dsh-plugin-om 0.0.15 → 0.0.17
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 +22 -5
- package/dist/client/OmCompactionCard.d.ts +22 -0
- package/dist/client/OmCompactionCard.d.ts.map +1 -0
- package/dist/client/definition.d.ts +55 -0
- package/dist/client/definition.d.ts.map +1 -0
- package/dist/client/index.d.ts +18 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/locales.d.ts +25 -0
- package/dist/client/locales.d.ts.map +1 -0
- package/dist/client.js +259 -0
- package/dist/client.js.map +1 -0
- package/dist/compress.d.ts +1 -1
- package/dist/compress.d.ts.map +1 -1
- package/dist/constants.d.ts +8 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.mjs +120 -115
- package/dist/log-index.d.ts +2 -15
- package/dist/log-index.d.ts.map +1 -1
- package/dist/recall.d.ts +2 -1
- package/dist/recall.d.ts.map +1 -1
- package/dist/semantic-recall.d.ts +3 -2
- package/dist/semantic-recall.d.ts.map +1 -1
- package/dist/summarize.d.ts +9 -12
- package/dist/summarize.d.ts.map +1 -1
- package/dist/types.d.ts +25 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +37 -15
package/dist/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
|
10
10
|
import type { CompactionId } from '@deepseek-ai/dsh-compaction';
|
|
11
11
|
import type { ToolResultPruner } from '@deepseek-ai/dsh-compaction-tool-result-pruner';
|
|
12
12
|
import type { Message, TokenUsage, UserMessage } from '@deepseek-ai/dsh-llm';
|
|
13
|
-
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
|
|
13
|
+
import type { Session, SessionEvent, SessionEventMap } from '@deepseek-ai/dsh-session';
|
|
14
14
|
import type { SubagentResult, SubagentRun, SubagentStartRequest } from '@deepseek-ai/dsh-subagent';
|
|
15
15
|
import type { SystemPrompt } from '@deepseek-ai/dsh-system-prompt';
|
|
16
16
|
import type { TokenMeter } from '@deepseek-ai/dsh-token-meter';
|
|
@@ -21,7 +21,7 @@ export type { PluginConfig } from './config.ts';
|
|
|
21
21
|
* 官方包宿主类型再导出:插件 API 与工具签名统一从这里取型,
|
|
22
22
|
* 避免各模块直接依赖不同版本的 dsh-* 包类型面。
|
|
23
23
|
*/
|
|
24
|
-
export type { Agent, CompactionId, Context, EventOptions, Events, Message, Session, SessionEvent, SubagentResult, SubagentRun, SubagentStartRequest, SystemPrompt, TokenMeter, TokenUsage, ToolDefinition, ToolResultPruner, ToolRunContext, UserMessage, };
|
|
24
|
+
export type { Agent, CompactionId, Context, EventOptions, Events, Message, Session, SessionEvent, SessionEventMap, SubagentResult, SubagentRun, SubagentStartRequest, SystemPrompt, TokenMeter, TokenUsage, ToolDefinition, ToolResultPruner, ToolRunContext, UserMessage, };
|
|
25
25
|
/**
|
|
26
26
|
* 一条消息事件(user/assistant/tool-result),带稳定 message_id;
|
|
27
27
|
* 消息级索引(indexMessages)的节点,按 message_id 定位消息序列下标。
|
|
@@ -42,19 +42,36 @@ export type MessageIndex = {
|
|
|
42
42
|
byId: Map<string, number>;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* 一条完整消息:摘要日志与 recall
|
|
46
|
-
* user
|
|
45
|
+
* 一条完整消息:摘要日志与 recall 共用的定位单位,分四类——
|
|
46
|
+
* user(用户消息,user_message 中 source.kind === 'user')、
|
|
47
|
+
* sys(系统消息,user_message 中其余 source.kind 的部分,如宿主注入的上下文)、
|
|
48
|
+
* assistant(模型输出文本)、toolcall(单个工具调用及其结果)。
|
|
47
49
|
* index 从 0 起、按日志顺序递增、只追加不重排 → 会话内全局稳定
|
|
48
|
-
* (压缩后旧摘要条目引用的 index
|
|
50
|
+
* (压缩后旧摘要条目引用的 index 仍然有效);本插件自产的压缩日志消息不占位。
|
|
49
51
|
*/
|
|
50
52
|
export type CompleteMessage = {
|
|
51
53
|
/** 完整消息序号(0 起,全局稳定)。 */
|
|
52
54
|
index: number;
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
/**
|
|
56
|
+
* 类别:user=用户消息;sys=系统消息(压缩日志中以 <sys type="KIND" index="N"> 空块
|
|
57
|
+
* 表示);assistant=模型输出文本;toolcall=单个工具调用及其结果。
|
|
58
|
+
*/
|
|
59
|
+
type: 'user' | 'sys' | 'assistant' | 'toolcall';
|
|
60
|
+
/** 系统消息的 source.kind(仅 sys 类;如 agent-instructions / skill-catalog)。 */
|
|
61
|
+
kind?: string;
|
|
62
|
+
/** 关联的消息事件 seq(user/sys/assistant=1 个;toolcall=assistant 消息 + 结果)。 */
|
|
56
63
|
seqs: number[];
|
|
57
64
|
/** 工具调用 id(仅 toolcall 类;关联 tool/result 用)。 */
|
|
58
65
|
callId?: string;
|
|
59
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* 插件扩展的 compaction/summary 载荷:宿主类型 + shadowedCharCount(压缩前字符数)。
|
|
69
|
+
* 宿主 append 不做 schema 剥离,扩展字段原样持久化;旧会话载荷可能缺失该字段,
|
|
70
|
+
* 客户端读取时按可选处理。宿主类型是 union(rawOutput 分支),无法直接声明合并,
|
|
71
|
+
* 故用交叉类型 + 读取处收窄。
|
|
72
|
+
*/
|
|
73
|
+
export type CompactionSummaryPayload = SessionEventMap['compaction/summary'] & {
|
|
74
|
+
/** 被压缩内容的字符数(压缩前文本长度合计;UI 标题统计用),旧载荷可能缺失。 */
|
|
75
|
+
shadowedCharCount?: number;
|
|
76
|
+
};
|
|
60
77
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAA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Z,OAAO,EACP,YAAY,EACZ,MAAM,EACN,OAAO,EACP,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,IAAI,EAAE,cAAc,GAAG,mBAAmB,GAAG,aAAa,CAAC;CAC5D,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG;IACzB,oBAAoB;IACpB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,kCAAkC;IAClC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;IAChD,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,oBAAoB,CAAC,GAAG;IAC7E,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare function isRecord(value: unknown): value is Record<string, unknow
|
|
|
10
10
|
export declare function uuid(): string;
|
|
11
11
|
/** 提取 content 数组中的纯文本块(type === 'text' 的 block.text 拼接)。 */
|
|
12
12
|
export declare function blocksToText(blocks: unknown): string;
|
|
13
|
+
/** 消息内容的字符数:递归计入 text 块与 tool-result 内嵌文本(与宿主 token 估算口径一致)。 */
|
|
14
|
+
export declare function textCharCount(message: Message | null | undefined): number;
|
|
13
15
|
/** 面向 recall 的完整消息呈现:text 原样;tool-call 展开(参数=代码);tool-result 取文本。 */
|
|
14
16
|
export declare function renderMessageText(message: Message | null | undefined): string;
|
|
15
17
|
/** 安全 JSON 序列化:序列化失败时退回 String 呈现(避免渲染异常)。 */
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,oDAAoD;AACpD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wDAAwD;AACxD,wBAAgB,IAAI,IAAI,MAAM,CAK7B;AAED,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CASpD;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAe7E;AAED,8CAA8C;AAC9C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM/C;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEvD;AAED,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA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
"version": "0.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -18,7 +18,12 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.mjs"
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./dist/client/index.d.ts",
|
|
24
|
+
"default": "./dist/client.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
22
27
|
},
|
|
23
28
|
"files": [
|
|
24
29
|
"dist",
|
|
@@ -30,6 +35,14 @@
|
|
|
30
35
|
"dsh": {
|
|
31
36
|
"bundle": {
|
|
32
37
|
"patch": "./cordis.patch.yml"
|
|
38
|
+
},
|
|
39
|
+
"client": {
|
|
40
|
+
"inject": [
|
|
41
|
+
"@deepseek-ai/dsh-client-locale",
|
|
42
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
44
|
+
],
|
|
45
|
+
"platform": "web"
|
|
33
46
|
}
|
|
34
47
|
},
|
|
35
48
|
"license": "MIT",
|
|
@@ -53,20 +66,29 @@
|
|
|
53
66
|
"devDependencies": {
|
|
54
67
|
"@biomejs/biome": "^2.5.8",
|
|
55
68
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
56
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
57
|
-
"@deepseek-ai/dsh-code-runtime": "^0.1.
|
|
58
|
-
"@deepseek-ai/dsh-compaction": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-compaction-tool-result-pruner": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-scope": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
64
|
-
"@deepseek-ai/dsh-subagent": "^0.1.
|
|
65
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.
|
|
66
|
-
"@deepseek-ai/dsh-token-meter": "^0.1.
|
|
67
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
+
"@deepseek-ai/dsh-agent": "^0.1.1-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-code-runtime": "^0.1.1-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-compaction": "^0.1.1-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-compaction-tool-result-pruner": "^0.1.1-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-scope": "^0.1.1-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-subagent": "^0.1.1-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-token-meter": "^0.1.1-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.1-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.1",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.1-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.1-rc.1",
|
|
69
87
|
"@types/node": "^22.20.0",
|
|
88
|
+
"@types/react": "~18.3.1",
|
|
89
|
+
"@types/react-dom": "~18.3.0",
|
|
90
|
+
"react": "^18.2.0",
|
|
91
|
+
"react-dom": "^18.2.0",
|
|
70
92
|
"tsdown": "^0.22.14",
|
|
71
93
|
"typescript": "^6.0.3",
|
|
72
94
|
"vitest": "^4.1.10",
|