> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moltzap.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# client/delivery

> One service's delivery, for the service to compose.

# client/delivery

*`packages/client/src/delivery`*

## Purpose

One service's delivery, for the service to compose.

## Public surface

### [`decodeHarnessMessageReadyEvent`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/operations.ts#L247)

*Function*

```ts theme={null}
export function decodeHarnessMessageReadyEvent(
  value: unknown,
): Effect.Effect<HarnessMessageReadyEvent, ParseResult.ParseError>
```

Decode one exact pending-delivery notification payload.

**Returns:** The validated pending delivery.

### [`decodeHarnessReadInboxResult`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/operations.ts#L156)

*Variable*

```ts theme={null}
export const decodeHarnessReadInboxResult =
  Schema.decodeUnknown(inboxResultSchema)
```

Decode a bounded inbox page received through the MCP transport.

### [`decodeHarnessSendErrorData`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/operations.ts#L258)

*Function*

```ts theme={null}
export function decodeHarnessSendErrorData(
  value: unknown,
): Effect.Effect<HarnessSendErrorData, ParseResult.ParseError>
```

Decode the error data of one refused `send_message` call.

**Returns:** The collective failure or send reason it carries.

### [`decodeHarnessSendResult`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/operations.ts#L280)

*Function*

```ts theme={null}
export function decodeHarnessSendResult(
  value: unknown,
): Effect.Effect<HarnessSendResult, ParseResult.ParseError>
```

Decode one `send_message` result, ignoring fields this release does not
name.

**Returns:** The operation id a gather names and the local firewall's guidance
on the admitted send, each if any.

### [`FirewallAuditRecord`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/firewall-values.ts#L170)

*TypeAlias*

```ts theme={null}
export type FirewallAuditRecord = typeof FirewallAuditRecord.Type;
```

Completion verifies the snapshot, not completion or delivery of each attempt.

### [`FirewallAuditRecord`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/firewall-values.ts#L131)

*Variable*

```ts theme={null}
export const FirewallAuditRecord = Schema.Union(
  exactStruct({
    kind: Schema.Literal("start"),
    format,
    snapshotId,
    startedAt: Schema.DateTimeUtc,
  }),
  exactStruct({
    kind: Schema.Literal("check"),
    checkId: Schema.NonEmptyString,
    direction: Schema.Literal("incoming", "outgoing"),
    revision: Schema.NonNegativeInt,
    disposition: Schema.Literal(
      "checking",
      "interrupted",
      "stale",
      "admitted",
      "withheld",
    ),
    post: Schema.NullOr(firewallAuditPost),
    candidate: Schema.Uint8ArrayFromBase64,
    input: firewallAuditInput,
    result: Schema.NullOr(firewallAuditResult),
  }),
  exactStruct({
    kind: Schema.Literal("activation"),
    ...firewallActivationSchema.fields,
  }),
  exactStruct({
    kind: Schema.Literal("complete"),
    format,
    snapshotId,
    checkCount: Schema.NonNegativeInt,
    activationCount: Schema.NonNegativeInt,
    sha256: digest,
  }),
).annotations({ identifier: "FirewallAuditRecord" })
```

One NDJSON record in an operator-only shutdown snapshot. A complete file has
one start, every retained check and activation, and one matching complete record.
Its digest covers the UTF-8 check and activation lines including trailing newlines.
Candidate bytes are opaque canonical Client data, encoded as base64. A null
result or checking/interrupted disposition never represents permission.
The nullable post reference identifies supported messages without decoding candidate bytes.

### [`HistoryExportRecord`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/history-export.ts#L50)

*TypeAlias*

```ts theme={null}
export type HistoryExportRecord = typeof HistoryExportRecord.Type;
```

A validated line of the daemon's history export.

### [`HistoryExportRecord`](https://github.com/chughtapan/moltzap/blob/main/packages/client/src/delivery/history-export.ts#L31)

*Variable*

```ts theme={null}
export const HistoryExportRecord = Schema.Union(
  exactStruct({
    kind: Schema.Literal("inbound"),
    item: InboundItem,
    at: Schema.DateTimeUtc,
  }),
  exactStruct({
    kind: Schema.Literal("outbound"),
    input: SendInput,
    outcome: historyExportSendOutcome,
    at: Schema.DateTimeUtc,
  }),
  exactStruct({
    kind: Schema.Literal("export-failed"),
    reason: Schema.String,
    at: Schema.DateTimeUtc,
  }),
).annotations({ identifier: "HistoryExportRecord" })
```

One line of the daemon's optional history export: an item as the daemon
published it, a completed `send` invocation with its input and outcome, or
the one line that says the export stopped. Readers decode the file line by
line with this schema rather than copying its shape.

## Files

* `firewall-values.ts`
* `history-export.ts`
* `operations.ts`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.