@sentry/junior 0.189.0 → 0.191.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 (86) hide show
  1. package/dist/{agent-hooks-6QRYH6PX.js → agent-hooks-HIWWBBKO.js} +11 -11
  2. package/dist/api.js +27 -27
  3. package/dist/app.js +134 -152
  4. package/dist/{catalog-runtime-IETJLJFG.js → catalog-runtime-4OKH4265.js} +4 -4
  5. package/dist/chat/actor.d.ts +7 -2
  6. package/dist/chat/agent/resume.d.ts +0 -1
  7. package/dist/chat/agent/types.d.ts +0 -1
  8. package/dist/chat/agent-invocations/types.d.ts +44 -308
  9. package/dist/chat/event-tasks/tool-support.d.ts +1 -1
  10. package/dist/chat/providers/slack/runtime.d.ts +1 -2
  11. package/dist/chat/providers/slack/system-turn.d.ts +9 -4
  12. package/dist/chat/providers/slack/turn.d.ts +0 -1
  13. package/dist/chat/resource-events/actor.d.ts +2 -2
  14. package/dist/chat/services/turn-router.d.ts +1 -1
  15. package/dist/chat/slack/dispatch-turn.d.ts +0 -1
  16. package/dist/chat/slack/timestamp-param.d.ts +1 -1
  17. package/dist/chat/source.d.ts +3 -3
  18. package/dist/chat/task-execution/assistant-message.d.ts +7 -7
  19. package/dist/chat/task-execution/checkpoint.d.ts +0 -1
  20. package/dist/chat/task-execution/conversation-turn.d.ts +2 -2
  21. package/dist/chat/task-execution/mailbox-turn.d.ts +16 -6
  22. package/dist/chat/task-execution/state.d.ts +2 -5
  23. package/dist/chat/task-execution/store.d.ts +1 -2
  24. package/dist/chat/task-execution/turn-cursor.d.ts +10 -3
  25. package/dist/chat/task-execution/worker.d.ts +0 -1
  26. package/dist/chat/tools/types.d.ts +9 -2
  27. package/dist/{chunk-BYBSI5TI.js → chunk-2JAWOTUT.js} +2 -2
  28. package/dist/{chunk-WN6VLHOU.js → chunk-3PDR63SX.js} +30 -9
  29. package/dist/{chunk-SR6OMO5C.js → chunk-5IMKUVMS.js} +8 -11
  30. package/dist/{chunk-YYSEH2WC.js → chunk-6KISW5UY.js} +2 -2
  31. package/dist/{chunk-WDHPN2GH.js → chunk-7PYCRKQL.js} +3 -3
  32. package/dist/{chunk-YNZPOFF3.js → chunk-AWFSSFAX.js} +9 -11
  33. package/dist/{chunk-OEIITG5F.js → chunk-BVWC5DBM.js} +1 -1
  34. package/dist/{chunk-DYXVAO2E.js → chunk-BVYUIVXE.js} +1 -1
  35. package/dist/{chunk-WYDF6PGK.js → chunk-CCPOZMS4.js} +3 -3
  36. package/dist/{chunk-YYZNESC3.js → chunk-CECRMPXJ.js} +9 -8
  37. package/dist/{chunk-6AUR6PWR.js → chunk-CUUE5MGF.js} +3 -3
  38. package/dist/{chunk-MVPLEPSI.js → chunk-DP6H3U2X.js} +1 -1
  39. package/dist/{chunk-E3PDZPGV.js → chunk-EQZUBYRF.js} +1 -1
  40. package/dist/{chunk-PCPSX4ES.js → chunk-GQN4REF5.js} +14 -12
  41. package/dist/{chunk-AC7MDOJW.js → chunk-HNMRX2EN.js} +5 -5
  42. package/dist/{chunk-7R5JRPCY.js → chunk-K2NKG42A.js} +5 -5
  43. package/dist/{chunk-MFSET7Q7.js → chunk-KTW62MG5.js} +31 -13
  44. package/dist/{chunk-PY3EIEAF.js → chunk-L4JLLS6C.js} +1 -1
  45. package/dist/{chunk-CMWIMFM6.js → chunk-LOYTPSAK.js} +5 -5
  46. package/dist/{chunk-S3SGZUOI.js → chunk-MFZOIKET.js} +1 -1
  47. package/dist/{chunk-MI6ZBDTS.js → chunk-NK3UEKAW.js} +25 -10
  48. package/dist/{chunk-QNIOBNOY.js → chunk-NY5SJGJZ.js} +52 -46
  49. package/dist/{chunk-4RHJ3CXR.js → chunk-Q32BSFN4.js} +13 -12
  50. package/dist/{chunk-ZV6PFUA4.js → chunk-QRNJO7DZ.js} +1 -1
  51. package/dist/{chunk-KN32OWL2.js → chunk-RZS4F5K4.js} +3 -3
  52. package/dist/{chunk-CUYFCI4G.js → chunk-S7NSFCCW.js} +16 -13
  53. package/dist/{chunk-5VWAY27R.js → chunk-SEIZ2XLD.js} +1 -1
  54. package/dist/{chunk-MRXMFB4L.js → chunk-SGRL7NV6.js} +5 -5
  55. package/dist/{chunk-WWYUYKKV.js → chunk-TH6LMEOW.js} +1 -1
  56. package/dist/{chunk-WMUAKAIF.js → chunk-VGYZ3YZM.js} +85 -41
  57. package/dist/{chunk-ZUPDSJUE.js → chunk-WBNQYVCM.js} +2 -2
  58. package/dist/{chunk-GP32KD2J.js → chunk-WCSXTDOL.js} +1 -1
  59. package/dist/{chunk-O35GZCKL.js → chunk-WNIVCR74.js} +2 -2
  60. package/dist/{chunk-UCWO5MKP.js → chunk-X6PQKQTY.js} +5 -7
  61. package/dist/{chunk-5CXCGDIL.js → chunk-YNRLCUCB.js} +1 -1
  62. package/dist/{chunk-LHKZKAZ4.js → chunk-ZJRGWZZ2.js} +3 -3
  63. package/dist/{chunk-NY2F7BZA.js → chunk-ZNFNGDT7.js} +1 -1
  64. package/dist/{chunk-VKQWU4PO.js → chunk-ZRN3OS7M.js} +1 -1
  65. package/dist/cli/chat.js +33 -33
  66. package/dist/cli/check.js +5 -5
  67. package/dist/cli/plugins.js +12 -12
  68. package/dist/cli/snapshot-create.js +9 -9
  69. package/dist/cli/upgrade.js +6 -6
  70. package/dist/db/schema/agent-invocations.d.ts +18 -6
  71. package/dist/db/schema.d.ts +18 -6
  72. package/dist/{db-LPJKR2EO.js → db-LG4ZEWA3.js} +6 -6
  73. package/dist/instrumentation.js +3 -3
  74. package/dist/nitro.js +6 -6
  75. package/dist/{oauth-callback-server-DMXF4TTQ.js → oauth-callback-server-KI7ZRTOG.js} +29 -29
  76. package/dist/{runner-L5DPVYCN.js → runner-K2EOSAZQ.js} +21 -21
  77. package/dist/{skills-NXG3LBCK.js → skills-JTRDFKMA.js} +5 -5
  78. package/dist/spawn-SRBETYCF.js +42 -0
  79. package/dist/task-runner-INQIQ4VF.js +36 -0
  80. package/dist/{validation-CH36LTOS.js → validation-NBWURHAP.js} +5 -5
  81. package/dist/version.js +1 -1
  82. package/dist/{work-HBC5Y5VZ.js → work-35TBEAUI.js} +21 -21
  83. package/dist/{worker-5RDZHLXH.js → worker-F762M6XM.js} +10 -10
  84. package/package.json +6 -6
  85. package/dist/spawn-VRUIGKWW.js +0 -42
  86. package/dist/task-runner-7YTBSPXW.js +0 -36
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-AC7MDOJW.js";
10
+ } from "./chunk-HNMRX2EN.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-YYZNESC3.js";
41
+ } from "./chunk-CECRMPXJ.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-PCPSX4ES.js";
55
+ } from "./chunk-GQN4REF5.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-GP32KD2J.js";
68
+ } from "./chunk-WCSXTDOL.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-MFSET7Q7.js";
122
+ } from "./chunk-KTW62MG5.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-CMWIMFM6.js";
163
+ } from "./chunk-LOYTPSAK.js";
164
164
  import {
165
165
  parseSlackThreadId
166
- } from "./chunk-MVPLEPSI.js";
166
+ } from "./chunk-DP6H3U2X.js";
167
167
  import {
168
168
  appendAndEnqueueInboundMessage
169
- } from "./chunk-WN6VLHOU.js";
169
+ } from "./chunk-3PDR63SX.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-O35GZCKL.js";
177
+ } from "./chunk-WNIVCR74.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-6AUR6PWR.js";
188
+ } from "./chunk-CUUE5MGF.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-S3SGZUOI.js";
198
+ } from "./chunk-MFZOIKET.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-MI6ZBDTS.js";
245
+ } from "./chunk-NK3UEKAW.js";
246
246
  import {
247
247
  getConversationEventStore,
248
248
  getConversationMessageSearchStore,
249
249
  getConversationStore,
250
250
  getDb,
251
251
  getSqlExecutor
252
- } from "./chunk-CUYFCI4G.js";
252
+ } from "./chunk-S7NSFCCW.js";
253
253
  import {
254
254
  juniorArtifacts,
255
255
  juniorIdentities,
256
256
  juniorSchedulerRuns
257
- } from "./chunk-5VWAY27R.js";
257
+ } from "./chunk-SEIZ2XLD.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-WDHPN2GH.js";
288
+ } from "./chunk-7PYCRKQL.js";
289
289
  import {
290
290
  fenceLock,
291
291
  getStateAdapter,
292
292
  withLock
293
- } from "./chunk-5CXCGDIL.js";
293
+ } from "./chunk-YNRLCUCB.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-BYBSI5TI.js";
326
+ } from "./chunk-2JAWOTUT.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-DYXVAO2E.js";
343
+ } from "./chunk-BVYUIVXE.js";
344
344
  import {
345
345
  discoverSkills,
346
346
  findSkillByName,
347
347
  loadSkillsByName,
348
348
  parseSkillInvocation
349
- } from "./chunk-YYSEH2WC.js";
349
+ } from "./chunk-6KISW5UY.js";
350
350
  import {
351
351
  pluginCatalogRuntime
352
- } from "./chunk-E3PDZPGV.js";
352
+ } from "./chunk-EQZUBYRF.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-ZV6PFUA4.js";
360
+ } from "./chunk-QRNJO7DZ.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-PY3EIEAF.js";
396
+ } from "./chunk-L4JLLS6C.js";
397
397
  import {
398
398
  startInactiveSpan,
399
399
  withActiveSpan
@@ -1840,21 +1840,28 @@ function buildRuntimeSection(params) {
1840
1840
  return renderTagBlock("runtime", lines.join("\n"));
1841
1841
  }
1842
1842
  function formatSourceLines(source) {
1843
- switch (source.platform) {
1843
+ switch (source.kind) {
1844
1844
  case "web":
1845
1845
  case "local":
1846
1846
  return [
1847
- `- source.platform: ${source.platform}`,
1847
+ `- source.kind: ${source.kind}`,
1848
1848
  `- source.conversation_id: ${escapeXml(source.conversationId)}`
1849
1849
  ];
1850
1850
  case "slack":
1851
1851
  return [
1852
- "- source.platform: slack",
1852
+ "- source.kind: slack",
1853
1853
  `- source.team_id: ${escapeXml(source.teamId)}`,
1854
1854
  `- source.channel_id: ${escapeXml(source.channelId)}`,
1855
1855
  ...source.messageTs ? [`- source.message_ts: ${escapeXml(source.messageTs)}`] : [],
1856
1856
  ...source.threadTs ? [`- source.thread_ts: ${escapeXml(source.threadTs)}`] : []
1857
1857
  ];
1858
+ case "resource_event":
1859
+ return [
1860
+ "- source.kind: resource_event",
1861
+ `- source.namespace: ${escapeXml(source.namespace)}`,
1862
+ `- source.identifier: ${escapeXml(source.identifier)}`,
1863
+ `- source.event_type: ${escapeXml(source.eventType)}`
1864
+ ];
1858
1865
  }
1859
1866
  }
1860
1867
  function formatDestinationLines(destination) {
@@ -1999,7 +2006,7 @@ var STATIC_SYSTEM_PROMPTS = {
1999
2006
  slack: buildStaticSystemPrompt("slack")
2000
2007
  };
2001
2008
  function buildSystemPrompt(params) {
2002
- const platform = params.source.platform === "slack" ? "slack" : "local";
2009
+ const platform = params.source.kind === "slack" ? "slack" : "local";
2003
2010
  return STATIC_SYSTEM_PROMPTS[platform];
2004
2011
  }
2005
2012
  function buildTurnContextPrompt(params) {
@@ -3213,10 +3220,6 @@ function createResourceEventInboundMessage(input) {
3213
3220
  delivery: "defer",
3214
3221
  source: "resource_event",
3215
3222
  receivedAtMs: input.receivedAtMs ?? Date.now(),
3216
- // TODO(dcramer): Store the final publish fact here after resource-event
3217
- // ingress loads the Conversation. Then remove the worker's Location-based
3218
- // publish default. Resource events only wake the mailbox until that change.
3219
- publishExternally: false,
3220
3223
  input: {
3221
3224
  text: input.text,
3222
3225
  authorId: RESOURCE_EVENT_AUTHOR_ID,
@@ -9133,7 +9136,7 @@ function createUpdateEventTaskTool(context, catalog) {
9133
9136
 
9134
9137
  // src/chat/tools/event-tasks.ts
9135
9138
  function createEventTaskTools(context, catalog) {
9136
- if (context.source.platform !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack") {
9139
+ if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack") {
9137
9140
  return {};
9138
9141
  }
9139
9142
  const canCreate = hasPluginResourceEventCatalogEntries(catalog);
@@ -9803,7 +9806,7 @@ function requireActiveConversation(context) {
9803
9806
  if (!parsed.success) {
9804
9807
  const source = context.source;
9805
9808
  const issues = parsed.error.issues;
9806
- if (!source || source.platform !== "slack") {
9809
+ if (!source || source.kind !== "slack") {
9807
9810
  throwToolInputError("No active Slack conversation is available.");
9808
9811
  }
9809
9812
  if (issues.some((issue) => issue.code === "unrecognized_keys")) {
@@ -9819,7 +9822,7 @@ function requireActiveConversation(context) {
9819
9822
  }
9820
9823
  throwToolInputError("No active Slack conversation is available.");
9821
9824
  }
9822
- if (parsed.data.platform !== "slack") {
9825
+ if (parsed.data.kind !== "slack") {
9823
9826
  throwToolInputError("No active Slack conversation is available.");
9824
9827
  }
9825
9828
  return {
@@ -10399,7 +10402,7 @@ function createSlackScheduleUpdateTaskTool(context) {
10399
10402
 
10400
10403
  // src/chat/tools/scheduled-tasks.ts
10401
10404
  function scheduledTaskToolContext(context) {
10402
- if (context.source.platform !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack" || !context.resolveActorIdentity) {
10405
+ if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack" || !context.resolveActorIdentity) {
10403
10406
  return void 0;
10404
10407
  }
10405
10408
  return {
@@ -13696,7 +13699,7 @@ async function resolveAccessScope(conversationStore, context, currentConversatio
13696
13699
  currentConversationId,
13697
13700
  current.parentConversationId
13698
13701
  ) : currentConversationId;
13699
- if (context.source.platform === "slack") {
13702
+ if (context.source.kind === "slack") {
13700
13703
  return {
13701
13704
  currentConversationId,
13702
13705
  currentRootConversationId,
@@ -14926,7 +14929,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
14926
14929
  context.conversationId
14927
14930
  );
14928
14931
  }
14929
- if (context.source.platform === "slack") {
14932
+ if (context.source.kind === "slack") {
14930
14933
  tools.slackPublicSearch = createSlackPublicSearchTool(
14931
14934
  context.slackActionToken
14932
14935
  );
@@ -17513,7 +17516,7 @@ async function tryRecordSkillLoadStat(skill) {
17513
17516
  }
17514
17517
  function resolveToolRuntimeRoute(args) {
17515
17518
  const destination = toolInvocationDestination(args.run);
17516
- switch (args.run.source.platform) {
17519
+ switch (args.run.source.kind) {
17517
17520
  case "slack": {
17518
17521
  if (destination.platform !== "slack") {
17519
17522
  throw new TypeError("Slack tool runtime requires a Slack destination");
@@ -17541,6 +17544,12 @@ function resolveToolRuntimeRoute(args) {
17541
17544
  actor: args.actor?.platform === "web" ? args.actor : void 0,
17542
17545
  source: args.run.source
17543
17546
  };
17547
+ case "resource_event":
17548
+ return {
17549
+ destination,
17550
+ actor: args.actor?.platform === "system" ? args.actor : void 0,
17551
+ source: args.run.source
17552
+ };
17544
17553
  }
17545
17554
  }
17546
17555
  async function wireAgentTools(args) {
@@ -17579,7 +17588,7 @@ async function wireAgentTools(args) {
17579
17588
  channelId: slackChannelId,
17580
17589
  destination: args.run.destination,
17581
17590
  source: runSource,
17582
- threadTs: args.run.source.platform === "slack" ? args.run.source.threadTs : void 0,
17591
+ threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
17583
17592
  toolChannelId: args.run.toolChannelId,
17584
17593
  userMessage: args.userInput,
17585
17594
  pendingAuth: args.state.pendingAuth,
@@ -17600,7 +17609,7 @@ async function wireAgentTools(args) {
17600
17609
  channelId: slackChannelId,
17601
17610
  destination: args.run.destination,
17602
17611
  source: runSource,
17603
- threadTs: args.run.source.platform === "slack" ? args.run.source.threadTs : void 0,
17612
+ threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
17604
17613
  userMessage: args.userInput,
17605
17614
  pendingAuth: args.state.pendingAuth,
17606
17615
  recordPendingAuth: args.durability.recordPendingAuth,
@@ -17868,7 +17877,6 @@ function createResumeState(args) {
17868
17877
  channelName: args.channelName,
17869
17878
  destination: args.destination,
17870
17879
  dispatchId: args.dispatchId,
17871
- publishExternally: args.publishExternally,
17872
17880
  source: args.runSource,
17873
17881
  actor: args.actor,
17874
17882
  surface: args.surface
@@ -18634,9 +18642,9 @@ async function executeAgentRun(run, streamFn) {
18634
18642
  const userActor = actor && "userId" in actor ? actor : void 0;
18635
18643
  const runLogContext = {
18636
18644
  conversationId: run.conversationId,
18637
- platform: run.source.platform,
18638
- messageConversationId: run.source.platform === "slack" ? run.conversationId : run.source.conversationId,
18639
- destinationName: run.location?.channelId ?? (run.source.platform === "slack" ? run.source.channelId : run.source.conversationId),
18645
+ platform: run.source.kind,
18646
+ messageConversationId: run.source.kind === "slack" ? run.conversationId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId,
18647
+ destinationName: run.location?.channelId ?? (run.source.kind === "slack" ? run.source.channelId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId),
18640
18648
  userId: userActor?.userId,
18641
18649
  userName: userActor?.userName,
18642
18650
  userEmail: userActor?.email,
@@ -18679,7 +18687,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
18679
18687
  slackConversation: run.slackConversation,
18680
18688
  slackActionToken: run.slackActionToken,
18681
18689
  destination: run.destination,
18682
- publishExternally: run.publishExternally,
18683
18690
  surface: run.surface,
18684
18691
  dispatch: run.dispatch,
18685
18692
  toolChannelId: run.toolChannelId
@@ -18748,7 +18755,7 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
18748
18755
  const actor = actorFromRun(run);
18749
18756
  const surface = surfaceFromRun(run);
18750
18757
  const runSource = routing.source;
18751
- const slackSource = runSource.platform === "slack" ? runSource : void 0;
18758
+ const slackSource = runSource.kind === "slack" ? runSource : void 0;
18752
18759
  const slackChannelId = run.location?.channelId ?? slackSource?.channelId;
18753
18760
  const slackActor = actor?.platform === "slack" ? actor : void 0;
18754
18761
  const userInput = input.messageText;
@@ -18834,7 +18841,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
18834
18841
  ...routing.dispatch?.id ? { dispatchId: routing.dispatch.id } : void 0,
18835
18842
  durability,
18836
18843
  recordActiveMcpProviders,
18837
- publishExternally: checkpoint.record?.publishExternally ?? routing.publishExternally ?? false,
18838
18844
  actor,
18839
18845
  runSource,
18840
18846
  conversationId,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState
4
- } from "./chunk-MRXMFB4L.js";
4
+ } from "./chunk-SGRL7NV6.js";
5
5
  import {
6
6
  recordTaskExecution
7
- } from "./chunk-LHKZKAZ4.js";
7
+ } from "./chunk-ZJRGWZZ2.js";
8
8
  import {
9
9
  pluginTaskId,
10
10
  pluginTaskParamsSchema,
11
11
  sendVercelPluginTask
12
- } from "./chunk-KN32OWL2.js";
12
+ } from "./chunk-RZS4F5K4.js";
13
13
  import {
14
14
  getPiMessageRole,
15
15
  getTurnRecord,
@@ -19,7 +19,7 @@ import {
19
19
  isToolResultMessage,
20
20
  normalizeToolNameFromResult,
21
21
  stripRuntimeTurnContext
22
- } from "./chunk-MFSET7Q7.js";
22
+ } from "./chunk-KTW62MG5.js";
23
23
  import {
24
24
  createPluginConversationEvents,
25
25
  createPluginEmbedder,
@@ -28,17 +28,17 @@ import {
28
28
  createPluginState,
29
29
  getPlugins,
30
30
  readActorIdentity
31
- } from "./chunk-MI6ZBDTS.js";
31
+ } from "./chunk-NK3UEKAW.js";
32
32
  import {
33
33
  JUNIOR_THREAD_STATE_TTL_MS
34
34
  } from "./chunk-3Y47VMHV.js";
35
35
  import {
36
36
  getConversationStore,
37
37
  getDb
38
- } from "./chunk-CUYFCI4G.js";
38
+ } from "./chunk-S7NSFCCW.js";
39
39
  import {
40
40
  getStateAdapter
41
- } from "./chunk-5CXCGDIL.js";
41
+ } from "./chunk-YNRLCUCB.js";
42
42
  import {
43
43
  sameActorIdentity
44
44
  } from "./chunk-GFBR4S3Q.js";
@@ -71,12 +71,12 @@ async function loadConversationChain(conversationId, conversationStore) {
71
71
  return chain;
72
72
  }
73
73
  function slackSourceForDestination(args) {
74
- if (args.source?.platform !== "slack" || args.source.channelId !== args.destination.channelId) {
74
+ if (args.source?.kind !== "slack" || args.source.channelId !== args.destination.channelId) {
75
75
  return void 0;
76
76
  }
77
77
  const threadTs = args.source.threadTs?.trim();
78
78
  return {
79
- platform: "slack",
79
+ kind: "slack",
80
80
  visibility: args.source.visibility ?? "public",
81
81
  teamId: args.source.teamId?.trim() || args.destination.teamId,
82
82
  channelId: args.source.channelId,
@@ -84,7 +84,7 @@ function slackSourceForDestination(args) {
84
84
  };
85
85
  }
86
86
  async function resolveConversationRouting(args) {
87
- const conversationStore = args.conversationStore ?? (await import("./db-LPJKR2EO.js")).getConversationStore();
87
+ const conversationStore = args.conversationStore ?? (await import("./db-LG4ZEWA3.js")).getConversationStore();
88
88
  const chain = await loadConversationChain(
89
89
  args.conversationId,
90
90
  conversationStore
@@ -611,7 +611,7 @@ function messageExistedAtRunCompletion(message, completedAtMs) {
611
611
  return messageTimestampMs !== void 0 && messageTimestampMs <= completedAtMs;
612
612
  }
613
613
  async function loadConversationContextTranscriptEntries(record, source, runActor) {
614
- switch (source.platform) {
614
+ switch (source.kind) {
615
615
  case "slack":
616
616
  if (source.visibility === "private") {
617
617
  return [];
@@ -619,6 +619,7 @@ async function loadConversationContextTranscriptEntries(record, source, runActor
619
619
  break;
620
620
  case "web":
621
621
  case "local":
622
+ case "resource_event":
622
623
  return [];
623
624
  }
624
625
  const state = await getPersistedThreadState(record.conversationId);
@@ -680,7 +681,7 @@ async function loadPluginRun(params) {
680
681
  const routing = await resolveTurnSessionRouting({
681
682
  conversationId: params.conversationId
682
683
  });
683
- const runActor = record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
684
+ const runActor = record.actor ?? record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
684
685
  const actorUser = runActor ? (await readActorIdentity(runActor))?.user : void 0;
685
686
  const runEntries = turnMessagesWithProvenance(record).map(
686
687
  ({ message, provenance }) => runTranscriptEntry(message, provenance, runActor)
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-PY3EIEAF.js";
15
+ } from "./chunk-L4JLLS6C.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runWithTurnRequestDeadline
3
- } from "./chunk-S3SGZUOI.js";
3
+ } from "./chunk-MFZOIKET.js";
4
4
  import {
5
5
  QUEUE_SIGNATURE_MAX_AGE_MS,
6
6
  createVercelQueueClient,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-7H2VZTWN.js";
10
10
  import {
11
11
  logWarn
12
- } from "./chunk-PY3EIEAF.js";
12
+ } from "./chunk-L4JLLS6C.js";
13
13
 
14
14
  // src/chat/plugins/task-queue.ts
15
15
  import { createHash } from "crypto";
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
129
129
  onRejected: logPluginTaskQueueMessageRejected,
130
130
  // Load the runner on first use so this module can send without a cycle.
131
131
  run: async (message) => {
132
- const { processPluginTask } = await import("./task-runner-7YTBSPXW.js");
132
+ const { processPluginTask } = await import("./task-runner-INQIQ4VF.js");
133
133
  await processPluginTask(message);
134
134
  },
135
135
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -8,7 +8,7 @@ import {
8
8
  juniorConversations,
9
9
  juniorIdentities,
10
10
  juniorUsers
11
- } from "./chunk-5VWAY27R.js";
11
+ } from "./chunk-SEIZ2XLD.js";
12
12
  import {
13
13
  conversationEventDataSchema,
14
14
  decodeStoredConversationEvent,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-VFUK3X5B.js";
21
21
  import {
22
22
  getChatConfig
23
- } from "./chunk-BYBSI5TI.js";
23
+ } from "./chunk-2JAWOTUT.js";
24
24
  import {
25
25
  parseActorUserId,
26
26
  parseSlackChannelReferenceId,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-N7TMSOZH.js";
29
29
  import {
30
30
  normalizeIdentityEmail
31
- } from "./chunk-PY3EIEAF.js";
31
+ } from "./chunk-L4JLLS6C.js";
32
32
 
33
33
  // src/chat/conversations/sql/store.ts
34
34
  import { randomUUID as randomUUID2 } from "crypto";
@@ -257,23 +257,26 @@ function normalizeSessionSource(value) {
257
257
  if (!value) {
258
258
  return void 0;
259
259
  }
260
- if (value.platform === "local") {
260
+ if (value.kind === "local") {
261
261
  return {
262
- platform: "local",
262
+ kind: "local",
263
263
  visibility: value.visibility,
264
264
  conversationId: value.conversationId
265
265
  };
266
266
  }
267
- if (value.platform === "web") {
267
+ if (value.kind === "web") {
268
268
  return {
269
- platform: "web",
269
+ kind: "web",
270
270
  visibility: value.visibility,
271
271
  conversationId: value.conversationId
272
272
  };
273
273
  }
274
+ if (value.kind === "resource_event") {
275
+ return void 0;
276
+ }
274
277
  const threadTs = value.threadTs?.trim();
275
278
  return {
276
- platform: "slack",
279
+ kind: "slack",
277
280
  visibility: value.visibility,
278
281
  teamId: value.teamId,
279
282
  channelId: value.channelId,
@@ -424,7 +427,7 @@ import { locationSchema } from "@sentry/junior-plugin-api";
424
427
  function locationForWrite(args) {
425
428
  const location = args.location ? locationSchema.parse(args.location) : void 0;
426
429
  const destination = args.destination?.platform === "slack" ? args.destination : void 0;
427
- const source = args.sessionSource?.platform === "slack" ? args.sessionSource : void 0;
430
+ const source = args.sessionSource?.kind === "slack" ? args.sessionSource : void 0;
428
431
  if (location) {
429
432
  if (destination && (location.id !== args.destinationId || location.teamId !== destination.teamId || location.channelId !== destination.channelId) || source && (location.teamId !== source.teamId || location.channelId !== source.channelId)) {
430
433
  throw new Error("Conversation Location changed");
@@ -455,7 +458,7 @@ function locationFromRow(value, row, sessionSource) {
455
458
  if (row.provider !== "slack") {
456
459
  throw new Error("Conversation Location provider is not supported");
457
460
  }
458
- const slackSource = sessionSource?.platform === "slack" && sessionSource.teamId === row.providerTenantId && sessionSource.channelId === row.providerDestinationId ? sessionSource : void 0;
461
+ const slackSource = sessionSource?.kind === "slack" && sessionSource.teamId === row.providerTenantId && sessionSource.channelId === row.providerDestinationId ? sessionSource : void 0;
459
462
  return locationSchema.parse({
460
463
  id: row.id,
461
464
  provider: "slack",
@@ -1166,9 +1169,9 @@ async function loadConversationSlackTenantId(executor, conversationId) {
1166
1169
  if (destinationTenant) {
1167
1170
  return destinationTenant;
1168
1171
  }
1169
- const sessionSource = row?.sessionSource;
1170
- if (isRecord(sessionSource) && sessionSource.platform === "slack" && typeof sessionSource.teamId === "string" && sessionSource.teamId.trim()) {
1171
- return sessionSource.teamId.trim();
1172
+ const sessionSource = parseSessionSource(row?.sessionSource);
1173
+ if (sessionSource?.kind === "slack") {
1174
+ return sessionSource.teamId;
1172
1175
  }
1173
1176
  return void 0;
1174
1177
  }
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFUK3X5B.js";
5
5
  import {
6
6
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
7
- } from "./chunk-BYBSI5TI.js";
7
+ } from "./chunk-2JAWOTUT.js";
8
8
 
9
9
  // src/db/neon.ts
10
10
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-MFSET7Q7.js";
3
+ } from "./chunk-KTW62MG5.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-CUYFCI4G.js";
9
+ } from "./chunk-S7NSFCCW.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-5VWAY27R.js";
12
+ } from "./chunk-SEIZ2XLD.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-5CXCGDIL.js";
15
+ } from "./chunk-YNRLCUCB.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-PY3EIEAF.js";
23
+ } from "./chunk-L4JLLS6C.js";
24
24
 
25
25
  // src/chat/state/conversation.ts
26
26
  function defaultConversationState() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConversationEventStore
3
- } from "./chunk-CUYFCI4G.js";
3
+ } from "./chunk-S7NSFCCW.js";
4
4
 
5
5
  // src/chat/conversations/turn-lifecycle.ts
6
6
  var ConversationTurnLifecycleService = class {