@deepseek-ai/dsh-repeat-tool-reminder 0.1.3-alpha.2 → 0.1.5-alpha.2

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.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/guard/repeat-tool-reminder/README.md
5
- README.md: 81a65629fe0e418e9a34c8b78046437575875e3c
6
- README.zh.md: d856032c65c788ad701148ab8e678c13cec42e4a
5
+ README.md: 13035b68e80c9eea3e87bb7c8315fbaf9b84a3c3
6
+ README.zh.md: 330dd22be31cbb128fe7807dd7e370c4ea2e1fe7
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- A model can get stuck calling the same tool with the same arguments — re-running a failing command, re-reading an unchanged file — burning time and tokens without making progress. `dsh-repeat-tool-reminder` notices the pattern and tells the model to stop: at chosen repeat counts it delivers a reminder to analyze the last result and either try a different approach or finish. The reminder is advice, never a block: a legitimate repeated call is delayed by nothing, and the decision to continue, change approach, or stop stays with the model. It tracks each agent separately, so one agent's loop never disturbs another's work, and a new user message clears the count. It ships enabled in the `dsh` base bundle with reminders at 3, 5, and 8 repeats.
12
+ This package helps a model escape loops in which it calls the same tool with identical arguments without making progress. At configured repeat counts, it asks the model to inspect the previous result and change approach or finish. The reminder is advisory: it never blocks or delays a legitimate repeated call. Repeats are tracked separately for each agent and cleared by a new user message. The `dsh` base bundle enables the package with reminders at 3, 5, and 8 repeats.
13
13
 
14
14
  ## Table of Contents
15
15
 
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 模型可能会卡在以相同参数调用同一工具上——反复运行失败的命令、反复读取未变化的文件——白白消耗时间和 token 却没有进展。`dsh-repeat-tool-reminder` 会发现这种模式并让模型停下来:在选定的重复次数上,它送出一条提醒,要求模型分析上一次结果并改用其他方法或结束任务。提醒只是建议,绝非阻止:合理的重复调用不会被延迟分毫,是否继续、改变方法或停止仍由模型决定。它分别跟踪每个 agent(智能体),一个 agent 的循环绝不会干扰另一个 agent 的工作,新的用户消息会清零计数。它随 `dsh` base 组合默认启用,在 3、5、8 次重复时提醒。
12
+ 本包帮助模型跳出以相同参数反复调用同一工具却没有进展的循环。达到配置的重复次数时,它会要求模型检查上一次结果并改变方法或结束任务。提醒只是建议,绝不会阻止或延迟合理的重复调用。每个 agent 的重复分别跟踪,新的用户消息会清除计数。`dsh` base 组合默认启用本包,并在重复 3、5、8 次时提醒。
13
13
 
14
14
  ## 目录
15
15
 
package/lib/index.js CHANGED
@@ -520,11 +520,13 @@ function contentHasImage(content) {
520
520
  /**
521
521
  * True when typed model content contains a file block, walking nested
522
522
  * tool-result content on the same recursion every file policy shares.
523
+ * Reads current content on every call without retaining scan results.
523
524
  * @param content - typed model content blocks.
524
525
  * @returns whether any nested block is a file.
525
526
  */
526
527
  function contentHasFile(content) {
527
- return content.some((block) => block.type === "file" || block.type === "tool-result" && contentHasFile(block.content));
528
+ for (const block of content) if (block.type === "file" || block.type === "tool-result" && contentHasFile(block.content)) return true;
529
+ return false;
528
530
  }
529
531
  /**
530
532
  * Stable model-facing handle for one durable file reference: the address of
@@ -1079,6 +1081,8 @@ var LlmError = class extends HarnessError {
1079
1081
  const context = resolved.context;
1080
1082
  if (context !== void 0 && (!Number.isInteger(context.contextWindow) || context.contextWindow <= 0)) throw new LlmError(`adapter returned invalid context metadata for provider "${provider}" model "${model}"`, "INVALID_MODEL_CONTEXT");
1081
1083
  const inputModalities = this.detachedModalities(resolved.inputModalities);
1084
+ const systemPromptUpdate = resolved.systemPromptUpdate;
1085
+ if (systemPromptUpdate !== void 0 && systemPromptUpdate !== "in-history") throw new LlmError(`adapter returned invalid system prompt update mode for provider "${provider}" model "${model}"`, "INVALID_MODEL_INFO");
1082
1086
  const defaultMaxTokens = resolved.defaultMaxTokens;
1083
1087
  if (defaultMaxTokens !== void 0 && (!Number.isSafeInteger(defaultMaxTokens) || defaultMaxTokens <= 0)) throw new LlmError(`adapter returned invalid default maxTokens for provider "${provider}" model "${model}"`, "INVALID_MODEL_MAX_TOKENS");
1084
1088
  const info = {
@@ -1088,7 +1092,8 @@ var LlmError = class extends HarnessError {
1088
1092
  ...resolved.description === void 0 ? {} : { description: resolved.description },
1089
1093
  ...inputModalities === void 0 ? {} : { inputModalities },
1090
1094
  ...context === void 0 ? {} : { context: { contextWindow: context.contextWindow } },
1091
- ...defaultMaxTokens === void 0 ? {} : { defaultMaxTokens }
1095
+ ...defaultMaxTokens === void 0 ? {} : { defaultMaxTokens },
1096
+ ...resolved.systemPromptUpdate === void 0 ? {} : { systemPromptUpdate: resolved.systemPromptUpdate }
1092
1097
  };
1093
1098
  const reasoning = resolved.reasoning;
1094
1099
  if (reasoning === void 0) return info;
@@ -1182,6 +1187,7 @@ var LlmError = class extends HarnessError {
1182
1187
  adapterDefaults,
1183
1188
  ...context === void 0 ? {} : { context },
1184
1189
  ...modelInfo.inputModalities === void 0 ? {} : { inputModalities: Object.freeze([...modelInfo.inputModalities]) },
1190
+ ...modelInfo.systemPromptUpdate === void 0 ? {} : { systemPromptUpdate: modelInfo.systemPromptUpdate },
1185
1191
  stream: (options) => {
1186
1192
  if (dispatched) throw new LlmError("a prepared LLM call can only be dispatched once", "INVALID_PREPARED_CALL");
1187
1193
  if (!callConfigEquals(options, resolvedConfig)) throw new LlmError("prepared LLM call config changed before adapter dispatch", "INVALID_PREPARED_CALL");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-repeat-tool-reminder",
3
3
  "description": "Repeat-tool-call guard plugin: advisory reminders when an agent loops on identical tool calls",
4
- "version": "0.1.3-alpha.2",
4
+ "version": "0.1.5-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,18 +30,18 @@
30
30
  "@deepseek-ai/schemastery": "^3.18.2"
31
31
  },
32
32
  "peerDependencies": {
33
- "@deepseek-ai/dsh-agent": "^0.1.3-alpha.2",
34
- "@deepseek-ai/dsh-tools": "^0.1.3-alpha.2",
33
+ "@deepseek-ai/dsh-agent": "^0.1.5-alpha.2",
34
+ "@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
35
35
  "@deepseek-ai/cordis": "^4.0.2"
36
36
  },
37
37
  "devDependencies": {
38
- "@deepseek-ai/dsh-agent": "^0.1.3-alpha.2",
39
- "@deepseek-ai/dsh-agent-loop": "^0.1.3-alpha.2",
40
- "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.3-alpha.2",
41
- "@deepseek-ai/dsh-llm": "^0.1.3-alpha.2",
42
- "@deepseek-ai/dsh-session": "^0.1.3-alpha.2",
38
+ "@deepseek-ai/dsh-agent": "^0.1.5-alpha.2",
39
+ "@deepseek-ai/dsh-agent-loop": "^0.1.5-alpha.2",
40
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-alpha.2",
41
+ "@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
42
+ "@deepseek-ai/dsh-session": "^0.1.5-alpha.2",
43
43
  "@deepseek-ai/cordis": "^4.0.2",
44
- "@deepseek-ai/dsh-tools": "^0.1.3-alpha.2",
45
- "@deepseek-ai/dsh-session-projection": "^0.1.3-alpha.2"
44
+ "@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
45
+ "@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.2"
46
46
  }
47
47
  }