1.7 KiB
1.7 KiB
ctx.agentExecution
AgentExecutionService (abstract seam) — provided by @deepseek-ai/dsh-agent-execution.
Ambient Agent identity within one process-local asynchronous chain.
ctx.agentExecution.current()
current(): AgentExecution | undefined
Read the active execution without requiring one.
Returns the inherited execution, or undefined outside/inside a cleared boundary.
ctx.agentExecution.require()
require(): AgentExecution
Read the active execution and fail when no boundary is active.
Returns the inherited execution.
ctx.agentExecution.run(execution, operation)
run<T>(execution: AgentExecution | undefined, operation: () => T): T
Run an operation inside an execution boundary. Passing undefined clears an inherited execution; the exact synchronous value or Promise is returned.
execution— execution to inherit, orundefinedfor a clearing boundary.operation— synchronous or asynchronous operation to invoke.
Returns the exact value returned by operation.