@sentry/junior 0.136.1 → 0.138.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 (103) hide show
  1. package/dist/{agent-hooks-2KDSPPO4.js → agent-hooks-SCR74Q3E.js} +11 -9
  2. package/dist/api/conversations/projection.d.ts +1 -0
  3. package/dist/api/conversations/stats.d.ts +1 -0
  4. package/dist/api/schema/conversation.d.ts +2 -0
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +187 -46
  7. package/dist/app.d.ts +8 -1
  8. package/dist/app.js +519 -860
  9. package/dist/{catalog-runtime-WSZQGC4D.js → catalog-runtime-IU3QF4GG.js} +5 -5
  10. package/dist/chat/agent/request.d.ts +32 -2
  11. package/dist/chat/agent-dispatch/heartbeat.d.ts +5 -0
  12. package/dist/chat/agent-dispatch/types.d.ts +1 -1
  13. package/dist/chat/agent-invocations/errors.d.ts +8 -0
  14. package/dist/chat/agent-invocations/spawn.d.ts +12 -0
  15. package/dist/chat/agent-invocations/store.d.ts +44 -0
  16. package/dist/chat/agent-invocations/types.d.ts +449 -0
  17. package/dist/chat/agent-invocations/work.d.ts +31 -0
  18. package/dist/chat/config.d.ts +1 -0
  19. package/dist/chat/configuration/defaults.d.ts +1 -1
  20. package/dist/chat/conversations/sql/store.d.ts +8 -0
  21. package/dist/chat/conversations/store.d.ts +9 -1
  22. package/dist/chat/experimental.d.ts +16 -0
  23. package/dist/chat/pi/client.d.ts +1 -8
  24. package/dist/chat/pi/gateway-auth.d.ts +16 -0
  25. package/dist/chat/runtime/agent-runner.d.ts +2 -1
  26. package/dist/chat/sandbox/docker.d.ts +17 -0
  27. package/dist/chat/services/agent-continue.d.ts +2 -0
  28. package/dist/chat/services/auth-pause.d.ts +0 -1
  29. package/dist/chat/services/mcp-auth-orchestration.d.ts +3 -2
  30. package/dist/chat/services/plugin-auth-orchestration.d.ts +3 -2
  31. package/dist/chat/services/subscribed-reply-router-policy.d.ts +12 -0
  32. package/dist/chat/services/turn-session-routing.d.ts +17 -0
  33. package/dist/chat/slack/message.d.ts +6 -1
  34. package/dist/chat/slack/source-link.d.ts +8 -2
  35. package/dist/chat/slack/team-domain.d.ts +4 -0
  36. package/dist/chat/source.d.ts +5 -5
  37. package/dist/chat/state/turn-session.d.ts +0 -2
  38. package/dist/chat/task-execution/state.d.ts +23 -11
  39. package/dist/chat/task-execution/store.d.ts +20 -11
  40. package/dist/chat/task-execution/worker.d.ts +2 -2
  41. package/dist/chat/tools/runtime/spawn-agent.d.ts +31 -0
  42. package/dist/chat/tools/types.d.ts +2 -0
  43. package/dist/chunk-3Y47VMHV.js +6 -0
  44. package/dist/chunk-5IDFPCON.js +46 -0
  45. package/dist/chunk-5LTJ4ITU.js +1523 -0
  46. package/dist/{chunk-KLBYCSLJ.js → chunk-5MXWHTCK.js} +17 -434
  47. package/dist/{chunk-CZZDCH3Q.js → chunk-A7WCHXZV.js} +206 -78
  48. package/dist/{chunk-4YQ6I6VF.js → chunk-BOLJOV5T.js} +2 -56
  49. package/dist/{chunk-XCZ6COFO.js → chunk-BYW4B4PR.js} +90 -54
  50. package/dist/{chunk-JQRTXJHD.js → chunk-C7ZVPO4Z.js} +2 -1
  51. package/dist/{chunk-MW2QRPGW.js → chunk-DCLLQGS6.js} +119 -50
  52. package/dist/{chunk-CDVCCOMF.js → chunk-E5UYAIKJ.js} +75 -1475
  53. package/dist/{chunk-3SUK3UXX.js → chunk-ELKW5FIB.js} +5 -5
  54. package/dist/chunk-EM225ITJ.js +56 -0
  55. package/dist/{chunk-Y6JNHTRD.js → chunk-FEUNPTGV.js} +34 -70
  56. package/dist/{chunk-TYNMSQKA.js → chunk-FNLBTB4K.js} +1 -1
  57. package/dist/{chunk-TRZSM67C.js → chunk-HCIVH3JS.js} +1 -0
  58. package/dist/chunk-HIWJWWMT.js +668 -0
  59. package/dist/chunk-IUFM5JWV.js +24 -0
  60. package/dist/{chunk-XWPA5KZF.js → chunk-JNNJZURV.js} +1 -1
  61. package/dist/{chunk-6ZK6FZIV.js → chunk-KCBZSJRU.js} +6 -27
  62. package/dist/{chunk-BG3KWWDJ.js → chunk-KDCHVT25.js} +1 -1
  63. package/dist/{chunk-VH6MI4L7.js → chunk-KFRHRSCJ.js} +1 -1
  64. package/dist/chunk-LPVUNO2W.js +320 -0
  65. package/dist/{chunk-G66RYKRS.js → chunk-N7WARMC6.js} +16 -776
  66. package/dist/chunk-PB3CXNVL.js +41 -0
  67. package/dist/chunk-Q6QZTTLS.js +55 -0
  68. package/dist/{chunk-3QNJOHKG.js → chunk-QS527AV5.js} +1 -1
  69. package/dist/chunk-R776HKPK.js +81 -0
  70. package/dist/{chunk-OTJMQYVP.js → chunk-RZIBSCYC.js} +517 -608
  71. package/dist/chunk-SD3OFRWY.js +714 -0
  72. package/dist/{chunk-HIRIWTWD.js → chunk-SIPKWSXK.js} +58 -10
  73. package/dist/chunk-TCS76X5D.js +441 -0
  74. package/dist/{chunk-UX2TNH5D.js → chunk-TDJCLNDH.js} +3 -3
  75. package/dist/{chunk-NVVBEJUB.js → chunk-TUUDXEXU.js} +336 -300
  76. package/dist/{chunk-22Z6MGMK.js → chunk-VPZFVJND.js} +1 -1
  77. package/dist/{chunk-RFDD3Z2I.js → chunk-YU5QUF67.js} +1 -1
  78. package/dist/chunk-ZBSMCXKV.js +710 -0
  79. package/dist/{chunk-FSYXYBWU.js → chunk-ZXNTJJIE.js} +2 -2
  80. package/dist/cli/chat.js +65 -26
  81. package/dist/cli/check.js +7 -7
  82. package/dist/cli/plugins.js +14 -12
  83. package/dist/cli/snapshot-create.js +10 -9
  84. package/dist/cli/upgrade.js +7 -7
  85. package/dist/conversation-work-KATFHLG3.js +56 -0
  86. package/dist/db/schema/agent-invocations.d.ts +544 -0
  87. package/dist/db/schema.d.ts +543 -1
  88. package/dist/{db-Z2NNL2JC.js → db-UO2IWXGA.js} +7 -7
  89. package/dist/experimental-HH6OM6UH.js +13 -0
  90. package/dist/instrumentation.js +4 -4
  91. package/dist/nitro.js +4 -3
  92. package/dist/{oauth-callback-server-PO3M5JMG.js → oauth-callback-server-MAQI43LX.js} +26 -18
  93. package/dist/{runner-QHQYZYJA.js → runner-PIUQEXKE.js} +26 -14
  94. package/dist/{skills-KXMT3DRA.js → skills-4ARJADHQ.js} +6 -6
  95. package/dist/spawn-G2AWPMCT.js +38 -0
  96. package/dist/{validation-Y42ULTT6.js → validation-S3EE3HWL.js} +6 -6
  97. package/dist/version.js +1 -1
  98. package/dist/work-UARRUAW3.js +46 -0
  99. package/dist/worker-DOCIRVD3.js +24 -0
  100. package/migrations/0021_first_warhawk.sql +35 -0
  101. package/migrations/meta/0021_snapshot.json +2176 -0
  102. package/migrations/meta/_journal.json +8 -1
  103. package/package.json +6 -5
@@ -0,0 +1,41 @@
1
+ import {
2
+ createAndEnqueueAgentInvocation
3
+ } from "./chunk-ZBSMCXKV.js";
4
+ import {
5
+ actorFromRouting,
6
+ toolInvocationDestination
7
+ } from "./chunk-R776HKPK.js";
8
+
9
+ // src/chat/agent-invocations/spawn.ts
10
+ function bindSpawnAgent(request, options) {
11
+ const actor = actorFromRouting(request.routing);
12
+ if (!actor) {
13
+ return void 0;
14
+ }
15
+ return async (input, call) => {
16
+ call.signal?.throwIfAborted();
17
+ const queue = typeof options.queue === "function" ? options.queue() : options.queue;
18
+ const invocation = await createAndEnqueueAgentInvocation(
19
+ {
20
+ actor,
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
26
+ } : {},
27
+ idempotencyKey: `${request.turnId}:${call.toolCallId}`,
28
+ input: input.task,
29
+ parentConversationId: request.conversationId,
30
+ ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : {},
31
+ source: request.routing.source
32
+ },
33
+ { ...options, queue }
34
+ );
35
+ return { invocationId: invocation.invocationId };
36
+ };
37
+ }
38
+
39
+ export {
40
+ bindSpawnAgent
41
+ };
@@ -0,0 +1,55 @@
1
+ // src/chat/conversations/turn-lifecycle.ts
2
+ var ConversationTurnLifecycleService = class {
3
+ constructor(events) {
4
+ this.events = events;
5
+ }
6
+ events;
7
+ /** Record the turn start once after every input message is durable. */
8
+ async start(input) {
9
+ await this.events.append(input.conversationId, [
10
+ {
11
+ idempotencyKey: `turn:${input.turnId}:started`,
12
+ createdAtMs: input.createdAtMs,
13
+ data: {
14
+ type: "turn_started",
15
+ turnId: input.turnId,
16
+ inputMessageIds: input.inputMessageIds,
17
+ surface: input.surface
18
+ }
19
+ }
20
+ ]);
21
+ }
22
+ /** Record successful or intentional-silence completion once. */
23
+ async complete(input) {
24
+ await this.events.append(input.conversationId, [
25
+ {
26
+ idempotencyKey: `turn:${input.turnId}:terminal`,
27
+ createdAtMs: input.createdAtMs,
28
+ data: {
29
+ type: "turn_completed",
30
+ turnId: input.turnId,
31
+ outcome: input.outcome
32
+ }
33
+ }
34
+ ]);
35
+ }
36
+ /** Record a classified failure once without accepting raw error details. */
37
+ async fail(input) {
38
+ await this.events.append(input.conversationId, [
39
+ {
40
+ idempotencyKey: `turn:${input.turnId}:terminal`,
41
+ createdAtMs: input.createdAtMs,
42
+ data: {
43
+ type: "turn_failed",
44
+ turnId: input.turnId,
45
+ failureCode: input.failureCode,
46
+ ...input.eventId ? { eventId: input.eventId } : {}
47
+ }
48
+ }
49
+ ]);
50
+ }
51
+ };
52
+
53
+ export {
54
+ ConversationTurnLifecycleService
55
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-VH6MI4L7.js";
3
+ } from "./chunk-KFRHRSCJ.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -0,0 +1,81 @@
1
+ // src/chat/agent/request.ts
2
+ function isAgentRunFeatureDisabled(policy, feature) {
3
+ return policy?.disabledFeatures?.includes(feature) ?? false;
4
+ }
5
+ var RetryableDeliveryError = class extends Error {
6
+ constructor(cause) {
7
+ super("Assistant delivery was transient or ambiguous", { cause });
8
+ this.name = "RetryableDeliveryError";
9
+ }
10
+ };
11
+ function actorFromRouting(routing) {
12
+ if (routing.dispatch?.actor) {
13
+ return routing.dispatch.actor;
14
+ }
15
+ if (routing.actor) {
16
+ return routing.actor;
17
+ }
18
+ if (routing.credentialContext && !("type" in routing.credentialContext.actor)) {
19
+ return routing.credentialContext.actor;
20
+ }
21
+ return void 0;
22
+ }
23
+ function assertRunRoutingConsistency(request) {
24
+ const { destination, source } = request.routing;
25
+ if (source.platform !== destination.platform) {
26
+ throw new TypeError("Run source and destination platforms do not match");
27
+ }
28
+ if (source.platform === "slack" && destination.platform === "slack") {
29
+ if (source.teamId !== destination.teamId) {
30
+ throw new TypeError("Slack source and destination teams do not match");
31
+ }
32
+ } else if (source.platform === "local" && destination.platform === "local") {
33
+ if (source.conversationId !== destination.conversationId) {
34
+ throw new TypeError(
35
+ "Local source and destination conversation IDs do not match"
36
+ );
37
+ }
38
+ if (request.routing.surface !== "internal" && destination.conversationId !== request.conversationId) {
39
+ throw new TypeError(
40
+ "Local source, destination, and run conversation IDs do not match"
41
+ );
42
+ }
43
+ }
44
+ const actor = request.routing.dispatch?.actor ?? request.routing.actor;
45
+ if (!actor || actor.platform === "system") {
46
+ return;
47
+ }
48
+ if (actor.platform !== destination.platform) {
49
+ throw new TypeError(
50
+ `Actor platform "${actor.platform}" does not match destination platform "${destination.platform}"`
51
+ );
52
+ }
53
+ if (actor.platform === "slack" && destination.platform === "slack" && actor.teamId !== destination.teamId) {
54
+ throw new TypeError("Slack actor team does not match destination team");
55
+ }
56
+ }
57
+ function toolInvocationDestination(routing) {
58
+ if (routing.destination.platform !== "slack" || !routing.toolChannelId) {
59
+ return routing.destination;
60
+ }
61
+ return {
62
+ platform: "slack",
63
+ teamId: routing.destination.teamId,
64
+ channelId: routing.toolChannelId
65
+ };
66
+ }
67
+ function surfaceFromRouting(routing) {
68
+ if (routing.surface) {
69
+ return routing.surface;
70
+ }
71
+ return routing.source.platform === "slack" ? "slack" : "internal";
72
+ }
73
+
74
+ export {
75
+ isAgentRunFeatureDisabled,
76
+ RetryableDeliveryError,
77
+ actorFromRouting,
78
+ assertRunRoutingConsistency,
79
+ toolInvocationDestination,
80
+ surfaceFromRouting
81
+ };