@songsid/agend 2.2.0-beta.10 → 2.2.0-beta.11
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/agent-endpoint.js +3 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +3 -1
- package/dist/auth-api.js +15 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +5 -0
- package/dist/backend/antigravity.js +27 -13
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/effort-metadata.d.ts +36 -0
- package/dist/backend/effort-metadata.js +83 -13
- package/dist/backend/effort-metadata.js.map +1 -1
- package/dist/backend/launch-effort.d.ts +29 -1
- package/dist/backend/launch-effort.js +53 -6
- package/dist/backend/launch-effort.js.map +1 -1
- package/dist/backend/types.d.ts +14 -0
- package/dist/backend/types.js +10 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +12 -0
- package/dist/channel/adapters/discord.js +39 -2
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +18 -0
- package/dist/channel/adapters/telegram.js +24 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-tools.js +2 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.d.ts +2 -0
- package/dist/channel/tool-router.js +1 -1
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +16 -0
- package/dist/cli.js +34 -11
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +9 -0
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +8 -1
- package/dist/delivery-outbox.js +6 -2
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +59 -3
- package/dist/fleet-manager.js +157 -22
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -1
- package/dist/instructions.js +2 -2
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +26 -0
- package/dist/locale.js.map +1 -1
- package/dist/outbound-handlers.js +21 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +12 -0
- package/dist/outbound-schemas.js +12 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +3 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +86 -5
- package/dist/reply-buttons-controller.js +271 -7
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +48 -3
- package/dist/reply-buttons.js +105 -10
- package/dist/reply-buttons.js.map +1 -1
- package/dist/reply-polls.d.ts +85 -0
- package/dist/reply-polls.js +154 -0
- package/dist/reply-polls.js.map +1 -0
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.js +9 -4
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/chat-render.js +19 -2
- package/dist/ui/chat-store.js +35 -1
- package/dist/ui/chat-strings.js +2 -0
- package/dist/ui/chat-thread.js +42 -0
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/panel-settings.js +48 -1
- package/dist/ui/settings-strings.js +10 -0
- package/dist/ui/shared/app-stream.js +4 -1
- package/dist/ui/shared/app.css +8 -0
- package/dist/update-check.d.ts +31 -0
- package/dist/update-check.js +47 -0
- package/dist/update-check.js.map +1 -1
- package/dist/update-launch.d.ts +46 -1
- package/dist/update-launch.js +146 -3
- package/dist/update-launch.js.map +1 -1
- package/dist/web-api.d.ts +40 -2
- package/dist/web-api.js +130 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +12 -1
- package/dist/web-chat-history.js +29 -7
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-login.d.ts +14 -0
- package/dist/web-login.js +4 -2
- package/dist/web-login.js.map +1 -1
- package/dist/web-prefs.d.ts +18 -0
- package/dist/web-prefs.js +36 -4
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-profile.d.ts +32 -0
- package/dist/web-profile.js +132 -0
- package/dist/web-profile.js.map +1 -0
- package/dist/web-session.d.ts +14 -0
- package/dist/web-session.js +10 -0
- package/dist/web-session.js.map +1 -1
- package/package.json +1 -1
|
@@ -293,7 +293,8 @@ export function DeviceSection() {
|
|
|
293
293
|
setTimeout(go, 0);
|
|
294
294
|
};
|
|
295
295
|
const publicLink = typeof document !== "undefined" && document.body && document.body.dataset.publicLink === "1";
|
|
296
|
-
return html
|
|
296
|
+
return html`<${ProfileCard} />
|
|
297
|
+
<section class="card s-device s-synced"><h3>${tn("syncedTitle")}</h3>
|
|
297
298
|
<p class="sub">${publicLink ? tn("syncedPublicLink") : tn("syncedLead")}</p>
|
|
298
299
|
<${DevicePrefs} labels=${true} />
|
|
299
300
|
${P() ? html`<label class="check"><input type="checkbox" checked=${on} onChange=${(e) => { const want = e.target.checked; setPreviewOptIn(want).then(setOn); }} />
|
|
@@ -305,6 +306,52 @@ export function DeviceSection() {
|
|
|
305
306
|
</section>`;
|
|
306
307
|
}
|
|
307
308
|
|
|
309
|
+
/**
|
|
310
|
+
* #1827: who agents see when this person writes from the web. Signed in with a code sent to their Discord or Telegram
|
|
311
|
+
* account, they are that account — its user id, and its name unless they choose another (it follows them to every
|
|
312
|
+
* device, the public link included). Otherwise "web-user", as before. The host checks a name in full and says why it
|
|
313
|
+
* refuses one; this only shows what it says.
|
|
314
|
+
*/
|
|
315
|
+
const view = (b) => ({ phase: "ready", name: b.name || "", shown: b.shown || "", id: b.id || "", bound: b.bound === true, platform: b.platform_name || "", error: "" });
|
|
316
|
+
export function ProfileCard() {
|
|
317
|
+
const [state, setState] = useState({ phase: "loading", name: "", shown: "", id: "", bound: false, platform: "", error: "" });
|
|
318
|
+
const [draft, setDraft] = useState("");
|
|
319
|
+
const lease = useLease();
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
let live = true;
|
|
322
|
+
api("/ui/profile").then((r) => {
|
|
323
|
+
if (!live) return;
|
|
324
|
+
if (!r.ok || !r.body) { setState((s) => ({ ...s, phase: "unavailable" })); return; }
|
|
325
|
+
setState(view(r.body));
|
|
326
|
+
setDraft(r.body.name || "");
|
|
327
|
+
}).catch(() => { if (live) setState((s) => ({ ...s, phase: "unavailable" })); });
|
|
328
|
+
return () => { live = false; };
|
|
329
|
+
}, []);
|
|
330
|
+
if (state.phase === "unavailable") return null;
|
|
331
|
+
const save = (clear) => {
|
|
332
|
+
setState((s) => ({ ...s, phase: "saving", error: "" }));
|
|
333
|
+
api("/ui/profile", { method: "POST", body: JSON.stringify({ name: clear ? null : draft }) }).then((r) => {
|
|
334
|
+
if (lease && !lease.current()) return;
|
|
335
|
+
if (!r.ok) { setState((s) => ({ ...s, phase: "ready", error: (r.body && r.body.error) || tn("profileFailed") })); return; }
|
|
336
|
+
setState(view(r.body));
|
|
337
|
+
setDraft(r.body.name || "");
|
|
338
|
+
toast(tn("profileSaved", r.body.shown || "web-user"));
|
|
339
|
+
}).catch(() => setState((s) => ({ ...s, phase: "ready", error: tn("profileFailed") })));
|
|
340
|
+
};
|
|
341
|
+
const busy = state.phase !== "ready";
|
|
342
|
+
const changed = draft.trim() !== state.name;
|
|
343
|
+
return html`<section class="card s-device s-profile"><h3>${tn("profileTitle")}</h3>
|
|
344
|
+
<p class="sub">${state.bound ? tn("profileLeadBound") : tn("profileLeadUnbound")}</p>
|
|
345
|
+
<div class="field"><label for="profile-name">${tn("profileName")}</label>
|
|
346
|
+
<input id="profile-name" type="text" maxlength="200" autocomplete="nickname" value=${draft} disabled=${busy}
|
|
347
|
+
placeholder=${state.platform || "web-user"} aria-invalid=${state.error ? "true" : "false"} aria-describedby="profile-help"
|
|
348
|
+
onInput=${(e) => setDraft(e.target.value)} onKeyDown=${(e) => { if (e.key === "Enter" && changed && draft.trim()) save(false); }} />
|
|
349
|
+
<p class="sub" id="profile-help">${state.error ? html`<span class="err" role="alert">${state.error}</span>` : tn("profileHelp", state.shown || "web-user", state.id)}</p></div>
|
|
350
|
+
<div class="s-device-row"><button type="button" class="btn primary" disabled=${busy || !changed || !draft.trim()} onClick=${() => save(false)}>${tn("profileSave")}</button>
|
|
351
|
+
${state.name ? html`<button type="button" class="btn" disabled=${busy} onClick=${() => save(true)}>${state.bound ? tn("profileUseAccount", state.platform || "web-user") : tn("profileClear")}</button>` : null}</div>
|
|
352
|
+
</section>`;
|
|
353
|
+
}
|
|
354
|
+
|
|
308
355
|
/** The operation in hand still owns Apply: its writes and job, or a restart of AgEnD from the press to its end. */
|
|
309
356
|
const opBusy = (op) => !!op && (["writing", "posting", "watching"].includes(op.phase) || op.restart === "busy");
|
|
310
357
|
function dropSecrets(staged) { for (const c of staged.values()) if (c.connectionSecret) c.connectionSecret.secret = ""; }
|
|
@@ -219,6 +219,11 @@ register("settings", {
|
|
|
219
219
|
staggerRange: "Must be between 0 and 30000",
|
|
220
220
|
staggerWarning: "Very low values can cause startup spikes",
|
|
221
221
|
sec_device: "Preferences", syncedTitle: "Synced across your devices", syncedLead: "Changes here apply on every device where you are signed in.",
|
|
222
|
+
profileTitle: "Your name",
|
|
223
|
+
profileLeadBound: "Agents see your web messages as the Discord or Telegram account your sign-in code was sent to: its id, and its name unless you choose another here. It follows you to every device you sign in on. It is for recognition only: it grants nothing.",
|
|
224
|
+
profileLeadUnbound: "This browser was not signed in with a code sent to your Discord or Telegram account, so agents see your web messages as \"web-user\" (or the name you set here). Sign in with a code from /web to be recognised as your account.",
|
|
225
|
+
profileName: "Name", profileHelp: "Agents see: {0} · id {1}", profileSave: "Save", profileClear: "Use web-user", profileUseAccount: "Use {0}",
|
|
226
|
+
profileSaved: "Agents now see you as {0}", profileFailed: "Could not save the name",
|
|
222
227
|
syncedPublicLink: "On the public link these are read-only: a change here stays in this browser.",
|
|
223
228
|
deviceTitle: "This device only", deviceLead: "The tour, text size, view fit, the sidebar shown or hidden, panel widths and desktop notifications stay on each device.",
|
|
224
229
|
sec_agents: "Agents",
|
|
@@ -585,6 +590,11 @@ register("settings", {
|
|
|
585
590
|
staggerRange: "必須介於 0 到 30000",
|
|
586
591
|
staggerWarning: "數值太低可能造成啟動尖峰",
|
|
587
592
|
sec_device: "偏好設定", syncedTitle: "在你所有的裝置同步", syncedLead: "這裡的變更會套用到你登入的每一台裝置。",
|
|
593
|
+
profileTitle: "你的名字",
|
|
594
|
+
profileLeadBound: "agent 會把你從網頁送出的訊息,認成收到登入驗證碼的那個 Discord 或 Telegram 帳號:用它的 id,名字也用它的,除非你在這裡另外取名。它會跟著你到每一台登入的裝置。這只用來辨認,不代表任何權限。",
|
|
595
|
+
profileLeadUnbound: "這個瀏覽器不是用私訊到你 Discord 或 Telegram 帳號的驗證碼登入的,所以 agent 會把你的網頁訊息看成「web-user」(或你在這裡設定的名字)。用 /web 的驗證碼登入,就能被認成你的帳號。",
|
|
596
|
+
profileName: "名字", profileHelp: "agent 看到:{0} · id {1}", profileSave: "儲存", profileClear: "改回 web-user", profileUseAccount: "改用 {0}",
|
|
597
|
+
profileSaved: "agent 現在會看到你是 {0}", profileFailed: "無法儲存名字",
|
|
588
598
|
syncedPublicLink: "公開連結只能讀取這些設定:在這裡變更只會留在這個瀏覽器。",
|
|
589
599
|
deviceTitle: "只限這台裝置", deviceLead: "導覽、文字大小、視圖寬度、側欄顯示或隱藏、面板寬度與桌面通知,每台裝置各自保留。",
|
|
590
600
|
sec_agents: "Agent",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
// - suspend()/resume(): the page is leaving (pagehide) / came back from the back-forward cache.
|
|
31
31
|
|
|
32
32
|
// #1218: steps_tick — an instance's transcript moved while a Log watches it (SSE only: a poll page asks the Log itself).
|
|
33
|
-
const EVENTS = ["status", "message", "delivery", "deliveries", "prompt", "prompts", "prompt_resolved", "activity", "needs", "reply_buttons", "steps_tick"];
|
|
33
|
+
const EVENTS = ["status", "message", "delivery", "deliveries", "prompt", "prompts", "prompt_resolved", "activity", "needs", "reply_buttons", "steps_tick", "clock"];
|
|
34
34
|
const MAX_HELD = 1000; // live events held during one catch-up read; more → read again afterwards
|
|
35
35
|
const RETRY_DELAYS = [1000, 2000, 4000]; // after the first failed catch-up read; then it waits for Retry
|
|
36
36
|
const POLL_LIMIT_MS = 10000; // a poll that has not answered by then counts as failed
|
|
@@ -114,6 +114,7 @@ export function createStream(opts) {
|
|
|
114
114
|
if (closed || mine !== pollSeq || !r.ok) return false;
|
|
115
115
|
const d = await r.json();
|
|
116
116
|
if (closed || mine !== pollSeq) return false;
|
|
117
|
+
if (typeof d.now === "number") emit("clock", { now: d.now }); // #1823: read just now, handed over at once
|
|
117
118
|
if (d.status) emit("status", d.status);
|
|
118
119
|
for (const m of d.messages || []) emit("message", m);
|
|
119
120
|
if (typeof d.cursor === "string") state.cursor = d.cursor;
|
|
@@ -209,6 +210,8 @@ export function createStream(opts) {
|
|
|
209
210
|
try { data = JSON.parse(e.data); } catch { return; }
|
|
210
211
|
if (!spoke) { spoke = true; alive(); if (again) catchUp(); }
|
|
211
212
|
else alive();
|
|
213
|
+
// #1823: a clock reading is about now, not about order: it is never held behind a catch-up (it would be stale).
|
|
214
|
+
if (name === "clock") { emit(name, data); return; }
|
|
212
215
|
live(name, data, name === "message" ? e.lastEventId : null);
|
|
213
216
|
});
|
|
214
217
|
}
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -150,6 +150,10 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
|
|
|
150
150
|
.s-device { display: flex; flex-direction: column; gap: var(--s-3); }
|
|
151
151
|
.s-device .sub { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }
|
|
152
152
|
.s-device-row { display: flex; gap: var(--s-2); }
|
|
153
|
+
/* #1827: the person's web name — its field takes the card's width; a refusal reads in the danger colour. */
|
|
154
|
+
.s-profile .field { display: flex; flex-direction: column; gap: var(--s-1); }
|
|
155
|
+
.s-profile .field input { max-width: 24rem; }
|
|
156
|
+
.s-profile .err { color: var(--danger); }
|
|
153
157
|
/* #1620: Settings → Web — the lead, and the read-only list of what is set in fleet.yaml. */
|
|
154
158
|
.s-web .sub { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }
|
|
155
159
|
.s-web-fields:disabled select { opacity: 0.6; } /* over the public link: dimmed like the inputs (.field input:disabled) */
|
|
@@ -526,6 +530,10 @@ html.lb-open .scroller { overflow: hidden; }
|
|
|
526
530
|
.rb-btn { max-width: 100%; white-space: normal; text-align: left; }
|
|
527
531
|
.rb-btn.chosen, .rb-btn.chosen:disabled { border-color: var(--ok); color: var(--text); background: color-mix(in srgb, var(--ok) 14%, transparent); font-weight: var(--fw-semibold); opacity: 1; }
|
|
528
532
|
.rb-btn:disabled:not(.chosen) { opacity: 0.55; }
|
|
533
|
+
/* #1823: a poll — its closed buttons show the tally, so they stay readable; the time left keeps its width. */
|
|
534
|
+
.rb-row.poll .rb-btn:disabled { opacity: 0.85; }
|
|
535
|
+
.rb-row.poll .poll-left { font-variant-numeric: tabular-nums; }
|
|
536
|
+
.poll-voters { margin: var(--s-1) 0 0; padding-left: var(--s-4); color: var(--text-2); font-size: var(--fs-sm); }
|
|
529
537
|
.rb-note { font-size: var(--fs-xs); color: var(--text-3); }
|
|
530
538
|
.pv-menu { position: relative; }
|
|
531
539
|
.pv-menu > summary { list-style: none; cursor: pointer; padding: 2px var(--s-2); border-radius: var(--r-sm); color: var(--text-3); }
|
package/dist/update-check.d.ts
CHANGED
|
@@ -80,6 +80,37 @@ export declare function runningFleetPredatesInstall(opts: {
|
|
|
80
80
|
isFleetProcess: (pid: number) => boolean;
|
|
81
81
|
marginMs?: number;
|
|
82
82
|
}): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* #1829 review: what fleet.pid says, as evidence — "missing" only when the file is not there (ENOENT), "valid" for a
|
|
85
|
+
* whole positive pid, "unknown" for anything else (unreadable, a directory, empty, malformed). Unknown is never read
|
|
86
|
+
* as a stopped fleet.
|
|
87
|
+
*/
|
|
88
|
+
export declare function readFleetPidEvidence(path: string, read?: (path: string) => string): {
|
|
89
|
+
kind: "missing";
|
|
90
|
+
} | {
|
|
91
|
+
kind: "valid";
|
|
92
|
+
pid: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "unknown";
|
|
95
|
+
};
|
|
96
|
+
/** The largest pid `process.kill` accepts (a signed 32-bit integer). */
|
|
97
|
+
export declare const MAX_PID = 2147483647;
|
|
98
|
+
/**
|
|
99
|
+
* Whether `pid` may be alive: only ESRCH ("no such process") proves it gone. EPERM is a live process of another
|
|
100
|
+
* user, and any other failure (an argument the call refused, for one) proves nothing — so: alive.
|
|
101
|
+
*/
|
|
102
|
+
export declare function pidAlive(pid: number, kill?: (pid: number, signal: 0) => unknown): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* #1829 ⑥: whether the fleet is PROVEN not running — no fleet.pid (a fleet removes it when it stops), a pid that no
|
|
105
|
+
* longer exists, or a live pid whose readable command line is not a fleet's (a recycled pid). A command line that
|
|
106
|
+
* cannot be read proves nothing either way: not stopped.
|
|
107
|
+
*/
|
|
108
|
+
export declare function fleetProvenStopped(opts: {
|
|
109
|
+
pid: number | null;
|
|
110
|
+
alive: (pid: number) => boolean;
|
|
111
|
+
commandLine: (pid: number) => string;
|
|
112
|
+
isFleetProcess: (commandLine: string) => boolean;
|
|
113
|
+
}): boolean;
|
|
83
114
|
/** Start time of a live process, via `ps -o lstart=` (Linux and macOS); null if gone. */
|
|
84
115
|
export declare function processStartMs(pid: number, run?: (args: string[]) => string): number | null;
|
|
85
116
|
interface UpdateOutput {
|
package/dist/update-check.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
import { SYSTEMD_RESTART_INDETERMINATE_EXIT_CODE } from "./service-restart-selection.js";
|
|
3
4
|
/**
|
|
4
5
|
* What a chat `/update` (Discord slash or Telegram) runs: no channel flag, ever.
|
|
@@ -160,6 +161,52 @@ export function runningFleetPredatesInstall(opts) {
|
|
|
160
161
|
return false;
|
|
161
162
|
return started < opts.installedAtMs - (opts.marginMs ?? 2_000);
|
|
162
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* #1829 review: what fleet.pid says, as evidence — "missing" only when the file is not there (ENOENT), "valid" for a
|
|
166
|
+
* whole positive pid, "unknown" for anything else (unreadable, a directory, empty, malformed). Unknown is never read
|
|
167
|
+
* as a stopped fleet.
|
|
168
|
+
*/
|
|
169
|
+
export function readFleetPidEvidence(path, read = p => readFileSync(p, "utf-8")) {
|
|
170
|
+
let raw;
|
|
171
|
+
try {
|
|
172
|
+
raw = read(path);
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
return err?.code === "ENOENT" ? { kind: "missing" } : { kind: "unknown" };
|
|
176
|
+
}
|
|
177
|
+
const text = raw.trim();
|
|
178
|
+
const pid = /^[1-9][0-9]{0,9}$/.test(text) ? Number(text) : Number.NaN;
|
|
179
|
+
// process.kill takes a signed 32-bit pid (review): anything above is not a pid it can ask about.
|
|
180
|
+
return pid <= MAX_PID ? { kind: "valid", pid } : { kind: "unknown" };
|
|
181
|
+
}
|
|
182
|
+
/** The largest pid `process.kill` accepts (a signed 32-bit integer). */
|
|
183
|
+
export const MAX_PID = 2_147_483_647;
|
|
184
|
+
/**
|
|
185
|
+
* Whether `pid` may be alive: only ESRCH ("no such process") proves it gone. EPERM is a live process of another
|
|
186
|
+
* user, and any other failure (an argument the call refused, for one) proves nothing — so: alive.
|
|
187
|
+
*/
|
|
188
|
+
export function pidAlive(pid, kill = (p, s) => process.kill(p, s)) {
|
|
189
|
+
try {
|
|
190
|
+
kill(pid, 0);
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
return err?.code !== "ESRCH";
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* #1829 ⑥: whether the fleet is PROVEN not running — no fleet.pid (a fleet removes it when it stops), a pid that no
|
|
199
|
+
* longer exists, or a live pid whose readable command line is not a fleet's (a recycled pid). A command line that
|
|
200
|
+
* cannot be read proves nothing either way: not stopped.
|
|
201
|
+
*/
|
|
202
|
+
export function fleetProvenStopped(opts) {
|
|
203
|
+
if (opts.pid === null)
|
|
204
|
+
return true;
|
|
205
|
+
if (!opts.alive(opts.pid))
|
|
206
|
+
return true;
|
|
207
|
+
const line = opts.commandLine(opts.pid);
|
|
208
|
+
return line !== "" && !opts.isFleetProcess(line);
|
|
209
|
+
}
|
|
163
210
|
/** Start time of a live process, via `ps -o lstart=` (Linux and macOS); null if gone. */
|
|
164
211
|
export function processStartMs(pid, run = args => execFileSync("ps", args, { encoding: "utf8", env: { ...process.env, LC_ALL: "C", TZ: process.env.TZ }, stdio: ["ignore", "pipe", "ignore"], timeout: 5000 })) {
|
|
165
212
|
try {
|
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,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,CAAC;IACpB,OAAO,EAAE,IAAI,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IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAqB,EACrB,SAAuB,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/update-launch.d.ts
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
/** Chat updates must survive the fleet's service cgroup being stopped (#1490 row 37). */
|
|
2
|
+
import { type ChildProcess } from "node:child_process";
|
|
3
|
+
/** How many bytes to cap the update.log file at (across all runs). */
|
|
4
|
+
export declare const UPDATE_LOG_FILE_CAP: number;
|
|
5
|
+
/**
|
|
6
|
+
* Path of the update log file (mode 0600; raw updater output is written directly — secrets are
|
|
7
|
+
* masked only when extracting the short cause shown in chat; the file itself is owner-readable only).
|
|
8
|
+
*/
|
|
9
|
+
export declare function updateLogPath(dataDir: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Extract a short human-readable cause from raw updater output.
|
|
12
|
+
* Prefers the last `npm ERR!`/`npm error` summary line or the last `✗` line.
|
|
13
|
+
* Falls back to the last non-blank line. Masks secrets and caps at ~300 chars.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractUpdateCause(output: string): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* #1829: the one-line fix for a failure AgEnD knows, from this run's output (a small lookup; anything else: null).
|
|
18
|
+
* - `agendGone`: the launched `agend` is no longer there (an install that removed it and did not put it back).
|
|
19
|
+
* - npm `ENOTEMPTY` on its rename: a staging directory left by an interrupted install. npm names the same one on every
|
|
20
|
+
* retry, so the retry fails the same way until it is removed — only that exact directory, and only when it is one of
|
|
21
|
+
* AgEnD's own (`@songsid/.agend…`), never a pattern.
|
|
22
|
+
* - "systemd does not know …": the activation proof could not read the user manager (#1804): the one-time manual hop.
|
|
23
|
+
*/
|
|
24
|
+
export declare function updateFixHint(output: string, opts?: {
|
|
25
|
+
agendGone?: boolean;
|
|
26
|
+
}): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Rotate the log file if needed, write a run header, and return an open file descriptor
|
|
29
|
+
* for the child process to write to directly — not a pipe.
|
|
30
|
+
*
|
|
31
|
+
* Using an fd instead of a pipe means the updater can keep writing after the fleet process
|
|
32
|
+
* that spawned it has been stopped: there is no read end to close, so no EPIPE.
|
|
33
|
+
* The caller must closeSync(fd) after spawn so the parent's copy of the fd is released.
|
|
34
|
+
*
|
|
35
|
+
* Returns `null` when the log file cannot be opened (dataDir unwritable, disk full, etc.).
|
|
36
|
+
* In that case the caller should fall back to `stdio: "ignore"` and omit the log note.
|
|
37
|
+
*/
|
|
38
|
+
export declare function openUpdateLog(logPath: string, header: string): {
|
|
39
|
+
fd: number;
|
|
40
|
+
offset: number;
|
|
41
|
+
} | null;
|
|
1
42
|
export interface UpdateLaunchDeps {
|
|
2
43
|
platform: string;
|
|
3
44
|
cgroup(): Promise<string>;
|
|
@@ -19,4 +60,8 @@ export type UpdateLaunch = {
|
|
|
19
60
|
/** Same UID, no privileged or remote manager, no credentials in argv. No unsafe detached fallback. */
|
|
20
61
|
export declare function resolveUpdateLaunch(agend: string, deps?: UpdateLaunchDeps): Promise<UpdateLaunch>;
|
|
21
62
|
/** Spawn/manager refusal and nonzero updater exit are visible; exit 75 is the existing pending hand-off. */
|
|
22
|
-
export declare function watchUpdateLaunch(child: Pick<
|
|
63
|
+
export declare function watchUpdateLaunch(child: Pick<ChildProcess, "once">, fail: (message: string) => void, logPath?: string,
|
|
64
|
+
/** Byte offset into the log file at which this run's output begins. */
|
|
65
|
+
logOffset?: number,
|
|
66
|
+
/** The `agend` the updater runs: there at launch and gone after a failure → reinstalling is the fix (#1829). */
|
|
67
|
+
agendPath?: string): void;
|
package/dist/update-launch.js
CHANGED
|
@@ -1,9 +1,141 @@
|
|
|
1
1
|
/** Chat updates must survive the fleet's service cgroup being stopped (#1490 row 37). */
|
|
2
2
|
import { execFile } from "node:child_process";
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
|
+
import { appendFileSync, existsSync, fchmodSync, openSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { readFile } from "node:fs/promises";
|
|
6
|
+
import { basename, dirname, isAbsolute, join } from "node:path";
|
|
5
7
|
import { promisify } from "node:util";
|
|
6
8
|
import { updateCommand } from "./update-dispatch.js";
|
|
9
|
+
import { maskSecrets } from "./log-steps.js";
|
|
10
|
+
/** How many bytes to read from the tail of the log when extracting a cause after the updater exits. */
|
|
11
|
+
const CAUSE_TAIL_BYTES = 8 * 1024;
|
|
12
|
+
/** How many bytes to cap the update.log file at (across all runs). */
|
|
13
|
+
export const UPDATE_LOG_FILE_CAP = 400 * 1024;
|
|
14
|
+
/**
|
|
15
|
+
* Path of the update log file (mode 0600; raw updater output is written directly — secrets are
|
|
16
|
+
* masked only when extracting the short cause shown in chat; the file itself is owner-readable only).
|
|
17
|
+
*/
|
|
18
|
+
export function updateLogPath(dataDir) {
|
|
19
|
+
return join(dataDir, "update.log");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Extract a short human-readable cause from raw updater output.
|
|
23
|
+
* Prefers the last `npm ERR!`/`npm error` summary line or the last `✗` line.
|
|
24
|
+
* Falls back to the last non-blank line. Masks secrets and caps at ~300 chars.
|
|
25
|
+
*/
|
|
26
|
+
export function extractUpdateCause(output) {
|
|
27
|
+
// Lines starting with --- are log headers, not updater output.
|
|
28
|
+
const lines = output.split("\n").map(l => l.trimEnd()).filter(l => Boolean(l) && !l.startsWith("---"));
|
|
29
|
+
if (!lines.length)
|
|
30
|
+
return null;
|
|
31
|
+
// npm ERR! ends with !, a non-word char: \b does not anchor here. Use (?:\s|$) instead.
|
|
32
|
+
const npmErrRe = /^npm (ERR!|error)(?:\s|$)/i;
|
|
33
|
+
const npmLines = lines.filter(l => npmErrRe.test(l));
|
|
34
|
+
if (npmLines.length) {
|
|
35
|
+
// npm 10 always ends with "A complete log of this run can be found in: …". Skip that footer.
|
|
36
|
+
// Prefer the first `npm error code` line plus the next for context.
|
|
37
|
+
const codeIdx = npmLines.findIndex(l => /^npm (ERR!|error) code\s/i.test(l));
|
|
38
|
+
if (codeIdx >= 0) {
|
|
39
|
+
const summary = [npmLines[codeIdx], npmLines[codeIdx + 1]].filter(Boolean).join(" — ");
|
|
40
|
+
return maskSecrets(summary).slice(0, 300);
|
|
41
|
+
}
|
|
42
|
+
const meaningful = npmLines.filter(l => !/A complete log of this run can be found in/i.test(l));
|
|
43
|
+
const pick = meaningful.length ? meaningful[meaningful.length - 1] : npmLines[npmLines.length - 1];
|
|
44
|
+
return maskSecrets(pick).slice(0, 300);
|
|
45
|
+
}
|
|
46
|
+
const cross = lines.filter(l => /^\s*[✗✕×✘]/.test(l));
|
|
47
|
+
if (cross.length)
|
|
48
|
+
return maskSecrets(cross[cross.length - 1]).slice(0, 300);
|
|
49
|
+
return maskSecrets(lines[lines.length - 1]).slice(0, 300);
|
|
50
|
+
}
|
|
51
|
+
/** A version or dist-tag as the updater printed it, safe to put in a suggested command; else a placeholder. */
|
|
52
|
+
function updateTarget(output) {
|
|
53
|
+
const to = /Updating AgEnD v\S+ → v(\S+?)\.\.\./.exec(output)?.[1] ?? /Updating AgEnD to (\S+?)\.\.\./.exec(output)?.[1];
|
|
54
|
+
return to && /^[0-9A-Za-z][0-9A-Za-z.+-]*$/.test(to) ? to : "<version>";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* #1829: the one-line fix for a failure AgEnD knows, from this run's output (a small lookup; anything else: null).
|
|
58
|
+
* - `agendGone`: the launched `agend` is no longer there (an install that removed it and did not put it back).
|
|
59
|
+
* - npm `ENOTEMPTY` on its rename: a staging directory left by an interrupted install. npm names the same one on every
|
|
60
|
+
* retry, so the retry fails the same way until it is removed — only that exact directory, and only when it is one of
|
|
61
|
+
* AgEnD's own (`@songsid/.agend…`), never a pattern.
|
|
62
|
+
* - "systemd does not know …": the activation proof could not read the user manager (#1804): the one-time manual hop.
|
|
63
|
+
*/
|
|
64
|
+
export function updateFixHint(output, opts = {}) {
|
|
65
|
+
const target = updateTarget(output);
|
|
66
|
+
if (opts.agendGone)
|
|
67
|
+
return `\`npm install -g @songsid/agend@${target}\``;
|
|
68
|
+
if (/^npm (?:ERR!|error) code ENOTEMPTY\b/im.test(output)) {
|
|
69
|
+
const named = /^npm (?:ERR!|error) dest (.+)$/im.exec(output)?.[1] ?? /ENOTEMPTY[^\n]*rename '[^'\n]+' -> '([^'\n]+)'/.exec(output)?.[1];
|
|
70
|
+
const ours = named && isAbsolute(named) && !/['"\s\\`$]/.test(named)
|
|
71
|
+
&& basename(dirname(named)) === "@songsid" && /^\.agend[A-Za-z0-9._-]*$/.test(basename(named));
|
|
72
|
+
if (ours)
|
|
73
|
+
return `remove the directory an interrupted install left, then update again: \`rm -rf '${named}' && agend update\``;
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (/systemd does not know /.test(output))
|
|
77
|
+
return `\`npm i -g @songsid/agend@${target} && agend restart\``;
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Rotate the log file if needed, write a run header, and return an open file descriptor
|
|
82
|
+
* for the child process to write to directly — not a pipe.
|
|
83
|
+
*
|
|
84
|
+
* Using an fd instead of a pipe means the updater can keep writing after the fleet process
|
|
85
|
+
* that spawned it has been stopped: there is no read end to close, so no EPIPE.
|
|
86
|
+
* The caller must closeSync(fd) after spawn so the parent's copy of the fd is released.
|
|
87
|
+
*
|
|
88
|
+
* Returns `null` when the log file cannot be opened (dataDir unwritable, disk full, etc.).
|
|
89
|
+
* In that case the caller should fall back to `stdio: "ignore"` and omit the log note.
|
|
90
|
+
*/
|
|
91
|
+
export function openUpdateLog(logPath, header) {
|
|
92
|
+
// Rotate BEFORE opening the fd the child will use (never write to the same inode concurrently).
|
|
93
|
+
try {
|
|
94
|
+
if (existsSync(logPath) && statSync(logPath).size > UPDATE_LOG_FILE_CAP / 2) {
|
|
95
|
+
const old = readFileSync(logPath);
|
|
96
|
+
writeFileSync(logPath, old.subarray(Math.max(0, old.length - UPDATE_LOG_FILE_CAP / 2)));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch { /* best-effort */ }
|
|
100
|
+
try {
|
|
101
|
+
appendFileSync(logPath, `${header}\n`, { mode: 0o600 });
|
|
102
|
+
}
|
|
103
|
+
catch { /* best-effort */ }
|
|
104
|
+
let fd;
|
|
105
|
+
try {
|
|
106
|
+
fd = openSync(logPath, "a", 0o600);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return null; // caller falls back to stdio: "ignore" and no log note
|
|
110
|
+
}
|
|
111
|
+
// fchmod: mode param of openSync only applies to new files; existing files keep their mode.
|
|
112
|
+
try {
|
|
113
|
+
fchmodSync(fd, 0o600);
|
|
114
|
+
}
|
|
115
|
+
catch { /* best-effort */ }
|
|
116
|
+
// Record the offset so readRunCause only reads this run's output, not previous runs.
|
|
117
|
+
const offset = (() => { try {
|
|
118
|
+
return statSync(logPath).size;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return 0;
|
|
122
|
+
} })();
|
|
123
|
+
return { fd, offset };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Read only this run's output from the log (from `offset`): its tail, for the cause and the fix.
|
|
127
|
+
* Prevents a run with no output from picking up the previous run's error as the cause.
|
|
128
|
+
*/
|
|
129
|
+
function readRunTail(logPath, offset) {
|
|
130
|
+
try {
|
|
131
|
+
const buf = readFileSync(logPath);
|
|
132
|
+
const runBytes = buf.subarray(offset);
|
|
133
|
+
return runBytes.subarray(Math.max(0, runBytes.length - CAUSE_TAIL_BYTES)).toString("utf8");
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
7
139
|
export const defaultUpdateLaunchDeps = {
|
|
8
140
|
platform: process.platform,
|
|
9
141
|
cgroup: async () => {
|
|
@@ -89,18 +221,29 @@ export async function resolveUpdateLaunch(agend, deps = defaultUpdateLaunchDeps)
|
|
|
89
221
|
] };
|
|
90
222
|
}
|
|
91
223
|
/** Spawn/manager refusal and nonzero updater exit are visible; exit 75 is the existing pending hand-off. */
|
|
92
|
-
export function watchUpdateLaunch(child, fail
|
|
224
|
+
export function watchUpdateLaunch(child, fail, logPath,
|
|
225
|
+
/** Byte offset into the log file at which this run's output begins. */
|
|
226
|
+
logOffset,
|
|
227
|
+
/** The `agend` the updater runs: there at launch and gone after a failure → reinstalling is the fix (#1829). */
|
|
228
|
+
agendPath) {
|
|
93
229
|
let reported = false;
|
|
230
|
+
const agendAtLaunch = agendPath !== undefined && existsSync(agendPath);
|
|
94
231
|
const report = (reason) => {
|
|
95
232
|
if (reported)
|
|
96
233
|
return;
|
|
97
234
|
reported = true;
|
|
98
|
-
|
|
235
|
+
const tail = logPath != null && logOffset != null ? readRunTail(logPath, logOffset) : null;
|
|
236
|
+
const cause = tail === null ? null : extractUpdateCause(tail);
|
|
237
|
+
const logNote = logPath ? ` Full log: ${logPath}.` : "";
|
|
238
|
+
const detail = cause ? ` Cause: ${cause}.${logNote}` : logNote;
|
|
239
|
+
const fix = updateFixHint(tail ?? "", { agendGone: agendAtLaunch && !existsSync(agendPath) });
|
|
240
|
+
fail(`/update could not complete (${reason}).${detail} ${fix ? `Fix: ${fix}` : "Run `agend update` from a host shell."}`);
|
|
99
241
|
};
|
|
100
242
|
child.once("error", () => report("updater launch failed"));
|
|
101
243
|
child.once("exit", (code, signal) => {
|
|
102
|
-
if (signal || (code !== 0 && code !== 75))
|
|
244
|
+
if (signal || (code !== 0 && code !== 75)) {
|
|
103
245
|
report(signal ? "updater was interrupted" : `updater exited ${code ?? "without a status"}`);
|
|
246
|
+
}
|
|
104
247
|
});
|
|
105
248
|
}
|
|
106
249
|
//# sourceMappingURL=update-launch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-launch.js","sourceRoot":"","sources":["../src/update-launch.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"update-launch.js","sourceRoot":"","sources":["../src/update-launch.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAa,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7H,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,uGAAuG;AACvG,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,CAAC;AAClC,sEAAsE;AACtE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,GAAG,IAAI,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe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Aa,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,IAAI,CAAC,UAAU,CAAC,SAAU,CAAC,EAAE,CAAC,CAAC;QAC/F,IAAI,CAAC,+BAA+B,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,uCAAuC,EAAE,CAAC,CAAC;IAC5H,CAAC,CAAC;IAEF,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;QAClC,IAAI,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,kBAAkB,IAAI,IAAI,kBAAkB,EAAE,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/web-api.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { type WebChatHistory } from "./web-chat-history.js";
|
|
|
10
10
|
import { type WebFileLedger } from "./web-upload.js";
|
|
11
11
|
import type { WebSessionStore } from "./web-session.js";
|
|
12
12
|
import { type WebPrefsStore } from "./web-prefs.js";
|
|
13
|
+
import { type WebAccount } from "./web-profile.js";
|
|
13
14
|
import { type MentionNames, type MentionQuery } from "./web-mentions.js";
|
|
14
15
|
import type { ExplicitInstanceRemoval } from "./instance-removal.js";
|
|
15
16
|
/**
|
|
@@ -104,7 +105,7 @@ export interface WebApiContext {
|
|
|
104
105
|
* (#1320 part B). Resolves the entries and adapters itself; returns how
|
|
105
106
|
* many channels were posted to. Never rejects the web send on failure.
|
|
106
107
|
*/
|
|
107
|
-
sendClassicWebEcho?(instance: string, text: string): Promise<number>;
|
|
108
|
+
sendClassicWebEcho?(instance: string, text: string, sender?: string): Promise<number>;
|
|
108
109
|
/** false: definitely not delivered (the instance's IPC is gone, or it was restarted meanwhile). */
|
|
109
110
|
deliverToInstance(instanceName: string, payload: Record<string, unknown>): Promise<boolean | void>;
|
|
110
111
|
deliverHumanToInstance?(instanceName: string, payload: Record<string, unknown>, origin: HumanOrigin, originalBody: string): Promise<boolean | void>;
|
|
@@ -160,10 +161,25 @@ export interface WebApiContext {
|
|
|
160
161
|
confirm?: string;
|
|
161
162
|
}, opts: {
|
|
162
163
|
publicLink: boolean;
|
|
164
|
+
person?: WebPerson;
|
|
163
165
|
}): Promise<{
|
|
164
166
|
status: number;
|
|
165
167
|
body: unknown;
|
|
166
168
|
}>;
|
|
169
|
+
/**
|
|
170
|
+
* #1827: a web person — for the account a session is bound to (none: the operator) — as agents and chats see them.
|
|
171
|
+
* Absent: everyone is "web-user", as before.
|
|
172
|
+
*/
|
|
173
|
+
webPerson?(owner?: WebAccount): WebPerson;
|
|
174
|
+
/** #1827: set (or, with null, clear) a person's own name; refused with a reason. */
|
|
175
|
+
setWebPersonName?(owner: WebAccount | undefined, raw: unknown): {
|
|
176
|
+
ok: true;
|
|
177
|
+
person: WebPerson;
|
|
178
|
+
} | {
|
|
179
|
+
ok: false;
|
|
180
|
+
status: number;
|
|
181
|
+
error: string;
|
|
182
|
+
};
|
|
167
183
|
/** #1386: the web's Acknowledge of a delivery item; `principal` is "web:<session handle>" or "cli". */
|
|
168
184
|
acknowledgeNeedsItem?(id: string, principal: string): {
|
|
169
185
|
status: number;
|
|
@@ -175,9 +191,14 @@ export interface WebApiContext {
|
|
|
175
191
|
error?: string;
|
|
176
192
|
}>;
|
|
177
193
|
/** #1266: a click on an agent reply's button. */
|
|
178
|
-
clickWebReplyButton?(instance: string, id: string, index: number
|
|
194
|
+
clickWebReplyButton?(instance: string, id: string, index: number, voter?: {
|
|
195
|
+
key: string;
|
|
196
|
+
userId: string;
|
|
197
|
+
name: string;
|
|
198
|
+
}): Promise<{
|
|
179
199
|
status: number;
|
|
180
200
|
error?: string;
|
|
201
|
+
options?: number[];
|
|
181
202
|
}>;
|
|
182
203
|
/** Interrupt the current reply and drop what was queued for it; false when the instance is not running. */
|
|
183
204
|
cancelInstance?(name: string): boolean;
|
|
@@ -232,6 +253,23 @@ export interface WebApiContext {
|
|
|
232
253
|
delete(id: string): void;
|
|
233
254
|
} | null;
|
|
234
255
|
}
|
|
256
|
+
/** #1827: a web person as the web chat shows them to agents and chats. */
|
|
257
|
+
export interface WebPerson {
|
|
258
|
+
/** Their key in the web preferences (web-profile.ts webPersonKey): never shown. */
|
|
259
|
+
readonly key: string;
|
|
260
|
+
/** Signed in as an account (a sign-in code DMed to it), or the operator. */
|
|
261
|
+
readonly bound: boolean;
|
|
262
|
+
/** What agents see as the id: the bound account's user id on its platform (still `via web`), or "web-user". */
|
|
263
|
+
readonly userId: string;
|
|
264
|
+
/** Their poll ballot's key: the account's `<connection>:<user id>` (as on the platform), or the operator's. */
|
|
265
|
+
readonly voterKey: string;
|
|
266
|
+
/** The name in use: the one they chose, else their account's name at sign-in, else "web-user". */
|
|
267
|
+
readonly name: string;
|
|
268
|
+
/** Whether the name in use is one they chose. */
|
|
269
|
+
readonly set: boolean;
|
|
270
|
+
/** Their account's name at sign-in, made safe (bound only). */
|
|
271
|
+
readonly platformName?: string;
|
|
272
|
+
}
|
|
235
273
|
/**
|
|
236
274
|
* Handle a Web UI request. Returns true if handled, false to pass through.
|
|
237
275
|
*/
|