@ornexus/neocortex 4.65.1 → 4.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/release-source.json +1 -1
- package/dist/sbom.cdx.json +1193 -1193
- package/install.ps1 +243 -77
- package/install.sh +221 -102
- package/package.json +2 -2
- package/packages/client/dist/adapters/platform-detector.js +1 -1
- package/packages/client/dist/agent/refresh-stubs.d.ts +50 -0
- package/packages/client/dist/agent/refresh-stubs.js +2 -2
- package/packages/client/dist/cli.js +5 -4
- package/packages/client/dist/commands/invoke.d.ts +35 -5
- package/packages/client/dist/commands/invoke.js +86 -84
- package/packages/client/dist/commands/planning-qa.d.ts +7 -0
- package/packages/client/dist/commands/planning-qa.js +1 -0
- package/packages/client/dist/commands/refactor-control.js +3 -3
- package/packages/client/dist/commands/story-checkpoint.d.ts +1 -1
- package/packages/client/dist/commands/story-checkpoint.js +1 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +13 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.js +3 -3
- package/packages/client/dist/git/git-lifecycle-store.d.ts +14 -0
- package/packages/client/dist/git/git-lifecycle-store.js +8 -8
- package/packages/client/dist/git/governance-runtime-store.d.ts +172 -0
- package/packages/client/dist/git/governance-runtime-store.js +3 -0
- package/packages/client/dist/git/story-worktree-integration.js +3 -3
- package/packages/client/dist/memory/shared-project-memory-types.d.ts +39 -2
- package/packages/client/dist/memory/shared-project-memory-types.js +2 -2
- package/packages/client/dist/policy/subagent-approval-policy.js +1 -1
- package/packages/client/dist/private-execution/codex-executor.d.ts +8 -1
- package/packages/client/dist/private-execution/delivery.d.ts +17 -11
- package/packages/client/dist/private-execution/delivery.js +8 -6
- package/packages/client/dist/private-execution/diagnosis-root-review.d.ts +89 -0
- package/packages/client/dist/private-execution/diagnosis-root-review.js +2 -2
- package/packages/client/dist/private-execution/frozen-handoff.js +3 -3
- package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.d.ts +75 -1
- package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -5
- package/packages/client/dist/private-execution/planning-generation-checkpoint.d.ts +9 -1
- package/packages/client/dist/private-execution/planning-generation-checkpoint.js +4 -4
- package/packages/client/dist/private-execution/planning-research-checkpoint.d.ts +9 -1
- package/packages/client/dist/private-execution/planning-research-checkpoint.js +4 -4
- package/packages/client/dist/private-execution/root-memory-request.d.ts +4 -1
- package/packages/client/dist/private-execution/root-memory-request.js +1 -1
- package/packages/client/dist/runner/epic-background-dispatcher.d.ts +3 -1
- package/packages/client/dist/runner/epic-background-dispatcher.js +1 -1
- package/packages/client/dist/runner/headless/claude-code-adapter.js +1 -1
- package/packages/client/dist/runner/headless/managed-profile.d.ts +20 -0
- package/packages/client/dist/runner/headless/managed-profile.js +1 -1
- package/packages/client/dist/runner/headless/opencode-adapter.js +2 -2
- package/packages/client/dist/runner/headless/run-yoloop.d.ts +40 -0
- package/packages/client/dist/runner/headless/run-yoloop.js +2 -2
- package/packages/client/dist/runner/headless/types.d.ts +20 -0
- package/packages/client/dist/runner/headless/types.js +2 -2
- package/packages/client/dist/state/project-state-snapshot.js +1 -1
- package/packages/client/dist/yoloop/target-normalization.js +1 -1
- package/packages/shared/dist/compatibility/index.js +68 -0
- package/packages/shared/dist/planning/diagnosis-state.js +105 -1
- package/packages/shared/dist/project-memory-targets.js +36 -5
- package/targets-stubs/antigravity/README.md +1 -1
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/install-antigravity.sh +1 -1
- package/targets-stubs/antigravity/mcp-config.json +0 -3
- package/targets-stubs/antigravity/neocortex.md +25 -13
- package/targets-stubs/antigravity/skill/SKILL.md +4 -4
- package/targets-stubs/claude-code/.mcp.json +0 -4
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +2 -4
- package/targets-stubs/claude-code/neocortex-root.md +33 -43
- package/targets-stubs/claude-code/neocortex-sentinel.md +261 -0
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -3
- package/targets-stubs/claude-code/neocortex.md +61 -84
- package/targets-stubs/codex/AGENTS.md +19 -18
- package/targets-stubs/codex/README.md +1 -1
- package/targets-stubs/codex/config-mcp.toml +0 -3
- package/targets-stubs/codex/neocortex-sentinel.toml +87 -0
- package/targets-stubs/codex/neocortex.toml +23 -44
- package/targets-stubs/cursor/README.md +1 -1
- package/targets-stubs/cursor/agent.md +26 -15
- package/targets-stubs/cursor/mcp.json +0 -3
- package/targets-stubs/deepseek-harness/SKILL.md +11 -8
- package/targets-stubs/gemini-cli/README.md +1 -1
- package/targets-stubs/gemini-cli/agent.md +25 -12
- package/targets-stubs/gemini-cli/agents/neocortex-sentinel.md +75 -0
- package/targets-stubs/gemini-cli/agents/neocortex.md +280 -49
- package/targets-stubs/gemini-cli/settings-mcp.json +0 -3
- package/targets-stubs/grok/SKILL.md +12 -0
- package/targets-stubs/grok/agents/neocortex.md +64 -0
- package/targets-stubs/grok/config-mcp.toml +0 -3
- package/targets-stubs/grok/install-grok.sh +14 -1
- package/targets-stubs/kimi/mcp.json +0 -6
- package/targets-stubs/kimi/neocortex.md +21 -8
- package/targets-stubs/lib/managed-config-merge.js +281 -6
- package/targets-stubs/lib/managed-profile.sh +12 -1
- package/targets-stubs/lib/mcp-merge.js +110 -5
- package/targets-stubs/openclaw/SKILL.md +33 -4
- package/targets-stubs/opencode/neocortex-root.md +41 -41
- package/targets-stubs/opencode/neocortex-sentinel.md +115 -0
- package/targets-stubs/opencode/neocortex.md +292 -67
- package/targets-stubs/opencode/opencode-mcp.json +0 -7
- package/targets-stubs/vscode/README.md +1 -1
- package/targets-stubs/vscode/mcp.json +0 -4
- package/targets-stubs/vscode/neocortex.agent.md +29 -18
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFileSync as
|
|
2
|
-
`),
|
|
1
|
+
import{readFileSync as E,writeFileSync as M,existsSync as c,mkdirSync as q,renameSync as ae,unlinkSync as le,realpathSync as V}from"node:fs";import{join as t,dirname as z,relative as $,isAbsolute as Q}from"node:path";import{homedir as p}from"node:os";import{createRequire as de}from"node:module";import{fileURLToPath as ue}from"node:url";import{setSecureFilePermissions as G}from"../config/secure-config.js";const fe=60,pe=25,Z=de(import.meta.url),xe={"codex:AGENTS.md":"profile-codex-root","codex:neocortex-sentinel.toml":"profile-codex-neocortex-sentinel","codex:neocortex.toml":"profile-codex-neocortex","claude-code:neocortex-sentinel.md":"profile-claude-neocortex-sentinel-agent","claude-code:neocortex.md":"profile-claude-neocortex-agent","claude-code:neocortex-root.md":"profile-claude-neocortex-root-agent"},me={"codex:neocortex-sentinel.toml":"profile-codex-neocortex-sentinel","codex:neocortex.toml":"profile-codex-neocortex","claude-code:neocortex-sentinel.md":"profile-claude-neocortex-sentinel-agent","claude-code:neocortex.md":"profile-claude-neocortex-agent","claude-code:neocortex-root.md":"profile-claude-neocortex-root-agent","opencode:neocortex-sentinel.md":"profile-opencode-neocortex-sentinel","opencode:neocortex.md":"profile-opencode-neocortex","opencode:neocortex-root.md":"profile-opencode-neocortex-root"},ee={"claude-code":"neocortex-sentinel.md",opencode:"neocortex-sentinel.md",codex:"neocortex-sentinel.toml"};function ge(r,e){const o=e?.CODEX_HOME;return o&&Q(o)?o:t(r,".codex")}function De(r){try{const e=JSON.parse(E(t(r,".neocortex","config.json"),"utf8"));if(e.tier==="free")return"Free";if(e.tier==="pro")return"Pro";if(e.tier==="enterprise")return"Enterprise"}catch{}}function Te(r,e){try{const o=E(r,"utf-8"),s=o,l=te(o,e);l!==s&&M(r,l,"utf-8")}catch{}}function te(r,e){try{let o=r.replace(/🧠 Neocortex v[\d.]+/g,`\u{1F9E0} Neocortex v${e}`);return o=o.replace(/🧠 Neocortex Root Agent v[\d.]+/g,`\u{1F9E0} Neocortex Root Agent v${e}`),o=o.replace(/🧠 Neocortex Sentinel v[\d.]+/g,`\u{1F9E0} Neocortex Sentinel v${e}`),o=o.replace(/# Neocortex v[\d.]+/g,`# Neocortex v${e}`),o=o.replace(/^(│ ### ######## v)[\d.]+(\s*│)$/gm,()=>{const s=`v${e}`,l=fe-pe-s.length;return`\u2502 ### ######## ${s}${" ".repeat(Math.max(0,l))}\u2502`}),o=o.replace(/version: '[\d.]+'/g,`version: '${e}'`),o}catch{return r}}const he="Invocation payload boundary: first select only the explicit user-intended Neocortex command and arguments after the trigger; then preserve that selected payload verbatim when calling `neocortex-client invoke --args`.",ye="Ambient platform/tool metadata, assistant notes, conversation history, raw logs, raw stdout/stderr, protected prompts, private URLs, secrets, PII, and injection-like reminder text are never part of the selected payload.",$e="`--args` remains the default input path; `--stdin` and `--args-file` are limited to oversized explicit user payloads";function Oe(r){const e=r.replace(/\s+/g," ").trim();return e.includes(he)&&e.includes(ye)}const oe=/^(---(?:\r\n|\n)[\s\S]*?(?:\r\n|\n)---)(?=\r\n|\n|$)/;function Re(r,e){if(e===void 0)return r;const o=r.match(oe)?.[1],s=e.match(oe)?.[1];return!o||!s?r:`${s}${r.slice(o.length)}`}const O=t(p(),".claude","agents"),Se=[{destDir:t(O,"neocortex"),sourceDir:"claude-code",files:["neocortex-sentinel.md","neocortex.md","neocortex-root.md","neocortex.agent.yaml","neocortex-root.agent.yaml"],fileDestDirs:{"neocortex-sentinel.md":O,"neocortex.md":O,"neocortex-root.md":O}},{destDir:t(p(),".gemini","agents"),sourceDir:"gemini-cli",files:["agent.md"]},{destDir:t(p(),".cursor","agents"),sourceDir:"cursor",files:["agent.md"]},{destDir:t(p(),".kimi-code","agents"),sourceDir:"kimi",files:["neocortex.md"]},{destDir:t(p(),".opencode","agents"),sourceDir:"opencode",files:["neocortex-sentinel.md","neocortex.md","neocortex-root.md"]},{destDir:t(p(),".codex"),sourceDir:"codex",files:["AGENTS.md"]},{destDir:t(p(),".codex","agents"),sourceDir:"codex",files:["neocortex-sentinel.toml","neocortex.toml"]},{destDir:t(p(),".copilot","agents"),sourceDir:"vscode",files:["neocortex.agent.md"]},{destDir:t(p(),".agent","skills","neocortex"),sourceDir:"antigravity",files:["skill/SKILL.md"]},{destDir:t(p(),".gemini","config","agents"),sourceDir:"antigravity",files:["neocortex.md"]},{destDir:t(p(),".grok","skills","neocortex"),sourceDir:"grok",files:["SKILL.md"]}],ve=[{stubDir:"claude-code",agentsDir:t(".claude","agents"),roleFiles:[["neocortex-sentinel.md","project-claude-neocortex-sentinel-agent",!0],["neocortex.md","project-claude-neocortex-agent",!0]],legacyDir:t(".claude","agents","neocortex")},{stubDir:"opencode",agentsDir:t(".opencode","agents"),roleFiles:[["neocortex-sentinel.md","project-opencode-neocortex-sentinel",!0],["neocortex.md","project-opencode-neocortex",!0],["neocortex-root.md","project-opencode-neocortex-root",!1]]},{stubDir:"codex",agentsDir:t(".codex","agents"),roleFiles:[["neocortex-sentinel.toml","project-codex-neocortex-sentinel",!0],["neocortex.toml","project-codex-neocortex",!0]]}];function Ee(){try{const r=ue(import.meta.url);let e=z(r);for(let o=0;o<10;o++){try{if(JSON.parse(E(t(e,"package.json"),"utf-8")).name==="@ornexus/neocortex")return e}catch{}e=z(e)}}catch{}return null}function Ne(r){try{const e=t(r,".version");if(c(e))return E(e,"utf-8").trim()||null}catch{}return null}function Pe(r,e){const o=`${r}.tmp-${process.pid}`;try{M(o,e,"utf8"),G(o),ae(o,r),G(r)}catch(s){try{c(o)&&le(o)}catch{}throw s}}function we(r,e){return be(r,e).refreshed}function re(r,e,o,s,l,u=!0){let x=E(r,"utf8");if(e.endsWith(".md")&&u){const i=c(o)?o:s&&c(s)?s:null,y=i?E(i,"utf8"):void 0;x=Re(x,y)}return(e.endsWith(".md")||e.endsWith(".yaml")||e.endsWith(".yml"))&&(x=te(x,l)),x}function ne(r,e,o){return{id:r.id??e,scope:o,relativePath:r.relativePath??"",action:r.action,reasonCode:r.reasonCode,...r.nextStep?{nextStep:r.nextStep}:{}}}function Ae(r,e){try{return V.native(r)===V.native(e)}catch{return!1}}function Fe(r){const{projectRoot:e,home:o,stubsRoot:s,managed:l,cliVersion:u,dryRun:x,tierLabel:i,targetFilter:y,results:h}=r;if(!Q(e)||!c(e)||Ae(e,o))return;const N=t(e,".neocortex","managed-config-manifest.json");for(const d of ve)if(!(y&&d.stubDir!==y))try{const P=t(s,d.stubDir),A=t(e,d.agentsDir);if(!d.roleFiles.slice(0,2).some(([m])=>c(t(A,m))))continue;const S=ee[d.stubDir],j=!!(S&&c(t(P,S)));for(const[m,n,R]of d.roleFiles){const F=t(P,m),f=t(A,m);if(!c(F)||!R&&!c(f))continue;const g=d.legacyDir?t(e,d.legacyDir,m):null,I=j&&l.agentRoleMigrationPending?.({id:n,destination:f,manifestFile:N,baseDir:e})===!0,w=re(F,m,f,g,u,!I);try{const b=l.applyProfileBytes({id:n,content:w,destination:f,manifestFile:N,baseDir:e,dryRun:x,allowLegacyAdoption:!0,tierLabel:i,adoptExistingOwner:!0,agentRoles:j,legacyCopyPath:g&&c(g)?g:null});h.push(ne(b,n,"project"))}catch(b){const D=b?.reasonCode;h.push({id:n,scope:"project",relativePath:$(e,f).split("\\").join("/"),action:"failed",reasonCode:typeof D=="string"?D:"managed-operation-failed"})}}}catch{}}function be(r,e){const o=[];try{const s=e?.forceCreate??!1,l=e?.targetFilter,u=e?.dryRun??!1,x=p(),i=e?.homeDir??x,y=e?.packageRoot??Ee();if(!y)return{refreshed:0,results:o};const h=t(y,"targets-stubs");if(!c(h))return{refreshed:0,results:o};const N=t(h,"lib","managed-config-merge.js");if(!c(N))return{refreshed:0,results:o};const d=Z(N),P=t(i,".neocortex","managed-config-manifest.json"),A=De(i),U=e?.env??(e?.homeDir?void 0:process.env),S=ge(i,U),j=t(x,".codex");try{d.applyPolicy({configFile:t(i,".neocortex","config.json"),manifestFile:P,baseDir:i,dryRun:u})}catch{}if(e?.projectRoot&&Fe({projectRoot:e.projectRoot,home:i,stubsRoot:h,managed:d,cliVersion:r,dryRun:u,tierLabel:A,targetFilter:l,results:o}),!l||l==="claude-code")try{const n=t(h,"lib","claude-worktree-setting.js");c(n)&&Z(n).ensureClaudeWorktreeBaseRef(i,{dryRun:u})}catch{}let m=0;for(const n of Se)try{const R=n.sourceDir==="codex",F=a=>R?t(S,$(j,a)):e?.homeDir?t(i,$(x,a)):a,f=F(n.destDir);if(l&&n.sourceDir!==l)continue;if(!c(f)){if(s&&!u)q(f,{recursive:!0});else if(!(s&&u))continue}const g=t(h,n.sourceDir),I=a=>{const L=n.fileDestDirs?.[a];return L?t(F(L),a):t(f,a)},w=Ne(f),b=n.files.every(a=>!c(t(g,a))||c(I(a)));if(w===r&&b||!c(g))continue;let D=i;if(R){if(!c(S))continue;D=d.resolveManagedBase(S,i)}const H=D===i?P:t(D,".neocortex","managed-config-manifest.json"),W=ee[n.sourceDir],Y=!!(W&&c(t(g,W)));let B=!1;for(const a of n.files){const L=t(g,a),ce=n.fileDestDirs?.[a],k=I(a),C=ce?t(f,a):null;if(c(L)){const J=$(i,k).split("\\").join("/"),K=`${n.sourceDir}:${a}`,T=xe[K]??`profile-${n.sourceDir}-${J}`,v=me[K],ie=!!v&&Y&&d.agentRoleMigrationPending?.({id:T,agentRoleId:v,destination:k,manifestFile:H,baseDir:D})===!0,se=re(L,a,k,C,r,!ie);try{const _=d.applyProfileBytes({id:T,content:se,destination:k,manifestFile:H,baseDir:D,dryRun:u,allowLegacyAdoption:!0,tierLabel:A,adoptExistingOwner:!0,legacyBaseDir:D===i?null:i,...v?{agentRoles:Y,agentRoleId:v}:{},legacyCopyPath:C&&c(C)?C:null});v&&o.push(ne(_,T,"user")),_.action!=="failed"&&(B=!0)}catch(_){if(v){const X=_?.reasonCode;o.push({id:T,scope:"user",relativePath:J,action:"failed",reasonCode:typeof X=="string"?X:"managed-operation-failed"})}throw _}}}if(B&&!u){const a=t(f,".version");Pe(a,r+`
|
|
2
|
+
`),m++}else B&&m++}catch{}if(m>0&&!u)try{const n=t(i,".neocortex");q(n,{recursive:!0});const R=t(n,".update-check");M(R,"",{flag:"w"}),G(R)}catch{}return{refreshed:m,results:o}}catch{return{refreshed:0,results:o}}}export{me as AGENT_ROLE_IDS,xe as CANONICAL_MANAGED_IDS,ve as PROJECT_ROLE_TARGETS,he as SELECTED_PAYLOAD_BOUNDARY_SNIPPET,ye as SELECTED_PAYLOAD_EXCLUSION_SNIPPET,$e as SELECTED_PAYLOAD_LARGE_INPUT_SNIPPET,Se as STUB_TARGETS,Oe as containsSelectedPayloadBoundary,Ee as findPackageRoot,te as patchVersionInContent,Te as patchVersionInFile,Re as preserveInstalledMarkdownFrontmatter,we as refreshStubs,be as refreshStubsReport};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{getClientVersion as l}from"./version.js";import{spawnSync as v}from"node:child_process";import{COMMAND_REGISTRY_CHECKSUM as p,COMMAND_REGISTRY_VERSION as d}from"./generated/command-registry.generated.js";import{readProjectRegistryIdentity as
|
|
2
|
+
import{getClientVersion as l}from"./version.js";import{spawnSync as v}from"node:child_process";import{COMMAND_REGISTRY_CHECKSUM as p,COMMAND_REGISTRY_VERSION as d}from"./generated/command-registry.generated.js";import{readProjectRegistryIdentity as w,reconcileRegistry as m,RegistryReconciliationError as u,REGISTRY_RECONCILIATION_REASON_CODES as h}from"./registry/registry-reconciliation.js";const f=`
|
|
3
3
|
neocortex-client - Neocortex Client CLI
|
|
4
4
|
|
|
5
5
|
Usage:
|
|
@@ -14,6 +14,7 @@ Commands:
|
|
|
14
14
|
planning-research seal Seal an independently reviewed P02 checkpoint from stdin
|
|
15
15
|
planning-generation <seal|verify> Seal a reviewed P03 or verify its committed evidence from stdin
|
|
16
16
|
planning-memory <seal|verify> Seal reviewed committed memory or reopen its physical receipt
|
|
17
|
+
planning-qa record Record digest-bound QA evidence for an admitted P01-P03 checkpoint from stdin
|
|
17
18
|
private-session <inspect-rejected|discard-rejected|renew-lease|accept-diagnosis|accept-research|accept-specification|accept-tasks|validate-implementation|accept-implementation|accept-refactor-advisory|accept-test-validation|accept-qa|accept-project-memory> Root recovery and phase validation
|
|
18
19
|
story-checkpoint Root-owned direct-*yolo commit/checkpoint boundary
|
|
19
20
|
story-worktree <create|adopt|sync|status|release> P225 temporary story worktree lifecycle (public-safe JSON)
|
|
@@ -220,7 +221,7 @@ Invocation payload boundary:
|
|
|
220
221
|
|
|
221
222
|
License:
|
|
222
223
|
Licensed under BSL-1.1 (Business Source License 1.1)
|
|
223
|
-
`.trim(),
|
|
224
|
+
`.trim(),j=new Set(["pm","install","postinstall","preinstall","prepublish","postpublish","preuninstall","postuninstall","preprepare","prepare","postprepare"]);function y(r,a){const o=r.indexOf(a);return o>=0?r[o+1]:void 0}function g(r){if(r instanceof u){process.stderr.write(`[Neocortex] ${r.reasonCode}: ${r.remediation}
|
|
224
225
|
`);return}process.stderr.write(`[Neocortex] ${h.ARTIFACT_UNAVAILABLE}: registry reconciliation could not be completed safely; no invoke request was sent.
|
|
225
|
-
`)}function x(){return{version:d,checksum:p}}function b(r){const a=
|
|
226
|
-
`),process.exit(0));const o=r.slice(1);switch(a){case"invoke":{const e=k(r,o);if(e!==void 0){process.exitCode=e;break}const{invokeCliHandler:t,flushInvokeCliOutput:
|
|
226
|
+
`)}function x(){return{version:d,checksum:p}}function b(r){const a=w(r);return!a||a.version===d&&a.checksum===p}function k(r,a){const o=y(a,"--project-root")||process.cwd();try{if(process.env.NEOCORTEX_REGISTRY_REEXECUTED==="1"&&!b(o))throw new u(h.ARTIFACT_MISMATCH,"The reinstalled client still does not match the trusted local projection; no invoke request was sent.");if(m({projectRoot:o,installedVersion:l(),installedIdentity:x()}).status!=="updated")return;const t=v(process.execPath,[process.argv[1],...r],{stdio:"inherit",env:{...process.env,NEOCORTEX_REGISTRY_REEXECUTED:"1"},shell:!1});return t.error?1:t.status??1}catch(e){return g(e),1}}async function C(){const r=process.argv.slice(2),a=r[0];a&&j.has(a.toLowerCase())&&process.exit(0),(!a||a==="--help"||a==="-h")&&(console.log(f),process.exit(0)),(a==="--version"||a==="-v")&&(console.log(l()),process.stderr.write(`Licensed under BSL-1.1 (Business Source License 1.1)
|
|
227
|
+
`),process.exit(0));const o=r.slice(1);switch(a){case"invoke":{const e=k(r,o);if(e!==void 0){process.exitCode=e;break}const{invokeCliHandler:t,flushInvokeCliOutput:i}=await import("./commands/invoke.js"),s=await t(o),n=await i();process.exitCode=n?s:1;break}case"reconcile-registry":{const e=y(o,"--project-root")||process.cwd();try{m({projectRoot:e,installedVersion:l(),installedIdentity:x(),checkLatest:o.includes("--check-latest")}),process.exitCode=0}catch(t){g(t),process.exitCode=1}break}case"activate":{const{activate:e}=await import("./commands/activate.js");let t,i,s=!1;for(let n=0;n<o.length;n++){const c=o[n];c==="--server-url"?i=o[++n]:c==="--non-interactive"?s=!0:c==="--help"||c==="-h"?(console.log(f),process.exit(0)):c.startsWith("-")||(t=c)}t||(console.error("Error: License key is required."),console.error("Usage: neocortex-client activate <license-key>"),console.error("Example: neocortex-client activate NX-PRO-ABC-123"),process.exit(1));try{const n=await e({licenseKey:t,serverUrl:i,nonInteractive:s});n.success?(console.log(n.message),process.exit(0)):(console.error(n.message),process.exit(1))}catch(n){const c=n instanceof Error?n.message:String(n);console.error(`Activation failed: ${c}`),process.exit(1)}break}case"cache-status":{console.log("Cache status requires an active client session."),console.log("Use this command within a running Neocortex client context."),process.exit(0);break}case"doctor":{const{doctorCliHandler:e}=await import("./commands/doctor.js"),t=await e(o);process.exit(t);break}case"config":{const{configCliHandler:e}=await import("./commands/config.js"),t=await e(o);process.exit(t);break}case"refresh-memory":{const{refreshMemoryCliHandler:e}=await import("./commands/refresh-memory.js"),t=await e(o);process.exit(t);break}case"architecture-memory":{const{architectureMemoryTerminalCliHandler:e}=await import("./commands/architecture-memory-terminal.js"),t=await e(o);process.exit(t);break}case"planning-diagnosis":{const{planningDiagnosisCliHandler:e}=await import("./commands/planning-diagnosis.js"),t=await e(o);process.exit(t);break}case"planning-research":{const{planningResearchCliHandler:e}=await import("./commands/planning-research.js"),t=await e(o);process.exit(t);break}case"private-session":{const{privateSessionCliHandler:e}=await import("./commands/private-session.js"),t=await e(o);process.exit(t);break}case"planning-memory":{const{planningMemoryCliHandler:e}=await import("./commands/planning-memory.js"),t=await e(o);process.exit(t);break}case"planning-generation":{const{planningGenerationCliHandler:e}=await import("./commands/planning-generation.js"),t=await e(o);process.exit(t);break}case"planning-qa":{const{planningQaCliHandler:e}=await import("./commands/planning-qa.js"),t=await e(o);process.exit(t);break}case"story-checkpoint":{const{storyCheckpointCliHandler:e}=await import("./commands/story-checkpoint.js"),t=await e(o);process.exit(t);break}case"story-worktree":{const{storyWorktreeCliHandler:e}=await import("./commands/story-worktree.js"),t=await e(o);process.exit(t);break}case"legacy-story-branch":{const{legacyStoryBranchCliHandler:e}=await import("./commands/legacy-story-branch.js"),t=await e(o);process.exit(t);break}case"legacy-story-pr":{const{legacyStoryPrCliHandler:e}=await import("./commands/legacy-story-pr.js"),t=await e(o);process.exit(t);break}case"legacy-epic-terminal":{const{legacyEpicTerminalCliHandler:e}=await import("./commands/legacy-epic-terminal.js"),t=await e(o);process.exit(t);break}case"mutation-qa":{const{mutationQaCliHandler:e}=await import("./commands/mutation-qa.js"),t=await e(o);process.exit(t);break}case"property-qa":{const{propertyQaCliHandler:e}=await import("./commands/property-qa.js"),t=await e(o);process.exit(t);break}case"qa-synthetic-backend":{const{syntheticBackendCliHandler:e}=await import("./commands/qa-synthetic-backend.js");process.exitCode=await e(r.slice(1));break}case"qa-scan-review":{const{qaScanReviewCliHandler:e}=await import("./commands/qa-scan-review.js"),t=await e(o);process.exit(t);break}case"qa-root":{const{qaControlCliHandler:e}=await import("./commands/qa-control.js");process.exit(await e(o));break}case"refactor-root":{if(o[0]==="control"){const{refactorControlCliHandler:i}=await import("./commands/refactor-control.js");process.exit(await i(o))}if(o[0]==="characterize"){const{refactorCharacterizationCliHandler:i}=await import("./commands/refactor-characterization.js");process.exit(i(o))}if(o[0]==="review-accept"||o[0]==="review-status"){const{refactorReviewCliHandler:i}=await import("./commands/refactor-review.js");process.exit(await i(o))}if(o[0]?.startsWith("commit-")){const{refactorCommitCliHandler:i}=await import("./commands/refactor-commit.js");process.exit(i(o))}const{refactorRootCliHandler:e}=await import("./commands/refactor-root.js"),t=e(o);process.exit(t);break}case"native-agent":{const{nativeAgentCliHandler:e}=await import("./commands/native-agent.js"),t=await e(o);process.exit(t);break}case"architecture-answers":{const{architectureAnswersCliHandler:e}=await import("./commands/architecture-answers.js"),t=await e(o);process.exit(t);break}case"update":{console.log("To update Neocortex, run:"),console.log(" neocortex update"),console.log(""),console.log("Or manually:"),console.log(" npm install -g @ornexus/neocortex@latest"),process.exit(0);break}default:console.error(`Unknown command: ${a}`),console.error('Run "neocortex-client --help" for usage information.'),process.exit(1)}}C().catch(r=>{console.error(`Fatal error: ${r instanceof Error?r.message:String(r)}`),process.exit(1)});
|
|
@@ -14,7 +14,7 @@ import type { ProjectManifestProjectionAttachment } from '../../../shared/dist/p
|
|
|
14
14
|
import { type ReleaseGateRequestV1 } from '../../../shared/dist/yoloop/release-blocked.js';
|
|
15
15
|
import { type InvokeEffectContext, type StrictReadOnlyInvokeEnvelope } from '../../../shared/dist/strict-readonly.js';
|
|
16
16
|
import { type ExplicitIntentRecoveryBindingV1, type ExplicitIntentRecoveryResultV1, type InvokeInputEvidenceV1, type InvokeInputEnvelopeV2, type InvokeInputSourceV2, type InvocationMalformedInputReasonV1, type InvocationAdmissionResultV1, type ProjectIdentityMigrationRequestV1 } from '../../../shared/dist/invocation/index.js';
|
|
17
|
-
import { type CompatibilityOfferV1, type CompatibilityResultV1 } from '../../../shared/dist/compatibility/index.js';
|
|
17
|
+
import { COMPATIBILITY_CAPABILITIES, type CompatibilityOfferV1, type CompatibilityResultV1, type PrivateExecutionHostKind } from '../../../shared/dist/compatibility/index.js';
|
|
18
18
|
import { type P205TransientExecutionAuthority } from '../git/git-lifecycle-store.js';
|
|
19
19
|
/**
|
|
20
20
|
* P226.04: the collector may fail with the bounded per-field frontmatter code
|
|
@@ -546,11 +546,15 @@ interface InvokeRequestBodyBase {
|
|
|
546
546
|
readonly nativeHostAttestation?: ReturnType<typeof detectNativeHostAttestation>;
|
|
547
547
|
/** Advisory numbers-only host capacity, attached to `*yoloop` only. */
|
|
548
548
|
readonly hostCapacity?: YoloopHostCapacityV1;
|
|
549
|
+
/**
|
|
550
|
+
* P228.18: `hostKind` is the closed shared host enum; `sandboxProof` is a
|
|
551
|
+
* Codex-host attribute sent only for `codex-cli`.
|
|
552
|
+
*/
|
|
549
553
|
readonly privateExecution?: {
|
|
550
554
|
readonly schemaVersion: 1;
|
|
551
|
-
readonly hostKind:
|
|
555
|
+
readonly hostKind: PrivateExecutionHostKind;
|
|
552
556
|
readonly hostVersion: string;
|
|
553
|
-
readonly sandboxProof
|
|
557
|
+
readonly sandboxProof?: {
|
|
554
558
|
readonly schemaVersion: 6;
|
|
555
559
|
readonly trust: 'client-self-attested';
|
|
556
560
|
readonly credentialKind: 'chatgpt-subscription';
|
|
@@ -649,11 +653,16 @@ export declare function detectStateSchemaDrift(stateData: unknown): SchemaDriftI
|
|
|
649
653
|
* Exported for tests only; not part of the public API.
|
|
650
654
|
*/
|
|
651
655
|
export declare function __resetSchemaDriftWarnedForTests(): void;
|
|
656
|
+
/**
|
|
657
|
+
* P228.03 (CON-PB-03): exact public counts only. The 1.0 bucket shape is no
|
|
658
|
+
* longer emitted; servers keep accepting it from older clients.
|
|
659
|
+
*/
|
|
652
660
|
export interface CreateEpicPlanningProjectionDiagnosticV1 {
|
|
653
|
-
readonly schemaVersion: 'CreateEpicPlanningProjectionDiagnostic/1.
|
|
661
|
+
readonly schemaVersion: 'CreateEpicPlanningProjectionDiagnostic/1.1';
|
|
654
662
|
readonly outcome: 'omitted';
|
|
655
663
|
readonly reasonCode: 'budget-omitted';
|
|
656
|
-
readonly
|
|
664
|
+
readonly byteLength: number;
|
|
665
|
+
readonly maxBytes: number;
|
|
657
666
|
readonly publicSafe: true;
|
|
658
667
|
}
|
|
659
668
|
/**
|
|
@@ -705,7 +714,21 @@ export interface StoryWorktreeReadinessV1 {
|
|
|
705
714
|
* only on the epic branch are present in every worktree.
|
|
706
715
|
*/
|
|
707
716
|
readonly executionBases?: readonly StoryWorktreeExecutionBaseV1[];
|
|
717
|
+
/**
|
|
718
|
+
* P228.26 (R12, DEC-09): emitted only when `.neocortex/state.json` is not
|
|
719
|
+
* tracked (`runtime-store` or `ambiguous`), always with the in-band
|
|
720
|
+
* capability id. `tracked` readiness stays byte-identical (AC5).
|
|
721
|
+
*/
|
|
722
|
+
readonly governanceMode?: 'runtime-store' | 'ambiguous';
|
|
723
|
+
readonly governanceCapability?: typeof COMPATIBILITY_CAPABILITIES.STORY_GOVERNANCE_RUNTIME_STORE;
|
|
708
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* P228.26 (DEC-05): from the root checkout of a `runtime-store` project, mirror
|
|
727
|
+
* the local `.neocortex/state.json` read-only into the governance store so
|
|
728
|
+
* story worktrees can read it. Never writes the local file; a failure only
|
|
729
|
+
* leaves the previous mirror and is reported by reason code.
|
|
730
|
+
*/
|
|
731
|
+
export declare function mirrorRuntimeStoreProjectState(projectRoot: string): void;
|
|
709
732
|
/** Epic targeted by `*yoloop @docs/epics/epic-P…md` or `*yolo @docs/stories/P….NN.story.md`. */
|
|
710
733
|
export declare function storyWorktreeReadinessTargetEpic(args: string): string | undefined;
|
|
711
734
|
/** Undefined outside a Git work tree or when Git cannot answer. */
|
|
@@ -841,6 +864,13 @@ export interface StoryWorktreeBarrierPollingOptions {
|
|
|
841
864
|
* phase-1 prompt, which resumes at C05.
|
|
842
865
|
*/
|
|
843
866
|
export declare function pollStoryWorktreeSpecBarrier(args: string, attempt: (args: string) => Promise<InvokeResult>, options?: StoryWorktreeBarrierPollingOptions): Promise<InvokeResult>;
|
|
867
|
+
/**
|
|
868
|
+
* P228.24 (AM-03): the server returns the v1 acceptance and, beside it, the
|
|
869
|
+
* story's current `specInputDigest`. A valid digest upgrades the record to v2
|
|
870
|
+
* (closed five keys); anything else keeps the record as the server sent it,
|
|
871
|
+
* so the closed store validator still decides. The client never computes it.
|
|
872
|
+
*/
|
|
873
|
+
export declare function composeStoryWorktreeSpecAcceptance(acceptance: unknown, specInputDigest: unknown): unknown;
|
|
844
874
|
/**
|
|
845
875
|
* 4.61.4: persist the server-returned C04 spec acceptance and phase-one receipt
|
|
846
876
|
* into the shared runtime evidence (git common dir), so the server can see
|