@sentry/junior 0.295.0 → 0.297.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 (84) hide show
  1. package/dist/{admin-ifgjyfpF.js → admin-tmGIw4KS.js} +2 -2
  2. package/dist/{agent-runner-DjMTPWEO.js → agent-runner-CneTquAE.js} +468 -1947
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +7 -7
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +306 -569
  7. package/dist/{app-uiTzRbvq.d.ts → app-BJojZ7HL.d.ts} +7 -2
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +64 -44
  10. package/dist/attempt-selection-ClP3MMPr.js +61 -0
  11. package/dist/{automation-yJX3C7i3.js → automation-BrP6ImrC.js} +1 -1
  12. package/dist/{background-compaction-queue-DUkHZjmL.js → background-compaction-queue-CwfJy3Cd.js} +4 -88
  13. package/dist/{briefs-CbNYM-q2.js → briefs-uFTuhMqA.js} +3 -3
  14. package/dist/{catalog-runtime-DgouZKZm.js → catalog-runtime-0kuQqYL4.js} +1 -1
  15. package/dist/cli/chat.js +19 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-DvnTPCfp.js → config-Dj9M_nqB.js} +18 -2
  23. package/dist/{connections-CWaIVl_1.js → connections-B96JUM5o.js} +6 -6
  24. package/dist/{conversation-CMkSmi02.js → conversation-CvcBU1z2.js} +2 -16
  25. package/dist/{conversation-feed-BVAOga0H.js → conversation-feed-BSMlGZnS.js} +1 -1
  26. package/dist/{conversation-privacy-DPjv4SnA.js → conversation-privacy-DI29jbZV.js} +1 -1
  27. package/dist/conversation-turn-CZWBr091.js +805 -0
  28. package/dist/{credential-sync-BhbaZfmO.js → credential-sync-Blhx4_xf.js} +14 -13
  29. package/dist/{db-Dts2XvLu.js → db-Br0tfAo7.js} +54 -32
  30. package/dist/{db-CCUqQe0E.d.ts → db-CrtyFRz7.d.ts} +13 -1
  31. package/dist/{executor-Ck73J0wP.js → executor-BMPipFVA.js} +19 -5
  32. package/dist/instrumentation.js +19 -2
  33. package/dist/{logging-9OAq-fdg.js → logging-CQjlDQYX.js} +1 -1
  34. package/dist/{message-CtaPzC7m.js → message-BOZEIuxy.js} +15 -13
  35. package/dist/nitro.d.ts +1 -1
  36. package/dist/nitro.js +3 -2
  37. package/dist/{session-stop-DkxI5vc3.js → notification-gusCgdQ6.js} +14 -933
  38. package/dist/{oauth-callback-server-C_LXY1d4.js → oauth-callback-server-V_DuMuNX.js} +2 -2
  39. package/dist/{projection-BzJQncZV.js → projection-B08mfi0u.js} +479 -145
  40. package/dist/{prompt-Cbq5b4SO.js → prompt-BlutWLNt.js} +4 -4
  41. package/dist/prompt-input-Dxn8cDC0.js +1424 -0
  42. package/dist/{registry-cbpOxO4M.js → registry-BDWgCJDf.js} +1 -1
  43. package/dist/reporting-window-DopzcOHh.js +137 -0
  44. package/dist/{resolve-t-pmRdwS.js → resolve-2Z_o_SsI.js} +3 -3
  45. package/dist/result-CAujiaci.js +463 -0
  46. package/dist/{runner-CHv9X9TH.js → runner-D2Chc02N.js} +9 -8
  47. package/dist/{sandbox-egress-signals-Yy3fSCbg.js → sandbox-egress-signals-CFoJduFj.js} +1 -1
  48. package/dist/{schema-BhneuGYv.js → schema-Bqa5NbcP.js} +22 -48
  49. package/dist/{schema-TSEisVJR.d.ts → schema-Ce2XCS7O.d.ts} +24 -107
  50. package/dist/{service-account-DjPIwCMj.js → service-account-C9kRQEb_.js} +3 -3
  51. package/dist/{service-account-C4rBP8ne.js → service-account-CERfXEVU.js} +3 -3
  52. package/dist/session-stop-B-I1rAS1.js +181 -0
  53. package/dist/{skills-BZE2DP8I.js → skills-B0m1nZ_j.js} +3 -3
  54. package/dist/{spawn-BvULxIiu.js → spawn-CwMjRRtn.js} +6 -5
  55. package/dist/{state-CO9ETDzk.js → state-DFnmLmfn.js} +2 -2
  56. package/dist/{stop-CL-rdtQb.js → stop-BCH9VNGf.js} +329 -382
  57. package/dist/{store-DgD78_NK.js → store-B59rOYbS.js} +11 -4
  58. package/dist/{task-runner-CKOj6xla.js → store-m5bmdmsP.js} +929 -1559
  59. package/dist/task-queue-N0kuCknH.js +89 -0
  60. package/dist/task-runner-COOwR8qm.js +291 -0
  61. package/dist/thread-context-Cd44z_W5.js +248 -0
  62. package/dist/turn-cancel-DDu8TOwt.js +201 -0
  63. package/dist/turn-session-routing-BlCtVFRN.js +380 -0
  64. package/dist/{turn-failure-response-BTSo6SMJ.js → turn-user-message-ygLG3ylQ.js} +183 -358
  65. package/dist/turn-wake-DmQec4AG.js +161 -0
  66. package/dist/{reporting-window-B3Ze-Qnt.js → user-input-request-CXNIov9n.js} +24 -143
  67. package/dist/{validation-CXeYgBzq.js → validation-Ba2OcUse.js} +1 -1
  68. package/dist/{version-AQa7Fr2H.js → version-KNDzIAh6.js} +1 -1
  69. package/dist/version.js +1 -1
  70. package/dist/{viewer-Bqkb678l.js → viewer-BPpuN2f9.js} +3 -3
  71. package/dist/warmup-Bskrwmk1.js +2697 -0
  72. package/dist/{worker-Hl7N292I.js → worker-B1skZlit.js} +20 -8
  73. package/migrations/0101_drop_legacy_columns.sql +12 -0
  74. package/migrations/0102_code_change_last_activity.sql +1 -0
  75. package/migrations/0103_agent_invocation_fork.sql +8 -0
  76. package/migrations/meta/0101_snapshot.json +4496 -0
  77. package/migrations/meta/0102_snapshot.json +4502 -0
  78. package/migrations/meta/0103_snapshot.json +4509 -0
  79. package/migrations/meta/_journal.json +21 -0
  80. package/package.json +5 -4
  81. package/dist/result-DhgjR3nQ.js +0 -305
  82. package/dist/result-event-type-DD6BAgT7.js +0 -11
  83. package/dist/warmup-h6u1e9n0.js +0 -1869
  84. package/dist/work-yN_GAuXY.js +0 -768
@@ -1,8 +1,9 @@
1
1
  import { r as notificationScheduleSchema } from "./schedule-cP0AACm1.js";
2
- import { E as conversationChildAgentTotalsSchema, i as actorIdentitySchema, s as conversationAuxiliaryCostsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-CMkSmi02.js";
3
- import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, w as AGENT_INVOCATION_STATUSES, x as userInputRequestSchema } from "./reporting-window-B3Ze-Qnt.js";
4
- import "./automation-yJX3C7i3.js";
5
- import "./conversation-feed-BVAOga0H.js";
2
+ import { E as conversationChildAgentTotalsSchema, i as actorIdentitySchema, s as conversationAuxiliaryCostsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-CvcBU1z2.js";
3
+ import { p as AGENT_INVOCATION_STATUSES, s as userInputRequestSchema } from "./user-input-request-CXNIov9n.js";
4
+ import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-DopzcOHh.js";
5
+ import "./automation-BrP6ImrC.js";
6
+ import "./conversation-feed-BSMlGZnS.js";
6
7
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
7
8
  import * as z from "zod";
8
9
  import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
@@ -50,14 +51,6 @@ const conversationSubscriptionResponseSchema = z.object({
50
51
  archivedAt: z.string().datetime().nullable(),
51
52
  subscribed: z.boolean()
52
53
  }).strict();
53
- // src/api/schema/conversation-unread.ts
54
- /** Mark one Conversation read or unread for the signed-in viewer. */
55
- const markConversationUnreadBodySchema = z.object({ unread: z.boolean() }).strict();
56
- /**
57
- * Whether Junior's latest visible reply is after the viewer's read position
58
- * once the change is stored.
59
- */
60
- const conversationUnreadSchema = z.object({ unreadReply: z.boolean() }).strict();
61
54
  // src/api/schema/conversation-archive.ts
62
55
  /**
63
56
  * Archive or restore one conversation. `applyToChildren` applies to a child
@@ -111,6 +104,17 @@ const conversationMetricDaySchema = z.object({
111
104
  date: conversationMetricBucketSchema,
112
105
  durationMs: z.number(),
113
106
  inputTokens: z.number().optional(),
107
+ /** Conversation cost split to `mergedCodeChanges`. */
108
+ mergedCodeChangeCostUsd: z.number().optional(),
109
+ /** Code changes merged in this bucket. They are also `outcomes`. */
110
+ mergedCodeChanges: z.number().optional(),
111
+ /** Conversation cost of `outcomes`. */
112
+ outcomeCostUsd: z.number().optional(),
113
+ /**
114
+ * Merged code changes, plus root Conversations without code changes
115
+ * whose latest Brief is `done` or `answered`.
116
+ */
117
+ outcomes: z.number().optional(),
114
118
  tokens: z.number().optional()
115
119
  }).strict();
116
120
  const guardianMetricDaySchema = z.object({
@@ -263,41 +267,6 @@ const conversationWatchesReportSchema = z.object({
263
267
  conversationId: z.string().min(1),
264
268
  watches: z.array(conversationWatchSchema)
265
269
  }).strict();
266
- // src/api/schema/board.ts
267
- const boardColumnSchema = z.enum([
268
- "planned",
269
- "in_progress",
270
- "ready",
271
- "done"
272
- ]);
273
- const boardCardSchema = z.object({
274
- /** Stable card id. One object gives one card. */
275
- key: z.string().min(1),
276
- column: boardColumnSchema,
277
- objectType: z.enum(["task", "code_change"]),
278
- title: z.string().min(1),
279
- /** Short object reference, such as `getsentry/junior#42`. */
280
- label: z.string().min(1),
281
- url: z.string().url().optional(),
282
- status: z.string().min(1),
283
- /** When the card last changed. A Done card uses its finish time. */
284
- updatedAt: z.string(),
285
- conversation: z.object({
286
- conversationId: z.string().min(1),
287
- title: z.string().optional(),
288
- /** Root title when the card comes from a Thread. */
289
- rootTitle: z.string().optional()
290
- }).strict(),
291
- participants: z.array(actorIdentitySchema),
292
- /** A Turn runs in the Conversation of the card or in one of its Tasks. */
293
- working: z.boolean(),
294
- /** The Conversation has an open review item that needs the viewer. */
295
- needsViewer: z.boolean()
296
- }).strict();
297
- const boardReportSchema = z.object({
298
- cards: z.array(boardCardSchema),
299
- doneWindowHours: z.number().int().positive()
300
- }).strict();
301
270
  // src/api/schema/code.ts
302
271
  const codeChangeSummarySchema = z.object({
303
272
  closed: z.number().int().nonnegative(),
@@ -332,6 +301,11 @@ const codeRepositorySummarySchema = z.object({
332
301
  const codeChangeSummaryReportSchema = z.object({
333
302
  closedAt: z.string().optional(),
334
303
  id: z.string().uuid(),
304
+ /**
305
+ * Latest push, review, or comment by a person. Absent when the code
306
+ * plugin has seen no activity; readers fall back to `openedAt`.
307
+ */
308
+ lastActivityAt: z.string().optional(),
335
309
  mergedAt: z.string().optional(),
336
310
  number: z.number().int().positive(),
337
311
  openedAt: z.string(),
@@ -870,4 +844,4 @@ const versionsSchema = z.object({
870
844
  /** The viewer's rolling model spend. */
871
845
  spend: z.string().min(1)
872
846
  }).strict();
873
- export { codeActivityDaySchema as $, revokePersonalTokenResponseSchema as A, reorderPinnedConversationsBodySchema as At, activityDays as B, serviceAccountSchema as C, markConversationUnreadBodySchema as Ct, personalTokenListSchema as D, conversationDeliveryResponseSchema as Dt, createdPersonalTokenSchema as E, conversationDeliveryBodySchema as Et, personalSpendReportSchema as F, pushSubscriptionBodySchema as G, activitySixHours as H, locationActivityDayReportSchema as I, connectionListSchema as J, pushSubscriptionDeleteBodySchema as K, locationDetailReportSchema as L, actorProfileReportSchema as M, conversationCatchUpBodySchema as Mt, avatarParamsSchema as N, conversationCatchUpSchema as Nt, personalTokenMetadataSchema as O, pinConversationBodySchema as Ot, personParamsSchema as P, startConnectionResponseSchema as Q, locationDirectoryReportSchema as R, serviceAccountParamsSchema as S, conversationUnreadSchema as St, createPersonalTokenBodySchema as T, conversationSubscriptionResponseSchema as Tt, dailyConversationActivitySchema as U, activityHours as V, notificationSettingsSchema as W, connectionSchema as X, connectionParamsSchema as Y, disconnectConnectionResponseSchema as Z, reviewItemParamsSchema as _, conversationOutlineSchema as _t, replyTimeSegmentsReportSchema as a, codeRepositoryReportSchema as at, disconnectServiceAccountResponseSchema as b, archiveDoneConversationsResponseSchema as bt, workspaceBodySchema as c, conversationWatchSchema as ct, workspaceRepoSchema as d, conversationChildAgentsReportSchema as dt, codeChangeSummaryReportSchema as et, workspaceSchema as f, continueConversationInSlackBodySchema as ft, reviewItemListSchema as g, CONVERSATION_OUTLINE_TEXT_LENGTH as gt, reviewItemListQuerySchema as h, conversationStatsReportSchema as ht, statsReportSchema as i, codeRepositoryParamsSchema as it, actorDirectoryReportSchema as j, reorderPinnedConversationsResponseSchema as jt, personalTokenParamsSchema as k, pinConversationResponseSchema as kt, workspaceListSchema as l, conversationWatchesReportSchema as lt, reviewItemCountSchema as m, stopConversationTurnResponseSchema as mt, versionsSchema as n, codeOverviewReportSchema as nt, baselineSnapshotSchema as o, codeRepositorySummarySchema as ot, reviewItemActionSchema as p, continueConversationInSlackResponseSchema as pt, testNotificationResponseSchema as q, statSchema as r, codePersonReportSchema as rt, deleteWorkspaceResponseSchema as s, boardReportSchema as st, versionsQuerySchema as t, codeChangeSummarySchema as tt, workspaceParamsSchema as u, conversationChildAgentSchema as ut, reviewItemSchema as v, archiveConversationBodySchema as vt, startServiceAccountSignInResponseSchema as w, conversationSubscriptionBodySchema as wt, serviceAccountListSchema as x, conversationAutoArchiveSchema as xt, reviewItemWaitingConversationsSchema as y, archiveConversationResponseSchema as yt, locationParamsSchema as z };
847
+ export { codeActivityDaySchema as $, revokePersonalTokenResponseSchema as A, conversationCatchUpSchema as At, activityDays as B, serviceAccountSchema as C, conversationDeliveryBodySchema as Ct, personalTokenListSchema as D, reorderPinnedConversationsBodySchema as Dt, createdPersonalTokenSchema as E, pinConversationResponseSchema as Et, personalSpendReportSchema as F, pushSubscriptionBodySchema as G, activitySixHours as H, locationActivityDayReportSchema as I, connectionListSchema as J, pushSubscriptionDeleteBodySchema as K, locationDetailReportSchema as L, actorProfileReportSchema as M, avatarParamsSchema as N, personalTokenMetadataSchema as O, reorderPinnedConversationsResponseSchema as Ot, personParamsSchema as P, startConnectionResponseSchema as Q, locationDirectoryReportSchema as R, serviceAccountParamsSchema as S, conversationSubscriptionResponseSchema as St, createPersonalTokenBodySchema as T, pinConversationBodySchema as Tt, dailyConversationActivitySchema as U, activityHours as V, notificationSettingsSchema as W, connectionSchema as X, connectionParamsSchema as Y, disconnectConnectionResponseSchema as Z, reviewItemParamsSchema as _, archiveConversationBodySchema as _t, replyTimeSegmentsReportSchema as a, codeRepositoryReportSchema as at, disconnectServiceAccountResponseSchema as b, conversationAutoArchiveSchema as bt, workspaceBodySchema as c, conversationWatchesReportSchema as ct, workspaceRepoSchema as d, continueConversationInSlackBodySchema as dt, codeChangeSummaryReportSchema as et, workspaceSchema as f, continueConversationInSlackResponseSchema as ft, reviewItemListSchema as g, conversationOutlineSchema as gt, reviewItemListQuerySchema as h, CONVERSATION_OUTLINE_TEXT_LENGTH as ht, statsReportSchema as i, codeRepositoryParamsSchema as it, actorDirectoryReportSchema as j, personalTokenParamsSchema as k, conversationCatchUpBodySchema as kt, workspaceListSchema as l, conversationChildAgentSchema as lt, reviewItemCountSchema as m, conversationStatsReportSchema as mt, versionsSchema as n, codeOverviewReportSchema as nt, baselineSnapshotSchema as o, codeRepositorySummarySchema as ot, reviewItemActionSchema as p, stopConversationTurnResponseSchema as pt, testNotificationResponseSchema as q, statSchema as r, codePersonReportSchema as rt, deleteWorkspaceResponseSchema as s, conversationWatchSchema as st, versionsQuerySchema as t, codeChangeSummarySchema as tt, workspaceParamsSchema as u, conversationChildAgentsReportSchema as ut, reviewItemSchema as v, archiveConversationResponseSchema as vt, startServiceAccountSignInResponseSchema as w, conversationDeliveryResponseSchema as wt, serviceAccountListSchema as x, conversationSubscriptionBodySchema as xt, reviewItemWaitingConversationsSchema as y, archiveDoneConversationsResponseSchema as yt, locationParamsSchema as z };
@@ -28,6 +28,8 @@ declare const messageAttachmentSchema: z.ZodObject<{
28
28
  type MessageAttachment = z.output<typeof messageAttachmentSchema>;
29
29
  /** True when an Event type names an agent invocation result. */
30
30
  declare function isAgentInvocationResultEventType(eventType: string): boolean;
31
+ /** Event type of the `reply` that ends a child agent's Turn. */
32
+ declare const AGENT_REPLY_EVENT_TYPE = "agent.reply";
31
33
  /**
32
34
  * Build the retry-stable Message id shared by web ingress and browser sends.
33
35
  * Keep the existing hash and prefix so retries still address stored Messages.
@@ -162,82 +164,6 @@ declare const messageCardRefSchema: z.ZodObject<{
162
164
  type MessageCardRef = z.output<typeof messageCardRefSchema>;
163
165
  /** Resolve current saved facts without fetching providers or changing history. */
164
166
  declare function resolveMessageCards(refs: readonly MessageCardRef[], annotations: readonly ConversationAnnotation[]): OwnedObjectAnnotation[];
165
- declare const boardColumnSchema: z.ZodEnum<{
166
- done: "done";
167
- in_progress: "in_progress";
168
- planned: "planned";
169
- ready: "ready";
170
- }>;
171
- declare const boardCardSchema: z.ZodObject<{
172
- key: z.ZodString;
173
- column: z.ZodEnum<{
174
- done: "done";
175
- in_progress: "in_progress";
176
- planned: "planned";
177
- ready: "ready";
178
- }>;
179
- objectType: z.ZodEnum<{
180
- code_change: "code_change";
181
- task: "task";
182
- }>;
183
- title: z.ZodString;
184
- label: z.ZodString;
185
- url: z.ZodOptional<z.ZodString>;
186
- status: z.ZodString;
187
- updatedAt: z.ZodString;
188
- conversation: z.ZodObject<{
189
- conversationId: z.ZodString;
190
- title: z.ZodOptional<z.ZodString>;
191
- rootTitle: z.ZodOptional<z.ZodString>;
192
- }, z.core.$strict>;
193
- participants: z.ZodArray<z.ZodObject<{
194
- avatarUrl: z.ZodOptional<z.ZodString>;
195
- email: z.ZodOptional<z.ZodString>;
196
- fullName: z.ZodOptional<z.ZodString>;
197
- slackUserId: z.ZodOptional<z.ZodString>;
198
- slackUserName: z.ZodOptional<z.ZodString>;
199
- }, z.core.$strict>>;
200
- working: z.ZodBoolean;
201
- needsViewer: z.ZodBoolean;
202
- }, z.core.$strict>;
203
- declare const boardReportSchema: z.ZodObject<{
204
- cards: z.ZodArray<z.ZodObject<{
205
- key: z.ZodString;
206
- column: z.ZodEnum<{
207
- done: "done";
208
- in_progress: "in_progress";
209
- planned: "planned";
210
- ready: "ready";
211
- }>;
212
- objectType: z.ZodEnum<{
213
- code_change: "code_change";
214
- task: "task";
215
- }>;
216
- title: z.ZodString;
217
- label: z.ZodString;
218
- url: z.ZodOptional<z.ZodString>;
219
- status: z.ZodString;
220
- updatedAt: z.ZodString;
221
- conversation: z.ZodObject<{
222
- conversationId: z.ZodString;
223
- title: z.ZodOptional<z.ZodString>;
224
- rootTitle: z.ZodOptional<z.ZodString>;
225
- }, z.core.$strict>;
226
- participants: z.ZodArray<z.ZodObject<{
227
- avatarUrl: z.ZodOptional<z.ZodString>;
228
- email: z.ZodOptional<z.ZodString>;
229
- fullName: z.ZodOptional<z.ZodString>;
230
- slackUserId: z.ZodOptional<z.ZodString>;
231
- slackUserName: z.ZodOptional<z.ZodString>;
232
- }, z.core.$strict>>;
233
- working: z.ZodBoolean;
234
- needsViewer: z.ZodBoolean;
235
- }, z.core.$strict>>;
236
- doneWindowHours: z.ZodNumber;
237
- }, z.core.$strict>;
238
- type BoardColumn = z.output<typeof boardColumnSchema>;
239
- type BoardCard = z.output<typeof boardCardSchema>;
240
- type BoardReport = z.output<typeof boardReportSchema>;
241
167
  declare const dailyConversationActivitySchema: z.ZodObject<{
242
168
  active: z.ZodNumber;
243
169
  conversations: z.ZodNumber;
@@ -304,6 +230,7 @@ declare const codeRepositorySummarySchema: z.ZodObject<{
304
230
  declare const codeChangeSummaryReportSchema: z.ZodObject<{
305
231
  closedAt: z.ZodOptional<z.ZodString>;
306
232
  id: z.ZodString;
233
+ lastActivityAt: z.ZodOptional<z.ZodString>;
307
234
  mergedAt: z.ZodOptional<z.ZodString>;
308
235
  number: z.ZodNumber;
309
236
  openedAt: z.ZodString;
@@ -339,6 +266,7 @@ declare const codeOverviewReportSchema: z.ZodObject<{
339
266
  changes: z.ZodArray<z.ZodObject<{
340
267
  closedAt: z.ZodOptional<z.ZodString>;
341
268
  id: z.ZodString;
269
+ lastActivityAt: z.ZodOptional<z.ZodString>;
342
270
  mergedAt: z.ZodOptional<z.ZodString>;
343
271
  number: z.ZodNumber;
344
272
  openedAt: z.ZodString;
@@ -404,6 +332,7 @@ declare const codeRepositoryReportSchema: z.ZodObject<{
404
332
  changes: z.ZodArray<z.ZodObject<{
405
333
  closedAt: z.ZodOptional<z.ZodString>;
406
334
  id: z.ZodString;
335
+ lastActivityAt: z.ZodOptional<z.ZodString>;
407
336
  mergedAt: z.ZodOptional<z.ZodString>;
408
337
  number: z.ZodNumber;
409
338
  openedAt: z.ZodString;
@@ -464,6 +393,7 @@ declare const codePersonReportSchema: z.ZodObject<{
464
393
  changes: z.ZodArray<z.ZodObject<{
465
394
  closedAt: z.ZodOptional<z.ZodString>;
466
395
  id: z.ZodString;
396
+ lastActivityAt: z.ZodOptional<z.ZodString>;
467
397
  mergedAt: z.ZodOptional<z.ZodString>;
468
398
  number: z.ZodNumber;
469
399
  openedAt: z.ZodString;
@@ -795,7 +725,6 @@ declare const conversationSummaryReportSchema: z.ZodObject<{
795
725
  archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
796
726
  pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
797
727
  pinPosition: z.ZodOptional<z.ZodNumber>;
798
- unread: z.ZodOptional<z.ZodBoolean>;
799
728
  channel: z.ZodOptional<z.ZodString>;
800
729
  channelName: z.ZodOptional<z.ZodString>;
801
730
  channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
@@ -1936,7 +1865,6 @@ declare const conversationDetailReportSchema: z.ZodObject<{
1936
1865
  archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1937
1866
  pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1938
1867
  pinPosition: z.ZodOptional<z.ZodNumber>;
1939
- unread: z.ZodOptional<z.ZodBoolean>;
1940
1868
  channel: z.ZodOptional<z.ZodString>;
1941
1869
  channelName: z.ZodOptional<z.ZodString>;
1942
1870
  channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
@@ -3042,7 +2970,6 @@ declare const conversationDetailWithMailboxReportSchema: z.ZodObject<{
3042
2970
  archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3043
2971
  pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3044
2972
  pinPosition: z.ZodOptional<z.ZodNumber>;
3045
- unread: z.ZodOptional<z.ZodBoolean>;
3046
2973
  channel: z.ZodOptional<z.ZodString>;
3047
2974
  channelName: z.ZodOptional<z.ZodString>;
3048
2975
  channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
@@ -4117,6 +4044,10 @@ declare const conversationMetricDaySchema: z.ZodObject<{
4117
4044
  date: z.ZodString;
4118
4045
  durationMs: z.ZodNumber;
4119
4046
  inputTokens: z.ZodOptional<z.ZodNumber>;
4047
+ mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
4048
+ mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
4049
+ outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
4050
+ outcomes: z.ZodOptional<z.ZodNumber>;
4120
4051
  tokens: z.ZodOptional<z.ZodNumber>;
4121
4052
  }, z.core.$strict>;
4122
4053
  declare const guardianMetricDaySchema: z.ZodObject<{
@@ -4205,6 +4136,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
4205
4136
  date: z.ZodString;
4206
4137
  durationMs: z.ZodNumber;
4207
4138
  inputTokens: z.ZodOptional<z.ZodNumber>;
4139
+ mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
4140
+ mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
4141
+ outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
4142
+ outcomes: z.ZodOptional<z.ZodNumber>;
4208
4143
  tokens: z.ZodOptional<z.ZodNumber>;
4209
4144
  }, z.core.$strict>>;
4210
4145
  metricHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -4215,6 +4150,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
4215
4150
  date: z.ZodString;
4216
4151
  durationMs: z.ZodNumber;
4217
4152
  inputTokens: z.ZodOptional<z.ZodNumber>;
4153
+ mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
4154
+ mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
4155
+ outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
4156
+ outcomes: z.ZodOptional<z.ZodNumber>;
4218
4157
  tokens: z.ZodOptional<z.ZodNumber>;
4219
4158
  }, z.core.$strict>>>;
4220
4159
  metricSixHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -4225,6 +4164,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
4225
4164
  date: z.ZodString;
4226
4165
  durationMs: z.ZodNumber;
4227
4166
  inputTokens: z.ZodOptional<z.ZodNumber>;
4167
+ mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
4168
+ mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
4169
+ outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
4170
+ outcomes: z.ZodOptional<z.ZodNumber>;
4228
4171
  tokens: z.ZodOptional<z.ZodNumber>;
4229
4172
  }, z.core.$strict>>>;
4230
4173
  locations: z.ZodArray<z.ZodObject<{
@@ -4294,23 +4237,12 @@ type ContinueConversationInSlackResponse = z.infer<typeof continueConversationIn
4294
4237
  *
4295
4238
  * `lastReadSeq` is the event sequence of the last transcript row the viewer
4296
4239
  * saw. Reports only move it forward: the server keeps the highest value it
4297
- * receives. Only Mark as unread moves it back. It is never before the
4298
- * viewer's own latest Message.
4240
+ * receives. It is never before the viewer's own latest Message.
4299
4241
  */
4300
4242
  declare const conversationReadPositionSchema: z.ZodObject<{
4301
4243
  lastReadSeq: z.ZodNumber;
4302
4244
  }, z.core.$strict>;
4303
4245
  type ConversationReadPosition = z.infer<typeof conversationReadPositionSchema>;
4304
- /**
4305
- * The reply to a read report: the stored read position and whether Junior's
4306
- * latest visible reply is still after it. The dashboard clears the unread
4307
- * flag from this, so it does not refetch the feed after each report.
4308
- */
4309
- declare const conversationReadReportSchema: z.ZodObject<{
4310
- lastReadSeq: z.ZodNumber;
4311
- unreadReply: z.ZodBoolean;
4312
- }, z.core.$strict>;
4313
- type ConversationReadReport = z.infer<typeof conversationReadReportSchema>;
4314
4246
  /**
4315
4247
  * The unread rows to summarize: every event after `afterSeq`, through
4316
4248
  * `throughSeq`. The dashboard sends the range from when the Conversation
@@ -4375,19 +4307,6 @@ declare const conversationSubscriptionResponseSchema: z.ZodObject<{
4375
4307
  }, z.core.$strict>;
4376
4308
  type ConversationSubscriptionBody = z.infer<typeof conversationSubscriptionBodySchema>;
4377
4309
  type ConversationSubscriptionResponse = z.infer<typeof conversationSubscriptionResponseSchema>;
4378
- /** Mark one Conversation read or unread for the signed-in viewer. */
4379
- declare const markConversationUnreadBodySchema: z.ZodObject<{
4380
- unread: z.ZodBoolean;
4381
- }, z.core.$strict>;
4382
- type MarkConversationUnreadBody = z.infer<typeof markConversationUnreadBodySchema>;
4383
- /**
4384
- * Whether Junior's latest visible reply is after the viewer's read position
4385
- * once the change is stored.
4386
- */
4387
- declare const conversationUnreadSchema: z.ZodObject<{
4388
- unreadReply: z.ZodBoolean;
4389
- }, z.core.$strict>;
4390
- type ConversationUnread = z.infer<typeof conversationUnreadSchema>;
4391
4310
  /**
4392
4311
  * Longest outline item text. The outline previews each message, so the
4393
4312
  * server cuts the text and does not send whole messages.
@@ -4934,7 +4853,6 @@ declare const actorProfileReportSchema: z.ZodObject<{
4934
4853
  archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4935
4854
  pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4936
4855
  pinPosition: z.ZodOptional<z.ZodNumber>;
4937
- unread: z.ZodOptional<z.ZodBoolean>;
4938
4856
  channel: z.ZodOptional<z.ZodString>;
4939
4857
  channelName: z.ZodOptional<z.ZodString>;
4940
4858
  channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
@@ -5370,7 +5288,6 @@ declare const locationDetailReportSchema: z.ZodObject<{
5370
5288
  archivedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5371
5289
  pinnedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5372
5290
  pinPosition: z.ZodOptional<z.ZodNumber>;
5373
- unread: z.ZodOptional<z.ZodBoolean>;
5374
5291
  channel: z.ZodOptional<z.ZodString>;
5375
5292
  channelName: z.ZodOptional<z.ZodString>;
5376
5293
  channelNameRedacted: z.ZodOptional<z.ZodBoolean>;
@@ -7851,4 +7768,4 @@ declare const versionsSchema: z.ZodObject<{
7851
7768
  spend: z.ZodString;
7852
7769
  }, z.core.$strict>;
7853
7770
  type Versions = z.output<typeof versionsSchema>;
7854
- export { AutomationVersionList as $, CodeOverviewReport as $i, ConversationSubscriptionResponse as $n, conversationDetailWithMailboxReportSchema as $r, isWithinNotificationSchedule as $t, runtimeInfoReportSchema as A, normalizeUserInputAnswer as Aa, CreateConversationBody as Ai, personParamsSchema as An, ConversationStatsReport as Ar, workspaceListSchema as At, replyTimeSegmentsReportSchema as B, conversationFeedQuerySchema as Bi, CONVERSATION_TITLE_MAX_LENGTH as Bn, conversationAutoArchiveSchema as Br, personalTokenMetadataSchema as Bt, healthReportSchema as C, AutomationCard as Ca, ConversationReportStatus as Ci, ActorTotalsReport as Cn, ContinueConversationInSlackResponse as Cr, scheduledAutomationSummarySchema as Ct, pluginPackageContentReportSchema as D, UserInputRequest as Da, ConversationTurnFailureCode as Di, PersonalSpendReport as Dn, stopConversationTurnResponseSchema as Dr, baselineSnapshotSchema as Dt, pluginPackageContentItemReportSchema as E, UserInputField as Ea, ConversationSurface as Ei, PersonParams as En, StopConversationTurnResponse as Er, WorkspaceReport as Et, StatsReport as F, MAX_INPUT_IMAGE_BYTES as Fa, conversationDetailQuerySchema as Fi, conversationWatchesReportSchema as Fn, ArchiveConversationResponse as Fr, userCustomizationSchema as Ft, AutomationList as G, createConversationBodySchema as Gi, CONVERSATION_OUTLINE_TEXT_LENGTH as Gn, CancelConversationPendingMessagesResponse as Gr, serviceAccountParamsSchema as Gt, AutomationExecution as H, conversationReportEventDataSchema as Hi, RenameConversationResponse as Hn, ConversationFeedItem as Hr, revokePersonalTokenResponseSchema as Ht, statSchema as I, MessageAttachment as Ia, conversationDetailReportSchema as Ii, ConversationChildAgent as In, ConversationAutoArchive as Ir, PersonalTokenMetadata as It, AutomationRunList as J, forkConversationResponseSchema as Ji, ConversationUnread as Jn, ConversationPendingMessagesReport as Jr, NotificationSettings as Jt, AutomationListQuery as K, createConversationMessageBodySchema as Ki, ConversationOutline as Kn, ConversationPendingMessage as Kr, serviceAccountSchema as Kt, statsReportSchema as L, INLINE_VIDEO_TYPES as La, conversationEventHistorySchema as Li, ConversationChildAgentsReport as Ln, archiveConversationBodySchema as Lr, createPersonalTokenBodySchema as Lt, skillReportSchema as M, isAgentInvocationResultEventType as Ma, acceptedConversationMessageSchema as Mi, ConversationWatch as Mn, GuardianStats as Mr, workspaceRepoSchema as Mt, skillReportsSchema as N, InputImage as Na, conversationActivityPreviewSchema as Ni, ConversationWatchesReport as Nn, conversationStatsReportSchema as Nr, workspaceSchema as Nt, pluginSchema as O, buttonUserInputField as Oa, ConversationTurnFailureReason as Oi, actorDirectoryReportSchema as On, ConversationMetricDay as Or, deleteWorkspaceResponseSchema as Ot, StatReport as P, MAX_INPUT_IMAGES as Pa, conversationAuxiliaryCostsSchema as Pi, conversationWatchSchema as Pn, ArchiveConversationBody as Pr, USER_CUSTOMIZATION_MAX_CHARS as Pt, AutomationUpdate as Q, CodeChangeSummaryReport as Qi, ConversationSubscriptionBody as Qn, cancelConversationPendingMessagesResponseSchema as Qr, NotificationSchedule as Qt, ReplyTimeHistogram as R, INPUT_IMAGE_TYPES as Ra, conversationEventPageSchema as Ri, conversationChildAgentSchema as Rn, archiveConversationResponseSchema as Rr, createdPersonalTokenSchema as Rt, SkillReports as S, AutomationTask as Sa, ConversationReportMessageEvent as Si, ActorSummaryReport as Sn, ContinueConversationInSlackBody as Sr, eventAutomationSummarySchema as St, pluginOperationalReportSchema as T, UserInputAnswer as Ta, ConversationSummaryReport as Ti, PeopleActivityDayReport as Tn, continueConversationInSlackResponseSchema as Tr, WorkspaceListReport as Tt, AutomationExecutionList as U, conversationReportEventSchema as Ui, renameConversationBodySchema as Un, conversationFeedSchema as Ur, disconnectServiceAccountResponseSchema as Ut, AutomationEdit as V, conversationParamsSchema as Vi, RenameConversationBody as Vn, ConversationFeed as Vr, personalTokenParamsSchema as Vt, AutomationExecutionStatusDay as W, conversationSummaryReportSchema as Wi, renameConversationResponseSchema as Wn, CancelConversationPendingMessagesBody as Wr, serviceAccountListSchema as Wt, AutomationScheduleIntent as X, conversationTurnFailureReasonSchema as Xi, conversationUnreadSchema as Xn, SteerConversationPendingMessagesResponse as Xr, testNotificationResponseSchema as Xt, AutomationRunWindows as Y, conversationTurnFailureCodeSchema as Yi, MarkConversationUnreadBody as Yn, SteerConversationPendingMessagesBody as Yr, notificationSettingsSchema as Yt, AutomationSummary as Z, CodeActivityDay as Zi, markConversationUnreadBodySchema as Zn, cancelConversationPendingMessagesBodySchema as Zr, DEFAULT_NOTIFICATION_SCHEDULE as Zt, PluginPackageContentReport as _, BoardReport as _a, ConversationEventPage as _i, locationParamsSchema as _n, conversationCatchUpSchema as _r, automationUpdateSchema as _t, ReviewItemPayload as a, codeChangeSummarySchema as aa, steerConversationPendingMessagesBodySchema as ai, startConnectionResponseSchema as an, conversationDeliveryResponseSchema as ar, automationExecutionSchema as at, SkillDetailReport as b, messageCardText as ba, ConversationReportEvent as bi, ActorDirectoryWindows as bn, conversationReadPositionSchema as br, automationVersionParamsSchema as bt, reviewItemListSchema as c, codeRepositoryParamsSchema as ca, ActorIdentity as ci, LocationActivityDayReport as cn, ReorderPinnedConversationsBody as cr, automationListQuerySchema as ct, ReviewItemChangeRecord as d, ConversationChildAgentTotals as da, ConversationActivityPreview as di, LocationDirectoryReport as dn, pinConversationResponseSchema as dr, automationRunListSchema as dt, CodePersonReport as ea, conversationPendingAuthorizationSchema as ei, notificationScheduleSchema as en, conversationSubscriptionBodySchema as er, ListedAutomationVersion as et, HealthReport as f, conversationChildAgentTotalsSchema as fa, ConversationAgentTreeNode as fi, LocationParams as fn, reorderPinnedConversationsBodySchema as fr, automationRunSchema as ft, PluginPackageContentItemReport as g, BoardColumn as ga, ConversationEventHistory as gi, locationDirectoryReportSchema as gn, conversationCatchUpBodySchema as gr, automationSummarySchema as gt, PluginOperationalReportFeed as h, BoardCard as ha, ConversationDetailReport as hi, locationDetailReportSchema as hn, ConversationCatchUpBody as hr, automationSchedulePreviewSchema as ht, ReviewItemActionBody as i, codeChangeSummaryReportSchema as ia, conversationUnchangedDetailWithMailboxSchema as ii, disconnectConnectionResponseSchema as in, conversationDeliveryBodySchema as ir, automationExecutionListSchema as it, skillDetailReportSchema as j, webMessageId as ja, CreateConversationMessageBody as ji, personalSpendReportSchema as jn, GuardianMetricDay as jr, workspaceParamsSchema as jt, pluginsSchema as k, isEmptyUserInputAnswer as ka, ConversationUsage as ki, actorProfileReportSchema as kn, ConversationStatsItem as kr, workspaceBodySchema as kt, reviewItemSchema as l, codeRepositoryReportSchema as la, CONVERSATION_DETAIL_VERSION_HEADER as li, LocationActorSummaryReport as ln, ReorderPinnedConversationsResponse as lr, automationListSchema as lt, PluginOperationalReport as m, dailyConversationActivitySchema as ma, ConversationCost as mi, locationActivityDayReportSchema as mn, ConversationCatchUp as mr, automationScheduleIntentSchema as mt, Versions as n, CodeRepositorySummary as na, conversationPendingMessageSchema as ni, connectionParamsSchema as nn, ConversationDeliveryBody as nr, automationEditSchema as nt, reviewItemActionSchema as o, codeOverviewReportSchema as oa, steerConversationPendingMessagesResponseSchema as oi, ApiError as on, PinConversationBody as or, automationExecutionStatusDaySchema as ot, Plugin as p, DailyConversationActivity as pa, ConversationAuxiliaryCosts as pi, LocationSummaryReport as pn, reorderPinnedConversationsResponseSchema as pr, automationRunWindowsSchema as pt, AutomationRun as q, forkConversationBodySchema as qi, conversationOutlineSchema as qn, ConversationPendingMessageDelivery as qr, startServiceAccountSignInResponseSchema as qt, versionsSchema as r, codeActivityDaySchema as ra, conversationPendingMessagesReportSchema as ri, connectionSchema as rn, ConversationDeliveryResponse as rr, automationEventCatalogSchema as rt, reviewItemCountSchema as s, codePersonReportSchema as sa, AcceptedConversationMessage as si, apiErrorSchema as sn, PinConversationResponse as sr, automationExecutionStatusSchema as st, OwnedObjectAnnotation$1 as t, CodeRepositoryReport as ta, conversationPendingMessageDeliverySchema as ti, connectionListSchema as tn, conversationSubscriptionResponseSchema as tr, automationEditErrorSchema as tt, reviewItemWaitingConversationsSchema as u, codeRepositorySummarySchema as ua, CONVERSATION_VERSION_HEADER as ui, LocationDetailReport as un, pinConversationBodySchema as ur, automationParamsSchema as ut, Plugins as v, boardReportSchema as va, ConversationModelUsage as vi, ActorActivityDayReport as vn, ConversationReadPosition as vr, automationVersionActivateSchema as vt, pluginOperationalReportFeedSchema as w, USER_INPUT_NOTE as wa, ConversationSourceTask as wi, ActorWindowMetrics as wn, continueConversationInSlackBodySchema as wr, BaselineSnapshotReport as wt, SkillReport as x, resolveMessageCards as xa, ConversationReportEventData as xi, ActorProfileReport as xn, conversationReadReportSchema as xr, automationVersionSchema as xt, RuntimeInfoReport as y, MessageCard as ya, ConversationParams as yi, ActorDirectoryReport as yn, ConversationReadReport as yr, automationVersionListSchema as yt, ReplyTimeSegmentsReport as z, conversationEventsQuerySchema as zi, conversationChildAgentsReportSchema as zn, archiveDoneConversationsResponseSchema as zr, personalTokenListSchema as zt };
7771
+ export { AutomationVersionList as $, codeChangeSummarySchema as $i, ConversationDeliveryResponse as $n, steerConversationPendingMessagesBodySchema as $r, isWithinNotificationSchedule as $t, runtimeInfoReportSchema as A, conversationDetailReportSchema as Ai, personParamsSchema as An, ConversationAutoArchive as Ar, workspaceListSchema as At, replyTimeSegmentsReportSchema as B, createConversationMessageBodySchema as Bi, CONVERSATION_TITLE_MAX_LENGTH as Bn, ConversationPendingMessage as Br, personalTokenMetadataSchema as Bt, healthReportSchema as C, isAgentInvocationResultEventType as Ca, ConversationUsage as Ci, ActorTotalsReport as Cn, ConversationStatsItem as Cr, scheduledAutomationSummarySchema as Ct, pluginPackageContentReportSchema as D, MessageAttachment as Da, conversationActivityPreviewSchema as Di, PersonalSpendReport as Dn, conversationStatsReportSchema as Dr, baselineSnapshotSchema as Dt, pluginPackageContentItemReportSchema as E, MAX_INPUT_IMAGE_BYTES as Ea, acceptedConversationMessageSchema as Ei, PersonParams as En, GuardianStats as Er, WorkspaceReport as Et, StatsReport as F, conversationParamsSchema as Fi, conversationWatchesReportSchema as Fn, ConversationFeed as Fr, userCustomizationSchema as Ft, AutomationList as G, CodeActivityDay as Gi, CONVERSATION_OUTLINE_TEXT_LENGTH as Gn, cancelConversationPendingMessagesBodySchema as Gr, serviceAccountParamsSchema as Gt, AutomationExecution as H, forkConversationResponseSchema as Hi, RenameConversationResponse as Hn, ConversationPendingMessagesReport as Hr, revokePersonalTokenResponseSchema as Ht, statSchema as I, conversationReportEventDataSchema as Ii, ConversationChildAgent as In, ConversationFeedItem as Ir, PersonalTokenMetadata as It, AutomationRunList as J, CodePersonReport as Ji, ConversationSubscriptionBody as Jn, conversationPendingAuthorizationSchema as Jr, NotificationSettings as Jt, AutomationListQuery as K, CodeChangeSummaryReport as Ki, ConversationOutline as Kn, cancelConversationPendingMessagesResponseSchema as Kr, serviceAccountSchema as Kt, statsReportSchema as L, conversationReportEventSchema as Li, ConversationChildAgentsReport as Ln, conversationFeedSchema as Lr, createPersonalTokenBodySchema as Lt, skillReportSchema as M, conversationEventPageSchema as Mi, ConversationWatch as Mn, archiveConversationResponseSchema as Mr, workspaceRepoSchema as Mt, skillReportsSchema as N, conversationEventsQuerySchema as Ni, ConversationWatchesReport as Nn, archiveDoneConversationsResponseSchema as Nr, workspaceSchema as Nt, pluginSchema as O, INLINE_VIDEO_TYPES as Oa, conversationAuxiliaryCostsSchema as Oi, actorDirectoryReportSchema as On, ArchiveConversationBody as Or, deleteWorkspaceResponseSchema as Ot, StatReport as P, conversationFeedQuerySchema as Pi, conversationWatchSchema as Pn, conversationAutoArchiveSchema as Pr, USER_CUSTOMIZATION_MAX_CHARS as Pt, AutomationUpdate as Q, codeChangeSummaryReportSchema as Qi, ConversationDeliveryBody as Qn, conversationUnchangedDetailWithMailboxSchema as Qr, NotificationSchedule as Qt, ReplyTimeHistogram as R, conversationSummaryReportSchema as Ri, conversationChildAgentSchema as Rn, CancelConversationPendingMessagesBody as Rr, createdPersonalTokenSchema as Rt, SkillReports as S, AGENT_REPLY_EVENT_TYPE as Sa, ConversationTurnFailureReason as Si, ActorSummaryReport as Sn, ConversationMetricDay as Sr, eventAutomationSummarySchema as St, pluginOperationalReportSchema as T, MAX_INPUT_IMAGES as Ta, CreateConversationMessageBody as Ti, PeopleActivityDayReport as Tn, GuardianMetricDay as Tr, WorkspaceListReport as Tt, AutomationExecutionList as U, conversationTurnFailureCodeSchema as Ui, renameConversationBodySchema as Un, SteerConversationPendingMessagesBody as Ur, disconnectServiceAccountResponseSchema as Ut, AutomationEdit as V, forkConversationBodySchema as Vi, RenameConversationBody as Vn, ConversationPendingMessageDelivery as Vr, personalTokenParamsSchema as Vt, AutomationExecutionStatusDay as W, conversationTurnFailureReasonSchema as Wi, renameConversationResponseSchema as Wn, SteerConversationPendingMessagesResponse as Wr, serviceAccountListSchema as Wt, AutomationScheduleIntent as X, CodeRepositorySummary as Xi, conversationSubscriptionBodySchema as Xn, conversationPendingMessageSchema as Xr, testNotificationResponseSchema as Xt, AutomationRunWindows as Y, CodeRepositoryReport as Yi, ConversationSubscriptionResponse as Yn, conversationPendingMessageDeliverySchema as Yr, notificationSettingsSchema as Yt, AutomationSummary as Z, codeActivityDaySchema as Zi, conversationSubscriptionResponseSchema as Zn, conversationPendingMessagesReportSchema as Zr, DEFAULT_NOTIFICATION_SCHEDULE as Zt, PluginPackageContentReport as _, UserInputRequest as _a, ConversationReportStatus as _i, locationParamsSchema as _n, ContinueConversationInSlackResponse as _r, automationUpdateSchema as _t, ReviewItemPayload as a, ConversationChildAgentTotals as aa, ConversationActivityPreview as ai, startConnectionResponseSchema as an, ReorderPinnedConversationsResponse as ar, automationExecutionSchema as at, SkillDetailReport as b, normalizeUserInputAnswer as ba, ConversationSurface as bi, ActorDirectoryWindows as bn, StopConversationTurnResponse as br, automationVersionParamsSchema as bt, reviewItemListSchema as c, dailyConversationActivitySchema as ca, ConversationCost as ci, LocationActivityDayReport as cn, reorderPinnedConversationsBodySchema as cr, automationListQuerySchema as ct, ReviewItemChangeRecord as d, resolveMessageCards as da, ConversationEventPage as di, LocationDirectoryReport as dn, ConversationCatchUpBody as dr, automationRunListSchema as dt, codeOverviewReportSchema as ea, steerConversationPendingMessagesResponseSchema as ei, notificationScheduleSchema as en, conversationDeliveryBodySchema as er, ListedAutomationVersion as et, HealthReport as f, AutomationTask as fa, ConversationModelUsage as fi, LocationParams as fn, conversationCatchUpBodySchema as fr, automationRunSchema as ft, PluginPackageContentItemReport as g, UserInputField as ga, ConversationReportMessageEvent as gi, locationDirectoryReportSchema as gn, ContinueConversationInSlackBody as gr, automationSummarySchema as gt, PluginOperationalReportFeed as h, UserInputAnswer as ha, ConversationReportEventData as hi, locationDetailReportSchema as hn, conversationReadPositionSchema as hr, automationSchedulePreviewSchema as ht, ReviewItemActionBody as i, codeRepositorySummarySchema as ia, CONVERSATION_VERSION_HEADER as ii, disconnectConnectionResponseSchema as in, ReorderPinnedConversationsBody as ir, automationExecutionListSchema as it, skillDetailReportSchema as j, conversationEventHistorySchema as ji, personalSpendReportSchema as jn, archiveConversationBodySchema as jr, workspaceParamsSchema as jt, pluginsSchema as k, INPUT_IMAGE_TYPES as ka, conversationDetailQuerySchema as ki, actorProfileReportSchema as kn, ArchiveConversationResponse as kr, workspaceBodySchema as kt, reviewItemSchema as l, MessageCard as la, ConversationDetailReport as li, LocationActorSummaryReport as ln, reorderPinnedConversationsResponseSchema as lr, automationListSchema as lt, PluginOperationalReport as m, USER_INPUT_NOTE as ma, ConversationReportEvent as mi, locationActivityDayReportSchema as mn, ConversationReadPosition as mr, automationScheduleIntentSchema as mt, Versions as n, codeRepositoryParamsSchema as na, ActorIdentity as ni, connectionParamsSchema as nn, PinConversationBody as nr, automationEditSchema as nt, reviewItemActionSchema as o, conversationChildAgentTotalsSchema as oa, ConversationAgentTreeNode as oi, ApiError as on, pinConversationBodySchema as or, automationExecutionStatusDaySchema as ot, Plugin as p, AutomationCard as pa, ConversationParams as pi, LocationSummaryReport as pn, conversationCatchUpSchema as pr, automationRunWindowsSchema as pt, AutomationRun as q, CodeOverviewReport as qi, conversationOutlineSchema as qn, conversationDetailWithMailboxReportSchema as qr, startServiceAccountSignInResponseSchema as qt, versionsSchema as r, codeRepositoryReportSchema as ra, CONVERSATION_DETAIL_VERSION_HEADER as ri, connectionSchema as rn, PinConversationResponse as rr, automationEventCatalogSchema as rt, reviewItemCountSchema as s, DailyConversationActivity as sa, ConversationAuxiliaryCosts as si, apiErrorSchema as sn, pinConversationResponseSchema as sr, automationExecutionStatusSchema as st, OwnedObjectAnnotation$1 as t, codePersonReportSchema as ta, AcceptedConversationMessage as ti, connectionListSchema as tn, conversationDeliveryResponseSchema as tr, automationEditErrorSchema as tt, reviewItemWaitingConversationsSchema as u, messageCardText as ua, ConversationEventHistory as ui, LocationDetailReport as un, ConversationCatchUp as ur, automationParamsSchema as ut, Plugins as v, buttonUserInputField as va, ConversationSourceTask as vi, ActorActivityDayReport as vn, continueConversationInSlackBodySchema as vr, automationVersionActivateSchema as vt, pluginOperationalReportFeedSchema as w, InputImage as wa, CreateConversationBody as wi, ActorWindowMetrics as wn, ConversationStatsReport as wr, BaselineSnapshotReport as wt, SkillReport as x, webMessageId as xa, ConversationTurnFailureCode as xi, ActorProfileReport as xn, stopConversationTurnResponseSchema as xr, automationVersionSchema as xt, RuntimeInfoReport as y, isEmptyUserInputAnswer as ya, ConversationSummaryReport as yi, ActorDirectoryReport as yn, continueConversationInSlackResponseSchema as yr, automationVersionListSchema as yt, ReplyTimeSegmentsReport as z, createConversationBodySchema as zi, conversationChildAgentsReportSchema as zn, CancelConversationPendingMessagesResponse as zr, personalTokenListSchema as zt };
@@ -1,7 +1,7 @@
1
- import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-9OAq-fdg.js";
2
- import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-cbpOxO4M.js";
1
+ import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CQjlDQYX.js";
2
+ import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-BDWgCJDf.js";
3
3
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
4
- import { a as getStateAdapter, n as readEncryptedState, t as createEncryptedState } from "./state-CO9ETDzk.js";
4
+ import { a as getStateAdapter, n as readEncryptedState, t as createEncryptedState } from "./state-DFnmLmfn.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DgouZKZm.js";
2
- import { r as disconnectStateAdapter } from "./state-CO9ETDzk.js";
3
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-DjPIwCMj.js";
1
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-0kuQqYL4.js";
2
+ import { r as disconnectStateAdapter } from "./state-DFnmLmfn.js";
3
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-C9kRQEb_.js";
4
4
  import { CLI_USAGE } from "./cli/run.js";
5
5
  import { createServer } from "node:http";
6
6
  // src/cli/service-account.ts
@@ -0,0 +1,181 @@
1
+ import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
+ import { M as normalizeConversationText, ti as cancelSubscriptions, x as toStoredConversationMessage } from "./projection-B08mfi0u.js";
3
+ import { et as nextDetailVersion, r as getConversationEventStore, s as getSqlExecutor, w as isPersonInput } from "./db-Br0tfAo7.js";
4
+ import { A as juniorConversations } from "./executor-BMPipFVA.js";
5
+ import { _ as getEventBatchDelayMs, s as instructionForInputs, t as eventReviewItemInputs } from "./prompt-input-Dxn8cDC0.js";
6
+ import { a as renderEventBatchInputs, i as isEventMailboxMetadata, r as eventBatchMessageMeta } from "./notification-gusCgdQ6.js";
7
+ import { and, eq, inArray, isNull, lt, lte, or, sql } from "drizzle-orm";
8
+ // src/chat/conversations/sql/subtree.ts
9
+ /** Columns of the `conversation_subtree` table that `conversationSubtree` returns. */
10
+ const conversationSubtreeColumns = {
11
+ conversationId: sql`conversation_subtree.conversation_id`,
12
+ scopeConversationId: sql`conversation_subtree.scope_conversation_id`
13
+ };
14
+ /**
15
+ * Return a joinable `conversation_subtree` table. It maps each selected
16
+ * Conversation to itself and to each descendant child Conversation at any
17
+ * depth. Reports use it so that a total for a Conversation always includes the
18
+ * work of all its child agents.
19
+ *
20
+ * A descendant must have the same root as the selected Conversation. Thus a
21
+ * Conversation that has no valid root gets only its own work.
22
+ */
23
+ function conversationSubtree(conversationIds) {
24
+ const selectedIds = sql.join(conversationIds.map((conversationId) => sql`${conversationId}`), sql`, `);
25
+ return sql`(
26
+ with recursive tree(scope_conversation_id, conversation_id, root_conversation_id) as (
27
+ select selected.conversation_id, selected.conversation_id, selected.root_conversation_id
28
+ from junior_conversations selected
29
+ where selected.conversation_id in (${selectedIds})
30
+ union
31
+ select tree.scope_conversation_id, child.conversation_id, child.root_conversation_id
32
+ from junior_conversations child
33
+ join tree
34
+ on child.parent_conversation_id = tree.conversation_id
35
+ and (child.root_conversation_id || '') = tree.root_conversation_id
36
+ )
37
+ select scope_conversation_id, conversation_id from tree
38
+ ) conversation_subtree`;
39
+ }
40
+ // src/chat/conversations/session-stop.ts
41
+ var session_stop_exports = /* @__PURE__ */ __exportAll({
42
+ getConversationStoppedAtMs: () => getConversationStoppedAtMs,
43
+ isSkippedAfterConversationStop: () => isSkippedAfterConversationStop,
44
+ isWatchEvent: () => isWatchEvent,
45
+ markConversationsStopped: () => markConversationsStopped,
46
+ resumeStoppedConversationTree: () => resumeStoppedConversationTree,
47
+ skipInputAfterConversationStop: () => skipInputAfterConversationStop
48
+ });
49
+ /** Skip reason on the Message that saves Events for a stopped Conversation. */
50
+ const STOPPED_CONVERSATION_SKIP_REASON = "stopped conversation";
51
+ /**
52
+ * Stop each Conversation until a person sends it input or its parent gives
53
+ * it new work. With `cancelWatches`, an agent stopped them, so their Watches
54
+ * end first: a Watch delivers under its lock, so every Event of a cancelled
55
+ * Watch was received before the stop. A Conversation that already stopped
56
+ * later keeps that stop, so a retried or cascaded stop does not move it back.
57
+ */
58
+ async function markConversationsStopped(conversationIds, options) {
59
+ if (conversationIds.length === 0) return;
60
+ if (options.cancelWatches) for (const conversationId of conversationIds) await cancelSubscriptions({
61
+ conversationId,
62
+ state: options.state
63
+ });
64
+ const stoppedAt = new Date(options.nowMs ?? Date.now());
65
+ await getSqlExecutor().db().update(juniorConversations).set({
66
+ stoppedAt,
67
+ detailVersion: nextDetailVersion
68
+ }).where(and(inArray(juniorConversations.conversationId, [...conversationIds]), or(isNull(juniorConversations.stoppedAt), lt(juniorConversations.stoppedAt, stoppedAt))));
69
+ }
70
+ /** Return when a Conversation stopped, or undefined when it is not stopped. */
71
+ async function getConversationStoppedAtMs(conversationId) {
72
+ const [row] = await getSqlExecutor().db().select({ stoppedAt: juniorConversations.stoppedAt }).from(juniorConversations).where(eq(juniorConversations.conversationId, conversationId)).limit(1);
73
+ return row?.stoppedAt?.getTime();
74
+ }
75
+ /**
76
+ * End the stop of a Conversation and of the child agents below it, for new
77
+ * work sent at `sentAtMs`. Nothing changes for work sent at or before the
78
+ * stop, so the input that a stop drops does not undo it.
79
+ * Only Conversations that stopped no later than this Conversation change, so
80
+ * a later stop of one child agent stays in effect.
81
+ */
82
+ async function resumeStoppedConversationTree(conversationId, sentAtMs) {
83
+ const stoppedAtMs = await getConversationStoppedAtMs(conversationId);
84
+ if (stoppedAtMs === void 0 || sentAtMs <= stoppedAtMs) return;
85
+ await getSqlExecutor().db().update(juniorConversations).set({
86
+ stoppedAt: null,
87
+ detailVersion: nextDetailVersion
88
+ }).where(and(inArray(juniorConversations.conversationId, sql`(select ${conversationSubtreeColumns.conversationId} from ${conversationSubtree([conversationId])})`), lte(juniorConversations.stoppedAt, new Date(stoppedAtMs))));
89
+ }
90
+ /**
91
+ * Apply a session stop to automated input. Input from a person always runs.
92
+ * When a person sent it after the stop, the Conversation and its child agents
93
+ * stop no more. Input from a parent tool call also runs. While the
94
+ * Conversation is stopped, its Watch Events are saved as one Message and
95
+ * start no Turn, and other Events received at or before the stop are
96
+ * dropped. Returns the work to run, with only the Events that are left, or
97
+ * the finished result when nothing is left.
98
+ */
99
+ async function skipInputAfterConversationStop(context) {
100
+ const messages = context.attempt.messages;
101
+ const personInput = messages.filter((message) => isPersonInput(message.source));
102
+ if (personInput.length > 0) {
103
+ await resumeStoppedConversationTree(context.conversationId, Math.max(...personInput.map((message) => message.createdAtMs)));
104
+ return { context };
105
+ }
106
+ if (messages.length === 0 || !messages.every(isEventInput)) return { context };
107
+ const stoppedAtMs = await getConversationStoppedAtMs(context.conversationId);
108
+ if (stoppedAtMs === void 0) return { context };
109
+ const saved = messages.filter(isWatchEvent);
110
+ const live = messages.filter((message) => !isSkippedAfterConversationStop(message, stoppedAtMs));
111
+ if (live.length > 0 && saved.length > 0) {
112
+ const delayMs = Math.max(getEventBatchDelayMs(messages), getEventBatchDelayMs(live));
113
+ if (delayMs > 0) return { skipped: {
114
+ status: "deferred",
115
+ delayMs
116
+ } };
117
+ }
118
+ if (saved.length > 0) await saveStoppedConversationEvents(context.conversationId, saved);
119
+ if (live.length === messages.length) return { context };
120
+ if (live.length > 0) return { context: {
121
+ ...context,
122
+ attempt: {
123
+ ...context.attempt,
124
+ messages: live
125
+ }
126
+ } };
127
+ await context.attempt.ack();
128
+ return { skipped: { status: "completed" } };
129
+ }
130
+ /**
131
+ * Return whether a session stop at `stoppedAtMs` keeps one Event from
132
+ * starting a Turn: a Watch Event is saved, and another Event received at or
133
+ * before the stop is dropped. Input from a person is never skipped.
134
+ */
135
+ function isSkippedAfterConversationStop(message, stoppedAtMs) {
136
+ return stoppedAtMs !== void 0 && isEventInput(message) && (isWatchEvent(message) || message.receivedAtMs <= stoppedAtMs);
137
+ }
138
+ function isEventInput(message) {
139
+ return message.source === "event" && isEventMailboxMetadata(message.input.metadata);
140
+ }
141
+ /** Return whether a Watch delivered this input. Agent input has none. */
142
+ function isWatchEvent(message) {
143
+ const metadata = message.input.metadata;
144
+ return isEventMailboxMetadata(metadata) && metadata.event.subscriptionId !== void 0;
145
+ }
146
+ /**
147
+ * Save Events as the one Message that a Turn would save for them. The append
148
+ * is idempotent by Message id, so a retried batch saves nothing new. The
149
+ * Message takes the id of the first saved Event, so when an ack is lost and
150
+ * the retry carries more Events to save, the extra Events are deduplicated
151
+ * away.
152
+ */
153
+ async function saveStoppedConversationEvents(conversationId, messages) {
154
+ const first = messages[0];
155
+ const { text } = instructionForInputs(renderEventBatchInputs(messages, await eventReviewItemInputs(messages)).map((input) => ({
156
+ kind: "runtime",
157
+ text: input
158
+ })));
159
+ const stored = toStoredConversationMessage({
160
+ id: first.inboundMessageId,
161
+ role: "user",
162
+ text: normalizeConversationText(text),
163
+ createdAtMs: first.createdAtMs,
164
+ ...first.input.authorIdentityId ? { authorIdentityId: first.input.authorIdentityId } : void 0,
165
+ meta: {
166
+ replied: false,
167
+ skippedReason: STOPPED_CONVERSATION_SKIP_REASON,
168
+ ...eventBatchMessageMeta(messages)
169
+ }
170
+ });
171
+ const { createdAtMs, ...data } = stored;
172
+ await getConversationEventStore().append(conversationId, [{
173
+ idempotencyKey: `message:${stored.messageId}`,
174
+ createdAtMs,
175
+ data: {
176
+ type: "message",
177
+ ...data
178
+ }
179
+ }]);
180
+ }
181
+ export { session_stop_exports as a, conversationSubtreeColumns as c, resumeStoppedConversationTree as i, isSkippedAfterConversationStop as n, skipInputAfterConversationStop as o, markConversationsStopped as r, conversationSubtree as s, getConversationStoppedAtMs as t };
@@ -1,7 +1,7 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { h as logWarn } from "./logging-9OAq-fdg.js";
2
+ import { h as logWarn } from "./logging-CQjlDQYX.js";
3
3
  import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DgouZKZm.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-0kuQqYL4.js";
5
5
  import path from "node:path";
6
6
  import * as z from "zod";
7
7
  import fs from "node:fs/promises";
@@ -265,7 +265,7 @@ function isCommonEnvironmentVariable(name) {
265
265
  function parseSkillInvocation(messageText, availableSkills) {
266
266
  const trimmed = messageText.trim();
267
267
  const escapePattern = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
268
- for (const match of trimmed.matchAll(/(?:^|\s)\$([a-z0-9]+(?:-[a-z0-9]+)*)/gi)) {
268
+ for (const match of trimmed.matchAll(/(?<![\w$])\$([a-z0-9]+(?:-[a-z0-9]+)*)/gi)) {
269
269
  const skillName = match[1]?.toLowerCase();
270
270
  if (!skillName) continue;
271
271
  if (isCommonEnvironmentVariable(skillName)) continue;