dsh-any-deepseek 0.0.22 โ†’ 0.0.24

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/lib/client.js +174 -2
  2. package/package.json +6 -1
package/lib/client.js CHANGED
@@ -201,11 +201,11 @@ window.__ModuleLoader__.load({
201
201
  }
202
202
  //#endregion
203
203
  //#region \0ad-css:src/client/SettingsPage
204
- const css = "/* Panel styles.\n *\n * ๐Ÿ”ด There are NO `--dsw-alias-*` design tokens on this host (measured 2026-10-21: the document\n * declares 29 custom properties and not one is a colour). This file used to reference a dozen of\n * them, every one falling back to a hardcoded LIGHT value (`rgba(0,0,0,0.12)` and friends) โ€” so\n * on the dark theme the borders and dividers were effectively invisible.\n *\n * โ‡’ Derive everything from `currentColor`, which the host sets per theme. `color-mix` gives the\n * low-contrast borders and fills that a token would have provided, and it follows the theme\n * automatically instead of assuming one palette.\n */\n\n.ad-page {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 4px 2px 12px;\n}\n\n/* One place to change the two theme-derived values the whole panel uses. */\n.ad-page {\n --ad-line: color-mix(in srgb, currentColor 18%, transparent);\n --ad-line-strong: color-mix(in srgb, currentColor 32%, transparent);\n --ad-fill-subtle: color-mix(in srgb, currentColor 7%, transparent);\n /*\n * ๐Ÿ”ด The ACTIVE channel is green (owner request 2026-10-25: ใ€Œๆฟ€ๆดป็š„ๆ ทๅผ็”จ็ปฟ่‰ฒใ€).\n *\n * It used to be derived from `currentColor`, which made the live row look like every other\n * \"slightly emphasised\" row โ€” the same neutral tint as a hover or a selected input. Green says\n * \"this one is ON\" in a way a grey tint cannot, and it matches the key-configured dot and the\n * ๅฏ†้’ฅๅทฒ้…็ฝฎ text that were already green, so the panel now uses one colour for one meaning:\n * green = working / live. Red stays reserved for destructive and for failures.\n *\n * Kept as one token so the mark (border + bar + fill + badge) can never drift apart between\n * the four places it is applied.\n */\n --ad-active: #2f855a;\n --ad-active-fill: color-mix(in srgb, var(--ad-active) 12%, transparent);\n --ad-danger: #e5534b;\n}\n\n.ad-head {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.ad-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n}\n\n.ad-intro {\n margin: 0;\n font-size: 12px;\n line-height: 1.6;\n opacity: 0.72;\n}\n\n.ad-error {\n border: 1px solid var(--ad-danger);\n border-radius: 6px;\n padding: 8px 10px;\n font-size: 12px;\n}\n\n.ad-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.ad-sectionTitle {\n margin: 0;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n opacity: 0.6;\n}\n\n.ad-rows {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/*\n * ๐Ÿ”ด Compact rows (owner request 2026-10-24: ใ€Œๆฏไธชๆธ ้“้ซ˜ๅบฆๅธŒๆœ›ๅฐไธ€ไบ›๏ผŒ็ดงๅ‡‘ไบ›ใ€).\n *\n * The row used to be a four-line stack โ€” title / modelยทapiยทbaseURL / key line / balance โ€” and\n * with five channels that is most of the panel spent on air. The fix is layout, not information:\n * everything stays on screen, but the secondary facts move BESIDE the name instead of under it.\n *\n * What changed and why:\n * ยท padding 10pxโ†’7px and gap 6pxโ†’4px: the row now reads as one line of text plus a hairline of\n * metadata, instead of a card with its own interior spacing;\n * ยท `ad-rowMain` became a ROW (was a column): the title line and the meta line share one axis,\n * so the row is two text lines tall at most, not four;\n * ยท the meta line keeps `flex-wrap` โ€” on a narrow panel it may wrap, and that is the correct\n * trade: a row that stays readable beats one that clips the endpoint URL.\n */\n.ad-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border: 1px solid var(--ad-line);\n border-radius: 8px;\n padding: 7px 10px;\n /*\n * The left edge is reserved on EVERY row so the current one does not shift its content when\n * selected โ€” a row that reindents on click makes the list feel like it moved.\n */\n border-left: 3px solid transparent;\n}\n\n/*\n * ๐Ÿ”ด The current channel is marked in GREEN (owner 2026-10-25: ใ€Œๆฟ€ๆดป็š„ๆ ทๅผ็”จ็ปฟ่‰ฒใ€).\n *\n * Previously the marks were derived from `currentColor` โ€” a neutral bar, a stronger border and a\n * grey tint. All three were so low-contrast that the live row read as \"merely hovered\", which is\n * exactly what the owner was reacting to.\n *\n * Green is also the coherent choice: the key dot and ๅฏ†้’ฅๅทฒ้…็ฝฎ text were already green, so the\n * panel now uses ONE colour for ONE meaning (green = working / live), and red stays reserved for\n * destructive actions and failures.\n *\n * Four marks read from the same token so they cannot drift apart: left bar, border, fill, badge.\n */\n.ad-row-current {\n border-color: var(--ad-active);\n border-left-color: var(--ad-active);\n background: var(--ad-active-fill);\n}\n\n/* The ๅฝ“ๅ‰ badge is the textual confirmation, for when colour alone is not enough (colour-blind\n readers, screenshots, forced-colours mode). */\n.ad-row-current .ad-badge {\n border-color: var(--ad-active);\n color: var(--ad-active);\n opacity: 1;\n font-weight: 600;\n}\n\n/* The live row's NAME goes green too: the name is where the eye lands first, so marking only the\n border leaves the reader to connect two separate cues. */\n.ad-row-current .ad-rowTitle {\n color: var(--ad-active);\n}\n\n/*\n * The row's content is a COLUMN of at most two lines: (1) name + status, (2) everything else.\n * It was a four-line stack before the compactness pass โ€” see the note on `.ad-row`.\n */\n.ad-rowMain {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.ad-rowTitleLine {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n font-weight: 500;\n min-width: 0;\n}\n\n.ad-rowTitle {\n white-space: nowrap;\n}\n\n.ad-badge {\n font-size: 10px;\n padding: 1px 6px;\n border-radius: 999px;\n border: 1px solid currentColor;\n opacity: 0.8;\n}\n\n.ad-warn {\n color: #b7791f;\n cursor: help;\n}\n\n/*\n * The live-state line under a channel's name: probe verdict and/or balance, nothing else.\n *\n * ๐Ÿ”ด It shrank twice at the owner's request, and the history matters:\n * 2026-10-24 ใ€Œ็ดงๅ‡‘ไบ›ใ€ โ€” four stacked lines (endpoint identity / key state / verdict / balance)\n * became one wrapping line;\n * 2026-10-25 ใ€Œ่ฟ™้ƒจๅˆ†ไธ่ฆไบ†ใ€ โ€” endpoint identity and key state were removed outright. What\n * remains is only what changes at runtime: did the probe pass, what is\n * the balance. Those two cannot be derived from anything else on screen,\n * which is why they survived while model/api/baseURL did not.\n *\n * The element is rendered ONLY when one of them exists, so an unprobed, unpriced channel shows a\n * single-line row with no orphan gap.\n */\n.ad-rowDetail {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 6px;\n row-gap: 2px;\n font-size: 11px;\n opacity: 0.66;\n min-width: 0;\n}\n\n.ad-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n word-break: break-all;\n}\n\n.ad-sep {\n opacity: 0.5;\n}\n\n.ad-rowActions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n\n/*\n * Buttons: sized to be hit, not guessed at.\n *\n * The previous 4px/10px padding made a 22px-tall target, which is below the comfortable\n * threshold and made the row actions (ๆต‹่ฏ• / ็งป้™ค) look like text rather than controls. 6px/12px\n * with a minimum width gives each one a real box while keeping the row compact โ€” a row action is\n * secondary, so it should be easy to hit and easy to ignore.\n */\n.ad-btn {\n font-size: 11px;\n font-family: inherit;\n line-height: 1.5;\n padding: 5px 12px;\n min-width: 56px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;\n}\n\n.ad-btn:hover:not(:disabled) {\n border-color: var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n}\n\n.ad-btn:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.ad-btn-quiet {\n opacity: 0.85;\n}\n\n.ad-probe {\n font-size: 11px;\n padding-top: 2px;\n}\n\n.ad-probe-ok {\n color: #2f855a;\n}\n\n.ad-probe-bad {\n color: #c53030;\n word-break: break-word;\n}\n\n.ad-hint,\n.ad-empty,\n.ad-note {\n margin: 0;\n font-size: 11px;\n line-height: 1.6;\n opacity: 0.66;\n}\n\n.ad-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n display: inline-block;\n}\n\n.ad-dot-on {\n background: #2f855a;\n}\n\n.ad-dot-off {\n border: 1px solid currentColor;\n opacity: 0.5;\n}\n\n.ad-dot-unknown {\n background: linear-gradient(90deg, currentColor 50%, transparent 50%);\n opacity: 0.5;\n}\n\n/* The channel row is a radio \"pick\" zone: the whole left side is clickable, and the radio sits\n at the start of the line so \"which one is live\" is readable down a single column. */\n.ad-rowPick {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n flex: 1;\n min-width: 0;\n cursor: pointer;\n}\n\n.ad-rowPick input[type='radio'] {\n flex: none;\n /* Optically centred against the first text line rather than the row box. */\n margin-top: 3px;\n accent-color: var(--ad-line-strong);\n cursor: pointer;\n}\n\n/* The switch is gone: selection is the only axis (see `channels.ts`). Keeping the rules would\n invite someone to bring the second axis back. */\n\n/* โ”€โ”€ top-level tabs (ๆธ ้“ / ็”จ้‡) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * The panel answers two questions asked at different moments: \"which relay serves me and does\n * its key work\" and \"what has each relay cost\". They used to be stacked on one scroll, so\n * reading the cost table meant scrolling past every channel row. As tabs, each answer gets the\n * whole panel and the reader never scrolls to reach the second one.\n *\n * The selected tab is marked by a bottom rule plus full opacity โ€” not by colour alone, because\n * this host ships no colour tokens and a colour-only cue would vary with the theme.\n */\n.ad-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--ad-line);\n}\n\n.ad-tab {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* Comfortable click target: 28px tall is enough to hit without aiming, and still compact\n enough that two tabs do not dominate the panel. */\n padding: 6px 14px;\n font-size: 12px;\n font-family: inherit;\n border: none;\n border-bottom: 2px solid transparent;\n /* Pulled down over the container's rule so the selected tab's underline replaces it. */\n margin-bottom: -1px;\n background: transparent;\n color: inherit;\n opacity: 0.62;\n cursor: pointer;\n}\n\n.ad-tab:hover {\n opacity: 0.85;\n}\n\n.ad-tab-on {\n opacity: 1;\n font-weight: 600;\n border-bottom-color: currentColor;\n}\n\n/* A count on the channel tab, so \"how many do I have\" is answered without opening it. */\n.ad-tabCount {\n font-size: 10px;\n font-weight: 500;\n min-width: 16px;\n padding: 0 4px;\n border-radius: 999px;\n text-align: center;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* โ”€โ”€ segmented control (ๆŒ‰ๆธ ้“ / ๆŒ‰ๅคฉ / ๅˆทๆ–ฐ) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * A segmented control rather than free-floating pill buttons: these three share one meaning\n * (\"how the table below is grouped, and re-read it\"), so they are drawn as one object. The\n * borders collapse to avoid double lines between neighbours.\n */\n.ad-segmented {\n display: inline-flex;\n align-items: stretch;\n border: 1px solid var(--ad-line);\n border-radius: 7px;\n overflow: hidden;\n}\n\n.ad-seg {\n padding: 4px 11px;\n font-size: 11px;\n font-family: inherit;\n border: none;\n border-right: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.ad-seg:last-child {\n border-right: none;\n}\n\n.ad-seg:hover:not(:disabled) {\n opacity: 1;\n background: var(--ad-fill-subtle);\n}\n\n.ad-seg-on {\n opacity: 1;\n font-weight: 600;\n background: var(--ad-fill-subtle);\n}\n\n/* Refresh is an action, not a grouping โ€” a gap separates it from the choice it refreshes. */\n.ad-seg-refresh {\n border-left: 1px solid var(--ad-line);\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n.ad-table th,\n.ad-table td {\n padding: 5px 8px;\n border-bottom: 1px solid var(--ad-line);\n text-align: left;\n}\n\n.ad-table th {\n font-weight: 500;\n opacity: 0.6;\n}\n\n.ad-num {\n text-align: right;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n.ad-total td {\n font-weight: 600;\n border-bottom: none;\n}\n\n/* โ”€โ”€ add-channel form โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n.ad-addForm {\n display: flex;\n flex-direction: column;\n gap: 14px;\n border: 1px dashed var(--ad-line);\n border-radius: 8px;\n padding: 14px;\n}\n\n.ad-field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 11px;\n}\n\n/* The label row: the field name, plus a required/optional marker that says which is which. */\n.ad-field > span:first-child {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n opacity: 0.9;\n}\n\n/*\n * ๅฟ…้€‰ / ๅฏ็ฉบ as a small marker rather than a sentence.\n *\n * The add form used to leave the reader guessing which fields could be skipped โ€” and the one\n * field that could not be skipped (the key) looked exactly like the two that could. The marker\n * is text, not colour, so it survives both themes and any colour-blindness.\n */\n.ad-req,\n.ad-opt {\n font-style: normal;\n font-size: 10px;\n font-weight: 400;\n padding: 1px 5px;\n border-radius: 4px;\n opacity: 0.7;\n}\n\n.ad-req {\n border: 1px solid var(--ad-line-strong);\n}\n\n.ad-opt {\n border: 1px dotted var(--ad-line);\n}\n\n/* Why this field exists, in one line โ€” printed under the control, not hidden in a tooltip. */\n.ad-fieldHelp {\n font-size: 11px;\n line-height: 1.55;\n opacity: 0.6;\n}\n\n.ad-input {\n font-size: 12px;\n font-family: inherit;\n /* 6px/9px keeps the control the same height as a `.ad-btn` (26px), so a field and its button\n on one line align without a per-case override. */\n padding: 5px 9px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n}\n\n.ad-input:focus-visible {\n outline: 2px solid var(--ad-line-strong);\n outline-offset: 1px;\n border-color: var(--ad-line-strong);\n}\n\n/*\n * ๐Ÿ”ด A native `<select>` cannot be themed by leaving the background transparent.\n *\n * The popup list is drawn by the browser, not by the closed control's box: the options inherit\n * nothing from it, so `background: transparent` made them render in the platform default (light)\n * palette against this dark theme โ€” reported by the owner and measured on the real host.\n *\n * ๐Ÿ”ด SECOND correction (measured 2026-10-21): this file used `var(--dsw-alias-color-*, #fallback)`\n * throughout, and **none of those variables exist**. The host declares only 29 custom properties\n * in total and not one is a colour token, so every `var()` here was falling back โ€” and a fallback\n * that happens to be set inside a shorthand can be silently dropped (the select's background\n * computed to `rgba(0,0,0,0)`, i.e. still transparent, which is exactly the bug).\n *\n * โ‡’ Use only values this file controls, derived from `currentColor` (the host sets a light text\n * colour on both themes) plus explicit translucent layers. No host token is assumed.\n */\nselect.ad-input {\n /* Tells the engine which palette to use for the popup. This part DID work. */\n color-scheme: dark light;\n /*\n * Paint the closed box with a layer that follows the surrounding text colour, so it matches\n * whichever theme is active instead of hardcoding a dark value into a light theme.\n */\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n color: inherit;\n cursor: pointer;\n padding-right: 22px;\n /* Room for the chevron drawn below, so text never runs under it. */\n appearance: none;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n}\n\nselect.ad-input:hover:not(:disabled) {\n background-color: color-mix(in srgb, currentColor 14%, transparent);\n}\n\nselect.ad-input:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 1px;\n}\n\n/*\n * The popup itself follows `color-scheme`; these keep the option rows explicit for engines that\n * honour per-option colours. `color-scheme: dark` above is what actually stops the light-on-dark\n * list, because the popup is native chrome rather than a styled element.\n */\nselect.ad-input option {\n background-color: Canvas;\n color: CanvasText;\n}\n\n.ad-fieldError {\n margin: 0;\n font-size: 11px;\n color: #c53030;\n}\n\n/* โ”€โ”€ balance โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * Remaining balance.\n *\n * A fact about this channel, not a control. The subtle fill marks it as a measurement rather than\n * a warning: the words themselves say whether it is fine (\"72.50 USD\") or not (\"๏ผˆไฝ™้ขไธ่ถณ๏ผ‰\").\n */\n.ad-balance {\n font-variant-numeric: tabular-nums;\n font-size: 11px;\n padding: 1px 6px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n}\n\n/* A section heading with one action on its right (currently: ๆŸฅ่ฏขไฝ™้ข). */\n.ad-sectionBar {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n/* The reference name, not a secret: monospace so it lines up and misreads as a name, not a value. */\n.ad-keyName {\n font-size: 10px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* A text-shaped action. Styled as a link because it opens an inline editor, not a dialog. */\n.ad-link {\n font-size: 11px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n opacity: 0.75;\n cursor: pointer;\n}\n\n.ad-link:hover {\n opacity: 1;\n}\n\n/* The inline key editor: one masked field and one button, on the same line as the fact above. */\n.ad-keyForm {\n display: flex;\n align-items: center;\n gap: 6px;\n padding-top: 4px;\n}\n\n.ad-keyForm .ad-input {\n flex: 1;\n min-width: 0;\n}\n\n/* A destructive action is quiet until hovered: it should be findable, not inviting. */\n.ad-btn-danger {\n opacity: 0.6;\n}\n\n.ad-btn-danger:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--ad-danger);\n color: var(--ad-danger);\n}\n\n/*\n * The one hint that must not be skimmed past: where the key ends up.\n *\n * It carries a left rule and slightly higher opacity than an ordinary hint, because a reader who\n * skips it has been told something false by omission โ€” the key IS in the profile document.\n */\n.ad-hint-warn {\n padding: 8px 10px;\n border-left: 3px solid var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n border-radius: 0 6px 6px 0;\n opacity: 0.82;\n}\n\n/*\n * The table can be wider than a narrow settings pane (ten columns of numbers). Scrolling it\n * inside its own box keeps the tab strip and the channel list reachable, instead of pushing the\n * whole panel sideways.\n */\n.ad-tableWrap {\n overflow-x: auto;\n /* A hint that there is more to the right, without a scrollbar competing with the borders. */\n scrollbar-width: thin;\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n/* The first column is a name, not a number: keep it from being squeezed by the numeric columns. */\n.ad-table th:first-child,\n.ad-table td:first-child {\n white-space: nowrap;\n padding-right: 14px;\n}\n\n/* โ”€โ”€ footer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * States what this thing is (MIT, open, improvable) and where it lives. A user deciding whether\n * to fork it or add a relay should not have to search for the source.\n */\n.ad-foot {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 8px;\n padding-top: 10px;\n border-top: 1px solid var(--ad-line);\n font-size: 11px;\n opacity: 0.6;\n}\n\n.ad-footLink {\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 10px;\n}\n\n.ad-footLink:hover {\n opacity: 0.9;\n}\n";
204
+ const css$1 = "/* Panel styles.\n *\n * ๐Ÿ”ด There are NO `--dsw-alias-*` design tokens on this host (measured 2026-10-21: the document\n * declares 29 custom properties and not one is a colour). This file used to reference a dozen of\n * them, every one falling back to a hardcoded LIGHT value (`rgba(0,0,0,0.12)` and friends) โ€” so\n * on the dark theme the borders and dividers were effectively invisible.\n *\n * โ‡’ Derive everything from `currentColor`, which the host sets per theme. `color-mix` gives the\n * low-contrast borders and fills that a token would have provided, and it follows the theme\n * automatically instead of assuming one palette.\n */\n\n.ad-page {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 4px 2px 12px;\n}\n\n/* One place to change the two theme-derived values the whole panel uses. */\n.ad-page {\n --ad-line: color-mix(in srgb, currentColor 18%, transparent);\n --ad-line-strong: color-mix(in srgb, currentColor 32%, transparent);\n --ad-fill-subtle: color-mix(in srgb, currentColor 7%, transparent);\n /*\n * ๐Ÿ”ด The ACTIVE channel is green (owner request 2026-10-25: ใ€Œๆฟ€ๆดป็š„ๆ ทๅผ็”จ็ปฟ่‰ฒใ€).\n *\n * It used to be derived from `currentColor`, which made the live row look like every other\n * \"slightly emphasised\" row โ€” the same neutral tint as a hover or a selected input. Green says\n * \"this one is ON\" in a way a grey tint cannot, and it matches the key-configured dot and the\n * ๅฏ†้’ฅๅทฒ้…็ฝฎ text that were already green, so the panel now uses one colour for one meaning:\n * green = working / live. Red stays reserved for destructive and for failures.\n *\n * Kept as one token so the mark (border + bar + fill + badge) can never drift apart between\n * the four places it is applied.\n */\n --ad-active: #2f855a;\n --ad-active-fill: color-mix(in srgb, var(--ad-active) 12%, transparent);\n --ad-danger: #e5534b;\n}\n\n.ad-head {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.ad-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n}\n\n.ad-intro {\n margin: 0;\n font-size: 12px;\n line-height: 1.6;\n opacity: 0.72;\n}\n\n.ad-error {\n border: 1px solid var(--ad-danger);\n border-radius: 6px;\n padding: 8px 10px;\n font-size: 12px;\n}\n\n.ad-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.ad-sectionTitle {\n margin: 0;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n opacity: 0.6;\n}\n\n.ad-rows {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/*\n * ๐Ÿ”ด Compact rows (owner request 2026-10-24: ใ€Œๆฏไธชๆธ ้“้ซ˜ๅบฆๅธŒๆœ›ๅฐไธ€ไบ›๏ผŒ็ดงๅ‡‘ไบ›ใ€).\n *\n * The row used to be a four-line stack โ€” title / modelยทapiยทbaseURL / key line / balance โ€” and\n * with five channels that is most of the panel spent on air. The fix is layout, not information:\n * everything stays on screen, but the secondary facts move BESIDE the name instead of under it.\n *\n * What changed and why:\n * ยท padding 10pxโ†’7px and gap 6pxโ†’4px: the row now reads as one line of text plus a hairline of\n * metadata, instead of a card with its own interior spacing;\n * ยท `ad-rowMain` became a ROW (was a column): the title line and the meta line share one axis,\n * so the row is two text lines tall at most, not four;\n * ยท the meta line keeps `flex-wrap` โ€” on a narrow panel it may wrap, and that is the correct\n * trade: a row that stays readable beats one that clips the endpoint URL.\n */\n.ad-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border: 1px solid var(--ad-line);\n border-radius: 8px;\n padding: 7px 10px;\n /*\n * The left edge is reserved on EVERY row so the current one does not shift its content when\n * selected โ€” a row that reindents on click makes the list feel like it moved.\n */\n border-left: 3px solid transparent;\n}\n\n/*\n * ๐Ÿ”ด The current channel is marked in GREEN (owner 2026-10-25: ใ€Œๆฟ€ๆดป็š„ๆ ทๅผ็”จ็ปฟ่‰ฒใ€).\n *\n * Previously the marks were derived from `currentColor` โ€” a neutral bar, a stronger border and a\n * grey tint. All three were so low-contrast that the live row read as \"merely hovered\", which is\n * exactly what the owner was reacting to.\n *\n * Green is also the coherent choice: the key dot and ๅฏ†้’ฅๅทฒ้…็ฝฎ text were already green, so the\n * panel now uses ONE colour for ONE meaning (green = working / live), and red stays reserved for\n * destructive actions and failures.\n *\n * Four marks read from the same token so they cannot drift apart: left bar, border, fill, badge.\n */\n.ad-row-current {\n border-color: var(--ad-active);\n border-left-color: var(--ad-active);\n background: var(--ad-active-fill);\n}\n\n/* The ๅฝ“ๅ‰ badge is the textual confirmation, for when colour alone is not enough (colour-blind\n readers, screenshots, forced-colours mode). */\n.ad-row-current .ad-badge {\n border-color: var(--ad-active);\n color: var(--ad-active);\n opacity: 1;\n font-weight: 600;\n}\n\n/* The live row's NAME goes green too: the name is where the eye lands first, so marking only the\n border leaves the reader to connect two separate cues. */\n.ad-row-current .ad-rowTitle {\n color: var(--ad-active);\n}\n\n/*\n * The row's content is a COLUMN of at most two lines: (1) name + status, (2) everything else.\n * It was a four-line stack before the compactness pass โ€” see the note on `.ad-row`.\n */\n.ad-rowMain {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.ad-rowTitleLine {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n font-weight: 500;\n min-width: 0;\n}\n\n.ad-rowTitle {\n white-space: nowrap;\n}\n\n.ad-badge {\n font-size: 10px;\n padding: 1px 6px;\n border-radius: 999px;\n border: 1px solid currentColor;\n opacity: 0.8;\n}\n\n.ad-warn {\n color: #b7791f;\n cursor: help;\n}\n\n/*\n * The live-state line under a channel's name: probe verdict and/or balance, nothing else.\n *\n * ๐Ÿ”ด It shrank twice at the owner's request, and the history matters:\n * 2026-10-24 ใ€Œ็ดงๅ‡‘ไบ›ใ€ โ€” four stacked lines (endpoint identity / key state / verdict / balance)\n * became one wrapping line;\n * 2026-10-25 ใ€Œ่ฟ™้ƒจๅˆ†ไธ่ฆไบ†ใ€ โ€” endpoint identity and key state were removed outright. What\n * remains is only what changes at runtime: did the probe pass, what is\n * the balance. Those two cannot be derived from anything else on screen,\n * which is why they survived while model/api/baseURL did not.\n *\n * The element is rendered ONLY when one of them exists, so an unprobed, unpriced channel shows a\n * single-line row with no orphan gap.\n */\n.ad-rowDetail {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: 6px;\n row-gap: 2px;\n font-size: 11px;\n opacity: 0.66;\n min-width: 0;\n}\n\n.ad-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n word-break: break-all;\n}\n\n.ad-sep {\n opacity: 0.5;\n}\n\n.ad-rowActions {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n}\n\n/*\n * Buttons: sized to be hit, not guessed at.\n *\n * The previous 4px/10px padding made a 22px-tall target, which is below the comfortable\n * threshold and made the row actions (ๆต‹่ฏ• / ็งป้™ค) look like text rather than controls. 6px/12px\n * with a minimum width gives each one a real box while keeping the row compact โ€” a row action is\n * secondary, so it should be easy to hit and easy to ignore.\n */\n.ad-btn {\n font-size: 11px;\n font-family: inherit;\n line-height: 1.5;\n padding: 5px 12px;\n min-width: 56px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n cursor: pointer;\n transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;\n}\n\n.ad-btn:hover:not(:disabled) {\n border-color: var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n}\n\n.ad-btn:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.ad-btn-quiet {\n opacity: 0.85;\n}\n\n.ad-probe {\n font-size: 11px;\n padding-top: 2px;\n}\n\n.ad-probe-ok {\n color: #2f855a;\n}\n\n.ad-probe-bad {\n color: #c53030;\n word-break: break-word;\n}\n\n.ad-hint,\n.ad-empty,\n.ad-note {\n margin: 0;\n font-size: 11px;\n line-height: 1.6;\n opacity: 0.66;\n}\n\n.ad-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n display: inline-block;\n}\n\n.ad-dot-on {\n background: #2f855a;\n}\n\n.ad-dot-off {\n border: 1px solid currentColor;\n opacity: 0.5;\n}\n\n.ad-dot-unknown {\n background: linear-gradient(90deg, currentColor 50%, transparent 50%);\n opacity: 0.5;\n}\n\n/* The channel row is a radio \"pick\" zone: the whole left side is clickable, and the radio sits\n at the start of the line so \"which one is live\" is readable down a single column. */\n.ad-rowPick {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n flex: 1;\n min-width: 0;\n cursor: pointer;\n}\n\n.ad-rowPick input[type='radio'] {\n flex: none;\n /* Optically centred against the first text line rather than the row box. */\n margin-top: 3px;\n accent-color: var(--ad-line-strong);\n cursor: pointer;\n}\n\n/* The switch is gone: selection is the only axis (see `channels.ts`). Keeping the rules would\n invite someone to bring the second axis back. */\n\n/* โ”€โ”€ top-level tabs (ๆธ ้“ / ็”จ้‡) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * The panel answers two questions asked at different moments: \"which relay serves me and does\n * its key work\" and \"what has each relay cost\". They used to be stacked on one scroll, so\n * reading the cost table meant scrolling past every channel row. As tabs, each answer gets the\n * whole panel and the reader never scrolls to reach the second one.\n *\n * The selected tab is marked by a bottom rule plus full opacity โ€” not by colour alone, because\n * this host ships no colour tokens and a colour-only cue would vary with the theme.\n */\n.ad-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--ad-line);\n}\n\n.ad-tab {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* Comfortable click target: 28px tall is enough to hit without aiming, and still compact\n enough that two tabs do not dominate the panel. */\n padding: 6px 14px;\n font-size: 12px;\n font-family: inherit;\n border: none;\n border-bottom: 2px solid transparent;\n /* Pulled down over the container's rule so the selected tab's underline replaces it. */\n margin-bottom: -1px;\n background: transparent;\n color: inherit;\n opacity: 0.62;\n cursor: pointer;\n}\n\n.ad-tab:hover {\n opacity: 0.85;\n}\n\n.ad-tab-on {\n opacity: 1;\n font-weight: 600;\n border-bottom-color: currentColor;\n}\n\n/* A count on the channel tab, so \"how many do I have\" is answered without opening it. */\n.ad-tabCount {\n font-size: 10px;\n font-weight: 500;\n min-width: 16px;\n padding: 0 4px;\n border-radius: 999px;\n text-align: center;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* โ”€โ”€ segmented control (ๆŒ‰ๆธ ้“ / ๆŒ‰ๅคฉ / ๅˆทๆ–ฐ) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * A segmented control rather than free-floating pill buttons: these three share one meaning\n * (\"how the table below is grouped, and re-read it\"), so they are drawn as one object. The\n * borders collapse to avoid double lines between neighbours.\n */\n.ad-segmented {\n display: inline-flex;\n align-items: stretch;\n border: 1px solid var(--ad-line);\n border-radius: 7px;\n overflow: hidden;\n}\n\n.ad-seg {\n padding: 4px 11px;\n font-size: 11px;\n font-family: inherit;\n border: none;\n border-right: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.ad-seg:last-child {\n border-right: none;\n}\n\n.ad-seg:hover:not(:disabled) {\n opacity: 1;\n background: var(--ad-fill-subtle);\n}\n\n.ad-seg-on {\n opacity: 1;\n font-weight: 600;\n background: var(--ad-fill-subtle);\n}\n\n/* Refresh is an action, not a grouping โ€” a gap separates it from the choice it refreshes. */\n.ad-seg-refresh {\n border-left: 1px solid var(--ad-line);\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n.ad-table th,\n.ad-table td {\n padding: 5px 8px;\n border-bottom: 1px solid var(--ad-line);\n text-align: left;\n}\n\n.ad-table th {\n font-weight: 500;\n opacity: 0.6;\n}\n\n.ad-num {\n text-align: right;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n.ad-total td {\n font-weight: 600;\n border-bottom: none;\n}\n\n/* โ”€โ”€ add-channel form โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n.ad-addForm {\n display: flex;\n flex-direction: column;\n gap: 14px;\n border: 1px dashed var(--ad-line);\n border-radius: 8px;\n padding: 14px;\n}\n\n.ad-field {\n display: flex;\n flex-direction: column;\n gap: 5px;\n font-size: 11px;\n}\n\n/* The label row: the field name, plus a required/optional marker that says which is which. */\n.ad-field > span:first-child {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n opacity: 0.9;\n}\n\n/*\n * ๅฟ…้€‰ / ๅฏ็ฉบ as a small marker rather than a sentence.\n *\n * The add form used to leave the reader guessing which fields could be skipped โ€” and the one\n * field that could not be skipped (the key) looked exactly like the two that could. The marker\n * is text, not colour, so it survives both themes and any colour-blindness.\n */\n.ad-req,\n.ad-opt {\n font-style: normal;\n font-size: 10px;\n font-weight: 400;\n padding: 1px 5px;\n border-radius: 4px;\n opacity: 0.7;\n}\n\n.ad-req {\n border: 1px solid var(--ad-line-strong);\n}\n\n.ad-opt {\n border: 1px dotted var(--ad-line);\n}\n\n/* Why this field exists, in one line โ€” printed under the control, not hidden in a tooltip. */\n.ad-fieldHelp {\n font-size: 11px;\n line-height: 1.55;\n opacity: 0.6;\n}\n\n.ad-input {\n font-size: 12px;\n font-family: inherit;\n /* 6px/9px keeps the control the same height as a `.ad-btn` (26px), so a field and its button\n on one line align without a per-case override. */\n padding: 5px 9px;\n min-height: 26px;\n border-radius: 6px;\n border: 1px solid var(--ad-line);\n background: transparent;\n color: inherit;\n}\n\n.ad-input:focus-visible {\n outline: 2px solid var(--ad-line-strong);\n outline-offset: 1px;\n border-color: var(--ad-line-strong);\n}\n\n/*\n * ๐Ÿ”ด A native `<select>` cannot be themed by leaving the background transparent.\n *\n * The popup list is drawn by the browser, not by the closed control's box: the options inherit\n * nothing from it, so `background: transparent` made them render in the platform default (light)\n * palette against this dark theme โ€” reported by the owner and measured on the real host.\n *\n * ๐Ÿ”ด SECOND correction (measured 2026-10-21): this file used `var(--dsw-alias-color-*, #fallback)`\n * throughout, and **none of those variables exist**. The host declares only 29 custom properties\n * in total and not one is a colour token, so every `var()` here was falling back โ€” and a fallback\n * that happens to be set inside a shorthand can be silently dropped (the select's background\n * computed to `rgba(0,0,0,0)`, i.e. still transparent, which is exactly the bug).\n *\n * โ‡’ Use only values this file controls, derived from `currentColor` (the host sets a light text\n * colour on both themes) plus explicit translucent layers. No host token is assumed.\n */\nselect.ad-input {\n /* Tells the engine which palette to use for the popup. This part DID work. */\n color-scheme: dark light;\n /*\n * Paint the closed box with a layer that follows the surrounding text colour, so it matches\n * whichever theme is active instead of hardcoding a dark value into a light theme.\n */\n background-color: color-mix(in srgb, currentColor 8%, transparent);\n color: inherit;\n cursor: pointer;\n padding-right: 22px;\n /* Room for the chevron drawn below, so text never runs under it. */\n appearance: none;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n}\n\nselect.ad-input:hover:not(:disabled) {\n background-color: color-mix(in srgb, currentColor 14%, transparent);\n}\n\nselect.ad-input:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 1px;\n}\n\n/*\n * The popup itself follows `color-scheme`; these keep the option rows explicit for engines that\n * honour per-option colours. `color-scheme: dark` above is what actually stops the light-on-dark\n * list, because the popup is native chrome rather than a styled element.\n */\nselect.ad-input option {\n background-color: Canvas;\n color: CanvasText;\n}\n\n.ad-fieldError {\n margin: 0;\n font-size: 11px;\n color: #c53030;\n}\n\n/* โ”€โ”€ balance โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * Remaining balance.\n *\n * A fact about this channel, not a control. The subtle fill marks it as a measurement rather than\n * a warning: the words themselves say whether it is fine (\"72.50 USD\") or not (\"๏ผˆไฝ™้ขไธ่ถณ๏ผ‰\").\n */\n.ad-balance {\n font-variant-numeric: tabular-nums;\n font-size: 11px;\n padding: 1px 6px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n}\n\n/* A section heading with one action on its right (currently: ๆŸฅ่ฏขไฝ™้ข). */\n.ad-sectionBar {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n}\n\n/* The reference name, not a secret: monospace so it lines up and misreads as a name, not a value. */\n.ad-keyName {\n font-size: 10px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--ad-fill-subtle);\n opacity: 0.8;\n}\n\n/* A text-shaped action. Styled as a link because it opens an inline editor, not a dialog. */\n.ad-link {\n font-size: 11px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n opacity: 0.75;\n cursor: pointer;\n}\n\n.ad-link:hover {\n opacity: 1;\n}\n\n/* The inline key editor: one masked field and one button, on the same line as the fact above. */\n.ad-keyForm {\n display: flex;\n align-items: center;\n gap: 6px;\n padding-top: 4px;\n}\n\n.ad-keyForm .ad-input {\n flex: 1;\n min-width: 0;\n}\n\n/* A destructive action is quiet until hovered: it should be findable, not inviting. */\n.ad-btn-danger {\n opacity: 0.6;\n}\n\n.ad-btn-danger:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--ad-danger);\n color: var(--ad-danger);\n}\n\n/*\n * The one hint that must not be skimmed past: where the key ends up.\n *\n * It carries a left rule and slightly higher opacity than an ordinary hint, because a reader who\n * skips it has been told something false by omission โ€” the key IS in the profile document.\n */\n.ad-hint-warn {\n padding: 8px 10px;\n border-left: 3px solid var(--ad-line-strong);\n background: var(--ad-fill-subtle);\n border-radius: 0 6px 6px 0;\n opacity: 0.82;\n}\n\n/*\n * The table can be wider than a narrow settings pane (ten columns of numbers). Scrolling it\n * inside its own box keeps the tab strip and the channel list reachable, instead of pushing the\n * whole panel sideways.\n */\n.ad-tableWrap {\n overflow-x: auto;\n /* A hint that there is more to the right, without a scrollbar competing with the borders. */\n scrollbar-width: thin;\n}\n\n.ad-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 11px;\n}\n\n/* The first column is a name, not a number: keep it from being squeezed by the numeric columns. */\n.ad-table th:first-child,\n.ad-table td:first-child {\n white-space: nowrap;\n padding-right: 14px;\n}\n\n/* โ”€โ”€ footer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */\n\n/*\n * States what this thing is (MIT, open, improvable) and where it lives. A user deciding whether\n * to fork it or add a relay should not have to search for the source.\n */\n.ad-foot {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 8px;\n padding-top: 10px;\n border-top: 1px solid var(--ad-line);\n font-size: 11px;\n opacity: 0.6;\n}\n\n.ad-footLink {\n color: inherit;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 10px;\n}\n\n.ad-footLink:hover {\n opacity: 0.9;\n}\n";
205
205
  if (typeof document !== "undefined" && document.querySelector("style[data-ad-css=\"SettingsPage\"]") === null) {
206
206
  const tag = document.createElement("style");
207
207
  tag.setAttribute("data-ad-css", "SettingsPage");
208
- tag.textContent = css;
208
+ tag.textContent = css$1;
209
209
  document.head.appendChild(tag);
210
210
  }
211
211
  //#endregion
@@ -1208,6 +1208,168 @@ window.__ModuleLoader__.load({
1208
1208
  });
1209
1209
  }
1210
1210
  //#endregion
1211
+ //#region \0ad-css:src/client/UsageBadge
1212
+ const css = "/**\n * UsageBadge.css โ€” the header badge's own styles.\n *\n * Kept in its own file, imported by the component, because the build inlines CSS imports into the\n * bundle (`--loader:.css=text`). The panel's stylesheet is not reused on purpose: the badge lives\n * in the host's header, not inside the panel, and a shared sheet would tie two unrelated surfaces\n * together so that touching one breaks the other.\n *\n * ## Sizing follows the host, not our taste\n *\n * The host's header leading area is `display:flex; align-items:center; gap:8px`\n * (`ConversationRoot.module.css`: `.headerLeading`). So this contributes one flex item and does not\n * set its own margins. Height is left to the line box: the header row is 30px tall\n * (`.titleRow{min-height:30px}`), so a 20px line-height sits inside it without stretching it.\n *\n * ## Colour comes from the host's tokens\n *\n * `--dsw-alias-*` are the host's own aliases, the same family its crumbs and captions use. Hard-coded\n * greys would look correct in one theme and vanish in the other; three of the panel's earlier colour\n * defects were exactly this.\n */\n\n.ad-usageBadge {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* No padding/background: this is an ornament in a drag region, not a button. Giving it a hit\n area would invite clicks that the owner explicitly did not ask for. */\n padding: 0;\n background: none;\n border: none;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 20px;\n /* Tabular figures stop the number's width from jittering as it grows during a session, which\n would drag everything to its right back and forth. */\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n /* The header is `data-window-drag`; text selection there would fight the drag affordance. */\n user-select: none;\n}\n\n/* The dot is the \"this is a live reading\" cue. It is `aria-hidden` in the markup because the\n number and the title already say everything the dot implies. */\n.ad-usageDot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.55;\n flex: none;\n}\n\n.ad-usageNum {\n font-weight: 500;\n}\n\n/* An unreadable figure is dimmed rather than hidden: the seat stays occupied so the header does\n not reflow when the route comes back. */\n.ad-usageBadge[title^=\"ไปŠๅคฉ่ฟ˜ๆฒกๆœ‰่ฏปๅˆฐ\"] {\n opacity: 0.6;\n}\n";
1213
+ if (typeof document !== "undefined" && document.querySelector("style[data-ad-css=\"UsageBadge\"]") === null) {
1214
+ const tag = document.createElement("style");
1215
+ tag.setAttribute("data-ad-css", "UsageBadge");
1216
+ tag.textContent = css;
1217
+ document.head.appendChild(tag);
1218
+ }
1219
+ //#endregion
1220
+ //#region src/client/UsageBadge.tsx
1221
+ /**
1222
+ * client/UsageBadge.tsx โ€” today's input tokens, in the header's leading seat.
1223
+ *
1224
+ * ## What it is for
1225
+ *
1226
+ * Owner request 2026-11-01: ใ€Œๅœจ dsh ๅทฆไธŠ่ง’ๅˆ้€‚็š„ๅœฐๆ–นๆ”พไธช็”จ้‡ๅ›พๆ ‡๏ผŒๆ˜พ็คบๅฝ“ๅคฉ็š„่พ“ๅ…ฅ็ปŸ่ฎก๏ผŒๅ•ไฝ Mใ€.
1227
+ * The panel answers "what did each relay cost" but you have to open Settings to ask it. This puts
1228
+ * ONE number where it is seen without asking โ€” the header, before the Session title.
1229
+ *
1230
+ * ## The counting convention is a decision, not an accident
1231
+ *
1232
+ * ๐Ÿ”ด **`billableInput`, not `input`.** The ledger carries three input figures and on a real day
1233
+ * (2026-10-27) they differ by two orders of magnitude: `input` 13.0M, `cacheRead` 1369M,
1234
+ * `billableInput` 1382M. Owner chose BILLABLE (uncached + cache read + cache write) on 2026-11-01.
1235
+ *
1236
+ * This is the same number the panel's footer describes as ใ€Œไธ‰่€…็›ธๅŠ ๆ‰ๆ˜ฏ่ฎก่ดน่พ“ๅ…ฅใ€, so the badge and
1237
+ * the panel cannot disagree about what "input" means. A second convention invented here would be
1238
+ * the failure this plugin has already paid for twice (decision 19: docs said default, code said
1239
+ * required; decision 51: a preset claimed text-only while the record said otherwise).
1240
+ *
1241
+ * ## Three states, and why `0.0M` is never one of them
1242
+ *
1243
+ * ยท **loading** โ€” nothing rendered yet. Rendering `0.0M` first and correcting it later makes the
1244
+ * reader believe a number that was never read.
1245
+ * ยท **unknown** โ€” the request failed. `โ€”`, never `0.0M`: decision 45/47 discipline โ€” a missing
1246
+ * reading must not render as a zero, because "zero spend" and "could not ask" look identical
1247
+ * and only one of them is actionable.
1248
+ * ยท **value** โ€” the real figure, e.g. `1.38B`.
1249
+ *
1250
+ * ## Why it is not interactive
1251
+ *
1252
+ * Owner chose ใ€Œๅช่ฆไธ€ไธชๆ•ฐๅญ—๏ผŒไธ่ฆไปปไฝ•ไบคไบ’ใ€. So this is a `<span>`, not a button: no click target,
1253
+ * no hover card, no focus ring. The cost is stated in the docs โ€” the badge answers "how much
1254
+ * today", and any further question still needs theSettings page.
1255
+ *
1256
+ * ## Why it does not depend on the settings service
1257
+ *
1258
+ * The panel registers inside `configForms.whileServed` (decision 22: without the settings document
1259
+ * the panel used to vanish silently). The badge must NOT inherit that coupling: it reads its own
1260
+ * HTTP route and has nothing to do with the settings form. A deployment whose settings service is
1261
+ * late, absent, or refused would otherwise lose the badge with no trace โ€” the exact silent shape
1262
+ * decision 22 was written to remove.
1263
+ */
1264
+ /** Refresh cadence. Slow on purpose โ€” see the note at the call site. */
1265
+ const USAGE_BADGE_REFRESH_MS = 6e4;
1266
+ /**
1267
+ * Extract today's billable input from a stats response.
1268
+ *
1269
+ * The response groups by day, so the row whose key is today's `YYYY-MM-DD` carries it. Matching on
1270
+ * the key rather than taking `rows[0]` matters: the ordering is newest-first but that is a display
1271
+ * decision that may change, and "first row" would silently start meaning yesterday.
1272
+ *
1273
+ * @param stats - the response, or null while loading.
1274
+ * @param today - `YYYY-MM-DD` in the browser's own offset.
1275
+ * @returns the figure, or undefined when the response has no such row.
1276
+ */
1277
+ function pickTodayBillable(stats, today) {
1278
+ if (stats === null) return void 0;
1279
+ return stats.rows.find((candidate) => candidate.key === today)?.aggregate.billableInput;
1280
+ }
1281
+ /**
1282
+ * Today's date as `YYYY-MM-DD`, in this browser's timezone.
1283
+ *
1284
+ * Built from local getters, NOT `toISOString().slice(0, 10)`: the latter is UTC, so for a user at
1285
+ * UTC+8 it would report yesterday until 08:00 and today's spend would be attributed to the wrong
1286
+ * day for eight hours every morning. The ledger writes its keys with the same local-offset rule
1287
+ * (`usage-ledger.ts` {@link dayKey}), so this is the matching reader.
1288
+ * @param now - clock, injectable for tests.
1289
+ * @returns e.g. `2026-11-01`.
1290
+ */
1291
+ function localDayKey(now = /* @__PURE__ */ new Date()) {
1292
+ return `${now.getFullYear()}-${`${now.getMonth() + 1}`.padStart(2, "0")}-${`${now.getDate()}`.padStart(2, "0")}`;
1293
+ }
1294
+ function badgeState(value, failed) {
1295
+ if (value !== null) return {
1296
+ kind: "value",
1297
+ tokens: value
1298
+ };
1299
+ if (failed) return { kind: "unknown" };
1300
+ return { kind: "hidden" };
1301
+ }
1302
+ /**
1303
+ * The header badge.
1304
+ *
1305
+ * Renders `null` until a figure exists โ€” see the three-states note above. The title attribute is
1306
+ * the one concession to discoverability: it states the convention and the day in words, because a
1307
+ * bare `1.38B` in a header is ambiguous about both.
1308
+ * @param props - slot runtime share and the injected loader.
1309
+ * @returns the badge, or null while there is nothing honest to show.
1310
+ */
1311
+ function UsageBadge({ loadToday }) {
1312
+ const [value, setValue] = (0, react.useState)(null);
1313
+ const [failed, setFailed] = (0, react.useState)(false);
1314
+ const [day, setDay] = (0, react.useState)(() => localDayKey());
1315
+ const alive = (0, react.useRef)(true);
1316
+ /** One read. Failures land in `failed`, never in `value`. */
1317
+ const read = (0, react.useCallback)(async () => {
1318
+ const today = localDayKey();
1319
+ try {
1320
+ const stats = await loadToday();
1321
+ if (!alive.current) return;
1322
+ setDay(today);
1323
+ const figure = pickTodayBillable(stats, today);
1324
+ if (figure === void 0) {
1325
+ setValue(null);
1326
+ setFailed(true);
1327
+ return;
1328
+ }
1329
+ setValue(figure);
1330
+ setFailed(false);
1331
+ } catch {
1332
+ if (!alive.current) return;
1333
+ setFailed(true);
1334
+ }
1335
+ }, [loadToday]);
1336
+ (0, react.useEffect)(() => {
1337
+ alive.current = true;
1338
+ read();
1339
+ const timer = setInterval(() => {
1340
+ read();
1341
+ }, USAGE_BADGE_REFRESH_MS);
1342
+ return () => {
1343
+ alive.current = false;
1344
+ clearInterval(timer);
1345
+ };
1346
+ }, [read]);
1347
+ const state = badgeState(value, failed);
1348
+ if (state.kind === "hidden") return null;
1349
+ if (state.kind === "unknown") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1350
+ className: "ad-usageBadge",
1351
+ title: "ไปŠๅคฉ่ฟ˜ๆฒกๆœ‰่ฏปๅˆฐ็”จ้‡๏ผˆๆˆ–็”จ้‡ๆŽฅๅฃๆš‚ๆ—ถไธๅฏ็”จ๏ผ‰",
1352
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1353
+ className: "ad-usageDot",
1354
+ "aria-hidden": "true"
1355
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1356
+ className: "ad-usageNum",
1357
+ children: "โ€”"
1358
+ })]
1359
+ });
1360
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1361
+ className: "ad-usageBadge",
1362
+ title: `${day} ่ฎก่ดน่พ“ๅ…ฅ ${state.tokens.toLocaleString()} tokens๏ผˆๆœชๅ‘ฝไธญ + ็ผ“ๅญ˜่ฏป + ็ผ“ๅญ˜ๅ†™๏ผ‰`,
1363
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1364
+ className: "ad-usageDot",
1365
+ "aria-hidden": "true"
1366
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1367
+ className: "ad-usageNum",
1368
+ children: formatTokens(state.tokens)
1369
+ })]
1370
+ });
1371
+ }
1372
+ //#endregion
1211
1373
  //#region src/client/index.ts
1212
1374
  /**
1213
1375
  * Settings namespace โ€” the PROFILE ENTRY id, not the plugin's bare name.
@@ -1223,6 +1385,16 @@ window.__ModuleLoader__.load({
1223
1385
  /** Services this half waits for. */
1224
1386
  const inject = ["slots", "configForms"];
1225
1387
  function apply(ctx) {
1388
+ ctx.inject(["slots"], (scope) => {
1389
+ scope.effect(() => scope.slots.register({
1390
+ name: "conversation.header.leading",
1391
+ inject: () => ({ loadToday: () => {
1392
+ const start = /* @__PURE__ */ new Date();
1393
+ start.setHours(0, 0, 0, 0);
1394
+ return fetchStats("day", start.toISOString());
1395
+ } })
1396
+ }, UsageBadge), "any-deepseek header usage badge");
1397
+ });
1226
1398
  ctx.inject(["slots", "configForms"], (scope) => {
1227
1399
  const form = scope.configForms.get(SETTINGS_NS);
1228
1400
  scope.effect(() => scope.configForms.whileServed([SETTINGS_NS], () => scope.slots.inject("settings.section", () => scope.slots.register({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-any-deepseek",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "One DeepSeek V4.1 Flash provider for DeepSeek Harness: paste a key per channel, switch channels manually, token usage booked per real upstream.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -62,6 +62,7 @@
62
62
  "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.1 || ^0.2.1-rc.1",
63
63
  "@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.1 || ^0.2.1-rc.1",
64
64
  "@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.1 || ^0.2.1-rc.1",
65
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.2.0-rc.1 || ^0.2.1-rc.1",
65
66
  "@deepseek-ai/dsh-credentials": "^0.2.0-rc.1 || ^0.2.1-rc.1",
66
67
  "@deepseek-ai/dsh-home-paths": "^0.2.0-rc.1 || ^0.2.1-rc.1",
67
68
  "@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.1 || ^0.2.1-rc.1",
@@ -87,6 +88,9 @@
87
88
  "@deepseek-ai/dsh-client-ui-slots": {
88
89
  "optional": true
89
90
  },
91
+ "@deepseek-ai/dsh-client-ui-conversation": {
92
+ "optional": true
93
+ },
90
94
  "@deepseek-ai/dsh-credentials": {
91
95
  "optional": true
92
96
  },
@@ -106,6 +110,7 @@
106
110
  "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
107
111
  "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.2",
108
112
  "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
113
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.2",
109
114
  "@deepseek-ai/dsh-credentials": "0.2.1-rc.2",
110
115
  "@deepseek-ai/dsh-home-paths": "0.2.1-rc.2",
111
116
  "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.2",