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.
Files changed (101) hide show
  1. package/dist/codex-chip-hooks.d.ts +2 -7
  2. package/dist/codex-chip-hooks.js +25 -159
  3. package/dist/codex-chip-hooks.js.map +1 -1
  4. package/dist/codex-steering.d.ts +2 -1
  5. package/dist/codex-steering.js +8 -5
  6. package/dist/codex-steering.js.map +1 -1
  7. package/dist/commands/codex-chip/bootstrap.d.ts +8 -0
  8. package/dist/commands/codex-chip/bootstrap.js +103 -0
  9. package/dist/commands/codex-chip/bootstrap.js.map +1 -0
  10. package/dist/commands/codex-chip/breakthrough-command.js +0 -7
  11. package/dist/commands/codex-chip/breakthrough-command.js.map +1 -1
  12. package/dist/commands/codex-chip/cleanup-command.js +1 -9
  13. package/dist/commands/codex-chip/cleanup-command.js.map +1 -1
  14. package/dist/commands/codex-chip/command.js +5 -63
  15. package/dist/commands/codex-chip/command.js.map +1 -1
  16. package/dist/commands/codex-chip/git.d.ts +0 -1
  17. package/dist/commands/codex-chip/git.js +0 -2
  18. package/dist/commands/codex-chip/git.js.map +1 -1
  19. package/dist/commands/codex-chip/goals.d.ts +9 -0
  20. package/dist/commands/codex-chip/goals.js +54 -7
  21. package/dist/commands/codex-chip/goals.js.map +1 -1
  22. package/dist/commands/codex-chip/help.d.ts +1 -1
  23. package/dist/commands/codex-chip/help.js +13 -24
  24. package/dist/commands/codex-chip/help.js.map +1 -1
  25. package/dist/commands/codex-chip/model.d.ts +2 -4
  26. package/dist/commands/codex-chip/model.js +1 -1
  27. package/dist/commands/codex-chip/model.js.map +1 -1
  28. package/dist/commands/codex-chip/naming.js +4 -10
  29. package/dist/commands/codex-chip/naming.js.map +1 -1
  30. package/dist/commands/codex-chip/native.js +11 -15
  31. package/dist/commands/codex-chip/native.js.map +1 -1
  32. package/dist/commands/codex-chip/prompt.d.ts +2 -1
  33. package/dist/commands/codex-chip/prompt.js +15 -59
  34. package/dist/commands/codex-chip/prompt.js.map +1 -1
  35. package/dist/commands/codex-chip/resume-command.js +0 -3
  36. package/dist/commands/codex-chip/resume-command.js.map +1 -1
  37. package/dist/commands/codex-chip/selection.d.ts +1 -1
  38. package/dist/commands/codex-chip/selection.js +15 -59
  39. package/dist/commands/codex-chip/selection.js.map +1 -1
  40. package/dist/commands/codex-chip/worker.js +60 -122
  41. package/dist/commands/codex-chip/worker.js.map +1 -1
  42. package/dist/commands/codex-delivery.d.ts +32 -7
  43. package/dist/commands/codex-delivery.js +76 -92
  44. package/dist/commands/codex-delivery.js.map +1 -1
  45. package/dist/commands/codex-startup.js +1 -1
  46. package/dist/commands/codex-startup.js.map +1 -1
  47. package/dist/commands/codex.js +36 -34
  48. package/dist/commands/codex.js.map +1 -1
  49. package/dist/commands/friction-reminder.d.ts +9 -9
  50. package/dist/commands/friction-reminder.js +12 -17
  51. package/dist/commands/friction-reminder.js.map +1 -1
  52. package/dist/commands/inbox-primer-reminder.js +3 -3
  53. package/dist/commands/inbox-primer-reminder.js.map +1 -1
  54. package/dist/commands/init.js +7 -5
  55. package/dist/commands/init.js.map +1 -1
  56. package/dist/commands/load-primer-reminder.js +2 -2
  57. package/dist/commands/load-primer-reminder.js.map +1 -1
  58. package/dist/commands/load.js +28 -27
  59. package/dist/commands/load.js.map +1 -1
  60. package/dist/commands/mechanic-spawn.d.ts +10 -0
  61. package/dist/commands/mechanic-spawn.js +67 -0
  62. package/dist/commands/mechanic-spawn.js.map +1 -0
  63. package/dist/commands/mechanic.js +6 -0
  64. package/dist/commands/mechanic.js.map +1 -1
  65. package/dist/commands/opencode-chip-client.d.ts +8 -0
  66. package/dist/commands/opencode-chip-client.js +45 -0
  67. package/dist/commands/opencode-chip-client.js.map +1 -0
  68. package/dist/commands/opencode-chip-lifecycle.d.ts +2 -0
  69. package/dist/commands/opencode-chip-lifecycle.js +137 -0
  70. package/dist/commands/opencode-chip-lifecycle.js.map +1 -0
  71. package/dist/commands/opencode-chip-mission.d.ts +22 -0
  72. package/dist/commands/opencode-chip-mission.js +105 -0
  73. package/dist/commands/opencode-chip-mission.js.map +1 -0
  74. package/dist/commands/opencode-chip-store.d.ts +72 -0
  75. package/dist/commands/opencode-chip-store.js +141 -0
  76. package/dist/commands/opencode-chip-store.js.map +1 -0
  77. package/dist/commands/opencode-chip.d.ts +3 -0
  78. package/dist/commands/opencode-chip.js +488 -0
  79. package/dist/commands/opencode-chip.js.map +1 -0
  80. package/dist/commands/opencode-goals.d.ts +5 -0
  81. package/dist/commands/opencode-goals.js +83 -0
  82. package/dist/commands/opencode-goals.js.map +1 -0
  83. package/dist/hook.js +8 -3
  84. package/dist/hook.js.map +1 -1
  85. package/dist/index.js +11 -90
  86. package/dist/index.js.map +1 -1
  87. package/dist/opencode-plugin.bundle.js +9 -11
  88. package/package.json +1 -1
  89. package/skill/greprag/SKILL.md +2 -2
  90. package/skill/greprag/docs/codex-chip.md +20 -59
  91. package/skill/greprag/docs/setup.md +15 -21
  92. package/skill/templates/chip-bootloader.md +33 -91
  93. package/skill/templates/chip-leader-opencode.md +90 -75
  94. package/skill/templates/chip-leader.md +81 -221
  95. package/skill/templates/codex-chip-spawn.md +129 -173
  96. package/skill/templates/codex-subagent-spawn.md +32 -0
  97. package/dist/commands/codex-native-delivery.d.ts +0 -70
  98. package/dist/commands/codex-native-delivery.js +0 -285
  99. package/dist/commands/codex-native-delivery.js.map +0 -1
  100. package/skill/templates/reflex-chip.md +0 -58
  101. package/skill/templates/workshop-chip.md +0 -46
@@ -1,177 +1,133 @@
1
- # Codex Chip Spawn
2
-
3
- This is the Codex Desktop chip method. It is separate from Claude Code
4
- `spawn_task`: never use or copy the Claude Block 1/Block 2 prompt here.
5
-
6
- Exact visible titles are role contracts: `PLANNER: <Mission>` owns intent and
7
- acceptance, `LEAD: <Mission>` is always Luna/xhigh and owns orchestration,
8
- `Chip A/B/C: <Specific Purview>` are Luna/xhigh workers, and
9
- `ADVISOR: <Purview>` is read-only Sol/high advice for a documented fundamental
10
- blocker.
11
-
12
- ## Gate: one chip or a mission?
13
-
14
- A single independent task proceeds directly. If two or more chips target one
15
- objective, or you are about to create a second chip, stop and run `greprag load
16
- chip-leader`. Plan the integration branch, ownership seams, dependency order,
17
- merge order, and whole-feature test gate before another spawn. Rename the
18
- orchestrating task so its title begins `LEAD: <Mission>`. Multi-chip workers are
19
- uniquely named `Chip A: <Specific Purview>`, `Chip B: ...`; a single worker is
20
- `Chip: <Purview>`. Labels are stable coordination handles, not execution order.
21
-
22
- ## Prepare the isolated task
23
-
24
- Every mission starts with a durable parent-owned goal. Give it a concrete
25
- objective, final state, and stable acceptance criterion IDs. Every write chip
26
- declares non-overlapping ownership leases; research uses `--read-only`.
27
- After the planner attaches the Luna LEAD, the LEAD creates one nested goal and
28
- runs `greprag codex chip goal bind-lead <lead-id> --goal-id <nested-goal-id>`.
29
- That emits `GOAL_READY:<goalId>`; no LEAD execution or child dispatch is valid
30
- before it. All later Chips, ADVISOR, and MECHANIC tasks use that exact goal.
31
-
32
- ```bash
33
- greprag codex chip goal create \
34
- --objective "<concrete objective>" \
35
- --final-state "<observable final state>" \
36
- --criterion <id>:"<acceptance statement>"
37
-
38
- greprag codex chip spawn "<independent task>" \
39
- --name <slug> \
40
- --title "<Properly Capitalized Purview>" \
41
- --goal-id <goal-id> --covers <criterion-id> \
42
- --owns "<path/**>" \
43
- --codex-project-id <desktop-project-id> \
44
- --parent-session <parent-thread-id> \
45
- --json
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
- The parent/`LEAD:` selects each worker model before dispatch; the child never
49
- self-selects or changes it. `LEAD` and ordinary Chips are fixed to
50
- `gpt-5.6-luna/xhigh`.
51
- `PLANNER` may use Luna/xhigh or explicitly Sol/high. `ADVISOR` must be
52
- `--read-only`, Sol/high, and carry `--model-reason "Fundamental blocker: ..."`.
53
- The old `--complex`, `--profile complex`, and `--complexity-signal` routing is
54
- rejected for new spawns. Native Desktop `thinking` uses the callable enum and
55
- is checked against the selected model's advertised effort matrix. The manifest
56
- persists role, model, effort, parent session, reason, and criterion evidence.
57
- The auditable selection fields are `selectedBy`, `reason`, and `matched signals`.
58
- The hard-signal rubric covers `architecture/API/schema` and
59
- `high-risk migration/security/accounting`; a scope boundary sends a
60
- `breakthrough message` and the child `never swaps models autonomously`.
61
-
62
- Native Desktop is the default runtime.
63
- `--runtime cli` is opt-in and only valid when PATH Codex `model/list` actually
64
- exposes the requested model and effort; validation remains fail-loud.
65
-
66
- For a multi-chip mission every spawn also uses `--multi-chip --label A` (then B,
67
- C...) and a different `--title`. Duplicate active slugs, labels, or purview
68
- titles fail loudly.
69
-
70
- The spawn command creates a unique starting branch, records the manifest and
71
- lease, and returns a `greprag-codex-native-v4` handoff. Pass `createRequest`
72
- exactly to native `create_thread`: it already contains the full real mission,
73
- selected `model`, `thinking`, project target, and worktree starting branch.
74
- The native target schema is `target.type=project` with
75
- `startingState={type:"branch", branchName}` inside the worktree environment;
76
- do not invent a checkout path or second bootstrap turn. Do not add `cwd`, `title`, `model`, or `effort` to the native create request; those values belong to the handoff and post-create verification contract.
77
- `expectedBaseSha` is the attach-time commit invariant behind that reserved branch.
78
- This is the only assignment turn. Never create a bootstrap task and never send
79
- the mission again after attach.
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
- For a native chip, `BREAKTHROUGH` is the sole agent-visible control envelope;
161
- native turn transport remains private. Breakthrough delivery is
162
- durably queued → injected → acknowledged → acted; empty completed turns are
163
- not delivery, and natural-turn drain is degraded fallback only. Stop fails
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>;