@songsid/agend 2.3.5-alpha.10 → 2.3.5-alpha.12
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/accounts-view.d.ts +17 -0
- package/dist/accounts-view.js +24 -8
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-cli-instructions.md +2 -2
- package/dist/auth-api.d.ts +48 -16
- package/dist/auth-api.js +83 -32
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/settings-role.d.ts +56 -0
- package/dist/authority/settings-role.js +48 -0
- package/dist/authority/settings-role.js.map +1 -0
- package/dist/backend/claude-code.d.ts +2 -0
- package/dist/backend/claude-code.js +32 -6
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/cli-env-probe.js +6 -2
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend/codex.d.ts +5 -3
- package/dist/backend/codex.js +31 -13
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +18 -0
- package/dist/backend/credential-profile.js +46 -0
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.d.ts +3 -1
- package/dist/backend/muse.js +31 -1
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +17 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +15 -0
- package/dist/backend-availability.js +37 -1
- package/dist/backend-availability.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/bundled-tmux-guard.d.ts +4 -0
- package/dist/bundled-tmux-guard.js +7 -0
- package/dist/bundled-tmux-guard.js.map +1 -1
- package/dist/claude-auth-status.d.ts +20 -8
- package/dist/claude-auth-status.js +38 -22
- package/dist/claude-auth-status.js.map +1 -1
- package/dist/cli-audited.d.ts +60 -0
- package/dist/cli-audited.js +84 -0
- package/dist/cli-audited.js.map +1 -0
- package/dist/cli-capability.d.ts +36 -5
- package/dist/cli-capability.js +2 -2
- package/dist/cli-capability.js.map +1 -1
- package/dist/cli-caps-module.d.ts +5 -1
- package/dist/cli-caps-module.js +4 -2
- package/dist/cli-caps-module.js.map +1 -1
- package/dist/cli-registry-check.js +16 -2
- package/dist/cli-registry-check.js.map +1 -1
- package/dist/cli-registry.d.ts +56 -4
- package/dist/cli-registry.js +1 -1
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli-spec-antigravity.d.ts +12 -1
- package/dist/cli-spec-antigravity.js +13 -1
- package/dist/cli-spec-antigravity.js.map +1 -1
- package/dist/cli-spec-claude-code.d.ts +9 -0
- package/dist/cli-spec-claude-code.js +4 -2
- package/dist/cli-spec-claude-code.js.map +1 -1
- package/dist/cli-spec-codex.d.ts +10 -1
- package/dist/cli-spec-codex.js +5 -3
- package/dist/cli-spec-codex.js.map +1 -1
- package/dist/cli-spec-grok.d.ts +5 -0
- package/dist/cli-spec-grok.js +6 -1
- package/dist/cli-spec-grok.js.map +1 -1
- package/dist/cli-spec-kiro-cli.d.ts +7 -1
- package/dist/cli-spec-kiro-cli.js +7 -3
- package/dist/cli-spec-kiro-cli.js.map +1 -1
- package/dist/cli-spec-muse.d.ts +2 -0
- package/dist/cli-spec-muse.js +3 -1
- package/dist/cli-spec-muse.js.map +1 -1
- package/dist/cli-spec-opencode.d.ts +11 -1
- package/dist/cli-spec-opencode.js +7 -2
- package/dist/cli-spec-opencode.js.map +1 -1
- package/dist/cli.js +28 -1
- package/dist/cli.js.map +1 -1
- package/dist/create-host-account.d.ts +17 -0
- package/dist/create-host-account.js +47 -0
- package/dist/create-host-account.js.map +1 -0
- package/dist/daemon.d.ts +26 -0
- package/dist/daemon.js +131 -10
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.js +7 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +5 -1
- package/dist/fleet-manager.d.ts +363 -71
- package/dist/fleet-manager.js +1374 -367
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-process-handlers.d.ts +1 -1
- package/dist/fleet-process-handlers.js +3 -2
- package/dist/fleet-process-handlers.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +21 -14
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +9 -8
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +9 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +27 -20
- package/dist/instance-lifecycle.js +33 -3
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.js +29 -6
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +125 -81
- package/dist/locale.js.map +1 -1
- package/dist/login-manager.d.ts +2 -2
- package/dist/login-manager.js +3 -2
- package/dist/login-manager.js.map +1 -1
- package/dist/native-model-catalog.d.ts +20 -0
- package/dist/native-model-catalog.js +107 -2
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/public-web-gateway.js +1 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +5 -0
- package/dist/public-web-link.js +8 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/runtime-api.d.ts +1 -1
- package/dist/runtime-api.js +104 -12
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-autostart.d.ts +61 -0
- package/dist/runtime-autostart.js +161 -0
- package/dist/runtime-autostart.js.map +1 -0
- package/dist/runtime-background.d.ts +200 -0
- package/dist/runtime-background.js +480 -0
- package/dist/runtime-background.js.map +1 -0
- package/dist/runtime-build-info.js +5 -5
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-background.d.ts +92 -0
- package/dist/runtime-cli-background.js +336 -0
- package/dist/runtime-cli-background.js.map +1 -0
- package/dist/runtime-cli-install.d.ts +148 -8
- package/dist/runtime-cli-install.js +253 -59
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-cli.d.ts +8 -1
- package/dist/runtime-cli.js +206 -44
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +11 -0
- package/dist/runtime-client-store.js +20 -5
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +23 -1
- package/dist/runtime-client.js +92 -6
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-connection.d.ts +1 -1
- package/dist/runtime-connection.js +1 -1
- package/dist/runtime-connection.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +95 -1
- package/dist/runtime-coordinator.js +344 -10
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-enroll-notice.d.ts +4 -0
- package/dist/runtime-enroll-notice.js +21 -0
- package/dist/runtime-enroll-notice.js.map +1 -0
- package/dist/runtime-enrollment.d.ts +21 -0
- package/dist/runtime-enrollment.js +52 -0
- package/dist/runtime-enrollment.js.map +1 -0
- package/dist/runtime-pane-native.js +4 -4
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/runtime-protocol.d.ts +78 -1
- package/dist/runtime-protocol.js +95 -5
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-remote-accounts.d.ts +12 -0
- package/dist/runtime-remote-accounts.js +56 -5
- package/dist/runtime-remote-accounts.js.map +1 -1
- package/dist/runtime-remote-setup.d.ts +4 -1
- package/dist/runtime-remote-setup.js +4 -1
- package/dist/runtime-remote-setup.js.map +1 -1
- package/dist/runtime-update-controller.d.ts +11 -0
- package/dist/runtime-update-controller.js +56 -4
- package/dist/runtime-update-controller.js.map +1 -1
- package/dist/settings-api.d.ts +13 -1
- package/dist/settings-api.js +44 -20
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.d.ts +5 -13
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +11 -13
- package/dist/settings-confirmation.js +2 -6
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +5 -0
- package/dist/settings-effect.js +76 -10
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +8 -1
- package/dist/settings-http-confirmation.js +39 -13
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +7 -0
- package/dist/settings-request-capability.js +3 -1
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/setup-i18n.js +4 -4
- package/dist/setup-i18n.js.map +1 -1
- package/dist/signin-keepalive.d.ts +25 -1
- package/dist/signin-keepalive.js +44 -1
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/subagent-records.d.ts +45 -0
- package/dist/subagent-records.js +214 -0
- package/dist/subagent-records.js.map +1 -0
- package/dist/subagent-service.d.ts +27 -0
- package/dist/subagent-service.js +199 -0
- package/dist/subagent-service.js.map +1 -0
- package/dist/tmux-manager.d.ts +2 -2
- package/dist/tmux-manager.js +5 -3
- package/dist/tmux-manager.js.map +1 -1
- package/dist/ui/account-identity.js +7 -5
- package/dist/ui/accounts-keepalive.js +17 -17
- package/dist/ui/accounts-manage.js +34 -34
- package/dist/ui/accounts-view.js +68 -24
- package/dist/ui/agent-runtime-settings.js +1 -1
- package/dist/ui/backend-signin.js +67 -67
- package/dist/ui/chat-msg-actions.js +50 -4
- package/dist/ui/chat-quote.js +256 -0
- package/dist/ui/chat-store.js +9 -4
- package/dist/ui/cli-caps.js +7 -7
- package/dist/ui/credential-profile-select.js +4 -4
- package/dist/ui/general-location.js +1 -1
- package/dist/ui/host-install.js +290 -0
- package/dist/ui/hub-company-join-strings.js +3 -0
- package/dist/ui/hub-company-join.js +20 -2
- package/dist/ui/hub-owner-strings.js +5 -4
- package/dist/ui/hub-pairing-progress-strings.js +1 -1
- package/dist/ui/hub-quick-strings.js +4 -4
- package/dist/ui/hub-strings.js +6 -6
- package/dist/ui/machine-signin.js +4 -4
- package/dist/ui/model-picker.js +68 -0
- package/dist/ui/panel-chat.js +74 -13
- package/dist/ui/panel-fleet.js +8 -2
- package/dist/ui/panel-hub.js +8 -4
- package/dist/ui/panel-needs.js +2 -2
- package/dist/ui/panel-runtimes.js +232 -33
- package/dist/ui/panel-settings.js +7 -1
- package/dist/ui/panel-windows-cli.js +1 -1
- package/dist/ui/runtime-cli-install.js +99 -20
- package/dist/ui/runtime-commands.d.ts +2 -0
- package/dist/ui/runtime-commands.js +34 -1
- package/dist/ui/runtime-update-status.js +2 -2
- package/dist/ui/search-dialog.js +1 -0
- package/dist/ui/settings-access-overview.js +167 -0
- package/dist/ui/settings-access-strings.js +1 -1
- package/dist/ui/settings-catalog.js +19 -3
- package/dist/ui/settings-confirm.js +2 -2
- package/dist/ui/settings-devices.js +59 -25
- package/dist/ui/settings-dialogs.js +12 -13
- package/dist/ui/settings-guests.js +1 -1
- package/dist/ui/settings-hub-company-join.js +10 -7
- package/dist/ui/settings-hub-connection.js +121 -0
- package/dist/ui/settings-hub-membership.js +1 -1
- package/dist/ui/settings-hub-run.js +5 -6
- package/dist/ui/settings-hub-section.js +3 -6
- package/dist/ui/settings-hub.js +12 -7
- package/dist/ui/settings-layout.js +9 -7
- package/dist/ui/settings-outside.js +87 -19
- package/dist/ui/settings-registry.js +2 -1
- package/dist/ui/settings-revoke-strings.js +28 -0
- package/dist/ui/settings-strings.js +25 -25
- package/dist/ui/settings-web-authority.js +11 -4
- package/dist/ui/shared/accounts.css +11 -1
- package/dist/ui/shared/agend-auth.js +8 -1
- package/dist/ui/shared/app-i18n.js +10 -12
- package/dist/ui/shared/app-session.js +13 -16
- package/dist/ui/shared/app-shell.js +37 -37
- package/dist/ui/shared/app-store.js +2 -0
- package/dist/ui/shared/app.css +85 -14
- package/dist/ui/shared/chat-render.js +17 -5
- package/dist/ui/shared/chat-strings.js +4 -4
- package/dist/ui/shared/device-roles.js +27 -0
- package/dist/ui/shared/host-install.css +10 -0
- package/dist/ui/shared/hub-owner.css +6 -0
- package/dist/ui/shared/model-picker.css +21 -0
- package/dist/ui/shared/runtime-install.css +26 -1
- package/dist/ui/shared/setup-host-text.js +4 -4
- package/dist/ui/shared/signin.js +171 -64
- package/dist/ui/shared/subagent-row.css +15 -0
- package/dist/ui/shared/usage-dialog.js +28 -16
- package/dist/ui/shared/view-strings.js +7 -7
- package/dist/ui/shared/web-authorize.js +54 -4
- package/dist/ui/signin.html +19 -8
- package/dist/ui/structured-signin.js +30 -30
- package/dist/ui/subagent-row.js +72 -0
- package/dist/ui/web-terminal/terminal.js +9 -9
- package/dist/update-launch.js +4 -1
- package/dist/update-launch.js.map +1 -1
- package/dist/update-npm-env.d.ts +70 -0
- package/dist/update-npm-env.js +128 -0
- package/dist/update-npm-env.js.map +1 -0
- package/dist/usage/format-rich.js +1 -1
- package/dist/usage/format-rich.js.map +1 -1
- package/dist/usage/providers.js +2 -2
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +8 -2
- package/dist/usage/usage-api.js +12 -5
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +38 -4
- package/dist/web-api.js +370 -18
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.js +1 -1
- package/dist/web-auth.js.map +1 -1
- package/dist/web-backend-login.d.ts +2 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-channel-echo.js +3 -1
- package/dist/web-channel-echo.js.map +1 -1
- package/dist/web-commands.d.ts +9 -1
- package/dist/web-commands.js +7 -1
- package/dist/web-commands.js.map +1 -1
- package/dist/web-host-install.d.ts +127 -0
- package/dist/web-host-install.js +165 -0
- package/dist/web-host-install.js.map +1 -0
- package/dist/web-remote-access.d.ts +194 -11
- package/dist/web-remote-access.js +458 -34
- package/dist/web-remote-access.js.map +1 -1
- package/dist/web-session.d.ts +11 -3
- package/dist/web-session.js.map +1 -1
- package/dist/web-signin-device.d.ts +16 -0
- package/dist/web-signin-device.js +81 -0
- package/dist/web-signin-device.js.map +1 -0
- package/dist/web-update.js +3 -1
- package/dist/web-update.js.map +1 -1
- package/dist/windows-cli-api.js +2 -1
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +14 -0
- package/dist/windows-cli-worker.js +145 -1
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +4 -0
- package/dist/windows-cli.js +9 -1
- package/dist/windows-cli.js.map +1 -1
- package/launcher/agend-install.cjs +16 -3
- package/package.json +1 -1
- package/templates/runtime-install/install.ps1 +219 -12
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
# copy, with your fleet's address and THIS file's SHA-256 filled in. The command downloads this file, checks the hash shown on
|
|
5
5
|
# the page and only then runs it, so what runs is exactly what the page vouches for, whatever the TLS trust decision was.
|
|
6
6
|
# The server address is the one the command put in $agend (the reviewed address, never the Host that happened to serve this
|
|
7
|
-
# file); nothing here is looked up from the network, and nothing here is a secret.
|
|
7
|
+
# file); nothing here is looked up from the network, and nothing here is a secret. $agend is used only as that address, after the
|
|
8
|
+
# origin check below, for the download, the receipt, agend-server.json and the connection. This file is the same bytes for everyone
|
|
8
9
|
# and for every request.
|
|
9
10
|
#
|
|
10
11
|
# It is run by the page's command (`iex` of the downloaded text), so it is kept safe for that: ASCII only (Windows
|
|
@@ -22,11 +23,34 @@
|
|
|
22
23
|
# 4. Points agend-runtime at the new version: bin\agend-runtime.cmd never changes, and bin\current.txt (the version it
|
|
23
24
|
# starts) is swapped in with an atomic file replace. A Runtime that is already running keeps running its own version.
|
|
24
25
|
# 5. Adds the bin folder to YOUR user PATH (not the system PATH).
|
|
25
|
-
# 6.
|
|
26
|
-
#
|
|
26
|
+
# 6. Leaves a reconnect entry for this AgEnD under <install folder>\connect\<server>: agend-server.json (only the public address, never
|
|
27
|
+
# a credential or a pairing code) and the same connect-agend.bat the ZIP has, so the next connection is a double-click.
|
|
28
|
+
# 7. Connects, in this same window, when - and only when - this is an interactive console (stdin and stdout are the console, not
|
|
29
|
+
# -NonInteractive, not the ISE, no usual CI variable such as CI or GITHUB_ACTIONS set) and $agendNoConnect is not set. It runs the Runtime's own `connect --connection-dir`, the logic
|
|
30
|
+
# connect-agend.bat uses: a new profile asks for the one-time pairing code, shows the fingerprint and waits for your approval in
|
|
31
|
+
# AgEnD; a profile already paired to this AgEnD just reconnects; one paired to another AgEnD gets its own profile and that pairing is
|
|
32
|
+
# left alone. The code is typed into the terminal by a person: the Runtime accepts it from nothing else, so this script never sees it.
|
|
33
|
+
# Once it is connected the Runtime moves to the background and `connect` ends, so closing this window does not disconnect it, and the
|
|
34
|
+
# command returns (an AI agent or CI does not wait for it). It also adds a Task Scheduler task for your own account that starts it when
|
|
35
|
+
# you sign in (no administrator rights, not a Windows service). `agend-runtime status`, `stop` and `logs` manage it. $agendForeground = 1
|
|
36
|
+
# keeps the Runtime in this window instead, as before.
|
|
37
|
+
# 7a. When this run switched `agend-runtime` to a different build than before, or is a repair run, a Runtime that runs in the background is
|
|
38
|
+
# stopped and started again so it uses the installed version (`agend-runtime restart --all`; a Runtime that runs in a window is never touched).
|
|
39
|
+
# Anywhere else (an AI agent, CI, a pipeline, $agendNoConnect) it only installs, prints the exact command to run next and ends with
|
|
40
|
+
# exit code 0. The Runtime is started after the install lock is released, because a running Runtime needs that lock for updates.
|
|
41
|
+
# 7b. With a ONE-TIME TOKEN ($agendEnroll and $agendFingerprint, set by the page's "install command") it connects in ANY window, interactive or
|
|
42
|
+
# not, with no pairing code and no approval step: the token is the authorisation, and it could only come from an administrator's signed-in
|
|
43
|
+
# AgEnD page. The token is checked for its shape before anything is installed, copied out of the variable (which is cleared at once), and
|
|
44
|
+
# handed to the Runtime on its standard input - never on the command line, never in an environment variable, never in a file. The Runtime
|
|
45
|
+
# first checks that the server is the AgEnD whose fingerprint $agendFingerprint names and sends the token only then; the token works once, for 15
|
|
46
|
+
# minutes, and can be revoked on the AgEnD page. A computer already connected to this AgEnD just reconnects and the token is not used.
|
|
47
|
+
# Without a token everything is exactly as in 7. $agendNoConnect (and a repair run) still win: with them nothing is connected and the token is not used.
|
|
27
48
|
#
|
|
28
49
|
# Optional, set in the same PowerShell window before running it:
|
|
29
|
-
# $
|
|
50
|
+
# $agendNoConnect = 1 install only: do not connect, even in an interactive window (unset it with $null)
|
|
51
|
+
# $agendForeground = 1 connect, but keep the Runtime in this window (Ctrl+C stops it) instead of moving it to the background
|
|
52
|
+
# $agendEnroll = '<token>'; $agendFingerprint = '<64 hex>' the one-time token and server fingerprint from the page's install command (both are cleared by this script)
|
|
53
|
+
# $env:AGEND_RUNTIME_REPAIR = '1' keep PATH unchanged; print run with an existing profile, never pairing steps or a connection
|
|
30
54
|
# $env:AGEND_RUNTIME_NO_PATH = '1' leave PATH alone (the final message then shows the full path to run)
|
|
31
55
|
# $env:AGEND_RUNTIME_INSTALL_DIR = 'D:\agend' install somewhere other than %LOCALAPPDATA%\agend-runtime
|
|
32
56
|
# If it fails it says why, leaves what was installed before untouched, and sets $LASTEXITCODE to 1.
|
|
@@ -51,6 +75,51 @@
|
|
|
51
75
|
if ($uri.UserInfo -ne '' -or $uri.Query -ne '' -or $uri.Fragment -ne '' -or $uri.AbsolutePath -ne '/') { return '' }
|
|
52
76
|
return $uri.GetLeftPart([UriPartial]::Authority)
|
|
53
77
|
}
|
|
78
|
+
# `$agendNoConnect = 1`, set in the same window before the command, means "install only". Empty, 0, false, no and off mean "not set".
|
|
79
|
+
function Test-AgendSwitch($value) {
|
|
80
|
+
if ($null -eq $value) { return $false }
|
|
81
|
+
$text = ([string]$value).Trim()
|
|
82
|
+
return -not ($text -eq '' -or $text -in '0', 'false', 'no', 'off')
|
|
83
|
+
}
|
|
84
|
+
# The one-time install-command token ("agend_enroll_" and 43 URL-safe base64 characters) and the AgEnD server fingerprint (the SHA-256 of its enrollment
|
|
85
|
+
# key, 64 lower-case hex digits). Case-sensitive on purpose. A value that fails is refused before anything is installed, and is never echoed.
|
|
86
|
+
function Test-AgendEnrollToken($value) { return ($value -is [string]) -and ($value -cmatch '\Aagend_enroll_[A-Za-z0-9_-]{43}\z') }
|
|
87
|
+
function Test-AgendFingerprint($value) { return ($value -is [string]) -and ($value -cmatch '\A[a-f0-9]{64}\z') }
|
|
88
|
+
# True only at a real, interactive console. The pairing code is typed by a person and the Runtime reads it from nothing else, so a
|
|
89
|
+
# redirected stdin or stdout (an AI agent, CI, a pipeline), -NonInteractive (any abbreviation of it), the ISE (no console for a child
|
|
90
|
+
# process) and a CI environment variable (CI, GITHUB_ACTIONS, TF_BUILD, ...: an agent on a pseudo-terminal) are all "not interactive". When in
|
|
91
|
+
# doubt it answers false: the cost is one command to run by hand, never a hung window.
|
|
92
|
+
function Test-AgendInteractive {
|
|
93
|
+
try {
|
|
94
|
+
if ([Console]::IsInputRedirected -or [Console]::IsOutputRedirected) { return $false }
|
|
95
|
+
if ([string]$Host.Name -match 'ISE') { return $false }
|
|
96
|
+
foreach ($arg in [Environment]::GetCommandLineArgs()) { if ($arg -match '\A[-/]noni') { return $false } }
|
|
97
|
+
# An AI agent or CI step that gives PowerShell a pseudo-terminal looks interactive from in here, but nobody is there to type a pairing code. The usual
|
|
98
|
+
# CI variables say so: any of them set (and not 0, false, no or off, the same reading as $agendNoConnect) means "not interactive".
|
|
99
|
+
foreach ($name in 'CI', 'GITHUB_ACTIONS', 'TF_BUILD', 'BUILD_BUILDID', 'JENKINS_URL', 'GITLAB_CI', 'CIRCLECI', 'BUILDKITE', 'TEAMCITY_VERSION') {
|
|
100
|
+
if (Test-AgendSwitch ([Environment]::GetEnvironmentVariable($name))) { return $false }
|
|
101
|
+
}
|
|
102
|
+
return $true
|
|
103
|
+
} catch { return $false }
|
|
104
|
+
}
|
|
105
|
+
# What to do after the install, as one word: repair (never connect), switch ($agendNoConnect), enroll (a valid one-time token: connect with it in
|
|
106
|
+
# any window), noninteractive, noentry (the reconnect entry could not be written) or connect. The order is the order of precedence.
|
|
107
|
+
function Get-AgendConnectMode([bool]$Repair, [bool]$NoConnect, [bool]$Interactive, [bool]$HasEntry, [bool]$HasToken = $false) {
|
|
108
|
+
if ($Repair) { return 'repair' }
|
|
109
|
+
if ($NoConnect) { return 'switch' }
|
|
110
|
+
if ($HasToken) { if ($HasEntry) { return 'enroll' } else { return 'noentry' } }
|
|
111
|
+
if (-not $Interactive) { return 'noninteractive' }
|
|
112
|
+
if (-not $HasEntry) { return 'noentry' }
|
|
113
|
+
return 'connect'
|
|
114
|
+
}
|
|
115
|
+
# One folder per AgEnD address under <install>\connect, so two AgEnDs on one PC never overwrite each other's reconnect entry. The name is
|
|
116
|
+
# only a label (the Runtime picks the profile from the address inside agend-server.json): host, port and 8 hex characters of the address's hash.
|
|
117
|
+
function Get-AgendConnectName([string]$Origin) {
|
|
118
|
+
$uri = [Uri]$Origin
|
|
119
|
+
$sha = [Security.Cryptography.SHA256]::Create()
|
|
120
|
+
try { $hash = ([BitConverter]::ToString($sha.ComputeHash([Text.Encoding]::UTF8.GetBytes($Origin))) -replace '-', '').ToLowerInvariant() } finally { $sha.Dispose() }
|
|
121
|
+
return (([string]$uri.Host -replace '[^A-Za-z0-9.-]', '_').ToLowerInvariant() + '-' + $uri.Port + '-' + $hash.Substring(0, 8))
|
|
122
|
+
}
|
|
54
123
|
# Node.js satisfying the Runtime's engines: ^22.14.0 || ^23.6.0 || >=24.
|
|
55
124
|
function Test-NodeVersion([string]$text) {
|
|
56
125
|
$m = [regex]::Match($text, '\Av?(\d+)\.(\d+)\.(\d+)')
|
|
@@ -230,6 +299,22 @@
|
|
|
230
299
|
Set-AgendFile $path ($receipt | ConvertTo-Json -Depth 4 -Compress) { Assert-AgendLock $Lock; if ((Read-AgendSmallFile $path 20000) -cne $raw) { throw 'The managed-install receipt changed; nothing was switched.' } }
|
|
231
300
|
}
|
|
232
301
|
|
|
302
|
+
# <root>\connect\<server>\agend-server.json (the public address and nothing else) and connect-agend.bat. Returns that folder.
|
|
303
|
+
# The batch file calls the shim (so it follows current.txt to the newest installed Runtime) and passes its own folder as --connection-dir;
|
|
304
|
+
# the Runtime reads the address from the json and picks the profile the way the ZIP's connect-agend.bat does. `call` re-reads % and ^ in a
|
|
305
|
+
# path, so a folder whose name holds one is refused here rather than written into a batch file that would misread it.
|
|
306
|
+
function Write-AgendConnectEntry([string]$Root, [string]$Origin) {
|
|
307
|
+
if ($Origin -notmatch '\A[A-Za-z0-9.:/\[\]-]+\z') { throw 'the AgEnD address has characters that agend-server.json does not carry' }
|
|
308
|
+
if ($Root -match '[%^]') { throw 'the install folder name contains % or ^, which a batch file cannot carry safely' }
|
|
309
|
+
$parent = Join-Path $Root 'connect'
|
|
310
|
+
$null = New-Item -ItemType Directory -Path $parent -Force; Assert-AgendDirectory $parent
|
|
311
|
+
$folder = Join-Path $parent (Get-AgendConnectName $Origin)
|
|
312
|
+
$null = New-Item -ItemType Directory -Path $folder -Force; Assert-AgendDirectory $folder
|
|
313
|
+
Set-AgendFile (Join-Path $folder 'agend-server.json') ('{' + "`n" + ' "server": "' + $Origin + '"' + "`n" + '}' + "`n")
|
|
314
|
+
Set-AgendFile (Join-Path $folder 'connect-agend.bat') $connectBatText
|
|
315
|
+
return $folder
|
|
316
|
+
}
|
|
317
|
+
|
|
233
318
|
# Adds a folder to the USER PATH in the registry, keeping its value kind: [Environment]::SetEnvironmentVariable would turn a
|
|
234
319
|
# REG_EXPAND_SZ PATH into plain REG_SZ and stop its %VARIABLES% entries expanding, and setx truncates at 1024 characters, so
|
|
235
320
|
# neither is used. An entry already there (written out or with %VARIABLES%) is not added again.
|
|
@@ -274,7 +359,22 @@
|
|
|
274
359
|
'exit /b %errorlevel%', ':agend_rt_missing', 'echo AgEnD Runtime is not installed correctly. Run the install command shown in AgEnD Settings - Runtime - Connect a computer again.>&2',
|
|
275
360
|
'exit /b 1', '') -join "`r`n"
|
|
276
361
|
|
|
362
|
+
# connect-agend.bat for the reconnect entry: what the ZIP's connect-agend.bat does (connect, then say how it ended and pause), pointed at the
|
|
363
|
+
# installed shim. Like the shim, its text names no version and must not change without a reason: cmd.exe reads a batch file as it runs it, and
|
|
364
|
+
# Set-AgendFile rewrites this file whenever the text differs from what is on disk, which can disturb a window that is running it right now.
|
|
365
|
+
# If it must change, update the pinned hash in tests/runtime-install-script.test.ts in the same commit.
|
|
366
|
+
# (Changed once: connect now ends after moving the Runtime to the background, so the old "AgEnD Runtime stopped." line would have
|
|
367
|
+
# been wrong. A window that is still running the previous connect-agend.bat while this one is written should be closed first.)
|
|
368
|
+
$connectBatText = ('@echo off', 'setlocal DisableDelayedExpansion', 'if not exist "%~dp0..\..\bin\agend-runtime.cmd" (',
|
|
369
|
+
' echo AgEnD Runtime is not installed correctly. Run the install command shown in AgEnD Settings - Runtime - Connect a computer again.', ' pause', ' exit /b 1', ')',
|
|
370
|
+
'call "%~dp0..\..\bin\agend-runtime.cmd" connect --connection-dir "%~dp0."', 'set "AGEND_EXIT=%errorlevel%"', 'echo.',
|
|
371
|
+
'if not "%AGEND_EXIT%"=="0" (', ' echo AgEnD Runtime stopped or could not connect. Read the message above for what to do next.', ') else (', ' echo Done. Read the message above: a Runtime that was started keeps running in the background after this window closes.', ')',
|
|
372
|
+
'pause', '') -join "`r`n"
|
|
373
|
+
|
|
277
374
|
$tmp = $null; $installLock = $null
|
|
375
|
+
$doConnect = $false; $connectDir = $null; $cliJs = $null; $restartCli = $null
|
|
376
|
+
# Tracked apart: the restart below runs only after an installation that finished (the end of the try block was reached) and whose lock was released and confirmed.
|
|
377
|
+
$installFinished = $false; $lockReleased = $true
|
|
278
378
|
try {
|
|
279
379
|
try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 } catch { }
|
|
280
380
|
|
|
@@ -287,9 +387,35 @@
|
|
|
287
387
|
return
|
|
288
388
|
}
|
|
289
389
|
|
|
390
|
+
# the one-time token and server fingerprint the page's command set. They are copied here and cleared from the caller's scope at
|
|
391
|
+
# once (the page's command clears them again afterwards), and checked for their shape before anything is installed: a malformed token is
|
|
392
|
+
# refused with the next step, without being printed. Nothing about the token goes into a file, a log or the command line.
|
|
393
|
+
$enrollToken = $null; $enrollFingerprint = $null
|
|
394
|
+
$rawToken = $agendEnroll; $rawFingerprint = $agendFingerprint
|
|
395
|
+
foreach ($scopeName in 1, 'Global') { foreach ($varName in 'agendEnroll', 'agendFingerprint') { try { Set-Variable -Name $varName -Value $null -Scope $scopeName -ErrorAction Stop } catch { } } }
|
|
396
|
+
# A variable that is not there, or is $null (what the page's command and this script leave behind), is "no token". One that holds anything else, an empty or
|
|
397
|
+
# blank string included, is a token that was meant to be there and is not valid: refused, never quietly turned into the pairing-code route.
|
|
398
|
+
if ($null -ne $rawToken) {
|
|
399
|
+
if (-not (Test-AgendEnrollToken $rawToken)) {
|
|
400
|
+
Write-Problem 'The one-time token in this install command is not valid (it may have been copied incompletely). Nothing was installed.'
|
|
401
|
+
Write-Host 'Open AgEnD Settings -> Runtime -> Connect a computer, generate a new install command there and run it again.'
|
|
402
|
+
$global:LASTEXITCODE = 1
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
if (-not (Test-AgendFingerprint $rawFingerprint)) {
|
|
406
|
+
Write-Problem 'The AgEnD server fingerprint in this install command is missing or not valid (it is 64 hexadecimal characters). Nothing was installed.'
|
|
407
|
+
Write-Host 'Open AgEnD Settings -> Runtime -> Connect a computer, generate a new install command there and run it again.'
|
|
408
|
+
$global:LASTEXITCODE = 1
|
|
409
|
+
return
|
|
410
|
+
}
|
|
411
|
+
$enrollToken = [string]$rawToken; $enrollFingerprint = [string]$rawFingerprint
|
|
412
|
+
}
|
|
413
|
+
$rawToken = $null
|
|
414
|
+
|
|
290
415
|
$nodeText = ''
|
|
291
416
|
$node = Get-Command node -ErrorAction SilentlyContinue
|
|
292
|
-
|
|
417
|
+
$nodeExe = $null
|
|
418
|
+
if ($node) { $nodeExe = $node.Source; try { $nodeText = ((& $node.Source -v) | Out-String).Trim() } catch { $nodeText = '' } }
|
|
293
419
|
if (-not (Test-NodeVersion $nodeText)) {
|
|
294
420
|
if ($nodeText) { Write-Problem ('Node.js ' + $nodeText + ' is too old. The AgEnD Runtime needs Node.js 22.14 or newer (22.14+, 23.6+ or 24+).') }
|
|
295
421
|
else { Write-Problem 'Node.js was not found. The AgEnD Runtime needs Node.js 22.14 or newer (22.14+, 23.6+ or 24+).' }
|
|
@@ -367,8 +493,10 @@
|
|
|
367
493
|
Set-AgendFile $shim $shimText
|
|
368
494
|
Set-AgendFile $current $folder { Assert-AgendLock $installLock; if ((Read-AgendSmallFile $current 90) -cne $beforeCurrent) { throw 'The selected Runtime changed during installation; nothing was switched.' } }
|
|
369
495
|
if ($was -ne '' -and $was -ne $folder) {
|
|
370
|
-
Write-Step ('agend-runtime now starts ' + $folder + ' (it was ' + $was + '). A Runtime that
|
|
496
|
+
Write-Step ('agend-runtime now starts ' + $folder + ' (it was ' + $was + '). A Runtime that runs in a window keeps its own version until you stop it with Ctrl+C and start it again; one that runs in the background is restarted below.')
|
|
371
497
|
}
|
|
498
|
+
# a Runtime that runs in the background was started from an older build; restart it after the lock is released so it uses this one.
|
|
499
|
+
if (([string]$env:AGEND_RUNTIME_REPAIR -eq '1') -or ($was -ne '' -and $was -ne $folder)) { $restartCli = Join-Path $target 'dist\runtime-cli.js' }
|
|
372
500
|
$others = @(Get-ChildItem -LiteralPath $root -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -ne $folder -and $_.Name -match '\A\d+\.\d+\.\d+([-+][A-Za-z0-9.+-]+)?\z' } | ForEach-Object { $_.Name })
|
|
373
501
|
# Earlier folders are not removed here: one of them may be running. Cleaning them up comes with the update and uninstall commands (phase 2).
|
|
374
502
|
if ($others.Count -gt 0) { Write-Step ('earlier versions are kept where they are (' + ($others -join ', ') + '). This installer never removes a version; clearing old ones comes later, with the update and uninstall commands.') }
|
|
@@ -384,28 +512,107 @@
|
|
|
384
512
|
$onPath = $true
|
|
385
513
|
}
|
|
386
514
|
|
|
515
|
+
# The reconnect entry: this AgEnD's address and the same connect-agend.bat the ZIP has. A repair run is for a computer that is already
|
|
516
|
+
# paired and writes nothing new beside it. A failure here never fails the install; it only means no automatic connection.
|
|
517
|
+
$repair = [string]$env:AGEND_RUNTIME_REPAIR -eq '1'
|
|
518
|
+
if (-not $repair) {
|
|
519
|
+
try { $connectDir = Write-AgendConnectEntry $root $origin }
|
|
520
|
+
catch { Write-Host ('AgEnD Runtime: warning: the reconnect entry was not written (' + $_.Exception.Message + '). The Runtime is installed; connect with the command shown below.') -ForegroundColor Yellow }
|
|
521
|
+
}
|
|
522
|
+
$connectBat = $null
|
|
523
|
+
if ($connectDir) { $connectBat = Join-Path $connectDir 'connect-agend.bat' }
|
|
524
|
+
$noConnect = Test-AgendSwitch $agendNoConnect
|
|
525
|
+
$mode = Get-AgendConnectMode $repair $noConnect (Test-AgendInteractive) ([bool]$connectDir) ([bool]$enrollToken)
|
|
526
|
+
|
|
387
527
|
Write-Host ''
|
|
388
|
-
if (
|
|
528
|
+
if ($mode -eq 'repair') {
|
|
389
529
|
Write-Host 'AgEnD Runtime is installed. Keep your existing profile and pairing; PATH was not changed.'
|
|
390
|
-
Write-Host '
|
|
530
|
+
Write-Host 'A Runtime that runs in the background was restarted with this version (see below). Close any Runtime that runs in a window (Ctrl+C), then start it in the background with this exact new executable and the same existing profile folder, including any previous --profile or AGEND_RUNTIME_HOME:'
|
|
391
531
|
$literalShim = $shim.Replace("'", "''")
|
|
392
|
-
Write-Host (' $agendProfile = $null; $agendProfile = Read-Host ''Existing Runtime profile folder (same as before)''; if ($agendProfile) { & ''' + $literalShim + '''
|
|
532
|
+
Write-Host (' $agendProfile = $null; $agendProfile = Read-Host ''Existing Runtime profile folder (same as before)''; if ($agendProfile) { & ''' + $literalShim + ''' start --profile $agendProfile } else { throw ''Existing Runtime profile folder is required'' }')
|
|
533
|
+
} elseif ($mode -eq 'connect' -or $mode -eq 'enroll') {
|
|
534
|
+
Write-Host 'AgEnD Runtime is installed.'
|
|
535
|
+
Write-Host ('Next time, double-click ' + $connectBat + ' to reconnect this computer.')
|
|
536
|
+
$cliJs = Join-Path $target 'dist\runtime-cli.js'
|
|
537
|
+
$doConnect = $true
|
|
393
538
|
} else {
|
|
394
539
|
Write-Host 'AgEnD Runtime is installed. This computer is not connected yet and nothing has been paired.'
|
|
395
|
-
Write-Host '
|
|
540
|
+
if ($mode -eq 'noninteractive') { Write-Host 'This window is not an interactive console (a script, a pipeline, CI or an AI agent runs it), so it only installed and did not try to connect.' }
|
|
541
|
+
elseif ($mode -eq 'switch') { Write-Host 'The variable $agendNoConnect is set in this window, so it only installed and did not try to connect. To connect from here by itself next time, run $agendNoConnect = $null first.' }
|
|
542
|
+
else { Write-Host 'The reconnect entry could not be written (see above), so it did not connect by itself.' }
|
|
543
|
+
Write-Host 'Next, connect it from an interactive PowerShell window. Open Settings -> Runtime -> Connect a computer in AgEnD for the one-time pairing code, then run:'
|
|
396
544
|
Write-Host ''
|
|
397
545
|
if ($onPath) { Write-Host (' agend-runtime connect --server "' + $origin + '"') }
|
|
398
546
|
else { Write-Host (' & "' + $shim + '" connect --server "' + $origin + '"') }
|
|
399
547
|
Write-Host ''
|
|
400
|
-
Write-Host '
|
|
548
|
+
Write-Host 'A person types the pairing code when asked, compares the fingerprint with the one AgEnD shows, then approves this computer in AgEnD. The code cannot be put in a command, a variable or a file, so an AI agent or script should stop here and give this command to the person.'
|
|
549
|
+
if ($connectBat) { Write-Host ('Or double-click ' + $connectBat + ' on that computer: it connects, and next time it reconnects without asking for the code.') }
|
|
550
|
+
if ($enrollToken) {
|
|
551
|
+
Write-Host 'The one-time token in this command was NOT used. It stays valid until it expires (15 minutes after it was made) or is revoked on the AgEnD page; running the same command again uses it.'
|
|
552
|
+
if ($mode -eq 'noentry') { $global:LASTEXITCODE = 1 }
|
|
553
|
+
}
|
|
401
554
|
}
|
|
555
|
+
$installFinished = $true
|
|
402
556
|
} catch {
|
|
403
557
|
Write-Problem ('install failed: ' + $_.Exception.Message)
|
|
404
558
|
$global:LASTEXITCODE = 1
|
|
559
|
+
$doConnect = $false
|
|
405
560
|
} finally {
|
|
406
561
|
if ($tmp -and (Test-Path -LiteralPath $tmp)) { Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue }
|
|
407
|
-
if ($installLock) { try { Remove-AgendLock $installLock } catch { Write-Problem 'Installation cleanup is unconfirmed; ownership was retained.'; $global:LASTEXITCODE = 1 } }
|
|
562
|
+
if ($installLock) { try { Remove-AgendLock $installLock } catch { Write-Problem 'Installation cleanup is unconfirmed; ownership was retained.'; $global:LASTEXITCODE = 1; $doConnect = $false; $lockReleased = $false } }
|
|
408
563
|
# A run that installed nothing leaves nothing: the install folder this run created is removed again, but only while it is still empty.
|
|
409
564
|
if ($createdRoot -and $root -and (Test-Path -LiteralPath $root) -and -not (Get-ChildItem -LiteralPath $root -Force | Select-Object -First 1)) { Remove-Item -LiteralPath $root -Force -ErrorAction SilentlyContinue }
|
|
410
565
|
}
|
|
566
|
+
|
|
567
|
+
# restart Runtimes that run in the background (repair run, or a different build was just selected). After the install lock is gone: a
|
|
568
|
+
# Runtime takes that lock itself. Only background Runtimes are touched; one that runs in a window is reported and left alone. A failure is a
|
|
569
|
+
# warning, never "install failed": the install itself is complete. If the installation failed after the build was selected, or its lock could not be confirmed released,
|
|
570
|
+
# nothing is stopped or restarted and the failure status stays.
|
|
571
|
+
if ($restartCli -and $installFinished -and $lockReleased -and (Test-Path -LiteralPath $restartCli)) {
|
|
572
|
+
$previousPreference = $ErrorActionPreference; $statusBeforeRestart = $global:LASTEXITCODE
|
|
573
|
+
try {
|
|
574
|
+
$ErrorActionPreference = 'Continue'
|
|
575
|
+
Write-Step 'restarting any Runtime that runs in the background so it uses this version.'
|
|
576
|
+
& $nodeExe $restartCli restart --all
|
|
577
|
+
if ($LASTEXITCODE -ne 0) { Write-Host 'AgEnD Runtime: warning: a background Runtime could not be restarted (see above). Run agend-runtime restart --all, or agend-runtime stop and agend-runtime start, when it is idle.' -ForegroundColor Yellow }
|
|
578
|
+
} catch {
|
|
579
|
+
Write-Host ('AgEnD Runtime: warning: could not restart a background Runtime: ' + $_.Exception.Message) -ForegroundColor Yellow
|
|
580
|
+
} finally { $ErrorActionPreference = $previousPreference }
|
|
581
|
+
$global:LASTEXITCODE = $statusBeforeRestart # a restart that failed is the warning above; it never turns a finished install into a failure, or a success into one
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
# Connect in this window, after the install lock is gone (a running Runtime takes that lock to update itself). This is the Runtime's own
|
|
585
|
+
# `connect --connection-dir`, the logic of connect-agend.bat, run by the Node.js that was just checked, in the version that was just installed
|
|
586
|
+
# (the same file the shim starts). A path goes to node.exe as an argument, never through cmd.exe. The Runtime asks for the pairing code itself.
|
|
587
|
+
# Once connected it moves itself to the background and this command ends; $agendForeground = 1 keeps it in this window.
|
|
588
|
+
if ($doConnect) {
|
|
589
|
+
$previousPreference = $ErrorActionPreference
|
|
590
|
+
try {
|
|
591
|
+
$ErrorActionPreference = 'Continue'
|
|
592
|
+
$foreground = Test-AgendSwitch $agendForeground
|
|
593
|
+
$connectExtra = @(); if ($foreground) { $connectExtra = @('--foreground') }
|
|
594
|
+
Write-Host ''
|
|
595
|
+
if ($enrollToken) {
|
|
596
|
+
if ($foreground) { $stays = 'The Runtime stays running in this window until you press Ctrl+C ($agendForeground is set; an AI agent or script that must not wait for it should start this command as its own background process).' }
|
|
597
|
+
else { $stays = 'Once it is connected the Runtime keeps running in the background: this command ends and closing this window does not disconnect it.' }
|
|
598
|
+
Write-Step ('connecting this computer to ' + $origin + ' with the one-time token from the install command: no pairing code and no approval step. ' + $stays + ' A computer that is already connected to this AgEnD just reconnects, and the token is not used.')
|
|
599
|
+
# The token goes in on standard input, once: not as an argument (it would show in the process list), not in the environment, not in a file.
|
|
600
|
+
$enrollToken | & $nodeExe $cliJs connect --connection-dir $connectDir --enroll-stdin --server-fingerprint $enrollFingerprint @connectExtra
|
|
601
|
+
$enrollToken = $null
|
|
602
|
+
} else {
|
|
603
|
+
if ($foreground) { $stays = 'Ctrl+C stops it ($agendForeground is set, so the Runtime stays in this window).' } else { $stays = 'Once it is connected it keeps running in the background and closing this window does not disconnect it.' }
|
|
604
|
+
Write-Step ('connecting this computer to ' + $origin + '. If it asks for the one-time pairing code, type the one on the AgEnD page (Settings -> Runtime -> Connect a computer); a computer that is already paired just reconnects. ' + $stays)
|
|
605
|
+
& $nodeExe $cliJs connect --connection-dir $connectDir @connectExtra
|
|
606
|
+
}
|
|
607
|
+
$connectExit = $LASTEXITCODE
|
|
608
|
+
Write-Host ''
|
|
609
|
+
if ($connectExit -eq 0 -and $foreground) { Write-Step ('stopped. To reconnect, double-click ' + $connectBat) }
|
|
610
|
+
elseif ($connectExit -eq 0) { Write-Step ('done. To reconnect later, double-click ' + $connectBat + ' (only needed if the Runtime was stopped, or autostart is off and this computer was restarted).') }
|
|
611
|
+
else { Write-Problem ('stopped or could not connect (status ' + $connectExit + '). Read the message above for what to do next, then double-click ' + $connectBat + ' to try again.') }
|
|
612
|
+
} catch {
|
|
613
|
+
Write-Problem ('could not start the connection: ' + $_.Exception.Message)
|
|
614
|
+
Write-Host ('The Runtime is installed. Connect with: double-click ' + $connectBat)
|
|
615
|
+
$global:LASTEXITCODE = 1
|
|
616
|
+
} finally { $ErrorActionPreference = $previousPreference }
|
|
617
|
+
}
|
|
411
618
|
}
|