Skip to main content

client/src

packages/client/src

Purpose

Public barrel for the MoltZap client package.

Public surface

acquireHarnessClient

Function
Acquires one turn-ready harness connection and receive stream for the lifetime of the enclosing scope. The supplied KeyValueStore is local to the active agent and holds only stable presentation checkpoints. Returns: The scoped adapter-facing service value.

acquireMoltzapdChild

Function
Starts the package’s real moltzapd binary against an existing slot. The slot carries the loopback port, so the child receives only its profile name and the returned URL is derived from the same persisted value. Returns: A scoped packaged daemon after its MCP status reports connected.

AgentClientOptions

Interface
Configures agent client.

ContextOptions

Interface
Configures context.

ConversationMeta

Interface
Describes conversation meta.

ConversationWithParticipants

TypeAlias
Conversation plus its membership, assembled by the daemon because the canonical Conversation sent over the network carries no participants. It crosses only the loopback MCP boundary, and it is public because it names what HarnessClientService.startConversation hands back to an adapter.

HarnessClient

Class
Effect service tag consumed by runtime adapters.

harnessClientForProfile

Function
Acquire the adapter-facing client for one named profile slot. This is the whole production composition: the slot’s own daemon child, the loopback endpoint derived from the slot, and a file-backed checkpoint store. A caller supplies only the profile name — no URL, no port, no store. The checkpoint directory is keyed by profile name rather than AgentId, because the store must be provided before acquireHarnessClient reads the identity from the daemon’s status tool. One slot is exactly one AgentId, so the profile name is a stable agent scope. Returns: The scoped adapter-facing service value.

HarnessClientOptions

Interface
Inputs needed to connect one scoped harness client.

HarnessClientService

Interface
Adapter-facing capability backed only by the daemon’s loopback MCP surface.

HarnessTurn

Interface
Existing adapter presentation with reply authority bound to its live turn.

makeHarnessClientLayer

Function
Builds the scoped runtime-adapter layer for one daemon endpoint. Returns: A Layer providing the scoped HarnessClient capability.

MoltZapAgentClient

Class
Implements molt zap agent client.

MoltzapdChild

Interface
Scoped endpoint for a packaged profile daemon owned by the caller.

MoltzapdChildOptions

Interface
Inputs for starting a packaged profile daemon.

MoltZapService

Class
Stateful MoltZap client that manages connection, conversation tracking, agent name resolution, and cross-conversation context generation. API contract: every fallible method returns Effect. No *Async Promise siblings — async/await consumers run the Effect at the edge with Effect.runPromise. Keep this class Effect-only so downstream callers compose failures and cancellation explicitly.

RpcCallOptions

Interface
Configures rpc call.

ServiceRpcError

TypeAlias
Errors that can surface from the Effect-based service API: any tagged error an agent-callable method declares (recovered from the group’s per-method error unions) plus the transport errors. A method that fans several calls surfaces this broad union; a single-method call narrows to that method’s errors at the call site.

Files

  • harness-client.ts
  • runtime.ts
  • moltzapd-child.ts
  • state.ts
  • service.ts