@songsid/agend 2.4.0-beta.10 → 2.4.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts-view.d.ts +29 -0
- package/dist/accounts-view.js +2 -14
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +4 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +29 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +35 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-precaution.d.ts +7 -0
- package/dist/backend/codex-precaution.js +102 -0
- package/dist/backend/codex-precaution.js.map +1 -0
- package/dist/backend/codex.d.ts +1 -0
- package/dist/backend/codex.js +18 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok.js +21 -6
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +9 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +1 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-install-kind.d.ts +19 -0
- package/dist/claude-install-kind.js +54 -0
- package/dist/claude-install-kind.js.map +1 -0
- package/dist/cli-audited.js +3 -3
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.d.ts +5 -0
- package/dist/daemon.js +22 -4
- package/dist/daemon.js.map +1 -1
- package/dist/event-log.d.ts +12 -0
- package/dist/event-log.js +40 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-manager.d.ts +122 -2
- package/dist/fleet-manager.js +482 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +38 -6
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -1
- package/dist/hub/admin-dashboard.js +3 -3
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog-model.d.ts +276 -0
- package/dist/hub/agent-catalog-model.js +49 -0
- package/dist/hub/agent-catalog-model.js.map +1 -0
- package/dist/hub/agent-catalog.d.ts +137 -0
- package/dist/hub/agent-catalog.js +118 -0
- package/dist/hub/agent-catalog.js.map +1 -0
- package/dist/hub/agent-intro-model.d.ts +38 -0
- package/dist/hub/agent-intro-model.js +14 -0
- package/dist/hub/agent-intro-model.js.map +1 -0
- package/dist/hub/agent-intro-tool.d.ts +35 -0
- package/dist/hub/agent-intro-tool.js +83 -0
- package/dist/hub/agent-intro-tool.js.map +1 -0
- package/dist/hub/agent-intro.d.ts +31 -0
- package/dist/hub/agent-intro.js +51 -0
- package/dist/hub/agent-intro.js.map +1 -0
- package/dist/hub/catalog.d.ts +4 -2
- package/dist/hub/catalog.js +19 -3
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +3 -0
- package/dist/hub/client.js +47 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +19 -5
- package/dist/hub/compose/member.js +94 -13
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +5 -0
- package/dist/hub/compose/server.js +6 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/execution/service.d.ts +1 -1
- package/dist/hub/execution/service.js +1 -0
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/http/compose.d.ts +3 -0
- package/dist/hub/http/compose.js +122 -15
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +15 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/mcp/tools.js +2 -1
- package/dist/hub/mcp/tools.js.map +1 -1
- package/dist/hub/member/agent-catalog.d.ts +28 -0
- package/dist/hub/member/agent-catalog.js +80 -0
- package/dist/hub/member/agent-catalog.js.map +1 -0
- package/dist/hub/member/agent-intro.d.ts +28 -0
- package/dist/hub/member/agent-intro.js +66 -0
- package/dist/hub/member/agent-intro.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +3 -3
- package/dist/hub/member/exposure-api.js +4 -4
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +12 -4
- package/dist/hub/member/exposures.js +27 -13
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +14 -1
- package/dist/hub/member/room-ask.js +76 -10
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-context-budget.d.ts +5 -0
- package/dist/hub/member/room-context-budget.js +34 -0
- package/dist/hub/member/room-context-budget.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +1 -1
- package/dist/hub/member/room-post.d.ts +6 -3
- package/dist/hub/member/room-post.js +9 -3
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/sharing-journal.d.ts +252 -0
- package/dist/hub/member/sharing-journal.js +212 -0
- package/dist/hub/member/sharing-journal.js.map +1 -0
- package/dist/hub/member/sharing-link.d.ts +25 -0
- package/dist/hub/member/sharing-link.js +68 -0
- package/dist/hub/member/sharing-link.js.map +1 -0
- package/dist/hub/member/sharing-result.d.ts +6 -0
- package/dist/hub/member/sharing-result.js +46 -0
- package/dist/hub/member/sharing-result.js.map +1 -0
- package/dist/hub/member/sharing.d.ts +37 -0
- package/dist/hub/member/sharing.js +181 -0
- package/dist/hub/member/sharing.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +6 -0
- package/dist/hub/personal/owner-host.js +4 -2
- package/dist/hub/personal/owner-host.js.map +1 -1
- package/dist/hub/protocol.d.ts +398 -4
- package/dist/hub/protocol.js +13 -5
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-answer-status-model.d.ts +3 -0
- package/dist/hub/room-answer-status-model.js +4 -0
- package/dist/hub/room-answer-status-model.js.map +1 -0
- package/dist/hub/room-brief-model.d.ts +30 -0
- package/dist/hub/room-brief-model.js +37 -0
- package/dist/hub/room-brief-model.js.map +1 -0
- package/dist/hub/room-context-model.d.ts +2 -0
- package/dist/hub/room-context-model.js +2 -2
- package/dist/hub/room-context-model.js.map +1 -1
- package/dist/hub/room-members-model.d.ts +63 -0
- package/dist/hub/room-members-model.js +7 -0
- package/dist/hub/room-members-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +1 -0
- package/dist/hub/rooms/agents.js +62 -11
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/brief.d.ts +18 -0
- package/dist/hub/rooms/brief.js +39 -0
- package/dist/hub/rooms/brief.js.map +1 -0
- package/dist/hub/rooms/direct-view.d.ts +5 -1
- package/dist/hub/rooms/direct-view.js +2 -2
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/members-page.d.ts +33 -0
- package/dist/hub/rooms/members-page.js +37 -0
- package/dist/hub/rooms/members-page.js.map +1 -0
- package/dist/hub/rooms/purpose.d.ts +7 -0
- package/dist/hub/rooms/purpose.js +14 -0
- package/dist/hub/rooms/purpose.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +43 -0
- package/dist/hub/rooms/service.js +80 -22
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +6 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +9 -4
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +49 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sharing-previous-access.d.ts +22 -0
- package/dist/hub/sharing-previous-access.js +93 -0
- package/dist/hub/sharing-previous-access.js.map +1 -0
- package/dist/hub/sharing-requests.d.ts +171 -0
- package/dist/hub/sharing-requests.js +311 -0
- package/dist/hub/sharing-requests.js.map +1 -0
- package/dist/hub/sharing-retention.d.ts +47 -0
- package/dist/hub/sharing-retention.js +83 -0
- package/dist/hub/sharing-retention.js.map +1 -0
- package/dist/hub/sharing-withdrawal.d.ts +14 -0
- package/dist/hub/sharing-withdrawal.js +28 -0
- package/dist/hub/sharing-withdrawal.js.map +1 -0
- package/dist/hub/types.d.ts +13 -5
- package/dist/hub-page-sharing-settings.d.ts +6 -0
- package/dist/hub-page-sharing-settings.js +19 -0
- package/dist/hub-page-sharing-settings.js.map +1 -0
- package/dist/hub-room-reply-warning.d.ts +2 -0
- package/dist/hub-room-reply-warning.js +16 -0
- package/dist/hub-room-reply-warning.js.map +1 -0
- package/dist/hub-sharing-notice.d.ts +43 -0
- package/dist/hub-sharing-notice.js +34 -0
- package/dist/hub-sharing-notice.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +15 -0
- package/dist/instance-lifecycle.js +36 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +78 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +26 -0
- package/dist/login-controller.js +72 -2
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-flows.js.map +1 -1
- package/dist/native-mcp.js +1 -1
- package/dist/native-mcp.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 +6 -0
- 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 +2 -1
- package/dist/outbound-handlers.js +17 -4
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +10 -0
- package/dist/outbound-schemas.js +3 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +9 -3
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/remote-card-answer.d.ts +1 -1
- package/dist/remote-card-answer.js +8 -1
- package/dist/remote-card-answer.js.map +1 -1
- package/dist/remote-card-prompt.js +1 -1
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +84 -10
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +3 -0
- package/dist/settings-baseline.js +2 -2
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +3 -0
- package/dist/settings-effect.js +33 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/fleet-office-card.js +8 -4
- package/dist/ui/fleet-office-pack.d.ts +1 -0
- package/dist/ui/fleet-office-pack.js +6 -2
- package/dist/ui/fleet-office-play.js +84 -0
- package/dist/ui/fleet-office-store.js +23 -0
- package/dist/ui/fleet-office-zones.js +5 -1
- package/dist/ui/fleet-office.js +78 -8
- package/dist/ui/host-install.js +77 -3
- package/dist/ui/hub-agent-intro.js +35 -0
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-strings.js +4 -4
- package/dist/ui/hub-client.js +16 -1
- package/dist/ui/hub-grant-picker.js +25 -11
- package/dist/ui/hub-group-strings.js +3 -3
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-my-agents-model.js +42 -0
- package/dist/ui/hub-my-agents-strings.js +18 -0
- package/dist/ui/hub-my-agents.js +144 -0
- package/dist/ui/hub-owner-strings.js +5 -5
- package/dist/ui/hub-personal-agent.js +5 -4
- package/dist/ui/hub-room-composer.js +37 -6
- package/dist/ui/hub-room-list.js +4 -3
- package/dist/ui/hub-room-members.js +5 -2
- package/dist/ui/hub-room-new.js +8 -5
- package/dist/ui/hub-room-purpose.js +19 -0
- package/dist/ui/hub-room-search.js +1 -1
- package/dist/ui/hub-room-settings.js +9 -0
- package/dist/ui/hub-room-strings.js +6 -4
- package/dist/ui/hub-room-thread.js +70 -17
- package/dist/ui/hub-strings.js +5 -5
- package/dist/ui/hub-welcome.js +6 -6
- package/dist/ui/notice-hub-sharing.js +81 -0
- package/dist/ui/panel-chat.js +19 -5
- package/dist/ui/panel-hub.js +77 -29
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/settings-hub-connection.js +2 -2
- package/dist/ui/settings-hub-page-sharing.js +52 -0
- package/dist/ui/settings-hub.js +4 -2
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +14 -2
- package/dist/ui/shared/app-store.js +6 -2
- package/dist/ui/shared/app.js +3 -1
- package/dist/ui/shared/chat-msg-actions.js +3 -1
- package/dist/ui/shared/chat-quote.js +261 -0
- package/dist/ui/shared/hub-chat.css +31 -0
- package/dist/ui/shared/hub-my-agents.css +35 -0
- package/dist/ui/shared/hub-rooms-u2.css +5 -0
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/web-api.d.ts +21 -5
- package/dist/web-api.js +138 -7
- package/dist/web-api.js.map +1 -1
- package/dist/web-asset-version.d.ts +65 -0
- package/dist/web-asset-version.js +259 -0
- package/dist/web-asset-version.js.map +1 -0
- package/dist/web-host-guard.js +3 -1
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-host-install.d.ts +30 -3
- package/dist/web-host-install.js +50 -4
- package/dist/web-host-install.js.map +1 -1
- package/dist/web-notices.d.ts +17 -0
- package/dist/web-notices.js +47 -6
- package/dist/web-notices.js.map +1 -1
- package/dist/web-terminal.d.ts +5 -0
- package/dist/web-terminal.js +11 -0
- package/dist/web-terminal.js.map +1 -1
- package/launcher/agend-install.cjs +48 -7
- package/package.json +1 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// M-2789 (the user, 11-09): answer a long, multi-part message passage by passage. Select text in ONE message of the thread
|
|
2
|
+
// → a small 「引用」 pill → the passage goes into the composer as a Markdown quote ("> …") at the caret, on its own lines,
|
|
3
|
+
// the caret left on the next line for the answer. Repeatable: quote, answer, quote the next passage, answer…
|
|
4
|
+
//
|
|
5
|
+
// - Desktop: the pill is anchored to where the selection ends (a pointer at the exact spot), below that line — clear of
|
|
6
|
+
// the browser's own menu above a selection (Edge's mini menu sits there, and a page can't turn it off; M-2872) — and
|
|
7
|
+
// above it only when there is no room below in the thread's visible box. After a quote the composer takes the focus.
|
|
8
|
+
// - Phone (a coarse pointer): the pill 「引用選取的文字」 docks above the composer's whole box inside the 16-px gutter — clear
|
|
9
|
+
// of the system's own copy toolbar (above a selection) and of the finger — or at the top of the thread when the
|
|
10
|
+
// passage sits there. The keyboard does NOT open after a quote (the user's choice): more passages can be selected;
|
|
11
|
+
// the composer's own scroller shows the caret and the newest quote.
|
|
12
|
+
// - No pill for a selection across messages, outside the thread, or on a page that can't send; no keyboard shortcut
|
|
13
|
+
// (the user's choice). The whole-message Reply (#2272) is unchanged, and so is the browser's menu on selected text.
|
|
14
|
+
// - What is sent is the composer's text as typed: the agent reads the "> " lines as written; the web renders them as
|
|
15
|
+
// blockquotes (chat-render.js); Discord's mirror shows them as quotes, Telegram's as the same plain lines.
|
|
16
|
+
//
|
|
17
|
+
// Its own words and drawing (a page that loaded an older chat-strings.js or ui-icons.js still draws it), CSSOM only
|
|
18
|
+
// (no style attribute: #1300), the shared popover look (.msg-menu) with the shared border and shadow tokens.
|
|
19
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
20
|
+
|
|
21
|
+
register("chatQuote", {
|
|
22
|
+
en: { quote: "Quote", quotePhone: "Quote selection", label: "Quote the selected text in your message" },
|
|
23
|
+
"zh-TW": { quote: "引用", quotePhone: "引用選取的文字", label: "把選取的文字引用到你的訊息裡" },
|
|
24
|
+
});
|
|
25
|
+
const tq = (k) => t(`chatQuote.${k}`);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Where the person's caret was in the composer when it last lost the focus — what a quote goes in at. A field's own
|
|
29
|
+
* selectionStart can't be trusted after the page's selection moved into the thread (Chrome resets it), so it is kept
|
|
30
|
+
* here, with the text it belongs to (a caret for another text is no caret).
|
|
31
|
+
*/
|
|
32
|
+
const remembered = new WeakMap();
|
|
33
|
+
export function composerCaret(field, value) {
|
|
34
|
+
if (!field) return value.length;
|
|
35
|
+
const r = remembered.get(field);
|
|
36
|
+
if (r && r.value === value) return r.caret;
|
|
37
|
+
const doc = field.ownerDocument;
|
|
38
|
+
if (doc && doc.activeElement === field && field.value === value) return field.selectionStart ?? value.length;
|
|
39
|
+
return value.length;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The passage as Markdown quote lines: each line "> line" (an empty one "> " keeps the quote one block). */
|
|
43
|
+
export function quoteBlock(text) {
|
|
44
|
+
const lines = String(text ?? "").replace(/\r\n?/g, "\n").replace(/ /g, " ").split("\n").map((l) => l.replace(/\s+$/, ""));
|
|
45
|
+
while (lines.length && !lines[0].trim()) lines.shift();
|
|
46
|
+
while (lines.length && !lines[lines.length - 1].trim()) lines.pop();
|
|
47
|
+
// A run of empty lines inside the passage becomes one quoted empty line.
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const l of lines) { if (!l.trim() && out.length && out[out.length - 1] === ">") continue; out.push(l.trim() ? `> ${l}` : ">"); }
|
|
50
|
+
return out.join("\n");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Put the passage into `value` at `caret`, on its own lines: a blank line before it when text precedes on the line or
|
|
55
|
+
* just above, the caret on the line after it (for the answer), and a line break before any text that follows.
|
|
56
|
+
* Returns { value, caret }, or null for a passage with nothing to quote.
|
|
57
|
+
*/
|
|
58
|
+
export function insertQuote(value, caret, text) {
|
|
59
|
+
const block = quoteBlock(text);
|
|
60
|
+
if (!block) return null;
|
|
61
|
+
const v = String(value ?? "");
|
|
62
|
+
const at = Math.max(0, Math.min(Number.isInteger(caret) ? caret : v.length, v.length));
|
|
63
|
+
const before = v.slice(0, at), after = v.slice(at);
|
|
64
|
+
const lead = !before ? "" : before.endsWith("\n\n") ? "" : before.endsWith("\n") ? "\n" : "\n\n";
|
|
65
|
+
const head = before + lead + block + "\n";
|
|
66
|
+
// Text after the caret starts its own line below the answer's (its leading spaces dropped with the break).
|
|
67
|
+
const tail = after && !after.startsWith("\n") ? "\n" + after.replace(/^[ \t]+/, "") : after;
|
|
68
|
+
return { value: head + tail, caret: head.length };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The selected passage when it lies inside one message's text of `list`, else null. { text, el, rects }. */
|
|
72
|
+
export function selectedPassage(list, sel) {
|
|
73
|
+
if (!sel || sel.isCollapsed || !sel.rangeCount) return null;
|
|
74
|
+
const text = String(sel.toString() || "");
|
|
75
|
+
if (!text.trim()) return null;
|
|
76
|
+
const msg = (n) => { const e = n && (n.nodeType === 1 ? n : n.parentElement); return e && e.closest ? e.closest(".msg[data-key]") : null; };
|
|
77
|
+
// The message's own words, not its header (sender, time) or its action strip.
|
|
78
|
+
const inBody = (n) => { const e = n && (n.nodeType === 1 ? n : n.parentElement); return !!(e && e.closest && e.closest(".body, .md") && !e.closest(".meta, .msg-actions")); };
|
|
79
|
+
// Every range of the selection (a browser may keep several: #3555 review P3) in the same message's words — what is
|
|
80
|
+
// quoted is the whole selection's text.
|
|
81
|
+
const range = sel.getRangeAt(0), a = msg(range.startContainer);
|
|
82
|
+
if (!a || !list.contains(a)) return null;
|
|
83
|
+
for (let i = 0; i < sel.rangeCount; i++) {
|
|
84
|
+
const rg = sel.getRangeAt(i);
|
|
85
|
+
if (msg(rg.startContainer) !== a || msg(rg.endContainer) !== a || !inBody(rg.startContainer) || !inBody(rg.endContainer)) return null;
|
|
86
|
+
}
|
|
87
|
+
return { text, el: a, range };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Where the composer's caret sits, in px from the top of its text (a mirror of the field's text box up to the caret).
|
|
92
|
+
* Used to show the caret without focusing the field (a phone: the keyboard stays down).
|
|
93
|
+
*/
|
|
94
|
+
export function caretTop(field, pos) {
|
|
95
|
+
const doc = field.ownerDocument, win = doc.defaultView;
|
|
96
|
+
if (!win || !win.getComputedStyle) return 0;
|
|
97
|
+
const cs = win.getComputedStyle(field);
|
|
98
|
+
const m = doc.createElement("div");
|
|
99
|
+
for (const p of ["box-sizing", "width", "padding-top", "padding-right", "padding-bottom", "padding-left", "border-top-width", "border-right-width",
|
|
100
|
+
"border-bottom-width", "border-left-width", "font-family", "font-size", "font-weight", "font-style", "line-height", "letter-spacing", "word-spacing", "tab-size"]) {
|
|
101
|
+
m.style.setProperty(p, cs.getPropertyValue(p));
|
|
102
|
+
}
|
|
103
|
+
for (const [k, v] of [["position", "absolute"], ["visibility", "hidden"], ["top", "0"], ["left", "-9999px"], ["white-space", "pre-wrap"], ["overflow-wrap", "break-word"], ["height", "auto"]]) m.style.setProperty(k, v);
|
|
104
|
+
m.textContent = field.value.slice(0, pos);
|
|
105
|
+
const mark = doc.createElement("span"); mark.textContent = ""; m.append(mark);
|
|
106
|
+
doc.body.append(m);
|
|
107
|
+
const y = mark.offsetTop, h = mark.offsetHeight;
|
|
108
|
+
m.remove();
|
|
109
|
+
return { y, h };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Scroll the field's own scroller so the caret (and the lines just above it: the newest quote) are in view. */
|
|
113
|
+
export function showCaret(field, pos) {
|
|
114
|
+
// At the end (the usual case: the newest quote is the last thing in the box): the bottom.
|
|
115
|
+
if (pos >= field.value.length) { field.scrollTop = field.scrollHeight; return; }
|
|
116
|
+
const c = caretTop(field, pos);
|
|
117
|
+
if (!c || typeof c !== "object") { field.scrollTop = field.scrollHeight; return; }
|
|
118
|
+
const view = field.clientHeight;
|
|
119
|
+
if (c.y + c.h > field.scrollTop + view) field.scrollTop = Math.max(0, c.y + c.h - view + 4);
|
|
120
|
+
else if (c.y < field.scrollTop) field.scrollTop = Math.max(0, c.y - 4);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// The quote mark: two marks on the shared 24-px grid, 2-px stroke, currentColor (as ui-icons.js draws).
|
|
124
|
+
const ICON = "M4 11h5v6H4v-6zm0 0c0-3 1.5-5 4-6M14 11h5v6h-5v-6zm0 0c0-3 1.5-5 4-6";
|
|
125
|
+
function iconEl(doc) {
|
|
126
|
+
const NS = "http://www.w3.org/2000/svg";
|
|
127
|
+
const svg = doc.createElementNS(NS, "svg");
|
|
128
|
+
for (const [k, v] of [["class", "icon"], ["width", "16"], ["height", "16"], ["viewBox", "0 0 24 24"], ["fill", "none"], ["stroke", "currentColor"], ["stroke-width", "2"],
|
|
129
|
+
["stroke-linecap", "round"], ["stroke-linejoin", "round"], ["aria-hidden", "true"], ["focusable", "false"]]) svg.setAttribute(k, v);
|
|
130
|
+
const p = doc.createElementNS(NS, "path"); p.setAttribute("d", ICON); svg.append(p);
|
|
131
|
+
return svg;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const overlap = (a, z) => Math.max(0, Math.min(a.right, z.right) - Math.max(a.left, z.left)) * Math.max(0, Math.min(a.bottom, z.bottom) - Math.max(a.top, z.top));
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Install the pill on `list` (the thread element). `deps`:
|
|
138
|
+
* field() → the composer's text field (marked data-touched once it has had the focus: its caret is the person's);
|
|
139
|
+
* canQuote() → boolean (a page that can send); insert(text) (the composer's side: see panel-chat.js);
|
|
140
|
+
* phone() → boolean (a coarse pointer); composerBox() → the composer's whole box (Element) or null; threadBox() → Element.
|
|
141
|
+
* Returns a function that removes everything.
|
|
142
|
+
*/
|
|
143
|
+
export function installQuoteSelection(list, deps) {
|
|
144
|
+
const doc = list.ownerDocument, win = doc.defaultView;
|
|
145
|
+
let pop = null, timer = null, down = false, current = null, drawnFor = "";
|
|
146
|
+
|
|
147
|
+
function hide() {
|
|
148
|
+
current = null; drawnFor = "";
|
|
149
|
+
if (!pop) return;
|
|
150
|
+
pop.remove(); pop = null;
|
|
151
|
+
}
|
|
152
|
+
function place(passage) {
|
|
153
|
+
const phone = !!deps.phone?.();
|
|
154
|
+
if (!pop) {
|
|
155
|
+
pop = doc.createElement("div");
|
|
156
|
+
pop.className = "msg-menu quote-pop";
|
|
157
|
+
pop.setAttribute("role", "toolbar"); pop.setAttribute("data-trust", "menu"); pop.setAttribute("aria-label", tq("label"));
|
|
158
|
+
const b = doc.createElement("button");
|
|
159
|
+
b.type = "button"; b.className = "menu-item quote-pick";
|
|
160
|
+
b.append(iconEl(doc));
|
|
161
|
+
const span = doc.createElement("span"); b.append(span);
|
|
162
|
+
// A press on the pill must not collapse the selection it is about (mousedown's default does, pointerdown's
|
|
163
|
+
// preventDefault alone doesn't); the passage is the one the pill was drawn for, whatever the selection did since.
|
|
164
|
+
b.addEventListener("pointerdown", (e) => { e.preventDefault(); });
|
|
165
|
+
b.addEventListener("mousedown", (e) => { e.preventDefault(); });
|
|
166
|
+
b.addEventListener("click", (e) => { e.preventDefault(); const text = drawnFor; hide(); if (text) { deps.insert(text); doc.getSelection?.()?.removeAllRanges?.(); } });
|
|
167
|
+
pop.append(b);
|
|
168
|
+
doc.body.append(pop);
|
|
169
|
+
}
|
|
170
|
+
pop.classList.toggle("is-phone", phone);
|
|
171
|
+
const label = pop.querySelector(".quote-pick span"); label.textContent = tq(phone ? "quotePhone" : "quote");
|
|
172
|
+
for (const old of pop.querySelectorAll(".quote-other")) old.remove();
|
|
173
|
+
for (const target of deps.targets?.() || []) {
|
|
174
|
+
const b = doc.createElement("button"); b.type = "button"; b.className = "menu-item quote-pick quote-other";
|
|
175
|
+
b.append(iconEl(doc));
|
|
176
|
+
const span = doc.createElement("span"); span.textContent = target.label; b.append(span); b.title = target.label;
|
|
177
|
+
b.addEventListener("pointerdown", e => e.preventDefault()); b.addEventListener("mousedown", e => e.preventDefault());
|
|
178
|
+
b.addEventListener("click", e => { e.preventDefault(); const text = drawnFor; hide(); if (text) target.insert(text); });
|
|
179
|
+
pop.append(b);
|
|
180
|
+
}
|
|
181
|
+
pop.querySelector(".quote-tip")?.remove();
|
|
182
|
+
const pr = pop.getBoundingClientRect();
|
|
183
|
+
const vw = win?.innerWidth ?? 1024;
|
|
184
|
+
const rects = [...(passage.range.getClientRects?.() ?? [])].filter((x) => x.width > 0);
|
|
185
|
+
if (!rects.length) { hide(); return; }
|
|
186
|
+
const last = rects[rects.length - 1];
|
|
187
|
+
let left, top, tip = null;
|
|
188
|
+
if (!phone) {
|
|
189
|
+
// Room is the thread's visible box (the chat scroller, above the composer), within the window.
|
|
190
|
+
const th = deps.threadBox?.()?.getBoundingClientRect?.();
|
|
191
|
+
const vh = win?.innerHeight ?? 800;
|
|
192
|
+
const box = th && th.bottom > th.top ? th : { top: 0, bottom: vh };
|
|
193
|
+
const floor = Math.min(vh, box.bottom) - 4, ceil = Math.max(0, box.top) + 4;
|
|
194
|
+
left = Math.max(8, Math.min(last.right - pr.width / 2, vw - pr.width - 8));
|
|
195
|
+
const aboveTop = last.top - pr.height - 10, belowTop = last.bottom + 10;
|
|
196
|
+
// Below unless it would run out of the box and above fits (with no room either side, below).
|
|
197
|
+
const under = belowTop + pr.height <= floor || aboveTop < ceil;
|
|
198
|
+
top = under ? belowTop : aboveTop;
|
|
199
|
+
tip = { side: under ? "up" : "down", x: Math.max(10, Math.min(last.right - left - 5, pr.width - 20)) };
|
|
200
|
+
} else {
|
|
201
|
+
const box = deps.composerBox?.()?.getBoundingClientRect?.();
|
|
202
|
+
left = Math.max(16, vw - 16 - pr.width);
|
|
203
|
+
top = box ? box.top - pr.height - 12 : (win?.innerHeight ?? 800) - pr.height - 120;
|
|
204
|
+
const at = { left, right: left + pr.width, top: top - 8, bottom: top + pr.height + 8 };
|
|
205
|
+
if (rects.some((q) => overlap(at, q) > 0)) {
|
|
206
|
+
const th = deps.threadBox?.()?.getBoundingClientRect?.();
|
|
207
|
+
top = Math.max(th ? th.top : 0, 0) + 12;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (tip) {
|
|
211
|
+
const s = doc.createElement("span"); s.className = `quote-tip ${tip.side}`; s.setAttribute("aria-hidden", "true");
|
|
212
|
+
s.style.setProperty("left", `${tip.x}px`);
|
|
213
|
+
pop.append(s);
|
|
214
|
+
}
|
|
215
|
+
pop.style.setProperty("left", `${Math.round(left)}px`);
|
|
216
|
+
pop.style.setProperty("top", `${Math.round(top)}px`);
|
|
217
|
+
}
|
|
218
|
+
function check() {
|
|
219
|
+
timer = null;
|
|
220
|
+
if (down || deps.canQuote?.() === false) { hide(); return; }
|
|
221
|
+
const passage = selectedPassage(list, doc.getSelection?.());
|
|
222
|
+
if (!passage) { hide(); return; }
|
|
223
|
+
current = passage; drawnFor = passage.text;
|
|
224
|
+
place(passage);
|
|
225
|
+
}
|
|
226
|
+
function soon() { if (timer) clearTimeout(timer); timer = setTimeout(check, 120); }
|
|
227
|
+
const onSelection = () => soon();
|
|
228
|
+
const onDown = (e) => { if (pop && pop.contains(e.target)) return; down = true; hide(); };
|
|
229
|
+
// A gesture the browser took over (a touch scroll: pointerdown → pointercancel, no pointerup — #3555 review P2-1)
|
|
230
|
+
// ends the press as a pointerup does; the selection then decides.
|
|
231
|
+
const onUp = () => { if (!down) return; down = false; soon(); };
|
|
232
|
+
const onKey = (e) => { if (e.key === "Escape" && pop) { hide(); } };
|
|
233
|
+
const onScroll = () => { if (pop && current) place(current); };
|
|
234
|
+
const onFocusIn = (e) => { const f = deps.field?.(); if (f && e.target === f) f.dataset.touched = "1"; };
|
|
235
|
+
// The caret as the person leaves it: kept on every move inside the composer and when it loses the focus.
|
|
236
|
+
const keep = (e) => { const f = deps.field?.(); if (f && e.target === f) remembered.set(f, { value: f.value, caret: f.selectionStart ?? f.value.length }); };
|
|
237
|
+
const KEEP = ["focusout", "input", "keyup", "mouseup", "select"];
|
|
238
|
+
doc.addEventListener("focusin", onFocusIn);
|
|
239
|
+
for (const k of KEEP) doc.addEventListener(k, keep, true);
|
|
240
|
+
doc.addEventListener("selectionchange", onSelection);
|
|
241
|
+
list.addEventListener("pointerdown", onDown);
|
|
242
|
+
doc.addEventListener("pointerup", onUp);
|
|
243
|
+
doc.addEventListener("pointercancel", onUp);
|
|
244
|
+
doc.addEventListener("keydown", onKey);
|
|
245
|
+
win?.addEventListener("scroll", onScroll, true);
|
|
246
|
+
win?.addEventListener("resize", onScroll);
|
|
247
|
+
return () => {
|
|
248
|
+
if (timer) clearTimeout(timer);
|
|
249
|
+
hide();
|
|
250
|
+
doc.removeEventListener("focusin", onFocusIn);
|
|
251
|
+
for (const k of KEEP) doc.removeEventListener(k, keep, true);
|
|
252
|
+
doc.removeEventListener("selectionchange", onSelection);
|
|
253
|
+
list.removeEventListener("pointerdown", onDown);
|
|
254
|
+
doc.removeEventListener("pointerup", onUp);
|
|
255
|
+
doc.removeEventListener("pointercancel", onUp);
|
|
256
|
+
doc.removeEventListener("keydown", onKey);
|
|
257
|
+
win?.removeEventListener("scroll", onScroll, true);
|
|
258
|
+
win?.removeEventListener("resize", onScroll);
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
installQuoteSelection.workspaceVersion = 1;
|
|
@@ -172,3 +172,34 @@ a.hub-launch-pill { border: 1px solid var(--border); background: transparent; co
|
|
|
172
172
|
.inst-alt.hub-answer-only-note, .cmd-desc.hub-answer-only-note { white-space: normal; overflow-wrap: anywhere; }
|
|
173
173
|
|
|
174
174
|
.hub-chat-head.hub-answer-only-head { padding-block: var(--s-2); }
|
|
175
|
+
|
|
176
|
+
/* Room context H1: a short public introduction stays readable on narrow screens. */
|
|
177
|
+
.hub-chat-title .hub-agent-intro-line{white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
|
|
178
|
+
|
|
179
|
+
/* M-3311 (1): the Fleet chat's drop card over a Hub conversation, shown while files are dragged over it (app.css's
|
|
180
|
+
.p-chat.dragging .drop-overlay; .drop-overlay is hidden and .drop-card drawn there). */
|
|
181
|
+
.hub-chat-main.dragging { position: relative; }
|
|
182
|
+
.hub-chat-main.dragging .drop-overlay {
|
|
183
|
+
display: flex; position: absolute; inset: var(--s-2); z-index: 20; align-items: center; justify-content: center; pointer-events: none;
|
|
184
|
+
border: 2px dashed var(--accent); border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg) 85%, transparent);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* M-3311 (3): the Fleet chat's 「全寬」 for a Hub conversation (app.css .p-chat[data-width="full"]), on a desk; and the lines
|
|
188
|
+
under the box: the Enter hint, then the conversation's own note on a line of its own (side by side, a phone squeezed the
|
|
189
|
+
first to nothing). */
|
|
190
|
+
@media (min-width: 900px) and (pointer: fine), (min-width: 900px) and (pointer: none), (min-width: 900px) and (min-height: 501px), (min-width: 1024px) {
|
|
191
|
+
.hub-chat[data-width="full"] .thread, .hub-chat[data-width="full"] .dock-col { max-width: none; }
|
|
192
|
+
}
|
|
193
|
+
.composer-row.hub-hints { flex-direction: column; align-items: flex-start; gap: 0; }
|
|
194
|
+
.composer-row.hub-hints > .hint { flex-shrink: 0; max-width: 100%; }
|
|
195
|
+
|
|
196
|
+
/* M-3311 (4): a phone's room header is one row, as the Fleet chat's — back, the room (its name, then one line of counts), the
|
|
197
|
+
members and ⋯. The purpose is in the members sheet there (hub-room-members.js), and text size and Notify are in ⋯; the name
|
|
198
|
+
no longer sits on the top edge (the header has room above and below), and the counts are no longer cut to "2 人 · 0 個 …". */
|
|
199
|
+
@media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
|
|
200
|
+
.hub-room-page .hub-chat-head { padding-block: var(--s-1); }
|
|
201
|
+
.hub-room-page .hub-chat-head .hub-chat-title .hub-room-purpose-trigger { display: none; }
|
|
202
|
+
.hub-room-page .hub-chat-head .hub-head-tools { display: none; }
|
|
203
|
+
/* …and its members and ⋯ are full tap targets, as its back is (S-150). */
|
|
204
|
+
.hub-room-page .hub-chat-head .hub-room-menu > .icon-btn, .hub-room-page .hub-chat-head .hub-room-rail-toggle { min-width: var(--tap); min-height: var(--tap); }
|
|
205
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* Lazy linked: retained shells receive the grouped owner page and its phone action bar together. */
|
|
2
|
+
.hub-my-agents { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; padding-bottom: calc(var(--s-6) * 3); }
|
|
3
|
+
.hub-my-agents > .field-row { justify-content: flex-end; }
|
|
4
|
+
.hub-agent-fleet > summary { display: list-item; cursor: pointer; padding: var(--s-2); }
|
|
5
|
+
.hub-agent-fleet > summary strong { margin-right: var(--s-3); }
|
|
6
|
+
.hub-agent-fleet > summary .note { display: inline; }
|
|
7
|
+
.hub-agent-choice { border-bottom: 1px solid var(--border); }
|
|
8
|
+
.hub-agent-choice:last-child { border-bottom: 0; }
|
|
9
|
+
.hub-agent-choice .hub-row-text { overflow-wrap: anywhere; }
|
|
10
|
+
.hub-agent-choice .hub-row-text > .tag { width: fit-content; }
|
|
11
|
+
.hub-agent-tick { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; }
|
|
12
|
+
.hub-agent-tick input { width: 1.2em; height: 1.2em; }
|
|
13
|
+
.hub-classic-disclosure { margin: 0 var(--s-3) var(--s-3); }
|
|
14
|
+
.hub-share-bar { position: sticky; bottom: var(--s-3); z-index: 5; display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); }
|
|
15
|
+
.hub-share-bar > strong { flex: 1; }
|
|
16
|
+
@media (max-width: 899px), (pointer: coarse) {
|
|
17
|
+
.hub-my-agents .btn { min-height: 44px; min-width: 44px; }
|
|
18
|
+
.hub-my-agents a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); }
|
|
19
|
+
.hub-agent-choice .s-row { flex-wrap: wrap; }
|
|
20
|
+
.hub-agent-choice .hub-row-text { min-width: 0; flex: 1 1 50%; }
|
|
21
|
+
.hub-agent-fleet > summary .note { display: block; }
|
|
22
|
+
.hub-share-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--s-2)); }
|
|
23
|
+
.hub-share-bar > strong { flex-basis: 100%; }
|
|
24
|
+
.hub-share-bar > .btn { flex: 1; }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.hub-my-fleets-head { justify-content: space-between; flex-wrap: wrap; }
|
|
28
|
+
.hub-my-fleets-head h3 { margin: 0; }
|
|
29
|
+
.hub-agent-choice[data-unavailable] .hub-row-text { opacity: .65; }
|
|
30
|
+
.hub-share-access-list { list-style: none; padding: 0; margin: 0; }
|
|
31
|
+
.hub-share-access-item { display: flex; align-items: center; gap: var(--s-3); padding-block: var(--s-2); flex-wrap: wrap; }
|
|
32
|
+
@media (max-width: 899px), (pointer: coarse) {
|
|
33
|
+
.hub-my-agents .hub-agent-choice .s-row.hub-row { display: grid; grid-template-columns: 44px 28px minmax(0, 1fr); }
|
|
34
|
+
.hub-agent-choice .hub-agent-pause { grid-column: 3; justify-self: start; }
|
|
35
|
+
}
|
|
@@ -74,3 +74,8 @@
|
|
|
74
74
|
.hub-source-trigger { min-height: var(--tap); min-width: var(--tap); }
|
|
75
75
|
.hub-room-page .msg .meta { align-items: center; }
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
/* Purpose stays one line in the header; tapping reads the complete room content. */
|
|
79
|
+
.hub-room-purpose-trigger{display:block;max-width:100%;min-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;border:0;background:none;padding:0;color:var(--text-3);font:inherit;font-size:var(--fs-xs);cursor:pointer}
|
|
80
|
+
.hub-room-purpose-full,.hub-room-purpose-panel p{white-space:pre-wrap;overflow-wrap:anywhere}
|
|
81
|
+
@media(max-width:640px),(pointer:coarse){.hub-room-purpose-trigger{min-height:var(--tap)}}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// M-3314: a panel opened after the page loaded (Settings, Fleet…) asks for its whole module graph at once, not one
|
|
2
|
+
// import level at a time over a slow link. The shell carries the served modules' static imports (#agend-modules, a
|
|
3
|
+
// signed-in admin's page only) and loads this file under its version (/assets/v-<V>/); a preload names the same
|
|
4
|
+
// versioned URL the import map gives the import, so the browser fetches each file once. Anywhere else (no graph, a
|
|
5
|
+
// plain path) it does nothing and the import loads as before.
|
|
6
|
+
|
|
7
|
+
const VERSIONED = /\/assets\/(v-[0-9a-f]{12})\/module-warm\.js(?:[?#]|$)/;
|
|
8
|
+
|
|
9
|
+
function readGraph(doc) {
|
|
10
|
+
try { const el = doc && doc.getElementById("agend-modules"); return el ? JSON.parse(el.textContent || "null") : null; } catch { return null; }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** The module URLs (plain) `entry` imports statically, itself included. */
|
|
14
|
+
export function closureOf(graph, entry) {
|
|
15
|
+
const seen = new Set(), stack = [entry];
|
|
16
|
+
while (stack.length) { const u = stack.pop(); if (seen.has(u) || !graph || !Object.prototype.hasOwnProperty.call(graph, u)) continue; seen.add(u); for (const d of graph[u]) stack.push(d); }
|
|
17
|
+
return [...seen];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A warmer over this page: `warm(entry)` adds one modulepreload per module of the entry's graph not asked for yet. */
|
|
21
|
+
export function createWarmer({ doc = globalThis.document, url = import.meta.url } = {}) {
|
|
22
|
+
const m = VERSIONED.exec(url);
|
|
23
|
+
const graph = m ? readGraph(doc) : null;
|
|
24
|
+
const version = m ? m[1] : null;
|
|
25
|
+
return function warm(entry) {
|
|
26
|
+
if (!graph || !version || !doc || !doc.head) return 0;
|
|
27
|
+
let added = 0;
|
|
28
|
+
for (const u of closureOf(graph, entry)) {
|
|
29
|
+
const href = u.replace(/^\/(assets|ui\/js)\//, `/$1/${version}/`);
|
|
30
|
+
if (doc.head.querySelector(`link[rel="modulepreload"][href="${href}"]`)) continue;
|
|
31
|
+
const link = doc.createElement("link");
|
|
32
|
+
link.setAttribute("rel", "modulepreload"); link.setAttribute("href", href);
|
|
33
|
+
doc.head.appendChild(link); added++;
|
|
34
|
+
}
|
|
35
|
+
return added;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const warmModules = createWarmer();
|
package/dist/web-api.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { WebUpdateHost } from "./web-update.js";
|
|
|
17
17
|
import type { SendOpts } from "./channel/types.js";
|
|
18
18
|
import { type WebModelAction } from "./web-commands.js";
|
|
19
19
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
20
|
+
import { type ModuleGraph } from "./web-asset-version.js";
|
|
20
21
|
import type { LifecycleCreateArgs } from "./instance-lifecycle.js";
|
|
21
22
|
import { type Actor as BoardActor, type TaskBoard } from "./scheduler/task-board.js";
|
|
22
23
|
import { type PreviewAvailability } from "./web-preview.js";
|
|
@@ -238,6 +239,13 @@ export interface WebApiContext {
|
|
|
238
239
|
webMessageInChannel?(instance: string, messageId: string, copies?: readonly import("./web-reactions.js").WebEchoCopy[]): void;
|
|
239
240
|
/** false: definitely not delivered (the instance's IPC is gone, or it was restarted meanwhile). */
|
|
240
241
|
generalLocationDeliveryHold?(instanceName: string): string | null;
|
|
242
|
+
/** #4145: `text` with this fleet's sign-in access token hidden (`live`: the live one was in it); null when there is none. */
|
|
243
|
+
screenLoginToken?(text: string): {
|
|
244
|
+
text: string;
|
|
245
|
+
live: boolean;
|
|
246
|
+
} | null;
|
|
247
|
+
/** #4145: take a pasted access token back and send a new one; the line for the chat, or null. */
|
|
248
|
+
loginTokenPasted?(): Promise<string | null>;
|
|
241
249
|
deliverToInstance(instanceName: string, payload: Record<string, unknown>, options?: {
|
|
242
250
|
stillCurrent?: () => boolean;
|
|
243
251
|
authorityCurrent?: () => boolean;
|
|
@@ -304,6 +312,8 @@ export interface WebApiContext {
|
|
|
304
312
|
readonly guestSearches?: OfficeWriteLimiter;
|
|
305
313
|
/** #2578: the agents' live acts in the Office view (office_set); absent: /ui/office-acts is not offered. */
|
|
306
314
|
readonly officeActs?: Pick<OfficeActs, "live">;
|
|
315
|
+
/** M-3293: an Office pat or feed for the instance's next real message (FleetManager.officeTell); whether it was stored. */
|
|
316
|
+
officeTell?(instance: string, person: string, kind: "pat" | "feed"): boolean;
|
|
307
317
|
/** #2636: Office share links (office-share-service.ts): the open ones, making and ending one. */
|
|
308
318
|
readonly officeShares?: {
|
|
309
319
|
enabled(): boolean;
|
|
@@ -503,7 +513,8 @@ export interface WebApiContext {
|
|
|
503
513
|
} | null;
|
|
504
514
|
/** Answer one of them, exactly as a click on its platform button would. */
|
|
505
515
|
/** `text`: #2675 — the typed answer, for the one action the page shows a text box for. */
|
|
506
|
-
|
|
516
|
+
webPromptNeedsHuman?(nonce: string): boolean;
|
|
517
|
+
clickWebPrompt?(instance: string, nonce: string, action: string, text?: string, humanSession?: boolean): Promise<{
|
|
507
518
|
status: number;
|
|
508
519
|
error?: string;
|
|
509
520
|
}>;
|
|
@@ -697,12 +708,17 @@ export declare function serveHubWorkspaceShell(res: ServerResponse, hub: {
|
|
|
697
708
|
name: string;
|
|
698
709
|
preview?: Readonly<import("./hub/preview.js").HubPreviewView>;
|
|
699
710
|
}): void;
|
|
700
|
-
/**
|
|
701
|
-
|
|
711
|
+
/** M-3314: the served modules' static imports, read once per process (its files do not change under it). */
|
|
712
|
+
export declare function appModuleGraph(): ModuleGraph;
|
|
713
|
+
/** M-3314: the module each panel's route loads (app.js's own dynamic imports). */
|
|
714
|
+
export declare const PANEL_MODULES: Readonly<Record<string, string>>;
|
|
702
715
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
716
|
+
* M-3314: what this load of the shell imports, statically or as app.js boots it, so it can be asked for in one wave:
|
|
717
|
+
* app.js; for a signed-in page the chat (always booted) and the panel of the route; for an admin's page also what
|
|
718
|
+
* app.js loads for every admin (backend sign-in, agent proposals) and, with the chat workspace, its modules. Nothing a
|
|
719
|
+
* page of that kind would not load anyway — a guest's or a reader's page preloads only what it imports itself.
|
|
705
720
|
*/
|
|
721
|
+
export declare function shellPreload(mode: AppShellMode, guest: boolean, path: string, workspace: boolean): string[];
|
|
706
722
|
export declare function serveAppShell(req: IncomingMessage, res: ServerResponse, ctx: AppShellContext, mode: AppShellMode, opts?: {
|
|
707
723
|
hubWorkspace?: {
|
|
708
724
|
name: string;
|