@otto-code/protocol 0.8.12 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-labels.d.ts +3 -0
- package/dist/agent-labels.js +10 -0
- package/dist/agent-personalities.d.ts +4 -3
- package/dist/agent-personalities.js +13 -20
- package/dist/agent-types.d.ts +24 -4
- package/dist/binary-frames/terminal.d.ts +4 -0
- package/dist/binary-frames/terminal.js +1 -0
- package/dist/brain.d.ts +91 -0
- package/dist/brain.js +19 -1
- package/dist/chat/rpc-schemas.js +1 -0
- package/dist/chat/types.js +1 -0
- package/dist/client-capabilities.d.ts +1 -0
- package/dist/client-capabilities.js +4 -0
- package/dist/daemon-config.d.ts +6 -0
- package/dist/daemon-config.js +6 -0
- package/dist/generated/validation/ws-outbound.aot.js +64093 -60274
- package/dist/loop/rpc-schemas.js +1 -0
- package/dist/messages.d.ts +3546 -422
- package/dist/messages.js +445 -13
- package/dist/provider-manifest.js +7 -0
- package/dist/provider-snapshot-codec.d.ts +18 -0
- package/dist/provider-snapshot-codec.js +71 -0
- package/dist/schedule/rpc-schemas.d.ts +8 -64
- package/dist/schedule/types.d.ts +3 -24
- package/dist/schedule/types.js +1 -11
- package/dist/search/text-match.d.ts +55 -0
- package/dist/search/text-match.js +262 -0
- package/dist/suggested-tasks.js +1 -1
- package/dist/terminal-input-mode.d.ts +4 -0
- package/dist/terminal-input-mode.js +35 -6
- package/dist/terminal-key-input.js +15 -6
- package/dist/terminal-profiles.d.ts +35 -0
- package/dist/terminal-profiles.js +246 -4
- package/dist/tool-call-display.d.ts +2 -2
- package/dist/tool-call-display.js +6 -6
- package/dist/validation/ws-outbound-schema-metadata.d.ts +587 -77
- package/package.json +1 -1
package/dist/messages.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MutableAgentBehaviorsConfigSchema, MutableLspConfigSchema, MutableDotnetSolutionConfigSchema, MutableGitHostingConfigSchema, MutableKanbanConfigSchema, MutableAgentPersonalitiesConfigSchema, MutableAgentPersonalitiesConfigPatchSchema, MutableAgentTeamsConfigSchema, MutableAgentTeamsConfigPatchSchema, MutableBrainConfigSchema, MutableBrainConfigPatchSchema, MutableGitFetchConfigSchema, DEFAULT_MUTABLE_BRAIN_CONFIG, } from "./daemon-config.js";
|
|
3
|
-
import { VisualizerVoiceCuesGenerateRequestSchema, VisualizerVoiceCuesGenerateResponseSchema, AgentPersonalitySpinnerSchema, AgentPersonalitiesGetStatsRequestSchema, AgentPersonalitiesGenerateProfileRequestSchema, AgentPersonalitiesGetStatsResponseSchema, AgentPersonalitiesGenerateProfileResponseSchema, PersonalityMemoryListRequestMessageSchema, PersonalityMemoryListResponseMessageSchema, PersonalityMemoryUpdateRequestMessageSchema, PersonalityMemoryUpdateResponseMessageSchema, PersonalityMemoryTransferRequestMessageSchema, PersonalityMemoryTransferResponseMessageSchema, PersonalityMemoryStatsRequestMessageSchema, PersonalityMemoryStatsResponseMessageSchema, } from "./personality-schemas.js";
|
|
3
|
+
import { VisualizerVoiceCuesGenerateRequestSchema, VisualizerVoiceCuesGenerateResponseSchema, AgentPersonalitySpinnerSchema, AgentPersonalityVoiceSchema, AgentPersonalityVoiceCuesSchema, AgentPersonalitiesGetStatsRequestSchema, AgentPersonalitiesGenerateProfileRequestSchema, AgentPersonalitiesGetStatsResponseSchema, AgentPersonalitiesGenerateProfileResponseSchema, PersonalityMemoryListRequestMessageSchema, PersonalityMemoryListResponseMessageSchema, PersonalityMemoryUpdateRequestMessageSchema, PersonalityMemoryUpdateResponseMessageSchema, PersonalityMemoryTransferRequestMessageSchema, PersonalityMemoryTransferResponseMessageSchema, PersonalityMemoryStatsRequestMessageSchema, PersonalityMemoryStatsResponseMessageSchema, } from "./personality-schemas.js";
|
|
4
4
|
import { TerminalCompatibilityDiagnosticRequestSchema, TerminalCompatibilityDiagnosticResponseSchema, } from "./terminal-compatibility.js";
|
|
5
5
|
import { HostingPrAttachmentSchema, HostingIssueAttachmentSchema, HostingSearchRequestSchema, HostingAuthStatusRequestSchema, HostingListRepositoriesRequestSchema, HostingListOwnersRequestSchema, HostingListRepositoriesResponseSchema, HostingListOwnersResponseSchema, HostingAuthStatusResponseSchema, GitHostingCapabilitiesSchema, GitHostingProviderIdWireSchema, } from "./git-hosting.js";
|
|
6
6
|
import { ProjectKanbanTargetSchema, KanbanProjectTargetSetRequestSchema, KanbanProjectTargetSetResponseSchema, KanbanBoardsListRequestSchema, KanbanBoardsListResponseSchema, KanbanBoardGetRequestSchema, KanbanBoardGetResponseSchema, KanbanCardMoveRequestSchema, KanbanCardMoveResponseSchema, KanbanCardCreateRequestSchema, KanbanCardCreateResponseSchema, KanbanTaskLinkRequestSchema, KanbanTaskLinkResponseSchema, } from "./kanban.js";
|
|
@@ -87,6 +87,47 @@ export const TerminalProfileSchema = z
|
|
|
87
87
|
icon: z.string().optional(),
|
|
88
88
|
})
|
|
89
89
|
.passthrough();
|
|
90
|
+
/**
|
|
91
|
+
* A named launch bundle: a provider plus the agent-config values a client would
|
|
92
|
+
* otherwise set one control at a time. Field names mirror `AgentSessionConfig`
|
|
93
|
+
* so applying a profile is a copy rather than a translation table.
|
|
94
|
+
*
|
|
95
|
+
* There is deliberately no system prompt here. `AgentSessionConfig.systemPrompt`
|
|
96
|
+
* is creation-only, so a profile carrying one would apply when starting a new
|
|
97
|
+
* agent and silently do nothing when applied to a running one.
|
|
98
|
+
*/
|
|
99
|
+
export const AgentProfileSchema = z
|
|
100
|
+
.object({
|
|
101
|
+
id: z.string(),
|
|
102
|
+
name: z.string(),
|
|
103
|
+
/** A key into the client's icon registry, not a glyph. Unknown keys draw the default. */
|
|
104
|
+
icon: z.string().optional(),
|
|
105
|
+
/** An identity colour name shared with host badges. Unknown values draw unthemed. */
|
|
106
|
+
color: z.string().optional(),
|
|
107
|
+
provider: z.string(),
|
|
108
|
+
model: z.string().optional(),
|
|
109
|
+
modeId: z.string().optional(),
|
|
110
|
+
thinkingOptionId: z.string().optional(),
|
|
111
|
+
/** Legacy Otto effort alias retained while profile callers converge on thinkingOptionId. */
|
|
112
|
+
effortLevel: z.string().optional(),
|
|
113
|
+
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
114
|
+
/** Free text, surfaced to orchestrating agents by the `list_profiles` MCP tool. */
|
|
115
|
+
notes: z.string().optional(),
|
|
116
|
+
/** Otto behavior and identity fields. All remain optional for older v0.4 peers. */
|
|
117
|
+
personalityPrompt: z.string().optional(),
|
|
118
|
+
respectGlobalAppendPrompt: z.boolean().optional(),
|
|
119
|
+
roles: z.array(z.string().min(1)).optional(),
|
|
120
|
+
spinner: AgentPersonalitySpinnerSchema.optional(),
|
|
121
|
+
voice: AgentPersonalityVoiceSchema.optional(),
|
|
122
|
+
voiceCues: AgentPersonalityVoiceCuesSchema.optional(),
|
|
123
|
+
memoryEnabled: z.boolean().optional(),
|
|
124
|
+
})
|
|
125
|
+
.passthrough();
|
|
126
|
+
const MutableRelayConfigSchema = z
|
|
127
|
+
.object({
|
|
128
|
+
enabled: z.boolean(),
|
|
129
|
+
})
|
|
130
|
+
.passthrough();
|
|
90
131
|
const MutableBrowserToolsConfigSchema = z
|
|
91
132
|
.object({
|
|
92
133
|
enabled: z.boolean().default(false),
|
|
@@ -130,6 +171,8 @@ export const SavedProviderEndpointSchema = z
|
|
|
130
171
|
.passthrough();
|
|
131
172
|
export const MutableDaemonConfigSchema = z
|
|
132
173
|
.object({
|
|
174
|
+
// COMPAT(relayConfig): added in v0.2.6, remove after 2027-01-31 when old daemons are unsupported.
|
|
175
|
+
relay: MutableRelayConfigSchema.optional(),
|
|
133
176
|
mcp: z
|
|
134
177
|
.object({
|
|
135
178
|
injectIntoAgents: z.boolean(),
|
|
@@ -239,10 +282,12 @@ export const MutableDaemonConfigSchema = z
|
|
|
239
282
|
// Kanban board surface credentials (provider tokens). Gated by
|
|
240
283
|
// server_info features.kanbanBoard; absent on older daemons.
|
|
241
284
|
kanban: MutableKanbanConfigSchema.optional(),
|
|
285
|
+
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
242
286
|
})
|
|
243
287
|
.passthrough();
|
|
244
288
|
export const MutableDaemonConfigPatchSchema = z
|
|
245
289
|
.object({
|
|
290
|
+
relay: MutableRelayConfigSchema.partial().optional(),
|
|
246
291
|
mcp: MutableDaemonConfigSchema.shape.mcp.partial().optional(),
|
|
247
292
|
browserTools: MutableBrowserToolsConfigSchema.partial().optional(),
|
|
248
293
|
// Gated by server_info features.agentBehaviorToggles; patches deep-merge.
|
|
@@ -304,6 +349,7 @@ export const MutableDaemonConfigPatchSchema = z
|
|
|
304
349
|
// (read-modify-write), matching modelTierOverrides/savedProviderEndpoints, so
|
|
305
350
|
// enabling/disabling a connector or a tool is a whole-array rewrite.
|
|
306
351
|
connectors: z.array(ConnectorConfigSchema).optional(),
|
|
352
|
+
agentProfiles: z.array(AgentProfileSchema).optional(),
|
|
307
353
|
})
|
|
308
354
|
.partial()
|
|
309
355
|
.passthrough();
|
|
@@ -376,6 +422,8 @@ export const AgentFeatureSchema = z.discriminatedUnion("type", [
|
|
|
376
422
|
const AgentModelDefinitionSchema = z.object({
|
|
377
423
|
provider: AgentProviderSchema,
|
|
378
424
|
id: z.string(),
|
|
425
|
+
aliases: z.array(z.string()).optional(),
|
|
426
|
+
isSelectable: z.boolean().optional(),
|
|
379
427
|
label: z.string(),
|
|
380
428
|
description: z.string().optional(),
|
|
381
429
|
family: z.string().optional(),
|
|
@@ -404,6 +452,25 @@ export const ProviderSnapshotEntrySchema = z.object({
|
|
|
404
452
|
description: z.string().optional(),
|
|
405
453
|
defaultModeId: z.string().nullable().optional(),
|
|
406
454
|
});
|
|
455
|
+
export const CompactProviderSnapshotModelSchema = AgentModelDefinitionSchema.omit({
|
|
456
|
+
provider: true,
|
|
457
|
+
thinkingOptions: true,
|
|
458
|
+
}).extend({
|
|
459
|
+
thinkingSet: z.number().int().nonnegative().optional(),
|
|
460
|
+
});
|
|
461
|
+
export const ProviderSnapshotThinkingSetSchema = z.object({
|
|
462
|
+
options: z.array(AgentSelectOptionSchema),
|
|
463
|
+
defaultOptionId: z.string().optional(),
|
|
464
|
+
});
|
|
465
|
+
export const CompactProviderSnapshotEntrySchema = ProviderSnapshotEntrySchema.omit({
|
|
466
|
+
models: true,
|
|
467
|
+
}).extend({
|
|
468
|
+
models: z.array(CompactProviderSnapshotModelSchema).optional(),
|
|
469
|
+
});
|
|
470
|
+
export const CompactProviderSnapshotSchema = z.object({
|
|
471
|
+
entries: z.array(CompactProviderSnapshotEntrySchema),
|
|
472
|
+
thinkingSets: z.array(ProviderSnapshotThinkingSetSchema),
|
|
473
|
+
});
|
|
407
474
|
const AgentCapabilityFlagsSchema = z
|
|
408
475
|
.object({
|
|
409
476
|
supportsStreaming: z.boolean(),
|
|
@@ -453,6 +520,19 @@ const AgentUsageSchema = z.object({
|
|
|
453
520
|
// contextComposition; absent ⇒ fall back to the estimate, then to occupancy.
|
|
454
521
|
contextCategories: z.array(AgentContextCategorySchema).optional(),
|
|
455
522
|
});
|
|
523
|
+
const ProviderOptionsSchema = z.record(z.string(), z.json());
|
|
524
|
+
const McpToolRefSchema = z
|
|
525
|
+
.object({
|
|
526
|
+
kind: z.literal("mcp"),
|
|
527
|
+
server: z.string().trim().min(1),
|
|
528
|
+
tool: z.string().trim().min(1),
|
|
529
|
+
})
|
|
530
|
+
.strict();
|
|
531
|
+
const ToolPolicySchema = z
|
|
532
|
+
.object({
|
|
533
|
+
preapproved: z.array(McpToolRefSchema),
|
|
534
|
+
})
|
|
535
|
+
.strict();
|
|
456
536
|
const AgentSessionConfigSchema = z.object({
|
|
457
537
|
provider: AgentProviderSchema,
|
|
458
538
|
cwd: z.string(),
|
|
@@ -461,17 +541,8 @@ const AgentSessionConfigSchema = z.object({
|
|
|
461
541
|
thinkingOptionId: z.string().optional(),
|
|
462
542
|
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
463
543
|
title: z.string().trim().min(1).max(MAX_EXPLICIT_AGENT_TITLE_CHARS).optional().nullable(),
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
networkAccess: z.boolean().optional(),
|
|
467
|
-
webSearch: z.boolean().optional(),
|
|
468
|
-
extra: z
|
|
469
|
-
.object({
|
|
470
|
-
codex: z.record(z.string(), z.unknown()).optional(),
|
|
471
|
-
claude: z.record(z.string(), z.unknown()).optional(),
|
|
472
|
-
})
|
|
473
|
-
.partial()
|
|
474
|
-
.optional(),
|
|
544
|
+
providerOptions: ProviderOptionsSchema.optional(),
|
|
545
|
+
toolPolicy: ToolPolicySchema.optional(),
|
|
475
546
|
systemPrompt: z.string().optional(),
|
|
476
547
|
mcpServers: z.record(z.string(), McpServerConfigSchema).optional(),
|
|
477
548
|
});
|
|
@@ -686,6 +757,9 @@ export const AgentTimelineItemPayloadSchema = z.union([
|
|
|
686
757
|
items: z.array(z.object({
|
|
687
758
|
text: z.string(),
|
|
688
759
|
completed: z.boolean(),
|
|
760
|
+
id: z.string().optional(),
|
|
761
|
+
status: z.enum(["pending", "in_progress", "completed"]).optional(),
|
|
762
|
+
activeForm: z.string().optional(),
|
|
689
763
|
})),
|
|
690
764
|
}),
|
|
691
765
|
z.object({
|
|
@@ -714,15 +788,18 @@ export const AgentStreamEventPayloadSchema = z.discriminatedUnion("type", [
|
|
|
714
788
|
z.object({
|
|
715
789
|
type: z.literal("turn_started"),
|
|
716
790
|
provider: AgentProviderSchema,
|
|
791
|
+
turnId: z.string().optional(),
|
|
717
792
|
}),
|
|
718
793
|
z.object({
|
|
719
794
|
type: z.literal("turn_completed"),
|
|
720
795
|
provider: AgentProviderSchema,
|
|
796
|
+
turnId: z.string().optional(),
|
|
721
797
|
usage: AgentUsageSchema.optional(),
|
|
722
798
|
}),
|
|
723
799
|
z.object({
|
|
724
800
|
type: z.literal("turn_failed"),
|
|
725
801
|
provider: AgentProviderSchema,
|
|
802
|
+
turnId: z.string().optional(),
|
|
726
803
|
error: z.string(),
|
|
727
804
|
code: z.string().optional(),
|
|
728
805
|
diagnostic: z.string().optional(),
|
|
@@ -730,6 +807,7 @@ export const AgentStreamEventPayloadSchema = z.discriminatedUnion("type", [
|
|
|
730
807
|
z.object({
|
|
731
808
|
type: z.literal("turn_canceled"),
|
|
732
809
|
provider: AgentProviderSchema,
|
|
810
|
+
turnId: z.string().optional(),
|
|
733
811
|
reason: z.string(),
|
|
734
812
|
}),
|
|
735
813
|
z.object({
|
|
@@ -833,6 +911,10 @@ export const AgentCumulativeUsageSchema = z.object({
|
|
|
833
911
|
*/
|
|
834
912
|
costCoverage: z.enum(["complete", "partial", "none"]).optional(),
|
|
835
913
|
});
|
|
914
|
+
const AgentActiveTurnPayloadSchema = z.object({
|
|
915
|
+
turnId: z.string(),
|
|
916
|
+
startedAt: z.string().nullable(),
|
|
917
|
+
});
|
|
836
918
|
export const AgentSnapshotPayloadSchema = z.object({
|
|
837
919
|
id: z.string(),
|
|
838
920
|
provider: AgentProviderSchema,
|
|
@@ -846,6 +928,7 @@ export const AgentSnapshotPayloadSchema = z.object({
|
|
|
846
928
|
updatedAt: z.string(),
|
|
847
929
|
lastUserMessageAt: z.string().nullable(),
|
|
848
930
|
status: AgentStatusSchema,
|
|
931
|
+
activeTurn: AgentActiveTurnPayloadSchema.nullable().optional(),
|
|
849
932
|
capabilities: AgentCapabilityFlagsSchema,
|
|
850
933
|
currentModeId: z.string().nullable(),
|
|
851
934
|
availableModes: z.array(AgentModeSchema),
|
|
@@ -1020,6 +1103,12 @@ export const UpdateAgentRequestMessageSchema = z.object({
|
|
|
1020
1103
|
// correlated request/response; the download runs as a `pull` job. Gated by
|
|
1021
1104
|
// server_info.features.brainHfSearch. The brain resolves its own HF token (env
|
|
1022
1105
|
// HF_TOKEN or its config), so no secret crosses this boundary.
|
|
1106
|
+
// The daemon accepts only image bytes chosen or acquired by the client. It must
|
|
1107
|
+
// never fetch a user-provided URL on the host's network.
|
|
1108
|
+
export const ProjectIconSourceSchema = z.discriminatedUnion("type", [
|
|
1109
|
+
z.object({ type: z.literal("automatic") }),
|
|
1110
|
+
z.object({ type: z.literal("upload"), data: z.string() }),
|
|
1111
|
+
]);
|
|
1023
1112
|
export const ProjectRenameRequestSchema = z.object({
|
|
1024
1113
|
type: z.literal("project.rename.request"),
|
|
1025
1114
|
projectId: z.string(),
|
|
@@ -1027,6 +1116,12 @@ export const ProjectRenameRequestSchema = z.object({
|
|
|
1027
1116
|
customName: z.string().nullable(),
|
|
1028
1117
|
requestId: z.string(),
|
|
1029
1118
|
});
|
|
1119
|
+
export const ProjectIconSetRequestSchema = z.object({
|
|
1120
|
+
type: z.literal("project.icon.set.request"),
|
|
1121
|
+
projectId: z.string(),
|
|
1122
|
+
source: ProjectIconSourceSchema,
|
|
1123
|
+
requestId: z.string(),
|
|
1124
|
+
});
|
|
1030
1125
|
export const ProjectRemoveRequestSchema = z.object({
|
|
1031
1126
|
type: z.literal("project.remove.request"),
|
|
1032
1127
|
projectId: z.string(),
|
|
@@ -1264,6 +1359,10 @@ export const FetchAgentHistoryRequestMessageSchema = z.object({
|
|
|
1264
1359
|
type: z.literal("fetch_agent_history_request"),
|
|
1265
1360
|
requestId: z.string(),
|
|
1266
1361
|
filter: AgentDirectoryFilterSchema.optional(),
|
|
1362
|
+
// A ranked free-text query over agent title, workspace name, branch, and
|
|
1363
|
+
// project name. Present only on history: agent subscriptions filter on
|
|
1364
|
+
// structure, not on relevance. Ranking replaces `sort` when it is set.
|
|
1365
|
+
search: z.string().optional(),
|
|
1267
1366
|
sort: z
|
|
1268
1367
|
.array(z.object({
|
|
1269
1368
|
key: z.enum(["status_priority", "created_at", "updated_at", "title"]),
|
|
@@ -1541,6 +1640,8 @@ export const ListAvailableProvidersRequestMessageSchema = z.object({
|
|
|
1541
1640
|
export const GetProvidersSnapshotRequestMessageSchema = z.object({
|
|
1542
1641
|
type: z.literal("get_providers_snapshot_request"),
|
|
1543
1642
|
cwd: z.string().optional(),
|
|
1643
|
+
// COMPAT(compactProviderSnapshots): old daemons ignore this field and return a full snapshot.
|
|
1644
|
+
ifNoneMatch: z.string().optional(),
|
|
1544
1645
|
requestId: z.string(),
|
|
1545
1646
|
});
|
|
1546
1647
|
export const RefreshProvidersSnapshotRequestMessageSchema = z.object({
|
|
@@ -1618,6 +1719,13 @@ export const FetchAgentTimelineRequestMessageSchema = z.object({
|
|
|
1618
1719
|
limit: z.number().int().nonnegative().optional(),
|
|
1619
1720
|
// Default should be projected for app timeline loading.
|
|
1620
1721
|
projection: z.enum(["projected", "canonical"]).optional(),
|
|
1722
|
+
// Allow the client to merge this bounded page outside its contiguous loaded range.
|
|
1723
|
+
mergeWindow: z.boolean().optional(),
|
|
1724
|
+
});
|
|
1725
|
+
export const AgentTimelineListPromptsRequestMessageSchema = z.object({
|
|
1726
|
+
type: z.literal("agent.timeline.list_prompts.request"),
|
|
1727
|
+
agentId: z.string(),
|
|
1728
|
+
requestId: z.string(),
|
|
1621
1729
|
});
|
|
1622
1730
|
export const ProviderSubagentListRequestMessageSchema = z.object({
|
|
1623
1731
|
type: z.literal("agent.provider_subagents.list.request"),
|
|
@@ -1693,6 +1801,33 @@ export const SetAgentFeatureResponseMessageSchema = z.object({
|
|
|
1693
1801
|
type: z.literal("set_agent_feature_response"),
|
|
1694
1802
|
payload: AgentActionResponsePayloadSchema,
|
|
1695
1803
|
});
|
|
1804
|
+
/**
|
|
1805
|
+
* Every agent-config value a client can change in one shot. Each field is
|
|
1806
|
+
* optional and an omitted field is left alone; `null` on model and thinking
|
|
1807
|
+
* clears them, matching the single-field RPCs above.
|
|
1808
|
+
*/
|
|
1809
|
+
export const AgentConfigApplySchema = z.object({
|
|
1810
|
+
modelId: z.string().nullable().optional(),
|
|
1811
|
+
modeId: z.string().optional(),
|
|
1812
|
+
thinkingOptionId: z.string().nullable().optional(),
|
|
1813
|
+
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
1814
|
+
});
|
|
1815
|
+
/**
|
|
1816
|
+
* Applies a whole config bundle to one agent. The four single-field RPCs above
|
|
1817
|
+
* stay for individual control edits. One request prevents client interruption
|
|
1818
|
+
* and other mutations from interleaving between bundle steps; provider-level
|
|
1819
|
+
* rejection can still leave earlier steps applied.
|
|
1820
|
+
*/
|
|
1821
|
+
export const AgentConfigApplyRequestMessageSchema = z.object({
|
|
1822
|
+
type: z.literal("agent.config.apply.request"),
|
|
1823
|
+
agentId: z.string(),
|
|
1824
|
+
config: AgentConfigApplySchema,
|
|
1825
|
+
requestId: z.string(),
|
|
1826
|
+
});
|
|
1827
|
+
export const AgentConfigApplyResponseMessageSchema = z.object({
|
|
1828
|
+
type: z.literal("agent.config.apply.response"),
|
|
1829
|
+
payload: AgentActionResponsePayloadSchema,
|
|
1830
|
+
});
|
|
1696
1831
|
export const AgentDetachRequestMessageSchema = z.object({
|
|
1697
1832
|
type: z.literal("agent.detach.request"),
|
|
1698
1833
|
agentId: z.string(),
|
|
@@ -1839,6 +1974,15 @@ export const ProjectRenameResponseSchema = z.object({
|
|
|
1839
1974
|
type: z.literal("project.rename.response"),
|
|
1840
1975
|
payload: ProjectRenameResponsePayloadSchema,
|
|
1841
1976
|
});
|
|
1977
|
+
export const ProjectIconSetResponseSchema = z.object({
|
|
1978
|
+
type: z.literal("project.icon.set.response"),
|
|
1979
|
+
payload: z.object({
|
|
1980
|
+
requestId: z.string(),
|
|
1981
|
+
projectId: z.string(),
|
|
1982
|
+
accepted: z.boolean(),
|
|
1983
|
+
error: z.string().nullable(),
|
|
1984
|
+
}),
|
|
1985
|
+
});
|
|
1842
1986
|
export const ProjectRemoveResponsePayloadSchema = z.object({
|
|
1843
1987
|
requestId: z.string(),
|
|
1844
1988
|
projectId: z.string(),
|
|
@@ -2060,6 +2204,12 @@ export const CheckoutGitFetchRequestSchema = z.object({
|
|
|
2060
2204
|
cwd: z.string(),
|
|
2061
2205
|
requestId: z.string(),
|
|
2062
2206
|
});
|
|
2207
|
+
export const CheckoutDiscardChangesRequestSchema = z.object({
|
|
2208
|
+
type: z.literal("checkout.discard_changes.request"),
|
|
2209
|
+
cwd: z.string(),
|
|
2210
|
+
paths: z.array(z.string()).min(1),
|
|
2211
|
+
requestId: z.string(),
|
|
2212
|
+
});
|
|
2063
2213
|
export const CheckoutPrCreateRequestSchema = z.object({
|
|
2064
2214
|
type: z.literal("checkout_pr_create_request"),
|
|
2065
2215
|
cwd: z.string(),
|
|
@@ -2550,6 +2700,8 @@ const DiffHunkSchema = z.object({
|
|
|
2550
2700
|
});
|
|
2551
2701
|
const ParsedDiffFileSchema = z.object({
|
|
2552
2702
|
path: z.string(),
|
|
2703
|
+
// COMPAT(diffOldPath): added in v0.3.0, remove gate after 2027-02-09.
|
|
2704
|
+
oldPath: z.string().optional(),
|
|
2553
2705
|
isNew: z.boolean(),
|
|
2554
2706
|
isDeleted: z.boolean(),
|
|
2555
2707
|
additions: z.number(),
|
|
@@ -2692,11 +2844,43 @@ export const FsFileWriteBinaryRequestSchema = z.object({
|
|
|
2692
2844
|
overwrite: z.boolean().optional(),
|
|
2693
2845
|
requestId: z.string(),
|
|
2694
2846
|
});
|
|
2847
|
+
export const FileEntryCreateRequestSchema = z.object({
|
|
2848
|
+
type: z.literal("fs.entry.create.request"),
|
|
2849
|
+
cwd: z.string(),
|
|
2850
|
+
parentPath: z.string(),
|
|
2851
|
+
name: z.string(),
|
|
2852
|
+
kind: z.enum(["file", "directory"]),
|
|
2853
|
+
requestId: z.string(),
|
|
2854
|
+
});
|
|
2855
|
+
export const FileEntryRenameRequestSchema = z.object({
|
|
2856
|
+
type: z.literal("fs.entry.rename.request"),
|
|
2857
|
+
cwd: z.string(),
|
|
2858
|
+
path: z.string(),
|
|
2859
|
+
name: z.string(),
|
|
2860
|
+
requestId: z.string(),
|
|
2861
|
+
});
|
|
2862
|
+
export const FileEntryDuplicateRequestSchema = z.object({
|
|
2863
|
+
type: z.literal("fs.entry.duplicate.request"),
|
|
2864
|
+
cwd: z.string(),
|
|
2865
|
+
path: z.string(),
|
|
2866
|
+
requestId: z.string(),
|
|
2867
|
+
});
|
|
2868
|
+
export const FileEntryDeleteRequestSchema = z.object({
|
|
2869
|
+
type: z.literal("fs.entry.delete.request"),
|
|
2870
|
+
cwd: z.string(),
|
|
2871
|
+
path: z.string(),
|
|
2872
|
+
requestId: z.string(),
|
|
2873
|
+
});
|
|
2695
2874
|
export const ProjectIconRequestSchema = z.object({
|
|
2696
2875
|
type: z.literal("project_icon_request"),
|
|
2697
2876
|
cwd: z.string(),
|
|
2698
2877
|
requestId: z.string(),
|
|
2699
2878
|
});
|
|
2879
|
+
export const ProjectIconGetRequestSchema = z.object({
|
|
2880
|
+
type: z.literal("project.icon.get.request"),
|
|
2881
|
+
projectId: z.string(),
|
|
2882
|
+
requestId: z.string(),
|
|
2883
|
+
});
|
|
2700
2884
|
export const FileDownloadTokenRequestSchema = z.object({
|
|
2701
2885
|
type: z.literal("file_download_token_request"),
|
|
2702
2886
|
cwd: z.string(),
|
|
@@ -2775,6 +2959,17 @@ export const RegisterPushTokenMessageSchema = z.object({
|
|
|
2775
2959
|
type: z.literal("register_push_token"),
|
|
2776
2960
|
token: z.string(),
|
|
2777
2961
|
});
|
|
2962
|
+
export const PushUnregisterRequestSchema = z.object({
|
|
2963
|
+
type: z.literal("push.unregister.request"),
|
|
2964
|
+
token: z.string(),
|
|
2965
|
+
requestId: z.string(),
|
|
2966
|
+
});
|
|
2967
|
+
export const PushUnregisterResponseSchema = z.object({
|
|
2968
|
+
type: z.literal("push.unregister.response"),
|
|
2969
|
+
payload: z.object({
|
|
2970
|
+
requestId: z.string(),
|
|
2971
|
+
}),
|
|
2972
|
+
});
|
|
2778
2973
|
// ============================================================================
|
|
2779
2974
|
// Terminal Messages
|
|
2780
2975
|
// ============================================================================
|
|
@@ -2881,7 +3076,12 @@ export const UnsubscribeTerminalRequestSchema = z.object({
|
|
|
2881
3076
|
});
|
|
2882
3077
|
const TerminalClientMessageSchema = z.discriminatedUnion("type", [
|
|
2883
3078
|
z.object({ type: z.literal("input"), data: z.string() }),
|
|
2884
|
-
z.object({
|
|
3079
|
+
z.object({
|
|
3080
|
+
type: z.literal("resize"),
|
|
3081
|
+
rows: z.number(),
|
|
3082
|
+
cols: z.number(),
|
|
3083
|
+
intent: z.enum(["claim", "update"]).optional(),
|
|
3084
|
+
}),
|
|
2885
3085
|
z.object({
|
|
2886
3086
|
type: z.literal("mouse"),
|
|
2887
3087
|
row: z.number(),
|
|
@@ -2915,14 +3115,47 @@ export const HubExecutionAgentCreateRequestSchema = z.object({
|
|
|
2915
3115
|
provider: z.string(),
|
|
2916
3116
|
cwd: z.string(),
|
|
2917
3117
|
prompt: z.string(),
|
|
3118
|
+
// COMPAT(hubExecutionWorkspaceSelection): semantics retired in v0.3.1; remove after 2027-08-08 once the Hub floor no longer sends it.
|
|
2918
3119
|
workspaceId: z.string().optional(),
|
|
2919
3120
|
model: z.string().optional(),
|
|
2920
3121
|
modeId: z.string().optional(),
|
|
2921
3122
|
thinkingOptionId: z.string().optional(),
|
|
2922
3123
|
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
3124
|
+
providerOptions: ProviderOptionsSchema.optional(),
|
|
3125
|
+
toolPolicy: ToolPolicySchema.optional(),
|
|
2923
3126
|
env: z.record(z.string(), z.string()).optional(),
|
|
3127
|
+
mcpServers: z.record(z.string(), McpServerConfigSchema).optional(),
|
|
2924
3128
|
worktree: CreateAgentWorktreeTargetSchema.optional(),
|
|
2925
3129
|
});
|
|
3130
|
+
export const HubExecutionAgentValidateRequestSchema = z.object({
|
|
3131
|
+
type: z.literal("hub.execution.agent.validate.request"),
|
|
3132
|
+
requestId: z.string(),
|
|
3133
|
+
provider: z.string(),
|
|
3134
|
+
model: z.string().optional(),
|
|
3135
|
+
modeId: z.string().optional(),
|
|
3136
|
+
thinkingOptionId: z.string().optional(),
|
|
3137
|
+
providerOptions: ProviderOptionsSchema.optional(),
|
|
3138
|
+
});
|
|
3139
|
+
const HubExecutionAgentCreateErrorSchema = z.discriminatedUnion("code", [
|
|
3140
|
+
z.object({
|
|
3141
|
+
code: z.literal("provider_options_invalid"),
|
|
3142
|
+
provider: z.string(),
|
|
3143
|
+
issues: z.array(z.object({
|
|
3144
|
+
path: z.array(z.union([z.string(), z.number()])),
|
|
3145
|
+
message: z.string(),
|
|
3146
|
+
})),
|
|
3147
|
+
message: z.string(),
|
|
3148
|
+
}),
|
|
3149
|
+
z.object({
|
|
3150
|
+
code: z.literal("tool_policy_unsupported"),
|
|
3151
|
+
provider: z.string(),
|
|
3152
|
+
message: z.string(),
|
|
3153
|
+
}),
|
|
3154
|
+
z.object({
|
|
3155
|
+
code: z.literal("create_failed"),
|
|
3156
|
+
message: z.string(),
|
|
3157
|
+
}),
|
|
3158
|
+
]);
|
|
2926
3159
|
export const HubExecutionControlActionSchema = z.enum(["interrupt", "archive"]);
|
|
2927
3160
|
export const HubExecutionControlRequestSchema = z.object({
|
|
2928
3161
|
type: z.literal("hub.execution.control.request"),
|
|
@@ -2932,6 +3165,7 @@ export const HubExecutionControlRequestSchema = z.object({
|
|
|
2932
3165
|
});
|
|
2933
3166
|
export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
2934
3167
|
HubExecutionAgentCreateRequestSchema,
|
|
3168
|
+
HubExecutionAgentValidateRequestSchema,
|
|
2935
3169
|
HubExecutionControlRequestSchema,
|
|
2936
3170
|
BrowserAutomationExecuteResponseSchema,
|
|
2937
3171
|
VoiceAudioChunkMessageSchema,
|
|
@@ -2989,6 +3223,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
2989
3223
|
UpdateAgentRequestMessageSchema,
|
|
2990
3224
|
ProjectRenameRequestSchema,
|
|
2991
3225
|
KanbanProjectTargetSetRequestSchema,
|
|
3226
|
+
ProjectIconSetRequestSchema,
|
|
2992
3227
|
ProjectRemoveRequestSchema,
|
|
2993
3228
|
ProjectLinksListRequestSchema,
|
|
2994
3229
|
ProjectLinksSetRequestSchema,
|
|
@@ -3084,6 +3319,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
3084
3319
|
RestartServerRequestMessageSchema,
|
|
3085
3320
|
DaemonUpdateRequestMessageSchema,
|
|
3086
3321
|
FetchAgentTimelineRequestMessageSchema,
|
|
3322
|
+
AgentTimelineListPromptsRequestMessageSchema,
|
|
3087
3323
|
ProviderSubagentListRequestMessageSchema,
|
|
3088
3324
|
ProviderSubagentTimelineRequestMessageSchema,
|
|
3089
3325
|
SetAgentTimelineSubscriptionRequestMessageSchema,
|
|
@@ -3092,6 +3328,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
3092
3328
|
SetAgentModelRequestMessageSchema,
|
|
3093
3329
|
SetAgentThinkingRequestMessageSchema,
|
|
3094
3330
|
SetAgentFeatureRequestMessageSchema,
|
|
3331
|
+
AgentConfigApplyRequestMessageSchema,
|
|
3095
3332
|
AgentDetachRequestMessageSchema,
|
|
3096
3333
|
AgentWorkspaceTransferRequestMessageSchema,
|
|
3097
3334
|
AgentSubagentStopRequestMessageSchema,
|
|
@@ -3135,6 +3372,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
3135
3372
|
CheckoutPushRequestSchema,
|
|
3136
3373
|
CheckoutRefreshRequestSchema,
|
|
3137
3374
|
CheckoutGitFetchRequestSchema,
|
|
3375
|
+
CheckoutDiscardChangesRequestSchema,
|
|
3138
3376
|
CheckoutPrCreateRequestSchema,
|
|
3139
3377
|
CheckoutPrMergeRequestSchema,
|
|
3140
3378
|
CheckoutForgeSetAutoMergeRequestSchema,
|
|
@@ -3192,7 +3430,12 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
3192
3430
|
FileUnsubscribeRequestSchema,
|
|
3193
3431
|
FsFileWriteRequestSchema,
|
|
3194
3432
|
FsFileWriteBinaryRequestSchema,
|
|
3433
|
+
FileEntryCreateRequestSchema,
|
|
3434
|
+
FileEntryRenameRequestSchema,
|
|
3435
|
+
FileEntryDuplicateRequestSchema,
|
|
3436
|
+
FileEntryDeleteRequestSchema,
|
|
3195
3437
|
ProjectIconRequestSchema,
|
|
3438
|
+
ProjectIconGetRequestSchema,
|
|
3196
3439
|
FileDownloadTokenRequestSchema,
|
|
3197
3440
|
FileUploadRequestSchema,
|
|
3198
3441
|
FileWriteRequestSchema,
|
|
@@ -3225,6 +3468,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
3225
3468
|
PingMessageSchema,
|
|
3226
3469
|
ListCommandsRequestSchema,
|
|
3227
3470
|
RegisterPushTokenMessageSchema,
|
|
3471
|
+
PushUnregisterRequestSchema,
|
|
3228
3472
|
ListTerminalsRequestSchema,
|
|
3229
3473
|
SubscribeTerminalsRequestSchema,
|
|
3230
3474
|
UnsubscribeTerminalsRequestSchema,
|
|
@@ -3425,6 +3669,8 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3425
3669
|
features: z
|
|
3426
3670
|
.object({
|
|
3427
3671
|
providersSnapshot: z.boolean().optional(),
|
|
3672
|
+
// COMPAT(providersSnapshotCwd): added in v0.3.2, remove gate after 2027-02-10.
|
|
3673
|
+
providersSnapshotCwd: z.boolean().optional(),
|
|
3428
3674
|
// COMPAT(checkoutForgeSetAutoMerge): added in v0.1.106, remove old
|
|
3429
3675
|
// checkoutGithubSetAutoMerge fallback after 2026-12-28.
|
|
3430
3676
|
checkoutForgeSetAutoMerge: z.boolean().optional(),
|
|
@@ -3437,6 +3683,10 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3437
3683
|
forgeSearch: z.boolean().optional(),
|
|
3438
3684
|
// COMPAT(daemonStatusRpc): added in v0.1.76, remove gate after 2026-11-18.
|
|
3439
3685
|
daemonStatusRpc: z.boolean().optional(),
|
|
3686
|
+
// COMPAT(relayConfig): added in v0.2.6, remove gate after 2027-01-31.
|
|
3687
|
+
relayConfig: z.boolean().optional(),
|
|
3688
|
+
// COMPAT(pushTokenRevocation): added in v0.3.2, remove gate after 2027-02-10.
|
|
3689
|
+
pushTokenRevocation: z.boolean().optional(),
|
|
3440
3690
|
// COMPAT(terminalRestoreModes): added in v0.1.81, remove gate after 2026-11-23.
|
|
3441
3691
|
"terminal-restore-modes": z.boolean().optional(),
|
|
3442
3692
|
// COMPAT(terminalCompatibilityDiagnostic): added in v0.8.9, remove gate after 2027-02-12.
|
|
@@ -3444,8 +3694,16 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3444
3694
|
terminalEmbeddedPresentation: z.boolean().optional(),
|
|
3445
3695
|
// COMPAT(terminalTitleSettings): added in v0.8.5, remove gate after 2027-02-07.
|
|
3446
3696
|
terminalTitleSettings: z.boolean().optional(),
|
|
3697
|
+
// COMPAT(terminalInputModeReplay): added in v0.2.6, remove gate after 2027-02-02.
|
|
3698
|
+
"terminal-input-mode-replay": z.boolean().optional(),
|
|
3699
|
+
// COMPAT(terminalSizeOwnership): added in v0.2.6, remove gate after 2027-02-02.
|
|
3700
|
+
"terminal-size-ownership": z.boolean().optional(),
|
|
3447
3701
|
// COMPAT(rewind): added in v0.1.X, drop the gate when floor >= v0.1.X.
|
|
3448
3702
|
rewind: z.boolean().optional(),
|
|
3703
|
+
// COMPAT(agentTimelinePromptIndex): added in v0.2.X, drop the gate when floor >= v0.2.X.
|
|
3704
|
+
agentTimelinePromptIndex: z.boolean().optional(),
|
|
3705
|
+
// COMPAT(agentHistorySearch): added in v0.3.0, remove gate after 2027-02-07.
|
|
3706
|
+
agentHistorySearch: z.boolean().optional(),
|
|
3449
3707
|
// COMPAT(checkoutRefresh): added in v0.1.86, remove gate after 2026-11-29.
|
|
3450
3708
|
checkoutRefresh: z.boolean().optional(),
|
|
3451
3709
|
// COMPAT(gitFetchControl): added in v0.8.11, remove gate after 2027-02-14.
|
|
@@ -3493,6 +3751,10 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3493
3751
|
// older daemons, whose Brain config rejects the field.
|
|
3494
3752
|
// COMPAT(brainRuntimeLogVerbosity): added in v0.8.10, drop the gate when daemon floor >= v0.8.10.
|
|
3495
3753
|
brainRuntimeLogVerbosity: z.boolean().optional(),
|
|
3754
|
+
// The Brain host can keep multiple independent model processes resident
|
|
3755
|
+
// and exposes maxLoadedModels/lockedModels in local and remote settings.
|
|
3756
|
+
// COMPAT(brainModelProcessPool): added in v0.8.12, remove after 2027-02-21.
|
|
3757
|
+
brainModelProcessPool: z.boolean().optional(),
|
|
3496
3758
|
// Daemon streams the brain's live status/telemetry via
|
|
3497
3759
|
// subscribe_brain_status + brain_status_changed, and serves brain.evals.get.
|
|
3498
3760
|
// Separate from brainControl because status/eval watching can ship after
|
|
@@ -3930,10 +4192,29 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
3930
4192
|
forgeProviders: z.boolean().optional(),
|
|
3931
4193
|
// COMPAT(selectiveAgentTimeline): added in v0.1.106, remove after 2027-01-12.
|
|
3932
4194
|
selectiveAgentTimeline: z.boolean().optional(),
|
|
4195
|
+
// COMPAT(canonicalSubmittedPrompts): added in v0.2.6, remove gate after 2027-01-30.
|
|
4196
|
+
canonicalSubmittedPrompts: z.boolean().optional(),
|
|
4197
|
+
// COMPAT(agentTurnIdentity): accept peers that observed pre-release v0.2.6 through 2027-01-31.
|
|
4198
|
+
agentTurnIdentity: z.boolean().optional(),
|
|
3933
4199
|
// COMPAT(stableProjectIdentity): added in v0.1.109, remove gate after 2027-01-15.
|
|
3934
4200
|
stableProjectIdentity: z.boolean().optional(),
|
|
3935
4201
|
// COMPAT(workspaceScriptManagement): added in v0.1.105, remove gate after 2027-01-10.
|
|
3936
4202
|
workspaceScriptManagement: z.boolean().optional(),
|
|
4203
|
+
// COMPAT(projectCustomIcon): added in v0.2.0, remove after 2027-01-20.
|
|
4204
|
+
projectCustomIcon: z.boolean().optional(),
|
|
4205
|
+
// COMPAT(fsEntryOps): added in v0.3.0, remove gate after 2027-02-08.
|
|
4206
|
+
fsEntryOps: z.boolean().optional(),
|
|
4207
|
+
// COMPAT(fsEntryDuplicate): added in v0.3.0, remove gate after 2027-02-09.
|
|
4208
|
+
fsEntryDuplicate: z.boolean().optional(),
|
|
4209
|
+
// COMPAT(checkoutDiscardChanges): added in v0.3.0, remove gate after 2027-02-08.
|
|
4210
|
+
checkoutDiscardChanges: z.boolean().optional(),
|
|
4211
|
+
// COMPAT(agentProfiles): added in v0.3.2, remove gate after 2027-02-11.
|
|
4212
|
+
// An older daemon parses its persisted config strictly, so writing
|
|
4213
|
+
// agentProfiles to one is silently dropped. The client hides the feature
|
|
4214
|
+
// rather than letting a save appear to succeed.
|
|
4215
|
+
agentProfiles: z.boolean().optional(),
|
|
4216
|
+
// COMPAT(agentConfigApply): added in v0.3.2, remove gate after 2027-02-11.
|
|
4217
|
+
agentConfigApply: z.boolean().optional(),
|
|
3937
4218
|
})
|
|
3938
4219
|
.optional(),
|
|
3939
4220
|
})
|
|
@@ -4226,8 +4507,14 @@ export const WorkspaceDescriptorPayloadSchema = z
|
|
|
4226
4507
|
// COMPAT(projectKanbanTarget): added in v0.8.11, drop the optional gate when
|
|
4227
4508
|
// floor >= v0.8.11.
|
|
4228
4509
|
projectKanban: ProjectKanbanTargetSchema.nullable().optional(),
|
|
4510
|
+
// Identifies the project's stored custom icon; null means automatic.
|
|
4511
|
+
// COMPAT(projectCustomIcon): added in v0.2.0, remove after 2027-01-20.
|
|
4512
|
+
projectCustomIconRevision: z.string().nullable().optional(),
|
|
4229
4513
|
projectRootPath: z.string(),
|
|
4230
4514
|
workspaceDirectory: z.string().optional(),
|
|
4515
|
+
// COMPAT(worktreeSlug): added in v0.2.6, remove optional after 2027-01-31.
|
|
4516
|
+
// Present only for Otto-owned worktrees; this is the basename of their root directory.
|
|
4517
|
+
worktreeSlug: z.string().optional(),
|
|
4231
4518
|
projectKind: z.enum(["git", "non_git", "directory"]),
|
|
4232
4519
|
// COMPAT(workspaces): keep the legacy "directory" workspace kind parseable.
|
|
4233
4520
|
// Persisted registries still carry it and there is no migration, so this
|
|
@@ -4328,9 +4615,25 @@ export const AgentListMessageSchema = z.object({
|
|
|
4328
4615
|
agents: z.array(AgentSnapshotPayloadSchema),
|
|
4329
4616
|
}),
|
|
4330
4617
|
});
|
|
4618
|
+
export const AgentSearchMatchFieldSchema = z.enum(["workspace", "title", "branch", "project"]);
|
|
4619
|
+
export const AgentSearchMatchSchema = z.object({
|
|
4620
|
+
field: AgentSearchMatchFieldSchema,
|
|
4621
|
+
ranges: z.array(z.object({
|
|
4622
|
+
start: z.number().int().nonnegative(),
|
|
4623
|
+
length: z.number().int().positive(),
|
|
4624
|
+
})),
|
|
4625
|
+
});
|
|
4331
4626
|
const AgentDirectoryResponseEntrySchema = z.object({
|
|
4332
4627
|
agent: AgentSnapshotPayloadSchema,
|
|
4333
4628
|
project: ProjectPlacementPayloadSchema,
|
|
4629
|
+
// Relevance of this entry to the request's `search`, lower being better.
|
|
4630
|
+
// Set only when the request carried a query; a client merging results from
|
|
4631
|
+
// several hosts needs it to interleave their separately ranked pages.
|
|
4632
|
+
searchScore: z.number().optional(),
|
|
4633
|
+
// Where the query matched, so the row can mark it. The ranker computes this
|
|
4634
|
+
// anyway; sending it keeps the client from re-deriving a second opinion that
|
|
4635
|
+
// could disagree with the ranking it is explaining.
|
|
4636
|
+
searchMatches: z.array(AgentSearchMatchSchema).optional(),
|
|
4334
4637
|
});
|
|
4335
4638
|
const AgentDirectoryPageInfoSchema = z.object({
|
|
4336
4639
|
nextCursor: z.string().nullable(),
|
|
@@ -4352,6 +4655,10 @@ export const FetchAgentHistoryResponseMessageSchema = z.object({
|
|
|
4352
4655
|
requestId: z.string(),
|
|
4353
4656
|
entries: z.array(AgentDirectoryResponseEntrySchema),
|
|
4354
4657
|
pageInfo: AgentDirectoryPageInfoSchema,
|
|
4658
|
+
// More sessions matched the request's `search` than the page could hold.
|
|
4659
|
+
// Distinct from `pageInfo.hasMore`, which promises a fetchable next page —
|
|
4660
|
+
// a ranked result set has none, and the way on is a narrower query.
|
|
4661
|
+
searchTruncated: z.boolean().optional(),
|
|
4355
4662
|
}),
|
|
4356
4663
|
});
|
|
4357
4664
|
export const FetchRecentProviderSessionsResponseMessageSchema = z.object({
|
|
@@ -4378,6 +4685,8 @@ export const WorkspaceProjectDescriptorPayloadSchema = z.object({
|
|
|
4378
4685
|
// COMPAT(projectKanbanTarget): added in v0.8.11, drop the optional gate when
|
|
4379
4686
|
// floor >= v0.8.11.
|
|
4380
4687
|
projectKanban: ProjectKanbanTargetSchema.nullable().optional(),
|
|
4688
|
+
// COMPAT(projectCustomIcon): added in v0.2.0, remove after 2027-01-20.
|
|
4689
|
+
projectCustomIconRevision: z.string().nullable().optional(),
|
|
4381
4690
|
projectRootPath: z.string(),
|
|
4382
4691
|
projectKind: z.enum(["git", "non_git", "directory"]),
|
|
4383
4692
|
});
|
|
@@ -4755,10 +5064,25 @@ export const FetchAgentTimelineResponseMessageSchema = z.object({
|
|
|
4755
5064
|
endCursor: AgentTimelineCursorSchema.nullable(),
|
|
4756
5065
|
hasOlder: z.boolean(),
|
|
4757
5066
|
hasNewer: z.boolean(),
|
|
5067
|
+
mergeWindow: z.boolean().optional(),
|
|
4758
5068
|
entries: z.array(AgentTimelineEntryPayloadSchema),
|
|
4759
5069
|
error: z.string().nullable(),
|
|
4760
5070
|
}),
|
|
4761
5071
|
});
|
|
5072
|
+
export const AgentTimelineListPromptsResponseMessageSchema = z.object({
|
|
5073
|
+
type: z.literal("agent.timeline.list_prompts.response"),
|
|
5074
|
+
payload: z.object({
|
|
5075
|
+
requestId: z.string(),
|
|
5076
|
+
agentId: z.string(),
|
|
5077
|
+
epoch: z.string(),
|
|
5078
|
+
prompts: z.array(z.object({
|
|
5079
|
+
seq: z.number().int().nonnegative(),
|
|
5080
|
+
timestamp: z.string(),
|
|
5081
|
+
preview: z.string(),
|
|
5082
|
+
})),
|
|
5083
|
+
error: z.string().nullable(),
|
|
5084
|
+
}),
|
|
5085
|
+
});
|
|
4762
5086
|
export const ProviderSubagentDescriptorPayloadSchema = z.object({
|
|
4763
5087
|
id: z.string(),
|
|
4764
5088
|
parentAgentId: z.string(),
|
|
@@ -4770,6 +5094,9 @@ export const ProviderSubagentDescriptorPayloadSchema = z.object({
|
|
|
4770
5094
|
updatedAt: z.string(),
|
|
4771
5095
|
toolCallId: z.string().nullable(),
|
|
4772
5096
|
cwd: z.string().nullable().optional(),
|
|
5097
|
+
// Compact provider-owned context for the shared track. Providers choose what belongs here and
|
|
5098
|
+
// format it for display; clients must not parse provider-specific facts out of this string.
|
|
5099
|
+
subtitle: z.string().nullable().optional(),
|
|
4773
5100
|
});
|
|
4774
5101
|
export const ProviderSubagentListResponseMessageSchema = z.object({
|
|
4775
5102
|
type: z.literal("agent.provider_subagents.list.response"),
|
|
@@ -5054,6 +5381,7 @@ export const ReadProjectConfigResponseMessageSchema = z.object({
|
|
|
5054
5381
|
ok: z.literal(true),
|
|
5055
5382
|
config: OttoConfigRawSchema.nullable(),
|
|
5056
5383
|
revision: OttoConfigRevisionSchema.nullable(),
|
|
5384
|
+
hasUncommittedWorktreeSetupChanges: z.boolean().optional(),
|
|
5057
5385
|
}),
|
|
5058
5386
|
z.object({
|
|
5059
5387
|
requestId: z.string(),
|
|
@@ -5074,6 +5402,7 @@ export const WriteProjectConfigResponseMessageSchema = z.object({
|
|
|
5074
5402
|
ok: z.literal(true),
|
|
5075
5403
|
config: OttoConfigRawSchema,
|
|
5076
5404
|
revision: OttoConfigRevisionSchema,
|
|
5405
|
+
hasUncommittedWorktreeSetupChanges: z.boolean().optional(),
|
|
5077
5406
|
}),
|
|
5078
5407
|
z.object({
|
|
5079
5408
|
requestId: z.string(),
|
|
@@ -5152,6 +5481,13 @@ const CheckoutStatusCommonSchema = z.object({
|
|
|
5152
5481
|
// client inferred from isOttoOwnedWorktree.
|
|
5153
5482
|
// COMPAT(checkoutDiffBaseAnyRepo): added in v0.7.4.
|
|
5154
5483
|
isBaseEditable: z.boolean().optional(),
|
|
5484
|
+
// The full ref currentBranch tracks, as git resolves `<branch>@{upstream}`:
|
|
5485
|
+
// "refs/remotes/origin/main", "refs/remotes/upstream/main" on a fork, or a
|
|
5486
|
+
// "refs/heads/..." ref for a branch tracking a local branch. Null when there is no
|
|
5487
|
+
// upstream. Clients use it verbatim — the remote is not necessarily origin and the
|
|
5488
|
+
// upstream branch name is not necessarily currentBranch, so composing one is wrong.
|
|
5489
|
+
// aheadOfOrigin/behindOfOrigin are measured against exactly this ref.
|
|
5490
|
+
upstreamRef: z.string().nullable().optional(),
|
|
5155
5491
|
});
|
|
5156
5492
|
const CheckoutStatusNotGitSchema = CheckoutStatusCommonSchema.extend({
|
|
5157
5493
|
isGit: z.literal(false),
|
|
@@ -5547,6 +5883,15 @@ export const CheckoutGithubSetAutoMergeResponseSchema = z.object({
|
|
|
5547
5883
|
requestId: z.string(),
|
|
5548
5884
|
}),
|
|
5549
5885
|
});
|
|
5886
|
+
export const CheckoutDiscardChangesResponseSchema = z.object({
|
|
5887
|
+
type: z.literal("checkout.discard_changes.response"),
|
|
5888
|
+
payload: z.object({
|
|
5889
|
+
cwd: z.string(),
|
|
5890
|
+
success: z.boolean(),
|
|
5891
|
+
error: CheckoutErrorSchema.nullable(),
|
|
5892
|
+
requestId: z.string(),
|
|
5893
|
+
}),
|
|
5894
|
+
});
|
|
5550
5895
|
export const CheckoutCommitsListResponseSchema = z.object({
|
|
5551
5896
|
type: z.literal("checkout.commits.list.response"),
|
|
5552
5897
|
payload: z.object({
|
|
@@ -5845,6 +6190,8 @@ export const BranchSuggestionsResponseSchema = z.object({
|
|
|
5845
6190
|
// older daemons, in which case pickers disable nothing (today's
|
|
5846
6191
|
// behavior).
|
|
5847
6192
|
checkedOutElsewhere: z.boolean().optional(),
|
|
6193
|
+
localAhead: z.number().int().nonnegative().optional(),
|
|
6194
|
+
localBehind: z.number().int().nonnegative().optional(),
|
|
5848
6195
|
}))
|
|
5849
6196
|
.optional(),
|
|
5850
6197
|
error: z.string().nullable(),
|
|
@@ -5996,6 +6343,49 @@ export const FsFileWriteBinaryResponseSchema = z.object({
|
|
|
5996
6343
|
requestId: z.string(),
|
|
5997
6344
|
}),
|
|
5998
6345
|
});
|
|
6346
|
+
export const FileEntryCreateResponseSchema = z.object({
|
|
6347
|
+
type: z.literal("fs.entry.create.response"),
|
|
6348
|
+
payload: z.object({
|
|
6349
|
+
cwd: z.string(),
|
|
6350
|
+
parentPath: z.string(),
|
|
6351
|
+
path: z.string().nullable(),
|
|
6352
|
+
success: z.boolean(),
|
|
6353
|
+
error: z.string().nullable(),
|
|
6354
|
+
requestId: z.string(),
|
|
6355
|
+
}),
|
|
6356
|
+
});
|
|
6357
|
+
export const FileEntryRenameResponseSchema = z.object({
|
|
6358
|
+
type: z.literal("fs.entry.rename.response"),
|
|
6359
|
+
payload: z.object({
|
|
6360
|
+
cwd: z.string(),
|
|
6361
|
+
path: z.string(),
|
|
6362
|
+
renamedPath: z.string().nullable(),
|
|
6363
|
+
success: z.boolean(),
|
|
6364
|
+
error: z.string().nullable(),
|
|
6365
|
+
requestId: z.string(),
|
|
6366
|
+
}),
|
|
6367
|
+
});
|
|
6368
|
+
export const FileEntryDuplicateResponseSchema = z.object({
|
|
6369
|
+
type: z.literal("fs.entry.duplicate.response"),
|
|
6370
|
+
payload: z.object({
|
|
6371
|
+
cwd: z.string(),
|
|
6372
|
+
path: z.string(),
|
|
6373
|
+
duplicatedPath: z.string().nullable(),
|
|
6374
|
+
success: z.boolean(),
|
|
6375
|
+
error: z.string().nullable(),
|
|
6376
|
+
requestId: z.string(),
|
|
6377
|
+
}),
|
|
6378
|
+
});
|
|
6379
|
+
export const FileEntryDeleteResponseSchema = z.object({
|
|
6380
|
+
type: z.literal("fs.entry.delete.response"),
|
|
6381
|
+
payload: z.object({
|
|
6382
|
+
cwd: z.string(),
|
|
6383
|
+
path: z.string(),
|
|
6384
|
+
success: z.boolean(),
|
|
6385
|
+
error: z.string().nullable(),
|
|
6386
|
+
requestId: z.string(),
|
|
6387
|
+
}),
|
|
6388
|
+
});
|
|
5999
6389
|
export const FileUpdateSchema = z.object({
|
|
6000
6390
|
type: z.literal("fs.file.update"),
|
|
6001
6391
|
payload: z.object({
|
|
@@ -6016,6 +6406,15 @@ export const ProjectIconResponseSchema = z.object({
|
|
|
6016
6406
|
requestId: z.string(),
|
|
6017
6407
|
}),
|
|
6018
6408
|
});
|
|
6409
|
+
export const ProjectIconGetResponseSchema = z.object({
|
|
6410
|
+
type: z.literal("project.icon.get.response"),
|
|
6411
|
+
payload: z.object({
|
|
6412
|
+
projectId: z.string(),
|
|
6413
|
+
icon: ProjectIconSchema.nullable(),
|
|
6414
|
+
error: z.string().nullable(),
|
|
6415
|
+
requestId: z.string(),
|
|
6416
|
+
}),
|
|
6417
|
+
});
|
|
6019
6418
|
export const FileDownloadTokenResponseSchema = z.object({
|
|
6020
6419
|
type: z.literal("file_download_token_response"),
|
|
6021
6420
|
payload: z.object({
|
|
@@ -6118,7 +6517,11 @@ export const ListAvailableProvidersResponseSchema = z.object({
|
|
|
6118
6517
|
export const GetProvidersSnapshotResponseMessageSchema = z.object({
|
|
6119
6518
|
type: z.literal("get_providers_snapshot_response"),
|
|
6120
6519
|
payload: z.object({
|
|
6520
|
+
cwd: z.string().optional(),
|
|
6121
6521
|
entries: z.array(ProviderSnapshotEntrySchema),
|
|
6522
|
+
compactSnapshot: CompactProviderSnapshotSchema.optional(),
|
|
6523
|
+
snapshotHash: z.string().optional(),
|
|
6524
|
+
notModified: z.boolean().optional(),
|
|
6122
6525
|
generatedAt: z.string(),
|
|
6123
6526
|
requestId: z.string(),
|
|
6124
6527
|
}),
|
|
@@ -6129,6 +6532,8 @@ export const ProvidersSnapshotUpdateMessageSchema = z.object({
|
|
|
6129
6532
|
payload: z.object({
|
|
6130
6533
|
cwd: z.string().optional(),
|
|
6131
6534
|
entries: z.array(ProviderSnapshotEntrySchema),
|
|
6535
|
+
compactSnapshot: CompactProviderSnapshotSchema.optional(),
|
|
6536
|
+
snapshotHash: z.string().optional(),
|
|
6132
6537
|
generatedAt: z.string(),
|
|
6133
6538
|
}),
|
|
6134
6539
|
});
|
|
@@ -6370,6 +6775,20 @@ export const HubExecutionAgentCreateResponseSchema = z.object({
|
|
|
6370
6775
|
agentId: z.string().nullable(),
|
|
6371
6776
|
agent: AgentSnapshotPayloadSchema.nullable(),
|
|
6372
6777
|
success: z.boolean(),
|
|
6778
|
+
toolPolicyApplied: z.literal(true).optional(),
|
|
6779
|
+
error: HubExecutionAgentCreateErrorSchema.nullable(),
|
|
6780
|
+
}),
|
|
6781
|
+
});
|
|
6782
|
+
export const HubExecutionAgentValidationIssueSchema = z.object({
|
|
6783
|
+
path: z.array(z.union([z.string(), z.number()])),
|
|
6784
|
+
message: z.string(),
|
|
6785
|
+
});
|
|
6786
|
+
export const HubExecutionAgentValidateResponseSchema = z.object({
|
|
6787
|
+
type: z.literal("hub.execution.agent.validate.response"),
|
|
6788
|
+
payload: z.object({
|
|
6789
|
+
requestId: z.string(),
|
|
6790
|
+
valid: z.boolean(),
|
|
6791
|
+
issues: z.array(HubExecutionAgentValidationIssueSchema),
|
|
6373
6792
|
error: z.string().nullable(),
|
|
6374
6793
|
}),
|
|
6375
6794
|
});
|
|
@@ -6401,6 +6820,7 @@ export const HubExecutionAgentStreamSchema = z.object({
|
|
|
6401
6820
|
});
|
|
6402
6821
|
export const HubExecutionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
6403
6822
|
HubExecutionAgentCreateResponseSchema,
|
|
6823
|
+
HubExecutionAgentValidateResponseSchema,
|
|
6404
6824
|
HubExecutionControlResponseSchema,
|
|
6405
6825
|
HubExecutionAgentUpdateSchema,
|
|
6406
6826
|
HubExecutionAgentStreamSchema,
|
|
@@ -6425,6 +6845,7 @@ export function parseHubExecutionOutboundMessage(value) {
|
|
|
6425
6845
|
}
|
|
6426
6846
|
export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
6427
6847
|
HubExecutionAgentCreateResponseSchema,
|
|
6848
|
+
HubExecutionAgentValidateResponseSchema,
|
|
6428
6849
|
HubExecutionControlResponseSchema,
|
|
6429
6850
|
HubExecutionAgentUpdateSchema,
|
|
6430
6851
|
HubExecutionAgentStreamSchema,
|
|
@@ -6441,6 +6862,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6441
6862
|
DictationStreamErrorMessageSchema,
|
|
6442
6863
|
StatusMessageSchema,
|
|
6443
6864
|
PongMessageSchema,
|
|
6865
|
+
PushUnregisterResponseSchema,
|
|
6444
6866
|
RpcErrorMessageSchema,
|
|
6445
6867
|
ArtifactMessageSchema,
|
|
6446
6868
|
ArtifactUpdateMessageSchema,
|
|
@@ -6478,6 +6900,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6478
6900
|
WorktreeReattachResponseSchema,
|
|
6479
6901
|
FetchAgentResponseMessageSchema,
|
|
6480
6902
|
FetchAgentTimelineResponseMessageSchema,
|
|
6903
|
+
AgentTimelineListPromptsResponseMessageSchema,
|
|
6481
6904
|
ProviderSubagentListResponseMessageSchema,
|
|
6482
6905
|
ProviderSubagentTimelineResponseMessageSchema,
|
|
6483
6906
|
ProviderSubagentUpdateMessageSchema,
|
|
@@ -6538,6 +6961,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6538
6961
|
SetAgentModelResponseMessageSchema,
|
|
6539
6962
|
SetAgentThinkingResponseMessageSchema,
|
|
6540
6963
|
SetAgentFeatureResponseMessageSchema,
|
|
6964
|
+
AgentConfigApplyResponseMessageSchema,
|
|
6541
6965
|
AgentDetachResponseMessageSchema,
|
|
6542
6966
|
AgentWorkspaceTransferResponseMessageSchema,
|
|
6543
6967
|
AgentQueueRemoveResponseMessageSchema,
|
|
@@ -6557,6 +6981,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6557
6981
|
ProjectRenameResponseSchema,
|
|
6558
6982
|
KanbanProjectTargetSetResponseSchema,
|
|
6559
6983
|
ProjectUpdatedNotificationSchema,
|
|
6984
|
+
ProjectIconSetResponseSchema,
|
|
6560
6985
|
ProjectRemoveResponseSchema,
|
|
6561
6986
|
ProjectLinksListResponseSchema,
|
|
6562
6987
|
ProjectLinksSetResponseSchema,
|
|
@@ -6647,6 +7072,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6647
7072
|
CheckoutPushResponseSchema,
|
|
6648
7073
|
CheckoutRefreshResponseSchema,
|
|
6649
7074
|
CheckoutGitFetchResponseSchema,
|
|
7075
|
+
CheckoutDiscardChangesResponseSchema,
|
|
6650
7076
|
CheckoutPrCreateResponseSchema,
|
|
6651
7077
|
CheckoutPrMergeResponseSchema,
|
|
6652
7078
|
CheckoutForgeSetAutoMergeResponseSchema,
|
|
@@ -6688,8 +7114,13 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
6688
7114
|
FileUnsubscribeResponseSchema,
|
|
6689
7115
|
FsFileWriteResponseSchema,
|
|
6690
7116
|
FsFileWriteBinaryResponseSchema,
|
|
7117
|
+
FileEntryCreateResponseSchema,
|
|
7118
|
+
FileEntryRenameResponseSchema,
|
|
7119
|
+
FileEntryDuplicateResponseSchema,
|
|
7120
|
+
FileEntryDeleteResponseSchema,
|
|
6691
7121
|
FileUpdateSchema,
|
|
6692
7122
|
ProjectIconResponseSchema,
|
|
7123
|
+
ProjectIconGetResponseSchema,
|
|
6693
7124
|
FileDownloadTokenResponseSchema,
|
|
6694
7125
|
FileUploadResponseSchema,
|
|
6695
7126
|
FileWriteResponseSchema,
|
|
@@ -6824,6 +7255,7 @@ export const WSHelloMessageSchema = z.object({
|
|
|
6824
7255
|
[CLIENT_CAPS.terminalReflowableSnapshot]: z.boolean().optional(),
|
|
6825
7256
|
[CLIENT_CAPS.providerSubagents]: z.boolean().optional(),
|
|
6826
7257
|
[CLIENT_CAPS.projectUpdates]: z.boolean().optional(),
|
|
7258
|
+
[CLIENT_CAPS.compactProviderSnapshots]: z.boolean().optional(),
|
|
6827
7259
|
[CLIENT_CAPS.browserHost]: BrowserAutomationHostCapabilitySchema.optional(),
|
|
6828
7260
|
})
|
|
6829
7261
|
.passthrough()
|