dsh-thinking-levels 4.7.1 → 4.7.3

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/lib/client.js CHANGED
@@ -4638,7 +4638,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
4638
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
4639
  .sgGuideBtn-primary{background:var(--dsw-alias-button-primary-fill, #4d6bfe);border-color:transparent;color:#fff}
4640
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}
4641
+ .sgGuideRestart{appearance:none;font:inherit;font-size:12px;line-height:1.4;padding:4px 12px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35));background:var(--dsw-alias-bg-layer-2, rgba(127,127,127,.06));color:var(--dsw-alias-label-primary, currentColor);cursor:pointer;text-decoration:none}
4642
+ .sgGuideRestart:hover{border-color:var(--dsw-alias-button-primary-fill, #4d6bfe);color:var(--dsw-alias-button-primary-fill, #4d6bfe)}
4642
4643
  `;
4643
4644
  function injectGuideCss() {
4644
4645
  try {
@@ -4798,6 +4799,180 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
4798
4799
  ]
4799
4800
  };
4800
4801
  //#endregion
4802
+ //#region src/client/star-row-copy.ts
4803
+ /**
4804
+ * star-row 真源(面板 star 快车道行,v1)——纯 DOM 实现,零依赖。
4805
+ *
4806
+ * 副本约束:生成文件名 star-row-copy.ts,头部须保留 /** 块注释,单行 ≤140
4807
+ * 字宽(sidebar-fold 仓 lint 门禁:max-line + file-header)。
4808
+ *
4809
+ * 契约(对齐 panel-star-row spec):
4810
+ * - 渲染一行 <a>:GitHub 单色 SVG + `owner/name`;variant A 追加一句工程话术;
4811
+ * - 整行即链接(A/L 档),新标签页打开;不做弹窗、不做按钮交互;
4812
+ * - 文案内嵌 10 语,按 `document.documentElement.lang` 前缀自选
4813
+ * (同 sidebar-fold `pickDictionary` 口径),不依赖宿主 locale 服务,
4814
+ * 避免逐仓动字典文件;
4815
+ * - 样式一次性注入 <style data-dsh-star-row>,色随 currentColor,深浅主题自适应;
4816
+ * - 副本由 _tools/star-row/sync.mjs 生成到各仓 `src/client/star-row-copy.ts`
4817
+ * (文件名含 copy,locale 守卫豁免规则命中),改副本无效,改真源后重跑 sync。
4818
+ *
4819
+ * 每仓生成时在文件头部烘焙 REPO_URL / STAR_NS / STAR_VARIANT 三个常量。
4820
+ */
4821
+ /** 生成段:REPO_URL / STAR_NS / STAR_VARIANT 由 sync 注入。 */
4822
+ const REPO_URL = "https://github.com/drscrewdriver/dsh-thinking-levels";
4823
+ const STAR_NS = "thinking-levels";
4824
+ /** zh 为键集真理源;10 语与 sidebar-fold/manage-session 同集合。 */
4825
+ const STAR_COPY = {
4826
+ zh: { ask: "觉得省事了?一颗 Star 让工具被更多人看见" },
4827
+ en: { ask: "Finding it handy? A star helps more people discover this tool" },
4828
+ ja: { ask: "便利でしたら⭐で、このツールがもっと届きます" },
4829
+ ko: { ask: "유용했다면 ⭐ 하나로 더 많은 사용자에게 닿습니다" },
4830
+ fr: { ask: "Utile ? Une étoile aide cet outil à être découvert" },
4831
+ de: { ask: "Nützlich? Ein Stern hilft dem Tool, gesehen zu werden" },
4832
+ it: { ask: "Ti è utile? Una stella aiuta questo tool a farsi scoprire" },
4833
+ ru: { ask: "Пригодилось? Звезда поможет большему числу людей узнать о tool" },
4834
+ es: { ask: "¿Te resulta útil? Una estrella ayuda a que más gente lo descubra" },
4835
+ pt: { ask: "Achou útil? Uma estrela ajuda mais pessoas a descobrir a ferramenta" }
4836
+ };
4837
+ const STAR_LANGS = [
4838
+ "zh",
4839
+ "en",
4840
+ "ja",
4841
+ "ko",
4842
+ "fr",
4843
+ "de",
4844
+ "it",
4845
+ "ru",
4846
+ "es",
4847
+ "pt"
4848
+ ];
4849
+ /** GitHub mark(Simple Icons / octicon 轮廓,24 视口),fill 随 currentColor。 */
4850
+ const GITHUB_MARK_PATH = "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332 -5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12";
4851
+ const STYLE_ID = "dsh-star-row-style";
4852
+ const STYLE_CSS = [
4853
+ ".dsh-star-row{display:flex;align-items:center;gap:7px;font-size:12px;",
4854
+ "line-height:1.5;color:inherit;text-decoration:none;opacity:.72;padding:3px 0;",
4855
+ "margin-top:6px;min-width:0;flex-wrap:wrap}",
4856
+ ".dsh-star-row:hover{opacity:1;text-decoration:underline}",
4857
+ ".dsh-star-row svg{width:14px;height:14px;flex:none;display:block}",
4858
+ ".dsh-star-row .dsh-star-ask{opacity:.85;font-weight:400}"
4859
+ ].join("");
4860
+ const STAR_CTA = {
4861
+ zh: "留颗 Star",
4862
+ en: "Star",
4863
+ ja: "スター",
4864
+ ko: "스타",
4865
+ fr: "Star",
4866
+ de: "Stern",
4867
+ it: "Stella",
4868
+ ru: "Звезда",
4869
+ es: "Estrella",
4870
+ pt: "Estrela"
4871
+ };
4872
+ const STAR_S_STYLE_ID = "dsh-star-row-s-style";
4873
+ const STAR_S_STYLE = [
4874
+ ".dsh-star-row-s{display:flex;align-items:center;gap:8px;flex-wrap:wrap;",
4875
+ "font-size:12px;line-height:1.5;color:inherit;opacity:.75;margin-top:10px;",
4876
+ "padding-top:8px;border-top:1px solid rgba(127,127,127,.25)}",
4877
+ ".dsh-star-row-s:hover{opacity:1}",
4878
+ ".dsh-star-link{display:inline-flex;align-items:center;gap:6px;",
4879
+ "color:inherit;text-decoration:none}",
4880
+ ".dsh-star-link:hover{text-decoration:underline}",
4881
+ ".dsh-star-link svg{width:14px;height:14px;flex:none;display:block}",
4882
+ ".dsh-star-row-s .dsh-star-ask{opacity:.85;font-weight:400}",
4883
+ ".dsh-star-cta{font:inherit;font-size:11px;line-height:1;padding:4px 9px;",
4884
+ "border-radius:999px;border:1px solid currentColor;background:transparent;",
4885
+ "color:inherit;cursor:pointer;flex:none;opacity:.7}",
4886
+ ".dsh-star-cta:hover{opacity:1}"
4887
+ ].join("");
4888
+ /** 宿主语言标签归一:取 `documentElement.lang` 的前缀,命中 STAR_LANGS 即用。 */
4889
+ function starLang() {
4890
+ const low = (typeof document !== "undefined" && document.documentElement.lang || "").toLowerCase();
4891
+ for (const cand of STAR_LANGS) if (low.startsWith(cand)) return cand;
4892
+ return "en";
4893
+ }
4894
+ /** 是否已被用户点掉话术(隐私模式下读失败按未关闭处理,只影响本次会话)。 */
4895
+ function starDismissed() {
4896
+ try {
4897
+ return localStorage.getItem("dsh.star.thinking-levels.dismissed") === "1";
4898
+ } catch {
4899
+ return false;
4900
+ }
4901
+ }
4902
+ /** 记住关闭态(隐私模式写失败不报错,话术本次隐藏、刷新复活)。 */
4903
+ function starDismiss() {
4904
+ try {
4905
+ localStorage.setItem("dsh.star.thinking-levels.dismissed", "1");
4906
+ } catch {}
4907
+ }
4908
+ /** 一次性注入 S 档样式。 */
4909
+ function injectStarSStyle(d) {
4910
+ if (d.getElementById(STAR_S_STYLE_ID)) return;
4911
+ const style = d.createElement("style");
4912
+ style.id = STAR_S_STYLE_ID;
4913
+ style.textContent = STAR_S_STYLE;
4914
+ d.head.appendChild(style);
4915
+ }
4916
+ /** S 档扩充:把裸链接行升级成「链接 | 话术 | ★ CTA」,非 S 档返回 null 走原路径。 */
4917
+ function extendedStarRow(link, d) {
4918
+ if (starDismissed()) return link;
4919
+ injectStarSStyle(d);
4920
+ link.className = "dsh-star-link";
4921
+ const lang = starLang();
4922
+ const row = d.createElement("div");
4923
+ row.className = "dsh-star-row-s";
4924
+ row.appendChild(link);
4925
+ const ask = d.createElement("span");
4926
+ ask.className = "dsh-star-ask";
4927
+ ask.textContent = STAR_COPY[lang].ask;
4928
+ row.appendChild(ask);
4929
+ const cta = d.createElement("button");
4930
+ cta.type = "button";
4931
+ cta.className = "dsh-star-cta";
4932
+ cta.textContent = "★ " + STAR_CTA[lang];
4933
+ cta.addEventListener("click", () => {
4934
+ starDismiss();
4935
+ if (row.parentNode) {
4936
+ row.parentNode.replaceChild(link, row);
4937
+ link.className = "dsh-star-row";
4938
+ }
4939
+ });
4940
+ row.appendChild(cta);
4941
+ return row;
4942
+ }
4943
+ /** 在目标文档上建出快车道行(一次性注入样式)。纯 DOM,React 仓经 ref 回调挂载。 */
4944
+ function mountStarRow(doc) {
4945
+ const d = doc ?? document;
4946
+ if (!d.getElementById(STYLE_ID)) {
4947
+ const tag = d.createElement("style");
4948
+ tag.id = STYLE_ID;
4949
+ tag.textContent = STYLE_CSS;
4950
+ d.head.appendChild(tag);
4951
+ }
4952
+ const match = REPO_URL.match(/github\.com\/([^/]+\/[^/#?]+)/);
4953
+ const repo = match ? match[1] : "drscrewdriver";
4954
+ const a = d.createElement("a");
4955
+ a.className = "dsh-star-row";
4956
+ a.href = REPO_URL;
4957
+ a.target = "_blank";
4958
+ a.rel = "noreferrer";
4959
+ a.dataset.starNs = STAR_NS;
4960
+ const svg = d.createElementNS("http://www.w3.org/2000/svg", "svg");
4961
+ svg.setAttribute("viewBox", "0 0 24 24");
4962
+ svg.setAttribute("aria-hidden", "true");
4963
+ const path = d.createElementNS("http://www.w3.org/2000/svg", "path");
4964
+ path.setAttribute("fill", "currentColor");
4965
+ path.setAttribute("d", GITHUB_MARK_PATH);
4966
+ svg.appendChild(path);
4967
+ a.appendChild(svg);
4968
+ const label = d.createElement("span");
4969
+ label.textContent = repo;
4970
+ a.appendChild(label);
4971
+ const row = extendedStarRow(a, d);
4972
+ if (row) return row;
4973
+ return a;
4974
+ }
4975
+ //#endregion
4801
4976
  //#region src/client/card.tsx
4802
4977
  /**
4803
4978
  * Thinking-levels settings card — the family settings tab face of the
@@ -6489,282 +6664,288 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
6489
6664
  borderRadius: "12px",
6490
6665
  transition: "border-color 0.16s, background 0.16s"
6491
6666
  },
6492
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6493
- type: "button",
6494
- "aria-expanded": open,
6495
- style: {
6496
- appearance: "none",
6497
- width: "100%",
6498
- font: "inherit",
6499
- color: "inherit",
6500
- textAlign: "left",
6501
- cursor: "pointer",
6502
- background: "none",
6503
- border: 0,
6504
- borderRadius: "12px",
6505
- display: "flex",
6506
- alignItems: "center",
6507
- gap: "12px",
6508
- padding: "14px 16px"
6509
- },
6510
- onClick: () => {
6511
- setOpen((current) => !current);
6512
- },
6513
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6667
+ children: [
6668
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6669
+ type: "button",
6670
+ "aria-expanded": open,
6514
6671
  style: {
6515
- flex: "1 1 0%",
6516
- minWidth: 0
6672
+ appearance: "none",
6673
+ width: "100%",
6674
+ font: "inherit",
6675
+ color: "inherit",
6676
+ textAlign: "left",
6677
+ cursor: "pointer",
6678
+ background: "none",
6679
+ border: 0,
6680
+ borderRadius: "12px",
6681
+ display: "flex",
6682
+ alignItems: "center",
6683
+ gap: "12px",
6684
+ padding: "14px 16px"
6517
6685
  },
6518
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6686
+ onClick: () => {
6687
+ setOpen((current) => !current);
6688
+ },
6689
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6519
6690
  style: {
6520
- fontSize: "14px",
6521
- fontWeight: 600,
6522
- color: "var(--dsw-alias-label-primary)"
6691
+ flex: "1 1 0%",
6692
+ minWidth: 0
6523
6693
  },
6524
- children: t("card.title")
6525
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6694
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6695
+ style: {
6696
+ fontSize: "14px",
6697
+ fontWeight: 600,
6698
+ color: "var(--dsw-alias-label-primary)"
6699
+ },
6700
+ children: t("card.title")
6701
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6702
+ style: {
6703
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
6704
+ fontSize: "13px",
6705
+ lineHeight: 1.5
6706
+ },
6707
+ children: t("card.description")
6708
+ })]
6709
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
6710
+ width: "16",
6711
+ height: "16",
6712
+ viewBox: "0 0 16 16",
6713
+ "aria-hidden": true,
6526
6714
  style: {
6527
6715
  color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
6528
- fontSize: "13px",
6529
- lineHeight: 1.5
6716
+ flex: "0 0 auto",
6717
+ transition: "transform 0.16s",
6718
+ transform: open ? "rotate(180deg)" : "none"
6530
6719
  },
6531
- children: t("card.description")
6532
- })]
6533
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
6534
- width: "16",
6535
- height: "16",
6536
- viewBox: "0 0 16 16",
6537
- "aria-hidden": true,
6538
- style: {
6539
- color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
6540
- flex: "0 0 auto",
6541
- transition: "transform 0.16s",
6542
- transform: open ? "rotate(180deg)" : "none"
6543
- },
6544
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
6545
- d: "M4 6l4 4 4-4",
6546
- fill: "none",
6547
- stroke: "currentColor",
6548
- strokeWidth: "1.5",
6549
- strokeLinecap: "round",
6550
- strokeLinejoin: "round"
6551
- })
6552
- })]
6553
- }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6554
- style: { padding: "12px 16px" },
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);
6562
- }
6720
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
6721
+ d: "M4 6l4 4 4-4",
6722
+ fill: "none",
6723
+ stroke: "currentColor",
6724
+ strokeWidth: "1.5",
6725
+ strokeLinecap: "round",
6726
+ strokeLinejoin: "round"
6563
6727
  })
6564
- }),
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", {
6573
- style: {
6574
- fontSize: "13px",
6575
- color: "var(--dsw-alias-label-tertiary)"
6576
- },
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", {
6580
- style: rowStyle,
6581
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6582
- htmlFor: "plugin-config-thinking-levels-level",
6583
- style: labelStyle,
6584
- children: t("card.level")
6585
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
6586
- id: "plugin-config-thinking-levels-level",
6587
- value: level,
6588
- disabled: readonly,
6589
- style: controlStyle,
6590
- onChange: (event) => {
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);
6628
- }
6629
- })]
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);
6728
+ })]
6729
+ }),
6730
+ open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6731
+ style: { padding: "12px 16px" },
6732
+ children: [
6733
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6734
+ style: { margin: "0 0 10px" },
6735
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuideRestartButton, {
6736
+ ns: "thinking-levels",
6737
+ onOpen: () => {
6738
+ setGuideOpen(true);
6645
6739
  }
6646
- })]
6740
+ })
6647
6741
  }),
6648
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6742
+ guideOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuidePanel, {
6743
+ ns: "thinking-levels",
6744
+ steps: guideSteps(THINKING_GUIDE_STEPS),
6745
+ onClose: () => {
6746
+ setGuideOpen(false);
6747
+ }
6748
+ }) : null,
6749
+ unavailable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6649
6750
  style: {
6650
- ...hintStyle,
6651
- margin: "2px 0 10px"
6751
+ fontSize: "13px",
6752
+ color: "var(--dsw-alias-label-tertiary)"
6652
6753
  },
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", {
6754
+ children: t("card.unavailable")
6755
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
6756
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6709
6757
  style: rowStyle,
6710
6758
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6711
- htmlFor: "plugin-config-thinking-levels-simple-tools",
6759
+ htmlFor: "plugin-config-thinking-levels-level",
6712
6760
  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,
6761
+ children: t("card.level")
6762
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
6763
+ id: "plugin-config-thinking-levels-level",
6764
+ value: level,
6718
6765
  disabled: readonly,
6719
- value: simpleToolsText,
6720
- placeholder: "shell, pwsh, web_fetch",
6766
+ style: controlStyle,
6721
6767
  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);
6768
+ writeTl("level", event.currentTarget.value);
6769
+ },
6770
+ children: EFFORT_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
6771
+ value: option,
6772
+ children: t(`card.level.${option}`)
6773
+ }, option))
6774
+ })]
6775
+ }),
6776
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6777
+ style: rowStyle,
6778
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6779
+ htmlFor: "plugin-config-thinking-levels-enabled",
6780
+ style: labelStyle,
6781
+ children: t("card.enabled")
6782
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
6783
+ id: "plugin-config-thinking-levels-enabled",
6784
+ checked: viewValue.enabled ?? true,
6785
+ disabled: readonly,
6786
+ onChange: (next) => {
6787
+ writeTl("enabled", next);
6788
+ }
6789
+ })]
6790
+ }),
6791
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6792
+ style: rowStyle,
6793
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6794
+ htmlFor: "plugin-config-thinking-levels-takeover",
6795
+ style: labelStyle,
6796
+ title: t("card.masterTakeoverHint"),
6797
+ children: t("card.masterTakeover")
6798
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
6799
+ id: "plugin-config-thinking-levels-takeover",
6800
+ checked: viewValue.takeover ?? false,
6801
+ disabled: readonly,
6802
+ title: t("card.masterTakeoverHint"),
6803
+ onChange: (next) => {
6804
+ writeTl("takeover", next);
6726
6805
  }
6727
6806
  })]
6728
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6807
+ }),
6808
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6809
+ style: rowStyle,
6810
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6811
+ htmlFor: "plugin-config-thinking-levels-takeover-ui",
6812
+ style: labelStyle,
6813
+ title: t("card.takeoverUiHint"),
6814
+ children: t("card.takeoverUi")
6815
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
6816
+ id: "plugin-config-thinking-levels-takeover-ui",
6817
+ checked: viewValue.takeoverUi ?? false,
6818
+ disabled: readonly,
6819
+ title: t("card.takeoverUiHint"),
6820
+ onChange: (next) => {
6821
+ writeTl("takeoverUi", next);
6822
+ }
6823
+ })]
6824
+ }),
6825
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6729
6826
  style: {
6730
6827
  ...hintStyle,
6731
6828
  margin: "2px 0 10px"
6732
6829
  },
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
- ]
6767
- }) : null]
6830
+ children: t("card.takeoverUiHint")
6831
+ }),
6832
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6833
+ style: rowStyle,
6834
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6835
+ htmlFor: "plugin-config-thinking-levels-downgrade",
6836
+ style: labelStyle,
6837
+ children: t("card.allowDowngrade")
6838
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
6839
+ id: "plugin-config-thinking-levels-downgrade",
6840
+ checked: viewValue.allowDowngrade ?? true,
6841
+ disabled: readonly || viewValue.level !== "auto",
6842
+ onChange: (next) => {
6843
+ writeTl("allowDowngrade", next);
6844
+ }
6845
+ })]
6846
+ }),
6847
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6848
+ style: rowStyle,
6849
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6850
+ htmlFor: "plugin-config-thinking-levels-upgrade",
6851
+ style: labelStyle,
6852
+ children: t("card.allowUpgrade")
6853
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillToggle, {
6854
+ id: "plugin-config-thinking-levels-upgrade",
6855
+ checked: viewValue.allowUpgrade ?? false,
6856
+ disabled: readonly || viewValue.level !== "auto",
6857
+ onChange: (next) => {
6858
+ writeTl("allowUpgrade", next);
6859
+ }
6860
+ })]
6861
+ }),
6862
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6863
+ style: rowStyle,
6864
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6865
+ htmlFor: "plugin-config-thinking-levels-default-pricing",
6866
+ style: labelStyle,
6867
+ title: t("card.defaultPricingHint"),
6868
+ children: t("card.defaultPricing")
6869
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
6870
+ id: "plugin-config-thinking-levels-default-pricing",
6871
+ value: defaultPricing,
6872
+ disabled: readonly,
6873
+ style: controlStyle,
6874
+ onChange: (event) => {
6875
+ writeTl("defaultPricing", event.currentTarget.value);
6876
+ },
6877
+ children: PRICING_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
6878
+ value: option,
6879
+ children: t(`card.defaultPricing.${option}`)
6880
+ }, option))
6881
+ })]
6882
+ }),
6883
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6884
+ style: fieldStyle,
6885
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6886
+ style: rowStyle,
6887
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
6888
+ htmlFor: "plugin-config-thinking-levels-simple-tools",
6889
+ style: labelStyle,
6890
+ children: t("card.simpleTools")
6891
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
6892
+ id: "plugin-config-thinking-levels-simple-tools",
6893
+ type: "text",
6894
+ style: controlStyle,
6895
+ disabled: readonly,
6896
+ value: simpleToolsText,
6897
+ placeholder: "shell, pwsh, web_fetch",
6898
+ onChange: (event) => {
6899
+ const raw = event.currentTarget.value;
6900
+ setSimpleToolsText(raw);
6901
+ const parsed = Array.from(new Set(raw.split(/[,\s]+/).map((token) => token.trim()).filter((token) => token !== "")));
6902
+ writeTl("simpleTools", parsed);
6903
+ }
6904
+ })]
6905
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6906
+ style: {
6907
+ ...hintStyle,
6908
+ margin: "2px 0 10px"
6909
+ },
6910
+ children: t("card.simpleToolsHint")
6911
+ })]
6912
+ }),
6913
+ writeErrorTl !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
6914
+ style: {
6915
+ margin: "8px 0 0",
6916
+ fontSize: "12px",
6917
+ color: "var(--dsw-alias-danger, #e5484d)"
6918
+ },
6919
+ role: "status",
6920
+ children: ["⚠ ", writeErrorTl]
6921
+ }),
6922
+ !snapshot.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6923
+ style: {
6924
+ margin: "8px 0 0",
6925
+ fontSize: "12px",
6926
+ color: "var(--dsw-alias-label-tertiary)"
6927
+ },
6928
+ children: t("card.readonly")
6929
+ }),
6930
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelCapabilities, {
6931
+ scope: piAiScope,
6932
+ ocScope,
6933
+ tlScope: scope,
6934
+ t,
6935
+ readonly
6936
+ }),
6937
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeepSeekContextSection, {
6938
+ scope: deepseekScope,
6939
+ t,
6940
+ readonly
6941
+ })
6942
+ ] })
6943
+ ]
6944
+ }) : null,
6945
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { ref: (node) => {
6946
+ if (node && !node.firstChild) node.appendChild(mountStarRow());
6947
+ } })
6948
+ ]
6768
6949
  });
6769
6950
  }
6770
6951
  //#endregion