@sentry/junior 0.117.0 → 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 (66) hide show
  1. package/dist/{agent-hooks-5IK4LPLP.js → agent-hooks-J2FB7XD6.js} +8 -10
  2. package/dist/api/schema/stats.d.ts +22 -0
  3. package/dist/api/schema.d.ts +2 -0
  4. package/dist/api/schema.js +7 -3
  5. package/dist/api/stats.d.ts +16 -0
  6. package/dist/api/user-pages/routes.d.ts +4 -0
  7. package/dist/api.js +179 -18
  8. package/dist/app.js +40 -35
  9. package/dist/{catalog-runtime-MTUYW3AA.js → catalog-runtime-UHHLU53I.js} +5 -5
  10. package/dist/chat/agent/prompt.d.ts +4 -2
  11. package/dist/chat/plugins/user-pages.d.ts +15 -0
  12. package/dist/chat/plugins/viewer-actors.d.ts +6 -0
  13. package/dist/chat/prompt.d.ts +1 -2
  14. package/dist/chat/sandbox/paths.d.ts +2 -0
  15. package/dist/chat/sandbox/sandbox.d.ts +3 -1
  16. package/dist/chat/sandbox/workspace.d.ts +1 -0
  17. package/dist/chat/skills.d.ts +1 -2
  18. package/dist/chat/tools/index.d.ts +4 -1
  19. package/dist/chat/tools/sandbox/file-utils.d.ts +11 -0
  20. package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
  21. package/dist/chat/tools/sandbox/grep.d.ts +2 -1
  22. package/dist/{chunk-5O3JDQDG.js → chunk-3LGCVRBQ.js} +1 -1
  23. package/dist/{chunk-WEK3V5RI.js → chunk-3MUSSFMP.js} +17 -19
  24. package/dist/{chunk-KU6ALEJC.js → chunk-3N3FMCKN.js} +30 -2
  25. package/dist/{chunk-FAWBONPC.js → chunk-4LPPH7Y6.js} +5 -7
  26. package/dist/{chunk-W5JEQQEA.js → chunk-4SOQPUF4.js} +1 -1
  27. package/dist/{chunk-LN765Y4N.js → chunk-6BGUAOYP.js} +8 -8
  28. package/dist/{chunk-NHZEUHKH.js → chunk-6K2QE2UI.js} +231 -94
  29. package/dist/{chunk-AKG4TZNH.js → chunk-7GADTCNS.js} +30 -9
  30. package/dist/{chunk-BFIRIZPH.js → chunk-7SM3P4XR.js} +19 -1
  31. package/dist/{chunk-WKU7TY22.js → chunk-FIANEE7Z.js} +3 -1
  32. package/dist/{chunk-RXRQJF7Y.js → chunk-GCGJGSQL.js} +21 -0
  33. package/dist/{chunk-STUI6NIL.js → chunk-GT2ZUALJ.js} +511 -14
  34. package/dist/{chunk-LUMEBOWC.js → chunk-HN6LFYG3.js} +1 -1
  35. package/dist/{chunk-3GE3F4LT.js → chunk-HWUBBHLK.js} +1 -1
  36. package/dist/{chunk-ZRQUQJUV.js → chunk-KC5EE27Y.js} +3 -3
  37. package/dist/chunk-L72GDKSN.js +37 -0
  38. package/dist/{chunk-72Z3HNTQ.js → chunk-MLZFK4KP.js} +1 -1
  39. package/dist/{chunk-27KWTFP6.js → chunk-PJPKHGLG.js} +5 -7
  40. package/dist/{chunk-DS27ZBSP.js → chunk-PWRFTDTY.js} +1 -1
  41. package/dist/{chunk-WUNPRM76.js → chunk-QWCF4RAC.js} +1 -1
  42. package/dist/{chunk-6G45D3YG.js → chunk-S6R23MFB.js} +12 -16
  43. package/dist/{chunk-CU7HTGNI.js → chunk-UXLYAVYL.js} +1 -1
  44. package/dist/cli/chat.js +23 -24
  45. package/dist/cli/check.js +6 -6
  46. package/dist/cli/plugins.js +12 -14
  47. package/dist/cli/snapshot-create.js +8 -9
  48. package/dist/cli/upgrade.js +7 -7
  49. package/dist/db/schema/stats.d.ts +93 -0
  50. package/dist/db/schema.d.ts +94 -1
  51. package/dist/{db-J2ITKS63.js → db-PMRHFSYL.js} +6 -6
  52. package/dist/instrumentation.js +2 -2
  53. package/dist/nitro.js +3 -3
  54. package/dist/{oauth-callback-server-NQYKBT24.js → oauth-callback-server-QJUC7S4X.js} +15 -17
  55. package/dist/{plugins-IUJA4VBU.js → plugins-HW4VWW6G.js} +1 -1
  56. package/dist/{runner-53V5GIQM.js → runner-PZMV6JQW.js} +10 -12
  57. package/dist/{skills-BU3ZMLVB.js → skills-W4JETYSV.js} +6 -6
  58. package/dist/stats.d.ts +18 -0
  59. package/dist/{validation-74EIKKE6.js → validation-IJLNHZSU.js} +6 -6
  60. package/dist/version.js +1 -1
  61. package/migrations/0011_sour_golden_guardian.sql +8 -0
  62. package/migrations/meta/0011_snapshot.json +1195 -0
  63. package/migrations/meta/_journal.json +8 -1
  64. package/package.json +5 -5
  65. package/dist/chunk-4ZNGQH7C.js +0 -25
  66. package/dist/chunk-YRWJ3KEU.js +0 -517
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-CU7HTGNI.js";
3
+ } from "./chunk-UXLYAVYL.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-72Z3HNTQ.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) {
@@ -441,6 +441,22 @@ var createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z6.
441
441
  var personalTokenParamsSchema = z6.object({ id: z6.string().uuid() }).strict();
442
442
  var revokePersonalTokenResponseSchema = z6.object({ revoked: z6.literal(true) }).strict();
443
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
+
444
460
  export {
445
461
  apiErrorSchema,
446
462
  conversationParamsSchema,
@@ -471,5 +487,7 @@ export {
471
487
  createPersonalTokenBodySchema,
472
488
  createdPersonalTokenSchema,
473
489
  personalTokenParamsSchema,
474
- revokePersonalTokenResponseSchema
490
+ revokePersonalTokenResponseSchema,
491
+ statSchema,
492
+ statsReportSchema
475
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
  };