@getpaseo/protocol 0.4.0 → 0.5.0-beta.2

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/messages.js CHANGED
@@ -5,6 +5,7 @@ import { AGENT_LIFECYCLE_STATUSES } from "./agent-lifecycle.js";
5
5
  import { MAX_EXPLICIT_AGENT_TITLE_CHARS } from "./agent-title-limits.js";
6
6
  import { AgentProviderSchema } from "./provider-manifest.js";
7
7
  import { TOOL_CALL_ICON_NAMES } from "./agent-types.js";
8
+ import { WORKSPACE_LABEL_COLORS } from "./workspace-labels.js";
8
9
  import { ChatCreateRequestSchema, ChatListRequestSchema, ChatInspectRequestSchema, ChatDeleteRequestSchema, ChatPostRequestSchema, ChatReadRequestSchema, ChatWaitRequestSchema, ChatCreateResponseSchema, ChatListResponseSchema, ChatInspectResponseSchema, ChatDeleteResponseSchema, ChatPostResponseSchema, ChatReadResponseSchema, ChatWaitResponseSchema, } from "./chat/rpc-schemas.js";
9
10
  import { ScheduleCreateRequestSchema, ScheduleListRequestSchema, ScheduleInspectRequestSchema, ScheduleLogsRequestSchema, SchedulePauseRequestSchema, ScheduleResumeRequestSchema, ScheduleDeleteRequestSchema, ScheduleRunOnceRequestSchema, ScheduleUpdateRequestSchema, ScheduleCreateResponseSchema, ScheduleListResponseSchema, ScheduleInspectResponseSchema, ScheduleLogsResponseSchema, SchedulePauseResponseSchema, ScheduleResumeResponseSchema, ScheduleDeleteResponseSchema, ScheduleRunOnceResponseSchema, ScheduleUpdateResponseSchema, } from "./schedule/rpc-schemas.js";
10
11
  import { LoopRunRequestSchema, LoopListRequestSchema, LoopInspectRequestSchema, LoopLogsRequestSchema, LoopStopRequestSchema, LoopRunResponseSchema, LoopListResponseSchema, LoopInspectResponseSchema, LoopLogsResponseSchema, LoopStopResponseSchema, } from "./loop/rpc-schemas.js";
@@ -86,15 +87,45 @@ const MutableRelayConfigSchema = z
86
87
  enabled: z.boolean(),
87
88
  })
88
89
  .passthrough();
90
+ export const PluginIdSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
91
+ export const DirectoryPluginSourceSchema = z
92
+ .object({
93
+ source: z.literal("directory"),
94
+ path: z.string().min(1),
95
+ enabled: z.boolean().optional(),
96
+ })
97
+ .strict();
98
+ export const PluginSourceSchema = z.discriminatedUnion("source", [DirectoryPluginSourceSchema]);
99
+ export const AgentSkillSelectionSchema = z.discriminatedUnion("mode", [
100
+ z.object({ mode: z.literal("all") }).strict(),
101
+ z.object({ mode: z.literal("custom"), skills: z.array(z.string()) }).strict(),
102
+ ]);
89
103
  export const MutableDaemonConfigSchema = z
90
104
  .object({
91
105
  // COMPAT(relayConfig): added in v0.2.6, remove after 2027-01-31 when old daemons are unsupported.
92
106
  relay: MutableRelayConfigSchema.optional(),
93
107
  mcp: z
94
108
  .object({
109
+ enabled: z.boolean().optional(),
95
110
  injectIntoAgents: z.boolean(),
96
111
  })
97
112
  .passthrough(),
113
+ hostnames: z.union([z.literal(true), z.array(z.string())]).optional(),
114
+ cors: z
115
+ .object({
116
+ allowedOrigins: z.array(z.string()),
117
+ })
118
+ .passthrough()
119
+ .optional(),
120
+ trustedProxies: z.union([z.literal(true), z.array(z.string())]).optional(),
121
+ git: z
122
+ .object({
123
+ maxProcessesPerSecond: z.number().int().positive(),
124
+ maxProcessConcurrency: z.number().int().positive(),
125
+ })
126
+ .optional(),
127
+ app: z.object({ baseUrl: z.string() }).optional(),
128
+ catalogRefreshTimeoutMs: z.number().int().positive().optional(),
98
129
  browserTools: MutableBrowserToolsConfigSchema.default({ enabled: false }),
99
130
  providers: z.record(z.string(), MutableDaemonProviderConfigSchema).default({}),
100
131
  metadataGeneration: MutableMetadataGenerationConfigSchema.default({ providers: [] }),
@@ -103,12 +134,15 @@ export const MutableDaemonConfigSchema = z
103
134
  appendSystemPrompt: z.string().default(""),
104
135
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
105
136
  agentProfiles: z.array(AgentProfileSchema).optional(),
137
+ skills: z.object({ selection: AgentSkillSelectionSchema.optional() }).strict().optional(),
138
+ pluginsEnabled: z.boolean().optional(),
139
+ plugins: z.record(PluginIdSchema, PluginSourceSchema).optional(),
106
140
  })
107
141
  .passthrough();
108
142
  export const MutableDaemonConfigPatchSchema = z
109
143
  .object({
110
144
  relay: MutableRelayConfigSchema.partial().optional(),
111
- mcp: MutableDaemonConfigSchema.shape.mcp.partial().optional(),
145
+ mcp: z.object({ injectIntoAgents: z.boolean().optional() }).passthrough().optional(),
112
146
  browserTools: MutableBrowserToolsConfigSchema.partial().optional(),
113
147
  providers: z
114
148
  .record(z.string(), MutableDaemonProviderConfigSchema.partial().passthrough())
@@ -120,6 +154,8 @@ export const MutableDaemonConfigPatchSchema = z
120
154
  appendSystemPrompt: z.string().optional(),
121
155
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
122
156
  agentProfiles: z.array(AgentProfileSchema).optional(),
157
+ pluginsEnabled: z.boolean().optional(),
158
+ plugins: z.record(PluginIdSchema, PluginSourceSchema).optional(),
123
159
  })
124
160
  .partial()
125
161
  .passthrough();
@@ -554,6 +590,7 @@ export const AgentStreamEventPayloadSchema = z.discriminatedUnion("type", [
554
590
  type: z.literal("timeline"),
555
591
  provider: AgentProviderSchema,
556
592
  item: AgentTimelineItemPayloadSchema,
593
+ turnId: z.string().optional(),
557
594
  }),
558
595
  z.object({
559
596
  type: z.literal("permission_requested"),
@@ -750,6 +787,50 @@ export const WorkspacePinSetRequestSchema = z.object({
750
787
  pinned: z.boolean(),
751
788
  requestId: z.string(),
752
789
  });
790
+ export const WorkspaceLabelColorSchema = z.enum(WORKSPACE_LABEL_COLORS);
791
+ export const WorkspaceLabelDefinitionSchema = z.object({
792
+ name: z.string(),
793
+ color: WorkspaceLabelColorSchema,
794
+ });
795
+ const WorkspaceLabelSyncCursorSchema = z.object({
796
+ generation: z.string(),
797
+ afterSeq: z.number().int().nonnegative(),
798
+ });
799
+ export const WorkspaceLabelListRequestSchema = z.object({
800
+ type: z.literal("workspace.label.list.request"),
801
+ requestId: z.string(),
802
+ subscribe: z.object({ subscriptionId: z.string() }),
803
+ sync: WorkspaceLabelSyncCursorSchema.optional(),
804
+ });
805
+ export const WorkspaceLabelAssignmentSetRequestSchema = z.object({
806
+ type: z.literal("workspace.label.assignment.set.request"),
807
+ requestId: z.string(),
808
+ workspaceId: z.string(),
809
+ label: WorkspaceLabelDefinitionSchema,
810
+ assigned: z.boolean(),
811
+ });
812
+ /**
813
+ * Editing a label is one operation. A name and a colour are two fields of one thing, and two
814
+ * RPCs can land half-applied — leaving the catalog in a state the user never asked for and the
815
+ * UI with nothing true to say. Both fields are optional; omitting one leaves it alone.
816
+ */
817
+ export const WorkspaceLabelUpdateRequestSchema = z.object({
818
+ type: z.literal("workspace.label.update.request"),
819
+ requestId: z.string(),
820
+ name: z.string(),
821
+ newName: z.string().optional(),
822
+ color: WorkspaceLabelColorSchema.optional(),
823
+ });
824
+ export const WorkspaceLabelDeleteRequestSchema = z.object({
825
+ type: z.literal("workspace.label.delete.request"),
826
+ requestId: z.string(),
827
+ name: z.string(),
828
+ });
829
+ export const WorkspaceLabelDeleteInspectRequestSchema = z.object({
830
+ type: z.literal("workspace.label.delete.inspect.request"),
831
+ requestId: z.string(),
832
+ name: z.string(),
833
+ });
753
834
  export const WorkspaceRecoveryInspectRequestSchema = z.object({
754
835
  type: z.literal("workspace.recovery.inspect.request"),
755
836
  workspaceId: z.string(),
@@ -806,6 +887,15 @@ export const ForgeIssueAttachmentSchema = z.object({
806
887
  body: z.string().nullable().optional(),
807
888
  projectPath: z.string().optional(),
808
889
  });
890
+ export const ExternalResourceAttachmentMetadataSchema = z.object({
891
+ provider: z.string(),
892
+ providerLabel: z.string(),
893
+ resourceType: z.string(),
894
+ id: z.string(),
895
+ identifier: z.string(),
896
+ title: z.string(),
897
+ url: z.string(),
898
+ });
809
899
  export const TextAttachmentSchema = z
810
900
  .object({
811
901
  type: z.literal("text"),
@@ -813,6 +903,7 @@ export const TextAttachmentSchema = z
813
903
  contextKind: z.string().optional(),
814
904
  title: z.string().nullable().optional(),
815
905
  text: z.string(),
906
+ externalResource: ExternalResourceAttachmentMetadataSchema.optional(),
816
907
  })
817
908
  .transform(({ contextKind, ...attachment }) => ({
818
909
  ...attachment,
@@ -884,17 +975,36 @@ const ImageAttachmentSchema = z.object({
884
975
  data: z.string(), // base64 encoded image
885
976
  mimeType: z.string(), // e.g., "image/jpeg", "image/png"
886
977
  });
978
+ export const ActiveTurnBehaviorSchema = z.enum(["interrupt", "steer"]);
887
979
  export const SendAgentMessageSchema = z.object({
888
980
  type: z.literal("send_agent_message"),
889
981
  agentId: z.string(),
890
982
  text: z.string(),
891
983
  messageId: z.string().optional(), // Client-provided ID for deduplication
984
+ activeTurnBehavior: ActiveTurnBehaviorSchema.optional(),
892
985
  images: z.array(ImageAttachmentSchema).optional(),
893
986
  attachments: AgentAttachmentsSchema,
894
987
  });
895
988
  // ============================================================================
896
989
  // Agent RPCs (requestId-correlated)
897
990
  // ============================================================================
991
+ const DirectorySyncRequestSchema = z.object({
992
+ generation: z.string().optional(),
993
+ afterSeq: z.number().int().nonnegative().optional(),
994
+ });
995
+ const DirectorySyncRemovalSchema = z.object({
996
+ id: z.string(),
997
+ seq: z.number().int().positive(),
998
+ });
999
+ const DirectorySyncMetadataSchema = z.object({
1000
+ generation: z.string(),
1001
+ headSeq: z.number().int().nonnegative(),
1002
+ mode: z.enum(["snapshot", "changes"]),
1003
+ reason: z
1004
+ .enum(["no_cursor", "generation_changed", "cursor_expired", "changes_too_large"])
1005
+ .optional(),
1006
+ removals: z.array(DirectorySyncRemovalSchema),
1007
+ });
898
1008
  export const FetchAgentsRequestMessageSchema = z.object({
899
1009
  type: z.literal("fetch_agents_request"),
900
1010
  requestId: z.string(),
@@ -917,6 +1027,8 @@ export const FetchAgentsRequestMessageSchema = z.object({
917
1027
  subscriptionId: z.string().optional(),
918
1028
  })
919
1029
  .optional(),
1030
+ // COMPAT(directorySync): added in v0.3.x, remove optional after 2027-02-12.
1031
+ sync: DirectorySyncRequestSchema.optional(),
920
1032
  });
921
1033
  const WorkspaceStateBucketSchema = z.enum([
922
1034
  "needs_input",
@@ -953,10 +1065,14 @@ export const FetchWorkspacesRequestMessageSchema = z.object({
953
1065
  subscriptionId: z.string().optional(),
954
1066
  })
955
1067
  .optional(),
1068
+ // COMPAT(directorySync): added in v0.3.x, remove optional after 2027-02-12.
1069
+ sync: DirectorySyncRequestSchema.optional(),
956
1070
  });
957
1071
  export const ProjectListRequestMessageSchema = z.object({
958
1072
  type: z.literal("project.list.request"),
959
1073
  requestId: z.string(),
1074
+ // COMPAT(directorySync): added in v0.3.x, remove optional after 2027-02-12.
1075
+ sync: DirectorySyncRequestSchema.optional(),
960
1076
  });
961
1077
  export const FetchAgentHistoryRequestMessageSchema = z.object({
962
1078
  type: z.literal("fetch_agent_history_request"),
@@ -1000,6 +1116,7 @@ export const SendAgentMessageRequestSchema = z.object({
1000
1116
  agentId: z.string(),
1001
1117
  text: z.string(),
1002
1118
  messageId: z.string().optional(), // Client-provided ID for deduplication
1119
+ activeTurnBehavior: ActiveTurnBehaviorSchema.optional(),
1003
1120
  images: z.array(ImageAttachmentSchema).optional(),
1004
1121
  attachments: AgentAttachmentsSchema,
1005
1122
  });
@@ -1018,6 +1135,10 @@ export const DaemonGetPairingOfferRequestSchema = z.object({
1018
1135
  type: z.literal("daemon.get_pairing_offer.request"),
1019
1136
  requestId: z.string(),
1020
1137
  });
1138
+ export const DaemonConfigReloadRequestSchema = z.object({
1139
+ type: z.literal("daemon.config.reload.request"),
1140
+ requestId: z.string(),
1141
+ });
1021
1142
  export const HubManagementDaemonConnectRequestSchema = z.object({
1022
1143
  type: z.literal("hub.management.daemon.connect.request"),
1023
1144
  requestId: z.string(),
@@ -1037,6 +1158,81 @@ export const DiagnosticsRequestSchema = z.object({
1037
1158
  type: z.literal("diagnostics.request"),
1038
1159
  requestId: z.string(),
1039
1160
  });
1161
+ export const PluginCatalogGetRequestSchema = z.object({
1162
+ type: z.literal("plugin.catalog.get.request"),
1163
+ requestId: z.string(),
1164
+ });
1165
+ export const PluginListRequestSchema = z.object({
1166
+ type: z.literal("plugin.list.request"),
1167
+ requestId: z.string(),
1168
+ });
1169
+ export const PluginLogsGetRequestSchema = z.object({
1170
+ type: z.literal("plugin.logs.get.request"),
1171
+ requestId: z.string(),
1172
+ pluginId: PluginIdSchema,
1173
+ });
1174
+ export const PluginDirectoryInstallRequestSchema = z.object({
1175
+ type: z.literal("plugin.directory.install.request"),
1176
+ requestId: z.string(),
1177
+ path: z.string().min(1),
1178
+ id: PluginIdSchema.optional(),
1179
+ });
1180
+ export const PluginDirectoryInspectRequestSchema = z.object({
1181
+ type: z.literal("plugin.directory.inspect.request"),
1182
+ requestId: z.string(),
1183
+ path: z.string().min(1),
1184
+ });
1185
+ function pluginIdRequest(type) {
1186
+ return z.object({ type: z.literal(type), requestId: z.string(), pluginId: PluginIdSchema });
1187
+ }
1188
+ export const PluginReloadRequestSchema = pluginIdRequest("plugin.reload.request");
1189
+ export const PluginEnableRequestSchema = pluginIdRequest("plugin.enable.request");
1190
+ export const PluginDisableRequestSchema = pluginIdRequest("plugin.disable.request");
1191
+ export const PluginRemoveRequestSchema = pluginIdRequest("plugin.remove.request");
1192
+ export const PluginRpcInvokeRequestSchema = z.object({
1193
+ type: z.literal("plugin.rpc.invoke.request"),
1194
+ requestId: z.string(),
1195
+ pluginId: PluginIdSchema,
1196
+ method: z.string().min(1),
1197
+ input: z.unknown(),
1198
+ });
1199
+ export const AgentSkillOperationSchema = z.discriminatedUnion("kind", [
1200
+ z.object({ kind: z.literal("add"), name: z.string() }).strict(),
1201
+ z.object({ kind: z.literal("update"), name: z.string() }).strict(),
1202
+ z.object({ kind: z.literal("delete"), name: z.string() }).strict(),
1203
+ ]);
1204
+ export const AgentSkillsStatusSchema = z.object({
1205
+ state: z.enum(["not-installed", "up-to-date", "drift"]),
1206
+ ops: z.array(AgentSkillOperationSchema),
1207
+ available: z.array(z.string()),
1208
+ installed: z.array(z.string()),
1209
+ selection: AgentSkillSelectionSchema,
1210
+ });
1211
+ export const AgentSkillsConfirmationSchema = z.object({ removals: z.array(z.string()) }).strict();
1212
+ export const AgentSkillsSaveResultSchema = AgentSkillsStatusSchema.extend({
1213
+ confirmationRequired: AgentSkillsConfirmationSchema.nullable(),
1214
+ });
1215
+ function agentSkillsRequest(type) {
1216
+ return z.object({ type: z.literal(type), requestId: z.string() }).strict();
1217
+ }
1218
+ export const AgentSkillsGetStatusRequestSchema = agentSkillsRequest("agent.skills.get_status.request");
1219
+ export const AgentSkillsReconcileRequestSchema = agentSkillsRequest("agent.skills.reconcile.request");
1220
+ export const AgentSkillsUninstallRequestSchema = agentSkillsRequest("agent.skills.uninstall.request");
1221
+ export const AgentSkillsSaveSelectionRequestSchema = z
1222
+ .object({
1223
+ type: z.literal("agent.skills.save_selection.request"),
1224
+ requestId: z.string(),
1225
+ selection: AgentSkillSelectionSchema,
1226
+ confirmedRemovals: z.array(z.string()).optional(),
1227
+ })
1228
+ .strict();
1229
+ export const AgentSkillsImportLegacySelectionRequestSchema = z
1230
+ .object({
1231
+ type: z.literal("agent.skills.import_legacy_selection.request"),
1232
+ requestId: z.string(),
1233
+ selection: AgentSkillSelectionSchema,
1234
+ })
1235
+ .strict();
1040
1236
  export const GetDaemonConfigRequestMessageSchema = z.object({
1041
1237
  type: z.literal("get_daemon_config_request"),
1042
1238
  requestId: z.string(),
@@ -2300,6 +2496,11 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2300
2496
  ProjectRemoveRequestSchema,
2301
2497
  WorkspaceTitleSetRequestSchema,
2302
2498
  WorkspacePinSetRequestSchema,
2499
+ WorkspaceLabelListRequestSchema,
2500
+ WorkspaceLabelAssignmentSetRequestSchema,
2501
+ WorkspaceLabelUpdateRequestSchema,
2502
+ WorkspaceLabelDeleteRequestSchema,
2503
+ WorkspaceLabelDeleteInspectRequestSchema,
2303
2504
  WorkspaceRecoveryInspectRequestSchema,
2304
2505
  WorkspaceRecoveryRestoreRequestSchema,
2305
2506
  SetVoiceModeMessageSchema,
@@ -2307,10 +2508,26 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2307
2508
  WaitForFinishRequestSchema,
2308
2509
  DaemonGetStatusRequestSchema,
2309
2510
  DaemonGetPairingOfferRequestSchema,
2511
+ DaemonConfigReloadRequestSchema,
2310
2512
  HubManagementDaemonConnectRequestSchema,
2311
2513
  HubManagementDaemonGetStatusRequestSchema,
2312
2514
  HubManagementDaemonDisconnectRequestSchema,
2313
2515
  DiagnosticsRequestSchema,
2516
+ PluginCatalogGetRequestSchema,
2517
+ PluginListRequestSchema,
2518
+ PluginLogsGetRequestSchema,
2519
+ PluginDirectoryInstallRequestSchema,
2520
+ PluginDirectoryInspectRequestSchema,
2521
+ PluginReloadRequestSchema,
2522
+ PluginEnableRequestSchema,
2523
+ PluginDisableRequestSchema,
2524
+ PluginRemoveRequestSchema,
2525
+ PluginRpcInvokeRequestSchema,
2526
+ AgentSkillsGetStatusRequestSchema,
2527
+ AgentSkillsReconcileRequestSchema,
2528
+ AgentSkillsUninstallRequestSchema,
2529
+ AgentSkillsSaveSelectionRequestSchema,
2530
+ AgentSkillsImportLegacySelectionRequestSchema,
2314
2531
  GetDaemonConfigRequestMessageSchema,
2315
2532
  SetDaemonConfigRequestMessageSchema,
2316
2533
  ReadProjectConfigRequestMessageSchema,
@@ -2594,6 +2811,10 @@ export const ServerInfoStatusPayloadSchema = z
2594
2811
  providersSnapshot: z.boolean().optional(),
2595
2812
  // COMPAT(providersSnapshotCwd): added in v0.3.2, remove gate after 2027-02-10.
2596
2813
  providersSnapshotCwd: z.boolean().optional(),
2814
+ // COMPAT(directorySync): added in v0.3.x, remove gate after 2027-02-12.
2815
+ directorySync: z.boolean().optional(),
2816
+ // COMPAT(workspaceLabels): added in v0.5.0, remove after 2027-08-14.
2817
+ workspaceLabels: z.boolean().optional(),
2597
2818
  // COMPAT(checkoutForgeSetAutoMerge): added in v0.1.106, remove old
2598
2819
  // checkoutGithubSetAutoMerge fallback after 2026-12-28.
2599
2820
  checkoutForgeSetAutoMerge: z.boolean().optional(),
@@ -2606,10 +2827,20 @@ export const ServerInfoStatusPayloadSchema = z
2606
2827
  forgeSearch: z.boolean().optional(),
2607
2828
  // COMPAT(daemonStatusRpc): added in v0.1.76, remove gate after 2026-11-18.
2608
2829
  daemonStatusRpc: z.boolean().optional(),
2830
+ // COMPAT(daemonConfigReload): added in v0.4.0, remove gate after 2027-02-14.
2831
+ daemonConfigReload: z.boolean().optional(),
2609
2832
  // COMPAT(relayConfig): added in v0.2.6, remove gate after 2027-01-31.
2610
2833
  relayConfig: z.boolean().optional(),
2611
2834
  // COMPAT(pushTokenRevocation): added in v0.3.2, remove gate after 2027-02-10.
2612
2835
  pushTokenRevocation: z.boolean().optional(),
2836
+ // COMPAT(plugins): added in v0.3.0, remove gate after 2027-08-07.
2837
+ plugins: z.boolean().optional(),
2838
+ // COMPAT(pluginManagement): added in v0.4.0, remove gate after 2027-08-14.
2839
+ pluginManagement: z.boolean().optional(),
2840
+ // COMPAT(pluginLogs): added in v0.4.0, remove gate after 2027-08-16.
2841
+ pluginLogs: z.boolean().optional(),
2842
+ // COMPAT(skillManagement): added in v0.4.0, remove gate after 2027-08-16.
2843
+ skillManagement: z.boolean().optional(),
2613
2844
  // COMPAT(terminalRestoreModes): added in v0.1.81, remove gate after 2026-11-23.
2614
2845
  "terminal-restore-modes": z.boolean().optional(),
2615
2846
  // COMPAT(terminalInputModeReplay): added in v0.2.6, remove gate after 2027-02-02.
@@ -2783,6 +3014,10 @@ export const DaemonConfigChangedStatusPayloadSchema = z
2783
3014
  config: MutableDaemonConfigSchema,
2784
3015
  })
2785
3016
  .passthrough();
3017
+ export const PluginCatalogChangedStatusPayloadSchema = z.object({
3018
+ status: z.literal("plugin_catalog_changed"),
3019
+ pluginId: PluginIdSchema,
3020
+ });
2786
3021
  export const KnownStatusPayloadSchema = z.discriminatedUnion("status", [
2787
3022
  AgentCreatedStatusPayloadSchema,
2788
3023
  AgentCreateFailedStatusPayloadSchema,
@@ -2791,6 +3026,7 @@ export const KnownStatusPayloadSchema = z.discriminatedUnion("status", [
2791
3026
  ShutdownRequestedStatusPayloadSchema,
2792
3027
  RestartRequestedStatusPayloadSchema,
2793
3028
  DaemonConfigChangedStatusPayloadSchema,
3029
+ PluginCatalogChangedStatusPayloadSchema,
2794
3030
  ]);
2795
3031
  export const ArtifactMessageSchema = z.object({
2796
3032
  type: z.literal("artifact"),
@@ -2888,7 +3124,7 @@ const WorkspaceGitRuntimePayloadSchema = z
2888
3124
  })
2889
3125
  .optional()
2890
3126
  .nullable();
2891
- const WorkspaceGitHubRuntimePayloadSchema = z
3127
+ export const WorkspaceGitHubRuntimePayloadSchema = z
2892
3128
  .object({
2893
3129
  featuresEnabled: z.boolean().optional(),
2894
3130
  pullRequest: z
@@ -2959,6 +3195,8 @@ export const WorkspaceDescriptorPayloadSchema = z
2959
3195
  title: z.string().nullable().optional(),
2960
3196
  // COMPAT(workspacePinning): added in v0.1.107, remove optional after 2027-01-12.
2961
3197
  pinnedAt: z.string().nullable().optional(),
3198
+ // COMPAT(workspaceLabels): added in v0.5.0, remove optional after 2027-08-14.
3199
+ labels: z.array(z.string()).optional(),
2962
3200
  archivingAt: z.string().nullable().optional().default(null),
2963
3201
  status: WorkspaceStateBucketSchema,
2964
3202
  // Best-effort workspace status entry timestamp. Old daemons omit the
@@ -2985,6 +3223,8 @@ export const WorkspaceDescriptorPayloadSchema = z
2985
3223
  // Old daemons omit it; absent means the client falls back to GitHub.
2986
3224
  forge: z.string().optional(),
2987
3225
  project: ProjectPlacementPayloadSchema.optional(),
3226
+ // COMPAT(directorySync): sequence of this latest directory projection.
3227
+ syncSeq: z.number().int().positive().optional(),
2988
3228
  })
2989
3229
  .transform((workspace) => ({
2990
3230
  ...workspace,
@@ -2997,10 +3237,14 @@ export const AgentUpdateMessageSchema = z.object({
2997
3237
  kind: z.literal("upsert"),
2998
3238
  agent: AgentSnapshotPayloadSchema,
2999
3239
  project: ProjectPlacementPayloadSchema.nullable().optional(),
3240
+ generation: z.string().optional(),
3241
+ seq: z.number().int().positive().optional(),
3000
3242
  }),
3001
3243
  z.object({
3002
3244
  kind: z.literal("remove"),
3003
3245
  agentId: z.string(),
3246
+ generation: z.string().optional(),
3247
+ seq: z.number().int().positive().optional(),
3004
3248
  }),
3005
3249
  ]),
3006
3250
  });
@@ -3048,6 +3292,8 @@ const AgentDirectoryResponseEntrySchema = z.object({
3048
3292
  // anyway; sending it keeps the client from re-deriving a second opinion that
3049
3293
  // could disagree with the ranking it is explaining.
3050
3294
  searchMatches: z.array(AgentSearchMatchSchema).optional(),
3295
+ // COMPAT(directorySync): sequence of this latest directory projection.
3296
+ syncSeq: z.number().int().positive().optional(),
3051
3297
  });
3052
3298
  const AgentDirectoryPageInfoSchema = z.object({
3053
3299
  nextCursor: z.string().nullable(),
@@ -3061,6 +3307,7 @@ export const FetchAgentsResponseMessageSchema = z.object({
3061
3307
  subscriptionId: z.string().nullable().optional(),
3062
3308
  entries: z.array(AgentDirectoryResponseEntrySchema),
3063
3309
  pageInfo: AgentDirectoryPageInfoSchema,
3310
+ sync: DirectorySyncMetadataSchema.optional(),
3064
3311
  }),
3065
3312
  });
3066
3313
  export const FetchAgentHistoryResponseMessageSchema = z.object({
@@ -3095,8 +3342,14 @@ export const WorkspaceProjectDescriptorPayloadSchema = z.object({
3095
3342
  projectCustomName: z.string().nullable().optional(),
3096
3343
  // COMPAT(projectCustomIcon): added in v0.2.0, remove after 2027-01-20.
3097
3344
  projectCustomIconRevision: z.string().nullable().optional(),
3345
+ // Fingerprints the effective icon, including automatic discovery and the
3346
+ // absence of an icon. Clients may persist icon results against this value.
3347
+ // COMPAT(projectIconCache): added in v0.2.7, remove optional after 2027-02-12.
3348
+ projectIconRevision: z.string().optional(),
3098
3349
  projectRootPath: z.string(),
3099
3350
  projectKind: z.enum(["git", "non_git", "directory"]),
3351
+ // COMPAT(directorySync): sequence of this latest directory projection.
3352
+ syncSeq: z.number().int().positive().optional(),
3100
3353
  });
3101
3354
  export const FetchWorkspacesResponseMessageSchema = z.object({
3102
3355
  type: z.literal("fetch_workspaces_response"),
@@ -3113,6 +3366,7 @@ export const FetchWorkspacesResponseMessageSchema = z.object({
3113
3366
  prevCursor: z.string().nullable(),
3114
3367
  hasMore: z.boolean(),
3115
3368
  }),
3369
+ sync: DirectorySyncMetadataSchema.optional(),
3116
3370
  }),
3117
3371
  });
3118
3372
  export const WorkspaceUpdateMessageSchema = z.object({
@@ -3121,6 +3375,8 @@ export const WorkspaceUpdateMessageSchema = z.object({
3121
3375
  z.object({
3122
3376
  kind: z.literal("upsert"),
3123
3377
  workspace: WorkspaceDescriptorPayloadSchema,
3378
+ generation: z.string().optional(),
3379
+ seq: z.number().int().positive().optional(),
3124
3380
  }),
3125
3381
  z.object({
3126
3382
  kind: z.literal("remove"),
@@ -3135,14 +3391,88 @@ export const WorkspaceUpdateMessageSchema = z.object({
3135
3391
  // Project removal is represented on the existing workspace update channel
3136
3392
  // so old clients can still parse the message and ignore the extra field.
3137
3393
  removedProjectId: z.string().optional(),
3394
+ generation: z.string().optional(),
3395
+ seq: z.number().int().positive().optional(),
3138
3396
  }),
3139
3397
  ]),
3140
3398
  });
3399
+ const WorkspaceLabelSyncMetadataSchema = z.object({
3400
+ mode: z.enum(["snapshot", "changes"]),
3401
+ generation: z.string(),
3402
+ headSeq: z.number().int().nonnegative(),
3403
+ removals: z.array(z.object({ name: z.string(), seq: z.number().int().positive() })),
3404
+ });
3405
+ export const WorkspaceLabelListResponseSchema = z.object({
3406
+ type: z.literal("workspace.label.list.response"),
3407
+ payload: z.object({
3408
+ requestId: z.string(),
3409
+ labels: z.array(WorkspaceLabelDefinitionSchema),
3410
+ sync: WorkspaceLabelSyncMetadataSchema,
3411
+ }),
3412
+ });
3413
+ export const WorkspaceLabelUpdateSchema = z.object({
3414
+ type: z.literal("workspace.label.update"),
3415
+ payload: z.discriminatedUnion("kind", [
3416
+ z.object({
3417
+ kind: z.literal("upsert"),
3418
+ label: WorkspaceLabelDefinitionSchema,
3419
+ previousName: z.string().optional(),
3420
+ generation: z.string(),
3421
+ seq: z.number().int().positive(),
3422
+ }),
3423
+ z.object({
3424
+ kind: z.literal("remove"),
3425
+ name: z.string(),
3426
+ generation: z.string(),
3427
+ seq: z.number().int().positive(),
3428
+ }),
3429
+ ]),
3430
+ });
3431
+ export const WorkspaceLabelAssignmentSetResponseSchema = z.object({
3432
+ type: z.literal("workspace.label.assignment.set.response"),
3433
+ payload: z.object({
3434
+ requestId: z.string(),
3435
+ label: WorkspaceLabelDefinitionSchema,
3436
+ workspaceLabels: z.array(z.string()),
3437
+ }),
3438
+ });
3439
+ export const WorkspaceLabelUpdateResponseSchema = z.object({
3440
+ type: z.literal("workspace.label.update.response"),
3441
+ payload: z.object({
3442
+ requestId: z.string(),
3443
+ label: WorkspaceLabelDefinitionSchema,
3444
+ affectedWorkspaceCount: z.number().int().nonnegative(),
3445
+ }),
3446
+ });
3447
+ export const WorkspaceLabelDeleteResponseSchema = z.object({
3448
+ type: z.literal("workspace.label.delete.response"),
3449
+ payload: z.object({
3450
+ requestId: z.string(),
3451
+ affectedWorkspaceCount: z.number().int().nonnegative(),
3452
+ }),
3453
+ });
3454
+ export const WorkspaceLabelDeleteInspectResponseSchema = z.object({
3455
+ type: z.literal("workspace.label.delete.inspect.response"),
3456
+ payload: z.object({
3457
+ requestId: z.string(),
3458
+ affectedWorkspaceCount: z.number().int().nonnegative(),
3459
+ }),
3460
+ });
3141
3461
  export const ProjectUpdateMessageSchema = z.object({
3142
3462
  type: z.literal("project.update"),
3143
3463
  payload: z.discriminatedUnion("kind", [
3144
- z.object({ kind: z.literal("upsert"), project: WorkspaceProjectDescriptorPayloadSchema }),
3145
- z.object({ kind: z.literal("remove"), projectId: z.string() }),
3464
+ z.object({
3465
+ kind: z.literal("upsert"),
3466
+ project: WorkspaceProjectDescriptorPayloadSchema,
3467
+ generation: z.string().optional(),
3468
+ seq: z.number().int().positive().optional(),
3469
+ }),
3470
+ z.object({
3471
+ kind: z.literal("remove"),
3472
+ projectId: z.string(),
3473
+ generation: z.string().optional(),
3474
+ seq: z.number().int().positive().optional(),
3475
+ }),
3146
3476
  ]),
3147
3477
  });
3148
3478
  export const ProjectListResponseMessageSchema = z.object({
@@ -3150,6 +3480,7 @@ export const ProjectListResponseMessageSchema = z.object({
3150
3480
  payload: z.object({
3151
3481
  requestId: z.string(),
3152
3482
  projects: z.array(WorkspaceProjectDescriptorPayloadSchema),
3483
+ sync: DirectorySyncMetadataSchema.optional(),
3153
3484
  }),
3154
3485
  });
3155
3486
  export const ScriptStatusUpdateMessageSchema = z.object({
@@ -3338,6 +3669,7 @@ const AgentTimelineSeqRangeSchema = z.object({
3338
3669
  export const AgentTimelineEntryPayloadSchema = z.object({
3339
3670
  provider: AgentProviderSchema,
3340
3671
  item: AgentTimelineItemPayloadSchema,
3672
+ turnId: z.string().optional(),
3341
3673
  timestamp: z.string(),
3342
3674
  seqStart: z.number().int().nonnegative(),
3343
3675
  seqEnd: z.number().int().nonnegative(),
@@ -3641,6 +3973,17 @@ export const DaemonGetPairingOfferResponseSchema = z.object({
3641
3973
  })
3642
3974
  .passthrough(),
3643
3975
  });
3976
+ export const DaemonConfigReloadResponseSchema = z.object({
3977
+ type: z.literal("daemon.config.reload.response"),
3978
+ payload: z
3979
+ .object({
3980
+ requestId: z.string(),
3981
+ appliedPaths: z.array(z.string()),
3982
+ restartRequiredPaths: z.array(z.string()),
3983
+ overrideControlledPaths: z.array(z.string()),
3984
+ })
3985
+ .passthrough(),
3986
+ });
3644
3987
  export const DiagnosticsResponseSchema = z.object({
3645
3988
  type: z.literal("diagnostics.response"),
3646
3989
  payload: z
@@ -3883,6 +4226,10 @@ export const CheckoutPrStatusSchema = z.object({
3883
4226
  status: z.string(),
3884
4227
  url: z.string().nullable(),
3885
4228
  workflow: z.string().optional(),
4229
+ /**
4230
+ * Formatted by the forge adapter: how long a finished check took, or how long a
4231
+ * running one has been going. Raw timestamps stay off the wire.
4232
+ */
3886
4233
  duration: z.string().optional(),
3887
4234
  checkRunId: z.number().optional(),
3888
4235
  workflowRunId: z.number().optional(),
@@ -4928,6 +5275,91 @@ export function parseHubExecutionOutboundMessage(value) {
4928
5275
  }
4929
5276
  return message;
4930
5277
  }
5278
+ export const PluginCatalogGetResponseSchema = z.object({
5279
+ type: z.literal("plugin.catalog.get.response"),
5280
+ payload: z.object({
5281
+ requestId: z.string(),
5282
+ plugins: z.array(z.object({
5283
+ id: PluginIdSchema,
5284
+ clientBundle: z.string(),
5285
+ })),
5286
+ }),
5287
+ });
5288
+ export const PluginStatusSchema = z.enum(["running", "disabled", "failed"]);
5289
+ export const PluginListItemSchema = z.object({
5290
+ id: PluginIdSchema,
5291
+ path: z.string(),
5292
+ enabled: z.boolean(),
5293
+ status: PluginStatusSchema,
5294
+ error: z.string().optional(),
5295
+ });
5296
+ export const PluginLogEntrySchema = z.object({
5297
+ sequence: z.number().int().nonnegative(),
5298
+ timestamp: z.string().datetime(),
5299
+ stream: z.enum(["stdout", "stderr"]),
5300
+ message: z.string(),
5301
+ });
5302
+ export const PluginListResponseSchema = z.object({
5303
+ type: z.literal("plugin.list.response"),
5304
+ payload: z.object({ requestId: z.string(), plugins: z.array(PluginListItemSchema) }),
5305
+ });
5306
+ export const PluginLogsGetResponseSchema = z.object({
5307
+ type: z.literal("plugin.logs.get.response"),
5308
+ payload: z.object({
5309
+ requestId: z.string(),
5310
+ pluginId: PluginIdSchema,
5311
+ entries: z.array(PluginLogEntrySchema),
5312
+ }),
5313
+ });
5314
+ export const PluginDirectoryInstallResponseSchema = z.object({
5315
+ type: z.literal("plugin.directory.install.response"),
5316
+ payload: z.object({ requestId: z.string(), plugin: PluginListItemSchema }),
5317
+ });
5318
+ export const PluginDirectoryInspectResponseSchema = z.object({
5319
+ type: z.literal("plugin.directory.inspect.response"),
5320
+ payload: z.object({ requestId: z.string(), id: PluginIdSchema }),
5321
+ });
5322
+ function pluginActionResponse(type) {
5323
+ return z.object({
5324
+ type: z.literal(type),
5325
+ payload: z.object({ requestId: z.string(), plugin: PluginListItemSchema }),
5326
+ });
5327
+ }
5328
+ export const PluginReloadResponseSchema = pluginActionResponse("plugin.reload.response");
5329
+ export const PluginEnableResponseSchema = pluginActionResponse("plugin.enable.response");
5330
+ export const PluginDisableResponseSchema = pluginActionResponse("plugin.disable.response");
5331
+ export const PluginRemoveResponseSchema = z.object({
5332
+ type: z.literal("plugin.remove.response"),
5333
+ payload: z.object({ requestId: z.string() }).strict(),
5334
+ });
5335
+ export const PluginRpcInvokeResponseSchema = z.object({
5336
+ type: z.literal("plugin.rpc.invoke.response"),
5337
+ payload: z.object({
5338
+ requestId: z.string(),
5339
+ output: z.unknown(),
5340
+ }),
5341
+ });
5342
+ function agentSkillsStatusResponse(type) {
5343
+ return z.object({
5344
+ type: z.literal(type),
5345
+ payload: AgentSkillsStatusSchema.extend({ requestId: z.string() }),
5346
+ });
5347
+ }
5348
+ export const AgentSkillsGetStatusResponseSchema = agentSkillsStatusResponse("agent.skills.get_status.response");
5349
+ export const AgentSkillsReconcileResponseSchema = agentSkillsStatusResponse("agent.skills.reconcile.response");
5350
+ export const AgentSkillsUninstallResponseSchema = agentSkillsStatusResponse("agent.skills.uninstall.response");
5351
+ export const AgentSkillsSaveSelectionResponseSchema = z.object({
5352
+ type: z.literal("agent.skills.save_selection.response"),
5353
+ payload: AgentSkillsSaveResultSchema.extend({ requestId: z.string() }),
5354
+ });
5355
+ export const AgentSkillsImportLegacySelectionResponseSchema = z.object({
5356
+ type: z.literal("agent.skills.import_legacy_selection.response"),
5357
+ payload: z.object({
5358
+ requestId: z.string(),
5359
+ imported: z.boolean(),
5360
+ selection: AgentSkillSelectionSchema,
5361
+ }),
5362
+ });
4931
5363
  export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4932
5364
  HubExecutionAgentCreateResponseSchema,
4933
5365
  HubExecutionAgentValidateResponseSchema,
@@ -4935,6 +5367,21 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4935
5367
  HubExecutionAgentUpdateSchema,
4936
5368
  HubExecutionAgentStreamSchema,
4937
5369
  BrowserAutomationExecuteRequestSchema,
5370
+ PluginCatalogGetResponseSchema,
5371
+ PluginListResponseSchema,
5372
+ PluginLogsGetResponseSchema,
5373
+ PluginDirectoryInstallResponseSchema,
5374
+ PluginDirectoryInspectResponseSchema,
5375
+ PluginReloadResponseSchema,
5376
+ PluginEnableResponseSchema,
5377
+ PluginDisableResponseSchema,
5378
+ PluginRemoveResponseSchema,
5379
+ PluginRpcInvokeResponseSchema,
5380
+ AgentSkillsGetStatusResponseSchema,
5381
+ AgentSkillsReconcileResponseSchema,
5382
+ AgentSkillsUninstallResponseSchema,
5383
+ AgentSkillsSaveSelectionResponseSchema,
5384
+ AgentSkillsImportLegacySelectionResponseSchema,
4938
5385
  ActivityLogMessageSchema,
4939
5386
  AssistantChunkMessageSchema,
4940
5387
  AudioOutputMessageSchema,
@@ -4952,6 +5399,12 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4952
5399
  ArtifactMessageSchema,
4953
5400
  AgentUpdateMessageSchema,
4954
5401
  WorkspaceUpdateMessageSchema,
5402
+ WorkspaceLabelListResponseSchema,
5403
+ WorkspaceLabelUpdateSchema,
5404
+ WorkspaceLabelAssignmentSetResponseSchema,
5405
+ WorkspaceLabelUpdateResponseSchema,
5406
+ WorkspaceLabelDeleteResponseSchema,
5407
+ WorkspaceLabelDeleteInspectResponseSchema,
4955
5408
  ProjectUpdateMessageSchema,
4956
5409
  ProjectListResponseMessageSchema,
4957
5410
  ScriptStatusUpdateMessageSchema,
@@ -4992,6 +5445,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4992
5445
  SetVoiceModeResponseMessageSchema,
4993
5446
  DaemonGetStatusResponseSchema,
4994
5447
  DaemonGetPairingOfferResponseSchema,
5448
+ DaemonConfigReloadResponseSchema,
4995
5449
  HubManagementDaemonConnectResponseSchema,
4996
5450
  HubManagementDaemonGetStatusResponseSchema,
4997
5451
  HubManagementDaemonDisconnectResponseSchema,