@linxin666/dsh-liangshen 0.4.5 → 0.4.7
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/README.i18n.yaml +2 -2
- package/README.md +21 -22
- package/README.zh.md +21 -22
- package/lib/client.js +62 -212
- package/lib/client.js.map +1 -1
- package/lib/index.js +18 -46
- package/lib/types/client/LiangShenMark.d.ts +13 -0
- package/lib/types/client/LiangShenSettingsCard.d.ts +12 -25
- package/lib/types/client/locales.d.ts +2 -14
- package/lib/types/client/plugin-card-seat.d.ts +5 -0
- package/lib/types/composition.d.ts +7 -15
- package/lib/types/index.d.ts +24 -54
- package/package.json +20 -20
- package/presets/liangshen/agent.cordis.yml +48 -36
- package/presets/liangshen/dispatcher-rules.mjs +190 -0
- package/presets/liangshen/minimal-prompt.mjs +75 -12
- package/presets/liangshen/tool-catalog.mjs +177 -67
- package/src/announce.test.ts +7 -13
- package/src/client/LiangShenMark.tsx +25 -0
- package/src/client/LiangShenSettingsCard.tsx +24 -87
- package/src/client/locales.ts +6 -30
- package/src/client/plugin-card-seat.ts +7 -0
- package/src/client/settings-entry-form.ts +0 -1
- package/src/composition.test.ts +39 -22
- package/src/composition.ts +8 -22
- package/src/index.test.ts +35 -10
- package/src/index.ts +30 -62
- package/tools/benchmark-live-run.mjs +12 -17
- package/tools/benchmark-report.mjs +4 -6
- package/presets/liangshen/guard.mjs +0 -426
package/lib/client.js
CHANGED
|
@@ -6,6 +6,7 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
9
10
|
//#region \0dsh-css:packages/dsh-liangshen/src/client/LiangShenLever.module.css.mjs
|
|
10
11
|
const css$1 = ".hYkIZq_lever{align-items:center;font-size:12px;line-height:1;display:inline-flex;position:relative}.hYkIZq_control{color:var(--dsw-alias-label-secondary,inherit);font:inherit;cursor:pointer;touch-action:none;-webkit-user-select:none;user-select:none;background:0 0;border:none;border-radius:999px;align-items:center;gap:6px;margin:0;padding:2px 8px 2px 4px;transition:background-color .16s,color .16s;display:inline-flex}.hYkIZq_control:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,#0000000f)}.hYkIZq_control:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,currentColor);outline-offset:2px}.hYkIZq_control:disabled{cursor:default;opacity:.55}.hYkIZq_track{background:linear-gradient(#2b2f36,#14161a);border-radius:8px;justify-content:center;align-items:flex-end;width:24px;height:28px;display:inline-flex;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff24,inset 0 6px 10px #0000008c}.hYkIZq_track:after{content:\"\";background:#ffffff38;border-radius:2px;height:3px;position:absolute;bottom:2px;left:3px;right:3px}.hYkIZq_arm{transform-origin:50% 24px;width:16px;height:26px;margin-left:-8px;transition:transform .34s cubic-bezier(.2,1.7,.32,1);position:absolute;bottom:2px;left:50%;transform:rotate(-24deg)}.hYkIZq_lever[data-state=on] .hYkIZq_arm{transform:rotate(24deg)}.hYkIZq_rod{fill:#c9ced6;transition:fill .2s}.hYkIZq_knob{fill:#e04a33;stroke:#00000059;stroke-width:.6px;transition:fill .2s}.hYkIZq_lever[data-state=on] .hYkIZq_rod{fill:#ffd76a}.hYkIZq_lever[data-state=on] .hYkIZq_knob{fill:#f7c637}.hYkIZq_lever[data-state=on] .hYkIZq_track{box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l3,#0000001f), 0 0 10px #f7c6378c}.hYkIZq_lever[data-busy=true] .hYkIZq_arm{animation:.42s ease-in-out infinite hYkIZq_lever-jitter}.hYkIZq_readout{white-space:nowrap;letter-spacing:.02em;min-width:4.4em}.hYkIZq_lever[data-state=on] .hYkIZq_readout{color:var(--dsw-alias-label-primary,inherit);font-weight:600}.hYkIZq_error{background:var(--dsw-alias-bg-layer-3,#0000000f);max-width:22ch;color:var(--dsw-alias-state-error-primary,#c0392b);text-overflow:ellipsis;white-space:nowrap;border-radius:6px;margin-left:4px;padding:2px 6px;overflow:hidden}.hYkIZq_burst{z-index:60;pointer-events:none;place-items:center;display:grid;position:fixed;inset:0;overflow:hidden}.hYkIZq_flash{background:radial-gradient(circle at 50% 62%,#fff6c8eb,#ffd04a73 38%,#ffa00000 72%);animation:.72s ease-out both hYkIZq_burst-flash;position:absolute;inset:0}.hYkIZq_ring{border:6px solid #ffd65ad9;border-radius:50%;width:220px;height:220px;animation:1.1s cubic-bezier(.16,.9,.3,1) both hYkIZq_burst-ring;position:absolute}.hYkIZq_ring:nth-of-type(2){animation-delay:.12s}.hYkIZq_ring:nth-of-type(3){animation-delay:.24s}.hYkIZq_banner{color:#ffe9a8;text-align:center;background:linear-gradient(160deg,#181004f0,#402604eb);border-radius:22px;flex-direction:column;align-items:center;gap:6px;padding:22px 40px;animation:.6s cubic-bezier(.16,1.5,.3,1) both hYkIZq_banner-slam,.5s ease-in-out .6s 2 hYkIZq_banner-shake;display:flex;position:relative;box-shadow:0 0 0 2px #ffd65abf,0 24px 70px #00000073}.hYkIZq_bannerName{letter-spacing:.16em;background:linear-gradient(#fff6d0,#ffc93c 55%,#b8730a);color:#0000;text-shadow:0 0 24px #ffc93ca6;-webkit-background-clip:text;background-clip:text;font-size:44px;font-weight:800}.hYkIZq_line{letter-spacing:.08em;font-size:15px}.hYkIZq_code{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);letter-spacing:.06em;opacity:.82;font-size:11px;animation:.5s steps(2,end) 6 hYkIZq_code-blink}.hYkIZq_sparks{place-items:center;display:grid;position:absolute;inset:0}.hYkIZq_spark{transform-origin:50%;background:linear-gradient(#ffeca0f2,#ffaa1400);border-radius:3px;grid-area:1/1;width:3px;height:30px;animation:.95s ease-out both hYkIZq_spark-fly}@keyframes hYkIZq_lever-jitter{0%,to{transform:rotate(-22deg)}50%{transform:rotate(-8deg)}}@keyframes hYkIZq_burst-flash{0%{opacity:0;transform:scale(.6)}18%{opacity:1}to{opacity:0;transform:scale(1.5)}}@keyframes hYkIZq_burst-ring{0%{opacity:.9;transform:scale(.2)}to{opacity:0;transform:scale(3.4)}}@keyframes hYkIZq_banner-slam{0%{opacity:0;transform:scale(3.6)rotate(-9deg)}55%{opacity:1;transform:scale(.94)rotate(1.5deg)}75%{transform:scale(1.06)rotate(-1deg)}to{opacity:1;transform:scale(1)rotate(0)}}@keyframes hYkIZq_banner-shake{0%,to{transform:translate(0)}25%{transform:translate(-9px)rotate(-.6deg)}75%{transform:translate(9px)rotate(.6deg)}}@keyframes hYkIZq_spark-fly{0%{opacity:0;transform:translateY(-40px)scaleY(.3)}18%{opacity:1}to{opacity:0;transform:translateY(-300px)scaleY(1.15)}}@keyframes hYkIZq_code-blink{0%,to{opacity:.35}50%{opacity:1}}@media (prefers-reduced-motion:reduce){.hYkIZq_arm,.hYkIZq_control,.hYkIZq_rod,.hYkIZq_knob{transition:none}.hYkIZq_lever[data-busy=true] .hYkIZq_arm,.hYkIZq_flash,.hYkIZq_ring,.hYkIZq_banner,.hYkIZq_code,.hYkIZq_spark{animation:none}.hYkIZq_burst{animation:.3s ease-out both hYkIZq_burst-flash}.hYkIZq_spark{display:none}}";
|
|
11
12
|
const tagId$1 = "@linxin666/dsh-liangshen/packages/dsh-liangshen/src/client/LiangShenLever.module.css";
|
|
@@ -271,19 +272,6 @@ window.__ModuleLoader__.load({
|
|
|
271
272
|
for (const row of Object.values(byId)) if (row !== void 0 && (row.retainedBy?.mainView ?? 0) > 0) return row.id;
|
|
272
273
|
}
|
|
273
274
|
//#endregion
|
|
274
|
-
//#region \0dsh-store-engine
|
|
275
|
-
const platform = ["@deepseek-ai/dsh-client", "-store"].join("");
|
|
276
|
-
const legacy = ["@deepseek-ai/dsh-client-runtime", "/client"].join("");
|
|
277
|
-
let engine;
|
|
278
|
-
try {
|
|
279
|
-
engine = require(platform);
|
|
280
|
-
} catch {
|
|
281
|
-
engine = require(legacy);
|
|
282
|
-
}
|
|
283
|
-
const createSnapshotStore = engine.createSnapshotStore;
|
|
284
|
-
engine.defineStore;
|
|
285
|
-
engine.shallowEqual;
|
|
286
|
-
//#endregion
|
|
287
275
|
//#region src/core/lever.ts
|
|
288
276
|
/**
|
|
289
277
|
* LiangShen lever logic — framework-free, no DOM, compiled by both programs.
|
|
@@ -369,7 +357,7 @@ window.__ModuleLoader__.load({
|
|
|
369
357
|
this.selectTimeoutMs = options.selectTimeoutMs ?? 1e4;
|
|
370
358
|
this.sessions = readService(() => ctx.sessions);
|
|
371
359
|
this.remote = readService(() => ctx.remote.agentPresets);
|
|
372
|
-
this.store = createSnapshotStore({
|
|
360
|
+
this.store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
373
361
|
state: "off",
|
|
374
362
|
restoreLabel: "",
|
|
375
363
|
busy: false,
|
|
@@ -612,6 +600,44 @@ window.__ModuleLoader__.load({
|
|
|
612
600
|
return error instanceof Error ? error.message : String(error);
|
|
613
601
|
}
|
|
614
602
|
//#endregion
|
|
603
|
+
//#region src/client/LiangShenMark.tsx
|
|
604
|
+
/**
|
|
605
|
+
* Render the LiangShen card mark.
|
|
606
|
+
* @returns the 18x18 lever mark, in the current text color.
|
|
607
|
+
*/
|
|
608
|
+
function LiangShenMark() {
|
|
609
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
610
|
+
width: "18",
|
|
611
|
+
height: "18",
|
|
612
|
+
viewBox: "0 0 18 18",
|
|
613
|
+
fill: "none",
|
|
614
|
+
"aria-hidden": "true",
|
|
615
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
616
|
+
x: "3.6",
|
|
617
|
+
y: "13.2",
|
|
618
|
+
width: "8.8",
|
|
619
|
+
height: "2.8",
|
|
620
|
+
rx: "1.4",
|
|
621
|
+
fill: "currentColor"
|
|
622
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", {
|
|
623
|
+
transform: "rotate(20 8 14.4)",
|
|
624
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
625
|
+
x: "6.5",
|
|
626
|
+
y: "4.6",
|
|
627
|
+
width: "3",
|
|
628
|
+
height: "9.8",
|
|
629
|
+
rx: "1.5",
|
|
630
|
+
fill: "currentColor"
|
|
631
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
632
|
+
cx: "8",
|
|
633
|
+
cy: "4.4",
|
|
634
|
+
r: "2.9",
|
|
635
|
+
fill: "currentColor"
|
|
636
|
+
})]
|
|
637
|
+
})]
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
615
641
|
//#region \0dsh-css:packages/dsh-liangshen/src/client/settings-card.module.css.mjs
|
|
616
642
|
const css = "._9t79wq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}._9t79wq_card:hover{border-color:var(--dsw-alias-label-dimmed)}._9t79wq_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}._9t79wq_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}._9t79wq_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}._9t79wq_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}._9t79wq_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}._9t79wq_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}._9t79wq_header:hover ._9t79wq_mark,._9t79wq_cardOpen ._9t79wq_mark{color:var(--dsw-alias-label-primary)}._9t79wq_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}._9t79wq_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}._9t79wq_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}._9t79wq_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}._9t79wq_header:hover ._9t79wq_chevron{color:var(--dsw-alias-label-secondary)}._9t79wq_chevronOpen{transform:rotate(180deg)}._9t79wq_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}._9t79wq_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}._9t79wq_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}._9t79wq_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}._9t79wq_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}._9t79wq_discard,._9t79wq_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}._9t79wq_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}._9t79wq_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}._9t79wq_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}._9t79wq_discard:disabled,._9t79wq_save:disabled{opacity:.4;cursor:default}._9t79wq_discard:focus-visible,._9t79wq_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}._9t79wq_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}._9t79wq_field+._9t79wq_field{border-top:1px solid var(--dsw-alias-border-l2)}._9t79wq_head{align-items:center;gap:8px;display:flex}._9t79wq_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}._9t79wq_badges{align-items:center;gap:8px;display:inline-flex}._9t79wq_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}._9t79wq_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}._9t79wq_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}._9t79wq_reset:disabled{cursor:default}._9t79wq_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}._9t79wq_input,._9t79wq_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}._9t79wq_input:focus-visible,._9t79wq_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}._9t79wq_input:disabled,._9t79wq_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}._9t79wq_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}._9t79wq_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}._9t79wq_selectWrap{position:relative}._9t79wq_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}._9t79wq_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._9t79wq_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}._9t79wq_selectChevronOpen{transform:rotate(180deg)}._9t79wq_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}._9t79wq_selectPopupOpen{opacity:1;transform:none}._9t79wq_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}._9t79wq_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}._9t79wq_selectOption:hover,._9t79wq_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}._9t79wq_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}._9t79wq_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}._9t79wq_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){._9t79wq_card,._9t79wq_header,._9t79wq_mark,._9t79wq_chevron,._9t79wq_chevronOpen,._9t79wq_discard,._9t79wq_save,._9t79wq_selectChevron,._9t79wq_selectChevronOpen,._9t79wq_selectPopup{transition:none}}";
|
|
617
643
|
const tagId = "@linxin666/dsh-liangshen/packages/dsh-liangshen/src/client/settings-card.module.css";
|
|
@@ -812,51 +838,6 @@ window.__ModuleLoader__.load({
|
|
|
812
838
|
}) : null]
|
|
813
839
|
});
|
|
814
840
|
}
|
|
815
|
-
/** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */
|
|
816
|
-
function ValueField(props) {
|
|
817
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
818
|
-
className: settings_card_module_css_default.field,
|
|
819
|
-
children: [
|
|
820
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
821
|
-
className: settings_card_module_css_default.head,
|
|
822
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
823
|
-
className: settings_card_module_css_default.label,
|
|
824
|
-
htmlFor: props.id,
|
|
825
|
-
children: props.label
|
|
826
|
-
}), props.overridden ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
827
|
-
className: settings_card_module_css_default.badges,
|
|
828
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
829
|
-
className: settings_card_module_css_default.badge,
|
|
830
|
-
children: props.overriddenLabel
|
|
831
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
832
|
-
type: "button",
|
|
833
|
-
className: settings_card_module_css_default.reset,
|
|
834
|
-
disabled: props.disabled,
|
|
835
|
-
onClick: props.onReset,
|
|
836
|
-
children: props.resetLabel
|
|
837
|
-
})]
|
|
838
|
-
}) : null]
|
|
839
|
-
}),
|
|
840
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
841
|
-
id: props.id,
|
|
842
|
-
className: props.invalid ? settings_card_module_css_default.inputInvalid : settings_card_module_css_default.input,
|
|
843
|
-
type: "text",
|
|
844
|
-
...props.numeric === true ? { inputMode: "numeric" } : {},
|
|
845
|
-
...props.invalid ? { "aria-invalid": true } : {},
|
|
846
|
-
value: props.text,
|
|
847
|
-
placeholder: props.placeholder ?? "",
|
|
848
|
-
disabled: props.disabled,
|
|
849
|
-
onChange: (event) => {
|
|
850
|
-
props.onEdit(event.target.value);
|
|
851
|
-
}
|
|
852
|
-
}),
|
|
853
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
854
|
-
className: props.invalid ? settings_card_module_css_default.invalid : settings_card_module_css_default.hint,
|
|
855
|
-
children: props.invalid ? props.invalidLabel : props.hint
|
|
856
|
-
})
|
|
857
|
-
]
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
841
|
const NON_SKIN_BODY_MARKERS = /* @__PURE__ */ new Set(["dshSkinCenter", "dshSidebarCollapsed"]);
|
|
861
842
|
function isSkinActive() {
|
|
862
843
|
return Object.keys(document.body.dataset).some((key) => key.startsWith("dsh") && !NON_SKIN_BODY_MARKERS.has(key));
|
|
@@ -1124,26 +1105,6 @@ window.__ModuleLoader__.load({
|
|
|
1124
1105
|
}
|
|
1125
1106
|
//#endregion
|
|
1126
1107
|
//#region src/client/settings-form.ts
|
|
1127
|
-
/** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints blocks the save. */
|
|
1128
|
-
function numberField(field, constraints = {}) {
|
|
1129
|
-
const { integer = false, min } = constraints;
|
|
1130
|
-
return {
|
|
1131
|
-
field,
|
|
1132
|
-
format: (value) => typeof value === "number" ? String(value) : "",
|
|
1133
|
-
parse: (text) => {
|
|
1134
|
-
const trimmed = text.trim();
|
|
1135
|
-
if (trimmed === "") return { kind: "clear" };
|
|
1136
|
-
const parsed = Number(trimmed);
|
|
1137
|
-
if (!Number.isFinite(parsed)) return void 0;
|
|
1138
|
-
if (integer && !Number.isInteger(parsed)) return void 0;
|
|
1139
|
-
if (min !== void 0 && parsed < min) return void 0;
|
|
1140
|
-
return {
|
|
1141
|
-
kind: "set",
|
|
1142
|
-
value: parsed
|
|
1143
|
-
};
|
|
1144
|
-
}
|
|
1145
|
-
};
|
|
1146
|
-
}
|
|
1147
1108
|
/** A boolean field, edited through true/false draft text. */
|
|
1148
1109
|
function booleanField(field) {
|
|
1149
1110
|
return {
|
|
@@ -1218,7 +1179,7 @@ window.__ModuleLoader__.load({
|
|
|
1218
1179
|
}
|
|
1219
1180
|
/** Publish a projection of this form, rebuilt whenever the form or a draft changes. */
|
|
1220
1181
|
bind(project) {
|
|
1221
|
-
const store = createSnapshotStore(project());
|
|
1182
|
+
const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(project());
|
|
1222
1183
|
this.listeners.add(() => {
|
|
1223
1184
|
store.set(project());
|
|
1224
1185
|
});
|
|
@@ -1454,17 +1415,7 @@ window.__ModuleLoader__.load({
|
|
|
1454
1415
|
//#endregion
|
|
1455
1416
|
//#region src/client/LiangShenSettingsCard.tsx
|
|
1456
1417
|
/** Wire presentations the tool catalog accepts (mirrors the Host schema). */
|
|
1457
|
-
const PRESENTATION_CHOICES = [
|
|
1458
|
-
"ptc",
|
|
1459
|
-
"native",
|
|
1460
|
-
"both"
|
|
1461
|
-
];
|
|
1462
|
-
/** Sensitivity presets for the circuit breaker (mirrors the Host schema). */
|
|
1463
|
-
const SENSITIVITY_CHOICES = [
|
|
1464
|
-
"conservative",
|
|
1465
|
-
"balanced",
|
|
1466
|
-
"aggressive"
|
|
1467
|
-
];
|
|
1418
|
+
const PRESENTATION_CHOICES = ["ptc", "native"];
|
|
1468
1419
|
/** Bridges the `liangshen` settings form onto the card's staged form. */
|
|
1469
1420
|
var LiangShenSettingsCardController = class {
|
|
1470
1421
|
form;
|
|
@@ -1475,20 +1426,7 @@ window.__ModuleLoader__.load({
|
|
|
1475
1426
|
booleanField("enabled"),
|
|
1476
1427
|
booleanField("announceToAgent"),
|
|
1477
1428
|
choiceField("presentation", PRESENTATION_CHOICES),
|
|
1478
|
-
booleanField("
|
|
1479
|
-
choiceField("guardSensitivity", SENSITIVITY_CHOICES),
|
|
1480
|
-
numberField("guardStallReasoningChars", {
|
|
1481
|
-
integer: true,
|
|
1482
|
-
min: 200
|
|
1483
|
-
}),
|
|
1484
|
-
numberField("guardGlobalStallCap", {
|
|
1485
|
-
integer: true,
|
|
1486
|
-
min: 2
|
|
1487
|
-
}),
|
|
1488
|
-
numberField("guardEchoFailures", {
|
|
1489
|
-
integer: true,
|
|
1490
|
-
min: 2
|
|
1491
|
-
})
|
|
1429
|
+
booleanField("dispatcher")
|
|
1492
1430
|
]);
|
|
1493
1431
|
this.store = this.form.bind(() => this.projection());
|
|
1494
1432
|
}
|
|
@@ -1498,11 +1436,7 @@ window.__ModuleLoader__.load({
|
|
|
1498
1436
|
enabled: this.form.field("enabled"),
|
|
1499
1437
|
announceToAgent: this.form.field("announceToAgent"),
|
|
1500
1438
|
presentation: this.form.field("presentation"),
|
|
1501
|
-
|
|
1502
|
-
guardSensitivity: this.form.field("guardSensitivity"),
|
|
1503
|
-
guardStallReasoningChars: this.form.field("guardStallReasoningChars"),
|
|
1504
|
-
guardGlobalStallCap: this.form.field("guardGlobalStallCap"),
|
|
1505
|
-
guardEchoFailures: this.form.field("guardEchoFailures")
|
|
1439
|
+
dispatcher: this.form.field("dispatcher")
|
|
1506
1440
|
};
|
|
1507
1441
|
}
|
|
1508
1442
|
/**
|
|
@@ -1539,6 +1473,7 @@ window.__ModuleLoader__.load({
|
|
|
1539
1473
|
t,
|
|
1540
1474
|
titleKey: "settings.title",
|
|
1541
1475
|
descriptionKey: "settings.description",
|
|
1476
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LiangShenMark, {}),
|
|
1542
1477
|
defaultOpen: false,
|
|
1543
1478
|
state,
|
|
1544
1479
|
renderChildrenWhenNotExposed: true,
|
|
@@ -1594,80 +1529,18 @@ window.__ModuleLoader__.load({
|
|
|
1594
1529
|
}
|
|
1595
1530
|
}),
|
|
1596
1531
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanField, {
|
|
1597
|
-
id: "settings-liangshen-
|
|
1598
|
-
label: t("settings.
|
|
1599
|
-
hint: t("settings.
|
|
1532
|
+
id: "settings-liangshen-dispatcher",
|
|
1533
|
+
label: t("settings.dispatcher"),
|
|
1534
|
+
hint: t("settings.dispatcherHint"),
|
|
1600
1535
|
onLabel: t("settings.on"),
|
|
1601
1536
|
offLabel: t("settings.off"),
|
|
1602
1537
|
...fieldProps,
|
|
1603
|
-
...state.
|
|
1604
|
-
onEdit: (text) => {
|
|
1605
|
-
props.edit("guardEnabled", text);
|
|
1606
|
-
},
|
|
1607
|
-
onReset: () => {
|
|
1608
|
-
props.resetField("guardEnabled");
|
|
1609
|
-
}
|
|
1610
|
-
}),
|
|
1611
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
|
|
1612
|
-
id: "settings-liangshen-guard-sensitivity",
|
|
1613
|
-
label: t("settings.guardSensitivity"),
|
|
1614
|
-
hint: t("settings.guardSensitivityHint"),
|
|
1615
|
-
choices: SENSITIVITY_CHOICES.map((choice) => ({
|
|
1616
|
-
value: choice,
|
|
1617
|
-
label: t(`sensitivity.${choice}`)
|
|
1618
|
-
})),
|
|
1619
|
-
...fieldProps,
|
|
1620
|
-
...state.guardSensitivity,
|
|
1621
|
-
onEdit: (text) => {
|
|
1622
|
-
props.edit("guardSensitivity", text);
|
|
1623
|
-
},
|
|
1624
|
-
onReset: () => {
|
|
1625
|
-
props.resetField("guardSensitivity");
|
|
1626
|
-
}
|
|
1627
|
-
}),
|
|
1628
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
1629
|
-
id: "settings-liangshen-guard-stall-chars",
|
|
1630
|
-
numeric: true,
|
|
1631
|
-
label: t("settings.guardStallChars"),
|
|
1632
|
-
hint: t("settings.guardStallCharsHint"),
|
|
1633
|
-
placeholder: "8000",
|
|
1634
|
-
...fieldProps,
|
|
1635
|
-
...state.guardStallReasoningChars,
|
|
1636
|
-
onEdit: (text) => {
|
|
1637
|
-
props.edit("guardStallReasoningChars", text);
|
|
1638
|
-
},
|
|
1639
|
-
onReset: () => {
|
|
1640
|
-
props.resetField("guardStallReasoningChars");
|
|
1641
|
-
}
|
|
1642
|
-
}),
|
|
1643
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
1644
|
-
id: "settings-liangshen-guard-global-cap",
|
|
1645
|
-
numeric: true,
|
|
1646
|
-
label: t("settings.guardGlobalCap"),
|
|
1647
|
-
hint: t("settings.guardGlobalCapHint"),
|
|
1648
|
-
placeholder: "4",
|
|
1649
|
-
...fieldProps,
|
|
1650
|
-
...state.guardGlobalStallCap,
|
|
1651
|
-
onEdit: (text) => {
|
|
1652
|
-
props.edit("guardGlobalStallCap", text);
|
|
1653
|
-
},
|
|
1654
|
-
onReset: () => {
|
|
1655
|
-
props.resetField("guardGlobalStallCap");
|
|
1656
|
-
}
|
|
1657
|
-
}),
|
|
1658
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
1659
|
-
id: "settings-liangshen-guard-echo",
|
|
1660
|
-
numeric: true,
|
|
1661
|
-
label: t("settings.guardEchoFailures"),
|
|
1662
|
-
hint: t("settings.guardEchoFailuresHint"),
|
|
1663
|
-
placeholder: "3",
|
|
1664
|
-
...fieldProps,
|
|
1665
|
-
...state.guardEchoFailures,
|
|
1538
|
+
...state.dispatcher,
|
|
1666
1539
|
onEdit: (text) => {
|
|
1667
|
-
props.edit("
|
|
1540
|
+
props.edit("dispatcher", text);
|
|
1668
1541
|
},
|
|
1669
1542
|
onReset: () => {
|
|
1670
|
-
props.resetField("
|
|
1543
|
+
props.resetField("dispatcher");
|
|
1671
1544
|
}
|
|
1672
1545
|
})
|
|
1673
1546
|
]
|
|
@@ -1704,7 +1577,9 @@ window.__ModuleLoader__.load({
|
|
|
1704
1577
|
"settings.announceToAgent": "向 agent 公告本插件",
|
|
1705
1578
|
"settings.announceToAgentHint": "开启后向每一轮 agent 系统提示注入本插件公告;默认关闭以保持提示词干净。",
|
|
1706
1579
|
"settings.presentation": "工具面呈现方式",
|
|
1707
|
-
"settings.presentationHint": "写入本插件声明的预设的 tool-catalog 行:
|
|
1580
|
+
"settings.presentationHint": "写入本插件声明的预设的 tool-catalog 行:ptc(出厂默认)把 wire 收拢为 run_code,其余工具经生成的 SDK 调用;native 保持原生工具清单。改动立即生效,但已开始的会话保持其已声明的组合。",
|
|
1581
|
+
"settings.dispatcher": "调度者身份",
|
|
1582
|
+
"settings.dispatcherHint": "开启后本模式按调度 Agent 工作:先分诊复杂度(L0/L1 直接执行,L2 走完整流程),L2 任务先澄清访谈再规划,由主代理派发子代理并逐层审查与验收。与工具面呈现方式无关,只决定身份与流程纪律。出厂默认开启;关闭后回到仅含工作纪律的极简 persona。",
|
|
1708
1583
|
"settings.on": "开",
|
|
1709
1584
|
"settings.off": "关",
|
|
1710
1585
|
"settings.inherit": "继承(跟随部署默认)",
|
|
@@ -1721,21 +1596,7 @@ window.__ModuleLoader__.load({
|
|
|
1721
1596
|
"settings.saveFailed": "部署未接受这些值,已保留供你修改。",
|
|
1722
1597
|
"settings.invalidValue": "该取值不被接受",
|
|
1723
1598
|
"presentation.ptc": "ptc(仅 run_code)",
|
|
1724
|
-
"presentation.native": "native(原生工具清单)"
|
|
1725
|
-
"presentation.both": "both(两者同驻)",
|
|
1726
|
-
"settings.guardEnabled": "启用退化熔断器",
|
|
1727
|
-
"settings.guardEnabledHint": "运行时检测思考退化(连续零产出长思考 / 同参重复失败),触发时注入熔断提示并临时下调推理档位。关闭后不干预任何请求。",
|
|
1728
|
-
"settings.guardStallChars": "单步暴走字符阈值",
|
|
1729
|
-
"settings.guardStallCharsHint": "单条推理达到该字符数且零产出即触发熔断(按 V4.1 官方 384K 最大输出校准;默认 8000,约 2-4K 思考 token)。",
|
|
1730
|
-
"settings.guardGlobalCap": "慢烧连续步数",
|
|
1731
|
-
"settings.guardGlobalCapHint": "连续多少步有真实推理但零产出触发慢烧熔断(默认 4;步数越小越敏感,真实长调查建议调大)。",
|
|
1732
|
-
"settings.guardSensitivity": "熔断灵敏度",
|
|
1733
|
-
"settings.guardSensitivityHint": "整体缩放熔断阈值:保守(更少打断,阈值×1.5)、均衡(出厂校准值)、激进(更早触发,阈值×0.5)。阈值随推理档位自适应:max 档 8000 / high 档 12000 / low 档 20000 字符。",
|
|
1734
|
-
"sensitivity.conservative": "保守(少打断)",
|
|
1735
|
-
"sensitivity.balanced": "均衡(默认)",
|
|
1736
|
-
"sensitivity.aggressive": "激进(早触发)",
|
|
1737
|
-
"settings.guardEchoFailures": "同参连续失败次数",
|
|
1738
|
-
"settings.guardEchoFailuresHint": "同一工具以相同参数连续失败多少次触发空转熔断(默认 3)。"
|
|
1599
|
+
"presentation.native": "native(原生工具清单)"
|
|
1739
1600
|
};
|
|
1740
1601
|
/** English counterpart; the key set mirrors {@link zh} exactly. */
|
|
1741
1602
|
const en = {
|
|
@@ -1761,7 +1622,9 @@ window.__ModuleLoader__.load({
|
|
|
1761
1622
|
"settings.announceToAgent": "Announce this plugin to agents",
|
|
1762
1623
|
"settings.announceToAgentHint": "Adds this plugin announcement to every agent system prompt; off by default so prompts stay clean.",
|
|
1763
1624
|
"settings.presentation": "Wire presentation",
|
|
1764
|
-
"settings.presentationHint": "Written into the tool-catalog row of the preset this plugin declares:
|
|
1625
|
+
"settings.presentationHint": "Written into the tool-catalog row of the preset this plugin declares: ptc (the shipped default) collapses the wire to run_code with every other tool reached through the generated SDK; native keeps the native roster. A change re-declares the preset immediately; sessions that already started keep the composition they declared.",
|
|
1626
|
+
"settings.dispatcher": "Dispatcher identity",
|
|
1627
|
+
"settings.dispatcherHint": "When on, the mode works as a dispatcher agent: it triages complexity first (L0/L1 work is done directly, an L2 task runs the full flow), clarifies an L2 task through an interview before planning, and the lead agent dispatches subagents and reviews and accepts them layer by layer. It is unrelated to the wire presentation and decides identity and process discipline only. On by default; switching it off returns the prompt to the bare persona with its working discipline.",
|
|
1765
1628
|
"settings.on": "On",
|
|
1766
1629
|
"settings.off": "Off",
|
|
1767
1630
|
"settings.inherit": "Inherit (deployment default)",
|
|
@@ -1778,21 +1641,7 @@ window.__ModuleLoader__.load({
|
|
|
1778
1641
|
"settings.saveFailed": "The deployment did not accept these values; they were left for you to correct.",
|
|
1779
1642
|
"settings.invalidValue": "The value is not accepted",
|
|
1780
1643
|
"presentation.ptc": "ptc (run_code only)",
|
|
1781
|
-
"presentation.native": "native (native tool roster)"
|
|
1782
|
-
"presentation.both": "both (both co-resident)",
|
|
1783
|
-
"settings.guardEnabled": "Degeneration circuit breaker",
|
|
1784
|
-
"settings.guardEnabledHint": "Detects reasoning degeneration at runtime (consecutive zero-output long reasoning / repeated identical-argument failures), injecting a breaker message and stepping the reasoning effort down when it fires. Disabled means requests are never touched.",
|
|
1785
|
-
"settings.guardStallChars": "Runaway reasoning character floor",
|
|
1786
|
-
"settings.guardStallCharsHint": "One reasoning block reaching this many characters with no output fires the breaker (calibrated against V4.1's official 384K max output; default 8000, roughly 2-4K thinking tokens).",
|
|
1787
|
-
"settings.guardGlobalCap": "Slow-burn step count",
|
|
1788
|
-
"settings.guardGlobalCapHint": "Consecutive output-free steps of real reasoning that fire the slow-burn ladder (default 4; lower is more sensitive — raise it for genuinely long investigations).",
|
|
1789
|
-
"settings.guardSensitivity": "Breaker sensitivity",
|
|
1790
|
-
"settings.guardSensitivityHint": "Scales every breaker threshold: conservative (fewer interruptions, x1.5), balanced (the calibrated defaults), aggressive (fires earlier, x0.5). Thresholds adapt to the reasoning effort: 8000 at max / 12000 at high / 20000 at low.",
|
|
1791
|
-
"sensitivity.conservative": "Conservative (fewer interruptions)",
|
|
1792
|
-
"sensitivity.balanced": "Balanced (default)",
|
|
1793
|
-
"sensitivity.aggressive": "Aggressive (fires earlier)",
|
|
1794
|
-
"settings.guardEchoFailures": "Identical-argument failures",
|
|
1795
|
-
"settings.guardEchoFailuresHint": "Identical-argument failures of the same tool in a row that fire the echo ladder (default 3)."
|
|
1644
|
+
"presentation.native": "native (native tool roster)"
|
|
1796
1645
|
};
|
|
1797
1646
|
//#endregion
|
|
1798
1647
|
//#region src/client/plugin-card-seat.ts
|
|
@@ -1898,11 +1747,13 @@ window.__ModuleLoader__.load({
|
|
|
1898
1747
|
...seat.order === void 0 ? {} : { order: seat.order },
|
|
1899
1748
|
...seat.label === void 0 ? {} : { label: seat.label },
|
|
1900
1749
|
locale: seat.locale,
|
|
1750
|
+
...seat.children === void 0 ? {} : { children: seat.children },
|
|
1901
1751
|
...seat.inject === void 0 ? {} : { inject }
|
|
1902
1752
|
} : {
|
|
1903
1753
|
name: OFFICIAL_PLUGIN_CARD_SEAT,
|
|
1904
1754
|
key: seat.bundle,
|
|
1905
1755
|
locale: seat.locale,
|
|
1756
|
+
...seat.children === void 0 ? {} : { children: seat.children },
|
|
1906
1757
|
...seat.inject === void 0 ? {} : { inject }
|
|
1907
1758
|
}, component);
|
|
1908
1759
|
current = target;
|
|
@@ -1929,8 +1780,7 @@ window.__ModuleLoader__.load({
|
|
|
1929
1780
|
base: void 0,
|
|
1930
1781
|
user: void 0,
|
|
1931
1782
|
revision: void 0,
|
|
1932
|
-
writable: false
|
|
1933
|
-
mode: "host"
|
|
1783
|
+
writable: false
|
|
1934
1784
|
};
|
|
1935
1785
|
}
|
|
1936
1786
|
/**
|