@xixka/dsh-hub 0.2.1-rc.25 → 0.2.1-rc.26

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.
@@ -1268,8 +1268,8 @@ var STYLES = `
1268
1268
  * 216px 全部装得下且留 6.7px 余量(字体回退时字宽会变)。
1269
1269
  *
1270
1270
  * ⚠️ **上限不能再往上放**:实测把上限放到「无上限」时,极窄 composer(220px)
1271
- * 下胶囊会**溢出容器 8.3px**,把同排的官方 pill(tok/s / 缓存命中)挤出可视区。
1272
- * 内容自适应 + 合理上限,两者缺一不可。
1271
+ * 下胶囊会**溢出容器 8.3px** —— 那正是 2026-10-02「模型选择器图标被挤没」
1272
+ * 的形态。内容自适应 + 合理上限,两者缺一不可。
1273
1273
  * 兜底退化顺序:超长时**渠道名**先出省略号,**余额一个字都不会少**
1274
1274
  * (.dim-jh-badgeReading 是 flex: none)。
1275
1275
  *
@@ -1278,36 +1278,37 @@ var STYLES = `
1278
1278
  * ⚠️⚠️ 本段注释里**不能出现反引号**(本文件整体是 JS 模板字符串,会提前终止)。
1279
1279
  * ② 容器再窄时(< 720px,媒体查询挂在**全局宽度**上:composer 宽度受
1280
1280
  * 侧栏影响,用容器查询无法表达「右侧还剩多少」)**只留状态点**,
1281
- * 文字与图标全部隐藏 —— 此时 composer dock 行让位给官方 pill 与输入框。 */
1281
+ * 文字与 chevron 全部隐藏 —— 此时代理器优先级让给模型选择器。 */
1282
1282
  /* ⚠️ flex: 0 1 auto(而非 none):胶囊自身也要能收缩。它是 flex: none 时
1283
1283
  宽度只由 max-width 兜底,而 max-width 只在**内容超标**时生效 —— 容器更窄时
1284
- 它会把同排的官方 pill 一起挤出可视区。允许收缩后,空间不足时同排一起让位,
1284
+ 它会连同右侧模型选择器一起溢出。允许收缩后,空间不足时胶囊与选择器一起让位,
1285
1285
  且胶囊内部退化是有序的(先名字出省略号,数字最后才动)。 */
1286
1286
  .dim-jh-badge { position: relative; display: flex; align-items: center; flex: 0 1 auto; min-width: 0; font-size: calc(var(--dsh-content-font-size-secondary, 13px) - 1px); line-height: calc(20px + var(--dsh-content-font-delta-secondary, 0px)); }
1287
- /* ⚠️ 上面两条是宿主 StatsPills.module.css 的 anchor 字号口径(2026-11-01 迁居
1288
- composer dock 行后与官方 tok/s / 缓存命中 pill 同排):字号 = 内容字号 −1px、
1289
- 行高 20px + 字号偏移。逐字照抄,别「就地取整」—— 宿主改变量时这里要跟着走。 */
1287
+ /* ⚠️ 字号/行高两条是宿主 StatsPills.module.css 的 anchor 口径(2026-11-02 用户要求
1288
+ 徽标去边框、观感对齐官方 pill):字号 = 内容字号 −1px、行高 20px + 字号偏移。
1289
+ 逐字照抄,别「就地取整」—— 宿主改变量时这里要跟着走。 */
1290
1290
  /* ⚠️ box-sizing 是**显式写出**的,不是修复:button 的 UA 默认样式表本就是
1291
1291
  border-box(实测 offsetWidth 与 max-width 相等)。写上它只为在元素类型被改
1292
1292
  (span/div 默认是 content-box)时语义不悄悄漂移 —— 那种情况下 max-width 会从
1293
- 「占位宽度」变成「内容宽度」,胶囊会突然变宽 19px 而这行代码看着毫无变化。 */
1294
- /* 几何口径 = 宿主 StatsPills.module.css 的 .pill 规则(2026-11-01 用户要求
1295
- 「样式要和 Pill 状态条其他元素一样」,逐字对齐):无底无框、radius-sm、
1293
+ 「占位宽度」变成「内容宽度」,胶囊会突然变宽 19px 而这行代码看着毫无变化。
1294
+ 几何口径 = 宿主 StatsPills.module.css 的 .pill 规则(用户 2026-11-02 要求:
1295
+ 模型选择器旁的徽标去掉边框与底色,逐字对齐官方 pill):无底无框、radius-sm、
1296
1296
  内边距 1px 8px、gap 6px、tertiary 色、tabular-nums、行高继承 anchor。
1297
- 与 pill 的差别只有两处,都是**功能性**的:cursor:pointer(本 pill 可点开浮层,
1298
- 官方 DialogPill 也有指针);max-width 216px 收敛上限(见下一段)。 */
1297
+ 与官方 pill 的差别只有两处,都是**功能性**的:cursor:pointer(本徽标可点开
1298
+ 浮层);max-width 216px 收敛上限(见下一段)。 */
1299
1299
  .dim-jh-badgeBtn { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; max-width: 216px; min-width: 0; padding: 1px 8px; border: none; border-radius: var(--dsw-radius-sm, 6px); background: 0 0; color: var(--dsw-alias-label-tertiary); font: inherit; line-height: inherit; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .15s ease; }
1300
1300
  .dim-jh-badgeBtn:hover, .dim-jh-badgeBtn[aria-expanded="true"] { color: var(--dsw-alias-label-primary); }
1301
1301
  /* 聚合「待首次请求」占位胶囊(用户报障 2026-10-08:「也没胶囊了?」)。
1302
1302
  ⚠️ 刻意与 .dim-jh-badgeBtn **外观一致但不共用类名**:那个类名带 cursor:pointer
1303
1303
  与 :hover 反馈,而这里没有任何可点的东西(无历史 ⇒ 没有余额可展开)。
1304
1304
  给一个点了没反应的按钮比没有按钮更糟。
1305
- ⚠️ 宽度口径与 .dim-jh-badgeBtn 同步(gap 6px / padding 1px 8px / anchor 字号):
1306
- 两者会在同一位置交替出现(首次请求成功后换成真胶囊),尺寸不一致会看到跳动。 */
1305
+ ⚠️ 宽度口径与 .dim-jh-badgeBtn 同步(gap 6px / padding 1px 8px / anchor 字号,
1306
+ 含 2026-11-02 的无底无框化):两者会在同一位置交替出现(首次请求成功后
1307
+ 换成真徽标),尺寸不一致会看到跳动。 */
1307
1308
  .dim-jh-badgePending { display: inline-flex; align-items: center; gap: 6px; max-width: 216px; min-width: 0; padding: 1px 8px; border-radius: var(--dsw-radius-sm, 6px); background: 0 0; color: var(--dsw-alias-label-tertiary); line-height: inherit; white-space: nowrap; font-variant-numeric: tabular-nums; }
1308
1309
  .dim-jh-badgePending > span:last-child { overflow: hidden; text-overflow: ellipsis; }
1309
1310
  /* 折叠态文本容器:只装「额度」一个读数(用户 2026-11-01 要求 pill 不显示供应商名
1310
- —— 渠道名挤在同排官方 pill 中间只会被截成省略号;名字走 title 悬停与浮层)。
1311
+ —— 渠道名挤占宽度只会被截成省略号;名字走 title 悬停与浮层)。
1311
1312
  ⚠️ 仍必须是 flex 容器:读数与「不完整」角标各自独立、角标不参与收缩。 */
1312
1313
  .dim-jh-badgeText { display: flex; align-items: center; min-width: 0; }
1313
1314
  /* ⚠️⚠️ 读数必须 flex: none(**完全不收缩**),不能写 flex: 0 1 auto。
@@ -1336,12 +1337,12 @@ var STYLES = `
1336
1337
  字号小一档并压紧行高,让它读起来像角标而不是读数的一部分。 */
1337
1338
  .dim-jh-badgeWarn { flex: none; font-size: 10px; line-height: 1; color: var(--dsw-alias-state-warn-primary); cursor: help; }
1338
1339
 
1339
- /* ② 窄屏收敛:只留状态点,文字让位给同排官方 pill 与输入框。
1340
- * 阈值 720px 是实测桌面版在 100% 缩放下「徽标 216px + 官方 pill ≥ 240px」的临界值。
1340
+ /* ② 窄屏收敛:只留状态点,文字与 chevron 让位给模型选择器。
1341
+ * 阈值 720px 是实测桌面版在 100% 缩放下「徽标 216px + 模型选择器 ≥ 240px」的临界值。
1341
1342
  * ⚠️⚠️ 本段的**位置**是功能性的,不要为了排版把它挪到 .dim-jh-badgeText 之前:
1342
1343
  * 它与 ".dim-jh-badgeText { display: flex }" 特异性相同(都是单个类),
1343
1344
  * 靠**源顺序**决定胜负 —— 一旦被排到前面,窄屏下 display:none 会被
1344
- * 后面的 display:flex 覆盖,文字重新出现并挤压同排官方 pill(静默回归)。 */
1345
+ * 后面的 display:flex 覆盖,文字重新出现并挤压模型选择器(静默回归)。 */
1345
1346
  @media (max-width: 720px) { .dim-jh-badgeText, .dim-jh-badgeBtn > svg, .dim-jh-badgeBtn > .dim-jh-badgeChevron { display: none; } .dim-jh-badgeBtn { max-width: none; padding: 1px 6px; } }
1346
1347
  .dim-jh-badgeDot { width: 5px; height: 5px; flex: none; border-radius: 999px; background: var(--dsw-alias-state-success-primary); }
1347
1348
  .dim-jh-badgeDot[data-tone="warn"] { background: var(--dsw-alias-state-warn-primary); }
@@ -1619,8 +1620,10 @@ var STYLES = `
1619
1620
  ⚠️ min-width: 0 不可省 —— 少了它,flex 项的最小尺寸是内容宽度,
1620
1621
  ellipsis 永远不触发,长 id 会把右侧的到期提示与开关挤出可视区。 */
1621
1622
  .dim-jh-aggCandidateId { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }
1622
- /* 倍率徽章:观感沿用全站 .dim-jh-badgeBtn 的胶囊口径(999px 圆角 / 11px / .5px 边框),
1623
- 但**不共用类名** —— 那个类名带 cursor:pointer,而这里只是一枚只读读数。
1623
+ /* 倍率徽章:带边框的紧凑胶囊(999px 圆角 / 11px / .5px 边框),沿用量徽标
1624
+ 2026-11-02 无框化**之前**的历史口径 —— 不共用 .dim-jh-badgeBtn 类名:
1625
+ 那个类名带 cursor:pointer 且已无底无框(对齐官方 pill),而这里是一枚
1626
+ 只读读数,保持带边框的辨识度。
1624
1627
  ⚠️ flex: none:徽章宽度由内容决定,不能被模型 id 那种弹性挤变形。 */
1625
1628
  .dim-jh-aggCandidatePrice { flex: none; padding: 1px 7px; border: .5px solid var(--dsw-alias-border-l2, #d0d3d8); border-radius: 999px; background: var(--dsw-alias-bg-layer-2, rgba(0, 0, 0, 0.03)); font-size: 11px; line-height: 1.5; color: var(--dsw-alias-label-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
1626
1629
  /* 「免费」(倍率 0):它与「x0.15」不是同一类信息 —— 前者是**该渠道不计费**,
@@ -15260,13 +15263,7 @@ function UsageBadgeActive(props) {
15260
15263
  "aria-hidden": "true"
15261
15264
  }, "⚠")
15262
15265
  ]);
15263
- return React7.createElement("div", {
15264
- className: "dim-jh-badge",
15265
- ref: root,
15266
- // 与同排官方 pill 相同的数据标记(StatsPills 的 anchor 带 data-composer-stat)
15267
- // —— 便于在 DOM 里把这一排 pill 当一个整体查找/测试。
15268
- "data-composer-stat": "jet-hub-usage"
15269
- }, [
15266
+ return React7.createElement("div", { className: "dim-jh-badge", ref: root }, [
15270
15267
  React7.createElement("button", {
15271
15268
  key: "btn",
15272
15269
  type: "button",
@@ -16144,10 +16141,10 @@ function apply(ctx) {
16144
16141
  key: "@xixka/dsh-hub",
16145
16142
  inject: () => ({ rpcCall })
16146
16143
  }, JetHubPanelEntryCardGuarded));
16147
- ctx.slots.inject("conversation.composer.dock", () => ctx.slots.register({
16148
- name: "conversation.composer.dock",
16144
+ ctx.slots.inject("conversation.input.right", () => ctx.slots.register({
16145
+ name: "conversation.input.right",
16149
16146
  id: "jet-hub-usage",
16150
- order: -10,
16147
+ order: 100,
16151
16148
  inject: (sessionId) => ({
16152
16149
  // ⚠️⚠️ **必须惰性取目录,不能在 inject 里取**(真机事故 2026-10-02)。
16153
16150
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xixka/dsh-hub",
3
- "version": "0.2.1-rc.25",
3
+ "version": "0.2.1-rc.26",
4
4
  "description": "DeepSeek Harness plugin: one hub for AI coding providers — account login, multi-account pools, silent credential refresh, credit claiming, and a local OpenAI-compatible gateway",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",