@xenosystem/agent-cli 0.5.191 → 0.5.192
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/dist/cli.js +3 -3
- package/dist/index.js +2692 -2663
- package/dist/metafile-esm.json +1 -1
- package/dist/sdk-build-identity.json +12 -12
- package/native/xeno-pty/prebuilds/win32-x64/manifest.json +18 -18
- package/package.json +13 -6
- package/scripts/install-standalone.ps1 +326 -0
- package/scripts/install-standalone.sh +298 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@xenosystem/agent-sdk",
|
|
4
|
-
"version": "0.10.
|
|
5
|
-
"cliBundleSha256": "
|
|
4
|
+
"version": "0.10.126",
|
|
5
|
+
"cliBundleSha256": "bb880f70d04e639b11c8cfe53914f64485cc1b6bb200ebf4d4d6af71472537c7",
|
|
6
6
|
"inputs": [
|
|
7
7
|
{
|
|
8
8
|
"path": "dist/agents/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"path": "dist/artifacts/index.js",
|
|
13
|
-
"sha256": "
|
|
13
|
+
"sha256": "92914d0878541c97ff331dc56724290fd96f03a149bfd815cc25a6de51c34b4d"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"path": "dist/control-room/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "dist/governance/index.js",
|
|
33
|
-
"sha256": "
|
|
33
|
+
"sha256": "3a46096d799491ab19fe8e0ce7a4ff6b647ed703b3e500bded376d8ccad5b45c"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"path": "dist/hooks/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "dist/index.js",
|
|
45
|
-
"sha256": "
|
|
45
|
+
"sha256": "df9d43a2c9f4251c743d65519ef7d201b0230e9dc337e1de7e898253898444ab"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"path": "dist/intelligence/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"path": "dist/recipes/index.js",
|
|
73
|
-
"sha256": "
|
|
73
|
+
"sha256": "3f514647ac9497174af2622d19f0cc1e6de106f228126b707d69f2a188c3af1e"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"path": "dist/research/index.js",
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"path": "dist/runs/index.js",
|
|
81
|
-
"sha256": "
|
|
81
|
+
"sha256": "761a2b0fddcbcbe755b706974be8025414b0e021e87c84309640658dd7f8d081"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"path": "dist/schedules/index.js",
|
|
85
|
-
"sha256": "
|
|
85
|
+
"sha256": "118bead993b3a320c30fecfa743b59f1b70a6e050cc875db4ba589d98a83da73"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"path": "dist/share/index.js",
|
|
89
|
-
"sha256": "
|
|
89
|
+
"sha256": "a93f711fd90cb2378ee85e331c8c9d35dd214b8cad690aa54b4f44a3734f9cc7"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"path": "dist/sharing/index.js",
|
|
@@ -185,15 +185,15 @@
|
|
|
185
185
|
"emitted": [
|
|
186
186
|
{
|
|
187
187
|
"path": "cli.js",
|
|
188
|
-
"sha256": "
|
|
188
|
+
"sha256": "3ff6b43972d4acfbf04c8371a56130bf28503c9be2f9fd198d7c4712e915b119"
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
"path": "index.js",
|
|
192
|
-
"sha256": "
|
|
192
|
+
"sha256": "bb880f70d04e639b11c8cfe53914f64485cc1b6bb200ebf4d4d6af71472537c7"
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
"path": "metafile-esm.json",
|
|
196
|
-
"sha256": "
|
|
196
|
+
"sha256": "0e504275ff902c168442539e8c31c53f835a615b13b07ea219166d9baa6b20c2"
|
|
197
197
|
}
|
|
198
198
|
]
|
|
199
199
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 2,
|
|
3
|
-
"component": "xeno-pty",
|
|
4
|
-
"binary": "xeno_pty.node",
|
|
5
|
-
"apiVersion": 1,
|
|
6
|
-
"platform": "win32",
|
|
7
|
-
"architecture": "x64",
|
|
8
|
-
"abi": "napi-v8",
|
|
9
|
-
"napi": 8,
|
|
10
|
-
"minimumNode": "20.0.0",
|
|
11
|
-
"nodeHeaders": "24.
|
|
12
|
-
"compiler": "Microsoft (R) C/C++ Optimizing Compiler Version 19.
|
|
13
|
-
"sourceSha256": "3da3e5b6c553f76d9adb3078507c9d615e5dcae9fe5f8b86094e219c7ad768fa",
|
|
14
|
-
"sha256": "
|
|
15
|
-
"signature": {
|
|
16
|
-
"status": "unsigned-development"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"component": "xeno-pty",
|
|
4
|
+
"binary": "xeno_pty.node",
|
|
5
|
+
"apiVersion": 1,
|
|
6
|
+
"platform": "win32",
|
|
7
|
+
"architecture": "x64",
|
|
8
|
+
"abi": "napi-v8",
|
|
9
|
+
"napi": 8,
|
|
10
|
+
"minimumNode": "20.0.0",
|
|
11
|
+
"nodeHeaders": "24.22.1",
|
|
12
|
+
"compiler": "Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35229 for x64",
|
|
13
|
+
"sourceSha256": "3da3e5b6c553f76d9adb3078507c9d615e5dcae9fe5f8b86094e219c7ad768fa",
|
|
14
|
+
"sha256": "29377736d8c7bb29b7a43c7be97365a689fa24336bd702704c54e735419e7d71",
|
|
15
|
+
"signature": {
|
|
16
|
+
"status": "unsigned-development"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.192",
|
|
4
4
|
"xenoInstallProtocol": 1,
|
|
5
5
|
"description": "Autonomous developer agent CLI for continuous software engineering across repositories, terminals, and model backends",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"xeno-code": "dist/cli.js"
|
|
15
15
|
},
|
|
16
16
|
"pkg": {
|
|
17
|
+
"scripts": [
|
|
18
|
+
"dist/cli.js",
|
|
19
|
+
"dist/index.js"
|
|
20
|
+
],
|
|
17
21
|
"assets": [
|
|
18
22
|
"native/xeno-pty/prebuilds/**/manifest.json",
|
|
19
23
|
"native/xeno-pty/prebuilds/**/*.node",
|
|
@@ -31,6 +35,8 @@
|
|
|
31
35
|
"ownership/",
|
|
32
36
|
"scripts/install.sh",
|
|
33
37
|
"scripts/install.ps1",
|
|
38
|
+
"scripts/install-standalone.sh",
|
|
39
|
+
"scripts/install-standalone.ps1",
|
|
34
40
|
"README.md",
|
|
35
41
|
"LICENSE",
|
|
36
42
|
"THIRD_PARTY_NOTICES.md"
|
|
@@ -74,11 +80,12 @@
|
|
|
74
80
|
"license": "UNLICENSED",
|
|
75
81
|
"dependencies": {
|
|
76
82
|
"@xeno-corporation/account": "0.4.3",
|
|
77
|
-
"@xenosystem/agent-
|
|
78
|
-
"@xenosystem/agent-interface-
|
|
79
|
-
"@xenosystem/agent-interface-
|
|
80
|
-
"@xenosystem/agent-interface-
|
|
81
|
-
"@xenosystem/agent-
|
|
83
|
+
"@xenosystem/agent-host": "0.1.211",
|
|
84
|
+
"@xenosystem/agent-interface-client": "0.1.211",
|
|
85
|
+
"@xenosystem/agent-interface-contract": "0.1.211",
|
|
86
|
+
"@xenosystem/agent-interface-host": "0.1.211",
|
|
87
|
+
"@xenosystem/agent-interface-runtime": "0.1.211",
|
|
88
|
+
"@xenosystem/agent-sdk": "0.10.126",
|
|
82
89
|
"@xenosystem/primitives": "0.6.0",
|
|
83
90
|
"@xenosystem/web-context-client": "0.1.5",
|
|
84
91
|
"undici": "6.29.1",
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
<#
|
|
2
|
+
XENO Agent CLI - standalone installer (Windows)
|
|
3
|
+
|
|
4
|
+
irm https://xenosystem.ai/install.ps1 | iex
|
|
5
|
+
|
|
6
|
+
Installs a self-contained `xeno.exe` (embedded Node.js runtime + the audited
|
|
7
|
+
native ConPTY addon). No Node.js, no npm, and no package registry are required
|
|
8
|
+
on the target machine.
|
|
9
|
+
|
|
10
|
+
---------------------------------------------------------------------------
|
|
11
|
+
TRUST MODEL - read before changing anything below.
|
|
12
|
+
|
|
13
|
+
Piping a script into a shell makes XENO the trust anchor: there is no package
|
|
14
|
+
manager review layer between this file and the user's machine. Therefore:
|
|
15
|
+
|
|
16
|
+
1. TLS to updates.xenostudio.ai authenticates the ORIGIN.
|
|
17
|
+
2. SHA256SUMS.txt (fetched from that same origin, per version) authenticates
|
|
18
|
+
the ARTIFACT. It is also the release MANIFEST: an artifact absent from it
|
|
19
|
+
is treated as "not published for this platform", never as "download and
|
|
20
|
+
hope".
|
|
21
|
+
3. The checksum is verified BEFORE the archive is expanded and BEFORE
|
|
22
|
+
anything is moved into the install dir. A mismatch is a hard abort with a
|
|
23
|
+
non-zero exit - never a warning.
|
|
24
|
+
|
|
25
|
+
This is origin-trust, the same level rustup/uv ship with. It defends against a
|
|
26
|
+
corrupted or truncated download and against a swapped object in the bucket; it
|
|
27
|
+
does NOT defend against a compromise of the origin itself.
|
|
28
|
+
|
|
29
|
+
>>> SIGNING PLUG-IN POINT <<<
|
|
30
|
+
Two independent signatures belong here once certificates exist
|
|
31
|
+
(see docs/INSTALL-SCRIPT.md section 7):
|
|
32
|
+
(a) Authenticode on xeno.exe - verify with Get-AuthenticodeSignature and
|
|
33
|
+
require `Valid` + the expected subject. This is also what silences
|
|
34
|
+
SmartScreen.
|
|
35
|
+
(b) A detached signature over SHA256SUMS.txt, verified against a public key
|
|
36
|
+
pinned in THIS file.
|
|
37
|
+
Make both mandatory in Assert-Checksum / after expansion.
|
|
38
|
+
---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
Environment overrides:
|
|
41
|
+
XENO_VERSION Pin an exact version (e.g. 0.5.16). Default: latest stable.
|
|
42
|
+
XENO_INSTALL_DIR Install directory. Default: %LOCALAPPDATA%\XENO\bin
|
|
43
|
+
XENO_BASE_URL Release root. Default:
|
|
44
|
+
https://updates.xenostudio.ai/apps/agent-cli
|
|
45
|
+
|
|
46
|
+
Exit codes: 0 ok | 1 usage/environment | 2 unsupported platform |
|
|
47
|
+
3 download failure | 4 CHECKSUM MISMATCH | 5 install failure
|
|
48
|
+
#>
|
|
49
|
+
|
|
50
|
+
Set-StrictMode -Version Latest
|
|
51
|
+
$ErrorActionPreference = 'Stop'
|
|
52
|
+
$ProgressPreference = 'SilentlyContinue' # keeps piped output clean and fast
|
|
53
|
+
|
|
54
|
+
$AppSlug = 'agent-cli'
|
|
55
|
+
$BinName = 'xeno'
|
|
56
|
+
|
|
57
|
+
function Get-EnvOr {
|
|
58
|
+
param([string]$Name, [string]$Default)
|
|
59
|
+
$v = [Environment]::GetEnvironmentVariable($Name)
|
|
60
|
+
if ([string]::IsNullOrWhiteSpace($v)) { return $Default }
|
|
61
|
+
return $v
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$BaseUrl = Get-EnvOr 'XENO_BASE_URL' "https://updates.xenostudio.ai/apps/$AppSlug"
|
|
65
|
+
$InstallDir = Get-EnvOr 'XENO_INSTALL_DIR' (Join-Path $env:LOCALAPPDATA 'XENO\bin')
|
|
66
|
+
|
|
67
|
+
function Say { param([string]$m) Write-Host $m }
|
|
68
|
+
function Info { param([string]$m) Write-Host " $m" }
|
|
69
|
+
|
|
70
|
+
function Die {
|
|
71
|
+
param([int]$Code, [string]$Message)
|
|
72
|
+
Write-Host ''
|
|
73
|
+
Write-Host "error: $Message" -ForegroundColor Red
|
|
74
|
+
exit $Code
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
# --- platform detection -----------------------------------------------------
|
|
78
|
+
# Fail loudly on anything not explicitly recognised. Installing "something
|
|
79
|
+
# close" is worse than not installing at all.
|
|
80
|
+
function Get-Target {
|
|
81
|
+
if (-not [Environment]::Is64BitOperatingSystem) {
|
|
82
|
+
Die 2 @"
|
|
83
|
+
unsupported platform: 32-bit Windows.
|
|
84
|
+
XENO publishes 64-bit builds only (x64, arm64).
|
|
85
|
+
You can still install via npm: npm install -g @xenosystem/agent-cli
|
|
86
|
+
"@
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# PROCESSOR_ARCHITEW6432 is set when a 32-bit process runs on a 64-bit OS.
|
|
90
|
+
$arch = $env:PROCESSOR_ARCHITEW6432
|
|
91
|
+
if ([string]::IsNullOrWhiteSpace($arch)) { $arch = $env:PROCESSOR_ARCHITECTURE }
|
|
92
|
+
|
|
93
|
+
switch ($arch.ToUpperInvariant()) {
|
|
94
|
+
'AMD64' { return 'win-x64' }
|
|
95
|
+
'ARM64' { return 'win-arm64' }
|
|
96
|
+
default {
|
|
97
|
+
Die 2 @"
|
|
98
|
+
unsupported CPU architecture: $arch
|
|
99
|
+
Supported: AMD64 (x64), ARM64.
|
|
100
|
+
You can still install via npm: npm install -g @xenosystem/agent-cli
|
|
101
|
+
"@
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# --- download ---------------------------------------------------------------
|
|
107
|
+
function Get-File {
|
|
108
|
+
param([string]$Url, [string]$Dest)
|
|
109
|
+
try {
|
|
110
|
+
# TLS 1.2 for Windows PowerShell 5.1, whose default is often too old.
|
|
111
|
+
try {
|
|
112
|
+
[Net.ServicePointManager]::SecurityProtocol =
|
|
113
|
+
[Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
|
114
|
+
} catch { }
|
|
115
|
+
Invoke-WebRequest -Uri $Url -OutFile $Dest -UseBasicParsing
|
|
116
|
+
return $true
|
|
117
|
+
} catch {
|
|
118
|
+
return $false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
# --- version ----------------------------------------------------------------
|
|
123
|
+
# TWO pointers, tried in order:
|
|
124
|
+
#
|
|
125
|
+
# standalone.json the BINARY channel pointer. Authoritative for this script.
|
|
126
|
+
# version.json the npm-derived CLI pointer (shape: version/date/npm/
|
|
127
|
+
# install/notes), written by publish-cli-releases.mjs.
|
|
128
|
+
#
|
|
129
|
+
# They are deliberately separate. version.json's version is derived from the npm
|
|
130
|
+
# registry, so it can only ever name a version that npm has. The whole point of
|
|
131
|
+
# the standalone channel is to ship WITHOUT a registry round-trip, so the binary
|
|
132
|
+
# channel keeps its own pointer and can move independently (and ahead) of npm.
|
|
133
|
+
# Falling back to version.json keeps this script working for a release that ships
|
|
134
|
+
# binaries at the same version npm already has.
|
|
135
|
+
function Resolve-Version {
|
|
136
|
+
param([string]$TmpDir)
|
|
137
|
+
|
|
138
|
+
$pinned = [Environment]::GetEnvironmentVariable('XENO_VERSION')
|
|
139
|
+
if (-not [string]::IsNullOrWhiteSpace($pinned)) {
|
|
140
|
+
$v = $pinned.TrimStart('v')
|
|
141
|
+
Info "version: $v (pinned via XENO_VERSION)"
|
|
142
|
+
return $v
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
$pj = Join-Path $TmpDir 'pointer.json'
|
|
146
|
+
$src = $null
|
|
147
|
+
if (Get-File "$BaseUrl/standalone.json" $pj) {
|
|
148
|
+
$src = 'standalone channel'
|
|
149
|
+
} elseif (Get-File "$BaseUrl/version.json" $pj) {
|
|
150
|
+
$src = 'latest stable'
|
|
151
|
+
} else {
|
|
152
|
+
Die 3 @"
|
|
153
|
+
could not fetch a release pointer from $BaseUrl
|
|
154
|
+
(tried standalone.json and version.json)
|
|
155
|
+
Check your network/proxy, or pin a known version with `$env:XENO_VERSION='x.y.z'
|
|
156
|
+
"@
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
try {
|
|
160
|
+
$v = (Get-Content $pj -Raw | ConvertFrom-Json).version
|
|
161
|
+
} catch {
|
|
162
|
+
Die 3 "could not parse a version out of the $src pointer at $BaseUrl"
|
|
163
|
+
}
|
|
164
|
+
if ([string]::IsNullOrWhiteSpace($v)) {
|
|
165
|
+
Die 3 "could not parse a version out of the $src pointer at $BaseUrl"
|
|
166
|
+
}
|
|
167
|
+
Info "version: $v ($src)"
|
|
168
|
+
return $v
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# --- checksum ---------------------------------------------------------------
|
|
172
|
+
function Assert-Checksum {
|
|
173
|
+
param([string]$File, [string]$Expected)
|
|
174
|
+
|
|
175
|
+
$actual = (Get-FileHash -Path $File -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
176
|
+
$want = $Expected.ToLowerInvariant()
|
|
177
|
+
|
|
178
|
+
if ($actual -ne $want) {
|
|
179
|
+
Die 4 @"
|
|
180
|
+
CHECKSUM MISMATCH - refusing to install.
|
|
181
|
+
|
|
182
|
+
artifact : $(Split-Path $File -Leaf)
|
|
183
|
+
expected : $want
|
|
184
|
+
actual : $actual
|
|
185
|
+
|
|
186
|
+
The download does not match the published SHA-256. This is either a corrupted
|
|
187
|
+
transfer or a tampered artifact. Nothing has been installed. Do not retry
|
|
188
|
+
blindly on an untrusted network; report this if it persists.
|
|
189
|
+
"@
|
|
190
|
+
}
|
|
191
|
+
Info "sha256 verified: $actual"
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
# --- main -------------------------------------------------------------------
|
|
195
|
+
$tmp = Join-Path ([IO.Path]::GetTempPath()) ("xeno-install-" + [Guid]::NewGuid().ToString('N'))
|
|
196
|
+
New-Item -ItemType Directory -Path $tmp -Force | Out-Null
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
Say ''
|
|
200
|
+
Say 'XENO Agent CLI - standalone installer'
|
|
201
|
+
Say ''
|
|
202
|
+
|
|
203
|
+
$target = Get-Target
|
|
204
|
+
Info "platform: $target"
|
|
205
|
+
|
|
206
|
+
$version = Resolve-Version -TmpDir $tmp
|
|
207
|
+
|
|
208
|
+
$archive = "$BinName-$target.exe.zip"
|
|
209
|
+
$payload = "$BinName-$target.exe"
|
|
210
|
+
$relUrl = "$BaseUrl/v$version"
|
|
211
|
+
|
|
212
|
+
# 1) SHA256SUMS.txt is both the checksum source AND the release manifest.
|
|
213
|
+
$sums = Join-Path $tmp 'SHA256SUMS.txt'
|
|
214
|
+
if (-not (Get-File "$relUrl/SHA256SUMS.txt" $sums)) {
|
|
215
|
+
Die 3 @"
|
|
216
|
+
could not fetch the checksum manifest: $relUrl/SHA256SUMS.txt
|
|
217
|
+
Version $version may not publish standalone binaries.
|
|
218
|
+
Fallback: npm install -g @xenosystem/agent-cli
|
|
219
|
+
"@
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
# 2) Is THIS platform published in THIS release? Data-driven, so the script
|
|
223
|
+
# never goes stale as the build matrix grows.
|
|
224
|
+
$expected = $null
|
|
225
|
+
foreach ($line in (Get-Content $sums)) {
|
|
226
|
+
$parts = $line -split '\s+', 2
|
|
227
|
+
if ($parts.Count -eq 2 -and $parts[1].Trim().TrimStart('*') -eq $archive) {
|
|
228
|
+
$expected = $parts[0].Trim()
|
|
229
|
+
break
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (-not $expected) {
|
|
233
|
+
Say ''
|
|
234
|
+
Say " Published artifacts for v${version}:"
|
|
235
|
+
foreach ($line in (Get-Content $sums)) {
|
|
236
|
+
$p = $line -split '\s+', 2
|
|
237
|
+
if ($p.Count -eq 2) { Say (" " + $p[1].Trim().TrimStart('*')) }
|
|
238
|
+
}
|
|
239
|
+
Die 2 @"
|
|
240
|
+
no standalone binary for $target in release v$version.
|
|
241
|
+
|
|
242
|
+
This platform has not been built yet (see docs/INSTALL-SCRIPT.md, platform matrix).
|
|
243
|
+
Install via npm instead: npm install -g @xenosystem/agent-cli
|
|
244
|
+
"@
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
# 3) Download the artifact.
|
|
248
|
+
$archivePath = Join-Path $tmp $archive
|
|
249
|
+
Info "downloading $archive"
|
|
250
|
+
if (-not (Get-File "$relUrl/$archive" $archivePath)) {
|
|
251
|
+
Die 3 "download failed: $relUrl/$archive"
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
# 4) Verify BEFORE expanding. Nothing is installed until this passes.
|
|
255
|
+
Assert-Checksum -File $archivePath -Expected $expected
|
|
256
|
+
|
|
257
|
+
# 5) Expand into the temp dir only.
|
|
258
|
+
try {
|
|
259
|
+
Expand-Archive -Path $archivePath -DestinationPath $tmp -Force
|
|
260
|
+
} catch {
|
|
261
|
+
Die 5 "could not unpack $archive"
|
|
262
|
+
}
|
|
263
|
+
$payloadPath = Join-Path $tmp $payload
|
|
264
|
+
if (-not (Test-Path $payloadPath)) {
|
|
265
|
+
Die 5 "archive did not contain the expected payload '$payload'"
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
# 6) Install. Per-user only - no elevation, nothing written outside InstallDir.
|
|
269
|
+
try {
|
|
270
|
+
New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
|
|
271
|
+
} catch {
|
|
272
|
+
Die 5 "could not create $InstallDir"
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
$dest = Join-Path $InstallDir "$BinName.exe"
|
|
276
|
+
# A running xeno.exe cannot be overwritten on Windows, but it CAN be renamed.
|
|
277
|
+
# Move the old one aside so re-running the installer is always an upgrade.
|
|
278
|
+
if (Test-Path $dest) {
|
|
279
|
+
$old = "$dest.old"
|
|
280
|
+
try {
|
|
281
|
+
if (Test-Path $old) { Remove-Item $old -Force -ErrorAction SilentlyContinue }
|
|
282
|
+
Move-Item -Path $dest -Destination $old -Force
|
|
283
|
+
} catch {
|
|
284
|
+
Die 5 @"
|
|
285
|
+
could not replace $dest
|
|
286
|
+
A running 'xeno' process may be holding it open. Close it and re-run.
|
|
287
|
+
"@
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
Move-Item -Path $payloadPath -Destination $dest -Force
|
|
292
|
+
} catch {
|
|
293
|
+
Die 5 "could not install $dest"
|
|
294
|
+
}
|
|
295
|
+
Remove-Item "$dest.old" -Force -ErrorAction SilentlyContinue
|
|
296
|
+
|
|
297
|
+
Say ''
|
|
298
|
+
Say " installed: $dest"
|
|
299
|
+
|
|
300
|
+
# 7) PATH guidance - print it only when it is actually missing.
|
|
301
|
+
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
|
|
302
|
+
if ($null -eq $userPath) { $userPath = '' }
|
|
303
|
+
$want = $InstallDir.TrimEnd('\')
|
|
304
|
+
# @() is required: under Set-StrictMode a 0/1-element pipeline result has no .Count.
|
|
305
|
+
$onPath = @($env:Path -split ';' | Where-Object { $_ -and $_.TrimEnd('\') -ieq $want }).Count -gt 0
|
|
306
|
+
$inUserPath = @($userPath -split ';' | Where-Object { $_ -and $_.TrimEnd('\') -ieq $want }).Count -gt 0
|
|
307
|
+
|
|
308
|
+
if ($onPath -or $inUserPath) {
|
|
309
|
+
Say " $InstallDir is already on your PATH."
|
|
310
|
+
if (-not $onPath) { Say ' (open a new terminal for it to take effect)' }
|
|
311
|
+
} else {
|
|
312
|
+
Say ''
|
|
313
|
+
Say " $InstallDir is NOT on your PATH. Add it for your user:"
|
|
314
|
+
Say ''
|
|
315
|
+
Say " [Environment]::SetEnvironmentVariable('Path', (([Environment]::GetEnvironmentVariable('Path','User')) + ';$InstallDir'), 'User')"
|
|
316
|
+
Say ''
|
|
317
|
+
Say ' Then open a new terminal.'
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
Say ''
|
|
321
|
+
Say " Run: $BinName --help"
|
|
322
|
+
Say ''
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
if (Test-Path $tmp) { Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue }
|
|
326
|
+
}
|