greprag 5.73.23 → 5.74.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/claude-lifecycle-cutover.d.ts +23 -0
- package/dist/claude-lifecycle-cutover.js +175 -0
- package/dist/claude-lifecycle-cutover.js.map +1 -0
- package/dist/commands/delivery-reminder.d.ts +10 -0
- package/dist/commands/delivery-reminder.js +44 -0
- package/dist/commands/delivery-reminder.js.map +1 -0
- package/dist/commands/delivery.d.ts +1 -0
- package/dist/commands/delivery.js +56 -0
- package/dist/commands/delivery.js.map +1 -0
- package/dist/commands/init.js +5 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/opencode-interrupt.d.ts +1 -0
- package/dist/commands/opencode-interrupt.js +1 -0
- package/dist/commands/opencode-interrupt.js.map +1 -1
- package/dist/commands/reminder-registry.js +2 -0
- package/dist/commands/reminder-registry.js.map +1 -1
- package/dist/commands/reminder-types.d.ts +4 -0
- package/dist/commands/skill.js +22 -1
- package/dist/commands/skill.js.map +1 -1
- package/dist/delivery-config.d.ts +35 -0
- package/dist/delivery-config.js +188 -0
- package/dist/delivery-config.js.map +1 -0
- package/dist/delivery-lifecycle.d.ts +3 -0
- package/dist/delivery-lifecycle.js +13 -0
- package/dist/delivery-lifecycle.js.map +1 -0
- package/dist/hook.js +28 -34
- package/dist/hook.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/native-skill-mirror.d.ts +3 -1
- package/dist/native-skill-mirror.js +11 -4
- package/dist/native-skill-mirror.js.map +1 -1
- package/dist/opencode-plugin.bundle.js +54 -0
- package/dist/opencode-plugin.js +1 -0
- package/dist/opencode-plugin.js.map +1 -1
- package/dist/procedure-runtime.d.ts +18 -0
- package/dist/procedure-runtime.js +83 -0
- package/dist/procedure-runtime.js.map +1 -0
- package/dist/procedure-shadow.d.ts +31 -0
- package/dist/procedure-shadow.js +122 -0
- package/dist/procedure-shadow.js.map +1 -0
- package/dist/procedure-watch.d.ts +5 -3
- package/dist/procedure-watch.js +10 -4
- package/dist/procedure-watch.js.map +1 -1
- package/dist/procedure.js +3 -0
- package/dist/procedure.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type NativeMirroredSkill } from './native-skill-mirror';
|
|
2
|
+
export declare const CLAUDE_LIFECYCLE_SKILLS: readonly ["commit", "deploy", "release"];
|
|
3
|
+
export interface ClaudeLifecycleCutoverResult {
|
|
4
|
+
installed: number;
|
|
5
|
+
updated: number;
|
|
6
|
+
current: number;
|
|
7
|
+
blocked: number;
|
|
8
|
+
backupDir?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Explicit, narrow Claude cutover. Only SKILL.md becomes mirror-managed;
|
|
12
|
+
* companion scripts and docs remain untouched in the native package.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyClaudeLifecycleCutover(params: {
|
|
15
|
+
skills: NativeMirroredSkill[];
|
|
16
|
+
homeDir?: string;
|
|
17
|
+
now?: Date;
|
|
18
|
+
}): ClaudeLifecycleCutoverResult;
|
|
19
|
+
export declare function syncClaudeLifecycleCutover(params: {
|
|
20
|
+
apiUrl: string;
|
|
21
|
+
apiKey: string;
|
|
22
|
+
homeDir?: string;
|
|
23
|
+
}): Promise<ClaudeLifecycleCutoverResult>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CLAUDE_LIFECYCLE_SKILLS = void 0;
|
|
37
|
+
exports.applyClaudeLifecycleCutover = applyClaudeLifecycleCutover;
|
|
38
|
+
exports.syncClaudeLifecycleCutover = syncClaudeLifecycleCutover;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const os = __importStar(require("os"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const native_skill_mirror_1 = require("./native-skill-mirror");
|
|
43
|
+
const skill_mirror_files_1 = require("./skill-mirror-files");
|
|
44
|
+
exports.CLAUDE_LIFECYCLE_SKILLS = ['commit', 'deploy', 'release'];
|
|
45
|
+
const STATE_FILE = '.greprag-mirror.json';
|
|
46
|
+
function readState(root) {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(root, STATE_FILE), 'utf8'));
|
|
49
|
+
if (parsed?.version === 1 && parsed.skills && typeof parsed.skills === 'object')
|
|
50
|
+
return parsed;
|
|
51
|
+
}
|
|
52
|
+
catch { /* first targeted cutover */ }
|
|
53
|
+
return { version: 1, skills: {} };
|
|
54
|
+
}
|
|
55
|
+
function writeState(root, state) {
|
|
56
|
+
fs.mkdirSync(root, { recursive: true });
|
|
57
|
+
fs.writeFileSync(path.join(root, STATE_FILE), JSON.stringify(state, null, 2) + '\n', 'utf8');
|
|
58
|
+
}
|
|
59
|
+
function adapterFor(skill) {
|
|
60
|
+
const files = (0, native_skill_mirror_1.buildNativeSkillAdapter)('claude-code', skill, { allowClaudeCode: true });
|
|
61
|
+
if (!files || files.length !== 1 || files[0].path !== 'SKILL.md') {
|
|
62
|
+
throw new Error(`Claude lifecycle adapter is invalid for ${skill.skillName}.`);
|
|
63
|
+
}
|
|
64
|
+
return files;
|
|
65
|
+
}
|
|
66
|
+
function safeTimestamp(now) {
|
|
67
|
+
return now.toISOString().replace(/[:.]/g, '-');
|
|
68
|
+
}
|
|
69
|
+
function requiredSkills(skills) {
|
|
70
|
+
const byName = new Map(skills
|
|
71
|
+
.filter(skill => skill.scope !== 'project')
|
|
72
|
+
.map(skill => [skill.skillName, skill]));
|
|
73
|
+
return exports.CLAUDE_LIFECYCLE_SKILLS.map(name => {
|
|
74
|
+
const skill = byName.get(name);
|
|
75
|
+
if (!skill)
|
|
76
|
+
throw new Error(`Canonical Claude lifecycle skill missing: ${name}.`);
|
|
77
|
+
return skill;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Explicit, narrow Claude cutover. Only SKILL.md becomes mirror-managed;
|
|
82
|
+
* companion scripts and docs remain untouched in the native package.
|
|
83
|
+
*/
|
|
84
|
+
function applyClaudeLifecycleCutover(params) {
|
|
85
|
+
const homeDir = params.homeDir || os.homedir();
|
|
86
|
+
const root = (0, native_skill_mirror_1.nativeSkillRoot)('claude-code', homeDir);
|
|
87
|
+
const state = readState(root);
|
|
88
|
+
const prepared = requiredSkills(params.skills).map(skill => {
|
|
89
|
+
const target = path.join(root, skill.skillName);
|
|
90
|
+
const skillMd = path.join(target, 'SKILL.md');
|
|
91
|
+
const adapterFiles = adapterFor(skill);
|
|
92
|
+
const nextHash = (0, skill_mirror_files_1.computeSkillFileHash)(adapterFiles);
|
|
93
|
+
const managed = state.skills[skill.skillName];
|
|
94
|
+
let currentContent;
|
|
95
|
+
if (fs.existsSync(skillMd))
|
|
96
|
+
currentContent = fs.readFileSync(skillMd, 'utf8');
|
|
97
|
+
if (managed) {
|
|
98
|
+
const currentFiles = currentContent === undefined
|
|
99
|
+
? null
|
|
100
|
+
: [{ path: 'SKILL.md', content: currentContent }];
|
|
101
|
+
if (!currentFiles || (0, skill_mirror_files_1.computeSkillFileHash)(currentFiles) !== managed.hash) {
|
|
102
|
+
throw new Error(`Claude lifecycle adapter diverged: ${skill.skillName}.`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (fs.existsSync(target) && currentContent === undefined) {
|
|
106
|
+
throw new Error(`Claude lifecycle package has no SKILL.md: ${skill.skillName}.`);
|
|
107
|
+
}
|
|
108
|
+
return { skill, target, skillMd, adapterFiles, nextHash, managed, currentContent };
|
|
109
|
+
});
|
|
110
|
+
const replacements = prepared.filter(item => !item.managed && item.currentContent !== undefined);
|
|
111
|
+
let backupDir;
|
|
112
|
+
if (replacements.length > 0) {
|
|
113
|
+
backupDir = path.join(homeDir, '.greprag', 'backups', 'claude-lifecycle-cutover', safeTimestamp(params.now || new Date()));
|
|
114
|
+
for (const item of replacements) {
|
|
115
|
+
const destination = path.join(backupDir, item.skill.skillName, 'SKILL.md');
|
|
116
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
117
|
+
fs.writeFileSync(destination, item.currentContent, 'utf8');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const result = {
|
|
121
|
+
installed: 0, updated: 0, current: 0, blocked: 0, backupDir,
|
|
122
|
+
};
|
|
123
|
+
for (const item of prepared) {
|
|
124
|
+
if (item.managed && item.managed.hash === item.nextHash) {
|
|
125
|
+
result.current++;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
fs.mkdirSync(item.target, { recursive: true });
|
|
129
|
+
fs.writeFileSync(item.skillMd, item.adapterFiles[0].content, 'utf8');
|
|
130
|
+
state.skills[item.skill.skillName] = { hash: item.nextHash, files: ['SKILL.md'] };
|
|
131
|
+
if (item.managed)
|
|
132
|
+
result.updated++;
|
|
133
|
+
else
|
|
134
|
+
result.installed++;
|
|
135
|
+
}
|
|
136
|
+
writeState(root, state);
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
async function syncClaudeLifecycleCutover(params) {
|
|
140
|
+
const list = await fetch(`${params.apiUrl}/v1/skillmirror`, {
|
|
141
|
+
headers: { Authorization: `Bearer ${params.apiKey}` },
|
|
142
|
+
});
|
|
143
|
+
if (!list.ok)
|
|
144
|
+
throw new Error(`skill mirror list failed: HTTP ${list.status}`);
|
|
145
|
+
const data = await list.json();
|
|
146
|
+
const wanted = new Set(exports.CLAUDE_LIFECYCLE_SKILLS);
|
|
147
|
+
const rows = (data.skills || []).filter(row => wanted.has(row.skillName) && row.scope !== 'project');
|
|
148
|
+
if (rows.length !== exports.CLAUDE_LIFECYCLE_SKILLS.length) {
|
|
149
|
+
throw new Error('Canonical Claude lifecycle skill list is incomplete; native files preserved.');
|
|
150
|
+
}
|
|
151
|
+
const fetched = await Promise.all(rows.map(async (row) => {
|
|
152
|
+
const query = new URLSearchParams({ skillId: row.skillId || `global:${row.skillName}` });
|
|
153
|
+
const response = await fetch(`${params.apiUrl}/v1/skillmirror/${encodeURIComponent(row.skillName)}?${query.toString()}`, { headers: { Authorization: `Bearer ${params.apiKey}` } });
|
|
154
|
+
if (!response.ok)
|
|
155
|
+
return null;
|
|
156
|
+
const body = await response.json();
|
|
157
|
+
if (!Array.isArray(body.files))
|
|
158
|
+
return null;
|
|
159
|
+
return {
|
|
160
|
+
...row,
|
|
161
|
+
scope: 'global',
|
|
162
|
+
files: body.files,
|
|
163
|
+
contentHash: body.contentHash || row.contentHash,
|
|
164
|
+
revision: body.revision ?? row.revision,
|
|
165
|
+
};
|
|
166
|
+
}));
|
|
167
|
+
if (fetched.some(skill => skill === null)) {
|
|
168
|
+
throw new Error('Claude lifecycle snapshot incomplete; native files preserved.');
|
|
169
|
+
}
|
|
170
|
+
return applyClaudeLifecycleCutover({
|
|
171
|
+
skills: fetched,
|
|
172
|
+
homeDir: params.homeDir,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=claude-lifecycle-cutover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-lifecycle-cutover.js","sourceRoot":"","sources":["../src/claude-lifecycle-cutover.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,kEA8DC;AAED,gEA2CC;AAnLD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,+DAI+B;AAC/B,6DAA4E;AAE/D,QAAA,uBAAuB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAoBhF,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAE1C,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAsB,CAAC;QACrG,IAAI,MAAM,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;IACjG,CAAC;IAAC,MAAM,CAAC,CAAC,4BAA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OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,OAAO;YACL,GAAG,GAAG;YACN,KAAK,EAAE,QAAiB;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,GAAG,CAAC,WAAW;YAChD,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ;SACxC,CAAC;IACJ,CAAC,CAAC,CAAC,CAAC;IACJ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,2BAA2B,CAAC;QACjC,MAAM,EAAE,OAAgC;QACxC,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Repo-scoped Delivery System pilot announce.
|
|
2
|
+
*
|
|
3
|
+
* The announce owns temporary lifecycle doctrine while Procedure lifecycle
|
|
4
|
+
* verbs run shadow-only. It contains no provider commands: those remain
|
|
5
|
+
* repo/target configuration. I/O (Git repo detection) stays in each harness
|
|
6
|
+
* adapter and arrives as env.deliveryRepo.
|
|
7
|
+
* docs/delivery-system.md, docs/delivery-migration-ledger.md */
|
|
8
|
+
import { ReminderEnv, ReminderModule } from './reminder-types';
|
|
9
|
+
export declare function buildDeliveryAnnounce(env: ReminderEnv): string | null;
|
|
10
|
+
export declare const deliveryControlModule: ReminderModule;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** Repo-scoped Delivery System pilot announce.
|
|
3
|
+
*
|
|
4
|
+
* The announce owns temporary lifecycle doctrine while Procedure lifecycle
|
|
5
|
+
* verbs run shadow-only. It contains no provider commands: those remain
|
|
6
|
+
* repo/target configuration. I/O (Git repo detection) stays in each harness
|
|
7
|
+
* adapter and arrives as env.deliveryRepo.
|
|
8
|
+
* docs/delivery-system.md, docs/delivery-migration-ledger.md */
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.deliveryControlModule = void 0;
|
|
11
|
+
exports.buildDeliveryAnnounce = buildDeliveryAnnounce;
|
|
12
|
+
// adr: adr/delivery-announce-pilot.md
|
|
13
|
+
function coordinationLine(platform) {
|
|
14
|
+
if (platform === 'codex') {
|
|
15
|
+
return 'Codex coordination: discover local peers with list_threads; inspect/message them with native thread tools, and use GrepRAG for cross-harness peers.';
|
|
16
|
+
}
|
|
17
|
+
if (platform === 'claude-code') {
|
|
18
|
+
return 'Claude Code coordination: discover peers with `greprag inbox watchers --json`, send to the exact session, and keep the Monitor armed for replies.';
|
|
19
|
+
}
|
|
20
|
+
if (platform === 'opencode') {
|
|
21
|
+
return 'OpenCode coordination: use the GrepRAG project/session registry and session-targeted send; the plugin relay delivers replies.';
|
|
22
|
+
}
|
|
23
|
+
return 'Coordination: discover same-project peers through this harness and use GrepRAG for cross-harness peers.';
|
|
24
|
+
}
|
|
25
|
+
function buildDeliveryAnnounce(env) {
|
|
26
|
+
if (!env.deliveryRepo)
|
|
27
|
+
return null;
|
|
28
|
+
const project = env.projectName?.trim() || 'current repo';
|
|
29
|
+
return [
|
|
30
|
+
`[DELIVERY CONTROL — ${project}]`,
|
|
31
|
+
'For full-goal code work, done means checkpointed, coordinated, integrated, pushed, deployed, and production-verified. Checkpoint each passing fix or feature.',
|
|
32
|
+
coordinationLine(env.platform),
|
|
33
|
+
'Before merge, push, deploy, or release: elect one delivery owner. That owner includes every ready peer commit, resolves ordinary mission conflicts, and settles unclaimed dirt by adopt, rescue, or discard.',
|
|
34
|
+
'Use the canonical commit, deploy, and release skills plus this repo\'s delivery configuration. Never borrow a branch, remote, provider command, or verification rule from another repo.',
|
|
35
|
+
'A full-goal delivery mission already provisions ordinary repo-scoped commit, merge, push, deploy, and verification; do not wait for a second keyword.',
|
|
36
|
+
].join('\n');
|
|
37
|
+
}
|
|
38
|
+
exports.deliveryControlModule = {
|
|
39
|
+
id: 'delivery-control',
|
|
40
|
+
detect: (_env) => ({ tier: 'silent' }),
|
|
41
|
+
announce: buildDeliveryAnnounce,
|
|
42
|
+
reminder: () => null,
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=delivery-reminder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-reminder.js","sourceRoot":"","sources":["../../src/commands/delivery-reminder.ts"],"names":[],"mappings":";AAAA;;;;;;gEAMgE;;;AAmBhE,sDAWC;AA1BD,sCAAsC;AAEtC,SAAS,gBAAgB,CAAC,QAAmC;IAC3D,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,qJAAqJ,CAAC;IAC/J,CAAC;IACD,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC/B,OAAO,mJAAmJ,CAAC;IAC7J,CAAC;IACD,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,+HAA+H,CAAC;IACzI,CAAC;IACD,OAAO,yGAAyG,CAAC;AACnH,CAAC;AAED,SAAgB,qBAAqB,CAAC,GAAgB;IACpD,IAAI,CAAC,GAAG,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,cAAc,CAAC;IAC1D,OAAO;QACL,uBAAuB,OAAO,GAAG;QACjC,+JAA+J;QAC/J,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC9B,8MAA8M;QAC9M,yLAAyL;QACzL,uJAAuJ;KACxJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAEY,QAAA,qBAAqB,GAAmB;IACnD,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,CAAC,IAAiB,EAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9D,QAAQ,EAAE,qBAAqB;IAC/B,QAAQ,EAAE,GAAkB,EAAE,CAAC,IAAI;CACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runDelivery(args: string[]): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runDelivery = runDelivery;
|
|
4
|
+
const delivery_config_1 = require("../delivery-config");
|
|
5
|
+
const HELP = `greprag delivery — resolve the current repo's delivery authority
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
greprag delivery resolve [--json]
|
|
9
|
+
greprag delivery status [--json]
|
|
10
|
+
|
|
11
|
+
Reads .greprag/delivery.json when present. During migration only, falls back to
|
|
12
|
+
docs/deploy.md, docs/releases.md, then CLAUDE.md. Provider commands remain in
|
|
13
|
+
the referenced repo docs; the profile owns Git integration facts and pointers.`;
|
|
14
|
+
function runDelivery(args) {
|
|
15
|
+
if (args.includes('--help') || args.includes('-h') || args[0] === 'help') {
|
|
16
|
+
console.log(HELP);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const sub = args[0] || 'resolve';
|
|
20
|
+
if (sub !== 'resolve' && sub !== 'status') {
|
|
21
|
+
console.error(`Unknown delivery command: ${sub}\n\n${HELP}`);
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const result = (0, delivery_config_1.resolveDeliveryProfile)(process.cwd());
|
|
26
|
+
if (args.includes('--json')) {
|
|
27
|
+
console.log(JSON.stringify(result, null, 2));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
console.log(`Delivery authority: ${result.mode}`);
|
|
31
|
+
if (result.root)
|
|
32
|
+
console.log(` root: ${result.root}`);
|
|
33
|
+
if (result.configPath)
|
|
34
|
+
console.log(` profile: ${result.configPath}`);
|
|
35
|
+
if (result.profile) {
|
|
36
|
+
const git = result.profile.git;
|
|
37
|
+
console.log(` git: ${git.remote}/${git.defaultBranch} · ${git.integrationStrategy} · pushDeploys=${git.pushDeploys}`);
|
|
38
|
+
for (const target of result.profile.deploy?.targets ?? []) {
|
|
39
|
+
console.log(` deploy target: ${target.id}${target.procedureId ? ` → ${target.procedureId}` : ''}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (result.deploySource)
|
|
43
|
+
console.log(` deploy source: ${result.deploySource}`);
|
|
44
|
+
if (result.releaseSource)
|
|
45
|
+
console.log(` release source: ${result.releaseSource}`);
|
|
46
|
+
if (result.legacyPromptSource)
|
|
47
|
+
console.log(` legacy prompt fallback: ${result.legacyPromptSource}`);
|
|
48
|
+
for (const warning of result.warnings)
|
|
49
|
+
console.log(` warning: ${warning}`);
|
|
50
|
+
for (const error of result.errors)
|
|
51
|
+
console.error(` error: ${error}`);
|
|
52
|
+
}
|
|
53
|
+
if (result.mode === 'missing' || result.mode === 'invalid')
|
|
54
|
+
process.exitCode = 1;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=delivery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery.js","sourceRoot":"","sources":["../../src/commands/delivery.ts"],"names":[],"mappings":";;AAYA,kCAgCC;AA5CD,wDAA4D;AAE5D,MAAM,IAAI,GAAG;;;;;;;;+EAQkE,CAAC;AAEhF,SAAgB,WAAW,CAAC,IAAc;IACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS,I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EAAE,CAAC,CAAC;YACtG,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,YAAY;YAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAChF,IAAI,MAAM,CAAC,aAAa;YAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QACnF,IAAI,MAAM,CAAC,kBAAkB;YAAE,OAAO,CAAC,GAAG,CAAC,6BAA6B,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC;QACrG,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;YAAE,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAC5E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACnF,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1523,13 +1523,10 @@ function applySettings(settings, apiKey) {
|
|
|
1523
1523
|
else {
|
|
1524
1524
|
changes.push('UserPromptSubmit friction-reminder hook already configured (skipped)');
|
|
1525
1525
|
}
|
|
1526
|
-
// UserPromptSubmit (procedure-check) — Procedure
|
|
1527
|
-
//
|
|
1528
|
-
//
|
|
1529
|
-
//
|
|
1530
|
-
// instead of by trial-and-error. Local (no network on the hot path), additive,
|
|
1531
|
-
// fail-open; a Tier-1 intent guard suppresses keyword mention-not-request
|
|
1532
|
-
// false-fires. Seed the recipes with `greprag procedure seed`. docs/procedure-system.md
|
|
1526
|
+
// UserPromptSubmit (procedure-check) — Procedure trigger leg. Active
|
|
1527
|
+
// non-lifecycle procedures inject; commit/merge/push/deploy/release record
|
|
1528
|
+
// would-have-fired evidence in SHADOW while the Delivery announce pilot owns
|
|
1529
|
+
// agent behavior. Local, additive, fail-open. docs/procedure-system.md
|
|
1533
1530
|
const procedureCheckHook = {
|
|
1534
1531
|
matcher: '',
|
|
1535
1532
|
hooks: [{ type: 'command', command: 'greprag-hook procedure-check', timeout: 3000 }],
|
|
@@ -1538,7 +1535,7 @@ function applySettings(settings, apiKey) {
|
|
|
1538
1535
|
if (!settings.hooks.UserPromptSubmit)
|
|
1539
1536
|
settings.hooks.UserPromptSubmit = [];
|
|
1540
1537
|
settings.hooks.UserPromptSubmit.push(procedureCheckHook);
|
|
1541
|
-
changes.push('Added UserPromptSubmit hook (Procedure
|
|
1538
|
+
changes.push('Added UserPromptSubmit hook (Procedure active + lifecycle shadow)');
|
|
1542
1539
|
}
|
|
1543
1540
|
else {
|
|
1544
1541
|
changes.push('UserPromptSubmit procedure-check hook already configured (skipped)');
|