authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-05 17:41:27-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-05 23:00:41-08:00
loge6575c41491c001f08c8bd9424dc71aa1e89c103
tree7fd9c04e68c587fa65eb204b30ce7f16a1c76921
parentae7283e021a58c2717005a5745def6e4f0afa2aa

Prune internal contract exports and remove checkpoint RPC schemas

- Stop exporting internal-only schema constants/types across contracts modules - Remove unused provider checkpoint list/revert/diff RPC contract schemas - Keep public contract surface focused on externally consumed types

9 files changed, 231 insertions(+), 301 deletions(-)

packages/contracts/src/git.ts+7-10
...@@ -7,20 +7,19 @@ const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;...@@ -7,20 +7,19 @@ const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;
77
8export const GitStackedAction = Schema.Literals(["commit", "commit_push", "commit_push_pr"]);8export const GitStackedAction = Schema.Literals(["commit", "commit_push", "commit_push_pr"]);
9export type GitStackedAction = typeof GitStackedAction.Type;9export type GitStackedAction = typeof GitStackedAction.Type;
10export const GitCommitStepStatus = Schema.Literals(["created", "skipped_no_changes"]);10const GitCommitStepStatus = Schema.Literals(["created", "skipped_no_changes"]);
11export const GitPushStepStatus = Schema.Literals([11const GitPushStepStatus = Schema.Literals([
12 "pushed",12 "pushed",
13 "skipped_not_requested",13 "skipped_not_requested",
14 "skipped_up_to_date",14 "skipped_up_to_date",
15]);15]);
16export const GitBranchStepStatus = Schema.Literals(["created", "skipped_not_requested"]);16const GitBranchStepStatus = Schema.Literals(["created", "skipped_not_requested"]);
17export const GitPrStepStatus = Schema.Literals([17const GitPrStepStatus = Schema.Literals([
18 "created",18 "created",
19 "opened_existing",19 "opened_existing",
20 "skipped_not_requested",20 "skipped_not_requested",
21]);21]);
22export const GitStatusPrState = Schema.Literals(["open", "closed", "merged"]);22const GitStatusPrState = Schema.Literals(["open", "closed", "merged"]);
23export type GitStatusPrState = typeof GitStatusPrState.Type;
2423
25export const GitBranch = Schema.Struct({24export const GitBranch = Schema.Struct({
26 name: TrimmedNonEmptyStringSchema,25 name: TrimmedNonEmptyStringSchema,
...@@ -32,11 +31,10 @@ export const GitBranch = Schema.Struct({...@@ -32,11 +31,10 @@ export const GitBranch = Schema.Struct({
32});31});
33export type GitBranch = typeof GitBranch.Type;32export type GitBranch = typeof GitBranch.Type;
3433
35export const GitWorktree = Schema.Struct({34const GitWorktree = Schema.Struct({
36 path: TrimmedNonEmptyStringSchema,35 path: TrimmedNonEmptyStringSchema,
37 branch: TrimmedNonEmptyStringSchema,36 branch: TrimmedNonEmptyStringSchema,
38});37});
39export type GitWorktree = typeof GitWorktree.Type;
4038
41// RPC Inputs39// RPC Inputs
4240
...@@ -97,7 +95,7 @@ export type GitInitInput = typeof GitInitInput.Type;...@@ -97,7 +95,7 @@ export type GitInitInput = typeof GitInitInput.Type;
9795
98// RPC Results96// RPC Results
9997
100export const GitStatusPr = Schema.Struct({98const GitStatusPr = Schema.Struct({
101 number: PositiveInt,99 number: PositiveInt,
102 title: TrimmedNonEmptyStringSchema,100 title: TrimmedNonEmptyStringSchema,
103 url: Schema.String,101 url: Schema.String,
...@@ -105,7 +103,6 @@ export const GitStatusPr = Schema.Struct({...@@ -105,7 +103,6 @@ export const GitStatusPr = Schema.Struct({
105 headBranch: TrimmedNonEmptyStringSchema,103 headBranch: TrimmedNonEmptyStringSchema,
106 state: GitStatusPrState,104 state: GitStatusPrState,
107});105});
108export type GitStatusPr = typeof GitStatusPr.Type;
109106
110export const GitStatusResult = Schema.Struct({107export const GitStatusResult = Schema.Struct({
111 branch: TrimmedNonEmptyStringSchema.pipe(Schema.NullOr),108 branch: TrimmedNonEmptyStringSchema.pipe(Schema.NullOr),
packages/contracts/src/keybindings.ts+4-8
...@@ -1,15 +1,13 @@...@@ -1,15 +1,13 @@
1import { Schema } from "effect";1import { Schema } from "effect";
2import { TrimmedString } from "./baseSchemas";2import { TrimmedString } from "./baseSchemas";
33
4export const MAX_KEYBINDING_COMMAND_LENGTH = 96;
5export const MAX_KEYBINDING_VALUE_LENGTH = 64;4export const MAX_KEYBINDING_VALUE_LENGTH = 64;
6export const MAX_KEYBINDING_WHEN_LENGTH = 256;5const MAX_KEYBINDING_WHEN_LENGTH = 256;
7export const MAX_WHEN_EXPRESSION_DEPTH = 64;6export const MAX_WHEN_EXPRESSION_DEPTH = 64;
8export const MAX_SCRIPT_ID_LENGTH = 24;7export const MAX_SCRIPT_ID_LENGTH = 24;
9export const MAX_SCRIPT_RUN_COMMAND_LENGTH = 96;
10export const MAX_KEYBINDINGS_COUNT = 256;8export const MAX_KEYBINDINGS_COUNT = 256;
119
12export const STATIC_KEYBINDING_COMMANDS = [10const STATIC_KEYBINDING_COMMANDS = [
13 "terminal.toggle",11 "terminal.toggle",
14 "terminal.split",12 "terminal.split",
15 "terminal.new",13 "terminal.new",
...@@ -35,17 +33,15 @@ export const KeybindingCommand = Schema.Union([...@@ -35,17 +33,15 @@ export const KeybindingCommand = Schema.Union([
35]);33]);
36export type KeybindingCommand = typeof KeybindingCommand.Type;34export type KeybindingCommand = typeof KeybindingCommand.Type;
3735
38export const KeybindingValue = TrimmedString.check(36const KeybindingValue = TrimmedString.check(
39 Schema.isMinLength(1),37 Schema.isMinLength(1),
40 Schema.isMaxLength(MAX_KEYBINDING_VALUE_LENGTH),38 Schema.isMaxLength(MAX_KEYBINDING_VALUE_LENGTH),
41);39);
42export type KeybindingValue = typeof KeybindingValue.Type;
4340
44export const KeybindingWhen = TrimmedString.check(41const KeybindingWhen = TrimmedString.check(
45 Schema.isMinLength(1),42 Schema.isMinLength(1),
46 Schema.isMaxLength(MAX_KEYBINDING_WHEN_LENGTH),43 Schema.isMaxLength(MAX_KEYBINDING_WHEN_LENGTH),
47);44);
48export type KeybindingWhen = typeof KeybindingWhen.Type;
49export const KeybindingRule = Schema.Struct({45export const KeybindingRule = Schema.Struct({
50 key: KeybindingValue,46 key: KeybindingValue,
51 command: KeybindingCommand,47 command: KeybindingCommand,
packages/contracts/src/orchestration.ts+36-36
...@@ -52,14 +52,14 @@ export type ProviderUserInputAnswers = typeof ProviderUserInputAnswers.Type;...@@ -52,14 +52,14 @@ export type ProviderUserInputAnswers = typeof ProviderUserInputAnswers.Type;
52export const PROVIDER_SEND_TURN_MAX_INPUT_CHARS = 120_000;52export const PROVIDER_SEND_TURN_MAX_INPUT_CHARS = 120_000;
53export const PROVIDER_SEND_TURN_MAX_ATTACHMENTS = 8;53export const PROVIDER_SEND_TURN_MAX_ATTACHMENTS = 8;
54export const PROVIDER_SEND_TURN_MAX_IMAGE_BYTES = 10 * 1024 * 1024;54export const PROVIDER_SEND_TURN_MAX_IMAGE_BYTES = 10 * 1024 * 1024;
55export const PROVIDER_SEND_TURN_MAX_IMAGE_DATA_URL_CHARS = 14_000_000;55const PROVIDER_SEND_TURN_MAX_IMAGE_DATA_URL_CHARS = 14_000_000;
56export const CHAT_ATTACHMENT_ID_MAX_CHARS = 128;56const CHAT_ATTACHMENT_ID_MAX_CHARS = 128;
5757
58// Correlation id is command id by design in this model.58// Correlation id is command id by design in this model.
59export const CorrelationId = CommandId;59export const CorrelationId = CommandId;
60export type CorrelationId = typeof CorrelationId.Type;60export type CorrelationId = typeof CorrelationId.Type;
6161
62export const ChatAttachmentId = TrimmedNonEmptyString.check(62const ChatAttachmentId = TrimmedNonEmptyString.check(
63 Schema.isMaxLength(CHAT_ATTACHMENT_ID_MAX_CHARS),63 Schema.isMaxLength(CHAT_ATTACHMENT_ID_MAX_CHARS),
64 Schema.isPattern(/^[a-z0-9_-]+$/i),64 Schema.isPattern(/^[a-z0-9_-]+$/i),
65);65);
...@@ -74,7 +74,7 @@ export const ChatImageAttachment = Schema.Struct({...@@ -74,7 +74,7 @@ export const ChatImageAttachment = Schema.Struct({
74});74});
75export type ChatImageAttachment = typeof ChatImageAttachment.Type;75export type ChatImageAttachment = typeof ChatImageAttachment.Type;
7676
77export const UploadChatImageAttachment = Schema.Struct({77const UploadChatImageAttachment = Schema.Struct({
78 type: Schema.Literal("image"),78 type: Schema.Literal("image"),
79 name: TrimmedNonEmptyString.check(Schema.isMaxLength(255)),79 name: TrimmedNonEmptyString.check(Schema.isMaxLength(255)),
80 mimeType: TrimmedNonEmptyString.check(Schema.isMaxLength(100), Schema.isPattern(/^image\//i)),80 mimeType: TrimmedNonEmptyString.check(Schema.isMaxLength(100), Schema.isPattern(/^image\//i)),
...@@ -87,7 +87,7 @@ export type UploadChatImageAttachment = typeof UploadChatImageAttachment.Type;...@@ -87,7 +87,7 @@ export type UploadChatImageAttachment = typeof UploadChatImageAttachment.Type;
8787
88export const ChatAttachment = Schema.Union([ChatImageAttachment]);88export const ChatAttachment = Schema.Union([ChatImageAttachment]);
89export type ChatAttachment = typeof ChatAttachment.Type;89export type ChatAttachment = typeof ChatAttachment.Type;
90export const UploadChatAttachment = Schema.Union([UploadChatImageAttachment]);90const UploadChatAttachment = Schema.Union([UploadChatImageAttachment]);
91export type UploadChatAttachment = typeof UploadChatAttachment.Type;91export type UploadChatAttachment = typeof UploadChatAttachment.Type;
9292
93export const ProjectScriptIcon = Schema.Literals([93export const ProjectScriptIcon = Schema.Literals([
...@@ -212,7 +212,7 @@ export const OrchestrationThreadActivity = Schema.Struct({...@@ -212,7 +212,7 @@ export const OrchestrationThreadActivity = Schema.Struct({
212});212});
213export type OrchestrationThreadActivity = typeof OrchestrationThreadActivity.Type;213export type OrchestrationThreadActivity = typeof OrchestrationThreadActivity.Type;
214214
215export const OrchestrationLatestTurnState = Schema.Literals([215const OrchestrationLatestTurnState = Schema.Literals([
216 "running",216 "running",
217 "interrupted",217 "interrupted",
218 "completed",218 "completed",
...@@ -263,7 +263,7 @@ export const OrchestrationReadModel = Schema.Struct({...@@ -263,7 +263,7 @@ export const OrchestrationReadModel = Schema.Struct({
263});263});
264export type OrchestrationReadModel = typeof OrchestrationReadModel.Type;264export type OrchestrationReadModel = typeof OrchestrationReadModel.Type;
265265
266export const ProjectCreateCommand = Schema.Struct({266const ProjectCreateCommand = Schema.Struct({
267 type: Schema.Literal("project.create"),267 type: Schema.Literal("project.create"),
268 commandId: CommandId,268 commandId: CommandId,
269 projectId: ProjectId,269 projectId: ProjectId,
...@@ -273,7 +273,7 @@ export const ProjectCreateCommand = Schema.Struct({...@@ -273,7 +273,7 @@ export const ProjectCreateCommand = Schema.Struct({
273 createdAt: IsoDateTime,273 createdAt: IsoDateTime,
274});274});
275275
276export const ProjectMetaUpdateCommand = Schema.Struct({276const ProjectMetaUpdateCommand = Schema.Struct({
277 type: Schema.Literal("project.meta.update"),277 type: Schema.Literal("project.meta.update"),
278 commandId: CommandId,278 commandId: CommandId,
279 projectId: ProjectId,279 projectId: ProjectId,
...@@ -283,13 +283,13 @@ export const ProjectMetaUpdateCommand = Schema.Struct({...@@ -283,13 +283,13 @@ export const ProjectMetaUpdateCommand = Schema.Struct({
283 scripts: Schema.optional(Schema.Array(ProjectScript)),283 scripts: Schema.optional(Schema.Array(ProjectScript)),
284});284});
285285
286export const ProjectDeleteCommand = Schema.Struct({286const ProjectDeleteCommand = Schema.Struct({
287 type: Schema.Literal("project.delete"),287 type: Schema.Literal("project.delete"),
288 commandId: CommandId,288 commandId: CommandId,
289 projectId: ProjectId,289 projectId: ProjectId,
290});290});
291291
292export const ThreadCreateCommand = Schema.Struct({292const ThreadCreateCommand = Schema.Struct({
293 type: Schema.Literal("thread.create"),293 type: Schema.Literal("thread.create"),
294 commandId: CommandId,294 commandId: CommandId,
295 threadId: ThreadId,295 threadId: ThreadId,
...@@ -305,13 +305,13 @@ export const ThreadCreateCommand = Schema.Struct({...@@ -305,13 +305,13 @@ export const ThreadCreateCommand = Schema.Struct({
305 createdAt: IsoDateTime,305 createdAt: IsoDateTime,
306});306});
307307
308export const ThreadDeleteCommand = Schema.Struct({308const ThreadDeleteCommand = Schema.Struct({
309 type: Schema.Literal("thread.delete"),309 type: Schema.Literal("thread.delete"),
310 commandId: CommandId,310 commandId: CommandId,
311 threadId: ThreadId,311 threadId: ThreadId,
312});312});
313313
314export const ThreadMetaUpdateCommand = Schema.Struct({314const ThreadMetaUpdateCommand = Schema.Struct({
315 type: Schema.Literal("thread.meta.update"),315 type: Schema.Literal("thread.meta.update"),
316 commandId: CommandId,316 commandId: CommandId,
317 threadId: ThreadId,317 threadId: ThreadId,
...@@ -321,7 +321,7 @@ export const ThreadMetaUpdateCommand = Schema.Struct({...@@ -321,7 +321,7 @@ export const ThreadMetaUpdateCommand = Schema.Struct({
321 worktreePath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),321 worktreePath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
322});322});
323323
324export const ThreadRuntimeModeSetCommand = Schema.Struct({324const ThreadRuntimeModeSetCommand = Schema.Struct({
325 type: Schema.Literal("thread.runtime-mode.set"),325 type: Schema.Literal("thread.runtime-mode.set"),
326 commandId: CommandId,326 commandId: CommandId,
327 threadId: ThreadId,327 threadId: ThreadId,
...@@ -329,7 +329,7 @@ export const ThreadRuntimeModeSetCommand = Schema.Struct({...@@ -329,7 +329,7 @@ export const ThreadRuntimeModeSetCommand = Schema.Struct({
329 createdAt: IsoDateTime,329 createdAt: IsoDateTime,
330});330});
331331
332export const ThreadInteractionModeSetCommand = Schema.Struct({332const ThreadInteractionModeSetCommand = Schema.Struct({
333 type: Schema.Literal("thread.interaction-mode.set"),333 type: Schema.Literal("thread.interaction-mode.set"),
334 commandId: CommandId,334 commandId: CommandId,
335 threadId: ThreadId,335 threadId: ThreadId,
...@@ -337,7 +337,7 @@ export const ThreadInteractionModeSetCommand = Schema.Struct({...@@ -337,7 +337,7 @@ export const ThreadInteractionModeSetCommand = Schema.Struct({
337 createdAt: IsoDateTime,337 createdAt: IsoDateTime,
338});338});
339339
340export const ThreadTurnStartCommand = Schema.Struct({340const ThreadTurnStartCommand = Schema.Struct({
341 type: Schema.Literal("thread.turn.start"),341 type: Schema.Literal("thread.turn.start"),
342 commandId: CommandId,342 commandId: CommandId,
343 threadId: ThreadId,343 threadId: ThreadId,
...@@ -358,7 +358,7 @@ export const ThreadTurnStartCommand = Schema.Struct({...@@ -358,7 +358,7 @@ export const ThreadTurnStartCommand = Schema.Struct({
358 createdAt: IsoDateTime,358 createdAt: IsoDateTime,
359});359});
360360
361export const ClientThreadTurnStartCommand = Schema.Struct({361const ClientThreadTurnStartCommand = Schema.Struct({
362 type: Schema.Literal("thread.turn.start"),362 type: Schema.Literal("thread.turn.start"),
363 commandId: CommandId,363 commandId: CommandId,
364 threadId: ThreadId,364 threadId: ThreadId,
...@@ -377,7 +377,7 @@ export const ClientThreadTurnStartCommand = Schema.Struct({...@@ -377,7 +377,7 @@ export const ClientThreadTurnStartCommand = Schema.Struct({
377 createdAt: IsoDateTime,377 createdAt: IsoDateTime,
378});378});
379379
380export const ThreadTurnInterruptCommand = Schema.Struct({380const ThreadTurnInterruptCommand = Schema.Struct({
381 type: Schema.Literal("thread.turn.interrupt"),381 type: Schema.Literal("thread.turn.interrupt"),
382 commandId: CommandId,382 commandId: CommandId,
383 threadId: ThreadId,383 threadId: ThreadId,
...@@ -385,7 +385,7 @@ export const ThreadTurnInterruptCommand = Schema.Struct({...@@ -385,7 +385,7 @@ export const ThreadTurnInterruptCommand = Schema.Struct({
385 createdAt: IsoDateTime,385 createdAt: IsoDateTime,
386});386});
387387
388export const ThreadApprovalRespondCommand = Schema.Struct({388const ThreadApprovalRespondCommand = Schema.Struct({
389 type: Schema.Literal("thread.approval.respond"),389 type: Schema.Literal("thread.approval.respond"),
390 commandId: CommandId,390 commandId: CommandId,
391 threadId: ThreadId,391 threadId: ThreadId,
...@@ -394,7 +394,7 @@ export const ThreadApprovalRespondCommand = Schema.Struct({...@@ -394,7 +394,7 @@ export const ThreadApprovalRespondCommand = Schema.Struct({
394 createdAt: IsoDateTime,394 createdAt: IsoDateTime,
395});395});
396396
397export const ThreadUserInputRespondCommand = Schema.Struct({397const ThreadUserInputRespondCommand = Schema.Struct({
398 type: Schema.Literal("thread.user-input.respond"),398 type: Schema.Literal("thread.user-input.respond"),
399 commandId: CommandId,399 commandId: CommandId,
400 threadId: ThreadId,400 threadId: ThreadId,
...@@ -403,7 +403,7 @@ export const ThreadUserInputRespondCommand = Schema.Struct({...@@ -403,7 +403,7 @@ export const ThreadUserInputRespondCommand = Schema.Struct({
403 createdAt: IsoDateTime,403 createdAt: IsoDateTime,
404});404});
405405
406export const ThreadCheckpointRevertCommand = Schema.Struct({406const ThreadCheckpointRevertCommand = Schema.Struct({
407 type: Schema.Literal("thread.checkpoint.revert"),407 type: Schema.Literal("thread.checkpoint.revert"),
408 commandId: CommandId,408 commandId: CommandId,
409 threadId: ThreadId,409 threadId: ThreadId,
...@@ -411,14 +411,14 @@ export const ThreadCheckpointRevertCommand = Schema.Struct({...@@ -411,14 +411,14 @@ export const ThreadCheckpointRevertCommand = Schema.Struct({
411 createdAt: IsoDateTime,411 createdAt: IsoDateTime,
412});412});
413413
414export const ThreadSessionStopCommand = Schema.Struct({414const ThreadSessionStopCommand = Schema.Struct({
415 type: Schema.Literal("thread.session.stop"),415 type: Schema.Literal("thread.session.stop"),
416 commandId: CommandId,416 commandId: CommandId,
417 threadId: ThreadId,417 threadId: ThreadId,
418 createdAt: IsoDateTime,418 createdAt: IsoDateTime,
419});419});
420420
421export const DispatchableClientOrchestrationCommand = Schema.Union([421const DispatchableClientOrchestrationCommand = Schema.Union([
422 ProjectCreateCommand,422 ProjectCreateCommand,
423 ProjectMetaUpdateCommand,423 ProjectMetaUpdateCommand,
424 ProjectDeleteCommand,424 ProjectDeleteCommand,
...@@ -455,7 +455,7 @@ export const ClientOrchestrationCommand = Schema.Union([...@@ -455,7 +455,7 @@ export const ClientOrchestrationCommand = Schema.Union([
455]);455]);
456export type ClientOrchestrationCommand = typeof ClientOrchestrationCommand.Type;456export type ClientOrchestrationCommand = typeof ClientOrchestrationCommand.Type;
457457
458export const ThreadSessionSetCommand = Schema.Struct({458const ThreadSessionSetCommand = Schema.Struct({
459 type: Schema.Literal("thread.session.set"),459 type: Schema.Literal("thread.session.set"),
460 commandId: CommandId,460 commandId: CommandId,
461 threadId: ThreadId,461 threadId: ThreadId,
...@@ -463,7 +463,7 @@ export const ThreadSessionSetCommand = Schema.Struct({...@@ -463,7 +463,7 @@ export const ThreadSessionSetCommand = Schema.Struct({
463 createdAt: IsoDateTime,463 createdAt: IsoDateTime,
464});464});
465465
466export const ThreadMessageAssistantDeltaCommand = Schema.Struct({466const ThreadMessageAssistantDeltaCommand = Schema.Struct({
467 type: Schema.Literal("thread.message.assistant.delta"),467 type: Schema.Literal("thread.message.assistant.delta"),
468 commandId: CommandId,468 commandId: CommandId,
469 threadId: ThreadId,469 threadId: ThreadId,
...@@ -473,7 +473,7 @@ export const ThreadMessageAssistantDeltaCommand = Schema.Struct({...@@ -473,7 +473,7 @@ export const ThreadMessageAssistantDeltaCommand = Schema.Struct({
473 createdAt: IsoDateTime,473 createdAt: IsoDateTime,
474});474});
475475
476export const ThreadMessageAssistantCompleteCommand = Schema.Struct({476const ThreadMessageAssistantCompleteCommand = Schema.Struct({
477 type: Schema.Literal("thread.message.assistant.complete"),477 type: Schema.Literal("thread.message.assistant.complete"),
478 commandId: CommandId,478 commandId: CommandId,
479 threadId: ThreadId,479 threadId: ThreadId,
...@@ -482,7 +482,7 @@ export const ThreadMessageAssistantCompleteCommand = Schema.Struct({...@@ -482,7 +482,7 @@ export const ThreadMessageAssistantCompleteCommand = Schema.Struct({
482 createdAt: IsoDateTime,482 createdAt: IsoDateTime,
483});483});
484484
485export const ThreadProposedPlanUpsertCommand = Schema.Struct({485const ThreadProposedPlanUpsertCommand = Schema.Struct({
486 type: Schema.Literal("thread.proposed-plan.upsert"),486 type: Schema.Literal("thread.proposed-plan.upsert"),
487 commandId: CommandId,487 commandId: CommandId,
488 threadId: ThreadId,488 threadId: ThreadId,
...@@ -490,7 +490,7 @@ export const ThreadProposedPlanUpsertCommand = Schema.Struct({...@@ -490,7 +490,7 @@ export const ThreadProposedPlanUpsertCommand = Schema.Struct({
490 createdAt: IsoDateTime,490 createdAt: IsoDateTime,
491});491});
492492
493export const ThreadTurnDiffCompleteCommand = Schema.Struct({493const ThreadTurnDiffCompleteCommand = Schema.Struct({
494 type: Schema.Literal("thread.turn.diff.complete"),494 type: Schema.Literal("thread.turn.diff.complete"),
495 commandId: CommandId,495 commandId: CommandId,
496 threadId: ThreadId,496 threadId: ThreadId,
...@@ -504,7 +504,7 @@ export const ThreadTurnDiffCompleteCommand = Schema.Struct({...@@ -504,7 +504,7 @@ export const ThreadTurnDiffCompleteCommand = Schema.Struct({
504 createdAt: IsoDateTime,504 createdAt: IsoDateTime,
505});505});
506506
507export const ThreadActivityAppendCommand = Schema.Struct({507const ThreadActivityAppendCommand = Schema.Struct({
508 type: Schema.Literal("thread.activity.append"),508 type: Schema.Literal("thread.activity.append"),
509 commandId: CommandId,509 commandId: CommandId,
510 threadId: ThreadId,510 threadId: ThreadId,
...@@ -512,7 +512,7 @@ export const ThreadActivityAppendCommand = Schema.Struct({...@@ -512,7 +512,7 @@ export const ThreadActivityAppendCommand = Schema.Struct({
512 createdAt: IsoDateTime,512 createdAt: IsoDateTime,
513});513});
514514
515export const ThreadRevertCompleteCommand = Schema.Struct({515const ThreadRevertCompleteCommand = Schema.Struct({
516 type: Schema.Literal("thread.revert.complete"),516 type: Schema.Literal("thread.revert.complete"),
517 commandId: CommandId,517 commandId: CommandId,
518 threadId: ThreadId,518 threadId: ThreadId,
...@@ -520,7 +520,7 @@ export const ThreadRevertCompleteCommand = Schema.Struct({...@@ -520,7 +520,7 @@ export const ThreadRevertCompleteCommand = Schema.Struct({
520 createdAt: IsoDateTime,520 createdAt: IsoDateTime,
521});521});
522522
523export const InternalOrchestrationCommand = Schema.Union([523const InternalOrchestrationCommand = Schema.Union([
524 ThreadSessionSetCommand,524 ThreadSessionSetCommand,
525 ThreadMessageAssistantDeltaCommand,525 ThreadMessageAssistantDeltaCommand,
526 ThreadMessageAssistantCompleteCommand,526 ThreadMessageAssistantCompleteCommand,
...@@ -671,7 +671,7 @@ export const ThreadApprovalResponseRequestedPayload = Schema.Struct({...@@ -671,7 +671,7 @@ export const ThreadApprovalResponseRequestedPayload = Schema.Struct({
671 createdAt: IsoDateTime,671 createdAt: IsoDateTime,
672});672});
673673
674export const ThreadUserInputResponseRequestedPayload = Schema.Struct({674const ThreadUserInputResponseRequestedPayload = Schema.Struct({
675 threadId: ThreadId,675 threadId: ThreadId,
676 requestId: ApprovalRequestId,676 requestId: ApprovalRequestId,
677 answers: ProviderUserInputAnswers,677 answers: ProviderUserInputAnswers,
...@@ -980,7 +980,7 @@ export const TurnCountRange = Schema.Struct({...@@ -980,7 +980,7 @@ export const TurnCountRange = Schema.Struct({
980 ),980 ),
981);981);
982982
983export const ThreadTurnDiff = TurnCountRange.mapFields(983const ThreadTurnDiff = TurnCountRange.mapFields(
984 Struct.assign({984 Struct.assign({
985 threadId: ThreadId,985 threadId: ThreadId,
986 diff: Schema.String,986 diff: Schema.String,
...@@ -996,7 +996,7 @@ export const ProviderSessionRuntimeStatus = Schema.Literals([...@@ -996,7 +996,7 @@ export const ProviderSessionRuntimeStatus = Schema.Literals([
996]);996]);
997export type ProviderSessionRuntimeStatus = typeof ProviderSessionRuntimeStatus.Type;997export type ProviderSessionRuntimeStatus = typeof ProviderSessionRuntimeStatus.Type;
998998
999export const ProjectionThreadTurnStatus = Schema.Literals([999const ProjectionThreadTurnStatus = Schema.Literals([
1000 "running",1000 "running",
1001 "completed",1001 "completed",
1002 "interrupted",1002 "interrupted",
...@@ -1004,7 +1004,7 @@ export const ProjectionThreadTurnStatus = Schema.Literals([...@@ -1004,7 +1004,7 @@ export const ProjectionThreadTurnStatus = Schema.Literals([
1004]);1004]);
1005export type ProjectionThreadTurnStatus = typeof ProjectionThreadTurnStatus.Type;1005export type ProjectionThreadTurnStatus = typeof ProjectionThreadTurnStatus.Type;
10061006
1007export const ProjectionCheckpointRow = Schema.Struct({1007const ProjectionCheckpointRow = Schema.Struct({
1008 threadId: ThreadId,1008 threadId: ThreadId,
1009 turnId: TurnId,1009 turnId: TurnId,
1010 checkpointTurnCount: NonNegativeInt,1010 checkpointTurnCount: NonNegativeInt,
...@@ -1029,7 +1029,7 @@ export type DispatchResult = typeof DispatchResult.Type;...@@ -1029,7 +1029,7 @@ export type DispatchResult = typeof DispatchResult.Type;
10291029
1030export const OrchestrationGetSnapshotInput = Schema.Struct({});1030export const OrchestrationGetSnapshotInput = Schema.Struct({});
1031export type OrchestrationGetSnapshotInput = typeof OrchestrationGetSnapshotInput.Type;1031export type OrchestrationGetSnapshotInput = typeof OrchestrationGetSnapshotInput.Type;
1032export const OrchestrationGetSnapshotResult = OrchestrationReadModel;1032const OrchestrationGetSnapshotResult = OrchestrationReadModel;
1033export type OrchestrationGetSnapshotResult = typeof OrchestrationGetSnapshotResult.Type;1033export type OrchestrationGetSnapshotResult = typeof OrchestrationGetSnapshotResult.Type;
10341034
1035export const OrchestrationGetTurnDiffInput = TurnCountRange.mapFields(1035export const OrchestrationGetTurnDiffInput = TurnCountRange.mapFields(
...@@ -1055,7 +1055,7 @@ export const OrchestrationReplayEventsInput = Schema.Struct({...@@ -1055,7 +1055,7 @@ export const OrchestrationReplayEventsInput = Schema.Struct({
1055});1055});
1056export type OrchestrationReplayEventsInput = typeof OrchestrationReplayEventsInput.Type;1056export type OrchestrationReplayEventsInput = typeof OrchestrationReplayEventsInput.Type;
10571057
1058export const OrchestrationReplayEventsResult = Schema.Array(OrchestrationEvent);1058const OrchestrationReplayEventsResult = Schema.Array(OrchestrationEvent);
1059export type OrchestrationReplayEventsResult = typeof OrchestrationReplayEventsResult.Type;1059export type OrchestrationReplayEventsResult = typeof OrchestrationReplayEventsResult.Type;
10601060
1061export const OrchestrationRpcSchemas = {1061export const OrchestrationRpcSchemas = {
packages/contracts/src/project.ts+3-3
...@@ -1,8 +1,8 @@...@@ -1,8 +1,8 @@
1import { Schema } from "effect";1import { Schema } from "effect";
2import { PositiveInt, TrimmedNonEmptyString } from "./baseSchemas";2import { PositiveInt, TrimmedNonEmptyString } from "./baseSchemas";
33
4export const PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;4const PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;
5export const PROJECT_WRITE_FILE_PATH_MAX_LENGTH = 512;5const PROJECT_WRITE_FILE_PATH_MAX_LENGTH = 512;
66
7export const ProjectSearchEntriesInput = Schema.Struct({7export const ProjectSearchEntriesInput = Schema.Struct({
8 cwd: TrimmedNonEmptyString,8 cwd: TrimmedNonEmptyString,
...@@ -11,7 +11,7 @@ export const ProjectSearchEntriesInput = Schema.Struct({...@@ -11,7 +11,7 @@ export const ProjectSearchEntriesInput = Schema.Struct({
11});11});
12export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;12export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;
1313
14export const ProjectEntryKind = Schema.Literals(["file", "directory"]);14const ProjectEntryKind = Schema.Literals(["file", "directory"]);
1515
16export const ProjectEntry = Schema.Struct({16export const ProjectEntry = Schema.Struct({
17 path: TrimmedNonEmptyString,17 path: TrimmedNonEmptyString,
packages/contracts/src/provider.ts+6-65
...@@ -19,19 +19,17 @@ import {...@@ -19,19 +19,17 @@ import {
19 ProviderRequestKind,19 ProviderRequestKind,
20 ProviderUserInputAnswers,20 ProviderUserInputAnswers,
21 RuntimeMode,21 RuntimeMode,
22 TurnCountRange,
23} from "./orchestration";22} from "./orchestration";
2423
25const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;24const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;
2625
27export const ProviderSessionStatus = Schema.Literals([26const ProviderSessionStatus = Schema.Literals([
28 "connecting",27 "connecting",
29 "ready",28 "ready",
30 "running",29 "running",
31 "error",30 "error",
32 "closed",31 "closed",
33]);32]);
34export type ProviderSessionStatus = typeof ProviderSessionStatus.Type;
3533
36export const ProviderSession = Schema.Struct({34export const ProviderSession = Schema.Struct({
37 provider: ProviderKind,35 provider: ProviderKind,
...@@ -48,30 +46,26 @@ export const ProviderSession = Schema.Struct({...@@ -48,30 +46,26 @@ export const ProviderSession = Schema.Struct({
48});46});
49export type ProviderSession = typeof ProviderSession.Type;47export type ProviderSession = typeof ProviderSession.Type;
5048
51export const CodexProviderStartOptions = Schema.Struct({49const CodexProviderStartOptions = Schema.Struct({
52 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),50 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
53 homePath: Schema.optional(TrimmedNonEmptyStringSchema),51 homePath: Schema.optional(TrimmedNonEmptyStringSchema),
54});52});
55export type CodexProviderStartOptions = typeof CodexProviderStartOptions.Type;
5653
57export const ClaudeCodeProviderStartOptions = Schema.Struct({54const ClaudeCodeProviderStartOptions = Schema.Struct({
58 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),55 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
59 permissionMode: Schema.optional(TrimmedNonEmptyStringSchema),56 permissionMode: Schema.optional(TrimmedNonEmptyStringSchema),
60 maxThinkingTokens: Schema.optional(NonNegativeInt),57 maxThinkingTokens: Schema.optional(NonNegativeInt),
61});58});
62export type ClaudeCodeProviderStartOptions = typeof ClaudeCodeProviderStartOptions.Type;
6359
64export const CursorProviderStartOptions = Schema.Struct({60const CursorProviderStartOptions = Schema.Struct({
65 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),61 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
66});62});
67export type CursorProviderStartOptions = typeof CursorProviderStartOptions.Type;
6863
69export const ProviderStartOptions = Schema.Struct({64const ProviderStartOptions = Schema.Struct({
70 codex: Schema.optional(CodexProviderStartOptions),65 codex: Schema.optional(CodexProviderStartOptions),
71 claudeCode: Schema.optional(ClaudeCodeProviderStartOptions),66 claudeCode: Schema.optional(ClaudeCodeProviderStartOptions),
72 cursor: Schema.optional(CursorProviderStartOptions),67 cursor: Schema.optional(CursorProviderStartOptions),
73});68});
74export type ProviderStartOptions = typeof ProviderStartOptions.Type;
7569
76export const ProviderSessionStartInput = Schema.Struct({70export const ProviderSessionStartInput = Schema.Struct({
77 threadId: ThreadId,71 threadId: ThreadId,
...@@ -116,55 +110,6 @@ export const ProviderStopSessionInput = Schema.Struct({...@@ -116,55 +110,6 @@ export const ProviderStopSessionInput = Schema.Struct({
116});110});
117export type ProviderStopSessionInput = typeof ProviderStopSessionInput.Type;111export type ProviderStopSessionInput = typeof ProviderStopSessionInput.Type;
118112
119export const ProviderListCheckpointsInput = Schema.Struct({
120 threadId: ThreadId,
121});
122export type ProviderListCheckpointsInput = typeof ProviderListCheckpointsInput.Type;
123
124export const ProviderCheckpoint = Schema.Struct({
125 id: TrimmedNonEmptyStringSchema,
126 turnCount: NonNegativeInt,
127 messageCount: NonNegativeInt,
128 label: TrimmedNonEmptyStringSchema,
129 preview: Schema.optional(TrimmedNonEmptyStringSchema),
130 isCurrent: Schema.Boolean,
131});
132export type ProviderCheckpoint = typeof ProviderCheckpoint.Type;
133
134export const ProviderListCheckpointsResult = Schema.Struct({
135 threadId: ThreadId,
136 checkpoints: Schema.Array(ProviderCheckpoint),
137});
138export type ProviderListCheckpointsResult = typeof ProviderListCheckpointsResult.Type;
139
140export const ProviderRevertToCheckpointInput = Schema.Struct({
141 threadId: ThreadId,
142 turnCount: NonNegativeInt,
143});
144export type ProviderRevertToCheckpointInput = typeof ProviderRevertToCheckpointInput.Type;
145
146export const ProviderRevertToCheckpointResult = Schema.Struct({
147 threadId: ThreadId,
148 turnCount: NonNegativeInt,
149 messageCount: NonNegativeInt,
150 rolledBackTurns: NonNegativeInt,
151 checkpoints: Schema.Array(ProviderCheckpoint),
152});
153export type ProviderRevertToCheckpointResult = typeof ProviderRevertToCheckpointResult.Type;
154
155export const ProviderGetCheckpointDiffInput = Schema.Struct({
156 threadId: ThreadId,
157 ...TurnCountRange.fields,
158});
159export type ProviderGetCheckpointDiffInput = typeof ProviderGetCheckpointDiffInput.Type;
160
161export const ProviderGetCheckpointDiffResult = Schema.Struct({
162 threadId: ThreadId,
163 ...TurnCountRange.fields,
164 diff: Schema.String,
165});
166export type ProviderGetCheckpointDiffResult = typeof ProviderGetCheckpointDiffResult.Type;
167
168export const ProviderRespondToRequestInput = Schema.Struct({113export const ProviderRespondToRequestInput = Schema.Struct({
169 threadId: ThreadId,114 threadId: ThreadId,
170 requestId: ApprovalRequestId,115 requestId: ApprovalRequestId,
...@@ -179,8 +124,7 @@ export const ProviderRespondToUserInputInput = Schema.Struct({...@@ -179,8 +124,7 @@ export const ProviderRespondToUserInputInput = Schema.Struct({
179});124});
180export type ProviderRespondToUserInputInput = typeof ProviderRespondToUserInputInput.Type;125export type ProviderRespondToUserInputInput = typeof ProviderRespondToUserInputInput.Type;
181126
182export const ProviderEventKind = Schema.Literals(["session", "notification", "request", "error"]);127const ProviderEventKind = Schema.Literals(["session", "notification", "request", "error"]);
183export type ProviderEventKind = typeof ProviderEventKind.Type;
184128
185export const ProviderEvent = Schema.Struct({129export const ProviderEvent = Schema.Struct({
186 id: EventId,130 id: EventId,
...@@ -198,6 +142,3 @@ export const ProviderEvent = Schema.Struct({...@@ -198,6 +142,3 @@ export const ProviderEvent = Schema.Struct({
198 payload: Schema.optional(Schema.Unknown),142 payload: Schema.optional(Schema.Unknown),
199});143});
200export type ProviderEvent = typeof ProviderEvent.Type;144export type ProviderEvent = typeof ProviderEvent.Type;
201
202export type ProviderSendTurnAttachment = typeof ChatAttachment.Type;
203export type ProviderSendTurnAttachmentInput = typeof ChatAttachment.Type;
packages/contracts/src/providerRuntime.ts+161-161
...@@ -15,7 +15,7 @@ import { ProviderKind } from "./orchestration";...@@ -15,7 +15,7 @@ import { ProviderKind } from "./orchestration";
15const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;15const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;
16const UnknownRecordSchema = Schema.Record(Schema.String, Schema.Unknown);16const UnknownRecordSchema = Schema.Record(Schema.String, Schema.Unknown);
1717
18export const RuntimeEventRawSource = Schema.Literals([18const RuntimeEventRawSource = Schema.Literals([
19 "codex.app-server.notification",19 "codex.app-server.notification",
20 "codex.app-server.request",20 "codex.app-server.request",
21 "codex.eventmsg",21 "codex.eventmsg",
...@@ -36,17 +36,17 @@ export const RuntimeEventRaw = Schema.Struct({...@@ -36,17 +36,17 @@ export const RuntimeEventRaw = Schema.Struct({
36});36});
37export type RuntimeEventRaw = typeof RuntimeEventRaw.Type;37export type RuntimeEventRaw = typeof RuntimeEventRaw.Type;
3838
39export const ProviderRequestId = TrimmedNonEmptyStringSchema;39const ProviderRequestId = TrimmedNonEmptyStringSchema;
40export type ProviderRequestId = typeof ProviderRequestId.Type;40export type ProviderRequestId = typeof ProviderRequestId.Type;
4141
42export const ProviderRefs = Schema.Struct({42const ProviderRefs = Schema.Struct({
43 providerTurnId: Schema.optional(TrimmedNonEmptyStringSchema),43 providerTurnId: Schema.optional(TrimmedNonEmptyStringSchema),
44 providerItemId: Schema.optional(ProviderItemId),44 providerItemId: Schema.optional(ProviderItemId),
45 providerRequestId: Schema.optional(ProviderRequestId),45 providerRequestId: Schema.optional(ProviderRequestId),
46});46});
47export type ProviderRefs = typeof ProviderRefs.Type;47export type ProviderRefs = typeof ProviderRefs.Type;
4848
49export const RuntimeSessionState = Schema.Literals([49const RuntimeSessionState = Schema.Literals([
50 "starting",50 "starting",
51 "ready",51 "ready",
52 "running",52 "running",
...@@ -56,7 +56,7 @@ export const RuntimeSessionState = Schema.Literals([...@@ -56,7 +56,7 @@ export const RuntimeSessionState = Schema.Literals([
56]);56]);
57export type RuntimeSessionState = typeof RuntimeSessionState.Type;57export type RuntimeSessionState = typeof RuntimeSessionState.Type;
5858
59export const RuntimeThreadState = Schema.Literals([59const RuntimeThreadState = Schema.Literals([
60 "active",60 "active",
61 "idle",61 "idle",
62 "archived",62 "archived",
...@@ -66,7 +66,7 @@ export const RuntimeThreadState = Schema.Literals([...@@ -66,7 +66,7 @@ export const RuntimeThreadState = Schema.Literals([
66]);66]);
67export type RuntimeThreadState = typeof RuntimeThreadState.Type;67export type RuntimeThreadState = typeof RuntimeThreadState.Type;
6868
69export const RuntimeTurnState = Schema.Literals([69const RuntimeTurnState = Schema.Literals([
70 "completed",70 "completed",
71 "failed",71 "failed",
72 "interrupted",72 "interrupted",
...@@ -74,13 +74,13 @@ export const RuntimeTurnState = Schema.Literals([...@@ -74,13 +74,13 @@ export const RuntimeTurnState = Schema.Literals([
74]);74]);
75export type RuntimeTurnState = typeof RuntimeTurnState.Type;75export type RuntimeTurnState = typeof RuntimeTurnState.Type;
7676
77export const RuntimePlanStepStatus = Schema.Literals(["pending", "inProgress", "completed"]);77const RuntimePlanStepStatus = Schema.Literals(["pending", "inProgress", "completed"]);
78export type RuntimePlanStepStatus = typeof RuntimePlanStepStatus.Type;78export type RuntimePlanStepStatus = typeof RuntimePlanStepStatus.Type;
7979
80export const RuntimeItemStatus = Schema.Literals(["inProgress", "completed", "failed", "declined"]);80const RuntimeItemStatus = Schema.Literals(["inProgress", "completed", "failed", "declined"]);
81export type RuntimeItemStatus = typeof RuntimeItemStatus.Type;81export type RuntimeItemStatus = typeof RuntimeItemStatus.Type;
8282
83export const RuntimeContentStreamKind = Schema.Literals([83const RuntimeContentStreamKind = Schema.Literals([
84 "assistant_text",84 "assistant_text",
85 "reasoning_text",85 "reasoning_text",
86 "reasoning_summary_text",86 "reasoning_summary_text",
...@@ -91,10 +91,10 @@ export const RuntimeContentStreamKind = Schema.Literals([...@@ -91,10 +91,10 @@ export const RuntimeContentStreamKind = Schema.Literals([
91]);91]);
92export type RuntimeContentStreamKind = typeof RuntimeContentStreamKind.Type;92export type RuntimeContentStreamKind = typeof RuntimeContentStreamKind.Type;
9393
94export const RuntimeSessionExitKind = Schema.Literals(["graceful", "error"]);94const RuntimeSessionExitKind = Schema.Literals(["graceful", "error"]);
95export type RuntimeSessionExitKind = typeof RuntimeSessionExitKind.Type;95export type RuntimeSessionExitKind = typeof RuntimeSessionExitKind.Type;
9696
97export const RuntimeErrorClass = Schema.Literals([97const RuntimeErrorClass = Schema.Literals([
98 "provider_error",98 "provider_error",
99 "transport_error",99 "transport_error",
100 "permission_error",100 "permission_error",
...@@ -136,7 +136,7 @@ export const CanonicalRequestType = Schema.Literals([...@@ -136,7 +136,7 @@ export const CanonicalRequestType = Schema.Literals([
136]);136]);
137export type CanonicalRequestType = typeof CanonicalRequestType.Type;137export type CanonicalRequestType = typeof CanonicalRequestType.Type;
138138
139export const ProviderRuntimeEventType = Schema.Literals([139const ProviderRuntimeEventType = Schema.Literals([
140 "session.started",140 "session.started",
141 "session.configured",141 "session.configured",
142 "session.state.changed",142 "session.state.changed",
...@@ -187,55 +187,55 @@ export const ProviderRuntimeEventType = Schema.Literals([...@@ -187,55 +187,55 @@ export const ProviderRuntimeEventType = Schema.Literals([
187]);187]);
188export type ProviderRuntimeEventType = typeof ProviderRuntimeEventType.Type;188export type ProviderRuntimeEventType = typeof ProviderRuntimeEventType.Type;
189189
190export const SessionStartedType = Schema.Literal("session.started");190const SessionStartedType = Schema.Literal("session.started");
191export const SessionConfiguredType = Schema.Literal("session.configured");191const SessionConfiguredType = Schema.Literal("session.configured");
192export const SessionStateChangedType = Schema.Literal("session.state.changed");192const SessionStateChangedType = Schema.Literal("session.state.changed");
193export const SessionExitedType = Schema.Literal("session.exited");193const SessionExitedType = Schema.Literal("session.exited");
194export const ThreadStartedType = Schema.Literal("thread.started");194const ThreadStartedType = Schema.Literal("thread.started");
195export const ThreadStateChangedType = Schema.Literal("thread.state.changed");195const ThreadStateChangedType = Schema.Literal("thread.state.changed");
196export const ThreadMetadataUpdatedType = Schema.Literal("thread.metadata.updated");196const ThreadMetadataUpdatedType = Schema.Literal("thread.metadata.updated");
197export const ThreadTokenUsageUpdatedType = Schema.Literal("thread.token-usage.updated");197const ThreadTokenUsageUpdatedType = Schema.Literal("thread.token-usage.updated");
198export const ThreadRealtimeStartedType = Schema.Literal("thread.realtime.started");198const ThreadRealtimeStartedType = Schema.Literal("thread.realtime.started");
199export const ThreadRealtimeItemAddedType = Schema.Literal("thread.realtime.item-added");199const ThreadRealtimeItemAddedType = Schema.Literal("thread.realtime.item-added");
200export const ThreadRealtimeAudioDeltaType = Schema.Literal("thread.realtime.audio.delta");200const ThreadRealtimeAudioDeltaType = Schema.Literal("thread.realtime.audio.delta");
201export const ThreadRealtimeErrorType = Schema.Literal("thread.realtime.error");201const ThreadRealtimeErrorType = Schema.Literal("thread.realtime.error");
202export const ThreadRealtimeClosedType = Schema.Literal("thread.realtime.closed");202const ThreadRealtimeClosedType = Schema.Literal("thread.realtime.closed");
203export const TurnStartedType = Schema.Literal("turn.started");203const TurnStartedType = Schema.Literal("turn.started");
204export const TurnCompletedType = Schema.Literal("turn.completed");204const TurnCompletedType = Schema.Literal("turn.completed");
205export const TurnAbortedType = Schema.Literal("turn.aborted");205const TurnAbortedType = Schema.Literal("turn.aborted");
206export const TurnPlanUpdatedType = Schema.Literal("turn.plan.updated");206const TurnPlanUpdatedType = Schema.Literal("turn.plan.updated");
207export const TurnProposedDeltaType = Schema.Literal("turn.proposed.delta");207const TurnProposedDeltaType = Schema.Literal("turn.proposed.delta");
208export const TurnProposedCompletedType = Schema.Literal("turn.proposed.completed");208const TurnProposedCompletedType = Schema.Literal("turn.proposed.completed");
209export const TurnDiffUpdatedType = Schema.Literal("turn.diff.updated");209const TurnDiffUpdatedType = Schema.Literal("turn.diff.updated");
210export const ItemStartedType = Schema.Literal("item.started");210const ItemStartedType = Schema.Literal("item.started");
211export const ItemUpdatedType = Schema.Literal("item.updated");211const ItemUpdatedType = Schema.Literal("item.updated");
212export const ItemCompletedType = Schema.Literal("item.completed");212const ItemCompletedType = Schema.Literal("item.completed");
213export const ContentDeltaType = Schema.Literal("content.delta");213const ContentDeltaType = Schema.Literal("content.delta");
214export const RequestOpenedType = Schema.Literal("request.opened");214const RequestOpenedType = Schema.Literal("request.opened");
215export const RequestResolvedType = Schema.Literal("request.resolved");215const RequestResolvedType = Schema.Literal("request.resolved");
216export const UserInputRequestedType = Schema.Literal("user-input.requested");216const UserInputRequestedType = Schema.Literal("user-input.requested");
217export const UserInputResolvedType = Schema.Literal("user-input.resolved");217const UserInputResolvedType = Schema.Literal("user-input.resolved");
218export const TaskStartedType = Schema.Literal("task.started");218const TaskStartedType = Schema.Literal("task.started");
219export const TaskProgressType = Schema.Literal("task.progress");219const TaskProgressType = Schema.Literal("task.progress");
220export const TaskCompletedType = Schema.Literal("task.completed");220const TaskCompletedType = Schema.Literal("task.completed");
221export const HookStartedType = Schema.Literal("hook.started");221const HookStartedType = Schema.Literal("hook.started");
222export const HookProgressType = Schema.Literal("hook.progress");222const HookProgressType = Schema.Literal("hook.progress");
223export const HookCompletedType = Schema.Literal("hook.completed");223const HookCompletedType = Schema.Literal("hook.completed");
224export const ToolProgressType = Schema.Literal("tool.progress");224const ToolProgressType = Schema.Literal("tool.progress");
225export const ToolSummaryType = Schema.Literal("tool.summary");225const ToolSummaryType = Schema.Literal("tool.summary");
226export const AuthStatusType = Schema.Literal("auth.status");226const AuthStatusType = Schema.Literal("auth.status");
227export const AccountUpdatedType = Schema.Literal("account.updated");227const AccountUpdatedType = Schema.Literal("account.updated");
228export const AccountRateLimitsUpdatedType = Schema.Literal("account.rate-limits.updated");228const AccountRateLimitsUpdatedType = Schema.Literal("account.rate-limits.updated");
229export const McpStatusUpdatedType = Schema.Literal("mcp.status.updated");229const McpStatusUpdatedType = Schema.Literal("mcp.status.updated");
230export const McpOauthCompletedType = Schema.Literal("mcp.oauth.completed");230const McpOauthCompletedType = Schema.Literal("mcp.oauth.completed");
231export const ModelReroutedType = Schema.Literal("model.rerouted");231const ModelReroutedType = Schema.Literal("model.rerouted");
232export const ConfigWarningType = Schema.Literal("config.warning");232const ConfigWarningType = Schema.Literal("config.warning");
233export const DeprecationNoticeType = Schema.Literal("deprecation.notice");233const DeprecationNoticeType = Schema.Literal("deprecation.notice");
234export const FilesPersistedType = Schema.Literal("files.persisted");234const FilesPersistedType = Schema.Literal("files.persisted");
235export const RuntimeWarningType = Schema.Literal("runtime.warning");235const RuntimeWarningType = Schema.Literal("runtime.warning");
236export const RuntimeErrorType = Schema.Literal("runtime.error");236const RuntimeErrorType = Schema.Literal("runtime.error");
237237
238export const ProviderRuntimeEventBase = Schema.Struct({238const ProviderRuntimeEventBase = Schema.Struct({
239 eventId: EventId,239 eventId: EventId,
240 provider: ProviderKind,240 provider: ProviderKind,
241 threadId: ThreadId,241 threadId: ThreadId,
...@@ -248,85 +248,85 @@ export const ProviderRuntimeEventBase = Schema.Struct({...@@ -248,85 +248,85 @@ export const ProviderRuntimeEventBase = Schema.Struct({
248});248});
249export type ProviderRuntimeEventBase = typeof ProviderRuntimeEventBase.Type;249export type ProviderRuntimeEventBase = typeof ProviderRuntimeEventBase.Type;
250250
251export const SessionStartedPayload = Schema.Struct({251const SessionStartedPayload = Schema.Struct({
252 message: Schema.optional(TrimmedNonEmptyStringSchema),252 message: Schema.optional(TrimmedNonEmptyStringSchema),
253 resume: Schema.optional(Schema.Unknown),253 resume: Schema.optional(Schema.Unknown),
254});254});
255export type SessionStartedPayload = typeof SessionStartedPayload.Type;255export type SessionStartedPayload = typeof SessionStartedPayload.Type;
256256
257export const SessionConfiguredPayload = Schema.Struct({257const SessionConfiguredPayload = Schema.Struct({
258 config: UnknownRecordSchema,258 config: UnknownRecordSchema,
259});259});
260export type SessionConfiguredPayload = typeof SessionConfiguredPayload.Type;260export type SessionConfiguredPayload = typeof SessionConfiguredPayload.Type;
261261
262export const SessionStateChangedPayload = Schema.Struct({262const SessionStateChangedPayload = Schema.Struct({
263 state: RuntimeSessionState,263 state: RuntimeSessionState,
264 reason: Schema.optional(TrimmedNonEmptyStringSchema),264 reason: Schema.optional(TrimmedNonEmptyStringSchema),
265 detail: Schema.optional(Schema.Unknown),265 detail: Schema.optional(Schema.Unknown),
266});266});
267export type SessionStateChangedPayload = typeof SessionStateChangedPayload.Type;267export type SessionStateChangedPayload = typeof SessionStateChangedPayload.Type;
268268
269export const SessionExitedPayload = Schema.Struct({269const SessionExitedPayload = Schema.Struct({
270 reason: Schema.optional(TrimmedNonEmptyStringSchema),270 reason: Schema.optional(TrimmedNonEmptyStringSchema),
271 recoverable: Schema.optional(Schema.Boolean),271 recoverable: Schema.optional(Schema.Boolean),
272 exitKind: Schema.optional(RuntimeSessionExitKind),272 exitKind: Schema.optional(RuntimeSessionExitKind),
273});273});
274export type SessionExitedPayload = typeof SessionExitedPayload.Type;274export type SessionExitedPayload = typeof SessionExitedPayload.Type;
275275
276export const ThreadStartedPayload = Schema.Struct({276const ThreadStartedPayload = Schema.Struct({
277 providerThreadId: Schema.optional(TrimmedNonEmptyStringSchema),277 providerThreadId: Schema.optional(TrimmedNonEmptyStringSchema),
278});278});
279export type ThreadStartedPayload = typeof ThreadStartedPayload.Type;279export type ThreadStartedPayload = typeof ThreadStartedPayload.Type;
280280
281export const ThreadStateChangedPayload = Schema.Struct({281const ThreadStateChangedPayload = Schema.Struct({
282 state: RuntimeThreadState,282 state: RuntimeThreadState,
283 detail: Schema.optional(Schema.Unknown),283 detail: Schema.optional(Schema.Unknown),
284});284});
285export type ThreadStateChangedPayload = typeof ThreadStateChangedPayload.Type;285export type ThreadStateChangedPayload = typeof ThreadStateChangedPayload.Type;
286286
287export const ThreadMetadataUpdatedPayload = Schema.Struct({287const ThreadMetadataUpdatedPayload = Schema.Struct({
288 name: Schema.optional(TrimmedNonEmptyStringSchema),288 name: Schema.optional(TrimmedNonEmptyStringSchema),
289 metadata: Schema.optional(UnknownRecordSchema),289 metadata: Schema.optional(UnknownRecordSchema),
290});290});
291export type ThreadMetadataUpdatedPayload = typeof ThreadMetadataUpdatedPayload.Type;291export type ThreadMetadataUpdatedPayload = typeof ThreadMetadataUpdatedPayload.Type;
292292
293export const ThreadTokenUsageUpdatedPayload = Schema.Struct({293const ThreadTokenUsageUpdatedPayload = Schema.Struct({
294 usage: Schema.Unknown,294 usage: Schema.Unknown,
295});295});
296export type ThreadTokenUsageUpdatedPayload = typeof ThreadTokenUsageUpdatedPayload.Type;296export type ThreadTokenUsageUpdatedPayload = typeof ThreadTokenUsageUpdatedPayload.Type;
297297
298export const ThreadRealtimeStartedPayload = Schema.Struct({298const ThreadRealtimeStartedPayload = Schema.Struct({
299 realtimeSessionId: Schema.optional(TrimmedNonEmptyStringSchema),299 realtimeSessionId: Schema.optional(TrimmedNonEmptyStringSchema),
300});300});
301export type ThreadRealtimeStartedPayload = typeof ThreadRealtimeStartedPayload.Type;301export type ThreadRealtimeStartedPayload = typeof ThreadRealtimeStartedPayload.Type;
302302
303export const ThreadRealtimeItemAddedPayload = Schema.Struct({303const ThreadRealtimeItemAddedPayload = Schema.Struct({
304 item: Schema.Unknown,304 item: Schema.Unknown,
305});305});
306export type ThreadRealtimeItemAddedPayload = typeof ThreadRealtimeItemAddedPayload.Type;306export type ThreadRealtimeItemAddedPayload = typeof ThreadRealtimeItemAddedPayload.Type;
307307
308export const ThreadRealtimeAudioDeltaPayload = Schema.Struct({308const ThreadRealtimeAudioDeltaPayload = Schema.Struct({
309 audio: Schema.Unknown,309 audio: Schema.Unknown,
310});310});
311export type ThreadRealtimeAudioDeltaPayload = typeof ThreadRealtimeAudioDeltaPayload.Type;311export type ThreadRealtimeAudioDeltaPayload = typeof ThreadRealtimeAudioDeltaPayload.Type;
312312
313export const ThreadRealtimeErrorPayload = Schema.Struct({313const ThreadRealtimeErrorPayload = Schema.Struct({
314 message: TrimmedNonEmptyStringSchema,314 message: TrimmedNonEmptyStringSchema,
315});315});
316export type ThreadRealtimeErrorPayload = typeof ThreadRealtimeErrorPayload.Type;316export type ThreadRealtimeErrorPayload = typeof ThreadRealtimeErrorPayload.Type;
317317
318export const ThreadRealtimeClosedPayload = Schema.Struct({318const ThreadRealtimeClosedPayload = Schema.Struct({
319 reason: Schema.optional(TrimmedNonEmptyStringSchema),319 reason: Schema.optional(TrimmedNonEmptyStringSchema),
320});320});
321export type ThreadRealtimeClosedPayload = typeof ThreadRealtimeClosedPayload.Type;321export type ThreadRealtimeClosedPayload = typeof ThreadRealtimeClosedPayload.Type;
322322
323export const TurnStartedPayload = Schema.Struct({323const TurnStartedPayload = Schema.Struct({
324 model: Schema.optional(TrimmedNonEmptyStringSchema),324 model: Schema.optional(TrimmedNonEmptyStringSchema),
325 effort: Schema.optional(TrimmedNonEmptyStringSchema),325 effort: Schema.optional(TrimmedNonEmptyStringSchema),
326});326});
327export type TurnStartedPayload = typeof TurnStartedPayload.Type;327export type TurnStartedPayload = typeof TurnStartedPayload.Type;
328328
329export const TurnCompletedPayload = Schema.Struct({329const TurnCompletedPayload = Schema.Struct({
330 state: RuntimeTurnState,330 state: RuntimeTurnState,
331 stopReason: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),331 stopReason: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),
332 usage: Schema.optional(Schema.Unknown),332 usage: Schema.optional(Schema.Unknown),
...@@ -336,34 +336,34 @@ export const TurnCompletedPayload = Schema.Struct({...@@ -336,34 +336,34 @@ export const TurnCompletedPayload = Schema.Struct({
336});336});
337export type TurnCompletedPayload = typeof TurnCompletedPayload.Type;337export type TurnCompletedPayload = typeof TurnCompletedPayload.Type;
338338
339export const TurnAbortedPayload = Schema.Struct({339const TurnAbortedPayload = Schema.Struct({
340 reason: TrimmedNonEmptyStringSchema,340 reason: TrimmedNonEmptyStringSchema,
341});341});
342export type TurnAbortedPayload = typeof TurnAbortedPayload.Type;342export type TurnAbortedPayload = typeof TurnAbortedPayload.Type;
343343
344export const RuntimePlanStep = Schema.Struct({344const RuntimePlanStep = Schema.Struct({
345 step: TrimmedNonEmptyStringSchema,345 step: TrimmedNonEmptyStringSchema,
346 status: RuntimePlanStepStatus,346 status: RuntimePlanStepStatus,
347});347});
348export type RuntimePlanStep = typeof RuntimePlanStep.Type;348export type RuntimePlanStep = typeof RuntimePlanStep.Type;
349349
350export const TurnPlanUpdatedPayload = Schema.Struct({350const TurnPlanUpdatedPayload = Schema.Struct({
351 explanation: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),351 explanation: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),
352 plan: Schema.Array(RuntimePlanStep),352 plan: Schema.Array(RuntimePlanStep),
353});353});
354export type TurnPlanUpdatedPayload = typeof TurnPlanUpdatedPayload.Type;354export type TurnPlanUpdatedPayload = typeof TurnPlanUpdatedPayload.Type;
355355
356export const TurnProposedDeltaPayload = Schema.Struct({356const TurnProposedDeltaPayload = Schema.Struct({
357 delta: Schema.String,357 delta: Schema.String,
358});358});
359export type TurnProposedDeltaPayload = typeof TurnProposedDeltaPayload.Type;359export type TurnProposedDeltaPayload = typeof TurnProposedDeltaPayload.Type;
360360
361export const TurnProposedCompletedPayload = Schema.Struct({361const TurnProposedCompletedPayload = Schema.Struct({
362 planMarkdown: TrimmedNonEmptyStringSchema,362 planMarkdown: TrimmedNonEmptyStringSchema,
363});363});
364export type TurnProposedCompletedPayload = typeof TurnProposedCompletedPayload.Type;364export type TurnProposedCompletedPayload = typeof TurnProposedCompletedPayload.Type;
365365
366export const TurnDiffUpdatedPayload = Schema.Struct({366const TurnDiffUpdatedPayload = Schema.Struct({
367 unifiedDiff: Schema.String,367 unifiedDiff: Schema.String,
368});368});
369export type TurnDiffUpdatedPayload = typeof TurnDiffUpdatedPayload.Type;369export type TurnDiffUpdatedPayload = typeof TurnDiffUpdatedPayload.Type;
...@@ -377,7 +377,7 @@ export const ItemLifecyclePayload = Schema.Struct({...@@ -377,7 +377,7 @@ export const ItemLifecyclePayload = Schema.Struct({
377});377});
378export type ItemLifecyclePayload = typeof ItemLifecyclePayload.Type;378export type ItemLifecyclePayload = typeof ItemLifecyclePayload.Type;
379379
380export const ContentDeltaPayload = Schema.Struct({380const ContentDeltaPayload = Schema.Struct({
381 streamKind: RuntimeContentStreamKind,381 streamKind: RuntimeContentStreamKind,
382 delta: Schema.String,382 delta: Schema.String,
383 contentIndex: Schema.optional(Schema.Int),383 contentIndex: Schema.optional(Schema.Int),
...@@ -385,21 +385,21 @@ export const ContentDeltaPayload = Schema.Struct({...@@ -385,21 +385,21 @@ export const ContentDeltaPayload = Schema.Struct({
385});385});
386export type ContentDeltaPayload = typeof ContentDeltaPayload.Type;386export type ContentDeltaPayload = typeof ContentDeltaPayload.Type;
387387
388export const RequestOpenedPayload = Schema.Struct({388const RequestOpenedPayload = Schema.Struct({
389 requestType: CanonicalRequestType,389 requestType: CanonicalRequestType,
390 detail: Schema.optional(TrimmedNonEmptyStringSchema),390 detail: Schema.optional(TrimmedNonEmptyStringSchema),
391 args: Schema.optional(Schema.Unknown),391 args: Schema.optional(Schema.Unknown),
392});392});
393export type RequestOpenedPayload = typeof RequestOpenedPayload.Type;393export type RequestOpenedPayload = typeof RequestOpenedPayload.Type;
394394
395export const RequestResolvedPayload = Schema.Struct({395const RequestResolvedPayload = Schema.Struct({
396 requestType: CanonicalRequestType,396 requestType: CanonicalRequestType,
397 decision: Schema.optional(TrimmedNonEmptyStringSchema),397 decision: Schema.optional(TrimmedNonEmptyStringSchema),
398 resolution: Schema.optional(Schema.Unknown),398 resolution: Schema.optional(Schema.Unknown),
399});399});
400export type RequestResolvedPayload = typeof RequestResolvedPayload.Type;400export type RequestResolvedPayload = typeof RequestResolvedPayload.Type;
401401
402export const UserInputQuestionOption = Schema.Struct({402const UserInputQuestionOption = Schema.Struct({
403 label: TrimmedNonEmptyStringSchema,403 label: TrimmedNonEmptyStringSchema,
404 description: TrimmedNonEmptyStringSchema,404 description: TrimmedNonEmptyStringSchema,
405});405});
...@@ -413,24 +413,24 @@ export const UserInputQuestion = Schema.Struct({...@@ -413,24 +413,24 @@ export const UserInputQuestion = Schema.Struct({
413});413});
414export type UserInputQuestion = typeof UserInputQuestion.Type;414export type UserInputQuestion = typeof UserInputQuestion.Type;
415415
416export const UserInputRequestedPayload = Schema.Struct({416const UserInputRequestedPayload = Schema.Struct({
417 questions: Schema.Array(UserInputQuestion),417 questions: Schema.Array(UserInputQuestion),
418});418});
419export type UserInputRequestedPayload = typeof UserInputRequestedPayload.Type;419export type UserInputRequestedPayload = typeof UserInputRequestedPayload.Type;
420420
421export const UserInputResolvedPayload = Schema.Struct({421const UserInputResolvedPayload = Schema.Struct({
422 answers: UnknownRecordSchema,422 answers: UnknownRecordSchema,
423});423});
424export type UserInputResolvedPayload = typeof UserInputResolvedPayload.Type;424export type UserInputResolvedPayload = typeof UserInputResolvedPayload.Type;
425425
426export const TaskStartedPayload = Schema.Struct({426const TaskStartedPayload = Schema.Struct({
427 taskId: RuntimeTaskId,427 taskId: RuntimeTaskId,
428 description: Schema.optional(TrimmedNonEmptyStringSchema),428 description: Schema.optional(TrimmedNonEmptyStringSchema),
429 taskType: Schema.optional(TrimmedNonEmptyStringSchema),429 taskType: Schema.optional(TrimmedNonEmptyStringSchema),
430});430});
431export type TaskStartedPayload = typeof TaskStartedPayload.Type;431export type TaskStartedPayload = typeof TaskStartedPayload.Type;
432432
433export const TaskProgressPayload = Schema.Struct({433const TaskProgressPayload = Schema.Struct({
434 taskId: RuntimeTaskId,434 taskId: RuntimeTaskId,
435 description: TrimmedNonEmptyStringSchema,435 description: TrimmedNonEmptyStringSchema,
436 usage: Schema.optional(Schema.Unknown),436 usage: Schema.optional(Schema.Unknown),
...@@ -438,7 +438,7 @@ export const TaskProgressPayload = Schema.Struct({...@@ -438,7 +438,7 @@ export const TaskProgressPayload = Schema.Struct({
438});438});
439export type TaskProgressPayload = typeof TaskProgressPayload.Type;439export type TaskProgressPayload = typeof TaskProgressPayload.Type;
440440
441export const TaskCompletedPayload = Schema.Struct({441const TaskCompletedPayload = Schema.Struct({
442 taskId: RuntimeTaskId,442 taskId: RuntimeTaskId,
443 status: Schema.Literals(["completed", "failed", "stopped"]),443 status: Schema.Literals(["completed", "failed", "stopped"]),
444 summary: Schema.optional(TrimmedNonEmptyStringSchema),444 summary: Schema.optional(TrimmedNonEmptyStringSchema),
...@@ -446,14 +446,14 @@ export const TaskCompletedPayload = Schema.Struct({...@@ -446,14 +446,14 @@ export const TaskCompletedPayload = Schema.Struct({
446});446});
447export type TaskCompletedPayload = typeof TaskCompletedPayload.Type;447export type TaskCompletedPayload = typeof TaskCompletedPayload.Type;
448448
449export const HookStartedPayload = Schema.Struct({449const HookStartedPayload = Schema.Struct({
450 hookId: TrimmedNonEmptyStringSchema,450 hookId: TrimmedNonEmptyStringSchema,
451 hookName: TrimmedNonEmptyStringSchema,451 hookName: TrimmedNonEmptyStringSchema,
452 hookEvent: TrimmedNonEmptyStringSchema,452 hookEvent: TrimmedNonEmptyStringSchema,
453});453});
454export type HookStartedPayload = typeof HookStartedPayload.Type;454export type HookStartedPayload = typeof HookStartedPayload.Type;
455455
456export const HookProgressPayload = Schema.Struct({456const HookProgressPayload = Schema.Struct({
457 hookId: TrimmedNonEmptyStringSchema,457 hookId: TrimmedNonEmptyStringSchema,
458 output: Schema.optional(Schema.String),458 output: Schema.optional(Schema.String),
459 stdout: Schema.optional(Schema.String),459 stdout: Schema.optional(Schema.String),
...@@ -461,7 +461,7 @@ export const HookProgressPayload = Schema.Struct({...@@ -461,7 +461,7 @@ export const HookProgressPayload = Schema.Struct({
461});461});
462export type HookProgressPayload = typeof HookProgressPayload.Type;462export type HookProgressPayload = typeof HookProgressPayload.Type;
463463
464export const HookCompletedPayload = Schema.Struct({464const HookCompletedPayload = Schema.Struct({
465 hookId: TrimmedNonEmptyStringSchema,465 hookId: TrimmedNonEmptyStringSchema,
466 outcome: Schema.Literals(["success", "error", "cancelled"]),466 outcome: Schema.Literals(["success", "error", "cancelled"]),
467 output: Schema.optional(Schema.String),467 output: Schema.optional(Schema.String),
...@@ -471,7 +471,7 @@ export const HookCompletedPayload = Schema.Struct({...@@ -471,7 +471,7 @@ export const HookCompletedPayload = Schema.Struct({
471});471});
472export type HookCompletedPayload = typeof HookCompletedPayload.Type;472export type HookCompletedPayload = typeof HookCompletedPayload.Type;
473473
474export const ToolProgressPayload = Schema.Struct({474const ToolProgressPayload = Schema.Struct({
475 toolUseId: Schema.optional(TrimmedNonEmptyStringSchema),475 toolUseId: Schema.optional(TrimmedNonEmptyStringSchema),
476 toolName: Schema.optional(TrimmedNonEmptyStringSchema),476 toolName: Schema.optional(TrimmedNonEmptyStringSchema),
477 summary: Schema.optional(TrimmedNonEmptyStringSchema),477 summary: Schema.optional(TrimmedNonEmptyStringSchema),
...@@ -479,49 +479,49 @@ export const ToolProgressPayload = Schema.Struct({...@@ -479,49 +479,49 @@ export const ToolProgressPayload = Schema.Struct({
479});479});
480export type ToolProgressPayload = typeof ToolProgressPayload.Type;480export type ToolProgressPayload = typeof ToolProgressPayload.Type;
481481
482export const ToolSummaryPayload = Schema.Struct({482const ToolSummaryPayload = Schema.Struct({
483 summary: TrimmedNonEmptyStringSchema,483 summary: TrimmedNonEmptyStringSchema,
484 precedingToolUseIds: Schema.optional(Schema.Array(TrimmedNonEmptyStringSchema)),484 precedingToolUseIds: Schema.optional(Schema.Array(TrimmedNonEmptyStringSchema)),
485});485});
486export type ToolSummaryPayload = typeof ToolSummaryPayload.Type;486export type ToolSummaryPayload = typeof ToolSummaryPayload.Type;
487487
488export const AuthStatusPayload = Schema.Struct({488const AuthStatusPayload = Schema.Struct({
489 isAuthenticating: Schema.optional(Schema.Boolean),489 isAuthenticating: Schema.optional(Schema.Boolean),
490 output: Schema.optional(Schema.Array(Schema.String)),490 output: Schema.optional(Schema.Array(Schema.String)),
491 error: Schema.optional(TrimmedNonEmptyStringSchema),491 error: Schema.optional(TrimmedNonEmptyStringSchema),
492});492});
493export type AuthStatusPayload = typeof AuthStatusPayload.Type;493export type AuthStatusPayload = typeof AuthStatusPayload.Type;
494494
495export const AccountUpdatedPayload = Schema.Struct({495const AccountUpdatedPayload = Schema.Struct({
496 account: Schema.Unknown,496 account: Schema.Unknown,
497});497});
498export type AccountUpdatedPayload = typeof AccountUpdatedPayload.Type;498export type AccountUpdatedPayload = typeof AccountUpdatedPayload.Type;
499499
500export const AccountRateLimitsUpdatedPayload = Schema.Struct({500const AccountRateLimitsUpdatedPayload = Schema.Struct({
501 rateLimits: Schema.Unknown,501 rateLimits: Schema.Unknown,
502});502});
503export type AccountRateLimitsUpdatedPayload = typeof AccountRateLimitsUpdatedPayload.Type;503export type AccountRateLimitsUpdatedPayload = typeof AccountRateLimitsUpdatedPayload.Type;
504504
505export const McpStatusUpdatedPayload = Schema.Struct({505const McpStatusUpdatedPayload = Schema.Struct({
506 status: Schema.Unknown,506 status: Schema.Unknown,
507});507});
508export type McpStatusUpdatedPayload = typeof McpStatusUpdatedPayload.Type;508export type McpStatusUpdatedPayload = typeof McpStatusUpdatedPayload.Type;
509509
510export const McpOauthCompletedPayload = Schema.Struct({510const McpOauthCompletedPayload = Schema.Struct({
511 success: Schema.Boolean,511 success: Schema.Boolean,
512 name: Schema.optional(TrimmedNonEmptyStringSchema),512 name: Schema.optional(TrimmedNonEmptyStringSchema),
513 error: Schema.optional(TrimmedNonEmptyStringSchema),513 error: Schema.optional(TrimmedNonEmptyStringSchema),
514});514});
515export type McpOauthCompletedPayload = typeof McpOauthCompletedPayload.Type;515export type McpOauthCompletedPayload = typeof McpOauthCompletedPayload.Type;
516516
517export const ModelReroutedPayload = Schema.Struct({517const ModelReroutedPayload = Schema.Struct({
518 fromModel: TrimmedNonEmptyStringSchema,518 fromModel: TrimmedNonEmptyStringSchema,
519 toModel: TrimmedNonEmptyStringSchema,519 toModel: TrimmedNonEmptyStringSchema,
520 reason: TrimmedNonEmptyStringSchema,520 reason: TrimmedNonEmptyStringSchema,
521});521});
522export type ModelReroutedPayload = typeof ModelReroutedPayload.Type;522export type ModelReroutedPayload = typeof ModelReroutedPayload.Type;
523523
524export const ConfigWarningPayload = Schema.Struct({524const ConfigWarningPayload = Schema.Struct({
525 summary: TrimmedNonEmptyStringSchema,525 summary: TrimmedNonEmptyStringSchema,
526 details: Schema.optional(TrimmedNonEmptyStringSchema),526 details: Schema.optional(TrimmedNonEmptyStringSchema),
527 path: Schema.optional(TrimmedNonEmptyStringSchema),527 path: Schema.optional(TrimmedNonEmptyStringSchema),
...@@ -529,13 +529,13 @@ export const ConfigWarningPayload = Schema.Struct({...@@ -529,13 +529,13 @@ export const ConfigWarningPayload = Schema.Struct({
529});529});
530export type ConfigWarningPayload = typeof ConfigWarningPayload.Type;530export type ConfigWarningPayload = typeof ConfigWarningPayload.Type;
531531
532export const DeprecationNoticePayload = Schema.Struct({532const DeprecationNoticePayload = Schema.Struct({
533 summary: TrimmedNonEmptyStringSchema,533 summary: TrimmedNonEmptyStringSchema,
534 details: Schema.optional(TrimmedNonEmptyStringSchema),534 details: Schema.optional(TrimmedNonEmptyStringSchema),
535});535});
536export type DeprecationNoticePayload = typeof DeprecationNoticePayload.Type;536export type DeprecationNoticePayload = typeof DeprecationNoticePayload.Type;
537537
538export const FilesPersistedPayload = Schema.Struct({538const FilesPersistedPayload = Schema.Struct({
539 files: Schema.Array(539 files: Schema.Array(
540 Schema.Struct({540 Schema.Struct({
541 filename: TrimmedNonEmptyStringSchema,541 filename: TrimmedNonEmptyStringSchema,
...@@ -553,69 +553,69 @@ export const FilesPersistedPayload = Schema.Struct({...@@ -553,69 +553,69 @@ export const FilesPersistedPayload = Schema.Struct({
553});553});
554export type FilesPersistedPayload = typeof FilesPersistedPayload.Type;554export type FilesPersistedPayload = typeof FilesPersistedPayload.Type;
555555
556export const RuntimeWarningPayload = Schema.Struct({556const RuntimeWarningPayload = Schema.Struct({
557 message: TrimmedNonEmptyStringSchema,557 message: TrimmedNonEmptyStringSchema,
558 detail: Schema.optional(Schema.Unknown),558 detail: Schema.optional(Schema.Unknown),
559});559});
560export type RuntimeWarningPayload = typeof RuntimeWarningPayload.Type;560export type RuntimeWarningPayload = typeof RuntimeWarningPayload.Type;
561561
562export const RuntimeErrorPayload = Schema.Struct({562const RuntimeErrorPayload = Schema.Struct({
563 message: TrimmedNonEmptyStringSchema,563 message: TrimmedNonEmptyStringSchema,
564 class: Schema.optional(RuntimeErrorClass),564 class: Schema.optional(RuntimeErrorClass),
565 detail: Schema.optional(Schema.Unknown),565 detail: Schema.optional(Schema.Unknown),
566});566});
567export type RuntimeErrorPayload = typeof RuntimeErrorPayload.Type;567export type RuntimeErrorPayload = typeof RuntimeErrorPayload.Type;
568568
569export const ProviderRuntimeSessionStartedEvent = Schema.Struct({569const ProviderRuntimeSessionStartedEvent = Schema.Struct({
570 ...ProviderRuntimeEventBase.fields,570 ...ProviderRuntimeEventBase.fields,
571 type: SessionStartedType,571 type: SessionStartedType,
572 payload: SessionStartedPayload,572 payload: SessionStartedPayload,
573});573});
574export type ProviderRuntimeSessionStartedEvent = typeof ProviderRuntimeSessionStartedEvent.Type;574export type ProviderRuntimeSessionStartedEvent = typeof ProviderRuntimeSessionStartedEvent.Type;
575575
576export const ProviderRuntimeSessionConfiguredEvent = Schema.Struct({576const ProviderRuntimeSessionConfiguredEvent = Schema.Struct({
577 ...ProviderRuntimeEventBase.fields,577 ...ProviderRuntimeEventBase.fields,
578 type: SessionConfiguredType,578 type: SessionConfiguredType,
579 payload: SessionConfiguredPayload,579 payload: SessionConfiguredPayload,
580});580});
581export type ProviderRuntimeSessionConfiguredEvent = typeof ProviderRuntimeSessionConfiguredEvent.Type;581export type ProviderRuntimeSessionConfiguredEvent = typeof ProviderRuntimeSessionConfiguredEvent.Type;
582582
583export const ProviderRuntimeSessionStateChangedEvent = Schema.Struct({583const ProviderRuntimeSessionStateChangedEvent = Schema.Struct({
584 ...ProviderRuntimeEventBase.fields,584 ...ProviderRuntimeEventBase.fields,
585 type: SessionStateChangedType,585 type: SessionStateChangedType,
586 payload: SessionStateChangedPayload,586 payload: SessionStateChangedPayload,
587});587});
588export type ProviderRuntimeSessionStateChangedEvent = typeof ProviderRuntimeSessionStateChangedEvent.Type;588export type ProviderRuntimeSessionStateChangedEvent = typeof ProviderRuntimeSessionStateChangedEvent.Type;
589589
590export const ProviderRuntimeSessionExitedEvent = Schema.Struct({590const ProviderRuntimeSessionExitedEvent = Schema.Struct({
591 ...ProviderRuntimeEventBase.fields,591 ...ProviderRuntimeEventBase.fields,
592 type: SessionExitedType,592 type: SessionExitedType,
593 payload: SessionExitedPayload,593 payload: SessionExitedPayload,
594});594});
595export type ProviderRuntimeSessionExitedEvent = typeof ProviderRuntimeSessionExitedEvent.Type;595export type ProviderRuntimeSessionExitedEvent = typeof ProviderRuntimeSessionExitedEvent.Type;
596596
597export const ProviderRuntimeThreadStartedEvent = Schema.Struct({597const ProviderRuntimeThreadStartedEvent = Schema.Struct({
598 ...ProviderRuntimeEventBase.fields,598 ...ProviderRuntimeEventBase.fields,
599 type: ThreadStartedType,599 type: ThreadStartedType,
600 payload: ThreadStartedPayload,600 payload: ThreadStartedPayload,
601});601});
602export type ProviderRuntimeThreadStartedEvent = typeof ProviderRuntimeThreadStartedEvent.Type;602export type ProviderRuntimeThreadStartedEvent = typeof ProviderRuntimeThreadStartedEvent.Type;
603603
604export const ProviderRuntimeThreadStateChangedEvent = Schema.Struct({604const ProviderRuntimeThreadStateChangedEvent = Schema.Struct({
605 ...ProviderRuntimeEventBase.fields,605 ...ProviderRuntimeEventBase.fields,
606 type: ThreadStateChangedType,606 type: ThreadStateChangedType,
607 payload: ThreadStateChangedPayload,607 payload: ThreadStateChangedPayload,
608});608});
609export type ProviderRuntimeThreadStateChangedEvent = typeof ProviderRuntimeThreadStateChangedEvent.Type;609export type ProviderRuntimeThreadStateChangedEvent = typeof ProviderRuntimeThreadStateChangedEvent.Type;
610610
611export const ProviderRuntimeThreadMetadataUpdatedEvent = Schema.Struct({611const ProviderRuntimeThreadMetadataUpdatedEvent = Schema.Struct({
612 ...ProviderRuntimeEventBase.fields,612 ...ProviderRuntimeEventBase.fields,
613 type: ThreadMetadataUpdatedType,613 type: ThreadMetadataUpdatedType,
614 payload: ThreadMetadataUpdatedPayload,614 payload: ThreadMetadataUpdatedPayload,
615});615});
616export type ProviderRuntimeThreadMetadataUpdatedEvent = typeof ProviderRuntimeThreadMetadataUpdatedEvent.Type;616export type ProviderRuntimeThreadMetadataUpdatedEvent = typeof ProviderRuntimeThreadMetadataUpdatedEvent.Type;
617617
618export const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({618const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({
619 ...ProviderRuntimeEventBase.fields,619 ...ProviderRuntimeEventBase.fields,
620 type: ThreadTokenUsageUpdatedType,620 type: ThreadTokenUsageUpdatedType,
621 payload: ThreadTokenUsageUpdatedPayload,621 payload: ThreadTokenUsageUpdatedPayload,
...@@ -623,7 +623,7 @@ export const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({...@@ -623,7 +623,7 @@ export const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({
623export type ProviderRuntimeThreadTokenUsageUpdatedEvent =623export type ProviderRuntimeThreadTokenUsageUpdatedEvent =
624 typeof ProviderRuntimeThreadTokenUsageUpdatedEvent.Type;624 typeof ProviderRuntimeThreadTokenUsageUpdatedEvent.Type;
625625
626export const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({626const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({
627 ...ProviderRuntimeEventBase.fields,627 ...ProviderRuntimeEventBase.fields,
628 type: ThreadRealtimeStartedType,628 type: ThreadRealtimeStartedType,
629 payload: ThreadRealtimeStartedPayload,629 payload: ThreadRealtimeStartedPayload,
...@@ -631,7 +631,7 @@ export const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({...@@ -631,7 +631,7 @@ export const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({
631export type ProviderRuntimeThreadRealtimeStartedEvent =631export type ProviderRuntimeThreadRealtimeStartedEvent =
632 typeof ProviderRuntimeThreadRealtimeStartedEvent.Type;632 typeof ProviderRuntimeThreadRealtimeStartedEvent.Type;
633633
634export const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({634const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({
635 ...ProviderRuntimeEventBase.fields,635 ...ProviderRuntimeEventBase.fields,
636 type: ThreadRealtimeItemAddedType,636 type: ThreadRealtimeItemAddedType,
637 payload: ThreadRealtimeItemAddedPayload,637 payload: ThreadRealtimeItemAddedPayload,
...@@ -639,7 +639,7 @@ export const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({...@@ -639,7 +639,7 @@ export const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({
639export type ProviderRuntimeThreadRealtimeItemAddedEvent =639export type ProviderRuntimeThreadRealtimeItemAddedEvent =
640 typeof ProviderRuntimeThreadRealtimeItemAddedEvent.Type;640 typeof ProviderRuntimeThreadRealtimeItemAddedEvent.Type;
641641
642export const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({642const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({
643 ...ProviderRuntimeEventBase.fields,643 ...ProviderRuntimeEventBase.fields,
644 type: ThreadRealtimeAudioDeltaType,644 type: ThreadRealtimeAudioDeltaType,
645 payload: ThreadRealtimeAudioDeltaPayload,645 payload: ThreadRealtimeAudioDeltaPayload,
...@@ -647,7 +647,7 @@ export const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({...@@ -647,7 +647,7 @@ export const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({
647export type ProviderRuntimeThreadRealtimeAudioDeltaEvent =647export type ProviderRuntimeThreadRealtimeAudioDeltaEvent =
648 typeof ProviderRuntimeThreadRealtimeAudioDeltaEvent.Type;648 typeof ProviderRuntimeThreadRealtimeAudioDeltaEvent.Type;
649649
650export const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({650const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({
651 ...ProviderRuntimeEventBase.fields,651 ...ProviderRuntimeEventBase.fields,
652 type: ThreadRealtimeErrorType,652 type: ThreadRealtimeErrorType,
653 payload: ThreadRealtimeErrorPayload,653 payload: ThreadRealtimeErrorPayload,
...@@ -655,7 +655,7 @@ export const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({...@@ -655,7 +655,7 @@ export const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({
655export type ProviderRuntimeThreadRealtimeErrorEvent =655export type ProviderRuntimeThreadRealtimeErrorEvent =
656 typeof ProviderRuntimeThreadRealtimeErrorEvent.Type;656 typeof ProviderRuntimeThreadRealtimeErrorEvent.Type;
657657
658export const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({658const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({
659 ...ProviderRuntimeEventBase.fields,659 ...ProviderRuntimeEventBase.fields,
660 type: ThreadRealtimeClosedType,660 type: ThreadRealtimeClosedType,
661 payload: ThreadRealtimeClosedPayload,661 payload: ThreadRealtimeClosedPayload,
...@@ -663,35 +663,35 @@ export const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({...@@ -663,35 +663,35 @@ export const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({
663export type ProviderRuntimeThreadRealtimeClosedEvent =663export type ProviderRuntimeThreadRealtimeClosedEvent =
664 typeof ProviderRuntimeThreadRealtimeClosedEvent.Type;664 typeof ProviderRuntimeThreadRealtimeClosedEvent.Type;
665665
666export const ProviderRuntimeTurnStartedEvent = Schema.Struct({666const ProviderRuntimeTurnStartedEvent = Schema.Struct({
667 ...ProviderRuntimeEventBase.fields,667 ...ProviderRuntimeEventBase.fields,
668 type: TurnStartedType,668 type: TurnStartedType,
669 payload: TurnStartedPayload,669 payload: TurnStartedPayload,
670});670});
671export type ProviderRuntimeTurnStartedEvent = typeof ProviderRuntimeTurnStartedEvent.Type;671export type ProviderRuntimeTurnStartedEvent = typeof ProviderRuntimeTurnStartedEvent.Type;
672672
673export const ProviderRuntimeTurnCompletedEvent = Schema.Struct({673const ProviderRuntimeTurnCompletedEvent = Schema.Struct({
674 ...ProviderRuntimeEventBase.fields,674 ...ProviderRuntimeEventBase.fields,
675 type: TurnCompletedType,675 type: TurnCompletedType,
676 payload: TurnCompletedPayload,676 payload: TurnCompletedPayload,
677});677});
678export type ProviderRuntimeTurnCompletedEvent = typeof ProviderRuntimeTurnCompletedEvent.Type;678export type ProviderRuntimeTurnCompletedEvent = typeof ProviderRuntimeTurnCompletedEvent.Type;
679679
680export const ProviderRuntimeTurnAbortedEvent = Schema.Struct({680const ProviderRuntimeTurnAbortedEvent = Schema.Struct({
681 ...ProviderRuntimeEventBase.fields,681 ...ProviderRuntimeEventBase.fields,
682 type: TurnAbortedType,682 type: TurnAbortedType,
683 payload: TurnAbortedPayload,683 payload: TurnAbortedPayload,
684});684});
685export type ProviderRuntimeTurnAbortedEvent = typeof ProviderRuntimeTurnAbortedEvent.Type;685export type ProviderRuntimeTurnAbortedEvent = typeof ProviderRuntimeTurnAbortedEvent.Type;
686686
687export const ProviderRuntimeTurnPlanUpdatedEvent = Schema.Struct({687const ProviderRuntimeTurnPlanUpdatedEvent = Schema.Struct({
688 ...ProviderRuntimeEventBase.fields,688 ...ProviderRuntimeEventBase.fields,
689 type: TurnPlanUpdatedType,689 type: TurnPlanUpdatedType,
690 payload: TurnPlanUpdatedPayload,690 payload: TurnPlanUpdatedPayload,
691});691});
692export type ProviderRuntimeTurnPlanUpdatedEvent = typeof ProviderRuntimeTurnPlanUpdatedEvent.Type;692export type ProviderRuntimeTurnPlanUpdatedEvent = typeof ProviderRuntimeTurnPlanUpdatedEvent.Type;
693693
694export const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({694const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({
695 ...ProviderRuntimeEventBase.fields,695 ...ProviderRuntimeEventBase.fields,
696 type: TurnProposedDeltaType,696 type: TurnProposedDeltaType,
697 payload: TurnProposedDeltaPayload,697 payload: TurnProposedDeltaPayload,
...@@ -699,7 +699,7 @@ export const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({...@@ -699,7 +699,7 @@ export const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({
699export type ProviderRuntimeTurnProposedDeltaEvent =699export type ProviderRuntimeTurnProposedDeltaEvent =
700 typeof ProviderRuntimeTurnProposedDeltaEvent.Type;700 typeof ProviderRuntimeTurnProposedDeltaEvent.Type;
701701
702export const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({702const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({
703 ...ProviderRuntimeEventBase.fields,703 ...ProviderRuntimeEventBase.fields,
704 type: TurnProposedCompletedType,704 type: TurnProposedCompletedType,
705 payload: TurnProposedCompletedPayload,705 payload: TurnProposedCompletedPayload,
...@@ -707,56 +707,56 @@ export const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({...@@ -707,56 +707,56 @@ export const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({
707export type ProviderRuntimeTurnProposedCompletedEvent =707export type ProviderRuntimeTurnProposedCompletedEvent =
708 typeof ProviderRuntimeTurnProposedCompletedEvent.Type;708 typeof ProviderRuntimeTurnProposedCompletedEvent.Type;
709709
710export const ProviderRuntimeTurnDiffUpdatedEvent = Schema.Struct({710const ProviderRuntimeTurnDiffUpdatedEvent = Schema.Struct({
711 ...ProviderRuntimeEventBase.fields,711 ...ProviderRuntimeEventBase.fields,
712 type: TurnDiffUpdatedType,712 type: TurnDiffUpdatedType,
713 payload: TurnDiffUpdatedPayload,713 payload: TurnDiffUpdatedPayload,
714});714});
715export type ProviderRuntimeTurnDiffUpdatedEvent = typeof ProviderRuntimeTurnDiffUpdatedEvent.Type;715export type ProviderRuntimeTurnDiffUpdatedEvent = typeof ProviderRuntimeTurnDiffUpdatedEvent.Type;
716716
717export const ProviderRuntimeItemStartedEvent = Schema.Struct({717const ProviderRuntimeItemStartedEvent = Schema.Struct({
718 ...ProviderRuntimeEventBase.fields,718 ...ProviderRuntimeEventBase.fields,
719 type: ItemStartedType,719 type: ItemStartedType,
720 payload: ItemLifecyclePayload,720 payload: ItemLifecyclePayload,
721});721});
722export type ProviderRuntimeItemStartedEvent = typeof ProviderRuntimeItemStartedEvent.Type;722export type ProviderRuntimeItemStartedEvent = typeof ProviderRuntimeItemStartedEvent.Type;
723723
724export const ProviderRuntimeItemUpdatedEvent = Schema.Struct({724const ProviderRuntimeItemUpdatedEvent = Schema.Struct({
725 ...ProviderRuntimeEventBase.fields,725 ...ProviderRuntimeEventBase.fields,
726 type: ItemUpdatedType,726 type: ItemUpdatedType,
727 payload: ItemLifecyclePayload,727 payload: ItemLifecyclePayload,
728});728});
729export type ProviderRuntimeItemUpdatedEvent = typeof ProviderRuntimeItemUpdatedEvent.Type;729export type ProviderRuntimeItemUpdatedEvent = typeof ProviderRuntimeItemUpdatedEvent.Type;
730730
731export const ProviderRuntimeItemCompletedEvent = Schema.Struct({731const ProviderRuntimeItemCompletedEvent = Schema.Struct({
732 ...ProviderRuntimeEventBase.fields,732 ...ProviderRuntimeEventBase.fields,
733 type: ItemCompletedType,733 type: ItemCompletedType,
734 payload: ItemLifecyclePayload,734 payload: ItemLifecyclePayload,
735});735});
736export type ProviderRuntimeItemCompletedEvent = typeof ProviderRuntimeItemCompletedEvent.Type;736export type ProviderRuntimeItemCompletedEvent = typeof ProviderRuntimeItemCompletedEvent.Type;
737737
738export const ProviderRuntimeContentDeltaEvent = Schema.Struct({738const ProviderRuntimeContentDeltaEvent = Schema.Struct({
739 ...ProviderRuntimeEventBase.fields,739 ...ProviderRuntimeEventBase.fields,
740 type: ContentDeltaType,740 type: ContentDeltaType,
741 payload: ContentDeltaPayload,741 payload: ContentDeltaPayload,
742});742});
743export type ProviderRuntimeContentDeltaEvent = typeof ProviderRuntimeContentDeltaEvent.Type;743export type ProviderRuntimeContentDeltaEvent = typeof ProviderRuntimeContentDeltaEvent.Type;
744744
745export const ProviderRuntimeRequestOpenedEvent = Schema.Struct({745const ProviderRuntimeRequestOpenedEvent = Schema.Struct({
746 ...ProviderRuntimeEventBase.fields,746 ...ProviderRuntimeEventBase.fields,
747 type: RequestOpenedType,747 type: RequestOpenedType,
748 payload: RequestOpenedPayload,748 payload: RequestOpenedPayload,
749});749});
750export type ProviderRuntimeRequestOpenedEvent = typeof ProviderRuntimeRequestOpenedEvent.Type;750export type ProviderRuntimeRequestOpenedEvent = typeof ProviderRuntimeRequestOpenedEvent.Type;
751751
752export const ProviderRuntimeRequestResolvedEvent = Schema.Struct({752const ProviderRuntimeRequestResolvedEvent = Schema.Struct({
753 ...ProviderRuntimeEventBase.fields,753 ...ProviderRuntimeEventBase.fields,
754 type: RequestResolvedType,754 type: RequestResolvedType,
755 payload: RequestResolvedPayload,755 payload: RequestResolvedPayload,
756});756});
757export type ProviderRuntimeRequestResolvedEvent = typeof ProviderRuntimeRequestResolvedEvent.Type;757export type ProviderRuntimeRequestResolvedEvent = typeof ProviderRuntimeRequestResolvedEvent.Type;
758758
759export const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({759const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({
760 ...ProviderRuntimeEventBase.fields,760 ...ProviderRuntimeEventBase.fields,
761 type: UserInputRequestedType,761 type: UserInputRequestedType,
762 payload: UserInputRequestedPayload,762 payload: UserInputRequestedPayload,
...@@ -764,84 +764,84 @@ export const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({...@@ -764,84 +764,84 @@ export const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({
764export type ProviderRuntimeUserInputRequestedEvent =764export type ProviderRuntimeUserInputRequestedEvent =
765 typeof ProviderRuntimeUserInputRequestedEvent.Type;765 typeof ProviderRuntimeUserInputRequestedEvent.Type;
766766
767export const ProviderRuntimeUserInputResolvedEvent = Schema.Struct({767const ProviderRuntimeUserInputResolvedEvent = Schema.Struct({
768 ...ProviderRuntimeEventBase.fields,768 ...ProviderRuntimeEventBase.fields,
769 type: UserInputResolvedType,769 type: UserInputResolvedType,
770 payload: UserInputResolvedPayload,770 payload: UserInputResolvedPayload,
771});771});
772export type ProviderRuntimeUserInputResolvedEvent = typeof ProviderRuntimeUserInputResolvedEvent.Type;772export type ProviderRuntimeUserInputResolvedEvent = typeof ProviderRuntimeUserInputResolvedEvent.Type;
773773
774export const ProviderRuntimeTaskStartedEvent = Schema.Struct({774const ProviderRuntimeTaskStartedEvent = Schema.Struct({
775 ...ProviderRuntimeEventBase.fields,775 ...ProviderRuntimeEventBase.fields,
776 type: TaskStartedType,776 type: TaskStartedType,
777 payload: TaskStartedPayload,777 payload: TaskStartedPayload,
778});778});
779export type ProviderRuntimeTaskStartedEvent = typeof ProviderRuntimeTaskStartedEvent.Type;779export type ProviderRuntimeTaskStartedEvent = typeof ProviderRuntimeTaskStartedEvent.Type;
780780
781export const ProviderRuntimeTaskProgressEvent = Schema.Struct({781const ProviderRuntimeTaskProgressEvent = Schema.Struct({
782 ...ProviderRuntimeEventBase.fields,782 ...ProviderRuntimeEventBase.fields,
783 type: TaskProgressType,783 type: TaskProgressType,
784 payload: TaskProgressPayload,784 payload: TaskProgressPayload,
785});785});
786export type ProviderRuntimeTaskProgressEvent = typeof ProviderRuntimeTaskProgressEvent.Type;786export type ProviderRuntimeTaskProgressEvent = typeof ProviderRuntimeTaskProgressEvent.Type;
787787
788export const ProviderRuntimeTaskCompletedEvent = Schema.Struct({788const ProviderRuntimeTaskCompletedEvent = Schema.Struct({
789 ...ProviderRuntimeEventBase.fields,789 ...ProviderRuntimeEventBase.fields,
790 type: TaskCompletedType,790 type: TaskCompletedType,
791 payload: TaskCompletedPayload,791 payload: TaskCompletedPayload,
792});792});
793export type ProviderRuntimeTaskCompletedEvent = typeof ProviderRuntimeTaskCompletedEvent.Type;793export type ProviderRuntimeTaskCompletedEvent = typeof ProviderRuntimeTaskCompletedEvent.Type;
794794
795export const ProviderRuntimeHookStartedEvent = Schema.Struct({795const ProviderRuntimeHookStartedEvent = Schema.Struct({
796 ...ProviderRuntimeEventBase.fields,796 ...ProviderRuntimeEventBase.fields,
797 type: HookStartedType,797 type: HookStartedType,
798 payload: HookStartedPayload,798 payload: HookStartedPayload,
799});799});
800export type ProviderRuntimeHookStartedEvent = typeof ProviderRuntimeHookStartedEvent.Type;800export type ProviderRuntimeHookStartedEvent = typeof ProviderRuntimeHookStartedEvent.Type;
801801
802export const ProviderRuntimeHookProgressEvent = Schema.Struct({802const ProviderRuntimeHookProgressEvent = Schema.Struct({
803 ...ProviderRuntimeEventBase.fields,803 ...ProviderRuntimeEventBase.fields,
804 type: HookProgressType,804 type: HookProgressType,
805 payload: HookProgressPayload,805 payload: HookProgressPayload,
806});806});
807export type ProviderRuntimeHookProgressEvent = typeof ProviderRuntimeHookProgressEvent.Type;807export type ProviderRuntimeHookProgressEvent = typeof ProviderRuntimeHookProgressEvent.Type;
808808
809export const ProviderRuntimeHookCompletedEvent = Schema.Struct({809const ProviderRuntimeHookCompletedEvent = Schema.Struct({
810 ...ProviderRuntimeEventBase.fields,810 ...ProviderRuntimeEventBase.fields,
811 type: HookCompletedType,811 type: HookCompletedType,
812 payload: HookCompletedPayload,812 payload: HookCompletedPayload,
813});813});
814export type ProviderRuntimeHookCompletedEvent = typeof ProviderRuntimeHookCompletedEvent.Type;814export type ProviderRuntimeHookCompletedEvent = typeof ProviderRuntimeHookCompletedEvent.Type;
815815
816export const ProviderRuntimeToolProgressEvent = Schema.Struct({816const ProviderRuntimeToolProgressEvent = Schema.Struct({
817 ...ProviderRuntimeEventBase.fields,817 ...ProviderRuntimeEventBase.fields,
818 type: ToolProgressType,818 type: ToolProgressType,
819 payload: ToolProgressPayload,819 payload: ToolProgressPayload,
820});820});
821export type ProviderRuntimeToolProgressEvent = typeof ProviderRuntimeToolProgressEvent.Type;821export type ProviderRuntimeToolProgressEvent = typeof ProviderRuntimeToolProgressEvent.Type;
822822
823export const ProviderRuntimeToolSummaryEvent = Schema.Struct({823const ProviderRuntimeToolSummaryEvent = Schema.Struct({
824 ...ProviderRuntimeEventBase.fields,824 ...ProviderRuntimeEventBase.fields,
825 type: ToolSummaryType,825 type: ToolSummaryType,
826 payload: ToolSummaryPayload,826 payload: ToolSummaryPayload,
827});827});
828export type ProviderRuntimeToolSummaryEvent = typeof ProviderRuntimeToolSummaryEvent.Type;828export type ProviderRuntimeToolSummaryEvent = typeof ProviderRuntimeToolSummaryEvent.Type;
829829
830export const ProviderRuntimeAuthStatusEvent = Schema.Struct({830const ProviderRuntimeAuthStatusEvent = Schema.Struct({
831 ...ProviderRuntimeEventBase.fields,831 ...ProviderRuntimeEventBase.fields,
832 type: AuthStatusType,832 type: AuthStatusType,
833 payload: AuthStatusPayload,833 payload: AuthStatusPayload,
834});834});
835export type ProviderRuntimeAuthStatusEvent = typeof ProviderRuntimeAuthStatusEvent.Type;835export type ProviderRuntimeAuthStatusEvent = typeof ProviderRuntimeAuthStatusEvent.Type;
836836
837export const ProviderRuntimeAccountUpdatedEvent = Schema.Struct({837const ProviderRuntimeAccountUpdatedEvent = Schema.Struct({
838 ...ProviderRuntimeEventBase.fields,838 ...ProviderRuntimeEventBase.fields,
839 type: AccountUpdatedType,839 type: AccountUpdatedType,
840 payload: AccountUpdatedPayload,840 payload: AccountUpdatedPayload,
841});841});
842export type ProviderRuntimeAccountUpdatedEvent = typeof ProviderRuntimeAccountUpdatedEvent.Type;842export type ProviderRuntimeAccountUpdatedEvent = typeof ProviderRuntimeAccountUpdatedEvent.Type;
843843
844export const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({844const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({
845 ...ProviderRuntimeEventBase.fields,845 ...ProviderRuntimeEventBase.fields,
846 type: AccountRateLimitsUpdatedType,846 type: AccountRateLimitsUpdatedType,
847 payload: AccountRateLimitsUpdatedPayload,847 payload: AccountRateLimitsUpdatedPayload,
...@@ -849,56 +849,56 @@ export const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({...@@ -849,56 +849,56 @@ export const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({
849export type ProviderRuntimeAccountRateLimitsUpdatedEvent =849export type ProviderRuntimeAccountRateLimitsUpdatedEvent =
850 typeof ProviderRuntimeAccountRateLimitsUpdatedEvent.Type;850 typeof ProviderRuntimeAccountRateLimitsUpdatedEvent.Type;
851851
852export const ProviderRuntimeMcpStatusUpdatedEvent = Schema.Struct({852const ProviderRuntimeMcpStatusUpdatedEvent = Schema.Struct({
853 ...ProviderRuntimeEventBase.fields,853 ...ProviderRuntimeEventBase.fields,
854 type: McpStatusUpdatedType,854 type: McpStatusUpdatedType,
855 payload: McpStatusUpdatedPayload,855 payload: McpStatusUpdatedPayload,
856});856});
857export type ProviderRuntimeMcpStatusUpdatedEvent = typeof ProviderRuntimeMcpStatusUpdatedEvent.Type;857export type ProviderRuntimeMcpStatusUpdatedEvent = typeof ProviderRuntimeMcpStatusUpdatedEvent.Type;
858858
859export const ProviderRuntimeMcpOauthCompletedEvent = Schema.Struct({859const ProviderRuntimeMcpOauthCompletedEvent = Schema.Struct({
860 ...ProviderRuntimeEventBase.fields,860 ...ProviderRuntimeEventBase.fields,
861 type: McpOauthCompletedType,861 type: McpOauthCompletedType,
862 payload: McpOauthCompletedPayload,862 payload: McpOauthCompletedPayload,
863});863});
864export type ProviderRuntimeMcpOauthCompletedEvent = typeof ProviderRuntimeMcpOauthCompletedEvent.Type;864export type ProviderRuntimeMcpOauthCompletedEvent = typeof ProviderRuntimeMcpOauthCompletedEvent.Type;
865865
866export const ProviderRuntimeModelReroutedEvent = Schema.Struct({866const ProviderRuntimeModelReroutedEvent = Schema.Struct({
867 ...ProviderRuntimeEventBase.fields,867 ...ProviderRuntimeEventBase.fields,
868 type: ModelReroutedType,868 type: ModelReroutedType,
869 payload: ModelReroutedPayload,869 payload: ModelReroutedPayload,
870});870});
871export type ProviderRuntimeModelReroutedEvent = typeof ProviderRuntimeModelReroutedEvent.Type;871export type ProviderRuntimeModelReroutedEvent = typeof ProviderRuntimeModelReroutedEvent.Type;
872872
873export const ProviderRuntimeConfigWarningEvent = Schema.Struct({873const ProviderRuntimeConfigWarningEvent = Schema.Struct({
874 ...ProviderRuntimeEventBase.fields,874 ...ProviderRuntimeEventBase.fields,
875 type: ConfigWarningType,875 type: ConfigWarningType,
876 payload: ConfigWarningPayload,876 payload: ConfigWarningPayload,
877});877});
878export type ProviderRuntimeConfigWarningEvent = typeof ProviderRuntimeConfigWarningEvent.Type;878export type ProviderRuntimeConfigWarningEvent = typeof ProviderRuntimeConfigWarningEvent.Type;
879879
880export const ProviderRuntimeDeprecationNoticeEvent = Schema.Struct({880const ProviderRuntimeDeprecationNoticeEvent = Schema.Struct({
881 ...ProviderRuntimeEventBase.fields,881 ...ProviderRuntimeEventBase.fields,
882 type: DeprecationNoticeType,882 type: DeprecationNoticeType,
883 payload: DeprecationNoticePayload,883 payload: DeprecationNoticePayload,
884});884});
885export type ProviderRuntimeDeprecationNoticeEvent = typeof ProviderRuntimeDeprecationNoticeEvent.Type;885export type ProviderRuntimeDeprecationNoticeEvent = typeof ProviderRuntimeDeprecationNoticeEvent.Type;
886886
887export const ProviderRuntimeFilesPersistedEvent = Schema.Struct({887const ProviderRuntimeFilesPersistedEvent = Schema.Struct({
888 ...ProviderRuntimeEventBase.fields,888 ...ProviderRuntimeEventBase.fields,
889 type: FilesPersistedType,889 type: FilesPersistedType,
890 payload: FilesPersistedPayload,890 payload: FilesPersistedPayload,
891});891});
892export type ProviderRuntimeFilesPersistedEvent = typeof ProviderRuntimeFilesPersistedEvent.Type;892export type ProviderRuntimeFilesPersistedEvent = typeof ProviderRuntimeFilesPersistedEvent.Type;
893893
894export const ProviderRuntimeWarningEvent = Schema.Struct({894const ProviderRuntimeWarningEvent = Schema.Struct({
895 ...ProviderRuntimeEventBase.fields,895 ...ProviderRuntimeEventBase.fields,
896 type: RuntimeWarningType,896 type: RuntimeWarningType,
897 payload: RuntimeWarningPayload,897 payload: RuntimeWarningPayload,
898});898});
899export type ProviderRuntimeWarningEvent = typeof ProviderRuntimeWarningEvent.Type;899export type ProviderRuntimeWarningEvent = typeof ProviderRuntimeWarningEvent.Type;
900900
901export const ProviderRuntimeErrorEvent = Schema.Struct({901const ProviderRuntimeErrorEvent = Schema.Struct({
902 ...ProviderRuntimeEventBase.fields,902 ...ProviderRuntimeEventBase.fields,
903 type: RuntimeErrorType,903 type: RuntimeErrorType,
904 payload: RuntimeErrorPayload,904 payload: RuntimeErrorPayload,
...@@ -960,21 +960,21 @@ export const ProviderRuntimeEvent = ProviderRuntimeEventV2;...@@ -960,21 +960,21 @@ export const ProviderRuntimeEvent = ProviderRuntimeEventV2;
960export type ProviderRuntimeEvent = ProviderRuntimeEventV2;960export type ProviderRuntimeEvent = ProviderRuntimeEventV2;
961961
962// Compatibility aliases for call sites still importing legacy names.962// Compatibility aliases for call sites still importing legacy names.
963export const ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;963const ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;
964export type ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;964export type ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;
965export const ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;965const ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;
966export type ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;966export type ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;
967export const ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;967const ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;
968export type ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;968export type ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;
969export const ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;969const ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;
970export type ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;970export type ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;
971export const ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;971const ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;
972export type ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;972export type ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;
973export const ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;973const ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;
974export type ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;974export type ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;
975975
976// Legacy helper aliases retained for adapters/tests.976// Legacy helper aliases retained for adapters/tests.
977export const ProviderRuntimeToolKind = Schema.Literals([977const ProviderRuntimeToolKind = Schema.Literals([
978 "command",978 "command",
979 "file-read",979 "file-read",
980 "file-change",980 "file-change",
packages/contracts/src/server.ts+4-8
...@@ -4,18 +4,16 @@ import { KeybindingRule, ResolvedKeybindingsConfig } from "./keybindings";...@@ -4,18 +4,16 @@ import { KeybindingRule, ResolvedKeybindingsConfig } from "./keybindings";
4import { EditorId } from "./editor";4import { EditorId } from "./editor";
5import { ProviderKind } from "./orchestration";5import { ProviderKind } from "./orchestration";
66
7export const KeybindingsMalformedConfigIssue = Schema.Struct({7const KeybindingsMalformedConfigIssue = Schema.Struct({
8 kind: Schema.Literal("keybindings.malformed-config"),8 kind: Schema.Literal("keybindings.malformed-config"),
9 message: TrimmedNonEmptyString,9 message: TrimmedNonEmptyString,
10});10});
11export type KeybindingsMalformedConfigIssue = typeof KeybindingsMalformedConfigIssue.Type;
1211
13export const KeybindingsInvalidEntryIssue = Schema.Struct({12const KeybindingsInvalidEntryIssue = Schema.Struct({
14 kind: Schema.Literal("keybindings.invalid-entry"),13 kind: Schema.Literal("keybindings.invalid-entry"),
15 message: TrimmedNonEmptyString,14 message: TrimmedNonEmptyString,
16 index: Schema.Number,15 index: Schema.Number,
17});16});
18export type KeybindingsInvalidEntryIssue = typeof KeybindingsInvalidEntryIssue.Type;
1917
20export const ServerConfigIssue = Schema.Union([18export const ServerConfigIssue = Schema.Union([
21 KeybindingsMalformedConfigIssue,19 KeybindingsMalformedConfigIssue,
...@@ -23,8 +21,7 @@ export const ServerConfigIssue = Schema.Union([...@@ -23,8 +21,7 @@ export const ServerConfigIssue = Schema.Union([
23]);21]);
24export type ServerConfigIssue = typeof ServerConfigIssue.Type;22export type ServerConfigIssue = typeof ServerConfigIssue.Type;
2523
26export const ServerConfigIssues = Schema.Array(ServerConfigIssue);24const ServerConfigIssues = Schema.Array(ServerConfigIssue);
27export type ServerConfigIssues = typeof ServerConfigIssues.Type;
2825
29export const ServerProviderStatusState = Schema.Literals(["ready", "warning", "error"]);26export const ServerProviderStatusState = Schema.Literals(["ready", "warning", "error"]);
30export type ServerProviderStatusState = typeof ServerProviderStatusState.Type;27export type ServerProviderStatusState = typeof ServerProviderStatusState.Type;
...@@ -46,8 +43,7 @@ export const ServerProviderStatus = Schema.Struct({...@@ -46,8 +43,7 @@ export const ServerProviderStatus = Schema.Struct({
46});43});
47export type ServerProviderStatus = typeof ServerProviderStatus.Type;44export type ServerProviderStatus = typeof ServerProviderStatus.Type;
4845
49export const ServerProviderStatuses = Schema.Array(ServerProviderStatus);46const ServerProviderStatuses = Schema.Array(ServerProviderStatus);
50export type ServerProviderStatuses = typeof ServerProviderStatuses.Type;
5147
52export const ServerConfig = Schema.Struct({48export const ServerConfig = Schema.Struct({
53 cwd: TrimmedNonEmptyString,49 cwd: TrimmedNonEmptyString,
packages/contracts/src/terminal.ts+9-9
...@@ -23,12 +23,12 @@ const TerminalIdWithDefaultSchema = TerminalIdSchema.pipe(...@@ -23,12 +23,12 @@ const TerminalIdWithDefaultSchema = TerminalIdSchema.pipe(
23 Schema.withDecodingDefault(() => DEFAULT_TERMINAL_ID),23 Schema.withDecodingDefault(() => DEFAULT_TERMINAL_ID),
24);24);
2525
26export const TerminalThreadInput = Schema.Struct({26const TerminalThreadInput = Schema.Struct({
27 threadId: TrimmedNonEmptyStringSchema,27 threadId: TrimmedNonEmptyStringSchema,
28});28});
29export type TerminalThreadInput = Schema.Codec.Encoded<typeof TerminalThreadInput>;29export type TerminalThreadInput = Schema.Codec.Encoded<typeof TerminalThreadInput>;
3030
31export const TerminalSessionInput = Schema.Struct({31const TerminalSessionInput = Schema.Struct({
32 ...TerminalThreadInput.fields,32 ...TerminalThreadInput.fields,
33 terminalId: TerminalIdWithDefaultSchema,33 terminalId: TerminalIdWithDefaultSchema,
34});34});
...@@ -96,43 +96,43 @@ const TerminalEventBaseSchema = Schema.Struct({...@@ -96,43 +96,43 @@ const TerminalEventBaseSchema = Schema.Struct({
96 createdAt: Schema.String,96 createdAt: Schema.String,
97});97});
9898
99export const TerminalStartedEvent = Schema.Struct({99const TerminalStartedEvent = Schema.Struct({
100 ...TerminalEventBaseSchema.fields,100 ...TerminalEventBaseSchema.fields,
101 type: Schema.Literal("started"),101 type: Schema.Literal("started"),
102 snapshot: TerminalSessionSnapshot,102 snapshot: TerminalSessionSnapshot,
103});103});
104104
105export const TerminalOutputEvent = Schema.Struct({105const TerminalOutputEvent = Schema.Struct({
106 ...TerminalEventBaseSchema.fields,106 ...TerminalEventBaseSchema.fields,
107 type: Schema.Literal("output"),107 type: Schema.Literal("output"),
108 data: Schema.String,108 data: Schema.String,
109});109});
110110
111export const TerminalExitedEvent = Schema.Struct({111const TerminalExitedEvent = Schema.Struct({
112 ...TerminalEventBaseSchema.fields,112 ...TerminalEventBaseSchema.fields,
113 type: Schema.Literal("exited"),113 type: Schema.Literal("exited"),
114 exitCode: Schema.NullOr(Schema.Int),114 exitCode: Schema.NullOr(Schema.Int),
115 exitSignal: Schema.NullOr(Schema.Int),115 exitSignal: Schema.NullOr(Schema.Int),
116});116});
117117
118export const TerminalErrorEvent = Schema.Struct({118const TerminalErrorEvent = Schema.Struct({
119 ...TerminalEventBaseSchema.fields,119 ...TerminalEventBaseSchema.fields,
120 type: Schema.Literal("error"),120 type: Schema.Literal("error"),
121 message: Schema.String.check(Schema.isNonEmpty()),121 message: Schema.String.check(Schema.isNonEmpty()),
122});122});
123123
124export const TerminalClearedEvent = Schema.Struct({124const TerminalClearedEvent = Schema.Struct({
125 ...TerminalEventBaseSchema.fields,125 ...TerminalEventBaseSchema.fields,
126 type: Schema.Literal("cleared"),126 type: Schema.Literal("cleared"),
127});127});
128128
129export const TerminalRestartedEvent = Schema.Struct({129const TerminalRestartedEvent = Schema.Struct({
130 ...TerminalEventBaseSchema.fields,130 ...TerminalEventBaseSchema.fields,
131 type: Schema.Literal("restarted"),131 type: Schema.Literal("restarted"),
132 snapshot: TerminalSessionSnapshot,132 snapshot: TerminalSessionSnapshot,
133});133});
134134
135export const TerminalActivityEvent = Schema.Struct({135const TerminalActivityEvent = Schema.Struct({
136 ...TerminalEventBaseSchema.fields,136 ...TerminalEventBaseSchema.fields,
137 type: Schema.Literal("activity"),137 type: Schema.Literal("activity"),
138 hasRunningSubprocess: Schema.Boolean,138 hasRunningSubprocess: Schema.Boolean,
packages/contracts/src/ws.ts+1-1
...@@ -89,7 +89,7 @@ const tagRequestBody = <const Tag extends string, const Fields extends Schema.St...@@ -89,7 +89,7 @@ const tagRequestBody = <const Tag extends string, const Fields extends Schema.St
89 { unsafePreserveChecks: true },89 { unsafePreserveChecks: true },
90 );90 );
9191
92export const WebSocketRequestBody = Schema.Union([92const WebSocketRequestBody = Schema.Union([
93 // Orchestration methods93 // Orchestration methods
94 tagRequestBody(94 tagRequestBody(
95 ORCHESTRATION_WS_METHODS.dispatchCommand,95 ORCHESTRATION_WS_METHODS.dispatchCommand,