@sentry/junior-plugin-api 0.225.0 → 0.227.0

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/index.js CHANGED
@@ -1,23 +1,127 @@
1
1
  // src/object-annotations.ts
2
+ import { z as z2 } from "zod";
3
+
4
+ // src/object-facts.ts
2
5
  import { z } from "zod";
3
- var objectAnnotationSchema = z.object({
4
- kind: z.literal("object"),
5
- key: z.string().trim().min(1).max(256),
6
- label: z.string().trim().min(1).max(256),
7
- objectType: z.enum(["task", "code_change", "automation", "item"]),
8
- title: z.string().trim().min(1).max(512),
9
- url: z.url().max(2048).refine((value) => ["http:", "https:"].includes(new URL(value).protocol)).nullable(),
10
- description: z.string().max(4e3).optional(),
11
- status: z.string().trim().min(1).max(100).optional(),
12
- trigger: z.string().max(4e3).optional(),
13
- warning: z.string().max(1e3).optional()
14
- }).strict();
15
- var ownedObjectAnnotationSchema = objectAnnotationSchema.extend({
16
- plugin: z.string().min(1)
6
+ var text = z.string().trim().min(1).max(160);
7
+ var count = z.number().int().nonnegative();
8
+ var objectFactsSchema = z.discriminatedUnion("type", [
9
+ // Code changes: keep lifecycle, review, and checks separate.
10
+ z.strictObject({
11
+ type: z.literal("code_change"),
12
+ author: text.optional(),
13
+ sourceBranch: text.optional(),
14
+ targetBranch: text.optional(),
15
+ reviewers: z.array(text).max(5).optional(),
16
+ review: z.enum(["required", "approved", "changes_requested"]).optional(),
17
+ checks: z.strictObject({ passed: count, failed: count, pending: count }).optional(),
18
+ mergeable: z.boolean().optional(),
19
+ changedFiles: count.optional(),
20
+ additions: count.optional(),
21
+ deletions: count.optional()
22
+ }),
23
+ // Tasks: ownership and priority first; planning context comes next.
24
+ z.strictObject({
25
+ type: z.literal("task"),
26
+ assignees: z.array(text).max(5).optional(),
27
+ priority: text.optional(),
28
+ project: text.optional(),
29
+ cycle: text.optional(),
30
+ dueDate: z.iso.date().optional(),
31
+ labels: z.array(text).max(5).optional()
32
+ }),
33
+ // Deployments remain Items. Never copy environment values or logs.
34
+ z.strictObject({
35
+ type: z.literal("deployment"),
36
+ project: text.optional(),
37
+ environment: text.optional(),
38
+ revision: text.optional(),
39
+ branch: text.optional()
40
+ })
41
+ ]);
42
+ function objectFactFields(facts) {
43
+ if (!facts) return [];
44
+ const fields = [];
45
+ const list = (values) => values?.length ? `${values.join(", ")}${values.length === 5 ? " (up to 5 shown)" : ""}` : void 0;
46
+ function add(key, label, value) {
47
+ if (value !== void 0 && value !== "")
48
+ fields.push({ key, label, value: String(value) });
49
+ }
50
+ switch (facts.type) {
51
+ case "code_change": {
52
+ const review = {
53
+ required: "Review required",
54
+ approved: "Approved",
55
+ changes_requested: "Changes requested"
56
+ };
57
+ add("review", "Review", facts.review && review[facts.review]);
58
+ const checks = facts.checks;
59
+ add(
60
+ "checks",
61
+ "Checks",
62
+ checks && `${checks.failed} failed \xB7 ${checks.pending} pending \xB7 ${checks.passed} passed`
63
+ );
64
+ add("author", "Author", facts.author);
65
+ add("reviewers", "Requested reviewers", list(facts.reviewers));
66
+ add(
67
+ "mergeable",
68
+ "Conflicts",
69
+ facts.mergeable === void 0 ? void 0 : facts.mergeable ? "No conflicts" : "Has conflicts"
70
+ );
71
+ add("sourceBranch", "From", facts.sourceBranch);
72
+ add("targetBranch", "Into", facts.targetBranch);
73
+ break;
74
+ }
75
+ case "task":
76
+ add(
77
+ "assignees",
78
+ "Assignees",
79
+ facts.assignees?.length === 0 ? "Unassigned" : list(facts.assignees)
80
+ );
81
+ add("priority", "Priority", facts.priority);
82
+ add("project", "Project", facts.project);
83
+ add("cycle", "Cycle", facts.cycle);
84
+ add("dueDate", "Due", facts.dueDate);
85
+ add("labels", "Labels", list(facts.labels));
86
+ break;
87
+ case "deployment":
88
+ add("environment", "Environment", facts.environment);
89
+ add("project", "Project", facts.project);
90
+ add("revision", "Revision", facts.revision);
91
+ add("branch", "Branch", facts.branch);
92
+ break;
93
+ }
94
+ return fields.slice(0, 4);
95
+ }
96
+
97
+ // src/object-annotations.ts
98
+ var objectAnnotationSchema = z2.object({
99
+ kind: z2.literal("object"),
100
+ key: z2.string().trim().min(1).max(256),
101
+ label: z2.string().trim().min(1).max(256),
102
+ objectType: z2.enum(["task", "code_change", "automation", "item"]),
103
+ title: z2.string().trim().min(1).max(512),
104
+ url: z2.url().max(2048).refine((value) => ["http:", "https:"].includes(new URL(value).protocol)).nullable(),
105
+ description: z2.string().max(4e3).optional(),
106
+ status: z2.string().trim().min(1).max(100).optional(),
107
+ trigger: z2.string().max(4e3).optional(),
108
+ warning: z2.string().max(1e3).optional(),
109
+ displayType: z2.string().trim().min(1).max(80).optional(),
110
+ sourceUpdatedAt: z2.iso.datetime({ offset: true }).optional(),
111
+ facts: objectFactsSchema.refine(
112
+ (facts) => new TextEncoder().encode(JSON.stringify(facts)).length <= 4096,
113
+ "Object facts must not exceed 4 KiB"
114
+ ).optional()
115
+ }).strict().refine(
116
+ (annotation) => !annotation.facts || (annotation.facts.type === "deployment" ? annotation.objectType === "item" : annotation.facts.type === annotation.objectType),
117
+ "Object facts must match the object type"
118
+ );
119
+ var ownedObjectAnnotationSchema = objectAnnotationSchema.safeExtend({
120
+ plugin: z2.string().min(1)
17
121
  });
18
122
 
19
123
  // src/annotations.ts
20
- import { z as z2 } from "zod";
124
+ import { z as z3 } from "zod";
21
125
  function usesHttpProtocol(value) {
22
126
  try {
23
127
  const protocol = new URL(value).protocol;
@@ -26,19 +130,19 @@ function usesHttpProtocol(value) {
26
130
  return false;
27
131
  }
28
132
  }
29
- var resourceLinkAnnotationSchema = z2.object({
30
- kind: z2.literal("resource_link"),
31
- key: z2.string().trim().min(1).max(256),
32
- label: z2.string().trim().min(1).max(256),
33
- url: z2.string().url().max(2048).refine(usesHttpProtocol, "URL must use HTTP or HTTPS."),
34
- description: z2.string().trim().min(1).max(512).optional(),
35
- status: z2.enum(["open", "draft", "closed", "merged", "warning"]).optional()
133
+ var resourceLinkAnnotationSchema = z3.object({
134
+ kind: z3.literal("resource_link"),
135
+ key: z3.string().trim().min(1).max(256),
136
+ label: z3.string().trim().min(1).max(256),
137
+ url: z3.string().url().max(2048).refine(usesHttpProtocol, "URL must use HTTP or HTTPS."),
138
+ description: z3.string().trim().min(1).max(512).optional(),
139
+ status: z3.enum(["open", "draft", "closed", "merged", "warning"]).optional()
36
140
  }).strict();
37
- var conversationAnnotationInputSchema = z2.discriminatedUnion("kind", [
141
+ var conversationAnnotationInputSchema = z3.discriminatedUnion("kind", [
38
142
  resourceLinkAnnotationSchema,
39
143
  objectAnnotationSchema
40
144
  ]);
41
- var conversationSidebarIconSchema = z2.enum([
145
+ var conversationSidebarIconSchema = z3.enum([
42
146
  "circle-dot",
43
147
  "circle-dashed",
44
148
  "circle-x",
@@ -46,37 +150,37 @@ var conversationSidebarIconSchema = z2.enum([
46
150
  "git-pull-request",
47
151
  "triangle-alert"
48
152
  ]);
49
- var conversationSidebarAnnotationSchema = z2.object({
153
+ var conversationSidebarAnnotationSchema = z3.object({
50
154
  icon: conversationSidebarIconSchema.optional(),
51
- key: z2.string().trim().min(1).max(256),
52
- label: z2.string().trim().min(1).max(256)
155
+ key: z3.string().trim().min(1).max(256),
156
+ label: z3.string().trim().min(1).max(256)
53
157
  }).strict();
54
158
 
55
159
  // src/code.ts
56
- import { z as z3 } from "zod";
57
- var codeChangeStateSchema = z3.enum(["closed", "merged", "open"]);
58
- var codeChangeInputSchema = z3.object({
59
- closedAt: z3.date().optional(),
60
- conversationIds: z3.array(z3.string().min(1)).default([]),
61
- mergedAt: z3.date().optional(),
62
- number: z3.number().int().positive(),
63
- openedAt: z3.date(),
64
- providerId: z3.string().min(1),
65
- repository: z3.object({
66
- name: z3.string().min(1),
67
- providerId: z3.string().min(1),
68
- url: z3.string().url().optional()
160
+ import { z as z4 } from "zod";
161
+ var codeChangeStateSchema = z4.enum(["closed", "merged", "open"]);
162
+ var codeChangeInputSchema = z4.object({
163
+ closedAt: z4.date().optional(),
164
+ conversationIds: z4.array(z4.string().min(1)).default([]),
165
+ mergedAt: z4.date().optional(),
166
+ number: z4.number().int().positive(),
167
+ openedAt: z4.date(),
168
+ providerId: z4.string().min(1),
169
+ repository: z4.object({
170
+ name: z4.string().min(1),
171
+ providerId: z4.string().min(1),
172
+ url: z4.string().url().optional()
69
173
  }).strict(),
70
174
  state: codeChangeStateSchema,
71
- title: z3.string().min(1).optional(),
72
- updatedAt: z3.date(),
73
- url: z3.string().url().optional()
175
+ title: z4.string().min(1).optional(),
176
+ updatedAt: z4.date(),
177
+ url: z4.string().url().optional()
74
178
  }).strict();
75
179
 
76
180
  // src/conversation-events.ts
77
- import { z as z4 } from "zod";
78
- var conversationEventNameSchema = z4.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
79
- var conversationEventIconSchema = z4.enum([
181
+ import { z as z5 } from "zod";
182
+ var conversationEventNameSchema = z5.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
183
+ var conversationEventIconSchema = z5.enum([
80
184
  "activity",
81
185
  "brain",
82
186
  "calendar",
@@ -88,22 +192,22 @@ var conversationEventIconSchema = z4.enum([
88
192
  "sparkles",
89
193
  "warning"
90
194
  ]);
91
- var conversationEventDetailSchema = z4.object({
92
- content: z4.string().min(1).max(32 * 1024).optional(),
93
- description: z4.string().trim().min(1).max(2e3).optional(),
94
- metadata: z4.array(z4.string().trim().min(1).max(120)).max(8).optional(),
95
- title: z4.string().trim().min(1).max(4e3)
195
+ var conversationEventDetailSchema = z5.object({
196
+ content: z5.string().min(1).max(32 * 1024).optional(),
197
+ description: z5.string().trim().min(1).max(2e3).optional(),
198
+ metadata: z5.array(z5.string().trim().min(1).max(120)).max(8).optional(),
199
+ title: z5.string().trim().min(1).max(4e3)
96
200
  }).strict();
97
- var conversationEventPresentationSchema = z4.object({
98
- details: z4.array(conversationEventDetailSchema).max(100).optional(),
201
+ var conversationEventPresentationSchema = z5.object({
202
+ details: z5.array(conversationEventDetailSchema).max(100).optional(),
99
203
  icon: conversationEventIconSchema.optional(),
100
- preview: z4.string().trim().min(1).max(500).optional(),
101
- title: z4.string().trim().min(1).max(120)
204
+ preview: z5.string().trim().min(1).max(500).optional(),
205
+ title: z5.string().trim().min(1).max(120)
102
206
  }).strict();
103
207
  function defineConversationEvent(definition) {
104
- const identity = z4.object({
208
+ const identity = z5.object({
105
209
  name: conversationEventNameSchema,
106
- version: z4.number().int().positive()
210
+ version: z5.number().int().positive()
107
211
  }).strict().parse({ name: definition.name, version: definition.version });
108
212
  let eventDefinition;
109
213
  const createEvent = (data) => ({
@@ -126,85 +230,85 @@ function defineConversationEvent(definition) {
126
230
  }
127
231
 
128
232
  // src/schemas.ts
129
- import { z as z5 } from "zod";
130
- var slackTeamIdSchema = z5.string().regex(/^T[A-Z0-9]+$/);
131
- var slackConversationIdSchema = z5.string().regex(/^(C|G|D)[A-Z0-9]+$/);
132
- var localConversationIdSchema = z5.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/);
133
- var actorUserIdSchema = z5.string().min(1).refine(
233
+ import { z as z6 } from "zod";
234
+ var slackTeamIdSchema = z6.string().regex(/^T[A-Z0-9]+$/);
235
+ var slackConversationIdSchema = z6.string().regex(/^(C|G|D)[A-Z0-9]+$/);
236
+ var localConversationIdSchema = z6.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/);
237
+ var actorUserIdSchema = z6.string().min(1).refine(
134
238
  (value) => value === value.trim() && value.toLowerCase() !== "unknown"
135
239
  );
136
240
  var exactActorUserIdSchema = actorUserIdSchema;
137
- var nonBlankStringSchema = z5.string().refine((value) => value.trim().length > 0);
241
+ var nonBlankStringSchema = z6.string().refine((value) => value.trim().length > 0);
138
242
  var exactNonBlankStringSchema = nonBlankStringSchema.refine(
139
243
  (value) => value === value.trim()
140
244
  );
141
- var baseLocationSchema = z5.object({
245
+ var baseLocationSchema = z6.object({
142
246
  /** Stable SQL identity used by Location configuration and reporting. */
143
247
  id: nonBlankStringSchema,
144
248
  provider: exactNonBlankStringSchema
145
249
  }).strict();
146
250
  var slackLocationSchema = baseLocationSchema.extend({
147
- provider: z5.literal("slack"),
251
+ provider: z6.literal("slack"),
148
252
  teamId: slackTeamIdSchema,
149
253
  channelId: slackConversationIdSchema,
150
254
  threadTs: exactNonBlankStringSchema.optional()
151
255
  }).strict();
152
- var locationSchema = z5.discriminatedUnion("provider", [
256
+ var locationSchema = z6.discriminatedUnion("provider", [
153
257
  slackLocationSchema
154
258
  ]);
155
- var platformSchema = z5.enum(["slack", "local"]);
156
- var sourceVisibilitySchema = z5.enum(["public", "private"]);
157
- var destinationVisibilitySchema = z5.enum(["public", "private"]);
158
- var slackAddressSchema = z5.object({
159
- platform: z5.literal("slack"),
259
+ var platformSchema = z6.enum(["slack", "local"]);
260
+ var sourceVisibilitySchema = z6.enum(["public", "private"]);
261
+ var destinationVisibilitySchema = z6.enum(["public", "private"]);
262
+ var slackAddressSchema = z6.object({
263
+ platform: z6.literal("slack"),
160
264
  teamId: slackTeamIdSchema,
161
265
  channelId: slackConversationIdSchema,
162
266
  threadTs: exactNonBlankStringSchema.optional()
163
267
  }).strict();
164
268
  var slackDestinationSchema = slackAddressSchema;
165
- var localDestinationSchema = z5.object({
166
- platform: z5.literal("local"),
269
+ var localDestinationSchema = z6.object({
270
+ platform: z6.literal("local"),
167
271
  conversationId: localConversationIdSchema
168
272
  }).strict();
169
- var destinationSchema = z5.discriminatedUnion("platform", [
273
+ var destinationSchema = z6.discriminatedUnion("platform", [
170
274
  slackDestinationSchema,
171
275
  localDestinationSchema
172
276
  ]);
173
- var taskOutcomeSchema = z5.object({
174
- action: z5.literal("send_message"),
277
+ var taskOutcomeSchema = z6.object({
278
+ action: z6.literal("send_message"),
175
279
  destination: slackDestinationSchema
176
280
  }).strict();
177
- var slackSourceSchema = z5.object({
178
- kind: z5.literal("slack"),
281
+ var slackSourceSchema = z6.object({
282
+ kind: z6.literal("slack"),
179
283
  teamId: slackTeamIdSchema,
180
284
  channelId: slackConversationIdSchema,
181
285
  visibility: sourceVisibilitySchema,
182
286
  messageTs: nonBlankStringSchema.optional(),
183
287
  threadTs: nonBlankStringSchema.optional()
184
288
  }).strict();
185
- var localSourceSchema = z5.object({
186
- kind: z5.literal("local"),
187
- visibility: z5.literal("private"),
289
+ var localSourceSchema = z6.object({
290
+ kind: z6.literal("local"),
291
+ visibility: z6.literal("private"),
188
292
  conversationId: localConversationIdSchema
189
293
  }).strict();
190
- var webSourceSchema = z5.object({
191
- kind: z5.literal("web"),
294
+ var webSourceSchema = z6.object({
295
+ kind: z6.literal("web"),
192
296
  visibility: sourceVisibilitySchema,
193
297
  // Web can continue any existing conversation id, including Slack roots.
194
298
  conversationId: exactNonBlankStringSchema
195
299
  }).strict();
196
- var eventSourceSchema = z5.object({
197
- kind: z5.literal("event"),
300
+ var eventSourceSchema = z6.object({
301
+ kind: z6.literal("event"),
198
302
  eventKey: exactNonBlankStringSchema,
199
303
  eventType: exactNonBlankStringSchema,
200
304
  identifier: exactNonBlankStringSchema,
201
305
  namespace: exactNonBlankStringSchema
202
306
  }).strict();
203
- var scheduledAutomationSourceSchema = z5.object({ kind: z5.literal("scheduled_automation") }).strict();
204
- var eventAutomationSourceSchema = z5.object({ kind: z5.literal("event_automation") }).strict();
205
- var pluginDispatchSourceSchema = z5.object({ kind: z5.literal("plugin_dispatch") }).strict();
206
- var agentInvocationSourceSchema = z5.object({ kind: z5.literal("agent_invocation") }).strict();
207
- var currentSourceSchema = z5.discriminatedUnion("kind", [
307
+ var scheduledAutomationSourceSchema = z6.object({ kind: z6.literal("scheduled_automation") }).strict();
308
+ var eventAutomationSourceSchema = z6.object({ kind: z6.literal("event_automation") }).strict();
309
+ var pluginDispatchSourceSchema = z6.object({ kind: z6.literal("plugin_dispatch") }).strict();
310
+ var agentInvocationSourceSchema = z6.object({ kind: z6.literal("agent_invocation") }).strict();
311
+ var currentSourceSchema = z6.discriminatedUnion("kind", [
208
312
  slackSourceSchema,
209
313
  localSourceSchema,
210
314
  webSourceSchema,
@@ -234,22 +338,22 @@ function normalizeStoredSource(value) {
234
338
  const { location: _location, platform: kind, ...fields } = source;
235
339
  return { ...fields, kind };
236
340
  }
237
- var sourceSchema = z5.preprocess(
341
+ var sourceSchema = z6.preprocess(
238
342
  normalizeStoredSource,
239
343
  currentSourceSchema
240
344
  );
241
- var pluginCredentialSubjectSchema = z5.discriminatedUnion(
345
+ var pluginCredentialSubjectSchema = z6.discriminatedUnion(
242
346
  "allowedWhen",
243
347
  [
244
- z5.object({
245
- type: z5.literal("user"),
348
+ z6.object({
349
+ type: z6.literal("user"),
246
350
  userId: exactActorUserIdSchema,
247
- allowedWhen: z5.literal("private-direct-conversation")
351
+ allowedWhen: z6.literal("private-direct-conversation")
248
352
  }).strict(),
249
- z5.object({
250
- type: z5.literal("user"),
353
+ z6.object({
354
+ type: z6.literal("user"),
251
355
  userId: exactActorUserIdSchema,
252
- allowedWhen: z5.literal("scheduled-automation"),
356
+ allowedWhen: z6.literal("scheduled-automation"),
253
357
  taskId: exactNonBlankStringSchema
254
358
  }).strict()
255
359
  ]
@@ -260,30 +364,30 @@ var actorProfileSchema = {
260
364
  userId: exactActorUserIdSchema,
261
365
  userName: nonBlankStringSchema.optional()
262
366
  };
263
- var slackActorSchema = z5.object({
367
+ var slackActorSchema = z6.object({
264
368
  ...actorProfileSchema,
265
- platform: z5.literal("slack"),
369
+ platform: z6.literal("slack"),
266
370
  teamId: slackTeamIdSchema
267
371
  }).strict();
268
- var localActorSchema = z5.object({
372
+ var localActorSchema = z6.object({
269
373
  ...actorProfileSchema,
270
- platform: z5.literal("local")
374
+ platform: z6.literal("local")
271
375
  }).strict();
272
- var webActorSchema = z5.object({
376
+ var webActorSchema = z6.object({
273
377
  ...actorProfileSchema,
274
- platform: z5.literal("web")
378
+ platform: z6.literal("web")
275
379
  }).strict();
276
- var systemActorSchema = z5.object({
277
- platform: z5.literal("system"),
380
+ var systemActorSchema = z6.object({
381
+ platform: z6.literal("system"),
278
382
  name: exactActorUserIdSchema
279
383
  }).strict();
280
- var actorSchema = z5.discriminatedUnion("platform", [
384
+ var actorSchema = z6.discriminatedUnion("platform", [
281
385
  slackActorSchema,
282
386
  localActorSchema,
283
387
  webActorSchema,
284
388
  systemActorSchema
285
389
  ]);
286
- var identitySchema = z5.object({
390
+ var identitySchema = z6.object({
287
391
  displayName: nonBlankStringSchema.optional(),
288
392
  handle: nonBlankStringSchema.optional(),
289
393
  id: exactNonBlankStringSchema,
@@ -291,17 +395,17 @@ var identitySchema = z5.object({
291
395
  providerSubjectId: exactNonBlankStringSchema,
292
396
  providerTenantId: exactNonBlankStringSchema.optional()
293
397
  }).strict();
294
- var userSchema = z5.object({
398
+ var userSchema = z6.object({
295
399
  displayName: nonBlankStringSchema.optional(),
296
400
  email: nonBlankStringSchema.max(320),
297
401
  id: exactNonBlankStringSchema,
298
- identities: z5.array(identitySchema).max(100)
402
+ identities: z6.array(identitySchema).max(100)
299
403
  }).strict();
300
- var dispatchMetadataSchema = z5.record(z5.string(), z5.string()).superRefine((metadata, ctx) => {
404
+ var dispatchMetadataSchema = z6.record(z6.string(), z6.string()).superRefine((metadata, ctx) => {
301
405
  const entries = Object.entries(metadata);
302
406
  if (entries.length > 20) {
303
407
  ctx.addIssue({
304
- code: z5.ZodIssueCode.custom,
408
+ code: z6.ZodIssueCode.custom,
305
409
  message: "Dispatch metadata has too many keys"
306
410
  });
307
411
  return;
@@ -309,7 +413,7 @@ var dispatchMetadataSchema = z5.record(z5.string(), z5.string()).superRefine((me
309
413
  for (const [key, value] of entries) {
310
414
  if (!key.trim()) {
311
415
  ctx.addIssue({
312
- code: z5.ZodIssueCode.custom,
416
+ code: z6.ZodIssueCode.custom,
313
417
  message: "Dispatch metadata values must be strings",
314
418
  path: [key]
315
419
  });
@@ -317,44 +421,44 @@ var dispatchMetadataSchema = z5.record(z5.string(), z5.string()).superRefine((me
317
421
  }
318
422
  if (key.length > 128) {
319
423
  ctx.addIssue({
320
- code: z5.ZodIssueCode.custom,
424
+ code: z6.ZodIssueCode.custom,
321
425
  message: "Dispatch metadata key exceeds the maximum length",
322
426
  path: [key]
323
427
  });
324
428
  }
325
429
  if (/[\r\n]/.test(key)) {
326
430
  ctx.addIssue({
327
- code: z5.ZodIssueCode.custom,
431
+ code: z6.ZodIssueCode.custom,
328
432
  message: "Dispatch metadata keys must be single-line strings",
329
433
  path: [key]
330
434
  });
331
435
  }
332
436
  if (/[\r\n]/.test(value)) {
333
437
  ctx.addIssue({
334
- code: z5.ZodIssueCode.custom,
438
+ code: z6.ZodIssueCode.custom,
335
439
  message: "Dispatch metadata values must be single-line strings",
336
440
  path: [key]
337
441
  });
338
442
  }
339
443
  if (value.length > 512) {
340
444
  ctx.addIssue({
341
- code: z5.ZodIssueCode.custom,
445
+ code: z6.ZodIssueCode.custom,
342
446
  message: "Dispatch metadata value exceeds the maximum length",
343
447
  path: [key]
344
448
  });
345
449
  }
346
450
  }
347
451
  });
348
- var replyAttributionSchema = z5.object({
349
- label: exactNonBlankStringSchema.pipe(z5.string().max(48)).refine((value) => !/[\r\n]/.test(value)),
350
- detail: exactNonBlankStringSchema.pipe(z5.string().max(128)).refine((value) => !/[\r\n]/.test(value)).optional()
452
+ var replyAttributionSchema = z6.object({
453
+ label: exactNonBlankStringSchema.pipe(z6.string().max(48)).refine((value) => !/[\r\n]/.test(value)),
454
+ detail: exactNonBlankStringSchema.pipe(z6.string().max(128)).refine((value) => !/[\r\n]/.test(value)).optional()
351
455
  }).strict();
352
- var dispatchOptionsSchema = z5.object({
353
- idempotencyKey: nonBlankStringSchema.pipe(z5.string().max(512)),
456
+ var dispatchOptionsSchema = z6.object({
457
+ idempotencyKey: nonBlankStringSchema.pipe(z6.string().max(512)),
354
458
  credentialSubject: pluginCredentialSubjectSchema.optional(),
355
459
  destination: slackDestinationSchema,
356
460
  destinationVisibility: destinationVisibilitySchema,
357
- input: nonBlankStringSchema.pipe(z5.string().max(32e3)),
461
+ input: nonBlankStringSchema.pipe(z6.string().max(32e3)),
358
462
  metadata: dispatchMetadataSchema.optional(),
359
463
  replyAttribution: replyAttributionSchema.optional()
360
464
  }).strict();
@@ -422,15 +526,15 @@ function isSlackDestination(destination) {
422
526
  }
423
527
 
424
528
  // src/prompt.ts
425
- import { z as z6 } from "zod";
426
- var promptContextKindSchema = z6.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/);
427
- var promptMessageSchema = z6.object({
428
- text: z6.string().trim().min(1).max(8e3)
529
+ import { z as z7 } from "zod";
530
+ var promptContextKindSchema = z7.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/);
531
+ var promptMessageSchema = z7.object({
532
+ text: z7.string().trim().min(1).max(8e3)
429
533
  }).strict();
430
- var promptContextSchema = z6.object({
534
+ var promptContextSchema = z7.object({
431
535
  kind: promptContextKindSchema,
432
- version: z6.number().int().positive(),
433
- content: z6.record(z6.string(), z6.unknown())
536
+ version: z7.number().int().positive(),
537
+ content: z7.record(z7.string(), z7.unknown())
434
538
  }).strict();
435
539
  function definePromptContext(definition) {
436
540
  const identity = promptContextSchema.pick({ kind: true, version: true }).parse({ kind: definition.kind, version: definition.version });
@@ -444,13 +548,13 @@ function definePromptContext(definition) {
444
548
  }
445
549
 
446
550
  // src/events.ts
447
- import { z as z7 } from "zod";
551
+ import { z as z8 } from "zod";
448
552
  var EVENT_SUMMARY_MAX_LENGTH = 4e3;
449
553
  var EVENT_TEXT_MAX_LENGTH = 8e3;
450
554
  var EVENT_DATA_MAX_KEYS = 32;
451
555
  var EVENT_DATA_MAX_JSON_BYTES = 4e3;
452
556
  var EVENT_GUIDANCE_MAX_LENGTH = 1e3;
453
- var eventDataSchema = z7.record(z7.string(), z7.unknown()).superRefine((value, context) => {
557
+ var eventDataSchema = z8.record(z8.string(), z8.unknown()).superRefine((value, context) => {
454
558
  const keys = Object.keys(value);
455
559
  if (keys.length > EVENT_DATA_MAX_KEYS) {
456
560
  context.addIssue({
@@ -468,17 +572,17 @@ var eventDataSchema = z7.record(z7.string(), z7.unknown()).superRefine((value, c
468
572
  });
469
573
  }
470
574
  });
471
- var eventTypeSchema = z7.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe(
575
+ var eventTypeSchema = z8.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe(
472
576
  "Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."
473
577
  );
474
- var resourceTypeSchema = z7.string().regex(/^[a-z][a-z0-9_]*$/).describe(
578
+ var resourceTypeSchema = z8.string().regex(/^[a-z][a-z0-9_]*$/).describe(
475
579
  "Canonical plugin-defined resource type, such as issue or pull_request."
476
580
  );
477
581
  var EVENT_MATCH_FIELD_NAME = /^[a-z][a-zA-Z0-9]*$/;
478
- var eventMatchFieldSchema = z7.object({
479
- kind: z7.enum(["boolean", "string", "number"]),
480
- description: z7.string().trim().min(1).max(200),
481
- enum: z7.array(z7.string().min(1)).min(1).optional()
582
+ var eventMatchFieldSchema = z8.object({
583
+ kind: z8.enum(["boolean", "string", "number"]),
584
+ description: z8.string().trim().min(1).max(200),
585
+ enum: z8.array(z8.string().min(1)).min(1).optional()
482
586
  }).strict().superRefine((field, context) => {
483
587
  if (field.enum && field.kind !== "string") {
484
588
  context.addIssue({
@@ -488,7 +592,7 @@ var eventMatchFieldSchema = z7.object({
488
592
  });
489
593
  }
490
594
  });
491
- var eventMatchFieldsSchema = z7.record(z7.string().regex(EVENT_MATCH_FIELD_NAME), eventMatchFieldSchema).superRefine((fields, context) => {
595
+ var eventMatchFieldsSchema = z8.record(z8.string().regex(EVENT_MATCH_FIELD_NAME), eventMatchFieldSchema).superRefine((fields, context) => {
492
596
  if (Object.keys(fields).length > EVENT_DATA_MAX_KEYS) {
493
597
  context.addIssue({
494
598
  code: "custom",
@@ -496,13 +600,13 @@ var eventMatchFieldsSchema = z7.record(z7.string().regex(EVENT_MATCH_FIELD_NAME)
496
600
  });
497
601
  }
498
602
  });
499
- var eventMatchSchema = z7.record(
500
- z7.string().regex(EVENT_MATCH_FIELD_NAME),
501
- z7.union([
502
- z7.boolean(),
503
- z7.number().finite(),
504
- z7.string().min(1),
505
- z7.array(z7.union([z7.number().finite(), z7.string().min(1)])).min(1)
603
+ var eventMatchSchema = z8.record(
604
+ z8.string().regex(EVENT_MATCH_FIELD_NAME),
605
+ z8.union([
606
+ z8.boolean(),
607
+ z8.number().finite(),
608
+ z8.string().min(1),
609
+ z8.array(z8.union([z8.number().finite(), z8.string().min(1)])).min(1)
506
610
  ])
507
611
  ).superRefine((match, context) => {
508
612
  if (Object.keys(match).length > EVENT_DATA_MAX_KEYS) {
@@ -553,14 +657,14 @@ function eventMatches(match, data) {
553
657
  }
554
658
  return true;
555
659
  }
556
- var pluginEventTypeSchema = z7.object({
660
+ var pluginEventTypeSchema = z8.object({
557
661
  type: resourceTypeSchema,
558
- supportedEvents: z7.array(eventTypeSchema).min(1),
559
- suggestedEvents: z7.array(eventTypeSchema).optional(),
662
+ supportedEvents: z8.array(eventTypeSchema).min(1),
663
+ suggestedEvents: z8.array(eventTypeSchema).optional(),
560
664
  matchFields: eventMatchFieldsSchema.optional(),
561
- guidance: z7.record(
665
+ guidance: z8.record(
562
666
  eventTypeSchema,
563
- z7.string().trim().min(1).max(EVENT_GUIDANCE_MAX_LENGTH)
667
+ z8.string().trim().min(1).max(EVENT_GUIDANCE_MAX_LENGTH)
564
668
  ).optional()
565
669
  }).strict().superRefine((resourceType, context) => {
566
670
  const supported = /* @__PURE__ */ new Set();
@@ -602,10 +706,10 @@ var pluginEventTypeSchema = z7.object({
602
706
  suggested.add(eventType);
603
707
  });
604
708
  });
605
- var pluginEventsSchema = z7.object({
606
- resourceTypes: z7.array(pluginEventTypeSchema).min(1),
607
- isEnabled: z7.function({ input: [], output: z7.boolean() }).optional(),
608
- normalizeIdentifier: z7.function({ input: [z7.string()], output: z7.string() }).optional()
709
+ var pluginEventsSchema = z8.object({
710
+ resourceTypes: z8.array(pluginEventTypeSchema).min(1),
711
+ isEnabled: z8.function({ input: [], output: z8.boolean() }).optional(),
712
+ normalizeIdentifier: z8.function({ input: [z8.string()], output: z8.string() }).optional()
609
713
  }).strict().superRefine((registration, context) => {
610
714
  const seen = /* @__PURE__ */ new Set();
611
715
  registration.resourceTypes.forEach((resourceType, index) => {
@@ -627,62 +731,62 @@ function normalizeEventIdentifier(registration, identifier) {
627
731
  }
628
732
  return normalized;
629
733
  }
630
- var subscribableResourceSchema = z7.object({
631
- identifier: z7.string().min(1),
632
- label: z7.string().min(1),
633
- namespace: z7.string().min(1),
634
- suggestedEvents: z7.array(eventTypeSchema).optional(),
635
- supportedEvents: z7.array(eventTypeSchema),
734
+ var subscribableResourceSchema = z8.object({
735
+ identifier: z8.string().min(1),
736
+ label: z8.string().min(1),
737
+ namespace: z8.string().min(1),
738
+ suggestedEvents: z8.array(eventTypeSchema).optional(),
739
+ supportedEvents: z8.array(eventTypeSchema),
636
740
  type: resourceTypeSchema
637
741
  }).strict();
638
- var watchResultSchema = z7.object({
639
- events: z7.array(eventTypeSchema).min(1),
640
- id: z7.string().min(1)
742
+ var watchResultSchema = z8.object({
743
+ events: z8.array(eventTypeSchema).min(1),
744
+ id: z8.string().min(1)
641
745
  }).strict();
642
- var eventInputSchema = z7.object({
643
- eventKey: z7.string().min(1),
746
+ var eventInputSchema = z8.object({
747
+ eventKey: z8.string().min(1),
644
748
  eventType: eventTypeSchema,
645
- identifier: z7.string().min(1),
646
- occurredAtMs: z7.number().finite(),
647
- terminal: z7.boolean().optional(),
648
- trustedSummary: z7.string().min(1).transform((value) => value.slice(0, EVENT_SUMMARY_MAX_LENGTH)),
749
+ identifier: z8.string().min(1),
750
+ occurredAtMs: z8.number().finite(),
751
+ terminal: z8.boolean().optional(),
752
+ trustedSummary: z8.string().min(1).transform((value) => value.slice(0, EVENT_SUMMARY_MAX_LENGTH)),
649
753
  /** Trusted structured facts. Prefer ids and urls over long prose. */
650
754
  data: eventDataSchema.optional(),
651
- untrustedText: z7.string().transform((value) => value.slice(0, EVENT_TEXT_MAX_LENGTH)).optional()
755
+ untrustedText: z8.string().transform((value) => value.slice(0, EVENT_TEXT_MAX_LENGTH)).optional()
652
756
  }).strict();
653
757
  var eventSchema = eventInputSchema.extend({
654
- namespace: z7.string().min(1)
758
+ namespace: z8.string().min(1)
655
759
  });
656
760
 
657
761
  // src/tasks.ts
658
- import { z as z8 } from "zod";
659
- var pluginRunTranscriptProvenanceSchema = z8.object({
660
- authority: z8.enum(["instruction", "context"]),
762
+ import { z as z9 } from "zod";
763
+ var pluginRunTranscriptProvenanceSchema = z9.object({
764
+ authority: z9.enum(["instruction", "context"]),
661
765
  actor: actorSchema.optional()
662
766
  }).strict();
663
- var pluginRunTranscriptEntrySchema = z8.discriminatedUnion("type", [
664
- z8.object({
665
- type: z8.literal("message"),
666
- role: z8.enum(["user", "assistant"]),
667
- text: z8.string().min(1),
767
+ var pluginRunTranscriptEntrySchema = z9.discriminatedUnion("type", [
768
+ z9.object({
769
+ type: z9.literal("message"),
770
+ role: z9.enum(["user", "assistant"]),
771
+ text: z9.string().min(1),
668
772
  provenance: pluginRunTranscriptProvenanceSchema.optional(),
669
- isRunActor: z8.boolean().optional()
773
+ isRunActor: z9.boolean().optional()
670
774
  }).strict(),
671
- z8.object({
672
- type: z8.literal("toolResult"),
673
- toolName: z8.string().min(1),
674
- isError: z8.boolean(),
675
- text: z8.string().min(1).optional()
775
+ z9.object({
776
+ type: z9.literal("toolResult"),
777
+ toolName: z9.string().min(1),
778
+ isError: z9.boolean(),
779
+ text: z9.string().min(1).optional()
676
780
  }).strict()
677
781
  ]);
678
- var pluginRunContextSchema = z8.object({
782
+ var pluginRunContextSchema = z9.object({
679
783
  /** User linked to the Actor, when known. */
680
- actorUserId: z8.string().min(1).optional(),
681
- completedAtMs: z8.number().finite(),
682
- conversationId: z8.string().min(1),
784
+ actorUserId: z9.string().min(1).optional(),
785
+ completedAtMs: z9.number().finite(),
786
+ conversationId: z9.string().min(1),
683
787
  destination: destinationSchema,
684
788
  /** Location associated with this Conversation. */
685
- locationId: z8.string().min(1).optional(),
789
+ locationId: z9.string().min(1).optional(),
686
790
  /**
687
791
  * All distinct actors annotated on this run's committed instruction-authority
688
792
  * messages, in first-seen order. Attribution provenance only, never an
@@ -691,45 +795,45 @@ var pluginRunContextSchema = z8.object({
691
795
  * exceed the actors visible in the transcript slice. Usually `[run.actor]`;
692
796
  * possibly empty for system runs with no human instructions.
693
797
  */
694
- actors: z8.array(actorSchema),
798
+ actors: z9.array(actorSchema),
695
799
  /**
696
800
  * The single actor this run executes as. Absent only for actor-less legacy
697
801
  * system records, so authority-sensitive plugins must fail closed.
698
802
  */
699
803
  actor: actorSchema.optional(),
700
- runId: z8.string().min(1),
804
+ runId: z9.string().min(1),
701
805
  source: sourceSchema,
702
- transcript: z8.array(pluginRunTranscriptEntrySchema)
806
+ transcript: z9.array(pluginRunTranscriptEntrySchema)
703
807
  }).strict();
704
808
 
705
809
  // src/tools.ts
706
- import { z as z9 } from "zod";
810
+ import { z as z10 } from "zod";
707
811
  var PluginToolInputError = class extends Error {
708
812
  constructor(message, options) {
709
813
  super(message, options);
710
814
  this.name = "PluginToolInputError";
711
815
  }
712
816
  };
713
- var pluginToolContentSchema = z9.discriminatedUnion("type", [
714
- z9.object({ type: z9.literal("text"), text: z9.string() }).strict(),
715
- z9.object({
716
- type: z9.literal("image"),
717
- data: z9.string(),
718
- mimeType: z9.string()
817
+ var pluginToolContentSchema = z10.discriminatedUnion("type", [
818
+ z10.object({ type: z10.literal("text"), text: z10.string() }).strict(),
819
+ z10.object({
820
+ type: z10.literal("image"),
821
+ data: z10.string(),
822
+ mimeType: z10.string()
719
823
  }).strict()
720
824
  ]);
721
- var pluginToolContinuationSchema = z9.object({
722
- arguments: z9.record(z9.string(), z9.unknown()),
723
- reason: z9.string().min(1).optional()
825
+ var pluginToolContinuationSchema = z10.object({
826
+ arguments: z10.record(z10.string(), z10.unknown()),
827
+ reason: z10.string().min(1).optional()
724
828
  }).strict();
725
- var pluginToolOutputSchema = z9.object({
829
+ var pluginToolOutputSchema = z10.object({
726
830
  /** Object results to save and show with the next reply. Omit for silent updates. */
727
- objectAnnotations: z9.array(objectAnnotationSchema).optional(),
728
- target: z9.string().min(1).optional(),
729
- truncated: z9.boolean().optional(),
831
+ objectAnnotations: z10.array(objectAnnotationSchema).optional(),
832
+ target: z10.string().min(1).optional(),
833
+ truncated: z10.boolean().optional(),
730
834
  continuation: pluginToolContinuationSchema.optional()
731
835
  }).passthrough();
732
- var toolApprovalModeSchema = z9.enum(["auto", "review", "approve"]);
836
+ var toolApprovalModeSchema = z10.enum(["auto", "review", "approve"]);
733
837
  var REQUIRED_TOOL_ANNOTATION_KEYS = [
734
838
  "destructiveHint",
735
839
  "idempotentHint",
@@ -765,7 +869,7 @@ function createZodTool(definition, helperName) {
765
869
  let modelInputSchema;
766
870
  let modelOutputSchema;
767
871
  try {
768
- modelInputSchema = z9.toJSONSchema(inputSchema);
872
+ modelInputSchema = z10.toJSONSchema(inputSchema);
769
873
  } catch (error) {
770
874
  throw new TypeError(
771
875
  `${helperName}() inputSchema must be representable as JSON Schema.`,
@@ -773,7 +877,7 @@ function createZodTool(definition, helperName) {
773
877
  );
774
878
  }
775
879
  try {
776
- modelOutputSchema = z9.toJSONSchema(outputSchema);
880
+ modelOutputSchema = z10.toJSONSchema(outputSchema);
777
881
  } catch (error) {
778
882
  throw new TypeError(
779
883
  `${helperName}() outputSchema must be representable as JSON Schema.`,
@@ -799,7 +903,7 @@ function createZodTool(definition, helperName) {
799
903
  );
800
904
  if (isPluginToolOutputEnvelope(result)) {
801
905
  return {
802
- content: z9.array(pluginToolContentSchema).parse(result.content),
906
+ content: z10.array(pluginToolContentSchema).parse(result.content),
803
907
  details: outputSchema.parse(result.details)
804
908
  };
805
909
  }
@@ -816,76 +920,76 @@ function definePluginTool(definition) {
816
920
  }
817
921
 
818
922
  // src/operations.ts
819
- import { z as z10 } from "zod";
820
- var pluginApiRouteRequestContextSchema = z10.object({
821
- auth: z10.object({
822
- user: z10.object({
823
- email: z10.string().nullable().optional(),
824
- emailVerified: z10.boolean().optional(),
825
- name: z10.string().nullable().optional()
923
+ import { z as z11 } from "zod";
924
+ var pluginApiRouteRequestContextSchema = z11.object({
925
+ auth: z11.object({
926
+ user: z11.object({
927
+ email: z11.string().nullable().optional(),
928
+ emailVerified: z11.boolean().optional(),
929
+ name: z11.string().nullable().optional()
826
930
  }).strict()
827
931
  }).strict(),
828
932
  pluginName: nonBlankStringSchema
829
933
  }).strict();
830
934
 
831
935
  // src/credentials.ts
832
- import { z as z11 } from "zod";
833
- var pluginProviderNameSchema = z11.string().regex(/^[a-z][a-z0-9-]*$/);
834
- var pluginGrantNameSchema = z11.string().regex(/^[a-z][a-z0-9.-]*$/);
835
- var pluginGrantAccessSchema = z11.union([
836
- z11.literal("read"),
837
- z11.literal("write")
936
+ import { z as z12 } from "zod";
937
+ var pluginProviderNameSchema = z12.string().regex(/^[a-z][a-z0-9-]*$/);
938
+ var pluginGrantNameSchema = z12.string().regex(/^[a-z][a-z0-9.-]*$/);
939
+ var pluginGrantAccessSchema = z12.union([
940
+ z12.literal("read"),
941
+ z12.literal("write")
838
942
  ]);
839
- var pluginAuthorizationSchema = z11.object({
943
+ var pluginAuthorizationSchema = z12.object({
840
944
  provider: pluginProviderNameSchema,
841
945
  scope: nonBlankStringSchema.optional(),
842
- type: z11.literal("oauth")
946
+ type: z12.literal("oauth")
843
947
  }).strict();
844
- var pluginProviderAccountSchema = z11.object({
948
+ var pluginProviderAccountSchema = z12.object({
845
949
  displayName: nonBlankStringSchema.optional(),
846
950
  handle: nonBlankStringSchema.optional(),
847
951
  id: nonBlankStringSchema,
848
952
  label: nonBlankStringSchema.optional(),
849
953
  url: nonBlankStringSchema.optional()
850
954
  }).strict();
851
- var pluginStoredTokensSchema = z11.object({
955
+ var pluginStoredTokensSchema = z12.object({
852
956
  account: pluginProviderAccountSchema.optional(),
853
957
  accessToken: nonBlankStringSchema,
854
- expiresAt: z11.number().finite().optional(),
958
+ expiresAt: z12.number().finite().optional(),
855
959
  refreshToken: nonBlankStringSchema,
856
- refreshTokenExpiresAt: z11.number().finite().optional(),
960
+ refreshTokenExpiresAt: z12.number().finite().optional(),
857
961
  scope: nonBlankStringSchema.optional()
858
962
  }).strict();
859
- var pluginGrantSchema = z11.object({
963
+ var pluginGrantSchema = z12.object({
860
964
  access: pluginGrantAccessSchema,
861
965
  leaseScope: nonBlankStringSchema.optional(),
862
966
  name: pluginGrantNameSchema,
863
967
  reason: nonBlankStringSchema.optional(),
864
- requirements: z11.array(nonBlankStringSchema).min(1).optional()
968
+ requirements: z12.array(nonBlankStringSchema).min(1).optional()
865
969
  }).strict();
866
- var pluginCredentialHeaderTransformSchema = z11.object({
867
- domain: z11.string().min(1),
868
- headers: z11.record(z11.string(), z11.string()).refine((headers) => Object.keys(headers).length > 0)
970
+ var pluginCredentialHeaderTransformSchema = z12.object({
971
+ domain: z12.string().min(1),
972
+ headers: z12.record(z12.string(), z12.string()).refine((headers) => Object.keys(headers).length > 0)
869
973
  }).strict();
870
- var pluginCredentialLeaseSchema = z11.object({
974
+ var pluginCredentialLeaseSchema = z12.object({
871
975
  account: pluginProviderAccountSchema.optional(),
872
976
  authorization: pluginAuthorizationSchema.optional(),
873
- expiresAt: z11.string().refine((value) => Number.isFinite(Date.parse(value))),
874
- headerTransforms: z11.array(pluginCredentialHeaderTransformSchema).min(1)
977
+ expiresAt: z12.string().refine((value) => Number.isFinite(Date.parse(value))),
978
+ headerTransforms: z12.array(pluginCredentialHeaderTransformSchema).min(1)
875
979
  }).strict();
876
- var pluginCredentialResultSchema = z11.discriminatedUnion("type", [
877
- z11.object({
980
+ var pluginCredentialResultSchema = z12.discriminatedUnion("type", [
981
+ z12.object({
878
982
  lease: pluginCredentialLeaseSchema,
879
- type: z11.literal("lease")
983
+ type: z12.literal("lease")
880
984
  }).strict(),
881
- z11.object({
985
+ z12.object({
882
986
  authorization: pluginAuthorizationSchema.optional(),
883
987
  message: nonBlankStringSchema,
884
- type: z11.literal("needed")
988
+ type: z12.literal("needed")
885
989
  }).strict(),
886
- z11.object({
990
+ z12.object({
887
991
  message: nonBlankStringSchema,
888
- type: z11.literal("unavailable")
992
+ type: z12.literal("unavailable")
889
993
  }).strict()
890
994
  ]);
891
995
  var EgressAuthRequired = class extends Error {
@@ -1021,44 +1125,44 @@ function defineJuniorPlugin(plugin) {
1021
1125
  }
1022
1126
 
1023
1127
  // src/user-pages.ts
1024
- import { z as z12 } from "zod";
1128
+ import { z as z13 } from "zod";
1025
1129
  var userPageIdSchema = nonBlankStringSchema.max(64).regex(/^[a-z][a-z0-9-]*$/);
1026
1130
  var userPageLabelSchema = nonBlankStringSchema.max(80);
1027
1131
  var userPageDescriptionSchema = nonBlankStringSchema.max(500);
1028
- var userPageNavigationSchema = z12.enum(["primary", "profile"]);
1029
- var pluginUserPageMetricSchema = z12.object({
1132
+ var userPageNavigationSchema = z13.enum(["primary", "profile"]);
1133
+ var pluginUserPageMetricSchema = z13.object({
1030
1134
  detail: nonBlankStringSchema.max(500).optional(),
1031
1135
  label: nonBlankStringSchema.max(80),
1032
- tone: z12.enum(["good", "neutral", "warning"]).optional(),
1136
+ tone: z13.enum(["good", "neutral", "warning"]).optional(),
1033
1137
  value: nonBlankStringSchema.max(120)
1034
1138
  }).strict();
1035
- var pluginUserPageMetadataSchema = z12.object({
1139
+ var pluginUserPageMetadataSchema = z13.object({
1036
1140
  label: nonBlankStringSchema.max(80),
1037
1141
  value: nonBlankStringSchema.max(500)
1038
1142
  }).strict();
1039
- var pluginUserPageActionSchema = z12.object({
1143
+ var pluginUserPageActionSchema = z13.object({
1040
1144
  confirmation: nonBlankStringSchema.max(500).optional(),
1041
1145
  href: nonBlankStringSchema.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),
1042
1146
  label: nonBlankStringSchema.max(80),
1043
- method: z12.literal("DELETE"),
1044
- tone: z12.enum(["danger", "neutral"]).optional()
1147
+ method: z13.literal("DELETE"),
1148
+ tone: z13.enum(["danger", "neutral"]).optional()
1045
1149
  }).strict();
1046
- var pluginUserPageRecordSchema = z12.object({
1047
- actions: z12.array(pluginUserPageActionSchema).max(4).optional(),
1150
+ var pluginUserPageRecordSchema = z13.object({
1151
+ actions: z13.array(pluginUserPageActionSchema).max(4).optional(),
1048
1152
  description: nonBlankStringSchema.max(1e3).optional(),
1049
1153
  id: nonBlankStringSchema.max(128),
1050
- metadata: z12.array(pluginUserPageMetadataSchema).max(8).optional(),
1154
+ metadata: z13.array(pluginUserPageMetadataSchema).max(8).optional(),
1051
1155
  title: nonBlankStringSchema.max(4e3)
1052
1156
  }).strict();
1053
- var pluginUserPageContentSchema = z12.object({
1157
+ var pluginUserPageContentSchema = z13.object({
1054
1158
  emptyText: nonBlankStringSchema.max(500).optional(),
1055
- metrics: z12.array(pluginUserPageMetricSchema).max(6).optional(),
1159
+ metrics: z13.array(pluginUserPageMetricSchema).max(6).optional(),
1056
1160
  nextCursor: nonBlankStringSchema.max(1e3).optional(),
1057
- records: z12.array(pluginUserPageRecordSchema).max(100),
1161
+ records: z13.array(pluginUserPageRecordSchema).max(100),
1058
1162
  searchPlaceholder: nonBlankStringSchema.max(120).optional(),
1059
- type: z12.literal("list")
1163
+ type: z13.literal("list")
1060
1164
  }).strict();
1061
- var pluginUserPageLinkSchema = z12.object({
1165
+ var pluginUserPageLinkSchema = z13.object({
1062
1166
  description: userPageDescriptionSchema,
1063
1167
  id: userPageIdSchema,
1064
1168
  label: userPageLabelSchema,
@@ -1066,14 +1170,14 @@ var pluginUserPageLinkSchema = z12.object({
1066
1170
  pluginDisplayName: nonBlankStringSchema.max(200),
1067
1171
  pluginName: nonBlankStringSchema.max(100)
1068
1172
  }).strict();
1069
- var pluginUserPageLinksSchema = z12.array(pluginUserPageLinkSchema);
1173
+ var pluginUserPageLinksSchema = z13.array(pluginUserPageLinkSchema);
1070
1174
  var pluginUserPageCursorSchema = nonBlankStringSchema.max(1e3).optional();
1071
1175
  var pluginUserPageFilterSchema = nonBlankStringSchema.max(64).optional();
1072
- var pluginUserPageQuerySchema = z12.string().trim().max(200).optional();
1073
- var pluginUserPageInputSchema = z12.object({
1176
+ var pluginUserPageQuerySchema = z13.string().trim().max(200).optional();
1177
+ var pluginUserPageInputSchema = z13.object({
1074
1178
  cursor: pluginUserPageCursorSchema,
1075
1179
  filter: pluginUserPageFilterSchema,
1076
- limit: z12.number().int().min(1).max(50),
1180
+ limit: z13.number().int().min(1).max(50),
1077
1181
  query: pluginUserPageQuerySchema
1078
1182
  }).strict();
1079
1183
  export {
@@ -1130,6 +1234,8 @@ export {
1130
1234
  nonBlankStringSchema,
1131
1235
  normalizeEventIdentifier,
1132
1236
  objectAnnotationSchema,
1237
+ objectFactFields,
1238
+ objectFactsSchema,
1133
1239
  ownedObjectAnnotationSchema,
1134
1240
  platformSchema,
1135
1241
  pluginApiRouteRequestContextSchema,