@songsid/agend 2.4.0-beta.22 → 2.4.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-whats-new.js +6 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +5 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +17 -3
- package/dist/authority/web-authority.js +56 -3
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +8 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +2 -2
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/contact-auth-api.js +3 -1
- package/dist/contact-auth-api.js.map +1 -1
- package/dist/contact-auth-service.js +1 -1
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +28 -2
- package/dist/contact-auth-store.js +72 -4
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +18 -1
- package/dist/contact-change-proposals.js +38 -4
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/contact-state-view.d.ts +103 -0
- package/dist/contact-state-view.js +80 -0
- package/dist/contact-state-view.js.map +1 -0
- package/dist/fleet-manager.d.ts +143 -15
- package/dist/fleet-manager.js +455 -78
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
- package/dist/general-knowledge/skills/concepts/SKILL.md +14 -17
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +54 -9
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/hub/client.js +6 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +2 -1
- package/dist/hub/compose/member.js +3 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.js +5 -0
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/protocol.d.ts +21 -0
- package/dist/hub/protocol.js +3 -0
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/question-close-model.d.ts +17 -0
- package/dist/hub/question-close-model.js +7 -0
- package/dist/hub/question-close-model.js.map +1 -0
- package/dist/hub/representative.d.ts +5 -0
- package/dist/hub/representative.js +51 -1
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/rooms/direct-view.js +1 -0
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +1 -1
- package/dist/hub/rooms.d.ts +3 -0
- package/dist/hub/rooms.js +27 -1
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -2
- package/dist/human-delivery-receipts.d.ts +12 -2
- package/dist/human-delivery-receipts.js +19 -4
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +100 -12
- package/dist/locale.js.map +1 -1
- package/dist/needs-you.d.ts +2 -0
- package/dist/needs-you.js +2 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +4 -0
- package/dist/outbound-handlers.js +40 -5
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +2 -1
- package/dist/outbound-schemas.js +3 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +18 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +2 -1
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/tool-permissions.js +1 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +2 -1
- package/dist/ui/chat-activity.js +2 -1
- package/dist/ui/chat-pins.js +2 -1
- package/dist/ui/claude-credentials.js +2 -1
- package/dist/ui/contact-auth-strings.js +28 -17
- package/dist/ui/contact-authorizations.js +6 -4
- package/dist/ui/contact-needs.js +6 -1
- package/dist/ui/contact-permissions.js +6 -4
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/contact-verify-need.js +46 -0
- package/dist/ui/fleet-cache.js +2 -1
- package/dist/ui/fleet-office-skin.js +10 -6
- package/dist/ui/fleet-office-zones.js +22 -9
- package/dist/ui/fleet-office.js +16 -9
- package/dist/ui/fleet-org.js +6 -1
- package/dist/ui/fleet-tab-icons.js +19 -0
- package/dist/ui/fleet-task-activity.js +2 -1
- package/dist/ui/fleet-task-view.js +2 -1
- package/dist/ui/fleet-usage.js +2 -1
- package/dist/ui/hub-admin-overview.js +2 -1
- package/dist/ui/hub-agent-intro.js +2 -1
- package/dist/ui/hub-assistant-admin.js +2 -1
- package/dist/ui/hub-directory-notices.js +2 -1
- package/dist/ui/hub-enrolment-code.js +2 -1
- package/dist/ui/hub-my-agents.js +2 -1
- package/dist/ui/hub-quick-pairing.js +2 -1
- package/dist/ui/hub-role-audit.js +2 -1
- package/dist/ui/hub-role-forms.js +3 -2
- package/dist/ui/hub-role-view.js +3 -2
- package/dist/ui/hub-roles.js +2 -1
- package/dist/ui/hub-room-agent-strings.js +2 -1
- package/dist/ui/hub-room-list.js +2 -1
- package/dist/ui/hub-room-owner-requests.js +2 -1
- package/dist/ui/hub-room-pins.js +2 -1
- package/dist/ui/hub-room-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +1 -1
- package/dist/ui/log-row.js +4 -3
- package/dist/ui/office-share-dialog.js +2 -1
- package/dist/ui/office-share-page.js +2 -1
- package/dist/ui/page-share-dialog.js +3 -2
- package/dist/ui/panel-chat.js +2 -1
- package/dist/ui/panel-details.js +2 -1
- package/dist/ui/panel-fleet.js +10 -5
- package/dist/ui/panel-hub.js +2 -1
- package/dist/ui/panel-needs.js +31 -3
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/panel-windows-cli.js +3 -2
- package/dist/ui/runtime-cli-install.js +2 -1
- package/dist/ui/settings-appearance.js +2 -1
- package/dist/ui/settings-guests.js +4 -3
- package/dist/ui/settings-hub-member-address.js +2 -1
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-hub-web-address.js +2 -1
- package/dist/ui/settings-hub.js +2 -1
- package/dist/ui/settings-update.js +2 -1
- package/dist/ui/settings-web-authority.js +2 -1
- package/dist/ui/shared/agent-sheet.js +2 -1
- package/dist/ui/shared/app-session.js +4 -3
- package/dist/ui/shared/app-shell.js +6 -2
- package/dist/ui/shared/app.css +38 -8
- package/dist/ui/shared/chat-time.js +7 -4
- package/dist/ui/shared/clock-text.js +57 -0
- package/dist/ui/shared/device-roles.js +6 -5
- package/dist/ui/shared/instance-nav.js +17 -22
- package/dist/ui/shared/usage-dialog.js +2 -1
- package/dist/ui/shared/view-strings.js +0 -14
- package/dist/ui/shared/web-authorize.js +3 -2
- package/dist/ui/subagent-row.js +2 -1
- package/dist/web-api.d.ts +15 -2
- package/dist/web-api.js +62 -13
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +6 -1
- package/dist/web-login.js +8 -3
- package/dist/web-login.js.map +1 -1
- package/dist/web-session-authorization.d.ts +3 -0
- package/dist/web-session-authorization.js +1 -1
- package/dist/web-session-authorization.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
2
2
|
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
3
4
|
register("hubIntro", {
|
|
4
5
|
en: {title:"Introduction",hint:"One line about what this agent handles. Colleagues can see it. Up to 50 characters.",placeholder:"I handle…",save:"Save introduction",failed:"Could not save the introduction. Try again.",saved:"Saved. The agent can still change it later; this line shows who changed it last.",edit:"Edit",close:"Close",owner:"Last changed by the owner",agent:"Last changed by the agent",default:"From the Fleet description",review:"Colleagues will see this line. Check it and save.",cut:"Your earlier description was longer; only the first 50 characters are shown here.",assistant:"Hub assistant. Answers from this room's chat."},
|
|
5
6
|
"zh-TW": {title:"自我介紹",hint:"用一句話說明這個 Agent 負責什麼,同仁會看到。最多 50 個字。",placeholder:"我負責…",save:"儲存自我介紹",failed:"無法儲存自我介紹,請再試一次。",saved:"已儲存。Agent 之後仍然可以更改;這一行會顯示最後是誰改的。",edit:"編輯",close:"關閉",owner:"最後由擁有者修改",agent:"最後由 Agent 修改",default:"來自 Fleet 說明",review:"同仁會看到這一行,請確認後儲存。",cut:"你之前的說明比較長,這裡只顯示前 50 個字。",assistant:"Hub 提供的助理,根據這個房間的對話回答。"}
|
|
@@ -20,7 +21,7 @@ export function AgentIntroEditor({exposure,client,onSaved=()=>{},embedded=false}
|
|
|
20
21
|
const Body=embedded?"div":"form";
|
|
21
22
|
return html`<section class=${embedded?"hub-agent-intro":"card hub-agent-intro"}>${embedded?null:html`<h3>${hi("title")}</h3>`}<${Body} class="form" onSubmit=${embedded?undefined:save}>
|
|
22
23
|
<label class="field"><span>${hi("title")}</span><input value=${text} placeholder=${hi("placeholder")} disabled=${busy} onInput=${e=>setText(e.target.value)} aria-invalid=${count>50?"true":null} /><small class="note">${`${hi("hint")} ${count}/50`}</small></label>
|
|
23
|
-
${exposure.introBy?html`<p class="note">${hi(exposure.introBy)}${exposure.introAt?html` · <time datetime=${new Date(exposure.introAt).toISOString()}>${
|
|
24
|
+
${exposure.introBy?html`<p class="note">${hi(exposure.introBy)}${exposure.introAt?html` · <time datetime=${new Date(exposure.introAt).toISOString()}>${dateTimeText(exposure.introAt)}</time>`:null}</p>`:null}
|
|
24
25
|
<div class="field-row"><button type=${embedded?"button":"submit"} onClick=${embedded?save:undefined} class="btn btn-sm btn-primary" disabled=${busy||count>50||text===(exposure.intro??"")}>${hi("save")}</button></div>
|
|
25
26
|
${message?html`<p role="status">${message}</p>`:null}
|
|
26
27
|
</${Body}></section>`;
|
|
@@ -2,6 +2,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
|
2
2
|
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
3
3
|
import { hroom } from "./hub-room-strings.js";
|
|
4
4
|
import { ha } from "./hub-assistant-admin-strings.js";
|
|
5
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
5
6
|
|
|
6
7
|
const fields = value => ({ enabled: value.enabled === true, backend: value.backend, account: value.account ?? null, cap: Number(value.cap), idleMinutes: Number(value.idleMinutes) });
|
|
7
8
|
const validLimits = value => Number.isInteger(Number(value?.cap)) && Number(value.cap) >= 1 && Number(value.cap) <= 16 && Number.isInteger(Number(value?.idleMinutes)) && Number(value.idleMinutes) >= 1 && Number(value.idleMinutes) <= 240;
|
|
@@ -75,7 +76,7 @@ export function HubAssistantAdmin({ client }) {
|
|
|
75
76
|
</form>
|
|
76
77
|
</section>
|
|
77
78
|
<section class="card" aria-label=${hroom("runningNow")}><div class="hub-card-head"><h3>${hroom("runningNow")}</h3><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${() => load(false)}>${ha("refresh")}</button></div>
|
|
78
|
-
${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${
|
|
79
|
+
${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${dateTimeText(row.lastUsed, { dateStyle: "short", timeStyle: "short", hour12: false })}</small></span>
|
|
79
80
|
<span class=${`tag ${row.state === "failed" ? "warn" : ""}`}>${stateWord(row.state)}</span><button type="button" class="btn btn-sm" disabled=${busy || row.state === "stopping"} onClick=${() => stop(row.roomId)}>${hroom("stop")}</button></div>`)}</div>` : html`<p class="note">${ha("noneRunning")}</p>`}
|
|
80
81
|
</section>
|
|
81
82
|
<section class="card" aria-label=${hroom("usage")}><h3>${hroom("usage")}</h3><p class="note">${hroom("usageLead")}</p>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Recipient-only history, fetched on this page only. No stream, polling, implicit ACK or global notice feed. */
|
|
2
2
|
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
3
3
|
import { dn } from "./hub-directory-notice-strings.js";
|
|
4
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
4
5
|
|
|
5
6
|
export const DIRECTORY_NOTICE_FEATURE = "directory-security-notices-v1";
|
|
6
7
|
export function directoryNoticesOffered(session, client) {
|
|
@@ -56,7 +57,7 @@ export function DirectoryNotices({ client, host = false }) {
|
|
|
56
57
|
${loaded && !errorKey && !rows.length ? html`<p class="muted">${dn("empty")}</p>` : null}
|
|
57
58
|
${rows.map(row => html`<article class="directory-notice" key=${row.id} data-directory-notice=${row.id}>
|
|
58
59
|
<h3>${dn(row.kind === "directory-compensation" ? "restored" : "changed")}</h3>
|
|
59
|
-
<p class="muted">${dn(row.actor?.kind === "host-owner" ? "host" : "admin")} · <time datetime=${new Date(row.at).toISOString()}>${
|
|
60
|
+
<p class="muted">${dn(row.actor?.kind === "host-owner" ? "host" : "admin")} · <time datetime=${new Date(row.at).toISOString()}>${dateTimeText(row.at)}</time></p>
|
|
60
61
|
<p>${(row.changes || []).map(key => dn(key)).join(" · ")}</p>
|
|
61
62
|
${row.acknowledged ? html`<span class="muted">${dn("acknowledged")}</span>` : html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => acknowledge(row.id)}>${dn(acking === row.id ? "acknowledging" : "acknowledge")}</button>`}
|
|
62
63
|
</article>`)}
|
|
@@ -5,8 +5,9 @@ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
|
5
5
|
import { hubClient } from "./hub-client.js";
|
|
6
6
|
import { he } from "./hub-enrolment-code-strings.js";
|
|
7
7
|
import { jf } from "./hub-joincode-flow-strings.js";
|
|
8
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
8
9
|
export const enrolmentCodeV1 = true;
|
|
9
|
-
const time = value =>
|
|
10
|
+
const time = value => dateTimeText(value);
|
|
10
11
|
const supported = client => client?.enrolmentCodeV1 === true && ["enrolmentCodes", "createEnrolmentCode", "revokeEnrolmentCode"].every(key => typeof client[key] === "function");
|
|
11
12
|
const integer = (value, max) => Number.isSafeInteger(Number(value)) && Number(value) >= 1 && Number(value) <= max;
|
|
12
13
|
const errorText = (result, fallback) => result?.code === "backpressure" && result.reason === "live-code-limit" ? jf("liveLimit")
|
package/dist/ui/hub-my-agents.js
CHANGED
|
@@ -7,8 +7,9 @@ import { ms } from "./hub-my-agents-strings.js";
|
|
|
7
7
|
import { rowAvailability, rowKey, shareRows, reconcileSharing } from "./hub-my-agents-model.js";
|
|
8
8
|
import { HubGrantPicker } from "./hub-grant-picker.js";
|
|
9
9
|
import { assetUrl } from "/assets/asset-url.js";
|
|
10
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
10
11
|
const tone = name => { let h = 0; for (const c of name) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % 6; };
|
|
11
|
-
const shortSeen = at => Number.isFinite(at) ?
|
|
12
|
+
const shortSeen = at => Number.isFinite(at) ? clockFormat({ month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, lang() === "zh-TW" ? "zh-TW" : "en-GB").format(at) : "—";
|
|
12
13
|
const Avatar = ({ name }) => html`<span class=${`hub-av sm t${tone(name)}`} aria-hidden="true">${[...name][0] || "?"}</span>`;
|
|
13
14
|
const mc = (key, n) => ms(n === 1 ? `${key}One` : key, n);
|
|
14
15
|
const STORE = "agend.hub.owner-sharing";
|
|
@@ -10,12 +10,13 @@ import { hq } from "./hub-quick-strings.js";
|
|
|
10
10
|
import { hr } from "./hub-read-strings.js";
|
|
11
11
|
import { linkHubCss } from "./hub-strings.js";
|
|
12
12
|
import { linkHubOwnerCss } from "./hub-owner-strings.js";
|
|
13
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
13
14
|
/** A member Settings reader opts into code rows only alongside this renderer. */
|
|
14
15
|
export const pairingNoticesV3 = true;
|
|
15
16
|
|
|
16
17
|
const reason = (r) => hq(r.code === "expired" ? "expired" : r.code === "conflict" ? "conflict" : r.code === "backpressure" ? "limit"
|
|
17
18
|
: r.code === "denied" || r.code === "revoked" ? "denied" : r.code === "unavailable" || r.code === "unreachable" ? "unavailable" : "failed");
|
|
18
|
-
const time = (at) => { try { return
|
|
19
|
+
const time = (at) => { try { return dateTimeText(at, { dateStyle: "medium", timeStyle: "short" }, lang() === "zh-TW" ? "zh-TW" : "en"); } catch { return dateTimeText(at); } };
|
|
19
20
|
|
|
20
21
|
/** The page controls its own attempt only. The separate fleet-local proof is never performed by this component. */
|
|
21
22
|
export function QuickPairingGuide({ allowed = false, publishAllowed = false, onConnected = () => {} }) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {html,useEffect,useRef,useState} from "/assets/app-html.js";
|
|
2
2
|
import {hr} from "./hub-roles-strings.js";
|
|
3
3
|
import {auditActor,auditAction,auditCsv,auditResult,auditSentence,valueLines,roleAuditActions} from "./hub-role-view.js";
|
|
4
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
4
5
|
export function RoleAudit({client}){
|
|
5
6
|
const enhanced=client.roleAuditFiltersV1===true;
|
|
6
7
|
const [page,setPage]=useState(null),[error,setError]=useState(null),[busy,setBusy]=useState(false),[exporting,setExporting]=useState(false),[filters,setFilters]=useState({}),[draft,setDraft]=useState({from:"",to:"",person:"",action:""}),[people,setPeople]=useState([]),[actions,setActions]=useState(()=>[...roleAuditActions]);
|
|
@@ -32,7 +33,7 @@ export function RoleAudit({client}){
|
|
|
32
33
|
<label class="field"><span>${hr("filterAction")}</span><select value=${draft.action} disabled=${busy||exporting} onChange=${e=>setDraft({...draft,action:e.target.value})}><option value="">${hr("all")}</option>${actions.map(action=>html`<option key=${action} value=${action}>${auditAction(action)}</option>`)}</select></label><button type="submit" class="btn" disabled=${busy||exporting}>${hr("filter")}</button></form>`:null}
|
|
33
34
|
${error?html`<p class="err" role="alert">${error}</p><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(null,filters)}>${hr("retry")}</button>`:null}${!page&&!error?html`<p role="status">${hr("loading")}</p>`:null}
|
|
34
35
|
<div class="hub-team-table-wrap"><table class="hub-team-table hub-role-audit"><thead><tr><th>${hr("when")}</th><th>${hr("who")}</th><th>${hr("action")}</th><th>${hr("result")}</th></tr></thead><tbody>
|
|
35
|
-
${page?.rows?.map(row=>html`<tr key=${row.id}><td class="hub-role-audit-when"><time datetime=${new Date(row.at).toISOString()}>${
|
|
36
|
+
${page?.rows?.map(row=>html`<tr key=${row.id}><td class="hub-role-audit-when"><time datetime=${new Date(row.at).toISOString()}>${dateTimeText(row.at)}</time></td><td class="hub-role-audit-who">${auditActor(row)}</td><td class="hub-role-audit-action">
|
|
36
37
|
${row.details?html`<details><summary>${auditSentence(row)}</summary><div class="grid2 hub-role-audit-values">${["before","after"].map(side=>html`<div key=${side}><strong>${hr(side)}</strong><ul>${valueLines(row.details[side]).map((line,i)=>html`<li key=${i}>${line}</li>`)}</ul></div>`)}</div></details>`:auditSentence(row)}</td>
|
|
37
38
|
<td class="hub-role-audit-result"><span class=${`tag ${row.result==="denied"?"warn":["completed","allowed"].includes(row.result)?"ok":"danger"}`}>${auditResult(row.result)}</span></td></tr>`)}</tbody></table></div>
|
|
38
39
|
${page&&!page.rows.length?html`<p class="note">${hr("empty")}</p>`:null}${page?.nextCursor?html`<div class="hub-role-actions"><button type="button" class="btn" disabled=${busy||exporting} onClick=${()=>load(page.nextCursor)}>${hr("more")}</button></div>`:null}</section>`;
|
|
@@ -4,6 +4,7 @@ import {PeopleSearch} from "./hub-subject-picker.js";
|
|
|
4
4
|
import {GroupSearch} from "./hub-group-search.js";
|
|
5
5
|
import {hr} from "./hub-roles-strings.js";
|
|
6
6
|
import {personKey,personName,roleName,roleDescription,permissionGroups,management,changeLines,reviewImpact,scopeName,valueLines} from "./hub-role-view.js";
|
|
7
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
7
8
|
const copy=value=>structuredClone(value);
|
|
8
9
|
const dateValue=at=>at?new Date(at-new Date(at).getTimezoneOffset()*60000).toISOString().slice(0,16):"";
|
|
9
10
|
export function RoleSearch({client,kind,onPick,disabled,id}){
|
|
@@ -45,8 +46,8 @@ export function Review({view,checked}){
|
|
|
45
46
|
${line.after?.description!==undefined?html`<p>${hr("rolePurpose")}: ${line.before?.description||"–"} → ${line.after.description||"–"}</p>`:null}
|
|
46
47
|
${line.after?.defaultMaxFleets!==undefined?html`<p>${hr("quota")}: ${line.before?.defaultMaxFleets??"–"} → ${line.after.defaultMaxFleets}</p>`:null}
|
|
47
48
|
${line.after?.scope?html`<p>${hr("scope")}: ${line.before?.scope?scopeName(line.before.scope):"–"} → ${scopeName(line.after.scope)}</p>
|
|
48
|
-
${line.after.startsAt||line.before?.startsAt?html`<p>${hr("start")}: ${line.before?.startsAt?
|
|
49
|
-
<p>${hr("ends")}: ${line.before?.expiresAt?
|
|
49
|
+
${line.after.startsAt||line.before?.startsAt?html`<p>${hr("start")}: ${line.before?.startsAt?dateTimeText(line.before.startsAt):"–"} → ${line.after.startsAt?dateTimeText(line.after.startsAt):"–"}</p>`:null}
|
|
50
|
+
<p>${hr("ends")}: ${line.before?.expiresAt?dateTimeText(line.before.expiresAt):hr("noEnd")} → ${line.after.expiresAt?dateTimeText(line.after.expiresAt):hr("noEnd")}</p>
|
|
50
51
|
${line.after.maxFleets!==null||line.before?.maxFleets!=null?html`<p>${hr("override")}: ${line.before?.maxFleets??"–"} → ${line.after.maxFleets??"–"}</p>`:null}`:null}
|
|
51
52
|
${line.deleted?html`<p class="note">${hr("deleteAssignments",line.removedAssignments)}</p>`:null}</section>`)}
|
|
52
53
|
${!lines.length?html`<p>${hr("nothingChanged")}</p>`:null}
|
package/dist/ui/hub-role-view.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Display projections only. Policy keys, permissions and checked writes remain server-owned. */
|
|
2
2
|
import {hr} from "./hub-roles-strings.js";
|
|
3
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
3
4
|
export const personKey=p=>`${p?.realm}/${p?.objectId}`;
|
|
4
5
|
export const management=["fleets.manage","join.manage","roles.assign","audit.view","hub.admin"];
|
|
5
6
|
export const permissionGroups=[{key:"usingHub",permissions:["ask_agents","publish_agents","pair_fleet"]},{key:"theirTeam",permissions:["team.view","team.usage"]},{key:"runningHub",permissions:["fleets.manage","join.manage","roles.assign","audit.view"]}];
|
|
@@ -73,8 +74,8 @@ export function valueLines(value){
|
|
|
73
74
|
if(value.permissions)lines.push(value.permissions.map(p=>hr(p)).join(" · "));
|
|
74
75
|
if(value.defaultMaxFleets!==undefined)lines.push(`${hr("quota")}: ${value.defaultMaxFleets}`);
|
|
75
76
|
if(value.subject)lines.push(value.subject.name||hr("unknownPerson"));if(value.scope)lines.push(scopeName(value.scope));
|
|
76
|
-
if(value.startsAt)lines.push(`${hr("start")}: ${
|
|
77
|
-
if(value.expiresAt!==undefined)lines.push(`${hr("ends")}: ${value.expiresAt?
|
|
77
|
+
if(value.startsAt)lines.push(`${hr("start")}: ${dateTimeText(value.startsAt)}`);
|
|
78
|
+
if(value.expiresAt!==undefined)lines.push(`${hr("ends")}: ${value.expiresAt?dateTimeText(value.expiresAt):hr("noEnd")}`);
|
|
78
79
|
if(value.maxFleets!=null)lines.push(`${hr("override")}: ${value.maxFleets}`);
|
|
79
80
|
if(value.rolesActive!==undefined)lines.push(hr(value.rolesActive?"on":"off"));
|
|
80
81
|
return lines;
|
package/dist/ui/hub-roles.js
CHANGED
|
@@ -5,6 +5,7 @@ import {hr,linkRoleCss} from "./hub-roles-strings.js";
|
|
|
5
5
|
import {RoleWizard,AssignPanel,PermissionSections,Review} from "./hub-role-forms.js";
|
|
6
6
|
import {RoleAudit} from "./hub-role-audit.js";
|
|
7
7
|
import {personKey,personName,roleName,roleDescription,assignedSubjects,assignmentCount,subjectId,scopeName,roleError} from "./hub-role-view.js";
|
|
8
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
8
9
|
const copy=value=>structuredClone(value);
|
|
9
10
|
function Tabs({items,value,onChange,disabled=false,label}){
|
|
10
11
|
return html`<div class="hub-role-tabs" role="tablist" aria-label=${label}>${items.map(item=>html`<button key=${item.key} type="button" role="tab" tabindex=${item.key===value?0:-1} onKeyDown=${e=>{const at=items.findIndex(row=>row.key===value),keys={ArrowRight:(at+1)%items.length,ArrowLeft:(at+items.length-1)%items.length,Home:0,End:items.length-1};if(Object.hasOwn(keys,e.key)){e.preventDefault();const next=keys[e.key];onChange(items[next].key);(e.currentTarget||e.target).parentNode.querySelectorAll('[role="tab"]')[next]?.focus();}}} aria-selected=${item.key===value} class=${item.key===value?"is-active":""} disabled=${disabled} onClick=${()=>onChange(item.key)}>${item.label}</button>`)}</div>`;
|
|
@@ -27,7 +28,7 @@ function PersonRoles({view,subject,busy,onBack,onEdit,onRemove}){
|
|
|
27
28
|
const row=assignedSubjects(view).find(row=>row.id===subjectId(subject)),own=subject.kind==="person"&&personKey(subject.person)===personKey(view.actor),canAssign=view.management.includes("roles.assign");
|
|
28
29
|
return html`<section class="card hub-role-person"><button type="button" class="btn btn-sm" disabled=${busy} onClick=${onBack}>‹ ${hr("people")}</button><h2>${row?.name||hr("unknownPerson")}${own?html` <span class="tag">${hr("you")}</span>`:null}</h2>${own?html`<p class="s-info">${hr("selfHelp")}</p>`:null}
|
|
29
30
|
<ul class="hub-rows">${row?.fixed?html`<li class="s-row hub-row"><span class="hub-row-text"><strong>${hr("admin")}</strong><small class="note">${hr("firstAdminHelp")}</small></span></li>`:null}
|
|
30
|
-
${row?.assignments.map(a=>html`<li class="s-row hub-row" key=${a.id}><span class="hub-row-text"><strong>${roleName(view.policy.roles.find(r=>r.id===a.roleId),view)}</strong><small class="note">${scopeName(a.scope)} · ${a.expiresAt?
|
|
31
|
+
${row?.assignments.map(a=>html`<li class="s-row hub-row" key=${a.id}><span class="hub-row-text"><strong>${roleName(view.policy.roles.find(r=>r.id===a.roleId),view)}</strong><small class="note">${scopeName(a.scope)} · ${a.expiresAt?dateTimeText(a.expiresAt):hr("noEnd")}</small></span>
|
|
31
32
|
${canAssign?html`<div class="s-actions"><button type="button" class="btn btn-sm" disabled=${busy||own} onClick=${()=>onEdit(a)}>${hr("edit")}</button><button type="button" class="btn btn-sm danger" disabled=${busy||own} onClick=${()=>onRemove(a)}>${hr("remove")}</button></div>`:null}</li>`)}</ul></section>`;
|
|
32
33
|
}
|
|
33
34
|
function RolePage({view,role,busy,canEdit,canAssign,onBack,onAssign,onEdit,onDelete,onPerson}){
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// M-3118: independent namespace so a cached room dictionary can still render new stop events.
|
|
2
2
|
import { register, t, lang } from "/assets/app-i18n.js";
|
|
3
|
+
import { timeText } from "/assets/clock-text.js";
|
|
3
4
|
register("hubRoomAgent", {
|
|
4
5
|
en: {
|
|
5
6
|
all: "Agents can't use @All agents. This message was not sent to other agents.",
|
|
@@ -23,6 +24,6 @@ export function agentStopText(system) {
|
|
|
23
24
|
if (!system || !["all", "ambiguous", "depth", "rate", "capacity"].includes(system.reason)) return null;
|
|
24
25
|
if (system.reason !== "rate") return hra(system.reason, String(system.name || ""));
|
|
25
26
|
if (!Number.isSafeInteger(system.retryAt) || system.retryAt < 0) return null;
|
|
26
|
-
const time =
|
|
27
|
+
const time = timeText(Math.ceil(system.retryAt / 60_000) * 60_000, { hour: "2-digit", minute: "2-digit" }, lang());
|
|
27
28
|
return hra("rate", String(system.name || ""), time);
|
|
28
29
|
}
|
package/dist/ui/hub-room-list.js
CHANGED
|
@@ -17,6 +17,7 @@ import { Menu } from "/assets/ui-menu.js";
|
|
|
17
17
|
import { Icon } from "/assets/ui-icons.js";
|
|
18
18
|
import "./hub-room-strings.js";
|
|
19
19
|
import { presenceDot } from "./hub-room-presence.js";
|
|
20
|
+
import { timeText } from "/assets/clock-text.js";
|
|
20
21
|
|
|
21
22
|
const tr = (key, ...a) => t(`hubRoom.${key}`, ...a);
|
|
22
23
|
/** The Fleet sidebar's own words for favourites (view.*, with named values; agentRow.*): no Hub copy of them. */
|
|
@@ -90,7 +91,7 @@ export function rowView(r) {
|
|
|
90
91
|
const listTime = (ms) => {
|
|
91
92
|
if (!ms) return "";
|
|
92
93
|
const d = new Date(ms), now = new Date();
|
|
93
|
-
return d.toDateString() === now.toDateString() ? d
|
|
94
|
+
return d.toDateString() === now.toDateString() ? timeText(d, { hour: "2-digit", minute: "2-digit" }) : d.toLocaleDateString(undefined, { month: "numeric", day: "numeric" });
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
/**
|
|
@@ -3,12 +3,13 @@ import { Dialog } from "/assets/ui-dialog.js";
|
|
|
3
3
|
import { RoomPicker } from "./hub-room-new.js";
|
|
4
4
|
import { hrq } from "./hub-room-owner-requests-strings.js";
|
|
5
5
|
import { hn } from "./hub-room-new-strings.js";
|
|
6
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
6
7
|
|
|
7
8
|
export function ownerRequestError(result, owner) {
|
|
8
9
|
if (result?.code === "owner-not-taking-requests") return hrq("ownerOff", owner);
|
|
9
10
|
if (result?.code === "request-open") return hrq("already", owner);
|
|
10
11
|
if (result?.code === "request-limit" && Number.isSafeInteger(result.resetsAt) && result.resetsAt > 0 && result.resetsAt <= 8.64e15) {
|
|
11
|
-
const time =
|
|
12
|
+
const time = dateTimeText(result.resetsAt, { month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
12
13
|
return hrq("limit", time);
|
|
13
14
|
}
|
|
14
15
|
return hrq("failed");
|
package/dist/ui/hub-room-pins.js
CHANGED
|
@@ -9,11 +9,12 @@ import { lang, t } from "/assets/app-i18n.js";
|
|
|
9
9
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
10
10
|
import { Icon } from "/assets/ui-icons.js";
|
|
11
11
|
import { hroom } from "./hub-room-strings.js";
|
|
12
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
12
13
|
|
|
13
14
|
/** The Hub's limit per person per room (src/hub/rooms/service.ts ROOM_PINS_MAX). */
|
|
14
15
|
export const ROOM_PINS_MAX = 50;
|
|
15
16
|
|
|
16
|
-
const when = (ms) => { const d = new Date(ms); return Number.isFinite(d.getTime()) ? d
|
|
17
|
+
const when = (ms) => { const d = new Date(ms); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, lang()) : ""; };
|
|
17
18
|
const snippet = (s, n = 40) => { const one = String(s || "").replace(/\s+/g, " ").trim(); return one.length > n ? `${one.slice(0, n - 1)}…` : one; };
|
|
18
19
|
const textOf = (m) => String(m?.text || "");
|
|
19
20
|
const filesOf = (m) => (Array.isArray(m?.files) ? m.files.map((f) => f && f.name).filter(Boolean) : []);
|
|
@@ -40,7 +40,7 @@ register("hubRoom", {
|
|
|
40
40
|
searchResults: "Results", searchRooms: "Rooms and chats", searchBadgeRoom: "Room", searchBadgeChat: "Chat", searchCount: "{0} results",
|
|
41
41
|
searchOlder: "Search older messages", searchKeys: "↑↓ move · Enter open · Esc close", jumpMissing: "That message is no longer in this room.",
|
|
42
42
|
filterPh: "Filter: name or owner", filterClear: "Clear the filter",
|
|
43
|
-
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerReshare: "This agent is unavailable right now. Its owner needs to share it again.", noAnswerUnanswered:"No answer: The agent finished without answering here", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
43
|
+
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerReshare: "This agent is unavailable right now. Its owner needs to share it again.", noAnswerUnanswered:"No answer: The agent finished without answering here", noAnswerDeclined: "The owner chose not to answer this question.", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
44
44
|
workingOne: "{0} is working on it", workingMany: "{0} agents are working",
|
|
45
45
|
waitBehindOne: "Waiting: {0} is answering another question first", waitBehindMany: "Waiting: {0} has {1} questions to answer first",
|
|
46
46
|
waitBusy: "Waiting: {0} is busy with other work", waitPaused: "Waiting: {0} is paused; it gets your question when it resumes",
|
|
@@ -197,7 +197,7 @@ register("hubRoom", {
|
|
|
197
197
|
searchResults: "結果", searchRooms: "房間與聊天", searchBadgeRoom: "房間", searchBadgeChat: "聊天", searchCount: "{0} 筆結果",
|
|
198
198
|
searchOlder: "搜尋更早的訊息", searchKeys: "↑↓ 移動 · Enter 開啟 · Esc 關閉", jumpMissing: "這則訊息已不在這個房間裡。",
|
|
199
199
|
filterPh: "篩選:名稱或擁有者", filterClear: "清除篩選",
|
|
200
|
-
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerReshare: "這個 Agent 暫時無法回答,擁有者需要重新分享。", noAnswerUnanswered:"沒有回答:Agent 已結束處理,但沒有在這裡回答。", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
200
|
+
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerReshare: "這個 Agent 暫時無法回答,擁有者需要重新分享。", noAnswerUnanswered:"沒有回答:Agent 已結束處理,但沒有在這裡回答。", noAnswerDeclined: "擁有者決定不處理這題。", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
201
201
|
workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
|
|
202
202
|
waitBehindOne: "等待中:{0} 正在先回答另一個問題", waitBehindMany: "等待中:{0} 前面還有 {1} 個問題",
|
|
203
203
|
waitBusy: "等待中:{0} 正在處理其他工作", waitPaused: "等待中:{0} 已暫停,恢復後會收到你的問題",
|
|
@@ -211,7 +211,7 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
211
211
|
...(!direct && Array.isArray(m.reactions) && m.reactions.length ? { reactionBar: reactionBar(m.reactions, { meId, names }) } : {}),
|
|
212
212
|
...(!direct && kind !== "person" && m.buttons ? { buttons: roomButtons(m.buttons, meId) } : {}),
|
|
213
213
|
...(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) : "" } } : {}),
|
|
214
|
-
...(m.stage === "not-answered" && !(kind === "person" && m.reasonCode === "share-needs-reshare") ? { text: m.reasonCode === "share-needs-reshare" ? hroom("noAnswerReshare") : m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : m.reasonCode==="finished-without-answer"?hroom("noAnswerUnanswered"):hroom("noAnswer") } : {}) });
|
|
214
|
+
...(m.stage === "not-answered" && !(kind === "person" && m.reasonCode === "share-needs-reshare") ? { text: m.reasonCode === "owner-declined" ? hroom("noAnswerDeclined") : m.reasonCode === "share-needs-reshare" ? hroom("noAnswerReshare") : m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : m.reasonCode==="finished-without-answer"?hroom("noAnswerUnanswered"):hroom("noAnswer") } : {}) });
|
|
215
215
|
if (kind === "person" && m.stage === "not-answered" && m.reasonCode === "share-needs-reshare")
|
|
216
216
|
out.push({ boot: BOOT, id: num(`unavailable:${m.id}`), role: "status", sender: "", text: hroom("noAnswerReshare"), bare: true, wrap: true });
|
|
217
217
|
if (foldAfter) out.push({ boot: BOOT, id: num(`expand:${foldAfter.arg}`), role: "status", sender: "", text: "", bare: true, fold: true, action: foldAfter });
|
package/dist/ui/log-row.js
CHANGED
|
@@ -7,6 +7,7 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
7
7
|
import { Icon } from "/assets/ui-icons.js";
|
|
8
8
|
import "/assets/chat-strings.js";
|
|
9
9
|
import { chatTime, chatTimeFull } from "/assets/chat-time.js";
|
|
10
|
+
import { unitText } from "/assets/clock-text.js";
|
|
10
11
|
|
|
11
12
|
register("log", {
|
|
12
13
|
en: {
|
|
@@ -129,11 +130,11 @@ function size(bytes) {
|
|
|
129
130
|
}
|
|
130
131
|
function duration(ms) {
|
|
131
132
|
if (!(ms >= 0)) return "";
|
|
132
|
-
if (ms < 1000) return
|
|
133
|
+
if (ms < 1000) return unitText(ms, "ms");
|
|
133
134
|
const s = ms / 1000;
|
|
134
|
-
if (s < 60) return
|
|
135
|
+
if (s < 60) return unitText(s < 10 ? s.toFixed(1) : Math.round(s), "s");
|
|
135
136
|
const m = Math.floor(s / 60);
|
|
136
|
-
return `${m
|
|
137
|
+
return `${unitText(m, "m")} ${unitText(Math.round(s - m * 60), "s")}`;
|
|
137
138
|
}
|
|
138
139
|
const eventLabel = (type) => { const k = `log.ev_${type}`; const v = t(k); return v === k ? String(type).replace(/_/g, " ") : v; };
|
|
139
140
|
|
|
@@ -10,6 +10,7 @@ import { html, useEffect, useState } from "/assets/app-html.js";
|
|
|
10
10
|
import { t, register } from "/assets/app-i18n.js";
|
|
11
11
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
12
12
|
import { toast } from "/assets/ui-toast.js";
|
|
13
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
13
14
|
|
|
14
15
|
register("oshare", {
|
|
15
16
|
en: {
|
|
@@ -40,7 +41,7 @@ register("oshare", {
|
|
|
40
41
|
const to = (k, ...v) => t(`oshare.${k}`, ...v);
|
|
41
42
|
const DURATIONS = [["m15", 15], ["m30", 30], ["h1", 60], ["h2", 120], ["h4", 240], ["h8", 480], ["h24", 1440]];
|
|
42
43
|
const JSON_HEADERS = { "Content-Type": "application/json" };
|
|
43
|
-
const when = (ms) => { try { return
|
|
44
|
+
const when = (ms) => { try { return clockFormat({ month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }, undefined).format(new Date(ms)); } catch { return ""; } };
|
|
44
45
|
|
|
45
46
|
/** What a refusal says (the host's `error` and `reason`). */
|
|
46
47
|
export function refusalText(d) {
|
|
@@ -12,6 +12,7 @@ import { buildOrgView } from "./fleet-org.js";
|
|
|
12
12
|
import { createTrafficStore, POLL_MS } from "./fleet-traffic.js";
|
|
13
13
|
import { Office } from "./fleet-office.js";
|
|
14
14
|
import { ALL_ID } from "./fleet-office-overview.js";
|
|
15
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
15
16
|
|
|
16
17
|
register("share", {
|
|
17
18
|
en: { title: "Office", live: "Live view", ends: "until {0}", readOnly: "Read-only: names and states only.", ended: "This Office link has ended.", loading: "Loading the office…", offline: "Can't reach the office right now. Trying again…" },
|
|
@@ -111,7 +112,7 @@ export function appFromState(d) {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
const clock = (ms) => {
|
|
114
|
-
try { return
|
|
115
|
+
try { return clockFormat({ hour: "2-digit", minute: "2-digit" }, undefined).format(new Date(ms)); } catch { return ""; }
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
export function SharePage({ base, timers = globalThis, pollMs = POLL_MS }) {
|
|
@@ -8,6 +8,7 @@ import { html, useEffect, useState } from "/assets/app-html.js";
|
|
|
8
8
|
import { t, register } from "/assets/app-i18n.js";
|
|
9
9
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
10
10
|
import { toast } from "/assets/ui-toast.js";
|
|
11
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
11
12
|
|
|
12
13
|
register("pshare", {
|
|
13
14
|
en: {
|
|
@@ -56,10 +57,10 @@ register("pshare", {
|
|
|
56
57
|
const tp = (k, ...v) => t(`pshare.${k}`, ...v);
|
|
57
58
|
export const DURATIONS = [["m15", 15], ["h1", 60], ["h8", 480], ["h24", 1440]];
|
|
58
59
|
const JSON_HEADERS = { "Content-Type": "application/json" };
|
|
59
|
-
const when = (ms) => { try { return
|
|
60
|
+
const when = (ms) => { try { return clockFormat({ hour: "2-digit", minute: "2-digit" }, undefined).format(new Date(ms)); } catch { return ""; } };
|
|
60
61
|
/** The end of a share for the bar: the time today, with the day when it is not today (a share may last 24 h). */
|
|
61
62
|
const until = (ms) => { const d = new Date(ms), now = new Date(); return d.toDateString() === now.toDateString() ? when(ms) : whenLong(ms); };
|
|
62
|
-
const whenLong = (ms) => { try { return
|
|
63
|
+
const whenLong = (ms) => { try { return clockFormat({ month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }, undefined).format(new Date(ms)); } catch { return ""; } };
|
|
63
64
|
|
|
64
65
|
/** What a refusal says (the host's `error` and `reason`). */
|
|
65
66
|
export function refusalText(d) {
|
package/dist/ui/panel-chat.js
CHANGED
|
@@ -107,7 +107,7 @@ register("chatPhone", {
|
|
|
107
107
|
en: { goTo: "Go to", thisChat: "This chat", verifiedUntil: "Verified · speaks as you until {0}", needsToast: "{0} needs you", ctxHide: "Hide this for now" },
|
|
108
108
|
"zh-TW": { goTo: "前往", thisChat: "這個對話", verifiedUntil: "已驗證 · 以你的身分發言到 {0}", needsToast: "{0} 正在等你回應", ctxHide: "這次先不提醒" },
|
|
109
109
|
});
|
|
110
|
-
const untilClock = (ms) => { try { return
|
|
110
|
+
const untilClock = (ms) => { try { return timeText(ms, { hour: "2-digit", minute: "2-digit" }, []); } catch { return ""; } };
|
|
111
111
|
/** A Needs-you item's identity: its nonce, else its id, else what it says. */
|
|
112
112
|
const needKey = (item) => String(item?.nonce || item?.id || JSON.stringify(item || null));
|
|
113
113
|
/**
|
|
@@ -244,6 +244,7 @@ export function linkWorkBarCss(doc = typeof document !== "undefined" ? document
|
|
|
244
244
|
linkWorkBarCss();
|
|
245
245
|
|
|
246
246
|
import { activityDrawCtx, activityInfo, activityInfoStore, activityOffered, activityPrefs, composeActivity, mountActivity, observeActivity, setActivityOn, setActivityThinking } from "./chat-activity.js";
|
|
247
|
+
import { timeText } from "/assets/clock-text.js";
|
|
247
248
|
/** The composer's textarea (#2342: text put back into it is a step Ctrl+Z goes back from). */
|
|
248
249
|
const composers = new Map(); // agent → current mounted refs, never a retained thread's stale closure
|
|
249
250
|
const composerField = (name) => composers.get(name)?.input.current || null;
|
package/dist/ui/panel-details.js
CHANGED
|
@@ -36,6 +36,7 @@ import { AgentCategoryNav, AgentPageHead, AgentSettingsPanels, agentKind, catego
|
|
|
36
36
|
import { ContactPermissionsPanel } from "./contact-permissions.js";
|
|
37
37
|
import "./agent-page-strings.js";
|
|
38
38
|
import { pt } from "./agent-page-strings.js";
|
|
39
|
+
import { timeText } from "/assets/clock-text.js";
|
|
39
40
|
|
|
40
41
|
// Local registration also works when this lazy page is paired with retained string modules.
|
|
41
42
|
register("agentNavigation", { en: { backToChat: "Back to chat" }, "zh-TW": { backToChat: "回到聊天" } });
|
|
@@ -195,7 +196,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
195
196
|
${loaded(d.instruction_files)}
|
|
196
197
|
<${InstanceBoardWork} name=${name} onOpen=${(id) => navigate(`/ui/fleet?card=${encodeURIComponent(id)}`)} />
|
|
197
198
|
<section class="card"><h3>${t("chat.dActivity")}</h3>${d.recent_activity?.length ? d.recent_activity.map((a, i) => html`<div key=${i} class="activity">
|
|
198
|
-
<span class="mono muted">${a.timestamp ?
|
|
199
|
+
<span class="mono muted">${a.timestamp ? timeText(`${a.timestamp.replace(" ", "T")}Z`, { hour: "2-digit", minute: "2-digit" }, []) : ""}</span>
|
|
199
200
|
<span class="ev">${a.event}</span> ${a.summary || ""}</div>`) : html`<p class="note">${t("chat.dNoActivity")}</p>`}</section>`;
|
|
200
201
|
}
|
|
201
202
|
const actions = items.filter((i) => i && ["start", "restart", "stop", "pause", "wake"].includes(i.key));
|
package/dist/ui/panel-fleet.js
CHANGED
|
@@ -24,6 +24,7 @@ import { ContactAuthorizations } from "./contact-authorizations.js";
|
|
|
24
24
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
25
25
|
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
26
26
|
import { Icon } from "/assets/ui-icons.js";
|
|
27
|
+
import { TabIcon } from "./fleet-tab-icons.js";
|
|
27
28
|
import { toast } from "/assets/ui-toast.js";
|
|
28
29
|
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
29
30
|
import { confirmedWrite, selfConfirmed } from "./settings-confirm.js";
|
|
@@ -33,6 +34,7 @@ import { CacheReport } from "./fleet-cache.js";
|
|
|
33
34
|
import { UsageTab } from "./fleet-usage.js";
|
|
34
35
|
import { BackendSelect, ModelSelect } from "./settings-dialogs.js";
|
|
35
36
|
import { TaskBoardTab } from "./fleet-tasks.js";
|
|
37
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
36
38
|
|
|
37
39
|
/** #2015: one of the largest processes as text: "python3 18.1 GB (dev-a)". */
|
|
38
40
|
export function memoryHogText(p) {
|
|
@@ -105,7 +107,8 @@ const DOCS_SITE = "https://songsid.github.io/AgEnD";
|
|
|
105
107
|
export function docsUrl(language = lang()) {
|
|
106
108
|
return `${DOCS_SITE}${language === "zh-TW" ? "/zh-tw" : ""}/docs/web-guide/`;
|
|
107
109
|
}
|
|
108
|
-
|
|
110
|
+
// M-3722: one icon each (a phone's tabs are icons only): Cache, Usage and Host health no longer share "chart" (fleet-tab-icons.js).
|
|
111
|
+
const ICONS = { tasks: "tasks", schedules: "clock", teams: "team", org: "org", cache: "database", usage: "gauge", authorizations: "key", "host-health": "pulse" };
|
|
109
112
|
const BACKENDS = ["claude-code", "codex", "opencode", "kiro-cli", "antigravity", "grok", "muse"];
|
|
110
113
|
|
|
111
114
|
async function api(method, path, body, lease) {
|
|
@@ -232,7 +235,7 @@ export function FleetPanel({ route, navKey }) {
|
|
|
232
235
|
else if (a.left < n.left) nav.scrollLeft -= n.left - a.left;
|
|
233
236
|
}, [phone, tab, admin, wide]);
|
|
234
237
|
const tabs = (cls) => html`<nav data-trust="panel-navigation" class=${cls} aria-label=${t("fleet.title")}>${visibleTabs.map(k => html`<a key=${k} href=${fleetPath(k)} class=${`seg-item${k === tab ? " active" : ""}`}
|
|
235
|
-
aria-current=${k === tab ? "page" : undefined}><${
|
|
238
|
+
aria-current=${k === tab ? "page" : undefined}><${TabIcon} name=${ICONS[k]} size=${16} /><span>${t(`fleet.${k}`)}</span></a>`)}</nav>`;
|
|
236
239
|
return html`<div ref=${root} data-effect-panel="fleet" class="panel p-fleet">
|
|
237
240
|
${/* M-2542: the tabs share the title row (PanelHeader's nav slot, as the instance tabs do) when everything fits
|
|
238
241
|
there (useTabsInHeader), saving a line; otherwise — a phone, a narrow window, a long host memory warning — they
|
|
@@ -240,8 +243,10 @@ export function FleetPanel({ route, navKey }) {
|
|
|
240
243
|
and chosen here rather than by CSS: a previous release's app.css, cached in an open tab, has no rule for the
|
|
241
244
|
header slot — this way either stylesheet lays both out (smoke-2542 SKEW). */ ""}
|
|
242
245
|
${/* M-3166 (Argon 5, the user's OK of round 2): a phone's Fleet is two rows — its tabs in the header's row (☰, then the
|
|
243
|
-
tabs; the title, search, docs and text size give way: app.css), then the page's own tools.
|
|
244
|
-
|
|
246
|
+
tabs; the title, search, docs and text size give way: app.css), then the page's own tools.
|
|
247
|
+
M-3722: eight tabs no longer fit beside ☰ at 390 px (Authorizations, Host health). On a phone the header is ☰ and
|
|
248
|
+
this page's name, then every tab as an icon, each a whole touch target (app.css): nothing scrolls off. */ ""}
|
|
249
|
+
<${PanelHeader} title=${phone && !wide ? t(`fleet.${tab}`) : t("fleet.title")} sub=${sub} nav=${wide ? tabs("fleet-tabs") : phone ? tabs("seg fleet-phone-tabs") : null}><${DocsLink} /><${HeaderTools} navKey=${navKey} /></${PanelHeader}>
|
|
245
250
|
${wide || phone ? null : tabs("seg fleet-tabs-row")}
|
|
246
251
|
<div data-trust="panel-content" class="panel-body"><div class=${`col${tab === "tasks" || tab === "org" || tab === "cache" || tab === "usage" || tab === "authorizations" || tab === "host-health" ? " col-wide" : ""}`}><${Body} lease=${lease} /></div></div>
|
|
247
252
|
</div>`;
|
|
@@ -622,7 +627,7 @@ export function CreateInstanceDialog({ onClose }) {
|
|
|
622
627
|
const cliLabel = productLabel(f.backend) || `${t("fleet.fleetDefault")} (${productLabel(defaultBackend)})`;
|
|
623
628
|
const backendField = windows ? html`<div class="field"><div class="cli-discovery-heading"><span>${tr("backend")}</span>${native && !machineId ? html`<button type="button" class="btn btn-ghost btn-sm" disabled=${discovery.loading} onClick=${discovery.refresh}><${Icon} name="restart" size=${14} />${detectionText("refresh")}</button>` : null}</div>
|
|
624
629
|
<div aria-busy=${!machineId && discovery.loading ? "true" : "false"}>${native ? html`<${CliPicker} label=${tr("backend")} value=${f.backend} choices=${nativeChoices} onChange=${value => { setCredentialProfile(""); setF(x => ({...x,backend:value,model:""})); }} disabled=${!nativeChoices.length || !!machineId && machine?.status !== "online"} />` : null}</div>
|
|
625
|
-
${machineId ? html`<p class="note">${tr(!nativeChoices.length ? "noRemoteCli" : "remotePolicy")}</p>${machine?.inventoryUpdatedAt ? html`<p class="note">${t("runtime.inventoryAt",
|
|
630
|
+
${machineId ? html`<p class="note">${tr(!nativeChoices.length ? "noRemoteCli" : "remotePolicy")}</p>${machine?.inventoryUpdatedAt ? html`<p class="note">${t("runtime.inventoryAt",dateTimeText(machine.inventoryUpdatedAt))}</p>` : null}` : html`<${WindowsCliDiscoveryStatus} state=${discovery} />`}
|
|
626
631
|
${!machineId && native && !discovery.loading && !discovery.error ? html`<p class="note">${!nativeChoices.length ? tr("noCli") : tr("nativeHint")}</p>` : null}
|
|
627
632
|
${machineId ? html`<${ClaudeAccountSelect} id="native-create-claude-account" machine=${machine} backend=${f.backend} value=${credentialProfile} onChange=${setCredentialProfile} disabled=${machine?.status !== "online"} />` : null}</div>`
|
|
628
633
|
: html`${field(tr("backend"),backends ? html`<${CliPicker} label=${tr("backend")} value=${f.backend} choices=${[{value:"",label:t("fleet.fleetDefault")},...backends.filter(b => backendState(b) !== "not_installed" && !b.deprecated).map(b => ({value:b.name,label:productLabel(b.name),disabled:backendBlocked(b),description:backendNote(b)}))]} onChange=${value => { setCredentialProfile(""); setF(x => ({...x,backend:value,model:""})); }} />` : html`<div role="status" aria-busy="true"><${Skeleton} lines=${1} /><span class="note">${tr("loadingClis")}</span></div>`)}${hostAccount ? html`<${AccountSelect} id="create-host-account" backend=${hostBackend} value=${credentialProfile} onChange=${setCredentialProfile} creating=${true} />` : null}`;
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -61,6 +61,7 @@ import { DropOverlay, MAX_FILES, PendingFiles, hf, pageCarriesFiles, pasteToAtta
|
|
|
61
61
|
import { composerCaret, insertQuote, installQuoteSelection, showCaret } from "/assets/chat-quote.js";
|
|
62
62
|
import { installTableSelection } from "/assets/chat-table-select.js";
|
|
63
63
|
import { assetUrl } from "/assets/asset-url.js";
|
|
64
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
64
65
|
register("hubAccess", {
|
|
65
66
|
en: { tag: "Access needs checking", refused: "Asking was refused. Check your access before trying again.", check: "Check access", limited: "Asking was refused; the previous access information needs checking." },
|
|
66
67
|
"zh-TW": { tag: "需要確認權限", refused: "提問遭到拒絕。請先重新檢查權限,再試一次。", check: "重新檢查權限", limited: "提問遭到拒絕,先前的權限資訊需要重新確認。" },
|
|
@@ -160,7 +161,7 @@ function useSession() {
|
|
|
160
161
|
}, []);
|
|
161
162
|
return s;
|
|
162
163
|
}
|
|
163
|
-
const when = (ms) =>
|
|
164
|
+
const when = (ms) => dateTimeText(ms, { dateStyle: "medium", timeStyle: "short" });
|
|
164
165
|
// M-2988: words added after a release; a tab holding the older hub-strings dictionary falls back to the older sentence.
|
|
165
166
|
const newer = (key, args, older) => { const s = hw(key, ...args); return s === `hub.${key}` ? older() : s; };
|
|
166
167
|
const errText = (r) => hw(r.code === "conflict" || r.code === "stale" ? "errConflictHub" : r.code === "not-found" ? "errNotFound"
|