dsh-plugin-dev-kb 1.0.9 → 1.1.0
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/CHANGELOG.md +10 -0
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/kb/INDEX.md +4 -2
- package/kb/README.md +4 -4
- package/kb/extra/AGENTS.md +1 -1
- package/kb/extra/cookbook/adding-a-remote-api.md +197 -0
- package/kb/extra/cookbook/adding-a-remote-api.zh.md +197 -0
- package/kb/extra/deepseek-llm-api-wire-extensions.md +18 -14
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +18 -14
- package/kb/extra/event-producer-consumer.md +44 -43
- package/kb/extra/event-producer-consumer.zh.md +47 -46
- package/kb/extra/i18n/style-samples.md +2 -2
- package/kb/extra/module-graph.md +444 -991
- package/kb/extra/module-graph.zh.md +446 -993
- package/kb/extra/subsystems/agent-team.md +4 -3
- package/kb/extra/subsystems/agent-team.zh.md +4 -3
- package/kb/extra/subsystems/attachment.md +157 -4
- package/kb/extra/subsystems/attachment.zh.md +157 -4
- package/kb/extra/subsystems/feedback.md +2 -2
- package/kb/extra/subsystems/feedback.zh.md +2 -2
- package/kb/extra/testing.md +6 -2
- package/kb/extra/testing.zh.md +6 -2
- package/kb/extra/web-styling.md +4 -0
- package/kb/extra/web-styling.zh.md +4 -0
- package/kb/meta/search-index.json +135 -111
- package/kb/meta/site-pages.txt +184 -182
- package/kb/meta/source.json +5 -5
- package/kb/meta/topics.md +4 -4
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +3 -2
- package/kb/site/develop/practice/llm-adapter.md +4 -3
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +3 -2
- package/kb/site/en/develop/practice/llm-adapter.md +4 -3
- package/kb/site/en/guide/network-proxy.md +87 -0
- package/kb/site/en/guide/providers.md +70 -17
- package/kb/site/en/guide/schedule.md +2 -0
- package/kb/site/en/reference/agent-lifecycle.md +5 -3
- package/kb/site/en/reference/api-gateway.md +2 -2
- package/kb/site/en/reference/capability-seams.md +14 -7
- package/kb/site/en/reference/config-catalog.md +157 -230
- package/kb/site/en/reference/cookbook/adding-a-package.md +1 -2
- package/kb/site/en/reference/cookbook/adding-a-settings-card.md +10 -8
- package/kb/site/en/reference/cookbook/extension-cookbook.md +15 -12
- package/kb/site/en/reference/index.md +11 -4
- package/kb/site/en/reference/persistence-catalog.md +91 -70
- package/kb/site/en/reference/subsystems/code-runtime.md +7 -3
- package/kb/site/en/reference/subsystems/commands.md +25 -16
- package/kb/site/en/reference/subsystems/compaction.md +9 -9
- package/kb/site/en/reference/subsystems/conversation.md +11 -4
- package/kb/site/en/reference/subsystems/core.md +96 -15
- package/kb/site/en/reference/subsystems/credentials.md +5 -4
- package/kb/site/en/reference/subsystems/goal.md +1 -1
- package/kb/site/en/reference/subsystems/index.md +1 -1
- package/kb/site/en/reference/subsystems/llm-streaming.md +24 -3
- package/kb/site/en/reference/subsystems/permission-presets.md +5 -5
- package/kb/site/en/reference/subsystems/persistence.md +185 -194
- package/kb/site/en/reference/subsystems/plan.md +3 -3
- package/kb/site/en/reference/subsystems/sandbox.md +2 -0
- package/kb/site/en/reference/subsystems/schedule.md +9 -3
- package/kb/site/en/reference/subsystems/session-projection.md +50 -24
- package/kb/site/en/reference/subsystems/session-query.md +19 -13
- package/kb/site/en/reference/subsystems/session-reference.md +25 -1
- package/kb/site/en/reference/subsystems/session-telemetry.md +6 -5
- package/kb/site/en/reference/subsystems/session-title.md +6 -6
- package/kb/site/en/reference/subsystems/session.md +156 -73
- package/kb/site/en/reference/subsystems/settings.md +30 -12
- package/kb/site/en/reference/subsystems/skills.md +1 -1
- package/kb/site/en/reference/subsystems/slots.md +1 -0
- package/kb/site/en/reference/subsystems/storage.md +28 -5
- package/kb/site/en/reference/subsystems/subagent.md +43 -97
- package/kb/site/en/reference/subsystems/system-prompt.md +16 -3
- package/kb/site/en/reference/subsystems/token-meter.md +2 -2
- package/kb/site/en/reference/subsystems/typert.md +18 -18
- package/kb/site/en/reference/subsystems/web-client.md +1 -1
- package/kb/site/en/reference/subsystems/workspace.md +8 -8
- package/kb/site/en/reference/tool-catalog.md +10 -64
- package/kb/site/guide/network-proxy.md +87 -0
- package/kb/site/guide/providers.md +70 -17
- package/kb/site/guide/schedule.md +2 -0
- package/kb/site/reference/agent-lifecycle.md +5 -3
- package/kb/site/reference/api-gateway.md +2 -2
- package/kb/site/reference/capability-seams.md +14 -7
- package/kb/site/reference/config-catalog.md +156 -229
- package/kb/site/reference/cookbook/adding-a-package.md +1 -2
- package/kb/site/reference/cookbook/adding-a-settings-card.md +10 -8
- package/kb/site/reference/cookbook/extension-cookbook.md +15 -12
- package/kb/site/reference/index.md +11 -4
- package/kb/site/reference/persistence-catalog.md +91 -70
- package/kb/site/reference/subsystems/code-runtime.md +7 -3
- package/kb/site/reference/subsystems/commands.md +25 -16
- package/kb/site/reference/subsystems/compaction.md +9 -9
- package/kb/site/reference/subsystems/conversation.md +11 -4
- package/kb/site/reference/subsystems/core.md +96 -15
- package/kb/site/reference/subsystems/credentials.md +5 -4
- package/kb/site/reference/subsystems/goal.md +1 -1
- package/kb/site/reference/subsystems/index.md +1 -1
- package/kb/site/reference/subsystems/llm-streaming.md +24 -3
- package/kb/site/reference/subsystems/permission-presets.md +5 -5
- package/kb/site/reference/subsystems/persistence.md +184 -193
- package/kb/site/reference/subsystems/plan.md +3 -3
- package/kb/site/reference/subsystems/schedule.md +9 -3
- package/kb/site/reference/subsystems/session-projection.md +50 -24
- package/kb/site/reference/subsystems/session-query.md +19 -13
- package/kb/site/reference/subsystems/session-reference.md +25 -1
- package/kb/site/reference/subsystems/session-telemetry.md +6 -5
- package/kb/site/reference/subsystems/session-title.md +6 -6
- package/kb/site/reference/subsystems/session.md +156 -73
- package/kb/site/reference/subsystems/settings.md +30 -12
- package/kb/site/reference/subsystems/skills.md +1 -1
- package/kb/site/reference/subsystems/slots.md +1 -0
- package/kb/site/reference/subsystems/storage.md +28 -5
- package/kb/site/reference/subsystems/subagent.md +43 -97
- package/kb/site/reference/subsystems/system-prompt.md +16 -3
- package/kb/site/reference/subsystems/token-meter.md +2 -2
- package/kb/site/reference/subsystems/typert.md +18 -18
- package/kb/site/reference/subsystems/web-client.md +1 -1
- package/kb/site/reference/subsystems/workspace.md +8 -8
- package/kb/site/reference/tool-catalog.md +9 -63
- package/package.json +2 -2
- package/skills/dsh-plugin-dev-kb.md +4 -4
|
@@ -12,7 +12,7 @@ outline: "deep"
|
|
|
12
12
|
|
|
13
13
|
英文源文件根据源码生成(`scripts/gen-persistence-catalog.ts`),并由 `pnpm run verify-persistence-catalog`(`doc-sync`(文档同步门禁)的一部分)验证新鲜度;本中文文件作为经评审对侧通过双语配对维护。声明块保留源码声明和嵌套属性的 JSDoc,只移除其所在接口/模块带来的缩进,并使用 `ts persistence-catalog` 围栏(doc-typecheck 会跳过这些围栏,因为声明引用了其所属模块中的类型)。payload 中的类型名称会链接到记录该类型的页面。参见 [persistence-log-catalog Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/archived/process/2026-07-04-persistence-log-catalog.md)。
|
|
14
14
|
|
|
15
|
-
以下信封声明组合了每个事件的 `type`、单调递增的 `seq`、以 epoch 毫秒表示的 `time`、`data`,以及条件字段 `surfaceOp`/`sourceEventSeqs`。**surface** 表示 `SurfaceEventType` 成员:它会生成一条 LLM(大语言模型)消息,并声明该事件如何加入 surface 列表。**log-only** 表示其他所有事件:这类记录可持久化、可回放,但不参与派生历史。每个 payload 均可进行 JSON 序列化(在 `Session.append`
|
|
15
|
+
以下信封声明组合了每个事件的 `type`、单调递增的 `seq`、以 epoch 毫秒表示的 `time`、`data`、可选的未知类型跳过标记 `ignorable`,以及条件字段 `surfaceOp`/`sourceEventSeqs`。**surface** 表示 `SurfaceEventType` 成员:它会生成一条 LLM(大语言模型)消息,并声明该事件如何加入 surface 列表。**log-only** 表示其他所有事件:这类记录可持久化、可回放,但不参与派生历史。每个 payload 均可进行 JSON 序列化(在 `Session.append` 处强制执行)。当前 writer 会写入 `SESSION_FORMAT_VERSION`;受支持的历史产物通过构建期静态相邻迁移目录进入这套当前词汇(参见[版本生命周期](./subsystems/persistence.md))。范围仅限本仓库中的包;下游插件可以继续合并其他当前版本事件类型,这些类型按设计不属于本目录,并且在后续格式迁移边中需要显式 disposition。
|
|
16
16
|
|
|
17
17
|
## 事件信封
|
|
18
18
|
|
|
@@ -23,7 +23,8 @@ export type SessionEventType = keyof SessionEventMap
|
|
|
23
23
|
/**
|
|
24
24
|
* The subset of {@link SessionEventType} values whose events produce LLM
|
|
25
25
|
* messages and are eligible to appear on the ordered surface. Only these
|
|
26
|
-
* event types may carry {@link SurfaceOp} and
|
|
26
|
+
* event types may carry {@link SurfaceOp}; user and tool events may also cite
|
|
27
|
+
* earlier sources through {@link SessionEvent.sourceEventSeqs}.
|
|
27
28
|
*/
|
|
28
29
|
export type SurfaceEventType =
|
|
29
30
|
| 'user/message'
|
|
@@ -45,7 +46,7 @@ export type SurfaceEventType =
|
|
|
45
46
|
*/
|
|
46
47
|
export type SurfaceOp =
|
|
47
48
|
| 'append'
|
|
48
|
-
| { op: 'replace'; start:
|
|
49
|
+
| { op: 'replace'; start: SessionSeq; end: SessionSeq }
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* One immutable entry in the session log.
|
|
@@ -56,7 +57,7 @@ export type SurfaceOp =
|
|
|
56
57
|
* The {@link sourceEventSeqs} and {@link surfaceOp} fields are conditional:
|
|
57
58
|
* they only exist on {@link SurfaceEventType} variants (`user/message`,
|
|
58
59
|
* `assistant/message`, `tool/result`).
|
|
59
|
-
* Non-surface events (boundary markers,
|
|
60
|
+
* Non-surface events (boundary markers, attempts, errors) never carry
|
|
60
61
|
* surface metadata — the compiler enforces this at `Session.append()`
|
|
61
62
|
* call sites.
|
|
62
63
|
*/
|
|
@@ -64,27 +65,35 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
64
65
|
[K in SessionEventType]: {
|
|
65
66
|
type: K
|
|
66
67
|
/** Monotonic sequence number within the session. */
|
|
67
|
-
seq:
|
|
68
|
+
seq: SessionSeq
|
|
68
69
|
/** Unix epoch milliseconds. */
|
|
69
70
|
time: number
|
|
70
71
|
data: SessionEventMap[K]
|
|
72
|
+
/**
|
|
73
|
+
* Marks an event a reader may safely skip when it does not recognize
|
|
74
|
+
* `type`. Absent means required: a reader meeting an unrecognized type
|
|
75
|
+
* without this marker MUST refuse to reconstruct the session instead of
|
|
76
|
+
* silently dropping the event, because an unrecognized required event may
|
|
77
|
+
* change how the rest of the log is interpreted. A writer sets `true` only
|
|
78
|
+
* on purely informational records whose loss cannot affect reconstruction;
|
|
79
|
+
* defaulting to required means a forgotten marker over-refuses (an
|
|
80
|
+
* inconvenience) rather than silently resuming a gutted session.
|
|
81
|
+
*/
|
|
82
|
+
ignorable?: true
|
|
71
83
|
} & (K extends SurfaceEventType ? {
|
|
72
84
|
/**
|
|
73
|
-
* Seq numbers of earlier events that this event cites as sources
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* `assistant/message` may carry a present empty array for a known empty
|
|
77
|
-
* provider stream; when the field is absent, the event does not record which
|
|
78
|
-
* earlier events produced the message.
|
|
85
|
+
* Seq numbers of earlier events that this event cites as sources, such as
|
|
86
|
+
* the surface nodes shadowed by a compaction replacement. A v2
|
|
87
|
+
* `assistant/message` embeds its provider stream and cannot carry this field.
|
|
79
88
|
*/
|
|
80
|
-
sourceEventSeqs?:
|
|
89
|
+
sourceEventSeqs?: SessionSeq[]
|
|
81
90
|
/** How this event entered the surface; absent for non-surface events. */
|
|
82
91
|
surfaceOp?: SurfaceOp
|
|
83
92
|
} : object)
|
|
84
93
|
}[T]
|
|
85
94
|
```
|
|
86
95
|
|
|
87
|
-
来源:[`packages/core/session/src/types.ts:
|
|
96
|
+
来源:[`packages/core/session/src/types.ts:379`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:387`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:416`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts) · [`packages/core/session/src/types.ts:447`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
88
97
|
|
|
89
98
|
## 事件
|
|
90
99
|
|
|
@@ -109,7 +118,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
109
118
|
}
|
|
110
119
|
```
|
|
111
120
|
|
|
112
|
-
来源:[`packages/core/agent/src/types.ts:
|
|
121
|
+
来源:[`packages/core/agent/src/types.ts:58`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/agent/src/types.ts)
|
|
113
122
|
|
|
114
123
|
### `agent-preset/*`
|
|
115
124
|
|
|
@@ -183,7 +192,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
183
192
|
* The session's approval policy was switched — log-only, durable,
|
|
184
193
|
* replayable, never in the model transcript (the model learns the policy
|
|
185
194
|
* from the runtime-context snapshot and live switch notices). The LAST
|
|
186
|
-
* such event is the session's override
|
|
195
|
+
* such event is the session's override.
|
|
187
196
|
* `source: 'delegation'` marks an override seeded into a child; an absent
|
|
188
197
|
* source is a runtime switch.
|
|
189
198
|
*/
|
|
@@ -198,18 +207,20 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
198
207
|
|
|
199
208
|
### `assistant/*`
|
|
200
209
|
|
|
201
|
-
<a id="
|
|
210
|
+
<a id="assistantattempt--log-only"></a>
|
|
202
211
|
|
|
203
|
-
#### `assistant/
|
|
212
|
+
#### `assistant/attempt` — log-only
|
|
204
213
|
|
|
205
214
|
```ts persistence-catalog
|
|
206
|
-
/**
|
|
207
|
-
|
|
215
|
+
/**
|
|
216
|
+
* One model attempt that committed no surface message. The embedded stream
|
|
217
|
+
* preserves a failed, retried, cancelled, or stream-error attempt that
|
|
218
|
+
* reached settlement without fabricating model-visible history.
|
|
219
|
+
*/
|
|
220
|
+
'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[] }
|
|
208
221
|
```
|
|
209
222
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
来源:[`packages/core/session/src/types.ts:249`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
223
|
+
来源:[`packages/core/session/src/types.ts:313`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
213
224
|
|
|
214
225
|
<a id="assistantmessage--surface"></a>
|
|
215
226
|
|
|
@@ -226,12 +237,20 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
226
237
|
* marker distinguishes that prefix without re-deriving interruption from turn
|
|
227
238
|
* boundaries. An aborted turn with no such event streamed no visible content.
|
|
228
239
|
*/
|
|
229
|
-
'assistant/message': {
|
|
240
|
+
'assistant/message': {
|
|
241
|
+
turn: number
|
|
242
|
+
step: number
|
|
243
|
+
message: AssistantMessage
|
|
244
|
+
/** Exact timed model stream, compacted without joining delta boundaries. */
|
|
245
|
+
stream: AssistantStreamRecord[]
|
|
246
|
+
usage?: TokenUsage
|
|
247
|
+
interrupted?: true
|
|
248
|
+
}
|
|
230
249
|
```
|
|
231
250
|
|
|
232
251
|
类型:[TokenUsage](./subsystems/llm-streaming.md)
|
|
233
252
|
|
|
234
|
-
来源:[`packages/core/session/src/types.ts:
|
|
253
|
+
来源:[`packages/core/session/src/types.ts:299`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
235
254
|
|
|
236
255
|
### `command/*`
|
|
237
256
|
|
|
@@ -250,11 +269,11 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
250
269
|
commandId: CommandId
|
|
251
270
|
kind: 'success' | 'error'
|
|
252
271
|
text?: string
|
|
253
|
-
sourceEventSeq?:
|
|
272
|
+
sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq
|
|
254
273
|
}
|
|
255
274
|
```
|
|
256
275
|
|
|
257
|
-
来源:[`packages/interaction/commands/src/types.ts:
|
|
276
|
+
来源:[`packages/interaction/commands/src/types.ts:110`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
|
|
258
277
|
|
|
259
278
|
<a id="commandrun--log-only"></a>
|
|
260
279
|
|
|
@@ -274,7 +293,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
274
293
|
'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource }
|
|
275
294
|
```
|
|
276
295
|
|
|
277
|
-
来源:[`packages/interaction/commands/src/types.ts:
|
|
296
|
+
来源:[`packages/interaction/commands/src/types.ts:103`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/types.ts)
|
|
278
297
|
|
|
279
298
|
### `compaction/*`
|
|
280
299
|
|
|
@@ -290,7 +309,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
290
309
|
'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string }
|
|
291
310
|
```
|
|
292
311
|
|
|
293
|
-
来源:[`packages/compaction/compaction/src/types.ts:
|
|
312
|
+
来源:[`packages/compaction/compaction/src/types.ts:72`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
|
|
294
313
|
|
|
295
314
|
<a id="compactionprune--log-only"></a>
|
|
296
315
|
|
|
@@ -308,15 +327,15 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
308
327
|
*/
|
|
309
328
|
'compaction/prune': {
|
|
310
329
|
/** The replaced range's first and last surface-node seqs (a surface-position span, like {@link CompactionResult.shadowedRange}). */
|
|
311
|
-
shadowedRange: { start:
|
|
330
|
+
shadowedRange: { start: SessionSeq; end: SessionSeq }
|
|
312
331
|
/** The seqs of all shadowed surface nodes, in surface order. */
|
|
313
|
-
shadowedSeqs:
|
|
332
|
+
shadowedSeqs: SessionSeq[]
|
|
314
333
|
/** Heuristic price of the shadowed content under the token-meter's fixed estimator. */
|
|
315
334
|
shadowedTokenCount: number
|
|
316
335
|
}
|
|
317
336
|
```
|
|
318
337
|
|
|
319
|
-
来源:[`packages/compaction/compaction/src/types.ts:
|
|
338
|
+
来源:[`packages/compaction/compaction/src/types.ts:82`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
|
|
320
339
|
|
|
321
340
|
<a id="compactionstart--log-only"></a>
|
|
322
341
|
|
|
@@ -331,7 +350,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
331
350
|
'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null }
|
|
332
351
|
```
|
|
333
352
|
|
|
334
|
-
来源:[`packages/compaction/compaction/src/types.ts:
|
|
353
|
+
来源:[`packages/compaction/compaction/src/types.ts:24`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
|
|
335
354
|
|
|
336
355
|
<a id="compactionsummary--log-only"></a>
|
|
337
356
|
|
|
@@ -351,8 +370,8 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
351
370
|
compactionId: CompactionId
|
|
352
371
|
sourceCommandId?: CommandId
|
|
353
372
|
summary: ContentBlock[]
|
|
354
|
-
shadowedRange: { start:
|
|
355
|
-
shadowedSeqs:
|
|
373
|
+
shadowedRange: { start: SessionSeq; end: SessionSeq }
|
|
374
|
+
shadowedSeqs: SessionSeq[]
|
|
356
375
|
shadowedTokenCount: number
|
|
357
376
|
/** The provider route that wrote the summary. */
|
|
358
377
|
provider: string
|
|
@@ -385,7 +404,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
385
404
|
|
|
386
405
|
类型:[ContentBlock](./subsystems/core.md) · [TokenUsage](./subsystems/llm-streaming.md)
|
|
387
406
|
|
|
388
|
-
来源:[`packages/compaction/compaction/src/types.ts:
|
|
407
|
+
来源:[`packages/compaction/compaction/src/types.ts:34`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/compaction/compaction/src/types.ts)
|
|
389
408
|
|
|
390
409
|
### `feedback/*`
|
|
391
410
|
|
|
@@ -506,7 +525,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
506
525
|
'model/selection': ModelSelection
|
|
507
526
|
```
|
|
508
527
|
|
|
509
|
-
来源:[`packages/api/session-controller/src/types.ts:
|
|
528
|
+
来源:[`packages/api/session-controller/src/types.ts:41`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/session-controller/src/types.ts)
|
|
510
529
|
|
|
511
530
|
### `permission/*`
|
|
512
531
|
|
|
@@ -518,13 +537,13 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
518
537
|
/**
|
|
519
538
|
* Records the selected preset as durable, log-only user intent. The knob
|
|
520
539
|
* events follow in the same turn and control execution; this event stays
|
|
521
|
-
* out of the model transcript and lets
|
|
540
|
+
* out of the model transcript and lets the permission projection unit
|
|
522
541
|
* preserve a selection when bundles match.
|
|
523
542
|
*/
|
|
524
543
|
'permission/preset': { preset: string }
|
|
525
544
|
```
|
|
526
545
|
|
|
527
|
-
来源:[`packages/interaction/permission-presets/src/index.ts:
|
|
546
|
+
来源:[`packages/interaction/permission-presets/src/index.ts:53`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/permission-presets/src/index.ts)
|
|
528
547
|
|
|
529
548
|
### `plan/*`
|
|
530
549
|
|
|
@@ -536,12 +555,12 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
536
555
|
/**
|
|
537
556
|
* Whether plan mode is in force from this point on: log-only, non-surface,
|
|
538
557
|
* whole-value replace. The last `plan/mode` wins; a log with none folds to
|
|
539
|
-
* inactive through
|
|
558
|
+
* inactive through the projection unit's fold.
|
|
540
559
|
*/
|
|
541
560
|
'plan/mode': { active: boolean }
|
|
542
561
|
```
|
|
543
562
|
|
|
544
|
-
来源:[`packages/plan/plan-mode/src/index.ts:
|
|
563
|
+
来源:[`packages/plan/plan-mode/src/index.ts:46`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/plan/plan-mode/src/index.ts)
|
|
545
564
|
|
|
546
565
|
### `request/*`
|
|
547
566
|
|
|
@@ -557,7 +576,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
557
576
|
'request/context': RequestContext
|
|
558
577
|
```
|
|
559
578
|
|
|
560
|
-
来源:[`packages/core/session/src/types.ts:
|
|
579
|
+
来源:[`packages/core/session/src/types.ts:341`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
561
580
|
|
|
562
581
|
<a id="requestheader--log-only"></a>
|
|
563
582
|
|
|
@@ -576,7 +595,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
576
595
|
}
|
|
577
596
|
```
|
|
578
597
|
|
|
579
|
-
来源:[`packages/core/session/src/types.ts:
|
|
598
|
+
来源:[`packages/core/session/src/types.ts:331`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
580
599
|
|
|
581
600
|
### `sandbox/*`
|
|
582
601
|
|
|
@@ -589,7 +608,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
589
608
|
* The session's sandbox mode was switched — log-only (like `approval/*`;
|
|
590
609
|
* NOT a surface event, carries no `surfaceOp`): durable and replayable,
|
|
591
610
|
* never in the model transcript. The LAST such event is the session's
|
|
592
|
-
* override (
|
|
611
|
+
* override (folded by the sandboxMode projection unit). `source: 'delegation'` marks
|
|
593
612
|
* an override seeded into a child; an absent source is a runtime switch.
|
|
594
613
|
*/
|
|
595
614
|
'sandbox/mode': {
|
|
@@ -630,12 +649,12 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
630
649
|
* Marks the end of a constructor seed. Events before it have smaller seq
|
|
631
650
|
* values and came from the seed (resume, fork, or replay); this lifecycle
|
|
632
651
|
* produced none of them. This log-only event is the durable projection of
|
|
633
|
-
* {@link Session.firstLiveSeq}.
|
|
634
|
-
* carry the meaning.
|
|
652
|
+
* {@link Session.firstLiveSeq}.
|
|
635
653
|
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
654
|
+
* A fresh fork child owns one `{ inherited: true }` marker at its exact
|
|
655
|
+
* inherited-prefix cut, even when that prefix ends in an ancestor marker.
|
|
656
|
+
* The last tagged marker is the current Session's cut; untagged markers keep
|
|
657
|
+
* ordinary restore and replay lifecycle boundaries.
|
|
639
658
|
*
|
|
640
659
|
* `Session`'s constructor is the only legitimate writer. The invariant
|
|
641
660
|
* companion deliberately constrains nothing here, so a plugin appending one
|
|
@@ -648,10 +667,10 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
648
667
|
* writers — a concurrently live session holds its own boundary elsewhere,
|
|
649
668
|
* so tolerating concurrent writers needs a signal beyond the log.
|
|
650
669
|
*/
|
|
651
|
-
'session/end-seed':
|
|
670
|
+
'session/end-seed': { inherited?: true }
|
|
652
671
|
```
|
|
653
672
|
|
|
654
|
-
来源:[`packages/core/session/src/types.ts:
|
|
673
|
+
来源:[`packages/core/session/src/types.ts:375`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
655
674
|
|
|
656
675
|
<a id="sessiontitle--log-only"></a>
|
|
657
676
|
|
|
@@ -667,7 +686,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
667
686
|
|
|
668
687
|
类型:[SessionTitleEventData](./subsystems/session-title.md)
|
|
669
688
|
|
|
670
|
-
来源:[`packages/session/session-title/src/index.ts:
|
|
689
|
+
来源:[`packages/session/session-title/src/index.ts:77`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title/src/index.ts)
|
|
671
690
|
|
|
672
691
|
<a id="sessiontitle-llm-request--log-only"></a>
|
|
673
692
|
|
|
@@ -680,7 +699,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
680
699
|
|
|
681
700
|
类型:[SessionTitleLlmRequestEventData](./subsystems/session-title.md)
|
|
682
701
|
|
|
683
|
-
来源:[`packages/session/session-title-llm/src/index.ts:
|
|
702
|
+
来源:[`packages/session/session-title-llm/src/index.ts:45`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-title-llm/src/index.ts)
|
|
684
703
|
|
|
685
704
|
### `session-log-deepseek/*`
|
|
686
705
|
|
|
@@ -693,12 +712,14 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
693
712
|
'session-log-deepseek/delivery-accepted': {
|
|
694
713
|
/** Session identity the accepted delivery carried; inherited fork markers retain the parent's id. */
|
|
695
714
|
sessionId: import('@deepseek-ai/dsh-session/types').SessionId
|
|
715
|
+
/** Accepted Session format generation; absence identifies version 0. */
|
|
716
|
+
sessionFormatVersion?: number
|
|
696
717
|
/** Last canonical event included in the accepted request. */
|
|
697
|
-
throughSeq:
|
|
718
|
+
throughSeq: import('@deepseek-ai/dsh-session/types').SessionSeq
|
|
698
719
|
}
|
|
699
720
|
```
|
|
700
721
|
|
|
701
|
-
来源:[`packages/session/session-log-deepseek/src/types.ts:
|
|
722
|
+
来源:[`packages/session/session-log-deepseek/src/types.ts:59`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-log-deepseek/src/types.ts)
|
|
702
723
|
|
|
703
724
|
### `step/*`
|
|
704
725
|
|
|
@@ -711,7 +732,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
711
732
|
'step/end': { turn: number; step: number }
|
|
712
733
|
```
|
|
713
734
|
|
|
714
|
-
来源:[`packages/core/session/src/types.ts:
|
|
735
|
+
来源:[`packages/core/session/src/types.ts:281`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
715
736
|
|
|
716
737
|
<a id="stepstart--log-only"></a>
|
|
717
738
|
|
|
@@ -722,7 +743,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
722
743
|
'step/start': { turn: number; step: number }
|
|
723
744
|
```
|
|
724
745
|
|
|
725
|
-
来源:[`packages/core/session/src/types.ts:
|
|
746
|
+
来源:[`packages/core/session/src/types.ts:279`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
726
747
|
|
|
727
748
|
### `subagent/*`
|
|
728
749
|
|
|
@@ -760,7 +781,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
760
781
|
}
|
|
761
782
|
```
|
|
762
783
|
|
|
763
|
-
来源:[`packages/subagent/tool-subagent/src/model-selection-state.ts:
|
|
784
|
+
来源:[`packages/subagent/tool-subagent/src/model-selection-state.ts:17`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/tool-subagent/src/model-selection-state.ts)
|
|
764
785
|
|
|
765
786
|
### `team/*`
|
|
766
787
|
|
|
@@ -770,12 +791,12 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
770
791
|
|
|
771
792
|
```ts persistence-catalog
|
|
772
793
|
/** Whole teammate lifecycle value, stored only in the Team Lead Session. */
|
|
773
|
-
'team/member': { version:
|
|
794
|
+
'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot }
|
|
774
795
|
```
|
|
775
796
|
|
|
776
797
|
类型:[TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) · [TeamMemberSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md)
|
|
777
798
|
|
|
778
|
-
来源:[`packages/experimental/agent-team/src/types.ts:
|
|
799
|
+
来源:[`packages/experimental/agent-team/src/types.ts:204`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
|
|
779
800
|
|
|
780
801
|
<a id="teammessagedelivered--log-only"></a>
|
|
781
802
|
|
|
@@ -784,7 +805,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
784
805
|
```ts persistence-catalog
|
|
785
806
|
/** Durable acknowledgement that the target Session recorded the message. */
|
|
786
807
|
'team/message/delivered': {
|
|
787
|
-
version:
|
|
808
|
+
version: 2
|
|
788
809
|
teamId: TeamId
|
|
789
810
|
messageId: TeamMessageId
|
|
790
811
|
targetId: SessionId
|
|
@@ -793,7 +814,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
793
814
|
|
|
794
815
|
类型:[TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) · [TeamMessageId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md)
|
|
795
816
|
|
|
796
|
-
来源:[`packages/experimental/agent-team/src/types.ts:
|
|
817
|
+
来源:[`packages/experimental/agent-team/src/types.ts:210`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
|
|
797
818
|
|
|
798
819
|
<a id="teammessagequeued--log-only"></a>
|
|
799
820
|
|
|
@@ -801,12 +822,12 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
801
822
|
|
|
802
823
|
```ts persistence-catalog
|
|
803
824
|
/** Durable mailbox enqueue, stored before delivery is attempted. */
|
|
804
|
-
'team/message/queued': { version:
|
|
825
|
+
'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot }
|
|
805
826
|
```
|
|
806
827
|
|
|
807
828
|
类型:[TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) · [TeamMessageSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md)
|
|
808
829
|
|
|
809
|
-
来源:[`packages/experimental/agent-team/src/types.ts:
|
|
830
|
+
来源:[`packages/experimental/agent-team/src/types.ts:208`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
|
|
810
831
|
|
|
811
832
|
<a id="teamtask--log-only"></a>
|
|
812
833
|
|
|
@@ -814,12 +835,12 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
814
835
|
|
|
815
836
|
```ts persistence-catalog
|
|
816
837
|
/** Whole shared-task value, stored only in the Team Lead Session. */
|
|
817
|
-
'team/task': { version:
|
|
838
|
+
'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot }
|
|
818
839
|
```
|
|
819
840
|
|
|
820
841
|
类型:[TeamId](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md) · [TeamTaskSnapshot](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/agent-team.zh.md)
|
|
821
842
|
|
|
822
|
-
来源:[`packages/experimental/agent-team/src/types.ts:
|
|
843
|
+
来源:[`packages/experimental/agent-team/src/types.ts:206`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/experimental/agent-team/src/types.ts)
|
|
823
844
|
|
|
824
845
|
### `todo/*`
|
|
825
846
|
|
|
@@ -853,7 +874,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
853
874
|
|
|
854
875
|
类型:[ToolCallId](./subsystems/core.md)
|
|
855
876
|
|
|
856
|
-
来源:[`packages/core/session/src/types.ts:
|
|
877
|
+
来源:[`packages/core/session/src/types.ts:308`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
857
878
|
|
|
858
879
|
<a id="toolcode-dispatch--log-only"></a>
|
|
859
880
|
|
|
@@ -928,7 +949,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
928
949
|
}
|
|
929
950
|
```
|
|
930
951
|
|
|
931
|
-
来源:[`packages/core/session/src/types.ts:
|
|
952
|
+
来源:[`packages/core/session/src/types.ts:320`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
932
953
|
|
|
933
954
|
### `tool-workflow/*`
|
|
934
955
|
|
|
@@ -1008,7 +1029,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
1008
1029
|
|
|
1009
1030
|
类型:[TurnEndReason](./subsystems/session.md)
|
|
1010
1031
|
|
|
1011
|
-
来源:[`packages/core/session/src/types.ts:
|
|
1032
|
+
来源:[`packages/core/session/src/types.ts:277`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
1012
1033
|
|
|
1013
1034
|
<a id="turnstart--log-only"></a>
|
|
1014
1035
|
|
|
@@ -1024,7 +1045,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
1024
1045
|
'turn/start': { turn: number }
|
|
1025
1046
|
```
|
|
1026
1047
|
|
|
1027
|
-
来源:[`packages/core/session/src/types.ts:
|
|
1048
|
+
来源:[`packages/core/session/src/types.ts:268`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
1028
1049
|
|
|
1029
1050
|
### `user/*`
|
|
1030
1051
|
|
|
@@ -1043,7 +1064,7 @@ export type SessionEvent<T extends SessionEventType = SessionEventType> = {
|
|
|
1043
1064
|
'user/message': UserMessage
|
|
1044
1065
|
```
|
|
1045
1066
|
|
|
1046
|
-
来源:[`packages/core/session/src/types.ts:
|
|
1067
|
+
来源:[`packages/core/session/src/types.ts:289`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/core/session/src/types.ts)
|
|
1047
1068
|
|
|
1048
1069
|
### `web/*`
|
|
1049
1070
|
|
|
@@ -55,7 +55,11 @@ interface CodeRunResult {
|
|
|
55
55
|
* rendered string; a failed or value-less run leaves this absent.
|
|
56
56
|
*/
|
|
57
57
|
value?: CodeJsonValue
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Captured text. Each source channel preserves emission order; interleaving
|
|
60
|
+
* across independent channels is backend-dependent. Bounded only as part of
|
|
61
|
+
* the outer result.
|
|
62
|
+
*/
|
|
59
63
|
logs: string[]
|
|
60
64
|
/** Present iff the run failed; see {@link CodeRunFailure} for the taxonomy. */
|
|
61
65
|
error?: CodeRunFailure
|
|
@@ -134,7 +138,7 @@ type CodeBindingFunction = (args: unknown) => Promise<CodeJsonValue>
|
|
|
134
138
|
|
|
135
139
|
## 捕获的输出与失败分类体系
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
日志是纯字符串。每个来源通道保留自身的发出顺序;由于通道元数据不属于 seam,相互独立的通道如何交错由后端决定。运行时捕获程序的 console 与流输出,Consumer 只渲染文本。实现会对序列化后的外层日志数组,以及完成值或失败消息的组合载荷设置上限;固定的结果封装语法与 Consumer 展示空白不计入这份可变载荷计量。超限会显式失败,而不会在值中插入替代内容。
|
|
138
142
|
|
|
139
143
|
失败类型是**正交的结果,独立报告**(见 [defensive-patterns](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/defensive-patterns.zh.md)):预算耗尽不是异常,中止不是超时,基底崩溃(如 OOM)也不是二者中的任何一个:
|
|
140
144
|
|
|
@@ -161,7 +165,7 @@ interface CodeRunFailure {
|
|
|
161
165
|
|
|
162
166
|
## 服务
|
|
163
167
|
|
|
164
|
-
`CodeRuntime`(`ctx.codeRuntime`,抽象服务,定义于 [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts))由 `run(request)` 加两个只读描述符组成:`language`(程序必须使用的语言,已知值为 `'typescript'` 与 `'python'`,即 `dsh-tools`
|
|
168
|
+
`CodeRuntime`(`ctx.codeRuntime`,抽象服务,定义于 [`packages/code-runtime/code-runtime/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts))由 `run(request)` 加两个只读描述符组成:`language`(程序必须使用的语言,已知值为 `'typescript'` 与 `'python'`,即 `dsh-tools` 能呈现的那些,TypeScript 后端已发布、Python 后端为实验性且私有(未发布);生成语言相关展示的 Consumer 据此切换,遇到无法展示的语言时应显式报错)和 `isolation`(执行基底,`'worker-thread'`、`'process'`、`'container'`;仅为诊断标签,**不构成安全承诺**)。实现必须保证各次运行彼此隔离(无跨运行状态),并在 dispose(资源释放)时等待系统完全停稳:teardown 要等到所有进行中的运行均已终止并结算后才完成。
|
|
165
169
|
|
|
166
170
|
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
167
171
|
|
|
@@ -11,7 +11,7 @@ outline: [2,3]
|
|
|
11
11
|
|
|
12
12
|
## 输入元数据
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
该服务公开一个可选的非结构化输入描述符:提示文本加附件接受标志。命令的可用性由插件组合决定:每个消费注册表的适配器都会看到全部生效定义。
|
|
15
15
|
|
|
16
16
|
```ts type-equiv
|
|
17
17
|
/** Immutable metadata for a command's optional unstructured input. */
|
|
@@ -19,13 +19,13 @@ interface CommandInputDescriptor {
|
|
|
19
19
|
/** Placeholder shown before the user supplies free-form input. */
|
|
20
20
|
readonly hint: string
|
|
21
21
|
/**
|
|
22
|
-
* Whether composer
|
|
23
|
-
* false = the executor rejects an invocation carrying
|
|
22
|
+
* Whether composer attachments may accompany an invocation. Absent or
|
|
23
|
+
* false = the executor rejects an invocation carrying attachments and capable
|
|
24
24
|
* composers refuse the submission before dispatch. A declaring command's
|
|
25
25
|
* handler receives the admitted durable blocks and owns every further
|
|
26
26
|
* grammar decision, including rejecting sub-commands that cannot use them.
|
|
27
27
|
*/
|
|
28
|
-
readonly
|
|
28
|
+
readonly attachments?: boolean
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -67,13 +67,13 @@ interface CommandInvocation {
|
|
|
67
67
|
/** Exact text following the registered command name, including separator whitespace. */
|
|
68
68
|
readonly rawInput: string
|
|
69
69
|
/**
|
|
70
|
-
* Durably admitted image blocks accompanying this invocation, in submission
|
|
71
|
-
* order; empty unless the definition declares `input.
|
|
70
|
+
* Durably admitted image and file blocks accompanying this invocation, in submission
|
|
71
|
+
* order; empty unless the definition declares `input.attachments`. The handler
|
|
72
72
|
* owns their model-visible use — the registry never schedules them itself —
|
|
73
73
|
* and a handler whose grammar cannot use them in this invocation returns an
|
|
74
74
|
* error so the dispatching composer retains the originals.
|
|
75
75
|
*/
|
|
76
|
-
readonly attachments: readonly ImageBlock[]
|
|
76
|
+
readonly attachments: readonly (ImageBlock | FileBlock)[]
|
|
77
77
|
/** Cancellation signal owned by the dispatching UI request. */
|
|
78
78
|
readonly signal: AbortSignal
|
|
79
79
|
}
|
|
@@ -86,7 +86,7 @@ type CommandResult =
|
|
|
86
86
|
readonly kind: 'success'
|
|
87
87
|
readonly text?: string
|
|
88
88
|
/** Earlier authoritative domain event that owns a richer presentation. */
|
|
89
|
-
readonly sourceEventSeq?:
|
|
89
|
+
readonly sourceEventSeq?: SessionSeq
|
|
90
90
|
}
|
|
91
91
|
| { readonly kind: 'error'; readonly text: string }
|
|
92
92
|
```
|
|
@@ -141,6 +141,13 @@ Human-command registry. Plain-context definitions are global; definitions regist
|
|
|
141
141
|
*/
|
|
142
142
|
register(definition: CommandDefinition): () => void
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Register the sole authority that resolves staged file receipts for command submissions.
|
|
146
|
+
* @param resolver - Session-aware receipt resolver.
|
|
147
|
+
* @returns disposer that removes this exact resolver.
|
|
148
|
+
*/
|
|
149
|
+
registerFileReceiptResolver(resolver: CommandFileReceiptResolver): () => void
|
|
150
|
+
|
|
144
151
|
/**
|
|
145
152
|
* List the effective immutable command descriptors for one agent.
|
|
146
153
|
* @param agent - exact receiving agent and scoped-layer key.
|
|
@@ -169,23 +176,25 @@ find(agent: Agent, name: string): CommandDefinition | undefined
|
|
|
169
176
|
* handler-failure path is contained so the handler's own error stays the
|
|
170
177
|
* reported failure.
|
|
171
178
|
*
|
|
172
|
-
*
|
|
173
|
-
* command that does not declare `input.
|
|
174
|
-
* and an exceeded
|
|
175
|
-
* the handler runs
|
|
179
|
+
* Attachment admission is enforced here, not in the composer: attachments sent to a
|
|
180
|
+
* command that does not declare `input.attachments`, an absent attachment store,
|
|
181
|
+
* and an exceeded image limit each settle as an error result before
|
|
182
|
+
* the handler runs. Validation rejection starts no attachment writes;
|
|
183
|
+
* a storage failure can leave only unreachable content-addressed objects
|
|
184
|
+
* for deferred collection.
|
|
176
185
|
*
|
|
177
186
|
* @param agent - exact receiving agent.
|
|
178
187
|
* @param line - complete slash-command line.
|
|
179
|
-
* @param
|
|
180
|
-
* submission order; empty for a plain invocation.
|
|
188
|
+
* @param submittedAttachments - encoded images and staged file receipts accompanying the line,
|
|
189
|
+
* in submission order; empty for a plain invocation.
|
|
181
190
|
* @param signal - cancellation signal owned by the UI request.
|
|
182
191
|
* @returns the settled execution (result + lifecycle pairing id), or
|
|
183
192
|
* `undefined` when syntax or name does not resolve.
|
|
184
193
|
*/
|
|
185
|
-
@Remote async execute( agent: Agent, line: string,
|
|
194
|
+
@Remote async execute( agent: Agent, line: string, submittedAttachments: readonly CommandSubmitAttachment[], signal: AbortSignal, ): Promise<CommandExecution | undefined>
|
|
186
195
|
```
|
|
187
196
|
|
|
188
|
-
Types: [Agent](./core.md)
|
|
197
|
+
Types: [Agent](./core.md)
|
|
189
198
|
|
|
190
199
|
Source: [`packages/interaction/commands/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/interaction/commands/src/index.ts)
|
|
191
200
|
|