diff --git a/.gitignore b/.gitignore index 3c97991..6eade5c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,10 +17,9 @@ venv/ .coverage htmlcov/ # .claude/ (AI-agent config: rules, agents, hooks, local state) and the root -# CLAUDE.md stay local. Per-library CLAUDE.md quickstarts remain tracked. +# CLAUDE.md stay local (root and per-library). .claude/ CLAUDE.md -!libraries/*/CLAUDE.md node_modules/ *.sqlite *.log diff --git a/libraries/python/CLAUDE.md b/libraries/python/CLAUDE.md deleted file mode 100644 index 47ea5d3..0000000 --- a/libraries/python/CLAUDE.md +++ /dev/null @@ -1,58 +0,0 @@ -# Python SDK — agent quickstart - -This file is the per-library guide for AI agents working in `libraries/python/`. For repo-wide rules, see [`AGENTS.md`](../../AGENTS.md) and [`CONTRIBUTING.md`](../../CONTRIBUTING.md). - -## Layout - -``` -libraries/python/ -├── pyproject.toml # package metadata, deps, pytest config -├── .env.example # env vars for local runs -├── README.md # user-facing quickstart -├── tests/ # pytest suite (unit / integration / security / soak) -│ └── conftest.py -└── getpatter/ # the published package (`pip install getpatter`) - ├── __init__.py - ├── client.py # Patter entry point - ├── cli.py # `getpatter` console-script entry point - ├── local_config.py # LocalOptions + local-mode config - ├── models.py # public dataclasses (frozen=True) - ├── exceptions.py # PatterError + ErrorCode enum - ├── pricing.py # PricingUnit enum + provider price tables - ├── server.py # FastAPI app - ├── stream_handler.py # per-call orchestrator - ├── telephony/ # Twilio + Telnyx + Plivo adapters (twilio.py / telnyx.py / plivo.py / common.py) - ├── carriers/ # carrier classes (twilio.py / telnyx.py / plivo.py) - ├── audio/ # transcoding, pcm_mixer, background_audio - ├── tools/ # tool_decorator, tool_executor - ├── providers/ # voice / LLM / STT / TTS provider adapters - ├── services/ # llm_loop, metrics, sentence_chunker, text_transforms, ivr, ... - ├── observability/ # event_bus + OTel tracing - ├── evals/ engines/ integrations/ # eval runner, engines, external integrations - ├── dashboard/ - ├── llm/ tts/ stt/ # public provider namespaces (env-var auto-resolve) - └── ... -``` - -## Daily commands - -```bash -cd libraries/python -pytest tests/ -v # all tests -pytest tests/ -m "not soak" -q # default CI run -pytest tests/test_client.py -v # one file -pip install -e ".[dev]" # editable install for development -``` - -## Conventions (project-wide, restated for convenience) - -- pytest with `asyncio_mode = "auto"` — write `async def test_*`, no decorator needed. -- Public dataclasses are `@dataclass(frozen=True)`. Tuples, not lists. -- Async I/O everywhere. `httpx.AsyncClient`, `websockets.connect`. No `time.sleep`. -- Logger: `logging.getLogger("getpatter")` — never `print()`. Sub-namespaces like `getpatter.providers.deepgram_stt` are used per-module. -- New config fields are optional with safe defaults (backward compat). -- Authentic tests: mock only at paid/external boundary, tag `@pytest.mark.mocked`. - -## Parity with TypeScript - -Every public feature in this SDK MUST exist in `libraries/typescript/` with the same defaults and error taxonomy. Run `/parity-check` before PR. diff --git a/libraries/typescript/CLAUDE.md b/libraries/typescript/CLAUDE.md deleted file mode 100644 index bb93e2e..0000000 --- a/libraries/typescript/CLAUDE.md +++ /dev/null @@ -1,58 +0,0 @@ -# TypeScript SDK — agent quickstart - -This file is the per-library guide for AI agents working in `libraries/typescript/`. For repo-wide rules, see [`AGENTS.md`](../../AGENTS.md) and [`CONTRIBUTING.md`](../../CONTRIBUTING.md). - -## Layout - -``` -libraries/typescript/ -├── package.json # npm pkg metadata, scripts, deps -├── tsconfig.json -├── tsup.config.ts # bundler config (esm + cjs + types) -├── vitest.config.ts # test runner config -├── .env.example -├── README.md # user-facing quickstart -├── tests/ # vitest suite (unit / integration / security / e2e / soak) -│ └── setup.ts -└── src/ # the published package (`npm install getpatter`) - ├── index.ts # public entry — re-exports - ├── client.ts # Patter entry point - ├── types.ts # public interfaces (readonly) - ├── errors.ts # PatterError + ErrorCode enum - ├── pricing.ts # PricingUnit + provider price tables - ├── server.ts # Express app - ├── stream-handler.ts # per-call lifecycle - ├── telephony/ # Twilio + Telnyx + Plivo adapters (twilio.ts / telnyx.ts / plivo.ts) - ├── carrier-config.ts # carrier audio/format config - ├── audio/ # transcoding, background-audio - ├── tools/ # tool-decorator - ├── providers/ # voice / LLM / STT / TTS provider adapters - ├── services/ # call-log, ivr (mostly top-level files in src/) - ├── observability/ - ├── dashboard/ - ├── llm/ tts/ stt/ # public provider namespaces (env-var auto-resolve) - └── ... -``` - -## Daily commands - -```bash -cd libraries/typescript -npm test # vitest run -npm run lint # tsc --noEmit -npm run build # tsup → dist/ -npx vitest tests/server.test.ts # one file -``` - -## Conventions (project-wide, restated for convenience) - -- Vitest, not jest. tsup, not tsc-build. npm, not pnpm/bun. -- Public interfaces use `readonly` on every field. `readonly T[]` for arrays. -- Async everywhere — return `Promise` for I/O. No `setTimeout` polling. -- Logger: `getLogger().info/warn/error` from `src/logger.ts`. Never bare `console.*` in library code. -- New config fields are optional with safe defaults (backward compat). -- Authentic tests: mock only at paid/external boundary, file suffix `*.mocked.test.ts`. - -## Parity with Python - -Every public feature in this SDK MUST exist in `libraries/python/` with the same defaults and error taxonomy. Naming maps `camelCase` ↔ `snake_case`. Run `/parity-check` before PR.