@kilocode/client 0.0.0-stage → 0.0.0-v2-9

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 (94) hide show
  1. package/README.md +26 -2
  2. package/dist/chunks/contract-15p82y03.js +62 -0
  3. package/dist/chunks/contract-1x65x4hv.js +1701 -0
  4. package/dist/chunks/contract-5bf0yjkp.js +111 -0
  5. package/dist/chunks/contract-6mptkzbc.js +0 -0
  6. package/dist/chunks/contract-8bbb028w.js +145 -0
  7. package/dist/chunks/contract-8s2anffy.js +11 -0
  8. package/dist/chunks/contract-8ye1ye6f.js +92 -0
  9. package/dist/chunks/contract-9rqn6x4v.js +16 -0
  10. package/dist/chunks/contract-c46qzyff.js +37 -0
  11. package/dist/chunks/contract-gne7h7mq.js +50 -0
  12. package/dist/chunks/contract-hjez4bfs.js +52 -0
  13. package/dist/chunks/contract-m2eywc8w.js +0 -0
  14. package/dist/chunks/contract-nwcpakzx.js +12 -0
  15. package/dist/chunks/contract-qav6mfdz.js +0 -0
  16. package/dist/chunks/contract-ryy6kscr.js +39 -0
  17. package/dist/chunks/contract-s2hya144.js +1524 -0
  18. package/dist/chunks/contract-skhp7hxc.js +81 -0
  19. package/dist/chunks/contract-sxt88q69.js +12 -0
  20. package/dist/chunks/contract-ve4aws36.js +103 -0
  21. package/dist/chunks/contract-vmytr4q8.js +4 -0
  22. package/dist/chunks/contract-vwtmm97t.js +30 -0
  23. package/dist/chunks/contract-vyas3vgt.js +0 -0
  24. package/dist/chunks/contract-w10x3kfx.js +658 -0
  25. package/dist/chunks/contract-xgnj2w4v.js +20 -0
  26. package/dist/chunks/contract-y2etg5bs.js +9 -0
  27. package/dist/chunks/contract-ydhz1zrh.js +238 -0
  28. package/dist/contract.d.ts +1 -0
  29. package/dist/contract.js +12 -0
  30. package/dist/effect/api/api.d.ts +2927 -0
  31. package/dist/effect/api/api.js +0 -0
  32. package/dist/effect/api.d.ts +4 -0
  33. package/dist/effect/api.js +0 -0
  34. package/dist/effect/client.d.ts +2569 -0
  35. package/dist/effect/client.js +15 -0
  36. package/dist/effect/generated/client-error.d.ts +7 -0
  37. package/dist/effect/generated/client-error.js +6 -0
  38. package/dist/effect/generated/client.d.ts +2568 -0
  39. package/dist/effect/generated/client.js +8 -0
  40. package/dist/effect/generated/index.d.ts +2 -0
  41. package/dist/effect/generated/index.js +12 -0
  42. package/dist/effect/index.d.ts +35 -0
  43. package/dist/effect/index.js +75 -0
  44. package/dist/effect/rpc.d.ts +20 -0
  45. package/dist/effect/rpc.js +11 -0
  46. package/dist/effect/service.d.ts +90 -0
  47. package/dist/effect/service.js +187 -0
  48. package/dist/mcp.d.ts +44 -0
  49. package/dist/mcp.js +110 -0
  50. package/dist/promise/api.d.ts +21 -0
  51. package/dist/promise/api.js +0 -0
  52. package/dist/promise/client.d.ts +270 -0
  53. package/dist/promise/client.js +14 -0
  54. package/dist/promise/generated/client-error.d.ts +8 -0
  55. package/dist/promise/generated/client-error.js +6 -0
  56. package/dist/promise/generated/client.d.ts +277 -0
  57. package/dist/promise/generated/client.js +7 -0
  58. package/dist/promise/generated/index.d.ts +3 -0
  59. package/dist/promise/generated/index.js +81 -0
  60. package/dist/promise/generated/types.d.ts +7877 -0
  61. package/dist/promise/generated/types.js +72 -0
  62. package/dist/promise/index.d.ts +6 -0
  63. package/dist/promise/index.js +85 -0
  64. package/dist/promise/rpc.d.ts +32 -0
  65. package/dist/promise/rpc.js +7 -0
  66. package/dist/promise/service.d.ts +24 -0
  67. package/dist/promise/service.js +187 -0
  68. package/dist/pty-handoff.d.ts +12 -0
  69. package/dist/pty-handoff.js +17 -0
  70. package/dist/rpc-runtime.d.ts +20 -0
  71. package/dist/rpc-runtime.js +14 -0
  72. package/dist/service-contender.d.ts +37 -0
  73. package/dist/service-contender.js +10 -0
  74. package/dist/service-probe.d.ts +70 -0
  75. package/dist/service-probe.js +16 -0
  76. package/dist/service-timing.d.ts +12 -0
  77. package/dist/service-timing.js +10 -0
  78. package/dist/service-version.d.ts +2 -0
  79. package/dist/service-version.js +6 -0
  80. package/dist/service.d.ts +52 -0
  81. package/dist/service.js +1 -0
  82. package/dist/shared-events.d.ts +11 -0
  83. package/dist/shared-events.js +8 -0
  84. package/dist/solid/connection.d.ts +37 -0
  85. package/dist/solid/connection.js +10 -0
  86. package/dist/solid/data.d.ts +211 -0
  87. package/dist/solid/data.js +18 -0
  88. package/dist/solid/index.d.ts +4 -0
  89. package/dist/solid/index.js +36 -0
  90. package/dist/solid/pty.d.ts +22 -0
  91. package/dist/solid/pty.js +8 -0
  92. package/dist/solid/usage.d.ts +9 -0
  93. package/dist/solid/usage.js +6 -0
  94. package/package.json +88 -4
@@ -0,0 +1,2927 @@
1
+ import type { Effect, Stream } from "effect";
2
+ import type { Location } from "@opencode/schema/location";
3
+ import type { Agent } from "@opencode/schema/agent";
4
+ import type { Plugin } from "@opencode/schema/plugin";
5
+ import type { Session } from "@opencode/schema/session";
6
+ import type { AbsolutePath } from "@opencode/schema/schema";
7
+ import type { Project } from "@opencode/schema/project";
8
+ import type { RelativePath } from "@opencode/schema/schema";
9
+ import type { Money } from "@opencode/schema/money";
10
+ import type { Model } from "@opencode/schema/model";
11
+ import type { DateTime } from "effect";
12
+ import type { Permission } from "@opencode/schema/permission";
13
+ import type { SessionMessage } from "@opencode/schema/session-message";
14
+ import type { SessionInbox } from "@opencode/schema/session-inbox";
15
+ import type { PromptInput } from "@opencode/schema/prompt-input";
16
+ import type { AgentAttachment } from "@opencode/schema/prompt";
17
+ import type { Skill } from "@opencode/schema/skill";
18
+ import type { FileDiff } from "@opencode/schema/file-diff";
19
+ import type { InstructionEntry } from "@opencode/schema/instruction-entry";
20
+ import type { Schema } from "effect";
21
+ import type { Event } from "@opencode/schema/event";
22
+ import type { EventLog } from "@opencode/schema/event-log";
23
+ import type { Workspace } from "@opencode/schema/workspace";
24
+ import type { Instruction } from "@opencode/schema/instruction";
25
+ import type { Snapshot } from "@opencode/schema/snapshot";
26
+ import type { Shell } from "@opencode/schema/shell";
27
+ import type { Form } from "@opencode/schema/form";
28
+ import type { Provider } from "@opencode/schema/provider";
29
+ import type { Integration } from "@opencode/schema/integration";
30
+ import type { Mcp } from "@opencode/schema/mcp";
31
+ import type { PtyTicket } from "@opencode/schema/pty-ticket";
32
+ import type { Credential } from "@opencode/schema/credential";
33
+ import type { PermissionSaved } from "@opencode/schema/permission-saved";
34
+ import type { FileSystem } from "@opencode/schema/filesystem";
35
+ import type { Command } from "@opencode/schema/command";
36
+ import type { OpenCodeEvent } from "@opencode/protocol/groups/event";
37
+ import type { Pty } from "@opencode/schema/pty";
38
+ import type { Reference } from "@opencode/schema/reference";
39
+ import type { Worktree } from "@opencode/schema/worktree";
40
+ import type { Vcs } from "@opencode/schema/vcs";
41
+ import type { WebSearch } from "@opencode/schema/websearch";
42
+ import type { Config } from "@opencode/schema/config";
43
+ export type ServerInfoOutput = {
44
+ readonly version: string;
45
+ readonly pid: number;
46
+ readonly urls: ReadonlyArray<string>;
47
+ readonly paths: {
48
+ readonly tmp: string;
49
+ };
50
+ readonly capabilities?: {
51
+ readonly persistentPty?: boolean | undefined;
52
+ } | undefined;
53
+ };
54
+ export type ServerInfoOperation<E = never> = () => Effect.Effect<ServerInfoOutput, E>;
55
+ export type ServerPairOutput = {
56
+ readonly code: string;
57
+ readonly expires_in: number;
58
+ };
59
+ export type ServerPairOperation<E = never> = () => Effect.Effect<ServerPairOutput, E>;
60
+ export type ServerConnectInput = {
61
+ readonly code: string;
62
+ };
63
+ export type ServerConnectOutput = {
64
+ readonly token: string;
65
+ };
66
+ export type ServerConnectOperation<E = never> = (input: ServerConnectInput) => Effect.Effect<ServerConnectOutput, E>;
67
+ export interface ServerApi<E = never> {
68
+ readonly info: ServerInfoOperation<E>;
69
+ readonly pair: ServerPairOperation<E>;
70
+ readonly connect: ServerConnectOperation<E>;
71
+ }
72
+ export type LocationGetInput = {
73
+ readonly location?: {
74
+ readonly directory?: string | undefined;
75
+ } | undefined;
76
+ };
77
+ export type LocationGetOutput = Location.PublicInfo;
78
+ export type LocationGetOperation<E = never> = (input?: LocationGetInput) => Effect.Effect<LocationGetOutput, E>;
79
+ export type LocationReloadOutput = void;
80
+ export type LocationReloadOperation<E = never> = () => Effect.Effect<LocationReloadOutput, E>;
81
+ export interface LocationApi<E = never> {
82
+ readonly get: LocationGetOperation<E>;
83
+ readonly reload: LocationReloadOperation<E>;
84
+ }
85
+ export type AgentListInput = {
86
+ readonly location?: {
87
+ readonly directory?: string | undefined;
88
+ } | undefined;
89
+ };
90
+ export type AgentListOutput = {
91
+ readonly location: Location.PublicRef;
92
+ readonly data: ReadonlyArray<Agent.Info>;
93
+ };
94
+ export type AgentListOperation<E = never> = (input?: AgentListInput) => Effect.Effect<AgentListOutput, E>;
95
+ export type AgentGetInput = {
96
+ readonly agentID: Agent.ID;
97
+ readonly location?: {
98
+ readonly directory?: string | undefined;
99
+ } | undefined;
100
+ };
101
+ export type AgentGetOutput = {
102
+ readonly location: Location.PublicRef;
103
+ readonly data: Agent.Info;
104
+ };
105
+ export type AgentGetOperation<E = never> = (input: AgentGetInput) => Effect.Effect<AgentGetOutput, E>;
106
+ export interface AgentApi<E = never> {
107
+ readonly list: AgentListOperation<E>;
108
+ readonly get: AgentGetOperation<E>;
109
+ }
110
+ export type PluginListInput = {
111
+ readonly location?: {
112
+ readonly directory?: string | undefined;
113
+ } | undefined;
114
+ };
115
+ export type PluginListOutput = {
116
+ readonly location: Location.PublicRef;
117
+ readonly data: ReadonlyArray<Plugin.Info>;
118
+ };
119
+ export type PluginListOperation<E = never> = (input?: PluginListInput) => Effect.Effect<PluginListOutput, E>;
120
+ export type PluginCheckInput = {
121
+ readonly location?: {
122
+ readonly directory?: string | undefined;
123
+ } | undefined;
124
+ readonly target?: string | undefined;
125
+ };
126
+ export type PluginCheckOutput = {
127
+ readonly location: Location.PublicRef;
128
+ readonly data: ReadonlyArray<Plugin.Info>;
129
+ };
130
+ export type PluginCheckOperation<E = never> = (input?: PluginCheckInput) => Effect.Effect<PluginCheckOutput, E>;
131
+ export type PluginUpdateInput = {
132
+ readonly location?: {
133
+ readonly directory?: string | undefined;
134
+ } | undefined;
135
+ readonly targets: ReadonlyArray<string>;
136
+ };
137
+ export type PluginUpdateOutput = void;
138
+ export type PluginUpdateOperation<E = never> = (input: PluginUpdateInput) => Effect.Effect<PluginUpdateOutput, E>;
139
+ export interface PluginApi<E = never> {
140
+ readonly list: PluginListOperation<E>;
141
+ readonly check: PluginCheckOperation<E>;
142
+ readonly update: PluginUpdateOperation<E>;
143
+ }
144
+ export type SessionListInput = {
145
+ readonly limit?: number | undefined;
146
+ readonly order?: "asc" | "desc" | undefined;
147
+ readonly search?: string | undefined;
148
+ readonly parentID?: Session.ID | null | undefined;
149
+ readonly archived?: boolean | undefined;
150
+ readonly directory?: AbsolutePath | undefined;
151
+ readonly project?: Project.ID | undefined;
152
+ readonly subpath?: RelativePath | undefined;
153
+ readonly cursor?: Session.ListCursor | undefined;
154
+ };
155
+ export type SessionListOutput = {
156
+ readonly data: ReadonlyArray<Session.Info>;
157
+ readonly cursor: {
158
+ readonly previous?: Session.ListCursor | undefined;
159
+ readonly next?: Session.ListCursor | undefined;
160
+ };
161
+ };
162
+ export type SessionListOperation<E = never> = (input?: SessionListInput) => Effect.Effect<SessionListOutput, E>;
163
+ export type SessionStatsInput = {
164
+ readonly from?: number | undefined;
165
+ readonly to?: number | undefined;
166
+ readonly project?: Project.ID | undefined;
167
+ readonly timezone?: string | undefined;
168
+ readonly tools?: "none" | "summary" | "detail" | undefined;
169
+ };
170
+ export type SessionStatsOutput = {
171
+ readonly range: {
172
+ readonly from: DateTime.Utc;
173
+ readonly to: DateTime.Utc;
174
+ };
175
+ readonly sessions: number;
176
+ readonly subagents: number;
177
+ readonly prompts: number;
178
+ readonly steps: number;
179
+ readonly tokens: {
180
+ readonly input: number;
181
+ readonly output: number;
182
+ readonly reasoning: number;
183
+ readonly cache: {
184
+ readonly read: number;
185
+ readonly write: number;
186
+ };
187
+ };
188
+ readonly cost: Money.USD;
189
+ readonly tools: {
190
+ readonly mode: "none";
191
+ } | {
192
+ readonly mode: "summary";
193
+ readonly totals: {
194
+ readonly calls: number;
195
+ readonly succeeded: number;
196
+ readonly failed: number;
197
+ readonly unfinished: number;
198
+ };
199
+ } | {
200
+ readonly mode: "detail";
201
+ readonly totals: {
202
+ readonly calls: number;
203
+ readonly succeeded: number;
204
+ readonly failed: number;
205
+ readonly unfinished: number;
206
+ };
207
+ readonly usage: ReadonlyArray<{
208
+ readonly name: string;
209
+ readonly calls: number;
210
+ readonly succeeded: number;
211
+ readonly failed: number;
212
+ readonly unfinished: number;
213
+ readonly durationP50?: number | undefined;
214
+ }>;
215
+ };
216
+ readonly activeDays: number;
217
+ readonly streak: number;
218
+ readonly activity: ReadonlyArray<{
219
+ readonly date: string;
220
+ readonly steps: number;
221
+ }>;
222
+ readonly models: ReadonlyArray<{
223
+ readonly model: Model.Ref;
224
+ readonly steps: number;
225
+ readonly tokens: {
226
+ readonly input: number;
227
+ readonly output: number;
228
+ readonly reasoning: number;
229
+ readonly cache: {
230
+ readonly read: number;
231
+ readonly write: number;
232
+ };
233
+ };
234
+ readonly cost: Money.USD;
235
+ }>;
236
+ };
237
+ export type SessionStatsOperation<E = never> = (input?: SessionStatsInput) => Effect.Effect<SessionStatsOutput, E>;
238
+ export type SessionCreateInput = {
239
+ readonly id?: Session.ID | undefined;
240
+ readonly parentID?: Session.ID | undefined;
241
+ readonly title?: string | undefined;
242
+ readonly agent?: Agent.ID | undefined;
243
+ readonly model?: Model.Ref | undefined;
244
+ readonly location?: Location.PublicRef | undefined;
245
+ readonly metadata?: Session.Metadata | undefined;
246
+ readonly permissions?: Permission.Ruleset | undefined;
247
+ };
248
+ export type SessionCreateOutput = Session.Info;
249
+ export type SessionCreateOperation<E = never> = (input?: SessionCreateInput) => Effect.Effect<SessionCreateOutput, E>;
250
+ export type SessionImportInput = {
251
+ readonly info: Session.Info;
252
+ readonly messages: ReadonlyArray<SessionMessage.Info>;
253
+ readonly location?: Location.PublicRef | undefined;
254
+ };
255
+ export type SessionImportOutput = Session.Info;
256
+ export type SessionImportOperation<E = never> = (input: SessionImportInput) => Effect.Effect<SessionImportOutput, E>;
257
+ export type SessionExportInput = {
258
+ readonly sessionID: Session.ID;
259
+ readonly sanitize?: boolean | undefined;
260
+ };
261
+ export type SessionExportOutput = {
262
+ readonly info: Session.Info;
263
+ readonly messages: ReadonlyArray<SessionMessage.Info>;
264
+ };
265
+ export type SessionExportOperation<E = never> = (input: SessionExportInput) => Effect.Effect<SessionExportOutput, E>;
266
+ export type SessionActiveOutput = {
267
+ readonly [x: Session.ID]: {
268
+ readonly type: "running";
269
+ };
270
+ };
271
+ export type SessionActiveOperation<E = never> = () => Effect.Effect<SessionActiveOutput, E>;
272
+ export type SessionGetInput = {
273
+ readonly sessionID: Session.ID;
274
+ };
275
+ export type SessionGetOutput = Session.Info;
276
+ export type SessionGetOperation<E = never> = (input: SessionGetInput) => Effect.Effect<SessionGetOutput, E>;
277
+ export type SessionRemoveInput = {
278
+ readonly sessionID: Session.ID;
279
+ };
280
+ export type SessionRemoveOutput = void;
281
+ export type SessionRemoveOperation<E = never> = (input: SessionRemoveInput) => Effect.Effect<SessionRemoveOutput, E>;
282
+ export type SessionForkInput = {
283
+ readonly sessionID: Session.ID;
284
+ readonly before?: SessionMessage.ID | undefined;
285
+ };
286
+ export type SessionForkOutput = Session.Info;
287
+ export type SessionForkOperation<E = never> = (input: SessionForkInput) => Effect.Effect<SessionForkOutput, E>;
288
+ export type SessionSwitchAgentInput = {
289
+ readonly sessionID: Session.ID;
290
+ readonly agent: Agent.ID;
291
+ };
292
+ export type SessionSwitchAgentOutput = void;
293
+ export type SessionSwitchAgentOperation<E = never> = (input: SessionSwitchAgentInput) => Effect.Effect<SessionSwitchAgentOutput, E>;
294
+ export type SessionSwitchModelInput = {
295
+ readonly sessionID: Session.ID;
296
+ readonly model: Model.Ref;
297
+ };
298
+ export type SessionSwitchModelOutput = void;
299
+ export type SessionSwitchModelOperation<E = never> = (input: SessionSwitchModelInput) => Effect.Effect<SessionSwitchModelOutput, E>;
300
+ export type SessionUpdateInput = {
301
+ readonly sessionID: Session.ID;
302
+ readonly title?: string | undefined;
303
+ readonly metadata?: Session.Metadata | undefined;
304
+ readonly permissions?: Permission.Ruleset | undefined;
305
+ readonly archived?: boolean | undefined;
306
+ };
307
+ export type SessionUpdateOutput = void;
308
+ export type SessionUpdateOperation<E = never> = (input: SessionUpdateInput) => Effect.Effect<SessionUpdateOutput, E>;
309
+ export type SessionMoveInput = {
310
+ readonly sessionID: Session.ID;
311
+ readonly directory: AbsolutePath;
312
+ readonly delivery?: SessionInbox.Delivery | undefined;
313
+ };
314
+ export type SessionMoveOutput = void;
315
+ export type SessionMoveOperation<E = never> = (input: SessionMoveInput) => Effect.Effect<SessionMoveOutput, E>;
316
+ export type SessionPromptInput = {
317
+ readonly sessionID: Session.ID;
318
+ readonly id?: SessionMessage.ID | undefined;
319
+ readonly text: string;
320
+ readonly files?: ReadonlyArray<PromptInput.FileAttachment> | undefined;
321
+ readonly agents?: ReadonlyArray<AgentAttachment> | undefined;
322
+ readonly skills?: ReadonlyArray<PromptInput.SkillAttachment> | undefined;
323
+ readonly metadata?: {
324
+ readonly [x: string]: unknown;
325
+ } | undefined;
326
+ readonly delivery?: SessionInbox.Delivery | undefined;
327
+ readonly resume?: boolean | undefined;
328
+ };
329
+ export type SessionPromptOutput = SessionInbox.User;
330
+ export type SessionPromptOperation<E = never> = (input: SessionPromptInput) => Effect.Effect<SessionPromptOutput, E>;
331
+ export type SessionCommandInput = {
332
+ readonly sessionID: Session.ID;
333
+ readonly name: string;
334
+ readonly text: string;
335
+ readonly files?: ReadonlyArray<PromptInput.FileAttachment> | undefined;
336
+ readonly agents?: ReadonlyArray<AgentAttachment> | undefined;
337
+ readonly skills?: ReadonlyArray<PromptInput.SkillAttachment> | undefined;
338
+ readonly delivery?: SessionInbox.Delivery | undefined;
339
+ };
340
+ export type SessionCommandOutput = void;
341
+ export type SessionCommandOperation<E = never> = (input: SessionCommandInput) => Effect.Effect<SessionCommandOutput, E>;
342
+ export type SessionSkillInput = {
343
+ readonly sessionID: Session.ID;
344
+ readonly id: Skill.ID;
345
+ readonly resume?: boolean | undefined;
346
+ };
347
+ export type SessionSkillOutput = void;
348
+ export type SessionSkillOperation<E = never> = (input: SessionSkillInput) => Effect.Effect<SessionSkillOutput, E>;
349
+ export type SessionSyntheticInput = {
350
+ readonly sessionID: Session.ID;
351
+ readonly id?: SessionMessage.ID | undefined;
352
+ readonly text: string;
353
+ readonly description?: string | undefined;
354
+ readonly metadata?: {
355
+ readonly [x: string]: unknown;
356
+ } | undefined;
357
+ readonly delivery?: SessionInbox.Delivery | undefined;
358
+ readonly resume?: boolean | undefined;
359
+ };
360
+ export type SessionSyntheticOutput = SessionInbox.Synthetic;
361
+ export type SessionSyntheticOperation<E = never> = (input: SessionSyntheticInput) => Effect.Effect<SessionSyntheticOutput, E>;
362
+ export type SessionShellInput = {
363
+ readonly sessionID: Session.ID;
364
+ readonly id?: SessionMessage.ID | undefined;
365
+ readonly command: string;
366
+ };
367
+ export type SessionShellOutput = void;
368
+ export type SessionShellOperation<E = never> = (input: SessionShellInput) => Effect.Effect<SessionShellOutput, E>;
369
+ export type SessionCompactInput = {
370
+ readonly sessionID: Session.ID;
371
+ readonly id?: SessionMessage.ID | undefined;
372
+ readonly delivery?: SessionInbox.Delivery | undefined;
373
+ };
374
+ export type SessionCompactOutput = SessionInbox.Compaction;
375
+ export type SessionCompactOperation<E = never> = (input: SessionCompactInput) => Effect.Effect<SessionCompactOutput, E>;
376
+ export type SessionWaitInput = {
377
+ readonly sessionID: Session.ID;
378
+ };
379
+ export type SessionWaitOutput = void;
380
+ export type SessionWaitOperation<E = never> = (input: SessionWaitInput) => Effect.Effect<SessionWaitOutput, E>;
381
+ export type SessionRevertStageInput = {
382
+ readonly sessionID: Session.ID;
383
+ readonly messageID: SessionMessage.ID;
384
+ readonly files?: boolean | undefined;
385
+ };
386
+ export type SessionRevertStageOutput = Session.Revert;
387
+ export type SessionRevertStageOperation<E = never> = (input: SessionRevertStageInput) => Effect.Effect<SessionRevertStageOutput, E>;
388
+ export type SessionRevertClearInput = {
389
+ readonly sessionID: Session.ID;
390
+ };
391
+ export type SessionRevertClearOutput = void;
392
+ export type SessionRevertClearOperation<E = never> = (input: SessionRevertClearInput) => Effect.Effect<SessionRevertClearOutput, E>;
393
+ export type SessionRevertCommitInput = {
394
+ readonly sessionID: Session.ID;
395
+ };
396
+ export type SessionRevertCommitOutput = void;
397
+ export type SessionRevertCommitOperation<E = never> = (input: SessionRevertCommitInput) => Effect.Effect<SessionRevertCommitOutput, E>;
398
+ export type SessionContextInput = {
399
+ readonly sessionID: Session.ID;
400
+ };
401
+ export type SessionContextOutput = ReadonlyArray<SessionMessage.Info>;
402
+ export type SessionContextOperation<E = never> = (input: SessionContextInput) => Effect.Effect<SessionContextOutput, E>;
403
+ export type SessionDiffInput = {
404
+ readonly sessionID: Session.ID;
405
+ readonly from?: SessionMessage.ID | undefined;
406
+ readonly to?: SessionMessage.ID | undefined;
407
+ readonly context?: number | undefined;
408
+ };
409
+ export type SessionDiffOutput = ReadonlyArray<FileDiff.Info>;
410
+ export type SessionDiffOperation<E = never> = (input: SessionDiffInput) => Effect.Effect<SessionDiffOutput, E>;
411
+ export type SessionInboxListInput = {
412
+ readonly sessionID: Session.ID;
413
+ };
414
+ export type SessionInboxListOutput = ReadonlyArray<SessionInbox.Info>;
415
+ export type SessionInboxListOperation<E = never> = (input: SessionInboxListInput) => Effect.Effect<SessionInboxListOutput, E>;
416
+ export type SessionInboxCancelInput = {
417
+ readonly sessionID: Session.ID;
418
+ readonly inboxID: SessionMessage.ID;
419
+ };
420
+ export type SessionInboxCancelOutput = void;
421
+ export type SessionInboxCancelOperation<E = never> = (input: SessionInboxCancelInput) => Effect.Effect<SessionInboxCancelOutput, E>;
422
+ export type SessionInboxUpdateInput = {
423
+ readonly sessionID: Session.ID;
424
+ readonly inboxID: SessionMessage.ID;
425
+ readonly delivery: SessionInbox.Delivery;
426
+ };
427
+ export type SessionInboxUpdateOutput = void;
428
+ export type SessionInboxUpdateOperation<E = never> = (input: SessionInboxUpdateInput) => Effect.Effect<SessionInboxUpdateOutput, E>;
429
+ export type SessionInstructionsEntryListInput = {
430
+ readonly sessionID: Session.ID;
431
+ };
432
+ export type SessionInstructionsEntryListOutput = ReadonlyArray<InstructionEntry.Info>;
433
+ export type SessionInstructionsEntryListOperation<E = never> = (input: SessionInstructionsEntryListInput) => Effect.Effect<SessionInstructionsEntryListOutput, E>;
434
+ export type SessionInstructionsEntryPutInput = {
435
+ readonly sessionID: Session.ID;
436
+ readonly key: InstructionEntry.Key;
437
+ readonly value: Schema.Json;
438
+ };
439
+ export type SessionInstructionsEntryPutOutput = void;
440
+ export type SessionInstructionsEntryPutOperation<E = never> = (input: SessionInstructionsEntryPutInput) => Effect.Effect<SessionInstructionsEntryPutOutput, E>;
441
+ export type SessionInstructionsEntryRemoveInput = {
442
+ readonly sessionID: Session.ID;
443
+ readonly key: InstructionEntry.Key;
444
+ };
445
+ export type SessionInstructionsEntryRemoveOutput = void;
446
+ export type SessionInstructionsEntryRemoveOperation<E = never> = (input: SessionInstructionsEntryRemoveInput) => Effect.Effect<SessionInstructionsEntryRemoveOutput, E>;
447
+ export type SessionGenerateInput = {
448
+ readonly sessionID: Session.ID;
449
+ readonly prompt: string;
450
+ };
451
+ export type SessionGenerateOutput = {
452
+ readonly text: string;
453
+ };
454
+ export type SessionGenerateOperation<E = never> = (input: SessionGenerateInput) => Effect.Effect<SessionGenerateOutput, E>;
455
+ export type SessionLogInput = {
456
+ readonly sessionID: Session.ID;
457
+ readonly after?: Event.Seq | undefined;
458
+ readonly follow?: boolean | undefined;
459
+ };
460
+ export type SessionLogOutput = ({
461
+ readonly id: Event.ID;
462
+ readonly created: number;
463
+ readonly metadata?: {
464
+ readonly [x: string]: unknown;
465
+ } | undefined;
466
+ readonly type: "session.created";
467
+ readonly durable: {
468
+ readonly aggregateID: string;
469
+ readonly seq: Event.Seq;
470
+ readonly version: Event.Version;
471
+ };
472
+ readonly location?: {
473
+ readonly directory: AbsolutePath;
474
+ readonly workspaceID?: Workspace.ID | undefined;
475
+ } | undefined;
476
+ readonly data: {
477
+ readonly sessionID: Session.ID;
478
+ readonly projectID: Project.ID;
479
+ readonly location: {
480
+ readonly directory: AbsolutePath;
481
+ readonly workspaceID?: Workspace.ID | undefined;
482
+ };
483
+ readonly subpath?: RelativePath | undefined;
484
+ readonly parentID?: Session.ID | undefined;
485
+ readonly slug: string;
486
+ readonly title?: string | undefined;
487
+ readonly agent?: Agent.ID | undefined;
488
+ readonly model?: Model.Ref | undefined;
489
+ readonly metadata?: Session.Metadata | undefined;
490
+ readonly permissions?: Permission.Ruleset | undefined;
491
+ readonly version: string;
492
+ };
493
+ } | {
494
+ readonly id: Event.ID;
495
+ readonly created: number;
496
+ readonly metadata?: {
497
+ readonly [x: string]: unknown;
498
+ } | undefined;
499
+ readonly type: "session.agent.selected";
500
+ readonly durable: {
501
+ readonly aggregateID: string;
502
+ readonly seq: Event.Seq;
503
+ readonly version: Event.Version;
504
+ };
505
+ readonly location?: {
506
+ readonly directory: AbsolutePath;
507
+ readonly workspaceID?: Workspace.ID | undefined;
508
+ } | undefined;
509
+ readonly data: {
510
+ readonly sessionID: Session.ID;
511
+ readonly agent: Agent.ID;
512
+ readonly previous?: Agent.ID | undefined;
513
+ };
514
+ } | {
515
+ readonly id: Event.ID;
516
+ readonly created: number;
517
+ readonly metadata?: {
518
+ readonly [x: string]: unknown;
519
+ } | undefined;
520
+ readonly type: "session.model.selected";
521
+ readonly durable: {
522
+ readonly aggregateID: string;
523
+ readonly seq: Event.Seq;
524
+ readonly version: Event.Version;
525
+ };
526
+ readonly location?: {
527
+ readonly directory: AbsolutePath;
528
+ readonly workspaceID?: Workspace.ID | undefined;
529
+ } | undefined;
530
+ readonly data: {
531
+ readonly sessionID: Session.ID;
532
+ readonly model: Model.Ref;
533
+ readonly previous?: Model.Ref | undefined;
534
+ };
535
+ } | {
536
+ readonly id: Event.ID;
537
+ readonly created: number;
538
+ readonly metadata?: {
539
+ readonly [x: string]: unknown;
540
+ } | undefined;
541
+ readonly type: "session.moved";
542
+ readonly durable: {
543
+ readonly aggregateID: string;
544
+ readonly seq: Event.Seq;
545
+ readonly version: Event.Version;
546
+ };
547
+ readonly location?: {
548
+ readonly directory: AbsolutePath;
549
+ readonly workspaceID?: Workspace.ID | undefined;
550
+ } | undefined;
551
+ readonly data: {
552
+ readonly sessionID: Session.ID;
553
+ readonly location: {
554
+ readonly directory: AbsolutePath;
555
+ readonly workspaceID?: Workspace.ID | undefined;
556
+ };
557
+ readonly projectID: Project.ID;
558
+ readonly subpath?: RelativePath | undefined;
559
+ };
560
+ } | {
561
+ readonly id: Event.ID;
562
+ readonly created: number;
563
+ readonly metadata?: {
564
+ readonly [x: string]: unknown;
565
+ } | undefined;
566
+ readonly type: "session.renamed";
567
+ readonly durable: {
568
+ readonly aggregateID: string;
569
+ readonly seq: Event.Seq;
570
+ readonly version: Event.Version;
571
+ };
572
+ readonly location?: {
573
+ readonly directory: AbsolutePath;
574
+ readonly workspaceID?: Workspace.ID | undefined;
575
+ } | undefined;
576
+ readonly data: {
577
+ readonly sessionID: Session.ID;
578
+ readonly title: string;
579
+ };
580
+ } | {
581
+ readonly id: Event.ID;
582
+ readonly created: number;
583
+ readonly metadata?: {
584
+ readonly [x: string]: unknown;
585
+ } | undefined;
586
+ readonly type: "session.metadata.updated";
587
+ readonly durable: {
588
+ readonly aggregateID: string;
589
+ readonly seq: Event.Seq;
590
+ readonly version: Event.Version;
591
+ };
592
+ readonly location?: {
593
+ readonly directory: AbsolutePath;
594
+ readonly workspaceID?: Workspace.ID | undefined;
595
+ } | undefined;
596
+ readonly data: {
597
+ readonly sessionID: Session.ID;
598
+ readonly metadata: Session.Metadata;
599
+ };
600
+ } | {
601
+ readonly id: Event.ID;
602
+ readonly created: number;
603
+ readonly metadata?: {
604
+ readonly [x: string]: unknown;
605
+ } | undefined;
606
+ readonly type: "session.permissions";
607
+ readonly durable: {
608
+ readonly aggregateID: string;
609
+ readonly seq: Event.Seq;
610
+ readonly version: Event.Version;
611
+ };
612
+ readonly location?: {
613
+ readonly directory: AbsolutePath;
614
+ readonly workspaceID?: Workspace.ID | undefined;
615
+ } | undefined;
616
+ readonly data: {
617
+ readonly sessionID: Session.ID;
618
+ readonly permissions: Permission.Ruleset;
619
+ };
620
+ } | {
621
+ readonly id: Event.ID;
622
+ readonly created: number;
623
+ readonly metadata?: {
624
+ readonly [x: string]: unknown;
625
+ } | undefined;
626
+ readonly type: "session.viewed";
627
+ readonly durable: {
628
+ readonly aggregateID: string;
629
+ readonly seq: Event.Seq;
630
+ readonly version: Event.Version;
631
+ };
632
+ readonly location?: {
633
+ readonly directory: AbsolutePath;
634
+ readonly workspaceID?: Workspace.ID | undefined;
635
+ } | undefined;
636
+ readonly data: {
637
+ readonly sessionID: Session.ID;
638
+ readonly idle: number;
639
+ };
640
+ } | {
641
+ readonly id: Event.ID;
642
+ readonly created: number;
643
+ readonly metadata?: {
644
+ readonly [x: string]: unknown;
645
+ } | undefined;
646
+ readonly type: "session.archived";
647
+ readonly durable: {
648
+ readonly aggregateID: string;
649
+ readonly seq: Event.Seq;
650
+ readonly version: Event.Version;
651
+ };
652
+ readonly location?: {
653
+ readonly directory: AbsolutePath;
654
+ readonly workspaceID?: Workspace.ID | undefined;
655
+ } | undefined;
656
+ readonly data: {
657
+ readonly sessionID: Session.ID;
658
+ };
659
+ } | {
660
+ readonly id: Event.ID;
661
+ readonly created: number;
662
+ readonly metadata?: {
663
+ readonly [x: string]: unknown;
664
+ } | undefined;
665
+ readonly type: "session.unarchived";
666
+ readonly durable: {
667
+ readonly aggregateID: string;
668
+ readonly seq: Event.Seq;
669
+ readonly version: Event.Version;
670
+ };
671
+ readonly location?: {
672
+ readonly directory: AbsolutePath;
673
+ readonly workspaceID?: Workspace.ID | undefined;
674
+ } | undefined;
675
+ readonly data: {
676
+ readonly sessionID: Session.ID;
677
+ };
678
+ } | {
679
+ readonly id: Event.ID;
680
+ readonly created: number;
681
+ readonly metadata?: {
682
+ readonly [x: string]: unknown;
683
+ } | undefined;
684
+ readonly type: "session.deleted";
685
+ readonly durable: {
686
+ readonly aggregateID: string;
687
+ readonly seq: Event.Seq;
688
+ readonly version: Event.Version;
689
+ };
690
+ readonly location?: {
691
+ readonly directory: AbsolutePath;
692
+ readonly workspaceID?: Workspace.ID | undefined;
693
+ } | undefined;
694
+ readonly data: {
695
+ readonly sessionID: Session.ID;
696
+ };
697
+ } | {
698
+ readonly id: Event.ID;
699
+ readonly created: number;
700
+ readonly metadata?: {
701
+ readonly [x: string]: unknown;
702
+ } | undefined;
703
+ readonly type: "session.forked";
704
+ readonly durable: {
705
+ readonly aggregateID: string;
706
+ readonly seq: Event.Seq;
707
+ readonly version: Event.Version;
708
+ };
709
+ readonly location?: {
710
+ readonly directory: AbsolutePath;
711
+ readonly workspaceID?: Workspace.ID | undefined;
712
+ } | undefined;
713
+ readonly data: {
714
+ readonly sessionID: Session.ID;
715
+ readonly parentID: Session.ID;
716
+ readonly boundary: Session.ForkBoundary;
717
+ readonly instructions?: {
718
+ readonly [x: Instruction.Key]: Instruction.Hash;
719
+ } | undefined;
720
+ readonly instructionEntries?: InstructionEntry.Snapshot | undefined;
721
+ };
722
+ } | {
723
+ readonly id: Event.ID;
724
+ readonly created: number;
725
+ readonly metadata?: {
726
+ readonly [x: string]: unknown;
727
+ } | undefined;
728
+ readonly type: "session.inbox.delivered";
729
+ readonly durable: {
730
+ readonly aggregateID: string;
731
+ readonly seq: Event.Seq;
732
+ readonly version: Event.Version;
733
+ };
734
+ readonly location?: {
735
+ readonly directory: AbsolutePath;
736
+ readonly workspaceID?: Workspace.ID | undefined;
737
+ } | undefined;
738
+ readonly data: {
739
+ readonly sessionID: Session.ID;
740
+ readonly inboxID: SessionMessage.ID;
741
+ };
742
+ } | {
743
+ readonly id: Event.ID;
744
+ readonly created: number;
745
+ readonly metadata?: {
746
+ readonly [x: string]: unknown;
747
+ } | undefined;
748
+ readonly type: "session.inbox.enqueued";
749
+ readonly durable: {
750
+ readonly aggregateID: string;
751
+ readonly seq: Event.Seq;
752
+ readonly version: Event.Version;
753
+ };
754
+ readonly location?: {
755
+ readonly directory: AbsolutePath;
756
+ readonly workspaceID?: Workspace.ID | undefined;
757
+ } | undefined;
758
+ readonly data: {
759
+ readonly sessionID: Session.ID;
760
+ readonly inboxID: SessionMessage.ID;
761
+ readonly item: SessionInbox.Item;
762
+ };
763
+ } | {
764
+ readonly id: Event.ID;
765
+ readonly created: number;
766
+ readonly metadata?: {
767
+ readonly [x: string]: unknown;
768
+ } | undefined;
769
+ readonly type: "session.inbox.cancelled";
770
+ readonly durable: {
771
+ readonly aggregateID: string;
772
+ readonly seq: Event.Seq;
773
+ readonly version: Event.Version;
774
+ };
775
+ readonly location?: {
776
+ readonly directory: AbsolutePath;
777
+ readonly workspaceID?: Workspace.ID | undefined;
778
+ } | undefined;
779
+ readonly data: {
780
+ readonly sessionID: Session.ID;
781
+ readonly inboxID: SessionMessage.ID;
782
+ };
783
+ } | {
784
+ readonly id: Event.ID;
785
+ readonly created: number;
786
+ readonly metadata?: {
787
+ readonly [x: string]: unknown;
788
+ } | undefined;
789
+ readonly type: "session.inbox.delivery.changed";
790
+ readonly durable: {
791
+ readonly aggregateID: string;
792
+ readonly seq: Event.Seq;
793
+ readonly version: Event.Version;
794
+ };
795
+ readonly location?: {
796
+ readonly directory: AbsolutePath;
797
+ readonly workspaceID?: Workspace.ID | undefined;
798
+ } | undefined;
799
+ readonly data: {
800
+ readonly sessionID: Session.ID;
801
+ readonly inboxID: SessionMessage.ID;
802
+ readonly delivery: SessionInbox.Delivery;
803
+ };
804
+ } | {
805
+ readonly id: Event.ID;
806
+ readonly created: number;
807
+ readonly metadata?: {
808
+ readonly [x: string]: unknown;
809
+ } | undefined;
810
+ readonly type: "session.execution.started";
811
+ readonly durable: {
812
+ readonly aggregateID: string;
813
+ readonly seq: Event.Seq;
814
+ readonly version: Event.Version;
815
+ };
816
+ readonly location?: {
817
+ readonly directory: AbsolutePath;
818
+ readonly workspaceID?: Workspace.ID | undefined;
819
+ } | undefined;
820
+ readonly data: {
821
+ readonly sessionID: Session.ID;
822
+ };
823
+ } | {
824
+ readonly id: Event.ID;
825
+ readonly created: number;
826
+ readonly metadata?: {
827
+ readonly [x: string]: unknown;
828
+ } | undefined;
829
+ readonly type: "session.execution.succeeded";
830
+ readonly durable: {
831
+ readonly aggregateID: string;
832
+ readonly seq: Event.Seq;
833
+ readonly version: Event.Version;
834
+ };
835
+ readonly location?: {
836
+ readonly directory: AbsolutePath;
837
+ readonly workspaceID?: Workspace.ID | undefined;
838
+ } | undefined;
839
+ readonly data: {
840
+ readonly sessionID: Session.ID;
841
+ };
842
+ } | {
843
+ readonly id: Event.ID;
844
+ readonly created: number;
845
+ readonly metadata?: {
846
+ readonly [x: string]: unknown;
847
+ } | undefined;
848
+ readonly type: "session.execution.failed";
849
+ readonly durable: {
850
+ readonly aggregateID: string;
851
+ readonly seq: Event.Seq;
852
+ readonly version: Event.Version;
853
+ };
854
+ readonly location?: {
855
+ readonly directory: AbsolutePath;
856
+ readonly workspaceID?: Workspace.ID | undefined;
857
+ } | undefined;
858
+ readonly data: {
859
+ readonly sessionID: Session.ID;
860
+ readonly error: {
861
+ readonly type: string;
862
+ readonly message: string;
863
+ readonly status?: number | undefined;
864
+ readonly response?: {
865
+ readonly body: string;
866
+ } | undefined;
867
+ readonly retryAfterMs?: number | undefined;
868
+ };
869
+ };
870
+ } | {
871
+ readonly id: Event.ID;
872
+ readonly created: number;
873
+ readonly metadata?: {
874
+ readonly [x: string]: unknown;
875
+ } | undefined;
876
+ readonly type: "session.execution.interrupted";
877
+ readonly durable: {
878
+ readonly aggregateID: string;
879
+ readonly seq: Event.Seq;
880
+ readonly version: Event.Version;
881
+ };
882
+ readonly location?: {
883
+ readonly directory: AbsolutePath;
884
+ readonly workspaceID?: Workspace.ID | undefined;
885
+ } | undefined;
886
+ readonly data: {
887
+ readonly sessionID: Session.ID;
888
+ readonly reason: "user" | "shutdown" | "superseded" | "inactivity";
889
+ };
890
+ } | {
891
+ readonly id: Event.ID;
892
+ readonly created: number;
893
+ readonly metadata?: {
894
+ readonly [x: string]: unknown;
895
+ } | undefined;
896
+ readonly type: "session.instructions.updated";
897
+ readonly durable: {
898
+ readonly aggregateID: string;
899
+ readonly seq: Event.Seq;
900
+ readonly version: Event.Version;
901
+ };
902
+ readonly location?: {
903
+ readonly directory: AbsolutePath;
904
+ readonly workspaceID?: Workspace.ID | undefined;
905
+ } | undefined;
906
+ readonly data: {
907
+ readonly sessionID: Session.ID;
908
+ readonly delta: {
909
+ readonly [x: string]: Instruction.Hash | "removed";
910
+ };
911
+ readonly text?: string | undefined;
912
+ };
913
+ } | {
914
+ readonly id: Event.ID;
915
+ readonly created: number;
916
+ readonly metadata?: {
917
+ readonly [x: string]: unknown;
918
+ } | undefined;
919
+ readonly type: "session.synthetic";
920
+ readonly durable: {
921
+ readonly aggregateID: string;
922
+ readonly seq: Event.Seq;
923
+ readonly version: Event.Version;
924
+ };
925
+ readonly location?: {
926
+ readonly directory: AbsolutePath;
927
+ readonly workspaceID?: Workspace.ID | undefined;
928
+ } | undefined;
929
+ readonly data: {
930
+ readonly sessionID: Session.ID;
931
+ readonly text: string;
932
+ readonly description?: string | undefined;
933
+ readonly metadata?: {
934
+ readonly [x: string]: unknown;
935
+ } | undefined;
936
+ };
937
+ } | {
938
+ readonly id: Event.ID;
939
+ readonly created: number;
940
+ readonly metadata?: {
941
+ readonly [x: string]: unknown;
942
+ } | undefined;
943
+ readonly type: "session.skill.activated";
944
+ readonly durable: {
945
+ readonly aggregateID: string;
946
+ readonly seq: Event.Seq;
947
+ readonly version: Event.Version;
948
+ };
949
+ readonly location?: {
950
+ readonly directory: AbsolutePath;
951
+ readonly workspaceID?: Workspace.ID | undefined;
952
+ } | undefined;
953
+ readonly data: {
954
+ readonly sessionID: Session.ID;
955
+ readonly id: Skill.ID;
956
+ readonly name: Skill.Name;
957
+ readonly text: string;
958
+ };
959
+ } | {
960
+ readonly id: Event.ID;
961
+ readonly created: number;
962
+ readonly metadata?: {
963
+ readonly [x: string]: unknown;
964
+ } | undefined;
965
+ readonly type: "session.shell.started";
966
+ readonly durable: {
967
+ readonly aggregateID: string;
968
+ readonly seq: Event.Seq;
969
+ readonly version: Event.Version;
970
+ };
971
+ readonly location?: {
972
+ readonly directory: AbsolutePath;
973
+ readonly workspaceID?: Workspace.ID | undefined;
974
+ } | undefined;
975
+ readonly data: {
976
+ readonly sessionID: Session.ID;
977
+ readonly shell: Shell.Info;
978
+ };
979
+ } | {
980
+ readonly id: Event.ID;
981
+ readonly created: number;
982
+ readonly metadata?: {
983
+ readonly [x: string]: unknown;
984
+ } | undefined;
985
+ readonly type: "session.shell.ended";
986
+ readonly durable: {
987
+ readonly aggregateID: string;
988
+ readonly seq: Event.Seq;
989
+ readonly version: Event.Version;
990
+ };
991
+ readonly location?: {
992
+ readonly directory: AbsolutePath;
993
+ readonly workspaceID?: Workspace.ID | undefined;
994
+ } | undefined;
995
+ readonly data: {
996
+ readonly sessionID: Session.ID;
997
+ readonly shell: Shell.Info;
998
+ readonly output: {
999
+ readonly output: string;
1000
+ readonly cursor: number;
1001
+ readonly size: number;
1002
+ readonly truncated: boolean;
1003
+ };
1004
+ };
1005
+ } | {
1006
+ readonly id: Event.ID;
1007
+ readonly created: number;
1008
+ readonly metadata?: {
1009
+ readonly [x: string]: unknown;
1010
+ } | undefined;
1011
+ readonly type: "session.step.started";
1012
+ readonly durable: {
1013
+ readonly aggregateID: string;
1014
+ readonly seq: Event.Seq;
1015
+ readonly version: Event.Version;
1016
+ };
1017
+ readonly location?: {
1018
+ readonly directory: AbsolutePath;
1019
+ readonly workspaceID?: Workspace.ID | undefined;
1020
+ } | undefined;
1021
+ readonly data: {
1022
+ readonly sessionID: Session.ID;
1023
+ readonly assistantMessageID: SessionMessage.ID;
1024
+ readonly agent: Agent.ID;
1025
+ readonly model: Model.Ref;
1026
+ readonly snapshot?: Snapshot.ID | undefined;
1027
+ readonly started: number;
1028
+ };
1029
+ } | {
1030
+ readonly id: Event.ID;
1031
+ readonly created: number;
1032
+ readonly metadata?: {
1033
+ readonly [x: string]: unknown;
1034
+ } | undefined;
1035
+ readonly type: "session.step.streamed";
1036
+ readonly durable: {
1037
+ readonly aggregateID: string;
1038
+ readonly seq: Event.Seq;
1039
+ readonly version: Event.Version;
1040
+ };
1041
+ readonly location?: {
1042
+ readonly directory: AbsolutePath;
1043
+ readonly workspaceID?: Workspace.ID | undefined;
1044
+ } | undefined;
1045
+ readonly data: {
1046
+ readonly sessionID: Session.ID;
1047
+ readonly assistantMessageID: SessionMessage.ID;
1048
+ };
1049
+ } | {
1050
+ readonly id: Event.ID;
1051
+ readonly created: number;
1052
+ readonly metadata?: {
1053
+ readonly [x: string]: unknown;
1054
+ } | undefined;
1055
+ readonly type: "session.step.ended";
1056
+ readonly durable: {
1057
+ readonly aggregateID: string;
1058
+ readonly seq: Event.Seq;
1059
+ readonly version: Event.Version;
1060
+ };
1061
+ readonly location?: {
1062
+ readonly directory: AbsolutePath;
1063
+ readonly workspaceID?: Workspace.ID | undefined;
1064
+ } | undefined;
1065
+ readonly data: {
1066
+ readonly sessionID: Session.ID;
1067
+ readonly assistantMessageID: SessionMessage.ID;
1068
+ readonly finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
1069
+ readonly rawFinish?: string | undefined;
1070
+ readonly native?: SessionMessage.Native | undefined;
1071
+ readonly cost: Money.USD;
1072
+ readonly tokens: {
1073
+ readonly input: number;
1074
+ readonly output: number;
1075
+ readonly reasoning: number;
1076
+ readonly cache: {
1077
+ readonly read: number;
1078
+ readonly write: number;
1079
+ };
1080
+ };
1081
+ readonly snapshot?: Snapshot.ID | undefined;
1082
+ readonly files?: ReadonlyArray<RelativePath> | undefined;
1083
+ };
1084
+ } | {
1085
+ readonly id: Event.ID;
1086
+ readonly created: number;
1087
+ readonly metadata?: {
1088
+ readonly [x: string]: unknown;
1089
+ } | undefined;
1090
+ readonly type: "session.step.failed";
1091
+ readonly durable: {
1092
+ readonly aggregateID: string;
1093
+ readonly seq: Event.Seq;
1094
+ readonly version: Event.Version;
1095
+ };
1096
+ readonly location?: {
1097
+ readonly directory: AbsolutePath;
1098
+ readonly workspaceID?: Workspace.ID | undefined;
1099
+ } | undefined;
1100
+ readonly data: {
1101
+ readonly sessionID: Session.ID;
1102
+ readonly assistantMessageID: SessionMessage.ID;
1103
+ readonly error: {
1104
+ readonly type: string;
1105
+ readonly message: string;
1106
+ readonly status?: number | undefined;
1107
+ readonly response?: {
1108
+ readonly body: string;
1109
+ } | undefined;
1110
+ readonly retryAfterMs?: number | undefined;
1111
+ };
1112
+ readonly finish?: "content-filter" | undefined;
1113
+ readonly rawFinish?: string | undefined;
1114
+ readonly native?: SessionMessage.Native | undefined;
1115
+ readonly cost?: Money.USD | undefined;
1116
+ readonly tokens?: {
1117
+ readonly input: number;
1118
+ readonly output: number;
1119
+ readonly reasoning: number;
1120
+ readonly cache: {
1121
+ readonly read: number;
1122
+ readonly write: number;
1123
+ };
1124
+ } | undefined;
1125
+ readonly snapshot?: Snapshot.ID | undefined;
1126
+ readonly files?: ReadonlyArray<RelativePath> | undefined;
1127
+ };
1128
+ } | {
1129
+ readonly id: Event.ID;
1130
+ readonly created: number;
1131
+ readonly metadata?: {
1132
+ readonly [x: string]: unknown;
1133
+ } | undefined;
1134
+ readonly type: "session.text.started";
1135
+ readonly durable: {
1136
+ readonly aggregateID: string;
1137
+ readonly seq: Event.Seq;
1138
+ readonly version: Event.Version;
1139
+ };
1140
+ readonly location?: {
1141
+ readonly directory: AbsolutePath;
1142
+ readonly workspaceID?: Workspace.ID | undefined;
1143
+ } | undefined;
1144
+ readonly data: {
1145
+ readonly sessionID: Session.ID;
1146
+ readonly assistantMessageID: SessionMessage.ID;
1147
+ readonly ordinal: number;
1148
+ };
1149
+ } | {
1150
+ readonly id: Event.ID;
1151
+ readonly created: number;
1152
+ readonly metadata?: {
1153
+ readonly [x: string]: unknown;
1154
+ } | undefined;
1155
+ readonly type: "session.text.ended";
1156
+ readonly durable: {
1157
+ readonly aggregateID: string;
1158
+ readonly seq: Event.Seq;
1159
+ readonly version: Event.Version;
1160
+ };
1161
+ readonly location?: {
1162
+ readonly directory: AbsolutePath;
1163
+ readonly workspaceID?: Workspace.ID | undefined;
1164
+ } | undefined;
1165
+ readonly data: {
1166
+ readonly sessionID: Session.ID;
1167
+ readonly assistantMessageID: SessionMessage.ID;
1168
+ readonly ordinal: number;
1169
+ readonly text: string;
1170
+ readonly native?: SessionMessage.Native | undefined;
1171
+ };
1172
+ } | {
1173
+ readonly id: Event.ID;
1174
+ readonly created: number;
1175
+ readonly metadata?: {
1176
+ readonly [x: string]: unknown;
1177
+ } | undefined;
1178
+ readonly type: "session.reasoning.started";
1179
+ readonly durable: {
1180
+ readonly aggregateID: string;
1181
+ readonly seq: Event.Seq;
1182
+ readonly version: Event.Version;
1183
+ };
1184
+ readonly location?: {
1185
+ readonly directory: AbsolutePath;
1186
+ readonly workspaceID?: Workspace.ID | undefined;
1187
+ } | undefined;
1188
+ readonly data: {
1189
+ readonly sessionID: Session.ID;
1190
+ readonly assistantMessageID: SessionMessage.ID;
1191
+ readonly ordinal: number;
1192
+ readonly native?: SessionMessage.Native | undefined;
1193
+ };
1194
+ } | {
1195
+ readonly id: Event.ID;
1196
+ readonly created: number;
1197
+ readonly metadata?: {
1198
+ readonly [x: string]: unknown;
1199
+ } | undefined;
1200
+ readonly type: "session.reasoning.ended";
1201
+ readonly durable: {
1202
+ readonly aggregateID: string;
1203
+ readonly seq: Event.Seq;
1204
+ readonly version: Event.Version;
1205
+ };
1206
+ readonly location?: {
1207
+ readonly directory: AbsolutePath;
1208
+ readonly workspaceID?: Workspace.ID | undefined;
1209
+ } | undefined;
1210
+ readonly data: {
1211
+ readonly sessionID: Session.ID;
1212
+ readonly assistantMessageID: SessionMessage.ID;
1213
+ readonly ordinal: number;
1214
+ readonly text: string;
1215
+ readonly native?: SessionMessage.Native | undefined;
1216
+ };
1217
+ } | {
1218
+ readonly id: Event.ID;
1219
+ readonly created: number;
1220
+ readonly metadata?: {
1221
+ readonly [x: string]: unknown;
1222
+ } | undefined;
1223
+ readonly type: "session.tool.input.started";
1224
+ readonly durable: {
1225
+ readonly aggregateID: string;
1226
+ readonly seq: Event.Seq;
1227
+ readonly version: Event.Version;
1228
+ };
1229
+ readonly location?: {
1230
+ readonly directory: AbsolutePath;
1231
+ readonly workspaceID?: Workspace.ID | undefined;
1232
+ } | undefined;
1233
+ readonly data: {
1234
+ readonly sessionID: Session.ID;
1235
+ readonly assistantMessageID: SessionMessage.ID;
1236
+ readonly id: string;
1237
+ readonly name: string;
1238
+ };
1239
+ } | {
1240
+ readonly id: Event.ID;
1241
+ readonly created: number;
1242
+ readonly metadata?: {
1243
+ readonly [x: string]: unknown;
1244
+ } | undefined;
1245
+ readonly type: "session.tool.input.ended";
1246
+ readonly durable: {
1247
+ readonly aggregateID: string;
1248
+ readonly seq: Event.Seq;
1249
+ readonly version: Event.Version;
1250
+ };
1251
+ readonly location?: {
1252
+ readonly directory: AbsolutePath;
1253
+ readonly workspaceID?: Workspace.ID | undefined;
1254
+ } | undefined;
1255
+ readonly data: {
1256
+ readonly sessionID: Session.ID;
1257
+ readonly assistantMessageID: SessionMessage.ID;
1258
+ readonly id: string;
1259
+ readonly text: string;
1260
+ };
1261
+ } | {
1262
+ readonly id: Event.ID;
1263
+ readonly created: number;
1264
+ readonly metadata?: {
1265
+ readonly [x: string]: unknown;
1266
+ } | undefined;
1267
+ readonly type: "session.tool.called";
1268
+ readonly durable: {
1269
+ readonly aggregateID: string;
1270
+ readonly seq: Event.Seq;
1271
+ readonly version: Event.Version;
1272
+ };
1273
+ readonly location?: {
1274
+ readonly directory: AbsolutePath;
1275
+ readonly workspaceID?: Workspace.ID | undefined;
1276
+ } | undefined;
1277
+ readonly data: {
1278
+ readonly sessionID: Session.ID;
1279
+ readonly assistantMessageID: SessionMessage.ID;
1280
+ readonly id: string;
1281
+ readonly input: {
1282
+ readonly [x: string]: unknown;
1283
+ };
1284
+ readonly executed: boolean;
1285
+ readonly native?: SessionMessage.Native | undefined;
1286
+ };
1287
+ } | {
1288
+ readonly id: Event.ID;
1289
+ readonly created: number;
1290
+ readonly metadata?: {
1291
+ readonly [x: string]: unknown;
1292
+ } | undefined;
1293
+ readonly type: "session.tool.success";
1294
+ readonly durable: {
1295
+ readonly aggregateID: string;
1296
+ readonly seq: Event.Seq;
1297
+ readonly version: Event.Version;
1298
+ };
1299
+ readonly location?: {
1300
+ readonly directory: AbsolutePath;
1301
+ readonly workspaceID?: Workspace.ID | undefined;
1302
+ } | undefined;
1303
+ readonly data: {
1304
+ readonly sessionID: Session.ID;
1305
+ readonly assistantMessageID: SessionMessage.ID;
1306
+ readonly id: string;
1307
+ readonly content: readonly [
1308
+ ({
1309
+ readonly type: "text";
1310
+ readonly text: string;
1311
+ } | {
1312
+ readonly type: "file";
1313
+ readonly uri: string;
1314
+ readonly mime: string;
1315
+ readonly name?: string | undefined;
1316
+ }),
1317
+ ...Array<{
1318
+ readonly type: "text";
1319
+ readonly text: string;
1320
+ } | {
1321
+ readonly type: "file";
1322
+ readonly uri: string;
1323
+ readonly mime: string;
1324
+ readonly name?: string | undefined;
1325
+ }>
1326
+ ];
1327
+ readonly metadata?: {
1328
+ readonly [x: string]: Schema.Json;
1329
+ } | undefined;
1330
+ readonly executed: boolean;
1331
+ readonly native?: SessionMessage.Native | undefined;
1332
+ };
1333
+ } | {
1334
+ readonly id: Event.ID;
1335
+ readonly created: number;
1336
+ readonly metadata?: {
1337
+ readonly [x: string]: unknown;
1338
+ } | undefined;
1339
+ readonly type: "session.tool.failed";
1340
+ readonly durable: {
1341
+ readonly aggregateID: string;
1342
+ readonly seq: Event.Seq;
1343
+ readonly version: Event.Version;
1344
+ };
1345
+ readonly location?: {
1346
+ readonly directory: AbsolutePath;
1347
+ readonly workspaceID?: Workspace.ID | undefined;
1348
+ } | undefined;
1349
+ readonly data: {
1350
+ readonly sessionID: Session.ID;
1351
+ readonly assistantMessageID: SessionMessage.ID;
1352
+ readonly id: string;
1353
+ readonly error: {
1354
+ readonly type: string;
1355
+ readonly message: string;
1356
+ readonly status?: number | undefined;
1357
+ readonly response?: {
1358
+ readonly body: string;
1359
+ } | undefined;
1360
+ readonly retryAfterMs?: number | undefined;
1361
+ };
1362
+ readonly content?: readonly [
1363
+ ({
1364
+ readonly type: "text";
1365
+ readonly text: string;
1366
+ } | {
1367
+ readonly type: "file";
1368
+ readonly uri: string;
1369
+ readonly mime: string;
1370
+ readonly name?: string | undefined;
1371
+ }),
1372
+ ...Array<{
1373
+ readonly type: "text";
1374
+ readonly text: string;
1375
+ } | {
1376
+ readonly type: "file";
1377
+ readonly uri: string;
1378
+ readonly mime: string;
1379
+ readonly name?: string | undefined;
1380
+ }>
1381
+ ] | undefined;
1382
+ readonly metadata?: {
1383
+ readonly [x: string]: Schema.Json;
1384
+ } | undefined;
1385
+ readonly executed: boolean;
1386
+ readonly native?: SessionMessage.Native | undefined;
1387
+ };
1388
+ } | {
1389
+ readonly id: Event.ID;
1390
+ readonly created: number;
1391
+ readonly metadata?: {
1392
+ readonly [x: string]: unknown;
1393
+ } | undefined;
1394
+ readonly type: "session.retry.scheduled";
1395
+ readonly durable: {
1396
+ readonly aggregateID: string;
1397
+ readonly seq: Event.Seq;
1398
+ readonly version: Event.Version;
1399
+ };
1400
+ readonly location?: {
1401
+ readonly directory: AbsolutePath;
1402
+ readonly workspaceID?: Workspace.ID | undefined;
1403
+ } | undefined;
1404
+ readonly data: {
1405
+ readonly sessionID: Session.ID;
1406
+ readonly assistantMessageID: SessionMessage.ID;
1407
+ readonly attempt: number;
1408
+ readonly at: number;
1409
+ readonly error: {
1410
+ readonly type: string;
1411
+ readonly message: string;
1412
+ readonly status?: number | undefined;
1413
+ readonly response?: {
1414
+ readonly body: string;
1415
+ } | undefined;
1416
+ readonly retryAfterMs?: number | undefined;
1417
+ };
1418
+ };
1419
+ } | {
1420
+ readonly id: Event.ID;
1421
+ readonly created: number;
1422
+ readonly metadata?: {
1423
+ readonly [x: string]: unknown;
1424
+ } | undefined;
1425
+ readonly type: "session.compaction.started";
1426
+ readonly durable: {
1427
+ readonly aggregateID: string;
1428
+ readonly seq: Event.Seq;
1429
+ readonly version: Event.Version;
1430
+ };
1431
+ readonly location?: {
1432
+ readonly directory: AbsolutePath;
1433
+ readonly workspaceID?: Workspace.ID | undefined;
1434
+ } | undefined;
1435
+ readonly data: {
1436
+ readonly sessionID: Session.ID;
1437
+ readonly reason: "auto" | "manual";
1438
+ readonly inputID?: SessionMessage.ID | undefined;
1439
+ };
1440
+ } | {
1441
+ readonly id: Event.ID;
1442
+ readonly created: number;
1443
+ readonly metadata?: {
1444
+ readonly [x: string]: unknown;
1445
+ } | undefined;
1446
+ readonly type: "session.compaction.ended";
1447
+ readonly durable: {
1448
+ readonly aggregateID: string;
1449
+ readonly seq: Event.Seq;
1450
+ readonly version: Event.Version;
1451
+ };
1452
+ readonly location?: {
1453
+ readonly directory: AbsolutePath;
1454
+ readonly workspaceID?: Workspace.ID | undefined;
1455
+ } | undefined;
1456
+ readonly data: {
1457
+ readonly sessionID: Session.ID;
1458
+ readonly reason: "auto" | "manual";
1459
+ readonly model?: Model.Ref | undefined;
1460
+ readonly native?: SessionMessage.Native | undefined;
1461
+ readonly text: string;
1462
+ readonly cost?: Money.USD | undefined;
1463
+ readonly tokens?: {
1464
+ readonly input: number;
1465
+ readonly output: number;
1466
+ readonly reasoning: number;
1467
+ readonly cache: {
1468
+ readonly read: number;
1469
+ readonly write: number;
1470
+ };
1471
+ } | undefined;
1472
+ };
1473
+ } | {
1474
+ readonly id: Event.ID;
1475
+ readonly created: number;
1476
+ readonly metadata?: {
1477
+ readonly [x: string]: unknown;
1478
+ } | undefined;
1479
+ readonly type: "session.compaction.failed";
1480
+ readonly durable: {
1481
+ readonly aggregateID: string;
1482
+ readonly seq: Event.Seq;
1483
+ readonly version: Event.Version;
1484
+ };
1485
+ readonly location?: {
1486
+ readonly directory: AbsolutePath;
1487
+ readonly workspaceID?: Workspace.ID | undefined;
1488
+ } | undefined;
1489
+ readonly data: {
1490
+ readonly sessionID: Session.ID;
1491
+ readonly reason: "auto" | "manual";
1492
+ readonly error: {
1493
+ readonly type: string;
1494
+ readonly message: string;
1495
+ readonly status?: number | undefined;
1496
+ readonly response?: {
1497
+ readonly body: string;
1498
+ } | undefined;
1499
+ readonly retryAfterMs?: number | undefined;
1500
+ };
1501
+ readonly inputID?: SessionMessage.ID | undefined;
1502
+ readonly cost?: Money.USD | undefined;
1503
+ readonly tokens?: {
1504
+ readonly input: number;
1505
+ readonly output: number;
1506
+ readonly reasoning: number;
1507
+ readonly cache: {
1508
+ readonly read: number;
1509
+ readonly write: number;
1510
+ };
1511
+ } | undefined;
1512
+ };
1513
+ } | {
1514
+ readonly id: Event.ID;
1515
+ readonly created: number;
1516
+ readonly metadata?: {
1517
+ readonly [x: string]: unknown;
1518
+ } | undefined;
1519
+ readonly type: "session.revert.staged";
1520
+ readonly durable: {
1521
+ readonly aggregateID: string;
1522
+ readonly seq: Event.Seq;
1523
+ readonly version: Event.Version;
1524
+ };
1525
+ readonly location?: {
1526
+ readonly directory: AbsolutePath;
1527
+ readonly workspaceID?: Workspace.ID | undefined;
1528
+ } | undefined;
1529
+ readonly data: {
1530
+ readonly sessionID: Session.ID;
1531
+ readonly revert: Session.Revert;
1532
+ };
1533
+ } | {
1534
+ readonly id: Event.ID;
1535
+ readonly created: number;
1536
+ readonly metadata?: {
1537
+ readonly [x: string]: unknown;
1538
+ } | undefined;
1539
+ readonly type: "session.revert.cleared";
1540
+ readonly durable: {
1541
+ readonly aggregateID: string;
1542
+ readonly seq: Event.Seq;
1543
+ readonly version: Event.Version;
1544
+ };
1545
+ readonly location?: {
1546
+ readonly directory: AbsolutePath;
1547
+ readonly workspaceID?: Workspace.ID | undefined;
1548
+ } | undefined;
1549
+ readonly data: {
1550
+ readonly sessionID: Session.ID;
1551
+ };
1552
+ } | {
1553
+ readonly id: Event.ID;
1554
+ readonly created: number;
1555
+ readonly metadata?: {
1556
+ readonly [x: string]: unknown;
1557
+ } | undefined;
1558
+ readonly type: "session.revert.committed";
1559
+ readonly durable: {
1560
+ readonly aggregateID: string;
1561
+ readonly seq: Event.Seq;
1562
+ readonly version: Event.Version;
1563
+ };
1564
+ readonly location?: {
1565
+ readonly directory: AbsolutePath;
1566
+ readonly workspaceID?: Workspace.ID | undefined;
1567
+ } | undefined;
1568
+ readonly data: {
1569
+ readonly sessionID: Session.ID;
1570
+ readonly to: SessionMessage.ID;
1571
+ };
1572
+ } | {
1573
+ readonly id: Event.ID;
1574
+ readonly created: number;
1575
+ readonly metadata?: {
1576
+ readonly [x: string]: unknown;
1577
+ } | undefined;
1578
+ readonly type: "session.usage.recorded";
1579
+ readonly durable: {
1580
+ readonly aggregateID: string;
1581
+ readonly seq: Event.Seq;
1582
+ readonly version: Event.Version;
1583
+ };
1584
+ readonly location?: {
1585
+ readonly directory: AbsolutePath;
1586
+ readonly workspaceID?: Workspace.ID | undefined;
1587
+ } | undefined;
1588
+ readonly data: {
1589
+ readonly sessionID: Session.ID;
1590
+ readonly source: "title" | "compaction";
1591
+ readonly cost: Money.USD;
1592
+ readonly tokens: {
1593
+ readonly input: number;
1594
+ readonly output: number;
1595
+ readonly reasoning: number;
1596
+ readonly cache: {
1597
+ readonly read: number;
1598
+ readonly write: number;
1599
+ };
1600
+ };
1601
+ };
1602
+ } | {
1603
+ readonly id: Event.ID;
1604
+ readonly created: number;
1605
+ readonly metadata?: {
1606
+ readonly [x: string]: unknown;
1607
+ } | undefined;
1608
+ readonly type: "session.message.content.updated";
1609
+ readonly durable: {
1610
+ readonly aggregateID: string;
1611
+ readonly seq: Event.Seq;
1612
+ readonly version: Event.Version;
1613
+ };
1614
+ readonly location?: {
1615
+ readonly directory: AbsolutePath;
1616
+ readonly workspaceID?: Workspace.ID | undefined;
1617
+ } | undefined;
1618
+ readonly data: {
1619
+ readonly sessionID: Session.ID;
1620
+ readonly messageID: SessionMessage.ID;
1621
+ readonly content: ReadonlyArray<SessionMessage.AssistantContentEncoded>;
1622
+ };
1623
+ }) | EventLog.Synced;
1624
+ export type SessionLogOperation<E = never> = (input: SessionLogInput) => Stream.Stream<SessionLogOutput, E>;
1625
+ export type SessionInterruptInput = {
1626
+ readonly sessionID: Session.ID;
1627
+ readonly resume?: boolean | undefined;
1628
+ };
1629
+ export type SessionInterruptOutput = {
1630
+ readonly interrupted: boolean;
1631
+ };
1632
+ export type SessionInterruptOperation<E = never> = (input: SessionInterruptInput) => Effect.Effect<SessionInterruptOutput, E>;
1633
+ export type SessionBackgroundInput = {
1634
+ readonly sessionID: Session.ID;
1635
+ };
1636
+ export type SessionBackgroundOutput = void;
1637
+ export type SessionBackgroundOperation<E = never> = (input: SessionBackgroundInput) => Effect.Effect<SessionBackgroundOutput, E>;
1638
+ export type SessionMessageGetInput = {
1639
+ readonly sessionID: Session.ID;
1640
+ readonly messageID: SessionMessage.ID;
1641
+ };
1642
+ export type SessionMessageGetOutput = SessionMessage.Info;
1643
+ export type SessionMessageGetOperation<E = never> = (input: SessionMessageGetInput) => Effect.Effect<SessionMessageGetOutput, E>;
1644
+ export type SessionFormListInput = {
1645
+ readonly sessionID: string;
1646
+ };
1647
+ export type SessionFormListOutput = ReadonlyArray<Form.Info>;
1648
+ export type SessionFormListOperation<E = never> = (input: SessionFormListInput) => Effect.Effect<SessionFormListOutput, E>;
1649
+ export type SessionFormCreateInput = {
1650
+ readonly sessionID: string;
1651
+ readonly id?: Form.ID | undefined;
1652
+ readonly title: string;
1653
+ readonly metadata?: Form.Metadata | undefined;
1654
+ readonly fields: Form.Fields;
1655
+ };
1656
+ export type SessionFormCreateOutput = Form.Info;
1657
+ export type SessionFormCreateOperation<E = never> = (input: SessionFormCreateInput) => Effect.Effect<SessionFormCreateOutput, E>;
1658
+ export type SessionFormGetInput = {
1659
+ readonly sessionID: string;
1660
+ readonly formID: Form.ID;
1661
+ };
1662
+ export type SessionFormGetOutput = Form.Detail;
1663
+ export type SessionFormGetOperation<E = never> = (input: SessionFormGetInput) => Effect.Effect<SessionFormGetOutput, E>;
1664
+ export type SessionFormReplyInput = {
1665
+ readonly sessionID: string;
1666
+ readonly formID: Form.ID;
1667
+ readonly answer: Form.Answer;
1668
+ };
1669
+ export type SessionFormReplyOutput = void;
1670
+ export type SessionFormReplyOperation<E = never> = (input: SessionFormReplyInput) => Effect.Effect<SessionFormReplyOutput, E>;
1671
+ export type SessionFormCancelInput = {
1672
+ readonly sessionID: string;
1673
+ readonly formID: Form.ID;
1674
+ readonly message?: string | undefined;
1675
+ };
1676
+ export type SessionFormCancelOutput = void;
1677
+ export type SessionFormCancelOperation<E = never> = (input: SessionFormCancelInput) => Effect.Effect<SessionFormCancelOutput, E>;
1678
+ export type SessionEnvironmentInput = {
1679
+ readonly sessionID: Session.ID;
1680
+ readonly variables: {
1681
+ readonly [x: string]: string;
1682
+ };
1683
+ };
1684
+ export type SessionEnvironmentOutput = void;
1685
+ export type SessionEnvironmentOperation<E = never> = (input: SessionEnvironmentInput) => Effect.Effect<SessionEnvironmentOutput, E>;
1686
+ export type SessionViewInput = {
1687
+ readonly sessionID: Session.ID;
1688
+ readonly idle: DateTime.Utc;
1689
+ };
1690
+ export type SessionViewOutput = void;
1691
+ export type SessionViewOperation<E = never> = (input: SessionViewInput) => Effect.Effect<SessionViewOutput, E>;
1692
+ export interface SessionApi<E = never> {
1693
+ readonly list: SessionListOperation<E>;
1694
+ readonly stats: SessionStatsOperation<E>;
1695
+ readonly create: SessionCreateOperation<E>;
1696
+ readonly import: SessionImportOperation<E>;
1697
+ readonly export: SessionExportOperation<E>;
1698
+ readonly active: SessionActiveOperation<E>;
1699
+ readonly get: SessionGetOperation<E>;
1700
+ readonly remove: SessionRemoveOperation<E>;
1701
+ readonly fork: SessionForkOperation<E>;
1702
+ readonly switchAgent: SessionSwitchAgentOperation<E>;
1703
+ readonly switchModel: SessionSwitchModelOperation<E>;
1704
+ readonly update: SessionUpdateOperation<E>;
1705
+ readonly move: SessionMoveOperation<E>;
1706
+ readonly prompt: SessionPromptOperation<E>;
1707
+ readonly command: SessionCommandOperation<E>;
1708
+ readonly skill: SessionSkillOperation<E>;
1709
+ readonly synthetic: SessionSyntheticOperation<E>;
1710
+ readonly shell: SessionShellOperation<E>;
1711
+ readonly compact: SessionCompactOperation<E>;
1712
+ readonly wait: SessionWaitOperation<E>;
1713
+ readonly revert: {
1714
+ readonly stage: SessionRevertStageOperation<E>;
1715
+ readonly clear: SessionRevertClearOperation<E>;
1716
+ readonly commit: SessionRevertCommitOperation<E>;
1717
+ };
1718
+ readonly context: SessionContextOperation<E>;
1719
+ readonly diff: SessionDiffOperation<E>;
1720
+ readonly inbox: {
1721
+ readonly list: SessionInboxListOperation<E>;
1722
+ readonly cancel: SessionInboxCancelOperation<E>;
1723
+ readonly update: SessionInboxUpdateOperation<E>;
1724
+ };
1725
+ readonly instructions: {
1726
+ readonly entry: {
1727
+ readonly list: SessionInstructionsEntryListOperation<E>;
1728
+ readonly put: SessionInstructionsEntryPutOperation<E>;
1729
+ readonly remove: SessionInstructionsEntryRemoveOperation<E>;
1730
+ };
1731
+ };
1732
+ readonly generate: SessionGenerateOperation<E>;
1733
+ readonly log: SessionLogOperation<E>;
1734
+ readonly interrupt: SessionInterruptOperation<E>;
1735
+ readonly background: SessionBackgroundOperation<E>;
1736
+ readonly message: {
1737
+ readonly get: SessionMessageGetOperation<E>;
1738
+ };
1739
+ readonly form: {
1740
+ readonly list: SessionFormListOperation<E>;
1741
+ readonly create: SessionFormCreateOperation<E>;
1742
+ readonly get: SessionFormGetOperation<E>;
1743
+ readonly reply: SessionFormReplyOperation<E>;
1744
+ readonly cancel: SessionFormCancelOperation<E>;
1745
+ };
1746
+ readonly environment: SessionEnvironmentOperation<E>;
1747
+ readonly view: SessionViewOperation<E>;
1748
+ }
1749
+ export type MessageListInput = {
1750
+ readonly sessionID: Session.ID;
1751
+ readonly limit?: number | undefined;
1752
+ readonly order?: "asc" | "desc" | undefined;
1753
+ readonly cursor?: string | undefined;
1754
+ readonly type?: "agent-switched" | "model-switched" | "location-switched" | "user" | "synthetic" | "system" | "skill" | "shell" | "assistant" | "compaction" | "idle" | undefined;
1755
+ };
1756
+ export type MessageListOutput = {
1757
+ readonly data: ReadonlyArray<SessionMessage.Info>;
1758
+ readonly cursor: {
1759
+ readonly previous?: string | undefined;
1760
+ readonly next?: string | undefined;
1761
+ };
1762
+ };
1763
+ export type MessageListOperation<E = never> = (input: MessageListInput) => Effect.Effect<MessageListOutput, E>;
1764
+ export interface MessageApi<E = never> {
1765
+ readonly list: MessageListOperation<E>;
1766
+ }
1767
+ export type ModelListInput = {
1768
+ readonly location?: {
1769
+ readonly directory?: string | undefined;
1770
+ } | undefined;
1771
+ };
1772
+ export type ModelListOutput = {
1773
+ readonly location: Location.PublicRef;
1774
+ readonly data: ReadonlyArray<Model.Info>;
1775
+ };
1776
+ export type ModelListOperation<E = never> = (input?: ModelListInput) => Effect.Effect<ModelListOutput, E>;
1777
+ export type ModelDefaultInput = {
1778
+ readonly location?: {
1779
+ readonly directory?: string | undefined;
1780
+ } | undefined;
1781
+ };
1782
+ export type ModelDefaultOutput = {
1783
+ readonly location: Location.PublicRef;
1784
+ readonly data: Model.Info | undefined;
1785
+ };
1786
+ export type ModelDefaultOperation<E = never> = (input?: ModelDefaultInput) => Effect.Effect<ModelDefaultOutput, E>;
1787
+ export interface ModelApi<E = never> {
1788
+ readonly list: ModelListOperation<E>;
1789
+ readonly default: ModelDefaultOperation<E>;
1790
+ }
1791
+ export type GenerateTextInput = {
1792
+ readonly prompt: string;
1793
+ readonly model?: Model.Ref | undefined;
1794
+ };
1795
+ export type GenerateTextOutput = {
1796
+ readonly text: string;
1797
+ };
1798
+ export type GenerateTextOperation<E = never> = (input: GenerateTextInput) => Effect.Effect<GenerateTextOutput, E>;
1799
+ export interface GenerateApi<E = never> {
1800
+ readonly text: GenerateTextOperation<E>;
1801
+ }
1802
+ export type VoiceModelsOutput = {
1803
+ readonly models: ReadonlyArray<{
1804
+ readonly model: string;
1805
+ readonly provider: string;
1806
+ readonly transports: ReadonlyArray<"webrtc" | "websocket">;
1807
+ readonly available: boolean;
1808
+ readonly integration?: string | undefined;
1809
+ readonly workspace?: string | undefined;
1810
+ }>;
1811
+ readonly default?: string | undefined;
1812
+ };
1813
+ export type VoiceModelsOperation<E = never> = () => Effect.Effect<VoiceModelsOutput, E>;
1814
+ export type VoiceSessionInput = {
1815
+ readonly model: string;
1816
+ readonly session?: {
1817
+ readonly [x: string]: unknown;
1818
+ } | undefined;
1819
+ readonly transport: {
1820
+ readonly type: "webrtc";
1821
+ readonly sdp: string;
1822
+ readonly dcid?: number | undefined;
1823
+ } | {
1824
+ readonly type: "websocket";
1825
+ };
1826
+ };
1827
+ export type VoiceSessionOutput = {
1828
+ readonly transport: {
1829
+ readonly type: "webrtc";
1830
+ readonly sdp: string;
1831
+ } | {
1832
+ readonly type: "websocket";
1833
+ readonly url: string;
1834
+ readonly token: string;
1835
+ readonly expiresAt: number;
1836
+ };
1837
+ readonly session?: {
1838
+ readonly id: string;
1839
+ } | undefined;
1840
+ };
1841
+ export type VoiceSessionOperation<E = never> = (input: VoiceSessionInput) => Effect.Effect<VoiceSessionOutput, E>;
1842
+ export type VoiceInstructionsInput = {
1843
+ readonly sessionID: string;
1844
+ readonly instructions: string;
1845
+ };
1846
+ export type VoiceInstructionsOutput = void;
1847
+ export type VoiceInstructionsOperation<E = never> = (input: VoiceInstructionsInput) => Effect.Effect<VoiceInstructionsOutput, E>;
1848
+ export interface VoiceApi<E = never> {
1849
+ readonly models: VoiceModelsOperation<E>;
1850
+ readonly session: VoiceSessionOperation<E>;
1851
+ readonly instructions: VoiceInstructionsOperation<E>;
1852
+ }
1853
+ export type ProviderListInput = {
1854
+ readonly location?: {
1855
+ readonly directory?: string | undefined;
1856
+ } | undefined;
1857
+ };
1858
+ export type ProviderListOutput = {
1859
+ readonly location: Location.PublicRef;
1860
+ readonly data: ReadonlyArray<Provider.Info>;
1861
+ };
1862
+ export type ProviderListOperation<E = never> = (input?: ProviderListInput) => Effect.Effect<ProviderListOutput, E>;
1863
+ export type ProviderGetInput = {
1864
+ readonly providerID: Provider.ID;
1865
+ readonly location?: {
1866
+ readonly directory?: string | undefined;
1867
+ } | undefined;
1868
+ };
1869
+ export type ProviderGetOutput = {
1870
+ readonly location: Location.PublicRef;
1871
+ readonly data: Provider.Info;
1872
+ };
1873
+ export type ProviderGetOperation<E = never> = (input: ProviderGetInput) => Effect.Effect<ProviderGetOutput, E>;
1874
+ export interface ProviderApi<E = never> {
1875
+ readonly list: ProviderListOperation<E>;
1876
+ readonly get: ProviderGetOperation<E>;
1877
+ }
1878
+ export type IntegrationListInput = {
1879
+ readonly location?: {
1880
+ readonly directory?: string | undefined;
1881
+ } | undefined;
1882
+ };
1883
+ export type IntegrationListOutput = {
1884
+ readonly location: Location.PublicRef;
1885
+ readonly data: ReadonlyArray<Integration.Info>;
1886
+ };
1887
+ export type IntegrationListOperation<E = never> = (input?: IntegrationListInput) => Effect.Effect<IntegrationListOutput, E>;
1888
+ export type IntegrationGetInput = {
1889
+ readonly integrationID: Integration.ID;
1890
+ readonly location?: {
1891
+ readonly directory?: string | undefined;
1892
+ } | undefined;
1893
+ };
1894
+ export type IntegrationGetOutput = {
1895
+ readonly location: Location.PublicRef;
1896
+ readonly data: Integration.Info;
1897
+ };
1898
+ export type IntegrationGetOperation<E = never> = (input: IntegrationGetInput) => Effect.Effect<IntegrationGetOutput, E>;
1899
+ export type IntegrationWellknownAddInput = {
1900
+ readonly location?: {
1901
+ readonly directory?: string | undefined;
1902
+ } | undefined;
1903
+ readonly url: string;
1904
+ };
1905
+ export type IntegrationWellknownAddOutput = void;
1906
+ export type IntegrationWellknownAddOperation<E = never> = (input: IntegrationWellknownAddInput) => Effect.Effect<IntegrationWellknownAddOutput, E>;
1907
+ export type IntegrationConnectKeyInput = {
1908
+ readonly integrationID: Integration.ID;
1909
+ readonly location?: {
1910
+ readonly directory?: string | undefined;
1911
+ } | undefined;
1912
+ readonly key: string;
1913
+ readonly answer?: Form.Answer | undefined;
1914
+ readonly label?: string | undefined;
1915
+ };
1916
+ export type IntegrationConnectKeyOutput = void;
1917
+ export type IntegrationConnectKeyOperation<E = never> = (input: IntegrationConnectKeyInput) => Effect.Effect<IntegrationConnectKeyOutput, E>;
1918
+ export type IntegrationConnectExternalInput = {
1919
+ readonly integrationID: Integration.ID;
1920
+ readonly location?: {
1921
+ readonly directory?: string | undefined;
1922
+ } | undefined;
1923
+ readonly methodID: Integration.MethodID;
1924
+ readonly answer?: Form.Answer | undefined;
1925
+ readonly label?: string | undefined;
1926
+ };
1927
+ export type IntegrationConnectExternalOutput = void;
1928
+ export type IntegrationConnectExternalOperation<E = never> = (input: IntegrationConnectExternalInput) => Effect.Effect<IntegrationConnectExternalOutput, E>;
1929
+ export type IntegrationOauthConnectInput = {
1930
+ readonly integrationID: Integration.ID;
1931
+ readonly location?: {
1932
+ readonly directory?: string | undefined;
1933
+ } | undefined;
1934
+ readonly methodID: Integration.MethodID;
1935
+ readonly answer?: Form.Answer | undefined;
1936
+ readonly label?: string | undefined;
1937
+ };
1938
+ export type IntegrationOauthConnectOutput = {
1939
+ readonly location: Location.PublicRef;
1940
+ readonly data: Integration.Attempt;
1941
+ };
1942
+ export type IntegrationOauthConnectOperation<E = never> = (input: IntegrationOauthConnectInput) => Effect.Effect<IntegrationOauthConnectOutput, E>;
1943
+ export type IntegrationOauthStatusInput = {
1944
+ readonly integrationID: Integration.ID;
1945
+ readonly attemptID: Integration.AttemptID;
1946
+ readonly location?: {
1947
+ readonly directory?: string | undefined;
1948
+ } | undefined;
1949
+ };
1950
+ export type IntegrationOauthStatusOutput = {
1951
+ readonly location: Location.PublicRef;
1952
+ readonly data: Integration.AttemptStatus;
1953
+ };
1954
+ export type IntegrationOauthStatusOperation<E = never> = (input: IntegrationOauthStatusInput) => Effect.Effect<IntegrationOauthStatusOutput, E>;
1955
+ export type IntegrationOauthCompleteInput = {
1956
+ readonly integrationID: Integration.ID;
1957
+ readonly attemptID: Integration.AttemptID;
1958
+ readonly location?: {
1959
+ readonly directory?: string | undefined;
1960
+ } | undefined;
1961
+ readonly code?: string | undefined;
1962
+ };
1963
+ export type IntegrationOauthCompleteOutput = void;
1964
+ export type IntegrationOauthCompleteOperation<E = never> = (input: IntegrationOauthCompleteInput) => Effect.Effect<IntegrationOauthCompleteOutput, E>;
1965
+ export type IntegrationOauthCancelInput = {
1966
+ readonly integrationID: Integration.ID;
1967
+ readonly attemptID: Integration.AttemptID;
1968
+ readonly location?: {
1969
+ readonly directory?: string | undefined;
1970
+ } | undefined;
1971
+ };
1972
+ export type IntegrationOauthCancelOutput = void;
1973
+ export type IntegrationOauthCancelOperation<E = never> = (input: IntegrationOauthCancelInput) => Effect.Effect<IntegrationOauthCancelOutput, E>;
1974
+ export type IntegrationCommandConnectInput = {
1975
+ readonly integrationID: Integration.ID;
1976
+ readonly location?: {
1977
+ readonly directory?: string | undefined;
1978
+ } | undefined;
1979
+ readonly methodID: Integration.MethodID;
1980
+ readonly label?: string | undefined;
1981
+ };
1982
+ export type IntegrationCommandConnectOutput = {
1983
+ readonly location: Location.PublicRef;
1984
+ readonly data: Integration.CommandAttempt;
1985
+ };
1986
+ export type IntegrationCommandConnectOperation<E = never> = (input: IntegrationCommandConnectInput) => Effect.Effect<IntegrationCommandConnectOutput, E>;
1987
+ export type IntegrationCommandStatusInput = {
1988
+ readonly integrationID: Integration.ID;
1989
+ readonly attemptID: Integration.AttemptID;
1990
+ readonly location?: {
1991
+ readonly directory?: string | undefined;
1992
+ } | undefined;
1993
+ };
1994
+ export type IntegrationCommandStatusOutput = {
1995
+ readonly location: Location.PublicRef;
1996
+ readonly data: Integration.CommandAttemptStatus;
1997
+ };
1998
+ export type IntegrationCommandStatusOperation<E = never> = (input: IntegrationCommandStatusInput) => Effect.Effect<IntegrationCommandStatusOutput, E>;
1999
+ export type IntegrationCommandCancelInput = {
2000
+ readonly integrationID: Integration.ID;
2001
+ readonly attemptID: Integration.AttemptID;
2002
+ readonly location?: {
2003
+ readonly directory?: string | undefined;
2004
+ } | undefined;
2005
+ };
2006
+ export type IntegrationCommandCancelOutput = void;
2007
+ export type IntegrationCommandCancelOperation<E = never> = (input: IntegrationCommandCancelInput) => Effect.Effect<IntegrationCommandCancelOutput, E>;
2008
+ export interface IntegrationApi<E = never> {
2009
+ readonly list: IntegrationListOperation<E>;
2010
+ readonly get: IntegrationGetOperation<E>;
2011
+ readonly wellknown: {
2012
+ readonly add: IntegrationWellknownAddOperation<E>;
2013
+ };
2014
+ readonly connect: {
2015
+ readonly key: IntegrationConnectKeyOperation<E>;
2016
+ readonly external: IntegrationConnectExternalOperation<E>;
2017
+ };
2018
+ readonly oauth: {
2019
+ readonly connect: IntegrationOauthConnectOperation<E>;
2020
+ readonly status: IntegrationOauthStatusOperation<E>;
2021
+ readonly complete: IntegrationOauthCompleteOperation<E>;
2022
+ readonly cancel: IntegrationOauthCancelOperation<E>;
2023
+ };
2024
+ readonly command: {
2025
+ readonly connect: IntegrationCommandConnectOperation<E>;
2026
+ readonly status: IntegrationCommandStatusOperation<E>;
2027
+ readonly cancel: IntegrationCommandCancelOperation<E>;
2028
+ };
2029
+ }
2030
+ export type McpListInput = {
2031
+ readonly location?: {
2032
+ readonly directory?: string | undefined;
2033
+ } | undefined;
2034
+ };
2035
+ export type McpListOutput = {
2036
+ readonly location: Location.PublicRef;
2037
+ readonly data: ReadonlyArray<Mcp.Server>;
2038
+ };
2039
+ export type McpListOperation<E = never> = (input?: McpListInput) => Effect.Effect<McpListOutput, E>;
2040
+ export type McpAddInput = {
2041
+ readonly server: string;
2042
+ readonly location?: {
2043
+ readonly directory?: string | undefined;
2044
+ } | undefined;
2045
+ readonly config: Mcp.LocalConfig | Mcp.RemoteConfig;
2046
+ };
2047
+ export type McpAddOutput = void;
2048
+ export type McpAddOperation<E = never> = (input: McpAddInput) => Effect.Effect<McpAddOutput, E>;
2049
+ export type McpRemoveInput = {
2050
+ readonly server: string;
2051
+ readonly location?: {
2052
+ readonly directory?: string | undefined;
2053
+ } | undefined;
2054
+ };
2055
+ export type McpRemoveOutput = void;
2056
+ export type McpRemoveOperation<E = never> = (input: McpRemoveInput) => Effect.Effect<McpRemoveOutput, E>;
2057
+ export type McpConnectInput = {
2058
+ readonly server: string;
2059
+ readonly location?: {
2060
+ readonly directory?: string | undefined;
2061
+ } | undefined;
2062
+ };
2063
+ export type McpConnectOutput = void;
2064
+ export type McpConnectOperation<E = never> = (input: McpConnectInput) => Effect.Effect<McpConnectOutput, E>;
2065
+ export type McpDisconnectInput = {
2066
+ readonly server: string;
2067
+ readonly location?: {
2068
+ readonly directory?: string | undefined;
2069
+ } | undefined;
2070
+ };
2071
+ export type McpDisconnectOutput = void;
2072
+ export type McpDisconnectOperation<E = never> = (input: McpDisconnectInput) => Effect.Effect<McpDisconnectOutput, E>;
2073
+ export type McpResourceCatalogInput = {
2074
+ readonly location?: {
2075
+ readonly directory?: string | undefined;
2076
+ } | undefined;
2077
+ };
2078
+ export type McpResourceCatalogOutput = {
2079
+ readonly location: Location.PublicRef;
2080
+ readonly data: Mcp.ResourceCatalog;
2081
+ };
2082
+ export type McpResourceCatalogOperation<E = never> = (input?: McpResourceCatalogInput) => Effect.Effect<McpResourceCatalogOutput, E>;
2083
+ export type McpClientTokenInput = {
2084
+ readonly location?: {
2085
+ readonly directory?: string | undefined;
2086
+ } | undefined;
2087
+ readonly name: string;
2088
+ readonly "x-opencode-ticket"?: string | undefined;
2089
+ };
2090
+ export type McpClientTokenOutput = {
2091
+ readonly location: Location.PublicRef;
2092
+ readonly data: PtyTicket.ConnectToken;
2093
+ };
2094
+ export type McpClientTokenOperation<E = never> = (input: McpClientTokenInput) => Effect.Effect<McpClientTokenOutput, E>;
2095
+ export interface McpApi<E = never> {
2096
+ readonly list: McpListOperation<E>;
2097
+ readonly add: McpAddOperation<E>;
2098
+ readonly remove: McpRemoveOperation<E>;
2099
+ readonly connect: McpConnectOperation<E>;
2100
+ readonly disconnect: McpDisconnectOperation<E>;
2101
+ readonly resource: {
2102
+ readonly catalog: McpResourceCatalogOperation<E>;
2103
+ };
2104
+ readonly client: {
2105
+ readonly token: McpClientTokenOperation<E>;
2106
+ };
2107
+ }
2108
+ export type CredentialListOutput = ReadonlyArray<Credential.Entry>;
2109
+ export type CredentialListOperation<E = never> = () => Effect.Effect<CredentialListOutput, E>;
2110
+ export type CredentialCreateInput = {
2111
+ readonly id?: Credential.ID | undefined;
2112
+ readonly integrationID: Integration.ID;
2113
+ readonly label?: string | undefined;
2114
+ readonly value: Credential.Value;
2115
+ readonly activate?: boolean | undefined;
2116
+ };
2117
+ export type CredentialCreateOutput = Credential.Entry;
2118
+ export type CredentialCreateOperation<E = never> = (input: CredentialCreateInput) => Effect.Effect<CredentialCreateOutput, E>;
2119
+ export type CredentialUpdateInput = {
2120
+ readonly credentialID: Credential.ID;
2121
+ readonly label: string;
2122
+ };
2123
+ export type CredentialUpdateOutput = void;
2124
+ export type CredentialUpdateOperation<E = never> = (input: CredentialUpdateInput) => Effect.Effect<CredentialUpdateOutput, E>;
2125
+ export type CredentialActivateInput = {
2126
+ readonly credentialID: Credential.ID;
2127
+ };
2128
+ export type CredentialActivateOutput = void;
2129
+ export type CredentialActivateOperation<E = never> = (input: CredentialActivateInput) => Effect.Effect<CredentialActivateOutput, E>;
2130
+ export type CredentialRemoveInput = {
2131
+ readonly credentialID: Credential.ID;
2132
+ };
2133
+ export type CredentialRemoveOutput = void;
2134
+ export type CredentialRemoveOperation<E = never> = (input: CredentialRemoveInput) => Effect.Effect<CredentialRemoveOutput, E>;
2135
+ export interface CredentialApi<E = never> {
2136
+ readonly list: CredentialListOperation<E>;
2137
+ readonly create: CredentialCreateOperation<E>;
2138
+ readonly update: CredentialUpdateOperation<E>;
2139
+ readonly activate: CredentialActivateOperation<E>;
2140
+ readonly remove: CredentialRemoveOperation<E>;
2141
+ }
2142
+ export type ProjectListInput = {
2143
+ readonly archived?: boolean | undefined;
2144
+ };
2145
+ export type ProjectListOutput = ReadonlyArray<Project.Info>;
2146
+ export type ProjectListOperation<E = never> = (input?: ProjectListInput) => Effect.Effect<ProjectListOutput, E>;
2147
+ export type ProjectUpdateInput = {
2148
+ readonly projectID: Project.ID;
2149
+ readonly canonical?: AbsolutePath | undefined;
2150
+ readonly name?: string | undefined;
2151
+ readonly icon?: Project.Icon | undefined;
2152
+ readonly commands?: Project.Commands | undefined;
2153
+ };
2154
+ export type ProjectUpdateOutput = Project.Info;
2155
+ export type ProjectUpdateOperation<E = never> = (input: ProjectUpdateInput) => Effect.Effect<ProjectUpdateOutput, E>;
2156
+ export interface ProjectApi<E = never> {
2157
+ readonly list: ProjectListOperation<E>;
2158
+ readonly update: ProjectUpdateOperation<E>;
2159
+ }
2160
+ export type FormListInput = {
2161
+ readonly location?: {
2162
+ readonly directory?: string | undefined;
2163
+ } | undefined;
2164
+ };
2165
+ export type FormListOutput = {
2166
+ readonly location: Location.PublicRef;
2167
+ readonly data: ReadonlyArray<Form.Info>;
2168
+ };
2169
+ export type FormListOperation<E = never> = (input?: FormListInput) => Effect.Effect<FormListOutput, E>;
2170
+ export interface FormApi<E = never> {
2171
+ readonly list: FormListOperation<E>;
2172
+ }
2173
+ export type PermissionRequestListInput = {
2174
+ readonly location?: {
2175
+ readonly directory?: string | undefined;
2176
+ } | undefined;
2177
+ };
2178
+ export type PermissionRequestListOutput = {
2179
+ readonly location: Location.PublicRef;
2180
+ readonly data: ReadonlyArray<Permission.Request>;
2181
+ };
2182
+ export type PermissionRequestListOperation<E = never> = (input?: PermissionRequestListInput) => Effect.Effect<PermissionRequestListOutput, E>;
2183
+ export type PermissionSavedListInput = {
2184
+ readonly projectID?: Project.ID | undefined;
2185
+ };
2186
+ export type PermissionSavedListOutput = ReadonlyArray<PermissionSaved.Info>;
2187
+ export type PermissionSavedListOperation<E = never> = (input?: PermissionSavedListInput) => Effect.Effect<PermissionSavedListOutput, E>;
2188
+ export type PermissionSavedUpdateInput = {
2189
+ readonly id: PermissionSaved.ID;
2190
+ readonly action?: string | undefined;
2191
+ readonly resource?: string | undefined;
2192
+ };
2193
+ export type PermissionSavedUpdateOutput = PermissionSaved.Info;
2194
+ export type PermissionSavedUpdateOperation<E = never> = (input: PermissionSavedUpdateInput) => Effect.Effect<PermissionSavedUpdateOutput, E>;
2195
+ export type PermissionSavedRemoveInput = {
2196
+ readonly id: PermissionSaved.ID;
2197
+ };
2198
+ export type PermissionSavedRemoveOutput = void;
2199
+ export type PermissionSavedRemoveOperation<E = never> = (input: PermissionSavedRemoveInput) => Effect.Effect<PermissionSavedRemoveOutput, E>;
2200
+ export type PermissionCreateInput = {
2201
+ readonly sessionID: Session.ID;
2202
+ readonly id?: Permission.ID | undefined;
2203
+ readonly action: string;
2204
+ readonly resources: ReadonlyArray<string>;
2205
+ readonly save?: ReadonlyArray<string> | undefined;
2206
+ readonly metadata?: {
2207
+ readonly [x: string]: unknown;
2208
+ } | undefined;
2209
+ readonly source?: Permission.Source | undefined;
2210
+ readonly agent?: Agent.ID | undefined;
2211
+ };
2212
+ export type PermissionCreateOutput = {
2213
+ readonly id: Permission.ID;
2214
+ readonly effect: Permission.Effect;
2215
+ };
2216
+ export type PermissionCreateOperation<E = never> = (input: PermissionCreateInput) => Effect.Effect<PermissionCreateOutput, E>;
2217
+ export type PermissionListInput = {
2218
+ readonly sessionID: Session.ID;
2219
+ };
2220
+ export type PermissionListOutput = ReadonlyArray<Permission.Request>;
2221
+ export type PermissionListOperation<E = never> = (input: PermissionListInput) => Effect.Effect<PermissionListOutput, E>;
2222
+ export type PermissionGetInput = {
2223
+ readonly sessionID: Session.ID;
2224
+ readonly requestID: Permission.ID;
2225
+ };
2226
+ export type PermissionGetOutput = Permission.Request;
2227
+ export type PermissionGetOperation<E = never> = (input: PermissionGetInput) => Effect.Effect<PermissionGetOutput, E>;
2228
+ export type PermissionReplyInput = {
2229
+ readonly sessionID: Session.ID;
2230
+ readonly requestID: Permission.ID;
2231
+ readonly decision: Permission.Reply;
2232
+ readonly message?: string | undefined;
2233
+ };
2234
+ export type PermissionReplyOutput = void;
2235
+ export type PermissionReplyOperation<E = never> = (input: PermissionReplyInput) => Effect.Effect<PermissionReplyOutput, E>;
2236
+ export interface PermissionApi<E = never> {
2237
+ readonly request: {
2238
+ readonly list: PermissionRequestListOperation<E>;
2239
+ };
2240
+ readonly saved: {
2241
+ readonly list: PermissionSavedListOperation<E>;
2242
+ readonly update: PermissionSavedUpdateOperation<E>;
2243
+ readonly remove: PermissionSavedRemoveOperation<E>;
2244
+ };
2245
+ readonly create: PermissionCreateOperation<E>;
2246
+ readonly list: PermissionListOperation<E>;
2247
+ readonly get: PermissionGetOperation<E>;
2248
+ readonly reply: PermissionReplyOperation<E>;
2249
+ }
2250
+ export type FileListInput = {
2251
+ readonly location?: {
2252
+ readonly directory?: string | undefined;
2253
+ } | undefined;
2254
+ readonly path?: string | undefined;
2255
+ };
2256
+ export type FileListOutput = {
2257
+ readonly location: Location.PublicRef;
2258
+ readonly data: ReadonlyArray<FileSystem.Entry>;
2259
+ };
2260
+ export type FileListOperation<E = never> = (input?: FileListInput) => Effect.Effect<FileListOutput, E>;
2261
+ export type FileFindInput = {
2262
+ readonly location?: {
2263
+ readonly directory?: string | undefined;
2264
+ } | undefined;
2265
+ readonly query: string;
2266
+ readonly type?: "file" | "directory" | undefined;
2267
+ readonly limit?: number | undefined;
2268
+ };
2269
+ export type FileFindOutput = {
2270
+ readonly location: Location.PublicRef;
2271
+ readonly data: ReadonlyArray<FileSystem.Entry>;
2272
+ };
2273
+ export type FileFindOperation<E = never> = (input: FileFindInput) => Effect.Effect<FileFindOutput, E>;
2274
+ export interface FileApi<E = never> {
2275
+ readonly list: FileListOperation<E>;
2276
+ readonly find: FileFindOperation<E>;
2277
+ }
2278
+ export type CommandListInput = {
2279
+ readonly location?: {
2280
+ readonly directory?: string | undefined;
2281
+ } | undefined;
2282
+ };
2283
+ export type CommandListOutput = {
2284
+ readonly location: Location.PublicRef;
2285
+ readonly data: ReadonlyArray<Command.Info>;
2286
+ };
2287
+ export type CommandListOperation<E = never> = (input?: CommandListInput) => Effect.Effect<CommandListOutput, E>;
2288
+ export interface CommandApi<E = never> {
2289
+ readonly list: CommandListOperation<E>;
2290
+ }
2291
+ export type SkillListInput = {
2292
+ readonly location?: {
2293
+ readonly directory?: string | undefined;
2294
+ } | undefined;
2295
+ };
2296
+ export type SkillListOutput = {
2297
+ readonly location: Location.PublicRef;
2298
+ readonly data: ReadonlyArray<Skill.Info>;
2299
+ };
2300
+ export type SkillListOperation<E = never> = (input?: SkillListInput) => Effect.Effect<SkillListOutput, E>;
2301
+ export interface SkillApi<E = never> {
2302
+ readonly list: SkillListOperation<E>;
2303
+ }
2304
+ export type RpcCallInput = {
2305
+ readonly rpcID: string;
2306
+ readonly method: string;
2307
+ readonly location?: {
2308
+ readonly directory?: string | undefined;
2309
+ } | undefined;
2310
+ readonly input?: unknown | undefined;
2311
+ };
2312
+ export type RpcCallOutput = {
2313
+ readonly output?: unknown;
2314
+ };
2315
+ export type RpcCallOperation<E = never> = (input: RpcCallInput) => Effect.Effect<RpcCallOutput, E>;
2316
+ export interface RpcApi<E = never> {
2317
+ readonly call: RpcCallOperation<E>;
2318
+ }
2319
+ export type EventSubscribeOutput = OpenCodeEvent;
2320
+ export type EventSubscribeOperation<E = never> = () => Stream.Stream<EventSubscribeOutput, E>;
2321
+ export interface EventApi<E = never> {
2322
+ readonly subscribe: EventSubscribeOperation<E>;
2323
+ }
2324
+ export type PtyListInput = {
2325
+ readonly location?: {
2326
+ readonly directory?: string | undefined;
2327
+ } | undefined;
2328
+ };
2329
+ export type PtyListOutput = {
2330
+ readonly location: Location.PublicRef;
2331
+ readonly data: ReadonlyArray<Pty.Info>;
2332
+ };
2333
+ export type PtyListOperation<E = never> = (input?: PtyListInput) => Effect.Effect<PtyListOutput, E>;
2334
+ export type PtyCreateInput = {
2335
+ readonly location?: {
2336
+ readonly directory?: string | undefined;
2337
+ } | undefined;
2338
+ readonly command?: string | undefined;
2339
+ readonly args?: ReadonlyArray<string> | undefined;
2340
+ readonly cwd?: string | undefined;
2341
+ readonly title?: string | undefined;
2342
+ readonly env?: {
2343
+ readonly [x: string]: string;
2344
+ } | undefined;
2345
+ };
2346
+ export type PtyCreateOutput = {
2347
+ readonly location: Location.PublicRef;
2348
+ readonly data: Pty.Info;
2349
+ };
2350
+ export type PtyCreateOperation<E = never> = (input?: PtyCreateInput) => Effect.Effect<PtyCreateOutput, E>;
2351
+ export type PtyGetInput = {
2352
+ readonly ptyID: Pty.ID;
2353
+ readonly location?: {
2354
+ readonly directory?: string | undefined;
2355
+ } | undefined;
2356
+ };
2357
+ export type PtyGetOutput = {
2358
+ readonly location: Location.PublicRef;
2359
+ readonly data: Pty.Info;
2360
+ };
2361
+ export type PtyGetOperation<E = never> = (input: PtyGetInput) => Effect.Effect<PtyGetOutput, E>;
2362
+ export type PtyUpdateInput = {
2363
+ readonly ptyID: Pty.ID;
2364
+ readonly location?: {
2365
+ readonly directory?: string | undefined;
2366
+ } | undefined;
2367
+ readonly title?: string | undefined;
2368
+ readonly size?: {
2369
+ readonly rows: number;
2370
+ readonly cols: number;
2371
+ } | undefined;
2372
+ };
2373
+ export type PtyUpdateOutput = {
2374
+ readonly location: Location.PublicRef;
2375
+ readonly data: Pty.Info;
2376
+ };
2377
+ export type PtyUpdateOperation<E = never> = (input: PtyUpdateInput) => Effect.Effect<PtyUpdateOutput, E>;
2378
+ export type PtyRemoveInput = {
2379
+ readonly ptyID: Pty.ID;
2380
+ readonly location?: {
2381
+ readonly directory?: string | undefined;
2382
+ } | undefined;
2383
+ };
2384
+ export type PtyRemoveOutput = void;
2385
+ export type PtyRemoveOperation<E = never> = (input: PtyRemoveInput) => Effect.Effect<PtyRemoveOutput, E>;
2386
+ export type PtyConnectTokenInput = {
2387
+ readonly ptyID: Pty.ID;
2388
+ readonly location?: {
2389
+ readonly directory?: string | undefined;
2390
+ } | undefined;
2391
+ readonly "x-opencode-ticket"?: string | undefined;
2392
+ };
2393
+ export type PtyConnectTokenOutput = {
2394
+ readonly location: Location.PublicRef;
2395
+ readonly data: PtyTicket.ConnectToken;
2396
+ };
2397
+ export type PtyConnectTokenOperation<E = never> = (input: PtyConnectTokenInput) => Effect.Effect<PtyConnectTokenOutput, E>;
2398
+ export interface PtyApi<E = never> {
2399
+ readonly list: PtyListOperation<E>;
2400
+ readonly create: PtyCreateOperation<E>;
2401
+ readonly get: PtyGetOperation<E>;
2402
+ readonly update: PtyUpdateOperation<E>;
2403
+ readonly remove: PtyRemoveOperation<E>;
2404
+ readonly connect: {
2405
+ readonly token: PtyConnectTokenOperation<E>;
2406
+ };
2407
+ }
2408
+ export type ExperimentalPersistentPtyReadInput = {
2409
+ readonly sessionID: Session.ID;
2410
+ readonly lines?: number | undefined;
2411
+ };
2412
+ export type ExperimentalPersistentPtyReadOutput = {
2413
+ readonly ptyID: Pty.ID;
2414
+ readonly title: string;
2415
+ readonly cwd: string;
2416
+ readonly foregroundProcess: string | null;
2417
+ readonly screen: {
2418
+ readonly text: string;
2419
+ readonly cols: number;
2420
+ readonly rows: number;
2421
+ readonly cursor: {
2422
+ readonly x: number;
2423
+ readonly y: number;
2424
+ };
2425
+ };
2426
+ } | null;
2427
+ export type ExperimentalPersistentPtyReadOperation<E = never> = (input: ExperimentalPersistentPtyReadInput) => Effect.Effect<ExperimentalPersistentPtyReadOutput, E>;
2428
+ export type ExperimentalPersistentPtyListInput = {
2429
+ readonly sessionID: Session.ID;
2430
+ };
2431
+ export type ExperimentalPersistentPtyListOutput = ReadonlyArray<{
2432
+ readonly id: Pty.ID;
2433
+ readonly title: string;
2434
+ readonly command: string;
2435
+ readonly args: ReadonlyArray<string>;
2436
+ readonly cwd: string;
2437
+ readonly status: "running" | "exited";
2438
+ readonly pid: number;
2439
+ readonly exitCode?: number | undefined;
2440
+ readonly sessionID: Session.ID;
2441
+ readonly foregroundProcess: string | null;
2442
+ readonly size: {
2443
+ readonly cols: number;
2444
+ readonly rows: number;
2445
+ };
2446
+ readonly output: {
2447
+ readonly head: number;
2448
+ readonly tail: number;
2449
+ };
2450
+ }>;
2451
+ export type ExperimentalPersistentPtyListOperation<E = never> = (input: ExperimentalPersistentPtyListInput) => Effect.Effect<ExperimentalPersistentPtyListOutput, E>;
2452
+ export type ExperimentalPersistentPtyCreateInput = {
2453
+ readonly sessionID: Session.ID;
2454
+ readonly command?: string | undefined;
2455
+ readonly args: ReadonlyArray<string>;
2456
+ readonly cwd?: string | undefined;
2457
+ readonly title: string;
2458
+ readonly env: {
2459
+ readonly [x: string]: string;
2460
+ };
2461
+ readonly size?: {
2462
+ readonly cols: number;
2463
+ readonly rows: number;
2464
+ } | undefined;
2465
+ };
2466
+ export type ExperimentalPersistentPtyCreateOutput = {
2467
+ readonly id: Pty.ID;
2468
+ readonly title: string;
2469
+ readonly command: string;
2470
+ readonly args: ReadonlyArray<string>;
2471
+ readonly cwd: string;
2472
+ readonly status: "running" | "exited";
2473
+ readonly pid: number;
2474
+ readonly exitCode?: number | undefined;
2475
+ readonly sessionID: Session.ID;
2476
+ readonly foregroundProcess: string | null;
2477
+ readonly size: {
2478
+ readonly cols: number;
2479
+ readonly rows: number;
2480
+ };
2481
+ readonly output: {
2482
+ readonly head: number;
2483
+ readonly tail: number;
2484
+ };
2485
+ };
2486
+ export type ExperimentalPersistentPtyCreateOperation<E = never> = (input: ExperimentalPersistentPtyCreateInput) => Effect.Effect<ExperimentalPersistentPtyCreateOutput, E>;
2487
+ export type ExperimentalPersistentPtyShutdownOutput = void;
2488
+ export type ExperimentalPersistentPtyShutdownOperation<E = never> = () => Effect.Effect<ExperimentalPersistentPtyShutdownOutput, E>;
2489
+ export type ExperimentalPersistentPtyHandoffOutput = {
2490
+ readonly handoff: {
2491
+ readonly directory: string;
2492
+ readonly instanceID: string;
2493
+ readonly ticket: string;
2494
+ readonly expiresAt: number;
2495
+ } | null;
2496
+ };
2497
+ export type ExperimentalPersistentPtyHandoffOperation<E = never> = () => Effect.Effect<ExperimentalPersistentPtyHandoffOutput, E>;
2498
+ export type ExperimentalPersistentPtyGetInput = {
2499
+ readonly ptyID: Pty.ID;
2500
+ };
2501
+ export type ExperimentalPersistentPtyGetOutput = {
2502
+ readonly id: Pty.ID;
2503
+ readonly title: string;
2504
+ readonly command: string;
2505
+ readonly args: ReadonlyArray<string>;
2506
+ readonly cwd: string;
2507
+ readonly status: "running" | "exited";
2508
+ readonly pid: number;
2509
+ readonly exitCode?: number | undefined;
2510
+ readonly sessionID: Session.ID;
2511
+ readonly foregroundProcess: string | null;
2512
+ readonly size: {
2513
+ readonly cols: number;
2514
+ readonly rows: number;
2515
+ };
2516
+ readonly output: {
2517
+ readonly head: number;
2518
+ readonly tail: number;
2519
+ };
2520
+ };
2521
+ export type ExperimentalPersistentPtyGetOperation<E = never> = (input: ExperimentalPersistentPtyGetInput) => Effect.Effect<ExperimentalPersistentPtyGetOutput, E>;
2522
+ export type ExperimentalPersistentPtyUpdateInput = {
2523
+ readonly ptyID: Pty.ID;
2524
+ readonly attachmentID?: string | undefined;
2525
+ readonly size: {
2526
+ readonly cols: number;
2527
+ readonly rows: number;
2528
+ };
2529
+ };
2530
+ export type ExperimentalPersistentPtyUpdateOutput = {
2531
+ readonly id: Pty.ID;
2532
+ readonly title: string;
2533
+ readonly command: string;
2534
+ readonly args: ReadonlyArray<string>;
2535
+ readonly cwd: string;
2536
+ readonly status: "running" | "exited";
2537
+ readonly pid: number;
2538
+ readonly exitCode?: number | undefined;
2539
+ readonly sessionID: Session.ID;
2540
+ readonly foregroundProcess: string | null;
2541
+ readonly size: {
2542
+ readonly cols: number;
2543
+ readonly rows: number;
2544
+ };
2545
+ readonly output: {
2546
+ readonly head: number;
2547
+ readonly tail: number;
2548
+ };
2549
+ };
2550
+ export type ExperimentalPersistentPtyUpdateOperation<E = never> = (input: ExperimentalPersistentPtyUpdateInput) => Effect.Effect<ExperimentalPersistentPtyUpdateOutput, E>;
2551
+ export type ExperimentalPersistentPtySnapshotInput = {
2552
+ readonly ptyID: Pty.ID;
2553
+ };
2554
+ export type ExperimentalPersistentPtySnapshotOutput = {
2555
+ readonly info: {
2556
+ readonly id: Pty.ID;
2557
+ readonly title: string;
2558
+ readonly command: string;
2559
+ readonly args: ReadonlyArray<string>;
2560
+ readonly cwd: string;
2561
+ readonly status: "running" | "exited";
2562
+ readonly pid: number;
2563
+ readonly exitCode?: number | undefined;
2564
+ readonly sessionID: Session.ID;
2565
+ readonly foregroundProcess: string | null;
2566
+ readonly size: {
2567
+ readonly cols: number;
2568
+ readonly rows: number;
2569
+ };
2570
+ readonly output: {
2571
+ readonly head: number;
2572
+ readonly tail: number;
2573
+ };
2574
+ };
2575
+ readonly text: string;
2576
+ readonly checkpoint: globalThis.Uint8Array;
2577
+ readonly cursor: {
2578
+ readonly x: number;
2579
+ readonly y: number;
2580
+ };
2581
+ };
2582
+ export type ExperimentalPersistentPtySnapshotOperation<E = never> = (input: ExperimentalPersistentPtySnapshotInput) => Effect.Effect<ExperimentalPersistentPtySnapshotOutput, E>;
2583
+ export type ExperimentalPersistentPtyRemoveInput = {
2584
+ readonly ptyID: Pty.ID;
2585
+ };
2586
+ export type ExperimentalPersistentPtyRemoveOutput = void;
2587
+ export type ExperimentalPersistentPtyRemoveOperation<E = never> = (input: ExperimentalPersistentPtyRemoveInput) => Effect.Effect<ExperimentalPersistentPtyRemoveOutput, E>;
2588
+ export type ExperimentalPersistentPtyConnectTokenInput = {
2589
+ readonly ptyID: Pty.ID;
2590
+ readonly "x-opencode-ticket"?: string | undefined;
2591
+ };
2592
+ export type ExperimentalPersistentPtyConnectTokenOutput = PtyTicket.ConnectToken;
2593
+ export type ExperimentalPersistentPtyConnectTokenOperation<E = never> = (input: ExperimentalPersistentPtyConnectTokenInput) => Effect.Effect<ExperimentalPersistentPtyConnectTokenOutput, E>;
2594
+ export interface ExperimentalApi<E = never> {
2595
+ readonly persistentPty: {
2596
+ readonly read: ExperimentalPersistentPtyReadOperation<E>;
2597
+ readonly list: ExperimentalPersistentPtyListOperation<E>;
2598
+ readonly create: ExperimentalPersistentPtyCreateOperation<E>;
2599
+ readonly shutdown: ExperimentalPersistentPtyShutdownOperation<E>;
2600
+ readonly handoff: ExperimentalPersistentPtyHandoffOperation<E>;
2601
+ readonly get: ExperimentalPersistentPtyGetOperation<E>;
2602
+ readonly update: ExperimentalPersistentPtyUpdateOperation<E>;
2603
+ readonly snapshot: ExperimentalPersistentPtySnapshotOperation<E>;
2604
+ readonly remove: ExperimentalPersistentPtyRemoveOperation<E>;
2605
+ readonly connectToken: ExperimentalPersistentPtyConnectTokenOperation<E>;
2606
+ };
2607
+ }
2608
+ export type ShellListInput = {
2609
+ readonly location?: {
2610
+ readonly directory?: string | undefined;
2611
+ } | undefined;
2612
+ };
2613
+ export type ShellListOutput = {
2614
+ readonly location: Location.PublicRef;
2615
+ readonly data: ReadonlyArray<Shell.Info>;
2616
+ };
2617
+ export type ShellListOperation<E = never> = (input?: ShellListInput) => Effect.Effect<ShellListOutput, E>;
2618
+ export type ShellCreateInput = {
2619
+ readonly location?: {
2620
+ readonly directory?: string | undefined;
2621
+ } | undefined;
2622
+ readonly command: string;
2623
+ readonly cwd?: string | undefined;
2624
+ readonly timeout?: number | undefined;
2625
+ readonly metadata?: {
2626
+ readonly [x: string]: unknown;
2627
+ } | undefined;
2628
+ };
2629
+ export type ShellCreateOutput = {
2630
+ readonly location: Location.PublicRef;
2631
+ readonly data: Shell.Info;
2632
+ };
2633
+ export type ShellCreateOperation<E = never> = (input: ShellCreateInput) => Effect.Effect<ShellCreateOutput, E>;
2634
+ export type ShellGetInput = {
2635
+ readonly id: Shell.ID;
2636
+ readonly location?: {
2637
+ readonly directory?: string | undefined;
2638
+ } | undefined;
2639
+ };
2640
+ export type ShellGetOutput = {
2641
+ readonly location: Location.PublicRef;
2642
+ readonly data: Shell.Info;
2643
+ };
2644
+ export type ShellGetOperation<E = never> = (input: ShellGetInput) => Effect.Effect<ShellGetOutput, E>;
2645
+ export type ShellOutputInput = {
2646
+ readonly id: Shell.ID;
2647
+ readonly location?: {
2648
+ readonly directory?: string | undefined;
2649
+ } | undefined;
2650
+ readonly cursor?: number | undefined;
2651
+ readonly limit?: number | undefined;
2652
+ };
2653
+ export type ShellOutputOutput = {
2654
+ readonly location: Location.PublicRef;
2655
+ readonly data: {
2656
+ readonly output: string;
2657
+ readonly cursor: number;
2658
+ readonly size: number;
2659
+ readonly truncated: boolean;
2660
+ };
2661
+ };
2662
+ export type ShellOutputOperation<E = never> = (input: ShellOutputInput) => Effect.Effect<ShellOutputOutput, E>;
2663
+ export type ShellRemoveInput = {
2664
+ readonly id: Shell.ID;
2665
+ readonly location?: {
2666
+ readonly directory?: string | undefined;
2667
+ } | undefined;
2668
+ };
2669
+ export type ShellRemoveOutput = void;
2670
+ export type ShellRemoveOperation<E = never> = (input: ShellRemoveInput) => Effect.Effect<ShellRemoveOutput, E>;
2671
+ export interface ShellApi<E = never> {
2672
+ readonly list: ShellListOperation<E>;
2673
+ readonly create: ShellCreateOperation<E>;
2674
+ readonly get: ShellGetOperation<E>;
2675
+ readonly output: ShellOutputOperation<E>;
2676
+ readonly remove: ShellRemoveOperation<E>;
2677
+ }
2678
+ export type ReferenceListInput = {
2679
+ readonly location?: {
2680
+ readonly directory?: string | undefined;
2681
+ } | undefined;
2682
+ };
2683
+ export type ReferenceListOutput = {
2684
+ readonly location: Location.PublicRef;
2685
+ readonly data: ReadonlyArray<Reference.Info>;
2686
+ };
2687
+ export type ReferenceListOperation<E = never> = (input?: ReferenceListInput) => Effect.Effect<ReferenceListOutput, E>;
2688
+ export interface ReferenceApi<E = never> {
2689
+ readonly list: ReferenceListOperation<E>;
2690
+ }
2691
+ export type WorktreeListInput = {
2692
+ readonly projectID: Project.ID;
2693
+ };
2694
+ export type WorktreeListOutput = Worktree.List;
2695
+ export type WorktreeListOperation<E = never> = (input: WorktreeListInput) => Effect.Effect<WorktreeListOutput, E>;
2696
+ export type WorktreeCreateInput = {
2697
+ readonly projectID: Project.ID;
2698
+ readonly from?: AbsolutePath | undefined;
2699
+ readonly branch?: string | undefined;
2700
+ readonly directory?: AbsolutePath | undefined;
2701
+ readonly name?: string | undefined;
2702
+ };
2703
+ export type WorktreeCreateOutput = Worktree.Info;
2704
+ export type WorktreeCreateOperation<E = never> = (input: WorktreeCreateInput) => Effect.Effect<WorktreeCreateOutput, E>;
2705
+ export type WorktreeRemoveInput = {
2706
+ readonly projectID: Project.ID;
2707
+ readonly directory: AbsolutePath;
2708
+ readonly force: boolean;
2709
+ };
2710
+ export type WorktreeRemoveOutput = void;
2711
+ export type WorktreeRemoveOperation<E = never> = (input: WorktreeRemoveInput) => Effect.Effect<WorktreeRemoveOutput, E>;
2712
+ export type WorktreeRefreshInput = {
2713
+ readonly projectID: Project.ID;
2714
+ };
2715
+ export type WorktreeRefreshOutput = void;
2716
+ export type WorktreeRefreshOperation<E = never> = (input: WorktreeRefreshInput) => Effect.Effect<WorktreeRefreshOutput, E>;
2717
+ export interface WorktreeApi<E = never> {
2718
+ readonly list: WorktreeListOperation<E>;
2719
+ readonly create: WorktreeCreateOperation<E>;
2720
+ readonly remove: WorktreeRemoveOperation<E>;
2721
+ readonly refresh: WorktreeRefreshOperation<E>;
2722
+ }
2723
+ export type VcsInitInput = {
2724
+ readonly location?: {
2725
+ readonly directory?: string | undefined;
2726
+ } | undefined;
2727
+ readonly provider?: string | undefined;
2728
+ };
2729
+ export type VcsInitOutput = void;
2730
+ export type VcsInitOperation<E = never> = (input?: VcsInitInput) => Effect.Effect<VcsInitOutput, E>;
2731
+ export type VcsGetInput = {
2732
+ readonly location?: {
2733
+ readonly directory?: string | undefined;
2734
+ } | undefined;
2735
+ };
2736
+ export type VcsGetOutput = {
2737
+ readonly location: Location.PublicRef;
2738
+ readonly data: Vcs.Info;
2739
+ };
2740
+ export type VcsGetOperation<E = never> = (input?: VcsGetInput) => Effect.Effect<VcsGetOutput, E>;
2741
+ export type VcsBaseInput = {
2742
+ readonly location?: {
2743
+ readonly directory?: string | undefined;
2744
+ } | undefined;
2745
+ };
2746
+ export type VcsBaseOutput = {
2747
+ readonly location: Location.PublicRef;
2748
+ readonly data: Vcs.Base | null;
2749
+ };
2750
+ export type VcsBaseOperation<E = never> = (input?: VcsBaseInput) => Effect.Effect<VcsBaseOutput, E>;
2751
+ export type VcsStatusInput = {
2752
+ readonly location?: {
2753
+ readonly directory?: string | undefined;
2754
+ } | undefined;
2755
+ };
2756
+ export type VcsStatusOutput = {
2757
+ readonly location: Location.PublicRef;
2758
+ readonly data: ReadonlyArray<Vcs.FileStatus>;
2759
+ };
2760
+ export type VcsStatusOperation<E = never> = (input?: VcsStatusInput) => Effect.Effect<VcsStatusOutput, E>;
2761
+ export type VcsBranchListInput = {
2762
+ readonly location?: {
2763
+ readonly directory?: string | undefined;
2764
+ } | undefined;
2765
+ readonly search?: string | undefined;
2766
+ readonly limit?: number | undefined;
2767
+ };
2768
+ export type VcsBranchListOutput = {
2769
+ readonly location: Location.PublicRef;
2770
+ readonly data: Vcs.BranchList;
2771
+ };
2772
+ export type VcsBranchListOperation<E = never> = (input?: VcsBranchListInput) => Effect.Effect<VcsBranchListOutput, E>;
2773
+ export type VcsDiffInput = {
2774
+ readonly location?: {
2775
+ readonly directory?: string | undefined;
2776
+ } | undefined;
2777
+ readonly mode: Vcs.Mode;
2778
+ readonly base?: string | undefined;
2779
+ readonly context?: number | undefined;
2780
+ };
2781
+ export type VcsDiffOutput = {
2782
+ readonly location: Location.PublicRef;
2783
+ readonly data: ReadonlyArray<FileDiff.Info>;
2784
+ };
2785
+ export type VcsDiffOperation<E = never> = (input: VcsDiffInput) => Effect.Effect<VcsDiffOutput, E>;
2786
+ export interface VcsApi<E = never> {
2787
+ readonly init: VcsInitOperation<E>;
2788
+ readonly get: VcsGetOperation<E>;
2789
+ readonly base: VcsBaseOperation<E>;
2790
+ readonly status: VcsStatusOperation<E>;
2791
+ readonly branch: {
2792
+ readonly list: VcsBranchListOperation<E>;
2793
+ };
2794
+ readonly diff: VcsDiffOperation<E>;
2795
+ }
2796
+ export type DebugHeapDumpInput = {
2797
+ readonly directory?: string | undefined;
2798
+ };
2799
+ export type DebugHeapDumpOutput = {
2800
+ readonly path: string;
2801
+ readonly pid: number;
2802
+ readonly memory: {
2803
+ readonly rss: number;
2804
+ readonly heapTotal: number;
2805
+ readonly heapUsed: number;
2806
+ readonly external: number;
2807
+ readonly arrayBuffers: number;
2808
+ };
2809
+ };
2810
+ export type DebugHeapDumpOperation<E = never> = (input?: DebugHeapDumpInput) => Effect.Effect<DebugHeapDumpOutput, E>;
2811
+ export type DebugLocationListOutput = ReadonlyArray<Location.PublicRef>;
2812
+ export type DebugLocationListOperation<E = never> = () => Effect.Effect<DebugLocationListOutput, E>;
2813
+ export type DebugLocationEvictInput = {
2814
+ readonly location?: {
2815
+ readonly directory?: string | undefined;
2816
+ } | undefined;
2817
+ };
2818
+ export type DebugLocationEvictOutput = void;
2819
+ export type DebugLocationEvictOperation<E = never> = (input?: DebugLocationEvictInput) => Effect.Effect<DebugLocationEvictOutput, E>;
2820
+ export interface DebugApi<E = never> {
2821
+ readonly heapDump: DebugHeapDumpOperation<E>;
2822
+ readonly location: {
2823
+ readonly list: DebugLocationListOperation<E>;
2824
+ readonly evict: DebugLocationEvictOperation<E>;
2825
+ };
2826
+ }
2827
+ export type MigrationV1StatusOutput = {
2828
+ readonly status: "required" | "completed";
2829
+ } | {
2830
+ readonly status: "running";
2831
+ readonly progress: {
2832
+ readonly label: string;
2833
+ readonly numerator?: number | undefined;
2834
+ readonly denominator?: number | undefined;
2835
+ };
2836
+ } | {
2837
+ readonly status: "error";
2838
+ readonly error: string;
2839
+ };
2840
+ export type MigrationV1StatusOperation<E = never> = () => Effect.Effect<MigrationV1StatusOutput, E>;
2841
+ export interface MigrationApi<E = never> {
2842
+ readonly v1: {
2843
+ readonly status: MigrationV1StatusOperation<E>;
2844
+ };
2845
+ }
2846
+ export type WebsearchProvidersInput = {
2847
+ readonly location?: {
2848
+ readonly directory?: string | undefined;
2849
+ } | undefined;
2850
+ };
2851
+ export type WebsearchProvidersOutput = {
2852
+ readonly location: Location.PublicRef;
2853
+ readonly data: ReadonlyArray<WebSearch.Provider>;
2854
+ };
2855
+ export type WebsearchProvidersOperation<E = never> = (input?: WebsearchProvidersInput) => Effect.Effect<WebsearchProvidersOutput, E>;
2856
+ export type WebsearchQueryInput = {
2857
+ readonly location?: {
2858
+ readonly directory?: string | undefined;
2859
+ } | undefined;
2860
+ readonly query: string;
2861
+ readonly providerID?: WebSearch.ID | undefined;
2862
+ };
2863
+ export type WebsearchQueryOutput = {
2864
+ readonly location: Location.PublicRef;
2865
+ readonly data: WebSearch.Response;
2866
+ };
2867
+ export type WebsearchQueryOperation<E = never> = (input: WebsearchQueryInput) => Effect.Effect<WebsearchQueryOutput, E>;
2868
+ export interface WebsearchApi<E = never> {
2869
+ readonly providers: WebsearchProvidersOperation<E>;
2870
+ readonly query: WebsearchQueryOperation<E>;
2871
+ }
2872
+ export type ConfigGetInput = {
2873
+ readonly location?: {
2874
+ readonly directory?: string | undefined;
2875
+ } | undefined;
2876
+ };
2877
+ export type ConfigGetOutput = ReadonlyArray<Config.Entry>;
2878
+ export type ConfigGetOperation<E = never> = (input?: ConfigGetInput) => Effect.Effect<ConfigGetOutput, E>;
2879
+ export type ConfigShellsOutput = ReadonlyArray<{
2880
+ readonly path: string;
2881
+ readonly name: string;
2882
+ readonly acceptable: boolean;
2883
+ }>;
2884
+ export type ConfigShellsOperation<E = never> = () => Effect.Effect<ConfigShellsOutput, E>;
2885
+ export type ConfigUpdateInput = {
2886
+ readonly shell: string | null;
2887
+ };
2888
+ export type ConfigUpdateOutput = void;
2889
+ export type ConfigUpdateOperation<E = never> = (input: ConfigUpdateInput) => Effect.Effect<ConfigUpdateOutput, E>;
2890
+ export interface ConfigApi<E = never> {
2891
+ readonly get: ConfigGetOperation<E>;
2892
+ readonly shells: ConfigShellsOperation<E>;
2893
+ readonly update: ConfigUpdateOperation<E>;
2894
+ }
2895
+ export interface AppApi<E = never> {
2896
+ readonly server: ServerApi<E>;
2897
+ readonly location: LocationApi<E>;
2898
+ readonly agent: AgentApi<E>;
2899
+ readonly plugin: PluginApi<E>;
2900
+ readonly session: SessionApi<E>;
2901
+ readonly message: MessageApi<E>;
2902
+ readonly model: ModelApi<E>;
2903
+ readonly generate: GenerateApi<E>;
2904
+ readonly voice: VoiceApi<E>;
2905
+ readonly provider: ProviderApi<E>;
2906
+ readonly integration: IntegrationApi<E>;
2907
+ readonly mcp: McpApi<E>;
2908
+ readonly credential: CredentialApi<E>;
2909
+ readonly project: ProjectApi<E>;
2910
+ readonly form: FormApi<E>;
2911
+ readonly permission: PermissionApi<E>;
2912
+ readonly file: FileApi<E>;
2913
+ readonly command: CommandApi<E>;
2914
+ readonly skill: SkillApi<E>;
2915
+ readonly rpc: RpcApi<E>;
2916
+ readonly event: EventApi<E>;
2917
+ readonly pty: PtyApi<E>;
2918
+ readonly experimental: ExperimentalApi<E>;
2919
+ readonly shell: ShellApi<E>;
2920
+ readonly reference: ReferenceApi<E>;
2921
+ readonly worktree: WorktreeApi<E>;
2922
+ readonly vcs: VcsApi<E>;
2923
+ readonly debug: DebugApi<E>;
2924
+ readonly migration: MigrationApi<E>;
2925
+ readonly websearch: WebsearchApi<E>;
2926
+ readonly config: ConfigApi<E>;
2927
+ }