@try-works/dsh-minimal-router 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/index.js +1949 -1510
- package/lib/backend.js +40 -9
- package/lib/build-id.js +1 -1
- package/lib/engine-adapter.js +24 -8
- package/lib/engines/contract.js +59 -0
- package/lib/engines/mlx-serve.js +183 -0
- package/lib/engines/omlx.js +185 -0
- package/lib/engines/select.js +40 -0
- package/lib/engines/snapshot.js +345 -0
- package/lib/evidence.js +96 -1
- package/lib/index.js +110 -6
- package/lib/routing.js +22 -9
- package/lib/telemetry-series.js +275 -0
- package/lib/telemetry.js +30 -3
- package/package.json +1 -1
package/client/index.js
CHANGED
|
@@ -355,23 +355,23 @@ function overdamped(omega, zeta, x0, v0) {
|
|
|
355
355
|
function settleTime(solver, {
|
|
356
356
|
positionTolerance = 0.5,
|
|
357
357
|
velocityTolerance = 0.02,
|
|
358
|
-
step:
|
|
358
|
+
step: step4 = 1,
|
|
359
359
|
limit = 1e4
|
|
360
360
|
} = {}) {
|
|
361
|
-
for (let t = 0; t <= limit; t +=
|
|
361
|
+
for (let t = 0; t <= limit; t += step4) {
|
|
362
362
|
if (Math.abs(solver.position(t)) <= positionTolerance && Math.abs(solver.velocity(t)) <= velocityTolerance) {
|
|
363
363
|
return t;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
return limit;
|
|
367
367
|
}
|
|
368
|
-
function springLinearEasing(solver, from, to, duration2,
|
|
368
|
+
function springLinearEasing(solver, from, to, duration2, step4 = 1e3 / 120) {
|
|
369
369
|
const distance2 = to - from;
|
|
370
370
|
if (Math.abs(distance2) < 1e-6) {
|
|
371
371
|
return "linear";
|
|
372
372
|
}
|
|
373
373
|
const stops = [];
|
|
374
|
-
for (let t = 0; t < duration2; t +=
|
|
374
|
+
for (let t = 0; t < duration2; t += step4) {
|
|
375
375
|
stops.push(round(1 + solver.position(t) / distance2));
|
|
376
376
|
}
|
|
377
377
|
stops.push("1");
|
|
@@ -3254,14 +3254,14 @@ function rovingStop(items, remembered = null) {
|
|
|
3254
3254
|
const enabled = focusable.filter((item) => !item.disabled);
|
|
3255
3255
|
return (enabled.find((item) => item.preferred) ?? enabled[0] ?? focusable[0])?.key ?? null;
|
|
3256
3256
|
}
|
|
3257
|
-
function moveIndex(index2,
|
|
3258
|
-
if (
|
|
3257
|
+
function moveIndex(index2, step4, count3, loop) {
|
|
3258
|
+
if (step4 === "first") {
|
|
3259
3259
|
return 0;
|
|
3260
3260
|
}
|
|
3261
|
-
if (
|
|
3261
|
+
if (step4 === "last") {
|
|
3262
3262
|
return count3 - 1;
|
|
3263
3263
|
}
|
|
3264
|
-
const next3 = index2 +
|
|
3264
|
+
const next3 = index2 + step4;
|
|
3265
3265
|
if (loop) {
|
|
3266
3266
|
return (next3 % count3 + count3) % count3;
|
|
3267
3267
|
}
|
|
@@ -4869,11 +4869,11 @@ function createRovingFocus(context4, options) {
|
|
|
4869
4869
|
if (options.move) {
|
|
4870
4870
|
to = options.move(event, { from, items: list, rtl });
|
|
4871
4871
|
} else if (!event.ctrlKey && !event.metaKey) {
|
|
4872
|
-
const
|
|
4873
|
-
if (
|
|
4872
|
+
const step4 = stepFor(event.key, orientation(), rtl);
|
|
4873
|
+
if (step4 !== void 0) {
|
|
4874
4874
|
to = list[moveIndex(
|
|
4875
4875
|
list.indexOf(from),
|
|
4876
|
-
|
|
4876
|
+
step4,
|
|
4877
4877
|
list.length,
|
|
4878
4878
|
options.loop?.() ?? false
|
|
4879
4879
|
)]?.key;
|
|
@@ -7418,8 +7418,8 @@ function guardFrames(popup, trapping) {
|
|
|
7418
7418
|
return;
|
|
7419
7419
|
}
|
|
7420
7420
|
const stops = tabbables(popup);
|
|
7421
|
-
const
|
|
7422
|
-
const next3 = stops.at((stops.indexOf(from) +
|
|
7421
|
+
const step4 = side === 0 ? -1 : 1;
|
|
7422
|
+
const next3 = stops.at((stops.indexOf(from) + step4) % stops.length);
|
|
7423
7423
|
(next3 ?? popup).focus({ preventScroll: true });
|
|
7424
7424
|
});
|
|
7425
7425
|
return () => {
|
|
@@ -7810,12 +7810,12 @@ function createPopupLayer(options) {
|
|
|
7810
7810
|
if (index2 === -1) {
|
|
7811
7811
|
return;
|
|
7812
7812
|
}
|
|
7813
|
-
const
|
|
7814
|
-
const next3 =
|
|
7815
|
-
const previous =
|
|
7813
|
+
const step4 = path[index2];
|
|
7814
|
+
const next3 = step4.next?.deref();
|
|
7815
|
+
const previous = step4.previous?.deref();
|
|
7816
7816
|
const parent = path[index2 + 1].node;
|
|
7817
7817
|
const inPlace = (sibling) => !!sibling?.isConnected && sibling.parentNode === parent;
|
|
7818
|
-
const closed = inPlace(next3) ? next3.previousElementSibling === (
|
|
7818
|
+
const closed = inPlace(next3) ? next3.previousElementSibling === (step4.previous ? previous : null) : !step4.next && (step4.previous ? inPlace(previous) && !previous.nextElementSibling : !parent.firstElementChild);
|
|
7819
7819
|
if (strict && !closed) {
|
|
7820
7820
|
return;
|
|
7821
7821
|
}
|
|
@@ -16083,161 +16083,6 @@ var RouterIcon = () => (0, import_react.createElement)(
|
|
|
16083
16083
|
// packages/plugin/client/RouterPage.ts
|
|
16084
16084
|
var import_react2 = require("react");
|
|
16085
16085
|
|
|
16086
|
-
// packages/ui/src/tokens.ts
|
|
16087
|
-
var RouterTokensCss = `:root {
|
|
16088
|
-
/* \u2500\u2500 \xA701 colour roles \u2014 12 roles, one value each \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16089
|
-
--color-bg: #FFFFFF; /* page ground, card ground */
|
|
16090
|
-
--color-surface: #FAFAF9; /* inset panel, table head, state well */
|
|
16091
|
-
--color-subtle: #F2F2F0; /* hover fill, tag fill, disabled fill */
|
|
16092
|
-
--color-ink: #111111; /* titles, values, focus ring, primary fill */
|
|
16093
|
-
--color-body: #333333; /* labels, control text, prose */
|
|
16094
|
-
--color-meta: #5F5F5F; /* micro-labels, table meta, footer, copy */
|
|
16095
|
-
--color-placeholder: #AAAAAA; /* unset value inside a control */
|
|
16096
|
-
--color-disabled: #D6D6D3; /* disabled label and icon */
|
|
16097
|
-
--color-danger: #B4261A; /* error text, invalid border, destructive */
|
|
16098
|
-
/* Three hairline roles, not three greys (F-34-01). Panel and field share a
|
|
16099
|
-
value today so a field edge can be strengthened without moving a panel. */
|
|
16100
|
-
--color-line-rule: #EAEAEA; /* row divider, table rule, header rule */
|
|
16101
|
-
--color-line-panel: #DFDFDD; /* card, notice, chip edge */
|
|
16102
|
-
--color-line-field: #DFDFDD; /* input, select, button border */
|
|
16103
|
-
|
|
16104
|
-
/* \u2500\u2500 \xA704 depth \u2014 one flat default, one float; CSS-only (no Paper token) \u2500\u2500\u2500 */
|
|
16105
|
-
--elevation-flat: none;
|
|
16106
|
-
--elevation-popover: 0 8px 24px rgba(17,17,17,.10);
|
|
16107
|
-
|
|
16108
|
-
/* \u2500\u2500 \xA702 type families \u2014 titles/sentence Geist, labels Inter, data Mono \u2500\u2500\u2500 */
|
|
16109
|
-
--font-prose: "Geist", "Inter", system-ui, sans-serif;
|
|
16110
|
-
--font-ui: "Inter", system-ui, sans-serif;
|
|
16111
|
-
--font-mono: "Geist Mono", ui-monospace, monospace;
|
|
16112
|
-
|
|
16113
|
-
/* \u2500\u2500 \xA702 canonical steps \u2014 T1 display \u2026 T6 meta \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16114
|
-
--text-display: 30px; /* T1 \u2014 page title (the tab names the page) */
|
|
16115
|
-
--leading-display: 34px;
|
|
16116
|
-
--text-title: 20px; /* T2 \u2014 section, state and decision title */
|
|
16117
|
-
--leading-title: 24px;
|
|
16118
|
-
--text-sentence: 19px; /* T3 \u2014 the Overview sentence, this role only */
|
|
16119
|
-
--leading-sentence: 24px;
|
|
16120
|
-
--text-body: 14px; /* T4 \u2014 prose, descriptions, empty copy */
|
|
16121
|
-
--leading-body: 20px;
|
|
16122
|
-
--text-label: 13px; /* T5 \u2014 form labels, row names, error text */
|
|
16123
|
-
--leading-label: 18px;
|
|
16124
|
-
--text-meta: 12px; /* T6 \u2014 data cells, table meta, mono labels */
|
|
16125
|
-
--leading-meta: 16px;
|
|
16126
|
-
|
|
16127
|
-
/* \u2500\u2500 \xA702 closed dense exceptions \u2014 D1 kpi \u2026 D4 micro-label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16128
|
-
--text-kpi: 18px; /* D1 \u2014 KPI value, concurrency ceiling */
|
|
16129
|
-
--leading-kpi: 22px;
|
|
16130
|
-
--text-detail: 17px; /* D2 \u2014 record title, detail panel heading */
|
|
16131
|
-
--leading-detail: 22px;
|
|
16132
|
-
--text-caption: 10.5px; /* D3 \u2014 KPI caption, chip sm, table sub-cell */
|
|
16133
|
-
--leading-caption: 14px;
|
|
16134
|
-
--text-caps: 9.5px; /* D4 \u2014 record head, table heads, caps labels */
|
|
16135
|
-
--leading-caps: 12px;
|
|
16136
|
-
|
|
16137
|
-
/* \u2500\u2500 \xA702 tracking \u2014 declared per role in em, never inherited \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16138
|
-
--tracking-none: 0em; /* T4, T5, T6 */
|
|
16139
|
-
--tracking-snug: -0.01em; /* T2, D1, D2 */
|
|
16140
|
-
--tracking-sentence: -0.012em; /* T3 only */
|
|
16141
|
-
--tracking-tight: -0.02em; /* T1 */
|
|
16142
|
-
--tracking-caption: 0.01em; /* D3 \u2014 board \xA702 states it; see the P1 report */
|
|
16143
|
-
--tracking-caps: 0.06em; /* D4 */
|
|
16144
|
-
|
|
16145
|
-
/* \u2500\u2500 \xA703 spacing \u2014 a 4px base, eight steps \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16146
|
-
--spacing-1: 4px; /* icon gap */
|
|
16147
|
-
--spacing-2: 8px; /* chip gap */
|
|
16148
|
-
--spacing-3: 12px; /* field pad */
|
|
16149
|
-
--spacing-4: 16px; /* panel pad */
|
|
16150
|
-
--spacing-5: 20px; /* gutter @390 */
|
|
16151
|
-
--spacing-6: 24px; /* section gap */
|
|
16152
|
-
--spacing-7: 28px; /* frame gap */
|
|
16153
|
-
--spacing-8: 32px; /* gutter @1440 */
|
|
16154
|
-
|
|
16155
|
-
/* \u2500\u2500 \xA705 control heights and row height \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16156
|
-
--container-control-sm: 24px; /* chips, pager, icon buttons, sentence chips */
|
|
16157
|
-
--container-control-md: 30px; /* buttons, select, number field, input */
|
|
16158
|
-
--container-control-lg: 38px; /* Engine endpoint/key, page primary */
|
|
16159
|
-
--container-row: 44px; /* table row and form row */
|
|
16160
|
-
|
|
16161
|
-
/* \u2500\u2500 page geometry (measured, already holds) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16162
|
-
/* The shell header's measured height (DEC-34-05: 24 top pad + the 28px tab
|
|
16163
|
-
row + hairline at 1440; the wrapped bar plus the status row at 390). It is
|
|
16164
|
-
the SHELL's value: no page reads or subtracts it, because the shell's flex
|
|
16165
|
-
column owns the fold (F-34-21). ShellCss overrides it to 115px below 760. */
|
|
16166
|
-
--shell-header: 59px;
|
|
16167
|
-
--container-page: 1180px;
|
|
16168
|
-
--container-gutter: 32px;
|
|
16169
|
-
--container-gutter-sm: 20px;
|
|
16170
|
-
/* F-34-14 repair (P6): --container-measure (720px) is deleted \u2014 no source
|
|
16171
|
-
declares or needs a 720px measure. --breakpoint-sm/-md/-lg are deleted for
|
|
16172
|
-
the same reason: a CSS @media condition cannot read a var(), and no JS
|
|
16173
|
-
matchMedia consumes them, so the tokens could have no consumer. Every
|
|
16174
|
-
media budget is pinned by name in tokens.test.ts instead. */
|
|
16175
|
-
|
|
16176
|
-
/* \u2500\u2500 \xA704 radii \u2014 four corners + two shapes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16177
|
-
--radius-chip: 4px; /* chip, tag, badge */
|
|
16178
|
-
--radius-input: 6px; /* input, select, number field */
|
|
16179
|
-
--radius-card: 8px; /* the one panel: raised or inset */
|
|
16180
|
-
--radius-popover: 10px; /* popover surface */
|
|
16181
|
-
--radius-pill: 999px; /* switch track, on filter chip */
|
|
16182
|
-
--radius-round: 50%; /* status dot, slider thumb */
|
|
16183
|
-
}`;
|
|
16184
|
-
var RouterRecipesCss = `
|
|
16185
|
-
/* Owner review (2026-12-05): a data page reads calmer when its numbers hold
|
|
16186
|
-
their columns and its text is antialiased. Tabular figures wherever a value
|
|
16187
|
-
updates, smoothing on the page roots, and one rule for the quiet empty line.
|
|
16188
|
-
[class~="router-panel-value"] is the panel value written without the panel
|
|
16189
|
-
prefix, so the panel recipe below stays the only .router-panel selector. */
|
|
16190
|
-
.router-overview, .page-body, .router-rail, .router-split { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
|
|
16191
|
-
.router-kpi-value, .router-kpi-sub, .router-meter-value, .router-meter-status, .router-meter-tick, .router-recent-time, .router-recent-meta, .router-session-meta, .router-session-state, .router-ceiling-value, .router-ceiling-unit, .router-card-meta, [class~="router-panel-value"] { font-variant-numeric: tabular-nums; }
|
|
16192
|
-
.router-empty-line { padding: 6px 0; font-family: var(--font-ui); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-meta); text-wrap: pretty; }
|
|
16193
|
-
[data-control]:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
|
|
16194
|
-
:where([data-control]):hover:where(:not([aria-disabled="true"]):not(:disabled):not([aria-pressed="true"]):not([aria-checked="true"]):not([aria-current="page"]):not([data-current="true"])) { background: var(--color-subtle); color: var(--color-ink); transition: background 120ms ease; }
|
|
16195
|
-
.router-interactive:hover { background: var(--color-subtle); transition: background 120ms ease; }
|
|
16196
|
-
[data-control][aria-disabled="true"] { color: var(--color-disabled); background: var(--color-surface); cursor: not-allowed; }
|
|
16197
|
-
[aria-invalid="true"] { border-color: var(--color-danger); }
|
|
16198
|
-
/* The kit Slider keeps its range input visually hidden inside the drawn thumb
|
|
16199
|
-
(13RS-0), so the thumb carries the board's hover halo and focus ring. */
|
|
16200
|
-
.router-slider-thumb:hover { box-shadow: 0 0 0 4px var(--color-subtle); }
|
|
16201
|
-
.router-slider-thumb:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-ink); }
|
|
16202
|
-
.router-field-error { font-family: var(--font-ui); font-size: var(--text-label); line-height: var(--leading-label); color: var(--color-danger); }
|
|
16203
|
-
/* One error role, three placements: the class stays exactly router-field-error
|
|
16204
|
-
and the layout rides a data attribute, so a test/DevTools probe can still
|
|
16205
|
-
match the role by class (F-34-12). */
|
|
16206
|
-
.router-field-error[data-error-layout="page"] { margin: 0 0 10px; }
|
|
16207
|
-
.router-field-error[data-error-layout="alert"] { padding-block: 4px 0; }
|
|
16208
|
-
.router-field-error[data-error-layout="row"] { padding-bottom: 6px; }
|
|
16209
|
-
/* F-34-19 (P6): the ONE panel surface. Before this rule the pages carried four
|
|
16210
|
-
competing surface grammars (detail/record were flat surface wells, card a
|
|
16211
|
-
raised white panel, notice a chip-cornered box) plus the settings panel's
|
|
16212
|
-
own copy. Every panel now takes .router-panel with data-surface:
|
|
16213
|
-
raised \u2014 a panel lifted off the page ground (cards, settings blocks);
|
|
16214
|
-
flush \u2014 a panel set into the page ground (detail, record, notice).
|
|
16215
|
-
Both are the board's one panel: a 1px --color-line-panel hairline and the
|
|
16216
|
-
--radius-card corner; only the ground differs (DEC: "the one panel: raised
|
|
16217
|
-
or inset", tokens \xA704). Pages keep only padding and layout in their class. */
|
|
16218
|
-
.router-panel { box-sizing: border-box; border: 1px solid var(--color-line-panel); border-radius: var(--radius-card); }
|
|
16219
|
-
.router-panel[data-surface="raised"] { background: var(--color-bg); }
|
|
16220
|
-
.router-panel[data-surface="flush"] { background: var(--color-surface); }
|
|
16221
|
-
/* The interactive class list: every class that can take a pointer or the
|
|
16222
|
-
keyboard, so the two recipes cannot miss one (F-34-06/07). */
|
|
16223
|
-
:where(.router-chip, .router-filter-chip, .router-button, .router-model-button, .router-pager-button, .router-export, .router-input, .router-select-item, .router-conflict-action, .router-footer-button, .router-select-trigger, .router-settings-action, .router-subset-button, .router-switch):hover:where(:not([aria-disabled="true"]):not(:disabled):not([aria-pressed="true"]):not([aria-checked="true"]):not([aria-current="page"]):not([data-current="true"])) { background: var(--color-subtle); color: var(--color-ink); }
|
|
16224
|
-
:where(.router-chip, .router-filter-chip, .router-button, .router-model-button, .router-pager-button, .router-segment-button, .router-export, .router-input, .router-select-item, .router-interactive, .router-conflict-action, .router-footer-button, .router-select-trigger, .router-settings-action, .router-subset-button, .router-switch):focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
|
|
16225
|
-
`;
|
|
16226
|
-
var injectRouterSheet = (doc, key5, css2) => {
|
|
16227
|
-
if (doc.head === null) return null;
|
|
16228
|
-
const existing = doc.head.querySelector('style[data-router-sheet="' + key5 + '"]');
|
|
16229
|
-
if (existing !== null) return existing;
|
|
16230
|
-
const style = doc.createElement("style");
|
|
16231
|
-
style.setAttribute("data-router-sheet", key5);
|
|
16232
|
-
style.textContent = css2;
|
|
16233
|
-
doc.head.appendChild(style);
|
|
16234
|
-
return style;
|
|
16235
|
-
};
|
|
16236
|
-
var injectRouterRecipes = (doc) => injectRouterSheet(doc, "recipes", RouterRecipesCss);
|
|
16237
|
-
if (typeof document !== "undefined" && document.head !== null) {
|
|
16238
|
-
injectRouterSheet(document, "tokens", RouterTokensCss);
|
|
16239
|
-
}
|
|
16240
|
-
|
|
16241
16086
|
// vendor/effect/dist/Pipeable.js
|
|
16242
16087
|
var pipeArguments = (self, args2) => {
|
|
16243
16088
|
switch (args2.length) {
|
|
@@ -20932,8 +20777,8 @@ var forEachSequential = (iterable, f, options) => suspend(() => {
|
|
|
20932
20777
|
var resolveConcurrency = (concurrency) => concurrency === "unbounded" ? Number.POSITIVE_INFINITY : Math.max(1, concurrency ?? 1);
|
|
20933
20778
|
var iterateEager = () => (options) => {
|
|
20934
20779
|
const onItem = options.onItem;
|
|
20935
|
-
const
|
|
20936
|
-
const resumeSequential = (state3, items, index2, end4, effect2) => flatMap3(exit(effect2), (itemExit) =>
|
|
20780
|
+
const step4 = options.step;
|
|
20781
|
+
const resumeSequential = (state3, items, index2, end4, effect2) => flatMap3(exit(effect2), (itemExit) => step4(state3, items[index2], itemExit, index2) ?? runSequential(state3, items, index2 + 1, end4) ?? void_);
|
|
20937
20782
|
const runSequential = (state3, items, index2 = 0, end4 = items.length) => {
|
|
20938
20783
|
for (; index2 < end4; index2++) {
|
|
20939
20784
|
const item = items[index2];
|
|
@@ -20941,7 +20786,7 @@ var iterateEager = () => (options) => {
|
|
|
20941
20786
|
if (!effectIsExit(effect2)) {
|
|
20942
20787
|
return resumeSequential(state3, items, index2, end4, effect2);
|
|
20943
20788
|
}
|
|
20944
|
-
const terminal =
|
|
20789
|
+
const terminal = step4(state3, item, effect2, index2);
|
|
20945
20790
|
if (terminal) return terminal._tag === "Failure" ? terminal : void 0;
|
|
20946
20791
|
}
|
|
20947
20792
|
};
|
|
@@ -20949,7 +20794,7 @@ var iterateEager = () => (options) => {
|
|
|
20949
20794
|
};
|
|
20950
20795
|
var iterateConcurrentImpl = (options) => {
|
|
20951
20796
|
const onItem = options.onItem;
|
|
20952
|
-
const
|
|
20797
|
+
const step4 = options.step;
|
|
20953
20798
|
return (state3, items, opts) => {
|
|
20954
20799
|
let index2 = 0;
|
|
20955
20800
|
const end4 = opts.end ?? items.length;
|
|
@@ -20972,7 +20817,7 @@ var iterateConcurrentImpl = (options) => {
|
|
|
20972
20817
|
const item = items[index2];
|
|
20973
20818
|
const eff = effect2 ?? onItem(state3, item, index2);
|
|
20974
20819
|
if (effectIsExit(eff)) {
|
|
20975
|
-
terminal =
|
|
20820
|
+
terminal = step4(state3, item, eff, index2);
|
|
20976
20821
|
if (terminal) break;
|
|
20977
20822
|
} else if (!parentFiber) {
|
|
20978
20823
|
return callback((cb) => {
|
|
@@ -20996,7 +20841,7 @@ var iterateConcurrentImpl = (options) => {
|
|
|
20996
20841
|
effect2 = void 0;
|
|
20997
20842
|
const fiber3 = forkUnsafe(parentFiber, eff, true, true, "inherit");
|
|
20998
20843
|
if (fiber3._exit) {
|
|
20999
|
-
terminal =
|
|
20844
|
+
terminal = step4(state3, item, fiber3._exit, index2);
|
|
21000
20845
|
if (terminal) break;
|
|
21001
20846
|
continue;
|
|
21002
20847
|
}
|
|
@@ -21014,7 +20859,7 @@ var iterateConcurrentImpl = (options) => {
|
|
|
21014
20859
|
}
|
|
21015
20860
|
}
|
|
21016
20861
|
} else {
|
|
21017
|
-
const result3 =
|
|
20862
|
+
const result3 = step4(state3, item, exit3, currentIndex);
|
|
21018
20863
|
if (result3) {
|
|
21019
20864
|
terminal = result3;
|
|
21020
20865
|
go();
|
|
@@ -23006,9 +22851,9 @@ var ScheduleProto = {
|
|
|
23006
22851
|
}
|
|
23007
22852
|
};
|
|
23008
22853
|
var isSchedule = (u) => hasProperty(u, TypeId8);
|
|
23009
|
-
var fromStep = (
|
|
22854
|
+
var fromStep = (step4) => {
|
|
23010
22855
|
const self = Object.create(ScheduleProto);
|
|
23011
|
-
self.step =
|
|
22856
|
+
self.step = step4;
|
|
23012
22857
|
return self;
|
|
23013
22858
|
};
|
|
23014
22859
|
var metadataFn = () => {
|
|
@@ -23030,16 +22875,16 @@ var metadataFn = () => {
|
|
|
23030
22875
|
};
|
|
23031
22876
|
};
|
|
23032
22877
|
};
|
|
23033
|
-
var fromStepWithMetadata = (
|
|
22878
|
+
var fromStepWithMetadata = (step4) => fromStep(map5(step4, (f) => {
|
|
23034
22879
|
const meta = metadataFn();
|
|
23035
22880
|
return (now4, input2) => f(meta(now4, input2));
|
|
23036
22881
|
}));
|
|
23037
22882
|
var toStep = (schedule4) => catchCause(schedule4.step, (cause2) => succeed3(() => failCause(cause2)));
|
|
23038
|
-
var toStepWithMetadata = (schedule4) => clockWith((clock3) => map5(toStep(schedule4), (
|
|
22883
|
+
var toStepWithMetadata = (schedule4) => clockWith((clock3) => map5(toStep(schedule4), (step4) => {
|
|
23039
22884
|
const metaFn = metadataFn();
|
|
23040
22885
|
return (input2) => suspend(() => {
|
|
23041
22886
|
const now4 = clock3.currentTimeMillisUnsafe();
|
|
23042
|
-
return flatMap3(
|
|
22887
|
+
return flatMap3(step4(now4, input2), ([output, duration2]) => {
|
|
23043
22888
|
const meta = metaFn(now4, input2);
|
|
23044
22889
|
meta.output = output;
|
|
23045
22890
|
meta.duration = duration2;
|
|
@@ -23047,7 +22892,7 @@ var toStepWithMetadata = (schedule4) => clockWith((clock3) => map5(toStep(schedu
|
|
|
23047
22892
|
});
|
|
23048
22893
|
});
|
|
23049
22894
|
}));
|
|
23050
|
-
var min3 = (schedules) => fromStep(map5(all(schedules.map(toStep)), (steps) => (now4, input2) => flatMap3(forEach(steps, (
|
|
22895
|
+
var min3 = (schedules) => fromStep(map5(all(schedules.map(toStep)), (steps) => (now4, input2) => flatMap3(forEach(steps, (step4) => matchEffect2(step4(now4, input2), {
|
|
23051
22896
|
onSuccess: (result3) => succeed3(result3[1]),
|
|
23052
22897
|
onDone: () => undefined_,
|
|
23053
22898
|
onFailure: failCause
|
|
@@ -23075,7 +22920,7 @@ var exponential = (base2, factor = 2) => {
|
|
|
23075
22920
|
return succeed3([duration2, duration2]);
|
|
23076
22921
|
}));
|
|
23077
22922
|
};
|
|
23078
|
-
var passthrough = (self) => fromStep(map5(toStep(self), (
|
|
22923
|
+
var passthrough = (self) => fromStep(map5(toStep(self), (step4) => (now4, input2) => matchEffect2(step4(now4, input2), {
|
|
23079
22924
|
onSuccess: (result3) => succeed3([input2, result3[1]]),
|
|
23080
22925
|
onFailure: failCause,
|
|
23081
22926
|
onDone: () => done2(input2)
|
|
@@ -23087,9 +22932,9 @@ var spaced = (duration2) => {
|
|
|
23087
22932
|
const decoded = fromInputUnsafe(duration2);
|
|
23088
22933
|
return fromStepWithMetadata(succeed3((meta) => succeed3([meta.attempt - 1, decoded])));
|
|
23089
22934
|
};
|
|
23090
|
-
var while_ = /* @__PURE__ */ dual(2, (self, predicate) => fromStep(map5(toStep(self), (
|
|
22935
|
+
var while_ = /* @__PURE__ */ dual(2, (self, predicate) => fromStep(map5(toStep(self), (step4) => {
|
|
23091
22936
|
const meta = metadataFn();
|
|
23092
|
-
return (now4, input2) => flatMap3(
|
|
22937
|
+
return (now4, input2) => flatMap3(step4(now4, input2), (result3) => {
|
|
23093
22938
|
const [output, duration2] = result3;
|
|
23094
22939
|
const eff = predicate({
|
|
23095
22940
|
...meta(now4, input2),
|
|
@@ -23107,11 +22952,11 @@ var Proto3 = {
|
|
|
23107
22952
|
[TypeId9]: TypeId9,
|
|
23108
22953
|
get captureRequirements() {
|
|
23109
22954
|
const self = this;
|
|
23110
|
-
return contextWith((context4) => succeed3(makeProto(self.steps.map((
|
|
23111
|
-
...
|
|
23112
|
-
while:
|
|
23113
|
-
schedule:
|
|
23114
|
-
provide: isLayer(
|
|
22955
|
+
return contextWith((context4) => succeed3(makeProto(self.steps.map((step4) => ({
|
|
22956
|
+
...step4,
|
|
22957
|
+
while: step4.while ? (input2) => provideContext(step4.while(input2), context4) : void 0,
|
|
22958
|
+
schedule: step4.schedule ? fromStep(provideContext(map5(toStep(step4.schedule), (next3) => (now4, input2) => provideContext(next3(now4, input2), context4)), context4)) : void 0,
|
|
22959
|
+
provide: isLayer(step4.provide) ? provide2(step4.provide, succeedContext(context4)) : step4.provide
|
|
23115
22960
|
})))));
|
|
23116
22961
|
},
|
|
23117
22962
|
pipe() {
|
|
@@ -23135,9 +22980,9 @@ var provideLayer = (self, layer4, options) => scopedWith((scope3) => flatMap3(op
|
|
|
23135
22980
|
var provide3 = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, source, options) => isContext(source) ? provideContext(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll2(...source) : source, options));
|
|
23136
22981
|
|
|
23137
22982
|
// vendor/effect/dist/internal/schedule.js
|
|
23138
|
-
var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule4, orElse) => flatMap3(toStepWithMetadata(schedule4), (
|
|
22983
|
+
var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule4, orElse) => flatMap3(toStepWithMetadata(schedule4), (step4) => {
|
|
23139
22984
|
let meta = CurrentMetadata.defaultValue();
|
|
23140
|
-
const loop = (input2) => matchEffect2(
|
|
22985
|
+
const loop = (input2) => matchEffect2(step4(input2), {
|
|
23141
22986
|
onSuccess(meta_) {
|
|
23142
22987
|
meta = meta_;
|
|
23143
22988
|
return flatMap3(provideService(self, CurrentMetadata, meta), loop);
|
|
@@ -23147,12 +22992,12 @@ var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule4, orElse) => flatMap3
|
|
|
23147
22992
|
});
|
|
23148
22993
|
return catchCauseFilter(flatMap3(provideService(self, CurrentMetadata, meta), loop), findRecoverableError, (error) => orElse(error, meta.attempt === 0 ? none5() : some2(meta)));
|
|
23149
22994
|
}));
|
|
23150
|
-
var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse) => flatMap3(toStepWithMetadata(policy), (
|
|
22995
|
+
var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse) => flatMap3(toStepWithMetadata(policy), (step4) => {
|
|
23151
22996
|
let meta = CurrentMetadata.defaultValue();
|
|
23152
22997
|
let lastError;
|
|
23153
22998
|
const loop = catchCauseFilter(suspend(() => provideService(self, CurrentMetadata, meta)), findRecoverableError, (error) => {
|
|
23154
22999
|
lastError = error;
|
|
23155
|
-
return flatMap3(
|
|
23000
|
+
return flatMap3(step4(error), (meta_) => {
|
|
23156
23001
|
meta = meta_;
|
|
23157
23002
|
return loop;
|
|
23158
23003
|
});
|
|
@@ -23167,8 +23012,8 @@ var retry = /* @__PURE__ */ dual(2, (self, options) => {
|
|
|
23167
23012
|
const schedule4 = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
|
|
23168
23013
|
return retryOrElse(self, schedule4, fail3);
|
|
23169
23014
|
});
|
|
23170
|
-
var scheduleFrom = /* @__PURE__ */ dual(3, (self, initial3, schedule4) => flatMap3(toStepWithMetadata(schedule4), (
|
|
23171
|
-
const loop = (input2) => matchEffect2(
|
|
23015
|
+
var scheduleFrom = /* @__PURE__ */ dual(3, (self, initial3, schedule4) => flatMap3(toStepWithMetadata(schedule4), (step4) => {
|
|
23016
|
+
const loop = (input2) => matchEffect2(step4(input2), {
|
|
23172
23017
|
onSuccess: (meta) => flatMap3(provideService(self, CurrentMetadata, meta), loop),
|
|
23173
23018
|
onFailure: failCause,
|
|
23174
23019
|
onDone: succeed3
|
|
@@ -23266,8 +23111,8 @@ var withExecutionPlan = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (sel
|
|
|
23266
23111
|
return flatMap3(whileLoop({
|
|
23267
23112
|
while: () => i < plan.steps.length && (result3 === void 0 || isFailure2(result3)),
|
|
23268
23113
|
body() {
|
|
23269
|
-
const
|
|
23270
|
-
let nextEffect = provideMeta(instrument(provide3(self,
|
|
23114
|
+
const step4 = plan.steps[i];
|
|
23115
|
+
let nextEffect = provideMeta(instrument(provide3(self, step4.provide)));
|
|
23271
23116
|
if (result3) {
|
|
23272
23117
|
let attempted = false;
|
|
23273
23118
|
const wrapped = nextEffect;
|
|
@@ -23276,9 +23121,9 @@ var withExecutionPlan = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (sel
|
|
|
23276
23121
|
attempted = true;
|
|
23277
23122
|
return fromResult(result3);
|
|
23278
23123
|
});
|
|
23279
|
-
nextEffect = retry(nextEffect, scheduleFromStep(
|
|
23124
|
+
nextEffect = retry(nextEffect, scheduleFromStep(step4, false));
|
|
23280
23125
|
} else {
|
|
23281
|
-
const schedule4 = scheduleFromStep(
|
|
23126
|
+
const schedule4 = scheduleFromStep(step4, true);
|
|
23282
23127
|
nextEffect = schedule4 ? retry(nextEffect, schedule4) : nextEffect;
|
|
23283
23128
|
}
|
|
23284
23129
|
return result(nextEffect);
|
|
@@ -23289,20 +23134,20 @@ var withExecutionPlan = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (sel
|
|
|
23289
23134
|
}
|
|
23290
23135
|
}), () => fromResult(result3));
|
|
23291
23136
|
}));
|
|
23292
|
-
var scheduleFromStep = (
|
|
23137
|
+
var scheduleFromStep = (step4, first2) => {
|
|
23293
23138
|
if (!first2) {
|
|
23294
23139
|
return buildFromOptions({
|
|
23295
|
-
schedule:
|
|
23296
|
-
times:
|
|
23297
|
-
while:
|
|
23140
|
+
schedule: step4.schedule ? step4.schedule : step4.attempts ? void 0 : scheduleOnce,
|
|
23141
|
+
times: step4.attempts,
|
|
23142
|
+
while: step4.while
|
|
23298
23143
|
});
|
|
23299
|
-
} else if (
|
|
23144
|
+
} else if (step4.attempts === 1 || !(step4.schedule || step4.attempts)) {
|
|
23300
23145
|
return void 0;
|
|
23301
23146
|
}
|
|
23302
23147
|
return buildFromOptions({
|
|
23303
|
-
schedule:
|
|
23304
|
-
while:
|
|
23305
|
-
times:
|
|
23148
|
+
schedule: step4.schedule,
|
|
23149
|
+
while: step4.while,
|
|
23150
|
+
times: step4.attempts ? step4.attempts - 1 : void 0
|
|
23306
23151
|
});
|
|
23307
23152
|
};
|
|
23308
23153
|
var scheduleOnce = /* @__PURE__ */ recurs(1);
|
|
@@ -33498,10 +33343,10 @@ function toCodecJson(schema) {
|
|
|
33498
33343
|
});
|
|
33499
33344
|
}
|
|
33500
33345
|
var toCodecJsonAST = /* @__PURE__ */ makeCodecDerivation(toCodecJsonASTStep);
|
|
33501
|
-
function makeCodecDerivation(
|
|
33346
|
+
function makeCodecDerivation(step4, options) {
|
|
33502
33347
|
const deriveBody = memoize((owner2) => {
|
|
33503
33348
|
const body = replaceContext(owner2, void 0);
|
|
33504
|
-
const out =
|
|
33349
|
+
const out = step4(body, recur3);
|
|
33505
33350
|
return out === body ? null : out;
|
|
33506
33351
|
});
|
|
33507
33352
|
const recur3 = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
|
|
@@ -35890,7 +35735,7 @@ var PrismImpl = class extends OptionalImpl {
|
|
|
35890
35735
|
function make20(node) {
|
|
35891
35736
|
let op = node[0] ?? identityOperation;
|
|
35892
35737
|
if (node.length > 1) {
|
|
35893
|
-
const kind = node.reduce((kind2,
|
|
35738
|
+
const kind = node.reduce((kind2, step4) => composeKind(kind2, step4.kind), "Iso");
|
|
35894
35739
|
op = {
|
|
35895
35740
|
kind,
|
|
35896
35741
|
get: compileGet(node, kind),
|
|
@@ -42207,302 +42052,1134 @@ var runForEach2 = /* @__PURE__ */ dual(2, (self, f) => runForEach(self.channel,
|
|
|
42207
42052
|
});
|
|
42208
42053
|
}));
|
|
42209
42054
|
|
|
42210
|
-
//
|
|
42211
|
-
var
|
|
42212
|
-
var
|
|
42213
|
-
var
|
|
42214
|
-
|
|
42215
|
-
|
|
42216
|
-
|
|
42055
|
+
// packages/domain/src/routing.ts
|
|
42056
|
+
var gates = ["residency", "headroom", "floor", "fallback"];
|
|
42057
|
+
var GateSchema = Schema_exports.Literals(gates);
|
|
42058
|
+
var routeTargets = ["local", "remote"];
|
|
42059
|
+
var RouteTargetSchema = Schema_exports.Literals(routeTargets);
|
|
42060
|
+
var PressureLevelSchema = Schema_exports.Literals(["ok", "soft", "hard"]);
|
|
42061
|
+
var DecisionSchema = Schema_exports.Struct({
|
|
42062
|
+
target: RouteTargetSchema,
|
|
42063
|
+
provider: Schema_exports.NullOr(Schema_exports.String),
|
|
42064
|
+
model: Schema_exports.NullOr(Schema_exports.String),
|
|
42065
|
+
gate: GateSchema,
|
|
42066
|
+
reason: Schema_exports.String,
|
|
42067
|
+
policyRev: Schema_exports.Number,
|
|
42068
|
+
floorTps: Schema_exports.Number,
|
|
42069
|
+
observedTps: Schema_exports.NullOr(Schema_exports.Number)
|
|
42217
42070
|
});
|
|
42218
|
-
var
|
|
42219
|
-
|
|
42220
|
-
|
|
42221
|
-
|
|
42222
|
-
|
|
42223
|
-
|
|
42224
|
-
|
|
42225
|
-
|
|
42226
|
-
|
|
42227
|
-
|
|
42228
|
-
|
|
42229
|
-
|
|
42230
|
-
|
|
42231
|
-
|
|
42232
|
-
|
|
42233
|
-
|
|
42234
|
-
|
|
42235
|
-
|
|
42236
|
-
|
|
42237
|
-
|
|
42238
|
-
|
|
42239
|
-
return out;
|
|
42240
|
-
}).pipe(catch_3((error) => {
|
|
42241
|
-
if (needsFlush && error.reason._tag === "SocketCloseError" && error.reason.code === 1e3) {
|
|
42242
|
-
needsFlush = false;
|
|
42243
|
-
const last = decoder4.decode();
|
|
42244
|
-
if (last.length > 0) return succeed6([last]);
|
|
42245
|
-
}
|
|
42246
|
-
return fail6(error);
|
|
42247
|
-
}));
|
|
42071
|
+
var decodeDecision = Schema_exports.decodeUnknownSync(DecisionSchema);
|
|
42072
|
+
|
|
42073
|
+
// packages/domain/src/ledger.ts
|
|
42074
|
+
var LedgerDecisionSchema = Schema_exports.Literals(["local", "remote"]);
|
|
42075
|
+
var LedgerGateLoadSchema = Schema_exports.Union([GateSchema, Schema_exports.Literal("scope")]);
|
|
42076
|
+
var LedgerScopeSchema = Schema_exports.Literals([
|
|
42077
|
+
"localAndRemote",
|
|
42078
|
+
"localOnly",
|
|
42079
|
+
"remoteOnly"
|
|
42080
|
+
]);
|
|
42081
|
+
var LedgerSurfaceSchema = Schema_exports.Literals([
|
|
42082
|
+
"pre-step",
|
|
42083
|
+
"router_route",
|
|
42084
|
+
"agent/status",
|
|
42085
|
+
"agent/inbox/claimed",
|
|
42086
|
+
"turn/start"
|
|
42087
|
+
]);
|
|
42088
|
+
var LedgerRoleSchema = Schema_exports.Literals(["l1", "l2", "l3", "advisor", "unknown"]);
|
|
42089
|
+
var LedgerSkipSchema = Schema_exports.Struct({
|
|
42090
|
+
model: Schema_exports.String,
|
|
42091
|
+
reason: Schema_exports.String
|
|
42248
42092
|
});
|
|
42249
|
-
var
|
|
42250
|
-
|
|
42251
|
-
|
|
42252
|
-
|
|
42253
|
-
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42258
|
-
|
|
42259
|
-
|
|
42260
|
-
|
|
42261
|
-
|
|
42262
|
-
|
|
42263
|
-
|
|
42264
|
-
|
|
42265
|
-
|
|
42266
|
-
|
|
42267
|
-
|
|
42268
|
-
|
|
42269
|
-
|
|
42270
|
-
|
|
42271
|
-
|
|
42272
|
-
|
|
42273
|
-
|
|
42274
|
-
|
|
42275
|
-
|
|
42276
|
-
|
|
42277
|
-
var
|
|
42278
|
-
|
|
42279
|
-
|
|
42280
|
-
|
|
42281
|
-
|
|
42282
|
-
|
|
42283
|
-
|
|
42284
|
-
|
|
42285
|
-
|
|
42286
|
-
|
|
42287
|
-
|
|
42288
|
-
|
|
42289
|
-
|
|
42290
|
-
|
|
42291
|
-
|
|
42292
|
-
|
|
42293
|
-
|
|
42294
|
-
|
|
42295
|
-
|
|
42296
|
-
|
|
42297
|
-
|
|
42298
|
-
|
|
42299
|
-
|
|
42300
|
-
|
|
42093
|
+
var LedgerRowSchema = Schema_exports.Struct({
|
|
42094
|
+
id: Schema_exports.String,
|
|
42095
|
+
requestId: Schema_exports.String,
|
|
42096
|
+
omlxRequestId: Schema_exports.NullOr(Schema_exports.String),
|
|
42097
|
+
agentId: Schema_exports.NullOr(Schema_exports.String),
|
|
42098
|
+
decision: LedgerDecisionSchema,
|
|
42099
|
+
model: Schema_exports.String,
|
|
42100
|
+
reason: Schema_exports.String,
|
|
42101
|
+
contextTokens: Schema_exports.Number,
|
|
42102
|
+
floorTps: Schema_exports.Number,
|
|
42103
|
+
latencyMs: Schema_exports.Number,
|
|
42104
|
+
at: Schema_exports.String,
|
|
42105
|
+
gate: Schema_exports.optional(LedgerGateLoadSchema),
|
|
42106
|
+
scope: Schema_exports.optional(LedgerScopeSchema),
|
|
42107
|
+
policyRev: Schema_exports.optional(Schema_exports.Number),
|
|
42108
|
+
role: Schema_exports.optional(LedgerRoleSchema),
|
|
42109
|
+
roleReason: Schema_exports.optional(Schema_exports.String),
|
|
42110
|
+
skips: Schema_exports.optional(Schema_exports.Array(LedgerSkipSchema)),
|
|
42111
|
+
turn: Schema_exports.optional(Schema_exports.Number),
|
|
42112
|
+
step: Schema_exports.optional(Schema_exports.Number),
|
|
42113
|
+
applied: Schema_exports.optional(Schema_exports.Boolean),
|
|
42114
|
+
surface: Schema_exports.optional(LedgerSurfaceSchema),
|
|
42115
|
+
limitation: Schema_exports.optional(Schema_exports.String),
|
|
42116
|
+
notAppliedReason: Schema_exports.optional(Schema_exports.String),
|
|
42117
|
+
appliedBy: Schema_exports.optional(Schema_exports.String),
|
|
42118
|
+
provider: Schema_exports.optional(Schema_exports.String),
|
|
42119
|
+
selectedModel: Schema_exports.optional(Schema_exports.String)
|
|
42120
|
+
});
|
|
42121
|
+
var decodeLedgerRow = Schema_exports.decodeUnknownSync(LedgerRowSchema);
|
|
42122
|
+
|
|
42123
|
+
// packages/domain/src/policy.ts
|
|
42124
|
+
var validFloor = (floorTps) => Number.isFinite(floorTps) && Number.isInteger(floorTps) && floorTps >= 0 && floorTps <= 100;
|
|
42125
|
+
var MainModelSchema = Schema_exports.Struct({
|
|
42126
|
+
provider: Schema_exports.String,
|
|
42127
|
+
model: Schema_exports.String,
|
|
42128
|
+
label: Schema_exports.String
|
|
42129
|
+
});
|
|
42130
|
+
var PolicySchema = Schema_exports.Struct({
|
|
42131
|
+
floorTps: Schema_exports.Number,
|
|
42132
|
+
mainModel: Schema_exports.NullOr(MainModelSchema),
|
|
42133
|
+
advisoryModel: Schema_exports.NullOr(Schema_exports.String),
|
|
42134
|
+
rev: Schema_exports.Number
|
|
42135
|
+
});
|
|
42136
|
+
|
|
42137
|
+
// packages/domain/src/evidence.ts
|
|
42138
|
+
var tpsSources = ["live", "historical"];
|
|
42139
|
+
var TpsSourceSchema = Schema_exports.Literals(tpsSources);
|
|
42140
|
+
var EvidenceStatsSchema = Schema_exports.Struct({
|
|
42141
|
+
avgGenerationTps: Schema_exports.Number,
|
|
42142
|
+
avgPrefillTps: Schema_exports.Number,
|
|
42143
|
+
totalRequests: Schema_exports.Number,
|
|
42144
|
+
totalCachedTokens: Schema_exports.Number,
|
|
42145
|
+
cacheEfficiency: Schema_exports.Number,
|
|
42146
|
+
uptimeSeconds: Schema_exports.Number
|
|
42147
|
+
});
|
|
42148
|
+
var EvidenceActivitySchema = Schema_exports.Struct({
|
|
42149
|
+
activeRequests: Schema_exports.Number,
|
|
42150
|
+
waitingRequests: Schema_exports.Number,
|
|
42151
|
+
memoryUsedBytes: Schema_exports.Number,
|
|
42152
|
+
memoryMaxBytes: Schema_exports.Number,
|
|
42153
|
+
// F-37-48: the engine's soft memory limit (the guard), null when unreported.
|
|
42154
|
+
memorySoftBytes: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
42155
|
+
});
|
|
42156
|
+
var EvidenceDeviceSchema = Schema_exports.Struct({
|
|
42157
|
+
chipName: Schema_exports.String,
|
|
42158
|
+
memoryGb: Schema_exports.Number,
|
|
42159
|
+
gpuCores: Schema_exports.Number
|
|
42160
|
+
});
|
|
42161
|
+
var EvidenceModelSchema = Schema_exports.Struct({
|
|
42162
|
+
id: Schema_exports.String,
|
|
42163
|
+
preferred: Schema_exports.Boolean,
|
|
42164
|
+
pinned: Schema_exports.Boolean,
|
|
42165
|
+
contextLength: Schema_exports.NullOr(Schema_exports.Number),
|
|
42166
|
+
sizeBytes: Schema_exports.NullOr(Schema_exports.Number),
|
|
42167
|
+
tps: Schema_exports.NullOr(Schema_exports.Number)
|
|
42168
|
+
});
|
|
42169
|
+
var EvidenceTelemetrySchema = Schema_exports.Struct({
|
|
42170
|
+
fetchedAt: Schema_exports.String,
|
|
42171
|
+
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
42172
|
+
observedTpsSource: Schema_exports.NullOr(TpsSourceSchema),
|
|
42173
|
+
headroomRatio: Schema_exports.Number,
|
|
42174
|
+
engineMax: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
42175
|
+
pressureLevel: PressureLevelSchema,
|
|
42176
|
+
residentModels: Schema_exports.Array(Schema_exports.String),
|
|
42177
|
+
models: Schema_exports.Array(EvidenceModelSchema),
|
|
42178
|
+
preferredModel: Schema_exports.NullOr(Schema_exports.String),
|
|
42179
|
+
stats: EvidenceStatsSchema,
|
|
42180
|
+
activity: EvidenceActivitySchema,
|
|
42181
|
+
device: EvidenceDeviceSchema
|
|
42182
|
+
});
|
|
42183
|
+
var telemetryErrorKinds = [
|
|
42184
|
+
"http",
|
|
42185
|
+
"network",
|
|
42186
|
+
"timeout",
|
|
42187
|
+
"parse",
|
|
42188
|
+
"validation",
|
|
42189
|
+
"unknown"
|
|
42190
|
+
];
|
|
42191
|
+
var EvidenceTelemetryErrorSchema = Schema_exports.Struct({
|
|
42192
|
+
kind: Schema_exports.Literals(telemetryErrorKinds),
|
|
42193
|
+
message: Schema_exports.String,
|
|
42194
|
+
status: Schema_exports.NullOr(Schema_exports.Number),
|
|
42195
|
+
retryable: Schema_exports.Boolean
|
|
42196
|
+
});
|
|
42197
|
+
var EvidenceTelemetryStateSchema = Schema_exports.Struct({
|
|
42198
|
+
snapshot: Schema_exports.NullOr(EvidenceTelemetrySchema),
|
|
42199
|
+
error: Schema_exports.NullOr(EvidenceTelemetryErrorSchema),
|
|
42200
|
+
readAt: Schema_exports.NullOr(Schema_exports.String)
|
|
42201
|
+
});
|
|
42202
|
+
var EvidenceSchema = Schema_exports.Struct({
|
|
42203
|
+
fetchedAt: Schema_exports.String,
|
|
42204
|
+
staleAt: Schema_exports.NullOr(Schema_exports.String),
|
|
42205
|
+
policy: PolicySchema,
|
|
42206
|
+
ledger: Schema_exports.Struct({
|
|
42207
|
+
rows: Schema_exports.Array(LedgerRowSchema)
|
|
42208
|
+
}),
|
|
42209
|
+
telemetry: EvidenceTelemetryStateSchema
|
|
42210
|
+
});
|
|
42211
|
+
var BackendSchema = Schema_exports.Struct({
|
|
42212
|
+
kind: Schema_exports.String
|
|
42213
|
+
});
|
|
42214
|
+
var TelemetryStateNameSchema = Schema_exports.Literals([
|
|
42215
|
+
"ok",
|
|
42216
|
+
"stale",
|
|
42217
|
+
"empty",
|
|
42218
|
+
"error"
|
|
42219
|
+
]);
|
|
42220
|
+
var ModelsStatusSchema = Schema_exports.Literals([
|
|
42221
|
+
"ready",
|
|
42222
|
+
"degraded",
|
|
42223
|
+
"stale",
|
|
42224
|
+
"empty",
|
|
42225
|
+
"error"
|
|
42226
|
+
]);
|
|
42227
|
+
var ModelsKpisSchema = Schema_exports.Struct({
|
|
42228
|
+
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
42229
|
+
observedTpsSource: Schema_exports.NullOr(TpsSourceSchema),
|
|
42230
|
+
headroomRatio: Schema_exports.Number,
|
|
42231
|
+
engineMax: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
42232
|
+
pressureLevel: PressureLevelSchema,
|
|
42233
|
+
activeRequests: Schema_exports.Number,
|
|
42234
|
+
waitingRequests: Schema_exports.Number,
|
|
42235
|
+
totalRequests: Schema_exports.Number,
|
|
42236
|
+
cacheEfficiency: Schema_exports.Number,
|
|
42237
|
+
uptimeSeconds: Schema_exports.Number,
|
|
42238
|
+
memoryUsedBytes: Schema_exports.Number,
|
|
42239
|
+
memoryMaxBytes: Schema_exports.Number,
|
|
42240
|
+
// F-37-48: the engine's soft memory limit (the guard) for the Models header.
|
|
42241
|
+
memorySoftBytes: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
42242
|
+
});
|
|
42243
|
+
var ModelCapabilityFields = {
|
|
42244
|
+
contextWindow: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
42245
|
+
inputModalities: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Array(Schema_exports.String)))
|
|
42301
42246
|
};
|
|
42302
|
-
var
|
|
42303
|
-
|
|
42304
|
-
|
|
42305
|
-
|
|
42306
|
-
|
|
42247
|
+
var ModelsResidentSchema = Schema_exports.Struct({
|
|
42248
|
+
id: Schema_exports.String,
|
|
42249
|
+
preferred: Schema_exports.Boolean,
|
|
42250
|
+
selected: Schema_exports.Boolean,
|
|
42251
|
+
// F-37-48: the role ids whose settings chain routes to this model, so the page
|
|
42252
|
+
// can label it by what it actually serves (l1 | l2 | l3 | advisor).
|
|
42253
|
+
roles: Schema_exports.optional(Schema_exports.Array(Schema_exports.String)),
|
|
42254
|
+
// F-37-48: the fresh probe/measured reading for this model (null when none).
|
|
42255
|
+
tps: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
42256
|
+
...ModelCapabilityFields
|
|
42257
|
+
});
|
|
42258
|
+
var RemoteModelSchema = Schema_exports.Struct({
|
|
42259
|
+
provider: Schema_exports.String,
|
|
42260
|
+
model: Schema_exports.String,
|
|
42261
|
+
role: Schema_exports.Literals(["main", "advisory"]),
|
|
42262
|
+
roles: Schema_exports.optional(Schema_exports.Array(Schema_exports.String)),
|
|
42263
|
+
label: Schema_exports.optional(Schema_exports.String)
|
|
42264
|
+
});
|
|
42265
|
+
var ModelsViewSchema = Schema_exports.Struct({
|
|
42266
|
+
status: ModelsStatusSchema,
|
|
42267
|
+
selectedModel: Schema_exports.String,
|
|
42268
|
+
preferredModel: Schema_exports.NullOr(Schema_exports.String),
|
|
42269
|
+
residents: Schema_exports.Array(ModelsResidentSchema),
|
|
42270
|
+
remoteModels: Schema_exports.Array(RemoteModelSchema),
|
|
42271
|
+
pool: Schema_exports.optional(Schema_exports.Struct({ models: Schema_exports.Number, residents: Schema_exports.Number, remote: Schema_exports.Number })),
|
|
42272
|
+
models: Schema_exports.optional(
|
|
42273
|
+
Schema_exports.Array(
|
|
42274
|
+
Schema_exports.Struct({
|
|
42275
|
+
id: Schema_exports.String,
|
|
42276
|
+
local: Schema_exports.Boolean,
|
|
42277
|
+
preferred: Schema_exports.Boolean,
|
|
42278
|
+
selected: Schema_exports.Boolean,
|
|
42279
|
+
...ModelCapabilityFields
|
|
42280
|
+
})
|
|
42281
|
+
)
|
|
42282
|
+
),
|
|
42283
|
+
selected: Schema_exports.optional(Schema_exports.String),
|
|
42284
|
+
pressure: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Literals(["ok", "soft", "hard"]))),
|
|
42285
|
+
staleAt: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)),
|
|
42286
|
+
capabilities: Schema_exports.optional(Schema_exports.Unknown),
|
|
42287
|
+
kpis: Schema_exports.NullOr(ModelsKpisSchema)
|
|
42288
|
+
});
|
|
42289
|
+
var DecisionTpsSourceSchema = Schema_exports.Literals(["measured", "probe", "unknown"]);
|
|
42290
|
+
var CurrentDecisionSchema = Schema_exports.Struct({
|
|
42291
|
+
id: Schema_exports.String,
|
|
42292
|
+
requestId: Schema_exports.String,
|
|
42293
|
+
decision: LedgerDecisionSchema,
|
|
42294
|
+
gate: Schema_exports.NullOr(LedgerGateLoadSchema),
|
|
42295
|
+
model: Schema_exports.String,
|
|
42296
|
+
reason: Schema_exports.String,
|
|
42297
|
+
at: Schema_exports.String,
|
|
42298
|
+
applied: Schema_exports.NullOr(Schema_exports.Boolean),
|
|
42299
|
+
role: Schema_exports.optional(LedgerRoleSchema),
|
|
42300
|
+
skips: Schema_exports.optional(Schema_exports.Array(LedgerSkipSchema)),
|
|
42301
|
+
notAppliedReason: Schema_exports.optional(Schema_exports.String),
|
|
42302
|
+
tpsSource: Schema_exports.optional(DecisionTpsSourceSchema),
|
|
42307
42303
|
/**
|
|
42308
|
-
*
|
|
42309
|
-
*
|
|
42310
|
-
* @stability unstable
|
|
42311
|
-
* @since 4.0.0
|
|
42304
|
+
* The session ceiling the decision was admitted under (R-36-10). Optional and
|
|
42305
|
+
* nullable so a payload recorded before the ceiling existed still decodes.
|
|
42312
42306
|
*/
|
|
42313
|
-
|
|
42314
|
-
|
|
42315
|
-
|
|
42316
|
-
|
|
42317
|
-
|
|
42318
|
-
|
|
42319
|
-
|
|
42320
|
-
|
|
42321
|
-
|
|
42322
|
-
|
|
42323
|
-
|
|
42324
|
-
|
|
42325
|
-
|
|
42326
|
-
|
|
42327
|
-
|
|
42328
|
-
|
|
42329
|
-
|
|
42330
|
-
|
|
42331
|
-
|
|
42332
|
-
|
|
42333
|
-
|
|
42334
|
-
|
|
42335
|
-
|
|
42336
|
-
|
|
42337
|
-
|
|
42338
|
-
|
|
42339
|
-
|
|
42340
|
-
|
|
42341
|
-
|
|
42342
|
-
|
|
42307
|
+
concurrencyCeiling: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
42308
|
+
});
|
|
42309
|
+
var SpeedStripSchema = Schema_exports.Struct({
|
|
42310
|
+
available: Schema_exports.Boolean,
|
|
42311
|
+
reason: Schema_exports.NullOr(Schema_exports.String),
|
|
42312
|
+
range: Schema_exports.Literals(["24h", "7d", "all"]),
|
|
42313
|
+
p50: Schema_exports.NullOr(Schema_exports.Number),
|
|
42314
|
+
floor: Schema_exports.Number,
|
|
42315
|
+
belowFloor: Schema_exports.NullOr(Schema_exports.Number),
|
|
42316
|
+
total: Schema_exports.Number
|
|
42317
|
+
});
|
|
42318
|
+
var RoutingViewSchema = Schema_exports.Struct({
|
|
42319
|
+
gates: Schema_exports.Array(GateSchema),
|
|
42320
|
+
policyRev: Schema_exports.Number,
|
|
42321
|
+
current: Schema_exports.NullOr(CurrentDecisionSchema),
|
|
42322
|
+
counts: Schema_exports.Struct({
|
|
42323
|
+
local: Schema_exports.Number,
|
|
42324
|
+
remote: Schema_exports.Number,
|
|
42325
|
+
total: Schema_exports.Number
|
|
42326
|
+
}),
|
|
42327
|
+
policy: Schema_exports.optional(
|
|
42328
|
+
Schema_exports.Struct({
|
|
42329
|
+
floorTps: Schema_exports.Number,
|
|
42330
|
+
mainModel: Schema_exports.String,
|
|
42331
|
+
rev: Schema_exports.Number
|
|
42332
|
+
})
|
|
42333
|
+
),
|
|
42334
|
+
/** R-40-05: the same strip the Engine page carries. */
|
|
42335
|
+
speedStrip: Schema_exports.optional(SpeedStripSchema),
|
|
42336
|
+
order: Schema_exports.optional(
|
|
42337
|
+
Schema_exports.Array(
|
|
42338
|
+
Schema_exports.Struct({ n: Schema_exports.Number, name: Schema_exports.String, description: Schema_exports.String, source: Schema_exports.String })
|
|
42339
|
+
)
|
|
42340
|
+
),
|
|
42341
|
+
escapes: Schema_exports.optional(Schema_exports.Array(Schema_exports.Struct({ gate: Schema_exports.String, count: Schema_exports.Number }))),
|
|
42342
|
+
ceiling: Schema_exports.optional(
|
|
42343
|
+
Schema_exports.NullOr(
|
|
42344
|
+
Schema_exports.Struct({
|
|
42345
|
+
model: Schema_exports.NullOr(Schema_exports.String),
|
|
42346
|
+
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
42347
|
+
active: Schema_exports.Number,
|
|
42348
|
+
waiting: Schema_exports.Number,
|
|
42349
|
+
slots: Schema_exports.optional(Schema_exports.Number),
|
|
42350
|
+
contextBucket: Schema_exports.optional(Schema_exports.String)
|
|
42351
|
+
})
|
|
42352
|
+
)
|
|
42353
|
+
),
|
|
42354
|
+
contextBuckets: Schema_exports.optional(Schema_exports.Array(Schema_exports.Struct({ label: Schema_exports.String, admitted: Schema_exports.Number }))),
|
|
42355
|
+
limits: Schema_exports.optional(
|
|
42356
|
+
Schema_exports.Struct({
|
|
42357
|
+
floorTps: Schema_exports.Number,
|
|
42358
|
+
engineMax: Schema_exports.NullOr(Schema_exports.Number),
|
|
42359
|
+
memoryMaxBytes: Schema_exports.NullOr(Schema_exports.Number)
|
|
42360
|
+
})
|
|
42361
|
+
),
|
|
42362
|
+
pinned: Schema_exports.optional(Schema_exports.Array(Schema_exports.String))
|
|
42363
|
+
});
|
|
42364
|
+
var ActivityViewSchema = Schema_exports.Struct({
|
|
42365
|
+
nextCursor: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)),
|
|
42366
|
+
rows: Schema_exports.optional(Schema_exports.Array(Schema_exports.Unknown)),
|
|
42367
|
+
joined: Schema_exports.optional(
|
|
42368
|
+
Schema_exports.Struct({ total: Schema_exports.Number, linked: Schema_exports.Number, missing: Schema_exports.Number })
|
|
42369
|
+
),
|
|
42370
|
+
kpis: Schema_exports.Struct({
|
|
42371
|
+
total: Schema_exports.Number,
|
|
42372
|
+
local: Schema_exports.Number,
|
|
42373
|
+
remote: Schema_exports.Number,
|
|
42374
|
+
applied: Schema_exports.Number,
|
|
42375
|
+
lastAt: Schema_exports.NullOr(Schema_exports.String)
|
|
42376
|
+
})
|
|
42377
|
+
});
|
|
42378
|
+
var ModelsPayloadSchema = Schema_exports.Struct({
|
|
42379
|
+
kind: Schema_exports.Literals(["models"]),
|
|
42380
|
+
backend: BackendSchema,
|
|
42381
|
+
evidence: EvidenceSchema,
|
|
42382
|
+
view: ModelsViewSchema
|
|
42383
|
+
});
|
|
42384
|
+
var RoutingPayloadSchema = Schema_exports.Struct({
|
|
42385
|
+
kind: Schema_exports.Literals(["routing"]),
|
|
42386
|
+
backend: BackendSchema,
|
|
42387
|
+
evidence: EvidenceSchema,
|
|
42388
|
+
view: RoutingViewSchema
|
|
42389
|
+
});
|
|
42390
|
+
var ActivityPayloadSchema = Schema_exports.Struct({
|
|
42391
|
+
kind: Schema_exports.Literals(["activity"]),
|
|
42392
|
+
backend: BackendSchema,
|
|
42393
|
+
evidence: EvidenceSchema,
|
|
42394
|
+
view: ActivityViewSchema
|
|
42395
|
+
});
|
|
42396
|
+
var EngineAdapterEntrySchema = Schema_exports.Struct({
|
|
42397
|
+
id: Schema_exports.String,
|
|
42398
|
+
label: Schema_exports.String,
|
|
42399
|
+
current: Schema_exports.Boolean,
|
|
42400
|
+
enabled: Schema_exports.Boolean
|
|
42401
|
+
});
|
|
42402
|
+
var EngineAdapterSchema = Schema_exports.Struct({
|
|
42403
|
+
kind: Schema_exports.String,
|
|
42404
|
+
label: Schema_exports.String,
|
|
42405
|
+
version: Schema_exports.String,
|
|
42406
|
+
adapters: Schema_exports.Array(EngineAdapterEntrySchema)
|
|
42407
|
+
});
|
|
42408
|
+
var EngineConnectionSchema = Schema_exports.Struct({
|
|
42409
|
+
endpoint: Schema_exports.String,
|
|
42410
|
+
authKind: Schema_exports.Literals(["bearer", "none"]),
|
|
42411
|
+
keyPresent: Schema_exports.Boolean,
|
|
42412
|
+
keyHint: Schema_exports.String,
|
|
42413
|
+
source: Schema_exports.Literals(["config", "environment", "default"])
|
|
42414
|
+
});
|
|
42415
|
+
var CapabilityReportSchema = Schema_exports.Struct({
|
|
42416
|
+
fetchedAt: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
42417
|
+
sources: Schema_exports.optional(
|
|
42418
|
+
Schema_exports.Struct({
|
|
42419
|
+
models: Schema_exports.optional(Schema_exports.Boolean),
|
|
42420
|
+
admin: Schema_exports.optional(Schema_exports.Boolean)
|
|
42421
|
+
})
|
|
42422
|
+
),
|
|
42423
|
+
advertised: Schema_exports.optional(Schema_exports.Number),
|
|
42424
|
+
excluded: Schema_exports.optional(Schema_exports.Unknown),
|
|
42425
|
+
stale: Schema_exports.optional(Schema_exports.Boolean),
|
|
42426
|
+
drift: Schema_exports.optional(Schema_exports.Unknown)
|
|
42427
|
+
});
|
|
42428
|
+
var HealthCapabilitySummarySchema = Schema_exports.Struct({
|
|
42429
|
+
sources: Schema_exports.Struct({ models: Schema_exports.optional(Schema_exports.Boolean), admin: Schema_exports.optional(Schema_exports.Boolean) }),
|
|
42430
|
+
advertised: Schema_exports.Number,
|
|
42431
|
+
excluded: Schema_exports.Number,
|
|
42432
|
+
drift: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Boolean)),
|
|
42433
|
+
driftKeys: Schema_exports.optional(Schema_exports.Array(Schema_exports.String))
|
|
42434
|
+
});
|
|
42435
|
+
var EngineHealthSchema = Schema_exports.Struct({
|
|
42436
|
+
status: Schema_exports.Literals(["healthy", "unreachable", "unknown"]),
|
|
42437
|
+
httpStatus: Schema_exports.NullOr(Schema_exports.Number),
|
|
42438
|
+
latencyMs: Schema_exports.NullOr(Schema_exports.Number),
|
|
42439
|
+
checkedAt: Schema_exports.NullOr(Schema_exports.String),
|
|
42440
|
+
message: Schema_exports.NullOr(Schema_exports.String)
|
|
42441
|
+
});
|
|
42442
|
+
var EngineModelSchema = Schema_exports.Struct({
|
|
42443
|
+
id: Schema_exports.String,
|
|
42444
|
+
default: Schema_exports.Boolean,
|
|
42445
|
+
loaded: Schema_exports.Boolean
|
|
42446
|
+
});
|
|
42447
|
+
var EnginePayloadSchema = Schema_exports.Struct({
|
|
42448
|
+
kind: Schema_exports.Literals(["engine"]),
|
|
42449
|
+
backend: BackendSchema,
|
|
42450
|
+
adapter: EngineAdapterSchema,
|
|
42451
|
+
connection: EngineConnectionSchema,
|
|
42452
|
+
health: EngineHealthSchema,
|
|
42453
|
+
/** R-40-05: absent on a host that predates the strip. */
|
|
42454
|
+
speedStrip: Schema_exports.optional(SpeedStripSchema),
|
|
42455
|
+
capabilities: Schema_exports.optional(Schema_exports.NullOr(CapabilityReportSchema)),
|
|
42456
|
+
models: Schema_exports.Array(EngineModelSchema),
|
|
42457
|
+
discovery: Schema_exports.Struct({
|
|
42458
|
+
discovered: Schema_exports.Number,
|
|
42459
|
+
resident: Schema_exports.Number
|
|
42460
|
+
}),
|
|
42461
|
+
config: Schema_exports.Struct({
|
|
42462
|
+
writable: Schema_exports.Boolean,
|
|
42463
|
+
note: Schema_exports.String
|
|
42464
|
+
}),
|
|
42465
|
+
evidence: EvidenceSchema
|
|
42466
|
+
});
|
|
42467
|
+
var EngineSavePayloadSchema = Schema_exports.Struct({
|
|
42468
|
+
endpoint: Schema_exports.String,
|
|
42469
|
+
apiKey: Schema_exports.String
|
|
42470
|
+
});
|
|
42471
|
+
var EngineSaveErrorSchema = Schema_exports.Struct({
|
|
42472
|
+
ok: Schema_exports.Literal(false),
|
|
42473
|
+
error: Schema_exports.Struct({
|
|
42474
|
+
field: Schema_exports.String,
|
|
42475
|
+
message: Schema_exports.String
|
|
42476
|
+
})
|
|
42477
|
+
});
|
|
42478
|
+
var EngineSaveResponseSchema = Schema_exports.Union([EnginePayloadSchema, EngineSaveErrorSchema]);
|
|
42479
|
+
var TelemetrySourceSchema = Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.NullOr(Schema_exports.String) });
|
|
42480
|
+
var TelemetryBandSchema = Schema_exports.Struct({ band: Schema_exports.String, count: Schema_exports.Number });
|
|
42481
|
+
var TelemetrySeriesSchema = Schema_exports.Struct({
|
|
42482
|
+
range: Schema_exports.Literals(["24h", "7d", "all"]),
|
|
42483
|
+
windowStart: Schema_exports.NullOr(Schema_exports.String),
|
|
42484
|
+
fetchedAt: Schema_exports.String,
|
|
42485
|
+
sources: Schema_exports.Struct({ ledger: TelemetrySourceSchema, observations: TelemetrySourceSchema }),
|
|
42486
|
+
kpis: Schema_exports.Struct({
|
|
42487
|
+
medianDecodeTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
42488
|
+
p90DecodeTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
42489
|
+
remoteShare: Schema_exports.NullOr(Schema_exports.Number),
|
|
42490
|
+
medianDecisionMs: Schema_exports.NullOr(Schema_exports.Number),
|
|
42491
|
+
p99DecisionMs: Schema_exports.NullOr(Schema_exports.Number),
|
|
42492
|
+
observations: Schema_exports.Number,
|
|
42493
|
+
decisions: Schema_exports.Number,
|
|
42494
|
+
unavailable: Schema_exports.Array(Schema_exports.String)
|
|
42495
|
+
}),
|
|
42496
|
+
speed: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), n: Schema_exports.Number, bands: Schema_exports.Array(TelemetryBandSchema), over: Schema_exports.optional(Schema_exports.Number), median: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), p90: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), max: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), floor: Schema_exports.optional(Schema_exports.Number), belowFloor: Schema_exports.optional(Schema_exports.Number) }),
|
|
42497
|
+
prompt: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), n: Schema_exports.Number, bands: Schema_exports.Array(TelemetryBandSchema), over: Schema_exports.optional(Schema_exports.Number), median: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), p90: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), max: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), window: Schema_exports.optional(Schema_exports.Number) }),
|
|
42498
|
+
gates: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), total: Schema_exports.optional(Schema_exports.Number), gates: Schema_exports.Array(Schema_exports.Struct({ gate: Schema_exports.String, count: Schema_exports.Number })) }),
|
|
42499
|
+
latency: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), n: Schema_exports.optional(Schema_exports.Number), p50: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), p90: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), p99: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)), max: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)) }),
|
|
42500
|
+
traffic: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), hours: Schema_exports.Array(Schema_exports.Struct({ hour: Schema_exports.String, count: Schema_exports.Number, quiet: Schema_exports.Boolean })), quiet: Schema_exports.optional(Schema_exports.Number), busiest: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Struct({ hour: Schema_exports.String, count: Schema_exports.Number, quiet: Schema_exports.Boolean }))) }),
|
|
42501
|
+
scatter: Schema_exports.Struct({ available: Schema_exports.Boolean, reason: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)), n: Schema_exports.Number, plotted: Schema_exports.optional(Schema_exports.Number), points: Schema_exports.Array(Schema_exports.Struct({ promptTokens: Schema_exports.Number, tps: Schema_exports.Number, model: Schema_exports.NullOr(Schema_exports.String) })), floor: Schema_exports.optional(Schema_exports.Number), xMax: Schema_exports.optional(Schema_exports.Number) })
|
|
42502
|
+
});
|
|
42503
|
+
var TelemetryPayloadSchema = Schema_exports.Struct({
|
|
42504
|
+
kind: Schema_exports.Literals(["telemetry"]),
|
|
42505
|
+
backend: BackendSchema,
|
|
42506
|
+
evidence: EvidenceSchema,
|
|
42507
|
+
view: TelemetrySeriesSchema
|
|
42508
|
+
});
|
|
42509
|
+
var EvidencePayloadSchema = Schema_exports.Union([
|
|
42510
|
+
ModelsPayloadSchema,
|
|
42511
|
+
RoutingPayloadSchema,
|
|
42512
|
+
ActivityPayloadSchema,
|
|
42513
|
+
EnginePayloadSchema,
|
|
42514
|
+
TelemetryPayloadSchema
|
|
42515
|
+
]);
|
|
42516
|
+
var HealthSchema = Schema_exports.Struct({
|
|
42517
|
+
ok: Schema_exports.Boolean,
|
|
42518
|
+
name: Schema_exports.String,
|
|
42519
|
+
buildId: Schema_exports.optional(Schema_exports.String),
|
|
42520
|
+
now: Schema_exports.String,
|
|
42521
|
+
backend: BackendSchema,
|
|
42522
|
+
policyRev: Schema_exports.Number,
|
|
42523
|
+
ledgerRows: Schema_exports.Number,
|
|
42524
|
+
telemetry: TelemetryStateNameSchema,
|
|
42525
|
+
staleAt: Schema_exports.NullOr(Schema_exports.String),
|
|
42526
|
+
capabilities: Schema_exports.optional(Schema_exports.NullOr(HealthCapabilitySummarySchema)),
|
|
42527
|
+
routing: Schema_exports.Struct({
|
|
42528
|
+
enabled: Schema_exports.Boolean
|
|
42529
|
+
})
|
|
42530
|
+
});
|
|
42531
|
+
var decodeEvidence = Schema_exports.decodeUnknownSync(EvidenceSchema);
|
|
42532
|
+
var decodeModelsPayload = Schema_exports.decodeUnknownSync(ModelsPayloadSchema);
|
|
42533
|
+
var decodeRoutingPayload = Schema_exports.decodeUnknownSync(RoutingPayloadSchema);
|
|
42534
|
+
var decodeActivityPayload = Schema_exports.decodeUnknownSync(ActivityPayloadSchema);
|
|
42535
|
+
var decodeEnginePayload = Schema_exports.decodeUnknownSync(EnginePayloadSchema);
|
|
42536
|
+
var decodeEngineSaveResponse = Schema_exports.decodeUnknownSync(EngineSaveResponseSchema);
|
|
42537
|
+
var decodeTelemetryPayload = Schema_exports.decodeUnknownSync(TelemetryPayloadSchema);
|
|
42538
|
+
var decodeEvidencePayload = Schema_exports.decodeUnknownSync(EvidencePayloadSchema);
|
|
42539
|
+
var decodeHealth = Schema_exports.decodeUnknownSync(HealthSchema);
|
|
42540
|
+
|
|
42541
|
+
// packages/plugin/client/evidence-client.ts
|
|
42542
|
+
var evidencePath = (tab, probe = false, range2) => {
|
|
42543
|
+
if (tab === "telemetry" && range2 !== void 0) return `/api/router/telemetry?range=${range2}`;
|
|
42544
|
+
return `/api/router/${tab}${probe ? "?probe=1" : ""}`;
|
|
42545
|
+
};
|
|
42546
|
+
var TELEMETRY_RANGES = [
|
|
42547
|
+
{ id: "24h", label: "24h" },
|
|
42548
|
+
{ id: "7d", label: "7d" },
|
|
42549
|
+
{ id: "all", label: "all" }
|
|
42550
|
+
];
|
|
42551
|
+
var upgradeLegacyEvidencePayload = (value3) => {
|
|
42552
|
+
if (value3 === null || typeof value3 !== "object") return value3;
|
|
42553
|
+
const record3 = value3;
|
|
42554
|
+
const evidence = record3.evidence;
|
|
42555
|
+
if (evidence === null || typeof evidence !== "object") return value3;
|
|
42556
|
+
const policy = evidence.policy;
|
|
42557
|
+
if (policy === null || typeof policy !== "object") return value3;
|
|
42558
|
+
const mainModel = policy.mainModel;
|
|
42559
|
+
if (typeof mainModel !== "string") return value3;
|
|
42560
|
+
return {
|
|
42561
|
+
...record3,
|
|
42562
|
+
evidence: {
|
|
42563
|
+
...evidence,
|
|
42564
|
+
policy: {
|
|
42565
|
+
...policy,
|
|
42566
|
+
mainModel: mainModel.length === 0 ? null : { provider: "", model: mainModel, label: mainModel }
|
|
42567
|
+
}
|
|
42343
42568
|
}
|
|
42344
|
-
|
|
42569
|
+
};
|
|
42570
|
+
};
|
|
42571
|
+
var decodeEvidencePayload2 = (tab, value3) => {
|
|
42572
|
+
const body = upgradeLegacyEvidencePayload(value3);
|
|
42573
|
+
switch (tab) {
|
|
42574
|
+
case "models":
|
|
42575
|
+
return decodeModelsPayload(body);
|
|
42576
|
+
case "telemetry":
|
|
42577
|
+
return decodeTelemetryPayload(body);
|
|
42578
|
+
case "routing":
|
|
42579
|
+
return decodeRoutingPayload(body);
|
|
42580
|
+
case "activity":
|
|
42581
|
+
return decodeActivityPayload(body);
|
|
42582
|
+
case "engine":
|
|
42583
|
+
return decodeEnginePayload(body);
|
|
42345
42584
|
}
|
|
42346
42585
|
};
|
|
42347
|
-
var
|
|
42348
|
-
|
|
42349
|
-
|
|
42350
|
-
|
|
42351
|
-
|
|
42352
|
-
|
|
42353
|
-
constructor(props) {
|
|
42354
|
-
if ("cause" in props.reason) {
|
|
42355
|
-
super({
|
|
42356
|
-
...props,
|
|
42357
|
-
cause: props.reason.cause
|
|
42358
|
-
});
|
|
42359
|
-
} else {
|
|
42360
|
-
super(props);
|
|
42586
|
+
var classifyEvidence = (tab, payload, nowMs) => {
|
|
42587
|
+
const evidence = payload.evidence;
|
|
42588
|
+
if (tab === "models" && payload.kind === "models") {
|
|
42589
|
+
const hasRemote = payload.view.remoteModels.length > 0;
|
|
42590
|
+
if (payload.view.residents.length === 0 && evidence.telemetry.snapshot === null) {
|
|
42591
|
+
return hasRemote ? "partial" : "empty";
|
|
42361
42592
|
}
|
|
42593
|
+
if (evidence.telemetry.snapshot === null) return "partial";
|
|
42362
42594
|
}
|
|
42363
|
-
|
|
42364
|
-
|
|
42365
|
-
|
|
42366
|
-
* @stability unstable
|
|
42367
|
-
* @since 4.0.0
|
|
42368
|
-
*/
|
|
42369
|
-
[SocketErrorTypeId] = SocketErrorTypeId;
|
|
42370
|
-
/**
|
|
42371
|
-
* Returns `true` when the value is a `SocketError`.
|
|
42372
|
-
*
|
|
42373
|
-
* @stability unstable
|
|
42374
|
-
* @since 4.0.0
|
|
42375
|
-
*/
|
|
42376
|
-
static is(u) {
|
|
42377
|
-
return isSocketError(u);
|
|
42595
|
+
if (tab === "routing" && payload.kind === "routing") {
|
|
42596
|
+
if (payload.view.current === null && evidence.ledger.rows.length === 0) return "empty";
|
|
42597
|
+
if (evidence.telemetry.snapshot === null) return "partial";
|
|
42378
42598
|
}
|
|
42379
|
-
|
|
42599
|
+
if (tab === "activity" && payload.kind === "activity") {
|
|
42600
|
+
if (evidence.ledger.rows.length === 0) return "empty";
|
|
42601
|
+
if (evidence.ledger.rows.some((row) => row.gate === void 0 || row.surface === void 0)) return "partial";
|
|
42602
|
+
}
|
|
42603
|
+
if (tab === "telemetry" && payload.kind === "telemetry") {
|
|
42604
|
+
if (payload.view.kpis.decisions === 0 && payload.view.kpis.observations === 0) return "empty";
|
|
42605
|
+
if (payload.view.sources.ledger.available === false || payload.view.sources.observations.available === false) return "partial";
|
|
42606
|
+
}
|
|
42607
|
+
if (tab === "engine" && payload.kind === "engine") {
|
|
42608
|
+
if (payload.models.length === 0 && payload.health.status === "unknown") return "empty";
|
|
42609
|
+
if (payload.health.status === "healthy" && payload.models.length === 0) return "partial";
|
|
42610
|
+
}
|
|
42611
|
+
if (evidence.staleAt !== null) {
|
|
42612
|
+
const staleAt = Date.parse(evidence.staleAt);
|
|
42613
|
+
if (Number.isFinite(staleAt) && staleAt <= nowMs) return "stale";
|
|
42614
|
+
}
|
|
42615
|
+
return "ready";
|
|
42380
42616
|
};
|
|
42381
|
-
var
|
|
42382
|
-
|
|
42383
|
-
|
|
42384
|
-
|
|
42385
|
-
|
|
42386
|
-
|
|
42387
|
-
|
|
42617
|
+
var evidenceStatusMessage = (status) => {
|
|
42618
|
+
if (status === 401) return "Unauthorized \u2014 reload the DSH page to restore the browser session.";
|
|
42619
|
+
if (status === 403) return "Forbidden by the DSH Host/Origin policy.";
|
|
42620
|
+
if (status === 404) return "The /api/router evidence route is not mounted on this host.";
|
|
42621
|
+
if (status === 405) return "The host only accepts GET and HEAD for evidence.";
|
|
42622
|
+
if (status >= 500) return "The router host could not build this evidence view.";
|
|
42623
|
+
return `Evidence request failed with HTTP ${status}.`;
|
|
42388
42624
|
};
|
|
42389
|
-
var
|
|
42390
|
-
|
|
42391
|
-
|
|
42625
|
+
var emptyHint = (tab, payload) => {
|
|
42626
|
+
const rev = payload.evidence.policy.rev;
|
|
42627
|
+
if (tab === "routing" && payload.kind === "routing") {
|
|
42628
|
+
return `policy r${rev} \xB7 ${payload.view.gates.length} gates \xB7 ledger ${payload.evidence.ledger.rows.length} rows`;
|
|
42392
42629
|
}
|
|
42393
|
-
|
|
42394
|
-
}
|
|
42395
|
-
|
|
42396
|
-
|
|
42397
|
-
|
|
42398
|
-
|
|
42399
|
-
var
|
|
42400
|
-
|
|
42401
|
-
|
|
42402
|
-
|
|
42403
|
-
|
|
42404
|
-
|
|
42405
|
-
|
|
42406
|
-
|
|
42407
|
-
|
|
42408
|
-
|
|
42409
|
-
|
|
42410
|
-
|
|
42411
|
-
|
|
42412
|
-
const ws = yield* provide(acquire, scope3);
|
|
42413
|
-
if ("binaryType" in ws) {
|
|
42414
|
-
;
|
|
42415
|
-
ws.binaryType = "arraybuffer";
|
|
42630
|
+
if (tab === "activity" && payload.kind === "activity") {
|
|
42631
|
+
return `last 24 h \xB7 ${payload.evidence.ledger.rows.length} rows \xB7 policy r${rev}`;
|
|
42632
|
+
}
|
|
42633
|
+
return "";
|
|
42634
|
+
};
|
|
42635
|
+
var DECODE_COPY = "The host answered but its evidence body did not match the shared schema.";
|
|
42636
|
+
var schemaIssuePath = (error) => {
|
|
42637
|
+
if (error === null || typeof error !== "object") return null;
|
|
42638
|
+
const root = error.issue;
|
|
42639
|
+
const segments = [];
|
|
42640
|
+
let node = root;
|
|
42641
|
+
while (node !== null && typeof node === "object") {
|
|
42642
|
+
const record3 = node;
|
|
42643
|
+
if (record3._tag === "Pointer" && Array.isArray(record3.path)) {
|
|
42644
|
+
for (const segment2 of record3.path) {
|
|
42645
|
+
if (typeof segment2 === "string" || typeof segment2 === "number") segments.push(segment2);
|
|
42646
|
+
}
|
|
42647
|
+
node = record3.issue;
|
|
42648
|
+
continue;
|
|
42416
42649
|
}
|
|
42417
|
-
|
|
42418
|
-
|
|
42419
|
-
|
|
42420
|
-
let paused = pausable && "isPaused" in ws && ws.isPaused === true;
|
|
42421
|
-
let buffer2 = [];
|
|
42422
|
-
let bufferSize = 0;
|
|
42423
|
-
let overflowed = false;
|
|
42424
|
-
let error;
|
|
42425
|
-
let waiter;
|
|
42426
|
-
let openWaiter;
|
|
42427
|
-
function pauseWebSocket() {
|
|
42428
|
-
if (!pausable || paused) return;
|
|
42429
|
-
ws.pause();
|
|
42430
|
-
paused = true;
|
|
42650
|
+
if (Array.isArray(record3.issues) && record3.issues.length > 0) {
|
|
42651
|
+
node = record3.issues[0];
|
|
42652
|
+
continue;
|
|
42431
42653
|
}
|
|
42432
|
-
|
|
42433
|
-
|
|
42434
|
-
|
|
42435
|
-
paused = false;
|
|
42654
|
+
if (record3.issue !== null && typeof record3.issue === "object") {
|
|
42655
|
+
node = record3.issue;
|
|
42656
|
+
continue;
|
|
42436
42657
|
}
|
|
42437
|
-
|
|
42438
|
-
|
|
42439
|
-
|
|
42440
|
-
|
|
42441
|
-
|
|
42442
|
-
|
|
42658
|
+
break;
|
|
42659
|
+
}
|
|
42660
|
+
return segments.length === 0 ? null : segments.map(String).join(".");
|
|
42661
|
+
};
|
|
42662
|
+
var fetchHealth = async (options = {}) => {
|
|
42663
|
+
const request3 = options.fetchImpl ?? globalThis.fetch;
|
|
42664
|
+
if (typeof request3 !== "function") {
|
|
42665
|
+
return { ok: false, status: null, message: "No fetch implementation is available." };
|
|
42666
|
+
}
|
|
42667
|
+
try {
|
|
42668
|
+
const response = await request3("/api/router/health", {
|
|
42669
|
+
method: "GET",
|
|
42670
|
+
headers: { accept: "application/json" },
|
|
42671
|
+
credentials: "same-origin",
|
|
42672
|
+
cache: "no-store",
|
|
42673
|
+
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
42674
|
+
});
|
|
42675
|
+
if (!response.ok) {
|
|
42676
|
+
return { ok: false, status: response.status, message: evidenceStatusMessage(response.status) };
|
|
42443
42677
|
}
|
|
42444
|
-
|
|
42445
|
-
|
|
42446
|
-
|
|
42447
|
-
|
|
42448
|
-
|
|
42678
|
+
const body = await response.json();
|
|
42679
|
+
return { ok: true, status: response.status, health: decodeHealth(body) };
|
|
42680
|
+
} catch (error) {
|
|
42681
|
+
if (options.signal?.aborted === true) throw error;
|
|
42682
|
+
return { ok: false, status: null, message: "Cannot reach the router host." };
|
|
42683
|
+
}
|
|
42684
|
+
};
|
|
42685
|
+
var fetchEvidence = async (tab, options = {}) => {
|
|
42686
|
+
const request3 = options.fetchImpl ?? globalThis.fetch;
|
|
42687
|
+
if (typeof request3 !== "function") {
|
|
42688
|
+
return { ok: false, status: null, message: "No fetch implementation is available.", retryable: false };
|
|
42689
|
+
}
|
|
42690
|
+
const call = () => request3(evidencePath(tab, options.probe === true, options.range), {
|
|
42691
|
+
method: "GET",
|
|
42692
|
+
headers: { accept: "application/json" },
|
|
42693
|
+
credentials: "same-origin",
|
|
42694
|
+
cache: "no-store",
|
|
42695
|
+
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
42696
|
+
});
|
|
42697
|
+
try {
|
|
42698
|
+
let response = await call();
|
|
42699
|
+
if (response.status === 404) {
|
|
42700
|
+
await new Promise((resolve7) => setTimeout(resolve7, 750));
|
|
42701
|
+
if (options.signal?.aborted !== true) response = await call();
|
|
42449
42702
|
}
|
|
42450
|
-
|
|
42451
|
-
|
|
42452
|
-
buffer2.push(data);
|
|
42453
|
-
if (highWaterMark !== void 0) {
|
|
42454
|
-
bufferSize += (typeof data === "string" ? encoder5.encode(data).byteLength : data.byteLength) || 1;
|
|
42455
|
-
}
|
|
42456
|
-
if (waiter !== void 0) deliver();
|
|
42457
|
-
if (pausable && bufferSize >= highWaterMark) {
|
|
42458
|
-
pauseWebSocket();
|
|
42459
|
-
} else if (!pausable && bufferSize > highWaterMark) {
|
|
42460
|
-
overflow2();
|
|
42461
|
-
}
|
|
42703
|
+
if (!response.ok) {
|
|
42704
|
+
return { ok: false, status: response.status, message: evidenceStatusMessage(response.status), retryable: true };
|
|
42462
42705
|
}
|
|
42463
|
-
|
|
42464
|
-
|
|
42465
|
-
|
|
42466
|
-
|
|
42467
|
-
|
|
42468
|
-
})
|
|
42469
|
-
}));
|
|
42470
|
-
try {
|
|
42471
|
-
ws.close(1008, "Inbound message buffer limit exceeded");
|
|
42472
|
-
} catch {
|
|
42473
|
-
ws.close();
|
|
42474
|
-
}
|
|
42706
|
+
let body;
|
|
42707
|
+
try {
|
|
42708
|
+
body = await response.json();
|
|
42709
|
+
} catch {
|
|
42710
|
+
return { ok: false, status: response.status, message: "Evidence response was not JSON.", retryable: false };
|
|
42475
42711
|
}
|
|
42476
|
-
|
|
42477
|
-
|
|
42478
|
-
|
|
42479
|
-
|
|
42480
|
-
|
|
42481
|
-
|
|
42482
|
-
|
|
42483
|
-
|
|
42484
|
-
|
|
42485
|
-
|
|
42486
|
-
|
|
42487
|
-
|
|
42488
|
-
const resume = waiter;
|
|
42489
|
-
waiter = void 0;
|
|
42490
|
-
resume(buffer2.length > 0 ? succeed6(takeBuffer()) : fail6(error));
|
|
42491
|
-
}
|
|
42712
|
+
let payload;
|
|
42713
|
+
try {
|
|
42714
|
+
payload = decodeEvidencePayload2(tab, body);
|
|
42715
|
+
} catch (error) {
|
|
42716
|
+
const field2 = schemaIssuePath(error);
|
|
42717
|
+
return {
|
|
42718
|
+
ok: false,
|
|
42719
|
+
status: response.status,
|
|
42720
|
+
message: DECODE_COPY,
|
|
42721
|
+
retryable: false,
|
|
42722
|
+
...field2 === null ? {} : { field: field2 }
|
|
42723
|
+
};
|
|
42492
42724
|
}
|
|
42493
|
-
|
|
42494
|
-
|
|
42495
|
-
|
|
42496
|
-
|
|
42497
|
-
|
|
42498
|
-
|
|
42499
|
-
|
|
42500
|
-
|
|
42501
|
-
|
|
42502
|
-
|
|
42503
|
-
|
|
42504
|
-
|
|
42505
|
-
|
|
42725
|
+
return { ok: true, status: response.status, payload };
|
|
42726
|
+
} catch (error) {
|
|
42727
|
+
if (options.signal?.aborted === true) throw error;
|
|
42728
|
+
return { ok: false, status: null, message: "Cannot reach the router host.", retryable: true };
|
|
42729
|
+
}
|
|
42730
|
+
};
|
|
42731
|
+
|
|
42732
|
+
// packages/ui/src/tokens.ts
|
|
42733
|
+
var RouterTokensCss = `:root {
|
|
42734
|
+
/* \u2500\u2500 \xA701 colour roles \u2014 12 roles, one value each \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42735
|
+
--color-bg: #FFFFFF; /* page ground, card ground */
|
|
42736
|
+
--color-surface: #FAFAF9; /* inset panel, table head, state well */
|
|
42737
|
+
--color-subtle: #F2F2F0; /* hover fill, tag fill, disabled fill */
|
|
42738
|
+
--color-ink: #111111; /* titles, values, focus ring, primary fill */
|
|
42739
|
+
--color-body: #333333; /* labels, control text, prose */
|
|
42740
|
+
--color-meta: #5F5F5F; /* micro-labels, table meta, footer, copy */
|
|
42741
|
+
--color-placeholder: #AAAAAA; /* unset value inside a control */
|
|
42742
|
+
--color-disabled: #D6D6D3; /* disabled label and icon */
|
|
42743
|
+
--color-danger: #B4261A; /* error text, invalid border, destructive */
|
|
42744
|
+
/* Three hairline roles, not three greys (F-34-01). Panel and field share a
|
|
42745
|
+
value today so a field edge can be strengthened without moving a panel. */
|
|
42746
|
+
--color-line-rule: #EAEAEA; /* row divider, table rule, header rule */
|
|
42747
|
+
--color-line-panel: #DFDFDD; /* card, notice, chip edge */
|
|
42748
|
+
--color-line-field: #DFDFDD; /* input, select, button border */
|
|
42749
|
+
|
|
42750
|
+
/* \u2500\u2500 \xA704 depth \u2014 one flat default, one float; CSS-only (no Paper token) \u2500\u2500\u2500 */
|
|
42751
|
+
--elevation-flat: none;
|
|
42752
|
+
--elevation-popover: 0 8px 24px rgba(17,17,17,.10);
|
|
42753
|
+
|
|
42754
|
+
/* \u2500\u2500 \xA702 type families \u2014 titles/sentence Geist, labels Inter, data Mono \u2500\u2500\u2500 */
|
|
42755
|
+
--font-prose: "Geist", "Inter", system-ui, sans-serif;
|
|
42756
|
+
--font-ui: "Inter", system-ui, sans-serif;
|
|
42757
|
+
--font-mono: "Geist Mono", ui-monospace, monospace;
|
|
42758
|
+
|
|
42759
|
+
/* \u2500\u2500 \xA702 canonical steps \u2014 T1 display \u2026 T6 meta \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42760
|
+
--text-display: 30px; /* T1 \u2014 page title (the tab names the page) */
|
|
42761
|
+
--leading-display: 34px;
|
|
42762
|
+
--text-title: 20px; /* T2 \u2014 section, state and decision title */
|
|
42763
|
+
--leading-title: 24px;
|
|
42764
|
+
--text-sentence: 19px; /* T3 \u2014 the Overview sentence, this role only */
|
|
42765
|
+
--leading-sentence: 24px;
|
|
42766
|
+
--text-body: 14px; /* T4 \u2014 prose, descriptions, empty copy */
|
|
42767
|
+
--leading-body: 20px;
|
|
42768
|
+
--text-label: 13px; /* T5 \u2014 form labels, row names, error text */
|
|
42769
|
+
--leading-label: 18px;
|
|
42770
|
+
--text-meta: 12px; /* T6 \u2014 data cells, table meta, mono labels */
|
|
42771
|
+
--leading-meta: 16px;
|
|
42772
|
+
|
|
42773
|
+
/* \u2500\u2500 \xA702 closed dense exceptions \u2014 D1 kpi \u2026 D4 micro-label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42774
|
+
--text-kpi: 18px; /* D1 \u2014 KPI value, concurrency ceiling */
|
|
42775
|
+
--leading-kpi: 22px;
|
|
42776
|
+
--text-detail: 17px; /* D2 \u2014 record title, detail panel heading */
|
|
42777
|
+
--leading-detail: 22px;
|
|
42778
|
+
--text-caption: 10.5px; /* D3 \u2014 KPI caption, chip sm, table sub-cell */
|
|
42779
|
+
--leading-caption: 14px;
|
|
42780
|
+
--text-caps: 9.5px; /* D4 \u2014 record head, table heads, caps labels */
|
|
42781
|
+
--leading-caps: 12px;
|
|
42782
|
+
|
|
42783
|
+
/* \u2500\u2500 \xA702 tracking \u2014 declared per role in em, never inherited \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42784
|
+
--tracking-none: 0em; /* T4, T5, T6 */
|
|
42785
|
+
--tracking-snug: -0.01em; /* T2, D1, D2 */
|
|
42786
|
+
--tracking-sentence: -0.012em; /* T3 only */
|
|
42787
|
+
--tracking-tight: -0.02em; /* T1 */
|
|
42788
|
+
--tracking-caption: 0.01em; /* D3 \u2014 board \xA702 states it; see the P1 report */
|
|
42789
|
+
--tracking-caps: 0.06em; /* D4 */
|
|
42790
|
+
|
|
42791
|
+
/* \u2500\u2500 \xA703 spacing \u2014 a 4px base, eight steps \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42792
|
+
--spacing-1: 4px; /* icon gap */
|
|
42793
|
+
--spacing-2: 8px; /* chip gap */
|
|
42794
|
+
--spacing-3: 12px; /* field pad */
|
|
42795
|
+
--spacing-4: 16px; /* panel pad */
|
|
42796
|
+
--spacing-5: 20px; /* gutter @390 */
|
|
42797
|
+
--spacing-6: 24px; /* section gap */
|
|
42798
|
+
--spacing-7: 28px; /* frame gap */
|
|
42799
|
+
--spacing-8: 32px; /* gutter @1440 */
|
|
42800
|
+
|
|
42801
|
+
/* \u2500\u2500 \xA705 control heights and row height \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42802
|
+
--container-control-sm: 24px; /* chips, pager, icon buttons, sentence chips */
|
|
42803
|
+
--container-control-md: 30px; /* buttons, select, number field, input */
|
|
42804
|
+
--container-control-lg: 38px; /* Engine endpoint/key, page primary */
|
|
42805
|
+
--container-row: 44px; /* table row and form row */
|
|
42806
|
+
|
|
42807
|
+
/* \u2500\u2500 page geometry (measured, already holds) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42808
|
+
/* The shell header's measured height (DEC-34-05: 24 top pad + the 28px tab
|
|
42809
|
+
row + hairline at 1440; the wrapped bar plus the status row at 390). It is
|
|
42810
|
+
the SHELL's value: no page reads or subtracts it, because the shell's flex
|
|
42811
|
+
column owns the fold (F-34-21). ShellCss overrides it to 115px below 760. */
|
|
42812
|
+
--shell-header: 59px;
|
|
42813
|
+
--container-page: 1180px;
|
|
42814
|
+
--container-gutter: 32px;
|
|
42815
|
+
--container-gutter-sm: 20px;
|
|
42816
|
+
/* F-34-14 repair (P6): --container-measure (720px) is deleted \u2014 no source
|
|
42817
|
+
declares or needs a 720px measure. --breakpoint-sm/-md/-lg are deleted for
|
|
42818
|
+
the same reason: a CSS @media condition cannot read a var(), and no JS
|
|
42819
|
+
matchMedia consumes them, so the tokens could have no consumer. Every
|
|
42820
|
+
media budget is pinned by name in tokens.test.ts instead. */
|
|
42821
|
+
|
|
42822
|
+
/* \u2500\u2500 \xA704 radii \u2014 four corners + two shapes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
42823
|
+
--radius-chip: 4px; /* chip, tag, badge */
|
|
42824
|
+
--radius-input: 6px; /* input, select, number field */
|
|
42825
|
+
--radius-card: 8px; /* the one panel: raised or inset */
|
|
42826
|
+
--radius-popover: 10px; /* popover surface */
|
|
42827
|
+
--radius-pill: 999px; /* switch track, on filter chip */
|
|
42828
|
+
--radius-round: 50%; /* status dot, slider thumb */
|
|
42829
|
+
}`;
|
|
42830
|
+
var RouterRecipesCss = `
|
|
42831
|
+
/* Owner review (2026-12-05): a data page reads calmer when its numbers hold
|
|
42832
|
+
their columns and its text is antialiased. Tabular figures wherever a value
|
|
42833
|
+
updates, smoothing on the page roots, and one rule for the quiet empty line.
|
|
42834
|
+
[class~="router-panel-value"] is the panel value written without the panel
|
|
42835
|
+
prefix, so the panel recipe below stays the only .router-panel selector. */
|
|
42836
|
+
.router-overview, .page-body, .router-rail, .router-split { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
|
|
42837
|
+
.router-kpi-value, .router-kpi-sub, .router-meter-value, .router-meter-status, .router-meter-tick, .router-recent-time, .router-recent-meta, .router-session-meta, .router-session-state, .router-ceiling-value, .router-ceiling-unit, .router-card-meta, [class~="router-panel-value"] { font-variant-numeric: tabular-nums; }
|
|
42838
|
+
.router-empty-line { padding: 6px 0; font-family: var(--font-ui); font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-meta); text-wrap: pretty; }
|
|
42839
|
+
[data-control]:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
|
|
42840
|
+
:where([data-control]):hover:where(:not([aria-disabled="true"]):not(:disabled):not([aria-pressed="true"]):not([aria-checked="true"]):not([aria-current="page"]):not([data-current="true"])) { background: var(--color-subtle); color: var(--color-ink); transition: background 120ms ease; }
|
|
42841
|
+
.router-interactive:hover { background: var(--color-subtle); transition: background 120ms ease; }
|
|
42842
|
+
[data-control][aria-disabled="true"] { color: var(--color-disabled); background: var(--color-surface); cursor: not-allowed; }
|
|
42843
|
+
[aria-invalid="true"] { border-color: var(--color-danger); }
|
|
42844
|
+
/* The kit Slider keeps its range input visually hidden inside the drawn thumb
|
|
42845
|
+
(13RS-0), so the thumb carries the board's hover halo and focus ring. */
|
|
42846
|
+
.router-slider-thumb:hover { box-shadow: 0 0 0 4px var(--color-subtle); }
|
|
42847
|
+
.router-slider-thumb:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-ink); }
|
|
42848
|
+
.router-field-error { font-family: var(--font-ui); font-size: var(--text-label); line-height: var(--leading-label); color: var(--color-danger); }
|
|
42849
|
+
/* One error role, three placements: the class stays exactly router-field-error
|
|
42850
|
+
and the layout rides a data attribute, so a test/DevTools probe can still
|
|
42851
|
+
match the role by class (F-34-12). */
|
|
42852
|
+
.router-field-error[data-error-layout="page"] { margin: 0 0 10px; }
|
|
42853
|
+
.router-field-error[data-error-layout="alert"] { padding-block: 4px 0; }
|
|
42854
|
+
.router-field-error[data-error-layout="row"] { padding-bottom: 6px; }
|
|
42855
|
+
/* F-34-19 (P6): the ONE panel surface. Before this rule the pages carried four
|
|
42856
|
+
competing surface grammars (detail/record were flat surface wells, card a
|
|
42857
|
+
raised white panel, notice a chip-cornered box) plus the settings panel's
|
|
42858
|
+
own copy. Every panel now takes .router-panel with data-surface:
|
|
42859
|
+
raised \u2014 a panel lifted off the page ground (cards, settings blocks);
|
|
42860
|
+
flush \u2014 a panel set into the page ground (detail, record, notice).
|
|
42861
|
+
Both are the board's one panel: a 1px --color-line-panel hairline and the
|
|
42862
|
+
--radius-card corner; only the ground differs (DEC: "the one panel: raised
|
|
42863
|
+
or inset", tokens \xA704). Pages keep only padding and layout in their class. */
|
|
42864
|
+
.router-panel { box-sizing: border-box; border: 1px solid var(--color-line-panel); border-radius: var(--radius-card); }
|
|
42865
|
+
.router-panel[data-surface="raised"] { background: var(--color-bg); }
|
|
42866
|
+
.router-panel[data-surface="flush"] { background: var(--color-surface); }
|
|
42867
|
+
/* The interactive class list: every class that can take a pointer or the
|
|
42868
|
+
keyboard, so the two recipes cannot miss one (F-34-06/07). */
|
|
42869
|
+
:where(.router-chip, .router-filter-chip, .router-button, .router-model-button, .router-pager-button, .router-export, .router-input, .router-select-item, .router-conflict-action, .router-footer-button, .router-select-trigger, .router-settings-action, .router-subset-button, .router-switch):hover:where(:not([aria-disabled="true"]):not(:disabled):not([aria-pressed="true"]):not([aria-checked="true"]):not([aria-current="page"]):not([data-current="true"])) { background: var(--color-subtle); color: var(--color-ink); }
|
|
42870
|
+
:where(.router-chip, .router-filter-chip, .router-button, .router-model-button, .router-pager-button, .router-segment-button, .router-export, .router-input, .router-select-item, .router-interactive, .router-conflict-action, .router-footer-button, .router-select-trigger, .router-settings-action, .router-subset-button, .router-switch):focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
|
|
42871
|
+
`;
|
|
42872
|
+
var injectRouterSheet = (doc, key5, css2) => {
|
|
42873
|
+
if (doc.head === null) return null;
|
|
42874
|
+
const existing = doc.head.querySelector('style[data-router-sheet="' + key5 + '"]');
|
|
42875
|
+
if (existing !== null) return existing;
|
|
42876
|
+
const style = doc.createElement("style");
|
|
42877
|
+
style.setAttribute("data-router-sheet", key5);
|
|
42878
|
+
style.textContent = css2;
|
|
42879
|
+
doc.head.appendChild(style);
|
|
42880
|
+
return style;
|
|
42881
|
+
};
|
|
42882
|
+
var injectRouterRecipes = (doc) => injectRouterSheet(doc, "recipes", RouterRecipesCss);
|
|
42883
|
+
if (typeof document !== "undefined" && document.head !== null) {
|
|
42884
|
+
injectRouterSheet(document, "tokens", RouterTokensCss);
|
|
42885
|
+
}
|
|
42886
|
+
|
|
42887
|
+
// vendor/effect/dist/socket/Socket.js
|
|
42888
|
+
var TypeId43 = "~effect/socket/Socket";
|
|
42889
|
+
var Socket = /* @__PURE__ */ Service("effect/socket/Socket");
|
|
42890
|
+
var make29 = (options) => Socket.of({
|
|
42891
|
+
[TypeId43]: TypeId43,
|
|
42892
|
+
reader: options.reader,
|
|
42893
|
+
writer: options.writer
|
|
42894
|
+
});
|
|
42895
|
+
var encoder5 = /* @__PURE__ */ new TextEncoder();
|
|
42896
|
+
var readerString = (self, encoding) => map7(self.reader, ({
|
|
42897
|
+
pull
|
|
42898
|
+
}) => {
|
|
42899
|
+
const decoder4 = new TextDecoder(encoding);
|
|
42900
|
+
const streamOptions = {
|
|
42901
|
+
stream: true
|
|
42902
|
+
};
|
|
42903
|
+
let needsFlush = false;
|
|
42904
|
+
return map7(pull, (chunk) => {
|
|
42905
|
+
const out = new Array(chunk.length);
|
|
42906
|
+
for (let i = 0; i < chunk.length; i++) {
|
|
42907
|
+
const item = chunk[i];
|
|
42908
|
+
if (typeof item === "string") {
|
|
42909
|
+
out[i] = needsFlush ? decoder4.decode() + item : item;
|
|
42910
|
+
needsFlush = false;
|
|
42911
|
+
} else {
|
|
42912
|
+
out[i] = decoder4.decode(item, streamOptions);
|
|
42913
|
+
needsFlush = true;
|
|
42914
|
+
}
|
|
42915
|
+
}
|
|
42916
|
+
return out;
|
|
42917
|
+
}).pipe(catch_3((error) => {
|
|
42918
|
+
if (needsFlush && error.reason._tag === "SocketCloseError" && error.reason.code === 1e3) {
|
|
42919
|
+
needsFlush = false;
|
|
42920
|
+
const last = decoder4.decode();
|
|
42921
|
+
if (last.length > 0) return succeed6([last]);
|
|
42922
|
+
}
|
|
42923
|
+
return fail6(error);
|
|
42924
|
+
}));
|
|
42925
|
+
});
|
|
42926
|
+
var CloseEventTypeId = "~effect/socket/Socket/CloseEvent";
|
|
42927
|
+
var CloseEvent = class {
|
|
42928
|
+
/**
|
|
42929
|
+
* Marks this value as a socket close event for runtime guards.
|
|
42930
|
+
*
|
|
42931
|
+
* @stability unstable
|
|
42932
|
+
* @since 4.0.0
|
|
42933
|
+
*/
|
|
42934
|
+
[CloseEventTypeId];
|
|
42935
|
+
code;
|
|
42936
|
+
reason;
|
|
42937
|
+
constructor(code = 1e3, reason) {
|
|
42938
|
+
this[CloseEventTypeId] = CloseEventTypeId;
|
|
42939
|
+
this.code = code;
|
|
42940
|
+
this.reason = reason;
|
|
42941
|
+
}
|
|
42942
|
+
/**
|
|
42943
|
+
* Formats the close code and optional reason for display.
|
|
42944
|
+
*
|
|
42945
|
+
* @stability unstable
|
|
42946
|
+
* @since 4.0.0
|
|
42947
|
+
*/
|
|
42948
|
+
toString() {
|
|
42949
|
+
return this.reason ? `${this.code}: ${this.reason}` : `${this.code}`;
|
|
42950
|
+
}
|
|
42951
|
+
};
|
|
42952
|
+
var isCloseEvent = (u) => hasProperty(u, CloseEventTypeId);
|
|
42953
|
+
var SocketErrorTypeId = "~effect/socket/Socket/SocketError";
|
|
42954
|
+
var isSocketError = (u) => hasProperty(u, SocketErrorTypeId);
|
|
42955
|
+
var SocketReadError = class extends (/* @__PURE__ */ Error4("effect/socket/Socket/SocketReadError")({
|
|
42956
|
+
_tag: /* @__PURE__ */ tag("SocketReadError"),
|
|
42957
|
+
cause: /* @__PURE__ */ Defect()
|
|
42958
|
+
})) {
|
|
42959
|
+
/**
|
|
42960
|
+
* Default message used for socket read failures.
|
|
42961
|
+
*
|
|
42962
|
+
* @stability unstable
|
|
42963
|
+
* @since 4.0.0
|
|
42964
|
+
*/
|
|
42965
|
+
message = `An error occurred during Read`;
|
|
42966
|
+
};
|
|
42967
|
+
var SocketWriteError = class extends (/* @__PURE__ */ Error4("effect/socket/Socket/SocketWriteError")({
|
|
42968
|
+
_tag: /* @__PURE__ */ tag("SocketWriteError"),
|
|
42969
|
+
cause: /* @__PURE__ */ Defect()
|
|
42970
|
+
})) {
|
|
42971
|
+
/**
|
|
42972
|
+
* Default message used for socket write failures.
|
|
42973
|
+
*
|
|
42974
|
+
* @stability unstable
|
|
42975
|
+
* @since 4.0.0
|
|
42976
|
+
*/
|
|
42977
|
+
message = `An error occurred during Write`;
|
|
42978
|
+
};
|
|
42979
|
+
var SocketOpenError = class extends (/* @__PURE__ */ Error4("effect/socket/Socket/SocketOpenError")({
|
|
42980
|
+
_tag: /* @__PURE__ */ tag("SocketOpenError"),
|
|
42981
|
+
kind: /* @__PURE__ */ Literals(["Unknown", "Timeout"]),
|
|
42982
|
+
cause: /* @__PURE__ */ Defect()
|
|
42983
|
+
})) {
|
|
42984
|
+
/**
|
|
42985
|
+
* Formats timeout and unknown open failures for display.
|
|
42986
|
+
*
|
|
42987
|
+
* @stability unstable
|
|
42988
|
+
* @since 4.0.0
|
|
42989
|
+
*/
|
|
42990
|
+
get message() {
|
|
42991
|
+
return this.kind === "Timeout" ? `timeout waiting for "open"` : `An error occurred during Open`;
|
|
42992
|
+
}
|
|
42993
|
+
};
|
|
42994
|
+
var SocketUpgradeError = class _SocketUpgradeError extends (/* @__PURE__ */ Error4("effect/socket/Socket/SocketUpgradeError")({
|
|
42995
|
+
_tag: /* @__PURE__ */ tag("SocketUpgradeError"),
|
|
42996
|
+
cause: /* @__PURE__ */ optional2(/* @__PURE__ */ Defect())
|
|
42997
|
+
})) {
|
|
42998
|
+
/**
|
|
42999
|
+
* An upgrade implementation for transports that cannot wrap the connection
|
|
43000
|
+
* with TLS.
|
|
43001
|
+
*
|
|
43002
|
+
* @stability unstable
|
|
43003
|
+
* @since 4.0.0
|
|
43004
|
+
*/
|
|
43005
|
+
static unsupported = () => fail6(new SocketError({
|
|
43006
|
+
reason: new _SocketUpgradeError({})
|
|
43007
|
+
}));
|
|
43008
|
+
get message() {
|
|
43009
|
+
return this.cause === void 0 ? `Socket does not support TLS upgrade` : `An error occurred during TLS upgrade`;
|
|
43010
|
+
}
|
|
43011
|
+
};
|
|
43012
|
+
var SocketCloseError = class extends (/* @__PURE__ */ Error4("effect/socket/Socket/SocketCloseError")({
|
|
43013
|
+
_tag: /* @__PURE__ */ tag("SocketCloseError"),
|
|
43014
|
+
code: Int,
|
|
43015
|
+
closeReason: /* @__PURE__ */ optional2(String6)
|
|
43016
|
+
})) {
|
|
43017
|
+
get message() {
|
|
43018
|
+
if (this.closeReason) {
|
|
43019
|
+
return `${this.code}: ${this.closeReason}`;
|
|
43020
|
+
}
|
|
43021
|
+
return `${this.code}`;
|
|
43022
|
+
}
|
|
43023
|
+
};
|
|
43024
|
+
var SocketErrorReason = /* @__PURE__ */ Union2([SocketReadError, SocketWriteError, SocketOpenError, SocketUpgradeError, SocketCloseError]);
|
|
43025
|
+
var SocketError = class extends (/* @__PURE__ */ TaggedError3(SocketErrorTypeId)("SocketError", {
|
|
43026
|
+
_tag: /* @__PURE__ */ tag("SocketError"),
|
|
43027
|
+
reason: SocketErrorReason
|
|
43028
|
+
})) {
|
|
43029
|
+
// @effect-diagnostics-next-line overriddenSchemaConstructor:off
|
|
43030
|
+
constructor(props) {
|
|
43031
|
+
if ("cause" in props.reason) {
|
|
43032
|
+
super({
|
|
43033
|
+
...props,
|
|
43034
|
+
cause: props.reason.cause
|
|
43035
|
+
});
|
|
43036
|
+
} else {
|
|
43037
|
+
super(props);
|
|
43038
|
+
}
|
|
43039
|
+
}
|
|
43040
|
+
/**
|
|
43041
|
+
* Marks this value as a socket error wrapper for runtime guards.
|
|
43042
|
+
*
|
|
43043
|
+
* @stability unstable
|
|
43044
|
+
* @since 4.0.0
|
|
43045
|
+
*/
|
|
43046
|
+
[SocketErrorTypeId] = SocketErrorTypeId;
|
|
43047
|
+
/**
|
|
43048
|
+
* Returns `true` when the value is a `SocketError`.
|
|
43049
|
+
*
|
|
43050
|
+
* @stability unstable
|
|
43051
|
+
* @since 4.0.0
|
|
43052
|
+
*/
|
|
43053
|
+
static is(u) {
|
|
43054
|
+
return isSocketError(u);
|
|
43055
|
+
}
|
|
43056
|
+
message = this.reason.message;
|
|
43057
|
+
};
|
|
43058
|
+
var closeError = (code, closeReason) => new SocketError({
|
|
43059
|
+
reason: new SocketCloseError({
|
|
43060
|
+
code,
|
|
43061
|
+
closeReason
|
|
43062
|
+
})
|
|
43063
|
+
});
|
|
43064
|
+
var WebSocketConstructor = class extends (/* @__PURE__ */ Service()("@effect/platform/Socket/WebSocketConstructor")) {
|
|
43065
|
+
};
|
|
43066
|
+
var layerWebSocketConstructorGlobal = /* @__PURE__ */ succeed5(WebSocketConstructor)((url, options) => {
|
|
43067
|
+
if (options !== void 0 && typeof options !== "string" && !Array.isArray(options)) {
|
|
43068
|
+
throw new TypeError("WebSocket client options are not supported by the global WebSocket constructor");
|
|
43069
|
+
}
|
|
43070
|
+
return new globalThis.WebSocket(url, options);
|
|
43071
|
+
});
|
|
43072
|
+
var makeWebSocket = (url, options) => WebSocketConstructor.use((makeWs) => fromWebSocket(acquireRelease2((typeof url === "string" ? succeed6(url) : url).pipe(map7((url2) => makeWs(url2, options?.headers === void 0 ? options?.protocols : {
|
|
43073
|
+
protocols: options.protocols,
|
|
43074
|
+
headers: options.headers
|
|
43075
|
+
}))), (ws) => sync3(() => ws.close(1e3))), options));
|
|
43076
|
+
var isPausable = (ws) => "pause" in ws && typeof ws.pause === "function";
|
|
43077
|
+
var fromWebSocket = (acquire, options) => withFiber2((fiber3) => {
|
|
43078
|
+
let currentWS;
|
|
43079
|
+
let terminalError;
|
|
43080
|
+
const latch = makeUnsafe9(false);
|
|
43081
|
+
const acquireContext = fiber3.context;
|
|
43082
|
+
const disableReconnects = options?.disableReconnects === true;
|
|
43083
|
+
const terminate = disableReconnects ? (error) => {
|
|
43084
|
+
terminalError ??= error;
|
|
43085
|
+
latch.openUnsafe();
|
|
43086
|
+
} : () => latch.closeUnsafe();
|
|
43087
|
+
const connect3 = gen2(function* () {
|
|
43088
|
+
const scope3 = yield* scope2;
|
|
43089
|
+
const ws = yield* provide(acquire, scope3);
|
|
43090
|
+
if ("binaryType" in ws) {
|
|
43091
|
+
;
|
|
43092
|
+
ws.binaryType = "arraybuffer";
|
|
43093
|
+
}
|
|
43094
|
+
const pausable = isPausable(ws);
|
|
43095
|
+
const highWaterMark = options?.highWaterMark ?? (pausable ? defaultHighWaterMark : void 0);
|
|
43096
|
+
let open4 = ws.readyState === 1;
|
|
43097
|
+
let paused = pausable && "isPaused" in ws && ws.isPaused === true;
|
|
43098
|
+
let buffer2 = [];
|
|
43099
|
+
let bufferSize = 0;
|
|
43100
|
+
let overflowed = false;
|
|
43101
|
+
let error;
|
|
43102
|
+
let waiter;
|
|
43103
|
+
let openWaiter;
|
|
43104
|
+
function pauseWebSocket() {
|
|
43105
|
+
if (!pausable || paused) return;
|
|
43106
|
+
ws.pause();
|
|
43107
|
+
paused = true;
|
|
43108
|
+
}
|
|
43109
|
+
function resumeWebSocket() {
|
|
43110
|
+
if (!pausable || !paused) return;
|
|
43111
|
+
ws.resume();
|
|
43112
|
+
paused = false;
|
|
43113
|
+
}
|
|
43114
|
+
function takeBuffer() {
|
|
43115
|
+
const chunk = buffer2;
|
|
43116
|
+
buffer2 = [];
|
|
43117
|
+
bufferSize = 0;
|
|
43118
|
+
if (error === void 0) resumeWebSocket();
|
|
43119
|
+
return chunk;
|
|
43120
|
+
}
|
|
43121
|
+
function deliver() {
|
|
43122
|
+
if (waiter === void 0 || buffer2.length === 0) return;
|
|
43123
|
+
const resume = waiter;
|
|
43124
|
+
waiter = void 0;
|
|
43125
|
+
resume(succeed6(takeBuffer()));
|
|
43126
|
+
}
|
|
43127
|
+
function push2(data) {
|
|
43128
|
+
if (overflowed) return;
|
|
43129
|
+
buffer2.push(data);
|
|
43130
|
+
if (highWaterMark !== void 0) {
|
|
43131
|
+
bufferSize += (typeof data === "string" ? encoder5.encode(data).byteLength : data.byteLength) || 1;
|
|
43132
|
+
}
|
|
43133
|
+
if (waiter !== void 0) deliver();
|
|
43134
|
+
if (pausable && bufferSize >= highWaterMark) {
|
|
43135
|
+
pauseWebSocket();
|
|
43136
|
+
} else if (!pausable && bufferSize > highWaterMark) {
|
|
43137
|
+
overflow2();
|
|
43138
|
+
}
|
|
43139
|
+
}
|
|
43140
|
+
function overflow2() {
|
|
43141
|
+
overflowed = true;
|
|
43142
|
+
fail15(new SocketError({
|
|
43143
|
+
reason: new SocketReadError({
|
|
43144
|
+
cause: new Error(`Socket highWaterMark of ${highWaterMark} bytes exceeded`)
|
|
43145
|
+
})
|
|
43146
|
+
}));
|
|
43147
|
+
try {
|
|
43148
|
+
ws.close(1008, "Inbound message buffer limit exceeded");
|
|
43149
|
+
} catch {
|
|
43150
|
+
ws.close();
|
|
43151
|
+
}
|
|
43152
|
+
}
|
|
43153
|
+
function fail15(err) {
|
|
43154
|
+
if (error === void 0) error = err;
|
|
43155
|
+
if (openWaiter !== void 0) {
|
|
43156
|
+
const {
|
|
43157
|
+
cleanup,
|
|
43158
|
+
resume
|
|
43159
|
+
} = openWaiter;
|
|
43160
|
+
openWaiter = void 0;
|
|
43161
|
+
cleanup();
|
|
43162
|
+
resume(fail6(error));
|
|
43163
|
+
}
|
|
43164
|
+
if (waiter !== void 0) {
|
|
43165
|
+
const resume = waiter;
|
|
43166
|
+
waiter = void 0;
|
|
43167
|
+
resume(buffer2.length > 0 ? succeed6(takeBuffer()) : fail6(error));
|
|
43168
|
+
}
|
|
43169
|
+
}
|
|
43170
|
+
function onMessage(event) {
|
|
43171
|
+
const data = event.data;
|
|
43172
|
+
if (typeof Blob !== "undefined" && data instanceof Blob) {
|
|
43173
|
+
data.arrayBuffer().then((buf) => push2(new Uint8Array(buf)), (cause2) => {
|
|
43174
|
+
fail15(new SocketError({
|
|
43175
|
+
reason: new SocketReadError({
|
|
43176
|
+
cause: cause2
|
|
43177
|
+
})
|
|
43178
|
+
}));
|
|
43179
|
+
});
|
|
43180
|
+
return;
|
|
43181
|
+
}
|
|
43182
|
+
push2(data instanceof ArrayBuffer ? new Uint8Array(data) : data);
|
|
42506
43183
|
}
|
|
42507
43184
|
function onError4(event) {
|
|
42508
43185
|
fail15(new SocketError({
|
|
@@ -46934,7 +47611,7 @@ var makeStep = (model, commands, emitted, lists, sends, viewTransitionTypes) =>
|
|
|
46934
47611
|
sends,
|
|
46935
47612
|
viewTransitionTypes
|
|
46936
47613
|
});
|
|
46937
|
-
var stepWith = (
|
|
47614
|
+
var stepWith = (step4, change) => Object.assign(makeStep(step4.model, step4.commands, step4.emitted, step4.lists, step4.sends, step4.viewTransitionTypes), change);
|
|
46938
47615
|
var UpdateProto = {
|
|
46939
47616
|
...StepProto,
|
|
46940
47617
|
send(target2, message) {
|
|
@@ -48131,10 +48808,10 @@ var isClosed = (scope3) => scope3.state._tag === "Closed";
|
|
|
48131
48808
|
var withProps = (rootProps, f) => isEffect2(rootProps) ? flatMap5(rootProps, f) : f(rootProps);
|
|
48132
48809
|
var fromDom = (makeDom, elements2) => ({
|
|
48133
48810
|
elements: elements2,
|
|
48134
|
-
make: (container, ownsHead,
|
|
48811
|
+
make: (container, ownsHead, step4) => {
|
|
48135
48812
|
const dom = makeDom(container, {
|
|
48136
48813
|
head: ownsHead,
|
|
48137
|
-
step:
|
|
48814
|
+
step: step4
|
|
48138
48815
|
});
|
|
48139
48816
|
return {
|
|
48140
48817
|
base: dom,
|
|
@@ -49728,7 +50405,7 @@ var makeHost = (container, options) => {
|
|
|
49728
50405
|
const edits = /* @__PURE__ */ new WeakMap();
|
|
49729
50406
|
let pending4;
|
|
49730
50407
|
let scratch;
|
|
49731
|
-
const
|
|
50408
|
+
const step4 = options.step ?? ((f) => f());
|
|
49732
50409
|
const remember2 = (node, state3) => {
|
|
49733
50410
|
if (state3 === void 0) return;
|
|
49734
50411
|
let states2 = edits.get(node);
|
|
@@ -49910,7 +50587,7 @@ var makeHost = (container, options) => {
|
|
|
49910
50587
|
const prevents = element.eventOptions[name3]?.preventDefault;
|
|
49911
50588
|
if (prevents === "always") event?.preventDefault();
|
|
49912
50589
|
const inst = rec.inst;
|
|
49913
|
-
|
|
50590
|
+
step4(() => {
|
|
49914
50591
|
if (inst.closed) return false;
|
|
49915
50592
|
if (handler?.["~fire"] !== void 0) {
|
|
49916
50593
|
return handler["~fire"](payload(), name3, () => event?.preventDefault());
|
|
@@ -51214,7 +51891,7 @@ var make39 = (log2, clock3, session, app) => {
|
|
|
51214
51891
|
starting = wasStarting;
|
|
51215
51892
|
}
|
|
51216
51893
|
};
|
|
51217
|
-
const
|
|
51894
|
+
const step4 = (f) => depth > 0 ? f() : under(void 0, f, true);
|
|
51218
51895
|
const stamp = (cause2, next3) => ({
|
|
51219
51896
|
seq: next3,
|
|
51220
51897
|
...cause2 === void 0 ? void 0 : {
|
|
@@ -51316,7 +51993,7 @@ var make39 = (log2, clock3, session, app) => {
|
|
|
51316
51993
|
};
|
|
51317
51994
|
return {
|
|
51318
51995
|
record: record3,
|
|
51319
|
-
step:
|
|
51996
|
+
step: step4,
|
|
51320
51997
|
session: (f) => {
|
|
51321
51998
|
if (!log2.enabled) return under(void 0, f);
|
|
51322
51999
|
const next3 = ++seq;
|
|
@@ -51330,9 +52007,9 @@ var make39 = (log2, clock3, session, app) => {
|
|
|
51330
52007
|
follow: (late) => {
|
|
51331
52008
|
const from = origin;
|
|
51332
52009
|
const opening = late ? starting : void 0;
|
|
51333
|
-
return from === void 0 && opening === void 0 ?
|
|
52010
|
+
return from === void 0 && opening === void 0 ? step4 : (f) => {
|
|
51334
52011
|
const cause2 = from ?? opening.seq;
|
|
51335
|
-
return cause2 === void 0 ?
|
|
52012
|
+
return cause2 === void 0 ? step4(f) : under(cause2, f);
|
|
51336
52013
|
};
|
|
51337
52014
|
},
|
|
51338
52015
|
tree: (draft) => {
|
|
@@ -52885,27 +53562,27 @@ var chainOf = (session, entry) => {
|
|
|
52885
53562
|
});
|
|
52886
53563
|
return steps;
|
|
52887
53564
|
};
|
|
52888
|
-
var inRun = (
|
|
53565
|
+
var inRun = (step4) => step4._tag === "Command" ? step4.command._tag !== "Interrupt" : step4._tag === "Started" || step4._tag === "NotStarted" || step4._tag === "Result";
|
|
52889
53566
|
var chainSeqs = (steps) => {
|
|
52890
53567
|
const seqs = /* @__PURE__ */ new Set();
|
|
52891
|
-
for (const
|
|
52892
|
-
switch (
|
|
53568
|
+
for (const step4 of steps) {
|
|
53569
|
+
switch (step4._tag) {
|
|
52893
53570
|
case "Source":
|
|
52894
|
-
if (
|
|
53571
|
+
if (step4.link !== void 0) seqs.add(step4.link.seq);
|
|
52895
53572
|
break;
|
|
52896
53573
|
case "Entry":
|
|
52897
|
-
seqs.add(
|
|
52898
|
-
for (const ref4 of
|
|
53574
|
+
seqs.add(step4.ref.seq);
|
|
53575
|
+
for (const ref4 of step4.stopped ?? []) seqs.add(ref4.seq);
|
|
52899
53576
|
break;
|
|
52900
53577
|
case "Link":
|
|
52901
53578
|
case "Started":
|
|
52902
53579
|
case "End":
|
|
52903
53580
|
case "Result":
|
|
52904
53581
|
case "CausedBy":
|
|
52905
|
-
seqs.add(
|
|
53582
|
+
seqs.add(step4.ref.seq);
|
|
52906
53583
|
break;
|
|
52907
53584
|
case "Command":
|
|
52908
|
-
for (const ref4 of
|
|
53585
|
+
for (const ref4 of step4.stopped) seqs.add(ref4.seq);
|
|
52909
53586
|
break;
|
|
52910
53587
|
}
|
|
52911
53588
|
}
|
|
@@ -56177,8 +56854,8 @@ var Label = (h3, entry, strong = false) => {
|
|
|
56177
56854
|
};
|
|
56178
56855
|
var RefSummary = (h3, ref4) => ref4.entry._tag === "Outside" ? [SeqLink(h3, ref4), h3.span.class("muted").children(" outside the buffer")] : [...Label(h3, ref4.entry), " ", SeqLink(h3, ref4)];
|
|
56179
56856
|
var Stopped = (h3, refs) => refs.length === 0 ? [] : [h3.span.class("muted").children(", stopped "), ...refs.flatMap((ref4) => [SeqLink(h3, ref4), " "])];
|
|
56180
|
-
var markOfStep = (
|
|
56181
|
-
switch (
|
|
56857
|
+
var markOfStep = (step4) => {
|
|
56858
|
+
switch (step4._tag) {
|
|
56182
56859
|
case "Source":
|
|
56183
56860
|
case "NotStarted":
|
|
56184
56861
|
case "Names":
|
|
@@ -56193,10 +56870,10 @@ var markOfStep = (step3) => {
|
|
|
56193
56870
|
case "Result":
|
|
56194
56871
|
case "End":
|
|
56195
56872
|
case "CausedBy":
|
|
56196
|
-
return markOf(
|
|
56873
|
+
return markOf(step4.ref.entry);
|
|
56197
56874
|
}
|
|
56198
56875
|
};
|
|
56199
|
-
var Step = (h3,
|
|
56876
|
+
var Step = (h3, step4, body, tone, extra) => h3.li.class("step", tone === void 0 ? null : "step-" + tone, inRun(step4) && "run").attr("data-step", step4._tag).attr("data-index", step4._tag === "Command" ? String(step4.index) : void 0).children(h3.span.class("node").children(Mark(h3, markOfStep(step4))), h3.div.class("what").children(...body), extra === void 0 ? null : h3.div.class("args").children(...extra));
|
|
56200
56877
|
var endText = (end4) => {
|
|
56201
56878
|
switch (end4._tag) {
|
|
56202
56879
|
case "CommandInterrupted":
|
|
@@ -56215,34 +56892,34 @@ var linkText = {
|
|
|
56215
56892
|
source: "Result of",
|
|
56216
56893
|
started: "Started from"
|
|
56217
56894
|
};
|
|
56218
|
-
var Chain = (h3, steps) => h3.ol.class("chain").attr("aria-label", "Causal chain").children(steps.map((
|
|
56219
|
-
switch (
|
|
56895
|
+
var Chain = (h3, steps) => h3.ol.class("chain").attr("aria-label", "Causal chain").children(steps.map((step4, index2) => {
|
|
56896
|
+
switch (step4._tag) {
|
|
56220
56897
|
case "Source":
|
|
56221
|
-
return Step(h3,
|
|
56898
|
+
return Step(h3, step4, [sourceText(step4.source), ...step4.link === void 0 ? [] : [" ", SeqLink(h3, step4.link)]]);
|
|
56222
56899
|
case "Link":
|
|
56223
|
-
return Step(h3,
|
|
56900
|
+
return Step(h3, step4, [linkText[step4.rel], " ", ...RefSummary(h3, step4.ref)]);
|
|
56224
56901
|
case "Entry":
|
|
56225
|
-
return Step(h3,
|
|
56902
|
+
return Step(h3, step4, [...Label(h3, step4.ref.entry, step4.selected), " ", step4.selected ? h3.span.class("muted").children("this entry") : SeqLink(h3, step4.ref), ...Stopped(h3, step4.stopped ?? [])], step4.selected ? "this" : void 0);
|
|
56226
56903
|
case "Command":
|
|
56227
|
-
return
|
|
56904
|
+
return step4.command._tag === "Interrupt" ? Step(h3, step4, ["Interrupt " + step4.command.name, step4.command.group === null ? null : h3.span.class("muted").children(" " + step4.command.group), ...Stopped(h3, step4.stopped)]) : Step(h3, step4, ["Issued ", Code(h3, step4.command.name)], void 0, Json3(h3, step4.command.args));
|
|
56228
56905
|
case "Started":
|
|
56229
|
-
return Step(h3,
|
|
56906
|
+
return Step(h3, step4, ["Started ", SeqLink(h3, step4.ref)], step4.selected ? "this" : void 0);
|
|
56230
56907
|
case "NotStarted":
|
|
56231
|
-
return Step(h3,
|
|
56908
|
+
return Step(h3, step4, [step4.ended ? "Stopped before it started" : "Waiting to start"], step4.ended ? void 0 : "open");
|
|
56232
56909
|
case "Result":
|
|
56233
|
-
return Step(h3,
|
|
56910
|
+
return Step(h3, step4, ["Result ", ...RefSummary(h3, step4.ref)]);
|
|
56234
56911
|
case "Running":
|
|
56235
|
-
return Step(h3,
|
|
56912
|
+
return Step(h3, step4, step4.since === void 0 ? ["Not started yet"] : ["Still running since ", SeqLink(h3, step4.since), h3.span.class("muted").children(", no end logged yet")], "open");
|
|
56236
56913
|
case "End": {
|
|
56237
|
-
const end4 =
|
|
56914
|
+
const end4 = step4.ref.entry;
|
|
56238
56915
|
const bad = end4._tag === "CommandInterrupted" || end4._tag === "CommandDropped" || end4._tag === "Failed";
|
|
56239
56916
|
const next3 = steps[index2 + 1];
|
|
56240
|
-
return Step(h3,
|
|
56917
|
+
return Step(h3, step4, [endText(end4), step4.after === void 0 ? "" : " after " + duration(step4.after), " ", SeqLink(h3, step4.ref), end4._tag === "Failed" ? h3.span.class("muted").children(", which failed its instance") : null, ...next3?._tag === "CausedBy" ? [h3.span.class("cause").children(" by ", ...RefSummary(h3, next3.ref))] : []], bad ? "bad" : step4.selected ? "this" : void 0);
|
|
56241
56918
|
}
|
|
56242
56919
|
case "CausedBy":
|
|
56243
|
-
return steps[index2 - 1]?._tag === "End" ? null : Step(h3,
|
|
56920
|
+
return steps[index2 - 1]?._tag === "End" ? null : Step(h3, step4, ["Caused by ", ...RefSummary(h3, step4.ref)]);
|
|
56244
56921
|
case "Names":
|
|
56245
|
-
return Step(h3,
|
|
56922
|
+
return Step(h3, step4, ["Linked from ", ...step4.links.flatMap((link2, at) => [at === 0 ? null : ", ", ...Label(h3, link2.entry), " ", SeqLink(h3, {
|
|
56246
56923
|
seq: link2.seq,
|
|
56247
56924
|
entry: link2.entry
|
|
56248
56925
|
}), h3.span.class("muted").children(" (" + link2.rel + ")")])]);
|
|
@@ -56314,7 +56991,7 @@ var Details = (h3, session, entry, info, model) => {
|
|
|
56314
56991
|
model: previous.model,
|
|
56315
56992
|
props: previous.props
|
|
56316
56993
|
} : void 0;
|
|
56317
|
-
const
|
|
56994
|
+
const unavailable2 = previous !== void 0 && before === void 0;
|
|
56318
56995
|
const changes2 = state3 === void 0 || before === void 0 ? [] : diff2(before.model, state3.model);
|
|
56319
56996
|
const changed2 = changes2.filter((change) => change.kind !== "unknown").length;
|
|
56320
56997
|
const commands = isIssuing(entry) ? entry.commands : [];
|
|
@@ -56328,13 +57005,13 @@ var Details = (h3, session, entry, info, model) => {
|
|
|
56328
57005
|
const sections = [...state3 === void 0 ? [] : [{
|
|
56329
57006
|
value: "model",
|
|
56330
57007
|
label: "Model",
|
|
56331
|
-
...
|
|
57008
|
+
...unavailable2 ? {
|
|
56332
57009
|
count: "no diff"
|
|
56333
57010
|
} : previous === void 0 ? {} : {
|
|
56334
57011
|
count: String(changed2),
|
|
56335
57012
|
unit: changed2 === 1 ? "change" : "changes"
|
|
56336
57013
|
},
|
|
56337
|
-
body: () => [h3.p.class("note").children(previous === void 0 ? "First state of " + name3 :
|
|
57014
|
+
body: () => [h3.p.class("note").children(previous === void 0 ? "First state of " + name3 : unavailable2 ? h3.span.children(previous.changed === true ? "Changed since " : "No diff against ", SeqLink(h3, refOf(session, previous.seq)), ", which is outside the buffer") : h3.span.children("Since ", SeqLink(h3, refOf(session, previous.seq)), ", the previous state of " + name3)), VirtualTree(h3, "Model after #" + entry.seq, String(entry.seq), treeOf(state3.model, changes2, new Set(model.expanded)))]
|
|
56338
57015
|
}], ...entry._tag === "Update" ? [{
|
|
56339
57016
|
value: "message",
|
|
56340
57017
|
label: "Message",
|
|
@@ -58475,7 +59152,7 @@ var handlers2 = (server) => {
|
|
|
58475
59152
|
seq: r.seq,
|
|
58476
59153
|
is: summaryOf(r.entry)
|
|
58477
59154
|
});
|
|
58478
|
-
const
|
|
59155
|
+
const step4 = (s) => {
|
|
58479
59156
|
switch (s._tag) {
|
|
58480
59157
|
case "Source":
|
|
58481
59158
|
return omitNull({
|
|
@@ -58618,7 +59295,7 @@ var handlers2 = (server) => {
|
|
|
58618
59295
|
}) {
|
|
58619
59296
|
const s = yield* sessionOf2(session);
|
|
58620
59297
|
const entry = yield* entryOf2(s, seq);
|
|
58621
|
-
return ok(yield* fit(chainOf(s, entry).map(
|
|
59298
|
+
return ok(yield* fit(chainOf(s, entry).map(step4)));
|
|
58622
59299
|
}),
|
|
58623
59300
|
get_state: fnUntraced2(function* ({
|
|
58624
59301
|
at,
|
|
@@ -58757,11 +59434,11 @@ var handlers2 = (server) => {
|
|
|
58757
59434
|
yield* server.until(() => arrival(s, newest)).pipe(timeoutOption2("2 seconds"));
|
|
58758
59435
|
}
|
|
58759
59436
|
const unseen = [];
|
|
58760
|
-
const
|
|
59437
|
+
const unavailable2 = [];
|
|
58761
59438
|
for (const seq of logged) {
|
|
58762
59439
|
const reason = arrival(s, seq);
|
|
58763
59440
|
if (reason === void 0) unseen.push(seq);
|
|
58764
|
-
else if (reason !== "seen")
|
|
59441
|
+
else if (reason !== "seen") unavailable2.push({
|
|
58765
59442
|
seq,
|
|
58766
59443
|
reason
|
|
58767
59444
|
});
|
|
@@ -58772,7 +59449,7 @@ var handlers2 = (server) => {
|
|
|
58772
59449
|
length: messages.length - sent
|
|
58773
59450
|
}, (_, i) => sent + i);
|
|
58774
59451
|
const seqs = (list) => list.map((seq) => "#" + seq).join(", ");
|
|
58775
|
-
const notes = [last?._tag === "Unknown" ? "Message " + (sent - 1) + " was sent but did not finish in time, so it may still be applied. Read before resending it." : void 0, notSent.length === 0 ? void 0 : "Messages " + notSent.join(", ") + " were not sent, " + (last === void 0 || last._tag === "Updated" ? "because the batch ran out of time." : last._tag === "Unknown" ? "because message " + (sent - 1) + "'s outcome is unknown." : "because message " + (sent - 1) + " did not update."), unseen.length === 0 ? void 0 : "Entries " + seqs(unseen) + " were logged by the page but have not reached the server yet, so a read may not show them.",
|
|
59452
|
+
const notes = [last?._tag === "Unknown" ? "Message " + (sent - 1) + " was sent but did not finish in time, so it may still be applied. Read before resending it." : void 0, notSent.length === 0 ? void 0 : "Messages " + notSent.join(", ") + " were not sent, " + (last === void 0 || last._tag === "Updated" ? "because the batch ran out of time." : last._tag === "Unknown" ? "because message " + (sent - 1) + "'s outcome is unknown." : "because message " + (sent - 1) + " did not update."), unseen.length === 0 ? void 0 : "Entries " + seqs(unseen) + " were logged by the page but have not reached the server yet, so a read may not show them.", unavailable2.length === 0 ? void 0 : "Entries " + seqs(unavailable2.map((u) => u.seq)) + " were logged by the page, but the server can't show them: a skipped entry was dropped from the page's buffer before it was sent, an evicted one is older than the entries kept, and an excluded one matched exclude.", reply.paused === null ? void 0 : "The page is paused: resume to see the live page."].filter((note) => note !== void 0);
|
|
58776
59453
|
return ok(omitNull({
|
|
58777
59454
|
outcomes: reply.outcomes,
|
|
58778
59455
|
applied: reply.outcomes.filter((outcome) => outcome._tag === "Updated").length,
|
|
@@ -58780,7 +59457,7 @@ var handlers2 = (server) => {
|
|
|
58780
59457
|
notSent: notSent.length === 0 ? void 0 : notSent,
|
|
58781
59458
|
paused: reply.paused,
|
|
58782
59459
|
unseen: unseen.length === 0 ? void 0 : unseen,
|
|
58783
|
-
unavailable:
|
|
59460
|
+
unavailable: unavailable2.length === 0 ? void 0 : unavailable2,
|
|
58784
59461
|
note: notes.length === 0 ? void 0 : notes.join(" ")
|
|
58785
59462
|
}));
|
|
58786
59463
|
}),
|
|
@@ -59329,6 +60006,29 @@ var attach4 = (options = {}) => {
|
|
|
59329
60006
|
var layer3 = (options) => make45(options ?? {});
|
|
59330
60007
|
var attach5 = attach4;
|
|
59331
60008
|
|
|
60009
|
+
// packages/ui/src/time.ts
|
|
60010
|
+
var clockFormat = (options) => new Intl.DateTimeFormat(void 0, options);
|
|
60011
|
+
var HH_MM = clockFormat({ hour: "2-digit", minute: "2-digit", hour12: false });
|
|
60012
|
+
var HH_MM_DD = clockFormat({ month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hour12: false });
|
|
60013
|
+
var HH = clockFormat({ hour: "2-digit", hour12: false });
|
|
60014
|
+
var toDate2 = (value3) => {
|
|
60015
|
+
if (value3 instanceof Date) return Number.isNaN(value3.getTime()) ? null : value3;
|
|
60016
|
+
if (typeof value3 === "number" && Number.isFinite(value3)) return new Date(value3);
|
|
60017
|
+
if (typeof value3 === "string" && value3.length > 0) {
|
|
60018
|
+
const parsed2 = Date.parse(value3);
|
|
60019
|
+
return Number.isNaN(parsed2) ? null : new Date(parsed2);
|
|
60020
|
+
}
|
|
60021
|
+
return null;
|
|
60022
|
+
};
|
|
60023
|
+
var localClock = (value3) => {
|
|
60024
|
+
const date = toDate2(value3);
|
|
60025
|
+
return date === null ? "\u2014" : HH_MM.format(date);
|
|
60026
|
+
};
|
|
60027
|
+
var localHour = (value3) => {
|
|
60028
|
+
const date = toDate2(value3);
|
|
60029
|
+
return date === null ? "\u2014" : HH.format(date);
|
|
60030
|
+
};
|
|
60031
|
+
|
|
59332
60032
|
// vendor/effect-ui-kit/dist/internal/interaction.js
|
|
59333
60033
|
var methodOf = (pointerType) => pointerType === "touch" || pointerType === "pen" ? pointerType : pointerType === "" ? "keyboard" : "mouse";
|
|
59334
60034
|
var onScrollbar2 = (target2, event) => {
|
|
@@ -60020,22 +60720,22 @@ var place5 = (input2) => {
|
|
|
60020
60720
|
fn: fn3,
|
|
60021
60721
|
name: name3
|
|
60022
60722
|
} = middleware[i];
|
|
60023
|
-
const
|
|
60723
|
+
const step4 = fn3({
|
|
60024
60724
|
x,
|
|
60025
60725
|
y,
|
|
60026
60726
|
placement: placement2,
|
|
60027
60727
|
data: steps
|
|
60028
60728
|
});
|
|
60029
|
-
x =
|
|
60030
|
-
y =
|
|
60729
|
+
x = step4.x ?? x;
|
|
60730
|
+
y = step4.y ?? y;
|
|
60031
60731
|
steps[name3] = {
|
|
60032
60732
|
...steps[name3],
|
|
60033
|
-
...
|
|
60733
|
+
...step4.data
|
|
60034
60734
|
};
|
|
60035
|
-
if (
|
|
60735
|
+
if (step4.reset !== void 0 && step4.reset !== false && resets2 < 50) {
|
|
60036
60736
|
resets2++;
|
|
60037
|
-
if (typeof
|
|
60038
|
-
placement2 =
|
|
60737
|
+
if (typeof step4.reset === "object") {
|
|
60738
|
+
placement2 = step4.reset.placement;
|
|
60039
60739
|
const coords = coordsFor(anchor, popup, placement2, rtl);
|
|
60040
60740
|
x = coords.x;
|
|
60041
60741
|
y = coords.y;
|
|
@@ -60978,28 +61678,28 @@ var roundedTo = (value3, format10) => {
|
|
|
60978
61678
|
return parsed2 !== null && formatter.format(parsed2) === text2 ? parsed2 : value3;
|
|
60979
61679
|
};
|
|
60980
61680
|
var rounded = (value3, format10) => hasRounding(format10) ? roundedTo(value3, format10) : value3;
|
|
60981
|
-
var snapped = (value3, base2,
|
|
60982
|
-
const size6 = Math.abs(
|
|
60983
|
-
const direction = Math.sign(
|
|
61681
|
+
var snapped = (value3, base2, step4, nearest3) => {
|
|
61682
|
+
const size6 = Math.abs(step4);
|
|
61683
|
+
const direction = Math.sign(step4);
|
|
60984
61684
|
const steps = value3 - base2 + size6 * 1e-10 * direction;
|
|
60985
|
-
if (nearest3) return base2 + Math.round(steps /
|
|
61685
|
+
if (nearest3) return base2 + Math.round(steps / step4) * step4;
|
|
60986
61686
|
return base2 + (direction > 0 ? Math.floor(steps / size6) : Math.ceil(steps / size6)) * size6;
|
|
60987
61687
|
};
|
|
60988
61688
|
var lowest = (range2) => range2.min ?? Number.MIN_SAFE_INTEGER;
|
|
60989
61689
|
var highest = (range2) => range2.max ?? Number.MAX_SAFE_INTEGER;
|
|
60990
61690
|
var validated = (value3, range2, options) => {
|
|
60991
61691
|
const {
|
|
60992
|
-
step:
|
|
61692
|
+
step: step4
|
|
60993
61693
|
} = options;
|
|
60994
61694
|
const min6 = lowest(range2);
|
|
60995
61695
|
const max6 = highest(range2);
|
|
60996
61696
|
let next3 = value3;
|
|
60997
|
-
if (
|
|
60998
|
-
next3 = snapped(next3, range2.min ?? 0,
|
|
61697
|
+
if (step4 !== void 0 && step4 !== 0 && range2.snapOnStep) {
|
|
61698
|
+
next3 = snapped(next3, range2.min ?? 0, step4, options.small === true);
|
|
60999
61699
|
}
|
|
61000
61700
|
if (options.clamp) next3 = clamp5(next3, min6, max6);
|
|
61001
61701
|
const rounds = hasRounding(range2.format);
|
|
61002
|
-
if (
|
|
61702
|
+
if (step4 === void 0 && !rounds) return next3;
|
|
61003
61703
|
const clean2 = rounds ? roundedTo(next3, range2.format) : withoutFloatNoise(next3);
|
|
61004
61704
|
return options.clamp ? clamp5(clean2, min6, max6) : clean2;
|
|
61005
61705
|
};
|
|
@@ -63660,7 +64360,7 @@ var watch = (node, args2, changes2) => callback3((queue) => {
|
|
|
63660
64360
|
if (current3.active !== null) send3(SelectMessage.ScrolledByArrow());
|
|
63661
64361
|
};
|
|
63662
64362
|
const scrollBy = (arrow, up) => {
|
|
63663
|
-
const
|
|
64363
|
+
const step4 = () => {
|
|
63664
64364
|
const element = scroller();
|
|
63665
64365
|
unhighlight();
|
|
63666
64366
|
const max6 = maxScrollOf(element);
|
|
@@ -63671,9 +64371,9 @@ var watch = (node, args2, changes2) => callback3((queue) => {
|
|
|
63671
64371
|
if (items.length > 0) {
|
|
63672
64372
|
element.scrollTop = arrowScrollTop(items, up, top, element.clientHeight, arrow.offsetHeight || 0, max6);
|
|
63673
64373
|
}
|
|
63674
|
-
arrowTimer = setTimeout(
|
|
64374
|
+
arrowTimer = setTimeout(step4, 40);
|
|
63675
64375
|
};
|
|
63676
|
-
arrowTimer = setTimeout(
|
|
64376
|
+
arrowTimer = setTimeout(step4, 40);
|
|
63677
64377
|
};
|
|
63678
64378
|
const onPointerDown = () => {
|
|
63679
64379
|
dragY = 0;
|
|
@@ -64391,32 +65091,32 @@ var decimals = (value3) => {
|
|
|
64391
65091
|
}
|
|
64392
65092
|
return value3.toString().split(".")[1]?.length ?? 0;
|
|
64393
65093
|
};
|
|
64394
|
-
var roundToStep = (value3,
|
|
64395
|
-
var snap = (value3,
|
|
65094
|
+
var roundToStep = (value3, step4, min6) => Number((Math.round((value3 - min6) / step4) * step4 + min6).toFixed(Math.max(decimals(step4), decimals(min6))));
|
|
65095
|
+
var snap = (value3, step4, min6, top) => clamp5(roundToStep(value3, step4, min6), min6, top);
|
|
64396
65096
|
var exact = (value3) => Number(value3.toFixed(12));
|
|
64397
65097
|
var sameValues = (a, b) => a.length === b.length && a.every((value3, i) => value3 === b[i]);
|
|
64398
65098
|
var settingsOf2 = (props, rtl) => {
|
|
64399
65099
|
const min6 = props.min ?? 0;
|
|
64400
65100
|
const max6 = props.max ?? 100;
|
|
64401
|
-
const
|
|
65101
|
+
const step4 = props.step ?? 1;
|
|
64402
65102
|
const array2 = typeof props.value !== "number";
|
|
64403
65103
|
const raw = typeof props.value === "number" ? [props.value] : props.value;
|
|
64404
|
-
const top = max6 <= min6 ? min6 : roundToStep(min6 + Math.floor(exact((max6 - min6) /
|
|
65104
|
+
const top = max6 <= min6 ? min6 : roundToStep(min6 + Math.floor(exact((max6 - min6) / step4)) * step4, step4, min6);
|
|
64405
65105
|
return {
|
|
64406
65106
|
min: min6,
|
|
64407
65107
|
max: max6,
|
|
64408
65108
|
top,
|
|
64409
|
-
step:
|
|
65109
|
+
step: step4,
|
|
64410
65110
|
largeStep: props.largeStep ?? 10,
|
|
64411
65111
|
// Whole steps, so a thumb the gap from another stays on the grid.
|
|
64412
|
-
gap: exact(
|
|
65112
|
+
gap: exact(step4 * Math.max(0, Math.ceil(exact(props.minStepsBetweenValues ?? 0)))),
|
|
64413
65113
|
vertical: props.orientation === "vertical",
|
|
64414
65114
|
reversed: rtl && props.orientation !== "vertical",
|
|
64415
65115
|
collision: props.thumbCollisionBehavior ?? "push",
|
|
64416
65116
|
array: array2,
|
|
64417
65117
|
// At the step the native input shows, so the input, its ARIA value
|
|
64418
65118
|
// and what a key starts from agree.
|
|
64419
|
-
values: raw.map((value3) => snap(value3,
|
|
65119
|
+
values: raw.map((value3) => snap(value3, step4, min6, top)).sort((a, b) => a - b),
|
|
64420
65120
|
disabled: props.disabled === true
|
|
64421
65121
|
};
|
|
64422
65122
|
};
|
|
@@ -64909,20 +65609,6 @@ var Switch = (_h, options) => {
|
|
|
64909
65609
|
});
|
|
64910
65610
|
};
|
|
64911
65611
|
|
|
64912
|
-
// packages/domain/src/policy.ts
|
|
64913
|
-
var validFloor = (floorTps) => Number.isFinite(floorTps) && Number.isInteger(floorTps) && floorTps >= 0 && floorTps <= 100;
|
|
64914
|
-
var MainModelSchema = Schema_exports.Struct({
|
|
64915
|
-
provider: Schema_exports.String,
|
|
64916
|
-
model: Schema_exports.String,
|
|
64917
|
-
label: Schema_exports.String
|
|
64918
|
-
});
|
|
64919
|
-
var PolicySchema = Schema_exports.Struct({
|
|
64920
|
-
floorTps: Schema_exports.Number,
|
|
64921
|
-
mainModel: Schema_exports.NullOr(MainModelSchema),
|
|
64922
|
-
advisoryModel: Schema_exports.NullOr(Schema_exports.String),
|
|
64923
|
-
rev: Schema_exports.Number
|
|
64924
|
-
});
|
|
64925
|
-
|
|
64926
65612
|
// packages/domain/src/roles.ts
|
|
64927
65613
|
var roleIds = ["l1", "l2", "l3", "advisor"];
|
|
64928
65614
|
var RoleSettingsSchema = Schema_exports.Struct({
|
|
@@ -65301,6 +65987,11 @@ var OverviewCss = [
|
|
|
65301
65987
|
/* F-37-51: the session list reads like the recent-calls list - one row per
|
|
65302
65988
|
session, the kit checkbox first, the id reduced to its tail. */
|
|
65303
65989
|
".router-sessions { display: flex; flex-direction: column; gap: 0; width: 100%; }",
|
|
65990
|
+
// F-37-52 (Owner, 2026-12-06): the two tables stacked with no space between them,
|
|
65991
|
+
// so the sessions card and the recent-calls card read as one block. Each raised
|
|
65992
|
+
// panel keeps its own breathing room in the overview column.
|
|
65993
|
+
'.router-overview .router-card[data-table="sessions"] { margin-top: var(--spacing-5); }',
|
|
65994
|
+
'.router-overview .router-card[data-table="recent"] { margin-top: var(--spacing-5); }',
|
|
65304
65995
|
,
|
|
65305
65996
|
,
|
|
65306
65997
|
".router-session-hint { padding: var(--spacing-3) 0 0; font-family: var(--font-ui); font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--color-meta); text-wrap: pretty; }",
|
|
@@ -65566,7 +66257,7 @@ var SaveSettings = Command_exports.make(
|
|
|
65566
66257
|
);
|
|
65567
66258
|
var OverviewSessionShortId = (id2) => id2.length <= 8 ? id2 : "\u2026" + id2.slice(-8);
|
|
65568
66259
|
var OverviewSessionLabel = (row) => row.title !== null && row.title.length > 0 ? row.title : OverviewSessionShortId(row.id);
|
|
65569
|
-
var OverviewSessionTime = (row) => row.updatedAt === null ? "" : row.updatedAt
|
|
66260
|
+
var OverviewSessionTime = (row) => row.updatedAt === null ? "" : localClock(row.updatedAt);
|
|
65570
66261
|
var OverviewDef = Html_exports.component({
|
|
65571
66262
|
name: "Overview",
|
|
65572
66263
|
props: Schema_exports.Struct({
|
|
@@ -65598,893 +66289,292 @@ var OverviewDef = Html_exports.component({
|
|
|
65598
66289
|
),
|
|
65599
66290
|
selectOpen: Schema_exports.NullOr(Schema_exports.String),
|
|
65600
66291
|
pending: Schema_exports.Boolean,
|
|
65601
|
-
saveError: Schema_exports.NullOr(Schema_exports.String),
|
|
65602
|
-
// A 409's attempted change, offered as a retry against the adopted rev.
|
|
65603
|
-
conflict: Schema_exports.NullOr(
|
|
65604
|
-
Schema_exports.Struct({ path: Schema_exports.String, value: Schema_exports.String, rev: Schema_exports.Number })
|
|
65605
|
-
)
|
|
65606
|
-
}),
|
|
65607
|
-
message: OverviewMessage
|
|
65608
|
-
});
|
|
65609
|
-
var Overview = OverviewDef.make({
|
|
65610
|
-
init: ({ props }) => ({
|
|
65611
|
-
policy: props.initialPolicy,
|
|
65612
|
-
sessions: Array.isArray(props.overview?.sessions) ? props.overview.sessions : [],
|
|
65613
|
-
overview: props.overview,
|
|
65614
|
-
models: props.models,
|
|
65615
|
-
policyError: props.policyError,
|
|
65616
|
-
buildMismatch: props.buildMismatch ?? false,
|
|
65617
|
-
settings: props.overview?.settings ?? null,
|
|
65618
|
-
engine: props.overview?.engine ?? null,
|
|
65619
|
-
selectOpen: null,
|
|
65620
|
-
pending: false,
|
|
65621
|
-
saveError: null,
|
|
65622
|
-
conflict: null
|
|
65623
|
-
}),
|
|
65624
|
-
// No subscription: the page holds no draft (the role chips commit through the
|
|
65625
|
-
// one settings write), so a Refresh reaches it as a remount with the fresh
|
|
65626
|
-
// document; there is nothing to preserve in place (Run 20 R-20-01 retired the
|
|
65627
|
-
// editor that needed it).
|
|
65628
|
-
update: {
|
|
65629
|
-
RequestedOpenSelect: ($, { path }) => $.evolve({ selectOpen: path }),
|
|
65630
|
-
RequestedCloseSelect: ($, { path }) => $.model.selectOpen === path ? $.evolve({ selectOpen: null }) : $.model,
|
|
65631
|
-
PickedRoleSetting: ($, { path, value: value3 }) => {
|
|
65632
|
-
if ($.model.pending) return $.model;
|
|
65633
|
-
const settings = $.model.settings;
|
|
65634
|
-
if (settings === null) return $.model;
|
|
65635
|
-
if (path === "engine.kind") return $.evolve({ selectOpen: null });
|
|
65636
|
-
if (path === "roles.l3.enabled") {
|
|
65637
|
-
if (value3 !== "enabled" && value3 !== "disabled") return $.evolve({ selectOpen: null });
|
|
65638
|
-
} else if (!modelItems(settings).some((item) => item.value === value3)) {
|
|
65639
|
-
return $.evolve({ selectOpen: null, saveError: "Unknown model" });
|
|
65640
|
-
}
|
|
65641
|
-
const next3 = withRoleSetting(settings, path, value3);
|
|
65642
|
-
return $.evolve({ selectOpen: null, saveError: null, conflict: null, pending: true }).run(
|
|
65643
|
-
SaveSettings.make({ settings, roles: next3.roles, path })
|
|
65644
|
-
);
|
|
65645
|
-
},
|
|
65646
|
-
SavedRoleSettings: ($, { settings, issue: issue2 }) => $.evolve({
|
|
65647
|
-
settings,
|
|
65648
|
-
pending: false,
|
|
65649
|
-
conflict: null,
|
|
65650
|
-
saveError: issue2 === null ? null : issue2.message
|
|
65651
|
-
}),
|
|
65652
|
-
RoleSettingsSaveFailed: ($, { path, value: value3, status, current: current3, field: field2, message }) => {
|
|
65653
|
-
const isConflict = status === 409;
|
|
65654
|
-
return $.evolve({
|
|
65655
|
-
...isConflict ? { settings: current3 } : {},
|
|
65656
|
-
conflict: isConflict ? { path, value: value3, rev: current3.rev } : null,
|
|
65657
|
-
pending: false,
|
|
65658
|
-
saveError: isConflict ? "Settings changed elsewhere \u2014 the latest document has been loaded" : status === 0 ? "Could not reach the host" : message !== "" ? message : "Could not save " + path + " (status " + status + ")"
|
|
65659
|
-
});
|
|
65660
|
-
},
|
|
65661
|
-
RetryRoleSave: ($) => {
|
|
65662
|
-
const settings = $.model.settings;
|
|
65663
|
-
const conflict = $.model.conflict;
|
|
65664
|
-
if (settings === null || conflict === null || $.model.pending) return $.model;
|
|
65665
|
-
const next3 = withRoleSetting(settings, conflict.path, conflict.value);
|
|
65666
|
-
return $.evolve({ conflict: null, saveError: null, pending: true }).run(
|
|
65667
|
-
SaveSettings.make({ settings, roles: next3.roles, path: conflict.path })
|
|
65668
|
-
);
|
|
65669
|
-
}
|
|
65670
|
-
},
|
|
65671
|
-
view: (h3, model) => {
|
|
65672
|
-
const status = engineStatus({ policy: model.policy, overview: model.overview });
|
|
65673
|
-
const settings = model.settings;
|
|
65674
|
-
const lines = settings === null ? [] : roleSentence({ settings, engine: model.engine });
|
|
65675
|
-
const selectOpen = (path) => model.selectOpen === path;
|
|
65676
|
-
const renderPart = (part) => {
|
|
65677
|
-
if (part.kind === "text") {
|
|
65678
|
-
return h3.span.class(part.mono === true ? "router-sentence-value" : "router-sentence-text").children(part.text);
|
|
65679
|
-
}
|
|
65680
|
-
const chip = part.chip;
|
|
65681
|
-
return SelectChip(h3, {
|
|
65682
|
-
name: chip.name,
|
|
65683
|
-
text: chip.label ?? chip.value,
|
|
65684
|
-
value: chip.value,
|
|
65685
|
-
items: chip.items,
|
|
65686
|
-
key: chip.path,
|
|
65687
|
-
open: selectOpen(chip.path),
|
|
65688
|
-
onOpen: OverviewMessage.RequestedOpenSelect({ path: chip.path }),
|
|
65689
|
-
onClose: OverviewMessage.RequestedCloseSelect({ path: chip.path }),
|
|
65690
|
-
onPick: (value3) => OverviewMessage.PickedRoleSetting({ path: chip.path, value: value3 })
|
|
65691
|
-
});
|
|
65692
|
-
};
|
|
65693
|
-
const meter = Meter(h3, {
|
|
65694
|
-
props: { value: status.valuePercent, min: 0, max: 100, valueText: status.readout },
|
|
65695
|
-
view: (engineMeter) => engineMeter.root(h3.div.class("router-meter")).attr("data-engine-tps", status.tps === null ? "none" : String(status.tps)).attr("data-floor-tps", String(status.floorTps)).attr("data-below-floor", status.belowFloor ? "" : void 0).children(
|
|
65696
|
-
h3.div.class("router-meter-head").children(
|
|
65697
|
-
engineMeter.label(h3.span.class("router-meter-label")).children("engine status"),
|
|
65698
|
-
engineMeter.value(h3.span.class("router-meter-value"))
|
|
65699
|
-
),
|
|
65700
|
-
engineMeter.track(h3.div.class("router-meter-track")).children(
|
|
65701
|
-
engineMeter.indicator(
|
|
65702
|
-
h3.div.class("router-meter-indicator").attr("data-meter-indicator", "").style({ background: status.belowFloor ? "var(--color-danger)" : "var(--color-ink)" })
|
|
65703
|
-
),
|
|
65704
|
-
// The floor is a tick on the same scale, never a second control.
|
|
65705
|
-
h3.div.class("router-meter-tick").attr("data-floor-tick", "").style({ left: "calc(" + status.floorPercent + "% - 1px)" })
|
|
65706
|
-
),
|
|
65707
|
-
h3.div.class("router-meter-status").children(status.statusLine)
|
|
65708
|
-
)
|
|
65709
|
-
});
|
|
65710
|
-
const sessions2 = model.sessions;
|
|
65711
|
-
const onCount = sessions2.filter((row) => row.enabled).length;
|
|
65712
|
-
const sessionsCard = h3.div.class("router-sessions").attr("data-sessions-card", "").children(
|
|
65713
|
-
h3.div.class("router-card-head").children(
|
|
65714
|
-
h3.span.class("router-caps-label").children("Sessions \xB7 routing"),
|
|
65715
|
-
h3.span.class("router-card-meta").children(
|
|
65716
|
-
sessions2.length === 0 ? "none" : `${onCount} of ${sessions2.length} routing`
|
|
65717
|
-
)
|
|
65718
|
-
),
|
|
65719
|
-
...sessions2.length === 0 ? [h3.div.class("router-recent-empty").children("No recent sessions")] : sessions2.map(
|
|
65720
|
-
(row) => h3.div.class("router-recent-row").attr("data-session-row", row.id).attr("data-session-state", row.enabled ? "on" : "off").children(
|
|
65721
|
-
h3.span.class("router-recent-time").children(OverviewSessionTime(row)),
|
|
65722
|
-
h3.span.class("router-recent-id").children(OverviewSessionLabel(row)),
|
|
65723
|
-
h3.span.class("router-recent-meta").children(
|
|
65724
|
-
(row.live ? "live \xB7 " : "") + (row.enabled ? "routing" : "not routing")
|
|
65725
|
-
)
|
|
65726
|
-
)
|
|
65727
|
-
),
|
|
65728
|
-
h3.p.class("router-session-hint").children(
|
|
65729
|
-
"Routing is turned on per session in the model picker."
|
|
65730
|
-
)
|
|
65731
|
-
);
|
|
65732
|
-
const recent = model.overview === null ? [] : model.overview.recent;
|
|
65733
|
-
return PageFrame(h3, {
|
|
65734
|
-
// Run 34 P3 (DEC-34-04 / DEC-34-07): no footer status line and no page
|
|
65735
|
-
// badge — the body starts on the sentence, as on the approved artboard.
|
|
65736
|
-
props: { variant: "railless" },
|
|
65737
|
-
slots: {
|
|
65738
|
-
content: h3.div.class("router-overview").children(
|
|
65739
|
-
// The sentence is the page's first content unit (DEC-34-07): the
|
|
65740
|
-
// statements come first, and a state notice follows them rather than
|
|
65741
|
-
// opening the page.
|
|
65742
|
-
h3.div.class("router-statements").children(
|
|
65743
|
-
...settings === null ? [
|
|
65744
|
-
h3.div.class("router-field-error").attr("data-error-layout", "page").attr("role", "alert").children("The settings document is unavailable \u2014 refresh to reload it")
|
|
65745
|
-
] : lines.map(
|
|
65746
|
-
(line) => h3.div.class("router-statement").attr("data-sentence", line.key).children(
|
|
65747
|
-
...line.parts.map(renderPart)
|
|
65748
|
-
)
|
|
65749
|
-
)
|
|
65750
|
-
),
|
|
65751
|
-
...model.saveError === null ? [] : [h3.div.class("router-field-error").attr("data-error-layout", "page").attr("role", "alert").attr("aria-live", "polite").children(model.saveError)],
|
|
65752
|
-
...model.conflict === null ? [] : [
|
|
65753
|
-
h3.div.class("router-conflict-notice").attr("role", "status").children(
|
|
65754
|
-
h3.span("Settings changed elsewhere \u2014 the latest document has been loaded"),
|
|
65755
|
-
Button(h3, { onPress: OverviewMessage.RetryRoleSave() }).class("router-conflict-action").attr("data-control", "").children("Use " + model.conflict.value)
|
|
65756
|
-
)
|
|
65757
|
-
],
|
|
65758
|
-
Separator(h3).class("router-rule"),
|
|
65759
|
-
meter,
|
|
65760
|
-
// Owner review (2026-12-05): the session list and the recent-calls list
|
|
65761
|
-
// are two tables. Each is its own raised panel with its own heading, so
|
|
65762
|
-
// they can never read as one continuous list.
|
|
65763
|
-
h3.div.class("router-card router-panel").attr("data-surface", "raised").attr("data-table", "sessions").children(sessionsCard),
|
|
65764
|
-
h3.div.class("router-card router-panel").attr("data-surface", "raised").attr("data-table", "recent").children(
|
|
65765
|
-
h3.div.class("router-card-head").children(
|
|
65766
|
-
h3.span.class("router-caps-label").children("Recent calls"),
|
|
65767
|
-
h3.span.class("router-card-meta").children(recent.length === 0 ? "none" : String(recent.length))
|
|
65768
|
-
),
|
|
65769
|
-
...recent.length === 0 ? [
|
|
65770
|
-
h3.div.class("router-recent-empty").children("No calls yet")
|
|
65771
|
-
] : recent.map(
|
|
65772
|
-
(row) => h3.div.class("router-recent-row").children(
|
|
65773
|
-
h3.span.class("router-recent-time").children(
|
|
65774
|
-
row.at.length >= 16 ? row.at.slice(11, 16) : row.at
|
|
65775
|
-
),
|
|
65776
|
-
h3.span.class("router-recent-id").children(row.requestId),
|
|
65777
|
-
h3.span.class("router-recent-meta").children(
|
|
65778
|
-
row.decision + " \xB7 " + row.model + (row.gate === null ? "" : " \xB7 " + row.gate)
|
|
65779
|
-
)
|
|
65780
|
-
)
|
|
65781
|
-
)
|
|
65782
|
-
)
|
|
65783
|
-
)
|
|
65784
|
-
}
|
|
65785
|
-
});
|
|
65786
|
-
}
|
|
65787
|
-
});
|
|
65788
|
-
if (typeof document !== "undefined" && document.head !== null) {
|
|
65789
|
-
injectRouterSheet(document, "overview", OverviewCss);
|
|
65790
|
-
}
|
|
65791
|
-
|
|
65792
|
-
// packages/plugin/client/mount.ts
|
|
65793
|
-
var devToolsEnabled = () => {
|
|
65794
|
-
try {
|
|
65795
|
-
const scope3 = globalThis;
|
|
65796
|
-
if (scope3.__ROUTER_DEVTOOLS__ === true) return true;
|
|
65797
|
-
if (scope3.localStorage?.getItem?.("routerDevtools") === "1") return true;
|
|
65798
|
-
const search = scope3.location?.search;
|
|
65799
|
-
return typeof search === "string" && /(?:^|[?&])devtools=1(?:&|$)/.test(search);
|
|
65800
|
-
} catch {
|
|
65801
|
-
return false;
|
|
65802
|
-
}
|
|
65803
|
-
};
|
|
65804
|
-
var hostLayer = (component2, props, container) => {
|
|
65805
|
-
const host = BrowserHost_exports.mount(component2, props, container, { head: false });
|
|
65806
|
-
if (!devToolsEnabled() || typeof document === "undefined") return host;
|
|
65807
|
-
const devTools2 = DevTools_exports.layer({
|
|
65808
|
-
position: "BottomRight",
|
|
65809
|
-
server: "http://127.0.0.1:4774"
|
|
65810
|
-
}).pipe(Layer_exports.provide(layerWebSocketConstructorGlobal));
|
|
65811
|
-
return host.pipe(Layer_exports.provide(devTools2));
|
|
65812
|
-
};
|
|
65813
|
-
var mountEffectPage = (component2, props, container) => {
|
|
65814
|
-
const fiber3 = Effect_exports.runFork(Layer_exports.launch(hostLayer(component2, props, container)));
|
|
65815
|
-
return {
|
|
65816
|
-
fiber: fiber3,
|
|
65817
|
-
dispose: async () => {
|
|
65818
|
-
await Effect_exports.runPromise(Fiber_exports.interrupt(fiber3));
|
|
65819
|
-
container.replaceChildren();
|
|
65820
|
-
}
|
|
65821
|
-
};
|
|
65822
|
-
};
|
|
65823
|
-
var noModelPolicy = {
|
|
65824
|
-
floorTps: 50,
|
|
65825
|
-
mainModel: null,
|
|
65826
|
-
advisoryModel: null,
|
|
65827
|
-
rev: 1
|
|
65828
|
-
};
|
|
65829
|
-
var mountRouter = (container, overview = null, extras = {}) => mountEffectPage(
|
|
65830
|
-
Overview,
|
|
65831
|
-
{
|
|
65832
|
-
initialPolicy: overview?.policy ?? noModelPolicy,
|
|
65833
|
-
overview: overview ?? null,
|
|
65834
|
-
models: extras.models ?? [],
|
|
65835
|
-
policyError: extras.policyError ?? null,
|
|
65836
|
-
buildMismatch: extras.buildMismatch === true
|
|
65837
|
-
},
|
|
65838
|
-
container
|
|
65839
|
-
);
|
|
65840
|
-
|
|
65841
|
-
// packages/plugin/client/keys.ts
|
|
65842
|
-
var isTypingTarget = (target2) => {
|
|
65843
|
-
const element = target2;
|
|
65844
|
-
if (element === null || element === void 0 || typeof element.tagName !== "string") return false;
|
|
65845
|
-
const tag2 = element.tagName.toUpperCase();
|
|
65846
|
-
return tag2 === "INPUT" || tag2 === "TEXTAREA" || tag2 === "SELECT" || element.isContentEditable === true;
|
|
65847
|
-
};
|
|
65848
|
-
|
|
65849
|
-
// packages/plugin/client/tab-mounts.ts
|
|
65850
|
-
var signatureOf = (value3) => {
|
|
65851
|
-
try {
|
|
65852
|
-
return JSON.stringify(value3) ?? "undefined";
|
|
65853
|
-
} catch {
|
|
65854
|
-
return "unserializable";
|
|
65855
|
-
}
|
|
65856
|
-
};
|
|
65857
|
-
var signatureForTab = (id2, inputs) => id2 === "overview" ? inputs.overviewError !== null ? "overview:error:" + inputs.overviewError : inputs.overview === null ? "overview:loading" : "overview:ready:" + inputs.mountKey : String(inputs.revision) + "|" + signatureOf(inputs.view);
|
|
65858
|
-
var planOverviewRefresh = (previousKey, nextKey, editorOpen) => {
|
|
65859
|
-
if (nextKey === previousKey) return { bumpKey: false, deliverEvent: false };
|
|
65860
|
-
return editorOpen ? { bumpKey: false, deliverEvent: true } : { bumpKey: true, deliverEvent: false };
|
|
65861
|
-
};
|
|
65862
|
-
var planTabs = (previous, activeId, activeSignature) => {
|
|
65863
|
-
const actions = [];
|
|
65864
|
-
for (const id2 of Object.keys(previous)) {
|
|
65865
|
-
if (id2 !== activeId) actions.push({ kind: "hide", id: id2 });
|
|
65866
|
-
}
|
|
65867
|
-
const current3 = previous[activeId];
|
|
65868
|
-
if (current3 === void 0) {
|
|
65869
|
-
actions.push({ kind: "mount", id: activeId, signature: activeSignature });
|
|
65870
|
-
return { actions, registry: { ...previous, [activeId]: { signature: activeSignature } } };
|
|
65871
|
-
}
|
|
65872
|
-
if (current3.signature === activeSignature) {
|
|
65873
|
-
actions.push({ kind: "activate", id: activeId });
|
|
65874
|
-
return { actions, registry: previous };
|
|
65875
|
-
}
|
|
65876
|
-
actions.push({ kind: "dispose", id: activeId });
|
|
65877
|
-
actions.push({ kind: "mount", id: activeId, signature: activeSignature });
|
|
65878
|
-
return { actions, registry: { ...previous, [activeId]: { signature: activeSignature } } };
|
|
65879
|
-
};
|
|
65880
|
-
var planDispose = (registry2) => ({
|
|
65881
|
-
actions: Object.keys(registry2).map((id2) => ({ kind: "dispose", id: id2 })),
|
|
65882
|
-
registry: {}
|
|
65883
|
-
});
|
|
65884
|
-
|
|
65885
|
-
// packages/domain/src/routing.ts
|
|
65886
|
-
var gates = ["residency", "headroom", "floor", "fallback"];
|
|
65887
|
-
var GateSchema = Schema_exports.Literals(gates);
|
|
65888
|
-
var routeTargets = ["local", "remote"];
|
|
65889
|
-
var RouteTargetSchema = Schema_exports.Literals(routeTargets);
|
|
65890
|
-
var PressureLevelSchema = Schema_exports.Literals(["ok", "soft", "hard"]);
|
|
65891
|
-
var DecisionSchema = Schema_exports.Struct({
|
|
65892
|
-
target: RouteTargetSchema,
|
|
65893
|
-
provider: Schema_exports.NullOr(Schema_exports.String),
|
|
65894
|
-
model: Schema_exports.NullOr(Schema_exports.String),
|
|
65895
|
-
gate: GateSchema,
|
|
65896
|
-
reason: Schema_exports.String,
|
|
65897
|
-
policyRev: Schema_exports.Number,
|
|
65898
|
-
floorTps: Schema_exports.Number,
|
|
65899
|
-
observedTps: Schema_exports.NullOr(Schema_exports.Number)
|
|
65900
|
-
});
|
|
65901
|
-
var decodeDecision = Schema_exports.decodeUnknownSync(DecisionSchema);
|
|
65902
|
-
|
|
65903
|
-
// packages/domain/src/ledger.ts
|
|
65904
|
-
var LedgerDecisionSchema = Schema_exports.Literals(["local", "remote"]);
|
|
65905
|
-
var LedgerGateLoadSchema = Schema_exports.Union([GateSchema, Schema_exports.Literal("scope")]);
|
|
65906
|
-
var LedgerScopeSchema = Schema_exports.Literals([
|
|
65907
|
-
"localAndRemote",
|
|
65908
|
-
"localOnly",
|
|
65909
|
-
"remoteOnly"
|
|
65910
|
-
]);
|
|
65911
|
-
var LedgerSurfaceSchema = Schema_exports.Literals([
|
|
65912
|
-
"pre-step",
|
|
65913
|
-
"router_route",
|
|
65914
|
-
"agent/status",
|
|
65915
|
-
"agent/inbox/claimed",
|
|
65916
|
-
"turn/start"
|
|
65917
|
-
]);
|
|
65918
|
-
var LedgerRoleSchema = Schema_exports.Literals(["l1", "l2", "l3", "advisor", "unknown"]);
|
|
65919
|
-
var LedgerSkipSchema = Schema_exports.Struct({
|
|
65920
|
-
model: Schema_exports.String,
|
|
65921
|
-
reason: Schema_exports.String
|
|
65922
|
-
});
|
|
65923
|
-
var LedgerRowSchema = Schema_exports.Struct({
|
|
65924
|
-
id: Schema_exports.String,
|
|
65925
|
-
requestId: Schema_exports.String,
|
|
65926
|
-
omlxRequestId: Schema_exports.NullOr(Schema_exports.String),
|
|
65927
|
-
agentId: Schema_exports.NullOr(Schema_exports.String),
|
|
65928
|
-
decision: LedgerDecisionSchema,
|
|
65929
|
-
model: Schema_exports.String,
|
|
65930
|
-
reason: Schema_exports.String,
|
|
65931
|
-
contextTokens: Schema_exports.Number,
|
|
65932
|
-
floorTps: Schema_exports.Number,
|
|
65933
|
-
latencyMs: Schema_exports.Number,
|
|
65934
|
-
at: Schema_exports.String,
|
|
65935
|
-
gate: Schema_exports.optional(LedgerGateLoadSchema),
|
|
65936
|
-
scope: Schema_exports.optional(LedgerScopeSchema),
|
|
65937
|
-
policyRev: Schema_exports.optional(Schema_exports.Number),
|
|
65938
|
-
role: Schema_exports.optional(LedgerRoleSchema),
|
|
65939
|
-
roleReason: Schema_exports.optional(Schema_exports.String),
|
|
65940
|
-
skips: Schema_exports.optional(Schema_exports.Array(LedgerSkipSchema)),
|
|
65941
|
-
turn: Schema_exports.optional(Schema_exports.Number),
|
|
65942
|
-
step: Schema_exports.optional(Schema_exports.Number),
|
|
65943
|
-
applied: Schema_exports.optional(Schema_exports.Boolean),
|
|
65944
|
-
surface: Schema_exports.optional(LedgerSurfaceSchema),
|
|
65945
|
-
limitation: Schema_exports.optional(Schema_exports.String),
|
|
65946
|
-
notAppliedReason: Schema_exports.optional(Schema_exports.String),
|
|
65947
|
-
appliedBy: Schema_exports.optional(Schema_exports.String),
|
|
65948
|
-
provider: Schema_exports.optional(Schema_exports.String),
|
|
65949
|
-
selectedModel: Schema_exports.optional(Schema_exports.String)
|
|
65950
|
-
});
|
|
65951
|
-
var decodeLedgerRow = Schema_exports.decodeUnknownSync(LedgerRowSchema);
|
|
65952
|
-
|
|
65953
|
-
// packages/domain/src/evidence.ts
|
|
65954
|
-
var tpsSources = ["live", "historical"];
|
|
65955
|
-
var TpsSourceSchema = Schema_exports.Literals(tpsSources);
|
|
65956
|
-
var EvidenceStatsSchema = Schema_exports.Struct({
|
|
65957
|
-
avgGenerationTps: Schema_exports.Number,
|
|
65958
|
-
avgPrefillTps: Schema_exports.Number,
|
|
65959
|
-
totalRequests: Schema_exports.Number,
|
|
65960
|
-
totalCachedTokens: Schema_exports.Number,
|
|
65961
|
-
cacheEfficiency: Schema_exports.Number,
|
|
65962
|
-
uptimeSeconds: Schema_exports.Number
|
|
65963
|
-
});
|
|
65964
|
-
var EvidenceActivitySchema = Schema_exports.Struct({
|
|
65965
|
-
activeRequests: Schema_exports.Number,
|
|
65966
|
-
waitingRequests: Schema_exports.Number,
|
|
65967
|
-
memoryUsedBytes: Schema_exports.Number,
|
|
65968
|
-
memoryMaxBytes: Schema_exports.Number,
|
|
65969
|
-
// F-37-48: the engine's soft memory limit (the guard), null when unreported.
|
|
65970
|
-
memorySoftBytes: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
65971
|
-
});
|
|
65972
|
-
var EvidenceDeviceSchema = Schema_exports.Struct({
|
|
65973
|
-
chipName: Schema_exports.String,
|
|
65974
|
-
memoryGb: Schema_exports.Number,
|
|
65975
|
-
gpuCores: Schema_exports.Number
|
|
65976
|
-
});
|
|
65977
|
-
var EvidenceModelSchema = Schema_exports.Struct({
|
|
65978
|
-
id: Schema_exports.String,
|
|
65979
|
-
preferred: Schema_exports.Boolean,
|
|
65980
|
-
pinned: Schema_exports.Boolean,
|
|
65981
|
-
contextLength: Schema_exports.NullOr(Schema_exports.Number),
|
|
65982
|
-
sizeBytes: Schema_exports.NullOr(Schema_exports.Number),
|
|
65983
|
-
tps: Schema_exports.NullOr(Schema_exports.Number)
|
|
65984
|
-
});
|
|
65985
|
-
var EvidenceTelemetrySchema = Schema_exports.Struct({
|
|
65986
|
-
fetchedAt: Schema_exports.String,
|
|
65987
|
-
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
65988
|
-
observedTpsSource: Schema_exports.NullOr(TpsSourceSchema),
|
|
65989
|
-
headroomRatio: Schema_exports.Number,
|
|
65990
|
-
engineMax: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
65991
|
-
pressureLevel: PressureLevelSchema,
|
|
65992
|
-
residentModels: Schema_exports.Array(Schema_exports.String),
|
|
65993
|
-
models: Schema_exports.Array(EvidenceModelSchema),
|
|
65994
|
-
preferredModel: Schema_exports.NullOr(Schema_exports.String),
|
|
65995
|
-
stats: EvidenceStatsSchema,
|
|
65996
|
-
activity: EvidenceActivitySchema,
|
|
65997
|
-
device: EvidenceDeviceSchema
|
|
65998
|
-
});
|
|
65999
|
-
var telemetryErrorKinds = [
|
|
66000
|
-
"http",
|
|
66001
|
-
"network",
|
|
66002
|
-
"timeout",
|
|
66003
|
-
"parse",
|
|
66004
|
-
"validation",
|
|
66005
|
-
"unknown"
|
|
66006
|
-
];
|
|
66007
|
-
var EvidenceTelemetryErrorSchema = Schema_exports.Struct({
|
|
66008
|
-
kind: Schema_exports.Literals(telemetryErrorKinds),
|
|
66009
|
-
message: Schema_exports.String,
|
|
66010
|
-
status: Schema_exports.NullOr(Schema_exports.Number),
|
|
66011
|
-
retryable: Schema_exports.Boolean
|
|
66012
|
-
});
|
|
66013
|
-
var EvidenceTelemetryStateSchema = Schema_exports.Struct({
|
|
66014
|
-
snapshot: Schema_exports.NullOr(EvidenceTelemetrySchema),
|
|
66015
|
-
error: Schema_exports.NullOr(EvidenceTelemetryErrorSchema),
|
|
66016
|
-
readAt: Schema_exports.NullOr(Schema_exports.String)
|
|
66017
|
-
});
|
|
66018
|
-
var EvidenceSchema = Schema_exports.Struct({
|
|
66019
|
-
fetchedAt: Schema_exports.String,
|
|
66020
|
-
staleAt: Schema_exports.NullOr(Schema_exports.String),
|
|
66021
|
-
policy: PolicySchema,
|
|
66022
|
-
ledger: Schema_exports.Struct({
|
|
66023
|
-
rows: Schema_exports.Array(LedgerRowSchema)
|
|
66024
|
-
}),
|
|
66025
|
-
telemetry: EvidenceTelemetryStateSchema
|
|
66026
|
-
});
|
|
66027
|
-
var BackendSchema = Schema_exports.Struct({
|
|
66028
|
-
kind: Schema_exports.String
|
|
66029
|
-
});
|
|
66030
|
-
var TelemetryStateNameSchema = Schema_exports.Literals([
|
|
66031
|
-
"ok",
|
|
66032
|
-
"stale",
|
|
66033
|
-
"empty",
|
|
66034
|
-
"error"
|
|
66035
|
-
]);
|
|
66036
|
-
var ModelsStatusSchema = Schema_exports.Literals([
|
|
66037
|
-
"ready",
|
|
66038
|
-
"degraded",
|
|
66039
|
-
"stale",
|
|
66040
|
-
"empty",
|
|
66041
|
-
"error"
|
|
66042
|
-
]);
|
|
66043
|
-
var ModelsKpisSchema = Schema_exports.Struct({
|
|
66044
|
-
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
66045
|
-
observedTpsSource: Schema_exports.NullOr(TpsSourceSchema),
|
|
66046
|
-
headroomRatio: Schema_exports.Number,
|
|
66047
|
-
engineMax: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
66048
|
-
pressureLevel: PressureLevelSchema,
|
|
66049
|
-
activeRequests: Schema_exports.Number,
|
|
66050
|
-
waitingRequests: Schema_exports.Number,
|
|
66051
|
-
totalRequests: Schema_exports.Number,
|
|
66052
|
-
cacheEfficiency: Schema_exports.Number,
|
|
66053
|
-
uptimeSeconds: Schema_exports.Number,
|
|
66054
|
-
memoryUsedBytes: Schema_exports.Number,
|
|
66055
|
-
memoryMaxBytes: Schema_exports.Number,
|
|
66056
|
-
// F-37-48: the engine's soft memory limit (the guard) for the Models header.
|
|
66057
|
-
memorySoftBytes: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
66058
|
-
});
|
|
66059
|
-
var ModelCapabilityFields = {
|
|
66060
|
-
contextWindow: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
66061
|
-
inputModalities: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Array(Schema_exports.String)))
|
|
66062
|
-
};
|
|
66063
|
-
var ModelsResidentSchema = Schema_exports.Struct({
|
|
66064
|
-
id: Schema_exports.String,
|
|
66065
|
-
preferred: Schema_exports.Boolean,
|
|
66066
|
-
selected: Schema_exports.Boolean,
|
|
66067
|
-
// F-37-48: the role ids whose settings chain routes to this model, so the page
|
|
66068
|
-
// can label it by what it actually serves (l1 | l2 | l3 | advisor).
|
|
66069
|
-
roles: Schema_exports.optional(Schema_exports.Array(Schema_exports.String)),
|
|
66070
|
-
// F-37-48: the fresh probe/measured reading for this model (null when none).
|
|
66071
|
-
tps: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
66072
|
-
...ModelCapabilityFields
|
|
66073
|
-
});
|
|
66074
|
-
var RemoteModelSchema = Schema_exports.Struct({
|
|
66075
|
-
provider: Schema_exports.String,
|
|
66076
|
-
model: Schema_exports.String,
|
|
66077
|
-
role: Schema_exports.Literals(["main", "advisory"]),
|
|
66078
|
-
roles: Schema_exports.optional(Schema_exports.Array(Schema_exports.String)),
|
|
66079
|
-
label: Schema_exports.optional(Schema_exports.String)
|
|
66080
|
-
});
|
|
66081
|
-
var ModelsViewSchema = Schema_exports.Struct({
|
|
66082
|
-
status: ModelsStatusSchema,
|
|
66083
|
-
selectedModel: Schema_exports.String,
|
|
66084
|
-
preferredModel: Schema_exports.NullOr(Schema_exports.String),
|
|
66085
|
-
residents: Schema_exports.Array(ModelsResidentSchema),
|
|
66086
|
-
remoteModels: Schema_exports.Array(RemoteModelSchema),
|
|
66087
|
-
pool: Schema_exports.optional(Schema_exports.Struct({ models: Schema_exports.Number, residents: Schema_exports.Number, remote: Schema_exports.Number })),
|
|
66088
|
-
models: Schema_exports.optional(
|
|
66089
|
-
Schema_exports.Array(
|
|
66090
|
-
Schema_exports.Struct({
|
|
66091
|
-
id: Schema_exports.String,
|
|
66092
|
-
local: Schema_exports.Boolean,
|
|
66093
|
-
preferred: Schema_exports.Boolean,
|
|
66094
|
-
selected: Schema_exports.Boolean,
|
|
66095
|
-
...ModelCapabilityFields
|
|
66096
|
-
})
|
|
66097
|
-
)
|
|
66098
|
-
),
|
|
66099
|
-
selected: Schema_exports.optional(Schema_exports.String),
|
|
66100
|
-
pressure: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Literals(["ok", "soft", "hard"]))),
|
|
66101
|
-
staleAt: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)),
|
|
66102
|
-
capabilities: Schema_exports.optional(Schema_exports.Unknown),
|
|
66103
|
-
kpis: Schema_exports.NullOr(ModelsKpisSchema)
|
|
66104
|
-
});
|
|
66105
|
-
var DecisionTpsSourceSchema = Schema_exports.Literals(["measured", "probe", "unknown"]);
|
|
66106
|
-
var CurrentDecisionSchema = Schema_exports.Struct({
|
|
66107
|
-
id: Schema_exports.String,
|
|
66108
|
-
requestId: Schema_exports.String,
|
|
66109
|
-
decision: LedgerDecisionSchema,
|
|
66110
|
-
gate: Schema_exports.NullOr(LedgerGateLoadSchema),
|
|
66111
|
-
model: Schema_exports.String,
|
|
66112
|
-
reason: Schema_exports.String,
|
|
66113
|
-
at: Schema_exports.String,
|
|
66114
|
-
applied: Schema_exports.NullOr(Schema_exports.Boolean),
|
|
66115
|
-
role: Schema_exports.optional(LedgerRoleSchema),
|
|
66116
|
-
skips: Schema_exports.optional(Schema_exports.Array(LedgerSkipSchema)),
|
|
66117
|
-
notAppliedReason: Schema_exports.optional(Schema_exports.String),
|
|
66118
|
-
tpsSource: Schema_exports.optional(DecisionTpsSourceSchema),
|
|
66119
|
-
/**
|
|
66120
|
-
* The session ceiling the decision was admitted under (R-36-10). Optional and
|
|
66121
|
-
* nullable so a payload recorded before the ceiling existed still decodes.
|
|
66122
|
-
*/
|
|
66123
|
-
concurrencyCeiling: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number))
|
|
66124
|
-
});
|
|
66125
|
-
var RoutingViewSchema = Schema_exports.Struct({
|
|
66126
|
-
gates: Schema_exports.Array(GateSchema),
|
|
66127
|
-
policyRev: Schema_exports.Number,
|
|
66128
|
-
current: Schema_exports.NullOr(CurrentDecisionSchema),
|
|
66129
|
-
counts: Schema_exports.Struct({
|
|
66130
|
-
local: Schema_exports.Number,
|
|
66131
|
-
remote: Schema_exports.Number,
|
|
66132
|
-
total: Schema_exports.Number
|
|
66133
|
-
}),
|
|
66134
|
-
policy: Schema_exports.optional(
|
|
66135
|
-
Schema_exports.Struct({
|
|
66136
|
-
floorTps: Schema_exports.Number,
|
|
66137
|
-
mainModel: Schema_exports.String,
|
|
66138
|
-
rev: Schema_exports.Number
|
|
66139
|
-
})
|
|
66140
|
-
),
|
|
66141
|
-
order: Schema_exports.optional(
|
|
66142
|
-
Schema_exports.Array(
|
|
66143
|
-
Schema_exports.Struct({ n: Schema_exports.Number, name: Schema_exports.String, description: Schema_exports.String, source: Schema_exports.String })
|
|
66144
|
-
)
|
|
66145
|
-
),
|
|
66146
|
-
escapes: Schema_exports.optional(Schema_exports.Array(Schema_exports.Struct({ gate: Schema_exports.String, count: Schema_exports.Number }))),
|
|
66147
|
-
ceiling: Schema_exports.optional(
|
|
66148
|
-
Schema_exports.NullOr(
|
|
66149
|
-
Schema_exports.Struct({
|
|
66150
|
-
model: Schema_exports.NullOr(Schema_exports.String),
|
|
66151
|
-
observedTps: Schema_exports.NullOr(Schema_exports.Number),
|
|
66152
|
-
active: Schema_exports.Number,
|
|
66153
|
-
waiting: Schema_exports.Number,
|
|
66154
|
-
slots: Schema_exports.optional(Schema_exports.Number),
|
|
66155
|
-
contextBucket: Schema_exports.optional(Schema_exports.String)
|
|
66156
|
-
})
|
|
66157
|
-
)
|
|
66158
|
-
),
|
|
66159
|
-
contextBuckets: Schema_exports.optional(Schema_exports.Array(Schema_exports.Struct({ label: Schema_exports.String, admitted: Schema_exports.Number }))),
|
|
66160
|
-
limits: Schema_exports.optional(
|
|
66161
|
-
Schema_exports.Struct({
|
|
66162
|
-
floorTps: Schema_exports.Number,
|
|
66163
|
-
engineMax: Schema_exports.NullOr(Schema_exports.Number),
|
|
66164
|
-
memoryMaxBytes: Schema_exports.NullOr(Schema_exports.Number)
|
|
66165
|
-
})
|
|
66166
|
-
),
|
|
66167
|
-
pinned: Schema_exports.optional(Schema_exports.Array(Schema_exports.String))
|
|
66168
|
-
});
|
|
66169
|
-
var ActivityViewSchema = Schema_exports.Struct({
|
|
66170
|
-
nextCursor: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.String)),
|
|
66171
|
-
rows: Schema_exports.optional(Schema_exports.Array(Schema_exports.Unknown)),
|
|
66172
|
-
joined: Schema_exports.optional(
|
|
66173
|
-
Schema_exports.Struct({ total: Schema_exports.Number, linked: Schema_exports.Number, missing: Schema_exports.Number })
|
|
66174
|
-
),
|
|
66175
|
-
kpis: Schema_exports.Struct({
|
|
66176
|
-
total: Schema_exports.Number,
|
|
66177
|
-
local: Schema_exports.Number,
|
|
66178
|
-
remote: Schema_exports.Number,
|
|
66179
|
-
applied: Schema_exports.Number,
|
|
66180
|
-
lastAt: Schema_exports.NullOr(Schema_exports.String)
|
|
66181
|
-
})
|
|
66182
|
-
});
|
|
66183
|
-
var ModelsPayloadSchema = Schema_exports.Struct({
|
|
66184
|
-
kind: Schema_exports.Literals(["models"]),
|
|
66185
|
-
backend: BackendSchema,
|
|
66186
|
-
evidence: EvidenceSchema,
|
|
66187
|
-
view: ModelsViewSchema
|
|
66188
|
-
});
|
|
66189
|
-
var RoutingPayloadSchema = Schema_exports.Struct({
|
|
66190
|
-
kind: Schema_exports.Literals(["routing"]),
|
|
66191
|
-
backend: BackendSchema,
|
|
66192
|
-
evidence: EvidenceSchema,
|
|
66193
|
-
view: RoutingViewSchema
|
|
66194
|
-
});
|
|
66195
|
-
var ActivityPayloadSchema = Schema_exports.Struct({
|
|
66196
|
-
kind: Schema_exports.Literals(["activity"]),
|
|
66197
|
-
backend: BackendSchema,
|
|
66198
|
-
evidence: EvidenceSchema,
|
|
66199
|
-
view: ActivityViewSchema
|
|
66200
|
-
});
|
|
66201
|
-
var EngineAdapterEntrySchema = Schema_exports.Struct({
|
|
66202
|
-
id: Schema_exports.String,
|
|
66203
|
-
label: Schema_exports.String,
|
|
66204
|
-
current: Schema_exports.Boolean,
|
|
66205
|
-
enabled: Schema_exports.Boolean
|
|
66206
|
-
});
|
|
66207
|
-
var EngineAdapterSchema = Schema_exports.Struct({
|
|
66208
|
-
kind: Schema_exports.String,
|
|
66209
|
-
label: Schema_exports.String,
|
|
66210
|
-
version: Schema_exports.String,
|
|
66211
|
-
adapters: Schema_exports.Array(EngineAdapterEntrySchema)
|
|
66212
|
-
});
|
|
66213
|
-
var EngineConnectionSchema = Schema_exports.Struct({
|
|
66214
|
-
endpoint: Schema_exports.String,
|
|
66215
|
-
authKind: Schema_exports.Literals(["bearer", "none"]),
|
|
66216
|
-
keyPresent: Schema_exports.Boolean,
|
|
66217
|
-
keyHint: Schema_exports.String,
|
|
66218
|
-
source: Schema_exports.Literals(["config", "environment", "default"])
|
|
66219
|
-
});
|
|
66220
|
-
var CapabilityReportSchema = Schema_exports.Struct({
|
|
66221
|
-
fetchedAt: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Number)),
|
|
66222
|
-
sources: Schema_exports.optional(
|
|
66223
|
-
Schema_exports.Struct({
|
|
66224
|
-
models: Schema_exports.optional(Schema_exports.Boolean),
|
|
66225
|
-
admin: Schema_exports.optional(Schema_exports.Boolean)
|
|
66226
|
-
})
|
|
66227
|
-
),
|
|
66228
|
-
advertised: Schema_exports.optional(Schema_exports.Number),
|
|
66229
|
-
excluded: Schema_exports.optional(Schema_exports.Unknown),
|
|
66230
|
-
stale: Schema_exports.optional(Schema_exports.Boolean),
|
|
66231
|
-
drift: Schema_exports.optional(Schema_exports.Unknown)
|
|
66232
|
-
});
|
|
66233
|
-
var HealthCapabilitySummarySchema = Schema_exports.Struct({
|
|
66234
|
-
sources: Schema_exports.Struct({ models: Schema_exports.optional(Schema_exports.Boolean), admin: Schema_exports.optional(Schema_exports.Boolean) }),
|
|
66235
|
-
advertised: Schema_exports.Number,
|
|
66236
|
-
excluded: Schema_exports.Number,
|
|
66237
|
-
drift: Schema_exports.optional(Schema_exports.NullOr(Schema_exports.Boolean)),
|
|
66238
|
-
driftKeys: Schema_exports.optional(Schema_exports.Array(Schema_exports.String))
|
|
66239
|
-
});
|
|
66240
|
-
var EngineHealthSchema = Schema_exports.Struct({
|
|
66241
|
-
status: Schema_exports.Literals(["healthy", "unreachable", "unknown"]),
|
|
66242
|
-
httpStatus: Schema_exports.NullOr(Schema_exports.Number),
|
|
66243
|
-
latencyMs: Schema_exports.NullOr(Schema_exports.Number),
|
|
66244
|
-
checkedAt: Schema_exports.NullOr(Schema_exports.String),
|
|
66245
|
-
message: Schema_exports.NullOr(Schema_exports.String)
|
|
66246
|
-
});
|
|
66247
|
-
var EngineModelSchema = Schema_exports.Struct({
|
|
66248
|
-
id: Schema_exports.String,
|
|
66249
|
-
default: Schema_exports.Boolean,
|
|
66250
|
-
loaded: Schema_exports.Boolean
|
|
66251
|
-
});
|
|
66252
|
-
var EnginePayloadSchema = Schema_exports.Struct({
|
|
66253
|
-
kind: Schema_exports.Literals(["engine"]),
|
|
66254
|
-
backend: BackendSchema,
|
|
66255
|
-
adapter: EngineAdapterSchema,
|
|
66256
|
-
connection: EngineConnectionSchema,
|
|
66257
|
-
health: EngineHealthSchema,
|
|
66258
|
-
capabilities: Schema_exports.optional(Schema_exports.NullOr(CapabilityReportSchema)),
|
|
66259
|
-
models: Schema_exports.Array(EngineModelSchema),
|
|
66260
|
-
discovery: Schema_exports.Struct({
|
|
66261
|
-
discovered: Schema_exports.Number,
|
|
66262
|
-
resident: Schema_exports.Number
|
|
66263
|
-
}),
|
|
66264
|
-
config: Schema_exports.Struct({
|
|
66265
|
-
writable: Schema_exports.Boolean,
|
|
66266
|
-
note: Schema_exports.String
|
|
66267
|
-
}),
|
|
66268
|
-
evidence: EvidenceSchema
|
|
66269
|
-
});
|
|
66270
|
-
var EngineSavePayloadSchema = Schema_exports.Struct({
|
|
66271
|
-
endpoint: Schema_exports.String,
|
|
66272
|
-
apiKey: Schema_exports.String
|
|
66273
|
-
});
|
|
66274
|
-
var EngineSaveErrorSchema = Schema_exports.Struct({
|
|
66275
|
-
ok: Schema_exports.Literal(false),
|
|
66276
|
-
error: Schema_exports.Struct({
|
|
66277
|
-
field: Schema_exports.String,
|
|
66278
|
-
message: Schema_exports.String
|
|
66279
|
-
})
|
|
66292
|
+
saveError: Schema_exports.NullOr(Schema_exports.String),
|
|
66293
|
+
// A 409's attempted change, offered as a retry against the adopted rev.
|
|
66294
|
+
conflict: Schema_exports.NullOr(
|
|
66295
|
+
Schema_exports.Struct({ path: Schema_exports.String, value: Schema_exports.String, rev: Schema_exports.Number })
|
|
66296
|
+
)
|
|
66297
|
+
}),
|
|
66298
|
+
message: OverviewMessage
|
|
66280
66299
|
});
|
|
66281
|
-
var
|
|
66282
|
-
|
|
66283
|
-
|
|
66284
|
-
|
|
66285
|
-
|
|
66286
|
-
|
|
66287
|
-
|
|
66288
|
-
|
|
66289
|
-
|
|
66290
|
-
|
|
66291
|
-
|
|
66292
|
-
|
|
66293
|
-
|
|
66294
|
-
|
|
66295
|
-
|
|
66296
|
-
|
|
66297
|
-
|
|
66298
|
-
|
|
66299
|
-
|
|
66300
|
-
|
|
66301
|
-
|
|
66300
|
+
var Overview = OverviewDef.make({
|
|
66301
|
+
init: ({ props }) => ({
|
|
66302
|
+
policy: props.initialPolicy,
|
|
66303
|
+
sessions: Array.isArray(props.overview?.sessions) ? props.overview.sessions : [],
|
|
66304
|
+
overview: props.overview,
|
|
66305
|
+
models: props.models,
|
|
66306
|
+
policyError: props.policyError,
|
|
66307
|
+
buildMismatch: props.buildMismatch ?? false,
|
|
66308
|
+
settings: props.overview?.settings ?? null,
|
|
66309
|
+
engine: props.overview?.engine ?? null,
|
|
66310
|
+
selectOpen: null,
|
|
66311
|
+
pending: false,
|
|
66312
|
+
saveError: null,
|
|
66313
|
+
conflict: null
|
|
66314
|
+
}),
|
|
66315
|
+
// No subscription: the page holds no draft (the role chips commit through the
|
|
66316
|
+
// one settings write), so a Refresh reaches it as a remount with the fresh
|
|
66317
|
+
// document; there is nothing to preserve in place (Run 20 R-20-01 retired the
|
|
66318
|
+
// editor that needed it).
|
|
66319
|
+
update: {
|
|
66320
|
+
RequestedOpenSelect: ($, { path }) => $.evolve({ selectOpen: path }),
|
|
66321
|
+
RequestedCloseSelect: ($, { path }) => $.model.selectOpen === path ? $.evolve({ selectOpen: null }) : $.model,
|
|
66322
|
+
PickedRoleSetting: ($, { path, value: value3 }) => {
|
|
66323
|
+
if ($.model.pending) return $.model;
|
|
66324
|
+
const settings = $.model.settings;
|
|
66325
|
+
if (settings === null) return $.model;
|
|
66326
|
+
if (path === "engine.kind") return $.evolve({ selectOpen: null });
|
|
66327
|
+
if (path === "roles.l3.enabled") {
|
|
66328
|
+
if (value3 !== "enabled" && value3 !== "disabled") return $.evolve({ selectOpen: null });
|
|
66329
|
+
} else if (!modelItems(settings).some((item) => item.value === value3)) {
|
|
66330
|
+
return $.evolve({ selectOpen: null, saveError: "Unknown model" });
|
|
66331
|
+
}
|
|
66332
|
+
const next3 = withRoleSetting(settings, path, value3);
|
|
66333
|
+
return $.evolve({ selectOpen: null, saveError: null, conflict: null, pending: true }).run(
|
|
66334
|
+
SaveSettings.make({ settings, roles: next3.roles, path })
|
|
66335
|
+
);
|
|
66336
|
+
},
|
|
66337
|
+
SavedRoleSettings: ($, { settings, issue: issue2 }) => $.evolve({
|
|
66338
|
+
settings,
|
|
66339
|
+
pending: false,
|
|
66340
|
+
conflict: null,
|
|
66341
|
+
saveError: issue2 === null ? null : issue2.message
|
|
66342
|
+
}),
|
|
66343
|
+
RoleSettingsSaveFailed: ($, { path, value: value3, status, current: current3, field: field2, message }) => {
|
|
66344
|
+
const isConflict = status === 409;
|
|
66345
|
+
return $.evolve({
|
|
66346
|
+
...isConflict ? { settings: current3 } : {},
|
|
66347
|
+
conflict: isConflict ? { path, value: value3, rev: current3.rev } : null,
|
|
66348
|
+
pending: false,
|
|
66349
|
+
saveError: isConflict ? "Settings changed elsewhere \u2014 the latest document has been loaded" : status === 0 ? "Could not reach the host" : message !== "" ? message : "Could not save " + path + " (status " + status + ")"
|
|
66350
|
+
});
|
|
66351
|
+
},
|
|
66352
|
+
RetryRoleSave: ($) => {
|
|
66353
|
+
const settings = $.model.settings;
|
|
66354
|
+
const conflict = $.model.conflict;
|
|
66355
|
+
if (settings === null || conflict === null || $.model.pending) return $.model;
|
|
66356
|
+
const next3 = withRoleSetting(settings, conflict.path, conflict.value);
|
|
66357
|
+
return $.evolve({ conflict: null, saveError: null, pending: true }).run(
|
|
66358
|
+
SaveSettings.make({ settings, roles: next3.roles, path: conflict.path })
|
|
66359
|
+
);
|
|
66360
|
+
}
|
|
66361
|
+
},
|
|
66362
|
+
view: (h3, model) => {
|
|
66363
|
+
const status = engineStatus({ policy: model.policy, overview: model.overview });
|
|
66364
|
+
const settings = model.settings;
|
|
66365
|
+
const lines = settings === null ? [] : roleSentence({ settings, engine: model.engine });
|
|
66366
|
+
const selectOpen = (path) => model.selectOpen === path;
|
|
66367
|
+
const renderPart = (part) => {
|
|
66368
|
+
if (part.kind === "text") {
|
|
66369
|
+
return h3.span.class(part.mono === true ? "router-sentence-value" : "router-sentence-text").children(part.text);
|
|
66370
|
+
}
|
|
66371
|
+
const chip = part.chip;
|
|
66372
|
+
return SelectChip(h3, {
|
|
66373
|
+
name: chip.name,
|
|
66374
|
+
text: chip.label ?? chip.value,
|
|
66375
|
+
value: chip.value,
|
|
66376
|
+
items: chip.items,
|
|
66377
|
+
key: chip.path,
|
|
66378
|
+
open: selectOpen(chip.path),
|
|
66379
|
+
onOpen: OverviewMessage.RequestedOpenSelect({ path: chip.path }),
|
|
66380
|
+
onClose: OverviewMessage.RequestedCloseSelect({ path: chip.path }),
|
|
66381
|
+
onPick: (value3) => OverviewMessage.PickedRoleSetting({ path: chip.path, value: value3 })
|
|
66382
|
+
});
|
|
66383
|
+
};
|
|
66384
|
+
const meter2 = Meter(h3, {
|
|
66385
|
+
props: { value: status.valuePercent, min: 0, max: 100, valueText: status.readout },
|
|
66386
|
+
view: (engineMeter) => engineMeter.root(h3.div.class("router-meter")).attr("data-engine-tps", status.tps === null ? "none" : String(status.tps)).attr("data-floor-tps", String(status.floorTps)).attr("data-below-floor", status.belowFloor ? "" : void 0).children(
|
|
66387
|
+
h3.div.class("router-meter-head").children(
|
|
66388
|
+
engineMeter.label(h3.span.class("router-meter-label")).children("engine status"),
|
|
66389
|
+
engineMeter.value(h3.span.class("router-meter-value"))
|
|
66390
|
+
),
|
|
66391
|
+
engineMeter.track(h3.div.class("router-meter-track")).children(
|
|
66392
|
+
engineMeter.indicator(
|
|
66393
|
+
h3.div.class("router-meter-indicator").attr("data-meter-indicator", "").style({ background: status.belowFloor ? "var(--color-danger)" : "var(--color-ink)" })
|
|
66394
|
+
),
|
|
66395
|
+
// The floor is a tick on the same scale, never a second control.
|
|
66396
|
+
h3.div.class("router-meter-tick").attr("data-floor-tick", "").style({ left: "calc(" + status.floorPercent + "% - 1px)" })
|
|
66397
|
+
),
|
|
66398
|
+
h3.div.class("router-meter-status").children(status.statusLine)
|
|
66399
|
+
)
|
|
66400
|
+
});
|
|
66401
|
+
const sessions2 = model.sessions;
|
|
66402
|
+
const onCount = sessions2.filter((row) => row.enabled).length;
|
|
66403
|
+
const sessionsCard = h3.div.class("router-sessions").attr("data-sessions-card", "").children(
|
|
66404
|
+
h3.div.class("router-card-head").children(
|
|
66405
|
+
h3.span.class("router-caps-label").children("Sessions \xB7 routing"),
|
|
66406
|
+
h3.span.class("router-card-meta").children(
|
|
66407
|
+
sessions2.length === 0 ? "none" : `${onCount} of ${sessions2.length} routing`
|
|
66408
|
+
)
|
|
66409
|
+
),
|
|
66410
|
+
...sessions2.length === 0 ? [h3.div.class("router-recent-empty").children("No recent sessions")] : sessions2.map(
|
|
66411
|
+
(row) => h3.div.class("router-recent-row").attr("data-session-row", row.id).attr("data-session-state", row.enabled ? "on" : "off").children(
|
|
66412
|
+
h3.span.class("router-recent-time").children(OverviewSessionTime(row)),
|
|
66413
|
+
h3.span.class("router-recent-id").children(OverviewSessionLabel(row)),
|
|
66414
|
+
h3.span.class("router-recent-meta").children(
|
|
66415
|
+
(row.live ? "live \xB7 " : "") + (row.enabled ? "routing" : "not routing")
|
|
66416
|
+
)
|
|
66417
|
+
)
|
|
66418
|
+
),
|
|
66419
|
+
h3.p.class("router-session-hint").children(
|
|
66420
|
+
"Routing is turned on per session in the model picker."
|
|
66421
|
+
)
|
|
66422
|
+
);
|
|
66423
|
+
const recent = model.overview === null ? [] : model.overview.recent;
|
|
66424
|
+
return PageFrame(h3, {
|
|
66425
|
+
// Run 34 P3 (DEC-34-04 / DEC-34-07): no footer status line and no page
|
|
66426
|
+
// badge — the body starts on the sentence, as on the approved artboard.
|
|
66427
|
+
props: { variant: "railless" },
|
|
66428
|
+
slots: {
|
|
66429
|
+
content: h3.div.class("router-overview").children(
|
|
66430
|
+
// The sentence is the page's first content unit (DEC-34-07): the
|
|
66431
|
+
// statements come first, and a state notice follows them rather than
|
|
66432
|
+
// opening the page.
|
|
66433
|
+
h3.div.class("router-statements").children(
|
|
66434
|
+
...settings === null ? [
|
|
66435
|
+
h3.div.class("router-field-error").attr("data-error-layout", "page").attr("role", "alert").children("The settings document is unavailable \u2014 refresh to reload it")
|
|
66436
|
+
] : lines.map(
|
|
66437
|
+
(line) => h3.div.class("router-statement").attr("data-sentence", line.key).children(
|
|
66438
|
+
...line.parts.map(renderPart)
|
|
66439
|
+
)
|
|
66440
|
+
)
|
|
66441
|
+
),
|
|
66442
|
+
...model.saveError === null ? [] : [h3.div.class("router-field-error").attr("data-error-layout", "page").attr("role", "alert").attr("aria-live", "polite").children(model.saveError)],
|
|
66443
|
+
...model.conflict === null ? [] : [
|
|
66444
|
+
h3.div.class("router-conflict-notice").attr("role", "status").children(
|
|
66445
|
+
h3.span("Settings changed elsewhere \u2014 the latest document has been loaded"),
|
|
66446
|
+
Button(h3, { onPress: OverviewMessage.RetryRoleSave() }).class("router-conflict-action").attr("data-control", "").children("Use " + model.conflict.value)
|
|
66447
|
+
)
|
|
66448
|
+
],
|
|
66449
|
+
Separator(h3).class("router-rule"),
|
|
66450
|
+
meter2,
|
|
66451
|
+
// Owner review (2026-12-05): the session list and the recent-calls list
|
|
66452
|
+
// are two tables. Each is its own raised panel with its own heading, so
|
|
66453
|
+
// they can never read as one continuous list.
|
|
66454
|
+
h3.div.class("router-card router-panel").attr("data-surface", "raised").attr("data-table", "sessions").children(sessionsCard),
|
|
66455
|
+
h3.div.class("router-card router-panel").attr("data-surface", "raised").attr("data-table", "recent").children(
|
|
66456
|
+
h3.div.class("router-card-head").children(
|
|
66457
|
+
h3.span.class("router-caps-label").children("Recent calls"),
|
|
66458
|
+
h3.span.class("router-card-meta").children(recent.length === 0 ? "none" : String(recent.length))
|
|
66459
|
+
),
|
|
66460
|
+
...recent.length === 0 ? [
|
|
66461
|
+
h3.div.class("router-recent-empty").children("No calls yet")
|
|
66462
|
+
] : recent.map(
|
|
66463
|
+
(row) => h3.div.class("router-recent-row").children(
|
|
66464
|
+
h3.span.class("router-recent-time").children(
|
|
66465
|
+
row.at.length >= 16 ? localClock(row.at) : row.at
|
|
66466
|
+
),
|
|
66467
|
+
h3.span.class("router-recent-id").children(row.requestId),
|
|
66468
|
+
h3.span.class("router-recent-meta").children(
|
|
66469
|
+
row.decision + " \xB7 " + row.model + (row.gate === null ? "" : " \xB7 " + row.gate)
|
|
66470
|
+
)
|
|
66471
|
+
)
|
|
66472
|
+
)
|
|
66473
|
+
)
|
|
66474
|
+
)
|
|
66475
|
+
}
|
|
66476
|
+
});
|
|
66477
|
+
}
|
|
66302
66478
|
});
|
|
66303
|
-
|
|
66304
|
-
|
|
66305
|
-
|
|
66306
|
-
var decodeActivityPayload = Schema_exports.decodeUnknownSync(ActivityPayloadSchema);
|
|
66307
|
-
var decodeEnginePayload = Schema_exports.decodeUnknownSync(EnginePayloadSchema);
|
|
66308
|
-
var decodeEngineSaveResponse = Schema_exports.decodeUnknownSync(EngineSaveResponseSchema);
|
|
66309
|
-
var decodeEvidencePayload = Schema_exports.decodeUnknownSync(EvidencePayloadSchema);
|
|
66310
|
-
var decodeHealth = Schema_exports.decodeUnknownSync(HealthSchema);
|
|
66479
|
+
if (typeof document !== "undefined" && document.head !== null) {
|
|
66480
|
+
injectRouterSheet(document, "overview", OverviewCss);
|
|
66481
|
+
}
|
|
66311
66482
|
|
|
66312
|
-
// packages/plugin/client/
|
|
66313
|
-
var
|
|
66314
|
-
|
|
66315
|
-
|
|
66316
|
-
|
|
66317
|
-
|
|
66318
|
-
|
|
66319
|
-
|
|
66320
|
-
|
|
66321
|
-
|
|
66322
|
-
|
|
66483
|
+
// packages/plugin/client/mount.ts
|
|
66484
|
+
var devToolsEnabled = () => {
|
|
66485
|
+
try {
|
|
66486
|
+
const scope3 = globalThis;
|
|
66487
|
+
if (scope3.__ROUTER_DEVTOOLS__ === true) return true;
|
|
66488
|
+
if (scope3.localStorage?.getItem?.("routerDevtools") === "1") return true;
|
|
66489
|
+
const search = scope3.location?.search;
|
|
66490
|
+
return typeof search === "string" && /(?:^|[?&])devtools=1(?:&|$)/.test(search);
|
|
66491
|
+
} catch {
|
|
66492
|
+
return false;
|
|
66493
|
+
}
|
|
66494
|
+
};
|
|
66495
|
+
var hostLayer = (component2, props, container) => {
|
|
66496
|
+
const host = BrowserHost_exports.mount(component2, props, container, { head: false });
|
|
66497
|
+
if (!devToolsEnabled() || typeof document === "undefined") return host;
|
|
66498
|
+
const devTools2 = DevTools_exports.layer({
|
|
66499
|
+
position: "BottomRight",
|
|
66500
|
+
server: "http://127.0.0.1:4774"
|
|
66501
|
+
}).pipe(Layer_exports.provide(layerWebSocketConstructorGlobal));
|
|
66502
|
+
return host.pipe(Layer_exports.provide(devTools2));
|
|
66503
|
+
};
|
|
66504
|
+
var mountEffectPage = (component2, props, container) => {
|
|
66505
|
+
const fiber3 = Effect_exports.runFork(Layer_exports.launch(hostLayer(component2, props, container)));
|
|
66323
66506
|
return {
|
|
66324
|
-
|
|
66325
|
-
|
|
66326
|
-
|
|
66327
|
-
|
|
66328
|
-
...policy,
|
|
66329
|
-
mainModel: mainModel.length === 0 ? null : { provider: "", model: mainModel, label: mainModel }
|
|
66330
|
-
}
|
|
66507
|
+
fiber: fiber3,
|
|
66508
|
+
dispose: async () => {
|
|
66509
|
+
await Effect_exports.runPromise(Fiber_exports.interrupt(fiber3));
|
|
66510
|
+
container.replaceChildren();
|
|
66331
66511
|
}
|
|
66332
66512
|
};
|
|
66333
66513
|
};
|
|
66334
|
-
var
|
|
66335
|
-
|
|
66336
|
-
|
|
66337
|
-
|
|
66338
|
-
|
|
66339
|
-
case "routing":
|
|
66340
|
-
return decodeRoutingPayload(body);
|
|
66341
|
-
case "activity":
|
|
66342
|
-
return decodeActivityPayload(body);
|
|
66343
|
-
case "engine":
|
|
66344
|
-
return decodeEnginePayload(body);
|
|
66345
|
-
}
|
|
66346
|
-
};
|
|
66347
|
-
var classifyEvidence = (tab, payload, nowMs) => {
|
|
66348
|
-
const evidence = payload.evidence;
|
|
66349
|
-
if (tab === "models" && payload.kind === "models") {
|
|
66350
|
-
const hasRemote = payload.view.remoteModels.length > 0;
|
|
66351
|
-
if (payload.view.residents.length === 0 && evidence.telemetry.snapshot === null) {
|
|
66352
|
-
return hasRemote ? "partial" : "empty";
|
|
66353
|
-
}
|
|
66354
|
-
if (evidence.telemetry.snapshot === null) return "partial";
|
|
66355
|
-
}
|
|
66356
|
-
if (tab === "routing" && payload.kind === "routing") {
|
|
66357
|
-
if (payload.view.current === null && evidence.ledger.rows.length === 0) return "empty";
|
|
66358
|
-
if (evidence.telemetry.snapshot === null) return "partial";
|
|
66359
|
-
}
|
|
66360
|
-
if (tab === "activity" && payload.kind === "activity") {
|
|
66361
|
-
if (evidence.ledger.rows.length === 0) return "empty";
|
|
66362
|
-
if (evidence.ledger.rows.some((row) => row.gate === void 0 || row.surface === void 0)) return "partial";
|
|
66363
|
-
}
|
|
66364
|
-
if (tab === "engine" && payload.kind === "engine") {
|
|
66365
|
-
if (payload.models.length === 0 && payload.health.status === "unknown") return "empty";
|
|
66366
|
-
if (payload.health.status === "healthy" && payload.models.length === 0) return "partial";
|
|
66367
|
-
}
|
|
66368
|
-
if (evidence.staleAt !== null) {
|
|
66369
|
-
const staleAt = Date.parse(evidence.staleAt);
|
|
66370
|
-
if (Number.isFinite(staleAt) && staleAt <= nowMs) return "stale";
|
|
66371
|
-
}
|
|
66372
|
-
return "ready";
|
|
66514
|
+
var noModelPolicy = {
|
|
66515
|
+
floorTps: 50,
|
|
66516
|
+
mainModel: null,
|
|
66517
|
+
advisoryModel: null,
|
|
66518
|
+
rev: 1
|
|
66373
66519
|
};
|
|
66374
|
-
var
|
|
66375
|
-
|
|
66376
|
-
|
|
66377
|
-
|
|
66378
|
-
|
|
66379
|
-
|
|
66380
|
-
|
|
66520
|
+
var mountRouter = (container, overview = null, extras = {}) => mountEffectPage(
|
|
66521
|
+
Overview,
|
|
66522
|
+
{
|
|
66523
|
+
initialPolicy: overview?.policy ?? noModelPolicy,
|
|
66524
|
+
overview: overview ?? null,
|
|
66525
|
+
models: extras.models ?? [],
|
|
66526
|
+
policyError: extras.policyError ?? null,
|
|
66527
|
+
buildMismatch: extras.buildMismatch === true
|
|
66528
|
+
},
|
|
66529
|
+
container
|
|
66530
|
+
);
|
|
66531
|
+
|
|
66532
|
+
// packages/plugin/client/keys.ts
|
|
66533
|
+
var isTypingTarget = (target2) => {
|
|
66534
|
+
const element = target2;
|
|
66535
|
+
if (element === null || element === void 0 || typeof element.tagName !== "string") return false;
|
|
66536
|
+
const tag2 = element.tagName.toUpperCase();
|
|
66537
|
+
return tag2 === "INPUT" || tag2 === "TEXTAREA" || tag2 === "SELECT" || element.isContentEditable === true;
|
|
66381
66538
|
};
|
|
66382
|
-
|
|
66383
|
-
|
|
66384
|
-
|
|
66385
|
-
|
|
66386
|
-
|
|
66387
|
-
|
|
66388
|
-
return
|
|
66539
|
+
|
|
66540
|
+
// packages/plugin/client/tab-mounts.ts
|
|
66541
|
+
var signatureOf = (value3) => {
|
|
66542
|
+
try {
|
|
66543
|
+
return JSON.stringify(value3) ?? "undefined";
|
|
66544
|
+
} catch {
|
|
66545
|
+
return "unserializable";
|
|
66389
66546
|
}
|
|
66390
|
-
return "";
|
|
66391
66547
|
};
|
|
66392
|
-
var
|
|
66393
|
-
|
|
66394
|
-
|
|
66395
|
-
|
|
66396
|
-
|
|
66397
|
-
|
|
66398
|
-
|
|
66399
|
-
const record3 = node;
|
|
66400
|
-
if (record3._tag === "Pointer" && Array.isArray(record3.path)) {
|
|
66401
|
-
for (const segment2 of record3.path) {
|
|
66402
|
-
if (typeof segment2 === "string" || typeof segment2 === "number") segments.push(segment2);
|
|
66403
|
-
}
|
|
66404
|
-
node = record3.issue;
|
|
66405
|
-
continue;
|
|
66406
|
-
}
|
|
66407
|
-
if (Array.isArray(record3.issues) && record3.issues.length > 0) {
|
|
66408
|
-
node = record3.issues[0];
|
|
66409
|
-
continue;
|
|
66410
|
-
}
|
|
66411
|
-
if (record3.issue !== null && typeof record3.issue === "object") {
|
|
66412
|
-
node = record3.issue;
|
|
66413
|
-
continue;
|
|
66414
|
-
}
|
|
66415
|
-
break;
|
|
66416
|
-
}
|
|
66417
|
-
return segments.length === 0 ? null : segments.map(String).join(".");
|
|
66548
|
+
var signatureForTab = (id2, inputs) => id2 === "overview" ? inputs.overviewError !== null ? "overview:error:" + inputs.overviewError : inputs.overview === null ? "overview:loading" : "overview:ready:" + inputs.mountKey : String(inputs.revision) + "|" + // R40-R5-F1: the page receives the selected window as a prop, so the window is part
|
|
66549
|
+
// of the mount signature - without it the props freeze at mount and the reading
|
|
66550
|
+
// line can never differ from the drawn series.
|
|
66551
|
+
(id2 === "telemetry" ? inputs.telemetryRange + "|" : "") + signatureOf(inputs.view);
|
|
66552
|
+
var planOverviewRefresh = (previousKey, nextKey, editorOpen) => {
|
|
66553
|
+
if (nextKey === previousKey) return { bumpKey: false, deliverEvent: false };
|
|
66554
|
+
return editorOpen ? { bumpKey: false, deliverEvent: true } : { bumpKey: true, deliverEvent: false };
|
|
66418
66555
|
};
|
|
66419
|
-
var
|
|
66420
|
-
const
|
|
66421
|
-
|
|
66422
|
-
|
|
66423
|
-
}
|
|
66424
|
-
try {
|
|
66425
|
-
const response = await request3("/api/router/health", {
|
|
66426
|
-
method: "GET",
|
|
66427
|
-
headers: { accept: "application/json" },
|
|
66428
|
-
credentials: "same-origin",
|
|
66429
|
-
cache: "no-store",
|
|
66430
|
-
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
66431
|
-
});
|
|
66432
|
-
if (!response.ok) {
|
|
66433
|
-
return { ok: false, status: response.status, message: evidenceStatusMessage(response.status) };
|
|
66434
|
-
}
|
|
66435
|
-
const body = await response.json();
|
|
66436
|
-
return { ok: true, status: response.status, health: decodeHealth(body) };
|
|
66437
|
-
} catch (error) {
|
|
66438
|
-
if (options.signal?.aborted === true) throw error;
|
|
66439
|
-
return { ok: false, status: null, message: "Cannot reach the router host." };
|
|
66556
|
+
var planTabs = (previous, activeId, activeSignature) => {
|
|
66557
|
+
const actions = [];
|
|
66558
|
+
for (const id2 of Object.keys(previous)) {
|
|
66559
|
+
if (id2 !== activeId) actions.push({ kind: "hide", id: id2 });
|
|
66440
66560
|
}
|
|
66441
|
-
|
|
66442
|
-
|
|
66443
|
-
|
|
66444
|
-
|
|
66445
|
-
return { ok: false, status: null, message: "No fetch implementation is available.", retryable: false };
|
|
66561
|
+
const current3 = previous[activeId];
|
|
66562
|
+
if (current3 === void 0) {
|
|
66563
|
+
actions.push({ kind: "mount", id: activeId, signature: activeSignature });
|
|
66564
|
+
return { actions, registry: { ...previous, [activeId]: { signature: activeSignature } } };
|
|
66446
66565
|
}
|
|
66447
|
-
|
|
66448
|
-
|
|
66449
|
-
|
|
66450
|
-
credentials: "same-origin",
|
|
66451
|
-
cache: "no-store",
|
|
66452
|
-
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
66453
|
-
});
|
|
66454
|
-
try {
|
|
66455
|
-
let response = await call();
|
|
66456
|
-
if (response.status === 404) {
|
|
66457
|
-
await new Promise((resolve7) => setTimeout(resolve7, 750));
|
|
66458
|
-
if (options.signal?.aborted !== true) response = await call();
|
|
66459
|
-
}
|
|
66460
|
-
if (!response.ok) {
|
|
66461
|
-
return { ok: false, status: response.status, message: evidenceStatusMessage(response.status), retryable: true };
|
|
66462
|
-
}
|
|
66463
|
-
let body;
|
|
66464
|
-
try {
|
|
66465
|
-
body = await response.json();
|
|
66466
|
-
} catch {
|
|
66467
|
-
return { ok: false, status: response.status, message: "Evidence response was not JSON.", retryable: false };
|
|
66468
|
-
}
|
|
66469
|
-
let payload;
|
|
66470
|
-
try {
|
|
66471
|
-
payload = decodeEvidencePayload2(tab, body);
|
|
66472
|
-
} catch (error) {
|
|
66473
|
-
const field2 = schemaIssuePath(error);
|
|
66474
|
-
return {
|
|
66475
|
-
ok: false,
|
|
66476
|
-
status: response.status,
|
|
66477
|
-
message: DECODE_COPY,
|
|
66478
|
-
retryable: false,
|
|
66479
|
-
...field2 === null ? {} : { field: field2 }
|
|
66480
|
-
};
|
|
66481
|
-
}
|
|
66482
|
-
return { ok: true, status: response.status, payload };
|
|
66483
|
-
} catch (error) {
|
|
66484
|
-
if (options.signal?.aborted === true) throw error;
|
|
66485
|
-
return { ok: false, status: null, message: "Cannot reach the router host.", retryable: true };
|
|
66566
|
+
if (current3.signature === activeSignature) {
|
|
66567
|
+
actions.push({ kind: "activate", id: activeId });
|
|
66568
|
+
return { actions, registry: previous };
|
|
66486
66569
|
}
|
|
66570
|
+
actions.push({ kind: "dispose", id: activeId });
|
|
66571
|
+
actions.push({ kind: "mount", id: activeId, signature: activeSignature });
|
|
66572
|
+
return { actions, registry: { ...previous, [activeId]: { signature: activeSignature } } };
|
|
66487
66573
|
};
|
|
66574
|
+
var planDispose = (registry2) => ({
|
|
66575
|
+
actions: Object.keys(registry2).map((id2) => ({ kind: "dispose", id: id2 })),
|
|
66576
|
+
registry: {}
|
|
66577
|
+
});
|
|
66488
66578
|
|
|
66489
66579
|
// packages/plugin/client/ShellCss.ts
|
|
66490
66580
|
var ShellCss = `
|
|
@@ -66593,7 +66683,7 @@ if (typeof document !== "undefined" && document.head !== null) {
|
|
|
66593
66683
|
}
|
|
66594
66684
|
|
|
66595
66685
|
// packages/plugin/client/build-id.ts
|
|
66596
|
-
var clientBuildId = true ? "
|
|
66686
|
+
var clientBuildId = true ? "62ec21caf664d3f61dfa009f8b43e6b8fb29ccaf0e316a3edc4e661e140b701a" : "";
|
|
66597
66687
|
var compareBuildIds = (hostId, clientId) => {
|
|
66598
66688
|
const host = typeof hostId === "string" && hostId.length > 0 ? hostId : null;
|
|
66599
66689
|
const client = typeof clientId === "string" && clientId.length > 0 ? clientId : null;
|
|
@@ -66709,7 +66799,47 @@ var HAIRLINE = "var(--color-line-field)";
|
|
|
66709
66799
|
var ROW_LINE = "var(--color-line-rule)";
|
|
66710
66800
|
var PANEL = "var(--color-surface)";
|
|
66711
66801
|
var CARD = "var(--color-line-panel)";
|
|
66802
|
+
var TELEMETRY_CSS = [
|
|
66803
|
+
".router-tl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--spacing-5); }",
|
|
66804
|
+
".router-tl-kpi { display: flex; flex-direction: column; gap: 2px; }",
|
|
66805
|
+
".router-tl-kpi-value { font-family: var(--font-mono); font-size: var(--text-title); color: var(--color-ink); }",
|
|
66806
|
+
".router-tl-kpi-label { font-family: var(--font-mono); font-size: var(--text-caps); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-meta); }",
|
|
66807
|
+
".router-tl-kpi-sub { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
|
|
66808
|
+
".router-tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-5); }",
|
|
66809
|
+
".router-tl-card { display: flex; flex-direction: column; gap: var(--spacing-3); padding: var(--spacing-5); }",
|
|
66810
|
+
/* Owner report (2026-12-06): the traffic card is the last row on its own, so it spans
|
|
66811
|
+
both columns - the board's layout, not a half-width orphan. */
|
|
66812
|
+
".router-tl-card-wide { grid-column: 1 / -1; }",
|
|
66813
|
+
".router-tl-card-title { font-family: var(--font-ui); font-size: var(--text-body); color: var(--color-ink); }",
|
|
66814
|
+
".router-tl-meter { display: flex; flex-direction: row; align-items: center; gap: var(--spacing-3); }",
|
|
66815
|
+
".router-tl-meter-label { width: 62px; flex-shrink: 0; text-align: right; font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-meta); }",
|
|
66816
|
+
".router-tl-meter-track { flex: 1 1 auto; min-width: 0; height: 10px; border-radius: var(--radius-chip); background: var(--color-subtle); }",
|
|
66817
|
+
".router-tl-meter-fill { display: block; height: 10px; min-width: 2px; border-radius: var(--radius-chip); background: var(--color-ink); }",
|
|
66818
|
+
'.router-tl-meter[data-danger="true"] .router-tl-meter-fill { background: var(--color-danger); }',
|
|
66819
|
+
".router-tl-meter-value { width: 56px; flex-shrink: 0; text-align: right; font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-ink); }",
|
|
66820
|
+
".router-tl-foot { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
|
|
66821
|
+
".router-tl-unavailable { display: flex; flex-direction: column; gap: 2px; }",
|
|
66822
|
+
".router-tl-reason { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-meta); }",
|
|
66823
|
+
".router-tl-scatter { position: relative; height: 150px; border-left: 1px solid var(--color-line-rule); border-bottom: 1px solid var(--color-line-rule); }",
|
|
66824
|
+
".router-tl-dot { position: absolute; width: 5px; height: 5px; border-radius: var(--radius-round); background: var(--color-ink); opacity: 0.5; }",
|
|
66825
|
+
'.router-tl-dot[data-below-floor="true"] { background: var(--color-danger); }',
|
|
66826
|
+
".router-tl-bars { display: flex; flex-direction: row; align-items: flex-end; gap: var(--spacing-2); border-bottom: 1px solid var(--color-line-rule); }",
|
|
66827
|
+
".router-tl-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1 1 0; min-width: 0; }",
|
|
66828
|
+
".router-tl-bar-count { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-ink); }",
|
|
66829
|
+
".router-tl-bar-track { display: flex; flex-direction: column; justify-content: flex-end; height: 96px; width: 100%; align-items: center; }",
|
|
66830
|
+
".router-tl-bar { width: 12px; background: var(--color-ink); border-radius: var(--radius-chip); }",
|
|
66831
|
+
".router-tl-bar-label { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
|
|
66832
|
+
...Array.from({ length: 21 }, (_, i) => ".router-tl-meter-fill.w" + i + " { width: " + i * 5 + "%; }"),
|
|
66833
|
+
...Array.from({ length: 20 }, (_, j) => ".router-tl-bar.h" + (j + 1) + " { height: " + (j + 1) * 5 + "%; }"),
|
|
66834
|
+
".router-tl-reading { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); padding-bottom: var(--spacing-2); }",
|
|
66835
|
+
".router-range-row { display: flex; flex-direction: row; align-items: center; gap: var(--spacing-2); padding-block: var(--spacing-2); }",
|
|
66836
|
+
'.router-range-chip[aria-pressed="true"] { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }',
|
|
66837
|
+
".router-range-chip { font-family: var(--font-mono); font-size: var(--text-caption); padding-inline: var(--spacing-3); }",
|
|
66838
|
+
...Array.from({ length: 41 }, (_, i) => ".router-tl-dot.w" + i + " { left: " + i * 2.5 + "%; }"),
|
|
66839
|
+
...Array.from({ length: 41 }, (_, i) => ".router-tl-dot.scatter-y-" + i + " { bottom: " + i * 2.5 + "%; }")
|
|
66840
|
+
].join("\n");
|
|
66712
66841
|
var EvidenceContentCss = `
|
|
66842
|
+
${TELEMETRY_CSS}
|
|
66713
66843
|
/* P8 (ui-review \xA78/\xA725): 16TR-0/16ZQ-0 the KPI strip pads 16 and, at 390, gaps 20. */
|
|
66714
66844
|
.router-kpis { display: flex; flex-wrap: wrap; gap: var(--spacing-6); border-top: 1px solid ${ROW_LINE}; border-bottom: 1px solid ${ROW_LINE}; padding-block: var(--spacing-4); }
|
|
66715
66845
|
/* D2 (board 17RD-0): inside the stats card the card owns the frame, so the
|
|
@@ -66724,6 +66854,9 @@ var EvidenceContentCss = `
|
|
|
66724
66854
|
.router-kpi-label { font-family: ${INTER}; font-size: var(--text-label); line-height: var(--leading-label); letter-spacing: var(--tracking-none); text-transform: none; color: var(--color-meta); white-space: nowrap; }
|
|
66725
66855
|
.router-kpi-value { font-family: ${MONO}; font-size: var(--text-kpi); line-height: var(--leading-kpi); font-weight: 400; font-variant-numeric: tabular-nums; color: ${INK}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
66726
66856
|
.router-kpi-sub { font-family: ${MONO}; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
66857
|
+
/* Run 39: an unavailable value is a name in the muted meta role - never the
|
|
66858
|
+
ink data role, never danger; it wraps instead of truncating. */
|
|
66859
|
+
.router-kpi-value[data-gap="true"], .router-kpi-sub[data-gap="true"] { color: var(--color-meta); white-space: normal; overflow: visible; text-overflow: clip; }
|
|
66727
66860
|
/* Models only: Paper 17UD-0/1822-0 label Geist Mono 9.5/12 caps 0.06em. */
|
|
66728
66861
|
.router-kpis-stats .router-kpi-label { font-family: ${MONO}; font-size: var(--text-caps); line-height: var(--leading-caps); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
|
|
66729
66862
|
.router-kpis-stats .router-kpi-sub { font-family: ${INTER}; font-size: var(--text-caption); line-height: var(--leading-caption); }
|
|
@@ -66764,7 +66897,7 @@ var EvidenceContentCss = `
|
|
|
66764
66897
|
column, which names the residency and the sample's provenance (R-36-07) in
|
|
66765
66898
|
the mono meta role. */
|
|
66766
66899
|
.router-state-cell { flex: 160 1 0; min-width: 0; font-family: ${MONO}; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-meta); }
|
|
66767
|
-
.router-role-cell { flex: 200 1 0; min-width: 0; font-family: ${MONO}; font-size: var(--text-caps); line-height: var(--leading-caps); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: ${MUTED}; }
|
|
66900
|
+
.router-role-cell { flex: 200 1 0; min-width: 0; font-family: ${MONO}; font-size: var(--text-caps); line-height: var(--leading-caps); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: ${MUTED}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
66768
66901
|
.router-num-cell { width: 66px; flex-shrink: 0; font-family: ${MONO}; font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--color-body); }
|
|
66769
66902
|
.router-context-cell { flex: 100 1 0; min-width: 0; font-family: ${MONO}; font-size: var(--text-meta); line-height: var(--leading-meta); color: ${INK}; }
|
|
66770
66903
|
.router-mobile-only { display: none; }
|
|
@@ -66960,6 +67093,13 @@ var EvidenceContentCss = `
|
|
|
66960
67093
|
12/16 ink (was Inter 13/18 body). */
|
|
66961
67094
|
.router-engine-fact-label { font-family: ${MONO}; font-size: var(--text-caps); line-height: var(--leading-caps); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--color-meta); }
|
|
66962
67095
|
.router-engine-fact-value { font-family: ${MONO}; font-size: var(--text-meta); line-height: var(--leading-meta); color: var(--color-ink); }
|
|
67096
|
+
/* Run 39: a field the engine cannot report names its cause in muted meta -
|
|
67097
|
+
unavailable is not an error and never reads as zero (F-34-08 attribute
|
|
67098
|
+
selector keeps this rule a distinct key). */
|
|
67099
|
+
.router-engine-fact-value[data-gap="true"] { color: var(--color-meta); }
|
|
67100
|
+
/* Run 39: the same muted cause styling for the Catalogue context cell and the
|
|
67101
|
+
selected-model facts, so a gap never reads as zero in the data roles. */
|
|
67102
|
+
.router-context-cell[data-gap="true"], .router-kv-value[data-gap="true"] { color: var(--color-meta); }
|
|
66963
67103
|
.router-engine-grid { display: flex; flex-direction: column; gap: var(--spacing-7); align-items: stretch; width: 100%; }
|
|
66964
67104
|
.router-engine-grid > .router-card { width: 100%; }
|
|
66965
67105
|
|
|
@@ -66995,6 +67135,14 @@ var EvidenceContentCss = `
|
|
|
66995
67135
|
.router-activity-policy { display: none; }
|
|
66996
67136
|
}
|
|
66997
67137
|
@media (max-width: 760px) {
|
|
67138
|
+
/* F-40-13: the telemetry page is four KPIs and a two-column grid at desktop; on a
|
|
67139
|
+
phone it is two KPIs and one column, with narrower meters and a shorter plot. */
|
|
67140
|
+
.router-tl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-4); }
|
|
67141
|
+
.router-tl-grid { grid-template-columns: minmax(0, 1fr); }
|
|
67142
|
+
.router-tl-meter-label, .router-tl-meter-value { width: 40px; }
|
|
67143
|
+
.router-tl-bars { gap: 2px; }
|
|
67144
|
+
.router-tl-bar { width: 8px; }
|
|
67145
|
+
.router-tl-scatter { height: 120px; }
|
|
66998
67146
|
/* P8 (ui-review \xA78/\xA79/\xA711/\xA725): the narrow-board values the 390 artboards name. */
|
|
66999
67147
|
.router-kpis { flex-wrap: wrap; padding-block: var(--spacing-4); gap: var(--spacing-5); }
|
|
67000
67148
|
.router-kpi { flex: 1 1 44%; padding-inline: 0; min-width: 44%; margin-bottom: 12px; }
|
|
@@ -67056,8 +67204,11 @@ var Kpis = (h3, items, variant) => h3.div.class(variant === "stats" ? "router-kp
|
|
|
67056
67204
|
...items.map(
|
|
67057
67205
|
(item) => h3.div.class("router-kpi").children(
|
|
67058
67206
|
h3.div.class("router-kpi-label").children(item.label),
|
|
67059
|
-
|
|
67060
|
-
|
|
67207
|
+
// Run 39: a gap value (the engine cannot report it) renders in the muted
|
|
67208
|
+
// meta role via the data-gap attribute rule, never the ink data role.
|
|
67209
|
+
h3.div.class("router-kpi-value").attr("data-gap", item.gap === true ? "true" : void 0).children(item.value),
|
|
67210
|
+
// Run 39: a gap sub (the cause line) wraps instead of truncating.
|
|
67211
|
+
h3.div.class("router-kpi-sub").attr("data-gap", item.gap === true ? "true" : void 0).children(item.sub)
|
|
67061
67212
|
)
|
|
67062
67213
|
)
|
|
67063
67214
|
);
|
|
@@ -67074,11 +67225,7 @@ var formatContext = (value3) => {
|
|
|
67074
67225
|
if (value3 >= 1e3) return `${Math.round(value3 / 1e3)}k`;
|
|
67075
67226
|
return String(value3);
|
|
67076
67227
|
};
|
|
67077
|
-
var clock = (iso) =>
|
|
67078
|
-
if (iso === null || iso === void 0) return "\u2014";
|
|
67079
|
-
const ms = Date.parse(iso);
|
|
67080
|
-
return Number.isFinite(ms) ? new Date(ms).toISOString().slice(11, 16) : "\u2014";
|
|
67081
|
-
};
|
|
67228
|
+
var clock = (iso) => localClock(iso);
|
|
67082
67229
|
var shortDecision = (id2) => {
|
|
67083
67230
|
const compactId = id2.replace(/[^A-Za-z0-9]/g, "");
|
|
67084
67231
|
return compactId.length <= 7 ? compactId : compactId.slice(-7);
|
|
@@ -67095,6 +67242,69 @@ var GATE_COPY = {
|
|
|
67095
67242
|
fallback: { name: "Fallback", meaning: "The request goes to the next model in this role's chain.", source: "router" }
|
|
67096
67243
|
};
|
|
67097
67244
|
var GATE_ORDER = ["residency", "headroom", "floor", "fallback"];
|
|
67245
|
+
var engineKindLabel = (kind) => {
|
|
67246
|
+
if (kind === "omlx") return "oMLX";
|
|
67247
|
+
if (kind === "mlx-serve") return "mlx-serve";
|
|
67248
|
+
if (kind === null || kind === void 0 || kind === "") return "unknown";
|
|
67249
|
+
return kind;
|
|
67250
|
+
};
|
|
67251
|
+
var engineStatement = (kind) => `Engine \xB7 ${engineKindLabel(kind)}`;
|
|
67252
|
+
var enginePayloadKind = (payload) => {
|
|
67253
|
+
const adapterKind = payload.adapter.kind;
|
|
67254
|
+
if (typeof adapterKind === "string" && adapterKind !== "") return adapterKind;
|
|
67255
|
+
const backendKind = payload.backend.kind;
|
|
67256
|
+
if (typeof backendKind === "string" && backendKind !== "") return backendKind;
|
|
67257
|
+
const current3 = payload.adapter.adapters.find((entry) => entry.current);
|
|
67258
|
+
if (current3 !== void 0 && current3.id !== "") return current3.id;
|
|
67259
|
+
return null;
|
|
67260
|
+
};
|
|
67261
|
+
var engineAdminAbsent = (payload) => {
|
|
67262
|
+
const sources = payload.capabilities?.sources;
|
|
67263
|
+
return sources !== null && sources !== void 0 && sources.admin === false;
|
|
67264
|
+
};
|
|
67265
|
+
var modelsAdminAbsent = (payload) => {
|
|
67266
|
+
const caps = payload.view.capabilities;
|
|
67267
|
+
if (typeof caps !== "object" || caps === null) return false;
|
|
67268
|
+
const sources = caps.sources;
|
|
67269
|
+
if (typeof sources !== "object" || sources === null) return false;
|
|
67270
|
+
return sources.admin === false;
|
|
67271
|
+
};
|
|
67272
|
+
var engineKindFact = (kind, adapterLabel) => engineKindLabel(kind) === "mlx-serve" ? "mlx-serve \xB7 HTTP API" : `${adapterLabel} \xB7 admin API`;
|
|
67273
|
+
var MODELS_GAP_NOTE = "mlx-serve exposes models, slots and per-request speed; memory pressure and the waiting queue are not part of its API. Start the server with --metrics for memory.";
|
|
67274
|
+
var MODELS_MEMORY_GAP_VALUE = "not reported";
|
|
67275
|
+
var MODELS_MEMORY_GAP_SUB = "mlx-serve reports memory only when started with --metrics";
|
|
67276
|
+
var isGapEngine = (kind) => engineKindLabel(kind) === "mlx-serve";
|
|
67277
|
+
var engineGapCopy = (kind) => {
|
|
67278
|
+
if (isGapEngine(kind)) {
|
|
67279
|
+
return {
|
|
67280
|
+
memory: "not exposed by mlx-serve (start it with --metrics)",
|
|
67281
|
+
pressure: "not exposed by mlx-serve",
|
|
67282
|
+
waiting: "mlx-serve has no queue view",
|
|
67283
|
+
adminLine: "admin API: not available on this engine"
|
|
67284
|
+
};
|
|
67285
|
+
}
|
|
67286
|
+
if (engineKindLabel(kind) === "oMLX") {
|
|
67287
|
+
return {
|
|
67288
|
+
memory: "not reported - the oMLX admin API is unreachable",
|
|
67289
|
+
pressure: "not reported - the oMLX admin API is unreachable",
|
|
67290
|
+
waiting: "not reported - the oMLX admin API is unreachable",
|
|
67291
|
+
adminLine: "admin API: unreachable"
|
|
67292
|
+
};
|
|
67293
|
+
}
|
|
67294
|
+
return {
|
|
67295
|
+
memory: "not reported",
|
|
67296
|
+
pressure: "not reported",
|
|
67297
|
+
waiting: "not reported",
|
|
67298
|
+
adminLine: "admin API: not reported"
|
|
67299
|
+
};
|
|
67300
|
+
};
|
|
67301
|
+
var ENGINE_MEMORY_GAP = engineGapCopy("mlx-serve").memory;
|
|
67302
|
+
var ENGINE_PRESSURE_GAP = engineGapCopy("mlx-serve").pressure;
|
|
67303
|
+
var ENGINE_WAITING_GAP = engineGapCopy("mlx-serve").waiting;
|
|
67304
|
+
var ENGINE_FACT_NOT_CAPTURED = "not captured";
|
|
67305
|
+
var engineMemoryFact = (used, max6) => used === null || max6 === null ? ENGINE_FACT_NOT_CAPTURED : `${gb(used)} / ${gb(max6)} GB`;
|
|
67306
|
+
var enginePressureFact = (level) => level === null ? ENGINE_FACT_NOT_CAPTURED : level;
|
|
67307
|
+
var engineWaitingFact = (count3) => count3 === null ? ENGINE_FACT_NOT_CAPTURED : String(count3);
|
|
67098
67308
|
var NO_MODEL_LABEL = "no usable model";
|
|
67099
67309
|
var gateName = (gate) => gate === null || gate === void 0 ? "\u2014" : GATE_COPY[gate]?.name ?? gate;
|
|
67100
67310
|
var decisionPart = (value3) => {
|
|
@@ -67163,21 +67373,27 @@ var EvidenceStatus = Html_exports.component({
|
|
|
67163
67373
|
] : [];
|
|
67164
67374
|
return PageFrame(h3, {
|
|
67165
67375
|
props: { variant: variant ?? "railless" },
|
|
67376
|
+
// Run 40 (F-40-01, found by the layout gate): a status page is still a page.
|
|
67377
|
+
// Without this wrapper the loading/empty/error surface had no .page-body, so
|
|
67378
|
+
// it fell outside the page grid the other tabs use and no layout check could
|
|
67379
|
+
// verify it. The frame's body is the grid every page shares.
|
|
67166
67380
|
slots: {
|
|
67167
67381
|
content: [
|
|
67168
|
-
|
|
67169
|
-
|
|
67170
|
-
|
|
67171
|
-
|
|
67172
|
-
|
|
67173
|
-
|
|
67174
|
-
|
|
67175
|
-
|
|
67176
|
-
|
|
67177
|
-
|
|
67178
|
-
|
|
67179
|
-
|
|
67180
|
-
|
|
67382
|
+
h3.div.class("page-body").children(
|
|
67383
|
+
RouterState(h3, {
|
|
67384
|
+
key: "evidence-state",
|
|
67385
|
+
props: {
|
|
67386
|
+
tone,
|
|
67387
|
+
density: "page",
|
|
67388
|
+
title,
|
|
67389
|
+
message: detail,
|
|
67390
|
+
...retryable === false ? { note: RELOAD_HINT } : {},
|
|
67391
|
+
...codes3.length === 0 ? {} : { code: codes3 },
|
|
67392
|
+
loading: state3 === "loading"
|
|
67393
|
+
},
|
|
67394
|
+
slots: { actions }
|
|
67395
|
+
})
|
|
67396
|
+
)
|
|
67181
67397
|
]
|
|
67182
67398
|
}
|
|
67183
67399
|
});
|
|
@@ -67237,9 +67453,12 @@ var modelCatalog = (payload) => {
|
|
|
67237
67453
|
const snapshot2 = evidence.telemetry.snapshot;
|
|
67238
67454
|
const sampleSource = snapshot2?.observedTpsSource ?? null;
|
|
67239
67455
|
const details = new Map((snapshot2?.models ?? []).map((model) => [model.id, model]));
|
|
67456
|
+
const adminAbsent = modelsAdminAbsent(payload);
|
|
67457
|
+
const GAP_CONTEXT = "unknown";
|
|
67458
|
+
const GAP_MEMORY = "unknown";
|
|
67240
67459
|
const local = view2.residents.map((resident) => {
|
|
67241
67460
|
const detail = details.get(resident.id) ?? null;
|
|
67242
|
-
const pinned = detail?.pinned === true;
|
|
67461
|
+
const pinned = adminAbsent ? false : detail?.pinned === true;
|
|
67243
67462
|
const viewTps = resident.tps;
|
|
67244
67463
|
const tpsValue = Number.isFinite(viewTps) ? viewTps : detail?.tps ?? null;
|
|
67245
67464
|
const contextLength = detail?.contextLength ?? null;
|
|
@@ -67251,12 +67470,12 @@ var modelCatalog = (payload) => {
|
|
|
67251
67470
|
role: roleLabel(resident.roles) + (pinned ? " \xB7 pinned" : ""),
|
|
67252
67471
|
tps: tpsValue === null ? "\u2014" : String(Math.round(tpsValue)),
|
|
67253
67472
|
kv: "\u2014",
|
|
67254
|
-
context: formatContext(contextLength),
|
|
67473
|
+
context: contextLength === null && adminAbsent ? GAP_CONTEXT : formatContext(contextLength),
|
|
67255
67474
|
modalities: modalitiesLabel(resident.inputModalities),
|
|
67256
67475
|
contextWindow: Number.isFinite(resident.contextWindow) ? resident.contextWindow : null,
|
|
67257
|
-
memory: sizeBytes === null ? "\u2014" : `${gb(sizeBytes)} GB`,
|
|
67476
|
+
memory: sizeBytes === null ? adminAbsent ? GAP_MEMORY : "\u2014" : `${gb(sizeBytes)} GB`,
|
|
67258
67477
|
local: true,
|
|
67259
|
-
preferred: resident.preferred,
|
|
67478
|
+
preferred: adminAbsent ? false : resident.preferred,
|
|
67260
67479
|
selected: resident.id === view2.selectedModel,
|
|
67261
67480
|
pinned,
|
|
67262
67481
|
contextLength,
|
|
@@ -67321,6 +67540,7 @@ var ModelsPage = Html_exports.component({
|
|
|
67321
67540
|
const max6 = snapshot2?.activity.memoryMaxBytes ?? 0;
|
|
67322
67541
|
const active2 = snapshot2?.activity.activeRequests ?? 0;
|
|
67323
67542
|
const waiting = snapshot2?.activity.waitingRequests ?? 0;
|
|
67543
|
+
const adminAbsent = modelsAdminAbsent(payload);
|
|
67324
67544
|
return PageFrame(h3, {
|
|
67325
67545
|
// No footer: the frame's footer slot is actions-only (DEC-34-03).
|
|
67326
67546
|
// D2 (P6, approved boards 17RD-0/17VD-0): the Models order is the board's
|
|
@@ -67333,7 +67553,7 @@ var ModelsPage = Html_exports.component({
|
|
|
67333
67553
|
h3.div.class("router-notice router-panel").attr("data-surface", "flush").children(
|
|
67334
67554
|
h3.span.class("router-caps-label").children("NOTE"),
|
|
67335
67555
|
h3.p.class("router-note").children(
|
|
67336
|
-
"Context and resident size come from the oMLX model list; decode rate is live when the model is generating. KV cache and quantization are not exposed by the admin API."
|
|
67556
|
+
adminAbsent ? MODELS_GAP_NOTE : "Context and resident size come from the oMLX model list; decode rate is live when the model is generating. KV cache and quantization are not exposed by the admin API."
|
|
67337
67557
|
)
|
|
67338
67558
|
),
|
|
67339
67559
|
h3.div.class("router-card router-panel").attr("data-card-density", "models").attr("data-surface", "raised").children(
|
|
@@ -67345,9 +67565,11 @@ var ModelsPage = Html_exports.component({
|
|
|
67345
67565
|
},
|
|
67346
67566
|
{
|
|
67347
67567
|
label: "Memory",
|
|
67348
|
-
|
|
67568
|
+
// Run 39: a gap engine names the cause; the value wraps in muted meta.
|
|
67569
|
+
value: adminAbsent ? MODELS_MEMORY_GAP_VALUE : snapshot2 === null ? "\u2014" : `${gb(used)} / ${gb(max6)}`,
|
|
67570
|
+
gap: adminAbsent,
|
|
67349
67571
|
// F-37-48: the engine's own soft limit is the guard; unknown stays "—".
|
|
67350
|
-
sub: Number.isFinite(payload.view.kpis?.memorySoftBytes) ? `GB \xB7 guard ${gb(payload.view.kpis?.memorySoftBytes)}` : "GB \xB7 guard \u2014"
|
|
67572
|
+
sub: adminAbsent ? MODELS_MEMORY_GAP_SUB : Number.isFinite(payload.view.kpis?.memorySoftBytes) ? `GB \xB7 guard ${gb(payload.view.kpis?.memorySoftBytes)}` : "GB \xB7 guard \u2014"
|
|
67351
67573
|
},
|
|
67352
67574
|
{
|
|
67353
67575
|
label: "Concurrent",
|
|
@@ -67358,10 +67580,11 @@ var ModelsPage = Html_exports.component({
|
|
|
67358
67580
|
{ label: "Evicted", value: "\u2014", sub: "not captured" }
|
|
67359
67581
|
], "stats"),
|
|
67360
67582
|
h3.div.class("router-pressure").children(
|
|
67361
|
-
|
|
67362
|
-
h3.span.children("
|
|
67363
|
-
h3.span.children("
|
|
67364
|
-
h3.span.children(
|
|
67583
|
+
// Run 39: the gap engine names the cause; the strip stays muted meta.
|
|
67584
|
+
h3.span.children(adminAbsent ? "PRESSURE \u2014 not reported by mlx-serve" : "PRESSURE " + (snapshot2 === null ? "\u2014" : String(snapshot2.pressureLevel).toUpperCase())),
|
|
67585
|
+
h3.span.children(adminAbsent ? "HEADROOM \u2014 unknown" : "HEADROOM " + (snapshot2 === null ? "\u2014" : Math.round(snapshot2.headroomRatio * 100) + "%")),
|
|
67586
|
+
h3.span.children(adminAbsent ? "ACTIVE " + (payload.view.kpis?.activeRequests ?? "\u2014") + " \xB7 WAITING not reported" : "ACTIVE " + active2 + " \xB7 WAITING " + waiting),
|
|
67587
|
+
h3.span.children("ENGINE MAX " + (payload.view.kpis?.engineMax ?? "\u2014"))
|
|
67365
67588
|
)
|
|
67366
67589
|
),
|
|
67367
67590
|
h3.div.class("router-card router-panel").attr("data-card-density", "models").attr("data-surface", "raised").children(
|
|
@@ -67414,11 +67637,12 @@ var ModelsPage = Html_exports.component({
|
|
|
67414
67637
|
h3.div.class("router-mobile-sub").children(row.role)
|
|
67415
67638
|
)
|
|
67416
67639
|
),
|
|
67417
|
-
h3.div.class("router-cell router-role-cell").children(row.role),
|
|
67418
|
-
|
|
67640
|
+
h3.div.class("router-cell router-role-cell").attr("title", row.role).children(row.role),
|
|
67641
|
+
// Run 39: a gap context names its cause in muted meta.
|
|
67642
|
+
h3.div.class("router-cell router-context-cell").attr("data-gap", row.local && adminAbsent ? "true" : void 0).children(row.context),
|
|
67419
67643
|
h3.div.class("router-mobile-only").children(
|
|
67420
67644
|
h3.span.class("router-mobile-state").children(row.state),
|
|
67421
|
-
h3.span.class("router-model-sub").children(row.memory)
|
|
67645
|
+
h3.span.class("router-model-sub").attr("data-gap", row.local && adminAbsent ? "true" : void 0).children(row.memory)
|
|
67422
67646
|
)
|
|
67423
67647
|
);
|
|
67424
67648
|
})
|
|
@@ -67443,14 +67667,14 @@ var ModelsPage = Html_exports.component({
|
|
|
67443
67667
|
["KV cache", "\u2014"],
|
|
67444
67668
|
["Ceiling", "\u2014"],
|
|
67445
67669
|
["Quantization", "\u2014"],
|
|
67446
|
-
["Context", selected?.contextLength === null || selected === null ? "\u2014" : formatContext(selected.contextLength)],
|
|
67447
|
-
["Context window", selected?.contextWindow === null || selected?.contextWindow === void 0 ? "\u2014" : formatContext(selected.contextWindow)],
|
|
67670
|
+
["Context", selected?.contextLength === null || selected === null ? adminAbsent && selected?.local ? "unknown" : "\u2014" : formatContext(selected.contextLength), adminAbsent && selected?.local === true && selected?.contextLength === null],
|
|
67671
|
+
["Context window", selected?.contextWindow === null || selected?.contextWindow === void 0 ? adminAbsent && selected?.local ? "unknown" : "\u2014" : formatContext(selected.contextWindow), adminAbsent && selected?.local === true && (selected?.contextWindow === null || selected?.contextWindow === void 0)],
|
|
67448
67672
|
["Modalities", selected?.modalities ?? "\u2014"],
|
|
67449
|
-
["Resident", selected?.sizeBytes === null || selected === null ? "\u2014" : `${gb(selected.sizeBytes)} GB
|
|
67673
|
+
["Resident", selected?.sizeBytes === null || selected === null ? adminAbsent && selected?.local ? "unknown \xB7 not exposed by mlx-serve" : "\u2014" : `${gb(selected.sizeBytes)} GB`, adminAbsent && selected?.local === true && selected?.sizeBytes === null]
|
|
67450
67674
|
].slice(column * 5, column * 5 + 5).map(
|
|
67451
|
-
([key5, value3]) => h3.div.class("router-kv").children(
|
|
67675
|
+
([key5, value3, gap]) => h3.div.class("router-kv").children(
|
|
67452
67676
|
h3.span.class("router-kv-key").children(key5),
|
|
67453
|
-
h3.span.class("router-kv-value").children(value3)
|
|
67677
|
+
h3.span.class("router-kv-value").attr("data-gap", gap === true ? "true" : void 0).children(value3)
|
|
67454
67678
|
)
|
|
67455
67679
|
)
|
|
67456
67680
|
))
|
|
@@ -67643,7 +67867,9 @@ var RoutingPage = Html_exports.component({
|
|
|
67643
67867
|
}),
|
|
67644
67868
|
h3.div.class("router-note").children(
|
|
67645
67869
|
`${policy.floorTps} tps floor \xB7 memory guard ${gb(max6)} GB \xB7 ${gb(used)} / ${gb(max6)} GB used`
|
|
67646
|
-
)
|
|
67870
|
+
),
|
|
67871
|
+
// R-40-05: the compact speed strip, the same series the Telemetry page draws.
|
|
67872
|
+
h3.div.class("router-note").attr("data-speed-strip", "").children(speedStripLine(h3, payload.view.speedStrip))
|
|
67647
67873
|
),
|
|
67648
67874
|
h3.div.class("router-card router-panel").attr("data-surface", "raised").children(
|
|
67649
67875
|
h3.div.class("router-card-head").children(
|
|
@@ -68051,9 +68277,19 @@ var EnginePage = Html_exports.component({
|
|
|
68051
68277
|
const healthy = payload.health.status === "healthy";
|
|
68052
68278
|
const tested = payload.health.checkedAt === null ? "not tested" : clock(payload.health.checkedAt);
|
|
68053
68279
|
const capabilityReport = payload.capabilities ?? null;
|
|
68054
|
-
const
|
|
68055
|
-
const
|
|
68280
|
+
const engineKind = enginePayloadKind(payload);
|
|
68281
|
+
const adminAbsent = engineAdminAbsent(payload);
|
|
68282
|
+
const gapCopy = engineGapCopy(enginePayloadKind(payload));
|
|
68056
68283
|
const capabilityDrift = capabilityReport !== null && capabilityReport !== void 0 && capabilityReport.drift !== null && capabilityReport.drift !== void 0;
|
|
68284
|
+
const engineMetaLine = adminAbsent ? gapCopy.adminLine : capabilityDrift ? "capability drift: the engine report disagrees with the adapter" : null;
|
|
68285
|
+
const telemetrySnapshot = payload.evidence.telemetry.snapshot;
|
|
68286
|
+
const memoryUsed = telemetrySnapshot?.activity.memoryUsedBytes ?? null;
|
|
68287
|
+
const memoryMax = telemetrySnapshot?.activity.memoryMaxBytes ?? null;
|
|
68288
|
+
const pressureLevel = telemetrySnapshot?.pressureLevel ?? null;
|
|
68289
|
+
const waitingCount = telemetrySnapshot?.activity.waitingRequests ?? null;
|
|
68290
|
+
const memoryFact = adminAbsent ? gapCopy.memory : engineMemoryFact(memoryUsed, memoryMax);
|
|
68291
|
+
const pressureFact = adminAbsent ? gapCopy.pressure : enginePressureFact(pressureLevel);
|
|
68292
|
+
const waitingFact = adminAbsent ? gapCopy.waiting : engineWaitingFact(waitingCount);
|
|
68057
68293
|
return PageFrame(h3, {
|
|
68058
68294
|
// D6 (P6, boards 17RD-0/17VD-0): the board puts Test/Save at the page
|
|
68059
68295
|
// bottom, so they go in the frame's footer action cluster (DEC-34-03 keeps
|
|
@@ -68069,7 +68305,9 @@ var EnginePage = Html_exports.component({
|
|
|
68069
68305
|
h3.div.class("router-engine-grid").children(
|
|
68070
68306
|
h3.div.class("router-card router-panel").attr("data-surface", "raised").children(
|
|
68071
68307
|
h3.div.class("router-card-head").children(
|
|
68072
|
-
|
|
68308
|
+
// Run 39: the card names the active engine kind (never guessed).
|
|
68309
|
+
h3.span.class("router-card-label").children(engineStatement(engineKind)),
|
|
68310
|
+
...engineMetaLine === null ? [] : [h3.span.class("router-card-meta").children(engineMetaLine)]
|
|
68073
68311
|
),
|
|
68074
68312
|
// Run 17, R-17-03: the adapter row is a labelled group of non-interactive
|
|
68075
68313
|
// chips. Each chip says "current" or "later" in its own text, so the
|
|
@@ -68082,14 +68320,20 @@ var EnginePage = Html_exports.component({
|
|
|
68082
68320
|
// Board 17RD-0: KIND / ENDPOINT / AUTH / HEALTH under a hairline, not prose.
|
|
68083
68321
|
h3.div.class("router-engine-facts").children(
|
|
68084
68322
|
...[
|
|
68085
|
-
["kind",
|
|
68086
|
-
["
|
|
68087
|
-
["
|
|
68088
|
-
["
|
|
68323
|
+
["kind", engineKindFact(engineKind, payload.adapter.label), false],
|
|
68324
|
+
["speed", speedStripLine(h3, payload.speedStrip), false],
|
|
68325
|
+
["endpoint", payload.connection.endpoint, false],
|
|
68326
|
+
["auth", `${payload.connection.authKind === "bearer" ? "bearer" : "no auth"} \xB7 ${payload.connection.source}`, false],
|
|
68327
|
+
["health", payload.health.httpStatus === null ? "unreachable" : `healthy \xB7 ${payload.health.httpStatus} \xB7 ${tested}`, false],
|
|
68328
|
+
// Run 39: memory, pressure and waiting name their cause when the
|
|
68329
|
+
// engine cannot report them; a real 0 still renders "0".
|
|
68330
|
+
["memory", memoryFact, adminAbsent || memoryUsed === null || memoryMax === null],
|
|
68331
|
+
["pressure", pressureFact, adminAbsent || pressureLevel === null],
|
|
68332
|
+
["waiting", waitingFact, adminAbsent || waitingCount === null]
|
|
68089
68333
|
].map(
|
|
68090
|
-
([label, value3]) => h3.div.class("router-engine-fact").children(
|
|
68334
|
+
([label, value3, gap]) => h3.div.class("router-engine-fact").children(
|
|
68091
68335
|
h3.div.class("router-engine-fact-label").children(label),
|
|
68092
|
-
h3.div.class("router-engine-fact-value").children(value3)
|
|
68336
|
+
h3.div.class("router-engine-fact-value").attr("data-gap", gap ? "true" : void 0).children(value3)
|
|
68093
68337
|
)
|
|
68094
68338
|
)
|
|
68095
68339
|
)
|
|
@@ -68106,7 +68350,7 @@ var EnginePage = Html_exports.component({
|
|
|
68106
68350
|
key: "endpoint",
|
|
68107
68351
|
props: { filled: model.endpointDraft !== "" },
|
|
68108
68352
|
view: (field2) => field2.root(h3.div.class("router-field")).children(
|
|
68109
|
-
field2.label(h3.label.class("router-field-label")).children("
|
|
68353
|
+
field2.label(h3.label.class("router-field-label")).children("Endpoint"),
|
|
68110
68354
|
Input(h3, {
|
|
68111
68355
|
element: field2.control(h3.input.class("router-input")),
|
|
68112
68356
|
props: { value: model.endpointDraft },
|
|
@@ -68140,7 +68384,9 @@ var EnginePage = Html_exports.component({
|
|
|
68140
68384
|
(entry) => h3.div.class("router-engine-model").children(
|
|
68141
68385
|
h3.span.children(entry.id),
|
|
68142
68386
|
h3.span.class("router-engine-model-state").children(
|
|
68143
|
-
|
|
68387
|
+
// Run 39: mlx-serve reports the served state, not admin-API
|
|
68388
|
+
// residency semantics.
|
|
68389
|
+
engineKindLabel(engineKind) === "mlx-serve" ? "served" : entry.default ? "default \xB7 loaded" : entry.loaded ? "loaded" : "resident"
|
|
68144
68390
|
)
|
|
68145
68391
|
)
|
|
68146
68392
|
)
|
|
@@ -68154,6 +68400,132 @@ var EnginePage = Html_exports.component({
|
|
|
68154
68400
|
if (typeof document !== "undefined" && document.head !== null) {
|
|
68155
68401
|
injectRouterSheet(document, "evidence", EvidenceContentCss);
|
|
68156
68402
|
}
|
|
68403
|
+
var telemetryReadingLine = (drawnRange, selectedRange) => selectedRange === void 0 || selectedRange === drawnRange ? null : "reading " + selectedRange + " \u2026";
|
|
68404
|
+
var speedStripLine = (h3, strip) => {
|
|
68405
|
+
if (strip === null || strip === void 0) return "speed \xB7 not captured";
|
|
68406
|
+
if (strip.available !== true) return "speed \xB7 not reported (" + (strip.reason ?? "no series") + ")";
|
|
68407
|
+
return "speed \xB7 p50 " + (strip.p50 ?? "\u2014") + " tps \xB7 floor " + strip.floor + " \xB7 " + (strip.belowFloor ?? 0) + " of " + strip.total + " below floor \xB7 " + strip.range;
|
|
68408
|
+
};
|
|
68409
|
+
var stepIndex = (pct) => Math.max(0, Math.min(40, Math.round(pct / 2.5)));
|
|
68410
|
+
var step3 = (pct) => "w" + Math.max(0, Math.min(20, Math.round(pct / 5)));
|
|
68411
|
+
var scatterDotClass = (xPct, yPct) => "router-tl-dot w" + stepIndex(xPct) + " scatter-y-" + stepIndex(yPct);
|
|
68412
|
+
var TelemetryPageSchema = Schema_exports.Struct({
|
|
68413
|
+
/** The window the reader selected; when it differs from view.range, data is in flight. */
|
|
68414
|
+
selectedRange: Schema_exports.optional(Schema_exports.Literals(["24h", "7d", "all"])),
|
|
68415
|
+
// Only the series: the page never reads the envelope, and a narrower schema keeps
|
|
68416
|
+
// the mount-time validation honest instead of validating fields nobody uses.
|
|
68417
|
+
view: TelemetrySeriesSchema
|
|
68418
|
+
});
|
|
68419
|
+
var meter = (h3, label, value3, pct, danger = false) => h3.div.class("router-tl-meter").attr("data-danger", danger ? "true" : void 0).children(
|
|
68420
|
+
h3.span.class("router-tl-meter-label").children(label),
|
|
68421
|
+
h3.div.class("router-tl-meter-track").children(
|
|
68422
|
+
h3.div.class("router-tl-meter-fill " + step3(pct))
|
|
68423
|
+
),
|
|
68424
|
+
h3.span.class("router-tl-meter-value").children(String(value3))
|
|
68425
|
+
);
|
|
68426
|
+
var unavailable = (h3, reason) => h3.div.class("router-tl-unavailable").children(
|
|
68427
|
+
h3.span.class("router-tl-kpi-label").children("not reported"),
|
|
68428
|
+
h3.span.class("router-tl-reason").children(reason ?? "this series could not be computed")
|
|
68429
|
+
);
|
|
68430
|
+
var card = (h3, label, titleText, children3, wide = false) => h3.div.class("router-card router-panel router-tl-card" + (wide ? " router-tl-card-wide" : "")).attr("data-surface", "raised").children(
|
|
68431
|
+
h3.div.class("router-card-label").children(label),
|
|
68432
|
+
h3.div.class("router-tl-card-title").children(titleText),
|
|
68433
|
+
...children3
|
|
68434
|
+
);
|
|
68435
|
+
var TelemetryPage = Html_exports.component({
|
|
68436
|
+
name: "TelemetryPage",
|
|
68437
|
+
props: TelemetryPageSchema,
|
|
68438
|
+
model: Schema_exports.Struct({}),
|
|
68439
|
+
message: Schema_exports.Never
|
|
68440
|
+
}).make({
|
|
68441
|
+
init: () => ({}),
|
|
68442
|
+
update: ($) => $.model,
|
|
68443
|
+
view: (h3) => {
|
|
68444
|
+
const { view: view2, selectedRange } = h3.props;
|
|
68445
|
+
const reading = telemetryReadingLine(view2.range, selectedRange);
|
|
68446
|
+
const maxSpeed = Math.max(1, ...view2.speed.bands.map((b) => b.count));
|
|
68447
|
+
const maxPrompt = Math.max(1, ...view2.prompt.bands.map((b) => b.count));
|
|
68448
|
+
const maxGate = Math.max(1, ...view2.gates.gates.map((g) => g.count));
|
|
68449
|
+
const maxHour = Math.max(1, ...view2.traffic.hours.map((row) => row.count));
|
|
68450
|
+
const shownHours = view2.traffic.hours.filter((row) => row.count > 0).slice(-10);
|
|
68451
|
+
const kpi = (value3, label, sub) => h3.div.class("router-tl-kpi").children(
|
|
68452
|
+
h3.div.class("router-tl-kpi-value").children(value3),
|
|
68453
|
+
h3.div.class("router-tl-kpi-label").children(label),
|
|
68454
|
+
h3.div.class("router-tl-kpi-sub").children(sub)
|
|
68455
|
+
);
|
|
68456
|
+
return PageFrame(h3, {
|
|
68457
|
+
props: { variant: "railless" },
|
|
68458
|
+
slots: {
|
|
68459
|
+
content: [
|
|
68460
|
+
h3.div.class("page-body").children(
|
|
68461
|
+
...reading === null ? [] : [h3.div.class("router-tl-reading").attr("data-range-reading", "").children(reading)],
|
|
68462
|
+
h3.div.class("router-tl-kpis").children(
|
|
68463
|
+
kpi(view2.kpis.medianDecodeTps === null ? "not reported" : String(view2.kpis.medianDecodeTps), "median decode", "tps \xB7 per request"),
|
|
68464
|
+
kpi(view2.kpis.p90DecodeTps === null ? "not reported" : String(view2.kpis.p90DecodeTps), "p90 decode", "tps \xB7 per request"),
|
|
68465
|
+
kpi(view2.kpis.remoteShare === null ? "not reported" : view2.kpis.remoteShare + "%", "remote", view2.kpis.decisions + " decisions"),
|
|
68466
|
+
kpi(view2.kpis.medianDecisionMs === null ? "not reported" : view2.kpis.medianDecisionMs + " ms", "median decision", "p99 " + (view2.kpis.p99DecisionMs === null ? "\u2014" : view2.kpis.p99DecisionMs + " ms"))
|
|
68467
|
+
),
|
|
68468
|
+
h3.div.class("router-tl-grid").children(
|
|
68469
|
+
card(h3, "Speed \xB7 decode tokens per second", "The floor sits inside the common band", view2.speed.available ? [
|
|
68470
|
+
...view2.speed.bands.map((band2) => meter(h3, band2.band, band2.count, band2.count / maxSpeed * 100, Number(band2.band.split("-")[0]) === view2.speed.floor)),
|
|
68471
|
+
h3.div.class("router-tl-foot").children("median " + (view2.speed.median ?? "\u2014") + " \xB7 p90 " + (view2.speed.p90 ?? "\u2014") + " \xB7 " + (view2.speed.belowFloor ?? 0) + " below the " + (view2.speed.floor ?? 30) + " tps floor")
|
|
68472
|
+
] : [unavailable(h3, view2.speed.reason)]),
|
|
68473
|
+
card(h3, "Speed \xB7 against context", "Prompt size does not predict the fail", view2.scatter.available ? [
|
|
68474
|
+
// DEC-40-04: the approved design draws the scatter as positioned dots.
|
|
68475
|
+
// foldkit-viz is vendored and its scatter renderer is tested, but the
|
|
68476
|
+
// page cannot inject its SVG yet (Effect UI offers no confirmed
|
|
68477
|
+
// property path in this snapshot), so the dots stay until the bridge
|
|
68478
|
+
// is proven. A half-wired plot would be worse than the fallback.
|
|
68479
|
+
h3.div.class("router-tl-scatter").children(
|
|
68480
|
+
...(() => {
|
|
68481
|
+
const yTop = Math.max(60, Math.ceil(Math.max(...view2.scatter.points.map((p) => p.tps)) / 20) * 20);
|
|
68482
|
+
return view2.scatter.points.map(
|
|
68483
|
+
(point) => h3.div.class(
|
|
68484
|
+
scatterDotClass(
|
|
68485
|
+
point.promptTokens / (view2.scatter.xMax ?? 131072) * 100,
|
|
68486
|
+
point.tps / yTop * 100
|
|
68487
|
+
)
|
|
68488
|
+
).attr("data-below-floor", point.tps < (view2.scatter.floor ?? 30) ? "true" : void 0)
|
|
68489
|
+
);
|
|
68490
|
+
})()
|
|
68491
|
+
),
|
|
68492
|
+
h3.div.class("router-tl-foot").children(view2.scatter.n + " requests \xB7 " + view2.scatter.plotted + " plotted \xB7 floor " + (view2.scatter.floor ?? 30) + " tps")
|
|
68493
|
+
] : [unavailable(h3, view2.scatter.reason)]),
|
|
68494
|
+
card(h3, "Decisions \xB7 gate and cost", "Why it decided, and what that cost", view2.gates.available ? [
|
|
68495
|
+
...view2.gates.gates.map((gate) => meter(h3, gate.gate, gate.count, gate.count / maxGate * 100)),
|
|
68496
|
+
...view2.latency.available ? [
|
|
68497
|
+
meter(h3, "p50", (view2.latency.p50 ?? 0) + " ms", (view2.latency.p50 ?? 0) / Math.max(1, view2.latency.p99 ?? 1) * 100),
|
|
68498
|
+
meter(h3, "p99", (view2.latency.p99 ?? 0) + " ms", 100),
|
|
68499
|
+
// The board's footer: the decision count and what the latency is.
|
|
68500
|
+
h3.div.class("router-tl-foot").children((view2.gates.total ?? 0) + " decisions \xB7 latency is the router's own cost")
|
|
68501
|
+
] : [unavailable(h3, view2.latency.reason)]
|
|
68502
|
+
] : [unavailable(h3, view2.gates.reason)]),
|
|
68503
|
+
card(h3, "Context \xB7 prompt tokens per request", "Most requests carry 32\u201364k tokens", view2.prompt.available ? [
|
|
68504
|
+
...view2.prompt.bands.map((band2) => meter(h3, band2.band, band2.count, band2.count / maxPrompt * 100)),
|
|
68505
|
+
h3.div.class("router-tl-foot").children("median " + (view2.prompt.median ?? "\u2014") + " \xB7 max " + (view2.prompt.max ?? "\u2014"))
|
|
68506
|
+
] : [unavailable(h3, view2.prompt.reason)]),
|
|
68507
|
+
card(h3, "Traffic \xB7 decisions per hour", "Traffic is bursty, not a load curve", view2.traffic.available ? [
|
|
68508
|
+
h3.div.class("router-tl-bars").children(
|
|
68509
|
+
...shownHours.map(
|
|
68510
|
+
(row) => h3.div.class("router-tl-bar-col").children(
|
|
68511
|
+
h3.span.class("router-tl-bar-count").children(String(row.count)),
|
|
68512
|
+
h3.div.class("router-tl-bar-track").children(
|
|
68513
|
+
h3.div.class("router-tl-bar h" + Math.max(1, Math.min(20, Math.round(row.count / maxHour * 20))))
|
|
68514
|
+
),
|
|
68515
|
+
h3.span.class("router-tl-bar-label").children(localHour(row.hour))
|
|
68516
|
+
)
|
|
68517
|
+
)
|
|
68518
|
+
),
|
|
68519
|
+
h3.div.class("router-tl-foot").children(shownHours.length + " hours with traffic \xB7 " + (view2.traffic.quiet ?? 0) + " quiet hours omitted, not drawn as zero")
|
|
68520
|
+
] : [unavailable(h3, view2.traffic.reason)], true)
|
|
68521
|
+
),
|
|
68522
|
+
h3.div.class("router-tl-foot").children("range " + view2.range + " \xB7 " + view2.kpis.observations + " observations \xB7 " + view2.kpis.decisions + " decisions \xB7 every series is per-request, never an engine average")
|
|
68523
|
+
)
|
|
68524
|
+
]
|
|
68525
|
+
}
|
|
68526
|
+
});
|
|
68527
|
+
}
|
|
68528
|
+
});
|
|
68157
68529
|
|
|
68158
68530
|
// packages/ui/src/SettingsPages.ts
|
|
68159
68531
|
var chevron2 = (h3) => h3.svg.class("router-select-chevron").attr("width", "9").attr("height", "6").attr("viewBox", "0 0 9 6").attr("aria-hidden", "true").children(
|
|
@@ -68966,24 +69338,27 @@ var TABS = [
|
|
|
68966
69338
|
{ id: "activity", label: "Activity" },
|
|
68967
69339
|
{ id: "engine", label: "Engine" },
|
|
68968
69340
|
{ id: "context", label: "Context" },
|
|
68969
|
-
{ id: "roles", label: "Roles" }
|
|
69341
|
+
{ id: "roles", label: "Roles" },
|
|
69342
|
+
{ id: "telemetry", label: "Telemetry" }
|
|
68970
69343
|
];
|
|
68971
69344
|
var EMPTY_COPY = {
|
|
68972
69345
|
models: "Start a model in the backend, then Refresh.",
|
|
68973
69346
|
routing: "Enable Auto routing for this session, then send a message. Each decision is written to the ledger and kept across restarts.",
|
|
68974
69347
|
activity: "Decisions appear here once routing records a request. History is persisted in the ledger file and survives restarts.",
|
|
68975
|
-
engine: "Choose an adapter, then test the connection."
|
|
69348
|
+
engine: "Choose an adapter, then test the connection.",
|
|
69349
|
+
telemetry: "Send a request through the router; every series is computed from the ledger and the request observations."
|
|
68976
69350
|
};
|
|
68977
69351
|
var OFFLINE_COPY = {
|
|
68978
69352
|
models: ["Local backend offline", "Policy only. Remote models still routable."],
|
|
68979
69353
|
routing: ["No current decision", "Offline: routing falls back to remote. No edits."],
|
|
68980
69354
|
activity: ["Ledger offline", "Cached rows stay visible, labelled offline."],
|
|
68981
|
-
engine: ["Backend unreachable", "Saved endpoint retained; routing policy untouched."]
|
|
69355
|
+
engine: ["Backend unreachable", "Saved endpoint retained; routing policy untouched."],
|
|
69356
|
+
telemetry: ["Telemetry offline", "The series cannot be read; the last read is not faked."]
|
|
68982
69357
|
};
|
|
68983
69358
|
var clock2 = (iso) => {
|
|
68984
69359
|
if (iso === null || iso === void 0) return "\u2014";
|
|
68985
69360
|
const ms = Date.parse(iso);
|
|
68986
|
-
return Number.isFinite(ms) ?
|
|
69361
|
+
return Number.isFinite(ms) ? localClock(ms) : "\u2014";
|
|
68987
69362
|
};
|
|
68988
69363
|
var variantFor = (tab) => tab === "overview" || tab === "engine" || tab === "activity" || tab === "context" || tab === "roles" ? "railless" : "split";
|
|
68989
69364
|
var noticeFor = (tab, payload, surface) => {
|
|
@@ -68991,6 +69366,17 @@ var noticeFor = (tab, payload, surface) => {
|
|
|
68991
69366
|
if (tab === "models") return { state: "partial", title: "Pool metrics missing", message: "Model list and policy loaded; per-model metrics are not captured." };
|
|
68992
69367
|
if (tab === "routing") return null;
|
|
68993
69368
|
if (tab === "activity") return { state: "partial", title: "Some rows lack adapter metrics", message: "Gaps are marked; values are never invented." };
|
|
69369
|
+
if (tab === "telemetry" && payload.kind === "telemetry") {
|
|
69370
|
+
const missing3 = [
|
|
69371
|
+
payload.view.sources.ledger.available === false ? "the ledger" : null,
|
|
69372
|
+
payload.view.sources.observations.available === false ? "the request observations" : null
|
|
69373
|
+
].filter((value3) => value3 !== null);
|
|
69374
|
+
return {
|
|
69375
|
+
state: "partial",
|
|
69376
|
+
title: missing3.length === 0 ? "Some series are incomplete" : "Reading " + missing3.join(" and "),
|
|
69377
|
+
message: missing3.length === 0 ? "Series with no observations say so on their card." : "No request has been measured yet in this window; the cards name what is missing."
|
|
69378
|
+
};
|
|
69379
|
+
}
|
|
68994
69380
|
return { state: "partial", title: "Connection OK \xB7 models failed", message: "0 models discovered; the connection is saved." };
|
|
68995
69381
|
}
|
|
68996
69382
|
if (surface !== "stale") return null;
|
|
@@ -69006,7 +69392,7 @@ var noticeFor = (tab, payload, surface) => {
|
|
|
69006
69392
|
}
|
|
69007
69393
|
return { state: "stale", title: `Health ${clock2(payload.kind === "engine" ? payload.health.checkedAt : null)} \xB7 stale`, message: "Last health result shown with its timestamp." };
|
|
69008
69394
|
};
|
|
69009
|
-
var pageFor = (tab, payload) => {
|
|
69395
|
+
var pageFor = (tab, payload, telemetryRange = "7d") => {
|
|
69010
69396
|
if (tab === "models" && payload.kind === "models") {
|
|
69011
69397
|
return { component: ModelsPage, props: { payload } };
|
|
69012
69398
|
}
|
|
@@ -69019,6 +69405,9 @@ var pageFor = (tab, payload) => {
|
|
|
69019
69405
|
if (tab === "engine" && payload.kind === "engine") {
|
|
69020
69406
|
return { component: EnginePage, props: { payload } };
|
|
69021
69407
|
}
|
|
69408
|
+
if (tab === "telemetry" && payload.kind === "telemetry") {
|
|
69409
|
+
return { component: TelemetryPage, props: { view: payload.view, selectedRange: telemetryRange } };
|
|
69410
|
+
}
|
|
69022
69411
|
return null;
|
|
69023
69412
|
};
|
|
69024
69413
|
var healthFor = (view2, tab) => {
|
|
@@ -69033,6 +69422,7 @@ var RouterPage = () => {
|
|
|
69033
69422
|
const [views, setViews] = (0, import_react2.useState)({});
|
|
69034
69423
|
const [settingsDocs, setSettingsDocs] = (0, import_react2.useState)({});
|
|
69035
69424
|
const [revision, setRevision] = (0, import_react2.useState)(0);
|
|
69425
|
+
const [telemetryRange, setTelemetryRange] = (0, import_react2.useState)("7d");
|
|
69036
69426
|
const [settingsOpen, setSettingsOpen] = (0, import_react2.useState)(false);
|
|
69037
69427
|
const [overview, setOverview] = (0, import_react2.useState)(null);
|
|
69038
69428
|
const [models, setModels] = (0, import_react2.useState)([]);
|
|
@@ -69101,14 +69491,16 @@ var RouterPage = () => {
|
|
|
69101
69491
|
(0, import_react2.useEffect)(() => {
|
|
69102
69492
|
if (tab === "overview") return;
|
|
69103
69493
|
if (tab === "context" || tab === "roles") return;
|
|
69104
|
-
|
|
69494
|
+
const fetchKey = tab === "telemetry" ? revision + ":" + telemetryRange : revision;
|
|
69495
|
+
if (fetchedRevision.current[tab] === fetchKey) return;
|
|
69105
69496
|
const controller = new AbortController();
|
|
69106
69497
|
const evidenceTab = tab;
|
|
69107
69498
|
const write2 = (next3) => setViews((current3) => ({ ...current3, [evidenceTab]: next3 }));
|
|
69108
|
-
|
|
69109
|
-
|
|
69499
|
+
const keepingLast = evidenceTab === "telemetry" && lastGood.current[evidenceTab] !== void 0;
|
|
69500
|
+
if (!keepingLast) write2(LOADING_VIEW);
|
|
69501
|
+
fetchEvidence(evidenceTab, { signal: controller.signal, ...evidenceTab === "telemetry" ? { range: telemetryRange } : {} }).then((result3) => {
|
|
69110
69502
|
if (controller.signal.aborted) return;
|
|
69111
|
-
fetchedRevision.current[evidenceTab] =
|
|
69503
|
+
fetchedRevision.current[evidenceTab] = fetchKey;
|
|
69112
69504
|
if (!result3.ok) {
|
|
69113
69505
|
if (result3.status === null) {
|
|
69114
69506
|
write2({ status: "offline", payload: lastGood.current[evidenceTab] ?? null });
|
|
@@ -69135,7 +69527,7 @@ var RouterPage = () => {
|
|
|
69135
69527
|
write2({ status: "offline", payload: lastGood.current[evidenceTab] ?? null });
|
|
69136
69528
|
});
|
|
69137
69529
|
return () => controller.abort();
|
|
69138
|
-
}, [tab, revision]);
|
|
69530
|
+
}, [tab, revision, telemetryRange]);
|
|
69139
69531
|
(0, import_react2.useEffect)(() => {
|
|
69140
69532
|
if (tab !== "context" && tab !== "roles") return;
|
|
69141
69533
|
if (fetchedRevision.current[tab] === revision) return;
|
|
@@ -69273,11 +69665,57 @@ var RouterPage = () => {
|
|
|
69273
69665
|
return;
|
|
69274
69666
|
}
|
|
69275
69667
|
const variant = variantFor(id2);
|
|
69668
|
+
let telemetryRow = null;
|
|
69669
|
+
if (id2 === "telemetry") {
|
|
69670
|
+
const row = document.createElement("div");
|
|
69671
|
+
row.className = "router-range-row";
|
|
69672
|
+
row.setAttribute("data-range-row", "");
|
|
69673
|
+
row.style.display = "flex";
|
|
69674
|
+
row.style.flexDirection = "row";
|
|
69675
|
+
row.style.alignItems = "center";
|
|
69676
|
+
row.style.gap = "6px";
|
|
69677
|
+
row.style.padding = "8px 0 4px";
|
|
69678
|
+
for (const entry of TELEMETRY_RANGES) {
|
|
69679
|
+
const button = document.createElement("button");
|
|
69680
|
+
button.type = "button";
|
|
69681
|
+
button.className = "router-button router-range-chip";
|
|
69682
|
+
button.setAttribute("data-control", "");
|
|
69683
|
+
button.setAttribute("data-range", entry.id);
|
|
69684
|
+
button.setAttribute("aria-pressed", telemetryRange === entry.id ? "true" : "false");
|
|
69685
|
+
button.textContent = entry.label;
|
|
69686
|
+
button.style.fontFamily = "inherit";
|
|
69687
|
+
button.style.fontSize = "11px";
|
|
69688
|
+
button.style.minHeight = "24px";
|
|
69689
|
+
button.style.padding = "0 10px";
|
|
69690
|
+
button.style.border = "1px solid var(--color-line-panel)";
|
|
69691
|
+
button.style.borderRadius = "4px";
|
|
69692
|
+
button.style.background = telemetryRange === entry.id ? "var(--color-ink)" : "transparent";
|
|
69693
|
+
button.style.color = telemetryRange === entry.id ? "var(--color-bg)" : "var(--color-body)";
|
|
69694
|
+
button.style.cursor = "pointer";
|
|
69695
|
+
button.addEventListener("click", () => setTelemetryRange(entry.id));
|
|
69696
|
+
row.append(button);
|
|
69697
|
+
}
|
|
69698
|
+
content.wrapper.append(row);
|
|
69699
|
+
telemetryRow = row;
|
|
69700
|
+
}
|
|
69276
69701
|
const view2 = views[id2] ?? LOADING_VIEW;
|
|
69702
|
+
if (telemetryRow !== null && view2.status === "ready" && view2.payload.kind === "telemetry") {
|
|
69703
|
+
const provenance = document.createElement("span");
|
|
69704
|
+
provenance.className = "router-range-provenance";
|
|
69705
|
+
provenance.setAttribute("data-range-provenance", "");
|
|
69706
|
+
provenance.style.fontFamily = "inherit";
|
|
69707
|
+
provenance.style.fontSize = "10.5px";
|
|
69708
|
+
provenance.style.color = "var(--color-meta)";
|
|
69709
|
+
provenance.style.marginLeft = "10px";
|
|
69710
|
+
const raw = view2.payload.backend.kind;
|
|
69711
|
+
const kind = raw === "omlx" ? "oMLX" : raw === "mlx-serve" ? "mlx-serve" : raw === "unknown" ? "engine" : raw;
|
|
69712
|
+
provenance.textContent = "Engine \xB7 " + kind + " \xB7 " + view2.payload.view.kpis.observations + " observations \xB7 " + view2.payload.view.kpis.decisions + " decisions";
|
|
69713
|
+
telemetryRow.append(provenance);
|
|
69714
|
+
}
|
|
69277
69715
|
if (view2.status === "ready") {
|
|
69278
69716
|
const notice = noticeFor(id2, view2.payload, view2.surface);
|
|
69279
69717
|
if (notice !== null) mount3(content, EvidenceNotice, notice);
|
|
69280
|
-
const page = pageFor(id2, view2.payload);
|
|
69718
|
+
const page = pageFor(id2, view2.payload, telemetryRange);
|
|
69281
69719
|
if (page !== null) mount3(content, page.component, page.props);
|
|
69282
69720
|
} else if (view2.status === "empty") {
|
|
69283
69721
|
mount3(content, EvidenceStatus, { tab: id2, state: "empty", message: EMPTY_COPY[id2], hint: view2.hint, variant });
|
|
@@ -69294,7 +69732,7 @@ var RouterPage = () => {
|
|
|
69294
69732
|
const [title, message] = OFFLINE_COPY[id2];
|
|
69295
69733
|
mount3(content, EvidenceNotice, { state: "offline", title, message });
|
|
69296
69734
|
if (view2.payload !== null) {
|
|
69297
|
-
const page = pageFor(id2, view2.payload);
|
|
69735
|
+
const page = pageFor(id2, view2.payload, telemetryRange);
|
|
69298
69736
|
if (page !== null) mount3(content, page.component, page.props);
|
|
69299
69737
|
} else {
|
|
69300
69738
|
mount3(content, EvidenceStatus, { tab: id2, state: "error", message, variant });
|
|
@@ -69318,7 +69756,8 @@ var RouterPage = () => {
|
|
|
69318
69756
|
models,
|
|
69319
69757
|
policyError,
|
|
69320
69758
|
overviewError,
|
|
69321
|
-
mountKey: overviewMountKey.current
|
|
69759
|
+
mountKey: overviewMountKey.current,
|
|
69760
|
+
telemetryRange
|
|
69322
69761
|
};
|
|
69323
69762
|
const plan = planTabs(tabRegistry.current, tab, signatureForTab(tab, inputs));
|
|
69324
69763
|
tabRegistry.current = plan.registry;
|
|
@@ -69352,7 +69791,7 @@ var RouterPage = () => {
|
|
|
69352
69791
|
);
|
|
69353
69792
|
}
|
|
69354
69793
|
}
|
|
69355
|
-
}, [tab, views, settingsDocs, revision, overview, models, policyError, overviewError, editorOpen, buildMismatch]);
|
|
69794
|
+
}, [tab, telemetryRange, views, settingsDocs, revision, overview, models, policyError, overviewError, editorOpen, buildMismatch]);
|
|
69356
69795
|
(0, import_react2.useEffect)(() => {
|
|
69357
69796
|
return () => {
|
|
69358
69797
|
const disposal = planDispose(tabRegistry.current);
|