dsh-compact-saviour 0.2.7 → 0.2.9
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.md +14 -8
- package/dshx.yml +1 -0
- package/lib/client.js +10 -17
- package/lib/client.js.map +1 -1
- package/lib/dsh-compact-saviour.js +133 -28
- package/lib/types/compress.d.ts +3 -1
- package/lib/types/compress.d.ts.map +1 -1
- package/lib/types/compress.js +22 -6
- package/lib/types/compress.js.map +1 -1
- package/lib/types/controller.d.ts +3 -1
- package/lib/types/controller.d.ts.map +1 -1
- package/lib/types/controller.js +31 -11
- package/lib/types/controller.js.map +1 -1
- package/lib/types/dsh-compact-saviour.d.ts +2 -0
- package/lib/types/dsh-compact-saviour.d.ts.map +1 -1
- package/lib/types/dsh-compact-saviour.js +6 -1
- package/lib/types/dsh-compact-saviour.js.map +1 -1
- package/lib/types/routes.d.ts +26 -0
- package/lib/types/routes.d.ts.map +1 -0
- package/lib/types/routes.js +65 -0
- package/lib/types/routes.js.map +1 -0
- package/package.json +22 -21
- package/scripts/link-harness-dependencies.mjs +22 -6
- package/src/compress.ts +19 -6
- package/src/controller.ts +26 -15
- package/src/dsh-compact-saviour.ts +7 -1
- package/src/routes.ts +76 -0
- package/tests/compression.test.ts +1 -1
- package/tests/peer-range.test.ts +8 -8
- package/tests/routes.test.ts +67 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
|
-
需要 DeepSeek Harness **0.2.0-rc.2**(`@deepseek-ai/dsh-*` peer `>=0.2.0-rc.1 <0.2.1`,与 DSHX 写在 `@deepseek-ai/dsh` 上的范围相同)。这是符合官方 `dsh.bundle.patch` 约定的外部插件,仓库和 Release 安装包都包含编译好的 `lib/`。**安装不需要 dshx、Creator Mode、Harness 源码或本地构建。**
|
|
7
|
+
需要 DeepSeek Harness **0.2.0-rc.2**(`@deepseek-ai/dsh-*` peer `>=0.2.0-rc.1 <0.2.1`,与 DSHX 写在 `@deepseek-ai/dsh` 上的范围相同)。这是符合官方 `dsh.bundle.patch` 约定的外部插件,仓库和 Release 安装包都包含编译好的 `lib/`。**安装不需要 dshx、Creator Mode、Harness 源码或本地构建。** 本次正式版本为 `0.2.9`,提供 npm 包和 GitHub Release 安装包。
|
|
8
8
|
|
|
9
9
|
### 桌面应用(推荐)
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
2. 在 **包名或地址** 中填入下面这一行,按官方安装向导继续:
|
|
13
13
|
|
|
14
14
|
```text
|
|
15
|
-
|
|
15
|
+
dsh-compact-saviour@0.2.9
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
3. 安装到当前应用所用的 profile,按安装结果给出的提示完成启用或重新打开应用。
|
|
@@ -25,30 +25,30 @@
|
|
|
25
25
|
已安装官方 `dsh` CLI 时:
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
dsh plugin --profile web add
|
|
28
|
+
dsh plugin --profile web add dsh-compact-saviour@0.2.9
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
没有全局 `dsh` 命令时:
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
|
-
npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add
|
|
34
|
+
npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add dsh-compact-saviour@0.2.9
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
CLI 路径需要 Node.js 24
|
|
37
|
+
CLI 路径需要 Node.js 24+ 及 PATH 中的 pnpm;Git spec 另需 Git。它把包写入选定 profile;按官方安装器的生效结果继续,只有提示需要重启时才用原启动方式重新打开 Host。不要在同一个 DSH_HOME 上另开一个 Host。
|
|
38
38
|
|
|
39
39
|
### 使用 Release 安装包
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
从 [v0.2.9 Release](https://github.com/aa2246740/dsh-compact-saviour/releases/tag/v0.2.9) 下载 `.tgz`,在官方插件管理器中选择该安装包。开发时也可使用本地目录:
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
44
|
dsh plugin --profile web add file:/path/to/dsh-compact-saviour
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
这条路径同样使用官方插件安装器,不需要解压或手动创建软链接。npm 安装可使用上面的固定版本包名。
|
|
48
48
|
|
|
49
49
|
### 更新与卸载
|
|
50
50
|
|
|
51
|
-
更新时在官方插件管理器安装目标版本的 GitHub spec 或 `.tgz`,按结果提示生效。Web CLI 使用同一条 `add` 命令即可指定目标版本。卸载请使用应用插件页面;Web CLI 对应:
|
|
51
|
+
更新时在官方插件管理器安装目标版本的 npm 包、GitHub spec 或 `.tgz`,按结果提示生效。Web CLI 使用同一条 `add` 命令即可指定目标版本。卸载请使用应用插件页面;Web CLI 对应:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
54
|
dsh plugin --profile web remove dsh-compact-saviour
|
|
@@ -105,6 +105,12 @@ dsh plugin --profile web remove dsh-compact-saviour
|
|
|
105
105
|
|
|
106
106
|
摘要是有损压缩,可能漏掉细节;原始日志始终保留。官方上下文弹窗暂未提供扩展插槽,本插件使用有边界的 DOM 兼容层。未来 DSH 更改弹窗结构时需要重新验收,不承诺未测试版本兼容。
|
|
107
107
|
|
|
108
|
+
## 与会话模型路由插件协作
|
|
109
|
+
|
|
110
|
+
插件通过可选公共服务 `compactionRoutes`(`apiVersion: 1`)接收会话的真实上下文模型、压缩模型、reasoning effort、输出上限和路由修订。Fusion 会提供当前会话冻结的路由;其他会话仍使用 Saviour 自己的设置。自动辅助关闭时不接管自动压缩,手动压缩仍可用。
|
|
111
|
+
|
|
112
|
+
容量解析、分块预算和最终 `llm.stream` 请求使用同一路由快照。请求输出不超过已预留上限。路由变更或注册插件卸载后,旧快照失效;卸载也取消进行中的压缩。取消或失效不会提交摘要。该服务在外部插件内实现,不改动 Harness 核心。
|
|
113
|
+
|
|
108
114
|
## 许可证
|
|
109
115
|
|
|
110
116
|
[MIT](LICENSE)。复用的官方压缩事务和 Open Bot Motion 动画许可见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
package/dshx.yml
CHANGED
package/lib/client.js
CHANGED
|
@@ -4,14 +4,14 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
|
|
7
|
+
// \0rolldown/runtime.js
|
|
8
8
|
var __create = Object.create;
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
12
|
var __getProtoOf = Object.getPrototypeOf;
|
|
13
13
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
14
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
17
|
key = keys[i];
|
|
@@ -26,11 +26,10 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
value: mod,
|
|
27
27
|
enumerable: true
|
|
28
28
|
}) : target, mod));
|
|
29
|
-
//#endregion
|
|
30
29
|
let react = require("react");
|
|
31
30
|
let react_dom = require("react-dom");
|
|
32
31
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
|
|
32
|
+
// src/client/context-elements.ts
|
|
34
33
|
/** Keep the compatibility bridge local to its composer. RC2 places the meter
|
|
35
34
|
* in the dock outside the card and portals its popup directly to body. */
|
|
36
35
|
function contextRoot(anchor) {
|
|
@@ -57,8 +56,7 @@ window.__ModuleLoader__.load({
|
|
|
57
56
|
const panels = [...doc.body.children].filter((element) => element instanceof HTMLElement && isContextPanel(element));
|
|
58
57
|
return panels.length === 1 ? panels[0] : void 0;
|
|
59
58
|
}
|
|
60
|
-
|
|
61
|
-
//#region src/client/meter-bridge.ts
|
|
59
|
+
// src/client/meter-bridge.ts
|
|
62
60
|
function tokens(value) {
|
|
63
61
|
const unit = value >= 1e6 ? 1e6 : value >= 1e3 ? 1e3 : 1;
|
|
64
62
|
const scaled = value / unit;
|
|
@@ -146,14 +144,13 @@ window.__ModuleLoader__.load({
|
|
|
146
144
|
* @license MIT
|
|
147
145
|
* @author Open Bot Motion Team
|
|
148
146
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var import_open_bot_motion = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
147
|
+
// src/client/satellite.ts
|
|
148
|
+
var import_open_bot_motion = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
|
|
152
149
|
(function(root, factory) {
|
|
153
150
|
if (typeof define === "function" && define.amd) define([], factory);
|
|
154
151
|
else if (typeof module === "object" && module.exports) module.exports = factory();
|
|
155
152
|
else root.OpenBotMotion = factory();
|
|
156
|
-
})(typeof self !== "undefined" ? self :
|
|
153
|
+
})(typeof self !== "undefined" ? self : this$1, function() {
|
|
157
154
|
"use strict";
|
|
158
155
|
var CHARCOAL = "#222126";
|
|
159
156
|
var LOOP = 20.783;
|
|
@@ -5445,8 +5442,7 @@ window.__ModuleLoader__.load({
|
|
|
5445
5442
|
document.removeEventListener("visibilitychange", this.cancel);
|
|
5446
5443
|
}
|
|
5447
5444
|
};
|
|
5448
|
-
|
|
5449
|
-
//#region src/client/waiting-copy.tsx
|
|
5445
|
+
// src/client/waiting-copy.tsx
|
|
5450
5446
|
const COPY = {
|
|
5451
5447
|
compress: [
|
|
5452
5448
|
"正在压缩",
|
|
@@ -5492,8 +5488,7 @@ window.__ModuleLoader__.load({
|
|
|
5492
5488
|
}, phrase))
|
|
5493
5489
|
});
|
|
5494
5490
|
}
|
|
5495
|
-
|
|
5496
|
-
//#region \0dshx-css-global:src/client/style.css.mjs
|
|
5491
|
+
// \0dshx-css-global:/home/runner/work/dsh-compact-saviour/dsh-compact-saviour/src/client/style.css.mjs
|
|
5497
5492
|
const css = ".dsh-cs-footer{border-top:1px solid var(--dsw-alias-separator,#e7e7e9);margin-top:10px;padding-top:10px}.dsh-cs-content{flex-direction:column;gap:7px;display:flex}.dsh-cs-button{font:inherit;color:var(--dsw-alias-label-primary,#30343b);background:var(--dsw-alias-interactive-bg-hover,#f3f4f6);cursor:pointer;white-space:normal;overflow-wrap:anywhere;border:0;border-radius:7px;padding:6px 10px;font-size:12px;line-height:1.5}.dsh-cs-button:hover{filter:brightness(.96)}.dsh-cs-button:focus-visible{outline:2px solid var(--dsw-static-blue-450,#4d88f5);outline-offset:2px}.dsh-cs-button:disabled{opacity:.5;cursor:default}.dsh-cs-primary{color:var(--dsw-static-blue-550,#3476e3)}.dsh-cs-compact{isolation:isolate;position:relative;overflow:hidden}.dsh-cs-compact>.dsh-cs-button-status{z-index:1;justify-content:center;align-items:center;max-width:100%;display:inline-flex;position:relative}.dsh-cs-sr-status{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.dsh-cs-compact:before{content:\"\";pointer-events:none;background:linear-gradient(105deg, transparent 25%, color-mix(in srgb, currentColor 14%, transparent) 48%, transparent 72%);opacity:0;position:absolute;inset:0;transform:translate(-110%)}.dsh-cs-content:is([data-phase=sending],[data-phase=queued],[data-phase=running]) .dsh-cs-compact{opacity:1}.dsh-cs-content:is([data-phase=sending],[data-phase=queued],[data-phase=running]) .dsh-cs-compact:before{opacity:1;animation:2.6s ease-in-out infinite dsh-cs-shimmer}.dsh-cs-content[data-phase=done] .dsh-cs-compact:before{opacity:1;animation:.9s ease-out both dsh-cs-shimmer}.dsh-cs-progress{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0;margin-left:6px}.dsh-cs-waiting-copy{min-width:0;display:inline-grid}.dsh-cs-waiting-copy>span{opacity:0;grid-area:1/1;transition:opacity .45s}.dsh-cs-waiting-copy>span[data-active=true]{opacity:1}@keyframes dsh-cs-shimmer{0%{transform:translate(-110%)}70%,to{transform:translate(110%)}}@media (prefers-reduced-motion:no-preference){.dsh-cs-content:is([data-phase=idle],[data-phase=done]) .dsh-cs-compact:not(:disabled):is(:hover,:focus-visible):before{opacity:1;animation:.9s ease-out both dsh-cs-shimmer}}.dsh-cs-status,.dsh-cs-error{overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary,#747982);font-size:11px;line-height:1.5}.dsh-cs-error{color:var(--dsw-static-red-500,#c54848)}.dsh-cs-hint{text-align:center;color:var(--dsw-alias-label-tertiary,#8a9099);font-size:10px;line-height:1.5}.dsh-cs-ring{touch-action:manipulation;-webkit-touch-callout:none;user-select:none;position:relative}.dsh-cs-ring-art{pointer-events:none;color:var(--dsw-static-blue-550,#3476e3);place-items:center;display:grid;position:absolute;inset:auto}.dsh-cs-ring-art svg{width:100%;height:100%;position:absolute;overflow:visible}.dsh-cs-hold{opacity:0;transform:rotate(-90deg)}.dsh-cs-hold circle{fill:none;stroke:currentColor;stroke-width:1.8px;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1px}[data-cs-holding] .dsh-cs-hold{opacity:1}[data-cs-holding] .dsh-cs-hold circle{animation:.65s linear forwards dsh-cs-charge}@keyframes dsh-cs-charge{to{stroke-dashoffset:0}}.dsh-cs-robot{opacity:0;transition:opacity .18s,transform .32s cubic-bezier(.2,.8,.2,1)}.dsh-cs-body{fill:currentColor}.dsh-cs-eyes{fill:#fff}.dsh-cs-dot{fill:currentColor}.dsh-cs-ring>svg[viewBox=\"0 0 14 14\"]{transition:opacity .18s}.dsh-cs-ring[data-cs-phase=running] .dsh-cs-robot{opacity:1;transform:scale(1)}.dsh-cs-ring:is([data-cs-phase=queued],[data-cs-phase=sending]) .dsh-cs-robot{opacity:.55;transform:scale(1)}.dsh-cs-ring[data-cs-motion=settling] .dsh-cs-robot{opacity:0;transform:scale(.42)}@media (prefers-reduced-motion:reduce){[data-cs-holding] .dsh-cs-hold circle{stroke-dashoffset:.25px;animation:none}.dsh-cs-content[data-phase] .dsh-cs-compact:before{opacity:0;animation:none}.dsh-cs-waiting-copy>span,.dsh-cs-ring>svg[viewBox=\"0 0 14 14\"],.dsh-cs-robot{transition:none}}.dsh-cs-actions{flex-direction:column;gap:6px;display:flex}.dsh-cs-settings{max-width:640px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:14px;padding:24px;display:flex}.dsh-cs-settings h2,.dsh-cs-settings p{margin:0}.dsh-cs-settings p{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.7}.dsh-cs-settings label{flex-direction:column;gap:7px;font-size:13px;display:flex}.dsh-cs-settings .dsh-cs-toggle{flex-direction:row;align-items:center}.dsh-cs-settings input:not([type=checkbox]),.dsh-cs-settings select{box-sizing:border-box;width:100%;font:inherit;color:inherit;background:var(--dsw-alias-interactive-bg-hover,#f3f4f6);border:1px solid var(--dsw-alias-separator,#e7e7e9);border-radius:8px;padding:9px 10px}";
|
|
5498
5493
|
const tagId = "dsh-compact-saviour/style.css";
|
|
5499
5494
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
@@ -5503,8 +5498,7 @@ window.__ModuleLoader__.load({
|
|
|
5503
5498
|
tag.textContent = css;
|
|
5504
5499
|
document.head.appendChild(tag);
|
|
5505
5500
|
}
|
|
5506
|
-
|
|
5507
|
-
//#region src/client/index.tsx
|
|
5501
|
+
// src/client/index.tsx
|
|
5508
5502
|
const name = "dsh-compact-saviour-client";
|
|
5509
5503
|
const inject = ["slots"];
|
|
5510
5504
|
const ENDPOINT = "/api/dsh-compact-saviour/v1";
|
|
@@ -5921,7 +5915,6 @@ window.__ModuleLoader__.load({
|
|
|
5921
5915
|
label: () => "Compact Saviour"
|
|
5922
5916
|
}, SettingsPanel));
|
|
5923
5917
|
}
|
|
5924
|
-
//#endregion
|
|
5925
5918
|
exports.PopupBridge = PopupBridge;
|
|
5926
5919
|
exports.apply = apply;
|
|
5927
5920
|
exports.inject = inject;
|