@songsid/agend 2.4.0-beta.6 → 2.4.0-beta.8
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-cli-instructions.md +2 -0
- package/dist/app-message-origin.d.ts +2 -0
- package/dist/app-message-origin.js +3 -0
- package/dist/app-message-origin.js.map +1 -0
- package/dist/auth-api.js +3 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +9 -2
- package/dist/backend/antigravity.js +24 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/cli-env-probe.js +1 -1
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend-availability.d.ts +22 -0
- package/dist/backend-availability.js +71 -2
- package/dist/backend-availability.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/telegram.d.ts +2 -0
- package/dist/channel/adapters/telegram.js +3 -0
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/cli-capability.d.ts +3 -0
- package/dist/cli-capability.js.map +1 -1
- package/dist/cli-registry-check.js +1 -1
- package/dist/cli-registry-check.js.map +1 -1
- package/dist/cli-registry.d.ts +1 -0
- package/dist/cli-spec-antigravity.d.ts +1 -0
- package/dist/cli-spec-antigravity.js +3 -1
- package/dist/cli-spec-antigravity.js.map +1 -1
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/connect/control.d.ts +20 -0
- package/dist/connect/control.js +236 -0
- package/dist/connect/control.js.map +1 -0
- package/dist/connect/install.d.ts +13 -0
- package/dist/connect/install.js +12 -0
- package/dist/connect/install.js.map +1 -0
- package/dist/connect/protocol.d.ts +38 -0
- package/dist/connect/protocol.js +36 -0
- package/dist/connect/protocol.js.map +1 -0
- package/dist/connect/service.d.ts +19 -0
- package/dist/connect/service.js +79 -0
- package/dist/connect/service.js.map +1 -0
- package/dist/connect/stdio-entry.d.ts +1 -0
- package/dist/connect/stdio-entry.js +6 -0
- package/dist/connect/stdio-entry.js.map +1 -0
- package/dist/connect/stdio.d.ts +5 -0
- package/dist/connect/stdio.js +39 -0
- package/dist/connect/stdio.js.map +1 -0
- package/dist/daemon.d.ts +13 -0
- package/dist/daemon.js +66 -1
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-liveness.d.ts +51 -1
- package/dist/dispatcher-liveness.js +92 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/fleet-manager.d.ts +67 -1
- package/dist/fleet-manager.js +307 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.js +4 -2
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +15 -1
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +2 -0
- package/dist/hub/catalog.d.ts +6 -4
- package/dist/hub/catalog.js +14 -7
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/group-policy/admin-impact.d.ts +32 -3
- package/dist/hub/group-policy/admin-impact.js +14 -2
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +1 -1
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/model.d.ts +23 -0
- package/dist/hub/group-policy/model.js +3 -3
- package/dist/hub/group-policy/model.js.map +1 -1
- package/dist/hub/group-policy/store.js +3 -3
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/team-subjects.d.ts +1 -1
- package/dist/hub/group-policy/team-subjects.js +1 -1
- package/dist/hub/group-policy/team-subjects.js.map +1 -1
- package/dist/hub/http/compose.js +73 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +3 -0
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/join/service.d.ts +1 -1
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/mcp/auth-schema.d.ts +7 -0
- package/dist/hub/mcp/auth-schema.js +31 -0
- package/dist/hub/mcp/auth-schema.js.map +1 -0
- package/dist/hub/mcp/auth.d.ts +86 -0
- package/dist/hub/mcp/auth.js +364 -0
- package/dist/hub/mcp/auth.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +64 -0
- package/dist/hub/personal/owner-host.js +190 -0
- package/dist/hub/personal/owner-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +2 -0
- package/dist/hub/personal/schema.js +48 -0
- package/dist/hub/personal/schema.js.map +1 -0
- package/dist/hub/personal/types.d.ts +42 -0
- package/dist/hub/personal/types.js +2 -0
- package/dist/hub/personal/types.js.map +1 -0
- package/dist/hub/policy.js +2 -0
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/quota.js +3 -1
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/roles/admin-control.d.ts +29 -0
- package/dist/hub/roles/admin-control.js +134 -0
- package/dist/hub/roles/admin-control.js.map +1 -0
- package/dist/hub/roles/admin-types.d.ts +49 -0
- package/dist/hub/roles/admin-types.js +2 -0
- package/dist/hub/roles/admin-types.js.map +1 -0
- package/dist/hub/roles/change.js +4 -0
- package/dist/hub/roles/change.js.map +1 -1
- package/dist/hub/roles/convert.js +1 -1
- package/dist/hub/roles/convert.js.map +1 -1
- package/dist/hub/roles/delegation.js +4 -0
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/evaluate.d.ts +2 -1
- package/dist/hub/roles/evaluate.js +14 -0
- package/dist/hub/roles/evaluate.js.map +1 -1
- package/dist/hub/roles/model.d.ts +23 -0
- package/dist/hub/roles/model.js +7 -2
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/resource-effects.d.ts +16 -0
- package/dist/hub/roles/resource-effects.js +62 -0
- package/dist/hub/roles/resource-effects.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +6 -1
- package/dist/hub/roles/writer.js +10 -2
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/rooms/agents.js +5 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms.d.ts +1 -1
- package/dist/hub/rooms.js +12 -8
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/sessions.js +20 -2
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/sharing.js +2 -2
- package/dist/hub/sharing.js.map +1 -1
- package/dist/hub/types.d.ts +15 -3
- package/dist/human-delivery-receipts.js +8 -0
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instructions.js +3 -0
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +53 -0
- package/dist/locale.js.map +1 -1
- package/dist/native-model-catalog.d.ts +15 -0
- package/dist/native-model-catalog.js +43 -3
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/runtime-build-info.js +1 -0
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +31 -5
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +5 -0
- package/dist/runtime-client-store.js +28 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +4 -0
- package/dist/runtime-client.js +33 -10
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -2
- package/dist/runtime-coordinator.js +28 -6
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +3 -0
- package/dist/runtime-install.js +7 -1
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-personal-answer.d.ts +26 -0
- package/dist/runtime-personal-answer.js +116 -0
- package/dist/runtime-personal-answer.js.map +1 -0
- package/dist/runtime-personal-preflight.d.ts +5 -0
- package/dist/runtime-personal-preflight.js +57 -0
- package/dist/runtime-personal-preflight.js.map +1 -0
- package/dist/runtime-personal-profile.d.ts +36 -0
- package/dist/runtime-personal-profile.js +70 -0
- package/dist/runtime-personal-profile.js.map +1 -0
- package/dist/runtime-personal-protocol.d.ts +7 -0
- package/dist/runtime-personal-protocol.js +11 -0
- package/dist/runtime-personal-protocol.js.map +1 -0
- package/dist/runtime-personal-stage.d.ts +36 -0
- package/dist/runtime-personal-stage.js +163 -0
- package/dist/runtime-personal-stage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/settings-api.js +5 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/tool-progress.d.ts +9 -0
- package/dist/tool-progress.js +141 -32
- package/dist/tool-progress.js.map +1 -1
- package/dist/turn-reply-guard.d.ts +2 -2
- package/dist/turn-reply-guard.js +3 -3
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/ui/chat-store.js +39 -2
- package/dist/ui/fleet-office-skin.js +1 -1
- package/dist/ui/hub-client.js +14 -0
- package/dist/ui/hub-quick-pairing.js +7 -2
- package/dist/ui/hub-roles-strings.js +15 -0
- package/dist/ui/hub-roles.js +48 -0
- package/dist/ui/hub-switcher.js +2 -2
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/model-picker.js +4 -1
- package/dist/ui/panel-hub.js +15 -9
- package/dist/ui/panel-settings.js +4 -4
- package/dist/ui/settings-catalog.js +22 -0
- package/dist/ui/settings-connector-strings.js +23 -0
- package/dist/ui/settings-connector.js +39 -0
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/shared/app-shell.js +24 -10
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app-themes.js +2 -2
- package/dist/ui/shared/app.css +223 -145
- package/dist/ui/shared/chat-thread.js +3 -3
- package/dist/ui/shared/chat-work-bar.css +9 -1
- package/dist/ui/shared/connector-prompt.d.ts +2 -0
- package/dist/ui/shared/connector-prompt.js +10 -0
- package/dist/ui/shared/hub-chat.css +1 -1
- package/dist/ui/shared/hub-owner.css +1 -1
- package/dist/ui/shared/hub-roles.css +27 -0
- package/dist/ui/shared/hub.css +16 -3
- package/dist/ui/shared/image-lightbox.js +35 -10
- package/dist/ui/shared/image-zoom.js +61 -9
- package/dist/ui/shared/instance-nav.js +35 -6
- package/dist/ui/shared/settings-connector.css +7 -0
- package/dist/ui/shared/theme.js +52 -0
- package/dist/ui/shared/tokens.css +27 -10
- package/dist/ui/shared/usage-dialog.js +67 -12
- package/dist/ui/shared/view-strings.js +14 -0
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +39 -23
- package/dist/web-api.js.map +1 -1
- package/dist/web-icons.js +3 -3
- package/dist/web-icons.js.map +1 -1
- package/dist/web-theme.js +2 -2
- package/dist/windows-cli-worker.d.ts +7 -0
- package/dist/windows-cli-worker.js +80 -14
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +9 -1
- package/dist/windows-cli.js +43 -13
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* Themes follow /assets/theme.js: dark under :root; light under @media (prefers-color-scheme: light) for
|
|
7
7
|
* :root:not([data-theme="dark"]), and again under :root[data-theme="light"] for a browser that chose light. The two
|
|
8
8
|
* light blocks carry the same values (a test compares them). Every text colour meets WCAG AA (4.5:1) on the
|
|
9
|
-
* surfaces it is used on, and focus rings and strong borders meet 3:1 (tests/web-tokens-1408.test.ts).
|
|
9
|
+
* surfaces it is used on, and focus rings and strong borders meet 3:1 (tests/web-tokens-1408.test.ts). M-3216 (the user's phone
|
|
10
|
+
* contrast audit): on the dark page the secondary and tertiary greys also reach APCA Lc 60 on the page, the sidebar and a
|
|
11
|
+
* card, the floor for readable small text; WCAG alone passed them while 12–13px grey text still read dim on a phone.
|
|
10
12
|
*
|
|
11
13
|
* Inter is bundled (/assets/inter.woff2, SIL OFL 1.1 — see fonts/README.md): the CSP allows fonts from 'self' only,
|
|
12
14
|
* and nothing is loaded from another site. Chinese falls back to the system's CJK fonts, in the order below.
|
|
@@ -30,8 +32,16 @@
|
|
|
30
32
|
--font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", emoji;
|
|
31
33
|
--font-ui: Inter, "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Noto Sans CJK TC", "Noto Sans CJK SC", "Microsoft JhengHei", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, var(--font-emoji);
|
|
32
34
|
--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace, var(--font-emoji);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
/* M-3216: the two small sizes come from a base the phone layout raises one step; the text-size scopes in app.css
|
|
36
|
+
(the chat, Details, Fleet, Log, the drawer's agents) scale the same base, so they follow it too. */
|
|
37
|
+
--fs-3xs-base: 10px; /* M-3226: the two smallest steps (chart labels, badges, counts); font size only */
|
|
38
|
+
--fs-2xs-base: 11px;
|
|
39
|
+
--fs-xs-base: 12px; --lh-xs-base: 16px;
|
|
40
|
+
--fs-sm-base: 13px; --lh-sm-base: 18px;
|
|
41
|
+
--fs-3xs: var(--fs-3xs-base);
|
|
42
|
+
--fs-2xs: var(--fs-2xs-base);
|
|
43
|
+
--fs-xs: var(--fs-xs-base); --lh-xs: var(--lh-xs-base);
|
|
44
|
+
--fs-sm: var(--fs-sm-base); --lh-sm: var(--lh-sm-base);
|
|
35
45
|
--fs-md: 15px; --lh-md: 24px; /* message text */
|
|
36
46
|
--fs-lg: 17px; --lh-lg: 24px;
|
|
37
47
|
--fs-xl: 22px; --lh-xl: 28px;
|
|
@@ -60,8 +70,8 @@
|
|
|
60
70
|
--border: #3d3d3d; /* used rarely: tone separates areas */
|
|
61
71
|
--border-strong: #7a7a7a;
|
|
62
72
|
--text: #ececec;
|
|
63
|
-
--text-2: #
|
|
64
|
-
--text-3: #
|
|
73
|
+
--text-2: #cfcfcf; /* secondary: senders, labels */
|
|
74
|
+
--text-3: #bbbbbb; /* tertiary: times, hints, metadata */
|
|
65
75
|
--accent: #7ab7ff; /* links and selected text */
|
|
66
76
|
--accent-fill: #ececec; /* the primary button (Send) */
|
|
67
77
|
--on-accent: #0d0d0d;
|
|
@@ -95,8 +105,8 @@
|
|
|
95
105
|
--border: #e5e5e5;
|
|
96
106
|
--border-strong: #858585;
|
|
97
107
|
--text: #0d0d0d;
|
|
98
|
-
--text-2: #
|
|
99
|
-
--text-3: #
|
|
108
|
+
--text-2: #4d4d4d;
|
|
109
|
+
--text-3: #5d5d5d;
|
|
100
110
|
--accent: #0a62c2;
|
|
101
111
|
--accent-fill: #0d0d0d;
|
|
102
112
|
--on-accent: #ffffff;
|
|
@@ -130,8 +140,8 @@
|
|
|
130
140
|
--border: #e5e5e5;
|
|
131
141
|
--border-strong: #858585;
|
|
132
142
|
--text: #0d0d0d;
|
|
133
|
-
--text-2: #
|
|
134
|
-
--text-3: #
|
|
143
|
+
--text-2: #4d4d4d;
|
|
144
|
+
--text-3: #5d5d5d;
|
|
135
145
|
--accent: #0a62c2;
|
|
136
146
|
--accent-fill: #0d0d0d;
|
|
137
147
|
--on-accent: #ffffff;
|
|
@@ -161,6 +171,7 @@
|
|
|
161
171
|
canvas, image-annotate.js COLOURS). */
|
|
162
172
|
:root {
|
|
163
173
|
--media-ink: #ffffff;
|
|
174
|
+
--media-stage: rgba(0, 0, 0, 0.95); /* M-3210: the viewer's own dark, faded by a phone's pull-to-close (app.css .lb) */
|
|
164
175
|
--media-bar: rgba(0, 0, 0, 0.75);
|
|
165
176
|
--media-panel: rgba(0, 0, 0, 0.6);
|
|
166
177
|
--media-btn: rgba(255, 255, 255, 0.12);
|
|
@@ -178,8 +189,14 @@
|
|
|
178
189
|
the small type sizes are 16px ON the controls themselves, so every control sized from them (the filter, search,
|
|
179
190
|
settings fields, selects, the composer) computes to 16px, and a larger one (the sign-in code, 22px) stays as it is.
|
|
180
191
|
Pinch zoom is left alone (no maximum-scale / user-scalable in the viewport); the desktop look does not change. */
|
|
192
|
+
/* M-3216: on the phone layout the two small sizes are a step larger (12 → 13px, 13 → 14px): on a phone most of the
|
|
193
|
+
text (times, hints, labels, a card's lines) is set in them. The bases change, so every scope built on them (app.css's
|
|
194
|
+
text-size scopes) follows. Text fields keep the 16px rule below. */
|
|
195
|
+
@media (max-width: 899px) {
|
|
196
|
+
:root { --fs-3xs-base: 11px; --fs-2xs-base: 12px; --fs-xs-base: 13px; --lh-xs-base: 18px; --fs-sm-base: 14px; --lh-sm-base: 20px; }
|
|
197
|
+
}
|
|
181
198
|
@media (pointer: coarse), (max-width: 899px) {
|
|
182
|
-
input, select, textarea { --fs-xs: 16px; --fs-sm: 16px; --fs-md: 16px; }
|
|
199
|
+
input, select, textarea { --fs-3xs: 16px; --fs-2xs: 16px; --fs-xs: 16px; --fs-sm: 16px; --fs-md: 16px; }
|
|
183
200
|
}
|
|
184
201
|
/* #2478: the composer's drawn placeholder (a span over the box) is the box's text in size too. */
|
|
185
202
|
@media (pointer: coarse), (max-width: 899px) {
|
|
@@ -11,7 +11,7 @@ import { Dialog } from "./ui-dialog.js";
|
|
|
11
11
|
import { ErrorState, Skeleton } from "./ui-states.js";
|
|
12
12
|
import { Icon } from "./ui-icons.js";
|
|
13
13
|
import "./view-strings.js";
|
|
14
|
-
import { CompactMeter, resetClock, resetText, tn, usageClock, usageDuration, usageText } from "./usage-meter.js";
|
|
14
|
+
import { CompactMeter, level, resetClock, resetText, tn, usageClock, usageDuration, usageText, windowTag } from "./usage-meter.js";
|
|
15
15
|
// What this file exported before the meter moved out of it (#3321), for what imports it from here.
|
|
16
16
|
export { usageClock, windowTag, soonestReset } from "./usage-meter.js";
|
|
17
17
|
|
|
@@ -207,18 +207,20 @@ function rowNote(p) {
|
|
|
207
207
|
* Numbers not current, a failed read or no login: one muted line in place of the bars, what is wrong as its tooltip.
|
|
208
208
|
* Pressed, it opens its full card.
|
|
209
209
|
*/
|
|
210
|
-
export function CompactRow({ p, onExpand }) {
|
|
210
|
+
export function CompactRow({ p, onExpand, one = false }) {
|
|
211
211
|
const title = providerTitle(p), failed = p.status === "error" || p.status === "no-credentials";
|
|
212
212
|
// Last known numbers (stale, e.g. an expired token) show as the others do (the user, 2026-10-23; the full card has since
|
|
213
213
|
// #2386), with a small "cached at 07:47" on the name line; a window that reset since is left out (compactSlots).
|
|
214
|
-
|
|
215
|
-
const
|
|
214
|
+
// M-3241: `one` — its group shows one line per login: the binding window (the most used) beside the name.
|
|
215
|
+
const binding = one && !failed ? bindingMetric(p) : null;
|
|
216
|
+
const pools = failed || one ? null : compactPools(p);
|
|
217
|
+
const metrics = failed ? [] : one ? (binding ? [binding] : []) : pools ? pools.flatMap((x) => x.metrics) : compactMetrics(p);
|
|
216
218
|
const note = rowNote(p), stale = p.stale ? staleNote(p) : null;
|
|
217
219
|
const say = stale ? stale.mark : note || tn("usage.no_data");
|
|
218
220
|
const detail = stale ? [stale.mark, stale.detail].filter(Boolean).join(" — ") : say;
|
|
219
221
|
const name = title.profile || title.base;
|
|
220
222
|
const models = !pools && metrics.some((m) => m.scope === "model");
|
|
221
|
-
return html`<button type="button" class=${`u-crow${p.stale ? " is-stale" : ""}${pools ? " is-pooled" : ""}${models ? " has-models" : ""}`} aria-expanded="false" title=${`${p.name} — ${tn("usageExpand")}`} onClick=${onExpand}>
|
|
223
|
+
return html`<button type="button" class=${`u-crow${p.stale ? " is-stale" : ""}${pools ? " is-pooled" : ""}${models ? " has-models" : ""}${one ? " is-one" : ""}`} aria-expanded="false" title=${`${p.name} — ${tn("usageExpand")}`} onClick=${onExpand}>
|
|
222
224
|
<span class="u-crow-head"><span class="u-crow-name">${name}</span>${p.noAgents ? html`<span class="note">${tn("usage.no_agents")}</span>` : null}
|
|
223
225
|
${p.plan ? html`<span class="pill u-plan" title=${p.plan}><span aria-hidden="true">${planBadge(p.plan)}</span><span class="sr-only">${p.plan}</span></span>` : null}
|
|
224
226
|
${stale && metrics.length ? html`<span class="u-crow-stale" title=${detail}>${p.cachedAt ? tn("usageCachedAt", { at: usageClock(p.cachedAt) }) : stale.mark}<span class="sr-only"> (${detail})</span></span>` : null}</span>
|
|
@@ -228,11 +230,63 @@ export function CompactRow({ p, onExpand }) {
|
|
|
228
230
|
: html`<span class=${`u-crow-note${(stale || (p.status === "error" && !p.transient)) ? " is-alert" : ""}`} title=${detail}>${say}</span>`}
|
|
229
231
|
</button>`;
|
|
230
232
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
// ── M-3241 (the user): a provider of two or more logins folds — −/+ on its header cycles every window of each login →
|
|
234
|
+
// one line per login (its binding window: the most used) → the header alone, with the highest percent. Warning colours
|
|
235
|
+
// stay in each. This browser's choice (localStorage), per provider; another tab's follows. ──
|
|
236
|
+
const GROUP_MODE_KEY = "agend_usage_group_modes";
|
|
237
|
+
const GROUP_MODES = ["expanded", "compact", "collapsed"];
|
|
238
|
+
function readGroupModes() {
|
|
239
|
+
try { const o = JSON.parse(stored(GROUP_MODE_KEY) || "{}"); return o && typeof o === "object" && !Array.isArray(o) ? Object.fromEntries(Object.entries(o).filter(([, v]) => GROUP_MODES.includes(v))) : {}; }
|
|
240
|
+
catch { return {}; }
|
|
241
|
+
}
|
|
242
|
+
export const usageGroupStore = createStore({ modes: readGroupModes() });
|
|
243
|
+
export const groupMode = (base) => usageGroupStore.get().modes[base] || "expanded";
|
|
244
|
+
export function setGroupMode(base, mode) {
|
|
245
|
+
const modes = { ...usageGroupStore.get().modes };
|
|
246
|
+
if (mode === "expanded") delete modes[base]; else modes[base] = mode;
|
|
247
|
+
usageGroupStore.set({ modes });
|
|
248
|
+
store(GROUP_MODE_KEY, JSON.stringify(modes));
|
|
249
|
+
}
|
|
250
|
+
if (typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
251
|
+
window.addEventListener("storage", (e) => { if (!e || e.key === GROUP_MODE_KEY || e.key === null) usageGroupStore.set({ modes: readGroupModes() }); });
|
|
252
|
+
}
|
|
253
|
+
/** The window that binds a login: its most used percent window (any pool, any model), or null. */
|
|
254
|
+
export function bindingMetric(p) {
|
|
255
|
+
const pct = ((p && p.metrics) || []).filter((m) => m && m.type === "percent" && !m.resetPassed);
|
|
256
|
+
return pct.length ? pct.reduce((a, b) => ((b.used ?? 0) > (a.used ?? 0) ? b : a)) : null;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A group's most used window, and whose: the collapsed header's number. A failed login has none. A stale login's cached
|
|
260
|
+
* number (#4054 review) counts only when no current login has one, and is then muted and marked cached, as its row is.
|
|
261
|
+
*/
|
|
262
|
+
function groupTop(group) {
|
|
263
|
+
let top = null, cached = null;
|
|
264
|
+
for (const { p } of group.items) {
|
|
265
|
+
const m = p.status === "error" || p.status === "no-credentials" ? null : bindingMetric(p);
|
|
266
|
+
if (!m) continue;
|
|
267
|
+
if (p.stale) { if (!cached || (m.used ?? 0) > (cached.m.used ?? 0)) cached = { m, p }; }
|
|
268
|
+
else if (!top || (m.used ?? 0) > (top.m.used ?? 0)) top = { m, p };
|
|
269
|
+
}
|
|
270
|
+
return top || cached;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* A provider's logins: its name once (×N), in small capitals, then each login (or the full card of one opened). Two or
|
|
274
|
+
* more (M-3241): −/+ on the right cycles `mode` — every window, one line each, the header alone with the highest percent.
|
|
275
|
+
*/
|
|
276
|
+
export function CompactGroup({ group, line, mode = "expanded", onCycle }) {
|
|
277
|
+
const many = group.items.length > 1 && typeof onCycle === "function";
|
|
278
|
+
const shown = many ? mode : "expanded";
|
|
279
|
+
const top = many && shown === "collapsed" ? groupTop(group) : null;
|
|
280
|
+
const pct = top ? Math.min(100, Math.max(0, top.m.used ?? 0)) : null;
|
|
281
|
+
const next = shown === "expanded" ? "usageGroupToOne" : shown === "compact" ? "usageGroupToHeader" : "usageGroupToAll";
|
|
282
|
+
const who = top ? `${providerTitle(top.p).profile || providerTitle(top.p).base} · ${top.m.scope === "model" ? modelTag(top.m) : windowTag(top.m)}` : "";
|
|
283
|
+
return html`<section class=${`u-cgroup${many ? ` is-${shown}` : ""}`} data-group=${group.base}>
|
|
284
|
+
<div class="u-cg-head"><span class="u-cg-name" title=${group.base}>${group.base}</span>${group.items.length > 1 ? html`<span class="u-cg-count">×${group.items.length}</span>` : null}
|
|
285
|
+
${many ? html`<span class="u-cg-tools">
|
|
286
|
+
${top ? html`<span class=${`u-cg-top u-cm-pct ${level(pct)}${top.p.stale ? " is-stale" : ""}`} title=${tn("usageGroupTop", { pct: pct.toFixed(0), who }) + (top.p.stale && top.p.cachedAt ? ` · ${tn("usageCachedAt", { at: usageClock(top.p.cachedAt) })}` : "")}>${pct.toFixed(0)}%<span class="sr-only"> (${who})</span></span>` : null}
|
|
287
|
+
<button type="button" class="icon-btn u-cg-toggle" aria-expanded=${shown === "collapsed" ? "false" : "true"} aria-label=${`${group.base}: ${tn(next)}`} title=${tn(next)}
|
|
288
|
+
onClick=${() => onCycle(GROUP_MODES[(GROUP_MODES.indexOf(shown) + 1) % GROUP_MODES.length])}><${Icon} name=${shown === "collapsed" ? "plus" : "minus"} size=${14} /></button></span>` : null}</div>
|
|
289
|
+
${shown === "collapsed" ? null : group.items.map(line)}
|
|
236
290
|
</section>`;
|
|
237
291
|
}
|
|
238
292
|
|
|
@@ -250,6 +304,7 @@ export function UsageBody({ owner }) {
|
|
|
250
304
|
const reads = useMemo(() => readStream(lease), [lease]);
|
|
251
305
|
// Compact (one line per login): a line pressed opens its full card here, until folded or the mode changes.
|
|
252
306
|
const { compact } = useStore(usageViewStore);
|
|
307
|
+
const { modes } = useStore(usageGroupStore); // M-3241
|
|
253
308
|
const [expanded, setExpanded] = useState(() => new Set());
|
|
254
309
|
useEffect(() => { setExpanded(new Set()); }, [compact]);
|
|
255
310
|
const toggleOne = (id) => setExpanded((was) => { const next = new Set(was); if (next.has(id)) next.delete(id); else next.add(id); return next; });
|
|
@@ -317,8 +372,8 @@ export function UsageBody({ owner }) {
|
|
|
317
372
|
${!p.stale && p.hint ? html`<p class="note">${usageText(p.hint, p.hintI18n)}</p>` : !(p.metrics || []).length ? html`<p class="note">${tn("usage.no_data")}</p>` : null}`}
|
|
318
373
|
</section>`;
|
|
319
374
|
content = html`${!providers.length ? html`<p class="note">${tn("usage.empty_active")}</p>` : null}
|
|
320
|
-
${compact ? compactGroups(providers).map((g) => html`<${CompactGroup} key=${g.base} group=${g}
|
|
321
|
-
line=${({ p, i }) => (expanded.has(key(p)) ? card(p, i) : html`<${CompactRow} key=${key(p)} p=${p} onExpand=${() => toggleOne(key(p))} />`)} />`)
|
|
375
|
+
${compact ? compactGroups(providers).map((g) => html`<${CompactGroup} key=${g.base} group=${g} mode=${modes[g.base] || "expanded"} onCycle=${(m) => setGroupMode(g.base, m)}
|
|
376
|
+
line=${({ p, i }) => (expanded.has(key(p)) ? card(p, i) : html`<${CompactRow} key=${key(p)} p=${p} one=${(modes[g.base] || "expanded") === "compact" && g.items.length > 1} onExpand=${() => toggleOne(key(p))} />`)} />`)
|
|
322
377
|
: providers.map((p, i) => card(p, i))}
|
|
323
378
|
<div class="u-foot"><span class="note" title=${new Date(data.fetchedAt).toLocaleString()}>${failed ? html`${updatedAgo(data.fetchedAt)} · <span class="u-refresh-failed" role="status">${tn("usageRefreshFailed")}</span>` : data.refreshing ? html`<span class="u-refreshing">${tn("usageRefreshing")}</span>` : updatedAgo(data.fetchedAt)}</span>
|
|
324
379
|
${byAgent() ? html`<a class="btn btn-ghost btn-sm u-by-agent" href="/ui/fleet/usage" title=${tn("usageByAgentTitle")}>${tn("usageByAgent")}</a>` : null}
|
|
@@ -52,6 +52,10 @@ register("view", {
|
|
|
52
52
|
"usageMoveDown": "Move down",
|
|
53
53
|
"usageCompact": "Compact",
|
|
54
54
|
"usageCompactTitle": "One line per login",
|
|
55
|
+
"usageGroupToOne": "One line per account",
|
|
56
|
+
"usageGroupToHeader": "Show only the header",
|
|
57
|
+
"usageGroupToAll": "Show every window",
|
|
58
|
+
"usageGroupTop": "Highest: {pct}% ({who})",
|
|
55
59
|
"usageFull": "Full",
|
|
56
60
|
"usageFullTitle": "The full card for each login",
|
|
57
61
|
"usageExpand": "Show the full card",
|
|
@@ -278,6 +282,9 @@ register("view", {
|
|
|
278
282
|
"sortDisplay": "Display",
|
|
279
283
|
"sortDisplayDetailed": "Detailed",
|
|
280
284
|
"sortDisplayCompact": "Compact",
|
|
285
|
+
"sortPhoneDrawer": "Phone sidebar",
|
|
286
|
+
"sortPhoneDrawerFull": "Full width",
|
|
287
|
+
"sortPhoneDrawerNarrow": "Narrow",
|
|
281
288
|
"recentOthers": "Recent replies first",
|
|
282
289
|
"pinnedCurrent": "Current",
|
|
283
290
|
"pinnedLabel": "The instance you have open"
|
|
@@ -330,6 +337,10 @@ register("view", {
|
|
|
330
337
|
"usageMoveDown": "下移",
|
|
331
338
|
"usageCompact": "精簡",
|
|
332
339
|
"usageCompactTitle": "每個登入一行",
|
|
340
|
+
"usageGroupToOne": "每個帳號一行",
|
|
341
|
+
"usageGroupToHeader": "只顯示標題",
|
|
342
|
+
"usageGroupToAll": "顯示所有用量",
|
|
343
|
+
"usageGroupTop": "最高:{pct}%({who})",
|
|
333
344
|
"usageFull": "完整",
|
|
334
345
|
"usageFullTitle": "每個登入顯示完整卡片",
|
|
335
346
|
"usageExpand": "顯示完整卡片",
|
|
@@ -554,6 +565,9 @@ register("view", {
|
|
|
554
565
|
"sortDisplay": "顯示",
|
|
555
566
|
"sortDisplayDetailed": "詳細",
|
|
556
567
|
"sortDisplayCompact": "精簡",
|
|
568
|
+
"sortPhoneDrawer": "手機側欄",
|
|
569
|
+
"sortPhoneDrawerFull": "滿版",
|
|
570
|
+
"sortPhoneDrawerNarrow": "窄版",
|
|
557
571
|
"recentOthers": "最近回覆在上",
|
|
558
572
|
"pinnedCurrent": "目前",
|
|
559
573
|
"pinnedLabel": "你目前開著的 Agent"
|
package/dist/web-api.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export interface WebApiContext {
|
|
|
85
85
|
label: string;
|
|
86
86
|
description?: string;
|
|
87
87
|
}>>;
|
|
88
|
+
/** Discover an empty (or refresh a stale) model list once, bounded, before GET /ui/models answers; never throws. */
|
|
89
|
+
ensureModelCatalog?(backend: string, instance: string | null, selection?: {
|
|
90
|
+
profile?: string;
|
|
91
|
+
}): Promise<void>;
|
|
88
92
|
refreshModelCatalogFor?(backend: string, instance: string | null, selection?: {
|
|
89
93
|
profile?: string;
|
|
90
94
|
}): Promise<{
|
package/dist/web-api.js
CHANGED
|
@@ -377,6 +377,35 @@ function webCatalog(ctx, backend, instance, profile, plain) {
|
|
|
377
377
|
const flat = plain ?? (profile !== null ? ctx.modelCatalogFor?.(backend, instance, { profile }) : ctx.modelCatalogFor?.(backend, instance)) ?? [];
|
|
378
378
|
return shapeWebModelCatalog(backend, flat);
|
|
379
379
|
}
|
|
380
|
+
/** GET /ui/models' answer: the cached catalog of this instance/account, else the CLI's own cache, else (claude) the documented ids. */
|
|
381
|
+
function answerModelCatalog(res, ctx, backend, instance, profile, canAnswer) {
|
|
382
|
+
const models = webCatalog(ctx, backend, instance, profile);
|
|
383
|
+
// claude with no account list — with or without a credential profile — is answered with the documentation's ids.
|
|
384
|
+
const answerCatalog = () => {
|
|
385
|
+
if (backend === "claude-code" && !models.length)
|
|
386
|
+
json(res, 200, { backend, models: documentedClaudeCatalog(ctx), source: "official-catalog" });
|
|
387
|
+
else
|
|
388
|
+
json(res, 200, { backend, models });
|
|
389
|
+
};
|
|
390
|
+
// The existing catalog belongs to this instance/account and always wins.
|
|
391
|
+
if (models.length || !ctx.cliModelCatalogFor || profile !== null) {
|
|
392
|
+
answerCatalog();
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
void (async () => {
|
|
396
|
+
const cliModels = await ctx.cliModelCatalogFor?.(backend, instance) ?? [];
|
|
397
|
+
if (!canAnswer())
|
|
398
|
+
return;
|
|
399
|
+
const shaped = shapeWebModelCatalog(backend, cliModels);
|
|
400
|
+
if (shaped.length)
|
|
401
|
+
json(res, 200, { backend, models: shaped, source: "cli-cache" });
|
|
402
|
+
else
|
|
403
|
+
answerCatalog();
|
|
404
|
+
})().catch(() => {
|
|
405
|
+
if (canAnswer())
|
|
406
|
+
json(res, 503, { error: "CLI model cache unavailable" });
|
|
407
|
+
});
|
|
408
|
+
}
|
|
380
409
|
/** claude's fallback when no account list is readable: the documentation's `claude-*` ids for the host's CLI version, unverified. */
|
|
381
410
|
function documentedClaudeCatalog(ctx) {
|
|
382
411
|
const version = ctx.backendAvailabilityRows?.().find(row => row.backend === "claude-code")?.version;
|
|
@@ -2858,33 +2887,20 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2858
2887
|
}
|
|
2859
2888
|
if (handleNativeModelCatalog(req, res, url, ctx))
|
|
2860
2889
|
return true;
|
|
2861
|
-
const
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
json(res, 200, { backend, models });
|
|
2868
|
-
};
|
|
2869
|
-
// The existing catalog belongs to this instance/account and always wins.
|
|
2870
|
-
if (models.length || !ctx.cliModelCatalogFor || profile !== null) {
|
|
2871
|
-
answerCatalog();
|
|
2890
|
+
const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
|
|
2891
|
+
const answer = () => answerModelCatalog(res, ctx, backend, instance, profile, canAnswer);
|
|
2892
|
+
// An empty (or stale) list is discovered once, bounded, before the answer — the page shows its loading state
|
|
2893
|
+
// meanwhile — rather than answered as "no models" until someone presses Refresh. A cached fresh list is answered at once.
|
|
2894
|
+
if (!ctx.ensureModelCatalog) {
|
|
2895
|
+
answer();
|
|
2872
2896
|
return true;
|
|
2873
2897
|
}
|
|
2874
|
-
const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
|
|
2875
2898
|
void (async () => {
|
|
2876
|
-
|
|
2877
|
-
if (!canAnswer())
|
|
2878
|
-
return;
|
|
2879
|
-
const shaped = shapeWebModelCatalog(backend, cliModels);
|
|
2880
|
-
if (shaped.length)
|
|
2881
|
-
json(res, 200, { backend, models: shaped, source: "cli-cache" });
|
|
2882
|
-
else
|
|
2883
|
-
answerCatalog();
|
|
2884
|
-
})().catch(() => {
|
|
2899
|
+
await ctx.ensureModelCatalog?.(backend, instance, profile !== null ? { profile } : undefined);
|
|
2885
2900
|
if (canAnswer())
|
|
2886
|
-
|
|
2887
|
-
})
|
|
2901
|
+
answer();
|
|
2902
|
+
})().catch(() => { if (canAnswer())
|
|
2903
|
+
json(res, 503, { error: "model catalog unavailable" }); });
|
|
2888
2904
|
return true;
|
|
2889
2905
|
}
|
|
2890
2906
|
// The effort levels Settings → Runtime & model's dropdown offers for an agent and a (not yet saved) model — the chat chip's list.
|