@ornexus/neocortex 4.61.6 → 4.62.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 +31 -34
- package/install.sh +1 -1
- package/package.json +5 -2
- package/packages/client/dist/agent/update-description.d.ts +8 -1
- package/packages/client/dist/agent/update-description.js +2 -1
- package/packages/client/dist/commands/invoke.d.ts +17 -0
- package/packages/client/dist/commands/invoke.js +72 -72
- package/packages/client/dist/errors/frontmatter-diagnostics.d.ts +10 -1
- package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +24 -9
- package/packages/client/dist/git/direct-yolo-checkpoint.js +3 -4
- package/packages/client/dist/git/git-lifecycle-store.d.ts +66 -0
- package/packages/client/dist/git/git-lifecycle-store.js +8 -7
- package/packages/client/dist/git/release-gate-env.d.ts +62 -0
- package/packages/client/dist/git/release-gate-env.js +1 -0
- package/packages/client/dist/git/secure-filesystem-boundary.d.ts +24 -0
- package/packages/client/dist/git/secure-filesystem-boundary.js +20 -9
- package/packages/client/dist/runner/headless/child-env.d.ts +92 -0
- package/packages/client/dist/runner/headless/child-env.js +1 -0
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +11 -11
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +1 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +10 -10
- package/packages/client/dist/runner/headless/run-yoloop.js +2 -2
- package/packages/client/dist/yolo/invoke-envelope-capability.d.ts +2 -0
- package/packages/client/dist/yolo/invoke-envelope-capability.js +1 -1
- package/packages/client/dist/yolo/project-manifest-projection-collector.d.ts +28 -0
- package/packages/client/dist/yolo/project-manifest-projection-collector.js +1 -0
- package/packages/client/dist/yolo/spec-envelope-collector.d.ts +9 -0
- package/packages/client/dist/yolo/spec-envelope-collector.js +3 -3
- package/packages/client/dist/yoloop/shared-discover-epics.d.ts +16 -0
- package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1
- package/packages/shared/dist/frontmatter-context-contract.js +164 -52
- package/packages/shared/dist/project-manifest-projection.js +199 -0
- package/packages/shared/dist/project-validation-commands.js +14 -6
- package/packages/shared/dist/yolo/spec-envelope-rules.js +85 -0
- package/packages/shared/dist/yolo/spec-envelope.js +33 -7
- package/packages/shared/dist/yoloop/epic-terminal-git.js +94 -6
- package/packages/shared/dist/yoloop/story-write-scope.js +212 -0
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/install-antigravity.sh +13 -4
- 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.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +5 -5
- 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/lib/managed-config-merge.js +77 -1
- package/targets-stubs/lib/managed-profile.sh +7 -0
- package/targets-stubs/opencode/neocortex-root.md +1 -1
- package/targets-stubs/vscode/install-vscode.sh +21 -0
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
package/install.ps1
CHANGED
|
@@ -17,7 +17,7 @@ param(
|
|
|
17
17
|
[string]$ServerUrl = ('https://{0}.{1}.{2}' -f 'api','neocortex','sh')
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
$VERSION = "4.
|
|
20
|
+
$VERSION = "4.62.0"
|
|
21
21
|
|
|
22
22
|
# =============================================================================
|
|
23
23
|
# CONFIGURACOES
|
|
@@ -368,6 +368,21 @@ function Get-ManagedPlatformBase {
|
|
|
368
368
|
return $DefaultBase
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
+
# P226.13: true when a destination resolves to the user home. A global install
|
|
372
|
+
# targets the home; project folders (.github\*, .agent\*) must never be created
|
|
373
|
+
# there. Only guards creation; nothing is ever removed.
|
|
374
|
+
function Test-NeocortexUserHome {
|
|
375
|
+
param([string]$Path, [string]$HomePath = $env:USERPROFILE)
|
|
376
|
+
if (-not $Path -or -not $HomePath) { return $false }
|
|
377
|
+
try {
|
|
378
|
+
$candidate = [System.IO.Path]::GetFullPath($Path).TrimEnd('\', '/')
|
|
379
|
+
$homeFull = [System.IO.Path]::GetFullPath($HomePath).TrimEnd('\', '/')
|
|
380
|
+
} catch {
|
|
381
|
+
return $false
|
|
382
|
+
}
|
|
383
|
+
return [string]::Equals($candidate, $homeFull, [System.StringComparison]::OrdinalIgnoreCase)
|
|
384
|
+
}
|
|
385
|
+
|
|
371
386
|
# =============================================================================
|
|
372
387
|
# ACL HELPERS (Story 66.1 - Windows file permission hardening)
|
|
373
388
|
# Fail-open: never throws, never blocks installation
|
|
@@ -1465,28 +1480,16 @@ function Install-Targets {
|
|
|
1465
1480
|
# P201.08: preserve existing agents/skills; update owned files only.
|
|
1466
1481
|
|
|
1467
1482
|
# P124.02: source filename is neocortex.agent.md (canonical Custom Agents extension).
|
|
1483
|
+
# P226.13: global install never creates project folders (.github\*) in
|
|
1484
|
+
# the home; the user-level Custom Agents location is ~/.copilot/agents.
|
|
1468
1485
|
if (Test-Path "$vscodeTargetDir\neocortex.agent.md") {
|
|
1469
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\agents" -Force | Out-Null
|
|
1470
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.github\agents\neocortex.agent.md" -ManagedId "profile-vscode-neocortex-agent" -BaseDir $homeDir | Out-Null
|
|
1471
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.github\agents\neocortex.md" -ManagedId "profile-vscode-neocortex-compat" -BaseDir $homeDir | Out-Null
|
|
1472
1486
|
New-Item -ItemType Directory -Path "$homeDir\.copilot\agents" -Force | Out-Null
|
|
1473
1487
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.copilot\agents\neocortex.agent.md" -ManagedId "profile-copilot-neocortex-agent" -BaseDir $homeDir | Out-Null
|
|
1474
1488
|
}
|
|
1475
|
-
if (Test-Path "$vscodeTargetDir\instructions" -PathType Container) {
|
|
1476
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\instructions" -Force | Out-Null
|
|
1477
|
-
Copy-Item -Path "$vscodeTargetDir\instructions\*.instructions.md" -Destination "$homeDir\.github\instructions\" -Force -ErrorAction SilentlyContinue
|
|
1478
|
-
}
|
|
1479
|
-
if (Test-Path "$vscodeTargetDir\prompts" -PathType Container) {
|
|
1480
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\prompts" -Force | Out-Null
|
|
1481
|
-
Copy-Item -Path "$vscodeTargetDir\prompts\*.prompt.md" -Destination "$homeDir\.github\prompts\" -Force -ErrorAction SilentlyContinue
|
|
1482
|
-
}
|
|
1483
1489
|
if (Test-Path "$vscodeTargetDir\mcp.json") {
|
|
1484
1490
|
# User-level additive merge -- preserves user-defined servers (root key is "servers" in VS Code)
|
|
1485
1491
|
Merge-JsonMcpConfig -StubFile "$vscodeTargetDir\mcp.json" -DestFile (Get-VsCodeUserMcpPath) -RootKey "servers"
|
|
1486
1492
|
}
|
|
1487
|
-
if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
|
|
1488
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\copilot-instructions.md" -Destination "$homeDir\.github\copilot-instructions.md" -ManagedId "profile-vscode-copilot-instructions" -BaseDir $homeDir | Out-Null
|
|
1489
|
-
}
|
|
1490
1493
|
Write-Ok "vscode"
|
|
1491
1494
|
$script:TargetResults += "$target`:OK"
|
|
1492
1495
|
$script:TargetCount++
|
|
@@ -1582,22 +1585,11 @@ function Install-Targets {
|
|
|
1582
1585
|
$geminiHome = if ($env:GEMINI_HOME) { $env:GEMINI_HOME } else { "$homeDir\.gemini" }
|
|
1583
1586
|
if ($antiTargetDir -and (Test-Path $antiTargetDir -PathType Container)) {
|
|
1584
1587
|
# NOTE: Do NOT recursively delete $geminiHome\antigravity -- merge mcp_config.json instead
|
|
1585
|
-
|
|
1586
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\skills\neocortex" -Force | Out-Null
|
|
1587
|
-
Copy-ManagedFile -Source "$antiTargetDir\skill\SKILL.md" -Destination "$homeDir\.agent\skills\neocortex\SKILL.md" -ManagedId "profile-antigravity-skill" -BaseDir $homeDir | Out-Null
|
|
1588
|
-
}
|
|
1588
|
+
# P226.13: global install never creates project folders (.agent\*) in the home.
|
|
1589
1589
|
if (Test-Path "$antiTargetDir\neocortex.md") {
|
|
1590
1590
|
New-Item -ItemType Directory -Path "$geminiHome\config\agents" -Force | Out-Null
|
|
1591
1591
|
Copy-ManagedFile -Source "$antiTargetDir\neocortex.md" -Destination "$geminiHome\config\agents\neocortex.md" -ManagedId "profile-antigravity-neocortex" -BaseDir $geminiHome | Out-Null
|
|
1592
1592
|
}
|
|
1593
|
-
if (Test-Path "$antiTargetDir\rules" -PathType Container) {
|
|
1594
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\rules" -Force | Out-Null
|
|
1595
|
-
Copy-Item -Path "$antiTargetDir\rules\*.md" -Destination "$homeDir\.agent\rules\" -Force -ErrorAction SilentlyContinue
|
|
1596
|
-
}
|
|
1597
|
-
if (Test-Path "$antiTargetDir\workflows" -PathType Container) {
|
|
1598
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\workflows" -Force | Out-Null
|
|
1599
|
-
Copy-Item -Path "$antiTargetDir\workflows\*.md" -Destination "$homeDir\.agent\workflows\" -Force -ErrorAction SilentlyContinue
|
|
1600
|
-
}
|
|
1601
1593
|
if (Test-Path "$antiTargetDir\mcp-config.json") {
|
|
1602
1594
|
New-Item -ItemType Directory -Path "$geminiHome\antigravity" -Force | Out-Null
|
|
1603
1595
|
# Antigravity uses root mcpServers; preserve custom entries while migrating managed legacy top-level entries.
|
|
@@ -1784,21 +1776,24 @@ function New-ProjectDirectories {
|
|
|
1784
1776
|
"vscode" {
|
|
1785
1777
|
$vscodeTargetDir = Resolve-TargetDir -Target "vscode"
|
|
1786
1778
|
if ($vscodeTargetDir -and (Test-Path $vscodeTargetDir -PathType Container)) {
|
|
1779
|
+
# P226.13: a project directory that resolves to the home is a global
|
|
1780
|
+
# destination; skip project folders there (nothing is removed).
|
|
1781
|
+
$vscodeProjectIsHome = Test-NeocortexUserHome -Path $projectDir
|
|
1787
1782
|
# P124.02: source filename is neocortex.agent.md (canonical Custom Agents extension).
|
|
1788
|
-
if (Test-Path "$vscodeTargetDir\neocortex.agent.md") {
|
|
1783
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\neocortex.agent.md")) {
|
|
1789
1784
|
New-Item -ItemType Directory -Path "$projectDir\.github\agents" -Force | Out-Null
|
|
1790
1785
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$projectDir\.github\agents\neocortex.agent.md" -ManagedId "project-vscode-neocortex-agent" -BaseDir $projectDir | Out-Null
|
|
1791
1786
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$projectDir\.github\agents\neocortex.md" -ManagedId "project-vscode-neocortex-compat" -BaseDir $projectDir | Out-Null
|
|
1792
1787
|
}
|
|
1793
|
-
if (Test-Path "$vscodeTargetDir\instructions" -PathType Container) {
|
|
1788
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\instructions" -PathType Container)) {
|
|
1794
1789
|
New-Item -ItemType Directory -Path "$projectDir\.github\instructions" -Force | Out-Null
|
|
1795
1790
|
Copy-Item -Path "$vscodeTargetDir\instructions\*.instructions.md" -Destination "$projectDir\.github\instructions\" -Force -ErrorAction SilentlyContinue
|
|
1796
1791
|
}
|
|
1797
|
-
if (Test-Path "$vscodeTargetDir\prompts" -PathType Container) {
|
|
1792
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\prompts" -PathType Container)) {
|
|
1798
1793
|
New-Item -ItemType Directory -Path "$projectDir\.github\prompts" -Force | Out-Null
|
|
1799
1794
|
Copy-Item -Path "$vscodeTargetDir\prompts\*.prompt.md" -Destination "$projectDir\.github\prompts\" -Force -ErrorAction SilentlyContinue
|
|
1800
1795
|
}
|
|
1801
|
-
if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
|
|
1796
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\copilot-instructions.md")) {
|
|
1802
1797
|
Copy-ManagedFile -Source "$vscodeTargetDir\copilot-instructions.md" -Destination "$projectDir\.github\copilot-instructions.md" -ManagedId "project-vscode-copilot-instructions" -BaseDir $projectDir | Out-Null
|
|
1803
1798
|
}
|
|
1804
1799
|
$targetSummary += "vscode"
|
|
@@ -1845,7 +1840,9 @@ function New-ProjectDirectories {
|
|
|
1845
1840
|
"antigravity" {
|
|
1846
1841
|
$antiTargetDir = Resolve-TargetDir -Target "antigravity"
|
|
1847
1842
|
if ($antiTargetDir -and (Test-Path $antiTargetDir -PathType Container)) {
|
|
1848
|
-
|
|
1843
|
+
# P226.13: skip project .agent\* folders when the project resolves to the home.
|
|
1844
|
+
$antiProjectIsHome = Test-NeocortexUserHome -Path $projectDir
|
|
1845
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\skill\SKILL.md")) {
|
|
1849
1846
|
New-Item -ItemType Directory -Path "$projectDir\.agent\skills\neocortex" -Force | Out-Null
|
|
1850
1847
|
Copy-ManagedFile -Source "$antiTargetDir\skill\SKILL.md" -Destination "$projectDir\.agent\skills\neocortex\SKILL.md" -ManagedId "project-antigravity-skill" -BaseDir $projectDir | Out-Null
|
|
1851
1848
|
}
|
|
@@ -1853,11 +1850,11 @@ function New-ProjectDirectories {
|
|
|
1853
1850
|
New-Item -ItemType Directory -Path "$projectDir\.agents\agents" -Force | Out-Null
|
|
1854
1851
|
Copy-ManagedFile -Source "$antiTargetDir\neocortex.md" -Destination "$projectDir\.agents\agents\neocortex.md" -ManagedId "project-antigravity-neocortex" -BaseDir $projectDir | Out-Null
|
|
1855
1852
|
}
|
|
1856
|
-
if (Test-Path "$antiTargetDir\rules" -PathType Container) {
|
|
1853
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\rules" -PathType Container)) {
|
|
1857
1854
|
New-Item -ItemType Directory -Path "$projectDir\.agent\rules" -Force | Out-Null
|
|
1858
1855
|
Copy-Item -Path "$antiTargetDir\rules\*.md" -Destination "$projectDir\.agent\rules\" -Force -ErrorAction SilentlyContinue
|
|
1859
1856
|
}
|
|
1860
|
-
if (Test-Path "$antiTargetDir\workflows" -PathType Container) {
|
|
1857
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\workflows" -PathType Container)) {
|
|
1861
1858
|
New-Item -ItemType Directory -Path "$projectDir\.agent\workflows" -Force | Out-Null
|
|
1862
1859
|
Copy-Item -Path "$antiTargetDir\workflows\*.md" -Destination "$projectDir\.agent\workflows\" -Force -ErrorAction SilentlyContinue
|
|
1863
1860
|
}
|
package/install.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornexus/neocortex",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Neocortex v4.
|
|
3
|
+
"version": "4.62.0",
|
|
4
|
+
"description": "Neocortex v4.62.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"packages/shared/dist/strict-readonly.js",
|
|
59
59
|
"packages/shared/dist/frontmatter-context-contract.js",
|
|
60
60
|
"packages/shared/dist/yolo/spec-envelope.js",
|
|
61
|
+
"packages/shared/dist/yolo/spec-envelope-rules.js",
|
|
61
62
|
"packages/shared/dist/yolo/change-evidence.js",
|
|
62
63
|
"packages/shared/dist/invocation/",
|
|
63
64
|
"packages/shared/dist/compatibility/index.js",
|
|
@@ -85,9 +86,11 @@
|
|
|
85
86
|
"packages/shared/dist/yoloop/epic-terminal-git.js",
|
|
86
87
|
"packages/shared/dist/yoloop/operational-budget.js",
|
|
87
88
|
"packages/shared/dist/yoloop/host-capacity.js",
|
|
89
|
+
"packages/shared/dist/project-manifest-projection.js",
|
|
88
90
|
"packages/shared/dist/yoloop/wave-decision-receipt.js",
|
|
89
91
|
"packages/shared/dist/yoloop/planning-graph.js",
|
|
90
92
|
"packages/shared/dist/yoloop/public-story-write-set.js",
|
|
93
|
+
"packages/shared/dist/yoloop/story-write-scope.js",
|
|
91
94
|
"packages/shared/dist/yoloop/recovery-types.js",
|
|
92
95
|
"packages/shared/dist/yoloop/release-blocked.js",
|
|
93
96
|
"!packages/client/dist/**/*.js.map",
|
|
@@ -27,6 +27,13 @@ export declare function buildDescription(version: string, tier: string): string;
|
|
|
27
27
|
* Returns 'free' if config doesn't exist or tier is missing.
|
|
28
28
|
*/
|
|
29
29
|
export declare function readTierFromConfig(): string;
|
|
30
|
+
export interface DescriptionPatchOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Managed base whose `.neocortex/managed-config-manifest.json` owns the file.
|
|
33
|
+
* Defaults to HOME. Project-level files use the project root.
|
|
34
|
+
*/
|
|
35
|
+
managedBaseDir?: string;
|
|
36
|
+
}
|
|
30
37
|
/**
|
|
31
38
|
* Update agent descriptions across ALL known platform files:
|
|
32
39
|
* 1. Home-level files (Claude Code, Gemini CLI)
|
|
@@ -42,4 +49,4 @@ export declare function updateAgentDescription(version: string, tier?: string):
|
|
|
42
49
|
*
|
|
43
50
|
* Never throws -- description update is non-critical.
|
|
44
51
|
*/
|
|
45
|
-
export declare function updateAgentDescriptionAt(filePath: string, type: 'yaml' | 'h1', version: string, tier?: string): boolean;
|
|
52
|
+
export declare function updateAgentDescriptionAt(filePath: string, type: 'yaml' | 'h1', version: string, tier?: string, options?: DescriptionPatchOptions): boolean;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{readFileSync as d,writeFileSync as
|
|
1
|
+
import{readFileSync as d,writeFileSync as E,existsSync as m,lstatSync as S,mkdirSync as D,renameSync as j,unlinkSync as k,chmodSync as w}from"node:fs";import{execSync as C}from"node:child_process";import{createHash as M,randomBytes as H}from"node:crypto";import{basename as G,dirname as A,isAbsolute as V,join as c,relative as J,resolve as T,sep as W}from"node:path";import{homedir as p}from"node:os";const x=c(p(),".neocortex","config.json"),I={free:"Free",pro:"Pro",enterprise:"Enterprise"},q=60,K=25,b=/^description:\s*".*"$/m,_=/^# 🧠 Neocortex v[\d.]+(?:\s*\([^)]+\)\s*\| OrNexus Team|\s*-\s*Development Orchestrator \| OrNexus Team \([^)]+\))$/m,R=/^│ ### ######## v[\d.]+\s*│$/m,v=/^│ ## ### ###### ## OrNexus Team \([^)]*\)\s*│$/m,X=[{path:c(p(),".claude","agents","neocortex.md"),type:"yaml",fallbackPaths:[c(p(),".claude","agents","neocortex","neocortex.md")]},{path:c(p(),".gemini","agents","agent.md"),type:"yaml"}],Y=[{relativePath:c(".cursor","agents","neocortex.md"),type:"yaml"},{relativePath:c(".github","agents","neocortex.md"),type:"yaml"},{relativePath:"AGENTS.md",type:"h1"},{relativePath:c(".agent","skills","neocortex","SKILL.md"),type:"yaml"}];function z(){try{return C("git rev-parse --show-toplevel",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}function O(e,r){const t=q-K-r.length,n=t>0?" ".repeat(t):"";return`${e}${r}${n}\u2502`}function Q(e){return O("\u2502 ### ######## ",`v${e}`)}function U(e){const r=I[e.toLowerCase()]??"Free";return O("\u2502 ## ### ###### ## ",`OrNexus Team (${r})`)}function F(e,r){const t=I[r.toLowerCase()]??"Free";return`\u{1F9E0} Neocortex v${e} (${t}) | OrNexus Team`}function L(){try{if(m(x)){const e=d(x,"utf-8");return JSON.parse(e).tier??"free"}}catch{}return"free"}function Z(e,r,t){let n=e;return R.test(n)&&(n=n.replace(R,Q(r))),v.test(n)&&(n=n.replace(v,U(t))),n}const ee=1,te="[P201-EV-INSTALLER]";function h(e){return M("sha256").update(e).digest("hex")}function $(e,r){D(A(e),{recursive:!0,mode:448});const t=c(A(e),`.${G(e)}.neocortex-tmp-${process.pid}-${H(6).toString("hex")}`);try{E(t,r,{mode:384});try{w(t,384)}catch{}j(t,e)}catch(n){try{m(t)&&k(t)}catch{}throw n}}function ne(e,r,t){try{if(S(e).isSymbolicLink())return null;const n=T(r),i=J(n,T(e));if(!i||i.startsWith("..")||V(i))return null;const a=i.split(W).join("/"),s=c(n,".neocortex","managed-config-manifest.json");if(!m(s)||S(s).isSymbolicLink())return null;const o=d(s),l=JSON.parse(o.toString("utf8").replace(/^/,""));if(!l||typeof l!="object"||Array.isArray(l))return null;const u=l;if(u.schemaVersion!==ee||u.evidence!==te)return null;const f=u.entries;if(!f||typeof f!="object"||Array.isArray(f))return null;const g=Object.entries(f).filter(([,y])=>!!y&&typeof y=="object"&&y.relativePath===a);if(g.length!==1)return null;const[P,B]=g[0];return B.installedHash!==h(t)?null:{manifestFile:s,manifestBytes:o,manifest:u,entryId:P,baseDir:n}}catch{return null}}function re(e,r){try{const t=d(e.manifestFile);if(!t.equals(e.manifestBytes))return!1;const n=new Date().toISOString(),i=`managed-config-manifest-${n.replace(/[:.]/g,"-")}-${h(t).slice(0,12)}.bak`;return $(c(e.baseDir,".neocortex","backups","managed-config",i),t),e.manifest.entries[e.entryId]={...e.manifest.entries[e.entryId],installedHash:h(r),action:"post-process-reconciled",updatedAt:n},$(e.manifestFile,Buffer.from(`${JSON.stringify(e.manifest,null,2)}
|
|
2
|
+
`,"utf8")),!0}catch{return!1}}function N(e,r,t,n,i,a=p()){try{if(!m(e))return!1;const s=d(e);let o=s.toString("utf-8");const l=o;if(r==="yaml"?b.test(o)&&(o=o.replace(b,`description: "${t}"`)):_.test(o)&&(o=o.replace(_,`# ${t}`)),o=Z(o,n,i),o===l)return!1;const u=ne(e,a,s),f=Buffer.from(o,"utf-8");return E(e,f),u&&re(u,f),!0}catch{return!1}}function le(e,r){const t=r??L(),n=F(e,t);let i=0;for(const{path:s,type:o,fallbackPaths:l}of X){const u=m(s)?s:l?.find(f=>m(f))??s;N(u,o,n,e,t)&&i++}const a=z();if(a)for(const{relativePath:s,type:o}of Y){const l=c(a,s);N(l,o,n,e,t,a)&&i++}return i}function ue(e,r,t,n,i){const a=n??L(),s=F(t,a);return N(e,r,s,t,a,i?.managedBaseDir??p())}export{U as buildBannerTierLine,Q as buildBannerVersionLine,F as buildDescription,L as readTierFromConfig,le as updateAgentDescription,ue as updateAgentDescriptionAt};
|
|
@@ -10,11 +10,19 @@ import type { ProjectEvidenceEnvelope } from '../evidence/types.js';
|
|
|
10
10
|
import { detectNativeHostAttestation } from '../adapters/platform-detector.js';
|
|
11
11
|
import { type YoloSpecEnvelopeV1 } from '../../../shared/dist/yolo/spec-envelope.js';
|
|
12
12
|
import type { YoloChangeEvidence } from '../../../shared/dist/yolo/change-evidence.js';
|
|
13
|
+
import type { ProjectManifestProjectionAttachment } from '../../../shared/dist/project-manifest-projection.js';
|
|
13
14
|
import { type ReleaseGateRequestV1 } from '../../../shared/dist/yoloop/release-blocked.js';
|
|
14
15
|
import { type InvokeEffectContext, type StrictReadOnlyInvokeEnvelope } from '../../../shared/dist/strict-readonly.js';
|
|
15
16
|
import { type ExplicitIntentRecoveryBindingV1, type ExplicitIntentRecoveryResultV1, type InvokeInputEvidenceV1, type InvokeInputEnvelopeV2, type InvokeInputSourceV2, type InvocationMalformedInputReasonV1, type InvocationAdmissionResultV1, type ProjectIdentityMigrationRequestV1 } from '../../../shared/dist/invocation/index.js';
|
|
16
17
|
import { type CompatibilityOfferV1, type CompatibilityResultV1 } from '../../../shared/dist/compatibility/index.js';
|
|
17
18
|
import { type P205TransientExecutionAuthority } from '../git/git-lifecycle-store.js';
|
|
19
|
+
/**
|
|
20
|
+
* P226.04: the collector may fail with the bounded per-field frontmatter code
|
|
21
|
+
* (`frontmatter-list-too-long:<field>:<n>><limit>`); surface it verbatim instead
|
|
22
|
+
* of collapsing it into `yolo-spec-envelope-unsafe`. Only known field labels and
|
|
23
|
+
* integers match, so no rejected value is reflected.
|
|
24
|
+
*/
|
|
25
|
+
export declare function publicYoloSpecEnvelopeErrorCode(error: unknown, allowChangeEvidence?: boolean): string;
|
|
18
26
|
export declare const INVOKE_PAYLOAD_LIMIT_BYTES: number;
|
|
19
27
|
export declare const INVOKE_PAYLOAD_WARNING_THRESHOLD_BYTES: number;
|
|
20
28
|
type EpicClaimCommand = 'create-epic' | 'idea-diagnose';
|
|
@@ -570,6 +578,8 @@ interface InvokeRequestBodyBase {
|
|
|
570
578
|
readonly strictReadOnly?: StrictReadOnlyInvokeEnvelope;
|
|
571
579
|
readonly yoloSpecEnvelope?: YoloSpecEnvelopeV1;
|
|
572
580
|
readonly yoloChangeEvidence?: YoloChangeEvidence;
|
|
581
|
+
/** P226.09 optional planning projection; sent only when the server advertises it. */
|
|
582
|
+
readonly projectManifestProjection?: ProjectManifestProjectionAttachment;
|
|
573
583
|
}
|
|
574
584
|
export type InvokeRequestBody = InvokeRequestBodyBase & ({
|
|
575
585
|
readonly args: string;
|
|
@@ -681,6 +691,13 @@ export declare function boundedP222PremergeCheckpointPositions(projectRoot: stri
|
|
|
681
691
|
readonly headSha: string;
|
|
682
692
|
readonly position: number;
|
|
683
693
|
}>;
|
|
694
|
+
/**
|
|
695
|
+
* Public reason for a failed invoke-time P205 projection. Typed P226 gate
|
|
696
|
+
* reasons (P226-CON-GATE-REASONS) survive verbatim; anything else that is not
|
|
697
|
+
* a bounded `p205-*`/`git-lifecycle-*` code collapses to the generic reason.
|
|
698
|
+
* The projection itself stays fail-closed regardless of the reason.
|
|
699
|
+
*/
|
|
700
|
+
export declare function invokeP205ProjectionReasonCode(error: unknown): string;
|
|
684
701
|
export declare function collectInvokeP205Authorities(projectRoot: string, args: string, commandId: string | null | undefined): Promise<Readonly<Record<string, P205TransientExecutionAuthority>>>;
|
|
685
702
|
export declare function createFullStateSnapshotScope(trigger: string, snapshot: Pick<StateSnapshot, 'stories' | 'epics'>): FullStateSnapshotScope;
|
|
686
703
|
interface SendResult {
|