@opencode-ai/protocol 0.0.0-dev-17471

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.
Files changed (71) hide show
  1. package/dist/api.d.ts +53 -0
  2. package/dist/api.js +73 -0
  3. package/dist/client.d.ts +61 -0
  4. package/dist/client.js +47 -0
  5. package/dist/errors.d.ts +133 -0
  6. package/dist/errors.js +105 -0
  7. package/dist/groups/agent.d.ts +194 -0
  8. package/dist/groups/agent.js +30 -0
  9. package/dist/groups/command.d.ts +63 -0
  10. package/dist/groups/command.js +20 -0
  11. package/dist/groups/config.d.ts +9 -0
  12. package/dist/groups/config.js +16 -0
  13. package/dist/groups/credential.d.ts +23 -0
  14. package/dist/groups/credential.js +29 -0
  15. package/dist/groups/debug.d.ts +17 -0
  16. package/dist/groups/debug.js +23 -0
  17. package/dist/groups/event.d.ts +12882 -0
  18. package/dist/groups/event.js +42 -0
  19. package/dist/groups/form.d.ts +781 -0
  20. package/dist/groups/form.js +97 -0
  21. package/dist/groups/fs.d.ts +35 -0
  22. package/dist/groups/fs.js +51 -0
  23. package/dist/groups/generate.d.ts +38 -0
  24. package/dist/groups/generate.js +27 -0
  25. package/dist/groups/health.d.ts +27 -0
  26. package/dist/groups/health.js +34 -0
  27. package/dist/groups/integration.d.ts +1152 -0
  28. package/dist/groups/integration.js +149 -0
  29. package/dist/groups/location.d.ts +16 -0
  30. package/dist/groups/location.js +34 -0
  31. package/dist/groups/mcp.d.ts +82 -0
  32. package/dist/groups/mcp.js +78 -0
  33. package/dist/groups/message.d.ts +592 -0
  34. package/dist/groups/message.js +37 -0
  35. package/dist/groups/migration.d.ts +28 -0
  36. package/dist/groups/migration.js +21 -0
  37. package/dist/groups/model.d.ts +218 -0
  38. package/dist/groups/model.js +33 -0
  39. package/dist/groups/permission.d.ts +153 -0
  40. package/dist/groups/permission.js +99 -0
  41. package/dist/groups/plugin.d.ts +14 -0
  42. package/dist/groups/plugin.js +20 -0
  43. package/dist/groups/project.d.ts +41 -0
  44. package/dist/groups/project.js +27 -0
  45. package/dist/groups/provider.d.ts +82 -0
  46. package/dist/groups/provider.js +34 -0
  47. package/dist/groups/pty.d.ts +145 -0
  48. package/dist/groups/pty.js +112 -0
  49. package/dist/groups/reference.d.ts +29 -0
  50. package/dist/groups/reference.js +20 -0
  51. package/dist/groups/server.d.ts +5 -0
  52. package/dist/groups/server.js +11 -0
  53. package/dist/groups/session.d.ts +9247 -0
  54. package/dist/groups/session.js +515 -0
  55. package/dist/groups/shell.d.ts +152 -0
  56. package/dist/groups/shell.js +82 -0
  57. package/dist/groups/skill.d.ts +20 -0
  58. package/dist/groups/skill.js +20 -0
  59. package/dist/groups/vcs.d.ts +46 -0
  60. package/dist/groups/vcs.js +47 -0
  61. package/dist/groups/websearch.d.ts +28 -0
  62. package/dist/groups/websearch.js +34 -0
  63. package/dist/groups/worktree.d.ts +42 -0
  64. package/dist/groups/worktree.js +54 -0
  65. package/dist/middleware/authorization.d.ts +13 -0
  66. package/dist/middleware/authorization.js +6 -0
  67. package/dist/middleware/schema-error.d.ts +13 -0
  68. package/dist/middleware/schema-error.js +4 -0
  69. package/dist/simulation.d.ts +1590 -0
  70. package/dist/simulation.js +460 -0
  71. package/package.json +44 -0
@@ -0,0 +1,1590 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { Rpc, RpcGroup } from "effect/unstable/rpc";
3
+ export declare namespace JsonRpc {
4
+ const RequestFields: {
5
+ jsonrpc: Schema.Literal<"2.0">;
6
+ id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
7
+ };
8
+ const Request: Schema.Struct<{
9
+ readonly method: Schema.String;
10
+ readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
11
+ readonly jsonrpc: Schema.Literal<"2.0">;
12
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
13
+ }>;
14
+ interface Request extends Schema.Schema.Type<typeof Request> {
15
+ }
16
+ const ErrorObject: Schema.Struct<{
17
+ readonly code: Schema.Number;
18
+ readonly message: Schema.String;
19
+ readonly data: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
20
+ }>;
21
+ const Response: Schema.Union<readonly [Schema.Struct<{
22
+ readonly jsonrpc: Schema.Literal<"2.0">;
23
+ readonly id: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>;
24
+ readonly result: Schema.Codec<Schema.Json, Schema.Json, never, never>;
25
+ readonly error: Schema.optionalKey<Schema.Never>;
26
+ }>, Schema.Struct<{
27
+ readonly jsonrpc: Schema.Literal<"2.0">;
28
+ readonly id: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>;
29
+ readonly result: Schema.optionalKey<Schema.Never>;
30
+ readonly error: Schema.Struct<{
31
+ readonly code: Schema.Number;
32
+ readonly message: Schema.String;
33
+ readonly data: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
34
+ }>;
35
+ }>]>;
36
+ type Response = Schema.Schema.Type<typeof Response>;
37
+ const decodeRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
38
+ readonly method: string;
39
+ readonly jsonrpc: "2.0";
40
+ readonly id?: string | number | null | undefined;
41
+ readonly params?: Schema.Json | undefined;
42
+ };
43
+ function success(id: Request["id"], result: unknown): Response | undefined;
44
+ function failure(id: Request["id"], error: unknown): Response;
45
+ }
46
+ declare const SimulationRequestError_base: Schema.Class<SimulationRequestError, Schema.TaggedStruct<"SimulationRequestError", {
47
+ readonly method: Schema.String;
48
+ readonly code: Schema.Number;
49
+ readonly message: Schema.String;
50
+ readonly data: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
51
+ }>, import("effect/Cause").YieldableError>;
52
+ export declare class SimulationRequestError extends SimulationRequestError_base {
53
+ }
54
+ export declare namespace Handshake {
55
+ export const ProtocolVersion: Schema.Literal<1>;
56
+ export type ProtocolVersion = Schema.Schema.Type<typeof ProtocolVersion>;
57
+ export const Capability: Schema.NonEmptyString;
58
+ export type Capability = Schema.Schema.Type<typeof Capability>;
59
+ export const EndpointRole: Schema.Literals<readonly ["ui", "backend"]>;
60
+ export type EndpointRole = Schema.Schema.Type<typeof EndpointRole>;
61
+ export const Identity: Schema.Struct<{
62
+ readonly name: Schema.NonEmptyString;
63
+ readonly version: Schema.NonEmptyString;
64
+ }>;
65
+ export interface Identity extends Schema.Schema.Type<typeof Identity> {
66
+ }
67
+ export const Params: Schema.Struct<{
68
+ readonly client: Schema.Struct<{
69
+ readonly name: Schema.NonEmptyString;
70
+ readonly version: Schema.NonEmptyString;
71
+ }>;
72
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
73
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
74
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
75
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
76
+ }>;
77
+ export interface Params extends Schema.Schema.Type<typeof Params> {
78
+ }
79
+ export const Response: Schema.Struct<{
80
+ readonly protocolVersion: Schema.Literal<1>;
81
+ readonly role: Schema.Literals<readonly ["ui", "backend"]>;
82
+ readonly server: Schema.Struct<{
83
+ readonly name: Schema.NonEmptyString;
84
+ readonly version: Schema.NonEmptyString;
85
+ }>;
86
+ readonly capabilities: Schema.$Array<Schema.NonEmptyString>;
87
+ }>;
88
+ export interface Response extends Schema.Schema.Type<typeof Response> {
89
+ }
90
+ export const Request: Schema.Struct<{
91
+ readonly method: Schema.Literal<"simulation.handshake">;
92
+ readonly params: Schema.Struct<{
93
+ readonly client: Schema.Struct<{
94
+ readonly name: Schema.NonEmptyString;
95
+ readonly version: Schema.NonEmptyString;
96
+ }>;
97
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
98
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
99
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
100
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
101
+ }>;
102
+ readonly jsonrpc: Schema.Literal<"2.0">;
103
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
104
+ }>;
105
+ export interface Request extends Schema.Schema.Type<typeof Request> {
106
+ }
107
+ export interface DispatchAction {
108
+ readonly role: EndpointRole;
109
+ readonly server: Identity;
110
+ readonly capabilities: ReadonlyArray<Capability>;
111
+ }
112
+ const RoleMismatchError_base: Schema.Class<RoleMismatchError, Schema.TaggedStruct<"SimulationHandshake.RoleMismatchError", {
113
+ readonly expected: Schema.Literals<readonly ["ui", "backend"]>;
114
+ readonly actual: Schema.Literals<readonly ["ui", "backend"]>;
115
+ readonly message: Schema.String;
116
+ }>, import("effect/Cause").YieldableError>;
117
+ export class RoleMismatchError extends RoleMismatchError_base {
118
+ }
119
+ const UnsupportedProtocolError_base: Schema.Class<UnsupportedProtocolError, Schema.TaggedStruct<"SimulationHandshake.UnsupportedProtocolError", {
120
+ readonly offered: Schema.$Array<Schema.Number>;
121
+ readonly supported: Schema.$Array<Schema.Literal<1>>;
122
+ readonly message: Schema.String;
123
+ }>, import("effect/Cause").YieldableError>;
124
+ export class UnsupportedProtocolError extends UnsupportedProtocolError_base {
125
+ }
126
+ const MissingCapabilityError_base: Schema.Class<MissingCapabilityError, Schema.TaggedStruct<"SimulationHandshake.MissingCapabilityError", {
127
+ readonly missing: Schema.$Array<Schema.NonEmptyString>;
128
+ readonly message: Schema.String;
129
+ }>, import("effect/Cause").YieldableError>;
130
+ export class MissingCapabilityError extends MissingCapabilityError_base {
131
+ }
132
+ export function dispatch(action: DispatchAction, params: Params): Effect.Effect<{
133
+ protocolVersion: 1;
134
+ role: "ui" | "backend";
135
+ server: Identity;
136
+ capabilities: string[];
137
+ }, RoleMismatchError | UnsupportedProtocolError | MissingCapabilityError, never>;
138
+ export {};
139
+ }
140
+ export declare namespace Frontend {
141
+ const Capabilities: readonly ["ui.type", "ui.press", "ui.enter", "ui.arrow", "ui.focus", "ui.click", "ui.click.semantic", "ui.resize", "ui.matches", "ui.state", "ui.snapshot", "ui.capture", "ui.recording.finish"];
142
+ type Capability = (typeof Capabilities)[number];
143
+ const KeyModifiers: Schema.Struct<{
144
+ readonly ctrl: Schema.optional<Schema.Boolean>;
145
+ readonly shift: Schema.optional<Schema.Boolean>;
146
+ readonly meta: Schema.optional<Schema.Boolean>;
147
+ readonly super: Schema.optional<Schema.Boolean>;
148
+ readonly hyper: Schema.optional<Schema.Boolean>;
149
+ }>;
150
+ interface KeyModifiers extends Schema.Schema.Type<typeof KeyModifiers> {
151
+ }
152
+ const SemanticClickTarget: Schema.Struct<{
153
+ readonly id: Schema.NonEmptyString;
154
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
155
+ readonly element: Schema.Number;
156
+ }>;
157
+ interface SemanticClickTarget extends Schema.Schema.Type<typeof SemanticClickTarget> {
158
+ }
159
+ const Action: Schema.Union<readonly [Schema.Struct<{
160
+ readonly type: Schema.Literal<"ui.type">;
161
+ readonly text: Schema.String;
162
+ }>, Schema.Struct<{
163
+ readonly type: Schema.Literal<"ui.press">;
164
+ readonly key: Schema.String;
165
+ readonly modifiers: Schema.optional<Schema.Struct<{
166
+ readonly ctrl: Schema.optional<Schema.Boolean>;
167
+ readonly shift: Schema.optional<Schema.Boolean>;
168
+ readonly meta: Schema.optional<Schema.Boolean>;
169
+ readonly super: Schema.optional<Schema.Boolean>;
170
+ readonly hyper: Schema.optional<Schema.Boolean>;
171
+ }>>;
172
+ }>, Schema.Struct<{
173
+ readonly type: Schema.Literal<"ui.enter">;
174
+ }>, Schema.Struct<{
175
+ readonly type: Schema.Literal<"ui.arrow">;
176
+ readonly direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
177
+ }>, Schema.Struct<{
178
+ readonly type: Schema.Literal<"ui.focus">;
179
+ readonly target: Schema.Number;
180
+ }>, Schema.Struct<{
181
+ readonly type: Schema.Literal<"ui.click">;
182
+ readonly target: Schema.Number;
183
+ readonly x: Schema.Number;
184
+ readonly y: Schema.Number;
185
+ readonly semantic: Schema.optionalKey<Schema.Struct<{
186
+ readonly id: Schema.NonEmptyString;
187
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
188
+ readonly element: Schema.Number;
189
+ }>>;
190
+ }>, Schema.Struct<{
191
+ readonly type: Schema.Literal<"ui.resize">;
192
+ readonly cols: Schema.Number;
193
+ readonly rows: Schema.Number;
194
+ }>]>;
195
+ type Action = Schema.Schema.Type<typeof Action>;
196
+ const Element: Schema.Struct<{
197
+ readonly id: Schema.String;
198
+ readonly num: Schema.Number;
199
+ readonly x: Schema.Number;
200
+ readonly y: Schema.Number;
201
+ readonly width: Schema.Number;
202
+ readonly height: Schema.Number;
203
+ readonly focusable: Schema.Boolean;
204
+ readonly focused: Schema.Boolean;
205
+ readonly clickable: Schema.Boolean;
206
+ readonly editor: Schema.Boolean;
207
+ }>;
208
+ interface Element extends Schema.Schema.Type<typeof Element> {
209
+ }
210
+ const State: Schema.Struct<{
211
+ readonly focused: Schema.Struct<{
212
+ readonly renderable: Schema.optional<Schema.Number>;
213
+ readonly editor: Schema.Boolean;
214
+ }>;
215
+ readonly elements: Schema.$Array<Schema.Struct<{
216
+ readonly id: Schema.String;
217
+ readonly num: Schema.Number;
218
+ readonly x: Schema.Number;
219
+ readonly y: Schema.Number;
220
+ readonly width: Schema.Number;
221
+ readonly height: Schema.Number;
222
+ readonly focusable: Schema.Boolean;
223
+ readonly focused: Schema.Boolean;
224
+ readonly clickable: Schema.Boolean;
225
+ readonly editor: Schema.Boolean;
226
+ }>>;
227
+ }>;
228
+ interface State extends Schema.Schema.Type<typeof State> {
229
+ }
230
+ const SemanticNode: Schema.Struct<{
231
+ readonly id: Schema.NonEmptyString;
232
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
233
+ readonly parent: Schema.optionalKey<Schema.NonEmptyString>;
234
+ readonly role: Schema.NonEmptyString;
235
+ readonly label: Schema.optionalKey<Schema.NonEmptyString>;
236
+ readonly element: Schema.Number;
237
+ readonly focused: Schema.optionalKey<Schema.Boolean>;
238
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
239
+ readonly expanded: Schema.optionalKey<Schema.Boolean>;
240
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
241
+ }>;
242
+ interface SemanticNode extends Schema.Schema.Type<typeof SemanticNode> {
243
+ }
244
+ const SemanticSnapshot: Schema.Struct<{
245
+ readonly format: Schema.Literal<"opencode-ui-snapshot-v1">;
246
+ readonly nodes: Schema.$Array<Schema.Struct<{
247
+ readonly id: Schema.NonEmptyString;
248
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
249
+ readonly parent: Schema.optionalKey<Schema.NonEmptyString>;
250
+ readonly role: Schema.NonEmptyString;
251
+ readonly label: Schema.optionalKey<Schema.NonEmptyString>;
252
+ readonly element: Schema.Number;
253
+ readonly focused: Schema.optionalKey<Schema.Boolean>;
254
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
255
+ readonly expanded: Schema.optionalKey<Schema.Boolean>;
256
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
257
+ }>>;
258
+ }>;
259
+ interface SemanticSnapshot extends Schema.Schema.Type<typeof SemanticSnapshot> {
260
+ }
261
+ const Color: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
262
+ type Color = Schema.Schema.Type<typeof Color>;
263
+ const CapturedFrame: Schema.Struct<{
264
+ readonly cols: Schema.Number;
265
+ readonly rows: Schema.Number;
266
+ readonly cursor: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
267
+ readonly lines: Schema.$Array<Schema.Struct<{
268
+ readonly spans: Schema.$Array<Schema.Struct<{
269
+ readonly text: Schema.String;
270
+ readonly fg: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
271
+ readonly bg: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
272
+ readonly attributes: Schema.Number;
273
+ readonly width: Schema.Number;
274
+ }>>;
275
+ }>>;
276
+ }>;
277
+ interface CapturedFrame extends Schema.Schema.Type<typeof CapturedFrame> {
278
+ }
279
+ const RecordingFinish: Schema.String;
280
+ type RecordingFinish = Schema.Schema.Type<typeof RecordingFinish>;
281
+ const Matches: Schema.Boolean;
282
+ type Matches = Schema.Schema.Type<typeof Matches>;
283
+ const TypeParams: Schema.Struct<{
284
+ readonly text: Schema.String;
285
+ }>;
286
+ interface TypeParams extends Schema.Schema.Type<typeof TypeParams> {
287
+ }
288
+ const MatchesParams: Schema.Struct<{
289
+ readonly text: Schema.String;
290
+ }>;
291
+ interface MatchesParams extends Schema.Schema.Type<typeof MatchesParams> {
292
+ }
293
+ const PressParams: Schema.Struct<{
294
+ readonly key: Schema.String;
295
+ readonly modifiers: Schema.optional<Schema.Struct<{
296
+ readonly ctrl: Schema.optional<Schema.Boolean>;
297
+ readonly shift: Schema.optional<Schema.Boolean>;
298
+ readonly meta: Schema.optional<Schema.Boolean>;
299
+ readonly super: Schema.optional<Schema.Boolean>;
300
+ readonly hyper: Schema.optional<Schema.Boolean>;
301
+ }>>;
302
+ }>;
303
+ interface PressParams extends Schema.Schema.Type<typeof PressParams> {
304
+ }
305
+ const pressParams: (key: string, modifiers?: KeyModifiers) => PressParams;
306
+ const ArrowParams: Schema.Struct<{
307
+ readonly direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
308
+ }>;
309
+ interface ArrowParams extends Schema.Schema.Type<typeof ArrowParams> {
310
+ }
311
+ const FocusParams: Schema.Struct<{
312
+ readonly target: Schema.Number;
313
+ }>;
314
+ interface FocusParams extends Schema.Schema.Type<typeof FocusParams> {
315
+ }
316
+ const ClickParams: Schema.Struct<{
317
+ readonly target: Schema.Number;
318
+ readonly x: Schema.Number;
319
+ readonly y: Schema.Number;
320
+ readonly semantic: Schema.optionalKey<Schema.Struct<{
321
+ readonly id: Schema.NonEmptyString;
322
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
323
+ readonly element: Schema.Number;
324
+ }>>;
325
+ }>;
326
+ interface ClickParams extends Schema.Schema.Type<typeof ClickParams> {
327
+ }
328
+ const ResizeParams: Schema.Struct<{
329
+ readonly cols: Schema.Number;
330
+ readonly rows: Schema.Number;
331
+ }>;
332
+ interface ResizeParams extends Schema.Schema.Type<typeof ResizeParams> {
333
+ }
334
+ const Request: Schema.Union<readonly [Schema.Struct<{
335
+ readonly method: Schema.Literal<"simulation.handshake">;
336
+ readonly params: Schema.Struct<{
337
+ readonly client: Schema.Struct<{
338
+ readonly name: Schema.NonEmptyString;
339
+ readonly version: Schema.NonEmptyString;
340
+ }>;
341
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
342
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
343
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
344
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
345
+ }>;
346
+ readonly jsonrpc: Schema.Literal<"2.0">;
347
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
348
+ }>, Schema.Struct<{
349
+ readonly method: Schema.Literal<"ui.type">;
350
+ readonly params: Schema.Struct<{
351
+ readonly text: Schema.String;
352
+ }>;
353
+ readonly jsonrpc: Schema.Literal<"2.0">;
354
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
355
+ }>, Schema.Struct<{
356
+ readonly method: Schema.Literal<"ui.press">;
357
+ readonly params: Schema.Struct<{
358
+ readonly key: Schema.String;
359
+ readonly modifiers: Schema.optional<Schema.Struct<{
360
+ readonly ctrl: Schema.optional<Schema.Boolean>;
361
+ readonly shift: Schema.optional<Schema.Boolean>;
362
+ readonly meta: Schema.optional<Schema.Boolean>;
363
+ readonly super: Schema.optional<Schema.Boolean>;
364
+ readonly hyper: Schema.optional<Schema.Boolean>;
365
+ }>>;
366
+ }>;
367
+ readonly jsonrpc: Schema.Literal<"2.0">;
368
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
369
+ }>, Schema.Struct<{
370
+ readonly method: Schema.Literal<"ui.arrow">;
371
+ readonly params: Schema.Struct<{
372
+ readonly direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
373
+ }>;
374
+ readonly jsonrpc: Schema.Literal<"2.0">;
375
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
376
+ }>, Schema.Struct<{
377
+ readonly method: Schema.Literal<"ui.focus">;
378
+ readonly params: Schema.Struct<{
379
+ readonly target: Schema.Number;
380
+ }>;
381
+ readonly jsonrpc: Schema.Literal<"2.0">;
382
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
383
+ }>, Schema.Struct<{
384
+ readonly method: Schema.Literal<"ui.click">;
385
+ readonly params: Schema.Struct<{
386
+ readonly target: Schema.Number;
387
+ readonly x: Schema.Number;
388
+ readonly y: Schema.Number;
389
+ readonly semantic: Schema.optionalKey<Schema.Struct<{
390
+ readonly id: Schema.NonEmptyString;
391
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
392
+ readonly element: Schema.Number;
393
+ }>>;
394
+ }>;
395
+ readonly jsonrpc: Schema.Literal<"2.0">;
396
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
397
+ }>, Schema.Struct<{
398
+ readonly method: Schema.Literal<"ui.resize">;
399
+ readonly params: Schema.Struct<{
400
+ readonly cols: Schema.Number;
401
+ readonly rows: Schema.Number;
402
+ }>;
403
+ readonly jsonrpc: Schema.Literal<"2.0">;
404
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
405
+ }>, Schema.Struct<{
406
+ readonly method: Schema.Literal<"ui.matches">;
407
+ readonly params: Schema.Struct<{
408
+ readonly text: Schema.String;
409
+ }>;
410
+ readonly jsonrpc: Schema.Literal<"2.0">;
411
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
412
+ }>, Schema.Struct<{
413
+ readonly method: Schema.Literals<readonly ["ui.enter", "ui.state", "ui.snapshot", "ui.recording.finish"]>;
414
+ readonly jsonrpc: Schema.Literal<"2.0">;
415
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
416
+ }>, Schema.Struct<{
417
+ readonly method: Schema.Literal<"ui.capture">;
418
+ readonly jsonrpc: Schema.Literal<"2.0">;
419
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
420
+ }>]>;
421
+ type Request = Schema.Schema.Type<typeof Request>;
422
+ const decodeRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
423
+ readonly params: {
424
+ readonly client: {
425
+ readonly name: string;
426
+ readonly version: string;
427
+ };
428
+ readonly expectedRole: "ui" | "backend";
429
+ readonly offeredVersions: readonly number[];
430
+ readonly requiredCapabilities: readonly string[];
431
+ readonly optionalCapabilities: readonly string[];
432
+ };
433
+ readonly method: "simulation.handshake";
434
+ readonly jsonrpc: "2.0";
435
+ readonly id?: string | number | null | undefined;
436
+ } | {
437
+ readonly params: {
438
+ readonly text: string;
439
+ };
440
+ readonly method: "ui.type";
441
+ readonly jsonrpc: "2.0";
442
+ readonly id?: string | number | null | undefined;
443
+ } | {
444
+ readonly params: {
445
+ readonly key: string;
446
+ readonly modifiers?: {
447
+ readonly shift?: boolean | undefined;
448
+ readonly ctrl?: boolean | undefined;
449
+ readonly meta?: boolean | undefined;
450
+ readonly super?: boolean | undefined;
451
+ readonly hyper?: boolean | undefined;
452
+ } | undefined;
453
+ };
454
+ readonly method: "ui.press";
455
+ readonly jsonrpc: "2.0";
456
+ readonly id?: string | number | null | undefined;
457
+ } | {
458
+ readonly params: {
459
+ readonly direction: "up" | "down" | "left" | "right";
460
+ };
461
+ readonly method: "ui.arrow";
462
+ readonly jsonrpc: "2.0";
463
+ readonly id?: string | number | null | undefined;
464
+ } | {
465
+ readonly params: {
466
+ readonly target: number;
467
+ };
468
+ readonly method: "ui.focus";
469
+ readonly jsonrpc: "2.0";
470
+ readonly id?: string | number | null | undefined;
471
+ } | {
472
+ readonly params: {
473
+ readonly target: number;
474
+ readonly x: number;
475
+ readonly y: number;
476
+ readonly semantic?: {
477
+ readonly id: string;
478
+ readonly element: number;
479
+ readonly instance?: string | undefined;
480
+ } | undefined;
481
+ };
482
+ readonly method: "ui.click";
483
+ readonly jsonrpc: "2.0";
484
+ readonly id?: string | number | null | undefined;
485
+ } | {
486
+ readonly params: {
487
+ readonly cols: number;
488
+ readonly rows: number;
489
+ };
490
+ readonly method: "ui.resize";
491
+ readonly jsonrpc: "2.0";
492
+ readonly id?: string | number | null | undefined;
493
+ } | {
494
+ readonly params: {
495
+ readonly text: string;
496
+ };
497
+ readonly method: "ui.matches";
498
+ readonly jsonrpc: "2.0";
499
+ readonly id?: string | number | null | undefined;
500
+ } | {
501
+ readonly method: "ui.enter" | "ui.state" | "ui.snapshot" | "ui.recording.finish";
502
+ readonly jsonrpc: "2.0";
503
+ readonly id?: string | number | null | undefined;
504
+ } | {
505
+ readonly method: "ui.capture";
506
+ readonly jsonrpc: "2.0";
507
+ readonly id?: string | number | null | undefined;
508
+ };
509
+ const decodeRequestEffect: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
510
+ readonly params: {
511
+ readonly client: {
512
+ readonly name: string;
513
+ readonly version: string;
514
+ };
515
+ readonly expectedRole: "ui" | "backend";
516
+ readonly offeredVersions: readonly number[];
517
+ readonly requiredCapabilities: readonly string[];
518
+ readonly optionalCapabilities: readonly string[];
519
+ };
520
+ readonly method: "simulation.handshake";
521
+ readonly jsonrpc: "2.0";
522
+ readonly id?: string | number | null | undefined;
523
+ } | {
524
+ readonly params: {
525
+ readonly text: string;
526
+ };
527
+ readonly method: "ui.type";
528
+ readonly jsonrpc: "2.0";
529
+ readonly id?: string | number | null | undefined;
530
+ } | {
531
+ readonly params: {
532
+ readonly key: string;
533
+ readonly modifiers?: {
534
+ readonly shift?: boolean | undefined;
535
+ readonly ctrl?: boolean | undefined;
536
+ readonly meta?: boolean | undefined;
537
+ readonly super?: boolean | undefined;
538
+ readonly hyper?: boolean | undefined;
539
+ } | undefined;
540
+ };
541
+ readonly method: "ui.press";
542
+ readonly jsonrpc: "2.0";
543
+ readonly id?: string | number | null | undefined;
544
+ } | {
545
+ readonly params: {
546
+ readonly direction: "up" | "down" | "left" | "right";
547
+ };
548
+ readonly method: "ui.arrow";
549
+ readonly jsonrpc: "2.0";
550
+ readonly id?: string | number | null | undefined;
551
+ } | {
552
+ readonly params: {
553
+ readonly target: number;
554
+ };
555
+ readonly method: "ui.focus";
556
+ readonly jsonrpc: "2.0";
557
+ readonly id?: string | number | null | undefined;
558
+ } | {
559
+ readonly params: {
560
+ readonly target: number;
561
+ readonly x: number;
562
+ readonly y: number;
563
+ readonly semantic?: {
564
+ readonly id: string;
565
+ readonly element: number;
566
+ readonly instance?: string | undefined;
567
+ } | undefined;
568
+ };
569
+ readonly method: "ui.click";
570
+ readonly jsonrpc: "2.0";
571
+ readonly id?: string | number | null | undefined;
572
+ } | {
573
+ readonly params: {
574
+ readonly cols: number;
575
+ readonly rows: number;
576
+ };
577
+ readonly method: "ui.resize";
578
+ readonly jsonrpc: "2.0";
579
+ readonly id?: string | number | null | undefined;
580
+ } | {
581
+ readonly params: {
582
+ readonly text: string;
583
+ };
584
+ readonly method: "ui.matches";
585
+ readonly jsonrpc: "2.0";
586
+ readonly id?: string | number | null | undefined;
587
+ } | {
588
+ readonly method: "ui.enter" | "ui.state" | "ui.snapshot" | "ui.recording.finish";
589
+ readonly jsonrpc: "2.0";
590
+ readonly id?: string | number | null | undefined;
591
+ } | {
592
+ readonly method: "ui.capture";
593
+ readonly jsonrpc: "2.0";
594
+ readonly id?: string | number | null | undefined;
595
+ }, Schema.SchemaError, never>;
596
+ }
597
+ export declare namespace Backend {
598
+ const Capabilities: readonly ["llm.attach", "llm.chunk", "llm.finish", "llm.disconnect", "llm.pending", "llm.request", "llm.tool-input-delta", "tool.attach", "tool.update", "tool.finish", "tool.fail", "tool.invocation", "tool.cancel"];
599
+ const Item: Schema.Union<readonly [Schema.Struct<{
600
+ readonly type: Schema.Literal<"textDelta">;
601
+ readonly text: Schema.String;
602
+ }>, Schema.Struct<{
603
+ readonly type: Schema.Literal<"reasoningDelta">;
604
+ readonly text: Schema.String;
605
+ }>, Schema.Struct<{
606
+ readonly type: Schema.Literal<"toolInputStart">;
607
+ readonly index: Schema.Number;
608
+ readonly id: Schema.String;
609
+ readonly name: Schema.String;
610
+ }>, Schema.Struct<{
611
+ readonly type: Schema.Literal<"toolInputDelta">;
612
+ readonly index: Schema.Number;
613
+ readonly text: Schema.String;
614
+ }>, Schema.Struct<{
615
+ readonly type: Schema.Literal<"toolCall">;
616
+ readonly index: Schema.Number;
617
+ readonly id: Schema.String;
618
+ readonly name: Schema.String;
619
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
620
+ }>, Schema.Struct<{
621
+ readonly type: Schema.Literal<"raw">;
622
+ readonly chunk: Schema.Codec<Schema.Json, Schema.Json, never, never>;
623
+ }>]>;
624
+ type Item = Schema.Schema.Type<typeof Item>;
625
+ const FinishReason: Schema.Literals<readonly ["stop", "tool-calls", "length", "content-filter"]>;
626
+ type FinishReason = Schema.Schema.Type<typeof FinishReason>;
627
+ const ToolContent: Schema.Union<readonly [Schema.Struct<{
628
+ readonly type: Schema.Literal<"text">;
629
+ readonly text: Schema.String;
630
+ }>, Schema.Struct<{
631
+ readonly type: Schema.Literal<"file">;
632
+ readonly data: Schema.String;
633
+ readonly mime: Schema.NonEmptyString;
634
+ readonly name: Schema.optionalKey<Schema.String>;
635
+ }>]>;
636
+ type ToolContent = Schema.Schema.Type<typeof ToolContent>;
637
+ const ToolRegistration: Schema.Struct<{
638
+ readonly name: Schema.NonEmptyString;
639
+ readonly description: Schema.String;
640
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
641
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
642
+ readonly permission: Schema.optionalKey<Schema.NonEmptyString>;
643
+ readonly options: Schema.optionalKey<Schema.Struct<{
644
+ readonly namespace: Schema.optionalKey<Schema.NonEmptyString>;
645
+ readonly codemode: Schema.optionalKey<Schema.Boolean>;
646
+ }>>;
647
+ }>;
648
+ interface ToolRegistration extends Schema.Schema.Type<typeof ToolRegistration> {
649
+ }
650
+ const ToolAttachParams: Schema.Struct<{
651
+ readonly tools: Schema.$Array<Schema.Struct<{
652
+ readonly name: Schema.NonEmptyString;
653
+ readonly description: Schema.String;
654
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
655
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
656
+ readonly permission: Schema.optionalKey<Schema.NonEmptyString>;
657
+ readonly options: Schema.optionalKey<Schema.Struct<{
658
+ readonly namespace: Schema.optionalKey<Schema.NonEmptyString>;
659
+ readonly codemode: Schema.optionalKey<Schema.Boolean>;
660
+ }>>;
661
+ }>>;
662
+ }>;
663
+ interface ToolAttachParams extends Schema.Schema.Type<typeof ToolAttachParams> {
664
+ }
665
+ function exposedToolName(registration: ToolRegistration): string;
666
+ const ToolProgress: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
667
+ interface ToolProgress extends Schema.Schema.Type<typeof ToolProgress> {
668
+ }
669
+ const ToolOutput: Schema.Struct<{
670
+ readonly structured: Schema.Codec<Schema.Json, Schema.Json, never, never>;
671
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
672
+ readonly type: Schema.Literal<"text">;
673
+ readonly text: Schema.String;
674
+ }>, Schema.Struct<{
675
+ readonly type: Schema.Literal<"file">;
676
+ readonly data: Schema.String;
677
+ readonly mime: Schema.NonEmptyString;
678
+ readonly name: Schema.optionalKey<Schema.String>;
679
+ }>]>>;
680
+ }>;
681
+ interface ToolOutput extends Schema.Schema.Type<typeof ToolOutput> {
682
+ }
683
+ const ToolUpdateParams: Schema.Struct<{
684
+ readonly id: Schema.String;
685
+ readonly sequence: Schema.Int;
686
+ readonly update: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
687
+ }>;
688
+ interface ToolUpdateParams extends Schema.Schema.Type<typeof ToolUpdateParams> {
689
+ }
690
+ const ToolFinishParams: Schema.Struct<{
691
+ readonly id: Schema.String;
692
+ readonly output: Schema.Struct<{
693
+ readonly structured: Schema.Codec<Schema.Json, Schema.Json, never, never>;
694
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
695
+ readonly type: Schema.Literal<"text">;
696
+ readonly text: Schema.String;
697
+ }>, Schema.Struct<{
698
+ readonly type: Schema.Literal<"file">;
699
+ readonly data: Schema.String;
700
+ readonly mime: Schema.NonEmptyString;
701
+ readonly name: Schema.optionalKey<Schema.String>;
702
+ }>]>>;
703
+ }>;
704
+ }>;
705
+ interface ToolFinishParams extends Schema.Schema.Type<typeof ToolFinishParams> {
706
+ }
707
+ const ToolFailParams: Schema.Struct<{
708
+ readonly id: Schema.String;
709
+ readonly message: Schema.String;
710
+ }>;
711
+ interface ToolFailParams extends Schema.Schema.Type<typeof ToolFailParams> {
712
+ }
713
+ const ToolInvocation: Schema.Struct<{
714
+ readonly id: Schema.String;
715
+ readonly name: Schema.String;
716
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
717
+ readonly context: Schema.Struct<{
718
+ readonly sessionID: Schema.String;
719
+ readonly agent: Schema.String;
720
+ readonly messageID: Schema.String;
721
+ readonly id: Schema.String;
722
+ }>;
723
+ }>;
724
+ interface ToolInvocation extends Schema.Schema.Type<typeof ToolInvocation> {
725
+ }
726
+ const ToolCancellation: Schema.Struct<{
727
+ readonly id: Schema.String;
728
+ readonly reason: Schema.Literal<"interrupted">;
729
+ }>;
730
+ interface ToolCancellation extends Schema.Schema.Type<typeof ToolCancellation> {
731
+ }
732
+ const Attached: Schema.Struct<{
733
+ readonly attached: Schema.Literal<true>;
734
+ }>;
735
+ interface Attached extends Schema.Schema.Type<typeof Attached> {
736
+ }
737
+ const Ok: Schema.Struct<{
738
+ readonly ok: Schema.Literal<true>;
739
+ }>;
740
+ interface Ok extends Schema.Schema.Type<typeof Ok> {
741
+ }
742
+ const ChunkParams: Schema.Struct<{
743
+ readonly id: Schema.String;
744
+ readonly items: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
745
+ readonly type: Schema.Literal<"textDelta">;
746
+ readonly text: Schema.String;
747
+ }>, Schema.Struct<{
748
+ readonly type: Schema.Literal<"reasoningDelta">;
749
+ readonly text: Schema.String;
750
+ }>, Schema.Struct<{
751
+ readonly type: Schema.Literal<"toolInputStart">;
752
+ readonly index: Schema.Number;
753
+ readonly id: Schema.String;
754
+ readonly name: Schema.String;
755
+ }>, Schema.Struct<{
756
+ readonly type: Schema.Literal<"toolInputDelta">;
757
+ readonly index: Schema.Number;
758
+ readonly text: Schema.String;
759
+ }>, Schema.Struct<{
760
+ readonly type: Schema.Literal<"toolCall">;
761
+ readonly index: Schema.Number;
762
+ readonly id: Schema.String;
763
+ readonly name: Schema.String;
764
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
765
+ }>, Schema.Struct<{
766
+ readonly type: Schema.Literal<"raw">;
767
+ readonly chunk: Schema.Codec<Schema.Json, Schema.Json, never, never>;
768
+ }>]>>;
769
+ }>;
770
+ interface ChunkParams extends Schema.Schema.Type<typeof ChunkParams> {
771
+ }
772
+ const FinishParams: Schema.Struct<{
773
+ readonly id: Schema.String;
774
+ readonly reason: Schema.withDecodingDefault<Schema.Literals<readonly ["stop", "tool-calls", "length", "content-filter"]>, never>;
775
+ }>;
776
+ interface FinishParams extends Schema.Schema.Type<typeof FinishParams> {
777
+ }
778
+ const FinishPayload: Schema.Struct<{
779
+ readonly id: Schema.String;
780
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "tool-calls", "length", "content-filter"]>>;
781
+ }>;
782
+ interface FinishPayload extends Schema.Schema.Type<typeof FinishPayload> {
783
+ }
784
+ const DisconnectParams: Schema.Struct<{
785
+ readonly id: Schema.String;
786
+ }>;
787
+ interface DisconnectParams extends Schema.Schema.Type<typeof DisconnectParams> {
788
+ }
789
+ const Request: Schema.Union<readonly [Schema.Struct<{
790
+ readonly method: Schema.Literal<"simulation.handshake">;
791
+ readonly params: Schema.Struct<{
792
+ readonly client: Schema.Struct<{
793
+ readonly name: Schema.NonEmptyString;
794
+ readonly version: Schema.NonEmptyString;
795
+ }>;
796
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
797
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
798
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
799
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
800
+ }>;
801
+ readonly jsonrpc: Schema.Literal<"2.0">;
802
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
803
+ }>, Schema.Struct<{
804
+ readonly method: Schema.Literal<"llm.chunk">;
805
+ readonly params: Schema.Struct<{
806
+ readonly id: Schema.String;
807
+ readonly items: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
808
+ readonly type: Schema.Literal<"textDelta">;
809
+ readonly text: Schema.String;
810
+ }>, Schema.Struct<{
811
+ readonly type: Schema.Literal<"reasoningDelta">;
812
+ readonly text: Schema.String;
813
+ }>, Schema.Struct<{
814
+ readonly type: Schema.Literal<"toolInputStart">;
815
+ readonly index: Schema.Number;
816
+ readonly id: Schema.String;
817
+ readonly name: Schema.String;
818
+ }>, Schema.Struct<{
819
+ readonly type: Schema.Literal<"toolInputDelta">;
820
+ readonly index: Schema.Number;
821
+ readonly text: Schema.String;
822
+ }>, Schema.Struct<{
823
+ readonly type: Schema.Literal<"toolCall">;
824
+ readonly index: Schema.Number;
825
+ readonly id: Schema.String;
826
+ readonly name: Schema.String;
827
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
828
+ }>, Schema.Struct<{
829
+ readonly type: Schema.Literal<"raw">;
830
+ readonly chunk: Schema.Codec<Schema.Json, Schema.Json, never, never>;
831
+ }>]>>;
832
+ }>;
833
+ readonly jsonrpc: Schema.Literal<"2.0">;
834
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
835
+ }>, Schema.Struct<{
836
+ readonly method: Schema.Literal<"llm.finish">;
837
+ readonly params: Schema.Struct<{
838
+ readonly id: Schema.String;
839
+ readonly reason: Schema.withDecodingDefault<Schema.Literals<readonly ["stop", "tool-calls", "length", "content-filter"]>, never>;
840
+ }>;
841
+ readonly jsonrpc: Schema.Literal<"2.0">;
842
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
843
+ }>, Schema.Struct<{
844
+ readonly method: Schema.Literal<"llm.disconnect">;
845
+ readonly params: Schema.Struct<{
846
+ readonly id: Schema.String;
847
+ }>;
848
+ readonly jsonrpc: Schema.Literal<"2.0">;
849
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
850
+ }>, Schema.Struct<{
851
+ readonly method: Schema.Literal<"tool.attach">;
852
+ readonly params: Schema.Struct<{
853
+ readonly tools: Schema.$Array<Schema.Struct<{
854
+ readonly name: Schema.NonEmptyString;
855
+ readonly description: Schema.String;
856
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
857
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
858
+ readonly permission: Schema.optionalKey<Schema.NonEmptyString>;
859
+ readonly options: Schema.optionalKey<Schema.Struct<{
860
+ readonly namespace: Schema.optionalKey<Schema.NonEmptyString>;
861
+ readonly codemode: Schema.optionalKey<Schema.Boolean>;
862
+ }>>;
863
+ }>>;
864
+ }>;
865
+ readonly jsonrpc: Schema.Literal<"2.0">;
866
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
867
+ }>, Schema.Struct<{
868
+ readonly method: Schema.Literal<"tool.update">;
869
+ readonly params: Schema.Struct<{
870
+ readonly id: Schema.String;
871
+ readonly sequence: Schema.Int;
872
+ readonly update: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
873
+ }>;
874
+ readonly jsonrpc: Schema.Literal<"2.0">;
875
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
876
+ }>, Schema.Struct<{
877
+ readonly method: Schema.Literal<"tool.finish">;
878
+ readonly params: Schema.Struct<{
879
+ readonly id: Schema.String;
880
+ readonly output: Schema.Struct<{
881
+ readonly structured: Schema.Codec<Schema.Json, Schema.Json, never, never>;
882
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
883
+ readonly type: Schema.Literal<"text">;
884
+ readonly text: Schema.String;
885
+ }>, Schema.Struct<{
886
+ readonly type: Schema.Literal<"file">;
887
+ readonly data: Schema.String;
888
+ readonly mime: Schema.NonEmptyString;
889
+ readonly name: Schema.optionalKey<Schema.String>;
890
+ }>]>>;
891
+ }>;
892
+ }>;
893
+ readonly jsonrpc: Schema.Literal<"2.0">;
894
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
895
+ }>, Schema.Struct<{
896
+ readonly method: Schema.Literal<"tool.fail">;
897
+ readonly params: Schema.Struct<{
898
+ readonly id: Schema.String;
899
+ readonly message: Schema.String;
900
+ }>;
901
+ readonly jsonrpc: Schema.Literal<"2.0">;
902
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
903
+ }>, Schema.Struct<{
904
+ readonly method: Schema.Literals<readonly ["llm.attach", "llm.pending"]>;
905
+ readonly jsonrpc: Schema.Literal<"2.0">;
906
+ readonly id: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Null]>>;
907
+ }>]>;
908
+ type Request = Schema.Schema.Type<typeof Request>;
909
+ const decodeRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
910
+ readonly params: {
911
+ readonly client: {
912
+ readonly name: string;
913
+ readonly version: string;
914
+ };
915
+ readonly expectedRole: "ui" | "backend";
916
+ readonly offeredVersions: readonly number[];
917
+ readonly requiredCapabilities: readonly string[];
918
+ readonly optionalCapabilities: readonly string[];
919
+ };
920
+ readonly method: "simulation.handshake";
921
+ readonly jsonrpc: "2.0";
922
+ readonly id?: string | number | null | undefined;
923
+ } | {
924
+ readonly params: {
925
+ readonly id: string;
926
+ readonly items: readonly ({
927
+ readonly type: "textDelta";
928
+ readonly text: string;
929
+ } | {
930
+ readonly type: "reasoningDelta";
931
+ readonly text: string;
932
+ } | {
933
+ readonly type: "toolInputStart";
934
+ readonly index: number;
935
+ readonly id: string;
936
+ readonly name: string;
937
+ } | {
938
+ readonly type: "toolInputDelta";
939
+ readonly index: number;
940
+ readonly text: string;
941
+ } | {
942
+ readonly type: "toolCall";
943
+ readonly index: number;
944
+ readonly id: string;
945
+ readonly name: string;
946
+ readonly input: Schema.Json;
947
+ } | {
948
+ readonly type: "raw";
949
+ readonly chunk: Schema.Json;
950
+ })[];
951
+ };
952
+ readonly method: "llm.chunk";
953
+ readonly jsonrpc: "2.0";
954
+ readonly id?: string | number | null | undefined;
955
+ } | {
956
+ readonly params: {
957
+ readonly id: string;
958
+ readonly reason: "length" | "stop" | "tool-calls" | "content-filter";
959
+ };
960
+ readonly method: "llm.finish";
961
+ readonly jsonrpc: "2.0";
962
+ readonly id?: string | number | null | undefined;
963
+ } | {
964
+ readonly params: {
965
+ readonly id: string;
966
+ };
967
+ readonly method: "llm.disconnect";
968
+ readonly jsonrpc: "2.0";
969
+ readonly id?: string | number | null | undefined;
970
+ } | {
971
+ readonly params: {
972
+ readonly tools: readonly {
973
+ readonly description: string;
974
+ readonly name: string;
975
+ readonly inputSchema: {
976
+ readonly [x: string]: Schema.Json;
977
+ };
978
+ readonly options?: {
979
+ readonly codemode?: boolean | undefined;
980
+ readonly namespace?: string | undefined;
981
+ } | undefined;
982
+ readonly permission?: string | undefined;
983
+ readonly outputSchema?: {
984
+ readonly [x: string]: Schema.Json;
985
+ } | undefined;
986
+ }[];
987
+ };
988
+ readonly method: "tool.attach";
989
+ readonly jsonrpc: "2.0";
990
+ readonly id?: string | number | null | undefined;
991
+ } | {
992
+ readonly params: {
993
+ readonly id: string;
994
+ readonly sequence: number;
995
+ readonly update: {
996
+ readonly [x: string]: Schema.Json;
997
+ };
998
+ };
999
+ readonly method: "tool.update";
1000
+ readonly jsonrpc: "2.0";
1001
+ readonly id?: string | number | null | undefined;
1002
+ } | {
1003
+ readonly params: {
1004
+ readonly id: string;
1005
+ readonly output: {
1006
+ readonly structured: Schema.Json;
1007
+ readonly content: readonly ({
1008
+ readonly type: "text";
1009
+ readonly text: string;
1010
+ } | {
1011
+ readonly data: string;
1012
+ readonly type: "file";
1013
+ readonly mime: string;
1014
+ readonly name?: string | undefined;
1015
+ })[];
1016
+ };
1017
+ };
1018
+ readonly method: "tool.finish";
1019
+ readonly jsonrpc: "2.0";
1020
+ readonly id?: string | number | null | undefined;
1021
+ } | {
1022
+ readonly params: {
1023
+ readonly id: string;
1024
+ readonly message: string;
1025
+ };
1026
+ readonly method: "tool.fail";
1027
+ readonly jsonrpc: "2.0";
1028
+ readonly id?: string | number | null | undefined;
1029
+ } | {
1030
+ readonly method: "llm.attach" | "llm.pending";
1031
+ readonly jsonrpc: "2.0";
1032
+ readonly id?: string | number | null | undefined;
1033
+ };
1034
+ const decodeRequestEffect: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
1035
+ readonly params: {
1036
+ readonly client: {
1037
+ readonly name: string;
1038
+ readonly version: string;
1039
+ };
1040
+ readonly expectedRole: "ui" | "backend";
1041
+ readonly offeredVersions: readonly number[];
1042
+ readonly requiredCapabilities: readonly string[];
1043
+ readonly optionalCapabilities: readonly string[];
1044
+ };
1045
+ readonly method: "simulation.handshake";
1046
+ readonly jsonrpc: "2.0";
1047
+ readonly id?: string | number | null | undefined;
1048
+ } | {
1049
+ readonly params: {
1050
+ readonly id: string;
1051
+ readonly items: readonly ({
1052
+ readonly type: "textDelta";
1053
+ readonly text: string;
1054
+ } | {
1055
+ readonly type: "reasoningDelta";
1056
+ readonly text: string;
1057
+ } | {
1058
+ readonly type: "toolInputStart";
1059
+ readonly index: number;
1060
+ readonly id: string;
1061
+ readonly name: string;
1062
+ } | {
1063
+ readonly type: "toolInputDelta";
1064
+ readonly index: number;
1065
+ readonly text: string;
1066
+ } | {
1067
+ readonly type: "toolCall";
1068
+ readonly index: number;
1069
+ readonly id: string;
1070
+ readonly name: string;
1071
+ readonly input: Schema.Json;
1072
+ } | {
1073
+ readonly type: "raw";
1074
+ readonly chunk: Schema.Json;
1075
+ })[];
1076
+ };
1077
+ readonly method: "llm.chunk";
1078
+ readonly jsonrpc: "2.0";
1079
+ readonly id?: string | number | null | undefined;
1080
+ } | {
1081
+ readonly params: {
1082
+ readonly id: string;
1083
+ readonly reason: "length" | "stop" | "tool-calls" | "content-filter";
1084
+ };
1085
+ readonly method: "llm.finish";
1086
+ readonly jsonrpc: "2.0";
1087
+ readonly id?: string | number | null | undefined;
1088
+ } | {
1089
+ readonly params: {
1090
+ readonly id: string;
1091
+ };
1092
+ readonly method: "llm.disconnect";
1093
+ readonly jsonrpc: "2.0";
1094
+ readonly id?: string | number | null | undefined;
1095
+ } | {
1096
+ readonly params: {
1097
+ readonly tools: readonly {
1098
+ readonly description: string;
1099
+ readonly name: string;
1100
+ readonly inputSchema: {
1101
+ readonly [x: string]: Schema.Json;
1102
+ };
1103
+ readonly options?: {
1104
+ readonly codemode?: boolean | undefined;
1105
+ readonly namespace?: string | undefined;
1106
+ } | undefined;
1107
+ readonly permission?: string | undefined;
1108
+ readonly outputSchema?: {
1109
+ readonly [x: string]: Schema.Json;
1110
+ } | undefined;
1111
+ }[];
1112
+ };
1113
+ readonly method: "tool.attach";
1114
+ readonly jsonrpc: "2.0";
1115
+ readonly id?: string | number | null | undefined;
1116
+ } | {
1117
+ readonly params: {
1118
+ readonly id: string;
1119
+ readonly sequence: number;
1120
+ readonly update: {
1121
+ readonly [x: string]: Schema.Json;
1122
+ };
1123
+ };
1124
+ readonly method: "tool.update";
1125
+ readonly jsonrpc: "2.0";
1126
+ readonly id?: string | number | null | undefined;
1127
+ } | {
1128
+ readonly params: {
1129
+ readonly id: string;
1130
+ readonly output: {
1131
+ readonly structured: Schema.Json;
1132
+ readonly content: readonly ({
1133
+ readonly type: "text";
1134
+ readonly text: string;
1135
+ } | {
1136
+ readonly data: string;
1137
+ readonly type: "file";
1138
+ readonly mime: string;
1139
+ readonly name?: string | undefined;
1140
+ })[];
1141
+ };
1142
+ };
1143
+ readonly method: "tool.finish";
1144
+ readonly jsonrpc: "2.0";
1145
+ readonly id?: string | number | null | undefined;
1146
+ } | {
1147
+ readonly params: {
1148
+ readonly id: string;
1149
+ readonly message: string;
1150
+ };
1151
+ readonly method: "tool.fail";
1152
+ readonly jsonrpc: "2.0";
1153
+ readonly id?: string | number | null | undefined;
1154
+ } | {
1155
+ readonly method: "llm.attach" | "llm.pending";
1156
+ readonly jsonrpc: "2.0";
1157
+ readonly id?: string | number | null | undefined;
1158
+ }, Schema.SchemaError, never>;
1159
+ const ProviderInvocation: Schema.Struct<{
1160
+ readonly id: Schema.String;
1161
+ readonly url: Schema.String;
1162
+ readonly body: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1163
+ }>;
1164
+ interface ProviderInvocation extends Schema.Schema.Type<typeof ProviderInvocation> {
1165
+ }
1166
+ const Pending: Schema.Struct<{
1167
+ readonly invocations: Schema.$Array<Schema.Struct<{
1168
+ readonly id: Schema.String;
1169
+ readonly url: Schema.String;
1170
+ readonly body: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1171
+ }>>;
1172
+ }>;
1173
+ interface Pending extends Schema.Schema.Type<typeof Pending> {
1174
+ }
1175
+ const NetworkLogEntry: Schema.Struct<{
1176
+ readonly time: Schema.Number;
1177
+ readonly method: Schema.String;
1178
+ readonly url: Schema.String;
1179
+ readonly matched: Schema.Boolean;
1180
+ }>;
1181
+ interface NetworkLogEntry extends Schema.Schema.Type<typeof NetworkLogEntry> {
1182
+ }
1183
+ const Notification: Schema.Union<readonly [Schema.Struct<{
1184
+ readonly jsonrpc: Schema.Literal<"2.0">;
1185
+ readonly method: Schema.Literal<"llm.request">;
1186
+ readonly params: Schema.Struct<{
1187
+ readonly id: Schema.String;
1188
+ readonly url: Schema.String;
1189
+ readonly body: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1190
+ }>;
1191
+ }>, Schema.Struct<{
1192
+ readonly jsonrpc: Schema.Literal<"2.0">;
1193
+ readonly method: Schema.Literal<"tool.invocation">;
1194
+ readonly params: Schema.Struct<{
1195
+ readonly id: Schema.String;
1196
+ readonly name: Schema.String;
1197
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1198
+ readonly context: Schema.Struct<{
1199
+ readonly sessionID: Schema.String;
1200
+ readonly agent: Schema.String;
1201
+ readonly messageID: Schema.String;
1202
+ readonly id: Schema.String;
1203
+ }>;
1204
+ }>;
1205
+ }>, Schema.Struct<{
1206
+ readonly jsonrpc: Schema.Literal<"2.0">;
1207
+ readonly method: Schema.Literal<"tool.cancel">;
1208
+ readonly params: Schema.Struct<{
1209
+ readonly id: Schema.String;
1210
+ readonly reason: Schema.Literal<"interrupted">;
1211
+ }>;
1212
+ }>]>;
1213
+ type Notification = Schema.Schema.Type<typeof Notification>;
1214
+ const decodeNotification: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
1215
+ readonly jsonrpc: "2.0";
1216
+ readonly method: "llm.request";
1217
+ readonly params: {
1218
+ readonly id: string;
1219
+ readonly url: string;
1220
+ readonly body: Schema.Json;
1221
+ };
1222
+ } | {
1223
+ readonly jsonrpc: "2.0";
1224
+ readonly method: "tool.invocation";
1225
+ readonly params: {
1226
+ readonly id: string;
1227
+ readonly name: string;
1228
+ readonly input: Schema.Json;
1229
+ readonly context: {
1230
+ readonly sessionID: string;
1231
+ readonly agent: string;
1232
+ readonly messageID: string;
1233
+ readonly id: string;
1234
+ };
1235
+ };
1236
+ } | {
1237
+ readonly jsonrpc: "2.0";
1238
+ readonly method: "tool.cancel";
1239
+ readonly params: {
1240
+ readonly id: string;
1241
+ readonly reason: "interrupted";
1242
+ };
1243
+ };
1244
+ const decodeNotificationEffect: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
1245
+ readonly jsonrpc: "2.0";
1246
+ readonly method: "llm.request";
1247
+ readonly params: {
1248
+ readonly id: string;
1249
+ readonly url: string;
1250
+ readonly body: Schema.Json;
1251
+ };
1252
+ } | {
1253
+ readonly jsonrpc: "2.0";
1254
+ readonly method: "tool.invocation";
1255
+ readonly params: {
1256
+ readonly id: string;
1257
+ readonly name: string;
1258
+ readonly input: Schema.Json;
1259
+ readonly context: {
1260
+ readonly sessionID: string;
1261
+ readonly agent: string;
1262
+ readonly messageID: string;
1263
+ readonly id: string;
1264
+ };
1265
+ };
1266
+ } | {
1267
+ readonly jsonrpc: "2.0";
1268
+ readonly method: "tool.cancel";
1269
+ readonly params: {
1270
+ readonly id: string;
1271
+ readonly reason: "interrupted";
1272
+ };
1273
+ }, Schema.SchemaError, never>;
1274
+ }
1275
+ export declare const UiRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"simulation.handshake", Schema.Struct<{
1276
+ readonly client: Schema.Struct<{
1277
+ readonly name: Schema.NonEmptyString;
1278
+ readonly version: Schema.NonEmptyString;
1279
+ }>;
1280
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
1281
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
1282
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
1283
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
1284
+ }>, Schema.Struct<{
1285
+ readonly protocolVersion: Schema.Literal<1>;
1286
+ readonly role: Schema.Literals<readonly ["ui", "backend"]>;
1287
+ readonly server: Schema.Struct<{
1288
+ readonly name: Schema.NonEmptyString;
1289
+ readonly version: Schema.NonEmptyString;
1290
+ }>;
1291
+ readonly capabilities: Schema.$Array<Schema.NonEmptyString>;
1292
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.state", Schema.Void, Schema.Struct<{
1293
+ readonly focused: Schema.Struct<{
1294
+ readonly renderable: Schema.optional<Schema.Number>;
1295
+ readonly editor: Schema.Boolean;
1296
+ }>;
1297
+ readonly elements: Schema.$Array<Schema.Struct<{
1298
+ readonly id: Schema.String;
1299
+ readonly num: Schema.Number;
1300
+ readonly x: Schema.Number;
1301
+ readonly y: Schema.Number;
1302
+ readonly width: Schema.Number;
1303
+ readonly height: Schema.Number;
1304
+ readonly focusable: Schema.Boolean;
1305
+ readonly focused: Schema.Boolean;
1306
+ readonly clickable: Schema.Boolean;
1307
+ readonly editor: Schema.Boolean;
1308
+ }>>;
1309
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.snapshot", Schema.Void, Schema.Struct<{
1310
+ readonly format: Schema.Literal<"opencode-ui-snapshot-v1">;
1311
+ readonly nodes: Schema.$Array<Schema.Struct<{
1312
+ readonly id: Schema.NonEmptyString;
1313
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
1314
+ readonly parent: Schema.optionalKey<Schema.NonEmptyString>;
1315
+ readonly role: Schema.NonEmptyString;
1316
+ readonly label: Schema.optionalKey<Schema.NonEmptyString>;
1317
+ readonly element: Schema.Number;
1318
+ readonly focused: Schema.optionalKey<Schema.Boolean>;
1319
+ readonly selected: Schema.optionalKey<Schema.Boolean>;
1320
+ readonly expanded: Schema.optionalKey<Schema.Boolean>;
1321
+ readonly disabled: Schema.optionalKey<Schema.Boolean>;
1322
+ }>>;
1323
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.capture", Schema.Void, Schema.Struct<{
1324
+ readonly cols: Schema.Number;
1325
+ readonly rows: Schema.Number;
1326
+ readonly cursor: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
1327
+ readonly lines: Schema.$Array<Schema.Struct<{
1328
+ readonly spans: Schema.$Array<Schema.Struct<{
1329
+ readonly text: Schema.String;
1330
+ readonly fg: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
1331
+ readonly bg: Schema.Tuple<readonly [Schema.Number, Schema.Number, Schema.Number, Schema.Number]>;
1332
+ readonly attributes: Schema.Number;
1333
+ readonly width: Schema.Number;
1334
+ }>>;
1335
+ }>>;
1336
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.matches", Schema.Struct<{
1337
+ readonly text: Schema.String;
1338
+ }>, Schema.Boolean, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.recording.finish", Schema.Void, Schema.String, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.type", Schema.Struct<{
1339
+ readonly text: Schema.String;
1340
+ }>, Schema.Struct<{
1341
+ readonly focused: Schema.Struct<{
1342
+ readonly renderable: Schema.optional<Schema.Number>;
1343
+ readonly editor: Schema.Boolean;
1344
+ }>;
1345
+ readonly elements: Schema.$Array<Schema.Struct<{
1346
+ readonly id: Schema.String;
1347
+ readonly num: Schema.Number;
1348
+ readonly x: Schema.Number;
1349
+ readonly y: Schema.Number;
1350
+ readonly width: Schema.Number;
1351
+ readonly height: Schema.Number;
1352
+ readonly focusable: Schema.Boolean;
1353
+ readonly focused: Schema.Boolean;
1354
+ readonly clickable: Schema.Boolean;
1355
+ readonly editor: Schema.Boolean;
1356
+ }>>;
1357
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.press", Schema.Struct<{
1358
+ readonly key: Schema.String;
1359
+ readonly modifiers: Schema.optional<Schema.Struct<{
1360
+ readonly ctrl: Schema.optional<Schema.Boolean>;
1361
+ readonly shift: Schema.optional<Schema.Boolean>;
1362
+ readonly meta: Schema.optional<Schema.Boolean>;
1363
+ readonly super: Schema.optional<Schema.Boolean>;
1364
+ readonly hyper: Schema.optional<Schema.Boolean>;
1365
+ }>>;
1366
+ }>, Schema.Struct<{
1367
+ readonly focused: Schema.Struct<{
1368
+ readonly renderable: Schema.optional<Schema.Number>;
1369
+ readonly editor: Schema.Boolean;
1370
+ }>;
1371
+ readonly elements: Schema.$Array<Schema.Struct<{
1372
+ readonly id: Schema.String;
1373
+ readonly num: Schema.Number;
1374
+ readonly x: Schema.Number;
1375
+ readonly y: Schema.Number;
1376
+ readonly width: Schema.Number;
1377
+ readonly height: Schema.Number;
1378
+ readonly focusable: Schema.Boolean;
1379
+ readonly focused: Schema.Boolean;
1380
+ readonly clickable: Schema.Boolean;
1381
+ readonly editor: Schema.Boolean;
1382
+ }>>;
1383
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.enter", Schema.Void, Schema.Struct<{
1384
+ readonly focused: Schema.Struct<{
1385
+ readonly renderable: Schema.optional<Schema.Number>;
1386
+ readonly editor: Schema.Boolean;
1387
+ }>;
1388
+ readonly elements: Schema.$Array<Schema.Struct<{
1389
+ readonly id: Schema.String;
1390
+ readonly num: Schema.Number;
1391
+ readonly x: Schema.Number;
1392
+ readonly y: Schema.Number;
1393
+ readonly width: Schema.Number;
1394
+ readonly height: Schema.Number;
1395
+ readonly focusable: Schema.Boolean;
1396
+ readonly focused: Schema.Boolean;
1397
+ readonly clickable: Schema.Boolean;
1398
+ readonly editor: Schema.Boolean;
1399
+ }>>;
1400
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.arrow", Schema.Struct<{
1401
+ readonly direction: Schema.Literals<readonly ["up", "down", "left", "right"]>;
1402
+ }>, Schema.Struct<{
1403
+ readonly focused: Schema.Struct<{
1404
+ readonly renderable: Schema.optional<Schema.Number>;
1405
+ readonly editor: Schema.Boolean;
1406
+ }>;
1407
+ readonly elements: Schema.$Array<Schema.Struct<{
1408
+ readonly id: Schema.String;
1409
+ readonly num: Schema.Number;
1410
+ readonly x: Schema.Number;
1411
+ readonly y: Schema.Number;
1412
+ readonly width: Schema.Number;
1413
+ readonly height: Schema.Number;
1414
+ readonly focusable: Schema.Boolean;
1415
+ readonly focused: Schema.Boolean;
1416
+ readonly clickable: Schema.Boolean;
1417
+ readonly editor: Schema.Boolean;
1418
+ }>>;
1419
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.focus", Schema.Struct<{
1420
+ readonly target: Schema.Number;
1421
+ }>, Schema.Struct<{
1422
+ readonly focused: Schema.Struct<{
1423
+ readonly renderable: Schema.optional<Schema.Number>;
1424
+ readonly editor: Schema.Boolean;
1425
+ }>;
1426
+ readonly elements: Schema.$Array<Schema.Struct<{
1427
+ readonly id: Schema.String;
1428
+ readonly num: Schema.Number;
1429
+ readonly x: Schema.Number;
1430
+ readonly y: Schema.Number;
1431
+ readonly width: Schema.Number;
1432
+ readonly height: Schema.Number;
1433
+ readonly focusable: Schema.Boolean;
1434
+ readonly focused: Schema.Boolean;
1435
+ readonly clickable: Schema.Boolean;
1436
+ readonly editor: Schema.Boolean;
1437
+ }>>;
1438
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.click", Schema.Struct<{
1439
+ readonly target: Schema.Number;
1440
+ readonly x: Schema.Number;
1441
+ readonly y: Schema.Number;
1442
+ readonly semantic: Schema.optionalKey<Schema.Struct<{
1443
+ readonly id: Schema.NonEmptyString;
1444
+ readonly instance: Schema.optionalKey<Schema.NonEmptyString>;
1445
+ readonly element: Schema.Number;
1446
+ }>>;
1447
+ }>, Schema.Struct<{
1448
+ readonly focused: Schema.Struct<{
1449
+ readonly renderable: Schema.optional<Schema.Number>;
1450
+ readonly editor: Schema.Boolean;
1451
+ }>;
1452
+ readonly elements: Schema.$Array<Schema.Struct<{
1453
+ readonly id: Schema.String;
1454
+ readonly num: Schema.Number;
1455
+ readonly x: Schema.Number;
1456
+ readonly y: Schema.Number;
1457
+ readonly width: Schema.Number;
1458
+ readonly height: Schema.Number;
1459
+ readonly focusable: Schema.Boolean;
1460
+ readonly focused: Schema.Boolean;
1461
+ readonly clickable: Schema.Boolean;
1462
+ readonly editor: Schema.Boolean;
1463
+ }>>;
1464
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"ui.resize", Schema.Struct<{
1465
+ readonly cols: Schema.Number;
1466
+ readonly rows: Schema.Number;
1467
+ }>, Schema.Struct<{
1468
+ readonly focused: Schema.Struct<{
1469
+ readonly renderable: Schema.optional<Schema.Number>;
1470
+ readonly editor: Schema.Boolean;
1471
+ }>;
1472
+ readonly elements: Schema.$Array<Schema.Struct<{
1473
+ readonly id: Schema.String;
1474
+ readonly num: Schema.Number;
1475
+ readonly x: Schema.Number;
1476
+ readonly y: Schema.Number;
1477
+ readonly width: Schema.Number;
1478
+ readonly height: Schema.Number;
1479
+ readonly focusable: Schema.Boolean;
1480
+ readonly focused: Schema.Boolean;
1481
+ readonly clickable: Schema.Boolean;
1482
+ readonly editor: Schema.Boolean;
1483
+ }>>;
1484
+ }>, typeof SimulationRequestError, never, never>>;
1485
+ export declare const BackendRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"simulation.handshake", Schema.Struct<{
1486
+ readonly client: Schema.Struct<{
1487
+ readonly name: Schema.NonEmptyString;
1488
+ readonly version: Schema.NonEmptyString;
1489
+ }>;
1490
+ readonly expectedRole: Schema.Literals<readonly ["ui", "backend"]>;
1491
+ readonly offeredVersions: Schema.$Array<Schema.Int>;
1492
+ readonly requiredCapabilities: Schema.$Array<Schema.NonEmptyString>;
1493
+ readonly optionalCapabilities: Schema.$Array<Schema.NonEmptyString>;
1494
+ }>, Schema.Struct<{
1495
+ readonly protocolVersion: Schema.Literal<1>;
1496
+ readonly role: Schema.Literals<readonly ["ui", "backend"]>;
1497
+ readonly server: Schema.Struct<{
1498
+ readonly name: Schema.NonEmptyString;
1499
+ readonly version: Schema.NonEmptyString;
1500
+ }>;
1501
+ readonly capabilities: Schema.$Array<Schema.NonEmptyString>;
1502
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"llm.attach", Schema.Void, Schema.Struct<{
1503
+ readonly attached: Schema.Literal<true>;
1504
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"llm.pending", Schema.Void, Schema.Struct<{
1505
+ readonly invocations: Schema.$Array<Schema.Struct<{
1506
+ readonly id: Schema.String;
1507
+ readonly url: Schema.String;
1508
+ readonly body: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1509
+ }>>;
1510
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"llm.chunk", Schema.Struct<{
1511
+ readonly id: Schema.String;
1512
+ readonly items: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1513
+ readonly type: Schema.Literal<"textDelta">;
1514
+ readonly text: Schema.String;
1515
+ }>, Schema.Struct<{
1516
+ readonly type: Schema.Literal<"reasoningDelta">;
1517
+ readonly text: Schema.String;
1518
+ }>, Schema.Struct<{
1519
+ readonly type: Schema.Literal<"toolInputStart">;
1520
+ readonly index: Schema.Number;
1521
+ readonly id: Schema.String;
1522
+ readonly name: Schema.String;
1523
+ }>, Schema.Struct<{
1524
+ readonly type: Schema.Literal<"toolInputDelta">;
1525
+ readonly index: Schema.Number;
1526
+ readonly text: Schema.String;
1527
+ }>, Schema.Struct<{
1528
+ readonly type: Schema.Literal<"toolCall">;
1529
+ readonly index: Schema.Number;
1530
+ readonly id: Schema.String;
1531
+ readonly name: Schema.String;
1532
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1533
+ }>, Schema.Struct<{
1534
+ readonly type: Schema.Literal<"raw">;
1535
+ readonly chunk: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1536
+ }>]>>;
1537
+ }>, Schema.Struct<{
1538
+ readonly ok: Schema.Literal<true>;
1539
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"llm.finish", Schema.Struct<{
1540
+ readonly id: Schema.String;
1541
+ readonly reason: Schema.optionalKey<Schema.Literals<readonly ["stop", "tool-calls", "length", "content-filter"]>>;
1542
+ }>, Schema.Struct<{
1543
+ readonly ok: Schema.Literal<true>;
1544
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"llm.disconnect", Schema.Struct<{
1545
+ readonly id: Schema.String;
1546
+ }>, Schema.Struct<{
1547
+ readonly ok: Schema.Literal<true>;
1548
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"tool.attach", Schema.Struct<{
1549
+ readonly tools: Schema.$Array<Schema.Struct<{
1550
+ readonly name: Schema.NonEmptyString;
1551
+ readonly description: Schema.String;
1552
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
1553
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1554
+ readonly permission: Schema.optionalKey<Schema.NonEmptyString>;
1555
+ readonly options: Schema.optionalKey<Schema.Struct<{
1556
+ readonly namespace: Schema.optionalKey<Schema.NonEmptyString>;
1557
+ readonly codemode: Schema.optionalKey<Schema.Boolean>;
1558
+ }>>;
1559
+ }>>;
1560
+ }>, Schema.Struct<{
1561
+ readonly attached: Schema.Literal<true>;
1562
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"tool.update", Schema.Struct<{
1563
+ readonly id: Schema.String;
1564
+ readonly sequence: Schema.Int;
1565
+ readonly update: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
1566
+ }>, Schema.Struct<{
1567
+ readonly ok: Schema.Literal<true>;
1568
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"tool.finish", Schema.Struct<{
1569
+ readonly id: Schema.String;
1570
+ readonly output: Schema.Struct<{
1571
+ readonly structured: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1572
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1573
+ readonly type: Schema.Literal<"text">;
1574
+ readonly text: Schema.String;
1575
+ }>, Schema.Struct<{
1576
+ readonly type: Schema.Literal<"file">;
1577
+ readonly data: Schema.String;
1578
+ readonly mime: Schema.NonEmptyString;
1579
+ readonly name: Schema.optionalKey<Schema.String>;
1580
+ }>]>>;
1581
+ }>;
1582
+ }>, Schema.Struct<{
1583
+ readonly ok: Schema.Literal<true>;
1584
+ }>, typeof SimulationRequestError, never, never> | Rpc.Rpc<"tool.fail", Schema.Struct<{
1585
+ readonly id: Schema.String;
1586
+ readonly message: Schema.String;
1587
+ }>, Schema.Struct<{
1588
+ readonly ok: Schema.Literal<true>;
1589
+ }>, typeof SimulationRequestError, never, never>>;
1590
+ export {};