@sentry/junior 0.82.0 → 0.84.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 (45) hide show
  1. package/dist/{agent-hooks-5ZRILRC3.js → agent-hooks-XDS5DIVS.js} +8 -8
  2. package/dist/api-reference.d.ts +1 -1
  3. package/dist/app.d.ts +1 -1
  4. package/dist/app.js +3833 -3263
  5. package/dist/chat/config.d.ts +1 -1
  6. package/dist/chat/conversations/store.d.ts +1 -1
  7. package/dist/chat/plugins/agent-hooks.d.ts +3 -3
  8. package/dist/chat/resource-events/ingest.d.ts +23 -0
  9. package/dist/chat/resource-events/notification.d.ts +20 -0
  10. package/dist/chat/resource-events/store.d.ts +79 -0
  11. package/dist/chat/services/pending-auth.d.ts +5 -0
  12. package/dist/chat/slack/client.d.ts +3 -1
  13. package/dist/chat/state/session-log.d.ts +4 -0
  14. package/dist/chat/task-execution/slack-work.d.ts +22 -0
  15. package/dist/chat/task-execution/state.d.ts +8 -2
  16. package/dist/chat/task-execution/store.d.ts +30 -8
  17. package/dist/chat/tools/resource-events.d.ts +19 -0
  18. package/dist/{chunk-PQ2U2AO3.js → chunk-AAD2D7K3.js} +11 -11
  19. package/dist/{chunk-ABRNFE3N.js → chunk-ALL7GG6U.js} +7 -6
  20. package/dist/{chunk-4XHCVBXH.js → chunk-BAPRSWNW.js} +81 -13
  21. package/dist/{chunk-NC6LR6U4.js → chunk-BFPOSIYV.js} +725 -169
  22. package/dist/{chunk-GUO4EE7L.js → chunk-CWMMGUWM.js} +1 -1
  23. package/dist/{chunk-YA2JCC7G.js → chunk-JUI6XIHU.js} +13 -5
  24. package/dist/{chunk-TR2G37II.js → chunk-KNVN4HUT.js} +8 -8
  25. package/dist/{chunk-X2FL5ZH5.js → chunk-MJ4E2PK7.js} +1 -1
  26. package/dist/{chunk-3JKTVW4R.js → chunk-MZ4DUVFD.js} +2 -2
  27. package/dist/{chunk-2AJ4TEKE.js → chunk-S7SC5IUJ.js} +26 -4
  28. package/dist/{chunk-IOBSRZK5.js → chunk-SBYMRDH7.js} +1 -1
  29. package/dist/{chunk-LX5GBMEP.js → chunk-ZPD5YQFZ.js} +2 -2
  30. package/dist/cli/chat.js +4 -4
  31. package/dist/cli/plugins.js +6 -6
  32. package/dist/cli/snapshot-warmup.js +3 -3
  33. package/dist/cli/upgrade.js +16 -32
  34. package/dist/{db-GQJKBX5W.js → db-7RRWCYF3.js} +3 -3
  35. package/dist/handlers/github-webhook/check-suite.d.ts +3 -0
  36. package/dist/handlers/github-webhook/pull-request-review.d.ts +3 -0
  37. package/dist/handlers/github-webhook/pull-request.d.ts +3 -0
  38. package/dist/handlers/github-webhook/resource.d.ts +10 -0
  39. package/dist/handlers/github-webhook.d.ts +15 -0
  40. package/dist/nitro.js +3 -3
  41. package/dist/reporting/conversations.d.ts +79 -2
  42. package/dist/reporting.d.ts +12 -4
  43. package/dist/reporting.js +431 -27
  44. package/dist/{runner-VRFJLG2M.js → runner-CJL5IKFO.js} +9 -9
  45. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-X2FL5ZH5.js";
3
+ } from "./chunk-MJ4E2PK7.js";
4
4
  import {
5
5
  logException,
6
6
  logInfo,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConversationStore
3
- } from "./chunk-PQ2U2AO3.js";
3
+ } from "./chunk-AAD2D7K3.js";
4
4
  import {
5
5
  SANDBOX_DATA_ROOT,
6
6
  SANDBOX_WORKSPACE_ROOT,
@@ -9,15 +9,15 @@ import {
9
9
  import {
10
10
  getConnectedStateContext,
11
11
  getStateAdapter
12
- } from "./chunk-X2FL5ZH5.js";
12
+ } from "./chunk-MJ4E2PK7.js";
13
13
  import {
14
14
  parseDestination
15
- } from "./chunk-4XHCVBXH.js";
15
+ } from "./chunk-BAPRSWNW.js";
16
16
  import {
17
17
  TURN_CONTEXT_TAG,
18
18
  botConfig,
19
19
  getChatConfig
20
- } from "./chunk-ABRNFE3N.js";
20
+ } from "./chunk-ALL7GG6U.js";
21
21
  import {
22
22
  parseRequester,
23
23
  storedSlackRequesterSchema,
@@ -139,6 +139,8 @@ var subagentEndedEntrySchema = z.object({
139
139
  z.literal("aborted")
140
140
  ]),
141
141
  errorCode: z.string().min(1).optional(),
142
+ transcriptEndMessageIndex: z.number().int().nonnegative().optional(),
143
+ transcriptStartMessageIndex: z.number().int().nonnegative().optional(),
142
144
  createdAtMs: z.number().int().nonnegative()
143
145
  });
144
146
  var sessionLogEntrySchema = z.discriminatedUnion("type", [
@@ -339,6 +341,8 @@ function subagentEndedEntry(args) {
339
341
  subagentInvocationId: args.subagentInvocationId,
340
342
  outcome: args.outcome,
341
343
  ...args.errorCode ? { errorCode: args.errorCode } : {},
344
+ ...args.transcriptEndMessageIndex !== void 0 ? { transcriptEndMessageIndex: args.transcriptEndMessageIndex } : {},
345
+ ...args.transcriptStartMessageIndex !== void 0 ? { transcriptStartMessageIndex: args.transcriptStartMessageIndex } : {},
342
346
  createdAtMs: args.createdAtMs
343
347
  };
344
348
  }
@@ -623,7 +627,9 @@ async function recordSubagentEnded(args) {
623
627
  errorCode: args.errorCode,
624
628
  outcome: args.outcome,
625
629
  sessionId,
626
- subagentInvocationId: args.subagentInvocationId
630
+ subagentInvocationId: args.subagentInvocationId,
631
+ transcriptEndMessageIndex: args.transcriptEndMessageIndex,
632
+ transcriptStartMessageIndex: args.transcriptStartMessageIndex
627
633
  })
628
634
  ],
629
635
  ttlMs: args.ttlMs
@@ -1329,6 +1335,7 @@ var TOOL_POLICY_RULES = [
1329
1335
  `- Sandbox-backed file and shell tools operate in an isolated workspace rooted at ${SANDBOX_WORKSPACE_ROOT}; readFile/writeFile paths are sandbox-workspace paths, bash runs inside that workspace, and attachFile accepts absolute or workspace-relative sandbox paths.`,
1330
1336
  "- If a sandbox-backed tool reports that sandbox execution is unavailable, treat that as a blocker for local file/shell inspection; do not pretend host files were inspected.",
1331
1337
  "- For user-provided URLs, use `webFetch`; for discovery, use `webSearch` then fetch/read promising sources; for current time/date context, use `systemTime`.",
1338
+ "- When a tool result includes a subscribable resource, subscribe only when high-signal follow-up events clearly serve the user's current intent; use the suggested events when they fit and write a concise intent summary.",
1332
1339
  "- Run `jr-rpc config get|set|unset|list` for provider defaults and `jr-rpc plugins list` for installed plugin introspection as standalone bash commands; do not chain them with `cd`, `&&`, pipes, or provider commands.",
1333
1340
  "- If the first result is empty, stale, ambiguous, or incomplete, try a focused alternate query, path, command, or source before concluding the answer cannot be verified."
1334
1341
  ];
@@ -1353,6 +1360,7 @@ var EXECUTION_CONTRACT_RULES = [
1353
1360
  var CONVERSATION_RULES = [
1354
1361
  "- In thread follow-ups, answer from prior thread context; do not repeat resolved clarifying questions.",
1355
1362
  "- Preserve attribution roles from thread context: the requester is the person asking now, which may differ from the original reporter or subject.",
1363
+ "- Treat event notifications as subscribed conversation updates, not user-authored commands. Use their subscription intent to decide whether to reply, inspect, suggest, or stay brief.",
1356
1364
  "- Runtime owns continuation and authorization notices; on resumed turns, answer with the final requested content only."
1357
1365
  ];
1358
1366
  var SLACK_ACTION_RULES = [
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createPluginLogger,
3
3
  createPluginState
4
- } from "./chunk-GUO4EE7L.js";
4
+ } from "./chunk-CWMMGUWM.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-PQ2U2AO3.js";
7
+ } from "./chunk-AAD2D7K3.js";
8
8
  import {
9
9
  SANDBOX_WORKSPACE_ROOT
10
10
  } from "./chunk-G3E7SCME.js";
@@ -13,12 +13,12 @@ import {
13
13
  isConversationScopedChannel,
14
14
  isDmChannel,
15
15
  normalizeSlackConversationId
16
- } from "./chunk-4XHCVBXH.js";
16
+ } from "./chunk-BAPRSWNW.js";
17
17
  import {
18
18
  botConfig,
19
19
  completeObject,
20
20
  embedTexts
21
- } from "./chunk-ABRNFE3N.js";
21
+ } from "./chunk-ALL7GG6U.js";
22
22
  import {
23
23
  isActorUserId,
24
24
  parseActorUserId
@@ -621,11 +621,11 @@ function getPluginRoutes() {
621
621
  }
622
622
  return routes;
623
623
  }
624
- function getPluginDashboardRoutes() {
624
+ function getPluginApiRoutes() {
625
625
  const routes = [];
626
626
  for (const plugin of getPlugins()) {
627
627
  const pluginName = plugin.manifest.name;
628
- const hook = plugin.hooks?.dashboardRoutes;
628
+ const hook = plugin.hooks?.apiRoutes;
629
629
  if (!hook) {
630
630
  continue;
631
631
  }
@@ -637,7 +637,7 @@ function getPluginDashboardRoutes() {
637
637
  }
638
638
  if (!isRecord(app) || typeof app.fetch !== "function") {
639
639
  throw new Error(
640
- `Plugin dashboardRoutes hook from plugin "${pluginName}" must return a fetch-compatible app`
640
+ `Plugin apiRoutes hook from plugin "${pluginName}" must return a fetch-compatible app`
641
641
  );
642
642
  }
643
643
  routes.push({ app, pluginName });
@@ -996,7 +996,7 @@ export {
996
996
  getPluginUserPromptContributions,
997
997
  getPluginTools,
998
998
  getPluginRoutes,
999
- getPluginDashboardRoutes,
999
+ getPluginApiRoutes,
1000
1000
  getPluginSlackConversationLink,
1001
1001
  getPluginOperationalReports,
1002
1002
  createPluginHookRunner
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-ABRNFE3N.js";
3
+ } from "./chunk-ALL7GG6U.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-G3E7SCME.js";
4
4
  import {
5
5
  getStateAdapter
6
- } from "./chunk-X2FL5ZH5.js";
6
+ } from "./chunk-MJ4E2PK7.js";
7
7
  import {
8
8
  toOptionalTrimmed
9
- } from "./chunk-ABRNFE3N.js";
9
+ } from "./chunk-ALL7GG6U.js";
10
10
  import {
11
11
  pluginCatalogRuntime
12
12
  } from "./chunk-TW23AT22.js";
@@ -4,14 +4,14 @@ import {
4
4
  import {
5
5
  getDefaultRedisStateAdapterFor,
6
6
  getStateAdapter
7
- } from "./chunk-X2FL5ZH5.js";
7
+ } from "./chunk-MJ4E2PK7.js";
8
8
  import {
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-4XHCVBXH.js";
11
+ } from "./chunk-BAPRSWNW.js";
12
12
  import {
13
13
  getChatConfig
14
- } from "./chunk-ABRNFE3N.js";
14
+ } from "./chunk-ALL7GG6U.js";
15
15
  import {
16
16
  parseStoredSlackRequester
17
17
  } from "./chunk-ZPCGQRFJ.js";
@@ -68,7 +68,7 @@ function uniqueStrings(values) {
68
68
  return [...new Set(values)];
69
69
  }
70
70
  function normalizeSource(value) {
71
- if (value === "api" || value === "internal" || value === "local" || value === "plugin" || value === "scheduler" || value === "slack") {
71
+ if (value === "api" || value === "internal" || value === "local" || value === "plugin" || value === "resource_event" || value === "scheduler" || value === "slack") {
72
72
  return value;
73
73
  }
74
74
  return void 0;
@@ -801,6 +801,27 @@ async function markConversationWorkEnqueued(args) {
801
801
  );
802
802
  });
803
803
  }
804
+ async function clearConsumedConversationWake(args) {
805
+ const nowMs = args.nowMs ?? now();
806
+ return await withConversationMutation(args, async (state) => {
807
+ const current = await readConversation(state, args.conversationId);
808
+ if (!current || hasRunnableWork(current) || current.execution.lastEnqueuedAtMs === void 0) {
809
+ return false;
810
+ }
811
+ await writeConversation(
812
+ state,
813
+ withExecutionUpdate(
814
+ current,
815
+ {
816
+ ...current.execution,
817
+ lastEnqueuedAtMs: void 0
818
+ },
819
+ nowMs
820
+ )
821
+ );
822
+ return true;
823
+ });
824
+ }
804
825
  async function startConversationWork(args) {
805
826
  const nowMs = args.nowMs ?? now();
806
827
  return await withConversationMutation(args, async (state) => {
@@ -1108,6 +1129,7 @@ export {
1108
1129
  recordConversationActivity,
1109
1130
  recordConversationExecution,
1110
1131
  markConversationWorkEnqueued,
1132
+ clearConsumedConversationWake,
1111
1133
  startConversationWork,
1112
1134
  checkInConversationWork,
1113
1135
  drainConversationMailbox,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  destinationKey,
6
6
  parseDestination
7
- } from "./chunk-4XHCVBXH.js";
7
+ } from "./chunk-BAPRSWNW.js";
8
8
 
9
9
  // src/chat/task-execution/queue-signing.ts
10
10
  import { createHmac, timingSafeEqual } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-X2FL5ZH5.js";
3
+ } from "./chunk-MJ4E2PK7.js";
4
4
  import {
5
5
  normalizeSlackConversationId
6
- } from "./chunk-4XHCVBXH.js";
6
+ } from "./chunk-BAPRSWNW.js";
7
7
  import {
8
8
  parseSlackThreadId
9
9
  } from "./chunk-DR75T7J3.js";
package/dist/cli/chat.js CHANGED
@@ -130,10 +130,10 @@ async function configureLocalChatPlugins(pluginSet) {
130
130
  databaseModule
131
131
  ] = await Promise.all([
132
132
  import("../plugins-PZMDS7AT.js"),
133
- import("../agent-hooks-5ZRILRC3.js"),
133
+ import("../agent-hooks-XDS5DIVS.js"),
134
134
  import("../catalog-runtime-IVWRAPSI.js"),
135
135
  import("../validation-TN6HMZAD.js"),
136
- import("../db-GQJKBX5W.js")
136
+ import("../db-7RRWCYF3.js")
137
137
  ]);
138
138
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
139
139
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -195,7 +195,7 @@ async function runPrompt(options, io, pluginSet) {
195
195
  defaultStateAdapterForLocalChat();
196
196
  await configureLocalChatPlugins(pluginSet);
197
197
  const conversationId = newRunConversationId();
198
- const { runLocalAgentTurn } = await import("../runner-VRFJLG2M.js");
198
+ const { runLocalAgentTurn } = await import("../runner-CJL5IKFO.js");
199
199
  const result = await runLocalAgentTurn(
200
200
  {
201
201
  conversationId,
@@ -219,7 +219,7 @@ async function runInteractive(io, pluginSet) {
219
219
  defaultStateAdapterForLocalChat();
220
220
  await configureLocalChatPlugins(pluginSet);
221
221
  const conversationId = newRunConversationId();
222
- const { runLocalAgentTurn } = await import("../runner-VRFJLG2M.js");
222
+ const { runLocalAgentTurn } = await import("../runner-CJL5IKFO.js");
223
223
  const rl = readline.createInterface({
224
224
  input: io.input,
225
225
  output: io.output,
@@ -10,17 +10,17 @@ import {
10
10
  import {
11
11
  setPlugins,
12
12
  validatePlugins
13
- } from "../chunk-TR2G37II.js";
13
+ } from "../chunk-KNVN4HUT.js";
14
14
  import {
15
15
  createPluginLogger
16
- } from "../chunk-GUO4EE7L.js";
16
+ } from "../chunk-CWMMGUWM.js";
17
17
  import {
18
18
  getDb
19
- } from "../chunk-PQ2U2AO3.js";
19
+ } from "../chunk-AAD2D7K3.js";
20
20
  import "../chunk-G3E7SCME.js";
21
- import "../chunk-X2FL5ZH5.js";
22
- import "../chunk-4XHCVBXH.js";
23
- import "../chunk-ABRNFE3N.js";
21
+ import "../chunk-MJ4E2PK7.js";
22
+ import "../chunk-BAPRSWNW.js";
23
+ import "../chunk-ALL7GG6U.js";
24
24
  import "../chunk-DR75T7J3.js";
25
25
  import {
26
26
  loadAppPluginSet
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolveRuntimeDependencySnapshot
3
- } from "../chunk-3JKTVW4R.js";
3
+ } from "../chunk-MZ4DUVFD.js";
4
4
  import "../chunk-G3E7SCME.js";
5
5
  import {
6
6
  disconnectStateAdapter
7
- } from "../chunk-X2FL5ZH5.js";
8
- import "../chunk-ABRNFE3N.js";
7
+ } from "../chunk-MJ4E2PK7.js";
8
+ import "../chunk-ALL7GG6U.js";
9
9
  import "../chunk-DR75T7J3.js";
10
10
  import {
11
11
  pluginCatalogRuntime
@@ -4,7 +4,7 @@ import {
4
4
  recordConversationActivity,
5
5
  recordConversationExecution,
6
6
  requestConversationWork
7
- } from "../chunk-2AJ4TEKE.js";
7
+ } from "../chunk-S7SC5IUJ.js";
8
8
  import {
9
9
  JUNIOR_THREAD_STATE_TTL_MS,
10
10
  coerceThreadConversationState
@@ -18,23 +18,23 @@ import {
18
18
  import {
19
19
  createPluginLogger,
20
20
  createPluginState
21
- } from "../chunk-GUO4EE7L.js";
21
+ } from "../chunk-CWMMGUWM.js";
22
22
  import {
23
23
  createJuniorSqlExecutor,
24
24
  createSqlStore,
25
25
  getDb
26
- } from "../chunk-PQ2U2AO3.js";
26
+ } from "../chunk-AAD2D7K3.js";
27
27
  import {
28
28
  disconnectStateAdapter,
29
29
  getConnectedStateContext
30
- } from "../chunk-X2FL5ZH5.js";
30
+ } from "../chunk-MJ4E2PK7.js";
31
31
  import {
32
32
  parseDestination,
33
33
  sameDestination
34
- } from "../chunk-4XHCVBXH.js";
34
+ } from "../chunk-BAPRSWNW.js";
35
35
  import {
36
36
  getChatConfig
37
- } from "../chunk-ABRNFE3N.js";
37
+ } from "../chunk-ALL7GG6U.js";
38
38
  import "../chunk-DR75T7J3.js";
39
39
  import {
40
40
  loadAppPluginSet
@@ -83,23 +83,15 @@ function createStateConversationStore(state) {
83
83
 
84
84
  // src/cli/upgrade/migrations/conversations-sql.ts
85
85
  var CONVERSATION_BACKFILL_LIMIT = 1e4;
86
- var REQUIRED_SQL_DATABASE_URL_MESSAGE = "Junior SQL database URL is required for conversation metadata upgrade. Set JUNIOR_DATABASE_URL or DATABASE_URL.";
87
- function requireConversationSqlDatabaseUrl(context) {
88
- const databaseUrl = context.sqlDatabaseUrl ?? getChatConfig().sql.databaseUrl;
89
- if (!databaseUrl) {
90
- throw new Error(REQUIRED_SQL_DATABASE_URL_MESSAGE);
91
- }
92
- return databaseUrl;
93
- }
94
86
  async function migrateConversationsToSql(context, options = {}) {
95
87
  const source = createStateConversationStore(context.stateAdapter);
96
88
  let target = options.target;
97
89
  let closeTarget;
98
90
  if (!target) {
99
- const databaseUrl = requireConversationSqlDatabaseUrl(context);
91
+ const { sql } = getChatConfig();
100
92
  const executor = createJuniorSqlExecutor({
101
- connectionString: databaseUrl,
102
- driver: context.sqlDriver ?? getChatConfig().sql.driver
93
+ connectionString: sql.databaseUrl,
94
+ driver: sql.driver
103
95
  });
104
96
  target = createSqlStore(executor);
105
97
  closeTarget = () => executor.close();
@@ -219,9 +211,10 @@ async function runPluginStorageMigrations(context) {
219
211
  return emptyResult();
220
212
  }
221
213
  const previousConfig = pluginCatalogRuntime.setConfig(pluginCatalogConfig);
222
- const ownedExecutor = context.db || !context.sqlDatabaseUrl ? void 0 : createJuniorSqlExecutor({
223
- connectionString: context.sqlDatabaseUrl,
224
- driver: context.sqlDriver ?? getChatConfig().sql.driver
214
+ const sql = getChatConfig().sql;
215
+ const ownedExecutor = context.db ? void 0 : createJuniorSqlExecutor({
216
+ connectionString: sql.databaseUrl,
217
+ driver: sql.driver
225
218
  });
226
219
  const sqlUrlDb = ownedExecutor ? ownedExecutor.db() : void 0;
227
220
  try {
@@ -377,21 +370,13 @@ async function migratePluginSchemas(executor, migrations) {
377
370
  }
378
371
 
379
372
  // src/cli/upgrade/migrations/plugin-sql.ts
380
- var REQUIRED_SQL_DATABASE_URL_MESSAGE2 = "Junior SQL database URL is required for plugin schema migration. Set JUNIOR_DATABASE_URL or DATABASE_URL.";
381
- function requirePluginSqlDatabaseUrl(context) {
382
- const databaseUrl = context.sqlDatabaseUrl ?? getChatConfig().sql.databaseUrl;
383
- if (!databaseUrl) {
384
- throw new Error(REQUIRED_SQL_DATABASE_URL_MESSAGE2);
385
- }
386
- return databaseUrl;
387
- }
388
373
  async function migratePluginsToSql(context) {
389
- const databaseUrl = requirePluginSqlDatabaseUrl(context);
374
+ const { sql } = getChatConfig();
390
375
  const { pluginCatalogConfig } = await resolveUpgradePlugins(context);
391
376
  const previousConfig = pluginCatalogRuntime.setConfig(pluginCatalogConfig);
392
377
  const executor = createJuniorSqlExecutor({
393
- connectionString: databaseUrl,
394
- driver: context.sqlDriver ?? getChatConfig().sql.driver
378
+ connectionString: sql.databaseUrl,
379
+ driver: sql.driver
395
380
  });
396
381
  try {
397
382
  const migrations = pluginCatalogRuntime.getMigrationRoots().flatMap((root) => readPluginMigrations(root));
@@ -991,7 +976,6 @@ function formatMigrationResult(result) {
991
976
  async function runUpgradeMigrations(context) {
992
977
  const plugins = await resolveUpgradePlugins(context);
993
978
  const migrationContext = { ...context, ...plugins };
994
- migrationContext.sqlDatabaseUrl ??= requireConversationSqlDatabaseUrl(migrationContext);
995
979
  const results = [];
996
980
  for (const migration of MIGRATIONS) {
997
981
  migrationContext.io.info(`Running migration ${migration.name}...`);
@@ -2,9 +2,9 @@ import {
2
2
  closeDb,
3
3
  getConversationStore,
4
4
  getDb
5
- } from "./chunk-PQ2U2AO3.js";
6
- import "./chunk-4XHCVBXH.js";
7
- import "./chunk-ABRNFE3N.js";
5
+ } from "./chunk-AAD2D7K3.js";
6
+ import "./chunk-BAPRSWNW.js";
7
+ import "./chunk-ALL7GG6U.js";
8
8
  import "./chunk-DR75T7J3.js";
9
9
  import "./chunk-ZPCGQRFJ.js";
10
10
  import "./chunk-KF7522P3.js";
@@ -0,0 +1,3 @@
1
+ import type { IngestResourceEventInput } from "@/chat/resource-events/ingest";
2
+ /** Normalize GitHub `check_suite` webhooks for subscribed PR check outcomes. */
3
+ export declare function normalizeGitHubCheckSuiteEvents(deliveryId: string, body: unknown): IngestResourceEventInput[];
@@ -0,0 +1,3 @@
1
+ import type { IngestResourceEventInput } from "@/chat/resource-events/ingest";
2
+ /** Normalize GitHub `pull_request_review` webhooks for subscribed review outcomes. */
3
+ export declare function normalizeGitHubPullRequestReviewEvent(deliveryId: string, body: unknown): IngestResourceEventInput | undefined;
@@ -0,0 +1,3 @@
1
+ import type { IngestResourceEventInput } from "@/chat/resource-events/ingest";
2
+ /** Normalize GitHub `pull_request` webhooks for subscribed PR state changes. */
3
+ export declare function normalizeGitHubPullRequestEvent(deliveryId: string, body: unknown): IngestResourceEventInput | undefined;
@@ -0,0 +1,10 @@
1
+ /** Build the normalized resource identity for a GitHub pull request. */
2
+ export declare function gitHubPullRequestResource(input: {
3
+ pullRequestNumber: number;
4
+ repositoryFullName: string;
5
+ }): {
6
+ label: string;
7
+ resourceRef: string;
8
+ };
9
+ /** Build a stable provider retry key for one normalized GitHub event. */
10
+ export declare function gitHubEventKey(deliveryId: string, eventType: string): string;
@@ -0,0 +1,15 @@
1
+ import type { StateAdapter } from "chat";
2
+ import { type IngestResourceEventInput } from "@/chat/resource-events/ingest";
3
+ import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
4
+ export interface GitHubWebhookHandlerOptions {
5
+ queue: ConversationWorkQueue | (() => ConversationWorkQueue);
6
+ state?: StateAdapter | (() => StateAdapter | undefined);
7
+ }
8
+ /** Normalize a verified GitHub webhook delivery into resource events. */
9
+ export declare function normalizeGitHubResourceEvents(args: {
10
+ body: unknown;
11
+ deliveryId: string;
12
+ eventName: string;
13
+ }): IngestResourceEventInput[];
14
+ /** Handle signed GitHub webhooks for resource event subscriptions. */
15
+ export declare function POST(request: Request, options: GitHubWebhookHandlerOptions): Promise<Response>;
package/dist/nitro.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveConversationWorkQueueTopic
3
- } from "./chunk-IOBSRZK5.js";
3
+ } from "./chunk-SBYMRDH7.js";
4
4
  import {
5
5
  PLUGIN_TASK_QUEUE_TOPIC
6
6
  } from "./chunk-KNFROR7R.js";
@@ -8,8 +8,8 @@ import {
8
8
  pluginCatalogConfigFromPluginSet,
9
9
  pluginRuntimeRegistrationsFromPluginSet
10
10
  } from "./chunk-SG5WAA7H.js";
11
- import "./chunk-4XHCVBXH.js";
12
- import "./chunk-ABRNFE3N.js";
11
+ import "./chunk-BAPRSWNW.js";
12
+ import "./chunk-ALL7GG6U.js";
13
13
  import "./chunk-DR75T7J3.js";
14
14
  import {
15
15
  loadPluginSetFromModule,
@@ -35,7 +35,6 @@ export interface ConversationSummaryReport {
35
35
  requesterIdentity?: RequesterIdentity;
36
36
  channel?: string;
37
37
  channelName?: string;
38
- sentryConversationUrl?: string;
39
38
  sentryTraceUrl?: string;
40
39
  traceId?: string;
41
40
  }
@@ -91,6 +90,7 @@ export interface ConversationSubagentActivityReport {
91
90
  parentToolCallId?: string;
92
91
  status: ConversationActivityStatus;
93
92
  subagentKind: string;
93
+ transcriptAvailable?: boolean;
94
94
  }
95
95
  export interface ConversationToolActivityReport extends ActivityPayloadMetadata {
96
96
  type: "tool_execution";
@@ -109,10 +109,29 @@ export interface ConversationReport {
109
109
  /** Always-populated display title, computed the same way as per-run reports. */
110
110
  displayTitle: string;
111
111
  generatedAt: string;
112
+ sentryConversationUrl?: string;
112
113
  runs: ConversationRunReport[];
113
114
  }
115
+ export interface ConversationSubagentTranscriptReport {
116
+ type: "subagent";
117
+ createdAt: string;
118
+ endedAt?: string;
119
+ id: string;
120
+ outcome?: "success" | "error" | "aborted";
121
+ parentToolCallId?: string;
122
+ status: ConversationActivityStatus;
123
+ subagentConversationId?: string;
124
+ subagentKind: string;
125
+ subagentSentryConversationUrl?: string;
126
+ transcript: TranscriptMessage[];
127
+ transcriptAvailable: boolean;
128
+ transcriptMessageCount?: number;
129
+ transcriptRedacted?: boolean;
130
+ transcriptRedactionReason?: "non_public_conversation";
131
+ unavailableReason?: "missing_transcript_range" | "missing_transcript_ref" | "not_found";
132
+ }
114
133
  export interface ConversationFeed {
115
- sessions: ConversationSummaryReport[];
134
+ conversations: ConversationSummaryReport[];
116
135
  source: "conversation_index";
117
136
  generatedAt: string;
118
137
  }
@@ -144,6 +163,62 @@ export interface ConversationStatsReport {
144
163
  windowEnd: string;
145
164
  windowStart: string;
146
165
  }
166
+ export interface RequesterActivityDayReport {
167
+ active: number;
168
+ conversations: number;
169
+ date: string;
170
+ durationMs: number;
171
+ failed: number;
172
+ hung: number;
173
+ runs: number;
174
+ tokens?: number;
175
+ }
176
+ export interface RequesterTotalsReport {
177
+ active: number;
178
+ activeDays: number;
179
+ conversations: number;
180
+ durationMs: number;
181
+ failed: number;
182
+ hung: number;
183
+ runs: number;
184
+ tokens?: number;
185
+ }
186
+ export interface RequesterSummaryReport extends RequesterTotalsReport {
187
+ firstSeenAt: string;
188
+ lastSeenAt: string;
189
+ requester: RequesterIdentity & {
190
+ email: string;
191
+ };
192
+ }
193
+ export interface RequesterDirectoryReport {
194
+ generatedAt: string;
195
+ people: RequesterSummaryReport[];
196
+ sampleLimit: number;
197
+ sampleSize: number;
198
+ source: "conversation_index";
199
+ truncated: boolean;
200
+ }
201
+ export interface RequesterProfileReport {
202
+ activityDays: RequesterActivityDayReport[];
203
+ generatedAt: string;
204
+ locations: ConversationStatsItem[];
205
+ recentConversations: ConversationSummaryReport[];
206
+ requester: RequesterIdentity & {
207
+ email: string;
208
+ };
209
+ sampleLimit: number;
210
+ sampleSize: number;
211
+ source: "conversation_index";
212
+ surfaces: ConversationStatsItem[];
213
+ totals: RequesterTotalsReport;
214
+ truncated: boolean;
215
+ windowEnd: string;
216
+ windowStart: string;
217
+ }
218
+ /** Read the requester directory from durable conversation metadata. */
219
+ export declare function readRequesterDirectoryReport(options?: ConversationReaderOptions): Promise<RequesterDirectoryReport>;
220
+ /** Read one requester profile without exposing transcript payloads. */
221
+ export declare function readRequesterProfileReport(email: string, options?: ConversationReaderOptions): Promise<RequesterProfileReport>;
147
222
  /** Read the recent conversation feed for reporting consumers. */
148
223
  export declare function readConversationFeed(options?: ConversationReaderOptions): Promise<ConversationFeed>;
149
224
  /** Read aggregate conversation statistics for reporting consumers. */
@@ -154,3 +229,5 @@ export declare function listRecentConversationSummaries(options?: {
154
229
  } & ConversationReaderOptions): Promise<PluginConversationSummary[]>;
155
230
  /** Read one conversation transcript for reporting consumers. */
156
231
  export declare function readConversationReport(conversationId: string, options?: ConversationReaderOptions): Promise<ConversationReport>;
232
+ /** Read one child-agent transcript through its parent conversation run. */
233
+ export declare function readConversationSubagentTranscriptReport(conversationId: string, runId: string, subagentId: string): Promise<ConversationSubagentTranscriptReport>;