Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions docs/modules/client/src.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ active agent and holds only stable presentation checkpoints.

**Returns:** The scoped adapter-facing service value.

### [`acquireMoltzapdChild`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/moltzapd-child.ts#L209)

_Function_

```ts
export const acquireMoltzapdChild = (
options: MoltzapdChildOptions,
): Effect.Effect<MoltzapdChild, MoltzapdChildError, Scope.Scope>
```

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`](https://github.com/chughtapan/moltzap/blob/main/packages/protocol/dist/socket/agent-client.d.ts#L13)

_Interface_
Expand Down Expand Up @@ -101,6 +117,33 @@ export class HarnessClient extends Context.Tag("@moltzap/client/HarnessClient")<

Effect service tag consumed by runtime adapters.

### [`harnessClientForProfile`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/moltzapd-child.ts#L250)

_Function_

```ts
export const harnessClientForProfile = (
profileName: string,
): Effect.Effect<
HarnessClientService,
MoltzapdChildError | Error,
Scope.Scope
>
```

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`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/harness-client.ts#L64)

_Interface_
Expand Down Expand Up @@ -174,6 +217,31 @@ export declare class MoltZapAgentClient extends ProtocolClientLifecycle<AgentCal

Implements molt zap agent client.

### [`MoltzapdChild`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/moltzapd-child.ts#L39)

_Interface_

```ts
export interface MoltzapdChild {
readonly mcpUrl: string;
readonly logs: () => string;
}
```

Explicit endpoint for a packaged daemon owned by the enclosing test scope.

### [`MoltzapdChildOptions`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/moltzapd-child.ts#L45)

_Interface_

```ts
export interface MoltzapdChildOptions {
readonly profileName: string;
}
```

Inputs for starting the packaged daemon against caller-scoped test config.

### [`MoltZapService`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/service.ts#L233)

_Class_
Expand Down Expand Up @@ -340,5 +408,6 @@ to that method's errors at the `call` site.

- `harness-client.ts`
- `runtime.ts`
- `moltzapd-child.ts`
- `state.ts`
- `service.ts`
8 changes: 6 additions & 2 deletions packages/client/safer-architecture.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
"folderChildCountOverrides": [
{
"folder": ".",
"maxChildren": 25,
"maxChildrenIncludingTests": 27,
"maxChildren": 26,
"maxChildrenIncludingTests": 28,
"reason": "The client SDK keeps its peer public surfaces and their focused implementation modules flat at the source root; AGENTS.md documents the package structure"
}
],
"facadeFiles": [
{
"file": "harness-client.ts",
"reason": "Named adapter-facing boundary for the loopback daemon client, published as the ./harness-client subpath"
},
{
"file": "channel-core.ts",
"reason": "Named public boundary for channel-adapter dispatch, admission, and enrichment"
Expand Down
69 changes: 69 additions & 0 deletions packages/client/src/MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ active agent and holds only stable presentation checkpoints.

**Returns:** The scoped adapter-facing service value.

### [`acquireMoltzapdChild`](./moltzapd-child.ts#L209)

_Function_

```ts
export const acquireMoltzapdChild = (
options: MoltzapdChildOptions,
): Effect.Effect<MoltzapdChild, MoltzapdChildError, Scope.Scope>
```

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`](./../../protocol/dist/socket/agent-client.d.ts#L13)

_Interface_
Expand Down Expand Up @@ -96,6 +112,33 @@ export class HarnessClient extends Context.Tag("@moltzap/client/HarnessClient")<

Effect service tag consumed by runtime adapters.

### [`harnessClientForProfile`](./moltzapd-child.ts#L250)

_Function_

```ts
export const harnessClientForProfile = (
profileName: string,
): Effect.Effect<
HarnessClientService,
MoltzapdChildError | Error,
Scope.Scope
>
```

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`](./harness-client.ts#L64)

_Interface_
Expand Down Expand Up @@ -169,6 +212,31 @@ export declare class MoltZapAgentClient extends ProtocolClientLifecycle<AgentCal

Implements molt zap agent client.

### [`MoltzapdChild`](./moltzapd-child.ts#L39)

_Interface_

```ts
export interface MoltzapdChild {
readonly mcpUrl: string;
readonly logs: () => string;
}
```

Explicit endpoint for a packaged daemon owned by the enclosing test scope.

### [`MoltzapdChildOptions`](./moltzapd-child.ts#L45)

_Interface_

```ts
export interface MoltzapdChildOptions {
readonly profileName: string;
}
```

Inputs for starting the packaged daemon against caller-scoped test config.

### [`MoltZapService`](./service.ts#L233)

_Class_
Expand Down Expand Up @@ -335,5 +403,6 @@ to that method's errors at the `call` site.

- `harness-client.ts`
- `runtime.ts`
- `moltzapd-child.ts`
- `state.ts`
- `service.ts`
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { expect } from "vitest";
import type { ConversationId } from "@moltzap/protocol/conversation";
import type { Message } from "@moltzap/protocol/message";
import { withTestServiceConfig } from "../../../config.test-utils.js";
import { reserveTestMcpPort } from "../../../test-utils/process/packaged-moltzapd.js";
import { reserveTestMcpPort } from "../../../test-utils/process/reserve-port.js";
import {
acquireHarnessClient,
type HarnessClientService,
Expand Down
8 changes: 8 additions & 0 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ export {
type HarnessTurn,
type ConversationWithParticipants,
} from "./harness-client.js";

/** Re-exports the production composition of a slot's daemon and its client. */
export {
acquireMoltzapdChild,
harnessClientForProfile,
type MoltzapdChild,
type MoltzapdChildOptions,
} from "./moltzapd-child.js";
Loading
Loading