@sentry/junior 0.148.0 → 0.150.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 (84) hide show
  1. package/dist/{agent-hooks-VAUYT6PD.js → agent-hooks-SEOGOGKX.js} +10 -10
  2. package/dist/api/conversations/aggregate.d.ts +2 -0
  3. package/dist/api/conversations/create.d.ts +1 -1
  4. package/dist/api/conversations/pending-messages.d.ts +15 -0
  5. package/dist/api/people/shared.d.ts +2 -0
  6. package/dist/api/schema/conversation.d.ts +78 -4
  7. package/dist/api/schema.d.ts +2 -2
  8. package/dist/api/schema.js +7 -1
  9. package/dist/api.d.ts +1 -1
  10. package/dist/api.js +186 -35
  11. package/dist/app.js +152 -186
  12. package/dist/{catalog-runtime-WADOZVTB.js → catalog-runtime-HA7RIWYT.js} +5 -5
  13. package/dist/chat/agent/index.d.ts +5 -4
  14. package/dist/chat/agent/prompt.d.ts +8 -5
  15. package/dist/chat/agent/resume.d.ts +2 -2
  16. package/dist/chat/agent/tools.d.ts +4 -7
  17. package/dist/chat/agent/{request.d.ts → types.d.ts} +138 -129
  18. package/dist/chat/agent-dispatch/types.d.ts +2 -2
  19. package/dist/chat/agent-invocations/spawn.d.ts +2 -2
  20. package/dist/chat/api-turns/work.d.ts +6 -1
  21. package/dist/chat/app/services.d.ts +1 -1
  22. package/dist/chat/plugins/viewer.d.ts +4 -0
  23. package/dist/chat/runtime/agent-runner.d.ts +7 -5
  24. package/dist/chat/runtime/reply-executor.d.ts +0 -2
  25. package/dist/chat/runtime/slack-resume.d.ts +3 -3
  26. package/dist/chat/services/conversation-memory.d.ts +2 -2
  27. package/dist/chat/services/conversation-title.d.ts +20 -0
  28. package/dist/chat/slack/assistant-thread/title.d.ts +10 -27
  29. package/dist/chat/state/conversation.d.ts +1 -0
  30. package/dist/chat/task-execution/paused-turn.d.ts +2 -2
  31. package/dist/chat/tools/types.d.ts +1 -1
  32. package/dist/{chunk-QOWHHM3F.js → chunk-3GL327SC.js} +1 -1
  33. package/dist/{chunk-45LOR4PU.js → chunk-3JVUWLR7.js} +45 -1
  34. package/dist/{chunk-4GXJUYJV.js → chunk-3ZMKDHCT.js} +2 -2
  35. package/dist/{chunk-DUY5CDAM.js → chunk-4KAYAIBV.js} +1 -1
  36. package/dist/{chunk-ULAU5ZGU.js → chunk-4VH7KLGC.js} +106 -113
  37. package/dist/{chunk-V2FXMOEA.js → chunk-64K7GKRW.js} +2 -2
  38. package/dist/{chunk-2B3PT3V2.js → chunk-6PFDWAK2.js} +1 -1
  39. package/dist/{chunk-LNVEIJ2L.js → chunk-7D4GNUV2.js} +5 -5
  40. package/dist/{chunk-ZPL2RR7F.js → chunk-7GOP6VFJ.js} +40 -36
  41. package/dist/{chunk-HWQGBIH7.js → chunk-7NLW2NF5.js} +1 -1
  42. package/dist/{chunk-55F4QU2V.js → chunk-7QB2CKCW.js} +1 -1
  43. package/dist/{chunk-WCN4YSH7.js → chunk-DWETNV66.js} +6 -6
  44. package/dist/{chunk-D3WPMGEX.js → chunk-F5NMSEBL.js} +1 -1
  45. package/dist/{chunk-IL4EDBMV.js → chunk-FEFEIA3Z.js} +5 -5
  46. package/dist/{chunk-WOONT5ZP.js → chunk-H2RLIJ7G.js} +1 -1
  47. package/dist/{chunk-VRHTNBA6.js → chunk-ILYL6YFD.js} +3 -3
  48. package/dist/{chunk-VCYSOXON.js → chunk-IPGNWXA3.js} +545 -7
  49. package/dist/{chunk-LAZGHEYU.js → chunk-IZRSLANA.js} +1 -1
  50. package/dist/{chunk-EAI67NTM.js → chunk-JQXJ2E53.js} +1 -1
  51. package/dist/{chunk-HLPLT3NY.js → chunk-M5OZSVJI.js} +8 -4
  52. package/dist/{chunk-XJ42NBP5.js → chunk-MCNP7A7T.js} +8 -8
  53. package/dist/{chunk-OJCP3C3J.js → chunk-NCGVQXX5.js} +22 -26
  54. package/dist/{chunk-4AQZYNHM.js → chunk-NNOCRVQO.js} +2 -2
  55. package/dist/{chunk-GXYDVZKM.js → chunk-P43QM7JY.js} +5 -5
  56. package/dist/{chunk-EINWQFXI.js → chunk-QPIPYVGE.js} +5 -5
  57. package/dist/{chunk-GDFF3BQG.js → chunk-RF6J3DIO.js} +34 -36
  58. package/dist/{chunk-D6YX4NNN.js → chunk-SH6ZKJFZ.js} +4 -4
  59. package/dist/{chunk-LE5H7LMT.js → chunk-SHDREBGC.js} +1 -1
  60. package/dist/{chunk-VMNRXKAH.js → chunk-TZLYAO2J.js} +191 -134
  61. package/dist/{chunk-RRJV5UR5.js → chunk-UIMBNY6O.js} +11 -337
  62. package/dist/{chunk-ZCHIC2GM.js → chunk-UOFQEVR5.js} +15 -6
  63. package/dist/{chunk-7OEIXFC3.js → chunk-Y2VZ54CQ.js} +12 -12
  64. package/dist/{chunk-VY6W3T43.js → chunk-ZBOGYZ53.js} +4 -4
  65. package/dist/{chunk-POSZWRGL.js → chunk-ZUQT35YC.js} +1 -1
  66. package/dist/cli/chat.js +31 -32
  67. package/dist/cli/check.js +6 -6
  68. package/dist/cli/plugins.js +13 -13
  69. package/dist/cli/snapshot-create.js +9 -9
  70. package/dist/cli/upgrade.js +7 -7
  71. package/dist/{db-XUKZRFFK.js → db-HUW75QG7.js} +7 -7
  72. package/dist/instrumentation.js +4 -4
  73. package/dist/nitro.js +2 -2
  74. package/dist/{oauth-callback-server-LPZMMGFI.js → oauth-callback-server-DP7NIZPQ.js} +24 -25
  75. package/dist/{runner-DGKUTMPX.js → runner-AINV7K3M.js} +47 -45
  76. package/dist/{skills-P7YUFSXM.js → skills-PKS37E6B.js} +6 -6
  77. package/dist/spawn-NJCDEPPL.js +38 -0
  78. package/dist/{validation-S7U5M5NR.js → validation-PDC3MVMM.js} +6 -6
  79. package/dist/version.js +1 -1
  80. package/dist/{work-GAA7TVAD.js → work-KJLJRPXS.js} +17 -17
  81. package/dist/{worker-JXPJH3QB.js → worker-TYQ7YVIR.js} +11 -11
  82. package/package.json +5 -5
  83. package/dist/chunk-4EA2SFK2.js +0 -137
  84. package/dist/spawn-DSK3ZEVD.js +0 -38
@@ -1,34 +1,34 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-WCN4YSH7.js";
3
+ } from "./chunk-DWETNV66.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins
7
- } from "./chunk-ZCHIC2GM.js";
7
+ } from "./chunk-UOFQEVR5.js";
8
8
  import {
9
9
  getSlackClient,
10
10
  withSlackRetries
11
- } from "./chunk-V2FXMOEA.js";
11
+ } from "./chunk-64K7GKRW.js";
12
12
  import {
13
13
  getDb,
14
14
  parseDestination
15
- } from "./chunk-VRHTNBA6.js";
15
+ } from "./chunk-ILYL6YFD.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-2B3PT3V2.js";
22
+ } from "./chunk-6PFDWAK2.js";
23
23
  import {
24
24
  pluginCatalogRuntime
25
- } from "./chunk-HWQGBIH7.js";
25
+ } from "./chunk-7NLW2NF5.js";
26
26
  import {
27
27
  fetchWithBoundedOAuthErrorBodies
28
- } from "./chunk-POSZWRGL.js";
28
+ } from "./chunk-ZUQT35YC.js";
29
29
  import {
30
30
  isRecord
31
- } from "./chunk-EAI67NTM.js";
31
+ } from "./chunk-JQXJ2E53.js";
32
32
 
33
33
  // src/chat/capabilities/router.ts
34
34
  var ProviderCredentialRouter = class {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-HLPLT3NY.js";
3
+ } from "./chunk-M5OZSVJI.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-IL4EDBMV.js";
9
+ } from "./chunk-FEFEIA3Z.js";
10
10
  import {
11
11
  AgentInvocationBusyError,
12
12
  AgentInvocationLimitError,
@@ -15,7 +15,7 @@ import {
15
15
  agentBindingSchema,
16
16
  agentInvocationSchema,
17
17
  createAgentInvocationSchema
18
- } from "./chunk-EINWQFXI.js";
18
+ } from "./chunk-QPIPYVGE.js";
19
19
  import {
20
20
  TurnInputCommitLostError,
21
21
  failTurnRecord,
@@ -26,16 +26,16 @@ import {
26
26
  isTurnInputCommitLostError,
27
27
  openConversationProjection,
28
28
  saveTurnCheckpoint
29
- } from "./chunk-VCYSOXON.js";
29
+ } from "./chunk-IPGNWXA3.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-VRHTNBA6.js";
34
+ } from "./chunk-ILYL6YFD.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-D3WPMGEX.js";
38
+ } from "./chunk-F5NMSEBL.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";
@@ -525,27 +525,23 @@ function createAgentInvocationWorker(options) {
525
525
  conversationId: invocation.childConversationId,
526
526
  turnId,
527
527
  runId: invocation.invocationId,
528
- input: {
529
- messageText: invocation.input,
530
- piMessages: history
531
- },
532
- routing: {
533
- actor: invocation.actor,
534
- credentialContext: invocation.credentialContext,
535
- destination: invocation.destination,
536
- destinationVisibility: invocation.destinationVisibility,
537
- publishExternally: context.publishExternally,
538
- source: invocation.source,
539
- surface: "internal"
540
- },
541
- policy: {
542
- // TODO(#881, #883): Child runs may still need a path to force
543
- // interactive auth when a delegated tool requires credentials the
544
- // parent already has authority to request. Today background children
545
- // hard-fail instead of pausing for an OAuth link.
546
- disabledFeatures: ["handoff", "interactive-auth", "subagents"],
547
- reasoningLevel: invocation.reasoningLevel
528
+ instruction: {
529
+ text: invocation.input
548
530
  },
531
+ history,
532
+ actor: invocation.actor,
533
+ credentialContext: invocation.credentialContext,
534
+ destination: invocation.destination,
535
+ destinationVisibility: invocation.destinationVisibility,
536
+ publishExternally: context.publishExternally,
537
+ source: invocation.source,
538
+ surface: "internal",
539
+ // TODO(#881, #883): Child runs may still need a path to force
540
+ // interactive auth when a delegated tool requires credentials the
541
+ // parent already has authority to request. Today background children
542
+ // hard-fail instead of pausing for an OAuth link.
543
+ disabledFeatures: ["handoff", "interactive-auth", "subagents"],
544
+ reasoning: invocation.reasoningLevel,
549
545
  state: {
550
546
  sandboxRef
551
547
  },
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-HWQGBIH7.js";
3
+ } from "./chunk-7NLW2NF5.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-EAI67NTM.js";
6
+ } from "./chunk-JQXJ2E53.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-VCYSOXON.js";
3
+ } from "./chunk-IPGNWXA3.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-ZCHIC2GM.js";
7
+ } from "./chunk-UOFQEVR5.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-VRHTNBA6.js";
10
+ } from "./chunk-ILYL6YFD.js";
11
11
  import {
12
12
  juniorEventTasks,
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-D3WPMGEX.js";
16
+ } from "./chunk-F5NMSEBL.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-EAI67NTM.js";
22
+ } from "./chunk-JQXJ2E53.js";
23
23
 
24
24
  // src/chat/event-tasks/store.ts
25
25
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-WCN4YSH7.js";
7
+ } from "./chunk-DWETNV66.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-VCYSOXON.js";
15
+ } from "./chunk-IPGNWXA3.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-D3WPMGEX.js";
18
+ } from "./chunk-F5NMSEBL.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-4GXJUYJV.js";
21
+ } from "./chunk-3ZMKDHCT.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-HWQGBIH7.js";
24
+ } from "./chunk-7NLW2NF5.js";
25
25
  import {
26
26
  credentialContextSchema
27
27
  } from "./chunk-RUIXF3YQ.js";
@@ -1,27 +1,27 @@
1
- // src/chat/agent/request.ts
2
- function isAgentRunFeatureDisabled(policy, feature) {
3
- return policy?.disabledFeatures?.includes(feature) ?? false;
4
- }
1
+ // src/chat/agent/types.ts
5
2
  var RetryableDeliveryError = class extends Error {
6
3
  constructor(cause) {
7
4
  super("Assistant delivery was transient or ambiguous", { cause });
8
5
  this.name = "RetryableDeliveryError";
9
6
  }
10
7
  };
11
- function actorFromRouting(routing) {
12
- if (routing.dispatch?.actor) {
13
- return routing.dispatch.actor;
8
+ function isAgentRunFeatureDisabled(disabledFeatures, feature) {
9
+ return disabledFeatures?.includes(feature) ?? false;
10
+ }
11
+ function actorFromRun(run) {
12
+ if (run.dispatch?.actor) {
13
+ return run.dispatch.actor;
14
14
  }
15
- if (routing.actor) {
16
- return routing.actor;
15
+ if (run.actor) {
16
+ return run.actor;
17
17
  }
18
- if (routing.credentialContext && !("type" in routing.credentialContext.actor)) {
19
- return routing.credentialContext.actor;
18
+ if (run.credentialContext && !("type" in run.credentialContext.actor)) {
19
+ return run.credentialContext.actor;
20
20
  }
21
21
  return void 0;
22
22
  }
23
- function assertRunRoutingConsistency(request) {
24
- const { destination, source } = request.routing;
23
+ function assertRunConsistency(run) {
24
+ const { destination, source } = run;
25
25
  switch (source.platform) {
26
26
  case "slack": {
27
27
  if (destination.platform !== "slack") {
@@ -41,7 +41,7 @@ function assertRunRoutingConsistency(request) {
41
41
  "Source and destination conversation IDs do not match"
42
42
  );
43
43
  }
44
- if (request.routing.surface !== "internal" && destination.conversationId !== request.conversationId) {
44
+ if (run.surface !== "internal" && destination.conversationId !== run.conversationId) {
45
45
  throw new TypeError(
46
46
  "Source, destination, and run conversation IDs do not match"
47
47
  );
@@ -49,10 +49,8 @@ function assertRunRoutingConsistency(request) {
49
49
  break;
50
50
  }
51
51
  case "web": {
52
- if (request.routing.surface !== "internal" && source.conversationId !== request.conversationId) {
53
- throw new TypeError(
54
- "Web source and run conversation IDs do not match"
55
- );
52
+ if (run.surface !== "internal" && source.conversationId !== run.conversationId) {
53
+ throw new TypeError("Web source and run conversation IDs do not match");
56
54
  }
57
55
  switch (destination.platform) {
58
56
  case "local": {
@@ -61,7 +59,7 @@ function assertRunRoutingConsistency(request) {
61
59
  "Source and destination conversation IDs do not match"
62
60
  );
63
61
  }
64
- if (request.routing.surface !== "internal" && destination.conversationId !== request.conversationId) {
62
+ if (run.surface !== "internal" && destination.conversationId !== run.conversationId) {
65
63
  throw new TypeError(
66
64
  "Source, destination, and run conversation IDs do not match"
67
65
  );
@@ -69,7 +67,7 @@ function assertRunRoutingConsistency(request) {
69
67
  break;
70
68
  }
71
69
  case "slack": {
72
- if (request.routing.publishExternally) {
70
+ if (run.publishExternally) {
73
71
  throw new TypeError(
74
72
  "Web turns on Slack destinations must not publish externally"
75
73
  );
@@ -80,7 +78,7 @@ function assertRunRoutingConsistency(request) {
80
78
  break;
81
79
  }
82
80
  }
83
- const actor = request.routing.dispatch?.actor ?? request.routing.actor;
81
+ const actor = run.dispatch?.actor ?? run.actor;
84
82
  if (!actor || actor.platform === "system") {
85
83
  return;
86
84
  }
@@ -91,7 +89,7 @@ function assertRunRoutingConsistency(request) {
91
89
  case "local":
92
90
  return destination.platform === "local";
93
91
  case "web":
94
- return destination.platform === "local" || destination.platform === "slack" && request.routing.publishExternally !== true;
92
+ return destination.platform === "local" || destination.platform === "slack" && run.publishExternally !== true;
95
93
  }
96
94
  })();
97
95
  if (!actorMatchesDestination) {
@@ -103,34 +101,34 @@ function assertRunRoutingConsistency(request) {
103
101
  throw new TypeError("Slack actor team does not match destination team");
104
102
  }
105
103
  }
106
- function toolInvocationDestination(routing) {
107
- if (routing.destination.platform !== "slack" || !routing.toolChannelId) {
108
- return routing.destination;
104
+ function toolInvocationDestination(run) {
105
+ if (run.destination.platform !== "slack" || !run.toolChannelId) {
106
+ return run.destination;
109
107
  }
110
108
  return {
111
109
  platform: "slack",
112
- teamId: routing.destination.teamId,
113
- channelId: routing.toolChannelId
110
+ teamId: run.destination.teamId,
111
+ channelId: run.toolChannelId
114
112
  };
115
113
  }
116
- function surfaceFromRouting(routing) {
117
- if (routing.surface) {
118
- return routing.surface;
114
+ function surfaceFromRun(run) {
115
+ if (run.surface) {
116
+ return run.surface;
119
117
  }
120
- if (routing.source.platform === "slack") {
118
+ if (run.source.platform === "slack") {
121
119
  return "slack";
122
120
  }
123
- if (routing.source.platform === "web") {
121
+ if (run.source.platform === "web") {
124
122
  return "api";
125
123
  }
126
124
  return "internal";
127
125
  }
128
126
 
129
127
  export {
130
- isAgentRunFeatureDisabled,
131
128
  RetryableDeliveryError,
132
- actorFromRouting,
133
- assertRunRoutingConsistency,
129
+ isAgentRunFeatureDisabled,
130
+ actorFromRun,
131
+ assertRunConsistency,
134
132
  toolInvocationDestination,
135
- surfaceFromRouting
133
+ surfaceFromRun
136
134
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-DUY5CDAM.js";
3
+ } from "./chunk-4KAYAIBV.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-HLPLT3NY.js";
24
+ } from "./chunk-M5OZSVJI.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-4GXJUYJV.js";
31
+ } from "./chunk-3ZMKDHCT.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-EAI67NTM.js";
37
+ } from "./chunk-JQXJ2E53.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-EAI67NTM.js";
3
+ } from "./chunk-JQXJ2E53.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";