@sentry/junior 0.154.0 → 0.156.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 (96) hide show
  1. package/dist/{agent-hooks-VEHV2QUA.js → agent-hooks-CCAR46PQ.js} +11 -12
  2. package/dist/api/conversations/list.d.ts +5 -3
  3. package/dist/api/conversations/membership.d.ts +16 -0
  4. package/dist/api/locations/detail.d.ts +2 -0
  5. package/dist/api/schema/conversation.d.ts +22 -4
  6. package/dist/api/schema/location.d.ts +2 -0
  7. package/dist/api/schema/person.d.ts +2 -0
  8. package/dist/api/schema.js +1 -1
  9. package/dist/api.js +331 -188
  10. package/dist/app.js +154 -51
  11. package/dist/catalog-runtime-3SNKYCBG.js +16 -0
  12. package/dist/chat/agent/types.d.ts +2 -0
  13. package/dist/chat/attachments/storage.d.ts +12 -0
  14. package/dist/chat/attachments/store.d.ts +52 -0
  15. package/dist/chat/attachments/vercel.d.ts +3 -0
  16. package/dist/chat/conversations/retention.d.ts +4 -0
  17. package/dist/chat/conversations/sql/event-actor.d.ts +14 -0
  18. package/dist/chat/conversations/sql/event-lock.d.ts +1 -1
  19. package/dist/chat/conversations/sql/participants.d.ts +17 -0
  20. package/dist/chat/ingress/bot-mention.d.ts +13 -0
  21. package/dist/chat/plugins/unfinished-work.d.ts +8 -0
  22. package/dist/chat/runtime/agent-runner.d.ts +4 -0
  23. package/dist/chat/runtime/slack-resume.d.ts +1 -1
  24. package/dist/chat/services/conversation-memory.d.ts +1 -1
  25. package/dist/chat/slack/tools/send-files.d.ts +17 -11
  26. package/dist/chat/state/conversation.d.ts +3 -1
  27. package/dist/chat/tools/types.d.ts +2 -0
  28. package/dist/{chunk-XYMCZGH6.js → chunk-3FFUC32L.js} +8 -10
  29. package/dist/{chunk-4U4MNYGP.js → chunk-3L2PMOSR.js} +6 -8
  30. package/dist/{chunk-PTJ75ZWR.js → chunk-4ZZDTHFC.js} +94 -9
  31. package/dist/{chunk-DAJZZFU7.js → chunk-53W3LZEW.js} +386 -93
  32. package/dist/{chunk-F7QUK3YP.js → chunk-6CINHXIL.js} +5 -5
  33. package/dist/{chunk-6VWMX7NS.js → chunk-6JUU7J2B.js} +4 -4
  34. package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
  35. package/dist/{chunk-O4AQDOKA.js → chunk-7RAETIYO.js} +7 -7
  36. package/dist/{chunk-4R2XCKUH.js → chunk-A6WPDFHQ.js} +1 -1
  37. package/dist/{chunk-CZD6M57V.js → chunk-AIJRG227.js} +191 -126
  38. package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
  39. package/dist/{chunk-NUG3VYHL.js → chunk-CK2H7CFO.js} +2 -2
  40. package/dist/{chunk-HOGJ6TBT.js → chunk-CN2XSVKF.js} +6 -6
  41. package/dist/{chunk-3567VGCN.js → chunk-EDJ64P2P.js} +1 -1
  42. package/dist/{chunk-6PJXR4BC.js → chunk-GKC43TLS.js} +2 -2
  43. package/dist/{chunk-A6LWN4K6.js → chunk-GSBPZHLQ.js} +11 -11
  44. package/dist/{chunk-Y654CTW2.js → chunk-IIO5PFZX.js} +366 -138
  45. package/dist/{chunk-F2Q3ZHW2.js → chunk-IZEBHYI4.js} +1 -1
  46. package/dist/{chunk-QGR6QTC4.js → chunk-JUJR6WTL.js} +4 -4
  47. package/dist/{chunk-ZQT4RHUO.js → chunk-KBGMYLSV.js} +4 -1
  48. package/dist/{chunk-DK2FSQHS.js → chunk-KCA5MKHU.js} +5 -5
  49. package/dist/{chunk-NNN2WYAD.js → chunk-MC57E5U5.js} +1 -1
  50. package/dist/{chunk-6AF5GOZA.js → chunk-MJE7XKWP.js} +1 -1
  51. package/dist/{chunk-7CPN5JTA.js → chunk-NTNU6T2D.js} +3 -3
  52. package/dist/{chunk-NG4IAOVD.js → chunk-OGZPRMZA.js} +1 -1
  53. package/dist/{chunk-UCH55IGZ.js → chunk-OMQJB7YN.js} +28 -37
  54. package/dist/{chunk-2XNVS6RC.js → chunk-PMFGVLDU.js} +12 -11
  55. package/dist/{chunk-65IAU2L2.js → chunk-SE3D225X.js} +1 -1
  56. package/dist/{chunk-CCAU73CE.js → chunk-SRJA6QLM.js} +2 -2
  57. package/dist/{chunk-7RFWIHPM.js → chunk-TN4LVILT.js} +5 -5
  58. package/dist/{chunk-3ZR2R5EQ.js → chunk-TNXGMFWV.js} +1 -1
  59. package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
  60. package/dist/{chunk-MSOZLASC.js → chunk-WD7SEUZO.js} +2 -2
  61. package/dist/{chunk-UG5UCHHJ.js → chunk-X5NZQH5U.js} +4 -2
  62. package/dist/{chunk-3HX67UPN.js → chunk-X7W45B5G.js} +1 -1
  63. package/dist/{chunk-FVY7AJ46.js → chunk-ZNWRYNCA.js} +7 -7
  64. package/dist/cli/chat.js +36 -36
  65. package/dist/cli/check.js +8 -9
  66. package/dist/cli/init.js +41 -7
  67. package/dist/cli/plugins.js +15 -16
  68. package/dist/cli/snapshot-create.js +11 -12
  69. package/dist/cli/upgrade.js +9 -10
  70. package/dist/db/schema/attachments.d.ts +178 -0
  71. package/dist/db/schema/conversation-events.d.ts +20 -0
  72. package/dist/db/schema/conversation-participants.d.ts +63 -0
  73. package/dist/db/schema.d.ts +255 -1
  74. package/dist/{db-SOJJLMJK.js → db-TYUUKGJX.js} +8 -8
  75. package/dist/handlers/retention.d.ts +4 -1
  76. package/dist/instrumentation.js +4 -4
  77. package/dist/nitro.js +2 -2
  78. package/dist/{oauth-callback-server-GCJROMVO.js → oauth-callback-server-AWVDKPR5.js} +26 -26
  79. package/dist/{runner-SY6KDQCN.js → runner-JUQXMACC.js} +15 -16
  80. package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
  81. package/dist/{skills-XJ2LJ2ML.js → skills-4GZTZX4V.js} +8 -9
  82. package/dist/spawn-32SSRWU4.js +37 -0
  83. package/dist/{validation-XQWY6QRY.js → validation-DRLNJRND.js} +8 -9
  84. package/dist/version.js +1 -1
  85. package/dist/{work-FFT5JAOU.js → work-TGIXRRJY.js} +20 -21
  86. package/dist/worker-IFXZOYED.js +24 -0
  87. package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
  88. package/migrations/0027_attachment_storage.sql +16 -0
  89. package/migrations/meta/0026_snapshot.json +2424 -0
  90. package/migrations/meta/0027_snapshot.json +2554 -0
  91. package/migrations/meta/_journal.json +15 -1
  92. package/package.json +10 -7
  93. package/dist/catalog-runtime-AK5MY63F.js +0 -17
  94. package/dist/chunk-F3B2YJ76.js +0 -57
  95. package/dist/spawn-QFCQREEP.js +0 -38
  96. package/dist/worker-JAITK72F.js +0 -25
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-6PJXR4BC.js";
3
+ } from "./chunk-GKC43TLS.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -14,14 +14,8 @@ import {
14
14
  import { drizzle } from "drizzle-orm/neon-serverless";
15
15
  import { migrate } from "drizzle-orm/neon-serverless/migrator";
16
16
 
17
- // src/db/schema/conversation-annotations.ts
18
- import {
19
- foreignKey,
20
- jsonb as jsonb3,
21
- pgTable as pgTable4,
22
- primaryKey,
23
- text as text4
24
- } from "drizzle-orm/pg-core";
17
+ // src/db/schema/attachments.ts
18
+ import { index as index3, integer as integer2, pgTable as pgTable4, text as text4 } from "drizzle-orm/pg-core";
25
19
 
26
20
  // src/db/schema/conversations.ts
27
21
  import { sql as sql2 } from "drizzle-orm";
@@ -179,14 +173,49 @@ var juniorConversations = pgTable3(
179
173
  ]
180
174
  );
181
175
 
176
+ // src/db/schema/attachments.ts
177
+ var juniorAttachments = pgTable4(
178
+ "junior_attachments",
179
+ {
180
+ id: text4("id").primaryKey(),
181
+ conversationId: text4("conversation_id").notNull().references(() => juniorConversations.conversationId, {
182
+ onDelete: "cascade"
183
+ }),
184
+ provider: text4("provider").notNull(),
185
+ storageKey: text4("storage_key").notNull(),
186
+ filename: text4("filename").notNull(),
187
+ contentType: text4("content_type").notNull(),
188
+ bytes: integer2("bytes").notNull(),
189
+ sha256: text4("sha256").notNull(),
190
+ createdAt: timestamptz("created_at").notNull(),
191
+ /** Set when conversation purge marks the attachment unavailable. */
192
+ deleteRequestedAt: timestamptz("delete_requested_at")
193
+ },
194
+ (table) => [
195
+ index3("junior_attachments_conversation_idx").on(table.conversationId),
196
+ index3("junior_attachments_gc_idx").on(
197
+ table.provider,
198
+ table.deleteRequestedAt,
199
+ table.createdAt
200
+ )
201
+ ]
202
+ );
203
+
182
204
  // src/db/schema/conversation-annotations.ts
183
- var juniorConversationAnnotations = pgTable4(
205
+ import {
206
+ foreignKey,
207
+ jsonb as jsonb3,
208
+ pgTable as pgTable5,
209
+ primaryKey,
210
+ text as text5
211
+ } from "drizzle-orm/pg-core";
212
+ var juniorConversationAnnotations = pgTable5(
184
213
  "junior_conversation_annotations",
185
214
  {
186
- conversationId: text4("conversation_id").notNull(),
187
- plugin: text4("plugin").notNull(),
188
- kind: text4("kind").notNull(),
189
- key: text4("key").notNull(),
215
+ conversationId: text5("conversation_id").notNull(),
216
+ plugin: text5("plugin").notNull(),
217
+ kind: text5("kind").notNull(),
218
+ key: text5("key").notNull(),
190
219
  annotation: jsonb3("annotation_json").$type().notNull(),
191
220
  createdAt: timestamptz("created_at").notNull(),
192
221
  updatedAt: timestamptz("updated_at").notNull()
@@ -205,15 +234,15 @@ var juniorConversationAnnotations = pgTable4(
205
234
  );
206
235
 
207
236
  // src/db/schema/api-tokens.ts
208
- import { index as index3, pgTable as pgTable5, text as text5, uniqueIndex as uniqueIndex3 } from "drizzle-orm/pg-core";
209
- var juniorApiTokens = pgTable5(
237
+ import { index as index4, pgTable as pgTable6, text as text6, uniqueIndex as uniqueIndex3 } from "drizzle-orm/pg-core";
238
+ var juniorApiTokens = pgTable6(
210
239
  "junior_api_tokens",
211
240
  {
212
- id: text5("id").primaryKey(),
213
- ownerEmailNormalized: text5("owner_email_normalized").notNull(),
214
- name: text5("name").notNull(),
215
- tokenHash: text5("token_hash").notNull(),
216
- tokenSuffix: text5("token_suffix").notNull(),
241
+ id: text6("id").primaryKey(),
242
+ ownerEmailNormalized: text6("owner_email_normalized").notNull(),
243
+ name: text6("name").notNull(),
244
+ tokenHash: text6("token_hash").notNull(),
245
+ tokenSuffix: text6("token_suffix").notNull(),
217
246
  createdAt: timestamptz("created_at").notNull(),
218
247
  expiresAt: timestamptz("expires_at").notNull(),
219
248
  lastUsedAt: timestamptz("last_used_at"),
@@ -221,32 +250,35 @@ var juniorApiTokens = pgTable5(
221
250
  },
222
251
  (table) => [
223
252
  uniqueIndex3("junior_api_tokens_token_hash_uidx").on(table.tokenHash),
224
- index3("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)
253
+ index4("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)
225
254
  ]
226
255
  );
227
256
 
228
257
  // src/db/schema/conversation-events.ts
229
258
  import {
230
259
  foreignKey as foreignKey2,
231
- index as index4,
232
- integer as integer2,
260
+ index as index5,
261
+ integer as integer3,
233
262
  jsonb as jsonb4,
234
- pgTable as pgTable6,
263
+ pgTable as pgTable7,
235
264
  primaryKey as primaryKey2,
236
- text as text6,
265
+ text as text7,
237
266
  uniqueIndex as uniqueIndex4
238
267
  } from "drizzle-orm/pg-core";
239
268
  import { sql as sql3 } from "drizzle-orm";
240
- var juniorConversationEvents = pgTable6(
269
+ var juniorConversationEvents = pgTable7(
241
270
  "junior_conversation_events",
242
271
  {
243
- conversationId: text6("conversation_id").notNull(),
244
- seq: integer2("seq").notNull(),
245
- historyVersion: integer2("history_version").notNull(),
246
- schemaVersion: integer2("schema_version").default(1).notNull(),
247
- idempotencyKey: text6("idempotency_key"),
248
- type: text6("type").notNull(),
272
+ conversationId: text7("conversation_id").notNull(),
273
+ seq: integer3("seq").notNull(),
274
+ historyVersion: integer3("history_version").notNull(),
275
+ schemaVersion: integer3("schema_version").default(1).notNull(),
276
+ idempotencyKey: text7("idempotency_key"),
277
+ type: text7("type").notNull(),
249
278
  payload: jsonb4("payload").$type().notNull(),
279
+ actorIdentityId: text7("actor_identity_id").references(
280
+ () => juniorIdentities.id
281
+ ),
250
282
  createdAt: timestamptz("created_at").notNull()
251
283
  },
252
284
  (table) => [
@@ -259,17 +291,22 @@ var juniorConversationEvents = pgTable6(
259
291
  columns: [table.conversationId],
260
292
  foreignColumns: [juniorConversations.conversationId]
261
293
  }),
262
- index4("junior_conversation_events_history_version_idx").on(
294
+ index5("junior_conversation_events_history_version_idx").on(
263
295
  table.conversationId,
264
296
  table.historyVersion,
265
297
  table.seq
266
298
  ),
267
- index4("junior_conversation_events_type_idx").on(
299
+ index5("junior_conversation_events_type_idx").on(
268
300
  table.conversationId,
269
301
  table.type,
270
302
  table.seq
271
303
  ),
272
- index4("junior_conversation_events_message_search_idx").using("gin", sql3`to_tsvector('english', ${table.payload}->>'text')`).where(sql3`${table.type} = 'message'`),
304
+ index5("junior_conversation_events_actor_identity_idx").on(
305
+ table.actorIdentityId,
306
+ table.conversationId,
307
+ table.seq
308
+ ),
309
+ index5("junior_conversation_events_message_search_idx").using("gin", sql3`to_tsvector('english', ${table.payload}->>'text')`).where(sql3`${table.type} = 'message'`),
273
310
  uniqueIndex4("junior_conversation_events_idempotency_idx").on(
274
311
  table.conversationId,
275
312
  table.idempotencyKey
@@ -278,15 +315,15 @@ var juniorConversationEvents = pgTable6(
278
315
  );
279
316
 
280
317
  // src/db/schema/conversation-bindings.ts
281
- import { index as index5, pgTable as pgTable7, primaryKey as primaryKey3, text as text7 } from "drizzle-orm/pg-core";
282
- var juniorConversationBindings = pgTable7(
318
+ import { index as index6, pgTable as pgTable8, primaryKey as primaryKey3, text as text8 } from "drizzle-orm/pg-core";
319
+ var juniorConversationBindings = pgTable8(
283
320
  "junior_conversation_bindings",
284
321
  {
285
- conversationId: text7("conversation_id").notNull().references(() => juniorConversations.conversationId),
286
- provider: text7("provider").notNull(),
287
- providerTenantId: text7("provider_tenant_id").notNull().default(""),
288
- providerDestinationId: text7("provider_destination_id").notNull(),
289
- providerConversationId: text7("provider_conversation_id").notNull(),
322
+ conversationId: text8("conversation_id").notNull().references(() => juniorConversations.conversationId),
323
+ provider: text8("provider").notNull(),
324
+ providerTenantId: text8("provider_tenant_id").notNull().default(""),
325
+ providerDestinationId: text8("provider_destination_id").notNull(),
326
+ providerConversationId: text8("provider_conversation_id").notNull(),
290
327
  createdAt: timestamptz("created_at").notNull()
291
328
  },
292
329
  (table) => [
@@ -299,34 +336,58 @@ var juniorConversationBindings = pgTable7(
299
336
  table.providerConversationId
300
337
  ]
301
338
  }),
302
- index5("junior_conversation_bindings_conversation_idx").on(
339
+ index6("junior_conversation_bindings_conversation_idx").on(
303
340
  table.conversationId
304
341
  )
305
342
  ]
306
343
  );
307
344
 
345
+ // src/db/schema/conversation-participants.ts
346
+ import { index as index7, pgTable as pgTable9, primaryKey as primaryKey4, text as text9 } from "drizzle-orm/pg-core";
347
+ var juniorConversationParticipants = pgTable9(
348
+ "junior_conversation_participants",
349
+ {
350
+ userId: text9("user_id").notNull().references(() => juniorUsers.id),
351
+ rootConversationId: text9("root_conversation_id").notNull().references(() => juniorConversations.conversationId),
352
+ lastMessageAt: timestamptz("last_message_at").notNull()
353
+ },
354
+ (table) => [
355
+ primaryKey4({
356
+ name: "junior_conversation_participants_user_root_pk",
357
+ columns: [table.userId, table.rootConversationId]
358
+ }),
359
+ index7("junior_conversation_participants_user_activity_idx").on(
360
+ table.userId,
361
+ table.lastMessageAt.desc()
362
+ ),
363
+ index7("junior_conversation_participants_root_idx").on(
364
+ table.rootConversationId
365
+ )
366
+ ]
367
+ );
368
+
308
369
  // src/db/schema/agent-invocations.ts
309
370
  import {
310
- index as index6,
371
+ index as index8,
311
372
  jsonb as jsonb5,
312
- pgTable as pgTable8,
313
- primaryKey as primaryKey4,
314
- text as text8,
373
+ pgTable as pgTable10,
374
+ primaryKey as primaryKey5,
375
+ text as text10,
315
376
  uniqueIndex as uniqueIndex5
316
377
  } from "drizzle-orm/pg-core";
317
378
  var AGENT_INVOCATION_MAILBOX_STATUSES = [
318
379
  "pending",
319
380
  "appended"
320
381
  ];
321
- var juniorAgentBindings = pgTable8(
382
+ var juniorAgentBindings = pgTable10(
322
383
  "junior_agent_bindings",
323
384
  {
324
- parentConversationId: text8("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
325
- name: text8("name").notNull(),
326
- childConversationId: text8("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
385
+ parentConversationId: text10("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
386
+ name: text10("name").notNull(),
387
+ childConversationId: text10("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
327
388
  },
328
389
  (table) => [
329
- primaryKey4({
390
+ primaryKey5({
330
391
  columns: [table.parentConversationId, table.name]
331
392
  }),
332
393
  uniqueIndex5("junior_agent_bindings_child_idx").on(
@@ -334,35 +395,35 @@ var juniorAgentBindings = pgTable8(
334
395
  )
335
396
  ]
336
397
  );
337
- var juniorAgentInvocations = pgTable8(
398
+ var juniorAgentInvocations = pgTable10(
338
399
  "junior_agent_invocations",
339
400
  {
340
- invocationId: text8("invocation_id").primaryKey(),
341
- parentConversationId: text8("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
342
- childConversationId: text8("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
343
- agentName: text8("agent_name"),
344
- input: text8("input").notNull(),
401
+ invocationId: text10("invocation_id").primaryKey(),
402
+ parentConversationId: text10("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
403
+ childConversationId: text10("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
404
+ agentName: text10("agent_name"),
405
+ input: text10("input").notNull(),
345
406
  actor: jsonb5("actor_json").$type().notNull(),
346
407
  credentialContext: jsonb5(
347
408
  "credential_context_json"
348
409
  ).$type(),
349
410
  source: jsonb5("source_json").$type().notNull(),
350
411
  destination: jsonb5("destination_json").$type().notNull(),
351
- destinationVisibility: text8(
412
+ destinationVisibility: text10(
352
413
  "destination_visibility"
353
414
  ).$type(),
354
- reasoningLevel: text8("reasoning_level").$type(),
355
- status: text8("status").$type().notNull(),
356
- mailboxStatus: text8("mailbox_status").$type().notNull(),
357
- result: text8("result"),
358
- errorMessage: text8("error_message"),
415
+ reasoningLevel: text10("reasoning_level").$type(),
416
+ status: text10("status").$type().notNull(),
417
+ mailboxStatus: text10("mailbox_status").$type().notNull(),
418
+ result: text10("result"),
419
+ errorMessage: text10("error_message"),
359
420
  createdAt: timestamptz("created_at").notNull(),
360
421
  updatedAt: timestamptz("updated_at").notNull(),
361
422
  terminalAt: timestamptz("terminal_at")
362
423
  },
363
424
  (table) => [
364
- index6("junior_agent_invocations_child_idx").on(table.childConversationId),
365
- index6("junior_agent_invocations_mailbox_idx").on(
425
+ index8("junior_agent_invocations_child_idx").on(table.childConversationId),
426
+ index8("junior_agent_invocations_mailbox_idx").on(
366
427
  table.mailboxStatus,
367
428
  table.createdAt
368
429
  )
@@ -370,42 +431,42 @@ var juniorAgentInvocations = pgTable8(
370
431
  );
371
432
 
372
433
  // src/db/schema/location-configurations.ts
373
- import { pgTable as pgTable9, primaryKey as primaryKey5, text as text9 } from "drizzle-orm/pg-core";
374
- var juniorLocationConfigurations = pgTable9(
434
+ import { pgTable as pgTable11, primaryKey as primaryKey6, text as text11 } from "drizzle-orm/pg-core";
435
+ var juniorLocationConfigurations = pgTable11(
375
436
  "junior_location_configurations",
376
437
  {
377
- locationId: text9("location_id").notNull().references(() => juniorDestinations.id, { onDelete: "cascade" }),
378
- key: text9("key").notNull(),
379
- value: text9("value").notNull(),
438
+ locationId: text11("location_id").notNull().references(() => juniorDestinations.id, { onDelete: "cascade" }),
439
+ key: text11("key").notNull(),
440
+ value: text11("value").notNull(),
380
441
  updatedAt: timestamptz("updated_at").notNull(),
381
- updatedBy: text9("updated_by"),
382
- source: text9("source"),
383
- expiresAt: text9("expires_at")
442
+ updatedBy: text11("updated_by"),
443
+ source: text11("source"),
444
+ expiresAt: text11("expires_at")
384
445
  },
385
- (table) => [primaryKey5({ columns: [table.locationId, table.key] })]
446
+ (table) => [primaryKey6({ columns: [table.locationId, table.key] })]
386
447
  );
387
448
 
388
449
  // src/db/schema/event-tasks.ts
389
- import { bigint, index as index7, jsonb as jsonb6, pgTable as pgTable10, text as text10 } from "drizzle-orm/pg-core";
390
- var juniorEventTasks = pgTable10(
450
+ import { bigint, index as index9, jsonb as jsonb6, pgTable as pgTable12, text as text12 } from "drizzle-orm/pg-core";
451
+ var juniorEventTasks = pgTable12(
391
452
  "junior_event_tasks",
392
453
  {
393
- id: text10("id").primaryKey(),
394
- teamId: text10("team_id").notNull(),
395
- namespace: text10("namespace").notNull(),
396
- identifier: text10("identifier").notNull(),
454
+ id: text12("id").primaryKey(),
455
+ teamId: text12("team_id").notNull(),
456
+ namespace: text12("namespace").notNull(),
457
+ identifier: text12("identifier").notNull(),
397
458
  createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
398
459
  /** Short display title generated from the task instruction. */
399
- title: text10("title"),
460
+ title: text12("title"),
400
461
  task: jsonb6("task_json").$type().notNull()
401
462
  },
402
463
  (table) => [
403
- index7("junior_event_tasks_team_idx").on(
464
+ index9("junior_event_tasks_team_idx").on(
404
465
  table.teamId,
405
466
  table.createdAtMs,
406
467
  table.id
407
468
  ),
408
- index7("junior_event_tasks_match_idx").on(
469
+ index9("junior_event_tasks_match_idx").on(
409
470
  table.namespace,
410
471
  table.identifier,
411
472
  table.createdAtMs,
@@ -415,18 +476,18 @@ var juniorEventTasks = pgTable10(
415
476
  );
416
477
 
417
478
  // src/db/schema/stats.ts
418
- import { date, integer as integer3, pgTable as pgTable11, primaryKey as primaryKey6, text as text11 } from "drizzle-orm/pg-core";
419
- var juniorStats = pgTable11(
479
+ import { date, integer as integer4, pgTable as pgTable13, primaryKey as primaryKey7, text as text13 } from "drizzle-orm/pg-core";
480
+ var juniorStats = pgTable13(
420
481
  "junior_stats",
421
482
  {
422
483
  date: date("date", { mode: "string" }).notNull(),
423
- namespace: text11("namespace").notNull(),
424
- metric: text11("metric").notNull(),
425
- name: text11("name").notNull(),
426
- count: integer3("count").notNull().default(0)
484
+ namespace: text13("namespace").notNull(),
485
+ metric: text13("metric").notNull(),
486
+ name: text13("name").notNull(),
487
+ count: integer4("count").notNull().default(0)
427
488
  },
428
489
  (table) => [
429
- primaryKey6({
490
+ primaryKey7({
430
491
  name: "junior_stats_date_namespace_metric_name_pk",
431
492
  columns: [table.date, table.namespace, table.metric, table.name]
432
493
  })
@@ -439,21 +500,21 @@ import {
439
500
  bigint as bigint2,
440
501
  check,
441
502
  foreignKey as foreignKey3,
442
- index as index8,
443
- pgTable as pgTable12,
444
- primaryKey as primaryKey7,
445
- text as text12
503
+ index as index10,
504
+ pgTable as pgTable14,
505
+ primaryKey as primaryKey8,
506
+ text as text14
446
507
  } from "drizzle-orm/pg-core";
447
- var juniorTaskExecutions = pgTable12(
508
+ var juniorTaskExecutions = pgTable14(
448
509
  "junior_task_executions",
449
510
  {
450
- executionId: text12("execution_id").notNull(),
451
- kind: text12("kind").notNull(),
452
- namespace: text12("namespace").notNull(),
453
- taskId: text12("task_id").notNull(),
454
- conversationId: text12("conversation_id"),
511
+ executionId: text14("execution_id").notNull(),
512
+ kind: text14("kind").notNull(),
513
+ namespace: text14("namespace").notNull(),
514
+ taskId: text14("task_id").notNull(),
515
+ conversationId: text14("conversation_id"),
455
516
  executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull(),
456
- status: text12("status").$type().notNull()
517
+ status: text14("status").$type().notNull()
457
518
  },
458
519
  (table) => [
459
520
  check(
@@ -464,7 +525,7 @@ var juniorTaskExecutions = pgTable12(
464
525
  "junior_task_executions_status_check",
465
526
  sql4`${table.status} in ('blocked', 'completed', 'failed')`
466
527
  ),
467
- primaryKey7({
528
+ primaryKey8({
468
529
  name: "junior_task_executions_kind_namespace_execution_id_pk",
469
530
  columns: [table.kind, table.namespace, table.executionId]
470
531
  }),
@@ -473,17 +534,17 @@ var juniorTaskExecutions = pgTable12(
473
534
  columns: [table.conversationId],
474
535
  foreignColumns: [juniorConversations.conversationId]
475
536
  }),
476
- index8("junior_task_executions_task_time_idx").on(
537
+ index10("junior_task_executions_task_time_idx").on(
477
538
  table.kind,
478
539
  table.namespace,
479
540
  table.taskId,
480
541
  table.executedAtMs
481
542
  ),
482
- index8("junior_task_executions_time_kind_idx").on(
543
+ index10("junior_task_executions_time_kind_idx").on(
483
544
  table.executedAtMs,
484
545
  table.kind
485
546
  ),
486
- index8("junior_task_executions_conversation_time_idx").on(
547
+ index10("junior_task_executions_conversation_time_idx").on(
487
548
  table.conversationId,
488
549
  table.executedAtMs
489
550
  )
@@ -492,54 +553,54 @@ var juniorTaskExecutions = pgTable12(
492
553
 
493
554
  // src/db/schema/scheduled-tasks.ts
494
555
  import { sql as sql5 } from "drizzle-orm";
495
- import { bigint as bigint3, index as index9, jsonb as jsonb7, pgTable as pgTable13, text as text13 } from "drizzle-orm/pg-core";
496
- var juniorSchedulerTasks = pgTable13(
556
+ import { bigint as bigint3, index as index11, jsonb as jsonb7, pgTable as pgTable15, text as text15 } from "drizzle-orm/pg-core";
557
+ var juniorSchedulerTasks = pgTable15(
497
558
  "junior_scheduler_tasks",
498
559
  {
499
- id: text13("id").primaryKey(),
500
- teamId: text13("team_id").notNull(),
560
+ id: text15("id").primaryKey(),
561
+ teamId: text15("team_id").notNull(),
501
562
  // TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
502
- creatorSlackUserId: text13("creator_slack_user_id"),
503
- creatorIdentityId: text13("creator_identity_id"),
504
- status: text13("status").notNull(),
563
+ creatorSlackUserId: text15("creator_slack_user_id"),
564
+ creatorIdentityId: text15("creator_identity_id"),
565
+ status: text15("status").notNull(),
505
566
  nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
506
567
  runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
507
568
  createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
508
569
  /** Short display title generated from the task instruction. */
509
- title: text13("title"),
570
+ title: text15("title"),
510
571
  record: jsonb7("record").$type().notNull()
511
572
  },
512
573
  (table) => [
513
574
  // TODO(v0.128.0): Remove with creatorSlackUserId.
514
- index9("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
515
- index9("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
575
+ index11("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
576
+ index11("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
516
577
  sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
517
578
  ),
518
- index9("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
519
- index9("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
579
+ index11("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
580
+ index11("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
520
581
  sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
521
582
  ),
522
- index9("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
583
+ index11("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
523
584
  sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
524
585
  )
525
586
  ]
526
587
  );
527
- var juniorSchedulerRuns = pgTable13(
588
+ var juniorSchedulerRuns = pgTable15(
528
589
  "junior_scheduler_runs",
529
590
  {
530
- id: text13("id").primaryKey(),
531
- taskId: text13("task_id").notNull(),
532
- status: text13("status").notNull(),
591
+ id: text15("id").primaryKey(),
592
+ taskId: text15("task_id").notNull(),
593
+ status: text15("status").notNull(),
533
594
  scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
534
595
  record: jsonb7("record").$type().notNull()
535
596
  },
536
597
  (table) => [
537
- index9("junior_scheduler_runs_task_status_idx").on(
598
+ index11("junior_scheduler_runs_task_status_idx").on(
538
599
  table.taskId,
539
600
  table.status,
540
601
  table.scheduledForMs
541
602
  ),
542
- index9("junior_scheduler_runs_status_idx").on(
603
+ index11("junior_scheduler_runs_status_idx").on(
543
604
  table.status,
544
605
  table.scheduledForMs
545
606
  )
@@ -548,12 +609,14 @@ var juniorSchedulerRuns = pgTable13(
548
609
 
549
610
  // src/db/schema.ts
550
611
  var juniorSqlSchema = {
612
+ juniorAttachments,
551
613
  juniorConversationAnnotations,
552
614
  juniorApiTokens,
553
615
  juniorAgentBindings,
554
616
  juniorAgentInvocations,
555
617
  juniorConversationEvents,
556
618
  juniorConversationBindings,
619
+ juniorConversationParticipants,
557
620
  juniorConversations,
558
621
  juniorLocationConfigurations,
559
622
  juniorDestinations,
@@ -819,10 +882,12 @@ export {
819
882
  juniorUsers,
820
883
  juniorIdentities,
821
884
  juniorConversations,
885
+ juniorAttachments,
822
886
  juniorConversationAnnotations,
823
887
  juniorApiTokens,
824
888
  juniorConversationEvents,
825
889
  juniorConversationBindings,
890
+ juniorConversationParticipants,
826
891
  AGENT_INVOCATION_MAILBOX_STATUSES,
827
892
  juniorAgentBindings,
828
893
  juniorAgentInvocations,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseActorUserId
3
- } from "./chunk-HZF5P5UN.js";
3
+ } from "./chunk-V7YE4WCP.js";
4
4
 
5
5
  // src/chat/credentials/context.ts
6
6
  import { z } from "zod";
@@ -2,10 +2,10 @@ import {
2
2
  parseSlackChannelId,
3
3
  parseSlackMessageTs,
4
4
  parseSlackTeamId
5
- } from "./chunk-F3B2YJ76.js";
5
+ } from "./chunk-V7YE4WCP.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-3HX67UPN.js";
8
+ } from "./chunk-X7W45B5G.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-F7QUK3YP.js";
3
+ } from "./chunk-6CINHXIL.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-7RFWIHPM.js";
9
+ } from "./chunk-TN4LVILT.js";
10
10
  import {
11
11
  AgentInvocationBusyError,
12
12
  AgentInvocationLimitError,
@@ -15,7 +15,7 @@ import {
15
15
  agentBindingSchema,
16
16
  agentInvocationSchema,
17
17
  createAgentInvocationSchema
18
- } from "./chunk-FVY7AJ46.js";
18
+ } from "./chunk-ZNWRYNCA.js";
19
19
  import {
20
20
  TurnInputCommitLostError,
21
21
  failTurnRecord,
@@ -26,16 +26,16 @@ import {
26
26
  isTurnInputCommitLostError,
27
27
  openConversationProjection,
28
28
  saveTurnCheckpoint
29
- } from "./chunk-4U4MNYGP.js";
29
+ } from "./chunk-3L2PMOSR.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-Y654CTW2.js";
34
+ } from "./chunk-IIO5PFZX.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-CZD6M57V.js";
38
+ } from "./chunk-AIJRG227.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-MSOZLASC.js";
3
+ } from "./chunk-WD7SEUZO.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-6AF5GOZA.js";
6
+ } from "./chunk-MJE7XKWP.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-3HX67UPN.js";
14
+ } from "./chunk-X7W45B5G.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {