@cats-inc/cats-platform 0.1.7 → 0.1.9

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 (76) hide show
  1. package/README.md +8 -8
  2. package/build/desktop/bootstrapPage.d.ts.map +1 -1
  3. package/build/desktop/bootstrapPage.js +5 -1
  4. package/build/desktop/bootstrapPage.js.map +1 -1
  5. package/build/desktop/cliInventoryProbe.d.ts.map +1 -1
  6. package/build/desktop/cliInventoryProbe.js +12 -0
  7. package/build/desktop/cliInventoryProbe.js.map +1 -1
  8. package/build/desktop/contracts.d.ts +1 -1
  9. package/build/desktop/contracts.d.ts.map +1 -1
  10. package/build/desktop/contracts.js +4 -0
  11. package/build/desktop/contracts.js.map +1 -1
  12. package/build/desktop/main.js +41 -9
  13. package/build/desktop/main.js.map +1 -1
  14. package/build/desktop/packaging.d.ts.map +1 -1
  15. package/build/desktop/packaging.js +62 -0
  16. package/build/desktop/packaging.js.map +1 -1
  17. package/build/desktop/setupAssets.d.ts.map +1 -1
  18. package/build/desktop/setupAssets.js +134 -0
  19. package/build/desktop/setupAssets.js.map +1 -1
  20. package/build/desktop/updateInstallHandoff.d.ts +14 -0
  21. package/build/desktop/updateInstallHandoff.d.ts.map +1 -1
  22. package/build/desktop/updateInstallHandoff.js +23 -0
  23. package/build/desktop/updateInstallHandoff.js.map +1 -1
  24. package/build/desktop/updateManager.d.ts.map +1 -1
  25. package/build/desktop/updateManager.js +8 -0
  26. package/build/desktop/updateManager.js.map +1 -1
  27. package/build/desktop/updaterAdapter.d.ts +16 -1
  28. package/build/desktop/updaterAdapter.d.ts.map +1 -1
  29. package/build/desktop/updaterAdapter.js +49 -2
  30. package/build/desktop/updaterAdapter.js.map +1 -1
  31. package/build/renderer/assets/{ActiveSessionPermissionChip-BRMLwkvf.js → ActiveSessionPermissionChip-Dl2UOFgh.js} +1 -1
  32. package/build/renderer/assets/{App-BM2nzo6s.js → App-C57f4p8k.js} +1 -1
  33. package/build/renderer/assets/{App-CVQAwCMi.js → App-CPqGDXVi.js} +1 -1
  34. package/build/renderer/assets/{App-Dl5FLaR_.js → App-ChvP0G9X.js} +1 -1
  35. package/build/renderer/assets/{WorkspaceAppRoutes-C3DUzdbj.js → WorkspaceAppRoutes-DYg2vnjz.js} +1 -1
  36. package/build/renderer/assets/{app-hP5h2jAt.js → app-DVN9Ghrk.js} +3 -3
  37. package/build/renderer/assets/{conversationSidebarRecentEntries-B-mNvfiy.js → conversationSidebarRecentEntries-XZVCnMLw.js} +1 -1
  38. package/build/renderer/assets/{useDraftSessionChips-DuXIoptW.js → useDraftSessionChips-By3XXabI.js} +1 -1
  39. package/build/renderer/index.html +1 -1
  40. package/build/server/shared/providerCatalog.d.ts +2 -2
  41. package/build/server/shared/providerCatalog.d.ts.map +1 -1
  42. package/build/server/shared/providerCatalogData.d.ts +11 -1
  43. package/build/server/shared/providerCatalogData.d.ts.map +1 -1
  44. package/build/server/shared/providerCatalogData.js +8 -0
  45. package/build/server/shared/providerCatalogData.js.map +1 -1
  46. package/build/server/shared/providerCatalogInstances.d.ts.map +1 -1
  47. package/build/server/shared/providerCatalogInstances.js +6 -0
  48. package/build/server/shared/providerCatalogInstances.js.map +1 -1
  49. package/package.json +6 -3
  50. package/scripts/README.md +51 -2
  51. package/scripts/linux/install-aider.sh +8 -0
  52. package/scripts/linux/install-cline.sh +8 -0
  53. package/scripts/linux/install-devin.sh +8 -0
  54. package/scripts/linux/install-grok.sh +8 -0
  55. package/scripts/linux/install-pi.sh +1 -1
  56. package/scripts/linux/node-cli-common.sh +43 -3
  57. package/scripts/linux/provider-cli-common.sh +162 -24
  58. package/scripts/linux/test-linux-package-smoke.sh +16 -0
  59. package/scripts/linux/upgrade-cli-tools.sh +2 -2
  60. package/scripts/macos/install-aider.sh +8 -0
  61. package/scripts/macos/install-cline.sh +8 -0
  62. package/scripts/macos/install-devin.sh +8 -0
  63. package/scripts/macos/install-grok.sh +8 -0
  64. package/scripts/macos/install-pi.sh +1 -1
  65. package/scripts/macos/node-cli-common.sh +43 -3
  66. package/scripts/macos/provider-cli-common.sh +162 -24
  67. package/scripts/macos/test-macos-package-smoke.sh +15 -0
  68. package/scripts/macos/upgrade-cli-tools.sh +2 -2
  69. package/scripts/windows/Check-WindowsSetupReadiness.ps1 +32 -1
  70. package/scripts/windows/Install-Aider.ps1 +368 -0
  71. package/scripts/windows/Install-Cline.ps1 +39 -0
  72. package/scripts/windows/Install-Devin.ps1 +385 -0
  73. package/scripts/windows/Install-Grok.ps1 +355 -0
  74. package/scripts/windows/Install-Pi.ps1 +1 -1
  75. package/scripts/windows/Test-WindowsInstallerSmoke.ps1 +23 -0
  76. package/scripts/windows/_NpmCliInstaller.ps1 +41 -0
@@ -0,0 +1,368 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Install or verify the native Windows Aider for Cats.
4
+
5
+ .DESCRIPTION
6
+ Cats-owned packaged setup wrapper for Aider. The official installer is the
7
+ uv installer plus `uv tool install --force --python python3.12 --with pip
8
+ aider-chat@latest`, so the entry point at %USERPROFILE%\.local\bin\aider.exe
9
+ is a uv tool shim rather than the tool itself. Uninstall therefore runs
10
+ `uv tool uninstall aider-chat` before removing paths.
11
+
12
+ Cats installs and detects Aider but cannot run sessions through it: 0.86.2
13
+ has no machine-readable output, no ACP or server mode, and exits 0 even when
14
+ the model call fails.
15
+ #>
16
+ param(
17
+ [switch]$CheckOnly,
18
+ [switch]$Apply,
19
+ [switch]$Upgrade,
20
+ [switch]$Force,
21
+ [switch]$Uninstall,
22
+ [switch]$DryRun,
23
+ [switch]$Json,
24
+ [switch]$AllowAdmin,
25
+ [ValidateSet('auto', 'installed', 'missing')]
26
+ [string]$InstallState = 'auto',
27
+ [string]$DetectedVersion = '',
28
+ [switch]$SkipInstaller
29
+ )
30
+
31
+ Set-StrictMode -Version Latest
32
+ $ErrorActionPreference = 'Stop'
33
+
34
+ . (Join-Path $PSScriptRoot '_HiddenProcess.ps1')
35
+ . (Join-Path $PSScriptRoot '_PackagedUninstall.ps1')
36
+
37
+ function Write-StructuredResult {
38
+ param(
39
+ [pscustomobject]$Result,
40
+ [int]$ExitCode
41
+ )
42
+
43
+ if ($Json) {
44
+ $Result | ConvertTo-Json -Depth 10
45
+ } else {
46
+ Write-Host "Mode: $($Result.mode)"
47
+ Write-Host "Status: $($Result.status)"
48
+ Write-Host "Installed: $($Result.installed)"
49
+ if ($Result.detectedVersion) { Write-Host "Version: $($Result.detectedVersion)" }
50
+ foreach ($action in $Result.plannedActions) { Write-Host "Planned action: $action" }
51
+ foreach ($warning in $Result.warnings) { Write-Host "Warning: $warning" }
52
+ foreach ($step in $Result.manualSteps) { Write-Host "Manual step: $step" }
53
+ }
54
+
55
+ exit $ExitCode
56
+ }
57
+
58
+ function Resolve-AiderInstallDir {
59
+ return Join-Path $env:USERPROFILE '.local\bin'
60
+ }
61
+
62
+ function Resolve-AiderExecutablePath {
63
+ return Join-Path (Resolve-AiderInstallDir) 'aider.exe'
64
+ }
65
+
66
+ function Refresh-UserPath {
67
+ $env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'User') + ';' +
68
+ [System.Environment]::GetEnvironmentVariable('Path', 'Machine')
69
+ }
70
+
71
+ function Detect-AiderInstall {
72
+ $exePath = Resolve-AiderExecutablePath
73
+
74
+ if ($InstallState -eq 'installed') {
75
+ return [pscustomobject]@{
76
+ installed = $true
77
+ commandPath = $exePath
78
+ detectedVersion = $DetectedVersion
79
+ }
80
+ }
81
+ if ($InstallState -eq 'missing') {
82
+ return [pscustomobject]@{
83
+ installed = $false
84
+ commandPath = $exePath
85
+ detectedVersion = $DetectedVersion
86
+ }
87
+ }
88
+
89
+ Refresh-UserPath
90
+ $command = Get-Command aider -ErrorAction SilentlyContinue
91
+ $installed = $null -ne $command -or (Test-Path -LiteralPath $exePath -PathType Leaf)
92
+ $commandPath = if ($null -ne $command) { $command.Source } else { $exePath }
93
+ $commandSource = if ($null -ne $command) { $command.Source } else { '' }
94
+ $version = $DetectedVersion
95
+ $versionProbePath = Resolve-HiddenVersionProbePath `
96
+ -PreferredPath $commandSource `
97
+ -FallbackPath $exePath
98
+
99
+ if ($installed -and [string]::IsNullOrWhiteSpace($version) -and $versionProbePath) {
100
+ try {
101
+ $version = Get-HiddenCommandText -FileName $versionProbePath -ArgumentList @('--version')
102
+ } catch {
103
+ $version = ''
104
+ }
105
+ }
106
+
107
+ return [pscustomobject]@{
108
+ installed = $installed
109
+ commandPath = $commandPath
110
+ detectedVersion = $version
111
+ }
112
+ }
113
+
114
+ function Add-AiderToUserPath {
115
+ $installDir = Resolve-AiderInstallDir
116
+ $userPath = [System.Environment]::GetEnvironmentVariable('Path', 'User')
117
+ if ([string]::IsNullOrWhiteSpace($userPath)) {
118
+ [System.Environment]::SetEnvironmentVariable('Path', $installDir, 'User')
119
+ } elseif ($userPath -notlike "*$installDir*") {
120
+ [System.Environment]::SetEnvironmentVariable('Path', "$installDir;$userPath", 'User')
121
+ }
122
+ Refresh-UserPath
123
+ }
124
+
125
+ function Invoke-AiderInstaller {
126
+ if ($SkipInstaller) {
127
+ return [pscustomobject]@{ skipped = $true; success = $true; exitCode = 0; stderr = '' }
128
+ }
129
+
130
+ $tempScript = [System.IO.Path]::Combine(
131
+ [System.IO.Path]::GetTempPath(),
132
+ "cats-aider-install-$([System.Guid]::NewGuid().ToString('N')).ps1"
133
+ )
134
+ $stdoutPath = "$tempScript.stdout"
135
+ $stderrPath = "$tempScript.stderr"
136
+ $bootstrap = @'
137
+ & {
138
+ $previousErrorActionPreference = $ErrorActionPreference
139
+ try {
140
+ Invoke-RestMethod 'https://aider.chat/install.ps1' | Invoke-Expression
141
+ } finally {
142
+ $ErrorActionPreference = $previousErrorActionPreference
143
+ }
144
+ }
145
+ '@
146
+
147
+ try {
148
+ [System.IO.File]::WriteAllText(
149
+ $tempScript,
150
+ $bootstrap,
151
+ [System.Text.UTF8Encoding]::new($false)
152
+ )
153
+ $powerShellExe = if (Get-Command pwsh.exe -ErrorAction SilentlyContinue) {
154
+ 'pwsh.exe'
155
+ } else {
156
+ 'powershell.exe'
157
+ }
158
+ $process = Start-Process -FilePath $powerShellExe `
159
+ -ArgumentList @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', $tempScript) `
160
+ -Wait -PassThru -NoNewWindow `
161
+ -RedirectStandardOutput $stdoutPath `
162
+ -RedirectStandardError $stderrPath
163
+ $stderrRaw = if (Test-Path -LiteralPath $stderrPath -PathType Leaf) {
164
+ Get-Content -LiteralPath $stderrPath -Raw -ErrorAction SilentlyContinue
165
+ } else { $null }
166
+
167
+ return [pscustomobject]@{
168
+ skipped = $false
169
+ success = ($process.ExitCode -eq 0)
170
+ exitCode = $process.ExitCode
171
+ stderr = if ($null -eq $stderrRaw) { '' } else { [string]$stderrRaw }
172
+ }
173
+ } catch {
174
+ return [pscustomobject]@{
175
+ skipped = $false
176
+ success = $false
177
+ exitCode = -1
178
+ stderr = "Failed to invoke Aider installer: $($_.Exception.Message)"
179
+ }
180
+ } finally {
181
+ foreach ($path in @($tempScript, $stdoutPath, $stderrPath)) {
182
+ if (Test-Path -LiteralPath $path -PathType Leaf) {
183
+ Remove-Item -LiteralPath $path -Force -ErrorAction SilentlyContinue
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ if (-not $CheckOnly -and -not $Apply -and -not $Upgrade -and -not $Force -and -not $Uninstall) {
190
+ $CheckOnly = $true
191
+ }
192
+
193
+ $mutationCount = @($Apply, $Upgrade, $Force | Where-Object { $_ }).Count
194
+ if ($Uninstall -and ($CheckOnly -or $mutationCount -gt 0)) {
195
+ throw 'Install-Aider.ps1 -Uninstall is mutually exclusive with other modes.'
196
+ }
197
+ if ($CheckOnly -and $mutationCount -gt 0) {
198
+ throw 'Install-Aider.ps1 accepts either -CheckOnly or one mutation mode.'
199
+ }
200
+ if ($mutationCount -gt 1) {
201
+ throw 'Install-Aider.ps1 accepts at most one of -Apply / -Upgrade / -Force.'
202
+ }
203
+
204
+ $executionMode = if ($Uninstall) {
205
+ 'uninstall'
206
+ } elseif ($CheckOnly) {
207
+ 'check'
208
+ } elseif ($Force) {
209
+ 'force'
210
+ } elseif ($Upgrade) {
211
+ 'upgrade'
212
+ } else {
213
+ 'apply'
214
+ }
215
+
216
+ if ($Uninstall) {
217
+ # %USERPROFILE%\.local\bin\aider.exe is a uv tool shim, not the tool.
218
+ # Removing only the shim leaves aider-chat installed in the uv tool
219
+ # environment, so uv uninstalls it first and path removal mops up the rest.
220
+ #
221
+ # The uv binary itself is deliberately left alone: Aider's installer drops its
222
+ # own uv next to the shim, users commonly have another, and the helper cannot
223
+ # tell them apart (SPEC-112 PD4).
224
+ if (-not $DryRun) {
225
+ if (Get-Command uv -ErrorAction SilentlyContinue) {
226
+ & uv tool uninstall aider-chat 2>$null | Out-Null
227
+ }
228
+ }
229
+
230
+ Invoke-PackagedProviderUninstall `
231
+ -HelperId 'windows-aider-native-installer' `
232
+ -UserBinaryPath (Resolve-AiderExecutablePath) `
233
+ -ExtraUserOwnedPaths @() `
234
+ -RedetectCommand { Detect-AiderInstall } `
235
+ -EmitJson:$Json `
236
+ -DryRun:$DryRun
237
+ }
238
+
239
+ $isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).
240
+ IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
241
+ if ($isAdmin -and -not $AllowAdmin) {
242
+ Write-StructuredResult -Result ([pscustomobject]@{
243
+ helper = 'windows-aider-native-installer'
244
+ mode = $executionMode
245
+ status = 'failed'
246
+ installed = $false
247
+ detectedVersion = $null
248
+ commandPath = Resolve-AiderExecutablePath
249
+ restartRequired = $false
250
+ plannedActions = @()
251
+ warnings = @('Refusing to run under an elevated shell without -AllowAdmin because Aider is intended for user-scoped installation.')
252
+ appliedChanges = @()
253
+ manualSteps = @()
254
+ interruptions = @()
255
+ }) -ExitCode 1
256
+ }
257
+
258
+ $detected = Detect-AiderInstall
259
+ $plannedActions = [System.Collections.Generic.List[string]]::new()
260
+ $appliedChanges = [System.Collections.Generic.List[string]]::new()
261
+ $warnings = [System.Collections.Generic.List[string]]::new()
262
+ $manualSteps = [System.Collections.Generic.List[string]]::new()
263
+
264
+ if ($Force) {
265
+ $plannedActions.Add('reinstall_aider_native')
266
+ } elseif ($Upgrade -and $detected.installed) {
267
+ $plannedActions.Add('upgrade_aider_native')
268
+ } elseif (-not $detected.installed) {
269
+ $plannedActions.Add('install_aider_native')
270
+ }
271
+
272
+ if ($CheckOnly) {
273
+ Write-StructuredResult -Result ([pscustomobject]@{
274
+ helper = 'windows-aider-native-installer'
275
+ mode = 'check'
276
+ status = if ($detected.installed) { 'ready' } else { 'not_installed' }
277
+ installed = [bool]$detected.installed
278
+ detectedVersion = if ($detected.detectedVersion) { $detected.detectedVersion } else { $null }
279
+ commandPath = $detected.commandPath
280
+ restartRequired = $false
281
+ plannedActions = $plannedActions.ToArray()
282
+ warnings = @()
283
+ appliedChanges = @()
284
+ manualSteps = @()
285
+ interruptions = @()
286
+ }) -ExitCode 0
287
+ }
288
+
289
+ $shouldInstall = $Force -or $Upgrade -or -not $detected.installed
290
+ $installFailed = $false
291
+ $installSkipped = $false
292
+ if ($shouldInstall) {
293
+ if ($DryRun) {
294
+ $warnings.Add('Dry-run requested; Aider installer invocation was skipped.')
295
+ $installSkipped = $true
296
+ } else {
297
+ $installResult = Invoke-AiderInstaller
298
+ $installSkipped = [bool]$installResult.skipped
299
+ $installFailed = (-not $installSkipped) -and (-not $installResult.success)
300
+ if ($installSkipped) {
301
+ $warnings.Add('Installer invocation was skipped by request.')
302
+ } elseif ($installFailed) {
303
+ $stderrSnippet = if ([string]::IsNullOrWhiteSpace($installResult.stderr)) {
304
+ 'no stderr captured'
305
+ } else {
306
+ ($installResult.stderr.Trim() -split "`r?`n" |
307
+ Where-Object { -not [string]::IsNullOrWhiteSpace($_) } |
308
+ Select-Object -Last 8) -join ' | '
309
+ }
310
+ $warnings.Add("Aider installer exited $($installResult.exitCode): $stderrSnippet")
311
+ }
312
+
313
+ Start-Sleep -Seconds 2
314
+ Add-AiderToUserPath
315
+ $detected = Detect-AiderInstall
316
+ if (-not $detected.installed -and -not $installSkipped -and -not $installFailed) {
317
+ $warnings.Add('Aider installation completed but aider.exe was not detected at the expected path.')
318
+ $installFailed = $true
319
+ }
320
+ }
321
+
322
+ if (-not $installFailed -and -not ($DryRun -and $shouldInstall)) {
323
+ if ($Force) {
324
+ $appliedChanges.Add('reinstall_aider_native')
325
+ } elseif ($Upgrade) {
326
+ $appliedChanges.Add('upgrade_aider_native')
327
+ } else {
328
+ $appliedChanges.Add('install_aider_native')
329
+ }
330
+ }
331
+ }
332
+
333
+ $manualSteps.Add('Run `aider login` or set XAI_API_KEY before first use.')
334
+ $interruptions = [System.Collections.Generic.List[object]]::new()
335
+ if ($shouldInstall -and -not $installFailed -and -not $DryRun) {
336
+ $interruptions.Add([pscustomobject]@{
337
+ kind = 'relaunch_required'
338
+ summary = 'Relaunch Cats Desktop Host after the Aider install step, then rerun the packaged setup check.'
339
+ resumable = $true
340
+ requiresRestart = $false
341
+ requiresElevation = $false
342
+ })
343
+ }
344
+
345
+ $status = if ($installFailed) {
346
+ 'failed'
347
+ } elseif ($DryRun -and $shouldInstall) {
348
+ 'preview'
349
+ } elseif ($interruptions.Count -gt 0) {
350
+ [string]$interruptions[0].kind
351
+ } else {
352
+ 'ready'
353
+ }
354
+
355
+ Write-StructuredResult -Result ([pscustomobject]@{
356
+ helper = 'windows-aider-native-installer'
357
+ mode = $executionMode
358
+ status = $status
359
+ installed = [bool]$detected.installed
360
+ detectedVersion = if ($detected.detectedVersion) { $detected.detectedVersion } else { $null }
361
+ commandPath = $detected.commandPath
362
+ restartRequired = $false
363
+ plannedActions = $plannedActions.ToArray()
364
+ warnings = $warnings.ToArray()
365
+ appliedChanges = $appliedChanges.ToArray()
366
+ manualSteps = $manualSteps.ToArray()
367
+ interruptions = $interruptions.ToArray()
368
+ }) -ExitCode $(if ($installFailed) { 1 } else { 0 })
@@ -0,0 +1,39 @@
1
+ param(
2
+ [switch]$CheckOnly,
3
+ [switch]$Apply,
4
+ [switch]$Upgrade,
5
+ [switch]$Force,
6
+ [switch]$Uninstall,
7
+ [switch]$DryRun,
8
+ [switch]$Json,
9
+ [switch]$AllowAdmin,
10
+ [ValidateSet('auto', 'installed', 'missing')]
11
+ [string]$InstallState = 'auto',
12
+ [ValidateSet('auto', 'outdated', 'current')]
13
+ [string]$OutdatedState = 'auto',
14
+ [string]$DetectedVersion = '',
15
+ [switch]$SkipNpmInvocation
16
+ )
17
+
18
+ Set-StrictMode -Version Latest
19
+ $ErrorActionPreference = 'Stop'
20
+
21
+ . (Join-Path $PSScriptRoot '_NpmCliInstaller.ps1')
22
+
23
+ Invoke-PackagedNpmCliInstall `
24
+ -HelperId 'windows-cline-native-installer' `
25
+ -PackageName 'cline' `
26
+ -CommandName 'cline' `
27
+ -DisplayName 'Cline CLI' `
28
+ -CheckOnly:$CheckOnly `
29
+ -Apply:$Apply `
30
+ -Upgrade:$Upgrade `
31
+ -Force:$Force `
32
+ -Uninstall:$Uninstall `
33
+ -DryRun:$DryRun `
34
+ -Json:$Json `
35
+ -AllowAdmin:$AllowAdmin `
36
+ -InstallState $InstallState `
37
+ -OutdatedState $OutdatedState `
38
+ -DetectedVersion $DetectedVersion `
39
+ -SkipNpmInvocation:$SkipNpmInvocation