Skip to content

Interface: ServiceSession<THandle> ​

Defined in: ports/service-session.ts:13

Live background daemon session spawned from a ServiceASTNode within an isolation scope.

Exposes interaction tools unlocked while the service is mounted and a deterministic stop() lifecycle method invoked when the owning skill completes or the step quiesces.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownRuntime handle type of the active isolation scope.

Methods ​

invokeTool() ​

ts
invokeTool(
   toolName, 
   args, 
   ctx
): Promise<ToolExecutionResult>;

Defined in: ports/service-session.ts:30

Invokes one of the service session's exposed interaction tools by name.

Executes the interaction request against the running daemon and returns the formatted tool result.

Parameters ​

ParameterTypeDescription
toolNamestringName of the service interaction tool to invoke.
argsunknownTool call arguments supplied by the model.
ctxStepExecutionContext<THandle>Active step execution context.

Returns ​

Promise<ToolExecutionResult>

Tool execution result string and error status.


stop() ​

ts
stop(): Promise<void>;

Defined in: ports/service-session.ts:43

Stops the background daemon process, drains open sockets, and releases its daemon runner slot.

Called deterministically when the enclosing skill completes, the step finishes, or the actor suspends.

Returns ​

Promise<void>

Resolves once the daemon session has terminated cleanly.

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique identifier of the service AST node that spawned this session.ports/service-session.ts:15
toolsreadonlyreadonly BuiltInToolASTNode<THandle>[]Interaction tool AST nodes exposed to the agent while this service session is active.ports/service-session.ts:17

Released under the MIT License.