- Fixed major bug where tool descriptions were never sent to the LLM (!!) - A large variety of making server errors recoverable - Thinking traces now appear for OpenAI models
2.4 KiB
2.4 KiB
Repository Guidelines
Project Structure & Module Organization
src/: TypeScript sources. Key files:main.ts(CLI entry),anthropic-proxy.ts(HTTP proxy),convert-*.ts(format converters),detect-mimetype.ts,json-schema.ts.dist/: Bundled CLI entrymain.js(created by build).package.json,bun.lock: Bun-based build and deps;bin.anyclaudepoints todist/main.js.flake.nix,.envrc: Nix/direnv developer shell and formatters.- Assets/config:
README.md,CLAUDE.md,tsconfig.json,demo.png.
Build, Test, and Development Commands
- Install:
bun install. - Build:
bun run build(outputsdist/main.jswith Node shebang). - Run CLI (after build):
./dist/main.js --model openai/gpt-5-mini. - Dev run (no build):
PROXY_ONLY=true bun run src/main.ts(prints proxy URL)OPENAI_API_KEY=... bun run src/main.ts --model openai/gpt-5-mini
- Nix shell:
direnv allow(ornix develop); format Nix/shell files withnix fmt.
Coding Style & Naming Conventions
- Language: TypeScript (ESNext, strict mode enabled).
- Indentation: 2 spaces; keep lines reasonable; use explicit imports (
verbatimModuleSyntax). - Files: kebab-case
.ts(e.g.,convert-to-anthropic-stream.ts). - Names:
camelCasefor variables/functions;PascalCasefor types/classes. - Exports: prefer named exports; keep modules single‑purpose and small.
Testing Guidelines
- No test runner is configured yet. If adding tests:
- Place under
src/**/*.test.tsorsrc/__tests__/. - Prioritize pure units (converters, schema, MIME detection). Avoid live provider calls by default; gate with env vars.
- Add a
testscript inpackage.jsonand document how to run it inREADME.md.
- Place under
Commit & Pull Request Guidelines
- Commits: imperative, concise subjects (e.g., "Add Nix development environment and Claude guidance file"). Include rationale in the body when helpful.
- PRs: clear description, linked issues, commands used to verify (with relevant env vars), and expected behavior. Avoid committing secrets; scrub logs.
- Keep scope small; update
README.md/CLAUDE.mdwhen behavior or env vars change.
Security & Configuration Tips
- Never commit API keys. Use
direnvfor local secrets and keep.envrcminimal. - Provider envs:
OPENAI_*,GOOGLE_*,XAI_*,AZURE_*, optionalANTHROPIC_*. UsePROXY_ONLY=trueto inspect the proxy without launching Claude.