@sentry/junior 0.169.0 → 0.170.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 (64) hide show
  1. package/dist/{agent-hooks-YGKANST4.js → agent-hooks-IPUNCZPZ.js} +10 -10
  2. package/dist/api.js +27 -27
  3. package/dist/app.js +34 -34
  4. package/dist/catalog-runtime-E6XHWRPG.js +16 -0
  5. package/dist/chat/conversations/sql/store.d.ts +7 -0
  6. package/dist/chat/conversations/store.d.ts +14 -0
  7. package/dist/chat/slack/channel.d.ts +0 -13
  8. package/dist/chat/slack/ids.d.ts +7 -1
  9. package/dist/chat/slack/tool-support/channel-target.d.ts +6 -5
  10. package/dist/{chunk-7RIHHVFN.js → chunk-2XI6OLXA.js} +11 -11
  11. package/dist/{chunk-VRMPMOAT.js → chunk-3SFZJVX5.js} +2 -2
  12. package/dist/{chunk-URM4KBIU.js → chunk-47GJ7QRO.js} +1 -1
  13. package/dist/{chunk-EPXPE5Y5.js → chunk-4PSUCN4P.js} +2 -2
  14. package/dist/{chunk-FSH6HT5C.js → chunk-5EPG7PYS.js} +1 -1
  15. package/dist/{chunk-TMZOUVEP.js → chunk-6E4WQV75.js} +1 -1
  16. package/dist/{chunk-HWXQZCKV.js → chunk-6GOKKLWF.js} +7 -7
  17. package/dist/{chunk-MKEHLCSM.js → chunk-6W2UIZSA.js} +1 -1
  18. package/dist/{chunk-7MA4HV4W.js → chunk-6ZWRNC4D.js} +1 -1
  19. package/dist/{chunk-N7V2WPZV.js → chunk-74XMBKRI.js} +1 -1
  20. package/dist/{chunk-ZXCVYSTS.js → chunk-7TVGQZOH.js} +5 -5
  21. package/dist/{chunk-JNK444WM.js → chunk-A22DGDXT.js} +2 -2
  22. package/dist/{chunk-Q62IHFIH.js → chunk-B53NR3XY.js} +4 -4
  23. package/dist/{chunk-YTVYU5IF.js → chunk-BW644E3V.js} +1 -1
  24. package/dist/{chunk-VVQYG2GD.js → chunk-CA6JIB7S.js} +59 -96
  25. package/dist/{chunk-BDUENQD3.js → chunk-CGA4ERJ5.js} +1 -1
  26. package/dist/{chunk-MPLBAWGP.js → chunk-E7HKIHI5.js} +2 -2
  27. package/dist/{chunk-EEKFF74Y.js → chunk-F3I6YFB4.js} +6 -6
  28. package/dist/{chunk-5OUQCD2J.js → chunk-F4UM52UH.js} +1 -1
  29. package/dist/{chunk-5Z7QQYHV.js → chunk-FKOLWEMX.js} +7 -7
  30. package/dist/{chunk-ECBD46QI.js → chunk-HZALSYOW.js} +5 -5
  31. package/dist/{chunk-WF3WTELH.js → chunk-IF3OK4XO.js} +6 -6
  32. package/dist/{chunk-JJUZK6P2.js → chunk-IJTFG6AK.js} +5 -5
  33. package/dist/{chunk-FIMO3IDW.js → chunk-IX7VHMIJ.js} +32 -4
  34. package/dist/{chunk-S6JDUILF.js → chunk-KQCHIOME.js} +7 -7
  35. package/dist/{chunk-V7YE4WCP.js → chunk-M63DETLL.js} +7 -4
  36. package/dist/{chunk-BOZCSRAR.js → chunk-NESGW5HV.js} +1 -1
  37. package/dist/{chunk-WYNLAO2K.js → chunk-NFERKIUX.js} +4 -4
  38. package/dist/{chunk-23IKSW3E.js → chunk-NGL4XFT2.js} +1 -1
  39. package/dist/{chunk-OU2DMDUI.js → chunk-T4SEUU7A.js} +1 -1
  40. package/dist/{chunk-73XNLM4O.js → chunk-TX553KXA.js} +5 -5
  41. package/dist/{chunk-2VK3CYSL.js → chunk-UD4BNNM2.js} +1 -1
  42. package/dist/{chunk-65QX23BY.js → chunk-UHW5RAIB.js} +13 -13
  43. package/dist/{chunk-ELOZI777.js → chunk-YWX7D7BJ.js} +18 -18
  44. package/dist/cli/chat.js +33 -33
  45. package/dist/cli/check.js +8 -8
  46. package/dist/cli/plugins.js +14 -14
  47. package/dist/cli/snapshot-create.js +11 -11
  48. package/dist/cli/upgrade.js +9 -9
  49. package/dist/{db-CA3AJ2BU.js → db-WMSEGSFM.js} +8 -8
  50. package/dist/instrumentation.js +4 -4
  51. package/dist/nitro.js +2 -2
  52. package/dist/{oauth-callback-server-JVWWSDT5.js → oauth-callback-server-GBS47NTO.js} +24 -24
  53. package/dist/{runner-CMDQJDCH.js → runner-V2A2Z7K3.js} +14 -14
  54. package/dist/{sandbox-egress-signals-U3ZX7C5W.js → sandbox-egress-signals-DXOOBSBI.js} +3 -3
  55. package/dist/{skills-GYJ4MBNQ.js → skills-Z35YXLUG.js} +8 -8
  56. package/dist/spawn-AKPJBUS2.js +37 -0
  57. package/dist/{validation-55EBPZHH.js → validation-EQCK4DA5.js} +8 -8
  58. package/dist/version.js +1 -1
  59. package/dist/{work-N7CBTARL.js → work-XIANCABO.js} +20 -20
  60. package/dist/worker-YALLEN2Z.js +24 -0
  61. package/package.json +4 -4
  62. package/dist/catalog-runtime-BFDMFZV4.js +0 -16
  63. package/dist/spawn-KSP4DKK6.js +0 -37
  64. package/dist/worker-CGMUVQ2Q.js +0 -24
@@ -5,28 +5,28 @@ import {
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId,
7
7
  withSlackRetries
8
- } from "./chunk-EEKFF74Y.js";
8
+ } from "./chunk-F3I6YFB4.js";
9
9
  import {
10
10
  parseDestination
11
- } from "./chunk-FIMO3IDW.js";
11
+ } from "./chunk-IX7VHMIJ.js";
12
12
  import {
13
13
  getStateAdapter
14
- } from "./chunk-N7V2WPZV.js";
14
+ } from "./chunk-74XMBKRI.js";
15
15
  import {
16
16
  normalizeSlackEmojiName
17
- } from "./chunk-MPLBAWGP.js";
17
+ } from "./chunk-E7HKIHI5.js";
18
18
  import {
19
19
  pluginCatalogRuntime
20
- } from "./chunk-TMZOUVEP.js";
20
+ } from "./chunk-6E4WQV75.js";
21
21
  import {
22
22
  parseSlackMessageTs,
23
23
  parseSlackUserId
24
- } from "./chunk-V7YE4WCP.js";
24
+ } from "./chunk-M63DETLL.js";
25
25
  import {
26
26
  isRecord,
27
27
  logInfo,
28
28
  logWarn
29
- } from "./chunk-FSH6HT5C.js";
29
+ } from "./chunk-5EPG7PYS.js";
30
30
 
31
31
  // src/chat/slack/outbound.ts
32
32
  var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-MPLBAWGP.js";
3
+ } from "./chunk-E7HKIHI5.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  credentialContextSchema
3
- } from "./chunk-BDUENQD3.js";
3
+ } from "./chunk-CGA4ERJ5.js";
4
4
 
5
5
  // src/chat/sandbox/egress/schemas.ts
6
6
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-MPLBAWGP.js";
3
+ } from "./chunk-E7HKIHI5.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -8,22 +8,22 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-FIMO3IDW.js";
11
+ } from "./chunk-IX7VHMIJ.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-N7V2WPZV.js";
15
+ } from "./chunk-74XMBKRI.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-MPLBAWGP.js";
18
+ } from "./chunk-E7HKIHI5.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
- } from "./chunk-V7YE4WCP.js";
21
+ } from "./chunk-M63DETLL.js";
22
22
  import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-FSH6HT5C.js";
26
+ } from "./chunk-5EPG7PYS.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  credentialUserSubjectId
3
- } from "./chunk-BDUENQD3.js";
3
+ } from "./chunk-CGA4ERJ5.js";
4
4
  import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-FSH6HT5C.js";
8
+ } from "./chunk-5EPG7PYS.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -5,18 +5,18 @@ import {
5
5
  } from "./chunk-BVREIWBD.js";
6
6
  import {
7
7
  getStateAdapter
8
- } from "./chunk-N7V2WPZV.js";
8
+ } from "./chunk-74XMBKRI.js";
9
9
  import {
10
10
  toOptionalTrimmed
11
- } from "./chunk-MPLBAWGP.js";
11
+ } from "./chunk-E7HKIHI5.js";
12
12
  import {
13
13
  pluginCatalogRuntime
14
- } from "./chunk-TMZOUVEP.js";
14
+ } from "./chunk-6E4WQV75.js";
15
15
  import {
16
16
  setSpanAttributes,
17
17
  setSpanStatus,
18
18
  withSpan
19
- } from "./chunk-FSH6HT5C.js";
19
+ } from "./chunk-5EPG7PYS.js";
20
20
 
21
21
  // src/chat/sandbox/resources.ts
22
22
  var configuredResources;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-5OUQCD2J.js";
3
+ } from "./chunk-F4UM52UH.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-5Z7QQYHV.js";
10
+ } from "./chunk-FKOLWEMX.js";
11
11
  import {
12
12
  authorizationId
13
13
  } from "./chunk-DIB4GX3G.js";
@@ -32,7 +32,7 @@ import {
32
32
  searchSlackUsers,
33
33
  selectPluginGrant,
34
34
  toMcpProviderError
35
- } from "./chunk-S6JDUILF.js";
35
+ } from "./chunk-KQCHIOME.js";
36
36
  import {
37
37
  RetryableDeliveryError,
38
38
  actorFromRun,
@@ -48,13 +48,13 @@ import {
48
48
  getSlackMessagePermalink,
49
49
  resolveBaseUrl,
50
50
  uploadFilesToConversation
51
- } from "./chunk-HWXQZCKV.js";
51
+ } from "./chunk-6GOKKLWF.js";
52
52
  import {
53
53
  parseSandboxEgressAuthRequiredSignal,
54
54
  parseSandboxEgressPermissionDeniedSignal,
55
55
  sandboxEgressCredentialContextSchema,
56
56
  sandboxEgressCredentialLeaseSchema
57
- } from "./chunk-7MA4HV4W.js";
57
+ } from "./chunk-6ZWRNC4D.js";
58
58
  import {
59
59
  SANDBOX_RUNTIME,
60
60
  SCHEDULED_TASK_SYSTEM_ACTOR,
@@ -88,10 +88,10 @@ import {
88
88
  scheduledTaskAttributes,
89
89
  storeAttachments,
90
90
  writableEventTask
91
- } from "./chunk-JJUZK6P2.js";
91
+ } from "./chunk-IJTFG6AK.js";
92
92
  import {
93
93
  parseSlackThreadId
94
- } from "./chunk-EPXPE5Y5.js";
94
+ } from "./chunk-4PSUCN4P.js";
95
95
  import {
96
96
  AGENTS_REMOVAL_NOTICE,
97
97
  AGENTS_REPLACEMENT_NOTICE,
@@ -162,7 +162,7 @@ import {
162
162
  stripRuntimeTurnContext,
163
163
  trimTrailingAssistantMessages,
164
164
  truncateText
165
- } from "./chunk-ECBD46QI.js";
165
+ } from "./chunk-HZALSYOW.js";
166
166
  import {
167
167
  JUNIOR_THREAD_STATE_TTL_MS
168
168
  } from "./chunk-3Y47VMHV.js";
@@ -183,7 +183,7 @@ import {
183
183
  stopSession,
184
184
  throwSandboxOperationError,
185
185
  wrapSandboxSetupError
186
- } from "./chunk-Q62IHFIH.js";
186
+ } from "./chunk-B53NR3XY.js";
187
187
  import {
188
188
  privateTraceResultAttributes
189
189
  } from "./chunk-UIE3R5XU.js";
@@ -214,7 +214,7 @@ import {
214
214
  updateWorkspace,
215
215
  withSlackRetries,
216
216
  workspaceRepoCheckoutPath
217
- } from "./chunk-EEKFF74Y.js";
217
+ } from "./chunk-F3I6YFB4.js";
218
218
  import {
219
219
  KNOWN_CONVERSATION_EVENT_TYPES,
220
220
  contextProvenance,
@@ -226,11 +226,11 @@ import {
226
226
  instructionActors,
227
227
  instructionProvenanceFor,
228
228
  sameActorIdentity
229
- } from "./chunk-FIMO3IDW.js";
229
+ } from "./chunk-IX7VHMIJ.js";
230
230
  import {
231
231
  juniorArtifacts,
232
232
  juniorIdentities
233
- } from "./chunk-MKEHLCSM.js";
233
+ } from "./chunk-6W2UIZSA.js";
234
234
  import {
235
235
  SANDBOX_DATA_ROOT,
236
236
  SANDBOX_REPOS_ROOT,
@@ -246,7 +246,7 @@ import {
246
246
  } from "./chunk-BVREIWBD.js";
247
247
  import {
248
248
  getStateAdapter
249
- } from "./chunk-N7V2WPZV.js";
249
+ } from "./chunk-74XMBKRI.js";
250
250
  import {
251
251
  ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
252
252
  COMPACTION_SUMMARY_PREFIX,
@@ -279,7 +279,7 @@ import {
279
279
  resolveGatewayCredential,
280
280
  resolveGatewayModel,
281
281
  unwrapCurrentInstruction
282
- } from "./chunk-MPLBAWGP.js";
282
+ } from "./chunk-E7HKIHI5.js";
283
283
  import {
284
284
  canExposeConversationPayload,
285
285
  resolveConversationPrivacy,
@@ -289,16 +289,16 @@ import {
289
289
  toGenAiMessagesTraceAttributes,
290
290
  toGenAiPayloadMetadata,
291
291
  toGenAiPayloadTraceAttributes
292
- } from "./chunk-23IKSW3E.js";
292
+ } from "./chunk-NGL4XFT2.js";
293
293
  import {
294
294
  discoverSkills,
295
295
  findSkillByName,
296
296
  loadSkillsByName,
297
297
  parseSkillInvocation
298
- } from "./chunk-VRMPMOAT.js";
298
+ } from "./chunk-3SFZJVX5.js";
299
299
  import {
300
300
  pluginCatalogRuntime
301
- } from "./chunk-TMZOUVEP.js";
301
+ } from "./chunk-6E4WQV75.js";
302
302
  import {
303
303
  CredentialUnavailableError,
304
304
  OAuthProviderError,
@@ -306,16 +306,18 @@ import {
306
306
  getOAuthProviderErrorAttributes,
307
307
  resolveAuthTokenPlaceholder,
308
308
  resolvePluginCommandEnv
309
- } from "./chunk-JNK444WM.js";
309
+ } from "./chunk-A22DGDXT.js";
310
310
  import {
311
311
  credentialUserSubjectId
312
- } from "./chunk-BDUENQD3.js";
312
+ } from "./chunk-CGA4ERJ5.js";
313
313
  import {
314
314
  isUserActor,
315
315
  parseSlackChannelId,
316
+ parseSlackChannelReferenceId,
316
317
  parseSlackMessageTs,
318
+ parseSlackTeamId,
317
319
  parseSlackUserId
318
- } from "./chunk-V7YE4WCP.js";
320
+ } from "./chunk-M63DETLL.js";
319
321
  import {
320
322
  extractGenAiUsageAttributes,
321
323
  extractGenAiUsageSummary,
@@ -334,7 +336,7 @@ import {
334
336
  summarizeMessageText,
335
337
  withLogContext,
336
338
  withSpan
337
- } from "./chunk-FSH6HT5C.js";
339
+ } from "./chunk-5EPG7PYS.js";
338
340
  import {
339
341
  startInactiveSpan,
340
342
  withActiveSpan
@@ -9661,58 +9663,6 @@ async function joinPublicChannel(channelId) {
9661
9663
  { action: "conversations.join", idempotent: true }
9662
9664
  );
9663
9665
  }
9664
- async function listPublicChannels(input = {}) {
9665
- const client = getSlackClient();
9666
- const targetLimit = Math.max(1, Math.min(input.limit ?? 1e3, 1e3));
9667
- const maxPages = Math.max(1, Math.min(input.maxPages ?? 10, 20));
9668
- const channels = [];
9669
- let cursor;
9670
- let pages = 0;
9671
- while (channels.length < targetLimit && pages < maxPages) {
9672
- pages += 1;
9673
- const pageLimit = Math.max(1, Math.min(200, targetLimit - channels.length));
9674
- const response = await withSlackRetries(
9675
- () => client.conversations.list({
9676
- types: "public_channel",
9677
- exclude_archived: true,
9678
- limit: pageLimit,
9679
- cursor
9680
- }),
9681
- 3,
9682
- { action: "conversations.list", idempotent: true }
9683
- );
9684
- const batch = response.channels ?? [];
9685
- for (const item of batch) {
9686
- if (typeof item.id !== "string" || !item.id) {
9687
- continue;
9688
- }
9689
- if (item.is_private === true) {
9690
- continue;
9691
- }
9692
- channels.push({
9693
- id: item.id,
9694
- ...typeof item.name === "string" && item.name ? { name: item.name } : {},
9695
- ...typeof item.is_member === "boolean" ? { isMember: item.is_member } : {},
9696
- ...typeof item.is_archived === "boolean" ? { isArchived: item.is_archived } : {}
9697
- });
9698
- }
9699
- cursor = response.response_metadata?.next_cursor || void 0;
9700
- if (!cursor) {
9701
- break;
9702
- }
9703
- }
9704
- return channels.slice(0, targetLimit);
9705
- }
9706
- async function resolvePublicChannelByName(channelName) {
9707
- const normalized = channelName.trim().replace(/^#/, "").toLowerCase();
9708
- if (!normalized) {
9709
- return void 0;
9710
- }
9711
- const channels = await listPublicChannels();
9712
- return channels.find(
9713
- (channel) => channel.name?.trim().toLowerCase() === normalized
9714
- );
9715
- }
9716
9666
 
9717
9667
  // src/chat/slack/tool-support/channel-access.ts
9718
9668
  var DENIED_PRIVATE = "Cannot read this Slack conversation because it is private. Only the current conversation or public channels are readable.";
@@ -9806,44 +9756,47 @@ async function joinPublicChannelForRead(args) {
9806
9756
 
9807
9757
  // src/chat/slack/tool-support/channel-target.ts
9808
9758
  import { z as z35 } from "zod";
9809
- var slackChannelRefParam = z35.string().trim().min(1).max(80).describe("Slack channel ID or public channel name.");
9759
+ var SLACK_CHANNEL_REF_MAX_LENGTH = 160;
9760
+ var slackChannelRefParam = z35.string().trim().min(1).max(SLACK_CHANNEL_REF_MAX_LENGTH).describe(
9761
+ "Slack channel id (`C123`), mention (`<#C123>` / `<#C123|name>`), Junior slack reference (`slack:C123`), or a channel name Junior already knows in this workspace."
9762
+ );
9810
9763
  async function resolveSlackChannelRef(input) {
9811
9764
  const trimmed = input.value.trim();
9812
9765
  if (!trimmed) {
9813
9766
  throw new ToolInputError(
9814
- `Invalid \`${input.field}\`. Provide a Slack channel id like \`C123\` or a public channel name like \`#proj-foo\`.`
9767
+ `Invalid \`${input.field}\`. Use a channel id (\`C123\`), a Slack mention (\`<#C123>\`), a Junior slack reference (\`slack:C123\`), or a channel name Junior already knows.`
9815
9768
  );
9816
9769
  }
9817
- const channelId = parseSlackChannelId(trimmed);
9770
+ const channelId = parseSlackChannelReferenceId(trimmed);
9818
9771
  if (channelId) {
9772
+ return { channelId };
9773
+ }
9774
+ const known = await getConversationStore().findSlackDestinationByName({
9775
+ teamId: input.teamId,
9776
+ channelName: trimmed
9777
+ });
9778
+ const knownChannelId = known ? parseSlackChannelId(known.channelId) : void 0;
9779
+ if (known && knownChannelId) {
9819
9780
  return {
9820
- channelId,
9821
- resolvedFromName: false
9781
+ channelId: knownChannelId,
9782
+ ...known.channelName ? { channelName: known.channelName } : {}
9822
9783
  };
9823
9784
  }
9824
- const match = await resolvePublicChannelByName(trimmed);
9825
- if (!match) {
9826
- throw new ToolInputError(
9827
- `No public Slack channel named \`${trimmed}\` was found. Use an exact public channel name or a channel id.`
9828
- );
9829
- }
9830
- return {
9831
- channelId: match.id,
9832
- ...match.name ? { channelName: match.name } : {},
9833
- resolvedFromName: true
9834
- };
9785
+ throw new ToolInputError(
9786
+ `Unknown \`${input.field}\` \`${trimmed}\`. Use a channel id (\`C123\`), a Slack mention (\`<#C123>\`), a link, or a channel name Junior has already seen in this workspace. Public search can discover channels; plain names are not scanned from Slack.`
9787
+ );
9835
9788
  }
9836
9789
  async function resolveOptionalSlackChannelRef(input) {
9837
9790
  if (input.value !== void 0) {
9838
9791
  return resolveSlackChannelRef({
9839
9792
  field: input.field ?? "channel_id",
9840
- value: input.value
9793
+ value: input.value,
9794
+ teamId: input.teamId
9841
9795
  });
9842
9796
  }
9843
9797
  if (input.defaultChannelId) {
9844
9798
  return {
9845
- channelId: input.defaultChannelId,
9846
- resolvedFromName: false
9799
+ channelId: input.defaultChannelId
9847
9800
  };
9848
9801
  }
9849
9802
  throw new ToolInputError(
@@ -9869,7 +9822,8 @@ function createSlackChannelJoinTool(context) {
9869
9822
  execute: async ({ channel_id }) => {
9870
9823
  const target = await resolveSlackChannelRef({
9871
9824
  field: "channel_id",
9872
- value: channel_id
9825
+ value: channel_id,
9826
+ teamId: context.teamId
9873
9827
  });
9874
9828
  const access = await checkSlackChannelReadAccess({
9875
9829
  currentChannelIds: [
@@ -10013,7 +9967,8 @@ function createSlackChannelListMessagesTool(context) {
10013
9967
  const target = await resolveOptionalSlackChannelRef({
10014
9968
  field: "channel_id",
10015
9969
  value: channel_id,
10016
- defaultChannelId: context.destinationChannelId
9970
+ defaultChannelId: context.destinationChannelId,
9971
+ teamId: context.teamId
10017
9972
  });
10018
9973
  const targetChannelId = target.channelId;
10019
9974
  const access = await checkSlackChannelReadAccess({
@@ -10171,7 +10126,8 @@ async function resolveSearchFilters(input) {
10171
10126
  if (input.channel_id != null && input.channel_id.trim() !== "") {
10172
10127
  const target = await resolveSlackChannelRef({
10173
10128
  field: "channel_id",
10174
- value: input.channel_id
10129
+ value: input.channel_id,
10130
+ teamId: input.teamId
10175
10131
  });
10176
10132
  channelId = target.channelId;
10177
10133
  }
@@ -10216,7 +10172,13 @@ function createSlackConversationMessageSearchTool(scope, currentConversationId)
10216
10172
  }).strict(),
10217
10173
  outputSchema: conversationMessageSearchOutputSchema,
10218
10174
  execute: async (input) => {
10219
- const filters = await resolveSearchFilters(input);
10175
+ const teamId = parseSlackTeamId(scope.providerTenantId);
10176
+ if (!teamId) {
10177
+ throw new ToolInputError(
10178
+ "Cannot search retained messages without a valid Slack workspace id."
10179
+ );
10180
+ }
10181
+ const filters = await resolveSearchFilters({ ...input, teamId });
10220
10182
  const store = getConversationMessageSearchStore();
10221
10183
  const matches = await store.search({
10222
10184
  currentConversationId,
@@ -12093,7 +12055,8 @@ function createSlackThreadReadTool(context) {
12093
12055
  }
12094
12056
  const target = await resolveSlackChannelRef({
12095
12057
  field: "channel_id",
12096
- value: channel_id
12058
+ value: channel_id,
12059
+ teamId: context.teamId
12097
12060
  });
12098
12061
  channelId = target.channelId;
12099
12062
  messageTs = parsedTs.value;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseActorUserId
3
- } from "./chunk-V7YE4WCP.js";
3
+ } from "./chunk-M63DETLL.js";
4
4
 
5
5
  // src/chat/credentials/context.ts
6
6
  import { z } from "zod";
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-23IKSW3E.js";
6
+ } from "./chunk-NGL4XFT2.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-FSH6HT5C.js";
14
+ } from "./chunk-5EPG7PYS.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -2,7 +2,7 @@ import {
2
2
  getConversationEventStore,
3
3
  getDb,
4
4
  getSqlExecutor
5
- } from "./chunk-FIMO3IDW.js";
5
+ } from "./chunk-IX7VHMIJ.js";
6
6
  import {
7
7
  juniorConversationAnnotations,
8
8
  juniorConversationEvents,
@@ -10,7 +10,7 @@ import {
10
10
  juniorUsers,
11
11
  juniorWorkspaceRepos,
12
12
  juniorWorkspaces
13
- } from "./chunk-MKEHLCSM.js";
13
+ } from "./chunk-6W2UIZSA.js";
14
14
  import {
15
15
  SANDBOX_WORKSPACE_ROOT,
16
16
  runNonInteractiveCommand,
@@ -18,21 +18,21 @@ import {
18
18
  } from "./chunk-BVREIWBD.js";
19
19
  import {
20
20
  getStateAdapter
21
- } from "./chunk-N7V2WPZV.js";
21
+ } from "./chunk-74XMBKRI.js";
22
22
  import {
23
23
  botConfig,
24
24
  completeObject,
25
25
  embedTexts,
26
26
  getSlackBotToken,
27
27
  standardModelId
28
- } from "./chunk-MPLBAWGP.js";
28
+ } from "./chunk-E7HKIHI5.js";
29
29
  import {
30
30
  isActorUserId,
31
31
  parseActorUserId,
32
32
  parseSlackChannelReferenceId,
33
33
  parseSlackMessageTs,
34
34
  parseSlackTeamId
35
- } from "./chunk-V7YE4WCP.js";
35
+ } from "./chunk-M63DETLL.js";
36
36
  import {
37
37
  logException,
38
38
  logInfo,
@@ -41,7 +41,7 @@ import {
41
41
  setSpanAttributes,
42
42
  setSpanStatus,
43
43
  withSpan
44
- } from "./chunk-FSH6HT5C.js";
44
+ } from "./chunk-5EPG7PYS.js";
45
45
 
46
46
  // src/chat/plugins/agent-hooks.ts
47
47
  import {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.169.0",
4
+ version: "0.170.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -4,27 +4,27 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-HWXQZCKV.js";
7
+ } from "./chunk-6GOKKLWF.js";
8
8
  import {
9
9
  parseSandboxEgressAuthRequiredSignal
10
- } from "./chunk-7MA4HV4W.js";
10
+ } from "./chunk-6ZWRNC4D.js";
11
11
  import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink,
14
14
  recordAuthorizationRequested
15
- } from "./chunk-ECBD46QI.js";
15
+ } from "./chunk-HZALSYOW.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-MKEHLCSM.js";
18
+ } from "./chunk-6W2UIZSA.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-MPLBAWGP.js";
21
+ } from "./chunk-E7HKIHI5.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-TMZOUVEP.js";
24
+ } from "./chunk-6E4WQV75.js";
25
25
  import {
26
26
  credentialContextSchema
27
- } from "./chunk-BDUENQD3.js";
27
+ } from "./chunk-CGA4ERJ5.js";
28
28
 
29
29
  // src/chat/services/auth-pause.ts
30
30
  var AuthorizationPauseError = class extends Error {
@@ -13,7 +13,7 @@ import {
13
13
  instructionProvenanceFor,
14
14
  sanitizePostgresJson,
15
15
  withConversationEventLock
16
- } from "./chunk-FIMO3IDW.js";
16
+ } from "./chunk-IX7VHMIJ.js";
17
17
  import {
18
18
  SANDBOX_REPOS_ROOT,
19
19
  SANDBOX_WORKSPACE_ROOT,
@@ -24,24 +24,24 @@ import {
24
24
  fenceLock,
25
25
  getStateAdapter,
26
26
  withLock
27
- } from "./chunk-N7V2WPZV.js";
27
+ } from "./chunk-74XMBKRI.js";
28
28
  import {
29
29
  botConfig,
30
30
  completeText,
31
31
  escapeXml,
32
32
  resolveGatewayModel,
33
33
  unwrapCurrentInstruction
34
- } from "./chunk-MPLBAWGP.js";
34
+ } from "./chunk-E7HKIHI5.js";
35
35
  import {
36
36
  parseSlackMessageTs,
37
37
  toStoredSlackActor
38
- } from "./chunk-V7YE4WCP.js";
38
+ } from "./chunk-M63DETLL.js";
39
39
  import {
40
40
  getActiveTraceId,
41
41
  logException,
42
42
  logWarn,
43
43
  setSpanAttributes
44
- } from "./chunk-FSH6HT5C.js";
44
+ } from "./chunk-5EPG7PYS.js";
45
45
 
46
46
  // src/chat/turn-context-tag.ts
47
47
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-ZXCVYSTS.js";
3
+ } from "./chunk-7TVGQZOH.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-73XNLM4O.js";
9
+ } from "./chunk-TX553KXA.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-5Z7QQYHV.js";
18
+ } from "./chunk-FKOLWEMX.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-ECBD46QI.js";
29
+ } from "./chunk-HZALSYOW.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-FIMO3IDW.js";
34
+ } from "./chunk-IX7VHMIJ.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-MKEHLCSM.js";
38
+ } from "./chunk-6W2UIZSA.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";