@ornexus/neocortex 3.9.27 → 3.9.29
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/install.js +10 -2
- package/install.ps1 +85 -22
- package/install.sh +1 -1
- package/package.json +2 -2
- package/packages/client/dist/config/secure-config.js +3 -1
- package/postinstall.js +95 -13
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/skill/SKILL.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/vscode/agent.md +2 -2
package/install.js
CHANGED
|
@@ -41,7 +41,13 @@ const PLATFORMS = [
|
|
|
41
41
|
function detectPlatform(command) {
|
|
42
42
|
const { execSync } = require('child_process');
|
|
43
43
|
try {
|
|
44
|
-
|
|
44
|
+
// Platform-aware detection: `where.exe` on Windows, `which` on Unix
|
|
45
|
+
// `which` does not exist natively on Windows (Epic 63 - Story 63.4)
|
|
46
|
+
if (process.platform === 'win32') {
|
|
47
|
+
execSync(`where ${command} 2>NUL`, { stdio: 'pipe' });
|
|
48
|
+
} else {
|
|
49
|
+
execSync(`which ${command} 2>/dev/null`, { stdio: 'pipe' });
|
|
50
|
+
}
|
|
45
51
|
return true;
|
|
46
52
|
} catch {
|
|
47
53
|
return false;
|
|
@@ -410,7 +416,9 @@ async function main() {
|
|
|
410
416
|
log.info('');
|
|
411
417
|
} else {
|
|
412
418
|
try {
|
|
413
|
-
|
|
419
|
+
// Strip UTF-8 BOM if present (PowerShell 5.1 writes BOM via Out-File -Encoding utf8)
|
|
420
|
+
// Defense in depth: handles configs written by old PS 5.1 installers (Epic 63 - Story 63.1)
|
|
421
|
+
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf-8').replace(/^\uFEFF/, ''));
|
|
414
422
|
if (cfg.mode === 'remote') {
|
|
415
423
|
log.info(color.dim(`Remote mode active (server: ${cfg.serverUrl || 'default'})`));
|
|
416
424
|
}
|
package/install.ps1
CHANGED
|
@@ -15,7 +15,7 @@ param(
|
|
|
15
15
|
[string]$ServerUrl = "https://api.neocortex.ornexus.com"
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
-
$VERSION = "3.9.
|
|
18
|
+
$VERSION = "3.9.29"
|
|
19
19
|
|
|
20
20
|
# =============================================================================
|
|
21
21
|
# CONFIGURACOES
|
|
@@ -125,6 +125,23 @@ function Write-Dbg {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
# =============================================================================
|
|
129
|
+
# UTF-8 BOM-FREE WRITE HELPER (Epic 63 - Story 63.1)
|
|
130
|
+
# PowerShell 5.1 writes UTF-8 WITH BOM via Out-File -Encoding utf8 and
|
|
131
|
+
# Set-Content -Encoding utf8. Node.js JSON.parse fails on BOM prefix.
|
|
132
|
+
# This helper uses .NET API to write UTF-8 WITHOUT BOM, compatible with
|
|
133
|
+
# both PowerShell 5.1 and 7+.
|
|
134
|
+
# =============================================================================
|
|
135
|
+
|
|
136
|
+
function Write-Utf8NoBom {
|
|
137
|
+
param(
|
|
138
|
+
[string]$Path,
|
|
139
|
+
[string]$Content
|
|
140
|
+
)
|
|
141
|
+
$utf8NoBom = [System.Text.UTF8Encoding]::new($false)
|
|
142
|
+
[System.IO.File]::WriteAllText($Path, $Content, $utf8NoBom)
|
|
143
|
+
}
|
|
144
|
+
|
|
128
145
|
function Read-HostWithTimeout {
|
|
129
146
|
param([int]$TimeoutSeconds = 10, [string]$Default = "n")
|
|
130
147
|
try {
|
|
@@ -210,19 +227,30 @@ function Get-SourceDirectory {
|
|
|
210
227
|
}
|
|
211
228
|
Write-Dbg "Source: $script:SourceDir"
|
|
212
229
|
|
|
213
|
-
if (-not (Test-Path "$script:SourceDir\targets\claude-code\neocortex.md") -and
|
|
230
|
+
if (-not (Test-Path "$script:SourceDir\targets-stubs\claude-code\neocortex.md") -and
|
|
231
|
+
-not (Test-Path "$script:SourceDir\targets\claude-code\neocortex.md") -and
|
|
214
232
|
-not (Test-Path "$script:SourceDir\neocortex.md")) {
|
|
215
233
|
$possibleDirs = @(
|
|
216
234
|
$script:SourceDir,
|
|
235
|
+
# Scoped paths (primary) -- npm publishes as @ornexus/neocortex
|
|
236
|
+
"$env:APPDATA\npm\node_modules\@ornexus\neocortex",
|
|
237
|
+
"$env:LOCALAPPDATA\npm-cache\_npx\*\node_modules\@ornexus\neocortex",
|
|
238
|
+
".\node_modules\@ornexus\neocortex",
|
|
239
|
+
# Unscoped paths (fallback for backward compat)
|
|
217
240
|
"$env:APPDATA\npm\node_modules\neocortex",
|
|
218
241
|
"$env:LOCALAPPDATA\npm-cache\_npx\*\node_modules\neocortex",
|
|
219
242
|
".\node_modules\neocortex"
|
|
220
243
|
)
|
|
221
244
|
foreach ($dir in $possibleDirs) {
|
|
245
|
+
# Epic 64 (Story 64.6): Debug each possibleDir tested
|
|
246
|
+
Write-Dbg "Get-SourceDirectory: testing $dir"
|
|
222
247
|
$expandedDirs = Get-Item $dir -ErrorAction SilentlyContinue
|
|
223
248
|
foreach ($expanded in $expandedDirs) {
|
|
224
|
-
|
|
225
|
-
Test-Path "$($expanded.FullName)\neocortex.md")
|
|
249
|
+
$found = (Test-Path "$($expanded.FullName)\targets-stubs\claude-code\neocortex.md") -or
|
|
250
|
+
(Test-Path "$($expanded.FullName)\targets\claude-code\neocortex.md") -or
|
|
251
|
+
(Test-Path "$($expanded.FullName)\neocortex.md")
|
|
252
|
+
Write-Dbg "Get-SourceDirectory: $($expanded.FullName) found=$found"
|
|
253
|
+
if ($found) {
|
|
226
254
|
$script:SourceDir = $expanded.FullName
|
|
227
255
|
break
|
|
228
256
|
}
|
|
@@ -478,6 +506,10 @@ function Verify-Installation {
|
|
|
478
506
|
foreach ($entry in $criticalFiles) {
|
|
479
507
|
$fpath = Join-Path $script:DestDir $entry.Name
|
|
480
508
|
$fname = $entry.Name
|
|
509
|
+
# Epic 64 (Story 64.6): Debug file verification details
|
|
510
|
+
$fileExists = Test-Path $fpath -PathType Leaf
|
|
511
|
+
$fileSize = if ($fileExists) { (Get-Item $fpath).Length } else { 0 }
|
|
512
|
+
Write-Dbg "Verify-Installation: $fname exists=$fileExists size=$fileSize path=$fpath"
|
|
481
513
|
|
|
482
514
|
if (-not (Test-Path $fpath -PathType Leaf)) {
|
|
483
515
|
$report += @{ Status = "FAIL"; Detail = "$fname (nao encontrado)" }
|
|
@@ -567,7 +599,16 @@ function Verify-Installation {
|
|
|
567
599
|
return $true
|
|
568
600
|
}
|
|
569
601
|
|
|
570
|
-
|
|
602
|
+
# Epic 64 (Story 64.3): In quiet mode, report FAILs before returning
|
|
603
|
+
if ($QUIET_MODE) {
|
|
604
|
+
if ($fails -gt 0) {
|
|
605
|
+
# Critical failures MUST be visible even in quiet mode
|
|
606
|
+
Write-Fail "Verificacao falhou: $fails arquivo(s) critico(s) faltando"
|
|
607
|
+
foreach ($entry in ($report | Where-Object { $_.Status -eq "FAIL" })) {
|
|
608
|
+
Write-Fail " $($entry.Detail)"
|
|
609
|
+
}
|
|
610
|
+
return $false
|
|
611
|
+
}
|
|
571
612
|
return $true # In quiet mode, skip warnings-only report
|
|
572
613
|
}
|
|
573
614
|
|
|
@@ -613,7 +654,7 @@ function Set-ThinClientConfig {
|
|
|
613
654
|
if ($existingConfig.tier -eq 3 -and $existingConfig.mode -eq "pending-activation") {
|
|
614
655
|
$existingConfig.PSObject.Properties.Remove("tier")
|
|
615
656
|
}
|
|
616
|
-
$existingConfig | ConvertTo-Json -Depth 5
|
|
657
|
+
Write-Utf8NoBom -Path $configFile -Content ($existingConfig | ConvertTo-Json -Depth 5)
|
|
617
658
|
Write-Dbg "Config migrada para configVersion 1"
|
|
618
659
|
} catch {
|
|
619
660
|
Write-Dbg "Falha na migracao do config: $_"
|
|
@@ -638,7 +679,7 @@ function Set-ThinClientConfig {
|
|
|
638
679
|
installerVersion = $VERSION
|
|
639
680
|
}
|
|
640
681
|
|
|
641
|
-
$config | ConvertTo-Json -Depth 5
|
|
682
|
+
Write-Utf8NoBom -Path $configFile -Content ($config | ConvertTo-Json -Depth 5)
|
|
642
683
|
Write-Dbg "Thin client config criada: $configFile"
|
|
643
684
|
}
|
|
644
685
|
|
|
@@ -675,8 +716,10 @@ function Install-Core {
|
|
|
675
716
|
if (Test-Path $coreSource -PathType Container) {
|
|
676
717
|
Copy-Item -Path $coreSource -Destination "$script:DestDir\" -Recurse -Force -ErrorAction SilentlyContinue
|
|
677
718
|
}
|
|
678
|
-
Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
|
|
679
|
-
|
|
719
|
+
$r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
|
|
720
|
+
if (-not $r) { Write-Fail "Falha ao copiar package.json (Install-Core)" }
|
|
721
|
+
$r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
|
|
722
|
+
if (-not $r) { Write-Fail "Falha ao copiar README.md (Install-Core)" }
|
|
680
723
|
} else {
|
|
681
724
|
# Tier 3 Remote Mode: NAO copiar IP
|
|
682
725
|
# Nota: Invoke-AutoCleanupLegacy ja rodou no inicio - aqui apenas config
|
|
@@ -718,7 +761,7 @@ function Install-Core {
|
|
|
718
761
|
}
|
|
719
762
|
|
|
720
763
|
# Write version file
|
|
721
|
-
|
|
764
|
+
Write-Utf8NoBom -Path "$script:DestDir\.version" -Content $pkgVersion
|
|
722
765
|
}
|
|
723
766
|
|
|
724
767
|
if ($LOCAL_MODE) {
|
|
@@ -781,10 +824,22 @@ function Install-Agent {
|
|
|
781
824
|
$claudeTargetDir = $script:SourceDir
|
|
782
825
|
}
|
|
783
826
|
|
|
827
|
+
# Epic 64 (Story 64.6): Debug diagnostics for Install-Agent
|
|
828
|
+
Write-Dbg "Install-Agent: SourceDir=$($script:SourceDir)"
|
|
829
|
+
Write-Dbg "Install-Agent: DestDir=$($script:DestDir)"
|
|
830
|
+
Write-Dbg "Install-Agent: claudeTargetDir=$claudeTargetDir"
|
|
831
|
+
Write-Dbg "Install-Agent: neocortex.md exists=$(Test-Path "$claudeTargetDir\neocortex.md")"
|
|
832
|
+
Write-Dbg "Install-Agent: neocortex.agent.yaml exists=$(Test-Path "$claudeTargetDir\neocortex.agent.yaml")"
|
|
833
|
+
|
|
784
834
|
# SEMPRE copiar os 3 arquivos de interface
|
|
785
835
|
# Tier 3: Copy only 2 stub files
|
|
786
|
-
Copy-Silent
|
|
787
|
-
Copy-Silent "$claudeTargetDir\neocortex.
|
|
836
|
+
# Epic 64 (Story 64.2): Capture Copy-Silent return and check for errors
|
|
837
|
+
$stubResult1 = Copy-Silent "$claudeTargetDir\neocortex.md" "$script:DestDir\"
|
|
838
|
+
if (-not $stubResult1) { Write-Fail "Falha ao copiar neocortex.md de $claudeTargetDir" }
|
|
839
|
+
Write-Dbg "Install-Agent: Copy neocortex.md result=$stubResult1"
|
|
840
|
+
$stubResult2 = Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$script:DestDir\"
|
|
841
|
+
if (-not $stubResult2) { Write-Fail "Falha ao copiar neocortex.agent.yaml de $claudeTargetDir" }
|
|
842
|
+
Write-Dbg "Install-Agent: Copy neocortex.agent.yaml result=$stubResult2"
|
|
788
843
|
# Cleanup workflow.md from previous versions
|
|
789
844
|
if (Test-Path "$script:DestDir\workflow.md") {
|
|
790
845
|
Remove-Item "$script:DestDir\workflow.md" -Force -ErrorAction SilentlyContinue
|
|
@@ -792,8 +847,10 @@ function Install-Agent {
|
|
|
792
847
|
|
|
793
848
|
if ($LOCAL_MODE) {
|
|
794
849
|
# Modo local: copiar IP completa (comportamento legado para devs)
|
|
795
|
-
Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
|
|
796
|
-
|
|
850
|
+
$r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
|
|
851
|
+
if (-not $r) { Write-Fail "Falha ao copiar package.json" }
|
|
852
|
+
$r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
|
|
853
|
+
if (-not $r) { Write-Fail "Falha ao copiar README.md" }
|
|
797
854
|
|
|
798
855
|
$coreSource = Join-Path $script:SourceDir "core"
|
|
799
856
|
if (Test-Path $coreSource -PathType Container) {
|
|
@@ -1099,7 +1156,7 @@ function Install-Targets {
|
|
|
1099
1156
|
}
|
|
1100
1157
|
}
|
|
1101
1158
|
}
|
|
1102
|
-
$existingSettings | ConvertTo-Json -Depth 10
|
|
1159
|
+
Write-Utf8NoBom -Path $settingsFile -Content ($existingSettings | ConvertTo-Json -Depth 10)
|
|
1103
1160
|
} catch {
|
|
1104
1161
|
Copy-Item -Path "$geminiTargetDir\settings-mcp.json" -Destination "$geminiHome\settings-mcp.json" -Force
|
|
1105
1162
|
}
|
|
@@ -1140,12 +1197,13 @@ function Install-Targets {
|
|
|
1140
1197
|
$lines = Get-Content $configFile
|
|
1141
1198
|
$markerIndex = ($lines | Select-String "# Neocortex MCP Servers" | Select-Object -First 1).LineNumber - 1
|
|
1142
1199
|
$beforeSection = $lines[0..($markerIndex - 1)] -join "`n"
|
|
1143
|
-
"$($beforeSection.TrimEnd())`n`n# Neocortex MCP Servers`n$mcpContent"
|
|
1200
|
+
Write-Utf8NoBom -Path $configFile -Content "$($beforeSection.TrimEnd())`n`n# Neocortex MCP Servers`n$mcpContent"
|
|
1144
1201
|
} else {
|
|
1145
|
-
|
|
1202
|
+
$existingContent = [System.IO.File]::ReadAllText($configFile, [System.Text.UTF8Encoding]::new($false))
|
|
1203
|
+
Write-Utf8NoBom -Path $configFile -Content "$existingContent`n# Neocortex MCP Servers`n$mcpContent"
|
|
1146
1204
|
}
|
|
1147
1205
|
} else {
|
|
1148
|
-
"# Neocortex MCP Servers`n$mcpContent"
|
|
1206
|
+
Write-Utf8NoBom -Path $configFile -Content "# Neocortex MCP Servers`n$mcpContent"
|
|
1149
1207
|
}
|
|
1150
1208
|
}
|
|
1151
1209
|
|
|
@@ -1271,8 +1329,11 @@ function New-ProjectDirectories {
|
|
|
1271
1329
|
|
|
1272
1330
|
# SEMPRE copiar os 3 arquivos de interface
|
|
1273
1331
|
# Tier 3: Copy only 2 stub files
|
|
1274
|
-
|
|
1275
|
-
Copy-Silent "$claudeTargetDir\neocortex.
|
|
1332
|
+
# Epic 64 (Story 64.2): Capture Copy-Silent return
|
|
1333
|
+
$r = Copy-Silent "$claudeTargetDir\neocortex.md" "$agentDest\"
|
|
1334
|
+
if (-not $r) { Write-Fail "Falha ao copiar neocortex.md (projeto)" }
|
|
1335
|
+
$r = Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$agentDest\"
|
|
1336
|
+
if (-not $r) { Write-Fail "Falha ao copiar neocortex.agent.yaml (projeto)" }
|
|
1276
1337
|
# Cleanup workflow.md from previous versions
|
|
1277
1338
|
if (Test-Path "$agentDest\workflow.md") {
|
|
1278
1339
|
Remove-Item "$agentDest\workflow.md" -Force -ErrorAction SilentlyContinue
|
|
@@ -1280,8 +1341,10 @@ function New-ProjectDirectories {
|
|
|
1280
1341
|
|
|
1281
1342
|
if ($LOCAL_MODE) {
|
|
1282
1343
|
# Modo local: copiar IP completa (comportamento legado)
|
|
1283
|
-
Copy-Silent "$($script:SourceDir)\package.json" "$agentDest\"
|
|
1284
|
-
|
|
1344
|
+
$r = Copy-Silent "$($script:SourceDir)\package.json" "$agentDest\"
|
|
1345
|
+
if (-not $r) { Write-Fail "Falha ao copiar package.json (projeto)" }
|
|
1346
|
+
$r = Copy-Silent "$($script:SourceDir)\README.md" "$agentDest\"
|
|
1347
|
+
if (-not $r) { Write-Fail "Falha ao copiar README.md (projeto)" }
|
|
1285
1348
|
New-Item -ItemType Directory -Path "$agentDest\core" -Force | Out-Null
|
|
1286
1349
|
Copy-Item -Path "$coreSource\*" -Destination "$agentDest\core\" -Recurse -Force -ErrorAction SilentlyContinue
|
|
1287
1350
|
foreach ($folder in @("steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
|
package/install.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornexus/neocortex",
|
|
3
|
-
"version": "3.9.
|
|
4
|
-
"description": "Neocortex v3.9.
|
|
3
|
+
"version": "3.9.29",
|
|
4
|
+
"description": "Neocortex v3.9.29 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -109,7 +109,9 @@ export function loadSecureConfig() {
|
|
|
109
109
|
if (!existsSync(CONFIG_FILE))
|
|
110
110
|
return null;
|
|
111
111
|
const raw = readFileSync(CONFIG_FILE, 'utf-8');
|
|
112
|
-
|
|
112
|
+
// Strip UTF-8 BOM if present (PowerShell 5.1 writes BOM via Out-File -Encoding utf8)
|
|
113
|
+
// Defense in depth: handles configs written by old PS 5.1 installers (Epic 63 - Story 63.1)
|
|
114
|
+
const config = JSON.parse(raw.replace(/^\uFEFF/, ''));
|
|
113
115
|
// Migration path: plaintext licenseKey -> encrypted
|
|
114
116
|
if (config.licenseKey && !config.encryptedLicenseKey) {
|
|
115
117
|
const encrypted = encryptLicenseKey(config.licenseKey);
|
package/postinstall.js
CHANGED
|
@@ -35,9 +35,20 @@ function showUsageMessage() {
|
|
|
35
35
|
console.log(' @neocortex *status\n');
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function showErrorMessage() {
|
|
39
|
+
console.error('\n[x] Instalacao do Neocortex falhou.\n');
|
|
40
|
+
console.error('Troubleshooting:');
|
|
41
|
+
console.error(' 1. Execute manualmente: npx @ornexus/neocortex -Debug');
|
|
42
|
+
console.error(' 2. Verifique permissoes no diretorio ~/.claude/');
|
|
43
|
+
console.error(' 3. Reporte em: https://github.com/OrNexus-AI/neocortex/issues\n');
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
function runInstaller() {
|
|
39
47
|
const platform = os.platform();
|
|
40
48
|
|
|
49
|
+
// Epic 64: Check NEOCORTEX_DEBUG env var for debug mode
|
|
50
|
+
const debugMode = process.env.NEOCORTEX_DEBUG === '1';
|
|
51
|
+
|
|
41
52
|
if (platform === 'win32') {
|
|
42
53
|
// Windows: run install.ps1
|
|
43
54
|
const scriptPath = path.join(__dirname, 'install.ps1');
|
|
@@ -46,19 +57,54 @@ function runInstaller() {
|
|
|
46
57
|
return;
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
const baseFlags = ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', scriptPath];
|
|
61
|
+
const quietFlags = ['-Yes', '-Quiet', '-SkipProject'];
|
|
62
|
+
const retryFlags = ['-Yes', '-SkipProject'];
|
|
63
|
+
if (debugMode) {
|
|
64
|
+
quietFlags.push('-Debug');
|
|
65
|
+
retryFlags.push('-Debug');
|
|
66
|
+
}
|
|
67
|
+
|
|
49
68
|
const shells = ['pwsh', 'powershell'];
|
|
69
|
+
let hasRetried = false;
|
|
70
|
+
|
|
71
|
+
function retryWithoutQuiet(shellCmd) {
|
|
72
|
+
if (hasRetried) {
|
|
73
|
+
showErrorMessage();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
hasRetried = true;
|
|
77
|
+
console.log('\nInstalacao falhou. Re-executando com output detalhado...\n');
|
|
78
|
+
const retryChild = spawn(shellCmd, [...baseFlags, ...retryFlags], {
|
|
79
|
+
stdio: 'inherit', shell: false, timeout: 60000
|
|
80
|
+
});
|
|
81
|
+
retryChild.on('error', () => showErrorMessage());
|
|
82
|
+
retryChild.on('exit', (retryCode) => {
|
|
83
|
+
if (retryCode === 0) {
|
|
84
|
+
showUsageMessage();
|
|
85
|
+
} else {
|
|
86
|
+
showErrorMessage();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
50
91
|
function tryShell(index) {
|
|
51
92
|
if (index >= shells.length) {
|
|
52
93
|
showUsageMessage();
|
|
53
94
|
return;
|
|
54
95
|
}
|
|
55
|
-
const child = spawn(shells[index], [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
], { stdio: 'inherit', shell: false });
|
|
96
|
+
const child = spawn(shells[index], [...baseFlags, ...quietFlags], {
|
|
97
|
+
stdio: 'inherit', shell: false
|
|
98
|
+
});
|
|
59
99
|
|
|
60
100
|
child.on('error', () => tryShell(index + 1));
|
|
61
|
-
child.on('exit', () => {
|
|
101
|
+
child.on('exit', (code) => {
|
|
102
|
+
if (code === 0) {
|
|
103
|
+
showUsageMessage();
|
|
104
|
+
} else {
|
|
105
|
+
retryWithoutQuiet(shells[index]);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
62
108
|
}
|
|
63
109
|
tryShell(0);
|
|
64
110
|
} else {
|
|
@@ -71,19 +117,55 @@ function runInstaller() {
|
|
|
71
117
|
|
|
72
118
|
try { fs.chmodSync(scriptPath, '755'); } catch { /* ignore */ }
|
|
73
119
|
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
120
|
+
const quietArgs = [scriptPath, '--yes', '--quiet', '--skip-project'];
|
|
121
|
+
const retryArgs = [scriptPath, '--yes', '--skip-project'];
|
|
122
|
+
if (debugMode) {
|
|
123
|
+
quietArgs.push('--debug');
|
|
124
|
+
retryArgs.push('--debug');
|
|
125
|
+
}
|
|
126
|
+
let hasRetried = false;
|
|
127
|
+
|
|
128
|
+
function retryUnixWithoutQuiet(shellCmd) {
|
|
129
|
+
if (hasRetried) {
|
|
130
|
+
showErrorMessage();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
hasRetried = true;
|
|
134
|
+
console.log('\nInstalacao falhou. Re-executando com output detalhado...\n');
|
|
135
|
+
const retryChild = spawn(shellCmd, retryArgs, {
|
|
136
|
+
stdio: 'inherit', shell: false, timeout: 60000
|
|
137
|
+
});
|
|
138
|
+
retryChild.on('error', () => showErrorMessage());
|
|
139
|
+
retryChild.on('exit', (retryCode) => {
|
|
140
|
+
if (retryCode === 0) {
|
|
141
|
+
showUsageMessage();
|
|
142
|
+
} else {
|
|
143
|
+
showErrorMessage();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const child = spawn('bash', quietArgs, { stdio: 'inherit', shell: false });
|
|
77
149
|
|
|
78
150
|
child.on('error', () => {
|
|
79
151
|
// Fallback to sh
|
|
80
|
-
const shChild = spawn('sh',
|
|
81
|
-
scriptPath, '--yes', '--quiet', '--skip-project'
|
|
82
|
-
], { stdio: 'inherit', shell: false });
|
|
152
|
+
const shChild = spawn('sh', quietArgs, { stdio: 'inherit', shell: false });
|
|
83
153
|
shChild.on('error', () => showUsageMessage());
|
|
84
|
-
shChild.on('exit', () => {
|
|
154
|
+
shChild.on('exit', (code) => {
|
|
155
|
+
if (code === 0) {
|
|
156
|
+
showUsageMessage();
|
|
157
|
+
} else {
|
|
158
|
+
retryUnixWithoutQuiet('sh');
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
child.on('exit', (code) => {
|
|
163
|
+
if (code === 0) {
|
|
164
|
+
showUsageMessage();
|
|
165
|
+
} else {
|
|
166
|
+
retryUnixWithoutQuiet('bash');
|
|
167
|
+
}
|
|
85
168
|
});
|
|
86
|
-
child.on('exit', () => { /* always succeed */ });
|
|
87
169
|
}
|
|
88
170
|
}
|
|
89
171
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "🧠 Neocortex v3.9.
|
|
3
|
+
description: "🧠 Neocortex v3.9.29 (Free) | OrNexus Team"
|
|
4
4
|
model: opus
|
|
5
5
|
color: blue
|
|
6
6
|
tools:
|
|
@@ -56,7 +56,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
56
56
|
┌────────────────────────────────────────────────────────────┐
|
|
57
57
|
│ │
|
|
58
58
|
│ ####### N E O C O R T E X │
|
|
59
|
-
│ ### ######## v3.9.
|
|
59
|
+
│ ### ######## v3.9.29 │
|
|
60
60
|
│ ######### ##### │
|
|
61
61
|
│ ## ############## Development Orchestrator │
|
|
62
62
|
│ ## ### ###### ## OrNexus Team (Free) │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "🧠 Neocortex v3.9.
|
|
3
|
+
description: "🧠 Neocortex v3.9.29 (Free) | OrNexus Team"
|
|
4
4
|
model: fast
|
|
5
5
|
readonly: false
|
|
6
6
|
is_background: false
|
|
@@ -18,7 +18,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
18
18
|
┌────────────────────────────────────────────────────────────┐
|
|
19
19
|
│ │
|
|
20
20
|
│ ####### N E O C O R T E X │
|
|
21
|
-
│ ### ######## v3.9.
|
|
21
|
+
│ ### ######## v3.9.29 │
|
|
22
22
|
│ ######### ##### │
|
|
23
23
|
│ ## ############## Development Orchestrator │
|
|
24
24
|
│ ## ### ###### ## OrNexus Team (Free) │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "🧠 Neocortex v3.9.
|
|
3
|
+
description: "🧠 Neocortex v3.9.29 (Free) | OrNexus Team"
|
|
4
4
|
kind: local
|
|
5
5
|
tools:
|
|
6
6
|
- read_file
|
|
@@ -25,7 +25,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
25
25
|
┌────────────────────────────────────────────────────────────┐
|
|
26
26
|
│ │
|
|
27
27
|
│ ####### N E O C O R T E X │
|
|
28
|
-
│ ### ######## v3.9.
|
|
28
|
+
│ ### ######## v3.9.29 │
|
|
29
29
|
│ ######### ##### │
|
|
30
30
|
│ ## ############## Development Orchestrator │
|
|
31
31
|
│ ## ### ###### ## OrNexus Team (Free) │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "neocortex"
|
|
3
|
-
description: "🧠 Neocortex v3.9.
|
|
3
|
+
description: "🧠 Neocortex v3.9.29 (Free) | OrNexus Team"
|
|
4
4
|
tools:
|
|
5
5
|
- readFile
|
|
6
6
|
- editFiles
|
|
@@ -26,7 +26,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
26
26
|
┌────────────────────────────────────────────────────────────┐
|
|
27
27
|
│ │
|
|
28
28
|
│ ####### N E O C O R T E X │
|
|
29
|
-
│ ### ######## v3.9.
|
|
29
|
+
│ ### ######## v3.9.29 │
|
|
30
30
|
│ ######### ##### │
|
|
31
31
|
│ ## ############## Development Orchestrator │
|
|
32
32
|
│ ## ### ###### ## OrNexus Team (Free) │
|