dsh-as-aistudio 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +15 -15
- package/cordis.patch.yml +5 -0
- package/package.json +4 -2
- package/src/client.js +506 -9
- package/src/components.js +18 -3
- package/src/index.js +2 -2
- package/src/shell.js +3 -3
- package/src/vendor/host/dsh-log-trim.flatten.js +124 -0
- package/src/vendor/host/dsh-log-trim.host-libs.mjs +185 -0
- package/src/vendor/host/dsh-log-trim.js +1387 -0
- package/src/vendor/host/dsh-log-trim.lossless.js +548 -0
- package/src/vendor/host/dsh-log-trim.roots.js +168 -0
- package/src/vendor/host/dsh-log-trim.vendor.compact-session.mjs +2125 -0
- package/src/vendor/host/dsh-log-trim.verify-session-log.mjs +435 -0
- package/src/vendor/versions.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
## 中文
|
|
6
6
|
|
|
7
|
+
**0.5.0** —— 第五个组件:会话日志裁剪(dsh-log-trim 0.5.0)。
|
|
8
|
+
|
|
9
|
+
- **维护型组件**:manifest 新增 `{ id: 'dsh-log-trim', suffix: 'trim', kind: 'maintenance' }`,它没有消息行动作、没有输入区浮层,因此不占 slot / overlay;补丁行、`exports["./trim"]`、vendor 副本与状态行照旧,和其它四个组件一样由本包内置。
|
|
10
|
+
- **装 studio 就有全部五个功能**:启动时裁掉模型看不到的旧窗口、清空逐块回放记录、折叠 edit/rerun/delete 痕迹,写盘前过宿主自己的九项校验;不需要再单独装 `dsh-log-trim`。
|
|
11
|
+
- **体积与内存不重复**:单独安装的副本与本包内置的副本是两个插件身份,同时装会各跑一遍启动扫描(会互相看见对方的备份)。推荐只留一个:要么装本包、要么单独装。
|
|
12
|
+
- 内嵌组件版本:edit 0.5.14 / rerun 0.2.7 / delete 0.2.0 / markdown 0.1.5 / trim 0.5.0。
|
|
13
|
+
|
|
7
14
|
**0.4.9** —— 跟进内嵌组件 dsh-edit-turn 0.5.14。
|
|
8
15
|
|
|
9
16
|
- 内置版本记录与浏览器半部同步到 `dsh-edit-turn 0.5.14`(工具侧修复,运行代码无行为变化)。
|
package/README.md
CHANGED
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
|
|
13
13
|
AI Studio 的好用之处不在模型,在于一轮对话中的每一步都能回头改。DSH 官方只提供整段压缩(/compact),没有轮次级的编辑、重跑与删除。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
五个组件(四个动作 + 一个维护)补上了这一层,而这个包负责让它们装得下、合得来、看得见:
|
|
16
16
|
|
|
17
17
|
- **装得下** —— 自包含安装,一次装完;
|
|
18
|
-
- **合得来** ——
|
|
18
|
+
- **合得来** —— 五个组件各自独立、任意子集共存,互操作契约由本包固化并测试;
|
|
19
19
|
- **看得见** —— 设置 → 插件 → AI Studio 面板如实报告哪几个真的活着。
|
|
20
20
|
|
|
21
21
|
### 特性
|
|
22
22
|
|
|
23
|
-
- **一行搞定** —— 插件列表里只有 AI Studio
|
|
23
|
+
- **一行搞定** —— 插件列表里只有 AI Studio 一行。五个组件的**界面与后台都内置在本包里**,由本包的五个补丁行 `dsh-as-aistudio/edit` 等挂载(详情页因此能列出这 5 个组件),不再各自占一行。**装本包不会再装任何别的东西。**
|
|
24
24
|
- **组件仍是独立包** —— 每个都有自己的仓库与 cordis.patch.yml,单独安装照样工作;本包不复制任何组件逻辑:宿主半侧(路由、回滚、重放)就是组件自己,浏览器 factory 由 tools/vendor.mjs 从组件源码逐字剥离生成。
|
|
25
25
|
- **副本不会漂移** —— npm run vendor 重新生成内联包,npm run build 重新生成大 bundle,verify:vendor / verify:build 是只读校验;测试里 vendor-sync / build-sync 会在副本过期时失败。
|
|
26
|
-
- **一个挂了不影响其余** ——
|
|
26
|
+
- **一个挂了不影响其余** —— 五个 vendored factory 各自带 guard 挂载,一个抛错不会带走另外四个。
|
|
27
27
|
- **互操作契约可验证** —— slot order 分配、行隐藏归属、兄弟探测协议写在 docs/INTEROP.md,并由组合矩阵测试断言。
|
|
28
28
|
- **web 与桌面端同构** —— 同一份 dsh.client.platform: web bundle;没有 location.origin / window.open / navigator.* / dialog / popover。
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ AI Studio 的好用之处不在模型,在于一轮对话中的每一步都能
|
|
|
33
33
|
dsh plugin --profile web add dsh-as-aistudio
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
桌面端把 --profile web 换成 --profile desktop
|
|
36
|
+
桌面端把 --profile web 换成 --profile desktop。五个组件已经内置在本包里,不需要再装任何东西。
|
|
37
37
|
|
|
38
38
|
### 使用
|
|
39
39
|
|
|
@@ -45,15 +45,15 @@ dsh plugin --profile web add dsh-as-aistudio
|
|
|
45
45
|
|
|
46
46
|
### 工作原理
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
- **浏览器半侧**(src/client.js,由 tools/build.mjs 生成):单一大 bundle —— studio 自己的浏览器半侧 +
|
|
48
|
+
- **五个组件行**(cordis.patch.yml + src/shell.js):每个组件一条 `dsh-as-aistudio/<后缀>` 行,行名经本包 `exports` 全部指向同一个壳文件,壳读行配置里的 `config.plugin` 并 `import` + `ctx.plugin` 挂真正的组件包 —— 组件的 loopback 路由与回滚/重放服务因此就位。缺哪个报哪个,绝不致命;宿主半侧自己一个组件都不挂(再挂一次就是挂两遍,路由必冲突)。
|
|
49
|
+
- **浏览器半侧**(src/client.js,由 tools/build.mjs 生成):单一大 bundle —— studio 自己的浏览器半侧 + 五个组件的 factory(各自 var module / var exports / const react,靠 var 提升共处一个 scope)。bundle 是按 Loader 行下发的,所以这是它们到达页面的唯一方式。
|
|
50
50
|
- **为什么宿主半侧不内联**:宿主代码对插件列表不可见,复制它只会凭空多出一份要维护的东西。
|
|
51
51
|
- **状态面板**:读 GET /api/dsh-as-aistudio/status,对每个组件报告 installed / hostMounted / version / ownRows(ownRows 大于 0 表示它还被独立安装着)。hostMounted 不是自报,是从 Loader 读那一条行的 fiber 状态(只有 state === 2 才算活着),所以关掉的行、没装好的包、起失败的组件都会如实显示成因。
|
|
52
|
-
- **挂载门**:浏览器半侧挂载前先读一次这道状态,只画 hostMounted 为真的组件 ——
|
|
52
|
+
- **挂载门**:浏览器半侧挂载前先读一次这道状态,只画 hostMounted 为真的组件 —— 宿主没挂起来就没有路由,按钮画出来也点不动。宿主答不上来时按「未知」处理,五个都挂(保持旧行为)。
|
|
53
53
|
|
|
54
54
|
### 已知限制
|
|
55
55
|
|
|
56
|
-
-
|
|
56
|
+
- 五个组件的 browser factory 是生成副本。改了组件必须 npm run vendor && npm run build 再发本包;verify:vendor / verify:build 会拦住过期副本。
|
|
57
57
|
- 组件被关掉(插件页里把 `dsh-as-aistudio/<组件>` 那行停用)时,它的界面与后台都不挂载,面板显示「已安装,宿主未挂载」。
|
|
58
58
|
- 宿主版本常量只在进程启动时读一次:改了本包要重启宿主 + 硬刷新。
|
|
59
59
|
|
|
@@ -61,7 +61,7 @@ dsh plugin --profile web add dsh-as-aistudio
|
|
|
61
61
|
|
|
62
62
|
- DSH >=0.1.6-alpha.2(0.2.0-rc.1 实测通过);
|
|
63
63
|
- profile:web、desktop;
|
|
64
|
-
-
|
|
64
|
+
- 五个组件都可单独安装,也可以任意子集和本包共存。
|
|
65
65
|
|
|
66
66
|
### License
|
|
67
67
|
|
|
@@ -77,7 +77,7 @@ What makes AI Studio pleasant is not the model: it is that every step of a turn
|
|
|
77
77
|
|
|
78
78
|
### Features
|
|
79
79
|
|
|
80
|
-
- **One row** — the plugin list shows only AI Studio. Both halves of the
|
|
80
|
+
- **One row** — the plugin list shows only AI Studio. Both halves of the five components travel inside this package and are mounted by its five patch rows (`dsh-as-aistudio/edit` and friends, which is why the detail page can list all five). Installing the studio installs nothing else.
|
|
81
81
|
- **Components stay independent packages** — each keeps its own repo and its own cordis.patch.yml and works alone. This package copies no component logic: the host halves ARE the components, and the browser factories are lifted verbatim from their sources by tools/vendor.mjs.
|
|
82
82
|
- **The vendored copy cannot drift** — npm run vendor regenerates it, npm run build regenerates the bundle, and verify:vendor / verify:build are read-only gates; the test suite fails on a stale copy.
|
|
83
83
|
- **One failure does not take the rest** — each vendored factory mounts behind its own guard.
|
|
@@ -90,7 +90,7 @@ What makes AI Studio pleasant is not the model: it is that every step of a turn
|
|
|
90
90
|
dsh plugin --profile web add dsh-as-aistudio
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Use --profile desktop on the desktop app. The
|
|
93
|
+
Use --profile desktop on the desktop app. The five components are already inside this package; there is nothing else to install.
|
|
94
94
|
|
|
95
95
|
### Usage
|
|
96
96
|
|
|
@@ -100,15 +100,15 @@ Use --profile desktop on the desktop app. The four components are already inside
|
|
|
100
100
|
|
|
101
101
|
### How it works
|
|
102
102
|
|
|
103
|
-
- **The
|
|
103
|
+
- **The five component rows** (cordis.patch.yml + src/shell.js): one row per component, named `dsh-as-aistudio/<suffix>`; every one of those names maps through this package's exports to the same shell, which reads `config.plugin` from the row and imports + applies the real component package — that is what puts its loopback routes and its rollback / replay services in place. A missing one is reported, never fatal. The host half itself mounts nothing: mounting here too would run every component twice and collide on its routes.
|
|
104
104
|
- **Browser half** (src/client.js, generated by tools/build.mjs): one bundle — the studio's own browser half plus the four component factories, each with its own var module / var exports / const react in one scope via hoisting. A bundle is served per Loader row, so this is the only way they can reach the page.
|
|
105
105
|
- **Why the host halves are not vendored**: host code is invisible to the plugin list, so copying it would only create a second thing to fix.
|
|
106
106
|
- **The panel** reads GET /api/dsh-as-aistudio/status and reports installed / hostMounted / version / ownRows per component (ownRows greater than 0 means it is also installed standalone). hostMounted is not self-reported: it is read from the Loader row's fiber state (only state === 2 counts as live), so a disabled row, a missing package and a failed start each show their own reason.
|
|
107
|
-
- **The mount gate**: before mounting anything, the browser half reads that status once and draws only the components it calls mounted — a component whose host half is not up has no routes, so its buttons would do nothing. A host that cannot answer is treated as unknown and all
|
|
107
|
+
- **The mount gate**: before mounting anything, the browser half reads that status once and draws only the components it calls mounted — a component whose host half is not up has no routes, so its buttons would do nothing. A host that cannot answer is treated as unknown and all five mount, which is the pre-gate behaviour.
|
|
108
108
|
|
|
109
109
|
### Known limitations
|
|
110
110
|
|
|
111
|
-
- The
|
|
111
|
+
- The five browser factories are a generated copy. After changing a component, run npm run vendor && npm run build before releasing this package; the verify gates block a stale copy.
|
|
112
112
|
- A component that is somehow absent is not mounted and the panel says so.
|
|
113
113
|
- The host version constant is read once at process start: after changing this package, restart the host and hard-refresh.
|
|
114
114
|
|
package/cordis.patch.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-as-aistudio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Google-AI-Studio-style turn controls for DeepSeek Harness, in one install: edit a prompt and re-run it, re-run a reply in place, delete a turn from the model context, and render sent prompts as Markdown. Self-contained: the plugin list shows this one row, and the four components are vendored inside it - installing the studio installs nothing else.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"./rerun": "./src/shell.js",
|
|
12
12
|
"./delete": "./src/shell.js",
|
|
13
13
|
"./markdown": "./src/shell.js",
|
|
14
|
-
"./package.json": "./package.json"
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
"./trim": "./src/shell.js"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"src/index.js",
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
"devDependencies": {
|
|
84
85
|
"dsh-delete-turn": "^0.1.14",
|
|
85
86
|
"dsh-edit-turn": "^0.5.3",
|
|
87
|
+
"dsh-log-trim": "^0.5.0",
|
|
86
88
|
"dsh-markdown-bubble": "^0.1.5",
|
|
87
89
|
"dsh-rerun-turn": "^0.2.4"
|
|
88
90
|
}
|