@sentry/junior 0.127.0 → 0.128.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 (112) hide show
  1. package/dist/{agent-hooks-HMCMFIIO.js → agent-hooks-F75ANGBV.js} +9 -9
  2. package/dist/api.js +23 -22
  3. package/dist/app.js +281 -138
  4. package/dist/{catalog-runtime-MI5UNBZ7.js → catalog-runtime-ZPSA5QM2.js} +6 -6
  5. package/dist/chat/agent-dispatch/context.d.ts +17 -0
  6. package/dist/chat/agent-dispatch/store.d.ts +1 -1
  7. package/dist/chat/agent-dispatch/work.d.ts +1 -1
  8. package/dist/chat/credentials/context.d.ts +27 -0
  9. package/dist/chat/credentials/subject.d.ts +15 -0
  10. package/dist/chat/event-tasks/ingest.d.ts +9 -0
  11. package/dist/chat/event-tasks/store.d.ts +15 -0
  12. package/dist/chat/event-tasks/tool-support.d.ts +140 -0
  13. package/dist/chat/event-tasks/types.d.ts +44 -0
  14. package/dist/chat/plugins/viewer.d.ts +16 -0
  15. package/dist/chat/resource-events/ingest.d.ts +1 -0
  16. package/dist/chat/resource-events/store.d.ts +2 -0
  17. package/dist/chat/resource-events/workspace.d.ts +4 -0
  18. package/dist/chat/sandbox/command-result.d.ts +3 -22
  19. package/dist/chat/sandbox/egress/schemas.d.ts +11 -0
  20. package/dist/chat/services/guardian-action-policy.d.ts +1 -1
  21. package/dist/chat/slack/dispatch-turn.d.ts +1 -1
  22. package/dist/chat/slack/tools/canvas/create.d.ts +0 -16
  23. package/dist/chat/slack/tools/canvas/edit.d.ts +0 -16
  24. package/dist/chat/slack/tools/canvas/read.d.ts +0 -16
  25. package/dist/chat/slack/tools/canvas/write.d.ts +0 -16
  26. package/dist/chat/slack/tools/channel-list-messages.d.ts +0 -16
  27. package/dist/chat/slack/tools/conversation-search.d.ts +0 -16
  28. package/dist/chat/slack/tools/list/add-items.d.ts +0 -16
  29. package/dist/chat/slack/tools/list/create.d.ts +0 -16
  30. package/dist/chat/slack/tools/list/get-items.d.ts +0 -16
  31. package/dist/chat/slack/tools/list/update-item.d.ts +0 -16
  32. package/dist/chat/slack/tools/message-add-reaction.d.ts +0 -16
  33. package/dist/chat/slack/tools/public-search.d.ts +0 -16
  34. package/dist/chat/slack/tools/send-files.d.ts +10 -28
  35. package/dist/chat/slack/tools/thread-read.d.ts +0 -16
  36. package/dist/chat/slack/tools/user-lookup.d.ts +0 -16
  37. package/dist/chat/tool-support/action-review.d.ts +1 -1
  38. package/dist/chat/tool-support/structured-result.d.ts +17 -46
  39. package/dist/chat/tool-support/text-range-result.d.ts +8 -32
  40. package/dist/chat/tool-support/zod-tool.d.ts +6 -7
  41. package/dist/chat/tools/create-event-task.d.ts +65 -0
  42. package/dist/chat/tools/definition.d.ts +4 -0
  43. package/dist/chat/tools/delete-event-task.d.ts +57 -0
  44. package/dist/chat/tools/event-tasks.d.ts +5 -0
  45. package/dist/chat/tools/handoff/tool.d.ts +0 -16
  46. package/dist/chat/tools/list-event-tasks.d.ts +55 -0
  47. package/dist/chat/tools/list-resource-event-subscriptions.d.ts +0 -38
  48. package/dist/chat/tools/query-conversation-events.d.ts +0 -16
  49. package/dist/chat/tools/runtime/report-progress.d.ts +0 -16
  50. package/dist/chat/tools/sandbox/edit-file.d.ts +0 -23
  51. package/dist/chat/tools/sandbox/file-utils.d.ts +2 -17
  52. package/dist/chat/tools/sandbox/find-files.d.ts +5 -8
  53. package/dist/chat/tools/sandbox/grep.d.ts +1 -4
  54. package/dist/chat/tools/sandbox/list-dir.d.ts +1 -4
  55. package/dist/chat/tools/search-resource-event-types.d.ts +0 -16
  56. package/dist/chat/tools/search-tools.d.ts +0 -16
  57. package/dist/chat/tools/skill/load-skill.d.ts +0 -20
  58. package/dist/chat/tools/skill/search-mcp-tools.d.ts +0 -16
  59. package/dist/chat/tools/stop-watching-resources.d.ts +0 -22
  60. package/dist/chat/tools/system-time.d.ts +0 -16
  61. package/dist/chat/tools/types.d.ts +8 -4
  62. package/dist/chat/tools/update-event-task.d.ts +66 -0
  63. package/dist/chat/tools/watch-resource-events.d.ts +0 -46
  64. package/dist/chat/tools/web/fetch-content.d.ts +0 -2
  65. package/dist/chat/tools/web/fetch-tool.d.ts +0 -16
  66. package/dist/chat/tools/web/image-generate.d.ts +0 -16
  67. package/dist/chat/tools/web/search.d.ts +0 -16
  68. package/dist/{chunk-YSOZT72W.js → chunk-2HTHX6XV.js} +4 -4
  69. package/dist/{chunk-NYVMPADK.js → chunk-3PKF6YNU.js} +1 -1
  70. package/dist/{chunk-UEMGGJZD.js → chunk-5KKIBIIP.js} +12 -12
  71. package/dist/{chunk-W3U3YQYI.js → chunk-77VDLF3Z.js} +18 -1
  72. package/dist/{chunk-TLMI3Q4Q.js → chunk-A76LKS5W.js} +199 -94
  73. package/dist/{chunk-AYICPT5T.js → chunk-B6E3YA2H.js} +1 -1
  74. package/dist/{chunk-PDG3BSOD.js → chunk-B7FPRGUJ.js} +3 -3
  75. package/dist/{chunk-JNYR4G7A.js → chunk-BY43CEXN.js} +2 -2
  76. package/dist/{chunk-HDSDCEPK.js → chunk-EPBBYMNE.js} +1 -1
  77. package/dist/{chunk-VHUMNUJL.js → chunk-FJEIX3AH.js} +2 -2
  78. package/dist/{chunk-SH7HDO2D.js → chunk-G6XQODHM.js} +1 -1
  79. package/dist/{chunk-WXP2ZXC7.js → chunk-HBFQLSGV.js} +4 -4
  80. package/dist/{chunk-C7AVHH3H.js → chunk-JDCPDJ54.js} +2 -2
  81. package/dist/{chunk-L7L7RYJM.js → chunk-K5ZB3WWH.js} +2 -2
  82. package/dist/{chunk-4H2NZPFJ.js → chunk-KNRODVH2.js} +6 -6
  83. package/dist/{chunk-JXQWTNDI.js → chunk-KTGJAWRO.js} +1 -1
  84. package/dist/{chunk-6DU2ZNF7.js → chunk-NHWE6Y7G.js} +7 -7
  85. package/dist/{chunk-FVIU6NQO.js → chunk-OLGB5Y7R.js} +2 -2
  86. package/dist/{chunk-2M6LYDTB.js → chunk-PBWUUVVG.js} +1 -1
  87. package/dist/{chunk-AKL3BAYJ.js → chunk-RYWMDDWK.js} +1 -1
  88. package/dist/{chunk-S4PUICSB.js → chunk-SHMHHXD5.js} +34 -5
  89. package/dist/{chunk-2N6EL22B.js → chunk-WZ365SQC.js} +1 -1
  90. package/dist/{chunk-Z5LLJNTL.js → chunk-YY6CVET7.js} +1116 -1083
  91. package/dist/{chunk-NK7QVIMJ.js → chunk-Z4KTQMWW.js} +1 -1
  92. package/dist/cli/chat.js +27 -27
  93. package/dist/cli/check.js +7 -7
  94. package/dist/cli/plugins.js +13 -13
  95. package/dist/cli/snapshot-create.js +10 -10
  96. package/dist/cli/upgrade.js +8 -8
  97. package/dist/db/schema/event-tasks.d.ts +161 -0
  98. package/dist/db/schema.d.ts +163 -1
  99. package/dist/{db-N4EY57ZJ.js → db-FYJYPAKG.js} +7 -7
  100. package/dist/instrumentation.js +4 -4
  101. package/dist/nitro.js +2 -2
  102. package/dist/{oauth-callback-server-O62UOQSS.js → oauth-callback-server-W3PPIHCS.js} +18 -18
  103. package/dist/{runner-SRHRD3NX.js → runner-5NOFUYKR.js} +11 -11
  104. package/dist/{sandbox-egress-signals-CDFAP67O.js → sandbox-egress-signals-A5HWIQH4.js} +2 -2
  105. package/dist/{skills-V6X3JVVA.js → skills-ENIBKF5V.js} +7 -7
  106. package/dist/{validation-ZZXZELGH.js → validation-BHLBOO6K.js} +7 -7
  107. package/dist/version.js +1 -1
  108. package/migrations/0015_magical_ezekiel_stane.sql +11 -0
  109. package/migrations/meta/0015_snapshot.json +1360 -0
  110. package/migrations/meta/_journal.json +7 -0
  111. package/package.json +6 -6
  112. package/dist/chat/plugins/viewer-actors.d.ts +0 -6
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  getConversationEventStore,
3
3
  getDb
4
- } from "./chunk-PDG3BSOD.js";
4
+ } from "./chunk-B7FPRGUJ.js";
5
5
  import {
6
6
  juniorConversationAnnotations,
7
7
  juniorConversationEvents,
8
8
  juniorIdentities,
9
9
  juniorUsers
10
- } from "./chunk-S4PUICSB.js";
10
+ } from "./chunk-SHMHHXD5.js";
11
11
  import {
12
12
  SANDBOX_WORKSPACE_ROOT,
13
13
  getStateAdapter,
14
14
  sleep
15
- } from "./chunk-SH7HDO2D.js";
15
+ } from "./chunk-G6XQODHM.js";
16
16
  import {
17
17
  botConfig,
18
18
  completeObject,
19
19
  embedTexts,
20
20
  getSlackBotToken,
21
21
  standardModelId
22
- } from "./chunk-L7L7RYJM.js";
22
+ } from "./chunk-K5ZB3WWH.js";
23
23
  import {
24
24
  isActorUserId,
25
25
  parseActorUserId
@@ -37,7 +37,7 @@ import {
37
37
  setSpanAttributes,
38
38
  setSpanStatus,
39
39
  withSpan
40
- } from "./chunk-AYICPT5T.js";
40
+ } from "./chunk-B6E3YA2H.js";
41
41
 
42
42
  // src/chat/plugins/agent-hooks.ts
43
43
  import {
@@ -424,88 +424,6 @@ function getDashboardConversationLink(conversationId) {
424
424
  return `${baseURL}${path}`;
425
425
  }
426
426
 
427
- // src/chat/slack/tools/context.ts
428
- function getSlackToolContext(context) {
429
- if (context.source.platform !== "slack") {
430
- return void 0;
431
- }
432
- if (context.destination.platform !== "slack") {
433
- throw new TypeError("Slack source requires a Slack destination");
434
- }
435
- const destinationChannelId = parseSlackChannelReferenceId(
436
- context.destination.channelId
437
- );
438
- const sourceChannelId = parseSlackChannelReferenceId(
439
- context.source.channelId
440
- );
441
- const teamId = parseSlackTeamId(context.source.teamId);
442
- if (!destinationChannelId || !sourceChannelId || !teamId) {
443
- return void 0;
444
- }
445
- return {
446
- destination: context.destination,
447
- source: context.source,
448
- actor: context.actor?.platform === "slack" ? context.actor : void 0,
449
- destinationChannelId,
450
- messageTs: parseSlackMessageTs(context.source.messageTs),
451
- sourceChannelId,
452
- teamId,
453
- threadTs: parseSlackMessageTs(context.source.threadTs)
454
- };
455
- }
456
-
457
- // src/chat/plugins/viewer-actors.ts
458
- import { and as and3, eq as eq3 } from "drizzle-orm";
459
- import {
460
- actorSchema
461
- } from "@sentry/junior-plugin-api";
462
- async function readViewerActorsFromSql(db, email) {
463
- const normalizedEmail = normalizeIdentityEmail(email);
464
- if (!normalizedEmail) return [];
465
- const rows = await db.select({
466
- displayName: juniorIdentities.displayName,
467
- email: juniorUsers.primaryEmail,
468
- handle: juniorIdentities.handle,
469
- provider: juniorIdentities.provider,
470
- providerSubjectId: juniorIdentities.providerSubjectId,
471
- providerTenantId: juniorIdentities.providerTenantId
472
- }).from(juniorIdentities).innerJoin(juniorUsers, eq3(juniorUsers.id, juniorIdentities.userId)).where(
473
- and3(
474
- eq3(juniorUsers.primaryEmailNormalized, normalizedEmail),
475
- eq3(juniorIdentities.kind, "user")
476
- )
477
- );
478
- const actors = [];
479
- for (const row of rows) {
480
- const candidate = row.provider === "slack" ? {
481
- platform: "slack",
482
- teamId: row.providerTenantId,
483
- userId: row.providerSubjectId,
484
- email: row.email,
485
- ...row.displayName ? { fullName: row.displayName } : {},
486
- ...row.handle ? { userName: row.handle } : {}
487
- } : row.provider === "local" ? {
488
- platform: "local",
489
- userId: row.providerSubjectId,
490
- email: row.email,
491
- ...row.displayName ? { fullName: row.displayName } : {},
492
- ...row.handle ? { userName: row.handle } : {}
493
- } : void 0;
494
- if (!candidate) continue;
495
- const parsed = actorSchema.safeParse(candidate);
496
- if (parsed.success && parsed.data.platform !== "system") {
497
- actors.push(parsed.data);
498
- }
499
- }
500
- return actors;
501
- }
502
- async function readViewerActors(email) {
503
- return await readViewerActorsFromSql(getDb(), email);
504
- }
505
-
506
- // src/chat/credentials/subject.ts
507
- import { createHmac, timingSafeEqual } from "crypto";
508
-
509
427
  // src/chat/slack/client.ts
510
428
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
511
429
  import { WebClient } from "@slack/web-api";
@@ -916,7 +834,138 @@ async function downloadPrivateSlackFile(url) {
916
834
  );
917
835
  }
918
836
 
837
+ // src/chat/resource-events/workspace.ts
838
+ function canRouteResourceEvents() {
839
+ return Boolean(getSlackBotToken());
840
+ }
841
+ function createResourceEventTeamIdResolver() {
842
+ let pending;
843
+ return async () => {
844
+ if (!canRouteResourceEvents()) return void 0;
845
+ pending ??= getSlackClient().auth.test().then((result) => {
846
+ const teamId = result.team_id?.trim();
847
+ if (!teamId) {
848
+ throw new Error("Slack auth.test did not return a workspace team id");
849
+ }
850
+ return teamId;
851
+ }).catch((error) => {
852
+ pending = void 0;
853
+ throw error;
854
+ });
855
+ return await pending;
856
+ };
857
+ }
858
+
859
+ // src/chat/slack/tools/context.ts
860
+ function getSlackToolContext(context) {
861
+ if (context.source.platform !== "slack") {
862
+ return void 0;
863
+ }
864
+ if (context.destination.platform !== "slack") {
865
+ throw new TypeError("Slack source requires a Slack destination");
866
+ }
867
+ const destinationChannelId = parseSlackChannelReferenceId(
868
+ context.destination.channelId
869
+ );
870
+ const sourceChannelId = parseSlackChannelReferenceId(
871
+ context.source.channelId
872
+ );
873
+ const teamId = parseSlackTeamId(context.source.teamId);
874
+ if (!destinationChannelId || !sourceChannelId || !teamId) {
875
+ return void 0;
876
+ }
877
+ return {
878
+ destination: context.destination,
879
+ source: context.source,
880
+ actor: context.actor?.platform === "slack" ? context.actor : void 0,
881
+ destinationChannelId,
882
+ messageTs: parseSlackMessageTs(context.source.messageTs),
883
+ sourceChannelId,
884
+ teamId,
885
+ threadTs: parseSlackMessageTs(context.source.threadTs)
886
+ };
887
+ }
888
+
889
+ // src/chat/plugins/viewer.ts
890
+ import { randomUUID } from "crypto";
891
+ import { and as and3, asc, eq as eq3 } from "drizzle-orm";
892
+ import {
893
+ identitySchema,
894
+ userSchema
895
+ } from "@sentry/junior-plugin-api";
896
+ function identityFromRow(row) {
897
+ return identitySchema.parse({
898
+ id: row.id,
899
+ provider: row.provider,
900
+ providerSubjectId: row.providerSubjectId,
901
+ ...row.providerTenantId ? { providerTenantId: row.providerTenantId } : {},
902
+ ...row.displayName ? { displayName: row.displayName } : {},
903
+ ...row.handle ? { handle: row.handle } : {}
904
+ });
905
+ }
906
+ async function readUserById(db, userRow) {
907
+ const identityRows = await db.select().from(juniorIdentities).where(
908
+ and3(
909
+ eq3(juniorIdentities.userId, userRow.id),
910
+ eq3(juniorIdentities.kind, "user")
911
+ )
912
+ ).orderBy(
913
+ asc(juniorIdentities.provider),
914
+ asc(juniorIdentities.providerTenantId),
915
+ asc(juniorIdentities.providerSubjectId)
916
+ );
917
+ return userSchema.parse({
918
+ email: userRow.primaryEmail,
919
+ id: userRow.id,
920
+ identities: identityRows.map(identityFromRow),
921
+ ...userRow.displayName ? { displayName: userRow.displayName } : {}
922
+ });
923
+ }
924
+ async function resolveViewerUserFromSql(db, email) {
925
+ const normalizedEmail = normalizeIdentityEmail(email);
926
+ if (!normalizedEmail) return void 0;
927
+ const now = /* @__PURE__ */ new Date();
928
+ const rows = await db.insert(juniorUsers).values({
929
+ id: randomUUID(),
930
+ primaryEmail: email.trim(),
931
+ primaryEmailNormalized: normalizedEmail,
932
+ displayName: null,
933
+ createdAt: now,
934
+ updatedAt: now
935
+ }).onConflictDoNothing({ target: juniorUsers.primaryEmailNormalized }).returning();
936
+ const userRow = rows[0] ?? (await db.select().from(juniorUsers).where(eq3(juniorUsers.primaryEmailNormalized, normalizedEmail)).limit(1))[0];
937
+ return userRow ? await readUserById(db, userRow) : void 0;
938
+ }
939
+ async function resolveViewerUser(email) {
940
+ return await resolveViewerUserFromSql(getDb(), email);
941
+ }
942
+ async function readActorIdentityFromSql(db, actor) {
943
+ if (actor.platform === "system") return void 0;
944
+ const providerTenantId = actor.platform === "slack" ? actor.teamId : "";
945
+ const rows = await db.select({
946
+ identity: juniorIdentities,
947
+ user: juniorUsers
948
+ }).from(juniorIdentities).leftJoin(juniorUsers, eq3(juniorUsers.id, juniorIdentities.userId)).where(
949
+ and3(
950
+ eq3(juniorIdentities.kind, "user"),
951
+ eq3(juniorIdentities.provider, actor.platform),
952
+ eq3(juniorIdentities.providerTenantId, providerTenantId),
953
+ eq3(juniorIdentities.providerSubjectId, actor.userId)
954
+ )
955
+ ).limit(1);
956
+ const row = rows[0];
957
+ if (!row) return void 0;
958
+ return {
959
+ identity: identityFromRow(row.identity),
960
+ ...row.user ? { user: await readUserById(db, row.user) } : {}
961
+ };
962
+ }
963
+ async function readActorIdentity(actor) {
964
+ return await readActorIdentityFromSql(getDb(), actor);
965
+ }
966
+
919
967
  // src/chat/credentials/subject.ts
968
+ import { createHmac, timingSafeEqual } from "crypto";
920
969
  var CREDENTIAL_SUBJECT_HMAC_CONTEXT = "junior.credential_subject.v1";
921
970
  var CREDENTIAL_SUBJECT_SIGNATURE_VERSION = "v1";
922
971
  function getCredentialSubjectSecret() {
@@ -1041,6 +1090,51 @@ function verifyScheduledTaskCredentialSubject(input) {
1041
1090
  );
1042
1091
  return timingSafeMatch(expected, binding.signature);
1043
1092
  }
1093
+ function bindEventTaskCredentialSubject(input) {
1094
+ const secret = getCredentialSubjectSecret();
1095
+ const plugin = input.plugin.trim();
1096
+ const userId = parseActorUserId(input.subject.userId);
1097
+ if (!secret || plugin !== "junior" || !userId || input.subject.allowedWhen !== "event-task") {
1098
+ return void 0;
1099
+ }
1100
+ const taskId = input.subject.taskId;
1101
+ if (!taskId || taskId !== taskId.trim()) {
1102
+ return void 0;
1103
+ }
1104
+ return {
1105
+ type: "user",
1106
+ userId,
1107
+ allowedWhen: "event-task",
1108
+ taskId,
1109
+ binding: {
1110
+ type: "event-task",
1111
+ plugin,
1112
+ taskId,
1113
+ signature: signPayload(
1114
+ secret,
1115
+ buildPayload(["event-task", plugin, taskId, userId])
1116
+ )
1117
+ }
1118
+ };
1119
+ }
1120
+ function verifyEventTaskCredentialSubject(input) {
1121
+ const secret = getCredentialSubjectSecret();
1122
+ const { subject } = input;
1123
+ const binding = subject.binding;
1124
+ if (!secret || input.plugin !== "junior" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "event-task" || !subject.taskId || binding.type !== "event-task" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) {
1125
+ return false;
1126
+ }
1127
+ const expected = signPayload(
1128
+ secret,
1129
+ buildPayload([
1130
+ "event-task",
1131
+ binding.plugin,
1132
+ binding.taskId,
1133
+ subject.userId
1134
+ ])
1135
+ );
1136
+ return timingSafeMatch(expected, binding.signature);
1137
+ }
1044
1138
 
1045
1139
  // src/chat/slack/tools/channel-capabilities.ts
1046
1140
  function resolveChannelCapabilities(channelId) {
@@ -1425,6 +1519,10 @@ function getPluginTools(context) {
1425
1519
  plugin: pluginName
1426
1520
  }) : void 0;
1427
1521
  const mcp = pluginMcpContext(plugin, context);
1522
+ const resourceEvents = {
1523
+ canSubscribe: context.source.platform === "slack" && canRouteResourceEvents()
1524
+ };
1525
+ const resolveActor = context.resolveActorIdentity ?? (async () => void 0);
1428
1526
  let pluginContext;
1429
1527
  if (context.source.platform === "slack") {
1430
1528
  if (context.destination.platform !== "slack") {
@@ -1445,7 +1543,9 @@ function getPluginTools(context) {
1445
1543
  egress: context.egress,
1446
1544
  ...mcp ? { mcp } : {},
1447
1545
  model: createPluginModel(pluginName, plugin.model),
1448
- state: createPluginState(pluginName)
1546
+ resourceEvents,
1547
+ state: createPluginState(pluginName),
1548
+ users: { resolveActor }
1449
1549
  };
1450
1550
  } else {
1451
1551
  if (context.destination.platform !== "local") {
@@ -1465,7 +1565,9 @@ function getPluginTools(context) {
1465
1565
  egress: context.egress,
1466
1566
  ...mcp ? { mcp } : {},
1467
1567
  model: createPluginModel(pluginName, plugin.model),
1468
- state: createPluginState(pluginName)
1568
+ resourceEvents,
1569
+ state: createPluginState(pluginName),
1570
+ users: { resolveActor }
1469
1571
  };
1470
1572
  }
1471
1573
  const pluginTools = hook(pluginContext);
@@ -1635,9 +1737,7 @@ function getPluginApiRoutes() {
1635
1737
  const app = hook({
1636
1738
  ...basePluginContext(plugin),
1637
1739
  eventStats: createPluginConversationEventStats(plugin),
1638
- viewer: {
1639
- actors: readViewerActors
1640
- }
1740
+ users: { resolve: resolveViewerUser }
1641
1741
  });
1642
1742
  if (app === void 0) {
1643
1743
  continue;
@@ -2106,8 +2206,6 @@ export {
2106
2206
  createPluginState,
2107
2207
  setDashboardConversationLinkOptions,
2108
2208
  getDashboardConversationLink,
2109
- getSlackToolContext,
2110
- readViewerActors,
2111
2209
  runWithWorkspaceTeamId,
2112
2210
  getWorkspaceTeamId,
2113
2211
  SlackActionError,
@@ -2120,10 +2218,17 @@ export {
2120
2218
  isConversationScopedChannel,
2121
2219
  getFilePermalink,
2122
2220
  downloadPrivateSlackFile,
2221
+ canRouteResourceEvents,
2222
+ createResourceEventTeamIdResolver,
2223
+ getSlackToolContext,
2224
+ resolveViewerUser,
2225
+ readActorIdentity,
2123
2226
  bindSlackDirectCredentialSubject,
2124
2227
  verifySlackDirectCredentialSubject,
2125
2228
  bindScheduledTaskCredentialSubject,
2126
2229
  verifyScheduledTaskCredentialSubject,
2230
+ bindEventTaskCredentialSubject,
2231
+ verifyEventTaskCredentialSubject,
2127
2232
  resolveChannelCapabilities,
2128
2233
  PluginHookDeniedError,
2129
2234
  validatePlugins,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6GWA276C.js";
10
10
  import {
11
11
  getDeploymentTelemetryAttributes
12
- } from "./chunk-AKL3BAYJ.js";
12
+ } from "./chunk-RYWMDDWK.js";
13
13
 
14
14
  // src/chat/logging.ts
15
15
  import path from "path";
@@ -4,12 +4,12 @@ import {
4
4
  juniorConversations,
5
5
  juniorIdentities,
6
6
  juniorUsers
7
- } from "./chunk-S4PUICSB.js";
7
+ } from "./chunk-SHMHHXD5.js";
8
8
  import {
9
9
  TURN_REASONING_LEVELS,
10
10
  getChatConfig,
11
11
  modelProfileSchema
12
- } from "./chunk-L7L7RYJM.js";
12
+ } from "./chunk-K5ZB3WWH.js";
13
13
  import {
14
14
  juniorDestinations
15
15
  } from "./chunk-VFUK3X5B.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-F3B2YJ76.js";
20
20
  import {
21
21
  normalizeIdentityEmail
22
- } from "./chunk-AYICPT5T.js";
22
+ } from "./chunk-B6E3YA2H.js";
23
23
 
24
24
  // src/chat/conversations/sql/store.ts
25
25
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-2N6EL22B.js";
3
+ } from "./chunk-WZ365SQC.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-AYICPT5T.js";
6
+ } from "./chunk-B6E3YA2H.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  credentialContextSchema
3
- } from "./chunk-W3U3YQYI.js";
3
+ } from "./chunk-77VDLF3Z.js";
4
4
 
5
5
  // src/chat/sandbox/egress/schemas.ts
6
6
  import { z } from "zod";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getDb
3
- } from "./chunk-PDG3BSOD.js";
3
+ } from "./chunk-B7FPRGUJ.js";
4
4
  import {
5
5
  juniorStats
6
- } from "./chunk-S4PUICSB.js";
6
+ } from "./chunk-SHMHHXD5.js";
7
7
 
8
8
  // src/stats.ts
9
9
  import { and, asc, gte, lte, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-L7L7RYJM.js";
3
+ } from "./chunk-K5ZB3WWH.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -16,17 +16,17 @@ import {
16
16
  instructionProvenanceFor,
17
17
  sanitizePostgresJson,
18
18
  withConversationEventLock
19
- } from "./chunk-PDG3BSOD.js";
19
+ } from "./chunk-B7FPRGUJ.js";
20
20
  import {
21
21
  getStateAdapter,
22
22
  sleep
23
- } from "./chunk-SH7HDO2D.js";
23
+ } from "./chunk-G6XQODHM.js";
24
24
  import {
25
25
  botConfig,
26
26
  escapeXml,
27
27
  resolveGatewayModel,
28
28
  unwrapCurrentInstruction
29
- } from "./chunk-L7L7RYJM.js";
29
+ } from "./chunk-K5ZB3WWH.js";
30
30
  import {
31
31
  toStoredSlackActor
32
32
  } from "./chunk-HZF5P5UN.js";
@@ -41,7 +41,7 @@ import {
41
41
  setSpanAttributes,
42
42
  toOptionalNumber,
43
43
  toOptionalString
44
- } from "./chunk-AYICPT5T.js";
44
+ } from "./chunk-B6E3YA2H.js";
45
45
 
46
46
  // src/chat/turn-context-tag.ts
47
47
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-UTL3MHPC.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-2M6LYDTB.js";
6
+ } from "./chunk-PBWUUVVG.js";
7
7
  import {
8
8
  normalizeSlackConversationId
9
- } from "./chunk-TLMI3Q4Q.js";
9
+ } from "./chunk-A76LKS5W.js";
10
10
 
11
11
  // src/handlers/health.ts
12
12
  function readHealthReport() {
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-NK7QVIMJ.js";
6
+ } from "./chunk-Z4KTQMWW.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-AYICPT5T.js";
14
+ } from "./chunk-B6E3YA2H.js";
15
15
 
16
16
  // src/chat/config.ts
17
17
  import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
@@ -22,7 +22,7 @@ import {
22
22
  persistThreadStateById,
23
23
  stripRuntimeTurnContext,
24
24
  updateConversationStats
25
- } from "./chunk-WXP2ZXC7.js";
25
+ } from "./chunk-HBFQLSGV.js";
26
26
  import {
27
27
  createPluginConversationEvents,
28
28
  createPluginEmbedder,
@@ -30,26 +30,26 @@ import {
30
30
  createPluginModel,
31
31
  createPluginState,
32
32
  getPlugins
33
- } from "./chunk-TLMI3Q4Q.js";
33
+ } from "./chunk-A76LKS5W.js";
34
34
  import {
35
35
  getDb,
36
36
  sameActorIdentity
37
- } from "./chunk-PDG3BSOD.js";
37
+ } from "./chunk-B7FPRGUJ.js";
38
38
  import {
39
39
  getStateAdapter
40
- } from "./chunk-SH7HDO2D.js";
40
+ } from "./chunk-G6XQODHM.js";
41
41
  import {
42
42
  ProviderError,
43
43
  findProviderError,
44
44
  getProviderErrorAttributes,
45
45
  getProviderErrorUserMessage
46
- } from "./chunk-L7L7RYJM.js";
46
+ } from "./chunk-K5ZB3WWH.js";
47
47
  import {
48
48
  parseSlackMessageTs
49
49
  } from "./chunk-F3B2YJ76.js";
50
50
  import {
51
51
  buildTurnFailureResponse
52
- } from "./chunk-AYICPT5T.js";
52
+ } from "./chunk-B6E3YA2H.js";
53
53
 
54
54
  // src/chat/runtime/delivered-turn-state.ts
55
55
  function buildDeliveredTurnStatePatch(args) {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.127.0",
4
+ version: "0.128.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -6,25 +6,25 @@ import {
6
6
  isDmChannel,
7
7
  normalizeSlackConversationId,
8
8
  withSlackRetries
9
- } from "./chunk-TLMI3Q4Q.js";
9
+ } from "./chunk-A76LKS5W.js";
10
10
  import {
11
11
  getDb,
12
12
  parseDestination
13
- } from "./chunk-PDG3BSOD.js";
13
+ } from "./chunk-B7FPRGUJ.js";
14
14
  import {
15
15
  acquireActiveLock,
16
16
  getStateAdapter,
17
17
  sleep
18
- } from "./chunk-SH7HDO2D.js";
18
+ } from "./chunk-G6XQODHM.js";
19
19
  import {
20
20
  normalizeSlackEmojiName
21
- } from "./chunk-L7L7RYJM.js";
21
+ } from "./chunk-K5ZB3WWH.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-2N6EL22B.js";
24
+ } from "./chunk-WZ365SQC.js";
25
25
  import {
26
26
  fetchWithBoundedOAuthErrorBodies
27
- } from "./chunk-FVIU6NQO.js";
27
+ } from "./chunk-OLGB5Y7R.js";
28
28
  import {
29
29
  parseSlackMessageTs,
30
30
  parseSlackUserId
@@ -33,7 +33,7 @@ import {
33
33
  isRecord,
34
34
  logInfo,
35
35
  logWarn
36
- } from "./chunk-AYICPT5T.js";
36
+ } from "./chunk-B6E3YA2H.js";
37
37
 
38
38
  // src/chat/capabilities/router.ts
39
39
  var ProviderCredentialRouter = class {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  credentialUserSubjectId
3
- } from "./chunk-W3U3YQYI.js";
3
+ } from "./chunk-77VDLF3Z.js";
4
4
  import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-AYICPT5T.js";
8
+ } from "./chunk-B6E3YA2H.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-F3B2YJ76.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-AYICPT5T.js";
8
+ } from "./chunk-B6E3YA2H.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-JXQWTNDI.js";
3
+ } from "./chunk-KTGJAWRO.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";