@deepseek-ai/dsh-goal-round-driver 0.2.1-alpha.1 → 0.2.1-alpha.3

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
@@ -24,8 +24,8 @@
24
24
  en: a1312339977f1127
25
25
  zh: 57450327ff7e7d83
26
26
  /deepseek-ai-dsh-goal-round-driver/use-this-package/when-continuation-stops:
27
- en: 87b20bc93e1c6ebb
28
- zh: 20eebb2538da1551
27
+ en: 32ad77251e9f5acd
28
+ zh: a72f4c3e95c1a137
29
29
  /deepseek-ai-dsh-goal-round-driver/use-this-package/after-resume-fork-or-unload:
30
30
  en: 85d5470b1b330330
31
31
  zh: e761f9046ba7af8a
package/README.md CHANGED
@@ -50,7 +50,7 @@ With an exact live agent idle, an active armed goal, and remaining capacity, the
50
50
 
51
51
  ### When continuation stops
52
52
 
53
- A round starts only at whole-agent idle, and completion, pause, and blocking suppress continuation; a host-initiated pause also aborts the turn already running, while a model-initiated pause inside its own turn finishes normally. An edit only invalidates an in-flight round through the revision fence, and the driver continues the new revision. The driver also stops on its own when a turn ends on max tokens, a durability write fails, the agent is cancelled, the plugin unloads, or the round cap is exhausted — at the cap it records a blocker with the stable code `round-limit`. Cancellation never auto-restarts a round: a goal whose round was under way is paused at the next idle point, and a cancellation unrelated to a goal attempt only disarms continuation. A round prompt still queued when the agent reaches idle is removed from the inbox, so later human input does not wait behind it; when the cancelled turn belonged to other work, continuation is disarmed rather than paused.
53
+ A round starts only at whole-agent idle and, when the subagent service is loaded, only after the agent's progressing descendants settle; completion, pause, and blocking suppress continuation; a host-initiated pause also aborts the turn already running, while a model-initiated pause inside its own turn finishes normally. An edit only invalidates an in-flight round through the revision fence, and the driver continues the new revision. The driver also stops on its own when a turn ends on max tokens, a durability write fails, the agent is cancelled, the plugin unloads, or the round cap is exhausted — at the cap it records a blocker with the stable code `round-limit`. Cancellation never auto-restarts a round: a goal whose round was under way is paused at the next idle point, and a cancellation unrelated to a goal attempt only disarms continuation. A round prompt still queued when the agent reaches idle is removed from the inbox, so later human input does not wait behind it; when the cancelled turn belonged to other work, continuation is disarmed rather than paused.
54
54
 
55
55
  ### After resume, fork, or unload
56
56
 
package/README.zh.md CHANGED
@@ -50,7 +50,7 @@ kind: "package-reference"
50
50
 
51
51
  ### 何时停止续行
52
52
 
53
- Round 只在整个 agent 进入 idle 时启动;完成、暂停和阻塞会阻止续行;宿主发起的暂停还会中止正在运行的轮次,而模型在自己轮次内发起的暂停会正常结束。编辑只会通过修订栅栏使进行中的 Round 失效,驱动器会继续新修订。驱动器也会在以下情况自行停止:轮次因 max tokens 结束、持久性写入失败、agent 被取消、插件卸载,或 Round 上限耗尽——上限耗尽时它会以稳定代码 `round-limit` 记录一个 blocker。取消绝不会自动重启 Round:Round 已在进行的 goal 会在下一次 idle 时被暂停;与 goal 尝试无关的取消只会停用续行。agent 进入 idle 时仍在排队的 Round 提示会从收件箱移除,后续人类输入不会排在它后面等待;被取消的轮次属于其他工作时,续行会被停用而不是暂停。
53
+ Round 只在整个 agent 进入 idle 时启动;加载了子 agent 服务时,还要等该 agent 仍在推进的后代全部结束后才启动;完成、暂停和阻塞会阻止续行;宿主发起的暂停还会中止正在运行的轮次,而模型在自己轮次内发起的暂停会正常结束。编辑只会通过修订栅栏使进行中的 Round 失效,驱动器会继续新修订。驱动器也会在以下情况自行停止:轮次因 max tokens 结束、持久性写入失败、agent 被取消、插件卸载,或 Round 上限耗尽——上限耗尽时它会以稳定代码 `round-limit` 记录一个 blocker。取消绝不会自动重启 Round:Round 已在进行的 goal 会在下一次 idle 时被暂停;与 goal 尝试无关的取消只会停用续行。agent 进入 idle 时仍在排队的 Round 提示会从收件箱移除,后续人类输入不会排在它后面等待;被取消的轮次属于其他工作时,续行会被停用而不是暂停。
54
54
 
55
55
  ### resume、fork 或卸载之后
56
56
 
package/lib/index.js CHANGED
@@ -54,6 +54,7 @@ function renderThrown(value) {
54
54
  /** Install automatic same-session continuation and its race fences. */
55
55
  function apply(ctx) {
56
56
  const states = /* @__PURE__ */ new Map();
57
+ const unloading = Promise.withResolvers();
57
58
  /** Create state for an exact currently live agent. */
58
59
  function stateFor(agent) {
59
60
  const existing = states.get(agent);
@@ -75,6 +76,10 @@ function apply(ctx) {
75
76
  if (ctx.agents.get(state.agent.id) !== state.agent) return void 0;
76
77
  return ctx.goals.get(state.agent);
77
78
  }
79
+ /** Whether a goal may receive automatic rounds. */
80
+ function drivable(goal) {
81
+ return goal !== void 0 && goal.phase === "active" && goal.activation === "armed";
82
+ }
78
83
  /** Whether this exact lifecycle is quiescent with no competing prompt. */
79
84
  function readyToDrive(state) {
80
85
  return ctx.fiber.state === 2 && !state.stopping && ctx.agents.get(state.agent.id) === state.agent && state.agent.status === "idle" && !state.competingQueued;
@@ -121,7 +126,12 @@ function apply(ctx) {
121
126
  return;
122
127
  }
123
128
  const goal = currentGoal(state);
124
- if (goal === void 0 || goal.phase !== "active" || goal.activation !== "armed") return;
129
+ if (!drivable(goal)) return;
130
+ const subagents = ctx.get("subagents");
131
+ if (subagents !== void 0) {
132
+ await Promise.race([subagents.waitForChildren(agent), unloading.promise]);
133
+ if (!readyAfterCheckpoint(state)) return;
134
+ }
125
135
  if (goal.roundsStarted >= goal.maxGoalRounds) {
126
136
  ctx.goals.block(agent, goalRef(goal), {
127
137
  code: "round-limit",
@@ -342,6 +352,7 @@ function apply(ctx) {
342
352
  });
343
353
  for (const agent of ctx.agents.list()) disarm(stateFor(agent));
344
354
  yield async () => {
355
+ unloading.resolve();
345
356
  const waits = [];
346
357
  for (const state of states.values()) {
347
358
  state.stopping = true;
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "goal-round-driver"
4
+ }
5
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "目标自动续行",
4
+ "description": "在条件和额度允许时,让 AI 继续推进当前会话的目标。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-goal-round-driver",
3
3
  "description": "Race-fenced same-session goal-round driver",
4
- "version": "0.2.1-alpha.1",
4
+ "version": "0.2.1-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -19,30 +19,39 @@
19
19
  "default": "./lib/index.js"
20
20
  },
21
21
  "./src/*": "./src/*",
22
- "./package.json": "./package.json"
22
+ "./package.json": "./package.json",
23
+ "./locale/*.json": "./locale/*.json"
23
24
  },
24
25
  "files": [
26
+ "locale/*.json",
25
27
  "lib/index.js",
26
28
  "lib/types/**/*.d.ts"
27
29
  ],
28
30
  "license": "MIT",
29
31
  "peerDependencies": {
30
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
31
- "@deepseek-ai/dsh-goal": "0.2.1-alpha.1",
32
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
33
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
34
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
32
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
33
+ "@deepseek-ai/dsh-goal": "0.2.1-alpha.3",
34
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
35
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
36
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
37
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.3"
35
38
  },
36
39
  "devDependencies": {
37
- "@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.1",
38
- "@deepseek-ai/dsh-goal": "0.2.1-alpha.1",
39
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.1",
40
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
41
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
42
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
43
- "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
44
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
45
- "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.1",
46
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
40
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
41
+ "@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.3",
42
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.3",
43
+ "@deepseek-ai/dsh-goal": "0.2.1-alpha.3",
44
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
45
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.3",
46
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.3",
47
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.3",
48
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
49
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.3",
50
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.3"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@deepseek-ai/dsh-subagent": {
54
+ "optional": true
55
+ }
47
56
  }
48
57
  }