dsh-auto-collapse 0.1.3 → 0.1.4
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.en.md +97 -80
- package/README.md +98 -80
- package/lib/client.js +835 -123
- package/lib/index.js +32 -8
- package/lib/types/client/index.d.ts +16 -15
- package/lib/types/index.d.ts +22 -10
- package/package.json +61 -54
package/lib/index.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dsh-auto-collapse — node half(构建产物,与 src/index.ts 对应)。
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* dsh-auto-collapse — node half(构建产物,与 src/index.ts 对应)。
|
|
3
|
+
*
|
|
4
|
+
* Host 侧除了让插件出现在宿主插件树之外,还注册一个 `dsh-auto-collapse`
|
|
5
|
+
* settings 命名空间,供浏览器端“插件配置 → 状态提示词”卡片读写。
|
|
6
|
+
* 浏览器端 bundle 由 dsh.client 声明 + exports["./client"] 提供。
|
|
7
|
+
*/
|
|
8
|
+
import z from '@deepseek-ai/schemastery'
|
|
9
|
+
import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings'
|
|
10
|
+
|
|
11
|
+
export const name = 'dsh-auto-collapse'
|
|
12
|
+
export const inject = []
|
|
13
|
+
|
|
14
|
+
const DEFAULT_STATUS_TEXT = 'Deep sleeping...'
|
|
15
|
+
const AUTO_COLLAPSE_SETTINGS_NAMESPACE = settingsNamespace('dsh-auto-collapse')
|
|
16
|
+
const AUTO_COLLAPSE_SETTINGS_SCHEMA = z.object({
|
|
17
|
+
statusText: z.string().default(DEFAULT_STATUS_TEXT),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export function apply(ctx, config = {}) {
|
|
21
|
+
let current = () => ({ statusText: config.statusText ?? DEFAULT_STATUS_TEXT })
|
|
22
|
+
installSettingsSection(ctx, AUTO_COLLAPSE_SETTINGS_NAMESPACE, AUTO_COLLAPSE_SETTINGS_SCHEMA, {
|
|
23
|
+
statusText: config.statusText ?? DEFAULT_STATUS_TEXT,
|
|
24
|
+
}, {
|
|
25
|
+
setSource: (source) => {
|
|
26
|
+
current = source
|
|
27
|
+
},
|
|
28
|
+
onChange: () => {
|
|
29
|
+
void current
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dsh-auto-collapse — browser half 类型声明。
|
|
3
|
-
*
|
|
4
|
-
* 折叠会话里的工具卡片与 Think 推理块;把官方 "Deep diving..." 运行状态行
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* dsh-auto-collapse — browser half 类型声明。
|
|
3
|
+
*
|
|
4
|
+
* 折叠会话里的工具卡片与 Think 推理块;把官方 "Deep diving..." 运行状态行
|
|
5
|
+
* 替换为可配置的状态提示词(默认 "Deep sleeping...",为空时不替换)。
|
|
6
|
+
* 同时注册 DSH 设置 → 插件 → 插件配置的“状态提示词”卡片。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** 客户端根上下文的最小结构化类型(仅用 cordis 标准 effect,运行时通过 slot 注册配置卡片)。 */
|
|
10
|
+
export interface FoldClientCtx {
|
|
11
|
+
effect(fn: () => unknown, label?: string): unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare const name: string
|
|
15
|
+
export declare const inject: string[]
|
|
16
|
+
export declare function apply(ctx: FoldClientCtx): void
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dsh-auto-collapse — host half 类型声明。
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* 浏览器端 bundle 通过 package.json 的 dsh.client 声明 + exports["./client"]
|
|
6
|
-
* 被 dsh web 的 client-modules 服务发现并注入页面。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/** Host
|
|
10
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* dsh-auto-collapse — host half 类型声明。
|
|
3
|
+
*
|
|
4
|
+
* 注册 `dsh-auto-collapse` settings 命名空间,供浏览器端插件配置卡片读写;
|
|
5
|
+
* 浏览器端 bundle 通过 package.json 的 dsh.client 声明 + exports["./client"]
|
|
6
|
+
* 被 dsh web 的 client-modules 服务发现并注入页面。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Host 插件名。 */
|
|
10
|
+
export declare const name: 'dsh-auto-collapse'
|
|
11
|
+
|
|
12
|
+
/** Host 侧不注入额外服务。 */
|
|
13
|
+
export declare const inject: string[]
|
|
14
|
+
|
|
15
|
+
/** 插件配置。 */
|
|
16
|
+
export interface Config {
|
|
17
|
+
/** 自定义状态提示词;留空恢复官方 "Deep diving..."。 */
|
|
18
|
+
statusText?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Host 插件体:注册设置命名空间。 */
|
|
22
|
+
export declare function apply(ctx: unknown, config?: Config): void
|
package/package.json
CHANGED
|
@@ -1,54 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-auto-collapse",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "DeepSeek Harness Web 客户端插件:把会话里的工具卡片与 Think 推理块折叠成一行,折叠态实时显示当前正在进行的工作(工具名 + 正在执行的命令/参数、或思考内容),运行中带流光动画;点击展开/收起。让界面只保留模型说的话。",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/types/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client": {
|
|
14
|
-
"types": "./lib/types/client/index.d.ts",
|
|
15
|
-
"default": "./lib/client.js"
|
|
16
|
-
},
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"dsh": {
|
|
20
|
-
"bundle": {
|
|
21
|
-
"patch": "./cordis.patch.yml"
|
|
22
|
-
},
|
|
23
|
-
"client": {
|
|
24
|
-
"inject": [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-auto-collapse",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "DeepSeek Harness Web 客户端插件:把会话里的工具卡片与 Think 推理块折叠成一行,折叠态实时显示当前正在进行的工作(工具名 + 正在执行的命令/参数、或思考内容),运行中带流光动画;点击展开/收起。让界面只保留模型说的话。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": {
|
|
14
|
+
"types": "./lib/types/client/index.d.ts",
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"dsh": {
|
|
20
|
+
"bundle": {
|
|
21
|
+
"patch": "./cordis.patch.yml"
|
|
22
|
+
},
|
|
23
|
+
"client": {
|
|
24
|
+
"inject": [
|
|
25
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
26
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
27
|
+
],
|
|
28
|
+
"platform": "web"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "node build.mjs",
|
|
33
|
+
"deploy": "node deploy.mjs",
|
|
34
|
+
"test": "node test/run-all.mjs",
|
|
35
|
+
"typecheck": "tsc --noEmit --pretty false",
|
|
36
|
+
"check": "npm run typecheck && npm test",
|
|
37
|
+
"prepack": "node build.mjs"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"lib",
|
|
41
|
+
"cordis.patch.yml"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"dsh",
|
|
45
|
+
"deepseek-harness",
|
|
46
|
+
"client-plugin",
|
|
47
|
+
"ui",
|
|
48
|
+
"collapse",
|
|
49
|
+
"auto-collapse",
|
|
50
|
+
"chat"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"esbuild": "0.25.0",
|
|
55
|
+
"typescript": "5.9.3"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
|
|
59
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
60
|
+
}
|
|
61
|
+
}
|