@usulpro/codex-bee 0.1.1 → 0.1.3
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/README.md +22 -109
- package/dist/cli.js +230 -439
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# codex-bee
|
|
2
2
|
|
|
3
|
-
`codex-bee` is an autonomous wrapper around Codex CLI. The goal is to keep the standard Codex terminal experience intact while adding opt-in continuation modes driven by Stop hooks.
|
|
3
|
+
`codex-bee` is an autonomous wrapper around Codex CLI. The goal is to keep the standard Codex terminal experience intact while adding opt-in continuation modes driven by Stop hooks and configured from the live control UI.
|
|
4
4
|
|
|
5
5
|
When installed globally, the command surface is `bee`.
|
|
6
6
|
|
|
@@ -19,12 +19,12 @@ bee codex [codex args]
|
|
|
19
19
|
The wrapper also accepts the explicit separator form:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
bee [
|
|
22
|
+
bee [bee options] -- <command> [command args]
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Status
|
|
26
26
|
|
|
27
|
-
The interactive PTY baseline is live. The wrapper now boots Codex inside a PTY, keeps the normal terminal workflow visible to the user, validates the effective `codex_hooks` feature and required `SessionStart` / `UserPromptSubmit` / `Stop` hook config before starting an interactive Codex session, can bootstrap the global `~/.codex/hooks.json` hook file when it is missing, writes hook captures back into the live session workspace even when the hook script comes from a global install, surfaces a truthful early session state by moving from `Hooks ready` to `Connected` on `SessionStart` and to a running turn on `UserPromptSubmit`,
|
|
27
|
+
The interactive PTY baseline is live. The wrapper now boots Codex inside a PTY, keeps the normal terminal workflow visible to the user, validates the effective `codex_hooks` feature and required `SessionStart` / `UserPromptSubmit` / `Stop` hook config before starting an interactive Codex session, can bootstrap the global `~/.codex/hooks.json` hook file when it is missing, writes hook captures back into the live session workspace even when the hook script comes from a global install, surfaces a truthful early session state by moving from `Hooks ready` to `Connected` on `SessionStart` and to a running turn on `UserPromptSubmit`, stages continuation prompts and guardrails from the in-session UI instead of startup CLI flags, renders prompt templates from hook payload data on each matched turn, injects continuation text through bracketed paste so multiline prompts stay intact, and records runtime events for overlay and watcher activity.
|
|
28
28
|
|
|
29
29
|
## Project goals
|
|
30
30
|
|
|
@@ -93,7 +93,7 @@ The repository now pins the development floor with [`.nvmrc`](/home/usulpro/proj
|
|
|
93
93
|
- The IPC mechanism is still intentionally undecided until the baseline experiments validate env propagation, process tree behavior, and hook payload shape.
|
|
94
94
|
- Prefer live hook experiments inside the disposable sandbox harness during development, but interactive `bee codex ...` runs now validate and can bootstrap the global `~/.codex/hooks.json` hook file plus the effective `codex_hooks` feature when you launch outside the sandbox.
|
|
95
95
|
- When auto-continue is disabled and stdin/stdout are not TTYs, `bee codex ...` now falls back to direct inherited-stdio passthrough instead of failing on the PTY requirement. This keeps commands such as `bee codex --help` and `bee codex exec ...` usable in non-interactive environments.
|
|
96
|
-
-
|
|
96
|
+
- The public `bee` CLI is intentionally minimal now: only `--help` and `--version` belong to the wrapper itself. Continuation prompts, guardrails, and verification commands are configured from the live UI after launch.
|
|
97
97
|
|
|
98
98
|
## Packaging
|
|
99
99
|
|
|
@@ -263,44 +263,18 @@ cd "$CODEX_BEE_SANDBOX_DIR"
|
|
|
263
263
|
./bee codex --profile codex_bee_live
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
Current continuation flow is UI-driven:
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
`--continue-once` now defaults to zero extra delay after the matched Stop capture. Keep `--inject-delay-ms` only as a debug override for edge-case PTY timing experiments.
|
|
274
|
-
|
|
275
|
-
Repeat continuation loop smoke run with a three-injection guardrail:
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
279
|
-
./bee --continue-loop "Reply with NEXT only and stop." --max-continues 3 codex --profile codex_bee_live --no-alt-screen "Reply with FIRST only and stop."
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
`--continue-loop` reuses the same follow-up prompt after each matched Stop event and stops injecting automatically after `--max-continues` is reached.
|
|
283
|
-
|
|
284
|
-
Bee-agent loop smoke run through the wrapper:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
288
|
-
./bee --continue-loop-agent-file prompts/bee-agent-demo.json --max-continues 2 codex --profile codex_bee_live --no-alt-screen "Reply with FIRST only and stop."
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Expected demo sequence with the seeded sandbox bee-agent prompts:
|
|
292
|
-
|
|
293
|
-
- `FIRST`
|
|
294
|
-
- bee-agent generates `Reply with SECOND only and stop.`
|
|
295
|
-
- `SECOND`
|
|
296
|
-
- bee-agent generates `Reply with THIRD only and stop.`
|
|
297
|
-
- `THIRD`
|
|
268
|
+
- launch `./bee codex --profile codex_bee_live`
|
|
269
|
+
- wait for `Hooks ready` and then `Connected`
|
|
270
|
+
- press `Ctrl+B` to open the Bee screen
|
|
271
|
+
- type the continuation prompt in the composer and submit it to arm static continuation
|
|
272
|
+
- use slash commands such as `/steps-count 3`, `/duration 90`, `/sleep 23:30`, and `/stop-script pnpm typecheck` to change guardrails and the optional verification command for the live session
|
|
298
273
|
|
|
299
274
|
After the run:
|
|
300
275
|
|
|
301
276
|
```bash
|
|
302
277
|
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
303
|
-
./bee-inspect-agent-state
|
|
304
278
|
./bee-inspect-events
|
|
305
279
|
./bee-inspect-transcript
|
|
306
280
|
```
|
|
@@ -313,11 +287,12 @@ Use this profile for PTY-focused experiments so the session has the same interac
|
|
|
313
287
|
|
|
314
288
|
Current overlay capabilities:
|
|
315
289
|
|
|
316
|
-
- edit the static continuation prompt, including multiline content
|
|
290
|
+
- stage or edit the static continuation prompt, including multiline content
|
|
317
291
|
- arm auto-continue directly from the overlay
|
|
318
292
|
- change the repeat guardrail
|
|
319
293
|
- change the session-duration guardrail with values like `90m`, `1.5h`, `5400s`, or `off`
|
|
320
294
|
- disable auto-continue without restarting Codex
|
|
295
|
+
- show truthful hook/session state as it moves from preflight readiness to a proven attached Codex session
|
|
321
296
|
|
|
322
297
|
The overlay now uses the terminal alternate screen buffer so closing it can restore the previous Codex view instead of forcing a redraw guess.
|
|
323
298
|
|
|
@@ -368,30 +343,23 @@ Example review recording for the current bee-agent checkpoint:
|
|
|
368
343
|
|
|
369
344
|
```bash
|
|
370
345
|
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
371
|
-
./bee-record-review --label
|
|
346
|
+
./bee-record-review --label ui-session codex --profile codex_bee_live
|
|
372
347
|
```
|
|
373
348
|
|
|
374
349
|
This still requires a human to visually judge redraw and terminal fidelity, but it now leaves a consistent artifact bundle behind for later inspection instead of relying on memory and ad-hoc screenshots.
|
|
375
350
|
|
|
376
|
-
|
|
351
|
+
The older same-sandbox concurrency launcher is currently deprecated because it depended on the removed startup continuation flags. Leave it in the sandbox only as a reminder that a UI-driven replacement review flow still needs to be rebuilt.
|
|
352
|
+
|
|
353
|
+
If you want to inspect the deprecated harness entry point:
|
|
377
354
|
|
|
378
355
|
```bash
|
|
379
356
|
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
380
357
|
./bee-record-parallel-review --label same-sandbox
|
|
381
358
|
```
|
|
382
359
|
|
|
383
|
-
This launches two wrapper sessions in parallel from the same sandbox root:
|
|
384
|
-
|
|
385
|
-
- left: `ALPHA-FIRST -> ALPHA-SECOND`
|
|
386
|
-
- right: `BETA-FIRST -> BETA-SECOND`
|
|
387
|
-
|
|
388
|
-
The review bundle includes separate terminal recordings, shared runtime events, copied Stop captures, and a `parallel-summary.json` token check so you can confirm that each wrapper continued only its own session.
|
|
389
|
-
|
|
390
360
|
## Continuation prompt templates
|
|
391
361
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
File-based continuation templates are validated before Codex starts and re-read on every matched Stop event. The PTY injection path now uses bracketed paste, so multiline template files can be submitted as one logical prompt instead of breaking on the first newline.
|
|
362
|
+
Continuation prompts submitted from the UI can include `{{placeholder}}` tokens. The wrapper renders those tokens from the matched Stop capture immediately before each injected prompt, so the rendered prompt can change from turn to turn without adding a second model call.
|
|
395
363
|
|
|
396
364
|
Supported placeholders:
|
|
397
365
|
|
|
@@ -417,49 +385,15 @@ Safer helpers for previous assistant content:
|
|
|
417
385
|
- `{{last_assistant_message_json}}`: emits a JSON string literal of the raw message, useful when you need newline-safe quoting
|
|
418
386
|
- `{{last_assistant_message_excerpt}}`: emits a single-line excerpt capped at 280 characters
|
|
419
387
|
|
|
420
|
-
Example
|
|
388
|
+
Example static prompt text to submit from the Bee composer:
|
|
421
389
|
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
./bee --continue-loop "Reply with TRACE: {{last_assistant_message}} only and stop." --max-continues 3 codex --profile codex_bee_live --no-alt-screen "Reply with FIRST only and stop."
|
|
390
|
+
```text
|
|
391
|
+
Reply with TRACE: {{last_assistant_message_single_line}} only and stop.
|
|
425
392
|
```
|
|
426
393
|
|
|
427
|
-
Expected sequence:
|
|
428
|
-
|
|
429
|
-
- `FIRST`
|
|
430
|
-
- `TRACE: FIRST`
|
|
431
|
-
- `TRACE: TRACE: FIRST`
|
|
432
|
-
- `TRACE: TRACE: TRACE: FIRST`
|
|
433
|
-
|
|
434
|
-
Example one-shot prompt that is safer for multiline previous answers:
|
|
435
|
-
|
|
436
|
-
```bash
|
|
437
|
-
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
438
|
-
./bee --continue-once "Reply with SAFE {{last_assistant_message_single_line}} only and stop." codex --profile codex_bee_live --no-alt-screen "Reply with exactly two lines: FIRST and SECOND. Stop after that."
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
Example multiline template file workflow:
|
|
442
|
-
|
|
443
|
-
```bash
|
|
444
|
-
cat >/tmp/codex-bee-follow-up.txt <<'EOF'
|
|
445
|
-
Reply with the exact token from the next line only.
|
|
446
|
-
SECOND-LINE
|
|
447
|
-
Stop after that.
|
|
448
|
-
EOF
|
|
449
|
-
|
|
450
|
-
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
451
|
-
./bee --continue-once-file /tmp/codex-bee-follow-up.txt codex --profile codex_bee_live --no-alt-screen "Reply with READY only and stop."
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
Expected sequence:
|
|
455
|
-
|
|
456
|
-
- `READY`
|
|
457
|
-
- file-based continuation is injected as a single multiline prompt
|
|
458
|
-
- `SECOND-LINE`
|
|
459
|
-
|
|
460
394
|
## Verification-command gate
|
|
461
395
|
|
|
462
|
-
|
|
396
|
+
`/stop-script <command>` adds a simple mechanical gate on top of any continuation mode.
|
|
463
397
|
|
|
464
398
|
Current behavior:
|
|
465
399
|
|
|
@@ -468,32 +402,11 @@ Current behavior:
|
|
|
468
402
|
- if the command exits with a non-zero code, auto-continue keeps going and appends a verification summary to the next injected prompt
|
|
469
403
|
- the appended summary includes the command text, exit code, and tail excerpts from `stderr` and `stdout`
|
|
470
404
|
|
|
471
|
-
Example loop that keeps Codex working until `pnpm typecheck` passes:
|
|
472
|
-
|
|
473
|
-
```bash
|
|
474
|
-
cd "$CODEX_BEE_SANDBOX_DIR"
|
|
475
|
-
./bee --continue-loop "Continue fixing the verification failure." --verify-command "pnpm typecheck" --max-continues 5 codex --profile codex_bee_live --no-alt-screen "Find and fix the type errors, then stop."
|
|
476
|
-
```
|
|
477
|
-
|
|
478
405
|
This is intentionally a lightweight alternative to bee-agent orchestration. It gives the wrapper a deterministic continue-or-stop signal without requiring a second model call.
|
|
479
406
|
|
|
480
407
|
## Bee-agent continuation mode
|
|
481
408
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
Bee-agent config files are JSON and resolve prompt paths relative to the config file directory:
|
|
485
|
-
|
|
486
|
-
```json
|
|
487
|
-
{
|
|
488
|
-
"systemPromptPath": "bee-agent-system.md",
|
|
489
|
-
"sessionPromptPath": "bee-agent-session.md",
|
|
490
|
-
"model": "gpt-5.4",
|
|
491
|
-
"maxRecentMessages": 6,
|
|
492
|
-
"maxNoteChars": 4000,
|
|
493
|
-
"maxObjectiveChars": 1500,
|
|
494
|
-
"maxLastAssistantChars": 4000
|
|
495
|
-
}
|
|
496
|
-
```
|
|
409
|
+
Bee-agent plumbing still exists in the codebase, but it is not part of the minimal public launch contract right now. Treat it as internal implementation surface until the current TUI exposes it again in a deliberate way.
|
|
497
410
|
|
|
498
411
|
Current bounded bee-agent context includes:
|
|
499
412
|
|