@sentry/junior 0.137.0 → 0.139.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 (103) hide show
  1. package/dist/{agent-hooks-MZOKEP3J.js → agent-hooks-MJXMD7JP.js} +11 -9
  2. package/dist/api/schema/task.d.ts +100 -1
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +9 -1
  5. package/dist/api.js +202 -55
  6. package/dist/app.d.ts +7 -0
  7. package/dist/app.js +601 -1356
  8. package/dist/{catalog-runtime-MD66YLFV.js → catalog-runtime-GCCFYPIK.js} +6 -6
  9. package/dist/chat/agent/request.d.ts +44 -4
  10. package/dist/chat/agent-dispatch/heartbeat.d.ts +5 -0
  11. package/dist/chat/agent-dispatch/types.d.ts +1 -1
  12. package/dist/chat/agent-invocations/errors.d.ts +8 -0
  13. package/dist/chat/agent-invocations/spawn.d.ts +12 -0
  14. package/dist/chat/agent-invocations/store.d.ts +44 -0
  15. package/dist/chat/agent-invocations/types.d.ts +449 -0
  16. package/dist/chat/agent-invocations/work.d.ts +31 -0
  17. package/dist/chat/config.d.ts +1 -0
  18. package/dist/chat/conversations/sql/store.d.ts +8 -0
  19. package/dist/chat/conversations/store.d.ts +7 -0
  20. package/dist/chat/credentials/context.d.ts +14 -0
  21. package/dist/chat/experimental.d.ts +16 -0
  22. package/dist/chat/resource-events/actor.d.ts +23 -0
  23. package/dist/chat/runtime/agent-runner.d.ts +2 -1
  24. package/dist/chat/services/auth-pause.d.ts +0 -1
  25. package/dist/chat/services/mcp-auth-orchestration.d.ts +3 -2
  26. package/dist/chat/services/plugin-auth-orchestration.d.ts +3 -2
  27. package/dist/chat/state/turn-session.d.ts +1 -5
  28. package/dist/chat/task-execution/state.d.ts +23 -11
  29. package/dist/chat/task-execution/store.d.ts +20 -11
  30. package/dist/chat/task-execution/worker.d.ts +2 -2
  31. package/dist/chat/tasks/execution-stats.d.ts +34 -3
  32. package/dist/chat/tasks/read.d.ts +3 -1
  33. package/dist/chat/tools/runtime/spawn-agent.d.ts +31 -0
  34. package/dist/chat/tools/types.d.ts +2 -0
  35. package/dist/{chunk-T6Z5S6PQ.js → chunk-2ECYPYKP.js} +1 -1
  36. package/dist/chunk-3T2JAGRH.js +115 -0
  37. package/dist/chunk-3Y47VMHV.js +6 -0
  38. package/dist/chunk-4V4QIYJH.js +41 -0
  39. package/dist/{chunk-SYCX4DOK.js → chunk-5GSZWRE2.js} +434 -65
  40. package/dist/chunk-5IDFPCON.js +46 -0
  41. package/dist/{chunk-36EG34YI.js → chunk-6OHTDR4F.js} +1 -1
  42. package/dist/chunk-6SU2DT27.js +441 -0
  43. package/dist/{chunk-UG6ZYPBI.js → chunk-75I3UBIL.js} +73 -60
  44. package/dist/chunk-AEQISMMU.js +711 -0
  45. package/dist/{chunk-5PNJMOY5.js → chunk-C2N6MNO4.js} +9 -2
  46. package/dist/{chunk-BZAMASJP.js → chunk-CXH25EL4.js} +2 -2
  47. package/dist/{chunk-K2NCQJKH.js → chunk-DW4PMHNW.js} +3 -3
  48. package/dist/chunk-EM225ITJ.js +56 -0
  49. package/dist/{chunk-UOXATPSI.js → chunk-G52UXKGO.js} +7 -5
  50. package/dist/chunk-GI52BW74.js +207 -0
  51. package/dist/{chunk-3Q342EJJ.js → chunk-GWQSZT4C.js} +2 -2
  52. package/dist/{chunk-EPBBYMNE.js → chunk-HUO3UTAQ.js} +1 -1
  53. package/dist/{chunk-WPPXIAFB.js → chunk-IIESAYDL.js} +17 -434
  54. package/dist/chunk-IUFM5JWV.js +24 -0
  55. package/dist/{chunk-UZQ4VY3M.js → chunk-J3S57AXY.js} +1 -1
  56. package/dist/{chunk-DQXAAVTR.js → chunk-J6EJQCHY.js} +46 -1471
  57. package/dist/{chunk-6ZK6FZIV.js → chunk-KCBZSJRU.js} +6 -27
  58. package/dist/chunk-MQ5RYATN.js +1523 -0
  59. package/dist/{chunk-5G34IEK2.js → chunk-MXTVUV3I.js} +2 -56
  60. package/dist/{chunk-YRPC6MJY.js → chunk-MXVD2BDS.js} +1 -1
  61. package/dist/{chunk-POBSY47Q.js → chunk-PJW6U46K.js} +337 -306
  62. package/dist/chunk-Q6QZTTLS.js +55 -0
  63. package/dist/{chunk-ZFS67WIR.js → chunk-QTBKPZDA.js} +57 -6
  64. package/dist/chunk-R776HKPK.js +81 -0
  65. package/dist/{chunk-77VDLF3Z.js → chunk-RUIXF3YQ.js} +10 -0
  66. package/dist/chunk-U27DSXKB.js +714 -0
  67. package/dist/{chunk-XZ7NPXAB.js → chunk-U7CMWQ7Z.js} +1 -1
  68. package/dist/{chunk-RB4NJKEX.js → chunk-UDBUS533.js} +125 -51
  69. package/dist/chunk-WQRX57EA.js +668 -0
  70. package/dist/chunk-WZH4JV7R.js +320 -0
  71. package/dist/{chunk-HCIVH3JS.js → chunk-YCTDA7BD.js} +28 -0
  72. package/dist/{chunk-YNFERGKP.js → chunk-YGZ2OLXL.js} +1 -1
  73. package/dist/{chunk-EWDSB24B.js → chunk-ZQCGQMF2.js} +16 -776
  74. package/dist/{chunk-KJ4HGRHN.js → chunk-ZYQSPQYR.js} +515 -601
  75. package/dist/cli/chat.js +68 -29
  76. package/dist/cli/check.js +7 -7
  77. package/dist/cli/plugins.js +15 -13
  78. package/dist/cli/snapshot-create.js +11 -10
  79. package/dist/cli/upgrade.js +8 -8
  80. package/dist/conversation-work-KATFHLG3.js +56 -0
  81. package/dist/db/schema/agent-invocations.d.ts +544 -0
  82. package/dist/db/schema/task-executions.d.ts +23 -2
  83. package/dist/db/schema.d.ts +563 -2
  84. package/dist/{db-66E7VDNC.js → db-UXPPGHDF.js} +7 -7
  85. package/dist/experimental-HH6OM6UH.js +13 -0
  86. package/dist/instrumentation.js +4 -4
  87. package/dist/nitro.js +4 -3
  88. package/dist/{oauth-callback-server-7QPD4Q7P.js → oauth-callback-server-4ZYMD5UA.js} +28 -19
  89. package/dist/{runner-L2BKJKOD.js → runner-MZSEONRZ.js} +32 -18
  90. package/dist/{sandbox-egress-signals-A5HWIQH4.js → sandbox-egress-signals-EKPAVWQL.js} +2 -2
  91. package/dist/{skills-HOQ2NSPW.js → skills-IMVPXSQ7.js} +7 -7
  92. package/dist/spawn-S5LSVOCE.js +38 -0
  93. package/dist/{validation-ENHI7S2C.js → validation-ZKCY2BVR.js} +7 -7
  94. package/dist/version.js +1 -1
  95. package/dist/work-GG3XDYRX.js +46 -0
  96. package/dist/worker-23AUELCJ.js +24 -0
  97. package/migrations/0021_first_warhawk.sql +35 -0
  98. package/migrations/0022_task_execution_status.sql +3 -0
  99. package/migrations/meta/0021_snapshot.json +2176 -0
  100. package/migrations/meta/0022_snapshot.json +2186 -0
  101. package/migrations/meta/_journal.json +15 -1
  102. package/package.json +4 -4
  103. package/dist/chunk-6QW2RRQT.js +0 -233
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-UG6ZYPBI.js";
3
+ } from "./chunk-75I3UBIL.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -305,25 +305,89 @@ var juniorConversationBindings = pgTable7(
305
305
  ]
306
306
  );
307
307
 
308
+ // src/db/schema/agent-invocations.ts
309
+ import {
310
+ index as index6,
311
+ jsonb as jsonb5,
312
+ pgTable as pgTable8,
313
+ primaryKey as primaryKey4,
314
+ text as text8,
315
+ uniqueIndex as uniqueIndex5
316
+ } from "drizzle-orm/pg-core";
317
+ var AGENT_INVOCATION_MAILBOX_STATUSES = [
318
+ "pending",
319
+ "appended"
320
+ ];
321
+ var juniorAgentBindings = pgTable8(
322
+ "junior_agent_bindings",
323
+ {
324
+ parentConversationId: text8("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
325
+ name: text8("name").notNull(),
326
+ childConversationId: text8("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
327
+ },
328
+ (table) => [
329
+ primaryKey4({
330
+ columns: [table.parentConversationId, table.name]
331
+ }),
332
+ uniqueIndex5("junior_agent_bindings_child_idx").on(
333
+ table.childConversationId
334
+ )
335
+ ]
336
+ );
337
+ var juniorAgentInvocations = pgTable8(
338
+ "junior_agent_invocations",
339
+ {
340
+ invocationId: text8("invocation_id").primaryKey(),
341
+ parentConversationId: text8("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
342
+ childConversationId: text8("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
343
+ agentName: text8("agent_name"),
344
+ input: text8("input").notNull(),
345
+ actor: jsonb5("actor_json").$type().notNull(),
346
+ credentialContext: jsonb5(
347
+ "credential_context_json"
348
+ ).$type(),
349
+ source: jsonb5("source_json").$type().notNull(),
350
+ destination: jsonb5("destination_json").$type().notNull(),
351
+ destinationVisibility: text8(
352
+ "destination_visibility"
353
+ ).$type(),
354
+ reasoningLevel: text8("reasoning_level").$type(),
355
+ status: text8("status").$type().notNull(),
356
+ mailboxStatus: text8("mailbox_status").$type().notNull(),
357
+ result: text8("result"),
358
+ errorMessage: text8("error_message"),
359
+ createdAt: timestamptz("created_at").notNull(),
360
+ updatedAt: timestamptz("updated_at").notNull(),
361
+ terminalAt: timestamptz("terminal_at")
362
+ },
363
+ (table) => [
364
+ index6("junior_agent_invocations_child_idx").on(table.childConversationId),
365
+ index6("junior_agent_invocations_mailbox_idx").on(
366
+ table.mailboxStatus,
367
+ table.createdAt
368
+ )
369
+ ]
370
+ );
371
+
308
372
  // src/db/schema/event-tasks.ts
309
- import { bigint, index as index6, jsonb as jsonb5, pgTable as pgTable8, text as text8 } from "drizzle-orm/pg-core";
310
- var juniorEventTasks = pgTable8(
373
+ import { bigint, index as index7, jsonb as jsonb6, pgTable as pgTable9, text as text9 } from "drizzle-orm/pg-core";
374
+ var juniorEventTasks = pgTable9(
311
375
  "junior_event_tasks",
312
376
  {
313
- id: text8("id").primaryKey(),
314
- teamId: text8("team_id").notNull(),
315
- namespace: text8("namespace").notNull(),
316
- identifier: text8("identifier").notNull(),
377
+ id: text9("id").primaryKey(),
378
+ teamId: text9("team_id").notNull(),
379
+ namespace: text9("namespace").notNull(),
380
+ identifier: text9("identifier").notNull(),
317
381
  createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
318
- task: jsonb5("task_json").$type().notNull()
382
+ task: jsonb6("task_json").$type().notNull()
319
383
  },
320
384
  (table) => [
321
- index6("junior_event_tasks_team_idx").on(
385
+ index7("junior_event_tasks_team_idx").on(
322
386
  table.teamId,
323
387
  table.createdAtMs,
324
388
  table.id
325
389
  ),
326
- index6("junior_event_tasks_match_idx").on(
390
+ index7("junior_event_tasks_match_idx").on(
327
391
  table.namespace,
328
392
  table.identifier,
329
393
  table.createdAtMs,
@@ -333,18 +397,18 @@ var juniorEventTasks = pgTable8(
333
397
  );
334
398
 
335
399
  // src/db/schema/stats.ts
336
- import { date, integer as integer3, pgTable as pgTable9, primaryKey as primaryKey4, text as text9 } from "drizzle-orm/pg-core";
337
- var juniorStats = pgTable9(
400
+ import { date, integer as integer3, pgTable as pgTable10, primaryKey as primaryKey5, text as text10 } from "drizzle-orm/pg-core";
401
+ var juniorStats = pgTable10(
338
402
  "junior_stats",
339
403
  {
340
404
  date: date("date", { mode: "string" }).notNull(),
341
- namespace: text9("namespace").notNull(),
342
- metric: text9("metric").notNull(),
343
- name: text9("name").notNull(),
405
+ namespace: text10("namespace").notNull(),
406
+ metric: text10("metric").notNull(),
407
+ name: text10("name").notNull(),
344
408
  count: integer3("count").notNull().default(0)
345
409
  },
346
410
  (table) => [
347
- primaryKey4({
411
+ primaryKey5({
348
412
  name: "junior_stats_date_namespace_metric_name_pk",
349
413
  columns: [table.date, table.namespace, table.metric, table.name]
350
414
  })
@@ -357,27 +421,32 @@ import {
357
421
  bigint as bigint2,
358
422
  check,
359
423
  foreignKey as foreignKey3,
360
- index as index7,
361
- pgTable as pgTable10,
362
- primaryKey as primaryKey5,
363
- text as text10
424
+ index as index8,
425
+ pgTable as pgTable11,
426
+ primaryKey as primaryKey6,
427
+ text as text11
364
428
  } from "drizzle-orm/pg-core";
365
- var juniorTaskExecutions = pgTable10(
429
+ var juniorTaskExecutions = pgTable11(
366
430
  "junior_task_executions",
367
431
  {
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()
432
+ executionId: text11("execution_id").notNull(),
433
+ kind: text11("kind").notNull(),
434
+ namespace: text11("namespace").notNull(),
435
+ taskId: text11("task_id").notNull(),
436
+ conversationId: text11("conversation_id"),
437
+ executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull(),
438
+ status: text11("status").$type().notNull()
374
439
  },
375
440
  (table) => [
376
441
  check(
377
442
  "junior_task_executions_kind_check",
378
443
  sql4`${table.kind} in ('scheduled', 'event')`
379
444
  ),
380
- primaryKey5({
445
+ check(
446
+ "junior_task_executions_status_check",
447
+ sql4`${table.status} in ('blocked', 'completed', 'failed')`
448
+ ),
449
+ primaryKey6({
381
450
  name: "junior_task_executions_kind_namespace_execution_id_pk",
382
451
  columns: [table.kind, table.namespace, table.executionId]
383
452
  }),
@@ -386,17 +455,17 @@ var juniorTaskExecutions = pgTable10(
386
455
  columns: [table.conversationId],
387
456
  foreignColumns: [juniorConversations.conversationId]
388
457
  }),
389
- index7("junior_task_executions_task_time_idx").on(
458
+ index8("junior_task_executions_task_time_idx").on(
390
459
  table.kind,
391
460
  table.namespace,
392
461
  table.taskId,
393
462
  table.executedAtMs
394
463
  ),
395
- index7("junior_task_executions_time_kind_idx").on(
464
+ index8("junior_task_executions_time_kind_idx").on(
396
465
  table.executedAtMs,
397
466
  table.kind
398
467
  ),
399
- index7("junior_task_executions_conversation_time_idx").on(
468
+ index8("junior_task_executions_conversation_time_idx").on(
400
469
  table.conversationId,
401
470
  table.executedAtMs
402
471
  )
@@ -405,52 +474,52 @@ var juniorTaskExecutions = pgTable10(
405
474
 
406
475
  // src/db/schema/scheduled-tasks.ts
407
476
  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(
477
+ import { bigint as bigint3, index as index9, jsonb as jsonb7, pgTable as pgTable12, text as text12 } from "drizzle-orm/pg-core";
478
+ var juniorSchedulerTasks = pgTable12(
410
479
  "junior_scheduler_tasks",
411
480
  {
412
- id: text11("id").primaryKey(),
413
- teamId: text11("team_id").notNull(),
481
+ id: text12("id").primaryKey(),
482
+ teamId: text12("team_id").notNull(),
414
483
  // TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
415
- creatorSlackUserId: text11("creator_slack_user_id"),
416
- creatorIdentityId: text11("creator_identity_id"),
417
- status: text11("status").notNull(),
484
+ creatorSlackUserId: text12("creator_slack_user_id"),
485
+ creatorIdentityId: text12("creator_identity_id"),
486
+ status: text12("status").notNull(),
418
487
  nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
419
488
  runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
420
489
  createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
421
- record: jsonb6("record").$type().notNull()
490
+ record: jsonb7("record").$type().notNull()
422
491
  },
423
492
  (table) => [
424
493
  // TODO(v0.128.0): Remove with creatorSlackUserId.
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(
494
+ index9("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
495
+ index9("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
427
496
  sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
428
497
  ),
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(
498
+ index9("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
499
+ index9("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
431
500
  sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
432
501
  ),
433
- index8("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
502
+ index9("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
434
503
  sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
435
504
  )
436
505
  ]
437
506
  );
438
- var juniorSchedulerRuns = pgTable11(
507
+ var juniorSchedulerRuns = pgTable12(
439
508
  "junior_scheduler_runs",
440
509
  {
441
- id: text11("id").primaryKey(),
442
- taskId: text11("task_id").notNull(),
443
- status: text11("status").notNull(),
510
+ id: text12("id").primaryKey(),
511
+ taskId: text12("task_id").notNull(),
512
+ status: text12("status").notNull(),
444
513
  scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
445
- record: jsonb6("record").$type().notNull()
514
+ record: jsonb7("record").$type().notNull()
446
515
  },
447
516
  (table) => [
448
- index8("junior_scheduler_runs_task_status_idx").on(
517
+ index9("junior_scheduler_runs_task_status_idx").on(
449
518
  table.taskId,
450
519
  table.status,
451
520
  table.scheduledForMs
452
521
  ),
453
- index8("junior_scheduler_runs_status_idx").on(
522
+ index9("junior_scheduler_runs_status_idx").on(
454
523
  table.status,
455
524
  table.scheduledForMs
456
525
  )
@@ -461,6 +530,8 @@ var juniorSchedulerRuns = pgTable11(
461
530
  var juniorSqlSchema = {
462
531
  juniorConversationAnnotations,
463
532
  juniorApiTokens,
533
+ juniorAgentBindings,
534
+ juniorAgentInvocations,
464
535
  juniorConversationEvents,
465
536
  juniorConversationBindings,
466
537
  juniorConversations,
@@ -731,6 +802,9 @@ export {
731
802
  juniorApiTokens,
732
803
  juniorConversationEvents,
733
804
  juniorConversationBindings,
805
+ AGENT_INVOCATION_MAILBOX_STATUSES,
806
+ juniorAgentBindings,
807
+ juniorAgentInvocations,
734
808
  juniorEventTasks,
735
809
  juniorStats,
736
810
  juniorTaskExecutions,