@sentry/junior 0.147.0 → 0.148.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 (155) hide show
  1. package/dist/{agent-hooks-HS6VGUPM.js → agent-hooks-VAUYT6PD.js} +10 -10
  2. package/dist/api/conversations/access.d.ts +2 -1
  3. package/dist/api/conversations/archive.d.ts +3 -5
  4. package/dist/api/conversations/create.d.ts +6 -0
  5. package/dist/api/conversations/detail.d.ts +2 -296
  6. package/dist/api/conversations/event-list.d.ts +2 -193
  7. package/dist/api/conversations/list.d.ts +4 -66
  8. package/dist/api/conversations/routes.d.ts +1 -1
  9. package/dist/api/conversations/stats.d.ts +0 -54
  10. package/dist/api/http.d.ts +2 -6
  11. package/dist/api/locations/detail.d.ts +3 -111
  12. package/dist/api/locations/list.d.ts +0 -45
  13. package/dist/api/locations/query.d.ts +2 -1
  14. package/dist/api/locations/routes.d.ts +1 -1
  15. package/dist/api/people/list.d.ts +0 -29
  16. package/dist/api/people/profile.d.ts +2 -106
  17. package/dist/api/people/profile.query.d.ts +2 -1
  18. package/dist/api/people/routes.d.ts +1 -1
  19. package/dist/api/people/shared.d.ts +1 -1
  20. package/dist/api/people/spend.d.ts +3 -4
  21. package/dist/api/personal-tokens/routes.d.ts +2 -2
  22. package/dist/api/route.d.ts +8 -14
  23. package/dist/api/schema/conversation.d.ts +60 -29
  24. package/dist/api/schema/location.d.ts +4 -0
  25. package/dist/api/schema/person.d.ts +7 -3
  26. package/dist/api/schema.d.ts +2 -2
  27. package/dist/api/schema.js +7 -1
  28. package/dist/api/stats.d.ts +0 -13
  29. package/dist/api/validation.d.ts +7 -0
  30. package/dist/api/viewer.d.ts +3 -0
  31. package/dist/api.d.ts +2 -1
  32. package/dist/api.js +624 -562
  33. package/dist/app.js +183 -105
  34. package/dist/{catalog-runtime-M6ZTPYRV.js → catalog-runtime-WADOZVTB.js} +5 -5
  35. package/dist/chat/actor.d.ts +4 -1
  36. package/dist/chat/agent/request.d.ts +2 -0
  37. package/dist/chat/agent/resume.d.ts +1 -0
  38. package/dist/chat/agent-dispatch/context.d.ts +2 -2
  39. package/dist/chat/agent-invocations/types.d.ts +52 -0
  40. package/dist/chat/api-turns/work.d.ts +103 -0
  41. package/dist/chat/conversations/history.d.ts +60 -0
  42. package/dist/chat/conversations/provenance.d.ts +6 -0
  43. package/dist/chat/conversations/sql/actor-identity.d.ts +19 -0
  44. package/dist/chat/conversations/store.d.ts +1 -1
  45. package/dist/chat/resource-events/store.d.ts +1 -1
  46. package/dist/chat/runtime/reply-executor.d.ts +1 -1
  47. package/dist/chat/runtime/slack-runtime.d.ts +2 -1
  48. package/dist/chat/runtime/turn-preparation.d.ts +9 -0
  49. package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
  50. package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
  51. package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
  52. package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
  53. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
  54. package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
  55. package/dist/chat/slack/channel.d.ts +26 -0
  56. package/dist/chat/slack/dispatch-turn.d.ts +1 -0
  57. package/dist/chat/slack/timestamp-param.d.ts +0 -2
  58. package/dist/chat/slack/{tools → tool-support}/canvas/api.d.ts +1 -1
  59. package/dist/chat/slack/{tools → tool-support}/canvas/context.d.ts +3 -0
  60. package/dist/chat/slack/tool-support/channel-access.d.ts +42 -0
  61. package/dist/chat/slack/tool-support/channel-target.d.ts +27 -0
  62. package/dist/chat/slack/tool-support/list/params.d.ts +5 -0
  63. package/dist/chat/slack/tools/canvas/create.d.ts +1 -1
  64. package/dist/chat/slack/tools/channel-join.d.ts +28 -0
  65. package/dist/chat/slack/tools/channel-list-messages.d.ts +3 -2
  66. package/dist/chat/slack/tools/conversation-message-search.d.ts +2 -8
  67. package/dist/chat/slack/tools/message-add-reaction.d.ts +1 -1
  68. package/dist/chat/slack/tools/public-search.d.ts +63 -2
  69. package/dist/chat/slack/tools/send-files.d.ts +1 -1
  70. package/dist/chat/slack/tools/thread-read.d.ts +2 -5
  71. package/dist/chat/source.d.ts +2 -0
  72. package/dist/chat/task-execution/checkpoint.d.ts +1 -0
  73. package/dist/chat/task-execution/state.d.ts +9 -4
  74. package/dist/chat/task-execution/store.d.ts +3 -2
  75. package/dist/chat/task-execution/turn-cursor.d.ts +2 -0
  76. package/dist/chat/task-execution/worker.d.ts +2 -0
  77. package/dist/chat/tasks/read.d.ts +1 -1
  78. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  79. package/dist/chat/tools/types.d.ts +11 -4
  80. package/dist/chat/tools/watch-resource-events.d.ts +2 -2
  81. package/dist/{chunk-ORO3PWKQ.js → chunk-2B3PT3V2.js} +1 -1
  82. package/dist/{chunk-SVHUEHUL.js → chunk-45LOR4PU.js} +21 -4
  83. package/dist/{chunk-YBVXBNSV.js → chunk-4AQZYNHM.js} +2 -2
  84. package/dist/{chunk-Z4YU7Z4L.js → chunk-4EA2SFK2.js} +65 -4
  85. package/dist/{chunk-7NVJVJID.js → chunk-4GXJUYJV.js} +2 -2
  86. package/dist/{chunk-IIOOO4FQ.js → chunk-55F4QU2V.js} +2 -1
  87. package/dist/{chunk-745QJ3ZA.js → chunk-7OEIXFC3.js} +2 -2
  88. package/dist/{chunk-DU74WPIC.js → chunk-D3WPMGEX.js} +1 -1
  89. package/dist/{chunk-PVNG6UMU.js → chunk-D6YX4NNN.js} +22 -10
  90. package/dist/chunk-DUY5CDAM.js +36 -0
  91. package/dist/{chunk-4LJO56OJ.js → chunk-EAI67NTM.js} +1 -1
  92. package/dist/{chunk-X5UY34KT.js → chunk-EINWQFXI.js} +8 -8
  93. package/dist/chunk-GDFF3BQG.js +136 -0
  94. package/dist/{chunk-EFLJ2WJH.js → chunk-GXYDVZKM.js} +5 -5
  95. package/dist/{chunk-CWP5RHVX.js → chunk-HLPLT3NY.js} +8 -5
  96. package/dist/{chunk-JUUKWRBE.js → chunk-HWQGBIH7.js} +1 -1
  97. package/dist/{chunk-AZ7EAOBE.js → chunk-IL4EDBMV.js} +5 -5
  98. package/dist/{chunk-DLDRQHG5.js → chunk-LAZGHEYU.js} +1 -1
  99. package/dist/{chunk-RXBVB2JM.js → chunk-LE5H7LMT.js} +1 -1
  100. package/dist/chunk-LNVEIJ2L.js +48 -0
  101. package/dist/{chunk-YEO3VX72.js → chunk-OJCP3C3J.js} +8 -6
  102. package/dist/{chunk-GGB4WL5A.js → chunk-POSZWRGL.js} +1 -1
  103. package/dist/{chunk-YNTTROJT.js → chunk-QOWHHM3F.js} +1 -1
  104. package/dist/{chunk-6H5SZR24.js → chunk-RRJV5UR5.js} +302 -59
  105. package/dist/{chunk-AYU72WO7.js → chunk-ULAU5ZGU.js} +41 -64
  106. package/dist/{chunk-SGZO7UWH.js → chunk-V2FXMOEA.js} +2 -2
  107. package/dist/{chunk-AIOK6LAG.js → chunk-VCYSOXON.js} +272 -41
  108. package/dist/{chunk-7A4M7PCV.js → chunk-VMNRXKAH.js} +1166 -540
  109. package/dist/{chunk-YSB2N563.js → chunk-VRHTNBA6.js} +121 -87
  110. package/dist/{chunk-AVZDSUFB.js → chunk-VY6W3T43.js} +4 -4
  111. package/dist/{chunk-7UQIVT6G.js → chunk-WCN4YSH7.js} +6 -6
  112. package/dist/{chunk-CSZINQJ2.js → chunk-WOONT5ZP.js} +1 -1
  113. package/dist/{chunk-Q4R73I43.js → chunk-XJ42NBP5.js} +58 -28
  114. package/dist/{chunk-YHDERDRO.js → chunk-ZCHIC2GM.js} +91 -75
  115. package/dist/chunk-ZPL2RR7F.js +798 -0
  116. package/dist/cli/chat.js +33 -35
  117. package/dist/cli/check.js +6 -6
  118. package/dist/cli/plugins.js +13 -13
  119. package/dist/cli/snapshot-create.js +9 -9
  120. package/dist/cli/upgrade.js +7 -7
  121. package/dist/db/schema/agent-invocations.d.ts +20 -0
  122. package/dist/db/schema/conversation-annotations.d.ts +2 -2
  123. package/dist/db/schema.d.ts +22 -2
  124. package/dist/{db-CSEW4RII.js → db-XUKZRFFK.js} +7 -7
  125. package/dist/instrumentation.js +4 -4
  126. package/dist/nitro.js +2 -2
  127. package/dist/{oauth-callback-server-FUEV5HNG.js → oauth-callback-server-LPZMMGFI.js} +25 -26
  128. package/dist/{runner-U3XHSKSH.js → runner-DGKUTMPX.js} +17 -18
  129. package/dist/{skills-AKE6W3WI.js → skills-P7YUFSXM.js} +6 -6
  130. package/dist/spawn-DSK3ZEVD.js +38 -0
  131. package/dist/{validation-WDTAULUF.js → validation-S7U5M5NR.js} +6 -6
  132. package/dist/version.js +1 -1
  133. package/dist/{work-C3HAO2BG.js → work-GAA7TVAD.js} +18 -19
  134. package/dist/{worker-LNP4YKBM.js → worker-JXPJH3QB.js} +11 -10
  135. package/package.json +5 -4
  136. package/dist/api/health.d.ts +0 -7
  137. package/dist/api/personal-tokens/create.d.ts +0 -11
  138. package/dist/api/personal-tokens/list.d.ts +0 -12
  139. package/dist/api/personal-tokens/revoke.d.ts +0 -5
  140. package/dist/api/plugin-reports.d.ts +0 -63
  141. package/dist/api/plugins.d.ts +0 -8
  142. package/dist/api/runtime.d.ts +0 -24
  143. package/dist/api/skills.d.ts +0 -6
  144. package/dist/chat/slack/tools/channel-access.d.ts +0 -30
  145. package/dist/chunk-34GS7B6L.js +0 -115
  146. package/dist/chunk-AVOCH2Z5.js +0 -285
  147. package/dist/chunk-HLXXQI5Q.js +0 -238
  148. package/dist/chunk-K4SZAP3K.js +0 -67
  149. package/dist/chunk-R776HKPK.js +0 -81
  150. package/dist/spawn-B6GDTWJ4.js +0 -39
  151. /package/dist/chat/slack/{tools → tool-support}/canvas/markdown.d.ts +0 -0
  152. /package/dist/chat/slack/{tools → tool-support}/channel-capabilities.d.ts +0 -0
  153. /package/dist/chat/slack/{tools → tool-support}/context.d.ts +0 -0
  154. /package/dist/chat/slack/{tools → tool-support}/list/api.d.ts +0 -0
  155. /package/dist/chat/slack/{tools → tool-support}/slack-message-url.d.ts +0 -0
package/dist/app.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  processConversationWork
3
- } from "./chunk-PVNG6UMU.js";
3
+ } from "./chunk-D6YX4NNN.js";
4
4
  import {
5
5
  bindSpawnAgent
6
- } from "./chunk-745QJ3ZA.js";
6
+ } from "./chunk-7OEIXFC3.js";
7
7
  import {
8
8
  createAgentInvocationWorker,
9
9
  enqueueAgentInvocation,
10
10
  listPendingAgentInvocationMailboxAppends,
11
11
  routeAgentInvocationWork
12
- } from "./chunk-YEO3VX72.js";
12
+ } from "./chunk-OJCP3C3J.js";
13
13
  import {
14
14
  GET as GET2,
15
15
  GET2 as GET3,
@@ -25,21 +25,36 @@ import {
25
25
  getSlackErrorObservabilityAttributes,
26
26
  getThreadId,
27
27
  getThreadTs,
28
- getTurnRequestDeadline,
29
28
  isRetryableSlackPostError,
30
29
  isSlackTitlePermissionError,
31
30
  publishAppHomeView,
32
31
  receiveLocalOAuthCredential,
33
32
  resumeSlackTurn,
34
- runWithTurnRequestDeadline,
35
33
  sendSlackReply,
36
34
  shouldKeepProcessingReactionForToolInvocation,
37
35
  splitSlackReplyText,
38
36
  startSlackProcessingReaction,
39
37
  stripLeadingBotMention,
40
38
  wakePausedTurn
41
- } from "./chunk-AYU72WO7.js";
39
+ } from "./chunk-ULAU5ZGU.js";
42
40
  import "./chunk-FA6POGLH.js";
41
+ import {
42
+ getTurnRequestDeadline,
43
+ runWithTurnRequestDeadline
44
+ } from "./chunk-DUY5CDAM.js";
45
+ import {
46
+ completeAuthPauseTurn,
47
+ persistAuthPauseTurnState
48
+ } from "./chunk-LNVEIJ2L.js";
49
+ import {
50
+ GET,
51
+ conversationVisibilityFromSlackChannelType,
52
+ createApiTurnWorker,
53
+ resolveSlackChannelTypeFromMessage,
54
+ resolveSlackConversationContext,
55
+ routeApiTurnWork
56
+ } from "./chunk-ZPL2RR7F.js";
57
+ import "./chunk-4CODA7P5.js";
43
58
  import {
44
59
  CONVERSATION_WORK_STALE_ENQUEUE_MS,
45
60
  appendAndEnqueueInboundMessage,
@@ -50,12 +65,11 @@ import {
50
65
  isInvalidConversationRecordError,
51
66
  listActiveConversationIds,
52
67
  removeActiveConversation
53
- } from "./chunk-CWP5RHVX.js";
68
+ } from "./chunk-HLPLT3NY.js";
54
69
  import {
55
70
  buildConversationContext,
56
71
  buildDeliveredTurnStatePatch,
57
72
  claimDispatchMailboxAppend,
58
- completeAuthPauseTurn,
59
73
  confirmDispatchMailboxAppend,
60
74
  createConversationMemoryService,
61
75
  createOrGetDispatch,
@@ -83,15 +97,15 @@ import {
83
97
  markDispatchFailed,
84
98
  markDispatchRunning,
85
99
  normalizeConversationText,
86
- persistAuthPauseTurnState,
87
100
  processPluginTask,
88
101
  recordDeliveredAssistantMessage,
102
+ recordTaskExecution,
89
103
  requireTurnFailureEventId,
90
104
  resolveTurnSessionRouting,
91
105
  scheduleSessionCompletedPluginTasks,
92
106
  turnHasReply,
93
107
  upsertConversationMessage
94
- } from "./chunk-6H5SZR24.js";
108
+ } from "./chunk-RRJV5UR5.js";
95
109
  import {
96
110
  ConversationTurnLifecycleService,
97
111
  coerceThreadConversationState,
@@ -101,17 +115,7 @@ import {
101
115
  persistThreadRuntimeState,
102
116
  persistThreadState,
103
117
  persistThreadStateById
104
- } from "./chunk-AZ7EAOBE.js";
105
- import {
106
- GET,
107
- conversationVisibilityFromSlackChannelType,
108
- resolveSlackChannelTypeFromMessage,
109
- resolveSlackConversationContext
110
- } from "./chunk-34GS7B6L.js";
111
- import "./chunk-4CODA7P5.js";
112
- import {
113
- recordTaskExecution
114
- } from "./chunk-AVOCH2Z5.js";
118
+ } from "./chunk-IL4EDBMV.js";
115
119
  import "./chunk-UTL3MHPC.js";
116
120
  import {
117
121
  getVercelConversationWorkQueue,
@@ -130,7 +134,7 @@ import {
130
134
  import {
131
135
  validatePluginEgressCredentialHooks,
132
136
  validatePluginRegistrations
133
- } from "./chunk-YNTTROJT.js";
137
+ } from "./chunk-QOWHHM3F.js";
134
138
  import {
135
139
  defineJuniorPlugins,
136
140
  pluginCatalogConfigFromEnv,
@@ -163,29 +167,47 @@ import {
163
167
  setConfigDefaults,
164
168
  shouldEmitDevAgentTrace,
165
169
  shouldPropagateSandboxEgressTrace
166
- } from "./chunk-7A4M7PCV.js";
170
+ } from "./chunk-VMNRXKAH.js";
167
171
  import {
168
172
  AuthorizationFlowDisabledError,
169
173
  PluginCredentialFailureError
170
- } from "./chunk-X5UY34KT.js";
174
+ } from "./chunk-EINWQFXI.js";
171
175
  import "./chunk-DIB4GX3G.js";
172
176
  import {
173
177
  createUserTokenStore,
174
178
  deleteMcpAuthSessionsForUserProvider,
175
179
  deleteMcpServerSessionId,
176
180
  deleteMcpStoredOAuthCredentials
177
- } from "./chunk-Q4R73I43.js";
181
+ } from "./chunk-XJ42NBP5.js";
178
182
  import {
179
183
  RetryableDeliveryError
180
- } from "./chunk-R776HKPK.js";
184
+ } from "./chunk-GDFF3BQG.js";
181
185
  import {
182
186
  formatProviderLabel,
183
187
  postSlackMessage,
184
188
  startOAuthFlow
185
- } from "./chunk-7UQIVT6G.js";
189
+ } from "./chunk-WCN4YSH7.js";
190
+ import "./chunk-HUO3UTAQ.js";
191
+ import {
192
+ getExperimentalFeatures,
193
+ setExperimentalFeatures
194
+ } from "./chunk-5IDFPCON.js";
195
+ import {
196
+ getSandboxResourceConfig,
197
+ setSandboxResourceConfig
198
+ } from "./chunk-VY6W3T43.js";
199
+ import {
200
+ createSchedulerSqlStore,
201
+ findMatchingEventTasks,
202
+ logScheduledTaskRunSkipped,
203
+ scheduledTaskRunAttributes
204
+ } from "./chunk-GXYDVZKM.js";
205
+ import {
206
+ parseSlackThreadId
207
+ } from "./chunk-WOONT5ZP.js";
186
208
  import {
187
209
  estimateTextTokens
188
- } from "./chunk-K4SZAP3K.js";
210
+ } from "./chunk-4EA2SFK2.js";
189
211
  import {
190
212
  ConversationTurnBoundaryError,
191
213
  CooperativeTurnYieldError,
@@ -223,28 +245,8 @@ import {
223
245
  startActiveTurn,
224
246
  stripRuntimeTurnContext,
225
247
  trimTrailingAssistantMessages
226
- } from "./chunk-AIOK6LAG.js";
248
+ } from "./chunk-VCYSOXON.js";
227
249
  import "./chunk-3Y47VMHV.js";
228
- import "./chunk-HUO3UTAQ.js";
229
- import {
230
- getExperimentalFeatures,
231
- setExperimentalFeatures
232
- } from "./chunk-5IDFPCON.js";
233
- import {
234
- getSandboxResourceConfig,
235
- setSandboxResourceConfig
236
- } from "./chunk-AVZDSUFB.js";
237
- import {
238
- createSchedulerSqlStore,
239
- findMatchingEventTasks,
240
- logScheduledTaskRunSkipped,
241
- scheduledTaskRunAttributes
242
- } from "./chunk-EFLJ2WJH.js";
243
- import {
244
- parseSlackThreadId
245
- } from "./chunk-CSZINQJ2.js";
246
- import "./chunk-Z4YU7Z4L.js";
247
- import "./chunk-HLXXQI5Q.js";
248
250
  import "./chunk-PDO5BLNM.js";
249
251
  import "./chunk-UIE3R5XU.js";
250
252
  import {
@@ -263,7 +265,7 @@ import {
263
265
  verifyEventTaskCredentialSubject,
264
266
  verifyScheduledTaskCredentialSubject,
265
267
  verifySlackDirectCredentialSubject
266
- } from "./chunk-YHDERDRO.js";
268
+ } from "./chunk-ZCHIC2GM.js";
267
269
  import {
268
270
  SlackActionError,
269
271
  downloadPrivateSlackFile,
@@ -273,7 +275,7 @@ import {
273
275
  normalizeSlackConversationId,
274
276
  runWithSlackInstallationToken,
275
277
  runWithWorkspaceTeamId
276
- } from "./chunk-SGZO7UWH.js";
278
+ } from "./chunk-V2FXMOEA.js";
277
279
  import {
278
280
  contextProvenance,
279
281
  createSlackDestination,
@@ -286,19 +288,19 @@ import {
286
288
  requireSlackDestination,
287
289
  withConversationEventLock,
288
290
  withConversationMutationLock
289
- } from "./chunk-YSB2N563.js";
291
+ } from "./chunk-VRHTNBA6.js";
290
292
  import {
291
293
  juniorAgentBindings,
292
294
  juniorAgentInvocations,
293
295
  juniorConversationEvents,
294
296
  juniorConversations
295
- } from "./chunk-DU74WPIC.js";
297
+ } from "./chunk-D3WPMGEX.js";
296
298
  import "./chunk-EM225ITJ.js";
297
299
  import {
298
300
  acquireActiveLock,
299
301
  getStateAdapter,
300
302
  withActiveLock
301
- } from "./chunk-ORO3PWKQ.js";
303
+ } from "./chunk-2B3PT3V2.js";
302
304
  import {
303
305
  STANDARD_MODEL_PROFILE,
304
306
  botConfig,
@@ -316,16 +318,16 @@ import {
316
318
  modelIdForProfile,
317
319
  setSlackReactionConfig,
318
320
  standardModelId
319
- } from "./chunk-7NVJVJID.js";
321
+ } from "./chunk-4GXJUYJV.js";
320
322
  import {
321
323
  juniorDestinations
322
324
  } from "./chunk-VFUK3X5B.js";
323
- import "./chunk-RXBVB2JM.js";
324
- import "./chunk-YBVXBNSV.js";
325
+ import "./chunk-LE5H7LMT.js";
326
+ import "./chunk-4AQZYNHM.js";
325
327
  import {
326
328
  pluginCatalogRuntime
327
- } from "./chunk-JUUKWRBE.js";
328
- import "./chunk-GGB4WL5A.js";
329
+ } from "./chunk-HWQGBIH7.js";
330
+ import "./chunk-POSZWRGL.js";
329
331
  import {
330
332
  credentialContextForActor
331
333
  } from "./chunk-RUIXF3YQ.js";
@@ -359,7 +361,7 @@ import {
359
361
  withContext,
360
362
  withLogContext,
361
363
  withSpan
362
- } from "./chunk-4LJO56OJ.js";
364
+ } from "./chunk-EAI67NTM.js";
363
365
  import {
364
366
  continueTrace
365
367
  } from "./chunk-6GWA276C.js";
@@ -367,10 +369,10 @@ import "./chunk-OOUNJNMR.js";
367
369
  import "./chunk-H4HBKISO.js";
368
370
  import {
369
371
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
370
- } from "./chunk-DLDRQHG5.js";
372
+ } from "./chunk-LAZGHEYU.js";
371
373
  import {
372
374
  JUNIOR_VERSION
373
- } from "./chunk-IIOOO4FQ.js";
375
+ } from "./chunk-55F4QU2V.js";
374
376
  import "./chunk-MLKGABMK.js";
375
377
 
376
378
  // src/app.ts
@@ -474,6 +476,7 @@ function buildAgentDispatchInboundMessage(dispatch2, nowMs = Date.now()) {
474
476
  }
475
477
  },
476
478
  receivedAtMs: nowMs,
479
+ publishExternally: true,
477
480
  source: "plugin"
478
481
  };
479
482
  }
@@ -1214,13 +1217,23 @@ var SCHEDULE_FREQUENCY_COPY = {
1214
1217
  function singleLineMetadataValue(value) {
1215
1218
  return value.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
1216
1219
  }
1220
+ function buildDispatchInput(task) {
1221
+ const creator = sanitizeScheduledTaskPrincipal(task.createdBy);
1222
+ return [
1223
+ "You are executing a scheduled task.",
1224
+ "",
1225
+ "Task:",
1226
+ `- creator: <@${creator.slackUserId}>`,
1227
+ "",
1228
+ "Stored user instruction:",
1229
+ task.task.text
1230
+ ].join("\n");
1231
+ }
1217
1232
  function buildDispatchMetadata(args) {
1218
- const creator = sanitizeScheduledTaskPrincipal(args.task.createdBy);
1219
1233
  if (!args.task.task.text?.trim()) {
1220
1234
  throw new Error("Scheduled task text is required");
1221
1235
  }
1222
1236
  return {
1223
- creatorSlackUserId: creator.slackUserId,
1224
1237
  runId: args.run.id,
1225
1238
  schedule: singleLineMetadataValue(args.task.schedule.description),
1226
1239
  scheduleKind: args.task.schedule.kind,
@@ -1507,7 +1520,7 @@ async function runScheduledTaskHeartbeat(args) {
1507
1520
  } : {},
1508
1521
  destination: task.destination,
1509
1522
  destinationVisibility: task.conversationAccess.visibility,
1510
- input: task.task.text,
1523
+ input: buildDispatchInput(task),
1511
1524
  metadata,
1512
1525
  replyAttribution: replyAttribution(task),
1513
1526
  source: dispatchSource(task)
@@ -2976,6 +2989,7 @@ function createSlackResourceEventInboundMessage(input) {
2976
2989
  delivery: "defer",
2977
2990
  source: "resource_event",
2978
2991
  receivedAtMs: Date.now(),
2992
+ publishExternally: true,
2979
2993
  input: {
2980
2994
  text: input.text,
2981
2995
  authorId: RESOURCE_EVENT_SLACK_AUTHOR_ID,
@@ -3180,7 +3194,9 @@ function createSlackConversationWorker(options) {
3180
3194
  };
3181
3195
  const drainSteeringMessages = async (accept) => {
3182
3196
  await context.attempt.drain(async (pendingRecords) => {
3183
- const candidates = pendingRecords.map((record) => ({
3197
+ const candidates = pendingRecords.filter(
3198
+ (record) => record.publishExternally === context.publishExternally
3199
+ ).map((record) => ({
3184
3200
  inboundMessageId: record.inboundMessageId,
3185
3201
  message: restoreMessage({ adapter, record })
3186
3202
  })).filter(
@@ -3194,6 +3210,7 @@ function createSlackConversationWorker(options) {
3194
3210
  await options.runtime.handleNewMention(thread, latestMessage, {
3195
3211
  conversationId: context.conversationId,
3196
3212
  destination,
3213
+ publishExternally: context.publishExternally,
3197
3214
  messageContext,
3198
3215
  drainSteeringMessages,
3199
3216
  ack,
@@ -3207,6 +3224,7 @@ function createSlackConversationWorker(options) {
3207
3224
  {
3208
3225
  conversationId: context.conversationId,
3209
3226
  destination,
3227
+ publishExternally: context.publishExternally,
3210
3228
  messageContext,
3211
3229
  drainSteeringMessages,
3212
3230
  ack,
@@ -3258,6 +3276,7 @@ function buildSlackInboundMessage(args) {
3258
3276
  source: "slack",
3259
3277
  createdAtMs: args.message.metadata.dateSent.getTime(),
3260
3278
  receivedAtMs: args.receivedAtMs,
3279
+ publishExternally: true,
3261
3280
  input: {
3262
3281
  text: args.message.text || " ",
3263
3282
  authorId,
@@ -4800,6 +4819,9 @@ function buildLogContext(deps, args) {
4800
4819
  function actorUserName(message) {
4801
4820
  return getMessageActorIdentity(message)?.userName;
4802
4821
  }
4822
+ function shouldPublishExternally(publishExternally) {
4823
+ return publishExternally !== false;
4824
+ }
4803
4825
  function createSlackTurnRuntime(deps) {
4804
4826
  const logContext = (args) => buildLogContext(deps, args);
4805
4827
  const maybeHandleThreadOptOutDecision = async (args) => {
@@ -5113,6 +5135,7 @@ function createSlackTurnRuntime(deps) {
5113
5135
  conversationId: hooks.conversationId,
5114
5136
  destination: hooks.destination,
5115
5137
  queuedMessages,
5138
+ publishExternally: shouldPublishExternally(hooks.publishExternally),
5116
5139
  ack,
5117
5140
  onToolInvocation: toolInvocationHook,
5118
5141
  onTurnCompleted,
@@ -5170,11 +5193,13 @@ function createSlackTurnRuntime(deps) {
5170
5193
  lifecycleError = error2;
5171
5194
  }
5172
5195
  await hooks.beforeFirstResponsePost?.();
5173
- await postFallbackErrorReplyWithLogging({
5174
- thread,
5175
- eventId,
5176
- postFailureEventName: "mention.handler.failure_reply_post.failed"
5177
- });
5196
+ if (shouldPublishExternally(hooks.publishExternally)) {
5197
+ await postFallbackErrorReplyWithLogging({
5198
+ thread,
5199
+ eventId,
5200
+ postFailureEventName: "mention.handler.failure_reply_post.failed"
5201
+ });
5202
+ }
5178
5203
  if (lifecycleError) throw lifecycleError;
5179
5204
  } finally {
5180
5205
  if (completed) {
@@ -5374,6 +5399,7 @@ function createSlackTurnRuntime(deps) {
5374
5399
  conversationId: hooks.conversationId,
5375
5400
  destination: hooks.destination,
5376
5401
  preparedState,
5402
+ publishExternally: shouldPublishExternally(hooks.publishExternally),
5377
5403
  beforeFirstResponsePost: hooks.beforeFirstResponsePost,
5378
5404
  queuedMessages,
5379
5405
  ack,
@@ -5436,11 +5462,13 @@ function createSlackTurnRuntime(deps) {
5436
5462
  lifecycleError = error2;
5437
5463
  }
5438
5464
  await hooks.beforeFirstResponsePost?.();
5439
- await postFallbackErrorReplyWithLogging({
5440
- thread,
5441
- eventId,
5442
- postFailureEventName: "subscribed_message.handler.failure_reply_post.failed"
5443
- });
5465
+ if (shouldPublishExternally(hooks.publishExternally)) {
5466
+ await postFallbackErrorReplyWithLogging({
5467
+ thread,
5468
+ eventId,
5469
+ postFailureEventName: "subscribed_message.handler.failure_reply_post.failed"
5470
+ });
5471
+ }
5444
5472
  if (lifecycleError) throw lifecycleError;
5445
5473
  } finally {
5446
5474
  if (completed) {
@@ -6240,6 +6268,9 @@ async function loadPiMessagesForTurn(args) {
6240
6268
  }
6241
6269
  return {};
6242
6270
  }
6271
+ function shouldPublishExternally2(publishExternally) {
6272
+ return publishExternally !== false;
6273
+ }
6243
6274
  function createReplyToThread(deps) {
6244
6275
  return async function replyToThread(thread, message, options) {
6245
6276
  if (message.author.isMe) {
@@ -6376,6 +6407,9 @@ function createReplyToThread(deps) {
6376
6407
  );
6377
6408
  try {
6378
6409
  await beforeFirstResponsePost();
6410
+ if (!shouldPublishExternally2(options.publishExternally)) {
6411
+ return;
6412
+ }
6379
6413
  if (channelId && threadTs) {
6380
6414
  await sendSlackReply({
6381
6415
  channelId,
@@ -6570,7 +6604,9 @@ function createReplyToThread(deps) {
6570
6604
  });
6571
6605
  if (configReply) {
6572
6606
  await beforeFirstResponsePost();
6573
- await thread.post(buildSlackOutputMessage(configReply.text));
6607
+ if (shouldPublishExternally2(options.publishExternally)) {
6608
+ await thread.post(buildSlackOutputMessage(configReply.text));
6609
+ }
6574
6610
  markConversationMessage(
6575
6611
  preparedState.conversation,
6576
6612
  preparedState.userMessageId,
@@ -6737,19 +6773,21 @@ function createReplyToThread(deps) {
6737
6773
  let slackMessageTs2 = [];
6738
6774
  await beforeFirstResponsePost();
6739
6775
  try {
6740
- if (channelId && thread.adapter.name === "slack") {
6741
- slackMessageTs2 = await sendSlackReply({
6742
- channelId,
6743
- conversationId,
6744
- replyAttribution: options.execution?.dispatch?.replyAttribution,
6745
- text,
6746
- ...threadTs ? { threadTs } : {}
6747
- });
6748
- } else {
6749
- for (const part of splitSlackReplyText(text)) {
6750
- const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
6751
- if (postedMessageTs) {
6752
- slackMessageTs2.push(postedMessageTs);
6776
+ if (shouldPublishExternally2(options.publishExternally)) {
6777
+ if (channelId && thread.adapter.name === "slack") {
6778
+ slackMessageTs2 = await sendSlackReply({
6779
+ channelId,
6780
+ conversationId,
6781
+ replyAttribution: options.execution?.dispatch?.replyAttribution,
6782
+ text,
6783
+ ...threadTs ? { threadTs } : {}
6784
+ });
6785
+ } else {
6786
+ for (const part of splitSlackReplyText(text)) {
6787
+ const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
6788
+ if (postedMessageTs) {
6789
+ slackMessageTs2.push(postedMessageTs);
6790
+ }
6753
6791
  }
6754
6792
  }
6755
6793
  }
@@ -6980,6 +7018,7 @@ function createReplyToThread(deps) {
6980
7018
  slackConversation,
6981
7019
  source,
6982
7020
  destination,
7021
+ publishExternally: shouldPublishExternally2(options.publishExternally),
6983
7022
  ...destinationVisibility ? { destinationVisibility } : {},
6984
7023
  surface: options.execution?.surface ?? "slack",
6985
7024
  dispatch: options.execution?.dispatch,
@@ -7465,21 +7504,26 @@ function getBackfillText(entry) {
7465
7504
  const text = normalizeConversationText(parseContent(entry).text);
7466
7505
  return text || void 0;
7467
7506
  }
7468
- async function seedConversationBackfill(thread, conversation, currentTurn) {
7507
+ async function seedConversationBackfill(thread, conversation, currentTurn, resolveMessageActors) {
7469
7508
  if (conversation.messages.length > 0 || conversation.compactions.length > 0) {
7470
7509
  return "recent_messages";
7471
7510
  }
7472
7511
  const seeded = [];
7473
7512
  let source = "recent_messages";
7513
+ let fetchedNewestFirst;
7474
7514
  try {
7475
- const fetchedNewestFirst = [];
7515
+ const fetched = [];
7476
7516
  for await (const entry of thread.messages) {
7477
- fetchedNewestFirst.push(entry);
7478
- if (fetchedNewestFirst.length >= BACKFILL_MESSAGE_LIMIT) {
7517
+ fetched.push(entry);
7518
+ if (fetched.length >= BACKFILL_MESSAGE_LIMIT) {
7479
7519
  break;
7480
7520
  }
7481
7521
  }
7482
- fetchedNewestFirst.reverse();
7522
+ fetchedNewestFirst = fetched.reverse();
7523
+ } catch {
7524
+ }
7525
+ if (fetchedNewestFirst) {
7526
+ await resolveMessageActors(fetchedNewestFirst);
7483
7527
  for (const entry of fetchedNewestFirst) {
7484
7528
  const text = getBackfillText(entry);
7485
7529
  if (text) {
@@ -7489,7 +7533,6 @@ async function seedConversationBackfill(thread, conversation, currentTurn) {
7489
7533
  if (seeded.length > 0) {
7490
7534
  source = "thread_fetch";
7491
7535
  }
7492
- } catch {
7493
7536
  }
7494
7537
  if (seeded.length === 0) {
7495
7538
  try {
@@ -7497,6 +7540,7 @@ async function seedConversationBackfill(thread, conversation, currentTurn) {
7497
7540
  } catch {
7498
7541
  }
7499
7542
  const fromRecent = thread.recentMessages.slice(-BACKFILL_MESSAGE_LIMIT);
7543
+ await resolveMessageActors(fromRecent);
7500
7544
  for (const entry of fromRecent) {
7501
7545
  const text = getBackfillText(entry);
7502
7546
  if (text) {
@@ -7528,10 +7572,15 @@ function createPrepareTurnState(deps) {
7528
7572
  await hydrateConversationMessages({ conversation, conversationId });
7529
7573
  const locationConfiguration = args.locationConfiguration ?? getLocationConfigurationService(args.destination);
7530
7574
  const configuration = await locationConfiguration.resolveValues();
7531
- const backfillSource = args.skipBackfill ? void 0 : await seedConversationBackfill(args.thread, conversation, {
7532
- messageId: args.message.id,
7533
- messageCreatedAtMs: args.message.metadata.dateSent.getTime()
7534
- });
7575
+ const backfillSource = args.skipBackfill ? void 0 : await seedConversationBackfill(
7576
+ args.thread,
7577
+ conversation,
7578
+ {
7579
+ messageId: args.message.id,
7580
+ messageCreatedAtMs: args.message.metadata.dateSent.getTime()
7581
+ },
7582
+ (messages) => deps.resolveBackfillMessageActors(messages, args.destination)
7583
+ );
7535
7584
  for (const queued of args.queuedMessages ?? []) {
7536
7585
  const queuedMessage = toConversationMessage({
7537
7586
  entry: queued.message,
@@ -7565,7 +7614,10 @@ function createPrepareTurnState(deps) {
7565
7614
  threadTs: getThreadTs(args.context.threadId)
7566
7615
  });
7567
7616
  if (conversationId) {
7568
- await persistConversationVisionCache(conversationId, conversation.vision);
7617
+ await persistConversationVisionCache(
7618
+ conversationId,
7619
+ conversation.vision
7620
+ );
7569
7621
  }
7570
7622
  }
7571
7623
  await persistConversationMessages({ conversation, conversationId });
@@ -7650,6 +7702,7 @@ function createSlackDispatchTurnRunner(options) {
7650
7702
  ack: hooks.ack,
7651
7703
  conversationId,
7652
7704
  destination: dispatch2.destination,
7705
+ publishExternally: true,
7653
7706
  execution: {
7654
7707
  disabledFeatures: ["interactive-auth"],
7655
7708
  locationConfiguration: options.getLocationConfiguration(
@@ -7706,7 +7759,24 @@ function createSlackRuntime(options) {
7706
7759
  const services = createJuniorRuntimeServices(options.services);
7707
7760
  const prepareTurnState = createPrepareTurnState({
7708
7761
  compactConversationIfNeeded: services.conversationMemory.compactConversationIfNeeded,
7709
- hydrateConversationVisionContext: services.visionContext.hydrateConversationVisionContext
7762
+ hydrateConversationVisionContext: services.visionContext.hydrateConversationVisionContext,
7763
+ resolveBackfillMessageActors: async (messages, destination) => {
7764
+ if (destination.platform !== "slack") {
7765
+ throw new Error("Slack turn backfill requires a Slack destination");
7766
+ }
7767
+ await Promise.all(
7768
+ messages.filter((message) => {
7769
+ const actor = getMessageActorIdentity(message);
7770
+ return !message.author.isMe && Boolean(actor?.userId) && !actor?.fullName && !actor?.userName;
7771
+ }).map(
7772
+ (message) => ensureSlackMessageActorIdentity(
7773
+ message,
7774
+ destination.teamId,
7775
+ services.replyExecutor.lookupSlackUser
7776
+ )
7777
+ )
7778
+ );
7779
+ }
7710
7780
  });
7711
7781
  const replyToThread = createReplyToThread({
7712
7782
  getSlackAdapter: options.getSlackAdapter,
@@ -8145,6 +8215,9 @@ async function runPausedTurnInContext(payload, options, runOptions) {
8145
8215
  credentialContext,
8146
8216
  actor,
8147
8217
  destination: routingDestination,
8218
+ // Slack resume publishes unless the checkpoint opted out.
8219
+ // Missing means legacy/in-flight Slack turns still post.
8220
+ publishExternally: activeTurn.publishExternally !== false,
8148
8221
  source,
8149
8222
  toolChannelId: destination.channelId
8150
8223
  },
@@ -8419,11 +8492,16 @@ function createConversationWork(options) {
8419
8492
  return {
8420
8493
  conversationStore: options.conversationStore,
8421
8494
  queue: options.queue,
8422
- run: routeAgentInvocationWork({
8423
- invocationWorker: createAgentInvocationWorker({
8495
+ run: routeApiTurnWork({
8496
+ apiTurnWorker: createApiTurnWorker({
8424
8497
  agentRunner: options.agentRunner
8425
8498
  }),
8426
- fallbackWorker: providerWorker
8499
+ fallbackWorker: routeAgentInvocationWork({
8500
+ invocationWorker: createAgentInvocationWorker({
8501
+ agentRunner: options.agentRunner
8502
+ }),
8503
+ fallbackWorker: providerWorker
8504
+ })
8427
8505
  }),
8428
8506
  runtime,
8429
8507
  state: options.state
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-JUUKWRBE.js";
4
- import "./chunk-GGB4WL5A.js";
3
+ } from "./chunk-HWQGBIH7.js";
4
+ import "./chunk-POSZWRGL.js";
5
5
  import "./chunk-RUIXF3YQ.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
7
  import "./chunk-F3B2YJ76.js";
8
- import "./chunk-4LJO56OJ.js";
8
+ import "./chunk-EAI67NTM.js";
9
9
  import "./chunk-6GWA276C.js";
10
10
  import "./chunk-OOUNJNMR.js";
11
11
  import "./chunk-H4HBKISO.js";
12
- import "./chunk-DLDRQHG5.js";
13
- import "./chunk-IIOOO4FQ.js";
12
+ import "./chunk-LAZGHEYU.js";
13
+ import "./chunk-55F4QU2V.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  pluginCatalogRuntime
@@ -26,11 +26,14 @@ export interface SlackActor extends BaseActor {
26
26
  export interface LocalActor extends BaseActor {
27
27
  platform: "local";
28
28
  }
29
+ export interface WebActor extends BaseActor {
30
+ platform: "web";
31
+ }
29
32
  export interface SystemActor {
30
33
  platform: "system";
31
34
  name: string;
32
35
  }
33
- export type UserActor = SlackActor | LocalActor;
36
+ export type UserActor = SlackActor | LocalActor | WebActor;
34
37
  export type Actor = UserActor | SystemActor;
35
38
  export interface SlackActorProfile {
36
39
  email?: string;
@@ -96,6 +96,8 @@ export interface AgentRunRouting {
96
96
  */
97
97
  slackActionToken?: SlackActionToken;
98
98
  destination: Destination;
99
+ /** When true, also publish assistant output to the conversation destination. */
100
+ publishExternally?: boolean;
99
101
  /** Confirmed visibility of the destination where this run is delivered. */
100
102
  destinationVisibility?: ConversationPrivacy;
101
103
  surface?: AgentTurnSurface;