@getpaseo/protocol 0.3.1 → 0.4.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
@@ -50,6 +50,32 @@ export const TerminalProfileSchema = z
50
50
  icon: z.string().optional(),
51
51
  })
52
52
  .passthrough();
53
+ /**
54
+ * A named launch bundle: a provider plus the agent-config values a client would
55
+ * otherwise set one control at a time. Field names mirror `AgentSessionConfig`
56
+ * so applying a profile is a copy rather than a translation table.
57
+ *
58
+ * There is deliberately no system prompt here. `AgentSessionConfig.systemPrompt`
59
+ * is creation-only, so a profile carrying one would apply when starting a new
60
+ * agent and silently do nothing when applied to a running one.
61
+ */
62
+ export const AgentProfileSchema = z
63
+ .object({
64
+ id: z.string(),
65
+ name: z.string(),
66
+ /** A key into the client's icon registry, not a glyph. Unknown keys draw the default. */
67
+ icon: z.string().optional(),
68
+ /** An identity colour name shared with host badges. Unknown values draw unthemed. */
69
+ color: z.string().optional(),
70
+ provider: z.string(),
71
+ model: z.string().optional(),
72
+ modeId: z.string().optional(),
73
+ thinkingOptionId: z.string().optional(),
74
+ featureValues: z.record(z.string(), z.unknown()).optional(),
75
+ /** Free text, surfaced to orchestrating agents by the `list_profiles` MCP tool. */
76
+ notes: z.string().optional(),
77
+ })
78
+ .passthrough();
53
79
  const MutableBrowserToolsConfigSchema = z
54
80
  .object({
55
81
  enabled: z.boolean().default(false),
@@ -76,6 +102,7 @@ export const MutableDaemonConfigSchema = z
76
102
  enableTerminalAgentHooks: z.boolean().default(false),
77
103
  appendSystemPrompt: z.string().default(""),
78
104
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
105
+ agentProfiles: z.array(AgentProfileSchema).optional(),
79
106
  })
80
107
  .passthrough();
81
108
  export const MutableDaemonConfigPatchSchema = z
@@ -92,6 +119,7 @@ export const MutableDaemonConfigPatchSchema = z
92
119
  enableTerminalAgentHooks: z.boolean().optional(),
93
120
  appendSystemPrompt: z.string().optional(),
94
121
  terminalProfiles: z.array(TerminalProfileSchema).optional(),
122
+ agentProfiles: z.array(AgentProfileSchema).optional(),
95
123
  })
96
124
  .partial()
97
125
  .passthrough();
@@ -475,6 +503,9 @@ export const AgentTimelineItemPayloadSchema = z.union([
475
503
  items: z.array(z.object({
476
504
  text: z.string(),
477
505
  completed: z.boolean(),
506
+ id: z.string().optional(),
507
+ status: z.enum(["pending", "in_progress", "completed"]).optional(),
508
+ activeForm: z.string().optional(),
478
509
  })),
479
510
  }),
480
511
  z.object({
@@ -1273,6 +1304,33 @@ export const SetAgentFeatureResponseMessageSchema = z.object({
1273
1304
  type: z.literal("set_agent_feature_response"),
1274
1305
  payload: AgentActionResponsePayloadSchema,
1275
1306
  });
1307
+ /**
1308
+ * Every agent-config value a client can change in one shot. Each field is
1309
+ * optional and an omitted field is left alone; `null` on model and thinking
1310
+ * clears them, matching the single-field RPCs above.
1311
+ */
1312
+ export const AgentConfigApplySchema = z.object({
1313
+ modelId: z.string().nullable().optional(),
1314
+ modeId: z.string().optional(),
1315
+ thinkingOptionId: z.string().nullable().optional(),
1316
+ featureValues: z.record(z.string(), z.unknown()).optional(),
1317
+ });
1318
+ /**
1319
+ * Applies a whole config bundle to one agent. The four single-field RPCs above
1320
+ * stay for individual control edits. One request prevents client interruption
1321
+ * and other mutations from interleaving between bundle steps; provider-level
1322
+ * rejection can still leave earlier steps applied.
1323
+ */
1324
+ export const AgentConfigApplyRequestMessageSchema = z.object({
1325
+ type: z.literal("agent.config.apply.request"),
1326
+ agentId: z.string(),
1327
+ config: AgentConfigApplySchema,
1328
+ requestId: z.string(),
1329
+ });
1330
+ export const AgentConfigApplyResponseMessageSchema = z.object({
1331
+ type: z.literal("agent.config.apply.response"),
1332
+ payload: AgentActionResponsePayloadSchema,
1333
+ });
1276
1334
  export const AgentDetachRequestMessageSchema = z.object({
1277
1335
  type: z.literal("agent.detach.request"),
1278
1336
  agentId: z.string(),
@@ -1474,6 +1532,12 @@ export const CheckoutRefreshRequestSchema = z.object({
1474
1532
  cwd: z.string(),
1475
1533
  requestId: z.string(),
1476
1534
  });
1535
+ export const CheckoutDiscardChangesRequestSchema = z.object({
1536
+ type: z.literal("checkout.discard_changes.request"),
1537
+ cwd: z.string(),
1538
+ paths: z.array(z.string()).min(1),
1539
+ requestId: z.string(),
1540
+ });
1477
1541
  export const CheckoutPrCreateRequestSchema = z.object({
1478
1542
  type: z.literal("checkout_pr_create_request"),
1479
1543
  cwd: z.string(),
@@ -1850,6 +1914,8 @@ const DiffHunkSchema = z.object({
1850
1914
  });
1851
1915
  const ParsedDiffFileSchema = z.object({
1852
1916
  path: z.string(),
1917
+ // COMPAT(diffOldPath): added in v0.3.0, remove gate after 2027-02-09.
1918
+ oldPath: z.string().optional(),
1853
1919
  isNew: z.boolean(),
1854
1920
  isDeleted: z.boolean(),
1855
1921
  additions: z.number(),
@@ -1928,6 +1994,33 @@ export const FileWriteRequestSchema = z.object({
1928
1994
  expectedRevision: z.string().optional(),
1929
1995
  requestId: z.string(),
1930
1996
  });
1997
+ export const FileEntryCreateRequestSchema = z.object({
1998
+ type: z.literal("fs.entry.create.request"),
1999
+ cwd: z.string(),
2000
+ parentPath: z.string(),
2001
+ name: z.string(),
2002
+ kind: z.enum(["file", "directory"]),
2003
+ requestId: z.string(),
2004
+ });
2005
+ export const FileEntryRenameRequestSchema = z.object({
2006
+ type: z.literal("fs.entry.rename.request"),
2007
+ cwd: z.string(),
2008
+ path: z.string(),
2009
+ name: z.string(),
2010
+ requestId: z.string(),
2011
+ });
2012
+ export const FileEntryDuplicateRequestSchema = z.object({
2013
+ type: z.literal("fs.entry.duplicate.request"),
2014
+ cwd: z.string(),
2015
+ path: z.string(),
2016
+ requestId: z.string(),
2017
+ });
2018
+ export const FileEntryDeleteRequestSchema = z.object({
2019
+ type: z.literal("fs.entry.delete.request"),
2020
+ cwd: z.string(),
2021
+ path: z.string(),
2022
+ requestId: z.string(),
2023
+ });
1931
2024
  export const ProjectIconRequestSchema = z.object({
1932
2025
  type: z.literal("project_icon_request"),
1933
2026
  cwd: z.string(),
@@ -1995,6 +2088,17 @@ export const RegisterPushTokenMessageSchema = z.object({
1995
2088
  type: z.literal("register_push_token"),
1996
2089
  token: z.string(),
1997
2090
  });
2091
+ export const PushUnregisterRequestSchema = z.object({
2092
+ type: z.literal("push.unregister.request"),
2093
+ token: z.string(),
2094
+ requestId: z.string(),
2095
+ });
2096
+ export const PushUnregisterResponseSchema = z.object({
2097
+ type: z.literal("push.unregister.response"),
2098
+ payload: z.object({
2099
+ requestId: z.string(),
2100
+ }),
2101
+ });
1998
2102
  // ============================================================================
1999
2103
  // Terminal Messages
2000
2104
  // ============================================================================
@@ -2137,6 +2241,15 @@ export const HubExecutionAgentCreateRequestSchema = z.object({
2137
2241
  mcpServers: z.record(z.string(), McpServerConfigSchema).optional(),
2138
2242
  worktree: CreateAgentWorktreeTargetSchema.optional(),
2139
2243
  });
2244
+ export const HubExecutionAgentValidateRequestSchema = z.object({
2245
+ type: z.literal("hub.execution.agent.validate.request"),
2246
+ requestId: z.string(),
2247
+ provider: z.string(),
2248
+ model: z.string().optional(),
2249
+ modeId: z.string().optional(),
2250
+ thinkingOptionId: z.string().optional(),
2251
+ providerOptions: ProviderOptionsSchema.optional(),
2252
+ });
2140
2253
  const HubExecutionAgentCreateErrorSchema = z.discriminatedUnion("code", [
2141
2254
  z.object({
2142
2255
  code: z.literal("provider_options_invalid"),
@@ -2166,6 +2279,7 @@ export const HubExecutionControlRequestSchema = z.object({
2166
2279
  });
2167
2280
  export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2168
2281
  HubExecutionAgentCreateRequestSchema,
2282
+ HubExecutionAgentValidateRequestSchema,
2169
2283
  HubExecutionControlRequestSchema,
2170
2284
  BrowserAutomationExecuteResponseSchema,
2171
2285
  VoiceAudioChunkMessageSchema,
@@ -2231,6 +2345,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2231
2345
  SetAgentModelRequestMessageSchema,
2232
2346
  SetAgentThinkingRequestMessageSchema,
2233
2347
  SetAgentFeatureRequestMessageSchema,
2348
+ AgentConfigApplyRequestMessageSchema,
2234
2349
  AgentDetachRequestMessageSchema,
2235
2350
  AgentRewindRequestMessageSchema,
2236
2351
  AgentPermissionResponseMessageSchema,
@@ -2243,6 +2358,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2243
2358
  CheckoutPullRequestSchema,
2244
2359
  CheckoutPushRequestSchema,
2245
2360
  CheckoutRefreshRequestSchema,
2361
+ CheckoutDiscardChangesRequestSchema,
2246
2362
  CheckoutPrCreateRequestSchema,
2247
2363
  CheckoutPrMergeRequestSchema,
2248
2364
  CheckoutForgeSetAutoMergeRequestSchema,
@@ -2281,6 +2397,10 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2281
2397
  FileSubscribeRequestSchema,
2282
2398
  FileUnsubscribeRequestSchema,
2283
2399
  FileWriteRequestSchema,
2400
+ FileEntryCreateRequestSchema,
2401
+ FileEntryRenameRequestSchema,
2402
+ FileEntryDuplicateRequestSchema,
2403
+ FileEntryDeleteRequestSchema,
2284
2404
  ProjectIconRequestSchema,
2285
2405
  ProjectIconGetRequestSchema,
2286
2406
  FileDownloadTokenRequestSchema,
@@ -2290,6 +2410,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2290
2410
  PingMessageSchema,
2291
2411
  ListCommandsRequestSchema,
2292
2412
  RegisterPushTokenMessageSchema,
2413
+ PushUnregisterRequestSchema,
2293
2414
  ListTerminalsRequestSchema,
2294
2415
  SubscribeTerminalsRequestSchema,
2295
2416
  UnsubscribeTerminalsRequestSchema,
@@ -2471,6 +2592,8 @@ export const ServerInfoStatusPayloadSchema = z
2471
2592
  features: z
2472
2593
  .object({
2473
2594
  providersSnapshot: z.boolean().optional(),
2595
+ // COMPAT(providersSnapshotCwd): added in v0.3.2, remove gate after 2027-02-10.
2596
+ providersSnapshotCwd: z.boolean().optional(),
2474
2597
  // COMPAT(checkoutForgeSetAutoMerge): added in v0.1.106, remove old
2475
2598
  // checkoutGithubSetAutoMerge fallback after 2026-12-28.
2476
2599
  checkoutForgeSetAutoMerge: z.boolean().optional(),
@@ -2485,6 +2608,8 @@ export const ServerInfoStatusPayloadSchema = z
2485
2608
  daemonStatusRpc: z.boolean().optional(),
2486
2609
  // COMPAT(relayConfig): added in v0.2.6, remove gate after 2027-01-31.
2487
2610
  relayConfig: z.boolean().optional(),
2611
+ // COMPAT(pushTokenRevocation): added in v0.3.2, remove gate after 2027-02-10.
2612
+ pushTokenRevocation: z.boolean().optional(),
2488
2613
  // COMPAT(terminalRestoreModes): added in v0.1.81, remove gate after 2026-11-23.
2489
2614
  "terminal-restore-modes": z.boolean().optional(),
2490
2615
  // COMPAT(terminalInputModeReplay): added in v0.2.6, remove gate after 2027-02-02.
@@ -2563,6 +2688,19 @@ export const ServerInfoStatusPayloadSchema = z
2563
2688
  workspaceScriptManagement: z.boolean().optional(),
2564
2689
  // COMPAT(projectCustomIcon): added in v0.2.0, remove after 2027-01-20.
2565
2690
  projectCustomIcon: z.boolean().optional(),
2691
+ // COMPAT(fsEntryOps): added in v0.3.0, remove gate after 2027-02-08.
2692
+ fsEntryOps: z.boolean().optional(),
2693
+ // COMPAT(fsEntryDuplicate): added in v0.3.0, remove gate after 2027-02-09.
2694
+ fsEntryDuplicate: z.boolean().optional(),
2695
+ // COMPAT(checkoutDiscardChanges): added in v0.3.0, remove gate after 2027-02-08.
2696
+ checkoutDiscardChanges: z.boolean().optional(),
2697
+ // COMPAT(agentProfiles): added in v0.3.2, remove gate after 2027-02-11.
2698
+ // An older daemon parses its persisted config strictly, so writing
2699
+ // agentProfiles to one is silently dropped. The client hides the feature
2700
+ // rather than letting a save appear to succeed.
2701
+ agentProfiles: z.boolean().optional(),
2702
+ // COMPAT(agentConfigApply): added in v0.3.2, remove gate after 2027-02-11.
2703
+ agentConfigApply: z.boolean().optional(),
2566
2704
  })
2567
2705
  .optional(),
2568
2706
  })
@@ -3897,6 +4035,15 @@ export const CheckoutGithubSetAutoMergeResponseSchema = z.object({
3897
4035
  requestId: z.string(),
3898
4036
  }),
3899
4037
  });
4038
+ export const CheckoutDiscardChangesResponseSchema = z.object({
4039
+ type: z.literal("checkout.discard_changes.response"),
4040
+ payload: z.object({
4041
+ cwd: z.string(),
4042
+ success: z.boolean(),
4043
+ error: CheckoutErrorSchema.nullable(),
4044
+ requestId: z.string(),
4045
+ }),
4046
+ });
3900
4047
  export const CheckoutCommitsListResponseSchema = z.object({
3901
4048
  type: z.literal("checkout.commits.list.response"),
3902
4049
  payload: z.object({
@@ -4314,6 +4461,49 @@ export const FileWriteResponseSchema = z.object({
4314
4461
  requestId: z.string(),
4315
4462
  }),
4316
4463
  });
4464
+ export const FileEntryCreateResponseSchema = z.object({
4465
+ type: z.literal("fs.entry.create.response"),
4466
+ payload: z.object({
4467
+ cwd: z.string(),
4468
+ parentPath: z.string(),
4469
+ path: z.string().nullable(),
4470
+ success: z.boolean(),
4471
+ error: z.string().nullable(),
4472
+ requestId: z.string(),
4473
+ }),
4474
+ });
4475
+ export const FileEntryRenameResponseSchema = z.object({
4476
+ type: z.literal("fs.entry.rename.response"),
4477
+ payload: z.object({
4478
+ cwd: z.string(),
4479
+ path: z.string(),
4480
+ renamedPath: z.string().nullable(),
4481
+ success: z.boolean(),
4482
+ error: z.string().nullable(),
4483
+ requestId: z.string(),
4484
+ }),
4485
+ });
4486
+ export const FileEntryDuplicateResponseSchema = z.object({
4487
+ type: z.literal("fs.entry.duplicate.response"),
4488
+ payload: z.object({
4489
+ cwd: z.string(),
4490
+ path: z.string(),
4491
+ duplicatedPath: z.string().nullable(),
4492
+ success: z.boolean(),
4493
+ error: z.string().nullable(),
4494
+ requestId: z.string(),
4495
+ }),
4496
+ });
4497
+ export const FileEntryDeleteResponseSchema = z.object({
4498
+ type: z.literal("fs.entry.delete.response"),
4499
+ payload: z.object({
4500
+ cwd: z.string(),
4501
+ path: z.string(),
4502
+ success: z.boolean(),
4503
+ error: z.string().nullable(),
4504
+ requestId: z.string(),
4505
+ }),
4506
+ });
4317
4507
  export const FileUpdateSchema = z.object({
4318
4508
  type: z.literal("fs.file.update"),
4319
4509
  payload: z.object({
@@ -4412,6 +4602,7 @@ export const ListAvailableProvidersResponseSchema = z.object({
4412
4602
  export const GetProvidersSnapshotResponseMessageSchema = z.object({
4413
4603
  type: z.literal("get_providers_snapshot_response"),
4414
4604
  payload: z.object({
4605
+ cwd: z.string().optional(),
4415
4606
  entries: z.array(ProviderSnapshotEntrySchema),
4416
4607
  compactSnapshot: CompactProviderSnapshotSchema.optional(),
4417
4608
  snapshotHash: z.string().optional(),
@@ -4671,6 +4862,19 @@ export const HubExecutionAgentCreateResponseSchema = z.object({
4671
4862
  error: HubExecutionAgentCreateErrorSchema.nullable(),
4672
4863
  }),
4673
4864
  });
4865
+ export const HubExecutionAgentValidationIssueSchema = z.object({
4866
+ path: z.array(z.union([z.string(), z.number()])),
4867
+ message: z.string(),
4868
+ });
4869
+ export const HubExecutionAgentValidateResponseSchema = z.object({
4870
+ type: z.literal("hub.execution.agent.validate.response"),
4871
+ payload: z.object({
4872
+ requestId: z.string(),
4873
+ valid: z.boolean(),
4874
+ issues: z.array(HubExecutionAgentValidationIssueSchema),
4875
+ error: z.string().nullable(),
4876
+ }),
4877
+ });
4674
4878
  export const HubExecutionControlResponseSchema = z.object({
4675
4879
  type: z.literal("hub.execution.control.response"),
4676
4880
  payload: z.object({
@@ -4699,6 +4903,7 @@ export const HubExecutionAgentStreamSchema = z.object({
4699
4903
  });
4700
4904
  export const HubExecutionOutboundMessageSchema = z.discriminatedUnion("type", [
4701
4905
  HubExecutionAgentCreateResponseSchema,
4906
+ HubExecutionAgentValidateResponseSchema,
4702
4907
  HubExecutionControlResponseSchema,
4703
4908
  HubExecutionAgentUpdateSchema,
4704
4909
  HubExecutionAgentStreamSchema,
@@ -4723,6 +4928,7 @@ export function parseHubExecutionOutboundMessage(value) {
4723
4928
  }
4724
4929
  export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4725
4930
  HubExecutionAgentCreateResponseSchema,
4931
+ HubExecutionAgentValidateResponseSchema,
4726
4932
  HubExecutionControlResponseSchema,
4727
4933
  HubExecutionAgentUpdateSchema,
4728
4934
  HubExecutionAgentStreamSchema,
@@ -4739,6 +4945,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4739
4945
  DictationStreamErrorMessageSchema,
4740
4946
  StatusMessageSchema,
4741
4947
  PongMessageSchema,
4948
+ PushUnregisterResponseSchema,
4742
4949
  RpcErrorMessageSchema,
4743
4950
  ArtifactMessageSchema,
4744
4951
  AgentUpdateMessageSchema,
@@ -4795,6 +5002,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4795
5002
  SetAgentModelResponseMessageSchema,
4796
5003
  SetAgentThinkingResponseMessageSchema,
4797
5004
  SetAgentFeatureResponseMessageSchema,
5005
+ AgentConfigApplyResponseMessageSchema,
4798
5006
  AgentDetachResponseMessageSchema,
4799
5007
  AgentRewindResponseMessageSchema,
4800
5008
  UpdateAgentResponseMessageSchema,
@@ -4821,6 +5029,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4821
5029
  CheckoutPullResponseSchema,
4822
5030
  CheckoutPushResponseSchema,
4823
5031
  CheckoutRefreshResponseSchema,
5032
+ CheckoutDiscardChangesResponseSchema,
4824
5033
  CheckoutPrCreateResponseSchema,
4825
5034
  CheckoutPrMergeResponseSchema,
4826
5035
  CheckoutForgeSetAutoMergeResponseSchema,
@@ -4848,6 +5057,10 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
4848
5057
  FileSubscribeResponseSchema,
4849
5058
  FileUnsubscribeResponseSchema,
4850
5059
  FileWriteResponseSchema,
5060
+ FileEntryCreateResponseSchema,
5061
+ FileEntryRenameResponseSchema,
5062
+ FileEntryDuplicateResponseSchema,
5063
+ FileEntryDeleteResponseSchema,
4851
5064
  FileUpdateSchema,
4852
5065
  ProjectIconResponseSchema,
4853
5066
  ProjectIconGetResponseSchema,