@ornexus/neocortex 4.66.6 β 4.66.7
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 +1194 -1194
- package/install.ps1 +10 -3
- package/install.sh +8 -10
- package/package.json +2 -2
- package/packages/client/dist/cli.js +0 -0
- package/packages/client/dist/commands/activate.js +7 -8
- package/packages/client/dist/generated/public-projections.generated.d.ts +19 -19
- package/packages/client/dist/generated/public-projections.generated.js +1 -1
- package/packages/client/dist/license/license-client.d.ts +3 -0
- package/packages/client/dist/license/license-client.js +1 -1
- package/packages/client/dist/runner-cli.js +0 -0
- package/packages/shared/dist/generated/public-projections.generated.js +17 -17
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +2 -2
- package/targets-stubs/claude-code/neocortex-sentinel.md +1 -1
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +2 -2
- package/targets-stubs/codex/AGENTS.md +1 -1
- package/targets-stubs/cursor/agent.md +2 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/gemini-cli/agents/neocortex.md +2 -2
- package/targets-stubs/opencode/neocortex-root.md +1 -1
- package/targets-stubs/opencode/neocortex.md +1 -1
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
package/install.ps1
CHANGED
|
@@ -19,7 +19,7 @@ param(
|
|
|
19
19
|
[string]$ServerUrl = ('https://{0}.{1}.{2}' -f 'api','neocortex','sh')
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
$VERSION = "4.66.
|
|
22
|
+
$VERSION = "4.66.7"
|
|
23
23
|
|
|
24
24
|
# =============================================================================
|
|
25
25
|
# CONFIGURACOES
|
|
@@ -1343,12 +1343,19 @@ function Install-Core {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
1345
|
|
|
1346
|
-
# If version changed, purge
|
|
1346
|
+
# If version changed, purge only disposable cache files. Authentication
|
|
1347
|
+
# entries are durable credentials and must survive client upgrades.
|
|
1347
1348
|
if ($oldVersion -and $oldVersion -ne $pkgVersion) {
|
|
1348
1349
|
$cachePurgeDir = "$env:USERPROFILE\.neocortex\cache"
|
|
1349
1350
|
if (Test-Path $cachePurgeDir -PathType Container) {
|
|
1350
1351
|
$purged = 0
|
|
1351
|
-
|
|
1352
|
+
$authCacheFileNames = @(
|
|
1353
|
+
"0a245557f7037afaad6241d7e5f04b1b4e3d97e246e7b44f59151bf31b4854b3.enc",
|
|
1354
|
+
"42c066b696219e250df22534c818cc780f228800ab65a673b5fc3f93aa0be127.enc"
|
|
1355
|
+
)
|
|
1356
|
+
Get-ChildItem -Path $cachePurgeDir -File -ErrorAction SilentlyContinue |
|
|
1357
|
+
Where-Object { $authCacheFileNames -notcontains $_.Name } |
|
|
1358
|
+
ForEach-Object {
|
|
1352
1359
|
Remove-Item $_.FullName -Force -ErrorAction SilentlyContinue
|
|
1353
1360
|
$purged++
|
|
1354
1361
|
}
|
package/install.sh
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Development Orchestrator
|
|
5
5
|
|
|
6
6
|
# Versao do instalador
|
|
7
|
-
VERSION="4.66.
|
|
7
|
+
VERSION="4.66.7"
|
|
8
8
|
|
|
9
9
|
# Flags
|
|
10
10
|
MIGRATION_DETECTED=false
|
|
@@ -1265,21 +1265,19 @@ install_core() {
|
|
|
1265
1265
|
old_version=$(cat "$HOME/.neocortex/.version" 2>/dev/null | tr -d '[:space:]')
|
|
1266
1266
|
fi
|
|
1267
1267
|
|
|
1268
|
-
# If version changed, purge
|
|
1268
|
+
# If version changed, purge only disposable cache files. Authentication
|
|
1269
|
+
# entries are durable credentials and must survive client upgrades.
|
|
1269
1270
|
if [ -n "$old_version" ] && [ "$old_version" != "$pkg_version" ]; then
|
|
1270
1271
|
local cache_dir="$HOME/.neocortex/cache"
|
|
1271
1272
|
if [ -d "$cache_dir" ]; then
|
|
1272
1273
|
local purged=0
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
[ -f "$enc_file" ] || continue
|
|
1276
|
-
rm -f "$enc_file" 2>/dev/null && purged=$((purged + 1))
|
|
1277
|
-
done
|
|
1278
|
-
# Remove menu-cache.json (redundancy with 62.1)
|
|
1279
|
-
[ -f "$cache_dir/menu-cache.json" ] && rm -f "$cache_dir/menu-cache.json" 2>/dev/null && purged=$((purged + 1))
|
|
1280
|
-
# Remove any other non-directory files
|
|
1274
|
+
local access_token_cache="0a245557f7037afaad6241d7e5f04b1b4e3d97e246e7b44f59151bf31b4854b3.enc"
|
|
1275
|
+
local refresh_token_cache="42c066b696219e250df22534c818cc780f228800ab65a673b5fc3f93aa0be127.enc"
|
|
1281
1276
|
for cache_file in "$cache_dir"/*; do
|
|
1282
1277
|
[ -f "$cache_file" ] || continue
|
|
1278
|
+
case "$(basename "$cache_file")" in
|
|
1279
|
+
"$access_token_cache"|"$refresh_token_cache") continue ;;
|
|
1280
|
+
esac
|
|
1283
1281
|
rm -f "$cache_file" 2>/dev/null && purged=$((purged + 1))
|
|
1284
1282
|
done
|
|
1285
1283
|
[ $purged -gt 0 ] && info "Cache purgado: versao alterada de $old_version para $pkg_version ($purged arquivo(s))"
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`,"utf-8")}}async function fe(e){const{licenseKey:t,serverUrl:r=
|
|
3
|
-
`)};const n=t.trim();if(n.startsWith("nxk_")){const
|
|
4
|
-
`)}}const
|
|
5
|
-
`)
|
|
6
|
-
`)}}
|
|
7
|
-
`)
|
|
8
|
-
`),tier:y,serverUrl:r,configPath:c}}export{fe as activate,z as validateApiKeyFormat,G as validateLicenseKeyFormat};
|
|
1
|
+
import{existsSync as V,mkdirSync as x,writeFileSync as $,readFileSync as I}from"node:fs";import{join as a,dirname as C}from"node:path";import{homedir as X}from"node:os";import{fileURLToPath as Y}from"node:url";import{LicenseClient as w}from"../license/license-client.js";import{EncryptedCache as E}from"../cache/encrypted-cache.js";import{getMachineFingerprint as P}from"../machine/fingerprint.js";import{refreshStubs as l}from"../agent/refresh-stubs.js";import{saveSecureConfig as W,setSecureDirPermissions as S}from"../config/secure-config.js";import{DEFAULT_SERVER_URL as G}from"../constants.js";function N(){try{const e=Y(import.meta.url);let t=C(e);for(let r=0;r<5;r++){try{const n=JSON.parse(I(a(t,"package.json"),"utf-8"));if(n.name==="@ornexus/neocortex"||n.name==="@neocortex/client")return n.version??"0.0.0"}catch{}t=C(t)}}catch{}return"0.0.0"}const i=a(X(),".neocortex"),o=a(i,"config.json"),J=/^NX-(F|P|E)-[a-f0-9]+-[a-f0-9]+$/i,z=/^nxk_(?:[a-z]+_)?[a-f0-9]+_[a-f0-9]+$/;function q(e){if(!e||e.trim().length===0)return{valid:!1,error:"License key cannot be empty"};const t=e.trim().toUpperCase();return t.startsWith("NX-")?J.test(t)?{valid:!0}:{valid:!1,error:"Invalid license key format. Expected: NX-{TIER}-{ID} (e.g., NX-PRO-ABC-123)"}:{valid:!1,error:'License key must start with "NX-"'}}function B(e){if(!e||e.trim().length===0)return{valid:!1,error:"API key cannot be empty"};const t=e.trim();return t.startsWith("nxk_")?t.length<20?{valid:!1,error:"API key is too short"}:z.test(t)?{valid:!0}:{valid:!1,error:"Invalid API key format. Expected: nxk_{id}_{check} (e.g., nxk_abc123def456...)"}:{valid:!1,error:'API key must start with "nxk_"'}}function ue(){try{if(V(o)){const e=I(o,"utf-8");return JSON.parse(e)}}catch{}return null}function A(e){x(i,{recursive:!0}),S(i);const t=a(i,"cache");if(x(t,{recursive:!0}),S(t),e.licenseKey||e.apiKey)W({serverUrl:e.serverUrl,mode:e.mode,machineId:e.machineId,activatedAt:e.activatedAt,tier:e.tier,licenseKey:e.licenseKey??e.apiKey});else{const r={configVersion:1,...e};$(o,JSON.stringify(r,null,2)+`
|
|
2
|
+
`,"utf-8")}}async function fe(e){const{licenseKey:t,serverUrl:r=G}=e;if(!t)return{success:!1,message:["No key provided.","","Get your license key at https://neocortex.sh/portal/login","","Usage:"," neocortex activate YOUR-LICENSE-KEY"," neocortex activate YOUR-API-KEY"].join(`
|
|
3
|
+
`)};const n=t.trim();if(n.startsWith("nxk_")){const s=B(n);if(!s.valid)return{success:!1,message:`Invalid API key: ${s.error}`};const v=n.match(/^nxk_(free|pro|ent)_/),D={free:"free",pro:"pro",ent:"enterprise"},L=v?.[1]?D[v[1]]??"unknown":"unknown",O=P(),u=N(),T=a(i,"cache"),j=new E({cacheDir:T,passphrase:n}),y=await new w({serverUrl:r,licenseKey:n,cacheProvider:j,clientVersion:u,causalAuthRecovery:!0}).activate();if(!y)return{success:!1,message:"API key activation failed. Run neocortex-client auth-doctor --format plain and retry only after the reported cause is resolved."};const g=y.tier??L,M={serverUrl:r,mode:"remote",machineId:O,activatedAt:new Date().toISOString(),tier:g,apiKey:n};try{A(M)}catch(k){return{success:!1,message:`Failed to save configuration: ${k instanceof Error?k.message:"unknown error"}`}}return{success:!0,message:["Neocortex activated successfully.","","Open your preferred platform (Claude Code, Cursor, VS Code, etc.)","and reference the Neocortex agent.",...l(u,{forceCreate:!0,targetFilter:"claude-code"})+l(u)>0?["","Managed agent wrappers were refreshed while preserving existing Markdown frontmatter and unrelated platform files."]:[],"","Use *menu to see available commands or check the Docs in your Dashboard."].join(`
|
|
4
|
+
`),tier:g,serverUrl:r,configPath:o}}const f=q(n);if(!f.valid)return{success:!1,message:`Invalid license key: ${f.error}`};const c=n,m=c.match(/^NX-(F|P|E)-/i),K={F:"free",P:"pro",E:"enterprise"},R=m?.[1]?K[m[1].toUpperCase()]??"unknown":"unknown",_=a(i,"cache"),b=new E({cacheDir:_,passphrase:c}),F=new w({serverUrl:r,licenseKey:c,cacheProvider:b});let d;try{d=await F.activate()}catch{return{success:!1,message:["Failed to connect to IP Protection Server.","","Possible causes:",` - Server at ${r} is unreachable`," - Network connectivity issue"," - Server is still being deployed","","Workaround: Use --local flag to run in local mode"].join(`
|
|
5
|
+
`)}}if(!d)return{success:!1,message:["License activation failed.","","Possible causes:"," - Invalid or expired license key"," - License already activated on another machine"," - Server rejected the activation request","","Check your license key and try again.","Contact support if the problem persists."].join(`
|
|
6
|
+
`)};const p=d.tier??R,U={serverUrl:r,mode:"remote",machineId:P(),activatedAt:new Date().toISOString(),tier:p,licenseKey:c};try{A(U)}catch(s){return{success:!1,message:`Failed to save config to ${o}: ${s instanceof Error?s.message:String(s)}`}}const h=N();return{success:!0,message:["Neocortex activated successfully.","","Open your preferred platform (Claude Code, Cursor, VS Code, etc.)","and reference the Neocortex agent.",...l(h,{forceCreate:!0,targetFilter:"claude-code"})+l(h)>0?["","Managed agent wrappers were refreshed while preserving existing Markdown frontmatter and unrelated platform files."]:[],"","Use *menu to see available commands or check the Docs in your Dashboard."].join(`
|
|
7
|
+
`),tier:p,serverUrl:r,configPath:o}}export{fe as activate,B as validateApiKeyFormat,q as validateLicenseKeyFormat};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** Generated by scripts/generate-public-catalog-projections.mjs. Do not edit. */
|
|
2
2
|
export declare const PUBLIC_PROJECTION_BUNDLE: {
|
|
3
3
|
readonly schemaVersion: "PublicProjectionBundle/1.0";
|
|
4
|
-
readonly generationId: "sha256:
|
|
5
|
-
readonly sourceHash: "
|
|
6
|
-
readonly catalogHash: "
|
|
7
|
-
readonly publicProjectionHash: "
|
|
8
|
-
readonly stageProjectionHash: "
|
|
9
|
-
readonly compilationHash: "
|
|
4
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
5
|
+
readonly sourceHash: "137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
6
|
+
readonly catalogHash: "0f452979cb84c34476fd478379ee5c680d670f31065fb5ac51f19d1160f63c89";
|
|
7
|
+
readonly publicProjectionHash: "552f6aa4b4e6d121be460f9cde0c3bc0ef2284fcbd6d780ade4860d5e4032ed7";
|
|
8
|
+
readonly stageProjectionHash: "3492958695bf9d80c4db5e0ba63cf89f1b826df8282f24600018651ecabdaa3b";
|
|
9
|
+
readonly compilationHash: "ef6dbdd72a65ae50ea6379e04ab5381a91a2107c714986354f6f59a8ea53583c";
|
|
10
10
|
readonly registry: {
|
|
11
11
|
readonly version: "1.0.0";
|
|
12
12
|
readonly checksum: "184a2d616e0734fd3173d60889d74bae031280513831ec1f0a3a8c36959d2994";
|
|
@@ -15,37 +15,37 @@ export declare const PUBLIC_PROJECTION_BUNDLE: {
|
|
|
15
15
|
readonly kind: "catalog";
|
|
16
16
|
readonly schemaVersion: "ExecutableGraphCatalogPublicProjection/1.0";
|
|
17
17
|
readonly relativePath: "catalog.json";
|
|
18
|
-
readonly sha256: "
|
|
18
|
+
readonly sha256: "cef5eeebd75076c029e46bca28450eacbe329cb0f57151f6bc40faaecc4affdf";
|
|
19
19
|
readonly entryCount: 97;
|
|
20
|
-
readonly generationId: "sha256:
|
|
20
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
21
21
|
}, {
|
|
22
22
|
readonly kind: "commands";
|
|
23
23
|
readonly schemaVersion: "CommandRegistryPublicProjection/1.0";
|
|
24
24
|
readonly relativePath: "commands.json";
|
|
25
|
-
readonly sha256: "
|
|
25
|
+
readonly sha256: "38e967e221ebab7605009c5113cdbd2f6b5b0243f17fd1006191c932a08c0779";
|
|
26
26
|
readonly entryCount: 62;
|
|
27
|
-
readonly generationId: "sha256:
|
|
27
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
28
28
|
}, {
|
|
29
29
|
readonly kind: "progress-view";
|
|
30
30
|
readonly schemaVersion: "ProgressViewContractProjection/1.0";
|
|
31
31
|
readonly relativePath: "progress-view.json";
|
|
32
|
-
readonly sha256: "
|
|
32
|
+
readonly sha256: "92e8e5f2866ad8e51839ba089db703f02ee2391f830e0baa87735719f442dd0b";
|
|
33
33
|
readonly entryCount: 1;
|
|
34
|
-
readonly generationId: "sha256:
|
|
34
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
35
35
|
}, {
|
|
36
36
|
readonly kind: "stages";
|
|
37
37
|
readonly schemaVersion: "ExecutableGraphStageProjection/1.0";
|
|
38
38
|
readonly relativePath: "stages.json";
|
|
39
|
-
readonly sha256: "
|
|
39
|
+
readonly sha256: "f2fe325243c432718c2861a726fb2a53ee9c886f715acfd51ca7c82c92f68fd3";
|
|
40
40
|
readonly entryCount: 85;
|
|
41
|
-
readonly generationId: "sha256:
|
|
41
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
42
42
|
}, {
|
|
43
43
|
readonly kind: "surfaces";
|
|
44
44
|
readonly schemaVersion: "PublicProjectionSurfaces/1.0";
|
|
45
45
|
readonly relativePath: "surfaces.json";
|
|
46
|
-
readonly sha256: "
|
|
46
|
+
readonly sha256: "d38132db0ad2986acf9452cab72e5655d6f49e6aad4aab06c95245e0a16cf141";
|
|
47
47
|
readonly entryCount: 6;
|
|
48
|
-
readonly generationId: "sha256:
|
|
48
|
+
readonly generationId: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
49
49
|
}];
|
|
50
50
|
readonly compatibility: {
|
|
51
51
|
readonly status: "compatible";
|
|
@@ -94,7 +94,7 @@ export declare const PUBLIC_PROJECTION_BUNDLE: {
|
|
|
94
94
|
readonly authority: "read-only-projection";
|
|
95
95
|
}];
|
|
96
96
|
readonly publicSafe: true;
|
|
97
|
-
readonly bundleHash: "
|
|
97
|
+
readonly bundleHash: "18f2220180f7ed7325900c609a29ad61ad66bf7fecfb55e0b441ef2cd55e886e";
|
|
98
98
|
};
|
|
99
|
-
export declare const PUBLIC_PROJECTION_GENERATION_ID: "sha256:
|
|
100
|
-
export declare const PUBLIC_PROJECTION_BUNDLE_HASH: "
|
|
99
|
+
export declare const PUBLIC_PROJECTION_GENERATION_ID: "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04";
|
|
100
|
+
export declare const PUBLIC_PROJECTION_BUNDLE_HASH: "18f2220180f7ed7325900c609a29ad61ad66bf7fecfb55e0b441ef2cd55e886e";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a={schemaVersion:"PublicProjectionBundle/1.0",generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04",sourceHash:"137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04",catalogHash:"0f452979cb84c34476fd478379ee5c680d670f31065fb5ac51f19d1160f63c89",publicProjectionHash:"552f6aa4b4e6d121be460f9cde0c3bc0ef2284fcbd6d780ade4860d5e4032ed7",stageProjectionHash:"3492958695bf9d80c4db5e0ba63cf89f1b826df8282f24600018651ecabdaa3b",compilationHash:"ef6dbdd72a65ae50ea6379e04ab5381a91a2107c714986354f6f59a8ea53583c",registry:{version:"1.0.0",checksum:"184a2d616e0734fd3173d60889d74bae031280513831ec1f0a3a8c36959d2994"},artifacts:[{kind:"catalog",schemaVersion:"ExecutableGraphCatalogPublicProjection/1.0",relativePath:"catalog.json",sha256:"cef5eeebd75076c029e46bca28450eacbe329cb0f57151f6bc40faaecc4affdf",entryCount:97,generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"},{kind:"commands",schemaVersion:"CommandRegistryPublicProjection/1.0",relativePath:"commands.json",sha256:"38e967e221ebab7605009c5113cdbd2f6b5b0243f17fd1006191c932a08c0779",entryCount:62,generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"},{kind:"progress-view",schemaVersion:"ProgressViewContractProjection/1.0",relativePath:"progress-view.json",sha256:"92e8e5f2866ad8e51839ba089db703f02ee2391f830e0baa87735719f442dd0b",entryCount:1,generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"},{kind:"stages",schemaVersion:"ExecutableGraphStageProjection/1.0",relativePath:"stages.json",sha256:"f2fe325243c432718c2861a726fb2a53ee9c886f715acfd51ca7c82c92f68fd3",entryCount:85,generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"},{kind:"surfaces",schemaVersion:"PublicProjectionSurfaces/1.0",relativePath:"surfaces.json",sha256:"d38132db0ad2986acf9452cab72e5655d6f49e6aad4aab06c95245e0a16cf141",entryCount:6,generationId:"sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"}],compatibility:{status:"compatible",routeCount:97,rootCommandCount:62,operationCount:35,aliasCount:199},contractVersions:{catalog:"ExecutableGraphCatalogPublicProjection/1.0",stages:"ExecutableGraphStageProjection/1.0",progress:"ProgressSnapshot/1.0",progressView:"ProgressView/1.0",readiness:"ExecutableGraphReadinessVector/1.0",validation:"ValidationMatrix/1.1"},surfaces:[{kind:"admin",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"},{kind:"client",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"},{kind:"docs",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"},{kind:"metrics",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"},{kind:"runtime-preview",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"},{kind:"tests",artifactKinds:["catalog","stages","commands","surfaces","progress-view"],progressView:"ProgressView/1.0",authority:"read-only-projection"}],publicSafe:!0,bundleHash:"18f2220180f7ed7325900c609a29ad61ad66bf7fecfb55e0b441ef2cd55e886e"},e=a.generationId,c=a.bundleHash;export{a as PUBLIC_PROJECTION_BUNDLE,c as PUBLIC_PROJECTION_BUNDLE_HASH,e as PUBLIC_PROJECTION_GENERATION_ID};
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { CacheProvider } from '../types/index.js';
|
|
14
14
|
import { type AuthRecoveryResultV1 } from './host-auth-recovery.js';
|
|
15
|
+
export declare const LICENSE_ACCESS_TOKEN_CACHE_KEY = "neocortex:jwt:token";
|
|
16
|
+
export declare const LICENSE_REFRESH_TOKEN_CACHE_KEY = "neocortex:jwt:refresh_token";
|
|
17
|
+
export declare const LICENSE_REFRESH_TOKEN_TTL_MS: number;
|
|
15
18
|
export interface LicenseClientOptions {
|
|
16
19
|
readonly serverUrl: string;
|
|
17
20
|
readonly licenseKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{decodeJwt as l}from"jose";import{NoOpCache as u}from"../types/index.js";import{getMachineFingerprint as f}from"../machine/fingerprint.js";import{CLIENT_VERSION as d}from"../version.js";import{classifyAuthCausalEvidence as h}from"./host-auth-recovery.js";const
|
|
1
|
+
import{decodeJwt as l}from"jose";import{NoOpCache as u}from"../types/index.js";import{getMachineFingerprint as f}from"../machine/fingerprint.js";import{CLIENT_VERSION as d}from"../version.js";import{classifyAuthCausalEvidence as h}from"./host-auth-recovery.js";const k="neocortex:jwt:token",y="neocortex:jwt:refresh_token",R=300,p=10080*60*1e3,a=k,c=y,o=p;class C{serverUrl;licenseKey;cache;clientVersion;machineId;strictReadOnly;causalAuthRecovery;token=null;refreshToken=null;lastRecoveryResult=null;constructor(e){this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.licenseKey=e.licenseKey,this.cache=e.cacheProvider??new u,this.clientVersion=e.clientVersion??d,this.strictReadOnly=e.strictReadOnly??!1,this.causalAuthRecovery=e.causalAuthRecovery??!1,this.machineId=f({strictReadOnly:this.strictReadOnly})}async getToken(){try{if(this.strictReadOnly){const t=await this.inspectToken();return t.status==="authenticated"?t.token:null}if(this.token){const t=this.checkTokenValidity(this.token);if(t==="valid")return this.token;if(t==="needs-refresh")return this.strictReadOnly?this.token:(await this.refresh())?.token??this.token;this.token=null}const e=await this.loadFromCache();if(e){this.token=e;const t=this.checkTokenValidity(e);if(t==="valid")return e;if(t==="needs-refresh")return this.strictReadOnly?e:(await this.refresh())?.token??e;this.token=null}if(this.strictReadOnly)return null;if(this.refreshToken||(this.refreshToken=await this.loadRefreshTokenFromCache()),this.refreshToken){const t=await this.refresh();if(t?.token)return t.token;if(this.causalAuthRecovery)return null}return(await this.activate())?.token??null}catch{return null}}async inspectToken(){try{const e=this.token??await this.loadFromCache();if(e){const t=this.checkTokenValidity(e);return t==="valid"?{status:"authenticated",token:e}:{status:"refresh-required",reason:t==="needs-refresh"?"near-expiry":"expired"}}const i=this.refreshToken??await this.loadRefreshTokenFromCache();return i?(this.refreshToken=i,{status:"refresh-required",reason:"expired"}):this.licenseKey?{status:"refresh-required",reason:"unavailable"}:{status:"not-configured"}}catch{return this.licenseKey?{status:"refresh-required",reason:"unavailable"}:{status:"not-configured"}}}getLastRecoveryResult(){return this.lastRecoveryResult}refreshRequired(e,i){return this.lastRecoveryResult={status:"refresh-required",cause:e,action:i},null}rememberRecovery(e){return this.lastRecoveryResult=e,null}async activate(){if(this.strictReadOnly)return null;try{const e=this.licenseKey.startsWith("nxk_"),i=e?"activate-key":"activate",t=e?{api_key:this.licenseKey}:{license_key:this.licenseKey},s=await fetch(`${this.serverUrl}/api/v1/license/${i}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,machine_id:this.machineId,client_version:this.clientVersion})});if(!s.ok){let n="";try{n=String((await s.json()).error??"")}catch{}return this.rememberRecovery(h({kind:"http",status:s.status,...n?{errorCode:n}:{}}))}const r=await s.json();return r.tier!==void 0&&r.tier!=="free"&&r.tier!=="pro"&&r.tier!=="enterprise"?null:(this.token=r.token,this.refreshToken=r.refresh_token??null,await this.cache.set(a,r.token,r.expires_in*1e3).catch(()=>{}),r.refresh_token&&await this.cache.set(c,r.refresh_token,o).catch(()=>{}),{token:r.token,expiresIn:r.expires_in,refreshToken:r.refresh_token,tier:r.tier})}catch{return this.rememberRecovery(h({kind:"transport"}))}}async refresh(e){if(this.strictReadOnly)return null;try{const i=this.refreshToken??await this.loadRefreshTokenFromCache();if(!i)return this.refreshRequired("store-unavailable","retry-later");const t=await fetch(`${this.serverUrl}/api/v1/license/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:i})});if(!t.ok){let r="";try{r=String((await t.json()).error??"")}catch{}return t.status===429?this.refreshRequired("rate-limited","retry-later"):t.status>=500?this.refreshRequired("service-unavailable","retry-later"):r==="invalid_grant"||r==="revoked"?this.refreshRequired("revoked","reactivate"):r==="invalid_scope"||r==="scope_denied"?this.refreshRequired("scope-denied","request-scope"):r==="client_denied"?this.refreshRequired("client-denied","stop"):this.refreshRequired("protocol-invalid","stop")}const s=await t.json();return this.token=s.token,this.refreshToken=s.refresh_token??null,await this.cache.set(a,s.token,s.expires_in*1e3).catch(()=>{}),s.refresh_token&&await this.cache.set(c,s.refresh_token,o).catch(()=>{}),this.lastRecoveryResult={status:"authenticated",generation:0,accessCredential:s.token,expiresAt:new Date(Date.now()+s.expires_in*1e3).toISOString()},{token:s.token,expiresIn:s.expires_in,refreshToken:s.refresh_token}}catch{return this.refreshRequired("transport-error","retry-later")}}async forceRefresh(){if(this.strictReadOnly)return null;try{const e=await this.refresh();return e?.token?e.token:this.causalAuthRecovery?null:(this.token=null,this.refreshToken=null,await this.cache.clear().catch(()=>{}),(await this.activate())?.token??null)}catch{return null}}checkTokenValidity(e){try{const i=l(e);if(!i.exp)return"expired";const t=Math.floor(Date.now()/1e3);return i.exp<=t?"expired":i.exp-t<=R?"needs-refresh":"valid"}catch{return"expired"}}async loadFromCache(){try{return await this.cache.get(a)}catch{return null}}async loadRefreshTokenFromCache(){try{const e=await this.cache.get(c);return e&&e.length>0?e:null}catch{return null}}}export{k as LICENSE_ACCESS_TOKEN_CACHE_KEY,y as LICENSE_REFRESH_TOKEN_CACHE_KEY,p as LICENSE_REFRESH_TOKEN_TTL_MS,C as LicenseClient};
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** Generated by scripts/generate-public-catalog-projections.mjs. Do not edit. */
|
|
2
2
|
export const PUBLIC_PROJECTION_BUNDLE = {
|
|
3
3
|
"schemaVersion": "PublicProjectionBundle/1.0",
|
|
4
|
-
"generationId": "sha256:
|
|
5
|
-
"sourceHash": "
|
|
6
|
-
"catalogHash": "
|
|
7
|
-
"publicProjectionHash": "
|
|
8
|
-
"stageProjectionHash": "
|
|
9
|
-
"compilationHash": "
|
|
4
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04",
|
|
5
|
+
"sourceHash": "137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04",
|
|
6
|
+
"catalogHash": "0f452979cb84c34476fd478379ee5c680d670f31065fb5ac51f19d1160f63c89",
|
|
7
|
+
"publicProjectionHash": "552f6aa4b4e6d121be460f9cde0c3bc0ef2284fcbd6d780ade4860d5e4032ed7",
|
|
8
|
+
"stageProjectionHash": "3492958695bf9d80c4db5e0ba63cf89f1b826df8282f24600018651ecabdaa3b",
|
|
9
|
+
"compilationHash": "ef6dbdd72a65ae50ea6379e04ab5381a91a2107c714986354f6f59a8ea53583c",
|
|
10
10
|
"registry": {
|
|
11
11
|
"version": "1.0.0",
|
|
12
12
|
"checksum": "184a2d616e0734fd3173d60889d74bae031280513831ec1f0a3a8c36959d2994"
|
|
@@ -16,41 +16,41 @@ export const PUBLIC_PROJECTION_BUNDLE = {
|
|
|
16
16
|
"kind": "catalog",
|
|
17
17
|
"schemaVersion": "ExecutableGraphCatalogPublicProjection/1.0",
|
|
18
18
|
"relativePath": "catalog.json",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "cef5eeebd75076c029e46bca28450eacbe329cb0f57151f6bc40faaecc4affdf",
|
|
20
20
|
"entryCount": 97,
|
|
21
|
-
"generationId": "sha256:
|
|
21
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"kind": "commands",
|
|
25
25
|
"schemaVersion": "CommandRegistryPublicProjection/1.0",
|
|
26
26
|
"relativePath": "commands.json",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "38e967e221ebab7605009c5113cdbd2f6b5b0243f17fd1006191c932a08c0779",
|
|
28
28
|
"entryCount": 62,
|
|
29
|
-
"generationId": "sha256:
|
|
29
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"kind": "progress-view",
|
|
33
33
|
"schemaVersion": "ProgressViewContractProjection/1.0",
|
|
34
34
|
"relativePath": "progress-view.json",
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "92e8e5f2866ad8e51839ba089db703f02ee2391f830e0baa87735719f442dd0b",
|
|
36
36
|
"entryCount": 1,
|
|
37
|
-
"generationId": "sha256:
|
|
37
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"kind": "stages",
|
|
41
41
|
"schemaVersion": "ExecutableGraphStageProjection/1.0",
|
|
42
42
|
"relativePath": "stages.json",
|
|
43
|
-
"sha256": "
|
|
43
|
+
"sha256": "f2fe325243c432718c2861a726fb2a53ee9c886f715acfd51ca7c82c92f68fd3",
|
|
44
44
|
"entryCount": 85,
|
|
45
|
-
"generationId": "sha256:
|
|
45
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"kind": "surfaces",
|
|
49
49
|
"schemaVersion": "PublicProjectionSurfaces/1.0",
|
|
50
50
|
"relativePath": "surfaces.json",
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "d38132db0ad2986acf9452cab72e5655d6f49e6aad4aab06c95245e0a16cf141",
|
|
52
52
|
"entryCount": 6,
|
|
53
|
-
"generationId": "sha256:
|
|
53
|
+
"generationId": "sha256:137c29f9194f93ba83d457dcd67a4df28f709c8c2bb42e883cb86553a03b4a04"
|
|
54
54
|
}
|
|
55
55
|
],
|
|
56
56
|
"compatibility": {
|
|
@@ -143,7 +143,7 @@ export const PUBLIC_PROJECTION_BUNDLE = {
|
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
145
|
"publicSafe": true,
|
|
146
|
-
"bundleHash": "
|
|
146
|
+
"bundleHash": "18f2220180f7ed7325900c609a29ad61ad66bf7fecfb55e0b441ef2cd55e886e"
|
|
147
147
|
};
|
|
148
148
|
export const PUBLIC_PROJECTION_GENERATION_ID = PUBLIC_PROJECTION_BUNDLE.generationId;
|
|
149
149
|
export const PUBLIC_PROJECTION_BUNDLE_HASH = PUBLIC_PROJECTION_BUNDLE.bundleHash;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex-root
|
|
3
|
-
description: "π§ Neocortex Root Agent v4.66.
|
|
3
|
+
description: "π§ Neocortex Root Agent v4.66.7 | OrNexus Team"
|
|
4
4
|
model: opus
|
|
5
5
|
color: blue
|
|
6
6
|
tools:
|
|
@@ -113,7 +113,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
113
113
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
114
114
|
β β
|
|
115
115
|
β ####### N E O C O R T E X β
|
|
116
|
-
β ### ######## v4.66.
|
|
116
|
+
β ### ######## v4.66.7 β
|
|
117
117
|
β ######### ##### β
|
|
118
118
|
β ## ############## Development Orchestrator β
|
|
119
119
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -102,7 +102,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
102
102
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
103
103
|
β β
|
|
104
104
|
β ####### N E O C O R T E X β
|
|
105
|
-
β ### ######## v4.66.
|
|
105
|
+
β ### ######## v4.66.7 β
|
|
106
106
|
β ######### ##### β
|
|
107
107
|
β ## ############## Development Orchestrator β
|
|
108
108
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "π§ Neocortex v4.66.
|
|
3
|
+
description: "π§ Neocortex v4.66.7 | OrNexus Team"
|
|
4
4
|
model: opus
|
|
5
5
|
color: blue
|
|
6
6
|
permissionMode: bypassPermissions
|
|
@@ -113,7 +113,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
113
113
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
114
114
|
β β
|
|
115
115
|
β ####### N E O C O R T E X β
|
|
116
|
-
β ### ######## v4.66.
|
|
116
|
+
β ### ######## v4.66.7 β
|
|
117
117
|
β ######### ##### β
|
|
118
118
|
β ## ############## Development Orchestrator β
|
|
119
119
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -32,7 +32,7 @@ Codex built-in commands or actions.
|
|
|
32
32
|
|
|
33
33
|
<!-- END: Plugin Conflict Prevention -->
|
|
34
34
|
|
|
35
|
-
# Neocortex v4.66.
|
|
35
|
+
# Neocortex v4.66.7 | OrNexus Team
|
|
36
36
|
|
|
37
37
|
You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
|
|
38
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "π§ Neocortex v4.66.
|
|
3
|
+
description: "π§ Neocortex v4.66.7 | OrNexus Team"
|
|
4
4
|
model: inherit
|
|
5
5
|
readonly: false
|
|
6
6
|
is_background: false
|
|
@@ -115,7 +115,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
115
115
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
116
116
|
β β
|
|
117
117
|
β ####### N E O C O R T E X β
|
|
118
|
-
β ### ######## v4.66.
|
|
118
|
+
β ### ######## v4.66.7 β
|
|
119
119
|
β ######### ##### β
|
|
120
120
|
β ## ############## Development Orchestrator β
|
|
121
121
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex-root
|
|
3
|
-
description: "π§ Neocortex v4.66.
|
|
3
|
+
description: "π§ Neocortex v4.66.7 | OrNexus Team"
|
|
4
4
|
kind: local
|
|
5
5
|
tools:
|
|
6
6
|
# File operations (Gemini CLI built-ins)
|
|
@@ -73,7 +73,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
73
73
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
74
74
|
β β
|
|
75
75
|
β ####### N E O C O R T E X β
|
|
76
|
-
β ### ######## v4.66.
|
|
76
|
+
β ### ######## v4.66.7 β
|
|
77
77
|
β ######### ##### β
|
|
78
78
|
β ## ############## Development Orchestrator β
|
|
79
79
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "π§ Neocortex v4.66.
|
|
3
|
+
description: "π§ Neocortex v4.66.7 | OrNexus Team"
|
|
4
4
|
kind: local
|
|
5
5
|
tools:
|
|
6
6
|
# File operations (Gemini CLI built-ins)
|
|
@@ -72,7 +72,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
72
72
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
73
73
|
β β
|
|
74
74
|
β ####### N E O C O R T E X β
|
|
75
|
-
β ### ######## v4.66.
|
|
75
|
+
β ### ######## v4.66.7 β
|
|
76
76
|
β ######### ##### β
|
|
77
77
|
β ## ############## Development Orchestrator β
|
|
78
78
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -74,7 +74,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
|
|
|
74
74
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
75
75
|
β β
|
|
76
76
|
β ####### N E O C O R T E X β
|
|
77
|
-
β ### ######## v4.66.
|
|
77
|
+
β ### ######## v4.66.7 β
|
|
78
78
|
β ######### ##### β
|
|
79
79
|
β ## ############## Development Orchestrator β
|
|
80
80
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -73,7 +73,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
|
|
|
73
73
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
74
74
|
β β
|
|
75
75
|
β ####### N E O C O R T E X β
|
|
76
|
-
β ### ######## v4.66.
|
|
76
|
+
β ### ######## v4.66.7 β
|
|
77
77
|
β ######### ##### β
|
|
78
78
|
β ## ############## Development Orchestrator β
|
|
79
79
|
β ## ### ###### ## OrNexus Team β
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "neocortex"
|
|
3
|
-
description: "Neocortex v4.66.
|
|
3
|
+
description: "Neocortex v4.66.7 | OrNexus Team"
|
|
4
4
|
tools:
|
|
5
5
|
# Read / Edit (built-in tool sets)
|
|
6
6
|
- read
|
|
@@ -82,7 +82,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
82
82
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
83
83
|
β β
|
|
84
84
|
β ####### N E O C O R T E X β
|
|
85
|
-
β ### ######## v4.66.
|
|
85
|
+
β ### ######## v4.66.7 β
|
|
86
86
|
β ######### ##### β
|
|
87
87
|
β ## ############## Development Orchestrator β
|
|
88
88
|
β ## ### ###### ## OrNexus Team β
|