@sentry/junior 0.192.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 (77) hide show
  1. package/dist/{agent-hooks-3JY76L5X.js → agent-hooks-DWY3MZZ7.js} +11 -11
  2. package/dist/api.js +24 -24
  3. package/dist/app.js +49 -82
  4. package/dist/{catalog-runtime-5JVLWXRY.js → catalog-runtime-NAD44W5K.js} +4 -4
  5. package/dist/chat/agent/prompt.d.ts +1 -1
  6. package/dist/chat/agent-dispatch/types.d.ts +2 -1
  7. package/dist/chat/agent-dispatch/validation.d.ts +1 -1
  8. package/dist/chat/agent-invocations/types.d.ts +24 -28
  9. package/dist/chat/event-tasks/tool-support.d.ts +10 -1
  10. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  11. package/dist/chat/prompt.d.ts +4 -5
  12. package/dist/chat/services/turn-session-routing.d.ts +4 -3
  13. package/dist/chat/slack/tool-support/context.d.ts +3 -6
  14. package/dist/chat/source.d.ts +4 -6
  15. package/dist/chat/tools/delete-event-task.d.ts +1 -1
  16. package/dist/chat/tools/types.d.ts +10 -9
  17. package/dist/chat/tools/update-event-task.d.ts +1 -1
  18. package/dist/{chunk-AKR6W7VV.js → chunk-2CYWEVOP.js} +4 -4
  19. package/dist/{chunk-PYVGXGKC.js → chunk-3YZ2Q6AW.js} +2 -2
  20. package/dist/{chunk-47JFLZSF.js → chunk-42N6CDWF.js} +4 -4
  21. package/dist/{chunk-ITTEDZGY.js → chunk-4UA5C7AM.js} +32 -25
  22. package/dist/{chunk-3O2NXVGB.js → chunk-5E5SLAVD.js} +21 -21
  23. package/dist/{chunk-G4E5WIRL.js → chunk-5LEVZYXF.js} +4 -4
  24. package/dist/{chunk-IBO4YFFZ.js → chunk-5S6AQFNG.js} +1 -1
  25. package/dist/{chunk-4CCQZHD3.js → chunk-AZVDODSP.js} +11 -11
  26. package/dist/{chunk-EIYOABL4.js → chunk-BFP3ZKG6.js} +12 -8
  27. package/dist/{chunk-SSR6YBWW.js → chunk-COCVPDWX.js} +11 -7
  28. package/dist/{chunk-YE6DVM43.js → chunk-D4XQZOHB.js} +8 -8
  29. package/dist/{chunk-OBN7UEQJ.js → chunk-D5YQPCEG.js} +2 -2
  30. package/dist/{chunk-BGLMT6KP.js → chunk-DVU734PI.js} +3 -3
  31. package/dist/{chunk-FGYWKKTJ.js → chunk-DXFUYLHX.js} +1 -1
  32. package/dist/{chunk-BUTAWPUV.js → chunk-FQ5HFSFR.js} +37 -31
  33. package/dist/{chunk-YRWGJ5OO.js → chunk-GTXQHZ2O.js} +5 -5
  34. package/dist/{chunk-5V4BAUCH.js → chunk-GUKGU6R7.js} +1 -1
  35. package/dist/{chunk-MB2CTEPD.js → chunk-GUMBIDDL.js} +3 -3
  36. package/dist/{chunk-4WIA45WD.js → chunk-HMBTX5RK.js} +1 -1
  37. package/dist/{chunk-3UJSII43.js → chunk-IBXXTO3J.js} +3 -3
  38. package/dist/{chunk-LRTEMMCZ.js → chunk-IOUUS6H4.js} +1 -1
  39. package/dist/{chunk-SZ2O3CGS.js → chunk-IQCL5JGL.js} +1 -1
  40. package/dist/{chunk-7XO7PTZE.js → chunk-K47OVEO4.js} +1 -1
  41. package/dist/{chunk-6LX6KV5C.js → chunk-KWXZMHJS.js} +3 -3
  42. package/dist/{chunk-KR5F3QSP.js → chunk-LG7Q4OW4.js} +8 -8
  43. package/dist/{chunk-PXP2M32M.js → chunk-LXRTHE43.js} +6 -7
  44. package/dist/{chunk-RWBZZMW6.js → chunk-N6Q2PNSI.js} +3 -3
  45. package/dist/{chunk-EYNUOZCN.js → chunk-OICYQPKP.js} +1 -1
  46. package/dist/{chunk-4B4DQGOM.js → chunk-PYBFVK6K.js} +73 -64
  47. package/dist/{chunk-ARSUYYQG.js → chunk-QDU5MW2R.js} +1 -1
  48. package/dist/{chunk-6FCKJDKS.js → chunk-QWY4KI2V.js} +1 -1
  49. package/dist/{chunk-3ADPXQBL.js → chunk-QY2IU47O.js} +1 -1
  50. package/dist/{chunk-Z4DNJI5F.js → chunk-S5HS6WRH.js} +5 -5
  51. package/dist/{chunk-4AFSQJD6.js → chunk-THFNL3TL.js} +3 -4
  52. package/dist/{chunk-H5Q2T5VC.js → chunk-THYNA2QN.js} +1 -1
  53. package/dist/{chunk-PXUBRZBU.js → chunk-WH5VV2RW.js} +1 -1
  54. package/dist/{chunk-4Z7B5WVV.js → chunk-WJJDQLVL.js} +2 -2
  55. package/dist/{chunk-VF3EDS7P.js → chunk-ZFPEPWOO.js} +6 -6
  56. package/dist/cli/chat.js +33 -33
  57. package/dist/cli/check.js +5 -5
  58. package/dist/cli/plugins.js +12 -12
  59. package/dist/cli/snapshot-create.js +9 -9
  60. package/dist/cli/upgrade.js +6 -6
  61. package/dist/db/schema/agent-invocations.d.ts +16 -0
  62. package/dist/db/schema.d.ts +16 -0
  63. package/dist/{db-LRM6AP66.js → db-H5MDRQEY.js} +6 -6
  64. package/dist/instrumentation.js +3 -3
  65. package/dist/nitro.js +6 -6
  66. package/dist/{oauth-callback-server-BKCDVYVH.js → oauth-callback-server-IOU3NUHT.js} +29 -29
  67. package/dist/{runner-RUXGS3E6.js → runner-FZ5ZHLFG.js} +21 -21
  68. package/dist/{skills-DXP2RCJF.js → skills-AR3WD6BX.js} +5 -5
  69. package/dist/spawn-ZU6JABR7.js +42 -0
  70. package/dist/task-runner-EEGGG2PM.js +36 -0
  71. package/dist/{validation-F4KYLIF2.js → validation-VYE7TQY7.js} +5 -5
  72. package/dist/version.js +1 -1
  73. package/dist/{work-UUNMNSML.js → work-CTQFWYKE.js} +21 -21
  74. package/dist/{worker-PMIJ5NLD.js → worker-6WQU3IT5.js} +10 -10
  75. package/package.json +4 -4
  76. package/dist/spawn-HH7GH7XT.js +0 -42
  77. package/dist/task-runner-H5I7R3LJ.js +0 -36
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-AKR6W7VV.js";
11
+ } from "./chunk-2CYWEVOP.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-LRTEMMCZ.js";
15
+ } from "./chunk-IOUUS6H4.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-4Z7B5WVV.js";
18
+ } from "./chunk-WJJDQLVL.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-3ADPXQBL.js";
26
+ } from "./chunk-QY2IU47O.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-4Z7B5WVV.js";
7
+ } from "./chunk-WJJDQLVL.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AgentRunError,
3
3
  executeTurn
4
- } from "./chunk-BGLMT6KP.js";
4
+ } from "./chunk-DVU734PI.js";
5
5
  import {
6
6
  ConversationTurnLifecycleService
7
- } from "./chunk-PXUBRZBU.js";
7
+ } from "./chunk-WH5VV2RW.js";
8
8
  import {
9
9
  getPersistedSandboxState,
10
10
  getPersistedThreadState,
11
11
  persistThreadStateById
12
- } from "./chunk-Z4DNJI5F.js";
12
+ } from "./chunk-S5HS6WRH.js";
13
13
  import {
14
14
  AgentInvocationBusyError,
15
15
  AgentInvocationLimitError,
@@ -18,32 +18,32 @@ import {
18
18
  agentBindingSchema,
19
19
  agentInvocationSchema,
20
20
  createAgentInvocationSchema
21
- } from "./chunk-PXP2M32M.js";
21
+ } from "./chunk-LXRTHE43.js";
22
22
  import {
23
23
  TurnInputCommitLostError,
24
24
  getAssistantReplyText,
25
25
  getConversationTurnBoundaryError,
26
26
  isTurnInputCommitLostError
27
- } from "./chunk-7XO7PTZE.js";
27
+ } from "./chunk-K47OVEO4.js";
28
28
  import {
29
29
  failTurnRecord,
30
30
  getTerminalAssistantMessages,
31
31
  getTurnRecord,
32
32
  openConversationProjection,
33
33
  saveTurnCheckpoint
34
- } from "./chunk-VF3EDS7P.js";
34
+ } from "./chunk-ZFPEPWOO.js";
35
35
  import {
36
36
  appendAndEnqueueInboundMessage
37
- } from "./chunk-G4E5WIRL.js";
37
+ } from "./chunk-5LEVZYXF.js";
38
38
  import {
39
39
  getConversationEventStore,
40
40
  getConversationStore,
41
41
  getSqlExecutor
42
- } from "./chunk-AKR6W7VV.js";
42
+ } from "./chunk-2CYWEVOP.js";
43
43
  import {
44
44
  juniorAgentBindings,
45
45
  juniorAgentInvocations
46
- } from "./chunk-IBO4YFFZ.js";
46
+ } from "./chunk-5S6AQFNG.js";
47
47
 
48
48
  // src/chat/agent-invocations/work.ts
49
49
  import { z } from "zod";
@@ -111,7 +111,7 @@ function invocationFromRow(row) {
111
111
  });
112
112
  }
113
113
  function sameCreateInput(invocation, input) {
114
- return invocation.parentConversationId === input.parentConversationId && invocation.agentName === input.agentName && invocation.input === input.input && invocation.reasoningLevel === input.reasoningLevel && JSON.stringify(invocation.actor) === JSON.stringify(input.actor) && JSON.stringify(invocation.credentialContext) === JSON.stringify(input.credentialContext) && JSON.stringify(invocation.destination) === JSON.stringify(input.destination) && JSON.stringify(invocation.source) === JSON.stringify(input.source);
114
+ return invocation.parentConversationId === input.parentConversationId && invocation.agentName === input.agentName && invocation.input === input.input && invocation.reasoningLevel === input.reasoningLevel && JSON.stringify(invocation.actor) === JSON.stringify(input.actor) && JSON.stringify(invocation.credentialContext) === JSON.stringify(input.credentialContext) && JSON.stringify(invocation.destination) === JSON.stringify(input.destination);
115
115
  }
116
116
  async function getAgentBinding(args) {
117
117
  const rows = await getSqlExecutor().db().select().from(juniorAgentBindings).where(
@@ -223,7 +223,7 @@ async function createAgentInvocation(rawInput, nowMs = Date.now()) {
223
223
  input: input.input,
224
224
  actor: input.actor,
225
225
  credentialContext: input.credentialContext ?? null,
226
- source: input.source,
226
+ source: { kind: "agent_invocation" },
227
227
  destination: input.destination,
228
228
  reasoningLevel: input.reasoningLevel ?? null,
229
229
  status: "pending",
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-OBN7UEQJ.js";
3
+ } from "./chunk-D5YQPCEG.js";
4
4
  import {
5
5
  getPlugins
6
- } from "./chunk-BUTAWPUV.js";
6
+ } from "./chunk-FQ5HFSFR.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-AKR6W7VV.js";
9
+ } from "./chunk-2CYWEVOP.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-IBO4YFFZ.js";
17
+ } from "./chunk-5S6AQFNG.js";
18
18
  import {
19
19
  juniorDestinations
20
20
  } from "./chunk-VFUK3X5B.js";
@@ -560,13 +560,17 @@ function requireEventTaskSlackContext(context) {
560
560
  function eventTaskMatchesDestination(task, destination) {
561
561
  return task.destination.teamId === destination.teamId && task.destination.channelId === destination.channelId;
562
562
  }
563
+ function eventTaskIsWritableFrom(task, destination) {
564
+ if (task.destination.teamId !== destination.teamId) {
565
+ return false;
566
+ }
567
+ return task.destination.channelId === destination.channelId || task.destinationVisibility === "public";
568
+ }
563
569
  async function writableEventTask(context, id) {
564
570
  const { destination } = requireEventTaskSlackContext(context);
565
571
  const task = await getEventTask(getDb(), id);
566
- if (!task || !eventTaskMatchesDestination(task, destination)) {
567
- throw new ToolInputError(
568
- "Event task was not found in this Slack channel or DM."
569
- );
572
+ if (!task || !eventTaskIsWritableFrom(task, destination)) {
573
+ throw new ToolInputError("Event task was not found.");
570
574
  }
571
575
  return task;
572
576
  }
@@ -8,19 +8,19 @@ import {
8
8
  isDmChannel,
9
9
  normalizeSlackConversationId,
10
10
  withSlackRetries
11
- } from "./chunk-BUTAWPUV.js";
11
+ } from "./chunk-FQ5HFSFR.js";
12
12
  import {
13
13
  parseDestination
14
- } from "./chunk-AKR6W7VV.js";
14
+ } from "./chunk-2CYWEVOP.js";
15
15
  import {
16
16
  getStateAdapter
17
- } from "./chunk-LRTEMMCZ.js";
17
+ } from "./chunk-IOUUS6H4.js";
18
18
  import {
19
19
  normalizeSlackEmojiName
20
- } from "./chunk-4Z7B5WVV.js";
20
+ } from "./chunk-WJJDQLVL.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-FGYWKKTJ.js";
23
+ } from "./chunk-DXFUYLHX.js";
24
24
  import {
25
25
  parseSlackMessageTs,
26
26
  parseSlackUserId
@@ -29,7 +29,7 @@ import {
29
29
  isRecord,
30
30
  logInfo,
31
31
  logWarn
32
- } from "./chunk-3ADPXQBL.js";
32
+ } from "./chunk-QY2IU47O.js";
33
33
 
34
34
  // src/chat/agent/types.ts
35
35
  var RetryableDeliveryError = class extends Error {
@@ -109,7 +109,11 @@ function assertRunConsistency(run) {
109
109
  break;
110
110
  }
111
111
  case "resource_event":
112
- break;
112
+ case "scheduled_task":
113
+ case "event_task":
114
+ case "plugin_dispatch":
115
+ case "agent_invocation":
116
+ return;
113
117
  }
114
118
  const actor = run.dispatch?.actor ?? run.actor;
115
119
  if (!actor || actor.platform === "system") {
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-SSR6YBWW.js";
3
+ } from "./chunk-COCVPDWX.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins,
7
7
  getSlackClient,
8
8
  withSlackRetries
9
- } from "./chunk-BUTAWPUV.js";
9
+ } from "./chunk-FQ5HFSFR.js";
10
10
  import {
11
11
  getDb,
12
12
  parseDestination
13
- } from "./chunk-AKR6W7VV.js";
13
+ } from "./chunk-2CYWEVOP.js";
14
14
  import {
15
15
  sleep
16
- } from "./chunk-6LX6KV5C.js";
16
+ } from "./chunk-KWXZMHJS.js";
17
17
  import {
18
18
  acquireActiveLock,
19
19
  getStateAdapter
20
- } from "./chunk-LRTEMMCZ.js";
20
+ } from "./chunk-IOUUS6H4.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-FGYWKKTJ.js";
23
+ } from "./chunk-DXFUYLHX.js";
24
24
  import {
25
25
  fetchWithBoundedOAuthErrorBodies
26
- } from "./chunk-6FCKJDKS.js";
26
+ } from "./chunk-QWY4KI2V.js";
27
27
  import {
28
28
  isRecord
29
- } from "./chunk-3ADPXQBL.js";
29
+ } from "./chunk-QY2IU47O.js";
30
30
 
31
31
  // src/chat/capabilities/router.ts
32
32
  var ProviderCredentialRouter = class {
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-PDO5BLNM.js";
4
4
  import {
5
5
  botConfig
6
- } from "./chunk-4Z7B5WVV.js";
6
+ } from "./chunk-WJJDQLVL.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-3ADPXQBL.js";
9
+ } from "./chunk-QY2IU47O.js";
10
10
 
11
11
  // src/chat/conversations/structured-events.ts
12
12
  import {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ConversationTurnLifecycleService
3
- } from "./chunk-PXUBRZBU.js";
3
+ } from "./chunk-WH5VV2RW.js";
4
4
  import {
5
5
  runAgentWithTimeout
6
- } from "./chunk-SSR6YBWW.js";
6
+ } from "./chunk-COCVPDWX.js";
7
7
  import {
8
8
  getConversationEventStore
9
- } from "./chunk-AKR6W7VV.js";
9
+ } from "./chunk-2CYWEVOP.js";
10
10
 
11
11
  // src/chat/runtime/turn-execution.ts
12
12
  var AgentRunError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-6FCKJDKS.js";
3
+ } from "./chunk-QWY4KI2V.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-AKR6W7VV.js";
8
+ } from "./chunk-2CYWEVOP.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-IBO4YFFZ.js";
19
+ } from "./chunk-5S6AQFNG.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-6LX6KV5C.js";
27
+ } from "./chunk-KWXZMHJS.js";
28
28
  import {
29
29
  getStateAdapter
30
- } from "./chunk-LRTEMMCZ.js";
30
+ } from "./chunk-IOUUS6H4.js";
31
31
  import {
32
32
  botConfig,
33
33
  completeObject,
34
34
  embedTexts,
35
35
  getSlackBotToken
36
- } from "./chunk-4Z7B5WVV.js";
36
+ } from "./chunk-WJJDQLVL.js";
37
37
  import {
38
38
  defaultModelId
39
39
  } from "./chunk-D4YV5TDV.js";
@@ -52,7 +52,7 @@ import {
52
52
  setSpanAttributes,
53
53
  setSpanStatus,
54
54
  withSpan
55
- } from "./chunk-3ADPXQBL.js";
55
+ } from "./chunk-QY2IU47O.js";
56
56
 
57
57
  // src/chat/plugins/agent-hooks.ts
58
58
  import {
@@ -940,31 +940,30 @@ var RESOURCE_WATCH_TOOL_SOURCE = {
940
940
 
941
941
  // src/chat/slack/tool-support/context.ts
942
942
  function getSlackToolContext(context) {
943
- if (context.source.kind !== "slack") {
944
- return void 0;
945
- }
946
- if (context.destination.platform !== "slack") {
947
- throw new TypeError("Slack source requires a Slack destination");
948
- }
943
+ const source = context.source.kind === "slack" ? context.source : void 0;
944
+ const location = context.location?.provider === "slack" ? context.location : source ? {
945
+ provider: "slack",
946
+ teamId: source.teamId,
947
+ channelId: source.channelId,
948
+ threadTs: source.threadTs
949
+ } : void 0;
950
+ if (!location) return void 0;
949
951
  const destinationChannelId = parseSlackChannelReferenceId(
950
- context.destination.channelId
952
+ context.destination.platform === "slack" ? context.destination.channelId : location.channelId
951
953
  );
952
- const sourceChannelId = parseSlackChannelReferenceId(
953
- context.source.channelId
954
- );
955
- const teamId = parseSlackTeamId(context.source.teamId);
956
- if (!destinationChannelId || !sourceChannelId || !teamId) {
954
+ const locationChannelId = parseSlackChannelReferenceId(location.channelId);
955
+ const teamId = parseSlackTeamId(location.teamId);
956
+ if (!destinationChannelId || !locationChannelId || !teamId) {
957
957
  return void 0;
958
958
  }
959
959
  return {
960
- destination: context.destination,
961
- source: context.source,
962
960
  actor: context.actor?.platform === "slack" ? context.actor : void 0,
963
961
  destinationChannelId,
964
- messageTs: parseSlackMessageTs(context.source.messageTs),
965
- sourceChannelId,
962
+ locationChannelId,
963
+ messageChannelId: source ? parseSlackChannelReferenceId(source.channelId) : void 0,
964
+ messageTs: parseSlackMessageTs(source?.messageTs),
966
965
  teamId,
967
- threadTs: parseSlackMessageTs(context.source.threadTs)
966
+ threadTs: parseSlackMessageTs(location.threadTs)
968
967
  };
969
968
  }
970
969
 
@@ -2377,9 +2376,13 @@ function pluginInvocationContext(context) {
2377
2376
  source: context.source
2378
2377
  };
2379
2378
  case "resource_event":
2379
+ case "scheduled_task":
2380
+ case "event_task":
2381
+ case "plugin_dispatch":
2382
+ case "agent_invocation":
2380
2383
  return {
2381
2384
  ...common,
2382
- actor: context.actor?.platform === "system" ? context.actor : void 0,
2385
+ actor: context.actor,
2383
2386
  destination: context.destination,
2384
2387
  source: context.source
2385
2388
  };
@@ -2565,7 +2568,7 @@ function applyPluginFormatMarkdown(text) {
2565
2568
  }
2566
2569
  return transformed;
2567
2570
  }
2568
- async function getPluginSystemPromptContributions(source) {
2571
+ async function getPluginSystemPromptContributions(platform) {
2569
2572
  const contributions = [];
2570
2573
  let totalChars = 0;
2571
2574
  for (const plugin of getPlugins()) {
@@ -2577,8 +2580,7 @@ async function getPluginSystemPromptContributions(source) {
2577
2580
  try {
2578
2581
  const pluginContributions = await hook({
2579
2582
  ...systemPromptPluginContext(plugin),
2580
- // Plugin system prompts only distinguish Slack vs non-Slack surfaces.
2581
- platform: source.kind === "slack" ? "slack" : "local"
2583
+ platform
2582
2584
  });
2583
2585
  const result = systemPromptMessageArraySchema.safeParse(pluginContributions);
2584
2586
  if (!result.success) {
@@ -2693,7 +2695,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2693
2695
  }
2694
2696
  const slackToolContext = getSlackToolContext(context);
2695
2697
  const credentialSubject = slackToolContext ? createSlackDirectCredentialSubject({
2696
- channelId: slackToolContext.sourceChannelId,
2698
+ channelId: slackToolContext.locationChannelId,
2697
2699
  teamId: slackToolContext.teamId,
2698
2700
  userId: slackToolContext.actor?.userId
2699
2701
  }) : void 0;
@@ -2702,7 +2704,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2702
2704
  );
2703
2705
  const slackContext = slackToolContext ? {
2704
2706
  channelCapabilities: resolveChannelCapabilities(
2705
- slackToolContext.sourceChannelId
2707
+ slackToolContext.locationChannelId
2706
2708
  ),
2707
2709
  ...dashboardConversationUrl ? { conversationLink: { url: dashboardConversationUrl } } : void 0,
2708
2710
  ...credentialSubject ? { credentialSubject } : void 0
@@ -2758,6 +2760,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2758
2760
  annotations,
2759
2761
  conversationId: context.conversationId,
2760
2762
  locationId: context.locationId,
2763
+ ...slackContext ? { slack: slackContext } : void 0,
2761
2764
  userText: context.userText,
2762
2765
  embedder: createPluginEmbedder(pluginName),
2763
2766
  egress: context.egress,
@@ -2785,7 +2788,6 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2785
2788
  ...common,
2786
2789
  actor: context.actor?.platform === "slack" ? context.actor : void 0,
2787
2790
  destination: context.destination,
2788
- slack: slackContext,
2789
2791
  source: context.source
2790
2792
  };
2791
2793
  break;
@@ -2811,9 +2813,13 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2811
2813
  };
2812
2814
  break;
2813
2815
  case "resource_event":
2816
+ case "scheduled_task":
2817
+ case "event_task":
2818
+ case "plugin_dispatch":
2819
+ case "agent_invocation":
2814
2820
  pluginContext = {
2815
2821
  ...common,
2816
- actor: context.actor?.platform === "system" ? context.actor : void 0,
2822
+ actor: context.actor,
2817
2823
  destination: context.destination,
2818
2824
  source: context.source
2819
2825
  };
@@ -2,16 +2,16 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-Z4DNJI5F.js";
5
+ } from "./chunk-S5HS6WRH.js";
6
6
  import {
7
7
  clearPendingAuth,
8
8
  markTurnClosed,
9
9
  markTurnCompleted
10
- } from "./chunk-7XO7PTZE.js";
10
+ } from "./chunk-K47OVEO4.js";
11
11
  import {
12
12
  hydrateConversationMessages,
13
13
  markConversationMessage
14
- } from "./chunk-VF3EDS7P.js";
14
+ } from "./chunk-ZFPEPWOO.js";
15
15
  import {
16
16
  buildDeterministicTurnId
17
17
  } from "./chunk-DA2KGZZI.js";
@@ -20,13 +20,13 @@ import {
20
20
  findProviderError,
21
21
  getProviderErrorAttributes,
22
22
  getProviderErrorUserMessage
23
- } from "./chunk-4Z7B5WVV.js";
23
+ } from "./chunk-WJJDQLVL.js";
24
24
  import {
25
25
  parseSlackMessageTs
26
26
  } from "./chunk-N7TMSOZH.js";
27
27
  import {
28
28
  buildTurnFailureResponse
29
- } from "./chunk-3ADPXQBL.js";
29
+ } from "./chunk-QY2IU47O.js";
30
30
 
31
31
  // src/chat/runtime/delivered-turn-state.ts
32
32
  function buildDeliveredTurnStatePatch(args) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-FGYWKKTJ.js";
3
+ } from "./chunk-DXFUYLHX.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getDb
3
- } from "./chunk-AKR6W7VV.js";
3
+ } from "./chunk-2CYWEVOP.js";
4
4
  import {
5
5
  juniorConversations,
6
6
  juniorTaskExecutions
7
- } from "./chunk-IBO4YFFZ.js";
7
+ } from "./chunk-5S6AQFNG.js";
8
8
  import {
9
9
  logWarn
10
- } from "./chunk-3ADPXQBL.js";
10
+ } from "./chunk-QY2IU47O.js";
11
11
 
12
12
  // src/chat/tasks/execution-stats.ts
13
13
  import {
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-N7TMSOZH.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-3ADPXQBL.js";
8
+ } from "./chunk-QY2IU47O.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -6,14 +6,14 @@ import {
6
6
  isStale,
7
7
  runNonInteractiveCommand,
8
8
  sleep
9
- } from "./chunk-6LX6KV5C.js";
9
+ } from "./chunk-KWXZMHJS.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-LRTEMMCZ.js";
12
+ } from "./chunk-IOUUS6H4.js";
13
13
  import {
14
14
  setSpanAttributes,
15
15
  withSpan
16
- } from "./chunk-3ADPXQBL.js";
16
+ } from "./chunk-QY2IU47O.js";
17
17
 
18
18
  // src/chat/sandbox/resources.ts
19
19
  var configuredResources;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-4Z7B5WVV.js";
3
+ } from "./chunk-WJJDQLVL.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-4Z7B5WVV.js";
4
+ } from "./chunk-WJJDQLVL.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  abandonTurnRecord,
3
3
  extractAssistantText
4
- } from "./chunk-VF3EDS7P.js";
4
+ } from "./chunk-ZFPEPWOO.js";
5
5
  import {
6
6
  buildDeterministicTurnId
7
7
  } from "./chunk-DA2KGZZI.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-4Z7B5WVV.js";
3
+ } from "./chunk-WJJDQLVL.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-FGYWKKTJ.js";
6
+ } from "./chunk-DXFUYLHX.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-3ADPXQBL.js";
10
+ } from "./chunk-QY2IU47O.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -3,39 +3,39 @@ import {
3
3
  } from "./chunk-RC745GGZ.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-4WIA45WD.js";
6
+ } from "./chunk-HMBTX5RK.js";
7
7
  import {
8
8
  appendAndEnqueueExclusiveInboundMessage,
9
9
  appendAndEnqueueInboundMessage
10
- } from "./chunk-G4E5WIRL.js";
10
+ } from "./chunk-5LEVZYXF.js";
11
11
  import {
12
12
  buildDeterministicTurnId
13
13
  } from "./chunk-DA2KGZZI.js";
14
14
  import {
15
15
  normalizeSlackConversationId
16
- } from "./chunk-BUTAWPUV.js";
16
+ } from "./chunk-FQ5HFSFR.js";
17
17
  import {
18
18
  getConversationStore,
19
19
  getDb
20
- } from "./chunk-AKR6W7VV.js";
20
+ } from "./chunk-2CYWEVOP.js";
21
21
  import {
22
22
  juniorConversationParticipants,
23
23
  juniorConversations,
24
24
  juniorIdentities,
25
25
  juniorUsers
26
- } from "./chunk-IBO4YFFZ.js";
26
+ } from "./chunk-5S6AQFNG.js";
27
27
  import {
28
28
  juniorDestinations
29
29
  } from "./chunk-VFUK3X5B.js";
30
30
  import {
31
31
  getSlackBotToken
32
- } from "./chunk-4Z7B5WVV.js";
32
+ } from "./chunk-WJJDQLVL.js";
33
33
  import {
34
34
  canExposeConversationPayload
35
- } from "./chunk-EYNUOZCN.js";
35
+ } from "./chunk-OICYQPKP.js";
36
36
  import {
37
37
  logWarn
38
- } from "./chunk-3ADPXQBL.js";
38
+ } from "./chunk-QY2IU47O.js";
39
39
 
40
40
  // src/handlers/health.ts
41
41
  function readHealthReport() {