This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Run all tests
composer test
# Run a single test file
vendor/bin/pest tests/Feature/RecordingsResourceTest.php
# Run a specific test
vendor/bin/pest --filter "test name here"
# Static analysis (PHPStan level 5)
composer analyse
# Code formatting (Laravel Pint)
composer format
# Test with coverage
composer test-coverageThis is a Laravel SDK for the Pocket API (https://public.heypocketai.com). It provides a fluent interface for accessing recordings, transcripts, summaries, and action items.
-
Pocket(src/Pocket.php): Main entry point, creates and manages resource instances. Instantiated viaPocket::fromConfig()or constructor. -
PocketClient(src/PocketClient.php): HTTP client wrapper using Guzzle. Handles authentication (Bearer token), request building, retry logic with exponential backoff, and exception mapping. -
PocketServiceProvider(src/PocketServiceProvider.php): Laravel service provider using Spatie's package-tools. RegistersPocketas a singleton.
Resources in src/Resources/ encapsulate API endpoints:
RecordingsResource- recordings endpoint with filtering, pagination, and automatic iteration via generatorsFoldersResource- folders endpointTagsResource- tags endpoint
DTOs in src/Data/ represent API responses:
Recording,Folder,Tag- core entitiesTranscript,TranscriptSegment- transcript dataSummary,SummarySection- summary dataActionItem- action items with priority/status enumsPaginatedRecordings,Pagination- pagination handling
All DTOs have a static fromArray() factory method and implement Arrayable/JsonSerializable.
src/Enums/ contains backed enums for typed values:
RecordingState- processing states (pending, transcribing, completed, etc.)ActionItemPriority- priority levelsActionItemStatus- completion status
src/Exceptions/ maps HTTP status codes to specific exceptions:
AuthenticationException(401)NotFoundException(404)RateLimitException(429) - includesgetRetryAfter()ValidationException(400) - includesgetDetails()ServerException(5xx)PocketException- base class
Uses Pest with Orchestra Testbench. Tests are organized as:
tests/Feature/- integration tests for resources and error handlingtests/Unit/- unit tests for DTOs and enumstests/ArchTest.php- architecture tests
The MocksHttpResponses trait (tests/Helpers/) provides utilities for mocking Guzzle responses using MockHandler.