@engenty/wizards-runtime 0.7.9 → 0.7.11

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.
Files changed (63) hide show
  1. package/LICENSE-FIGURES +37 -0
  2. package/README.md +5 -2
  3. package/TRADEMARKS.md +47 -0
  4. package/apps/runtime/dist/app.js +2 -2
  5. package/apps/runtime/dist/cli/autostart.js +90 -7
  6. package/apps/runtime/dist/cli/autoupdate.js +18 -5
  7. package/apps/runtime/dist/cli/clients.js +25 -6
  8. package/apps/runtime/dist/cli/connect.js +7 -2
  9. package/apps/runtime/dist/cli/environment.js +33 -2
  10. package/apps/runtime/dist/cli/exec.js +38 -1
  11. package/apps/runtime/dist/cli/home.js +15 -0
  12. package/apps/runtime/dist/cli/machine.js +18 -8
  13. package/apps/runtime/dist/cli/processes.js +23 -3
  14. package/apps/runtime/dist/cli/setup.js +11 -1
  15. package/apps/runtime/dist/cli/start.js +33 -7
  16. package/apps/runtime/dist/cli/uninstall.js +100 -6
  17. package/apps/runtime/dist/cli/update.js +28 -12
  18. package/apps/runtime/dist/cli/versions.js +16 -4
  19. package/apps/runtime/dist/docs/user/install.md +18 -8
  20. package/apps/runtime/dist/harness/env.js +41 -8
  21. package/apps/runtime/dist/harness/index.js +10 -1
  22. package/apps/runtime/dist/harness/model.js +1 -1
  23. package/apps/runtime/dist/render/browser-path.js +43 -11
  24. package/apps/runtime/dist/services/engenty-shapes.js +3 -2
  25. package/apps/runtime/dist/update.js +4 -0
  26. package/apps/web/dist/assets/{AboutDialog-CShc0mRo.js → AboutDialog-CPRAlD2H.js} +1 -1
  27. package/apps/web/dist/assets/{ChangelogDialog-C4dVSwtN.js → ChangelogDialog-CZrd-MgC.js} +1 -1
  28. package/apps/web/dist/assets/{ChatView-KkOboyOo.js → ChatView-DVeERQdi.js} +1 -1
  29. package/apps/web/dist/assets/{EditorPage-lQ3YgsFT.js → EditorPage-DhUoKcss.js} +1 -1
  30. package/apps/web/dist/assets/{Harness-D6mgLWTb.js → Harness-DiB8CBdY.js} +1 -1
  31. package/apps/web/dist/assets/{NewWizardChannels-CPlh_37J.js → NewWizardChannels-Ba3XGpro.js} +1 -1
  32. package/apps/web/dist/assets/{NewWizardPage-D0FVJtXK.js → NewWizardPage-C2Oh2sMM.js} +1 -1
  33. package/apps/web/dist/assets/{OnboardingPage-BXPOMrQR.js → OnboardingPage-D_4ShWrL.js} +1 -1
  34. package/apps/web/dist/assets/{ProjectPage-DroTprqs.js → ProjectPage-C58rq50b.js} +1 -1
  35. package/apps/web/dist/assets/{PublicRunner-j3qoKjQQ.js → PublicRunner-CE0ohzyd.js} +1 -1
  36. package/apps/web/dist/assets/{ReadOnly-CKgSQ2z1.js → ReadOnly-CD5YWvrW.js} +1 -1
  37. package/apps/web/dist/assets/{RunDrawer-CJZ_ISAd.js → RunDrawer-Cd8-qHV7.js} +1 -1
  38. package/apps/web/dist/assets/{SettingsPage-BHZ0Z-og.js → SettingsPage-ChYLv-MG.js} +1 -1
  39. package/apps/web/dist/assets/{SetupPage-CDkYkjJX.js → SetupPage-hX7deF0g.js} +1 -1
  40. package/apps/web/dist/assets/{SharePage-BlVjVjHG.js → SharePage-B6u9kS12.js} +1 -1
  41. package/apps/web/dist/assets/changelog-Dn9LT4MS.js +1 -0
  42. package/apps/web/dist/assets/engenty-Cko4qGFV.js +1 -0
  43. package/apps/web/dist/assets/fluffy-engenty-Db7agOjV.js +520 -0
  44. package/apps/web/dist/assets/index-4jH2mkp7.js +14 -0
  45. package/apps/web/dist/assets/index-BwW652E-.css +1 -0
  46. package/apps/web/dist/assets/{oss-credits-qGhcbqiM.js → oss-credits-Bc05Qv5H.js} +1 -1
  47. package/apps/web/dist/favicon.svg +2 -1
  48. package/apps/web/dist/icons/apple-touch-icon.png +0 -0
  49. package/apps/web/dist/icons/icon-192.png +0 -0
  50. package/apps/web/dist/icons/icon-512.png +0 -0
  51. package/apps/web/dist/icons/icon-maskable-512.png +0 -0
  52. package/apps/web/dist/index.html +3 -3
  53. package/apps/web/dist/install.ps1 +307 -0
  54. package/apps/web/dist/mcp/flow.html +33 -88
  55. package/bin/wizards.mjs +59 -35
  56. package/package.json +6 -7
  57. package/plugin/.claude-plugin/plugin.json +1 -1
  58. package/plugin/hooks/engenty.ts +3 -2
  59. package/apps/web/dist/assets/changelog-Be0i5Jjw.js +0 -1
  60. package/apps/web/dist/assets/engenty-WpMi3xwq.js +0 -1
  61. package/apps/web/dist/assets/fluffy-engenty-DPNHytrz.js +0 -575
  62. package/apps/web/dist/assets/index-C4aHMcg9.css +0 -1
  63. package/apps/web/dist/assets/index-C61HAltK.js +0 -14
@@ -0,0 +1,307 @@
1
+ # engenty wizards - installer for Windows.
2
+ #
3
+ # irm https://engenty.ai/install.ps1 | iex
4
+ #
5
+ # It needs Windows 10 or 11. It asks for an administrator only once, and only where Windows lacks
6
+ # Microsoft's Visual C++ runtime, which the runtime's database needs. Everything else goes into
7
+ # %USERPROFILE%\.engenty\wizards (ENGENTY_HOME moves it), as install.sh does on macOS and Linux:
8
+ #
9
+ # tools\node-v<version>\ its own Node; a Node you already have is left alone
10
+ # runtime\<version>\ the runtime, from the GitHub release; runtime\current is the one
11
+ # the command starts (a junction, which needs no administrator)
12
+ # bin\wizards.cmd the command, its folder on your PATH
13
+ # data\ your wizards and results (made at the first start)
14
+ #
15
+ # Then the guided setup runs (`wizards setup`). Running the installer again updates an install;
16
+ # your data is kept.
17
+ #
18
+ # Its Node is the x64 one on every Windows: a database library the runtime uses has no build for
19
+ # Windows on Arm, and Windows 11 on Arm runs x64 programs.
20
+ #
21
+ # Run as a file it takes options (`update` and `npx wizards` do that):
22
+ #
23
+ # -Yes ask nothing and install nothing optional
24
+ # -NoSetup only Node, the runtime and the command (what `update` runs)
25
+ # -Version <v> this version instead of the newest
26
+ # -Local no account: nothing leaves this computer
27
+ #
28
+ # For tests: ENGENTY_WIZARDS_PACKAGE (an npm spec or a tarball instead of the release's package),
29
+ # ENGENTY_WIZARDS_NODE_VERSION.
30
+ #
31
+ # Written for the Windows PowerShell 5.1 that Windows ships, in ASCII only: `irm | iex` reads it
32
+ # as text.
33
+ param(
34
+ [switch]$Yes,
35
+ [switch]$NoSetup,
36
+ [string]$Version = "",
37
+ [switch]$Local
38
+ )
39
+
40
+ $ErrorActionPreference = "Stop"
41
+ $ProgressPreference = "SilentlyContinue"
42
+ [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
43
+
44
+ $NodeVersion = if ($env:ENGENTY_WIZARDS_NODE_VERSION) { $env:ENGENTY_WIZARDS_NODE_VERSION } else { "24.14.0" }
45
+ $Package = "@engenty/wizards-runtime"
46
+ $PackageFile = "engenty-wizards-runtime"
47
+ $Releases = "https://github.com/engenty/wizards/releases"
48
+ $Base = if ($env:ENGENTY_HOME) { $env:ENGENTY_HOME } else { Join-Path $HOME ".engenty" }
49
+ $HomeDir = Join-Path $Base "wizards"
50
+ $Tools = Join-Path $HomeDir "tools"
51
+ $NodeDir = Join-Path $Tools "node-v$NodeVersion"
52
+ $BinDir = Join-Path $HomeDir "bin"
53
+ $Wrapper = Join-Path $BinDir "wizards.cmd"
54
+ $Log = Join-Path $HomeDir "logs\install.log"
55
+ $script:Step = "The installer"
56
+
57
+ function Say($text, $detail = "") {
58
+ Write-Host " + " -ForegroundColor Green -NoNewline
59
+ Write-Host $text -NoNewline
60
+ if ($detail) { Write-Host " $detail" -ForegroundColor DarkGray } else { Write-Host "" }
61
+ }
62
+
63
+ # A failure ends the installer, not the window: under `irm | iex`, `exit` would close the
64
+ # PowerShell the person typed into, and the message with it.
65
+ function Fail($text) { throw [InstallFailed]::new($text) }
66
+ class InstallFailed : Exception { InstallFailed([string]$m) : base($m) {} }
67
+
68
+ function Show-Failure($text) {
69
+ Write-Host " x $text" -ForegroundColor Red
70
+ if (Test-Path $Log) {
71
+ Get-Content $Log -Tail 12 | ForEach-Object { Write-Host " $_" -ForegroundColor DarkGray }
72
+ Write-Host " The whole log: $Log" -ForegroundColor DarkGray
73
+ }
74
+ }
75
+
76
+ # The exit code for a caller that ran this file (update, npx wizards); nothing under `irm | iex`.
77
+ function Done($code) { if ($PSCommandPath) { exit $code } }
78
+
79
+ function Tilde($path) {
80
+ if ($path.StartsWith($HOME)) { return "~" + $path.Substring($HOME.Length) }
81
+ return $path
82
+ }
83
+
84
+ # --- the steps -------------------------------------------------------------------------------
85
+
86
+ function Check-Platform {
87
+ $script:Step = "Looking at this machine"
88
+ if (-not [Environment]::Is64BitOperatingSystem) { Fail "32-bit Windows is not supported." }
89
+ # The machine's, not this process's: run from an emulated x64 program, Windows on Arm says AMD64.
90
+ $arch = $env:PROCESSOR_ARCHITECTURE
91
+ try { $arch = [Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString() } catch {}
92
+ if ($arch -eq "X64") { $arch = "AMD64" }
93
+ $os = [Environment]::OSVersion.Version
94
+ if ($os.Major -lt 10) { Fail "Windows 10 or 11 is needed." }
95
+ $note = if ($arch -eq "ARM64") { "the x64 Node, which Windows on Arm runs" } else { "" }
96
+ Say "Windows $($os.Major).$($os.Build) on $($arch.ToLower())" $note
97
+ }
98
+
99
+ function Install-Node {
100
+ $script:Step = "Installing Node $NodeVersion"
101
+ $node = Join-Path $NodeDir "node.exe"
102
+ if ((Test-Path $node) -and ((& $node --version) -eq "v$NodeVersion")) {
103
+ Link-Node
104
+ Say "Node $NodeVersion" "already here"
105
+ return
106
+ }
107
+ $name = "node-v$NodeVersion-win-x64"
108
+ $dist = "https://nodejs.org/dist/v$NodeVersion"
109
+ $tmp = Join-Path $Tools (".node." + [Guid]::NewGuid().ToString("N").Substring(0, 8))
110
+ New-Item -ItemType Directory -Force $tmp | Out-Null
111
+ try {
112
+ Write-Host " ... Downloading Node $NodeVersion" -ForegroundColor DarkGray
113
+ Invoke-WebRequest -UseBasicParsing "$dist/$name.zip" -OutFile "$tmp\node.zip"
114
+ # The file must be the one nodejs.org lists.
115
+ $sums = (Invoke-WebRequest -UseBasicParsing "$dist/SHASUMS256.txt").Content
116
+ $expected = ($sums -split "`n" | Where-Object { $_ -match "\s$name\.zip$" } | ForEach-Object { ($_ -split "\s+")[0] })
117
+ $actual = (Get-FileHash "$tmp\node.zip" -Algorithm SHA256).Hash.ToLower()
118
+ if (-not $expected -or $expected -ne $actual) { Fail "The Node download does not match its checksum from nodejs.org." }
119
+ Write-Host " ... Unpacking Node $NodeVersion" -ForegroundColor DarkGray
120
+ # Windows' own tar reads a zip many times faster than Expand-Archive.
121
+ $tar = Join-Path $env:SystemRoot "System32\tar.exe"
122
+ if (Test-Path $tar) {
123
+ & $tar -xf "$tmp\node.zip" -C $tmp
124
+ if ($LASTEXITCODE -ne 0) { Fail "Node could not be unpacked." }
125
+ } else {
126
+ Expand-Archive "$tmp\node.zip" -DestinationPath $tmp -Force
127
+ }
128
+ if (Test-Path $NodeDir) { Remove-Item -Recurse -Force $NodeDir }
129
+ Move-Item (Join-Path $tmp $name) $NodeDir
130
+ } finally {
131
+ Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
132
+ }
133
+ Link-Node
134
+ # An older Node of ours is not needed any more.
135
+ Get-ChildItem $Tools -Directory -Filter "node-v*" | Where-Object { $_.FullName -ne $NodeDir } |
136
+ ForEach-Object { Remove-Item -Recurse -Force $_.FullName -ErrorAction SilentlyContinue }
137
+ Say "Node $NodeVersion" "$(Tilde (Join-Path $Tools 'node')), checksum from nodejs.org matches"
138
+ }
139
+
140
+ # tools\node points at the Node of this version: a junction, which needs no administrator.
141
+ function Link-Node {
142
+ $link = Join-Path $Tools "node"
143
+ if (Test-Path $link) { (Get-Item $link).Delete() }
144
+ New-Item -ItemType Junction -Path $link -Target $NodeDir | Out-Null
145
+ }
146
+
147
+ # The database library is built with Microsoft's compiler and needs its runtime, which many
148
+ # programs bring along but a new Windows lacks. Microsoft's installer for it needs an administrator:
149
+ # Windows asks once.
150
+ function Install-VCRuntime {
151
+ $script:Step = "Installing Microsoft's Visual C++ runtime"
152
+ $keys = @(
153
+ "HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64",
154
+ "HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
155
+ )
156
+ foreach ($key in $keys) {
157
+ if ((Get-ItemProperty $key -ErrorAction SilentlyContinue).Installed -eq 1) {
158
+ Say "Microsoft Visual C++ runtime" "already here"
159
+ return
160
+ }
161
+ }
162
+ $url = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
163
+ $exe = Join-Path $env:TEMP ("vc_redist." + [Guid]::NewGuid().ToString("N").Substring(0, 8) + ".exe")
164
+ Write-Host " ... Downloading Microsoft's Visual C++ runtime, which the database needs" -ForegroundColor DarkGray
165
+ Invoke-WebRequest -UseBasicParsing $url -OutFile $exe
166
+ try {
167
+ $signature = Get-AuthenticodeSignature $exe
168
+ if ($signature.Status -ne "Valid" -or $signature.SignerCertificate.Subject -notmatch "O=Microsoft Corporation") {
169
+ Fail "The Visual C++ runtime download is not signed by Microsoft."
170
+ }
171
+ Write-Host " ... Windows asks whether Microsoft's installer may make changes: say yes" -ForegroundColor DarkGray
172
+ try {
173
+ $process = Start-Process $exe -ArgumentList "/install", "/quiet", "/norestart" -Verb RunAs -Wait -PassThru
174
+ } catch {
175
+ Fail "The Visual C++ runtime was not installed. engenty wizards needs it: $url"
176
+ }
177
+ # 3010: installed, Windows wants a restart; 1638: a newer one is there.
178
+ if (@(0, 3010, 1638) -notcontains $process.ExitCode) {
179
+ Fail "Microsoft's Visual C++ installer ended with $($process.ExitCode). Install it yourself: $url"
180
+ }
181
+ } finally {
182
+ Remove-Item -Force $exe -ErrorAction SilentlyContinue
183
+ }
184
+ Say "Microsoft Visual C++ runtime" "installed"
185
+ }
186
+
187
+ # What gets installed, decided before anything is downloaded: the tarball of the GitHub release,
188
+ # which npm installs like one from its registry; what it depends on comes from the registry.
189
+ function Find-Package {
190
+ $script:Step = "Looking for the newest release"
191
+ if ($env:ENGENTY_WIZARDS_PACKAGE) { return $env:ENGENTY_WIZARDS_PACKAGE }
192
+ $v = $Version
193
+ if (-not $v) {
194
+ $latest = Invoke-RestMethod -UseBasicParsing "https://api.github.com/repos/engenty/wizards/releases/latest"
195
+ $v = $latest.tag_name -replace "^v", ""
196
+ }
197
+ if (-not $v) { Fail "No release of engenty wizards was found at $Releases." }
198
+ return "$Releases/download/v$v/$PackageFile-$v.tgz"
199
+ }
200
+
201
+ # Each version has its folder (runtime\<version>\, an npm prefix) and `current` names the one the
202
+ # command starts, as install.sh does it: a version that runs keeps its files.
203
+ function Install-Runtime($spec) {
204
+ $script:Step = "Installing engenty wizards"
205
+ $runtime = Join-Path $HomeDir "runtime"
206
+ New-Item -ItemType Directory -Force $runtime | Out-Null
207
+ $stage = Join-Path $runtime (".staging-" + [Guid]::NewGuid().ToString("N").Substring(0, 8))
208
+ Write-Host " ... Installing engenty wizards (about 650 MB on disk, a few minutes)" -ForegroundColor DarkGray
209
+ $node = Join-Path $NodeDir "node.exe"
210
+ $npm = Join-Path $NodeDir "node_modules\npm\bin\npm-cli.js"
211
+ # Our Node first on the PATH, for npm and whatever it starts. No install scripts run; the
212
+ # runtime works without them. --legacy-peer-deps: the dependencies as the package names them.
213
+ $env:Path = "$NodeDir;$env:Path"
214
+ # npm warns on stderr, which Windows PowerShell turns into errors that stop the script.
215
+ $ErrorActionPreference = "Continue"
216
+ & $node $npm install --prefix $stage --omit=dev --ignore-scripts --legacy-peer-deps `
217
+ --no-audit --no-fund --loglevel=error $spec *>> $Log
218
+ $code = $LASTEXITCODE
219
+ $ErrorActionPreference = "Stop"
220
+ $manifest = Join-Path $stage "node_modules\$Package\package.json"
221
+ if ($code -ne 0 -or -not (Test-Path $manifest)) {
222
+ Remove-Item -Recurse -Force $stage -ErrorAction SilentlyContinue
223
+ Fail "$script:Step failed."
224
+ }
225
+ $script:Installed = (Get-Content $manifest -Raw | ConvertFrom-Json).version
226
+ $current = Join-Path $runtime "current"
227
+ $previous = if (Test-Path $current) { Split-Path -Leaf ((Get-Item $current).Target | Select-Object -First 1) } else { "" }
228
+ $into = Join-Path $runtime $script:Installed
229
+ if (Test-Path $into) { Remove-Item -Recurse -Force $into }
230
+ Move-Item $stage $into
231
+ if (Test-Path $current) { (Get-Item $current).Delete() }
232
+ New-Item -ItemType Junction -Path $current -Target $into | Out-Null
233
+ # This version and the one before stay; older ones go (one that still runs keeps its files).
234
+ Get-ChildItem $runtime -Directory | Where-Object { $_.Name -match "^\d+\.\d+\.\d+$" -and $_.Name -ne $script:Installed -and $_.Name -ne $previous } |
235
+ ForEach-Object { Remove-Item -Recurse -Force $_.FullName -ErrorAction SilentlyContinue }
236
+ Say "engenty wizards $script:Installed" (Tilde $into)
237
+ }
238
+
239
+ function Write-Command {
240
+ $script:Step = "Writing the command"
241
+ New-Item -ItemType Directory -Force $BinDir | Out-Null
242
+ $lines = @(
243
+ "@echo off",
244
+ "rem engenty wizards - written by install.ps1; running the installer again rewrites it."
245
+ )
246
+ # An install outside ~\.engenty finds its folder again through the command.
247
+ if ($Base -ne (Join-Path $HOME ".engenty")) {
248
+ $lines += "if not defined ENGENTY_HOME set ""ENGENTY_HOME=$Base"""
249
+ }
250
+ # `(goto) 2>nul &` leaves the batch file before Node starts: cmd.exe would read on in it after
251
+ # Node ends, and `wizards uninstall` deletes it meanwhile. Node's exit code stays cmd's.
252
+ $lines += "(goto) 2>nul & ""$(Join-Path $Tools 'node\node.exe')"" ""$(Join-Path $HomeDir "runtime\current\node_modules\$Package\bin\wizards.mjs")"" %*"
253
+ Set-Content -Path $Wrapper -Value $lines -Encoding Ascii
254
+ # The command's folder on the user's PATH; a terminal opened before sees it after a restart.
255
+ $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
256
+ $entries = if ($userPath) { $userPath -split ";" } else { @() }
257
+ if ($entries -notcontains $BinDir) {
258
+ [Environment]::SetEnvironmentVariable("Path", (($entries + $BinDir) | Where-Object { $_ }) -join ";", "User")
259
+ Say "Command" "$(Tilde $Wrapper), its folder added to your PATH"
260
+ } else {
261
+ Say "Command" (Tilde $Wrapper)
262
+ }
263
+ if (($env:Path -split ";") -notcontains $BinDir) { $env:Path = "$BinDir;$env:Path" }
264
+ }
265
+
266
+ # --- main ------------------------------------------------------------------------------------
267
+
268
+ New-Item -ItemType Directory -Force (Join-Path $HomeDir "logs"), $Tools, $BinDir | Out-Null
269
+ # An uninstall whose clean-up waits for the next login would delete this install then.
270
+ Remove-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "engenty-wizards-uninstall" -ErrorAction SilentlyContinue
271
+ Add-Content $Log "`n--- $((Get-Date).ToUniversalTime().ToString('s'))Z install.ps1"
272
+ Write-Host ""
273
+ Write-Host " engenty wizards" -ForegroundColor Magenta -NoNewline
274
+ Write-Host " Make a wish. Get your wizard." -ForegroundColor DarkGray
275
+ Write-Host ""
276
+ Write-Host " Installing into $(Tilde $HomeDir)"
277
+ $failed = $false
278
+ try {
279
+ Check-Platform
280
+ $spec = Find-Package
281
+ Install-Node
282
+ Install-VCRuntime
283
+ Install-Runtime $spec
284
+ Write-Command
285
+ } catch [InstallFailed] {
286
+ Show-Failure $_.Exception.Message
287
+ $failed = $true
288
+ } catch {
289
+ Add-Content $Log $_.ToString()
290
+ Show-Failure "$script:Step failed: $($_.Exception.Message)"
291
+ $failed = $true
292
+ }
293
+
294
+ if ($failed) {
295
+ Done 1
296
+ } elseif ($NoSetup) {
297
+ Write-Host " Installed engenty wizards $script:Installed."
298
+ Done 0
299
+ } else {
300
+ Write-Host " Installed. The setup follows."
301
+ Write-Host ""
302
+ $setupArgs = @("setup")
303
+ if ($Yes) { $setupArgs += "--yes" }
304
+ if ($Local) { $setupArgs += "--local" }
305
+ & $Wrapper @setupArgs
306
+ Done $LASTEXITCODE
307
+ }