@songsid/agend 2.3.5-alpha.2 → 2.3.5-alpha.4
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/agend-home.d.ts +13 -0
- package/dist/agend-home.js +42 -0
- package/dist/agend-home.js.map +1 -1
- package/dist/agent-runtime-api.d.ts +4 -0
- package/dist/agent-runtime-api.js +59 -0
- package/dist/agent-runtime-api.js.map +1 -0
- package/dist/agent-runtime-change.d.ts +74 -0
- package/dist/agent-runtime-change.js +102 -0
- package/dist/agent-runtime-change.js.map +1 -0
- package/dist/auth-api.d.ts +21 -0
- package/dist/auth-api.js +95 -4
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +12 -2
- package/dist/authority/web-authority.js +25 -4
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.js +16 -1
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-footer-hints.d.ts +4 -0
- package/dist/backend/codex-footer-hints.js +27 -0
- package/dist/backend/codex-footer-hints.js.map +1 -0
- package/dist/backend/codex.js +19 -11
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/kiro-identity.d.ts +2 -0
- package/dist/backend/kiro-identity.js +13 -6
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro.js +18 -3
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend-availability.d.ts +6 -0
- package/dist/backend-availability.js +13 -5
- package/dist/backend-availability.js.map +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli.js +6 -9
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +12 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/daemon.d.ts +5 -0
- package/dist/daemon.js +107 -30
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +146 -8
- package/dist/fleet-manager.js +1030 -166
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +6 -1
- package/dist/fleet-windows-runtime.js +77 -1
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/fleet-yaml-patch.d.ts +3 -0
- package/dist/fleet-yaml-patch.js +103 -0
- package/dist/fleet-yaml-patch.js.map +1 -0
- package/dist/general-binding.d.ts +85 -0
- package/dist/general-binding.js +298 -0
- package/dist/general-binding.js.map +1 -0
- package/dist/general-host-owner.d.ts +8 -0
- package/dist/general-host-owner.js +26 -0
- package/dist/general-host-owner.js.map +1 -0
- package/dist/general-instance.d.ts +7 -0
- package/dist/general-instance.js +20 -3
- package/dist/general-instance.js.map +1 -1
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +2 -0
- package/dist/general-role.d.ts +5 -0
- package/dist/general-role.js +26 -0
- package/dist/general-role.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +1 -0
- package/dist/instance-lifecycle.js +26 -4
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.js +6 -0
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-resume-summary.d.ts +37 -0
- package/dist/kiro-resume-summary.js +85 -0
- package/dist/kiro-resume-summary.js.map +1 -0
- package/dist/locale.js +59 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.js +9 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/native-pane-lifecycle.js +4 -1
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +1 -0
- package/dist/native-pane-manager.js +23 -2
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you-hub.js +1 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +8 -1
- package/dist/needs-you.js +5 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/package-preimage.js +27 -2
- package/dist/package-preimage.js.map +1 -1
- package/dist/pane-port.d.ts +11 -0
- package/dist/public-web-gateway.js +9 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +11 -0
- package/dist/public-web-link.js +13 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/quickstart-api.js +9 -5
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +1 -0
- package/dist/quickstart.js +4 -1
- package/dist/quickstart.js.map +1 -1
- package/dist/reply-buttons-controller.js +10 -0
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/runtime-api.js +84 -9
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.d.ts +9 -0
- package/dist/runtime-build-info.js +57 -0
- package/dist/runtime-build-info.js.map +1 -0
- package/dist/runtime-bundle.d.ts +3 -1
- package/dist/runtime-bundle.js +17 -8
- package/dist/runtime-bundle.js.map +1 -1
- package/dist/runtime-cli.d.ts +6 -1
- package/dist/runtime-cli.js +46 -11
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +20 -1
- package/dist/runtime-client-store.js +56 -4
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +12 -0
- package/dist/runtime-client.js +43 -7
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-connection.d.ts +22 -0
- package/dist/runtime-connection.js +93 -0
- package/dist/runtime-connection.js.map +1 -0
- package/dist/runtime-coordinator.d.ts +9 -0
- package/dist/runtime-coordinator.js +81 -34
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-general-protocol.d.ts +22 -0
- package/dist/runtime-general-protocol.js +57 -0
- package/dist/runtime-general-protocol.js.map +1 -0
- package/dist/runtime-general-workspace.d.ts +17 -0
- package/dist/runtime-general-workspace.js +213 -0
- package/dist/runtime-general-workspace.js.map +1 -0
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-boot.d.ts +7 -0
- package/dist/runtime-pane-boot.js +23 -0
- package/dist/runtime-pane-boot.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +1 -0
- package/dist/runtime-pane-host.js +22 -1
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +8 -0
- package/dist/runtime-pane-mcp.js +15 -2
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +6 -1
- package/dist/runtime-pane-port.js +21 -0
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +4 -1
- package/dist/runtime-pane-protocol.js +7 -1
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-protocol.d.ts +13 -0
- package/dist/runtime-protocol.js +18 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/settings-api.d.ts +5 -0
- package/dist/settings-api.js +37 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-confirmation.d.ts +1 -0
- package/dist/settings-confirmation.js +1 -0
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +4 -0
- package/dist/settings-effect.js +36 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +4 -0
- package/dist/settings-http-confirmation.js +20 -1
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +2 -0
- package/dist/settings-request-capability.js +4 -0
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +14 -0
- package/dist/settings-route-lifetime.js +48 -0
- package/dist/settings-route-lifetime.js.map +1 -0
- package/dist/settings-transaction.d.ts +4 -0
- package/dist/settings-transaction.js +9 -0
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +6 -3
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.js +3 -0
- package/dist/setup-i18n.js.map +1 -1
- package/dist/stall-reporter.d.ts +21 -0
- package/dist/stall-reporter.js +82 -0
- package/dist/stall-reporter.js.map +1 -0
- package/dist/tmux-control.d.ts +2 -2
- package/dist/tmux-control.js +4 -2
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-exec-helper.d.ts +6 -3
- package/dist/tmux-exec-helper.js +115 -53
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tool-permissions.js +2 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tunnel/cloudflared-install.d.ts +4 -0
- package/dist/tunnel/cloudflared-install.js +20 -1
- package/dist/tunnel/cloudflared-install.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +8 -1
- package/dist/tunnel/cloudflared.js +34 -6
- package/dist/tunnel/cloudflared.js.map +1 -1
- package/dist/tunnel/lease.d.ts +3 -3
- package/dist/tunnel/lease.js +23 -19
- package/dist/tunnel/lease.js.map +1 -1
- package/dist/tunnel/manager.js +6 -7
- package/dist/tunnel/manager.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/ui/agent-proposals.js +2 -2
- package/dist/ui/agent-runtime-settings.js +67 -0
- package/dist/ui/agent-runtime.js +20 -2
- package/dist/ui/backend-signin.js +36 -21
- package/dist/ui/general-location.js +71 -0
- package/dist/ui/native-instance-settings.js +5 -8
- package/dist/ui/native-pane-recovery.js +1 -1
- package/dist/ui/panel-chat.js +5 -2
- package/dist/ui/panel-fleet.js +4 -2
- package/dist/ui/panel-needs.js +2 -0
- package/dist/ui/panel-runtimes.js +136 -33
- package/dist/ui/panel-settings.js +227 -138
- package/dist/ui/panel-windows-cli.js +77 -41
- package/dist/ui/settings-agent-filters.js +94 -0
- package/dist/ui/settings-appearance.js +122 -23
- package/dist/ui/settings-dialogs.js +13 -7
- package/dist/ui/settings-guests.js +25 -11
- package/dist/ui/settings-layout.js +245 -0
- package/dist/ui/settings-model.js +10 -1
- package/dist/ui/settings-outside.js +176 -0
- package/dist/ui/settings-registry.js +6 -3
- package/dist/ui/settings-shortcuts.js +65 -0
- package/dist/ui/settings-strings.js +95 -0
- package/dist/ui/settings-web-authority.js +14 -11
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +17 -7
- package/dist/ui/shared/app.css +1038 -13
- package/dist/ui/shared/instance-nav.js +16 -5
- package/dist/ui/shared/machine-name.js +13 -0
- package/dist/ui/shared/panel-view.js +266 -17
- package/dist/ui/shared/qrcode.module.js +2237 -0
- package/dist/ui/shared/settings-width.js +31 -0
- package/dist/ui/shared/signin.js +39 -5
- package/dist/ui/shared/tokens.css +1 -0
- package/dist/ui/shared/ui-dialog.js +2 -2
- package/dist/ui/shared/ui-menu.js +3 -3
- package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
- package/dist/ui/shared/vendor/vendor.json +19 -2
- package/dist/ui/shared/view-strings.js +28 -0
- package/dist/ui/windows-cli-catalog.js +41 -12
- package/dist/unattended-install.d.ts +1 -1
- package/dist/unattended-install.js +19 -5
- package/dist/unattended-install.js.map +1 -1
- package/dist/update-check.d.ts +2 -8
- package/dist/update-check.js +2 -5
- package/dist/update-check.js.map +1 -1
- package/dist/view-api.d.ts +15 -0
- package/dist/view-api.js +94 -33
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +13 -0
- package/dist/web-api.js +80 -0
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +4 -3
- package/dist/web-login.js +23 -14
- package/dist/web-login.js.map +1 -1
- package/dist/web-only-fleet.d.ts +20 -0
- package/dist/web-only-fleet.js +21 -0
- package/dist/web-only-fleet.js.map +1 -1
- package/dist/web-remote-access.d.ts +152 -0
- package/dist/web-remote-access.js +368 -0
- package/dist/web-remote-access.js.map +1 -0
- package/dist/web-session.d.ts +12 -0
- package/dist/web-session.js +22 -8
- package/dist/web-session.js.map +1 -1
- package/dist/windows-agents.d.ts +15 -1
- package/dist/windows-agents.js +37 -10
- package/dist/windows-agents.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 +1 -0
- package/dist/windows-cli-worker.js +2 -2
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +1 -0
- package/dist/windows-cli.js +7 -2
- package/dist/windows-cli.js.map +1 -1
- package/launcher/agend-install.cjs +16 -2
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// #2936 (Settings content width, from app-shell.js) — #2978 merge: a module of its own, imported by the shell (which
|
|
2
|
+
// restores the choice at load) and by Settings' Look section. A tab opened before an upgrade has the old shell, without
|
|
3
|
+
// these names; the new Settings panel imports them from here instead, a module that tab loads fresh, so Settings still
|
|
4
|
+
// opens (the width then applies from the first change on, and at the next load).
|
|
5
|
+
import { createStore } from "./app-store.js";
|
|
6
|
+
|
|
7
|
+
/** Settings' reading space is this device's layout choice, never a host-kept or staged preference. */
|
|
8
|
+
export const SETTINGS_CONTENT_WIDTH_KEY = "agend_settings_content_width";
|
|
9
|
+
export const SETTINGS_CONTENT_WIDTHS = Object.freeze([1000, 1200, 1440]);
|
|
10
|
+
export const DEFAULT_SETTINGS_CONTENT_WIDTH = 1200;
|
|
11
|
+
export const settingsContentWidthStore = createStore({ width: DEFAULT_SETTINGS_CONTENT_WIDTH });
|
|
12
|
+
function storedSettingsContentWidth() {
|
|
13
|
+
try {
|
|
14
|
+
const value = globalThis.localStorage.getItem(SETTINGS_CONTENT_WIDTH_KEY);
|
|
15
|
+
return SETTINGS_CONTENT_WIDTHS.find((width) => String(width) === value) ?? DEFAULT_SETTINGS_CONTENT_WIDTH;
|
|
16
|
+
} catch { return DEFAULT_SETTINGS_CONTENT_WIDTH; }
|
|
17
|
+
}
|
|
18
|
+
function showSettingsContentWidth(width) {
|
|
19
|
+
// The property is consumed only by Settings' content maximum; CSS still fits a narrower window or form.
|
|
20
|
+
if (typeof document !== "undefined") document.documentElement.style.setProperty("--settings-width", `${width}px`);
|
|
21
|
+
settingsContentWidthStore.set({ width });
|
|
22
|
+
}
|
|
23
|
+
/** A page load restores this device's choice. Unreadable or invalid storage keeps the normal 1200 px maximum. */
|
|
24
|
+
export function initSettingsContentWidth() { showSettingsContentWidth(storedSettingsContentWidth()); }
|
|
25
|
+
/** Apply immediately even when storage is unavailable; then the choice lasts for this page only. */
|
|
26
|
+
export function setSettingsContentWidth(width) {
|
|
27
|
+
if (!SETTINGS_CONTENT_WIDTHS.includes(width)) return;
|
|
28
|
+
try { globalThis.localStorage.setItem(SETTINGS_CONTENT_WIDTH_KEY, String(width)); } catch { /* this page only */ }
|
|
29
|
+
showSettingsContentWidth(width);
|
|
30
|
+
}
|
|
31
|
+
|
package/dist/ui/shared/signin.js
CHANGED
|
@@ -27,6 +27,12 @@
|
|
|
27
27
|
hint_web: "On the AgEnD computer, run agend web --code to get a sign-in code.",
|
|
28
28
|
refused_web: "The code is invalid or no longer works. Run agend web --code on the AgEnD computer for a new one.",
|
|
29
29
|
resend_refused_web: "A new code could not be sent. Run agend web --code on the AgEnD computer for one.",
|
|
30
|
+
// #3008: through the link "Allow connections from outside" opened — the authenticator app's code (the leader's wording).
|
|
31
|
+
label_outside: "Authenticator code", lead_outside: "Open your authenticator app and enter the 6-digit code for AgEnD.",
|
|
32
|
+
hint_outside: "Lost your phone? On the AgEnD computer, choose \u201cSet up again\u201d.",
|
|
33
|
+
refused_outside: "That code didn't work. Check that your phone's clock is right and try the newest code.",
|
|
34
|
+
paused_outside: "Too many wrong codes. Try again in {duration}.",
|
|
35
|
+
minutes: "{0} minutes", minute: "1 minute", hours: "{0} hours", hour: "1 hour",
|
|
30
36
|
},
|
|
31
37
|
"zh-TW": {
|
|
32
38
|
checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "輸入登入碼。",
|
|
@@ -44,15 +50,35 @@
|
|
|
44
50
|
hint_web: "在 AgEnD 電腦上執行 agend web --code 取得登入碼。",
|
|
45
51
|
refused_web: "登入碼無效或已失效。請在 AgEnD 電腦上執行 agend web --code 取得新碼。",
|
|
46
52
|
resend_refused_web: "無法傳送新的登入碼。請在 AgEnD 電腦上執行 agend web --code 取得。",
|
|
53
|
+
label_outside: "驗證器代碼", lead_outside: "打開驗證器 App,輸入 AgEnD 的 6 位數代碼。",
|
|
54
|
+
hint_outside: "手機遺失?請在 AgEnD 電腦上選「重新設定」。",
|
|
55
|
+
refused_outside: "代碼不對。請確認手機時間正確,並輸入最新的代碼。",
|
|
56
|
+
paused_outside: "錯誤次數太多,請 {duration} 後再試。",
|
|
57
|
+
minutes: "{0} 分鐘", minute: "1 分鐘", hours: "{0} 小時", hour: "1 小時",
|
|
47
58
|
},
|
|
48
59
|
};
|
|
49
60
|
const lang = /^zh/i.test(navigator.language || "") ? "zh-TW" : "en";
|
|
50
61
|
// #2910 D5: the server marks a web-only fleet's page (<body data-web-only="1">): its own words where it has them.
|
|
51
62
|
const webOnly = !!document.body && document.body.getAttribute("data-web-only") === "1";
|
|
52
|
-
|
|
63
|
+
// #3008: …and one served through the link "Allow connections from outside" opened (<body data-outside="1">): signing in
|
|
64
|
+
// is the authenticator app's code, posted to /auth/totp.
|
|
65
|
+
const outside = webOnly && document.body.getAttribute("data-outside") === "1";
|
|
66
|
+
const t = (k) => (outside && (T[lang][`${k}_outside`] || T.en[`${k}_outside`])) || (webOnly && (T[lang][`${k}_web`] || T.en[`${k}_web`])) || T[lang][k] || T.en[k] || k;
|
|
67
|
+
/** A wait as words: "15 minutes" / 「15 分鐘」, "2 hours" / 「2 小時」 (rounded up). */
|
|
68
|
+
const duration = (ms) => {
|
|
69
|
+
const minutes = Math.max(1, Math.ceil(ms / 60000));
|
|
70
|
+
if (minutes < 60) return minutes === 1 ? t("minute") : t("minutes").replace("{0}", String(minutes));
|
|
71
|
+
const hours = Math.ceil(minutes / 60);
|
|
72
|
+
return hours === 1 ? t("hour") : t("hours").replace("{0}", String(hours));
|
|
73
|
+
};
|
|
53
74
|
// …and no "No chat bot?" help: the hint above already is it.
|
|
54
75
|
if (webOnly) document.querySelectorAll("details.help").forEach((d) => { if (d.querySelector && d.querySelector('[data-i18n="nobot"]')) d.hidden = true; });
|
|
55
76
|
document.documentElement.lang = lang === "zh-TW" ? "zh-Hant" : "en";
|
|
77
|
+
if (outside) {
|
|
78
|
+
const input = $("code");
|
|
79
|
+
input.setAttribute("inputmode", "numeric"); input.setAttribute("maxlength", "7"); input.setAttribute("placeholder", "123456");
|
|
80
|
+
input.setAttribute("pattern", "[0-9 ]*");
|
|
81
|
+
}
|
|
56
82
|
|
|
57
83
|
// An old dashboard link carries `?token=`. It is not a credential any more (the server ignored it and
|
|
58
84
|
// answered with this page), but it is still the fleet's token: take it out of the address bar and
|
|
@@ -125,8 +151,10 @@
|
|
|
125
151
|
offerResend();
|
|
126
152
|
}
|
|
127
153
|
|
|
128
|
-
// Only a returning device gets the button; the answer is a boolean and asking has no side effect.
|
|
154
|
+
// Only a returning device gets the button; the answer is a boolean and asking has no side effect. Never from outside
|
|
155
|
+
// (#3008): the code there is the app's, nothing is sent.
|
|
129
156
|
async function offerResend() {
|
|
157
|
+
if (outside) return;
|
|
130
158
|
try {
|
|
131
159
|
const r = await fetch("/auth/device", { credentials: "same-origin", cache: "no-store" });
|
|
132
160
|
if (r.ok && (await r.json()).returning === true) $("resend").hidden = false;
|
|
@@ -173,18 +201,24 @@
|
|
|
173
201
|
button.disabled = true;
|
|
174
202
|
button.textContent = t("working");
|
|
175
203
|
try {
|
|
176
|
-
const r = await fetch("/auth/login", {
|
|
204
|
+
const r = await fetch(outside ? "/auth/totp" : "/auth/login", {
|
|
177
205
|
method: "POST",
|
|
178
206
|
credentials: "same-origin",
|
|
179
207
|
headers: { "Content-Type": "application/json" },
|
|
180
208
|
body: JSON.stringify({ code: $("code").value }),
|
|
181
209
|
});
|
|
182
210
|
if (r.ok) { clearBounce(); location.replace(nextTarget()); return; }
|
|
211
|
+
if (outside && r.status === 429) {
|
|
212
|
+
let wait = Number(r.headers.get("Retry-After")) * 1000;
|
|
213
|
+
try { const body = await r.json(); if (Number.isFinite(body && body.retryAfterMs)) wait = body.retryAfterMs; } catch { /* the header's */ }
|
|
214
|
+
msg.textContent = t("paused").replace("{duration}", duration(Number.isFinite(wait) && wait > 0 ? wait : 60000));
|
|
215
|
+
throw "shown";
|
|
216
|
+
}
|
|
183
217
|
// #1854: a 5xx is the server failing to confirm the sign-in (503: a public link's notice did not go out), not a
|
|
184
218
|
// wrong code — say so. The code is spent either way: the way on is a new one.
|
|
185
219
|
msg.textContent = r.status === 429 ? t("paused") : r.status >= 500 ? t("unconfirmed") : t("refused");
|
|
186
|
-
} catch {
|
|
187
|
-
msg.textContent = t("network");
|
|
220
|
+
} catch (err) {
|
|
221
|
+
if (err !== "shown") msg.textContent = t("network");
|
|
188
222
|
}
|
|
189
223
|
button.disabled = false;
|
|
190
224
|
button.textContent = t("submit");
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
/* ── Layout ── */
|
|
48
48
|
--col: 768px; /* the conversation column */
|
|
49
|
+
--settings-width: 1200px; /* settings workspace, including its horizontal padding */
|
|
49
50
|
--sidebar-w: 260px;
|
|
50
51
|
--header-h: 52px;
|
|
51
52
|
--tap: 44px; /* the smallest touch target on a phone */
|
|
@@ -10,7 +10,7 @@ import { t } from "./app-i18n.js";
|
|
|
10
10
|
* <${Dialog} title="Create task" onClose=${…} actions=${html`…`}>…body…</${Dialog}>
|
|
11
11
|
* Rendered = open; the parent unmounts it to close. `busy` keeps Esc and the backdrop from closing it mid-request.
|
|
12
12
|
*/
|
|
13
|
-
export function Dialog({ title, onClose, actions, children, busy = false, wide = false, drawer = false, label, tools = null }) {
|
|
13
|
+
export function Dialog({ title, onClose, actions, children, busy = false, wide = false, drawer = false, label, tools = null, cls = "" }) {
|
|
14
14
|
const ref = useRef(null);
|
|
15
15
|
const opener = useRef(null);
|
|
16
16
|
const busyRef = useRef(busy);
|
|
@@ -41,7 +41,7 @@ export function Dialog({ title, onClose, actions, children, busy = false, wide =
|
|
|
41
41
|
d.addEventListener("click", onClick);
|
|
42
42
|
return () => { d.removeEventListener("cancel", onCancel); d.removeEventListener("click", onClick); };
|
|
43
43
|
}, [onClose]);
|
|
44
|
-
return html`<dialog data-trust="dialog" ref=${ref} class=${`dlg${wide ? " dlg-wide" : ""}${drawer ? " dlg-drawer" : ""}`} aria-label=${label || title}>
|
|
44
|
+
return html`<dialog data-trust="dialog" ref=${ref} class=${`dlg${wide ? " dlg-wide" : ""}${drawer ? " dlg-drawer" : ""}${cls ? ` ${cls}` : ""}`} aria-label=${label || title}>
|
|
45
45
|
<div class="dlg-box" tabindex="-1">
|
|
46
46
|
<div class="dlg-head"><h2 class="dlg-title">${title}</h2>${tools ? html`<span class="dlg-tools">${tools}</span>` : null}
|
|
47
47
|
<button type="button" class="icon-btn dlg-x" aria-label=${t("app.close")} title=${t("app.close")} onClick=${() => { if (!busyRef.current) onClose(); }}><${Icon} name="close" /></button></div>
|
|
@@ -34,7 +34,7 @@ export function Menu({ items, label, icon = "more", cls = "", active = false, tr
|
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
if (!open || disabled) { if (open && disabled) setOpen(false); return undefined; }
|
|
36
36
|
const first = list.current && list.current.querySelector("[role=menuitem]:not([disabled]), [role=menuitemradio]:not([disabled]), [role=menuitemcheckbox]:not([disabled])");
|
|
37
|
-
if (first) first.focus();
|
|
37
|
+
if (first) first.focus({ preventScroll: true });
|
|
38
38
|
const outside = (e) => { if (list.current && !list.current.contains(e.target) && btn.current && !btn.current.contains(e.target)) setOpen(false); };
|
|
39
39
|
document.addEventListener("pointerdown", outside, true);
|
|
40
40
|
return () => document.removeEventListener("pointerdown", outside, true);
|
|
@@ -42,7 +42,7 @@ export function Menu({ items, label, icon = "more", cls = "", active = false, tr
|
|
|
42
42
|
function onKey(e) {
|
|
43
43
|
const all = [...list.current.querySelectorAll("[role=menuitem]:not([disabled]), [role=menuitemradio]:not([disabled]), [role=menuitemcheckbox]:not([disabled])")];
|
|
44
44
|
const i = all.indexOf(document.activeElement);
|
|
45
|
-
if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); setOpen(false); btn.current && btn.current.focus(); }
|
|
45
|
+
if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); setOpen(false); btn.current && btn.current.focus({ preventScroll: true }); }
|
|
46
46
|
else if (e.key === "Enter" || e.key === " ") { e.preventDefault(); document.activeElement?.click(); }
|
|
47
47
|
else if (e.key === "ArrowDown") { e.preventDefault(); (all[(i + 1) % all.length] || all[0])?.focus(); }
|
|
48
48
|
else if (e.key === "ArrowUp") { e.preventDefault(); (all[(i - 1 + all.length) % all.length] || all[0])?.focus(); }
|
|
@@ -50,7 +50,7 @@ export function Menu({ items, label, icon = "more", cls = "", active = false, tr
|
|
|
50
50
|
else if (e.key === "End") { e.preventDefault(); all[all.length - 1]?.focus(); }
|
|
51
51
|
else if (e.key === "Tab") setOpen(false);
|
|
52
52
|
}
|
|
53
|
-
function choose(item) { if (disabled || item.disabled) return; setOpen(false); btn.current && btn.current.focus(); item.onSelect(); }
|
|
53
|
+
function choose(item) { if (disabled || item.disabled) return; setOpen(false); btn.current && btn.current.focus({ preventScroll: true }); item.onSelect(); }
|
|
54
54
|
return html`<div class=${`menu ${cls}`}>
|
|
55
55
|
<button ref=${btn} type="button" class=${`${triggerClass}${active ? " active" : ""}`} aria-haspopup="menu" aria-expanded=${open ? "true" : "false"} disabled=${disabled}
|
|
56
56
|
aria-label=${label || t("app.more")} title=${label || t("app.more")} onClick=${() => { if (!disabled) setOpen(!open); }}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2009 Kazuhiko Arase
|
|
4
|
+
|
|
5
|
+
URL: http://www.d-project.com/
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
The word "QR Code" is a registered trademark of DENSO WAVE INCORPORATED.
|
|
26
|
+
(The package ships this licence in its source header — "Licensed under the MIT license" — and no separate file;
|
|
27
|
+
this is the MIT licence text with that header's copyright line.)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"note": "Vendored for #1408 (Preact + htm, no build). Every file below is byte-checked by tests/web-vendor-1408.test.ts.",
|
|
2
|
+
"note": "Vendored for #1408 (Preact + htm, no build) and #3008 (the QR code of an authenticator's setup). Every file below is byte-checked by tests/web-vendor-1408.test.ts.",
|
|
3
3
|
"packages": {
|
|
4
4
|
"preact": {
|
|
5
5
|
"version": "10.29.8",
|
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
"upstream": "package/hooks/dist/hooks.module.js",
|
|
18
18
|
"sha256": "f3555e7a8dba84175c94f17148ba6670e4b3716888fe06b3330a485637296a38",
|
|
19
19
|
"upstreamSha256": "a6ee626f2d01570592dd569a792e3f050154aa02890eead8c223fa3ed5aa3d5a",
|
|
20
|
-
"rewrite": {
|
|
20
|
+
"rewrite": {
|
|
21
|
+
"from": "from\"preact\"",
|
|
22
|
+
"to": "from\"./preact.module.js\""
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
},
|
|
@@ -34,6 +37,20 @@
|
|
|
34
37
|
"upstreamSha256": "ab33dd3f38059b9be4d5f5350128eefb2356639c4e0bbe9d9e8b3ba75847e9e4"
|
|
35
38
|
}
|
|
36
39
|
}
|
|
40
|
+
},
|
|
41
|
+
"qrcode-generator": {
|
|
42
|
+
"version": "2.0.4",
|
|
43
|
+
"tarball": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-2.0.4.tgz",
|
|
44
|
+
"integrity": "sha512-mZSiP6RnbHl4xL2Ap5HfkjLnmxfKcPWpWe/c+5XxCuetEenqmNFf1FH/ftXPCtFG5/TDobjsjz6sSNL0Sr8Z9g==",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"licenseFile": "vendor/qrcode-generator.LICENSE",
|
|
47
|
+
"files": {
|
|
48
|
+
"qrcode.module.js": {
|
|
49
|
+
"upstream": "package/dist/qrcode.mjs",
|
|
50
|
+
"sha256": "ea91d7118a5395289170da848b7c6758b996163bfbccf312591ab65a4911b7c0",
|
|
51
|
+
"upstreamSha256": "ea91d7118a5395289170da848b7c6758b996163bfbccf312591ab65a4911b7c0"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
37
54
|
}
|
|
38
55
|
}
|
|
39
56
|
}
|
|
@@ -218,6 +218,20 @@ register("view", {
|
|
|
218
218
|
"guestNeedsTrustedHint": "Your host gave you chat access to this agent. Ask them to make you Trusted in Settings → Guests.",
|
|
219
219
|
"noInstances": "No instances yet",
|
|
220
220
|
"paneUnavailable": "This instance's terminal is not available (is it stopped?)",
|
|
221
|
+
// M-2262: the terminal's scrollback.
|
|
222
|
+
"earlier": "Earlier output",
|
|
223
|
+
"earlierHint": "Scroll up to read what has scrolled off. Live output keeps coming in below.",
|
|
224
|
+
"loadingEarlier": "Loading earlier output…",
|
|
225
|
+
"earlierFailed": "Could not load earlier output.",
|
|
226
|
+
"noEarlier": "This CLI redraws its whole screen, so the terminal keeps no earlier output to scroll back to.",
|
|
227
|
+
"nothingEarlier": "Nothing has scrolled off the screen yet.",
|
|
228
|
+
// The words' mark (panel-view.js VIEW_REV, the same in both languages): a tab with older words reads these again.
|
|
229
|
+
"rev": "2",
|
|
230
|
+
"earlierInLog": "Earlier output is in the Log tab",
|
|
231
|
+
"logTabOff": "Earlier output: the Log tab is off. Turn it on in Settings",
|
|
232
|
+
"readingEarlier": "Reading earlier output. Live output continues; scroll to the bottom to follow it again.",
|
|
233
|
+
"jumpLatest": "Jump to latest",
|
|
234
|
+
"newBelow": "New output below",
|
|
221
235
|
"rosterFailedShort": "The instance list could not be loaded.",
|
|
222
236
|
"collapseGroup": "Fold {group}",
|
|
223
237
|
"expandGroup": "Open {group}",
|
|
@@ -226,6 +240,7 @@ register("view", {
|
|
|
226
240
|
"avatar": "Avatar",
|
|
227
241
|
"instancesLabel": "Instances",
|
|
228
242
|
"favorites": "Favorites",
|
|
243
|
+
"generalGroup": "General",
|
|
229
244
|
"favAdd": "Add {name} to favorites",
|
|
230
245
|
"favRemove": "Remove {name} from favorites",
|
|
231
246
|
"favEdit": "Edit",
|
|
@@ -467,6 +482,18 @@ register("view", {
|
|
|
467
482
|
"guestNeedsTrustedHint": "主人給你的是這個 agent 的聊天權限。請他在設定 → 訪客把你改成「信任」。",
|
|
468
483
|
"noInstances": "還沒有 instance",
|
|
469
484
|
"paneUnavailable": "無法取得這個 instance 的終端畫面(它是否已停止?)",
|
|
485
|
+
"earlier": "較早的輸出",
|
|
486
|
+
"earlierHint": "往上捲動可以看到已經捲走的內容,新的輸出會繼續出現在下方。",
|
|
487
|
+
"loadingEarlier": "正在載入較早的輸出…",
|
|
488
|
+
"earlierFailed": "無法載入較早的輸出。",
|
|
489
|
+
"noEarlier": "這個 CLI 會重繪整個畫面,終端沒有保留可以往上捲動的較早輸出。",
|
|
490
|
+
"nothingEarlier": "還沒有內容捲出畫面。",
|
|
491
|
+
"rev": "2",
|
|
492
|
+
"earlierInLog": "較早的輸出在「紀錄」分頁",
|
|
493
|
+
"logTabOff": "較早的輸出:「紀錄」分頁目前關閉,請到設定開啟",
|
|
494
|
+
"readingEarlier": "正在看較早的輸出。新的輸出仍會繼續;捲到最下面即可再次跟著最新內容。",
|
|
495
|
+
"jumpLatest": "跳到最新",
|
|
496
|
+
"newBelow": "下方有新的輸出",
|
|
470
497
|
"rosterFailedShort": "無法載入 instance 清單。",
|
|
471
498
|
"collapseGroup": "收合 {group}",
|
|
472
499
|
"expandGroup": "展開 {group}",
|
|
@@ -475,6 +502,7 @@ register("view", {
|
|
|
475
502
|
"avatar": "頭像",
|
|
476
503
|
"instancesLabel": "Instances",
|
|
477
504
|
"favorites": "最愛",
|
|
505
|
+
"generalGroup": "General",
|
|
478
506
|
"favAdd": "把 {name} 加入最愛",
|
|
479
507
|
"favRemove": "把 {name} 從最愛移除",
|
|
480
508
|
"favEdit": "編輯",
|
|
@@ -11,7 +11,7 @@ const initial = () => ({ data:null, loading:false, error:"", checkedAt:0, starte
|
|
|
11
11
|
|
|
12
12
|
/** Successful inventory only, in memory. No polling, localStorage, credential data or model tasks. A plain load reads the
|
|
13
13
|
* server's last detection (which starts nothing, M-2239 P1-2); only `force` (Detect again) runs detection. */
|
|
14
|
-
export function createWindowsCliCatalog({ fetcher = (...args) => fetch(...args), now = () => Date.now(), ttlMs = WINDOWS_CLI_CATALOG_TTL_MS, timeoutMs =
|
|
14
|
+
export function createWindowsCliCatalog({ fetcher = (...args) => fetch(...args), now = () => Date.now(), ttlMs = WINDOWS_CLI_CATALOG_TTL_MS, timeoutMs = 100_000, machineId = "" } = {}) {
|
|
15
15
|
const store = createStore(initial());
|
|
16
16
|
let pending = null, controller = null, generation = 0;
|
|
17
17
|
const load = ({ force = false } = {}) => {
|
|
@@ -26,12 +26,14 @@ export function createWindowsCliCatalog({ fetcher = (...args) => fetch(...args),
|
|
|
26
26
|
pending = Promise.resolve().then(async () => {
|
|
27
27
|
try {
|
|
28
28
|
if (mine !== generation) return null;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
29
|
+
const base = machineId ? `/ui/runtimes/machines/${encodeURIComponent(machineId)}` : "/ui/windows-cli";
|
|
30
|
+
const response = await fetcher(`${base}/${machineId && !force ? "inventory" : "probe"}`,{credentials:"same-origin",...(machineId && !force ? {} : {method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(machineId ? {} : force ? {force:true} : {})}),signal:abort.signal});
|
|
31
|
+
const body = await response.json();
|
|
31
32
|
if (!response.ok) {
|
|
32
33
|
if (mine === generation && [401,403].includes(response.status)) store.set({data:null,checkedAt:0});
|
|
33
|
-
throw new Error(
|
|
34
|
+
throw new Error(body?.error || `HTTP ${response.status}`);
|
|
34
35
|
}
|
|
36
|
+
const value = machineId ? body.inventory || { home:"", clis:[], probedAt:null } : body;
|
|
35
37
|
if (!value || !Array.isArray(value.clis) || typeof value.home !== "string") throw new Error("Invalid Windows CLI inventory response");
|
|
36
38
|
if (mine === generation) store.set({data:value,checkedAt:now(),error:""});
|
|
37
39
|
return value;
|
|
@@ -49,20 +51,47 @@ export function createWindowsCliCatalog({ fetcher = (...args) => fetch(...args),
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
const catalog = createWindowsCliCatalog();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return
|
|
54
|
+
const remoteCatalogs = new Map();
|
|
55
|
+
function catalogFor(machineId) {
|
|
56
|
+
if (!machineId) return catalog;
|
|
57
|
+
if (!remoteCatalogs.has(machineId)) remoteCatalogs.set(machineId,createWindowsCliCatalog({machineId}));
|
|
58
|
+
return remoteCatalogs.get(machineId);
|
|
59
|
+
}
|
|
60
|
+
export const refreshWindowsCliCatalog = (machineId = "") => catalogFor(machineId).load({force:true});
|
|
61
|
+
/** Subscribe to progress without starting a read; cards observe detection started in a dialog. */
|
|
62
|
+
export const useWindowsCliCatalogSnapshot = (machineId = "") => useStore(catalogFor(machineId));
|
|
63
|
+
export function forgetWindowsCliCatalog() { catalog.clear(); for (const remote of remoteCatalogs.values()) remote.clear(); remoteCatalogs.clear(); }
|
|
64
|
+
export function useWindowsCliCatalog(enabled = true, machineId = "") {
|
|
65
|
+
const current = catalogFor(machineId);
|
|
66
|
+
const state = useStore(current);
|
|
67
|
+
useEffect(() => { if (enabled) void current.load(); },[enabled,current]);
|
|
68
|
+
return { ...(enabled ? state : initial()), refresh:() => current.load({force:true}) };
|
|
57
69
|
}
|
|
58
70
|
|
|
71
|
+
register("windetect", {
|
|
72
|
+
en: { remoteWindows:"Paired Windows Runtime" },
|
|
73
|
+
"zh-TW": { remoteWindows:"已配對的 Windows Runtime" },
|
|
74
|
+
});
|
|
59
75
|
register("windetect", {
|
|
60
76
|
"zh-TW": { loading:"正在偵測 Windows CLI…", refreshing:"正在更新 Windows CLI…", hint:"正在確認已安裝的 CLI、版本與登入狀態。完成後會重用結果,不必每次重新等待。", elapsed:"已等待 {0} 秒,仍在檢查中。", failed:"無法完成 Windows CLI 偵測", previous:"更新未完成,目前顯示上次成功偵測的結果。", retry:"重試偵測", refresh:"重新偵測", cached:"已載入最近的偵測結果", never:"尚未偵測 Windows CLI。偵測會逐一啟動已安裝的 CLI 一次,讀取版本與登入狀態;之後只在你按下「重新偵測」時再做。", detect:"偵測 Windows CLI" },
|
|
61
77
|
en: { loading:"Detecting Windows CLIs…", refreshing:"Updating Windows CLIs…", hint:"Checking installed CLIs, versions and sign-ins. Results are reused so reopening does not repeat the wait.", elapsed:"Still checking after {0} seconds.", failed:"Windows CLI detection failed", previous:"Refresh failed. Showing the last successful inventory.", retry:"Retry detection", refresh:"Detect again", cached:"Loaded the recent inventory", never:"Windows CLIs have not been detected yet. Detection starts each installed CLI once to read its version and sign-in; after that, only when you press Detect again.", detect:"Detect Windows CLIs" },
|
|
62
78
|
});
|
|
79
|
+
register("windetect", {
|
|
80
|
+
en: { computer:"Diagnostic computer", hostWindows:"Windows on the AgEnD host", hostHint:"Diagnostics and test tasks use this computer's CLIs and sign-ins.", hostUnknown:"Computer name not reported", hostRefresh:"Detect again to read the Windows computer name." },
|
|
81
|
+
"zh-TW": { computer:"診斷電腦", hostWindows:"AgEnD 主機的 Windows", hostHint:"診斷與測試任務使用這台電腦的 CLI 與登入。", hostUnknown:"電腦名稱尚未回報", hostRefresh:"重新偵測後可取得 Windows 電腦名稱。" },
|
|
82
|
+
});
|
|
63
83
|
export const detectionText = key => t(`windetect.${key}`);
|
|
64
84
|
|
|
65
|
-
|
|
85
|
+
/** Show the execution computer's identity, independently of the computer opening the dashboard. */
|
|
86
|
+
export function WindowsCliHostIdentity({ inventory, compact = false, machineId = "", machine }) {
|
|
87
|
+
const hostname = (inventory?.hostname || machine?.hostname || "").trim();
|
|
88
|
+
return html`<div class=${`windows-cli-target${compact ? " is-compact" : ""}`} aria-label=${detectionText("computer")}>
|
|
89
|
+
<${Icon} name="fleet" size=${compact ? 16 : 21} /><div><span class="windows-cli-target-label">${machineId ? t("windetect.remoteWindows") : detectionText("hostWindows")}</span><strong class="windows-cli-target-name">${machineId ? `${machine?.name || machineId}${hostname && hostname !== machine?.name ? ` · ${hostname}` : ""}` : hostname || detectionText("hostUnknown")}</strong>
|
|
90
|
+
${!compact ? html`<p>${detectionText(hostname ? "hostHint" : "hostRefresh")}</p>` : null}</div>
|
|
91
|
+
</div>`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function WindowsCliDiscoveryStatus({ state, disabled = false }) {
|
|
66
95
|
const lease = useLease("windows-cli-discovery-status");
|
|
67
96
|
const [seconds,setSeconds] = useState(0);
|
|
68
97
|
useEffect(() => {
|
|
@@ -71,9 +100,9 @@ export function WindowsCliDiscoveryStatus({ state }) {
|
|
|
71
100
|
tick(); const timer = lease.interval(tick,1000);
|
|
72
101
|
return () => lease.clear(timer);
|
|
73
102
|
},[lease,state.loading,state.startedAt]);
|
|
74
|
-
if (state.error) return html`<div class="cli-discovery-status is-error" role="alert"><${Icon} name="alert" size=${18} /><div><strong>${detectionText("failed")}</strong><p>${state.data ? detectionText("previous") : state.error}</p>${state.data ? html`<small>${state.error}</small>` : null}<button type="button" class="btn btn-sm" onClick=${state.refresh}>${detectionText("retry")}</button></div></div>`;
|
|
103
|
+
if (state.error) return html`<div class="cli-discovery-status is-error" role="alert"><${Icon} name="alert" size=${18} /><div><strong>${detectionText("failed")}</strong><p>${state.data ? detectionText("previous") : state.error}</p>${state.data ? html`<small>${state.error}</small>` : null}<button type="button" class="btn btn-sm" disabled=${disabled} onClick=${state.refresh}>${detectionText("retry")}</button></div></div>`;
|
|
75
104
|
// M-2239 P1-2: nothing is detected on its own — the first detection is the administrator's press too.
|
|
76
|
-
if (!state.loading && state.data && state.data.probedAt === null) return html`<div class="cli-discovery-status" role="status"><${Icon} name="info" size=${18} /><div><p>${detectionText("never")}</p><button type="button" class="btn btn-sm" onClick=${state.refresh}>${detectionText("detect")}</button></div></div>`;
|
|
105
|
+
if (!state.loading && state.data && state.data.probedAt === null) return html`<div class="cli-discovery-status" role="status"><${Icon} name="info" size=${18} /><div><p>${detectionText("never")}</p><button type="button" class="btn btn-sm" disabled=${disabled} onClick=${state.refresh}>${detectionText("detect")}</button></div></div>`;
|
|
77
106
|
if (!state.loading && state.data) return null;
|
|
78
107
|
return html`<div class="cli-discovery-status" role="status" aria-live="polite" aria-busy="true"><span class="out-spin" aria-hidden="true"></span><div><strong>${detectionText(state.data ? "refreshing" : "loading")}</strong><p>${detectionText("hint")}</p>${seconds >= 8 ? html`<small>${t("windetect.elapsed",seconds)}</small>` : null}</div></div>`;
|
|
79
108
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Runs `$1` detached from any terminal, at low priority; HUP/INT/TERM on this shell reach its whole process group. */
|
|
2
2
|
export declare const UNATTENDED_INSTALL_SCRIPT: string;
|
|
3
3
|
/** The account's login shell, when it is an absolute path to an executable; else undefined (keep the inherited one). */
|
|
4
|
-
export declare function loginShell(read?: () => string | null | undefined): string | undefined
|
|
4
|
+
export declare function loginShell(read?: () => string | null | undefined): Promise<string | undefined>;
|
|
5
5
|
/** The window's command for an install command. `shell`: the $SHELL to give it; null keeps the inherited one. */
|
|
6
6
|
export declare function unattendedInstallCommand(command: string, shell?: string | null): string;
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
*
|
|
20
20
|
* The exit code is the install's own: the session judges success by it.
|
|
21
21
|
*/
|
|
22
|
-
import { accessSync, constants as fsConstants } from "node:fs";
|
|
23
22
|
import { userInfo } from "node:os";
|
|
24
23
|
import { isAbsolute } from "node:path";
|
|
25
24
|
import { shellQuote } from "./backend/types.js";
|
|
25
|
+
import { spawnProbeCommand, PROBE_DEADLINE_MS } from "./binary-probe.js";
|
|
26
26
|
/** Runs `$1` detached from any terminal, at low priority; HUP/INT/TERM on this shell reach its whole process group. */
|
|
27
27
|
export const UNATTENDED_INSTALL_SCRIPT = [
|
|
28
28
|
// In a tmux pane, start only once AgEnD has set remain-on-exit on the window (at most ~10 s): an install that fails
|
|
@@ -39,7 +39,7 @@ export const UNATTENDED_INSTALL_SCRIPT = [
|
|
|
39
39
|
'wait "$pid"',
|
|
40
40
|
].join("\n");
|
|
41
41
|
/** The account's login shell, when it is an absolute path to an executable; else undefined (keep the inherited one). */
|
|
42
|
-
export function loginShell(read = () => userInfo().shell) {
|
|
42
|
+
export async function loginShell(read = () => userInfo().shell) {
|
|
43
43
|
let shell;
|
|
44
44
|
try {
|
|
45
45
|
shell = read();
|
|
@@ -49,16 +49,30 @@ export function loginShell(read = () => userInfo().shell) {
|
|
|
49
49
|
}
|
|
50
50
|
if (!shell || !isAbsolute(shell))
|
|
51
51
|
return undefined;
|
|
52
|
+
// Child `sh` `[ -f && -x ]`, same as resolveBackendBinary's install-dir probe: an accessSync on a dead mount
|
|
53
|
+
// can hang a pool thread forever (#3009); a child can be killed (binary-probe.ts).
|
|
54
|
+
const child = spawnProbeCommand("sh", ["-c", '[ -f "$1" ] && [ -x "$1" ] && echo "$1"', "sh", shell]);
|
|
55
|
+
let timer;
|
|
52
56
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
const found = await Promise.race([
|
|
58
|
+
child.answer,
|
|
59
|
+
new Promise((r) => {
|
|
60
|
+
timer = setTimeout(() => { child.kill(); r(undefined); }, PROBE_DEADLINE_MS);
|
|
61
|
+
timer.unref?.();
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
return found ?? undefined;
|
|
55
65
|
}
|
|
56
66
|
catch {
|
|
57
67
|
return undefined;
|
|
58
68
|
}
|
|
69
|
+
finally {
|
|
70
|
+
if (timer)
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
}
|
|
59
73
|
}
|
|
60
74
|
/** The window's command for an install command. `shell`: the $SHELL to give it; null keeps the inherited one. */
|
|
61
|
-
export function unattendedInstallCommand(command, shell =
|
|
75
|
+
export function unattendedInstallCommand(command, shell = null) {
|
|
62
76
|
const env = shell ? `SHELL=${shellQuote(shell)} ` : "";
|
|
63
77
|
return `${env}sh -c ${shellQuote(UNATTENDED_INSTALL_SCRIPT)} agend-install ${shellQuote(command)}`;
|
|
64
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unattended-install.js","sourceRoot":"","sources":["../src/unattended-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"unattended-install.js","sourceRoot":"","sources":["../src/unattended-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,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AC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,KAAK,GAAkB,IAAI;IACnF,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACvD,OAAO,GAAG,GAAG,SAAS,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;AACrG,CAAC"}
|
package/dist/update-check.d.ts
CHANGED
|
@@ -10,11 +10,6 @@ export interface UpdateVersionOptions {
|
|
|
10
10
|
/** The alpha channel (`@alpha`, the next minor's previews, #1259). */
|
|
11
11
|
alpha?: boolean;
|
|
12
12
|
beta?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* #2987: the release candidate (`@rc`): a `vX.Y.Z-beta.N` before it is promoted to `@beta`. Only ever asked for — a
|
|
15
|
-
* candidate's version is a beta's, so the install then follows `@beta` again, and never goes back (#1259).
|
|
16
|
-
*/
|
|
17
|
-
rc?: boolean;
|
|
18
13
|
/** Back to the stable line (`@latest`), even from a beta install — may go back a version. */
|
|
19
14
|
stable?: boolean;
|
|
20
15
|
force?: boolean;
|
|
@@ -33,14 +28,13 @@ export declare function compareSemver(a: string, b: string): number | null;
|
|
|
33
28
|
export type UpdateChannel = "latest" | "beta" | "alpha";
|
|
34
29
|
/**
|
|
35
30
|
* The npm dist-tag an install follows (#1259): an alpha (`x.y.z-alpha.N`) is on
|
|
36
|
-
* `@alpha`, any other prerelease (beta, rc…) on `@beta`, a release on `@latest`.
|
|
37
|
-
* (`@rc`, #2987) is a beta's version too, so an install from it follows `@beta` afterwards.
|
|
31
|
+
* `@alpha`, any other prerelease (beta, rc…) on `@beta`, a release on `@latest`.
|
|
38
32
|
* Mirrors what publish.yml publishes each tag to (scripts/npm-dist-tag.mjs).
|
|
39
33
|
*/
|
|
40
34
|
export declare function installedChannel(version: string): UpdateChannel;
|
|
41
35
|
/**
|
|
42
36
|
* The npm selector `agend update` installs from. An explicit choice wins
|
|
43
|
-
* (`--version`, then `--alpha`, `--
|
|
37
|
+
* (`--version`, then `--alpha`, `--beta`, `--stable`); with none, the line the
|
|
44
38
|
* installed version is on — an alpha stays on `@alpha`, a beta on `@beta`, so
|
|
45
39
|
* nobody is moved to another channel without asking. `installedVersion` is the
|
|
46
40
|
* version of the package being replaced (the CLI's own package.json), never
|
package/dist/update-check.js
CHANGED
|
@@ -69,8 +69,7 @@ export function compareSemver(a, b) {
|
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* The npm dist-tag an install follows (#1259): an alpha (`x.y.z-alpha.N`) is on
|
|
72
|
-
* `@alpha`, any other prerelease (beta, rc…) on `@beta`, a release on `@latest`.
|
|
73
|
-
* (`@rc`, #2987) is a beta's version too, so an install from it follows `@beta` afterwards.
|
|
72
|
+
* `@alpha`, any other prerelease (beta, rc…) on `@beta`, a release on `@latest`.
|
|
74
73
|
* Mirrors what publish.yml publishes each tag to (scripts/npm-dist-tag.mjs).
|
|
75
74
|
*/
|
|
76
75
|
export function installedChannel(version) {
|
|
@@ -81,7 +80,7 @@ export function installedChannel(version) {
|
|
|
81
80
|
}
|
|
82
81
|
/**
|
|
83
82
|
* The npm selector `agend update` installs from. An explicit choice wins
|
|
84
|
-
* (`--version`, then `--alpha`, `--
|
|
83
|
+
* (`--version`, then `--alpha`, `--beta`, `--stable`); with none, the line the
|
|
85
84
|
* installed version is on — an alpha stays on `@alpha`, a beta on `@beta`, so
|
|
86
85
|
* nobody is moved to another channel without asking. `installedVersion` is the
|
|
87
86
|
* version of the package being replaced (the CLI's own package.json), never
|
|
@@ -92,8 +91,6 @@ export function getUpdateSelector(opts, installedVersion) {
|
|
|
92
91
|
return opts.version;
|
|
93
92
|
if (opts.alpha)
|
|
94
93
|
return "alpha";
|
|
95
|
-
if (opts.rc)
|
|
96
|
-
return "rc";
|
|
97
94
|
if (opts.beta)
|
|
98
95
|
return "beta";
|
|
99
96
|
if (opts.stable)
|
package/dist/update-check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAY7C;;;;;GAKG;AACH,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAC9B,MAAM,MAAM,GAAG,MAAM,GAAG,8BAA8B,CAAC;AACvD,MAAM,QAAQ,GAAG,eAAe,CAAC;AACjC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,MAAM,SAAS,MAAM,cAAc,QAAQ,SAAS,QAAQ,OAAO,CAAC,CAAC;AAIxI,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,C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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE5J,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAqB,EACrB,MAAM,GAAiB,OAAO;IAE9B,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QACjB,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACpC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,KAAK,uCAAuC,EAAE,CAAC;QACvD,MAAM,CAAC,GAAG,CAAC,sGAAsG,CAAC,CAAC;QACnH,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/view-api.d.ts
CHANGED
|
@@ -137,11 +137,26 @@ export declare function cardPicture(ctx: {
|
|
|
137
137
|
export declare function humanCards(dataDir: string): ReturnType<typeof HumanCardStore.all>;
|
|
138
138
|
/** For tests: forget the guests' read counts and shared captures. */
|
|
139
139
|
export declare function resetGuestPanes(): void;
|
|
140
|
+
/**
|
|
141
|
+
* M-2262 (the user, hmsg-435f6df6): the View's scrollback — the pane's history above its screen, read only when the
|
|
142
|
+
* person scrolls up (never on the 800 ms refresh), at most `lines` lines (tmux's own default history-limit) and at most
|
|
143
|
+
* `maxBytes` (its end, from a whole line). A viewer's tabs asking at once share one read.
|
|
144
|
+
*/
|
|
145
|
+
export declare const VIEW_HISTORY: {
|
|
146
|
+
readonly lines: 2000;
|
|
147
|
+
readonly maxBytes: number;
|
|
148
|
+
};
|
|
140
149
|
/** A pane's logical grid size in cells, as tmux sees it. */
|
|
141
150
|
export interface PaneSize {
|
|
142
151
|
cols: number;
|
|
143
152
|
rows: number;
|
|
144
153
|
}
|
|
154
|
+
/** M-2262: whether the pane shows its alternate screen, and how many lines tmux keeps above it. */
|
|
155
|
+
export interface PaneScrollback {
|
|
156
|
+
alternate: boolean;
|
|
157
|
+
lines: number;
|
|
158
|
+
}
|
|
159
|
+
export declare function parsePaneScrollback(alternate: string | undefined, lines: string | undefined): PaneScrollback | null;
|
|
145
160
|
/** Parse `display-message`'s `<cols>x<rows>` output. Returns null if unusable. */
|
|
146
161
|
export declare function parsePaneSize(out: string): PaneSize | null;
|
|
147
162
|
/** True if the path belongs to the view feature (so the caller can skip the
|