greprag 5.55.0 → 5.56.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.
@@ -0,0 +1,37 @@
1
+ /** loadout-registrar — the bundled Interrupt-System module that activates
2
+ * equipped loadouts (docs/loadout.md §activation model, adr/loadout.md). Modeled
3
+ * on `assistantDoctrine`: a data-driven announce over a per-tenant signal the
4
+ * hook assembles into `env`. THE one piece of executable code in the loadout
5
+ * feature — shipped in the CLI binary, identical for every tenant. Nothing that
6
+ * crosses the tenant wall is code; only the inert announce declarations
7
+ * (env.equippedLoadouts) it renders.
8
+ *
9
+ * Two firing layers, both at launch (docs/loadout.md — "one advisor line, expert
10
+ * keywords as the sensor"):
11
+ *
12
+ * - SessionStart (announce): ONE advisor pointer line per equipped loadout.
13
+ * The agent boots knowing the system exists + how to load it. Detect-
14
+ * independent (collectAnnounces renders every module's announce).
15
+ * - Per-turn (Match on env.promptText): when the prompt hits any equipped
16
+ * loadout's derived keywords, fire ONE thin "→ greprag load <advisor>"
17
+ * reminder; the advisor routes to the matched expert on demand.
18
+ *
19
+ * PURE over ReminderEnv — the hook owns all I/O (SessionStart fetch → local
20
+ * cache; per-turn cache read), so detect→announce + the keyword match are the
21
+ * unit-testable regression-locks. */
22
+ import { ReminderEnv, Detection, ReminderModule } from './reminder-types';
23
+ /** Which equipped loadouts does the prompt touch? PURE — a keyword hit is a
24
+ * case-insensitive substring match against the prompt text. Returns the
25
+ * matched decls (empty when no prompt / no equipped loadouts / no hit). */
26
+ export declare function matchLoadouts(promptText: string | null | undefined, equipped: ReminderEnv['equippedLoadouts']): NonNullable<ReminderEnv['equippedLoadouts']>;
27
+ /** SessionStart announce block — one advisor pointer per equipped loadout. */
28
+ export declare function buildLoadoutAnnounce(equipped: ReminderEnv['equippedLoadouts']): string | null;
29
+ /** The per-turn Match: fire ONE advisor-load pointer per matched loadout. */
30
+ export declare function buildLoadoutReminder(matched: NonNullable<ReminderEnv['equippedLoadouts']>): string | null;
31
+ /** Detect = the per-turn Match gate. Silent unless the prompt hits a keyword of
32
+ * some equipped loadout (which also implies there ARE equipped loadouts). The
33
+ * ambient "has loadouts" state drives the ANNOUNCE, which collectAnnounces reads
34
+ * independent of detect — so the detector stays a pure Match gate (no per-turn
35
+ * billboard). detail.matched carries the hit set for the reminder. */
36
+ export declare function loadoutDetect(env: ReminderEnv): Detection;
37
+ export declare const loadoutRegistrarModule: ReminderModule;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /** loadout-registrar — the bundled Interrupt-System module that activates
3
+ * equipped loadouts (docs/loadout.md §activation model, adr/loadout.md). Modeled
4
+ * on `assistantDoctrine`: a data-driven announce over a per-tenant signal the
5
+ * hook assembles into `env`. THE one piece of executable code in the loadout
6
+ * feature — shipped in the CLI binary, identical for every tenant. Nothing that
7
+ * crosses the tenant wall is code; only the inert announce declarations
8
+ * (env.equippedLoadouts) it renders.
9
+ *
10
+ * Two firing layers, both at launch (docs/loadout.md — "one advisor line, expert
11
+ * keywords as the sensor"):
12
+ *
13
+ * - SessionStart (announce): ONE advisor pointer line per equipped loadout.
14
+ * The agent boots knowing the system exists + how to load it. Detect-
15
+ * independent (collectAnnounces renders every module's announce).
16
+ * - Per-turn (Match on env.promptText): when the prompt hits any equipped
17
+ * loadout's derived keywords, fire ONE thin "→ greprag load <advisor>"
18
+ * reminder; the advisor routes to the matched expert on demand.
19
+ *
20
+ * PURE over ReminderEnv — the hook owns all I/O (SessionStart fetch → local
21
+ * cache; per-turn cache read), so detect→announce + the keyword match are the
22
+ * unit-testable regression-locks. */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.loadoutRegistrarModule = void 0;
25
+ exports.matchLoadouts = matchLoadouts;
26
+ exports.buildLoadoutAnnounce = buildLoadoutAnnounce;
27
+ exports.buildLoadoutReminder = buildLoadoutReminder;
28
+ exports.loadoutDetect = loadoutDetect;
29
+ /** Which equipped loadouts does the prompt touch? PURE — a keyword hit is a
30
+ * case-insensitive substring match against the prompt text. Returns the
31
+ * matched decls (empty when no prompt / no equipped loadouts / no hit). */
32
+ function matchLoadouts(promptText, equipped) {
33
+ const prompt = (promptText || '').toLowerCase();
34
+ if (!prompt.trim() || !equipped || equipped.length === 0)
35
+ return [];
36
+ return equipped.filter((l) => (l.keywords || []).some((kw) => {
37
+ const k = kw.trim().toLowerCase();
38
+ return k.length >= 3 && prompt.includes(k);
39
+ }));
40
+ }
41
+ /** SessionStart announce block — one advisor pointer per equipped loadout. */
42
+ function buildLoadoutAnnounce(equipped) {
43
+ const decls = (equipped || []).filter((l) => l.announceLine);
44
+ if (decls.length === 0)
45
+ return null;
46
+ return [
47
+ '[greprag loadouts — equipped skill bundles (served on demand via `greprag load`):]',
48
+ ...decls.map((l) => ` ${l.announceLine}`),
49
+ ].join('\n');
50
+ }
51
+ /** The per-turn Match: fire ONE advisor-load pointer per matched loadout. */
52
+ function buildLoadoutReminder(matched) {
53
+ if (matched.length === 0)
54
+ return null;
55
+ return matched
56
+ .map((l) => `🎒 your equipped loadout "${l.name}" covers this → \`greprag load ${l.advisor}\` (it routes to the right expert)`)
57
+ .join('\n');
58
+ }
59
+ /** Detect = the per-turn Match gate. Silent unless the prompt hits a keyword of
60
+ * some equipped loadout (which also implies there ARE equipped loadouts). The
61
+ * ambient "has loadouts" state drives the ANNOUNCE, which collectAnnounces reads
62
+ * independent of detect — so the detector stays a pure Match gate (no per-turn
63
+ * billboard). detail.matched carries the hit set for the reminder. */
64
+ function loadoutDetect(env) {
65
+ const matched = matchLoadouts(env.promptText, env.equippedLoadouts);
66
+ if (matched.length === 0)
67
+ return { tier: 'silent' };
68
+ return { tier: 'nudge', detail: { matched } };
69
+ }
70
+ exports.loadoutRegistrarModule = {
71
+ id: 'loadout-registrar',
72
+ // The announce says "greprag load" — depends on the load primer teaching it.
73
+ dependsOn: ['load-primer'],
74
+ detect: loadoutDetect,
75
+ announce: (env) => buildLoadoutAnnounce(env.equippedLoadouts),
76
+ reminder: (d) => buildLoadoutReminder(d.detail?.matched || []),
77
+ };
78
+ //# sourceMappingURL=loadout-reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadout-reminder.js","sourceRoot":"","sources":["../../src/commands/loadout-reminder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;sCAoBsC;;;AAOtC,sCAUC;AAGD,oDAOC;AAGD,oDAKC;AAOD,sCAIC;AA1CD;;4EAE4E;AAC5E,SAAgB,aAAa,CAC3B,UAAqC,EACrC,QAAyC;IAEzC,MAAM,MAAM,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QAC3D,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAClC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,SAAgB,oBAAoB,CAAC,QAAyC;IAC5E,MAAM,KAAK,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO;QACL,oFAAoF;QACpF,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,CAAC;KAC3C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,6EAA6E;AAC7E,SAAgB,oBAAoB,CAAC,OAAqD;IACxF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAA6B,CAAC,CAAC,IAAI,kCAAkC,CAAC,CAAC,OAAO,oCAAoC,CAAC;SAC9H,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;;uEAIuE;AACvE,SAAgB,aAAa,CAAC,GAAgB;IAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACpE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC;AAChD,CAAC;AAEY,QAAA,sBAAsB,GAAmB;IACpD,EAAE,EAAE,mBAAmB;IACvB,6EAA6E;IAC7E,SAAS,EAAE,CAAC,aAAa,CAAC;IAC1B,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC7D,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAE,CAAC,CAAC,MAAM,EAAE,OAAwD,IAAI,EAAE,CAAC;CACjH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** greprag loadout — cross-tenant skill-bundle gifting (docs/loadout.md,
2
+ * adr/loadout.md). A loadout is a directed private GIFT: you SEND a bundle of
3
+ * skills to another tenant; it lands at their front desk as a cold open; their
4
+ * operator EQUIPS or DECLINES; on equip it copies into their load store and
5
+ * self-inflates via the Interrupt System — no harness skills-dir write.
6
+ *
7
+ * loadout send --to <handle>@greprag.com --skill <name> [--dir <path>] …
8
+ * loadout list | status
9
+ * loadout open <id>
10
+ * loadout equip <id> (alias: accept) | decline <id>
11
+ * loadout unequip <name> [--delete-skills]
12
+ *
13
+ * Thin HTTP wrapper over /v1/loadout (the CLI is core-free). --skill resolves
14
+ * server-side from your mirror store; --dir reads a skill dir from disk here. */
15
+ export declare function runLoadout(args: string[]): Promise<void>;
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+ /** greprag loadout — cross-tenant skill-bundle gifting (docs/loadout.md,
3
+ * adr/loadout.md). A loadout is a directed private GIFT: you SEND a bundle of
4
+ * skills to another tenant; it lands at their front desk as a cold open; their
5
+ * operator EQUIPS or DECLINES; on equip it copies into their load store and
6
+ * self-inflates via the Interrupt System — no harness skills-dir write.
7
+ *
8
+ * loadout send --to <handle>@greprag.com --skill <name> [--dir <path>] …
9
+ * loadout list | status
10
+ * loadout open <id>
11
+ * loadout equip <id> (alias: accept) | decline <id>
12
+ * loadout unequip <name> [--delete-skills]
13
+ *
14
+ * Thin HTTP wrapper over /v1/loadout (the CLI is core-free). --skill resolves
15
+ * server-side from your mirror store; --dir reads a skill dir from disk here. */
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.runLoadout = runLoadout;
51
+ const skill_mirror_client_1 = require("../skill-mirror-client");
52
+ const skill_landing_1 = require("../skill-landing");
53
+ const path = __importStar(require("path"));
54
+ function getConfig() {
55
+ return {
56
+ apiUrl: process.env.GREPRAG_API_URL || 'https://api.greprag.com',
57
+ apiKey: process.env.GREPRAG_API_KEY || '',
58
+ };
59
+ }
60
+ /** All values for a repeatable flag (`--skill a --skill b`). */
61
+ function getFlags(args, flag) {
62
+ const out = [];
63
+ for (let i = 0; i < args.length; i++)
64
+ if (args[i] === flag && i + 1 < args.length)
65
+ out.push(args[i + 1]);
66
+ return out;
67
+ }
68
+ function getFlag(args, flag) {
69
+ const idx = args.indexOf(flag);
70
+ return idx === -1 || idx + 1 >= args.length ? undefined : args[idx + 1];
71
+ }
72
+ const HELP = `greprag loadout — gift a skill bundle to another tenant (docs/loadout.md)
73
+
74
+ A loadout is an OFFER, never a delivery: the recipient's operator equips it. On
75
+ equip it copies into their load store (served by \`greprag load\`) and
76
+ self-inflates via the Interrupt System — nothing is written to ~/.claude/skills.
77
+
78
+ USAGE
79
+ greprag loadout send --to <handle>@greprag.com --skill <name> [--skill <n> …]
80
+ [--dir <path>] [--advisor <name>] [--note "equip me"] [--line "…"]
81
+ Freeze + send a loadout. --skill pulls each skill from YOUR mirror store
82
+ (use it once so it mirrors, or pass --dir). --dir <path> snapshots a
83
+ skill directory straight from disk. --advisor names the router skill that
84
+ gets the SessionStart pointer (default: the first skill).
85
+
86
+ greprag loadout list Offered loadouts at your front desk.
87
+ greprag loadout open <id> Manifest + a bounded content preview.
88
+ greprag loadout equip <id> Equip it (alias: accept).
89
+ greprag loadout decline <id> Decline — GCs the snapshot.
90
+ greprag loadout status Loadouts you've sent + their state.
91
+ greprag loadout unequip <name> [--delete-skills]
92
+ Stop a loadout's auto-inflate (optionally
93
+ delete the copied advisor skill too).`;
94
+ async function api(method, pathname, body) {
95
+ const cfg = getConfig();
96
+ if (!cfg.apiKey) {
97
+ console.error('GREPRAG_API_KEY not set — run `greprag init` first.');
98
+ process.exit(1);
99
+ }
100
+ const res = await fetch(`${cfg.apiUrl}${pathname}`, {
101
+ method,
102
+ headers: { 'Authorization': `Bearer ${cfg.apiKey}`, 'Content-Type': 'application/json' },
103
+ body: body === undefined ? undefined : JSON.stringify(body),
104
+ });
105
+ let data = {};
106
+ try {
107
+ data = await res.json();
108
+ }
109
+ catch { /* non-JSON */ }
110
+ return { ok: res.ok, status: res.status, data };
111
+ }
112
+ function fail(data, status) {
113
+ console.error(`Error${status ? ` (${status})` : ''}: ${data.error || 'request failed'}`);
114
+ process.exit(1);
115
+ }
116
+ // ---------- send --------------------------------------------------------------
117
+ async function send(args) {
118
+ const to = getFlag(args, '--to');
119
+ if (!to) {
120
+ console.error('loadout send: --to <handle>@greprag.com is required');
121
+ process.exit(1);
122
+ }
123
+ const skills = getFlags(args, '--skill');
124
+ const dirs = getFlags(args, '--dir');
125
+ const advisor = getFlag(args, '--advisor');
126
+ const note = getFlag(args, '--note');
127
+ const line = getFlag(args, '--line');
128
+ // --dir: read each skill dir off disk here (the escape hatch for unmirrored skills).
129
+ const dirSkills = [];
130
+ const homeDir = process.env.HOME || process.env.USERPROFILE || '';
131
+ for (const d of dirs) {
132
+ // Accept either a path to a skill dir OR a bare skill name (resolved like the mirror).
133
+ const dirPath = d.includes('/') || d.includes('\\') || path.isAbsolute(d)
134
+ ? d : ((0, skill_landing_1.resolveSkillDir)(d, process.cwd(), homeDir) || d);
135
+ const files = (0, skill_mirror_client_1.collectSkillFiles)(dirPath);
136
+ if (!files) {
137
+ console.error(`loadout send: no SKILL.md under --dir "${d}" (${dirPath})`);
138
+ process.exit(1);
139
+ }
140
+ dirSkills.push({ name: path.basename(dirPath), files });
141
+ }
142
+ if (skills.length === 0 && dirSkills.length === 0) {
143
+ console.error('loadout send: pass at least one --skill <name> or --dir <path>');
144
+ process.exit(1);
145
+ }
146
+ const { ok, status, data } = await api('POST', '/v1/loadout/send', {
147
+ to, skills, dirSkills, advisor, note, line,
148
+ });
149
+ if (!ok)
150
+ fail(data, status);
151
+ const manifest = data.manifest;
152
+ const names = (manifest?.skills || []).map((s) => s.name).join(', ');
153
+ console.log(`🎒 Loadout sent to ${data.to} — id ${data.id}`);
154
+ console.log(` advisor: ${data.advisor} · skills: ${names} · ${manifest?.totalBytes ?? 0} bytes`);
155
+ console.log(` It's an offer — they run \`greprag loadout open ${data.id}\` then equip/decline.`);
156
+ }
157
+ // ---------- list / status -----------------------------------------------------
158
+ function printLoadoutRow(l) {
159
+ const m = l.manifest;
160
+ const skills = (m?.skills || []).map((s) => s.name).join(', ');
161
+ const from = l.fromHandle || l.fromTenantId;
162
+ const note = l.note ? ` — "${l.note}"` : '';
163
+ console.log(` ${l.id} [${l.status}] from ${from} advisor=${l.advisor}${note}`);
164
+ console.log(` skills: ${skills}`);
165
+ }
166
+ async function list() {
167
+ const { ok, status, data } = await api('GET', '/v1/loadout/inbox');
168
+ if (!ok)
169
+ fail(data, status);
170
+ const rows = data.loadouts || [];
171
+ if (rows.length === 0) {
172
+ console.log('No loadouts offered. (A gift lands here as a front-desk cold open.)');
173
+ return;
174
+ }
175
+ console.log(`\n${rows.length} loadout(s) offered — \`greprag loadout open <id>\` to review:\n`);
176
+ rows.forEach(printLoadoutRow);
177
+ console.log('');
178
+ }
179
+ async function status() {
180
+ const { ok, status: st, data } = await api('GET', '/v1/loadout/sent');
181
+ if (!ok)
182
+ fail(data, st);
183
+ const rows = data.loadouts || [];
184
+ if (rows.length === 0) {
185
+ console.log('You have not sent any loadouts.');
186
+ return;
187
+ }
188
+ console.log(`\nLoadouts you've sent:\n`);
189
+ for (const l of rows) {
190
+ const m = l.manifest;
191
+ const skills = (m?.skills || []).map((s) => s.name).join(', ');
192
+ console.log(` ${l.id} [${l.status}] → ${l.toTenantId} advisor=${l.advisor} (${skills})`);
193
+ }
194
+ console.log('');
195
+ }
196
+ // ---------- open --------------------------------------------------------------
197
+ async function open(id) {
198
+ if (!id) {
199
+ console.error('loadout open <id>');
200
+ process.exit(1);
201
+ }
202
+ const { ok, status, data } = await api('GET', `/v1/loadout/${encodeURIComponent(id)}`);
203
+ if (!ok)
204
+ fail(data, status);
205
+ const l = data.loadout;
206
+ const m = l.manifest;
207
+ console.log(`\n🎒 Loadout ${l.id} [${l.status}]`);
208
+ console.log(` from: ${l.fromHandle || l.fromTenantId} advisor: ${l.advisor}`);
209
+ if (l.note)
210
+ console.log(` note: "${l.note}"`);
211
+ console.log(`\n Announce (self-inflates at every SessionStart once equipped):`);
212
+ console.log(` ${m.announce.line}`);
213
+ console.log(`\n Skills (${m.skills.length}, ${m.totalBytes} bytes total):`);
214
+ for (const s of m.skills) {
215
+ console.log(` • ${s.name} — ${s.description || '(no description)'}`);
216
+ for (const f of s.files)
217
+ console.log(` ${f.path} (${f.bytes} bytes)`);
218
+ }
219
+ const preview = data.preview || [];
220
+ if (preview.length) {
221
+ console.log(`\n Preview (head of each file — never auto-ingested):`);
222
+ for (const p of preview) {
223
+ console.log(`\n ── ${p.skill}/${p.path} ${'─'.repeat(Math.max(0, 40 - p.path.length))}`);
224
+ console.log(p.head.split('\n').map((ln) => ` ${ln}`).join('\n'));
225
+ if (p.truncated)
226
+ console.log(' …');
227
+ }
228
+ }
229
+ console.log(`\n Equip: greprag loadout equip ${l.id} · Decline: greprag loadout decline ${l.id}\n`);
230
+ }
231
+ // ---------- equip / decline ---------------------------------------------------
232
+ async function equip(id, args) {
233
+ if (!id) {
234
+ console.error('loadout equip <id>');
235
+ process.exit(1);
236
+ }
237
+ const toSkills = args.includes('--to-skills');
238
+ const { ok, status, data } = await api('POST', `/v1/loadout/${encodeURIComponent(id)}/equip`, { toSkills });
239
+ if (!ok)
240
+ fail(data, status);
241
+ const decl = data.equipped;
242
+ const copied = data.skillsCopied || [];
243
+ console.log(`✅ Equipped — ${copied.length} skill(s) copied to your load store: ${copied.join(', ')}`);
244
+ console.log(` Auto-inflates next session:`);
245
+ console.log(` ${decl.announceLine}`);
246
+ console.log(` Sensor keywords (${decl.keywords.length}): ${decl.keywords.slice(0, 12).join(' · ')}${decl.keywords.length > 12 ? ' …' : ''}`);
247
+ console.log(` Load it now: greprag load ${decl.advisor}`);
248
+ }
249
+ async function decline(id) {
250
+ if (!id) {
251
+ console.error('loadout decline <id>');
252
+ process.exit(1);
253
+ }
254
+ const { ok, status, data } = await api('POST', `/v1/loadout/${encodeURIComponent(id)}/decline`);
255
+ if (!ok)
256
+ fail(data, status);
257
+ console.log(`Declined loadout ${id} — its snapshot was discarded.`);
258
+ }
259
+ // ---------- unequip -----------------------------------------------------------
260
+ async function unequip(name, args) {
261
+ if (!name) {
262
+ console.error('loadout unequip <name>');
263
+ process.exit(1);
264
+ }
265
+ const deleteSkills = args.includes('--delete-skills');
266
+ const { ok, status, data } = await api('POST', '/v1/loadout/unequip', { name, deleteSkills });
267
+ if (!ok)
268
+ fail(data, status);
269
+ console.log(`Unequipped "${name}" — the auto-inflate pointer is removed.${deleteSkills ? ' Advisor skill copy deleted.' : ''}`);
270
+ }
271
+ async function runLoadout(args) {
272
+ const sub = args[0];
273
+ const rest = args.slice(1);
274
+ switch (sub) {
275
+ case 'send': return send(rest);
276
+ case 'list': return list();
277
+ case 'status': return status();
278
+ case 'open': return open(rest[0]);
279
+ case 'equip':
280
+ case 'accept': return equip(rest[0], rest);
281
+ case 'decline': return decline(rest[0]);
282
+ case 'unequip': return unequip(rest[0], rest);
283
+ default:
284
+ console.log(HELP);
285
+ return;
286
+ }
287
+ }
288
+ //# sourceMappingURL=loadout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadout.js","sourceRoot":"","sources":["../../src/commands/loadout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;kFAakF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8MlF,gCAgBC;AA5ND,gEAA2D;AAC3D,oDAAmD;AACnD,2CAA6B;AAE7B,SAAS,SAAS;IAChB,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB;QAChE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE;KAC1C,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;IAC5C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzG,OAAO,GAAG,CAAC;AACb,CAAC;AACD,SAAS,OAAO,CAAC,IAAc,EAAE,IAAY;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;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OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,KAAK,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC9C;YACE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO;IACX,CAAC;AACH,CAAC"}
@@ -25,6 +25,7 @@ const enrichment_health_reminder_1 = require("./enrichment-health-reminder");
25
25
  const skill_gain_reminder_1 = require("./skill-gain-reminder");
26
26
  const skill_mirror_reminder_1 = require("./skill-mirror-reminder");
27
27
  const procedure_reminder_1 = require("./procedure-reminder");
28
+ const loadout_reminder_1 = require("./loadout-reminder");
28
29
  /** Registry order = display order. THE single agent-facing announce/reminder assembly:
29
30
  * the hook does I/O → fills ReminderEnv → collectAnnounces (SessionStart) / collectReminders
30
31
  * (per turn) render every module here in this order. Order preserves the historical recap
@@ -41,6 +42,7 @@ exports.REGISTRY = [
41
42
  skill_gain_reminder_1.skillGainAnnounceModule, // announce-only skill-gain landings (docs/skill-learning-loop.md)
42
43
  skill_mirror_reminder_1.skillMirrorAnnounceModule, // one-line Tier-3 pointer: your skills travel via greprag load (docs/load-system.md)
43
44
  procedure_reminder_1.procedureAnnounceModule, // active project procedures, rendered generically from operator-owned installs
45
+ loadout_reminder_1.loadoutRegistrarModule, // equipped loadouts: one advisor announce each + per-turn keyword Match (docs/loadout.md)
44
46
  setup_reminder_1.setupWarningModule,
45
47
  version_reminder_1.versionUpgradeModule, // Deficiency-gated announce — silent unless a newer release exists
46
48
  enrichment_health_reminder_1.enrichmentHealthModule, // Deficiency-gated announce — silent unless the Gemini probe fails (fix c2eb8777)
@@ -1 +1 @@
1
- {"version":3,"file":"reminder-registry.js","sourceRoot":"","sources":["../../src/commands/reminder-registry.ts"],"names":[],"mappings":";AAAA;;;;kEAIkE;;;AAsElE,4CAaC;AAMD,8BAkBC;AAID,4CAUC;AAtHD,mEAA4D;AAC5D,iEAAkF;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ACrB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -98,10 +98,27 @@ export interface ReminderEnv {
98
98
  * reads the operator-owned procedure store; one generic announce module
99
99
  * renders them. adr/procedure-install-control-plane.md */
100
100
  procedureAnnounces?: string[];
101
+ /** Equipped loadouts (docs/loadout.md, adr/loadout.md) — the recipient's
102
+ * self-inflating skill bundles. The hook fetches /v1/loadout/equipped at
103
+ * SessionStart (→ the ONE advisor announce line each) AND caches them locally
104
+ * so the per-turn read is network-free (→ the Match keyword sensor). Each
105
+ * decl is inert DATA (the pointer line + derived keywords), never code.
106
+ * Empty/undefined → the loadout-registrar module stays silent. */
107
+ equippedLoadouts?: Array<{
108
+ name: string;
109
+ advisor: string;
110
+ announceLine: string;
111
+ keywords: string[];
112
+ }>;
101
113
  /** Auto-surfaced episodic-memory injection — the hook owns the recall-intent gate +
102
114
  * the search + the confidence gate + framing; the memory-reflex module routes the
103
115
  * framed string as its per-turn reminder. Null = nothing cleared the gate this turn. */
104
116
  memoryHit?: string | null;
117
+ /** The user's prompt text (the `prompt` read surface for a Match trigger —
118
+ * docs/reminder-interrupt.md, the landed map). Present only on the per-turn
119
+ * UserPromptSubmit env; undefined at SessionStart/PreToolUse. The loadout
120
+ * keyword sensor is its first live consumer (the `prompt` source had none). */
121
+ promptText?: string | null;
105
122
  /** The Bash command about to run (the `command` read surface for a Match trigger).
106
123
  * Present only on the PreToolUse env; undefined at UserPromptSubmit. */
107
124
  toolCommand?: string | null;
@@ -0,0 +1,20 @@
1
+ /** Equipped-loadouts local cache (docs/loadout.md §activation model). The
2
+ * SessionStart hook fetches /v1/loadout/equipped ONCE (network) and writes the
3
+ * inert announce declarations here; the per-turn UserPromptSubmit hook READS
4
+ * this cache (zero network on the hot path) to drive the loadout-registrar's
5
+ * Match keyword sensor. Mirrors the skill-mirror-client state-file pattern.
6
+ *
7
+ * Pure DATA only — the pointer line + derived keywords + advisor name. No code
8
+ * ever lands here; the registrar (bundled in the binary) is the only executable
9
+ * piece. Best-effort end to end: a read/write miss just means the per-turn Match
10
+ * is quiet until the next SessionStart refreshes the cache. */
11
+ export interface EquippedLoadoutDecl {
12
+ name: string;
13
+ advisor: string;
14
+ announceLine: string;
15
+ keywords: string[];
16
+ }
17
+ /** The cached equipped-loadout declarations (empty on any miss). Never throws. */
18
+ export declare function readEquippedLoadouts(): EquippedLoadoutDecl[];
19
+ /** Overwrite the cache with the SessionStart fetch result. Never throws. */
20
+ export declare function writeEquippedLoadouts(loadouts: EquippedLoadoutDecl[]): void;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /** Equipped-loadouts local cache (docs/loadout.md §activation model). The
3
+ * SessionStart hook fetches /v1/loadout/equipped ONCE (network) and writes the
4
+ * inert announce declarations here; the per-turn UserPromptSubmit hook READS
5
+ * this cache (zero network on the hot path) to drive the loadout-registrar's
6
+ * Match keyword sensor. Mirrors the skill-mirror-client state-file pattern.
7
+ *
8
+ * Pure DATA only — the pointer line + derived keywords + advisor name. No code
9
+ * ever lands here; the registrar (bundled in the binary) is the only executable
10
+ * piece. Best-effort end to end: a read/write miss just means the per-turn Match
11
+ * is quiet until the next SessionStart refreshes the cache. */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.readEquippedLoadouts = readEquippedLoadouts;
47
+ exports.writeEquippedLoadouts = writeEquippedLoadouts;
48
+ const fs = __importStar(require("fs"));
49
+ const path = __importStar(require("path"));
50
+ function cachePath() {
51
+ const home = process.env.HOME || process.env.USERPROFILE || '';
52
+ return path.join(home, '.greprag', 'state', 'equipped-loadouts.json');
53
+ }
54
+ /** The cached equipped-loadout declarations (empty on any miss). Never throws. */
55
+ function readEquippedLoadouts() {
56
+ try {
57
+ const parsed = JSON.parse(fs.readFileSync(cachePath(), 'utf-8'));
58
+ const list = Array.isArray(parsed?.loadouts) ? parsed.loadouts : [];
59
+ return list
60
+ .filter((l) => !!l && typeof l.name === 'string' && typeof l.advisor === 'string'
61
+ && typeof l.announceLine === 'string' && Array.isArray(l.keywords))
62
+ .map((l) => ({ ...l, keywords: l.keywords.filter((k) => typeof k === 'string') }));
63
+ }
64
+ catch {
65
+ return [];
66
+ }
67
+ }
68
+ /** Overwrite the cache with the SessionStart fetch result. Never throws. */
69
+ function writeEquippedLoadouts(loadouts) {
70
+ try {
71
+ const file = cachePath();
72
+ fs.mkdirSync(path.dirname(file), { recursive: true });
73
+ fs.writeFileSync(file, JSON.stringify({ loadouts, fetchedAt: new Date().toISOString() }, null, 2) + '\n');
74
+ }
75
+ catch {
76
+ /* best-effort — a write miss just leaves the prior cache in place */
77
+ }
78
+ }
79
+ //# sourceMappingURL=equipped-loadouts-cache.js.map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