@sentry/junior 0.190.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 (78) hide show
  1. package/dist/{agent-hooks-3IG2FQW2.js → agent-hooks-HIWWBBKO.js} +11 -11
  2. package/dist/api.js +24 -24
  3. package/dist/app.js +92 -129
  4. package/dist/{catalog-runtime-2OT7S3ZC.js → catalog-runtime-4OKH4265.js} +4 -4
  5. package/dist/chat/agent/resume.d.ts +0 -1
  6. package/dist/chat/agent/types.d.ts +0 -1
  7. package/dist/chat/agent-invocations/types.d.ts +4 -4
  8. package/dist/chat/providers/slack/runtime.d.ts +1 -2
  9. package/dist/chat/providers/slack/system-turn.d.ts +9 -4
  10. package/dist/chat/providers/slack/turn.d.ts +0 -1
  11. package/dist/chat/services/turn-router.d.ts +1 -1
  12. package/dist/chat/slack/dispatch-turn.d.ts +0 -1
  13. package/dist/chat/slack/timestamp-param.d.ts +1 -1
  14. package/dist/chat/task-execution/assistant-message.d.ts +7 -7
  15. package/dist/chat/task-execution/checkpoint.d.ts +0 -1
  16. package/dist/chat/task-execution/conversation-turn.d.ts +2 -2
  17. package/dist/chat/task-execution/state.d.ts +0 -3
  18. package/dist/chat/task-execution/store.d.ts +0 -1
  19. package/dist/chat/task-execution/turn-cursor.d.ts +0 -2
  20. package/dist/chat/task-execution/worker.d.ts +0 -1
  21. package/dist/{chunk-VWNIDTFR.js → chunk-2JAWOTUT.js} +2 -2
  22. package/dist/{chunk-YFU4DGZY.js → chunk-3PDR63SX.js} +30 -9
  23. package/dist/{chunk-4BLFIYVK.js → chunk-5IMKUVMS.js} +8 -11
  24. package/dist/{chunk-REVH4BZU.js → chunk-6KISW5UY.js} +2 -2
  25. package/dist/{chunk-HI5KXE3C.js → chunk-7PYCRKQL.js} +3 -3
  26. package/dist/{chunk-OJFX2FP7.js → chunk-AWFSSFAX.js} +9 -11
  27. package/dist/{chunk-3J3BCB4J.js → chunk-BVWC5DBM.js} +1 -1
  28. package/dist/{chunk-DVX6U6GI.js → chunk-BVYUIVXE.js} +1 -1
  29. package/dist/{chunk-IRQ3RSX3.js → chunk-CCPOZMS4.js} +3 -3
  30. package/dist/{chunk-FVFJ57RK.js → chunk-CECRMPXJ.js} +9 -8
  31. package/dist/{chunk-2MKHYSYL.js → chunk-CUUE5MGF.js} +3 -3
  32. package/dist/{chunk-BUJU6C2J.js → chunk-DP6H3U2X.js} +1 -1
  33. package/dist/{chunk-4PKEJK5B.js → chunk-EQZUBYRF.js} +1 -1
  34. package/dist/{chunk-GWCFXTB6.js → chunk-GQN4REF5.js} +6 -6
  35. package/dist/{chunk-OYCOLHCR.js → chunk-HNMRX2EN.js} +5 -5
  36. package/dist/{chunk-7Y7XMI6P.js → chunk-K2NKG42A.js} +5 -5
  37. package/dist/{chunk-BGOLRC36.js → chunk-KTW62MG5.js} +13 -11
  38. package/dist/{chunk-Y4WL4OYD.js → chunk-L4JLLS6C.js} +1 -1
  39. package/dist/{chunk-62DRKZQU.js → chunk-LOYTPSAK.js} +4 -4
  40. package/dist/{chunk-7UJ6IJCK.js → chunk-MFZOIKET.js} +1 -1
  41. package/dist/{chunk-2MRF22J4.js → chunk-NK3UEKAW.js} +6 -6
  42. package/dist/{chunk-DJZGQ7OL.js → chunk-NY5SJGJZ.js} +22 -29
  43. package/dist/{chunk-ECOR3OXY.js → chunk-Q32BSFN4.js} +8 -8
  44. package/dist/{chunk-663DQH5W.js → chunk-QRNJO7DZ.js} +1 -1
  45. package/dist/{chunk-CZXZKTAI.js → chunk-RZS4F5K4.js} +3 -3
  46. package/dist/{chunk-OKAHLUSU.js → chunk-S7NSFCCW.js} +3 -3
  47. package/dist/{chunk-ZFCO2TMB.js → chunk-SEIZ2XLD.js} +1 -1
  48. package/dist/{chunk-W2C4TPLB.js → chunk-SGRL7NV6.js} +5 -5
  49. package/dist/{chunk-6H7YU6XH.js → chunk-TH6LMEOW.js} +1 -1
  50. package/dist/{chunk-F3K2267N.js → chunk-VGYZ3YZM.js} +77 -35
  51. package/dist/{chunk-T66GV7A3.js → chunk-WBNQYVCM.js} +2 -2
  52. package/dist/{chunk-67MMSYSE.js → chunk-WCSXTDOL.js} +1 -1
  53. package/dist/{chunk-YKIAUKYH.js → chunk-WNIVCR74.js} +2 -2
  54. package/dist/{chunk-RLYJYEIY.js → chunk-X6PQKQTY.js} +5 -7
  55. package/dist/{chunk-6BXUSF7J.js → chunk-YNRLCUCB.js} +1 -1
  56. package/dist/{chunk-MNHJ4WLE.js → chunk-ZJRGWZZ2.js} +3 -3
  57. package/dist/{chunk-JV7U4665.js → chunk-ZNFNGDT7.js} +1 -1
  58. package/dist/{chunk-OON4IQHH.js → chunk-ZRN3OS7M.js} +1 -1
  59. package/dist/cli/chat.js +33 -33
  60. package/dist/cli/check.js +5 -5
  61. package/dist/cli/plugins.js +12 -12
  62. package/dist/cli/snapshot-create.js +9 -9
  63. package/dist/cli/upgrade.js +6 -6
  64. package/dist/{db-2IFDMDDY.js → db-LG4ZEWA3.js} +6 -6
  65. package/dist/instrumentation.js +3 -3
  66. package/dist/nitro.js +6 -6
  67. package/dist/{oauth-callback-server-SZSS2KH6.js → oauth-callback-server-KI7ZRTOG.js} +29 -29
  68. package/dist/{runner-2N4QU77X.js → runner-K2EOSAZQ.js} +21 -21
  69. package/dist/{skills-VU2LZAKX.js → skills-JTRDFKMA.js} +5 -5
  70. package/dist/spawn-SRBETYCF.js +42 -0
  71. package/dist/task-runner-INQIQ4VF.js +36 -0
  72. package/dist/{validation-IJGHK7NI.js → validation-NBWURHAP.js} +5 -5
  73. package/dist/version.js +1 -1
  74. package/dist/{work-DI45MLRL.js → work-35TBEAUI.js} +21 -21
  75. package/dist/{worker-FY7KWG2M.js → worker-F762M6XM.js} +10 -10
  76. package/package.json +5 -5
  77. package/dist/spawn-3K7RV4T5.js +0 -42
  78. package/dist/task-runner-52DYFHW3.js +0 -36
package/dist/app.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  processConversationWork
3
- } from "./chunk-RLYJYEIY.js";
3
+ } from "./chunk-X6PQKQTY.js";
4
4
  import {
5
5
  bindSpawnAgent
6
- } from "./chunk-T66GV7A3.js";
6
+ } from "./chunk-WBNQYVCM.js";
7
7
  import {
8
8
  createAgentInvocationWorker,
9
9
  enqueueAgentInvocation,
10
10
  listPendingAgentInvocationMailboxAppends,
11
11
  resolveAgentInvocationId
12
- } from "./chunk-OJFX2FP7.js";
12
+ } from "./chunk-AWFSSFAX.js";
13
13
  import {
14
14
  GET as GET2,
15
15
  GET2 as GET3,
@@ -37,12 +37,12 @@ import {
37
37
  startProcessingReaction,
38
38
  stripLeadingBotMention,
39
39
  wakePausedTurn
40
- } from "./chunk-F3K2267N.js";
40
+ } from "./chunk-VGYZ3YZM.js";
41
41
  import "./chunk-FA6POGLH.js";
42
42
  import {
43
43
  AgentRunError,
44
44
  executeTurn
45
- } from "./chunk-IRQ3RSX3.js";
45
+ } from "./chunk-CCPOZMS4.js";
46
46
  import {
47
47
  buildDeliveredTurnStatePatch,
48
48
  completeAuthPauseTurn,
@@ -53,7 +53,7 @@ import {
53
53
  getTurnUserSlackMessageTs,
54
54
  persistAuthPauseTurnState,
55
55
  requireTurnFailureEventId
56
- } from "./chunk-7Y7XMI6P.js";
56
+ } from "./chunk-K2NKG42A.js";
57
57
  import {
58
58
  claimDispatchMailboxAppend,
59
59
  confirmDispatchMailboxAppend,
@@ -73,11 +73,11 @@ import {
73
73
  processPluginTask,
74
74
  resolveTurnSessionRouting,
75
75
  scheduleSessionCompletedPluginTasks
76
- } from "./chunk-ECOR3OXY.js";
76
+ } from "./chunk-Q32BSFN4.js";
77
77
  import {
78
78
  ConversationTurnLifecycleService,
79
79
  getTurnLifecycle
80
- } from "./chunk-6H7YU6XH.js";
80
+ } from "./chunk-TH6LMEOW.js";
81
81
  import {
82
82
  coerceThreadConversationState,
83
83
  getLocationConfigurationService,
@@ -86,7 +86,7 @@ import {
86
86
  persistThreadRuntimeState,
87
87
  persistThreadState,
88
88
  persistThreadStateById
89
- } from "./chunk-W2C4TPLB.js";
89
+ } from "./chunk-SGRL7NV6.js";
90
90
  import {
91
91
  GET,
92
92
  appendAndEnqueueWebMessage,
@@ -101,24 +101,24 @@ import {
101
101
  resolveSlackChannelTypeFromMessage,
102
102
  resolveSlackConversationContext,
103
103
  webActorFromEmail
104
- } from "./chunk-4BLFIYVK.js";
104
+ } from "./chunk-5IMKUVMS.js";
105
105
  import {
106
106
  createWebAuthorization,
107
107
  deleteWebAuthorization
108
- } from "./chunk-OON4IQHH.js";
108
+ } from "./chunk-ZRN3OS7M.js";
109
109
  import {
110
110
  recordTaskExecution
111
- } from "./chunk-MNHJ4WLE.js";
111
+ } from "./chunk-ZJRGWZZ2.js";
112
112
  import "./chunk-UTL3MHPC.js";
113
113
  import {
114
114
  createVercelPluginTaskCallback,
115
115
  queueCallback,
116
116
  registerVercelPluginTaskDevConsumer
117
- } from "./chunk-CZXZKTAI.js";
117
+ } from "./chunk-RZS4F5K4.js";
118
118
  import {
119
119
  validatePluginEgressCredentialHooks,
120
120
  validatePluginRegistrations
121
- } from "./chunk-3J3BCB4J.js";
121
+ } from "./chunk-BVWC5DBM.js";
122
122
  import {
123
123
  defineJuniorPlugins,
124
124
  pluginCatalogConfigFromEnv,
@@ -158,11 +158,11 @@ import {
158
158
  shouldEmitDevAgentTrace,
159
159
  shouldPropagateSandboxEgressTrace,
160
160
  unpublishedArtifactHeaders
161
- } from "./chunk-DJZGQ7OL.js";
161
+ } from "./chunk-NY5SJGJZ.js";
162
162
  import {
163
163
  AuthorizationFlowDisabledError,
164
164
  PluginCredentialFailureError
165
- } from "./chunk-OYCOLHCR.js";
165
+ } from "./chunk-HNMRX2EN.js";
166
166
  import "./chunk-6Y5B5PEX.js";
167
167
  import "./chunk-DIB4GX3G.js";
168
168
  import {
@@ -170,14 +170,14 @@ import {
170
170
  deleteMcpAuthSessionsForUserProvider,
171
171
  deleteMcpServerSessionId,
172
172
  deleteMcpStoredOAuthCredentials
173
- } from "./chunk-FVFJ57RK.js";
173
+ } from "./chunk-CECRMPXJ.js";
174
174
  import {
175
175
  RetryableDeliveryError,
176
176
  createAgentRunner,
177
177
  formatProviderLabel,
178
178
  postSlackMessage,
179
179
  startOAuthFlow
180
- } from "./chunk-GWCFXTB6.js";
180
+ } from "./chunk-GQN4REF5.js";
181
181
  import {
182
182
  ConversationTurnBoundaryError,
183
183
  CooperativeTurnYieldError,
@@ -193,7 +193,7 @@ import {
193
193
  markTurnCompleted,
194
194
  markTurnFailed,
195
195
  startActiveTurn
196
- } from "./chunk-67MMSYSE.js";
196
+ } from "./chunk-WCSXTDOL.js";
197
197
  import {
198
198
  abandonTurnRecord,
199
199
  appendThreadContextMessages,
@@ -229,7 +229,7 @@ import {
229
229
  trimTrailingAssistantMessages,
230
230
  turnHasReply,
231
231
  upsertConversationMessage
232
- } from "./chunk-BGOLRC36.js";
232
+ } from "./chunk-KTW62MG5.js";
233
233
  import {
234
234
  getExperimentalFeatures,
235
235
  isExperimentalFeatureEnabled,
@@ -249,10 +249,10 @@ import {
249
249
  scheduledRunId,
250
250
  scheduledRunSchema,
251
251
  withScheduledTaskLock
252
- } from "./chunk-62DRKZQU.js";
252
+ } from "./chunk-LOYTPSAK.js";
253
253
  import {
254
254
  parseSlackThreadId
255
- } from "./chunk-BUJU6C2J.js";
255
+ } from "./chunk-DP6H3U2X.js";
256
256
  import {
257
257
  CONVERSATION_WORK_STALE_ENQUEUE_MS,
258
258
  appendAndEnqueueInboundMessage,
@@ -267,16 +267,16 @@ import {
267
267
  removeActiveConversation,
268
268
  requestConversationWork,
269
269
  stopConversationWork
270
- } from "./chunk-YFU4DGZY.js";
270
+ } from "./chunk-3PDR63SX.js";
271
271
  import {
272
272
  buildDeterministicAssistantMessageId,
273
273
  buildDeterministicTurnId
274
274
  } from "./chunk-DA2KGZZI.js";
275
- import "./chunk-YKIAUKYH.js";
275
+ import "./chunk-WNIVCR74.js";
276
276
  import {
277
277
  getSandboxResourceConfig,
278
278
  setSandboxResourceConfig
279
- } from "./chunk-2MKHYSYL.js";
279
+ } from "./chunk-CUUE5MGF.js";
280
280
  import "./chunk-PDO5BLNM.js";
281
281
  import "./chunk-UIE3R5XU.js";
282
282
  import {
@@ -285,7 +285,7 @@ import {
285
285
  } from "./chunk-X6GDDWQH.js";
286
286
  import {
287
287
  getTurnRequestDeadline
288
- } from "./chunk-7UJ6IJCK.js";
288
+ } from "./chunk-MFZOIKET.js";
289
289
  import {
290
290
  getVercelConversationWorkQueue,
291
291
  resolveConversationWorkQueueTopic,
@@ -321,7 +321,7 @@ import {
321
321
  verifyEventTaskCredentialSubject,
322
322
  verifyScheduledTaskCredentialSubject,
323
323
  verifySlackDirectCredentialSubject
324
- } from "./chunk-2MRF22J4.js";
324
+ } from "./chunk-NK3UEKAW.js";
325
325
  import "./chunk-3Y47VMHV.js";
326
326
  import {
327
327
  createSlackDestination,
@@ -333,7 +333,7 @@ import {
333
333
  requireSlackDestination,
334
334
  withConversationEventLock,
335
335
  withConversationMutationLock
336
- } from "./chunk-OKAHLUSU.js";
336
+ } from "./chunk-S7NSFCCW.js";
337
337
  import {
338
338
  juniorAgentBindings,
339
339
  juniorAgentInvocations,
@@ -341,13 +341,13 @@ import {
341
341
  juniorConversations,
342
342
  juniorSchedulerRuns,
343
343
  juniorSchedulerTasks
344
- } from "./chunk-ZFCO2TMB.js";
345
- import "./chunk-HI5KXE3C.js";
344
+ } from "./chunk-SEIZ2XLD.js";
345
+ import "./chunk-7PYCRKQL.js";
346
346
  import {
347
347
  acquireActiveLock,
348
348
  getStateAdapter,
349
349
  withActiveLock
350
- } from "./chunk-6BXUSF7J.js";
350
+ } from "./chunk-YNRLCUCB.js";
351
351
  import {
352
352
  instructionProvenanceFor
353
353
  } from "./chunk-GFBR4S3Q.js";
@@ -369,17 +369,17 @@ import {
369
369
  isProviderRetryError,
370
370
  setProfiles,
371
371
  setSlackReactionConfig
372
- } from "./chunk-VWNIDTFR.js";
372
+ } from "./chunk-2JAWOTUT.js";
373
373
  import {
374
374
  defaultModelId,
375
375
  modelIdForProfile
376
376
  } from "./chunk-D4YV5TDV.js";
377
- import "./chunk-DVX6U6GI.js";
378
- import "./chunk-REVH4BZU.js";
377
+ import "./chunk-BVYUIVXE.js";
378
+ import "./chunk-6KISW5UY.js";
379
379
  import {
380
380
  pluginCatalogRuntime
381
- } from "./chunk-4PKEJK5B.js";
382
- import "./chunk-663DQH5W.js";
381
+ } from "./chunk-EQZUBYRF.js";
382
+ import "./chunk-QRNJO7DZ.js";
383
383
  import {
384
384
  credentialContextForActor
385
385
  } from "./chunk-CEMMLV5L.js";
@@ -415,13 +415,13 @@ import {
415
415
  withContext,
416
416
  withLogContext,
417
417
  withSpan
418
- } from "./chunk-Y4WL4OYD.js";
418
+ } from "./chunk-L4JLLS6C.js";
419
419
  import {
420
420
  continueTrace
421
421
  } from "./chunk-PEQXYSSE.js";
422
422
  import {
423
423
  JUNIOR_VERSION
424
- } from "./chunk-JV7U4665.js";
424
+ } from "./chunk-ZNFNGDT7.js";
425
425
 
426
426
  // src/app.ts
427
427
  import { createRequire } from "module";
@@ -597,7 +597,6 @@ function buildAgentDispatchInboundMessage(dispatch2, nowMs = Date.now()) {
597
597
  }
598
598
  },
599
599
  receivedAtMs: nowMs,
600
- publishExternally: true,
601
600
  source: "plugin"
602
601
  };
603
602
  }
@@ -3277,7 +3276,6 @@ function createSlackConversationWorker(options) {
3277
3276
  if (!latestRecord) {
3278
3277
  return { status: "completed" };
3279
3278
  }
3280
- const publishExternally = latestRecord.publishExternally ?? context.publishExternally;
3281
3279
  const latestMetadata = parseSlackMetadata(latestRecord.input.metadata);
3282
3280
  if (!latestMetadata) {
3283
3281
  throw new Error(
@@ -3341,9 +3339,7 @@ function createSlackConversationWorker(options) {
3341
3339
  };
3342
3340
  const drainSteeringMessages = async (accept) => {
3343
3341
  await context.attempt.drain(async (pendingRecords) => {
3344
- const candidates = pendingRecords.filter(
3345
- (record) => record.publishExternally === publishExternally
3346
- ).map((record) => ({
3342
+ const candidates = pendingRecords.map((record) => ({
3347
3343
  inboundMessageId: record.inboundMessageId,
3348
3344
  message: restoreMessage({
3349
3345
  adapter,
@@ -3360,7 +3356,6 @@ function createSlackConversationWorker(options) {
3360
3356
  await options.runtime.handleNewMention(thread, latestMessage, {
3361
3357
  conversationId: context.conversationId,
3362
3358
  destination,
3363
- publishExternally,
3364
3359
  messageContext,
3365
3360
  drainSteeringMessages,
3366
3361
  ack,
@@ -3374,7 +3369,6 @@ function createSlackConversationWorker(options) {
3374
3369
  {
3375
3370
  conversationId: context.conversationId,
3376
3371
  destination,
3377
- publishExternally,
3378
3372
  messageContext,
3379
3373
  drainSteeringMessages,
3380
3374
  ack,
@@ -3426,7 +3420,6 @@ function buildSlackInboundMessage(args) {
3426
3420
  source: "slack",
3427
3421
  createdAtMs: args.message.metadata.dateSent.getTime(),
3428
3422
  receivedAtMs: args.receivedAtMs,
3429
- publishExternally: true,
3430
3423
  input: {
3431
3424
  text: args.message.text || " ",
3432
3425
  authorId,
@@ -3694,7 +3687,8 @@ async function handleUnlink(event, actorId, provider) {
3694
3687
  await postEphemeral(event, `Unknown provider: \`${provider}\``);
3695
3688
  return;
3696
3689
  }
3697
- if (!pluginCatalogRuntime.getOAuthConfig(provider)) {
3690
+ const supportsUnlink = Boolean(pluginCatalogRuntime.getOAuthConfig(provider)) || Boolean(pluginCatalogRuntime.getDefinition(provider)?.manifest.mcp);
3691
+ if (!supportsUnlink) {
3698
3692
  await postEphemeral(
3699
3693
  event,
3700
3694
  `${formatProviderLabel(provider)} doesn't support account unlinking.`
@@ -4978,9 +4972,6 @@ function buildLogContext(deps, args) {
4978
4972
  function actorUserName(message) {
4979
4973
  return getMessageActorIdentity(message)?.userName;
4980
4974
  }
4981
- function shouldPublishExternally(publishExternally) {
4982
- return publishExternally !== false;
4983
- }
4984
4975
  function createSlackTurnRuntime(deps) {
4985
4976
  const turnLifecycle = getTurnLifecycle();
4986
4977
  const logContext = (args) => buildLogContext(deps, args);
@@ -5295,7 +5286,6 @@ function createSlackTurnRuntime(deps) {
5295
5286
  conversationId: hooks.conversationId,
5296
5287
  destination: hooks.destination,
5297
5288
  queuedMessages,
5298
- publishExternally: shouldPublishExternally(hooks.publishExternally),
5299
5289
  ack,
5300
5290
  onToolInvocation: toolInvocationHook,
5301
5291
  onTurnCompleted,
@@ -5353,13 +5343,11 @@ function createSlackTurnRuntime(deps) {
5353
5343
  lifecycleError = error2;
5354
5344
  }
5355
5345
  await hooks.beforeFirstResponsePost?.();
5356
- if (shouldPublishExternally(hooks.publishExternally)) {
5357
- await postFallbackErrorReplyWithLogging({
5358
- thread,
5359
- eventId,
5360
- postFailureEventName: "mention.handler.failure_reply_post.failed"
5361
- });
5362
- }
5346
+ await postFallbackErrorReplyWithLogging({
5347
+ thread,
5348
+ eventId,
5349
+ postFailureEventName: "mention.handler.failure_reply_post.failed"
5350
+ });
5363
5351
  if (lifecycleError) throw lifecycleError;
5364
5352
  } finally {
5365
5353
  if (completed) {
@@ -5584,7 +5572,6 @@ function createSlackTurnRuntime(deps) {
5584
5572
  conversationId: hooks.conversationId,
5585
5573
  destination: hooks.destination,
5586
5574
  preparedState,
5587
- publishExternally: shouldPublishExternally(hooks.publishExternally),
5588
5575
  beforeFirstResponsePost: hooks.beforeFirstResponsePost,
5589
5576
  queuedMessages,
5590
5577
  ack,
@@ -5644,13 +5631,11 @@ function createSlackTurnRuntime(deps) {
5644
5631
  lifecycleError = error2;
5645
5632
  }
5646
5633
  await hooks.beforeFirstResponsePost?.();
5647
- if (shouldPublishExternally(hooks.publishExternally)) {
5648
- await postFallbackErrorReplyWithLogging({
5649
- thread,
5650
- eventId,
5651
- postFailureEventName: "subscribed_message.handler.failure_reply_post.failed"
5652
- });
5653
- }
5634
+ await postFallbackErrorReplyWithLogging({
5635
+ thread,
5636
+ eventId,
5637
+ postFailureEventName: "subscribed_message.handler.failure_reply_post.failed"
5638
+ });
5654
5639
  if (lifecycleError) throw lifecycleError;
5655
5640
  } finally {
5656
5641
  if (completed) {
@@ -6478,9 +6463,6 @@ async function loadPiMessagesForTurn(args) {
6478
6463
  }
6479
6464
  return {};
6480
6465
  }
6481
- function shouldPublishExternally2(publishExternally) {
6482
- return publishExternally !== false;
6483
- }
6484
6466
  function createSlackTurn(deps) {
6485
6467
  const turnLifecycle = getTurnLifecycle();
6486
6468
  return async function executeSlackTurn(thread, message, options) {
@@ -6624,9 +6606,6 @@ function createSlackTurn(deps) {
6624
6606
  );
6625
6607
  try {
6626
6608
  await beforeFirstResponsePost();
6627
- if (!shouldPublishExternally2(options.publishExternally)) {
6628
- return;
6629
- }
6630
6609
  if (channelId && threadTs) {
6631
6610
  await sendSlackReply({
6632
6611
  channelId,
@@ -6781,9 +6760,7 @@ function createSlackTurn(deps) {
6781
6760
  });
6782
6761
  if (configReply) {
6783
6762
  await beforeFirstResponsePost();
6784
- if (shouldPublishExternally2(options.publishExternally)) {
6785
- await thread.post(buildSlackOutputMessage(configReply.text));
6786
- }
6763
+ await thread.post(buildSlackOutputMessage(configReply.text));
6787
6764
  markConversationMessage(
6788
6765
  preparedState.conversation,
6789
6766
  preparedState.userMessageId,
@@ -6949,21 +6926,19 @@ function createSlackTurn(deps) {
6949
6926
  let slackMessageTs2 = [];
6950
6927
  await beforeFirstResponsePost();
6951
6928
  try {
6952
- if (shouldPublishExternally2(options.publishExternally)) {
6953
- if (channelId && thread.adapter.name === "slack") {
6954
- slackMessageTs2 = await sendSlackReply({
6955
- channelId,
6956
- conversationId,
6957
- replyAttribution: options.execution?.dispatch?.replyAttribution,
6958
- text,
6959
- ...threadTs ? { threadTs } : void 0
6960
- });
6961
- } else {
6962
- for (const part of splitSlackReplyText(text)) {
6963
- const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
6964
- if (postedMessageTs) {
6965
- slackMessageTs2.push(postedMessageTs);
6966
- }
6929
+ if (channelId && thread.adapter.name === "slack") {
6930
+ slackMessageTs2 = await sendSlackReply({
6931
+ channelId,
6932
+ conversationId,
6933
+ replyAttribution: options.execution?.dispatch?.replyAttribution,
6934
+ text,
6935
+ ...threadTs ? { threadTs } : void 0
6936
+ });
6937
+ } else {
6938
+ for (const part of splitSlackReplyText(text)) {
6939
+ const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
6940
+ if (postedMessageTs) {
6941
+ slackMessageTs2.push(postedMessageTs);
6967
6942
  }
6968
6943
  }
6969
6944
  }
@@ -7172,9 +7147,6 @@ function createSlackTurn(deps) {
7172
7147
  source,
7173
7148
  ...location ? { location } : void 0,
7174
7149
  destination,
7175
- publishExternally: shouldPublishExternally2(
7176
- options.publishExternally
7177
- ),
7178
7150
  surface: options.execution?.surface ?? "slack",
7179
7151
  dispatch: options.execution?.dispatch,
7180
7152
  toolChannelId,
@@ -7865,7 +7837,6 @@ function createSlackDispatchTurnRunner(options) {
7865
7837
  ack: hooks.ack,
7866
7838
  conversationId,
7867
7839
  destination: dispatch2.destination,
7868
- publishExternally: true,
7869
7840
  execution: {
7870
7841
  disabledFeatures: ["interactive-auth"],
7871
7842
  locationConfiguration: options.getLocationConfiguration(
@@ -8371,11 +8342,6 @@ async function runPausedTurnInContext(payload, options, runOptions) {
8371
8342
  destination: routingDestination,
8372
8343
  ...dispatch2 ? { dispatch: dispatch2 } : void 0,
8373
8344
  ...routing.location ? { location: routing.location } : void 0,
8374
- // Slack resume publishes unless the checkpoint opted out.
8375
- // Missing means legacy/in-flight Slack turns still post.
8376
- // TODO(dcramer): Remove this missing-as-publish fallback after no
8377
- // stored Turn checkpoint can omit publishExternally.
8378
- publishExternally: activeTurn.publishExternally !== false,
8379
8345
  source,
8380
8346
  ...surface ? { surface } : void 0,
8381
8347
  toolChannelId: destination.channelId,
@@ -8603,9 +8569,9 @@ async function commitAssistantMessage(args) {
8603
8569
  text: args.text,
8604
8570
  userMessageId: args.userMessageId
8605
8571
  });
8606
- if (args.publishedMessage?.providerMessageId) {
8572
+ if (args.deliveryResult?.providerMessageId) {
8607
8573
  markConversationMessage(args.conversation, conversationMessageId, {
8608
- slackTs: args.publishedMessage.providerMessageId
8574
+ slackTs: args.deliveryResult.providerMessageId
8609
8575
  });
8610
8576
  }
8611
8577
  try {
@@ -8615,7 +8581,7 @@ async function commitAssistantMessage(args) {
8615
8581
  conversation: args.conversation,
8616
8582
  conversationMessageId,
8617
8583
  conversationId: args.conversationId,
8618
- providerConversationBindings: args.publishedMessage?.providerConversationBindings
8584
+ providerConversationBindings: args.deliveryResult?.providerConversationBindings
8619
8585
  })
8620
8586
  );
8621
8587
  } catch (error) {
@@ -8860,7 +8826,7 @@ async function completeCancelledConversationTurn(args) {
8860
8826
  });
8861
8827
  await args.acknowledge();
8862
8828
  }
8863
- function createConversationTurnWorker(agentRunner, publishMessage) {
8829
+ function createConversationTurnWorker(agentRunner, deliverMessage) {
8864
8830
  return async (context, resolved) => {
8865
8831
  const lifecycle = new ConversationTurnLifecycleService(
8866
8832
  getConversationEventStore()
@@ -8900,7 +8866,7 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
8900
8866
  conversationId: context.conversationId
8901
8867
  });
8902
8868
  const savedTurn = isResume ? await getTurnRecord(context.conversationId, turnId) : void 0;
8903
- let resumedResourceEvent = false;
8869
+ let savedMessageIsResourceEvent = false;
8904
8870
  if (isResume) {
8905
8871
  const userMessage = getTurnUserMessage(conversation, turnId);
8906
8872
  if (!userMessage) {
@@ -8908,7 +8874,7 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
8908
8874
  `Unable to locate the persisted user message for Turn "${turnId}"`
8909
8875
  );
8910
8876
  }
8911
- resumedResourceEvent = isResourceEventConversationMessage(userMessage);
8877
+ savedMessageIsResourceEvent = isResourceEventConversationMessage(userMessage);
8912
8878
  turnInputFacts = turnInputFactsFromConversationMessage(userMessage, {
8913
8879
  conversationId: context.conversationId,
8914
8880
  location: storedConversation?.location,
@@ -8933,10 +8899,9 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
8933
8899
  visibility: storedConversation?.visibility
8934
8900
  });
8935
8901
  const webActor = actor.platform === "web" ? actor : void 0;
8936
- const publish = savedTurn?.publishExternally ?? Boolean(
8937
- storedConversation?.location && (source.kind === "resource_event" || resumedResourceEvent)
8938
- );
8939
- const surface = publish ? "slack" : "api";
8902
+ const conversationLocation = storedConversation?.location;
8903
+ const deliverToProvider = Boolean(conversationLocation) && (source.kind === "resource_event" || savedMessageIsResourceEvent);
8904
+ const surface = deliverToProvider ? "slack" : "api";
8940
8905
  return await withLogContext(
8941
8906
  {
8942
8907
  conversationId: context.conversationId,
@@ -9031,24 +8996,26 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
9031
8996
  return;
9032
8997
  }
9033
8998
  failureCode = "delivery_failed";
9034
- const location = storedConversation?.location;
9035
- if (publish && (!location || !publishMessage)) {
9036
- throw new Error(
9037
- `Conversation ${context.conversationId} cannot publish its system Turn`
9038
- );
8999
+ let deliveryResult;
9000
+ if (deliverToProvider) {
9001
+ if (!conversationLocation || !deliverMessage) {
9002
+ throw new Error(
9003
+ `Conversation ${context.conversationId} cannot deliver to its Location`
9004
+ );
9005
+ }
9006
+ deliveryResult = await deliverMessage({
9007
+ conversationId: context.conversationId,
9008
+ location: conversationLocation,
9009
+ text: replyText
9010
+ });
9039
9011
  }
9040
- const publishedMessage = publish && location && publishMessage ? await publishMessage({
9041
- conversationId: context.conversationId,
9042
- location,
9043
- text: replyText
9044
- }) : void 0;
9045
9012
  await commitAssistantMessage({
9046
9013
  ...agentMessage ? { agentMessage } : void 0,
9047
9014
  conversation,
9048
9015
  conversationId: context.conversationId,
9049
- ...publishedMessage ? { publishedMessage } : void 0,
9016
+ ...deliveryResult ? { deliveryResult } : void 0,
9050
9017
  sessionId: turnId,
9051
- ...publishedMessage ? { source: "slack" } : source.kind === "web" ? { source: "web" } : void 0,
9018
+ ...deliveryResult ? { source: "slack" } : source.kind === "web" ? { source: "web" } : void 0,
9052
9019
  text: replyText,
9053
9020
  userMessageId
9054
9021
  });
@@ -9116,11 +9083,8 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
9116
9083
  // TODO(dcramer): Remove AgentRun.destination after agent and tool
9117
9084
  // code reads AgentRun.location and no Run consumer needs it.
9118
9085
  destination,
9119
- // TODO(dcramer): Remove AgentRun.publishExternally after the
9120
- // saved Turn publish choice controls optional Delivery.
9121
- publishExternally: publish,
9122
9086
  source,
9123
- ...storedConversation?.location ? { location: storedConversation.location } : void 0,
9087
+ ...conversationLocation ? { location: conversationLocation } : void 0,
9124
9088
  surface,
9125
9089
  ...stopSignal ? { signal: stopSignal } : void 0,
9126
9090
  ...webActor ? {
@@ -9194,7 +9158,6 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
9194
9158
  // TODO(dcramer): Remove checkpoint Destination after resume
9195
9159
  // reads the Conversation Location.
9196
9160
  destination,
9197
- publishExternally: publish,
9198
9161
  source,
9199
9162
  actor,
9200
9163
  surface
@@ -9323,11 +9286,11 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
9323
9286
  }
9324
9287
 
9325
9288
  // src/chat/providers/slack/system-turn.ts
9326
- function createSlackSystemTurnPublisher(args) {
9289
+ function createSlackSystemTurnDelivery(args) {
9327
9290
  return async ({ conversationId, location, text }) => {
9328
9291
  if (location.provider !== "slack") {
9329
9292
  throw new Error(
9330
- `Slack system Turn cannot publish to ${location.provider} Location`
9293
+ `Slack system Turn cannot deliver to ${location.provider} Location`
9331
9294
  );
9332
9295
  }
9333
9296
  let messageIds;
@@ -9424,7 +9387,7 @@ function createConversationWork(options) {
9424
9387
  const invocationWorker = createAgentInvocationWorker(options.agentRunner);
9425
9388
  const conversationTurnWorker = createConversationTurnWorker(
9426
9389
  options.agentRunner,
9427
- createSlackSystemTurnPublisher({
9390
+ createSlackSystemTurnDelivery({
9428
9391
  getSlackAdapter: options.getSlackAdapter,
9429
9392
  state: options.state
9430
9393
  })
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-4PKEJK5B.js";
4
- import "./chunk-663DQH5W.js";
3
+ } from "./chunk-EQZUBYRF.js";
4
+ import "./chunk-QRNJO7DZ.js";
5
5
  import "./chunk-CEMMLV5L.js";
6
6
  import "./chunk-N7TMSOZH.js";
7
7
  import "./chunk-DWPN6SCH.js";
8
8
  import "./chunk-TXKUKMVO.js";
9
- import "./chunk-Y4WL4OYD.js";
9
+ import "./chunk-L4JLLS6C.js";
10
10
  import "./chunk-PEQXYSSE.js";
11
- import "./chunk-JV7U4665.js";
11
+ import "./chunk-ZNFNGDT7.js";
12
12
  export {
13
13
  pluginCatalogRuntime
14
14
  };
@@ -20,7 +20,6 @@ interface ResumeStateArgs {
20
20
  dispatchId?: string;
21
21
  durability: AgentDurability;
22
22
  recordActiveMcpProviders: () => Promise<void>;
23
- publishExternally: boolean;
24
23
  actor?: Actor;
25
24
  runSource: Source;
26
25
  conversationId: string;
@@ -179,7 +179,6 @@ export type AgentRun = {
179
179
  /** Conversation Location available to this Run. */
180
180
  location?: Location;
181
181
  destination: Destination;
182
- publishExternally?: boolean;
183
182
  surface?: AgentTurnSurface;
184
183
  dispatch?: AgentDispatch;
185
184
  /**
@@ -126,7 +126,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
126
126
  eventType: z.ZodString;
127
127
  identifier: z.ZodString;
128
128
  namespace: z.ZodString;
129
- }, z.core.$strict>], "kind">>;
129
+ }, z.core.$strict>], "kind">, unknown>;
130
130
  updatedAtMs: z.ZodNumber;
131
131
  status: z.ZodEnum<{
132
132
  pending: "pending";
@@ -253,7 +253,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
253
253
  eventType: z.ZodString;
254
254
  identifier: z.ZodString;
255
255
  namespace: z.ZodString;
256
- }, z.core.$strict>], "kind">>;
256
+ }, z.core.$strict>], "kind">, unknown>;
257
257
  updatedAtMs: z.ZodNumber;
258
258
  result: z.ZodString;
259
259
  status: z.ZodLiteral<"completed">;
@@ -378,7 +378,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
378
378
  eventType: z.ZodString;
379
379
  identifier: z.ZodString;
380
380
  namespace: z.ZodString;
381
- }, z.core.$strict>], "kind">>;
381
+ }, z.core.$strict>], "kind">, unknown>;
382
382
  updatedAtMs: z.ZodNumber;
383
383
  errorMessage: z.ZodString;
384
384
  status: z.ZodEnum<{
@@ -501,7 +501,7 @@ export declare const createAgentInvocationSchema: z.ZodObject<{
501
501
  eventType: z.ZodString;
502
502
  identifier: z.ZodString;
503
503
  namespace: z.ZodString;
504
- }, z.core.$strict>], "kind">>;
504
+ }, z.core.$strict>], "kind">, unknown>;
505
505
  }, z.core.$strict>;
506
506
  export type AgentBinding = z.output<typeof agentBindingSchema>;
507
507
  export type AgentInvocation = z.output<typeof agentInvocationSchema>;