@sentry/junior 0.151.0 → 0.152.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 (63) hide show
  1. package/dist/{agent-hooks-EYUAEBMA.js → agent-hooks-U66Q3X2P.js} +10 -10
  2. package/dist/api/schema/conversation.d.ts +11 -0
  3. package/dist/api/schema.d.ts +1 -1
  4. package/dist/api/schema.js +3 -1
  5. package/dist/api.js +40 -25
  6. package/dist/app.js +38 -38
  7. package/dist/{catalog-runtime-2LCLLOBI.js → catalog-runtime-CVCR7SND.js} +5 -5
  8. package/dist/chat/api-turns/authorization.d.ts +23 -0
  9. package/dist/{chunk-JIJOPRD4.js → chunk-3PCKG4BT.js} +4 -4
  10. package/dist/{chunk-OYRFUQOV.js → chunk-3UJ3QYRV.js} +59 -12
  11. package/dist/{chunk-3WOK4ZLX.js → chunk-5LDOQV7Y.js} +18 -18
  12. package/dist/{chunk-EMB4VY7H.js → chunk-67VR4BJK.js} +5 -5
  13. package/dist/{chunk-PWMVR2MD.js → chunk-732P2RBQ.js} +1 -1
  14. package/dist/{chunk-OAPPJ3TM.js → chunk-7TZM33YX.js} +1 -1
  15. package/dist/{chunk-6A46QL4O.js → chunk-AYPU5T5L.js} +4 -4
  16. package/dist/{chunk-2MGJ64SL.js → chunk-CLX3T7Q3.js} +1 -1
  17. package/dist/{chunk-WVXFEQXE.js → chunk-ELAVLP7Z.js} +1 -1
  18. package/dist/{chunk-CL5DT6D2.js → chunk-ETXLHT3S.js} +4 -4
  19. package/dist/{chunk-J5LAA2LI.js → chunk-I4LR7MS2.js} +45 -11
  20. package/dist/{chunk-PQUV3NA5.js → chunk-KC47ZY6Q.js} +2 -2
  21. package/dist/{chunk-JSKTDBSS.js → chunk-KC5XZBRB.js} +4 -4
  22. package/dist/{chunk-AGSUPAD5.js → chunk-KTYC3GDO.js} +3 -3
  23. package/dist/{chunk-6WNWM5JD.js → chunk-KW2MGCW5.js} +5 -5
  24. package/dist/{chunk-C7D2ONB5.js → chunk-LETPYIDF.js} +1 -1
  25. package/dist/{chunk-DJAOSWB6.js → chunk-M6PWM3OK.js} +1 -1
  26. package/dist/{chunk-OFRJXFTH.js → chunk-N2472SQK.js} +8 -8
  27. package/dist/{chunk-QVQBWWXQ.js → chunk-NF733C66.js} +6 -6
  28. package/dist/{chunk-D22FO4LW.js → chunk-OEECXAGT.js} +2 -2
  29. package/dist/{chunk-M6KRPBXC.js → chunk-QKPIW2CY.js} +6 -6
  30. package/dist/{chunk-UDDCHQN2.js → chunk-RCBAXKMB.js} +1 -1
  31. package/dist/{chunk-ZGSL5ARH.js → chunk-SDMVFTH4.js} +141 -66
  32. package/dist/chunk-SFYDSI34.js +89 -0
  33. package/dist/{chunk-B7KWBJAR.js → chunk-TSQMITMQ.js} +6 -6
  34. package/dist/{chunk-KPQBQRNM.js → chunk-UFKSILED.js} +5 -5
  35. package/dist/{chunk-XN3QKNQX.js → chunk-UG5UCHHJ.js} +7 -0
  36. package/dist/{chunk-6PGJPCN2.js → chunk-VD6CRYCT.js} +1 -1
  37. package/dist/{chunk-6DLWRSGV.js → chunk-WZN4RQ64.js} +1 -1
  38. package/dist/{chunk-5N3XLYBW.js → chunk-X4RM4TBW.js} +1 -1
  39. package/dist/{chunk-YN4W5SRJ.js → chunk-X6JP6AMX.js} +1 -1
  40. package/dist/{chunk-K3QXMZDU.js → chunk-XTLF7C4I.js} +3 -3
  41. package/dist/{chunk-H7ZMEHAN.js → chunk-Z5WLTGME.js} +1 -1
  42. package/dist/cli/chat.js +30 -30
  43. package/dist/cli/check.js +6 -6
  44. package/dist/cli/plugins.js +13 -13
  45. package/dist/cli/snapshot-create.js +9 -9
  46. package/dist/cli/upgrade.js +7 -7
  47. package/dist/{db-ALCBI4JZ.js → db-HQAZQASY.js} +7 -7
  48. package/dist/handlers/mcp-oauth-callback.d.ts +3 -0
  49. package/dist/handlers/oauth-callback.d.ts +3 -0
  50. package/dist/instrumentation.js +4 -4
  51. package/dist/nitro.js +2 -2
  52. package/dist/{oauth-callback-server-3RRMG62B.js → oauth-callback-server-OJONZ7T3.js} +23 -24
  53. package/dist/{runner-V6C3EELU.js → runner-BIJAVQDX.js} +14 -16
  54. package/dist/{skills-43PFYZIZ.js → skills-SIPNY4AT.js} +6 -6
  55. package/dist/spawn-ABDIBQT6.js +38 -0
  56. package/dist/{validation-4MNN6QKE.js → validation-KRPOY5RQ.js} +6 -6
  57. package/dist/version.js +1 -1
  58. package/dist/{work-YZO6XTEB.js → work-KS3JOEI2.js} +17 -17
  59. package/dist/{worker-42AR7323.js → worker-CZ5KNZUI.js} +11 -11
  60. package/package.json +5 -5
  61. package/dist/chunk-4ABTAQYC.js +0 -48
  62. package/dist/chunk-4CODA7P5.js +0 -43
  63. package/dist/spawn-UZNNTNFU.js +0 -38
@@ -1,28 +1,34 @@
1
+ import {
2
+ createWebAuthorization,
3
+ deleteWebAuthorization
4
+ } from "./chunk-SFYDSI34.js";
1
5
  import {
2
6
  appendAndEnqueueInboundMessage
3
- } from "./chunk-6A46QL4O.js";
7
+ } from "./chunk-AYPU5T5L.js";
4
8
  import {
5
9
  buildDeliveredTurnStatePatch,
10
+ completeAuthPauseTurn,
6
11
  finalizeFailedTurnReplyWithEvent,
7
12
  getTurnUserMessage,
8
13
  processPluginTask,
9
14
  scheduleSessionCompletedPluginTasks
10
- } from "./chunk-J5LAA2LI.js";
15
+ } from "./chunk-I4LR7MS2.js";
11
16
  import {
12
17
  ConversationTurnLifecycleService,
13
18
  coerceThreadConversationState,
14
19
  getPersistedSandboxState,
15
20
  getPersistedThreadState,
16
21
  persistThreadStateById
17
- } from "./chunk-EMB4VY7H.js";
22
+ } from "./chunk-67VR4BJK.js";
18
23
  import {
19
24
  healthReportSchema
20
25
  } from "./chunk-UTL3MHPC.js";
21
26
  import {
22
27
  parseSlackThreadId
23
- } from "./chunk-UDDCHQN2.js";
28
+ } from "./chunk-RCBAXKMB.js";
24
29
  import {
25
30
  TurnInputCommitLostError,
31
+ abandonTurnRecord,
26
32
  buildConversationContext,
27
33
  buildDeterministicTurnId,
28
34
  getAssistantReplyText,
@@ -33,6 +39,7 @@ import {
33
39
  listTurnSummaries,
34
40
  loadProjection,
35
41
  markConversationMessage,
42
+ markTurnClosed,
36
43
  markTurnFailed,
37
44
  normalizeConversationText,
38
45
  persistConversationMessages,
@@ -41,17 +48,17 @@ import {
41
48
  saveTurnCheckpoint,
42
49
  startActiveTurn,
43
50
  upsertConversationMessage
44
- } from "./chunk-JIJOPRD4.js";
51
+ } from "./chunk-3PCKG4BT.js";
45
52
  import {
46
53
  normalizeSlackConversationId
47
- } from "./chunk-AGSUPAD5.js";
54
+ } from "./chunk-KTYC3GDO.js";
48
55
  import {
49
56
  getConversationEventStore,
50
57
  getConversationStore
51
- } from "./chunk-K3QXMZDU.js";
58
+ } from "./chunk-XTLF7C4I.js";
52
59
  import {
53
60
  getSlackBotToken
54
- } from "./chunk-D22FO4LW.js";
61
+ } from "./chunk-OEECXAGT.js";
55
62
  import {
56
63
  credentialContextForActor
57
64
  } from "./chunk-RUIXF3YQ.js";
@@ -60,7 +67,7 @@ import {
60
67
  logWarn,
61
68
  setTags,
62
69
  withLogContext
63
- } from "./chunk-OAPPJ3TM.js";
70
+ } from "./chunk-7TZM33YX.js";
64
71
 
65
72
  // src/handlers/health.ts
66
73
  function readHealthReport() {
@@ -527,6 +534,27 @@ function createApiTurnWorker(options) {
527
534
  startedAtMs = userMessage.createdAtMs;
528
535
  inputMessageIds = [userMessageId];
529
536
  } else {
537
+ const authParked = (await listTurnSummaries(context.conversationId)).filter(
538
+ (summary) => summary.surface === "api" && !summary.dispatchId && summary.state === "paused" && summary.resumeReason === "auth"
539
+ );
540
+ for (const parked of authParked) {
541
+ await abandonTurnRecord({
542
+ conversationId: context.conversationId,
543
+ turnId: parked.turnId,
544
+ errorMessage: "Auth-parked session superseded by a new user message"
545
+ });
546
+ markTurnClosed({
547
+ conversation,
548
+ nowMs: Date.now(),
549
+ sessionId: parked.turnId
550
+ });
551
+ }
552
+ if (authParked.length > 0) {
553
+ await deleteWebAuthorization({
554
+ actorId: actor.userId,
555
+ conversationId: context.conversationId
556
+ });
557
+ }
530
558
  upsertConversationMessage(conversation, {
531
559
  id: userMessageId,
532
560
  role: "user",
@@ -624,7 +652,10 @@ function createApiTurnWorker(options) {
624
652
  publishExternally: false,
625
653
  source,
626
654
  surface: "api",
627
- disabledFeatures: ["interactive-auth"],
655
+ authorization: createWebAuthorization({
656
+ actorId: actor.userId,
657
+ conversationId: context.conversationId
658
+ }),
628
659
  state: {
629
660
  pendingAuth: conversation.processing.pendingAuth,
630
661
  sandboxRef
@@ -639,14 +670,30 @@ function createApiTurnWorker(options) {
639
670
  conversation,
640
671
  sandboxRef
641
672
  });
673
+ },
674
+ recordPendingAuth: async (pendingAuth) => {
675
+ conversation.processing.pendingAuth = pendingAuth;
676
+ await persistThreadStateById(context.conversationId, {
677
+ conversation,
678
+ sandboxRef
679
+ });
642
680
  }
643
681
  }
644
682
  });
645
683
  if (outcome.status === "suspended") {
646
684
  return { status: "yielded" };
647
685
  }
648
- if (outcome.status !== "completed") {
649
- throw new Error(`API agent run ended with ${outcome.status}`);
686
+ if (outcome.status === "awaiting_auth") {
687
+ completeAuthPauseTurn({
688
+ conversation,
689
+ sessionId: turnId
690
+ });
691
+ await persistThreadStateById(context.conversationId, {
692
+ conversation,
693
+ sandboxRef
694
+ });
695
+ await acknowledge();
696
+ return { status: "completed" };
650
697
  }
651
698
  reply = outcome.result;
652
699
  modelFailureCaptureAttempted = reply.diagnostics.outcome !== "success";
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-KPQBQRNM.js";
10
+ } from "./chunk-UFKSILED.js";
11
11
  import {
12
12
  authorizationId
13
13
  } from "./chunk-DIB4GX3G.js";
@@ -32,7 +32,7 @@ import {
32
32
  searchSlackUsers,
33
33
  selectPluginGrant,
34
34
  toMcpProviderError
35
- } from "./chunk-OFRJXFTH.js";
35
+ } from "./chunk-N2472SQK.js";
36
36
  import {
37
37
  RetryableDeliveryError,
38
38
  actorFromRun,
@@ -48,7 +48,7 @@ import {
48
48
  getSlackMessagePermalink,
49
49
  resolveBaseUrl,
50
50
  uploadFilesToConversation
51
- } from "./chunk-M6KRPBXC.js";
51
+ } from "./chunk-QKPIW2CY.js";
52
52
  import {
53
53
  parseSandboxEgressAuthRequiredSignal,
54
54
  parseSandboxEgressPermissionDeniedSignal,
@@ -77,7 +77,7 @@ import {
77
77
  runNonInteractiveCommand,
78
78
  throwSandboxOperationError,
79
79
  wrapSandboxSetupError
80
- } from "./chunk-JSKTDBSS.js";
80
+ } from "./chunk-KC5XZBRB.js";
81
81
  import {
82
82
  SCHEDULED_TASK_SYSTEM_ACTOR,
83
83
  compactEventTask,
@@ -109,10 +109,10 @@ import {
109
109
  saveEventTask,
110
110
  scheduledTaskAttributes,
111
111
  writableEventTask
112
- } from "./chunk-6WNWM5JD.js";
112
+ } from "./chunk-KW2MGCW5.js";
113
113
  import {
114
114
  parseSlackThreadId
115
- } from "./chunk-UDDCHQN2.js";
115
+ } from "./chunk-RCBAXKMB.js";
116
116
  import {
117
117
  AGENTS_REMOVAL_NOTICE,
118
118
  AGENTS_REPLACEMENT_NOTICE,
@@ -182,7 +182,7 @@ import {
182
182
  stripRuntimeTurnContext,
183
183
  trimTrailingAssistantMessages,
184
184
  truncateText
185
- } from "./chunk-JIJOPRD4.js";
185
+ } from "./chunk-3PCKG4BT.js";
186
186
  import {
187
187
  JUNIOR_THREAD_STATE_TTL_MS
188
188
  } from "./chunk-3Y47VMHV.js";
@@ -198,7 +198,7 @@ import {
198
198
  getSlackToolContext,
199
199
  readActorIdentity,
200
200
  resolveChannelCapabilities
201
- } from "./chunk-QVQBWWXQ.js";
201
+ } from "./chunk-NF733C66.js";
202
202
  import {
203
203
  SlackActionError,
204
204
  downloadPrivateSlackFile,
@@ -207,7 +207,7 @@ import {
207
207
  isConversationScopedChannel,
208
208
  normalizeSlackConversationId,
209
209
  withSlackRetries
210
- } from "./chunk-AGSUPAD5.js";
210
+ } from "./chunk-KTYC3GDO.js";
211
211
  import {
212
212
  KNOWN_CONVERSATION_EVENT_TYPES,
213
213
  contextProvenance,
@@ -219,10 +219,10 @@ import {
219
219
  instructionActors,
220
220
  instructionProvenanceFor,
221
221
  sameActorIdentity
222
- } from "./chunk-K3QXMZDU.js";
222
+ } from "./chunk-XTLF7C4I.js";
223
223
  import {
224
224
  juniorIdentities
225
- } from "./chunk-5N3XLYBW.js";
225
+ } from "./chunk-X4RM4TBW.js";
226
226
  import {
227
227
  SANDBOX_DATA_ROOT,
228
228
  SANDBOX_SKILLS_ROOT,
@@ -234,7 +234,7 @@ import {
234
234
  } from "./chunk-EM225ITJ.js";
235
235
  import {
236
236
  getStateAdapter
237
- } from "./chunk-YN4W5SRJ.js";
237
+ } from "./chunk-X6JP6AMX.js";
238
238
  import {
239
239
  ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
240
240
  COMPACTION_SUMMARY_PREFIX,
@@ -267,7 +267,7 @@ import {
267
267
  resolveGatewayCredential,
268
268
  resolveGatewayModel,
269
269
  unwrapCurrentInstruction
270
- } from "./chunk-D22FO4LW.js";
270
+ } from "./chunk-OEECXAGT.js";
271
271
  import {
272
272
  canExposeConversationPayload,
273
273
  resolveConversationPrivacy,
@@ -277,16 +277,16 @@ import {
277
277
  toGenAiMessagesTraceAttributes,
278
278
  toGenAiPayloadMetadata,
279
279
  toGenAiPayloadTraceAttributes
280
- } from "./chunk-PWMVR2MD.js";
280
+ } from "./chunk-732P2RBQ.js";
281
281
  import {
282
282
  discoverSkills,
283
283
  findSkillByName,
284
284
  loadSkillsByName,
285
285
  parseSkillInvocation
286
- } from "./chunk-PQUV3NA5.js";
286
+ } from "./chunk-KC47ZY6Q.js";
287
287
  import {
288
288
  pluginCatalogRuntime
289
- } from "./chunk-6DLWRSGV.js";
289
+ } from "./chunk-WZN4RQ64.js";
290
290
  import {
291
291
  CredentialUnavailableError,
292
292
  OAuthProviderError,
@@ -294,7 +294,7 @@ import {
294
294
  getOAuthProviderErrorAttributes,
295
295
  resolveAuthTokenPlaceholder,
296
296
  resolvePluginCommandEnv
297
- } from "./chunk-2MGJ64SL.js";
297
+ } from "./chunk-CLX3T7Q3.js";
298
298
  import {
299
299
  credentialUserSubjectId
300
300
  } from "./chunk-RUIXF3YQ.js";
@@ -324,7 +324,7 @@ import {
324
324
  summarizeMessageText,
325
325
  withLogContext,
326
326
  withSpan
327
- } from "./chunk-OAPPJ3TM.js";
327
+ } from "./chunk-7TZM33YX.js";
328
328
  import {
329
329
  startInactiveSpan,
330
330
  withActiveSpan
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-JIJOPRD4.js";
3
+ } from "./chunk-3PCKG4BT.js";
4
4
  import {
5
5
  JUNIOR_THREAD_STATE_TTL_MS
6
6
  } from "./chunk-3Y47VMHV.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-K3QXMZDU.js";
9
+ } from "./chunk-XTLF7C4I.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-5N3XLYBW.js";
12
+ } from "./chunk-X4RM4TBW.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-YN4W5SRJ.js";
15
+ } from "./chunk-X6JP6AMX.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -20,7 +20,7 @@ import {
20
20
  isRecord,
21
21
  toOptionalNumber,
22
22
  toOptionalString
23
- } from "./chunk-OAPPJ3TM.js";
23
+ } from "./chunk-7TZM33YX.js";
24
24
 
25
25
  // src/chat/conversations/turn-lifecycle.ts
26
26
  var ConversationTurnLifecycleService = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-OAPPJ3TM.js";
3
+ } from "./chunk-7TZM33YX.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6GWA276C.js";
10
10
  import {
11
11
  getDeploymentTelemetryAttributes
12
- } from "./chunk-DJAOSWB6.js";
12
+ } from "./chunk-M6PWM3OK.js";
13
13
 
14
14
  // src/chat/logging.ts
15
15
  import path from "path";
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-K3QXMZDU.js";
11
+ } from "./chunk-XTLF7C4I.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-YN4W5SRJ.js";
15
+ } from "./chunk-X6JP6AMX.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-D22FO4LW.js";
18
+ } from "./chunk-OEECXAGT.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-HZF5P5UN.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-OAPPJ3TM.js";
26
+ } from "./chunk-7TZM33YX.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-OAPPJ3TM.js";
8
+ } from "./chunk-7TZM33YX.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.151.0",
4
+ version: "0.152.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-H7ZMEHAN.js";
3
+ } from "./chunk-Z5WLTGME.js";
4
4
  import {
5
5
  CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
6
6
  CONVERSATION_WORK_MAX_RETRIES,
@@ -21,20 +21,20 @@ import {
21
21
  releaseConversationWork,
22
22
  requestAnotherSlice,
23
23
  startConversationWork
24
- } from "./chunk-6A46QL4O.js";
24
+ } from "./chunk-AYPU5T5L.js";
25
25
  import {
26
26
  ConversationQueueMessageRejectedError
27
27
  } from "./chunk-JAL3CH4G.js";
28
28
  import {
29
29
  getChatConfig,
30
30
  isProviderRetryError
31
- } from "./chunk-D22FO4LW.js";
31
+ } from "./chunk-OEECXAGT.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-OAPPJ3TM.js";
37
+ } from "./chunk-7TZM33YX.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
- getPersistedThreadState
4
- } from "./chunk-EMB4VY7H.js";
3
+ getPersistedThreadState,
4
+ persistThreadStateById
5
+ } from "./chunk-67VR4BJK.js";
5
6
  import {
6
7
  pluginTaskId,
7
8
  pluginTaskParamsSchema,
@@ -17,10 +18,11 @@ import {
17
18
  isToolResultError,
18
19
  isToolResultMessage,
19
20
  markConversationMessage,
21
+ markTurnClosed,
20
22
  markTurnCompleted,
21
23
  normalizeToolNameFromResult,
22
24
  stripRuntimeTurnContext
23
- } from "./chunk-JIJOPRD4.js";
25
+ } from "./chunk-3PCKG4BT.js";
24
26
  import {
25
27
  JUNIOR_THREAD_STATE_TTL_MS
26
28
  } from "./chunk-3Y47VMHV.js";
@@ -31,25 +33,25 @@ import {
31
33
  createPluginModel,
32
34
  createPluginState,
33
35
  getPlugins
34
- } from "./chunk-QVQBWWXQ.js";
36
+ } from "./chunk-NF733C66.js";
35
37
  import {
36
38
  getConversationStore,
37
39
  getDb,
38
40
  sameActorIdentity
39
- } from "./chunk-K3QXMZDU.js";
41
+ } from "./chunk-XTLF7C4I.js";
40
42
  import {
41
43
  juniorConversations,
42
44
  juniorTaskExecutions
43
- } from "./chunk-5N3XLYBW.js";
45
+ } from "./chunk-X4RM4TBW.js";
44
46
  import {
45
47
  getStateAdapter
46
- } from "./chunk-YN4W5SRJ.js";
48
+ } from "./chunk-X6JP6AMX.js";
47
49
  import {
48
50
  ProviderError,
49
51
  findProviderError,
50
52
  getProviderErrorAttributes,
51
53
  getProviderErrorUserMessage
52
- } from "./chunk-D22FO4LW.js";
54
+ } from "./chunk-OEECXAGT.js";
53
55
  import {
54
56
  credentialSubjectSchema
55
57
  } from "./chunk-RUIXF3YQ.js";
@@ -59,7 +61,7 @@ import {
59
61
  import {
60
62
  buildTurnFailureResponse,
61
63
  logWarn
62
- } from "./chunk-OAPPJ3TM.js";
64
+ } from "./chunk-7TZM33YX.js";
63
65
 
64
66
  // src/chat/runtime/delivered-turn-state.ts
65
67
  function buildDeliveredTurnStatePatch(args) {
@@ -85,7 +87,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
85
87
 
86
88
  // src/chat/services/turn-session-routing.ts
87
89
  async function resolveTurnSessionRouting(args) {
88
- const conversationStore = args.conversationStore ?? (await import("./db-ALCBI4JZ.js")).getConversationStore();
90
+ const conversationStore = args.conversationStore ?? (await import("./db-HQAZQASY.js")).getConversationStore();
89
91
  const conversation = await conversationStore.get({
90
92
  conversationId: args.conversationId
91
93
  });
@@ -1183,6 +1185,36 @@ function getTurnUserReplyAttachmentContext(message) {
1183
1185
  };
1184
1186
  }
1185
1187
 
1188
+ // src/chat/runtime/auth-pause-state.ts
1189
+ function completeAuthPauseTurn(args) {
1190
+ markConversationMessage(
1191
+ args.conversation,
1192
+ getTurnUserMessageId(args.conversation, args.sessionId),
1193
+ {
1194
+ replied: true,
1195
+ skippedReason: void 0
1196
+ }
1197
+ );
1198
+ markTurnClosed({
1199
+ conversation: args.conversation,
1200
+ nowMs: Date.now(),
1201
+ sessionId: args.sessionId
1202
+ });
1203
+ }
1204
+ async function persistAuthPauseTurnState(args) {
1205
+ const currentState = await getPersistedThreadState(args.threadStateId);
1206
+ const conversation = coerceThreadConversationState(currentState);
1207
+ await hydrateConversationMessages({
1208
+ conversation,
1209
+ conversationId: args.threadStateId
1210
+ });
1211
+ completeAuthPauseTurn({
1212
+ conversation,
1213
+ sessionId: args.sessionId
1214
+ });
1215
+ await persistThreadStateById(args.threadStateId, { conversation });
1216
+ }
1217
+
1186
1218
  export {
1187
1219
  recordTaskExecution,
1188
1220
  readTaskExecutionSummaries,
@@ -1218,5 +1250,7 @@ export {
1218
1250
  getInterruptionMarker,
1219
1251
  requireTurnFailureEventId,
1220
1252
  getAgentTurnDiagnosticsAttributes,
1221
- finalizeFailedTurnReplyWithEvent
1253
+ finalizeFailedTurnReplyWithEvent,
1254
+ completeAuthPauseTurn,
1255
+ persistAuthPauseTurnState
1222
1256
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-6DLWRSGV.js";
3
+ } from "./chunk-WZN4RQ64.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-OAPPJ3TM.js";
6
+ } from "./chunk-7TZM33YX.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -4,18 +4,18 @@ import {
4
4
  } from "./chunk-EM225ITJ.js";
5
5
  import {
6
6
  getStateAdapter
7
- } from "./chunk-YN4W5SRJ.js";
7
+ } from "./chunk-X6JP6AMX.js";
8
8
  import {
9
9
  toOptionalTrimmed
10
- } from "./chunk-D22FO4LW.js";
10
+ } from "./chunk-OEECXAGT.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "./chunk-6DLWRSGV.js";
13
+ } from "./chunk-WZN4RQ64.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-OAPPJ3TM.js";
18
+ } from "./chunk-7TZM33YX.js";
19
19
 
20
20
  // src/chat/sandbox/resources.ts
21
21
  var configuredResources;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-D22FO4LW.js";
6
+ } from "./chunk-OEECXAGT.js";
7
7
  import {
8
8
  parseSlackChannelReferenceId
9
9
  } from "./chunk-F3B2YJ76.js";
@@ -12,7 +12,7 @@ import {
12
12
  setSpanAttributes,
13
13
  setSpanStatus,
14
14
  withSpan
15
- } from "./chunk-OAPPJ3TM.js";
15
+ } from "./chunk-7TZM33YX.js";
16
16
 
17
17
  // src/chat/slack/client.ts
18
18
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
@@ -314,7 +314,7 @@ async function withSlackRetries(task, maxAttempts = 3, context = {}) {
314
314
  "url.path": `/api/${action}`,
315
315
  "app.slack.method": action,
316
316
  "app.retry.max_attempts": maxAttempts,
317
- ...attemptNumber > 1 ? { "http.resend_count": attemptNumber - 1 } : {},
317
+ ...attemptNumber > 1 ? { "http.request.resend_count": attemptNumber - 1 } : {},
318
318
  ...context.attributes ?? {},
319
319
  ...context.spanAttributes ?? {}
320
320
  }
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-JIJOPRD4.js";
3
+ } from "./chunk-3PCKG4BT.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-QVQBWWXQ.js";
7
+ } from "./chunk-NF733C66.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-K3QXMZDU.js";
10
+ } from "./chunk-XTLF7C4I.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-5N3XLYBW.js";
16
+ } from "./chunk-X4RM4TBW.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-OAPPJ3TM.js";
22
+ } from "./chunk-7TZM33YX.js";
23
23
 
24
24
  // src/chat/event-tasks/store.ts
25
25
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-B7KWBJAR.js";
3
+ } from "./chunk-TSQMITMQ.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-WVXFEQXE.js";
3
+ } from "./chunk-ELAVLP7Z.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";