feat(subagent): catalog one-shot child sessions
This commit is contained in:
@@ -10,9 +10,9 @@ import type { Context } from 'cordis'
|
||||
import z from 'schemastery'
|
||||
import type {
|
||||
ContinuableCreateSpec,
|
||||
ResolvedSubagentStartRequest,
|
||||
SubagentCapabilities,
|
||||
SubagentProvider,
|
||||
SubagentStartRequest,
|
||||
} from '@deepseek-ai/dsh-subagent'
|
||||
import { startInProcessRun } from '@deepseek-ai/dsh-subagent-inprocess'
|
||||
|
||||
@@ -45,7 +45,7 @@ class SpawnProvider implements SubagentProvider {
|
||||
|
||||
constructor(readonly name: string) {}
|
||||
|
||||
start(request: SubagentStartRequest) {
|
||||
start(request: ResolvedSubagentStartRequest) {
|
||||
// Fresh child: no seed. The shared driver mints ids, stamps cwd/lineage/
|
||||
// depth, drives the one-shot (including the structured capture when the
|
||||
// request carries an outputSchema), and maps the result.
|
||||
|
||||
@@ -49,8 +49,16 @@ function text(blocks: { type: string; text?: string }[]): string {
|
||||
return blocks.filter(b => b.type === 'text').map(b => b.text).join('')
|
||||
}
|
||||
|
||||
function start(ctx: Context, provider: string, request: Omit<SubagentStartRequest, 'signal'> & { signal?: AbortSignal }) {
|
||||
return ctx.subagents.start(provider, { signal: request.signal ?? new AbortController().signal, ...request })
|
||||
function start(
|
||||
ctx: Context,
|
||||
provider: string,
|
||||
request: Omit<SubagentStartRequest, 'label' | 'signal'> & { label?: string; signal?: AbortSignal },
|
||||
) {
|
||||
return ctx.subagents.start(provider, {
|
||||
label: request.label ?? 'child task',
|
||||
signal: request.signal ?? new AbortController().signal,
|
||||
...request,
|
||||
})
|
||||
}
|
||||
|
||||
/** Invoke the child lifecycle effect while its parent-owned setup is still unpublished. */
|
||||
|
||||
Reference in New Issue
Block a user