@sentry/junior 0.174.0 → 0.176.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 (62) hide show
  1. package/dist/{agent-hooks-HBZUWB4D.js → agent-hooks-ZPCHKYXI.js} +13 -12
  2. package/dist/api.js +27 -27
  3. package/dist/app.js +272 -344
  4. package/dist/{catalog-runtime-J3R3LC7Y.js → catalog-runtime-3Z2Y5IP6.js} +5 -5
  5. package/dist/chat/agent-dispatch/heartbeat.d.ts +1 -1
  6. package/dist/chat/agent-dispatch/store.d.ts +3 -16
  7. package/dist/chat/resource-events/catalog.d.ts +2 -0
  8. package/dist/chat/resource-events/notification.d.ts +1 -1
  9. package/dist/chat/resource-events/tool-support.d.ts +4 -0
  10. package/dist/{chunk-47LO5GDT.js → chunk-2N7YRFMW.js} +12 -12
  11. package/dist/{chunk-RL23S5DG.js → chunk-5JB5JJO5.js} +1 -1
  12. package/dist/{chunk-2BNKQSPC.js → chunk-64EGCW34.js} +8 -16
  13. package/dist/{chunk-DIW6IQYK.js → chunk-665JOQEP.js} +6 -6
  14. package/dist/{chunk-WEL4NWRR.js → chunk-6NQJQP7O.js} +5 -5
  15. package/dist/{chunk-5EWBGDW2.js → chunk-AJEZETLT.js} +1 -1
  16. package/dist/{chunk-GWZBBIV6.js → chunk-B65VEBJV.js} +2 -2
  17. package/dist/{chunk-HJFWO72I.js → chunk-B6IOTX7W.js} +1 -1
  18. package/dist/{chunk-T5VGNZ7F.js → chunk-B7U2QBMT.js} +16 -58
  19. package/dist/{chunk-ZBWAXCR3.js → chunk-BNGK2J6X.js} +1 -1
  20. package/dist/{chunk-IYI7RPHU.js → chunk-CI4JX64I.js} +1 -1
  21. package/dist/{chunk-XOXKL2DL.js → chunk-CNC65LIX.js} +1 -1
  22. package/dist/{chunk-4ALVTB7F.js → chunk-COFZR2CO.js} +1 -1
  23. package/dist/{chunk-KIU7RKE5.js → chunk-CTYWFV6L.js} +6 -6
  24. package/dist/{chunk-VZFLAGFK.js → chunk-CUA5SZR5.js} +1 -1
  25. package/dist/{chunk-2E353AHN.js → chunk-DVHYQDGM.js} +1 -1
  26. package/dist/{chunk-BFNNCBTK.js → chunk-FNOLPLXJ.js} +4 -4
  27. package/dist/{chunk-GX2ISGLH.js → chunk-GYRGJVWR.js} +472 -903
  28. package/dist/{chunk-FFUNPZA2.js → chunk-H7KTMGNI.js} +1 -1
  29. package/dist/{chunk-OTAPFODZ.js → chunk-IPOB6IL5.js} +98 -96
  30. package/dist/{chunk-JVORBSUR.js → chunk-JHCAX7XY.js} +3 -3
  31. package/dist/{chunk-BLBKORDG.js → chunk-JIZ3RFER.js} +505 -11
  32. package/dist/{chunk-DRRUFZKZ.js → chunk-KYHHJ6LS.js} +1 -1
  33. package/dist/{chunk-N7Y3T47I.js → chunk-OKXHYVKE.js} +4 -4
  34. package/dist/{chunk-REUKFWLH.js → chunk-PS3ZPRL2.js} +1 -1
  35. package/dist/{chunk-7V25DLCB.js → chunk-Q374NKGS.js} +8 -8
  36. package/dist/{chunk-W6HVH5JJ.js → chunk-RSIHA3XC.js} +5 -5
  37. package/dist/{chunk-Z23POK2V.js → chunk-SBIQ5MZW.js} +1 -1
  38. package/dist/{chunk-WH7F67EN.js → chunk-SGLLADGQ.js} +17 -17
  39. package/dist/{chunk-AJMUVCXW.js → chunk-VUAHVGPY.js} +4 -4
  40. package/dist/{chunk-6FWEUJGH.js → chunk-VVLQGGJJ.js} +1 -1
  41. package/dist/{chunk-OXYAEFKS.js → chunk-Z2YZ6QLG.js} +2 -2
  42. package/dist/cli/chat.js +31 -31
  43. package/dist/cli/check.js +6 -6
  44. package/dist/cli/plugins.js +14 -13
  45. package/dist/cli/snapshot-create.js +10 -10
  46. package/dist/cli/upgrade.js +7 -7
  47. package/dist/{db-6JOWUGLP.js → db-63K2IY36.js} +7 -7
  48. package/dist/instrumentation.js +4 -4
  49. package/dist/nitro.js +2 -2
  50. package/dist/{oauth-callback-server-ZLOKNXOW.js → oauth-callback-server-JZXBDXGO.js} +24 -24
  51. package/dist/{runner-YD4J2GBE.js → runner-3KWZJVK6.js} +16 -16
  52. package/dist/{skills-YMSY2LFN.js → skills-TFQQ3WSE.js} +6 -6
  53. package/dist/spawn-3GVQNWFH.js +37 -0
  54. package/dist/{validation-KAOZ7UHD.js → validation-RKLSF2UH.js} +6 -6
  55. package/dist/version.js +1 -1
  56. package/dist/{work-ILZ3L7AD.js → work-RKDS3J2X.js} +19 -19
  57. package/dist/worker-5RJNDPYW.js +24 -0
  58. package/package.json +4 -4
  59. package/dist/chat/agent-dispatch/signing.d.ts +0 -14
  60. package/dist/handlers/agent-dispatch.d.ts +0 -12
  61. package/dist/spawn-ZVO5IUCR.js +0 -37
  62. package/dist/worker-D34ZL6RU.js +0 -24
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-Z23POK2V.js";
3
+ } from "./chunk-SBIQ5MZW.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,13 +1,11 @@
1
1
  import {
2
- ToolInputError
3
- } from "./chunk-2BNKQSPC.js";
4
- import {
2
+ ToolInputError,
5
3
  canRouteResourceEvents,
6
4
  getPlugins
7
- } from "./chunk-BLBKORDG.js";
5
+ } from "./chunk-JIZ3RFER.js";
8
6
  import {
9
7
  getDb
10
- } from "./chunk-JVORBSUR.js";
8
+ } from "./chunk-JHCAX7XY.js";
11
9
  import {
12
10
  juniorAttachments,
13
11
  juniorConversations,
@@ -15,13 +13,81 @@ import {
15
13
  juniorSchedulerRuns,
16
14
  juniorSchedulerTasks,
17
15
  juniorStats
18
- } from "./chunk-VZFLAGFK.js";
16
+ } from "./chunk-CUA5SZR5.js";
19
17
  import {
20
18
  juniorDestinations
21
19
  } from "./chunk-VFUK3X5B.js";
22
20
  import {
23
21
  logInfo
24
- } from "./chunk-Z23POK2V.js";
22
+ } from "./chunk-SBIQ5MZW.js";
23
+
24
+ // src/chat/resource-events/catalog.ts
25
+ import {
26
+ normalizeResourceEventIdentifier
27
+ } from "@sentry/junior-plugin-api";
28
+ import { z } from "zod";
29
+ function enumSchema(values, unavailableMessage) {
30
+ if (values.length === 0) {
31
+ return z.string().refine(() => false, unavailableMessage);
32
+ }
33
+ return z.enum(values);
34
+ }
35
+ function eventNamespaceSchema(catalog) {
36
+ return enumSchema(
37
+ Object.keys(catalog).sort(),
38
+ "No resource event namespaces are enabled."
39
+ );
40
+ }
41
+ function registeredEventTypeSchema(catalog) {
42
+ return enumSchema(
43
+ [
44
+ ...new Set(
45
+ Object.values(catalog).flatMap(
46
+ (registration) => registration.resourceTypes.flatMap(
47
+ (resourceType) => resourceType.supportedEvents
48
+ )
49
+ )
50
+ )
51
+ ].sort(),
52
+ "No resource event types are enabled."
53
+ );
54
+ }
55
+ function registeredResourceTypeSchema(catalog) {
56
+ return enumSchema(
57
+ [
58
+ ...new Set(
59
+ Object.values(catalog).flatMap(
60
+ (registration) => registration.resourceTypes.map((resourceType) => resourceType.type)
61
+ )
62
+ )
63
+ ].sort(),
64
+ "No resource types are enabled."
65
+ );
66
+ }
67
+ function pluginSupportsEvent(catalog, namespace, resourceType, eventType) {
68
+ return catalog[namespace]?.resourceTypes.find((candidate) => candidate.type === resourceType)?.supportedEvents.includes(eventType) ?? false;
69
+ }
70
+ function resourceEventGuidance(catalog, namespace, resourceType, eventType) {
71
+ return catalog[namespace]?.resourceTypes.find(
72
+ (candidate) => candidate.type === resourceType
73
+ )?.guidance?.[eventType];
74
+ }
75
+ function normalizeEventIdentifier(catalog, namespace, identifier) {
76
+ return normalizeResourceEventIdentifier(catalog[namespace], identifier);
77
+ }
78
+
79
+ // src/chat/resource-events/runtime-catalog.ts
80
+ function getResourceEventCatalog() {
81
+ return Object.fromEntries(
82
+ canRouteResourceEvents() ? getPlugins().flatMap((plugin) => {
83
+ const registration = plugin.resourceEvents;
84
+ if (!registration || registration.isEnabled?.() === false) {
85
+ return [];
86
+ }
87
+ return [[plugin.manifest.name, registration]];
88
+ }) : []
89
+ );
90
+ }
25
91
 
26
92
  // src/chat/event-tasks/store.ts
27
93
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -33,28 +99,28 @@ import {
33
99
  slackActorSchema,
34
100
  slackDestinationSchema
35
101
  } from "@sentry/junior-plugin-api";
36
- import { z } from "zod";
102
+ import { z as z2 } from "zod";
37
103
  var EVENT_TASK_IDENTIFIER_MAX_LENGTH = 300;
38
- var eventTaskPrincipalSchema = z.object({
104
+ var eventTaskPrincipalSchema = z2.object({
39
105
  slackUserId: slackActorSchema.shape.userId,
40
- fullName: z.string().optional(),
41
- userName: z.string().optional()
106
+ fullName: z2.string().optional(),
107
+ userName: z2.string().optional()
42
108
  }).strict();
43
- var eventTaskTriggerSchema = z.object({
44
- events: z.array(resourceEventTypeSchema).min(1),
45
- label: z.string().min(1),
46
- namespace: z.string().min(1),
47
- identifier: z.string().min(1).max(EVENT_TASK_IDENTIFIER_MAX_LENGTH),
48
- resourceType: z.string().min(1)
109
+ var eventTaskTriggerSchema = z2.object({
110
+ events: z2.array(resourceEventTypeSchema).min(1),
111
+ label: z2.string().min(1),
112
+ namespace: z2.string().min(1),
113
+ identifier: z2.string().min(1).max(EVENT_TASK_IDENTIFIER_MAX_LENGTH),
114
+ resourceType: z2.string().min(1)
49
115
  }).strict();
50
- var eventTaskSchema = z.object({
51
- id: z.string().min(1),
52
- createdAtMs: z.number().finite(),
116
+ var eventTaskSchema = z2.object({
117
+ id: z2.string().min(1),
118
+ createdAtMs: z2.number().finite(),
53
119
  createdBy: eventTaskPrincipalSchema,
54
- credentialMode: z.enum(["system", "creator"]),
120
+ credentialMode: z2.enum(["system", "creator"]),
55
121
  destination: slackDestinationSchema,
56
122
  destinationVisibility: destinationVisibilitySchema,
57
- task: z.object({ text: z.string().min(1) }).strict(),
123
+ task: z2.object({ text: z2.string().min(1) }).strict(),
58
124
  trigger: eventTaskTriggerSchema
59
125
  }).strict();
60
126
 
@@ -188,19 +254,19 @@ async function readStats(start, end) {
188
254
  }
189
255
 
190
256
  // src/chat/tool-support/structured-result.ts
191
- import { z as z2 } from "zod";
192
- var juniorToolContinuationSchema = z2.object({
193
- arguments: z2.record(z2.string(), z2.unknown()),
194
- reason: z2.string().min(1).optional()
257
+ import { z as z3 } from "zod";
258
+ var juniorToolContinuationSchema = z3.object({
259
+ arguments: z3.record(z3.string(), z3.unknown()),
260
+ reason: z3.string().min(1).optional()
195
261
  }).strict();
196
262
  var juniorToolBoundContinuationSchema = juniorToolContinuationSchema.extend({
197
- tool_name: z2.string().min(1)
263
+ tool_name: z3.string().min(1)
198
264
  });
199
- var juniorToolOutputSchema = z2.object({
200
- target: z2.string().min(1).optional(),
201
- truncated: z2.boolean().optional(),
265
+ var juniorToolOutputSchema = z3.object({
266
+ target: z3.string().min(1).optional(),
267
+ truncated: z3.boolean().optional(),
202
268
  /** True when this attempt did not finish before its time budget. */
203
- timed_out: z2.boolean().optional(),
269
+ timed_out: z3.boolean().optional(),
204
270
  continuation: juniorToolContinuationSchema.optional()
205
271
  }).passthrough();
206
272
  function sortJsonValue(value) {
@@ -242,73 +308,8 @@ function makeStructuredToolOutput(details, options = {}) {
242
308
  };
243
309
  }
244
310
 
245
- // src/chat/resource-events/runtime-catalog.ts
246
- function getResourceEventCatalog() {
247
- return Object.fromEntries(
248
- canRouteResourceEvents() ? getPlugins().flatMap((plugin) => {
249
- const registration = plugin.resourceEvents;
250
- if (!registration || registration.isEnabled?.() === false) {
251
- return [];
252
- }
253
- return [[plugin.manifest.name, registration]];
254
- }) : []
255
- );
256
- }
257
-
258
311
  // src/chat/event-tasks/tool-support.ts
259
312
  import { z as z4 } from "zod";
260
-
261
- // src/chat/resource-events/catalog.ts
262
- import {
263
- normalizeResourceEventIdentifier
264
- } from "@sentry/junior-plugin-api";
265
- import { z as z3 } from "zod";
266
- function enumSchema(values, unavailableMessage) {
267
- if (values.length === 0) {
268
- return z3.string().refine(() => false, unavailableMessage);
269
- }
270
- return z3.enum(values);
271
- }
272
- function eventNamespaceSchema(catalog) {
273
- return enumSchema(
274
- Object.keys(catalog).sort(),
275
- "No resource event namespaces are enabled."
276
- );
277
- }
278
- function registeredEventTypeSchema(catalog) {
279
- return enumSchema(
280
- [
281
- ...new Set(
282
- Object.values(catalog).flatMap(
283
- (registration) => registration.resourceTypes.flatMap(
284
- (resourceType) => resourceType.supportedEvents
285
- )
286
- )
287
- )
288
- ].sort(),
289
- "No resource event types are enabled."
290
- );
291
- }
292
- function registeredResourceTypeSchema(catalog) {
293
- return enumSchema(
294
- [
295
- ...new Set(
296
- Object.values(catalog).flatMap(
297
- (registration) => registration.resourceTypes.map((resourceType) => resourceType.type)
298
- )
299
- )
300
- ].sort(),
301
- "No resource types are enabled."
302
- );
303
- }
304
- function pluginSupportsEvent(catalog, namespace, resourceType, eventType) {
305
- return catalog[namespace]?.resourceTypes.find((candidate) => candidate.type === resourceType)?.supportedEvents.includes(eventType) ?? false;
306
- }
307
- function normalizeEventIdentifier(catalog, namespace, identifier) {
308
- return normalizeResourceEventIdentifier(catalog[namespace], identifier);
309
- }
310
-
311
- // src/chat/event-tasks/tool-support.ts
312
313
  var compactEventTaskResultSchema = z4.object({
313
314
  id: z4.string().min(1),
314
315
  task: z4.string().min(1),
@@ -1903,6 +1904,7 @@ export {
1903
1904
  registeredEventTypeSchema,
1904
1905
  registeredResourceTypeSchema,
1905
1906
  pluginSupportsEvent,
1907
+ resourceEventGuidance,
1906
1908
  normalizeEventIdentifier,
1907
1909
  getResourceEventCatalog,
1908
1910
  getEventTask,
@@ -7,12 +7,12 @@ import {
7
7
  juniorConversations,
8
8
  juniorIdentities,
9
9
  juniorUsers
10
- } from "./chunk-VZFLAGFK.js";
10
+ } from "./chunk-CUA5SZR5.js";
11
11
  import {
12
12
  TURN_REASONING_LEVELS,
13
13
  getChatConfig,
14
14
  modelProfileSchema
15
- } from "./chunk-OXYAEFKS.js";
15
+ } from "./chunk-Z2YZ6QLG.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-M63DETLL.js";
24
24
  import {
25
25
  normalizeIdentityEmail
26
- } from "./chunk-Z23POK2V.js";
26
+ } from "./chunk-SBIQ5MZW.js";
27
27
 
28
28
  // src/chat/conversations/sql/store.ts
29
29
  import { randomUUID as randomUUID2 } from "crypto";