@try-works/dsh-minimal-router 0.2.13 → 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 +51 -18
  2. package/package.json +1 -1
package/client/index.js CHANGED
@@ -66832,6 +66832,14 @@ var TELEMETRY_CSS = [
66832
66832
  ".router-tl-foot { font-family: var(--font-mono); font-size: var(--text-caps); color: var(--color-meta); }",
66833
66833
  ".router-tl-unavailable { display: flex; flex-direction: column; gap: 2px; }",
66834
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 + "%; }"),
66835
66843
  ".router-tl-scatter { position: relative; height: 150px; border-left: 1px solid var(--color-line-rule); border-bottom: 1px solid var(--color-line-rule); }",
66836
66844
  ".router-tl-dot { position: absolute; width: 5px; height: 5px; border-radius: var(--radius-round); background: var(--color-ink); opacity: 0.5; }",
66837
66845
  '.router-tl-dot[data-below-floor="true"] { background: var(--color-danger); }',
@@ -68420,6 +68428,19 @@ var speedStripLine = (h3, strip) => {
68420
68428
  };
68421
68429
  var stepIndex = (pct) => Math.max(0, Math.min(40, Math.round(pct / 2.5)));
68422
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
+ };
68423
68444
  var scatterDotClass = (xPct, yPct) => "router-tl-dot w" + stepIndex(xPct) + " scatter-y-" + stepIndex(yPct);
68424
68445
  var TelemetryPageSchema = Schema_exports.Struct({
68425
68446
  /** The window the reader selected; when it differs from view.range, data is in flight. */
@@ -68483,24 +68504,36 @@ var TelemetryPage = Html_exports.component({
68483
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")
68484
68505
  ] : [unavailable(h3, view2.speed.reason)]),
68485
68506
  card(h3, "Speed \xB7 against context", "Prompt size does not predict the fail", view2.scatter.available ? [
68486
- // DEC-40-04: the approved design draws the scatter as positioned dots.
68487
- // foldkit-viz is vendored and its scatter renderer is tested, but the
68488
- // page cannot inject its SVG yet (Effect UI offers no confirmed
68489
- // property path in this snapshot), so the dots stay until the bridge
68490
- // is proven. A half-wired plot would be worse than the fallback.
68491
- h3.div.class("router-tl-scatter").children(
68492
- ...(() => {
68493
- const yTop = Math.max(60, Math.ceil(Math.max(...view2.scatter.points.map((p) => p.tps)) / 20) * 20);
68494
- return view2.scatter.points.map(
68495
- (point) => h3.div.class(
68496
- scatterDotClass(
68497
- point.promptTokens / (view2.scatter.xMax ?? 131072) * 100,
68498
- point.tps / yTop * 100
68499
- )
68500
- ).attr("data-below-floor", point.tps < (view2.scatter.floor ?? 30) ? "true" : void 0)
68501
- );
68502
- })()
68503
- ),
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
+ })(),
68504
68537
  h3.div.class("router-tl-foot").children(view2.scatter.n + " requests \xB7 " + view2.scatter.plotted + " plotted \xB7 floor " + (view2.scatter.floor ?? 30) + " tps")
68505
68538
  ] : [unavailable(h3, view2.scatter.reason)]),
68506
68539
  card(h3, "Decisions \xB7 gate and cost", "Why it decided, and what that cost", view2.gates.available ? [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@try-works/dsh-minimal-router",
3
- "version": "0.2.13",
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",