DialOptions
View as MarkdownDefined in: agent/src/transport/types.ts:98
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
cursor |
object |
http: highest outbox seq dispatched, kept for the process lifetime. Crash semantics: a command dispatched but not yet acknowledged when the agent process dies is delivered again to the next process and runs again (dedupe is per process). A command acknowledged whose result never reached the hub before the crash is lost: the website request times out (commandTimeoutMs). Within one process, results not accepted by the hub are re-sent after every welcome. |
agent/src/transport/types.ts:120 |
cursor.get |
() => number |
- | agent/src/transport/types.ts:120 |
cursor.set |
(seq) => void |
- | agent/src/transport/types.ts:120 |
fetch |
(input, init?) => Promise<Response> |
- | agent/src/transport/types.ts:124 |
hello |
Omit<Extract<AgentFrame, { t: "hello"; }>, "transport"> |
- | agent/src/transport/types.ts:107 |
hubUrl |
string |
- | agent/src/transport/types.ts:99 |
logger |
AgentLogger |
- | agent/src/transport/types.ts:125 |
siteId? |
string |
For log lines. | agent/src/transport/types.ts:127 |
timing |
AgentTiming |
- | agent/src/transport/types.ts:123 |
token |
string |
- | agent/src/transport/types.ts:106 |
url? |
string |
The transport URL the hub offered (/agent/info transports[].url), already checked to be on the site’s host with a safe scheme (offeredTransportUrl). Default: derived from hubUrl (<hubUrl>/agent, ws(s) for WebSocket). |
agent/src/transport/types.ts:105 |
Methods
Section titled “Methods”busy()
Section titled “busy()”busy(): boolean;Defined in: agent/src/transport/types.ts:122
A run in progress or a tool call pending (keeps the hub in fast polling).
Returns
Section titled “Returns”boolean
onFrame()
Section titled “onFrame()”onFrame(f): void;Defined in: agent/src/transport/types.ts:111
A hub frame after the welcome (never welcome, ping or upgrade_required).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
f |
| { machineId: string; minAgentVersion: string; protocol: number; t: "welcome"; } | { minAgentVersion: string; t: "upgrade_required"; } | { args: unknown; id: string; op: | "createSession" | "startRun" | "cancelRun" | "decide" | "updateSettings" | "addAttachment" | "snapshot" | "listSessions" | "readEvents"; t: "command"; } | { sequence: number; sessionId: string; t: "ack"; } | { id: string; ok: true; result: { content: ( | { text: string; type: "text"; } | { json: unknown; type: "json"; })[]; isError?: boolean; }; t: "tool_result"; } | { error: { code: | "auth_required" | "runtime_unavailable" | "unsupported_capability" | "invalid_workspace" | "session_busy" | "session_read_only" | "not_found" | "unauthorized" | "forbidden_origin" | "invalid_request" | "approval_expired" | "approval_already_resolved" | "event_replay_unavailable" | "runtime_disconnected" | "policy_denied" | "store_locked" | "attachment_too_large" | "attachment_type_unsupported" | "machine_offline" | "machine_not_found" | "upgrade_required" | "tool_failed" | "device_code_expired" | "rate_limited" | "internal_error"; details?: Record<string, unknown>; hint?: string; message: string; requestId?: string; retryable: boolean; }; id: string; ok: false; t: "tool_result"; } | { id: string; maxBytes: number; path: string; sessionId: string; t: "file_pull"; } | { id: string; mime: string; name: string; sessionId: string; size: number; t: "attachment_begin"; } | { data: string; id: string; seq: number; t: "attachment_chunk"; } | { id: string; t: "attachment_end"; } | { id: string; t: "attachment_abort"; } | { at: number; t: "ping"; } |
Returns
Section titled “Returns”void
onWelcome()
Section titled “onWelcome()”onWelcome(w): void;Defined in: agent/src/transport/types.ts:109
The hub accepted the link. ws: replies is empty (follow-up frames arrive through onFrame).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
w |
{ machineId: string; replies: ( | { machineId: string; minAgentVersion: string; protocol: number; t: "welcome"; } | { minAgentVersion: string; t: "upgrade_required"; } | { args: unknown; id: string; op: | "createSession" | "startRun" | "cancelRun" | "decide" | "updateSettings" | "addAttachment" | "snapshot" | "listSessions" | "readEvents"; t: "command"; } | { sequence: number; sessionId: string; t: "ack"; } | { id: string; ok: true; result: { content: ( | { text: string; type: "text"; } | { json: unknown; type: "json"; })[]; isError?: boolean; }; t: "tool_result"; } | { error: { code: | "auth_required" | "runtime_unavailable" | "unsupported_capability" | "invalid_workspace" | "session_busy" | "session_read_only" | "not_found" | "unauthorized" | "forbidden_origin" | "invalid_request" | "approval_expired" | "approval_already_resolved" | "event_replay_unavailable" | "runtime_disconnected" | "policy_denied" | "store_locked" | "attachment_too_large" | "attachment_type_unsupported" | "machine_offline" | "machine_not_found" | "upgrade_required" | "tool_failed" | "device_code_expired" | "rate_limited" | "internal_error"; details?: Record<string, unknown>; hint?: string; message: string; requestId?: string; retryable: boolean; }; id: string; ok: false; t: "tool_result"; } | { id: string; maxBytes: number; path: string; sessionId: string; t: "file_pull"; } | { id: string; mime: string; name: string; sessionId: string; size: number; t: "attachment_begin"; } | { data: string; id: string; seq: number; t: "attachment_chunk"; } | { id: string; t: "attachment_end"; } | { id: string; t: "attachment_abort"; } | { at: number; t: "ping"; })[]; } |
w.machineId |
string |
w.replies |
( | { machineId: string; minAgentVersion: string; protocol: number; t: "welcome"; } | { minAgentVersion: string; t: "upgrade_required"; } | { args: unknown; id: string; op: | "createSession" | "startRun" | "cancelRun" | "decide" | "updateSettings" | "addAttachment" | "snapshot" | "listSessions" | "readEvents"; t: "command"; } | { sequence: number; sessionId: string; t: "ack"; } | { id: string; ok: true; result: { content: ( | { text: string; type: "text"; } | { json: unknown; type: "json"; })[]; isError?: boolean; }; t: "tool_result"; } | { error: { code: | "auth_required" | "runtime_unavailable" | "unsupported_capability" | "invalid_workspace" | "session_busy" | "session_read_only" | "not_found" | "unauthorized" | "forbidden_origin" | "invalid_request" | "approval_expired" | "approval_already_resolved" | "event_replay_unavailable" | "runtime_disconnected" | "policy_denied" | "store_locked" | "attachment_too_large" | "attachment_type_unsupported" | "machine_offline" | "machine_not_found" | "upgrade_required" | "tool_failed" | "device_code_expired" | "rate_limited" | "internal_error"; details?: Record<string, unknown>; hint?: string; message: string; requestId?: string; retryable: boolean; }; id: string; ok: false; t: "tool_result"; } | { id: string; maxBytes: number; path: string; sessionId: string; t: "file_pull"; } | { id: string; mime: string; name: string; sessionId: string; size: number; t: "attachment_begin"; } | { data: string; id: string; seq: number; t: "attachment_chunk"; } | { id: string; t: "attachment_end"; } | { id: string; t: "attachment_abort"; } | { at: number; t: "ping"; })[] |
Returns
Section titled “Returns”void