@sentry/junior 0.136.1 → 0.138.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-2KDSPPO4.js → agent-hooks-SCR74Q3E.js} +11 -9
  2. package/dist/api/conversations/projection.d.ts +1 -0
  3. package/dist/api/conversations/stats.d.ts +1 -0
  4. package/dist/api/schema/conversation.d.ts +2 -0
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +187 -46
  7. package/dist/app.d.ts +8 -1
  8. package/dist/app.js +519 -860
  9. package/dist/{catalog-runtime-WSZQGC4D.js → catalog-runtime-IU3QF4GG.js} +5 -5
  10. package/dist/chat/agent/request.d.ts +32 -2
  11. package/dist/chat/agent-dispatch/heartbeat.d.ts +5 -0
  12. package/dist/chat/agent-dispatch/types.d.ts +1 -1
  13. package/dist/chat/agent-invocations/errors.d.ts +8 -0
  14. package/dist/chat/agent-invocations/spawn.d.ts +12 -0
  15. package/dist/chat/agent-invocations/store.d.ts +44 -0
  16. package/dist/chat/agent-invocations/types.d.ts +449 -0
  17. package/dist/chat/agent-invocations/work.d.ts +31 -0
  18. package/dist/chat/config.d.ts +1 -0
  19. package/dist/chat/configuration/defaults.d.ts +1 -1
  20. package/dist/chat/conversations/sql/store.d.ts +8 -0
  21. package/dist/chat/conversations/store.d.ts +9 -1
  22. package/dist/chat/experimental.d.ts +16 -0
  23. package/dist/chat/pi/client.d.ts +1 -8
  24. package/dist/chat/pi/gateway-auth.d.ts +16 -0
  25. package/dist/chat/runtime/agent-runner.d.ts +2 -1
  26. package/dist/chat/sandbox/docker.d.ts +17 -0
  27. package/dist/chat/services/agent-continue.d.ts +2 -0
  28. package/dist/chat/services/auth-pause.d.ts +0 -1
  29. package/dist/chat/services/mcp-auth-orchestration.d.ts +3 -2
  30. package/dist/chat/services/plugin-auth-orchestration.d.ts +3 -2
  31. package/dist/chat/services/subscribed-reply-router-policy.d.ts +12 -0
  32. package/dist/chat/services/turn-session-routing.d.ts +17 -0
  33. package/dist/chat/slack/message.d.ts +6 -1
  34. package/dist/chat/slack/source-link.d.ts +8 -2
  35. package/dist/chat/slack/team-domain.d.ts +4 -0
  36. package/dist/chat/source.d.ts +5 -5
  37. package/dist/chat/state/turn-session.d.ts +0 -2
  38. package/dist/chat/task-execution/state.d.ts +23 -11
  39. package/dist/chat/task-execution/store.d.ts +20 -11
  40. package/dist/chat/task-execution/worker.d.ts +2 -2
  41. package/dist/chat/tools/runtime/spawn-agent.d.ts +31 -0
  42. package/dist/chat/tools/types.d.ts +2 -0
  43. package/dist/chunk-3Y47VMHV.js +6 -0
  44. package/dist/chunk-5IDFPCON.js +46 -0
  45. package/dist/chunk-5LTJ4ITU.js +1523 -0
  46. package/dist/{chunk-KLBYCSLJ.js → chunk-5MXWHTCK.js} +17 -434
  47. package/dist/{chunk-CZZDCH3Q.js → chunk-A7WCHXZV.js} +206 -78
  48. package/dist/{chunk-4YQ6I6VF.js → chunk-BOLJOV5T.js} +2 -56
  49. package/dist/{chunk-XCZ6COFO.js → chunk-BYW4B4PR.js} +90 -54
  50. package/dist/{chunk-JQRTXJHD.js → chunk-C7ZVPO4Z.js} +2 -1
  51. package/dist/{chunk-MW2QRPGW.js → chunk-DCLLQGS6.js} +119 -50
  52. package/dist/{chunk-CDVCCOMF.js → chunk-E5UYAIKJ.js} +75 -1475
  53. package/dist/{chunk-3SUK3UXX.js → chunk-ELKW5FIB.js} +5 -5
  54. package/dist/chunk-EM225ITJ.js +56 -0
  55. package/dist/{chunk-Y6JNHTRD.js → chunk-FEUNPTGV.js} +34 -70
  56. package/dist/{chunk-TYNMSQKA.js → chunk-FNLBTB4K.js} +1 -1
  57. package/dist/{chunk-TRZSM67C.js → chunk-HCIVH3JS.js} +1 -0
  58. package/dist/chunk-HIWJWWMT.js +668 -0
  59. package/dist/chunk-IUFM5JWV.js +24 -0
  60. package/dist/{chunk-XWPA5KZF.js → chunk-JNNJZURV.js} +1 -1
  61. package/dist/{chunk-6ZK6FZIV.js → chunk-KCBZSJRU.js} +6 -27
  62. package/dist/{chunk-BG3KWWDJ.js → chunk-KDCHVT25.js} +1 -1
  63. package/dist/{chunk-VH6MI4L7.js → chunk-KFRHRSCJ.js} +1 -1
  64. package/dist/chunk-LPVUNO2W.js +320 -0
  65. package/dist/{chunk-G66RYKRS.js → chunk-N7WARMC6.js} +16 -776
  66. package/dist/chunk-PB3CXNVL.js +41 -0
  67. package/dist/chunk-Q6QZTTLS.js +55 -0
  68. package/dist/{chunk-3QNJOHKG.js → chunk-QS527AV5.js} +1 -1
  69. package/dist/chunk-R776HKPK.js +81 -0
  70. package/dist/{chunk-OTJMQYVP.js → chunk-RZIBSCYC.js} +517 -608
  71. package/dist/chunk-SD3OFRWY.js +714 -0
  72. package/dist/{chunk-HIRIWTWD.js → chunk-SIPKWSXK.js} +58 -10
  73. package/dist/chunk-TCS76X5D.js +441 -0
  74. package/dist/{chunk-UX2TNH5D.js → chunk-TDJCLNDH.js} +3 -3
  75. package/dist/{chunk-NVVBEJUB.js → chunk-TUUDXEXU.js} +336 -300
  76. package/dist/{chunk-22Z6MGMK.js → chunk-VPZFVJND.js} +1 -1
  77. package/dist/{chunk-RFDD3Z2I.js → chunk-YU5QUF67.js} +1 -1
  78. package/dist/chunk-ZBSMCXKV.js +710 -0
  79. package/dist/{chunk-FSYXYBWU.js → chunk-ZXNTJJIE.js} +2 -2
  80. package/dist/cli/chat.js +65 -26
  81. package/dist/cli/check.js +7 -7
  82. package/dist/cli/plugins.js +14 -12
  83. package/dist/cli/snapshot-create.js +10 -9
  84. package/dist/cli/upgrade.js +7 -7
  85. package/dist/conversation-work-KATFHLG3.js +56 -0
  86. package/dist/db/schema/agent-invocations.d.ts +544 -0
  87. package/dist/db/schema.d.ts +543 -1
  88. package/dist/{db-Z2NNL2JC.js → db-UO2IWXGA.js} +7 -7
  89. package/dist/experimental-HH6OM6UH.js +13 -0
  90. package/dist/instrumentation.js +4 -4
  91. package/dist/nitro.js +4 -3
  92. package/dist/{oauth-callback-server-PO3M5JMG.js → oauth-callback-server-MAQI43LX.js} +26 -18
  93. package/dist/{runner-QHQYZYJA.js → runner-PIUQEXKE.js} +26 -14
  94. package/dist/{skills-KXMT3DRA.js → skills-4ARJADHQ.js} +6 -6
  95. package/dist/spawn-G2AWPMCT.js +38 -0
  96. package/dist/{validation-Y42ULTT6.js → validation-S3EE3HWL.js} +6 -6
  97. package/dist/version.js +1 -1
  98. package/dist/work-UARRUAW3.js +46 -0
  99. package/dist/worker-DOCIRVD3.js +24 -0
  100. package/migrations/0021_first_warhawk.sql +35 -0
  101. package/migrations/meta/0021_snapshot.json +2176 -0
  102. package/migrations/meta/_journal.json +8 -1
  103. package/package.json +6 -5
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-XCZ6COFO.js";
3
+ } from "./chunk-BYW4B4PR.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,19 +421,19 @@ 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(),
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").notNull(),
373
437
  executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull()
374
438
  },
375
439
  (table) => [
@@ -377,7 +441,7 @@ var juniorTaskExecutions = pgTable10(
377
441
  "junior_task_executions_kind_check",
378
442
  sql4`${table.kind} in ('scheduled', 'event')`
379
443
  ),
380
- primaryKey5({
444
+ primaryKey6({
381
445
  name: "junior_task_executions_kind_namespace_execution_id_pk",
382
446
  columns: [table.kind, table.namespace, table.executionId]
383
447
  }),
@@ -386,17 +450,17 @@ var juniorTaskExecutions = pgTable10(
386
450
  columns: [table.conversationId],
387
451
  foreignColumns: [juniorConversations.conversationId]
388
452
  }),
389
- index7("junior_task_executions_task_time_idx").on(
453
+ index8("junior_task_executions_task_time_idx").on(
390
454
  table.kind,
391
455
  table.namespace,
392
456
  table.taskId,
393
457
  table.executedAtMs
394
458
  ),
395
- index7("junior_task_executions_time_kind_idx").on(
459
+ index8("junior_task_executions_time_kind_idx").on(
396
460
  table.executedAtMs,
397
461
  table.kind
398
462
  ),
399
- index7("junior_task_executions_conversation_time_idx").on(
463
+ index8("junior_task_executions_conversation_time_idx").on(
400
464
  table.conversationId,
401
465
  table.executedAtMs
402
466
  )
@@ -405,52 +469,52 @@ var juniorTaskExecutions = pgTable10(
405
469
 
406
470
  // src/db/schema/scheduled-tasks.ts
407
471
  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(
472
+ import { bigint as bigint3, index as index9, jsonb as jsonb7, pgTable as pgTable12, text as text12 } from "drizzle-orm/pg-core";
473
+ var juniorSchedulerTasks = pgTable12(
410
474
  "junior_scheduler_tasks",
411
475
  {
412
- id: text11("id").primaryKey(),
413
- teamId: text11("team_id").notNull(),
476
+ id: text12("id").primaryKey(),
477
+ teamId: text12("team_id").notNull(),
414
478
  // 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(),
479
+ creatorSlackUserId: text12("creator_slack_user_id"),
480
+ creatorIdentityId: text12("creator_identity_id"),
481
+ status: text12("status").notNull(),
418
482
  nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
419
483
  runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
420
484
  createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
421
- record: jsonb6("record").$type().notNull()
485
+ record: jsonb7("record").$type().notNull()
422
486
  },
423
487
  (table) => [
424
488
  // 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(
489
+ index9("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
490
+ index9("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
427
491
  sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
428
492
  ),
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(
493
+ index9("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
494
+ index9("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
431
495
  sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
432
496
  ),
433
- index8("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
497
+ index9("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
434
498
  sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
435
499
  )
436
500
  ]
437
501
  );
438
- var juniorSchedulerRuns = pgTable11(
502
+ var juniorSchedulerRuns = pgTable12(
439
503
  "junior_scheduler_runs",
440
504
  {
441
- id: text11("id").primaryKey(),
442
- taskId: text11("task_id").notNull(),
443
- status: text11("status").notNull(),
505
+ id: text12("id").primaryKey(),
506
+ taskId: text12("task_id").notNull(),
507
+ status: text12("status").notNull(),
444
508
  scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
445
- record: jsonb6("record").$type().notNull()
509
+ record: jsonb7("record").$type().notNull()
446
510
  },
447
511
  (table) => [
448
- index8("junior_scheduler_runs_task_status_idx").on(
512
+ index9("junior_scheduler_runs_task_status_idx").on(
449
513
  table.taskId,
450
514
  table.status,
451
515
  table.scheduledForMs
452
516
  ),
453
- index8("junior_scheduler_runs_status_idx").on(
517
+ index9("junior_scheduler_runs_status_idx").on(
454
518
  table.status,
455
519
  table.scheduledForMs
456
520
  )
@@ -461,6 +525,8 @@ var juniorSchedulerRuns = pgTable11(
461
525
  var juniorSqlSchema = {
462
526
  juniorConversationAnnotations,
463
527
  juniorApiTokens,
528
+ juniorAgentBindings,
529
+ juniorAgentInvocations,
464
530
  juniorConversationEvents,
465
531
  juniorConversationBindings,
466
532
  juniorConversations,
@@ -731,6 +797,9 @@ export {
731
797
  juniorApiTokens,
732
798
  juniorConversationEvents,
733
799
  juniorConversationBindings,
800
+ AGENT_INVOCATION_MAILBOX_STATUSES,
801
+ juniorAgentBindings,
802
+ juniorAgentInvocations,
734
803
  juniorEventTasks,
735
804
  juniorStats,
736
805
  juniorTaskExecutions,