better-dsh 0.2.3-e → 0.2.3-g
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/docs/50_test-reports/2026-09-13-preact-ui-shell/345/256/236/346/265/213/346/212/245/345/221/212.md +1 -1
- package/docs/50_test-reports/2026-09-14-4999-skill/346/270/205/345/215/225/344/270/216lsp-gate/345/256/236/346/265/213/346/212/245/345/221/212.md +54 -0
- package/docs/specs/agent/spec.md +54 -0
- package/docs/specs/ast/spec.md +34 -0
- package/docs/specs/compaction-recall/spec.md +46 -0
- package/docs/specs/ctx/spec.md +107 -0
- package/docs/specs/dsh/spec.md +47 -0
- package/docs/specs/dvc/spec.md +87 -0
- package/docs/specs/escalation-guidance/spec.md +44 -0
- package/docs/specs/fs-scheme-resolution/spec.md +37 -0
- package/docs/specs/hash-edit/spec.md +41 -0
- package/docs/specs/http-read/spec.md +73 -0
- package/docs/specs/kernel-provisioning/spec.md +53 -0
- package/docs/specs/lsp/spec.md +121 -0
- package/docs/specs/mobile-layout/spec.md +108 -0
- package/docs/specs/model-failover/spec.md +20 -0
- package/docs/specs/preact-ui-shell/spec.md +22 -0
- package/docs/specs/repl-dispatch-resilience/spec.md +21 -0
- package/docs/specs/skill/spec.md +58 -0
- package/docs/specs/tool-surface/spec.md +222 -0
- package/docs/specs/url-schema/spec.md +148 -0
- package/docs/specs/web-trust-fence/spec.md +43 -0
- package/dsh-docs/AGENTS.md +75 -0
- package/dsh-docs/agent-lifecycle.md +84 -0
- package/dsh-docs/agent-lifecycle.zh.md +86 -0
- package/dsh-docs/api-gateway.md +164 -0
- package/dsh-docs/api-gateway.zh.md +164 -0
- package/dsh-docs/architecture.md +150 -0
- package/dsh-docs/architecture.zh.md +154 -0
- package/dsh-docs/capability-seams.md +543 -0
- package/dsh-docs/capability-seams.zh.md +545 -0
- package/dsh-docs/config-catalog.md +3473 -0
- package/dsh-docs/config-catalog.zh.md +3474 -0
- package/dsh-docs/cookbook/adding-a-package.md +117 -0
- package/dsh-docs/cookbook/adding-a-package.zh.md +119 -0
- package/dsh-docs/cookbook/adding-a-remote-api.md +197 -0
- package/dsh-docs/cookbook/adding-a-remote-api.zh.md +197 -0
- package/dsh-docs/cookbook/adding-a-settings-card.md +102 -0
- package/dsh-docs/cookbook/adding-a-settings-card.zh.md +102 -0
- package/dsh-docs/cookbook/adding-a-tool.md +101 -0
- package/dsh-docs/cookbook/adding-a-tool.zh.md +103 -0
- package/dsh-docs/cookbook/adding-a-vendored-package.md +59 -0
- package/dsh-docs/cookbook/adding-a-vendored-package.zh.md +59 -0
- package/dsh-docs/cookbook/adding-an-llm-adapter.md +43 -0
- package/dsh-docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
- package/dsh-docs/cookbook/extension-cookbook.md +132 -0
- package/dsh-docs/cookbook/extension-cookbook.zh.md +136 -0
- package/dsh-docs/cookbook/maintaining-dsh-code-review.md +64 -0
- package/dsh-docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
- package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
- package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
- package/dsh-docs/cordis-api/context.md +364 -0
- package/dsh-docs/cordis-api/context.zh.md +366 -0
- package/dsh-docs/cordis-api/events.md +207 -0
- package/dsh-docs/cordis-api/events.zh.md +209 -0
- package/dsh-docs/cordis-api/fiber.md +375 -0
- package/dsh-docs/cordis-api/fiber.zh.md +377 -0
- package/dsh-docs/cordis-api/inherited.md +39 -0
- package/dsh-docs/cordis-api/registry.md +152 -0
- package/dsh-docs/cordis-api/registry.zh.md +154 -0
- package/dsh-docs/cordis-api/service.md +102 -0
- package/dsh-docs/cordis-api/service.zh.md +104 -0
- package/dsh-docs/cordis-primer.md +45 -0
- package/dsh-docs/cordis-primer.zh.md +51 -0
- package/dsh-docs/cordis-tutorial/01-first-plugin.md +95 -0
- package/dsh-docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
- package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
- package/dsh-docs/cordis-tutorial/03-services.md +98 -0
- package/dsh-docs/cordis-tutorial/03-services.zh.md +98 -0
- package/dsh-docs/cordis-tutorial/04-events.md +144 -0
- package/dsh-docs/cordis-tutorial/04-events.zh.md +144 -0
- package/dsh-docs/cordis-tutorial/05-config.md +84 -0
- package/dsh-docs/cordis-tutorial/05-config.zh.md +84 -0
- package/dsh-docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/dsh-docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
- package/dsh-docs/cordis-tutorial/07-into-the-harness.md +108 -0
- package/dsh-docs/cordis-tutorial/07-into-the-harness.zh.md +108 -0
- package/dsh-docs/cordis-tutorial/index.md +60 -0
- package/dsh-docs/cordis-tutorial/index.zh.md +62 -0
- package/dsh-docs/deepseek-llm-api-wire-extensions.md +163 -0
- package/dsh-docs/deepseek-llm-api-wire-extensions.zh.md +163 -0
- package/dsh-docs/defensive-patterns.md +33 -0
- package/dsh-docs/defensive-patterns.zh.md +35 -0
- package/dsh-docs/development.md +167 -0
- package/dsh-docs/development.zh.md +173 -0
- package/dsh-docs/event-producer-consumer.md +86 -0
- package/dsh-docs/event-producer-consumer.zh.md +88 -0
- package/dsh-docs/glossary.md +45 -0
- package/dsh-docs/glossary.zh.md +45 -0
- package/dsh-docs/graph-atlas.md +22 -0
- package/dsh-docs/graph-atlas.zh.md +24 -0
- package/dsh-docs/i18n/README.md +60 -0
- package/dsh-docs/i18n/README.zh.md +62 -0
- package/dsh-docs/i18n/style-samples.md +87 -0
- package/dsh-docs/i18n/terminology.md +214 -0
- package/dsh-docs/i18n/translation-prompt.md +263 -0
- package/dsh-docs/i18n/translation-rules.md +69 -0
- package/dsh-docs/i18n/translation-rules.zh.md +69 -0
- package/dsh-docs/module-graph.md +1411 -0
- package/dsh-docs/module-graph.zh.md +1413 -0
- package/dsh-docs/persistence-catalog.md +1075 -0
- package/dsh-docs/persistence-catalog.zh.md +1077 -0
- package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
- package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
- package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
- package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
- package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
- package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
- package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
- package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
- package/dsh-docs/postmortem/README.md +18 -0
- package/dsh-docs/postmortem/README.zh.md +18 -0
- package/dsh-docs/rescope.md +53 -0
- package/dsh-docs/rescope.zh.md +53 -0
- package/dsh-docs/subsystems/README.md +61 -0
- package/dsh-docs/subsystems/README.zh.md +61 -0
- package/dsh-docs/subsystems/agent-team.md +207 -0
- package/dsh-docs/subsystems/agent-team.zh.md +207 -0
- package/dsh-docs/subsystems/approval.md +170 -0
- package/dsh-docs/subsystems/approval.zh.md +170 -0
- package/dsh-docs/subsystems/attachment.md +351 -0
- package/dsh-docs/subsystems/attachment.zh.md +351 -0
- package/dsh-docs/subsystems/client-modules.md +168 -0
- package/dsh-docs/subsystems/client-modules.zh.md +168 -0
- package/dsh-docs/subsystems/code-runtime.md +195 -0
- package/dsh-docs/subsystems/code-runtime.zh.md +195 -0
- package/dsh-docs/subsystems/commands.md +219 -0
- package/dsh-docs/subsystems/commands.zh.md +219 -0
- package/dsh-docs/subsystems/compaction.md +238 -0
- package/dsh-docs/subsystems/compaction.zh.md +238 -0
- package/dsh-docs/subsystems/conversation.md +258 -0
- package/dsh-docs/subsystems/conversation.zh.md +258 -0
- package/dsh-docs/subsystems/core.md +1209 -0
- package/dsh-docs/subsystems/core.zh.md +1219 -0
- package/dsh-docs/subsystems/credentials.md +329 -0
- package/dsh-docs/subsystems/credentials.zh.md +329 -0
- package/dsh-docs/subsystems/extensions.md +382 -0
- package/dsh-docs/subsystems/extensions.zh.md +382 -0
- package/dsh-docs/subsystems/feedback.md +266 -0
- package/dsh-docs/subsystems/feedback.zh.md +266 -0
- package/dsh-docs/subsystems/filesystem.md +505 -0
- package/dsh-docs/subsystems/filesystem.zh.md +505 -0
- package/dsh-docs/subsystems/goal.md +277 -0
- package/dsh-docs/subsystems/goal.zh.md +277 -0
- package/dsh-docs/subsystems/invariants.md +88 -0
- package/dsh-docs/subsystems/invariants.zh.md +88 -0
- package/dsh-docs/subsystems/jobs.md +290 -0
- package/dsh-docs/subsystems/jobs.zh.md +290 -0
- package/dsh-docs/subsystems/llm-streaming.md +1080 -0
- package/dsh-docs/subsystems/llm-streaming.zh.md +1086 -0
- package/dsh-docs/subsystems/lsp.md +202 -0
- package/dsh-docs/subsystems/lsp.zh.md +202 -0
- package/dsh-docs/subsystems/permission-presets.md +131 -0
- package/dsh-docs/subsystems/permission-presets.zh.md +131 -0
- package/dsh-docs/subsystems/persistence.md +395 -0
- package/dsh-docs/subsystems/persistence.zh.md +395 -0
- package/dsh-docs/subsystems/plan.md +87 -0
- package/dsh-docs/subsystems/plan.zh.md +87 -0
- package/dsh-docs/subsystems/sandbox.md +220 -0
- package/dsh-docs/subsystems/sandbox.zh.md +220 -0
- package/dsh-docs/subsystems/schedule.md +192 -0
- package/dsh-docs/subsystems/schedule.zh.md +192 -0
- package/dsh-docs/subsystems/scope.md +59 -0
- package/dsh-docs/subsystems/scope.zh.md +59 -0
- package/dsh-docs/subsystems/session-projection.md +354 -0
- package/dsh-docs/subsystems/session-projection.zh.md +354 -0
- package/dsh-docs/subsystems/session-query.md +509 -0
- package/dsh-docs/subsystems/session-query.zh.md +509 -0
- package/dsh-docs/subsystems/session-reference.md +219 -0
- package/dsh-docs/subsystems/session-reference.zh.md +219 -0
- package/dsh-docs/subsystems/session-telemetry.md +194 -0
- package/dsh-docs/subsystems/session-telemetry.zh.md +194 -0
- package/dsh-docs/subsystems/session-title.md +204 -0
- package/dsh-docs/subsystems/session-title.zh.md +204 -0
- package/dsh-docs/subsystems/session.md +1155 -0
- package/dsh-docs/subsystems/session.zh.md +1159 -0
- package/dsh-docs/subsystems/settings.md +405 -0
- package/dsh-docs/subsystems/settings.zh.md +405 -0
- package/dsh-docs/subsystems/shell.md +303 -0
- package/dsh-docs/subsystems/shell.zh.md +303 -0
- package/dsh-docs/subsystems/skills.md +354 -0
- package/dsh-docs/subsystems/skills.zh.md +354 -0
- package/dsh-docs/subsystems/slots.md +175 -0
- package/dsh-docs/subsystems/slots.zh.md +175 -0
- package/dsh-docs/subsystems/spill.md +117 -0
- package/dsh-docs/subsystems/spill.zh.md +117 -0
- package/dsh-docs/subsystems/storage.md +260 -0
- package/dsh-docs/subsystems/storage.zh.md +260 -0
- package/dsh-docs/subsystems/subagent.md +766 -0
- package/dsh-docs/subsystems/subagent.zh.md +770 -0
- package/dsh-docs/subsystems/subprocess.md +324 -0
- package/dsh-docs/subsystems/subprocess.zh.md +324 -0
- package/dsh-docs/subsystems/system-prompt.md +220 -0
- package/dsh-docs/subsystems/system-prompt.zh.md +220 -0
- package/dsh-docs/subsystems/terminal.md +184 -0
- package/dsh-docs/subsystems/terminal.zh.md +184 -0
- package/dsh-docs/subsystems/todo.md +32 -0
- package/dsh-docs/subsystems/todo.zh.md +32 -0
- package/dsh-docs/subsystems/token-meter.md +105 -0
- package/dsh-docs/subsystems/token-meter.zh.md +105 -0
- package/dsh-docs/subsystems/tools.md +720 -0
- package/dsh-docs/subsystems/tools.zh.md +720 -0
- package/dsh-docs/subsystems/typert.md +343 -0
- package/dsh-docs/subsystems/typert.zh.md +343 -0
- package/dsh-docs/subsystems/user-questions.md +178 -0
- package/dsh-docs/subsystems/user-questions.zh.md +178 -0
- package/dsh-docs/subsystems/web-client.md +95 -0
- package/dsh-docs/subsystems/web-client.zh.md +95 -0
- package/dsh-docs/subsystems/web-server.md +154 -0
- package/dsh-docs/subsystems/web-server.zh.md +154 -0
- package/dsh-docs/subsystems/web.md +206 -0
- package/dsh-docs/subsystems/web.zh.md +206 -0
- package/dsh-docs/subsystems/webhook.md +70 -0
- package/dsh-docs/subsystems/webhook.zh.md +70 -0
- package/dsh-docs/subsystems/workflow.md +278 -0
- package/dsh-docs/subsystems/workflow.zh.md +278 -0
- package/dsh-docs/subsystems/workspace.md +321 -0
- package/dsh-docs/subsystems/workspace.zh.md +321 -0
- package/dsh-docs/testing.md +54 -0
- package/dsh-docs/testing.zh.md +54 -0
- package/dsh-docs/tool-catalog.md +2225 -0
- package/dsh-docs/tool-catalog.zh.md +2233 -0
- package/dsh-docs/tool-execution-pipeline.md +62 -0
- package/dsh-docs/tool-execution-pipeline.zh.md +64 -0
- package/dsh-docs/user/develop/basic/config.md +106 -0
- package/dsh-docs/user/develop/basic/config.zh.md +106 -0
- package/dsh-docs/user/develop/basic/index.md +144 -0
- package/dsh-docs/user/develop/basic/index.zh.md +144 -0
- package/dsh-docs/user/develop/basic/publish.md +183 -0
- package/dsh-docs/user/develop/basic/publish.zh.md +183 -0
- package/dsh-docs/user/develop/basic/tool.md +52 -0
- package/dsh-docs/user/develop/basic/tool.zh.md +52 -0
- package/dsh-docs/user/develop/framework/events.md +143 -0
- package/dsh-docs/user/develop/framework/events.zh.md +143 -0
- package/dsh-docs/user/develop/framework/index.md +137 -0
- package/dsh-docs/user/develop/framework/index.zh.md +137 -0
- package/dsh-docs/user/develop/framework/service.md +148 -0
- package/dsh-docs/user/develop/framework/service.zh.md +150 -0
- package/dsh-docs/user/develop/practice/dynamic-cordis.md +15 -0
- package/dsh-docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
- package/dsh-docs/user/develop/practice/index.md +155 -0
- package/dsh-docs/user/develop/practice/index.zh.md +155 -0
- package/dsh-docs/user/develop/practice/llm-adapter.md +189 -0
- package/dsh-docs/user/develop/practice/llm-adapter.zh.md +189 -0
- package/dsh-docs/user/guide/github-review.md +102 -0
- package/dsh-docs/user/guide/github-review.zh.md +102 -0
- package/dsh-docs/user/guide/index.md +30 -0
- package/dsh-docs/user/guide/index.zh.md +30 -0
- package/dsh-docs/user/guide/mcp-memory.md +101 -0
- package/dsh-docs/user/guide/mcp-memory.zh.md +101 -0
- package/dsh-docs/user/guide/network-proxy.md +85 -0
- package/dsh-docs/user/guide/network-proxy.zh.md +85 -0
- package/dsh-docs/user/guide/providers.md +190 -0
- package/dsh-docs/user/guide/providers.zh.md +190 -0
- package/dsh-docs/user/guide/python-sdk.md +150 -0
- package/dsh-docs/user/guide/python-sdk.zh.md +150 -0
- package/dsh-docs/user/guide/schedule.md +21 -0
- package/dsh-docs/user/guide/schedule.zh.md +21 -0
- package/dsh-docs/user/index.md +11 -0
- package/dsh-docs/user/index.zh.md +11 -0
- package/dsh-docs/web-styling.md +29 -0
- package/dsh-docs/web-styling.zh.md +29 -0
- package/lib/client/index.js +268 -38
- package/lib/fs-aware/sandbox-plugin.js +1 -1
- package/lib/index.js +1112 -1261
- package/lib/lsp-server-registry-B8DNonhS.js +3 -0
- package/lib/lsp-server-registry-BexQagaK.js +943 -0
- package/lib/{wrap-DC8O3SYz.js → wrap-JFjcWwZf.js} +42 -16
- package/package.json +2 -1
package/lib/client/index.js
CHANGED
|
@@ -27,6 +27,8 @@ let react = require("react");
|
|
|
27
27
|
react = __toESM(react);
|
|
28
28
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
react_jsx_runtime = __toESM(react_jsx_runtime);
|
|
30
|
+
let __deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
31
|
+
__deepseek_ai_dsh_client_ui_primitives = __toESM(__deepseek_ai_dsh_client_ui_primitives);
|
|
30
32
|
|
|
31
33
|
//#region src/failover/config.ts
|
|
32
34
|
/**
|
|
@@ -70,21 +72,20 @@ const zh = {
|
|
|
70
72
|
|
|
71
73
|
//#endregion
|
|
72
74
|
//#region \0dsh-css:/home/u1/workspaces/dashr/dashr/src/failover/client/FailoverRow.module.css.mjs
|
|
73
|
-
const css = "._440e1d7b_row {\n display: flex;\n
|
|
74
|
-
const tagId = "better-dsh/FailoverRow.module.css";
|
|
75
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
75
|
+
const css$1 = "\n._440e1d7b_row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 0;\n}\n\n._a4f2ceec_rowText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n._9865b509_title {\n font-weight: 600;\n font-size: 14px;\n}\n\n\n._3cfec826_slots {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 6px;\n}\n\n._11c2662d_select {\n width: 280px;\n max-width: 100%;\n min-width: 0;\n}\n\n._b7c358f9_alert {\n color: var(--dsw-alias-danger, #c0392b);\n font-size: 12px;\n}\n";
|
|
76
|
+
const tagId$1 = "better-dsh/FailoverRow.module.css";
|
|
77
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
76
78
|
const tag = document.createElement("style");
|
|
77
79
|
tag.dataset.plugin = "better-dsh";
|
|
78
|
-
tag.dataset.pluginCss = tagId;
|
|
79
|
-
tag.textContent = css;
|
|
80
|
+
tag.dataset.pluginCss = tagId$1;
|
|
81
|
+
tag.textContent = css$1;
|
|
80
82
|
document.head.appendChild(tag);
|
|
81
83
|
}
|
|
82
84
|
var FailoverRow_module_css_default = {
|
|
83
85
|
"row": "_440e1d7b_row",
|
|
86
|
+
"rowText": "_a4f2ceec_rowText",
|
|
84
87
|
"title": "_9865b509_title",
|
|
85
88
|
"slots": "_3cfec826_slots",
|
|
86
|
-
"slot": "_70954771_slot",
|
|
87
|
-
"slotLabel": "_ba1fd839_slotLabel",
|
|
88
89
|
"select": "_11c2662d_select",
|
|
89
90
|
"alert": "_b7c358f9_alert"
|
|
90
91
|
};
|
|
@@ -139,47 +140,40 @@ function FailoverRow({ catalog, loadConfig, save, t }) {
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
const routes = loaded?.routes ?? [];
|
|
142
|
-
const renderSelect = (slot
|
|
143
|
+
const renderSelect = (slot) => {
|
|
143
144
|
const value = loaded?.config[slot] ?? "";
|
|
144
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
145
|
-
className: FailoverRow_module_css_default.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
children:
|
|
157
|
-
|
|
158
|
-
children: t("not-set")
|
|
159
|
-
}), routes.map((route) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
160
|
-
value: route,
|
|
161
|
-
children: route
|
|
162
|
-
}, route))]
|
|
163
|
-
})]
|
|
145
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
146
|
+
className: FailoverRow_module_css_default.select,
|
|
147
|
+
value,
|
|
148
|
+
disabled: saving || loaded === null,
|
|
149
|
+
onChange: (event) => {
|
|
150
|
+
select(slot, event.target.value);
|
|
151
|
+
},
|
|
152
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
153
|
+
value: "",
|
|
154
|
+
children: t("not-set")
|
|
155
|
+
}), routes.map((route) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
156
|
+
value: route,
|
|
157
|
+
children: route
|
|
158
|
+
}, route))]
|
|
164
159
|
});
|
|
165
160
|
};
|
|
166
161
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
167
162
|
className: FailoverRow_module_css_default.row,
|
|
168
|
-
children: [
|
|
169
|
-
|
|
163
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
164
|
+
className: FailoverRow_module_css_default.rowText,
|
|
165
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
170
166
|
className: FailoverRow_module_css_default.title,
|
|
171
167
|
children: t("title")
|
|
172
|
-
}),
|
|
173
|
-
error !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
168
|
+
}), error !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
174
169
|
className: FailoverRow_module_css_default.alert,
|
|
175
170
|
role: "alert",
|
|
176
171
|
children: t("error", { message: error })
|
|
177
|
-
}) : null
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]
|
|
172
|
+
}) : null]
|
|
173
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
174
|
+
className: FailoverRow_module_css_default.slots,
|
|
175
|
+
children: [renderSelect("fallback1"), renderSelect("fallback2")]
|
|
176
|
+
})]
|
|
183
177
|
});
|
|
184
178
|
}
|
|
185
179
|
|
|
@@ -421,6 +415,241 @@ function setupMobileLayout(ctx) {
|
|
|
421
415
|
}, "dashr: mobile layout");
|
|
422
416
|
}
|
|
423
417
|
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/compaction/config.ts
|
|
420
|
+
/**
|
|
421
|
+
* The `compaction-tuning` General-row config: the share of the routed context
|
|
422
|
+
* window at which automatic condensation starts.
|
|
423
|
+
*
|
|
424
|
+
* Pure module — no `@deepseek-ai/*` value imports — so the host half and the
|
|
425
|
+
* client half may both import it without dragging either runtime into the
|
|
426
|
+
* browser bundle: the host takes the namespace and the schema defaults, the
|
|
427
|
+
* client takes the namespace literal plus the stepper bounds.
|
|
428
|
+
*
|
|
429
|
+
* @module dashr/compaction/config
|
|
430
|
+
*/
|
|
431
|
+
/** The settings namespace the General row reads and writes. */
|
|
432
|
+
const COMPACTION_SETTINGS_NS = "compaction-tuning";
|
|
433
|
+
/** Upstream `compaction-basic`'s own default: condense at 80% of the window. */
|
|
434
|
+
const DEFAULT_THRESHOLD_RATIO = .8;
|
|
435
|
+
/** Whole-percent bounds for the General row's stepper. */
|
|
436
|
+
const THRESHOLD_MIN_PERCENT = 10;
|
|
437
|
+
/** @see THRESHOLD_MIN_PERCENT */
|
|
438
|
+
const THRESHOLD_MAX_PERCENT = 95;
|
|
439
|
+
/** Percent moved per arrow click (a stepper cannot express an arbitrary value). */
|
|
440
|
+
const THRESHOLD_STEP_PERCENT = 5;
|
|
441
|
+
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region src/compaction/client/locales.ts
|
|
444
|
+
/**
|
|
445
|
+
* Client locale dictionary for the compaction General row.
|
|
446
|
+
* @module dashr/compaction/client/locales
|
|
447
|
+
*/
|
|
448
|
+
const en$1 = {
|
|
449
|
+
"title": "Auto-compact threshold",
|
|
450
|
+
"description": "Only affects automatic condensation",
|
|
451
|
+
"unit": "%",
|
|
452
|
+
"increase": "Increase auto-compact threshold",
|
|
453
|
+
"decrease": "Decrease auto-compact threshold",
|
|
454
|
+
"error": "Save failed: {{message}}"
|
|
455
|
+
};
|
|
456
|
+
const zh$1 = {
|
|
457
|
+
"title": "自动压缩阈值",
|
|
458
|
+
"description": "仅影响自动压缩",
|
|
459
|
+
"unit": "%",
|
|
460
|
+
"increase": "提高自动压缩阈值",
|
|
461
|
+
"decrease": "降低自动压缩阈值",
|
|
462
|
+
"error": "保存失败:{{message}}"
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region \0dsh-css:/home/u1/workspaces/dashr/dashr/src/compaction/client/CompactionRow.module.css.mjs
|
|
467
|
+
const css = "\n\n\n._13e3747c_thresholdRow {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 16px 0;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n._8ad3ff3f_thresholdText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding-right: 48px;\n}\n\n._9ffb627e_thresholdTitle {\n font-size: 14px;\n font-weight: 400;\n line-height: 22px;\n color: var(--dsw-alias-label-primary);\n}\n\n._01bea389_thresholdDesc {\n font-size: 12px;\n font-weight: 400;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n._7f9578de_thresholdError {\n font-size: 12px;\n font-weight: 400;\n line-height: 18px;\n color: var(--dsw-alias-danger, #c0392b);\n}\n\n\n._cddd78cd_thresholdControl {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n._6058fea9_thresholdStepper {\n position: relative; \n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 72px;\n height: 36px;\n border-radius: 18px;\n background: var(--dsw-alias-bg-module-platform);\n}\n\n._39d30469_thresholdValue {\n min-width: 18px;\n text-align: center;\n font-size: 14px;\n line-height: 22px;\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-primary);\n}\n\n._68bd35c6_thresholdUnit {\n font-size: 14px;\n line-height: 22px;\n color: var(--dsw-alias-label-secondary);\n}\n\n\n._904da366_thresholdArrows {\n position: absolute;\n right: 8px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n opacity: 0;\n}\n\n._6058fea9_thresholdStepper:hover ._904da366_thresholdArrows,\n._6058fea9_thresholdStepper:focus-within ._904da366_thresholdArrows {\n opacity: 1;\n}\n\n\n._ae9106b1_thresholdArrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 17px;\n height: 12px;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 75%, transparent);\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n}\n\n._ae9106b1_thresholdArrow:hover:not(:disabled) {\n background: var(--dsw-alias-bg-layer-1);\n}\n\n._ae9106b1_thresholdArrow:disabled {\n color: var(--dsw-alias-label-caption);\n cursor: default;\n}\n";
|
|
468
|
+
const tagId = "better-dsh/CompactionRow.module.css";
|
|
469
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
470
|
+
const tag = document.createElement("style");
|
|
471
|
+
tag.dataset.plugin = "better-dsh";
|
|
472
|
+
tag.dataset.pluginCss = tagId;
|
|
473
|
+
tag.textContent = css;
|
|
474
|
+
document.head.appendChild(tag);
|
|
475
|
+
}
|
|
476
|
+
var CompactionRow_module_css_default = {
|
|
477
|
+
"thresholdRow": "_13e3747c_thresholdRow",
|
|
478
|
+
"thresholdText": "_8ad3ff3f_thresholdText",
|
|
479
|
+
"thresholdTitle": "_9ffb627e_thresholdTitle",
|
|
480
|
+
"thresholdDesc": "_01bea389_thresholdDesc",
|
|
481
|
+
"thresholdError": "_7f9578de_thresholdError",
|
|
482
|
+
"thresholdControl": "_cddd78cd_thresholdControl",
|
|
483
|
+
"thresholdStepper": "_6058fea9_thresholdStepper",
|
|
484
|
+
"thresholdValue": "_39d30469_thresholdValue",
|
|
485
|
+
"thresholdUnit": "_68bd35c6_thresholdUnit",
|
|
486
|
+
"thresholdArrows": "_904da366_thresholdArrows",
|
|
487
|
+
"thresholdArrow": "_ae9106b1_thresholdArrow"
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region src/compaction/client/CompactionRow.tsx
|
|
492
|
+
/** Render the compaction-threshold row. */
|
|
493
|
+
function CompactionRow({ t, loadConfig, save }) {
|
|
494
|
+
const [percent, setPercent] = (0, react.useState)(null);
|
|
495
|
+
const [absent, setAbsent] = (0, react.useState)(false);
|
|
496
|
+
const [error, setError] = (0, react.useState)(null);
|
|
497
|
+
const revisionRef = (0, react.useRef)(void 0);
|
|
498
|
+
const pendingRef = (0, react.useRef)(null);
|
|
499
|
+
const inFlightRef = (0, react.useRef)(false);
|
|
500
|
+
(0, react.useEffect)(() => {
|
|
501
|
+
let alive = true;
|
|
502
|
+
(async () => {
|
|
503
|
+
try {
|
|
504
|
+
const current = await loadConfig();
|
|
505
|
+
if (!alive) return;
|
|
506
|
+
if (current === null) {
|
|
507
|
+
setAbsent(true);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
revisionRef.current = current.revision;
|
|
511
|
+
setPercent(Math.round(current.thresholdRatio * 100));
|
|
512
|
+
} catch (err) {
|
|
513
|
+
if (alive) setError(err instanceof Error ? err.message : String(err));
|
|
514
|
+
}
|
|
515
|
+
})();
|
|
516
|
+
return () => {
|
|
517
|
+
alive = false;
|
|
518
|
+
};
|
|
519
|
+
}, [loadConfig]);
|
|
520
|
+
/** Write the newest pending step; the revision always comes from the last commit. */
|
|
521
|
+
const flush = () => {
|
|
522
|
+
if (inFlightRef.current || pendingRef.current === null) return;
|
|
523
|
+
const next = pendingRef.current;
|
|
524
|
+
pendingRef.current = null;
|
|
525
|
+
inFlightRef.current = true;
|
|
526
|
+
save({ thresholdRatio: next / 100 }, revisionRef.current).then((revision) => {
|
|
527
|
+
revisionRef.current = revision;
|
|
528
|
+
inFlightRef.current = false;
|
|
529
|
+
setError(null);
|
|
530
|
+
flush();
|
|
531
|
+
}, (err) => {
|
|
532
|
+
inFlightRef.current = false;
|
|
533
|
+
pendingRef.current = null;
|
|
534
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
535
|
+
(async () => {
|
|
536
|
+
try {
|
|
537
|
+
const current = await loadConfig();
|
|
538
|
+
if (current === null) return;
|
|
539
|
+
revisionRef.current = current.revision;
|
|
540
|
+
setPercent(Math.round(current.thresholdRatio * 100));
|
|
541
|
+
} catch {}
|
|
542
|
+
})();
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
const step = (delta) => {
|
|
546
|
+
if (percent === null) return;
|
|
547
|
+
const next = Math.min(THRESHOLD_MAX_PERCENT, Math.max(THRESHOLD_MIN_PERCENT, percent + delta));
|
|
548
|
+
if (next === percent) return;
|
|
549
|
+
setPercent(next);
|
|
550
|
+
setError(null);
|
|
551
|
+
pendingRef.current = next;
|
|
552
|
+
flush();
|
|
553
|
+
};
|
|
554
|
+
if (absent) return null;
|
|
555
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
556
|
+
className: CompactionRow_module_css_default.thresholdRow,
|
|
557
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
558
|
+
className: CompactionRow_module_css_default.thresholdText,
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
561
|
+
className: CompactionRow_module_css_default.thresholdTitle,
|
|
562
|
+
children: t("title")
|
|
563
|
+
}),
|
|
564
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
565
|
+
className: CompactionRow_module_css_default.thresholdDesc,
|
|
566
|
+
children: t("description")
|
|
567
|
+
}),
|
|
568
|
+
error !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
569
|
+
className: CompactionRow_module_css_default.thresholdError,
|
|
570
|
+
children: t("error", { message: error })
|
|
571
|
+
}) : null
|
|
572
|
+
]
|
|
573
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
574
|
+
className: CompactionRow_module_css_default.thresholdControl,
|
|
575
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
576
|
+
className: CompactionRow_module_css_default.thresholdStepper,
|
|
577
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
578
|
+
className: CompactionRow_module_css_default.thresholdValue,
|
|
579
|
+
children: percent === null ? "–" : String(percent)
|
|
580
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
581
|
+
className: CompactionRow_module_css_default.thresholdArrows,
|
|
582
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
583
|
+
type: "button",
|
|
584
|
+
className: CompactionRow_module_css_default.thresholdArrow,
|
|
585
|
+
"aria-label": t("increase"),
|
|
586
|
+
disabled: percent === null || percent >= THRESHOLD_MAX_PERCENT,
|
|
587
|
+
onClick: () => {
|
|
588
|
+
step(THRESHOLD_STEP_PERCENT);
|
|
589
|
+
},
|
|
590
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutline14, { size: 9 })
|
|
591
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
592
|
+
type: "button",
|
|
593
|
+
className: CompactionRow_module_css_default.thresholdArrow,
|
|
594
|
+
"aria-label": t("decrease"),
|
|
595
|
+
disabled: percent === null || percent <= THRESHOLD_MIN_PERCENT,
|
|
596
|
+
onClick: () => {
|
|
597
|
+
step(-THRESHOLD_STEP_PERCENT);
|
|
598
|
+
},
|
|
599
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 9 })
|
|
600
|
+
})]
|
|
601
|
+
})]
|
|
602
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
603
|
+
className: CompactionRow_module_css_default.thresholdUnit,
|
|
604
|
+
children: t("unit")
|
|
605
|
+
})]
|
|
606
|
+
})]
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/compaction/client/index.ts
|
|
612
|
+
/**
|
|
613
|
+
* Register the dictionaries and the General settings row.
|
|
614
|
+
*
|
|
615
|
+
* Called from the plugin's client entry, which already injects `locale`,
|
|
616
|
+
* `slots` and `remote.settings`.
|
|
617
|
+
*
|
|
618
|
+
* @param ctx - client root context.
|
|
619
|
+
*/
|
|
620
|
+
function setupCompactionRow(ctx) {
|
|
621
|
+
ctx.effect(() => ctx.locale.register(COMPACTION_SETTINGS_NS, {
|
|
622
|
+
zh: zh$1,
|
|
623
|
+
en: en$1
|
|
624
|
+
}), "compaction-tuning: dictionaries");
|
|
625
|
+
ctx.slots.inject("settings.general.item", function* () {
|
|
626
|
+
yield ctx.slots.register({
|
|
627
|
+
name: "settings.general.item",
|
|
628
|
+
id: COMPACTION_SETTINGS_NS,
|
|
629
|
+
order: 110,
|
|
630
|
+
locale: COMPACTION_SETTINGS_NS,
|
|
631
|
+
inject: () => ({
|
|
632
|
+
loadConfig: async () => {
|
|
633
|
+
const response = await ctx.remote.settings.describe();
|
|
634
|
+
if (!response.ok) throw new Error(`${response.error.code}: ${response.error.message}`);
|
|
635
|
+
const view = response.value.namespaces.find((entry) => entry.ns === COMPACTION_SETTINGS_NS);
|
|
636
|
+
if (view === void 0) return null;
|
|
637
|
+
const value = view.value;
|
|
638
|
+
return {
|
|
639
|
+
thresholdRatio: typeof value.thresholdRatio === "number" ? value.thresholdRatio : DEFAULT_THRESHOLD_RATIO,
|
|
640
|
+
revision: view.revision
|
|
641
|
+
};
|
|
642
|
+
},
|
|
643
|
+
save: async (patch, revision) => {
|
|
644
|
+
const response = await ctx.remote.settings.update(COMPACTION_SETTINGS_NS, patch, revision);
|
|
645
|
+
if (!response.ok) throw new Error(`${response.error.code}: ${response.error.message}`);
|
|
646
|
+
return response.value.revision;
|
|
647
|
+
}
|
|
648
|
+
})
|
|
649
|
+
}, CompactionRow);
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
|
|
424
653
|
//#endregion
|
|
425
654
|
//#region src/failover/client/index.ts
|
|
426
655
|
/** Required services (cordis fiber inject). */
|
|
@@ -441,6 +670,7 @@ function apply(ctx) {
|
|
|
441
670
|
en
|
|
442
671
|
}), "llm-failover: dictionaries");
|
|
443
672
|
setupMobileLayout(ctx);
|
|
673
|
+
setupCompactionRow(ctx);
|
|
444
674
|
ctx.slots.inject("settings.general.item", function* () {
|
|
445
675
|
yield ctx.slots.register({
|
|
446
676
|
name: "settings.general.item",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-
|
|
1
|
+
import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-JFjcWwZf.js";
|
|
2
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
import { dirname, sep } from "node:path";
|
|
4
4
|
import { stat } from "node:fs/promises";
|