@ornexus/neocortex 3.9.28 → 3.9.30

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.ps1 CHANGED
@@ -15,7 +15,7 @@ param(
15
15
  [string]$ServerUrl = "https://api.neocortex.ornexus.com"
16
16
  )
17
17
 
18
- $VERSION = "3.9.28"
18
+ $VERSION = "3.9.30"
19
19
 
20
20
  # =============================================================================
21
21
  # CONFIGURACOES
@@ -197,8 +197,26 @@ function Copy-Silent {
197
197
  param([string]$Source, [string]$Destination)
198
198
  Write-Dbg "Copiando: $Source -> $Destination"
199
199
  if (Test-Path $Source -PathType Leaf) {
200
- try { Copy-Item -Path $Source -Destination $Destination -Force; return $true }
201
- catch { return $false }
200
+ try {
201
+ # Epic 65: -ErrorAction Stop converts non-terminating errors to terminating
202
+ # Without this, Copy-Item on Windows silently fails and try/catch never triggers
203
+ Copy-Item -Path $Source -Destination $Destination -Force -ErrorAction Stop
204
+ # Post-copy verification: confirm file arrived at destination
205
+ $destFile = if ($Destination.EndsWith('\') -or $Destination.EndsWith('/') -or (Test-Path $Destination -PathType Container)) {
206
+ Join-Path $Destination (Split-Path $Source -Leaf)
207
+ } else { $Destination }
208
+ if (-not (Test-Path $destFile -PathType Leaf)) {
209
+ Write-Dbg "Copy-Item retornou OK mas arquivo nao existe no destino: $destFile"
210
+ $script:Errors++
211
+ return $false
212
+ }
213
+ return $true
214
+ }
215
+ catch {
216
+ Write-Dbg "Copy-Item falhou: $_"
217
+ $script:Errors++
218
+ return $false
219
+ }
202
220
  }
203
221
  Write-Dbg "Arquivo nao encontrado: $Source"
204
222
  $script:Errors++
@@ -209,8 +227,14 @@ function Copy-DirSilent {
209
227
  param([string]$Source, [string]$Destination)
210
228
  Write-Dbg "Copiando dir: $Source -> $Destination"
211
229
  if (Test-Path $Source -PathType Container) {
212
- try { Copy-Item -Path $Source -Destination $Destination -Recurse -Force; return $true }
213
- catch { return $false }
230
+ try {
231
+ Copy-Item -Path $Source -Destination $Destination -Recurse -Force -ErrorAction Stop
232
+ return $true
233
+ }
234
+ catch {
235
+ Write-Dbg "Copy-Item dir falhou: $_"
236
+ return $false
237
+ }
214
238
  }
215
239
  return $false
216
240
  }
@@ -230,6 +254,7 @@ function Get-SourceDirectory {
230
254
  if (-not (Test-Path "$script:SourceDir\targets-stubs\claude-code\neocortex.md") -and
231
255
  -not (Test-Path "$script:SourceDir\targets\claude-code\neocortex.md") -and
232
256
  -not (Test-Path "$script:SourceDir\neocortex.md")) {
257
+ Write-Dbg "Stubs nao encontrados em PSScriptRoot, buscando em paths alternativos..."
233
258
  $possibleDirs = @(
234
259
  $script:SourceDir,
235
260
  # Scoped paths (primary) -- npm publishes as @ornexus/neocortex
@@ -241,16 +266,29 @@ function Get-SourceDirectory {
241
266
  "$env:LOCALAPPDATA\npm-cache\_npx\*\node_modules\neocortex",
242
267
  ".\node_modules\neocortex"
243
268
  )
269
+ $script:SourceFound = $false
244
270
  foreach ($dir in $possibleDirs) {
271
+ # Epic 64 (Story 64.6): Debug each possibleDir tested
272
+ Write-Dbg "Get-SourceDirectory: testing $dir"
245
273
  $expandedDirs = Get-Item $dir -ErrorAction SilentlyContinue
246
274
  foreach ($expanded in $expandedDirs) {
247
- if ((Test-Path "$($expanded.FullName)\targets-stubs\claude-code\neocortex.md") -or
275
+ $found = (Test-Path "$($expanded.FullName)\targets-stubs\claude-code\neocortex.md") -or
248
276
  (Test-Path "$($expanded.FullName)\targets\claude-code\neocortex.md") -or
249
- (Test-Path "$($expanded.FullName)\neocortex.md")) {
277
+ (Test-Path "$($expanded.FullName)\neocortex.md")
278
+ Write-Dbg "Get-SourceDirectory: $($expanded.FullName) found=$found"
279
+ if ($found) {
250
280
  $script:SourceDir = $expanded.FullName
281
+ $script:SourceFound = $true
251
282
  break
252
283
  }
253
284
  }
285
+ if ($script:SourceFound) { break }
286
+ }
287
+ # Epic 65: Emit visible warning when stubs cannot be found anywhere
288
+ if (-not $script:SourceFound) {
289
+ Write-Warn "Arquivos de instalacao (stubs) nao encontrados em nenhum path conhecido"
290
+ Write-Warn "PSScriptRoot: $PSScriptRoot"
291
+ Write-Warn "Tente reinstalar: npm install -g @ornexus/neocortex"
254
292
  }
255
293
  }
256
294
  }
@@ -502,6 +540,10 @@ function Verify-Installation {
502
540
  foreach ($entry in $criticalFiles) {
503
541
  $fpath = Join-Path $script:DestDir $entry.Name
504
542
  $fname = $entry.Name
543
+ # Epic 64 (Story 64.6): Debug file verification details
544
+ $fileExists = Test-Path $fpath -PathType Leaf
545
+ $fileSize = if ($fileExists) { (Get-Item $fpath).Length } else { 0 }
546
+ Write-Dbg "Verify-Installation: $fname exists=$fileExists size=$fileSize path=$fpath"
505
547
 
506
548
  if (-not (Test-Path $fpath -PathType Leaf)) {
507
549
  $report += @{ Status = "FAIL"; Detail = "$fname (nao encontrado)" }
@@ -591,7 +633,16 @@ function Verify-Installation {
591
633
  return $true
592
634
  }
593
635
 
594
- if ($QUIET_MODE -and $fails -eq 0) {
636
+ # Epic 64 (Story 64.3): In quiet mode, report FAILs before returning
637
+ if ($QUIET_MODE) {
638
+ if ($fails -gt 0) {
639
+ # Critical failures MUST be visible even in quiet mode
640
+ Write-Fail "Verificacao falhou: $fails arquivo(s) critico(s) faltando"
641
+ foreach ($entry in ($report | Where-Object { $_.Status -eq "FAIL" })) {
642
+ Write-Fail " $($entry.Detail)"
643
+ }
644
+ return $false
645
+ }
595
646
  return $true # In quiet mode, skip warnings-only report
596
647
  }
597
648
 
@@ -680,18 +731,30 @@ function Install-Core {
680
731
 
681
732
  Write-Dbg "DEST=$script:DestDir"
682
733
 
683
- # Create directories
734
+ # Create directories with verification (Epic 65)
684
735
  if (-not (Test-Path $script:ClaudeDir)) {
685
- try { New-Item -ItemType Directory -Path $script:ClaudeDir -Force | Out-Null }
686
- catch { Write-Fail "Falha ao criar $script:ClaudeDir"; return $false }
736
+ try { New-Item -ItemType Directory -Path $script:ClaudeDir -Force -ErrorAction Stop | Out-Null }
737
+ catch { Write-Fail "Falha ao criar $script:ClaudeDir`: $_"; return $false }
687
738
  }
688
- New-Item -ItemType Directory -Path $script:AgentsDir -Force | Out-Null
739
+ try { New-Item -ItemType Directory -Path $script:AgentsDir -Force -ErrorAction Stop | Out-Null }
740
+ catch { Write-Fail "Falha ao criar $script:AgentsDir`: $_"; return $false }
689
741
 
690
742
  # Clean previous
691
743
  if (Test-Path $script:DestDir) {
692
- Remove-Item -Path $script:DestDir -Recurse -Force -ErrorAction SilentlyContinue
744
+ try {
745
+ Remove-Item -Path $script:DestDir -Recurse -Force -ErrorAction Stop
746
+ } catch {
747
+ Write-Warn "Falha ao remover instalacao anterior: $_ (tentando continuar)"
748
+ }
749
+ }
750
+ try { New-Item -ItemType Directory -Path $script:DestDir -Force -ErrorAction Stop | Out-Null }
751
+ catch { Write-Fail "Falha ao criar $script:DestDir`: $_"; return $false }
752
+
753
+ # Verify directory was actually created (Epic 65: anti-silent-failure)
754
+ if (-not (Test-Path $script:DestDir -PathType Container)) {
755
+ Write-Fail "Diretorio $script:DestDir nao existe apos criacao"
756
+ return $false
693
757
  }
694
- New-Item -ItemType Directory -Path $script:DestDir -Force | Out-Null
695
758
 
696
759
  if ($LOCAL_MODE) {
697
760
  # Modo local: copiar IP completa (comportamento legado para devs)
@@ -699,8 +762,10 @@ function Install-Core {
699
762
  if (Test-Path $coreSource -PathType Container) {
700
763
  Copy-Item -Path $coreSource -Destination "$script:DestDir\" -Recurse -Force -ErrorAction SilentlyContinue
701
764
  }
702
- Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\" | Out-Null
703
- Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\" | Out-Null
765
+ $r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
766
+ if (-not $r) { Write-Fail "Falha ao copiar package.json (Install-Core)" }
767
+ $r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
768
+ if (-not $r) { Write-Fail "Falha ao copiar README.md (Install-Core)" }
704
769
  } else {
705
770
  # Tier 3 Remote Mode: NAO copiar IP
706
771
  # Nota: Invoke-AutoCleanupLegacy ja rodou no inicio - aqui apenas config
@@ -805,10 +870,45 @@ function Install-Agent {
805
870
  $claudeTargetDir = $script:SourceDir
806
871
  }
807
872
 
808
- # SEMPRE copiar os 3 arquivos de interface
873
+ # Epic 64 (Story 64.6): Debug diagnostics for Install-Agent
874
+ Write-Dbg "Install-Agent: SourceDir=$($script:SourceDir)"
875
+ Write-Dbg "Install-Agent: DestDir=$($script:DestDir)"
876
+ Write-Dbg "Install-Agent: claudeTargetDir=$claudeTargetDir"
877
+ $srcMdExists = Test-Path "$claudeTargetDir\neocortex.md"
878
+ $srcYamlExists = Test-Path "$claudeTargetDir\neocortex.agent.yaml"
879
+ Write-Dbg "Install-Agent: neocortex.md exists=$srcMdExists"
880
+ Write-Dbg "Install-Agent: neocortex.agent.yaml exists=$srcYamlExists"
881
+
882
+ # Epic 65: Early validation — if NEITHER source file exists, emit clear error
883
+ if (-not $srcMdExists -and -not $srcYamlExists) {
884
+ Write-Fail "Arquivos fonte nao encontrados em: $claudeTargetDir"
885
+ Write-Fail "Diretorio de origem ($($script:SourceDir)) pode estar incompleto"
886
+ Write-Fail "Tente reinstalar: npm install -g @ornexus/neocortex"
887
+ $script:Errors += 2
888
+ return $false
889
+ }
890
+
809
891
  # Tier 3: Copy only 2 stub files
810
- Copy-Silent "$claudeTargetDir\neocortex.md" "$script:DestDir\" | Out-Null
811
- Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$script:DestDir\" | Out-Null
892
+ # Epic 64 (Story 64.2): Capture Copy-Silent return and check for errors
893
+ $stubResult1 = Copy-Silent "$claudeTargetDir\neocortex.md" "$script:DestDir\"
894
+ if (-not $stubResult1) { Write-Fail "Falha ao copiar neocortex.md de $claudeTargetDir" }
895
+ Write-Dbg "Install-Agent: Copy neocortex.md result=$stubResult1"
896
+ $stubResult2 = Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$script:DestDir\"
897
+ if (-not $stubResult2) { Write-Fail "Falha ao copiar neocortex.agent.yaml de $claudeTargetDir" }
898
+ Write-Dbg "Install-Agent: Copy neocortex.agent.yaml result=$stubResult2"
899
+
900
+ # Epic 65: Post-copy verification — belt and suspenders
901
+ $destMd = Join-Path $script:DestDir "neocortex.md"
902
+ $destYaml = Join-Path $script:DestDir "neocortex.agent.yaml"
903
+ if (-not (Test-Path $destMd -PathType Leaf)) {
904
+ Write-Fail "neocortex.md nao encontrado no destino apos copia: $destMd"
905
+ if (-not $stubResult1) {} else { $script:Errors++ }
906
+ }
907
+ if (-not (Test-Path $destYaml -PathType Leaf)) {
908
+ Write-Fail "neocortex.agent.yaml nao encontrado no destino apos copia: $destYaml"
909
+ if (-not $stubResult2) {} else { $script:Errors++ }
910
+ }
911
+
812
912
  # Cleanup workflow.md from previous versions
813
913
  if (Test-Path "$script:DestDir\workflow.md") {
814
914
  Remove-Item "$script:DestDir\workflow.md" -Force -ErrorAction SilentlyContinue
@@ -816,8 +916,10 @@ function Install-Agent {
816
916
 
817
917
  if ($LOCAL_MODE) {
818
918
  # Modo local: copiar IP completa (comportamento legado para devs)
819
- Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\" | Out-Null
820
- Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\" | Out-Null
919
+ $r = Copy-Silent "$($script:SourceDir)\package.json" "$script:DestDir\"
920
+ if (-not $r) { Write-Fail "Falha ao copiar package.json" }
921
+ $r = Copy-Silent "$($script:SourceDir)\README.md" "$script:DestDir\"
922
+ if (-not $r) { Write-Fail "Falha ao copiar README.md" }
821
923
 
822
924
  $coreSource = Join-Path $script:SourceDir "core"
823
925
  if (Test-Path $coreSource -PathType Container) {
@@ -831,7 +933,7 @@ function Install-Agent {
831
933
  }
832
934
  }
833
935
  }
834
- # Tier 3 Remote Mode: apenas 3 arquivos de interface
936
+ # Tier 3 Remote Mode: apenas 2 arquivos de interface (stubs)
835
937
 
836
938
  return ($script:Errors -eq 0)
837
939
  }
@@ -1296,8 +1398,11 @@ function New-ProjectDirectories {
1296
1398
 
1297
1399
  # SEMPRE copiar os 3 arquivos de interface
1298
1400
  # Tier 3: Copy only 2 stub files
1299
- Copy-Silent "$claudeTargetDir\neocortex.md" "$agentDest\" | Out-Null
1300
- Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$agentDest\" | Out-Null
1401
+ # Epic 64 (Story 64.2): Capture Copy-Silent return
1402
+ $r = Copy-Silent "$claudeTargetDir\neocortex.md" "$agentDest\"
1403
+ if (-not $r) { Write-Fail "Falha ao copiar neocortex.md (projeto)" }
1404
+ $r = Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$agentDest\"
1405
+ if (-not $r) { Write-Fail "Falha ao copiar neocortex.agent.yaml (projeto)" }
1301
1406
  # Cleanup workflow.md from previous versions
1302
1407
  if (Test-Path "$agentDest\workflow.md") {
1303
1408
  Remove-Item "$agentDest\workflow.md" -Force -ErrorAction SilentlyContinue
@@ -1305,8 +1410,10 @@ function New-ProjectDirectories {
1305
1410
 
1306
1411
  if ($LOCAL_MODE) {
1307
1412
  # Modo local: copiar IP completa (comportamento legado)
1308
- Copy-Silent "$($script:SourceDir)\package.json" "$agentDest\" | Out-Null
1309
- Copy-Silent "$($script:SourceDir)\README.md" "$agentDest\" | Out-Null
1413
+ $r = Copy-Silent "$($script:SourceDir)\package.json" "$agentDest\"
1414
+ if (-not $r) { Write-Fail "Falha ao copiar package.json (projeto)" }
1415
+ $r = Copy-Silent "$($script:SourceDir)\README.md" "$agentDest\"
1416
+ if (-not $r) { Write-Fail "Falha ao copiar README.md (projeto)" }
1310
1417
  New-Item -ItemType Directory -Path "$agentDest\core" -Force | Out-Null
1311
1418
  Copy-Item -Path "$coreSource\*" -Destination "$agentDest\core\" -Recurse -Force -ErrorAction SilentlyContinue
1312
1419
  foreach ($folder in @("steps-c", "steps-e", "steps-p", "steps-r", "steps-u")) {
package/install.sh CHANGED
@@ -4,7 +4,7 @@
4
4
  # Development Orchestrator
5
5
 
6
6
  # Versao do instalador
7
- VERSION="3.9.28"
7
+ VERSION="3.9.30"
8
8
 
9
9
  # Flags
10
10
  MIGRATION_DETECTED=false
@@ -553,25 +553,40 @@ detect_source_dir() {
553
553
  SCRIPT_DIR="$PWD"
554
554
  fi
555
555
 
556
- if [ ! -f "$SCRIPT_DIR/targets/claude-code/neocortex.md" ]; then
557
- if [ ! -f "$SCRIPT_DIR/neocortex.md" ]; then
558
- for possible_dir in \
559
- "$SCRIPT_DIR" \
560
- "$(npm root -g 2>/dev/null)/neocortex" \
561
- "$(dirname "$0")" \
562
- "$PWD/node_modules/neocortex" \
563
- "$HOME/.npm/_npx/"*"/node_modules/neocortex"; do
564
- if [ -f "$possible_dir/targets/claude-code/neocortex.md" ] 2>/dev/null || \
565
- [ -f "$possible_dir/neocortex.md" ] 2>/dev/null; then
566
- SCRIPT_DIR="$possible_dir"
567
- break
568
- fi
569
- done
570
- fi
556
+ local source_found=false
557
+ if [ -f "$SCRIPT_DIR/targets-stubs/claude-code/neocortex.md" ] || \
558
+ [ -f "$SCRIPT_DIR/targets/claude-code/neocortex.md" ] || \
559
+ [ -f "$SCRIPT_DIR/neocortex.md" ]; then
560
+ source_found=true
561
+ else
562
+ for possible_dir in \
563
+ "$SCRIPT_DIR" \
564
+ "$(npm root -g 2>/dev/null)/@ornexus/neocortex" \
565
+ "$(npm root -g 2>/dev/null)/neocortex" \
566
+ "$(dirname "$0")" \
567
+ "$PWD/node_modules/@ornexus/neocortex" \
568
+ "$PWD/node_modules/neocortex" \
569
+ "$HOME/.npm/_npx/"*"/node_modules/@ornexus/neocortex" \
570
+ "$HOME/.npm/_npx/"*"/node_modules/neocortex"; do
571
+ if [ -f "$possible_dir/targets-stubs/claude-code/neocortex.md" ] 2>/dev/null || \
572
+ [ -f "$possible_dir/targets/claude-code/neocortex.md" ] 2>/dev/null || \
573
+ [ -f "$possible_dir/neocortex.md" ] 2>/dev/null; then
574
+ SCRIPT_DIR="$possible_dir"
575
+ source_found=true
576
+ break
577
+ fi
578
+ done
571
579
  fi
572
580
 
573
581
  SOURCE_DIR="$SCRIPT_DIR"
574
582
  debug "Source: $SOURCE_DIR"
583
+
584
+ # Epic 65: Emit visible warning when stubs cannot be found
585
+ if [ "$source_found" = false ]; then
586
+ warn "Arquivos de instalacao (stubs) nao encontrados em nenhum path conhecido"
587
+ warn "SCRIPT_DIR: $SCRIPT_DIR"
588
+ warn "Tente reinstalar: npm install -g @ornexus/neocortex"
589
+ fi
575
590
  }
576
591
 
577
592
  # =============================================================================
@@ -784,10 +799,28 @@ install_agent() {
784
799
  CLAUDE_TARGET_DIR="$SOURCE_DIR"
785
800
  fi
786
801
 
802
+ # Epic 65: Early validation — if neither source file exists, emit clear error
803
+ if [ ! -f "$CLAUDE_TARGET_DIR/neocortex.md" ] && [ ! -f "$CLAUDE_TARGET_DIR/neocortex.agent.yaml" ]; then
804
+ fail "Arquivos fonte nao encontrados em: $CLAUDE_TARGET_DIR"
805
+ fail "Diretorio de origem ($SOURCE_DIR) pode estar incompleto"
806
+ fail "Tente reinstalar: npm install -g @ornexus/neocortex"
807
+ return 2
808
+ fi
809
+
787
810
  # Tier 3 Stub-Only: copiar apenas 2 arquivos de interface (stubs minimos)
788
811
  copy_file "$CLAUDE_TARGET_DIR/neocortex.md" "$DEST_DIR/" || ((errors++))
789
812
  copy_file "$CLAUDE_TARGET_DIR/neocortex.agent.yaml" "$DEST_DIR/" || ((errors++))
790
813
 
814
+ # Epic 65: Post-copy verification
815
+ if [ ! -f "$DEST_DIR/neocortex.md" ]; then
816
+ fail "neocortex.md nao encontrado no destino apos copia: $DEST_DIR/"
817
+ ((errors++))
818
+ fi
819
+ if [ ! -f "$DEST_DIR/neocortex.agent.yaml" ]; then
820
+ fail "neocortex.agent.yaml nao encontrado no destino apos copia: $DEST_DIR/"
821
+ ((errors++))
822
+ fi
823
+
791
824
  # Dynamic description: patch tier from existing config (if activated)
792
825
  patch_description_tier "$DEST_DIR/neocortex.md"
793
826
  patch_description_tier "$DEST_DIR/neocortex.agent.yaml"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ornexus/neocortex",
3
- "version": "3.9.28",
4
- "description": "Neocortex v3.9.28 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
3
+ "version": "3.9.30",
4
+ "description": "Neocortex v3.9.30 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
5
5
  "keywords": [
6
6
  "claude",
7
7
  "claude-code",
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,56 @@ 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
- showUsageMessage();
93
+ // Epic 65: Don't show "Neocortex instalado!" when no shell was found
94
+ console.error('\n[!] PowerShell nao encontrado (pwsh ou powershell).');
95
+ console.error(' Instale manualmente: npx @ornexus/neocortex\n');
53
96
  return;
54
97
  }
55
- const child = spawn(shells[index], [
56
- '-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', scriptPath,
57
- '-Yes', '-Quiet', '-SkipProject'
58
- ], { stdio: 'inherit', shell: false });
98
+ const child = spawn(shells[index], [...baseFlags, ...quietFlags], {
99
+ stdio: 'inherit', shell: false
100
+ });
59
101
 
60
102
  child.on('error', () => tryShell(index + 1));
61
- child.on('exit', () => { /* always succeed */ });
103
+ child.on('exit', (code) => {
104
+ if (code === 0) {
105
+ showUsageMessage();
106
+ } else {
107
+ retryWithoutQuiet(shells[index]);
108
+ }
109
+ });
62
110
  }
63
111
  tryShell(0);
64
112
  } else {
@@ -71,19 +119,55 @@ function runInstaller() {
71
119
 
72
120
  try { fs.chmodSync(scriptPath, '755'); } catch { /* ignore */ }
73
121
 
74
- const child = spawn('bash', [
75
- scriptPath, '--yes', '--quiet', '--skip-project'
76
- ], { stdio: 'inherit', shell: false });
122
+ const quietArgs = [scriptPath, '--yes', '--quiet', '--skip-project'];
123
+ const retryArgs = [scriptPath, '--yes', '--skip-project'];
124
+ if (debugMode) {
125
+ quietArgs.push('--debug');
126
+ retryArgs.push('--debug');
127
+ }
128
+ let hasRetried = false;
129
+
130
+ function retryUnixWithoutQuiet(shellCmd) {
131
+ if (hasRetried) {
132
+ showErrorMessage();
133
+ return;
134
+ }
135
+ hasRetried = true;
136
+ console.log('\nInstalacao falhou. Re-executando com output detalhado...\n');
137
+ const retryChild = spawn(shellCmd, retryArgs, {
138
+ stdio: 'inherit', shell: false, timeout: 60000
139
+ });
140
+ retryChild.on('error', () => showErrorMessage());
141
+ retryChild.on('exit', (retryCode) => {
142
+ if (retryCode === 0) {
143
+ showUsageMessage();
144
+ } else {
145
+ showErrorMessage();
146
+ }
147
+ });
148
+ }
149
+
150
+ const child = spawn('bash', quietArgs, { stdio: 'inherit', shell: false });
77
151
 
78
152
  child.on('error', () => {
79
153
  // Fallback to sh
80
- const shChild = spawn('sh', [
81
- scriptPath, '--yes', '--quiet', '--skip-project'
82
- ], { stdio: 'inherit', shell: false });
154
+ const shChild = spawn('sh', quietArgs, { stdio: 'inherit', shell: false });
83
155
  shChild.on('error', () => showUsageMessage());
84
- shChild.on('exit', () => { /* always succeed */ });
156
+ shChild.on('exit', (code) => {
157
+ if (code === 0) {
158
+ showUsageMessage();
159
+ } else {
160
+ retryUnixWithoutQuiet('sh');
161
+ }
162
+ });
163
+ });
164
+ child.on('exit', (code) => {
165
+ if (code === 0) {
166
+ showUsageMessage();
167
+ } else {
168
+ retryUnixWithoutQuiet('bash');
169
+ }
85
170
  });
86
- child.on('exit', () => { /* always succeed */ });
87
171
  }
88
172
  }
89
173
 
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.28 (Free) | OrNexus Team
1
+ # 🧠 Neocortex v3.9.30 (Free) | OrNexus Team
2
2
 
3
3
  This project uses Neocortex, a Development Orchestrator (Free).
4
4
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v3.9.28 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.30 (Free) | OrNexus Team"
4
4
  ---
5
5
 
6
6
  # Neocortex - Thin Client Interface
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex'
5
5
  title: 'Development Orchestrator (Free)'
6
6
  icon: '>'
7
- version: '3.9.28'
7
+ version: '3.9.30'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v3.9.28 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.30 (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.28
59
+ │ ### ######## v3.9.30
60
60
  │ ######### ##### │
61
61
  │ ## ############## Development Orchestrator │
62
62
  │ ## ### ###### ## OrNexus Team (Free) │
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.28 (Free) | OrNexus Team
1
+ # 🧠 Neocortex v3.9.30 (Free) | OrNexus Team
2
2
 
3
3
  You are a Development Orchestrator (Free). All orchestration logic is delivered by the remote Neocortex server.
4
4
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v3.9.28 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.30 (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.28
21
+ │ ### ######## v3.9.30
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.28 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.30 (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
28
+ │ ### ######## v3.9.30
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.28 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.30 (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.28
29
+ │ ### ######## v3.9.30
30
30
  │ ######### ##### │
31
31
  │ ## ############## Development Orchestrator │
32
32
  │ ## ### ###### ## OrNexus Team (Free) │