dsh-thinking-levels 4.6.0 → 4.7.1
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 +48 -0
- package/lib/auto-schedule-projection.d.ts +164 -6
- package/lib/auto-schedule-projection.js +252 -19
- package/lib/client.js +1633 -353
- package/lib/client.js.map +1 -1
- package/lib/index.js +27 -0
- package/lib/plugin-records.d.ts +85 -0
- package/lib/plugin-records.js +181 -0
- package/package.json +155 -155
package/lib/client.js
CHANGED
|
@@ -118,7 +118,53 @@ window.__ModuleLoader__.load({
|
|
|
118
118
|
"trace.label": "Effort 轨迹",
|
|
119
119
|
"trace.empty": "本会话还没有已提交的请求档位。",
|
|
120
120
|
"trace.intent.auto": "auto",
|
|
121
|
-
"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": "未校准·仅供参考"
|
|
122
168
|
};
|
|
123
169
|
/** English dictionary (keys mirror zh). */
|
|
124
170
|
const en = {
|
|
@@ -228,7 +274,53 @@ window.__ModuleLoader__.load({
|
|
|
228
274
|
"trace.label": "Effort trace",
|
|
229
275
|
"trace.empty": "No committed request levels in this session yet.",
|
|
230
276
|
"trace.intent.auto": "auto",
|
|
231
|
-
"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"
|
|
232
324
|
};
|
|
233
325
|
/** Japanese dictionary (keys mirror zh). */
|
|
234
326
|
const ja = {
|
|
@@ -338,7 +430,53 @@ window.__ModuleLoader__.load({
|
|
|
338
430
|
"trace.label": "Effort 軌跡",
|
|
339
431
|
"trace.empty": "このセッションには確定済みリクエストのレベルがまだありません。",
|
|
340
432
|
"trace.intent.auto": "auto",
|
|
341
|
-
"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": "未較正・参考のみ"
|
|
342
480
|
};
|
|
343
481
|
/** Korean dictionary (keys mirror zh). */
|
|
344
482
|
const ko = {
|
|
@@ -448,7 +586,53 @@ window.__ModuleLoader__.load({
|
|
|
448
586
|
"trace.label": "Effort 궤적",
|
|
449
587
|
"trace.empty": "이 세션에는 아직 확정된 요청 레벨이 없습니다.",
|
|
450
588
|
"trace.intent.auto": "auto",
|
|
451
|
-
"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": "미보정·참고용"
|
|
452
636
|
};
|
|
453
637
|
/** French dictionary (keys mirror zh). */
|
|
454
638
|
const fr = {
|
|
@@ -558,7 +742,53 @@ window.__ModuleLoader__.load({
|
|
|
558
742
|
"trace.label": "Trace des efforts",
|
|
559
743
|
"trace.empty": "Aucun niveau de requête validé dans cette session pour l'instant.",
|
|
560
744
|
"trace.intent.auto": "auto",
|
|
561
|
-
"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"
|
|
562
792
|
};
|
|
563
793
|
/** German dictionary (keys mirror zh). */
|
|
564
794
|
const de = {
|
|
@@ -668,7 +898,53 @@ window.__ModuleLoader__.load({
|
|
|
668
898
|
"trace.label": "Effort-Verlauf",
|
|
669
899
|
"trace.empty": "In dieser Sitzung gibt es noch keine übermittelten Request-Stufen.",
|
|
670
900
|
"trace.intent.auto": "auto",
|
|
671
|
-
"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"
|
|
672
948
|
};
|
|
673
949
|
/** Italian dictionary (keys mirror zh). */
|
|
674
950
|
const it = {
|
|
@@ -778,7 +1054,53 @@ window.__ModuleLoader__.load({
|
|
|
778
1054
|
"trace.label": "Traccia degli effort",
|
|
779
1055
|
"trace.empty": "Nessun livello di richiesta confermato in questa sessione.",
|
|
780
1056
|
"trace.intent.auto": "auto",
|
|
781
|
-
"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"
|
|
782
1104
|
};
|
|
783
1105
|
/** Russian dictionary (keys mirror zh). */
|
|
784
1106
|
const ru = {
|
|
@@ -888,7 +1210,53 @@ window.__ModuleLoader__.load({
|
|
|
888
1210
|
"trace.label": "Трасса усилий",
|
|
889
1211
|
"trace.empty": "В этой сессии ещё нет зафиксированных уровней запросов.",
|
|
890
1212
|
"trace.intent.auto": "auto",
|
|
891
|
-
"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": "без калибровки — только справка"
|
|
892
1260
|
};
|
|
893
1261
|
/** Spanish dictionary (keys mirror zh). */
|
|
894
1262
|
const es = {
|
|
@@ -998,7 +1366,53 @@ window.__ModuleLoader__.load({
|
|
|
998
1366
|
"trace.label": "Trazado de esfuerzo",
|
|
999
1367
|
"trace.empty": "Aún no hay niveles de solicitud confirmados en esta sesión.",
|
|
1000
1368
|
"trace.intent.auto": "auto",
|
|
1001
|
-
"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"
|
|
1002
1416
|
};
|
|
1003
1417
|
/** Portuguese (pt-BR) dictionary (keys mirror zh). */
|
|
1004
1418
|
const pt = {
|
|
@@ -1108,7 +1522,53 @@ window.__ModuleLoader__.load({
|
|
|
1108
1522
|
"trace.label": "Trilha de esforço",
|
|
1109
1523
|
"trace.empty": "Ainda não há níveis de solicitação confirmados nesta sessão.",
|
|
1110
1524
|
"trace.intent.auto": "auto",
|
|
1111
|
-
"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"
|
|
1112
1572
|
};
|
|
1113
1573
|
//#endregion
|
|
1114
1574
|
//#region src/client/context-ring.tsx
|
|
@@ -1137,74 +1597,10 @@ window.__ModuleLoader__.load({
|
|
|
1137
1597
|
* projection pushes — no polling.
|
|
1138
1598
|
*
|
|
1139
1599
|
* Zero host coupling beyond react + the injected seats: plain SVG + HTML
|
|
1140
|
-
* with token-based inline styling; copy
|
|
1141
|
-
* (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.
|
|
1142
1603
|
*/
|
|
1143
|
-
const COPY = {
|
|
1144
|
-
zh: {
|
|
1145
|
-
title: "上下文检查",
|
|
1146
|
-
used: "已用",
|
|
1147
|
-
remaining: "剩余",
|
|
1148
|
-
window: "窗口容量",
|
|
1149
|
-
percent: "占用",
|
|
1150
|
-
system: "系统提示词",
|
|
1151
|
-
tools: "工具定义",
|
|
1152
|
-
messages: "对话消息",
|
|
1153
|
-
warning: "上下文即将用尽——建议压缩上下文或开启新会话。",
|
|
1154
|
-
aria: (percent) => `上下文已用 ${percent}`,
|
|
1155
|
-
unset: "本轮尚未产生用量",
|
|
1156
|
-
billing: "缓存账单",
|
|
1157
|
-
billStep: "当前步",
|
|
1158
|
-
billTurn: "当前轮",
|
|
1159
|
-
billSession: "会话累计",
|
|
1160
|
-
billCacheRead: "缓存命中",
|
|
1161
|
-
billCacheMiss: "缓存未命中",
|
|
1162
|
-
billOutput: "输出",
|
|
1163
|
-
billFullMiss: "完全失效",
|
|
1164
|
-
billRoundsWord: "步",
|
|
1165
|
-
billPeak: "峰价",
|
|
1166
|
-
billOffPeak: "谷价",
|
|
1167
|
-
billFlat: "平价",
|
|
1168
|
-
billUnpriced: "未计价",
|
|
1169
|
-
billCustom: "自填价计价",
|
|
1170
|
-
billPricedAs: (label) => `按 ${label} 计价`,
|
|
1171
|
-
billPriced: "按目录价计价",
|
|
1172
|
-
billEstimate: "目录外估算价",
|
|
1173
|
-
billUncalibratedHint: "未校准·仅供参考"
|
|
1174
|
-
},
|
|
1175
|
-
en: {
|
|
1176
|
-
title: "Context check",
|
|
1177
|
-
used: "Used",
|
|
1178
|
-
remaining: "Remaining",
|
|
1179
|
-
window: "Context window",
|
|
1180
|
-
percent: "Pressure",
|
|
1181
|
-
system: "System prompt",
|
|
1182
|
-
tools: "Tool definitions",
|
|
1183
|
-
messages: "Messages",
|
|
1184
|
-
warning: "Context is nearly full — compact the context or start a new session.",
|
|
1185
|
-
aria: (percent) => `${percent} of context used`,
|
|
1186
|
-
unset: "No usage yet in this turn",
|
|
1187
|
-
billing: "Cache billing",
|
|
1188
|
-
billStep: "This step",
|
|
1189
|
-
billTurn: "This turn",
|
|
1190
|
-
billSession: "Session total",
|
|
1191
|
-
billCacheRead: "Cache read",
|
|
1192
|
-
billCacheMiss: "Cache miss",
|
|
1193
|
-
billOutput: "Output",
|
|
1194
|
-
billFullMiss: "Full misses",
|
|
1195
|
-
billRoundsWord: "steps",
|
|
1196
|
-
billPeak: "Peak rates",
|
|
1197
|
-
billOffPeak: "Off-peak rates",
|
|
1198
|
-
billFlat: "Flat rate",
|
|
1199
|
-
billUnpriced: "Not billed",
|
|
1200
|
-
billCustom: "priced at custom rates",
|
|
1201
|
-
billPricedAs: (label) => `priced as ${label}`,
|
|
1202
|
-
billPriced: "priced at catalog rates",
|
|
1203
|
-
billEstimate: "estimated off-catalog",
|
|
1204
|
-
billUncalibratedHint: "uncalibrated — reference only"
|
|
1205
|
-
}
|
|
1206
|
-
};
|
|
1207
|
-
const copy = () => typeof document !== "undefined" && document.documentElement.lang?.toLowerCase().startsWith("zh") ? COPY.zh : COPY.en;
|
|
1208
1604
|
const RING_SIZE = 18;
|
|
1209
1605
|
const RING_STROKE = 2.5;
|
|
1210
1606
|
const triggerStyle$1 = {
|
|
@@ -1238,7 +1634,7 @@ window.__ModuleLoader__.load({
|
|
|
1238
1634
|
fontSize: "12px",
|
|
1239
1635
|
lineHeight: "18px"
|
|
1240
1636
|
};
|
|
1241
|
-
const headStyle = {
|
|
1637
|
+
const headStyle$1 = {
|
|
1242
1638
|
display: "flex",
|
|
1243
1639
|
alignItems: "baseline",
|
|
1244
1640
|
gap: "8px",
|
|
@@ -1436,19 +1832,23 @@ window.__ModuleLoader__.load({
|
|
|
1436
1832
|
* 读数、金额位换「未计价」文案;旧 view 缺 priced 字段 → 按历史行为计价。
|
|
1437
1833
|
* 混币种会话不给跨币种合计,改按币种分行。
|
|
1438
1834
|
*/
|
|
1439
|
-
function BillingBlock({ billing }) {
|
|
1440
|
-
|
|
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
|
+
};
|
|
1441
1841
|
const cur = billing.currency;
|
|
1442
1842
|
const priced = billing.priced !== false;
|
|
1443
1843
|
const money = (amount, digits) => priced ? formatMoney(amount ?? 0, digits, cur) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1444
1844
|
style: { color: "var(--dsw-alias-label-caption, inherit)" },
|
|
1445
|
-
children: c.
|
|
1845
|
+
children: c("ring.bill.unpriced")
|
|
1446
1846
|
});
|
|
1447
1847
|
const dash = priced ? void 0 : "—";
|
|
1448
1848
|
const buckets = Array.isArray(billing.sessionByCurrency) ? billing.sessionByCurrency : [];
|
|
1449
1849
|
const sessionTotal = !priced ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1450
1850
|
style: { color: "var(--dsw-alias-label-caption, inherit)" },
|
|
1451
|
-
children: c.
|
|
1851
|
+
children: c("ring.bill.unpriced")
|
|
1452
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);
|
|
1453
1853
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
1454
1854
|
style: {
|
|
@@ -1464,7 +1864,7 @@ window.__ModuleLoader__.load({
|
|
|
1464
1864
|
...rowLabelStyle,
|
|
1465
1865
|
color: "#a78bfa"
|
|
1466
1866
|
},
|
|
1467
|
-
children: c.
|
|
1867
|
+
children: c("ring.bill.step")
|
|
1468
1868
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1469
1869
|
style: {
|
|
1470
1870
|
...rowValueStyle,
|
|
@@ -1478,19 +1878,19 @@ window.__ModuleLoader__.load({
|
|
|
1478
1878
|
})]
|
|
1479
1879
|
}),
|
|
1480
1880
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1481
|
-
label: c.
|
|
1881
|
+
label: c("ring.bill.cacheRead"),
|
|
1482
1882
|
tokens: billing.cacheReadTokens ?? 0,
|
|
1483
1883
|
amount: dash ?? formatMoney(billing.cost ?? 0, 4, cur),
|
|
1484
1884
|
color: BILL_COLORS.hit
|
|
1485
1885
|
}),
|
|
1486
1886
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1487
|
-
label: c.
|
|
1887
|
+
label: c("ring.bill.cacheMiss"),
|
|
1488
1888
|
tokens: (billing.totalInputTokens ?? 0) - (billing.cacheReadTokens ?? 0),
|
|
1489
1889
|
amount: dash ?? formatMoney(billing.missCost ?? 0, 4, cur),
|
|
1490
1890
|
color: BILL_COLORS.miss
|
|
1491
1891
|
}),
|
|
1492
1892
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1493
|
-
label: c.
|
|
1893
|
+
label: c("ring.bill.output"),
|
|
1494
1894
|
tokens: billing.outputTokens ?? 0,
|
|
1495
1895
|
amount: dash ?? formatMoney(billing.outputCost ?? 0, 4, cur),
|
|
1496
1896
|
color: BILL_COLORS.output
|
|
@@ -1502,7 +1902,7 @@ window.__ModuleLoader__.load({
|
|
|
1502
1902
|
...rowLabelStyle,
|
|
1503
1903
|
color: "#22d3ee"
|
|
1504
1904
|
},
|
|
1505
|
-
children: c.
|
|
1905
|
+
children: c("ring.bill.turn")
|
|
1506
1906
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1507
1907
|
style: {
|
|
1508
1908
|
...rowValueStyle,
|
|
@@ -1516,19 +1916,19 @@ window.__ModuleLoader__.load({
|
|
|
1516
1916
|
})]
|
|
1517
1917
|
}),
|
|
1518
1918
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1519
|
-
label: c.
|
|
1919
|
+
label: c("ring.bill.cacheRead"),
|
|
1520
1920
|
tokens: billing.turnCacheReadTokens ?? 0,
|
|
1521
1921
|
amount: dash ?? formatMoney(billing.turnHitCost ?? 0, 3, cur),
|
|
1522
1922
|
color: BILL_COLORS.hit
|
|
1523
1923
|
}),
|
|
1524
1924
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1525
|
-
label: c.
|
|
1925
|
+
label: c("ring.bill.cacheMiss"),
|
|
1526
1926
|
tokens: (billing.turnInputTokens ?? 0) - (billing.turnCacheReadTokens ?? 0),
|
|
1527
1927
|
amount: dash ?? formatMoney(billing.turnMissCost ?? 0, 3, cur),
|
|
1528
1928
|
color: BILL_COLORS.miss
|
|
1529
1929
|
}),
|
|
1530
1930
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1531
|
-
label: c.
|
|
1931
|
+
label: c("ring.bill.output"),
|
|
1532
1932
|
tokens: billing.turnOutputTokens ?? 0,
|
|
1533
1933
|
amount: dash ?? formatMoney(billing.turnOutputCost ?? 0, 3, cur),
|
|
1534
1934
|
color: BILL_COLORS.output
|
|
@@ -1540,7 +1940,7 @@ window.__ModuleLoader__.load({
|
|
|
1540
1940
|
...rowLabelStyle,
|
|
1541
1941
|
color: "#f472b6"
|
|
1542
1942
|
},
|
|
1543
|
-
children: [c.
|
|
1943
|
+
children: [c("ring.bill.session"), billing.sessionRounds ? ` · ${billing.sessionRounds} ${c("ring.bill.rounds")}` : ""]
|
|
1544
1944
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1545
1945
|
style: {
|
|
1546
1946
|
...rowValueStyle,
|
|
@@ -1554,19 +1954,19 @@ window.__ModuleLoader__.load({
|
|
|
1554
1954
|
})]
|
|
1555
1955
|
}),
|
|
1556
1956
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1557
|
-
label: c.
|
|
1957
|
+
label: c("ring.bill.cacheRead"),
|
|
1558
1958
|
tokens: billing.sessionCacheReadTokens ?? 0,
|
|
1559
1959
|
amount: dash ?? formatMoney(billing.sessionCacheHitCost ?? 0, 2, cur),
|
|
1560
1960
|
color: BILL_COLORS.hit
|
|
1561
1961
|
}),
|
|
1562
1962
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1563
|
-
label: c.
|
|
1963
|
+
label: c("ring.bill.cacheMiss"),
|
|
1564
1964
|
tokens: (billing.sessionInputTokens ?? 0) - (billing.sessionCacheReadTokens ?? 0),
|
|
1565
1965
|
amount: dash ?? formatMoney(billing.sessionMissCost ?? 0, 2, cur),
|
|
1566
1966
|
color: BILL_COLORS.miss
|
|
1567
1967
|
}),
|
|
1568
1968
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BillSubRow, {
|
|
1569
|
-
label: c.
|
|
1969
|
+
label: c("ring.bill.output"),
|
|
1570
1970
|
tokens: billing.sessionOutputTokens ?? 0,
|
|
1571
1971
|
amount: dash ?? formatMoney(billing.sessionOutputCost ?? 0, 2, cur),
|
|
1572
1972
|
color: BILL_COLORS.output
|
|
@@ -1578,7 +1978,7 @@ window.__ModuleLoader__.load({
|
|
|
1578
1978
|
...rowLabelStyle,
|
|
1579
1979
|
color: "#f43f5e"
|
|
1580
1980
|
},
|
|
1581
|
-
children: c.
|
|
1981
|
+
children: c("ring.bill.fullMiss")
|
|
1582
1982
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1583
1983
|
style: {
|
|
1584
1984
|
...rowValueStyle,
|
|
@@ -1605,23 +2005,29 @@ window.__ModuleLoader__.load({
|
|
|
1605
2005
|
const used = typeof pressure?.projectedTokens === "number" ? pressure.projectedTokens : typeof pressure?.pressureTokens === "number" ? pressure.pressureTokens : void 0;
|
|
1606
2006
|
const window_ = typeof pressure?.contextWindow === "number" && pressure.contextWindow > 0 ? pressure.contextWindow : typeof props.contextWindowFallback === "number" && props.contextWindowFallback > 0 ? props.contextWindowFallback : void 0;
|
|
1607
2007
|
const hasReading = used !== void 0 && window_ !== void 0 && window_ > 0;
|
|
1608
|
-
|
|
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
|
+
};
|
|
1609
2015
|
const percent = hasReading ? Math.min(100, Math.round(used / window_ * 100)) : 0;
|
|
1610
2016
|
const color = pressureColor(percent);
|
|
1611
2017
|
const remaining = hasReading ? Math.max(0, window_ - used) : 0;
|
|
1612
2018
|
const rows = !hasReading || breakdown === void 0 ? [] : [
|
|
1613
2019
|
{
|
|
1614
|
-
label: c.system,
|
|
2020
|
+
label: c("ring.system"),
|
|
1615
2021
|
value: breakdown.systemTokens,
|
|
1616
2022
|
color: BREAKDOWN_COLORS.system
|
|
1617
2023
|
},
|
|
1618
2024
|
{
|
|
1619
|
-
label: c.tools,
|
|
2025
|
+
label: c("ring.tools"),
|
|
1620
2026
|
value: breakdown.toolsTokens,
|
|
1621
2027
|
color: BREAKDOWN_COLORS.tools
|
|
1622
2028
|
},
|
|
1623
2029
|
{
|
|
1624
|
-
label: c.messages,
|
|
2030
|
+
label: c("ring.messages"),
|
|
1625
2031
|
value: breakdown.messageTokens,
|
|
1626
2032
|
color: BREAKDOWN_COLORS.messages
|
|
1627
2033
|
}
|
|
@@ -1639,7 +2045,7 @@ window.__ModuleLoader__.load({
|
|
|
1639
2045
|
...triggerStyle$1,
|
|
1640
2046
|
opacity: .55
|
|
1641
2047
|
},
|
|
1642
|
-
"aria-label": hasReading ? c.aria
|
|
2048
|
+
"aria-label": hasReading ? c("ring.aria", `${percent}%`) : c("ring.unset"),
|
|
1643
2049
|
"aria-haspopup": hasReading ? "dialog" : void 0,
|
|
1644
2050
|
"aria-expanded": open,
|
|
1645
2051
|
onClick: () => {
|
|
@@ -1658,11 +2064,11 @@ window.__ModuleLoader__.load({
|
|
|
1658
2064
|
}), open && hasReading && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1659
2065
|
style: popStyle$1,
|
|
1660
2066
|
role: "dialog",
|
|
1661
|
-
"aria-label": c.title,
|
|
2067
|
+
"aria-label": c("ring.title"),
|
|
1662
2068
|
children: [
|
|
1663
2069
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1664
|
-
style: headStyle,
|
|
1665
|
-
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", {
|
|
1666
2072
|
style: {
|
|
1667
2073
|
...rowValueStyle,
|
|
1668
2074
|
...figureStyle
|
|
@@ -1679,7 +2085,7 @@ window.__ModuleLoader__.load({
|
|
|
1679
2085
|
style: rowStyle$2,
|
|
1680
2086
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1681
2087
|
style: rowLabelStyle,
|
|
1682
|
-
children: c.percent
|
|
2088
|
+
children: c("ring.percent")
|
|
1683
2089
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
1684
2090
|
style: {
|
|
1685
2091
|
...rowValueStyle,
|
|
@@ -1693,7 +2099,7 @@ window.__ModuleLoader__.load({
|
|
|
1693
2099
|
style: rowStyle$2,
|
|
1694
2100
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1695
2101
|
style: rowLabelStyle,
|
|
1696
|
-
children: c.remaining
|
|
2102
|
+
children: c("ring.remaining")
|
|
1697
2103
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1698
2104
|
style: {
|
|
1699
2105
|
...rowValueStyle,
|
|
@@ -1714,18 +2120,21 @@ window.__ModuleLoader__.load({
|
|
|
1714
2120
|
color: row.color
|
|
1715
2121
|
}, row.label))
|
|
1716
2122
|
}),
|
|
1717
|
-
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
|
+
}),
|
|
1718
2127
|
percent >= 85 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1719
2128
|
style: warnStyle,
|
|
1720
|
-
children: c.warning
|
|
2129
|
+
children: c("ring.warning")
|
|
1721
2130
|
}),
|
|
1722
2131
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1723
2132
|
style: footStyle,
|
|
1724
2133
|
children: [
|
|
1725
|
-
c.window,
|
|
2134
|
+
c("ring.window"),
|
|
1726
2135
|
": ",
|
|
1727
|
-
hasReading ? window_.toLocaleString() : c.unset,
|
|
1728
|
-
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")}` : ""
|
|
1729
2138
|
]
|
|
1730
2139
|
})
|
|
1731
2140
|
]
|
|
@@ -3089,7 +3498,10 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3089
3498
|
})
|
|
3090
3499
|
]
|
|
3091
3500
|
}),
|
|
3092
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextRing, {
|
|
3501
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextRing, {
|
|
3502
|
+
contextWindowFallback: activeWindow,
|
|
3503
|
+
t
|
|
3504
|
+
}),
|
|
3093
3505
|
open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3094
3506
|
style: backdropStyle,
|
|
3095
3507
|
onClick: close
|
|
@@ -3359,6 +3771,59 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3359
3771
|
});
|
|
3360
3772
|
}
|
|
3361
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
|
|
3362
3827
|
//#region src/client/effort-trace.tsx
|
|
3363
3828
|
/**
|
|
3364
3829
|
* Effort-trace tab — the `conversation.view` face of dsh-thinking-levels,
|
|
@@ -3367,19 +3832,28 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3367
3832
|
* typed SlotMap merge lives in `types/contracts.d.ts`).
|
|
3368
3833
|
*
|
|
3369
3834
|
* A run-length timeline of the effort levels this session's requests ACTUALLY
|
|
3370
|
-
* went out with — the `tlAutoSchedule` projection's `trace` (stateVersion
|
|
3835
|
+
* went out with — the `tlAutoSchedule` projection's `trace` (stateVersion 4),
|
|
3371
3836
|
* the same durable fold the composer chip's `lastEffective` reads. Consecutive
|
|
3372
3837
|
* requests with the same level AND intent collapse into one run, so even a
|
|
3373
3838
|
* 95-step session reads as a handful of rows:
|
|
3374
3839
|
*
|
|
3375
|
-
* ↑ auto max ×1
|
|
3376
|
-
* = auto high ×12
|
|
3377
|
-
* ↓ 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
|
|
3378
3843
|
*
|
|
3379
3844
|
* The ↑/↓/= glyph is the transition against the escalation rank of the
|
|
3380
3845
|
* previous (older) run; the run text shows the intent (`auto`/`manual`,
|
|
3381
3846
|
* neutral when the session never picked and the configured default applied)
|
|
3382
|
-
* 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.
|
|
3383
3857
|
*
|
|
3384
3858
|
* Data source: the session's projection face — NO HTTP feed. The projection is
|
|
3385
3859
|
* a pure fold over the session log, so a cold read rebuilds historical
|
|
@@ -3387,6 +3861,12 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3387
3861
|
* empty trace or a throwing face read renders the empty state — a thrown
|
|
3388
3862
|
* render would abdicate the whole tab, which is never acceptable for a
|
|
3389
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.
|
|
3390
3870
|
*/
|
|
3391
3871
|
/** Transition glyph per direction (mirrors perm-gate's glyph table pattern). */
|
|
3392
3872
|
const GLYPH = {
|
|
@@ -3395,8 +3875,80 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3395
3875
|
flat: "=",
|
|
3396
3876
|
start: "•"
|
|
3397
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
|
+
};
|
|
3398
3938
|
/** Unknown ids rank after the standard table (same tail semantics as the slider). */
|
|
3399
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
|
+
}
|
|
3400
3952
|
/**
|
|
3401
3953
|
* Build the display rows: newest run first, each carrying the transition
|
|
3402
3954
|
* against its chronological predecessor. Pure — the component is a straight
|
|
@@ -3427,27 +3979,88 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3427
3979
|
return rows;
|
|
3428
3980
|
}
|
|
3429
3981
|
/**
|
|
3430
|
-
*
|
|
3431
|
-
*
|
|
3432
|
-
*
|
|
3433
|
-
*
|
|
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.
|
|
3434
4027
|
* @param sessions - the sessions face.
|
|
3435
4028
|
* @param sessionId - the owning session.
|
|
3436
|
-
* @returns the
|
|
4029
|
+
* @returns the slice, or undefined when there is nothing to render.
|
|
3437
4030
|
*/
|
|
3438
|
-
function
|
|
4031
|
+
function traceSliceOf(sessions, sessionId) {
|
|
3439
4032
|
try {
|
|
3440
4033
|
if (typeof sessionId !== "string" || sessionId.length === 0) return void 0;
|
|
3441
4034
|
const face = sessions?.binding(sessionId)?.session?.projections?.faceOf?.("tlAutoSchedule");
|
|
3442
|
-
const
|
|
3443
|
-
|
|
3444
|
-
const raw =
|
|
3445
|
-
|
|
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;
|
|
3446
4052
|
} catch {
|
|
3447
4053
|
return;
|
|
3448
4054
|
}
|
|
3449
4055
|
}
|
|
3450
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
|
+
/**
|
|
3451
4064
|
* Subscribe to the trace over the projection face's store when it offers one;
|
|
3452
4065
|
* a one-shot read otherwise (the conversation re-renders around every request
|
|
3453
4066
|
* anyway, so the one-shot cadence still tracks). `useSyncExternalStore` needs
|
|
@@ -3464,7 +4077,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3464
4077
|
return;
|
|
3465
4078
|
}
|
|
3466
4079
|
}, [sessions, id]);
|
|
3467
|
-
const getSnapshot = (0, react.useMemo)(() => () =>
|
|
4080
|
+
const getSnapshot = (0, react.useMemo)(() => () => traceSliceOf(sessions, id), [sessions, id]);
|
|
3468
4081
|
const subscribe = (0, react.useMemo)(() => (listener) => {
|
|
3469
4082
|
try {
|
|
3470
4083
|
return typeof face?.subscribe === "function" ? face.subscribe(listener) : () => {};
|
|
@@ -3474,67 +4087,717 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3474
4087
|
}, [face]);
|
|
3475
4088
|
return (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
3476
4089
|
}
|
|
3477
|
-
const
|
|
4090
|
+
const pageStyle = {
|
|
4091
|
+
boxSizing: "border-box",
|
|
4092
|
+
maxWidth: "720px",
|
|
4093
|
+
margin: "0 auto",
|
|
4094
|
+
padding: "8px 4px",
|
|
3478
4095
|
display: "flex",
|
|
3479
4096
|
flexDirection: "column",
|
|
3480
|
-
gap:
|
|
3481
|
-
|
|
3482
|
-
overflowY: "auto"
|
|
3483
|
-
font: "inherit"
|
|
4097
|
+
gap: "8px",
|
|
4098
|
+
font: "inherit",
|
|
4099
|
+
overflowY: "auto"
|
|
3484
4100
|
};
|
|
3485
|
-
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 = {
|
|
3486
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",
|
|
3487
4127
|
alignItems: "baseline",
|
|
3488
|
-
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)"
|
|
4168
|
+
};
|
|
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))"
|
|
4174
|
+
};
|
|
4175
|
+
const bodyStyle = {
|
|
4176
|
+
flex: "1 1 auto",
|
|
4177
|
+
minWidth: 0,
|
|
4178
|
+
paddingBottom: "10px"
|
|
3489
4179
|
};
|
|
3490
|
-
const
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
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))",
|
|
4204
|
+
fontVariantNumeric: "tabular-nums"
|
|
3496
4205
|
};
|
|
3497
|
-
const
|
|
3498
|
-
|
|
4206
|
+
const clockStyle = {
|
|
4207
|
+
marginLeft: "auto",
|
|
4208
|
+
flex: "0 0 auto",
|
|
4209
|
+
fontSize: "11px",
|
|
4210
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
3499
4211
|
fontVariantNumeric: "tabular-nums"
|
|
3500
4212
|
};
|
|
3501
|
-
const
|
|
3502
|
-
|
|
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. */
|
|
3503
4304
|
function EffortTrace(props) {
|
|
3504
4305
|
const t = props.t ?? props.tFallback ?? ((key) => key);
|
|
3505
|
-
const
|
|
4306
|
+
const slice = useTrace(props.sessions, props.sessionId);
|
|
4307
|
+
const trace = slice?.trace ?? [];
|
|
3506
4308
|
const rows = traceRows(trace);
|
|
3507
|
-
if (
|
|
3508
|
-
style:
|
|
3509
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3510
|
-
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
|
+
},
|
|
3511
4322
|
children: t("trace.empty")
|
|
3512
|
-
})
|
|
4323
|
+
})]
|
|
3513
4324
|
});
|
|
3514
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
3515
|
-
style:
|
|
3516
|
-
children:
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
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}`);
|
|
3532
4420
|
})
|
|
3533
|
-
|
|
3534
|
-
|
|
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
|
+
* 引导主体:≤10 步的小教学(惯例:末条讲「用量端点」贴士)+ 恒定可见的 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
|
|
3535
4766
|
});
|
|
3536
4767
|
}
|
|
3537
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
|
|
3538
4801
|
//#region src/client/card.tsx
|
|
3539
4802
|
/**
|
|
3540
4803
|
* Thinking-levels settings card — the family settings tab face of the
|
|
@@ -5199,6 +6462,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5199
6462
|
...value,
|
|
5200
6463
|
...pendingTl
|
|
5201
6464
|
};
|
|
6465
|
+
const [guideOpen, setGuideOpen] = (0, react.useState)(() => !isGuideSkipped("thinking-levels"));
|
|
5202
6466
|
const level = EFFORT_OPTIONS.includes(viewValue.level) ? viewValue.level : "auto";
|
|
5203
6467
|
const defaultPricing = PRICING_OPTIONS.includes(viewValue.defaultPricing) ? viewValue.defaultPricing : "estimate";
|
|
5204
6468
|
const writeTl = (field, v) => {
|
|
@@ -5286,202 +6550,220 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5286
6550
|
strokeLinejoin: "round"
|
|
5287
6551
|
})
|
|
5288
6552
|
})]
|
|
5289
|
-
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6553
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5290
6554
|
style: { padding: "12px 16px" },
|
|
5291
|
-
children:
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5299
|
-
style: rowStyle,
|
|
5300
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5301
|
-
htmlFor: "plugin-config-thinking-levels-level",
|
|
5302
|
-
style: labelStyle,
|
|
5303
|
-
children: t("card.level")
|
|
5304
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
5305
|
-
id: "plugin-config-thinking-levels-level",
|
|
5306
|
-
value: level,
|
|
5307
|
-
disabled: readonly,
|
|
5308
|
-
style: controlStyle,
|
|
5309
|
-
onChange: (event) => {
|
|
5310
|
-
writeTl("level", event.currentTarget.value);
|
|
5311
|
-
},
|
|
5312
|
-
children: EFFORT_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5313
|
-
value: option,
|
|
5314
|
-
children: t(`card.level.${option}`)
|
|
5315
|
-
}, option))
|
|
5316
|
-
})]
|
|
5317
|
-
}),
|
|
5318
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5319
|
-
style: rowStyle,
|
|
5320
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5321
|
-
htmlFor: "plugin-config-thinking-levels-enabled",
|
|
5322
|
-
style: labelStyle,
|
|
5323
|
-
children: t("card.enabled")
|
|
5324
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
5325
|
-
id: "plugin-config-thinking-levels-enabled",
|
|
5326
|
-
checked: viewValue.enabled ?? true,
|
|
5327
|
-
disabled: readonly,
|
|
5328
|
-
onChange: (next) => {
|
|
5329
|
-
writeTl("enabled", next);
|
|
5330
|
-
}
|
|
5331
|
-
})]
|
|
5332
|
-
}),
|
|
5333
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5334
|
-
style: rowStyle,
|
|
5335
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5336
|
-
htmlFor: "plugin-config-thinking-levels-takeover",
|
|
5337
|
-
style: labelStyle,
|
|
5338
|
-
title: t("card.masterTakeoverHint"),
|
|
5339
|
-
children: t("card.masterTakeover")
|
|
5340
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
5341
|
-
id: "plugin-config-thinking-levels-takeover",
|
|
5342
|
-
checked: viewValue.takeover ?? false,
|
|
5343
|
-
disabled: readonly,
|
|
5344
|
-
title: t("card.masterTakeoverHint"),
|
|
5345
|
-
onChange: (next) => {
|
|
5346
|
-
writeTl("takeover", next);
|
|
5347
|
-
}
|
|
5348
|
-
})]
|
|
5349
|
-
}),
|
|
5350
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5351
|
-
style: rowStyle,
|
|
5352
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5353
|
-
htmlFor: "plugin-config-thinking-levels-takeover-ui",
|
|
5354
|
-
style: labelStyle,
|
|
5355
|
-
title: t("card.takeoverUiHint"),
|
|
5356
|
-
children: t("card.takeoverUi")
|
|
5357
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
5358
|
-
id: "plugin-config-thinking-levels-takeover-ui",
|
|
5359
|
-
checked: viewValue.takeoverUi ?? false,
|
|
5360
|
-
disabled: readonly,
|
|
5361
|
-
title: t("card.takeoverUiHint"),
|
|
5362
|
-
onChange: (next) => {
|
|
5363
|
-
writeTl("takeoverUi", next);
|
|
6555
|
+
children: [
|
|
6556
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6557
|
+
style: { margin: "0 0 10px" },
|
|
6558
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuideRestartButton, {
|
|
6559
|
+
ns: "thinking-levels",
|
|
6560
|
+
onOpen: () => {
|
|
6561
|
+
setGuideOpen(true);
|
|
5364
6562
|
}
|
|
5365
|
-
})
|
|
6563
|
+
})
|
|
5366
6564
|
}),
|
|
5367
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6565
|
+
guideOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuidePanel, {
|
|
6566
|
+
ns: "thinking-levels",
|
|
6567
|
+
steps: guideSteps(THINKING_GUIDE_STEPS),
|
|
6568
|
+
onClose: () => {
|
|
6569
|
+
setGuideOpen(false);
|
|
6570
|
+
}
|
|
6571
|
+
}) : null,
|
|
6572
|
+
unavailable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5368
6573
|
style: {
|
|
5369
|
-
|
|
5370
|
-
|
|
6574
|
+
fontSize: "13px",
|
|
6575
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
5371
6576
|
},
|
|
5372
|
-
children: t("card.
|
|
5373
|
-
}),
|
|
5374
|
-
|
|
5375
|
-
style: rowStyle,
|
|
5376
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5377
|
-
htmlFor: "plugin-config-thinking-levels-downgrade",
|
|
5378
|
-
style: labelStyle,
|
|
5379
|
-
children: t("card.allowDowngrade")
|
|
5380
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
5381
|
-
id: "plugin-config-thinking-levels-downgrade",
|
|
5382
|
-
checked: viewValue.allowDowngrade ?? true,
|
|
5383
|
-
disabled: readonly || viewValue.level !== "auto",
|
|
5384
|
-
onChange: (next) => {
|
|
5385
|
-
writeTl("allowDowngrade", next);
|
|
5386
|
-
}
|
|
5387
|
-
})]
|
|
5388
|
-
}),
|
|
5389
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5390
|
-
style: rowStyle,
|
|
5391
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5392
|
-
htmlFor: "plugin-config-thinking-levels-upgrade",
|
|
5393
|
-
style: labelStyle,
|
|
5394
|
-
children: t("card.allowUpgrade")
|
|
5395
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
5396
|
-
id: "plugin-config-thinking-levels-upgrade",
|
|
5397
|
-
checked: viewValue.allowUpgrade ?? false,
|
|
5398
|
-
disabled: readonly || viewValue.level !== "auto",
|
|
5399
|
-
onChange: (next) => {
|
|
5400
|
-
writeTl("allowUpgrade", next);
|
|
5401
|
-
}
|
|
5402
|
-
})]
|
|
5403
|
-
}),
|
|
5404
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5405
|
-
style: rowStyle,
|
|
5406
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5407
|
-
htmlFor: "plugin-config-thinking-levels-default-pricing",
|
|
5408
|
-
style: labelStyle,
|
|
5409
|
-
title: t("card.defaultPricingHint"),
|
|
5410
|
-
children: t("card.defaultPricing")
|
|
5411
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
5412
|
-
id: "plugin-config-thinking-levels-default-pricing",
|
|
5413
|
-
value: defaultPricing,
|
|
5414
|
-
disabled: readonly,
|
|
5415
|
-
style: controlStyle,
|
|
5416
|
-
onChange: (event) => {
|
|
5417
|
-
writeTl("defaultPricing", event.currentTarget.value);
|
|
5418
|
-
},
|
|
5419
|
-
children: PRICING_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5420
|
-
value: option,
|
|
5421
|
-
children: t(`card.defaultPricing.${option}`)
|
|
5422
|
-
}, option))
|
|
5423
|
-
})]
|
|
5424
|
-
}),
|
|
5425
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5426
|
-
style: fieldStyle,
|
|
5427
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6577
|
+
children: t("card.unavailable")
|
|
6578
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
6579
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5428
6580
|
style: rowStyle,
|
|
5429
6581
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5430
|
-
htmlFor: "plugin-config-thinking-levels-
|
|
6582
|
+
htmlFor: "plugin-config-thinking-levels-level",
|
|
5431
6583
|
style: labelStyle,
|
|
5432
|
-
children: t("card.
|
|
5433
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
5434
|
-
id: "plugin-config-thinking-levels-
|
|
5435
|
-
|
|
5436
|
-
style: controlStyle,
|
|
6584
|
+
children: t("card.level")
|
|
6585
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
6586
|
+
id: "plugin-config-thinking-levels-level",
|
|
6587
|
+
value: level,
|
|
5437
6588
|
disabled: readonly,
|
|
5438
|
-
|
|
5439
|
-
placeholder: "shell, pwsh, web_fetch",
|
|
6589
|
+
style: controlStyle,
|
|
5440
6590
|
onChange: (event) => {
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
6591
|
+
writeTl("level", event.currentTarget.value);
|
|
6592
|
+
},
|
|
6593
|
+
children: EFFORT_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6594
|
+
value: option,
|
|
6595
|
+
children: t(`card.level.${option}`)
|
|
6596
|
+
}, option))
|
|
6597
|
+
})]
|
|
6598
|
+
}),
|
|
6599
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6600
|
+
style: rowStyle,
|
|
6601
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6602
|
+
htmlFor: "plugin-config-thinking-levels-enabled",
|
|
6603
|
+
style: labelStyle,
|
|
6604
|
+
children: t("card.enabled")
|
|
6605
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
6606
|
+
id: "plugin-config-thinking-levels-enabled",
|
|
6607
|
+
checked: viewValue.enabled ?? true,
|
|
6608
|
+
disabled: readonly,
|
|
6609
|
+
onChange: (next) => {
|
|
6610
|
+
writeTl("enabled", next);
|
|
6611
|
+
}
|
|
6612
|
+
})]
|
|
6613
|
+
}),
|
|
6614
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6615
|
+
style: rowStyle,
|
|
6616
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6617
|
+
htmlFor: "plugin-config-thinking-levels-takeover",
|
|
6618
|
+
style: labelStyle,
|
|
6619
|
+
title: t("card.masterTakeoverHint"),
|
|
6620
|
+
children: t("card.masterTakeover")
|
|
6621
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
6622
|
+
id: "plugin-config-thinking-levels-takeover",
|
|
6623
|
+
checked: viewValue.takeover ?? false,
|
|
6624
|
+
disabled: readonly,
|
|
6625
|
+
title: t("card.masterTakeoverHint"),
|
|
6626
|
+
onChange: (next) => {
|
|
6627
|
+
writeTl("takeover", next);
|
|
5445
6628
|
}
|
|
5446
6629
|
})]
|
|
5447
|
-
}),
|
|
6630
|
+
}),
|
|
6631
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6632
|
+
style: rowStyle,
|
|
6633
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6634
|
+
htmlFor: "plugin-config-thinking-levels-takeover-ui",
|
|
6635
|
+
style: labelStyle,
|
|
6636
|
+
title: t("card.takeoverUiHint"),
|
|
6637
|
+
children: t("card.takeoverUi")
|
|
6638
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
6639
|
+
id: "plugin-config-thinking-levels-takeover-ui",
|
|
6640
|
+
checked: viewValue.takeoverUi ?? false,
|
|
6641
|
+
disabled: readonly,
|
|
6642
|
+
title: t("card.takeoverUiHint"),
|
|
6643
|
+
onChange: (next) => {
|
|
6644
|
+
writeTl("takeoverUi", next);
|
|
6645
|
+
}
|
|
6646
|
+
})]
|
|
6647
|
+
}),
|
|
6648
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5448
6649
|
style: {
|
|
5449
6650
|
...hintStyle,
|
|
5450
6651
|
margin: "2px 0 10px"
|
|
5451
6652
|
},
|
|
5452
|
-
children: t("card.
|
|
5453
|
-
})
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
6653
|
+
children: t("card.takeoverUiHint")
|
|
6654
|
+
}),
|
|
6655
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6656
|
+
style: rowStyle,
|
|
6657
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6658
|
+
htmlFor: "plugin-config-thinking-levels-downgrade",
|
|
6659
|
+
style: labelStyle,
|
|
6660
|
+
children: t("card.allowDowngrade")
|
|
6661
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
6662
|
+
id: "plugin-config-thinking-levels-downgrade",
|
|
6663
|
+
checked: viewValue.allowDowngrade ?? true,
|
|
6664
|
+
disabled: readonly || viewValue.level !== "auto",
|
|
6665
|
+
onChange: (next) => {
|
|
6666
|
+
writeTl("allowDowngrade", next);
|
|
6667
|
+
}
|
|
6668
|
+
})]
|
|
6669
|
+
}),
|
|
6670
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6671
|
+
style: rowStyle,
|
|
6672
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6673
|
+
htmlFor: "plugin-config-thinking-levels-upgrade",
|
|
6674
|
+
style: labelStyle,
|
|
6675
|
+
children: t("card.allowUpgrade")
|
|
6676
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
|
|
6677
|
+
id: "plugin-config-thinking-levels-upgrade",
|
|
6678
|
+
checked: viewValue.allowUpgrade ?? false,
|
|
6679
|
+
disabled: readonly || viewValue.level !== "auto",
|
|
6680
|
+
onChange: (next) => {
|
|
6681
|
+
writeTl("allowUpgrade", next);
|
|
6682
|
+
}
|
|
6683
|
+
})]
|
|
6684
|
+
}),
|
|
6685
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6686
|
+
style: rowStyle,
|
|
6687
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6688
|
+
htmlFor: "plugin-config-thinking-levels-default-pricing",
|
|
6689
|
+
style: labelStyle,
|
|
6690
|
+
title: t("card.defaultPricingHint"),
|
|
6691
|
+
children: t("card.defaultPricing")
|
|
6692
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
6693
|
+
id: "plugin-config-thinking-levels-default-pricing",
|
|
6694
|
+
value: defaultPricing,
|
|
6695
|
+
disabled: readonly,
|
|
6696
|
+
style: controlStyle,
|
|
6697
|
+
onChange: (event) => {
|
|
6698
|
+
writeTl("defaultPricing", event.currentTarget.value);
|
|
6699
|
+
},
|
|
6700
|
+
children: PRICING_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6701
|
+
value: option,
|
|
6702
|
+
children: t(`card.defaultPricing.${option}`)
|
|
6703
|
+
}, option))
|
|
6704
|
+
})]
|
|
6705
|
+
}),
|
|
6706
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6707
|
+
style: fieldStyle,
|
|
6708
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6709
|
+
style: rowStyle,
|
|
6710
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
6711
|
+
htmlFor: "plugin-config-thinking-levels-simple-tools",
|
|
6712
|
+
style: labelStyle,
|
|
6713
|
+
children: t("card.simpleTools")
|
|
6714
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6715
|
+
id: "plugin-config-thinking-levels-simple-tools",
|
|
6716
|
+
type: "text",
|
|
6717
|
+
style: controlStyle,
|
|
6718
|
+
disabled: readonly,
|
|
6719
|
+
value: simpleToolsText,
|
|
6720
|
+
placeholder: "shell, pwsh, web_fetch",
|
|
6721
|
+
onChange: (event) => {
|
|
6722
|
+
const raw = event.currentTarget.value;
|
|
6723
|
+
setSimpleToolsText(raw);
|
|
6724
|
+
const parsed = Array.from(new Set(raw.split(/[,\s]+/).map((token) => token.trim()).filter((token) => token !== "")));
|
|
6725
|
+
writeTl("simpleTools", parsed);
|
|
6726
|
+
}
|
|
6727
|
+
})]
|
|
6728
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6729
|
+
style: {
|
|
6730
|
+
...hintStyle,
|
|
6731
|
+
margin: "2px 0 10px"
|
|
6732
|
+
},
|
|
6733
|
+
children: t("card.simpleToolsHint")
|
|
6734
|
+
})]
|
|
6735
|
+
}),
|
|
6736
|
+
writeErrorTl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
6737
|
+
style: {
|
|
6738
|
+
margin: "8px 0 0",
|
|
6739
|
+
fontSize: "12px",
|
|
6740
|
+
color: "var(--dsw-alias-danger, #e5484d)"
|
|
6741
|
+
},
|
|
6742
|
+
role: "status",
|
|
6743
|
+
children: ["⚠ ", writeErrorTl]
|
|
6744
|
+
}),
|
|
6745
|
+
!snapshot.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6746
|
+
style: {
|
|
6747
|
+
margin: "8px 0 0",
|
|
6748
|
+
fontSize: "12px",
|
|
6749
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
6750
|
+
},
|
|
6751
|
+
children: t("card.readonly")
|
|
6752
|
+
}),
|
|
6753
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelCapabilities, {
|
|
6754
|
+
scope: piAiScope,
|
|
6755
|
+
ocScope,
|
|
6756
|
+
tlScope: scope,
|
|
6757
|
+
t,
|
|
6758
|
+
readonly
|
|
6759
|
+
}),
|
|
6760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeepSeekContextSection, {
|
|
6761
|
+
scope: deepseekScope,
|
|
6762
|
+
t,
|
|
6763
|
+
readonly
|
|
6764
|
+
})
|
|
6765
|
+
] })
|
|
6766
|
+
]
|
|
5485
6767
|
}) : null]
|
|
5486
6768
|
});
|
|
5487
6769
|
}
|
|
@@ -5736,9 +7018,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
5736
7018
|
const lastEffectiveOf = (sessions, sessionId) => {
|
|
5737
7019
|
try {
|
|
5738
7020
|
const face = sessions?.binding(sessionId)?.session?.projections?.faceOf?.("tlAutoSchedule");
|
|
5739
|
-
const
|
|
5740
|
-
const value = typeof snapshot === "object" && snapshot !== null ? snapshot.value : void 0;
|
|
5741
|
-
const raw = typeof value === "object" && value !== null ? value.lastEffective : void 0;
|
|
7021
|
+
const raw = projectionValueOf(typeof face?.getSnapshot === "function" ? face.getSnapshot() : void 0)?.["lastEffective"];
|
|
5742
7022
|
return typeof raw === "string" && raw.length > 0 ? raw : void 0;
|
|
5743
7023
|
} catch {
|
|
5744
7024
|
return;
|