@ornexus/neocortex 3.9.29 → 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.29"
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,6 +266,7 @@ 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) {
245
271
  # Epic 64 (Story 64.6): Debug each possibleDir tested
246
272
  Write-Dbg "Get-SourceDirectory: testing $dir"
@@ -252,9 +278,17 @@ function Get-SourceDirectory {
252
278
  Write-Dbg "Get-SourceDirectory: $($expanded.FullName) found=$found"
253
279
  if ($found) {
254
280
  $script:SourceDir = $expanded.FullName
281
+ $script:SourceFound = $true
255
282
  break
256
283
  }
257
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"
258
292
  }
259
293
  }
260
294
  }
@@ -697,18 +731,30 @@ function Install-Core {
697
731
 
698
732
  Write-Dbg "DEST=$script:DestDir"
699
733
 
700
- # Create directories
734
+ # Create directories with verification (Epic 65)
701
735
  if (-not (Test-Path $script:ClaudeDir)) {
702
- try { New-Item -ItemType Directory -Path $script:ClaudeDir -Force | Out-Null }
703
- 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 }
704
738
  }
705
- 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 }
706
741
 
707
742
  # Clean previous
708
743
  if (Test-Path $script:DestDir) {
709
- 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
710
757
  }
711
- New-Item -ItemType Directory -Path $script:DestDir -Force | Out-Null
712
758
 
713
759
  if ($LOCAL_MODE) {
714
760
  # Modo local: copiar IP completa (comportamento legado para devs)
@@ -828,10 +874,20 @@ function Install-Agent {
828
874
  Write-Dbg "Install-Agent: SourceDir=$($script:SourceDir)"
829
875
  Write-Dbg "Install-Agent: DestDir=$($script:DestDir)"
830
876
  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")"
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
+ }
833
890
 
834
- # SEMPRE copiar os 3 arquivos de interface
835
891
  # Tier 3: Copy only 2 stub files
836
892
  # Epic 64 (Story 64.2): Capture Copy-Silent return and check for errors
837
893
  $stubResult1 = Copy-Silent "$claudeTargetDir\neocortex.md" "$script:DestDir\"
@@ -840,6 +896,19 @@ function Install-Agent {
840
896
  $stubResult2 = Copy-Silent "$claudeTargetDir\neocortex.agent.yaml" "$script:DestDir\"
841
897
  if (-not $stubResult2) { Write-Fail "Falha ao copiar neocortex.agent.yaml de $claudeTargetDir" }
842
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
+
843
912
  # Cleanup workflow.md from previous versions
844
913
  if (Test-Path "$script:DestDir\workflow.md") {
845
914
  Remove-Item "$script:DestDir\workflow.md" -Force -ErrorAction SilentlyContinue
@@ -864,7 +933,7 @@ function Install-Agent {
864
933
  }
865
934
  }
866
935
  }
867
- # Tier 3 Remote Mode: apenas 3 arquivos de interface
936
+ # Tier 3 Remote Mode: apenas 2 arquivos de interface (stubs)
868
937
 
869
938
  return ($script:Errors -eq 0)
870
939
  }
package/install.sh CHANGED
@@ -4,7 +4,7 @@
4
4
  # Development Orchestrator
5
5
 
6
6
  # Versao do instalador
7
- VERSION="3.9.29"
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.29",
4
- "description": "Neocortex v3.9.29 - 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
@@ -90,7 +90,9 @@ function runInstaller() {
90
90
 
91
91
  function tryShell(index) {
92
92
  if (index >= shells.length) {
93
- 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');
94
96
  return;
95
97
  }
96
98
  const child = spawn(shells[index], [...baseFlags, ...quietFlags], {
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.29 (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.29 (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.29'
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.29 (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.29
59
+ │ ### ######## v3.9.30
60
60
  │ ######### ##### │
61
61
  │ ## ############## Development Orchestrator │
62
62
  │ ## ### ###### ## OrNexus Team (Free) │
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.29 (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.29 (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.29
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.29 (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.29
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.29 (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.29
29
+ │ ### ######## v3.9.30
30
30
  │ ######### ##### │
31
31
  │ ## ############## Development Orchestrator │
32
32
  │ ## ### ###### ## OrNexus Team (Free) │