greprag 5.60.3 → 5.60.5
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/dist/codex-chip-hooks.d.ts +2 -7
- package/dist/codex-chip-hooks.js +25 -159
- package/dist/codex-chip-hooks.js.map +1 -1
- package/dist/codex-steering.d.ts +2 -1
- package/dist/codex-steering.js +8 -5
- package/dist/codex-steering.js.map +1 -1
- package/dist/commands/codex-chip/bootstrap.d.ts +8 -0
- package/dist/commands/codex-chip/bootstrap.js +103 -0
- package/dist/commands/codex-chip/bootstrap.js.map +1 -0
- package/dist/commands/codex-chip/breakthrough-command.js +0 -7
- package/dist/commands/codex-chip/breakthrough-command.js.map +1 -1
- package/dist/commands/codex-chip/cleanup-command.js +1 -9
- package/dist/commands/codex-chip/cleanup-command.js.map +1 -1
- package/dist/commands/codex-chip/command.js +5 -63
- package/dist/commands/codex-chip/command.js.map +1 -1
- package/dist/commands/codex-chip/git.d.ts +0 -1
- package/dist/commands/codex-chip/git.js +0 -2
- package/dist/commands/codex-chip/git.js.map +1 -1
- package/dist/commands/codex-chip/goals.d.ts +9 -0
- package/dist/commands/codex-chip/goals.js +54 -7
- package/dist/commands/codex-chip/goals.js.map +1 -1
- package/dist/commands/codex-chip/help.d.ts +1 -1
- package/dist/commands/codex-chip/help.js +13 -24
- package/dist/commands/codex-chip/help.js.map +1 -1
- package/dist/commands/codex-chip/model.d.ts +2 -4
- package/dist/commands/codex-chip/model.js +1 -1
- package/dist/commands/codex-chip/model.js.map +1 -1
- package/dist/commands/codex-chip/naming.js +4 -10
- package/dist/commands/codex-chip/naming.js.map +1 -1
- package/dist/commands/codex-chip/native.js +11 -15
- package/dist/commands/codex-chip/native.js.map +1 -1
- package/dist/commands/codex-chip/prompt.d.ts +2 -1
- package/dist/commands/codex-chip/prompt.js +15 -59
- package/dist/commands/codex-chip/prompt.js.map +1 -1
- package/dist/commands/codex-chip/resume-command.js +0 -3
- package/dist/commands/codex-chip/resume-command.js.map +1 -1
- package/dist/commands/codex-chip/selection.d.ts +1 -1
- package/dist/commands/codex-chip/selection.js +15 -59
- package/dist/commands/codex-chip/selection.js.map +1 -1
- package/dist/commands/codex-chip/worker.js +60 -122
- package/dist/commands/codex-chip/worker.js.map +1 -1
- package/dist/commands/codex-delivery.d.ts +32 -7
- package/dist/commands/codex-delivery.js +76 -92
- package/dist/commands/codex-delivery.js.map +1 -1
- package/dist/commands/codex-startup.js +1 -1
- package/dist/commands/codex-startup.js.map +1 -1
- package/dist/commands/codex.js +36 -34
- package/dist/commands/codex.js.map +1 -1
- package/dist/commands/friction-reminder.d.ts +9 -9
- package/dist/commands/friction-reminder.js +12 -17
- package/dist/commands/friction-reminder.js.map +1 -1
- package/dist/commands/inbox-primer-reminder.js +3 -3
- package/dist/commands/inbox-primer-reminder.js.map +1 -1
- package/dist/commands/init.js +7 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/load-primer-reminder.js +2 -2
- package/dist/commands/load-primer-reminder.js.map +1 -1
- package/dist/commands/load.js +28 -27
- package/dist/commands/load.js.map +1 -1
- package/dist/commands/mechanic-spawn.d.ts +10 -0
- package/dist/commands/mechanic-spawn.js +67 -0
- package/dist/commands/mechanic-spawn.js.map +1 -0
- package/dist/commands/mechanic.js +6 -0
- package/dist/commands/mechanic.js.map +1 -1
- package/dist/commands/opencode-chip-client.d.ts +8 -0
- package/dist/commands/opencode-chip-client.js +45 -0
- package/dist/commands/opencode-chip-client.js.map +1 -0
- package/dist/commands/opencode-chip-lifecycle.d.ts +2 -0
- package/dist/commands/opencode-chip-lifecycle.js +137 -0
- package/dist/commands/opencode-chip-lifecycle.js.map +1 -0
- package/dist/commands/opencode-chip-mission.d.ts +22 -0
- package/dist/commands/opencode-chip-mission.js +105 -0
- package/dist/commands/opencode-chip-mission.js.map +1 -0
- package/dist/commands/opencode-chip-store.d.ts +72 -0
- package/dist/commands/opencode-chip-store.js +141 -0
- package/dist/commands/opencode-chip-store.js.map +1 -0
- package/dist/commands/opencode-chip.d.ts +3 -0
- package/dist/commands/opencode-chip.js +488 -0
- package/dist/commands/opencode-chip.js.map +1 -0
- package/dist/commands/opencode-goals.d.ts +5 -0
- package/dist/commands/opencode-goals.js +83 -0
- package/dist/commands/opencode-goals.js.map +1 -0
- package/dist/hook.js +8 -3
- package/dist/hook.js.map +1 -1
- package/dist/index.js +11 -90
- package/dist/index.js.map +1 -1
- package/dist/opencode-plugin.bundle.js +9 -11
- package/package.json +1 -1
- package/skill/greprag/SKILL.md +2 -2
- package/skill/greprag/docs/codex-chip.md +20 -59
- package/skill/greprag/docs/setup.md +15 -21
- package/skill/templates/chip-bootloader.md +33 -91
- package/skill/templates/chip-leader-opencode.md +90 -75
- package/skill/templates/chip-leader.md +81 -221
- package/skill/templates/codex-chip-spawn.md +129 -173
- package/skill/templates/codex-subagent-spawn.md +32 -0
- package/dist/commands/codex-native-delivery.d.ts +0 -70
- package/dist/commands/codex-native-delivery.js +0 -285
- package/dist/commands/codex-native-delivery.js.map +0 -1
- package/skill/templates/reflex-chip.md +0 -58
- package/skill/templates/workshop-chip.md +0 -46
|
@@ -1,177 +1,133 @@
|
|
|
1
|
-
# Codex
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
# Codex Orchestration
|
|
2
|
+
|
|
3
|
+
Choose the smallest primitive that matches the work. This method is about
|
|
4
|
+
discoverable task shape; titles are coordination labels, not execution
|
|
5
|
+
authority.
|
|
6
|
+
|
|
7
|
+
## Identity first
|
|
8
|
+
|
|
9
|
+
For any coordinated multi-chip mission, rename the orchestrating task before
|
|
10
|
+
spawning children:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
LEAD: <Mission>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Then name children with the exact ordinal schema:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
Chip A: <Specific Purview>
|
|
20
|
+
Chip B: <Specific Purview>
|
|
21
|
+
Chip C: <Specific Purview>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
In quick mode, the current task renames itself `LEAD: <Mission>` and directly
|
|
25
|
+
spawns 1–2 children. It is the **implicit LEAD**; no separate leader task is
|
|
26
|
+
created. In Leader mode, the initiator creates a separate `LEAD: <Mission>`
|
|
27
|
+
task, and that LEAD spawns and manages the children.
|
|
28
|
+
|
|
29
|
+
## Three primitives
|
|
30
|
+
|
|
31
|
+
### 1. Internal subagent
|
|
32
|
+
|
|
33
|
+
Use this for ephemeral analysis, research, or bounded edits/tests that can stay
|
|
34
|
+
inside the current session. Load `greprag load codex-subagent-spawn` first.
|
|
35
|
+
|
|
36
|
+
- Same-session and short-lived; results return to the parent context.
|
|
37
|
+
- No worktree, durable task manifest, inbox identity, or goal is created.
|
|
38
|
+
- Keep the session bounded at `max_threads=6` and `max_depth=1`.
|
|
39
|
+
- `fast_scan` is read-only; `routine_worker` and `deep_worker` may make bounded
|
|
40
|
+
edits/tests in the parent workspace. The parent avoids overlapping writes and
|
|
41
|
+
owns integration.
|
|
42
|
+
- If the work needs a visible child, independent persistence, or its own
|
|
43
|
+
worktree, use a quick chip instead.
|
|
44
|
+
|
|
45
|
+
### 2. Quick chip
|
|
46
|
+
|
|
47
|
+
Use this for 1–2 visible, durable worktree tasks with one initiating parent.
|
|
48
|
+
The initiating task is the implicit LEAD after it renames itself; it may
|
|
49
|
+
dispatch `Chip A` and `Chip B` directly.
|
|
50
|
+
|
|
51
|
+
- Each child gets its own visible task and worktree.
|
|
52
|
+
- Children are writable ordinary chips. Do not add a read-only role, lease,
|
|
53
|
+
mandatory nested goal, or delivery-proof gate.
|
|
54
|
+
- Preserve the visible native task identity, isolated worktree, concise final
|
|
55
|
+
report, parent review/integration, and parent-owned archive + cleanup. Normal
|
|
56
|
+
completion is the native parent-child task result; `greprag send` remains
|
|
57
|
+
available for explicit cross-harness or peer messaging, but is not mandatory
|
|
58
|
+
chip ceremony.
|
|
59
|
+
|
|
60
|
+
### 3. Explicit Leader mission
|
|
61
|
+
|
|
62
|
+
Use this when the work is more than the quick 1–2-chip shape, or when shared
|
|
63
|
+
files, contracts, ordering, integration, or a seam require a dedicated
|
|
64
|
+
orchestrator. The initiator creates the separate `LEAD: <Mission>` task first.
|
|
65
|
+
That LEAD decomposes the mission, assigns exact `Chip A/B/C: <Specific Purview>`
|
|
66
|
+
titles, dispatches ordinary writable chips, reconciles their reports, and owns
|
|
67
|
+
integration checks and cleanup.
|
|
68
|
+
|
|
69
|
+
Load `greprag load chip-leader` for the mission worksheet before dispatch.
|
|
70
|
+
|
|
71
|
+
## Shared chip contract
|
|
72
|
+
|
|
73
|
+
Visible chips keep the useful durable boundaries:
|
|
74
|
+
|
|
75
|
+
1. Start in an isolated worktree with a clear purview and parent task
|
|
76
|
+
relationship.
|
|
77
|
+
2. Make the change or investigation within that worktree; commit when there is
|
|
78
|
+
a durable result.
|
|
79
|
+
3. Return a final `DONE` or `BLOCKED` result to the parent with commit, checks,
|
|
80
|
+
and caveats. Use `greprag send` only when explicit messaging is useful.
|
|
81
|
+
4. The parent reviews and integrates reported work, then performs cleanup.
|
|
82
|
+
|
|
83
|
+
The child never silently changes the orchestration shape. If the work grows
|
|
84
|
+
from quick to Leader-scale, tell the parent and let the parent create the
|
|
85
|
+
dedicated `LEAD: <Mission>` task.
|
|
86
|
+
|
|
87
|
+
## Selection rule
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
bounded thought, no durable surface → internal subagent
|
|
91
|
+
1–2 visible worktree tasks → quick chip; current task is LEAD
|
|
92
|
+
more chips or shared seams → separate LEAD mission
|
|
46
93
|
```
|
|
47
94
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Creation returns `clientThreadId` while Codex builds its own detached worktree.
|
|
82
|
-
The initial `UserPromptSubmit` hook provisionally binds the manifest and native
|
|
83
|
-
cwd before tool use. Resolve `threadId` + actual cwd immediately, then call
|
|
84
|
-
`set_thread_title` with the exact handoff title and read it back twice. Retry at
|
|
85
|
-
most three times if auto-title overwrites it; fail loudly if it will not remain
|
|
86
|
-
exact. `create_thread` has no title field, so the mission's first line carries
|
|
87
|
-
the correct identity immediately and task metadata is renamed as soon as the
|
|
88
|
-
resolved task exists. Only then run
|
|
89
|
-
`verifyTitleCommand`, rerun handoff, and run `attachCommand`. Attach validates
|
|
90
|
-
project/base/sandbox attestation, writes the marker, sends parent `IN-FLIGHT`,
|
|
91
|
-
and starts the monitor. The enforced order is create-real-mission → provisional
|
|
92
|
-
bind → resolve → rename/verify → attach → IN-FLIGHT → monitor. A standalone CLI cannot
|
|
93
|
-
invoke the Desktop-owned surface, so it prepares rather than pretending an old
|
|
94
|
-
PATH app-server successfully ran a 5.6 turn.
|
|
95
|
-
The title race contract is `set_thread_title` → read it back twice →
|
|
96
|
-
`IN-FLIGHT → mission` monitor only after the exact title remains stable.
|
|
97
|
-
|
|
98
|
-
## Mandatory parent inbox lifecycle
|
|
99
|
-
|
|
100
|
-
The child must address the recorded parent session, not a bare mailbox:
|
|
101
|
-
|
|
102
|
-
- `IN-FLIGHT` immediately after it starts work.
|
|
103
|
-
- `DONE` before ending, with commit + checks, by running the exact `codex chip
|
|
104
|
-
report` command in its opening prompt.
|
|
105
|
-
- `BLOCKED` before ending when it cannot finish, by running the exact `codex
|
|
106
|
-
chip block` command.
|
|
107
|
-
- If the work crosses the selected model boundary, run
|
|
108
|
-
`codex chip breakthrough <id> --reason "..."`. This emits a typed
|
|
109
|
-
`BREAKTHROUGH` event to the recorded parent; the child never swaps models.
|
|
110
|
-
|
|
111
|
-
The attached host monitor validates receipts from the recorded native cwd,
|
|
112
|
-
exact base ancestry, clean state, and every changed path against the lease. A
|
|
113
|
-
detached HEAD is valid; the host imports the reported exact commit into the
|
|
114
|
-
reserved chip ref, then sends the terminal inbox event. The
|
|
115
|
-
child never merges, pushes, cleans up, or edits the parent checkout. Reports map
|
|
116
|
-
concrete evidence to every covered goal criterion. The parent reviews the diff,
|
|
117
|
-
integrates it, and runs `greprag codex chip goal accept <goal-id> --summary
|
|
118
|
-
"<review judgment>"` only when all criteria and chips are satisfied. A
|
|
119
|
-
LEAD-owned goal with no additional child chip records final proofs with
|
|
120
|
-
`goal attest --commit <release-commit>` plus repeated `--evidence` and `--check`
|
|
121
|
-
before acceptance. For a verified squash/cherry-pick add `--integrated <chip-id>`
|
|
122
|
-
to acceptance. Acceptance
|
|
123
|
-
returns machine-readable closeout entries: apply each native `archiveRequest`
|
|
124
|
-
first, then its exact `cleanupCommand`. Cleanup does not imply acceptance, is
|
|
125
|
-
refused before it, and requires `--native-archived` for native tasks.
|
|
126
|
-
|
|
127
|
-
Native chips require parent-side `--native-model-verified` proof before monitor
|
|
128
|
-
start and have a receipt deadline (default 180 minutes; override with
|
|
129
|
-
`--native-timeout-minutes`). This standalone CLI cannot query Desktop-private
|
|
130
|
-
turn status, so it never guesses that a settled task succeeded: write *and read*
|
|
131
|
-
chips must submit `report`/`block`, and timeout fails loudly. One live monitor
|
|
132
|
-
per chip is enforced. `reconcile` expires unattached setup after 10 minutes,
|
|
133
|
-
retires stale blocked chips after 24 hours, and surfaces terminal-delivery
|
|
134
|
-
failure. Lifecycle inbox sends validate HTTP status, target session, sender
|
|
135
|
-
session, and durable event receipts; a duplicate monitor cannot double-send.
|
|
136
|
-
If initial `IN-FLIGHT` delivery fails, attach remains verified and retryable
|
|
137
|
-
instead of terminally stranding the task. Server-side idempotency serializes
|
|
138
|
-
the claim and preserves the originally resolved target across retries.
|
|
139
|
-
|
|
140
|
-
The native worktree sandbox is the physical boundary. Verification accepts only
|
|
141
|
-
the Codex-issued `client-new-thread:<uuid>` token (or its bare UUID form), a
|
|
142
|
-
distinct resolved UUID task ID, the expected project/base proof,
|
|
143
|
-
an attested `workspace-write` sandbox, and a Git root beneath Codex's own
|
|
144
|
-
`worktrees` directory at the exact base commit. Hook guards require the exact
|
|
145
|
-
bound task/cwd/sandbox and deny out-of-lease file tools, destructive
|
|
146
|
-
Git/cleanup, and symlink/junction creation; link-based escape is never allowed.
|
|
147
|
-
Generated verify/attach/report commands pin resolved stable Node and CLI paths,
|
|
148
|
-
so restarting Codex does not invalidate an in-flight chip contract.
|
|
149
|
-
|
|
150
|
-
Useful recovery commands:
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
greprag codex chip handoff <id> --json
|
|
154
|
-
greprag codex chip status <id>
|
|
155
|
-
greprag codex chip breakthrough <id> --reason "<follow-up>"
|
|
156
|
-
greprag codex chip resume <id>
|
|
157
|
-
greprag codex chip stop <id>
|
|
95
|
+
Do not use a larger coordination layer merely because the task sounds
|
|
96
|
+
important. Use the smallest shape that preserves the required visibility,
|
|
97
|
+
worktree isolation, reporting, messaging, and cleanup.
|
|
98
|
+
|
|
99
|
+
## Required child opening prompt
|
|
100
|
+
|
|
101
|
+
Generate the child assignment with this short handoff. Keep the real outcome
|
|
102
|
+
dominant and do not require a parent-authored implementation plan:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
Chip <Label>: <Specific Purview>
|
|
106
|
+
|
|
107
|
+
## Setup — do this FIRST
|
|
108
|
+
Stay in the Codex-provided isolated worktree; do not create a second worktree.
|
|
109
|
+
Read AGENTS.md and the session-start recap, then inspect the current repo state.
|
|
110
|
+
No leases, read-only mode, or goals.
|
|
111
|
+
If the exact first-line title is `MECHANIC: <Mission>`, make `greprag load
|
|
112
|
+
mechanic` the first Setup action before diagnosis or edits.
|
|
113
|
+
|
|
114
|
+
## Task
|
|
115
|
+
Outcome: <desired observable result>
|
|
116
|
+
Why: <one sentence; omit if obvious>
|
|
117
|
+
Seams: <shared files/contracts/order, or none>
|
|
118
|
+
Starting state / integration: <what this worktree starts from and who integrates>
|
|
119
|
+
Acceptance: <checks/evidence that mean done>
|
|
120
|
+
Own repository discovery, design, implementation, tests, and commit; do not
|
|
121
|
+
wait for a parent-authored implementation plan.
|
|
122
|
+
|
|
123
|
+
## Report when done
|
|
124
|
+
Return DONE or BLOCKED to the parent with the commit hash, concise result,
|
|
125
|
+
checks, and caveats. Do not merge, push, deploy, or delete the worktree; the
|
|
126
|
+
parent reviews and cleans up. Normal completion is the native parent-child task
|
|
127
|
+
result, not a nonce/ACK protocol or mandatory GrepRAG inbox ceremony.
|
|
158
128
|
```
|
|
159
129
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
loud until the parent interrupts the Desktop task, then confirms that fact with
|
|
165
|
-
`stop <id> --native-interrupted`; the CLI never records a false cancellation.
|
|
166
|
-
After restart/usage interruption, use `resume`, deliver its handoff, and wait for
|
|
167
|
-
the nonce-bound breakthrough acknowledgment. A delivered message without that
|
|
168
|
-
ack is not recovery. Cleaned/cancelled/failed tasks cannot resume; relaunch them.
|
|
169
|
-
For an invalid terminal launch, preserve the mission and run `goal exclude
|
|
170
|
-
<goal-id> --chip <old-chip-id> --reason "<concrete reason>"` before spawning its
|
|
171
|
-
replacement. Excluded evidence cannot satisfy acceptance. To abandon the whole
|
|
172
|
-
mission, stop every chip first, then use `goal cancel <goal-id> --reason
|
|
173
|
-
"<concrete reason>"`; cancelled closeout is not acceptance.
|
|
174
|
-
|
|
175
|
-
Mechanic repair incidents are not Mechanic task termination: `REPAIR-READY/CLOSED`
|
|
176
|
-
returns the same Luna/xhigh Mechanic to `OPEN+DORMANT` for later typed friction.
|
|
177
|
-
Only final LEAD teardown may accept/clean it with `--mechanic-final`.
|
|
130
|
+
The first line is the exact visible title, alone. Substitute the appropriate
|
|
131
|
+
discoverability label: `Chip A: <Specific Purview>`, `LEAD: <Mission>`,
|
|
132
|
+
`ADVISOR: <Purview>`, or `MECHANIC: <Mission>`. These labels do not change
|
|
133
|
+
execution authority.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Codex Internal Subagent
|
|
2
|
+
|
|
3
|
+
Use an internal subagent for ephemeral, same-session work: a bounded research
|
|
4
|
+
pass, comparison, review, edit, or test whose result can return directly to the
|
|
5
|
+
current task.
|
|
6
|
+
|
|
7
|
+
## Contract
|
|
8
|
+
|
|
9
|
+
- Load this method with `greprag load codex-subagent-spawn` when the shape is
|
|
10
|
+
not already in context.
|
|
11
|
+
- The subagent is ephemeral and same-session. It has no visible worktree task,
|
|
12
|
+
durable manifest, inbox identity, or goal.
|
|
13
|
+
- Keep concurrency at `max_threads=6` and recursion at `max_depth=1`.
|
|
14
|
+
- Give it one specific question or purview and ask for a compact result with
|
|
15
|
+
evidence. `fast_scan` is read-only; `routine_worker` and `deep_worker` may
|
|
16
|
+
perform bounded edits/tests in the parent workspace.
|
|
17
|
+
- The parent prevents overlapping concurrent edits and owns the final judgment,
|
|
18
|
+
integration, and any commit that should outlive the session.
|
|
19
|
+
- Do not use it for independent worktree isolation, parent-visible lifecycle
|
|
20
|
+
reporting, or work that must outlive the session; choose a quick chip instead.
|
|
21
|
+
|
|
22
|
+
## Compact brief
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Subagent purview: <one bounded question>
|
|
26
|
+
Context: <the files or facts it may inspect>
|
|
27
|
+
Return: <decision / findings / recommended next step>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Internal subagents do not need `greprag send`; their result is returned to the
|
|
31
|
+
initiating task. If you need a visible child identity, report, or cleanup
|
|
32
|
+
boundary, stop using this primitive and load `codex-chip-spawn`.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export type NativeDeliveryState = 'queued' | 'native-delivered' | 'acknowledged' | 'acted' | 'degraded';
|
|
2
|
-
export interface NativeCodexSendRequest {
|
|
3
|
-
threadId: string;
|
|
4
|
-
prompt: string;
|
|
5
|
-
messageId: string;
|
|
6
|
-
nonce: string;
|
|
7
|
-
ackMarker: string;
|
|
8
|
-
}
|
|
9
|
-
export interface NativeCodexSender {
|
|
10
|
-
/** The Codex host adapter must implement the native app-layer primitive. */
|
|
11
|
-
send_message_to_thread(request: NativeCodexSendRequest): Promise<unknown>;
|
|
12
|
-
}
|
|
13
|
-
export interface NativeDeliveryEnvelope {
|
|
14
|
-
version: 1;
|
|
15
|
-
messageId: string;
|
|
16
|
-
nonce: string;
|
|
17
|
-
targetSession: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
state: NativeDeliveryState;
|
|
20
|
-
attempts: number;
|
|
21
|
-
requestedAt: string;
|
|
22
|
-
nativeDeliveredAt?: string;
|
|
23
|
-
acknowledgedAt?: string;
|
|
24
|
-
actedAt?: string;
|
|
25
|
-
lastError?: string;
|
|
26
|
-
action?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface NativeDeliveryResult {
|
|
29
|
-
ok: boolean;
|
|
30
|
-
method: 'send_message_to_thread';
|
|
31
|
-
reason?: string;
|
|
32
|
-
lifecycle: NativeDeliveryState;
|
|
33
|
-
nonce: string;
|
|
34
|
-
threadId: string;
|
|
35
|
-
ackMarker: string;
|
|
36
|
-
visible: boolean;
|
|
37
|
-
acknowledged: boolean;
|
|
38
|
-
acted: boolean;
|
|
39
|
-
action?: string;
|
|
40
|
-
attempts: Array<{
|
|
41
|
-
method: string;
|
|
42
|
-
ok: boolean;
|
|
43
|
-
detail?: string;
|
|
44
|
-
}>;
|
|
45
|
-
}
|
|
46
|
-
export declare function deliveryNonce(messageId: string): string;
|
|
47
|
-
export declare function deliveryAckMarker(messageId: string): string;
|
|
48
|
-
export declare function readNativeEnvelope(messageId: string): NativeDeliveryEnvelope | null;
|
|
49
|
-
export declare function queueNativeEnvelope(messageId: string, targetSession: string, summary: string, nonce?: string): NativeDeliveryEnvelope;
|
|
50
|
-
export declare function markNativeDelivered(messageId: string): NativeDeliveryEnvelope;
|
|
51
|
-
/** ACK mutates the original nonce only. It never sends a reply message. */
|
|
52
|
-
export declare function acknowledgeNativeDelivery(messageId: string, nonce: string, action: string): NativeDeliveryEnvelope;
|
|
53
|
-
export declare function markNativeActed(messageId: string, nonce: string, action: string): NativeDeliveryEnvelope;
|
|
54
|
-
export declare function markNativeDegraded(messageId: string, error: string): NativeDeliveryEnvelope;
|
|
55
|
-
/**
|
|
56
|
-
* Load the host bridge supplied by Codex Desktop. A plain CLI process cannot
|
|
57
|
-
* call an MCP/app tool by pretending that app-server is native, so the bridge
|
|
58
|
-
* is explicit and fail-closed. The module must export the exact primitive name
|
|
59
|
-
* `send_message_to_thread`; its result must contain bound visible ACK/action
|
|
60
|
-
* proof before GrepRAG reports success.
|
|
61
|
-
*/
|
|
62
|
-
export declare function loadNativeCodexSender(env?: NodeJS.ProcessEnv): NativeCodexSender | null;
|
|
63
|
-
export declare function nativeAdapterConfigured(env?: NodeJS.ProcessEnv): boolean;
|
|
64
|
-
export declare function deliverViaNativeCodex(opts: {
|
|
65
|
-
messageId: string;
|
|
66
|
-
targetSession: string;
|
|
67
|
-
prompt: string;
|
|
68
|
-
nonce?: string;
|
|
69
|
-
nativeSender?: NativeCodexSender;
|
|
70
|
-
}): Promise<NativeDeliveryResult>;
|