@sentry/junior 0.191.0 → 0.193.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-HIWWBBKO.js → agent-hooks-DWY3MZZ7.js} +11 -11
  2. package/dist/api/activity.d.ts +3 -1
  3. package/dist/api/code/overview.d.ts +12 -0
  4. package/dist/api/locations/detail.d.ts +8 -0
  5. package/dist/api/locations/list.d.ts +5 -0
  6. package/dist/api/people/code.d.ts +6 -0
  7. package/dist/api/people/shared.d.ts +2 -0
  8. package/dist/api/reporting-window.d.ts +40 -0
  9. package/dist/api/schema/code.d.ts +14 -0
  10. package/dist/api/schema/conversation.d.ts +27 -0
  11. package/dist/api/schema/location.d.ts +15 -0
  12. package/dist/api/schema/person.d.ts +104 -0
  13. package/dist/api/schema/task.d.ts +15 -2
  14. package/dist/api/schema.d.ts +1 -1
  15. package/dist/api/schema.js +2 -2
  16. package/dist/api.js +536 -141
  17. package/dist/app.js +50 -83
  18. package/dist/{catalog-runtime-4OKH4265.js → catalog-runtime-NAD44W5K.js} +4 -4
  19. package/dist/chat/agent/prompt.d.ts +1 -1
  20. package/dist/chat/agent-dispatch/types.d.ts +2 -1
  21. package/dist/chat/agent-dispatch/validation.d.ts +1 -1
  22. package/dist/chat/agent-invocations/types.d.ts +24 -28
  23. package/dist/chat/event-tasks/tool-support.d.ts +10 -1
  24. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  25. package/dist/chat/prompt.d.ts +4 -5
  26. package/dist/chat/services/turn-session-routing.d.ts +4 -3
  27. package/dist/chat/slack/tool-support/context.d.ts +3 -6
  28. package/dist/chat/source.d.ts +4 -6
  29. package/dist/chat/tasks/execution-stats.d.ts +12 -0
  30. package/dist/chat/tools/delete-event-task.d.ts +1 -1
  31. package/dist/chat/tools/types.d.ts +10 -9
  32. package/dist/chat/tools/update-event-task.d.ts +1 -1
  33. package/dist/{chunk-S7NSFCCW.js → chunk-2CYWEVOP.js} +4 -4
  34. package/dist/{chunk-6KISW5UY.js → chunk-3YZ2Q6AW.js} +2 -2
  35. package/dist/{chunk-X6PQKQTY.js → chunk-42N6CDWF.js} +4 -4
  36. package/dist/{chunk-Q32BSFN4.js → chunk-4UA5C7AM.js} +32 -25
  37. package/dist/{chunk-VGYZ3YZM.js → chunk-5E5SLAVD.js} +21 -21
  38. package/dist/{chunk-3PDR63SX.js → chunk-5LEVZYXF.js} +4 -4
  39. package/dist/{chunk-SEIZ2XLD.js → chunk-5S6AQFNG.js} +1 -1
  40. package/dist/{chunk-AWFSSFAX.js → chunk-AZVDODSP.js} +11 -11
  41. package/dist/{chunk-LOYTPSAK.js → chunk-BFP3ZKG6.js} +12 -8
  42. package/dist/{chunk-GQN4REF5.js → chunk-COCVPDWX.js} +11 -7
  43. package/dist/{chunk-CECRMPXJ.js → chunk-D4XQZOHB.js} +8 -8
  44. package/dist/{chunk-WNIVCR74.js → chunk-D5YQPCEG.js} +2 -2
  45. package/dist/{chunk-CCPOZMS4.js → chunk-DVU734PI.js} +3 -3
  46. package/dist/{chunk-EQZUBYRF.js → chunk-DXFUYLHX.js} +1 -1
  47. package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
  48. package/dist/{chunk-NK3UEKAW.js → chunk-FQ5HFSFR.js} +81 -33
  49. package/dist/{chunk-K2NKG42A.js → chunk-GTXQHZ2O.js} +5 -5
  50. package/dist/{chunk-BVWC5DBM.js → chunk-GUKGU6R7.js} +1 -1
  51. package/dist/{chunk-ZJRGWZZ2.js → chunk-GUMBIDDL.js} +74 -4
  52. package/dist/{chunk-DP6H3U2X.js → chunk-HMBTX5RK.js} +1 -1
  53. package/dist/{chunk-CUUE5MGF.js → chunk-IBXXTO3J.js} +3 -3
  54. package/dist/{chunk-YNRLCUCB.js → chunk-IOUUS6H4.js} +1 -1
  55. package/dist/{chunk-MFZOIKET.js → chunk-IQCL5JGL.js} +1 -1
  56. package/dist/{chunk-WCSXTDOL.js → chunk-K47OVEO4.js} +1 -1
  57. package/dist/{chunk-7PYCRKQL.js → chunk-KWXZMHJS.js} +3 -3
  58. package/dist/{chunk-5IMKUVMS.js → chunk-LG7Q4OW4.js} +9 -9
  59. package/dist/{chunk-HNMRX2EN.js → chunk-LXRTHE43.js} +6 -7
  60. package/dist/{chunk-RZS4F5K4.js → chunk-N6Q2PNSI.js} +3 -3
  61. package/dist/{chunk-BVYUIVXE.js → chunk-OICYQPKP.js} +1 -1
  62. package/dist/{chunk-NY5SJGJZ.js → chunk-PYBFVK6K.js} +73 -64
  63. package/dist/{chunk-ZNFNGDT7.js → chunk-QDU5MW2R.js} +1 -1
  64. package/dist/{chunk-QRNJO7DZ.js → chunk-QWY4KI2V.js} +1 -1
  65. package/dist/{chunk-L4JLLS6C.js → chunk-QY2IU47O.js} +1 -1
  66. package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
  67. package/dist/{chunk-SGRL7NV6.js → chunk-S5HS6WRH.js} +5 -5
  68. package/dist/{chunk-WBNQYVCM.js → chunk-THFNL3TL.js} +3 -4
  69. package/dist/{chunk-ZRN3OS7M.js → chunk-THYNA2QN.js} +1 -1
  70. package/dist/{chunk-TH6LMEOW.js → chunk-WH5VV2RW.js} +1 -1
  71. package/dist/{chunk-2JAWOTUT.js → chunk-WJJDQLVL.js} +2 -2
  72. package/dist/{chunk-KTW62MG5.js → chunk-ZFPEPWOO.js} +6 -6
  73. package/dist/cli/chat.js +33 -33
  74. package/dist/cli/check.js +5 -5
  75. package/dist/cli/plugins.js +12 -12
  76. package/dist/cli/snapshot-create.js +9 -9
  77. package/dist/cli/upgrade.js +6 -6
  78. package/dist/db/schema/agent-invocations.d.ts +16 -0
  79. package/dist/db/schema/stats.d.ts +5 -1
  80. package/dist/db/schema.d.ts +16 -0
  81. package/dist/{db-LG4ZEWA3.js → db-H5MDRQEY.js} +6 -6
  82. package/dist/instrumentation.js +3 -3
  83. package/dist/nitro.js +6 -6
  84. package/dist/{oauth-callback-server-KI7ZRTOG.js → oauth-callback-server-IOU3NUHT.js} +29 -29
  85. package/dist/reporting-schema.d.ts +2 -2
  86. package/dist/{runner-K2EOSAZQ.js → runner-FZ5ZHLFG.js} +21 -21
  87. package/dist/{skills-JTRDFKMA.js → skills-AR3WD6BX.js} +5 -5
  88. package/dist/spawn-ZU6JABR7.js +42 -0
  89. package/dist/task-runner-EEGGG2PM.js +36 -0
  90. package/dist/{validation-NBWURHAP.js → validation-VYE7TQY7.js} +5 -5
  91. package/dist/version.js +1 -1
  92. package/dist/{work-35TBEAUI.js → work-CTQFWYKE.js} +21 -21
  93. package/dist/{worker-F762M6XM.js → worker-6WQU3IT5.js} +10 -10
  94. package/package.json +5 -5
  95. package/dist/spawn-SRBETYCF.js +0 -42
  96. package/dist/task-runner-INQIQ4VF.js +0 -36
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-HNMRX2EN.js";
10
+ } from "./chunk-LXRTHE43.js";
11
11
  import {
12
12
  parseSandboxEgressAuthRequiredSignal,
13
13
  parseSandboxEgressPermissionDeniedSignal,
@@ -38,7 +38,7 @@ import {
38
38
  searchSlackUsers,
39
39
  selectPluginGrant,
40
40
  toMcpProviderError
41
- } from "./chunk-CECRMPXJ.js";
41
+ } from "./chunk-D4XQZOHB.js";
42
42
  import {
43
43
  RetryableDeliveryError,
44
44
  actorFromRun,
@@ -52,7 +52,7 @@ import {
52
52
  surfaceFromRun,
53
53
  toolInvocationDestination,
54
54
  uploadFilesToConversation
55
- } from "./chunk-GQN4REF5.js";
55
+ } from "./chunk-COCVPDWX.js";
56
56
  import {
57
57
  CooperativeTurnYieldError,
58
58
  NO_REPLY_MARKER,
@@ -65,7 +65,7 @@ import {
65
65
  isNoReplyMarker,
66
66
  isTurnInputCommitLostError,
67
67
  sanitizeAssistantText
68
- } from "./chunk-WCSXTDOL.js";
68
+ } from "./chunk-K47OVEO4.js";
69
69
  import {
70
70
  AGENTS_REMOVAL_NOTICE,
71
71
  AGENTS_REPLACEMENT_NOTICE,
@@ -119,7 +119,7 @@ import {
119
119
  stripRuntimeTurnContext,
120
120
  trimTrailingAssistantMessages,
121
121
  truncateText
122
- } from "./chunk-KTW62MG5.js";
122
+ } from "./chunk-ZFPEPWOO.js";
123
123
  import {
124
124
  SCHEDULED_TASK_SYSTEM_ACTOR,
125
125
  WORKSPACE_SNAPSHOT_FAILED_EVENT,
@@ -160,13 +160,13 @@ import {
160
160
  workspaceSnapshotFinishedEvent,
161
161
  workspaceSnapshotWatch,
162
162
  writableEventTask
163
- } from "./chunk-LOYTPSAK.js";
163
+ } from "./chunk-BFP3ZKG6.js";
164
164
  import {
165
165
  parseSlackThreadId
166
- } from "./chunk-DP6H3U2X.js";
166
+ } from "./chunk-HMBTX5RK.js";
167
167
  import {
168
168
  appendAndEnqueueInboundMessage
169
- } from "./chunk-3PDR63SX.js";
169
+ } from "./chunk-5LEVZYXF.js";
170
170
  import {
171
171
  SHORT_TITLE_MAX_LENGTH,
172
172
  ToolInputError,
@@ -174,7 +174,7 @@ import {
174
174
  generateShortTitle,
175
175
  hasAgentTurnUsage,
176
176
  resolveTaskTitle
177
- } from "./chunk-WNIVCR74.js";
177
+ } from "./chunk-D5YQPCEG.js";
178
178
  import {
179
179
  bindSandboxFileSystem,
180
180
  createSandboxSession,
@@ -185,7 +185,7 @@ import {
185
185
  resolve,
186
186
  setSnapshotSpanAttributes,
187
187
  stopSession
188
- } from "./chunk-CUUE5MGF.js";
188
+ } from "./chunk-IBXXTO3J.js";
189
189
  import {
190
190
  privateTraceResultAttributes
191
191
  } from "./chunk-UIE3R5XU.js";
@@ -195,7 +195,7 @@ import {
195
195
  } from "./chunk-X6GDDWQH.js";
196
196
  import {
197
197
  getTurnRequestDeadline
198
- } from "./chunk-MFZOIKET.js";
198
+ } from "./chunk-IQCL5JGL.js";
199
199
  import {
200
200
  getVercelConversationWorkQueue
201
201
  } from "./chunk-DKIJ2RP5.js";
@@ -242,19 +242,19 @@ import {
242
242
  updateWorkspace,
243
243
  withSlackRetries,
244
244
  workspaceRepoCheckoutPath
245
- } from "./chunk-NK3UEKAW.js";
245
+ } from "./chunk-FQ5HFSFR.js";
246
246
  import {
247
247
  getConversationEventStore,
248
248
  getConversationMessageSearchStore,
249
249
  getConversationStore,
250
250
  getDb,
251
251
  getSqlExecutor
252
- } from "./chunk-S7NSFCCW.js";
252
+ } from "./chunk-2CYWEVOP.js";
253
253
  import {
254
254
  juniorArtifacts,
255
255
  juniorIdentities,
256
256
  juniorSchedulerRuns
257
- } from "./chunk-SEIZ2XLD.js";
257
+ } from "./chunk-5S6AQFNG.js";
258
258
  import {
259
259
  SANDBOX_DATA_ROOT,
260
260
  SANDBOX_REPOS_ROOT,
@@ -285,12 +285,12 @@ import {
285
285
  throwSandboxOperationError,
286
286
  workspaceSnapshotNotReadyUserMessage,
287
287
  wrapSandboxSetupError
288
- } from "./chunk-7PYCRKQL.js";
288
+ } from "./chunk-KWXZMHJS.js";
289
289
  import {
290
290
  fenceLock,
291
291
  getStateAdapter,
292
292
  withLock
293
- } from "./chunk-YNRLCUCB.js";
293
+ } from "./chunk-IOUUS6H4.js";
294
294
  import {
295
295
  KNOWN_CONVERSATION_EVENT_TYPES,
296
296
  contextProvenance,
@@ -323,7 +323,7 @@ import {
323
323
  resolveGatewayCredential,
324
324
  resolveGatewayModel,
325
325
  unwrapCurrentInstruction
326
- } from "./chunk-2JAWOTUT.js";
326
+ } from "./chunk-WJJDQLVL.js";
327
327
  import {
328
328
  ModelProfileNotConfiguredError,
329
329
  TURN_REASONING_LEVELS,
@@ -340,16 +340,16 @@ import {
340
340
  toGenAiMessagesTraceAttributes,
341
341
  toGenAiPayloadMetadata,
342
342
  toGenAiPayloadTraceAttributes
343
- } from "./chunk-BVYUIVXE.js";
343
+ } from "./chunk-OICYQPKP.js";
344
344
  import {
345
345
  discoverSkills,
346
346
  findSkillByName,
347
347
  loadSkillsByName,
348
348
  parseSkillInvocation
349
- } from "./chunk-6KISW5UY.js";
349
+ } from "./chunk-3YZ2Q6AW.js";
350
350
  import {
351
351
  pluginCatalogRuntime
352
- } from "./chunk-EQZUBYRF.js";
352
+ } from "./chunk-DXFUYLHX.js";
353
353
  import {
354
354
  CredentialUnavailableError,
355
355
  OAuthProviderError,
@@ -357,7 +357,7 @@ import {
357
357
  getOAuthProviderErrorAttributes,
358
358
  resolveAuthTokenPlaceholder,
359
359
  resolvePluginCommandEnv
360
- } from "./chunk-QRNJO7DZ.js";
360
+ } from "./chunk-QWY4KI2V.js";
361
361
  import {
362
362
  credentialContextForActor,
363
363
  credentialUserSubjectId
@@ -393,7 +393,7 @@ import {
393
393
  summarizeMessageText,
394
394
  withLogContext,
395
395
  withSpan
396
- } from "./chunk-L4JLLS6C.js";
396
+ } from "./chunk-QY2IU47O.js";
397
397
  import {
398
398
  startInactiveSpan,
399
399
  withActiveSpan
@@ -1724,7 +1724,7 @@ var TOOL_POLICY_RULES = [
1724
1724
  "- When a tool result includes a subscription, those events are already watched; do not call watchResourceEvents for them. When a tool result includes a subscribable resource with suggestedEvents, use watchResourceEvents only for those remaining events that serve the current intent. If suggestedEvents is empty or omitted, do not invent a watch. Do not create scheduled polling tasks for events a watch can deliver. Write a concise intent summary, and tell the user when the temporary watch expires. Stop only the requested watch by id unless the user explicitly asks to stop every watch in the thread.",
1725
1725
  "- Use createEventTask only when the user explicitly asks for an event task or durable whenever-this-happens-do-X automation. Ordinary watch, notify, and tell-me-when requests use watchResourceEvents. When an event task's resource and events are known, create it without redundant confirmation.",
1726
1726
  "- Event tasks make the task creator's connected credentials available by default when the requested work needs user-bound authorization. Do not ask for separate confirmation merely to use credentials needed for the requested work. On creation, omit credentialMode for the creator default and set system only when the creator explicitly requires it. For later changes, creator always means the task's original createdBy actor, never the current requester. If the requester is not that creator, do not attempt to enable creator credential use or suggest that confirmation could authorize it.",
1727
- "- Event tasks are managed for the current Slack channel or DM, not one thread. When listing them, use createdBy to explain creator-only credential changes and warn when triggerAvailable is false; an unavailable task remains stored but cannot receive events until its plugin event is enabled again.",
1727
+ "- Event tasks list for the current destination, not one thread. Public tasks can also be updated or deleted by task id from another destination in the same workspace. When listing them, use createdBy to explain creator-only credential changes and warn when triggerAvailable is false; an unavailable task remains stored but cannot receive events until its plugin event is enabled again.",
1728
1728
  "- Scheduled tasks make the task creator's connected credentials available by default when the requested work needs user-bound authorization. Do not ask for separate confirmation merely to use credentials needed for the requested work. On creation, omit credential_mode for the creator default and set system only when the creator explicitly requires it. For later changes, creator always means the task's original created_by actor, never the current requester. If the requester is not that creator, do not attempt to enable creator credential use or suggest that confirmation could authorize it.",
1729
1729
  "- For code changes, debugging or root-cause analysis, broad refactors, and software architecture decisions, use `handoff` before substantive analysis only when it offers a profile that better matches the task. Do not switch merely because the task involves code.",
1730
1730
  "- Run `jr-rpc config get|set|unset|list` for provider defaults and `jr-rpc plugins list` for installed plugin introspection as standalone bash commands; do not chain them with `cd`, `&&`, pipes, or provider commands.",
@@ -1862,6 +1862,11 @@ function formatSourceLines(source) {
1862
1862
  `- source.identifier: ${escapeXml(source.identifier)}`,
1863
1863
  `- source.event_type: ${escapeXml(source.eventType)}`
1864
1864
  ];
1865
+ case "scheduled_task":
1866
+ case "event_task":
1867
+ case "plugin_dispatch":
1868
+ case "agent_invocation":
1869
+ return [`- source.kind: ${source.kind}`];
1865
1870
  }
1866
1871
  }
1867
1872
  function formatDestinationLines(destination) {
@@ -2005,8 +2010,7 @@ var STATIC_SYSTEM_PROMPTS = {
2005
2010
  local: buildStaticSystemPrompt("local"),
2006
2011
  slack: buildStaticSystemPrompt("slack")
2007
2012
  };
2008
- function buildSystemPrompt(params) {
2009
- const platform = params.source.kind === "slack" ? "slack" : "local";
2013
+ function buildSystemPrompt(platform) {
2010
2014
  return STATIC_SYSTEM_PROMPTS[platform];
2011
2015
  }
2012
2016
  function buildTurnContextPrompt(params) {
@@ -2300,11 +2304,12 @@ async function assemblePrompt(args) {
2300
2304
  userContentParts: requestContentParts
2301
2305
  }) : void 0;
2302
2306
  const needsBootstrapContextForPrompt = shouldPromptAgent && !replayedPrompt && !hasRuntimeTurnContext(promptHistoryMessages);
2303
- const systemPromptContributions = await getPluginSystemPromptContributions(source);
2307
+ const platform = args.run.delivery && args.run.location?.provider === "slack" ? "slack" : "local";
2308
+ const systemPromptContributions = await getPluginSystemPromptContributions(platform);
2304
2309
  const pluginSystemPrompt = buildPluginSystemPromptContributions(
2305
2310
  systemPromptContributions
2306
2311
  );
2307
- const baseInstructions = [buildSystemPrompt({ source }), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
2312
+ const baseInstructions = [buildSystemPrompt(platform), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
2308
2313
  const pluginUserPromptContributions = !shouldPromptAgent || replayedPrompt ? [] : await getPluginUserPromptContributions({
2309
2314
  context: args.toolRuntimeContext,
2310
2315
  turnId: args.turnId
@@ -8912,7 +8917,7 @@ function createEventTaskTool(context, catalog) {
8912
8917
  readOnlyHint: false
8913
8918
  },
8914
8919
  executionMode: "sequential",
8915
- description: "Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task remains configured for this Slack channel or DM until deleted and may use the creator's connected credentials. Prefer a subscribable tool result when available.",
8920
+ description: "Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task may use the creator's connected credentials. Prefer a subscribable tool result when available.",
8916
8921
  inputSchema: z22.object({
8917
8922
  task: z22.string().trim().min(1).max(4e3),
8918
8923
  title: z22.string().trim().min(1).max(SHORT_TITLE_MAX_LENGTH).nullable().describe(
@@ -9000,16 +9005,14 @@ function createDeleteEventTaskTool(context, catalog) {
9000
9005
  readOnlyHint: false
9001
9006
  },
9002
9007
  executionMode: "sequential",
9003
- description: "Delete an event task from this Slack channel or DM, including a task created from another thread in the same destination.",
9008
+ description: "Delete an event task.",
9004
9009
  inputSchema: z23.object({ taskId: z23.string().min(1) }).strict(),
9005
9010
  outputSchema: eventTaskToolResultSchema,
9006
9011
  async execute({ taskId }) {
9007
9012
  const current = await writableEventTask(context, taskId);
9008
9013
  const deleted = await deleteEventTask(getDb(), current.id);
9009
9014
  if (!deleted) {
9010
- throw new ToolInputError(
9011
- "Event task was not found in this Slack channel or DM."
9012
- );
9015
+ throw new ToolInputError("Event task was not found.");
9013
9016
  }
9014
9017
  return eventTaskSuccess(deleted, catalog);
9015
9018
  }
@@ -9027,7 +9030,7 @@ function createListEventTasksTool(context, catalog) {
9027
9030
  openWorldHint: false,
9028
9031
  readOnlyHint: true
9029
9032
  },
9030
- description: "List event tasks for this Slack channel or DM, including tasks created from other threads in the same destination. A false triggerAvailable value means the task remains stored but its plugin event is not currently enabled.",
9033
+ description: "List event tasks for the current destination. A false triggerAvailable value means the task remains stored but its plugin event is not currently enabled.",
9031
9034
  inputSchema: z24.object({}).strict(),
9032
9035
  outputSchema: eventTaskListToolResultSchema,
9033
9036
  async execute() {
@@ -9060,7 +9063,7 @@ function createUpdateEventTaskTool(context, catalog) {
9060
9063
  readOnlyHint: false
9061
9064
  },
9062
9065
  executionMode: "sequential",
9063
- description: "Update the instruction, registered trigger, or credential use for an event task in this Slack channel or DM. Event tasks created from other threads in the same destination are manageable here.",
9066
+ description: "Update the instruction, registered trigger, or credential use for an event task.",
9064
9067
  inputSchema: z25.object({
9065
9068
  taskId: z25.string().min(1),
9066
9069
  task: z25.string().trim().min(1).max(4e3).nullable().optional(),
@@ -9125,9 +9128,7 @@ function createUpdateEventTaskTool(context, catalog) {
9125
9128
  }
9126
9129
  const saved = await saveEventTask(getDb(), next);
9127
9130
  if (!saved) {
9128
- throw new ToolInputError(
9129
- "Event task was not found in this Slack channel or DM."
9130
- );
9131
+ throw new ToolInputError("Event task was not found.");
9131
9132
  }
9132
9133
  return eventTaskSuccess(saved, catalog);
9133
9134
  }
@@ -10700,7 +10701,7 @@ function createSlackChannelJoinTool(context) {
10700
10701
  const access = await checkSlackChannelReadAccess({
10701
10702
  currentChannelIds: [
10702
10703
  context.destinationChannelId,
10703
- context.sourceChannelId
10704
+ context.locationChannelId
10704
10705
  ],
10705
10706
  targetChannelId: target.channelId,
10706
10707
  teamId: context.teamId
@@ -10846,7 +10847,7 @@ function createSlackChannelListMessagesTool(context) {
10846
10847
  const access = await checkSlackChannelReadAccess({
10847
10848
  currentChannelIds: [
10848
10849
  context.destinationChannelId,
10849
- context.sourceChannelId
10850
+ context.locationChannelId
10850
10851
  ],
10851
10852
  targetChannelId,
10852
10853
  teamId: context.teamId
@@ -11482,11 +11483,11 @@ function createSlackMessageAddReactionTool(context, state) {
11482
11483
  }),
11483
11484
  outputSchema: juniorToolOutputSchema,
11484
11485
  execute: async ({ emoji }) => {
11485
- const targetChannelId = context.sourceChannelId;
11486
+ const targetChannelId = context.messageChannelId;
11486
11487
  const targetMessageTs = context.messageTs;
11487
- if (!targetMessageTs) {
11488
+ if (!targetChannelId || !targetMessageTs) {
11488
11489
  throw new ToolInputError(
11489
- "No active message timestamp is available for reactions."
11490
+ "No active Slack message is available for reactions."
11490
11491
  );
11491
11492
  }
11492
11493
  const normalizedEmoji = normalizeSlackEmojiName(emoji);
@@ -11572,22 +11573,14 @@ function createSendFilesTool(context, state, materializeFile, attachments) {
11572
11573
  outputSchema: sendFilesResultSchema,
11573
11574
  execute: async ({ files }, options) => {
11574
11575
  const filesToSend = normalizeFiles(files);
11575
- const activeChannelId = context.sourceChannelId;
11576
- if (!activeChannelId) {
11577
- throw new ToolInputError("No active Slack conversation is available.");
11578
- }
11576
+ const activeChannelId = context.locationChannelId;
11579
11577
  const threadTs = context.threadTs ?? context.messageTs;
11580
- if (!threadTs) {
11581
- throw new ToolInputError(
11582
- "No active Slack conversation timestamp is available."
11583
- );
11584
- }
11585
11578
  const materializedFiles = await Promise.all(
11586
11579
  filesToSend.map((file) => materializeFile(file))
11587
11580
  );
11588
11581
  const operationKey = createOperationKey("sendFiles", {
11589
11582
  channel_id: activeChannelId,
11590
- thread_ts: threadTs,
11583
+ thread_ts: threadTs ?? null,
11591
11584
  files: fileOperationInput(materializedFiles)
11592
11585
  });
11593
11586
  const cached = state.getOperationResult(operationKey);
@@ -11617,7 +11610,7 @@ function createSendFilesTool(context, state, materializeFile, attachments) {
11617
11610
  await uploadFilesToConversation({
11618
11611
  channelId: activeChannelId,
11619
11612
  files: uploads,
11620
- threadTs
11613
+ ...threadTs ? { threadTs } : void 0
11621
11614
  });
11622
11615
  const delivered = stored.map(
11623
11616
  (attachment, index) => {
@@ -12940,7 +12933,7 @@ function createSlackThreadReadTool(context) {
12940
12933
  const access = await checkSlackChannelReadAccess({
12941
12934
  currentChannelIds: [
12942
12935
  context.destinationChannelId,
12943
- context.sourceChannelId
12936
+ context.locationChannelId
12944
12937
  ],
12945
12938
  targetChannelId: channelId,
12946
12939
  teamId: context.teamId
@@ -13699,6 +13692,14 @@ async function resolveAccessScope(conversationStore, context, currentConversatio
13699
13692
  currentConversationId,
13700
13693
  current.parentConversationId
13701
13694
  ) : currentConversationId;
13695
+ if (context.location?.provider === "slack") {
13696
+ return {
13697
+ currentConversationId,
13698
+ currentRootConversationId,
13699
+ provider: "slack",
13700
+ providerTenantId: context.location.teamId
13701
+ };
13702
+ }
13702
13703
  if (context.source.kind === "slack") {
13703
13704
  return {
13704
13705
  currentConversationId,
@@ -14839,9 +14840,9 @@ function createToolState() {
14839
14840
  function createTools(availableSkills, hooks = {}, context, options = {}) {
14840
14841
  const state = createToolState();
14841
14842
  const slackContext = getSlackToolContext(context);
14842
- const slackSourceCapabilities = slackContext ? resolveChannelCapabilities(slackContext.sourceChannelId) : void 0;
14843
+ const slackLocationCapabilities = slackContext ? resolveChannelCapabilities(slackContext.locationChannelId) : void 0;
14843
14844
  const canSendFilesToActiveConversation = Boolean(
14844
- slackContext && slackSourceCapabilities?.canSendFiles
14845
+ slackContext && slackLocationCapabilities?.canSendFiles
14845
14846
  );
14846
14847
  const resourceEventCatalog = getResourceEventCatalog();
14847
14848
  const tools = {
@@ -14919,7 +14920,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
14919
14920
  tools.slackCanvasWrite = createSlackCanvasWriteTool(state);
14920
14921
  tools.slackThreadRead = createSlackThreadReadTool(slackContext);
14921
14922
  tools.slackChannelJoin = createSlackChannelJoinTool(slackContext);
14922
- if (slackContext.source.visibility === "public") {
14923
+ if (context.conversationPrivacy === "public") {
14923
14924
  tools.searchConversationMessages = createSlackConversationMessageSearchTool(
14924
14925
  {
14925
14926
  kind: "public_provider_tenant",
@@ -14948,8 +14949,8 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
14948
14949
  tools.slackListUpdateItem = createSlackListUpdateItemTool(state);
14949
14950
  const outputChannelId = slackContext.destinationChannelId;
14950
14951
  const outputCapabilities = outputChannelId ? resolveChannelCapabilities(outputChannelId) : void 0;
14951
- const rawChannelCapabilities = resolveChannelCapabilities(
14952
- slackContext.sourceChannelId
14952
+ const locationCapabilities = resolveChannelCapabilities(
14953
+ slackContext.locationChannelId
14953
14954
  );
14954
14955
  if (outputCapabilities?.canCreateCanvas) {
14955
14956
  tools.slackCanvasCreate = createSlackCanvasCreateTool(
@@ -14957,7 +14958,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
14957
14958
  state
14958
14959
  );
14959
14960
  }
14960
- if (rawChannelCapabilities.canSendFiles) {
14961
+ if (locationCapabilities.canSendFiles) {
14961
14962
  tools.sendFiles = createSendFilesTool(
14962
14963
  slackContext,
14963
14964
  state,
@@ -14970,7 +14971,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
14970
14971
  );
14971
14972
  }
14972
14973
  tools.slackChannelListMessages = createSlackChannelListMessagesTool(slackContext);
14973
- if (rawChannelCapabilities.canAddReactions) {
14974
+ if (context.source.kind === "slack" && locationCapabilities.canAddReactions) {
14974
14975
  tools.addReaction = createSlackMessageAddReactionTool(
14975
14976
  slackContext,
14976
14977
  state
@@ -17545,9 +17546,13 @@ function resolveToolRuntimeRoute(args) {
17545
17546
  source: args.run.source
17546
17547
  };
17547
17548
  case "resource_event":
17549
+ case "scheduled_task":
17550
+ case "event_task":
17551
+ case "plugin_dispatch":
17552
+ case "agent_invocation":
17548
17553
  return {
17549
17554
  destination,
17550
- actor: args.actor?.platform === "system" ? args.actor : void 0,
17555
+ actor: args.actor,
17551
17556
  source: args.run.source
17552
17557
  };
17553
17558
  }
@@ -17642,7 +17647,11 @@ async function wireAgentTools(args) {
17642
17647
  );
17643
17648
  const commonToolRuntimeContext = {
17644
17649
  conversationId: args.run.conversationId,
17645
- ...args.run.location ? { locationId: args.run.location.id } : void 0,
17650
+ ...args.run.location ? {
17651
+ location: args.run.location,
17652
+ locationId: args.run.location.id
17653
+ } : void 0,
17654
+ conversationPrivacy: args.conversationPrivacy,
17646
17655
  userText: args.userInput,
17647
17656
  configuration: args.configurationValues,
17648
17657
  egress: createPluginEgress({
@@ -18642,7 +18651,7 @@ async function executeAgentRun(run, streamFn) {
18642
18651
  const userActor = actor && "userId" in actor ? actor : void 0;
18643
18652
  const runLogContext = {
18644
18653
  conversationId: run.conversationId,
18645
- platform: run.source.kind,
18654
+ platform: run.source.kind === "slack" || run.source.kind === "web" || run.source.kind === "local" ? run.source.kind : void 0,
18646
18655
  messageConversationId: run.source.kind === "slack" ? run.conversationId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId,
18647
18656
  destinationName: run.location?.channelId ?? (run.source.kind === "slack" ? run.source.channelId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId),
18648
18657
  userId: userActor?.userId,
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.191.0",
4
+ version: "0.193.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-L4JLLS6C.js";
15
+ } from "./chunk-QY2IU47O.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-PEQXYSSE.js";
13
13
  import {
14
14
  JUNIOR_VERSION
15
- } from "./chunk-ZNFNGDT7.js";
15
+ } from "./chunk-QDU5MW2R.js";
16
16
 
17
17
  // src/deployment.ts
18
18
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -83,7 +83,14 @@ var pluginOperationalBarChartWidgetSchema = z.object({
83
83
  tone: pluginOperationalToneSchema.optional()
84
84
  }).strict()
85
85
  ).min(1).max(8),
86
- timeRangeDays: z.array(z.union([z.literal(7), z.literal(30), z.literal(90)])).min(1).max(3).optional(),
86
+ timeRangeDays: z.array(
87
+ z.union([
88
+ z.literal(1),
89
+ z.literal(7),
90
+ z.literal(30),
91
+ z.literal(90)
92
+ ])
93
+ ).min(1).max(4).optional(),
87
94
  title: z.string().min(1),
88
95
  type: z.literal("bar_chart")
89
96
  }).strict();
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-KTW62MG5.js";
3
+ } from "./chunk-ZFPEPWOO.js";
4
4
  import {
5
5
  JUNIOR_THREAD_STATE_TTL_MS
6
6
  } from "./chunk-3Y47VMHV.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-S7NSFCCW.js";
9
+ } from "./chunk-2CYWEVOP.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-SEIZ2XLD.js";
12
+ } from "./chunk-5S6AQFNG.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-YNRLCUCB.js";
15
+ } from "./chunk-IOUUS6H4.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -20,7 +20,7 @@ import {
20
20
  isRecord,
21
21
  toOptionalNumber,
22
22
  toOptionalString
23
- } from "./chunk-L4JLLS6C.js";
23
+ } from "./chunk-QY2IU47O.js";
24
24
 
25
25
  // src/chat/state/conversation.ts
26
26
  function defaultConversationState() {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-AWFSSFAX.js";
3
+ } from "./chunk-AZVDODSP.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
7
- } from "./chunk-GQN4REF5.js";
7
+ } from "./chunk-COCVPDWX.js";
8
8
 
9
9
  // src/chat/agent-invocations/spawn.ts
10
10
  function bindSpawnAgent(run, options) {
@@ -24,8 +24,7 @@ function bindSpawnAgent(run, options) {
24
24
  idempotencyKey: `${run.turnId}:${call.toolCallId}`,
25
25
  input: input.task,
26
26
  parentConversationId: run.conversationId,
27
- ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0,
28
- source: run.source
27
+ ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0
29
28
  },
30
29
  { ...options, queue }
31
30
  );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-YNRLCUCB.js";
3
+ } from "./chunk-IOUUS6H4.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-PEQXYSSE.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConversationEventStore
3
- } from "./chunk-S7NSFCCW.js";
3
+ } from "./chunk-2CYWEVOP.js";
4
4
 
5
5
  // src/chat/conversations/turn-lifecycle.ts
6
6
  var ConversationTurnLifecycleService = class {
@@ -7,7 +7,7 @@ import {
7
7
  toCanonicalInputMessage,
8
8
  toCanonicalOutputMessage,
9
9
  toGenAiMessagesTraceAttributes
10
- } from "./chunk-BVYUIVXE.js";
10
+ } from "./chunk-OICYQPKP.js";
11
11
  import {
12
12
  extractGenAiUsageAttributes,
13
13
  logException,
@@ -15,7 +15,7 @@ import {
15
15
  normalizeGenAiFinishReason,
16
16
  serializeGenAiAttribute,
17
17
  withSpan
18
- } from "./chunk-L4JLLS6C.js";
18
+ } from "./chunk-QY2IU47O.js";
19
19
 
20
20
  // src/chat/services/provider-error.ts
21
21
  var ProviderError = class extends Error {
@@ -7,7 +7,7 @@ import {
7
7
  authenticationUnlinkedEvent,
8
8
  fallbackShortTitle,
9
9
  generateShortTitle
10
- } from "./chunk-WNIVCR74.js";
10
+ } from "./chunk-D5YQPCEG.js";
11
11
  import {
12
12
  bindProviderConversation,
13
13
  createSqlConversationEventStore,
@@ -16,18 +16,18 @@ import {
16
16
  getSqlExecutor,
17
17
  sanitizePostgresJson,
18
18
  withConversationEventLock
19
- } from "./chunk-S7NSFCCW.js";
19
+ } from "./chunk-2CYWEVOP.js";
20
20
  import {
21
21
  SANDBOX_REPOS_ROOT,
22
22
  SANDBOX_WORKSPACE_ROOT,
23
23
  sleep
24
- } from "./chunk-7PYCRKQL.js";
24
+ } from "./chunk-KWXZMHJS.js";
25
25
  import {
26
26
  MUTATION_LOCK_TTL_MS,
27
27
  fenceLock,
28
28
  getStateAdapter,
29
29
  withLock
30
- } from "./chunk-YNRLCUCB.js";
30
+ } from "./chunk-IOUUS6H4.js";
31
31
  import {
32
32
  agentHistoryItemSchema,
33
33
  contextProvenance,
@@ -40,7 +40,7 @@ import {
40
40
  escapeXml,
41
41
  resolveGatewayModel,
42
42
  unwrapCurrentInstruction
43
- } from "./chunk-2JAWOTUT.js";
43
+ } from "./chunk-WJJDQLVL.js";
44
44
  import {
45
45
  parseSlackMessageTs,
46
46
  toStoredSlackActor
@@ -50,7 +50,7 @@ import {
50
50
  logException,
51
51
  logWarn,
52
52
  setSpanAttributes
53
- } from "./chunk-L4JLLS6C.js";
53
+ } from "./chunk-QY2IU47O.js";
54
54
 
55
55
  // src/chat/turn-context-tag.ts
56
56
  var TURN_CONTEXT_TAG = "runtime-turn-context";