@sentry/junior 0.116.1 → 0.118.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 (93) hide show
  1. package/dist/{agent-hooks-GUAAS3XH.js → agent-hooks-J2FB7XD6.js} +8 -10
  2. package/dist/api/conversations/detail.d.ts +7 -0
  3. package/dist/api/conversations/event-list.d.ts +7 -0
  4. package/dist/api/conversations/events.d.ts +1 -1
  5. package/dist/api/schema/conversation.d.ts +28 -0
  6. package/dist/api/schema/stats.d.ts +22 -0
  7. package/dist/api/schema.d.ts +2 -0
  8. package/dist/api/schema.js +7 -3
  9. package/dist/api/stats.d.ts +16 -0
  10. package/dist/api/user-pages/routes.d.ts +4 -0
  11. package/dist/api.js +192 -18
  12. package/dist/app.js +53 -46
  13. package/dist/{catalog-runtime-WMPC4J4U.js → catalog-runtime-UHHLU53I.js} +5 -5
  14. package/dist/chat/agent/prompt.d.ts +6 -2
  15. package/dist/chat/agent/request.d.ts +2 -1
  16. package/dist/chat/agent/resume.d.ts +2 -0
  17. package/dist/chat/agent/tools.d.ts +1 -0
  18. package/dist/chat/conversations/history.d.ts +22 -1
  19. package/dist/chat/conversations/projection.d.ts +6 -0
  20. package/dist/chat/mcp/client.d.ts +4 -0
  21. package/dist/chat/mcp/errors.d.ts +22 -1
  22. package/dist/chat/oauth-response.d.ts +21 -0
  23. package/dist/chat/plugins/prompt.d.ts +9 -0
  24. package/dist/chat/plugins/types.d.ts +2 -21
  25. package/dist/chat/plugins/user-pages.d.ts +15 -0
  26. package/dist/chat/plugins/viewer-actors.d.ts +6 -0
  27. package/dist/chat/prompt.d.ts +1 -2
  28. package/dist/chat/sandbox/paths.d.ts +2 -0
  29. package/dist/chat/sandbox/sandbox.d.ts +3 -1
  30. package/dist/chat/sandbox/snapshot/install.d.ts +6 -0
  31. package/dist/chat/sandbox/snapshot/profile.d.ts +14 -0
  32. package/dist/chat/sandbox/snapshot/resolve.d.ts +22 -0
  33. package/dist/chat/sandbox/snapshot/span.d.ts +2 -0
  34. package/dist/chat/sandbox/workspace.d.ts +1 -0
  35. package/dist/chat/services/context-compaction-marker.d.ts +1 -0
  36. package/dist/chat/services/turn-session-record.d.ts +2 -0
  37. package/dist/chat/skills.d.ts +1 -2
  38. package/dist/chat/state/turn-session.d.ts +2 -0
  39. package/dist/chat/tools/index.d.ts +4 -1
  40. package/dist/chat/tools/query-conversation-events.d.ts +1 -1
  41. package/dist/chat/tools/sandbox/file-utils.d.ts +11 -0
  42. package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
  43. package/dist/chat/tools/sandbox/grep.d.ts +2 -1
  44. package/dist/chat/tools/sandbox/view-image.d.ts +11 -0
  45. package/dist/chat/tools/types.d.ts +7 -0
  46. package/dist/{chunk-XA3VLFPK.js → chunk-3LGCVRBQ.js} +154 -20
  47. package/dist/{chunk-JPKGW6L6.js → chunk-3MUSSFMP.js} +78 -39
  48. package/dist/{chunk-7CSVG54J.js → chunk-3N3FMCKN.js} +30 -2
  49. package/dist/{chunk-VBMMMVVQ.js → chunk-4LPPH7Y6.js} +405 -446
  50. package/dist/{chunk-2YYPXQNQ.js → chunk-4SOQPUF4.js} +1 -1
  51. package/dist/{chunk-H35BDAUS.js → chunk-6BGUAOYP.js} +8 -8
  52. package/dist/{chunk-GDAXWEIJ.js → chunk-6K2QE2UI.js} +731 -424
  53. package/dist/{chunk-DLLW5ITL.js → chunk-7GADTCNS.js} +30 -9
  54. package/dist/{chunk-TC4ZEM2D.js → chunk-7SM3P4XR.js} +28 -1
  55. package/dist/{chunk-WKU7TY22.js → chunk-FIANEE7Z.js} +3 -1
  56. package/dist/{chunk-RXRQJF7Y.js → chunk-GCGJGSQL.js} +21 -0
  57. package/dist/{chunk-ZYHLNTC2.js → chunk-GT2ZUALJ.js} +584 -25
  58. package/dist/{chunk-KNCELO2M.js → chunk-HN6LFYG3.js} +1 -1
  59. package/dist/{chunk-N3C4XCRE.js → chunk-HWUBBHLK.js} +1 -1
  60. package/dist/{chunk-BFYVIOTS.js → chunk-KC5EE27Y.js} +13 -3
  61. package/dist/chunk-L72GDKSN.js +37 -0
  62. package/dist/{chunk-F3SWGSPG.js → chunk-MLZFK4KP.js} +1 -1
  63. package/dist/{chunk-RYFAVWP3.js → chunk-PJPKHGLG.js} +34 -15
  64. package/dist/{chunk-CY7NXM32.js → chunk-PWRFTDTY.js} +4 -2
  65. package/dist/{chunk-WLT72MRP.js → chunk-QWCF4RAC.js} +1 -1
  66. package/dist/{chunk-CGXLCMWI.js → chunk-S6R23MFB.js} +117 -17
  67. package/dist/{chunk-OY2PQQ4P.js → chunk-UXLYAVYL.js} +1 -1
  68. package/dist/cli/chat.js +23 -24
  69. package/dist/cli/check.js +6 -6
  70. package/dist/cli/main.js +1 -1
  71. package/dist/cli/plugins.js +12 -14
  72. package/dist/cli/{snapshot-warmup.js → snapshot-create.js} +17 -20
  73. package/dist/cli/upgrade.js +7 -7
  74. package/dist/db/schema/stats.d.ts +93 -0
  75. package/dist/db/schema.d.ts +94 -1
  76. package/dist/{db-FH4R5ZQ4.js → db-PMRHFSYL.js} +6 -6
  77. package/dist/handlers/oauth-html.d.ts +4 -2
  78. package/dist/instrumentation.js +2 -2
  79. package/dist/nitro.js +3 -3
  80. package/dist/{oauth-callback-server-C2SSJ3FQ.js → oauth-callback-server-QJUC7S4X.js} +15 -17
  81. package/dist/{plugins-IUJA4VBU.js → plugins-HW4VWW6G.js} +1 -1
  82. package/dist/{runner-NAALFIXM.js → runner-PZMV6JQW.js} +10 -12
  83. package/dist/{skills-UN2JXYYF.js → skills-W4JETYSV.js} +6 -6
  84. package/dist/stats.d.ts +18 -0
  85. package/dist/{validation-EEF4ROHR.js → validation-IJLNHZSU.js} +6 -6
  86. package/dist/version.js +1 -1
  87. package/migrations/0011_sour_golden_guardian.sql +8 -0
  88. package/migrations/meta/0011_snapshot.json +1195 -0
  89. package/migrations/meta/_journal.json +8 -1
  90. package/package.json +5 -5
  91. package/dist/chat/sandbox/runtime-dependency-snapshots.d.ts +0 -20
  92. package/dist/chunk-4ZNGQH7C.js +0 -25
  93. package/dist/chunk-FAEALXEH.js +0 -517
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-OY2PQQ4P.js";
3
+ } from "./chunk-UXLYAVYL.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-F3SWGSPG.js";
6
+ } from "./chunk-MLZFK4KP.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-3V7OFJZC.js";
@@ -300,19 +300,41 @@ async function discoverSkills(options) {
300
300
  };
301
301
  return sorted;
302
302
  }
303
+ function isCommonEnvironmentVariable(name) {
304
+ return [
305
+ "HOME",
306
+ "LANG",
307
+ "PATH",
308
+ "PWD",
309
+ "SHELL",
310
+ "TEMP",
311
+ "TERM",
312
+ "TMP",
313
+ "TMPDIR",
314
+ "USER",
315
+ "XDG_CONFIG_HOME"
316
+ ].includes(name.toUpperCase());
317
+ }
303
318
  function parseSkillInvocation(messageText, availableSkills) {
304
319
  const trimmed = messageText.trim();
305
320
  const escapePattern = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
306
- const slashMatch = /(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\s+([\s\S]*))?/i.exec(trimmed);
321
+ const slashMatch = /(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)/i.exec(trimmed);
307
322
  if (slashMatch) {
308
323
  const skillName = slashMatch[1].toLowerCase();
309
324
  if (!availableSkills.some((skill) => skill.name === skillName)) {
310
325
  return null;
311
326
  }
312
- return {
313
- skillName,
314
- args: (slashMatch[2] ?? "").trim()
315
- };
327
+ return { skillName };
328
+ }
329
+ const dollarPattern = /(?:^|\s)\$([a-z0-9]+(?:-[a-z0-9]+)*)/gi;
330
+ for (const match of trimmed.matchAll(dollarPattern)) {
331
+ const skillName = match[1].toLowerCase();
332
+ if (isCommonEnvironmentVariable(skillName)) {
333
+ continue;
334
+ }
335
+ if (availableSkills.some((skill) => skill.name === skillName)) {
336
+ return { skillName };
337
+ }
316
338
  }
317
339
  const namedSkill = availableSkills.find((skill) => {
318
340
  if (skill.disableModelInvocation !== true) {
@@ -333,8 +355,7 @@ function parseSkillInvocation(messageText, availableSkills) {
333
355
  return null;
334
356
  }
335
357
  return {
336
- skillName: namedSkill.name,
337
- args: trimmed
358
+ skillName: namedSkill.name
338
359
  };
339
360
  }
340
361
  function findSkillByName(skillName, available) {
@@ -155,6 +155,14 @@ var conversationReportTurnRoutedEventDataSchema = z2.object({
155
155
  confidence: z2.number().min(0).max(1).optional(),
156
156
  source: z2.enum(["configured", "inherited", "router"])
157
157
  }).strict();
158
+ var conversationReportTurnContextEventDataSchema = z2.object({
159
+ type: z2.literal("turn_context"),
160
+ turnId: z2.string().min(1),
161
+ pluginName: z2.string().min(1),
162
+ kind: z2.string().min(1),
163
+ version: z2.number().int().positive(),
164
+ content: z2.record(z2.string(), z2.unknown())
165
+ }).strict();
158
166
  var conversationReportCompactionEventDataSchema = z2.object({
159
167
  type: z2.literal("compaction"),
160
168
  modelProfile: z2.string().min(1).optional(),
@@ -193,6 +201,7 @@ var conversationReportEventDataSchema = z2.discriminatedUnion("type", [
193
201
  conversationReportMessageHandledEventDataSchema,
194
202
  conversationReportToolCallsEventDataSchema,
195
203
  conversationReportTurnLifecycleEventDataSchema,
204
+ conversationReportTurnContextEventDataSchema,
196
205
  conversationReportTurnRoutedEventDataSchema,
197
206
  conversationReportCompactionEventDataSchema,
198
207
  conversationReportHandoffEventDataSchema,
@@ -432,6 +441,22 @@ var createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z6.
432
441
  var personalTokenParamsSchema = z6.object({ id: z6.string().uuid() }).strict();
433
442
  var revokePersonalTokenResponseSchema = z6.object({ revoked: z6.literal(true) }).strict();
434
443
 
444
+ // src/api/schema/stats.ts
445
+ import { z as z7 } from "zod";
446
+ var statSchema = z7.object({
447
+ count: z7.number().int().nonnegative(),
448
+ date: z7.string(),
449
+ metric: z7.string().min(1),
450
+ name: z7.string().min(1),
451
+ namespace: z7.string().min(1)
452
+ }).strict();
453
+ var statsReportSchema = z7.object({
454
+ generatedAt: z7.string().datetime(),
455
+ stats: z7.array(statSchema),
456
+ windowEnd: z7.string(),
457
+ windowStart: z7.string()
458
+ }).strict();
459
+
435
460
  export {
436
461
  apiErrorSchema,
437
462
  conversationParamsSchema,
@@ -462,5 +487,7 @@ export {
462
487
  createPersonalTokenBodySchema,
463
488
  createdPersonalTokenSchema,
464
489
  personalTokenParamsSchema,
465
- revokePersonalTokenResponseSchema
490
+ revokePersonalTokenResponseSchema,
491
+ statSchema,
492
+ statsReportSchema
466
493
  };
@@ -114,7 +114,9 @@ function pluginCatalogConfigFromEnv(env = process.env) {
114
114
  return packages ? { packages } : void 0;
115
115
  }
116
116
  function pluginRuntimeRegistrationsFromPluginSet(pluginSet) {
117
- return pluginSet?.registrations.filter((plugin) => plugin.hooks || plugin.tasks) ?? [];
117
+ return pluginSet?.registrations.filter(
118
+ (plugin) => plugin.hooks || plugin.tasks || plugin.userPages?.length
119
+ ) ?? [];
118
120
  }
119
121
  function pluginCliRegistrationsFromPluginSet(pluginSet) {
120
122
  return pluginSet?.registrations.filter((plugin) => plugin.cli) ?? [];
@@ -272,6 +272,25 @@ var juniorConversationEvents = pgTable6(
272
272
  ]
273
273
  );
274
274
 
275
+ // src/db/schema/stats.ts
276
+ import { date, integer as integer3, pgTable as pgTable7, primaryKey as primaryKey3, text as text7 } from "drizzle-orm/pg-core";
277
+ var juniorStats = pgTable7(
278
+ "junior_stats",
279
+ {
280
+ date: date("date", { mode: "string" }).notNull(),
281
+ namespace: text7("namespace").notNull(),
282
+ metric: text7("metric").notNull(),
283
+ name: text7("name").notNull(),
284
+ count: integer3("count").notNull().default(0)
285
+ },
286
+ (table) => [
287
+ primaryKey3({
288
+ name: "junior_stats_date_namespace_metric_name_pk",
289
+ columns: [table.date, table.namespace, table.metric, table.name]
290
+ })
291
+ ]
292
+ );
293
+
275
294
  // src/db/schema.ts
276
295
  var juniorSqlSchema = {
277
296
  juniorConversationAnnotations,
@@ -280,6 +299,7 @@ var juniorSqlSchema = {
280
299
  juniorConversations,
281
300
  juniorDestinations,
282
301
  juniorIdentities,
302
+ juniorStats,
283
303
  juniorUsers
284
304
  };
285
305
 
@@ -530,5 +550,6 @@ export {
530
550
  juniorConversationAnnotations,
531
551
  juniorApiTokens,
532
552
  juniorConversationEvents,
553
+ juniorStats,
533
554
  createJuniorSqlExecutor
534
555
  };