@sentry/junior 0.150.1 → 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 (77) hide show
  1. package/dist/{agent-hooks-G4LEACQB.js → agent-hooks-U66Q3X2P.js} +10 -10
  2. package/dist/api/schema/conversation.d.ts +35 -4
  3. package/dist/api/schema.d.ts +1 -1
  4. package/dist/api/schema.js +3 -1
  5. package/dist/api.js +81 -38
  6. package/dist/app.js +129 -206
  7. package/dist/{catalog-runtime-ZRSNE2MH.js → catalog-runtime-CVCR7SND.js} +5 -5
  8. package/dist/chat/agent/skills.d.ts +5 -4
  9. package/dist/chat/agent/tools.d.ts +5 -5
  10. package/dist/chat/api-turns/authorization.d.ts +23 -0
  11. package/dist/chat/conversations/history.d.ts +12 -3
  12. package/dist/chat/conversations/projection.d.ts +7 -3
  13. package/dist/chat/mcp/tool-manager.d.ts +0 -4
  14. package/dist/chat/runtime/agent-run-outcome.d.ts +4 -0
  15. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  16. package/dist/chat/tools/skill/call-mcp-tool.d.ts +0 -1
  17. package/dist/chat/tools/skill/load-skill.d.ts +2 -5
  18. package/dist/chat/tools/types.d.ts +1 -2
  19. package/dist/{chunk-2AWDPNP7.js → chunk-3PCKG4BT.js} +16 -10
  20. package/dist/{chunk-2Z7YX5PI.js → chunk-3UJ3QYRV.js} +156 -19
  21. package/dist/{chunk-IQW6RFXG.js → chunk-5LDOQV7Y.js} +72 -218
  22. package/dist/{chunk-JBYWR6FW.js → chunk-67VR4BJK.js} +5 -5
  23. package/dist/{chunk-5NOHC2Z4.js → chunk-732P2RBQ.js} +1 -1
  24. package/dist/{chunk-3WIFZBJL.js → chunk-7TZM33YX.js} +1 -1
  25. package/dist/{chunk-JVOLC6JZ.js → chunk-AYPU5T5L.js} +4 -4
  26. package/dist/{chunk-TZRYLW3R.js → chunk-CLX3T7Q3.js} +1 -1
  27. package/dist/{chunk-JUBPTYNO.js → chunk-ELAVLP7Z.js} +1 -1
  28. package/dist/{chunk-LSI3EKZQ.js → chunk-ETXLHT3S.js} +4 -4
  29. package/dist/{chunk-N6QJAPZS.js → chunk-I4LR7MS2.js} +45 -11
  30. package/dist/{chunk-6ZYGORV4.js → chunk-KC47ZY6Q.js} +2 -2
  31. package/dist/{chunk-6A24WEKX.js → chunk-KC5XZBRB.js} +4 -4
  32. package/dist/{chunk-D2PVJU5E.js → chunk-KTYC3GDO.js} +3 -3
  33. package/dist/{chunk-AD6N2KNE.js → chunk-KW2MGCW5.js} +5 -5
  34. package/dist/{chunk-QO3OSJDS.js → chunk-LETPYIDF.js} +1 -1
  35. package/dist/{chunk-6IWDFUXW.js → chunk-M6PWM3OK.js} +1 -1
  36. package/dist/{chunk-LWFHRWJI.js → chunk-N2472SQK.js} +8 -8
  37. package/dist/{chunk-QNSV46AW.js → chunk-NF733C66.js} +6 -6
  38. package/dist/{chunk-FGP5W3NS.js → chunk-OEECXAGT.js} +2 -2
  39. package/dist/{chunk-SZ74ECCC.js → chunk-QKPIW2CY.js} +6 -6
  40. package/dist/{chunk-4JV7GUUH.js → chunk-RCBAXKMB.js} +1 -1
  41. package/dist/{chunk-QZGYKKH6.js → chunk-SDMVFTH4.js} +173 -70
  42. package/dist/chunk-SFYDSI34.js +89 -0
  43. package/dist/{chunk-W3FQZAX5.js → chunk-TSQMITMQ.js} +6 -6
  44. package/dist/{chunk-IZE2EGCX.js → chunk-UFKSILED.js} +5 -5
  45. package/dist/{chunk-3JVUWLR7.js → chunk-UG5UCHHJ.js} +15 -1
  46. package/dist/{chunk-OWLJZ6I7.js → chunk-VD6CRYCT.js} +1 -1
  47. package/dist/{chunk-2DIRU2C2.js → chunk-WZN4RQ64.js} +1 -1
  48. package/dist/{chunk-KFHJQYKQ.js → chunk-X4RM4TBW.js} +1 -1
  49. package/dist/{chunk-B2YA2G26.js → chunk-X6JP6AMX.js} +1 -1
  50. package/dist/{chunk-GZ25ZSTX.js → chunk-XTLF7C4I.js} +11 -4
  51. package/dist/{chunk-R53UTQ2Q.js → chunk-Z5WLTGME.js} +1 -1
  52. package/dist/cli/chat.js +30 -30
  53. package/dist/cli/check.js +6 -6
  54. package/dist/cli/plugins.js +13 -13
  55. package/dist/cli/snapshot-create.js +9 -9
  56. package/dist/cli/upgrade.js +7 -7
  57. package/dist/{db-WRA5ZHYE.js → db-HQAZQASY.js} +7 -7
  58. package/dist/handlers/mcp-oauth-callback.d.ts +3 -0
  59. package/dist/handlers/oauth-callback.d.ts +3 -0
  60. package/dist/instrumentation.js +4 -4
  61. package/dist/nitro.js +2 -2
  62. package/dist/{oauth-callback-server-QWAYG3MI.js → oauth-callback-server-OJONZ7T3.js} +23 -24
  63. package/dist/{runner-5JQ54J6P.js → runner-BIJAVQDX.js} +14 -16
  64. package/dist/{skills-3YD55WPO.js → skills-SIPNY4AT.js} +6 -6
  65. package/dist/spawn-ABDIBQT6.js +38 -0
  66. package/dist/{validation-ZXE3IRSB.js → validation-KRPOY5RQ.js} +6 -6
  67. package/dist/version.js +1 -1
  68. package/dist/{work-7G2U64WI.js → work-KS3JOEI2.js} +17 -17
  69. package/dist/{worker-HJM2FZNI.js → worker-CZ5KNZUI.js} +11 -11
  70. package/migrations/0025_mcp_credential_subject.sql +8 -0
  71. package/migrations/meta/0025_snapshot.json +2275 -0
  72. package/migrations/meta/_journal.json +7 -0
  73. package/package.json +5 -5
  74. package/dist/chat/pi/derived-state.d.ts +0 -5
  75. package/dist/chunk-4CODA7P5.js +0 -43
  76. package/dist/chunk-XED3H34M.js +0 -48
  77. package/dist/spawn-OOO26XDL.js +0 -38
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
- getPersistedThreadState
4
- } from "./chunk-JBYWR6FW.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-2AWDPNP7.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-QNSV46AW.js";
36
+ } from "./chunk-NF733C66.js";
35
37
  import {
36
38
  getConversationStore,
37
39
  getDb,
38
40
  sameActorIdentity
39
- } from "./chunk-GZ25ZSTX.js";
41
+ } from "./chunk-XTLF7C4I.js";
40
42
  import {
41
43
  juniorConversations,
42
44
  juniorTaskExecutions
43
- } from "./chunk-KFHJQYKQ.js";
45
+ } from "./chunk-X4RM4TBW.js";
44
46
  import {
45
47
  getStateAdapter
46
- } from "./chunk-B2YA2G26.js";
48
+ } from "./chunk-X6JP6AMX.js";
47
49
  import {
48
50
  ProviderError,
49
51
  findProviderError,
50
52
  getProviderErrorAttributes,
51
53
  getProviderErrorUserMessage
52
- } from "./chunk-FGP5W3NS.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-3WIFZBJL.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-WRA5ZHYE.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-2DIRU2C2.js";
3
+ } from "./chunk-WZN4RQ64.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-3WIFZBJL.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-B2YA2G26.js";
7
+ } from "./chunk-X6JP6AMX.js";
8
8
  import {
9
9
  toOptionalTrimmed
10
- } from "./chunk-FGP5W3NS.js";
10
+ } from "./chunk-OEECXAGT.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "./chunk-2DIRU2C2.js";
13
+ } from "./chunk-WZN4RQ64.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-3WIFZBJL.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-FGP5W3NS.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-3WIFZBJL.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-2AWDPNP7.js";
3
+ } from "./chunk-3PCKG4BT.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-QNSV46AW.js";
7
+ } from "./chunk-NF733C66.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-GZ25ZSTX.js";
10
+ } from "./chunk-XTLF7C4I.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-KFHJQYKQ.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-3WIFZBJL.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-W3FQZAX5.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-JUBPTYNO.js";
3
+ } from "./chunk-ELAVLP7Z.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -1,34 +1,34 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-SZ74ECCC.js";
3
+ } from "./chunk-QKPIW2CY.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins
7
- } from "./chunk-QNSV46AW.js";
7
+ } from "./chunk-NF733C66.js";
8
8
  import {
9
9
  getSlackClient,
10
10
  withSlackRetries
11
- } from "./chunk-D2PVJU5E.js";
11
+ } from "./chunk-KTYC3GDO.js";
12
12
  import {
13
13
  getDb,
14
14
  parseDestination
15
- } from "./chunk-GZ25ZSTX.js";
15
+ } from "./chunk-XTLF7C4I.js";
16
16
  import {
17
17
  sleep
18
18
  } from "./chunk-EM225ITJ.js";
19
19
  import {
20
20
  acquireActiveLock,
21
21
  getStateAdapter
22
- } from "./chunk-B2YA2G26.js";
22
+ } from "./chunk-X6JP6AMX.js";
23
23
  import {
24
24
  pluginCatalogRuntime
25
- } from "./chunk-2DIRU2C2.js";
25
+ } from "./chunk-WZN4RQ64.js";
26
26
  import {
27
27
  fetchWithBoundedOAuthErrorBodies
28
- } from "./chunk-TZRYLW3R.js";
28
+ } from "./chunk-CLX3T7Q3.js";
29
29
  import {
30
30
  isRecord
31
- } from "./chunk-3WIFZBJL.js";
31
+ } from "./chunk-7TZM33YX.js";
32
32
 
33
33
  // src/chat/capabilities/router.ts
34
34
  var ProviderCredentialRouter = class {
@@ -4,30 +4,30 @@ import {
4
4
  isConversationScopedChannel,
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId
7
- } from "./chunk-D2PVJU5E.js";
7
+ } from "./chunk-KTYC3GDO.js";
8
8
  import {
9
9
  getConversationEventStore,
10
10
  getDb
11
- } from "./chunk-GZ25ZSTX.js";
11
+ } from "./chunk-XTLF7C4I.js";
12
12
  import {
13
13
  juniorConversationAnnotations,
14
14
  juniorConversationEvents,
15
15
  juniorIdentities,
16
16
  juniorUsers
17
- } from "./chunk-KFHJQYKQ.js";
17
+ } from "./chunk-X4RM4TBW.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT
20
20
  } from "./chunk-EM225ITJ.js";
21
21
  import {
22
22
  getStateAdapter
23
- } from "./chunk-B2YA2G26.js";
23
+ } from "./chunk-X6JP6AMX.js";
24
24
  import {
25
25
  botConfig,
26
26
  completeObject,
27
27
  embedTexts,
28
28
  getSlackBotToken,
29
29
  standardModelId
30
- } from "./chunk-FGP5W3NS.js";
30
+ } from "./chunk-OEECXAGT.js";
31
31
  import {
32
32
  isActorUserId,
33
33
  parseActorUserId
@@ -42,7 +42,7 @@ import {
42
42
  logInfo,
43
43
  logWarn,
44
44
  normalizeIdentityEmail
45
- } from "./chunk-3WIFZBJL.js";
45
+ } from "./chunk-7TZM33YX.js";
46
46
 
47
47
  // src/chat/plugins/agent-hooks.ts
48
48
  import {
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-5NOHC2Z4.js";
6
+ } from "./chunk-732P2RBQ.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-3WIFZBJL.js";
14
+ } from "./chunk-7TZM33YX.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -4,19 +4,19 @@ import {
4
4
  isDmChannel,
5
5
  normalizeSlackConversationId,
6
6
  withSlackRetries
7
- } from "./chunk-D2PVJU5E.js";
7
+ } from "./chunk-KTYC3GDO.js";
8
8
  import {
9
9
  parseDestination
10
- } from "./chunk-GZ25ZSTX.js";
10
+ } from "./chunk-XTLF7C4I.js";
11
11
  import {
12
12
  getStateAdapter
13
- } from "./chunk-B2YA2G26.js";
13
+ } from "./chunk-X6JP6AMX.js";
14
14
  import {
15
15
  normalizeSlackEmojiName
16
- } from "./chunk-FGP5W3NS.js";
16
+ } from "./chunk-OEECXAGT.js";
17
17
  import {
18
18
  pluginCatalogRuntime
19
- } from "./chunk-2DIRU2C2.js";
19
+ } from "./chunk-WZN4RQ64.js";
20
20
  import {
21
21
  parseSlackMessageTs,
22
22
  parseSlackUserId
@@ -25,7 +25,7 @@ import {
25
25
  isRecord,
26
26
  logInfo,
27
27
  logWarn
28
- } from "./chunk-3WIFZBJL.js";
28
+ } from "./chunk-7TZM33YX.js";
29
29
 
30
30
  // src/chat/slack/outbound.ts
31
31
  var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-F3B2YJ76.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-3WIFZBJL.js";
8
+ } from "./chunk-7TZM33YX.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";