machine-link-protocol
Import
Section titled “Import”import * as api from "@fungi.computer/seam/machine-link-protocol";Exports
Section titled “Exports”| 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.
Extends
Section titled “Extends”YieldableError<this> &object&Readonly<{reason:"closed"|"busy"|"timed_out"|"send_failed";cause?:unknown; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MachineLinkPostUnavailable(args): MachineLinkPostUnavailable;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”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;}>.constructorProperties
Section titled “Properties”reason
Section titled “reason”readonly reason: "closed" | "busy" | "timed_out" | "send_failed";Transient transport failure; none of these asserts command refusal.
Inherited from
Section titled “Inherited from”Data.TaggedError("MachineLinkPostUnavailable").reason;cause?
Section titled “cause?”optional cause?: unknown;The native send failure, when the platform supplied one.
Inherited from
Section titled “Inherited from”Data.TaggedError("MachineLinkPostUnavailable").cause;AgentMailAddresstype alias
Section titled “AgentMailAddress”type AgentMailAddress = object;Post destination only; delegation keys and admission belong to their engine.
Properties
Section titled “Properties”scopeId
Section titled “scopeId”readonly scopeId: string;Owning Team or standalone scope, a nonempty identity of at most 256 characters.
agentId
Section titled “agentId”readonly agentId: string;Destination Agent, a nonempty identity of at most 256 characters.
MachineAgentCreateSessiontype alias
Section titled “MachineAgentCreateSession”type MachineAgentCreateSession = object;Idempotent Session creation requested through an authorized machine link.
Properties
Section titled “Properties”readonly type: "createSession";Finite operation discriminator.
requestId
Section titled “requestId”readonly requestId: string;Caller-owned creation intent, a nonempty identity of at most 256 characters.
MachineAgentSettlementtype alias
Section titled “MachineAgentSettlement”type MachineAgentSettlement = object;Read the destination owner’s outcome for one previously accepted command.
Properties
Section titled “Properties”readonly type: "settlement";Finite operation discriminator.
requesterAgentId
Section titled “requesterAgentId”readonly requesterAgentId: string;Requesting Agent; the receiver still checks its relationship to the command.
sessionId
Section titled “sessionId”readonly sessionId: string;Recipient Session identity, nonempty and at most 256 characters.
commandId
Section titled “commandId”readonly commandId: string;Original Accepted command identity, nonempty and at most 256 characters.
MachineAgentOperationtype alias
Section titled “MachineAgentOperation”type MachineAgentOperation = MachineAgentCreateSession | MachineAgentSettlement;Finite Agent operations, not an arbitrary HTTP/RPC tunnel.
MachineAgentRequesttype alias
Section titled “MachineAgentRequest”type MachineAgentRequest = object;An operation plus its host-derived caller, still subject to receiver admission.
Properties
Section titled “Properties”actorAgentId
Section titled “actorAgentId”readonly actorAgentId: string;Calling Agent identity; syntax alone never authenticates this field.
operation
Section titled “operation”readonly operation: MachineAgentOperation;The finite operation to admit at the destination.
MachineDirectoryAgenttype alias
Section titled “MachineDirectoryAgent”type MachineDirectoryAgent = object;One public Agent directory entry, without a private Local selector or path.
Properties
Section titled “Properties”agentId
Section titled “agentId”readonly agentId: string;Team Agent identity, nonempty and at most 256 characters.
readonly name: string;Display label of at most 256 characters.
MachineDirectorytype alias
Section titled “MachineDirectory”type MachineDirectory = object;Bounded directory representation sent by an enrolled machine.
Properties
Section titled “Properties”agents
Section titled “agents”readonly agents: readonly MachineDirectoryAgent[];At most 256 public Agent entries; the host checks their enrollment.
MachineLinkLeaveFrametype alias
Section titled “MachineLinkLeaveFrame”type MachineLinkLeaveFrame = object;Ask the owner to remove one enrolled Team Agent projection.
Properties
Section titled “Properties”readonly type: "leave";Finite control discriminator.
agentId
Section titled “agentId”readonly agentId: string;Team Agent identity, nonempty and at most 256 characters.
MachineLinkReadFrametype alias
Section titled “MachineLinkReadFrame”type MachineLinkReadFrame = object;Read one bounded transcript page through the Session owner’s ordinary cursor.
Properties
Section titled “Properties”readonly type: "read";Finite control discriminator.
requestId
Section titled “requestId”readonly requestId: string;Correlation identity, nonempty and at most 256 characters.
agentId
Section titled “agentId”readonly agentId: string;Team Agent identity, nonempty and at most 256 characters.
sessionId
Section titled “sessionId”readonly sessionId: string;Session identity, nonempty and at most 256 characters.
before?
Section titled “before?”readonly optional before?: string;Opaque older-page cursor from Session.read(), not a transport stream cursor.
readonly limit: number;Integer page bound from one through 64.
MachineLinkControlFrametype alias
Section titled “MachineLinkControlFrame”type MachineLinkControlFrame = MachineLinkLeaveFrame | MachineLinkReadFrame;Non-mail requests, not authenticated membership or admitted Session access.
agentMailAddressSchemaconstant
Section titled “agentMailAddressSchema”const agentMailAddressSchema: Schema.Codec<AgentMailAddress>;Maintained decoder for the shared Post address, not delegation authority.
machineAgentOperationSchemaconstant
Section titled “machineAgentOperationSchema”const machineAgentOperationSchema: Schema.Codec<MachineAgentOperation>;Decode operation grammar without granting access to an Agent or Session.
machineAgentRequestSchemaconstant
Section titled “machineAgentRequestSchema”const machineAgentRequestSchema: Schema.Codec<MachineAgentRequest>;Decode the request representation, not caller authority.
machineDirectorySchemaconstant
Section titled “machineDirectorySchema”const machineDirectorySchema: Schema.Codec<MachineDirectory>;Decode the bounded directory representation without admitting its entries.
createMachineLinkPostChannel()function
Section titled “createMachineLinkPostChannel()”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.
Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”| 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()”function machineLinkAudience(teamId, deviceId): string;Shared signature audience; neither names nor private Local selectors enter it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
teamId |
string |
deviceId |
string |
Returns
Section titled “Returns”string
machineLinkDialUrl()function
Section titled “machineLinkDialUrl()”function machineLinkDialUrl(issuer, teamId, deviceId): URL;The exact GET path signed by Local and verified by its receiving link.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
issuer |
string |
teamId |
string |
deviceId |
string |
Returns
Section titled “Returns”URL
decodeMachineLinkControlFrame()function
Section titled “decodeMachineLinkControlFrame()”function decodeMachineLinkControlFrame(text): MachineLinkControlFrame;Decode JSON only; the host still owns device, member and Agent admission.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |