Skip to content

Commit 579987a

Browse files
committed
chore: release v0.13.0
1 parent a4ef720 commit 579987a

File tree

20 files changed

+1328
-51
lines changed

20 files changed

+1328
-51
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,19 @@ Open an [issue](https://github.com/OhadAssulin/headless-coder-sdk/issues) or sub
296296

297297
---
298298

299+
## 📦 Distribution Notes
300+
301+
- Every workspace now emits flattened entry points at `dist/*.js` (ESM) and `dist/*.cjs` (CommonJS), with `.d.ts` files sitting beside them for better editor support.
302+
- `package.json` is exposed via the exports map (`import '@headless-coder-sdk/core/package.json'`) for tooling that needs to inspect versions at runtime.
303+
- `@headless-coder-sdk/codex-adapter` forks a worker via `fileURLToPath(new URL('./worker.js', import.meta.url))`; keep `dist/worker.js` adjacent when rebundling so that child processes can spawn correctly.
304+
305+
---
306+
307+
## ✅ Smoke Tests
308+
309+
- `npm run smoke` builds every workspace, packs the publishable tarballs, installs them in a throwaway project, and exercises both CommonJS and ESM entry points.
310+
- Set `HEADLESS_CODER_KEEP_SMOKE_TMP=1 npm run smoke` if you want to inspect the generated smoke project instead of deleting it.
311+
312+
---
313+
299314
© 2025 Ohad Assulin - MIT License

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
"build": "node ./scripts/run-workspaces.mjs build",
1212
"lint": "eslint .",
1313
"test": "node ./scripts/run-workspaces.mjs test",
14+
"smoke": "node ./scripts/smoke-consumer.mjs",
1415
"acp:e2e": "npm run e2e --workspace packages/acp-server"
1516
},
1617
"devDependencies": {
1718
"@anthropic-ai/claude-agent-sdk": "^0.1.30",
1819
"@types/node": "^20.12.7",
20+
"tsup": "^8.5.0",
1921
"tsx": "^4.19.1",
2022
"typescript": "^5.4.0"
2123
}

packages/claude-adapter/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 headless-coder-sdk Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/claude-adapter/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# @headless-coder-sdk/claude-adapter
2+
3+
Anthropic Claude adapter for the Headless Coder SDK. It wraps `@anthropic-ai/claude-agent-sdk` behind the unified `createCoder`/`ThreadHandle` interface so you can swap providers without touching the rest of your agent logic.
4+
5+
## Installation
6+
7+
```bash
8+
npm install @headless-coder-sdk/core @headless-coder-sdk/claude-adapter @anthropic-ai/claude-agent-sdk
9+
```
10+
11+
## Usage
12+
13+
```ts
14+
import { registerAdapter, createCoder } from '@headless-coder-sdk/core';
15+
import { CODER_NAME as CLAUDE, createAdapter } from '@headless-coder-sdk/claude-adapter';
16+
17+
registerAdapter(CLAUDE, createAdapter);
18+
const coder = createCoder(CLAUDE, { permissionMode: 'bypassPermissions' });
19+
20+
const thread = await coder.startThread({ workingDirectory: process.cwd() });
21+
const result = await thread.run('Summarise the feature flag rollout plan.');
22+
console.log(result.text);
23+
```
24+
25+
> Heads up: the Anthropic SDK requires Node 18+. Make sure the `CLAUDE_API_KEY` environment variable is available before running the adapter.

packages/claude-adapter/package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
{
22
"name": "@headless-coder-sdk/claude-adapter",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"type": "module",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
7-
"files": [
8-
"dist"
9-
],
5+
"main": "./dist/index.cjs",
6+
"module": "./dist/index.js",
7+
"types": "./dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/index.js",
12+
"require": "./dist/index.cjs"
13+
},
14+
"./package.json": "./package.json"
15+
},
16+
"files": ["dist", "README.md", "LICENSE"],
1017
"scripts": {
11-
"build": "tsc -p tsconfig.build.json"
18+
"build": "tsup --config tsup.config.ts"
1219
},
1320
"peerDependencies": {
1421
"@anthropic-ai/claude-agent-sdk": "*",
15-
"@headless-coder-sdk/core": "^0.12.0"
22+
"@headless-coder-sdk/core": "^0.13.0"
1623
},
1724
"devDependencies": {
1825
"typescript": "^5.4.0",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { defineConfig } from 'tsup';
2+
3+
export default defineConfig({
4+
entry: {
5+
index: 'src/index.ts',
6+
},
7+
format: ['esm', 'cjs'],
8+
dts: true,
9+
sourcemap: true,
10+
clean: true,
11+
splitting: false,
12+
treeshake: false,
13+
minify: false,
14+
target: 'node18',
15+
platform: 'node',
16+
tsconfig: 'tsconfig.build.json',
17+
outDir: 'dist',
18+
outExtension({ format }) {
19+
return { js: format === 'esm' ? '.js' : '.cjs' };
20+
},
21+
});

packages/codex-adapter/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 headless-coder-sdk Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/codex-adapter/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# @headless-coder-sdk/codex-adapter
2+
3+
Adapter that bridges the OpenAI Codex CLI/SDK into the Headless Coder SDK interface.
4+
5+
## Installation
6+
7+
```bash
8+
npm install @headless-coder-sdk/core @headless-coder-sdk/codex-adapter
9+
```
10+
11+
## Usage
12+
13+
```ts
14+
import { registerAdapter, createCoder } from '@headless-coder-sdk/core';
15+
import { CODER_NAME as CODEX, createAdapter } from '@headless-coder-sdk/codex-adapter';
16+
17+
registerAdapter(CODEX, createAdapter);
18+
const coder = createCoder(CODEX, { workingDirectory: process.cwd() });
19+
const thread = await coder.startThread();
20+
const turn = await thread.run('Write unit tests for the git helper.');
21+
console.log(turn.text);
22+
```
23+
24+
## Worker placement
25+
26+
- The adapter forks a worker via `fileURLToPath(new URL('./worker.js', import.meta.url))`.
27+
- A transpiled `dist/worker.js` **must remain adjacent** to the published entry file. If you bundle the adapter, copy the worker into the final output directory or configure your bundler to emit it as an asset.
28+
- When packaging custom builds (Electron, webpack, etc.), keep the relative path stable or provide your own thin wrapper that adjusts `WORKER_PATH` before registering the adapter.
29+
30+
The published package already includes the worker alongside the JS/typings outputs; the guidance above is to prevent third-party bundlers from tree-shaking or relocating it.
Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
{
22
"name": "@headless-coder-sdk/codex-adapter",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"type": "module",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
5+
"main": "./dist/index.cjs",
6+
"module": "./dist/index.js",
7+
"types": "./dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/index.js",
12+
"require": "./dist/index.cjs"
13+
},
14+
"./worker": {
15+
"types": "./dist/worker.d.ts",
16+
"import": "./dist/worker.js",
17+
"require": "./dist/worker.cjs"
18+
},
19+
"./package.json": "./package.json"
20+
},
721
"files": [
8-
"dist"
22+
"dist",
23+
"README.md",
24+
"LICENSE"
925
],
1026
"scripts": {
11-
"build": "tsc -p tsconfig.build.json"
27+
"build": "tsup --config tsup.config.ts"
1228
},
1329
"peerDependencies": {
14-
"@headless-coder-sdk/core": "^0.12.0",
15-
"@openai/codex-sdk": "*"
30+
"@headless-coder-sdk/core": "^0.13.0",
31+
"@openai/codex-sdk": "^0.57.0"
1632
},
1733
"devDependencies": {
1834
"typescript": "^5.4.0",
19-
"@headless-coder-sdk/core": "workspace:*"
35+
"@headless-coder-sdk/core": "workspace:*",
36+
"@openai/codex-sdk": "^0.57.0"
2037
}
2138
}

0 commit comments

Comments
 (0)