dsh-thinking-levels 4.5.0 → 4.7.0
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/CHANGELOG.md +52 -0
- package/README.md +3 -1
- package/dsh.plugin.json +1 -1
- package/lib/auto-schedule-projection.d.ts +164 -6
- package/lib/auto-schedule-projection.js +252 -19
- package/lib/billing-projection.d.ts +7 -7
- package/lib/client.js +1473 -176
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +12 -0
- package/lib/index.js +34 -0
- package/lib/plugin-records.d.ts +85 -0
- package/lib/plugin-records.js +181 -0
- package/lib/strict-step-schedule.d.ts +2 -0
- package/lib/strict-step-schedule.js +1 -0
- package/lib/thinking-level.d.ts +38 -0
- package/lib/thinking-level.js +58 -16
- package/package.json +155 -155
package/lib/client.js
CHANGED
|
@@ -31,6 +31,8 @@ window.__ModuleLoader__.load({
|
|
|
31
31
|
"card.defaultPricing": "目录外定价",
|
|
32
32
|
"card.simpleTools": "简单工具白名单(auto 降档判定)",
|
|
33
33
|
"card.simpleToolsHint": "逗号或空格分隔的工具名,追加进内置的「廉价确定性工具」判定(如 shell、pwsh、web_fetch)。auto 档据此把仅由这类短小调用构成的步骤降到低档;内置已覆盖 bash/terminal/shell/pwsh 等,此处仅补充宿主专有工具名。",
|
|
34
|
+
"card.simpleToolsRegex": "简单工具 regex 名单(auto 降档判定)",
|
|
35
|
+
"card.simpleToolsRegexHint": "每条一个 JavaScript 正则(不自动加锚点,建议自写 ^;大小写不敏感),与上方字面量名单并存、同一统计。匹配同时测完整工具名与剥 ops_ 后的裸名——「^ops_.*」可一次覆盖整个 dsh-ops 家族。编译失败的条目跳过并告警一次。",
|
|
34
36
|
"card.defaultPricingHint": "定价目录未收录的模型(含其他插件接入的网关型号)如何计价;目录内模型始终按自己的目录价。改价只影响后续新账。",
|
|
35
37
|
"card.defaultPricing.estimate": "estimate — 典型价兜底估算(未校准·仅供参考,默认)",
|
|
36
38
|
"card.defaultPricing.cn": "cn — 人民币校准档(目录外仍按典型价估算)",
|
|
@@ -116,7 +118,53 @@ window.__ModuleLoader__.load({
|
|
|
116
118
|
"trace.label": "Effort 轨迹",
|
|
117
119
|
"trace.empty": "本会话还没有已提交的请求档位。",
|
|
118
120
|
"trace.intent.auto": "auto",
|
|
119
|
-
"trace.intent.manual": "手动"
|
|
121
|
+
"trace.intent.manual": "手动",
|
|
122
|
+
"trace.title": "Effort 轨迹",
|
|
123
|
+
"trace.subtitle": "本会话每次请求实际发出的档位,连续相同档位折叠为一段(最新在上)。",
|
|
124
|
+
"trace.summary.requests": "次请求",
|
|
125
|
+
"trace.summary.runs": "段",
|
|
126
|
+
"trace.summary.autoRuns": "段由 auto 调度",
|
|
127
|
+
"trace.summary.peak": "峰值",
|
|
128
|
+
"trace.summary.hint": "T=轮次 · S=步",
|
|
129
|
+
"trace.note.attribution": "注:0.2.2 起宿主禁止在请求阶段改档位,本插件(严格线)会自己写 `model/selection` 提前一步排程——因此「手动」标签只表示日志里最后一笔选择是具体档位,未必是人为点击。",
|
|
130
|
+
"trace.intent.default": "默认",
|
|
131
|
+
"trace.intent.unknown": "未记录",
|
|
132
|
+
"trace.intent.scheduler": "插件调度",
|
|
133
|
+
"trace.intent.unknownHint": "本次档位变化在会话日志里没有对应的选择记录(0.2.2+ 严格线由插件自身写 model/selection,这些写入不进日志)",
|
|
134
|
+
"trace.summary.switches": "模型切换",
|
|
135
|
+
"trace.dir.up": "相对上一段升档,共 %n 次请求",
|
|
136
|
+
"trace.dir.down": "相对上一段降档,共 %n 次请求",
|
|
137
|
+
"trace.dir.flat": "档位不变、选中意图变了,共 %n 次请求",
|
|
138
|
+
"trace.dir.start": "本会话首个档位,共 %n 次请求",
|
|
139
|
+
"ring.title": "上下文检查",
|
|
140
|
+
"ring.used": "已用",
|
|
141
|
+
"ring.remaining": "剩余",
|
|
142
|
+
"ring.window": "窗口容量",
|
|
143
|
+
"ring.percent": "占用",
|
|
144
|
+
"ring.system": "系统提示词",
|
|
145
|
+
"ring.tools": "工具定义",
|
|
146
|
+
"ring.messages": "对话消息",
|
|
147
|
+
"ring.warning": "上下文即将用尽——建议压缩上下文或开启新会话。",
|
|
148
|
+
"ring.aria": "上下文已用 %n",
|
|
149
|
+
"ring.unset": "本轮尚未产生用量",
|
|
150
|
+
"ring.billing": "缓存账单",
|
|
151
|
+
"ring.bill.step": "当前步",
|
|
152
|
+
"ring.bill.turn": "当前轮",
|
|
153
|
+
"ring.bill.session": "会话累计",
|
|
154
|
+
"ring.bill.cacheRead": "缓存命中",
|
|
155
|
+
"ring.bill.cacheMiss": "缓存未命中",
|
|
156
|
+
"ring.bill.output": "输出",
|
|
157
|
+
"ring.bill.fullMiss": "完全失效",
|
|
158
|
+
"ring.bill.rounds": "步",
|
|
159
|
+
"ring.bill.peak": "峰价",
|
|
160
|
+
"ring.bill.offPeak": "谷价",
|
|
161
|
+
"ring.bill.flat": "平价",
|
|
162
|
+
"ring.bill.unpriced": "未计价",
|
|
163
|
+
"ring.bill.custom": "自填价计价",
|
|
164
|
+
"ring.bill.pricedAs": "按 %n 计价",
|
|
165
|
+
"ring.bill.priced": "按目录价计价",
|
|
166
|
+
"ring.bill.estimate": "目录外估算价",
|
|
167
|
+
"ring.bill.uncalibrated": "未校准·仅供参考"
|
|
120
168
|
};
|
|
121
169
|
/** English dictionary (keys mirror zh). */
|
|
122
170
|
const en = {
|
|
@@ -139,6 +187,8 @@ window.__ModuleLoader__.load({
|
|
|
139
187
|
"card.defaultPricing": "Off-catalog pricing",
|
|
140
188
|
"card.simpleTools": "Simple-tool allowlist (auto downgrade)",
|
|
141
189
|
"card.simpleToolsHint": "Comma- or space-separated tool names added to the built-in \"cheap and deterministic tool\" set (e.g. shell, pwsh, web_fetch). In auto, a step made only of these short calls drops to low. The built-in set already covers bash/terminal/shell/pwsh; use this for host-specific names.",
|
|
190
|
+
"card.simpleToolsRegex": "Simple-tool regex list (auto downgrade)",
|
|
191
|
+
"card.simpleToolsRegexHint": "One JavaScript regex per entry (no auto-anchoring — write your own ^; case-insensitive), alongside the literal list above and counted in the same ratio. Patterns match BOTH the full tool name and the ops_-stripped bare name, so \"^ops_.*\" covers the whole dsh-ops family at once. Invalid entries are skipped with a one-time warning.",
|
|
142
192
|
"card.defaultPricingHint": "How to price models the catalog does not list (including gateway models brought in by other plugins); catalogued models always use their own rates. Pricing changes only affect new accounting from now on.",
|
|
143
193
|
"card.defaultPricing.estimate": "estimate — typical-price fallback (uncalibrated, reference only; default)",
|
|
144
194
|
"card.defaultPricing.cn": "cn — CNY calibration tier (off-catalog still falls back to the typical price)",
|
|
@@ -224,7 +274,53 @@ window.__ModuleLoader__.load({
|
|
|
224
274
|
"trace.label": "Effort trace",
|
|
225
275
|
"trace.empty": "No committed request levels in this session yet.",
|
|
226
276
|
"trace.intent.auto": "auto",
|
|
227
|
-
"trace.intent.manual": "manual"
|
|
277
|
+
"trace.intent.manual": "manual",
|
|
278
|
+
"trace.title": "Effort trace",
|
|
279
|
+
"trace.subtitle": "The level every request in this session actually went out with; consecutive identical levels collapse into one run (newest first).",
|
|
280
|
+
"trace.summary.requests": "requests",
|
|
281
|
+
"trace.summary.runs": "runs",
|
|
282
|
+
"trace.summary.autoRuns": "runs scheduled by auto",
|
|
283
|
+
"trace.summary.peak": "peak",
|
|
284
|
+
"trace.summary.hint": "T=turn · S=step",
|
|
285
|
+
"trace.note.attribution": "Note: from 0.2.2 the host forbids changing the level at request time, so this plugin (strict line) writes `model/selection` itself a step ahead — a “manual” tag therefore only means the last selection in the log was a concrete level, not necessarily a human click.",
|
|
286
|
+
"trace.intent.default": "default",
|
|
287
|
+
"trace.intent.unknown": "unrecorded",
|
|
288
|
+
"trace.intent.scheduler": "scheduler",
|
|
289
|
+
"trace.intent.unknownHint": "This level change has no matching selection record in the session log (on the 0.2.2+ strict line the plugin itself writes model/selection and those writes never reach the log)",
|
|
290
|
+
"trace.summary.switches": "model switches",
|
|
291
|
+
"trace.dir.up": "escalated from the previous run, %n request(s)",
|
|
292
|
+
"trace.dir.down": "dropped from the previous run, %n request(s)",
|
|
293
|
+
"trace.dir.flat": "same level, different pick, %n request(s)",
|
|
294
|
+
"trace.dir.start": "this session’s first level, %n request(s)",
|
|
295
|
+
"ring.title": "Context check",
|
|
296
|
+
"ring.used": "Used",
|
|
297
|
+
"ring.remaining": "Remaining",
|
|
298
|
+
"ring.window": "Context window",
|
|
299
|
+
"ring.percent": "Pressure",
|
|
300
|
+
"ring.system": "System prompt",
|
|
301
|
+
"ring.tools": "Tool definitions",
|
|
302
|
+
"ring.messages": "Messages",
|
|
303
|
+
"ring.warning": "Context is nearly full — compact the context or start a new session.",
|
|
304
|
+
"ring.aria": "%n of context used",
|
|
305
|
+
"ring.unset": "No usage yet in this turn",
|
|
306
|
+
"ring.billing": "Cache billing",
|
|
307
|
+
"ring.bill.step": "This step",
|
|
308
|
+
"ring.bill.turn": "This turn",
|
|
309
|
+
"ring.bill.session": "Session total",
|
|
310
|
+
"ring.bill.cacheRead": "Cache read",
|
|
311
|
+
"ring.bill.cacheMiss": "Cache miss",
|
|
312
|
+
"ring.bill.output": "Output",
|
|
313
|
+
"ring.bill.fullMiss": "Full misses",
|
|
314
|
+
"ring.bill.rounds": "steps",
|
|
315
|
+
"ring.bill.peak": "Peak rates",
|
|
316
|
+
"ring.bill.offPeak": "Off-peak rates",
|
|
317
|
+
"ring.bill.flat": "Flat rate",
|
|
318
|
+
"ring.bill.unpriced": "Not billed",
|
|
319
|
+
"ring.bill.custom": "priced at custom rates",
|
|
320
|
+
"ring.bill.pricedAs": "priced as %n",
|
|
321
|
+
"ring.bill.priced": "priced at catalog rates",
|
|
322
|
+
"ring.bill.estimate": "estimated off-catalog",
|
|
323
|
+
"ring.bill.uncalibrated": "uncalibrated — reference only"
|
|
228
324
|
};
|
|
229
325
|
/** Japanese dictionary (keys mirror zh). */
|
|
230
326
|
const ja = {
|
|
@@ -247,6 +343,8 @@ window.__ModuleLoader__.load({
|
|
|
247
343
|
"card.defaultPricing": "カタログ外モデルの価格",
|
|
248
344
|
"card.simpleTools": "簡易ツール許可リスト(auto ダウングレード)",
|
|
249
345
|
"card.simpleToolsHint": "カンマまたはスペース区切りのツール名を内蔵の「安価・決定論的ツール」判定に追加します(例: shell、pwsh、web_fetch)。auto ではこれらの短い呼び出しのみのステップは low に下がります。内蔵集合は既に bash/terminal/shell/pwsh を含むため、ここではホスト固有の名前を補完してください。",
|
|
346
|
+
"card.simpleToolsRegex": "簡易ツール正規表現リスト(auto 降格判定)",
|
|
347
|
+
"card.simpleToolsRegexHint": "1 エントリ = 1 つの JavaScript 正規表現(自動アンカーなし — 自前で ^ を書く、大文字小文字を無視)。上のリテラル名単と併存し同一の比率に計上されます。パターンは完全なツール名と ops_ を剥いだ裸名の両方に一致するため、「^ops_.*」だけで dsh-ops ファミリー全体を覆えます。不正なパターンは 1 度だけ警告してスキップされます。",
|
|
250
348
|
"card.defaultPricingHint": "価格カタログに未登録のモデル(他プラグイン経由のゲートウェイモデル含む)の計算方法。登録済みモデルは常にカタログ価格を使用。価格変更は以降の新規記録のみ影響。",
|
|
251
349
|
"card.defaultPricing.estimate": "estimate — 典型価格でフォールバック見積り(未校正・参考値、デフォルト)",
|
|
252
350
|
"card.defaultPricing.cn": "cn — 人民元キャリブレーション(カタログ外は典型価格の見積りのまま)",
|
|
@@ -332,7 +430,53 @@ window.__ModuleLoader__.load({
|
|
|
332
430
|
"trace.label": "Effort 軌跡",
|
|
333
431
|
"trace.empty": "このセッションには確定済みリクエストのレベルがまだありません。",
|
|
334
432
|
"trace.intent.auto": "auto",
|
|
335
|
-
"trace.intent.manual": "手動"
|
|
433
|
+
"trace.intent.manual": "手動",
|
|
434
|
+
"trace.title": "Effort 軌跡",
|
|
435
|
+
"trace.subtitle": "このセッションで各リクエストが実際に送られたレベル。連続する同一レベルは 1 セグメントにまとめます(新しい順)。",
|
|
436
|
+
"trace.summary.requests": "リクエスト",
|
|
437
|
+
"trace.summary.runs": "セグメント",
|
|
438
|
+
"trace.summary.autoRuns": "セグメントは auto が決定",
|
|
439
|
+
"trace.summary.peak": "最大",
|
|
440
|
+
"trace.summary.hint": "T=ターン · S=ステップ",
|
|
441
|
+
"trace.note.attribution": "注:0.2.2 以降ホストはリクエスト段階でのレベル変更を禁止するため、本プラグイン(厳格ライン)は 1 ステップ先の `model/selection` を自分で書きます。したがって「手動」はログ上の最後の選択が具体レベルだったことだけを意味し、人手のクリックとは限りません。",
|
|
442
|
+
"trace.intent.default": "既定",
|
|
443
|
+
"trace.intent.unknown": "記録なし",
|
|
444
|
+
"trace.intent.scheduler": "プラグイン",
|
|
445
|
+
"trace.intent.unknownHint": "このレベル変更に対応する選択記録がセッションログにありません(0.2.2 以降の厳格ラインではプラグイン自身が model/selection を書き、その書き込みはログに残りません)",
|
|
446
|
+
"trace.summary.switches": "モデル切替",
|
|
447
|
+
"trace.dir.up": "前のセグメントから上げ、%n リクエスト",
|
|
448
|
+
"trace.dir.down": "前のセグメントから下げ、%n リクエスト",
|
|
449
|
+
"trace.dir.flat": "レベルは同じで選択のみ変更、%n リクエスト",
|
|
450
|
+
"trace.dir.start": "このセッションの最初のレベル、%n リクエスト",
|
|
451
|
+
"ring.title": "コンテキスト確認",
|
|
452
|
+
"ring.used": "使用済み",
|
|
453
|
+
"ring.remaining": "残り",
|
|
454
|
+
"ring.window": "コンテキストウィンドウ",
|
|
455
|
+
"ring.percent": "占有率",
|
|
456
|
+
"ring.system": "システムプロンプト",
|
|
457
|
+
"ring.tools": "ツール定義",
|
|
458
|
+
"ring.messages": "対話メッセージ",
|
|
459
|
+
"ring.warning": "コンテキストがもうすぐ満杯です。圧縮するか、新しいセッションを開始してください。",
|
|
460
|
+
"ring.aria": "コンテキスト使用率 %n",
|
|
461
|
+
"ring.unset": "このターンはまだ使用量がありません",
|
|
462
|
+
"ring.billing": "キャッシュ請求",
|
|
463
|
+
"ring.bill.step": "現在のステップ",
|
|
464
|
+
"ring.bill.turn": "現在のターン",
|
|
465
|
+
"ring.bill.session": "セッション累計",
|
|
466
|
+
"ring.bill.cacheRead": "キャッシュヒット",
|
|
467
|
+
"ring.bill.cacheMiss": "キャッシュミス",
|
|
468
|
+
"ring.bill.output": "出力",
|
|
469
|
+
"ring.bill.fullMiss": "完全ミス",
|
|
470
|
+
"ring.bill.rounds": "ステップ",
|
|
471
|
+
"ring.bill.peak": "ピーク料金",
|
|
472
|
+
"ring.bill.offPeak": "オフピーク料金",
|
|
473
|
+
"ring.bill.flat": "定額",
|
|
474
|
+
"ring.bill.unpriced": "未計量",
|
|
475
|
+
"ring.bill.custom": "カスタム料金で計量",
|
|
476
|
+
"ring.bill.pricedAs": "%n として計量",
|
|
477
|
+
"ring.bill.priced": "カタログ料金で計量",
|
|
478
|
+
"ring.bill.estimate": "カタログ外の推定料金",
|
|
479
|
+
"ring.bill.uncalibrated": "未較正・参考のみ"
|
|
336
480
|
};
|
|
337
481
|
/** Korean dictionary (keys mirror zh). */
|
|
338
482
|
const ko = {
|
|
@@ -355,6 +499,8 @@ window.__ModuleLoader__.load({
|
|
|
355
499
|
"card.defaultPricing": "카탈로그 외 과금",
|
|
356
500
|
"card.simpleTools": "간단한 도구 허용 목록(auto 강등)",
|
|
357
501
|
"card.simpleToolsHint": "쉼표 또는 공백으로 구분한 도구 이름을 내장 \"저렴하고 결정적인 도구\" 판정에 추가합니다(예: shell, pwsh, web_fetch). auto에서는 이런 짧은 호출만으로 구성된 단계가 low로 내려갑니다. 내장 목록은 이미 bash/terminal/shell/pwsh를 포함하므로 호스트 고유 이름을 보충하세요.",
|
|
502
|
+
"card.simpleToolsRegex": "간단 도구 정규식 목록(auto 강등 판정)",
|
|
503
|
+
"card.simpleToolsRegexHint": "한 줄에 하나의 JavaScript 정규식(자동 앵커 없음 — ^ 를 직접 쓰세요, 대소문자 무시). 위 리터럴 목록과 병행되어 같은 비율에 계산됩니다. 패턴은 전체 도구 이름과 ops_ 를 제거한 이름 모두에 일치하므로 \"^ops_.*\" 하나로 dsh-ops 계열 전체를 커버합니다. 잘못된 항목은 한 번 경고 후 건너뜁니다.",
|
|
358
504
|
"card.defaultPricingHint": "가격 카탈로그에 없는 모델(다른 플러그인으로 유입된 게이트웨이 모델 포함)의 과금 방식. 카탈로그 등재 모델은 항상 자체 등재가 사용. 가격 변경은 이후 신규 기록에만 반영.",
|
|
359
505
|
"card.defaultPricing.estimate": "estimate — 전형가 폴백 추정(미교정·참고용, 기본)",
|
|
360
506
|
"card.defaultPricing.cn": "cn — 위안화 보정 등급(카탈로그 외는 여전히 전형가 추정)",
|
|
@@ -440,7 +586,53 @@ window.__ModuleLoader__.load({
|
|
|
440
586
|
"trace.label": "Effort 궤적",
|
|
441
587
|
"trace.empty": "이 세션에는 아직 확정된 요청 레벨이 없습니다.",
|
|
442
588
|
"trace.intent.auto": "auto",
|
|
443
|
-
"trace.intent.manual": "수동"
|
|
589
|
+
"trace.intent.manual": "수동",
|
|
590
|
+
"trace.title": "Effort 궤적",
|
|
591
|
+
"trace.subtitle": "이 세션에서 각 요청이 실제로 보낸 레벨입니다. 연속된 동일 레벨은 한 구간으로 묶습니다(최신순).",
|
|
592
|
+
"trace.summary.requests": "회 요청",
|
|
593
|
+
"trace.summary.runs": "구간",
|
|
594
|
+
"trace.summary.autoRuns": "구간은 auto 결정",
|
|
595
|
+
"trace.summary.peak": "최고",
|
|
596
|
+
"trace.summary.hint": "T=턴 · S=단계",
|
|
597
|
+
"trace.note.attribution": "참고: 0.2.2부터 호스트는 요청 단계에서 레벨 변경을 금지하므로, 이 플러그인(엄격 라인)은 한 단계 앞서 `model/selection`을 직접 기록합니다. 따라서 \"수동\"은 로그의 마지막 선택이 구체적 레벨이었다는 뜻일 뿐, 사람의 클릭을 의미하지 않습니다.",
|
|
598
|
+
"trace.intent.default": "기본",
|
|
599
|
+
"trace.intent.unknown": "기록 없음",
|
|
600
|
+
"trace.intent.scheduler": "플러그인",
|
|
601
|
+
"trace.intent.unknownHint": "이 레벨 변경에 대응하는 선택 기록이 세션 로그에 없습니다(0.2.2 이후 엄격 라인에서는 플러그인이 직접 model/selection을 기록하며 그 기록은 로그에 남지 않습니다)",
|
|
602
|
+
"trace.summary.switches": "모델 전환",
|
|
603
|
+
"trace.dir.up": "이전 구간보다 상향, %n회 요청",
|
|
604
|
+
"trace.dir.down": "이전 구간보다 하향, %n회 요청",
|
|
605
|
+
"trace.dir.flat": "레벨은 같고 선택만 변경, %n회 요청",
|
|
606
|
+
"trace.dir.start": "이 세션의 첫 레벨, %n회 요청",
|
|
607
|
+
"ring.title": "컨텍스트 확인",
|
|
608
|
+
"ring.used": "사용됨",
|
|
609
|
+
"ring.remaining": "남음",
|
|
610
|
+
"ring.window": "컨텍스트 창",
|
|
611
|
+
"ring.percent": "점유율",
|
|
612
|
+
"ring.system": "시스템 프롬프트",
|
|
613
|
+
"ring.tools": "도구 정의",
|
|
614
|
+
"ring.messages": "대화 메시지",
|
|
615
|
+
"ring.warning": "컨텍스트가 거의 가득 찼습니다. 컨텍스트를 압축하거나 새 세션을 시작하세요.",
|
|
616
|
+
"ring.aria": "컨텍스트 사용률 %n",
|
|
617
|
+
"ring.unset": "이번 턴에는 아직 사용량이 없습니다",
|
|
618
|
+
"ring.billing": "캐시 과금",
|
|
619
|
+
"ring.bill.step": "현재 단계",
|
|
620
|
+
"ring.bill.turn": "현재 턴",
|
|
621
|
+
"ring.bill.session": "세션 누적",
|
|
622
|
+
"ring.bill.cacheRead": "캐시 적중",
|
|
623
|
+
"ring.bill.cacheMiss": "캐시 미스",
|
|
624
|
+
"ring.bill.output": "출력",
|
|
625
|
+
"ring.bill.fullMiss": "완전 미스",
|
|
626
|
+
"ring.bill.rounds": "단계",
|
|
627
|
+
"ring.bill.peak": "피크 요금",
|
|
628
|
+
"ring.bill.offPeak": "비피크 요금",
|
|
629
|
+
"ring.bill.flat": "정액",
|
|
630
|
+
"ring.bill.unpriced": "미과금",
|
|
631
|
+
"ring.bill.custom": "사용자 지정 요금으로 과금",
|
|
632
|
+
"ring.bill.pricedAs": "%n 요금으로 과금",
|
|
633
|
+
"ring.bill.priced": "카탈로그 요금으로 과금",
|
|
634
|
+
"ring.bill.estimate": "카탈로그 외 추정 요금",
|
|
635
|
+
"ring.bill.uncalibrated": "미보정·참고용"
|
|
444
636
|
};
|
|
445
637
|
/** French dictionary (keys mirror zh). */
|
|
446
638
|
const fr = {
|
|
@@ -463,6 +655,8 @@ window.__ModuleLoader__.load({
|
|
|
463
655
|
"card.defaultPricing": "Tarification hors catalogue",
|
|
464
656
|
"card.simpleTools": "Liste d'outils simples (rétrogradation auto)",
|
|
465
657
|
"card.simpleToolsHint": "Noms d'outils séparés par virgule ou espace, ajoutés à l'ensemble interne des « outils bon marché et déterministes » (ex. shell, pwsh, web_fetch). En mode auto, une étape composée uniquement de ces appels courts passe à low. L'ensemble interne couvre déjà bash/terminal/shell/pwsh ; utilisez ce champ pour les noms propres à l'hôte.",
|
|
658
|
+
"card.simpleToolsRegex": "Liste regex d'outils simples (déclassement auto)",
|
|
659
|
+
"card.simpleToolsRegexHint": "Une regex JavaScript par entrée (pas d'ancrage automatique — écrivez votre ^ ; insensible à la casse), en complément de la liste littérale ci-dessus et comptée dans le même ratio. Les motifs testent à la fois le nom complet et le nom nu sans ops_ — « ^ops_.* » couvre toute la famille dsh-ops d'un coup. Les entrées invalides sont ignorées avec un avertissement unique.",
|
|
466
660
|
"card.defaultPricingHint": "Comment tarifer les modèles absents du catalogue (y compris les modèles de passerelle apportés par d'autres plugins) ; les modèles catalogués gardent leurs tarifs. Les changements ne touchent que les nouvelles lignes.",
|
|
467
661
|
"card.defaultPricing.estimate": "estimate — estimation par prix type (non calibrée, à titre indicatif ; par défaut)",
|
|
468
662
|
"card.defaultPricing.cn": "cn — palier calibré CNY (hors catalogue : estimation au prix type)",
|
|
@@ -548,7 +742,53 @@ window.__ModuleLoader__.load({
|
|
|
548
742
|
"trace.label": "Trace des efforts",
|
|
549
743
|
"trace.empty": "Aucun niveau de requête validé dans cette session pour l'instant.",
|
|
550
744
|
"trace.intent.auto": "auto",
|
|
551
|
-
"trace.intent.manual": "manuel"
|
|
745
|
+
"trace.intent.manual": "manuel",
|
|
746
|
+
"trace.title": "Trace des efforts",
|
|
747
|
+
"trace.subtitle": "Le niveau réellement envoyé à chaque requête de cette session ; les niveaux identiques consécutifs sont regroupés (le plus récent en haut).",
|
|
748
|
+
"trace.summary.requests": "requêtes",
|
|
749
|
+
"trace.summary.runs": "segments",
|
|
750
|
+
"trace.summary.autoRuns": "segments planifiés par auto",
|
|
751
|
+
"trace.summary.peak": "pic",
|
|
752
|
+
"trace.summary.hint": "T=tour · S=étape",
|
|
753
|
+
"trace.note.attribution": "Remarque : depuis 0.2.2 l’hôte interdit de changer le niveau au moment de la requête ; ce plugin (ligne stricte) écrit donc lui-même `model/selection` une étape à l’avance. L’étiquette « manuel » signifie seulement que la dernière sélection du journal était un niveau concret, pas forcément un clic humain.",
|
|
754
|
+
"trace.intent.default": "par défaut",
|
|
755
|
+
"trace.intent.unknown": "non enregistré",
|
|
756
|
+
"trace.intent.scheduler": "planificateur",
|
|
757
|
+
"trace.intent.unknownHint": "Ce changement de niveau n’a aucune sélection correspondante dans le journal (depuis 0.2.2, le plugin écrit lui-même model/selection et ces écritures n’atteignent pas le journal)",
|
|
758
|
+
"trace.summary.switches": "changements de modèle",
|
|
759
|
+
"trace.dir.up": "montée depuis le segment précédent, %n requête(s)",
|
|
760
|
+
"trace.dir.down": "descente depuis le segment précédent, %n requête(s)",
|
|
761
|
+
"trace.dir.flat": "même niveau, choix différent, %n requête(s)",
|
|
762
|
+
"trace.dir.start": "premier niveau de la session, %n requête(s)",
|
|
763
|
+
"ring.title": "Vérification du contexte",
|
|
764
|
+
"ring.used": "Utilisé",
|
|
765
|
+
"ring.remaining": "Restant",
|
|
766
|
+
"ring.window": "Fenêtre de contexte",
|
|
767
|
+
"ring.percent": "Occupation",
|
|
768
|
+
"ring.system": "Prompt système",
|
|
769
|
+
"ring.tools": "Définitions d’outils",
|
|
770
|
+
"ring.messages": "Messages",
|
|
771
|
+
"ring.warning": "Le contexte est presque plein — compactez le contexte ou démarrez une nouvelle session.",
|
|
772
|
+
"ring.aria": "%n du contexte utilisé",
|
|
773
|
+
"ring.unset": "Aucune consommation dans ce tour",
|
|
774
|
+
"ring.billing": "Facturation du cache",
|
|
775
|
+
"ring.bill.step": "Cette étape",
|
|
776
|
+
"ring.bill.turn": "Ce tour",
|
|
777
|
+
"ring.bill.session": "Total de la session",
|
|
778
|
+
"ring.bill.cacheRead": "Lecture du cache",
|
|
779
|
+
"ring.bill.cacheMiss": "Échec du cache",
|
|
780
|
+
"ring.bill.output": "Sortie",
|
|
781
|
+
"ring.bill.fullMiss": "Échecs complets",
|
|
782
|
+
"ring.bill.rounds": "étapes",
|
|
783
|
+
"ring.bill.peak": "Tarifs de pointe",
|
|
784
|
+
"ring.bill.offPeak": "Tarifs creux",
|
|
785
|
+
"ring.bill.flat": "Tarif fixe",
|
|
786
|
+
"ring.bill.unpriced": "Non facturé",
|
|
787
|
+
"ring.bill.custom": "facturé au tarif personnalisé",
|
|
788
|
+
"ring.bill.pricedAs": "facturé comme %n",
|
|
789
|
+
"ring.bill.priced": "facturé au tarif du catalogue",
|
|
790
|
+
"ring.bill.estimate": "estimé hors catalogue",
|
|
791
|
+
"ring.bill.uncalibrated": "non calibré — à titre indicatif"
|
|
552
792
|
};
|
|
553
793
|
/** German dictionary (keys mirror zh). */
|
|
554
794
|
const de = {
|
|
@@ -571,6 +811,8 @@ window.__ModuleLoader__.load({
|
|
|
571
811
|
"card.defaultPricing": "Preis außerhalb des Katalogs",
|
|
572
812
|
"card.simpleTools": "Allowlist einfacher Tools (Auto-Downgrade)",
|
|
573
813
|
"card.simpleToolsHint": "Durch Komma oder Leerzeichen getrennte Tool-Namen, die der internen Menge „billige und deterministische Tools“ hinzugefügt werden (z. B. shell, pwsh, web_fetch). Im Auto-Modus sinkt ein Schritt, der nur aus diesen kurzen Aufrufen besteht, auf low. Die interne Menge enthält bereits bash/terminal/shell/pwsh; nutzen Sie dieses Feld für hostspezifische Namen.",
|
|
814
|
+
"card.simpleToolsRegex": "Regex-Liste einfacher Tools (Auto-Downgrade)",
|
|
815
|
+
"card.simpleToolsRegexHint": "Ein JavaScript-Regex pro Eintrag (kein automatischer Anker — ^ selbst schreiben; Groß-/Kleinschreibung ignoriert), neben der Literal-Liste oben und in derselben Quote gezählt. Muster prüfen BOTH den vollständigen Tool-Namen und den ohne ops_ — „^ops_.*“ deckt die ganze dsh-ops-Familie auf einen Schlag ab. Ungültige Einträge werden mit einer einmaligen Warnung übersprungen.",
|
|
574
816
|
"card.defaultPricingHint": "Bepreisung von Modellen ohne Katalogeintrag (inkl. Gateway-Modelle anderer Plugins); katalogisierte Modelle nutzen immer ihre Katalogpreise. Änderungen wirken nur auf neue Buchungen.",
|
|
575
817
|
"card.defaultPricing.estimate": "estimate — Schätzung über Typicalpreis (unkalibriert, nur Referenz; Standard)",
|
|
576
818
|
"card.defaultPricing.cn": "cn — Kalibrierungsstufe CNY (ohne Katalogeintrag weiterhin Typicalpreis-Schätzung)",
|
|
@@ -656,7 +898,53 @@ window.__ModuleLoader__.load({
|
|
|
656
898
|
"trace.label": "Effort-Verlauf",
|
|
657
899
|
"trace.empty": "In dieser Sitzung gibt es noch keine übermittelten Request-Stufen.",
|
|
658
900
|
"trace.intent.auto": "auto",
|
|
659
|
-
"trace.intent.manual": "manuell"
|
|
901
|
+
"trace.intent.manual": "manuell",
|
|
902
|
+
"trace.title": "Effort-Verlauf",
|
|
903
|
+
"trace.subtitle": "Die Stufe, mit der jede Anfrage dieser Sitzung tatsächlich gesendet wurde; aufeinanderfolgende gleiche Stufen werden zusammengefasst (neueste oben).",
|
|
904
|
+
"trace.summary.requests": "Anfragen",
|
|
905
|
+
"trace.summary.runs": "Abschnitte",
|
|
906
|
+
"trace.summary.autoRuns": "Abschnitte von auto geplant",
|
|
907
|
+
"trace.summary.peak": "Spitze",
|
|
908
|
+
"trace.summary.hint": "T=Turn · S=Schritt",
|
|
909
|
+
"trace.note.attribution": "Hinweis: Ab 0.2.2 verbietet der Host das Ändern der Stufe zur Request-Zeit; dieses Plugin (strikte Linie) schreibt `model/selection` daher selbst einen Schritt im Voraus. „Manuell“ heißt also nur, dass die letzte Auswahl im Log eine konkrete Stufe war — nicht zwingend ein menschlicher Klick.",
|
|
910
|
+
"trace.intent.default": "Standard",
|
|
911
|
+
"trace.intent.unknown": "nicht erfasst",
|
|
912
|
+
"trace.intent.scheduler": "Planer",
|
|
913
|
+
"trace.intent.unknownHint": "Für diese Stufenänderung gibt es keine passende Auswahl im Sitzungsprotokoll (ab 0.2.2 schreibt das Plugin selbst model/selection und diese Schreibvorgänge erreichen das Protokoll nicht)",
|
|
914
|
+
"trace.summary.switches": "Modellwechsel",
|
|
915
|
+
"trace.dir.up": "gegenüber dem vorigen Abschnitt erhöht, %n Anfrage(n)",
|
|
916
|
+
"trace.dir.down": "gegenüber dem vorigen Abschnitt gesenkt, %n Anfrage(n)",
|
|
917
|
+
"trace.dir.flat": "gleiche Stufe, andere Auswahl, %n Anfrage(n)",
|
|
918
|
+
"trace.dir.start": "erste Stufe der Sitzung, %n Anfrage(n)",
|
|
919
|
+
"ring.title": "Kontextprüfung",
|
|
920
|
+
"ring.used": "Verwendet",
|
|
921
|
+
"ring.remaining": "Verbleibend",
|
|
922
|
+
"ring.window": "Kontextfenster",
|
|
923
|
+
"ring.percent": "Auslastung",
|
|
924
|
+
"ring.system": "System-Prompt",
|
|
925
|
+
"ring.tools": "Werkzeugdefinitionen",
|
|
926
|
+
"ring.messages": "Nachrichten",
|
|
927
|
+
"ring.warning": "Der Kontext ist fast voll — verdichten Sie den Kontext oder starten Sie eine neue Sitzung.",
|
|
928
|
+
"ring.aria": "%n des Kontexts verbraucht",
|
|
929
|
+
"ring.unset": "In diesem Zug noch keine Nutzung",
|
|
930
|
+
"ring.billing": "Cache-Abrechnung",
|
|
931
|
+
"ring.bill.step": "Aktueller Schritt",
|
|
932
|
+
"ring.bill.turn": "Aktueller Zug",
|
|
933
|
+
"ring.bill.session": "Sitzungssumme",
|
|
934
|
+
"ring.bill.cacheRead": "Cache-Treffer",
|
|
935
|
+
"ring.bill.cacheMiss": "Cache-Fehltreffer",
|
|
936
|
+
"ring.bill.output": "Ausgabe",
|
|
937
|
+
"ring.bill.fullMiss": "Vollständige Fehltreffer",
|
|
938
|
+
"ring.bill.rounds": "Schritte",
|
|
939
|
+
"ring.bill.peak": "Spitzentarif",
|
|
940
|
+
"ring.bill.offPeak": "Nebentarif",
|
|
941
|
+
"ring.bill.flat": "Pauschaltarif",
|
|
942
|
+
"ring.bill.unpriced": "Nicht abgerechnet",
|
|
943
|
+
"ring.bill.custom": "zu eigenen Sätzen abgerechnet",
|
|
944
|
+
"ring.bill.pricedAs": "als %n abgerechnet",
|
|
945
|
+
"ring.bill.priced": "zu Katalogsätzen abgerechnet",
|
|
946
|
+
"ring.bill.estimate": "außerhalb des Katalogs geschätzt",
|
|
947
|
+
"ring.bill.uncalibrated": "unkalibriert — nur als Richtwert"
|
|
660
948
|
};
|
|
661
949
|
/** Italian dictionary (keys mirror zh). */
|
|
662
950
|
const it = {
|
|
@@ -679,6 +967,8 @@ window.__ModuleLoader__.load({
|
|
|
679
967
|
"card.defaultPricing": "Prezzi fuori catalogo",
|
|
680
968
|
"card.simpleTools": "Elenco strumenti semplici (downgrade automatico)",
|
|
681
969
|
"card.simpleToolsHint": "Nomi di strumenti separati da virgole o spazi, aggiunti all'insieme interno degli \"strumenti economici e deterministici\" (es. shell, pwsh, web_fetch). In modalità auto, un passo composto solo da queste chiamate brevi scende a low. L'insieme interno copre già bash/terminal/shell/pwsh; usa questo campo per nomi specifici dell'host.",
|
|
970
|
+
"card.simpleToolsRegex": "Lista regex strumenti semplici (downgrade auto)",
|
|
971
|
+
"card.simpleToolsRegexHint": "Una regex JavaScript per voce (nessun ancoraggio automatico — scrivi tu il ^; insensibile a maiuscole), a fianco della lista letterale sopra e conteggiata nello stesso rapporto. I pattern testano sia il nome completo sia il nome nudo senza ops_ — «^ops_.*» copre l'intera famiglia dsh-ops in una volta. Le voci non valide vengono saltate con un avviso una tantum.",
|
|
682
972
|
"card.defaultPricingHint": "Come fatturare i modelli assenti dal catalogo (inclusi i modelli gateway di altri plugin); i modelli in catalogo usano sempre i propri prezzi. Le modifiche valgono solo per le nuove registrazioni.",
|
|
683
973
|
"card.defaultPricing.estimate": "estimate — stima a prezzo tipico (non calibrata, solo indicativa; predefinito)",
|
|
684
974
|
"card.defaultPricing.cn": "cn — livello calibrato CNY (fuori catalogo resta la stima a prezzo tipico)",
|
|
@@ -764,7 +1054,53 @@ window.__ModuleLoader__.load({
|
|
|
764
1054
|
"trace.label": "Traccia degli effort",
|
|
765
1055
|
"trace.empty": "Nessun livello di richiesta confermato in questa sessione.",
|
|
766
1056
|
"trace.intent.auto": "auto",
|
|
767
|
-
"trace.intent.manual": "manuale"
|
|
1057
|
+
"trace.intent.manual": "manuale",
|
|
1058
|
+
"trace.title": "Traccia degli effort",
|
|
1059
|
+
"trace.subtitle": "Il livello realmente inviato a ogni richiesta di questa sessione; livelli identici consecutivi vengono raggruppati (più recenti in alto).",
|
|
1060
|
+
"trace.summary.requests": "richieste",
|
|
1061
|
+
"trace.summary.runs": "segmenti",
|
|
1062
|
+
"trace.summary.autoRuns": "segmenti pianificati da auto",
|
|
1063
|
+
"trace.summary.peak": "picco",
|
|
1064
|
+
"trace.summary.hint": "T=turno · S=passo",
|
|
1065
|
+
"trace.note.attribution": "Nota: dalla 0.2.2 l’host vieta di cambiare livello al momento della richiesta, quindi questo plugin (linea rigorosa) scrive `model/selection` da sé con un passo di anticipo. L’etichetta «manuale» significa solo che l’ultima selezione nel log era un livello concreto, non necessariamente un clic umano.",
|
|
1066
|
+
"trace.intent.default": "predefinito",
|
|
1067
|
+
"trace.intent.unknown": "non registrato",
|
|
1068
|
+
"trace.intent.scheduler": "pianificatore",
|
|
1069
|
+
"trace.intent.unknownHint": "Questo cambio di livello non ha una selezione corrispondente nel log (dalla 0.2.2 il plugin scrive da sé model/selection e queste scritture non arrivano al log)",
|
|
1070
|
+
"trace.summary.switches": "cambi di modello",
|
|
1071
|
+
"trace.dir.up": "salito rispetto al segmento precedente, %n richiesta/e",
|
|
1072
|
+
"trace.dir.down": "sceso rispetto al segmento precedente, %n richiesta/e",
|
|
1073
|
+
"trace.dir.flat": "stesso livello, scelta diversa, %n richiesta/e",
|
|
1074
|
+
"trace.dir.start": "primo livello della sessione, %n richiesta/e",
|
|
1075
|
+
"ring.title": "Controllo contesto",
|
|
1076
|
+
"ring.used": "Usato",
|
|
1077
|
+
"ring.remaining": "Rimanente",
|
|
1078
|
+
"ring.window": "Finestra di contesto",
|
|
1079
|
+
"ring.percent": "Occupazione",
|
|
1080
|
+
"ring.system": "Prompt di sistema",
|
|
1081
|
+
"ring.tools": "Definizioni degli strumenti",
|
|
1082
|
+
"ring.messages": "Messaggi",
|
|
1083
|
+
"ring.warning": "Il contesto è quasi pieno — compatta il contesto o avvia una nuova sessione.",
|
|
1084
|
+
"ring.aria": "%n del contesto usato",
|
|
1085
|
+
"ring.unset": "Nessun consumo in questo turno",
|
|
1086
|
+
"ring.billing": "Addebito cache",
|
|
1087
|
+
"ring.bill.step": "Questo passo",
|
|
1088
|
+
"ring.bill.turn": "Questo turno",
|
|
1089
|
+
"ring.bill.session": "Totale sessione",
|
|
1090
|
+
"ring.bill.cacheRead": "Lettura cache",
|
|
1091
|
+
"ring.bill.cacheMiss": "Mancato riscontro cache",
|
|
1092
|
+
"ring.bill.output": "Output",
|
|
1093
|
+
"ring.bill.fullMiss": "Mancati riscontri completi",
|
|
1094
|
+
"ring.bill.rounds": "passi",
|
|
1095
|
+
"ring.bill.peak": "Tariffe di picco",
|
|
1096
|
+
"ring.bill.offPeak": "Tariffe fuori picco",
|
|
1097
|
+
"ring.bill.flat": "Tariffa fissa",
|
|
1098
|
+
"ring.bill.unpriced": "Non addebitato",
|
|
1099
|
+
"ring.bill.custom": "addebitato a tariffe personalizzate",
|
|
1100
|
+
"ring.bill.pricedAs": "addebitato come %n",
|
|
1101
|
+
"ring.bill.priced": "addebitato a tariffe di catalogo",
|
|
1102
|
+
"ring.bill.estimate": "stimato fuori catalogo",
|
|
1103
|
+
"ring.bill.uncalibrated": "non calibrato — solo indicativo"
|
|
768
1104
|
};
|
|
769
1105
|
/** Russian dictionary (keys mirror zh). */
|
|
770
1106
|
const ru = {
|
|
@@ -787,6 +1123,8 @@ window.__ModuleLoader__.load({
|
|
|
787
1123
|
"card.defaultPricing": "Внекаталожное ценообразование",
|
|
788
1124
|
"card.simpleTools": "Список простых инструментов (понижение auto)",
|
|
789
1125
|
"card.simpleToolsHint": "Имена инструментов через запятую или пробел, добавляемые во встроенный набор «дешёвых и детерминированных инструментов» (напр. shell, pwsh, web_fetch). В режиме auto шаг из таких коротких вызовов понижается до low. Встроенный набор уже включает bash/terminal/shell/pwsh; используйте это поле для имён, специфичных для хоста.",
|
|
1126
|
+
"card.simpleToolsRegex": "Regex-список простых инструментов (понижение auto)",
|
|
1127
|
+
"card.simpleToolsRegexHint": "Одно регулярное выражение JavaScript на запись (без автозаякоривания — ^ пишите сами; без учёта регистра), рядом со литеральным списком выше и в той же доле. Шаблоны проверяют и полное имя инструмента, и имя без ops_ — «^ops_.*» покрывает всё семейство dsh-ops разом. Некорректные записи пропускаются с однократным предупреждением.",
|
|
790
1128
|
"card.defaultPricingHint": "Как считать модели, которых нет в каталоге цен (включая шлюзовые модели из других плагинов); каталожные модели всегда считаются по своему прайсу. Изменения влияют только на новые записи.",
|
|
791
1129
|
"card.defaultPricing.estimate": "estimate — оценка по типовой цене (не откалибровано, справочно; по умолчанию)",
|
|
792
1130
|
"card.defaultPricing.cn": "cn — калибровка CNY (вне каталога всё равно оценка по типовой цене)",
|
|
@@ -872,7 +1210,53 @@ window.__ModuleLoader__.load({
|
|
|
872
1210
|
"trace.label": "Трасса усилий",
|
|
873
1211
|
"trace.empty": "В этой сессии ещё нет зафиксированных уровней запросов.",
|
|
874
1212
|
"trace.intent.auto": "auto",
|
|
875
|
-
"trace.intent.manual": "вручную"
|
|
1213
|
+
"trace.intent.manual": "вручную",
|
|
1214
|
+
"trace.title": "Трасса усилий",
|
|
1215
|
+
"trace.subtitle": "Уровень, с которым реально ушёл каждый запрос этой сессии; одинаковые подряд уровни схлопнуты в один отрезок (сверху новее).",
|
|
1216
|
+
"trace.summary.requests": "запросов",
|
|
1217
|
+
"trace.summary.runs": "отрезков",
|
|
1218
|
+
"trace.summary.autoRuns": "отрезков выбрал auto",
|
|
1219
|
+
"trace.summary.peak": "пик",
|
|
1220
|
+
"trace.summary.hint": "T=ход · S=шаг",
|
|
1221
|
+
"trace.note.attribution": "Примечание: с 0.2.2 хост запрещает менять уровень на этапе запроса, поэтому плагин (строгая линия) сам пишет `model/selection` на шаг вперёд. Метка «вручную» означает лишь то, что последний выбор в журнале был конкретным уровнем, а не обязательно клик человека.",
|
|
1222
|
+
"trace.intent.default": "по умолчанию",
|
|
1223
|
+
"trace.intent.unknown": "не записано",
|
|
1224
|
+
"trace.intent.scheduler": "планировщик",
|
|
1225
|
+
"trace.intent.unknownHint": "Для этого изменения уровня в журнале нет соответствующего выбора (с 0.2.2 плагин сам пишет model/selection, и эти записи не попадают в журнал)",
|
|
1226
|
+
"trace.summary.switches": "смен модели",
|
|
1227
|
+
"trace.dir.up": "повышение относительно прошлого отрезка, %n запрос(ов)",
|
|
1228
|
+
"trace.dir.down": "понижение относительно прошлого отрезка, %n запрос(ов)",
|
|
1229
|
+
"trace.dir.flat": "уровень тот же, выбор другой, %n запрос(ов)",
|
|
1230
|
+
"trace.dir.start": "первый уровень сессии, %n запрос(ов)",
|
|
1231
|
+
"ring.title": "Проверка контекста",
|
|
1232
|
+
"ring.used": "Использовано",
|
|
1233
|
+
"ring.remaining": "Осталось",
|
|
1234
|
+
"ring.window": "Окно контекста",
|
|
1235
|
+
"ring.percent": "Заполнено",
|
|
1236
|
+
"ring.system": "Системный промпт",
|
|
1237
|
+
"ring.tools": "Определения инструментов",
|
|
1238
|
+
"ring.messages": "Сообщения",
|
|
1239
|
+
"ring.warning": "Контекст почти заполнен — сожмите контекст или начните новый сеанс.",
|
|
1240
|
+
"ring.aria": "Использовано %n контекста",
|
|
1241
|
+
"ring.unset": "В этом ходе расхода ещё нет",
|
|
1242
|
+
"ring.billing": "Расчёт кэша",
|
|
1243
|
+
"ring.bill.step": "Текущий шаг",
|
|
1244
|
+
"ring.bill.turn": "Текущий ход",
|
|
1245
|
+
"ring.bill.session": "Итого по сеансу",
|
|
1246
|
+
"ring.bill.cacheRead": "Чтение из кэша",
|
|
1247
|
+
"ring.bill.cacheMiss": "Промах кэша",
|
|
1248
|
+
"ring.bill.output": "Вывод",
|
|
1249
|
+
"ring.bill.fullMiss": "Полные промахи",
|
|
1250
|
+
"ring.bill.rounds": "шаг(ов)",
|
|
1251
|
+
"ring.bill.peak": "Пиковые тарифы",
|
|
1252
|
+
"ring.bill.offPeak": "Внепиковые тарифы",
|
|
1253
|
+
"ring.bill.flat": "Фиксированный тариф",
|
|
1254
|
+
"ring.bill.unpriced": "Без оплаты",
|
|
1255
|
+
"ring.bill.custom": "по собственному тарифу",
|
|
1256
|
+
"ring.bill.pricedAs": "по тарифу %n",
|
|
1257
|
+
"ring.bill.priced": "по тарифу каталога",
|
|
1258
|
+
"ring.bill.estimate": "оценка вне каталога",
|
|
1259
|
+
"ring.bill.uncalibrated": "без калибровки — только справка"
|
|
876
1260
|
};
|
|
877
1261
|
/** Spanish dictionary (keys mirror zh). */
|
|
878
1262
|
const es = {
|
|
@@ -895,6 +1279,8 @@ window.__ModuleLoader__.load({
|
|
|
895
1279
|
"card.defaultPricing": "Precio fuera del catálogo",
|
|
896
1280
|
"card.simpleTools": "Lista de herramientas simples (degradación auto)",
|
|
897
1281
|
"card.simpleToolsHint": "Nombres de herramientas separados por comas o espacios, añadidos al conjunto interno de \"herramientas baratas y deterministas\" (p. ej. shell, pwsh, web_fetch). En modo auto, un paso compuesto solo por estas llamadas cortas baja a low. El conjunto interno ya cubre bash/terminal/shell/pwsh; use este campo para nombres propios del host.",
|
|
1282
|
+
"card.simpleToolsRegex": "Lista regex de herramientas simples (bajada auto)",
|
|
1283
|
+
"card.simpleToolsRegexHint": "Una expresión regular de JavaScript por entrada (sin anclaje automático — escriba su propio ^; insensible a mayúsculas), junto a la lista literal de arriba y contada en la misma proporción. Los patrones prueban tanto el nombre completo como el nombre sin ops_ — «^ops_.*» cubre toda la familia dsh-ops de una vez. Las entradas inválidas se omiten con un aviso único.",
|
|
898
1284
|
"card.defaultPricingHint": "Cómo facturar los modelos sin entrada en el catálogo (incluidos modelos de puerta de enlace de otros plugins); los modelos catalogados usan siempre sus precios. Los cambios solo afectan a registros nuevos.",
|
|
899
1285
|
"card.defaultPricing.estimate": "estimate — estimación a precio típico (sin calibrar, solo referencia; predeterminado)",
|
|
900
1286
|
"card.defaultPricing.cn": "cn — nivel calibrado en CNY (fuera del catálogo sigue siendo estimación a precio típico)",
|
|
@@ -980,7 +1366,53 @@ window.__ModuleLoader__.load({
|
|
|
980
1366
|
"trace.label": "Trazado de esfuerzo",
|
|
981
1367
|
"trace.empty": "Aún no hay niveles de solicitud confirmados en esta sesión.",
|
|
982
1368
|
"trace.intent.auto": "auto",
|
|
983
|
-
"trace.intent.manual": "manual"
|
|
1369
|
+
"trace.intent.manual": "manual",
|
|
1370
|
+
"trace.title": "Trazado de esfuerzo",
|
|
1371
|
+
"trace.subtitle": "El nivel con el que realmente salió cada solicitud de esta sesión; los niveles idénticos consecutivos se agrupan (lo más reciente arriba).",
|
|
1372
|
+
"trace.summary.requests": "solicitudes",
|
|
1373
|
+
"trace.summary.runs": "tramos",
|
|
1374
|
+
"trace.summary.autoRuns": "tramos planificados por auto",
|
|
1375
|
+
"trace.summary.peak": "pico",
|
|
1376
|
+
"trace.summary.hint": "T=turno · S=paso",
|
|
1377
|
+
"trace.note.attribution": "Nota: desde 0.2.2 el host prohíbe cambiar el nivel en el momento de la solicitud, así que este plugin (línea estricta) escribe `model/selection` por sí mismo un paso antes. La etiqueta «manual» solo significa que la última selección del registro era un nivel concreto, no necesariamente un clic humano.",
|
|
1378
|
+
"trace.intent.default": "predeterminado",
|
|
1379
|
+
"trace.intent.unknown": "sin registro",
|
|
1380
|
+
"trace.intent.scheduler": "planificador",
|
|
1381
|
+
"trace.intent.unknownHint": "Este cambio de nivel no tiene una selección correspondiente en el registro (desde 0.2.2 el plugin escribe model/selection por sí mismo y esas escrituras no llegan al registro)",
|
|
1382
|
+
"trace.summary.switches": "cambios de modelo",
|
|
1383
|
+
"trace.dir.up": "subió respecto al tramo anterior, %n solicitud(es)",
|
|
1384
|
+
"trace.dir.down": "bajó respecto al tramo anterior, %n solicitud(es)",
|
|
1385
|
+
"trace.dir.flat": "mismo nivel, elección distinta, %n solicitud(es)",
|
|
1386
|
+
"trace.dir.start": "primer nivel de la sesión, %n solicitud(es)",
|
|
1387
|
+
"ring.title": "Comprobación de contexto",
|
|
1388
|
+
"ring.used": "Usado",
|
|
1389
|
+
"ring.remaining": "Restante",
|
|
1390
|
+
"ring.window": "Ventana de contexto",
|
|
1391
|
+
"ring.percent": "Ocupación",
|
|
1392
|
+
"ring.system": "Mensaje de sistema",
|
|
1393
|
+
"ring.tools": "Definiciones de herramientas",
|
|
1394
|
+
"ring.messages": "Mensajes",
|
|
1395
|
+
"ring.warning": "El contexto está casi lleno: compacta el contexto o inicia una sesión nueva.",
|
|
1396
|
+
"ring.aria": "%n del contexto usado",
|
|
1397
|
+
"ring.unset": "Aún no hay consumo en este turno",
|
|
1398
|
+
"ring.billing": "Facturación de caché",
|
|
1399
|
+
"ring.bill.step": "Este paso",
|
|
1400
|
+
"ring.bill.turn": "Este turno",
|
|
1401
|
+
"ring.bill.session": "Total de la sesión",
|
|
1402
|
+
"ring.bill.cacheRead": "Lectura de caché",
|
|
1403
|
+
"ring.bill.cacheMiss": "Fallo de caché",
|
|
1404
|
+
"ring.bill.output": "Salida",
|
|
1405
|
+
"ring.bill.fullMiss": "Fallos completos",
|
|
1406
|
+
"ring.bill.rounds": "pasos",
|
|
1407
|
+
"ring.bill.peak": "Tarifas punta",
|
|
1408
|
+
"ring.bill.offPeak": "Tarifas valle",
|
|
1409
|
+
"ring.bill.flat": "Tarifa plana",
|
|
1410
|
+
"ring.bill.unpriced": "Sin facturar",
|
|
1411
|
+
"ring.bill.custom": "facturado a tarifa propia",
|
|
1412
|
+
"ring.bill.pricedAs": "facturado como %n",
|
|
1413
|
+
"ring.bill.priced": "facturado a tarifa de catálogo",
|
|
1414
|
+
"ring.bill.estimate": "estimado fuera de catálogo",
|
|
1415
|
+
"ring.bill.uncalibrated": "sin calibrar — solo orientativo"
|
|
984
1416
|
};
|
|
985
1417
|
/** Portuguese (pt-BR) dictionary (keys mirror zh). */
|
|
986
1418
|
const pt = {
|
|
@@ -1003,6 +1435,8 @@ window.__ModuleLoader__.load({
|
|
|
1003
1435
|
"card.defaultPricing": "Preço fora do catálogo",
|
|
1004
1436
|
"card.simpleTools": "Lista de ferramentas simples (rebaixamento automático)",
|
|
1005
1437
|
"card.simpleToolsHint": "Nomes de ferramentas separados por vírgula ou espaço, adicionados ao conjunto interno de \"ferramentas baratas e determinísticas\" (por exemplo shell, pwsh, web_fetch). No modo auto, uma etapa composta apenas por essas chamadas curtas desce para low. O conjunto interno já cobre bash/terminal/shell/pwsh; use este campo para nomes próprios do host.",
|
|
1438
|
+
"card.simpleToolsRegex": "Lista regex de ferramentas simples (rebaixamento auto)",
|
|
1439
|
+
"card.simpleToolsRegexHint": "Uma expressão regular JavaScript por entrada (sem âncora automática — escreva o seu ^; insensível a maiúsculas), ao lado da lista literal acima e contada na mesma razão. Os padrões testam tanto o nome completo quanto o nome sem ops_ — «^ops_.*» cobre toda a família dsh-ops de uma vez. Entradas inválidas são ignoradas com um aviso único.",
|
|
1006
1440
|
"card.defaultPricingHint": "Como cobrar modelos sem entrada no catálogo (incluindo modelos de gateway de outros plugins); modelos catalogados usam sempre os próprios preços. Alterações afetam apenas registros novos.",
|
|
1007
1441
|
"card.defaultPricing.estimate": "estimate — estimativa a preço típico (não calibrado, só referência; padrão)",
|
|
1008
1442
|
"card.defaultPricing.cn": "cn — nível calibrado em CNY (fora do catálogo continua sendo estimativa a preço típico)",
|
|
@@ -1088,7 +1522,53 @@ window.__ModuleLoader__.load({
|
|
|
1088
1522
|
"trace.label": "Trilha de esforço",
|
|
1089
1523
|
"trace.empty": "Ainda não há níveis de solicitação confirmados nesta sessão.",
|
|
1090
1524
|
"trace.intent.auto": "auto",
|
|
1091
|
-
"trace.intent.manual": "manual"
|
|
1525
|
+
"trace.intent.manual": "manual",
|
|
1526
|
+
"trace.title": "Trilha de esforço",
|
|
1527
|
+
"trace.subtitle": "O nível com que cada requisição desta sessão realmente saiu; níveis idênticos consecutivos são agrupados (mais recente no topo).",
|
|
1528
|
+
"trace.summary.requests": "requisições",
|
|
1529
|
+
"trace.summary.runs": "trechos",
|
|
1530
|
+
"trace.summary.autoRuns": "trechos agendados pelo auto",
|
|
1531
|
+
"trace.summary.peak": "pico",
|
|
1532
|
+
"trace.summary.hint": "T=turno · S=passo",
|
|
1533
|
+
"trace.note.attribution": "Nota: desde 0.2.2 o host proíbe mudar o nível no momento da requisição, então este plugin (linha estrita) escreve `model/selection` por conta própria um passo antes. O rótulo «manual» significa apenas que a última seleção no log era um nível concreto, não necessariamente um clique humano.",
|
|
1534
|
+
"trace.intent.default": "padrão",
|
|
1535
|
+
"trace.intent.unknown": "não registrado",
|
|
1536
|
+
"trace.intent.scheduler": "agendador",
|
|
1537
|
+
"trace.intent.unknownHint": "Esta mudança de nível não tem seleção correspondente no log (desde 0.2.2 o plugin escreve model/selection por conta própria e essas escrituras não chegam ao log)",
|
|
1538
|
+
"trace.summary.switches": "trocas de modelo",
|
|
1539
|
+
"trace.dir.up": "subiu em relação ao trecho anterior, %n requisição(ões)",
|
|
1540
|
+
"trace.dir.down": "desceu em relação ao trecho anterior, %n requisição(ões)",
|
|
1541
|
+
"trace.dir.flat": "mesmo nível, escolha diferente, %n requisição(ões)",
|
|
1542
|
+
"trace.dir.start": "primeiro nível da sessão, %n requisição(ões)",
|
|
1543
|
+
"ring.title": "Verificação de contexto",
|
|
1544
|
+
"ring.used": "Usado",
|
|
1545
|
+
"ring.remaining": "Restante",
|
|
1546
|
+
"ring.window": "Janela de contexto",
|
|
1547
|
+
"ring.percent": "Ocupação",
|
|
1548
|
+
"ring.system": "Prompt de sistema",
|
|
1549
|
+
"ring.tools": "Definições de ferramentas",
|
|
1550
|
+
"ring.messages": "Mensagens",
|
|
1551
|
+
"ring.warning": "O contexto está quase cheio — compacte o contexto ou inicie uma nova sessão.",
|
|
1552
|
+
"ring.aria": "%n do contexto usado",
|
|
1553
|
+
"ring.unset": "Ainda sem consumo neste turno",
|
|
1554
|
+
"ring.billing": "Cobrança de cache",
|
|
1555
|
+
"ring.bill.step": "Este passo",
|
|
1556
|
+
"ring.bill.turn": "Este turno",
|
|
1557
|
+
"ring.bill.session": "Total da sessão",
|
|
1558
|
+
"ring.bill.cacheRead": "Leitura de cache",
|
|
1559
|
+
"ring.bill.cacheMiss": "Falha de cache",
|
|
1560
|
+
"ring.bill.output": "Saída",
|
|
1561
|
+
"ring.bill.fullMiss": "Falhas completas",
|
|
1562
|
+
"ring.bill.rounds": "passos",
|
|
1563
|
+
"ring.bill.peak": "Tarifas de pico",
|
|
1564
|
+
"ring.bill.offPeak": "Tarifas fora de pico",
|
|
1565
|
+
"ring.bill.flat": "Tarifa fixa",
|
|
1566
|
+
"ring.bill.unpriced": "Não cobrado",
|
|
1567
|
+
"ring.bill.custom": "cobrado a tarifa personalizada",
|
|
1568
|
+
"ring.bill.pricedAs": "cobrado como %n",
|
|
1569
|
+
"ring.bill.priced": "cobrado a tarifa de catálogo",
|
|
1570
|
+
"ring.bill.estimate": "estimado fora do catálogo",
|
|
1571
|
+
"ring.bill.uncalibrated": "não calibrado — apenas referência"
|
|
1092
1572
|
};
|
|
1093
1573
|
//#endregion
|
|
1094
1574
|
//#region src/client/context-ring.tsx
|
|
@@ -1117,74 +1597,10 @@ window.__ModuleLoader__.load({
|
|
|
1117
1597
|
* projection pushes — no polling.
|
|
1118
1598
|
*
|
|
1119
1599
|
* Zero host coupling beyond react + the injected seats: plain SVG + HTML
|
|
1120
|
-
* with token-based inline styling; copy
|
|
1121
|
-
* (the
|
|
1600
|
+
* with token-based inline styling; copy comes from the plugin dictionary
|
|
1601
|
+
* (`ring.*`), delivered as the `t` thunk from the model panel — a ru/es host
|
|
1602
|
+
* then reads its own language instead of the old inline zh/en pair.
|
|
1122
1603
|
*/
|
|
1123
|
-
const COPY = {
|
|
1124
|
-
zh: {
|
|
1125
|
-
title: "上下文检查",
|
|
1126
|
-
used: "已用",
|
|
1127
|
-
remaining: "剩余",
|
|
1128
|
-
window: "窗口容量",
|
|
1129
|
-
percent: "占用",
|
|
1130
|
-
system: "系统提示词",
|
|
1131
|
-
tools: "工具定义",
|
|
1132
|
-
messages: "对话消息",
|
|
1133
|
-
warning: "上下文即将用尽——建议压缩上下文或开启新会话。",
|
|
1134
|
-
aria: (percent) => `上下文已用 ${percent}`,
|
|
1135
|
-
unset: "本轮尚未产生用量",
|
|
1136
|
-
billing: "缓存账单",
|
|
1137
|
-
billStep: "当前步",
|
|
1138
|
-
billTurn: "当前轮",
|
|
1139
|
-
billSession: "会话累计",
|
|
1140
|
-
billCacheRead: "缓存命中",
|
|
1141
|
-
billCacheMiss: "缓存未命中",
|
|
1142
|
-
billOutput: "输出",
|
|
1143
|
-
billFullMiss: "完全失效",
|
|
1144
|
-
billRoundsWord: "步",
|
|
1145
|
-
billPeak: "峰价",
|
|
1146
|
-
billOffPeak: "谷价",
|
|
1147
|
-
billFlat: "平价",
|
|
1148
|
-
billUnpriced: "未计价",
|
|
1149
|
-
billCustom: "自填价计价",
|
|
1150
|
-
billPricedAs: (label) => `按 ${label} 计价`,
|
|
1151
|
-
billPriced: "按目录价计价",
|
|
1152
|
-
billEstimate: "目录外估算价",
|
|
1153
|
-
billUncalibratedHint: "未校准·仅供参考"
|
|
1154
|
-
},
|
|
1155
|
-
en: {
|
|
1156
|
-
title: "Context check",
|
|
1157
|
-
used: "Used",
|
|
1158
|
-
remaining: "Remaining",
|
|
1159
|
-
window: "Context window",
|
|
1160
|
-
percent: "Pressure",
|
|
1161
|
-
system: "System prompt",
|
|
1162
|
-
tools: "Tool definitions",
|
|
1163
|
-
messages: "Messages",
|
|
1164
|
-
warning: "Context is nearly full — compact the context or start a new session.",
|
|
1165
|
-
aria: (percent) => `${percent} of context used`,
|
|
1166
|
-
unset: "No usage yet in this turn",
|
|
1167
|
-
billing: "Cache billing",
|
|
1168
|
-
billStep: "This step",
|
|
1169
|
-
billTurn: "This turn",
|
|
1170
|
-
billSession: "Session total",
|
|
1171
|
-
billCacheRead: "Cache read",
|
|
1172
|
-
billCacheMiss: "Cache miss",
|
|
1173
|
-
billOutput: "Output",
|
|
1174
|
-
billFullMiss: "Full misses",
|
|
1175
|
-
billRoundsWord: "steps",
|
|
1176
|
-
billPeak: "Peak rates",
|
|
1177
|
-
billOffPeak: "Off-peak rates",
|
|
1178
|
-
billFlat: "Flat rate",
|
|
1179
|
-
billUnpriced: "Not billed",
|
|
1180
|
-
billCustom: "priced at custom rates",
|
|
1181
|
-
billPricedAs: (label) => `priced as ${label}`,
|
|
1182
|
-
billPriced: "priced at catalog rates",
|
|
1183
|
-
billEstimate: "estimated off-catalog",
|
|
1184
|
-
billUncalibratedHint: "uncalibrated — reference only"
|
|
1185
|
-
}
|
|
1186
|
-
};
|
|
1187
|
-
const copy = () => typeof document !== "undefined" && document.documentElement.lang?.toLowerCase().startsWith("zh") ? COPY.zh : COPY.en;
|
|
1188
1604
|
const RING_SIZE = 18;
|
|
1189
1605
|
const RING_STROKE = 2.5;
|
|
1190
1606
|
const triggerStyle$1 = {
|
|
@@ -1218,7 +1634,7 @@ window.__ModuleLoader__.load({
|
|
|
1218
1634
|
fontSize: "12px",
|
|
1219
1635
|
lineHeight: "18px"
|
|
1220
1636
|
};
|
|
1221
|
-
const headStyle = {
|
|
1637
|
+
const headStyle$1 = {
|
|
1222
1638
|
display: "flex",
|
|
1223
1639
|
alignItems: "baseline",
|
|
1224
1640
|
gap: "8px",
|
|
@@ -1416,19 +1832,23 @@ window.__ModuleLoader__.load({
|
|
|
1416
1832
|
* 读数、金额位换「未计价」文案;旧 view 缺 priced 字段 → 按历史行为计价。
|
|
1417
1833
|
* 混币种会话不给跨币种合计,改按币种分行。
|
|
1418
1834
|
*/
|
|
1419
|
-
function BillingBlock({ billing }) {
|
|
1420
|
-
|
|
1835
|
+
function BillingBlock({ billing, t }) {
|
|
1836
|
+
/** `ring.*` 读取(字典里只有一个 `%n` 占位符,有值就填)。 */
|
|
1837
|
+
const c = (key, value) => {
|
|
1838
|
+
const text = t(key);
|
|
1839
|
+
return value === void 0 ? text : text.replace("%n", value);
|
|
1840
|
+
};
|
|
1421
1841
|
const cur = billing.currency;
|
|
1422
1842
|
const priced = billing.priced !== false;
|
|
1423
1843
|
const money = (amount, digits) => priced ? formatMoney(amount ?? 0, digits, cur) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1424
1844
|
style: { color: "var(--dsw-alias-label-caption, inherit)" },
|
|
1425
|
-
children: c.
|
|
1845
|
+
children: c("ring.bill.unpriced")
|
|
1426
1846
|
});
|
|
1427
1847
|
const dash = priced ? void 0 : "—";
|
|
1428
1848
|
const buckets = Array.isArray(billing.sessionByCurrency) ? billing.sessionByCurrency : [];
|
|
1429
1849
|
const sessionTotal = !priced ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1430
1850
|
style: { color: "var(--dsw-alias-label-caption, inherit)" },
|
|
1431
|
-
children: c.
|
|
1851
|
+
children: c("ring.bill.unpriced")
|
|
1432
1852
|
}) : billing.mixedCurrency === true && buckets.length > 1 ? buckets.map((b) => `${currencySymbol(b.currency)}${(b.hitCost + b.missCost + b.outputCost).toFixed(2)}`).join(" + ") : formatMoney((billing.sessionCacheHitCost ?? 0) + (billing.sessionMissCost ?? 0) + (billing.sessionOutputCost ?? 0), 2, cur);
|
|
1433
1853
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
1434
1854
|
style: {
|
|
@@ -1444,7 +1864,7 @@ window.__ModuleLoader__.load({
|
|
|
1444
1864
|
...rowLabelStyle,
|
|
1445
1865
|
color: "#a78bfa"
|
|
1446
1866
|
},
|
|
1447
|
-
children: c.
|
|
1867
|
+
children: c("ring.bill.step")
|
|
1448
1868
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1449
1869
|
style: {
|
|
1450
1870
|
...rowValueStyle,
|
|
@@ -1458,19 +1878,19 @@ window.__ModuleLoader__.load({
|
|
|
1458
1878
|
})]
|
|
1459
1879
|
}),
|
|
1460
1880
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1461
|
-
label: c.
|
|
1881
|
+
label: c("ring.bill.cacheRead"),
|
|
1462
1882
|
tokens: billing.cacheReadTokens ?? 0,
|
|
1463
1883
|
amount: dash ?? formatMoney(billing.cost ?? 0, 4, cur),
|
|
1464
1884
|
color: BILL_COLORS.hit
|
|
1465
1885
|
}),
|
|
1466
1886
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1467
|
-
label: c.
|
|
1887
|
+
label: c("ring.bill.cacheMiss"),
|
|
1468
1888
|
tokens: (billing.totalInputTokens ?? 0) - (billing.cacheReadTokens ?? 0),
|
|
1469
1889
|
amount: dash ?? formatMoney(billing.missCost ?? 0, 4, cur),
|
|
1470
1890
|
color: BILL_COLORS.miss
|
|
1471
1891
|
}),
|
|
1472
1892
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1473
|
-
label: c.
|
|
1893
|
+
label: c("ring.bill.output"),
|
|
1474
1894
|
tokens: billing.outputTokens ?? 0,
|
|
1475
1895
|
amount: dash ?? formatMoney(billing.outputCost ?? 0, 4, cur),
|
|
1476
1896
|
color: BILL_COLORS.output
|
|
@@ -1482,7 +1902,7 @@ window.__ModuleLoader__.load({
|
|
|
1482
1902
|
...rowLabelStyle,
|
|
1483
1903
|
color: "#22d3ee"
|
|
1484
1904
|
},
|
|
1485
|
-
children: c.
|
|
1905
|
+
children: c("ring.bill.turn")
|
|
1486
1906
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1487
1907
|
style: {
|
|
1488
1908
|
...rowValueStyle,
|
|
@@ -1496,19 +1916,19 @@ window.__ModuleLoader__.load({
|
|
|
1496
1916
|
})]
|
|
1497
1917
|
}),
|
|
1498
1918
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1499
|
-
label: c.
|
|
1919
|
+
label: c("ring.bill.cacheRead"),
|
|
1500
1920
|
tokens: billing.turnCacheReadTokens ?? 0,
|
|
1501
1921
|
amount: dash ?? formatMoney(billing.turnHitCost ?? 0, 3, cur),
|
|
1502
1922
|
color: BILL_COLORS.hit
|
|
1503
1923
|
}),
|
|
1504
1924
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1505
|
-
label: c.
|
|
1925
|
+
label: c("ring.bill.cacheMiss"),
|
|
1506
1926
|
tokens: (billing.turnInputTokens ?? 0) - (billing.turnCacheReadTokens ?? 0),
|
|
1507
1927
|
amount: dash ?? formatMoney(billing.turnMissCost ?? 0, 3, cur),
|
|
1508
1928
|
color: BILL_COLORS.miss
|
|
1509
1929
|
}),
|
|
1510
1930
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1511
|
-
label: c.
|
|
1931
|
+
label: c("ring.bill.output"),
|
|
1512
1932
|
tokens: billing.turnOutputTokens ?? 0,
|
|
1513
1933
|
amount: dash ?? formatMoney(billing.turnOutputCost ?? 0, 3, cur),
|
|
1514
1934
|
color: BILL_COLORS.output
|
|
@@ -1520,7 +1940,7 @@ window.__ModuleLoader__.load({
|
|
|
1520
1940
|
...rowLabelStyle,
|
|
1521
1941
|
color: "#f472b6"
|
|
1522
1942
|
},
|
|
1523
|
-
children: [c.
|
|
1943
|
+
children: [c("ring.bill.session"), billing.sessionRounds ? ` · ${billing.sessionRounds} ${c("ring.bill.rounds")}` : ""]
|
|
1524
1944
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1525
1945
|
style: {
|
|
1526
1946
|
...rowValueStyle,
|
|
@@ -1534,19 +1954,19 @@ window.__ModuleLoader__.load({
|
|
|
1534
1954
|
})]
|
|
1535
1955
|
}),
|
|
1536
1956
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1537
|
-
label: c.
|
|
1957
|
+
label: c("ring.bill.cacheRead"),
|
|
1538
1958
|
tokens: billing.sessionCacheReadTokens ?? 0,
|
|
1539
1959
|
amount: dash ?? formatMoney(billing.sessionCacheHitCost ?? 0, 2, cur),
|
|
1540
1960
|
color: BILL_COLORS.hit
|
|
1541
1961
|
}),
|
|
1542
1962
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1543
|
-
label: c.
|
|
1963
|
+
label: c("ring.bill.cacheMiss"),
|
|
1544
1964
|
tokens: (billing.sessionInputTokens ?? 0) - (billing.sessionCacheReadTokens ?? 0),
|
|
1545
1965
|
amount: dash ?? formatMoney(billing.sessionMissCost ?? 0, 2, cur),
|
|
1546
1966
|
color: BILL_COLORS.miss
|
|
1547
1967
|
}),
|
|
1548
1968
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1549
|
-
label: c.
|
|
1969
|
+
label: c("ring.bill.output"),
|
|
1550
1970
|
tokens: billing.sessionOutputTokens ?? 0,
|
|
1551
1971
|
amount: dash ?? formatMoney(billing.sessionOutputCost ?? 0, 2, cur),
|
|
1552
1972
|
color: BILL_COLORS.output
|
|
@@ -1558,7 +1978,7 @@ window.__ModuleLoader__.load({
|
|
|
1558
1978
|
...rowLabelStyle,
|
|
1559
1979
|
color: "#f43f5e"
|
|
1560
1980
|
},
|
|
1561
|
-
children: c.
|
|
1981
|
+
children: c("ring.bill.fullMiss")
|
|
1562
1982
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1563
1983
|
style: {
|
|
1564
1984
|
...rowValueStyle,
|
|
@@ -1585,23 +2005,29 @@ window.__ModuleLoader__.load({
|
|
|
1585
2005
|
const used = typeof pressure?.projectedTokens === "number" ? pressure.projectedTokens : typeof pressure?.pressureTokens === "number" ? pressure.pressureTokens : void 0;
|
|
1586
2006
|
const window_ = typeof pressure?.contextWindow === "number" && pressure.contextWindow > 0 ? pressure.contextWindow : typeof props.contextWindowFallback === "number" && props.contextWindowFallback > 0 ? props.contextWindowFallback : void 0;
|
|
1587
2007
|
const hasReading = used !== void 0 && window_ !== void 0 && window_ > 0;
|
|
1588
|
-
|
|
2008
|
+
/** Dictionary thunk: the model panel passes `locale.bind(NS)`; without it keys render. */
|
|
2009
|
+
const t = props.t ?? ((key) => key);
|
|
2010
|
+
/** `ring.*` 读取(字典里只有一个 `%n` 占位符,有值就填)。 */
|
|
2011
|
+
const c = (key, value) => {
|
|
2012
|
+
const text = t(key);
|
|
2013
|
+
return value === void 0 ? text : text.replace("%n", value);
|
|
2014
|
+
};
|
|
1589
2015
|
const percent = hasReading ? Math.min(100, Math.round(used / window_ * 100)) : 0;
|
|
1590
2016
|
const color = pressureColor(percent);
|
|
1591
2017
|
const remaining = hasReading ? Math.max(0, window_ - used) : 0;
|
|
1592
2018
|
const rows = !hasReading || breakdown === void 0 ? [] : [
|
|
1593
2019
|
{
|
|
1594
|
-
label: c.system,
|
|
2020
|
+
label: c("ring.system"),
|
|
1595
2021
|
value: breakdown.systemTokens,
|
|
1596
2022
|
color: BREAKDOWN_COLORS.system
|
|
1597
2023
|
},
|
|
1598
2024
|
{
|
|
1599
|
-
label: c.tools,
|
|
2025
|
+
label: c("ring.tools"),
|
|
1600
2026
|
value: breakdown.toolsTokens,
|
|
1601
2027
|
color: BREAKDOWN_COLORS.tools
|
|
1602
2028
|
},
|
|
1603
2029
|
{
|
|
1604
|
-
label: c.messages,
|
|
2030
|
+
label: c("ring.messages"),
|
|
1605
2031
|
value: breakdown.messageTokens,
|
|
1606
2032
|
color: BREAKDOWN_COLORS.messages
|
|
1607
2033
|
}
|
|
@@ -1619,7 +2045,7 @@ window.__ModuleLoader__.load({
|
|
|
1619
2045
|
...triggerStyle$1,
|
|
1620
2046
|
opacity: .55
|
|
1621
2047
|
},
|
|
1622
|
-
"aria-label": hasReading ? c.aria
|
|
2048
|
+
"aria-label": hasReading ? c("ring.aria", `${percent}%`) : c("ring.unset"),
|
|
1623
2049
|
"aria-haspopup": hasReading ? "dialog" : void 0,
|
|
1624
2050
|
"aria-expanded": open,
|
|
1625
2051
|
onClick: () => {
|
|
@@ -1638,11 +2064,11 @@ window.__ModuleLoader__.load({
|
|
|
1638
2064
|
}), open && hasReading && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1639
2065
|
style: popStyle$1,
|
|
1640
2066
|
role: "dialog",
|
|
1641
|
-
"aria-label": c.title,
|
|
2067
|
+
"aria-label": c("ring.title"),
|
|
1642
2068
|
children: [
|
|
1643
2069
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1644
|
-
style: headStyle,
|
|
1645
|
-
children: [c.title, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2070
|
+
style: headStyle$1,
|
|
2071
|
+
children: [c("ring.title"), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1646
2072
|
style: {
|
|
1647
2073
|
...rowValueStyle,
|
|
1648
2074
|
...figureStyle
|
|
@@ -1659,7 +2085,7 @@ window.__ModuleLoader__.load({
|
|
|
1659
2085
|
style: rowStyle$2,
|
|
1660
2086
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1661
2087
|
style: rowLabelStyle,
|
|
1662
|
-
children: c.percent
|
|
2088
|
+
children: c("ring.percent")
|
|
1663
2089
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1664
2090
|
style: {
|
|
1665
2091
|
...rowValueStyle,
|
|
@@ -1673,7 +2099,7 @@ window.__ModuleLoader__.load({
|
|
|
1673
2099
|
style: rowStyle$2,
|
|
1674
2100
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1675
2101
|
style: rowLabelStyle,
|
|
1676
|
-
children: c.remaining
|
|
2102
|
+
children: c("ring.remaining")
|
|
1677
2103
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1678
2104
|
style: {
|
|
1679
2105
|
...rowValueStyle,
|
|
@@ -1694,18 +2120,21 @@ window.__ModuleLoader__.load({
|
|
|
1694
2120
|
color: row.color
|
|
1695
2121
|
}, row.label))
|
|
1696
2122
|
}),
|
|
1697
|
-
billing?.available === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillingBlock, {
|
|
2123
|
+
billing?.available === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillingBlock, {
|
|
2124
|
+
billing,
|
|
2125
|
+
t
|
|
2126
|
+
}),
|
|
1698
2127
|
percent >= 85 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1699
2128
|
style: warnStyle,
|
|
1700
|
-
children: c.warning
|
|
2129
|
+
children: c("ring.warning")
|
|
1701
2130
|
}),
|
|
1702
2131
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1703
2132
|
style: footStyle,
|
|
1704
2133
|
children: [
|
|
1705
|
-
c.window,
|
|
2134
|
+
c("ring.window"),
|
|
1706
2135
|
": ",
|
|
1707
|
-
hasReading ? window_.toLocaleString() : c.unset,
|
|
1708
|
-
billing?.available === true ? ` · ${billing.tier === "peak" ? c.
|
|
2136
|
+
hasReading ? window_.toLocaleString() : c("ring.unset"),
|
|
2137
|
+
billing?.available === true ? ` · ${billing.tier === "peak" ? c("ring.bill.peak") : billing.tier === "offPeak" ? c("ring.bill.offPeak") : billing.tier === "flat" ? c("ring.bill.flat") : c("ring.bill.unpriced")} · ${billing.priced === false ? c("ring.bill.unpriced") : billing.estimated === true ? c("ring.bill.uncalibrated") : typeof billing.catalogLabel === "string" ? c("ring.bill.pricedAs", billing.catalogLabel) : billing.pricingSource === "custom" ? c("ring.bill.custom") : billing.modelMatched === false ? c("ring.bill.estimate") : c("ring.bill.priced")}` : ""
|
|
1709
2138
|
]
|
|
1710
2139
|
})
|
|
1711
2140
|
]
|
|
@@ -3069,7 +3498,10 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3069
3498
|
})
|
|
3070
3499
|
]
|
|
3071
3500
|
}),
|
|
3072
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextRing, {
|
|
3501
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextRing, {
|
|
3502
|
+
contextWindowFallback: activeWindow,
|
|
3503
|
+
t
|
|
3504
|
+
}),
|
|
3073
3505
|
open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3074
3506
|
style: backdropStyle,
|
|
3075
3507
|
onClick: close
|
|
@@ -3339,6 +3771,59 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3339
3771
|
});
|
|
3340
3772
|
}
|
|
3341
3773
|
//#endregion
|
|
3774
|
+
//#region src/client/projection-value.ts
|
|
3775
|
+
/**
|
|
3776
|
+
* One helper shared by every client read of a HOST projection face.
|
|
3777
|
+
*
|
|
3778
|
+
* The host's `ProjectionValueStore` face is built as
|
|
3779
|
+
* `{ getSnapshot: () => rows.get(key)?.value, subscribe }` — i.e. `getSnapshot()`
|
|
3780
|
+
* returns the projection STATE ITSELF, bare:
|
|
3781
|
+
*
|
|
3782
|
+
* ```ts
|
|
3783
|
+
* binding.session.projections.faceOf('tlAutoSchedule').getSnapshot()
|
|
3784
|
+
* // => { samples, userEffort, lastEffective, trace }
|
|
3785
|
+
* ```
|
|
3786
|
+
*
|
|
3787
|
+
* (`packages/api/session-controller/src/client/sessions/projection-store.ts`,
|
|
3788
|
+
* `channel()`; every in-tree consumer casts the snapshot straight to its
|
|
3789
|
+
* projection type — `faceOf('permissions').getSnapshot() as PermissionSelection`,
|
|
3790
|
+
* `faceOf('goal').getSnapshot() as GoalProjection | null | undefined`, ….)
|
|
3791
|
+
*
|
|
3792
|
+
* The `{ status, value }` wrapper belongs to a DIFFERENT API — the settings
|
|
3793
|
+
* handles (`configForms` / `settingsScope`), which is why `card.tsx` /
|
|
3794
|
+
* `model-panel.tsx` unwrap `.value` there. Reading a projection face with that
|
|
3795
|
+
* assumption yields `undefined` on every real host: the effort tab then renders
|
|
3796
|
+
* its empty state ("本会话还没有已提交的请求档位。") while the projection holds a
|
|
3797
|
+
* perfectly good trace, and the chip loses `lastEffective` (the issue #11
|
|
3798
|
+
* symptom coming back). Verified live on 4.6.0 against a session whose
|
|
3799
|
+
* `tlAutoSchedule` row had `[{high,manual,1},{low,manual,1}]`.
|
|
3800
|
+
*
|
|
3801
|
+
* Both shapes are still accepted, because a patched/older host wrapper or a
|
|
3802
|
+
* test double must not turn a cosmetic read into a dead one. The bare state is
|
|
3803
|
+
* recognized POSITIVELY — our projection always carries at least one of the
|
|
3804
|
+
* four known keys — so a wrapper is never mistaken for state and vice versa.
|
|
3805
|
+
*/
|
|
3806
|
+
/** The projection-state keys `tlAutoSchedule` always carries (any one identifies the bare value). */
|
|
3807
|
+
const STATE_KEYS = [
|
|
3808
|
+
"trace",
|
|
3809
|
+
"lastEffective",
|
|
3810
|
+
"userEffort",
|
|
3811
|
+
"samples"
|
|
3812
|
+
];
|
|
3813
|
+
/**
|
|
3814
|
+
* Unwrap one projection face's `getSnapshot()` result into the state record.
|
|
3815
|
+
*
|
|
3816
|
+
* @param snapshot - the face snapshot, as the host returns it.
|
|
3817
|
+
* @returns the projection state, or undefined for an absent/unrecognizable value.
|
|
3818
|
+
*/
|
|
3819
|
+
function projectionValueOf(snapshot) {
|
|
3820
|
+
if (typeof snapshot !== "object" || snapshot === null) return void 0;
|
|
3821
|
+
const record = snapshot;
|
|
3822
|
+
for (const key of STATE_KEYS) if (key in record) return record;
|
|
3823
|
+
const inner = record["value"];
|
|
3824
|
+
return typeof inner === "object" && inner !== null ? inner : void 0;
|
|
3825
|
+
}
|
|
3826
|
+
//#endregion
|
|
3342
3827
|
//#region src/client/effort-trace.tsx
|
|
3343
3828
|
/**
|
|
3344
3829
|
* Effort-trace tab — the `conversation.view` face of dsh-thinking-levels,
|
|
@@ -3347,19 +3832,28 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3347
3832
|
* typed SlotMap merge lives in `types/contracts.d.ts`).
|
|
3348
3833
|
*
|
|
3349
3834
|
* A run-length timeline of the effort levels this session's requests ACTUALLY
|
|
3350
|
-
* went out with — the `tlAutoSchedule` projection's `trace` (stateVersion
|
|
3835
|
+
* went out with — the `tlAutoSchedule` projection's `trace` (stateVersion 4),
|
|
3351
3836
|
* the same durable fold the composer chip's `lastEffective` reads. Consecutive
|
|
3352
3837
|
* requests with the same level AND intent collapse into one run, so even a
|
|
3353
3838
|
* 95-step session reads as a handful of rows:
|
|
3354
3839
|
*
|
|
3355
|
-
* ↑ auto max ×1
|
|
3356
|
-
* = auto high ×12
|
|
3357
|
-
* ↓ auto low ×3
|
|
3840
|
+
* ↑ auto max ×1 T4·S7 14:03:22
|
|
3841
|
+
* = auto high ×12 T3·S2 13:58:10
|
|
3842
|
+
* ↓ auto low ×3 T1·S1 13:44:31
|
|
3358
3843
|
*
|
|
3359
3844
|
* The ↑/↓/= glyph is the transition against the escalation rank of the
|
|
3360
3845
|
* previous (older) run; the run text shows the intent (`auto`/`manual`,
|
|
3361
3846
|
* neutral when the session never picked and the configured default applied)
|
|
3362
|
-
* plus the repetition count.
|
|
3847
|
+
* plus the repetition count and the turn·step the run STARTED in.
|
|
3848
|
+
*
|
|
3849
|
+
* ## Which "node" a run belongs to
|
|
3850
|
+
*
|
|
3851
|
+
* A run's position stamp is the `turn/start` / `step/start` pair preceding its
|
|
3852
|
+
* first `request/header`. The plugin's decision itself happens EARLIER — at
|
|
3853
|
+
* `agent/pre-step`, before the host appends `step/start` (agent-loop
|
|
3854
|
+
* `agent.ts`: `preStep()` then `session.append('step/start')`) — so the stamp
|
|
3855
|
+
* names the step the level was chosen FOR, which is exactly the node the user
|
|
3856
|
+
* sees in the timeline.
|
|
3363
3857
|
*
|
|
3364
3858
|
* Data source: the session's projection face — NO HTTP feed. The projection is
|
|
3365
3859
|
* a pure fold over the session log, so a cold read rebuilds historical
|
|
@@ -3367,6 +3861,12 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3367
3861
|
* empty trace or a throwing face read renders the empty state — a thrown
|
|
3368
3862
|
* render would abdicate the whole tab, which is never acceptable for a
|
|
3369
3863
|
* cosmetic view.
|
|
3864
|
+
*
|
|
3865
|
+
* Presentation mirrors perm-gate's approval history on purpose (title +
|
|
3866
|
+
* subtitle header, a summary strip, then one card per run with a circled glyph
|
|
3867
|
+
* on a connected rail, a colored intent tag, meta chips and a right-aligned
|
|
3868
|
+
* clock): the two tabs sit next to each other in the same tab row and must not
|
|
3869
|
+
* look like two different products.
|
|
3370
3870
|
*/
|
|
3371
3871
|
/** Transition glyph per direction (mirrors perm-gate's glyph table pattern). */
|
|
3372
3872
|
const GLYPH = {
|
|
@@ -3375,8 +3875,80 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3375
3875
|
flat: "=",
|
|
3376
3876
|
start: "•"
|
|
3377
3877
|
};
|
|
3878
|
+
/**
|
|
3879
|
+
* Rail/glyph color per DIRECTION — a rise is green, a drop is red, flat/start
|
|
3880
|
+
* are muted/blue.
|
|
3881
|
+
*
|
|
3882
|
+
* These are LITERAL colors, not theme tokens, on purpose. A direction is a
|
|
3883
|
+
* fixed semantic (up = more thinking, down = less), so it must read the same on
|
|
3884
|
+
* every theme; the token defaults were also what made it look washed out — the
|
|
3885
|
+
* active theme's `--dsw-alias-state-success-primary` / `-warn-*` resolve to
|
|
3886
|
+
* muted tints meant for large surfaces, not for an 18px ring and a one-glyph
|
|
3887
|
+
* rail. `down` is red rather than amber for the same reason: amber next to a
|
|
3888
|
+
* green up-arrow reads as "caution", while a downgrade is simply the opposite
|
|
3889
|
+
* direction and should be the opposite color.
|
|
3890
|
+
*/
|
|
3891
|
+
const TONE = {
|
|
3892
|
+
up: {
|
|
3893
|
+
color: "#18a058",
|
|
3894
|
+
bg: "rgba(24,160,88,0.12)"
|
|
3895
|
+
},
|
|
3896
|
+
down: {
|
|
3897
|
+
color: "#d03050",
|
|
3898
|
+
bg: "rgba(208,48,80,0.12)"
|
|
3899
|
+
},
|
|
3900
|
+
flat: {
|
|
3901
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.9))",
|
|
3902
|
+
bg: "var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))"
|
|
3903
|
+
},
|
|
3904
|
+
start: {
|
|
3905
|
+
color: "#2b6cb0",
|
|
3906
|
+
bg: "rgba(43,108,176,0.10)"
|
|
3907
|
+
}
|
|
3908
|
+
};
|
|
3909
|
+
/**
|
|
3910
|
+
* Tag tone per ATTRIBUTION — deliberately separate from the direction tone.
|
|
3911
|
+
*
|
|
3912
|
+
* `unknown` is amber, never grey: it is not a verdict about the level, it says
|
|
3913
|
+
* the log does not explain the change, and that deserves attention. Colouring
|
|
3914
|
+
* it like a decision would be the same lie as labelling it "manual".
|
|
3915
|
+
*/
|
|
3916
|
+
const INTENT_TONE = {
|
|
3917
|
+
auto: {
|
|
3918
|
+
color: "#18a058",
|
|
3919
|
+
bg: "rgba(24,160,88,0.12)"
|
|
3920
|
+
},
|
|
3921
|
+
manual: {
|
|
3922
|
+
color: "#2b6cb0",
|
|
3923
|
+
bg: "rgba(43,108,176,0.10)"
|
|
3924
|
+
},
|
|
3925
|
+
default: {
|
|
3926
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.9))",
|
|
3927
|
+
bg: "var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))"
|
|
3928
|
+
},
|
|
3929
|
+
unknown: {
|
|
3930
|
+
color: "#d48806",
|
|
3931
|
+
bg: "rgba(212,136,6,0.14)"
|
|
3932
|
+
},
|
|
3933
|
+
scheduler: {
|
|
3934
|
+
color: "#0e9f6e",
|
|
3935
|
+
bg: "rgba(14,159,110,0.16)"
|
|
3936
|
+
}
|
|
3937
|
+
};
|
|
3378
3938
|
/** Unknown ids rank after the standard table (same tail semantics as the slider). */
|
|
3379
3939
|
const rankOf = (level) => EFFORT_SLIDER_RANK[level] ?? 100;
|
|
3940
|
+
/** `HH:MM:SS` in the viewer's zone; empty for an absent stamp. */
|
|
3941
|
+
function clockOf(ms) {
|
|
3942
|
+
if (typeof ms !== "number" || !Number.isFinite(ms)) return "";
|
|
3943
|
+
const d = new Date(ms);
|
|
3944
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
3945
|
+
return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
3946
|
+
}
|
|
3947
|
+
/** `T{turn}·S{step}` for a stamped run, empty when the run carries no position. */
|
|
3948
|
+
function positionOf(run) {
|
|
3949
|
+
if (typeof run.turn !== "number") return "";
|
|
3950
|
+
return typeof run.step === "number" ? `T${run.turn}·S${run.step}` : `T${run.turn}`;
|
|
3951
|
+
}
|
|
3380
3952
|
/**
|
|
3381
3953
|
* Build the display rows: newest run first, each carrying the transition
|
|
3382
3954
|
* against its chronological predecessor. Pure — the component is a straight
|
|
@@ -3407,27 +3979,88 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3407
3979
|
return rows;
|
|
3408
3980
|
}
|
|
3409
3981
|
/**
|
|
3410
|
-
*
|
|
3411
|
-
*
|
|
3412
|
-
*
|
|
3413
|
-
*
|
|
3982
|
+
* Summarize a trace for the header strip. Pure.
|
|
3983
|
+
* @param trace - the folded trace, oldest run first.
|
|
3984
|
+
* @param modelSwitches - route switches folded by the projection (0 when absent).
|
|
3985
|
+
* @returns the summary; zeroed for an absent trace.
|
|
3986
|
+
*/
|
|
3987
|
+
function summarize(trace, modelSwitches = 0) {
|
|
3988
|
+
if (trace === void 0 || trace.length === 0) return {
|
|
3989
|
+
requests: 0,
|
|
3990
|
+
runs: 0,
|
|
3991
|
+
highest: void 0,
|
|
3992
|
+
autoRuns: 0,
|
|
3993
|
+
unknownRuns: 0,
|
|
3994
|
+
switches: modelSwitches
|
|
3995
|
+
};
|
|
3996
|
+
let requests = 0;
|
|
3997
|
+
let highest;
|
|
3998
|
+
let autoRuns = 0;
|
|
3999
|
+
let unknownRuns = 0;
|
|
4000
|
+
for (const run of trace) {
|
|
4001
|
+
requests += run.count;
|
|
4002
|
+
if (run.intent === "auto") autoRuns += 1;
|
|
4003
|
+
if (run.intent === "unknown") unknownRuns += 1;
|
|
4004
|
+
if (highest === void 0 || rankOf(run.level) > rankOf(highest)) highest = run.level;
|
|
4005
|
+
}
|
|
4006
|
+
return {
|
|
4007
|
+
requests,
|
|
4008
|
+
runs: trace.length,
|
|
4009
|
+
highest,
|
|
4010
|
+
autoRuns,
|
|
4011
|
+
unknownRuns,
|
|
4012
|
+
switches: modelSwitches
|
|
4013
|
+
};
|
|
4014
|
+
}
|
|
4015
|
+
/**
|
|
4016
|
+
* Read the whole slice off the projection face. `undefined` — never a throw —
|
|
4017
|
+
* when the face or its trace is absent; a trace with no route bookkeeping still
|
|
4018
|
+
* renders (the older cached row simply has no switch count).
|
|
4019
|
+
*
|
|
4020
|
+
* ## Reference stability is mandatory here
|
|
4021
|
+
*
|
|
4022
|
+
* `useSyncExternalStore` requires `getSnapshot()` to return the SAME reference
|
|
4023
|
+
* until the underlying value changes. The projection face hands out the bare
|
|
4024
|
+
* state object and only swaps it on a real publish, so the slice is memoized on
|
|
4025
|
+
* that state identity: building a fresh `{ trace, … }` per call would make every
|
|
4026
|
+
* render look like a change and spin React into an infinite re-render.
|
|
3414
4027
|
* @param sessions - the sessions face.
|
|
3415
4028
|
* @param sessionId - the owning session.
|
|
3416
|
-
* @returns the
|
|
4029
|
+
* @returns the slice, or undefined when there is nothing to render.
|
|
3417
4030
|
*/
|
|
3418
|
-
function
|
|
4031
|
+
function traceSliceOf(sessions, sessionId) {
|
|
3419
4032
|
try {
|
|
3420
4033
|
if (typeof sessionId !== "string" || sessionId.length === 0) return void 0;
|
|
3421
4034
|
const face = sessions?.binding(sessionId)?.session?.projections?.faceOf?.("tlAutoSchedule");
|
|
3422
|
-
const
|
|
3423
|
-
|
|
3424
|
-
const raw =
|
|
3425
|
-
|
|
4035
|
+
const state = projectionValueOf(typeof face?.getSnapshot === "function" ? face.getSnapshot() : void 0);
|
|
4036
|
+
if (state === void 0) return void 0;
|
|
4037
|
+
const raw = state["trace"];
|
|
4038
|
+
if (!Array.isArray(raw)) return void 0;
|
|
4039
|
+
const cached = sliceCache.get(state);
|
|
4040
|
+
if (cached !== void 0) return cached;
|
|
4041
|
+
const provider = state["lastProvider"];
|
|
4042
|
+
const model = state["lastModel"];
|
|
4043
|
+
const switches = state["modelSwitches"];
|
|
4044
|
+
const slice = {
|
|
4045
|
+
trace: raw,
|
|
4046
|
+
lastProvider: typeof provider === "string" && provider.length > 0 ? provider : null,
|
|
4047
|
+
lastModel: typeof model === "string" && model.length > 0 ? model : null,
|
|
4048
|
+
modelSwitches: typeof switches === "number" && Number.isFinite(switches) ? switches : 0
|
|
4049
|
+
};
|
|
4050
|
+
sliceCache.set(state, slice);
|
|
4051
|
+
return slice;
|
|
3426
4052
|
} catch {
|
|
3427
4053
|
return;
|
|
3428
4054
|
}
|
|
3429
4055
|
}
|
|
3430
4056
|
/**
|
|
4057
|
+
* Memo for {@link traceSliceOf}: one slice per projection state identity. The
|
|
4058
|
+
* face is shared by every reader of this key (the chip and the tab), so the
|
|
4059
|
+
* memo lives at module level; entries die with the state objects themselves, so
|
|
4060
|
+
* it cannot grow without bound.
|
|
4061
|
+
*/
|
|
4062
|
+
const sliceCache = /* @__PURE__ */ new WeakMap();
|
|
4063
|
+
/**
|
|
3431
4064
|
* Subscribe to the trace over the projection face's store when it offers one;
|
|
3432
4065
|
* a one-shot read otherwise (the conversation re-renders around every request
|
|
3433
4066
|
* anyway, so the one-shot cadence still tracks). `useSyncExternalStore` needs
|
|
@@ -3444,7 +4077,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3444
4077
|
return;
|
|
3445
4078
|
}
|
|
3446
4079
|
}, [sessions, id]);
|
|
3447
|
-
const getSnapshot = (0, react.useMemo)(() => () =>
|
|
4080
|
+
const getSnapshot = (0, react.useMemo)(() => () => traceSliceOf(sessions, id), [sessions, id]);
|
|
3448
4081
|
const subscribe = (0, react.useMemo)(() => (listener) => {
|
|
3449
4082
|
try {
|
|
3450
4083
|
return typeof face?.subscribe === "function" ? face.subscribe(listener) : () => {};
|
|
@@ -3454,67 +4087,717 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3454
4087
|
}, [face]);
|
|
3455
4088
|
return (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
3456
4089
|
}
|
|
3457
|
-
const
|
|
4090
|
+
const pageStyle = {
|
|
4091
|
+
boxSizing: "border-box",
|
|
4092
|
+
maxWidth: "720px",
|
|
4093
|
+
margin: "0 auto",
|
|
4094
|
+
padding: "8px 4px",
|
|
3458
4095
|
display: "flex",
|
|
3459
4096
|
flexDirection: "column",
|
|
3460
|
-
gap:
|
|
3461
|
-
|
|
3462
|
-
overflowY: "auto"
|
|
3463
|
-
font: "inherit"
|
|
4097
|
+
gap: "8px",
|
|
4098
|
+
font: "inherit",
|
|
4099
|
+
overflowY: "auto"
|
|
3464
4100
|
};
|
|
3465
|
-
const
|
|
4101
|
+
const titleStyle = {
|
|
4102
|
+
fontSize: "14px",
|
|
4103
|
+
fontWeight: 600,
|
|
4104
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4105
|
+
};
|
|
4106
|
+
const subtitleStyle = {
|
|
4107
|
+
marginTop: "2px",
|
|
4108
|
+
fontSize: "12px",
|
|
4109
|
+
lineHeight: "18px",
|
|
4110
|
+
color: "var(--dsw-alias-label-secondary, var(--dsw-alias-label-primary))"
|
|
4111
|
+
};
|
|
4112
|
+
/** The summary strip: the same rounded bar perm-gate's snapshot inventory uses. */
|
|
4113
|
+
const barStyle = {
|
|
3466
4114
|
display: "flex",
|
|
4115
|
+
alignItems: "center",
|
|
4116
|
+
gap: "10px",
|
|
4117
|
+
flexWrap: "wrap",
|
|
4118
|
+
padding: "6px 10px",
|
|
4119
|
+
borderRadius: "8px",
|
|
4120
|
+
background: "var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))",
|
|
4121
|
+
fontSize: "12px",
|
|
4122
|
+
lineHeight: "18px",
|
|
4123
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
4124
|
+
};
|
|
4125
|
+
const barStatStyle = {
|
|
4126
|
+
display: "inline-flex",
|
|
3467
4127
|
alignItems: "baseline",
|
|
3468
|
-
gap:
|
|
4128
|
+
gap: "4px"
|
|
4129
|
+
};
|
|
4130
|
+
const barValueStyle = {
|
|
4131
|
+
fontWeight: 600,
|
|
4132
|
+
color: "var(--dsw-alias-label-primary)",
|
|
4133
|
+
fontVariantNumeric: "tabular-nums"
|
|
4134
|
+
};
|
|
4135
|
+
const barSepStyle = {
|
|
4136
|
+
width: "1px",
|
|
4137
|
+
height: "10px",
|
|
4138
|
+
background: "var(--dsw-alias-border-l2, rgba(127,127,127,0.3))"
|
|
4139
|
+
};
|
|
4140
|
+
const rowStyle$1 = {
|
|
4141
|
+
display: "flex",
|
|
4142
|
+
gap: "10px",
|
|
4143
|
+
padding: "6px 10px",
|
|
4144
|
+
borderRadius: "8px",
|
|
4145
|
+
background: "var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))"
|
|
4146
|
+
};
|
|
4147
|
+
const railStyle = {
|
|
4148
|
+
display: "flex",
|
|
4149
|
+
flexDirection: "column",
|
|
4150
|
+
alignItems: "center",
|
|
4151
|
+
flex: "0 0 auto",
|
|
4152
|
+
width: "20px"
|
|
4153
|
+
};
|
|
4154
|
+
const markStyle = {
|
|
4155
|
+
width: "18px",
|
|
4156
|
+
height: "18px",
|
|
4157
|
+
marginTop: "3px",
|
|
4158
|
+
display: "flex",
|
|
4159
|
+
alignItems: "center",
|
|
4160
|
+
justifyContent: "center",
|
|
4161
|
+
fontSize: "12px",
|
|
4162
|
+
lineHeight: "18px",
|
|
4163
|
+
fontWeight: 700,
|
|
4164
|
+
borderRadius: "999px",
|
|
4165
|
+
borderStyle: "solid",
|
|
4166
|
+
borderWidth: "1.5px",
|
|
4167
|
+
fontFamily: "var(--ds-font-family-code, monospace)"
|
|
3469
4168
|
};
|
|
3470
|
-
const
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
color: "var(--dsw-alias-text-secondary, rgba(127,127,127,0.9))"
|
|
4169
|
+
const railLineStyle = {
|
|
4170
|
+
flex: "1 1 auto",
|
|
4171
|
+
width: "1px",
|
|
4172
|
+
minHeight: "10px",
|
|
4173
|
+
background: "var(--dsw-alias-border-l2, rgba(127,127,127,0.3))"
|
|
3476
4174
|
};
|
|
3477
|
-
const
|
|
3478
|
-
|
|
4175
|
+
const bodyStyle = {
|
|
4176
|
+
flex: "1 1 auto",
|
|
4177
|
+
minWidth: 0,
|
|
4178
|
+
paddingBottom: "10px"
|
|
4179
|
+
};
|
|
4180
|
+
const headStyle = {
|
|
4181
|
+
display: "flex",
|
|
4182
|
+
alignItems: "center",
|
|
4183
|
+
gap: "8px",
|
|
4184
|
+
flexWrap: "wrap"
|
|
4185
|
+
};
|
|
4186
|
+
const levelStyle = {
|
|
4187
|
+
font: "600 12px/18px var(--ds-font-family-code, monospace)",
|
|
4188
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4189
|
+
};
|
|
4190
|
+
const tagStyle = {
|
|
4191
|
+
fontSize: "11px",
|
|
4192
|
+
lineHeight: "18px",
|
|
4193
|
+
padding: "0 8px",
|
|
4194
|
+
borderRadius: "9px",
|
|
4195
|
+
fontWeight: 600
|
|
4196
|
+
};
|
|
4197
|
+
const metaStyle = {
|
|
4198
|
+
fontSize: "11px",
|
|
4199
|
+
lineHeight: "18px",
|
|
4200
|
+
padding: "0 6px",
|
|
4201
|
+
borderRadius: "9px",
|
|
4202
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
4203
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.3))",
|
|
3479
4204
|
fontVariantNumeric: "tabular-nums"
|
|
3480
4205
|
};
|
|
3481
|
-
const
|
|
3482
|
-
|
|
4206
|
+
const clockStyle = {
|
|
4207
|
+
marginLeft: "auto",
|
|
4208
|
+
flex: "0 0 auto",
|
|
4209
|
+
fontSize: "11px",
|
|
4210
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
4211
|
+
fontVariantNumeric: "tabular-nums"
|
|
4212
|
+
};
|
|
4213
|
+
const noteStyle = {
|
|
4214
|
+
marginTop: "2px",
|
|
4215
|
+
fontSize: "12px",
|
|
4216
|
+
lineHeight: "18px",
|
|
4217
|
+
color: "var(--dsw-alias-label-secondary, inherit)",
|
|
4218
|
+
overflowWrap: "anywhere"
|
|
4219
|
+
};
|
|
4220
|
+
const emptyStyle = {
|
|
4221
|
+
padding: "16px 0",
|
|
4222
|
+
fontSize: "13px",
|
|
4223
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
4224
|
+
};
|
|
4225
|
+
/** The summary strip above the timeline. */
|
|
4226
|
+
function SummaryBar(props) {
|
|
4227
|
+
const { t, summary } = props;
|
|
4228
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4229
|
+
style: barStyle,
|
|
4230
|
+
children: [
|
|
4231
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4232
|
+
style: barStatStyle,
|
|
4233
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4234
|
+
style: barValueStyle,
|
|
4235
|
+
children: summary.requests
|
|
4236
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.summary.requests") })]
|
|
4237
|
+
}),
|
|
4238
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4239
|
+
"aria-hidden": true,
|
|
4240
|
+
style: barSepStyle
|
|
4241
|
+
}),
|
|
4242
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4243
|
+
style: barStatStyle,
|
|
4244
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4245
|
+
style: barValueStyle,
|
|
4246
|
+
children: summary.runs
|
|
4247
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.summary.runs") })]
|
|
4248
|
+
}),
|
|
4249
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4250
|
+
"aria-hidden": true,
|
|
4251
|
+
style: barSepStyle
|
|
4252
|
+
}),
|
|
4253
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4254
|
+
style: barStatStyle,
|
|
4255
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4256
|
+
style: barValueStyle,
|
|
4257
|
+
children: summary.autoRuns
|
|
4258
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.summary.autoRuns") })]
|
|
4259
|
+
}),
|
|
4260
|
+
summary.unknownRuns === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4261
|
+
"aria-hidden": true,
|
|
4262
|
+
style: barSepStyle
|
|
4263
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4264
|
+
style: {
|
|
4265
|
+
...barStatStyle,
|
|
4266
|
+
color: "#d48806"
|
|
4267
|
+
},
|
|
4268
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4269
|
+
style: barValueStyle,
|
|
4270
|
+
children: summary.unknownRuns
|
|
4271
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.intent.unknown") })]
|
|
4272
|
+
})] }),
|
|
4273
|
+
summary.switches === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4274
|
+
"aria-hidden": true,
|
|
4275
|
+
style: barSepStyle
|
|
4276
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4277
|
+
style: barStatStyle,
|
|
4278
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4279
|
+
style: barValueStyle,
|
|
4280
|
+
children: summary.switches
|
|
4281
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.summary.switches") })]
|
|
4282
|
+
})] }),
|
|
4283
|
+
summary.highest === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4284
|
+
"aria-hidden": true,
|
|
4285
|
+
style: barSepStyle
|
|
4286
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4287
|
+
style: barStatStyle,
|
|
4288
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("trace.summary.peak") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4289
|
+
style: {
|
|
4290
|
+
...barValueStyle,
|
|
4291
|
+
fontFamily: "var(--ds-font-family-code, monospace)"
|
|
4292
|
+
},
|
|
4293
|
+
children: summary.highest
|
|
4294
|
+
})]
|
|
4295
|
+
})] }),
|
|
4296
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4297
|
+
style: { marginLeft: "auto" },
|
|
4298
|
+
children: t("trace.summary.hint")
|
|
4299
|
+
})
|
|
4300
|
+
]
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4303
|
+
/** The tab body: summary strip + timeline rows newest first, or the empty state. */
|
|
3483
4304
|
function EffortTrace(props) {
|
|
3484
4305
|
const t = props.t ?? props.tFallback ?? ((key) => key);
|
|
3485
|
-
const
|
|
4306
|
+
const slice = useTrace(props.sessions, props.sessionId);
|
|
4307
|
+
const trace = slice?.trace ?? [];
|
|
3486
4308
|
const rows = traceRows(trace);
|
|
3487
|
-
if (
|
|
3488
|
-
style:
|
|
3489
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3490
|
-
style:
|
|
4309
|
+
if (slice === void 0 || rows.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4310
|
+
style: pageStyle,
|
|
4311
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4312
|
+
style: titleStyle,
|
|
4313
|
+
children: t("trace.title")
|
|
4314
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4315
|
+
style: subtitleStyle,
|
|
4316
|
+
children: t("trace.subtitle")
|
|
4317
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4318
|
+
style: {
|
|
4319
|
+
...emptyStyle,
|
|
4320
|
+
fontSize: "13px"
|
|
4321
|
+
},
|
|
3491
4322
|
children: t("trace.empty")
|
|
3492
|
-
})
|
|
4323
|
+
})]
|
|
3493
4324
|
});
|
|
3494
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
3495
|
-
style:
|
|
3496
|
-
children:
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
4325
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4326
|
+
style: pageStyle,
|
|
4327
|
+
children: [
|
|
4328
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4329
|
+
style: titleStyle,
|
|
4330
|
+
children: t("trace.title")
|
|
4331
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4332
|
+
style: subtitleStyle,
|
|
4333
|
+
children: t("trace.subtitle")
|
|
4334
|
+
})] }),
|
|
4335
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryBar, {
|
|
4336
|
+
t,
|
|
4337
|
+
summary: summarize(trace, slice.modelSwitches)
|
|
4338
|
+
}),
|
|
4339
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4340
|
+
style: {
|
|
4341
|
+
fontSize: "11px",
|
|
4342
|
+
lineHeight: "16px",
|
|
4343
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
4344
|
+
},
|
|
4345
|
+
children: t("trace.note.attribution")
|
|
4346
|
+
}),
|
|
4347
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4348
|
+
style: {
|
|
4349
|
+
display: "flex",
|
|
4350
|
+
flexDirection: "column",
|
|
4351
|
+
gap: "6px"
|
|
4352
|
+
},
|
|
4353
|
+
children: rows.map((row, i) => {
|
|
4354
|
+
const tone = TONE[row.dir];
|
|
4355
|
+
const intentTone = INTENT_TONE[row.run.intent];
|
|
4356
|
+
const position = positionOf(row.run);
|
|
4357
|
+
const clock = clockOf(row.run.time);
|
|
4358
|
+
const intentLabel = t(`trace.intent.${row.run.intent}`);
|
|
4359
|
+
const route = row.run.model === void 0 ? "" : row.run.provider === void 0 ? row.run.model : `${row.run.provider}/${row.run.model}`;
|
|
4360
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4361
|
+
style: rowStyle$1,
|
|
4362
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4363
|
+
style: railStyle,
|
|
4364
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4365
|
+
"aria-hidden": true,
|
|
4366
|
+
style: {
|
|
4367
|
+
...markStyle,
|
|
4368
|
+
borderColor: tone.color,
|
|
4369
|
+
color: tone.color
|
|
4370
|
+
},
|
|
4371
|
+
children: GLYPH[row.dir]
|
|
4372
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4373
|
+
"aria-hidden": true,
|
|
4374
|
+
style: railLineStyle
|
|
4375
|
+
})]
|
|
4376
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4377
|
+
style: bodyStyle,
|
|
4378
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4379
|
+
style: headStyle,
|
|
4380
|
+
children: [
|
|
4381
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4382
|
+
style: levelStyle,
|
|
4383
|
+
children: row.run.level
|
|
4384
|
+
}),
|
|
4385
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4386
|
+
style: {
|
|
4387
|
+
...tagStyle,
|
|
4388
|
+
color: intentTone.color,
|
|
4389
|
+
background: intentTone.bg
|
|
4390
|
+
},
|
|
4391
|
+
title: row.run.intent === "unknown" ? t("trace.intent.unknownHint") : void 0,
|
|
4392
|
+
children: intentLabel
|
|
4393
|
+
}),
|
|
4394
|
+
row.run.count > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4395
|
+
style: metaStyle,
|
|
4396
|
+
children: `× ${row.run.count}`
|
|
4397
|
+
}) : null,
|
|
4398
|
+
position === "" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4399
|
+
style: metaStyle,
|
|
4400
|
+
children: position
|
|
4401
|
+
}),
|
|
4402
|
+
route === "" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4403
|
+
style: {
|
|
4404
|
+
...metaStyle,
|
|
4405
|
+
fontFamily: "var(--ds-font-family-code, monospace)"
|
|
4406
|
+
},
|
|
4407
|
+
children: route
|
|
4408
|
+
}),
|
|
4409
|
+
clock === "" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4410
|
+
style: clockStyle,
|
|
4411
|
+
children: clock
|
|
4412
|
+
})
|
|
4413
|
+
]
|
|
4414
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4415
|
+
style: noteStyle,
|
|
4416
|
+
children: t(`trace.dir.${row.dir}`).replace("%n", String(row.run.count))
|
|
4417
|
+
})]
|
|
4418
|
+
})]
|
|
4419
|
+
}, `${row.run.level}-${row.run.turn ?? "x"}-${row.run.step ?? "x"}-${trace.length - i}`);
|
|
3512
4420
|
})
|
|
3513
|
-
|
|
3514
|
-
|
|
4421
|
+
})
|
|
4422
|
+
]
|
|
4423
|
+
});
|
|
4424
|
+
}
|
|
4425
|
+
//#endregion
|
|
4426
|
+
//#region src/client/guide.tsx
|
|
4427
|
+
/**
|
|
4428
|
+
* ⚠️ 生成副本 —— 请勿手改。真源:mine-dsh-plugins/_tools/guide-kit/guide.tsx
|
|
4429
|
+
* 重新同步:node _tools/guide-kit/sync.mjs
|
|
4430
|
+
*/
|
|
4431
|
+
/**
|
|
4432
|
+
* guide-kit —— 九插件共用的「首次使用引导」件(**生成副本,勿手改**)。
|
|
4433
|
+
*
|
|
4434
|
+
* 唯一真源:`mine-dsh-plugins/_tools/guide-kit/guide.tsx`
|
|
4435
|
+
* 同步命令:`node _tools/guide-kit/sync.mjs`(会覆盖本文件;改这里等于白改)
|
|
4436
|
+
*
|
|
4437
|
+
* 六条契约(见 .agents/plans/unified-i18n-onboarding/spec.md §2):
|
|
4438
|
+
* 1. Skip 恒定可见,任何步骤都能退;
|
|
4439
|
+
* 2. 永远有字:引导外壳(标题/按钮/步进)自带 10 语词表,按 <html lang> 取词,
|
|
4440
|
+
* 认不出的一律落 en;步骤正文按「本语 → en → zh → 任意可用」逐级回退,绝不留空白;
|
|
4441
|
+
* 3. 重启入口:`GuideRestartButton`(或自己调 `resetGuide(ns)` + setOpen(true))就地重开;
|
|
4442
|
+
* 4. 零依赖:只 react + localStorage,不 import 平台包,不抢宿主设置表单;
|
|
4443
|
+
* 5. 引导自己绝不能成为卡面渲染的失败点:样式注入与存储访问全部 try/catch + 能力探测;
|
|
4444
|
+
* 6. 外壳词表与步骤正文分离:外壳跨插件统一(本文件),正文每插件一份 `guide-steps.ts`。
|
|
4445
|
+
*/
|
|
4446
|
+
/** 生态通用的十个语言码(与各插件 `locale/*.json`、README 的十语镜像同口径)。 */
|
|
4447
|
+
const GUIDE_LOCALES = [
|
|
4448
|
+
"zh",
|
|
4449
|
+
"en",
|
|
4450
|
+
"ja",
|
|
4451
|
+
"ko",
|
|
4452
|
+
"fr",
|
|
4453
|
+
"de",
|
|
4454
|
+
"it",
|
|
4455
|
+
"ru",
|
|
4456
|
+
"es",
|
|
4457
|
+
"pt"
|
|
4458
|
+
];
|
|
4459
|
+
/**
|
|
4460
|
+
* 引导外壳词表(10 语)。
|
|
4461
|
+
*
|
|
4462
|
+
* 为什么不塞进各插件 locales:这七个词是**跨插件同一套**,塞进九个字典要重复翻译
|
|
4463
|
+
* 9×10 次,且一旦措辞调整就得动九个仓。外壳留在本文件,正文留各插件。
|
|
4464
|
+
*/
|
|
4465
|
+
const GUIDE_COPY = {
|
|
4466
|
+
zh: {
|
|
4467
|
+
title: "快速上手",
|
|
4468
|
+
skip: "跳过引导",
|
|
4469
|
+
next: "下一步",
|
|
4470
|
+
prev: "上一步",
|
|
4471
|
+
done: "开始使用",
|
|
4472
|
+
restart: "重新查看引导",
|
|
4473
|
+
stepOf: (current, total) => `第 ${current} / ${total} 步`
|
|
4474
|
+
},
|
|
4475
|
+
en: {
|
|
4476
|
+
title: "Quick start",
|
|
4477
|
+
skip: "Skip guide",
|
|
4478
|
+
next: "Next",
|
|
4479
|
+
prev: "Back",
|
|
4480
|
+
done: "Get started",
|
|
4481
|
+
restart: "Show guide again",
|
|
4482
|
+
stepOf: (current, total) => `Step ${current} of ${total}`
|
|
4483
|
+
},
|
|
4484
|
+
ja: {
|
|
4485
|
+
title: "クイックスタート",
|
|
4486
|
+
skip: "ガイドをスキップ",
|
|
4487
|
+
next: "次へ",
|
|
4488
|
+
prev: "戻る",
|
|
4489
|
+
done: "はじめる",
|
|
4490
|
+
restart: "ガイドをもう一度表示",
|
|
4491
|
+
stepOf: (current, total) => `ステップ ${current} / ${total}`
|
|
4492
|
+
},
|
|
4493
|
+
ko: {
|
|
4494
|
+
title: "빠른 시작",
|
|
4495
|
+
skip: "가이드 건너뛰기",
|
|
4496
|
+
next: "다음",
|
|
4497
|
+
prev: "이전",
|
|
4498
|
+
done: "시작하기",
|
|
4499
|
+
restart: "가이드 다시 보기",
|
|
4500
|
+
stepOf: (current, total) => `${current} / ${total} 단계`
|
|
4501
|
+
},
|
|
4502
|
+
fr: {
|
|
4503
|
+
title: "Démarrage rapide",
|
|
4504
|
+
skip: "Ignorer le guide",
|
|
4505
|
+
next: "Suivant",
|
|
4506
|
+
prev: "Retour",
|
|
4507
|
+
done: "Commencer",
|
|
4508
|
+
restart: "Revoir le guide",
|
|
4509
|
+
stepOf: (current, total) => `Étape ${current} sur ${total}`
|
|
4510
|
+
},
|
|
4511
|
+
de: {
|
|
4512
|
+
title: "Schnellstart",
|
|
4513
|
+
skip: "Anleitung überspringen",
|
|
4514
|
+
next: "Weiter",
|
|
4515
|
+
prev: "Zurück",
|
|
4516
|
+
done: "Loslegen",
|
|
4517
|
+
restart: "Anleitung erneut anzeigen",
|
|
4518
|
+
stepOf: (current, total) => `Schritt ${current} von ${total}`
|
|
4519
|
+
},
|
|
4520
|
+
it: {
|
|
4521
|
+
title: "Avvio rapido",
|
|
4522
|
+
skip: "Salta la guida",
|
|
4523
|
+
next: "Avanti",
|
|
4524
|
+
prev: "Indietro",
|
|
4525
|
+
done: "Inizia",
|
|
4526
|
+
restart: "Rivedi la guida",
|
|
4527
|
+
stepOf: (current, total) => `Passo ${current} di ${total}`
|
|
4528
|
+
},
|
|
4529
|
+
ru: {
|
|
4530
|
+
title: "Быстрый старт",
|
|
4531
|
+
skip: "Пропустить руководство",
|
|
4532
|
+
next: "Далее",
|
|
4533
|
+
prev: "Назад",
|
|
4534
|
+
done: "Начать",
|
|
4535
|
+
restart: "Показать руководство снова",
|
|
4536
|
+
stepOf: (current, total) => `Шаг ${current} из ${total}`
|
|
4537
|
+
},
|
|
4538
|
+
es: {
|
|
4539
|
+
title: "Inicio rápido",
|
|
4540
|
+
skip: "Omitir la guía",
|
|
4541
|
+
next: "Siguiente",
|
|
4542
|
+
prev: "Atrás",
|
|
4543
|
+
done: "Empezar",
|
|
4544
|
+
restart: "Ver la guía de nuevo",
|
|
4545
|
+
stepOf: (current, total) => `Paso ${current} de ${total}`
|
|
4546
|
+
},
|
|
4547
|
+
pt: {
|
|
4548
|
+
title: "Início rápido",
|
|
4549
|
+
skip: "Ignorar o guia",
|
|
4550
|
+
next: "Próximo",
|
|
4551
|
+
prev: "Voltar",
|
|
4552
|
+
done: "Começar",
|
|
4553
|
+
restart: "Ver o guia novamente",
|
|
4554
|
+
stepOf: (current, total) => `Passo ${current} de ${total}`
|
|
4555
|
+
}
|
|
4556
|
+
};
|
|
4557
|
+
/** 语言标签 → 语言码:只认主标签,认不出的落 null(由调用方回退 en)。 */
|
|
4558
|
+
function normalizeGuideLocale(tag) {
|
|
4559
|
+
const primary = tag.toLowerCase().trim().split(/[-_]/)[0] ?? "";
|
|
4560
|
+
return GUIDE_LOCALES.includes(primary) ? primary : null;
|
|
4561
|
+
}
|
|
4562
|
+
function htmlLang() {
|
|
4563
|
+
try {
|
|
4564
|
+
return typeof document === "undefined" ? "" : document.documentElement?.lang ?? "";
|
|
4565
|
+
} catch {
|
|
4566
|
+
return "";
|
|
4567
|
+
}
|
|
4568
|
+
}
|
|
4569
|
+
/**
|
|
4570
|
+
* 当前引导语言:以宿主 `<html lang>` 为准(语言切换会改写这个属性)。
|
|
4571
|
+
*
|
|
4572
|
+
* 认不出 → en:引导是「帮助」面,宁可给英文也不能给空白或中文硬串。
|
|
4573
|
+
*/
|
|
4574
|
+
function currentGuideLocale() {
|
|
4575
|
+
return normalizeGuideLocale(htmlLang()) ?? "en";
|
|
4576
|
+
}
|
|
4577
|
+
/** 引导外壳取词。 */
|
|
4578
|
+
function guideLabels(locale = currentGuideLocale()) {
|
|
4579
|
+
return GUIDE_COPY[locale] ?? GUIDE_COPY.en;
|
|
4580
|
+
}
|
|
4581
|
+
/**
|
|
4582
|
+
* 步骤正文取词:本语 → en → zh → 表里第一个可用。
|
|
4583
|
+
*
|
|
4584
|
+
* 为什么需要回退链:九插件分批补语种,某个插件可能只有 zh/en 而宿主是 ru;
|
|
4585
|
+
* 这时给英文是可用的,给空白等于「引导坏了」。`undefined` 步骤表按空表处理。
|
|
4586
|
+
*/
|
|
4587
|
+
function guideSteps(map) {
|
|
4588
|
+
if (map === void 0) return [];
|
|
4589
|
+
const order = [
|
|
4590
|
+
currentGuideLocale(),
|
|
4591
|
+
"en",
|
|
4592
|
+
"zh"
|
|
4593
|
+
];
|
|
4594
|
+
for (const key of order) {
|
|
4595
|
+
const hit = key === void 0 ? void 0 : map[key];
|
|
4596
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
4597
|
+
}
|
|
4598
|
+
for (const key of GUIDE_LOCALES) {
|
|
4599
|
+
const hit = map[key];
|
|
4600
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
4601
|
+
}
|
|
4602
|
+
return [];
|
|
4603
|
+
}
|
|
4604
|
+
function guideStorageKey(ns) {
|
|
4605
|
+
return `dsh.guide.${ns}.skipped`;
|
|
4606
|
+
}
|
|
4607
|
+
/** 是否已跳过(存储不可用时按「未跳过」处理:宁可多教一次,不要静默不教)。 */
|
|
4608
|
+
function isGuideSkipped(ns) {
|
|
4609
|
+
try {
|
|
4610
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(guideStorageKey(ns)) === "1";
|
|
4611
|
+
} catch {
|
|
4612
|
+
return false;
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
/** 记下跳过;写失败不抛(隐私模式 / 存储禁用)。 */
|
|
4616
|
+
function skipGuide(ns) {
|
|
4617
|
+
try {
|
|
4618
|
+
localStorage?.setItem(guideStorageKey(ns), "1");
|
|
4619
|
+
} catch {}
|
|
4620
|
+
}
|
|
4621
|
+
/** 清标记 = 允许重新教学。 */
|
|
4622
|
+
function resetGuide(ns) {
|
|
4623
|
+
try {
|
|
4624
|
+
localStorage?.removeItem(guideStorageKey(ns));
|
|
4625
|
+
} catch {}
|
|
4626
|
+
}
|
|
4627
|
+
const GUIDE_CSS = `
|
|
4628
|
+
.sgGuide{border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28));background:var(--dsw-alias-bg-layer-2, rgba(127,127,127,.06));border-radius:12px;padding:14px 16px;margin:0 0 12px}
|
|
4629
|
+
.sgGuideHead{display:flex;align-items:center;gap:8px;margin:0 0 10px}
|
|
4630
|
+
.sgGuideTitle{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary, currentColor)}
|
|
4631
|
+
.sgGuideStep{font-size:12px;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));margin-left:auto}
|
|
4632
|
+
.sgGuideBody{font-size:13px;line-height:1.6;color:var(--dsw-alias-label-secondary, currentColor);min-height:52px}
|
|
4633
|
+
.sgGuideBody b{color:var(--dsw-alias-label-primary, currentColor);font-weight:600}
|
|
4634
|
+
.sgGuideDots{display:flex;gap:6px;margin:10px 0 0}
|
|
4635
|
+
.sgGuideDot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-border-l2, rgba(127,127,127,.3))}
|
|
4636
|
+
.sgGuideDot-on{background:var(--dsw-alias-button-primary-fill, #4d6bfe)}
|
|
4637
|
+
.sgGuideFoot{display:flex;align-items:center;gap:8px;margin:12px 0 0}
|
|
4638
|
+
.sgGuideBtn{appearance:none;font:inherit;font-size:12px;padding:5px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3));background:transparent;color:var(--dsw-alias-label-primary, currentColor);cursor:pointer}
|
|
4639
|
+
.sgGuideBtn-primary{background:var(--dsw-alias-button-primary-fill, #4d6bfe);border-color:transparent;color:#fff}
|
|
4640
|
+
.sgGuideBtn-skip{margin-right:auto;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));border-color:transparent;text-decoration:underline}
|
|
4641
|
+
.sgGuideRestart{appearance:none;font:inherit;font-size:12px;padding:0;border:0;background:transparent;color:var(--dsw-alias-link-primary, #4d6bfe);cursor:pointer;text-decoration:underline}
|
|
4642
|
+
`;
|
|
4643
|
+
function injectGuideCss() {
|
|
4644
|
+
try {
|
|
4645
|
+
if (typeof document === "undefined") return;
|
|
4646
|
+
if (typeof document.querySelector !== "function") return;
|
|
4647
|
+
if (typeof document.createElement !== "function") return;
|
|
4648
|
+
if (!document.head) return;
|
|
4649
|
+
if (document.querySelector("style[data-plugin-css=\"guide-kit\"]") !== null) return;
|
|
4650
|
+
const tag = document.createElement("style");
|
|
4651
|
+
tag.dataset.pluginCss = "guide-kit";
|
|
4652
|
+
tag.textContent = GUIDE_CSS;
|
|
4653
|
+
document.head.appendChild(tag);
|
|
4654
|
+
} catch {}
|
|
4655
|
+
}
|
|
4656
|
+
/** 语言变更订阅:语言切换后重渲染词表(引导是短生命周期,直接跟随 <html lang>)。 */
|
|
4657
|
+
function useLangTick() {
|
|
4658
|
+
const [, setTick] = (0, react.useState)(0);
|
|
4659
|
+
(0, react.useEffect)(() => {
|
|
4660
|
+
try {
|
|
4661
|
+
if (typeof MutationObserver === "undefined" || typeof document === "undefined") return;
|
|
4662
|
+
if (!document.documentElement) return;
|
|
4663
|
+
const observer = new MutationObserver(() => setTick((n) => n + 1));
|
|
4664
|
+
observer.observe(document.documentElement, {
|
|
4665
|
+
attributes: true,
|
|
4666
|
+
attributeFilter: ["lang"]
|
|
4667
|
+
});
|
|
4668
|
+
return () => observer.disconnect();
|
|
4669
|
+
} catch {
|
|
4670
|
+
return;
|
|
4671
|
+
}
|
|
4672
|
+
}, []);
|
|
4673
|
+
}
|
|
4674
|
+
/**
|
|
4675
|
+
* 引导主体:3 步以内的小教学 + 恒定可见的 Skip。
|
|
4676
|
+
*
|
|
4677
|
+
* `onClose` 由宿主卡面传:Skip/Done 都会调用它(Skip 同时写标记)。
|
|
4678
|
+
*/
|
|
4679
|
+
function GuidePanel(props) {
|
|
4680
|
+
const { ns, steps, onClose } = props;
|
|
4681
|
+
const [index, setIndex] = (0, react.useState)(0);
|
|
4682
|
+
useLangTick();
|
|
4683
|
+
const labels = guideLabels();
|
|
4684
|
+
(0, react.useEffect)(() => {
|
|
4685
|
+
injectGuideCss();
|
|
4686
|
+
}, []);
|
|
4687
|
+
if (steps.length === 0) return null;
|
|
4688
|
+
const current = steps[Math.min(index, steps.length - 1)];
|
|
4689
|
+
const last = index >= steps.length - 1;
|
|
4690
|
+
const finish = () => {
|
|
4691
|
+
skipGuide(ns);
|
|
4692
|
+
onClose();
|
|
4693
|
+
};
|
|
4694
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4695
|
+
className: "sgGuide",
|
|
4696
|
+
"aria-label": labels.title,
|
|
4697
|
+
children: [
|
|
4698
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
4699
|
+
className: "sgGuideHead",
|
|
4700
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4701
|
+
className: "sgGuideTitle",
|
|
4702
|
+
children: labels.title
|
|
4703
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4704
|
+
className: "sgGuideStep",
|
|
4705
|
+
children: labels.stepOf(index + 1, steps.length)
|
|
4706
|
+
})]
|
|
4707
|
+
}),
|
|
4708
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4709
|
+
className: "sgGuideBody",
|
|
4710
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: current.title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: current.body })]
|
|
4711
|
+
}),
|
|
4712
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4713
|
+
className: "sgGuideDots",
|
|
4714
|
+
"aria-hidden": "true",
|
|
4715
|
+
children: steps.map((step, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "sgGuideDot" + (i === index ? " sgGuideDot-on" : "") }, step.title))
|
|
4716
|
+
}),
|
|
4717
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
|
|
4718
|
+
className: "sgGuideFoot",
|
|
4719
|
+
children: [
|
|
4720
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4721
|
+
type: "button",
|
|
4722
|
+
className: "sgGuideBtn sgGuideBtn-skip",
|
|
4723
|
+
onClick: () => finish(),
|
|
4724
|
+
children: labels.skip
|
|
4725
|
+
}),
|
|
4726
|
+
index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4727
|
+
type: "button",
|
|
4728
|
+
className: "sgGuideBtn",
|
|
4729
|
+
onClick: () => setIndex(index - 1),
|
|
4730
|
+
children: labels.prev
|
|
4731
|
+
}),
|
|
4732
|
+
last ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4733
|
+
type: "button",
|
|
4734
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
4735
|
+
onClick: () => finish(),
|
|
4736
|
+
children: labels.done
|
|
4737
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4738
|
+
type: "button",
|
|
4739
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
4740
|
+
onClick: () => setIndex(index + 1),
|
|
4741
|
+
children: labels.next
|
|
4742
|
+
})
|
|
4743
|
+
]
|
|
4744
|
+
})
|
|
4745
|
+
]
|
|
4746
|
+
});
|
|
4747
|
+
}
|
|
4748
|
+
/**
|
|
4749
|
+
* 重启入口:清标记 + 就地重开引导。
|
|
4750
|
+
*
|
|
4751
|
+
* 统一件,避免九插件各写一份(措辞/样式/清标记时机容易走样)。跳过之后
|
|
4752
|
+
* 用户想再看一次,不需要去清浏览器存储。
|
|
4753
|
+
*/
|
|
4754
|
+
function GuideRestartButton(props) {
|
|
4755
|
+
const { ns, onOpen, style } = props;
|
|
4756
|
+
useLangTick();
|
|
4757
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4758
|
+
type: "button",
|
|
4759
|
+
className: "sgGuideRestart",
|
|
4760
|
+
style,
|
|
4761
|
+
onClick: () => {
|
|
4762
|
+
resetGuide(ns);
|
|
4763
|
+
onOpen();
|
|
4764
|
+
},
|
|
4765
|
+
children: guideLabels().restart
|
|
3515
4766
|
});
|
|
3516
4767
|
}
|
|
3517
4768
|
//#endregion
|
|
4769
|
+
//#region src/client/guide-steps.ts
|
|
4770
|
+
const THINKING_GUIDE_STEPS = {
|
|
4771
|
+
zh: [
|
|
4772
|
+
{
|
|
4773
|
+
title: "它决定「想多深」",
|
|
4774
|
+
body: "按请求难度自动挑思考档位:简单问答降到 low,复杂任务抬到 high。默认「自动」就够用,别一上来钉死 max——贵且慢。"
|
|
4775
|
+
},
|
|
4776
|
+
{
|
|
4777
|
+
title: "允许上浮比允许下调更重要",
|
|
4778
|
+
body: "「允许上调」打开后遇到难题会自动加深思考;「允许降级」则会为了省钱往下压。想稳就先只开上调。"
|
|
4779
|
+
},
|
|
4780
|
+
{
|
|
4781
|
+
title: "看实时档位在环上",
|
|
4782
|
+
body: "输入框右侧的圆环显示当前上下文占用与压力档;点开模型面板能看到本次请求实际发出的思考档位与理由。"
|
|
4783
|
+
}
|
|
4784
|
+
],
|
|
4785
|
+
en: [
|
|
4786
|
+
{
|
|
4787
|
+
title: "It decides how deeply to think",
|
|
4788
|
+
body: "Picks a reasoning effort per request by difficulty: easy Q&A drops to low, hard tasks rise to high. \"Auto\" is enough — don't pin max from the start, it is slow and expensive."
|
|
4789
|
+
},
|
|
4790
|
+
{
|
|
4791
|
+
title: "Allowing upgrades matters more than allowing downgrades",
|
|
4792
|
+
body: "With \"allow upgrade\" on, hard problems get more thinking automatically; \"allow downgrade\" pushes thinking down to save money. For stability, turn on upgrade only."
|
|
4793
|
+
},
|
|
4794
|
+
{
|
|
4795
|
+
title: "The ring shows the live gear",
|
|
4796
|
+
body: "The ring right of the composer shows context usage and pressure; open the model panel to see the effort actually sent with this request and why."
|
|
4797
|
+
}
|
|
4798
|
+
]
|
|
4799
|
+
};
|
|
4800
|
+
//#endregion
|
|
3518
4801
|
//#region src/client/card.tsx
|
|
3519
4802
|
/**
|
|
3520
4803
|
* Thinking-levels settings card — the family settings tab face of the
|
|
@@ -5179,6 +6462,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5179
6462
|
...value,
|
|
5180
6463
|
...pendingTl
|
|
5181
6464
|
};
|
|
6465
|
+
const [guideOpen, setGuideOpen] = (0, react.useState)(() => !isGuideSkipped("thinking-levels"));
|
|
5182
6466
|
const level = EFFORT_OPTIONS.includes(viewValue.level) ? viewValue.level : "auto";
|
|
5183
6467
|
const defaultPricing = PRICING_OPTIONS.includes(viewValue.defaultPricing) ? viewValue.defaultPricing : "estimate";
|
|
5184
6468
|
const writeTl = (field, v) => {
|
|
@@ -5266,9 +6550,15 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5266
6550
|
strokeLinejoin: "round"
|
|
5267
6551
|
})
|
|
5268
6552
|
})]
|
|
5269
|
-
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6553
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5270
6554
|
style: { padding: "12px 16px" },
|
|
5271
|
-
children:
|
|
6555
|
+
children: [guideOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuidePanel, {
|
|
6556
|
+
ns: "thinking-levels",
|
|
6557
|
+
steps: guideSteps(THINKING_GUIDE_STEPS),
|
|
6558
|
+
onClose: () => {
|
|
6559
|
+
setGuideOpen(false);
|
|
6560
|
+
}
|
|
6561
|
+
}) : null, unavailable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5272
6562
|
style: {
|
|
5273
6563
|
fontSize: "13px",
|
|
5274
6564
|
color: "var(--dsw-alias-label-tertiary)"
|
|
@@ -5460,8 +6750,17 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5460
6750
|
scope: deepseekScope,
|
|
5461
6751
|
t,
|
|
5462
6752
|
readonly
|
|
6753
|
+
}),
|
|
6754
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6755
|
+
style: { margin: "10px 0 0" },
|
|
6756
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuideRestartButton, {
|
|
6757
|
+
ns: "thinking-levels",
|
|
6758
|
+
onOpen: () => {
|
|
6759
|
+
setGuideOpen(true);
|
|
6760
|
+
}
|
|
6761
|
+
})
|
|
5463
6762
|
})
|
|
5464
|
-
] })
|
|
6763
|
+
] })]
|
|
5465
6764
|
}) : null]
|
|
5466
6765
|
});
|
|
5467
6766
|
}
|
|
@@ -5716,9 +7015,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5716
7015
|
const lastEffectiveOf = (sessions, sessionId) => {
|
|
5717
7016
|
try {
|
|
5718
7017
|
const face = sessions?.binding(sessionId)?.session?.projections?.faceOf?.("tlAutoSchedule");
|
|
5719
|
-
const
|
|
5720
|
-
const value = typeof snapshot === "object" && snapshot !== null ? snapshot.value : void 0;
|
|
5721
|
-
const raw = typeof value === "object" && value !== null ? value.lastEffective : void 0;
|
|
7018
|
+
const raw = projectionValueOf(typeof face?.getSnapshot === "function" ? face.getSnapshot() : void 0)?.["lastEffective"];
|
|
5722
7019
|
return typeof raw === "string" && raw.length > 0 ? raw : void 0;
|
|
5723
7020
|
} catch {
|
|
5724
7021
|
return;
|