greprag 5.78.7 → 5.80.0

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.
@@ -43,6 +43,7 @@ var __importStar = (this && this.__importStar) || (function () {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  exports.readNativeSkillNames = readNativeSkillNames;
45
45
  exports.buildMirroredSkillActivation = buildMirroredSkillActivation;
46
+ exports.nativeAdapterInstallCommand = nativeAdapterInstallCommand;
46
47
  exports.activationFromApiRows = activationFromApiRows;
47
48
  const fs = __importStar(require("fs"));
48
49
  const path = __importStar(require("path"));
@@ -139,6 +140,21 @@ function buildMirroredSkillActivation(entries, nativeNames) {
139
140
  const skills = valid.filter(entry => !nativeNames.has(entry.skillName.toLowerCase()));
140
141
  return { count: valid.length, skills, nativeCount: valid.length - skills.length };
141
142
  }
143
+ /** The one command that materializes native adapters for the named mirrored
144
+ * skills on this harness. claude-code is not swept wholesale (adapters there
145
+ * are opt-in per name); codex/opencode sync their whole roster. Null when
146
+ * nothing is missing. */
147
+ function nativeAdapterInstallCommand(platform, missingNames) {
148
+ if (missingNames.length === 0)
149
+ return null;
150
+ if (platform === 'claude-code') {
151
+ return `greprag skill mirror sync claude-code --only ${[...missingNames].sort().join(',')}`;
152
+ }
153
+ if (platform === 'codex' || platform === 'opencode') {
154
+ return `greprag skill mirror sync ${platform}`;
155
+ }
156
+ return null;
157
+ }
142
158
  /** Convert the mirror API response into a harness-specific activation signal. */
143
159
  function activationFromApiRows(params) {
144
160
  const entries = params.rows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greprag",
3
- "version": "5.78.7",
3
+ "version": "5.80.0",
4
4
  "description": "Private GrepRAG client for existing Claude Code, Codex, OpenCode, and Grok Build tenants.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -2,21 +2,23 @@
2
2
 
3
3
  **Grok Build?** Stop. Run `greprag load grok-chip-spawn`. This entry is Claude `spawn_task`.
4
4
 
5
- The `pre-spawn-check` PreToolUse hook **validates** chip prompts at the spawn boundary, but **cannot inject content** — `modifiedInput` is silently dropped by the CCD harness for MCP `spawn_task` calls (see `adr/spawn-task-hook-mode.md` 2026-05-27 entry). The agent writes Block 1 + Block 2 into the prompt itself. Validator rejects with `permissionDecision: deny` and a remediation reason if Block 1 or Block 2 markers are missing.
5
+ The `pre-spawn-check` PreToolUse hook **validates** chip prompts at the spawn boundary, but **cannot inject content** — `modifiedInput` is silently dropped by the CCD harness for MCP `spawn_task` calls (see `adr/spawn-task-hook-mode.md` 2026-05-27 entry). The agent writes Block 1 into the prompt itself. Validator rejects with `permissionDecision: deny` and a remediation reason if the `Chip: ` title prefix or the Block 1 worktree marker is missing.
6
+
7
+ **Chips talk over native `SendMessage`, not greprag.** Claude Code addresses live sessions by name on this machine — `ListAgents` to discover, `SendMessage to: "<name>"` to send, delivered at the recipient's next tool boundary. The parent gets native start and completion notifications for every chip it spawns. So there is no IN-FLIGHT ping, no `greprag send` report-back, and **no watcher to arm**. greprag's role in the chip loop is now content only (the `fix list` pre-pull below, and `fix spawn` as mission generator).
6
8
 
7
9
  > **Part of a multi-chip mission?** If this chip is one of ≥2 aimed at a single objective, you should already be inside a chip-leader plan — your **base branch** and **merge target** (the integration branch, *never* master) come from it. If you're not, stop and run `greprag load chip-leader` first. A lone chip targeting its own objective proceeds here directly.
8
10
 
9
11
  ## What the agent provides
10
12
 
11
13
  - `title: "Chip: <verb-phrase>"` — `Chip: ` prefix enforced. **Multi-chip mission?** Use the leader-assigned label: `"Chip <Label>: <verb-phrase>"` (Label = `A`/`B`/`C`… per workstream, from chip-leader) — e.g. `"Chip B: Build freshness engine"`. The validator accepts `Chip: `, `Chip A: `, `Chip 1: ` (regex `^Chip( [A-Za-z0-9]+)?: `). The label is the shared handle the leader and chip both use end-to-end (title → report-back self-ID → merge references).
12
- - `prompt:` — Block 1 + task body + Block 2 (templates below).
14
+ - `prompt:` — Block 1 + task body (template below), ending with the report-back line.
13
15
  - `cwd:` — optional, lands the chip in a different project root. Repo paths: `~/.greprag/projects.json`.
14
16
 
15
17
  Add `mode: interactive` as the first line of the task body to pause the chip for human reply (default is autonomous).
16
18
 
17
- ## Block 1 — Setup (verbatim, substitute `<slug>`, `<handle>` + parent session id)
19
+ ## Block 1 — Setup (verbatim, substitute `<slug>`)
18
20
 
19
- `<slug>` = title slugified (e.g. `Chip: Fix synthesis loop` → `fix-synthesis-loop`). `<8-hex-parent>` = first 8 hex of YOUR session id (printed by SessionStart as "greprag session id: ..."). `<handle>` = operator's greprag handle. `<own-session-id>` stays literal — the chip substitutes it from its own SessionStart output.
21
+ `<slug>` = title slugified (e.g. `Chip: Fix synthesis loop` → `fix-synthesis-loop`). `<parent-name>` = YOUR native session name, the one `ListAgents` prints as "This session is `<name>`" that is the chip's reply address, not a greprag 8-hex.
20
22
 
21
23
  ````
22
24
  **Setup — do this FIRST:**
@@ -39,9 +41,6 @@ else
39
41
  cd ".claude/worktrees/<slug>"
40
42
  fi
41
43
 
42
- greprag send "IN-FLIGHT: chip/<slug> launched — working" \
43
- --to <handle>@greprag.com/<8-hex-parent> --from-session <own-session-id>
44
-
45
44
  # Pristine worktrees check out source only — if the repo ships a worktree
46
45
  # bootstrap (local dependency bootstrap + gitignored dist/ build), run it now
47
46
  # or cross-package tests fail with a cryptic MODULE_NOT_FOUND. No-op in repos
@@ -49,7 +48,7 @@ greprag send "IN-FLIGHT: chip/<slug> launched — working" \
49
48
  if [ -f scripts/worktree-bootstrap.cjs ]; then node scripts/worktree-bootstrap.cjs; fi
50
49
  ```
51
50
 
52
- Your parent's session id is `<8-hex-parent>`. The `IN-FLIGHT` ping is non-negotiable without it the parent assumes the chip card was never launched.
51
+ Your parent session is named `<parent-name>`. When you finish, report to it with native `SendMessage` (`to: "<parent-name>"`): the commit hash, the branch `chip/<slug>`, and a one-line result.
53
52
 
54
53
  ---
55
54
  ````
@@ -62,40 +61,26 @@ greprag session retitle <your-own-8hex> "Chip <Label> — <workstream>"
62
61
 
63
62
  The leader dictates the exact string (e.g. `Chip A — Converter format coverage`); substitute your own 8-hex from SessionStart. This force-sets the registry title so the watcher list + Discord `/switch` line up with the leader's labels. Single chips skip this.
64
63
 
65
- ## Block 2 — Report back (verbatim, substitute `<slug>` + parent session id)
64
+ ## Report back native `SendMessage`
66
65
 
67
- Handle is the operator's greprag handle (from `~/.greprag/identity.json`, field `handle` — strip the `@greprag.com` suffix).
66
+ Close the task body with this (substitute `<slug>` + `<parent-name>`):
68
67
 
69
68
  ````
70
69
  ---
71
70
 
72
- **Block 2 Report back via greprag inbox:**
71
+ **Report back:** when the work is committed, send your result to the parent with native `SendMessage`:
73
72
 
74
- ```bash
75
- greprag send "<status>: <commit hash> on chip/<slug> <one-line>" \
76
- --to <handle>@greprag.com/<8-hex-parent> \
77
- --from-session <own-session-id> \
78
- --artifact commit:<hash>
79
- ```
73
+ - `to`: `"<parent-name>"`
74
+ - `message`: status, commit hash, branch `chip/<slug>`, and a one-line summary.
80
75
 
81
- Substitute `<own-session-id>` from your SessionStart hook output.
76
+ The parent is a live session on this machine no greprag address, no watcher. If `SendMessage` errors because the parent has ended, stop and leave the commit on the branch; the parent picks it up at merge.
82
77
 
83
78
  **Cleanup discipline (HARD RULE):** chip prompts forbid `git clean`, `git reset --hard`, `git worktree remove`, `git checkout <other>`, raw `rm -rf` outside the worktree's tracked files.
84
79
  ````
85
80
 
86
- ## After spawning — arm YOUR OWN watcher (HARD RULE)
87
-
88
- The chip reports back to **your** session id via `greprag send`. Nothing else reliably arms you to receive it: the SessionStart arm-directive and the turn-2 UserPromptSubmit fallback are agent-choice and may not fire, and a report that lands in an unwatched inbox sits silently until someone runs `greprag inbox` by hand. So **immediately after `spawn_task` returns, arm your own watcher** — unless you already have one running this session (one watcher covers every chip you spawn; never double-arm):
89
-
90
- Use the **registered** form — copy the exact command the SessionStart / UserPromptSubmit arm hook prints **verbatim**. It already carries `--owner-pid <claude-pid>`, which only the hook can resolve (the hook is a live descendant of claude.exe; your shell is not):
91
-
92
- ```
93
- Monitor (persistent:true): `greprag inbox watch --session <your-8hex> --json --owner-pid <pid>`
94
- ```
95
-
96
- `<your-8hex>` = your own session id (from SessionStart). **Do NOT hand-fill `--owner-pid` from a shell PID** — the reaper reads `--owner-pid` as "the claude.exe that owns me," so a non-claude PID there reads as a dead owner and the watch is reaped. **Do NOT add `--monitor-pid` / `read … /proc/$$/winpid`** — that form was reverted 2026-06-11 (it stamped the transient arm-line bash, not the Monitor task, and false-killed live watchers); the flag is dead code now. **Do NOT use a bare `while true; greprag inbox watch …` loop** — it never registers in the desk-line, so the arm-probe reports you "NOT armed" and other sessions can't see you as live-reachable. Simplest and correct: **paste the arm hook's printed command verbatim** — its `--owner-pid` is the only one the reaper trusts. (A watch armed with no `--owner-pid` at all is fine too — it is kept, never false-killed — it just isn't owner-pid-reapable if hard-killed.) Arming is what makes the chip's "done" report surface live instead of being lost — the spawn is only half the loop.
81
+ ## After spawning — do nothing
97
82
 
98
- **Launch state:** the Block 1 `IN-FLIGHT` ping is your only signal the operator actually clicked the chip card. No ping = assume the card is still unpresseddon't wait on results from a chip that was never launched.
83
+ No watcher. No arming. The harness tells you when the operator starts the chip and again when it ends, and the chip's own `SendMessage` lands at your next tool boundary. Never arm a `Monitor` on greprag's inbox for chip traffic the inbox watcher exists for Discord, inbound email, and cold opens, not for chips.
99
84
 
100
85
  ## Before composing
101
86