@sentry/junior 0.186.0 → 0.187.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 (72) hide show
  1. package/dist/{agent-hooks-4B3Z4WRK.js → agent-hooks-XVAE2554.js} +11 -11
  2. package/dist/api.js +32 -32
  3. package/dist/app.js +59 -89
  4. package/dist/{catalog-runtime-AFJCAOHC.js → catalog-runtime-DWFAC562.js} +4 -4
  5. package/dist/chat/agent/types.d.ts +16 -13
  6. package/dist/chat/api-turns/{accepted-reply.d.ts → assistant-message.d.ts} +3 -2
  7. package/dist/chat/api-turns/cancellation.d.ts +0 -1
  8. package/dist/chat/api-turns/mailbox-input.d.ts +0 -3
  9. package/dist/chat/api-turns/routing.d.ts +22 -21
  10. package/dist/chat/api-turns/work.d.ts +2 -2
  11. package/dist/chat/conversations/location.d.ts +2 -2
  12. package/dist/chat/conversations/store.d.ts +13 -0
  13. package/dist/chat/resource-events/actor.d.ts +7 -0
  14. package/dist/chat/services/turn-session-routing.d.ts +6 -5
  15. package/dist/chat/task-input.d.ts +22 -0
  16. package/dist/{chunk-CM6RTYSO.js → chunk-27T5HZHO.js} +91 -7
  17. package/dist/{chunk-QBL2AVFF.js → chunk-2VUDJGB6.js} +2 -2
  18. package/dist/{chunk-7EOWT62G.js → chunk-4A2R3AQB.js} +1 -1
  19. package/dist/{chunk-7EU4YSZ4.js → chunk-4YD3DET6.js} +139 -121
  20. package/dist/{chunk-INQHUE72.js → chunk-6FGN7ZEG.js} +6 -2
  21. package/dist/{chunk-VQZYIVYN.js → chunk-6FKNNUSN.js} +6 -6
  22. package/dist/{chunk-3CVEE6LA.js → chunk-6YCIYOVA.js} +1 -1
  23. package/dist/{chunk-YXSBZRP7.js → chunk-7LRRVMPH.js} +1 -1
  24. package/dist/{chunk-QU3URVWG.js → chunk-BITZUBPJ.js} +8 -8
  25. package/dist/{chunk-CV5CPRVG.js → chunk-D3GDGREI.js} +3 -3
  26. package/dist/{chunk-H7X2G2KS.js → chunk-D5BWM37G.js} +5 -5
  27. package/dist/{chunk-JFPY6XFF.js → chunk-DUE4EUNL.js} +6 -6
  28. package/dist/{chunk-OZG7E22Y.js → chunk-EIWYZXSM.js} +5 -5
  29. package/dist/{chunk-VXL2LBPK.js → chunk-HXR3FHTE.js} +13 -3
  30. package/dist/{chunk-PZZOGHVR.js → chunk-ITLYUKGZ.js} +1 -1
  31. package/dist/{chunk-BRKB5R7P.js → chunk-JCRXXEMC.js} +1 -1
  32. package/dist/{chunk-HWXP6RHG.js → chunk-JZPDYKRG.js} +3 -3
  33. package/dist/{chunk-EWRPUXE3.js → chunk-KRYJ5VOD.js} +20 -14
  34. package/dist/{chunk-DHYZ4VKG.js → chunk-MUPPP7A7.js} +97 -47
  35. package/dist/{chunk-2IBDVE62.js → chunk-NIKLTFBP.js} +4 -4
  36. package/dist/{chunk-VOGOTEW7.js → chunk-NU775DLU.js} +2 -2
  37. package/dist/{chunk-GQMQCY7H.js → chunk-OM4SFFJK.js} +3 -3
  38. package/dist/{chunk-O6GQO7VP.js → chunk-P2VU5JNH.js} +26 -24
  39. package/dist/{chunk-FFYDRLXW.js → chunk-Q6OCUQ7W.js} +1 -1
  40. package/dist/{chunk-NRMAOGRS.js → chunk-QH3I7ZOK.js} +1 -1
  41. package/dist/{chunk-ACGWTJ74.js → chunk-STF4GSK4.js} +3 -3
  42. package/dist/{chunk-2U7EPTRZ.js → chunk-TQHCZXN7.js} +4 -4
  43. package/dist/{chunk-VQIWBJOP.js → chunk-U3KMII5Y.js} +1 -1
  44. package/dist/{chunk-GSB3NTNS.js → chunk-U5POFCKM.js} +29 -31
  45. package/dist/{chunk-DOP3FIQC.js → chunk-U6ZQHRIP.js} +1 -1
  46. package/dist/{chunk-AD64YMEC.js → chunk-URZ7UD4P.js} +2 -2
  47. package/dist/{chunk-STOCCPWH.js → chunk-VC343WHM.js} +1 -1
  48. package/dist/{chunk-43LODHJM.js → chunk-WKIS4VRK.js} +3 -3
  49. package/dist/{chunk-MCLWOBPN.js → chunk-WL3R2KTS.js} +11 -89
  50. package/dist/{chunk-TXLBLGNQ.js → chunk-WRDW3A3D.js} +5 -5
  51. package/dist/{chunk-64WF2GQ3.js → chunk-X5SXFVZT.js} +1 -1
  52. package/dist/{chunk-HKFLRIBD.js → chunk-Z6OHCDXP.js} +2 -2
  53. package/dist/cli/chat.js +33 -33
  54. package/dist/cli/check.js +5 -5
  55. package/dist/cli/plugins.js +12 -12
  56. package/dist/cli/snapshot-create.js +9 -9
  57. package/dist/cli/upgrade.js +6 -6
  58. package/dist/{db-7XL4UPAE.js → db-FBHAWVXU.js} +6 -6
  59. package/dist/instrumentation.js +3 -3
  60. package/dist/nitro.js +6 -6
  61. package/dist/{oauth-callback-server-RAOYHWDI.js → oauth-callback-server-5HS5ULC6.js} +28 -28
  62. package/dist/{runner-KMPBWRPM.js → runner-46W6NV6B.js} +19 -19
  63. package/dist/{skills-IPCALGLQ.js → skills-TG3QC4B6.js} +5 -5
  64. package/dist/spawn-Y6YWBIJS.js +41 -0
  65. package/dist/task-runner-YSGBPN4U.js +34 -0
  66. package/dist/{validation-BSRCCX6N.js → validation-GMRIDBC5.js} +5 -5
  67. package/dist/version.js +1 -1
  68. package/dist/{work-T6UFTOJY.js → work-W4ULBJTU.js} +21 -21
  69. package/dist/{worker-L35OG7VA.js → worker-M6NVACS2.js} +10 -10
  70. package/package.json +5 -5
  71. package/dist/spawn-OSOWTMBG.js +0 -41
  72. package/dist/task-runner-IQNBA3RY.js +0 -34
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  buildSentryConversationUrl,
6
6
  deleteWebAuthorization
7
- } from "./chunk-PZZOGHVR.js";
7
+ } from "./chunk-ITLYUKGZ.js";
8
8
  import {
9
9
  AgentRunError,
10
10
  executeTurn
11
- } from "./chunk-GQMQCY7H.js";
11
+ } from "./chunk-OM4SFFJK.js";
12
12
  import {
13
13
  buildDeliveredTurnStatePatch,
14
14
  finalizeFailedTurnReplyWithEvent,
@@ -19,22 +19,22 @@ import {
19
19
  getTurnUserSlackMessageTs,
20
20
  persistAuthPauseTurnState,
21
21
  requireTurnFailureEventId
22
- } from "./chunk-OZG7E22Y.js";
22
+ } from "./chunk-EIWYZXSM.js";
23
23
  import {
24
- resolveTurnSessionRouting,
25
24
  scheduleSessionCompletedPluginTasks
26
- } from "./chunk-MCLWOBPN.js";
25
+ } from "./chunk-WL3R2KTS.js";
27
26
  import {
28
27
  getTurnLifecycle
29
- } from "./chunk-STOCCPWH.js";
28
+ } from "./chunk-VC343WHM.js";
30
29
  import {
31
30
  coerceThreadConversationState,
32
31
  configValueSchema,
33
32
  getLocationConfigurationService,
34
33
  getPersistedSandboxState,
35
34
  getPersistedThreadState,
36
- persistThreadStateById
37
- } from "./chunk-CM6RTYSO.js";
35
+ persistThreadStateById,
36
+ resolveTurnSessionRouting
37
+ } from "./chunk-27T5HZHO.js";
38
38
  import {
39
39
  createUserTokenStore,
40
40
  deleteMcpAuthSession,
@@ -44,7 +44,7 @@ import {
44
44
  getMcpStoredOAuthCredentials,
45
45
  lookupSlackUserProfile,
46
46
  resolvePluginOAuthAccount
47
- } from "./chunk-QU3URVWG.js";
47
+ } from "./chunk-BITZUBPJ.js";
48
48
  import {
49
49
  addReactionToMessage,
50
50
  escapeSlackMrkdwnText,
@@ -57,20 +57,20 @@ import {
57
57
  removeReactionFromMessage,
58
58
  resolveBaseUrl,
59
59
  truncateStatusText
60
- } from "./chunk-VQZYIVYN.js";
60
+ } from "./chunk-6FKNNUSN.js";
61
61
  import {
62
62
  parseSlackThreadId,
63
63
  readSlackRawMessageContext,
64
64
  resolveSlackChannelIdFromMessage,
65
65
  resolveSlackChannelIdFromThreadId
66
- } from "./chunk-7EOWT62G.js";
66
+ } from "./chunk-4A2R3AQB.js";
67
67
  import {
68
68
  RetryableDeliveryError
69
- } from "./chunk-INQHUE72.js";
69
+ } from "./chunk-6FGN7ZEG.js";
70
70
  import {
71
71
  ensureConversationWake,
72
72
  requestConversationWork
73
- } from "./chunk-2IBDVE62.js";
73
+ } from "./chunk-NIKLTFBP.js";
74
74
  import {
75
75
  CooperativeTurnYieldError,
76
76
  clearPendingAuth,
@@ -79,7 +79,7 @@ import {
79
79
  isCooperativeTurnYieldError,
80
80
  isPendingAuthLatestRequest,
81
81
  markTurnFailed
82
- } from "./chunk-VOGOTEW7.js";
82
+ } from "./chunk-NU775DLU.js";
83
83
  import {
84
84
  TurnSliceLimitExceededError,
85
85
  abandonTurnRecord,
@@ -99,13 +99,13 @@ import {
99
99
  recordTurnSummary,
100
100
  saveTurnCheckpoint,
101
101
  turnHasReply
102
- } from "./chunk-H7X2G2KS.js";
102
+ } from "./chunk-D5BWM37G.js";
103
103
  import {
104
104
  getVercelConversationWorkQueue
105
105
  } from "./chunk-DKIJ2RP5.js";
106
106
  import {
107
107
  getTurnRequestDeadline
108
- } from "./chunk-BRKB5R7P.js";
108
+ } from "./chunk-JCRXXEMC.js";
109
109
  import {
110
110
  SlackActionError,
111
111
  getDashboardConversationLink,
@@ -114,38 +114,38 @@ import {
114
114
  getSlackClient,
115
115
  isDmChannel,
116
116
  normalizeSlackConversationId
117
- } from "./chunk-JFPY6XFF.js";
117
+ } from "./chunk-DUE4EUNL.js";
118
118
  import {
119
119
  getSqlExecutor,
120
120
  requireSlackDestination,
121
121
  upsertIdentity,
122
122
  upsertLinkedIdentity
123
- } from "./chunk-43LODHJM.js";
123
+ } from "./chunk-WKIS4VRK.js";
124
124
  import {
125
125
  acquireActiveLock,
126
126
  getStateAdapter
127
- } from "./chunk-DOP3FIQC.js";
127
+ } from "./chunk-U6ZQHRIP.js";
128
128
  import {
129
129
  botConfig,
130
130
  escapeXml,
131
131
  getChatConfig,
132
132
  getRuntimeMetadata,
133
133
  normalizeSlackEmojiName
134
- } from "./chunk-AD64YMEC.js";
134
+ } from "./chunk-URZ7UD4P.js";
135
135
  import {
136
136
  defaultModelId
137
137
  } from "./chunk-D4YV5TDV.js";
138
138
  import {
139
139
  discoverSkills
140
- } from "./chunk-HKFLRIBD.js";
140
+ } from "./chunk-Z6OHCDXP.js";
141
141
  import {
142
142
  pluginCatalogRuntime
143
- } from "./chunk-NRMAOGRS.js";
143
+ } from "./chunk-QH3I7ZOK.js";
144
144
  import {
145
145
  buildOAuthTokenRequest,
146
146
  hasRequiredOAuthScope,
147
147
  parseOAuthTokenResponse
148
- } from "./chunk-64WF2GQ3.js";
148
+ } from "./chunk-X5SXFVZT.js";
149
149
  import {
150
150
  createSlackResumeActor,
151
151
  isUserActor,
@@ -164,7 +164,7 @@ import {
164
164
  setTags,
165
165
  toOptionalString,
166
166
  withLogContext
167
- } from "./chunk-3CVEE6LA.js";
167
+ } from "./chunk-6YCIYOVA.js";
168
168
 
169
169
  // src/chat/slack/assistant-thread/status-render.ts
170
170
  var DEFAULT_STATUS_CONTEXTS = {
@@ -2089,6 +2089,7 @@ async function resumeAuthorizedMcpTurn(args) {
2089
2089
  },
2090
2090
  actor,
2091
2091
  destination,
2092
+ ...routing.location ? { location: routing.location } : void 0,
2092
2093
  source: routing.source,
2093
2094
  toolChannelId: authSession.toolChannelId ?? authSession.channelId,
2094
2095
  environment: {
@@ -2754,6 +2755,7 @@ async function resumeOAuthSessionRecordTurn(stored, options) {
2754
2755
  },
2755
2756
  actor,
2756
2757
  destination,
2758
+ ...routing.location ? { location: routing.location } : void 0,
2757
2759
  source: routing.source,
2758
2760
  toolChannelId: stored.channelId,
2759
2761
  environment: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-3CVEE6LA.js";
3
+ } from "./chunk-6YCIYOVA.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-64WF2GQ3.js";
3
+ } from "./chunk-X5SXFVZT.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-7H2VZTWN.js";
7
7
  import {
8
8
  runWithTurnRequestDeadline
9
- } from "./chunk-BRKB5R7P.js";
9
+ } from "./chunk-JCRXXEMC.js";
10
10
  import {
11
11
  logWarn
12
- } from "./chunk-3CVEE6LA.js";
12
+ } from "./chunk-6YCIYOVA.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-IQNBA3RY.js");
132
+ const { processPluginTask } = await import("./task-runner-YSGBPN4U.js");
133
133
  await processPluginTask(message);
134
134
  },
135
135
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -19,23 +19,23 @@ import {
19
19
  releaseConversationWork,
20
20
  requestAnotherSlice,
21
21
  startConversationWork
22
- } from "./chunk-2IBDVE62.js";
22
+ } from "./chunk-NIKLTFBP.js";
23
23
  import {
24
24
  ConversationQueueMessageRejectedError
25
25
  } from "./chunk-JAL3CH4G.js";
26
26
  import {
27
27
  getTurnRequestDeadline
28
- } from "./chunk-BRKB5R7P.js";
28
+ } from "./chunk-JCRXXEMC.js";
29
29
  import {
30
30
  getChatConfig,
31
31
  isProviderRetryError
32
- } from "./chunk-AD64YMEC.js";
32
+ } from "./chunk-URZ7UD4P.js";
33
33
  import {
34
34
  logException,
35
35
  logInfo,
36
36
  logWarn,
37
37
  withLogContext
38
- } from "./chunk-3CVEE6LA.js";
38
+ } from "./chunk-6YCIYOVA.js";
39
39
 
40
40
  // src/chat/task-execution/worker.ts
41
41
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-NRMAOGRS.js";
3
+ } from "./chunk-QH3I7ZOK.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-TXLBLGNQ.js";
10
+ } from "./chunk-WRDW3A3D.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-QU3URVWG.js";
41
+ } from "./chunk-BITZUBPJ.js";
42
42
  import {
43
43
  addReactionToMessage,
44
44
  deliverOAuthAuthorization,
@@ -46,7 +46,7 @@ import {
46
46
  getSlackMessagePermalink,
47
47
  resolveBaseUrl,
48
48
  uploadFilesToConversation
49
- } from "./chunk-VQZYIVYN.js";
49
+ } from "./chunk-6FKNNUSN.js";
50
50
  import {
51
51
  SCHEDULED_TASK_SYSTEM_ACTOR,
52
52
  WORKSPACE_SNAPSHOT_FAILED_EVENT,
@@ -87,10 +87,10 @@ import {
87
87
  workspaceSnapshotFinishedEvent,
88
88
  workspaceSnapshotWatch,
89
89
  writableEventTask
90
- } from "./chunk-DHYZ4VKG.js";
90
+ } from "./chunk-MUPPP7A7.js";
91
91
  import {
92
92
  parseSlackThreadId
93
- } from "./chunk-7EOWT62G.js";
93
+ } from "./chunk-4A2R3AQB.js";
94
94
  import {
95
95
  RetryableDeliveryError,
96
96
  actorFromRun,
@@ -98,7 +98,7 @@ import {
98
98
  isAgentRunFeatureDisabled,
99
99
  surfaceFromRun,
100
100
  toolInvocationDestination
101
- } from "./chunk-INQHUE72.js";
101
+ } from "./chunk-6FGN7ZEG.js";
102
102
  import {
103
103
  CooperativeTurnYieldError,
104
104
  NO_REPLY_MARKER,
@@ -111,7 +111,7 @@ import {
111
111
  isNoReplyMarker,
112
112
  isTurnInputCommitLostError,
113
113
  sanitizeAssistantText
114
- } from "./chunk-VOGOTEW7.js";
114
+ } from "./chunk-NU775DLU.js";
115
115
  import {
116
116
  AGENTS_REMOVAL_NOTICE,
117
117
  AGENTS_REPLACEMENT_NOTICE,
@@ -171,7 +171,7 @@ import {
171
171
  stripRuntimeTurnContext,
172
172
  trimTrailingAssistantMessages,
173
173
  truncateText
174
- } from "./chunk-H7X2G2KS.js";
174
+ } from "./chunk-D5BWM37G.js";
175
175
  import {
176
176
  bindSandboxFileSystem,
177
177
  createSandboxSession,
@@ -182,7 +182,7 @@ import {
182
182
  resolve,
183
183
  setSnapshotSpanAttributes,
184
184
  stopSession
185
- } from "./chunk-CV5CPRVG.js";
185
+ } from "./chunk-D3GDGREI.js";
186
186
  import {
187
187
  privateTraceResultAttributes
188
188
  } from "./chunk-UIE3R5XU.js";
@@ -195,7 +195,7 @@ import {
195
195
  } from "./chunk-DKIJ2RP5.js";
196
196
  import {
197
197
  getTurnRequestDeadline
198
- } from "./chunk-BRKB5R7P.js";
198
+ } from "./chunk-JCRXXEMC.js";
199
199
  import {
200
200
  RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS,
201
201
  RESOURCE_SUBSCRIPTION_MAX_TTL_MS,
@@ -239,19 +239,19 @@ import {
239
239
  updateWorkspace,
240
240
  withSlackRetries,
241
241
  workspaceRepoCheckoutPath
242
- } from "./chunk-JFPY6XFF.js";
242
+ } from "./chunk-DUE4EUNL.js";
243
243
  import {
244
244
  getConversationEventStore,
245
245
  getConversationMessageSearchStore,
246
246
  getConversationStore,
247
247
  getDb,
248
248
  getSqlExecutor
249
- } from "./chunk-43LODHJM.js";
249
+ } from "./chunk-WKIS4VRK.js";
250
250
  import {
251
251
  juniorArtifacts,
252
252
  juniorIdentities,
253
253
  juniorSchedulerRuns
254
- } from "./chunk-VXL2LBPK.js";
254
+ } from "./chunk-HXR3FHTE.js";
255
255
  import {
256
256
  SANDBOX_DATA_ROOT,
257
257
  SANDBOX_REPOS_ROOT,
@@ -282,12 +282,12 @@ import {
282
282
  throwSandboxOperationError,
283
283
  workspaceSnapshotNotReadyUserMessage,
284
284
  wrapSandboxSetupError
285
- } from "./chunk-HWXP6RHG.js";
285
+ } from "./chunk-JZPDYKRG.js";
286
286
  import {
287
287
  fenceLock,
288
288
  getStateAdapter,
289
289
  withLock
290
- } from "./chunk-DOP3FIQC.js";
290
+ } from "./chunk-U6ZQHRIP.js";
291
291
  import {
292
292
  KNOWN_CONVERSATION_EVENT_TYPES,
293
293
  contextProvenance,
@@ -320,7 +320,7 @@ import {
320
320
  resolveGatewayCredential,
321
321
  resolveGatewayModel,
322
322
  unwrapCurrentInstruction
323
- } from "./chunk-AD64YMEC.js";
323
+ } from "./chunk-URZ7UD4P.js";
324
324
  import {
325
325
  ModelProfileNotConfiguredError,
326
326
  TURN_REASONING_LEVELS,
@@ -337,16 +337,16 @@ import {
337
337
  toGenAiMessagesTraceAttributes,
338
338
  toGenAiPayloadMetadata,
339
339
  toGenAiPayloadTraceAttributes
340
- } from "./chunk-FFYDRLXW.js";
340
+ } from "./chunk-Q6OCUQ7W.js";
341
341
  import {
342
342
  discoverSkills,
343
343
  findSkillByName,
344
344
  loadSkillsByName,
345
345
  parseSkillInvocation
346
- } from "./chunk-HKFLRIBD.js";
346
+ } from "./chunk-Z6OHCDXP.js";
347
347
  import {
348
348
  pluginCatalogRuntime
349
- } from "./chunk-NRMAOGRS.js";
349
+ } from "./chunk-QH3I7ZOK.js";
350
350
  import {
351
351
  CredentialUnavailableError,
352
352
  OAuthProviderError,
@@ -354,7 +354,7 @@ import {
354
354
  getOAuthProviderErrorAttributes,
355
355
  resolveAuthTokenPlaceholder,
356
356
  resolvePluginCommandEnv
357
- } from "./chunk-64WF2GQ3.js";
357
+ } from "./chunk-X5SXFVZT.js";
358
358
  import {
359
359
  credentialContextForActor,
360
360
  credentialUserSubjectId
@@ -390,7 +390,7 @@ import {
390
390
  summarizeMessageText,
391
391
  withLogContext,
392
392
  withSpan
393
- } from "./chunk-3CVEE6LA.js";
393
+ } from "./chunk-6YCIYOVA.js";
394
394
  import {
395
395
  startInactiveSpan,
396
396
  withActiveSpan
@@ -888,12 +888,13 @@ function buildTurnResult(input) {
888
888
  const rawPrimaryText = sanitizeAssistantText(
889
889
  terminalAssistantMessages.map((message) => extractAssistantText(message)).join("\n\n")
890
890
  ).trim();
891
- const exactNoReplyMarker = isNoReplyMarker(rawPrimaryText);
892
- const mixedNoReplyMarker = !exactNoReplyMarker && containsNoReplyMarker(rawPrimaryText);
893
- const noReplyRequested = exactNoReplyMarker || mixedNoReplyMarker;
894
- const primaryText = noReplyRequested ? "" : terminalAssistantMessages.map((message) => decideReply(message)).filter(
891
+ const primaryText = terminalAssistantMessages.map((message) => decideReply(message)).filter(
895
892
  (output) => output.kind === "deliver"
896
893
  ).map((output) => output.text).join("\n\n");
894
+ const terminalTexts = terminalAssistantMessages.map(
895
+ (message) => sanitizeAssistantText(extractAssistantText(message))
896
+ );
897
+ const noReplyRequested = !primaryText && terminalTexts.some((text) => isNoReplyMarker(text)) && terminalTexts.every((text) => !text || isNoReplyMarker(text));
897
898
  const toolErrorCount = toolResults.filter((result) => result.isError).length;
898
899
  const reactionPerformed = toolResults.some(
899
900
  (result) => !isToolResultError(result) && normalizeToolNameFromResult(result) === "addReaction"
@@ -903,7 +904,7 @@ function buildTurnResult(input) {
903
904
  const stopReason = typeof lastAssistant?.stopReason === "string" ? lastAssistant.stopReason : void 0;
904
905
  const errorMessage = typeof lastAssistant?.errorMessage === "string" ? lastAssistant.errorMessage : void 0;
905
906
  const isProviderError = stopReason === "error";
906
- if (exactNoReplyMarker) {
907
+ if (noReplyRequested) {
907
908
  const markerCategory = reactionPerformed ? "reaction" : "none";
908
909
  const markerAttributes = {
909
910
  "app.ai.no_reply_marker": true,
@@ -913,7 +914,7 @@ function buildTurnResult(input) {
913
914
  if (!isProviderError) {
914
915
  logInfo("ai.no_reply_marker.accepted", markerAttributes);
915
916
  }
916
- } else if (mixedNoReplyMarker) {
917
+ } else if (containsNoReplyMarker(rawPrimaryText)) {
917
918
  logWarn("ai.no_reply_marker.mixed_text", {
918
919
  "app.ai.no_reply_marker": true,
919
920
  "app.ai.no_reply_marker_mode": "mixed"
@@ -17389,9 +17390,6 @@ async function wireAgentTools(args) {
17389
17390
  const runSource = args.run.source;
17390
17391
  const credentialUserId = args.run.credentialContext ? credentialUserSubjectId(args.run.credentialContext) : void 0;
17391
17392
  const userTokenStore = createUserTokenStore();
17392
- const conversation = await getConversationStore().get({
17393
- conversationId: args.run.conversationId
17394
- });
17395
17393
  const pluginHooks = createPluginHookRunner({
17396
17394
  actor: args.currentActor,
17397
17395
  actors: args.currentActors
@@ -17478,7 +17476,7 @@ async function wireAgentTools(args) {
17478
17476
  );
17479
17477
  const commonToolRuntimeContext = {
17480
17478
  conversationId: args.run.conversationId,
17481
- ...conversation?.location ? { locationId: conversation.location.id } : void 0,
17479
+ ...args.run.location ? { locationId: args.run.location.id } : void 0,
17482
17480
  userText: args.userInput,
17483
17481
  configuration: args.configurationValues,
17484
17482
  egress: createPluginEgress({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-AD64YMEC.js";
3
+ } from "./chunk-URZ7UD4P.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -7,7 +7,7 @@ import {
7
7
  toCanonicalInputMessage,
8
8
  toCanonicalOutputMessage,
9
9
  toGenAiMessagesTraceAttributes
10
- } from "./chunk-FFYDRLXW.js";
10
+ } from "./chunk-Q6OCUQ7W.js";
11
11
  import {
12
12
  extractGenAiUsageAttributes,
13
13
  logException,
@@ -15,7 +15,7 @@ import {
15
15
  normalizeGenAiFinishReason,
16
16
  serializeGenAiAttribute,
17
17
  withSpan
18
- } from "./chunk-3CVEE6LA.js";
18
+ } from "./chunk-6YCIYOVA.js";
19
19
 
20
20
  // src/chat/services/provider-error.ts
21
21
  var ProviderError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConversationEventStore
3
- } from "./chunk-43LODHJM.js";
3
+ } from "./chunk-WKIS4VRK.js";
4
4
 
5
5
  // src/chat/conversations/turn-lifecycle.ts
6
6
  var ConversationTurnLifecycleService = class {
@@ -8,7 +8,7 @@ import {
8
8
  juniorConversations,
9
9
  juniorIdentities,
10
10
  juniorUsers
11
- } from "./chunk-VXL2LBPK.js";
11
+ } from "./chunk-HXR3FHTE.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-AD64YMEC.js";
23
+ } from "./chunk-URZ7UD4P.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-3CVEE6LA.js";
31
+ } from "./chunk-6YCIYOVA.js";
32
32
 
33
33
  // src/chat/conversations/sql/store.ts
34
34
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
- getPersistedThreadState
4
- } from "./chunk-CM6RTYSO.js";
3
+ getPersistedThreadState,
4
+ resolveTurnSessionRouting
5
+ } from "./chunk-27T5HZHO.js";
5
6
  import {
6
7
  pluginTaskId,
7
8
  pluginTaskParamsSchema,
8
9
  sendVercelPluginTask
9
- } from "./chunk-ACGWTJ74.js";
10
+ } from "./chunk-STF4GSK4.js";
10
11
  import {
11
12
  getPiMessageRole,
12
13
  getTurnRecord,
@@ -16,7 +17,7 @@ import {
16
17
  isToolResultMessage,
17
18
  normalizeToolNameFromResult,
18
19
  stripRuntimeTurnContext
19
- } from "./chunk-H7X2G2KS.js";
20
+ } from "./chunk-D5BWM37G.js";
20
21
  import {
21
22
  createPluginConversationEvents,
22
23
  createPluginEmbedder,
@@ -25,21 +26,21 @@ import {
25
26
  createPluginState,
26
27
  getPlugins,
27
28
  readActorIdentity
28
- } from "./chunk-JFPY6XFF.js";
29
+ } from "./chunk-DUE4EUNL.js";
29
30
  import {
30
31
  JUNIOR_THREAD_STATE_TTL_MS
31
32
  } from "./chunk-3Y47VMHV.js";
32
33
  import {
33
34
  getConversationStore,
34
35
  getDb
35
- } from "./chunk-43LODHJM.js";
36
+ } from "./chunk-WKIS4VRK.js";
36
37
  import {
37
38
  juniorConversations,
38
39
  juniorTaskExecutions
39
- } from "./chunk-VXL2LBPK.js";
40
+ } from "./chunk-HXR3FHTE.js";
40
41
  import {
41
42
  getStateAdapter
42
- } from "./chunk-DOP3FIQC.js";
43
+ } from "./chunk-U6ZQHRIP.js";
43
44
  import {
44
45
  sameActorIdentity
45
46
  } from "./chunk-GFBR4S3Q.js";
@@ -51,88 +52,11 @@ import {
51
52
  } from "./chunk-N7TMSOZH.js";
52
53
  import {
53
54
  logWarn
54
- } from "./chunk-3CVEE6LA.js";
55
+ } from "./chunk-6YCIYOVA.js";
55
56
 
56
57
  // src/chat/plugins/task-runner.ts
57
58
  import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
58
59
 
59
- // src/chat/services/turn-session-routing.ts
60
- async function loadConversationChain(conversationId, conversationStore) {
61
- const chain = [];
62
- const seen = /* @__PURE__ */ new Set();
63
- let cursor = conversationId;
64
- while (cursor && !seen.has(cursor)) {
65
- seen.add(cursor);
66
- const conversation = await conversationStore.get({ conversationId: cursor });
67
- if (!conversation) {
68
- break;
69
- }
70
- chain.push(conversation);
71
- cursor = conversation.lineage?.parentConversationId;
72
- }
73
- return chain;
74
- }
75
- function slackSourceForDestination(args) {
76
- if (args.source?.platform !== "slack" || args.source.channelId !== args.destination.channelId) {
77
- return void 0;
78
- }
79
- const threadTs = args.source.threadTs?.trim();
80
- return {
81
- platform: "slack",
82
- visibility: args.source.visibility ?? "public",
83
- teamId: args.source.teamId?.trim() || args.destination.teamId,
84
- channelId: args.source.channelId,
85
- ...threadTs ? { threadTs } : void 0
86
- };
87
- }
88
- async function resolveConversationRouting(args) {
89
- const conversationStore = args.conversationStore ?? (await import("./db-7XL4UPAE.js")).getConversationStore();
90
- const chain = await loadConversationChain(
91
- args.conversationId,
92
- conversationStore
93
- );
94
- let destination;
95
- let source;
96
- let locationId;
97
- for (const conversation of chain) {
98
- destination ??= conversation.destination;
99
- source ??= conversation.sessionSource;
100
- locationId ??= conversation.location?.id;
101
- if (destination && source) {
102
- break;
103
- }
104
- }
105
- if (!destination) {
106
- return void 0;
107
- }
108
- if (destination.platform === "slack") {
109
- const slackSource = slackSourceForDestination({ destination, source });
110
- return {
111
- destination,
112
- ...locationId ? { locationId } : void 0,
113
- ...slackSource ? { source: slackSource } : void 0
114
- };
115
- }
116
- return {
117
- destination,
118
- ...locationId ? { locationId } : void 0,
119
- ...source ? { source } : void 0
120
- };
121
- }
122
- async function resolveTurnSessionRouting(args) {
123
- const routing = await resolveConversationRouting(args);
124
- if (!routing?.destination || !routing.source) {
125
- throw new Error(
126
- `Conversation ${args.conversationId} is missing durable routing metadata`
127
- );
128
- }
129
- return {
130
- destination: routing.destination,
131
- source: routing.source,
132
- ...routing.locationId ? { locationId: routing.locationId } : void 0
133
- };
134
- }
135
-
136
60
  // src/chat/agent-dispatch/store.ts
137
61
  import { createHash } from "crypto";
138
62
  import {
@@ -969,7 +893,7 @@ async function loadPluginRun(params) {
969
893
  completedAtMs: record.updatedAtMs,
970
894
  conversationId: record.conversationId,
971
895
  destination: routing.destination,
972
- ...routing.locationId ? { locationId: routing.locationId } : void 0,
896
+ ...routing.location ? { locationId: routing.location.id } : void 0,
973
897
  // Read Actors from the full run record, not the shorter transcript.
974
898
  // This includes every Actor that supplied an instruction.
975
899
  actors: record.actors,
@@ -1082,8 +1006,6 @@ export {
1082
1006
  listPendingDispatchMailboxAppends,
1083
1007
  claimDispatchMailboxAppend,
1084
1008
  getPluginDispatchProjection,
1085
- resolveConversationRouting,
1086
- resolveTurnSessionRouting,
1087
1009
  scheduleSessionCompletedPluginTasks,
1088
1010
  processPluginTask
1089
1011
  };