@songsid/agend 2.3.5-alpha.2 → 2.3.5-alpha.3
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/auth-api.d.ts +21 -0
- package/dist/auth-api.js +91 -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.js +11 -1
- 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 +143 -8
- package/dist/fleet-manager.js +874 -166
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.js +7 -0
- 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/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 +5 -0
- package/dist/public-web-link.js +4 -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-bundle.js +3 -0
- package/dist/runtime-bundle.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-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/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 +35 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +1 -0
- package/dist/settings-http-confirmation.js +4 -0
- 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/general-location.js +71 -0
- package/dist/ui/native-pane-recovery.js +1 -1
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/panel-needs.js +2 -0
- package/dist/ui/panel-settings.js +5 -1
- package/dist/ui/settings-dialogs.js +8 -2
- package/dist/ui/settings-model.js +2 -1
- package/dist/ui/settings-outside.js +176 -0
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app.css +16 -1
- package/dist/ui/shared/instance-nav.js +13 -3
- package/dist/ui/shared/panel-view.js +266 -17
- package/dist/ui/shared/qrcode.module.js +2237 -0
- package/dist/ui/shared/signin.js +39 -5
- 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/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 +12 -0
- package/dist/web-api.js +77 -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 +12 -0
- package/dist/windows-agents.js +24 -0
- package/dist/windows-agents.js.map +1 -1
- package/launcher/agend-install.cjs +16 -2
- package/package.json +1 -1
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");
|
|
@@ -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": "編輯",
|
|
@@ -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,EAAE,MAAM,mBAAmB,CAAC;AAEzE,uHAAuH;AACvH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,oHAAoH;IACpH,qHAAqH;IACrH,oFAAoF;IACpF,uNAAuN;IACvN,MAAM;IACN,0GAA0G;IAC1G,0IAA0I;IAC1I,QAAQ;IACR,uHAAuH;IACvH,uDAAuD;IACvD,2FAA2F;IAC3F,aAAa;CACd,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,wHAAwH;AACxH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAI,GAAoC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,KAA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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,E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,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
|
package/dist/view-api.js
CHANGED
|
@@ -7,7 +7,8 @@ import { gatewayRequestContext } from "./web-request-context.js";
|
|
|
7
7
|
*
|
|
8
8
|
* GET /view → static page
|
|
9
9
|
* GET /api/pane/:instance → `tmux capture-pane -ep` output (ANSI text),
|
|
10
|
-
* plus X-Pane-Cols / X-Pane-Rows response headers
|
|
10
|
+
* plus X-Pane-Cols / X-Pane-Rows response headers;
|
|
11
|
+
* `?history=1`: the scrollback above it too, on demand (VIEW_HISTORY)
|
|
11
12
|
* GET /api/profiles → merged roster (live status + config + profile)
|
|
12
13
|
* GET /api/profile/:instance → one profile row
|
|
13
14
|
* POST /api/profile/:instance → upsert profile (signed in)
|
|
@@ -241,7 +242,7 @@ const guestPaneAgents = new Map(); // account → agent → when it was last rea
|
|
|
241
242
|
const sharedCaptures = new Map();
|
|
242
243
|
/** For tests: forget the guests' read counts and shared captures. */
|
|
243
244
|
export function resetGuestPanes() { guestPaneReads = paneReadLimiter(); guestPaneAgents.clear(); sharedCaptures.clear(); }
|
|
244
|
-
function guestPane(ctx, name, guest, res) {
|
|
245
|
+
function guestPane(ctx, name, guest, res, history = false) {
|
|
245
246
|
if (!guest.trusted?.()) {
|
|
246
247
|
json(res, 403, { error: "guest_not_trusted" });
|
|
247
248
|
return;
|
|
@@ -264,6 +265,11 @@ function guestPane(ctx, name, guest, res) {
|
|
|
264
265
|
guestPaneReads.record(account);
|
|
265
266
|
agents.set(name, now);
|
|
266
267
|
guestPaneAgents.set(account, agents);
|
|
268
|
+
// The scrollback (a person scrolled up): one read within the same limits, at most the same bytes (its end).
|
|
269
|
+
if (history) {
|
|
270
|
+
historyCapture(ctx, name).then((c) => sendHistory(res, c, GUEST_PANE_MAX_BYTES, { "Cache-Control": "private, no-store" }), (err) => historyFailed(ctx, res, name, err));
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
267
273
|
let shared = sharedCaptures.get(name);
|
|
268
274
|
if (!shared || now - shared.at >= GUEST_PANE_SHARE_MS) {
|
|
269
275
|
shared = { at: now, capture: capturePane(ctx, name) };
|
|
@@ -271,19 +277,68 @@ function guestPane(ctx, name, guest, res) {
|
|
|
271
277
|
shared.capture.catch(() => { if (sharedCaptures.get(name) === shared)
|
|
272
278
|
sharedCaptures.delete(name); });
|
|
273
279
|
}
|
|
274
|
-
shared.capture.then(({
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
280
|
+
shared.capture.then((c) => sendPane(res, c, GUEST_PANE_MAX_BYTES, { "Cache-Control": "private, no-store" }), (err) => paneFailed(ctx, res, name, err));
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* M-2262 (the user, hmsg-435f6df6): the View's scrollback — the pane's history above its screen, read only when the
|
|
284
|
+
* person scrolls up (never on the 800 ms refresh), at most `lines` lines (tmux's own default history-limit) and at most
|
|
285
|
+
* `maxBytes` (its end, from a whole line). A viewer's tabs asking at once share one read.
|
|
286
|
+
*/
|
|
287
|
+
export const VIEW_HISTORY = { lines: 2000, maxBytes: 1024 * 1024 };
|
|
288
|
+
const historyCaptures = new Map();
|
|
289
|
+
function historyCapture(ctx, name) {
|
|
290
|
+
let capture = historyCaptures.get(name);
|
|
291
|
+
if (!capture) {
|
|
292
|
+
capture = capturePane(ctx, name, VIEW_HISTORY.lines);
|
|
293
|
+
historyCaptures.set(name, capture);
|
|
294
|
+
const done = () => { if (historyCaptures.get(name) === capture)
|
|
295
|
+
historyCaptures.delete(name); };
|
|
296
|
+
capture.then(done, done);
|
|
297
|
+
}
|
|
298
|
+
return capture;
|
|
299
|
+
}
|
|
300
|
+
/** A capture as the answer: the pane's grid in X-Pane-Cols / X-Pane-Rows; over `maxBytes`, its end from a whole line. */
|
|
301
|
+
function sendPane(res, { text, size, scrollback }, maxBytes, extra = {}) {
|
|
302
|
+
const headers = { "Content-Type": "text/plain; charset=utf-8", ...extra };
|
|
303
|
+
if (size) {
|
|
304
|
+
headers["X-Pane-Cols"] = String(size.cols);
|
|
305
|
+
headers["X-Pane-Rows"] = String(size.rows);
|
|
306
|
+
}
|
|
307
|
+
// M-2262: the scrollback's own facts (the page says when a CLI keeps none).
|
|
308
|
+
if (scrollback) {
|
|
309
|
+
headers["X-Pane-Alternate"] = scrollback.alternate ? "1" : "0";
|
|
310
|
+
headers["X-Pane-History-Lines"] = String(scrollback.lines);
|
|
311
|
+
}
|
|
312
|
+
const bytes = Buffer.from(text, "utf8");
|
|
313
|
+
res.writeHead(200, headers);
|
|
314
|
+
// Over the cap: its end, from the first whole line in it (never mid-character or mid-escape sequence).
|
|
315
|
+
if (bytes.length <= maxBytes) {
|
|
316
|
+
res.end(text);
|
|
317
|
+
return;
|
|
318
|
+
} // whole: the text, as before
|
|
319
|
+
const tail = bytes.subarray(bytes.length - maxBytes);
|
|
320
|
+
const line = tail.indexOf(0x0a);
|
|
321
|
+
res.end(line >= 0 ? tail.subarray(line + 1) : tail);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* #2969 review (Prism P2): the scrollback says so when it is not there — never the plain read's empty 200, which the
|
|
325
|
+
* page would draw as the earlier output (blanking the screen it had). No pane yet, or no scrollback facts: 503.
|
|
326
|
+
*/
|
|
327
|
+
function sendHistory(res, c, maxBytes, extra = {}) {
|
|
328
|
+
if (!c.scrollback) {
|
|
329
|
+
json(res, 503, { error: "scrollback_unavailable" });
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
sendPane(res, c, maxBytes, extra);
|
|
333
|
+
}
|
|
334
|
+
function historyFailed(ctx, res, name, err) {
|
|
335
|
+
ctx.logger.debug({ err, name }, "capture-pane (scrollback) failed");
|
|
336
|
+
json(res, 503, { error: "scrollback_unavailable" });
|
|
337
|
+
}
|
|
338
|
+
function paneFailed(ctx, res, name, err) {
|
|
339
|
+
ctx.logger.debug({ err, name }, "capture-pane failed");
|
|
340
|
+
res.writeHead(200, { "Content-Type": "text/plain" });
|
|
341
|
+
res.end("");
|
|
287
342
|
}
|
|
288
343
|
/**
|
|
289
344
|
* Capture a pane's contents (with ANSI escapes) **and** its logical grid size.
|
|
@@ -293,22 +348,33 @@ function guestPane(ctx, name, guest, res) {
|
|
|
293
348
|
* sparse frame (a freshly-started CLI printing three short lines) would
|
|
294
349
|
* otherwise fit to ~3 columns and blow the font up to the 48px ceiling.
|
|
295
350
|
*/
|
|
296
|
-
async function capturePane(ctx, name) {
|
|
351
|
+
async function capturePane(ctx, name, historyLines = 0) {
|
|
297
352
|
const target = paneTarget(ctx, name);
|
|
298
353
|
if (!target)
|
|
299
354
|
return { text: "", size: null };
|
|
355
|
+
// M-2262: with the scrollback, whether the CLI keeps any (a full-screen one — the alternate screen, or one that redraws
|
|
356
|
+
// the whole window — leaves tmux nothing above the screen), from the same one display-message.
|
|
357
|
+
const format = historyLines > 0 ? "#{pane_width}x#{pane_height} #{alternate_on} #{history_size}" : "#{pane_width}x#{pane_height}";
|
|
358
|
+
// M-2262: with `historyLines`, from that many lines above the screen (tmux stops at what it kept) to the screen's end.
|
|
359
|
+
const capture = ["capture-pane", "-p", "-e", ...(historyLines > 0 ? ["-S", `-${Math.floor(historyLines)}`] : []), "-t", target];
|
|
300
360
|
const [text, size] = await Promise.all([
|
|
301
361
|
// #1956: through the fleet's spawn helper when it runs (a viewer polls this every 800 ms).
|
|
302
|
-
tmuxExecHelper.exec("tmux", tmuxArgs(
|
|
362
|
+
tmuxExecHelper.exec("tmux", tmuxArgs(capture), { maxBuffer: 8 * 1024 * 1024 }, () => execFileP("tmux", tmuxArgs(capture), { maxBuffer: 8 * 1024 * 1024 }))
|
|
303
363
|
.then(r => r.stdout),
|
|
304
364
|
// display-message resolves the window's *active* pane, matching capture-pane.
|
|
305
|
-
tmuxExecHelper.exec("tmux", tmuxArgs(["display-message", "-p", "-t", target,
|
|
306
|
-
.then(r =>
|
|
365
|
+
tmuxExecHelper.exec("tmux", tmuxArgs(["display-message", "-p", "-t", target, format]), {}, () => execFileP("tmux", tmuxArgs(["display-message", "-p", "-t", target, format])))
|
|
366
|
+
.then(r => r.stdout)
|
|
307
367
|
// A missing size must not fail the whole capture — the client falls back
|
|
308
368
|
// to its last known size (or skips refitting) when the headers are absent.
|
|
309
|
-
.catch(() =>
|
|
369
|
+
.catch(() => ""),
|
|
310
370
|
]);
|
|
311
|
-
|
|
371
|
+
const [grid = "", alternate, kept] = size.trim().split(/\s+/);
|
|
372
|
+
return { text, size: parsePaneSize(grid), ...(historyLines > 0 ? { scrollback: parsePaneScrollback(alternate, kept) } : {}) };
|
|
373
|
+
}
|
|
374
|
+
export function parsePaneScrollback(alternate, lines) {
|
|
375
|
+
if ((alternate !== "0" && alternate !== "1") || !/^\d+$/.test(lines ?? ""))
|
|
376
|
+
return null;
|
|
377
|
+
return { alternate: alternate === "1", lines: Number(lines) };
|
|
312
378
|
}
|
|
313
379
|
/** Parse `display-message`'s `<cols>x<rows>` output. Returns null if unusable. */
|
|
314
380
|
export function parsePaneSize(out) {
|
|
@@ -389,22 +455,17 @@ export function handleViewRequest(req, res, url, ctx) {
|
|
|
389
455
|
}
|
|
390
456
|
// #2855: a guest (the gate bound it, and checked the agent is in its scope) — Trusted only, within its limits, and
|
|
391
457
|
// reading the capture every guest viewer of this agent shares.
|
|
458
|
+
// M-2262: `?history=1` — the scrollback too (on demand: the person scrolled up). Any other query is the screen.
|
|
459
|
+
const history = url.searchParams.get("history") === "1";
|
|
392
460
|
const guest = guestRequestOf(req);
|
|
393
461
|
if (guest) {
|
|
394
|
-
guestPane(ctx, name, guest, res);
|
|
462
|
+
guestPane(ctx, name, guest, res, history);
|
|
395
463
|
return true;
|
|
396
464
|
}
|
|
397
|
-
|
|
398
|
-
.then((
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
headers["X-Pane-Cols"] = String(size.cols);
|
|
402
|
-
headers["X-Pane-Rows"] = String(size.rows);
|
|
403
|
-
}
|
|
404
|
-
res.writeHead(200, headers);
|
|
405
|
-
res.end(text);
|
|
406
|
-
})
|
|
407
|
-
.catch(err => { ctx.logger.debug({ err, name }, "capture-pane failed"); res.writeHead(200, { "Content-Type": "text/plain" }); res.end(""); });
|
|
465
|
+
if (history)
|
|
466
|
+
historyCapture(ctx, name).then((c) => sendHistory(res, c, VIEW_HISTORY.maxBytes), (err) => historyFailed(ctx, res, name, err));
|
|
467
|
+
else
|
|
468
|
+
capturePane(ctx, name).then((c) => sendPane(res, c, Number.MAX_SAFE_INTEGER), (err) => paneFailed(ctx, res, name, err));
|
|
408
469
|
return true;
|
|
409
470
|
}
|
|
410
471
|
// ── GET /api/profiles — merged roster ──
|