@sentry/junior 0.149.0 → 0.150.1

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 (68) hide show
  1. package/dist/{agent-hooks-CWMCXAMT.js → agent-hooks-G4LEACQB.js} +10 -10
  2. package/dist/api.d.ts +1 -1
  3. package/dist/api.js +25 -23
  4. package/dist/app.js +92 -85
  5. package/dist/{catalog-runtime-GAW5APVI.js → catalog-runtime-ZRSNE2MH.js} +5 -5
  6. package/dist/chat/agent/index.d.ts +5 -4
  7. package/dist/chat/agent/prompt.d.ts +8 -5
  8. package/dist/chat/agent/resume.d.ts +2 -2
  9. package/dist/chat/agent/tools.d.ts +4 -7
  10. package/dist/chat/agent/{request.d.ts → types.d.ts} +138 -129
  11. package/dist/chat/agent-dispatch/types.d.ts +2 -2
  12. package/dist/chat/agent-invocations/spawn.d.ts +2 -2
  13. package/dist/chat/plugins/viewer.d.ts +4 -0
  14. package/dist/chat/runtime/agent-runner.d.ts +7 -5
  15. package/dist/chat/runtime/slack-resume.d.ts +3 -3
  16. package/dist/chat/task-execution/paused-turn.d.ts +2 -2
  17. package/dist/chat/tools/types.d.ts +1 -1
  18. package/dist/{chunk-EW2LNCRL.js → chunk-2AWDPNP7.js} +4 -4
  19. package/dist/{chunk-X22XXSZA.js → chunk-2DIRU2C2.js} +1 -1
  20. package/dist/{chunk-5CWUQXXT.js → chunk-2Z7YX5PI.js} +20 -24
  21. package/dist/{chunk-RLVZIWNQ.js → chunk-3WIFZBJL.js} +1 -1
  22. package/dist/{chunk-MEMURSBG.js → chunk-4JV7GUUH.js} +1 -1
  23. package/dist/{chunk-3KGQOKIG.js → chunk-5NOHC2Z4.js} +1 -1
  24. package/dist/{chunk-2P6BQQER.js → chunk-6A24WEKX.js} +4 -4
  25. package/dist/{chunk-6G5RCDKP.js → chunk-6IWDFUXW.js} +1 -1
  26. package/dist/{chunk-4JGM7FXO.js → chunk-6ZYGORV4.js} +2 -2
  27. package/dist/{chunk-URDCZAL4.js → chunk-AD6N2KNE.js} +5 -5
  28. package/dist/{chunk-25SC7D6Z.js → chunk-B2YA2G26.js} +1 -1
  29. package/dist/{chunk-SWHPVZBV.js → chunk-D2PVJU5E.js} +2 -2
  30. package/dist/{chunk-32CXPIZE.js → chunk-FGP5W3NS.js} +2 -2
  31. package/dist/{chunk-3GYZ5YEH.js → chunk-GZ25ZSTX.js} +3 -3
  32. package/dist/{chunk-DK5UT6PQ.js → chunk-IQW6RFXG.js} +185 -126
  33. package/dist/{chunk-XPYWWMHR.js → chunk-IZE2EGCX.js} +5 -5
  34. package/dist/{chunk-4YKPOYRV.js → chunk-JBYWR6FW.js} +5 -5
  35. package/dist/{chunk-ZYMYLLWG.js → chunk-JUBPTYNO.js} +1 -1
  36. package/dist/{chunk-JMSMXXED.js → chunk-JVOLC6JZ.js} +4 -4
  37. package/dist/{chunk-3I2IVWSZ.js → chunk-KFHJQYKQ.js} +1 -1
  38. package/dist/{chunk-TFBNBXPU.js → chunk-LSI3EKZQ.js} +4 -4
  39. package/dist/{chunk-RB26T3LU.js → chunk-LWFHRWJI.js} +8 -8
  40. package/dist/{chunk-UZGASGOD.js → chunk-N6QJAPZS.js} +9 -9
  41. package/dist/{chunk-QIW7OQEO.js → chunk-OWLJZ6I7.js} +1 -1
  42. package/dist/{chunk-7BH46NB4.js → chunk-QNSV46AW.js} +15 -6
  43. package/dist/{chunk-ALJG73MQ.js → chunk-QO3OSJDS.js} +12 -12
  44. package/dist/{chunk-75DSYFFB.js → chunk-QZGYKKH6.js} +100 -107
  45. package/dist/{chunk-EXW76GW4.js → chunk-R53UTQ2Q.js} +1 -1
  46. package/dist/{chunk-GDFF3BQG.js → chunk-RF6J3DIO.js} +34 -36
  47. package/dist/{chunk-JMH3DBM5.js → chunk-SZ74ECCC.js} +6 -6
  48. package/dist/{chunk-2JHKISQA.js → chunk-TZRYLW3R.js} +1 -1
  49. package/dist/{chunk-W7UONUIZ.js → chunk-W3FQZAX5.js} +22 -26
  50. package/dist/{chunk-ART7P442.js → chunk-XED3H34M.js} +3 -3
  51. package/dist/cli/chat.js +31 -31
  52. package/dist/cli/check.js +6 -6
  53. package/dist/cli/plugins.js +13 -13
  54. package/dist/cli/snapshot-create.js +9 -9
  55. package/dist/cli/upgrade.js +7 -7
  56. package/dist/{db-JBZLRIVY.js → db-WRA5ZHYE.js} +7 -7
  57. package/dist/instrumentation.js +4 -4
  58. package/dist/nitro.js +2 -2
  59. package/dist/{oauth-callback-server-MNTVYY2I.js → oauth-callback-server-QWAYG3MI.js} +24 -24
  60. package/dist/{runner-K24BWZSZ.js → runner-5JQ54J6P.js} +40 -37
  61. package/dist/{skills-AU5ST2CG.js → skills-3YD55WPO.js} +6 -6
  62. package/dist/spawn-OOO26XDL.js +38 -0
  63. package/dist/{validation-IXGZCFRO.js → validation-ZXE3IRSB.js} +6 -6
  64. package/dist/version.js +1 -1
  65. package/dist/{work-WCZIYILX.js → work-7G2U64WI.js} +17 -17
  66. package/dist/{worker-U2AACBEY.js → worker-HJM2FZNI.js} +11 -11
  67. package/package.json +5 -5
  68. package/dist/spawn-6PO7CVJ6.js +0 -38
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-JMH3DBM5.js";
7
+ } from "./chunk-SZ74ECCC.js";
8
8
  import {
9
9
  parseSandboxEgressAuthRequiredSignal
10
10
  } from "./chunk-HUO3UTAQ.js";
@@ -12,16 +12,16 @@ import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink,
14
14
  recordAuthorizationRequested
15
- } from "./chunk-EW2LNCRL.js";
15
+ } from "./chunk-2AWDPNP7.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-3I2IVWSZ.js";
18
+ } from "./chunk-KFHJQYKQ.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-32CXPIZE.js";
21
+ } from "./chunk-FGP5W3NS.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-X22XXSZA.js";
24
+ } from "./chunk-2DIRU2C2.js";
25
25
  import {
26
26
  credentialContextSchema
27
27
  } from "./chunk-RUIXF3YQ.js";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-EW2LNCRL.js";
3
+ } from "./chunk-2AWDPNP7.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-3GYZ5YEH.js";
9
+ } from "./chunk-GZ25ZSTX.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-3I2IVWSZ.js";
12
+ } from "./chunk-KFHJQYKQ.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-25SC7D6Z.js";
15
+ } from "./chunk-B2YA2G26.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-RLVZIWNQ.js";
23
+ } from "./chunk-3WIFZBJL.js";
24
24
 
25
25
  // src/chat/conversations/turn-lifecycle.ts
26
26
  var ConversationTurnLifecycleService = class {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.149.0",
4
+ version: "0.150.1",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-3GYZ5YEH.js";
11
+ } from "./chunk-GZ25ZSTX.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-25SC7D6Z.js";
15
+ } from "./chunk-B2YA2G26.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-32CXPIZE.js";
18
+ } from "./chunk-FGP5W3NS.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-RLVZIWNQ.js";
26
+ } from "./chunk-3WIFZBJL.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-32CXPIZE.js";
3
+ } from "./chunk-FGP5W3NS.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-EXW76GW4.js";
3
+ } from "./chunk-R53UTQ2Q.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-JMSMXXED.js";
24
+ } from "./chunk-JVOLC6JZ.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-32CXPIZE.js";
31
+ } from "./chunk-FGP5W3NS.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-RLVZIWNQ.js";
37
+ } from "./chunk-3WIFZBJL.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,34 +1,34 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-JMH3DBM5.js";
3
+ } from "./chunk-SZ74ECCC.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins
7
- } from "./chunk-7BH46NB4.js";
7
+ } from "./chunk-QNSV46AW.js";
8
8
  import {
9
9
  getSlackClient,
10
10
  withSlackRetries
11
- } from "./chunk-SWHPVZBV.js";
11
+ } from "./chunk-D2PVJU5E.js";
12
12
  import {
13
13
  getDb,
14
14
  parseDestination
15
- } from "./chunk-3GYZ5YEH.js";
15
+ } from "./chunk-GZ25ZSTX.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-25SC7D6Z.js";
22
+ } from "./chunk-B2YA2G26.js";
23
23
  import {
24
24
  pluginCatalogRuntime
25
- } from "./chunk-X22XXSZA.js";
25
+ } from "./chunk-2DIRU2C2.js";
26
26
  import {
27
27
  fetchWithBoundedOAuthErrorBodies
28
- } from "./chunk-2JHKISQA.js";
28
+ } from "./chunk-TZRYLW3R.js";
29
29
  import {
30
30
  isRecord
31
- } from "./chunk-RLVZIWNQ.js";
31
+ } from "./chunk-3WIFZBJL.js";
32
32
 
33
33
  // src/chat/capabilities/router.ts
34
34
  var ProviderCredentialRouter = class {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState
4
- } from "./chunk-4YKPOYRV.js";
4
+ } from "./chunk-JBYWR6FW.js";
5
5
  import {
6
6
  pluginTaskId,
7
7
  pluginTaskParamsSchema,
@@ -20,7 +20,7 @@ import {
20
20
  markTurnCompleted,
21
21
  normalizeToolNameFromResult,
22
22
  stripRuntimeTurnContext
23
- } from "./chunk-EW2LNCRL.js";
23
+ } from "./chunk-2AWDPNP7.js";
24
24
  import {
25
25
  JUNIOR_THREAD_STATE_TTL_MS
26
26
  } from "./chunk-3Y47VMHV.js";
@@ -31,25 +31,25 @@ import {
31
31
  createPluginModel,
32
32
  createPluginState,
33
33
  getPlugins
34
- } from "./chunk-7BH46NB4.js";
34
+ } from "./chunk-QNSV46AW.js";
35
35
  import {
36
36
  getConversationStore,
37
37
  getDb,
38
38
  sameActorIdentity
39
- } from "./chunk-3GYZ5YEH.js";
39
+ } from "./chunk-GZ25ZSTX.js";
40
40
  import {
41
41
  juniorConversations,
42
42
  juniorTaskExecutions
43
- } from "./chunk-3I2IVWSZ.js";
43
+ } from "./chunk-KFHJQYKQ.js";
44
44
  import {
45
45
  getStateAdapter
46
- } from "./chunk-25SC7D6Z.js";
46
+ } from "./chunk-B2YA2G26.js";
47
47
  import {
48
48
  ProviderError,
49
49
  findProviderError,
50
50
  getProviderErrorAttributes,
51
51
  getProviderErrorUserMessage
52
- } from "./chunk-32CXPIZE.js";
52
+ } from "./chunk-FGP5W3NS.js";
53
53
  import {
54
54
  credentialSubjectSchema
55
55
  } from "./chunk-RUIXF3YQ.js";
@@ -59,7 +59,7 @@ import {
59
59
  import {
60
60
  buildTurnFailureResponse,
61
61
  logWarn
62
- } from "./chunk-RLVZIWNQ.js";
62
+ } from "./chunk-3WIFZBJL.js";
63
63
 
64
64
  // src/chat/runtime/delivered-turn-state.ts
65
65
  function buildDeliveredTurnStatePatch(args) {
@@ -85,7 +85,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
85
85
 
86
86
  // src/chat/services/turn-session-routing.ts
87
87
  async function resolveTurnSessionRouting(args) {
88
- const conversationStore = args.conversationStore ?? (await import("./db-JBZLRIVY.js")).getConversationStore();
88
+ const conversationStore = args.conversationStore ?? (await import("./db-WRA5ZHYE.js")).getConversationStore();
89
89
  const conversation = await conversationStore.get({
90
90
  conversationId: args.conversationId
91
91
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-X22XXSZA.js";
3
+ } from "./chunk-2DIRU2C2.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -4,30 +4,30 @@ import {
4
4
  isConversationScopedChannel,
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId
7
- } from "./chunk-SWHPVZBV.js";
7
+ } from "./chunk-D2PVJU5E.js";
8
8
  import {
9
9
  getConversationEventStore,
10
10
  getDb
11
- } from "./chunk-3GYZ5YEH.js";
11
+ } from "./chunk-GZ25ZSTX.js";
12
12
  import {
13
13
  juniorConversationAnnotations,
14
14
  juniorConversationEvents,
15
15
  juniorIdentities,
16
16
  juniorUsers
17
- } from "./chunk-3I2IVWSZ.js";
17
+ } from "./chunk-KFHJQYKQ.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT
20
20
  } from "./chunk-EM225ITJ.js";
21
21
  import {
22
22
  getStateAdapter
23
- } from "./chunk-25SC7D6Z.js";
23
+ } from "./chunk-B2YA2G26.js";
24
24
  import {
25
25
  botConfig,
26
26
  completeObject,
27
27
  embedTexts,
28
28
  getSlackBotToken,
29
29
  standardModelId
30
- } from "./chunk-32CXPIZE.js";
30
+ } from "./chunk-FGP5W3NS.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-RLVZIWNQ.js";
45
+ } from "./chunk-3WIFZBJL.js";
46
46
 
47
47
  // src/chat/plugins/agent-hooks.ts
48
48
  import {
@@ -543,6 +543,14 @@ async function resolveViewerUserFromSql(db, email) {
543
543
  async function resolveViewerUser(email) {
544
544
  return await resolveViewerUserFromSql(getDb(), email);
545
545
  }
546
+ async function updateViewerDisplayNameFromSql(db, userId, displayName) {
547
+ const rows = await db.update(juniorUsers).set({ displayName, updatedAt: /* @__PURE__ */ new Date() }).where(eq3(juniorUsers.id, userId)).returning();
548
+ const userRow = rows[0];
549
+ return userRow ? await readUserById(db, userRow) : void 0;
550
+ }
551
+ async function updateViewerDisplayName(userId, displayName) {
552
+ return await updateViewerDisplayNameFromSql(getDb(), userId, displayName);
553
+ }
546
554
  async function readActorIdentityFromSql(db, actor) {
547
555
  if (actor.platform === "system") return void 0;
548
556
  const providerTenantId = actor.platform === "slack" ? actor.teamId : "";
@@ -1833,6 +1841,7 @@ export {
1833
1841
  createResourceEventTeamIdResolver,
1834
1842
  getSlackToolContext,
1835
1843
  resolveViewerUser,
1844
+ updateViewerDisplayName,
1836
1845
  readActorIdentity,
1837
1846
  bindSlackDirectCredentialSubject,
1838
1847
  verifySlackDirectCredentialSubject,
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-W7UONUIZ.js";
3
+ } from "./chunk-W3FQZAX5.js";
4
4
  import {
5
- actorFromRouting,
5
+ actorFromRun,
6
6
  toolInvocationDestination
7
- } from "./chunk-GDFF3BQG.js";
7
+ } from "./chunk-RF6J3DIO.js";
8
8
 
9
9
  // src/chat/agent-invocations/spawn.ts
10
- function bindSpawnAgent(request, options) {
11
- const actor = actorFromRouting(request.routing);
10
+ function bindSpawnAgent(run, options) {
11
+ const actor = actorFromRun(run);
12
12
  if (!actor) {
13
13
  return void 0;
14
14
  }
@@ -19,16 +19,16 @@ function bindSpawnAgent(request, options) {
19
19
  {
20
20
  actor,
21
21
  ...input.name ? { agentName: input.name } : {},
22
- ...request.routing.credentialContext ? { credentialContext: request.routing.credentialContext } : {},
23
- destination: toolInvocationDestination(request.routing),
24
- ...request.routing.destinationVisibility ? {
25
- destinationVisibility: request.routing.destinationVisibility
22
+ ...run.credentialContext ? { credentialContext: run.credentialContext } : {},
23
+ destination: toolInvocationDestination(run),
24
+ ...run.destinationVisibility ? {
25
+ destinationVisibility: run.destinationVisibility
26
26
  } : {},
27
- idempotencyKey: `${request.turnId}:${call.toolCallId}`,
27
+ idempotencyKey: `${run.turnId}:${call.toolCallId}`,
28
28
  input: input.task,
29
- parentConversationId: request.conversationId,
29
+ parentConversationId: run.conversationId,
30
30
  ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : {},
31
- source: request.routing.source
31
+ source: run.source
32
32
  },
33
33
  { ...options, queue }
34
34
  );