Skip to content

Commit 7bd419c

Browse files
OhadAssulinclaude
andcommitted
chore: release 0.26.0
Update CHANGELOG, README, and bump all package versions to 0.26.0. Changes: - Update CHANGELOG.md with custom tools support and Codex default model - Add Custom Tools section to root README with comprehensive example - Copy updated README to core package for npm distribution - Bump version to 0.26.0 across all packages - Update peer dependencies to @headless-coder-sdk/core@^0.26.0 This release includes custom tools infrastructure, Claude adapter automatic MCP server conversion, and Codex adapter default model update to gpt-5.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 51cec58 commit 7bd419c

File tree

9 files changed

+156
-9
lines changed

9 files changed

+156
-9
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [0.26.0] - 2025-12-13
4+
### ✨ Custom Tools Support
5+
- Added comprehensive custom tools infrastructure following Claude Agent SDK patterns.
6+
- Core package now includes `tool()`, `createMCPServer()`, and helper utilities for creating custom tools with type-safe schemas.
7+
- New types: `ToolDefinition`, `ToolHandler`, `ToolResult`, `MCPServer`, and `ToolInputSchema` for unified tool creation across adapters.
8+
- Claude adapter gained automatic MCP server conversion, bridging generic tools to Claude Agent SDK format seamlessly.
9+
- Export `getToolName()` and `getServerToolNames()` helpers to simplify tool name management (format: `mcp__{server}__{tool}`).
10+
- Enhanced `StartOpts.mcpServers` and `StartOpts.allowedTools` documentation with clear patterns and examples.
11+
- Added comprehensive examples: `claude-custom-tools.test.ts` (weather, calculator, formatter tools with streaming) and `custom-tools-simple.ts`.
12+
13+
### 🛠 Codex Adapter
14+
- Default model is now `gpt-5.2` when no model is specified in `StartOpts`.
15+
- Exported `DEFAULT_MODEL` constant for easy reference.
16+
17+
### 📚 Documentation
18+
- Added `CLAUDE.md` at repository root with architecture, build commands, and development guidance for Claude Code instances.
19+
- Updated root README with custom tools examples.
20+
- Core package README now documents tool creation patterns.
21+
322
## [0.25.0] - 2025-11-25
423
### 📚 Adapter Guide & Provider Types
524
- Widened the `Provider`/`AdapterName` types so third-party adapters can use custom provider strings without casts.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,70 @@ In this workflow two reviewers (Claude, Codex) analyze the same commit in parall
235235

236236
---
237237

238+
## 🛠 Custom Tools (Claude)
239+
240+
The SDK provides a unified interface for creating custom tools that extend Claude's capabilities, following the Claude Agent SDK's MCP (Model Context Protocol) pattern:
241+
242+
```ts
243+
import { tool, createMCPServer, getToolName } from '@headless-coder-sdk/core';
244+
import { createHeadlessClaude } from '@headless-coder-sdk/claude-adapter';
245+
246+
// Define a custom tool
247+
const weatherTool = tool(
248+
'get_weather',
249+
'Get current temperature for a location using coordinates',
250+
{
251+
latitude: { type: 'number', description: 'Latitude coordinate' },
252+
longitude: { type: 'number', description: 'Longitude coordinate' }
253+
},
254+
async (args) => {
255+
const response = await fetch(
256+
`https://api.open-meteo.com/v1/forecast?latitude=${args.latitude}&longitude=${args.longitude}&current=temperature_2m&temperature_unit=fahrenheit`
257+
);
258+
const data = await response.json();
259+
260+
return {
261+
content: [{
262+
type: 'text',
263+
text: `Temperature: ${data.current.temperature_2m}°F`
264+
}]
265+
};
266+
}
267+
);
268+
269+
// Create an MCP server with your tools
270+
const weatherServer = createMCPServer({
271+
name: 'weather-tools',
272+
version: '1.0.0',
273+
tools: [weatherTool]
274+
});
275+
276+
// Use with Claude
277+
const claude = createHeadlessClaude({
278+
workingDirectory: process.cwd(),
279+
mcpServers: {
280+
'weather-tools': weatherServer
281+
},
282+
allowedTools: [getToolName('weather-tools', 'get_weather')],
283+
permissionMode: 'bypassPermissions'
284+
});
285+
286+
const thread = await claude.startThread();
287+
const result = await thread.run("What's the weather in San Francisco? (37.7749, -122.4194)");
288+
console.log(result.text);
289+
```
290+
291+
**Key Features:**
292+
- **Type-safe schemas** – Define input schemas with full TypeScript support
293+
- **Tool name management** – Use `getToolName(server, tool)` for proper MCP naming (`mcp__{server}__{tool}`)
294+
- **Selective permissions** – Control which tools Claude can use via `allowedTools`
295+
- **Streaming support** – Custom tools work seamlessly with `runStreamed()`
296+
- **Claude native** – Use Claude's native `tool()` and `createSdkMcpServer()` directly if preferred
297+
298+
See `examples/src/claude-custom-tools.test.ts` for comprehensive examples including calculator, formatter, and multi-tool workflows.
299+
300+
---
301+
238302
## ⚠️ Codex Adapter Runtime
239303

240304
- The Codex adapter talks directly to the Codex CLI through Node APIs and **must run on the server**. It is safe to import in build tooling, but gate runtime usage to environments where `process.versions.node` exists.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "headless-coder-sdk",
33
"private": true,
4-
"version": "0.25.0",
4+
"version": "0.26.0",
55
"type": "module",
66
"workspaces": [
77
"packages/*",

packages/acp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@headless-coder-sdk/acp-server",
3-
"version": "0.25.0",
3+
"version": "0.26.0",
44
"type": "module",
55
"scripts": {
66
"dev": "next dev -p 8000",

packages/claude-adapter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@headless-coder-sdk/claude-adapter",
3-
"version": "0.25.0",
3+
"version": "0.26.0",
44
"type": "module",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
@@ -24,7 +24,7 @@
2424
},
2525
"peerDependencies": {
2626
"@anthropic-ai/claude-agent-sdk": ">=0.1.50 <0.1.99",
27-
"@headless-coder-sdk/core": "^0.25.0"
27+
"@headless-coder-sdk/core": "^0.26.0"
2828
},
2929
"devDependencies": {
3030
"typescript": "^5.4.0",

packages/codex-adapter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@headless-coder-sdk/codex-adapter",
3-
"version": "0.25.0",
3+
"version": "0.26.0",
44
"type": "module",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
@@ -22,7 +22,7 @@
2222
"build": "tsup --config tsup.config.ts"
2323
},
2424
"peerDependencies": {
25-
"@headless-coder-sdk/core": "^0.25.0",
25+
"@headless-coder-sdk/core": "^0.26.0",
2626
"@openai/codex-sdk": ">=0.60.0 <0.80.0"
2727
},
2828
"devDependencies": {

packages/core/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,70 @@ In this workflow two reviewers (Claude, Codex) analyze the same commit in parall
235235

236236
---
237237

238+
## 🛠 Custom Tools (Claude)
239+
240+
The SDK provides a unified interface for creating custom tools that extend Claude's capabilities, following the Claude Agent SDK's MCP (Model Context Protocol) pattern:
241+
242+
```ts
243+
import { tool, createMCPServer, getToolName } from '@headless-coder-sdk/core';
244+
import { createHeadlessClaude } from '@headless-coder-sdk/claude-adapter';
245+
246+
// Define a custom tool
247+
const weatherTool = tool(
248+
'get_weather',
249+
'Get current temperature for a location using coordinates',
250+
{
251+
latitude: { type: 'number', description: 'Latitude coordinate' },
252+
longitude: { type: 'number', description: 'Longitude coordinate' }
253+
},
254+
async (args) => {
255+
const response = await fetch(
256+
`https://api.open-meteo.com/v1/forecast?latitude=${args.latitude}&longitude=${args.longitude}&current=temperature_2m&temperature_unit=fahrenheit`
257+
);
258+
const data = await response.json();
259+
260+
return {
261+
content: [{
262+
type: 'text',
263+
text: `Temperature: ${data.current.temperature_2m}°F`
264+
}]
265+
};
266+
}
267+
);
268+
269+
// Create an MCP server with your tools
270+
const weatherServer = createMCPServer({
271+
name: 'weather-tools',
272+
version: '1.0.0',
273+
tools: [weatherTool]
274+
});
275+
276+
// Use with Claude
277+
const claude = createHeadlessClaude({
278+
workingDirectory: process.cwd(),
279+
mcpServers: {
280+
'weather-tools': weatherServer
281+
},
282+
allowedTools: [getToolName('weather-tools', 'get_weather')],
283+
permissionMode: 'bypassPermissions'
284+
});
285+
286+
const thread = await claude.startThread();
287+
const result = await thread.run("What's the weather in San Francisco? (37.7749, -122.4194)");
288+
console.log(result.text);
289+
```
290+
291+
**Key Features:**
292+
- **Type-safe schemas** – Define input schemas with full TypeScript support
293+
- **Tool name management** – Use `getToolName(server, tool)` for proper MCP naming (`mcp__{server}__{tool}`)
294+
- **Selective permissions** – Control which tools Claude can use via `allowedTools`
295+
- **Streaming support** – Custom tools work seamlessly with `runStreamed()`
296+
- **Claude native** – Use Claude's native `tool()` and `createSdkMcpServer()` directly if preferred
297+
298+
See `examples/src/claude-custom-tools.test.ts` for comprehensive examples including calculator, formatter, and multi-tool workflows.
299+
300+
---
301+
238302
## ⚠️ Codex Adapter Runtime
239303

240304
- The Codex adapter talks directly to the Codex CLI through Node APIs and **must run on the server**. It is safe to import in build tooling, but gate runtime usage to environments where `process.versions.node` exists.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@headless-coder-sdk/core",
3-
"version": "0.25.0",
3+
"version": "0.26.0",
44
"description": "Unified SDK for headless AI coders (Codex, Claude, Gemini) with standardized threading, streaming, and sandboxing.",
55
"type": "module",
66
"main": "./dist/index.cjs",

packages/gemini-adapter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@headless-coder-sdk/gemini-adapter",
3-
"version": "0.25.0",
3+
"version": "0.26.0",
44
"type": "module",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
@@ -22,7 +22,7 @@
2222
"build": "tsup --config tsup.config.ts"
2323
},
2424
"peerDependencies": {
25-
"@headless-coder-sdk/core": "^0.25.0"
25+
"@headless-coder-sdk/core": "^0.26.0"
2626
},
2727
"devDependencies": {
2828
"typescript": "^5.4.0",

0 commit comments

Comments
 (0)