TypeScript SDK for building AI agents with tool use, ReAct loop, and multi-provider support.
| Document | Purpose |
|---|---|
| Requirements | Feature requirements |
| Gap Analysis | vs Claude Agent SDK |
| ADRs | Architecture decisions |
| Git Workflow | Worktree & PR rules |
| Testing Guide | TDD & env setup |
open-agent-sdk/
├── CLAUDE.md # This file: Claude Code context
├── package.json # Bun workspaces configuration
├── REQUIREMENTS.md # Product requirements
└── packages/
└── core/ # Core SDK package
├── src/
│ ├── index.ts # Public API exports
│ ├── types/ # Message, tool, provider types
│ ├── tools/ # Tool implementations
│ ├── providers/ # LLM provider adapters
│ ├── agent/ # ReAct loop, subagent system
│ ├── session/ # Session management
│ ├── permissions/ # Permission system
│ ├── skills/ # Skill loading system
│ └── hooks/ # Hooks framework
└── tests/ # Test files (mirror src/ structure)
- TypeScript 5.x (strict), Bun runtime
- Testing: Bun test framework
- Dependencies:
ai(Vercel AI SDK),@ai-sdk/google,zod
- Use TDD for: Core agent logic, tools, providers, permissions
- Tests after OK for: Utils, docs, config, obvious fixes
- Recommended for: Features, refactoring, experiments
- Optional for: Typo fixes, single-line fixes, hotfixes
- See Git Workflow
- Format:
type(scope): description(Conventional Commits) - Frequency: After each logical unit
- Language: English only
- Incremental: Break features into multiple commits
- Tests:
tests/(mirrorssrc/), e.g.,src/foo.ts→tests/foo.test.ts - Directories:
types/,tools/,providers/,agent/,session/,permissions/,skills/,hooks/
- Public APIs: Complete type definitions required
- Strict mode enforced
- Target: >80% overall, >90% core logic
- Integration tests need
.envwith API keys
Run tests with .env variables:
env $(cat .env | xargs) bun test- ✅ Fully compatible with Google native API
- Default model:
gemini-3-flash-preview
- ✅ Works with OpenAI API
- ✅ Compatible with DeepSeek, OpenRouter (via
baseURL) ⚠️ Gemini's OpenAI-compatible endpoint has limitations (missingindexfield in tool calls)- Workaround: Use Google Provider for Gemini models
- Claude Agent SDK TypeScript - Reference product API
- Claude Agent SDK V2 Preview - V2 interface design