@camerontaylor/paseo-protocol 0.11.0-beta.3.fork.1 → 0.11.1-fork.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
@@ -1,3 +1,4 @@
1
+ import { PluginRegistryIdentitySchema } from "./plugin-registry.js";
1
2
  import { AgentProfileSchema, AgentSkillSelectionSchema } from "./agent-profile.js";
2
3
  export { AgentProfileSchema, AgentSkillSelectionSchema, } from "./agent-profile.js";
3
4
  import { PluginIdSchema, PluginRequirementsSchema, PluginSourceSchema } from "./plugin-config.js";
@@ -5,6 +6,7 @@ export { PluginIdSchema, PluginRequirementsSchema, DirectoryPluginSourceSchema,
5
6
  import { TerminalProfileSchema } from "./terminal-profile.js";
6
7
  export { TerminalProfileSchema } from "./terminal-profile.js";
7
8
  import { z } from "zod";
9
+ import { CompanionEntrySchema } from "./companion-stream.js";
8
10
  import { TerminalActivitySchema } from "./terminal-activity.js";
9
11
  import { CLIENT_CAPS } from "./client-capabilities.js";
10
12
  import { AGENT_LIFECYCLE_STATUSES } from "./agent-lifecycle.js";
@@ -103,6 +105,7 @@ export const MutableDaemonConfigSchema = z
103
105
  metadataGeneration: MutableMetadataGenerationConfigSchema.default({ providers: [] }),
104
106
  autoArchiveAfterMerge: z.boolean().default(false),
105
107
  enableTerminalAgentHooks: z.boolean().default(false),
108
+ appendSystemPromptExcludedProviders: z.array(z.string().min(1)).optional(),
106
109
  appendSystemPrompt: z.string().default(""),
107
110
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
108
111
  agentProfiles: z.array(AgentProfileSchema).optional(),
@@ -131,6 +134,7 @@ export const MutableDaemonConfigPatchSchema = z
131
134
  metadataGeneration: MutableMetadataGenerationConfigSchema.partial().optional(),
132
135
  autoArchiveAfterMerge: z.boolean().optional(),
133
136
  enableTerminalAgentHooks: z.boolean().optional(),
137
+ appendSystemPromptExcludedProviders: z.array(z.string().min(1)).optional(),
134
138
  appendSystemPrompt: z.string().optional(),
135
139
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
136
140
  agentProfiles: z.array(AgentProfileSchema).optional(),
@@ -643,6 +647,15 @@ const AgentActiveTurnPayloadSchema = z.object({
643
647
  turnId: z.string(),
644
648
  startedAt: z.string().nullable(),
645
649
  });
650
+ export const AgentArtifactSchema = z.object({
651
+ path: z.string(),
652
+ name: z.string(),
653
+ kind: z.enum(["html", "markdown", "image", "svg", "pdf", "diff"]),
654
+ mimeType: z.string(),
655
+ size: z.number().int().nonnegative(),
656
+ createdAt: z.string(),
657
+ updatedAt: z.string(),
658
+ });
646
659
  export const AgentSnapshotPayloadSchema = z.object({
647
660
  id: z.string(),
648
661
  provider: AgentProviderSchema,
@@ -672,6 +685,8 @@ export const AgentSnapshotPayloadSchema = z.object({
672
685
  attentionTimestamp: z.string().nullable().optional(),
673
686
  archivedAt: z.string().nullable().optional(),
674
687
  providerUnavailable: z.boolean().optional(),
688
+ artifacts: z.array(AgentArtifactSchema).optional(),
689
+ companionEntries: z.array(CompanionEntrySchema).optional(),
675
690
  });
676
691
  export const AgentListItemPayloadSchema = z.object({
677
692
  id: z.string(),
@@ -708,16 +723,50 @@ export const RecentProviderSessionDescriptorPayloadSchema = z.object({
708
723
  // ============================================================================
709
724
  export const VoiceAudioChunkMessageSchema = z.object({
710
725
  type: z.literal("voice_audio_chunk"),
726
+ /** Voice attachment identity. Absent in legacy clients without attachments. */
727
+ attachmentId: z.string().optional(),
728
+ /** Transport generation handed out by the host for this attachment. */
729
+ generation: z.string().optional(),
711
730
  audio: z.string(), // base64 encoded
712
731
  format: z.string(),
713
732
  isLast: z.boolean(),
714
733
  });
715
734
  export const AbortRequestMessageSchema = z.object({
716
735
  type: z.literal("abort_request"),
736
+ attachmentId: z.string().optional(),
737
+ generation: z.string().optional(),
717
738
  });
718
739
  export const AudioPlayedMessageSchema = z.object({
719
740
  type: z.literal("audio_played"),
741
+ attachmentId: z.string().optional(),
742
+ generation: z.string().optional(),
720
743
  id: z.string(),
744
+ /** Set when the client failed to play the clip; the speech caller sees the failure. */
745
+ error: z.string().optional(),
746
+ });
747
+ export const VoiceInputReceiptsReadRequestSchema = z.object({
748
+ type: z.literal("voice.input.receipts.read.request"),
749
+ requestId: z.string(),
750
+ agentId: z.string(),
751
+ attachmentId: z.string(),
752
+ generation: z.string(),
753
+ after: z.string().optional(),
754
+ limit: z.number().int().min(1).max(100).optional(),
755
+ });
756
+ export const VoiceInputReceiptsReadResponseSchema = z.object({
757
+ type: z.literal("voice.input.receipts.read.response"),
758
+ payload: z.object({
759
+ requestId: z.string(),
760
+ agentId: z.string(),
761
+ attachmentId: z.string(),
762
+ items: z.array(z.object({
763
+ messageId: z.string(),
764
+ state: z.enum(["queued", "submitted", "removed", "unknown"]),
765
+ createdAt: z.string(),
766
+ })),
767
+ nextCursor: z.string().nullable(),
768
+ error: z.string().nullable(),
769
+ }),
721
770
  });
722
771
  const AgentDirectoryFilterSchema = z.object({
723
772
  labels: z.record(z.string(), z.string()).optional(),
@@ -750,6 +799,49 @@ export const UpdateAgentRequestMessageSchema = z.object({
750
799
  labels: z.record(z.string(), z.string()).optional(),
751
800
  requestId: z.string(),
752
801
  });
802
+ // COMPAT(companionStreamPortV1): added in v0.11.0-beta.3-fork, remove after 2027-04-01.
803
+ // Ported from the source fork's flat `update_companion_entry_request`; renamed to the
804
+ // dotted namespace so the two contracts stay distinct on the wire.
805
+ export const AgentCompanionUpdateEntryRequestMessageSchema = z.object({
806
+ type: z.literal("agent.companion.update_entry.request"),
807
+ agentId: z.string(),
808
+ entryId: z.string().optional(),
809
+ action: z.enum(["update_status", "add_pin", "remove_pin", "add_q_and_a"]),
810
+ status: z.enum(["open", "reviewed", "done"]).optional(),
811
+ text: z.string().optional(),
812
+ answerText: z.string().optional(),
813
+ sourceId: z.string().optional(),
814
+ requestId: z.string(),
815
+ });
816
+ export const AgentCompanionUpdateEntryResponseMessageSchema = z.object({
817
+ type: z.literal("agent.companion.update_entry.response"),
818
+ payload: z.object({
819
+ requestId: z.string(),
820
+ agentId: z.string(),
821
+ accepted: z.boolean(),
822
+ error: z.string().nullable(),
823
+ }),
824
+ });
825
+ export const AgentArtifactsScanRequestMessageSchema = z.object({
826
+ type: z.literal("agent.artifacts.scan.request"),
827
+ agentId: z.string(),
828
+ requestId: z.string(),
829
+ /** Overrides the daemon's default retention ceiling for this scan. */
830
+ limit: z.number().int().positive().optional(),
831
+ });
832
+ export const AgentArtifactsScanResponseMessageSchema = z.object({
833
+ type: z.literal("agent.artifacts.scan.response"),
834
+ payload: z.object({
835
+ requestId: z.string(),
836
+ agentId: z.string(),
837
+ accepted: z.boolean(),
838
+ error: z.string().nullable(),
839
+ /** Files newly recorded or refreshed by this scan. */
840
+ addedOrUpdated: z.number().int().nonnegative(),
841
+ /** Size of the agent's artifact list after the scan. */
842
+ total: z.number().int().nonnegative(),
843
+ }),
844
+ });
753
845
  // The daemon accepts only image bytes chosen or acquired by the client. It must
754
846
  // never fetch a user-provided URL on the host's network.
755
847
  export const ProjectIconSourceSchema = z.discriminatedUnion("type", [
@@ -843,6 +935,10 @@ export const WorkspaceRecoveryRestoreRequestSchema = z.object({
843
935
  });
844
936
  export const SetVoiceModeMessageSchema = z.object({
845
937
  type: z.literal("set_voice_mode"),
938
+ /** Voice attachment identity; the host binds its generation to it. */
939
+ attachmentId: z.string().optional(),
940
+ /** Supplied when an existing attachment reclaims itself after a reconnect. */
941
+ generation: z.string().optional(),
846
942
  enabled: z.boolean(),
847
943
  agentId: z.string().optional(),
848
944
  requestId: z.string().optional(),
@@ -902,16 +998,15 @@ export const ExternalResourceAttachmentMetadataSchema = z.object({
902
998
  title: z.string(),
903
999
  url: z.string(),
904
1000
  });
905
- export const TextAttachmentSchema = z
906
- .object({
1001
+ export const TextAttachmentWireSchema = z.object({
907
1002
  type: z.literal("text"),
908
1003
  mimeType: z.literal("text/plain"),
909
1004
  contextKind: z.string().optional(),
910
1005
  title: z.string().nullable().optional(),
911
1006
  text: z.string(),
912
1007
  externalResource: ExternalResourceAttachmentMetadataSchema.optional(),
913
- })
914
- .transform(({ contextKind, ...attachment }) => ({
1008
+ });
1009
+ export const TextAttachmentSchema = TextAttachmentWireSchema.transform(({ contextKind, ...attachment }) => ({
915
1010
  ...attachment,
916
1011
  ...(contextKind === "chat_history" ? { contextKind } : {}),
917
1012
  }));
@@ -957,6 +1052,20 @@ export const AgentAttachmentSchema = z.discriminatedUnion("type", [
957
1052
  ReviewAttachmentSchema,
958
1053
  UploadedFileAttachmentSchema,
959
1054
  ]);
1055
+ /**
1056
+ * Same shape as AgentAttachmentSchema without the text-attachment transform, so
1057
+ * attachments can appear in outbound messages. Message schemas stay pure — see
1058
+ * docs/protocol-validation.md.
1059
+ */
1060
+ export const AgentAttachmentWireSchema = z.discriminatedUnion("type", [
1061
+ ForgeChangeRequestAttachmentSchema,
1062
+ ForgeIssueAttachmentSchema,
1063
+ GitHubPrAttachmentSchema,
1064
+ GitHubIssueAttachmentSchema,
1065
+ TextAttachmentWireSchema,
1066
+ ReviewAttachmentSchema,
1067
+ UploadedFileAttachmentSchema,
1068
+ ]);
960
1069
  function normalizeAgentAttachments(input) {
961
1070
  if (!Array.isArray(input)) {
962
1071
  return [];
@@ -1206,8 +1315,18 @@ export const PluginSourceInstallRequestSchema = z.object({
1206
1315
  });
1207
1316
  export const PluginSourceIdentitySchema = z.discriminatedUnion("kind", [
1208
1317
  z.object({ kind: z.literal("directory"), path: z.string() }),
1209
- z.object({ kind: z.literal("git"), remote: z.string(), pluginPath: z.string() }),
1210
- z.object({ kind: z.literal("npm"), packageName: z.string(), pluginPath: z.string() }),
1318
+ z.object({
1319
+ kind: z.literal("git"),
1320
+ remote: z.string(),
1321
+ pluginPath: z.string(),
1322
+ registry: PluginRegistryIdentitySchema.optional(),
1323
+ }),
1324
+ z.object({
1325
+ kind: z.literal("npm"),
1326
+ packageName: z.string(),
1327
+ pluginPath: z.string(),
1328
+ registry: PluginRegistryIdentitySchema.optional(),
1329
+ }),
1211
1330
  ]);
1212
1331
  export const PluginInstallationSchema = z.object({
1213
1332
  identity: PluginSourceIdentitySchema,
@@ -1479,6 +1598,8 @@ export const ProviderUsageListRequestMessageSchema = z.object({
1479
1598
  });
1480
1599
  export const UsageListReportsRequestMessageSchema = z.object({
1481
1600
  type: z.literal("usage.list_reports.request"),
1601
+ streaming: z.boolean().optional(),
1602
+ agentId: z.string().optional(),
1482
1603
  requestId: z.string(),
1483
1604
  reportIds: z.array(z.string()).optional(),
1484
1605
  forceRefresh: z.boolean().optional(),
@@ -1796,6 +1917,9 @@ export const SetVoiceModeResponseMessageSchema = z.object({
1796
1917
  reasonCode: z.string().optional(),
1797
1918
  retryable: z.boolean().optional(),
1798
1919
  missingModelIds: z.array(z.string()).optional(),
1920
+ /** Echoed attachment identity plus the host's fresh transport generation. */
1921
+ attachmentId: z.string().optional(),
1922
+ generation: z.string().optional(),
1799
1923
  }),
1800
1924
  });
1801
1925
  export const AgentPermissionResponseMessageSchema = z.object({
@@ -2079,6 +2203,220 @@ export const ForgeSearchKindSchema = z.enum([
2079
2203
  "pr",
2080
2204
  ]);
2081
2205
  export const GitHubSearchKindSchema = ForgeSearchKindSchema;
2206
+ // ---------------------------------------------------------------------------
2207
+ // Durable agent message queue. Removal group: Queue (TM-02).
2208
+ //
2209
+ // Admission through these RPCs is opt-in. `send_agent_message_request` without
2210
+ // queue intent keeps the legacy receipt-backed interrupt path and never reaches
2211
+ // the queue, so every message in this block is new to an old daemon: gate a
2212
+ // client on `server_info.features.durableAgentQueueV1` before sending any of it,
2213
+ // and never send the new `intent` values to a daemon that lacks the flag. The
2214
+ // daemon only broadcasts `agent.queue.update` to clients advertising
2215
+ // CLIENT_CAPS.durableAgentQueue, so an old client never sees an unknown event.
2216
+ // ---------------------------------------------------------------------------
2217
+ /**
2218
+ * How the daemon delivers a queued item. `queue` waits for a free agent;
2219
+ * `steer_strict` asks the provider to steer the running turn and never
2220
+ * interrupts or replaces it. Both values postdate every released daemon, which
2221
+ * is why the feature flag gates the whole block.
2222
+ */
2223
+ export const QueuedAgentDeliveryIntentSchema = z.enum(["queue", "steer_strict"]);
2224
+ /**
2225
+ * Where a queued item stands in the claim/dispatch/receipt/removal cycle.
2226
+ *
2227
+ * - `pending`: accepted and never handed to a provider; safe to resume.
2228
+ * - `dispatching`: claimed, dispatch in flight.
2229
+ * - `uncertain`: the provider may or may not have accepted it. Visible for
2230
+ * reconciliation; the daemon never resends it on its own.
2231
+ * - `failed`: repeated known failures (see the daemon's attempt limit). Visible
2232
+ * with an explicit retry or discard.
2233
+ */
2234
+ export const QueuedAgentMessageDeliveryStateSchema = z.enum([
2235
+ "pending",
2236
+ "dispatching",
2237
+ "uncertain",
2238
+ "failed",
2239
+ ]);
2240
+ /**
2241
+ * Queued images are described, never shipped. The bytes live on the daemon, so a
2242
+ * queue holding a photo does not push megabytes of base64 at every connected
2243
+ * client on every queue change.
2244
+ */
2245
+ export const QueuedAgentMessageImageSchema = z.object({
2246
+ id: z.string(),
2247
+ mimeType: z.string(),
2248
+ fileName: z.string().nullable().optional(),
2249
+ byteSize: z.number().int().nonnegative().optional(),
2250
+ });
2251
+ /**
2252
+ * The composer-side view of an attachment, kept alongside the agent-side one so
2253
+ * any device can pull a queued message back into its composer with the same
2254
+ * pills the author saw. Images are excluded: their bytes are stored separately
2255
+ * and fetched with agent.queue.get_item_images.request.
2256
+ */
2257
+ export const QueuedComposerAttachmentSchema = z.discriminatedUnion("kind", [
2258
+ z.object({ kind: z.literal("file"), attachment: UploadedFileAttachmentSchema }),
2259
+ z.object({
2260
+ kind: z.literal("workspace_file"),
2261
+ path: z.string(),
2262
+ selection: z.discriminatedUnion("kind", [
2263
+ z.object({ kind: z.literal("whole_file") }),
2264
+ z.object({
2265
+ kind: z.literal("line_range"),
2266
+ startLine: z.number().int().positive(),
2267
+ endLine: z.number().int().positive(),
2268
+ }),
2269
+ ]),
2270
+ }),
2271
+ z.object({ kind: z.literal("forge_issue"), item: ForgeSearchItemSchema }),
2272
+ z.object({ kind: z.literal("forge_change_request"), item: ForgeSearchItemSchema }),
2273
+ z.object({ kind: z.literal("github_issue"), item: ForgeSearchItemSchema }),
2274
+ z.object({ kind: z.literal("github_pr"), item: ForgeSearchItemSchema }),
2275
+ ]);
2276
+ export const QueuedAgentMessageSchema = z.object({
2277
+ id: z.string(),
2278
+ text: z.string(),
2279
+ /** Set when the item was admitted as spoken input rather than typed or tool-created. */
2280
+ origin: z.literal("voice").optional(),
2281
+ intent: QueuedAgentDeliveryIntentSchema,
2282
+ deliveryState: QueuedAgentMessageDeliveryStateSchema,
2283
+ attempts: z.number().int().nonnegative(),
2284
+ lastError: z.string().nullable().optional(),
2285
+ attachments: z.array(AgentAttachmentWireSchema).optional(),
2286
+ composerAttachments: z.array(QueuedComposerAttachmentSchema).optional(),
2287
+ images: z.array(QueuedAgentMessageImageSchema).optional(),
2288
+ createdAt: z.string(),
2289
+ });
2290
+ export const AgentQueueSnapshotSchema = z.object({
2291
+ agentId: z.string(),
2292
+ /** Increments on every mutation so clients can drop a stale broadcast. */
2293
+ revision: z.number().int().nonnegative(),
2294
+ items: z.array(QueuedAgentMessageSchema),
2295
+ });
2296
+ export const AgentQueueEnqueueRequestSchema = z.object({
2297
+ type: z.literal("agent.queue.enqueue.request"),
2298
+ requestId: z.string(),
2299
+ agentId: z.string(),
2300
+ /** Client-generated so the optimistic local item and the stored item share an id. */
2301
+ itemId: z.string(),
2302
+ text: z.string(),
2303
+ intent: QueuedAgentDeliveryIntentSchema,
2304
+ images: z.array(ImageAttachmentSchema).optional(),
2305
+ attachments: z.array(AgentAttachmentWireSchema).optional(),
2306
+ composerAttachments: z.array(QueuedComposerAttachmentSchema).optional(),
2307
+ });
2308
+ /**
2309
+ * The revision the client last saw. A stale device is rejected with
2310
+ * `queue_revision_conflict` instead of overwriting another device's edit, so
2311
+ * edits, reorders and deletions are governed by queue revisions.
2312
+ */
2313
+ export const AgentQueueMutationRequestSchema = z.object({
2314
+ type: z.string(),
2315
+ requestId: z.string(),
2316
+ agentId: z.string(),
2317
+ expectedRevision: z.number().int().nonnegative(),
2318
+ });
2319
+ export const AgentQueueUpdateRequestSchema = AgentQueueMutationRequestSchema.extend({
2320
+ type: z.literal("agent.queue.update.request"),
2321
+ itemId: z.string(),
2322
+ text: z.string(),
2323
+ images: z.array(ImageAttachmentSchema).optional(),
2324
+ attachments: z.array(AgentAttachmentWireSchema).optional(),
2325
+ composerAttachments: z.array(QueuedComposerAttachmentSchema).optional(),
2326
+ });
2327
+ export const AgentQueueReorderRequestSchema = AgentQueueMutationRequestSchema.extend({
2328
+ type: z.literal("agent.queue.reorder.request"),
2329
+ /** Full id list in the desired order. Unknown ids are ignored, omitted ids keep their relative order at the end. */
2330
+ itemIds: z.array(z.string()),
2331
+ });
2332
+ export const AgentQueueDeleteRequestSchema = AgentQueueMutationRequestSchema.extend({
2333
+ type: z.literal("agent.queue.delete.request"),
2334
+ itemId: z.string(),
2335
+ });
2336
+ /** Returns a failed or uncertain item to the drain loop after an explicit user decision. */
2337
+ export const AgentQueueRetryRequestSchema = AgentQueueMutationRequestSchema.extend({
2338
+ type: z.literal("agent.queue.retry.request"),
2339
+ itemId: z.string(),
2340
+ });
2341
+ /**
2342
+ * Attempts delivery of one item now instead of waiting for the queue to reach
2343
+ * the head. The response carries the queue after the attempt, so a client can
2344
+ * tell a delivered item from one the admission fence refused.
2345
+ */
2346
+ export const AgentQueueSendNowRequestSchema = AgentQueueMutationRequestSchema.extend({
2347
+ type: z.literal("agent.queue.send_now.request"),
2348
+ itemId: z.string(),
2349
+ });
2350
+ export const AgentQueueListRequestSchema = z.object({
2351
+ type: z.literal("agent.queue.list.request"),
2352
+ requestId: z.string(),
2353
+ agentId: z.string(),
2354
+ });
2355
+ /**
2356
+ * Fetches the image bytes of one queued item. A device that did not queue the
2357
+ * item has no local copy, so editing it there would otherwise drop the images.
2358
+ */
2359
+ export const AgentQueueGetItemImagesRequestSchema = z.object({
2360
+ type: z.literal("agent.queue.get_item_images.request"),
2361
+ requestId: z.string(),
2362
+ agentId: z.string(),
2363
+ itemId: z.string(),
2364
+ });
2365
+ export const AgentQueueGetItemImagesResponseSchema = z.object({
2366
+ type: z.literal("agent.queue.get_item_images.response"),
2367
+ payload: z.object({
2368
+ requestId: z.string(),
2369
+ agentId: z.string(),
2370
+ itemId: z.string(),
2371
+ images: z.array(z.object({
2372
+ id: z.string(),
2373
+ mimeType: z.string(),
2374
+ fileName: z.string().nullable().optional(),
2375
+ data: z.string(),
2376
+ })),
2377
+ error: z.string().nullable(),
2378
+ }),
2379
+ });
2380
+ export const AgentQueueResponsePayloadSchema = z.object({
2381
+ requestId: z.string(),
2382
+ agentId: z.string(),
2383
+ queue: AgentQueueSnapshotSchema.nullable(),
2384
+ /** Machine-readable on mutation failures, e.g. `queue_revision_conflict`. */
2385
+ error: z.string().nullable(),
2386
+ });
2387
+ export const AgentQueueEnqueueResponseSchema = z.object({
2388
+ type: z.literal("agent.queue.enqueue.response"),
2389
+ payload: AgentQueueResponsePayloadSchema,
2390
+ });
2391
+ export const AgentQueueUpdateResponseSchema = z.object({
2392
+ type: z.literal("agent.queue.update.response"),
2393
+ payload: AgentQueueResponsePayloadSchema,
2394
+ });
2395
+ export const AgentQueueReorderResponseSchema = z.object({
2396
+ type: z.literal("agent.queue.reorder.response"),
2397
+ payload: AgentQueueResponsePayloadSchema,
2398
+ });
2399
+ export const AgentQueueDeleteResponseSchema = z.object({
2400
+ type: z.literal("agent.queue.delete.response"),
2401
+ payload: AgentQueueResponsePayloadSchema,
2402
+ });
2403
+ export const AgentQueueRetryResponseSchema = z.object({
2404
+ type: z.literal("agent.queue.retry.response"),
2405
+ payload: AgentQueueResponsePayloadSchema,
2406
+ });
2407
+ export const AgentQueueSendNowResponseSchema = z.object({
2408
+ type: z.literal("agent.queue.send_now.response"),
2409
+ payload: AgentQueueResponsePayloadSchema,
2410
+ });
2411
+ export const AgentQueueListResponseSchema = z.object({
2412
+ type: z.literal("agent.queue.list.response"),
2413
+ payload: AgentQueueResponsePayloadSchema,
2414
+ });
2415
+ /** Unsolicited full-queue broadcast, only to clients advertising CLIENT_CAPS.durableAgentQueue. */
2416
+ export const AgentQueueUpdateMessageSchema = z.object({
2417
+ type: z.literal("agent.queue.update"),
2418
+ payload: AgentQueueSnapshotSchema,
2419
+ });
2082
2420
  export const ForgeSearchRequestSchema = z.object({
2083
2421
  type: z.literal("forge.search.request"),
2084
2422
  cwd: z.string(),
@@ -2678,6 +3016,10 @@ export const SessionEventSubscriptionSchema = z.enum([
2678
3016
  "script_status_update",
2679
3017
  "workspace_setup_progress",
2680
3018
  "agent.provider_subagents.update",
3019
+ // COMPAT(durableAgentQueue): fork addition (TM-02). Only sent by clients that
3020
+ // saw features.durableAgentQueueV1; an old daemon parsing this enum rejects
3021
+ // the subscription request, which is why the client gates before subscribing.
3022
+ "agent.queue.update",
2681
3023
  "terminal_attention_required",
2682
3024
  "status.server_info",
2683
3025
  "status.daemon_config_changed",
@@ -2737,6 +3079,8 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2737
3079
  ArchiveAgentRequestMessageSchema,
2738
3080
  CloseItemsRequestMessageSchema,
2739
3081
  UpdateAgentRequestMessageSchema,
3082
+ AgentCompanionUpdateEntryRequestMessageSchema,
3083
+ AgentArtifactsScanRequestMessageSchema,
2740
3084
  ProjectRenameRequestSchema,
2741
3085
  ProjectIconSetRequestSchema,
2742
3086
  ProjectRemoveRequestSchema,
@@ -2750,6 +3094,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2750
3094
  WorkspaceRecoveryInspectRequestSchema,
2751
3095
  WorkspaceRecoveryRestoreRequestSchema,
2752
3096
  SetVoiceModeMessageSchema,
3097
+ VoiceInputReceiptsReadRequestSchema,
2753
3098
  SendAgentMessageRequestSchema,
2754
3099
  WaitForFinishRequestSchema,
2755
3100
  DaemonGetStatusRequestSchema,
@@ -2814,6 +3159,14 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2814
3159
  SideConversationAskRequestMessageSchema,
2815
3160
  SideConversationTimelineGetRequestMessageSchema,
2816
3161
  SideConversationListRequestMessageSchema,
3162
+ AgentQueueEnqueueRequestSchema,
3163
+ AgentQueueUpdateRequestSchema,
3164
+ AgentQueueReorderRequestSchema,
3165
+ AgentQueueDeleteRequestSchema,
3166
+ AgentQueueRetryRequestSchema,
3167
+ AgentQueueSendNowRequestSchema,
3168
+ AgentQueueListRequestSchema,
3169
+ AgentQueueGetItemImagesRequestSchema,
2817
3170
  SetAgentTimelineSubscriptionRequestMessageSchema,
2818
3171
  AgentForkContextRequestMessageSchema,
2819
3172
  SetAgentModeRequestMessageSchema,
@@ -2955,6 +3308,8 @@ export const AudioOutputMessageSchema = z.object({
2955
3308
  audio: z.string(), // base64 encoded
2956
3309
  format: z.string(),
2957
3310
  id: z.string(),
3311
+ attachmentId: z.string().optional(),
3312
+ generation: z.string().optional(),
2958
3313
  isVoiceMode: z.boolean(), // Mode when audio was generated (for drift protection)
2959
3314
  groupId: z.string().optional(), // Logical utterance id
2960
3315
  chunkIndex: z.number().int().nonnegative().optional(),
@@ -2968,6 +3323,11 @@ export const TranscriptionResultMessageSchema = z.object({
2968
3323
  language: z.string().optional(),
2969
3324
  duration: z.number().optional(),
2970
3325
  requestId: z.string(), // Echoed back from request for tracking
3326
+ attachmentId: z.string().optional(),
3327
+ generation: z.string().optional(),
3328
+ /** Queue item id of the admitted utterance; present only when it was queued. */
3329
+ messageId: z.string().optional(),
3330
+ queued: z.boolean().optional(),
2971
3331
  avgLogprob: z.number().optional(),
2972
3332
  isLowConfidence: z.boolean().optional(),
2973
3333
  byteLength: z.number().optional(),
@@ -2979,6 +3339,13 @@ export const VoiceInputStateMessageSchema = z.object({
2979
3339
  type: z.literal("voice_input_state"),
2980
3340
  payload: z.object({
2981
3341
  isSpeaking: z.boolean(),
3342
+ /** Input problem text, e.g. a transcript that could not be queued. */
3343
+ error: z.string().optional(),
3344
+ attachmentId: z.string().optional(),
3345
+ generation: z.string().optional(),
3346
+ // "nothing_recognized" | "timed_out" | "failed". A string so later hosts can add
3347
+ // values that older clients ignore instead of rejecting the message.
3348
+ recognitionIssue: z.string().optional(),
2982
3349
  }),
2983
3350
  });
2984
3351
  export const DictationStreamAckMessageSchema = z.object({
@@ -3085,6 +3452,7 @@ export const ServerInfoStatusPayloadSchema = z
3085
3452
  hubAgentRpc: z.boolean().optional(),
3086
3453
  providersSnapshot: z.boolean().optional(),
3087
3454
  usageSources: z.boolean().optional(),
3455
+ usageReportsStreaming: z.boolean().optional(),
3088
3456
  // COMPAT(providersSnapshotCwd): added in v0.3.2, remove gate after 2027-02-10.
3089
3457
  providersSnapshotCwd: z.boolean().optional(),
3090
3458
  // COMPAT(directorySync): added in v0.3.x, remove gate after 2027-02-12.
@@ -3161,6 +3529,15 @@ export const ServerInfoStatusPayloadSchema = z
3161
3529
  agentTimelinePromptIndex: z.boolean().optional(),
3162
3530
  // COMPAT(agentHistorySearch): added in v0.3.0, remove gate after 2027-02-07.
3163
3531
  agentHistorySearch: z.boolean().optional(),
3532
+ // COMPAT(durableAgentQueue): fork addition (TM-02). Gates the whole
3533
+ // agent.queue.* block, including the delivery-intent enum that no
3534
+ // released daemon understands. Remove the gate after 2027-10-01 once
3535
+ // the supported daemon floor is past every 0.11.x host.
3536
+ durableAgentQueueV1: z.boolean().optional(),
3537
+ // COMPAT(durableVoiceInputV1): fork addition (TM-04). Gates voice
3538
+ // attachment admission into the durable agent queue; an old daemon
3539
+ // never answers voice.input.receipts.read requests.
3540
+ durableVoiceInputV1: z.boolean().optional(),
3164
3541
  // COMPAT(checkoutRefresh): added in v0.1.86, remove gate after 2026-11-29.
3165
3542
  checkoutRefresh: z.boolean().optional(),
3166
3543
  // COMPAT(workspaceMultiplicity): added in v0.1.97, drop the gate when floor >= v0.1.97
@@ -3175,6 +3552,11 @@ export const ServerInfoStatusPayloadSchema = z
3175
3552
  workspaceRecovery: z.boolean().optional(),
3176
3553
  // COMPAT(workspaceFileEditing): added in v0.2.0, remove after 2027-01-18 once daemon floor >= v0.2.0.
3177
3554
  workspaceFileEditing: z.boolean().optional(),
3555
+ // COMPAT(companionStreamPortV1): added in v0.11.0-beta.3-fork, remove after 2027-04-01.
3556
+ // Deliberately not the source fork's `companionStream`/`artifactFeed` flags: a client
3557
+ // that saw those names would expect the source's flat companion RPC, which this
3558
+ // daemon does not accept.
3559
+ companionStreamPortV1: z.boolean().optional(),
3178
3560
  // COMPAT(providerUsageList): added in v0.1.98, drop the gate when daemon floor >= v0.1.98.
3179
3561
  providerUsageList: z.boolean().optional(),
3180
3562
  // COMPAT(agentDetach): added in v0.1.98, remove gate after 2026-12-19 once daemon floor >= v0.1.98.
@@ -5666,10 +6048,27 @@ export const UsageReportEntrySchema = z.object({
5666
6048
  sourceLabel: z.string(),
5667
6049
  icon: z.string().optional(),
5668
6050
  report: UsageReportSchema,
6051
+ loginErrors: z
6052
+ .array(z.object({
6053
+ harness: z.string(),
6054
+ report: z.discriminatedUnion("status", [
6055
+ z.object({ status: z.literal("unavailable"), problem: UsageProblemSchema }),
6056
+ z.object({ status: z.literal("error"), error: z.string() }),
6057
+ ]),
6058
+ }))
6059
+ .optional(),
6060
+ });
6061
+ export const UsageListReportsUpdateMessageSchema = z.object({
6062
+ type: z.literal("usage.list_reports.update"),
6063
+ payload: z.object({ requestId: z.string(), report: UsageReportEntrySchema }),
5669
6064
  });
5670
6065
  export const UsageListReportsResponseMessageSchema = z.object({
5671
6066
  type: z.literal("usage.list_reports.response"),
5672
- payload: z.object({ requestId: z.string(), reports: z.array(UsageReportEntrySchema) }),
6067
+ payload: z.object({
6068
+ requestId: z.string(),
6069
+ reports: z.array(UsageReportEntrySchema).optional(),
6070
+ error: z.string().nullable().optional(),
6071
+ }),
5673
6072
  });
5674
6073
  const AgentSlashCommandSchema = z.object({
5675
6074
  name: z.string(),
@@ -5939,6 +6338,9 @@ export const PluginNpmInstallationSchema = z.object({
5939
6338
  });
5940
6339
  export const PluginListItemSchema = z.object({
5941
6340
  id: PluginIdSchema,
6341
+ name: z.string().optional(),
6342
+ icon: z.string().optional(),
6343
+ media: z.array(z.string()).optional(),
5942
6344
  description: z.string().optional(),
5943
6345
  path: z.string(),
5944
6346
  enabled: z.boolean(),
@@ -6083,6 +6485,8 @@ export const AgentSkillsImportLegacySelectionResponseSchema = z.object({
6083
6485
  }),
6084
6486
  });
6085
6487
  export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6488
+ AgentCompanionUpdateEntryResponseMessageSchema,
6489
+ AgentArtifactsScanResponseMessageSchema,
6086
6490
  BrowserHostRegisterResponseSchema,
6087
6491
  SubscriptionReleaseResponseSchema,
6088
6492
  SessionEventsSetSubscriptionResponseSchema,
@@ -6173,6 +6577,15 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6173
6577
  SideConversationUpdateMessageSchema,
6174
6578
  SideConversationListResponseMessageSchema,
6175
6579
  SideConversationRemovedMessageSchema,
6580
+ AgentQueueEnqueueResponseSchema,
6581
+ AgentQueueUpdateResponseSchema,
6582
+ AgentQueueReorderResponseSchema,
6583
+ AgentQueueDeleteResponseSchema,
6584
+ AgentQueueRetryResponseSchema,
6585
+ AgentQueueSendNowResponseSchema,
6586
+ AgentQueueListResponseSchema,
6587
+ AgentQueueGetItemImagesResponseSchema,
6588
+ AgentQueueUpdateMessageSchema,
6176
6589
  SetAgentTimelineSubscriptionResponseMessageSchema,
6177
6590
  AgentAttentionRequiredMessageSchema,
6178
6591
  AgentForkContextResponseMessageSchema,
@@ -6187,6 +6600,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6187
6600
  WorkspaceMarkUnreadResponseSchema,
6188
6601
  SendAgentMessageResponseMessageSchema,
6189
6602
  SetVoiceModeResponseMessageSchema,
6603
+ VoiceInputReceiptsReadResponseSchema,
6190
6604
  DaemonGetStatusResponseSchema,
6191
6605
  DaemonGetPairingOfferResponseSchema,
6192
6606
  DaemonConfigReloadResponseSchema,
@@ -6278,6 +6692,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6278
6692
  RefreshProvidersSnapshotResponseMessageSchema,
6279
6693
  ProviderDiagnosticResponseMessageSchema,
6280
6694
  ProviderUsageListResponseMessageSchema,
6695
+ UsageListReportsUpdateMessageSchema,
6281
6696
  UsageListReportsResponseMessageSchema,
6282
6697
  ListCommandsResponseSchema,
6283
6698
  ListTerminalsResponseSchema,
@@ -0,0 +1,12 @@
1
+ /** Presentation contract for author-controlled registry content, independent of the UI runtime. */
2
+ export declare const pluginOverviewPolicy: {
3
+ readonly rawHtml: false;
4
+ readonly elements: readonly ["p", "br", "hr", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "ul", "ol", "li", "strong", "em", "del", "pre", "code", "a", "img", "table", "thead", "tbody", "tr", "th", "td"];
5
+ readonly link: {
6
+ readonly rel: "noopener noreferrer nofollow";
7
+ readonly target: "_blank";
8
+ };
9
+ };
10
+ /** Validate decoded Markdown destinations; never resolve against the reader's page or repository. */
11
+ export declare function pluginOverviewUrl(value: string | undefined): string | undefined;
12
+ //# sourceMappingURL=plugin-overview.d.ts.map