@songsid/agend 2.4.0-beta.22 → 2.4.0-beta.23
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-whats-new.js +6 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +5 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +17 -3
- package/dist/authority/web-authority.js +56 -3
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +8 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +2 -2
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/contact-auth-api.js +3 -1
- package/dist/contact-auth-api.js.map +1 -1
- package/dist/contact-auth-service.js +1 -1
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +28 -2
- package/dist/contact-auth-store.js +72 -4
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +18 -1
- package/dist/contact-change-proposals.js +38 -4
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/contact-state-view.d.ts +103 -0
- package/dist/contact-state-view.js +80 -0
- package/dist/contact-state-view.js.map +1 -0
- package/dist/fleet-manager.d.ts +143 -15
- package/dist/fleet-manager.js +455 -78
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
- package/dist/general-knowledge/skills/concepts/SKILL.md +14 -17
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +54 -9
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/hub/client.js +6 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +2 -1
- package/dist/hub/compose/member.js +3 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.js +5 -0
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/protocol.d.ts +21 -0
- package/dist/hub/protocol.js +3 -0
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/question-close-model.d.ts +17 -0
- package/dist/hub/question-close-model.js +7 -0
- package/dist/hub/question-close-model.js.map +1 -0
- package/dist/hub/representative.d.ts +5 -0
- package/dist/hub/representative.js +51 -1
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/rooms/direct-view.js +1 -0
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +1 -1
- package/dist/hub/rooms.d.ts +3 -0
- package/dist/hub/rooms.js +27 -1
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -2
- package/dist/human-delivery-receipts.d.ts +12 -2
- package/dist/human-delivery-receipts.js +19 -4
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +100 -12
- package/dist/locale.js.map +1 -1
- package/dist/needs-you.d.ts +2 -0
- package/dist/needs-you.js +2 -1
- 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/outbound-handlers.d.ts +4 -0
- package/dist/outbound-handlers.js +40 -5
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +2 -1
- package/dist/outbound-schemas.js +3 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +18 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +2 -1
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/tool-permissions.js +1 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +2 -1
- package/dist/ui/chat-activity.js +2 -1
- package/dist/ui/chat-pins.js +2 -1
- package/dist/ui/claude-credentials.js +2 -1
- package/dist/ui/contact-auth-strings.js +28 -17
- package/dist/ui/contact-authorizations.js +6 -4
- package/dist/ui/contact-needs.js +6 -1
- package/dist/ui/contact-permissions.js +6 -4
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/contact-verify-need.js +46 -0
- package/dist/ui/fleet-cache.js +2 -1
- package/dist/ui/fleet-office-skin.js +10 -6
- package/dist/ui/fleet-office-zones.js +22 -9
- package/dist/ui/fleet-office.js +16 -9
- package/dist/ui/fleet-org.js +6 -1
- package/dist/ui/fleet-tab-icons.js +19 -0
- package/dist/ui/fleet-task-activity.js +2 -1
- package/dist/ui/fleet-task-view.js +2 -1
- package/dist/ui/fleet-usage.js +2 -1
- package/dist/ui/hub-admin-overview.js +2 -1
- package/dist/ui/hub-agent-intro.js +2 -1
- package/dist/ui/hub-assistant-admin.js +2 -1
- package/dist/ui/hub-directory-notices.js +2 -1
- package/dist/ui/hub-enrolment-code.js +2 -1
- package/dist/ui/hub-my-agents.js +2 -1
- package/dist/ui/hub-quick-pairing.js +2 -1
- package/dist/ui/hub-role-audit.js +2 -1
- package/dist/ui/hub-role-forms.js +3 -2
- package/dist/ui/hub-role-view.js +3 -2
- package/dist/ui/hub-roles.js +2 -1
- package/dist/ui/hub-room-agent-strings.js +2 -1
- package/dist/ui/hub-room-list.js +2 -1
- package/dist/ui/hub-room-owner-requests.js +2 -1
- package/dist/ui/hub-room-pins.js +2 -1
- package/dist/ui/hub-room-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +1 -1
- package/dist/ui/log-row.js +4 -3
- package/dist/ui/office-share-dialog.js +2 -1
- package/dist/ui/office-share-page.js +2 -1
- package/dist/ui/page-share-dialog.js +3 -2
- package/dist/ui/panel-chat.js +2 -1
- package/dist/ui/panel-details.js +2 -1
- package/dist/ui/panel-fleet.js +10 -5
- package/dist/ui/panel-hub.js +2 -1
- package/dist/ui/panel-needs.js +31 -3
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/panel-windows-cli.js +3 -2
- package/dist/ui/runtime-cli-install.js +2 -1
- package/dist/ui/settings-appearance.js +2 -1
- package/dist/ui/settings-guests.js +4 -3
- package/dist/ui/settings-hub-member-address.js +2 -1
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-hub-web-address.js +2 -1
- package/dist/ui/settings-hub.js +2 -1
- package/dist/ui/settings-update.js +2 -1
- package/dist/ui/settings-web-authority.js +2 -1
- package/dist/ui/shared/agent-sheet.js +2 -1
- package/dist/ui/shared/app-session.js +4 -3
- package/dist/ui/shared/app-shell.js +6 -2
- package/dist/ui/shared/app.css +38 -8
- package/dist/ui/shared/chat-time.js +7 -4
- package/dist/ui/shared/clock-text.js +57 -0
- package/dist/ui/shared/device-roles.js +6 -5
- package/dist/ui/shared/instance-nav.js +17 -22
- package/dist/ui/shared/usage-dialog.js +2 -1
- package/dist/ui/shared/view-strings.js +0 -14
- package/dist/ui/shared/web-authorize.js +3 -2
- package/dist/ui/subagent-row.js +2 -1
- package/dist/web-api.d.ts +15 -2
- package/dist/web-api.js +62 -13
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +6 -1
- package/dist/web-login.js +8 -3
- package/dist/web-login.js.map +1 -1
- package/dist/web-session-authorization.d.ts +3 -0
- package/dist/web-session-authorization.js +1 -1
- package/dist/web-session-authorization.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// M-3730 (the user, 2026-11-25): a time in the zh-TW interface is a 24-hour clock, 00:19 and 19:45, never 上午12:19 or
|
|
2
|
+
// 下午07:45. Every time and date-with-time the web UI shows goes through here; English keeps what each screen showed.
|
|
3
|
+
// No imports: the language is the page's own <html lang> (app-i18n.js sets "zh-Hant" or "en"), so the fleet, the Hub,
|
|
4
|
+
// a share page and the tests can all read it as it is.
|
|
5
|
+
|
|
6
|
+
/** True when the page shows zh-TW. */
|
|
7
|
+
export function zhClock() { return /^zh/i.test(globalThis.document?.documentElement?.lang || ""); }
|
|
8
|
+
|
|
9
|
+
/** The locale to format with: zh-TW on a zh-TW page, else the screen's own (English: what it always used). */
|
|
10
|
+
export function clockLocale(enLocale) { return zhClock() ? "zh-TW" : enLocale; }
|
|
11
|
+
|
|
12
|
+
const hasTime = (o) => Boolean(o && (o.hour || o.timeStyle));
|
|
13
|
+
const DATE = { year: "numeric", month: "numeric", day: "numeric" }, HMS = { hour: "2-digit", minute: "2-digit", second: "2-digit" };
|
|
14
|
+
/**
|
|
15
|
+
* Intl options for that locale: a zh-TW time is on the 24-hour cycle. A date-only format is left as it is. With no
|
|
16
|
+
* fields (none, {} or only a timeZone) each wrapper keeps its native default: `datetime` (toLocaleString) is a date and
|
|
17
|
+
* a time, `time` (toLocaleTimeString) a time alone, `format` (Intl.DateTimeFormat) a date alone (#4455 review).
|
|
18
|
+
*/
|
|
19
|
+
export function clockOptions(o, kind = "datetime") {
|
|
20
|
+
if (!zhClock()) return o;
|
|
21
|
+
if (!o || !Object.keys(o).some((k) => k !== "timeZone")) {
|
|
22
|
+
if (kind === "format") return o;
|
|
23
|
+
return { ...(kind === "datetime" ? DATE : {}), ...HMS, hourCycle: "h23", ...(o?.timeZone ? { timeZone: o.timeZone } : {}) };
|
|
24
|
+
}
|
|
25
|
+
if (!hasTime(o)) return o;
|
|
26
|
+
const { hour12: _ignored, dateStyle, timeStyle, ...rest } = o;
|
|
27
|
+
// ICU drops a dateStyle's words when an hourCycle comes with it (2026年12月2日 turns into 2026/12/2), so the styles
|
|
28
|
+
// become the parts they stand for.
|
|
29
|
+
const day = dateStyle === "full" ? { year: "numeric", month: "long", day: "numeric", weekday: "long" }
|
|
30
|
+
: dateStyle === "long" || dateStyle === "medium" ? { year: "numeric", month: "long", day: "numeric" }
|
|
31
|
+
: dateStyle === "short" ? { year: "numeric", month: "numeric", day: "numeric" } : {};
|
|
32
|
+
const time = !timeStyle ? {} : { hour: "2-digit", minute: "2-digit", ...(timeStyle === "short" ? {} : { second: "2-digit" }),
|
|
33
|
+
...(timeStyle === "long" || timeStyle === "full" ? { timeZoneName: "short" } : {}) };
|
|
34
|
+
return { ...day, ...time, ...rest, hourCycle: "h23" };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** An Intl.DateTimeFormat that follows the rule above. */
|
|
38
|
+
export function clockFormat(o, enLocale) { return new Intl.DateTimeFormat(clockLocale(enLocale), clockOptions(o, "format")); }
|
|
39
|
+
|
|
40
|
+
const date = (v) => (v instanceof Date ? v : new Date(v));
|
|
41
|
+
/** A time of day ("19:45" in zh-TW; the screen's English format otherwise). No `o`: toLocaleTimeString's own default
|
|
42
|
+
* (hours, minutes and seconds). */
|
|
43
|
+
export function timeText(v, o, enLocale) {
|
|
44
|
+
const d = date(v);
|
|
45
|
+
if (!Number.isFinite(d.getTime())) return "";
|
|
46
|
+
return d.toLocaleTimeString(clockLocale(enLocale), clockOptions(o, "time"));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A date with its time (toLocaleString), with the screen's options. */
|
|
50
|
+
export function dateTimeText(v, o, enLocale) {
|
|
51
|
+
const d = date(v);
|
|
52
|
+
return Number.isFinite(d.getTime()) ? d.toLocaleString(clockLocale(enLocale), clockOptions(o)) : "";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const ZH_UNIT = { ms: "毫秒", s: "秒", m: "分鐘", min: "分鐘", h: "小時" };
|
|
56
|
+
/** A number with its time unit: "2 h" / "5 min" / "3 s" in English, "2 小時" / "5 分鐘" / "3 秒" on a zh-TW page. */
|
|
57
|
+
export function unitText(n, unit) { return `${n} ${zhClock() ? ZH_UNIT[unit] ?? unit : unit}`; }
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { register, t } from "./app-i18n.js";
|
|
8
8
|
|
|
9
9
|
register("webauth", {
|
|
10
|
-
en: { role: "Role", roleOwner: "Owner ✓", roleAdminUnverified: "Admin · not verified", roleGuest: "Guest", roleRead: "Read-only" },
|
|
11
|
-
"zh-TW": { role: "角色", roleOwner: "擁有者 ✓", roleAdminUnverified: "管理員 · 未驗證", roleGuest: "訪客", roleRead: "唯讀" },
|
|
10
|
+
en: { role: "Role", roleOwner: "Owner ✓", roleAdminUnverified: "Admin · not verified", roleGuest: "Guest", roleGuestVerified: "Guest · Verified until {0}", roleRead: "Read-only" },
|
|
11
|
+
"zh-TW": { role: "角色", roleOwner: "擁有者 ✓", roleAdminUnverified: "管理員 · 未驗證", roleGuest: "訪客", roleGuestVerified: "訪客 · 驗證有效至 {0}", roleRead: "唯讀" },
|
|
12
12
|
});
|
|
13
13
|
register("app", {
|
|
14
14
|
en: { manageDevices: "Manage devices" },
|
|
@@ -18,10 +18,11 @@ register("app", {
|
|
|
18
18
|
/**
|
|
19
19
|
* A sign-in's role as one of four words — the session menu's and Settings → Devices' alike. `tier` is the session's (admin /
|
|
20
20
|
* read / guest); `verified`: its owner authorization is valid now (this computer's code sign-in or a chat account's confirm).
|
|
21
|
-
* Only an admin can be an owner; an admin without that is "Admin · not verified".
|
|
21
|
+
* Only an admin can be an owner; an admin without that is "Admin · not verified". M-3651: a guest verified as its account
|
|
22
|
+
* (its private code) is "Guest · Verified until …" when `until` (the time, as shown) is given — who it is, never an owner.
|
|
22
23
|
*/
|
|
23
|
-
export function roleName(tier, verified) {
|
|
24
|
-
if (tier === "guest") return t("webauth.roleGuest");
|
|
24
|
+
export function roleName(tier, verified, until) {
|
|
25
|
+
if (tier === "guest") return verified && until ? t("webauth.roleGuestVerified", until) : t("webauth.roleGuest");
|
|
25
26
|
if (tier === "read") return t("webauth.roleRead");
|
|
26
27
|
return verified ? t("webauth.roleOwner") : t("webauth.roleAdminUnverified");
|
|
27
28
|
}
|
|
@@ -22,6 +22,7 @@ import "./view-strings.js";
|
|
|
22
22
|
import { themesShown, themesStore } from "./app-themes.js";
|
|
23
23
|
import { machineName } from "./machine-name.js";
|
|
24
24
|
import { identityClasses, identityOf, paintIdentity, useIdentityColors } from "./identity-color.js";
|
|
25
|
+
import { dateTimeText } from "./clock-text.js";
|
|
25
26
|
|
|
26
27
|
// Keep new copy beside its caller: a retained view-strings.js still links and renders the menu.
|
|
27
28
|
register("agentRow", {
|
|
@@ -510,28 +511,21 @@ export function agentTurnAge(it, now = Date.now()) {
|
|
|
510
511
|
const at = it && typeof it.last_agent_turn === "string" ? Date.parse(it.last_agent_turn) : NaN;
|
|
511
512
|
return Number.isFinite(at) ? Math.max(0, (now - at) / 60000) : null;
|
|
512
513
|
}
|
|
513
|
-
/** A short "ago": "now", "2m", "3h", "4d" (zh-TW: 剛剛、2 分、3 小時、4 天). */
|
|
514
|
-
export function whenShort(mins) {
|
|
515
|
-
if (mins < 1) return tn("whenNow");
|
|
516
|
-
if (mins < 60) return tn("whenMin", { n: Math.floor(mins) });
|
|
517
|
-
if (mins < 1440) return tn("whenHour", { n: Math.floor(mins / 60) });
|
|
518
|
-
return tn("whenDay", { n: Math.floor(mins / 1440) });
|
|
519
|
-
}
|
|
520
514
|
/**
|
|
521
|
-
* The row's
|
|
522
|
-
*
|
|
523
|
-
* null for
|
|
524
|
-
*
|
|
515
|
+
* The row's time (M-3707, the user 11-25: one time again, not M-3674's 人/Agent pair): the most recent response, to a
|
|
516
|
+
* person (last_reply) or to another agent (last_agent_turn), unlabelled, as a reply's time always read ("2 min ago");
|
|
517
|
+
* null for neither. `person`: the time shown is the reply to a person. The title says which kind each was, the newer
|
|
518
|
+
* first, each with its full time. Only a reply to a person highlights the row or moves it in "Recent" (replyAge, below):
|
|
519
|
+
* a turn another agent started updates the time silently.
|
|
525
520
|
*/
|
|
526
|
-
export function activityText(it, replyMins, agentMins
|
|
521
|
+
export function activityText(it, replyMins, agentMins) {
|
|
527
522
|
if (replyMins == null && agentMins == null) return null;
|
|
528
|
-
const at = (k) =>
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
return { text: replyMins == null ? a : tn("whenBoth", { p: tn("whenPerson", { t: whenShort(replyMins) }), a }), title };
|
|
523
|
+
const at = (k) => dateTimeText(Date.parse(it[k]));
|
|
524
|
+
const agentNewer = agentMins != null && (replyMins == null || agentMins < replyMins);
|
|
525
|
+
const lines = [replyMins != null ? tn("whenPersonTitle", { time: at("last_reply") }) : null, agentMins != null ? tn("whenAgentTitle", { time: at("last_agent_turn") }) : null]
|
|
526
|
+
.filter(Boolean);
|
|
527
|
+
if (agentNewer) lines.reverse();
|
|
528
|
+
return { text: replyText(agentNewer ? agentMins : replyMins), title: lines.join("\n"), person: !agentNewer };
|
|
535
529
|
}
|
|
536
530
|
/** How strong the highlight is: 1 just after a reply, down to 0 at REPLY_FRESH_MIN minutes. */
|
|
537
531
|
export function replyFade(mins) { return mins == null || mins >= REPLY_FRESH_MIN ? 0 : 1 - mins / REPLY_FRESH_MIN; }
|
|
@@ -821,8 +815,9 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
|
|
|
821
815
|
// #2179 (B5, the user's pick): the % (and the ★ beside the row) on the name's line; the time of the last reply at the
|
|
822
816
|
// end of the second line, highlighted for REPLY_FRESH_MIN minutes, fading by itself (a reply under a minute pulses once).
|
|
823
817
|
const mins = ageOf(name), fade = replyFade(mins);
|
|
824
|
-
// M-3674:
|
|
825
|
-
|
|
818
|
+
// M-3674/M-3707: the time is the newer of that reply and the last turn another agent started (a busy agent no longer
|
|
819
|
+
// reads "33 天前"); the highlight and "Recent" stay the reply's.
|
|
820
|
+
const amins = viewOnly ? null : agentTurnAge(byName.get(name), now), act = activityText(byName.get(name) || {}, mins, amins);
|
|
826
821
|
const two = !!secondary || !!act;
|
|
827
822
|
const menuItems = [
|
|
828
823
|
canStar ? { key: "favorite", label: t(`agentRow.${starred ? "remove" : "add"}`), icon: "star", disabled: full,
|
|
@@ -855,7 +850,7 @@ export function InstanceNav({ route, items, loaded = true, exec = {}, awaiting =
|
|
|
855
850
|
<span class="inst-text"><span class="inst-line"><span class="inst-name" title=${label}>${label}</span>
|
|
856
851
|
${!compact ? html`<span class="v-meta">${it.runtime === "windows" ? "Windows" : it.context_pct != null ? `${Math.round(it.context_pct)}%` : ""}</span>` : null}</span>
|
|
857
852
|
${two ? html`<span class="inst-line inst-line2">${!compact ? html`<span class="inst-alt" title=${secondary || undefined}>${secondary || ""}</span>` : null}
|
|
858
|
-
${act ? html`<span class=${`inst-when${fade > 0 ? " fresh" : ""}`} title=${act.title}>${act.text}</span>` : null}</span>` : null}
|
|
853
|
+
${act ? html`<span class=${`inst-when${fade > 0 && act.person ? " fresh" : ""}`} title=${act.title}>${act.text}</span>` : null}</span>` : null}
|
|
859
854
|
${!compact && it.machine_id ? html`<span class=${`inst-machine${it.machine_status !== "online" ? " offline" : ""}`} title=${tn("tooltipMachine",{value:machineName(it.machine_id,it.machine_name)})}><span class="inst-machine-name">${machineName(it.machine_id,it.machine_name)}</span>${it.machine_status !== "online" ? html`<span class="inst-machine-status">${tn(it.machine_status === "revoked" ? "machineRevoked" : "machineOffline")}</span>` : null}</span>` : null}
|
|
860
855
|
${!compact && facet === "needs" ? html`<span class="inst-sub"><span class="badge-await" title=${waiting || t("app.approxNote")}>${t("app.needsYou")}</span></span>` : null}
|
|
861
856
|
<span class="sr-only">${tn("tooltipBackend", { value: backendLabel(it.backend) })}</span></span>
|
|
@@ -13,6 +13,7 @@ import { Icon } from "./ui-icons.js";
|
|
|
13
13
|
import { InfoTip } from "./info-tip.js";
|
|
14
14
|
import "./view-strings.js";
|
|
15
15
|
import { CompactMeter, level, resetClock, resetText, tn, usageClock, usageDuration, usageText, windowTag } from "./usage-meter.js";
|
|
16
|
+
import { dateTimeText } from "./clock-text.js";
|
|
16
17
|
// What this file exported before the meter moved out of it (#3321), for what imports it from here.
|
|
17
18
|
export { usageClock, windowTag, soonestReset } from "./usage-meter.js";
|
|
18
19
|
|
|
@@ -391,7 +392,7 @@ export function UsageBody({ owner }) {
|
|
|
391
392
|
${compact ? compactGroups(providers).map((g) => html`<${CompactGroup} key=${g.base} group=${g} mode=${modes[g.base] || "expanded"} onCycle=${(m) => setGroupMode(g.base, m)}
|
|
392
393
|
line=${({ p, i }) => (expanded.has(key(p)) ? card(p, i) : html`<${CompactRow} key=${key(p)} p=${p} one=${(modes[g.base] || "expanded") === "compact" && g.items.length > 1} onExpand=${() => toggleOne(key(p))} />`)} />`)
|
|
393
394
|
: providers.map((p, i) => card(p, i))}
|
|
394
|
-
<div class="u-foot"><span class="note" title=${
|
|
395
|
+
<div class="u-foot"><span class="note" title=${dateTimeText(data.fetchedAt)}>${failed ? html`${updatedAgo(data.fetchedAt)} · <span class="u-refresh-failed" role="status">${tn("usageRefreshFailed")}</span>` : data.refreshing ? html`<span class="u-refreshing">${tn("usageRefreshing")}</span>` : updatedAgo(data.fetchedAt)}</span>
|
|
395
396
|
${byAgent() ? html`<a class="btn btn-ghost btn-sm u-by-agent" href="/ui/fleet/usage" title=${tn("usageByAgentTitle")}>${tn("usageByAgent")}</a>` : null}
|
|
396
397
|
<button type="button" class="btn btn-sm" onClick=${() => load(true)}>${tn("usageRefresh")}</button></div>`;
|
|
397
398
|
}
|
|
@@ -272,13 +272,6 @@ register("view", {
|
|
|
272
272
|
"replyYesterday": "yesterday",
|
|
273
273
|
"replyDays": "{n} d ago",
|
|
274
274
|
"replyTitle": "Last replied: {time}",
|
|
275
|
-
"whenPerson": "Person {t}",
|
|
276
|
-
"whenAgent": "Agent {t}",
|
|
277
|
-
"whenBoth": "{p} · {a}",
|
|
278
|
-
"whenNow": "now",
|
|
279
|
-
"whenMin": "{n}m",
|
|
280
|
-
"whenHour": "{n}h",
|
|
281
|
-
"whenDay": "{n}d",
|
|
282
275
|
"whenPersonTitle": "Last reply to a person: {time}",
|
|
283
276
|
"whenAgentTitle": "Last turn another agent started (send_to_instance, a task, a report, a broadcast): {time}",
|
|
284
277
|
"sortTitle": "Sort the list",
|
|
@@ -565,13 +558,6 @@ register("view", {
|
|
|
565
558
|
"replyYesterday": "昨天",
|
|
566
559
|
"replyDays": "{n} 天前",
|
|
567
560
|
"replyTitle": "最後回覆:{time}",
|
|
568
|
-
"whenPerson": "人 {t}",
|
|
569
|
-
"whenAgent": "Agent {t}",
|
|
570
|
-
"whenBoth": "{p} · {a}",
|
|
571
|
-
"whenNow": "剛剛",
|
|
572
|
-
"whenMin": "{n} 分",
|
|
573
|
-
"whenHour": "{n} 小時",
|
|
574
|
-
"whenDay": "{n} 天",
|
|
575
561
|
"whenPersonTitle": "最後回覆人的時間:{time}",
|
|
576
562
|
"whenAgentTitle": "最後一次由其他 Agent 發起的回合(send_to_instance、任務、回報、廣播):{time}",
|
|
577
563
|
"sortTitle": "排序方式",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { html, useEffect, useLayoutEffect, useRef, useState } from "./app-html.js";
|
|
5
5
|
import { register, t } from "./app-i18n.js";
|
|
6
6
|
import { guestPage } from "./app-store.js";
|
|
7
|
+
import { dateTimeText, timeText } from "./clock-text.js";
|
|
7
8
|
|
|
8
9
|
register("webauth", {
|
|
9
10
|
en: {
|
|
@@ -93,8 +94,8 @@ const REASONS = ["disabled", "loopback_only", "no_account", "host_sign_in", "not
|
|
|
93
94
|
// Until when: the time, with the day when it isn't today (an authorization lasts up to 48 h).
|
|
94
95
|
const clock = (ms) => {
|
|
95
96
|
const d = new Date(ms), today = new Date().toDateString() === d.toDateString();
|
|
96
|
-
return today ? d
|
|
97
|
-
: d
|
|
97
|
+
return today ? timeText(d, { hour: "2-digit", minute: "2-digit" }, [])
|
|
98
|
+
: dateTimeText(d, { weekday: "short", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }, []);
|
|
98
99
|
};
|
|
99
100
|
const mmss = (ms) => { const s = Math.max(0, Math.ceil(ms / 1000)); return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`; };
|
|
100
101
|
|
package/dist/ui/subagent-row.js
CHANGED
|
@@ -3,6 +3,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
|
3
3
|
import { register, t } from "/assets/app-i18n.js";
|
|
4
4
|
import { ErrorState } from "/assets/ui-states.js";
|
|
5
5
|
import { assetUrl } from "/assets/asset-url.js";
|
|
6
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
6
7
|
register("subagents", {
|
|
7
8
|
en: { title: "Subagents", completed: "{0} finished", running: "{0} running", unknown: "{0} unconfirmed", parent: "Main Agent task: {0}", turn: "Main Agent task turn: {0}", done: "Finished", live: "Running", unsure: "Unconfirmed", seconds: "{0} s", elapsed: "{0} s elapsed", note: "A subagent's report is not the main Agent's final answer.", gap: "Some records are missing or no longer current. Their state is unconfirmed.", failed: "Subagent status could not be checked.", fallback: "Subagent", scroll: "Scroll to see all child runs.", bound: "Up to 16 recent child runs are shown." },
|
|
8
9
|
"zh-TW": { title: "子 Agent", completed: "{0} 已完成", running: "{0} 執行中", unknown: "{0} 待確認", parent: "主 Agent 工作:{0}", turn: "主 Agent 工作回合:{0}", done: "已完成", live: "執行中", unsure: "待確認", seconds: "{0} 秒", elapsed: "已經過 {0} 秒", note: "子 Agent 的回報不是主 Agent 的最終答覆。", gap: "部分紀錄缺漏或已不再是目前的紀錄,狀態待確認。", failed: "暫時無法確認子 Agent 的狀態。", fallback: "子 Agent", scroll: "捲動檢視所有子工作回合。", bound: "最多顯示最近 16 個子工作回合。" },
|
|
@@ -63,7 +64,7 @@ export function SubagentRow({ name }) {
|
|
|
63
64
|
for (const row of runs) { if (!groups.has(row.parentTurn)) groups.set(row.parentTurn, []); groups.get(row.parentTurn).push(row); }
|
|
64
65
|
return html`<details class="subagent-progress" data-trust="subagent-observation"><summary><span>${copy("title")}</span><span class="note">${counts.join(" · ")}</span></summary><p class="note subagent-scroll-hint">${copy("scroll")}</p><div class="subagent-scroll">
|
|
65
66
|
${value.error ? html`<${ErrorState} message=${copy("failed")} onRetry=${() => observer.current?.retry()} />` : null}
|
|
66
|
-
${[...groups].map(([turn, rows]) => html`<section key=${turn} class="subagent-group"><p class="note subagent-parent">${rows[0].parentTask ? copy("parent", rows[0].parentTask) : copy("turn",
|
|
67
|
+
${[...groups].map(([turn, rows]) => html`<section key=${turn} class="subagent-group"><p class="note subagent-parent">${rows[0].parentTask ? copy("parent", rows[0].parentTask) : copy("turn", dateTimeText(Math.min(...rows.map(r => r.parentStartedAt))))}</p>
|
|
67
68
|
${rows.map(r => html`<article key=${r.key} class="subagent-item"><div class="subagent-head"><strong>${r.name || copy("fallback")}</strong>${r.type ? html`<span class="note">${r.type}</span>` : null}<span class="tag">${copy(r.state === "completed" ? "done" : r.state === "running" ? "live" : "unsure")}</span></div>
|
|
68
69
|
<p>${r.task}</p>${r.state === "completed" && Number.isFinite(r.durationMs) ? html`<p class="note">${copy("seconds", (r.durationMs / 1000).toFixed(1).replace(/\.0$/, ""))}</p>` : r.state === "running" ? html`<p class="note">${copy("elapsed", Math.max(0, Math.floor((tick - r.startedAt) / 1000)))}</p>` : null}
|
|
69
70
|
${r.state === "completed" && r.summary ? html`<p class="subagent-report">${r.summary}</p>` : null}</article>`)}
|
package/dist/web-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ClaudeCredentialApi } from "./web-claude-credentials.js";
|
|
2
2
|
import { type ContactApiHost } from "./contact-auth-api.js";
|
|
3
|
-
import { type HumanOrigin } from "./human-delivery-receipts.js";
|
|
3
|
+
import { type HumanOrigin, type WebSessionIdentity } from "./human-delivery-receipts.js";
|
|
4
4
|
import { type HumanAuthority, type WebAuthorityResult, type WebPeer } from "./authority/web-authority.js";
|
|
5
5
|
import type { CachedImage } from "./web-images.js";
|
|
6
6
|
import type { SettingsExecution } from "./settings-transaction.js";
|
|
@@ -70,6 +70,11 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
70
70
|
decideContactAuthorization?: ContactApiHost["decideContactAuthorization"];
|
|
71
71
|
contactActor?(req: IncomingMessage, url: URL): import("./contact-auth-types.js").ContactPerson | null;
|
|
72
72
|
contactNeeds?(actor: import("./contact-auth-types.js").ContactPerson): unknown[];
|
|
73
|
+
/** M-3710: the pending contact requests' count and the oldest one's time — nothing that names them. */
|
|
74
|
+
contactPendingCount?(): {
|
|
75
|
+
count: number;
|
|
76
|
+
since: number;
|
|
77
|
+
};
|
|
73
78
|
acknowledgeContactSuggestion?(instance: string, actor: import("./contact-auth-types.js").ContactPerson): void;
|
|
74
79
|
acknowledgeContactSuggestionFromWeb?(instance: string, req: IncomingMessage, url: URL): void;
|
|
75
80
|
contactSuggestionActor?(req: IncomingMessage, url: URL): import("./contact-auth-types.js").ContactPerson | null;
|
|
@@ -424,6 +429,7 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
424
429
|
publicLink: boolean;
|
|
425
430
|
person?: WebPerson;
|
|
426
431
|
authority?: HumanAuthority;
|
|
432
|
+
identity?: WebSessionIdentity;
|
|
427
433
|
guest?: boolean;
|
|
428
434
|
}): Promise<{
|
|
429
435
|
status: number;
|
|
@@ -452,7 +458,9 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
452
458
|
expiresInMs?: number;
|
|
453
459
|
reason?: string;
|
|
454
460
|
};
|
|
455
|
-
/**
|
|
461
|
+
/** Session-account recognition only, independent of verification and action authority. */
|
|
462
|
+
webSessionIdentity?(session: SessionRecord): WebSessionIdentity | undefined;
|
|
463
|
+
/** #1939 S1: authority for one request; absent means no web authority. */
|
|
456
464
|
webAuthority?(input: {
|
|
457
465
|
session: SessionRecord | null;
|
|
458
466
|
gateway: boolean;
|
|
@@ -479,6 +487,10 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
479
487
|
message: string;
|
|
480
488
|
};
|
|
481
489
|
/** M-3632: Needs you → "Try again" on held Hub work. */
|
|
490
|
+
closeHubHeld?(id: string, actor: import("./contact-auth-types.js").ContactPerson): Promise<{
|
|
491
|
+
status: number;
|
|
492
|
+
code: string;
|
|
493
|
+
}>;
|
|
482
494
|
retryHubHeld?(id: string): {
|
|
483
495
|
status: number;
|
|
484
496
|
code: string;
|
|
@@ -555,6 +567,7 @@ export interface WebApiContext extends ClaudeCredentialApi {
|
|
|
555
567
|
name: string;
|
|
556
568
|
guest?: true;
|
|
557
569
|
authority?: HumanAuthority;
|
|
570
|
+
identity?: WebSessionIdentity;
|
|
558
571
|
}): Promise<{
|
|
559
572
|
status: number;
|
|
560
573
|
error?: string;
|
package/dist/web-api.js
CHANGED
|
@@ -241,7 +241,12 @@ function contactNeedsFor(req, url, ctx, base) {
|
|
|
241
241
|
// A session identity may see benign room suggestions, never pending approval tickets.
|
|
242
242
|
const suggestions = observer && ctx.contactNeeds ? ctx.contactNeeds(observer).filter(item => item && typeof item === "object"
|
|
243
243
|
&& item.reason === "contact_restricted_suggestion") : [];
|
|
244
|
-
|
|
244
|
+
// M-3710 (R21079937, 11-25: a pending request was in no list, even on this computer): an admin session with no verified
|
|
245
|
+
// person behind it is told how many requests wait and to authorize this browser — the count only, never which.
|
|
246
|
+
const waiting = admin ? ctx.contactPendingCount?.() : undefined;
|
|
247
|
+
const verify = waiting && waiting.count > 0 ? [{ id: "contact-verify", type: "contact", reason: "contact_verify_needed", instance: "",
|
|
248
|
+
since: waiting.since, detail: "", contactVerify: { count: waiting.count } }] : [];
|
|
249
|
+
return [...ordinary, ...verify, ...suggestions];
|
|
245
250
|
}
|
|
246
251
|
/**
|
|
247
252
|
* The task board's rule over the public link: an instance kept out of sight (cross_instance_visibility: hidden) is not
|
|
@@ -936,7 +941,7 @@ function handlePageShare(req, res, url, ctx, path, method) {
|
|
|
936
941
|
}
|
|
937
942
|
/**
|
|
938
943
|
* #2716/#3679: an Office-wide setting kept in web-offices.json beside the offices (PUT { <key>: value }): who may save
|
|
939
|
-
* the offices may set it — an admin session
|
|
944
|
+
* the offices may set it — an admin session (over the public link too, M-3278), never the CLI token; asked again once the body is in;
|
|
940
945
|
* counted with the offices' saves (OfficeWriteLimiter); every page hears `offices` and reads again.
|
|
941
946
|
*/
|
|
942
947
|
function officeSettingPut(req, res, url, ctx, o) {
|
|
@@ -2332,6 +2337,11 @@ function webPersonOf(req, url, ctx) {
|
|
|
2332
2337
|
const who = webAccountOf(req, url, ctx);
|
|
2333
2338
|
return who ? ctx.webPerson(who.owner) : null;
|
|
2334
2339
|
}
|
|
2340
|
+
/** Current session recognition only; no header token, body, display name or voter key supplies an account. */
|
|
2341
|
+
function webIdentityOf(req, url, ctx) {
|
|
2342
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
2343
|
+
return v.kind === "allow" && v.via === "session" ? ctx.webSessionIdentity?.(v.session) : undefined;
|
|
2344
|
+
}
|
|
2335
2345
|
/**
|
|
2336
2346
|
* #1939 S1: whether this request carries `web-session` authority, asked as it stands now — on arrival without an instance,
|
|
2337
2347
|
* after the body with the one it names (then confirmAfterBody joins the two). Never touches the session.
|
|
@@ -3909,8 +3919,9 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3909
3919
|
// ── Fleet → Org chart → Office: the offices people made (web-offices.json, web-office-store.ts) ──
|
|
3910
3920
|
// GET /ui/offices: { rev, offices, readable } for whoever may open the org chart (the public link too: it reads the
|
|
3911
3921
|
// chart; a guest's routes do not include it). PUT /ui/offices { offices, rev? }: a person's change, as a theme's reset
|
|
3912
|
-
// or lock is — an admin session only
|
|
3913
|
-
// refused
|
|
3922
|
+
// or lock is — an admin session only (over the public link too since M-3278, decision 7933bf90; a read-only session
|
|
3923
|
+
// there is refused below), never the CLI token; asked again once the body is in. Every page hears `offices` on the
|
|
3924
|
+
// stream and reads again.
|
|
3914
3925
|
if (method === "GET" && path === "/ui/offices") {
|
|
3915
3926
|
const store = ctx.officeStore;
|
|
3916
3927
|
if (!store) {
|
|
@@ -3998,7 +4009,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3998
4009
|
}
|
|
3999
4010
|
// #2716: PUT /ui/office-style { skin }: the whole-fleet office's style for every viewer, device and share link (a skin
|
|
4000
4011
|
// id, or null for the default; read back as GET /ui/offices's autoSkin). Who may save the offices may set it, as they
|
|
4001
|
-
// would: an admin session
|
|
4012
|
+
// would: an admin session (over the public link too, M-3278), never the CLI token; asked again once the body is in; counted with the
|
|
4002
4013
|
// offices' saves. Every page hears `offices` and reads again.
|
|
4003
4014
|
if (method === "PUT" && path === "/ui/office-style") {
|
|
4004
4015
|
return officeSettingPut(req, res, url, ctx, { key: "skin", invalid: "office_style_invalid", shape: "{ skin: a skin id, or null }", failed: "Saving the office style failed",
|
|
@@ -4278,7 +4289,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
4278
4289
|
return;
|
|
4279
4290
|
// #1920 review: a guest's choice reaches the agent marked as a guest's, as its typed messages do.
|
|
4280
4291
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, url, ctx, instance));
|
|
4281
|
-
const
|
|
4292
|
+
const identity = webIdentityOf(req, url, ctx);
|
|
4293
|
+
const r = await click(instance, id, index, { key: person.voterKey, userId: person.userId, name: person.name, ...(guest ? { guest: true } : {}), authority, ...(identity ? { identity } : {}) });
|
|
4282
4294
|
json(res, r.status, r.status === 200 ? { answered: true, ...(r.options ? { options: r.options } : {}) } : { error: r.error ?? "Refused", ...(r.status === 409 ? { gone: true } : {}) });
|
|
4283
4295
|
})().catch(err => {
|
|
4284
4296
|
ctx.logger.error({ err: err.message }, "Web reply-button click failed");
|
|
@@ -4744,12 +4756,48 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
4744
4756
|
});
|
|
4745
4757
|
return true;
|
|
4746
4758
|
}
|
|
4759
|
+
if (method === "POST" && path === "/ui/needs/hub-close") {
|
|
4760
|
+
(async () => {
|
|
4761
|
+
let body;
|
|
4762
|
+
try {
|
|
4763
|
+
body = await parseBody(req);
|
|
4764
|
+
}
|
|
4765
|
+
catch {
|
|
4766
|
+
json(res, 400, { error: "invalid" });
|
|
4767
|
+
return;
|
|
4768
|
+
}
|
|
4769
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
4770
|
+
return;
|
|
4771
|
+
const actor = ctx.contactActor?.(req, url);
|
|
4772
|
+
if (!actor) {
|
|
4773
|
+
json(res, 403, { error: "verification-required", code: "verification-required" });
|
|
4774
|
+
return;
|
|
4775
|
+
}
|
|
4776
|
+
if (typeof body.id !== "string" || body.id.length > 200) {
|
|
4777
|
+
json(res, 400, { error: "invalid" });
|
|
4778
|
+
return;
|
|
4779
|
+
}
|
|
4780
|
+
if (!ctx.closeHubHeld) {
|
|
4781
|
+
json(res, 503, { error: "unavailable", code: "unavailable" });
|
|
4782
|
+
return;
|
|
4783
|
+
}
|
|
4784
|
+
const out = await ctx.closeHubHeld(body.id, actor);
|
|
4785
|
+
json(res, out.status, { code: out.code, ...(out.status === 200 ? { ok: true } : { error: out.code }) });
|
|
4786
|
+
})().catch(() => { if (!res.headersSent)
|
|
4787
|
+
json(res, 503, { error: "unavailable", code: "unavailable" }); });
|
|
4788
|
+
return true;
|
|
4789
|
+
}
|
|
4747
4790
|
// M-3632: Needs you → "Try again" on held Hub work: back through the Hub's checks, never a blind delivery.
|
|
4748
4791
|
if (method === "POST" && path === "/ui/needs/hub-retry") {
|
|
4749
4792
|
if (!ctx.retryHubHeld) {
|
|
4750
4793
|
json(res, 404, { error: "not-found", code: "not-found" });
|
|
4751
4794
|
return true;
|
|
4752
4795
|
}
|
|
4796
|
+
// M-3680: over the public link, an admin session's (decision 7933bf90); a read-only session or a guest there: no.
|
|
4797
|
+
if (linkRestricted(req, url, ctx)) {
|
|
4798
|
+
json(res, 403, { error: "forbidden", code: "forbidden" });
|
|
4799
|
+
return true;
|
|
4800
|
+
}
|
|
4753
4801
|
const retry = ctx.retryHubHeld.bind(ctx);
|
|
4754
4802
|
(async () => {
|
|
4755
4803
|
let body;
|
|
@@ -5000,10 +5048,11 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5000
5048
|
}
|
|
5001
5049
|
try {
|
|
5002
5050
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, url, ctx, instance));
|
|
5051
|
+
const identity = webIdentityOf(req, url, ctx);
|
|
5003
5052
|
const r = await run({ instance, command, args: str(body.args, MAX_COMMAND_ARGS), confirm: body.confirm, ...(body.action ? { action: body.action } : {}) },
|
|
5004
5053
|
// M-3278 (decision 7933bf90): `publicLink` is a request over the link by anyone but an admin session — the link's
|
|
5005
5054
|
// admin runs /save and gets /model and /backend's Sign in, as on the local dashboard.
|
|
5006
|
-
{ publicLink: !!gatewayRequestContext(req) && !adminAdmissionOf(req, url, ctx), person, authority, ...(guest ? { guest: true } : {}) });
|
|
5055
|
+
{ publicLink: !!gatewayRequestContext(req) && !adminAdmissionOf(req, url, ctx), person, authority, ...(identity ? { identity } : {}), ...(guest ? { guest: true } : {}) });
|
|
5007
5056
|
if (!stillAuthorized(req, res, url, ctx))
|
|
5008
5057
|
return;
|
|
5009
5058
|
json(res, r.status, r.body);
|
|
@@ -5642,7 +5691,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5642
5691
|
return verdict.kind !== "allow" || (verdict.via === "session" && verdict.session?.tier !== "admin");
|
|
5643
5692
|
};
|
|
5644
5693
|
if (method === "POST" && path === "/ui/schedules") {
|
|
5645
|
-
// #1724:
|
|
5694
|
+
// #1724: an admin session's (M-3278, decision 7933bf90: over the public link too).
|
|
5646
5695
|
if (!ctx.scheduler) {
|
|
5647
5696
|
json(res, 500, { error: "Scheduler not initialized" });
|
|
5648
5697
|
return true;
|
|
@@ -5890,7 +5939,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5890
5939
|
return true;
|
|
5891
5940
|
}
|
|
5892
5941
|
if (method === "POST" && path === "/ui/teams") {
|
|
5893
|
-
// #1689:
|
|
5942
|
+
// #1689: an admin session's (M-3278, decision 7933bf90: over the public link too), like editing and deleting a team.
|
|
5894
5943
|
(async () => {
|
|
5895
5944
|
try {
|
|
5896
5945
|
const body = await parseBody(req);
|
|
@@ -5920,7 +5969,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
5920
5969
|
return true;
|
|
5921
5970
|
}
|
|
5922
5971
|
// #1689: edit a team — the same update as the update_team tool (applyTeamUpdate), from the members the page sends:
|
|
5923
|
-
// what to add and remove is worked out against the team as it is now.
|
|
5972
|
+
// what to add and remove is worked out against the team as it is now. An admin session's, over the public link too (M-3278).
|
|
5924
5973
|
const teamEditMatch = path.match(/^\/ui\/teams\/(.+)$/);
|
|
5925
5974
|
if ((method === "PATCH" || method === "PUT") && teamEditMatch) {
|
|
5926
5975
|
const name = decodeURIComponent(teamEditMatch[1]);
|
|
@@ -6242,7 +6291,7 @@ async function handleResendMessage(req, res, ctx) {
|
|
|
6242
6291
|
} };
|
|
6243
6292
|
let handedOff = false;
|
|
6244
6293
|
try {
|
|
6245
|
-
const delivered = ctx.deliverHumanToInstance ? await ctx.deliverHumanToInstance(instance, payload, webHumanOrigin(false, authority), row.text, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
6294
|
+
const delivered = ctx.deliverHumanToInstance ? await ctx.deliverHumanToInstance(instance, payload, webHumanOrigin(false, authority, webIdentityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx)), row.text, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
6246
6295
|
: await ctx.deliverToInstance(instance, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
6247
6296
|
if (delivered === false)
|
|
6248
6297
|
throw new Error("delivery changed");
|
|
@@ -6494,7 +6543,7 @@ function handleSendMessage(req, res, ctx) {
|
|
|
6494
6543
|
const reactions = ctx.pendingReactionsMeta?.(instance) ?? { meta: {}, consume: () => { } };
|
|
6495
6544
|
try {
|
|
6496
6545
|
const deliver = (name, payload) => ctx.deliverHumanToInstance
|
|
6497
|
-
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
6546
|
+
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority, webIdentityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx)), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
6498
6547
|
: ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
6499
6548
|
delivered = await deliver(instance, {
|
|
6500
6549
|
type: "fleet_inbound",
|
|
@@ -6928,7 +6977,7 @@ function shellOwnerCss(ctx, mode, viewer) {
|
|
|
6928
6977
|
/**
|
|
6929
6978
|
* AgEnD Hub P1 (docs/design/hub.md, docs/design/hub-ui-client.md): the page's Hub mark — presentation only, never
|
|
6930
6979
|
* authority, set by the listener that serves the page (never a client's choice): `member` on this fleet's listener when
|
|
6931
|
-
* `hub_member.enabled
|
|
6980
|
+
* `hub_member.enabled` (over the public link, an admin session's only: M-3278). `hub` is only the Hub listener's own workspace page
|
|
6932
6981
|
* (serveHubWorkspaceShell). Nothing otherwise: no Hub UI is drawn and no Hub module loads.
|
|
6933
6982
|
*/
|
|
6934
6983
|
function hubBodyAttrs(req, ctx) {
|