Commit graph

6 commits

Author SHA1 Message Date
JerrettDavis
ebc7158de2 test(sdk/ts): add HEADROOM_WORKSPACE_DIR precedence tests for derived helpers
Mirrors the Python coverage gap closure: every derived-only helper
(memoryDbPath, nativeMemoryDir, logDir, rtkPath, beaconLockPath,
pluginConfigDir, etc.) now has both a default test and an override test
that exercises the canonical workspace env var end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 19:59:38 -05:00
JerrettDavis
028e2c0c1b feat(sdk/ts): add paths module with HEADROOM_CONFIG_DIR / HEADROOM_WORKSPACE_DIR parity
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 19:16:00 -05:00
Adib Mohsin
cdb721a713 typescript coverage 2026-04-06 21:24:36 +06:00
chopratejas
284f6d0a09 Fix Vercel AI SDK v6 format: use input/output instead of args/result
- ToolCallPart: read `input` (v6) with fallback to `args` (legacy) in vercelToOpenAI
- ToolCallPart: produce `input` instead of `args` in openAIToVercel
- ToolResultPart: produce `output: { type, value }` instead of `result` in openAIToVercel
- ToolResultPart: read `output` (v6) with fallback to `result` (legacy) in vercelToOpenAI
- Add MDX example tests: verify every code sample from PR docs against real APIs
- 116 tests passing (unit + integration + e2e with OpenAI + Anthropic)
2026-03-26 18:04:07 -07:00
chopratejas
7d3f09f028 Make compress() format-aware: auto-detect OpenAI, Anthropic, Vercel, Gemini
- compress() now accepts messages in any of 4 formats and returns the same format
- Format detection is structural: Gemini (parts field), Vercel (tool-call hyphen),
  Anthropic (tool_use underscore), OpenAI (tool_calls field)
- Added converters: anthropicToOpenAI, geminiToOpenAI, and their inverses
- Updated openAIToVercel to produce AI SDK v6 output format (output: {type, value})
- E2E tested with real Vercel AI SDK + OpenAI gpt-4o-mini + Anthropic claude-haiku-4-5
- headroomMiddleware() proven working: transparently compresses before LLM call
- 14 format detection unit tests, 5 format integration tests, 3 Vercel AI SDK e2e tests
2026-03-26 17:06:54 -07:00
chopratejas
72e65148d2 Add TypeScript SDK (headroom-ai npm package)
- New `compress()` function: HTTP client calling POST /v1/compress on the proxy
- HeadroomClient: reusable client with retry, fallback, auth support
- Vercel AI SDK adapter: headroomMiddleware() for wrapLanguageModel()
- OpenAI SDK adapter: withHeadroom() Proxy wrapper
- Anthropic SDK adapter: withHeadroom() Proxy wrapper
- Format converters: Vercel AI SDK ↔ OpenAI message format round-trip
- POST /v1/compress proxy endpoint: compression without LLM call
- 90 TypeScript tests (84 unit + 6 integration) + 9 Python tests
- Zero runtime dependencies, all framework peers optional
- Updated README, proxy docs, integration guide, and 6 other doc pages
- New docs/typescript-sdk.md with full SDK documentation
- Removed docs/superpowers/ from tracking (.gitignore)
2026-03-26 15:41:56 -07:00