@ornexus/neocortex 3.9.27 → 3.9.28

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 CHANGED
@@ -41,7 +41,13 @@ const PLATFORMS = [
41
41
  function detectPlatform(command) {
42
42
  const { execSync } = require('child_process');
43
43
  try {
44
- execSync(`which ${command} 2>/dev/null || where ${command} 2>NUL`, { stdio: 'pipe' });
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
- const cfg = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
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.27"
18
+ $VERSION = "3.9.28"
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,10 +227,16 @@ 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"
@@ -221,8 +244,9 @@ function Get-SourceDirectory {
221
244
  foreach ($dir in $possibleDirs) {
222
245
  $expandedDirs = Get-Item $dir -ErrorAction SilentlyContinue
223
246
  foreach ($expanded in $expandedDirs) {
224
- if (Test-Path "$($expanded.FullName)\targets\claude-code\neocortex.md" -or
225
- Test-Path "$($expanded.FullName)\neocortex.md") {
247
+ if ((Test-Path "$($expanded.FullName)\targets-stubs\claude-code\neocortex.md") -or
248
+ (Test-Path "$($expanded.FullName)\targets\claude-code\neocortex.md") -or
249
+ (Test-Path "$($expanded.FullName)\neocortex.md")) {
226
250
  $script:SourceDir = $expanded.FullName
227
251
  break
228
252
  }
@@ -613,7 +637,7 @@ function Set-ThinClientConfig {
613
637
  if ($existingConfig.tier -eq 3 -and $existingConfig.mode -eq "pending-activation") {
614
638
  $existingConfig.PSObject.Properties.Remove("tier")
615
639
  }
616
- $existingConfig | ConvertTo-Json -Depth 5 | Out-File -FilePath $configFile -Encoding utf8
640
+ Write-Utf8NoBom -Path $configFile -Content ($existingConfig | ConvertTo-Json -Depth 5)
617
641
  Write-Dbg "Config migrada para configVersion 1"
618
642
  } catch {
619
643
  Write-Dbg "Falha na migracao do config: $_"
@@ -638,7 +662,7 @@ function Set-ThinClientConfig {
638
662
  installerVersion = $VERSION
639
663
  }
640
664
 
641
- $config | ConvertTo-Json -Depth 5 | Out-File -FilePath $configFile -Encoding utf8
665
+ Write-Utf8NoBom -Path $configFile -Content ($config | ConvertTo-Json -Depth 5)
642
666
  Write-Dbg "Thin client config criada: $configFile"
643
667
  }
644
668
 
@@ -718,7 +742,7 @@ function Install-Core {
718
742
  }
719
743
 
720
744
  # Write version file
721
- $pkgVersion | Out-File -FilePath "$script:DestDir\.version" -Encoding utf8 -NoNewline
745
+ Write-Utf8NoBom -Path "$script:DestDir\.version" -Content $pkgVersion
722
746
  }
723
747
 
724
748
  if ($LOCAL_MODE) {
@@ -1099,7 +1123,7 @@ function Install-Targets {
1099
1123
  }
1100
1124
  }
1101
1125
  }
1102
- $existingSettings | ConvertTo-Json -Depth 10 | Set-Content $settingsFile -Encoding utf8
1126
+ Write-Utf8NoBom -Path $settingsFile -Content ($existingSettings | ConvertTo-Json -Depth 10)
1103
1127
  } catch {
1104
1128
  Copy-Item -Path "$geminiTargetDir\settings-mcp.json" -Destination "$geminiHome\settings-mcp.json" -Force
1105
1129
  }
@@ -1140,12 +1164,13 @@ function Install-Targets {
1140
1164
  $lines = Get-Content $configFile
1141
1165
  $markerIndex = ($lines | Select-String "# Neocortex MCP Servers" | Select-Object -First 1).LineNumber - 1
1142
1166
  $beforeSection = $lines[0..($markerIndex - 1)] -join "`n"
1143
- "$($beforeSection.TrimEnd())`n`n# Neocortex MCP Servers`n$mcpContent" | Set-Content $configFile -Encoding utf8
1167
+ Write-Utf8NoBom -Path $configFile -Content "$($beforeSection.TrimEnd())`n`n# Neocortex MCP Servers`n$mcpContent"
1144
1168
  } else {
1145
- "`n# Neocortex MCP Servers`n$mcpContent" | Add-Content $configFile -Encoding utf8
1169
+ $existingContent = [System.IO.File]::ReadAllText($configFile, [System.Text.UTF8Encoding]::new($false))
1170
+ Write-Utf8NoBom -Path $configFile -Content "$existingContent`n# Neocortex MCP Servers`n$mcpContent"
1146
1171
  }
1147
1172
  } else {
1148
- "# Neocortex MCP Servers`n$mcpContent" | Set-Content $configFile -Encoding utf8
1173
+ Write-Utf8NoBom -Path $configFile -Content "# Neocortex MCP Servers`n$mcpContent"
1149
1174
  }
1150
1175
  }
1151
1176
 
package/install.sh CHANGED
@@ -4,7 +4,7 @@
4
4
  # Development Orchestrator
5
5
 
6
6
  # Versao do instalador
7
- VERSION="3.9.27"
7
+ VERSION="3.9.28"
8
8
 
9
9
  # Flags
10
10
  MIGRATION_DETECTED=false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ornexus/neocortex",
3
- "version": "3.9.27",
4
- "description": "Neocortex v3.9.27 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
3
+ "version": "3.9.28",
4
+ "description": "Neocortex v3.9.28 - 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
- const config = JSON.parse(raw);
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);
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.27 (Free) | OrNexus Team
1
+ # 🧠 Neocortex v3.9.28 (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.27 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.28 (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.27'
7
+ version: '3.9.28'
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.27 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.28 (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.27
59
+ │ ### ######## v3.9.28
60
60
  │ ######### ##### │
61
61
  │ ## ############## Development Orchestrator │
62
62
  │ ## ### ###### ## OrNexus Team (Free) │
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v3.9.27 (Free) | OrNexus Team
1
+ # 🧠 Neocortex v3.9.28 (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.27 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.28 (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.27
21
+ │ ### ######## v3.9.28
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.27 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.28 (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.27
28
+ │ ### ######## v3.9.28
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.27 (Free) | OrNexus Team"
3
+ description: "🧠 Neocortex v3.9.28 (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.27
29
+ │ ### ######## v3.9.28
30
30
  │ ######### ##### │
31
31
  │ ## ############## Development Orchestrator │
32
32
  │ ## ### ###### ## OrNexus Team (Free) │