Skip to content
API reference

machine-link-protocol

Import
import * as api from "@fungi.computer/seam/machine-link-protocol";
Kind Export Description
class MachineLinkPostUnavailable No receiver receipt was obtained. Carrier, not Seam, retains retries.
type alias AgentMailAddress Post destination only; delegation keys and admission belong to their engine.
type alias MachineAgentCreateSession Idempotent Session creation requested through an authorized machine link.
type alias MachineAgentSettlement Read the destination owner’s outcome for one previously accepted command.
type alias MachineAgentOperation Finite Agent operations, not an arbitrary HTTP/RPC tunnel.
type alias MachineAgentRequest An operation plus its host-derived caller, still subject to receiver admission.
type alias MachineDirectoryAgent One public Agent directory entry, without a private Local selector or path.
type alias MachineDirectory Bounded directory representation sent by an enrolled machine.
type alias MachineLinkLeaveFrame Ask the owner to remove one enrolled Team Agent projection.
type alias MachineLinkReadFrame Read one bounded transcript page through the Session owner’s ordinary cursor.
type alias MachineLinkControlFrame Non-mail requests, not authenticated membership or admitted Session access.
constant agentMailAddressSchema Maintained decoder for the shared Post address, not delegation authority.
constant machineAgentOperationSchema Decode operation grammar without granting access to an Agent or Session.
constant machineAgentRequestSchema Decode the request representation, not caller authority.
constant machineDirectorySchema Decode the bounded directory representation without admitting its entries.
function createMachineLinkPostChannel() One connection’s bounded Post I/O, without an outbox, dedupe store or RPC capability table. Native socket ownership and authentication stay with the host. Reconstruct after hibernation when idle; close on disconnect/restart and let the existing Carrier outbox retry the same frozen envelope.
function machineLinkAudience() Shared signature audience; neither names nor private Local selectors enter it.
function machineLinkDialUrl() The exact GET path signed by Local and verified by its receiving link.
function decodeMachineLinkControlFrame() Decode JSON only; the host still owns device, member and Agent admission.

MachineLinkPostUnavailableclass

Section titled “MachineLinkPostUnavailable”

No receiver receipt was obtained. Carrier, not Seam, retains retries.

  • YieldableError<this> & object & Readonly<{ reason: "closed" | "busy" | "timed_out" | "send_failed"; cause?: unknown; }>
Signature
new MachineLinkPostUnavailable(args): MachineLinkPostUnavailable;
Parameter Type Description
args { reason: "closed" | "busy" | "timed_out" | "send_failed"; cause?: unknown; } -
args.reason "closed" | "busy" | "timed_out" | "send_failed" Transient transport failure; none of these asserts command refusal.
args.cause? unknown The native send failure, when the platform supplied one.

MachineLinkPostUnavailable

Signature
Data.TaggedError(
"MachineLinkPostUnavailable",
)<{
/ Transient transport failure; none of these asserts command refusal. /
readonly reason: "closed" | "busy" | "timed_out" | "send_failed";
/ The native send failure, when the platform supplied one. /
readonly cause?: unknown;
}>.constructor
Signature
readonly reason: "closed" | "busy" | "timed_out" | "send_failed";

Transient transport failure; none of these asserts command refusal.

Signature
Data.TaggedError("MachineLinkPostUnavailable").reason;
Signature
optional cause?: unknown;

The native send failure, when the platform supplied one.

Signature
Data.TaggedError("MachineLinkPostUnavailable").cause;

AgentMailAddresstype alias

Section titled “AgentMailAddress”
Signature
type AgentMailAddress = object;

Post destination only; delegation keys and admission belong to their engine.

Signature
readonly scopeId: string;

Owning Team or standalone scope, a nonempty identity of at most 256 characters.

Signature
readonly agentId: string;

Destination Agent, a nonempty identity of at most 256 characters.


MachineAgentCreateSessiontype alias

Section titled “MachineAgentCreateSession”
Signature
type MachineAgentCreateSession = object;

Idempotent Session creation requested through an authorized machine link.

Signature
readonly type: "createSession";

Finite operation discriminator.

Signature
readonly requestId: string;

Caller-owned creation intent, a nonempty identity of at most 256 characters.


MachineAgentSettlementtype alias

Section titled “MachineAgentSettlement”
Signature
type MachineAgentSettlement = object;

Read the destination owner’s outcome for one previously accepted command.

Signature
readonly type: "settlement";

Finite operation discriminator.

Signature
readonly requesterAgentId: string;

Requesting Agent; the receiver still checks its relationship to the command.

Signature
readonly sessionId: string;

Recipient Session identity, nonempty and at most 256 characters.

Signature
readonly commandId: string;

Original Accepted command identity, nonempty and at most 256 characters.


MachineAgentOperationtype alias

Section titled “MachineAgentOperation”
Signature
type MachineAgentOperation = MachineAgentCreateSession | MachineAgentSettlement;

Finite Agent operations, not an arbitrary HTTP/RPC tunnel.


MachineAgentRequesttype alias

Section titled “MachineAgentRequest”
Signature
type MachineAgentRequest = object;

An operation plus its host-derived caller, still subject to receiver admission.

Signature
readonly actorAgentId: string;

Calling Agent identity; syntax alone never authenticates this field.

Signature
readonly operation: MachineAgentOperation;

The finite operation to admit at the destination.


MachineDirectoryAgenttype alias

Section titled “MachineDirectoryAgent”
Signature
type MachineDirectoryAgent = object;

One public Agent directory entry, without a private Local selector or path.

Signature
readonly agentId: string;

Team Agent identity, nonempty and at most 256 characters.

Signature
readonly name: string;

Display label of at most 256 characters.


MachineDirectorytype alias

Section titled “MachineDirectory”
Signature
type MachineDirectory = object;

Bounded directory representation sent by an enrolled machine.

Signature
readonly agents: readonly MachineDirectoryAgent[];

At most 256 public Agent entries; the host checks their enrollment.


MachineLinkLeaveFrametype alias

Section titled “MachineLinkLeaveFrame”
Signature
type MachineLinkLeaveFrame = object;

Ask the owner to remove one enrolled Team Agent projection.

Signature
readonly type: "leave";

Finite control discriminator.

Signature
readonly agentId: string;

Team Agent identity, nonempty and at most 256 characters.


MachineLinkReadFrametype alias

Section titled “MachineLinkReadFrame”
Signature
type MachineLinkReadFrame = object;

Read one bounded transcript page through the Session owner’s ordinary cursor.

Signature
readonly type: "read";

Finite control discriminator.

Signature
readonly requestId: string;

Correlation identity, nonempty and at most 256 characters.

Signature
readonly agentId: string;

Team Agent identity, nonempty and at most 256 characters.

Signature
readonly sessionId: string;

Session identity, nonempty and at most 256 characters.

Signature
readonly optional before?: string;

Opaque older-page cursor from Session.read(), not a transport stream cursor.

Signature
readonly limit: number;

Integer page bound from one through 64.


MachineLinkControlFrametype alias

Section titled “MachineLinkControlFrame”
Signature
type MachineLinkControlFrame = MachineLinkLeaveFrame | MachineLinkReadFrame;

Non-mail requests, not authenticated membership or admitted Session access.

agentMailAddressSchemaconstant

Section titled “agentMailAddressSchema”
Signature
const agentMailAddressSchema: Schema.Codec<AgentMailAddress>;

Maintained decoder for the shared Post address, not delegation authority.


machineAgentOperationSchemaconstant

Section titled “machineAgentOperationSchema”
Signature
const machineAgentOperationSchema: Schema.Codec<MachineAgentOperation>;

Decode operation grammar without granting access to an Agent or Session.


machineAgentRequestSchemaconstant

Section titled “machineAgentRequestSchema”
Signature
const machineAgentRequestSchema: Schema.Codec<MachineAgentRequest>;

Decode the request representation, not caller authority.


machineDirectorySchemaconstant

Section titled “machineDirectorySchema”
Signature
const machineDirectorySchema: Schema.Codec<MachineDirectory>;

Decode the bounded directory representation without admitting its entries.

createMachineLinkPostChannel()function

Section titled “createMachineLinkPostChannel()”
Signature
function createMachineLinkPostChannel(options): object;

One connection’s bounded Post I/O, without an outbox, dedupe store or RPC capability table. Native socket ownership and authentication stay with the host. Reconstruct after hibernation when idle; close on disconnect/restart and let the existing Carrier outbox retry the same frozen envelope.

Receipt payloads remain opaque. The Agent mail route still requires a real Shiitake Accepted receipt; a generic Post acknowledgment is not one.

Parameter Type
options { send: (frame) => void | Promise<void>; receive: (envelope) => Promise<PostDeliveryResult>; limits: { maxInFlight: number; maxFrameBytes: number; acknowledgmentMs: number; }; }
options.send (frame) => void | Promise<void>
options.receive (envelope) => Promise<PostDeliveryResult>
options.limits { maxInFlight: number; maxFrameBytes: number; acknowledgmentMs: number; }
options.limits.maxInFlight number
options.limits.maxFrameBytes number
options.limits.acknowledgmentMs number
Name Type Description
deliver() (envelope) => Promise<PostDeliveryResult> Send now; never acknowledge custody before the receiver replies.
receive() (text) => Promise<void> Called only for a host-authenticated, current native socket.
close() () => void Forget only pending I/O. The durable sender still owns undelivered work.

machineLinkAudience()function

Section titled “machineLinkAudience()”
Signature
function machineLinkAudience(teamId, deviceId): string;

Shared signature audience; neither names nor private Local selectors enter it.

Parameter Type
teamId string
deviceId string

string


machineLinkDialUrl()function

Section titled “machineLinkDialUrl()”
Signature
function machineLinkDialUrl(issuer, teamId, deviceId): URL;

The exact GET path signed by Local and verified by its receiving link.

Parameter Type
issuer string
teamId string
deviceId string

URL


decodeMachineLinkControlFrame()function

Section titled “decodeMachineLinkControlFrame()”
Signature
function decodeMachineLinkControlFrame(text): MachineLinkControlFrame;

Decode JSON only; the host still owns device, member and Agent admission.

Parameter Type
text string

MachineLinkControlFrame