@devries-cameron20 / t3code Mirror · read-only / commits / e6575c4149
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 10:00 UTC

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

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