@sentry/junior 0.133.0 → 0.135.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 (69) hide show
  1. package/dist/{agent-hooks-5BUIXVIX.js → agent-hooks-EMXDAD2K.js} +9 -9
  2. package/dist/api/schema/task.d.ts +36 -0
  3. package/dist/api/schema.d.ts +1 -1
  4. package/dist/api/schema.js +1 -1
  5. package/dist/api.js +39 -20
  6. package/dist/app.js +46 -24
  7. package/dist/{catalog-runtime-VGB3DWXZ.js → catalog-runtime-NVPT6HA5.js} +5 -5
  8. package/dist/chat/agent/prompt.d.ts +7 -5
  9. package/dist/chat/agent/repository-context.d.ts +20 -0
  10. package/dist/chat/agent/sandbox.d.ts +8 -0
  11. package/dist/chat/agent/tools.d.ts +3 -0
  12. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  13. package/dist/chat/repository-instructions.d.ts +44 -0
  14. package/dist/chat/sandbox/noninteractive-command.d.ts +2 -0
  15. package/dist/chat/sandbox/sandbox.d.ts +3 -0
  16. package/dist/chat/sandbox/session.d.ts +1 -0
  17. package/dist/chat/services/context-compaction.d.ts +1 -0
  18. package/dist/chat/slack/tools/user-lookup.d.ts +2 -6
  19. package/dist/chat/tasks/execution-stats.d.ts +28 -0
  20. package/dist/chat/tools/index.d.ts +2 -0
  21. package/dist/chat/tools/sandbox/bash.d.ts +1 -0
  22. package/dist/chat/tools/system-time.d.ts +11 -1
  23. package/dist/{chunk-XTQGVNM3.js → chunk-45DPXMI3.js} +6 -12
  24. package/dist/{chunk-TU7P77FI.js → chunk-5EX36ZCD.js} +12 -12
  25. package/dist/{chunk-VL7OYSHD.js → chunk-5LD6EBH2.js} +1 -1
  26. package/dist/{chunk-HJ4KDO4N.js → chunk-6UNZ5DHG.js} +1 -1
  27. package/dist/{chunk-IVTHTAVK.js → chunk-AGAHACF7.js} +2 -2
  28. package/dist/{chunk-HX236W2U.js → chunk-CDQ4YIZM.js} +9 -0
  29. package/dist/{chunk-5ZAZHLIW.js → chunk-EBRB6ZBF.js} +1 -1
  30. package/dist/{chunk-VQA25AL4.js → chunk-EJT7EPP3.js} +6 -6
  31. package/dist/{chunk-FX6BLEDP.js → chunk-HDGTBCQR.js} +1 -1
  32. package/dist/{chunk-AH5HTUYX.js → chunk-IRTIVX42.js} +1 -1
  33. package/dist/{chunk-ECUILEUX.js → chunk-NGX2V4WY.js} +430 -29
  34. package/dist/{chunk-TBVS7GBE.js → chunk-OSCF2BDE.js} +9 -8
  35. package/dist/{chunk-HTGXUNEC.js → chunk-P2D7IW57.js} +7 -7
  36. package/dist/{chunk-EJRJWBKG.js → chunk-QQCEMMVN.js} +1 -1
  37. package/dist/{chunk-LDRO4OQ4.js → chunk-RMI6OX52.js} +2 -2
  38. package/dist/{chunk-QVEXYYFM.js → chunk-TRZSM67C.js} +11 -1
  39. package/dist/{chunk-TLN54TOQ.js → chunk-TYEDZVRM.js} +32 -32
  40. package/dist/{chunk-QWGZ273D.js → chunk-U37P4IIP.js} +81 -27
  41. package/dist/{chunk-JLN4XSPR.js → chunk-UXYZPEWP.js} +1 -1
  42. package/dist/{chunk-LNYNTR27.js → chunk-VZEKCQLD.js} +3 -3
  43. package/dist/{chunk-T5FPIBU2.js → chunk-Y6627MTY.js} +788 -674
  44. package/dist/{chunk-IKO5LFIU.js → chunk-YPKPXLMS.js} +1 -1
  45. package/dist/chunk-Z67KVHMJ.js +233 -0
  46. package/dist/{chunk-WHEMUEXT.js → chunk-ZBQIA5NI.js} +8 -6
  47. package/dist/cli/chat.js +25 -25
  48. package/dist/cli/check.js +6 -6
  49. package/dist/cli/init.js +0 -1
  50. package/dist/cli/plugins.js +12 -12
  51. package/dist/cli/snapshot-create.js +9 -9
  52. package/dist/cli/upgrade.js +7 -7
  53. package/dist/db/schema/task-executions.d.ts +110 -0
  54. package/dist/db/schema.d.ts +111 -1
  55. package/dist/{db-RICMPUFT.js → db-UA6OFL25.js} +7 -7
  56. package/dist/instrumentation.js +4 -4
  57. package/dist/nitro.js +2 -2
  58. package/dist/{oauth-callback-server-YFVS4SAX.js → oauth-callback-server-IJDYBSTX.js} +18 -18
  59. package/dist/{runner-A3LVGZR6.js → runner-K6GID4HN.js} +12 -12
  60. package/dist/{skills-P7Q6Z6PN.js → skills-KJVS753I.js} +6 -6
  61. package/dist/{validation-RYHOWBET.js → validation-7VDJGK7K.js} +6 -6
  62. package/dist/version.js +1 -1
  63. package/migrations/0019_lowly_valkyrie.sql +14 -0
  64. package/migrations/0020_restrict_task_execution_kinds.sql +2 -0
  65. package/migrations/meta/0019_snapshot.json +1904 -0
  66. package/migrations/meta/0020_snapshot.json +1848 -0
  67. package/migrations/meta/_journal.json +15 -1
  68. package/package.json +4 -4
  69. package/dist/chunk-V365UVCU.js +0 -115
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-VL7OYSHD.js";
6
+ } from "./chunk-5LD6EBH2.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-EJRJWBKG.js";
14
+ } from "./chunk-QQCEMMVN.js";
15
15
 
16
16
  // src/chat/config.ts
17
17
  import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
@@ -604,7 +604,11 @@ var taskSummaryBaseSchema = z7.object({
604
604
  destination: taskDestinationSchema,
605
605
  id: z7.string().min(1),
606
606
  instruction: z7.string().min(1),
607
- ownedByViewer: z7.boolean()
607
+ lastConversationId: z7.string().min(1).optional(),
608
+ lastRunAt: z7.string().datetime().optional(),
609
+ ownedByViewer: z7.boolean(),
610
+ runsLast7Days: z7.number().int().nonnegative(),
611
+ totalRuns: z7.number().int().nonnegative()
608
612
  });
609
613
  var scheduledTaskSummarySchema = taskSummaryBaseSchema.extend({
610
614
  kind: z7.literal("scheduled"),
@@ -623,7 +627,13 @@ var taskSummarySchema = z7.discriminatedUnion("kind", [
623
627
  scheduledTaskSummarySchema,
624
628
  eventTaskSummarySchema
625
629
  ]);
630
+ var taskExecutionDaySchema = z7.object({
631
+ date: z7.string().min(1),
632
+ event: z7.number().int().nonnegative(),
633
+ scheduled: z7.number().int().nonnegative()
634
+ }).strict();
626
635
  var taskListSchema = z7.object({
636
+ executionDays: z7.array(taskExecutionDaySchema),
627
637
  tasks: z7.array(taskSummarySchema),
628
638
  truncated: z7.boolean()
629
639
  }).strict();
@@ -1,6 +1,31 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-LDRO4OQ4.js";
3
+ } from "./chunk-RMI6OX52.js";
4
+
5
+ // src/chat/sandbox/paths.ts
6
+ function normalizeWorkspaceRoot(input) {
7
+ const candidate = (input ?? "").trim();
8
+ if (!candidate) {
9
+ return "/vercel/sandbox";
10
+ }
11
+ const normalized = candidate.replace(/\/+$/, "");
12
+ return normalized.startsWith("/") ? normalized : `/${normalized}`;
13
+ }
14
+ var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
15
+ process.env.VERCEL_SANDBOX_WORKSPACE_DIR
16
+ );
17
+ var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
18
+ var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
19
+ function sandboxSkillDir(skillName) {
20
+ return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
21
+ }
22
+ function sandboxSkillFile(skillName) {
23
+ return `${sandboxSkillDir(skillName)}/SKILL.md`;
24
+ }
25
+ function sandboxSkillPathResolution(skillName) {
26
+ const skillDir = sandboxSkillDir(skillName);
27
+ return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
28
+ }
4
29
 
5
30
  // src/chat/state/adapter.ts
6
31
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -271,31 +296,6 @@ async function disconnectStateAdapter() {
271
296
  }
272
297
  }
273
298
 
274
- // src/chat/sandbox/paths.ts
275
- function normalizeWorkspaceRoot(input) {
276
- const candidate = (input ?? "").trim();
277
- if (!candidate) {
278
- return "/vercel/sandbox";
279
- }
280
- const normalized = candidate.replace(/\/+$/, "");
281
- return normalized.startsWith("/") ? normalized : `/${normalized}`;
282
- }
283
- var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
284
- process.env.VERCEL_SANDBOX_WORKSPACE_DIR
285
- );
286
- var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
287
- var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
288
- function sandboxSkillDir(skillName) {
289
- return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
290
- }
291
- function sandboxSkillFile(skillName) {
292
- return `${sandboxSkillDir(skillName)}/SKILL.md`;
293
- }
294
- function sandboxSkillPathResolution(skillName) {
295
- const skillDir = sandboxSkillDir(skillName);
296
- return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
297
- }
298
-
299
299
  // src/chat/sleep.ts
300
300
  function sleep(ms, signal) {
301
301
  if (!signal) {
@@ -319,15 +319,15 @@ function sleep(ms, signal) {
319
319
  }
320
320
 
321
321
  export {
322
- acquireActiveLock,
323
- getDefaultRedisStateAdapterFor,
324
- getStateAdapter,
325
- disconnectStateAdapter,
326
- sleep,
327
322
  SANDBOX_WORKSPACE_ROOT,
328
323
  SANDBOX_SKILLS_ROOT,
329
324
  SANDBOX_DATA_ROOT,
330
325
  sandboxSkillDir,
331
326
  sandboxSkillFile,
332
- sandboxSkillPathResolution
327
+ sandboxSkillPathResolution,
328
+ acquireActiveLock,
329
+ getDefaultRedisStateAdapterFor,
330
+ getStateAdapter,
331
+ disconnectStateAdapter,
332
+ sleep
333
333
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-LDRO4OQ4.js";
3
+ } from "./chunk-RMI6OX52.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -351,54 +351,106 @@ var juniorStats = pgTable9(
351
351
  ]
352
352
  );
353
353
 
354
- // src/db/schema/scheduled-tasks.ts
354
+ // src/db/schema/task-executions.ts
355
355
  import { sql as sql4 } from "drizzle-orm";
356
- import { bigint as bigint2, index as index7, jsonb as jsonb6, pgTable as pgTable10, text as text10 } from "drizzle-orm/pg-core";
357
- var juniorSchedulerTasks = pgTable10(
356
+ import {
357
+ bigint as bigint2,
358
+ check,
359
+ foreignKey as foreignKey3,
360
+ index as index7,
361
+ pgTable as pgTable10,
362
+ primaryKey as primaryKey5,
363
+ text as text10
364
+ } from "drizzle-orm/pg-core";
365
+ var juniorTaskExecutions = pgTable10(
366
+ "junior_task_executions",
367
+ {
368
+ executionId: text10("execution_id").notNull(),
369
+ kind: text10("kind").notNull(),
370
+ namespace: text10("namespace").notNull(),
371
+ taskId: text10("task_id").notNull(),
372
+ conversationId: text10("conversation_id").notNull(),
373
+ executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull()
374
+ },
375
+ (table) => [
376
+ check(
377
+ "junior_task_executions_kind_check",
378
+ sql4`${table.kind} in ('scheduled', 'event')`
379
+ ),
380
+ primaryKey5({
381
+ name: "junior_task_executions_kind_namespace_execution_id_pk",
382
+ columns: [table.kind, table.namespace, table.executionId]
383
+ }),
384
+ foreignKey3({
385
+ name: "junior_task_executions_conversation_id_junior_conversations_conversation_id_fk",
386
+ columns: [table.conversationId],
387
+ foreignColumns: [juniorConversations.conversationId]
388
+ }),
389
+ index7("junior_task_executions_task_time_idx").on(
390
+ table.kind,
391
+ table.namespace,
392
+ table.taskId,
393
+ table.executedAtMs
394
+ ),
395
+ index7("junior_task_executions_time_kind_idx").on(
396
+ table.executedAtMs,
397
+ table.kind
398
+ ),
399
+ index7("junior_task_executions_conversation_time_idx").on(
400
+ table.conversationId,
401
+ table.executedAtMs
402
+ )
403
+ ]
404
+ );
405
+
406
+ // src/db/schema/scheduled-tasks.ts
407
+ import { sql as sql5 } from "drizzle-orm";
408
+ import { bigint as bigint3, index as index8, jsonb as jsonb6, pgTable as pgTable11, text as text11 } from "drizzle-orm/pg-core";
409
+ var juniorSchedulerTasks = pgTable11(
358
410
  "junior_scheduler_tasks",
359
411
  {
360
- id: text10("id").primaryKey(),
361
- teamId: text10("team_id").notNull(),
412
+ id: text11("id").primaryKey(),
413
+ teamId: text11("team_id").notNull(),
362
414
  // TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
363
- creatorSlackUserId: text10("creator_slack_user_id"),
364
- creatorIdentityId: text10("creator_identity_id"),
365
- status: text10("status").notNull(),
366
- nextRunAtMs: bigint2("next_run_at_ms", { mode: "number" }),
367
- runNowAtMs: bigint2("run_now_at_ms", { mode: "number" }),
368
- createdAtMs: bigint2("created_at_ms", { mode: "number" }).notNull(),
415
+ creatorSlackUserId: text11("creator_slack_user_id"),
416
+ creatorIdentityId: text11("creator_identity_id"),
417
+ status: text11("status").notNull(),
418
+ nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
419
+ runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
420
+ createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
369
421
  record: jsonb6("record").$type().notNull()
370
422
  },
371
423
  (table) => [
372
424
  // TODO(v0.128.0): Remove with creatorSlackUserId.
373
- index7("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql4`${table.status} <> 'deleted'`),
374
- index7("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
375
- sql4`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
425
+ index8("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
426
+ index8("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
427
+ sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
376
428
  ),
377
- index7("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql4`${table.status} <> 'deleted'`),
378
- index7("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
379
- sql4`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
429
+ index8("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
430
+ index8("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
431
+ sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
380
432
  ),
381
- index7("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
382
- sql4`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
433
+ index8("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
434
+ sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
383
435
  )
384
436
  ]
385
437
  );
386
- var juniorSchedulerRuns = pgTable10(
438
+ var juniorSchedulerRuns = pgTable11(
387
439
  "junior_scheduler_runs",
388
440
  {
389
- id: text10("id").primaryKey(),
390
- taskId: text10("task_id").notNull(),
391
- status: text10("status").notNull(),
392
- scheduledForMs: bigint2("scheduled_for_ms", { mode: "number" }).notNull(),
441
+ id: text11("id").primaryKey(),
442
+ taskId: text11("task_id").notNull(),
443
+ status: text11("status").notNull(),
444
+ scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
393
445
  record: jsonb6("record").$type().notNull()
394
446
  },
395
447
  (table) => [
396
- index7("junior_scheduler_runs_task_status_idx").on(
448
+ index8("junior_scheduler_runs_task_status_idx").on(
397
449
  table.taskId,
398
450
  table.status,
399
451
  table.scheduledForMs
400
452
  ),
401
- index7("junior_scheduler_runs_status_idx").on(
453
+ index8("junior_scheduler_runs_status_idx").on(
402
454
  table.status,
403
455
  table.scheduledForMs
404
456
  )
@@ -416,6 +468,7 @@ var juniorSqlSchema = {
416
468
  juniorEventTasks,
417
469
  juniorIdentities,
418
470
  juniorStats,
471
+ juniorTaskExecutions,
419
472
  juniorSchedulerRuns,
420
473
  juniorSchedulerTasks,
421
474
  juniorUsers
@@ -680,6 +733,7 @@ export {
680
733
  juniorConversationBindings,
681
734
  juniorEventTasks,
682
735
  juniorStats,
736
+ juniorTaskExecutions,
683
737
  juniorSchedulerTasks,
684
738
  juniorSchedulerRuns,
685
739
  createJuniorSqlExecutor
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-HJ4KDO4N.js";
3
+ } from "./chunk-6UNZ5DHG.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -5,12 +5,12 @@ import {
5
5
  juniorConversations,
6
6
  juniorIdentities,
7
7
  juniorUsers
8
- } from "./chunk-QWGZ273D.js";
8
+ } from "./chunk-U37P4IIP.js";
9
9
  import {
10
10
  TURN_REASONING_LEVELS,
11
11
  getChatConfig,
12
12
  modelProfileSchema
13
- } from "./chunk-LDRO4OQ4.js";
13
+ } from "./chunk-RMI6OX52.js";
14
14
  import {
15
15
  juniorDestinations
16
16
  } from "./chunk-VFUK3X5B.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-F3B2YJ76.js";
21
21
  import {
22
22
  normalizeIdentityEmail
23
- } from "./chunk-EJRJWBKG.js";
23
+ } from "./chunk-QQCEMMVN.js";
24
24
 
25
25
  // src/chat/conversations/sql/store.ts
26
26
  import { randomUUID as randomUUID2 } from "crypto";