@beeos-ai/bma-executor-sdk 0.0.0-stage → 0.4.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.
@@ -0,0 +1,1218 @@
1
+ /** Generic acknowledgement returned by executor RPC methods. */
2
+ export interface Ack {
3
+ accepted: boolean;
4
+ }
5
+ /** agent capability. Present with enabled=true when the executor runs a complete agent and accepts turn.start, turn.input, turn.cancel, session.close and interaction.response. */
6
+ export interface AgentCapability {
7
+ enabled: boolean;
8
+ /** Models the local agent can run. An empty list means the executor picks its own model and ignores AgentTurnConfig.model. */
9
+ models?: Array<AgentModel>;
10
+ /** Permission mode ids the local agent understands, for example default, accept_edits, plan, bypass_permissions. The executor defines the ids; the platform only passes one back in AgentTurnConfig.permission_mode. */
11
+ permission_modes?: Array<string>;
12
+ /** Interaction kinds the executor may open with interaction.request. */
13
+ interaction_kinds?: Array<InteractionKind>;
14
+ /** The executor resolves file input blocks (session file ids) itself. */
15
+ file_inputs?: boolean;
16
+ /** Concurrent agent sessions. turn.start for a new session beyond it answers -32009 executor_busy. */
17
+ max_sessions?: number;
18
+ }
19
+ /** Typed session error. */
20
+ export interface AgentErrorInfo {
21
+ type: string;
22
+ message?: string;
23
+ }
24
+ /** One durable agent event. The event id is the session.event event_id; agent.tool_result.tool_use_id references the event_id of its agent.tool_use. */
25
+ export type AgentEvent = AgentMessageEvent | AgentThinkingEvent | AgentToolUseEvent | AgentToolResultEvent | AgentMcpToolUseEvent | AgentMcpToolResultEvent | SessionStatusRunningEvent | SessionStatusIdleEvent | SessionErrorEvent;
26
+ /** Durable events an agent executor emits with session.event. Names and members follow Anthropic Managed Agents session events. user.* events are written by the platform, never by the executor. */
27
+ export type AgentEventType = 'agent.message' | 'agent.thinking' | 'agent.tool_use' | 'agent.tool_result' | 'agent.mcp_tool_use' | 'agent.mcp_tool_result' | 'session.status_running' | 'session.status_idle' | 'session.error';
28
+ export declare const AgentEventType: {
29
+ readonly AgentMessage: "agent.message";
30
+ readonly AgentThinking: "agent.thinking";
31
+ readonly AgentToolUse: "agent.tool_use";
32
+ readonly AgentToolResult: "agent.tool_result";
33
+ readonly AgentMcpToolUse: "agent.mcp_tool_use";
34
+ readonly AgentMcpToolResult: "agent.mcp_tool_result";
35
+ readonly SessionStatusRunning: "session.status_running";
36
+ readonly SessionStatusIdle: "session.status_idle";
37
+ readonly SessionError: "session.error";
38
+ };
39
+ /** One block of user input. A file block references a platform session file by file_id; the executor downloads it through the executor files API. File bytes never travel on the control channel. */
40
+ export interface AgentInputBlock {
41
+ type: AgentInputBlockType;
42
+ text?: string;
43
+ file_id?: string;
44
+ name?: string;
45
+ mime_type?: string;
46
+ size_bytes?: number;
47
+ }
48
+ /** Agent input block type. */
49
+ export type AgentInputBlockType = 'text' | 'file';
50
+ export declare const AgentInputBlockType: {
51
+ readonly Text: "text";
52
+ readonly File: "file";
53
+ };
54
+ /** Result of an agent.mcp_tool_use. */
55
+ export interface AgentMcpToolResultEvent {
56
+ type: 'agent.mcp_tool_result';
57
+ mcp_tool_use_id: string;
58
+ content?: Array<ContentBlock>;
59
+ is_error?: boolean;
60
+ }
61
+ /** An MCP tool the local agent is calling. Its event_id is the mcp_tool_use_id. */
62
+ export interface AgentMcpToolUseEvent {
63
+ type: 'agent.mcp_tool_use';
64
+ mcp_server_name: string;
65
+ name: string;
66
+ input: Record<string, unknown>;
67
+ evaluated_permission?: EvaluatedPermission;
68
+ }
69
+ /** Final assistant text. Streaming previews for the same event_id arrive earlier as session.event_delta. */
70
+ export interface AgentMessageEvent {
71
+ type: 'agent.message';
72
+ content: Array<ContentBlock>;
73
+ }
74
+ /** One model the local agent can run. */
75
+ export interface AgentModel {
76
+ id: string;
77
+ display_name?: string;
78
+ /** Thinking or reasoning-effort levels the model accepts, for example off, low, medium, high. */
79
+ thinking_levels?: Array<string>;
80
+ default_thinking_level?: string;
81
+ }
82
+ /** Model thinking. content may be empty when the model only reports that it thought. */
83
+ export interface AgentThinkingEvent {
84
+ type: 'agent.thinking';
85
+ content?: Array<ContentBlock>;
86
+ }
87
+ /** Result of an agent.tool_use. */
88
+ export interface AgentToolResultEvent {
89
+ type: 'agent.tool_result';
90
+ tool_use_id: string;
91
+ content?: Array<ContentBlock>;
92
+ is_error?: boolean;
93
+ }
94
+ /** A built-in or custom tool the local agent is calling. Its event_id is the tool_use_id. */
95
+ export interface AgentToolUseEvent {
96
+ type: 'agent.tool_use';
97
+ name: string;
98
+ input: Record<string, unknown>;
99
+ evaluated_permission?: EvaluatedPermission;
100
+ }
101
+ /** Requested (turn.start) or effective (TurnStartResult.effective) turn configuration. Every member is optional in a request; the executor reports the values it actually applied. */
102
+ export interface AgentTurnConfig {
103
+ model?: string;
104
+ thinking_level?: string;
105
+ permission_mode?: string;
106
+ /** Working directory on the executor host. The executor rejects a directory outside its allowed roots with -32001 forbidden. */
107
+ cwd?: string;
108
+ /** Extra system instructions from the platform agent definition. */
109
+ system?: string;
110
+ }
111
+ /** v1.1 artifact upload (POST /v1/executors/artifacts). Environment-scoped executors only. */
112
+ export interface ArtifactCapability {
113
+ upload: boolean;
114
+ max_bytes?: number;
115
+ }
116
+ /** Artifact reference returned by POST /v1/executors/artifacts and listed in tool.result artifacts (v1.1 §6.5). */
117
+ export interface ArtifactRef {
118
+ artifact_id: string;
119
+ name?: string;
120
+ mime_type: string;
121
+ size_bytes: number;
122
+ /** sha256:<hex> of the content. */
123
+ digest: string;
124
+ created_at?: string;
125
+ }
126
+ /** Executor capability object. The server only sends a method to an executor that advertised its capability; otherwise the executor answers -32012 capability_unavailable. */
127
+ export interface Capabilities {
128
+ shell?: ShellCapability;
129
+ files?: FilesCapability;
130
+ mcp?: McpCapability;
131
+ chrome?: boolean;
132
+ computer_use?: boolean;
133
+ /** v1 boolean or v1.1 DisplayCapability object. */
134
+ display?: boolean | DisplayCapability;
135
+ process?: ProcessCapability;
136
+ artifacts?: ArtifactCapability;
137
+ terminal?: TerminalCapability;
138
+ skills?: SkillsCapability;
139
+ workspace?: WorkspaceCapability;
140
+ agent?: AgentCapability;
141
+ }
142
+ /** Channels a short-lived executor JWT may open. */
143
+ export type ChannelScope = 'control' | 'mcp';
144
+ export declare const ChannelScope: {
145
+ readonly Control: "control";
146
+ readonly Mcp: "mcp";
147
+ };
148
+ /** Input actions accepted by the computer_action tool. */
149
+ export type ComputerAction = 'click' | 'type' | 'key' | 'scroll' | 'drag';
150
+ export declare const ComputerAction: {
151
+ readonly Click: "click";
152
+ readonly Type: "type";
153
+ readonly Key: "key";
154
+ readonly Scroll: "scroll";
155
+ readonly Drag: "drag";
156
+ };
157
+ /** Executor control channel state machine. */
158
+ export type ConnectionState = 'disconnected' | 'connecting' | 'registered' | 'ready' | 'draining' | 'closed';
159
+ export declare const ConnectionState: {
160
+ readonly Disconnected: "disconnected";
161
+ readonly Connecting: "connecting";
162
+ readonly Registered: "registered";
163
+ readonly Ready: "ready";
164
+ readonly Draining: "draining";
165
+ readonly Closed: "closed";
166
+ };
167
+ /** Tool result content block. An artifact block carries artifact_id and mime_type instead of text (v1.1 §6.5). */
168
+ export interface ContentBlock {
169
+ type: ContentBlockType;
170
+ text?: string;
171
+ data?: string;
172
+ mime_type?: string;
173
+ url?: string;
174
+ artifact_id?: string;
175
+ }
176
+ /** Tool result content block type. */
177
+ export type ContentBlockType = 'text' | 'image' | 'resource' | 'artifact';
178
+ export declare const ContentBlockType: {
179
+ readonly Text: "text";
180
+ readonly Image: "image";
181
+ readonly Resource: "resource";
182
+ readonly Artifact: "artifact";
183
+ };
184
+ /** Per-stream byte cursors. */
185
+ export interface Cursors {
186
+ stdout: number;
187
+ stderr: number;
188
+ }
189
+ /** v1.1 display object. v1 sent a boolean; the server accepts both. */
190
+ export interface DisplayCapability {
191
+ rfb?: boolean;
192
+ }
193
+ /** Permission decision the executor applied to a tool use. ask means the executor opened an interaction.request for it. */
194
+ export interface EvaluatedPermission {
195
+ type: 'allow' | 'ask' | 'deny';
196
+ }
197
+ /** Durable event type a streaming preview belongs to. */
198
+ export type EventDeltaType = 'agent.message' | 'agent.thinking';
199
+ export declare const EventDeltaType: {
200
+ readonly AgentMessage: "agent.message";
201
+ readonly AgentThinking: "agent.thinking";
202
+ };
203
+ /** executor.drain result. */
204
+ export interface ExecutorDrainResult {
205
+ accepted: boolean;
206
+ active_sessions: Array<string>;
207
+ }
208
+ /** executor.heartbeat result. */
209
+ export interface ExecutorHeartbeatResult {
210
+ server_time: string;
211
+ lease_ttl_ms: number;
212
+ drain: boolean;
213
+ }
214
+ /** Executor identity reported at token bootstrap and registration. */
215
+ export interface ExecutorInfo {
216
+ name: string;
217
+ os: string;
218
+ arch: string;
219
+ version: string;
220
+ }
221
+ /** Advisory executor load reported with executor.heartbeat. The server does not act on it. */
222
+ export interface ExecutorLoad {
223
+ cpu_percent?: number;
224
+ memory_percent?: number;
225
+ }
226
+ /** executor.register result. protocol and limits are v1.1 only. */
227
+ export interface ExecutorRegisterResult {
228
+ executor_id: string;
229
+ connection_id: string;
230
+ server_time: string;
231
+ heartbeat_interval_ms: number;
232
+ lease_ttl_ms: number;
233
+ max_control_frame_bytes: number;
234
+ max_mcp_frame_bytes: number;
235
+ drain: boolean;
236
+ protocol?: ProtocolVersion;
237
+ limits?: Limits;
238
+ }
239
+ /** Reattach state sent on reconnect. */
240
+ export interface ExecutorResume {
241
+ executor_id?: string;
242
+ last_connection_id?: string;
243
+ active_sessions?: Array<string>;
244
+ }
245
+ /** POST /v1/executors/token body. The bearer is an environment key, or a machine daemon token. An empty environment_id with a machine token requests a machine-scoped executor: its executor_id is exec_<machine_id>, stable across refreshes, and the JWT carries machine_id and daemon_token_id. */
246
+ export interface ExecutorTokenRequest {
247
+ environment_id: string;
248
+ executor: ExecutorInfo;
249
+ }
250
+ /** POST /v1/executors/token response. */
251
+ export interface ExecutorTokenResponse {
252
+ executor_id: string;
253
+ /** Short-lived executor JWT, sent only in the Authorization header of the channel upgrade. */
254
+ token: string;
255
+ /** Seconds. */
256
+ expires_in: number;
257
+ ws_url: string;
258
+ channel_scope: Array<ChannelScope>;
259
+ }
260
+ /** File transfer direction relative to the machine. */
261
+ export type FileTransferDirection = 'upload' | 'download';
262
+ export declare const FileTransferDirection: {
263
+ readonly Upload: "upload";
264
+ readonly Download: "download";
265
+ };
266
+ /** Failed file transfer. */
267
+ export interface FileTransferError {
268
+ code: string;
269
+ error: string;
270
+ current_digest?: string;
271
+ }
272
+ /** Ended file transfer outcome: the uploaded path and digest, the downloaded digest, or an error. */
273
+ export interface FileTransferResult {
274
+ path?: string;
275
+ digest?: string;
276
+ error?: FileTransferError;
277
+ }
278
+ /** v1 file tools. */
279
+ export interface FilesCapability {
280
+ enabled: boolean;
281
+ read_roots?: Array<string>;
282
+ write_roots?: Array<string>;
283
+ }
284
+ /** process.start io_mode. "pty" runs the command on a 24x80 pseudo-terminal: stdout is the PTY output, stdin writes go to the PTY and close_stdin is rejected. Requires process.pty. */
285
+ export type IOMode = 'pty';
286
+ export declare const IOMode: {
287
+ readonly Pty: "pty";
288
+ };
289
+ /** Why the executor withdrew an open interaction. */
290
+ export type InteractionCancelReason = 'resolved_locally' | 'turn_canceled' | 'expired' | 'tool_canceled';
291
+ export declare const InteractionCancelReason: {
292
+ readonly ResolvedLocally: "resolved_locally";
293
+ readonly TurnCanceled: "turn_canceled";
294
+ readonly Expired: "expired";
295
+ readonly ToolCanceled: "tool_canceled";
296
+ };
297
+ /** Interaction kinds; they map 1:1 to platform agent interactions. */
298
+ export type InteractionKind = 'permission' | 'question';
299
+ export declare const InteractionKind: {
300
+ readonly Permission: "permission";
301
+ readonly Question: "question";
302
+ };
303
+ /** How the platform resolved an interaction. allow/deny answer permission, answered answers question, expired and canceled close either kind without an answer. */
304
+ export type InteractionOutcome = 'allow' | 'deny' | 'answered' | 'expired' | 'canceled';
305
+ export declare const InteractionOutcome: {
306
+ readonly Allow: "allow";
307
+ readonly Deny: "deny";
308
+ readonly Answered: "answered";
309
+ readonly Expired: "expired";
310
+ readonly Canceled: "canceled";
311
+ };
312
+ /** Question shown to the user. */
313
+ export interface InteractionQuestion {
314
+ prompt: string;
315
+ options?: Array<InteractionQuestionOption>;
316
+ multi_select?: boolean;
317
+ allow_free_text?: boolean;
318
+ }
319
+ /** One answer option of a question interaction. */
320
+ export interface InteractionQuestionOption {
321
+ id: string;
322
+ label: string;
323
+ }
324
+ /** interaction.request result. Idempotent by interaction_id: a repeat returns the same platform interaction. */
325
+ export interface InteractionRequestResult {
326
+ accepted: boolean;
327
+ platform_interaction_id: string;
328
+ }
329
+ /** Who answered, for local audit. surface is the client that resolved it, for example desktop, mobile, web, slack. */
330
+ export interface InteractionResponder {
331
+ actor_id?: string;
332
+ surface?: string;
333
+ }
334
+ /** interaction.response result. accepted=false when the interaction is unknown or already resolved (first answer wins); the platform then marks its copy stale. */
335
+ export interface InteractionResponseResult {
336
+ accepted: boolean;
337
+ }
338
+ /** How long a permission grant lasts on the executor: this tool use only, or the rest of the session. */
339
+ export type InteractionScope = 'once' | 'session';
340
+ export declare const InteractionScope: {
341
+ readonly Once: "once";
342
+ readonly Session: "session";
343
+ };
344
+ /** JSON-RPC 2.0 error object. */
345
+ export interface JsonRpcError {
346
+ code: JsonRpcErrorCode;
347
+ message: string;
348
+ data?: JsonRpcErrorData;
349
+ }
350
+ /** Executor protocol JSON-RPC error codes. -32011..-32013 are v1.1 additions. */
351
+ export type JsonRpcErrorCode = -32700 | -32600 | -32601 | -32602 | -32603 | -32000 | -32001 | -32002 | -32003 | -32004 | -32005 | -32006 | -32007 | -32008 | -32009 | -32010 | -32011 | -32012 | -32013;
352
+ export declare const JsonRpcErrorCode: {
353
+ readonly ParseError: -32700;
354
+ readonly InvalidRequest: -32600;
355
+ readonly MethodNotFound: -32601;
356
+ readonly InvalidParams: -32602;
357
+ readonly InternalError: -32603;
358
+ readonly Unauthorized: -32000;
359
+ readonly Forbidden: -32001;
360
+ readonly NotFound: -32002;
361
+ readonly LeaseExpired: -32003;
362
+ readonly Timeout: -32004;
363
+ readonly Canceled: -32005;
364
+ readonly PayloadTooLarge: -32006;
365
+ readonly SessionNotActive: -32007;
366
+ readonly McpUnavailable: -32008;
367
+ readonly ExecutorBusy: -32009;
368
+ readonly UnsupportedProtocol: -32010;
369
+ readonly ResourceUnavailable: -32011;
370
+ readonly CapabilityUnavailable: -32012;
371
+ readonly Conflict: -32013;
372
+ };
373
+ /** JSON-RPC error.data. Members are code-specific; unknown members are ignored. */
374
+ export interface JsonRpcErrorData {
375
+ /** Capacity or timeout failure the caller should retry with backoff. */
376
+ retryable?: boolean;
377
+ detail?: string;
378
+ /** Missing capability for -32012, for example "tool:read" or "process.pty". */
379
+ capability?: string;
380
+ /** Machine-readable cause, for example "spawn_failed" for process.start. */
381
+ reason?: string;
382
+ /** bma.terminal.v1 error code for a failed terminal.* call. */
383
+ terminal_code?: string;
384
+ /** Agent session.event gap (-32013): the sequence the harness expects next. */
385
+ expected_sequence?: number;
386
+ }
387
+ /** JSON-RPC 2.0 error response envelope. */
388
+ export interface JsonRpcErrorResponse {
389
+ jsonrpc: '2.0';
390
+ id: JsonRpcId;
391
+ error: JsonRpcError;
392
+ }
393
+ /** JSON-RPC request id. Both peers use strings. */
394
+ export type JsonRpcId = string;
395
+ /** JSON-RPC 2.0 notification envelope (no id). */
396
+ export interface JsonRpcNotification {
397
+ jsonrpc: '2.0';
398
+ method: string;
399
+ params: Record<string, never>;
400
+ }
401
+ /** JSON-RPC 2.0 request envelope. */
402
+ export interface JsonRpcRequest {
403
+ jsonrpc: '2.0';
404
+ id: JsonRpcId;
405
+ method: string;
406
+ params: Record<string, never>;
407
+ }
408
+ /** JSON-RPC 2.0 success response envelope. */
409
+ export interface JsonRpcSuccessResponse {
410
+ jsonrpc: '2.0';
411
+ id: JsonRpcId;
412
+ result: unknown;
413
+ }
414
+ /** Fencing lease for a session assignment. */
415
+ export interface Lease {
416
+ token: string;
417
+ fencing_token: number;
418
+ }
419
+ /** Limits the executor must enforce, advertised in the v1.1 executor.register result (v1.1 §1.3). */
420
+ export interface Limits {
421
+ max_inflight_requests: number;
422
+ max_concurrent_process_reads: number;
423
+ max_process_read_bytes: number;
424
+ max_process_write_bytes: number;
425
+ max_processes_per_session: number;
426
+ max_artifact_bytes: number;
427
+ }
428
+ /** Environment-origin MCP servers. */
429
+ export interface McpCapability {
430
+ stdio?: boolean;
431
+ http?: boolean;
432
+ max_servers?: number;
433
+ }
434
+ /** Who connects the MCP server. environment means the executor starts/connects it; service means the harness connects. */
435
+ export type McpConnectionOrigin = 'service' | 'environment';
436
+ export declare const McpConnectionOrigin: {
437
+ readonly Service: "service";
438
+ readonly Environment: "environment";
439
+ };
440
+ /** MCP tool content block. Large binary content must go to artifact storage. */
441
+ export interface McpContentBlock {
442
+ type: 'text' | 'image' | 'resource';
443
+ text?: string;
444
+ data?: string;
445
+ mimeType?: string;
446
+ resource?: unknown;
447
+ }
448
+ export interface McpImplementation {
449
+ name: string;
450
+ version: string;
451
+ }
452
+ export interface McpInitializeParams {
453
+ protocolVersion: string;
454
+ capabilities: Record<string, unknown>;
455
+ clientInfo: McpImplementation;
456
+ }
457
+ export interface McpInitializeResult {
458
+ protocolVersion: string;
459
+ capabilities: Record<string, unknown>;
460
+ serverInfo: McpImplementation;
461
+ }
462
+ export interface McpJsonRpcError {
463
+ code: number;
464
+ message: string;
465
+ data?: unknown;
466
+ }
467
+ export interface McpJsonRpcErrorResponse {
468
+ jsonrpc: '2.0';
469
+ id: McpJsonRpcId;
470
+ error: McpJsonRpcError;
471
+ }
472
+ /** MCP JSON-RPC id. */
473
+ export type McpJsonRpcId = string | number;
474
+ export interface McpJsonRpcNotification {
475
+ jsonrpc: '2.0';
476
+ method: string;
477
+ params?: Record<string, unknown>;
478
+ }
479
+ export interface McpJsonRpcRequest {
480
+ jsonrpc: '2.0';
481
+ id: McpJsonRpcId;
482
+ method: string;
483
+ params?: Record<string, unknown>;
484
+ }
485
+ export interface McpJsonRpcSuccessResponse {
486
+ jsonrpc: '2.0';
487
+ id: McpJsonRpcId;
488
+ result: unknown;
489
+ }
490
+ export interface McpProgressParams {
491
+ progressToken: string | number;
492
+ progress: number;
493
+ total?: number;
494
+ }
495
+ export interface McpServerConfig {
496
+ server_key: string;
497
+ connection_origin: McpConnectionOrigin;
498
+ transport: McpServerTransport;
499
+ }
500
+ /** Transport for one MCP server. stdio requires command; http requires url. Fields for the other transport are omitted. */
501
+ export interface McpServerTransport {
502
+ type: McpTransportType;
503
+ /** stdio: absolute or allowlisted executable. No shell, no sh -c. */
504
+ command?: string;
505
+ args?: Array<string>;
506
+ /** stdio: working directory under the session workspace. */
507
+ cwd?: string;
508
+ env?: Record<string, string>;
509
+ timeout_ms?: number;
510
+ /** Pins the executable when supplied. */
511
+ command_sha256?: string;
512
+ /** http: Streamable HTTP MCP endpoint. */
513
+ url?: string;
514
+ }
515
+ export interface McpTool {
516
+ name: string;
517
+ description?: string;
518
+ inputSchema: Record<string, unknown>;
519
+ }
520
+ export interface McpToolsCallParams {
521
+ name: string;
522
+ arguments: Record<string, unknown>;
523
+ }
524
+ export interface McpToolsCallResult {
525
+ content: Array<McpContentBlock>;
526
+ isError?: boolean;
527
+ structuredContent?: unknown;
528
+ }
529
+ export interface McpToolsListParams {
530
+ cursor?: string;
531
+ }
532
+ export interface McpToolsListResult {
533
+ tools: Array<McpTool>;
534
+ nextCursor?: string | null;
535
+ }
536
+ export type McpTransportType = 'stdio' | 'http';
537
+ export declare const McpTransportType: {
538
+ readonly Stdio: "stdio";
539
+ readonly Http: "http";
540
+ };
541
+ /** Tool permission mode; always_ask means the harness already resolved approval. */
542
+ export type PermissionMode = 'always_allow' | 'always_ask';
543
+ export declare const PermissionMode: {
544
+ readonly AlwaysAllow: "always_allow";
545
+ readonly AlwaysAsk: "always_ask";
546
+ };
547
+ /** v1.1 process.* support. pty, file_transfer and git_credentials are additive: the harness only sends the matching process.start fields to an executor that set them, and fails the process explicitly otherwise. */
548
+ export interface ProcessCapability {
549
+ enabled: boolean;
550
+ max_processes?: number;
551
+ buffer_bytes?: number;
552
+ /** Accepts process.start io_mode "pty". */
553
+ pty?: boolean;
554
+ /** Accepts process.start file_transfer. */
555
+ file_transfer?: boolean;
556
+ /** Accepts process.start git_credentials. */
557
+ git_credentials?: boolean;
558
+ }
559
+ /** Replaces argv: the executor moves one file between the machine and the process BMA file endpoint and reports the outcome in ProcessState.file_transfer. Requires process.file_transfer. */
560
+ export interface ProcessFileTransfer {
561
+ direction: FileTransferDirection;
562
+ local_path: string;
563
+ }
564
+ /** process.list result. */
565
+ export interface ProcessListResult {
566
+ processes: Array<ProcessState>;
567
+ }
568
+ /** process.read result. */
569
+ export interface ProcessReadResult {
570
+ process_id: string;
571
+ stream: ProcessStream;
572
+ /** Base64 bytes from from_cursor to next_cursor. */
573
+ data: string;
574
+ from_cursor: number;
575
+ next_cursor: number;
576
+ earliest_cursor: number;
577
+ gap: boolean;
578
+ truncated: boolean;
579
+ eof: boolean;
580
+ state: ProcessStateName;
581
+ ended_at?: string;
582
+ reason?: string;
583
+ exit_code: number | null;
584
+ exit_signal: string | null;
585
+ file_transfer?: FileTransferResult;
586
+ }
587
+ /** Result of process.start/interrupt/terminate and one process.list entry. ended_at (RFC 3339, executor clock) is set once the process is no longer running; reason explains a "failed" state (for example "timeout"). A spawn failure never creates a state: it is the process.start error with data.reason "spawn_failed". */
588
+ export interface ProcessState {
589
+ process_id: string;
590
+ state: ProcessStateName;
591
+ pid?: number;
592
+ started_at?: string;
593
+ ended_at?: string;
594
+ reason?: string;
595
+ cursors: Cursors;
596
+ exit_code: number | null;
597
+ exit_signal: string | null;
598
+ stderr?: string;
599
+ accepted?: boolean;
600
+ file_transfer?: FileTransferResult;
601
+ }
602
+ /** Process state (v1.1 §3.3). */
603
+ export type ProcessStateName = 'running' | 'exited' | 'failed' | 'killed';
604
+ export declare const ProcessStateName: {
605
+ readonly Running: "running";
606
+ readonly Exited: "exited";
607
+ readonly Failed: "failed";
608
+ readonly Killed: "killed";
609
+ };
610
+ /** Process output stream (v1.1 §3.2). */
611
+ export type ProcessStream = 'stdout' | 'stderr';
612
+ export declare const ProcessStream: {
613
+ readonly Stdout: "stdout";
614
+ readonly Stderr: "stderr";
615
+ };
616
+ /** process.write result. */
617
+ export interface ProcessWriteResult {
618
+ accepted: boolean;
619
+ }
620
+ /** Value of both the WebSocket subprotocol and executor.register protocol. A v1.1 server serves v1 executors and never sends them v1.1 methods. */
621
+ export type ProtocolVersion = 'bma.executor.v1' | 'bma.executor.v1.1';
622
+ export declare const ProtocolVersion: {
623
+ readonly BmaExecutorV1: "bma.executor.v1";
624
+ readonly BmaExecutorV11: "bma.executor.v1.1";
625
+ };
626
+ /** session.assign result. */
627
+ export interface SessionAssignResult {
628
+ accepted: boolean;
629
+ session_id: string;
630
+ }
631
+ /** session.close result. */
632
+ export interface SessionCloseResult {
633
+ closed: boolean;
634
+ }
635
+ /** A turn-level error. A failed turn still ends with session.status_idle turn_outcome=failed. */
636
+ export interface SessionErrorEvent {
637
+ type: 'session.error';
638
+ error: AgentErrorInfo;
639
+ }
640
+ /** Durable session event emitted by the executor. */
641
+ export interface SessionEvent {
642
+ type: SessionEventType;
643
+ tool_use_id?: string;
644
+ content?: Array<ContentBlock>;
645
+ is_error?: boolean;
646
+ }
647
+ /** session.event result. */
648
+ export interface SessionEventResult {
649
+ accepted: boolean;
650
+ event_id: string;
651
+ /** Agent sessions: highest contiguous sequence the platform has persisted for the session. A duplicate event is accepted and reports the current value. */
652
+ acked_sequence?: number;
653
+ }
654
+ /** Durable event types an executor may emit. Event names follow Anthropic Managed Agents; the executor must not invent new names. A tool executor emits agent.tool_result only; an agent executor (capability agent) emits every type, shaped as schemas/agent.json AgentEvent. */
655
+ export type SessionEventType = 'agent.tool_result' | 'agent.message' | 'agent.thinking' | 'agent.tool_use' | 'agent.mcp_tool_use' | 'agent.mcp_tool_result' | 'session.status_running' | 'session.status_idle' | 'session.error';
656
+ export declare const SessionEventType: {
657
+ readonly AgentToolResult: "agent.tool_result";
658
+ readonly AgentMessage: "agent.message";
659
+ readonly AgentThinking: "agent.thinking";
660
+ readonly AgentToolUse: "agent.tool_use";
661
+ readonly AgentMcpToolUse: "agent.mcp_tool_use";
662
+ readonly AgentMcpToolResult: "agent.mcp_tool_result";
663
+ readonly SessionStatusRunning: "session.status_running";
664
+ readonly SessionStatusIdle: "session.status_idle";
665
+ readonly SessionError: "session.error";
666
+ };
667
+ /** A memory store mounted into the session workspace. */
668
+ export interface SessionMemoryResource {
669
+ type: 'memory_store';
670
+ memory_store_id: string;
671
+ mount_path: string;
672
+ }
673
+ /** Lifecycle status reported by the executor. */
674
+ export type SessionStatus = 'starting' | 'running' | 'idle' | 'stopping' | 'stopped' | 'error';
675
+ export declare const SessionStatus: {
676
+ readonly Starting: "starting";
677
+ readonly Running: "running";
678
+ readonly Idle: "idle";
679
+ readonly Stopping: "stopping";
680
+ readonly Stopped: "stopped";
681
+ readonly Error: "error";
682
+ };
683
+ /** The turn ended. It is the last event of its turn_id; the platform publishes the turn as finished only after it accepted this event and every lower sequence. */
684
+ export interface SessionStatusIdleEvent {
685
+ type: 'session.status_idle';
686
+ stop_reason: StopReason;
687
+ turn_outcome: TurnOutcome;
688
+ }
689
+ /** The local agent started working on the turn. */
690
+ export interface SessionStatusRunningEvent {
691
+ type: 'session.status_running';
692
+ }
693
+ /** session.stop result. */
694
+ export interface SessionStopResult {
695
+ stopped: boolean;
696
+ }
697
+ /** v1 one-shot shell tools. */
698
+ export interface ShellCapability {
699
+ enabled: boolean;
700
+ }
701
+ /** skill.install result. state is "ready", or "failed" with error_code and error. */
702
+ export interface SkillInstallResult {
703
+ state: 'ready' | 'failed';
704
+ error_code?: string;
705
+ error?: string;
706
+ }
707
+ /** skill.install support. Machine-scoped executors only. */
708
+ export interface SkillsCapability {
709
+ install: boolean;
710
+ }
711
+ /** process.start stderr mode. "merge" redirects stderr into stdout at the OS level so one cursor covers both. */
712
+ export type StderrMode = 'merge';
713
+ export declare const StderrMode: {
714
+ readonly Merge: "merge";
715
+ };
716
+ /** process.start stdin mode. Empty or "closed" closes stdin at start; "open" keeps it open for process.write. */
717
+ export type StdinMode = 'open' | 'closed';
718
+ export declare const StdinMode: {
719
+ readonly Open: "open";
720
+ readonly Closed: "closed";
721
+ };
722
+ /** Why the turn stopped. */
723
+ export interface StopReason {
724
+ type: StopReasonType;
725
+ }
726
+ /** Anthropic stop_reason types an executor may report. requires_action is not in the list: the platform projects it from open interactions. */
727
+ export type StopReasonType = 'end_turn' | 'retries_exhausted';
728
+ export declare const StopReasonType: {
729
+ readonly EndTurn: "end_turn";
730
+ readonly RetriesExhausted: "retries_exhausted";
731
+ };
732
+ /** terminal.attach result, returned after the host socket is connected and the attached frame was written on it. */
733
+ export interface TerminalAttachResult {
734
+ accepted: boolean;
735
+ writer_epoch: number;
736
+ }
737
+ /** v1.1 terminal.* support. Machine-scoped executors only. */
738
+ export interface TerminalCapability {
739
+ enabled: boolean;
740
+ kinds?: Array<string>;
741
+ max_sessions?: number;
742
+ }
743
+ /** terminal.close result. Idempotent: closing an unknown or closed terminal returns closed=true. */
744
+ export interface TerminalCloseResult {
745
+ closed: boolean;
746
+ exit_code?: number | null;
747
+ }
748
+ /** JSON-RPC error.data of a failed terminal.* call. terminal_code is the bma.terminal.v1 code the harness relays to the attach (for example terminal_writer_busy). */
749
+ export interface TerminalErrorData {
750
+ terminal_code?: string;
751
+ }
752
+ /** Outbound host socket for one attach. The ticket is a single-use, short-lived bearer credential sent only in the Authorization header, never in the URL. */
753
+ export interface TerminalHost {
754
+ url: string;
755
+ ticket: string;
756
+ }
757
+ /** terminal.open result. epoch starts at 1 and increments when the executor recreates the PTY under the same terminal_id; attach is fenced by it. */
758
+ export interface TerminalOpenResult {
759
+ terminal_id: string;
760
+ epoch: number;
761
+ pid: number;
762
+ rows: number;
763
+ cols: number;
764
+ earliest_seq: number;
765
+ latest_seq: number;
766
+ created_at: string;
767
+ }
768
+ /** tool.cancel result. */
769
+ export interface ToolCancelResult {
770
+ canceled: boolean;
771
+ }
772
+ /** Built-in tool input. The selected tool decides which members are meaningful; unknown members are ignored. */
773
+ export interface ToolInput {
774
+ command?: string;
775
+ cwd?: string;
776
+ timeout_ms?: number;
777
+ env?: Record<string, string>;
778
+ path?: string;
779
+ offset?: number;
780
+ limit?: number;
781
+ content?: string;
782
+ old_string?: string;
783
+ new_string?: string;
784
+ pattern?: string;
785
+ glob?: string;
786
+ display?: string;
787
+ action?: ComputerAction;
788
+ }
789
+ /** Built-in tool names. bmad serves bash only and answers -32012 for the rest. */
790
+ export type ToolName = 'bash' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'list_files' | 'computer_observe' | 'computer_action';
791
+ export declare const ToolName: {
792
+ readonly Bash: "bash";
793
+ readonly Read: "read";
794
+ readonly Write: "write";
795
+ readonly Edit: "edit";
796
+ readonly Glob: "glob";
797
+ readonly Grep: "grep";
798
+ readonly ListFiles: "list_files";
799
+ readonly ComputerObserve: "computer_observe";
800
+ readonly ComputerAction: "computer_action";
801
+ };
802
+ /** Tool outcome. */
803
+ export type ToolOutcome = 'succeeded' | 'failed' | 'canceled';
804
+ export declare const ToolOutcome: {
805
+ readonly Succeeded: "succeeded";
806
+ readonly Failed: "failed";
807
+ readonly Canceled: "canceled";
808
+ };
809
+ /** Tool permission resolved by the harness. */
810
+ export interface ToolPermission {
811
+ mode: PermissionMode;
812
+ }
813
+ /** turn.cancel result. canceled=false when the turn is unknown or already ended; the turn still ends with its own session.status_idle event. */
814
+ export interface TurnCancelResult {
815
+ canceled: boolean;
816
+ }
817
+ /** BMA extension on session.status_idle: how the turn ended. */
818
+ export type TurnOutcome = 'completed' | 'canceled' | 'failed';
819
+ export declare const TurnOutcome: {
820
+ readonly Completed: "completed";
821
+ readonly Canceled: "canceled";
822
+ readonly Failed: "failed";
823
+ };
824
+ /** turn.start result. Idempotent by turn_id: a repeated turn.start for a turn the executor already accepted returns the same result without starting a second run. */
825
+ export interface TurnStartResult {
826
+ accepted: boolean;
827
+ turn_id: string;
828
+ /** Opaque local session handle (for example the local agent's conversation id). The platform stores it and sends it back in the next turn.start so the executor can resume the local conversation after a restart. */
829
+ executor_session_ref: string;
830
+ /** true when the executor continued an existing local conversation, false when it started a new one. */
831
+ resumed: boolean;
832
+ effective: AgentTurnConfig;
833
+ }
834
+ /** workspace.backup result. digest and size_bytes describe the archive as the server stored it; skipped counts entries that could not be read (missing from the archive). */
835
+ export interface WorkspaceBackupResult {
836
+ state: 'uploaded' | 'unchanged' | 'failed';
837
+ fingerprint?: string;
838
+ digest?: string;
839
+ size_bytes?: number;
840
+ entries?: number;
841
+ skipped?: number;
842
+ error?: string;
843
+ }
844
+ /** workspace.backup support and the startup restore of a pending backup. Machine-scoped executors only. */
845
+ export interface WorkspaceCapability {
846
+ backup: boolean;
847
+ }
848
+ /** Params object of executor.register. */
849
+ export interface ExecutorRegisterParams {
850
+ protocol: ProtocolVersion;
851
+ /** Selfhost environment id; empty for a machine-scoped executor. */
852
+ environment_id: string;
853
+ executor: ExecutorInfo;
854
+ capabilities: Capabilities;
855
+ resume?: ExecutorResume;
856
+ }
857
+ /** Params object of executor.heartbeat. */
858
+ export interface ExecutorHeartbeatParams {
859
+ connection_id: string;
860
+ active_sessions: Array<string>;
861
+ load?: ExecutorLoad;
862
+ }
863
+ /** Params object of executor.capabilities.update. */
864
+ export interface ExecutorCapabilitiesUpdateParams {
865
+ capabilities: Capabilities;
866
+ }
867
+ /** Params object of executor.drain. */
868
+ export interface ExecutorDrainParams {
869
+ reason: string;
870
+ deadline_ms?: number;
871
+ }
872
+ /** Params object of executor.close. */
873
+ export interface ExecutorCloseParams {
874
+ reason: string;
875
+ }
876
+ /** Params object of session.assign. */
877
+ export interface SessionAssignParams {
878
+ session_id: string;
879
+ work_id: string;
880
+ agent_id?: string;
881
+ environment_id: string;
882
+ deadline_ms?: number;
883
+ lease: Lease;
884
+ resources?: Array<SessionMemoryResource>;
885
+ mcp_servers?: Array<McpServerConfig>;
886
+ metadata?: Record<string, string>;
887
+ }
888
+ /** Params object of session.ready. */
889
+ export interface SessionReadyParams {
890
+ session_id: string;
891
+ work_id: string;
892
+ lease_token: string;
893
+ }
894
+ /** Params object of session.event. */
895
+ export interface SessionEventParams {
896
+ session_id: string;
897
+ /** Agent sessions; the turn that produced the event. */
898
+ turn_id?: string;
899
+ /** Agent sessions; executor-assigned, unique within the session, stable across resends. */
900
+ event_id?: string;
901
+ /** Agent sessions; starts at 1 and increases by 1 per durable event within the session. */
902
+ sequence?: number;
903
+ event: SessionEvent;
904
+ }
905
+ /** Params object of session.status. */
906
+ export interface SessionStatusParams {
907
+ session_id: string;
908
+ status: SessionStatus;
909
+ detail?: string;
910
+ }
911
+ /** Params object of session.stop. */
912
+ export interface SessionStopParams {
913
+ session_id: string;
914
+ reason: string;
915
+ deadline_ms?: number;
916
+ }
917
+ /** Params object of session.ended. */
918
+ export interface SessionEndedParams {
919
+ session_id: string;
920
+ reason: string;
921
+ }
922
+ /** Params object of tool.call. */
923
+ export interface ToolCallParams {
924
+ session_id: string;
925
+ tool_call_id: string;
926
+ tool: ToolName;
927
+ input: ToolInput;
928
+ deadline_ms?: number;
929
+ permission?: ToolPermission;
930
+ }
931
+ /** Params object of tool.result. */
932
+ export interface ToolResultParams {
933
+ session_id: string;
934
+ tool_call_id: string;
935
+ outcome: ToolOutcome;
936
+ is_error: boolean;
937
+ content: Array<ContentBlock>;
938
+ duration_ms?: number;
939
+ artifacts?: Array<ArtifactRef>;
940
+ }
941
+ /** Params object of tool.cancel. */
942
+ export interface ToolCancelParams {
943
+ session_id: string;
944
+ tool_call_id: string;
945
+ reason?: string;
946
+ }
947
+ /** Params object of tool.progress. */
948
+ export interface ToolProgressParams {
949
+ session_id: string;
950
+ tool_call_id: string;
951
+ message: string;
952
+ }
953
+ /** Params object of process.start. */
954
+ export interface ProcessStartParams {
955
+ session_id: string;
956
+ process_id: string;
957
+ /** Command and arguments (at most 256 entries, 4 KiB each, 16 KiB total). Must be empty when file_transfer is set. */
958
+ argv: Array<string>;
959
+ cwd?: string;
960
+ env?: Record<string, string>;
961
+ stdin?: StdinMode;
962
+ /** Empty keeps separate stdout/stderr streams. */
963
+ stderr?: StderrMode;
964
+ wait_ms?: number;
965
+ /** Kills the process and ends it as failed with reason "timeout". */
966
+ timeout_ms?: number;
967
+ metadata?: Record<string, string>;
968
+ /** Requires capability process.pty. */
969
+ io_mode?: IOMode;
970
+ /** Requires capability process.file_transfer. Excludes argv entries, io_mode and git_credentials. */
971
+ file_transfer?: ProcessFileTransfer;
972
+ /** Installs a per-process Git credential helper for https://github.com that fetches short-lived tokens for this process while it runs. Requires capability process.git_credentials. */
973
+ git_credentials?: boolean;
974
+ }
975
+ /** Params object of process.read. */
976
+ export interface ProcessReadParams {
977
+ session_id: string;
978
+ process_id: string;
979
+ stream: ProcessStream;
980
+ cursor: number;
981
+ max_bytes?: number;
982
+ wait_ms?: number;
983
+ }
984
+ /** Params object of process.write. */
985
+ export interface ProcessWriteParams {
986
+ session_id: string;
987
+ process_id: string;
988
+ data?: string;
989
+ close_stdin?: boolean;
990
+ }
991
+ /** Params object of process.interrupt and process.terminate. */
992
+ export interface ProcessSignalParams {
993
+ session_id: string;
994
+ process_id: string;
995
+ /** Only meaningful for process.terminate. */
996
+ grace_ms?: number | null;
997
+ }
998
+ /** Params object of process.list. */
999
+ export interface ProcessListParams {
1000
+ session_id: string;
1001
+ }
1002
+ /** Params object of process.status. */
1003
+ export interface ProcessStatusParams {
1004
+ session_id: string;
1005
+ process_id: string;
1006
+ state: ProcessStateName;
1007
+ exit_code?: number | null;
1008
+ exit_signal?: string | null;
1009
+ ended_at?: string;
1010
+ reason?: string;
1011
+ observed_at: string;
1012
+ }
1013
+ /** Params object of terminal.open. */
1014
+ export interface TerminalOpenParams {
1015
+ terminal_id: string;
1016
+ /** human or agent. */
1017
+ kind: string;
1018
+ shell?: string;
1019
+ argv?: Array<string>;
1020
+ cwd?: string;
1021
+ env?: Record<string, string>;
1022
+ rows?: number;
1023
+ cols?: number;
1024
+ }
1025
+ /** Params object of terminal.attach. */
1026
+ export interface TerminalAttachParams {
1027
+ terminal_id: string;
1028
+ epoch: number;
1029
+ stream_id: string;
1030
+ can_write: boolean;
1031
+ from_seq: number;
1032
+ ack_seq: number;
1033
+ host: TerminalHost;
1034
+ }
1035
+ /** Params object of terminal.close. */
1036
+ export interface TerminalCloseParams {
1037
+ terminal_id: string;
1038
+ reason?: string;
1039
+ }
1040
+ /** Params object of skill.install. */
1041
+ export interface SkillInstallParams {
1042
+ machine_id: string;
1043
+ skill_id: string;
1044
+ revision_id: string;
1045
+ digest: string;
1046
+ download_token: string;
1047
+ /** Unix seconds. */
1048
+ download_expires_at: number;
1049
+ }
1050
+ /** Params object of workspace.backup. */
1051
+ export interface WorkspaceBackupParams {
1052
+ backup_id: string;
1053
+ paths: Array<string>;
1054
+ exclude?: Array<string>;
1055
+ skip_if_fingerprint?: string;
1056
+ }
1057
+ /** Params object of turn.start. */
1058
+ export interface TurnStartParams {
1059
+ /** Platform session id. */
1060
+ session_id: string;
1061
+ turn_id: string;
1062
+ /** Platform input id of the user message that starts the turn. */
1063
+ input_id: string;
1064
+ input: Array<AgentInputBlock>;
1065
+ executor_session_ref?: string;
1066
+ config?: AgentTurnConfig;
1067
+ deadline_ms?: number;
1068
+ metadata?: Record<string, string>;
1069
+ }
1070
+ /** Params object of turn.input. */
1071
+ export interface TurnInputParams {
1072
+ session_id: string;
1073
+ turn_id: string;
1074
+ input_id: string;
1075
+ input: Array<AgentInputBlock>;
1076
+ }
1077
+ /** Params object of turn.cancel. */
1078
+ export interface TurnCancelParams {
1079
+ session_id: string;
1080
+ turn_id: string;
1081
+ reason?: string;
1082
+ }
1083
+ /** Params object of session.close. */
1084
+ export interface SessionCloseParams {
1085
+ session_id: string;
1086
+ reason: string;
1087
+ }
1088
+ /** Params object of session.event_delta. */
1089
+ export interface SessionEventDeltaParams {
1090
+ session_id: string;
1091
+ turn_id: string;
1092
+ event_id: string;
1093
+ event_type: EventDeltaType;
1094
+ /** Content block index within the event. */
1095
+ index: number;
1096
+ /** Text appended to the block. */
1097
+ text: string;
1098
+ }
1099
+ /** Params object of interaction.request. */
1100
+ export interface InteractionRequestParams {
1101
+ session_id: string;
1102
+ turn_id: string;
1103
+ /** Executor-assigned, unique within the session. */
1104
+ interaction_id: string;
1105
+ kind: InteractionKind;
1106
+ /** Required for permission. */
1107
+ tool_use_id?: string;
1108
+ tool_name?: string;
1109
+ tool_input?: Record<string, unknown>;
1110
+ /** Grant scopes the user may pick for permission; defaults to once. */
1111
+ scopes?: Array<InteractionScope>;
1112
+ /** Required for question. */
1113
+ question?: InteractionQuestion;
1114
+ /** RFC 3339 time after which the executor stops waiting. */
1115
+ expires_at?: string;
1116
+ }
1117
+ /** Params object of interaction.response. */
1118
+ export interface InteractionResponseParams {
1119
+ session_id: string;
1120
+ interaction_id: string;
1121
+ outcome: InteractionOutcome;
1122
+ /** Granted scope for allow. */
1123
+ scope?: InteractionScope;
1124
+ deny_message?: string;
1125
+ /** Selected option ids or free text for answered. */
1126
+ answers?: Array<string>;
1127
+ responder?: InteractionResponder;
1128
+ }
1129
+ /** Params object of interaction.cancel. */
1130
+ export interface InteractionCancelParams {
1131
+ session_id: string;
1132
+ interaction_id: string;
1133
+ reason: InteractionCancelReason;
1134
+ }
1135
+ /** Every executor protocol method. */
1136
+ export type MethodName = 'executor.register' | 'executor.heartbeat' | 'executor.capabilities.update' | 'executor.drain' | 'executor.close' | 'session.assign' | 'session.ready' | 'session.event' | 'session.status' | 'session.stop' | 'session.ended' | 'tool.call' | 'tool.result' | 'tool.cancel' | 'tool.progress' | 'process.start' | 'process.read' | 'process.write' | 'process.interrupt' | 'process.terminate' | 'process.list' | 'process.status' | 'terminal.open' | 'terminal.attach' | 'terminal.close' | 'skill.install' | 'workspace.backup' | 'turn.start' | 'turn.input' | 'turn.cancel' | 'session.close' | 'session.event_delta' | 'interaction.request' | 'interaction.response' | 'interaction.cancel';
1137
+ export type ExecutorToHarnessRequestMethod = 'executor.register' | 'executor.heartbeat' | 'session.ready' | 'session.event' | 'session.ended' | 'tool.result' | 'interaction.request' | 'interaction.cancel';
1138
+ export type ExecutorToHarnessNotificationMethod = 'executor.capabilities.update' | 'executor.close' | 'session.status' | 'tool.progress' | 'process.status' | 'session.event_delta';
1139
+ export type HarnessToExecutorRequestMethod = 'executor.drain' | 'session.assign' | 'session.stop' | 'tool.call' | 'tool.cancel' | 'process.start' | 'process.read' | 'process.write' | 'process.interrupt' | 'process.terminate' | 'process.list' | 'terminal.open' | 'terminal.attach' | 'terminal.close' | 'skill.install' | 'workspace.backup' | 'turn.start' | 'turn.input' | 'turn.cancel' | 'session.close' | 'interaction.response';
1140
+ export type HarnessToExecutorNotificationMethod = 'executor.close';
1141
+ export interface MethodParamsMap {
1142
+ 'executor.register': ExecutorRegisterParams;
1143
+ 'executor.heartbeat': ExecutorHeartbeatParams;
1144
+ 'executor.capabilities.update': ExecutorCapabilitiesUpdateParams;
1145
+ 'executor.drain': ExecutorDrainParams;
1146
+ 'executor.close': ExecutorCloseParams;
1147
+ 'session.assign': SessionAssignParams;
1148
+ 'session.ready': SessionReadyParams;
1149
+ 'session.event': SessionEventParams;
1150
+ 'session.status': SessionStatusParams;
1151
+ 'session.stop': SessionStopParams;
1152
+ 'session.ended': SessionEndedParams;
1153
+ 'tool.call': ToolCallParams;
1154
+ 'tool.result': ToolResultParams;
1155
+ 'tool.cancel': ToolCancelParams;
1156
+ 'tool.progress': ToolProgressParams;
1157
+ 'process.start': ProcessStartParams;
1158
+ 'process.read': ProcessReadParams;
1159
+ 'process.write': ProcessWriteParams;
1160
+ 'process.interrupt': ProcessSignalParams;
1161
+ 'process.terminate': ProcessSignalParams;
1162
+ 'process.list': ProcessListParams;
1163
+ 'process.status': ProcessStatusParams;
1164
+ 'terminal.open': TerminalOpenParams;
1165
+ 'terminal.attach': TerminalAttachParams;
1166
+ 'terminal.close': TerminalCloseParams;
1167
+ 'skill.install': SkillInstallParams;
1168
+ 'workspace.backup': WorkspaceBackupParams;
1169
+ 'turn.start': TurnStartParams;
1170
+ 'turn.input': TurnInputParams;
1171
+ 'turn.cancel': TurnCancelParams;
1172
+ 'session.close': SessionCloseParams;
1173
+ 'session.event_delta': SessionEventDeltaParams;
1174
+ 'interaction.request': InteractionRequestParams;
1175
+ 'interaction.response': InteractionResponseParams;
1176
+ 'interaction.cancel': InteractionCancelParams;
1177
+ }
1178
+ export interface MethodResultMap {
1179
+ 'executor.register': ExecutorRegisterResult;
1180
+ 'executor.heartbeat': ExecutorHeartbeatResult;
1181
+ 'executor.drain': ExecutorDrainResult;
1182
+ 'session.assign': SessionAssignResult;
1183
+ 'session.ready': Ack;
1184
+ 'session.event': SessionEventResult;
1185
+ 'session.stop': SessionStopResult;
1186
+ 'session.ended': Ack;
1187
+ 'tool.call': Ack;
1188
+ 'tool.result': Ack;
1189
+ 'tool.cancel': ToolCancelResult;
1190
+ 'process.start': ProcessState;
1191
+ 'process.read': ProcessReadResult;
1192
+ 'process.write': ProcessWriteResult;
1193
+ 'process.interrupt': ProcessState;
1194
+ 'process.terminate': ProcessState;
1195
+ 'process.list': ProcessListResult;
1196
+ 'terminal.open': TerminalOpenResult;
1197
+ 'terminal.attach': TerminalAttachResult;
1198
+ 'terminal.close': TerminalCloseResult;
1199
+ 'skill.install': SkillInstallResult;
1200
+ 'workspace.backup': WorkspaceBackupResult;
1201
+ 'turn.start': TurnStartResult;
1202
+ 'turn.input': Ack;
1203
+ 'turn.cancel': TurnCancelResult;
1204
+ 'session.close': SessionCloseResult;
1205
+ 'interaction.request': InteractionRequestResult;
1206
+ 'interaction.response': InteractionResponseResult;
1207
+ 'interaction.cancel': Ack;
1208
+ }
1209
+ /** since is the first protocol that has the method; capability is the capability bit the harness checks before sending it. */
1210
+ export interface MethodSpec {
1211
+ readonly name: MethodName;
1212
+ readonly direction: 'executor-to-harness' | 'harness-to-executor' | 'bidirectional';
1213
+ readonly kind: 'request' | 'notification';
1214
+ readonly since: ProtocolVersion;
1215
+ readonly capability: string | null;
1216
+ readonly idempotentBy: string | null;
1217
+ }
1218
+ export declare const methods: Readonly<Record<MethodName, MethodSpec>>;