@sentry/junior 0.114.0 → 0.115.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 (88) hide show
  1. package/dist/{agent-hooks-WNBUY4OB.js → agent-hooks-4EUUXP2F.js} +12 -11
  2. package/dist/api/conversations/detail.d.ts +2 -0
  3. package/dist/api/conversations/event-list.d.ts +2 -0
  4. package/dist/api/health.d.ts +7 -0
  5. package/dist/api/plugin-reports.d.ts +62 -0
  6. package/dist/api/plugins.d.ts +9 -0
  7. package/dist/api/runtime.d.ts +24 -0
  8. package/dist/api/schema/conversation.d.ts +8 -0
  9. package/dist/api/schema.d.ts +2 -2
  10. package/dist/api/schema.js +6 -6
  11. package/dist/api/skills.d.ts +6 -0
  12. package/dist/api.js +123 -99
  13. package/dist/app.js +1104 -5006
  14. package/dist/catalog-runtime-Y32UEQLB.js +18 -0
  15. package/dist/chat/agent/request.d.ts +6 -0
  16. package/dist/chat/agent/sandbox.d.ts +2 -0
  17. package/dist/chat/agent/tools.d.ts +2 -0
  18. package/dist/chat/config.d.ts +2 -0
  19. package/dist/chat/conversations/history.d.ts +6 -0
  20. package/dist/chat/local/credential-sync.d.ts +5 -0
  21. package/dist/chat/local/oauth-relay.d.ts +4 -0
  22. package/dist/chat/mcp/oauth.d.ts +1 -0
  23. package/dist/chat/oauth-authorization.d.ts +17 -0
  24. package/dist/chat/oauth-flow.d.ts +9 -0
  25. package/dist/chat/sandbox/egress/schemas.d.ts +46 -0
  26. package/dist/chat/sandbox/egress/signals.d.ts +9 -0
  27. package/dist/chat/sandbox/sandbox.d.ts +2 -0
  28. package/dist/chat/sentry-payload-filter.d.ts +4 -4
  29. package/dist/chat/services/mcp-auth-orchestration.d.ts +5 -3
  30. package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -0
  31. package/dist/chat/slack/message-control.d.ts +2 -0
  32. package/dist/chat/slack/oauth-authorization-message.d.ts +3 -0
  33. package/dist/chat/task-execution/slack-work.d.ts +2 -0
  34. package/dist/chat/tool-support/zod-tool.d.ts +1 -1
  35. package/dist/chat/tools/definition.d.ts +5 -0
  36. package/dist/{chunk-TLGM5X2M.js → chunk-2QG4MZQ7.js} +2 -2
  37. package/dist/{chunk-WV4UJBAS.js → chunk-43RYMWJ2.js} +523 -2373
  38. package/dist/chunk-4CODA7P5.js +43 -0
  39. package/dist/{chunk-YU6PO42Q.js → chunk-67CVNDJ7.js} +1 -1
  40. package/dist/{chunk-OSKEC4XU.js → chunk-6FKLPVF3.js} +1 -1
  41. package/dist/{chunk-2ZTTXTSZ.js → chunk-6OPTF4BQ.js} +10 -4
  42. package/dist/{chunk-W6RDUAO3.js → chunk-6V762AB4.js} +1 -1
  43. package/dist/{chunk-ABPSDO6M.js → chunk-AGLQYELI.js} +77 -8
  44. package/dist/{chunk-6QWPVTMO.js → chunk-CEYOL62C.js} +9 -7
  45. package/dist/{chunk-RD7EJI7H.js → chunk-CWEZEPD4.js} +3 -3
  46. package/dist/chunk-DIB4GX3G.js +8 -0
  47. package/dist/{chunk-K2W4CK7K.js → chunk-EW5MLKT5.js} +10 -75
  48. package/dist/{chunk-42WRQLJ6.js → chunk-F3B2YJ76.js} +0 -14
  49. package/dist/chunk-FA6POGLH.js +70 -0
  50. package/dist/{chunk-PM3PX42K.js → chunk-FHC4JUSF.js} +1 -1
  51. package/dist/{chunk-6Y5L4BOM.js → chunk-FXOYURO4.js} +5 -3
  52. package/dist/{chunk-S4QDH23A.js → chunk-G36V2YGB.js} +83 -81
  53. package/dist/{chunk-O4GT7LYB.js → chunk-G5SX4UPR.js} +3 -43
  54. package/dist/chunk-HDSDCEPK.js +80 -0
  55. package/dist/{chunk-FIGAF6KL.js → chunk-HWCQRGLL.js} +5 -3
  56. package/dist/{chunk-C4MZ3GP5.js → chunk-HZF5P5UN.js} +1 -1
  57. package/dist/chunk-LYA2AB5G.js +1914 -0
  58. package/dist/{chunk-4FUEG3QY.js → chunk-NVUQSFWX.js} +2 -2
  59. package/dist/chunk-OB42YVAE.js +16 -0
  60. package/dist/{chunk-XLFBQJUO.js → chunk-PVZHG2XZ.js} +4 -4
  61. package/dist/{chunk-VNNBSKCO.js → chunk-RAVKCKXA.js} +7 -7
  62. package/dist/{chunk-ZGXH3REA.js → chunk-SYJT7AKB.js} +12 -2
  63. package/dist/{chunk-5CZ7RETL.js → chunk-TVE25LPW.js} +1 -1
  64. package/dist/chunk-W3U3YQYI.js +71 -0
  65. package/dist/chunk-YCLO7D7M.js +4267 -0
  66. package/dist/cli/chat.js +72 -40
  67. package/dist/cli/check.js +10 -8
  68. package/dist/cli/init.js +1 -0
  69. package/dist/cli/plugins.js +16 -14
  70. package/dist/cli/snapshot-warmup.js +13 -11
  71. package/dist/cli/upgrade.js +10 -8
  72. package/dist/{db-4VLP7KBF.js → db-KBSJHAZU.js} +8 -7
  73. package/dist/handlers/sandbox-egress-signals.d.ts +4 -0
  74. package/dist/instrumentation.js +72 -4
  75. package/dist/nitro.js +2 -2
  76. package/dist/oauth-callback-server-EYRMJTCS.js +231 -0
  77. package/dist/oauth-relay-3ZU72UGL.js +9 -0
  78. package/dist/reporting-schema.d.ts +12 -4
  79. package/dist/reporting.d.ts +5 -5
  80. package/dist/{runner-IPXLWQOF.js → runner-RQGZ5Z2S.js} +139 -72
  81. package/dist/sandbox-egress-signals-CDFAP67O.js +75 -0
  82. package/dist/{skills-QCNZISNF.js → skills-JJQIE3BT.js} +10 -8
  83. package/dist/validation-MZ47PZP5.js +21 -0
  84. package/dist/version.js +1 -1
  85. package/package.json +5 -5
  86. package/dist/catalog-runtime-6O4M6JGA.js +0 -16
  87. package/dist/chat/oauth-authorization-message.d.ts +0 -6
  88. package/dist/validation-I2BW3UHD.js +0 -19
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  toOptionalNumber,
3
3
  toOptionalString
4
- } from "./chunk-42WRQLJ6.js";
4
+ } from "./chunk-OB42YVAE.js";
5
5
  import {
6
6
  captureException,
7
7
  getActiveSpan,
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-6GWA276C.js";
14
14
  import {
15
15
  getDeploymentTelemetryAttributes
16
- } from "./chunk-5CZ7RETL.js";
16
+ } from "./chunk-TVE25LPW.js";
17
17
 
18
18
  // src/chat/logging.ts
19
19
  import path from "path";
@@ -0,0 +1,16 @@
1
+ // src/chat/coerce.ts
2
+ function toOptionalString(value) {
3
+ return typeof value === "string" && value.trim() ? value : void 0;
4
+ }
5
+ function toOptionalNumber(value) {
6
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
7
+ }
8
+ function isRecord(value) {
9
+ return typeof value === "object" && value !== null;
10
+ }
11
+
12
+ export {
13
+ toOptionalString,
14
+ toOptionalNumber,
15
+ isRecord
16
+ };
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
3
  getStateAdapter
4
- } from "./chunk-YU6PO42Q.js";
4
+ } from "./chunk-67CVNDJ7.js";
5
5
  import {
6
6
  sleep
7
7
  } from "./chunk-4ZNGQH7C.js";
8
8
  import {
9
9
  toOptionalTrimmed
10
- } from "./chunk-ZGXH3REA.js";
10
+ } from "./chunk-SYJT7AKB.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "./chunk-OSKEC4XU.js";
13
+ } from "./chunk-6FKLPVF3.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-4FUEG3QY.js";
18
+ } from "./chunk-NVUQSFWX.js";
19
19
 
20
20
  // src/chat/sandbox/runtime-dependencies.ts
21
21
  var GLOBAL_RUNTIME_DEPENDENCIES = [
@@ -1,36 +1,36 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
3
  getStateAdapter
4
- } from "./chunk-YU6PO42Q.js";
4
+ } from "./chunk-67CVNDJ7.js";
5
5
  import {
6
6
  isConversationChannel,
7
7
  isConversationScopedChannel,
8
8
  isDmChannel,
9
9
  normalizeSlackConversationId
10
- } from "./chunk-RD7EJI7H.js";
10
+ } from "./chunk-CWEZEPD4.js";
11
11
  import {
12
12
  getDb
13
- } from "./chunk-FIGAF6KL.js";
13
+ } from "./chunk-HWCQRGLL.js";
14
14
  import {
15
15
  botConfig,
16
16
  completeObject,
17
17
  embedTexts,
18
18
  standardModelId
19
- } from "./chunk-ZGXH3REA.js";
19
+ } from "./chunk-SYJT7AKB.js";
20
20
  import {
21
21
  isActorUserId,
22
22
  parseActorUserId
23
- } from "./chunk-C4MZ3GP5.js";
23
+ } from "./chunk-HZF5P5UN.js";
24
24
  import {
25
25
  logException,
26
26
  logInfo,
27
27
  logWarn
28
- } from "./chunk-4FUEG3QY.js";
28
+ } from "./chunk-NVUQSFWX.js";
29
29
  import {
30
30
  parseSlackChannelReferenceId,
31
31
  parseSlackMessageTs,
32
32
  parseSlackTeamId
33
- } from "./chunk-42WRQLJ6.js";
33
+ } from "./chunk-F3B2YJ76.js";
34
34
 
35
35
  // src/chat/plugins/agent-hooks.ts
36
36
  import {
@@ -4,7 +4,7 @@ import {
4
4
  toCanonicalInputMessage,
5
5
  toCanonicalOutputMessage,
6
6
  toGenAiMessagesTraceAttributes
7
- } from "./chunk-6Y5L4BOM.js";
7
+ } from "./chunk-FXOYURO4.js";
8
8
  import {
9
9
  extractGenAiUsageAttributes,
10
10
  logException,
@@ -12,7 +12,7 @@ import {
12
12
  normalizeGenAiFinishReason,
13
13
  serializeGenAiAttribute,
14
14
  withSpan
15
- } from "./chunk-4FUEG3QY.js";
15
+ } from "./chunk-NVUQSFWX.js";
16
16
 
17
17
  // src/chat/config.ts
18
18
  import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
@@ -693,6 +693,13 @@ function parseSlashCommand(rawValue) {
693
693
  }
694
694
  return command;
695
695
  }
696
+ function parseCrossActorMidRunMode(rawValue) {
697
+ const value = toOptionalTrimmed(rawValue) ?? "follow_up";
698
+ if (value === "follow_up" || value === "steer") {
699
+ return value;
700
+ }
701
+ throw new Error("JUNIOR_CROSS_ACTOR_MID_RUN_MODE must be follow_up or steer");
702
+ }
696
703
  var DEFAULT_MODEL_ID = getModel2("vercel-ai-gateway", "xai/grok-4.5").id;
697
704
  var DEFAULT_FAST_MODEL_ID = getModel2(
698
705
  "vercel-ai-gateway",
@@ -779,6 +786,9 @@ function readBotConfig(env, functionMaxDurationSeconds) {
779
786
  const handoffModelId = validateGatewayModelId(env.AI_HANDOFF_MODEL) ?? DEFAULT_HANDOFF_MODEL_ID;
780
787
  return {
781
788
  userName: toOptionalTrimmed(env.JUNIOR_BOT_NAME) ?? "junior",
789
+ crossActorMidRunMode: parseCrossActorMidRunMode(
790
+ env.JUNIOR_CROSS_ACTOR_MID_RUN_MODE
791
+ ),
782
792
  profiles: parseProfiles(env.AI_MODEL_PROFILES, modelId, handoffModelId),
783
793
  contextWindowTokens: parseOptionalPositiveInteger(
784
794
  "AI_MODEL_CONTEXT_WINDOW_TOKENS",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-PM3PX42K.js";
3
+ } from "./chunk-FHC4JUSF.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -0,0 +1,71 @@
1
+ import {
2
+ parseActorUserId
3
+ } from "./chunk-HZF5P5UN.js";
4
+
5
+ // src/chat/credentials/context.ts
6
+ import { z } from "zod";
7
+ var exactActorIdSchema = z.string().refine((value) => parseActorUserId(value) === value);
8
+ var exactNonBlankStringSchema = z.string().min(1).refine((value) => value === value.trim());
9
+ var slackDirectCredentialSubjectBindingSchema = z.object({
10
+ type: z.literal("slack-direct-conversation"),
11
+ teamId: z.string().min(1),
12
+ channelId: z.string().min(1),
13
+ signature: z.string().min(1)
14
+ }).strict();
15
+ var scheduledTaskCredentialSubjectBindingSchema = z.object({
16
+ type: z.literal("scheduled-task"),
17
+ plugin: z.string().min(1),
18
+ taskId: exactNonBlankStringSchema,
19
+ signature: z.string().min(1)
20
+ }).strict();
21
+ var credentialSubjectBindingSchema = z.discriminatedUnion("type", [
22
+ slackDirectCredentialSubjectBindingSchema,
23
+ scheduledTaskCredentialSubjectBindingSchema
24
+ ]);
25
+ var credentialUserActorSchema = z.object({
26
+ type: z.literal("user"),
27
+ userId: exactActorIdSchema
28
+ }).strict();
29
+ var credentialSystemActorSchema = z.object({
30
+ platform: z.literal("system"),
31
+ name: exactActorIdSchema
32
+ }).strict();
33
+ var credentialSubjectSchema = z.discriminatedUnion("allowedWhen", [
34
+ z.object({
35
+ type: z.literal("user"),
36
+ userId: exactActorIdSchema,
37
+ allowedWhen: z.literal("private-direct-conversation"),
38
+ binding: slackDirectCredentialSubjectBindingSchema
39
+ }).strict(),
40
+ z.object({
41
+ type: z.literal("user"),
42
+ userId: exactActorIdSchema,
43
+ allowedWhen: z.literal("scheduled-task"),
44
+ taskId: exactNonBlankStringSchema,
45
+ binding: scheduledTaskCredentialSubjectBindingSchema
46
+ }).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
47
+ message: "Scheduled task credential subject requires task binding",
48
+ path: ["binding"]
49
+ })
50
+ ]);
51
+ var credentialContextSchema = z.union([
52
+ z.object({
53
+ actor: credentialUserActorSchema
54
+ }).strict(),
55
+ z.object({
56
+ actor: credentialSystemActorSchema,
57
+ subject: credentialSubjectSchema.optional()
58
+ }).strict()
59
+ ]);
60
+ function credentialUserSubjectId(context) {
61
+ if ("type" in context.actor) {
62
+ return context.actor.userId;
63
+ }
64
+ return "subject" in context ? context.subject?.userId : void 0;
65
+ }
66
+
67
+ export {
68
+ credentialSubjectSchema,
69
+ credentialContextSchema,
70
+ credentialUserSubjectId
71
+ };