@aiviatic/kindling 0.1.0 → 0.1.1

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.
@@ -1,13 +1,13 @@
1
- @echo off
2
- REM Kindling bootstrap entry — Windows. The user downloads THIS ONE FILE and double-clicks it.
3
- REM It FETCHES + runs the setup script from the host, so no sibling files are needed (the earlier
4
- REM `-File %~dp0setup.ps1` required setup.ps1 + lib\common.ps1 next to the .cmd, which a lone
5
- REM download doesn't have). Mirrors the macOS/Linux one-liner `curl -fsSL .../go | bash`.
6
- REM -ExecutionPolicy Bypass : lets the unsigned setup script run FOR THIS PROCESS ONLY
7
- REM (it does not change any system-wide policy — safe + reversible).
8
- REM -NoProfile : skips the user's PowerShell profile so nothing interferes (required).
9
- REM irm ... | iex : Invoke-RestMethod fetches setup.ps1 over HTTPS, Invoke-Expression
10
- REM runs it (the PowerShell equivalent of curl|bash). setup.ps1 is
11
- REM self-contained (helpers inlined), so no on-disk siblings are needed.
12
- powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://kindling.aiviatic.com/setup.ps1 | iex"
13
- pause
1
+ @echo off
2
+ REM Kindling bootstrap entry — Windows. The user downloads THIS ONE FILE and double-clicks it.
3
+ REM It FETCHES + runs the setup script from the host, so no sibling files are needed (the earlier
4
+ REM `-File %~dp0setup.ps1` required setup.ps1 + lib\common.ps1 next to the .cmd, which a lone
5
+ REM download doesn't have). Mirrors the macOS/Linux one-liner `curl -fsSL .../install | bash`.
6
+ REM -ExecutionPolicy Bypass : lets the unsigned setup script run FOR THIS PROCESS ONLY
7
+ REM (it does not change any system-wide policy — safe + reversible).
8
+ REM -NoProfile : skips the user's PowerShell profile so nothing interferes (required).
9
+ REM irm ... | iex : Invoke-RestMethod fetches setup.ps1 over HTTPS, Invoke-Expression
10
+ REM runs it (the PowerShell equivalent of curl|bash). setup.ps1 is
11
+ REM self-contained (helpers inlined), so no on-disk siblings are needed.
12
+ powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://kindling.aiviatic.com/setup.ps1 | iex"
13
+ pause
@@ -1,98 +1,111 @@
1
- # Kindling bootstrap — Windows. FETCHED + run by kindling.cmd (self-fetching one-file entry):
2
- # powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://kindling.aiviatic.com/setup.ps1 | iex"
3
- # Ensures the pinned Node + Git (portable), then launches Kindling.
4
- #
5
- # SELF-CONTAINED for the `irm | iex` delivery path: there is NO file on disk (no $PSScriptRoot), so
6
- # the helpers are INLINED below rather than dot-sourced — mirroring setup.sh's inline helpers for
7
- # `curl | bash`. Pinned versions below MUST match engine/pins.ts (a unit test asserts this).
8
- # NOTE: portable Node/Git provisioning is the Windows SPIKE — validated on real Windows at the
9
- # dress rehearsal (mirrors engine/provision/node-windows.ts).
10
- $ErrorActionPreference = 'Stop'
11
-
12
- $KindlingNodeVersion = '24.16.0' # == pins.node
13
- $KindlingVersion = '0.1.0' # == pins.kindling
14
- $NodeFloorMajor = 20
15
-
16
- # --- Inline helpers (were bootstrap/lib/common.ps1; inlined for the file-less delivery) ----------
17
- function Say([string]$msg) { Write-Host "`n$msg" -ForegroundColor White }
18
- function Test-Cmd([string]$name) {
19
- return [bool](Get-Command $name -ErrorAction SilentlyContinue)
20
- }
21
- # True if a Node on PATH meets the major-version floor.
22
- function Test-NodeOk([int]$floorMajor) {
23
- if (-not (Test-Cmd 'node')) { return $false }
24
- try {
25
- $v = (& node -v) -replace '^v', ''
26
- $major = [int]($v -split '\.')[0]
27
- return $major -ge $floorMajor
28
- } catch { return $false }
29
- }
30
-
31
- Say "Getting your computer ready. This usually takes about 5 minutes."
32
-
33
- # Plain-language guidance for the Windows security prompts (FR-7) - expected / safe / reversible.
34
- Say "Heads up: Windows may show a couple of security prompts. They're expected and safe:"
35
- Say " - SmartScreen ('Windows protected your PC'): click 'More info', then 'Run anyway'. Nothing is changed on your PC."
36
- Say " - This window already runs with -ExecutionPolicy Bypass for THIS process only; it does not change any system setting and is fully reversible."
37
-
38
- # --- Node (pinned, portable) --------------------------------------------------
39
- # $NodeExe stays $null when a system Node is reused (launch via PATH); the portable-install path
40
- # sets it to the absolute node.exe so the launch never depends on PATH (clean-runtime rule, AR6).
41
- $NodeExe = $null
42
- if (Test-NodeOk $NodeFloorMajor) {
43
- Say "Node is already installed - reusing it."
44
- } else {
45
- Say "Setting up Node - the engine your project runs on. This downloads about 30 MB, one time."
46
- # Portable Node: download the pinned Windows zip from nodejs.org, VERIFY its SHA-256 against Node's
47
- # published SHASUMS256.txt before touching it, extract, and point the launch at the absolute
48
- # node.exe (clean-runtime rule AR6 — never rely on a mutated PATH). Mirrors node-windows.ts.
49
- # NOTE: newly implemented; validate on real Windows (proxy/TLS-interception, extract, non-admin exec).
50
- $ProgressPreference = 'SilentlyContinue' # a visible progress bar makes Invoke-WebRequest ~10x slower
51
- [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
52
- $arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'x64' }
53
- $distName = "node-v$KindlingNodeVersion-win-$arch"
54
- $nodeRoot = Join-Path $env:LOCALAPPDATA 'kindling\node'
55
- $zipPath = Join-Path $nodeRoot "$distName.zip"
56
- $baseUrl = "https://nodejs.org/dist/v$KindlingNodeVersion"
57
- New-Item -ItemType Directory -Force -Path $nodeRoot | Out-Null
58
- try {
59
- Invoke-WebRequest -Uri "$baseUrl/$distName.zip" -OutFile $zipPath -UseBasicParsing
60
- $shaLine = ((Invoke-WebRequest -Uri "$baseUrl/SHASUMS256.txt" -UseBasicParsing).Content -split "`n" |
61
- Where-Object { $_ -match [regex]::Escape("$distName.zip") } | Select-Object -First 1)
62
- $expected = ($shaLine -split '\s+')[0].ToLower()
63
- $actual = (Get-FileHash -Path $zipPath -Algorithm SHA256).Hash.ToLower()
64
- if (-not $expected -or $actual -ne $expected) {
65
- throw "downloaded Node failed its integrity check (expected '$expected', got '$actual')"
66
- }
67
- Expand-Archive -Path $zipPath -DestinationPath $nodeRoot -Force
68
- } catch {
69
- throw "Couldn't set up Node ($($_.Exception.Message)). Check your internet connection, then run this again - it's safe to re-run."
70
- }
71
- $NodeExe = Join-Path $nodeRoot "$distName\node.exe"
72
- if (-not (Test-Path $NodeExe)) { throw "Node was downloaded but node.exe wasn't found at $NodeExe." }
73
- Say "Node is ready."
74
- }
75
-
76
- # --- Git (portable) -----------------------------------------------------------
77
- if (Test-Cmd 'git') {
78
- Say "Git is already installed - reusing it."
79
- } else {
80
- Say "Setting up Git - it keeps the history of your project."
81
- # PortableGit download/extract — deferred (needs pinned version + release URL); resolved at rehearsal.
82
- }
83
-
84
- # --- Launch Kindling (clean-runtime: absolute node when portable, else npx on PATH) -----------
85
- Say "Starting Kindling..."
86
- if ($null -eq $NodeExe) {
87
- & npx -y "@aiviatic/kindling@$KindlingVersion"
88
- } else {
89
- # Invoke npx's CLI through the exact provisioned node binary no reliance on PATH.
90
- $NpxCli = Join-Path (Split-Path $NodeExe) 'node_modules\npm\bin\npx-cli.js'
91
- & $NodeExe $NpxCli -y "@aiviatic/kindling@$KindlingVersion"
92
- }
93
- # A native exe (npx) does NOT raise a terminating error on failure even with
94
- # ErrorActionPreference='Stop' it only sets $LASTEXITCODE. So check that explicitly.
95
- if ($LASTEXITCODE -ne 0) {
96
- Say "Kindling couldn't start. Check that you're connected to the internet, then run it again. It's safe to re-run."
97
- exit 1
98
- }
1
+ # Kindling bootstrap — Windows. FETCHED + run by kindling.cmd (self-fetching one-file entry):
2
+ # powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://kindling.aiviatic.com/setup.ps1 | iex"
3
+ # Ensures the pinned Node + Git (portable), then launches Kindling.
4
+ #
5
+ # SELF-CONTAINED for the `irm | iex` delivery path: there is NO file on disk (no $PSScriptRoot), so
6
+ # the helpers are INLINED below rather than dot-sourced — mirroring setup.sh's inline helpers for
7
+ # `curl | bash`. Pinned versions below MUST match engine/pins.ts (a unit test asserts this).
8
+ # NOTE: portable Node/Git provisioning is the Windows SPIKE — validated on real Windows at the
9
+ # dress rehearsal (mirrors engine/provision/node-windows.ts).
10
+ $ErrorActionPreference = 'Stop'
11
+
12
+ $KindlingNodeVersion = '24.16.0' # == pins.node
13
+ $KindlingVersion = '0.1.1' # == pins.kindling
14
+ $NodeFloorMajor = 20
15
+
16
+ # --- Inline helpers (were bootstrap/lib/common.ps1; inlined for the file-less delivery) ----------
17
+ function Say([string]$msg) { Write-Host "`n$msg" -ForegroundColor White }
18
+ function Test-Cmd([string]$name) {
19
+ return [bool](Get-Command $name -ErrorAction SilentlyContinue)
20
+ }
21
+ # True if a Node on PATH meets the major-version floor.
22
+ function Test-NodeOk([int]$floorMajor) {
23
+ if (-not (Test-Cmd 'node')) { return $false }
24
+ try {
25
+ $v = (& node -v) -replace '^v', ''
26
+ $major = [int]($v -split '\.')[0]
27
+ return $major -ge $floorMajor
28
+ } catch { return $false }
29
+ }
30
+
31
+ Say "Getting your computer ready. This usually takes about 5 minutes."
32
+
33
+ # Plain-language guidance for the Windows security prompts (FR-7) - expected / safe / reversible.
34
+ Say "Heads up: Windows may show a couple of security prompts. They're expected and safe:"
35
+ Say " - SmartScreen ('Windows protected your PC'): click 'More info', then 'Run anyway'. Nothing is changed on your PC."
36
+ Say " - This window already runs with -ExecutionPolicy Bypass for THIS process only; it does not change any system setting and is fully reversible."
37
+
38
+ # --- Node (pinned, portable) --------------------------------------------------
39
+ # $NodeExe stays $null when a system Node is reused (launch via PATH); the portable-install path
40
+ # sets it to the absolute node.exe so the launch never depends on PATH (clean-runtime rule, AR6).
41
+ $NodeExe = $null
42
+ if (Test-NodeOk $NodeFloorMajor) {
43
+ Say "Node is already installed - reusing it."
44
+ } else {
45
+ Say "Setting up Node - the engine your project runs on. This downloads about 30 MB, one time."
46
+ # Portable Node: download the pinned Windows zip from nodejs.org, VERIFY its SHA-256 against Node's
47
+ # published SHASUMS256.txt before touching it, extract, and point the launch at the absolute
48
+ # node.exe (clean-runtime rule AR6 — never rely on a mutated PATH). Mirrors node-windows.ts.
49
+ # NOTE: newly implemented; validate on real Windows (proxy/TLS-interception, extract, non-admin exec).
50
+ $ProgressPreference = 'SilentlyContinue' # a visible progress bar makes Invoke-WebRequest ~10x slower
51
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
52
+ $arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'x64' }
53
+ $distName = "node-v$KindlingNodeVersion-win-$arch"
54
+ $nodeRoot = Join-Path $env:LOCALAPPDATA 'kindling\node'
55
+ $zipPath = Join-Path $nodeRoot "$distName.zip"
56
+ $baseUrl = "https://nodejs.org/dist/v$KindlingNodeVersion"
57
+ New-Item -ItemType Directory -Force -Path $nodeRoot | Out-Null
58
+ try {
59
+ Invoke-WebRequest -Uri "$baseUrl/$distName.zip" -OutFile $zipPath -UseBasicParsing
60
+ $shaLine = ((Invoke-WebRequest -Uri "$baseUrl/SHASUMS256.txt" -UseBasicParsing).Content -split "`n" |
61
+ Where-Object { $_ -match [regex]::Escape("$distName.zip") } | Select-Object -First 1)
62
+ $expected = ($shaLine -split '\s+')[0].ToLower()
63
+ $actual = (Get-FileHash -Path $zipPath -Algorithm SHA256).Hash.ToLower()
64
+ if (-not $expected -or $actual -ne $expected) {
65
+ throw "downloaded Node failed its integrity check (expected '$expected', got '$actual')"
66
+ }
67
+ Expand-Archive -Path $zipPath -DestinationPath $nodeRoot -Force
68
+ } catch {
69
+ throw "Couldn't set up Node ($($_.Exception.Message)). Check your internet connection, then run this again - it's safe to re-run."
70
+ }
71
+ $NodeExe = Join-Path $nodeRoot "$distName\node.exe"
72
+ if (-not (Test-Path $NodeExe)) { throw "Node was downloaded but node.exe wasn't found at $NodeExe." }
73
+ Say "Node is ready."
74
+ }
75
+
76
+ # --- Git (portable) -----------------------------------------------------------
77
+ if (Test-Cmd 'git') {
78
+ Say "Git is already installed - reusing it."
79
+ } else {
80
+ Say "Setting up Git - it keeps the history of your project."
81
+ # PortableGit download/extract — deferred (needs pinned version + release URL); resolved at rehearsal.
82
+ }
83
+
84
+ # --- Launch Kindling (clean-runtime: absolute node when portable, else npx on PATH) -----------
85
+ Say "Starting Kindling..."
86
+ # Launch from a NEUTRAL directory, never the folder the download was run from. npx runs the
87
+ # package's `kindling` bin BY NAME, and Windows searches the CURRENT directory first — so if the
88
+ # downloaded `kindling.cmd` sits in the cwd, `kindling` resolves to IT instead of npx's shim and
89
+ # re-runs the whole bootstrap forever (dress-rehearsal Windows loop, 2026-07-03). LOCALAPPDATA\kindling
90
+ # holds only the portable Node, never a `kindling.cmd`.
91
+ $launchDir = Join-Path $env:LOCALAPPDATA 'kindling'
92
+ New-Item -ItemType Directory -Force -Path $launchDir | Out-Null
93
+ Set-Location -LiteralPath $launchDir
94
+ if ($null -eq $NodeExe) {
95
+ & npx -y "@aiviatic/kindling@$KindlingVersion"
96
+ } else {
97
+ # Put the provisioned Node dir on PATH so bare `node`/`npm`/`npx` resolve by NAME. Launching via the
98
+ # absolute node binary isn't enough: npx and the launched package (plus the child processes the
99
+ # engine spawns for provisioning) call `node` by name and inherit this PATH — without it they fail
100
+ # with "'node' is not recognized" and Kindling never starts. (Dress-rehearsal finding, 2026-07-03.)
101
+ $env:Path = "$(Split-Path $NodeExe);$env:Path"
102
+ # Invoke npx's CLI through the exact provisioned node binary — no reliance on PATH for the launch itself.
103
+ $NpxCli = Join-Path (Split-Path $NodeExe) 'node_modules\npm\bin\npx-cli.js'
104
+ & $NodeExe $NpxCli -y "@aiviatic/kindling@$KindlingVersion"
105
+ }
106
+ # A native exe (npx) does NOT raise a terminating error on failure even with
107
+ # ErrorActionPreference='Stop' — it only sets $LASTEXITCODE. So check that explicitly.
108
+ if ($LASTEXITCODE -ne 0) {
109
+ Say "Kindling couldn't start. Check that you're connected to the internet, then run it again. It's safe to re-run."
110
+ exit 1
111
+ }
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env bash
2
2
  # Kindling bootstrap — macOS/Linux. Served by the Landing Page as:
3
- # curl -fsSL https://kindling.aiviatic.com/go | bash
3
+ # curl -fsSL https://kindling.aiviatic.com/install | bash
4
4
  # Ensures the pinned Node + Git, then launches Kindling in the SAME shell (no new terminal).
5
5
  #
6
6
  # Pinned versions below MUST match engine/pins.ts + node-unix.ts (a unit test asserts this).
7
7
  set -euo pipefail
8
8
 
9
9
  KINDLING_NODE_VERSION="24.16.0" # == pins.node
10
- KINDLING_VERSION="0.1.0" # == pins.kindling
10
+ KINDLING_VERSION="0.1.1" # == pins.kindling
11
11
  NVM_VERSION="v0.40.3" # == NVM_VERSION (engine/provision/node-unix.ts)
12
12
  NODE_FLOOR_MAJOR=20
13
13
 
@@ -40,7 +40,7 @@ var pins = Object.freeze({
40
40
  node: "24.16.0",
41
41
  bmad: "6.9.0",
42
42
  // frozen for the Cohort #1 cycle (matches this repo's BMad install; tools + install flags verified vs the real 6.9.0 CLI 2026-07-02); bump between cohorts
43
- kindling: "0.1.0"
43
+ kindling: "0.1.1"
44
44
  });
45
45
 
46
46
  // engine/messages.ts
@@ -887,4 +887,4 @@ export {
887
887
  writeFailureLog,
888
888
  Engine
889
889
  };
890
- //# sourceMappingURL=chunk-MW7UAGER.js.map
890
+ //# sourceMappingURL=chunk-6VTQGOJR.js.map