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;
77
88export const GitStackedAction = Schema.Literals(["commit", "commit_push", "commit_push_pr"]);
99export type GitStackedAction = typeof GitStackedAction.Type;
10export const GitCommitStepStatus = Schema.Literals(["created", "skipped_no_changes"]);
11export const GitPushStepStatus = Schema.Literals([
10const GitCommitStepStatus = Schema.Literals(["created", "skipped_no_changes"]);
11const GitPushStepStatus = Schema.Literals([
1212 "pushed",
1313 "skipped_not_requested",
1414 "skipped_up_to_date",
1515]);
16export const GitBranchStepStatus = Schema.Literals(["created", "skipped_not_requested"]);
17export const GitPrStepStatus = Schema.Literals([
16const GitBranchStepStatus = Schema.Literals(["created", "skipped_not_requested"]);
17const GitPrStepStatus = Schema.Literals([
1818 "created",
1919 "opened_existing",
2020 "skipped_not_requested",
2121]);
22export const GitStatusPrState = Schema.Literals(["open", "closed", "merged"]);
23export type GitStatusPrState = typeof GitStatusPrState.Type;
22const GitStatusPrState = Schema.Literals(["open", "closed", "merged"]);
2423
2524export const GitBranch = Schema.Struct({
2625 name: TrimmedNonEmptyStringSchema,
......@@ -32,11 +31,10 @@ export const GitBranch = Schema.Struct({
3231});
3332export type GitBranch = typeof GitBranch.Type;
3433
35export const GitWorktree = Schema.Struct({
34const GitWorktree = Schema.Struct({
3635 path: TrimmedNonEmptyStringSchema,
3736 branch: TrimmedNonEmptyStringSchema,
3837});
39export type GitWorktree = typeof GitWorktree.Type;
4038
4139// RPC Inputs
4240
......@@ -97,7 +95,7 @@ export type GitInitInput = typeof GitInitInput.Type;
9795
9896// RPC Results
9997
100export const GitStatusPr = Schema.Struct({
98const GitStatusPr = Schema.Struct({
10199 number: PositiveInt,
102100 title: TrimmedNonEmptyStringSchema,
103101 url: Schema.String,
......@@ -105,7 +103,6 @@ export const GitStatusPr = Schema.Struct({
105103 headBranch: TrimmedNonEmptyStringSchema,
106104 state: GitStatusPrState,
107105});
108export type GitStatusPr = typeof GitStatusPr.Type;
109106
110107export const GitStatusResult = Schema.Struct({
111108 branch: TrimmedNonEmptyStringSchema.pipe(Schema.NullOr),
packages/contracts/src/keybindings.ts+4-8
......@@ -1,15 +1,13 @@
11import { Schema } from "effect";
22import { TrimmedString } from "./baseSchemas";
33
4export const MAX_KEYBINDING_COMMAND_LENGTH = 96;
54export const MAX_KEYBINDING_VALUE_LENGTH = 64;
6export const MAX_KEYBINDING_WHEN_LENGTH = 256;
5const MAX_KEYBINDING_WHEN_LENGTH = 256;
76export const MAX_WHEN_EXPRESSION_DEPTH = 64;
87export const MAX_SCRIPT_ID_LENGTH = 24;
9export const MAX_SCRIPT_RUN_COMMAND_LENGTH = 96;
108export const MAX_KEYBINDINGS_COUNT = 256;
119
12export const STATIC_KEYBINDING_COMMANDS = [
10const STATIC_KEYBINDING_COMMANDS = [
1311 "terminal.toggle",
1412 "terminal.split",
1513 "terminal.new",
......@@ -35,17 +33,15 @@ export const KeybindingCommand = Schema.Union([
3533]);
3634export type KeybindingCommand = typeof KeybindingCommand.Type;
3735
38export const KeybindingValue = TrimmedString.check(
36const KeybindingValue = TrimmedString.check(
3937 Schema.isMinLength(1),
4038 Schema.isMaxLength(MAX_KEYBINDING_VALUE_LENGTH),
4139);
42export type KeybindingValue = typeof KeybindingValue.Type;
4340
44export const KeybindingWhen = TrimmedString.check(
41const KeybindingWhen = TrimmedString.check(
4542 Schema.isMinLength(1),
4643 Schema.isMaxLength(MAX_KEYBINDING_WHEN_LENGTH),
4744);
48export type KeybindingWhen = typeof KeybindingWhen.Type;
4945export const KeybindingRule = Schema.Struct({
5046 key: KeybindingValue,
5147 command: KeybindingCommand,
packages/contracts/src/orchestration.ts+36-36
......@@ -52,14 +52,14 @@ export type ProviderUserInputAnswers = typeof ProviderUserInputAnswers.Type;
5252export const PROVIDER_SEND_TURN_MAX_INPUT_CHARS = 120_000;
5353export const PROVIDER_SEND_TURN_MAX_ATTACHMENTS = 8;
5454export const PROVIDER_SEND_TURN_MAX_IMAGE_BYTES = 10 * 1024 * 1024;
55export const PROVIDER_SEND_TURN_MAX_IMAGE_DATA_URL_CHARS = 14_000_000;
56export const CHAT_ATTACHMENT_ID_MAX_CHARS = 128;
55const PROVIDER_SEND_TURN_MAX_IMAGE_DATA_URL_CHARS = 14_000_000;
56const CHAT_ATTACHMENT_ID_MAX_CHARS = 128;
5757
5858// Correlation id is command id by design in this model.
5959export const CorrelationId = CommandId;
6060export type CorrelationId = typeof CorrelationId.Type;
6161
62export const ChatAttachmentId = TrimmedNonEmptyString.check(
62const ChatAttachmentId = TrimmedNonEmptyString.check(
6363 Schema.isMaxLength(CHAT_ATTACHMENT_ID_MAX_CHARS),
6464 Schema.isPattern(/^[a-z0-9_-]+$/i),
6565);
......@@ -74,7 +74,7 @@ export const ChatImageAttachment = Schema.Struct({
7474});
7575export type ChatImageAttachment = typeof ChatImageAttachment.Type;
7676
77export const UploadChatImageAttachment = Schema.Struct({
77const UploadChatImageAttachment = Schema.Struct({
7878 type: Schema.Literal("image"),
7979 name: TrimmedNonEmptyString.check(Schema.isMaxLength(255)),
8080 mimeType: TrimmedNonEmptyString.check(Schema.isMaxLength(100), Schema.isPattern(/^image\//i)),
......@@ -87,7 +87,7 @@ export type UploadChatImageAttachment = typeof UploadChatImageAttachment.Type;
8787
8888export const ChatAttachment = Schema.Union([ChatImageAttachment]);
8989export type ChatAttachment = typeof ChatAttachment.Type;
90export const UploadChatAttachment = Schema.Union([UploadChatImageAttachment]);
90const UploadChatAttachment = Schema.Union([UploadChatImageAttachment]);
9191export type UploadChatAttachment = typeof UploadChatAttachment.Type;
9292
9393export const ProjectScriptIcon = Schema.Literals([
......@@ -212,7 +212,7 @@ export const OrchestrationThreadActivity = Schema.Struct({
212212});
213213export type OrchestrationThreadActivity = typeof OrchestrationThreadActivity.Type;
214214
215export const OrchestrationLatestTurnState = Schema.Literals([
215const OrchestrationLatestTurnState = Schema.Literals([
216216 "running",
217217 "interrupted",
218218 "completed",
......@@ -263,7 +263,7 @@ export const OrchestrationReadModel = Schema.Struct({
263263});
264264export type OrchestrationReadModel = typeof OrchestrationReadModel.Type;
265265
266export const ProjectCreateCommand = Schema.Struct({
266const ProjectCreateCommand = Schema.Struct({
267267 type: Schema.Literal("project.create"),
268268 commandId: CommandId,
269269 projectId: ProjectId,
......@@ -273,7 +273,7 @@ export const ProjectCreateCommand = Schema.Struct({
273273 createdAt: IsoDateTime,
274274});
275275
276export const ProjectMetaUpdateCommand = Schema.Struct({
276const ProjectMetaUpdateCommand = Schema.Struct({
277277 type: Schema.Literal("project.meta.update"),
278278 commandId: CommandId,
279279 projectId: ProjectId,
......@@ -283,13 +283,13 @@ export const ProjectMetaUpdateCommand = Schema.Struct({
283283 scripts: Schema.optional(Schema.Array(ProjectScript)),
284284});
285285
286export const ProjectDeleteCommand = Schema.Struct({
286const ProjectDeleteCommand = Schema.Struct({
287287 type: Schema.Literal("project.delete"),
288288 commandId: CommandId,
289289 projectId: ProjectId,
290290});
291291
292export const ThreadCreateCommand = Schema.Struct({
292const ThreadCreateCommand = Schema.Struct({
293293 type: Schema.Literal("thread.create"),
294294 commandId: CommandId,
295295 threadId: ThreadId,
......@@ -305,13 +305,13 @@ export const ThreadCreateCommand = Schema.Struct({
305305 createdAt: IsoDateTime,
306306});
307307
308export const ThreadDeleteCommand = Schema.Struct({
308const ThreadDeleteCommand = Schema.Struct({
309309 type: Schema.Literal("thread.delete"),
310310 commandId: CommandId,
311311 threadId: ThreadId,
312312});
313313
314export const ThreadMetaUpdateCommand = Schema.Struct({
314const ThreadMetaUpdateCommand = Schema.Struct({
315315 type: Schema.Literal("thread.meta.update"),
316316 commandId: CommandId,
317317 threadId: ThreadId,
......@@ -321,7 +321,7 @@ export const ThreadMetaUpdateCommand = Schema.Struct({
321321 worktreePath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
322322});
323323
324export const ThreadRuntimeModeSetCommand = Schema.Struct({
324const ThreadRuntimeModeSetCommand = Schema.Struct({
325325 type: Schema.Literal("thread.runtime-mode.set"),
326326 commandId: CommandId,
327327 threadId: ThreadId,
......@@ -329,7 +329,7 @@ export const ThreadRuntimeModeSetCommand = Schema.Struct({
329329 createdAt: IsoDateTime,
330330});
331331
332export const ThreadInteractionModeSetCommand = Schema.Struct({
332const ThreadInteractionModeSetCommand = Schema.Struct({
333333 type: Schema.Literal("thread.interaction-mode.set"),
334334 commandId: CommandId,
335335 threadId: ThreadId,
......@@ -337,7 +337,7 @@ export const ThreadInteractionModeSetCommand = Schema.Struct({
337337 createdAt: IsoDateTime,
338338});
339339
340export const ThreadTurnStartCommand = Schema.Struct({
340const ThreadTurnStartCommand = Schema.Struct({
341341 type: Schema.Literal("thread.turn.start"),
342342 commandId: CommandId,
343343 threadId: ThreadId,
......@@ -358,7 +358,7 @@ export const ThreadTurnStartCommand = Schema.Struct({
358358 createdAt: IsoDateTime,
359359});
360360
361export const ClientThreadTurnStartCommand = Schema.Struct({
361const ClientThreadTurnStartCommand = Schema.Struct({
362362 type: Schema.Literal("thread.turn.start"),
363363 commandId: CommandId,
364364 threadId: ThreadId,
......@@ -377,7 +377,7 @@ export const ClientThreadTurnStartCommand = Schema.Struct({
377377 createdAt: IsoDateTime,
378378});
379379
380export const ThreadTurnInterruptCommand = Schema.Struct({
380const ThreadTurnInterruptCommand = Schema.Struct({
381381 type: Schema.Literal("thread.turn.interrupt"),
382382 commandId: CommandId,
383383 threadId: ThreadId,
......@@ -385,7 +385,7 @@ export const ThreadTurnInterruptCommand = Schema.Struct({
385385 createdAt: IsoDateTime,
386386});
387387
388export const ThreadApprovalRespondCommand = Schema.Struct({
388const ThreadApprovalRespondCommand = Schema.Struct({
389389 type: Schema.Literal("thread.approval.respond"),
390390 commandId: CommandId,
391391 threadId: ThreadId,
......@@ -394,7 +394,7 @@ export const ThreadApprovalRespondCommand = Schema.Struct({
394394 createdAt: IsoDateTime,
395395});
396396
397export const ThreadUserInputRespondCommand = Schema.Struct({
397const ThreadUserInputRespondCommand = Schema.Struct({
398398 type: Schema.Literal("thread.user-input.respond"),
399399 commandId: CommandId,
400400 threadId: ThreadId,
......@@ -403,7 +403,7 @@ export const ThreadUserInputRespondCommand = Schema.Struct({
403403 createdAt: IsoDateTime,
404404});
405405
406export const ThreadCheckpointRevertCommand = Schema.Struct({
406const ThreadCheckpointRevertCommand = Schema.Struct({
407407 type: Schema.Literal("thread.checkpoint.revert"),
408408 commandId: CommandId,
409409 threadId: ThreadId,
......@@ -411,14 +411,14 @@ export const ThreadCheckpointRevertCommand = Schema.Struct({
411411 createdAt: IsoDateTime,
412412});
413413
414export const ThreadSessionStopCommand = Schema.Struct({
414const ThreadSessionStopCommand = Schema.Struct({
415415 type: Schema.Literal("thread.session.stop"),
416416 commandId: CommandId,
417417 threadId: ThreadId,
418418 createdAt: IsoDateTime,
419419});
420420
421export const DispatchableClientOrchestrationCommand = Schema.Union([
421const DispatchableClientOrchestrationCommand = Schema.Union([
422422 ProjectCreateCommand,
423423 ProjectMetaUpdateCommand,
424424 ProjectDeleteCommand,
......@@ -455,7 +455,7 @@ export const ClientOrchestrationCommand = Schema.Union([
455455]);
456456export type ClientOrchestrationCommand = typeof ClientOrchestrationCommand.Type;
457457
458export const ThreadSessionSetCommand = Schema.Struct({
458const ThreadSessionSetCommand = Schema.Struct({
459459 type: Schema.Literal("thread.session.set"),
460460 commandId: CommandId,
461461 threadId: ThreadId,
......@@ -463,7 +463,7 @@ export const ThreadSessionSetCommand = Schema.Struct({
463463 createdAt: IsoDateTime,
464464});
465465
466export const ThreadMessageAssistantDeltaCommand = Schema.Struct({
466const ThreadMessageAssistantDeltaCommand = Schema.Struct({
467467 type: Schema.Literal("thread.message.assistant.delta"),
468468 commandId: CommandId,
469469 threadId: ThreadId,
......@@ -473,7 +473,7 @@ export const ThreadMessageAssistantDeltaCommand = Schema.Struct({
473473 createdAt: IsoDateTime,
474474});
475475
476export const ThreadMessageAssistantCompleteCommand = Schema.Struct({
476const ThreadMessageAssistantCompleteCommand = Schema.Struct({
477477 type: Schema.Literal("thread.message.assistant.complete"),
478478 commandId: CommandId,
479479 threadId: ThreadId,
......@@ -482,7 +482,7 @@ export const ThreadMessageAssistantCompleteCommand = Schema.Struct({
482482 createdAt: IsoDateTime,
483483});
484484
485export const ThreadProposedPlanUpsertCommand = Schema.Struct({
485const ThreadProposedPlanUpsertCommand = Schema.Struct({
486486 type: Schema.Literal("thread.proposed-plan.upsert"),
487487 commandId: CommandId,
488488 threadId: ThreadId,
......@@ -490,7 +490,7 @@ export const ThreadProposedPlanUpsertCommand = Schema.Struct({
490490 createdAt: IsoDateTime,
491491});
492492
493export const ThreadTurnDiffCompleteCommand = Schema.Struct({
493const ThreadTurnDiffCompleteCommand = Schema.Struct({
494494 type: Schema.Literal("thread.turn.diff.complete"),
495495 commandId: CommandId,
496496 threadId: ThreadId,
......@@ -504,7 +504,7 @@ export const ThreadTurnDiffCompleteCommand = Schema.Struct({
504504 createdAt: IsoDateTime,
505505});
506506
507export const ThreadActivityAppendCommand = Schema.Struct({
507const ThreadActivityAppendCommand = Schema.Struct({
508508 type: Schema.Literal("thread.activity.append"),
509509 commandId: CommandId,
510510 threadId: ThreadId,
......@@ -512,7 +512,7 @@ export const ThreadActivityAppendCommand = Schema.Struct({
512512 createdAt: IsoDateTime,
513513});
514514
515export const ThreadRevertCompleteCommand = Schema.Struct({
515const ThreadRevertCompleteCommand = Schema.Struct({
516516 type: Schema.Literal("thread.revert.complete"),
517517 commandId: CommandId,
518518 threadId: ThreadId,
......@@ -520,7 +520,7 @@ export const ThreadRevertCompleteCommand = Schema.Struct({
520520 createdAt: IsoDateTime,
521521});
522522
523export const InternalOrchestrationCommand = Schema.Union([
523const InternalOrchestrationCommand = Schema.Union([
524524 ThreadSessionSetCommand,
525525 ThreadMessageAssistantDeltaCommand,
526526 ThreadMessageAssistantCompleteCommand,
......@@ -671,7 +671,7 @@ export const ThreadApprovalResponseRequestedPayload = Schema.Struct({
671671 createdAt: IsoDateTime,
672672});
673673
674export const ThreadUserInputResponseRequestedPayload = Schema.Struct({
674const ThreadUserInputResponseRequestedPayload = Schema.Struct({
675675 threadId: ThreadId,
676676 requestId: ApprovalRequestId,
677677 answers: ProviderUserInputAnswers,
......@@ -980,7 +980,7 @@ export const TurnCountRange = Schema.Struct({
980980 ),
981981);
982982
983export const ThreadTurnDiff = TurnCountRange.mapFields(
983const ThreadTurnDiff = TurnCountRange.mapFields(
984984 Struct.assign({
985985 threadId: ThreadId,
986986 diff: Schema.String,
......@@ -996,7 +996,7 @@ export const ProviderSessionRuntimeStatus = Schema.Literals([
996996]);
997997export type ProviderSessionRuntimeStatus = typeof ProviderSessionRuntimeStatus.Type;
998998
999export const ProjectionThreadTurnStatus = Schema.Literals([
999const ProjectionThreadTurnStatus = Schema.Literals([
10001000 "running",
10011001 "completed",
10021002 "interrupted",
......@@ -1004,7 +1004,7 @@ export const ProjectionThreadTurnStatus = Schema.Literals([
10041004]);
10051005export type ProjectionThreadTurnStatus = typeof ProjectionThreadTurnStatus.Type;
10061006
1007export const ProjectionCheckpointRow = Schema.Struct({
1007const ProjectionCheckpointRow = Schema.Struct({
10081008 threadId: ThreadId,
10091009 turnId: TurnId,
10101010 checkpointTurnCount: NonNegativeInt,
......@@ -1029,7 +1029,7 @@ export type DispatchResult = typeof DispatchResult.Type;
10291029
10301030export const OrchestrationGetSnapshotInput = Schema.Struct({});
10311031export type OrchestrationGetSnapshotInput = typeof OrchestrationGetSnapshotInput.Type;
1032export const OrchestrationGetSnapshotResult = OrchestrationReadModel;
1032const OrchestrationGetSnapshotResult = OrchestrationReadModel;
10331033export type OrchestrationGetSnapshotResult = typeof OrchestrationGetSnapshotResult.Type;
10341034
10351035export const OrchestrationGetTurnDiffInput = TurnCountRange.mapFields(
......@@ -1055,7 +1055,7 @@ export const OrchestrationReplayEventsInput = Schema.Struct({
10551055});
10561056export type OrchestrationReplayEventsInput = typeof OrchestrationReplayEventsInput.Type;
10571057
1058export const OrchestrationReplayEventsResult = Schema.Array(OrchestrationEvent);
1058const OrchestrationReplayEventsResult = Schema.Array(OrchestrationEvent);
10591059export type OrchestrationReplayEventsResult = typeof OrchestrationReplayEventsResult.Type;
10601060
10611061export const OrchestrationRpcSchemas = {
packages/contracts/src/project.ts+3-3
......@@ -1,8 +1,8 @@
11import { Schema } from "effect";
22import { PositiveInt, TrimmedNonEmptyString } from "./baseSchemas";
33
4export const PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;
5export const PROJECT_WRITE_FILE_PATH_MAX_LENGTH = 512;
4const PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;
5const PROJECT_WRITE_FILE_PATH_MAX_LENGTH = 512;
66
77export const ProjectSearchEntriesInput = Schema.Struct({
88 cwd: TrimmedNonEmptyString,
......@@ -11,7 +11,7 @@ export const ProjectSearchEntriesInput = Schema.Struct({
1111});
1212export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;
1313
14export const ProjectEntryKind = Schema.Literals(["file", "directory"]);
14const ProjectEntryKind = Schema.Literals(["file", "directory"]);
1515
1616export const ProjectEntry = Schema.Struct({
1717 path: TrimmedNonEmptyString,
packages/contracts/src/provider.ts+6-65
......@@ -19,19 +19,17 @@ import {
1919 ProviderRequestKind,
2020 ProviderUserInputAnswers,
2121 RuntimeMode,
22 TurnCountRange,
2322} from "./orchestration";
2423
2524const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;
2625
27export const ProviderSessionStatus = Schema.Literals([
26const ProviderSessionStatus = Schema.Literals([
2827 "connecting",
2928 "ready",
3029 "running",
3130 "error",
3231 "closed",
3332]);
34export type ProviderSessionStatus = typeof ProviderSessionStatus.Type;
3533
3634export const ProviderSession = Schema.Struct({
3735 provider: ProviderKind,
......@@ -48,30 +46,26 @@ export const ProviderSession = Schema.Struct({
4846});
4947export type ProviderSession = typeof ProviderSession.Type;
5048
51export const CodexProviderStartOptions = Schema.Struct({
49const CodexProviderStartOptions = Schema.Struct({
5250 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
5351 homePath: Schema.optional(TrimmedNonEmptyStringSchema),
5452});
55export type CodexProviderStartOptions = typeof CodexProviderStartOptions.Type;
5653
57export const ClaudeCodeProviderStartOptions = Schema.Struct({
54const ClaudeCodeProviderStartOptions = Schema.Struct({
5855 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
5956 permissionMode: Schema.optional(TrimmedNonEmptyStringSchema),
6057 maxThinkingTokens: Schema.optional(NonNegativeInt),
6158});
62export type ClaudeCodeProviderStartOptions = typeof ClaudeCodeProviderStartOptions.Type;
6359
64export const CursorProviderStartOptions = Schema.Struct({
60const CursorProviderStartOptions = Schema.Struct({
6561 binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
6662});
67export type CursorProviderStartOptions = typeof CursorProviderStartOptions.Type;
6863
69export const ProviderStartOptions = Schema.Struct({
64const ProviderStartOptions = Schema.Struct({
7065 codex: Schema.optional(CodexProviderStartOptions),
7166 claudeCode: Schema.optional(ClaudeCodeProviderStartOptions),
7267 cursor: Schema.optional(CursorProviderStartOptions),
7368});
74export type ProviderStartOptions = typeof ProviderStartOptions.Type;
7569
7670export const ProviderSessionStartInput = Schema.Struct({
7771 threadId: ThreadId,
......@@ -116,55 +110,6 @@ export const ProviderStopSessionInput = Schema.Struct({
116110});
117111export 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
168113export const ProviderRespondToRequestInput = Schema.Struct({
169114 threadId: ThreadId,
170115 requestId: ApprovalRequestId,
......@@ -179,8 +124,7 @@ export const ProviderRespondToUserInputInput = Schema.Struct({
179124});
180125export type ProviderRespondToUserInputInput = typeof ProviderRespondToUserInputInput.Type;
181126
182export const ProviderEventKind = Schema.Literals(["session", "notification", "request", "error"]);
183export type ProviderEventKind = typeof ProviderEventKind.Type;
127const ProviderEventKind = Schema.Literals(["session", "notification", "request", "error"]);
184128
185129export const ProviderEvent = Schema.Struct({
186130 id: EventId,
......@@ -198,6 +142,3 @@ export const ProviderEvent = Schema.Struct({
198142 payload: Schema.optional(Schema.Unknown),
199143});
200144export 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";
1515const TrimmedNonEmptyStringSchema = TrimmedNonEmptyString;
1616const UnknownRecordSchema = Schema.Record(Schema.String, Schema.Unknown);
1717
18export const RuntimeEventRawSource = Schema.Literals([
18const RuntimeEventRawSource = Schema.Literals([
1919 "codex.app-server.notification",
2020 "codex.app-server.request",
2121 "codex.eventmsg",
......@@ -36,17 +36,17 @@ export const RuntimeEventRaw = Schema.Struct({
3636});
3737export type RuntimeEventRaw = typeof RuntimeEventRaw.Type;
3838
39export const ProviderRequestId = TrimmedNonEmptyStringSchema;
39const ProviderRequestId = TrimmedNonEmptyStringSchema;
4040export type ProviderRequestId = typeof ProviderRequestId.Type;
4141
42export const ProviderRefs = Schema.Struct({
42const ProviderRefs = Schema.Struct({
4343 providerTurnId: Schema.optional(TrimmedNonEmptyStringSchema),
4444 providerItemId: Schema.optional(ProviderItemId),
4545 providerRequestId: Schema.optional(ProviderRequestId),
4646});
4747export type ProviderRefs = typeof ProviderRefs.Type;
4848
49export const RuntimeSessionState = Schema.Literals([
49const RuntimeSessionState = Schema.Literals([
5050 "starting",
5151 "ready",
5252 "running",
......@@ -56,7 +56,7 @@ export const RuntimeSessionState = Schema.Literals([
5656]);
5757export type RuntimeSessionState = typeof RuntimeSessionState.Type;
5858
59export const RuntimeThreadState = Schema.Literals([
59const RuntimeThreadState = Schema.Literals([
6060 "active",
6161 "idle",
6262 "archived",
......@@ -66,7 +66,7 @@ export const RuntimeThreadState = Schema.Literals([
6666]);
6767export type RuntimeThreadState = typeof RuntimeThreadState.Type;
6868
69export const RuntimeTurnState = Schema.Literals([
69const RuntimeTurnState = Schema.Literals([
7070 "completed",
7171 "failed",
7272 "interrupted",
......@@ -74,13 +74,13 @@ export const RuntimeTurnState = Schema.Literals([
7474]);
7575export type RuntimeTurnState = typeof RuntimeTurnState.Type;
7676
77export const RuntimePlanStepStatus = Schema.Literals(["pending", "inProgress", "completed"]);
77const RuntimePlanStepStatus = Schema.Literals(["pending", "inProgress", "completed"]);
7878export type RuntimePlanStepStatus = typeof RuntimePlanStepStatus.Type;
7979
80export const RuntimeItemStatus = Schema.Literals(["inProgress", "completed", "failed", "declined"]);
80const RuntimeItemStatus = Schema.Literals(["inProgress", "completed", "failed", "declined"]);
8181export type RuntimeItemStatus = typeof RuntimeItemStatus.Type;
8282
83export const RuntimeContentStreamKind = Schema.Literals([
83const RuntimeContentStreamKind = Schema.Literals([
8484 "assistant_text",
8585 "reasoning_text",
8686 "reasoning_summary_text",
......@@ -91,10 +91,10 @@ export const RuntimeContentStreamKind = Schema.Literals([
9191]);
9292export type RuntimeContentStreamKind = typeof RuntimeContentStreamKind.Type;
9393
94export const RuntimeSessionExitKind = Schema.Literals(["graceful", "error"]);
94const RuntimeSessionExitKind = Schema.Literals(["graceful", "error"]);
9595export type RuntimeSessionExitKind = typeof RuntimeSessionExitKind.Type;
9696
97export const RuntimeErrorClass = Schema.Literals([
97const RuntimeErrorClass = Schema.Literals([
9898 "provider_error",
9999 "transport_error",
100100 "permission_error",
......@@ -136,7 +136,7 @@ export const CanonicalRequestType = Schema.Literals([
136136]);
137137export type CanonicalRequestType = typeof CanonicalRequestType.Type;
138138
139export const ProviderRuntimeEventType = Schema.Literals([
139const ProviderRuntimeEventType = Schema.Literals([
140140 "session.started",
141141 "session.configured",
142142 "session.state.changed",
......@@ -187,55 +187,55 @@ export const ProviderRuntimeEventType = Schema.Literals([
187187]);
188188export type ProviderRuntimeEventType = typeof ProviderRuntimeEventType.Type;
189189
190export const SessionStartedType = Schema.Literal("session.started");
191export const SessionConfiguredType = Schema.Literal("session.configured");
192export const SessionStateChangedType = Schema.Literal("session.state.changed");
193export const SessionExitedType = Schema.Literal("session.exited");
194export const ThreadStartedType = Schema.Literal("thread.started");
195export const ThreadStateChangedType = Schema.Literal("thread.state.changed");
196export const ThreadMetadataUpdatedType = Schema.Literal("thread.metadata.updated");
197export const ThreadTokenUsageUpdatedType = Schema.Literal("thread.token-usage.updated");
198export const ThreadRealtimeStartedType = Schema.Literal("thread.realtime.started");
199export const ThreadRealtimeItemAddedType = Schema.Literal("thread.realtime.item-added");
200export const ThreadRealtimeAudioDeltaType = Schema.Literal("thread.realtime.audio.delta");
201export const ThreadRealtimeErrorType = Schema.Literal("thread.realtime.error");
202export const ThreadRealtimeClosedType = Schema.Literal("thread.realtime.closed");
203export const TurnStartedType = Schema.Literal("turn.started");
204export const TurnCompletedType = Schema.Literal("turn.completed");
205export const TurnAbortedType = Schema.Literal("turn.aborted");
206export const TurnPlanUpdatedType = Schema.Literal("turn.plan.updated");
207export const TurnProposedDeltaType = Schema.Literal("turn.proposed.delta");
208export const TurnProposedCompletedType = Schema.Literal("turn.proposed.completed");
209export const TurnDiffUpdatedType = Schema.Literal("turn.diff.updated");
210export const ItemStartedType = Schema.Literal("item.started");
211export const ItemUpdatedType = Schema.Literal("item.updated");
212export const ItemCompletedType = Schema.Literal("item.completed");
213export const ContentDeltaType = Schema.Literal("content.delta");
214export const RequestOpenedType = Schema.Literal("request.opened");
215export const RequestResolvedType = Schema.Literal("request.resolved");
216export const UserInputRequestedType = Schema.Literal("user-input.requested");
217export const UserInputResolvedType = Schema.Literal("user-input.resolved");
218export const TaskStartedType = Schema.Literal("task.started");
219export const TaskProgressType = Schema.Literal("task.progress");
220export const TaskCompletedType = Schema.Literal("task.completed");
221export const HookStartedType = Schema.Literal("hook.started");
222export const HookProgressType = Schema.Literal("hook.progress");
223export const HookCompletedType = Schema.Literal("hook.completed");
224export const ToolProgressType = Schema.Literal("tool.progress");
225export const ToolSummaryType = Schema.Literal("tool.summary");
226export const AuthStatusType = Schema.Literal("auth.status");
227export const AccountUpdatedType = Schema.Literal("account.updated");
228export const AccountRateLimitsUpdatedType = Schema.Literal("account.rate-limits.updated");
229export const McpStatusUpdatedType = Schema.Literal("mcp.status.updated");
230export const McpOauthCompletedType = Schema.Literal("mcp.oauth.completed");
231export const ModelReroutedType = Schema.Literal("model.rerouted");
232export const ConfigWarningType = Schema.Literal("config.warning");
233export const DeprecationNoticeType = Schema.Literal("deprecation.notice");
234export const FilesPersistedType = Schema.Literal("files.persisted");
235export const RuntimeWarningType = Schema.Literal("runtime.warning");
236export const RuntimeErrorType = Schema.Literal("runtime.error");
237
238export const ProviderRuntimeEventBase = Schema.Struct({
190const SessionStartedType = Schema.Literal("session.started");
191const SessionConfiguredType = Schema.Literal("session.configured");
192const SessionStateChangedType = Schema.Literal("session.state.changed");
193const SessionExitedType = Schema.Literal("session.exited");
194const ThreadStartedType = Schema.Literal("thread.started");
195const ThreadStateChangedType = Schema.Literal("thread.state.changed");
196const ThreadMetadataUpdatedType = Schema.Literal("thread.metadata.updated");
197const ThreadTokenUsageUpdatedType = Schema.Literal("thread.token-usage.updated");
198const ThreadRealtimeStartedType = Schema.Literal("thread.realtime.started");
199const ThreadRealtimeItemAddedType = Schema.Literal("thread.realtime.item-added");
200const ThreadRealtimeAudioDeltaType = Schema.Literal("thread.realtime.audio.delta");
201const ThreadRealtimeErrorType = Schema.Literal("thread.realtime.error");
202const ThreadRealtimeClosedType = Schema.Literal("thread.realtime.closed");
203const TurnStartedType = Schema.Literal("turn.started");
204const TurnCompletedType = Schema.Literal("turn.completed");
205const TurnAbortedType = Schema.Literal("turn.aborted");
206const TurnPlanUpdatedType = Schema.Literal("turn.plan.updated");
207const TurnProposedDeltaType = Schema.Literal("turn.proposed.delta");
208const TurnProposedCompletedType = Schema.Literal("turn.proposed.completed");
209const TurnDiffUpdatedType = Schema.Literal("turn.diff.updated");
210const ItemStartedType = Schema.Literal("item.started");
211const ItemUpdatedType = Schema.Literal("item.updated");
212const ItemCompletedType = Schema.Literal("item.completed");
213const ContentDeltaType = Schema.Literal("content.delta");
214const RequestOpenedType = Schema.Literal("request.opened");
215const RequestResolvedType = Schema.Literal("request.resolved");
216const UserInputRequestedType = Schema.Literal("user-input.requested");
217const UserInputResolvedType = Schema.Literal("user-input.resolved");
218const TaskStartedType = Schema.Literal("task.started");
219const TaskProgressType = Schema.Literal("task.progress");
220const TaskCompletedType = Schema.Literal("task.completed");
221const HookStartedType = Schema.Literal("hook.started");
222const HookProgressType = Schema.Literal("hook.progress");
223const HookCompletedType = Schema.Literal("hook.completed");
224const ToolProgressType = Schema.Literal("tool.progress");
225const ToolSummaryType = Schema.Literal("tool.summary");
226const AuthStatusType = Schema.Literal("auth.status");
227const AccountUpdatedType = Schema.Literal("account.updated");
228const AccountRateLimitsUpdatedType = Schema.Literal("account.rate-limits.updated");
229const McpStatusUpdatedType = Schema.Literal("mcp.status.updated");
230const McpOauthCompletedType = Schema.Literal("mcp.oauth.completed");
231const ModelReroutedType = Schema.Literal("model.rerouted");
232const ConfigWarningType = Schema.Literal("config.warning");
233const DeprecationNoticeType = Schema.Literal("deprecation.notice");
234const FilesPersistedType = Schema.Literal("files.persisted");
235const RuntimeWarningType = Schema.Literal("runtime.warning");
236const RuntimeErrorType = Schema.Literal("runtime.error");
237
238const ProviderRuntimeEventBase = Schema.Struct({
239239 eventId: EventId,
240240 provider: ProviderKind,
241241 threadId: ThreadId,
......@@ -248,85 +248,85 @@ export const ProviderRuntimeEventBase = Schema.Struct({
248248});
249249export type ProviderRuntimeEventBase = typeof ProviderRuntimeEventBase.Type;
250250
251export const SessionStartedPayload = Schema.Struct({
251const SessionStartedPayload = Schema.Struct({
252252 message: Schema.optional(TrimmedNonEmptyStringSchema),
253253 resume: Schema.optional(Schema.Unknown),
254254});
255255export type SessionStartedPayload = typeof SessionStartedPayload.Type;
256256
257export const SessionConfiguredPayload = Schema.Struct({
257const SessionConfiguredPayload = Schema.Struct({
258258 config: UnknownRecordSchema,
259259});
260260export type SessionConfiguredPayload = typeof SessionConfiguredPayload.Type;
261261
262export const SessionStateChangedPayload = Schema.Struct({
262const SessionStateChangedPayload = Schema.Struct({
263263 state: RuntimeSessionState,
264264 reason: Schema.optional(TrimmedNonEmptyStringSchema),
265265 detail: Schema.optional(Schema.Unknown),
266266});
267267export type SessionStateChangedPayload = typeof SessionStateChangedPayload.Type;
268268
269export const SessionExitedPayload = Schema.Struct({
269const SessionExitedPayload = Schema.Struct({
270270 reason: Schema.optional(TrimmedNonEmptyStringSchema),
271271 recoverable: Schema.optional(Schema.Boolean),
272272 exitKind: Schema.optional(RuntimeSessionExitKind),
273273});
274274export type SessionExitedPayload = typeof SessionExitedPayload.Type;
275275
276export const ThreadStartedPayload = Schema.Struct({
276const ThreadStartedPayload = Schema.Struct({
277277 providerThreadId: Schema.optional(TrimmedNonEmptyStringSchema),
278278});
279279export type ThreadStartedPayload = typeof ThreadStartedPayload.Type;
280280
281export const ThreadStateChangedPayload = Schema.Struct({
281const ThreadStateChangedPayload = Schema.Struct({
282282 state: RuntimeThreadState,
283283 detail: Schema.optional(Schema.Unknown),
284284});
285285export type ThreadStateChangedPayload = typeof ThreadStateChangedPayload.Type;
286286
287export const ThreadMetadataUpdatedPayload = Schema.Struct({
287const ThreadMetadataUpdatedPayload = Schema.Struct({
288288 name: Schema.optional(TrimmedNonEmptyStringSchema),
289289 metadata: Schema.optional(UnknownRecordSchema),
290290});
291291export type ThreadMetadataUpdatedPayload = typeof ThreadMetadataUpdatedPayload.Type;
292292
293export const ThreadTokenUsageUpdatedPayload = Schema.Struct({
293const ThreadTokenUsageUpdatedPayload = Schema.Struct({
294294 usage: Schema.Unknown,
295295});
296296export type ThreadTokenUsageUpdatedPayload = typeof ThreadTokenUsageUpdatedPayload.Type;
297297
298export const ThreadRealtimeStartedPayload = Schema.Struct({
298const ThreadRealtimeStartedPayload = Schema.Struct({
299299 realtimeSessionId: Schema.optional(TrimmedNonEmptyStringSchema),
300300});
301301export type ThreadRealtimeStartedPayload = typeof ThreadRealtimeStartedPayload.Type;
302302
303export const ThreadRealtimeItemAddedPayload = Schema.Struct({
303const ThreadRealtimeItemAddedPayload = Schema.Struct({
304304 item: Schema.Unknown,
305305});
306306export type ThreadRealtimeItemAddedPayload = typeof ThreadRealtimeItemAddedPayload.Type;
307307
308export const ThreadRealtimeAudioDeltaPayload = Schema.Struct({
308const ThreadRealtimeAudioDeltaPayload = Schema.Struct({
309309 audio: Schema.Unknown,
310310});
311311export type ThreadRealtimeAudioDeltaPayload = typeof ThreadRealtimeAudioDeltaPayload.Type;
312312
313export const ThreadRealtimeErrorPayload = Schema.Struct({
313const ThreadRealtimeErrorPayload = Schema.Struct({
314314 message: TrimmedNonEmptyStringSchema,
315315});
316316export type ThreadRealtimeErrorPayload = typeof ThreadRealtimeErrorPayload.Type;
317317
318export const ThreadRealtimeClosedPayload = Schema.Struct({
318const ThreadRealtimeClosedPayload = Schema.Struct({
319319 reason: Schema.optional(TrimmedNonEmptyStringSchema),
320320});
321321export type ThreadRealtimeClosedPayload = typeof ThreadRealtimeClosedPayload.Type;
322322
323export const TurnStartedPayload = Schema.Struct({
323const TurnStartedPayload = Schema.Struct({
324324 model: Schema.optional(TrimmedNonEmptyStringSchema),
325325 effort: Schema.optional(TrimmedNonEmptyStringSchema),
326326});
327327export type TurnStartedPayload = typeof TurnStartedPayload.Type;
328328
329export const TurnCompletedPayload = Schema.Struct({
329const TurnCompletedPayload = Schema.Struct({
330330 state: RuntimeTurnState,
331331 stopReason: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),
332332 usage: Schema.optional(Schema.Unknown),
......@@ -336,34 +336,34 @@ export const TurnCompletedPayload = Schema.Struct({
336336});
337337export type TurnCompletedPayload = typeof TurnCompletedPayload.Type;
338338
339export const TurnAbortedPayload = Schema.Struct({
339const TurnAbortedPayload = Schema.Struct({
340340 reason: TrimmedNonEmptyStringSchema,
341341});
342342export type TurnAbortedPayload = typeof TurnAbortedPayload.Type;
343343
344export const RuntimePlanStep = Schema.Struct({
344const RuntimePlanStep = Schema.Struct({
345345 step: TrimmedNonEmptyStringSchema,
346346 status: RuntimePlanStepStatus,
347347});
348348export type RuntimePlanStep = typeof RuntimePlanStep.Type;
349349
350export const TurnPlanUpdatedPayload = Schema.Struct({
350const TurnPlanUpdatedPayload = Schema.Struct({
351351 explanation: Schema.optional(Schema.NullOr(TrimmedNonEmptyStringSchema)),
352352 plan: Schema.Array(RuntimePlanStep),
353353});
354354export type TurnPlanUpdatedPayload = typeof TurnPlanUpdatedPayload.Type;
355355
356export const TurnProposedDeltaPayload = Schema.Struct({
356const TurnProposedDeltaPayload = Schema.Struct({
357357 delta: Schema.String,
358358});
359359export type TurnProposedDeltaPayload = typeof TurnProposedDeltaPayload.Type;
360360
361export const TurnProposedCompletedPayload = Schema.Struct({
361const TurnProposedCompletedPayload = Schema.Struct({
362362 planMarkdown: TrimmedNonEmptyStringSchema,
363363});
364364export type TurnProposedCompletedPayload = typeof TurnProposedCompletedPayload.Type;
365365
366export const TurnDiffUpdatedPayload = Schema.Struct({
366const TurnDiffUpdatedPayload = Schema.Struct({
367367 unifiedDiff: Schema.String,
368368});
369369export type TurnDiffUpdatedPayload = typeof TurnDiffUpdatedPayload.Type;
......@@ -377,7 +377,7 @@ export const ItemLifecyclePayload = Schema.Struct({
377377});
378378export type ItemLifecyclePayload = typeof ItemLifecyclePayload.Type;
379379
380export const ContentDeltaPayload = Schema.Struct({
380const ContentDeltaPayload = Schema.Struct({
381381 streamKind: RuntimeContentStreamKind,
382382 delta: Schema.String,
383383 contentIndex: Schema.optional(Schema.Int),
......@@ -385,21 +385,21 @@ export const ContentDeltaPayload = Schema.Struct({
385385});
386386export type ContentDeltaPayload = typeof ContentDeltaPayload.Type;
387387
388export const RequestOpenedPayload = Schema.Struct({
388const RequestOpenedPayload = Schema.Struct({
389389 requestType: CanonicalRequestType,
390390 detail: Schema.optional(TrimmedNonEmptyStringSchema),
391391 args: Schema.optional(Schema.Unknown),
392392});
393393export type RequestOpenedPayload = typeof RequestOpenedPayload.Type;
394394
395export const RequestResolvedPayload = Schema.Struct({
395const RequestResolvedPayload = Schema.Struct({
396396 requestType: CanonicalRequestType,
397397 decision: Schema.optional(TrimmedNonEmptyStringSchema),
398398 resolution: Schema.optional(Schema.Unknown),
399399});
400400export type RequestResolvedPayload = typeof RequestResolvedPayload.Type;
401401
402export const UserInputQuestionOption = Schema.Struct({
402const UserInputQuestionOption = Schema.Struct({
403403 label: TrimmedNonEmptyStringSchema,
404404 description: TrimmedNonEmptyStringSchema,
405405});
......@@ -413,24 +413,24 @@ export const UserInputQuestion = Schema.Struct({
413413});
414414export type UserInputQuestion = typeof UserInputQuestion.Type;
415415
416export const UserInputRequestedPayload = Schema.Struct({
416const UserInputRequestedPayload = Schema.Struct({
417417 questions: Schema.Array(UserInputQuestion),
418418});
419419export type UserInputRequestedPayload = typeof UserInputRequestedPayload.Type;
420420
421export const UserInputResolvedPayload = Schema.Struct({
421const UserInputResolvedPayload = Schema.Struct({
422422 answers: UnknownRecordSchema,
423423});
424424export type UserInputResolvedPayload = typeof UserInputResolvedPayload.Type;
425425
426export const TaskStartedPayload = Schema.Struct({
426const TaskStartedPayload = Schema.Struct({
427427 taskId: RuntimeTaskId,
428428 description: Schema.optional(TrimmedNonEmptyStringSchema),
429429 taskType: Schema.optional(TrimmedNonEmptyStringSchema),
430430});
431431export type TaskStartedPayload = typeof TaskStartedPayload.Type;
432432
433export const TaskProgressPayload = Schema.Struct({
433const TaskProgressPayload = Schema.Struct({
434434 taskId: RuntimeTaskId,
435435 description: TrimmedNonEmptyStringSchema,
436436 usage: Schema.optional(Schema.Unknown),
......@@ -438,7 +438,7 @@ export const TaskProgressPayload = Schema.Struct({
438438});
439439export type TaskProgressPayload = typeof TaskProgressPayload.Type;
440440
441export const TaskCompletedPayload = Schema.Struct({
441const TaskCompletedPayload = Schema.Struct({
442442 taskId: RuntimeTaskId,
443443 status: Schema.Literals(["completed", "failed", "stopped"]),
444444 summary: Schema.optional(TrimmedNonEmptyStringSchema),
......@@ -446,14 +446,14 @@ export const TaskCompletedPayload = Schema.Struct({
446446});
447447export type TaskCompletedPayload = typeof TaskCompletedPayload.Type;
448448
449export const HookStartedPayload = Schema.Struct({
449const HookStartedPayload = Schema.Struct({
450450 hookId: TrimmedNonEmptyStringSchema,
451451 hookName: TrimmedNonEmptyStringSchema,
452452 hookEvent: TrimmedNonEmptyStringSchema,
453453});
454454export type HookStartedPayload = typeof HookStartedPayload.Type;
455455
456export const HookProgressPayload = Schema.Struct({
456const HookProgressPayload = Schema.Struct({
457457 hookId: TrimmedNonEmptyStringSchema,
458458 output: Schema.optional(Schema.String),
459459 stdout: Schema.optional(Schema.String),
......@@ -461,7 +461,7 @@ export const HookProgressPayload = Schema.Struct({
461461});
462462export type HookProgressPayload = typeof HookProgressPayload.Type;
463463
464export const HookCompletedPayload = Schema.Struct({
464const HookCompletedPayload = Schema.Struct({
465465 hookId: TrimmedNonEmptyStringSchema,
466466 outcome: Schema.Literals(["success", "error", "cancelled"]),
467467 output: Schema.optional(Schema.String),
......@@ -471,7 +471,7 @@ export const HookCompletedPayload = Schema.Struct({
471471});
472472export type HookCompletedPayload = typeof HookCompletedPayload.Type;
473473
474export const ToolProgressPayload = Schema.Struct({
474const ToolProgressPayload = Schema.Struct({
475475 toolUseId: Schema.optional(TrimmedNonEmptyStringSchema),
476476 toolName: Schema.optional(TrimmedNonEmptyStringSchema),
477477 summary: Schema.optional(TrimmedNonEmptyStringSchema),
......@@ -479,49 +479,49 @@ export const ToolProgressPayload = Schema.Struct({
479479});
480480export type ToolProgressPayload = typeof ToolProgressPayload.Type;
481481
482export const ToolSummaryPayload = Schema.Struct({
482const ToolSummaryPayload = Schema.Struct({
483483 summary: TrimmedNonEmptyStringSchema,
484484 precedingToolUseIds: Schema.optional(Schema.Array(TrimmedNonEmptyStringSchema)),
485485});
486486export type ToolSummaryPayload = typeof ToolSummaryPayload.Type;
487487
488export const AuthStatusPayload = Schema.Struct({
488const AuthStatusPayload = Schema.Struct({
489489 isAuthenticating: Schema.optional(Schema.Boolean),
490490 output: Schema.optional(Schema.Array(Schema.String)),
491491 error: Schema.optional(TrimmedNonEmptyStringSchema),
492492});
493493export type AuthStatusPayload = typeof AuthStatusPayload.Type;
494494
495export const AccountUpdatedPayload = Schema.Struct({
495const AccountUpdatedPayload = Schema.Struct({
496496 account: Schema.Unknown,
497497});
498498export type AccountUpdatedPayload = typeof AccountUpdatedPayload.Type;
499499
500export const AccountRateLimitsUpdatedPayload = Schema.Struct({
500const AccountRateLimitsUpdatedPayload = Schema.Struct({
501501 rateLimits: Schema.Unknown,
502502});
503503export type AccountRateLimitsUpdatedPayload = typeof AccountRateLimitsUpdatedPayload.Type;
504504
505export const McpStatusUpdatedPayload = Schema.Struct({
505const McpStatusUpdatedPayload = Schema.Struct({
506506 status: Schema.Unknown,
507507});
508508export type McpStatusUpdatedPayload = typeof McpStatusUpdatedPayload.Type;
509509
510export const McpOauthCompletedPayload = Schema.Struct({
510const McpOauthCompletedPayload = Schema.Struct({
511511 success: Schema.Boolean,
512512 name: Schema.optional(TrimmedNonEmptyStringSchema),
513513 error: Schema.optional(TrimmedNonEmptyStringSchema),
514514});
515515export type McpOauthCompletedPayload = typeof McpOauthCompletedPayload.Type;
516516
517export const ModelReroutedPayload = Schema.Struct({
517const ModelReroutedPayload = Schema.Struct({
518518 fromModel: TrimmedNonEmptyStringSchema,
519519 toModel: TrimmedNonEmptyStringSchema,
520520 reason: TrimmedNonEmptyStringSchema,
521521});
522522export type ModelReroutedPayload = typeof ModelReroutedPayload.Type;
523523
524export const ConfigWarningPayload = Schema.Struct({
524const ConfigWarningPayload = Schema.Struct({
525525 summary: TrimmedNonEmptyStringSchema,
526526 details: Schema.optional(TrimmedNonEmptyStringSchema),
527527 path: Schema.optional(TrimmedNonEmptyStringSchema),
......@@ -529,13 +529,13 @@ export const ConfigWarningPayload = Schema.Struct({
529529});
530530export type ConfigWarningPayload = typeof ConfigWarningPayload.Type;
531531
532export const DeprecationNoticePayload = Schema.Struct({
532const DeprecationNoticePayload = Schema.Struct({
533533 summary: TrimmedNonEmptyStringSchema,
534534 details: Schema.optional(TrimmedNonEmptyStringSchema),
535535});
536536export type DeprecationNoticePayload = typeof DeprecationNoticePayload.Type;
537537
538export const FilesPersistedPayload = Schema.Struct({
538const FilesPersistedPayload = Schema.Struct({
539539 files: Schema.Array(
540540 Schema.Struct({
541541 filename: TrimmedNonEmptyStringSchema,
......@@ -553,69 +553,69 @@ export const FilesPersistedPayload = Schema.Struct({
553553});
554554export type FilesPersistedPayload = typeof FilesPersistedPayload.Type;
555555
556export const RuntimeWarningPayload = Schema.Struct({
556const RuntimeWarningPayload = Schema.Struct({
557557 message: TrimmedNonEmptyStringSchema,
558558 detail: Schema.optional(Schema.Unknown),
559559});
560560export type RuntimeWarningPayload = typeof RuntimeWarningPayload.Type;
561561
562export const RuntimeErrorPayload = Schema.Struct({
562const RuntimeErrorPayload = Schema.Struct({
563563 message: TrimmedNonEmptyStringSchema,
564564 class: Schema.optional(RuntimeErrorClass),
565565 detail: Schema.optional(Schema.Unknown),
566566});
567567export type RuntimeErrorPayload = typeof RuntimeErrorPayload.Type;
568568
569export const ProviderRuntimeSessionStartedEvent = Schema.Struct({
569const ProviderRuntimeSessionStartedEvent = Schema.Struct({
570570 ...ProviderRuntimeEventBase.fields,
571571 type: SessionStartedType,
572572 payload: SessionStartedPayload,
573573});
574574export type ProviderRuntimeSessionStartedEvent = typeof ProviderRuntimeSessionStartedEvent.Type;
575575
576export const ProviderRuntimeSessionConfiguredEvent = Schema.Struct({
576const ProviderRuntimeSessionConfiguredEvent = Schema.Struct({
577577 ...ProviderRuntimeEventBase.fields,
578578 type: SessionConfiguredType,
579579 payload: SessionConfiguredPayload,
580580});
581581export type ProviderRuntimeSessionConfiguredEvent = typeof ProviderRuntimeSessionConfiguredEvent.Type;
582582
583export const ProviderRuntimeSessionStateChangedEvent = Schema.Struct({
583const ProviderRuntimeSessionStateChangedEvent = Schema.Struct({
584584 ...ProviderRuntimeEventBase.fields,
585585 type: SessionStateChangedType,
586586 payload: SessionStateChangedPayload,
587587});
588588export type ProviderRuntimeSessionStateChangedEvent = typeof ProviderRuntimeSessionStateChangedEvent.Type;
589589
590export const ProviderRuntimeSessionExitedEvent = Schema.Struct({
590const ProviderRuntimeSessionExitedEvent = Schema.Struct({
591591 ...ProviderRuntimeEventBase.fields,
592592 type: SessionExitedType,
593593 payload: SessionExitedPayload,
594594});
595595export type ProviderRuntimeSessionExitedEvent = typeof ProviderRuntimeSessionExitedEvent.Type;
596596
597export const ProviderRuntimeThreadStartedEvent = Schema.Struct({
597const ProviderRuntimeThreadStartedEvent = Schema.Struct({
598598 ...ProviderRuntimeEventBase.fields,
599599 type: ThreadStartedType,
600600 payload: ThreadStartedPayload,
601601});
602602export type ProviderRuntimeThreadStartedEvent = typeof ProviderRuntimeThreadStartedEvent.Type;
603603
604export const ProviderRuntimeThreadStateChangedEvent = Schema.Struct({
604const ProviderRuntimeThreadStateChangedEvent = Schema.Struct({
605605 ...ProviderRuntimeEventBase.fields,
606606 type: ThreadStateChangedType,
607607 payload: ThreadStateChangedPayload,
608608});
609609export type ProviderRuntimeThreadStateChangedEvent = typeof ProviderRuntimeThreadStateChangedEvent.Type;
610610
611export const ProviderRuntimeThreadMetadataUpdatedEvent = Schema.Struct({
611const ProviderRuntimeThreadMetadataUpdatedEvent = Schema.Struct({
612612 ...ProviderRuntimeEventBase.fields,
613613 type: ThreadMetadataUpdatedType,
614614 payload: ThreadMetadataUpdatedPayload,
615615});
616616export type ProviderRuntimeThreadMetadataUpdatedEvent = typeof ProviderRuntimeThreadMetadataUpdatedEvent.Type;
617617
618export const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({
618const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({
619619 ...ProviderRuntimeEventBase.fields,
620620 type: ThreadTokenUsageUpdatedType,
621621 payload: ThreadTokenUsageUpdatedPayload,
......@@ -623,7 +623,7 @@ export const ProviderRuntimeThreadTokenUsageUpdatedEvent = Schema.Struct({
623623export type ProviderRuntimeThreadTokenUsageUpdatedEvent =
624624 typeof ProviderRuntimeThreadTokenUsageUpdatedEvent.Type;
625625
626export const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({
626const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({
627627 ...ProviderRuntimeEventBase.fields,
628628 type: ThreadRealtimeStartedType,
629629 payload: ThreadRealtimeStartedPayload,
......@@ -631,7 +631,7 @@ export const ProviderRuntimeThreadRealtimeStartedEvent = Schema.Struct({
631631export type ProviderRuntimeThreadRealtimeStartedEvent =
632632 typeof ProviderRuntimeThreadRealtimeStartedEvent.Type;
633633
634export const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({
634const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({
635635 ...ProviderRuntimeEventBase.fields,
636636 type: ThreadRealtimeItemAddedType,
637637 payload: ThreadRealtimeItemAddedPayload,
......@@ -639,7 +639,7 @@ export const ProviderRuntimeThreadRealtimeItemAddedEvent = Schema.Struct({
639639export type ProviderRuntimeThreadRealtimeItemAddedEvent =
640640 typeof ProviderRuntimeThreadRealtimeItemAddedEvent.Type;
641641
642export const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({
642const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({
643643 ...ProviderRuntimeEventBase.fields,
644644 type: ThreadRealtimeAudioDeltaType,
645645 payload: ThreadRealtimeAudioDeltaPayload,
......@@ -647,7 +647,7 @@ export const ProviderRuntimeThreadRealtimeAudioDeltaEvent = Schema.Struct({
647647export type ProviderRuntimeThreadRealtimeAudioDeltaEvent =
648648 typeof ProviderRuntimeThreadRealtimeAudioDeltaEvent.Type;
649649
650export const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({
650const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({
651651 ...ProviderRuntimeEventBase.fields,
652652 type: ThreadRealtimeErrorType,
653653 payload: ThreadRealtimeErrorPayload,
......@@ -655,7 +655,7 @@ export const ProviderRuntimeThreadRealtimeErrorEvent = Schema.Struct({
655655export type ProviderRuntimeThreadRealtimeErrorEvent =
656656 typeof ProviderRuntimeThreadRealtimeErrorEvent.Type;
657657
658export const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({
658const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({
659659 ...ProviderRuntimeEventBase.fields,
660660 type: ThreadRealtimeClosedType,
661661 payload: ThreadRealtimeClosedPayload,
......@@ -663,35 +663,35 @@ export const ProviderRuntimeThreadRealtimeClosedEvent = Schema.Struct({
663663export type ProviderRuntimeThreadRealtimeClosedEvent =
664664 typeof ProviderRuntimeThreadRealtimeClosedEvent.Type;
665665
666export const ProviderRuntimeTurnStartedEvent = Schema.Struct({
666const ProviderRuntimeTurnStartedEvent = Schema.Struct({
667667 ...ProviderRuntimeEventBase.fields,
668668 type: TurnStartedType,
669669 payload: TurnStartedPayload,
670670});
671671export type ProviderRuntimeTurnStartedEvent = typeof ProviderRuntimeTurnStartedEvent.Type;
672672
673export const ProviderRuntimeTurnCompletedEvent = Schema.Struct({
673const ProviderRuntimeTurnCompletedEvent = Schema.Struct({
674674 ...ProviderRuntimeEventBase.fields,
675675 type: TurnCompletedType,
676676 payload: TurnCompletedPayload,
677677});
678678export type ProviderRuntimeTurnCompletedEvent = typeof ProviderRuntimeTurnCompletedEvent.Type;
679679
680export const ProviderRuntimeTurnAbortedEvent = Schema.Struct({
680const ProviderRuntimeTurnAbortedEvent = Schema.Struct({
681681 ...ProviderRuntimeEventBase.fields,
682682 type: TurnAbortedType,
683683 payload: TurnAbortedPayload,
684684});
685685export type ProviderRuntimeTurnAbortedEvent = typeof ProviderRuntimeTurnAbortedEvent.Type;
686686
687export const ProviderRuntimeTurnPlanUpdatedEvent = Schema.Struct({
687const ProviderRuntimeTurnPlanUpdatedEvent = Schema.Struct({
688688 ...ProviderRuntimeEventBase.fields,
689689 type: TurnPlanUpdatedType,
690690 payload: TurnPlanUpdatedPayload,
691691});
692692export type ProviderRuntimeTurnPlanUpdatedEvent = typeof ProviderRuntimeTurnPlanUpdatedEvent.Type;
693693
694export const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({
694const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({
695695 ...ProviderRuntimeEventBase.fields,
696696 type: TurnProposedDeltaType,
697697 payload: TurnProposedDeltaPayload,
......@@ -699,7 +699,7 @@ export const ProviderRuntimeTurnProposedDeltaEvent = Schema.Struct({
699699export type ProviderRuntimeTurnProposedDeltaEvent =
700700 typeof ProviderRuntimeTurnProposedDeltaEvent.Type;
701701
702export const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({
702const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({
703703 ...ProviderRuntimeEventBase.fields,
704704 type: TurnProposedCompletedType,
705705 payload: TurnProposedCompletedPayload,
......@@ -707,56 +707,56 @@ export const ProviderRuntimeTurnProposedCompletedEvent = Schema.Struct({
707707export type ProviderRuntimeTurnProposedCompletedEvent =
708708 typeof ProviderRuntimeTurnProposedCompletedEvent.Type;
709709
710export const ProviderRuntimeTurnDiffUpdatedEvent = Schema.Struct({
710const ProviderRuntimeTurnDiffUpdatedEvent = Schema.Struct({
711711 ...ProviderRuntimeEventBase.fields,
712712 type: TurnDiffUpdatedType,
713713 payload: TurnDiffUpdatedPayload,
714714});
715715export type ProviderRuntimeTurnDiffUpdatedEvent = typeof ProviderRuntimeTurnDiffUpdatedEvent.Type;
716716
717export const ProviderRuntimeItemStartedEvent = Schema.Struct({
717const ProviderRuntimeItemStartedEvent = Schema.Struct({
718718 ...ProviderRuntimeEventBase.fields,
719719 type: ItemStartedType,
720720 payload: ItemLifecyclePayload,
721721});
722722export type ProviderRuntimeItemStartedEvent = typeof ProviderRuntimeItemStartedEvent.Type;
723723
724export const ProviderRuntimeItemUpdatedEvent = Schema.Struct({
724const ProviderRuntimeItemUpdatedEvent = Schema.Struct({
725725 ...ProviderRuntimeEventBase.fields,
726726 type: ItemUpdatedType,
727727 payload: ItemLifecyclePayload,
728728});
729729export type ProviderRuntimeItemUpdatedEvent = typeof ProviderRuntimeItemUpdatedEvent.Type;
730730
731export const ProviderRuntimeItemCompletedEvent = Schema.Struct({
731const ProviderRuntimeItemCompletedEvent = Schema.Struct({
732732 ...ProviderRuntimeEventBase.fields,
733733 type: ItemCompletedType,
734734 payload: ItemLifecyclePayload,
735735});
736736export type ProviderRuntimeItemCompletedEvent = typeof ProviderRuntimeItemCompletedEvent.Type;
737737
738export const ProviderRuntimeContentDeltaEvent = Schema.Struct({
738const ProviderRuntimeContentDeltaEvent = Schema.Struct({
739739 ...ProviderRuntimeEventBase.fields,
740740 type: ContentDeltaType,
741741 payload: ContentDeltaPayload,
742742});
743743export type ProviderRuntimeContentDeltaEvent = typeof ProviderRuntimeContentDeltaEvent.Type;
744744
745export const ProviderRuntimeRequestOpenedEvent = Schema.Struct({
745const ProviderRuntimeRequestOpenedEvent = Schema.Struct({
746746 ...ProviderRuntimeEventBase.fields,
747747 type: RequestOpenedType,
748748 payload: RequestOpenedPayload,
749749});
750750export type ProviderRuntimeRequestOpenedEvent = typeof ProviderRuntimeRequestOpenedEvent.Type;
751751
752export const ProviderRuntimeRequestResolvedEvent = Schema.Struct({
752const ProviderRuntimeRequestResolvedEvent = Schema.Struct({
753753 ...ProviderRuntimeEventBase.fields,
754754 type: RequestResolvedType,
755755 payload: RequestResolvedPayload,
756756});
757757export type ProviderRuntimeRequestResolvedEvent = typeof ProviderRuntimeRequestResolvedEvent.Type;
758758
759export const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({
759const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({
760760 ...ProviderRuntimeEventBase.fields,
761761 type: UserInputRequestedType,
762762 payload: UserInputRequestedPayload,
......@@ -764,84 +764,84 @@ export const ProviderRuntimeUserInputRequestedEvent = Schema.Struct({
764764export type ProviderRuntimeUserInputRequestedEvent =
765765 typeof ProviderRuntimeUserInputRequestedEvent.Type;
766766
767export const ProviderRuntimeUserInputResolvedEvent = Schema.Struct({
767const ProviderRuntimeUserInputResolvedEvent = Schema.Struct({
768768 ...ProviderRuntimeEventBase.fields,
769769 type: UserInputResolvedType,
770770 payload: UserInputResolvedPayload,
771771});
772772export type ProviderRuntimeUserInputResolvedEvent = typeof ProviderRuntimeUserInputResolvedEvent.Type;
773773
774export const ProviderRuntimeTaskStartedEvent = Schema.Struct({
774const ProviderRuntimeTaskStartedEvent = Schema.Struct({
775775 ...ProviderRuntimeEventBase.fields,
776776 type: TaskStartedType,
777777 payload: TaskStartedPayload,
778778});
779779export type ProviderRuntimeTaskStartedEvent = typeof ProviderRuntimeTaskStartedEvent.Type;
780780
781export const ProviderRuntimeTaskProgressEvent = Schema.Struct({
781const ProviderRuntimeTaskProgressEvent = Schema.Struct({
782782 ...ProviderRuntimeEventBase.fields,
783783 type: TaskProgressType,
784784 payload: TaskProgressPayload,
785785});
786786export type ProviderRuntimeTaskProgressEvent = typeof ProviderRuntimeTaskProgressEvent.Type;
787787
788export const ProviderRuntimeTaskCompletedEvent = Schema.Struct({
788const ProviderRuntimeTaskCompletedEvent = Schema.Struct({
789789 ...ProviderRuntimeEventBase.fields,
790790 type: TaskCompletedType,
791791 payload: TaskCompletedPayload,
792792});
793793export type ProviderRuntimeTaskCompletedEvent = typeof ProviderRuntimeTaskCompletedEvent.Type;
794794
795export const ProviderRuntimeHookStartedEvent = Schema.Struct({
795const ProviderRuntimeHookStartedEvent = Schema.Struct({
796796 ...ProviderRuntimeEventBase.fields,
797797 type: HookStartedType,
798798 payload: HookStartedPayload,
799799});
800800export type ProviderRuntimeHookStartedEvent = typeof ProviderRuntimeHookStartedEvent.Type;
801801
802export const ProviderRuntimeHookProgressEvent = Schema.Struct({
802const ProviderRuntimeHookProgressEvent = Schema.Struct({
803803 ...ProviderRuntimeEventBase.fields,
804804 type: HookProgressType,
805805 payload: HookProgressPayload,
806806});
807807export type ProviderRuntimeHookProgressEvent = typeof ProviderRuntimeHookProgressEvent.Type;
808808
809export const ProviderRuntimeHookCompletedEvent = Schema.Struct({
809const ProviderRuntimeHookCompletedEvent = Schema.Struct({
810810 ...ProviderRuntimeEventBase.fields,
811811 type: HookCompletedType,
812812 payload: HookCompletedPayload,
813813});
814814export type ProviderRuntimeHookCompletedEvent = typeof ProviderRuntimeHookCompletedEvent.Type;
815815
816export const ProviderRuntimeToolProgressEvent = Schema.Struct({
816const ProviderRuntimeToolProgressEvent = Schema.Struct({
817817 ...ProviderRuntimeEventBase.fields,
818818 type: ToolProgressType,
819819 payload: ToolProgressPayload,
820820});
821821export type ProviderRuntimeToolProgressEvent = typeof ProviderRuntimeToolProgressEvent.Type;
822822
823export const ProviderRuntimeToolSummaryEvent = Schema.Struct({
823const ProviderRuntimeToolSummaryEvent = Schema.Struct({
824824 ...ProviderRuntimeEventBase.fields,
825825 type: ToolSummaryType,
826826 payload: ToolSummaryPayload,
827827});
828828export type ProviderRuntimeToolSummaryEvent = typeof ProviderRuntimeToolSummaryEvent.Type;
829829
830export const ProviderRuntimeAuthStatusEvent = Schema.Struct({
830const ProviderRuntimeAuthStatusEvent = Schema.Struct({
831831 ...ProviderRuntimeEventBase.fields,
832832 type: AuthStatusType,
833833 payload: AuthStatusPayload,
834834});
835835export type ProviderRuntimeAuthStatusEvent = typeof ProviderRuntimeAuthStatusEvent.Type;
836836
837export const ProviderRuntimeAccountUpdatedEvent = Schema.Struct({
837const ProviderRuntimeAccountUpdatedEvent = Schema.Struct({
838838 ...ProviderRuntimeEventBase.fields,
839839 type: AccountUpdatedType,
840840 payload: AccountUpdatedPayload,
841841});
842842export type ProviderRuntimeAccountUpdatedEvent = typeof ProviderRuntimeAccountUpdatedEvent.Type;
843843
844export const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({
844const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({
845845 ...ProviderRuntimeEventBase.fields,
846846 type: AccountRateLimitsUpdatedType,
847847 payload: AccountRateLimitsUpdatedPayload,
......@@ -849,56 +849,56 @@ export const ProviderRuntimeAccountRateLimitsUpdatedEvent = Schema.Struct({
849849export type ProviderRuntimeAccountRateLimitsUpdatedEvent =
850850 typeof ProviderRuntimeAccountRateLimitsUpdatedEvent.Type;
851851
852export const ProviderRuntimeMcpStatusUpdatedEvent = Schema.Struct({
852const ProviderRuntimeMcpStatusUpdatedEvent = Schema.Struct({
853853 ...ProviderRuntimeEventBase.fields,
854854 type: McpStatusUpdatedType,
855855 payload: McpStatusUpdatedPayload,
856856});
857857export type ProviderRuntimeMcpStatusUpdatedEvent = typeof ProviderRuntimeMcpStatusUpdatedEvent.Type;
858858
859export const ProviderRuntimeMcpOauthCompletedEvent = Schema.Struct({
859const ProviderRuntimeMcpOauthCompletedEvent = Schema.Struct({
860860 ...ProviderRuntimeEventBase.fields,
861861 type: McpOauthCompletedType,
862862 payload: McpOauthCompletedPayload,
863863});
864864export type ProviderRuntimeMcpOauthCompletedEvent = typeof ProviderRuntimeMcpOauthCompletedEvent.Type;
865865
866export const ProviderRuntimeModelReroutedEvent = Schema.Struct({
866const ProviderRuntimeModelReroutedEvent = Schema.Struct({
867867 ...ProviderRuntimeEventBase.fields,
868868 type: ModelReroutedType,
869869 payload: ModelReroutedPayload,
870870});
871871export type ProviderRuntimeModelReroutedEvent = typeof ProviderRuntimeModelReroutedEvent.Type;
872872
873export const ProviderRuntimeConfigWarningEvent = Schema.Struct({
873const ProviderRuntimeConfigWarningEvent = Schema.Struct({
874874 ...ProviderRuntimeEventBase.fields,
875875 type: ConfigWarningType,
876876 payload: ConfigWarningPayload,
877877});
878878export type ProviderRuntimeConfigWarningEvent = typeof ProviderRuntimeConfigWarningEvent.Type;
879879
880export const ProviderRuntimeDeprecationNoticeEvent = Schema.Struct({
880const ProviderRuntimeDeprecationNoticeEvent = Schema.Struct({
881881 ...ProviderRuntimeEventBase.fields,
882882 type: DeprecationNoticeType,
883883 payload: DeprecationNoticePayload,
884884});
885885export type ProviderRuntimeDeprecationNoticeEvent = typeof ProviderRuntimeDeprecationNoticeEvent.Type;
886886
887export const ProviderRuntimeFilesPersistedEvent = Schema.Struct({
887const ProviderRuntimeFilesPersistedEvent = Schema.Struct({
888888 ...ProviderRuntimeEventBase.fields,
889889 type: FilesPersistedType,
890890 payload: FilesPersistedPayload,
891891});
892892export type ProviderRuntimeFilesPersistedEvent = typeof ProviderRuntimeFilesPersistedEvent.Type;
893893
894export const ProviderRuntimeWarningEvent = Schema.Struct({
894const ProviderRuntimeWarningEvent = Schema.Struct({
895895 ...ProviderRuntimeEventBase.fields,
896896 type: RuntimeWarningType,
897897 payload: RuntimeWarningPayload,
898898});
899899export type ProviderRuntimeWarningEvent = typeof ProviderRuntimeWarningEvent.Type;
900900
901export const ProviderRuntimeErrorEvent = Schema.Struct({
901const ProviderRuntimeErrorEvent = Schema.Struct({
902902 ...ProviderRuntimeEventBase.fields,
903903 type: RuntimeErrorType,
904904 payload: RuntimeErrorPayload,
......@@ -960,21 +960,21 @@ export const ProviderRuntimeEvent = ProviderRuntimeEventV2;
960960export type ProviderRuntimeEvent = ProviderRuntimeEventV2;
961961
962962// Compatibility aliases for call sites still importing legacy names.
963export const ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;
963const ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;
964964export type ProviderRuntimeMessageDeltaEvent = ProviderRuntimeContentDeltaEvent;
965export const ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;
965const ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;
966966export type ProviderRuntimeMessageCompletedEvent = ProviderRuntimeItemCompletedEvent;
967export const ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;
967const ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;
968968export type ProviderRuntimeToolStartedEvent = ProviderRuntimeItemStartedEvent;
969export const ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;
969const ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;
970970export type ProviderRuntimeToolCompletedEvent = ProviderRuntimeItemCompletedEvent;
971export const ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;
971const ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;
972972export type ProviderRuntimeApprovalRequestedEvent = ProviderRuntimeRequestOpenedEvent;
973export const ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;
973const ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;
974974export type ProviderRuntimeApprovalResolvedEvent = ProviderRuntimeRequestResolvedEvent;
975975
976976// Legacy helper aliases retained for adapters/tests.
977export const ProviderRuntimeToolKind = Schema.Literals([
977const ProviderRuntimeToolKind = Schema.Literals([
978978 "command",
979979 "file-read",
980980 "file-change",
packages/contracts/src/server.ts+4-8
......@@ -4,18 +4,16 @@ import { KeybindingRule, ResolvedKeybindingsConfig } from "./keybindings";
44import { EditorId } from "./editor";
55import { ProviderKind } from "./orchestration";
66
7export const KeybindingsMalformedConfigIssue = Schema.Struct({
7const KeybindingsMalformedConfigIssue = Schema.Struct({
88 kind: Schema.Literal("keybindings.malformed-config"),
99 message: TrimmedNonEmptyString,
1010});
11export type KeybindingsMalformedConfigIssue = typeof KeybindingsMalformedConfigIssue.Type;
1211
13export const KeybindingsInvalidEntryIssue = Schema.Struct({
12const KeybindingsInvalidEntryIssue = Schema.Struct({
1413 kind: Schema.Literal("keybindings.invalid-entry"),
1514 message: TrimmedNonEmptyString,
1615 index: Schema.Number,
1716});
18export type KeybindingsInvalidEntryIssue = typeof KeybindingsInvalidEntryIssue.Type;
1917
2018export const ServerConfigIssue = Schema.Union([
2119 KeybindingsMalformedConfigIssue,
......@@ -23,8 +21,7 @@ export const ServerConfigIssue = Schema.Union([
2321]);
2422export type ServerConfigIssue = typeof ServerConfigIssue.Type;
2523
26export const ServerConfigIssues = Schema.Array(ServerConfigIssue);
27export type ServerConfigIssues = typeof ServerConfigIssues.Type;
24const ServerConfigIssues = Schema.Array(ServerConfigIssue);
2825
2926export const ServerProviderStatusState = Schema.Literals(["ready", "warning", "error"]);
3027export type ServerProviderStatusState = typeof ServerProviderStatusState.Type;
......@@ -46,8 +43,7 @@ export const ServerProviderStatus = Schema.Struct({
4643});
4744export type ServerProviderStatus = typeof ServerProviderStatus.Type;
4845
49export const ServerProviderStatuses = Schema.Array(ServerProviderStatus);
50export type ServerProviderStatuses = typeof ServerProviderStatuses.Type;
46const ServerProviderStatuses = Schema.Array(ServerProviderStatus);
5147
5248export const ServerConfig = Schema.Struct({
5349 cwd: TrimmedNonEmptyString,
packages/contracts/src/terminal.ts+9-9
......@@ -23,12 +23,12 @@ const TerminalIdWithDefaultSchema = TerminalIdSchema.pipe(
2323 Schema.withDecodingDefault(() => DEFAULT_TERMINAL_ID),
2424);
2525
26export const TerminalThreadInput = Schema.Struct({
26const TerminalThreadInput = Schema.Struct({
2727 threadId: TrimmedNonEmptyStringSchema,
2828});
2929export type TerminalThreadInput = Schema.Codec.Encoded<typeof TerminalThreadInput>;
3030
31export const TerminalSessionInput = Schema.Struct({
31const TerminalSessionInput = Schema.Struct({
3232 ...TerminalThreadInput.fields,
3333 terminalId: TerminalIdWithDefaultSchema,
3434});
......@@ -96,43 +96,43 @@ const TerminalEventBaseSchema = Schema.Struct({
9696 createdAt: Schema.String,
9797});
9898
99export const TerminalStartedEvent = Schema.Struct({
99const TerminalStartedEvent = Schema.Struct({
100100 ...TerminalEventBaseSchema.fields,
101101 type: Schema.Literal("started"),
102102 snapshot: TerminalSessionSnapshot,
103103});
104104
105export const TerminalOutputEvent = Schema.Struct({
105const TerminalOutputEvent = Schema.Struct({
106106 ...TerminalEventBaseSchema.fields,
107107 type: Schema.Literal("output"),
108108 data: Schema.String,
109109});
110110
111export const TerminalExitedEvent = Schema.Struct({
111const TerminalExitedEvent = Schema.Struct({
112112 ...TerminalEventBaseSchema.fields,
113113 type: Schema.Literal("exited"),
114114 exitCode: Schema.NullOr(Schema.Int),
115115 exitSignal: Schema.NullOr(Schema.Int),
116116});
117117
118export const TerminalErrorEvent = Schema.Struct({
118const TerminalErrorEvent = Schema.Struct({
119119 ...TerminalEventBaseSchema.fields,
120120 type: Schema.Literal("error"),
121121 message: Schema.String.check(Schema.isNonEmpty()),
122122});
123123
124export const TerminalClearedEvent = Schema.Struct({
124const TerminalClearedEvent = Schema.Struct({
125125 ...TerminalEventBaseSchema.fields,
126126 type: Schema.Literal("cleared"),
127127});
128128
129export const TerminalRestartedEvent = Schema.Struct({
129const TerminalRestartedEvent = Schema.Struct({
130130 ...TerminalEventBaseSchema.fields,
131131 type: Schema.Literal("restarted"),
132132 snapshot: TerminalSessionSnapshot,
133133});
134134
135export const TerminalActivityEvent = Schema.Struct({
135const TerminalActivityEvent = Schema.Struct({
136136 ...TerminalEventBaseSchema.fields,
137137 type: Schema.Literal("activity"),
138138 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
8989 { unsafePreserveChecks: true },
9090 );
9191
92export const WebSocketRequestBody = Schema.Union([
92const WebSocketRequestBody = Schema.Union([
9393 // Orchestration methods
9494 tagRequestBody(
9595 ORCHESTRATION_WS_METHODS.dispatchCommand,