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
|
@@ -200,8 +200,22 @@ prepareDocument(): Promise<string | undefined>
|
|
|
200
200
|
* @param schema - schemastery schema resolving this namespace's value.
|
|
201
201
|
* @param options - composition `base` layer and effect timing.
|
|
202
202
|
* @returns the owner scope for reads, observation, and updates.
|
|
203
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
203
204
|
*/
|
|
204
|
-
register<T>(ns:
|
|
205
|
+
register<const Namespace extends string, T>( ns: Namespace & SettingsNamespaceInput<Namespace>, schema: z<T>, options?: SettingsRegisterOptions<T>, ): SettingsScope<T>
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Attach one optional-settings consumer to this provider. The consumer
|
|
209
|
+
* registers its composition entry as the base layer while this provider is
|
|
210
|
+
* present, then falls back to that entry if the provider detaches.
|
|
211
|
+
* @param owner - consumer context whose unload suppresses fallback work.
|
|
212
|
+
* @param ns - consumer-owned settings namespace.
|
|
213
|
+
* @param schema - schema resolving the namespace.
|
|
214
|
+
* @param entry - composition entry used as the base and fallback value.
|
|
215
|
+
* @param hooks - source sink, change notification, and optional validation.
|
|
216
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
217
|
+
*/
|
|
218
|
+
installSection<const Namespace extends string, T>( owner: Context, ns: Namespace & SettingsNamespaceInput<Namespace>, schema: z<T>, entry: T, hooks: SettingsSectionHooks<T>, ): void
|
|
205
219
|
|
|
206
220
|
/**
|
|
207
221
|
* Describe every registered namespace for configuration surfaces, including
|
|
@@ -216,8 +230,9 @@ describe(options?: SettingsDescribeOptions): SettingsDescriptor[]
|
|
|
216
230
|
* Read one registered namespace's resolved value.
|
|
217
231
|
* @param ns - the namespace to read.
|
|
218
232
|
* @returns the resolved value, or `undefined` while unregistered.
|
|
233
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
219
234
|
*/
|
|
220
|
-
get(ns:
|
|
235
|
+
get<const Namespace extends string>(ns: Namespace & SettingsNamespaceInput<Namespace>): unknown
|
|
221
236
|
|
|
222
237
|
/**
|
|
223
238
|
* Merge a patch into one registered namespace's user layer, validate the
|
|
@@ -229,8 +244,9 @@ get(ns: SettingsNamespace): unknown
|
|
|
229
244
|
* @param patch - plain-object patch over the user section.
|
|
230
245
|
* @param expectedRevision - the descriptor `revision` the caller read; a
|
|
231
246
|
* namespace that moved past it rejects with {@link SettingsConflictError}.
|
|
247
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
232
248
|
*/
|
|
233
|
-
async update(ns:
|
|
249
|
+
async update<const Namespace extends string>( ns: Namespace & SettingsNamespaceInput<Namespace>, patch: object, expectedRevision?: number, ): Promise<void>
|
|
234
250
|
|
|
235
251
|
/**
|
|
236
252
|
* Replace one registered namespace's user section wholesale, validate,
|
|
@@ -241,8 +257,9 @@ async update(ns: SettingsNamespace, patch: object, expectedRevision?: number): P
|
|
|
241
257
|
* @param section - the complete next user section.
|
|
242
258
|
* @param expectedRevision - the descriptor `revision` the caller read; a
|
|
243
259
|
* namespace that moved past it rejects with {@link SettingsConflictError}.
|
|
260
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
244
261
|
*/
|
|
245
|
-
async replace(ns:
|
|
262
|
+
async replace<const Namespace extends string>( ns: Namespace & SettingsNamespaceInput<Namespace>, section: object, expectedRevision?: number, ): Promise<void>
|
|
246
263
|
|
|
247
264
|
/**
|
|
248
265
|
* Apply path-addressed edits to one registered namespace's user section,
|
|
@@ -255,8 +272,9 @@ async replace(ns: SettingsNamespace, section: object, expectedRevision?: number)
|
|
|
255
272
|
* @param ops - ordered path edits; later ops observe earlier ones.
|
|
256
273
|
* @param expectedRevision - the descriptor `revision` the caller read; a
|
|
257
274
|
* namespace that moved past it rejects with {@link SettingsConflictError}.
|
|
275
|
+
* @throws {TypeError} when `ns` is not a lowercase hyphenated identifier.
|
|
258
276
|
*/
|
|
259
|
-
async mutate(ns:
|
|
277
|
+
async mutate<const Namespace extends string>( ns: Namespace & SettingsNamespaceInput<Namespace>, ops: readonly SettingsPathOp[], expectedRevision?: number, ): Promise<void>
|
|
260
278
|
```
|
|
261
279
|
|
|
262
280
|
Source: [`packages/settings/settings/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/settings/settings/src/index.ts)
|
|
@@ -265,14 +283,14 @@ Source: [`packages/settings/settings/src/index.ts`](https://github.com/deepseek-
|
|
|
265
283
|
|
|
266
284
|
### `ctx.settingsController` — `SettingsController`
|
|
267
285
|
|
|
268
|
-
Host service backing the generated `ctx.remote.settings` namespace. Every remote read uses `redactSecrets: true`, so a `role('secret')` field cannot ride a response. Writes expose the settings service's merge, replacement, and path-addressed operations, and classify every provider refusal as `settings
|
|
286
|
+
Host service backing the generated `ctx.remote.settings` namespace. Every remote read uses `redactSecrets: true`, so a `role('secret')` field cannot ride a response. Writes expose the settings service's merge, replacement, and path-addressed operations, and classify every provider refusal as `settings/conflict` or `settings/rejected` with the service's message.
|
|
269
287
|
|
|
270
288
|
```ts cordis-catalog
|
|
271
289
|
/**
|
|
272
290
|
* Describe every registered namespace for a configuration page: redacted
|
|
273
291
|
* layered values plus the serialized schema the page renders its form from.
|
|
274
292
|
* @returns provider writability, local-document presence, and one view per namespace.
|
|
275
|
-
* @throws
|
|
293
|
+
* @throws RemoteError when no settings provider is mounted.
|
|
276
294
|
*/
|
|
277
295
|
@Remote describe(): SettingsDescribeValue
|
|
278
296
|
|
|
@@ -288,7 +306,7 @@ Host service backing the generated `ctx.remote.settings` namespace. Every remote
|
|
|
288
306
|
* @param patch - fields to merge into the user section.
|
|
289
307
|
* @param expectedRevision - revision the caller read; `undefined` writes unconditionally.
|
|
290
308
|
* @returns the namespace's redacted view after the write.
|
|
291
|
-
* @throws
|
|
309
|
+
* @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
|
|
292
310
|
*/
|
|
293
311
|
@Remote update( ns: string, patch: Record<string, JsonValue>, expectedRevision: number | undefined, ): Promise<SettingsNamespaceView>
|
|
294
312
|
|
|
@@ -298,7 +316,7 @@ Host service backing the generated `ctx.remote.settings` namespace. Every remote
|
|
|
298
316
|
* @param section - complete replacement user section.
|
|
299
317
|
* @param expectedRevision - revision the caller read; `undefined` writes unconditionally.
|
|
300
318
|
* @returns the namespace's redacted view after the write.
|
|
301
|
-
* @throws
|
|
319
|
+
* @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
|
|
302
320
|
*/
|
|
303
321
|
@Remote replace( ns: string, section: Record<string, JsonValue>, expectedRevision: number | undefined, ): Promise<SettingsNamespaceView>
|
|
304
322
|
|
|
@@ -310,7 +328,7 @@ Host service backing the generated `ctx.remote.settings` namespace. Every remote
|
|
|
310
328
|
* @param ops - the edits to apply, in order.
|
|
311
329
|
* @param expectedRevision - revision the caller read; `undefined` writes unconditionally.
|
|
312
330
|
* @returns the namespace's redacted view after the write.
|
|
313
|
-
* @throws
|
|
331
|
+
* @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
|
|
314
332
|
*/
|
|
315
333
|
@Remote async mutate( ns: string, ops: SettingsPathOpView[], expectedRevision: number | undefined, ): Promise<SettingsNamespaceView>
|
|
316
334
|
|
|
@@ -318,7 +336,7 @@ Host service backing the generated `ctx.remote.settings` namespace. Every remote
|
|
|
318
336
|
* Materialize the provider-owned settings document and open it in a native text editor.
|
|
319
337
|
* @param signal - caller lifetime; abort terminates preparation or the native command.
|
|
320
338
|
* @returns confirmation after the native opener accepts the document.
|
|
321
|
-
* @throws
|
|
339
|
+
* @throws RemoteError when no document exists, preparation fails, or opening fails.
|
|
322
340
|
*/
|
|
323
341
|
@Remote async openSettingsDocument(signal: AbortSignal): Promise<SettingsDocumentOpenValue>
|
|
324
342
|
|
|
@@ -327,7 +345,7 @@ Host service backing the generated `ctx.remote.settings` namespace. Every remote
|
|
|
327
345
|
* @param agentPreset - preset id resolved against Host-owned roots.
|
|
328
346
|
* @param signal - caller lifetime; abort terminates the native command.
|
|
329
347
|
* @returns an opened confirmation or the resolved directory for text display.
|
|
330
|
-
* @throws
|
|
348
|
+
* @throws RemoteError when the preset is missing, read-only, invalid, or cannot be opened.
|
|
331
349
|
*/
|
|
332
350
|
@Remote async openAgentPresetDirectory( agentPreset: string, signal: AbortSignal, ): Promise<AgentPresetDirectoryOpenValue>
|
|
333
351
|
```
|
|
@@ -261,7 +261,7 @@ Host service backing `ctx.remote.skills` without activating a cold Agent.
|
|
|
261
261
|
* @param request - Session identity whose cwd and preset select the catalog view.
|
|
262
262
|
* @param signal - caller lifetime carried by the Remote transport; admitted catalog reads retain their existing completion semantics.
|
|
263
263
|
* @returns user-invocable skill metadata without loading skill bodies.
|
|
264
|
-
* @throws
|
|
264
|
+
* @throws RemoteError when the Session cannot be inspected or no registry can serve it.
|
|
265
265
|
*/
|
|
266
266
|
@Remote async list(request: SkillListRequest, signal: AbortSignal): Promise<SkillListValue>
|
|
267
267
|
```
|
|
@@ -138,6 +138,7 @@ root
|
|
|
138
138
|
│ │ │ ├─ conversation.chat.commandview
|
|
139
139
|
│ │ │ ├─ conversation.chat.turnTail
|
|
140
140
|
│ │ │ └─ tool.call.toolview
|
|
141
|
+
│ │ │ ├─ tool.call.images
|
|
141
142
|
│ │ │ └─ tool.view.cordis
|
|
142
143
|
│ │ ├─ conversation.message.images
|
|
143
144
|
│ │ └─ conversation.trajectory.images
|
|
@@ -47,7 +47,7 @@ interface StorageBackend {
|
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
A backend owns one medium (a file-tree root, a database file) and exposes optional operation groups; `kv` is the only shipped group. `KvFacet.open(descriptor)` opens one named unit — `KvUnitDescriptor` carries the name, format version, table names, and whether a global singleton slot exists — and returns a `KvUnit` with `loadAll`, `putRecord`, `deleteRecord`, `setGlobal`, and `close`. Unit and table names must match `UNIT_NAME_RE` (safe as a file name and as a SQL identifier segment); record keys are arbitrary strings that never reach file paths. A unit does not serialize concurrent writes — ordering belongs to the caller — but each single call is atomic on the medium and durable once resolved. A medium stamped with a different version rejects `version-mismatch`;
|
|
50
|
+
A backend owns one medium (a file-tree root, a database file) and exposes optional operation groups; `kv` is the only shipped group. `KvFacet.open(descriptor)` opens one named unit — `KvUnitDescriptor` carries the name, current format version, optional compatible record versions, table names, and whether a global singleton slot exists — and returns a `KvUnit` with `loadAll`, `putRecord`, `deleteRecord`, `setGlobal`, and `close`. Unit and table names must match `UNIT_NAME_RE` (safe as a file name and as a SQL identifier segment); record keys are arbitrary strings that never reach file paths. A unit does not serialize concurrent writes — ordering belongs to the caller — but each single call is atomic on the medium and durable once resolved. A `single` medium stamped with a different version rejects `version-mismatch`; a `per-record` document stamped outside the accepted set reads as absent. A medium that cannot be parsed as the unit rejects `malformed-medium`. [`backend.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/storage/storage/src/backend.ts) is the normative clause-by-clause contract, and the shared conformance suite in [`tests/contract.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/storage/storage/tests/contract.ts) checks every clause against each backend. The [json backend](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/storage/storage-json/README.md) republishes one whole human-readable file per unit atomically; the [sqlite backend](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/storage/storage-sqlite/README.md) stores one document per row in one database for frequently updated data.
|
|
51
51
|
|
|
52
52
|
## Declaring a domain
|
|
53
53
|
|
|
@@ -58,16 +58,36 @@ A domain is declared once by its owning package as a spec object — the single
|
|
|
58
58
|
interface DomainSpec {
|
|
59
59
|
/** Domain name; must match `UNIT_NAME_RE` (doubles as the backend unit name). */
|
|
60
60
|
readonly name: string
|
|
61
|
-
/**
|
|
61
|
+
/** Current domain format version; reads enforce it according to the selected layout. */
|
|
62
62
|
readonly version: number
|
|
63
63
|
/**
|
|
64
64
|
* Medium layout for the backend unit: `single` (the default) stores the
|
|
65
65
|
* whole unit as one document; `per-record` stores each record as its own
|
|
66
66
|
* document, for units whose records are large, sparse, or individually
|
|
67
|
-
* disposable — the projection cache — and scopes version
|
|
68
|
-
* (
|
|
67
|
+
* disposable — the projection cache — and scopes version checks per record
|
|
68
|
+
* (an unaccepted record document is discarded, never migrated).
|
|
69
69
|
*/
|
|
70
70
|
readonly layout?: 'single' | 'per-record'
|
|
71
|
+
/**
|
|
72
|
+
* Older domain versions whose stored records the current record schemas
|
|
73
|
+
* also accept (the declaring owner vouches for that, typically by
|
|
74
|
+
* declaring the fields older records lack as optional). `per-record` backends
|
|
75
|
+
* read documents stamped with a listed version instead of discarding them,
|
|
76
|
+
* and accept a legacy whole-unit file so stamped for the one-time
|
|
77
|
+
* bootstrap; writes always stamp {@link version}.
|
|
78
|
+
*/
|
|
79
|
+
readonly compatibleVersions?: readonly number[]
|
|
80
|
+
/**
|
|
81
|
+
* What `open` does with a stored table record that fails its zod schema.
|
|
82
|
+
* Absent (the default), the whole open rejects with `invalid-record` —
|
|
83
|
+
* right for authoritative data. `'backup-and-skip'` is for domains whose
|
|
84
|
+
* records are disposable derived data: the backend moves the record's
|
|
85
|
+
* document aside (`KvUnit.backupRecord`), the failure is logged with
|
|
86
|
+
* its cause, and the open continues with the record absent. A backend
|
|
87
|
+
* without `backupRecord` (no per-record document to move) falls back
|
|
88
|
+
* to the rejecting default. The global slot always rejects.
|
|
89
|
+
*/
|
|
90
|
+
readonly invalidRecords?: 'backup-and-skip'
|
|
71
91
|
/** Optional global singleton slot. */
|
|
72
92
|
readonly global?: DomainGlobalSpec<unknown>
|
|
73
93
|
/** Table declarations keyed by table name; each name must match `UNIT_NAME_RE`. */
|
|
@@ -183,7 +203,10 @@ The mounted domain facility. Opens declared domains over routed backends; one fa
|
|
|
183
203
|
* (`facet-unsupported`); open the unit projected from the spec (backend
|
|
184
204
|
* `version-mismatch`/`malformed-medium` pass through); load and validate
|
|
185
205
|
* every stored record against the spec's zod schemas (`invalid-record`
|
|
186
|
-
* with the offending table and key
|
|
206
|
+
* with the offending table and key — unless the spec declares
|
|
207
|
+
* `invalidRecords: 'backup-and-skip'` and the unit can move documents aside, in
|
|
208
|
+
* which case the failing record is backed up, logged, and skipped);
|
|
209
|
+
* construct the domain.
|
|
187
210
|
*
|
|
188
211
|
* Lifecycle: the CALLER owns the returned handle and closes it via
|
|
189
212
|
* `Domain.close()` (typically as its own `ctx.effect` disposer) — the
|
|
@@ -7,7 +7,7 @@ outline: [2,3]
|
|
|
7
7
|
|
|
8
8
|
The subagent seam lets an agent delegate work to a child agent. Like [bash](./shell.md), it is **one optional capability**, not part of the agent loop, so its types live here rather than in [core.md](./core.md). It differs from the other capability seams because **multiple provider implementations coexist** in one context, registered by name (`ctx.subagents`), while bash allows only one executor. Its registry follows the [LLM adapter registry](./llm-streaming.md), not the single-service bash executor.
|
|
9
9
|
|
|
10
|
-
Service Definition: [dsh-subagent](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent) (`ctx.subagents` + the vocabulary below). Service Providers are sibling packages (`dsh-subagent-spawn-in-process`, `dsh-subagent-fork-in-process`, `dsh-subagent-acp`, `dsh-subagent-codex`, `dsh-subagent-claude-code`, `dsh-subagent-dsh-sdk`); the model-facing Consumers are [dsh-tool-subagent](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/tool-subagent) (per-provider delegation)
|
|
10
|
+
Service Definition: [dsh-subagent](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent) (`ctx.subagents` + the vocabulary below). Service Providers are sibling packages (`dsh-subagent-spawn-in-process`, `dsh-subagent-fork-in-process`, `dsh-subagent-acp`, `dsh-subagent-codex`, `dsh-subagent-claude-code`, `dsh-subagent-dsh-sdk`); the model-facing Consumers are [dsh-tool-subagent](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/tool-subagent) (per-provider delegation) and [dsh-tool-subagent-control](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/tool-subagent-control) (the optional global `send_message`, `interrupt_agent`, and `list_agents` controls). The same `ctx.subagents` service owns continuable-child orchestration through an internal activation manager and read-only child and descendant discovery straight from the session store and optional session persistence. Product-provider rationale lives in [the Codex and Claude Code Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-08-04-claude-code-and-codex-subagent-backends.md); common-seam rationale lives in [the subagent Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-06-21-subagent-capability-seam.md), [the continuable subagents Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-28-continuable-subagent-conversations.md), [the adjacent-Agent messaging Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-27-adjacent-agent-steer-messaging.md), [the durable catalog Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-22-durable-subagent-catalog-and-list-agents.md), [the list-identity-projection Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-06-subagent-list-identity-projection.md), and [the merged-service Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/simplification/2026-07-26-merge-subagent-control-service.md).
|
|
11
11
|
|
|
12
12
|
Sources: [`packages/subagent/subagent/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/types.ts), [`packages/subagent/subagent/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/index.ts), and [`packages/subagent/subagent/src/continuation.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/continuation.ts)
|
|
13
13
|
|
|
@@ -136,21 +136,21 @@ persisted Session
|
|
|
136
136
|
|
|
137
137
|
`SubagentRuntime.startContinuable()` reserves the stable child id, snapshots the versioned `subagent/descriptor` payload, asks the named provider for its detached `ContinuableCreateSpec`, creates the child Agent through a private activation-owner scope, establishes any continuable-parent ownership, and submits the initial prompt. It resolves with `{ childId, messageId }` when inbox acceptance yields the message id — without waiting for the turn to start or for the message to enter the Session log. Every failure before that acceptance rejects with neither id, disposing any created handle and rolling back the Activation and parent ownership.
|
|
138
138
|
|
|
139
|
-
`SubagentRuntime.
|
|
139
|
+
`SubagentRuntime.sendMessage()` is the sole model-authored message operation. It accepts the exact live sender plus a target id, permits only a direct parent or direct continuable child, derives sender attribution itself, and routes a direct-child target by Activation residency:
|
|
140
140
|
|
|
141
|
-
| Activation state | `
|
|
141
|
+
| Target Activation state | `sendMessage` |
|
|
142
142
|
|---|---|
|
|
143
|
-
| `running` |
|
|
144
|
-
| `waiting` | wake the same Activation |
|
|
145
|
-
| no Activation | cold-resume a new Activation |
|
|
143
|
+
| `running` | steer the nearest step in the same Activation |
|
|
144
|
+
| `waiting` | wake and steer the same Activation |
|
|
145
|
+
| no Activation | cold-resume a new Activation, then steer it |
|
|
146
146
|
|
|
147
147
|
`running` means the Agent has an active admission or turn, or waking inbox work; `waiting` means it is quiescent but still owns at least one child Activation that has not completed disposal; `settled` means quiescent with every owned child disposed, at which point the manager disposes the [`AgentHandle`](./core.md#creation-and-ownership) and removes the Activation. The manager derives these internal conditions from Agent quiescence and the owned-child set rather than maintaining a second execution state machine.
|
|
148
148
|
|
|
149
|
-
The Agent inbox is the only queue. Every
|
|
149
|
+
The Agent inbox is the only queue. Every Agent message uses `Agent.steer()`: an idle target starts a turn, while a running target claims it at the nearest step boundary. Successful delivery returns the accepted `MessageId`; the existing `agent/inbox/inserted`, `agent/inbox/claimed`, and `agent/inbox/discarded` events remain the message-lifecycle observations, and the continuation layer defines no subagent-specific delivery route.
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Authority comes from the exact live sender. Parent-to-child delivery requires the target's `SessionHeader.parentSession` to name the sender; child-to-parent delivery requires the sender's resident Activation to name the target. Siblings, ancestors beyond one edge, self-targets, stale Agent objects, and one-shot children are rejected. Each accepted message is framed as `Agent <sender-id> sent a message:` and records `AgentMessageSource`; provenance records the sender but grants no authority.
|
|
152
152
|
|
|
153
|
-
For
|
|
153
|
+
For `startContinuable()` and `sendMessage()`, the caller signal owns lookup, materialization, and admission only until inbox acceptance. Afterwards the manager owns the Activation independently: later caller cancellation neither cancels the accepted turn nor disposes the child. Human browser prompts remain a separate private Queue adapter and therefore still produce distinct FIFO turns.
|
|
154
154
|
|
|
155
155
|
`SubagentRuntime.interrupt(targetSessionId, authority)` is the one public stop: it authorizes synchronously, issues `Agent.cancel(cause, { keepInbox: true })` on the live target, and returns without awaiting quiescence. The Activation, its unclaimed pending inbox work, and published descendants are untouched; work already claimed into the interrupted turn is not requeued. Once the interrupted driver is idle, a waking send resumes the parked FIFO queue. An absent target — unknown, one-shot, or already settled — and a manager-less composition are accepted no-ops. For a live target, a mismatched parent address or caller outside its live ancestry rejects with `UNAUTHORIZED`; stale ancestor objects and self-targeting ancestor requests reject before target lookup.
|
|
156
156
|
|
|
@@ -170,21 +170,19 @@ Every Activation owns its `AgentHandle` and an `ownedChildren: Set<SessionId>`;
|
|
|
170
170
|
Final settlement awaits `ctx.sessions.flush(session)` but ignores its participation boolean because an arbitrary listener cannot prove that a persistence backend stored the state. Rejection is logged without failing the Activation, and the manager still disposes the handle and releases ownership; the persisted child state may then be missing or stale on a later resume. Manager unload invokes an internal manager-wide drain that closes admission and disposes every live forest; `drainContinuableDescendants(parents)` closes admission only below exact live host-owned Agents and disposes their continuable descendants while unrelated forests remain live. Both await already-admitted materializations in their scope, propagate cancellation top-down, release handles child-first, and await every selected branch despite individual failures. Durable child Sessions survive that process-local teardown.
|
|
171
171
|
|
|
172
172
|
```ts type-equiv
|
|
173
|
-
/**
|
|
174
|
-
interface
|
|
175
|
-
readonly kind: '
|
|
173
|
+
/** Durable attribution for one model-authored message between adjacent Agents. */
|
|
174
|
+
interface AgentMessageSource {
|
|
175
|
+
readonly kind: 'agent-message'
|
|
176
176
|
/** A message another agent addressed to this one (`relay` context form). */
|
|
177
177
|
readonly form: 'relay'
|
|
178
|
-
/** Session id of the
|
|
178
|
+
/** Session id of the Agent whose tool call produced the message. */
|
|
179
179
|
readonly senderSessionId: SessionId
|
|
180
180
|
}
|
|
181
181
|
```
|
|
182
182
|
|
|
183
183
|
```ts type-equiv
|
|
184
|
-
/** Options for
|
|
185
|
-
interface
|
|
186
|
-
/** Durable attribution retained on the delivered message; it grants no authority. */
|
|
187
|
-
readonly source: MessageSource
|
|
184
|
+
/** Options for one model-authored message between adjacent Agents. */
|
|
185
|
+
interface SubagentSendMessageOptions {
|
|
188
186
|
/** Caller cancellation, owning the operation only until inbox acceptance. */
|
|
189
187
|
readonly signal: AbortSignal
|
|
190
188
|
}
|
|
@@ -200,33 +198,13 @@ interface ContinuableStart {
|
|
|
200
198
|
}
|
|
201
199
|
```
|
|
202
200
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
`SubagentRuntime.reportFrom()` uses that extension point without adding a second queue or a result-bearing child wrapper. The exact live child Agent authorizes the call; callers cannot name a recipient. The manager derives the only recipient from the child's durable `parentSession`, requires that parent Agent to be live, frames the selected content as one `subagent-report` user message, and returns the message's stable `MessageId`. Quiet delivery uses `Agent.inject()` and does not wake the parent; next-step delivery uses `Agent.steer()`, waking an idle parent or joining a running parent's nearest step boundary. Neither mode concludes the child's turn, and no final answer reports implicitly.
|
|
206
|
-
|
|
207
|
-
```ts type-equiv
|
|
208
|
-
/** Durable attribution for a continuable child's explicit parent report. */
|
|
209
|
-
interface SubagentReportMessageSource {
|
|
210
|
-
readonly kind: 'subagent-report'
|
|
211
|
-
/** A message another agent addressed to this one (`relay` context form). */
|
|
212
|
-
readonly form: 'relay'
|
|
213
|
-
/** Session id of the reporting child. */
|
|
214
|
-
readonly senderSessionId: SessionId
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
```ts type-equiv
|
|
219
|
-
/** Deployment scheduling policy for accepted child reports. */
|
|
220
|
-
type SubagentReportDelivery = 'quiet' | 'next-step'
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Reporting is the child's own choice, so the manager keeps a separate account of its own: when a resident Activation settles, it delivers one notice to the child's durable direct parent describing how that epoch ended and carrying its final assistant content. That delivery is unconditional for every child whose id a caller received, happens before the ownership release that would let the parent be judged settled, and reaches a resident parent through the same waking-admission accounting as a report. A parent whose own lineage is already tearing down receives it without a wake, because waking a quiescent Agent starts a turn rather than queueing work. Its provenance is a distinct kind so a transcript never presents a runtime account as something the child wrote.
|
|
201
|
+
When a resident Activation settles, the manager delivers one notice to the child's durable direct parent describing how that epoch ended and carrying its final assistant content. That delivery is unconditional for every child whose id a caller received, happens before the ownership release that would let the parent be judged settled, and reaches a resident parent through the same waking-admission accounting as an Agent message. A parent whose own lineage is already tearing down receives it without a wake, because waking a quiescent Agent starts a turn rather than queueing work. Its provenance is a distinct kind so a transcript never presents a runtime account as something the child wrote.
|
|
224
202
|
|
|
225
203
|
```ts type-equiv
|
|
226
204
|
/**
|
|
227
205
|
* Durable attribution for the runtime's own account of a continuable child
|
|
228
206
|
* settling. Deliberately a different kind from
|
|
229
|
-
* {@link
|
|
207
|
+
* {@link AgentMessageSource}: an Agent message is content the sender chose,
|
|
230
208
|
* while this message is the manager stating what became of the child, and a
|
|
231
209
|
* transcript that merged them would credit the child with words it never wrote.
|
|
232
210
|
*/
|
|
@@ -241,16 +219,6 @@ interface SubagentSettledMessageSource {
|
|
|
241
219
|
}
|
|
242
220
|
```
|
|
243
221
|
|
|
244
|
-
```ts type-equiv
|
|
245
|
-
/** Options for one continuable child's report to its direct parent. */
|
|
246
|
-
interface SubagentReportOptions {
|
|
247
|
-
/** Already-resolved parent scheduling policy. */
|
|
248
|
-
readonly delivery: SubagentReportDelivery
|
|
249
|
-
/** Caller cancellation, owning authorization and admission until acceptance. */
|
|
250
|
-
readonly signal: AbortSignal
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
222
|
The provider participates only in preparing the initial creation spec, where `spawn` and `fork` differ. Its returned spec carries only detached provider-specific creation inputs — the optional parent-history seed — and no Agent, `AgentHandle`, prompt delivery, result, disposal, or resume operation. Cold resume does not dispatch through a provider at all: the manager folds the generic descriptor, calls `ctx.agents.resume()` through the same activation-owner scope, and submits the waiting turn.
|
|
255
223
|
|
|
256
224
|
```ts type-equiv
|
|
@@ -293,11 +261,11 @@ interface ContinuableCreateSpec {
|
|
|
293
261
|
|
|
294
262
|
The descriptor (`SubagentDescriptorData` in [descriptor.ts](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/subagent/src/descriptor.ts)) is a mode-discriminated durable identity for every session-backed subagent. Both modes carry the provider name. A `one-shot` descriptor optionally carries a caller-owned display `label`; a `continuable` descriptor requires the delegation `description` as its durable creation label and additionally snapshots resolved child `agentOptions.provider`/`model`/`reasoningEffort` and optional `persona`/`toolFilter` for cold resume. It never snapshots the merge-extensible `AgentOptions` object, so an unrelated extension value cannot break continuation and a later composition input is a deliberate version change. It omits `subagentDepth` (cold resume trusts the persisted header's `delegationDepth` as the monotone floor) and `outputSchema` (one run or Activation's result contract, not durable identity).
|
|
295
263
|
|
|
296
|
-
A local one-shot provider appends the descriptor inside the child's initial turn before its first request. The continuation manager appends the descriptor after any provider-supplied lineage and before the initial prompt is admitted; `
|
|
264
|
+
A local one-shot provider appends the descriptor inside the child's initial turn before its first request. The continuation manager appends the descriptor after any provider-supplied lineage and before the initial prompt is admitted; `Session.inheritedEventCount` remains the fork-lineage boundary: resume-time descriptor authority reads the child's own suffix, while the list-serving identity projection folds `subagent/descriptor` last-wins so the child's own descriptor overrides a fork-seeded ancestor's. A seeded cold list skips a cache hint until an authoritative observation supplies that exact cut. The event is log-only: no `surfaceOp`, never in model history, and retained across compaction by the append-only log. Malformed current-version descriptors are corrupt; unsupported versions cannot be classified by this runtime.
|
|
297
265
|
|
|
298
266
|
## Durable enumeration: `listChildren()`, `listDescendants()`, and their entries
|
|
299
267
|
|
|
300
|
-
`SubagentRuntime.listChildren(parentSessionId)` enumerates the parent's direct session-backed subagents from the live-preferred merge of `ctx.sessions
|
|
268
|
+
`SubagentRuntime.listChildren(parentSessionId)` enumerates the parent's direct session-backed subagents from the live-preferred merge of `ctx.sessions` and the session-query engine's `listSessions()` — no Agent is loaded or resumed. Candidates are the direct children whose durable header carries `origin: 'subagent'`; the marker classifies enumeration and coarse generic-route denial but cannot establish a valid descriptor, resumability, or authorization — the projection fold owns identity, and the Activation contract owns resume. Each row's `mode`/`label` is the registered `subagent` projection unit's value, served through a three-rung ladder: the registry's watermark cache for a live child (zero log reads); the optional projection checkpoint cache for a cold one (`cachedSnapshot` — an identity passing the own-suffix seq gate is final, because an own descriptor is immutable once appended); otherwise one `query.observeSession()` cold observation folded through the registry (bounded concurrency, recomputed per listing). The cache is a pure optional accelerator: absent, serving the `null` sentinel or missing the key, failing the seq gate, or faulting, it falls silently through to the authoritative refold. The fold is `subagent/descriptor` last-wins with no failure channel: the child's own descriptor overrides a fork-seeded ancestor's, and a malformed or unknown-version payload folds to a serializable `null` sentinel, treated as no value. The result is one `SubagentListEntry[]` in `createdAt`-then-id order: a served identity yields a `child` entry with `mode: 'one-shot' | 'continuable'` and `activity: 'running' | 'inactive'`; continuable entries always carry `label`, while one-shot entries carry it only when the start caller supplied presentation metadata. A settled candidate whose fold served no identity yields a `corrupt` diagnostic — missing, malformed, and unknown-version descriptors deliberately undistinguished (`unsupported` remains in the type but is never produced); a running candidate without an identity is omitted (the creation window before its descriptor lands); a failed cold inspection yields one `unavailable` diagnostic retried on the next listing, so one damaged sibling cannot hide healthy children. `hasChildren` marks a direct descendant with durable subagent origin, read from the same merged material. Activity snapshots only whether the logical record is live in `ctx.sessions`, not outcome or resumability. Absent persistence, enumeration is live-only rather than an error — a cold child cannot be resumed then either. `listChildren()` throws `SubagentError` with code `SUBAGENT_CONTROL_PROJECTIONS_UNAVAILABLE` when the `ctx.sessionProjections` registry is absent and `SUBAGENT_CONTROL_SESSION_STORE_UNAVAILABLE` when the session store is, both checked before any read so a deployment with zero children still fails deterministically; the list tool requires `ctx.subagents` and `ctx.agents` at plugin load. A service consumer such as a UI can display both modes and choose an unlabeled one-shot fallback, while the model-facing `list_agents` adapter (the separately loadable `/list-agents` plugin of [dsh-tool-subagent-control](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/tool-subagent-control)) keeps only continuable entries and refines status through the live Agent registry into its own `running`/`idle`/`ready` vocabulary, whose `ready` names a storage-only child as resumable rather than terminal. Listing does not consult the continuation manager's Activation map, Agent registry, or provider availability; `send_message` remains the authoritative delivery-time operation, and a listed running continuable child may still reject delivery as an ownership conflict. The read-path rationale lives in [the list-identity-projection Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-08-06-subagent-list-identity-projection.md).
|
|
301
269
|
|
|
302
270
|
`SubagentRuntime.listDescendants(rootSessionId)` applies the same live-preferred corpus and projection-backed interpretation to the root's complete descendant tree in stable pre-order. Ordinary sessions and one-shot children remain traversal nodes, so continuable descendants below them are discovered; only `origin: 'subagent'` candidates produce rows. Each returned child or diagnostic adds its position from the enumerated durable header, while a cold inspection revalidates that complete lifecycle before serving identity:
|
|
303
271
|
|
|
@@ -535,21 +503,20 @@ Named provider registry with one-shot runs, durable discovery, and continuable-c
|
|
|
535
503
|
async startContinuable(spec: ContinuableStartSpec): Promise<ContinuableStart>
|
|
536
504
|
|
|
537
505
|
/**
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
* @param
|
|
544
|
-
* @param
|
|
545
|
-
* @param content -
|
|
546
|
-
* @param options -
|
|
547
|
-
* operation only before inbox acceptance.
|
|
506
|
+
* Steer one model-authored message to the sender's direct parent or direct
|
|
507
|
+
* continuable child. A running target admits it at the nearest step boundary;
|
|
508
|
+
* an idle target starts a turn, and an absent direct child cold-resumes from
|
|
509
|
+
* persistence. The service derives durable sender attribution from the exact
|
|
510
|
+
* live sender. Caller cancellation stops only pre-acceptance work.
|
|
511
|
+
* @param sender - exact live Agent authorizing and originating the message.
|
|
512
|
+
* @param targetId - durable direct-parent or direct-child session id.
|
|
513
|
+
* @param content - model-authored content to deliver.
|
|
514
|
+
* @param options - caller cancellation before inbox acceptance.
|
|
548
515
|
* @returns the accepted message's inbox id.
|
|
549
|
-
* @throws when continuation services are unavailable,
|
|
550
|
-
*
|
|
516
|
+
* @throws when continuation services are unavailable, adjacency is rejected,
|
|
517
|
+
* or the message was not admitted.
|
|
551
518
|
*/
|
|
552
|
-
async
|
|
519
|
+
async sendMessage( sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions, ): Promise<MessageId>
|
|
553
520
|
|
|
554
521
|
/**
|
|
555
522
|
* Interrupt one live continuable child's current turn under a human parent
|
|
@@ -568,29 +535,6 @@ async followup( parent: Agent, childId: SessionId, content: ContentBlock[], opti
|
|
|
568
535
|
*/
|
|
569
536
|
interrupt(targetSessionId: SessionId, authority: SubagentInterruptAuthority): void
|
|
570
537
|
|
|
571
|
-
/**
|
|
572
|
-
* Deliver selected content from one live continuable child to its durable
|
|
573
|
-
* direct parent. The child is the authority credential; callers cannot name a
|
|
574
|
-
* recipient. Reporting does not conclude the child's turn or Activation.
|
|
575
|
-
* @param child - exact live reporting child.
|
|
576
|
-
* @param content - selected model-facing content.
|
|
577
|
-
* @param options - parent scheduling and pre-acceptance cancellation.
|
|
578
|
-
* @returns the stable identity of the parent-accepted message.
|
|
579
|
-
* @throws when continuation services are unavailable, sender authorization
|
|
580
|
-
* fails, or the direct parent is not live.
|
|
581
|
-
*/
|
|
582
|
-
async reportFrom( child: Agent, content: ContentBlock[], options: SubagentReportOptions, ): Promise<MessageId>
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* Compose one deployment capability into every continuable child's
|
|
586
|
-
* unpublished creation context on fresh creation and cold resume. Grants wait
|
|
587
|
-
* for the next Activation; removing the contribution revokes every resident
|
|
588
|
-
* installation immediately.
|
|
589
|
-
* @param contribution - synchronous child-scope installer.
|
|
590
|
-
* @returns the exact Cordis effect disposer.
|
|
591
|
-
*/
|
|
592
|
-
registerContinuableSetup(contribution: ContinuableSetupContribution): () => void
|
|
593
|
-
|
|
594
538
|
/**
|
|
595
539
|
* Close continuable admission below exact live parent Agents, stop only their
|
|
596
540
|
* visible descendant Activations synchronously, then await admitted scoped
|
|
@@ -660,9 +604,9 @@ listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<Subagen
|
|
|
660
604
|
* @param parentSessionId - parent session whose direct children are listed.
|
|
661
605
|
* @param signal - carrier cancellation forwarded to Session queries.
|
|
662
606
|
* @returns the catalog view for that parent.
|
|
663
|
-
* @throws {
|
|
664
|
-
* `cancelled` for an aborted read, `subagent
|
|
665
|
-
* the deployment has no projection registry, otherwise `internal`.
|
|
607
|
+
* @throws {RemoteError} `gateway/bad-request` for an empty parent id,
|
|
608
|
+
* `gateway/cancelled` for an aborted read, `subagent/projections-unavailable` when
|
|
609
|
+
* the deployment has no projection registry, otherwise `gateway/internal`.
|
|
666
610
|
*/
|
|
667
611
|
@Remote('list') async remoteExportList(parentSessionId: SessionId, signal: AbortSignal): Promise<SubagentCatalog>
|
|
668
612
|
|
|
@@ -672,13 +616,15 @@ listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<Subagen
|
|
|
672
616
|
* validated browser zone on the accepted message. Success identifies the
|
|
673
617
|
* message the child's FIFO inbox accepted; later execution is independent of
|
|
674
618
|
* this call.
|
|
619
|
+
* Image parts are admitted and persisted through the attachment store
|
|
620
|
+
* before delivery, and the child's model must accept image input.
|
|
675
621
|
* @param request - durable address, minted identity, content, and optional browser zone.
|
|
676
622
|
* @param signal - carrier cancellation, owning the call until inbox acceptance.
|
|
677
623
|
* @returns the accepted message's inbox identity.
|
|
678
|
-
* @throws {
|
|
679
|
-
* `subagent-
|
|
680
|
-
* `subagent-
|
|
681
|
-
* `internal`.
|
|
624
|
+
* @throws {RemoteError} `gateway/bad-request`, `subagent/attachment-invalid`,
|
|
625
|
+
* `subagent/invalid-time-zone`, `subagent/parent-unavailable`,
|
|
626
|
+
* `subagent/not-resumable`, `subagent/unauthorized`,
|
|
627
|
+
* `subagent/delivery-unavailable`, `gateway/cancelled`, or `gateway/internal`.
|
|
682
628
|
*/
|
|
683
629
|
@Remote('prompt') async prompt(request: SubagentPromptRequest, signal: AbortSignal): Promise<SubagentPromptReceipt>
|
|
684
630
|
|
|
@@ -692,9 +638,9 @@ listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<Subagen
|
|
|
692
638
|
* @param parentSessionId - durable direct parent whose authority is claimed.
|
|
693
639
|
* @param mode - required continuable-address discriminator.
|
|
694
640
|
* @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.
|
|
695
|
-
* @throws {
|
|
696
|
-
* `subagent
|
|
697
|
-
* otherwise `internal`.
|
|
641
|
+
* @throws {RemoteError} `gateway/bad-request` for an empty id,
|
|
642
|
+
* `subagent/unauthorized` when the address does not own the live target,
|
|
643
|
+
* otherwise `gateway/internal`.
|
|
698
644
|
*/
|
|
699
645
|
@Remote('interruptByParent') interruptByParent( childSessionId: SessionId, parentSessionId: SessionId, mode: 'continuable', ): SubagentInterruptReceipt
|
|
700
646
|
|
|
@@ -42,7 +42,7 @@ interface ToolProviderResult {
|
|
|
42
42
|
|
|
43
43
|
## Prompt sections
|
|
44
44
|
|
|
45
|
-
`PromptSection` is a readonly same-process registration contract. Its text may be static or resolved from the current assembly context. Sections sort by ascending order and then code-unit name;
|
|
45
|
+
`PromptSection` is a readonly same-process registration contract. Its text may be static or resolved from the current assembly context. Sections sort by ascending order and then code-unit name; repository contributors resolve the service-owned named allocation through `getSectionOrder()`. Runtime-context contributors resolve their independent allocation through `getContextOrder()`. One effective `complete` section becomes the sole prompt section after cooperative assembly.
|
|
46
46
|
|
|
47
47
|
```ts type-equiv
|
|
48
48
|
/** One contributed section of the system prompt (registry input). */
|
|
@@ -51,8 +51,7 @@ interface PromptSection {
|
|
|
51
51
|
readonly name: string
|
|
52
52
|
/**
|
|
53
53
|
* Sections are concatenated in ascending order. Equal orders use code-unit
|
|
54
|
-
* name order.
|
|
55
|
-
* {@link FIRST_PARTY_SECTION_ORDER}.
|
|
54
|
+
* name order.
|
|
56
55
|
*/
|
|
57
56
|
readonly order: number
|
|
58
57
|
/**
|
|
@@ -112,6 +111,20 @@ Registry service for the prompt inputs assembled before each model step.
|
|
|
112
111
|
*/
|
|
113
112
|
section(section: PromptSection): () => void
|
|
114
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Resolve the centrally owned placement of a repository prompt section.
|
|
116
|
+
* @param name - stable section placement name.
|
|
117
|
+
* @returns the section's numeric sort order.
|
|
118
|
+
*/
|
|
119
|
+
getSectionOrder(name: PromptSectionOrderName): number
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Resolve the centrally owned placement of a repository runtime context.
|
|
123
|
+
* @param name - stable context placement name.
|
|
124
|
+
* @returns the context's numeric sort order.
|
|
125
|
+
*/
|
|
126
|
+
getContextOrder(name: PromptContextOrderName): number
|
|
127
|
+
|
|
115
128
|
/**
|
|
116
129
|
* Register ordered dynamic context in the calling context's scope. Scoped
|
|
117
130
|
* entries shadow global entries with the same name.
|
|
@@ -15,7 +15,7 @@ Source: [`packages/llm/token-meter/src/types.ts`](https://github.com/deepseek-ai
|
|
|
15
15
|
/** Detached immutable request-pressure and surface snapshot at one consumed log revision. */
|
|
16
16
|
interface TokenMeasurement {
|
|
17
17
|
/** Number of durable events consumed; equal to the next unread event seq. */
|
|
18
|
-
readonly logRevision:
|
|
18
|
+
readonly logRevision: SessionLogOffset
|
|
19
19
|
/** Provider or heuristic anchor used for this measurement. */
|
|
20
20
|
readonly baseline: TokenMeasurementBaseline
|
|
21
21
|
/** Signed repricing of current surface content relative to the baseline anchor. */
|
|
@@ -37,7 +37,7 @@ Every measurement resolves the effective envelope's routed provider/model to tha
|
|
|
37
37
|
/** One token-priced node in the current ordered session surface. */
|
|
38
38
|
interface TokenSurfaceNode {
|
|
39
39
|
/** Durable sequence number of the surface event. */
|
|
40
|
-
readonly seq:
|
|
40
|
+
readonly seq: SessionSeq
|
|
41
41
|
/**
|
|
42
42
|
* Request-pressure tokens for the exact message projected by this node under
|
|
43
43
|
* the measured route: image occurrences carry the route's declared visual
|
|
@@ -142,7 +142,7 @@ interface TypertRemoteNamespaceMap {}
|
|
|
142
142
|
|
|
143
143
|
## Host Gateway
|
|
144
144
|
|
|
145
|
-
Connection decodes its carrier envelope before calling `ctx.typertGateway`. The request carries exact named wire fields and the carrier's cancellation signal separately; infrastructure and boundary failures
|
|
145
|
+
Connection decodes its carrier envelope before calling `ctx.typertGateway`. The request carries exact named wire fields and the carrier's cancellation signal separately; infrastructure and boundary failures ride `TypertGatewayError`, whose `gateway/*` codes are ordinary `RemoteError` codes, so the RPC adapter passes every structurally identified `RemoteError` through with its code and details intact and folds only unrecognized exceptions into `gateway/internal`.
|
|
146
146
|
|
|
147
147
|
```ts type-equiv
|
|
148
148
|
/** One Remote method request after a carrier has decoded its envelope. */
|
|
@@ -161,23 +161,23 @@ interface InvokeRemoteRequest {
|
|
|
161
161
|
```ts type-equiv
|
|
162
162
|
/** Stable infrastructure and boundary failures emitted before or after business execution. */
|
|
163
163
|
type TypertGatewayErrorCode =
|
|
164
|
-
| 'ambiguous-endpoint'
|
|
165
|
-
| 'arguments-invalid'
|
|
166
|
-
| 'binding-invalid'
|
|
167
|
-
| 'context-failed'
|
|
168
|
-
| 'context-not-found'
|
|
169
|
-
| 'context-unavailable'
|
|
170
|
-
| 'definition-unavailable'
|
|
171
|
-
| 'input-invalid'
|
|
172
|
-
| 'invocation-unavailable'
|
|
173
|
-
| 'lookup-failed'
|
|
174
|
-
| 'lookup-not-found'
|
|
175
|
-
| 'lookup-unavailable'
|
|
176
|
-
| 'method-unavailable'
|
|
177
|
-
| 'provider-mismatch'
|
|
178
|
-
| 'result-invalid'
|
|
179
|
-
| 'service-unavailable'
|
|
180
|
-
| 'signature-invalid'
|
|
164
|
+
| 'gateway/ambiguous-endpoint'
|
|
165
|
+
| 'gateway/arguments-invalid'
|
|
166
|
+
| 'gateway/binding-invalid'
|
|
167
|
+
| 'gateway/context-failed'
|
|
168
|
+
| 'gateway/context-not-found'
|
|
169
|
+
| 'gateway/context-unavailable'
|
|
170
|
+
| 'gateway/definition-unavailable'
|
|
171
|
+
| 'gateway/input-invalid'
|
|
172
|
+
| 'gateway/invocation-unavailable'
|
|
173
|
+
| 'gateway/lookup-failed'
|
|
174
|
+
| 'gateway/lookup-not-found'
|
|
175
|
+
| 'gateway/lookup-unavailable'
|
|
176
|
+
| 'gateway/method-unavailable'
|
|
177
|
+
| 'gateway/provider-mismatch'
|
|
178
|
+
| 'gateway/result-invalid'
|
|
179
|
+
| 'gateway/service-unavailable'
|
|
180
|
+
| 'gateway/signature-invalid'
|
|
181
181
|
```
|
|
182
182
|
|
|
183
183
|
```ts type-equiv
|