@ornexus/neocortex 4.66.49 → 4.66.51

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 (45) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1191 -1191
  3. package/install.js +8 -8
  4. package/install.ps1 +188 -162
  5. package/install.sh +1 -1
  6. package/package.json +2 -2
  7. package/packages/client/dist/commands/activate.js +6 -7
  8. package/packages/client/dist/commands/invoke.js +82 -82
  9. package/packages/client/dist/config/secure-config.d.ts +4 -0
  10. package/packages/client/dist/config/secure-config.js +6 -6
  11. package/packages/client/dist/git/git-lifecycle-store.d.ts +3 -1
  12. package/packages/client/dist/git/git-lifecycle-store.js +8 -8
  13. package/packages/client/dist/git/story-worktree-manager.d.ts +2 -0
  14. package/packages/client/dist/git/story-worktree-manager.js +3 -3
  15. package/packages/client/dist/migrations/project-identity.d.ts +3 -0
  16. package/packages/client/dist/migrations/project-identity.js +7 -7
  17. package/packages/client/dist/private-execution/isolated-admission.js +11 -11
  18. package/packages/client/dist/private-execution/isolated-workspace.js +1 -1
  19. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -5
  20. package/packages/client/dist/private-execution/planning-memory-checkpoint.js +3 -3
  21. package/packages/client/dist/runner/headless/run-yoloop.d.ts +2 -0
  22. package/packages/client/dist/runner/headless/run-yoloop.js +4 -4
  23. package/packages/shared/dist/invocation/semantic-gate-remediation.d.ts +45 -0
  24. package/packages/shared/dist/invocation/semantic-gate-remediation.js +51 -0
  25. package/targets-stubs/antigravity/gemini.md +1 -1
  26. package/targets-stubs/antigravity/neocortex.md +1 -1
  27. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  28. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  29. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  30. package/targets-stubs/claude-code/neocortex-sentinel.md +1 -1
  31. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  32. package/targets-stubs/claude-code/neocortex.md +2 -2
  33. package/targets-stubs/codex/AGENTS.md +1 -1
  34. package/targets-stubs/codex/neocortex.toml +1 -1
  35. package/targets-stubs/cursor/agent.md +2 -2
  36. package/targets-stubs/deepseek-harness/SKILL.md +1 -1
  37. package/targets-stubs/gemini-cli/agent.md +2 -2
  38. package/targets-stubs/gemini-cli/agents/neocortex.md +2 -2
  39. package/targets-stubs/grok/SKILL.md +1 -1
  40. package/targets-stubs/kimi/neocortex.md +1 -1
  41. package/targets-stubs/lib/managed-config-merge.js +12 -4
  42. package/targets-stubs/openclaw/SKILL.md +1 -1
  43. package/targets-stubs/opencode/neocortex-root.md +2 -2
  44. package/targets-stubs/opencode/neocortex.md +2 -2
  45. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -23,6 +23,10 @@ export interface SecureConfig {
23
23
  /** Key type: 'license' (NX-...) or 'api_key' (nxk_...). undefined = legacy (treat as license). Story 29.04 */
24
24
  readonly keyType?: KeyType;
25
25
  }
26
+ export declare class SecureConfigError extends Error {
27
+ readonly code: 'AUTH_PROFILE_CONFIG_INVALID' | 'AUTH_PROFILE_CONFIG_CHANGED';
28
+ constructor(code: 'AUTH_PROFILE_CONFIG_INVALID' | 'AUTH_PROFILE_CONFIG_CHANGED');
29
+ }
26
30
  /**
27
31
  * Encrypt a license key using the machine fingerprint as passphrase.
28
32
  * Returns the encrypted envelope string.
@@ -1,12 +1,12 @@
1
- import{existsSync as p,readFileSync as R,writeFileSync as S,mkdirSync as L,chmodSync as y}from"node:fs";import{execSync as u}from"node:child_process";import{join as d}from"node:path";import{encrypt as I,decrypt as g}from"../cache/crypto-utils.js";import{getMachineFingerprint as l}from"../machine/fingerprint.js";import{DEFAULT_SERVER_URL as x}from"../constants.js";import{neocortexProfileDirectory as K}from"./profile-directory.js";const s=K(),a=d(s,"config.json"),C=["api","neocortex","ornexus","com"].join("."),f=1;function m(r,t={}){const e=l(t);return I(r,e)}function O(r,t={}){try{const e=l(t);return g(r,e).plaintext}catch{return null}}function _(r){try{if(process.platform==="win32"){const t=process.env.USERNAME||process.env.USER||"";if(!t)return;u(`icacls "${r}" /inheritance:r /grant:r "${t}:(F)"`,{stdio:"pipe",timeout:5e3})}else y(r,384)}catch{}}function h(r){try{if(process.platform==="win32"){const t=process.env.USERNAME||process.env.USER||"";if(!t)return;u(`icacls "${r}" /inheritance:r /grant:r "${t}:(OI)(CI)(F)"`,{stdio:"pipe",timeout:5e3})}else y(r,448)}catch{}}let v=!1;function F(r){if(v)return;const t=r.serverUrl;if(!t)return;/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)(:\d+)?/i.test(t)&&(v=!0,console.warn(`
1
+ import{existsSync as F,readFileSync as u,writeFileSync as N,mkdirSync as x,chmodSync as m,closeSync as h,constants as d,fstatSync as g,fsyncSync as A,lstatSync as K,openSync as I,renameSync as T,unlinkSync as k}from"node:fs";import{execFileSync as E}from"node:child_process";import{randomUUID as D}from"node:crypto";import{join as v,win32 as f}from"node:path";import{encrypt as G,decrypt as $}from"../cache/crypto-utils.js";import{getMachineFingerprint as p}from"../machine/fingerprint.js";import{DEFAULT_SERVER_URL as H}from"../constants.js";import{neocortexProfileDirectory as V}from"./profile-directory.js";const a=V(),s=v(a,"config.json"),j=["api","neocortex","ornexus","com"].join("."),w=1;class l extends Error{code;constructor(t){super(t),this.code=t}}function L(r){let t;try{t=JSON.parse(r.replace(/^\uFEFF/,""))}catch{throw new l("AUTH_PROFILE_CONFIG_INVALID")}if(!t||typeof t!="object"||Array.isArray(t))throw new l("AUTH_PROFILE_CONFIG_INVALID");return t}function O(r,t={}){const e=p(t);return G(r,e)}function W(r,t={}){try{const e=p(t);return $(r,e).plaintext}catch{return null}}let y;function S(r,t){const e=f.join(process.env.SystemRoot??"C:\\Windows","System32");if(!y){const o=E(f.join(e,"whoami.exe"),["/user","/fo","csv","/nh"],{encoding:"utf8",timeout:5e3,windowsHide:!0});y=/,\s*"(S-1-(?:\d+-)+\d+)"\s*$/i.exec(o.trim())?.[1]}y&&E(f.join(e,"icacls.exe"),[r,"/inheritance:r","/grant:r",`*${y}:${t}`],{stdio:"pipe",timeout:5e3,windowsHide:!0})}function P(r){try{process.platform==="win32"?S(r,"(F)"):m(r,384)}catch{}}function Y(r){try{process.platform==="win32"?S(r,"(OI)(CI)(F)"):m(r,448)}catch{}}let U=!1;function b(r){if(U)return;const t=r.serverUrl;if(!t)return;/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)(:\d+)?/i.test(t)&&(U=!0,console.warn(`
2
2
  [!] Warning: connected to local server (`+t+`).
3
3
  To use production, run: neocortex activate YOUR-LICENSE-KEY
4
4
  Get yours at https://neocortex.sh/portal/login
5
- `))}function w(r){const t=r.match(/^(https?:\/\/)([^/]+)(.*)$/i);if(!t)return null;const[,e,o,n=""]=t;return o.toLowerCase()!==C?null:`${e}api.neocortex.sh${n}`}function D(r={}){try{if(!p(a))return null;const t=R(a,"utf-8"),e=JSON.parse(t.replace(/^\uFEFF/,""));if(e.licenseKey&&!e.encryptedLicenseKey){const c=m(e.licenseKey,r),i={...e},U=i.licenseKey;return delete i.licenseKey,i.encryptedLicenseKey=c,i.configVersion||(i.configVersion=f),r.strictReadOnly||E(i),{serverUrl:e.serverUrl,mode:e.mode,machineId:e.machineId,activatedAt:e.activatedAt,tier:e.tier,licenseKey:U,keyType:e.keyType}}let o;if(e.encryptedLicenseKey){const c=O(e.encryptedLicenseKey,r);c&&(o=c)}const n={serverUrl:e.serverUrl,mode:e.mode,machineId:e.machineId,activatedAt:e.activatedAt,tier:e.tier,licenseKey:o,keyType:e.keyType};if(e.machineId&&!o&&e.encryptedLicenseKey){const c=l(r);e.machineId!==c&&console.warn(`
6
- [!] Machine fingerprint changed (was: ${e.machineId.slice(0,12)}..., now: ${c.slice(0,12)}...).
5
+ `))}function X(r){const t=r.match(/^(https?:\/\/)([^/]+)(.*)$/i);if(!t)return null;const[,e,o,n=""]=t;return o.toLowerCase()!==j?null:`${e}api.neocortex.sh${n}`}function re(r={}){try{if(!F(s))return null;const t=u(s,"utf-8"),e=L(t);if(e.licenseKey&&!e.encryptedLicenseKey){const i=O(e.licenseKey,r),c={...e},C=c.licenseKey;return delete c.licenseKey,c.encryptedLicenseKey=i,c.configVersion||(c.configVersion=w),r.strictReadOnly||R(c,t),{serverUrl:e.serverUrl,mode:e.mode,machineId:e.machineId,activatedAt:e.activatedAt,tier:e.tier,licenseKey:C,keyType:e.keyType}}let o;if(e.encryptedLicenseKey){const i=W(e.encryptedLicenseKey,r);i&&(o=i)}const n={serverUrl:e.serverUrl,mode:e.mode,machineId:e.machineId,activatedAt:e.activatedAt,tier:e.tier,licenseKey:o,keyType:e.keyType};if(e.machineId&&!o&&e.encryptedLicenseKey){const i=p(r);e.machineId!==i&&console.warn(`
6
+ [!] Machine fingerprint changed (was: ${e.machineId.slice(0,12)}..., now: ${i.slice(0,12)}...).
7
7
  Your encrypted credentials are no longer valid.
8
8
  Re-activate with: neocortex activate YOUR-LICENSE-KEY
9
- `)}if(F(n),n.serverUrl&&!process.env.NEOCORTEX_SERVER_URL&&/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)(:\d+)?/i.test(n.serverUrl)){const i=x;return console.warn(`[neocortex] Auto-repairing serverUrl: ${n.serverUrl} -> ${i}
9
+ `)}if(b(n),n.serverUrl&&!process.env.NEOCORTEX_SERVER_URL&&/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)(:\d+)?/i.test(n.serverUrl)){const c=H;return console.warn(`[neocortex] Auto-repairing serverUrl: ${n.serverUrl} -> ${c}
10
10
  [neocortex] To keep localhost, set NEOCORTEX_SERVER_URL=${n.serverUrl}
11
- `),{...n,serverUrl:i}}if(n.serverUrl&&!process.env.NEOCORTEX_SERVER_URL){const c=w(n.serverUrl);if(c)return{...n,serverUrl:c}}return n}catch{return null}}function E(r){L(s,{recursive:!0}),h(s);const t=d(s,"cache");p(t)&&h(t),S(a,JSON.stringify(r,null,2)+`
12
- `,"utf-8"),_(a)}function G(r){const t=m(r.licenseKey),e=r.keyType??(r.licenseKey.startsWith("nxk_")?"api_key":"license"),o={configVersion:f,serverUrl:r.serverUrl,mode:r.mode,machineId:r.machineId,activatedAt:r.activatedAt,tier:r.tier,encryptedLicenseKey:t,keyType:e};E(o)}export{O as decryptLicenseKey,m as encryptLicenseKey,D as loadSecureConfig,G as saveSecureConfig,h as setSecureDirPermissions,_ as setSecureFilePermissions};
11
+ `),{...n,serverUrl:c}}if(n.serverUrl&&!process.env.NEOCORTEX_SERVER_URL){const i=X(n.serverUrl);if(i)return{...n,serverUrl:i}}return n}catch{return null}}function _(){try{const r=K(s);if(!r.isFile()||r.isSymbolicLink())throw new l("AUTH_PROFILE_CONFIG_INVALID");const t=I(s,d.O_RDWR|d.O_NOFOLLOW|d.O_NONBLOCK);try{const e=g(t);if(!e.isFile()||e.dev!==r.dev||e.ino!==r.ino)throw new l("AUTH_PROFILE_CONFIG_CHANGED");return u(t,"utf8")}finally{h(t)}}catch(r){if(r.code==="ENOENT")return null;throw r}}function R(r,t){x(a,{recursive:!0,mode:448})!==void 0&&Y(a);const e=v(a,`.config.json.${D()}.tmp`),o=I(e,"wx",384);let n=!1;try{try{P(e),N(o,JSON.stringify(r,null,2)+`
12
+ `,"utf8"),A(o)}finally{h(o)}if(_()!==t)throw new l("AUTH_PROFILE_CONFIG_CHANGED");T(e,s),n=!0}finally{if(!n)try{k(e)}catch{}}}function te(r){const t=_(),e=t===null?{}:L(t),o=O(r.licenseKey),n=r.keyType??(r.licenseKey.startsWith("nxk_")?"api_key":"license"),i={...e,configVersion:w,serverUrl:r.serverUrl,mode:r.mode,machineId:r.machineId,activatedAt:r.activatedAt,tier:r.tier,encryptedLicenseKey:o,keyType:n};delete i.licenseKey,delete i.apiKey,R(i,t)}export{l as SecureConfigError,W as decryptLicenseKey,O as encryptLicenseKey,re as loadSecureConfig,te as saveSecureConfig,Y as setSecureDirPermissions,P as setSecureFilePermissions};
@@ -549,11 +549,13 @@ export type GitLifecyclePhysicalIntegrationLockResult = {
549
549
  readonly ok: false;
550
550
  readonly reasonCode: 'git-lifecycle-integration-backpressure' | 'git-lifecycle-integration-lock-failed';
551
551
  };
552
+ export declare const YOLOOP_RUNNER_LOCK_SCOPE = "yoloop-runner";
553
+ type PhysicalIntegrationLockScope = 'integration' | typeof YOLOOP_RUNNER_LOCK_SCOPE;
552
554
  /** One physical writer lock shared by direct `*yolo` and continuous DAG integration. */
553
555
  export declare function acquireGitLifecyclePhysicalIntegrationLock(projectRoot: string, requested: Omit<GitLifecyclePhysicalIntegrationLockOwner, 'schemaVersion' | 'pid' | 'createdAt' | 'ownerNonce'> & {
554
556
  readonly createdAt?: string;
555
557
  readonly ownerNonce?: string;
556
- }, scope?: 'integration' | 'yoloop-runner'): Promise<GitLifecyclePhysicalIntegrationLockResult>;
558
+ }, scope?: PhysicalIntegrationLockScope): Promise<GitLifecyclePhysicalIntegrationLockResult>;
557
559
  /** P227.06 (ADR-3): bounded, jittered wait on the physical integration lock. */
558
560
  export interface GitLifecyclePhysicalIntegrationLockWait {
559
561
  /** Total scheduled wait in ms; default 2000, clamped to [0, 5000]. */