@try-works/dsh-minimal-router 0.2.12 → 0.2.14

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.
Files changed (2) hide show
  1. package/client/index.js +63 -19
  2. package/package.json +1 -1
package/client/index.js CHANGED
@@ -66593,6 +66593,17 @@ var ShellCss = `
66593
66593
  fold when it is shorter (F-34-21). One rule for the content column: display,
66594
66594
  overflow and the 60vh floor live together (F-34-08). */
66595
66595
  [data-router-shell] [data-router-content] { display: flex !important; flex-direction: column; flex: 1 1 auto; min-height: 60vh; overflow-y: auto; overflow-x: hidden; }
66596
+ /* Run 40 (F-40-21, Owner): the window chips sit beside the page frame in the tab
66597
+ wrapper, so they must use the frame's container column - same max width, same
66598
+ centred gutter - or they hang at the viewport edge while the page is centred. */
66599
+ [data-router-shell] .router-range-row {
66600
+ width: 100%;
66601
+ max-width: var(--container-page);
66602
+ margin: 0 auto;
66603
+ padding-block: var(--spacing-2) 0;
66604
+ padding-inline: var(--container-gutter);
66605
+ box-sizing: border-box;
66606
+ }
66596
66607
  /* A mounted tab is a flex column too, so the page frame can fill it. These are
66597
66608
  NOT !important: a hidden tab keeps its inline display:none. */
66598
66609
  [data-router-shell] [data-router-tab],
@@ -66655,6 +66666,7 @@ var ShellCss = `
66655
66666
  /* The build-mismatch banner (R-30-02): one class, not an inline style string. */
66656
66667
  [data-router-shell] .router-build-mismatch { display: flex; align-items: center; margin: 12px 32px; padding: 10px 14px; border: 1px solid var(--color-danger); border-radius: var(--radius-input); background: var(--color-subtle); color: var(--color-ink); font-family: var(--font-ui); font-size: var(--text-meta); line-height: var(--leading-meta); }
66657
66668
  @media (max-width: 760px) {
66669
+ [data-router-shell] .router-range-row { padding-inline: var(--container-gutter-sm); }
66658
66670
  /* DEC-34-05 re-measured on the board's composition: 70px of tab rows (12 top
66659
66671
  padding + 28 + 2 gap + 28) + the 44px status row + the 1px rule = 115px. */
66660
66672
  [data-router-shell] { --shell-header: 115px; }
@@ -66820,6 +66832,14 @@ var TELEMETRY_CSS = [
66820
66832
  ".router-tl-foot { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
66821
66833
  ".router-tl-unavailable { display: flex; flex-direction: column; gap: 2px; }",
66822
66834
  ".router-tl-reason { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-meta); }",
66835
+ /* F-40-22: the plot fills the card and carries labelled axes, like the board. */
66836
+ ".router-tl-plot { display: flex; flex-direction: row; gap: 6px; flex: 1 1 auto; min-height: 140px; }",
66837
+ ".router-tl-yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; width: 34px; flex: 0 0 auto; padding-block: 2px; }",
66838
+ ".router-tl-plotarea { position: relative; flex: 1 1 auto; min-width: 0; border-left: 1px solid var(--color-line-rule); border-bottom: 1px solid var(--color-line-rule); }",
66839
+ ".router-tl-xaxis { display: flex; flex-direction: row; justify-content: space-between; padding-left: 40px; }",
66840
+ ".router-tl-tick { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
66841
+ ".router-tl-floor-rule { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--color-danger); opacity: 0.7; }",
66842
+ ...Array.from({ length: 41 }, (_, i) => ".router-tl-floor-rule.fy-" + i + " { bottom: " + i * 2.5 + "%; }"),
66823
66843
  ".router-tl-scatter { position: relative; height: 150px; border-left: 1px solid var(--color-line-rule); border-bottom: 1px solid var(--color-line-rule); }",
66824
66844
  ".router-tl-dot { position: absolute; width: 5px; height: 5px; border-radius: var(--radius-round); background: var(--color-ink); opacity: 0.5; }",
66825
66845
  '.router-tl-dot[data-below-floor="true"] { background: var(--color-danger); }',
@@ -68408,6 +68428,19 @@ var speedStripLine = (h3, strip) => {
68408
68428
  };
68409
68429
  var stepIndex = (pct) => Math.max(0, Math.min(40, Math.round(pct / 2.5)));
68410
68430
  var step3 = (pct) => "w" + Math.max(0, Math.min(20, Math.round(pct / 5)));
68431
+ var tickTokens = (value3) => value3 >= 1e3 ? Math.round(value3 / 1e3) + "k" : String(Math.round(value3));
68432
+ var scatterPlotGeometry = (points, xMax, floor) => {
68433
+ const yTop = Math.max(60, Math.ceil(Math.max(...points.map((point) => point.tps), 1) / 20) * 20);
68434
+ const xTop = xMax ?? 131072;
68435
+ const floorPct = Math.max(0, Math.min(100, (floor ?? 30) / yTop * 100));
68436
+ return {
68437
+ yTop,
68438
+ xTop,
68439
+ yTicks: [yTop, Math.round(yTop * 0.75), Math.round(yTop * 0.5), Math.round(yTop * 0.25), 0],
68440
+ xTicks: [0, 0.25, 0.5, 0.75, 1].map((fraction) => tickTokens(Math.round(xTop * fraction))),
68441
+ floorPct
68442
+ };
68443
+ };
68411
68444
  var scatterDotClass = (xPct, yPct) => "router-tl-dot w" + stepIndex(xPct) + " scatter-y-" + stepIndex(yPct);
68412
68445
  var TelemetryPageSchema = Schema_exports.Struct({
68413
68446
  /** The window the reader selected; when it differs from view.range, data is in flight. */
@@ -68471,24 +68504,36 @@ var TelemetryPage = Html_exports.component({
68471
68504
  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
68505
  ] : [unavailable(h3, view2.speed.reason)]),
68473
68506
  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
- ),
68507
+ // DEC-40-04 / F-40-22: the approved design draws the scatter as dots in a
68508
+ // plot with labelled axes and the floor rule. foldkit-viz is vendored and
68509
+ // its renderer is tested, but Effect UI offers no confirmed way to hand a
68510
+ // custom element its SVG in this snapshot, so the plot is CSS - now with
68511
+ // the axes and the floor the board shows.
68512
+ (() => {
68513
+ const plot = scatterPlotGeometry(view2.scatter.points, view2.scatter.xMax, view2.scatter.floor);
68514
+ return h3.div.class("router-tl-plot").children(
68515
+ h3.div.class("router-tl-yaxis").children(
68516
+ ...plot.yTicks.map((tick) => h3.span.class("router-tl-tick").children(String(tick)))
68517
+ ),
68518
+ h3.div.class("router-tl-plotarea").children(
68519
+ h3.div.class("router-tl-floor-rule fy-" + stepIndex(plot.floorPct)).attr("aria-hidden", "true"),
68520
+ ...view2.scatter.points.map(
68521
+ (point) => h3.div.class(
68522
+ scatterDotClass(
68523
+ point.promptTokens / plot.xTop * 100,
68524
+ point.tps / plot.yTop * 100
68525
+ )
68526
+ ).attr("data-below-floor", point.tps < (view2.scatter.floor ?? 30) ? "true" : void 0)
68527
+ )
68528
+ )
68529
+ );
68530
+ })(),
68531
+ (() => {
68532
+ const plot = scatterPlotGeometry(view2.scatter.points, view2.scatter.xMax, view2.scatter.floor);
68533
+ return h3.div.class("router-tl-xaxis").children(
68534
+ ...plot.xTicks.map((tick) => h3.span.class("router-tl-tick").children(tick))
68535
+ );
68536
+ })(),
68492
68537
  h3.div.class("router-tl-foot").children(view2.scatter.n + " requests \xB7 " + view2.scatter.plotted + " plotted \xB7 floor " + (view2.scatter.floor ?? 30) + " tps")
68493
68538
  ] : [unavailable(h3, view2.scatter.reason)]),
68494
68539
  card(h3, "Decisions \xB7 gate and cost", "Why it decided, and what that cost", view2.gates.available ? [
@@ -69674,7 +69719,6 @@ var RouterPage = () => {
69674
69719
  row.style.flexDirection = "row";
69675
69720
  row.style.alignItems = "center";
69676
69721
  row.style.gap = "6px";
69677
- row.style.padding = "8px 0 4px";
69678
69722
  for (const entry of TELEMETRY_RANGES) {
69679
69723
  const button = document.createElement("button");
69680
69724
  button.type = "button";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@try-works/dsh-minimal-router",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "DSH local router plugin: per-session auto-routing between a local engine and remote models, evidence pages, and a plugin-owned engine provider.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",