codex-worker 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/bin/codex-worker.mjs +9 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +579 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/core/failure-classifier.d.ts +2 -0
- package/dist/src/core/failure-classifier.js +70 -0
- package/dist/src/core/failure-classifier.js.map +1 -0
- package/dist/src/core/fleet-mode.d.ts +3 -0
- package/dist/src/core/fleet-mode.js +21 -0
- package/dist/src/core/fleet-mode.js.map +1 -0
- package/dist/src/core/ids.d.ts +1 -0
- package/dist/src/core/ids.js +5 -0
- package/dist/src/core/ids.js.map +1 -0
- package/dist/src/core/markdown.d.ts +5 -0
- package/dist/src/core/markdown.js +14 -0
- package/dist/src/core/markdown.js.map +1 -0
- package/dist/src/core/model-catalog.d.ts +21 -0
- package/dist/src/core/model-catalog.js +47 -0
- package/dist/src/core/model-catalog.js.map +1 -0
- package/dist/src/core/paths.d.ts +18 -0
- package/dist/src/core/paths.js +43 -0
- package/dist/src/core/paths.js.map +1 -0
- package/dist/src/core/profile-faults.d.ts +15 -0
- package/dist/src/core/profile-faults.js +110 -0
- package/dist/src/core/profile-faults.js.map +1 -0
- package/dist/src/core/profile-manager.d.ts +25 -0
- package/dist/src/core/profile-manager.js +162 -0
- package/dist/src/core/profile-manager.js.map +1 -0
- package/dist/src/core/store.d.ts +33 -0
- package/dist/src/core/store.js +184 -0
- package/dist/src/core/store.js.map +1 -0
- package/dist/src/core/types.d.ts +97 -0
- package/dist/src/core/types.js +2 -0
- package/dist/src/core/types.js.map +1 -0
- package/dist/src/daemon/client.d.ts +6 -0
- package/dist/src/daemon/client.js +117 -0
- package/dist/src/daemon/client.js.map +1 -0
- package/dist/src/daemon/server.d.ts +1 -0
- package/dist/src/daemon/server.js +176 -0
- package/dist/src/daemon/server.js.map +1 -0
- package/dist/src/daemon/service.d.ts +86 -0
- package/dist/src/daemon/service.js +973 -0
- package/dist/src/daemon/service.js.map +1 -0
- package/dist/src/doctor.d.ts +1 -0
- package/dist/src/doctor.js +28 -0
- package/dist/src/doctor.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/output.d.ts +9 -0
- package/dist/src/output.js +49 -0
- package/dist/src/output.js.map +1 -0
- package/dist/src/runtime/app-server.d.ts +44 -0
- package/dist/src/runtime/app-server.js +194 -0
- package/dist/src/runtime/app-server.js.map +1 -0
- package/dist/src/smoke.d.ts +1 -0
- package/dist/src/smoke.js +55 -0
- package/dist/src/smoke.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yigit Konur
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# codex-worker
|
|
2
|
+
|
|
3
|
+
`codex-worker` is a daemon-backed CLI for driving the official `codex app-server --listen stdio://` runtime from scripts, local automation, and long-running operator workflows.
|
|
4
|
+
|
|
5
|
+
It wraps the app-server protocol in a stable shell surface with local state, resumable threads, pending-request handling, and multi-profile failover.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node.js 22+
|
|
10
|
+
- `codex` CLI installed and authenticated
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Global install:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g codex-worker
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
One-off execution:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx codex-worker doctor
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
From source:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
node dist/src/cli.js --help
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## CLI Surface
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
codex-worker run <task.md>
|
|
38
|
+
codex-worker send <thread-id> <message.md>
|
|
39
|
+
codex-worker read <thread-id>
|
|
40
|
+
codex-worker logs <thread-id>
|
|
41
|
+
codex-worker thread start|resume|read|list
|
|
42
|
+
codex-worker turn start|steer|interrupt
|
|
43
|
+
codex-worker model list
|
|
44
|
+
codex-worker account read|rate-limits
|
|
45
|
+
codex-worker skills list
|
|
46
|
+
codex-worker app list
|
|
47
|
+
codex-worker request list|read|respond
|
|
48
|
+
codex-worker wait
|
|
49
|
+
codex-worker doctor
|
|
50
|
+
codex-worker daemon start|status|stop
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Common Flows
|
|
54
|
+
|
|
55
|
+
Start a file-backed task:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
codex-worker run task.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Resume a thread with a follow-up prompt:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
codex-worker send <thread-id> followup.md
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Read local thread state and recent transcript/log output:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
codex-worker read <thread-id>
|
|
71
|
+
codex-worker logs <thread-id>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Handle a pending approval or user-input request:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
codex-worker request list
|
|
78
|
+
codex-worker request read <request-id>
|
|
79
|
+
codex-worker request respond <request-id> --json '{"decision":"accept"}'
|
|
80
|
+
codex-worker request respond <request-id> --answer "yes"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## State And Environment
|
|
84
|
+
|
|
85
|
+
- Default state root: `~/.codex-worker`
|
|
86
|
+
- Preferred override: `CODEX_WORKER_STATE_DIR`
|
|
87
|
+
- Backward-compatible fallback override: `CLI_CODEX_WORKER_STATE_DIR`
|
|
88
|
+
- Profile discovery: `CODEX_HOME_DIRS` or `CODEX_HOME`
|
|
89
|
+
- Fleet toggle: `CODEX_ENABLE_FLEET=1`
|
|
90
|
+
|
|
91
|
+
When fleet mode is enabled, `codex-worker` appends a `[codex-worker:fleet]` suffix to outgoing developer instructions on thread start and resume paths.
|
|
92
|
+
|
|
93
|
+
## Development
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run build
|
|
97
|
+
npm test
|
|
98
|
+
npm run smoke
|
|
99
|
+
node --import tsx src/cli.ts --help
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`npm run smoke` exercises a live local flow against the installed `codex` binary.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const binDir = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const entrypointUrl = pathToFileURL(resolve(binDir, '../dist/src/cli.js')).href;
|
|
8
|
+
|
|
9
|
+
await import(entrypointUrl);
|