@nurix/nustack 0.23.12 → 0.23.14
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.js +1 -53
- package/dist/commands/check.js +73 -0
- package/dist/commands/deploy.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/harness.js +127 -48
- package/dist/commands/init.js +103 -3
- package/dist/commands/login.js +9 -2
- package/dist/commands/mcp.js +7 -0
- package/dist/commands/project-sync.js +2 -1
- package/dist/commands/read.js +19 -0
- package/dist/commands/records.js +10 -0
- package/dist/commands/review.js +3 -2
- package/dist/commands/sessions.js +4 -1
- package/dist/commands/sync.js +2 -1
- package/dist/index.js +4 -0
- package/dist/lib/agent/claudeHooks.js +4 -1
- package/dist/lib/agent/desktopDoor.js +55 -0
- package/dist/lib/auth_grant.js +15 -3
- package/dist/lib/auth_recovery.js +10 -3
- package/dist/lib/etna/manager.js +24 -6
- package/dist/lib/etna/profile.js +6 -0
- package/dist/lib/etna/reconcile.js +6 -0
- package/dist/lib/gate/bulkReadRelay.js +354 -0
- package/dist/lib/gate/hook.js +30 -3
- package/dist/lib/gate/outline.js +12 -0
- package/dist/lib/gate/settings.js +24 -1
- package/dist/lib/gate/tierOne.js +22 -0
- package/dist/lib/harness/codes.js +24 -0
- package/dist/lib/harness/hookCheck.js +325 -0
- package/dist/lib/harness/hookEntry.js +27 -0
- package/dist/lib/harness/legacyMount.js +231 -0
- package/dist/lib/harness/mount.js +199 -131
- package/dist/lib/harness/storeWaivers.js +43 -0
- package/dist/lib/harness/vendor.js +29 -0
- package/dist/lib/harness/versionsClient.js +54 -0
- package/dist/lib/local_store/database.js +18 -0
- package/dist/lib/local_store/routing.js +26 -0
- package/dist/lib/nustack_client.js +35 -2
- package/dist/lib/onboarding/attach_existing_git.js +14 -2
- package/dist/lib/onboarding/binding.js +46 -2
- package/dist/lib/onboarding/commit_trailer_hook.js +66 -0
- package/dist/lib/onboarding/manifest_writer.js +19 -3
- package/dist/lib/onboarding/session_hook.js +76 -0
- package/dist/lib/origin_guard.js +43 -0
- package/dist/lib/project_contract.js +104 -0
- package/dist/lib/records/door.js +26 -19
- package/dist/lib/records/drain.js +10 -4
- package/dist/lib/records/refusalLog.js +30 -1
- package/dist/lib/session-engine/supervisor.js +6 -18
- package/dist/lib/sessions/client.js +0 -12
- package/dist/program.js +27 -4
- package/dist/vendor/harness/assemble/runtimes.js +32 -0
- package/dist/vendor/harness/assemble/settingsMerge.js +136 -0
- package/dist/vendor/harness/digest/index.js +38 -0
- package/dist/vendor/harness/lib/findings.js +32 -0
- package/dist/vendor/harness/lib/frontmatter.js +79 -0
- package/dist/vendor/harness/lib/paths.js +31 -0
- package/dist/vendor/harness/mount/cache.js +65 -0
- package/dist/vendor/harness/mount/exclude.js +77 -0
- package/dist/vendor/harness/mount/files.js +38 -0
- package/dist/vendor/harness/mount/index.js +352 -0
- package/dist/vendor/harness/rules/changeRules.js +162 -0
- package/dist/vendor/harness/rules/context.js +38 -0
- package/dist/vendor/harness/rules/docsRoot.js +34 -0
- package/dist/vendor/harness/rules/index.js +109 -0
- package/dist/vendor/harness/rules/node.js +144 -0
- package/dist/vendor/harness/rules/outputGate.js +28 -0
- package/dist/vendor/harness/rules/ownership.js +178 -0
- package/dist/vendor/harness/rules/packageTable.js +113 -0
- package/dist/vendor/harness/rules/plans.js +96 -0
- package/dist/vendor/harness/rules/sessionWalls.js +31 -0
- package/package.json +5 -5
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Anchored at statement boundaries, so quoted text never trips a screen and a command on its own line never slips one. */
|
|
2
|
+
const AT_STATEMENT = String.raw `(?:^|\n|&&|;|\|)\s*(?:sudo\s+)?(?:npx\s+(?:--yes\s+)?)?`;
|
|
3
|
+
const statement = (body) => new RegExp(AT_STATEMENT + body);
|
|
4
|
+
const BRANCH_CREATE = statement(String.raw `git\s+(checkout\s+-b|switch\s+-c|branch\s+(?!-)\S+|worktree\s+add)`);
|
|
5
|
+
const LIVE_COMMAND = statement(String.raw `wrangler(?:@\S+)?\b.*(\bd1\s+execute\b.*--remote|\bsecret\s+(put|bulk)\b|\bdeploy\b)`);
|
|
6
|
+
const missing = (id, what) => [{ id: `${id}.context_missing`, message: `${id} needs ${what}, which the caller did not pass` }];
|
|
7
|
+
export function branchWorktreeRule(ctx) {
|
|
8
|
+
if (!ctx.action)
|
|
9
|
+
return missing('branch-worktree', 'the Bash command');
|
|
10
|
+
return BRANCH_CREATE.test(ctx.action.command) ? [{ id: 'branch-worktree.create', message: 'the command creates a branch or worktree; policy allows that only when the person asked for one' }] : [];
|
|
11
|
+
}
|
|
12
|
+
export function liveCommandRule(ctx) {
|
|
13
|
+
if (!ctx.action)
|
|
14
|
+
return missing('live-command', 'the Bash command');
|
|
15
|
+
const command = ctx.action.command;
|
|
16
|
+
return LIVE_COMMAND.test(command) && !/--dry-run\b|--local\b/.test(command) ? [{ id: 'live-command.live', message: 'the command deploys, writes a remote database or sets a secret' }] : [];
|
|
17
|
+
}
|
|
18
|
+
/** A rule over one session fact: missing when the fact is absent, a finding when `judge` says so. */
|
|
19
|
+
function factRule(id, key, judge) {
|
|
20
|
+
return (ctx) => {
|
|
21
|
+
const value = ctx.session?.[key];
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
return missing(id, `the session fact ${String(key)}`);
|
|
24
|
+
return judge(value);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const commitClaimRule = factRule('commit-claim', 'commitClaimHolder', (holder) => (holder ? [{ id: 'commit-claim.held', message: `another session (${holder}) holds the commit claim` }] : []));
|
|
28
|
+
export const foreignClaimRule = factRule('foreign-claim', 'foreignTouches', (touches) => (touches ?? []).map((touch) => ({ id: 'foreign-claim.touched', path: touch.path, message: `${touch.path} was touched by another live session (${touch.holder})` })));
|
|
29
|
+
export const openDenialsRule = factRule('open-denials', 'unresolvedDenials', (denials) => (denials ?? []).length ? [{ id: 'open-denials.unresolved', message: `${denials.length} gate denial(s) have no resolved line: ${denials.join('; ')}` }] : []);
|
|
30
|
+
export const exitStopRule = factRule('exit-stop', 'exitBlock', (block) => (block ? [{ id: 'exit-stop.blocked', message: block }] : []));
|
|
31
|
+
export const queueRule = factRule('queue', 'openObligations', (count) => ((count ?? 0) > 0 ? [{ id: 'queue.open_obligations', message: `${count} open obligation(s) in the session's queue` }] : []));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurix/nustack",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.14",
|
|
4
4
|
"description": "The nustack CLI — bootstrap NuStack services into a repo via the NuStack discovery plane.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@clack/prompts": "^0.11.0",
|
|
24
|
-
"@nurix/etna": "0.20.25",
|
|
25
24
|
"ajv": "^8.17.1",
|
|
26
25
|
"ajv-formats": "^3.0.1",
|
|
27
26
|
"commander": "^14.0.0"
|
|
@@ -35,15 +34,16 @@
|
|
|
35
34
|
"@types/node": "^22.19.20",
|
|
36
35
|
"typescript": "^5.7.2",
|
|
37
36
|
"vitest": "^4.1.11",
|
|
37
|
+
"@nurix/contracts": "2.0.1",
|
|
38
38
|
"@nurix/nustack.studio": "0.0.0",
|
|
39
|
-
"@nurix/
|
|
40
|
-
"@nurix/
|
|
39
|
+
"@nurix/harness": "0.0.0",
|
|
40
|
+
"@nurix/nustack.ui": "0.0.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "tsc && node scripts/copy_schema.mjs",
|
|
46
|
+
"build": "tsc && node scripts/copy_schema.mjs && node scripts/copy_harness.mjs",
|
|
47
47
|
"dev": "tsc --watch",
|
|
48
48
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json",
|
|
49
49
|
"test": "vitest run",
|