@sentry/junior 0.310.0 → 0.312.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.
Files changed (157) hide show
  1. package/dist/{adapter-context-BhKpjpGD.js → adapter-context-BRjEWRy1.js} +2 -2
  2. package/dist/adapter-iIq7ihf7.js +259 -0
  3. package/dist/{admin-tgZEZAk2.js → admin-DhInw5K9.js} +1 -2
  4. package/dist/{agent-runner-D9cvNlQl.js → agent-runner-C9iDurwX.js} +6507 -7721
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +7 -6
  7. package/dist/api.d.ts +21 -3
  8. package/dist/api.js +1625 -535
  9. package/dist/{app-B_7Wn0en.d.ts → app-DRFrC8Mw.d.ts} +14 -10
  10. package/dist/app.d.ts +2 -2
  11. package/dist/app.js +454 -994
  12. package/dist/{background-compaction-queue-BGHqkhkY.js → background-compaction-queue-DrKi7w3d.js} +10 -85
  13. package/dist/callback-mFlTUWWx.js +75 -0
  14. package/dist/{catalog-runtime-BxwzbLKY.js → catalog-runtime-D7xapBAX.js} +1 -1
  15. package/dist/channel-access-CJGfNTdn.js +221 -0
  16. package/dist/child-message-DcsritGf.js +179 -0
  17. package/dist/cli/chat.js +18 -19
  18. package/dist/cli/check.js +23 -29
  19. package/dist/cli/init.js +1 -7
  20. package/dist/cli/main.js +3 -7
  21. package/dist/cli/plugins.js +8 -7
  22. package/dist/cli/run.d.ts +1 -2
  23. package/dist/cli/run.js +1 -2
  24. package/dist/cli/snapshot-create.js +5 -5
  25. package/dist/cli/upgrade.d.ts +1 -1
  26. package/dist/cli/upgrade.js +3 -3
  27. package/dist/{config-Dkt2Le2b.js → config-kXB2Y5tl.js} +294 -28
  28. package/dist/{continue-in-slack-BWVwePKD.js → continue-in-slack-O6pV5004.js} +7 -7
  29. package/dist/{conversation-feed-Ci6YD1N-.js → conversation-feed-uNOv_x68.js} +87 -24
  30. package/dist/{conversation-privacy-C39g8BY4.js → conversation-privacy-L4ja1_W6.js} +1 -1
  31. package/dist/{conversation-turn-CBlZIH02.js → conversation-turn-CeLbHqdw.js} +56 -49
  32. package/dist/{credential-sync-vGnrB0BY.js → credential-sync-I8VBGk05.js} +16 -16
  33. package/dist/{projection-jZSlEAXG.js → credentialed-Cb6E2phL.js} +16268 -16821
  34. package/dist/{db-B4Hjxr-u.d.ts → db-BbC5stfa.d.ts} +13 -6
  35. package/dist/{db-CFZggNoy.js → db-LAyyX8tk.js} +1698 -1046
  36. package/dist/{executor-BPkZDx5-.js → executor-SCub-fAq.js} +552 -181
  37. package/dist/{html-2r2KmLwi.js → html-BCZ3Xtb_.js} +6 -6
  38. package/dist/{session-stop-BfY4rhJs.js → ingest-BDf3D50j.js} +2134 -2553
  39. package/dist/{install-C-oE6C_u.js → install-DCFJFkC0.js} +2 -2
  40. package/dist/instrumentation.js +4 -4
  41. package/dist/{lineage-CsvrEFQe.js → lineage-B_m-4TJw.js} +2 -2
  42. package/dist/{stop-DYzjRf2U.js → list-CN2QA2R9.js} +1656 -685
  43. package/dist/{logging-D5gkyvnK.js → logging-dQ9ZRGQ8.js} +47 -9
  44. package/dist/media-CYm1QD8T.js +2356 -0
  45. package/dist/{message-DwvJ-I3w.js → message-DSXGj1hM.js} +19 -29
  46. package/dist/{model-input-MAq2881y.js → model-input--TrP9hYV.js} +3 -3
  47. package/dist/nitro.d.ts +1 -1
  48. package/dist/nitro.js +4 -3
  49. package/dist/{oauth-callback-server-DIF6Li06.js → oauth-callback-server-DHCZC6B4.js} +2 -2
  50. package/dist/{oauth-relay-DPE-wrwO.js → oauth-relay-pPMGnDZt.js} +1 -1
  51. package/dist/{registry-BBkWFCl8.js → registry-CZOzddwu.js} +5 -8
  52. package/dist/{resolve-B38MkHXE.js → resolve-cKOQ14Dh.js} +3 -3
  53. package/dist/{result-BaqSZcJb.js → result-DcvEOe1r.js} +119 -93
  54. package/dist/result-event-type-BdIJuZxg.js +48 -0
  55. package/dist/rule-DAxQY-1h.js +20 -0
  56. package/dist/{runner-11h8PrHh.js → runner-DBfUW44l.js} +14 -16
  57. package/dist/{sandbox-egress-signals-CTcACAtJ.js → sandbox-egress-signals-BVF_xAm1.js} +1 -1
  58. package/dist/{schema-DriSvB40.d.ts → schema-BEHKxr4I.d.ts} +861 -298
  59. package/dist/{schema-obw5jvR4.js → schema-Bk9Nm2E8.js} +344 -153
  60. package/dist/{service-account-Bx93N1n1.js → service-account-CVYsFjty.js} +3 -3
  61. package/dist/{service-account-Zc5bUcIJ.js → service-account-Ts4ulcrV.js} +68 -68
  62. package/dist/{skills-C8Npu5zO.js → skills-VTnhAJWm.js} +2 -2
  63. package/dist/{slack-conversation-unfurl-DlRVA02H.js → slack-conversation-unfurl-fuLnF1jE.js} +9 -11
  64. package/dist/{spawn-CXr58R0x.js → spawn-vxAarlX5.js} +6 -6
  65. package/dist/start-conversation-CEn2KH1A.js +941 -0
  66. package/dist/{state-CGrGVeQC.js → state-C1P3_Ywk.js} +4 -4
  67. package/dist/statuses-_cRJHXK7.js +150 -0
  68. package/dist/store-DFZaN-Ix.js +492 -0
  69. package/dist/task-queue-Cx4Lmjyk.js +90 -0
  70. package/dist/task-runner-CbTwFA6k.js +1432 -0
  71. package/dist/{thread-context-Dyj1KWaY.js → thread-context-BkAZDTX2.js} +13 -11
  72. package/dist/thread-state-DhPndWi1.js +5625 -0
  73. package/dist/{validation-DxVNIxA0.js → validation-nIzMtAVJ.js} +1 -1
  74. package/dist/{task-queue-CaZffYaH.js → vercel-queue-hW90XzbG.js} +93 -172
  75. package/dist/{version-Cr7Z71yG.js → version-Brbtz4Qf.js} +1 -1
  76. package/dist/version.js +1 -1
  77. package/dist/{warmup-C6LOZ2d2.js → warmup-BDA5myRK.js} +5832 -4567
  78. package/dist/web-message-id-C6P83ans.js +10 -0
  79. package/dist/{worker-CUBtu1Li.js → worker-D63RcaVD.js} +20 -8
  80. package/migrations/0126_artifact_drop_public.sql +8 -0
  81. package/migrations/0127_artifact_path.sql +4 -0
  82. package/migrations/0128_artifact_path_index.sql +1 -0
  83. package/migrations/0129_review_item_answered_index.sql +1 -0
  84. package/migrations/0130_review_item_status_index.sql +1 -0
  85. package/migrations/0131_brief_outcome_status.sql +1 -0
  86. package/migrations/0132_brief_outcome_status_backfill.sql +7 -0
  87. package/migrations/0133_brief_created_at_index.sql +1 -0
  88. package/migrations/0134_slack_person_search_index.sql +1 -0
  89. package/migrations/0135_code_change_size.sql +3 -0
  90. package/migrations/0136_merge_conflict_notice_dismiss.sql +16 -0
  91. package/migrations/0137_inbox_snoozes.sql +27 -0
  92. package/migrations/0138_code_change_search_index.sql +2 -0
  93. package/migrations/0139_review_item_owner.sql +22 -0
  94. package/migrations/0140_review_item_owner_index.sql +1 -0
  95. package/migrations/0141_memory_core_adoption.sql +89 -0
  96. package/migrations/0142_memory_core_indexes.sql +17 -0
  97. package/migrations/0143_todos.sql +14 -0
  98. package/migrations/0144_inbox_items.sql +32 -0
  99. package/migrations/0145_todo_changed_by_agent.sql +1 -0
  100. package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
  101. package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
  102. package/migrations/0148_authorization_request_index.sql +1 -0
  103. package/migrations/0149_conversation_metadata.sql +10 -0
  104. package/migrations/0150_conversation_metadata_fill.sql +39 -0
  105. package/migrations/0151_conversation_search_index.sql +1 -0
  106. package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
  107. package/migrations/0153_artifact_expiry.sql +1 -0
  108. package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
  109. package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
  110. package/migrations/0156_conversation_kind_lead.sql +6 -0
  111. package/migrations/0157_conversation_lead_actor_index.sql +1 -0
  112. package/migrations/meta/0126_snapshot.json +5488 -0
  113. package/migrations/meta/0127_snapshot.json +5519 -0
  114. package/migrations/meta/0128_snapshot.json +5519 -0
  115. package/migrations/meta/0129_snapshot.json +5547 -0
  116. package/migrations/meta/0130_snapshot.json +5563 -0
  117. package/migrations/meta/0131_snapshot.json +5569 -0
  118. package/migrations/meta/0132_snapshot.json +5569 -0
  119. package/migrations/meta/0133_snapshot.json +5590 -0
  120. package/migrations/meta/0134_snapshot.json +5606 -0
  121. package/migrations/meta/0135_snapshot.json +5624 -0
  122. package/migrations/meta/0136_snapshot.json +5624 -0
  123. package/migrations/meta/0137_snapshot.json +5864 -0
  124. package/migrations/meta/0138_snapshot.json +5894 -0
  125. package/migrations/meta/0139_snapshot.json +5898 -0
  126. package/migrations/meta/0140_snapshot.json +5919 -0
  127. package/migrations/meta/0141_snapshot.json +6429 -0
  128. package/migrations/meta/0142_snapshot.json +6457 -0
  129. package/migrations/meta/0143_snapshot.json +6434 -0
  130. package/migrations/meta/0144_snapshot.json +6434 -0
  131. package/migrations/meta/0145_snapshot.json +6440 -0
  132. package/migrations/meta/0146_snapshot.json +6446 -0
  133. package/migrations/meta/0147_snapshot.json +6452 -0
  134. package/migrations/meta/0148_snapshot.json +6474 -0
  135. package/migrations/meta/0149_snapshot.json +6490 -0
  136. package/migrations/meta/0150_snapshot.json +6490 -0
  137. package/migrations/meta/0151_snapshot.json +6505 -0
  138. package/migrations/meta/0152_snapshot.json +6505 -0
  139. package/migrations/meta/0153_snapshot.json +6511 -0
  140. package/migrations/meta/0154_snapshot.json +6533 -0
  141. package/migrations/meta/0155_snapshot.json +6511 -0
  142. package/migrations/meta/0156_snapshot.json +6511 -0
  143. package/migrations/meta/0157_snapshot.json +6527 -0
  144. package/migrations/meta/_journal.json +224 -0
  145. package/package.json +7 -8
  146. package/skills/design-automation-skill/SKILL.md +108 -0
  147. package/dist/briefs-DKxkoruh.js +0 -395
  148. package/dist/conversation-M9KZ5JxF.js +0 -1024
  149. package/dist/prompt-CaMyeCpA.js +0 -910
  150. package/dist/schedule-DWxZ3kja.js +0 -1146
  151. package/dist/store-D4FQ1Nml.js +0 -335
  152. package/dist/task-runner-Dm7BHbGp.js +0 -287
  153. package/dist/turn-session-routing-CD0BRCex.js +0 -263
  154. package/dist/turn-user-message-9IxeEv5v.js +0 -364
  155. package/dist/users-CaUAYMb3.js +0 -181
  156. package/dist/viewer-AHldghAD.js +0 -212
  157. package/dist/web-message-id-BT8Mg8LL.js +0 -418
@@ -1,10 +1,21 @@
1
- import { F as sumUtcHoursIntoSixHours, M as fillUtcHours, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, j as fillUtcDays, y as PLAN_ITEM_STATUSES } from "./web-message-id-BT8Mg8LL.js";
2
- import { $ as inputFileSchema, D as conversationChildAgentTotalsSchema, E as idempotencyKeySchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-M9KZ5JxF.js";
3
- import "./conversation-feed-Ci6YD1N-.js";
1
+ import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-CYm1QD8T.js";
2
+ import { f as TODO_STATUSES } from "./result-event-type-BdIJuZxg.js";
3
+ import "./conversation-feed-uNOv_x68.js";
4
+ import { o as fillUtcDays, r as AGENT_INVOCATION_STATUSES, s as fillUtcHours, u as sumUtcHoursIntoSixHours } from "./statuses-_cRJHXK7.js";
4
5
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
5
- import { r as notificationScheduleSchema } from "./schedule-DWxZ3kja.js";
6
6
  import * as z from "zod";
7
- import { codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
7
+ import { codeChangeSizeSchema, codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
8
+ // src/api/schema/conversation-fork.ts
9
+ /** Body of a request to fork a Conversation at one assistant reply. */
10
+ const forkConversationBodySchema = z.object({
11
+ /** Assistant reply that ends the copied history. */
12
+ messageId: z.string().min(1).max(500),
13
+ idempotencyKey: z.string().trim().min(1).max(200),
14
+ /** Start a hidden, read-only Quick question about this reply text. */
15
+ quickQuestion: z.object({ quote: z.string().trim().min(1).max(4e3) }).strict().optional()
16
+ }).strict();
17
+ /** The Conversation that a fork made. */
18
+ const forkConversationResponseSchema = z.object({ conversationId: z.string() }).strict();
8
19
  // src/api/schema/conversation-attachment-upload.ts
9
20
  /**
10
21
  * Ask to upload one file for a Message. `conversationId` names an existing
@@ -40,52 +51,11 @@ const conversationCatchUpSchema = z.object({
40
51
  needsYou: z.string().min(1).optional(),
41
52
  summary: z.string().min(1)
42
53
  }).strict();
43
- // src/api/schema/conversation-pin.ts
44
- /** Pin or unpin one Conversation for the signed-in viewer. */
45
- const pinConversationBodySchema = z.object({ pinned: z.boolean() }).strict();
46
- /** The viewer's pin time after the change, or null when unpinned. */
47
- const pinConversationResponseSchema = z.object({ pinnedAt: z.string().datetime().nullable() }).strict();
48
- /**
49
- * The viewer's full Pinned order, first to last. Each pin takes its index as
50
- * its new place.
51
- */
52
- const reorderPinnedConversationsBodySchema = z.object({ conversationIds: z.array(z.string().min(1)).min(1).max(500).refine((ids) => new Set(ids).size === ids.length, { message: "Each Conversation can appear once." }) }).strict();
53
- /** The pinned Conversations that got a new place, in order. */
54
- const reorderPinnedConversationsResponseSchema = z.object({ conversationIds: z.array(z.string()) }).strict();
55
54
  // src/api/schema/conversation-delivery.ts
56
55
  /** Pause or resume Delivery of a root's Event Turn replies to its Location. */
57
56
  const conversationDeliveryBodySchema = z.object({ paused: z.boolean() }).strict();
58
57
  /** The Delivery state after the change. */
59
58
  const conversationDeliveryResponseSchema = z.object({ paused: z.boolean() }).strict();
60
- // src/api/schema/conversation-subscription.ts
61
- /** Subscribe to or unsubscribe from one Conversation for the viewer. */
62
- const conversationSubscriptionBodySchema = z.object({ subscribed: z.boolean() }).strict();
63
- /**
64
- * The viewer's subscription after the change. `archivedAt` is set when the
65
- * viewer was the last subscriber, so the unsubscribe archived the
66
- * Conversation for everyone.
67
- */
68
- const conversationSubscriptionResponseSchema = z.object({
69
- archivedAt: z.string().datetime().nullable(),
70
- subscribed: z.boolean()
71
- }).strict();
72
- // src/api/schema/conversation-archive.ts
73
- /**
74
- * Archive or restore one conversation. `applyToChildren` applies to a child
75
- * only: archive refuses while a descendant is unarchived unless it is true,
76
- * and restore also restores the descendants archived with the child when it
77
- * is true. A root archive is per viewer and writes no child rows.
78
- */
79
- const archiveConversationBodySchema = z.object({
80
- applyToChildren: z.boolean().optional(),
81
- archived: z.boolean(),
82
- lastSeenAt: z.string().datetime()
83
- }).strict();
84
- const archiveConversationResponseSchema = z.object({ archivedAt: z.string().datetime().nullable() }).strict();
85
- /** Viewer's auto-archive choice for one conversation. */
86
- const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean() }).strict();
87
- /** Result of archiving all of the viewer's done conversations once. */
88
- const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative() }).strict();
89
59
  // src/api/schema/conversation-outline.ts
90
60
  /**
91
61
  * Longest outline item text and reply. The outline previews each message,
@@ -132,15 +102,8 @@ const conversationMetricDaySchema = z.object({
132
102
  inputTokens: z.number().optional(),
133
103
  /** Conversation cost split to `mergedCodeChanges`. */
134
104
  mergedCodeChangeCostUsd: z.number().optional(),
135
- /** Code changes merged in this bucket. They are also `outcomes`. */
105
+ /** Code changes merged in this bucket. */
136
106
  mergedCodeChanges: z.number().optional(),
137
- /** Conversation cost of `outcomes`. */
138
- outcomeCostUsd: z.number().optional(),
139
- /**
140
- * Merged code changes, plus root Conversations without code changes
141
- * whose latest Brief is `done` or `answered`.
142
- */
143
- outcomes: z.number().optional(),
144
107
  tokens: z.number().optional()
145
108
  }).strict();
146
109
  const guardianMetricDaySchema = z.object({
@@ -171,25 +134,6 @@ const conversationStatsReportSchema = z.object({
171
134
  windowEnd: z.string(),
172
135
  windowStart: z.string()
173
136
  }).strict();
174
- // src/api/schema/conversation-stop.ts
175
- /** One queued web message from the viewer that a stop removed. */
176
- const stoppedConversationMessageSchema = z.object({
177
- inboundMessageId: z.string().min(1),
178
- text: z.string().min(1)
179
- }).strict();
180
- /**
181
- * Result of stopping the active Turn.
182
- *
183
- * `stoppedInboundMessageIds` lists every queued human message the stop
184
- * removes. `stoppedMessages` holds only the viewer's own web text, so the
185
- * dashboard can return it to the composer.
186
- */
187
- const stopConversationTurnResponseSchema = z.object({
188
- conversationId: z.string().min(1),
189
- status: z.enum(["no_work", "requested"]),
190
- stoppedInboundMessageIds: z.array(z.string().min(1)),
191
- stoppedMessages: z.array(stoppedConversationMessageSchema)
192
- }).strict();
193
137
  // src/api/schema/object-link.ts
194
138
  /** The most links that one object request may resolve. */
195
139
  const MAX_OBJECT_LINKS = 20;
@@ -297,8 +241,10 @@ const conversationWatchesReportSchema = z.object({
297
241
  conversationId: z.string().min(1),
298
242
  watches: z.array(conversationWatchSchema)
299
243
  }).strict();
300
- // src/api/schema/plan.ts
301
- const planItemAssigneeSchema = z.discriminatedUnion("kind", [
244
+ /** Route params that name one Watch of one Conversation. */
245
+ const watchParamsSchema = conversationParamsSchema.extend({ watchId: z.string().min(1) }).strict();
246
+ // src/api/schema/todos.ts
247
+ const todoAssigneeSchema = z.discriminatedUnion("kind", [
302
248
  z.object({ kind: z.literal("self") }).strict(),
303
249
  z.object({
304
250
  kind: z.literal("agent"),
@@ -311,16 +257,16 @@ const planItemAssigneeSchema = z.discriminatedUnion("kind", [
311
257
  }).strict()
312
258
  ]);
313
259
  /**
314
- * One Plan item of a Conversation. Viewers who cannot see private content
260
+ * One To-do of a Conversation. Viewers who cannot see private content
315
261
  * get the status, assignee kind, and times, but not the title, notes, or
316
262
  * names.
317
263
  */
318
- const conversationPlanItemSchema = z.object({
264
+ const conversationTodoSchema = z.object({
319
265
  id: z.number().int().positive(),
320
266
  title: z.string().min(1).optional(),
321
267
  notes: z.string().min(1).optional(),
322
- status: z.enum(PLAN_ITEM_STATUSES),
323
- assignee: planItemAssigneeSchema,
268
+ status: z.enum(TODO_STATUSES),
269
+ assignee: todoAssigneeSchema,
324
270
  /** Name of the person who made the latest change. */
325
271
  changedBy: z.string().min(1).optional(),
326
272
  redacted: z.literal(true).optional(),
@@ -328,22 +274,18 @@ const conversationPlanItemSchema = z.object({
328
274
  }).strict().superRefine((data, context) => {
329
275
  if (data.title === void 0 === (data.redacted !== true)) context.addIssue({
330
276
  code: "custom",
331
- message: "plan item title must be text or explicitly redacted"
277
+ message: "To-do title must be text or explicitly redacted"
332
278
  });
333
279
  });
334
- /** The open Plan items of one Conversation, then the latest closed ones. */
335
- const conversationPlanReportSchema = z.object({
280
+ /** The open To-dos of one Conversation, then the latest closed ones. */
281
+ const conversationTodosReportSchema = z.object({
336
282
  conversationId: z.string().min(1),
337
- items: z.array(conversationPlanItemSchema)
338
- }).strict();
339
- /** Route parameters of one Plan item. */
340
- const planItemParamsSchema = conversationParamsSchema.extend({ itemId: z.coerce.number().int().positive() }).strict();
341
- /** Status that a person can set on a Plan item. */
342
- const planItemStatusBodySchema = z.object({ status: z.enum([
343
- "pending",
344
- "done",
345
- "cancelled"
346
- ]) }).strict();
283
+ todos: z.array(conversationTodoSchema)
284
+ }).strict();
285
+ /** Route parameters of one To-do. */
286
+ const todoParamsSchema = conversationParamsSchema.extend({ todoId: z.coerce.number().int().positive() }).strict();
287
+ /** Status that a person can set on a To-do. */
288
+ const todoStatusBodySchema = z.object({ status: z.enum(TODO_STATUSES) }).strict();
347
289
  // src/api/schema/code.ts
348
290
  const codeChangeSummarySchema = z.object({
349
291
  closed: z.number().int().nonnegative(),
@@ -394,6 +336,8 @@ const codeChangeSummaryReportSchema = z.object({
394
336
  openedAt: z.string(),
395
337
  provider: z.string().min(1),
396
338
  repository: z.string().min(1),
339
+ /** Lines and files changed. Unknown parts are absent. */
340
+ size: codeChangeSizeSchema.optional(),
397
341
  state: codeChangeStateSchema,
398
342
  title: z.string().optional(),
399
343
  url: z.string().url().optional()
@@ -409,6 +353,19 @@ const codeOverviewReportSchema = z.object({
409
353
  windowEnd: z.string(),
410
354
  windowStart: z.string()
411
355
  }).strict();
356
+ /** A search of tracked code changes, for the composer `#` menu. */
357
+ const codeChangeSearchQuerySchema = z.object({ q: z.string().trim().min(1).max(100) }).strict();
358
+ /** A tracked code change that a Message can link to. */
359
+ const mentionableCodeChangeSchema = z.object({
360
+ draft: z.boolean(),
361
+ number: z.number().int(),
362
+ /** `owner/repo`. */
363
+ repository: z.string(),
364
+ state: codeChangeStateSchema,
365
+ title: z.string().nullable(),
366
+ url: z.string()
367
+ }).strict();
368
+ const codeChangeSearchReportSchema = z.object({ changes: z.array(mentionableCodeChangeSchema) }).strict();
412
369
  const codeRepositoryParamsSchema = z.object({ repositoryId: z.string().uuid() }).strict();
413
370
  /** Optional change state that limits the listed repository changes. */
414
371
  const codeRepositoryQuerySchema = z.object({ state: codeChangeStateSchema.optional() }).strict();
@@ -607,8 +564,32 @@ const locationDetailReportSchema = locationSummaryReportSchema.extend({
607
564
  windowEnd: z.string(),
608
565
  windowStart: z.string()
609
566
  }).strict();
567
+ // src/api/schema/lead.ts
568
+ /** The viewer's Lead. Messages to it use the Conversation message route. */
569
+ const leadSchema = z.object({
570
+ conversationId: z.string().min(1),
571
+ /** The Conversations that the Lead has an active Watch on. */
572
+ watchedConversationIds: z.array(z.string().min(1))
573
+ }).strict();
610
574
  // src/api/schema/person.ts
611
575
  const personParamsSchema = z.object({ email: z.string().trim().min(1) }).strict();
576
+ /**
577
+ * A people search. With `conversationId`, it finds only people in the Slack
578
+ * workspace of that Conversation, so a mention reaches them there.
579
+ */
580
+ const peopleSearchQuerySchema = z.object({
581
+ conversationId: z.string().min(1).max(500).optional(),
582
+ q: z.string().trim().min(1).max(100)
583
+ }).strict();
584
+ /**
585
+ * A person that a Message can mention: they have a Slack user id. `hasUser`
586
+ * is true when they are a User, so they have a feed to Invite them to.
587
+ */
588
+ const mentionablePersonSchema = actorIdentitySchema.extend({
589
+ hasUser: z.literal(true).optional(),
590
+ slackUserId: z.string().min(1)
591
+ }).strict();
592
+ const peopleSearchReportSchema = z.object({ people: z.array(mentionablePersonSchema) }).strict();
612
593
  /** Route parameters for the photo of one Identity. */
613
594
  const avatarParamsSchema = z.object({ identityId: z.string().min(1).max(200) }).strict();
614
595
  const peopleConversationStatsItemSchema = conversationStatsItemSchema.omit({ costUsd: true });
@@ -693,6 +674,28 @@ const personalSpendReportSchema = z.object({
693
674
  windowEnd: z.string(),
694
675
  windowStart: z.string()
695
676
  }).strict();
677
+ /** The most recent merged code changes and Conversations a person card lists. */
678
+ const PERSON_CARD_RECENT_LIMIT = 3;
679
+ /**
680
+ * The person card that opens on a reference to a person: their object card,
681
+ * when Junior knows them, the code changes they merged most recently, and
682
+ * their recent Junior activity. The activity names only Conversations that
683
+ * the viewer may read.
684
+ */
685
+ const personCardReportSchema = z.object({
686
+ activity: z.object({
687
+ /** The last Turn of the person in the last 30 days. */
688
+ lastActiveAt: z.string().optional(),
689
+ recentConversations: z.array(z.object({
690
+ conversationId: z.string(),
691
+ lastTurnAt: z.string(),
692
+ title: z.string()
693
+ }).strict()).max(3)
694
+ }).strict(),
695
+ card: ownedObjectAnnotationSchema.optional(),
696
+ /** The same code changes as the People profile, newest merge first. */
697
+ mergedChanges: z.array(codeChangeSummaryReportSchema).max(3)
698
+ }).strict();
696
699
  // src/api/schema/personal-token.ts
697
700
  const personalTokenMetadataSchema = z.object({
698
701
  id: z.string().uuid(),
@@ -797,41 +800,177 @@ const cacheWarmingSavingsRefillSchema = z.object({
797
800
  totalConversations: z.number().int().nonnegative().optional()
798
801
  }).strict();
799
802
  const cacheWarmingSavingsRefillResponseSchema = z.object({ refill: cacheWarmingSavingsRefillSchema }).strict();
800
- // src/chat/review-items/evidence.ts
803
+ const cacheHealthQuerySchema = z.object({ window: z.enum(["24h", "7d"]).default("24h") }).strict();
804
+ /** Prompt cache of agent model calls, without warmups. */
805
+ const cacheHealthCallsSchema = z.object({
806
+ calls: z.number().int().nonnegative(),
807
+ /** Input tokens, cache reads and writes included. */
808
+ inputTokens: z.number().int().nonnegative(),
809
+ cacheWriteTokens: z.number().int().nonnegative()
810
+ }).strict();
801
811
  /**
802
- * One source that an agent cites for a Review item: a link or a
803
- * Conversation, with a short label and an optional one-line note. A link
804
- * points outside Junior; a Conversation reference points to work in Junior.
805
- * The question stores the list, and the dashboard shows it beside the
806
- * answer choices.
812
+ * Cache health of a recent window, read from Junior's own Sentry telemetry.
813
+ * A full rewrite wrote over 50k tokens to the cache and read under 20k.
807
814
  */
808
- const reviewItemEvidenceSchema = z.object({
809
- conversationId: z.string().min(1).max(500).optional(),
810
- label: z.string().min(1).max(120),
811
- note: z.string().min(1).max(200).optional(),
812
- url: z.string().min(1).max(2e3).optional()
813
- }).strict().refine((entry) => entry.url === void 0 !== (entry.conversationId === void 0), "Evidence has a `url` or a `conversationId`, not both.");
815
+ const cacheHealthDataSchema = z.object({
816
+ status: z.literal("ok"),
817
+ window: z.enum(["24h", "7d"]),
818
+ /** The agent model whose calls count. */
819
+ modelId: z.string(),
820
+ /** When Sentry answered. */
821
+ fetchedAt: z.string(),
822
+ /** Sentry rate limited a newer read, so this is an older answer. */
823
+ stale: z.boolean(),
824
+ buckets: z.array(cacheHealthCallsSchema.extend({
825
+ /** UTC bucket start, `YYYY-MM-DDTHH`. */
826
+ start: z.string(),
827
+ fullRewrites: z.number().int().nonnegative()
828
+ })),
829
+ /** The same window a week earlier. */
830
+ lastWeek: cacheHealthCallsSchema,
831
+ warmups: z.object({
832
+ /** Warmup calls by how the Turn before ended, or `tool_wait`. */
833
+ sentByTurnEnding: z.record(z.string(), z.number().int().nonnegative()),
834
+ skipReasons: z.record(z.string(), z.number().int().nonnegative()),
835
+ /** Cost of every warmup call. */
836
+ costUsd: z.number().nonnegative()
837
+ }).strict(),
838
+ /** Idle periods that count, by `IdlePeriodOutcome`. */
839
+ idlePeriods: z.object({
840
+ saved: z.number().int().nonnegative(),
841
+ notWarmed: z.number().int().nonnegative(),
842
+ stoppedEarly: z.number().int().nonnegative(),
843
+ cacheLost: z.number().int().nonnegative(),
844
+ /** Cache writes that the saved periods avoided, less their reads. */
845
+ savedUsd: z.number().nonnegative()
846
+ }).strict(),
847
+ breakers: z.array(cacheWarmingBreakerSchema),
848
+ /** Breaker changes in the window. A close at the end of a pause is not one. */
849
+ breakerEvents: z.object({
850
+ opened: z.number().int().nonnegative(),
851
+ closed: z.number().int().nonnegative()
852
+ }).strict()
853
+ }).strict();
854
+ const cacheHealthReportSchema = z.discriminatedUnion("status", [
855
+ cacheHealthDataSchema,
856
+ z.object({
857
+ status: z.literal("unconfigured"),
858
+ missing: z.array(z.enum([
859
+ "SENTRY_DSN",
860
+ "SENTRY_ORG_SLUG",
861
+ "SENTRY_READ_TOKEN"
862
+ ]))
863
+ }).strict(),
864
+ z.object({ status: z.literal("denied") }).strict(),
865
+ z.object({ status: z.literal("rate_limited") }).strict(),
866
+ z.object({ status: z.literal("busy") }).strict()
867
+ ]);
868
+ // src/api/schema/gateway-providers.ts
869
+ const providerSlugSchema = z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]*$/).max(64);
870
+ /** The "Enabled providers" setting, with what the gateway lists for each model. */
871
+ const gatewayProvidersSchema = z.object({
872
+ /** Null when every provider is enabled. */
873
+ enabled: z.array(z.string()).nullable(),
874
+ /** Every provider that serves one of the models below. */
875
+ providers: z.array(z.string()),
876
+ /** Models that the agent runs, with the providers that serve each. */
877
+ models: z.array(z.object({
878
+ id: z.string(),
879
+ providers: z.array(z.string())
880
+ }).strict())
881
+ }).strict();
882
+ const updateGatewayProvidersBodySchema = z.object({ enabled: z.array(providerSlugSchema).max(100).nullable() }).strict();
883
+ // src/api/schema/inbox-snooze.ts
884
+ const conversationRowSchema = z.object({
885
+ conversationId: z.string().min(1),
886
+ inboxItemId: z.string().min(1).optional()
887
+ }).strict();
888
+ const itemRowSchema = z.object({ inboxItemId: z.string().min(1) }).strict();
889
+ /**
890
+ * The Inbox row of a snooze: one Conversation, one item in it, or one item
891
+ * on its own.
892
+ */
893
+ const inboxSnoozeSubjectSchema = z.union([conversationRowSchema, itemRowSchema]);
894
+ /**
895
+ * An Event that ends a snooze: `wake` shows the item again, and `resolve`
896
+ * dismisses it. The Event is on the page at `resourceUrl`, such as another
897
+ * pull request, or on each item's subject when it is unset.
898
+ */
899
+ const inboxSnoozeTriggerSchema = z.object({
900
+ eventType: z.string().min(1),
901
+ outcome: z.enum(["wake", "resolve"]),
902
+ resourceUrl: z.string().url().max(2e3).optional()
903
+ }).strict();
904
+ /**
905
+ * An Event resource that a snooze can wait on, such as a pull request, and
906
+ * the Event types of its resource type.
907
+ */
908
+ const inboxSnoozeResourceSchema = z.object({
909
+ events: z.array(z.string().min(1)).min(1),
910
+ namespace: z.string().min(1),
911
+ /** How each Event reads after the resource's name, such as "is merged". */
912
+ phrases: z.record(z.string().min(1), z.string().min(1)),
913
+ resourceType: z.string().min(1)
914
+ }).strict();
915
+ /** `GET /api/inbox/snoozes/resource` query: the page that a person names. */
916
+ const inboxSnoozeResourceQuerySchema = z.object({ url: z.string().url().max(2e3) }).strict();
917
+ /**
918
+ * Most triggers in one snooze. It bounds the trigger rows that one request
919
+ * writes for each item, and fits every Event of one page: a GitHub pull
920
+ * request has 13.
921
+ */
922
+ const INBOX_SNOOZE_MAX_TRIGGERS = 30;
923
+ const snoozeUntil = {
924
+ triggers: z.array(inboxSnoozeTriggerSchema).min(1).max(30).optional(),
925
+ /**
926
+ * No time and no Event: the snooze lasts until the item closes, so it
927
+ * waits until someone else handles it, or the viewer wakes it.
928
+ */
929
+ untilClosed: z.literal(true).optional(),
930
+ wakeAt: z.string().datetime().optional()
931
+ };
814
932
  /**
815
- * The question of a Review item with the evidence for its answer. Evidence
816
- * is part of the question, so it is stored in the `request` column.
933
+ * `POST /api/inbox/snoozes` body: hide the row's open items from the viewer
934
+ * until `wakeAt` or one of `triggers` fires, whichever is first, or with
935
+ * `untilClosed`, until each item closes. A later item in the row shows by
936
+ * itself.
817
937
  */
818
- const reviewItemRequestSchema = userInputRequestSchema.safeExtend({ evidence: z.array(reviewItemEvidenceSchema).optional() });
819
- // src/api/schema/review-item.ts
938
+ const inboxSnoozeCreateSchema = z.union([conversationRowSchema.extend(snoozeUntil).strict(), itemRowSchema.extend(snoozeUntil).strict()]).refine((body) => body.untilClosed === true !== (body.wakeAt !== void 0 || body.triggers !== void 0), { message: "Set wakeAt, triggers, or both, or set untilClosed alone." });
939
+ /** The items that a snooze hid from the viewer, one snooze each. */
940
+ const inboxSnoozeSchema = z.object({ inboxItemIds: z.array(z.string().min(1)).min(1) }).strict();
941
+ /**
942
+ * Why the viewer's snooze of an item woke: its time came, or an Event on
943
+ * `resource`, such as `getsentry/junior#12`. `phrase` says how the Event
944
+ * reads after the resource's name, where its source says.
945
+ */
946
+ const inboxSnoozeWakeSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("time") }).strict(), z.object({
947
+ eventType: z.string().min(1),
948
+ kind: z.literal("event"),
949
+ phrase: z.string().min(1).optional(),
950
+ resource: z.string().min(1)
951
+ }).strict()]);
952
+ /**
953
+ * `DELETE /api/inbox/snoozes/wakes` body: the viewer opened these items, so
954
+ * they no longer show why their snoozes woke.
955
+ */
956
+ const inboxSnoozeWakesClearSchema = z.object({ inboxItemIds: z.array(z.string().min(1)).min(1).max(100) }).strict();
957
+ // src/api/schema/inbox-item.ts
820
958
  const answerSchema = z.object({
821
959
  other: z.string().max(4e3).optional(),
822
960
  requestId: z.string().min(1),
823
961
  values: z.record(z.string(), z.array(z.string().max(4e3)).max(20))
824
962
  }).strict();
825
963
  const personSchema = z.object({
964
+ /** Junior API path of the profile photo. */
965
+ avatarUrl: z.string().min(1).optional(),
826
966
  displayName: z.string().min(1).optional(),
827
967
  email: z.string().min(1),
828
968
  userId: z.string().min(1)
829
969
  }).strict();
830
- /** One Review item as the viewer sees it. */
831
- const reviewItemSchema = z.object({
832
- addedByConversationId: z.string().min(1),
970
+ /** One Inbox item as the viewer sees it. */
971
+ const inboxItemSchema = z.object({
833
972
  /**
834
- * Names the Conversation that added the item when it is not
973
+ * Names the Conversation that owns the item when it is not
835
974
  * `rootConversationId`, such as a child agent's Thread title.
836
975
  */
837
976
  addedByLabel: z.string().min(1).optional(),
@@ -852,8 +991,24 @@ const reviewItemSchema = z.object({
852
991
  closedBy: personSchema.optional(),
853
992
  conversationIds: z.array(z.string().min(1)),
854
993
  createdAt: z.string().datetime(),
994
+ /**
995
+ * Set when the viewer snoozed the open item, and the snooze has not
996
+ * woken. It stays open for the other people it is for.
997
+ */
998
+ snoozedByViewer: z.literal(true).optional(),
855
999
  id: z.string().min(1),
856
1000
  kind: z.enum(["notice", "action"]),
1001
+ /** People that the title, body, and question mention. */
1002
+ mentions: z.array(actorIdentitySchema).optional(),
1003
+ /**
1004
+ * What the item belongs to: the Conversation of the agent or plugin
1005
+ * that added it, or the Automation of an Automation alert. Its kind
1006
+ * decides the item's visibility and where the Inbox stacks it.
1007
+ */
1008
+ owner: z.object({
1009
+ id: z.string().min(1),
1010
+ kind: z.enum(["conversation", "automation"])
1011
+ }).strict(),
857
1012
  /**
858
1013
  * Other open work that the viewer can see on the same subject or linked
859
1014
  * work. Only an open item has it.
@@ -870,13 +1025,14 @@ const reviewItemSchema = z.object({
870
1025
  title: z.string().min(1)
871
1026
  }).strict())
872
1027
  }).strict().optional(),
873
- request: reviewItemRequestSchema.optional(),
1028
+ request: inboxItemRequestSchema.optional(),
874
1029
  /**
875
- * The top of the item's Conversation tree that the viewer can see, at
876
- * any depth: the Conversation that added the item when it is a root, or
877
- * when the viewer cannot see its root. The Inbox stacks items by it.
1030
+ * The top of the owner Conversation's tree that the viewer can see, at
1031
+ * any depth: the owner when it is a root, or when the viewer cannot see
1032
+ * its root. The Inbox stacks items by it. Unset when the owner is not a
1033
+ * Conversation; then the Inbox stacks items by their owner.
878
1034
  */
879
- rootConversationId: z.string().min(1),
1035
+ rootConversationId: z.string().min(1).optional(),
880
1036
  status: z.enum([
881
1037
  "open",
882
1038
  "done",
@@ -889,20 +1045,41 @@ const reviewItemSchema = z.object({
889
1045
  * `code_change` for a pull request. Unset when none claims it.
890
1046
  */
891
1047
  objectType: objectTypeSchema.optional(),
1048
+ /**
1049
+ * The Event resource that `url` names, such as a pull request, with
1050
+ * the Event types that can wake or resolve a snooze of the item.
1051
+ * Unset when no Event source claims it.
1052
+ */
1053
+ resource: inboxSnoozeResourceSchema.optional(),
892
1054
  title: z.string().min(1).optional(),
1055
+ /**
1056
+ * A code change title split by Conventional Commits, as the plugin
1057
+ * that owns the code change parsed it.
1058
+ */
1059
+ titleParts: z.object({
1060
+ breaking: z.boolean().optional(),
1061
+ scope: z.string().min(1).optional(),
1062
+ text: z.string().min(1),
1063
+ type: z.string().min(1).optional()
1064
+ }).strict().optional(),
893
1065
  url: z.string().min(1).optional()
894
1066
  }).strict().optional(),
895
1067
  title: z.string().min(1),
896
1068
  updatedAt: z.string().datetime(),
897
- visibility: z.enum(["public", "private"])
1069
+ visibility: z.enum(["public", "private"]),
1070
+ /**
1071
+ * Why the viewer's snooze of the open item woke. Only that viewer sees
1072
+ * it, until they open or act on the item.
1073
+ */
1074
+ wake: inboxSnoozeWakeSchema.optional()
898
1075
  }).strict();
899
1076
  /**
900
- * Review desk list filters. The list has the open items that the viewer can
1077
+ * Inbox list filters. The list has the open items that the viewer can
901
1078
  * see, one page at a time. A search or `include=archived` also finds done and
902
1079
  * dismissed items, after the open ones. `status` lists closed items instead,
903
1080
  * with the same visibility.
904
1081
  */
905
- const reviewItemListQuerySchema = z.object({
1082
+ const inboxItemListQuerySchema = z.object({
906
1083
  conversationId: z.string().min(1).optional(),
907
1084
  /** `nextCursor` of the page before. */
908
1085
  cursor: z.string().min(1).max(1e3).optional(),
@@ -911,6 +1088,13 @@ const reviewItemListQuerySchema = z.object({
911
1088
  * list keeps items assigned to the viewer, to Everyone, or to no one.
912
1089
  */
913
1090
  for: z.enum(["viewer"]).optional(),
1091
+ /** `automation` lists only Automation alerts. */
1092
+ owner: z.enum(["automation"]).optional(),
1093
+ /**
1094
+ * `true` lists only the open items in Inbox rows that the viewer
1095
+ * snoozed, the Snoozed view. Without it, `for=viewer` hides them.
1096
+ */
1097
+ snoozed: z.enum(["true"]).optional(),
914
1098
  /** The number of open items on one page. */
915
1099
  limit: z.coerce.number().int().min(1).max(100).default(50),
916
1100
  /** Also list the newest done and dismissed items, with the first page. */
@@ -933,35 +1117,34 @@ const reviewItemListQuerySchema = z.object({
933
1117
  ])).refine((statuses) => !statuses.includes("open") || statuses.length === 1, "List open items on their own."))
934
1118
  }).strict();
935
1119
  /**
936
- * One page of the review desk list. Open items come first, oldest first.
1120
+ * One page of the Inbox list. Open items come first, oldest first.
937
1121
  * The first page of a search, or of a list that includes archived items,
938
1122
  * also has the newest archived matches.
939
1123
  */
940
- const reviewItemListSchema = z.object({
941
- items: z.array(reviewItemSchema),
1124
+ const inboxItemListSchema = z.object({
1125
+ items: z.array(inboxItemSchema),
942
1126
  /** Set when more archived items match than the list shows. */
943
1127
  moreArchived: z.boolean().optional(),
944
1128
  /** Set when more open items follow. Pass it as `cursor` to read them. */
945
1129
  nextCursor: z.string().min(1).optional()
946
1130
  }).strict();
947
- /** `GET /api/review-items/count` query. */
948
- const reviewItemCountQuerySchema = z.object({
949
- /** `automations` also counts the viewer's Automations that need attention. */
950
- include: z.enum(["automations"]).optional(),
951
- /**
952
- * The newest item of each snoozed Inbox row, comma separated. Snoozes
953
- * live in the browser, so the server counts only the ids it is given.
954
- */
955
- snoozed: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.string().min(1).max(200)).max(100))
956
- }).strict();
1131
+ /** `GET /api/inbox-items/count` query. */
1132
+ const inboxItemCountQuerySchema = z.object({
957
1133
  /**
958
- * The counts behind the Inbox badge, which shows the sum of `needsViewer`
959
- * and `automations`, and behind the Inbox entries.
1134
+ * Extra counts, comma separated. `automations` counts the viewer's
1135
+ * Automations that need attention, and `snoozed` their snoozed rows.
960
1136
  */
961
- const reviewItemCountSchema = z.object({
1137
+ include: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.enum(["automations", "snoozed"]))) }).strict();
1138
+ /**
1139
+ * The counts behind the Inbox badge, which shows `needsViewer`, and behind
1140
+ * the Inbox entries. An Automation alert is an Inbox item, so
1141
+ * `needsViewer` counts it.
1142
+ */
1143
+ const inboxItemCountSchema = z.object({
962
1144
  /**
963
- * The viewer's own Automations that need attention, as the Inbox lists
964
- * them (`scope=attention&owner=me`). Only with `include=automations`.
1145
+ * The viewer's own Automations that need attention, as the Automations
1146
+ * entry counts them (`scope=attention&owner=me`). Only with
1147
+ * `include=automations`.
965
1148
  */
966
1149
  automations: z.number().int().nonnegative().optional(),
967
1150
  /** The `needsViewer` items whose subject is a code change. */
@@ -970,10 +1153,13 @@ const reviewItemCountSchema = z.object({
970
1153
  decisions: z.number().int().nonnegative(),
971
1154
  /**
972
1155
  * Open action items assigned to the viewer as a User
973
- * (`reviewItemNeedsUser`). Notices and items for Everyone do not count.
1156
+ * (`inboxItemNeedsUser`). Notices and items for Everyone do not count.
974
1157
  */
975
1158
  needsViewer: z.number().int().nonnegative(),
976
- /** The `snoozed` ids that are open and listed for the viewer. */
1159
+ /**
1160
+ * The Inbox rows that the viewer snoozed and that still have an open
1161
+ * item for them, as Snoozed lists them. 0 without `include=snoozed`.
1162
+ */
977
1163
  snoozed: z.number().int().nonnegative()
978
1164
  }).strict();
979
1165
  /**
@@ -981,7 +1167,7 @@ const reviewItemCountSchema = z.object({
981
1167
  * is the newest such item; `count` is how many there are; `waitingSince` is
982
1168
  * when the oldest was added.
983
1169
  */
984
- const reviewItemWaitingConversationsSchema = z.object({ conversations: z.array(z.object({
1170
+ const inboxItemWaitingConversationsSchema = z.object({ conversations: z.array(z.object({
985
1171
  conversationId: z.string().min(1),
986
1172
  /** Open items that need the viewer, newest first. */
987
1173
  items: z.array(z.object({
@@ -992,9 +1178,9 @@ const reviewItemWaitingConversationsSchema = z.object({ conversations: z.array(z
992
1178
  /** When the oldest of those items was added: when the wait began. */
993
1179
  waitingSince: z.string().datetime()
994
1180
  }).strict()) }).strict();
995
- const reviewItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
996
- /** One person action on a Review item. */
997
- const reviewItemActionSchema = z.discriminatedUnion("action", [
1181
+ const inboxItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
1182
+ /** One person action on an Inbox item. */
1183
+ const inboxItemActionSchema = z.discriminatedUnion("action", [
998
1184
  z.object({ action: z.literal("take") }).strict(),
999
1185
  z.object({ action: z.literal("dismiss") }).strict(),
1000
1186
  z.object({
@@ -1062,9 +1248,14 @@ const statsReportSchema = z.object({
1062
1248
  windowStart: z.string()
1063
1249
  }).strict();
1064
1250
  // src/api/schema/versions.ts
1251
+ /** The most Conversations that one versions read gives tokens for. */
1252
+ const VERSIONS_CONVERSATION_LIMIT = 50;
1065
1253
  const versionsQuerySchema = z.object({
1066
- /** The open Conversation, whose token comes back as `conversation`. */
1067
- conversationId: z.string().min(1).optional() }).strict();
1254
+ /**
1255
+ * The Conversations on screen, comma separated. Their tokens come back
1256
+ * in `conversationDetails`.
1257
+ */
1258
+ conversationIds: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.string().min(1).max(200)).max(50)) }).strict();
1068
1259
  /**
1069
1260
  * Opaque change tokens for the dashboard reads that refresh by themselves.
1070
1261
  * A token changes when the read it covers can change. Compare a token only
@@ -1072,20 +1263,20 @@ conversationId: z.string().min(1).optional() }).strict();
1072
1263
  */
1073
1264
  const versionsSchema = z.object({
1074
1265
  /**
1075
- * Tree token of the requested Conversation, the same value as the
1076
- * detail report's `CONVERSATION_VERSION_HEADER`. Missing when it does
1077
- * not exist.
1266
+ * Tree token of each requested Conversation by id, the same value as
1267
+ * its detail report's `CONVERSATION_VERSION_HEADER`. A Conversation
1268
+ * that does not exist has no entry.
1078
1269
  */
1079
- conversation: z.string().min(1).optional(),
1270
+ conversationDetails: z.record(z.string(), z.string().min(1)),
1080
1271
  /**
1081
1272
  * The viewer's Conversation feed. It lists a short token for each
1082
1273
  * feed-row input as `name:token`, separated by spaces, so the dashboard
1083
1274
  * can record which inputs moved it.
1084
1275
  */
1085
1276
  conversations: z.string().min(1),
1086
- /** Open Review items that need the viewer. */
1087
- reviewItems: z.string().min(1),
1277
+ /** Open Inbox items that need the viewer. */
1278
+ inboxItems: z.string().min(1),
1088
1279
  /** The viewer's rolling model spend. */
1089
1280
  spend: z.string().min(1)
1090
1281
  }).strict();
1091
- export { testNotificationResponseSchema as $, startServiceAccountSignInResponseSchema as A, objectLinksReportSchema as At, personParamsSchema as B, conversationSubscriptionResponseSchema as Bt, cacheWarmingSavingsRefillResponseSchema as C, conversationChildAgentsReportSchema as Ct, serviceAccountListSchema as D, attachObjectLinkBodySchema as Dt, disconnectServiceAccountResponseSchema as E, MAX_OBJECT_LINKS as Et, personalTokenParamsSchema as F, archiveConversationBodySchema as Ft, locationParamsSchema as G, reorderPinnedConversationsBodySchema as Gt, locationActivityDayReportSchema as H, conversationDeliveryResponseSchema as Ht, revokePersonalTokenResponseSchema as I, archiveConversationResponseSchema as It, activitySixHours as J, conversationCatchUpSchema as Jt, activityDays as K, reorderPinnedConversationsResponseSchema as Kt, actorDirectoryReportSchema as L, archiveDoneConversationsResponseSchema as Lt, createdPersonalTokenSchema as M, conversationStatsReportSchema as Mt, personalTokenListSchema as N, CONVERSATION_OUTLINE_TEXT_LENGTH as Nt, serviceAccountParamsSchema as O, attachObjectLinkResponseSchema as Ot, personalTokenMetadataSchema as P, conversationOutlineSchema as Pt, pushSubscriptionDeleteBodySchema as Q, actorProfileReportSchema as R, conversationAutoArchiveSchema as Rt, cacheWarmingSavingsQuerySchema as S, conversationChildAgentSchema as St, closeCacheWarmingBreakerResponseSchema as T, continueConversationInSlackResponseSchema as Tt, locationDetailReportSchema as U, pinConversationBodySchema as Ut, personalSpendReportSchema as V, conversationDeliveryBodySchema as Vt, locationDirectoryReportSchema as W, pinConversationResponseSchema as Wt, notificationSettingsSchema as X, attachmentUploadSchema as Xt, dailyConversationActivitySchema as Y, attachmentUploadParamsSchema as Yt, pushSubscriptionBodySchema as Z, createAttachmentUploadBodySchema as Zt, reviewItemParamsSchema as _, conversationPlanReportSchema as _t, baselineSnapshotSchema as a, IDLE_CHANGE_DAYS as at, cacheWarmingBreakerListSchema as b, conversationWatchSchema as bt, workspaceListSchema as c, codeChangeSummarySchema as ct, workspaceSchema as d, codeRepositoryParamsSchema as dt, connectionListSchema as et, reviewItemActionSchema as f, codeRepositoryQuerySchema as ft, reviewItemListSchema as g, conversationPlanItemSchema as gt, reviewItemListQuerySchema as h, personCodeQuerySchema as ht, statsReportSchema as i, startConnectionResponseSchema as it, createPersonalTokenBodySchema as j, stopConversationTurnResponseSchema as jt, serviceAccountSchema as k, objectLinksQuerySchema as kt, workspaceParamsSchema as l, codeOverviewReportSchema as lt, reviewItemCountSchema as m, codeRepositorySummarySchema as mt, versionsSchema as n, connectionSchema as nt, deleteWorkspaceResponseSchema as o, codeActivityDaySchema as ot, reviewItemCountQuerySchema as p, codeRepositoryReportSchema as pt, activityHours as q, conversationCatchUpBodySchema as qt, statSchema as r, disconnectConnectionResponseSchema as rt, workspaceBodySchema as s, codeChangeSummaryReportSchema as st, versionsQuerySchema as t, connectionParamsSchema as tt, workspaceRepoSchema as u, codePersonReportSchema as ut, reviewItemSchema as v, planItemParamsSchema as vt, cacheWarmingSavingsReportSchema as w, continueConversationInSlackBodySchema as wt, cacheWarmingBreakerParamsSchema as x, conversationWatchesReportSchema as xt, reviewItemWaitingConversationsSchema as y, planItemStatusBodySchema as yt, avatarParamsSchema as z, conversationSubscriptionBodySchema as zt };
1282
+ export { mentionablePersonSchema as $, conversationStatsReportSchema as $t, cacheHealthQuerySchema as A, codePersonReportSchema as At, serviceAccountParamsSchema as B, todoStatusBodySchema as Bt, inboxSnoozeResourceQuerySchema as C, IDLE_CHANGE_DAYS as Ct, inboxSnoozeWakesClearSchema as D, codeChangeSummaryReportSchema as Dt, inboxSnoozeSubjectSchema as E, codeChangeSearchReportSchema as Et, cacheWarmingSavingsRefillResponseSchema as F, mentionableCodeChangeSchema as Ft, personalTokenListSchema as G, conversationChildAgentsReportSchema as Gt, startServiceAccountSignInResponseSchema as H, conversationWatchesReportSchema as Ht, cacheWarmingSavingsReportSchema as I, personCodeQuerySchema as It, revokePersonalTokenResponseSchema as J, MAX_OBJECT_LINKS as Jt, personalTokenMetadataSchema as K, continueConversationInSlackBodySchema as Kt, closeCacheWarmingBreakerResponseSchema as L, conversationTodoSchema as Lt, cacheWarmingBreakerListSchema as M, codeRepositoryQuerySchema as Mt, cacheWarmingBreakerParamsSchema as N, codeRepositoryReportSchema as Nt, gatewayProvidersSchema as O, codeChangeSummarySchema as Ot, cacheWarmingSavingsQuerySchema as P, codeRepositorySummarySchema as Pt, avatarParamsSchema as Q, objectLinksReportSchema as Qt, disconnectServiceAccountResponseSchema as R, conversationTodosReportSchema as Rt, inboxSnoozeCreateSchema as S, startConnectionResponseSchema as St, inboxSnoozeSchema as T, codeChangeSearchQuerySchema as Tt, createPersonalTokenBodySchema as U, watchParamsSchema as Ut, serviceAccountSchema as V, conversationWatchSchema as Vt, createdPersonalTokenSchema as W, conversationChildAgentSchema as Wt, actorDirectoryReportSchema as X, attachObjectLinkResponseSchema as Xt, PERSON_CARD_RECENT_LIMIT as Y, attachObjectLinkBodySchema as Yt, actorProfileReportSchema as Z, objectLinksQuerySchema as Zt, inboxItemListSchema as _, testNotificationResponseSchema as _t, statsReportSchema as a, conversationCatchUpSchema as an, leadSchema as at, inboxItemWaitingConversationsSchema as b, connectionSchema as bt, workspaceBodySchema as c, createAttachmentUploadBodySchema as cn, locationDirectoryReportSchema as ct, workspaceRepoSchema as d, activityHours as dt, CONVERSATION_OUTLINE_TEXT_LENGTH as en, peopleSearchQuerySchema as et, workspaceSchema as f, activitySixHours as ft, inboxItemListQuerySchema as g, pushSubscriptionDeleteBodySchema as gt, inboxItemCountSchema as h, pushSubscriptionBodySchema as ht, statSchema as i, conversationCatchUpBodySchema as in, personalSpendReportSchema as it, cacheHealthReportSchema as j, codeRepositoryParamsSchema as jt, updateGatewayProvidersBodySchema as k, codeOverviewReportSchema as kt, workspaceListSchema as l, forkConversationBodySchema as ln, locationParamsSchema as lt, inboxItemCountQuerySchema as m, notificationSettingsSchema as mt, versionsQuerySchema as n, conversationDeliveryBodySchema as nn, personCardReportSchema as nt, baselineSnapshotSchema as o, attachmentUploadParamsSchema as on, locationActivityDayReportSchema as ot, inboxItemActionSchema as p, dailyConversationActivitySchema as pt, personalTokenParamsSchema as q, continueConversationInSlackResponseSchema as qt, versionsSchema as r, conversationDeliveryResponseSchema as rn, personParamsSchema as rt, deleteWorkspaceResponseSchema as s, attachmentUploadSchema as sn, locationDetailReportSchema as st, VERSIONS_CONVERSATION_LIMIT as t, conversationOutlineSchema as tn, peopleSearchReportSchema as tt, workspaceParamsSchema as u, forkConversationResponseSchema as un, activityDays as ut, inboxItemParamsSchema as v, connectionListSchema as vt, inboxSnoozeResourceSchema as w, codeActivityDaySchema as wt, INBOX_SNOOZE_MAX_TRIGGERS as x, disconnectConnectionResponseSchema as xt, inboxItemSchema as y, connectionParamsSchema as yt, serviceAccountListSchema as z, todoParamsSchema as zt };