@sentry/junior 0.200.0 → 0.202.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 (65) hide show
  1. package/dist/{agent-hooks-6LGY2MBH.js → agent-hooks-UXITLYOK.js} +11 -11
  2. package/dist/api.js +25 -25
  3. package/dist/app.js +228 -122
  4. package/dist/{catalog-runtime-CIO3ERVQ.js → catalog-runtime-BG3JLLK2.js} +4 -4
  5. package/dist/{chunk-PMSENMWY.js → chunk-2MK3QBGA.js} +1 -1
  6. package/dist/{chunk-EOOWKTQC.js → chunk-3PGQSKJV.js} +9 -9
  7. package/dist/{chunk-ZPLAAHVP.js → chunk-3UI3WFTX.js} +5 -5
  8. package/dist/{chunk-SY2RQ77O.js → chunk-5NOPO64K.js} +1 -1
  9. package/dist/{chunk-JLUCKXGI.js → chunk-5PKWYPFT.js} +6 -6
  10. package/dist/{chunk-GFXDMDHR.js → chunk-63NKKFJL.js} +2 -2
  11. package/dist/{chunk-M7BHRB3G.js → chunk-6AYH6252.js} +4 -4
  12. package/dist/{chunk-RDWWCDA4.js → chunk-7DHZP5KJ.js} +2 -2
  13. package/dist/{chunk-RG74Q34N.js → chunk-A76OIMYN.js} +1 -1
  14. package/dist/{chunk-YVP6QNBZ.js → chunk-AWMS3SPP.js} +3 -3
  15. package/dist/{chunk-ODSGDVHT.js → chunk-B3LY5RCL.js} +5 -5
  16. package/dist/{chunk-4Q5IR5GA.js → chunk-BD2KT3OB.js} +1 -1
  17. package/dist/{chunk-5Q6KP6LH.js → chunk-BXCX5QKA.js} +1 -1
  18. package/dist/{chunk-TF5TXGRD.js → chunk-C6VVF43U.js} +1 -1
  19. package/dist/{chunk-5JDNDQHL.js → chunk-DBVY6HLX.js} +1 -1
  20. package/dist/{chunk-PIHLVU7T.js → chunk-DL2KLKVH.js} +6 -6
  21. package/dist/{chunk-3WUBDFFL.js → chunk-ELWOYVOY.js} +1 -1
  22. package/dist/{chunk-PSQ4SWI3.js → chunk-EWT7H65X.js} +4 -4
  23. package/dist/{chunk-OTTKTTVI.js → chunk-HMREVIO2.js} +2 -2
  24. package/dist/{chunk-LUITHZZL.js → chunk-IIWUT4FO.js} +8 -8
  25. package/dist/{chunk-V2VL335Y.js → chunk-JSJQEWBJ.js} +21 -21
  26. package/dist/{chunk-T6263C3N.js → chunk-KHKKHDLD.js} +2 -2
  27. package/dist/{chunk-OIILBD56.js → chunk-LA6R4A7Q.js} +3 -3
  28. package/dist/{chunk-X2Q4H6JQ.js → chunk-LOOU2DUR.js} +315 -166
  29. package/dist/{chunk-ADNSL3MX.js → chunk-M6FHWXE3.js} +9 -9
  30. package/dist/{chunk-JMRHEW6B.js → chunk-M76HMB7M.js} +3 -3
  31. package/dist/{chunk-7DO36XLF.js → chunk-MAGNK5J4.js} +1 -1
  32. package/dist/{chunk-OVHO76WN.js → chunk-NSXKRGRT.js} +3 -3
  33. package/dist/{chunk-UR43NMUR.js → chunk-OWMPFXJA.js} +4 -4
  34. package/dist/{chunk-K2QYWZ7F.js → chunk-PW4P4JYF.js} +14 -3
  35. package/dist/{chunk-VLBLCJXK.js → chunk-QB54UQUS.js} +5 -5
  36. package/dist/{chunk-752M26LC.js → chunk-QP3OGJXF.js} +1 -1
  37. package/dist/{chunk-LICM66W2.js → chunk-REOIRYPR.js} +2 -2
  38. package/dist/{chunk-AV552V2K.js → chunk-SCOZRLZ4.js} +3 -3
  39. package/dist/{chunk-IAZBUDVU.js → chunk-TXJSXBV5.js} +36 -30
  40. package/dist/{chunk-N5VHBUXF.js → chunk-U2GPUYAL.js} +19 -6
  41. package/dist/{chunk-22Y5SBDM.js → chunk-WQSHDTTI.js} +8 -8
  42. package/dist/{chunk-5VRPXF4T.js → chunk-YDUR3ZYW.js} +1 -1
  43. package/dist/cli/chat.js +33 -33
  44. package/dist/cli/check.js +5 -5
  45. package/dist/cli/plugins.js +12 -12
  46. package/dist/cli/snapshot-create.js +9 -9
  47. package/dist/cli/upgrade.js +6 -6
  48. package/dist/{db-SCTYCGQ5.js → db-3L2MCVRI.js} +6 -6
  49. package/dist/instrumentation.js +3 -3
  50. package/dist/nitro.js +6 -6
  51. package/dist/{oauth-callback-server-QXKBXP5M.js → oauth-callback-server-YVV6C6T2.js} +29 -29
  52. package/dist/{runner-Z3EQSZ23.js → runner-LQ7RETDP.js} +21 -21
  53. package/dist/{skills-CGEPG74A.js → skills-XRWYEDCD.js} +5 -5
  54. package/dist/spawn-RC6SJUAI.js +42 -0
  55. package/dist/task-runner-7DY7ARYH.js +36 -0
  56. package/dist/{validation-YLALMVMB.js → validation-7MNQGCJA.js} +5 -5
  57. package/dist/version.js +1 -1
  58. package/dist/{work-N6PUG4MY.js → work-COALHUCG.js} +21 -21
  59. package/dist/{worker-M7464FAO.js → worker-6MURZIPD.js} +10 -10
  60. package/migrations/0039_attachment_provider.sql +7 -0
  61. package/migrations/meta/0039_snapshot.json +3368 -0
  62. package/migrations/meta/_journal.json +7 -0
  63. package/package.json +6 -6
  64. package/dist/spawn-WBEM46BW.js +0 -42
  65. package/dist/task-runner-2X5MUSHN.js +0 -36
@@ -3,39 +3,39 @@ import {
3
3
  } from "./chunk-RC745GGZ.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-RG74Q34N.js";
6
+ } from "./chunk-A76OIMYN.js";
7
7
  import {
8
8
  appendAndEnqueueExclusiveInboundMessage,
9
9
  appendAndEnqueueInboundMessage
10
- } from "./chunk-UR43NMUR.js";
10
+ } from "./chunk-OWMPFXJA.js";
11
11
  import {
12
12
  buildDeterministicTurnId
13
13
  } from "./chunk-DA2KGZZI.js";
14
14
  import {
15
15
  normalizeSlackConversationId
16
- } from "./chunk-N5VHBUXF.js";
16
+ } from "./chunk-U2GPUYAL.js";
17
17
  import {
18
18
  getConversationStore,
19
19
  getDb
20
- } from "./chunk-JMRHEW6B.js";
20
+ } from "./chunk-M76HMB7M.js";
21
21
  import {
22
22
  juniorConversationParticipants,
23
23
  juniorConversations,
24
24
  juniorIdentities,
25
25
  juniorUsers
26
- } from "./chunk-K2QYWZ7F.js";
26
+ } from "./chunk-PW4P4JYF.js";
27
27
  import {
28
28
  juniorDestinations
29
29
  } from "./chunk-VFUK3X5B.js";
30
30
  import {
31
31
  getSlackBotToken
32
- } from "./chunk-GFXDMDHR.js";
32
+ } from "./chunk-63NKKFJL.js";
33
33
  import {
34
34
  canExposeConversationPayload
35
- } from "./chunk-SY2RQ77O.js";
35
+ } from "./chunk-5NOPO64K.js";
36
36
  import {
37
37
  logWarn
38
- } from "./chunk-7DO36XLF.js";
38
+ } from "./chunk-MAGNK5J4.js";
39
39
 
40
40
  // src/handlers/health.ts
41
41
  function readHealthReport() {
@@ -63,7 +63,7 @@ function createVercelAttachmentStorage() {
63
63
  });
64
64
  },
65
65
  async get(key) {
66
- const result = await get(key, { access: "private" });
66
+ const result = await get(key, { access: "private", useCache: false });
67
67
  return result?.statusCode === 200 ? result.stream : null;
68
68
  },
69
69
  async delete(keys) {
@@ -8,7 +8,7 @@ import {
8
8
  juniorConversations,
9
9
  juniorIdentities,
10
10
  juniorUsers
11
- } from "./chunk-K2QYWZ7F.js";
11
+ } from "./chunk-PW4P4JYF.js";
12
12
  import {
13
13
  conversationEventDataSchema,
14
14
  decodeStoredConversationEvent,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-VFUK3X5B.js";
21
21
  import {
22
22
  getChatConfig
23
- } from "./chunk-GFXDMDHR.js";
23
+ } from "./chunk-63NKKFJL.js";
24
24
  import {
25
25
  parseActorUserId,
26
26
  parseSlackChannelReferenceId,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-N7TMSOZH.js";
29
29
  import {
30
30
  normalizeIdentityEmail
31
- } from "./chunk-7DO36XLF.js";
31
+ } from "./chunk-MAGNK5J4.js";
32
32
 
33
33
  // src/chat/conversations/sql/store.ts
34
34
  import { randomUUID as randomUUID2 } from "crypto";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-PEQXYSSE.js";
13
13
  import {
14
14
  JUNIOR_VERSION
15
- } from "./chunk-OTTKTTVI.js";
15
+ } from "./chunk-HMREVIO2.js";
16
16
 
17
17
  // src/deployment.ts
18
18
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-GFXDMDHR.js";
3
+ } from "./chunk-63NKKFJL.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-5VRPXF4T.js";
6
+ } from "./chunk-YDUR3ZYW.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-7DO36XLF.js";
10
+ } from "./chunk-MAGNK5J4.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-JMRHEW6B.js";
11
+ } from "./chunk-M76HMB7M.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-PMSENMWY.js";
15
+ } from "./chunk-2MK3QBGA.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-GFXDMDHR.js";
18
+ } from "./chunk-63NKKFJL.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-N7TMSOZH.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-7DO36XLF.js";
26
+ } from "./chunk-MAGNK5J4.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFUK3X5B.js";
5
5
  import {
6
6
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
7
- } from "./chunk-GFXDMDHR.js";
7
+ } from "./chunk-63NKKFJL.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";
@@ -233,20 +233,31 @@ var juniorAttachments = pgTable5(
233
233
  conversationId: text5("conversation_id").notNull().references(() => juniorConversations.conversationId, {
234
234
  onDelete: "cascade"
235
235
  }),
236
- provider: text5("provider").notNull(),
236
+ /** Service that stores the file bytes. */
237
+ storageProvider: text5("storage_provider").notNull(),
237
238
  storageKey: text5("storage_key").notNull(),
239
+ /** Provider that supplied the file. */
240
+ provider: text5("provider"),
241
+ /** File id assigned by the source provider. */
242
+ providerId: text5("provider_id"),
238
243
  filename: text5("filename").notNull(),
239
244
  contentType: text5("content_type").notNull(),
240
245
  bytes: integer3("bytes").notNull(),
241
246
  sha256: text5("sha256").notNull(),
247
+ visionSummary: text5("vision_summary"),
242
248
  createdAt: timestamptz("created_at").notNull(),
243
249
  /** Set when conversation purge marks the attachment unavailable. */
244
250
  deleteRequestedAt: timestamptz("delete_requested_at")
245
251
  },
246
252
  (table) => [
247
253
  index4("junior_attachments_conversation_idx").on(table.conversationId),
248
- index4("junior_attachments_gc_idx").on(
254
+ index4("junior_attachments_provider_idx").on(
255
+ table.conversationId,
249
256
  table.provider,
257
+ table.providerId
258
+ ),
259
+ index4("junior_attachments_gc_idx").on(
260
+ table.storageProvider,
250
261
  table.deleteRequestedAt,
251
262
  table.createdAt
252
263
  )
@@ -7,23 +7,23 @@ import {
7
7
  import {
8
8
  formatProviderLabel,
9
9
  startOAuthFlow
10
- } from "./chunk-PIHLVU7T.js";
10
+ } from "./chunk-DL2KLKVH.js";
11
11
  import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink
14
- } from "./chunk-3WUBDFFL.js";
14
+ } from "./chunk-ELWOYVOY.js";
15
15
  import {
16
16
  recordAuthorizationRequested
17
- } from "./chunk-JLUCKXGI.js";
17
+ } from "./chunk-5PKWYPFT.js";
18
18
  import {
19
19
  AGENT_INVOCATION_MAILBOX_STATUSES
20
- } from "./chunk-K2QYWZ7F.js";
20
+ } from "./chunk-PW4P4JYF.js";
21
21
  import {
22
22
  TURN_REASONING_LEVELS
23
23
  } from "./chunk-NHJU2ZAL.js";
24
24
  import {
25
25
  pluginCatalogRuntime
26
- } from "./chunk-5VRPXF4T.js";
26
+ } from "./chunk-YDUR3ZYW.js";
27
27
  import {
28
28
  credentialContextSchema
29
29
  } from "./chunk-CEMMLV5L.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-PMSENMWY.js";
3
+ } from "./chunk-2MK3QBGA.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-PEQXYSSE.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-EOOWKTQC.js";
3
+ } from "./chunk-3PGQSKJV.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
7
- } from "./chunk-PIHLVU7T.js";
7
+ } from "./chunk-DL2KLKVH.js";
8
8
 
9
9
  // src/chat/agent-invocations/spawn.ts
10
10
  function bindSpawnAgent(run, options) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runWithTurnRequestDeadline
3
- } from "./chunk-4Q5IR5GA.js";
3
+ } from "./chunk-BD2KT3OB.js";
4
4
  import {
5
5
  QUEUE_SIGNATURE_MAX_AGE_MS,
6
6
  createVercelQueueClient,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-7H2VZTWN.js";
10
10
  import {
11
11
  logWarn
12
- } from "./chunk-7DO36XLF.js";
12
+ } from "./chunk-MAGNK5J4.js";
13
13
 
14
14
  // src/chat/plugins/task-queue.ts
15
15
  import { createHash } from "crypto";
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
129
129
  onRejected: logPluginTaskQueueMessageRejected,
130
130
  // Load the runner on first use so this module can send without a cycle.
131
131
  run: async (message) => {
132
- const { processPluginTask } = await import("./task-runner-2X5MUSHN.js");
132
+ const { processPluginTask } = await import("./task-runner-7DY7ARYH.js");
133
133
  await processPluginTask(message);
134
134
  },
135
135
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-RDWWCDA4.js";
3
+ } from "./chunk-7DHZP5KJ.js";
4
4
  import {
5
5
  getPlugins
6
- } from "./chunk-N5VHBUXF.js";
6
+ } from "./chunk-U2GPUYAL.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-JMRHEW6B.js";
9
+ } from "./chunk-M76HMB7M.js";
10
10
  import {
11
11
  juniorAttachments,
12
12
  juniorConversations,
@@ -14,7 +14,7 @@ import {
14
14
  juniorSchedulerRuns,
15
15
  juniorSchedulerTasks,
16
16
  juniorStats
17
- } from "./chunk-K2QYWZ7F.js";
17
+ } from "./chunk-PW4P4JYF.js";
18
18
  import {
19
19
  juniorDestinations
20
20
  } from "./chunk-VFUK3X5B.js";
@@ -1027,21 +1027,25 @@ async function listPublicScheduledTasksForTeams(db, teamIds, limit) {
1027
1027
 
1028
1028
  // src/chat/attachments/store.ts
1029
1029
  import { createHash, randomUUID } from "crypto";
1030
- import { and as and4, asc as asc4, eq as eq3, inArray as inArray3, isNotNull, isNull, or as or2 } from "drizzle-orm";
1030
+ import { and as and4, asc as asc4, eq as eq3, inArray as inArray3, isNotNull, isNull, lte as lte2, or as or2 } from "drizzle-orm";
1031
+ var DAY_MS = 24 * 60 * 60 * 1e3;
1031
1032
  var ATTACHMENT_GC_BATCH_LIMIT = 200;
1033
+ var ATTACHMENT_RETENTION_MS = 30 * DAY_MS;
1032
1034
  function attachmentDigest(file) {
1033
1035
  return createHash("sha256").update(file.data).digest("hex");
1034
1036
  }
1035
1037
  function attachmentId(args) {
1036
- return createHash("sha256").update(
1037
- [
1038
- args.conversationId,
1039
- args.provider,
1040
- args.sha256,
1041
- args.filename,
1042
- args.contentType
1043
- ].join("\0")
1044
- ).digest("hex");
1038
+ const identity = [
1039
+ args.conversationId,
1040
+ args.storageProvider,
1041
+ args.sha256,
1042
+ args.filename,
1043
+ args.contentType
1044
+ ];
1045
+ if (args.source) {
1046
+ identity.push(args.source.provider, args.source.id);
1047
+ }
1048
+ return createHash("sha256").update(identity.join("\0")).digest("hex");
1045
1049
  }
1046
1050
  function attachmentKey(args) {
1047
1051
  return `conversations/${args.conversationId}/attachments/${args.attachmentId}/${args.writeId}/${args.filename}`;
@@ -1085,7 +1089,8 @@ async function storeAttachment(args) {
1085
1089
  conversationId: args.conversationId,
1086
1090
  contentType: args.file.mimeType,
1087
1091
  filename: args.file.filename,
1088
- provider: args.storage.provider,
1092
+ source: args.source,
1093
+ storageProvider: args.storage.provider,
1089
1094
  sha256
1090
1095
  });
1091
1096
  const [existing] = await args.db.db().select({
@@ -1095,11 +1100,13 @@ async function storeAttachment(args) {
1095
1100
  filename: juniorAttachments.filename,
1096
1101
  id: juniorAttachments.id,
1097
1102
  provider: juniorAttachments.provider,
1103
+ providerId: juniorAttachments.providerId,
1104
+ storageProvider: juniorAttachments.storageProvider,
1098
1105
  sha256: juniorAttachments.sha256,
1099
1106
  storageKey: juniorAttachments.storageKey
1100
1107
  }).from(juniorAttachments).where(eq3(juniorAttachments.id, id));
1101
1108
  if (existing) {
1102
- if (existing.contentType !== args.file.mimeType || existing.conversationId !== args.conversationId || existing.filename !== args.file.filename || existing.provider !== args.storage.provider || existing.sha256 !== sha256) {
1109
+ if (existing.contentType !== args.file.mimeType || existing.conversationId !== args.conversationId || existing.filename !== args.file.filename || existing.provider !== (args.source?.provider ?? null) || existing.providerId !== (args.source?.id ?? null) || existing.storageProvider !== args.storage.provider || existing.sha256 !== sha256) {
1103
1110
  throw new Error(`Attachment write conflicts with ${existing.id}`);
1104
1111
  }
1105
1112
  if (existing.deleteRequestedAt === null) {
@@ -1170,8 +1177,10 @@ async function storeAttachment(args) {
1170
1177
  inserted = await args.db.db().insert(juniorAttachments).values({
1171
1178
  id,
1172
1179
  conversationId: args.conversationId,
1173
- provider: args.storage.provider,
1180
+ storageProvider: args.storage.provider,
1174
1181
  storageKey,
1182
+ provider: args.source?.provider,
1183
+ providerId: args.source?.id,
1175
1184
  filename: args.file.filename,
1176
1185
  contentType: args.file.mimeType,
1177
1186
  bytes: args.file.bytes,
@@ -1266,7 +1275,7 @@ async function readLiveAttachment(args) {
1266
1275
  deleteRequestedAt: juniorAttachments.deleteRequestedAt,
1267
1276
  filename: juniorAttachments.filename,
1268
1277
  id: juniorAttachments.id,
1269
- provider: juniorAttachments.provider,
1278
+ storageProvider: juniorAttachments.storageProvider,
1270
1279
  storageKey: juniorAttachments.storageKey
1271
1280
  }).from(juniorAttachments).where(
1272
1281
  and4(
@@ -1285,8 +1294,8 @@ async function readLiveAttachment(args) {
1285
1294
  conversationId: row.conversationId,
1286
1295
  filename: row.filename,
1287
1296
  id: row.id,
1288
- provider: row.provider,
1289
- storageKey: row.storageKey
1297
+ storageKey: row.storageKey,
1298
+ storageProvider: row.storageProvider
1290
1299
  };
1291
1300
  }
1292
1301
  async function storeAttachments(args) {
@@ -1314,20 +1323,18 @@ async function requestAttachmentDeletion(db, conversationIds, nowMs) {
1314
1323
  );
1315
1324
  }
1316
1325
  async function collectAttachmentGarbage(args) {
1317
- void args.nowMs;
1326
+ const expiresBefore = new Date(args.nowMs - ATTACHMENT_RETENTION_MS);
1318
1327
  const rows = await args.db.db().select({
1319
1328
  id: juniorAttachments.id,
1320
1329
  storageKey: juniorAttachments.storageKey
1321
1330
  }).from(juniorAttachments).innerJoin(
1322
1331
  juniorConversations,
1323
- eq3(
1324
- juniorAttachments.conversationId,
1325
- juniorConversations.conversationId
1326
- )
1332
+ eq3(juniorAttachments.conversationId, juniorConversations.conversationId)
1327
1333
  ).where(
1328
1334
  and4(
1329
- eq3(juniorAttachments.provider, args.storage.provider),
1335
+ eq3(juniorAttachments.storageProvider, args.storage.provider),
1330
1336
  or2(
1337
+ lte2(juniorAttachments.createdAt, expiresBefore),
1331
1338
  isNotNull(juniorAttachments.deleteRequestedAt),
1332
1339
  isNotNull(juniorConversations.transcriptPurgedAt)
1333
1340
  )
@@ -1337,10 +1344,7 @@ async function collectAttachmentGarbage(args) {
1337
1344
  await args.storage.delete(rows.map((row) => row.storageKey));
1338
1345
  const stillEligible = await args.db.db().select({ id: juniorAttachments.id }).from(juniorAttachments).innerJoin(
1339
1346
  juniorConversations,
1340
- eq3(
1341
- juniorAttachments.conversationId,
1342
- juniorConversations.conversationId
1343
- )
1347
+ eq3(juniorAttachments.conversationId, juniorConversations.conversationId)
1344
1348
  ).where(
1345
1349
  and4(
1346
1350
  inArray3(
@@ -1348,6 +1352,7 @@ async function collectAttachmentGarbage(args) {
1348
1352
  rows.map((row) => row.id)
1349
1353
  ),
1350
1354
  or2(
1355
+ lte2(juniorAttachments.createdAt, expiresBefore),
1351
1356
  isNotNull(juniorAttachments.deleteRequestedAt),
1352
1357
  isNotNull(juniorConversations.transcriptPurgedAt)
1353
1358
  )
@@ -1418,6 +1423,7 @@ export {
1418
1423
  saveScheduledTask,
1419
1424
  saveScheduledTaskInLock,
1420
1425
  listPublicScheduledTasksForTeams,
1426
+ storeAttachment,
1421
1427
  readLiveAttachment,
1422
1428
  storeAttachments,
1423
1429
  requestAttachmentDeletion,
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-JMRHEW6B.js";
8
+ } from "./chunk-M76HMB7M.js";
9
9
  import {
10
10
  juniorCodeChanges,
11
11
  juniorCodeRepositories,
@@ -16,7 +16,7 @@ import {
16
16
  juniorUsers,
17
17
  juniorWorkspaceRepos,
18
18
  juniorWorkspaces
19
- } from "./chunk-K2QYWZ7F.js";
19
+ } from "./chunk-PW4P4JYF.js";
20
20
  import {
21
21
  SANDBOX_WORKSPACE_ROOT,
22
22
  getVercelSandboxCredentials,
@@ -24,16 +24,16 @@ import {
24
24
  isSandboxMissingError,
25
25
  runNonInteractiveCommand,
26
26
  sleep
27
- } from "./chunk-OVHO76WN.js";
27
+ } from "./chunk-NSXKRGRT.js";
28
28
  import {
29
29
  getStateAdapter
30
- } from "./chunk-PMSENMWY.js";
30
+ } from "./chunk-2MK3QBGA.js";
31
31
  import {
32
32
  botConfig,
33
33
  completeObject,
34
34
  embedTexts,
35
35
  getSlackBotToken
36
- } from "./chunk-GFXDMDHR.js";
36
+ } from "./chunk-63NKKFJL.js";
37
37
  import {
38
38
  defaultModelId
39
39
  } from "./chunk-NHJU2ZAL.js";
@@ -52,7 +52,7 @@ import {
52
52
  setSpanAttributes,
53
53
  setSpanStatus,
54
54
  withSpan
55
- } from "./chunk-7DO36XLF.js";
55
+ } from "./chunk-MAGNK5J4.js";
56
56
 
57
57
  // src/chat/plugins/agent-hooks.ts
58
58
  import {
@@ -2923,6 +2923,19 @@ function getPluginRoutes(options) {
2923
2923
  },
2924
2924
  codeChanges: createCodeChangePublisher(pluginName),
2925
2925
  resourceEvents: {
2926
+ async hasMatch(event) {
2927
+ if (!options.resourceEvents.hasMatch) return false;
2928
+ const parsed = resourceEventInputSchema.parse(event);
2929
+ requirePublishedResourceEvent(plugin, parsed.eventType);
2930
+ return await options.resourceEvents.hasMatch({
2931
+ ...parsed,
2932
+ identifier: normalizeResourceEventIdentifier(
2933
+ plugin.resourceEvents,
2934
+ parsed.identifier
2935
+ ),
2936
+ namespace: pluginName
2937
+ });
2938
+ },
2926
2939
  async neededMatchKeys(input) {
2927
2940
  if (!options.resourceEvents.neededMatchKeys) return [];
2928
2941
  const identifiers = [
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-PIHLVU7T.js";
3
+ } from "./chunk-DL2KLKVH.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins,
7
7
  getSlackClient,
8
8
  withSlackRetries
9
- } from "./chunk-N5VHBUXF.js";
9
+ } from "./chunk-U2GPUYAL.js";
10
10
  import {
11
11
  getDb,
12
12
  parseDestination
13
- } from "./chunk-JMRHEW6B.js";
13
+ } from "./chunk-M76HMB7M.js";
14
14
  import {
15
15
  sleep
16
- } from "./chunk-OVHO76WN.js";
16
+ } from "./chunk-NSXKRGRT.js";
17
17
  import {
18
18
  acquireActiveLock,
19
19
  getStateAdapter
20
- } from "./chunk-PMSENMWY.js";
20
+ } from "./chunk-2MK3QBGA.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-5VRPXF4T.js";
23
+ } from "./chunk-YDUR3ZYW.js";
24
24
  import {
25
25
  fetchWithBoundedOAuthErrorBodies
26
- } from "./chunk-5Q6KP6LH.js";
26
+ } from "./chunk-BXCX5QKA.js";
27
27
  import {
28
28
  isRecord
29
- } from "./chunk-7DO36XLF.js";
29
+ } from "./chunk-MAGNK5J4.js";
30
30
 
31
31
  // src/chat/capabilities/router.ts
32
32
  var ProviderCredentialRouter = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-5Q6KP6LH.js";
3
+ } from "./chunk-BXCX5QKA.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
package/dist/cli/chat.js CHANGED
@@ -1,53 +1,53 @@
1
1
  import {
2
2
  executeAgentRun
3
- } from "../chunk-X2Q4H6JQ.js";
4
- import "../chunk-VLBLCJXK.js";
3
+ } from "../chunk-LOOU2DUR.js";
4
+ import "../chunk-QB54UQUS.js";
5
5
  import "../chunk-6Y5B5PEX.js";
6
6
  import "../chunk-DIB4GX3G.js";
7
- import "../chunk-22Y5SBDM.js";
7
+ import "../chunk-WQSHDTTI.js";
8
8
  import {
9
9
  createAgentRunner
10
- } from "../chunk-PIHLVU7T.js";
11
- import "../chunk-3WUBDFFL.js";
12
- import "../chunk-JLUCKXGI.js";
10
+ } from "../chunk-DL2KLKVH.js";
11
+ import "../chunk-ELWOYVOY.js";
12
+ import "../chunk-5PKWYPFT.js";
13
13
  import "../chunk-2LYHWMR4.js";
14
- import "../chunk-IAZBUDVU.js";
15
- import "../chunk-RG74Q34N.js";
16
- import "../chunk-UR43NMUR.js";
14
+ import "../chunk-TXJSXBV5.js";
15
+ import "../chunk-A76OIMYN.js";
16
+ import "../chunk-OWMPFXJA.js";
17
17
  import "../chunk-DA2KGZZI.js";
18
- import "../chunk-RDWWCDA4.js";
19
- import "../chunk-OIILBD56.js";
18
+ import "../chunk-7DHZP5KJ.js";
19
+ import "../chunk-LA6R4A7Q.js";
20
20
  import "../chunk-PDO5BLNM.js";
21
21
  import "../chunk-UIE3R5XU.js";
22
22
  import "../chunk-X6GDDWQH.js";
23
- import "../chunk-4Q5IR5GA.js";
23
+ import "../chunk-BD2KT3OB.js";
24
24
  import "../chunk-DKIJ2RP5.js";
25
25
  import "../chunk-JAL3CH4G.js";
26
26
  import "../chunk-7H2VZTWN.js";
27
27
  import {
28
28
  loadAppPluginSet
29
29
  } from "../chunk-Y2CM7HXH.js";
30
- import "../chunk-N5VHBUXF.js";
30
+ import "../chunk-U2GPUYAL.js";
31
31
  import "../chunk-3Y47VMHV.js";
32
- import "../chunk-JMRHEW6B.js";
33
- import "../chunk-K2QYWZ7F.js";
34
- import "../chunk-OVHO76WN.js";
35
- import "../chunk-PMSENMWY.js";
32
+ import "../chunk-M76HMB7M.js";
33
+ import "../chunk-PW4P4JYF.js";
34
+ import "../chunk-NSXKRGRT.js";
35
+ import "../chunk-2MK3QBGA.js";
36
36
  import "../chunk-7NL7T6VU.js";
37
37
  import "../chunk-VFUK3X5B.js";
38
- import "../chunk-GFXDMDHR.js";
38
+ import "../chunk-63NKKFJL.js";
39
39
  import "../chunk-NHJU2ZAL.js";
40
- import "../chunk-SY2RQ77O.js";
41
- import "../chunk-T6263C3N.js";
42
- import "../chunk-5VRPXF4T.js";
43
- import "../chunk-5Q6KP6LH.js";
40
+ import "../chunk-5NOPO64K.js";
41
+ import "../chunk-KHKKHDLD.js";
42
+ import "../chunk-YDUR3ZYW.js";
43
+ import "../chunk-BXCX5QKA.js";
44
44
  import "../chunk-CEMMLV5L.js";
45
45
  import "../chunk-N7TMSOZH.js";
46
46
  import "../chunk-DWPN6SCH.js";
47
47
  import "../chunk-TXKUKMVO.js";
48
- import "../chunk-7DO36XLF.js";
48
+ import "../chunk-MAGNK5J4.js";
49
49
  import "../chunk-PEQXYSSE.js";
50
- import "../chunk-OTTKTTVI.js";
50
+ import "../chunk-HMREVIO2.js";
51
51
 
52
52
  // src/cli/chat.ts
53
53
  import {
@@ -169,10 +169,10 @@ async function configureLocalChatPlugins(pluginSet) {
169
169
  databaseModule
170
170
  ] = await Promise.all([
171
171
  import("../plugins-YTYJMMJF.js"),
172
- import("../agent-hooks-6LGY2MBH.js"),
173
- import("../catalog-runtime-CIO3ERVQ.js"),
174
- import("../validation-YLALMVMB.js"),
175
- import("../db-SCTYCGQ5.js")
172
+ import("../agent-hooks-UXITLYOK.js"),
173
+ import("../catalog-runtime-BG3JLLK2.js"),
174
+ import("../validation-7MNQGCJA.js"),
175
+ import("../db-3L2MCVRI.js")
176
176
  ]);
177
177
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
178
178
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -238,14 +238,14 @@ async function prepareLocalChatRun(io, pluginSet) {
238
238
  await configureLocalChatPlugins(pluginSet);
239
239
  const { setExperimentalFeatures } = await import("../experimental-P5FZM4CU.js");
240
240
  setExperimentalFeatures({ subagents: true });
241
- const { runLocalAgentTurn } = await import("../runner-Z3EQSZ23.js");
242
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-QXKBXP5M.js");
241
+ const { runLocalAgentTurn } = await import("../runner-LQ7RETDP.js");
242
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-YVV6C6T2.js");
243
243
  const { createLocalOAuthState } = await import("../oauth-relay-5XPVRPYB.js");
244
244
  const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-FIL7EGPR.js");
245
- const { bindSpawnAgent } = await import("../spawn-WBEM46BW.js");
246
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-N6PUG4MY.js");
245
+ const { bindSpawnAgent } = await import("../spawn-RC6SJUAI.js");
246
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-COALHUCG.js");
247
247
  const { createLocalConversationWork } = await import("../conversation-work-VIOQ5ZF3.js");
248
- const { processConversationWork } = await import("../worker-M7464FAO.js");
248
+ const { processConversationWork } = await import("../worker-6MURZIPD.js");
249
249
  let agentRunner;
250
250
  const localConversationWork = createLocalConversationWork(async (message) => {
251
251
  if (!agentRunner) {