Interface: LocalDaemonBuilder
Defined in: node/src/builders/local-daemon-builder.ts:64
Fluent builder for a lifecycle-bound background daemon service (local.daemon(id)).
Configures dynamic TCP port allocation, pre-start cleanup and shutdown commands, combined stdout/stderr readiness regexes, and framed pseudo-terminal (PTY) interaction tools.
Extends
Methods
interact()
interact<TInput>(toolName, options): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:147
Registers a framed PTY interaction tool exposed while the daemon service is active.
Populates LocalServiceNode.toolSchemas up front so wire tool definitions remain static across skill activation and deactivation.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TInput | object | Validated tool input payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
toolName | string | Unique tool name exposed to the agent. |
options | LocalDaemonInteractOptions<TInput> | Interactive PTY command and framing configuration. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
lifecycle()
lifecycle(mode): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:88
Sets the lifecycle scope ('scope' | 'fork' | 'skill') governing daemon startup and teardown.
Controls when the runtime automatically starts, quiesces, and stops the daemon process.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | "scope" | "fork" | "skill" | Service lifecycle binding mode. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
port()
port(name): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:99
Declares a named dynamic TCP port to allocate conflict-free before starting the daemon.
Verifies TCP listener readiness on the allocated port before resolving service acquisition.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Logical port key exposed on ctx.ports[name]. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
readyWhenStdout()
readyWhenStdout(pattern): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:132
Configures a readiness regular expression evaluated over combined stdout and stderr during startup.
Blocks service session resolution until the rolling output buffer matches pattern and all TCP ports listen.
Parameters
| Parameter | Type | Description |
|---|---|---|
pattern | string | RegExp | Regular expression or pattern string indicating daemon readiness. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
runner()
runner(runner): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:77
Binds the NodeRunnerNode pool governing maxDaemons concurrency slots for this service.
Acquires a daemon slot via RunnerDriver.withDaemonSlot for the duration of the active ServiceSession.
Parameters
| Parameter | Type | Description |
|---|---|---|
runner | MaybeBuilder<NodeRunnerNode> | Runner pool AST node or builder. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
start()
start(startFn): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:110
Binds the pure factory function producing the startup command argv for the daemon.
Receives allocated ports, the hash-suffixed scopeKey, and optional worktreePath.
Parameters
| Parameter | Type | Description |
|---|---|---|
startFn | (ctx) => readonly string[] | Startup argv factory. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
stopCommand()
stopCommand(stopFn): LocalDaemonBuilder;Defined in: node/src/builders/local-daemon-builder.ts:121
Binds an optional cleanup/stop command factory executed best-effort before .start() and during .stop().
Reaps crash-orphaned containers or external processes bound to the same scopeKey.
Parameters
| Parameter | Type | Description |
|---|---|---|
stopFn | (ctx) => readonly string[] | Cleanup argv factory. |
Returns
LocalDaemonBuilder
Updated immutable daemon builder.
toAST()
toAST(): LocalServiceNode;Defined in: core/dist/ast/ast-builder.d.ts:19
Compiles the current builder configuration into a deeply frozen passive AST node.
Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.
Returns
Deeply frozen passive AST node.
Inherited from
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the daemon service. | node/src/builders/local-daemon-builder.ts:66 |