@neurcode-ai/cli 0.15.3 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +40 -1
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/cursor.d.ts.map +1 -1
- package/dist/commands/cursor.js +256 -1
- package/dist/commands/cursor.js.map +1 -1
- package/dist/commands/runtime-adapter.d.ts.map +1 -1
- package/dist/commands/runtime-adapter.js +28 -2
- package/dist/commands/runtime-adapter.js.map +1 -1
- package/dist/commands/session-hook.d.ts.map +1 -1
- package/dist/commands/session-hook.js +2 -1
- package/dist/commands/session-hook.js.map +1 -1
- package/dist/utils/cursor-gate.d.ts +93 -0
- package/dist/utils/cursor-gate.d.ts.map +1 -0
- package/dist/utils/cursor-gate.js +509 -0
- package/dist/utils/cursor-gate.js.map +1 -0
- package/dist/utils/session-allowlist-rules.d.ts +29 -0
- package/dist/utils/session-allowlist-rules.d.ts.map +1 -0
- package/dist/utils/session-allowlist-rules.js +128 -0
- package/dist/utils/session-allowlist-rules.js.map +1 -0
- package/dist/utils/v0-governance.d.ts +12 -2
- package/dist/utils/v0-governance.d.ts.map +1 -1
- package/dist/utils/v0-governance.js +108 -13
- package/dist/utils/v0-governance.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MIN_CURSOR_GATE_CLI_VERSION = exports.CURSOR_GATE_SCHEMA_VERSION = void 0;
|
|
4
|
+
exports.readBundledCliVersion = readBundledCliVersion;
|
|
5
|
+
exports.buildCliVersionStaleWarning = buildCliVersionStaleWarning;
|
|
6
|
+
exports.emitCliVersionStaleWarning = emitCliVersionStaleWarning;
|
|
7
|
+
exports.resolveCursorGateExitCode = resolveCursorGateExitCode;
|
|
8
|
+
exports.evaluateCursorGate = evaluateCursorGate;
|
|
9
|
+
exports.formatCursorGateCiErrors = formatCursorGateCiErrors;
|
|
10
|
+
exports.installCursorGateHook = installCursorGateHook;
|
|
11
|
+
exports.doctorCursorGateHook = doctorCursorGateHook;
|
|
12
|
+
const node_crypto_1 = require("node:crypto");
|
|
13
|
+
const node_fs_1 = require("node:fs");
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
15
|
+
const node_child_process_1 = require("node:child_process");
|
|
16
|
+
const contracts_1 = require("@neurcode-ai/contracts");
|
|
17
|
+
const governance_runtime_1 = require("@neurcode-ai/governance-runtime");
|
|
18
|
+
const agent_guard_1 = require("./agent-guard");
|
|
19
|
+
const v0_governance_1 = require("./v0-governance");
|
|
20
|
+
const runtime_live_1 = require("./runtime-live");
|
|
21
|
+
exports.CURSOR_GATE_SCHEMA_VERSION = 'neurcode.cursor-gate.v1';
|
|
22
|
+
exports.MIN_CURSOR_GATE_CLI_VERSION = '0.15.4';
|
|
23
|
+
function readBundledCliVersion() {
|
|
24
|
+
try {
|
|
25
|
+
const pkgPath = (0, node_path_1.join)(__dirname, '..', '..', 'package.json');
|
|
26
|
+
const pkg = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, 'utf8'));
|
|
27
|
+
return pkg.version?.trim() || 'unknown';
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return 'unknown';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Warn when the running CLI is too old for cursor gate (e.g. stale global @neurcode-ai/cli). */
|
|
34
|
+
function buildCliVersionStaleWarning(options) {
|
|
35
|
+
const expectedVersion = readBundledCliVersion();
|
|
36
|
+
const runningVersion = options?.runningVersionOverride?.trim() || expectedVersion;
|
|
37
|
+
const minimumVersion = options?.minimumVersion?.trim() || exports.MIN_CURSOR_GATE_CLI_VERSION;
|
|
38
|
+
const meetsMinimum = (0, contracts_1.isSemverAtLeast)(runningVersion, minimumVersion);
|
|
39
|
+
if (meetsMinimum !== false)
|
|
40
|
+
return null;
|
|
41
|
+
return {
|
|
42
|
+
id: 'cli_version_stale',
|
|
43
|
+
status: 'warn',
|
|
44
|
+
runningVersion,
|
|
45
|
+
expectedVersion,
|
|
46
|
+
minimumVersion,
|
|
47
|
+
message: `CLI ${runningVersion} is older than ${minimumVersion}; cursor gate and enterprise hooks require @neurcode-ai/cli@${minimumVersion}+.`,
|
|
48
|
+
remediation: [
|
|
49
|
+
'npm install -g @neurcode-ai/cli@latest',
|
|
50
|
+
'npm exec --package=@neurcode-ai/cli@latest -- neurcode cursor gate --help',
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function emitCliVersionStaleWarning(warning, json) {
|
|
55
|
+
if (json)
|
|
56
|
+
return;
|
|
57
|
+
process.stderr.write(`⚠️ ${warning.message}\n`);
|
|
58
|
+
for (const step of warning.remediation) {
|
|
59
|
+
process.stderr.write(` ${step}\n`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function repoRelativeArtifactPath(repoRoot, artifactPath) {
|
|
63
|
+
const root = repoRoot.replace(/\\/g, '/').replace(/\/+$/, '');
|
|
64
|
+
const normalized = artifactPath.replace(/\\/g, '/');
|
|
65
|
+
return normalized.startsWith(`${root}/`)
|
|
66
|
+
? normalized.slice(root.length + 1)
|
|
67
|
+
: '<external-agent-guard-artifact>';
|
|
68
|
+
}
|
|
69
|
+
function guardEvaluationFingerprint(evaluation) {
|
|
70
|
+
return (0, node_crypto_1.createHash)('sha256')
|
|
71
|
+
.update(JSON.stringify({
|
|
72
|
+
pass: evaluation.pass,
|
|
73
|
+
status: evaluation.status,
|
|
74
|
+
summary: evaluation.summary,
|
|
75
|
+
changedFiles: evaluation.changedFiles.map((file) => ({
|
|
76
|
+
path: file.path,
|
|
77
|
+
changeType: file.changeType,
|
|
78
|
+
classification: file.classification,
|
|
79
|
+
evidence: file.evidence,
|
|
80
|
+
})),
|
|
81
|
+
}))
|
|
82
|
+
.digest('hex')
|
|
83
|
+
.slice(0, 24);
|
|
84
|
+
}
|
|
85
|
+
function guardEvaluationDetail(repoRoot, artifactPath, evaluation) {
|
|
86
|
+
return {
|
|
87
|
+
schemaVersion: 'neurcode.agent-guard-status.v1',
|
|
88
|
+
guardId: evaluation.guardId,
|
|
89
|
+
artifactPath: repoRelativeArtifactPath(repoRoot, artifactPath),
|
|
90
|
+
reportFingerprint: guardEvaluationFingerprint(evaluation),
|
|
91
|
+
pass: evaluation.pass,
|
|
92
|
+
status: evaluation.status,
|
|
93
|
+
summary: evaluation.summary,
|
|
94
|
+
changedFiles: evaluation.changedFiles.slice(0, 100).map((file) => ({
|
|
95
|
+
path: file.path,
|
|
96
|
+
changeType: file.changeType,
|
|
97
|
+
classification: file.classification,
|
|
98
|
+
evidence: file.evidence,
|
|
99
|
+
})),
|
|
100
|
+
privacy: evaluation.privacy,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async function publishGuardEvent(input) {
|
|
104
|
+
const updated = (0, governance_runtime_1.appendEvent)(input.repoRoot, input.sessionId, input.event);
|
|
105
|
+
if (updated) {
|
|
106
|
+
await (0, runtime_live_1.publishRuntimeLiveStatus)(input.repoRoot, updated);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function publishGuardEvaluation(input) {
|
|
110
|
+
const session = (0, governance_runtime_1.loadSession)(input.repoRoot, input.evaluation.sessionId);
|
|
111
|
+
if (!session)
|
|
112
|
+
return;
|
|
113
|
+
const detail = guardEvaluationDetail(input.repoRoot, input.artifactPath, input.evaluation);
|
|
114
|
+
const latestStatus = [...session.events]
|
|
115
|
+
.reverse()
|
|
116
|
+
.find((event) => event.type === 'agent_guard_status');
|
|
117
|
+
if (latestStatus?.detail?.reportFingerprint === detail.reportFingerprint) {
|
|
118
|
+
await (0, runtime_live_1.publishRuntimeLiveStatus)(input.repoRoot, session);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
await publishGuardEvent({
|
|
122
|
+
repoRoot: input.repoRoot,
|
|
123
|
+
sessionId: input.evaluation.sessionId,
|
|
124
|
+
event: {
|
|
125
|
+
type: 'agent_guard_status',
|
|
126
|
+
ts: input.evaluation.generatedAt,
|
|
127
|
+
message: input.evaluation.pass
|
|
128
|
+
? 'Agent guard status: changed files have allowed pre-write evidence.'
|
|
129
|
+
: 'Agent guard status: attention required for unverified or denied writes.',
|
|
130
|
+
detail,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function buildRemediation(evaluation, sessionId) {
|
|
135
|
+
if (!sessionId) {
|
|
136
|
+
return [
|
|
137
|
+
'neurcode cursor onboard --guard-start',
|
|
138
|
+
'neurcode agent guard start cursor --goal "<task>" --plan "<source-free plan>"',
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
const base = [
|
|
142
|
+
`neurcode agent guard status --session-id ${sessionId} --fail-on-unverified --json`,
|
|
143
|
+
`neurcode agent guard finish --session-id ${sessionId} --fail-on-unverified`,
|
|
144
|
+
];
|
|
145
|
+
if (!evaluation || evaluation.pass)
|
|
146
|
+
return base;
|
|
147
|
+
const paths = evaluation.changedFiles
|
|
148
|
+
.filter((file) => file.classification === 'unverified_write' || file.classification === 'denied_but_changed')
|
|
149
|
+
.slice(0, 5)
|
|
150
|
+
.map((file) => `neurcode agent check ${file.path} --adapter cursor-mcp --session-id ${sessionId}`);
|
|
151
|
+
return [...paths, ...base];
|
|
152
|
+
}
|
|
153
|
+
function enforcementSummary() {
|
|
154
|
+
const capability = (0, governance_runtime_1.getAgentRuntimeAdapterCapability)('cursor-mcp');
|
|
155
|
+
return {
|
|
156
|
+
level: capability.enforcementLevel,
|
|
157
|
+
controlLevel: capability.controlLevel,
|
|
158
|
+
honestSummary: 'Cursor uses cooperative MCP edit.before checks plus local guard supervisor containment — not Claude-style hard pre-write deny. The cursor gate fail-closes git push, CI, and session handoff when guard detects unverified or denied-but-changed writes.',
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function resolveCursorGateExitCode(input) {
|
|
162
|
+
if (input.errorCode)
|
|
163
|
+
return 1;
|
|
164
|
+
if (input.pass === false)
|
|
165
|
+
return 2;
|
|
166
|
+
return 0;
|
|
167
|
+
}
|
|
168
|
+
async function evaluateCursorGate(options) {
|
|
169
|
+
const repoRoot = (0, v0_governance_1.resolveRepoRoot)(options.dir || process.cwd());
|
|
170
|
+
const enforcement = enforcementSummary();
|
|
171
|
+
const guardRead = (0, agent_guard_1.readAgentGuardArtifact)({
|
|
172
|
+
repoRoot,
|
|
173
|
+
sessionId: options.sessionId,
|
|
174
|
+
artifactPath: options.guardPath,
|
|
175
|
+
});
|
|
176
|
+
if (!guardRead.artifact || !guardRead.artifact.active) {
|
|
177
|
+
const errorCode = 'no_active_guard_session';
|
|
178
|
+
const error = guardRead.error
|
|
179
|
+
|| 'No active agent guard session found. Start one with `neurcode cursor onboard` or `neurcode agent guard start cursor`.';
|
|
180
|
+
if (!options.allowNoSession) {
|
|
181
|
+
return {
|
|
182
|
+
schemaVersion: exports.CURSOR_GATE_SCHEMA_VERSION,
|
|
183
|
+
ok: false,
|
|
184
|
+
exitCode: 1,
|
|
185
|
+
sessionId: null,
|
|
186
|
+
agentGuardPosture: null,
|
|
187
|
+
summary: { unverifiedWrites: 0, deniedButChanged: 0, changedFiles: 0 },
|
|
188
|
+
remediation: buildRemediation(null, null),
|
|
189
|
+
enforcement,
|
|
190
|
+
error,
|
|
191
|
+
errorCode,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
schemaVersion: exports.CURSOR_GATE_SCHEMA_VERSION,
|
|
196
|
+
ok: true,
|
|
197
|
+
exitCode: 0,
|
|
198
|
+
sessionId: null,
|
|
199
|
+
agentGuardPosture: null,
|
|
200
|
+
summary: { unverifiedWrites: 0, deniedButChanged: 0, changedFiles: 0 },
|
|
201
|
+
remediation: buildRemediation(null, null),
|
|
202
|
+
enforcement,
|
|
203
|
+
error,
|
|
204
|
+
errorCode,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const artifact = guardRead.artifact;
|
|
208
|
+
const sessionId = options.sessionId || artifact.sessionId;
|
|
209
|
+
const session = (0, governance_runtime_1.loadSession)(repoRoot, sessionId) || (0, governance_runtime_1.loadActiveSession)(repoRoot);
|
|
210
|
+
if (!session) {
|
|
211
|
+
return {
|
|
212
|
+
schemaVersion: exports.CURSOR_GATE_SCHEMA_VERSION,
|
|
213
|
+
ok: false,
|
|
214
|
+
exitCode: 1,
|
|
215
|
+
sessionId,
|
|
216
|
+
agentGuardPosture: null,
|
|
217
|
+
summary: { unverifiedWrites: 0, deniedButChanged: 0, changedFiles: 0 },
|
|
218
|
+
remediation: buildRemediation(null, sessionId),
|
|
219
|
+
enforcement,
|
|
220
|
+
error: `Local governance session ${sessionId} was not found.`,
|
|
221
|
+
errorCode: 'session_not_found',
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
const evaluation = (0, agent_guard_1.evaluateAgentGuard)(repoRoot, artifact, session);
|
|
225
|
+
await publishGuardEvaluation({ repoRoot, artifactPath: guardRead.path, evaluation });
|
|
226
|
+
const refreshed = (0, governance_runtime_1.loadSession)(repoRoot, sessionId) || session;
|
|
227
|
+
const agentGuardPosture = (0, governance_runtime_1.buildAgentGuardPostureSummary)(refreshed);
|
|
228
|
+
const exitCode = resolveCursorGateExitCode({ pass: evaluation.pass });
|
|
229
|
+
return {
|
|
230
|
+
schemaVersion: exports.CURSOR_GATE_SCHEMA_VERSION,
|
|
231
|
+
ok: evaluation.pass,
|
|
232
|
+
exitCode,
|
|
233
|
+
sessionId,
|
|
234
|
+
agentGuardPosture,
|
|
235
|
+
summary: {
|
|
236
|
+
unverifiedWrites: evaluation.summary.unverifiedWrites,
|
|
237
|
+
deniedButChanged: evaluation.summary.deniedButChanged,
|
|
238
|
+
changedFiles: evaluation.summary.changedFiles,
|
|
239
|
+
},
|
|
240
|
+
remediation: buildRemediation(evaluation, sessionId),
|
|
241
|
+
enforcement,
|
|
242
|
+
evaluation,
|
|
243
|
+
artifactPath: guardRead.path,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function formatCursorGateCiErrors(payload) {
|
|
247
|
+
if (payload.exitCode === 0)
|
|
248
|
+
return [];
|
|
249
|
+
const lines = [];
|
|
250
|
+
if (payload.errorCode) {
|
|
251
|
+
lines.push(`::error title=Neurcode cursor gate::${payload.error || payload.errorCode}`);
|
|
252
|
+
return lines;
|
|
253
|
+
}
|
|
254
|
+
const violations = payload.evaluation?.changedFiles.filter((file) => file.classification === 'unverified_write' || file.classification === 'denied_but_changed') || [];
|
|
255
|
+
if (violations.length === 0) {
|
|
256
|
+
lines.push('::error title=Neurcode cursor gate::Guard attention required before push or merge.');
|
|
257
|
+
return lines;
|
|
258
|
+
}
|
|
259
|
+
for (const file of violations.slice(0, 20)) {
|
|
260
|
+
lines.push(`::error file=${file.path}::${file.classification.replace(/_/g, ' ')} (${file.changeType})`);
|
|
261
|
+
}
|
|
262
|
+
return lines;
|
|
263
|
+
}
|
|
264
|
+
function buildCursorGateHookScript(hookKind) {
|
|
265
|
+
const gitAction = hookKind === 'pre-push' ? 'push' : 'commit';
|
|
266
|
+
const blockedLabel = hookKind === 'pre-push' ? 'push' : 'commit';
|
|
267
|
+
const beforeAction = hookKind === 'pre-push' ? 'pushing' : 'committing';
|
|
268
|
+
return `#!/usr/bin/env bash
|
|
269
|
+
set -euo pipefail
|
|
270
|
+
|
|
271
|
+
# Neurcode Cursor fail-closed ${blockedLabel} gate (cooperative enforcement handoff).
|
|
272
|
+
# Emergency bypass (audited): NEURCODE_CURSOR_GATE_SKIP=1 git ${gitAction} ...
|
|
273
|
+
|
|
274
|
+
if [[ "\${NEURCODE_CURSOR_GATE_SKIP:-0}" == "1" ]]; then
|
|
275
|
+
echo "⚠️ NEURCODE_CURSOR_GATE_SKIP=1 — cursor gate bypassed (audited emergency only)." >&2
|
|
276
|
+
exit 0
|
|
277
|
+
fi
|
|
278
|
+
|
|
279
|
+
ROOT="\$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
280
|
+
CLI=""
|
|
281
|
+
if command -v neurcode >/dev/null 2>&1; then
|
|
282
|
+
CLI="neurcode"
|
|
283
|
+
elif command -v npx >/dev/null 2>&1; then
|
|
284
|
+
CLI="npx @neurcode-ai/cli"
|
|
285
|
+
else
|
|
286
|
+
echo "❌ Neurcode cursor gate: neurcode CLI not found. Install @neurcode-ai/cli or set NEURCODE_CURSOR_GATE_SKIP=1." >&2
|
|
287
|
+
exit 1
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
set +e
|
|
291
|
+
OUTPUT=\$($CLI cursor gate --dir "\$ROOT" --json 2>&1)
|
|
292
|
+
STATUS=\$?
|
|
293
|
+
set -e
|
|
294
|
+
|
|
295
|
+
if [[ "\$STATUS" == "0" ]]; then
|
|
296
|
+
exit 0
|
|
297
|
+
fi
|
|
298
|
+
|
|
299
|
+
echo "\$OUTPUT" >&2
|
|
300
|
+
cat >&2 <<'MSG'
|
|
301
|
+
|
|
302
|
+
❌ Neurcode cursor gate blocked this ${blockedLabel}.
|
|
303
|
+
|
|
304
|
+
Unverified or denied-but-changed writes were detected in the active guarded session.
|
|
305
|
+
Finish the session, fix bypassed writes, or run agent checks before ${beforeAction}.
|
|
306
|
+
|
|
307
|
+
Remediation:
|
|
308
|
+
neurcode agent guard status --fail-on-unverified --explain
|
|
309
|
+
neurcode agent guard finish --fail-on-unverified
|
|
310
|
+
|
|
311
|
+
Emergency bypass (audited):
|
|
312
|
+
NEURCODE_CURSOR_GATE_SKIP=1 git ${gitAction} ...
|
|
313
|
+
MSG
|
|
314
|
+
exit "\$STATUS"
|
|
315
|
+
`;
|
|
316
|
+
}
|
|
317
|
+
function runGit(args, cwd) {
|
|
318
|
+
const result = (0, node_child_process_1.spawnSync)('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
319
|
+
return { stdout: result.stdout || '', stderr: result.stderr || '', status: result.status ?? 1 };
|
|
320
|
+
}
|
|
321
|
+
function resolveCursorGateHookKinds(hook) {
|
|
322
|
+
if (hook === 'both')
|
|
323
|
+
return ['pre-commit', 'pre-push'];
|
|
324
|
+
if (hook === 'pre-commit')
|
|
325
|
+
return ['pre-commit'];
|
|
326
|
+
return ['pre-push'];
|
|
327
|
+
}
|
|
328
|
+
function installSingleCursorGateHook(input) {
|
|
329
|
+
const hooksDir = (0, node_path_1.resolve)(input.repoRoot, '.githooks');
|
|
330
|
+
const hookPath = (0, node_path_1.resolve)(hooksDir, input.hookKind);
|
|
331
|
+
const neurcodeHookPath = (0, node_path_1.resolve)(input.repoRoot, '.neurcode', 'hooks', input.hookKind);
|
|
332
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.resolve)(input.repoRoot, '.neurcode', 'hooks'), { recursive: true });
|
|
333
|
+
(0, node_fs_1.writeFileSync)(neurcodeHookPath, buildCursorGateHookScript(input.hookKind), 'utf8');
|
|
334
|
+
(0, node_fs_1.chmodSync)(neurcodeHookPath, 0o755);
|
|
335
|
+
const marker = '# >>> neurcode-cursor-gate >>>';
|
|
336
|
+
const existing = (0, node_fs_1.existsSync)(hookPath) ? (0, node_fs_1.readFileSync)(hookPath, 'utf8') : '';
|
|
337
|
+
if (existing.includes(marker) && !input.force) {
|
|
338
|
+
const hooksPathResult = runGit(['config', '--get', 'core.hooksPath'], input.repoRoot);
|
|
339
|
+
const configured = hooksPathResult.status === 0 ? hooksPathResult.stdout.trim() : '';
|
|
340
|
+
return {
|
|
341
|
+
ok: true,
|
|
342
|
+
repoRoot: input.repoRoot,
|
|
343
|
+
hooksPath: hooksDir,
|
|
344
|
+
hookKind: input.hookKind,
|
|
345
|
+
hookPath,
|
|
346
|
+
neurcodeHookPath,
|
|
347
|
+
hooksPathConfigured: configured === '.githooks' || configured === hooksDir,
|
|
348
|
+
message: `Cursor gate ${input.hookKind} hook already installed. Use --force to rewrite.`,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
(0, node_fs_1.mkdirSync)(hooksDir, { recursive: true });
|
|
352
|
+
const fragment = `${marker}
|
|
353
|
+
# Neurcode Cursor fail-closed ${input.hookKind === 'pre-push' ? 'push' : 'commit'} gate
|
|
354
|
+
exec "${neurcodeHookPath}"
|
|
355
|
+
# <<< neurcode-cursor-gate <<<
|
|
356
|
+
`;
|
|
357
|
+
const merged = existing.trim()
|
|
358
|
+
? `${existing.trimEnd()}\n\n${fragment}`
|
|
359
|
+
: `#!/usr/bin/env bash\nset -euo pipefail\n\n${fragment}`;
|
|
360
|
+
(0, node_fs_1.writeFileSync)(hookPath, merged.endsWith('\n') ? merged : `${merged}\n`, 'utf8');
|
|
361
|
+
(0, node_fs_1.chmodSync)(hookPath, 0o755);
|
|
362
|
+
return {
|
|
363
|
+
ok: true,
|
|
364
|
+
repoRoot: input.repoRoot,
|
|
365
|
+
hooksPath: hooksDir,
|
|
366
|
+
hookKind: input.hookKind,
|
|
367
|
+
hookPath,
|
|
368
|
+
neurcodeHookPath,
|
|
369
|
+
hooksPathConfigured: false,
|
|
370
|
+
message: `Installed Neurcode cursor gate ${input.hookKind} hook.`,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function installCursorGateHook(input) {
|
|
374
|
+
const repoRoot = (0, v0_governance_1.resolveRepoRoot)(input.dir || process.cwd());
|
|
375
|
+
const hookKinds = resolveCursorGateHookKinds(input.hook);
|
|
376
|
+
const hooks = hookKinds.map((hookKind) => installSingleCursorGateHook({
|
|
377
|
+
repoRoot,
|
|
378
|
+
hookKind,
|
|
379
|
+
force: input.force,
|
|
380
|
+
}));
|
|
381
|
+
const setResult = runGit(['config', 'core.hooksPath', '.githooks'], repoRoot);
|
|
382
|
+
const hooksPathConfigured = setResult.status === 0;
|
|
383
|
+
for (const hook of hooks) {
|
|
384
|
+
hook.hooksPathConfigured = hooksPathConfigured;
|
|
385
|
+
if (!hooksPathConfigured)
|
|
386
|
+
hook.ok = false;
|
|
387
|
+
}
|
|
388
|
+
const ok = hooksPathConfigured && hooks.every((hook) => hook.ok);
|
|
389
|
+
const label = hookKinds.length === 2
|
|
390
|
+
? 'pre-commit and pre-push'
|
|
391
|
+
: hookKinds[0] === 'pre-commit'
|
|
392
|
+
? 'pre-commit'
|
|
393
|
+
: 'pre-push';
|
|
394
|
+
return {
|
|
395
|
+
ok,
|
|
396
|
+
repoRoot,
|
|
397
|
+
hooksPath: (0, node_path_1.resolve)(repoRoot, '.githooks'),
|
|
398
|
+
hooks,
|
|
399
|
+
hooksPathConfigured,
|
|
400
|
+
message: hooksPathConfigured
|
|
401
|
+
? `Installed Neurcode cursor gate ${label} hook${hookKinds.length > 1 ? 's' : ''}.`
|
|
402
|
+
: `Failed to set core.hooksPath: ${setResult.stderr || setResult.stdout}`,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
function doctorCursorGateHookKind(repoRoot, hookKind, required) {
|
|
406
|
+
const checks = [];
|
|
407
|
+
const neurcodeHookPath = (0, node_path_1.resolve)(repoRoot, '.neurcode', 'hooks', hookKind);
|
|
408
|
+
const hookPath = (0, node_path_1.resolve)(repoRoot, '.githooks', hookKind);
|
|
409
|
+
const prefix = hookKind.replace('-', '_');
|
|
410
|
+
const neurcodeExists = (0, node_fs_1.existsSync)(neurcodeHookPath);
|
|
411
|
+
const githookExists = (0, node_fs_1.existsSync)(hookPath);
|
|
412
|
+
const installed = neurcodeExists || githookExists;
|
|
413
|
+
if (!required && !installed) {
|
|
414
|
+
checks.push({
|
|
415
|
+
id: `${prefix}_optional`,
|
|
416
|
+
status: 'skip',
|
|
417
|
+
message: `${hookKind} hook not installed (optional unless --hook both).`,
|
|
418
|
+
});
|
|
419
|
+
return checks;
|
|
420
|
+
}
|
|
421
|
+
checks.push({
|
|
422
|
+
id: `neurcode_hook_script_${prefix}`,
|
|
423
|
+
status: neurcodeExists ? 'pass' : 'fail',
|
|
424
|
+
message: neurcodeExists
|
|
425
|
+
? `Found ${neurcodeHookPath}`
|
|
426
|
+
: `Missing ${neurcodeHookPath}. Run: neurcode cursor gate install --hook ${hookKind}`,
|
|
427
|
+
});
|
|
428
|
+
if (neurcodeExists) {
|
|
429
|
+
try {
|
|
430
|
+
const stat = (0, node_fs_1.statSync)(neurcodeHookPath);
|
|
431
|
+
const executable = (stat.mode & 0o111) !== 0;
|
|
432
|
+
checks.push({
|
|
433
|
+
id: `neurcode_hook_executable_${prefix}`,
|
|
434
|
+
status: executable ? 'pass' : 'fail',
|
|
435
|
+
message: executable
|
|
436
|
+
? `${hookKind} hook script is executable`
|
|
437
|
+
: `${hookKind} hook script is not executable`,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
catch (error) {
|
|
441
|
+
checks.push({
|
|
442
|
+
id: `neurcode_hook_executable_${prefix}`,
|
|
443
|
+
status: 'fail',
|
|
444
|
+
message: error instanceof Error ? error.message : String(error),
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
checks.push({
|
|
449
|
+
id: `githooks_${prefix}`,
|
|
450
|
+
status: githookExists ? 'pass' : 'fail',
|
|
451
|
+
message: githookExists
|
|
452
|
+
? `Found ${hookPath}`
|
|
453
|
+
: `Missing ${hookPath}. Run: neurcode cursor gate install --hook ${hookKind}`,
|
|
454
|
+
});
|
|
455
|
+
if (githookExists) {
|
|
456
|
+
const content = (0, node_fs_1.readFileSync)(hookPath, 'utf8');
|
|
457
|
+
checks.push({
|
|
458
|
+
id: `githooks_fragment_${prefix}`,
|
|
459
|
+
status: content.includes('neurcode-cursor-gate') ? 'pass' : 'fail',
|
|
460
|
+
message: content.includes('neurcode-cursor-gate')
|
|
461
|
+
? `${hookKind} delegates to Neurcode cursor gate`
|
|
462
|
+
: `${hookKind} missing neurcode-cursor-gate marker`,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
return checks;
|
|
466
|
+
}
|
|
467
|
+
function doctorCursorGateHook(input) {
|
|
468
|
+
const repoRoot = (0, v0_governance_1.resolveRepoRoot)(input.dir || process.cwd());
|
|
469
|
+
const cliVersionWarning = buildCliVersionStaleWarning();
|
|
470
|
+
const prePushInstalled = (0, node_fs_1.existsSync)((0, node_path_1.resolve)(repoRoot, '.githooks', 'pre-push'))
|
|
471
|
+
|| (0, node_fs_1.existsSync)((0, node_path_1.resolve)(repoRoot, '.neurcode', 'hooks', 'pre-push'));
|
|
472
|
+
const preCommitInstalled = (0, node_fs_1.existsSync)((0, node_path_1.resolve)(repoRoot, '.githooks', 'pre-commit'))
|
|
473
|
+
|| (0, node_fs_1.existsSync)((0, node_path_1.resolve)(repoRoot, '.neurcode', 'hooks', 'pre-commit'));
|
|
474
|
+
const requirePreCommit = preCommitInstalled;
|
|
475
|
+
const requirePrePush = prePushInstalled || !preCommitInstalled;
|
|
476
|
+
const checks = [
|
|
477
|
+
...doctorCursorGateHookKind(repoRoot, 'pre-push', requirePrePush),
|
|
478
|
+
...doctorCursorGateHookKind(repoRoot, 'pre-commit', requirePreCommit),
|
|
479
|
+
];
|
|
480
|
+
const hooksPathResult = runGit(['config', '--get', 'core.hooksPath'], repoRoot);
|
|
481
|
+
const configured = hooksPathResult.status === 0 ? hooksPathResult.stdout.trim() : '';
|
|
482
|
+
const expected = '.githooks';
|
|
483
|
+
const hooksNeeded = prePushInstalled || preCommitInstalled;
|
|
484
|
+
checks.push({
|
|
485
|
+
id: 'core_hooks_path',
|
|
486
|
+
status: !hooksNeeded || configured === expected || configured === (0, node_path_1.resolve)(repoRoot, '.githooks')
|
|
487
|
+
? 'pass'
|
|
488
|
+
: 'fail',
|
|
489
|
+
message: configured
|
|
490
|
+
? `core.hooksPath=${configured}`
|
|
491
|
+
: hooksNeeded
|
|
492
|
+
? 'core.hooksPath is unset. Run: neurcode cursor gate install'
|
|
493
|
+
: 'core.hooksPath is unset (no hooks installed yet).',
|
|
494
|
+
});
|
|
495
|
+
if (cliVersionWarning) {
|
|
496
|
+
checks.push({
|
|
497
|
+
id: 'cli_version_stale',
|
|
498
|
+
status: 'fail',
|
|
499
|
+
message: cliVersionWarning.message,
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
return {
|
|
503
|
+
ok: checks.every((check) => check.status === 'pass'),
|
|
504
|
+
checks,
|
|
505
|
+
repoRoot,
|
|
506
|
+
cliVersionWarning,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
//# sourceMappingURL=cursor-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-gate.js","sourceRoot":"","sources":["../../src/utils/cursor-gate.ts"],"names":[],"mappings":";;;AAoCA,sDAQC;AAGD,kEAsBC;AAED,gEASC;AAsJD,8DAOC;AAED,gDAmFC;AAED,4DAoBC;AA8ID,sDAqCC;AAkFD,oDA6CC;AA1oBD,6CAAyC;AACzC,qCAAkG;AAClG,yCAA0C;AAC1C,2DAA+C;AAC/C,sDAAyD;AACzD,wEAOyC;AACzC,+CAIuB;AACvB,mDAAkD;AAClD,iDAA0D;AAE7C,QAAA,0BAA0B,GAAG,yBAAkC,CAAC;AAChE,QAAA,2BAA2B,GAAG,QAAiB,CAAC;AAc7D,SAAgB,qBAAqB;IACnC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,OAAO,EAAE,MAAM,CAAC,CAAyB,CAAC;QAC9E,OAAO,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,SAAgB,2BAA2B,CAAC,OAG3C;IACC,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAC;IAChD,MAAM,cAAc,GAAG,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,IAAI,eAAe,CAAC;IAClF,MAAM,cAAc,GAAG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,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C7B,MAAM,WAAW,GAAG,gBAAgB,IAAI,kBAAkB,CAAC;IAC3D,MAAM,CAAC,IAAI,CAAC;QACV,EAAE,EAAE,iBAAiB;QACrB,MAAM,EAAE,CAAC,WAAW,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAA,mBAAO,EAAC,QAAQ,EAAE,WAAW,CAAC;YAC9F,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,MAAM;QACV,OAAO,EAAE,UAAU;YACjB,CAAC,CAAC,kBAAkB,UAAU,EAAE;YAChC,CAAC,CAAC,WAAW;gBACX,CAAC,CAAC,4DAA4D;gBAC9D,CAAC,CAAC,mDAAmD;KAC1D,CAAC,CAAC;IAEH,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,CAAC,IAAI,CAAC;YACV,EAAE,EAAE,mBAAmB;YACvB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,iBAAiB,CAAC,OAAO;SACnC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;QACpD,MAAM;QACN,QAAQ;QACR,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type GovernanceSession } from '@neurcode-ai/governance-runtime';
|
|
2
|
+
export declare const SESSION_SCOPE_RULES_RELATIVE: ".cursor/rules/neurcode-session-scope.mdc";
|
|
3
|
+
export declare const STRICT_CURSOR_RULES_MARKER = "neurcode-enterprise-strict-mode";
|
|
4
|
+
export interface SessionScopeRulesResult {
|
|
5
|
+
ok: boolean;
|
|
6
|
+
filePath: string;
|
|
7
|
+
sessionId: string | null;
|
|
8
|
+
allowedGlobs: string[];
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export interface StrictCursorRulesResult {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
filePath: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildSessionScopeRulesBody(session: GovernanceSession): string;
|
|
17
|
+
export declare function writeSessionScopeRules(input: {
|
|
18
|
+
repoRoot: string;
|
|
19
|
+
session: GovernanceSession;
|
|
20
|
+
}): SessionScopeRulesResult;
|
|
21
|
+
export declare function refreshSessionScopeRules(input: {
|
|
22
|
+
dir?: string;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
}): SessionScopeRulesResult;
|
|
25
|
+
export declare function writeStrictCursorRules(input: {
|
|
26
|
+
repoRoot: string;
|
|
27
|
+
}): StrictCursorRulesResult;
|
|
28
|
+
export declare function listStrictOnboardArtifacts(repoRoot: string): string[];
|
|
29
|
+
//# sourceMappingURL=session-allowlist-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-allowlist-rules.d.ts","sourceRoot":"","sources":["../../src/utils/session-allowlist-rules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGzG,eAAO,MAAM,4BAA4B,EAAG,0CAAmD,CAAC;AAChG,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAE5E,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CA0B7E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,GAAG,uBAAuB,CAY1B;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,uBAAuB,CAe1B;AAgBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,uBAAuB,CAoB3F;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAWrE"}
|