@ornexus/neocortex 4.60.23 → 4.60.24

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.
Files changed (84) hide show
  1. package/dist/sbom.cdx.json +23 -23
  2. package/install.js +67 -10
  3. package/install.ps1 +39 -8
  4. package/install.sh +18 -6
  5. package/package.json +5 -2
  6. package/packages/client/dist/adapters/adapter-registry.d.ts +2 -2
  7. package/packages/client/dist/adapters/adapter-registry.js +1 -1
  8. package/packages/client/dist/adapters/grok-adapter.d.ts +11 -0
  9. package/packages/client/dist/adapters/grok-adapter.js +2 -0
  10. package/packages/client/dist/adapters/index.d.ts +1 -0
  11. package/packages/client/dist/adapters/index.js +1 -1
  12. package/packages/client/dist/adapters/platform-detector.d.ts +1 -1
  13. package/packages/client/dist/adapters/platform-detector.js +1 -1
  14. package/packages/client/dist/agent/refresh-stubs.js +2 -2
  15. package/packages/client/dist/cli.js +21 -2
  16. package/packages/client/dist/commands/invoke.d.ts +20 -21
  17. package/packages/client/dist/commands/invoke.js +59 -55
  18. package/packages/client/dist/commands/story-checkpoint.d.ts +15 -0
  19. package/packages/client/dist/commands/story-checkpoint.js +1 -0
  20. package/packages/client/dist/config.js +1 -1
  21. package/packages/client/dist/generated/command-registry.generated.d.ts +18 -52
  22. package/packages/client/dist/generated/command-registry.generated.js +1 -1
  23. package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +67 -0
  24. package/packages/client/dist/git/direct-yolo-checkpoint.js +3 -0
  25. package/packages/client/dist/git/git-lifecycle-store.d.ts +198 -0
  26. package/packages/client/dist/git/git-lifecycle-store.js +4 -0
  27. package/packages/client/dist/git/secure-filesystem-boundary.d.ts +26 -0
  28. package/packages/client/dist/git/secure-filesystem-boundary.js +123 -0
  29. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -1
  30. package/packages/client/dist/index.d.ts +2 -0
  31. package/packages/client/dist/index.js +1 -1
  32. package/packages/client/dist/memory/shared-project-memory-types.d.ts +29 -2
  33. package/packages/client/dist/memory/shared-project-memory-types.js +2 -2
  34. package/packages/client/dist/policy/subagent-approval-policy.js +1 -1
  35. package/packages/client/dist/runner/headless/continuous-story-workspace.d.ts +131 -0
  36. package/packages/client/dist/runner/headless/continuous-story-workspace.js +58 -0
  37. package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.d.ts +23 -0
  38. package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -0
  39. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.d.ts +15 -0
  40. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +28 -0
  41. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +12 -0
  42. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +8 -0
  43. package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +134 -0
  44. package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -0
  45. package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -1
  46. package/packages/client/dist/runner/headless/run-yolo.js +1 -1
  47. package/packages/client/dist/runner/headless/run-yoloop.d.ts +7 -2
  48. package/packages/client/dist/runner/headless/run-yoloop.js +8 -1
  49. package/packages/client/dist/runner/headless/types.d.ts +1 -1
  50. package/packages/client/dist/runner/headless/types.js +2 -2
  51. package/packages/client/dist/runner-cli.js +0 -0
  52. package/packages/client/dist/state/project-state-snapshot.js +1 -1
  53. package/packages/client/dist/state/state-json-repair.d.ts +9 -0
  54. package/packages/client/dist/state/state-json-repair.js +3 -3
  55. package/packages/client/dist/tier/tier-aware-client.js +1 -1
  56. package/packages/client/dist/yoloop/invoke-hooks.d.ts +13 -10
  57. package/packages/client/dist/yoloop/invoke-hooks.js +8 -5
  58. package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1
  59. package/packages/shared/dist/generated/command-registry.generated.js +18 -66
  60. package/packages/shared/dist/generated/invocation-schema.generated.js +5 -25
  61. package/packages/shared/dist/invocation/index.d.ts +1 -1
  62. package/packages/shared/dist/yoloop/epic-terminal-git.js +227 -0
  63. package/packages/shared/dist/yoloop/planning-graph.js +119 -0
  64. package/packages/shared/dist/yoloop/public-story-write-set.js +27 -0
  65. package/packages/shared/dist/yoloop/wave-decision-receipt.js +19 -0
  66. package/targets-stubs/antigravity/gemini.md +1 -1
  67. package/targets-stubs/antigravity/neocortex.md +18 -0
  68. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  69. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  70. package/targets-stubs/claude-code/neocortex-root.md +21 -2
  71. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  72. package/targets-stubs/claude-code/neocortex.md +2 -2
  73. package/targets-stubs/codex/AGENTS.md +20 -1
  74. package/targets-stubs/cursor/agent.md +20 -2
  75. package/targets-stubs/gemini-cli/agent.md +2 -2
  76. package/targets-stubs/gemini-cli/gemini.md +18 -0
  77. package/targets-stubs/grok/README.md +13 -0
  78. package/targets-stubs/grok/SKILL.md +50 -0
  79. package/targets-stubs/grok/config-mcp.toml +22 -0
  80. package/targets-stubs/grok/install-grok.sh +31 -0
  81. package/targets-stubs/kimi/neocortex.md +18 -0
  82. package/targets-stubs/openclaw/SKILL.md +18 -0
  83. package/targets-stubs/opencode/neocortex-root.md +20 -1
  84. package/targets-stubs/vscode/neocortex.agent.md +20 -2
@@ -0,0 +1,123 @@
1
+ import{spawn as b}from"node:child_process";import{randomBytes as k}from"node:crypto";import{lstat as w,stat as v}from"node:fs/promises";const B=String.raw`
2
+ const fs = require('node:fs');
3
+ const [op, expectedDev, expectedIno, name, temporary] = process.argv.slice(1);
4
+ const fail = (code) => { process.stderr.write(code); process.exit(73); };
5
+ process.on('uncaughtException', (error) => fail('secure-filesystem-os:' + String(error && error.code || 'UNKNOWN')));
6
+ const safe = (value) => typeof value === 'string' && value.length > 0 && value.length <= 255
7
+ && !value.includes('/') && !value.includes('\\') && !value.includes('\0') && value !== '.' && value !== '..';
8
+ if (!safe(name) || (temporary && !safe(temporary))) fail('secure-filesystem-name-invalid');
9
+ const cwd = fs.statSync('.', { bigint: true });
10
+ if (String(cwd.dev) !== expectedDev || String(cwd.ino) !== expectedIno || !cwd.isDirectory()) {
11
+ fail('secure-filesystem-anchor-mismatch');
12
+ }
13
+ const noFollow = fs.constants.O_NOFOLLOW || 0;
14
+ const safeExisting = (target, kind) => {
15
+ try {
16
+ const item = fs.lstatSync(target, { bigint: true });
17
+ if (item.isSymbolicLink() || (kind === 'file' && !item.isFile()) || (kind === 'directory' && !item.isDirectory())) {
18
+ fail('secure-filesystem-entry-unsafe');
19
+ }
20
+ return item;
21
+ } catch (error) {
22
+ if (error && error.code === 'ENOENT') return null;
23
+ throw error;
24
+ }
25
+ };
26
+ const readStdin = () => fs.readFileSync(0);
27
+ if (op === 'mkdir' || op === 'mkdir-exclusive') {
28
+ try { fs.mkdirSync(name, { mode: 0o700 }); } catch (error) {
29
+ if (!error || error.code !== 'EEXIST') throw error;
30
+ if (op === 'mkdir-exclusive') fail('secure-filesystem-entry-exists');
31
+ }
32
+ const created = safeExisting(name, 'directory') || fail('secure-filesystem-directory-missing');
33
+ if (op === 'mkdir-exclusive') process.stdout.write('secure-filesystem-identity:' + String(created.dev) + ':' + String(created.ino));
34
+ } else if (op === 'create-owned-directory') {
35
+ fs.mkdirSync(name, { mode: 0o700 });
36
+ const created = safeExisting(name, 'directory') || fail('secure-filesystem-directory-missing');
37
+ process.chdir(name);
38
+ const handed = fs.statSync('.', { bigint: true });
39
+ if (created.dev !== handed.dev || created.ino !== handed.ino) fail('secure-filesystem-anchor-mismatch');
40
+ const fd = fs.openSync('owner.json', fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_WRONLY | noFollow, 0o600);
41
+ try { fs.writeFileSync(fd, readStdin()); fs.fsyncSync(fd); } finally { fs.closeSync(fd); }
42
+ safeExisting('owner.json', 'file') || fail('secure-filesystem-owner-missing');
43
+ try { const child = fs.openSync('.', fs.constants.O_RDONLY); fs.fsyncSync(child); fs.closeSync(child); } catch {}
44
+ } else if (op === 'write') {
45
+ safeExisting(name, 'file');
46
+ const fd = fs.openSync(temporary, fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_WRONLY | noFollow, 0o600);
47
+ try {
48
+ fs.writeFileSync(fd, readStdin());
49
+ fs.fsyncSync(fd);
50
+ } finally { fs.closeSync(fd); }
51
+ safeExisting(temporary, 'file') || fail('secure-filesystem-temporary-missing');
52
+ safeExisting(name, 'file');
53
+ fs.renameSync(temporary, name);
54
+ safeExisting(name, 'file') || fail('secure-filesystem-destination-missing');
55
+ } else if (op === 'remove') {
56
+ const item = safeExisting(name, 'file');
57
+ if (item) fs.unlinkSync(name);
58
+ } else if (op === 'rename-directory') {
59
+ safeExisting(name, 'directory') || fail('secure-filesystem-directory-missing');
60
+ if (safeExisting(temporary, 'directory')) fail('secure-filesystem-destination-exists');
61
+ fs.renameSync(name, temporary);
62
+ safeExisting(temporary, 'directory') || fail('secure-filesystem-destination-missing');
63
+ } else if (op === 'remove-directory') {
64
+ const item = safeExisting(name, 'directory');
65
+ if (item) fs.rmSync(name, { recursive: true, force: false, maxRetries: 0 });
66
+ if (safeExisting(name, 'directory')) fail('secure-filesystem-directory-remained');
67
+ } else fail('secure-filesystem-operation-invalid');
68
+ try { const parent = fs.openSync('.', fs.constants.O_RDONLY); fs.fsyncSync(parent); fs.closeSync(parent); } catch {}
69
+ `,R=String.raw`
70
+ const fs = require('node:fs');
71
+ const cp = require('node:child_process');
72
+ const [expectedParentDev, expectedParentIno, name, expectedChildDev, expectedChildIno, encodedArgs, handshake, binary] = process.argv.slice(1);
73
+ const fail = (code) => { process.stderr.write(code); process.exit(73); };
74
+ process.on('uncaughtException', (error) => fail('secure-git-os:' + String(error && error.code || 'UNKNOWN')));
75
+ const safeName = typeof name === 'string' && name.length > 0 && name.length <= 255
76
+ && !name.includes('/') && !name.includes('\\') && !name.includes('\0') && name !== '.' && name !== '..';
77
+ if (!safeName) fail('secure-git-name-invalid');
78
+ const parent = fs.statSync('.', { bigint: true });
79
+ if (!parent.isDirectory() || String(parent.dev) !== expectedParentDev || String(parent.ino) !== expectedParentIno) {
80
+ fail('secure-git-parent-anchor-mismatch');
81
+ }
82
+ const child = fs.lstatSync(name, { bigint: true });
83
+ if (!child.isDirectory() || child.isSymbolicLink()
84
+ || String(child.dev) !== expectedChildDev || String(child.ino) !== expectedChildIno) {
85
+ fail('secure-git-child-anchor-mismatch');
86
+ }
87
+ process.chdir(name);
88
+ const handed = fs.statSync('.', { bigint: true });
89
+ if (!handed.isDirectory() || String(handed.dev) !== expectedChildDev || String(handed.ino) !== expectedChildIno) {
90
+ fail('secure-git-handoff-mismatch');
91
+ }
92
+ if (handshake === '1') process.stderr.write('secure-git-handoff-ready\n');
93
+ const input = fs.readFileSync(0);
94
+ let args;
95
+ try { args = JSON.parse(Buffer.from(encodedArgs, 'base64url').toString('utf8')); } catch { fail('secure-git-args-invalid'); }
96
+ if (!Array.isArray(args) || args.length === 0 || args.length > 512
97
+ || args.some((arg) => typeof arg !== 'string' || arg.length > 4096 || arg.includes('\0'))) {
98
+ fail('secure-git-args-invalid');
99
+ }
100
+ process.umask(0o077);
101
+ if (!['git', 'node', 'npm'].includes(binary)) fail('secure-git-command-invalid');
102
+ const maxOutputBytes = binary === 'git' ? 16 * 1024 * 1024 : 64 * 1024 * 1024;
103
+ const gitEnv = { ...process.env, GIT_OPTIONAL_LOCKS: '1' };
104
+ for (const key of ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE', 'GIT_OBJECT_DIRECTORY',
105
+ 'GIT_ALTERNATE_OBJECT_DIRECTORIES', 'GIT_COMMON_DIR', 'GIT_NAMESPACE', 'GIT_CEILING_DIRECTORIES']) delete gitEnv[key];
106
+ if (binary !== 'git') {
107
+ for (const key of ['NODE_OPTIONS', 'NODE_PATH', 'NEOCORTEX_RELEASE_GATE_MANIFEST']) delete gitEnv[key];
108
+ gitEnv.npm_config_global = 'false';
109
+ }
110
+ const result = cp.spawnSync(binary === 'node' ? process.execPath : binary, args, {
111
+ input,
112
+ encoding: null,
113
+ maxBuffer: maxOutputBytes,
114
+ windowsHide: true,
115
+ env: gitEnv,
116
+ });
117
+ if (result.error) fail('secure-git-command-error:' + String(result.error.code || 'UNKNOWN'));
118
+ if (result.status !== 0) fail('secure-git-command-failed:' + String(Number.isInteger(result.status) ? result.status : 1));
119
+ if (result.stdout && result.stdout.length > maxOutputBytes) fail('secure-git-output-too-large');
120
+ if (result.stdout) process.stdout.write(result.stdout);
121
+ `;function x(r=process.platform){return r!=="win32"}async function G(r,e,t,i={}){const n=`.${e}.${process.pid}.${k(8).toString("hex")}.tmp`;await m(r,["write",e,n],Buffer.isBuffer(t)?t:Buffer.from(t),i)}async function P(r,e,t={}){await m(r,["remove",e],void 0,t)}async function H(r,e,t={}){await m(r,["mkdir",e],void 0,t)}async function W(r,e){const i=(await m(r,["mkdir-exclusive",e])).toString("utf8").match(/^secure-filesystem-identity:([0-9]+):([0-9]+)$/);if(!i)throw new Error("secure-filesystem-created-identity-missing");return Object.freeze({dev:i[1],ino:i[2]})}async function X(r){if(!x())throw new Error("secure-filesystem-platform-unsupported");const e=await w(r,{bigint:!0}),t=await v(r,{bigint:!0});if(e.isSymbolicLink()||!e.isDirectory()||!t.isDirectory()||e.dev!==t.dev||e.ino!==t.ino)throw new Error("secure-filesystem-directory-unsafe");return Object.freeze({dev:String(t.dev),ino:String(t.ino)})}async function K(r,e,t,i,n,c={}){return O("git",r,e,t,i,n,c)}async function Y(r,e,t,i,n,c={}){return O("node",r,e,t,i,n,c)}async function $(r,e,t,i){return O("npm",r,e,t,i)}async function O(r,e,t,i,n,c,f={}){if(!x(f.platform??process.platform))throw new Error("secure-filesystem-platform-unsupported");if(n.length===0||n.length>512||n.some(a=>typeof a!="string"||a.length>4096||a.includes("\0")))throw new Error("secure-git-args-invalid");const d=await v(e,{bigint:!0}),s=await w(e,{bigint:!0});if(!d.isDirectory()||s.isSymbolicLink()||!s.isDirectory()||d.dev!==s.dev||d.ino!==s.ino)throw new Error("secure-filesystem-parent-invalid");await f.beforeHandoff?.();const y=r==="git"?16*1024*1024:64*1024*1024;return await new Promise((a,p)=>{const l=f.afterHandoff?"1":"0",g=Buffer.from(JSON.stringify([...n])).toString("base64url"),o=b(process.execPath,["-e",R,String(d.dev),String(d.ino),t,i.dev,i.ino,g,l,r],{cwd:e,stdio:["pipe","pipe","pipe"]}),h=[],E=[];let S=0,I=!f.afterHandoff,_=!1;const N=async()=>{if(!_){_=!0;try{await f.afterHandoff?.(),I=!0,o.stdin.end(c===void 0?void 0:Buffer.isBuffer(c)?c:Buffer.from(c))}catch(u){o.kill(),p(u)}}};o.stdout.on("data",u=>{S+=u.length,S>y?o.kill():h.push(u)}),o.stderr.on("data",u=>{E.push(u),!I&&Buffer.concat(E).includes(Buffer.from(`secure-git-handoff-ready
122
+ `))&&N()}),o.once("error",p),o.once("close",u=>{if(u===0&&S<=y)return a(Buffer.concat(h));const T=Buffer.concat(E).toString("utf8").split(`
123
+ `).find(D=>D.startsWith("secure-git-")&&D!=="secure-git-handoff-ready")??(S>y?"secure-git-output-too-large":"secure-git-helper-failed");p(new Error(T))}),f.afterHandoff||N()})}async function J(r,e,t){await m(r,["create-owned-directory",e],Buffer.isBuffer(t)?t:Buffer.from(t))}async function M(r,e,t,i={}){await m(r,["rename-directory",e,t],void 0,i)}async function q(r,e,t={}){await m(r,["remove-directory",e],void 0,t)}async function m(r,e,t,i={}){if(!x(i.platform??process.platform))throw new Error("secure-filesystem-platform-unsupported");const n=await v(r,{bigint:!0});if(!n.isDirectory())throw new Error("secure-filesystem-parent-invalid");if((await w(r,{bigint:!0})).isSymbolicLink())throw new Error("secure-filesystem-parent-symlink");return await i.beforeHandoff?.(),await new Promise((f,d)=>{const s=b(process.execPath,["-e",B,...e.slice(0,1),String(n.dev),String(n.ino),...e.slice(1)],{cwd:r,stdio:["pipe","pipe","pipe"]}),y=[];let a=0;const p=[];s.stdout.on("data",l=>{a+=l.length,a>1024?s.kill():y.push(l)}),s.stderr.on("data",l=>p.push(l)),s.once("error",d),s.once("close",l=>{if(l===0&&a<=1024)return f(Buffer.concat(y));const g=Buffer.concat(p).toString("utf8")||"secure-filesystem-helper-failed",o=new Error(g),h=g.match(/^secure-filesystem-os:(E[A-Z0-9]+)$/)?.[1];h&&(o.code=h),g==="secure-filesystem-entry-exists"&&(o.code="EEXIST"),d(o)}),s.stdin.end(t)})}export{G as anchoredAtomicWriteFile,W as anchoredCreateDirectory,J as anchoredCreateOwnedDirectory,X as anchoredDirectoryIdentity,H as anchoredEnsureDirectory,K as anchoredExecuteGit,Y as anchoredExecuteNode,$ as anchoredExecuteNpm,q as anchoredRemoveDirectory,P as anchoredRemoveFile,M as anchoredRenameDirectory,x as secureFilesystemBoundaryAvailable};
@@ -1 +1 @@
1
- const L=1,O="client-pre-command-v1",N=["utility","planning","architecture","diagnostic","research","story-execution","review","qa","security","continuity","recovery"],h={maxItems:24,maxEdges:64,maxPayloadBytes:12288,maxSnippetChars:480,maxLabelChars:160,maxTotalCost:100},i=e=>Object.freeze({...e}),v=Object.freeze({utility:i({maxItems:4,maxEdges:8,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:40}),planning:i({maxItems:12,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:70}),architecture:i({maxItems:10,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:65}),diagnostic:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),research:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),"story-execution":i({maxItems:6,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),review:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),qa:i({maxItems:6,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),security:i({maxItems:8,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),continuity:i({maxItems:6,maxEdges:16,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:45}),recovery:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55})}),u=e=>Object.freeze({commandId:e.commandId,...e.number===void 0?{}:{number:e.number},aliases:Object.freeze([...e.aliases??[]]),retrievalProfile:e.retrievalProfile,retrievalBudget:v[e.retrievalProfile]}),C=[{commandId:"status",number:1,aliases:["st"],retrievalProfile:"utility"},{commandId:"init",number:2,aliases:["inicializar"],retrievalProfile:"utility"},{commandId:"arch-plan",number:3,aliases:["arquitetura","architecture","arch"],retrievalProfile:"architecture"},{commandId:"arch-prd",number:4,aliases:["prd","product-requirements"],retrievalProfile:"architecture"},{commandId:"arch-architecture",number:5,aliases:["arch-doc","tech-architecture"],retrievalProfile:"architecture"},{commandId:"arch-api-contracts",number:6,aliases:["api-contracts","api-contract"],retrievalProfile:"architecture"},{commandId:"arch-api-integrations",number:7,aliases:["api-integrations","api-int"],retrievalProfile:"architecture"},{commandId:"arch-database",number:8,aliases:["database-schema","db-schema","db"],retrievalProfile:"architecture"},{commandId:"arch-security",number:9,aliases:["cyber-security","security","sec"],retrievalProfile:"architecture"},{commandId:"arch-design-system",number:10,aliases:["design-system","ds","atomic-design"],retrievalProfile:"architecture"},{commandId:"arch-ux-design",number:11,aliases:["ux-design","ux","wireframes","wireframe","user-flows"],retrievalProfile:"architecture"},{commandId:"arch-performance",number:12,aliases:["performance","perf","capacity-planning","capacity","arch-perf","performance-strategy"],retrievalProfile:"architecture"},{commandId:"arch-testing",number:13,aliases:["testing-strategy","test-plan","test-strategy","arch-test"],retrievalProfile:"architecture"},{commandId:"arch-infrastructure",number:14,aliases:["infrastructure","infra","deploy-plan","deployment","arch-infra","arch-deploy"],retrievalProfile:"architecture"},{commandId:"arch-review",number:15,aliases:["review-consolidation","consolidation","architecture-review","arch-consolidation"],retrievalProfile:"architecture"},{commandId:"arch-fitness-functions",number:16,aliases:["fitness","fitness-functions","archfit","arch-fit","fit-funcs"],retrievalProfile:"architecture"},{commandId:"create-epic",number:17,aliases:["criar-epic","planejamento"],retrievalProfile:"planning"},{commandId:"idea-diagnose",number:18,aliases:["idea-diag"],retrievalProfile:"planning"},{commandId:"idea-research",number:19,aliases:["idea-pesq"],retrievalProfile:"planning"},{commandId:"generate-epic",number:20,aliases:["gerar-epic"],retrievalProfile:"planning"},{commandId:"exec",number:21,aliases:["executar","pipeline"],retrievalProfile:"story-execution"},{commandId:"yolo",number:22,retrievalProfile:"story-execution"},{commandId:"epic",number:23,aliases:["parallel-epic"],retrievalProfile:"story-execution"},{commandId:"setup-branch",number:24,aliases:["setup","branch"],retrievalProfile:"story-execution"},{commandId:"diagnose",number:25,aliases:["diag","diagnostico","c02"],retrievalProfile:"diagnostic"},{commandId:"research",number:26,aliases:["pesquisar","pesq","research-fix","c03"],retrievalProfile:"research"},{commandId:"write-spec",number:27,aliases:["spec","especificacao","c04"],retrievalProfile:"story-execution"},{commandId:"create-tasks",number:28,aliases:["tasks","tarefas","c05"],retrievalProfile:"story-execution"},{commandId:"implement",number:29,aliases:["impl","implementar","c06"],retrievalProfile:"story-execution"},{commandId:"commit",number:30,aliases:["push","commit-push","commit_push","cp","c07"],retrievalProfile:"story-execution"},{commandId:"sync",number:31,aliases:["sincronizar","c08"],retrievalProfile:"story-execution"},{commandId:"create-pr",number:32,aliases:["pr","c09"],retrievalProfile:"story-execution"},{commandId:"review",number:33,aliases:["revisar","c11"],retrievalProfile:"review"},{commandId:"merge",number:34,aliases:["mesclar","c12"],retrievalProfile:"story-execution"},{commandId:"fix-blocked",number:35,aliases:["fix","corrigir"],retrievalProfile:"recovery"},{commandId:"finalize-epic",number:36,aliases:["finalizar"],retrievalProfile:"recovery"},{commandId:"resolve-conflicts",number:37,aliases:["conflitos"],retrievalProfile:"recovery"},{commandId:"update-memory",number:38,aliases:["memoria"],retrievalProfile:"recovery"},{commandId:"refactor",number:39,aliases:["refactoring","refact","refac","rf","cleanup-code","code-cleanup","code-quality","improve-code","modernize","modernization","legacy","legacy-code","debt-pay","pay-debt","debt-reduction","smell-fix","fix-smells","code-smells","strangler","strangler-fig"],retrievalProfile:"recovery"},{commandId:"cleanup",number:40,aliases:["limpar","limpeza"],retrievalProfile:"utility"},{commandId:"audit",number:41,aliases:["auditar","auditoria"],retrievalProfile:"utility"},{commandId:"tech-debt",number:42,aliases:["debt","debts","debt-list","tech-debts","td"],retrievalProfile:"utility"},{commandId:"menu",number:43,aliases:["help","ajuda","?","commands","cmds"],retrievalProfile:"utility"},{commandId:"plans",number:44,aliases:["planos","pricing"],retrievalProfile:"utility"},{commandId:"billing",number:45,aliases:["bill","subscription","sub"],retrievalProfile:"utility"},{commandId:"subscribe",number:46,aliases:["upgrade","checkout"],retrievalProfile:"utility"},{commandId:"qa-scan",number:47,aliases:["qa","qa-test","visual-qa","e2e-scan","troubleshoot","debug-ui","scan","a11y","accessibility","wcag"],retrievalProfile:"qa"},{commandId:"yoloop",number:48,aliases:["auto-yolo","epic-runner","story-runner","loop-yolo","auto-epic"],retrievalProfile:"utility"},{commandId:"migrate-state",number:49,aliases:["migrate","state-migrate","schema-migrate"],retrievalProfile:"utility"},{commandId:"policy-audit",number:50,aliases:["policy","audit-policy","policy-history","policies"],retrievalProfile:"utility"},{commandId:"mutation-test",number:51,aliases:["mutation","stryker","kill-mutants"],retrievalProfile:"qa"},{commandId:"sync-openapi",number:52,aliases:["openapi-sync","api-sync","spec-sync","regen-openapi"],retrievalProfile:"utility"},{commandId:"generate-pacts",number:53,aliases:["pacts","gen-pacts","regen-pacts","create-pacts"],retrievalProfile:"utility"},{commandId:"verify-pacts",number:54,aliases:["verify-pact","pact-verify","check-pacts","pact-check"],retrievalProfile:"utility"},{commandId:"property-test",number:55,aliases:["property","pbt","proptest","property-tests","invariant-test"],retrievalProfile:"qa"},{commandId:"chaos-plan",number:56,aliases:["chaos","gameday","resilience-test"],retrievalProfile:"utility"},{commandId:"ui-ux-review",number:57,aliases:["ux-review","design-review","visual-review","product-polish"],retrievalProfile:"utility"},{commandId:"solyd-system",number:58,aliases:["security-system","authorized-security","sec-system"],retrievalProfile:"security"},{commandId:"goal",number:59,aliases:["goals","durable-goal","continuity-goal"],retrievalProfile:"continuity"},{commandId:"loop",number:60,aliases:["loops","durable-loop","continuity-loop"],retrievalProfile:"continuity"},{commandId:"jobs",number:61,aliases:["job","continuity-jobs"],retrievalProfile:"continuity"},{commandId:"runner",number:62,aliases:["neocortex-runner","continuity-runner"],retrievalProfile:"continuity"},{commandId:"migrate-project-id",number:63,retrievalProfile:"recovery"}],g=[{commandId:"diagnose-inline",retrievalProfile:"diagnostic"},{commandId:"research-inline",retrievalProfile:"research"},{commandId:"yolo-inline",retrievalProfile:"story-execution"},{commandId:"goal-tick",retrievalProfile:"continuity"},{commandId:"loop-tick",retrievalProfile:"continuity"}],l=Object.freeze(C.map(u)),p=Object.freeze(g.map(u)),f=Object.freeze([...l,...p]),m=Object.freeze(Object.fromEntries(f.map(e=>[e.commandId,e]))),E=Object.freeze(Object.fromEntries(l.filter(e=>e.number!==void 0).map(e=>[e.number,e]))),_=Object.freeze(Object.fromEntries(l.flatMap(e=>e.aliases.map(a=>[y(a),e.commandId]))));function y(e){return e.trim().toLowerCase().replace(/^\*/,"")}function T(e){return e.trim().split(/\s+/,1)[0]??""}function R(){return l}function S(){return p}function A(){return f}function M(e){const a=T(e);if(!a)return m.menu??null;const t=y(a);return/^\d+$/.test(t)?E[Number.parseInt(t,10)]??null:m[t]??m[_[t]??""]??null}const b={CanonicalMemory:0,Guardrail:1,Debt:2,State:3,Story:4,Epic:5,Command:6,Doc:7,Package:8,Api:9,Route:10,DbSchema:11,Flag:12,BusinessRule:13,Risk:14,PlatformMemory:15};function d(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\.\//,"")}function I(e){return[e.nodeType,`${e.source.kind}:${d(e.source.path).toLowerCase()}`,e.stableId.toLowerCase()].join("|")}function x(e){return e.score??0}function P(e,a){const t=x(a)-x(e);if(t!==0)return t;const o=a.confidence-e.confidence;if(o!==0)return o;const s=e.budgetCost-a.budgetCost;if(s!==0)return s;const n=b[e.nodeType]-b[a.nodeType];if(n!==0)return n;const r=d(e.source.path).localeCompare(d(a.source.path),"en-US");return r!==0?r:e.stableId.localeCompare(a.stableId,"en-US")}function D(e){const a={...h,...e.budgets},t=new Map;for(const r of e.items){const c=t.get(I(r));(!c||P(r,c)<0)&&t.set(I(r),r)}const o=[],s=[];let n=0;for(const r of[...t.values()].sort(P)){const c=n+Math.max(1,r.budgetCost);if(o.length>=a.maxItems||c>a.maxTotalCost){s.push({stableId:r.stableId,source:r.source,reasonCode:"budget_exceeded"});continue}o.push(r),n=c}return{schemaVersion:1,retrievalId:e.retrievalId,query:e.query,budget:{...a,totalCost:n},items:o,skipped:s,warnings:e.warnings??[],generatedAt:e.generatedAt}}export{f as CLIENT_COMMAND_CONTEXT_POLICIES,_ as CLIENT_COMMAND_CONTEXT_POLICY_ALIAS_MAP,m as CLIENT_COMMAND_CONTEXT_POLICY_BY_ID,E as CLIENT_COMMAND_CONTEXT_POLICY_BY_NUMBER,v as CLIENT_GRAPH_RETRIEVAL_PROFILE_BUDGETS,p as CLIENT_INTERNAL_COMMAND_CONTEXT_POLICIES,l as CLIENT_PUBLIC_COMMAND_CONTEXT_POLICIES,N as COMMAND_CONTEXT_RETRIEVAL_PROFILES,h as DEFAULT_GRAPH_RETRIEVAL_BUDGETS,O as GRAPH_RETRIEVAL_CLIENT_CONTRACT_VERSION,L as GRAPH_RETRIEVAL_SCHEMA_VERSION,P as compareGraphRetrievalItems,D as createGraphRetrievalMetadata,A as listClientCommandContextPolicies,S as listClientInternalCommandContextPolicies,R as listClientPublicCommandContextPolicies,y as normalizeCommandToken,d as normalizeGraphRetrievalPath,M as resolveClientCommandContextPolicy};
1
+ const L=1,O="client-pre-command-v1",N=["utility","planning","architecture","diagnostic","research","story-execution","review","qa","security","continuity","recovery"],P={maxItems:24,maxEdges:64,maxPayloadBytes:12288,maxSnippetChars:480,maxLabelChars:160,maxTotalCost:100},i=e=>Object.freeze({...e}),v=Object.freeze({utility:i({maxItems:4,maxEdges:8,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:40}),planning:i({maxItems:12,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:70}),architecture:i({maxItems:10,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:65}),diagnostic:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),research:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),"story-execution":i({maxItems:6,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),review:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),qa:i({maxItems:6,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),security:i({maxItems:8,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),continuity:i({maxItems:6,maxEdges:16,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:45}),recovery:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55})}),u=e=>Object.freeze({commandId:e.commandId,...e.number===void 0?{}:{number:e.number},aliases:Object.freeze([...e.aliases??[]]),retrievalProfile:e.retrievalProfile,retrievalBudget:v[e.retrievalProfile]}),C=[{commandId:"status",number:1,aliases:["st"],retrievalProfile:"utility"},{commandId:"arch-plan",number:3,aliases:["arquitetura","architecture","arch"],retrievalProfile:"architecture"},{commandId:"arch-prd",number:4,aliases:["prd","product-requirements"],retrievalProfile:"architecture"},{commandId:"arch-architecture",number:5,aliases:["arch-doc","tech-architecture"],retrievalProfile:"architecture"},{commandId:"arch-api-contracts",number:6,aliases:["api-contracts","api-contract"],retrievalProfile:"architecture"},{commandId:"arch-api-integrations",number:7,aliases:["api-integrations","api-int"],retrievalProfile:"architecture"},{commandId:"arch-database",number:8,aliases:["database-schema","db-schema","db"],retrievalProfile:"architecture"},{commandId:"arch-security",number:9,aliases:["cyber-security","security","sec"],retrievalProfile:"architecture"},{commandId:"arch-design-system",number:10,aliases:["design-system","ds","atomic-design"],retrievalProfile:"architecture"},{commandId:"arch-ux-design",number:11,aliases:["ux-design","ux","wireframes","wireframe","user-flows"],retrievalProfile:"architecture"},{commandId:"arch-performance",number:12,aliases:["performance","perf","capacity-planning","capacity","arch-perf","performance-strategy"],retrievalProfile:"architecture"},{commandId:"arch-testing",number:13,aliases:["testing-strategy","test-plan","test-strategy","arch-test"],retrievalProfile:"architecture"},{commandId:"arch-infrastructure",number:14,aliases:["infrastructure","infra","deploy-plan","deployment","arch-infra","arch-deploy"],retrievalProfile:"architecture"},{commandId:"arch-review",number:15,aliases:["review-consolidation","consolidation","architecture-review","arch-consolidation"],retrievalProfile:"architecture"},{commandId:"arch-fitness-functions",number:16,aliases:["fitness","fitness-functions","archfit","arch-fit","fit-funcs"],retrievalProfile:"architecture"},{commandId:"create-epic",number:17,aliases:["criar-epic","planejamento"],retrievalProfile:"planning"},{commandId:"idea-diagnose",number:18,aliases:["idea-diag"],retrievalProfile:"planning"},{commandId:"idea-research",number:19,aliases:["idea-pesq"],retrievalProfile:"planning"},{commandId:"generate-epic",number:20,aliases:["gerar-epic"],retrievalProfile:"planning"},{commandId:"exec",number:21,aliases:["executar","pipeline"],retrievalProfile:"story-execution"},{commandId:"yolo",number:22,retrievalProfile:"story-execution"},{commandId:"epic",number:23,aliases:["parallel-epic"],retrievalProfile:"story-execution"},{commandId:"setup-branch",number:24,aliases:["setup","branch"],retrievalProfile:"story-execution"},{commandId:"diagnose",number:25,aliases:["diag","diagnostico","c02"],retrievalProfile:"diagnostic"},{commandId:"research",number:26,aliases:["pesquisar","pesq","research-fix","c03"],retrievalProfile:"research"},{commandId:"write-spec",number:27,aliases:["spec","especificacao","c04"],retrievalProfile:"story-execution"},{commandId:"create-tasks",number:28,aliases:["tasks","tarefas","c05"],retrievalProfile:"story-execution"},{commandId:"implement",number:29,aliases:["impl","implementar","c06"],retrievalProfile:"story-execution"},{commandId:"commit",number:30,aliases:["push","commit-push","commit_push","cp","c07"],retrievalProfile:"story-execution"},{commandId:"sync",number:31,aliases:["sincronizar","c08"],retrievalProfile:"story-execution"},{commandId:"create-pr",number:32,aliases:["pr","c09"],retrievalProfile:"story-execution"},{commandId:"review",number:33,aliases:["revisar","c11"],retrievalProfile:"review"},{commandId:"merge",number:34,aliases:["mesclar","c12"],retrievalProfile:"story-execution"},{commandId:"fix-blocked",number:35,aliases:["fix","corrigir"],retrievalProfile:"recovery"},{commandId:"finalize-epic",number:36,aliases:["finalizar"],retrievalProfile:"recovery"},{commandId:"resolve-conflicts",number:37,aliases:["conflitos"],retrievalProfile:"recovery"},{commandId:"update-memory",number:38,aliases:["memoria"],retrievalProfile:"recovery"},{commandId:"refactor",number:39,aliases:["refactoring","refact","refac","rf","cleanup-code","code-cleanup","code-quality","improve-code","modernize","modernization","legacy","legacy-code","debt-pay","pay-debt","debt-reduction","smell-fix","fix-smells","code-smells","strangler","strangler-fig"],retrievalProfile:"recovery"},{commandId:"cleanup",number:40,aliases:["limpar","limpeza"],retrievalProfile:"utility"},{commandId:"audit",number:41,aliases:["auditar","auditoria"],retrievalProfile:"utility"},{commandId:"tech-debt",number:42,aliases:["debt","debts","debt-list","tech-debts","td"],retrievalProfile:"utility"},{commandId:"menu",number:43,aliases:["help","ajuda","?","commands","cmds"],retrievalProfile:"utility"},{commandId:"plans",number:44,aliases:["planos","pricing"],retrievalProfile:"utility"},{commandId:"billing",number:45,aliases:["bill","subscription","sub"],retrievalProfile:"utility"},{commandId:"subscribe",number:46,aliases:["upgrade","checkout"],retrievalProfile:"utility"},{commandId:"qa-scan",number:47,aliases:["qa","qa-test","visual-qa","e2e-scan","troubleshoot","debug-ui","scan","a11y","accessibility","wcag"],retrievalProfile:"qa"},{commandId:"yoloop",number:48,aliases:["auto-yolo","epic-runner","story-runner","loop-yolo","auto-epic"],retrievalProfile:"utility"},{commandId:"migrate-state",number:49,aliases:["migrate","state-migrate","schema-migrate"],retrievalProfile:"utility"},{commandId:"policy-audit",number:50,aliases:["policy","audit-policy","policy-history","policies"],retrievalProfile:"utility"},{commandId:"mutation-test",number:51,aliases:["mutation","stryker","kill-mutants"],retrievalProfile:"qa"},{commandId:"sync-openapi",number:52,aliases:["openapi-sync","api-sync","spec-sync","regen-openapi"],retrievalProfile:"utility"},{commandId:"generate-pacts",number:53,aliases:["pacts","gen-pacts","regen-pacts","create-pacts"],retrievalProfile:"utility"},{commandId:"verify-pacts",number:54,aliases:["verify-pact","pact-verify","check-pacts","pact-check"],retrievalProfile:"utility"},{commandId:"property-test",number:55,aliases:["property","pbt","proptest","property-tests","invariant-test"],retrievalProfile:"qa"},{commandId:"chaos-plan",number:56,aliases:["chaos","gameday","resilience-test"],retrievalProfile:"utility"},{commandId:"ui-ux-review",number:57,aliases:["ux-review","design-review","visual-review","product-polish"],retrievalProfile:"utility"},{commandId:"solyd-system",number:58,aliases:["security-system","authorized-security","sec-system"],retrievalProfile:"security"},{commandId:"goal",number:59,aliases:["goals","durable-goal","continuity-goal"],retrievalProfile:"continuity"},{commandId:"loop",number:60,aliases:["loops","durable-loop","continuity-loop"],retrievalProfile:"continuity"},{commandId:"jobs",number:61,aliases:["job","continuity-jobs"],retrievalProfile:"continuity"},{commandId:"runner",number:62,aliases:["neocortex-runner","continuity-runner"],retrievalProfile:"continuity"},{commandId:"migrate-project-id",number:63,retrievalProfile:"recovery"}],g=[{commandId:"diagnose-inline",retrievalProfile:"diagnostic"},{commandId:"research-inline",retrievalProfile:"research"},{commandId:"yolo-inline",retrievalProfile:"story-execution"},{commandId:"goal-tick",retrievalProfile:"continuity"},{commandId:"loop-tick",retrievalProfile:"continuity"}],l=Object.freeze(C.map(u)),p=Object.freeze(g.map(u)),f=Object.freeze([...l,...p]),m=Object.freeze(Object.fromEntries(f.map(e=>[e.commandId,e]))),E=Object.freeze(Object.fromEntries(l.filter(e=>e.number!==void 0).map(e=>[e.number,e]))),_=Object.freeze(Object.fromEntries(l.flatMap(e=>e.aliases.map(a=>[y(a),e.commandId]))));function y(e){return e.trim().toLowerCase().replace(/^\*/,"")}function T(e){return e.trim().split(/\s+/,1)[0]??""}function R(){return l}function S(){return p}function A(){return f}function M(e){const a=T(e);if(!a)return m.menu??null;const t=y(a);return/^\d+$/.test(t)?E[Number.parseInt(t,10)]??null:m[t]??m[_[t]??""]??null}const b={CanonicalMemory:0,Guardrail:1,Debt:2,State:3,Story:4,Epic:5,Command:6,Doc:7,Package:8,Api:9,Route:10,DbSchema:11,Flag:12,BusinessRule:13,Risk:14,PlatformMemory:15};function d(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\.\//,"")}function I(e){return[e.nodeType,`${e.source.kind}:${d(e.source.path).toLowerCase()}`,e.stableId.toLowerCase()].join("|")}function x(e){return e.score??0}function h(e,a){const t=x(a)-x(e);if(t!==0)return t;const o=a.confidence-e.confidence;if(o!==0)return o;const s=e.budgetCost-a.budgetCost;if(s!==0)return s;const n=b[e.nodeType]-b[a.nodeType];if(n!==0)return n;const r=d(e.source.path).localeCompare(d(a.source.path),"en-US");return r!==0?r:e.stableId.localeCompare(a.stableId,"en-US")}function D(e){const a={...P,...e.budgets},t=new Map;for(const r of e.items){const c=t.get(I(r));(!c||h(r,c)<0)&&t.set(I(r),r)}const o=[],s=[];let n=0;for(const r of[...t.values()].sort(h)){const c=n+Math.max(1,r.budgetCost);if(o.length>=a.maxItems||c>a.maxTotalCost){s.push({stableId:r.stableId,source:r.source,reasonCode:"budget_exceeded"});continue}o.push(r),n=c}return{schemaVersion:1,retrievalId:e.retrievalId,query:e.query,budget:{...a,totalCost:n},items:o,skipped:s,warnings:e.warnings??[],generatedAt:e.generatedAt}}export{f as CLIENT_COMMAND_CONTEXT_POLICIES,_ as CLIENT_COMMAND_CONTEXT_POLICY_ALIAS_MAP,m as CLIENT_COMMAND_CONTEXT_POLICY_BY_ID,E as CLIENT_COMMAND_CONTEXT_POLICY_BY_NUMBER,v as CLIENT_GRAPH_RETRIEVAL_PROFILE_BUDGETS,p as CLIENT_INTERNAL_COMMAND_CONTEXT_POLICIES,l as CLIENT_PUBLIC_COMMAND_CONTEXT_POLICIES,N as COMMAND_CONTEXT_RETRIEVAL_PROFILES,P as DEFAULT_GRAPH_RETRIEVAL_BUDGETS,O as GRAPH_RETRIEVAL_CLIENT_CONTRACT_VERSION,L as GRAPH_RETRIEVAL_SCHEMA_VERSION,h as compareGraphRetrievalItems,D as createGraphRetrievalMetadata,A as listClientCommandContextPolicies,S as listClientInternalCommandContextPolicies,R as listClientPublicCommandContextPolicies,y as normalizeCommandToken,d as normalizeGraphRetrievalPath,M as resolveClientCommandContextPolicy};
@@ -53,6 +53,8 @@ export { OfflineTelemetryQueue, type TelemetryEvent, type QueueConfig, type Queu
53
53
  export { getCacheStatus, formatCacheStatus, type CacheStatusInfo, type CacheStatusOptions, } from './commands/cache-status.js';
54
54
  export { getSubagentApprovalPolicy, ensureManagedSubagentApprovalPolicy, setSubagentApprovalMode, resetSubagentApprovalMode, ApprovalPolicyConfigError, type ApprovalPolicyConfigOptions, type ApprovalPolicyConfigResult, } from './config.js';
55
55
  export { configCliHandler, type ConfigCliDependencies, } from './commands/config.js';
56
+ export { storyCheckpointCliHandler, parseStoryCheckpointArgs, } from './commands/story-checkpoint.js';
57
+ export { beginDirectYoloStoryCommit, finalizeDirectYoloStoryCheckpoint, issueDirectYoloSetupLeaseHandoff, recoverLegacyDirectYoloStoryCheckpoint, type DirectYoloCheckpointOptions, type DirectYoloCheckpointResult, type DirectYoloCommitPlan, type DirectYoloSetupHandoffReceipt, } from './git/direct-yolo-checkpoint.js';
56
58
  export { FRONTMATTER_DIAGNOSTIC_CATEGORIES, FRONTMATTER_DIAGNOSTIC_REASON_CODES, getFrontmatterDiagnostic, formatFrontmatterDiagnostic, type FrontmatterDiagnosticCategory, type FrontmatterDiagnosticReasonCode, type PublicFrontmatterDiagnostic, } from './errors/frontmatter-diagnostics.js';
57
59
  export { invoke, invokeCliHandler, collectStateSnapshot, type InvokeOptions, type InvokeResult, } from './commands/invoke.js';
58
60
  export { TierAwareClient, type TierAwareClientOptions, type PreFlightResult, type QuotaSnapshot, } from './tier/index.js';
@@ -1 +1 @@
1
- import{ResolverMode as o,NoOpCache as t}from"./types/index.js";import{LocalResolver as i}from"./resolvers/local-resolver.js";import{RemoteResolver as p,RemoteResolverError as l}from"./resolvers/remote-resolver.js";import{EncryptedCache as m}from"./cache/index.js";import{createResolver as d,selectResolver as f}from"./config/resolver-selection.js";import{collectContext as C}from"./context/context-collector.js";import{sanitizeValue as A,sanitizeRecord as R,sanitizeObject as v}from"./context/context-sanitizer.js";import{getMachineFingerprint as S}from"./machine/index.js";import{LicenseClient as y}from"./license/index.js";import{ClaudeCodeAdapter as E,CursorAdapter as O,VSCodeAdapter as D,GeminiAdapter as F,CodexAdapter as P,AntigravityAdapter as h,AdapterRegistry as I,UnknownTargetError as N,createDefaultRegistry as b,detectPlatform as j,isValidTargetId as _}from"./adapters/index.js";import{ClientCircuitBreaker as w,DegradationManager as G,DegradationLevel as z,FreshnessIndicator as L,RecoveryDetector as V}from"./resilience/index.js";import{OfflineTelemetryQueue as B}from"./telemetry/index.js";import{getCacheStatus as U,formatCacheStatus as q}from"./commands/cache-status.js";import{getSubagentApprovalPolicy as K,ensureManagedSubagentApprovalPolicy as W,setSubagentApprovalMode as X,resetSubagentApprovalMode as Y,ApprovalPolicyConfigError as Z}from"./config.js";import{configCliHandler as ee}from"./commands/config.js";import{FRONTMATTER_DIAGNOSTIC_CATEGORIES as oe,FRONTMATTER_DIAGNOSTIC_REASON_CODES as te,getFrontmatterDiagnostic as ae,formatFrontmatterDiagnostic as ie}from"./errors/frontmatter-diagnostics.js";import{invoke as pe,invokeCliHandler as le,collectStateSnapshot as ce}from"./commands/invoke.js";import{TierAwareClient as se}from"./tier/index.js";import{buildProjectMemoryContent as fe,createNodeProjectMemoryFs as ge,writeProjectMemory as Ce,writeProjectMemoryTargetFiles as xe}from"./memory/project-memory-writer.js";export{I as AdapterRegistry,h as AntigravityAdapter,Z as ApprovalPolicyConfigError,E as ClaudeCodeAdapter,w as ClientCircuitBreaker,P as CodexAdapter,O as CursorAdapter,z as DegradationLevel,G as DegradationManager,m as EncryptedCache,oe as FRONTMATTER_DIAGNOSTIC_CATEGORIES,te as FRONTMATTER_DIAGNOSTIC_REASON_CODES,L as FreshnessIndicator,F as GeminiAdapter,y as LicenseClient,i as LocalResolver,t as NoOpCache,B as OfflineTelemetryQueue,V as RecoveryDetector,p as RemoteResolver,l as RemoteResolverError,o as ResolverMode,se as TierAwareClient,N as UnknownTargetError,D as VSCodeAdapter,fe as buildProjectMemoryContent,C as collectContext,ce as collectStateSnapshot,ee as configCliHandler,b as createDefaultRegistry,ge as createNodeProjectMemoryFs,d as createResolver,j as detectPlatform,W as ensureManagedSubagentApprovalPolicy,q as formatCacheStatus,ie as formatFrontmatterDiagnostic,U as getCacheStatus,ae as getFrontmatterDiagnostic,S as getMachineFingerprint,K as getSubagentApprovalPolicy,pe as invoke,le as invokeCliHandler,_ as isValidTargetId,Y as resetSubagentApprovalMode,v as sanitizeObject,R as sanitizeRecord,A as sanitizeValue,f as selectResolver,X as setSubagentApprovalMode,Ce as writeProjectMemory,xe as writeProjectMemoryTargetFiles};
1
+ import{ResolverMode as o,NoOpCache as t}from"./types/index.js";import{LocalResolver as i}from"./resolvers/local-resolver.js";import{RemoteResolver as p,RemoteResolverError as l}from"./resolvers/remote-resolver.js";import{EncryptedCache as m}from"./cache/index.js";import{createResolver as f,selectResolver as d}from"./config/resolver-selection.js";import{collectContext as g}from"./context/context-collector.js";import{sanitizeValue as A,sanitizeRecord as y,sanitizeObject as S}from"./context/context-sanitizer.js";import{getMachineFingerprint as u}from"./machine/index.js";import{LicenseClient as T}from"./license/index.js";import{ClaudeCodeAdapter as M,CursorAdapter as h,VSCodeAdapter as E,GeminiAdapter as O,CodexAdapter as k,AntigravityAdapter as F,AdapterRegistry as P,UnknownTargetError as b,createDefaultRegistry as I,detectPlatform as N,isValidTargetId as j}from"./adapters/index.js";import{ClientCircuitBreaker as _,DegradationManager as w,DegradationLevel as z,FreshnessIndicator as G,RecoveryDetector as H}from"./resilience/index.js";import{OfflineTelemetryQueue as V}from"./telemetry/index.js";import{getCacheStatus as Q,formatCacheStatus as U}from"./commands/cache-status.js";import{getSubagentApprovalPolicy as J,ensureManagedSubagentApprovalPolicy as K,setSubagentApprovalMode as W,resetSubagentApprovalMode as X,ApprovalPolicyConfigError as Z}from"./config.js";import{configCliHandler as ee}from"./commands/config.js";import{storyCheckpointCliHandler as oe,parseStoryCheckpointArgs as te}from"./commands/story-checkpoint.js";import{beginDirectYoloStoryCommit as ie,finalizeDirectYoloStoryCheckpoint as ne,issueDirectYoloSetupLeaseHandoff as pe,recoverLegacyDirectYoloStoryCheckpoint as le}from"./git/direct-yolo-checkpoint.js";import{FRONTMATTER_DIAGNOSTIC_CATEGORIES as me,FRONTMATTER_DIAGNOSTIC_REASON_CODES as se,getFrontmatterDiagnostic as fe,formatFrontmatterDiagnostic as de}from"./errors/frontmatter-diagnostics.js";import{invoke as ge,invokeCliHandler as xe,collectStateSnapshot as Ae}from"./commands/invoke.js";import{TierAwareClient as Se}from"./tier/index.js";import{buildProjectMemoryContent as ue,createNodeProjectMemoryFs as ve,writeProjectMemory as Te,writeProjectMemoryTargetFiles as De}from"./memory/project-memory-writer.js";export{P as AdapterRegistry,F as AntigravityAdapter,Z as ApprovalPolicyConfigError,M as ClaudeCodeAdapter,_ as ClientCircuitBreaker,k as CodexAdapter,h as CursorAdapter,z as DegradationLevel,w as DegradationManager,m as EncryptedCache,me as FRONTMATTER_DIAGNOSTIC_CATEGORIES,se as FRONTMATTER_DIAGNOSTIC_REASON_CODES,G as FreshnessIndicator,O as GeminiAdapter,T as LicenseClient,i as LocalResolver,t as NoOpCache,V as OfflineTelemetryQueue,H as RecoveryDetector,p as RemoteResolver,l as RemoteResolverError,o as ResolverMode,Se as TierAwareClient,b as UnknownTargetError,E as VSCodeAdapter,ie as beginDirectYoloStoryCommit,ue as buildProjectMemoryContent,g as collectContext,Ae as collectStateSnapshot,ee as configCliHandler,I as createDefaultRegistry,ve as createNodeProjectMemoryFs,f as createResolver,N as detectPlatform,K as ensureManagedSubagentApprovalPolicy,ne as finalizeDirectYoloStoryCheckpoint,U as formatCacheStatus,de as formatFrontmatterDiagnostic,Q as getCacheStatus,fe as getFrontmatterDiagnostic,u as getMachineFingerprint,J as getSubagentApprovalPolicy,ge as invoke,xe as invokeCliHandler,j as isValidTargetId,pe as issueDirectYoloSetupLeaseHandoff,te as parseStoryCheckpointArgs,le as recoverLegacyDirectYoloStoryCheckpoint,X as resetSubagentApprovalMode,S as sanitizeObject,y as sanitizeRecord,A as sanitizeValue,d as selectResolver,W as setSubagentApprovalMode,oe as storyCheckpointCliHandler,Te as writeProjectMemory,De as writeProjectMemoryTargetFiles};
@@ -5,7 +5,7 @@
5
5
  * at runtime. Keep this file in sync with `packages/shared/src/project-memory-*`
6
6
  * and enforce drift through the P130.06 release tests.
7
7
  */
8
- export type ProjectMemoryTargetId = 'canonical' | 'claude-code' | 'codex' | 'gemini-cli' | 'antigravity' | 'vscode' | 'cursor' | 'opencode' | 'openclaw' | 'kimi' | 'github-copilot-cli';
8
+ export type ProjectMemoryTargetId = 'canonical' | 'claude-code' | 'codex' | 'grok' | 'gemini-cli' | 'antigravity' | 'vscode' | 'cursor' | 'opencode' | 'openclaw' | 'kimi' | 'github-copilot-cli';
9
9
  export type ProjectMemoryTemplateKind = 'neocortex-md' | 'claude-md' | 'agents-md' | 'gemini-md' | 'copilot-instructions' | 'cursor-rule';
10
10
  export interface ProjectMemoryBudget {
11
11
  readonly maxLines: number;
@@ -64,7 +64,7 @@ export interface BootstrapArchitectureMemory {
64
64
  readonly heuristics?: readonly string[];
65
65
  }
66
66
  export declare const CANONICAL_PROJECT_MEMORY_SOURCE: "NEOCORTEX.md";
67
- export declare const PROJECT_MEMORY_TARGET_IDS: readonly ["claude-code", "codex", "gemini-cli", "antigravity", "vscode", "cursor", "opencode", "openclaw", "kimi", "github-copilot-cli"];
67
+ export declare const PROJECT_MEMORY_TARGET_IDS: readonly ["claude-code", "codex", "grok", "gemini-cli", "antigravity", "vscode", "cursor", "opencode", "openclaw", "kimi", "github-copilot-cli"];
68
68
  export declare const PROJECT_MEMORY_TARGETS: {
69
69
  readonly canonical: {
70
70
  readonly targetId: "canonical";
@@ -147,6 +147,33 @@ export declare const PROJECT_MEMORY_TARGETS: {
147
147
  readonly requiresWrapperPreservation: true;
148
148
  readonly notes: "Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems.";
149
149
  };
150
+ readonly grok: {
151
+ readonly targetId: "grok";
152
+ readonly platformName: "Grok Build";
153
+ readonly canonicalSource: "NEOCORTEX.md";
154
+ readonly primaryFile: "AGENTS.md";
155
+ readonly secondaryFiles: readonly [".grok/skills/neocortex/SKILL.md"];
156
+ readonly ownedBlockName: "NEOCORTEX-MEMORY";
157
+ readonly templateKind: "agents-md";
158
+ readonly budget: {
159
+ readonly maxLines: 220;
160
+ readonly maxBytes: 18000;
161
+ };
162
+ readonly linkRequirement: {
163
+ readonly canonicalSource: "NEOCORTEX.md";
164
+ readonly semanticFileRequired: true;
165
+ readonly symlinkBacked: true;
166
+ readonly wrapperAllowed: false;
167
+ readonly includeFallbackAllowed: false;
168
+ readonly requiresWrapperPreservation: false;
169
+ readonly fallbackIsCompatibilityRemediation: true;
170
+ readonly policy: "mandatory-semantic-symlink";
171
+ readonly notes: "Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter.";
172
+ };
173
+ readonly bidirectionalReference: ProjectMemoryBidirectionalReference;
174
+ readonly requiresWrapperPreservation: true;
175
+ readonly notes: "Grok Build reads AGENTS.md and the project-local Neocortex Skill; both resolve to canonical NEOCORTEX.md context.";
176
+ };
150
177
  readonly 'gemini-cli': {
151
178
  readonly targetId: "gemini-cli";
152
179
  readonly platformName: "Gemini CLI";
@@ -1,2 +1,2 @@
1
- const e="NEOCORTEX.md",r={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!1,includeFallbackAllowed:!1,requiresWrapperPreservation:!1,fallbackIsCompatibilityRemediation:!0,policy:"mandatory-semantic-symlink",notes:"Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter."},c={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!1,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"symlink-backed-wrapper",notes:"Platform wrapper/frontmatter is allowed only when the semantic memory payload remains symlink-backed by NEOCORTEX.md."},a={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!0,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"safe-include-fallback",notes:"Use a safe include/import only for platforms that cannot consume symlinks directly; the include must resolve back to NEOCORTEX.md."};function t(o){return{canonicalSource:e,resolvesVia:o.policy,feedbackTrigger:"*update-memory",guidance:"Treat NEOCORTEX.md as canonical project memory; consult it before platform-specific memory, and run *update-memory when durable project context changes should flow back to the canonical source."}}const l=["claude-code","codex","gemini-cli","antigravity","vscode","cursor","opencode","openclaw","kimi","github-copilot-cli"],s={canonical:{targetId:"canonical",platformName:"Neocortex Canonical Memory",canonicalSource:e,primaryFile:e,secondaryFiles:["AGENTS.md","CLAUDE.md","GEMINI.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"neocortex-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Canonical compact project memory source for platform symlinks and wrappers. Store only summaries, indexes, and links to architecture docs here."},"claude-code":{targetId:"claude-code",platformName:"Claude Code",canonicalSource:e,primaryFile:"CLAUDE.md",secondaryFiles:[".claude/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"claude-md",budget:{maxLines:320,maxBytes:28e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Claude Code project memory. Resolve to NEOCORTEX.md; keep root content concise and link deeper docs with @path references."},codex:{targetId:"codex",platformName:"Codex CLI",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:[".codex/agents/neocortex.toml"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems."},"gemini-cli":{targetId:"gemini-cli",platformName:"Gemini CLI",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Gemini CLI context file. Prefer shallow @file.md imports for detailed architecture docs."},antigravity:{targetId:"antigravity",platformName:"Antigravity",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Antigravity currently shares GEMINI.md behavior with the Gemini target stubs."},vscode:{targetId:"vscode",platformName:"VS Code / GitHub Copilot",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:[".github/instructions/neocortex.instructions.md",".github/agents/neocortex.agent.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),requiresWrapperPreservation:!0,notes:"VS Code and GitHub Copilot always-on repository instructions."},cursor:{targetId:"cursor",platformName:"Cursor",canonicalSource:e,primaryFile:".cursor/rules/neocortex.mdc",secondaryFiles:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"cursor-rule",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),requiresWrapperPreservation:!0,notes:"Cursor rule memory. Use AGENTS.md as compatibility fallback when Cursor rules are absent."},opencode:{targetId:"opencode",platformName:"OpenCode",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:[".opencode/AGENTS.md",".opencode/agents/neocortex-root.md",".opencode/agents/neocortex.md",".agent/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"OpenCode agent memory. It consumes AGENTS.md-compatible instructions and must resolve to canonical NEOCORTEX.md."},openclaw:{targetId:"openclaw",platformName:"OpenClaw",canonicalSource:e,primaryFile:".openclaw/skills/neocortex/SKILL.md",secondaryFiles:["~/.openclaw/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"OpenClaw Skill thin-client memory entrypoint. Use the project Skill path when --create-project is requested; do not mutate ~/.openclaw/openclaw.json, and keep memory content public-safe."},kimi:{targetId:"kimi",platformName:"Kimi",canonicalSource:e,primaryFile:"KIMI.md",secondaryFiles:["AGENTS.md",".kimi/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"Kimi memory entrypoint. Prefer a symlink to NEOCORTEX.md; use a compact include only if the host cannot follow symlinks."},"github-copilot-cli":{targetId:"github-copilot-cli",platformName:"GitHub Copilot CLI / gh alias",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies."}};function d(o){return s[o]}function p(o){return o==="canonical"||l.includes(o)}function u(){return l.map(o=>s[o])}function y(o){const n=i=>i.replace(/\|/g,"\\|").replace(/\n/g," ");return["| Path | Title | Purpose | Suggested Usage |","| --- | --- | --- | --- |",...o.map(i=>`| ${n(i.path)} | ${n(i.title)} | ${n(i.purpose)} | ${n(i.suggestedUsage)} |`)].join(`
2
- `)}export{e as CANONICAL_PROJECT_MEMORY_SOURCE,s as PROJECT_MEMORY_TARGETS,l as PROJECT_MEMORY_TARGET_IDS,d as getProjectMemoryTarget,p as isProjectMemoryTargetId,u as listProjectMemoryTargets,y as renderArchitectureReferenceTable};
1
+ const e="NEOCORTEX.md",r={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!1,includeFallbackAllowed:!1,requiresWrapperPreservation:!1,fallbackIsCompatibilityRemediation:!0,policy:"mandatory-semantic-symlink",notes:"Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter."},c={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!1,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"symlink-backed-wrapper",notes:"Platform wrapper/frontmatter is allowed only when the semantic memory payload remains symlink-backed by NEOCORTEX.md."},a={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!0,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"safe-include-fallback",notes:"Use a safe include/import only for platforms that cannot consume symlinks directly; the include must resolve back to NEOCORTEX.md."};function t(o){return{canonicalSource:e,resolvesVia:o.policy,feedbackTrigger:"*update-memory",guidance:"Treat NEOCORTEX.md as canonical project memory; consult it before platform-specific memory, and run *update-memory when durable project context changes should flow back to the canonical source."}}const l=["claude-code","codex","grok","gemini-cli","antigravity","vscode","cursor","opencode","openclaw","kimi","github-copilot-cli"],s={canonical:{targetId:"canonical",platformName:"Neocortex Canonical Memory",canonicalSource:e,primaryFile:e,secondaryFiles:["AGENTS.md","CLAUDE.md","GEMINI.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"neocortex-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Canonical compact project memory source for platform symlinks and wrappers. Store only summaries, indexes, and links to architecture docs here."},"claude-code":{targetId:"claude-code",platformName:"Claude Code",canonicalSource:e,primaryFile:"CLAUDE.md",secondaryFiles:[".claude/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"claude-md",budget:{maxLines:320,maxBytes:28e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Claude Code project memory. Resolve to NEOCORTEX.md; keep root content concise and link deeper docs with @path references."},codex:{targetId:"codex",platformName:"Codex CLI",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:[".codex/agents/neocortex.toml"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems."},grok:{targetId:"grok",platformName:"Grok Build",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:[".grok/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"Grok Build reads AGENTS.md and the project-local Neocortex Skill; both resolve to canonical NEOCORTEX.md context."},"gemini-cli":{targetId:"gemini-cli",platformName:"Gemini CLI",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Gemini CLI context file. Prefer shallow @file.md imports for detailed architecture docs."},antigravity:{targetId:"antigravity",platformName:"Antigravity",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!1,notes:"Antigravity currently shares GEMINI.md behavior with the Gemini target stubs."},vscode:{targetId:"vscode",platformName:"VS Code / GitHub Copilot",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:[".github/instructions/neocortex.instructions.md",".github/agents/neocortex.agent.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),requiresWrapperPreservation:!0,notes:"VS Code and GitHub Copilot always-on repository instructions."},cursor:{targetId:"cursor",platformName:"Cursor",canonicalSource:e,primaryFile:".cursor/rules/neocortex.mdc",secondaryFiles:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"cursor-rule",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),requiresWrapperPreservation:!0,notes:"Cursor rule memory. Use AGENTS.md as compatibility fallback when Cursor rules are absent."},opencode:{targetId:"opencode",platformName:"OpenCode",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:[".opencode/AGENTS.md",".opencode/agents/neocortex-root.md",".opencode/agents/neocortex.md",".agent/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"OpenCode agent memory. It consumes AGENTS.md-compatible instructions and must resolve to canonical NEOCORTEX.md."},openclaw:{targetId:"openclaw",platformName:"OpenClaw",canonicalSource:e,primaryFile:".openclaw/skills/neocortex/SKILL.md",secondaryFiles:["~/.openclaw/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"OpenClaw Skill thin-client memory entrypoint. Use the project Skill path when --create-project is requested; do not mutate ~/.openclaw/openclaw.json, and keep memory content public-safe."},kimi:{targetId:"kimi",platformName:"Kimi",canonicalSource:e,primaryFile:"KIMI.md",secondaryFiles:["AGENTS.md",".kimi/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"Kimi memory entrypoint. Prefer a symlink to NEOCORTEX.md; use a compact include only if the host cannot follow symlinks."},"github-copilot-cli":{targetId:"github-copilot-cli",platformName:"GitHub Copilot CLI / gh alias",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies."}};function d(o){return s[o]}function u(o){return o==="canonical"||l.includes(o)}function p(){return l.map(o=>s[o])}function y(o){const n=i=>i.replace(/\|/g,"\\|").replace(/\n/g," ");return["| Path | Title | Purpose | Suggested Usage |","| --- | --- | --- | --- |",...o.map(i=>`| ${n(i.path)} | ${n(i.title)} | ${n(i.purpose)} | ${n(i.suggestedUsage)} |`)].join(`
2
+ `)}export{e as CANONICAL_PROJECT_MEMORY_SOURCE,s as PROJECT_MEMORY_TARGETS,l as PROJECT_MEMORY_TARGET_IDS,d as getProjectMemoryTarget,u as isProjectMemoryTargetId,p as listProjectMemoryTargets,y as renderArchitectureReferenceTable};
@@ -1 +1 @@
1
- const u=1,p="max",s="[P201-EV-MAX-POLICY]",c=new Set(["claude-code","cursor","vscode","gemini","codex","opencode","github-copilot-cli","kimi","antigravity","openclaw","runner","unknown"]),r=e=>c.has(e)?e:"unknown",d=Object.freeze({"claude-code":{status:"validated",scope:"child",fallbackMode:"none",fallbackReasonCode:null},opencode:{status:"unvalidated",scope:"child",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},codex:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},gemini:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},vscode:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},"github-copilot-cli":{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},kimi:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},cursor:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},antigravity:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},openclaw:{status:"unsupported",scope:"none",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unsupported"},runner:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unsupported"},unknown:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-target-unknown"}}),n=Object.freeze({disabled:0,standard:1,max:2});function f(e){return e==="max"||e==="standard"||e==="disabled"}function i(e){const a=r(e),o=d[a];return a==="unknown"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"platform-target-unknown"}):o.status==="unsupported"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"host-capability-unsupported"}):o.status==="unvalidated"?Object.freeze({platformTarget:a,maximumMode:"standard",scope:o.scope,reductionReason:"host-capability-unvalidated"}):Object.freeze({platformTarget:a,maximumMode:"max",scope:o.scope,reductionReason:"host-policy-reduced"})}function b(e={}){const a=e.userOverride??"max",o=e.hostPolicy??i(e.platformTarget),t=d[o.platformTarget],l=n[a]>n[o.maximumMode];return Object.freeze({schemaVersion:1,requestedMode:a,effectiveMode:l?o.maximumMode:a,source:e.userOverride?"user-override":"managed-default",platformTarget:o.platformTarget,scope:o.scope,effectiveReason:l?o.reductionReason:"requested-mode-honored",fallbackMode:t.fallbackMode,fallbackReasonCode:t.fallbackReasonCode})}function m(e,a,o){return Object.freeze({evidence:s,event:e,occurredAt:o,...a})}export{s as SUBAGENT_APPROVAL_EVIDENCE,p as SUBAGENT_APPROVAL_MANAGED_DEFAULT,u as SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION,m as createSubagentApprovalAuditEvent,i as deriveSubagentHostApprovalPolicy,f as isSubagentApprovalMode,b as resolveSubagentApprovalPolicy};
1
+ const u=1,p="max",s="[P201-EV-MAX-POLICY]",c=new Set(["claude-code","cursor","vscode","gemini","codex","opencode","github-copilot-cli","kimi","antigravity","openclaw","grok","runner","unknown"]),r=e=>c.has(e)?e:"unknown",d=Object.freeze({"claude-code":{status:"validated",scope:"child",fallbackMode:"none",fallbackReasonCode:null},opencode:{status:"unvalidated",scope:"child",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},codex:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},gemini:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},vscode:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},"github-copilot-cli":{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},kimi:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},cursor:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},antigravity:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},grok:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},openclaw:{status:"unsupported",scope:"none",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unsupported"},runner:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unsupported"},unknown:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-target-unknown"}}),n=Object.freeze({disabled:0,standard:1,max:2});function f(e){return e==="max"||e==="standard"||e==="disabled"}function i(e){const a=r(e),o=d[a];return a==="unknown"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"platform-target-unknown"}):o.status==="unsupported"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"host-capability-unsupported"}):o.status==="unvalidated"?Object.freeze({platformTarget:a,maximumMode:"standard",scope:o.scope,reductionReason:"host-capability-unvalidated"}):Object.freeze({platformTarget:a,maximumMode:"max",scope:o.scope,reductionReason:"host-policy-reduced"})}function b(e={}){const a=e.userOverride??"max",o=e.hostPolicy??i(e.platformTarget),t=d[o.platformTarget],l=n[a]>n[o.maximumMode];return Object.freeze({schemaVersion:1,requestedMode:a,effectiveMode:l?o.maximumMode:a,source:e.userOverride?"user-override":"managed-default",platformTarget:o.platformTarget,scope:o.scope,effectiveReason:l?o.reductionReason:"requested-mode-honored",fallbackMode:t.fallbackMode,fallbackReasonCode:t.fallbackReasonCode})}function m(e,a,o){return Object.freeze({evidence:s,event:e,occurredAt:o,...a})}export{s as SUBAGENT_APPROVAL_EVIDENCE,p as SUBAGENT_APPROVAL_MANAGED_DEFAULT,u as SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION,m as createSubagentApprovalAuditEvent,i as deriveSubagentHostApprovalPolicy,f as isSubagentApprovalMode,b as resolveSubagentApprovalPolicy};
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Branchless preparation sandboxes for continuous yoloop children.
3
+ *
4
+ * A child receives an independent Git index at a detached HEAD, but no branch
5
+ * and no Git worktree are created. Only the root applies the validated result
6
+ * and creates the single logical story commit on the epic branch.
7
+ */
8
+ import type { StoryCommitCheckpoint } from '../../../../shared/dist/yoloop/branch-unit.js';
9
+ import type { YoloopPreparationBundleAdmission } from '../../../../shared/dist/yoloop/execution-plan.js';
10
+ import { type AnchoredDirectoryIdentity } from '../../git/secure-filesystem-boundary.js';
11
+ import type { HeadlessCommandRunner } from './types.js';
12
+ export interface ContinuousStoryWorkspaceRequest {
13
+ readonly projectRoot: string;
14
+ readonly epicId: string;
15
+ readonly storyId: string;
16
+ readonly targetRef: string;
17
+ readonly dispatchId: string;
18
+ readonly executionBranch: string;
19
+ readonly graphRevision: string;
20
+ readonly authorizedWriteSet: readonly string[];
21
+ }
22
+ interface ContinuousContextSnapshot {
23
+ readonly path: string;
24
+ readonly content?: Buffer;
25
+ }
26
+ export interface ContinuousStoryWorkspaceLease {
27
+ readonly projectRoot: string;
28
+ readonly workspacePath: string;
29
+ readonly workspaceStrategy: 'branchless_sandbox';
30
+ readonly storyId: string;
31
+ readonly targetRef: string;
32
+ readonly epicId: string;
33
+ readonly executionBranch: string;
34
+ readonly graphRevision: string;
35
+ /** Root-observed graph authority snapshot; distinct from the server epoch id. */
36
+ readonly graphAuthorityRevision: string;
37
+ /** Physical epic epoch observed with the authority snapshot. */
38
+ readonly graphAuthorityEpoch: string | null;
39
+ /** Effective target-story status observed with the authority snapshot. */
40
+ readonly graphAuthorityStoryStatus: string | null;
41
+ readonly authorizedWriteSet: readonly string[];
42
+ readonly claimRevision: string;
43
+ readonly baseSha: string;
44
+ readonly preparedAt: string;
45
+ readonly dispatchId: string;
46
+ readonly leasePath: string;
47
+ readonly leaseOwnerNonce: string;
48
+ readonly workspaceOwnerNonce: string;
49
+ readonly workspaceIdentity: AnchoredDirectoryIdentity;
50
+ readonly contextSnapshots: readonly ContinuousContextSnapshot[];
51
+ }
52
+ export type ContinuousStoryWorkspaceResult<T> = {
53
+ readonly ok: true;
54
+ readonly value: T;
55
+ } | {
56
+ readonly ok: false;
57
+ readonly reasonCode: string;
58
+ };
59
+ export interface ContinuousStoryWorkspaceManager {
60
+ prepare(input: ContinuousStoryWorkspaceRequest): Promise<ContinuousStoryWorkspaceResult<ContinuousStoryWorkspaceLease>>;
61
+ integrate(lease: ContinuousStoryWorkspaceLease, authority?: {
62
+ readonly receiptRefs?: readonly string[];
63
+ readonly nowIso?: string;
64
+ }): Promise<ContinuousStoryWorkspaceResult<{
65
+ readonly headSha: string;
66
+ readonly alreadyIntegrated: boolean;
67
+ readonly bundle: YoloopPreparationBundleAdmission;
68
+ readonly checkpoint: StoryCommitCheckpoint;
69
+ }>>;
70
+ release(lease: ContinuousStoryWorkspaceLease, preserveForRecovery: boolean): Promise<void>;
71
+ }
72
+ export interface ContinuousStoryWorkspaceManagerOptions {
73
+ /** Test-only platform seam; production always uses process.platform. */
74
+ readonly platform?: NodeJS.Platform;
75
+ /** Test observer after canonical P205; its return value never authorizes QA. */
76
+ readonly storyQaRunner?: (input: {
77
+ readonly projectRoot: string;
78
+ readonly storyId: string;
79
+ readonly headSha: string;
80
+ }) => Promise<unknown>;
81
+ /** Deterministic adversarial seam used only to prove QA-to-checkpoint races. */
82
+ readonly beforeCheckpointPersist?: (input: {
83
+ readonly projectRoot: string;
84
+ readonly storyId: string;
85
+ readonly headSha: string;
86
+ }) => Promise<void>;
87
+ /** Fault seam at the exact commit-return -> checkpoint-authority boundary. */
88
+ readonly afterRootCommit?: (input: {
89
+ readonly projectRoot: string;
90
+ readonly storyId: string;
91
+ readonly headSha: string;
92
+ }) => Promise<void>;
93
+ /** Test-only clock proving that lease expiry is checked again inside checkpoint CAS. */
94
+ readonly checkpointNow?: (phase: 'before-mutation' | 'pre-commit') => number;
95
+ /** Fault seam inside the serialized checkpoint preCommit, before its final authority read. */
96
+ readonly insideCheckpointPreCommit?: (input: {
97
+ readonly projectRoot: string;
98
+ readonly storyId: string;
99
+ readonly headSha: string;
100
+ }) => Promise<void>;
101
+ /** Fault seam after durable checkpoint persistence and before post-persist verification/cleanup. */
102
+ readonly afterCheckpointPersist?: (input: {
103
+ readonly projectRoot: string;
104
+ readonly storyId: string;
105
+ readonly headSha: string;
106
+ }) => Promise<void>;
107
+ /** Adversarial seam after writer acquisition and before the serialized root Git guard. */
108
+ readonly beforeRootCommit?: (input: {
109
+ readonly projectRoot: string;
110
+ readonly storyId: string;
111
+ readonly headSha: string;
112
+ }) => Promise<void>;
113
+ /** Deterministic adversarial seam immediately before a sandbox write commit. */
114
+ readonly beforeSandboxWriteCommit?: (input: {
115
+ readonly boundaryRoot: string;
116
+ readonly relativePath: string;
117
+ readonly destinationPath: string;
118
+ }) => Promise<void>;
119
+ }
120
+ /**
121
+ * Create the only command runner authorized for a continuous child. The helper
122
+ * owns and revalidates the sandbox cwd before launching the runtime, so the
123
+ * mutable public pathname is never reused as the runtime's cwd.
124
+ */
125
+ export declare function createAnchoredContinuousStoryCommandRunner(lease: Pick<ContinuousStoryWorkspaceLease, 'workspacePath' | 'workspaceIdentity'>, hooks?: {
126
+ readonly beforeHandoff?: () => Promise<void> | void;
127
+ readonly afterHandoff?: () => Promise<void> | void;
128
+ }): HeadlessCommandRunner;
129
+ /** Default continuous-DAG workspace policy. It never creates a Git worktree. */
130
+ export declare function createBranchlessContinuousStoryWorkspaceManager(options?: ContinuousStoryWorkspaceManagerOptions): ContinuousStoryWorkspaceManager;
131
+ export {};