@deepseek-ai/dsh-tool-goal 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 +2 -2
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/index.js +2 -0
- package/package.json +17 -16
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/goal/tool-goal/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: c40b9eb302ace23c2448114433eda364083a5293
|
|
6
|
+
README.zh.md: fdd1b1a317bed56f18c9eb8cc107b448e2b85981
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-tool-goal`
|
|
12
|
+
`dsh-tool-goal` lets a model read persisted goals and infer and create a long-running goal from a direct human request. Creating, editing, pausing, or resuming requires that direct request in a top-level agent turn; completing or blocking also works in an autonomous goal round. Updates require the exact goal id and revision returned by a prior read. `resume` rearms active-but-disarmed or blocked goals, while users resume durable paused goals through Web or `/goal resume`. Autonomous blocking requires the same condition for a configurable threshold of three consecutive rounds by default.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -52,7 +52,7 @@ The value must be a positive safe integer. It supplies both the hard lower bound
|
|
|
52
52
|
|
|
53
53
|
### Authority rules
|
|
54
54
|
|
|
55
|
-
The tools execute only for the exact live calling agent inside its active driver with an open turn. `create`, `edit`, `pause`, and `resume` additionally require a direct human message in a runtime-root agent's current turn — a subagent or a non-human producer cannot create or edit goals. `complete` and `blocked` also accept the exact current goal round: a goal-sourced round may complete the goal immediately, but a blocked call is mechanically rejected until the configured number of consecutive rounds has passed — the model judges whether the same condition actually persisted and must describe it in `blocked_reason`. A direct human request may stop a goal immediately.
|
|
55
|
+
The tools execute only for the exact live calling agent inside its active driver with an open turn. `create`, `edit`, `pause`, and `resume` additionally require a direct human message in a runtime-root agent's current turn — a subagent or a non-human producer cannot create or edit goals. `resume` rejects a durable paused goal before the goal service runs; that state belongs to the user-facing resume path. `complete` and `blocked` also accept the exact current goal round: a goal-sourced round may complete the goal immediately, but a blocked call is mechanically rejected until the configured number of consecutive rounds has passed — the model judges whether the same condition actually persisted and must describe it in `blocked_reason`. A direct human request may stop a goal immediately.
|
|
56
56
|
|
|
57
57
|
An autonomous round that successfully reports `complete` or `blocked` also ends the physical turn after that step, and the model receives a closing instruction to write the final message to the user. Direct-human mutations never trigger that stop: the assistant may acknowledge the change and the loop keeps concurrent human steering available.
|
|
58
58
|
|
|
@@ -68,7 +68,7 @@ This section explains how the tools enforce authority and render output; the obs
|
|
|
68
68
|
|
|
69
69
|
### Design
|
|
70
70
|
|
|
71
|
-
- **Authority at execution.** Every call resolves the exact live agent, its inherited `AgentRegistry` initiator, running status, and an open turn; `create`, `edit`, `pause`, and `resume` additionally require an accepted `{ kind: 'user' }` message or steering event in a runtime-root agent's current turn. Durable fork lineage does not demote a resumed root; live subagent ownership does.
|
|
71
|
+
- **Authority at execution.** Every call resolves the exact live agent, its inherited `AgentRegistry` initiator, running status, and an open turn; `create`, `edit`, `pause`, and `resume` additionally require an accepted `{ kind: 'user' }` message or steering event in a runtime-root agent's current turn. A durable paused goal fails the `resume` action with `GOAL_TOOL_RESUME_PAUSED`; the user-facing command or Web control owns that transition. Durable fork lineage does not demote a resumed root; live subagent ownership does.
|
|
72
72
|
- **Host attestation of human input.** `{ kind: 'user' }` is assigned by `Agent.followup()` and `steer()` when their caller omits a source, so plugins, schedulers, and other non-human producers must pass their own source rather than inheriting human authority.
|
|
73
73
|
- **System-prompt guidance with the configured threshold.** The package registers one `tool:goal` system-prompt section whose fixed text interpolates `blockedAfterConsecutiveRounds`; the same value is the hard lower bound enforced at execution.
|
|
74
74
|
- **Wrap-up context for terminal rounds.** A successful autonomous `complete` or `blocked` defers a closing `<goal_complete>` or `<goal_blocked>` instruction so the model addresses the user once before the turn ends; direct-human mutations never defer this context.
|
|
@@ -109,7 +109,7 @@ The tools are the model-facing half of the goal surface; read these pages for th
|
|
|
109
109
|
|
|
110
110
|
#### What the model sees
|
|
111
111
|
|
|
112
|
-
A fixed goal policy says when semantic human intent warrants creation, requires exact read-before-update refs, explains rearming after resume/fork, and limits completion/blocking claims. The configured threshold is interpolated into that guidance.
|
|
112
|
+
A fixed goal policy says when semantic human intent warrants creation, requires exact read-before-update refs, explains rearming after resume/fork, and limits completion/blocking claims. Durable paused resume is rejected at execution with `GOAL_TOOL_RESUME_PAUSED`; the user-facing goal control owns that transition. The configured threshold is interpolated into that guidance.
|
|
113
113
|
|
|
114
114
|
##### Goal policy
|
|
115
115
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-tool-goal`
|
|
12
|
+
`dsh-tool-goal` 让模型读取持久 goal,并根据人类直接请求推断和创建长期 goal。创建、编辑、暂停或恢复要求该直接请求出现在顶层 agent 轮次中;完成或阻塞也可以在自主 Goal Round 中执行。更新必须使用先前读取到的精确 goal id 和 revision。`resume` 会重新启用 active-but-disarmed 或 blocked 的 goal,而持久的 paused goal 由用户通过 Web 或 `/goal resume` 恢复。自主阻塞要求同一条件持续达到可配置阈值,默认是连续三个 Round。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -52,7 +52,7 @@ kind: "package-reference"
|
|
|
52
52
|
|
|
53
53
|
### 权限规则
|
|
54
54
|
|
|
55
|
-
工具只为活跃驱动器内、处于开放轮次中的精确活跃调用 agent 执行。`create`、`edit`、`pause` 和 `resume` 还要求运行时根 agent(智能体)的当前轮次中存在人类直接消息——subagent 或非人类生产方不能创建或编辑 goal。`complete` 和 `blocked` 还接受完全一致的当前 Goal Round:来源为 goal 的 Round 可以立即完成 goal,但 blocked 调用在达到配置的连续 Round 数量之前会被机械拒绝——模型判断同一条件是否确实持续,并必须在 `blocked_reason` 中说明。人类直接请求可以立即停止 goal。
|
|
55
|
+
工具只为活跃驱动器内、处于开放轮次中的精确活跃调用 agent 执行。`create`、`edit`、`pause` 和 `resume` 还要求运行时根 agent(智能体)的当前轮次中存在人类直接消息——subagent 或非人类生产方不能创建或编辑 goal。`resume` 会在 goal 服务执行前拒绝持久的 paused goal;该状态只属于面向用户的恢复路径。`complete` 和 `blocked` 还接受完全一致的当前 Goal Round:来源为 goal 的 Round 可以立即完成 goal,但 blocked 调用在达到配置的连续 Round 数量之前会被机械拒绝——模型判断同一条件是否确实持续,并必须在 `blocked_reason` 中说明。人类直接请求可以立即停止 goal。
|
|
56
56
|
|
|
57
57
|
成功报告 `complete` 或 `blocked` 的自主 Round 还会在该步骤后结束物理轮次,模型会收到一条结束指令,要求向用户写出最终消息。人类直接变更绝不会触发这种停止:assistant 可以确认变更,循环仍可接收并发的人类 steering(中途引导)。
|
|
58
58
|
|
|
@@ -68,7 +68,7 @@ kind: "package-reference"
|
|
|
68
68
|
|
|
69
69
|
### 设计
|
|
70
70
|
|
|
71
|
-
- **执行时权限。** 每次调用都解析精确活跃 agent、其继承的 `AgentRegistry` initiator、running 状态与开放轮次;`create`、`edit`、`pause` 和 `resume` 还要求运行时根 agent 的当前轮次中存在已接受的 `{ kind: 'user' }` 消息或 steering
|
|
71
|
+
- **执行时权限。** 每次调用都解析精确活跃 agent、其继承的 `AgentRegistry` initiator、running 状态与开放轮次;`create`、`edit`、`pause` 和 `resume` 还要求运行时根 agent 的当前轮次中存在已接受的 `{ kind: 'user' }` 消息或 steering 事件。持久的 paused goal 会让 `resume` 以 `GOAL_TOOL_RESUME_PAUSED` 失败;面向用户的命令或 Web 控件拥有该转换。持久 fork 谱系不会降低已恢复根 agent 的等级;活跃 subagent 所有权会降低。
|
|
72
72
|
- **人类输入的宿主证明。** `Agent.followup()` 与 `steer()` 会在调用方省略 source 时分配 `{ kind: 'user' }`,因此插件、调度器与其他非人类生产方必须传入自己的 source,不能继承人类权限。
|
|
73
73
|
- **带配置阈值的系统提示词指引。** 本包注册一个 `tool:goal` 系统提示词章节,其固定文本插入 `blockedAfterConsecutiveRounds`;同一数值就是执行时强制执行的硬下限。
|
|
74
74
|
- **终局 Round 的结束上下文。** 成功的自主 `complete` 或 `blocked` 会延后一条 `<goal_complete>` 或 `<goal_blocked>` 结束指令,让模型在轮次结束前向用户做一次交代;人类直接变更绝不会延后该上下文。
|
|
@@ -109,7 +109,7 @@ kind: "package-reference"
|
|
|
109
109
|
|
|
110
110
|
#### 模型看到的内容
|
|
111
111
|
|
|
112
|
-
固定 goal 策略说明何种用户语义意图值得创建 goal,要求更新前先精确读取 ref,解释会话 resume/fork
|
|
112
|
+
固定 goal 策略说明何种用户语义意图值得创建 goal,要求更新前先精确读取 ref,解释会话 resume/fork 后如何重新启用续行,并限制完成/阻塞声明。持久 paused 的 resume 会在执行时以 `GOAL_TOOL_RESUME_PAUSED` 拒绝;面向用户的 goal 控件拥有该转换。配置的阈值会插入该指引。
|
|
113
113
|
|
|
114
114
|
##### Goal 策略
|
|
115
115
|
|
package/lib/index.js
CHANGED
|
@@ -348,6 +348,8 @@ function apply(ctx, config) {
|
|
|
348
348
|
if (args.action === "pause" || args.action === "resume") {
|
|
349
349
|
requireDirectHuman(ctx, execution);
|
|
350
350
|
if (hasText(args.objective) || hasRoundCap(args.max_goal_rounds) || hasText(args.blocked_reason)) throw new HarnessError("objective and max_goal_rounds are valid only with action edit; blocked_reason is valid only with action blocked", "GOAL_TOOL_INVALID_UPDATE");
|
|
351
|
+
const current = ctx.goals.get(execution.agent);
|
|
352
|
+
if (args.action === "resume" && current?.id === ref.id && current.revision === ref.revision && current.phase === "paused") throw new HarnessError("the model cannot resume a paused goal; the user must resume it", "GOAL_TOOL_RESUME_PAUSED");
|
|
351
353
|
const goal = args.action === "pause" ? ctx.goals.pause(execution.agent, ref) : ctx.goals.resume(execution.agent, ref);
|
|
352
354
|
return Promise.resolve(goalValue(goal));
|
|
353
355
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-goal",
|
|
3
3
|
"description": "Model-facing same-session goal tools with execution-time authority checks",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,28 +27,29 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-
|
|
31
|
-
"@deepseek-ai/dsh-
|
|
32
|
-
"@deepseek-ai/dsh-
|
|
33
|
-
"@deepseek-ai/dsh-
|
|
34
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.3-alpha.2",
|
|
35
|
-
"@deepseek-ai/dsh-tools": "^0.1.3-alpha.2",
|
|
30
|
+
"@deepseek-ai/dsh-goal": "^0.1.5-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-alpha.2",
|
|
36
34
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
37
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
35
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
|
|
37
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
44
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
45
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
44
|
+
"@deepseek-ai/dsh-agent": "^0.1.5-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.5-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-llm": "^0.1.5-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-goal": "^0.1.5-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-session": "^0.1.5-alpha.2",
|
|
50
50
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.
|
|
51
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.5-alpha.2"
|
|
53
54
|
}
|
|
54
55
|
}
|