Skip to content

@paraharness/node ​

Variables ​

VariableDescription
DEFAULT_SUBPROCESS_GRACE_MSGrace period in milliseconds between SIGTERM and SIGKILL during process-group termination.
ISOLATED_GIT_ENV_OVERRIDESStatic isolated GIT_* environment overrides injected when a scope handle provides worktreePath.
localFrozen local.* DSL builder namespace for @paraharness/node.
mcpFrozen mcp.* DSL builder namespace for @paraharness/node.
nodeExecutorsDefault frozen RuntimeExecutorRegistrySlice instance for @paraharness/node.

Functions ​

FunctionDescription
allocateDynamicPortsAllocates distinct, conflict-free dynamic TCP ports for all named .port(name) entries on a daemon.
createAllowBinariesBuilderCreates a policy guard builder and passive AST node restricting subprocess binaries (local.allowBinaries).
createDenyNetworkBuilderCreates a policy guard builder and passive AST node denying outbound network access (local.denyNetwork).
createLocalCommandBuilderCreates a fluent LocalCommandBuilder for local.command(id).
createLocalCommandToolDriverCreates the ToolDriver for LocalCommandToolNode (type: 'node:command-tool').
createLocalDaemonBuilderCreates a fluent LocalDaemonBuilder for local.daemon(id).
createLocalRunnerBuilderCreates a LocalRunnerBuilder for local.runner({ id?, slots, maxDaemons? }).
createLocalServiceToolDriverCreates the ToolDriver for LocalServiceToolNode (type: 'node:service-tool').
createLocalStreamCheckBuilderCreates a fluent LocalStreamCheckBuilder for local.streamCheck(id).
createLocalStreamCheckToolDriverCreates the ToolDriver for LocalStreamCheckToolNode (type: 'node:stream-check-tool').
createMcpServerBuilderCreates an HTTP / MCP control-plane builder and passive AST node (mcp.server({ port })).
createMcpSseBuilderCreates an MCP HTTP/SSE control-plane builder and passive AST node (local.mcpSse({ port })).
createMcpStdioBuilderCreates an MCP stdio control-plane builder and passive AST node (local.mcpStdio(serverName)).
createNodeExecutorsCreates a RuntimeExecutorRegistrySlice registering all @paraharness/node executors and drivers.
createNodeHttpControlPlaneAdapterCreates a ControlPlaneAdapter for NodeHttpControlPlaneNode (mcp.server({ port })).
createNodeMcpSseAdapterCreates a ControlPlaneAdapter for NodeMcpSseNode (local.mcpSse({ port })).
createNodeMcpStdioAdapterCreates a ControlPlaneAdapter for NodeMcpStdioNode (local.mcpStdio(serverName)).
evaluateNodeAllowBinariesGuardEvaluates a NodeAllowBinariesNode (type: 'node:allow-binaries') policy guard against proposed tool effects.
evaluateNodeDenyNetworkGuardEvaluates a NodeDenyNetworkNode (type: 'node:deny-network') policy guard against proposed tool effects.
executeLocalCommandCheckExecutes a LocalCommandCheckNode (type: 'node:command-check') as a deterministic check gate.
executeLocalCommandStepExecutes a LocalCommandNode (type: 'node:command') inside its configured runner pool slot.
executeLocalStreamCheckExecutes a LocalStreamCheckNode (type: 'node:stream-check') inside its runner pool slot.
resolveWorktreeEnvAndCwdResolves the subprocess working directory and environment map from the active scopeHandle and envConfig.
sanitizeDaemonScopeKeySanitizes a raw isolation scopeKey into a collision-free daemon container/resource identifier.
spawnDetachedSubprocessSpawns a detached OS subprocess group (detached: true) with piped stdout and stderr.
startLocalDaemonServiceStarts a LocalServiceNode (type: 'node:service') inside a long-lived runner daemon slot.
terminateProcessGroupWithGraceTerminates a detached child process group and descendant PID tree gracefully (pidtree + fkill).
waitForTcpPortReadyWaits for 127.0.0.1:port to accept TCP connections via wait-on or rejects on timeout/abort.

Classes ​

ClassDescription
NodeRunnerDriverRuntime concurrency limiter implementing RunnerDriver for NodeRunnerNode (local.runner).
PtyFramedInteractiveSessionStateful ECHO-disabled OS pseudo-terminal session managing framed turn-based CLI communication (local.daemon.interact).

Interfaces ​

InterfaceDescription
LocalCommandBuilderFluent builder for a one-shot local OS subprocess command (local.command(id)).
LocalCommandCheckNodePassive AST node adapting a LocalCommandNode into a deterministic CheckASTNode (cmd.asCheck()).
LocalCommandNodePassive AST node representing a one-shot local OS subprocess command (local.command).
LocalCommandToolNodePassive AST node adapting a LocalCommandNode into a post-flight-diffed ToolASTNode (cmd.asTool()).
LocalCommandUnrepeatableConfigIdempotency guard configuration on LocalCommandNode that skips execution when preCheckCmd returns true.
LocalCommandUnrepeatableOptionsOptions for configuring an idempotency guard on local.command().unrepeatable(preCheckCmd, options).
LocalDaemonBuilderFluent builder for a lifecycle-bound background daemon service (local.daemon(id)).
LocalDaemonCommandContextRuntime context supplied to local.daemon .start(), .stopCommand(), and .interact() command factories.
LocalDaemonInteractOptionsConfiguration options for registering a framed PTY interaction tool on local.daemon(id).interact(toolName, options).
LocalDaemonRegexDescriptorSerializable regular expression descriptor used for frameDelimiter when specified as a pattern record.
LocalNamespacePublic local.* DSL builder namespace exported by @paraharness/node.
LocalRunnerBuilderFluent builder and passive descriptor for a local OS subprocess runner pool (local.runner).
LocalRunnerOptionsConfiguration options for creating a local OS subprocess and daemon runner pool (local.runner).
LocalServiceInteractionConfigFramed pseudo-terminal (PTY) interaction tool specification exposed by a LocalServiceNode.
LocalServiceNodePassive AST node representing a lifecycle-bound background daemon service (local.daemon).
LocalServiceToolNodePassive AST node representing a post-flight-diffed interaction tool bound to a LocalServiceNode.
LocalStreamCheckBuilderFluent builder for a streaming subprocess verification check (local.streamCheck(id)).
LocalStreamCheckCircuitBreakerConfigRolling-window regex circuit-breaker configuration over combined stdout and stderr for LocalStreamCheckNode.
LocalStreamCheckCircuitBreakerOptionsConfiguration options for a rolling-window regex circuit breaker on local.streamCheck.
LocalStreamCheckNodePassive AST node representing a streaming subprocess check with rolling-window regex circuit-breaking (local.streamCheck).
LocalStreamCheckToolNodePassive AST node adapting a LocalStreamCheckNode into a post-flight-diffed ToolASTNode (streamCheck.asTool()).
McpNamespacePublic mcp.* DSL builder namespace exported by @paraharness/node.
McpServerOptionsConfiguration options for exposing a local HTTP or MCP SSE control-plane server (mcp.server / local.mcpSse).
NodeAllowBinariesNodePassive AST node restricting subprocess execution to an explicit allowlist of binary names (local.allowBinaries).
NodeDenyNetworkNodePassive AST node denying outbound network access during subprocess execution (local.denyNetwork).
NodeHttpControlPlaneNodePassive AST node exposing a local HTTP control-plane endpoint (local.httpControlPlane).
NodeMcpSseNodePassive AST node exposing a Model Context Protocol (MCP) server over HTTP/SSE (mcp.server / local.mcpSse).
NodeMcpStdioNodePassive AST node exposing a Model Context Protocol (MCP) server over standard I/O (local.mcpStdio).
NodeRunnerNodePassive AST node representing a local OS subprocess and daemon concurrency pool (local.runner).

Released under the MIT License.