Skip to main content

client/src

packages/client/src

Purpose

Public barrel for the final endpoint runtime capability.

Public surface

acquireHarnessEndpoint

Function
Acquire one real MCP-backed endpoint and its scoped connection. Returns: An endpoint whose resources remain live for the caller’s scope.

AgentAddress (type)

TypeAlias
A validated direct destination.

AgentAddress (value)

Variable
An explicit direct destination using one canonical Registry name.

CheckedGuidance

TypeAlias
The guidance of one checked text: a message, a request, an answer, a question or a send.

CollectiveError

Class
A gather, all_gather or answer was refused. The message is what a host hands its model as the tool error: the failed action and its cause, naming each unreachable member or failing field. The operation id stays in the error’s data, not its message.

ConnectError

Class
Acquiring the endpoint connection failed.

Content (type)

TypeAlias
Validated nonempty semantic content.

Content (value)

Variable
Nonempty semantic content whose canonical JSON is at most 32,768 bytes.

ContentPart (type)

TypeAlias
A validated semantic message part.

ContentPart (value)

Variable
One exact semantic part of a message.

decodeHarnessMessageReadyEvent

Function
Decode one exact pending-delivery notification payload. Returns: The validated pending delivery.

decodeHarnessReadInboxResult

Variable
Decode a bounded inbox page received through the MCP transport.

decodeHarnessSendErrorData

Function
Decode the error data of one refused send_message call. Returns: The collective failure or send reason it carries.

decodeHarnessSendResult

Function
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.

DeliveryAcknowledgeError

Class
Transport acknowledgment could not complete for one delivery.

DirectMessage

TypeAlias
One certified remote-authored direct message.

FirewallSendError

Class
A refusal is returned only before an application invocation creates any intent. Its opaque check reference survives hosts that retain only the error message.

GroupAddress (type)

TypeAlias
A validated canonical complete group destination.

GroupAddress (value)

Variable
A complete fixed-member group address in unsigned ASCII name order.

groupMembers

Function
The agents a group address names, as agent: addresses, in its order; a direct address names none. Hosts list them on a group turn. Returns: The group’s member addresses, or an empty list.

GroupMessage

TypeAlias
One certified remote-authored fixed-group message.

HarnessEndpoint

Interface
Structural runtime capability owned by one scoped endpoint connection. Every send is one operation or one collective response; the stream yields inbound items. A host whose tool returns before the send completes passes failureDelivery: "inbound": a refused gather, all_gather or response then completes and its error arrives as an operationFailed item on the stream. A multicast has no operation id, so its failure is always returned. A firewall refusal always returns on the send call before creating an intent, including when inbound failure delivery was requested.

HistoryExportRecord (type)

TypeAlias
A validated line of the daemon’s history export.

HistoryExportRecord (value)

Variable
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.

InboundDelivery

Interface
One inbound item plus its transport-only acknowledgment.

InboundItem (type)

TypeAlias
A validated inbound item.

InboundItem (value)

Variable
One inbound item, discriminated by kind. The endpoint consumes the collective layer’s protocol posts, posts whose collective part is malformed or duplicated, and multicasts that carry nothing besides that part; every other certified post becomes one item, and the endpoint itself emits results and failures.

InboundMessage (type)

TypeAlias
A validated direct or group post.

InboundMessage (value)

Variable
One certified remote-authored post, direct or to a fixed group.

JsonValue (type)

TypeAlias
A value accepted by the closed semantic content boundary.

JsonValue (value)

Variable
Runtime validation for the closed recursive JSON value.

legacyKeys

Function
Returns retired key names, including empty settings, without exposing values.

ListenError

Class
The endpoint’s sole inbound subscription failed.

LocalGuidance

TypeAlias
Local advice accompanies the envelope and never changes a certified item.

MessageAddressInput (type)

TypeAlias
A validated explicit destination input.

MessageAddressInput (value)

Variable
Either accepted destination input, including noncanonical group order.

MessageTextError

Class
A message text states an operation it does not validly carry, or is plain text that is not well-formed Unicode. The message names each failing field so a host can hand it to its model as the tool error.

parseMessageText

Function
Read one message text as the send it states. Returns: The send input, or an error naming each field a stated operation gets wrong.

PostId (type)

TypeAlias
A validated author-scoped post identity.

PostId (value)

Variable
Opaque identity minted for one addressed-send invocation.

renderCollectiveRequest

Function
A question another agent asked: who asked and until when, the question, its form, and the exact text that answers it. Only the last line differs by host, since each host’s model sends the answer through its own tool. Returns: The text of the model’s turn.

renderCollectiveResult

Function
A gather’s or all_gather’s result: the question and one line per member. The question is quoted as JSON, so a question a peer asked cannot add lines that read as other members’ outcomes. Returns: The text of the model’s turn.

renderContent

Function
A message’s content as the text a model reads: each text part as written, each data part as JSON, one part per line. Returns: The text a host puts in the model’s turn.

SendError

Class
An addressed send failed before local certification completed. detail names the specific cause when the failing step knows it, such as which agent is unknown; the message is what a host hands its model. Validation issues expose only field paths and schema expectations.

SendInput (type)

TypeAlias
Validated input for one send.

SendInput (value)

Variable
One send to one address: text with its collective operation, multicast when collective is omitted, or an answer to the request open in that address’s conversation. parseMessageText reads both from a message’s text.

SendResult

Interface
What a completed send returns: a collecting operation names its id, and guidance carries the local firewall’s advice on the admitted send, such as a norm judgment the decision provider left unsettled.

Package subpaths

@moltzap/client/service

Daemon

Namespace

Daemon.StartupError

Class
Closed startup phase with sanitized configuration details.

Daemon.FirewallOptions

TypeAlias
Trusted process composition fixes code and evidence while owner tools edit English rules.

Daemon.help

Variable
Usage text listing the daemon process’s environment variables.

Daemon.layer

Variable
Complete production process composition for sharnessd, with the firewall SHARNESS_MESSAGE_POLICY_FILE describes when it is set.

Daemon.withFirewall

Function
Fixed middleware and persisted English rules are installed before the daemon accepts host calls. The environment must not also name a message-policy document. Returns: The complete daemon layer with both message boundaries checked.

CheckInputError

Class
Invalid construction or evidence is a typed failure, never permission.

DecisionProviderError

Class
The adapter scrubs credentials before retaining optional private diagnostics.

FirewallPolicyError

Class
A failed edit never replaces the active installation or retained editable document.

MiddlewareError

Class
Operational failures carry closed reasons, never arbitrary exception text.

DecisionProvider

Interface
Entirely code-based chains have no dependency on this optional capability.

DecisionRequest

Interface
Provider input contains explicit questions and state, never execution authority.

DecisionResponse

Interface
Raw distributions and provider confidence survive routing unchanged.

EnglishPolicySettings

Interface
Bytes bound allocation, not tokenizer capacity; probability is a routing setting.

EnglishRule

Interface
Text is interpreted by the provider; it is never compiled into executable code.

Firewall

Interface
Checking returns data; Client separately owns fresh, atomic send/delivery admission.

FirewallSettings

Interface
Sequential execution is bounded per entry and across the whole attempt.

Message

Interface
Attribution is supplied by Client, never inferred from names in the body. operation is absent for a plain message.

MessageContext

Interface
Trusted composition supplies authorized earlier evidence and candidate-specific approval. Agent identity and principal identity have different meanings. The first live composition supplies absent approval.

MessageMiddleware

Interface
Code and English policies have the same contract. Registered code is trusted; it receives no messaging/store capability and must not retain conversation state or perform messaging side effects.

MiddlewareInput

Interface
Each invocation gets immutable evidence and previously validated observations.

MiddlewareResult

Interface
A result is atomic: interrupted middleware has no returned partial findings.

RuleDescription

Interface
Runtime advice can only select templates registered by trusted composition.

FirewallAuditRecord (type)

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

MessagePolicy (type)

TypeAlias
One decoded message-policy document, with Client’s defaults filled in.

decodeMessagePolicy

Variable
Decodes the text of a message-policy document, refusing any property it does not name, so a misspelled or newer setting never silently weakens the policy.

FirewallAuditRecord (value)

Variable
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.

makeEnglishPolicy

Variable
Freezes English documents and provider settings for repeated checks in either direction. Question semantics and documents determine the recorded revision. fixedRuleIds names the rules composition fixed against owner edits; it is recorded in the provenance only, so a retained check keeps which of its rules were fixed, and never changes checking.

makeFirewall

Variable
Runs every installed check in order within the budget. Refusals accumulate; only Client can apply the result to an exact candidate with fresh evidence. Cancellation propagates, so an interrupted check never returns permission.

MessagePolicy (value)

Variable
The message policy of one daemon: its firewall mode, the built-in code middleware of each direction in chain order, its fixed and initial editable English rules, the decision provider those rules and the collective norms need, and the check bounds. Absent settings take Client’s defaults. English rules or the collective norms without a decision provider, the collective norms with the unavailable provider, which would leave every one of their English checks unavailable, and an English rule id given twice across the fixed and initial rules are refused.

messagePolicyFirewall

Variable
The firewall installation of one message-policy document: its built-in middleware in chain order, its English rules assessed by provider, and its settings. This is the trusted-composition hook: a composition that brings its own decision provider installs the result with Daemon.withFirewall. codeDigest is the SHA-256 of the Client release, the mode, each registration’s id and revision, the fixed English rules, the decision provider and the settings. It leaves out what differs between the agents of one arm: the facilitator role, which no revision holds, the allowed-sender list and the initial editable rules, so every member records the same digest.

makeJevDecisionProvider

Function
Uses the fixed TypeSafe origin and an explicitly pinned model. No retry, environment lookup or credential serialization occurs here. The evaluator owns timeouts; the Effect is interruptible through response-body consumption.

Files

  • delivery/admission.ts
  • delivery/firewall-audit-file.ts
  • delivery/firewall-audit.ts
  • delivery/firewall-checks.ts
  • delivery/firewall-results.ts
  • delivery/firewall-values.ts
  • delivery/firewall.ts
  • delivery/history-export.ts
  • delivery/host-delivery.ts
  • delivery/inbox.ts
  • delivery/index.ts
  • delivery/operations.ts
  • delivery/pass.ts
  • delivery/policy.ts
  • delivery/README.md
  • endpoint/environment.ts
  • endpoint/harness-endpoint/capability.ts
  • endpoint/harness-endpoint/events.ts
  • endpoint/harness-endpoint/index.ts
  • endpoint/implementation.ts
  • endpoint/mcp/auth.ts
  • endpoint/mcp/event-schemas.ts
  • endpoint/mcp/event-signing.ts
  • endpoint/mcp/events.ts
  • endpoint/mcp/http.ts
  • endpoint/mcp/index.ts
  • endpoint/mcp/names.ts
  • endpoint/mcp/owner-tools.ts
  • endpoint/mcp/README.md
  • endpoint/mcp/schemas.ts
  • endpoint/mcp/tools.ts
  • endpoint/mcp/webhook.ts
  • firewall/chain.ts
  • firewall/decision.ts
  • firewall/english.ts
  • firewall/index.ts
  • firewall/jev.ts
  • firewall/questions.ts
  • firewall/README.md
  • firewall/runtime.ts
  • firewall/values.ts
  • identity/credentials.ts
  • identity/index.ts
  • index.ts
  • launcher/configuration.ts
  • launcher/errors.ts
  • launcher/index.ts
  • launcher/installation.ts
  • launcher/integrity.ts
  • launcher/packed-manifest.ts
  • launcher/prepare.ts
  • launcher/provenance.ts
  • launcher/README.md
  • launcher/registry.ts
  • launcher/selection.ts
  • README.md
  • service/bootstrap.ts
  • service/configuration.ts
  • service/daemon/index.ts
  • service/daemon/protocol.ts
  • service/daemon/README.md
  • service/errors.ts
  • service/index.ts
  • service/lifecycle.ts
  • service/management.ts
  • service/message-policy/builtin.ts
  • service/message-policy/collective-norms.ts
  • service/message-policy/compose.ts
  • service/message-policy/index.ts
  • service/message-policy/load.ts
  • service/message-policy/outcome.ts
  • service/message-policy/policy.ts
  • service/message-policy/README.md
  • service/README.md
  • service/registration/binding.ts
  • service/registration/index.ts
  • service/registration/README.md
  • store/anchors.ts
  • store/database/index.ts
  • store/database/migrations.ts
  • store/database/schema.ts
  • store/database/values.ts
  • store/firewall.ts
  • store/inbox.ts
  • store/index.ts
  • store/queues/deliveries.ts
  • store/queues/dissemination.ts
  • store/queues/index.ts
  • store/queues/outbound.ts
  • store/queues/README.md
  • store/README.md
  • store/reads.ts
  • store/records.ts
  • store/rows/index.ts
  • store/runtime-codec.ts
  • store/store.ts
  • store/types.ts
  • transport/collectives/answer-formats.ts
  • transport/collectives/failures.ts
  • transport/collectives/forms.ts
  • transport/collectives/inbound.ts
  • transport/collectives/index.ts
  • transport/collectives/message-text.ts
  • transport/collectives/operation.ts
  • transport/collectives/part/grammar.ts
  • transport/collectives/part/index.ts
  • transport/collectives/ports.ts
  • transport/collectives/README.md
  • transport/collectives/received-request.ts
  • transport/collectives/render.ts
  • transport/collectives/request-sends.ts
  • transport/collectives/shared-answers.ts
  • transport/collectives/validation.ts
  • transport/messaging/address.ts
  • transport/messaging/certification/dissemination.ts
  • transport/messaging/certification/index.ts
  • transport/messaging/certification/README.md
  • transport/messaging/errors.ts
  • transport/messaging/history/build.ts
  • transport/messaging/history/certificate.ts
  • transport/messaging/history/index.ts
  • transport/messaging/history/README.md
  • transport/messaging/history/stored.ts
  • transport/messaging/index.ts
  • transport/messaging/message.ts
  • transport/messaging/outbox.ts
  • transport/messaging/README.md
  • transport/messaging/reanchor/empty.ts
  • transport/messaging/reanchor/index.ts
  • transport/messaging/reanchor/votes.ts
  • transport/messaging/recovery/barrier.ts
  • transport/messaging/recovery/catch-up.ts
  • transport/messaging/recovery/index.ts
  • transport/messaging/recovery/README.md
  • transport/messaging/recovery/successor.ts
  • transport/messaging/retry-markers.ts
  • transport/messaging/runtime/index.ts
  • transport/messaging/send.ts
  • transport/messaging/startup.ts
  • transport/router/index.ts
  • transport/router/outage.ts
  • transport/router/types.ts
  • transport/wire/encoding/canonical.ts
  • transport/wire/encoding/codec.ts
  • transport/wire/encoding/index.ts
  • transport/wire/index.ts
  • transport/wire/README.md
  • transport/wire/schemas.ts
  • transport/wire/values.ts
  • transport/wire/verification.ts