dsh-repeat-guard 0.2.0 → 0.2.1
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/lib/resume.d.ts +2 -2
- package/lib/resume.js +1 -1
- package/package.json +1 -1
- package/src/resume.ts +5 -3
package/lib/resume.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ import type { GuardState } from './types.js';
|
|
|
21
21
|
declare module '@deepseek-ai/dsh-llm' {
|
|
22
22
|
interface MessageSourceMap {
|
|
23
23
|
/** 本插件推给模型的续跑提示。 */
|
|
24
|
-
'repeat-guard': {
|
|
25
|
-
kind: 'repeat-guard';
|
|
24
|
+
'plugin:repeat-guard': {
|
|
25
|
+
kind: 'plugin:repeat-guard';
|
|
26
26
|
} & ContextFormed;
|
|
27
27
|
}
|
|
28
28
|
}
|
package/lib/resume.js
CHANGED
|
@@ -33,7 +33,7 @@ export function reviveTurn(state, agent, config) {
|
|
|
33
33
|
// `form: 'notice'` 要求同时给出 `summary`(dsh-llm 的 ContextFormed),
|
|
34
34
|
// 客户端据此把它渲染成折叠的 context 行,而不是用户气泡。
|
|
35
35
|
source: {
|
|
36
|
-
kind: 'repeat-guard',
|
|
36
|
+
kind: 'plugin:repeat-guard',
|
|
37
37
|
form: 'notice',
|
|
38
38
|
summary: config.resumeSummary,
|
|
39
39
|
},
|
package/package.json
CHANGED
package/src/resume.ts
CHANGED
|
@@ -23,11 +23,13 @@ import type { GuardState } from './types.js';
|
|
|
23
23
|
|
|
24
24
|
// dsh 0.1.7 起 `MessageSourceMap` 没有通用的 `plugin` kind:每个生产者在自己的模块里
|
|
25
25
|
// 声明自己的 kind(merge-extensible),`form` 另由 ContextFormed 提供。
|
|
26
|
+
// 用 `plugin:<名>` 而不是裸名:会话格式 v3→v4 的迁移器对历史消息生成的正是这个前缀
|
|
27
|
+
// (dsh-session-format-v3-to-v4 的 producerKind),裸名会让同一生产者出现两种 kind。
|
|
26
28
|
declare module '@deepseek-ai/dsh-llm' {
|
|
27
29
|
interface MessageSourceMap {
|
|
28
30
|
/** 本插件推给模型的续跑提示。 */
|
|
29
|
-
'repeat-guard': {
|
|
30
|
-
kind: 'repeat-guard';
|
|
31
|
+
'plugin:repeat-guard': {
|
|
32
|
+
kind: 'plugin:repeat-guard';
|
|
31
33
|
} & ContextFormed;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -51,7 +53,7 @@ export function reviveTurn(state: GuardState, agent: Agent, config: RepeatGuardC
|
|
|
51
53
|
// `form: 'notice'` 要求同时给出 `summary`(dsh-llm 的 ContextFormed),
|
|
52
54
|
// 客户端据此把它渲染成折叠的 context 行,而不是用户气泡。
|
|
53
55
|
source: {
|
|
54
|
-
kind: 'repeat-guard',
|
|
56
|
+
kind: 'plugin:repeat-guard',
|
|
55
57
|
form: 'notice',
|
|
56
58
|
summary: config.resumeSummary,
|
|
57
59
|
},
|