| 1 | // @generated from the Rust protocol types in crates/engine/src/extension_host/protocol.rs |
| 2 | // by `extension_host::protocol::tests`. Do not edit: change the Rust side, re-record with |
| 3 | // CODEWHALE_CONFORMANCE_UPDATE=1 cargo test -p codewhale-tui --lib extension_host::protocol |
| 4 | // and rebuild dist/ with `npm run build`. |
| 5 | |
| 6 | export const PROTOCOL_VERSION = 1 |
| 7 | export const MAGIC_ASCII = 'CWX1' |
| 8 | export const HEADER_LEN = 8 |
| 9 | export const MAX_FRAME = 33554432 |
| 10 | export const MAX_INFLIGHT = 256 |
| 11 | |
| 12 | export const IMAGE_LIMITS = { |
| 13 | maxImageBytes: 5242880, |
| 14 | maxImagesPerMessage: 1, |
| 15 | maxMessageImageBytes: 5242880, |
| 16 | maxImagePixels: 33554432, |
| 17 | maxImageDimension: 8192, |
| 18 | mediaTypes: ['image/png', 'image/jpeg', 'image/webp', 'image/gif'] as const, |
| 19 | } as const |
| 20 | |
| 21 | /** JSON-RPC error codes used on this channel. */ |
| 22 | export const ErrorCode = { |
| 23 | ParseError: -32700, |
| 24 | InvalidRequest: -32600, |
| 25 | MethodNotFound: -32601, |
| 26 | InvalidParams: -32602, |
| 27 | Internal: -32603, |
| 28 | ExecutionFailed: -32000, |
| 29 | NotAvailable: -32001, |
| 30 | Refused: -32002, |
| 31 | Denied: -32003, |
| 32 | Cancelled: -32800, |
| 33 | } as const |
| 34 | |
| 35 | export type Direction = 'core_to_host' | 'host_to_core' |
| 36 | |
| 37 | export const DSH_SERVICES = ['workspace', 'llm', 'network', 'settings', 'catalog', 'terminal', 'remote', 'attachments', 'plugins'] as const |
| 38 | export type DshService = typeof DSH_SERVICES[number] |
| 39 | |
| 40 | /** Every method either side may send, and the trust tiers it is allowed on; nothing else is admitted. */ |
| 41 | export const METHODS = [ |
| 42 | { name: 'host/initialize', direction: 'core_to_host', request: true, params: 'InitializeParams', tiers: ['plugin', 'builtin'] }, |
| 43 | { name: 'host/ping', direction: 'core_to_host', request: true, params: 'EmptyParams', tiers: ['plugin', 'builtin'] }, |
| 44 | { name: 'host/shutdown', direction: 'core_to_host', request: true, params: 'EmptyParams', tiers: ['plugin', 'builtin'] }, |
| 45 | { name: 'ext/activate', direction: 'core_to_host', request: true, params: 'ActivateParams', tiers: ['plugin', 'builtin'] }, |
| 46 | { name: 'ext/deactivate', direction: 'core_to_host', request: true, params: 'DeactivateParams', tiers: ['plugin', 'builtin'] }, |
| 47 | { name: 'tool/call', direction: 'core_to_host', request: true, params: 'ToolCallParams', tiers: ['plugin', 'builtin'] }, |
| 48 | { name: 'command/run', direction: 'core_to_host', request: true, params: 'CommandRunParams', tiers: ['plugin', 'builtin'] }, |
| 49 | { name: 'hook/evaluate', direction: 'core_to_host', request: true, params: 'HookEvaluateParams', tiers: ['plugin', 'builtin'] }, |
| 50 | { name: 'plugin_route/dispatch', direction: 'core_to_host', request: true, params: 'PluginRouteDispatchParams', tiers: ['plugin', 'builtin'] }, |
| 51 | { name: 'mcp/open', direction: 'core_to_host', request: true, params: 'McpOpenParams', tiers: ['builtin'] }, |
| 52 | { name: 'mcp/request', direction: 'core_to_host', request: true, params: 'McpRequestParams', tiers: ['builtin'] }, |
| 53 | { name: 'mcp/close', direction: 'core_to_host', request: true, params: 'McpCloseParams', tiers: ['builtin'] }, |
| 54 | { name: 'harness/run', direction: 'core_to_host', request: true, params: 'HarnessRunParams', tiers: ['builtin'] }, |
| 55 | { name: '$/cancel', direction: 'core_to_host', request: false, params: 'CancelParams', tiers: ['plugin', 'builtin'] }, |
| 56 | { name: 'host/hello', direction: 'host_to_core', request: false, params: 'HelloParams', tiers: ['plugin', 'builtin'] }, |
| 57 | { name: 'host/ready', direction: 'host_to_core', request: false, params: 'EmptyParams', tiers: ['plugin', 'builtin'] }, |
| 58 | { name: 'registry/register', direction: 'host_to_core', request: true, params: 'RegisterParams', tiers: ['plugin', 'builtin'] }, |
| 59 | { name: 'registry/unregister', direction: 'host_to_core', request: true, params: 'UnregisterParams', tiers: ['plugin', 'builtin'] }, |
| 60 | { name: 'core/call', direction: 'host_to_core', request: true, params: 'CoreCallParams', tiers: ['plugin', 'builtin'] }, |
| 61 | { name: 'session/checkpoint', direction: 'host_to_core', request: true, params: 'SessionCheckpointParams', tiers: ['plugin', 'builtin'] }, |
| 62 | { name: 'user-questions/ask', direction: 'host_to_core', request: true, params: 'UserQuestionParams', tiers: ['plugin', 'builtin'] }, |
| 63 | { name: 'subagent/start', direction: 'host_to_core', request: true, params: 'SubagentStartParams', tiers: ['plugin', 'builtin'] }, |
| 64 | { name: 'subagent/result', direction: 'host_to_core', request: true, params: 'SubagentHandleParams', tiers: ['plugin', 'builtin'] }, |
| 65 | { name: 'subagent/dispose', direction: 'host_to_core', request: true, params: 'SubagentHandleParams', tiers: ['plugin', 'builtin'] }, |
| 66 | { name: 'subagent/prompt', direction: 'host_to_core', request: true, params: 'SubagentPromptParams', tiers: ['plugin', 'builtin'] }, |
| 67 | { name: 'dsh/broker', direction: 'host_to_core', request: true, params: 'DshBrokerParams', tiers: ['plugin', 'builtin'] }, |
| 68 | { name: 'proc/launch', direction: 'host_to_core', request: true, params: 'ProcLaunchParams', tiers: ['builtin'] }, |
| 69 | { name: 'proc/read', direction: 'host_to_core', request: true, params: 'ProcSessionParams', tiers: ['builtin'] }, |
| 70 | { name: 'proc/write', direction: 'host_to_core', request: true, params: 'ProcWriteParams', tiers: ['builtin'] }, |
| 71 | { name: 'proc/close', direction: 'host_to_core', request: true, params: 'ProcSessionParams', tiers: ['builtin'] }, |
| 72 | { name: 'net/start', direction: 'host_to_core', request: true, params: 'ProcLaunchParams', tiers: ['builtin'] }, |
| 73 | { name: 'net/fetch', direction: 'host_to_core', request: true, params: 'NetFetchParams', tiers: ['builtin'] }, |
| 74 | { name: 'net/read', direction: 'host_to_core', request: true, params: 'NetReadParams', tiers: ['builtin'] }, |
| 75 | { name: 'net/release', direction: 'host_to_core', request: true, params: 'NetReadParams', tiers: ['builtin'] }, |
| 76 | { name: 'net/close', direction: 'host_to_core', request: true, params: 'ProcSessionParams', tiers: ['builtin'] }, |
| 77 | { name: 'exec/redeem', direction: 'host_to_core', request: true, params: 'ExecutionRedeemParams', tiers: ['builtin'] }, |
| 78 | { name: 'ext/faulted', direction: 'host_to_core', request: false, params: 'FaultedParams', tiers: ['plugin', 'builtin'] }, |
| 79 | { name: 'log', direction: 'host_to_core', request: false, params: 'LogParams', tiers: ['plugin', 'builtin'] }, |
| 80 | { name: '$/cancel', direction: 'host_to_core', request: false, params: 'CancelParams', tiers: ['plugin', 'builtin'] }, |
| 81 | ] as const |
| 82 | |
| 83 | /** A field's wire kind: the Rust field's serde type, normalized for validation. */ |
| 84 | export type Kind = |
| 85 | | 'string' |
| 86 | | 'boolean' |
| 87 | | 'uint' |
| 88 | | 'integer' |
| 89 | | 'object' |
| 90 | | 'json' |
| 91 | | { readonly ref: string } |
| 92 | | { readonly enum: readonly string[] } |
| 93 | | { readonly items: Kind } |
| 94 | |
| 95 | /** An object's fields; `strict` is Rust's `deny_unknown_fields`. */ |
| 96 | export interface Shape { |
| 97 | readonly strict: boolean |
| 98 | readonly required: { readonly [field: string]: Kind } |
| 99 | readonly optional: { readonly [field: string]: Kind } |
| 100 | } |
| 101 | |
| 102 | /** Every method's params, and an error response's `error`. */ |
| 103 | export const SHAPES: { readonly [name: string]: Shape } = { |
| 104 | ActivateParams: { |
| 105 | strict: false, |
| 106 | required: { owner: { ref: 'OwnerRef' }, plugin_name: 'string', entry: { ref: 'EntryRef' } }, |
| 107 | optional: { scope: { ref: 'EntryRef' }, config: 'json', data_dir: 'string', bundled_first_party: 'boolean' }, |
| 108 | }, |
| 109 | CancelParams: { |
| 110 | strict: true, |
| 111 | required: { id: 'uint' }, |
| 112 | optional: {}, |
| 113 | }, |
| 114 | CommandRunParams: { |
| 115 | strict: false, |
| 116 | required: { handle: 'uint', command_id: 'string', raw_input: 'string', deadline_ms: 'uint' }, |
| 117 | optional: { workspace: 'string', session_id: 'string', agent_id: 'string', origin_turn_id: 'string' }, |
| 118 | }, |
| 119 | CoreCallParams: { |
| 120 | strict: true, |
| 121 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', name: 'string', input: 'json' }, |
| 122 | optional: {}, |
| 123 | }, |
| 124 | DeactivateParams: { |
| 125 | strict: false, |
| 126 | required: { owner: { ref: 'OwnerRef' } }, |
| 127 | optional: { entry: { ref: 'EntryRef' } }, |
| 128 | }, |
| 129 | DshBrokerParams: { |
| 130 | strict: true, |
| 131 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', service: 'string', method: 'string', input: 'json' }, |
| 132 | optional: {}, |
| 133 | }, |
| 134 | DshBrokerTicketWire: { |
| 135 | strict: true, |
| 136 | required: { service: 'string', ticket: 'string' }, |
| 137 | optional: {}, |
| 138 | }, |
| 139 | EmptyParams: { |
| 140 | strict: true, |
| 141 | required: {}, |
| 142 | optional: {}, |
| 143 | }, |
| 144 | EntryRef: { |
| 145 | strict: false, |
| 146 | required: { path: 'string', sha256: 'string' }, |
| 147 | optional: {}, |
| 148 | }, |
| 149 | ExecutionRedeemParams: { |
| 150 | strict: true, |
| 151 | required: { owner: { ref: 'OwnerRef' }, execution_id: 'string', ticket: 'string' }, |
| 152 | optional: {}, |
| 153 | }, |
| 154 | FaultedParams: { |
| 155 | strict: true, |
| 156 | required: { owner: { ref: 'OwnerRef' }, error: 'string' }, |
| 157 | optional: {}, |
| 158 | }, |
| 159 | HarnessRunParams: { |
| 160 | strict: true, |
| 161 | required: { owner: { ref: 'OwnerRef' }, execution_id: 'string', ticket: 'string', deadline_ms: 'uint' }, |
| 162 | optional: { hook: { ref: 'HookDispatchWire' } }, |
| 163 | }, |
| 164 | HelloParams: { |
| 165 | strict: true, |
| 166 | required: { protocol: { ref: 'ProtocolRange' }, host_version: 'string', bundle_sha256: 'string', runtime: { ref: 'HelloRuntime' }, tier: { enum: ['builtin', 'plugin'] }, builtin_modules: { items: { ref: 'ModuleDigestWire' } } }, |
| 167 | optional: { memory_limit_mib: 'uint' }, |
| 168 | }, |
| 169 | HelloRuntime: { |
| 170 | strict: true, |
| 171 | required: { name: 'string', version: 'string' }, |
| 172 | optional: {}, |
| 173 | }, |
| 174 | HookCallPayload: { |
| 175 | strict: true, |
| 176 | required: { name: 'string', call_id: 'string', input: 'json', mode: 'string', workspace: 'string', model: 'string' }, |
| 177 | optional: {}, |
| 178 | }, |
| 179 | HookDispatchWire: { |
| 180 | strict: true, |
| 181 | required: { event: 'string', dialect: 'string', point: 'string', query: 'string' }, |
| 182 | optional: { matcher: 'string' }, |
| 183 | }, |
| 184 | HookEvaluateParams: { |
| 185 | strict: true, |
| 186 | required: { handle: 'uint', event: 'string', payload: { ref: 'HookCallPayload' }, deadline_ms: 'uint' }, |
| 187 | optional: {}, |
| 188 | }, |
| 189 | HostLimits: { |
| 190 | strict: false, |
| 191 | required: { max_frame: 'uint', max_inflight: 'uint', dispose_deadline_ms: 'uint', activate_deadline_ms: 'uint' }, |
| 192 | optional: {}, |
| 193 | }, |
| 194 | InitializeParams: { |
| 195 | strict: false, |
| 196 | required: { protocol: 'uint', limits: { ref: 'HostLimits' } }, |
| 197 | optional: {}, |
| 198 | }, |
| 199 | LogParams: { |
| 200 | strict: true, |
| 201 | required: { level: 'string', msg: 'string' }, |
| 202 | optional: { plugin_id: 'string' }, |
| 203 | }, |
| 204 | McpCloseParams: { |
| 205 | strict: true, |
| 206 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', deadline_ms: 'uint' }, |
| 207 | optional: {}, |
| 208 | }, |
| 209 | McpHttpHeaders: { |
| 210 | strict: true, |
| 211 | required: {}, |
| 212 | optional: { accept: 'string', content_type: 'string', mcp_session_id: 'string', mcp_protocol_version: 'string', mcp_method: 'string', mcp_name: 'string' }, |
| 213 | }, |
| 214 | McpOpenParams: { |
| 215 | strict: true, |
| 216 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', launch_ticket: 'string', transport: 'string', initialize_grant: { ref: 'McpOperationGrant' }, initialized_grant: { ref: 'McpOperationGrant' }, client_version: 'string', deadline_ms: 'uint' }, |
| 217 | optional: { discover_grant: { ref: 'McpOperationGrant' } }, |
| 218 | }, |
| 219 | McpOperationGrant: { |
| 220 | strict: true, |
| 221 | required: { ticket: 'string', operation_id: 'string', method: 'string', params: 'json' }, |
| 222 | optional: { wire_id: 'string' }, |
| 223 | }, |
| 224 | McpRequestParams: { |
| 225 | strict: true, |
| 226 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', grant: { ref: 'McpOperationGrant' }, deadline_ms: 'uint' }, |
| 227 | optional: {}, |
| 228 | }, |
| 229 | ModuleDigestWire: { |
| 230 | strict: true, |
| 231 | required: { id: 'string', sha256: 'string' }, |
| 232 | optional: {}, |
| 233 | }, |
| 234 | NetFetchParams: { |
| 235 | strict: true, |
| 236 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', url: 'string', method: 'string', headers: { ref: 'McpHttpHeaders' } }, |
| 237 | optional: { frame: 'json', ticket: 'string', operation_id: 'string' }, |
| 238 | }, |
| 239 | NetReadParams: { |
| 240 | strict: true, |
| 241 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', response_id: 'string' }, |
| 242 | optional: {}, |
| 243 | }, |
| 244 | OwnerRef: { |
| 245 | strict: true, |
| 246 | required: { plugin_id: 'string', generation: 'uint', owner_token: 'string' }, |
| 247 | optional: {}, |
| 248 | }, |
| 249 | PluginRouteDispatchParams: { |
| 250 | strict: true, |
| 251 | required: { owner: { ref: 'OwnerRef' }, method: 'string', path: 'string', headers: { items: { ref: 'PluginRouteHeaderWire' } }, deadline_ms: 'uint' }, |
| 252 | optional: { query: 'string', body_base64: 'string' }, |
| 253 | }, |
| 254 | PluginRouteHeaderWire: { |
| 255 | strict: true, |
| 256 | required: { name: 'string', value: 'string' }, |
| 257 | optional: {}, |
| 258 | }, |
| 259 | ProcLaunchParams: { |
| 260 | strict: true, |
| 261 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', ticket: 'string' }, |
| 262 | optional: {}, |
| 263 | }, |
| 264 | ProcSessionParams: { |
| 265 | strict: true, |
| 266 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string' }, |
| 267 | optional: {}, |
| 268 | }, |
| 269 | ProcWriteParams: { |
| 270 | strict: true, |
| 271 | required: { owner: { ref: 'OwnerRef' }, session_id: 'string', frame: 'json' }, |
| 272 | optional: { ticket: 'string', operation_id: 'string' }, |
| 273 | }, |
| 274 | ProtocolRange: { |
| 275 | strict: true, |
| 276 | required: { min: 'uint', max: 'uint' }, |
| 277 | optional: {}, |
| 278 | }, |
| 279 | RegisterParams: { |
| 280 | strict: true, |
| 281 | required: { owner: { ref: 'OwnerRef' }, kind: { enum: ['tool', 'command', 'hook', 'prompt_section', 'prompt_template', 'skill_root', 'avatar_pack', 'shell_hook', 'mcp_server'] }, spec: { ref: 'RegisterSpecWire' } }, |
| 282 | optional: { scope: { ref: 'EntryRef' } }, |
| 283 | }, |
| 284 | RegisterSpecWire: { |
| 285 | strict: true, |
| 286 | required: { name: 'string', description: 'string' }, |
| 287 | optional: { input_schema: 'object', argument_hint: 'string' }, |
| 288 | }, |
| 289 | RpcErrorWire: { |
| 290 | strict: true, |
| 291 | required: { code: 'integer', message: 'string' }, |
| 292 | optional: { data: 'json' }, |
| 293 | }, |
| 294 | SessionCheckpointParams: { |
| 295 | strict: true, |
| 296 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string' }, |
| 297 | optional: {}, |
| 298 | }, |
| 299 | SubagentHandleParams: { |
| 300 | strict: true, |
| 301 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', child_id: 'string' }, |
| 302 | optional: {}, |
| 303 | }, |
| 304 | SubagentPromptParams: { |
| 305 | strict: true, |
| 306 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', child_id: 'string', prompt: 'string', mode: 'string' }, |
| 307 | optional: {}, |
| 308 | }, |
| 309 | SubagentStartParams: { |
| 310 | strict: true, |
| 311 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', child_id: 'string', prompt: 'string', delivery: 'string' }, |
| 312 | optional: { model: 'string', persona: 'string', denied_tools: { items: 'string' } }, |
| 313 | }, |
| 314 | ToolCallParams: { |
| 315 | strict: false, |
| 316 | required: { handle: 'uint', call_id: 'string', input: 'json', deadline_ms: 'uint' }, |
| 317 | optional: { workspace: 'string', ticket: 'string', checkpoint_ticket: 'string', question_ticket: 'string', subagent_ticket: 'string', broker_tickets: { items: { ref: 'DshBrokerTicketWire' } }, caller_tools: { items: 'string' }, session_id: 'string', agent_id: 'string', origin_turn_id: 'string' }, |
| 318 | }, |
| 319 | UnregisterParams: { |
| 320 | strict: true, |
| 321 | required: { owner: { ref: 'OwnerRef' }, handle: 'uint' }, |
| 322 | optional: {}, |
| 323 | }, |
| 324 | UserInputIntent: { |
| 325 | strict: false, |
| 326 | required: { approve: 'string', kind: { enum: ['plan-review'] } }, |
| 327 | optional: { call_id: 'string' }, |
| 328 | }, |
| 329 | UserInputOption: { |
| 330 | strict: false, |
| 331 | required: { label: 'string' }, |
| 332 | optional: { description: 'string' }, |
| 333 | }, |
| 334 | UserInputQuestion: { |
| 335 | strict: false, |
| 336 | required: { id: 'string', question: 'string' }, |
| 337 | optional: { header: 'string', detail: 'string', intent: { ref: 'UserInputIntent' }, options: { items: { ref: 'UserInputOption' } }, allow_free_text: 'boolean', multi_select: 'boolean' }, |
| 338 | }, |
| 339 | UserQuestionParams: { |
| 340 | strict: true, |
| 341 | required: { owner: { ref: 'OwnerRef' }, ticket: 'string', questions: { items: { ref: 'UserInputQuestion' } } }, |
| 342 | optional: {}, |
| 343 | }, |
| 344 | } |
| 345 | |
| 346 | export type Json = null | boolean | number | string | Json[] | { [key: string]: Json } |
| 347 | |
| 348 | export interface ActivateParams { |
| 349 | owner: OwnerRef |
| 350 | scope?: EntryRef |
| 351 | plugin_name: string |
| 352 | entry: EntryRef |
| 353 | config?: Json |
| 354 | data_dir?: string |
| 355 | bundled_first_party?: boolean |
| 356 | } |
| 357 | |
| 358 | export type ActivateResult = { status: 'ok'; tools: string[]; commands?: string[] } | { status: 'failed'; diagnostic: string } |
| 359 | |
| 360 | export interface CancelParams { |
| 361 | id: number |
| 362 | } |
| 363 | |
| 364 | export type CommandResultWire = { kind: 'success'; text?: string } | { kind: 'error'; text: string } | { kind: 'submit'; prompt: string; text?: string } |
| 365 | |
| 366 | export interface CommandRunParams { |
| 367 | handle: number |
| 368 | command_id: string |
| 369 | raw_input: string |
| 370 | deadline_ms: number |
| 371 | workspace?: string |
| 372 | session_id?: string |
| 373 | agent_id?: string |
| 374 | origin_turn_id?: string |
| 375 | } |
| 376 | |
| 377 | export type ContentBlockWire = { type: 'text'; text: string } | { type: 'image_ref'; attachment_id: string } |
| 378 | |
| 379 | export interface CoreCallParams { |
| 380 | owner: OwnerRef |
| 381 | ticket: string |
| 382 | name: string |
| 383 | input: Json |
| 384 | } |
| 385 | |
| 386 | export interface DeactivateParams { |
| 387 | owner: OwnerRef |
| 388 | entry?: EntryRef |
| 389 | } |
| 390 | |
| 391 | export interface DeactivateResult { |
| 392 | disposed: boolean |
| 393 | leaked: string[] |
| 394 | } |
| 395 | |
| 396 | export interface DshBrokerParams { |
| 397 | owner: OwnerRef |
| 398 | ticket: string |
| 399 | service: string |
| 400 | method: string |
| 401 | input: Json |
| 402 | } |
| 403 | |
| 404 | export interface DshBrokerTicketWire { |
| 405 | service: string |
| 406 | ticket: string |
| 407 | } |
| 408 | |
| 409 | export interface EmptyParams {} |
| 410 | |
| 411 | export interface EntryRef { |
| 412 | path: string |
| 413 | sha256: string |
| 414 | } |
| 415 | |
| 416 | export interface ExecutionRedeemParams { |
| 417 | owner: OwnerRef |
| 418 | execution_id: string |
| 419 | ticket: string |
| 420 | } |
| 421 | |
| 422 | export interface FaultedParams { |
| 423 | owner: OwnerRef |
| 424 | error: string |
| 425 | } |
| 426 | |
| 427 | export interface HarnessRunParams { |
| 428 | owner: OwnerRef |
| 429 | execution_id: string |
| 430 | ticket: string |
| 431 | deadline_ms: number |
| 432 | hook?: HookDispatchWire |
| 433 | } |
| 434 | |
| 435 | export interface HelloParams { |
| 436 | protocol: ProtocolRange |
| 437 | host_version: string |
| 438 | bundle_sha256: string |
| 439 | runtime: HelloRuntime |
| 440 | tier: HostTier |
| 441 | builtin_modules: ModuleDigestWire[] |
| 442 | memory_limit_mib?: number |
| 443 | } |
| 444 | |
| 445 | export interface HelloRuntime { |
| 446 | name: string |
| 447 | version: string |
| 448 | } |
| 449 | |
| 450 | export interface HookCallPayload { |
| 451 | name: string |
| 452 | call_id: string |
| 453 | input: Json |
| 454 | mode: string |
| 455 | workspace: string |
| 456 | model: string |
| 457 | } |
| 458 | |
| 459 | export interface HookDispatchWire { |
| 460 | event: string |
| 461 | dialect: string |
| 462 | point: string |
| 463 | matcher?: string |
| 464 | query: string |
| 465 | } |
| 466 | |
| 467 | export interface HookEvaluateParams { |
| 468 | handle: number |
| 469 | event: string |
| 470 | payload: HookCallPayload |
| 471 | deadline_ms: number |
| 472 | } |
| 473 | |
| 474 | export type HookVerdictWire = { kind: 'abstain' } | { kind: 'deny'; reason: string } | { kind: 'ask'; reason: string } | { kind: 'annotate'; text: string } | { kind: 'revise'; input: { [key: string]: Json } } |
| 475 | |
| 476 | export interface HostLimits { |
| 477 | max_frame: number |
| 478 | max_inflight: number |
| 479 | dispose_deadline_ms: number |
| 480 | activate_deadline_ms: number |
| 481 | } |
| 482 | |
| 483 | export type HostTier = 'builtin' | 'plugin' |
| 484 | |
| 485 | export interface InitializeParams { |
| 486 | protocol: number |
| 487 | limits: HostLimits |
| 488 | } |
| 489 | |
| 490 | export interface LogParams { |
| 491 | level: string |
| 492 | msg: string |
| 493 | plugin_id?: string |
| 494 | } |
| 495 | |
| 496 | export interface McpCloseParams { |
| 497 | owner: OwnerRef |
| 498 | session_id: string |
| 499 | deadline_ms: number |
| 500 | } |
| 501 | |
| 502 | export interface McpHttpHeaders { |
| 503 | accept?: string |
| 504 | content_type?: string |
| 505 | mcp_session_id?: string |
| 506 | mcp_protocol_version?: string |
| 507 | mcp_method?: string |
| 508 | mcp_name?: string |
| 509 | } |
| 510 | |
| 511 | export interface McpOpenParams { |
| 512 | owner: OwnerRef |
| 513 | session_id: string |
| 514 | launch_ticket: string |
| 515 | transport: string |
| 516 | discover_grant?: McpOperationGrant |
| 517 | initialize_grant: McpOperationGrant |
| 518 | initialized_grant: McpOperationGrant |
| 519 | client_version: string |
| 520 | deadline_ms: number |
| 521 | } |
| 522 | |
| 523 | export interface McpOperationGrant { |
| 524 | ticket: string |
| 525 | operation_id: string |
| 526 | method: string |
| 527 | wire_id?: string |
| 528 | params: Json |
| 529 | } |
| 530 | |
| 531 | export interface McpRequestParams { |
| 532 | owner: OwnerRef |
| 533 | session_id: string |
| 534 | grant: McpOperationGrant |
| 535 | deadline_ms: number |
| 536 | } |
| 537 | |
| 538 | export interface ModuleDigestWire { |
| 539 | id: string |
| 540 | sha256: string |
| 541 | } |
| 542 | |
| 543 | export interface NetFetchParams { |
| 544 | owner: OwnerRef |
| 545 | session_id: string |
| 546 | url: string |
| 547 | method: string |
| 548 | headers: McpHttpHeaders |
| 549 | frame?: Json |
| 550 | ticket?: string |
| 551 | operation_id?: string |
| 552 | } |
| 553 | |
| 554 | export interface NetReadParams { |
| 555 | owner: OwnerRef |
| 556 | session_id: string |
| 557 | response_id: string |
| 558 | } |
| 559 | |
| 560 | export interface OwnerRef { |
| 561 | plugin_id: string |
| 562 | generation: number |
| 563 | owner_token: string |
| 564 | } |
| 565 | |
| 566 | export interface PluginRouteDispatchParams { |
| 567 | owner: OwnerRef |
| 568 | method: string |
| 569 | path: string |
| 570 | query?: string |
| 571 | headers: PluginRouteHeaderWire[] |
| 572 | body_base64?: string |
| 573 | deadline_ms: number |
| 574 | } |
| 575 | |
| 576 | export interface PluginRouteDispatchResult { |
| 577 | matched: boolean |
| 578 | status: number |
| 579 | headers: PluginRouteHeaderWire[] |
| 580 | body_base64?: string |
| 581 | } |
| 582 | |
| 583 | export interface PluginRouteHeaderWire { |
| 584 | name: string |
| 585 | value: string |
| 586 | } |
| 587 | |
| 588 | export interface ProcLaunchParams { |
| 589 | owner: OwnerRef |
| 590 | session_id: string |
| 591 | ticket: string |
| 592 | } |
| 593 | |
| 594 | export interface ProcSessionParams { |
| 595 | owner: OwnerRef |
| 596 | session_id: string |
| 597 | } |
| 598 | |
| 599 | export interface ProcWriteParams { |
| 600 | owner: OwnerRef |
| 601 | session_id: string |
| 602 | frame: Json |
| 603 | ticket?: string |
| 604 | operation_id?: string |
| 605 | } |
| 606 | |
| 607 | export interface ProtocolRange { |
| 608 | min: number |
| 609 | max: number |
| 610 | } |
| 611 | |
| 612 | export type RegisterKind = 'tool' | 'command' | 'hook' | 'prompt_section' | 'prompt_template' | 'skill_root' | 'avatar_pack' | 'shell_hook' | 'mcp_server' |
| 613 | |
| 614 | export interface RegisterParams { |
| 615 | owner: OwnerRef |
| 616 | scope?: EntryRef |
| 617 | kind: RegisterKind |
| 618 | spec: RegisterSpecWire |
| 619 | } |
| 620 | |
| 621 | export type RegisterResult = { handle: number } | { refused: string } |
| 622 | |
| 623 | export interface RegisterSpecWire { |
| 624 | name: string |
| 625 | description: string |
| 626 | input_schema?: { [key: string]: Json } |
| 627 | argument_hint?: string |
| 628 | } |
| 629 | |
| 630 | export interface RpcErrorWire { |
| 631 | code: number |
| 632 | message: string |
| 633 | data?: Json |
| 634 | } |
| 635 | |
| 636 | export interface SessionCheckpointParams { |
| 637 | owner: OwnerRef |
| 638 | ticket: string |
| 639 | } |
| 640 | |
| 641 | export interface SubagentHandleParams { |
| 642 | owner: OwnerRef |
| 643 | ticket: string |
| 644 | child_id: string |
| 645 | } |
| 646 | |
| 647 | export interface SubagentPromptParams { |
| 648 | owner: OwnerRef |
| 649 | ticket: string |
| 650 | child_id: string |
| 651 | prompt: string |
| 652 | mode: string |
| 653 | } |
| 654 | |
| 655 | export interface SubagentStartParams { |
| 656 | owner: OwnerRef |
| 657 | ticket: string |
| 658 | child_id: string |
| 659 | prompt: string |
| 660 | model?: string |
| 661 | persona?: string |
| 662 | denied_tools?: string[] |
| 663 | delivery: string |
| 664 | } |
| 665 | |
| 666 | export interface ToolCallParams { |
| 667 | handle: number |
| 668 | call_id: string |
| 669 | input: Json |
| 670 | deadline_ms: number |
| 671 | workspace?: string |
| 672 | ticket?: string |
| 673 | checkpoint_ticket?: string |
| 674 | question_ticket?: string |
| 675 | subagent_ticket?: string |
| 676 | broker_tickets?: DshBrokerTicketWire[] |
| 677 | caller_tools?: string[] |
| 678 | session_id?: string |
| 679 | agent_id?: string |
| 680 | origin_turn_id?: string |
| 681 | } |
| 682 | |
| 683 | export interface ToolResultWire { |
| 684 | content: ContentBlockWire[] |
| 685 | is_error: boolean |
| 686 | structured?: Json |
| 687 | } |
| 688 | |
| 689 | export interface UnregisterParams { |
| 690 | owner: OwnerRef |
| 691 | handle: number |
| 692 | } |
| 693 | |
| 694 | export interface UserInputAnswer { |
| 695 | kind?: UserInputAnswerKind |
| 696 | id: string |
| 697 | label: string |
| 698 | value: string |
| 699 | } |
| 700 | |
| 701 | export type UserInputAnswerKind = 'choice' | 'custom' | 'skipped' |
| 702 | |
| 703 | export interface UserInputIntent { |
| 704 | approve: string |
| 705 | call_id?: string |
| 706 | kind: 'plan-review' |
| 707 | } |
| 708 | |
| 709 | export interface UserInputOption { |
| 710 | label: string |
| 711 | description?: string |
| 712 | } |
| 713 | |
| 714 | export interface UserInputQuestion { |
| 715 | header?: string |
| 716 | id: string |
| 717 | question: string |
| 718 | detail?: string |
| 719 | intent?: UserInputIntent |
| 720 | options?: UserInputOption[] |
| 721 | allow_free_text?: boolean |
| 722 | multi_select?: boolean |
| 723 | } |
| 724 | |
| 725 | export interface UserInputResponse { |
| 726 | answers: UserInputAnswer[] |
| 727 | } |
| 728 | |
| 729 | export interface UserQuestionParams { |
| 730 | owner: OwnerRef |
| 731 | ticket: string |
| 732 | questions: UserInputQuestion[] |
| 733 | } |
| 734 |