@camerontaylor/paseo-protocol 0.8.0-fork.3 → 0.9.1-fork.1

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,9 @@
1
+ import { AgentProfileSchema, AgentSkillSelectionSchema } from "./agent-profile.js";
2
+ export { AgentProfileSchema, AgentSkillSelectionSchema, } from "./agent-profile.js";
3
+ import { PluginIdSchema, PluginRequirementsSchema, PluginSourceSchema } from "./plugin-config.js";
4
+ export { PluginIdSchema, PluginRequirementsSchema, DirectoryPluginSourceSchema, PluginSourceSchema, } from "./plugin-config.js";
5
+ import { TerminalProfileSchema } from "./terminal-profile.js";
6
+ export { TerminalProfileSchema } from "./terminal-profile.js";
1
7
  import { z } from "zod";
2
8
  import { TerminalActivitySchema } from "./terminal-activity.js";
3
9
  import { CLIENT_CAPS } from "./client-capabilities.js";
@@ -56,41 +62,6 @@ const MutableMetadataGenerationConfigSchema = z
56
62
  providers: z.array(MutableStructuredGenerationProviderSchema).default([]),
57
63
  })
58
64
  .passthrough();
59
- export const TerminalProfileSchema = z
60
- .object({
61
- id: z.string(),
62
- name: z.string(),
63
- command: z.string(),
64
- args: z.array(z.string()).optional(),
65
- icon: z.string().optional(),
66
- })
67
- .passthrough();
68
- /**
69
- * A named launch bundle: a provider plus the agent-config values a client would
70
- * otherwise set one control at a time. Field names mirror `AgentSessionConfig`
71
- * so applying a profile is a copy rather than a translation table.
72
- *
73
- * There is deliberately no system prompt here. `AgentSessionConfig.systemPrompt`
74
- * is creation-only, so a profile carrying one would apply when starting a new
75
- * agent and silently do nothing when applied to a running one.
76
- */
77
- export const AgentProfileSchema = z
78
- .object({
79
- id: z.string(),
80
- name: z.string(),
81
- /** A key into the client's icon registry, not a glyph. Unknown keys draw the default. */
82
- icon: z.string().optional(),
83
- /** An identity colour name shared with host badges. Unknown values draw unthemed. */
84
- color: z.string().optional(),
85
- provider: z.string(),
86
- model: z.string().optional(),
87
- modeId: z.string().optional(),
88
- thinkingOptionId: z.string().optional(),
89
- featureValues: z.record(z.string(), z.unknown()).optional(),
90
- /** Free text, surfaced to orchestrating agents by the `list_profiles` MCP tool. */
91
- notes: z.string().optional(),
92
- })
93
- .passthrough();
94
65
  const MutableBrowserToolsConfigSchema = z
95
66
  .object({
96
67
  enabled: z.boolean().default(false),
@@ -101,21 +72,6 @@ const MutableRelayConfigSchema = z
101
72
  enabled: z.boolean(),
102
73
  })
103
74
  .passthrough();
104
- export const PluginIdSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
105
- // Semver validation belongs at the manifest/runtime boundary, not on the wire.
106
- export const PluginRequirementsSchema = z.object({ paseo: z.string().optional() });
107
- export const DirectoryPluginSourceSchema = z
108
- .object({
109
- source: z.literal("directory"),
110
- path: z.string().min(1),
111
- enabled: z.boolean().optional(),
112
- })
113
- .strict();
114
- export const PluginSourceSchema = z.discriminatedUnion("source", [DirectoryPluginSourceSchema]);
115
- export const AgentSkillSelectionSchema = z.discriminatedUnion("mode", [
116
- z.object({ mode: z.literal("all") }).strict(),
117
- z.object({ mode: z.literal("custom"), skills: z.array(z.string()) }).strict(),
118
- ]);
119
75
  export const MutableDaemonConfigSchema = z
120
76
  .object({
121
77
  // COMPAT(relayConfig): added in v0.2.6, remove after 2027-01-31 when old daemons are unsupported.
@@ -1127,9 +1083,8 @@ export const FetchAgentHistoryRequestMessageSchema = z.object({
1127
1083
  type: z.literal("fetch_agent_history_request"),
1128
1084
  requestId: z.string(),
1129
1085
  filter: AgentDirectoryFilterSchema.optional(),
1130
- // A ranked free-text query over agent title, workspace name, branch, and
1131
- // project name. Present only on history: agent subscriptions filter on
1132
- // structure, not on relevance. Ranking replaces `sort` when it is set.
1086
+ // A free-text filter over agent title, workspace name, branch, and project name.
1087
+ // Matching rows follow the requested sort and cursor pagination.
1133
1088
  search: z.string().optional(),
1134
1089
  sort: z
1135
1090
  .array(z.object({
@@ -1248,6 +1203,48 @@ export const PluginSourceInstallRequestSchema = z.object({
1248
1203
  // COMPAT(plugin-source-path): accepted for v0.7 clients; remove after 2027-09-01.
1249
1204
  pluginPath: z.string().min(1).optional(),
1250
1205
  });
1206
+ export const PluginSourceIdentitySchema = z.discriminatedUnion("kind", [
1207
+ z.object({ kind: z.literal("directory"), path: z.string() }),
1208
+ z.object({ kind: z.literal("git"), remote: z.string(), pluginPath: z.string() }),
1209
+ z.object({ kind: z.literal("npm"), packageName: z.string(), pluginPath: z.string() }),
1210
+ ]);
1211
+ export const PluginInstallationSchema = z.object({
1212
+ identity: PluginSourceIdentitySchema,
1213
+ currentRevision: z.string().optional(),
1214
+ });
1215
+ export const PluginUpdateTargetSchema = z.discriminatedUnion("kind", [
1216
+ z.object({ kind: z.literal("git"), commit: z.string().regex(/^[0-9a-f]{40,64}$/) }),
1217
+ z.object({
1218
+ kind: z.literal("npm"),
1219
+ version: z.string().min(1),
1220
+ resolved: z.string().url(),
1221
+ integrity: z.string().min(1),
1222
+ }),
1223
+ ]);
1224
+ export const PluginUpdateProposalSchema = z.object({
1225
+ id: PluginIdSchema,
1226
+ expected: z.object({
1227
+ identity: PluginSourceIdentitySchema,
1228
+ installationRoot: z.string(),
1229
+ revision: z.string(),
1230
+ }),
1231
+ target: PluginUpdateTargetSchema,
1232
+ });
1233
+ export const PluginUpdateSelectionSchema = z.discriminatedUnion("kind", [
1234
+ z.object({ kind: z.literal("git"), ref: z.string().min(1) }),
1235
+ z.object({ kind: z.literal("npm"), version: z.string().min(1) }),
1236
+ ]);
1237
+ export const PluginUpdatePreviewRequestSchema = z.object({
1238
+ type: z.literal("plugin.source.update.preview.request"),
1239
+ requestId: z.string(),
1240
+ pluginId: PluginIdSchema.optional(),
1241
+ target: PluginUpdateSelectionSchema.optional(),
1242
+ });
1243
+ export const PluginUpdateApplyRequestSchema = z.object({
1244
+ type: z.literal("plugin.source.update.apply.request"),
1245
+ requestId: z.string(),
1246
+ proposals: z.array(PluginUpdateProposalSchema).min(1),
1247
+ });
1251
1248
  export const PluginSourceStatusRequestSchema = z.object({
1252
1249
  type: z.literal("plugin.source.status.request"),
1253
1250
  requestId: z.string(),
@@ -1397,7 +1394,7 @@ export const CreateAgentWorktreeTargetSchema = z.discriminatedUnion("mode", [
1397
1394
  ]);
1398
1395
  export const CreateAgentRequestMessageSchema = z.object({
1399
1396
  type: z.literal("create_agent_request"),
1400
- // A creation key requires initialPrompt to be sent separately with a stable messageId.
1397
+ // Legacy create_agent_request uses a separate initial-message receipt when keyed.
1401
1398
  idempotencyKey: z.string().min(1).max(512).optional(),
1402
1399
  config: AgentSessionConfigSchema,
1403
1400
  env: z.record(z.string(), z.string()).optional(),
@@ -1417,6 +1414,30 @@ export const CreateAgentRequestMessageSchema = z.object({
1417
1414
  labels: z.record(z.string(), z.string()).default({}),
1418
1415
  requestId: z.string(),
1419
1416
  });
1417
+ /** Resource IDs are optional on creation; supplied IDs retain their identity on replay. */
1418
+ export const AgentCreateRequestSchema = CreateAgentRequestMessageSchema.extend({
1419
+ type: z.literal("agent.create.request"),
1420
+ agentId: z.uuid().optional(),
1421
+ attachments: z.array(AgentAttachmentSchema).optional(),
1422
+ subscribe: z.boolean().optional(),
1423
+ });
1424
+ export const WorkspaceInitialAgentSchema = AgentCreateRequestSchema.omit({
1425
+ type: true,
1426
+ requestId: true,
1427
+ idempotencyKey: true,
1428
+ subscribe: true,
1429
+ workspaceId: true,
1430
+ worktree: true,
1431
+ worktreeName: true,
1432
+ git: true,
1433
+ });
1434
+ export const CreationSubscribeRequestSchema = z.object({
1435
+ type: z.literal("creation.subscribe.request"),
1436
+ requestId: z.string(),
1437
+ kind: z.enum(["workspace", "agent"]),
1438
+ idempotencyKey: z.string().min(1).max(512),
1439
+ subscribe: z.boolean().optional(),
1440
+ });
1420
1441
  export const ListProviderModelsRequestMessageSchema = z.object({
1421
1442
  type: z.literal("list_provider_models_request"),
1422
1443
  provider: AgentProviderSchema,
@@ -1512,6 +1533,13 @@ export const FetchAgentTimelineRequestMessageSchema = z.object({
1512
1533
  // Allow the client to merge this bounded page outside its contiguous loaded range.
1513
1534
  mergeWindow: z.boolean().optional(),
1514
1535
  });
1536
+ export const AgentTimelineSearchRequestMessageSchema = z.object({
1537
+ type: z.literal("agent.timeline.search.request"),
1538
+ agentId: z.string(),
1539
+ requestId: z.string(),
1540
+ query: z.string(),
1541
+ cursor: z.number().int().nonnegative().optional(),
1542
+ });
1515
1543
  export const AgentTimelineListPromptsRequestMessageSchema = z.object({
1516
1544
  type: z.literal("agent.timeline.list_prompts.request"),
1517
1545
  agentId: z.string(),
@@ -2179,7 +2207,14 @@ export const ArchiveWorkspaceRequestSchema = z.object({
2179
2207
  // between an existing local directory and a newly created paseo worktree.
2180
2208
  export const WorkspaceCreateRequestSchema = z.object({
2181
2209
  type: z.literal("workspace.create.request"),
2210
+ workspaceId: z
2211
+ .string()
2212
+ .regex(/^wks_[a-f0-9]{16}$/)
2213
+ .optional(),
2214
+ agent: WorkspaceInitialAgentSchema.optional(),
2215
+ subscribe: z.boolean().optional(),
2182
2216
  requestId: z.string(),
2217
+ idempotencyKey: z.string().min(1).max(512).optional(),
2183
2218
  // Optional user-set title applied to the created workspace.
2184
2219
  title: z.string().optional(),
2185
2220
  // Optional prompt context for workspace-level name/branch generation.
@@ -2707,6 +2742,8 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2707
2742
  PluginSourceInstallRequestSchema,
2708
2743
  PluginSourceStatusRequestSchema,
2709
2744
  PluginSourceUpdateRequestSchema,
2745
+ PluginUpdatePreviewRequestSchema,
2746
+ PluginUpdateApplyRequestSchema,
2710
2747
  PluginReloadRequestSchema,
2711
2748
  PluginEnableRequestSchema,
2712
2749
  PluginDisableRequestSchema,
@@ -2743,6 +2780,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2743
2780
  RestartServerRequestMessageSchema,
2744
2781
  DaemonUpdateRequestMessageSchema,
2745
2782
  FetchAgentTimelineRequestMessageSchema,
2783
+ AgentTimelineSearchRequestMessageSchema,
2746
2784
  AgentTimelineListPromptsRequestMessageSchema,
2747
2785
  ProviderSubagentListRequestMessageSchema,
2748
2786
  ProviderSubagentTimelineRequestMessageSchema,
@@ -2804,6 +2842,8 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2804
2842
  ProjectGithubCloneRequestSchema,
2805
2843
  ArchiveWorkspaceRequestSchema,
2806
2844
  WorkspaceCreateRequestSchema,
2845
+ AgentCreateRequestSchema,
2846
+ CreationSubscribeRequestSchema,
2807
2847
  WorkspaceClearAttentionRequestSchema,
2808
2848
  WorkspaceMarkUnreadRequestSchema,
2809
2849
  FileExplorerRequestSchema,
@@ -3009,6 +3049,9 @@ export const ServerInfoStatusPayloadSchema = z
3009
3049
  .object({
3010
3050
  // COMPAT(agentRequestReceipts): added in v0.8.0; remove gate after 2027-03-05.
3011
3051
  agentRequestReceipts: z.boolean().optional(),
3052
+ // COMPAT(workspaceRequestReceipts): added in v0.8.0; remove gate after 2027-03-07.
3053
+ workspaceRequestReceipts: z.boolean().optional(),
3054
+ creationLifecycle: z.boolean().optional(),
3012
3055
  // COMPAT(hubAgentRpc): added in v0.8.0; remove gate after 2027-03-05.
3013
3056
  hubAgentRpc: z.boolean().optional(),
3014
3057
  providersSnapshot: z.boolean().optional(),
@@ -3058,6 +3101,10 @@ export const ServerInfoStatusPayloadSchema = z
3058
3101
  pluginLogs: z.boolean().optional(),
3059
3102
  // COMPAT(pluginGitManagement): added in v0.7.0, remove gate after 2027-08-26.
3060
3103
  pluginGitManagement: z.boolean().optional(),
3104
+ // COMPAT(pluginSourceInstallation): added in v0.8.0; remove gate after 2027-03-16 once daemon floor supports source identifiers.
3105
+ pluginSourceInstallation: z.boolean().optional(),
3106
+ // COMPAT(pluginSourceUpdates): added in v0.8.0; remove gate after 2027-03-16 once daemon floor supports reviewed updates.
3107
+ pluginSourceUpdates: z.boolean().optional(),
3061
3108
  // COMPAT(pluginThemes): added in v0.5.0, remove gate after 2027-08-20.
3062
3109
  // A daemon that predates this flag keeps `addTheme` in the server bundle it compiles,
3063
3110
  // so a theme plugin cannot start there at all.
@@ -3108,6 +3155,8 @@ export const ServerInfoStatusPayloadSchema = z
3108
3155
  agentForkContextCursor: z.boolean().optional(),
3109
3156
  // COMPAT(providerSubagents): added in v0.1.107, remove gate after 2027-01-12.
3110
3157
  providerSubagents: z.boolean().optional(),
3158
+ // COMPAT(projectedSubagentTimeline): added after v0.8.0, remove gates after 2027-03-14; retain wire field.
3159
+ projectedSubagentTimeline: z.boolean().optional(),
3111
3160
  // COMPAT(providerSubagentNesting): added in v0.7, remove gate after 2027-03-04.
3112
3161
  providerSubagentNesting: z.boolean().optional(),
3113
3162
  // COMPAT(sideConversations): added in 0.7.0-beta.2.fork.1, fork-only — stock peers never gain it, so the gate lasts as long as stock peers are supported.
@@ -3540,13 +3589,10 @@ export const AgentSearchMatchSchema = z.object({
3540
3589
  const AgentDirectoryResponseEntrySchema = z.object({
3541
3590
  agent: AgentSnapshotPayloadSchema,
3542
3591
  project: ProjectPlacementPayloadSchema,
3543
- // Relevance of this entry to the request's `search`, lower being better.
3544
- // Set only when the request carried a query; a client merging results from
3545
- // several hosts needs it to interleave their separately ranked pages.
3592
+ // Legacy relevance metadata remains accepted from older daemons.
3593
+ // Current history responses use the requested chronological sort.
3546
3594
  searchScore: z.number().optional(),
3547
- // Where the query matched, so the row can mark it. The ranker computes this
3548
- // anyway; sending it keeps the client from re-deriving a second opinion that
3549
- // could disagree with the ranking it is explaining.
3595
+ // Legacy server-generated highlights. Current clients highlight displayed text locally.
3550
3596
  searchMatches: z.array(AgentSearchMatchSchema).optional(),
3551
3597
  // COMPAT(directorySync): sequence of this latest directory projection.
3552
3598
  syncSeq: z.number().int().positive().optional(),
@@ -3572,9 +3618,7 @@ export const FetchAgentHistoryResponseMessageSchema = z.object({
3572
3618
  requestId: z.string(),
3573
3619
  entries: z.array(AgentDirectoryResponseEntrySchema),
3574
3620
  pageInfo: AgentDirectoryPageInfoSchema,
3575
- // More sessions matched the request's `search` than the page could hold.
3576
- // Distinct from `pageInfo.hasMore`, which promises a fetchable next page —
3577
- // a ranked result set has none, and the way on is a narrower query.
3621
+ // Older daemons truncate relevance-ranked searches instead of returning a cursor.
3578
3622
  searchTruncated: z.boolean().optional(),
3579
3623
  }),
3580
3624
  });
@@ -4006,6 +4050,23 @@ export const AgentTimelineReplacementMessageSchema = z.object({
4006
4050
  epoch: z.string(),
4007
4051
  }),
4008
4052
  });
4053
+ export const AgentTimelineSearchResponseMessageSchema = z.object({
4054
+ type: z.literal("agent.timeline.search.response"),
4055
+ payload: z.object({
4056
+ requestId: z.string(),
4057
+ agentId: z.string(),
4058
+ epoch: z.string(),
4059
+ locations: z.array(z.object({
4060
+ seq: z.number().int().nonnegative(),
4061
+ role: z.enum(["user", "assistant"]),
4062
+ // Estimated occurrences in the message; the client verifies against rendered text.
4063
+ // COMPAT(timelineSearchCount): added in v0.9.0, remove optional after 2027-09-22.
4064
+ count: z.number().int().positive().optional(),
4065
+ })),
4066
+ nextCursor: z.number().int().nonnegative().nullable(),
4067
+ error: z.string().nullable(),
4068
+ }),
4069
+ });
4009
4070
  export const AgentTimelineListPromptsResponseMessageSchema = z.object({
4010
4071
  type: z.literal("agent.timeline.list_prompts.response"),
4011
4072
  payload: z.object({
@@ -4055,6 +4116,9 @@ export const ProviderSubagentTimelineResponseMessageSchema = z.object({
4055
4116
  provider: AgentProviderSchema.nullable(),
4056
4117
  direction: z.enum(["tail", "before", "after"]),
4057
4118
  epoch: z.string(),
4119
+ projection: z.literal("projected").optional(),
4120
+ startCursor: AgentTimelineCursorSchema.nullable().optional(),
4121
+ endCursor: AgentTimelineCursorSchema.nullable().optional(),
4058
4122
  reset: z.boolean(),
4059
4123
  staleCursor: z.boolean(),
4060
4124
  gap: z.boolean(),
@@ -4069,6 +4133,14 @@ export const ProviderSubagentTimelineResponseMessageSchema = z.object({
4069
4133
  item: AgentTimelineItemPayloadSchema,
4070
4134
  timestamp: z.string(),
4071
4135
  seq: z.number().int().nonnegative(),
4136
+ seqStart: z.number().int().nonnegative().optional(),
4137
+ seqEnd: z.number().int().nonnegative().optional(),
4138
+ sourceSeqRanges: z
4139
+ .array(z.object({
4140
+ startSeq: z.number().int().nonnegative(),
4141
+ endSeq: z.number().int().nonnegative(),
4142
+ }))
4143
+ .optional(),
4072
4144
  })),
4073
4145
  error: z.string().nullable(),
4074
4146
  }),
@@ -4226,9 +4298,58 @@ export const ClearAgentAttentionResponseMessageSchema = z.object({
4226
4298
  agents: z.array(AgentSnapshotPayloadSchema),
4227
4299
  }),
4228
4300
  });
4301
+ export const CreationSnapshotSchema = z.object({
4302
+ kind: z.enum(["workspace", "agent"]),
4303
+ idempotencyKey: z.string(),
4304
+ revision: z.number().int().nonnegative(),
4305
+ phase: z.enum([
4306
+ "accepted",
4307
+ "workspace_ready",
4308
+ "agent_ready",
4309
+ "prompt_started",
4310
+ "completed",
4311
+ "failed",
4312
+ ]),
4313
+ workspaceId: z.string().nullable(),
4314
+ agentId: z.string().nullable(),
4315
+ workspace: WorkspaceDescriptorPayloadSchema.optional(),
4316
+ agent: AgentSnapshotPayloadSchema.optional(),
4317
+ error: z.string().nullable(),
4318
+ setupSkippedReason: z.string().optional(),
4319
+ errorCode: z.string().optional(),
4320
+ failedStage: z.enum(["workspace", "agent", "prompt"]).optional(),
4321
+ outcomeUnknown: z.boolean().optional(),
4322
+ });
4323
+ export const WorkspaceCreationUpdateSchema = z.object({
4324
+ type: z.literal("workspace.create.update"),
4325
+ payload: CreationSnapshotSchema.extend({ subscriptionId: z.string().optional() }),
4326
+ });
4327
+ export const AgentCreationUpdateSchema = WorkspaceCreationUpdateSchema.extend({
4328
+ type: z.literal("agent.create.update"),
4329
+ });
4330
+ export const CreationSubscribeResponseSchema = z.object({
4331
+ type: z.literal("creation.subscribe.response"),
4332
+ payload: z.object({
4333
+ requestId: z.string(),
4334
+ subscriptionId: z.string().optional(),
4335
+ snapshot: CreationSnapshotSchema.nullable(),
4336
+ error: z.string().nullable(),
4337
+ }),
4338
+ });
4339
+ export const AgentCreateResponseSchema = z.object({
4340
+ type: z.literal("agent.create.response"),
4341
+ payload: z.object({
4342
+ requestId: z.string(),
4343
+ agent: AgentSnapshotPayloadSchema.nullable(),
4344
+ error: z.string().nullable(),
4345
+ creation: CreationSnapshotSchema.optional(),
4346
+ }),
4347
+ });
4229
4348
  export const WorkspaceCreateResponseSchema = z.object({
4230
4349
  type: z.literal("workspace.create.response"),
4231
4350
  payload: z.object({
4351
+ agent: AgentSnapshotPayloadSchema.optional(),
4352
+ creation: CreationSnapshotSchema.optional(),
4232
4353
  workspace: WorkspaceDescriptorPayloadSchema.nullable(),
4233
4354
  setupTerminalId: z.string().nullable(),
4234
4355
  setupSkippedReason: z.string().optional(),
@@ -5716,12 +5837,21 @@ export const PluginCatalogGetResponseSchema = z.object({
5716
5837
  }),
5717
5838
  });
5718
5839
  export const PluginStatusSchema = z.enum(["running", "disabled", "failed"]);
5840
+ export const PluginNpmInstallationSchema = z.object({
5841
+ packageName: z.string(),
5842
+ requestedSpec: z.string(),
5843
+ version: z.string(),
5844
+ integrity: z.string(),
5845
+ });
5719
5846
  export const PluginListItemSchema = z.object({
5720
5847
  id: PluginIdSchema,
5848
+ description: z.string().optional(),
5721
5849
  path: z.string(),
5722
5850
  enabled: z.boolean(),
5723
5851
  status: PluginStatusSchema,
5724
5852
  source: z.enum(["directory", "git"]).optional(),
5853
+ npm: PluginNpmInstallationSchema.optional(),
5854
+ installation: PluginInstallationSchema.optional(),
5725
5855
  remote: z.string().optional(),
5726
5856
  ref: z.string().optional(),
5727
5857
  commit: z.string().optional(),
@@ -5760,6 +5890,8 @@ export const PluginSourceInstallResponseSchema = z.object({
5760
5890
  export const PluginSourceStatusItemSchema = z.object({
5761
5891
  id: PluginIdSchema,
5762
5892
  source: z.enum(["directory", "git"]),
5893
+ npm: PluginNpmInstallationSchema.optional(),
5894
+ installation: PluginInstallationSchema.optional(),
5763
5895
  path: z.string(),
5764
5896
  remote: z.string().optional(),
5765
5897
  ref: z.string().optional(),
@@ -5783,6 +5915,30 @@ export const PluginSourceUpdateResponseSchema = z.object({
5783
5915
  type: z.literal("plugin.source.update.response"),
5784
5916
  payload: z.object({ requestId: z.string(), plugins: z.array(PluginSourceUpdateItemSchema) }),
5785
5917
  });
5918
+ export const PluginUpdatePreviewSchema = z.object({
5919
+ id: PluginIdSchema,
5920
+ outcome: z.enum(["update", "current", "installed-newer", "local", "error"]),
5921
+ current: PluginInstallationSchema.optional(),
5922
+ target: PluginUpdateTargetSchema.optional(),
5923
+ links: z.array(z.string()),
5924
+ proposal: PluginUpdateProposalSchema.optional(),
5925
+ error: z.string().optional(),
5926
+ });
5927
+ export const PluginUpdateResultSchema = z.object({
5928
+ id: PluginIdSchema,
5929
+ outcome: z.enum(["updated", "error"]),
5930
+ plugin: PluginListItemSchema.optional(),
5931
+ error: z.string().optional(),
5932
+ warning: z.string().optional(),
5933
+ });
5934
+ export const PluginUpdatePreviewResponseSchema = z.object({
5935
+ type: z.literal("plugin.source.update.preview.response"),
5936
+ payload: z.object({ requestId: z.string(), plugins: z.array(PluginUpdatePreviewSchema) }),
5937
+ });
5938
+ export const PluginUpdateApplyResponseSchema = z.object({
5939
+ type: z.literal("plugin.source.update.apply.response"),
5940
+ payload: z.object({ requestId: z.string(), plugins: z.array(PluginUpdateResultSchema) }),
5941
+ });
5786
5942
  function pluginActionResponse(type) {
5787
5943
  return z.object({
5788
5944
  type: z.literal(type),
@@ -5850,6 +6006,8 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
5850
6006
  PluginSourceInstallResponseSchema,
5851
6007
  PluginSourceStatusResponseSchema,
5852
6008
  PluginSourceUpdateResponseSchema,
6009
+ PluginUpdatePreviewResponseSchema,
6010
+ PluginUpdateApplyResponseSchema,
5853
6011
  PluginReloadResponseSchema,
5854
6012
  PluginEnableResponseSchema,
5855
6013
  PluginDisableResponseSchema,
@@ -5911,6 +6069,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
5911
6069
  FetchAgentResponseMessageSchema,
5912
6070
  FetchAgentTimelineResponseMessageSchema,
5913
6071
  AgentTimelineReplacementMessageSchema,
6072
+ AgentTimelineSearchResponseMessageSchema,
5914
6073
  AgentTimelineListPromptsResponseMessageSchema,
5915
6074
  ProviderSubagentListResponseMessageSchema,
5916
6075
  ProviderSubagentTimelineResponseMessageSchema,
@@ -5926,6 +6085,10 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
5926
6085
  CancelAgentResponseMessageSchema,
5927
6086
  ClearAgentAttentionResponseMessageSchema,
5928
6087
  WorkspaceCreateResponseSchema,
6088
+ AgentCreateResponseSchema,
6089
+ WorkspaceCreationUpdateSchema,
6090
+ AgentCreationUpdateSchema,
6091
+ CreationSubscribeResponseSchema,
5929
6092
  WorkspaceClearAttentionResponseSchema,
5930
6093
  WorkspaceMarkUnreadResponseSchema,
5931
6094
  SendAgentMessageResponseMessageSchema,
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const PluginIdSchema: z.ZodString;
3
+ export declare const PluginRequirementsSchema: z.ZodObject<{
4
+ paseo: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type PluginRequirements = z.infer<typeof PluginRequirementsSchema>;
7
+ export declare const DirectoryPluginSourceSchema: z.ZodObject<{
8
+ source: z.ZodLiteral<"directory">;
9
+ path: z.ZodString;
10
+ enabled: z.ZodOptional<z.ZodBoolean>;
11
+ }, z.core.$strict>;
12
+ export declare const PluginSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ source: z.ZodLiteral<"directory">;
14
+ path: z.ZodString;
15
+ enabled: z.ZodOptional<z.ZodBoolean>;
16
+ }, z.core.$strict>], "source">;
17
+ export type PluginSource = z.infer<typeof PluginSourceSchema>;
18
+ //# sourceMappingURL=plugin-config.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ export const PluginIdSchema = z.string().regex(/^[a-z][a-z0-9-]*$/);
3
+ // Semver validation belongs at the manifest/runtime boundary, not on the wire.
4
+ export const PluginRequirementsSchema = z.object({ paseo: z.string().optional() });
5
+ export const DirectoryPluginSourceSchema = z
6
+ .object({
7
+ source: z.literal("directory"),
8
+ path: z.string().min(1),
9
+ enabled: z.boolean().optional(),
10
+ })
11
+ .strict();
12
+ export const PluginSourceSchema = z.discriminatedUnion("source", [DirectoryPluginSourceSchema]);
13
+ //# sourceMappingURL=plugin-config.js.map
@@ -19,7 +19,7 @@ export function assertPluginCompatibility(input) {
19
19
  if (satisfies(version, range) || satisfies(stableCore, range))
20
20
  return;
21
21
  const action = input.requirements?.paseo === undefined
22
- ? "This plugin has no requirements.paseo and targets Paseo before 0.8. Ask its author to migrate it: https://paseo.sh/docs/plugins/v0.8/migration"
22
+ ? "This plugin has no requirements.paseo and targets Paseo before 0.8. Ask its author to migrate it: https://paseo.sh/docs/plugins/migration"
23
23
  : `Use a compatible plugin version or update the ${input.runtime}.`;
24
24
  throw new Error(`Plugin "${input.id}" requires Paseo ${range}. Your ${input.runtime} is ${input.version}. ${action}`);
25
25
  }
@@ -1,7 +1,10 @@
1
+ import type { PluginInstallation } from "./messages.js";
1
2
  export interface PluginSourceReference {
2
3
  source: string;
3
4
  pluginPath: string | undefined;
4
5
  }
5
6
  export declare function parsePluginSourceReference(reference: string): PluginSourceReference;
6
7
  export declare function formatPluginSourceReference(source: string, pluginPath: string | undefined): string;
8
+ export declare function formatPluginIdentity(identity: PluginInstallation["identity"]): string;
9
+ export declare function formatPluginInstallation(installation: PluginInstallation): string;
7
10
  //# sourceMappingURL=plugin-source-reference.d.ts.map
@@ -1,4 +1,10 @@
1
1
  export function parsePluginSourceReference(reference) {
2
+ const prefix = /^(npm:|github:|git:(?!\/\/))/.exec(reference)?.[0];
3
+ const source = prefix ? reference.slice(prefix.length) : reference;
4
+ const parsed = splitPluginPath(source, { scp: prefix !== "npm:" });
5
+ return { ...parsed, source: `${prefix ?? ""}${parsed.source}` };
6
+ }
7
+ function splitPluginPath(reference, options) {
2
8
  const separator = reference.lastIndexOf(":");
3
9
  if (separator === -1)
4
10
  return { source: reference, pluginPath: undefined };
@@ -13,7 +19,7 @@ export function parsePluginSourceReference(reference) {
13
19
  return { source: reference, pluginPath: undefined };
14
20
  }
15
21
  }
16
- else {
22
+ else if (options.scp) {
17
23
  const scpSeparator = reference.match(/^[^/@\s]+@[^:\s]+:/)?.[0].length;
18
24
  if (scpSeparator !== undefined && separator === scpSeparator - 1) {
19
25
  return { source: reference, pluginPath: undefined };
@@ -38,4 +44,17 @@ function isPortableRelativePluginPath(pluginPath) {
38
44
  return false;
39
45
  return pluginPath.split(/[\\/]/).every((part) => part !== "" && part !== "." && part !== "..");
40
46
  }
47
+ export function formatPluginIdentity(identity) {
48
+ if (identity.kind === "directory")
49
+ return identity.path;
50
+ const source = identity.kind === "npm" ? `npm:${identity.packageName}` : `git:${identity.remote}`;
51
+ return identity.pluginPath === "." ? source : `${source}:${identity.pluginPath}`;
52
+ }
53
+ export function formatPluginInstallation(installation) {
54
+ const identity = formatPluginIdentity(installation.identity);
55
+ const revision = installation.identity.kind === "git"
56
+ ? installation.currentRevision?.slice(0, 12)
57
+ : installation.currentRevision;
58
+ return revision ? `${identity} · ${revision}` : identity;
59
+ }
41
60
  //# sourceMappingURL=plugin-source-reference.js.map
@@ -16,11 +16,8 @@ export interface MatchOptions {
16
16
  /** Omit or pass null to match exactly. `fuzzyPolicyForToken` picks a policy. */
17
17
  fuzzy?: FuzzyPolicy | null;
18
18
  /**
19
- * Match characters that appear in order but not adjacently, so `pasbab` finds
20
- * `paseo-babysit`. Defaults to on. Turn it off where a near miss has to read as
21
- * no match at all: it widens far enough that most typos hit something, and a
22
- * list that preselects its first row would then act on that row when the user
23
- * presses Enter expecting nothing to happen.
19
+ * Match characters in order within one whitespace-delimited word, so `pasbab`
20
+ * finds `paseo-babysit`, but `labdes` cannot join "Label as Design". Defaults to on.
24
21
  */
25
22
  subsequence?: boolean;
26
23
  }
@@ -56,6 +56,12 @@ function scoreSubsequenceMatch(query, text) {
56
56
  let firstIndex = -1;
57
57
  let lastIndex = -1;
58
58
  for (let textIndex = 0; textIndex < text.length && queryIndex < query.length; textIndex += 1) {
59
+ if (/\s/u.test(text[textIndex])) {
60
+ queryIndex = 0;
61
+ firstIndex = -1;
62
+ lastIndex = -1;
63
+ continue;
64
+ }
59
65
  if (text[textIndex] !== query[queryIndex])
60
66
  continue;
61
67
  if (firstIndex === -1)
@@ -242,7 +248,7 @@ export function matchRanges(query, text, score) {
242
248
  if (score.tier === TIER_SUBSEQUENCE) {
243
249
  const indices = [];
244
250
  let queryIndex = 0;
245
- for (let textIndex = 0; textIndex < t.length && queryIndex < q.length; textIndex += 1) {
251
+ for (let textIndex = score.offset; textIndex < t.length && queryIndex < q.length; textIndex += 1) {
246
252
  if (t[textIndex] !== q[queryIndex])
247
253
  continue;
248
254
  indices.push(textIndex);
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const TerminalProfileSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ command: z.ZodString;
6
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ icon: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$loose>;
9
+ export type TerminalProfile = z.infer<typeof TerminalProfileSchema>;
10
+ //# sourceMappingURL=terminal-profile.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export const TerminalProfileSchema = z
3
+ .object({
4
+ id: z.string(),
5
+ name: z.string(),
6
+ command: z.string(),
7
+ args: z.array(z.string()).optional(),
8
+ icon: z.string().optional(),
9
+ })
10
+ .passthrough();
11
+ //# sourceMappingURL=terminal-profile.js.map