You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,20 @@
1
1
# Changelog
2
2
3
+
## [0.14.0] - 2025-11-10
4
+
### 🚀 Enhancements
5
+
- Added `createHeadlessCodex()` helper that auto-registers the adapter and returns a coder, reducing the boilerplate needed in most server runtimes.
6
+
- Codex adapter now enforces a Node-only runtime, guards worker spawns, and exposes the worker path via `new URL('./worker.js', import.meta.url)` so bundlers have a deterministic asset to copy.
7
+
- README docs call out the server-only requirement and provide lazy-loading snippets for frameworks like Next.js.
8
+
9
+
### 🛠 DX
10
+
- Added runtime guards/warnings that keep browser bundlers from crashing by tree-shaking the `child_process` fork when it’s unreachable.
11
+
3
12
## [0.13.1] - 2025-11-10
4
13
### ✨ Packaging & DX
5
14
- Core and every adapter now emit real entry points via `tsup`, producing both ESM (`dist/*.js`) and CommonJS (`dist/*.cjs`) bundles with colocated typings, so downstream apps can import the declared exports without diving into `dist/*/src` internals.
6
15
- Updated exports maps to expose `factory`, `types`, adapter workers, and `package.json`, unlocking better metadata discovery and `require()` support.
7
16
- Codex adapter gained a README that documents the worker co-location requirement, plus LICENSE files were added to every publishable package for npm completeness.
8
-
- Bumped `@openai/codex-sdk` to `0.57.0` and refreshed peer dependency ranges to `^0.13.0` across the adapters.
17
+
- Bumped `@openai/codex-sdk` to `0.57.0` and refreshed peer dependency ranges to `^0.14.0` across the adapters.
9
18
10
19
### 🧪 Tooling
11
20
- Added `npm run smoke`, which builds, packs, and installs the tarballs into a throwaway project to verify both CommonJS and ESM consumers and assert that the Codex worker ships beside the entry point.
const result =awaitthread.run('Write a hello world script');
49
46
console.log(result.text);
@@ -239,6 +236,38 @@ In this workflow two reviewers (Claude, Codex) analyze the same commit in parall
239
236
240
237
---
241
238
239
+
## ⚠️ Codex Adapter Runtime
240
+
241
+
- The Codex adapter forks worker processes via Node’s `child_process` API 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.
242
+
- A convenience helper, `createHeadlessCodex`, registers the adapter and returns a coder in one call:
const result =awaitthread.run('List recent commits');
265
+
returnResponse.json({ text: result.text });
266
+
}
267
+
```
268
+
269
+
---
270
+
242
271
## ⚙️ Development
243
272
244
273
**Install**
@@ -299,6 +328,7 @@ Open an [issue](https://github.com/OhadAssulin/headless-coder-sdk/issues) or sub
299
328
## 📦 Distribution Notes
300
329
301
330
- 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.
331
+
- You can import `createCoder` or helper utilities directly from `@headless-coder-sdk/core` and `@headless-coder-sdk/codex-adapter` without deep `dist/*/src` paths—the `main`/`module` fields now point at those root files.
302
332
-`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
333
-`@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.
const turn =awaitthread.run('Write unit tests for the git helper.');
21
23
console.log(turn.text);
22
24
```
23
25
26
+
`createHeadlessCodex` registers the adapter (if necessary) and returns a coder in one call so you no longer have to wire up `registerAdapter` manually.
27
+
28
+
## Next.js / server frameworks
29
+
30
+
The adapter forks worker processes via Node’s `child_process`, so keep it on the server:
31
+
32
+
```ts
33
+
exportasyncfunction POST() {
34
+
if (typeofwindow!=='undefined') {
35
+
thrownewError('Codex adapter must run on the server');
0 commit comments