@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
|
@@ -3,11 +3,13 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
3
3
|
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
4
4
|
import { ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
5
5
|
import { CLI_CAPS } from "./cli-caps.js";
|
|
6
|
+
import { confirmedWrite } from "./settings-confirm.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* #3190 Part 3b: install a CLI on a paired Windows computer, from Settings → Runtime. The page sends only a CLI id; the Runtime on that computer decides the
|
|
9
10
|
* package, the exact version, the folder and the checks. It happens only while that computer's owner has turned the "install" switch on THERE (the page can
|
|
10
|
-
* read the switch, never change it). Claude Code and
|
|
11
|
+
* read the switch, never change it). Only what AgEnD can pin and check: Claude Code, Codex and OpenCode (a pinned npm package) and Antigravity (one pinned download, #3521); the other CLIs
|
|
12
|
+
* show their official command, and why, for the computer's owner to run.
|
|
11
13
|
*/
|
|
12
14
|
register("runtimeInstall", {
|
|
13
15
|
en: { title: "Install a CLI", lead: "Installs the fixed version AgEnD pins, into this Runtime's own folder on that computer. No administrator, no PATH change, no vendor script.",
|
|
@@ -15,6 +17,8 @@ register("runtimeInstall", {
|
|
|
15
17
|
switchOff: "The owner of that computer has not turned this on. On that computer, run:", switchOn: "Allowed by that computer's owner.", switchUntil: "Allowed until {0}.",
|
|
16
18
|
installed: "Installed {0}", installedOther: "Installed {0} (not the version AgEnD installs)", notInstalled: "Not installed", install: "Install {0}", reinstall: "Install pinned {0}", installing: "Installing… this can take a few minutes",
|
|
17
19
|
ask: "Install {0} {1} on {2}? It comes from the official npm registry, is checked against AgEnD's pinned hashes, the registry signatures and the publisher's Windows signature, and is kept in this Runtime's folder on that computer. The install is recorded there.",
|
|
20
|
+
notAudited: "Not yet verified by AgEnD: this version is pinned for its integrity (size, checksum, the publisher's signature), not because AgEnD has audited it.",
|
|
21
|
+
askDownload: "Install {0} {1} on {2}? AgEnD downloads that exact version from the vendor's own address (the vendor's install script is not run), checks its size, its checksum and the publisher's Windows signature, and keeps it in this Runtime's folder on that computer. If any of them does not match, nothing is installed. The install is recorded there.",
|
|
18
22
|
confirm: "Install", done: "{0} {1} is installed.", failed: "The install did not finish: {2}", failedShort: "The install did not finish.", requestFailed: "Could not start the install: {0}",
|
|
19
23
|
othersTitle: "Other CLIs", othersLead: "AgEnD does not install these. The computer's owner can run the vendor's own command in PowerShell on that computer.", needsAdmin: "needs an administrator" },
|
|
20
24
|
"zh-TW": { title: "安裝 CLI", lead: "安裝 AgEnD 固定的版本,裝在那台電腦上 Runtime 自己的資料夾。不需要系統管理員,不改 PATH,也不執行廠商腳本。",
|
|
@@ -22,6 +26,8 @@ register("runtimeInstall", {
|
|
|
22
26
|
switchOff: "那台電腦的主人還沒有開啟這個功能。請在那台電腦執行:", switchOn: "那台電腦的主人已允許。", switchUntil: "已允許,到 {0} 為止。",
|
|
23
27
|
installed: "已安裝 {0}", installedOther: "已安裝 {0}(不是 AgEnD 會安裝的版本)", notInstalled: "尚未安裝", install: "安裝 {0}", reinstall: "安裝固定版本 {0}", installing: "安裝中…可能需要幾分鐘",
|
|
24
28
|
ask: "要在 {2} 安裝 {0} {1} 嗎?它來自官方 npm registry,會比對 AgEnD 內建的雜湊、registry 簽章與發行者的 Windows 數位簽章,並放在那台電腦上 Runtime 自己的資料夾。那台電腦會留下安裝紀錄。",
|
|
29
|
+
notAudited: "尚未經 AgEnD 驗證:這個版本是因為能檢查它的完整性(檔案大小、雜湊、發行者的簽章)才鎖定的,不是 AgEnD 稽核過的版本。",
|
|
30
|
+
askDownload: "要在 {2} 安裝 {0} {1} 嗎?AgEnD 會從廠商自己的網址下載這個固定版本(不執行廠商的安裝腳本),比對檔案大小、雜湊與發行者的 Windows 數位簽章,並放在那台電腦上 Runtime 自己的資料夾。任何一項不符就不會安裝。那台電腦會留下安裝紀錄。",
|
|
25
31
|
confirm: "安裝", done: "{0} {1} 已安裝。", failed: "安裝沒有完成:{2}", failedShort: "安裝沒有完成。", requestFailed: "無法開始安裝:{0}",
|
|
26
32
|
othersTitle: "其他 CLI", othersLead: "AgEnD 不會安裝這些。電腦的主人可以在那台電腦的 PowerShell 執行廠商自己的指令。", needsAdmin: "需要系統管理員" },
|
|
27
33
|
});
|
|
@@ -33,9 +39,9 @@ export const SWITCH_COMMAND = "agend-runtime remote-setup install on --for 2h";
|
|
|
33
39
|
export const INSTALL_CLIS = Object.keys(CLI_CAPS).filter((id) => CLI_CAPS[id].runtimeInstall).map((id) => ({ id, label: CLI_CAPS[id].runtimeName }));
|
|
34
40
|
/** Vendor commands, for the computer's owner to run: AgEnD never sends them anywhere. */
|
|
35
41
|
export const OFFICIAL_COMMANDS = [
|
|
36
|
-
{ id: "grok", label: "Grok", command: "irm https://x.ai/cli/install.ps1 | iex" },
|
|
37
|
-
{ id: "
|
|
38
|
-
{ id: "kiro", label: "Kiro", command: "irm https://cli.kiro.dev/install.ps1 | iex", administrator: true },
|
|
42
|
+
{ id: "grok", label: "Grok", command: "irm https://x.ai/cli/install.ps1 | iex", why: "whyGrok" },
|
|
43
|
+
{ id: "muse", label: "Muse", command: "irm https://dev.meta.ai/install.ps1 | iex", why: "whyMuse" },
|
|
44
|
+
{ id: "kiro", label: "Kiro", command: "irm https://cli.kiro.dev/install.ps1 | iex", administrator: true, why: "whyKiro" },
|
|
39
45
|
];
|
|
40
46
|
/** A computer shows this only when its Runtime says it can (and it is a paired, approved one). */
|
|
41
47
|
/**
|
|
@@ -45,10 +51,63 @@ export const OFFICIAL_COMMANDS = [
|
|
|
45
51
|
export const versionNumber = printed => typeof printed === "string" ? /(?<![\d.])\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?![\d.])/.exec(printed)?.[0] ?? null : null;
|
|
46
52
|
export const offersCliInstall = machine => !!machine && !machine.isLocal && machine.runtimeInfo?.capabilities?.includes("cli-install") === true && ["online", "offline"].includes(machine.status);
|
|
47
53
|
|
|
54
|
+
/** -1, 0 or 1: two x.y.z compared number by number (never as text). A prerelease suffix is ignored. Null when either is not a version. */
|
|
55
|
+
export function compareVersions(a, b) {
|
|
56
|
+
const x = /^(\d+)\.(\d+)\.(\d+)/.exec(a || ""), y = /^(\d+)\.(\d+)\.(\d+)/.exec(b || "");
|
|
57
|
+
if (!x || !y) return null;
|
|
58
|
+
for (let i = 1; i <= 3; i++) { const d = Number(x[i]) - Number(y[i]); if (d !== 0) return d < 0 ? -1 : 1; }
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// AGEND-136 (#3521): Update on a computer. The version the Runtime installs is the newest one AgEnD has AUDITED (the pinned table is kept equal to it), so an update is the
|
|
63
|
+
// same pinned, verified install over an older copy — the vendor's own updater never runs there. The page sends the CLI's id, as for an install, and nothing else.
|
|
64
|
+
register("runtimeInstall", {
|
|
65
|
+
en: { update: "Update to {0}", behind: "Installed {0}. AgEnD has audited {1}: Update installs exactly that, with the same checks as an install.",
|
|
66
|
+
current: "Installed {0} — up to date. The newest version AgEnD has audited: {1}.", newer: "Installed {0}, which is newer than {1}, the newest version AgEnD has audited: not verified by AgEnD yet.",
|
|
67
|
+
noUpdate: "Installed {0}. The newest version AgEnD has audited: {1}. This CLI is not updated from here: Install is only for a computer that does not have it yet.",
|
|
68
|
+
askUpdate: "Update {0} on {2} from {3} to {1}? That is the version AgEnD has audited. It comes from the official npm registry, is checked against AgEnD's pinned hashes, the registry signatures and the publisher's Windows signature, and is kept in this Runtime's folder on that computer. The update is recorded there.",
|
|
69
|
+
},
|
|
70
|
+
"zh-TW": { update: "更新到 {0}", behind: "已安裝 {0}。AgEnD 稽核過的版本是 {1}:按「更新」會裝這個版本,檢查和安裝完全一樣。",
|
|
71
|
+
current: "已安裝 {0},是最新的。AgEnD 稽核過的最新版本:{1}。", newer: "已安裝 {0},比 AgEnD 稽核過的最新版本 {1} 還新:尚未經 AgEnD 驗證。",
|
|
72
|
+
noUpdate: "已安裝 {0}。AgEnD 稽核過的最新版本:{1}。這個 CLI 不從這裡更新:「安裝」只給還沒有它的電腦。",
|
|
73
|
+
askUpdate: "要在 {2} 把 {0} 從 {3} 更新到 {1} 嗎?這是 AgEnD 稽核過的版本。它來自官方 npm registry,會比對 AgEnD 內建的雜湊、registry 簽章與發行者的 Windows 數位簽章,並放在那台電腦上 Runtime 自己的資料夾。那台電腦會留下更新紀錄。",
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// AGEND-153 (the maintainer's decision on #3539): the named exception. Antigravity updates itself and cannot be pinned to a release, so on a computer that already has it the button goes to the
|
|
78
|
+
// vendor's LATEST release — which AgEnD has NOT audited — and says so. The Runtime downloads it from the vendor's own fixed address and checks its checksum and Google's Windows signature first.
|
|
79
|
+
register("runtimeInstall", {
|
|
80
|
+
en: { updateLatest: "Update to latest (not audited by AgEnD)",
|
|
81
|
+
latestInfo: "Installed {0}. AgEnD installs {1}, a version it has audited. Update goes to the latest release the vendor serves, which AgEnD has NOT audited: this CLI updates itself and cannot be pinned.",
|
|
82
|
+
askUpdateLatest: "Update {0} on {1} to the vendor's LATEST release, which AgEnD has NOT audited? This computer downloads the release the vendor's own manifest names (the vendor's update program is not run), checks its checksum and the publisher's Windows signature, and keeps it in this Runtime's folder. If any of them does not match, nothing changes. The update is recorded there.",
|
|
83
|
+
doneLatest: "{0} is now {1}, the latest release the vendor serves (not audited by AgEnD).", cardLabelUpdateLatest: "Update {0} on {1} to the latest release (not audited by AgEnD)" },
|
|
84
|
+
"zh-TW": { updateLatest: "更新到最新版(未經盤點)",
|
|
85
|
+
latestInfo: "已安裝 {0}。AgEnD 會安裝 {1},這是它稽核過的版本。按「更新」會更新到廠商釋出的最新版,這個版本 AgEnD 尚未稽核:這個 CLI 會自己更新,無法指定版本。",
|
|
86
|
+
askUpdateLatest: "要在 {1} 把 {0} 更新到廠商的「最新版」嗎?這個版本 AgEnD 尚未稽核。那台電腦會下載廠商自己的 manifest 指定的版本(不執行廠商的更新程式),比對檔案雜湊與發行者的 Windows 數位簽章,並放在 Runtime 自己的資料夾。任何一項不符就不會改變任何東西。那台電腦會留下更新紀錄。",
|
|
87
|
+
doneLatest: "{0} 現在是 {1},廠商釋出的最新版(未經 AgEnD 盤點)。", cardLabelUpdateLatest: "在 {1} 上把 {0} 更新到最新版(未經 AgEnD 盤點)" },
|
|
88
|
+
});
|
|
89
|
+
|
|
48
90
|
// Ridge #3321 S06 / S09: the words of the loading state and the copyable commands.
|
|
49
91
|
register("runtimeInstall", {
|
|
50
|
-
en: { loading: "Reading this computer's install setting…", copy: "Copy", copied: "Copied", switchCommand: "Command for that computer"
|
|
51
|
-
|
|
92
|
+
en: { loading: "Reading this computer's install setting…", copy: "Copy", copied: "Copied", switchCommand: "Command for that computer",
|
|
93
|
+
cardLabel: "Install {0} on {1}", cardLabelUpdate: "Update {0} on {1}", err_expired: "The install was not confirmed in time.", err_rejected: "The install was turned down.",
|
|
94
|
+
err_stale: "Settings changed before the install could start. Try again.", err_install_confirmation_required: "The install must be confirmed first." },
|
|
95
|
+
"zh-TW": { loading: "正在讀取這台電腦的安裝設定…", copy: "複製", copied: "已複製", switchCommand: "在那台電腦執行的指令",
|
|
96
|
+
cardLabel: "在 {1} 上安裝 {0}", cardLabelUpdate: "在 {1} 上更新 {0}", err_expired: "安裝沒有在時限內確認。", err_rejected: "安裝已被拒絕。",
|
|
97
|
+
err_stale: "安裝開始前設定已經改變。請再試一次。", err_install_confirmation_required: "安裝必須先經過確認。" },
|
|
98
|
+
});
|
|
99
|
+
// AGEND-133 (#3521): why a CLI is not installed from here — AgEnD installs only what it can pin and check (an exact version, its hashes, and who published it).
|
|
100
|
+
register("runtimeInstall", {
|
|
101
|
+
en: {
|
|
102
|
+
whyGrok: "Why not here: Grok's Windows program is not signed by its publisher, so AgEnD could not check who built it, and the vendor script installs whatever version is current.",
|
|
103
|
+
whyMuse: "Why not here: Muse has no package or file with a fixed version AgEnD could check: its launcher installs itself, and updates itself, from the vendor's server.",
|
|
104
|
+
whyKiro: "Why not here: Kiro's Windows installer is an MSI into Program Files, which needs an administrator; the Runtime never has one.",
|
|
105
|
+
},
|
|
106
|
+
"zh-TW": {
|
|
107
|
+
whyGrok: "為什麼不能從這裡安裝:Grok 的 Windows 程式沒有發行者的數位簽章,AgEnD 無法確認是誰建置的;廠商腳本也是裝當下最新的版本。",
|
|
108
|
+
whyMuse: "為什麼不能從這裡安裝:Muse 沒有 AgEnD 能確認的固定版本套件或檔案:它的啟動器會自己從廠商的伺服器安裝、自己更新。",
|
|
109
|
+
whyKiro: "為什麼不能從這裡安裝:Kiro 在 Windows 的安裝程式是裝進 Program Files 的 MSI,需要系統管理員權限,而 Runtime 沒有。",
|
|
110
|
+
},
|
|
52
111
|
});
|
|
53
112
|
/** Ridge #3321 S09: a command to run on that computer — Runtime's labelled command card (runtime-install.css), with Copy. */
|
|
54
113
|
function CommandCard({ label, command }) {
|
|
@@ -59,9 +118,18 @@ function CommandCard({ label, command }) {
|
|
|
59
118
|
<button type="button" class="btn btn-sm" onClick=${copy}>${text(copied ? "copied" : "copy")}</button></div></div>`;
|
|
60
119
|
}
|
|
61
120
|
|
|
121
|
+
/** Why a confirmed install did not start: the computer's own sentence when the gate says `apply_rejected: …`, else the state of the held change, else what the write answered. */
|
|
122
|
+
const refusalOf = (r) => {
|
|
123
|
+
const detail = r.confirmed && r.confirmed.outcome && typeof r.confirmed.outcome.detail === "string" ? /apply_rejected: (.+)$/.exec(r.confirmed.outcome.detail) : null;
|
|
124
|
+
if (detail) return detail[1];
|
|
125
|
+
if (r.confirmed && ["expired", "rejected", "stale"].includes(r.confirmed.state)) return text(`err_${r.confirmed.state}`);
|
|
126
|
+
const code = r.body && r.body.error;
|
|
127
|
+
return code === "install_confirmation_required" ? text("err_install_confirmation_required") : code || `HTTP ${r.status}`;
|
|
128
|
+
};
|
|
129
|
+
|
|
62
130
|
export function CliInstall({ machine, lease, onChanged }) {
|
|
63
131
|
const [view, setView] = useState(null), [error, setError] = useState(""), [note, setNote] = useState(""), [busy, setBusy] = useState(false);
|
|
64
|
-
const last = useRef("");
|
|
132
|
+
const last = useRef(""), latestJob = useRef(false);
|
|
65
133
|
const online = machine.status === "online";
|
|
66
134
|
const path = `/ui/runtimes/machines/${encodeURIComponent(machine.id)}/remote-setup`;
|
|
67
135
|
const load = async () => {
|
|
@@ -87,7 +155,7 @@ export function CliInstall({ machine, lease, onChanged }) {
|
|
|
87
155
|
const before = last.current; last.current = key;
|
|
88
156
|
if (before.endsWith(":installing") && job && job.state !== "installing") {
|
|
89
157
|
const label = INSTALL_CLIS.find(cli => cli.id === job.cli)?.label || job.cli;
|
|
90
|
-
setNote(job.state === "done" ? text("done", label, job.version || "") : job.error ? text("failed", label, job.version || "", job.error) : text("failedShort"));
|
|
158
|
+
setNote(job.state === "done" ? text(latestJob.current && CLI_CAPS[job.cli]?.runtimeUpdateLatest ? "doneLatest" : "done", label, job.version || "") : job.error ? text("failed", label, job.version || "", job.error) : text("failedShort"));
|
|
91
159
|
onChanged?.();
|
|
92
160
|
}
|
|
93
161
|
}, [job]);
|
|
@@ -95,26 +163,36 @@ export function CliInstall({ machine, lease, onChanged }) {
|
|
|
95
163
|
const allowed = switchState?.on === true;
|
|
96
164
|
const row = cli => {
|
|
97
165
|
const entry = (machine.inventory?.clis || []).find(item => item.id === cli.id && item.path);
|
|
98
|
-
const
|
|
166
|
+
const pin = view?.catalog?.find(item => item.id === cli.id), pinned = pin?.version || "", byDownload = pin?.kind === "download", unaudited = pin?.pin === "integrity";
|
|
99
167
|
// What the CLI printed is compared by its version number, whole; the path says nothing (the owner's own copy of the same version is just as installed).
|
|
100
|
-
const found = entry ? versionNumber(entry.version) : null,
|
|
101
|
-
|
|
168
|
+
const found = entry ? versionNumber(entry.version) : null, order = found && pinned ? compareVersions(found, pinned) : null;
|
|
169
|
+
// AGEND-136: at the pinned (= audited) version: up to date. Older: an Update to it. Newer than it: not verified by AgEnD yet, and nothing to install (an install would only put an older copy beside it).
|
|
170
|
+
const upToDate = !!entry && !!pinned && order === 0, behind = !!entry && !!pinned && order === -1, newer = !!entry && !!pinned && order === 1;
|
|
171
|
+
// AGEND-152 (Prism R4 on #3539): install and update are separate facts in the registry. An installed copy of a CLI whose `runtime.update` is not "yes" (Antigravity updates itself, OpenCode's Update
|
|
172
|
+
// is not built) is only shown — its version and the audited one — and never offered a button: an Install over it would be an update by another name.
|
|
173
|
+
const canUpdate = CLI_CAPS[cli.id]?.runtimeUpdate === true, installOnly = !!entry && !canUpdate;
|
|
174
|
+
// AGEND-153: the named exception — installed here and updated to the vendor's latest, whatever the version it has now (it is offered at, below and above the audited one).
|
|
175
|
+
const toLatest = !!entry && canUpdate && CLI_CAPS[cli.id]?.runtimeUpdateLatest === true;
|
|
176
|
+
const state = !entry ? text("notInstalled") : toLatest ? text("latestInfo", entry.version || found || "?", pinned) : installOnly && behind ? text("noUpdate", found, pinned) : upToDate ? text("current", found, pinned) : behind ? text("behind", found, pinned) : newer ? text("newer", found, pinned) : text("installedOther", entry.version || "?");
|
|
102
177
|
const start = async () => {
|
|
103
|
-
if (busy || !pinned) return;
|
|
104
|
-
|
|
178
|
+
if (busy || !pinned || installOnly) return;
|
|
179
|
+
const message = toLatest ? text("askUpdateLatest", cli.label, machine.name) : byDownload ? text("askDownload", cli.label, pinned, machine.name) : behind ? text("askUpdate", cli.label, pinned, machine.name, found) : text("ask", cli.label, pinned, machine.name);
|
|
180
|
+
if (!await confirmDialog({ message, confirmLabel: toLatest ? text("updateLatest") : text(behind ? "update" : "confirm", pinned) })) return;
|
|
105
181
|
if (!lease.current()) return;
|
|
106
|
-
setBusy(true); setError(""); setNote("");
|
|
182
|
+
setBusy(true); setError(""); setNote(""); latestJob.current = toLatest;
|
|
107
183
|
try {
|
|
108
|
-
|
|
109
|
-
|
|
184
|
+
// AGEND-148 (Prism R3 on #3539): through the Settings gate like any change that acts on a computer — held, and (for an administrator who asked for their own code) confirmed with it on
|
|
185
|
+
// the card — and the page sends the CLI's id and nothing else. The computer's own owner-switch is asked on that computer afterwards, as before.
|
|
186
|
+
const label = toLatest ? text("cardLabelUpdateLatest", cli.label, machine.name) : text(behind ? "cardLabelUpdate" : "cardLabel", cli.label, machine.name);
|
|
187
|
+
const response = await confirmedWrite(`/ui/runtimes/machines/${encodeURIComponent(machine.id)}/cli-install`, { method: "POST", body: toLatest ? { cli: cli.id, acceptLatestUnaudited: true } : { cli: cli.id }, label, displaySummary: () => label });
|
|
110
188
|
if (!lease.current()) return;
|
|
111
|
-
if (!response.ok) throw new Error(
|
|
189
|
+
if (!response.ok) throw new Error(refusalOf(response));
|
|
112
190
|
await load();
|
|
113
191
|
} catch (e) { if (lease.current()) setError(text("requestFailed", e.message)); }
|
|
114
192
|
finally { if (lease.current()) setBusy(false); }
|
|
115
193
|
};
|
|
116
|
-
return html`<li key=${cli.id} data-cli=${cli.id}><strong>${cli.label}</strong><span class="note">${state}</span
|
|
117
|
-
${upToDate ? null : html`<button type="button" class="btn btn-sm" disabled=${!allowed || !online || busy || running || !pinned} onClick=${start}>${entry ? text("reinstall", pinned) : text("install", pinned)}</button>`}</li>`;
|
|
194
|
+
return html`<li key=${cli.id} data-cli=${cli.id}><strong>${cli.label}</strong><span class="note">${state}</span>${unaudited ? html`<span class="note runtime-cli-unaudited">${text("notAudited")}</span>` : null}
|
|
195
|
+
${!toLatest && (upToDate || newer || installOnly) ? null : html`<button type="button" class="btn btn-sm" disabled=${!allowed || !online || busy || running || !pinned} onClick=${start}>${toLatest ? text("updateLatest") : behind ? text("update", pinned) : entry ? text("reinstall", pinned) : text("install", pinned)}</button>`}</li>`;
|
|
118
196
|
};
|
|
119
197
|
return html`<div class="runtime-cli-install"><h4>${text("title")}</h4><p class="note">${text("lead")}</p>
|
|
120
198
|
${!online ? html`<p class="note" role="status">${text("offline")}</p>`
|
|
@@ -130,6 +208,7 @@ export function CliInstall({ machine, lease, onChanged }) {
|
|
|
130
208
|
${note ? html`<p class="note" role="status">${note}</p>` : null}
|
|
131
209
|
${error ? html`<p class="runtime-error" role="alert">${error}</p>` : null}`}
|
|
132
210
|
<details class="runtime-cli-install-others"><summary>${text("othersTitle")}</summary><p class="note">${text("othersLead")}</p>
|
|
133
|
-
<ul>${OFFICIAL_COMMANDS.map(item => html`<li key=${item.id}><${CommandCard} label=${item.administrator ? `${item.label} (${text("needsAdmin")})` : item.label} command=${item.command}
|
|
211
|
+
<ul>${OFFICIAL_COMMANDS.map(item => html`<li key=${item.id}><${CommandCard} label=${item.administrator ? `${item.label} (${text("needsAdmin")})` : item.label} command=${item.command} />
|
|
212
|
+
<p class="note runtime-cli-install-why" data-why=${item.id}>${text(item.why)}</p></li>`)}</ul></details>
|
|
134
213
|
</div>`;
|
|
135
214
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export function safeRuntimeOrigin(server: unknown): string;
|
|
2
2
|
export function runtimeConnectCommand(server: unknown): string;
|
|
3
3
|
export function runtimeInstallCommand(server: unknown, scriptSha256: unknown): string;
|
|
4
|
+
export function runtimeEnrollCommand(server: unknown, scriptSha256: unknown, token: unknown, fingerprint: unknown): string;
|
|
5
|
+
export function runtimeInstallOnlyCommand(server: unknown, scriptSha256: unknown): string;
|
|
4
6
|
export function runtimeWindowsConnectCommand(server: unknown): string;
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* A command only ever contains: the origin the administrator reviewed in step 1 (inert host and port characters, https or loopback
|
|
6
6
|
* http), and, for the install command, the SHA-256 of install.ps1 that the AgEnD server itself reported to this signed-in page. No
|
|
7
|
-
* pairing code,
|
|
7
|
+
* pairing code, credential or flag the page did not choose is ever put in one. The ONE exception is the install command that carries a
|
|
8
|
+
* one-time enrollment token (`runtimeEnrollCommand`): that token is a short-lived (15 minutes), single-use authorisation made by this page for
|
|
9
|
+
* exactly that command; the token and the server fingerprint are checked for their shape here and are inert (single-quoted) characters only.
|
|
8
10
|
*/
|
|
11
|
+
const ENROLL_TOKEN = /^agend_enroll_[A-Za-z0-9_-]{43}$/, SERVER_FINGERPRINT = /^[a-f0-9]{64}$/;
|
|
9
12
|
|
|
10
13
|
/** The origin, only when it is composed of inert hostname/port characters; "" otherwise. Nothing else is placed in a copyable shell command. */
|
|
11
14
|
export function safeRuntimeOrigin(server) {
|
|
@@ -41,6 +44,10 @@ export function runtimeConnectCommand(server) {
|
|
|
41
44
|
* - the first statement (TLS 1.2, which Windows PowerShell 5.1 may not offer by default) touches nothing the check depends on: if it
|
|
42
45
|
* fails, the rest still runs and the rest still refuses.
|
|
43
46
|
* This differs from the shape in the upstream design review (`if (-not $s -or <hash> -ne …) { throw }; iex $s`) for exactly that reason.
|
|
47
|
+
*
|
|
48
|
+
* The script itself decides what happens after the install: in an interactive console it goes on to connect this computer in the same
|
|
49
|
+
* window; anywhere else (a redirected stdin or stdout, -NonInteractive, an AI agent, CI) it only installs and prints the connect command.
|
|
50
|
+
* Nothing about that decision is in this command, so the hash pin covers all of it. The pairing code is never part of a command.
|
|
44
51
|
*/
|
|
45
52
|
export function runtimeInstallCommand(server, scriptSha256) {
|
|
46
53
|
const origin = safeRuntimeOrigin(server);
|
|
@@ -52,8 +59,34 @@ export function runtimeInstallCommand(server, scriptSha256) {
|
|
|
52
59
|
+ `if ($s -and $h -eq '${scriptSha256}') { iex $s } `
|
|
53
60
|
+ `else { Write-Host 'install.ps1 could not be verified against the hash on the AgEnD page (a certificate or download error above is the usual cause: trust this AgEnD certificate, or use the ZIP; otherwise reload the page and copy the command again)' -ForegroundColor Red; throw 'install.ps1 was not run' }`;
|
|
54
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The install command with a ONE-TIME enrollment token inside: pasted on ANY computer, or handed to an AI agent running there, it installs the
|
|
64
|
+
* Runtime and connects it with no pairing code and no approval step. The token (and the server fingerprint the Runtime must see before it sends it) are
|
|
65
|
+
* set in two variables that install.ps1 reads and clears at once; `try/finally` clears them again even when the command is refused before install.ps1
|
|
66
|
+
* runs (a thrown error would otherwise skip a trailing clear and leave the token in the PowerShell session). install.ps1 hands the token to the Runtime on
|
|
67
|
+
* its standard input; it is never a command-line argument. The token works once, for 15 minutes, and is revoked from this page; anyone who gets this text
|
|
68
|
+
* while it is valid can connect THEIR computer as your Runtime, so treat it like a password: do not paste it into chats or tickets.
|
|
69
|
+
*/
|
|
70
|
+
export function runtimeEnrollCommand(server, scriptSha256, token, fingerprint) {
|
|
71
|
+
const body = runtimeInstallCommand(server, scriptSha256);
|
|
72
|
+
if (!body || typeof token !== "string" || !ENROLL_TOKEN.test(token) || typeof fingerprint !== "string" || !SERVER_FINGERPRINT.test(fingerprint)) return "";
|
|
73
|
+
// `$LASTEXITCODE` is reset first (a stale value from an earlier command must not look like a failure) and checked last: `powershell -Command` returns 1 only when
|
|
74
|
+
// its last statement failed, so an AI agent or CI step sees a non-zero exit status when the install or the connection did not succeed. Silent and harmless at a prompt.
|
|
75
|
+
return `$global:LASTEXITCODE = 0; $agendEnroll = '${token}'; $agendFingerprint = '${fingerprint}'; try { ${body} } finally { $agendEnroll = $null; $agendFingerprint = $null }; `
|
|
76
|
+
+ `if ($LASTEXITCODE) { Write-Error 'The AgEnD Runtime was not installed or did not connect (the message above says why).' -ErrorAction SilentlyContinue }`;
|
|
77
|
+
}
|
|
55
78
|
/** After the install script: agend-runtime is on the user's PATH. The pairing code is typed into the terminal, never here. */
|
|
56
79
|
export function runtimeWindowsConnectCommand(server) {
|
|
57
80
|
const origin = safeRuntimeOrigin(server);
|
|
58
81
|
return origin ? `agend-runtime connect --server "${origin}"` : "";
|
|
59
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* The same pinned command, for a person or an agent that wants the install only. `$agendNoConnect = 1` is read by the script (and by nothing
|
|
85
|
+
* else) before it decides whether to connect, and is cleared again afterwards so it does not stay set in that PowerShell window and quietly
|
|
86
|
+
* turn the next, normal command into an install-only one. (If the command is refused before it runs, the clearing is skipped with it; the
|
|
87
|
+
* script says how to clear the variable whenever it is the reason nothing was connected.)
|
|
88
|
+
*/
|
|
89
|
+
export function runtimeInstallOnlyCommand(server, scriptSha256) {
|
|
90
|
+
const command = runtimeInstallCommand(server, scriptSha256);
|
|
91
|
+
return command ? `$agendNoConnect = 1; ${command}; $agendNoConnect = $null` : "";
|
|
92
|
+
}
|
|
@@ -14,7 +14,7 @@ register("runtimeUpdate", {
|
|
|
14
14
|
recovery: "An interrupted update needs a fresh separate installation. Keep the existing profile and pairing.",
|
|
15
15
|
damaged: "This installation could not be verified. Reinstall into a fresh separate folder.",
|
|
16
16
|
running: "Running: {0} / build {1}", last: "Last reported update status; this connection has not confirmed it.",
|
|
17
|
-
repair: "Show reinstall command", repairTitle: "Enable automatic Runtime updates", repairHint: "Run agend-runtime status with the same --profile or AGEND_RUNTIME_HOME as this Runtime, note its profile folder, then close this Runtime. This command selects a fresh separate folder and verifies the installer from this AgEnD, leaving PATH unchanged. The installer prints a full-path
|
|
17
|
+
repair: "Show reinstall command", repairTitle: "Enable automatic Runtime updates", repairHint: "Run agend-runtime status with the same --profile or AGEND_RUNTIME_HOME as this Runtime, note its profile folder, then close this Runtime. This command selects a fresh separate folder and verifies the installer from this AgEnD, leaving PATH unchanged. The installer prints a full-path start command that runs the Runtime in the background; enter that same existing profile folder when asked. Your pairing is kept; no new pairing code is needed.",
|
|
18
18
|
attention: "Runtime update needs attention", open: "Open Runtime settings",
|
|
19
19
|
},
|
|
20
20
|
"zh-TW": {
|
|
@@ -27,7 +27,7 @@ register("runtimeUpdate", {
|
|
|
27
27
|
recovery: "中斷的更新需要重新安裝到獨立目錄。請保留既有設定檔與配對。",
|
|
28
28
|
damaged: "無法驗證此安裝。請重新安裝到全新的獨立目錄。",
|
|
29
29
|
running: "執行中:{0}/組建 {1}", last: "這是上次回報的更新狀態,目前連線尚未確認。",
|
|
30
|
-
repair: "顯示重新安裝指令", repairTitle: "啟用 Runtime 自動更新", repairHint: "沿用此 Runtime 原本的 --profile 或 AGEND_RUNTIME_HOME 執行 agend-runtime status,記下設定檔資料夾,再關閉此 Runtime。指令會選擇全新的獨立目錄,並驗證來自這台 AgEnD 的安裝程式,不會變更 PATH。請執行安裝程式顯示的完整路徑
|
|
30
|
+
repair: "顯示重新安裝指令", repairTitle: "啟用 Runtime 自動更新", repairHint: "沿用此 Runtime 原本的 --profile 或 AGEND_RUNTIME_HOME 執行 agend-runtime status,記下設定檔資料夾,再關閉此 Runtime。指令會選擇全新的獨立目錄,並驗證來自這台 AgEnD 的安裝程式,不會變更 PATH。請執行安裝程式顯示的完整路徑 start 指令(會在背景執行 Runtime),並在詢問時輸入原本的設定檔資料夾;既有配對會保留,不需要新的配對碼。",
|
|
31
31
|
attention: "Runtime 更新需要處理", open: "開啟 Runtime 設定",
|
|
32
32
|
},
|
|
33
33
|
});
|
package/dist/ui/search-dialog.js
CHANGED
|
@@ -16,6 +16,7 @@ import { Skeleton } from "/assets/ui-states.js";
|
|
|
16
16
|
import { goToSetting, searchSettings, settingLabel } from "./settings-registry.js";
|
|
17
17
|
import "./settings-strings.js";
|
|
18
18
|
import "./settings-shared-strings.js"; // the "where" of a result is settings.sec_<section>; sec_agent-defaults is one of these words
|
|
19
|
+
import "./settings-revoke-strings.js"; // a result shows its label: settings.vaRevokeOthers is one of these words (PR #3553 review)
|
|
19
20
|
import "./settings-access-strings.js"; // a result shows its label: settings.webLoginQr is one of these words (#3061)
|
|
20
21
|
|
|
21
22
|
register("search", {
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// S-120 (M-2753 story 8): Settings → Access & security → Overview. Three cards up front — who is signed in (admins and
|
|
2
|
+
// guests, each with Sign out), the ways in from outside (the public link, a fixed address, connections from outside,
|
|
3
|
+
// shared links; Close now where the page may), and two-step confirmation (THIS admin's own authenticator, #3503: shown and
|
|
4
|
+
// linked, never changed here) — then the other connections, each on its own page with its own disconnect or remove.
|
|
5
|
+
// Every action here is an existing route asked again by the server: a sign-out is POST /ui/devices/signout (#3553).
|
|
6
|
+
// The words are English and 繁體中文, as everything in src/ui (tests/i18n-ui-literals-2390.test.ts).
|
|
7
|
+
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
8
|
+
import { t, register } from "/assets/app-i18n.js";
|
|
9
|
+
import { Dialog } from "/assets/ui-dialog.js";
|
|
10
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
11
|
+
import { navigate } from "/assets/app-nav.js";
|
|
12
|
+
import { appStore, useStore } from "/assets/app-store.js";
|
|
13
|
+
import { sectionPath } from "/assets/app-route.js";
|
|
14
|
+
import { api } from "./settings-confirm.js";
|
|
15
|
+
import { agoWords } from "./settings-devices.js";
|
|
16
|
+
import { roleName } from "/assets/device-roles.js";
|
|
17
|
+
|
|
18
|
+
register("accessov", {
|
|
19
|
+
en: {
|
|
20
|
+
devicesTitle: "Signed-in devices", devicesCount: "{0} signed in", more: "{0} more in Devices & sign-in", manageDevices: "Devices & sign-in", manageGuests: "Guests",
|
|
21
|
+
legend: "✓ the verified owner: may add devices and sign others out. Not verified: everyday use only.",
|
|
22
|
+
blockedOwner: "Verify as the owner first to sign out other devices.", blockedOther: "Another admin's device: only that admin can sign it out.",
|
|
23
|
+
signOutTitle: "Sign out {0}?", signOutLead: "{0} is signed out at once and has to sign in again.", signedOut: "{0} was signed out.",
|
|
24
|
+
entryTitle: "Ways in from outside", publicLink: "Public link", publicLinkHint: "An address that opens this dashboard from anywhere; signing in is still required.",
|
|
25
|
+
linkOpen: "Open", linkQuick: "temporary address", linkNamed: "fixed address {0}", linkLeft: "{0} left", hm: "{0} h {1} min", h: "{0} h", m: "{0} min", linkNoExpiry: "no expiry", linkClosed: "Closed", linkNotAllowed: "Not allowed",
|
|
26
|
+
outside: "Connections from outside", outsideHint: "Signing in from outside with the 6-digit code (authenticator app).", allowed: "Allowed", off: "Off",
|
|
27
|
+
shares: "Shared links", sharesHint: "Read-only office views and pages; whoever has the link can view them without signing in.",
|
|
28
|
+
sharesCount: "{0} open", none: "None", closeNow: "Close the public link now", manageSharing: "Public & sharing",
|
|
29
|
+
closeTitle: "Close the public link now?", closeLead: "The link stops working at once. Devices signed in through it are signed out.", closeGo: "Close the link", closed: "The public link is closed.", closeFailed: "The link could not be closed. Try again.",
|
|
30
|
+
outsideOwned: "This is the outside connection. Turn off “Connections from outside” in Owner verification to close it.",
|
|
31
|
+
twoStepTitle: "Owner verification", twoStepMine: "Your own authenticator app. Every admin sets up their own.",
|
|
32
|
+
app: "Authenticator app", appSet: "Set up on {0}", appNone: "Not set up", askCode: "Ask for my 6-digit code to confirm changes",
|
|
33
|
+
on: "On", goOwner: "Owner verification settings", twoStepNone: "Without it, changes from other devices are confirmed with Apply now.",
|
|
34
|
+
otherTitle: "Other connections", otherLead: "Disconnect or remove each one on its own page.",
|
|
35
|
+
hub: "Hub", hubHint: "Your team's Hub and the agents shared there", windows: "Windows computers", windowsHint: "Windows computers connected to run agents",
|
|
36
|
+
accounts: "AI accounts", accountsHint: "The Claude, Codex and other accounts your agents use", hubOn: "Connected", paired: "{0} connected",
|
|
37
|
+
},
|
|
38
|
+
"zh-TW": {
|
|
39
|
+
devicesTitle: "已登入的裝置", devicesCount: "{0} 個登入", more: "另外 {0} 個,到「裝置與登入」查看", manageDevices: "裝置與登入", manageGuests: "訪客",
|
|
40
|
+
legend: "✓ 已驗證的擁有者:可新增裝置、登出其他裝置。未驗證:只能使用一般功能。",
|
|
41
|
+
blockedOwner: "要先驗證為擁有者,才能登出其他裝置。", blockedOther: "別的管理員的裝置,只有那位管理員本人能登出。",
|
|
42
|
+
signOutTitle: "登出 {0}?", signOutLead: "{0} 會立即登出,之後需要重新登入。", signedOut: "已登出 {0}。",
|
|
43
|
+
entryTitle: "從外面連線的方式", publicLink: "公開連結", publicLinkHint: "從任何地方開啟這個儀表板的網址;開啟後仍要登入。",
|
|
44
|
+
linkOpen: "開啟中", linkQuick: "臨時網址", linkNamed: "固定網址 {0}", linkLeft: "剩 {0}", hm: "{0} 小時 {1} 分", h: "{0} 小時", m: "{0} 分", linkNoExpiry: "不過期", linkClosed: "已關閉", linkNotAllowed: "不允許",
|
|
45
|
+
outside: "從外面連線", outsideHint: "從外面登入時,用 6 位數驗證碼(驗證器 App)。", allowed: "允許", off: "關閉",
|
|
46
|
+
shares: "分享連結", sharesHint: "唯讀的辦公室畫面或網頁;拿到連結的人不用登入就能看。",
|
|
47
|
+
sharesCount: "{0} 個開放中", none: "沒有", closeNow: "立即關閉公開連結", manageSharing: "公開與分享",
|
|
48
|
+
closeTitle: "立即關閉公開連結?", closeLead: "連結會馬上失效,透過它登入的裝置也會一併登出。", closeGo: "關閉連結", closed: "公開連結已關閉。", closeFailed: "沒能關閉連結,請再試一次。",
|
|
49
|
+
outsideOwned: "這是「從外面連線」用的連結。要關閉,請到擁有者驗證關掉「從外面連線」。",
|
|
50
|
+
twoStepTitle: "擁有者驗證", twoStepMine: "這是你自己的驗證器 App;每位管理員各自設定。",
|
|
51
|
+
app: "驗證器 App", appSet: "已於 {0} 設定", appNone: "尚未設定", askCode: "確認變更時要求我的 6 位數驗證碼",
|
|
52
|
+
on: "開啟", goOwner: "擁有者驗證設定", twoStepNone: "未設定時,其他裝置上的變更以「立即套用」確認。",
|
|
53
|
+
otherTitle: "其他連線", otherLead: "到各自的頁面中斷或移除。",
|
|
54
|
+
hub: "Hub", hubHint: "你的團隊 Hub,以及在那裡分享的 Agent", windows: "Windows 電腦", windowsHint: "連上這裡、用來執行 Agent 的 Windows 電腦",
|
|
55
|
+
accounts: "AI 帳號", accountsHint: "Agent 使用的 Claude、Codex 等帳號", hubOn: "已連線", paired: "已連上 {0} 台",
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const to = (k, ...a) => t(`accessov.${k}`, ...a);
|
|
59
|
+
const SHOWN = 4;
|
|
60
|
+
const leftWords = (ms) => { const m = Math.max(1, Math.round(ms / 60_000)); return m >= 60 ? (m % 60 ? to("hm", Math.floor(m / 60), m % 60) : to("h", Math.floor(m / 60))) : to("m", m); };
|
|
61
|
+
const day = (ms) => { const d = new Date(ms); return `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}/${String(d.getDate()).padStart(2, "0")}`; };
|
|
62
|
+
|
|
63
|
+
function Row({ label, value, tone, hint }) {
|
|
64
|
+
return html`<div class="s-ov-row"><dt>${label}</dt><dd class=${tone ? `s-ov-${tone}` : ""}>${value}</dd>${hint ? html`<small class="s-ov-hint">${hint}</small>` : null}</div>`;
|
|
65
|
+
}
|
|
66
|
+
function More({ label, onClick }) {
|
|
67
|
+
return html`<button type="button" class="s-ov-link" onClick=${onClick}><span>${label}</span><${Icon} name="chevron" size=${14} /></button>`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function AccessOverview({ web = {}, hub, openTab, overPublicLink, active = true }) {
|
|
71
|
+
// Devices: GET /ui/devices only (#3553) — every tier, its role, and whether this session may sign it out.
|
|
72
|
+
const [devices, setDevices] = useState(null);
|
|
73
|
+
const [outside, setOutside] = useState(null);
|
|
74
|
+
const [shares, setShares] = useState(null), [machines, setMachines] = useState(null);
|
|
75
|
+
const [ask, setAsk] = useState(null), [askClose, setAskClose] = useState(false), [linkNote, setLinkNote] = useState("");
|
|
76
|
+
const { publicLink } = useStore(appStore);
|
|
77
|
+
const [busy, setBusy] = useState(false);
|
|
78
|
+
const [note, setNote] = useState("");
|
|
79
|
+
const load = async () => {
|
|
80
|
+
const [d, o] = await Promise.all([api("/ui/devices"), api("/ui/outside")]);
|
|
81
|
+
if (d.ok && d.body) setDevices(d.body.devices || []);
|
|
82
|
+
if (o.ok && o.body) setOutside(o.body);
|
|
83
|
+
// Existing reads only: the share lists (office + page) and the paired computers; one that is refused says nothing.
|
|
84
|
+
const [os, ps, rt] = await Promise.all([api("/ui/office-share"), api("/ui/page-share"), api("/ui/runtimes")]);
|
|
85
|
+
setShares([os, ps].reduce((n, r) => n + (r.ok && r.body && Array.isArray(r.body.shares) ? r.body.shares.length : 0), 0));
|
|
86
|
+
if (rt.ok && rt.body && rt.body.enabled) setMachines((rt.body.machines || []).length);
|
|
87
|
+
};
|
|
88
|
+
// Read again whenever the tab is shown: the tab panels stay mounted, so a device signed out on 裝置與登入 (or a link
|
|
89
|
+
// closed elsewhere) would otherwise still be listed here.
|
|
90
|
+
useEffect(() => { if (active) load(); }, [active]);
|
|
91
|
+
const rows = [...(devices || [])].sort((a, b) => (b.current ? 1 : 0) - (a.current ? 1 : 0));
|
|
92
|
+
const blockedWhy = (d) => to(d.signOutBlocked === "other_admin" ? "blockedOther" : "blockedOwner");
|
|
93
|
+
const signOut = async () => {
|
|
94
|
+
const d = ask; setBusy(true);
|
|
95
|
+
const r = await api("/ui/devices/signout", { method: "POST", body: JSON.stringify({ handle: d.handle }) });
|
|
96
|
+
setBusy(false); setAsk(null); setNote(r.ok ? to("signedOut", d.label) : (r.body && r.body.error) || `HTTP ${r.status}`);
|
|
97
|
+
load();
|
|
98
|
+
};
|
|
99
|
+
// The link's state: the shell's status frame (every fleet; a tab from before S-120 has none — then /ui/outside's).
|
|
100
|
+
const pub = web.public_link || {};
|
|
101
|
+
const framed = publicLink && publicLink.state !== "closed" ? { ...publicLink, quick: !pub.hostname } : null;
|
|
102
|
+
const link = framed || (outside && outside.link) || null;
|
|
103
|
+
// A web-only fleet's outside link is the owner's switch (#3008): closed there, not here (the route answers 409).
|
|
104
|
+
const outsideOwned = !!(link && outside && outside.webOnly && outside.outside);
|
|
105
|
+
const closeLink = async () => {
|
|
106
|
+
setBusy(true);
|
|
107
|
+
const r = await api("/ui/public-link/close", { method: "POST", body: "{}" });
|
|
108
|
+
setBusy(false); setAskClose(false);
|
|
109
|
+
setLinkNote(r.ok ? to("closed") : r.body && r.body.error === "outside_link" ? to("outsideOwned") : to("closeFailed"));
|
|
110
|
+
load();
|
|
111
|
+
};
|
|
112
|
+
const linkValue = link ? html`<span class="tag tag-ok">${to("linkOpen")}</span> ${link.quick ? to("linkQuick") : to("linkNamed", pub.hostname || "")} · ${link.noExpiry ? to("linkNoExpiry") : link.expiresAt ? to("linkLeft", leftWords(link.expiresAt - Date.now())) : ""}`
|
|
113
|
+
: pub.allow_public === false ? to("linkNotAllowed") : pub.hostname ? `${to("linkClosed")} · ${to("linkNamed", pub.hostname)}` : to("linkClosed");
|
|
114
|
+
return html`<div class="s-ov" id="accessOverview">
|
|
115
|
+
<div class="s-ov-grid">
|
|
116
|
+
<section class="card s-ov-card s-ov-devices" id="ovDevices"><h3 class="s-ov-title"><${Icon} name="user" size=${18} />${to("devicesTitle")}</h3>
|
|
117
|
+
<p class="note">${to("devicesCount", rows.length)}</p>
|
|
118
|
+
<ul class="s-ov-devlist s-ov-list">${rows.slice(0, SHOWN).map((d) => html`<li class=${`s-ov-dev${d.current ? " current" : ""}`} key=${d.handle} data-handle=${d.handle}>
|
|
119
|
+
<div class="s-ov-dev-main"><span class="s-ov-dev-name">${d.label}${d.current ? html` <span class="tag">${t("app.thisDevice")}</span>` : null}</span>
|
|
120
|
+
<span class="s-ov-dev-meta"><span data-role=${d.tier === "admin" ? (d.verified ? "owner" : "admin") : d.tier}>${roleName(d.tier, d.verified)}</span> · ${t("app.lastActive", agoWords(d.lastSeen))}</span>
|
|
121
|
+
${!d.current && !d.canSignOut ? html`<span class="s-ov-why">${blockedWhy(d)}</span>` : null}</div>
|
|
122
|
+
${d.current ? null : html`<button type="button" class=${`btn btn-sm${d.canSignOut ? " btn-danger" : ""}`} data-ov-signout=${d.handle} disabled=${!d.canSignOut || busy} onClick=${() => d.canSignOut && setAsk(d)}>${t("app.signOut")}</button>`}
|
|
123
|
+
</li>`)}</ul>
|
|
124
|
+
${rows.length > SHOWN ? html`<${More} label=${to("more", rows.length - SHOWN)} onClick=${() => openTab("login", "devicesCard")} />` : null}
|
|
125
|
+
<p class="note s-ov-legend">${to("legend")}</p>
|
|
126
|
+
${note ? html`<p class="note" role="status">${note}</p>` : null}
|
|
127
|
+
<footer><${More} label=${to("manageDevices")} onClick=${() => openTab("login", "devicesCard")} /><${More} label=${to("manageGuests")} onClick=${() => openTab("guests")} /></footer>
|
|
128
|
+
</section>
|
|
129
|
+
<section class="card s-ov-card" id="ovEntry"><h3 class="s-ov-title"><${Icon} name="globe" size=${18} />${to("entryTitle")}</h3>
|
|
130
|
+
<dl class="s-ov-facts">
|
|
131
|
+
<${Row} label=${to("publicLink")} hint=${to("publicLinkHint")} value=${linkValue} />
|
|
132
|
+
${outside && outside.webOnly ? html`<${Row} label=${to("outside")} hint=${to("outsideHint")} value=${to(outside.outside ? "allowed" : "off")} />` : null}
|
|
133
|
+
${shares !== null ? html`<${Row} label=${to("shares")} hint=${to("sharesHint")} value=${shares ? to("sharesCount", shares) : to("none")} tone=${shares ? "" : "muted"} />` : null}
|
|
134
|
+
</dl>
|
|
135
|
+
${link && !overPublicLink ? outsideOwned
|
|
136
|
+
? html`<p class="note" id="ovOutsideOwned">${to("outsideOwned")} <${More} label=${to("goOwner")} onClick=${() => openTab("login", "outsideCard")} /></p>`
|
|
137
|
+
: html`<div class="s-ov-actions"><button type="button" class="btn btn-sm btn-danger" id="ovCloseLink" disabled=${busy} onClick=${() => setAskClose(true)}>${to("closeNow")}</button></div>` : null}
|
|
138
|
+
${linkNote ? html`<p class="note" role="status" id="ovLinkNote">${linkNote}</p>` : null}
|
|
139
|
+
<footer><${More} label=${to("manageSharing")} onClick=${() => openTab("sharing")} /></footer>
|
|
140
|
+
</section>
|
|
141
|
+
<section class="card s-ov-card" id="ovTwoStep"><h3 class="s-ov-title"><${Icon} name="key" size=${18} />${to("twoStepTitle")}</h3>
|
|
142
|
+
<p class="note">${to("twoStepMine")}</p>
|
|
143
|
+
<dl class="s-ov-facts">
|
|
144
|
+
<${Row} label=${to("app")} value=${outside && outside.enrolled ? html`<span class="tag tag-ok">${to("appSet", day(outside.enrolledAt))}</span>` : html`<span class="tag">${to("appNone")}</span>`} />
|
|
145
|
+
<${Row} label=${to("askCode")} value=${to(outside && outside.strict ? "on" : "off")} tone=${outside && outside.strict ? "" : "muted"} />
|
|
146
|
+
</dl>
|
|
147
|
+
${outside && !outside.enrolled ? html`<p class="note">${to("twoStepNone")}</p>` : null}
|
|
148
|
+
<footer><${More} label=${to("goOwner")} onClick=${() => openTab("login", "outsideCard")} /></footer>
|
|
149
|
+
</section>
|
|
150
|
+
</div>
|
|
151
|
+
<section class="s-ov-other" id="ovOther"><h3>${to("otherTitle")}</h3><p class="note">${to("otherLead")}</p>
|
|
152
|
+
<div class="s-ov-tiles">
|
|
153
|
+
${[["plug", "hub", "hubHint", "hub", hub ? to("hubOn") : null], ["code", "windows", "windowsHint", "runtimes", machines ? to("paired", machines) : null], ["bot", "accounts", "accountsHint", "agents", null]].map(([icon, k, hint, sec, state]) => html`
|
|
154
|
+
<button type="button" class="s-ov-tile" data-ov-go=${sec} onClick=${() => navigate(sectionPath(sec))}><${Icon} name=${icon} size=${18} />
|
|
155
|
+
<span><strong>${to(k)}</strong><small>${to(hint)}</small>${state ? html`<small class="s-ov-state">${state}</small>` : null}</span><${Icon} name="chevron" size=${16} /></button>`)}
|
|
156
|
+
</div>
|
|
157
|
+
</section>
|
|
158
|
+
${askClose ? html`<${Dialog} title=${to("closeTitle")} onClose=${() => { if (!busy) setAskClose(false); }} busy=${busy} actions=${html`
|
|
159
|
+
<button type="button" class="btn" disabled=${busy} onClick=${() => setAskClose(false)}>${t("app.cancel")}</button>
|
|
160
|
+
<button type="button" class="btn btn-danger" id="ovCloseGo" disabled=${busy} onClick=${closeLink}>${to("closeGo")}</button>`}>
|
|
161
|
+
<p class="note">${to("closeLead")}</p></${Dialog}>` : null}
|
|
162
|
+
${ask ? html`<${Dialog} title=${to("signOutTitle", ask.label)} onClose=${() => { if (!busy) setAsk(null); }} busy=${busy} actions=${html`
|
|
163
|
+
<button type="button" class="btn" disabled=${busy} onClick=${() => setAsk(null)}>${t("app.cancel")}</button>
|
|
164
|
+
<button type="button" class="btn btn-danger" id="ovSignOutGo" disabled=${busy} onClick=${signOut}>${t("app.signOut")}</button>`}>
|
|
165
|
+
<p class="note">${to("signOutLead", ask.label)}</p></${Dialog}>` : null}
|
|
166
|
+
</div>`;
|
|
167
|
+
}
|
|
@@ -23,7 +23,7 @@ register("settings", {
|
|
|
23
23
|
},
|
|
24
24
|
"zh-TW": {
|
|
25
25
|
webLoginQr: "新裝置用其他裝置登入時顯示 QR Code",
|
|
26
|
-
webLoginQrHint: "顯示在新裝置登入頁、8
|
|
26
|
+
webLoginQrHint: "顯示在新裝置登入頁、8 字元裝置登入碼旁邊。裡面只有該頁面的網址和裝置登入碼,沒有任何憑證;核准仍需要已登入並驗證擁有者的裝置。預設關閉;有連接聊天平台的 fleet 不受影響。",
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -16,9 +16,14 @@ async function getJson(url) {
|
|
|
16
16
|
function cached(url, force = false) {
|
|
17
17
|
const hit = cache.get(url), now = performance.now();
|
|
18
18
|
if (hit && (hit.pending || !force && now - hit.at < TTL_MS)) return hit.pending ?? Promise.resolve(hit.value);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const entry = { at: now, value: null, pending: null };
|
|
20
|
+
const pending = getJson(force ? `${url}&refresh=1` : url).then((value) => {
|
|
21
|
+
// Explicit rediscovery/reset may have replaced this request while it waited.
|
|
22
|
+
if (cache.get(url) === entry) cache.set(url, { at: performance.now(), value, pending: null });
|
|
23
|
+
return value;
|
|
24
|
+
}).catch(() => { if (cache.get(url) === entry) cache.delete(url); return null; });
|
|
25
|
+
entry.pending = pending;
|
|
26
|
+
cache.set(url, entry);
|
|
22
27
|
return pending;
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
@@ -80,6 +85,17 @@ export function useModelCatalog(backend, instance, runtime) {
|
|
|
80
85
|
return state.loading && !state.models.length ? undefined : state.models;
|
|
81
86
|
}
|
|
82
87
|
|
|
88
|
+
/** Shared snapshot cache for upgraded fields; accessed through a namespace so old held modules still load. */
|
|
89
|
+
export function readModelCatalog(target) { return readModelCatalogSnapshot(target).then(answer => answer.models); }
|
|
90
|
+
/** Keep source provenance with the shared snapshot; the array-only API remains compatible with older pickers. */
|
|
91
|
+
export function readModelCatalogSnapshot(target) {
|
|
92
|
+
const url = `/ui/models?${new URLSearchParams(target)}`;
|
|
93
|
+
return cached(url).then(answer => { if (!answer || !Array.isArray(answer.models)) throw Error("Model catalog unavailable"); return answer; });
|
|
94
|
+
}
|
|
95
|
+
export function rememberModelCatalog(target, answer) {
|
|
96
|
+
cache.set(`/ui/models?${new URLSearchParams(target)}`, { at: performance.now(), value: answer, pending: null });
|
|
97
|
+
}
|
|
98
|
+
|
|
83
99
|
/** A state that keeps a backend from being chosen (shown, disabled, with why); "unknown" never does. */
|
|
84
100
|
export const BLOCKING_STATES = ["not_installed", "not_signed_in", "too_old"];
|
|
85
101
|
|
|
@@ -79,8 +79,8 @@ function publish() {
|
|
|
79
79
|
totpNotSetUp: view.totp === "not_set_up" && view.state === "pending",
|
|
80
80
|
// Over a link (the leader's ruling (b)): no code here — confirm it in the host computer's own browser, or in General.
|
|
81
81
|
onHost: view.totp === "on_host" && view.state === "pending",
|
|
82
|
-
//
|
|
83
|
-
|
|
82
|
+
// AGEND-122: the owner turned on "Only this computer can authorize": only the AgEnD computer's own browser confirms.
|
|
83
|
+
hostOnly: view.totp === "host_only" && view.state === "pending",
|
|
84
84
|
dismiss: TERMINAL.has(view.state) ? () => forget(view.id) : null,
|
|
85
85
|
// AGEND-118: a request that ended without applying can be sent again (the same write, a new confirmation).
|
|
86
86
|
retry: retry && resendable(view) ? () => resend(view.id) : null,
|