@songsid/agend 2.4.0-beta.11 → 2.4.0-beta.13
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 +33 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/codex.js +11 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/types.d.ts +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/daemon.d.ts +13 -1
- package/dist/daemon.js +54 -9
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-liveness.js +2 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/fleet-manager.d.ts +110 -1
- package/dist/fleet-manager.js +387 -25
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +7 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +25 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +6 -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/client.d.ts +1 -0
- package/dist/hub/client.js +26 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +13 -5
- package/dist/hub/compose/member.js +28 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +5 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.d.ts +1 -0
- package/dist/hub/http/compose.js +28 -5
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +6 -0
- package/dist/hub/http/schema.js.map +1 -1
- 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/room-ask.d.ts +10 -0
- package/dist/hub/member/room-ask.js +70 -7
- package/dist/hub/member/room-ask.js.map +1 -1
- 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/protocol.d.ts +172 -4
- package/dist/hub/protocol.js +10 -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.js +50 -10
- 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/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 +11 -0
- package/dist/hub/rooms/service.js +56 -12
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +6 -2
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +27 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +9 -5
- 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/instance-lifecycle.d.ts +18 -0
- package/dist/instance-lifecycle.js +43 -4
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +26 -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/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 +12 -1
- package/dist/needs-you.js +9 -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 +19 -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/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/public-web-gateway.d.ts +20 -0
- package/dist/public-web-gateway.js +66 -5
- package/dist/public-web-gateway.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-effect.js +17 -1
- 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/accounts-keepalive.js +2 -1
- package/dist/ui/accounts-view.js +2 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/fleet-canvas.js +3 -1
- package/dist/ui/fleet-office-skin.js +4 -3
- package/dist/ui/fleet-route.js +44 -6
- package/dist/ui/fleet-task-view.js +2 -1
- package/dist/ui/host-install.js +82 -5
- package/dist/ui/hub-agent-intro.js +15 -6
- package/dist/ui/hub-ai-apps.js +2 -1
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-strings.js +2 -1
- package/dist/ui/hub-client.js +4 -0
- package/dist/ui/hub-grant-picker.js +2 -1
- package/dist/ui/hub-group-strings.js +2 -1
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-my-agents.js +7 -3
- package/dist/ui/hub-owner-strings.js +2 -1
- package/dist/ui/hub-personal-agent.js +2 -1
- package/dist/ui/hub-quota.js +2 -1
- package/dist/ui/hub-roles-strings.js +2 -1
- package/dist/ui/hub-room-composer.js +10 -2
- package/dist/ui/hub-room-list.js +1 -1
- package/dist/ui/hub-room-members.js +2 -0
- package/dist/ui/hub-room-new-strings.js +2 -1
- package/dist/ui/hub-room-new.js +7 -4
- 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-source.js +2 -1
- package/dist/ui/hub-room-strings.js +6 -4
- package/dist/ui/hub-room-thread.js +68 -17
- package/dist/ui/hub-strings.js +2 -1
- package/dist/ui/hub-teams.js +2 -1
- package/dist/ui/model-picker.js +3 -2
- package/dist/ui/panel-chat.js +25 -7
- package/dist/ui/panel-hub.js +67 -20
- package/dist/ui/panel-needs.js +3 -2
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/reply-file-preview.js +2 -1
- package/dist/ui/settings-access-overview.js +2 -1
- package/dist/ui/settings-connector.js +2 -1
- package/dist/ui/shared/agent-sheet.js +2 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +39 -9
- package/dist/ui/shared/app.css +11 -0
- package/dist/ui/shared/app.js +3 -1
- package/dist/ui/shared/asset-url.d.ts +2 -0
- package/dist/ui/shared/asset-url.js +20 -0
- package/dist/ui/shared/chat-msg-actions.js +3 -1
- package/dist/ui/shared/chat-quote.js +261 -0
- package/dist/ui/shared/chat-table-select.js +175 -0
- package/dist/ui/shared/hub-chat.css +28 -0
- package/dist/ui/shared/hub-rooms-u2.css +5 -0
- package/dist/ui/shared/image-annotate.js +2 -1
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/ui/shared/ui-states.js +3 -2
- package/dist/ui/shared/view-history.js +2 -1
- package/dist/ui/subagent-row.js +3 -2
- package/dist/ui/usage-pool.js +2 -1
- package/dist/ui/workspace-panel.js +2 -1
- package/dist/wake-coordinator.js +3 -2
- package/dist/wake-coordinator.js.map +1 -1
- package/dist/web-api.d.ts +17 -4
- package/dist/web-api.js +83 -6
- 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-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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// of its own (#3261 review): a tab that loaded B's hub-chat-strings.js / hub-chat.css before C keeps them, so C's words
|
|
3
3
|
// and rules come only from here.
|
|
4
4
|
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
5
6
|
|
|
6
7
|
export const ownerAdminEntryV1 = true;
|
|
7
8
|
register("hubOwner", {
|
|
@@ -50,7 +51,7 @@ export function linkHubOwnerCss(doc = typeof document !== "undefined" ? document
|
|
|
50
51
|
try {
|
|
51
52
|
if (!doc || !doc.head || doc.querySelector('link[data-hub-owner-css="1"]')) return;
|
|
52
53
|
const link = doc.createElement("link");
|
|
53
|
-
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-owner.css"); link.setAttribute("data-hub-owner-css", "1");
|
|
54
|
+
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/hub-owner.css")); link.setAttribute("data-hub-owner-css", "1");
|
|
54
55
|
doc.head.appendChild(link);
|
|
55
56
|
} catch { /* the pages still work without it */ }
|
|
56
57
|
}
|
|
@@ -4,6 +4,7 @@ import {ErrorState,Skeleton} from "/assets/ui-states.js";
|
|
|
4
4
|
import {confirmDialog} from "/assets/ui-confirm.js";
|
|
5
5
|
import {runtimeEnrollCommand} from "./runtime-commands.js";
|
|
6
6
|
import {hp} from "./hub-personal-agent-strings.js";
|
|
7
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
7
8
|
const refused=()=>({ok:false});
|
|
8
9
|
const fields=agent=>({name:agent?.name??"",description:agent?.introBy?agent.intro:introPreview(agent?.description??""),cli:agent?.cli??"",model:agent?.model??"",ifRevision:agent?.revision??0,answerOnly:agent?.answerOnly===true});
|
|
9
10
|
const policy=value=>({enabled:value.enabled===true,people:[...(value.people??[])],teams:[...(value.teams??[])]});
|
|
@@ -14,7 +15,7 @@ export function personalCliReason(cli){
|
|
|
14
15
|
if(cli.id==="codex"&&["sandbox-unavailable","profile-unavailable"].includes(cli.personalStatus)&&cli.answerOnlyAvailable===false)return "answerOnlyFailed";
|
|
15
16
|
return cli.id==="codex"&&cli.personalStatus==="sandbox-unavailable"?"codexSandbox":"profile";
|
|
16
17
|
}
|
|
17
|
-
function installCss(){if(typeof document==="undefined"||document.querySelector('link[data-personal-install="1"]'))return;const link=document.createElement("link");link.rel="stylesheet";link.href="/assets/runtime-install.css";link.setAttribute("data-personal-install","1");document.head.appendChild(link);}
|
|
18
|
+
function installCss(){if(typeof document==="undefined"||document.querySelector('link[data-personal-install="1"]'))return;const link=document.createElement("link");link.rel="stylesheet";link.href=assetUrl("/assets/runtime-install.css");link.setAttribute("data-personal-install","1");document.head.appendChild(link);}
|
|
18
19
|
/** The captured sign-in is passed through every client call, including writes after an await. */
|
|
19
20
|
export function HubPersonalAgent({client,scope,isAdmin=false,onSaved=()=>{}}){
|
|
20
21
|
const [view,setView]=useState(null),[form,setForm]=useState(null),[busy,setBusy]=useState(false),[error,setError]=useState(""),[issued,setIssued]=useState(null),[copied,setCopied]=useState(false),[clock,setClock]=useState(Date.now()),[editing,setEditing]=useState(false),[waiting,setWaiting]=useState(false);
|
package/dist/ui/hub-quota.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
3
3
|
import { register, t } from "/assets/app-i18n.js";
|
|
4
4
|
import { hubClient } from "./hub-client.js";
|
|
5
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
5
6
|
|
|
6
7
|
if (typeof document !== "undefined" && !document.querySelector('link[data-hub-quota]')) {
|
|
7
|
-
const css = document.createElement("link"); css.rel = "stylesheet"; css.href = "/assets/hub-quota.css";
|
|
8
|
+
const css = document.createElement("link"); css.rel = "stylesheet"; css.href = assetUrl("/assets/hub-quota.css");
|
|
8
9
|
css.setAttribute("data-hub-quota", ""); document.head.appendChild(css);
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {register,t} from "/assets/app-i18n.js";
|
|
2
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
2
3
|
register("hubRole",{
|
|
3
4
|
"en": {
|
|
4
5
|
"migrationNotice": "Roles and permissions are now available. Nobody’s access changed during migration.",
|
|
@@ -435,5 +436,5 @@ const styles = new WeakMap();
|
|
|
435
436
|
export function linkRoleCss(doc = typeof document === "undefined" ? null : document) {
|
|
436
437
|
if (!doc?.head) return Promise.resolve(false);
|
|
437
438
|
if (styles.has(doc)) return styles.get(doc);
|
|
438
|
-
const ready = new Promise(resolve => {const link=doc.createElement("link");link.setAttribute("rel","stylesheet");link.setAttribute("href","/assets/hub-roles.css");link.setAttribute("data-hub-roles-css","1");link.addEventListener("load",()=>resolve(true),{once:true});link.addEventListener("error",()=>{styles.delete(doc);link.remove();resolve(false);},{once:true});doc.head.appendChild(link);});styles.set(doc,ready);return ready;
|
|
439
|
+
const ready = new Promise(resolve => {const link=doc.createElement("link");link.setAttribute("rel","stylesheet");link.setAttribute("href",assetUrl("/assets/hub-roles.css"));link.setAttribute("data-hub-roles-css","1");link.addEventListener("load",()=>resolve(true),{once:true});link.addEventListener("error",()=>{styles.delete(doc);link.remove();resolve(false);},{once:true});doc.head.appendChild(link);});styles.set(doc,ready);return ready;
|
|
439
440
|
}
|
|
@@ -13,6 +13,7 @@ import { t } from "/assets/app-i18n.js";
|
|
|
13
13
|
import { Icon } from "/assets/ui-icons.js";
|
|
14
14
|
import { hroom } from "./hub-room-strings.js";
|
|
15
15
|
import { presenceDot } from "./hub-room-presence.js";
|
|
16
|
+
import { pasteToAttach } from "./hub-attachments.js";
|
|
16
17
|
|
|
17
18
|
const ONLINE = new Set(["online", "idle", "working"]);
|
|
18
19
|
const agentsOf = (detail) => (detail?.members || []).filter((m) => m.kind === "agent" || m.kind === "later");
|
|
@@ -78,6 +79,9 @@ export function mentionsIn(text, detail) {
|
|
|
78
79
|
return [...new Set(out)];
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
// M-3308: the paste helpers live with the Hub's files (hub-attachments.js), shared with the 1:1 question's composer (M-3311).
|
|
83
|
+
export { LONG_PASTE_CHARS, pastedFile } from "./hub-attachments.js";
|
|
84
|
+
|
|
81
85
|
/** Above the box when @所有 Agent is in it: how many answer now, how many after they come back (spec §4). */
|
|
82
86
|
export function allBar(detail) {
|
|
83
87
|
const agents = agentsOf(detail), online = agents.filter((a) => ONLINE.has(a.presence)).length;
|
|
@@ -132,6 +136,9 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
132
136
|
if (globalThis.AgendChatRender?.composerKey(e, { touch: touchScreen() }) === "send") { e.preventDefault(); void send(); }
|
|
133
137
|
};
|
|
134
138
|
const track = (v) => { setValue(v); setMsg(null); setCaret(input.current ? input.current.selectionStart ?? v.length : v.length); };
|
|
139
|
+
// M-3308 (the user: a screenshot pasted with Ctrl+V did nothing in a room): the Fleet chat's paste, through the room's own
|
|
140
|
+
// Attach and its file rules (hub-attachments.js pasteToAttach). A room that takes no files keeps the text (as before).
|
|
141
|
+
const onPaste = (e) => { if (!closed) pasteToAttach(e, attach); };
|
|
135
142
|
const paletteId = `hubMention-${room.id || "room"}`, optId = (o) => `${paletteId}-${o.key}`;
|
|
136
143
|
// M-3117: as the Fleet chat's dock has it — the box, then a failed send, then the line under it (its .composer-row).
|
|
137
144
|
if (closed) return html`<p class="hub-banner warn" role="status">${hroom(detail?.room?.archived ? "errArchived" : "errNotMember")}</p>`;
|
|
@@ -145,11 +152,12 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
145
152
|
${group && value.includes(hroom("mentionAll")) ? html`<p class="note hub-room-allbar" role="status">${allBar(detail)}</p>` : null}
|
|
146
153
|
${reply ? html`<div class="reply-bar" data-trust="composer" role="status"><span class="reply-text">${reply.sender ? `${reply.sender} · ` : ""}${String(reply.text || "").slice(0, 80)}</span>
|
|
147
154
|
<button type="button" class="icon-btn reply-cancel" title=${hroom("cancel")} aria-label=${hroom("cancel")} onClick=${() => { onReply(null); input.current?.focus(); }}><${Icon} name="close" size=${14} /></button></div>` : null}
|
|
148
|
-
<${ComposerInput} inputRef=${input} value=${value} attach=${attach} placeholder=${room.assistant ? hroom("composerAssistant") : group ? (short ? hroom("composerShort") : hroom("composer", room.name || "")) : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
155
|
+
<${ComposerInput} inputRef=${input} value=${value} attach=${attach} onPaste=${onPaste} placeholder=${room.assistant ? hroom("composerAssistant") : group ? (short ? hroom("composerShort") : hroom("composer", room.name || "")) : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
149
156
|
controls=${palette ? paletteId : undefined} expanded=${!!palette} activeDescendant=${chosen ? optId(chosen) : undefined}
|
|
150
157
|
stop=${{ hidden: true, disabled: true, title: t("chat.stopReply"), label: t("chat.stopReply"), onClick: () => {} }}
|
|
151
158
|
send=${{ hidden: false, disabled: (!value.trim() && !canSendEmpty) || busy, label: t("chat.send"), onClick: () => { void send(); } }} />
|
|
152
159
|
</div>
|
|
153
160
|
${msg ? html`<p class="err" role="alert">${msg.text}${msg.retry ? html` <button type="button" class="btn btn-sm" onClick=${send}>${hroom("retrySend")}</button>` : null}</p>` : null}
|
|
154
|
-
${
|
|
161
|
+
${/* M-3311 (3): the Fleet chat's line under the box — Enter sends, Shift+Enter a new line — and a group room's @agent hint after it. */ ""}
|
|
162
|
+
<div class=${`composer-row${group ? " hub-hints" : ""}`}><span class="hint hub-enter-hint">${t(touchScreen() ? "chat.nativeComposerHintTouch" : "chat.nativeComposerHint")}</span>${group ? html`<span class="hint hub-room-hint">${hroom("composerHint")}</span>` : null}</div>`;
|
|
155
163
|
}
|
package/dist/ui/hub-room-list.js
CHANGED
|
@@ -72,7 +72,7 @@ export function rowView(r) {
|
|
|
72
72
|
const group = r.kind === "group", limited = r.limited === true;
|
|
73
73
|
// Today's chats keep what their row said: closed, or a question waiting (the Fleet's working dot), else its owner.
|
|
74
74
|
const closed = limited && r.legacy?.state === "closed", waiting = limited && !closed && r.legacy?.waiting === true;
|
|
75
|
-
const line2 = group ? countsLine(r.people, r.agents)
|
|
75
|
+
const line2 = group ? [countsLine(r.people, r.agents),r.purpose].filter(Boolean).join(" · ")
|
|
76
76
|
: closed ? t("hubChat.tagClosed") : waiting ? t("hubChat.waiting")
|
|
77
77
|
: r.assistant ? hi("assistant") : [r.agent?.intro,r.agent?.answerOnly ? hp("answerOnlyAsker") : String(r.agent?.owner?.name || "")].filter(Boolean).join(" · ");
|
|
78
78
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {rp} from "./hub-room-purpose.js";
|
|
1
2
|
import { hi } from "./hub-agent-intro.js";
|
|
2
3
|
// Hub rooms, the right-hand members panel (docs/design/hub-rooms-ux.md section 5): the people, the agents in presence
|
|
3
4
|
// order, the room assistant, who can see what, and (for a room manager) the way to Room settings. Clicking an agent
|
|
@@ -80,6 +81,7 @@ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMenti
|
|
|
80
81
|
return html`<span class="hub-member-name"><${RoomSourceMark} source=${roomSource(m)} decorative=${true} />${m.name}${extra}</span><span class="hub-member-state"><span class=${`dot ${v.dot}`} aria-hidden="true"></span><span>${v.text}</span>${owner ? html`<span class="hub-member-owner">· ${owner}</span>` : null}</span>${m.intro||m.kind==="assistant"?html`<small class="note">${m.kind==="assistant"?hi("assistant"):m.intro}</small>`:null}`;
|
|
81
82
|
};
|
|
82
83
|
return html`<aside class="hub-room-members">
|
|
84
|
+
${detail.room?.purpose?html`<section class="hub-room-purpose-panel"><h4>${rp("title")}</h4><p>${detail.room.purpose}</p></section>`:manager&&client.roomPurposeV1===true&&typeof detail.room?.purpose==="string"?html`<button type="button" class="btn btn-link" onClick=${()=>onSettings?.()}>${rp("add")}</button>`:null}
|
|
83
85
|
<section><h4>${heads.member}</h4>
|
|
84
86
|
<ul>${people.map(m => html`<li class="hub-member" key=${m.id}>${row(m, html`${m.id === meId ? html` <span class="tag">${hroom("roleYou")}</span>` : null}${m.role === "manager" ? html` <span class="tag">${hroom("roleManager")}</span>` : null}`)}</li>`)}</ul>
|
|
85
87
|
</section>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// settings, section 7): only the words the shared room vocabulary (hub-room-strings.js, namespace hubRoom) does not have.
|
|
3
3
|
// A module of its own, so a tab holding an older dictionary still has every word (upgrade skew).
|
|
4
4
|
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
5
6
|
|
|
6
7
|
register("hubRoomNew", {
|
|
7
8
|
en: {
|
|
@@ -40,7 +41,7 @@ export function linkRoomsU2Css(doc = typeof document !== "undefined" ? document
|
|
|
40
41
|
try {
|
|
41
42
|
if (!doc || !doc.head || doc.querySelector('link[data-hub-rooms-u2-css="1"]')) return;
|
|
42
43
|
const link = doc.createElement("link");
|
|
43
|
-
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-rooms-u2.css"); link.setAttribute("data-hub-rooms-u2-css", "1");
|
|
44
|
+
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/hub-rooms-u2.css")); link.setAttribute("data-hub-rooms-u2-css", "1");
|
|
44
45
|
doc.head.appendChild(link);
|
|
45
46
|
} catch { /* the screens still work without it */ }
|
|
46
47
|
}
|
package/dist/ui/hub-room-new.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {RoomPurposeField,purposeCount} from "./hub-room-purpose.js";
|
|
1
2
|
// Hub rooms, the New room dialog (docs/design/hub-rooms-ux.md section 6), opened from the list's 「+ 新房間」 row (shown
|
|
2
3
|
// only to people who may start rooms). Name (required, at most 60 characters), members (people, teams, AD groups; I am
|
|
3
4
|
// always in, as the manager), agents (mine join at once; someone else's are invited and join when their owner agrees;
|
|
@@ -79,7 +80,8 @@ export function RoomPicker({ client, kinds, picked, onChange, placeholder, label
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
/** Props: client, onClose(), onOpenRoom(roomId), assistant (whether the Hub offers the room assistant; read from the list when not given). */
|
|
82
|
-
export function NewRoomDialog({ client = hubClient(), onClose, onOpenRoom, assistant } = {}) {
|
|
83
|
+
export function NewRoomDialog({ client = hubClient(), onClose, onOpenRoom, assistant, purposeSupported=false } = {}) {
|
|
84
|
+
const [purpose,setPurpose]=useState("");
|
|
83
85
|
const [name, setName] = useState(""), [people, setPeople] = useState([]), [agents, setAgents] = useState([]), [withAssistant, setWithAssistant] = useState(false);
|
|
84
86
|
const [offered, setOffered] = useState(assistant === true), [busy, setBusy] = useState(false), [error, setError] = useState(""), [peopleNote, setPeopleNote] = useState("");
|
|
85
87
|
const nameRef = useRef(null), sent = useRef(false);
|
|
@@ -90,13 +92,13 @@ export function NewRoomDialog({ client = hubClient(), onClose, onOpenRoom, assis
|
|
|
90
92
|
return () => { live = false; };
|
|
91
93
|
}, [client, assistant]);
|
|
92
94
|
const create = async () => {
|
|
93
|
-
if (sent.current) return;
|
|
95
|
+
if (sent.current || purposeSupported&&purposeCount(purpose)>200) return;
|
|
94
96
|
const title = name.trim();
|
|
95
97
|
if (!title) { setError(hroom("nameRequired")); nameRef.current?.focus(); return; }
|
|
96
98
|
if ([...title].length > NAME_MAX) { setError(hn("nameTooLong")); nameRef.current?.focus(); return; }
|
|
97
99
|
sent.current = true; setBusy(true); setError(""); setPeopleNote("");
|
|
98
100
|
const ids = (kind, from = people) => from.filter(x => x.kind === kind).map(x => x.id);
|
|
99
|
-
const r = await client.createRoom({ name: title, people: ids("person"), teams: ids("team"), groups: ids("group"),
|
|
101
|
+
const r = await client.createRoom({ name: title, ...(purposeSupported?{purpose}:{}), people: ids("person"), teams: ids("team"), groups: ids("group"),
|
|
100
102
|
agents: agents.filter(x => x.kind === "agent" && x.mine).map(x => x.id), assistant: offered && withAssistant });
|
|
101
103
|
const roomId = r?.ok ? r.room?.id : null;
|
|
102
104
|
if (!roomId) {
|
|
@@ -118,11 +120,12 @@ export function NewRoomDialog({ client = hubClient(), onClose, onOpenRoom, assis
|
|
|
118
120
|
const me = html`<li class="tag hub-room-me">${hroom("roleYou")} · ${hroom("roleManager")}</li>`;
|
|
119
121
|
return html`<${Dialog} title=${hroom("newRoomTitle")} onClose=${() => onClose?.()} busy=${busy} cls="hub-room-new"
|
|
120
122
|
actions=${html`<button type="button" class="btn" disabled=${busy} onClick=${() => onClose?.()}>${hroom("cancel")}</button>
|
|
121
|
-
<button type="button" class="btn btn-primary" disabled=${busy} onClick=${() => { void create(); }}>${hroom("create")}</button>`}>
|
|
123
|
+
<button type="button" class="btn btn-primary" disabled=${busy||purposeSupported&&purposeCount(purpose)>200} onClick=${() => { void create(); }}>${hroom("create")}</button>`}>
|
|
122
124
|
<form class="form" onSubmit=${(e) => { e.preventDefault(); void create(); }}>
|
|
123
125
|
<label class="field"><span>${hroom("name")}</span>
|
|
124
126
|
<input id="hubRoomName" ref=${nameRef} maxlength=${NAME_MAX} autocomplete="off" placeholder=${hroom("namePlaceholder")} value=${name}
|
|
125
127
|
aria-invalid=${error === hroom("nameRequired") || error === hn("nameTooLong") ? "true" : "false"} onInput=${(e) => { setName(e.target.value); if (error) setError(""); }} /></label>
|
|
128
|
+
${purposeSupported?html`<${RoomPurposeField} value=${purpose} onValue=${setPurpose} disabled=${busy} />`:null}
|
|
126
129
|
${error ? html`<p class="note hub-room-new-error" role="alert">${error}</p>` : null}
|
|
127
130
|
<${RoomPicker} client=${client} id="hubRoomPeople" kinds=${["person", "team", "group"]} label=${hroom("members")} placeholder=${hroom("addPeople")}
|
|
128
131
|
picked=${people} onChange=${(next) => { setPeople(next); setPeopleNote(""); }} fixed=${me} note=${peopleNote} />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {html,useState} from "/assets/app-html.js";
|
|
2
|
+
import {register,t} from "/assets/app-i18n.js";
|
|
3
|
+
import {Dialog} from "/assets/ui-dialog.js";
|
|
4
|
+
register("hubRoomPurpose",{
|
|
5
|
+
en:{title:"Purpose",hint:"One line on what this room is for. Members see it, and agents asked here are told.",placeholder:"For example: release questions for the web team",add:"Add a purpose",tooLong:"Use 200 characters or fewer.",close:"Close"},
|
|
6
|
+
"zh-TW":{title:"用途",hint:"用一句話說明這個房間做什麼。成員看得到,在這裡被問的 Agent 也會知道。",placeholder:"例如:網頁組的發版問題",add:"新增用途",tooLong:"最多 200 個字。",close:"關閉"}
|
|
7
|
+
});
|
|
8
|
+
export const rp=(key,...args)=>t(`hubRoomPurpose.${key}`,...args);
|
|
9
|
+
export const purposeCount=value=>[...new Intl.Segmenter(undefined,{granularity:"grapheme"}).segment(String(value??""))].length;
|
|
10
|
+
export function RoomPurposeField({id="hubRoomPurpose",value="",onValue,disabled=false}){
|
|
11
|
+
const count=purposeCount(value);
|
|
12
|
+
return html`<label class="field hub-room-purpose-field" for=${id}><span>${rp("title")}</span><input id=${id} value=${value} placeholder=${rp("placeholder")} disabled=${disabled} aria-invalid=${count>200?"true":null} aria-describedby=${`${id}Hint`} onInput=${e=>onValue(e.target.value)} /><small class="note" id=${`${id}Hint`}>${`${rp("hint")} ${count}/200`}</small>${count>200?html`<small class="err" role="alert">${rp("tooLong")}</small>`:null}</label>`;
|
|
13
|
+
}
|
|
14
|
+
export function RoomPurposeHeader({purpose="",onEdit}){
|
|
15
|
+
const [open,setOpen]=useState(false);
|
|
16
|
+
if(!purpose)return onEdit?html`<button type="button" class="hub-room-purpose-trigger" onClick=${onEdit}>${rp("add")}</button>`:null;
|
|
17
|
+
return html`<button type="button" class="hub-room-purpose-trigger" title=${purpose} aria-haspopup="dialog" aria-expanded=${open?"true":"false"} aria-label=${`${rp("title")}: ${purpose}`} onClick=${()=>setOpen(true)}>${purpose}</button>
|
|
18
|
+
${open?html`<${Dialog} title=${rp("title")} onClose=${()=>setOpen(false)} actions=${html`<button type="button" class="btn" onClick=${()=>setOpen(false)}>${rp("close")}</button>`}><p class="hub-room-purpose-full">${purpose}</p></${Dialog}>`:null}`;
|
|
19
|
+
}
|
|
@@ -67,7 +67,7 @@ export function RoomSearch({ client, rooms = [], openRoom, openHit, onClose }) {
|
|
|
67
67
|
}, [onClose]);
|
|
68
68
|
const query = q.trim();
|
|
69
69
|
// A room or chat by its name, or an agent chat by its owner's (what the list's filter matched before).
|
|
70
|
-
const names = useMemo(() => (query ? rooms.filter((r) => [roomLabel(r), r.agent?.owner?.name].some((v) => String(v || "").toLowerCase().includes(query.toLowerCase()))).slice(0, 8) : []), [rooms, query]);
|
|
70
|
+
const names = useMemo(() => (query ? rooms.filter((r) => [roomLabel(r), r.purpose, r.agent?.owner?.name].some((v) => String(v || "").toLowerCase().includes(query.toLowerCase()))).slice(0, 8) : []), [rooms, query]);
|
|
71
71
|
// The messages: debounced; an older answer never replaces a newer query's; "Search older messages" appends.
|
|
72
72
|
const run = async (text, cursor = null) => {
|
|
73
73
|
const mine = ++seq.current;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {RoomPurposeField,purposeCount} from "./hub-room-purpose.js";
|
|
1
2
|
// Hub rooms, Room settings (docs/design/hub-rooms-ux.md section 7), opened from the room's header menu or the members
|
|
2
3
|
// panel's 「房間設定」, for a room manager. Three parts:
|
|
3
4
|
// - 基本: the name, 「成員可以 @所有 Agent」, 「新成員看得到」.
|
|
@@ -41,6 +42,9 @@ export function invitedLabel(row) {
|
|
|
41
42
|
export function RoomSettings({ client = hubClient(), roomId, detail, onClose, onChanged, assistant } = {}) {
|
|
42
43
|
const room = detail?.room ?? {}, settings = detail?.settings ?? {}, members = Array.isArray(detail?.members) ? detail.members : [];
|
|
43
44
|
const invited = Array.isArray(detail?.invited) ? detail.invited : [];
|
|
45
|
+
const [purpose,setPurpose]=useState(room.purpose??"");
|
|
46
|
+
useEffect(()=>setPurpose(room.purpose??""),[roomId,room.purpose]);
|
|
47
|
+
const purposeSupported=client.roomPurposeV1===true&&typeof room.purpose==="string"&&detail?.me?.role==="manager";
|
|
44
48
|
const [name, setName] = useState(room.name ?? ""), [busy, setBusy] = useState(false), [error, setError] = useState("");
|
|
45
49
|
const [allMention, setAllMention] = useState(settings.allMention !== false), [history, setHistory] = useState(settings.historyForNew === "all" ? "all" : "since-join");
|
|
46
50
|
const [aiApps,setAiApps]=useState(settings.aiApps!==false);
|
|
@@ -66,6 +70,10 @@ export function RoomSettings({ client = hubClient(), roomId, detail, onClose, on
|
|
|
66
70
|
else { undo?.(); if (!refused?.(r)) setError(r?.status === 409 && r.code === "last-manager" ? hroom("lastManager") : hs("saveFailed")); }
|
|
67
71
|
return r;
|
|
68
72
|
};
|
|
73
|
+
const savePurpose=()=>{
|
|
74
|
+
if(!purposeSupported||purposeCount(purpose)>200||purpose===(room.purpose??""))return;
|
|
75
|
+
void act(()=>client.updateRoom(roomId,{purpose}));
|
|
76
|
+
};
|
|
69
77
|
const saveName = () => {
|
|
70
78
|
const title = name.trim();
|
|
71
79
|
if (!title) { setError(hroom("nameRequired")); return; }
|
|
@@ -110,6 +118,7 @@ export function RoomSettings({ client = hubClient(), roomId, detail, onClose, on
|
|
|
110
118
|
<div class="field-row"><input id="hubRoomSettingsName" maxlength=${NAME_MAX} autocomplete="off" value=${name} onInput=${(e) => setName(e.target.value)} />
|
|
111
119
|
<button type="button" class="btn" disabled=${busy || name.trim() === (room.name ?? "")} onClick=${saveName}>${hs("save")}</button></div>
|
|
112
120
|
</form>
|
|
121
|
+
${purposeSupported?html`<form class="form hub-room-purpose-form" onSubmit=${e=>{e.preventDefault();savePurpose();}}><${RoomPurposeField} id="hubRoomSettingsPurpose" value=${purpose} onValue=${setPurpose} disabled=${busy} /><div class="field-row"><button type="submit" class="btn" disabled=${busy||purposeCount(purpose)>200||purpose===(room.purpose??"")}>${hs("save")}</button></div></form>`:null}
|
|
113
122
|
<label class="check"><input id="hubRoomAllMention" class="s-ui-toggle" type="checkbox" role="switch" checked=${allMention} disabled=${busy}
|
|
114
123
|
onChange=${(e) => { const v = e.target.checked; setAllMention(v); void act(() => client.updateRoom(roomId, { allMention: v }), () => setAllMention(!v)); }} /><span>${hroom("membersCanAll")}</span></label>
|
|
115
124
|
${typeof settings.aiApps==="boolean"&&typeof client.setRoomAiApps==="function"?html`<label class="check"><input id="hubRoomAiApps" class="s-ui-toggle" type="checkbox" role="switch" checked=${aiApps} disabled=${busy}
|
|
@@ -3,6 +3,7 @@ import { html, render } from "/assets/app-html.js";
|
|
|
3
3
|
import { Icon } from "/assets/ui-icons.js";
|
|
4
4
|
import { toast } from "/assets/ui-toast.js";
|
|
5
5
|
import { hsource } from "./hub-room-source-strings.js";
|
|
6
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
6
7
|
|
|
7
8
|
export function roomSource(author) {
|
|
8
9
|
if (!author) return null;
|
|
@@ -18,7 +19,7 @@ export function RoomSourceMark({ source, decorative = false }) {
|
|
|
18
19
|
if (!source) return null;
|
|
19
20
|
return html`<span class="hub-source-mark" data-room-source=${source.kind} role=${decorative ? undefined : "img"}
|
|
20
21
|
aria-hidden=${decorative ? "true" : undefined} aria-label=${decorative ? undefined : source.label} title=${source.label}>
|
|
21
|
-
${source.kind === "agend" ? html`<img src
|
|
22
|
+
${source.kind === "agend" ? html`<img src=${assetUrl("/assets/agend-mark.svg")} width="16" height="16" alt="" aria-hidden="true" />` : html`<${Icon} name="view" size=${16} />`}
|
|
22
23
|
</span>`;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -38,7 +38,7 @@ register("hubRoom", {
|
|
|
38
38
|
searchResults: "Results", searchRooms: "Rooms and chats", searchBadgeRoom: "Room", searchBadgeChat: "Chat", searchCount: "{0} results",
|
|
39
39
|
searchOlder: "Search older messages", searchKeys: "↑↓ move · Enter open · Esc close", jumpMissing: "That message is no longer in this room.",
|
|
40
40
|
filterPh: "Filter: name or owner", filterClear: "Clear the filter",
|
|
41
|
-
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
41
|
+
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerUnanswered:"No answer: The agent finished without answering here", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
42
42
|
workingOne: "{0} is working on it", workingMany: "{0} agents are working",
|
|
43
43
|
// §4 composer
|
|
44
44
|
composer: "Speak in “{0}”; @ an agent to have it answer",
|
|
@@ -73,6 +73,7 @@ register("hubRoom", {
|
|
|
73
73
|
addAssistant: "Add a room assistant (provided by the Hub)",
|
|
74
74
|
create: "Create", cancel: "Cancel",
|
|
75
75
|
createdSys: "{0} created this room.",
|
|
76
|
+
purposeSetSys:"{0} set the purpose: {1}",purposeClearedSys:"{0} cleared the purpose.",
|
|
76
77
|
sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
|
|
77
78
|
invitedSys: "{0} agents invited; they join when the owner agrees.",
|
|
78
79
|
nameRequired: "Enter a room name.",
|
|
@@ -141,7 +142,7 @@ register("hubRoom", {
|
|
|
141
142
|
// The @ progress line in parts, a part with 0 left out (Lumen): "Answered 1 · Working 1".
|
|
142
143
|
progAnswered: "Answered {0}", progWorking: "Working {0}", progLater: "Reply later {0}",
|
|
143
144
|
progFailed: "Failed {0}", progBlocked: "Blocked {0}",
|
|
144
|
-
reasonExpired: "The question expired before an answer", reasonUnavailable: "The room assistant could not answer",
|
|
145
|
+
reasonUnanswered:"The agent finished without answering here", reasonExpired: "The question expired before an answer", reasonUnavailable: "The room assistant could not answer",
|
|
145
146
|
reasonInterrupted: "The answer was interrupted", reasonRetired: "This agent could not answer", reasonUnknown: "No reason given",
|
|
146
147
|
roomsCanAskIt: "People in its rooms can @ it there. See In these rooms.", invitationsTitle: "Invitations",
|
|
147
148
|
},
|
|
@@ -171,7 +172,7 @@ register("hubRoom", {
|
|
|
171
172
|
searchResults: "結果", searchRooms: "房間與聊天", searchBadgeRoom: "房間", searchBadgeChat: "聊天", searchCount: "{0} 筆結果",
|
|
172
173
|
searchOlder: "搜尋更早的訊息", searchKeys: "↑↓ 移動 · Enter 開啟 · Esc 關閉", jumpMissing: "這則訊息已不在這個房間裡。",
|
|
173
174
|
filterPh: "篩選:名稱或擁有者", filterClear: "清除篩選",
|
|
174
|
-
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
175
|
+
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerUnanswered:"沒有回答:Agent 已結束處理,但沒有在這裡回答。", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
175
176
|
workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
|
|
176
177
|
composer: "在「{0}」說話;@ 一個 Agent 請它回答",
|
|
177
178
|
composerShort: "說話,或 @ Agent 請它回答",
|
|
@@ -203,6 +204,7 @@ register("hubRoom", {
|
|
|
203
204
|
addAssistant: "加入房間助理(Hub 提供)",
|
|
204
205
|
create: "建立", cancel: "取消",
|
|
205
206
|
createdSys: "{0} 建立了這個房間。",
|
|
207
|
+
purposeSetSys:"{0} 設定了用途:{1}",purposeClearedSys:"{0} 清除了用途。",
|
|
206
208
|
sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
|
|
207
209
|
invitedSys: "已邀請 {0} 個 Agent,擁有者同意後會加入。",
|
|
208
210
|
nameRequired: "請輸入房間名稱。",
|
|
@@ -260,7 +262,7 @@ register("hubRoom", {
|
|
|
260
262
|
peopleOne: "1 人", peopleMany: "{0} 人", agentsOne: "1 個 Agent", agentsMany: "{0} 個 Agent",
|
|
261
263
|
progAnswered: "已回答 {0}", progWorking: "處理中 {0}", progLater: "稍後回覆 {0}",
|
|
262
264
|
progFailed: "未回答 {0}", progBlocked: "無法回答 {0}",
|
|
263
|
-
reasonExpired: "問題在回答前就過期了", reasonUnavailable: "房間助理暫時無法回答",
|
|
265
|
+
reasonUnanswered:"Agent 已結束處理,但沒有在這裡回答", reasonExpired: "問題在回答前就過期了", reasonUnavailable: "房間助理暫時無法回答",
|
|
264
266
|
reasonInterrupted: "回答被中斷", reasonRetired: "這個 Agent 無法回答", reasonUnknown: "沒有說明原因",
|
|
265
267
|
roomsCanAskIt: "房間裡的人可以在房間裡 @ 它,見「在這些房間裡」。", invitationsTitle: "邀請",
|
|
266
268
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {RoomPurposeHeader} from "./hub-room-purpose.js";
|
|
1
2
|
import { hi } from "./hub-agent-intro.js";
|
|
2
3
|
import {hp} from "./hub-personal-agent-strings.js";
|
|
3
4
|
// M-3092 PR 2 (Hub rooms, track U): one room of a Hub with rooms, on the Fleet chat's own thread (/assets/chat-thread.js
|
|
@@ -24,19 +25,44 @@ import { firstCharacter } from "/assets/instance-nav.js";
|
|
|
24
25
|
import { hroom } from "./hub-room-strings.js";
|
|
25
26
|
import {ha} from "./hub-ai-apps-strings.js";
|
|
26
27
|
import { RoomComposer } from "./hub-room-composer.js";
|
|
27
|
-
import { TextSizeButton } from "/assets/header-tools.js";
|
|
28
|
+
import { TextSizeButton, TEXT_SIZES, setTextSize, textSizeStore } from "/assets/header-tools.js";
|
|
29
|
+
import { useStore } from "/assets/app-store.js";
|
|
30
|
+
import { notifyStore, notifySupport, setNotify } from "/assets/app-needs.js";
|
|
28
31
|
import { HubNotifyToggle } from "./hub-room-notify.js";
|
|
29
32
|
import { createHubButtonActions } from "./hub-button-actions.js";
|
|
30
33
|
import { linkRoomsU2Css } from "./hub-room-new-strings.js";
|
|
31
34
|
import { workingLine } from "./hub-room-working.js";
|
|
32
35
|
import { roomSource, mountSourceAuthor } from "./hub-room-source.js";
|
|
33
36
|
import { countsLine } from "./hub-room-list.js";
|
|
34
|
-
import { PendingFiles, hf, hubFileAttachment, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
|
|
37
|
+
import { DropOverlay, MAX_FILES, PendingFiles, hf, hubFileAttachment, pageCarriesFiles, putBackText, roomTakesFiles, uploadChosen, useFileDrop } from "./hub-attachments.js";
|
|
35
38
|
import { LightboxHost, openLightbox } from "/assets/image-lightbox.js";
|
|
36
39
|
// M-3125 PR3: the one quote target an annotated room picture has (here, so a page with an older dictionary has the words).
|
|
37
40
|
register("hubRoomAnnotate", { en: { quote: "Quote in this room" }, "zh-TW": { quote: "引用到這個房間" } });
|
|
38
41
|
|
|
39
42
|
linkRoomsU2Css(); // M-3127: the reaction chips and picker are drawn from hub-rooms-u2.css (a room opened before any U2 panel)
|
|
43
|
+
/**
|
|
44
|
+
* M-3311 (3): the Fleet chat's 「全寬」 for a Hub conversation — this device's choice (as the Fleet keeps its own), its own key:
|
|
45
|
+
* a Hub page has no Fleet module to share it with.
|
|
46
|
+
*/
|
|
47
|
+
const WIDE_KEY = "agend_hub_chat_wide";
|
|
48
|
+
export function hubChatWide() { try { return localStorage.getItem(WIDE_KEY) === "on"; } catch { return false; } }
|
|
49
|
+
function setHubChatWide(on) { try { if (on) localStorage.setItem(WIDE_KEY, "on"); else localStorage.removeItem(WIDE_KEY); } catch { /* this tab only */ } }
|
|
50
|
+
/** The Fleet chat's narrow screen (panel-chat.js narrowScreen): no 「全寬」 there — the column is the screen's already. */
|
|
51
|
+
const NARROW_QUERY = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
52
|
+
/**
|
|
53
|
+
* M-3311 (#4162 review): the narrow screen, kept current as the window is resized — hub-chat.css hides the header's text size
|
|
54
|
+
* and Notify at this same width, so ⋯ gains (or drops) them at once, not at the next render.
|
|
55
|
+
*/
|
|
56
|
+
function useNarrowScreen() {
|
|
57
|
+
const q = (() => { try { return typeof matchMedia === "function" ? matchMedia(NARROW_QUERY) : null; } catch { return null; } })();
|
|
58
|
+
const [narrow, setNarrow] = useState(() => !!q?.matches);
|
|
59
|
+
useEffect(() => { if (!q) return undefined; const on = () => setNarrow(!!q.matches); on(); q.addEventListener?.("change", on); return () => q.removeEventListener?.("change", on); }, []);
|
|
60
|
+
return narrow;
|
|
61
|
+
}
|
|
62
|
+
/** M-3311 (3): a room message's address — what Copy link copies; opening it shows that message (jumpParam). */
|
|
63
|
+
export const messageLink = (roomId, messageId) => `${location.origin}/ui/hub?room=${encodeURIComponent(roomId)}${messageId ? `&m=${encodeURIComponent(messageId)}` : ""}`;
|
|
64
|
+
/** M-3311 (#4159 review): a room row's Copy link — only a message with an address (a room message's id); otherwise none. */
|
|
65
|
+
export const roomLinkOf = (roomId) => (x) => (x && x.roomMessage ? messageLink(roomId, x.roomMessage) : null);
|
|
40
66
|
/** M-3127 C: the message a search hit opens (`?room=…&m=<id>`), or null. */
|
|
41
67
|
export const jumpParam = () => { try { const v = new URLSearchParams(location.search).get("m"); return v && /^[A-Za-z0-9-]{1,64}$/.test(v) ? v : null; } catch { return null; } };
|
|
42
68
|
const iso = (ms) => (Number.isFinite(ms) && ms > 0 ? new Date(ms).toISOString() : undefined);
|
|
@@ -66,6 +92,7 @@ export function authorLine(author, mine = false, direct = false) {
|
|
|
66
92
|
*/
|
|
67
93
|
const SYSTEM = { "room-created": "createdSys", "member-joined": "sysJoined", "admin-joined": "sysAdminJoined", "poll-closed": "sysPollClosed" };
|
|
68
94
|
export function systemText(m) {
|
|
95
|
+
if(m?.system?.kind==="purpose-changed"&&typeof m.system.purpose==="string"&&typeof m.system.name==="string")return hroom(m.system.purpose?"purposeSetSys":"purposeClearedSys",m.system.name,m.system.purpose);
|
|
69
96
|
if(m?.system?.kind==="app-rate-limited")return ha("rateLimited",m.system.name||"");
|
|
70
97
|
if (m?.system?.kind === "agent-mention-stopped") return agentStopText(m.system) ?? String(m.text || "");
|
|
71
98
|
const key = m && m.system && SYSTEM[m.system.kind];
|
|
@@ -78,7 +105,7 @@ export function systemText(m) {
|
|
|
78
105
|
* child counts as failed.
|
|
79
106
|
*/
|
|
80
107
|
const count = (v) => (Number.isSafeInteger(v) && v > 0 ? v : 0);
|
|
81
|
-
const REASON = { expired: "reasonExpired", unavailable: "reasonUnavailable", interrupted: "reasonInterrupted", retired: "reasonRetired", unknown: "reasonUnknown" };
|
|
108
|
+
const REASON = { "finished-without-answer":"reasonUnanswered",expired: "reasonExpired", unavailable: "reasonUnavailable", interrupted: "reasonInterrupted", retired: "reasonRetired", unknown: "reasonUnknown" };
|
|
82
109
|
export function askReason(code) { return REASON[code] ? hroom(REASON[code]) : ""; }
|
|
83
110
|
export function askState(ask) {
|
|
84
111
|
if (!ask || !Number.isSafeInteger(ask.total) || ask.total < 1) return null;
|
|
@@ -173,7 +200,7 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
173
200
|
...(!direct && Array.isArray(m.reactions) && m.reactions.length ? { reactionBar: reactionBar(m.reactions, { meId, names }) } : {}),
|
|
174
201
|
...(!direct && kind !== "person" && m.buttons ? { buttons: roomButtons(m.buttons, meId) } : {}),
|
|
175
202
|
...(quotedId ? { replyTo: { boot: BOOT, id: num(quotedId), sender: quoted ? authorLine(quoted.author, quoted.author?.id === meId, direct) : "", text: quoted ? String(quoted.text || "").slice(0, 120) : "" } } : {}),
|
|
176
|
-
...(m.stage === "not-answered" ? { text: m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : hroom("noAnswer") } : {}) });
|
|
203
|
+
...(m.stage === "not-answered" ? { text: m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : m.reasonCode==="finished-without-answer"?hroom("noAnswerUnanswered"):hroom("noAnswer") } : {}) });
|
|
177
204
|
if (foldAfter) out.push({ boot: BOOT, id: num(`expand:${foldAfter.arg}`), role: "status", sender: "", text: "", bare: true, fold: true, action: foldAfter });
|
|
178
205
|
// Spec §10: once an @所有 Agent has answers, under the last one shown, 「請房間助理整理」 (it sends 「@房間助理 整理上面的回答」).
|
|
179
206
|
if (summarise && lastShown && byId.get(m.answerTo)?.mentions?.includes("all"))
|
|
@@ -385,12 +412,20 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
385
412
|
useEffect(() => { const id = detail && detail.me && detail.me.id; if (id) onMe(roomId, id); }, [detail && detail.me && detail.me.id]);
|
|
386
413
|
// M-3125: Attach only where this page and this room carry files and the room is open; chosen files ride the next send.
|
|
387
414
|
const takesFiles = pageCarriesFiles(client, store) && roomTakesFiles(room) && !store.closed();
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
415
|
+
// M-3311: `left` (what still fits) and `notice` serve a paste and a drop as the Fleet chat's (hub-attachments.js pasteToAttach).
|
|
416
|
+
const attach = takesFiles ? { title: hf("attach"), left: () => MAX_FILES - filesRef.current.length, notice: (text) => { if (alive.current) toast(text); },
|
|
417
|
+
onFiles: async (list) => {
|
|
418
|
+
setFileMsg("");
|
|
419
|
+
const refused = await uploadChosen(client, room.id || roomId, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
|
|
420
|
+
if (alive.current && refused.length) setFileMsg(refused.join(" "));
|
|
421
|
+
return refused;
|
|
422
|
+
} } : null;
|
|
423
|
+
// M-3311 (1): a file dragged onto the conversation is attached, as in the Fleet chat.
|
|
424
|
+
const mainRef = useRef(null);
|
|
425
|
+
useFileDrop(mainRef, attach);
|
|
426
|
+
// M-3311 (3): a long paste's chip — 「改為文字」 puts its text back into the box (the Fleet chat's), and the chip goes.
|
|
427
|
+
const asText = (key) => { const f = filesRef.current.find((x) => x.key === key); if (!f) return; setFiles(filesRef.current.filter((x) => x.key !== key)); putBackText(input.current, f.text); input.current?.focus(); };
|
|
428
|
+
const pending = files.length || fileMsg ? html`<${PendingFiles} files=${files} onAsText=${asText} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
|
|
394
429
|
formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />${fileMsg ? html`<p class="note" role="alert">${fileMsg}</p>` : null}` : null;
|
|
395
430
|
// The composer sends through the store; this one adds the ready files, waits for uploads, and clears only what was sent.
|
|
396
431
|
const annotateRef = useRef(null);
|
|
@@ -467,7 +502,25 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
467
502
|
// composer's files (uploaded like any chosen file) and the reply quotes the message it came from. Read at click time
|
|
468
503
|
// (the thread keeps its options from its first render).
|
|
469
504
|
openImage: (links, img) => openLightbox(links, img, annotateRef.current(img)),
|
|
505
|
+
// M-3311 (2): 「引用」 on a selected passage goes into this room's box (read at selection time).
|
|
506
|
+
quote: { field: () => input.current, can: () => !store.closed() },
|
|
507
|
+
// M-3311 (3): the Fleet chat's Copy link — a room message's address (opening it shows that message).
|
|
508
|
+
linkOf: roomLinkOf(roomId),
|
|
470
509
|
};
|
|
510
|
+
// M-3311 (3): the header's menu — a group room's Room settings and Leave, and on a desk the Fleet chat's 「全寬」 for any room.
|
|
511
|
+
const [fullWidth, setFullWidth] = useState(hubChatWide);
|
|
512
|
+
const textSize = useStore(textSizeStore), notify = useStore(notifyStore), narrow = useNarrowScreen();
|
|
513
|
+
const menuItems = [
|
|
514
|
+
group && detail?.me?.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
|
|
515
|
+
group && detail?.me ? { key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } } : null,
|
|
516
|
+
!narrow && detail?.me ? { key: "fullWidth", checkbox: true, checked: fullWidth, label: t("chat.fullWidth"), onSelect: () => { setHubChatWide(!fullWidth); setFullWidth(!fullWidth); } } : null,
|
|
517
|
+
// M-3311 (4): a phone's header is one row (back, the room, members, ⋯) as the Fleet chat's — its text size and Notify
|
|
518
|
+
// move into ⋯ there (hub-chat.css hides the two buttons at the same width).
|
|
519
|
+
...(narrow ? [
|
|
520
|
+
{ key: "textSize", label: t("app.textSize", t(`app.textSize_${textSize.size}`)), icon: "type", onSelect: () => setTextSize(TEXT_SIZES[(TEXT_SIZES.indexOf(textSize.size) + 1) % TEXT_SIZES.length]) },
|
|
521
|
+
...(notifySupport() === "ok" ? [{ key: "notify", checkbox: true, checked: notify.state === "on", disabled: notify.asking, label: hroom("notifyTitle"), onSelect: () => { void setNotify(notify.state !== "on"); } }] : []),
|
|
522
|
+
] : []),
|
|
523
|
+
].filter(Boolean);
|
|
471
524
|
const line2 = group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
|
|
472
525
|
: room.assistant ? hroom("providedByHub") : room.agent?.answerOnly ? hp("answerOnlyAsker") : String(room.agent?.owner?.name || "");
|
|
473
526
|
const showRail = wide && rail && Panel && group && detail;
|
|
@@ -478,22 +531,20 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
478
531
|
onMention=${(m) => { setSheet(false); insert.current?.(`@${m.name}`); }}
|
|
479
532
|
onOpenChat=${(m) => { const direct = rooms.find((r) => r.kind === "direct" && r.agent?.exposureId === m.id); if (direct) openRoom(direct.id); }}
|
|
480
533
|
onSettings=${() => { setSheet(false); openSettings(); }} />` : null;
|
|
481
|
-
return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId}>
|
|
534
|
+
return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId} data-width=${fullWidth ? "full" : undefined}>
|
|
482
535
|
<${LightboxHost} />
|
|
483
|
-
<section class="hub-chat-main">
|
|
536
|
+
<section class="hub-chat-main" ref=${mainRef}>
|
|
537
|
+
${attach ? html`<${DropOverlay} />` : null}
|
|
484
538
|
<header class=${`hub-chat-head${room.agent?.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">
|
|
485
539
|
${/* Lumen (spec §2): on a phone the header starts with the Fleet chat's back to the list. */ ""}
|
|
486
540
|
<a class="icon-btn hub-back only-narrow" href="/ui/hub" aria-label=${t("hub.back")} title=${t("hub.back")}
|
|
487
541
|
onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); goList(); }}><${Icon} name="back" /></a>
|
|
488
542
|
<span class=${`av${group ? " av-square" : ""}`} aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>
|
|
489
|
-
<span class="hub-chat-title"><strong>${title}</strong
|
|
543
|
+
<span class="hub-chat-title"><strong>${title}</strong>${group&&typeof room.purpose==="string"?html`<${RoomPurposeHeader} purpose=${room.purpose} onEdit=${detail?.me?.role==="manager"&&client.roomPurposeV1===true?openSettings:undefined} />`:null}<span class=${`s${room.agent?.answerOnly?" hub-answer-only-note":""}`}>${line2}</span>${room.assistant||room.agent?.intro?html`<span class="s hub-agent-intro-line">${room.assistant?hi("assistant"):room.agent.intro}</span>`:null}</span>
|
|
490
544
|
<span class="hub-head-tools"><${TextSizeButton} /><${HubNotifyToggle} /></span>
|
|
491
545
|
${group && Panel ? html`<button type="button" class="icon-btn hub-room-rail-toggle" aria-pressed=${(wide ? rail : sheet) ? "true" : "false"} title=${hroom("members")} aria-label=${hroom("members")}
|
|
492
546
|
onClick=${() => (wide ? setRail(!rail) : setSheet(true))}><${Icon} name="team" size=${18} /></button>` : null}
|
|
493
|
-
${
|
|
494
|
-
detail.me.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
|
|
495
|
-
{ key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } },
|
|
496
|
-
].filter(Boolean)} />` : null}
|
|
547
|
+
${menuItems.length ? html`<${Menu} cls="hub-room-menu" label=${hroom("menu")} fit=${true} ownerKey=${roomId} items=${menuItems} />` : null}
|
|
497
548
|
</header>
|
|
498
549
|
${leaveError ? html`<p class="err hub-room-leave-err" role="alert">${leaveError}</p>` : null}
|
|
499
550
|
${room.closureReason === "owner-stopped-sharing" ? html`<p class="note" role="status">${hroom("noAnswerStopped", room.ownerName || room.agent?.owner?.name || "")}</p>` : null}
|
package/dist/ui/hub-strings.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// A lazy module of its own: loaded only with a Hub page or card, never while the Hub is off. It imports only names every
|
|
3
3
|
// shell has had since #1408 (register / t), so a tab opened before an upgrade loads it as fresh as the rest.
|
|
4
4
|
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
5
6
|
|
|
6
7
|
register("hub", {
|
|
7
8
|
en: {
|
|
@@ -172,7 +173,7 @@ export function linkHubCss(doc = typeof document !== "undefined" ? document : nu
|
|
|
172
173
|
try {
|
|
173
174
|
if (!doc || !doc.head || doc.querySelector('link[data-hub-css="1"]')) return;
|
|
174
175
|
const link = doc.createElement("link");
|
|
175
|
-
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub.css"); link.setAttribute("data-hub-css", "1");
|
|
176
|
+
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/hub.css")); link.setAttribute("data-hub-css", "1");
|
|
176
177
|
doc.head.appendChild(link);
|
|
177
178
|
} catch { /* the pages still work without it */ }
|
|
178
179
|
}
|
package/dist/ui/hub-teams.js
CHANGED
|
@@ -3,6 +3,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
|
3
3
|
import { Icon } from "/assets/ui-icons.js";
|
|
4
4
|
import { navigate } from "/assets/app-nav.js";
|
|
5
5
|
import { ht } from "./hub-teams-strings.js";
|
|
6
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
6
7
|
|
|
7
8
|
const changes = new Set();
|
|
8
9
|
const changed = () => { for (const fn of changes) fn(); };
|
|
@@ -18,7 +19,7 @@ export function linkHubTeamsCss(doc = typeof document === "undefined" ? null : d
|
|
|
18
19
|
if (!doc?.head) return Promise.resolve(false);
|
|
19
20
|
if (cssLoads.has(doc)) return cssLoads.get(doc);
|
|
20
21
|
const promise = new Promise(resolve => {
|
|
21
|
-
const link = doc.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-teams.css");
|
|
22
|
+
const link = doc.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/hub-teams.css"));
|
|
22
23
|
link.setAttribute("data-hub-teams-css", "1");
|
|
23
24
|
link.addEventListener("load", () => resolve(true), { once: true });
|
|
24
25
|
link.addEventListener("error", () => { link.remove(); cssLoads.delete(doc); resolve(false); }, { once: true });
|
package/dist/ui/model-picker.js
CHANGED
|
@@ -4,14 +4,15 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
4
4
|
import { Icon } from "/assets/ui-icons.js";
|
|
5
5
|
import { ErrorState } from "/assets/ui-states.js";
|
|
6
6
|
import * as catalogStore from "./settings-catalog.js";
|
|
7
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
7
8
|
register("modelPicker", {
|
|
8
9
|
en: { refresh: "Refresh models", refreshing: "Refreshing models…", refreshed: "Model list refreshed.", failed: "Could not refresh models. The previous list and selection are kept.", more: "More models…", backend: "Choose backend", model: "Choose model", next: "Choose a backend; next choose its model and reasoning effort.", current: "Selected", nativeFailed: "Could not refresh models on this computer. Update its Runtime if needed and check that its owner allows account access. The previous list and selection are kept.", keep: "Refreshing keeps the selected model.", selectionHint: "Refresh keeps your selection; choose a model to apply it.", accountSource: "Source: selected account’s model listing.", effort: "Choose reasoning effort", effortFor: "Choose the effort for {0}", effortAuto: "Auto" },
|
|
9
10
|
"zh-TW": { refresh: "重新整理模型", refreshing: "正在重新整理模型…", refreshed: "模型清單已更新。", failed: "無法重新整理模型。已保留原清單與選擇。", more: "更多模型…", backend: "選擇後端", model: "選擇模型", next: "選擇後端;下一步選模型與推理強度", current: "已選擇", nativeFailed: "無法在這台電腦重新整理模型。請確認 Runtime 已更新,且電腦擁有者允許存取帳號;已保留原清單與選擇。", keep: "重新整理會保留已選模型。", selectionHint: "重新整理只更新清單;選擇模型才會套用。", accountSource: "來源:已選帳號的模型清單。", effort: "選擇推理強度", effortFor: "選擇 {0} 的推理強度", effortAuto: "自動" },
|
|
10
11
|
});
|
|
11
12
|
export const mw = (key, ...args) => t(`modelPicker.${key}`, ...args);
|
|
12
13
|
export function modelPickerStyles() {
|
|
13
|
-
if (typeof document === "undefined" || !document.head || document.querySelector(
|
|
14
|
-
const link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/model-picker.css"); document.head.appendChild(link);
|
|
14
|
+
if (typeof document === "undefined" || !document.head || document.querySelector(`link[href="${assetUrl("/assets/model-picker.css")}"]`)) return;
|
|
15
|
+
const link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/model-picker.css")); document.head.appendChild(link);
|
|
15
16
|
}
|
|
16
17
|
const answers = new Map(); // share only in-flight passive reads; the server owns catalog freshness
|
|
17
18
|
export function forgetModelPickerCatalogs() { answers.clear(); catalogStore.forgetCatalogs?.(); }
|