@maiaos/sdk 0.1.0-canary.44938d4.manual.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,291 @@
1
+ # `@maiaos/sdk`
2
+
3
+ > **Publication status:** Source-implemented candidate, canary-only. npm
4
+ > canaries use the
5
+ > `canary` dist-tag for installation evidence and remain
6
+ > `releaseQualified: false`. No stable version or `latest` dist-tag is
7
+ > released.
8
+
9
+ Transport-neutral client primitives for the Maia protocol.
10
+
11
+ `@maiaos/sdk` is the only supported node-facing product-client boundary for Maia
12
+ Desktop, web, mobile/tablet, and `@maiaos/cli`:
13
+
14
+ ```text
15
+ product client ──► @maiaos/sdk ── runtime transport ──► maia-node
16
+ ╲ ╱
17
+ ╲══ package dependencies ═══╱
18
+ ▼
19
+ @maiaos/protocol
20
+ ```
21
+
22
+ Clients own presentation and select a connection profile. SDK transports own
23
+ local IPC or remote HTTP/WSS mechanics; clients must not open a parallel node
24
+ transport, access node storage, or supervise runtimes directly.
25
+
26
+ The SDK is also the mandatory middle layer for every planned Build,
27
+ Teammates, Rooms, Routines, Skill Studio, Activity, and Advanced Runtime
28
+ Extensions vertical slice. A node handler or CLI parser without the matching
29
+ bounded protocol and transport-neutral SDK operation is not a complete
30
+ headless feature. This includes planned recommendation/install/sync operations
31
+ for the exact-version `maia-cli` and `maia-orchestration` Skill bundles.
32
+
33
+ The package validates generic request and response envelopes, correlates
34
+ responses, preserves structured protocol errors, and forwards standard
35
+ `AbortSignal` cancellation. Its main export remains transport- and
36
+ platform-neutral. Protocol validation is implemented by Effect Schema behind
37
+ the Maia-owned facade; custom request/output validators still need only a
38
+ synchronous `parse(unknown)` method and do not expose Effect types.
39
+
40
+ The typed local-node client currently exposes status/shutdown, project
41
+ register/list/show, workspace list/show, explicit repository attachment, and
42
+ durable receipt lookup through keyed `getReceipt` and bounded no-payload
43
+ `listReceipts` (`receipt.list`). The CLI may project a compact page; this
44
+ client stays lossless over the list schema, which already omits `result`.
45
+ It also exposes `probeRuntime`, which uses the same authenticated transport to
46
+ request either the node-owned Codex compatibility probe or the release-disabled
47
+ Pi RPC source candidate. A Pi result is explicitly request-scoped and
48
+ no-model, lists only `set_auto_retry`, `set_auto_compaction`, and `get_state`,
49
+ and remains `releaseQualified: false`; the SDK does not infer installation or
50
+ provider availability from the request.
51
+ `listInstalledHarnesses` is the transport-neutral client for the candidate
52
+ `harness.installed.list` ordinary read: exact empty parameters and the closed
53
+ schema-v1 four-item catalog (`codex`, `grok`, `mistral-vibe`, `pi`) with
54
+ `selected` and `authorized` fixed to `false`. The CLI may project a smaller
55
+ agent-efficient view; this method keeps the full protocol result. It does not
56
+ launch, select, authorize, or probe a harness, and it is not release-qualified
57
+ product behavior.
58
+
59
+ The W0a neutral execution-selection candidate is exposed losslessly through
60
+ `readExecutionCatalog`, `showWorkspaceExecution`, and
61
+ `configureWorkspaceExecution`. The first two are ordinary reads; configure is
62
+ one revision-fenced, stable-command-ID mutation used by the CLI's separate
63
+ `workspace execution set` and `workspace execution clear` grammar. The SDK
64
+ does not choose or call a provider, launch a process, create an execution
65
+ instance, or turn the fixed `local_provider_unbound` resolution into
66
+ availability. All three operations remain release-disabled source candidates.
67
+
68
+ The typed local-node client now also exposes `planCodexIntegration`,
69
+ `applyCodexIntegration`, `statusCodexIntegration`, and
70
+ `removeCodexIntegration`. They losslessly validate the strict
71
+ `maia.integration-authorization/v1` results and accept no caller-selected
72
+ executable identity or policy fields. Apply and remove preserve stable command
73
+ IDs and mutation recovery through the Node transport. The SDK grants no process
74
+ authority and performs no filesystem inspection or cleanup itself. The exact
75
+ SDK/authenticated-IPC path is source-qualified at revision
76
+ `80631fb5c9adeb38ab58b12a7db80647161d5871`; all four operations remain
77
+ release-disabled candidates and do not enable a Codex consumer.
78
+
79
+ The client also implements the lossless release-disabled
80
+ `planPiRpcIntegration`, `applyPiRpcIntegration`, `statusPiRpcIntegration`, and
81
+ `removePiRpcIntegration` source-candidate methods. Their separate schema-v14
82
+ Pi authorization carries exact Node 24.19.0/Pi 0.84.2 interpreter, entry,
83
+ package-closure, session-format, owner-set, and conversation-policy identity
84
+ while accepting no caller path, native file, tool, workspace path, credential,
85
+ or provider field. These transport methods do not grant authority, start a
86
+ runtime, or establish execution-provider availability.
87
+
88
+ The durable session ledger foundation is source-callable through
89
+ `createSession`, `listSessions`, `showSession`, and `listSessionEvents`.
90
+ `startSession` persists asynchronous activation intent. Runtime `pi` with
91
+ profile `pi-rpc` routes through the active conversation authorization and exact
92
+ native Session binding; Codex still requires its private source authority.
93
+ `sendTurn`, `showTurn`, and `interruptTurn` use the same runtime-discriminated
94
+ family. Pi send/interrupt require active authorization, while durable Pi
95
+ history remains readable after authorization loss. Callers can observe running,
96
+ recovering, failed, interrupted, or completed state through bounded unary
97
+ queries and event cursors. Live attachment remains a later streaming contract.
98
+ These methods grant no tools, credentials/provider, workspace mutation, or
99
+ release enablement.
100
+
101
+ `status` carries the node-owned compact process-resource health projection
102
+ without giving the SDK process authority. Clients can distinguish healthy,
103
+ admission warning/saturation, and cleanup-unknown fencing; inspect exact
104
+ active/tracked/watcher and permit counts; and render the bounded next-step
105
+ code. The same typed result carries bounded latest-target CPU, RSS/peak RSS,
106
+ process, FD, and I/O availability plus advisory declared-budget warnings. The
107
+ macOS variant remains explicitly cooperative, source-candidate-only,
108
+ not release-qualified, without hard CPU/memory/process enforcement or sampled-
109
+ pressure auto-termination.
110
+
111
+ The macOS live-terminal source candidate exposes exactly 13 methods: `createTerminal`,
112
+ `listTerminals`, `showTerminal`, `listTerminalEvents`, `readTerminal`,
113
+ controller request/show/acquire/release, `writeTerminalInput`,
114
+ `resizeTerminal`, `signalTerminal`, and `closeTerminal`. It accepts no caller
115
+ executable, argv, environment, or cwd and supervises no process in the SDK.
116
+ Observer attach/check/detach/resync, controller renew, restart, delete, and
117
+ mutation reconcile remain unavailable or inert. These browser-safe unary
118
+ methods are real-boundary proven but remain blocked, release-disabled source
119
+ candidates rather than release-qualified product behavior.
120
+
121
+ The source-implemented local-v1 orchestration candidate adds
122
+ `createOrchestrationRun`, `listOrchestrationRuns`, `showOrchestrationRun`,
123
+ `listOrchestrationTasks`, `showOrchestrationTask`,
124
+ `showOrchestrationDispatch`,
125
+ `checkOrchestrationInbox`, `acknowledgeOrchestrationDelivery`,
126
+ `openOrchestrationQuestion`, `replyOrchestrationQuestion`,
127
+ `cancelOrchestrationQuestion`, and `settleOrchestrationDispatchTerminal`.
128
+ These are bounded unary methods over the same authenticated transport; the SDK
129
+ supplies no planner, mailbox queue, worker, resident waiter, lifecycle actor,
130
+ database access, process supervision, or caller-selected Message sender. The
131
+ node remains the durable authority and all twelve methods remain
132
+ blocked, release-disabled candidate behavior. `listOrchestrationRuns` is a
133
+ workspace-scoped page of compact Run records. `listOrchestrationTasks` is a
134
+ Run-scoped, objective-free Task index. `showOrchestrationTask` is the keyed
135
+ read of one full Task, including its objective. `showOrchestrationDispatch`
136
+ is the keyed read of the one Run-scoped Dispatch record; it is not a worker
137
+ or preamble projection. The CLI may project a compact aggregate for
138
+ `createOrchestrationRun`, `showOrchestrationRun`, Question mutations, and
139
+ `settleOrchestrationDispatchTerminal`; these SDK methods stay lossless.
140
+
141
+ The source-implemented `showCurrentContext` query is the single
142
+ transport-neutral SDK operation behind `maia context show --json`. It submits
143
+ exact empty parameters over the authenticated local connection and losslessly
144
+ validates a Client-only projection with `attachmentUsed: false`. IC0 Client
145
+ results omit `nodeId` until ADR-014 NodeBootstrap allocates an authoritative
146
+ value; the SDK remains lossless over that optional-field schema. It never
147
+ accepts a caller-selected principal or Session ID as proof. Inbox
148
+ `--scope current` waits for a mailbox-owning principal. The
149
+ result is a bounded, redacted projection, not a credential or cached
150
+ authorization decision. Session/Run/Dispatch attachments, remote adapters, and
151
+ descendant inheritance remain out of this slice. The method is a blocked,
152
+ release-disabled candidate.
153
+
154
+ The source also exposes `sendTurn`, `showTurn`, and `interruptTurn` for the
155
+ schema-v6 turn candidate. Those methods are source-implemented SDK candidates,
156
+ not release-qualified or enabled product behavior. `interruptTurn` is a
157
+ runtime-discriminated release-disabled client candidate: the ordinary
158
+ node/SDK/CLI path is callable for an exact active Pi conversation
159
+ authorization, while Codex remains limited to its internal test authority. H2
160
+ and the current G2 record are source-qualified only for revision
161
+ `e7f784b4aa567d19311235d729b047f96c9dfc7c` and its exact bound artifact;
162
+ prior records remain exact-artifact historical evidence. Ordinary Darwin-arm64
163
+ composition verifies the embedded sibling helper but rejects every process
164
+ consumer before native preparation. The exact Codex/Git migrations,
165
+ current-source real-Codex lifecycle, and bounded coding-task proofs now pass
166
+ only for their named revisions. The methods remain blocked with the owning
167
+ node/CLI consumer. A1 still lacks exact npm tarball closure,
168
+ integrity/provenance, carried-helper identity, clean installation, and an
169
+ explicit release decision. The retained macOS F1/H2 manifest remains
170
+ historical exact-artifact evidence; app/DMG qualification belongs to the later
171
+ Desktop/native channel.
172
+
173
+ `@maiaos/sdk/node` implements the first real adapter. Callers may provide an exact
174
+ ready endpoint and credential path, or call `connectLocalNode` to resolve the
175
+ current profile's private connection descriptor. The adapter then:
176
+
177
+ - validates transport options and the local-node request/response schemas;
178
+ - requires the credential and Unix socket to be owned by the current user,
179
+ private, regular/single-linked where applicable, and inside private
180
+ directories;
181
+ - uses `O_NOFOLLOW | O_NONBLOCK` on Unix, rejects non-regular credentials after
182
+ opening, and verifies the descriptor against its current path before sending
183
+ it;
184
+ - applies the protocol's one-MiB frame and 4,096-chunk compatibility limits;
185
+ - independently bounds each transport instance to eight in-flight requests and
186
+ each complete filesystem/connect/response operation to five seconds;
187
+ - fails fast when saturated and destroys the socket on interruption;
188
+ - returns generic client-facing transport failures without putting paths or
189
+ credentials in messages.
190
+ - validates a bounded, private, no-follow descriptor against its deterministic
191
+ profile location and proves its process identity with an authenticated
192
+ `node.status` call before returning a discovered client.
193
+
194
+ `connectLocalNode` accepts a standard `AbortSignal`; interruption propagates to
195
+ the authenticated identity probe and closes its real socket.
196
+
197
+ The Node adapter is deliberately a separate export so browser, Expo, and mobile
198
+ bundles do not import Node filesystem or socket modules:
199
+
200
+ ```ts
201
+ import { createLocalNodeClient } from "@maiaos/sdk";
202
+ import { connectLocalNode, createLocalNodeTransport } from "@maiaos/sdk/node";
203
+
204
+ const client = createLocalNodeClient(
205
+ createLocalNodeTransport({
206
+ credentialPath,
207
+ endpoint: readyRecord.endpoint,
208
+ }),
209
+ );
210
+
211
+ const discovered = await connectLocalNode({ profile: "default" });
212
+ console.log(discovered.status.lifecycle);
213
+ ```
214
+
215
+ The SDK does not start or stop a daemon implicitly, read node storage, or
216
+ supervise runtimes. Runtime probing, session persistence, and terminal
217
+ ownership remain node operations; the SDK never spawns Codex or a terminal
218
+ itself. OS-service discovery, remote HTTP/WSS, live subscriptions, cursor
219
+ helpers beyond the explicit page contracts, and higher-level generated
220
+ commands remain later slices. Local discovery is intentionally read/probe-only: desktop remains
221
+ the lifecycle owner in the current mode.
222
+
223
+ ADR-015 accepts a later generated Public operation catalog as the complete
224
+ programmatic view of the exact built public node protocol. Named typed methods
225
+ remain the normal SDK surface; bounded reflective access will be:
226
+
227
+ ```ts
228
+ client.operations.list({ limit, after, query }, options);
229
+ client.operations.show({ operationId }, options);
230
+ client.operations.invoke({ operationId, input, commandId }, options);
231
+ ```
232
+
233
+ These methods are planned and not exported today. Their registry will exclude
234
+ CLI presentation, NodeBootstrap, roadmap-only, database, Worker-administration,
235
+ provider-internal, and private service operations. Listing or describing an
236
+ operation never grants it, and `invoke` must preserve the operation's current
237
+ authentication, Capability, Approval, validation, revision, idempotency,
238
+ Receipt, cancellation, cursor, and availability behavior.
239
+
240
+ The accepted TypeScript Notebook kernel receives a short-lived injected
241
+ `maia` bridge generated from and conformant with this SDK; cell source does not
242
+ import `@maiaos/sdk` or receive a general node credential. External Harnesses may
243
+ use this package directly or the CLI. Protocol, SDK, CLI/help, and injected-
244
+ bridge catalog digests and fixtures must agree. Notebook schemas, methods, and
245
+ the bridge are unimplemented, and cell execution remains blocked until A6/W3
246
+ hard containment and the [Notebook product gates](../../services/README.md#execution--portable-notebooks)
247
+ pass.
248
+
249
+ The adapter uses Effect v4 for named effects, typed failures, bracketed file
250
+ handles, interruption, the five-second deadline, and fail-fast semaphore
251
+ admission. Native Node filesystem and socket calls remain the narrow boundary
252
+ because the generic platform filesystem does not expose the numeric
253
+ `O_NOFOLLOW` open needed here, and its socket abstraction does not own Windows
254
+ named pipes. XState is intentionally absent from one request/response exchange:
255
+ there is no durable or user-visible lifecycle topology yet. Connection
256
+ supervision, reconnect, and subscription state will introduce the machine when
257
+ those states become real.
258
+
259
+ Tests cover the transport through real Unix sockets or Windows named pipes and
260
+ also start the exact built `maia-node` and `maia status` executables from the
261
+ node integration suite. The real-filesystem cases include private descriptor
262
+ discovery, descriptor mismatch/symlink/size rejection, a no-writer FIFO,
263
+ deadline-triggered socket cleanup, cancellation, saturation, and
264
+ same-transport permit recovery.
265
+
266
+ The product sequence and full client expectations are owned by
267
+ [canonical roadmap](../../ROADMAP.md). Internal Maia services use
268
+ explicit typed ports or authenticated versioned service protocols at their own
269
+ boundaries; this product-client SDK is not permission to share private stores.
270
+ In-memory tests remain only for transport-neutral client validation. Node
271
+ 24.19.0 is the sole supported runtime; SDK performance claims require retained
272
+ raw evidence from that exact runtime and the documented reference host.
273
+
274
+ The live-terminal package layout remains labeled predecessor evidence: 23,744
275
+ packed bytes, 126,998 unpacked bytes, and 14 entries. That decision's
276
+ predecessor was 22,647 packed and 116,746 unpacked bytes; the deltas were
277
+ +4.843909% and +8.781457%. The current comparison identity is 17,997 packed
278
+ bytes, 85,879 unpacked bytes, and 8 entries. Direct dependencies remain three
279
+ and bundled dependencies remain zero. The published pack now omits declaration
280
+ maps and JavaScript source maps because both point at unpublished `src/` and
281
+ carry no `sourcesContent`; local `dist` still emits them. Types and the public
282
+ export surface stay in the tarball. The standalone CLI keeps its linked map.
283
+ This decision does not qualify the terminal product, F1, or a release. See the
284
+ [current comparison identity](../../services/README.md#benchmarks--sdkcli-collapsed-pack-and-standalone-comparison-identity-approved)
285
+ and the
286
+ [live-terminal predecessor](../../services/README.md#benchmarks--live-terminal-sdkcli-package-footprint-baseline-decision-approved).
287
+
288
+ A future device-capability-host SDK role will use credentials, grants, and
289
+ transport authority distinct from this product-client surface. It is planned
290
+ and not exported today; see
291
+ [Device capabilities](../../services/README.md#device-capabilities).
@@ -0,0 +1,96 @@
1
+ import { type ExecutionCatalogGetParameters, type ExecutionCatalogGetResult, type InstalledHarnessListParameters, type InstalledHarnessListResult, type IntegrationApplyCodexParameters, type IntegrationApplyCodexResult, type IntegrationApplyPiRpcParameters, type IntegrationApplyPiRpcResult, type IntegrationPlanCodexParameters, type IntegrationPlanCodexResult, type IntegrationPlanPiRpcParameters, type IntegrationPlanPiRpcResult, type IntegrationRemoveCodexParameters, type IntegrationRemoveCodexResult, type IntegrationRemovePiRpcParameters, type IntegrationRemovePiRpcResult, type IntegrationStatusCodexParameters, type IntegrationStatusCodexResult, type IntegrationStatusPiRpcParameters, type IntegrationStatusPiRpcResult, type InvocationContextShowParameters, type InvocationContextShowResult, type LiveTerminalCloseParameters, type LiveTerminalCloseResult, type LiveTerminalControllerAcquireParameters, type LiveTerminalControllerAcquireResult, type LiveTerminalControllerReleaseParameters, type LiveTerminalControllerReleaseResult, type LiveTerminalControllerRequestParameters, type LiveTerminalControllerRequestResult, type LiveTerminalControllerRequestShowParameters, type LiveTerminalControllerRequestShowResult, type LiveTerminalResizeParameters, type LiveTerminalResizeResult, type LiveTerminalSignalParameters, type LiveTerminalSignalResult, type LiveTerminalWriteParameters, type LiveTerminalWriteResult, type LocalNodeOperationErrorCode, type LocalNodeShutdownResult, type LocalNodeStatusResult, type MonitorBootstrapCreateResult, type OrchestrationDispatchSettleTerminalParameters, type OrchestrationDispatchSettleTerminalResult, type OrchestrationDispatchShowParameters, type OrchestrationDispatchShowResult, type OrchestrationInboxAckParameters, type OrchestrationInboxAckResult, type OrchestrationInboxCheckParameters, type OrchestrationInboxCheckResult, type OrchestrationQuestionCancelParameters, type OrchestrationQuestionCancelResult, type OrchestrationQuestionOpenParameters, type OrchestrationQuestionOpenResult, type OrchestrationQuestionReplyParameters, type OrchestrationQuestionReplyResult, type OrchestrationRunCreateParameters, type OrchestrationRunCreateResult, type OrchestrationRunListParameters, type OrchestrationRunListResult, type OrchestrationRunShowParameters, type OrchestrationRunShowResult, type OrchestrationTaskListParameters, type OrchestrationTaskListResult, type OrchestrationTaskShowParameters, type OrchestrationTaskShowResult, type ProjectListParameters, type ProjectListResult, type ProjectRegisterParameters, type ProjectRegisterResult, type ProjectShowParameters, type ProjectShowResult, type ProtocolError, type ProtocolRequestEnvelope, type ReceiptGetParameters, type ReceiptGetResult, type ReceiptListParameters, type ReceiptListResult, type RuntimeParser, type RuntimeProbeParameters, type RuntimeProbeResult, type SessionCreateParameters, type SessionCreateResult, type SessionEventsListParameters, type SessionEventsListResult, type SessionListParameters, type SessionListResult, type SessionShowParameters, type SessionShowResult, type SessionStartParameters, type SessionStartResult, type TerminalCreateParameters, type TerminalCreateResult, type TerminalEventsListParameters, type TerminalEventsListResult, type TerminalListParameters, type TerminalListResult, type TerminalReadParameters, type TerminalReadResult, type TerminalShowParameters, type TerminalShowResult, type TurnInterruptParameters, type TurnInterruptResult, type TurnSendParameters, type TurnSendResult, type TurnShowParameters, type TurnShowResult, type WorkspaceExecutionConfigureParameters, type WorkspaceExecutionConfigureResult, type WorkspaceExecutionShowParameters, type WorkspaceExecutionShowResult, type WorkspaceListParameters, type WorkspaceListResult, type WorkspaceRepositoryAttachParameters, type WorkspaceRepositoryAttachResult, type WorkspaceShowParameters, type WorkspaceShowResult } from "@maiaos/protocol";
2
+ export type { CapabilityDescriptor, ExecutionCatalogGetParameters, ExecutionCatalogGetResult, ExecutionProfile, ExecutionProviderDescriptor, InstalledHarnessListParameters, InstalledHarnessListResult, IntegrationApplyCodexParameters, IntegrationApplyCodexResult, IntegrationApplyPiRpcParameters, IntegrationApplyPiRpcResult, IntegrationAuthorization, IntegrationAuthorizationStatusItem, IntegrationPlanCodexParameters, IntegrationPlanCodexResult, IntegrationPlanPiRpcParameters, IntegrationPlanPiRpcResult, IntegrationRemoveCodexParameters, IntegrationRemoveCodexResult, IntegrationRemovePiRpcParameters, IntegrationRemovePiRpcResult, IntegrationStatusCodexParameters, IntegrationStatusCodexResult, IntegrationStatusPiRpcParameters, IntegrationStatusPiRpcResult, InvocationContextShowParameters, InvocationContextShowResult, LiveTerminalCloseParameters, LiveTerminalCloseResult, LiveTerminalControllerAcquireParameters, LiveTerminalControllerAcquireResult, LiveTerminalControllerLease, LiveTerminalControllerReleaseParameters, LiveTerminalControllerReleaseResult, LiveTerminalControllerRequest, LiveTerminalControllerRequestParameters, LiveTerminalControllerRequestResult, LiveTerminalControllerRequestShowParameters, LiveTerminalControllerRequestShowResult, LiveTerminalCreateParameters, LiveTerminalCreateResult, LiveTerminalMutationOutcomeUnknown, LiveTerminalMutationReceipt, LiveTerminalResizeParameters, LiveTerminalResizeResult, LiveTerminalSession, LiveTerminalSignalParameters, LiveTerminalSignalResult, LiveTerminalWriteParameters, LiveTerminalWriteResult, LocalNodeEndpoint, LocalNodeOperationErrorCode, LocalNodeShutdownResult, LocalNodeStatusResult, MonitorBootstrapCreateResult, OrchestrationAggregate, OrchestrationAttempt, OrchestrationDelivery, OrchestrationDispatch, OrchestrationDispatchSettleTerminalParameters, OrchestrationDispatchSettleTerminalResult, OrchestrationDispatchShowParameters, OrchestrationDispatchShowResult, OrchestrationInboxAckParameters, OrchestrationInboxAckResult, OrchestrationInboxCheckParameters, OrchestrationInboxCheckResult, OrchestrationMailbox, OrchestrationMessage, OrchestrationQuestion, OrchestrationQuestionCancelParameters, OrchestrationQuestionCancelResult, OrchestrationQuestionOpenParameters, OrchestrationQuestionOpenResult, OrchestrationQuestionReplyParameters, OrchestrationQuestionReplyResult, OrchestrationRun, OrchestrationRunCreateParameters, OrchestrationRunCreateResult, OrchestrationRunListParameters, OrchestrationRunListResult, OrchestrationRunShowParameters, OrchestrationRunShowResult, OrchestrationTask, OrchestrationTaskGraph, OrchestrationTaskInput, OrchestrationTaskListParameters, OrchestrationTaskListResult, OrchestrationTaskShowParameters, OrchestrationTaskShowResult, OrchestrationTaskSummary, Project, ProjectListParameters, ProjectListResult, ProjectRegisterParameters, ProjectRegisterResult, ProjectShowParameters, ProjectShowResult, ProtocolEnvelope, ProtocolError, ProtocolIdentifier, ProtocolMessageKind, ProtocolRequestEnvelope, ProtocolVersion, ReceiptGetParameters, ReceiptGetResult, ReceiptListCursor, ReceiptListItem, ReceiptListParameters, ReceiptListResult, Repository, RuntimeProbeParameters, RuntimeProbeResult, Session, SessionCreateParameters, SessionCreateResult, SessionEvent, SessionEventsListParameters, SessionEventsListResult, SessionListParameters, SessionListResult, SessionShowParameters, SessionShowResult, SessionStartParameters, SessionStartResult, Terminal, TerminalChunk, TerminalCreateParameters, TerminalCreateResult, TerminalEvent, TerminalEventsListParameters, TerminalEventsListResult, TerminalListParameters, TerminalListResult, TerminalReadParameters, TerminalReadResult, TerminalShowParameters, TerminalShowResult, Turn, TurnInput, TurnInterruptParameters, TurnInterruptResult, TurnSendParameters, TurnSendResult, TurnShowParameters, TurnShowResult, TurnTokenUsage, Workspace, WorkspaceCheckout, WorkspaceExecutionBinding, WorkspaceExecutionConfigureParameters, WorkspaceExecutionConfigureResult, WorkspaceExecutionResolution, WorkspaceExecutionSelection, WorkspaceExecutionShowParameters, WorkspaceExecutionShowResult, WorkspaceListParameters, WorkspaceListResult, WorkspaceRepositoryAttachParameters, WorkspaceRepositoryAttachResult, WorkspaceShowParameters, WorkspaceShowResult, } from "@maiaos/protocol";
3
+ export { capabilityDescriptorSchema, capabilityListSchema, capabilityNameSchema, createProtocolEnvelopeSchema, createRequestEnvelopeSchema, createRuntimeSchema, createSuccessEnvelopeSchema, DEFAULT_ORCHESTRATION_CHECK_PAGE_SIZE, DEFAULT_ORCHESTRATION_LIST_PAGE_SIZE, DEFAULT_ORCHESTRATION_TASK_LIST_PAGE_SIZE, DEFAULT_RECEIPT_LIST_PAGE_SIZE, EXECUTION_SCHEMA_VERSION, executionCatalogGetParametersSchema, executionCatalogGetResultSchema, executionProfileSchema, executionProviderDescriptorSchema, inspectOrchestrationRunCreateAdmission, installedHarnessListParametersSchema, installedHarnessListResultSchema, integrationApplyCodexParametersSchema, integrationApplyCodexResultSchema, integrationApplyPiRpcParametersSchema, integrationApplyPiRpcResultSchema, integrationAuthorizationSchema, integrationAuthorizationStatusItemSchema, integrationPlanCodexParametersSchema, integrationPlanCodexResultSchema, integrationPlanPiRpcParametersSchema, integrationPlanPiRpcResultSchema, integrationRemoveCodexParametersSchema, integrationRemoveCodexResultSchema, integrationRemovePiRpcParametersSchema, integrationRemovePiRpcResultSchema, integrationStatusCodexParametersSchema, integrationStatusCodexResultSchema, integrationStatusPiRpcParametersSchema, integrationStatusPiRpcResultSchema, INVOCATION_CONTEXT_ACTOR_LOCAL_USER, INVOCATION_CONTEXT_ALLOWED_ACTION_SHOW, INVOCATION_CONTEXT_CLIENT_PRINCIPAL_ID, INVOCATION_CONTEXT_ERROR_NODE_UNAVAILABLE, INVOCATION_CONTEXT_ERROR_OVERRIDE_FORBIDDEN, INVOCATION_CONTEXT_SCHEMA_VERSION, invocationContextShowParametersSchema, invocationContextShowResultSchema, liveTerminalCloseParametersSchema, liveTerminalCloseResultSchema, liveTerminalControllerAcquireParametersSchema, liveTerminalControllerAcquireResultSchema, liveTerminalControllerReleaseParametersSchema, liveTerminalControllerReleaseResultSchema, liveTerminalControllerRequestParametersSchema, liveTerminalControllerRequestResultSchema, liveTerminalControllerRequestShowParametersSchema, liveTerminalControllerRequestShowResultSchema, liveTerminalCreateParametersSchema, liveTerminalCreateResultSchema, liveTerminalResizeParametersSchema, liveTerminalResizeResultSchema, liveTerminalSignalParametersSchema, liveTerminalSignalResultSchema, liveTerminalWriteParametersSchema, liveTerminalWriteResultSchema, LOCAL_DEFAULT_POLICY_ID, LOCAL_HOST_PROFILE_ID, LOCAL_HOST_PROVIDER_ID, localNodeEndpointSchema, localNodeOperationErrorCodeSchema, localNodeRequestPayloadSchema, localNodeShutdownResultSchema, localNodeStatusResultSchema, MAIA_PROTOCOL_VERSION, MAX_ORCHESTRATION_CHECK_PAGE_SIZE, MAX_ORCHESTRATION_LIST_PAGE_SIZE, MAX_ORCHESTRATION_TASK_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_RESULT_BYTES, MAX_TERMINAL_COLUMNS, MAX_TERMINAL_CONTROLLER_LEASE_MS, MAX_TERMINAL_GENERATION, MAX_TERMINAL_INPUT_CHUNK_BYTES, MAX_TERMINAL_INPUT_SEQUENCE, MAX_TERMINAL_ROWS, MAX_TURN_INPUT_BYTES, MIN_TERMINAL_COLUMNS, MIN_TERMINAL_CONTROLLER_LEASE_MS, MIN_TERMINAL_ROWS, monitorBootstrapCreateResultSchema, orchestrationDispatchSettleTerminalParametersSchema, orchestrationDispatchSettleTerminalResultSchema, orchestrationDispatchShowParametersSchema, orchestrationDispatchShowResultSchema, orchestrationInboxAckParametersSchema, orchestrationInboxAckResultSchema, orchestrationInboxCheckParametersSchema, orchestrationInboxCheckResultSchema, orchestrationQuestionCancelParametersSchema, orchestrationQuestionCancelResultSchema, orchestrationQuestionOpenParametersSchema, orchestrationQuestionOpenResultSchema, orchestrationQuestionReplyParametersSchema, orchestrationQuestionReplyResultSchema, orchestrationRunCreateParametersSchema, orchestrationRunCreateResultSchema, orchestrationRunListParametersSchema, orchestrationRunListResultSchema, orchestrationRunShowParametersSchema, orchestrationRunShowResultSchema, orchestrationTaskGraphSchema, orchestrationTaskListParametersSchema, orchestrationTaskListResultSchema, orchestrationTaskShowParametersSchema, orchestrationTaskShowResultSchema, orchestrationTaskSummarySchema, placementPolicySchema, projectListParametersSchema, projectListResultSchema, projectRegisterParametersSchema, projectRegisterResultSchema, projectSchema, projectShowParametersSchema, projectShowResultSchema, protocolErrorCodeSchema, protocolErrorEnvelopeSchema, protocolErrorSchema, protocolIdentifierSchema, protocolMessageKindSchema, protocolRequestEnvelopeSchema, protocolSuccessEnvelopeSchema, protocolVersionSchema, receiptGetParametersSchema, receiptListCursorSchema, receiptListItemSchema, receiptListParametersSchema, receiptListResultSchema, repositorySchema, runtimeProbeParametersSchema, runtimeProbeResultSchema, sessionCreateParametersSchema, sessionCreateResultSchema, sessionEventSchema, sessionEventsListParametersSchema, sessionEventsListResultSchema, sessionListParametersSchema, sessionListResultSchema, sessionSchema, sessionShowParametersSchema, sessionShowResultSchema, sessionStartParametersSchema, sessionStartResultSchema, terminalChunkSchema, terminalCreateParametersSchema, terminalCreateResultSchema, terminalEventSchema, terminalEventsListParametersSchema, terminalEventsListResultSchema, terminalListParametersSchema, terminalListResultSchema, terminalReadParametersSchema, terminalReadResultSchema, terminalSchema, terminalShowParametersSchema, terminalShowResultSchema, turnInputSchema, turnInterruptParametersSchema, turnInterruptResultSchema, turnSchema, turnSendParametersSchema, turnSendResultSchema, turnShowParametersSchema, turnShowResultSchema, turnTokenUsageSchema, workspaceCheckoutSchema, workspaceExecutionBindingSchema, workspaceExecutionConfigureParametersSchema, workspaceExecutionConfigureResultSchema, workspaceExecutionResolutionSchema, workspaceExecutionSelectionSchema, workspaceExecutionShowParametersSchema, workspaceExecutionShowResultSchema, workspaceListParametersSchema, workspaceListResultSchema, workspaceRepositoryAttachParametersSchema, workspaceRepositoryAttachResultSchema, workspaceSchema, workspaceShowParametersSchema, workspaceShowResultSchema, } from "@maiaos/protocol";
4
+ export type CancellationSignal = AbortSignal;
5
+ export type TransportRequestOptions = {
6
+ readonly signal?: CancellationSignal;
7
+ };
8
+ export type MaiaTransport = {
9
+ readonly request: (envelope: ProtocolRequestEnvelope<unknown>, options?: TransportRequestOptions) => Promise<unknown>;
10
+ };
11
+ export type RuntimeSchema<TValue> = RuntimeParser<TValue>;
12
+ export type MaiaRequest<TInput, TOutput> = {
13
+ readonly inputSchema: RuntimeSchema<TInput>;
14
+ readonly messageId: string;
15
+ readonly outputSchema: RuntimeSchema<TOutput>;
16
+ readonly payload: TInput;
17
+ readonly signal?: CancellationSignal;
18
+ };
19
+ export type MaiaClientErrorCode = "cancelled" | "correlation_mismatch" | "invalid_request" | "invalid_response" | "remote_error" | "transport_failure" | LocalNodeOperationErrorCode;
20
+ export declare class MaiaClientError extends Error {
21
+ readonly code: MaiaClientErrorCode;
22
+ readonly remoteError?: ProtocolError;
23
+ constructor(code: MaiaClientErrorCode, message: string, options?: ErrorOptions & {
24
+ readonly remoteError?: ProtocolError;
25
+ });
26
+ }
27
+ export type MaiaClient = {
28
+ readonly request: <TInput, TOutput>(request: MaiaRequest<TInput, TOutput>) => Promise<TOutput>;
29
+ };
30
+ export type LocalNodeRequestOptions = {
31
+ readonly messageId: string;
32
+ readonly signal?: CancellationSignal;
33
+ };
34
+ export type LocalNodeClient = {
35
+ readonly acknowledgeOrchestrationDelivery: (parameters: OrchestrationInboxAckParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationInboxAckResult>;
36
+ readonly acquireTerminalController: (parameters: LiveTerminalControllerAcquireParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalControllerAcquireResult>;
37
+ readonly applyCodexIntegration: (parameters: IntegrationApplyCodexParameters, options: LocalNodeRequestOptions) => Promise<IntegrationApplyCodexResult>;
38
+ readonly applyPiRpcIntegration: (parameters: IntegrationApplyPiRpcParameters, options: LocalNodeRequestOptions) => Promise<IntegrationApplyPiRpcResult>;
39
+ readonly attachWorkspaceRepository: (parameters: WorkspaceRepositoryAttachParameters, options: LocalNodeRequestOptions) => Promise<WorkspaceRepositoryAttachResult>;
40
+ readonly cancelOrchestrationQuestion: (parameters: OrchestrationQuestionCancelParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationQuestionCancelResult>;
41
+ readonly checkOrchestrationInbox: (parameters: OrchestrationInboxCheckParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationInboxCheckResult>;
42
+ readonly closeTerminal: (parameters: LiveTerminalCloseParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalCloseResult>;
43
+ readonly configureWorkspaceExecution: (parameters: WorkspaceExecutionConfigureParameters, options: LocalNodeRequestOptions) => Promise<WorkspaceExecutionConfigureResult>;
44
+ readonly createMonitorBootstrap: (options: LocalNodeRequestOptions) => Promise<MonitorBootstrapCreateResult>;
45
+ readonly createOrchestrationRun: (parameters: OrchestrationRunCreateParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationRunCreateResult>;
46
+ readonly createSession: (parameters: SessionCreateParameters, options: LocalNodeRequestOptions) => Promise<SessionCreateResult>;
47
+ readonly createTerminal: (parameters: TerminalCreateParameters, options: LocalNodeRequestOptions) => Promise<TerminalCreateResult>;
48
+ readonly getReceipt: (parameters: ReceiptGetParameters, options: LocalNodeRequestOptions) => Promise<ReceiptGetResult>;
49
+ readonly interruptTurn: (parameters: TurnInterruptParameters, options: LocalNodeRequestOptions) => Promise<TurnInterruptResult>;
50
+ readonly listInstalledHarnesses: (parameters: InstalledHarnessListParameters, options: LocalNodeRequestOptions) => Promise<InstalledHarnessListResult>;
51
+ readonly listOrchestrationRuns: (parameters: OrchestrationRunListParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationRunListResult>;
52
+ readonly listOrchestrationTasks: (parameters: OrchestrationTaskListParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationTaskListResult>;
53
+ readonly listProjects: (parameters: ProjectListParameters, options: LocalNodeRequestOptions) => Promise<ProjectListResult>;
54
+ readonly listReceipts: (parameters: ReceiptListParameters, options: LocalNodeRequestOptions) => Promise<ReceiptListResult>;
55
+ readonly listSessionEvents: (parameters: SessionEventsListParameters, options: LocalNodeRequestOptions) => Promise<SessionEventsListResult>;
56
+ readonly listSessions: (parameters: SessionListParameters, options: LocalNodeRequestOptions) => Promise<SessionListResult>;
57
+ readonly listTerminalEvents: (parameters: TerminalEventsListParameters, options: LocalNodeRequestOptions) => Promise<TerminalEventsListResult>;
58
+ readonly listTerminals: (parameters: TerminalListParameters, options: LocalNodeRequestOptions) => Promise<TerminalListResult>;
59
+ readonly listWorkspaces: (parameters: WorkspaceListParameters, options: LocalNodeRequestOptions) => Promise<WorkspaceListResult>;
60
+ readonly openOrchestrationQuestion: (parameters: OrchestrationQuestionOpenParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationQuestionOpenResult>;
61
+ readonly planCodexIntegration: (parameters: IntegrationPlanCodexParameters, options: LocalNodeRequestOptions) => Promise<IntegrationPlanCodexResult>;
62
+ readonly planPiRpcIntegration: (parameters: IntegrationPlanPiRpcParameters, options: LocalNodeRequestOptions) => Promise<IntegrationPlanPiRpcResult>;
63
+ readonly probeRuntime: (parameters: RuntimeProbeParameters, options: LocalNodeRequestOptions) => Promise<RuntimeProbeResult>;
64
+ readonly readExecutionCatalog: (parameters: ExecutionCatalogGetParameters, options: LocalNodeRequestOptions) => Promise<ExecutionCatalogGetResult>;
65
+ readonly readTerminal: (parameters: TerminalReadParameters, options: LocalNodeRequestOptions) => Promise<TerminalReadResult>;
66
+ readonly registerProject: (parameters: ProjectRegisterParameters, options: LocalNodeRequestOptions) => Promise<ProjectRegisterResult>;
67
+ readonly releaseTerminalController: (parameters: LiveTerminalControllerReleaseParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalControllerReleaseResult>;
68
+ readonly removeCodexIntegration: (parameters: IntegrationRemoveCodexParameters, options: LocalNodeRequestOptions) => Promise<IntegrationRemoveCodexResult>;
69
+ readonly removePiRpcIntegration: (parameters: IntegrationRemovePiRpcParameters, options: LocalNodeRequestOptions) => Promise<IntegrationRemovePiRpcResult>;
70
+ readonly replyOrchestrationQuestion: (parameters: OrchestrationQuestionReplyParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationQuestionReplyResult>;
71
+ readonly requestTerminalController: (parameters: LiveTerminalControllerRequestParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalControllerRequestResult>;
72
+ readonly resizeTerminal: (parameters: LiveTerminalResizeParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalResizeResult>;
73
+ readonly sendTurn: (parameters: TurnSendParameters, options: LocalNodeRequestOptions) => Promise<TurnSendResult>;
74
+ readonly settleOrchestrationDispatchTerminal: (parameters: OrchestrationDispatchSettleTerminalParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationDispatchSettleTerminalResult>;
75
+ readonly showCurrentContext: (parameters: InvocationContextShowParameters, options: LocalNodeRequestOptions) => Promise<InvocationContextShowResult>;
76
+ readonly showOrchestrationDispatch: (parameters: OrchestrationDispatchShowParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationDispatchShowResult>;
77
+ readonly showOrchestrationRun: (parameters: OrchestrationRunShowParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationRunShowResult>;
78
+ readonly showOrchestrationTask: (parameters: OrchestrationTaskShowParameters, options: LocalNodeRequestOptions) => Promise<OrchestrationTaskShowResult>;
79
+ readonly showProject: (parameters: ProjectShowParameters, options: LocalNodeRequestOptions) => Promise<ProjectShowResult>;
80
+ readonly showSession: (parameters: SessionShowParameters, options: LocalNodeRequestOptions) => Promise<SessionShowResult>;
81
+ readonly showTerminal: (parameters: TerminalShowParameters, options: LocalNodeRequestOptions) => Promise<TerminalShowResult>;
82
+ readonly showTerminalControllerRequest: (parameters: LiveTerminalControllerRequestShowParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalControllerRequestShowResult>;
83
+ readonly showTurn: (parameters: TurnShowParameters, options: LocalNodeRequestOptions) => Promise<TurnShowResult>;
84
+ readonly showWorkspace: (parameters: WorkspaceShowParameters, options: LocalNodeRequestOptions) => Promise<WorkspaceShowResult>;
85
+ readonly showWorkspaceExecution: (parameters: WorkspaceExecutionShowParameters, options: LocalNodeRequestOptions) => Promise<WorkspaceExecutionShowResult>;
86
+ readonly shutdown: (options: LocalNodeRequestOptions) => Promise<LocalNodeShutdownResult>;
87
+ readonly signalTerminal: (parameters: LiveTerminalSignalParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalSignalResult>;
88
+ readonly startSession: (parameters: SessionStartParameters, options: LocalNodeRequestOptions) => Promise<SessionStartResult>;
89
+ readonly status: (options: LocalNodeRequestOptions) => Promise<LocalNodeStatusResult>;
90
+ readonly statusCodexIntegration: (parameters: IntegrationStatusCodexParameters, options: LocalNodeRequestOptions) => Promise<IntegrationStatusCodexResult>;
91
+ readonly statusPiRpcIntegration: (parameters: IntegrationStatusPiRpcParameters, options: LocalNodeRequestOptions) => Promise<IntegrationStatusPiRpcResult>;
92
+ readonly writeTerminalInput: (parameters: LiveTerminalWriteParameters, options: LocalNodeRequestOptions) => Promise<LiveTerminalWriteResult>;
93
+ };
94
+ export declare const createMaiaClient: (transport: MaiaTransport) => MaiaClient;
95
+ export declare const createLocalNodeClient: (transport: MaiaTransport) => LocalNodeClient;
96
+ //# sourceMappingURL=index.d.ts.map