greprag 5.55.0 → 5.57.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.
- package/dist/commands/loadout-reminder.d.ts +37 -0
- package/dist/commands/loadout-reminder.js +78 -0
- package/dist/commands/loadout-reminder.js.map +1 -0
- package/dist/commands/loadout.d.ts +15 -0
- package/dist/commands/loadout.js +320 -0
- package/dist/commands/loadout.js.map +1 -0
- package/dist/commands/reminder-registry.js +2 -0
- package/dist/commands/reminder-registry.js.map +1 -1
- package/dist/commands/reminder-types.d.ts +29 -0
- package/dist/commands/version-reminder.d.ts +13 -1
- package/dist/commands/version-reminder.js +24 -1
- package/dist/commands/version-reminder.js.map +1 -1
- package/dist/equipped-loadouts-cache.d.ts +20 -0
- package/dist/equipped-loadouts-cache.js +79 -0
- package/dist/equipped-loadouts-cache.js.map +1 -0
- package/dist/hook.js +58 -0
- package/dist/hook.js.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/opencode-plugin.bundle.js +51 -0
- package/package.json +1 -1
|
@@ -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,Y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jH,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,320 @@
|
|
|
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
|
+
const fs = __importStar(require("fs"));
|
|
55
|
+
function getConfig() {
|
|
56
|
+
return {
|
|
57
|
+
apiUrl: process.env.GREPRAG_API_URL || 'https://api.greprag.com',
|
|
58
|
+
apiKey: process.env.GREPRAG_API_KEY || '',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** This CLI's installed version (bundled package.json) — stamped on every loadout
|
|
62
|
+
* call as `x-greprag-cli-version` (docs/loadout.md §Version gating). The server
|
|
63
|
+
* uses it to stamp the equip floor at `send` (the recipient needs ≥ the sender's
|
|
64
|
+
* version) and to GATE `equip` (a below-floor client → 426, never a silent 500).
|
|
65
|
+
* Null → header omitted (server falls back to its floor default). */
|
|
66
|
+
function cliVersion() {
|
|
67
|
+
try {
|
|
68
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'));
|
|
69
|
+
return typeof pkg.version === 'string' ? pkg.version : null;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** All values for a repeatable flag (`--skill a --skill b`). */
|
|
76
|
+
function getFlags(args, flag) {
|
|
77
|
+
const out = [];
|
|
78
|
+
for (let i = 0; i < args.length; i++)
|
|
79
|
+
if (args[i] === flag && i + 1 < args.length)
|
|
80
|
+
out.push(args[i + 1]);
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
function getFlag(args, flag) {
|
|
84
|
+
const idx = args.indexOf(flag);
|
|
85
|
+
return idx === -1 || idx + 1 >= args.length ? undefined : args[idx + 1];
|
|
86
|
+
}
|
|
87
|
+
const HELP = `greprag loadout — gift a skill bundle to another tenant (docs/loadout.md)
|
|
88
|
+
|
|
89
|
+
A loadout is an OFFER, never a delivery: the recipient's operator equips it. On
|
|
90
|
+
equip it copies into their load store (served by \`greprag load\`) and
|
|
91
|
+
self-inflates via the Interrupt System — nothing is written to ~/.claude/skills.
|
|
92
|
+
|
|
93
|
+
USAGE
|
|
94
|
+
greprag loadout send --to <handle>@greprag.com --skill <name> [--skill <n> …]
|
|
95
|
+
[--dir <path>] [--advisor <name>] [--note "equip me"] [--line "…"]
|
|
96
|
+
Freeze + send a loadout. --skill pulls each skill from YOUR mirror store
|
|
97
|
+
(use it once so it mirrors, or pass --dir). --dir <path> snapshots a
|
|
98
|
+
skill directory straight from disk. --advisor names the router skill that
|
|
99
|
+
gets the SessionStart pointer (default: the first skill).
|
|
100
|
+
|
|
101
|
+
greprag loadout list Offered loadouts at your front desk.
|
|
102
|
+
greprag loadout open <id> Manifest + a bounded content preview.
|
|
103
|
+
greprag loadout equip <id> Equip it (alias: accept).
|
|
104
|
+
greprag loadout decline <id> Decline — GCs the snapshot.
|
|
105
|
+
greprag loadout status Loadouts you've sent + their state.
|
|
106
|
+
greprag loadout unequip <name> [--delete-skills]
|
|
107
|
+
Stop a loadout's auto-inflate (optionally
|
|
108
|
+
delete the copied advisor skill too).`;
|
|
109
|
+
async function api(method, pathname, body) {
|
|
110
|
+
const cfg = getConfig();
|
|
111
|
+
if (!cfg.apiKey) {
|
|
112
|
+
console.error('GREPRAG_API_KEY not set — run `greprag init` first.');
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
const headers = {
|
|
116
|
+
'Authorization': `Bearer ${cfg.apiKey}`, 'Content-Type': 'application/json',
|
|
117
|
+
};
|
|
118
|
+
const ver = cliVersion();
|
|
119
|
+
if (ver)
|
|
120
|
+
headers['x-greprag-cli-version'] = ver; // stamp the floor (send) / gate the equip
|
|
121
|
+
const res = await fetch(`${cfg.apiUrl}${pathname}`, {
|
|
122
|
+
method,
|
|
123
|
+
headers,
|
|
124
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
125
|
+
});
|
|
126
|
+
let data = {};
|
|
127
|
+
try {
|
|
128
|
+
data = await res.json();
|
|
129
|
+
}
|
|
130
|
+
catch { /* non-JSON */ }
|
|
131
|
+
return { ok: res.ok, status: res.status, data };
|
|
132
|
+
}
|
|
133
|
+
function fail(data, status) {
|
|
134
|
+
console.error(`Error${status ? ` (${status})` : ''}: ${data.error || 'request failed'}`);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
// ---------- send --------------------------------------------------------------
|
|
138
|
+
async function send(args) {
|
|
139
|
+
const to = getFlag(args, '--to');
|
|
140
|
+
if (!to) {
|
|
141
|
+
console.error('loadout send: --to <handle>@greprag.com is required');
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
const skills = getFlags(args, '--skill');
|
|
145
|
+
const dirs = getFlags(args, '--dir');
|
|
146
|
+
const advisor = getFlag(args, '--advisor');
|
|
147
|
+
const note = getFlag(args, '--note');
|
|
148
|
+
const line = getFlag(args, '--line');
|
|
149
|
+
// --dir: read each skill dir off disk here (the escape hatch for unmirrored skills).
|
|
150
|
+
const dirSkills = [];
|
|
151
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || '';
|
|
152
|
+
for (const d of dirs) {
|
|
153
|
+
// Accept either a path to a skill dir OR a bare skill name (resolved like the mirror).
|
|
154
|
+
const dirPath = d.includes('/') || d.includes('\\') || path.isAbsolute(d)
|
|
155
|
+
? d : ((0, skill_landing_1.resolveSkillDir)(d, process.cwd(), homeDir) || d);
|
|
156
|
+
const files = (0, skill_mirror_client_1.collectSkillFiles)(dirPath);
|
|
157
|
+
if (!files) {
|
|
158
|
+
console.error(`loadout send: no SKILL.md under --dir "${d}" (${dirPath})`);
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}
|
|
161
|
+
dirSkills.push({ name: path.basename(dirPath), files });
|
|
162
|
+
}
|
|
163
|
+
if (skills.length === 0 && dirSkills.length === 0) {
|
|
164
|
+
console.error('loadout send: pass at least one --skill <name> or --dir <path>');
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
const { ok, status, data } = await api('POST', '/v1/loadout/send', {
|
|
168
|
+
to, skills, dirSkills, advisor, note, line,
|
|
169
|
+
});
|
|
170
|
+
if (!ok)
|
|
171
|
+
fail(data, status);
|
|
172
|
+
const manifest = data.manifest;
|
|
173
|
+
const names = (manifest?.skills || []).map((s) => s.name).join(', ');
|
|
174
|
+
console.log(`🎒 Loadout sent to ${data.to} — id ${data.id}`);
|
|
175
|
+
console.log(` advisor: ${data.advisor} · skills: ${names} · ${manifest?.totalBytes ?? 0} bytes`);
|
|
176
|
+
console.log(` It's an offer — they run \`greprag loadout open ${data.id}\` then equip/decline.`);
|
|
177
|
+
}
|
|
178
|
+
// ---------- list / status -----------------------------------------------------
|
|
179
|
+
function printLoadoutRow(l) {
|
|
180
|
+
const m = l.manifest;
|
|
181
|
+
const skills = (m?.skills || []).map((s) => s.name).join(', ');
|
|
182
|
+
const from = l.fromHandle || l.fromTenantId;
|
|
183
|
+
const note = l.note ? ` — "${l.note}"` : '';
|
|
184
|
+
console.log(` ${l.id} [${l.status}] from ${from} advisor=${l.advisor}${note}`);
|
|
185
|
+
console.log(` skills: ${skills}`);
|
|
186
|
+
}
|
|
187
|
+
async function list() {
|
|
188
|
+
const { ok, status, data } = await api('GET', '/v1/loadout/inbox');
|
|
189
|
+
if (!ok)
|
|
190
|
+
fail(data, status);
|
|
191
|
+
const rows = data.loadouts || [];
|
|
192
|
+
if (rows.length === 0) {
|
|
193
|
+
console.log('No loadouts offered. (A gift lands here as a front-desk cold open.)');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
console.log(`\n${rows.length} loadout(s) offered — \`greprag loadout open <id>\` to review:\n`);
|
|
197
|
+
rows.forEach(printLoadoutRow);
|
|
198
|
+
console.log('');
|
|
199
|
+
}
|
|
200
|
+
async function status() {
|
|
201
|
+
const { ok, status: st, data } = await api('GET', '/v1/loadout/sent');
|
|
202
|
+
if (!ok)
|
|
203
|
+
fail(data, st);
|
|
204
|
+
const rows = data.loadouts || [];
|
|
205
|
+
if (rows.length === 0) {
|
|
206
|
+
console.log('You have not sent any loadouts.');
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
console.log(`\nLoadouts you've sent:\n`);
|
|
210
|
+
for (const l of rows) {
|
|
211
|
+
const m = l.manifest;
|
|
212
|
+
const skills = (m?.skills || []).map((s) => s.name).join(', ');
|
|
213
|
+
console.log(` ${l.id} [${l.status}] → ${l.toTenantId} advisor=${l.advisor} (${skills})`);
|
|
214
|
+
}
|
|
215
|
+
console.log('');
|
|
216
|
+
}
|
|
217
|
+
// ---------- open --------------------------------------------------------------
|
|
218
|
+
async function open(id) {
|
|
219
|
+
if (!id) {
|
|
220
|
+
console.error('loadout open <id>');
|
|
221
|
+
process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
const { ok, status, data } = await api('GET', `/v1/loadout/${encodeURIComponent(id)}`);
|
|
224
|
+
if (!ok)
|
|
225
|
+
fail(data, status);
|
|
226
|
+
const l = data.loadout;
|
|
227
|
+
const m = l.manifest;
|
|
228
|
+
console.log(`\n🎒 Loadout ${l.id} [${l.status}]`);
|
|
229
|
+
console.log(` from: ${l.fromHandle || l.fromTenantId} advisor: ${l.advisor}`);
|
|
230
|
+
if (l.note)
|
|
231
|
+
console.log(` note: "${l.note}"`);
|
|
232
|
+
console.log(`\n Announce (self-inflates at every SessionStart once equipped):`);
|
|
233
|
+
console.log(` ${m.announce.line}`);
|
|
234
|
+
console.log(`\n Skills (${m.skills.length}, ${m.totalBytes} bytes total):`);
|
|
235
|
+
for (const s of m.skills) {
|
|
236
|
+
console.log(` • ${s.name} — ${s.description || '(no description)'}`);
|
|
237
|
+
for (const f of s.files)
|
|
238
|
+
console.log(` ${f.path} (${f.bytes} bytes)`);
|
|
239
|
+
}
|
|
240
|
+
const preview = data.preview || [];
|
|
241
|
+
if (preview.length) {
|
|
242
|
+
console.log(`\n Preview (head of each file — never auto-ingested):`);
|
|
243
|
+
for (const p of preview) {
|
|
244
|
+
console.log(`\n ── ${p.skill}/${p.path} ${'─'.repeat(Math.max(0, 40 - p.path.length))}`);
|
|
245
|
+
console.log(p.head.split('\n').map((ln) => ` ${ln}`).join('\n'));
|
|
246
|
+
if (p.truncated)
|
|
247
|
+
console.log(' …');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
console.log(`\n Equip: greprag loadout equip ${l.id} · Decline: greprag loadout decline ${l.id}\n`);
|
|
251
|
+
}
|
|
252
|
+
// ---------- equip / decline ---------------------------------------------------
|
|
253
|
+
async function equip(id, args) {
|
|
254
|
+
if (!id) {
|
|
255
|
+
console.error('loadout equip <id>');
|
|
256
|
+
process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
const toSkills = args.includes('--to-skills');
|
|
259
|
+
const { ok, status, data } = await api('POST', `/v1/loadout/${encodeURIComponent(id)}/equip`, { toSkills });
|
|
260
|
+
if (!ok) {
|
|
261
|
+
// 426 Upgrade Required — this loadout needs a newer greprag than we're running.
|
|
262
|
+
// A clear, non-scary refusal (not a generic error), with the fix. The grant is
|
|
263
|
+
// left offered, so the same id equips after upgrading. docs/loadout.md §Version gating.
|
|
264
|
+
if (status === 426) {
|
|
265
|
+
const ur = data.updateRequired || {};
|
|
266
|
+
console.error(`⛔ Can't equip yet — this loadout needs greprag ≥ v${ur.needed || '?'} (you're on v${ur.current || 'unknown'}).`);
|
|
267
|
+
console.error(` Upgrade: npm i -g greprag@latest`);
|
|
268
|
+
console.error(` Then: greprag loadout equip ${id}`);
|
|
269
|
+
process.exit(1);
|
|
270
|
+
}
|
|
271
|
+
fail(data, status);
|
|
272
|
+
}
|
|
273
|
+
const decl = data.equipped;
|
|
274
|
+
const copied = data.skillsCopied || [];
|
|
275
|
+
console.log(`✅ Equipped — ${copied.length} skill(s) copied to your load store: ${copied.join(', ')}`);
|
|
276
|
+
console.log(` Auto-inflates next session:`);
|
|
277
|
+
console.log(` ${decl.announceLine}`);
|
|
278
|
+
console.log(` Sensor keywords (${decl.keywords.length}): ${decl.keywords.slice(0, 12).join(' · ')}${decl.keywords.length > 12 ? ' …' : ''}`);
|
|
279
|
+
console.log(` Load it now: greprag load ${decl.advisor}`);
|
|
280
|
+
}
|
|
281
|
+
async function decline(id) {
|
|
282
|
+
if (!id) {
|
|
283
|
+
console.error('loadout decline <id>');
|
|
284
|
+
process.exit(1);
|
|
285
|
+
}
|
|
286
|
+
const { ok, status, data } = await api('POST', `/v1/loadout/${encodeURIComponent(id)}/decline`);
|
|
287
|
+
if (!ok)
|
|
288
|
+
fail(data, status);
|
|
289
|
+
console.log(`Declined loadout ${id} — its snapshot was discarded.`);
|
|
290
|
+
}
|
|
291
|
+
// ---------- unequip -----------------------------------------------------------
|
|
292
|
+
async function unequip(name, args) {
|
|
293
|
+
if (!name) {
|
|
294
|
+
console.error('loadout unequip <name>');
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
const deleteSkills = args.includes('--delete-skills');
|
|
298
|
+
const { ok, status, data } = await api('POST', '/v1/loadout/unequip', { name, deleteSkills });
|
|
299
|
+
if (!ok)
|
|
300
|
+
fail(data, status);
|
|
301
|
+
console.log(`Unequipped "${name}" — the auto-inflate pointer is removed.${deleteSkills ? ' Advisor skill copy deleted.' : ''}`);
|
|
302
|
+
}
|
|
303
|
+
async function runLoadout(args) {
|
|
304
|
+
const sub = args[0];
|
|
305
|
+
const rest = args.slice(1);
|
|
306
|
+
switch (sub) {
|
|
307
|
+
case 'send': return send(rest);
|
|
308
|
+
case 'list': return list();
|
|
309
|
+
case 'status': return status();
|
|
310
|
+
case 'open': return open(rest[0]);
|
|
311
|
+
case 'equip':
|
|
312
|
+
case 'accept': return equip(rest[0], rest);
|
|
313
|
+
case 'decline': return decline(rest[0]);
|
|
314
|
+
case 'unequip': return unequip(rest[0], rest);
|
|
315
|
+
default:
|
|
316
|
+
console.log(HELP);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=loadout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadout.js","sourceRoot":"","sources":["../../src/commands/loadout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;kF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AC;IAC9F,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,2CAA2C,YAAY,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClI,CAAC;AAEM,KAAK,UAAU,UAAU,CAAC,IAAc;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,MAAM,CAAC,CAAI,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,MAAM,CAAC,CAAI,OAAO,IAAI,EAAE,CAAC;QAC9B,KAAK,QAAQ,CAAC,CAAE,OAAO,MAAM,EAAE,CAAC;QAChC,KAAK,MAAM,CAAC,CAAI,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC,CAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC5C,KAAK,SAAS,CAAC,CAAC,OAAO,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;;;
|
|
1
|
+
{"version":3,"file":"reminder-registry.js","sourceRoot":"","sources":["../../src/commands/reminder-registry.ts"],"names":[],"mappings":";AAAA;;;;kEAIkE;;;AAwElE,4CAaC;AAMD,8BAkBC;AAID,4CAUC;AAxHD,mEAA4D;AAC5D,iEAAkF;AAClF,mEAA4D;AAC5D,uDAAyD;AACzD,iEAAkE;AAClE,qDAAsD;AACtD,6DAA+D;AAC/D,mDAAqD;AACrD,iDAAkD;AAClD,2DAA6D;AAC7D,6DAA4D;AAC5D,yDAA0D;AAC1D,6EAAsE;AACtE,+DAAgE;AAChE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C,CAAC,CAAC,EAAE,CAAC,CAAC;QACnB,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;YACpC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC;gBAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,sCAAsC;QACzD,CAAC;QACD,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;yDACyD;AACzD,SAAgB,gBAAgB,CAC9B,GAAgB,EAAE,WAA6B,gBAAQ;IAEvD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,GAAkB,IAAI,CAAC;QAC5B,IAAI,CAAC;YAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC;YAAC,SAAS;QAAC,CAAC;QAChD,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -52,6 +52,18 @@ export interface ReminderEnv {
|
|
|
52
52
|
current: string;
|
|
53
53
|
latest: string;
|
|
54
54
|
} | null;
|
|
55
|
+
/** Deficiency-gated announce signal (docs/loadout.md §Version gating): a PENDING
|
|
56
|
+
* loadout requires a NEWER greprag than installed — the recipient can't equip it
|
|
57
|
+
* until they upgrade. Set by the hook (SessionStart pending-loadout summaries vs
|
|
58
|
+
* the bundled package.json version; picks the highest-floor pending loadout so
|
|
59
|
+
* one upgrade satisfies all). null/undefined when no pending loadout is above the
|
|
60
|
+
* installed floor. Drives the CONTEXTUALIZED version-upgrade announce — names the
|
|
61
|
+
* waiting loadout + the required version. Auto-clears on upgrade (Deficiency). */
|
|
62
|
+
loadoutUpdateRequired?: {
|
|
63
|
+
from: string;
|
|
64
|
+
needed: string;
|
|
65
|
+
current: string;
|
|
66
|
+
} | null;
|
|
55
67
|
/** Names of the api-docs-tagged corpus stores (the hook lists `?tag=api-docs`).
|
|
56
68
|
* Drives the corpus announce: name the on-tap reference banks so an agent
|
|
57
69
|
* searches them before answering from training data. Empty/undefined → the
|
|
@@ -98,10 +110,27 @@ export interface ReminderEnv {
|
|
|
98
110
|
* reads the operator-owned procedure store; one generic announce module
|
|
99
111
|
* renders them. adr/procedure-install-control-plane.md */
|
|
100
112
|
procedureAnnounces?: string[];
|
|
113
|
+
/** Equipped loadouts (docs/loadout.md, adr/loadout.md) — the recipient's
|
|
114
|
+
* self-inflating skill bundles. The hook fetches /v1/loadout/equipped at
|
|
115
|
+
* SessionStart (→ the ONE advisor announce line each) AND caches them locally
|
|
116
|
+
* so the per-turn read is network-free (→ the Match keyword sensor). Each
|
|
117
|
+
* decl is inert DATA (the pointer line + derived keywords), never code.
|
|
118
|
+
* Empty/undefined → the loadout-registrar module stays silent. */
|
|
119
|
+
equippedLoadouts?: Array<{
|
|
120
|
+
name: string;
|
|
121
|
+
advisor: string;
|
|
122
|
+
announceLine: string;
|
|
123
|
+
keywords: string[];
|
|
124
|
+
}>;
|
|
101
125
|
/** Auto-surfaced episodic-memory injection — the hook owns the recall-intent gate +
|
|
102
126
|
* the search + the confidence gate + framing; the memory-reflex module routes the
|
|
103
127
|
* framed string as its per-turn reminder. Null = nothing cleared the gate this turn. */
|
|
104
128
|
memoryHit?: string | null;
|
|
129
|
+
/** The user's prompt text (the `prompt` read surface for a Match trigger —
|
|
130
|
+
* docs/reminder-interrupt.md, the landed map). Present only on the per-turn
|
|
131
|
+
* UserPromptSubmit env; undefined at SessionStart/PreToolUse. The loadout
|
|
132
|
+
* keyword sensor is its first live consumer (the `prompt` source had none). */
|
|
133
|
+
promptText?: string | null;
|
|
105
134
|
/** The Bash command about to run (the `command` read surface for a Match trigger).
|
|
106
135
|
* Present only on the PreToolUse env; undefined at UserPromptSubmit. */
|
|
107
136
|
toolCommand?: string | null;
|
|
@@ -8,8 +8,20 @@
|
|
|
8
8
|
* NOT a new announce kind: it is a primer gated by Deficiency, exactly like setup-warning
|
|
9
9
|
* (which announces only when there's a drift gap). The hook does the I/O (the daily-cached
|
|
10
10
|
* npm-registry version check) and passes the verdict as env.updateAvailable; this module
|
|
11
|
-
* is PURE — announce-only (detect → silent, reminder → null).
|
|
11
|
+
* is PURE — announce-only (detect → silent, reminder → null).
|
|
12
|
+
*
|
|
13
|
+
* Two Deficiency signals, one module (docs/loadout.md §Version gating step 4):
|
|
14
|
+
* - env.loadoutUpdateRequired — a PENDING loadout needs a newer greprag than
|
|
15
|
+
* installed. Takes precedence + NAMES the waiting loadout (the actionable case:
|
|
16
|
+
* "upgrade to equip the gift"). Independent of the npm check, so it fires even
|
|
17
|
+
* offline whenever a pending floor is above the installed version.
|
|
18
|
+
* - env.updateAvailable — the generic "behind latest published" nudge (fallback). */
|
|
12
19
|
import { ReminderModule } from './reminder-types';
|
|
13
20
|
/** The upgrade announce — null unless the hook detected a newer published version. */
|
|
14
21
|
export declare function buildVersionAnnounce(current: string, latest: string): string;
|
|
22
|
+
/** The CONTEXTUALIZED upgrade announce: a pending loadout is waiting but needs a
|
|
23
|
+
* newer greprag to equip. Names the sender + the required floor so the deficiency
|
|
24
|
+
* is actionable, not generic. Auto-clears once the installed version reaches the
|
|
25
|
+
* floor (the hook stops setting the signal). docs/loadout.md §Version gating. */
|
|
26
|
+
export declare function buildLoadoutUpdateAnnounce(from: string, needed: string, current: string): string;
|
|
15
27
|
export declare const versionUpgradeModule: ReminderModule;
|
|
@@ -9,10 +9,18 @@
|
|
|
9
9
|
* NOT a new announce kind: it is a primer gated by Deficiency, exactly like setup-warning
|
|
10
10
|
* (which announces only when there's a drift gap). The hook does the I/O (the daily-cached
|
|
11
11
|
* npm-registry version check) and passes the verdict as env.updateAvailable; this module
|
|
12
|
-
* is PURE — announce-only (detect → silent, reminder → null).
|
|
12
|
+
* is PURE — announce-only (detect → silent, reminder → null).
|
|
13
|
+
*
|
|
14
|
+
* Two Deficiency signals, one module (docs/loadout.md §Version gating step 4):
|
|
15
|
+
* - env.loadoutUpdateRequired — a PENDING loadout needs a newer greprag than
|
|
16
|
+
* installed. Takes precedence + NAMES the waiting loadout (the actionable case:
|
|
17
|
+
* "upgrade to equip the gift"). Independent of the npm check, so it fires even
|
|
18
|
+
* offline whenever a pending floor is above the installed version.
|
|
19
|
+
* - env.updateAvailable — the generic "behind latest published" nudge (fallback). */
|
|
13
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
21
|
exports.versionUpgradeModule = void 0;
|
|
15
22
|
exports.buildVersionAnnounce = buildVersionAnnounce;
|
|
23
|
+
exports.buildLoadoutUpdateAnnounce = buildLoadoutUpdateAnnounce;
|
|
16
24
|
/** The upgrade announce — null unless the hook detected a newer published version. */
|
|
17
25
|
function buildVersionAnnounce(current, latest) {
|
|
18
26
|
return [
|
|
@@ -20,10 +28,25 @@ function buildVersionAnnounce(current, latest) {
|
|
|
20
28
|
`Upgrade: \`npm i -g greprag@latest\`. New behavior + fixes land on your next session.`,
|
|
21
29
|
].join('\n');
|
|
22
30
|
}
|
|
31
|
+
/** The CONTEXTUALIZED upgrade announce: a pending loadout is waiting but needs a
|
|
32
|
+
* newer greprag to equip. Names the sender + the required floor so the deficiency
|
|
33
|
+
* is actionable, not generic. Auto-clears once the installed version reaches the
|
|
34
|
+
* floor (the hook stops setting the signal). docs/loadout.md §Version gating. */
|
|
35
|
+
function buildLoadoutUpdateAnnounce(from, needed, current) {
|
|
36
|
+
return [
|
|
37
|
+
`[greprag — 📦 a loadout from ${from} is waiting, but it needs a newer greprag to equip.]`,
|
|
38
|
+
`It requires greprag ≥ v${needed} (you are on v${current}).`,
|
|
39
|
+
`Upgrade: \`npm i -g greprag@latest\`, then \`greprag loadout list\` to equip it.`,
|
|
40
|
+
].join('\n');
|
|
41
|
+
}
|
|
23
42
|
exports.versionUpgradeModule = {
|
|
24
43
|
id: 'version-upgrade',
|
|
25
44
|
detect: (_env) => ({ tier: 'silent' }), // announce-only
|
|
26
45
|
announce: (env) => {
|
|
46
|
+
// A waiting loadout that needs an upgrade wins — it names the reason (step 4).
|
|
47
|
+
const lo = env.loadoutUpdateRequired;
|
|
48
|
+
if (lo && lo.needed && lo.current)
|
|
49
|
+
return buildLoadoutUpdateAnnounce(lo.from, lo.needed, lo.current);
|
|
27
50
|
const u = env.updateAvailable;
|
|
28
51
|
if (!u || !u.current || !u.latest)
|
|
29
52
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-reminder.js","sourceRoot":"","sources":["../../src/commands/version-reminder.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"version-reminder.js","sourceRoot":"","sources":["../../src/commands/version-reminder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;wFAiBwF;;;AAKxF,oDAKC;AAMD,gEAMC;AAlBD,sFAAsF;AACtF,SAAgB,oBAAoB,CAAC,OAAe,EAAE,MAAc;IAClE,OAAO;QACL,qCAAqC,MAAM,iBAAiB,OAAO,KAAK;QACxE,uFAAuF;KACxF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;kFAGkF;AAClF,SAAgB,0BAA0B,CAAC,IAAY,EAAE,MAAc,EAAE,OAAe;IACtF,OAAO;QACL,gCAAgC,IAAI,sDAAsD;QAC1F,0BAA0B,MAAM,iBAAiB,OAAO,IAAI;QAC5D,kFAAkF;KACnF,CAAC,IAAI,CAAC,IAAI,CAAC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