@deepseek-ai/dsh-command-goal 0.1.0-rc.7 → 0.1.0-rc.8

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/goal/command-goal/README.md
5
- README.md: ee32ea9e5b90d79f9912d7817d6f14b2227ece64
6
- README.zh.md: ee40cd4219c45b6d9650036fda21c56599be6abd
5
+ README.md: 483f756517f511ec506868b008b88e99b2477dc0
6
+ README.zh.md: cd3c396ad446721de4cc091d511b615149ab2b30
package/README.md CHANGED
@@ -17,6 +17,8 @@ Human-facing `/goal` control over [`ctx.goals`](../goal/README.md). The plugin r
17
17
 
18
18
  Control words are case-insensitive only when they occupy the complete input. Every other non-empty suffix is an objective, so `/goal pause after verification` creates that literal objective. The goal domain trims and validates objectives. Because the generic command plane has no modal editor or confirmation primitive, `edit` takes its replacement inline and an unfinished replacement returns a direct error instructing the user to edit or clear.
19
19
 
20
+ The command declares `input.images`, so composer image attachments may accompany an invocation. Attachments only accompany an objective: on a successful create or edit the producer submits one user followup carrying the admitted image blocks plus the fixed text `Reference images for the goal objective.`, so later goal rounds read them from ordinary session history without the goal domain storing attachment state. Every other sub-command, and any refused create or edit, returns a direct error and submits nothing, so the dispatching composer keeps the images.
21
+
20
22
  Expected domain rejections become stable direct command errors without exposing branded ids or revisions. Unexpected implementation failures still reject dispatch so adapters can report them as command failures. Generic command text and output remain live UI state; `dsh-goal` persists every accepted mutation through its own durable `goal/change` event.
21
23
 
22
24
  ## Composition
@@ -40,11 +42,11 @@ The shipped `dsh` base enables the persisted-goal stack and this command; the We
40
42
 
41
43
  #### What the model sees
42
44
 
43
- The slash input, mutation, and direct status/error output are absent from model requests. The goal domain records the mutation as `goal/change`; an enabled same-session driver may expose the resulting state in a later continuation prompt. Presentation text is never logged.
45
+ The slash input, mutation, and direct status/error output are absent from model requests. The goal domain records the mutation as `goal/change`; an enabled same-session driver may expose the resulting state in a later continuation prompt. Presentation text is never logged. When a create or edit carries image attachments, the model sees one ordinary user message: the image blocks followed by the text `Reference images for the goal objective.`; it precedes the next goal round in session history.
44
46
 
45
47
  #### Token effect
46
48
 
47
- Reading status, mutating a goal, or receiving a direct command error adds no model tokens. An enabled same-session driver may add later goal-round prompts.
49
+ Reading status, mutating a goal, or receiving a direct command error adds no model tokens. An enabled same-session driver may add later goal-round prompts. An objective's image attachments add one user message billed like any image prompt.
48
50
 
49
51
  #### KV Cache effect
50
52
 
package/README.zh.md CHANGED
@@ -17,6 +17,8 @@
17
17
 
18
18
  只有控制词占据完整输入时才不区分大小写。其他任何非空后缀都属于目标,因此 `/goal pause after verification` 会创建该字面目标。goal 领域会去除目标首尾空白并进行验证。由于通用命令平面没有模态编辑器或确认原语,`edit` 会内联接收替换内容;若试图替换未完成的 goal,则直接返回错误,提示用户执行 edit 或 clear。
19
19
 
20
+ 该命令声明了 `input.images`,因此 composer 图片附件可以随调用一起提交。附件只随目标本身:create 或 edit 成功时,生产方提交一条用户 followup 消息,内容为已准入的图片块加固定文本 `Reference images for the goal objective.`,后续 Goal Round 从普通会话历史中读取它们,goal 领域不存储附件状态。其他任何子命令、以及被拒绝的 create 或 edit,都直接返回错误且不提交任何消息,分发方 composer 保留图片。
21
+
20
22
  可预期的领域拒绝会变成稳定的直接命令错误,不公开带品牌类型的 id 或 revision。意外实现失败仍会 reject 分发,使适配器能将其报告为命令失败。通用命令文本和输出仍属于实时 UI 状态;`dsh-goal` 通过自有的持久 `goal/change` 事件记录每项已接受变更。
21
23
 
22
24
  ## 组合
@@ -40,11 +42,11 @@
40
42
 
41
43
  #### 模型看到的内容
42
44
 
43
- 斜杠输入、变更以及直接状态/错误输出不会进入模型请求。goal 领域把变更记录为 `goal/change`;已启用的同会话驱动器可以在后续继续执行提示词中暴露结果状态。呈现文本绝不会记录到日志中。
45
+ 斜杠输入、变更以及直接状态/错误输出不会进入模型请求。goal 领域把变更记录为 `goal/change`;已启用的同会话驱动器可以在后续继续执行提示词中暴露结果状态。呈现文本绝不会记录到日志中。当 create 或 edit 携带图片附件时,模型会看到一条普通用户消息:图片块后跟文本 `Reference images for the goal objective.`,在会话历史中位于下一个 Goal Round 之前。
44
46
 
45
47
  #### Token 影响
46
48
 
47
- 读取状态、变更 goal 或收到直接命令错误不会增加模型 token。已启用的同会话驱动器可能增加后续 Goal Round 提示词。
49
+ 读取状态、变更 goal 或收到直接命令错误不会增加模型 token。已启用的同会话驱动器可能增加后续 Goal Round 提示词。目标携带的图片附件会增加一条用户消息,其计费与任何图片提示词相同。
48
50
 
49
51
  #### KV Cache 影响
50
52
 
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { GoalError } from "@deepseek-ai/dsh-goal";
2
+ import { createUserMessage } from "@deepseek-ai/dsh-llm";
2
3
  //#region lib/types/index.js
3
4
  /**
4
5
  * Human-facing `/goal` command over the persisted same-session goal domain.
@@ -87,9 +88,29 @@ function missingGoal(action) {
87
88
  text: `No goal is currently set; /goal ${action} requires one. ${USAGE}`
88
89
  };
89
90
  }
91
+ /**
92
+ * Submit the invocation's admitted composer images as one model-visible user
93
+ * message ahead of the goal's next round. The images precede a fixed text
94
+ * block naming their role, so a later goal round reads them from ordinary
95
+ * session history without the goal domain storing attachment state.
96
+ */
97
+ function submitObjectiveAttachments(invocation) {
98
+ if (invocation.attachments.length === 0) return;
99
+ invocation.agent.followup(createUserMessage({
100
+ content: [...invocation.attachments, {
101
+ type: "text",
102
+ text: "Reference images for the goal objective."
103
+ }],
104
+ source: { kind: "user" }
105
+ }));
106
+ }
90
107
  /** Execute one parsed human command through the domain that owns persistence. */
91
108
  function executeGoalCommand(ctx, invocation) {
92
109
  const command = parseGoalCommand(invocation.rawInput);
110
+ if (invocation.attachments.length > 0 && command.kind !== "create" && command.kind !== "edit") return {
111
+ kind: "error",
112
+ text: "Image attachments only accompany a goal objective: /goal <objective> or /goal edit <objective>."
113
+ };
93
114
  try {
94
115
  const current = ctx.goals.get(invocation.agent);
95
116
  switch (command.kind) {
@@ -101,16 +122,26 @@ function executeGoalCommand(ctx, invocation) {
101
122
  kind: "error",
102
123
  text: `Goal editing requires a replacement objective.\n${USAGE}`
103
124
  };
104
- case "create":
125
+ case "create": {
105
126
  if (current !== void 0 && current.phase !== "complete") return {
106
127
  kind: "error",
107
128
  text: `A goal is already ${phaseLabel(current.phase)}. Use /goal edit <objective> to change it or /goal clear before replacing it.`
108
129
  };
109
- return renderGoal("Goal created", ctx.goals.create(invocation.agent, { objective: command.objective }));
110
- case "edit":
130
+ const created = ctx.goals.create(invocation.agent, { objective: command.objective });
131
+ submitObjectiveAttachments(invocation);
132
+ return renderGoal("Goal created", created);
133
+ }
134
+ case "edit": {
111
135
  if (current === void 0) return missingGoal("edit");
112
- if (current.phase === "complete") return renderGoal("Goal created", ctx.goals.create(invocation.agent, { objective: command.objective }));
113
- return renderGoal("Goal updated", ctx.goals.edit(invocation.agent, goalRef(current), { objective: command.objective }));
136
+ if (current.phase === "complete") {
137
+ const replaced = ctx.goals.create(invocation.agent, { objective: command.objective });
138
+ submitObjectiveAttachments(invocation);
139
+ return renderGoal("Goal created", replaced);
140
+ }
141
+ const edited = ctx.goals.edit(invocation.agent, goalRef(current), { objective: command.objective });
142
+ submitObjectiveAttachments(invocation);
143
+ return renderGoal("Goal updated", edited);
144
+ }
114
145
  case "pause":
115
146
  if (current === void 0) return missingGoal("pause");
116
147
  return renderGoal("Goal paused", ctx.goals.pause(invocation.agent, goalRef(current)));
@@ -143,7 +174,10 @@ function apply(ctx) {
143
174
  ctx.commands.register({
144
175
  name: "goal",
145
176
  description: "set or view the goal for a long-running task",
146
- input: { hint: "[<objective>|clear|edit <objective>|pause|resume]" },
177
+ input: {
178
+ hint: "[<objective>|clear|edit <objective>|pause|resume]",
179
+ images: true
180
+ },
147
181
  handler: (invocation) => executeGoalCommand(ctx, invocation)
148
182
  });
149
183
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-command-goal",
3
3
  "description": "Human-facing slash command for persisted same-session goals",
4
- "version": "0.1.0-rc.7",
4
+ "version": "0.1.0-rc.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,19 +32,20 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "peerDependencies": {
35
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
36
- "@deepseek-ai/dsh-goal": "^0.1.0-rc.7",
37
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
35
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.8",
36
+ "@deepseek-ai/dsh-goal": "^0.1.0-rc.8",
37
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
38
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.8",
38
39
  "@deepseek-ai/cordis": "^4.0.1"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
42
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
43
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
44
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
45
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.7",
46
- "@deepseek-ai/dsh-goal": "^0.1.0-rc.7",
47
- "@deepseek-ai/cordis": "^4.0.1",
48
- "@deepseek-ai/dsh-session": "^0.1.0-rc.7"
43
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.8",
44
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.8",
45
+ "@deepseek-ai/dsh-goal": "^0.1.0-rc.8",
46
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
47
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.8",
48
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.8",
49
+ "@deepseek-ai/cordis": "^4.0.1"
49
50
  }
50
51
  }