@sentry/junior 0.290.0 → 0.291.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 (65) hide show
  1. package/bin/junior.mjs +19 -15
  2. package/dist/{adapter-CHMVy-j0.js → adapter-zphAlWE2.js} +1 -1
  3. package/dist/{admin-C45Ap5Tn.js → admin-B3WR7Y6e.js} +2 -2
  4. package/dist/{agent-runner-CZjf6MOQ.js → agent-runner-ke-hOiuv.js} +23 -23
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +26 -26
  9. package/dist/{app-BB1j2krL.d.ts → app-C47PT68y.d.ts} +2 -2
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +29 -29
  12. package/dist/{assistant-reply-BtIV0hq6.js → assistant-reply-BV8SZaVd.js} +1 -1
  13. package/dist/{automation-DWbjJltM.js → automation-CrsYnvdV.js} +1 -1
  14. package/dist/{background-compaction-queue-2gKhjRD3.js → background-compaction-queue-QDH_JS3D.js} +4 -4
  15. package/dist/{briefs-BGke_Cz5.js → briefs-Bdv9BG5J.js} +3 -3
  16. package/dist/{catalog-runtime-BSOlVfXi.js → catalog-runtime-yGnL9ywD.js} +1 -1
  17. package/dist/cli/chat.js +14 -14
  18. package/dist/cli/check.js +3 -3
  19. package/dist/cli/main.d.ts +5 -0
  20. package/dist/cli/main.js +25 -6
  21. package/dist/cli/plugins.js +4 -4
  22. package/dist/cli/snapshot-create.js +4 -4
  23. package/dist/cli/upgrade.d.ts +1 -1
  24. package/dist/cli/upgrade.js +3 -3
  25. package/dist/{config-DHDub41t.js → config-UsaBOQgC.js} +2 -2
  26. package/dist/{connections-BAb0fedk.js → connections-CePSRCoR.js} +6 -6
  27. package/dist/{conversation-CwC8K3RZ.js → conversation-CtjR1Zcx.js} +7 -1
  28. package/dist/{conversation-pending-messages-B0cuLReP.js → conversation-pending-messages-Cd7ShwBs.js} +1 -1
  29. package/dist/{conversation-privacy-QRdLPH-9.js → conversation-privacy-B3wmawmz.js} +1 -1
  30. package/dist/{credential-sync-YIMGiRk7.js → credential-sync-LNRLXZCn.js} +13 -13
  31. package/dist/{db-DCSmv9tz.d.ts → db-7glZCI18.d.ts} +1 -1
  32. package/dist/{db-DBHig2sI.js → db-c__lw9GH.js} +8 -5
  33. package/dist/{executor-DKrtH0k_.js → executor-N8-D5Gvv.js} +34 -5
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{logging-f24cZPEj.js → logging-DbXHuhac.js} +1 -1
  36. package/dist/{message-BbBOajiX.js → message-D1MEh8iR.js} +9 -9
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +2 -2
  39. package/dist/{oauth-callback-server-rHJYjFoz.js → oauth-callback-server-DUtqhYwP.js} +2 -2
  40. package/dist/{projection-D-9aVaHj.js → projection-D7XadqRY.js} +11 -11
  41. package/dist/{prompt-C7SZhNDy.js → prompt-CzEV4BF4.js} +4 -4
  42. package/dist/{registry-CwA-kSjW.js → registry-CTtGtXZP.js} +1 -1
  43. package/dist/{resolve-B5WJgt9k.js → resolve-nUuQ8yyH.js} +3 -3
  44. package/dist/{result-B2sCVIwl.js → result-Cr9tUdfS.js} +8 -8
  45. package/dist/{runner-CZq7wyIh.js → runner-D7NMbBim.js} +8 -8
  46. package/dist/{sandbox-egress-signals-C4d6Pa9a.js → sandbox-egress-signals-BJAyfzOD.js} +1 -1
  47. package/dist/{schema-DQaFSkZZ.d.ts → schema-CC2RxDAV.d.ts} +5 -0
  48. package/dist/{schema-Bptz19Ja.js → schema-CVV5r-qP.js} +3 -3
  49. package/dist/{service-account-BC73M8rj.js → service-account-CP1oBWTc.js} +3 -3
  50. package/dist/{service-account-B6OJtplS.js → service-account-_ml5D4Tk.js} +3 -3
  51. package/dist/{session-stop-1cku9Vm3.js → session-stop-BbsyIbK2.js} +11 -11
  52. package/dist/{skills-BFopj5ID.js → skills-CayJ8-Bj.js} +2 -2
  53. package/dist/{spawn-B-1JlJwH.js → spawn-CktAopv_.js} +5 -5
  54. package/dist/{stop-CJweYiOH.js → stop-BUzUJuN_.js} +88 -31
  55. package/dist/{store-CK869JpC.js → store-lotbeXq3.js} +3 -3
  56. package/dist/{task-runner-XmXL9E-k.js → task-runner-BinM1l5g.js} +11 -11
  57. package/dist/{turn-failure-response-hhpek6Fn.js → turn-failure-response-DH5nE6HJ.js} +8 -8
  58. package/dist/{validation-DHQjCRFx.js → validation-I0CqX5NC.js} +1 -1
  59. package/dist/{version-DQgCf4FE.js → version-C3sVz3bv.js} +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/{viewer-DG97nzP4.js → viewer-so1MPU10.js} +3 -3
  62. package/dist/{warmup-C00-jOoN.js → warmup-BH9HRBCI.js} +8 -8
  63. package/dist/{work-Ch3EWO6u.js → work-Cw6Fzvfz.js} +11 -11
  64. package/dist/{worker-B8kyM1fB.js → worker-qEykG39-.js} +6 -6
  65. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-DHDub41t.js";
2
- import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-f24cZPEj.js";
1
+ import { i as getChatConfig } from "./config-UsaBOQgC.js";
2
+ import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-DbXHuhac.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
5
5
  import * as z from "zod";
@@ -371,7 +371,7 @@ function cacheWarmupCallback() {
371
371
  maxDeliveries: 1,
372
372
  onRejected: logCacheWarmupRejected,
373
373
  run: async (message) => {
374
- const { runCacheWarmup } = await import("./warmup-C00-jOoN.js").then((n) => n.o);
374
+ const { runCacheWarmup } = await import("./warmup-BH9HRBCI.js").then((n) => n.o);
375
375
  await runCacheWarmup(message);
376
376
  },
377
377
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -560,7 +560,7 @@ function pluginTaskCallback() {
560
560
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
561
561
  onRejected: logPluginTaskQueueMessageRejected,
562
562
  run: async (message) => {
563
- const { processPluginTask } = await import("./task-runner-XmXL9E-k.js").then((n) => n.r);
563
+ const { processPluginTask } = await import("./task-runner-BinM1l5g.js").then((n) => n.r);
564
564
  await processPluginTask(message);
565
565
  },
566
566
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,5 +1,5 @@
1
- import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C7SZhNDy.js";
2
- import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-CwC8K3RZ.js";
1
+ import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CzEV4BF4.js";
2
+ import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-CtjR1Zcx.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import path from "node:path";
5
5
  import * as z from "zod";
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
262
262
  * token.
263
263
  */
264
264
  async function configuredBriefModelId() {
265
- const { botConfig } = await import("./config-DHDub41t.js").then((n) => n.r);
265
+ const { botConfig } = await import("./config-UsaBOQgC.js").then((n) => n.r);
266
266
  return botConfig.fastModelId;
267
267
  }
268
268
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-CwA-kSjW.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-CTtGtXZP.js";
3
3
  // src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CZjf6MOQ.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-ke-hOiuv.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-HYh_JOdw.js").then((n) => n.o),
102
- import("../projection-D-9aVaHj.js").then((n) => n.jn),
103
- import("../catalog-runtime-BSOlVfXi.js").then((n) => n.t),
104
- import("../validation-DHQjCRFx.js").then((n) => n.r),
105
- import("../db-DBHig2sI.js").then((n) => n.n)
102
+ import("../projection-D7XadqRY.js").then((n) => n.jn),
103
+ import("../catalog-runtime-yGnL9ywD.js").then((n) => n.t),
104
+ import("../validation-I0CqX5NC.js").then((n) => n.r),
105
+ import("../db-c__lw9GH.js").then((n) => n.n)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,18 +152,18 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-D-9aVaHj.js").then((n) => n.Un);
155
+ const { setBriefsConfig } = await import("../projection-D7XadqRY.js").then((n) => n.Un);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-CZq7wyIh.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-rHJYjFoz.js");
157
+ const { runLocalAgentTurn } = await import("../runner-D7NMbBim.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DUtqhYwP.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-D6xxVywK.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C4d6Pa9a.js");
161
- const { bindSpawnAgent } = await import("../spawn-B-1JlJwH.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-BbBOajiX.js").then((n) => n.n);
163
- const { createChildConversationWorker } = await import("../result-B2sCVIwl.js").then((n) => n.i);
164
- const { skipInputAfterConversationStop } = await import("../session-stop-1cku9Vm3.js").then((n) => n.a);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BJAyfzOD.js");
161
+ const { bindSpawnAgent } = await import("../spawn-CktAopv_.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-D1MEh8iR.js").then((n) => n.n);
163
+ const { createChildConversationWorker } = await import("../result-Cr9tUdfS.js").then((n) => n.i);
164
+ const { skipInputAfterConversationStop } = await import("../session-stop-BbsyIbK2.js").then((n) => n.a);
165
165
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
166
- const { processConversationWork } = await import("../worker-B8kyM1fB.js").then((n) => n.n);
166
+ const { processConversationWork } = await import("../worker-qEykG39-.js").then((n) => n.n);
167
167
  let agentRunner;
168
168
  const localConversationWork = createLocalConversationWork(async (message) => {
169
169
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-f24cZPEj.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-CwA-kSjW.js";
3
- import { i as parseSkillFile } from "../skills-BFopj5ID.js";
1
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DbXHuhac.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-CTtGtXZP.js";
3
+ import { i as parseSkillFile } from "../skills-CayJ8-Bj.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Format a failed CLI command with its cause chain. Drizzle wraps database
3
+ * errors in "Failed query: ...", so the Postgres reason is only in `cause`.
4
+ */
5
+ export declare function formatCliFailure(error: unknown): string;
1
6
  /** Run the packaged CLI entrypoint with plugin command bootstrap enabled. */
2
7
  export declare function runMain(argv: string[], options?: {
3
8
  instrument?: boolean;
package/dist/cli/main.js CHANGED
@@ -1,6 +1,26 @@
1
1
  import { loadCliEnvFiles } from "./env.js";
2
2
  import { runCli } from "./run.js";
3
3
  import { pathToFileURL } from "node:url";
4
+ // src/cli/failure.ts
5
+ const MAX_CAUSE_DEPTH = 5;
6
+ /**
7
+ * Format a failed CLI command with its cause chain. Drizzle wraps database
8
+ * errors in "Failed query: ...", so the Postgres reason is only in `cause`.
9
+ */
10
+ function formatCliFailure(error) {
11
+ const lines = [];
12
+ let current = error;
13
+ while (current !== void 0 && lines.length < MAX_CAUSE_DEPTH) {
14
+ if (!(current instanceof Error)) {
15
+ lines.push(String(current));
16
+ break;
17
+ }
18
+ const code = "code" in current ? current.code : void 0;
19
+ lines.push(typeof code === "string" && code ? `${current.message.trim()} (${code})` : current.message.trim());
20
+ current = current.cause;
21
+ }
22
+ return lines.join("\ncaused by: ");
23
+ }
4
24
  // src/cli/main.ts
5
25
  const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
6
26
  async function flushSentry() {
@@ -25,13 +45,13 @@ async function runChat(argv, pluginSet) {
25
45
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
46
  }
27
47
  async function runAdmin(argv) {
28
- return await (await import("../admin-C45Ap5Tn.js")).runAdmin(argv);
48
+ return await (await import("../admin-B3WR7Y6e.js")).runAdmin(argv);
29
49
  }
30
50
  async function runServiceAccount(argv) {
31
- return await (await import("../service-account-BC73M8rj.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-CP1oBWTc.js")).runServiceAccount(argv);
32
52
  }
33
53
  async function runBriefs(argv) {
34
- return await (await import("../briefs-BGke_Cz5.js")).runBriefs(argv);
54
+ return await (await import("../briefs-Bdv9BG5J.js")).runBriefs(argv);
35
55
  }
36
56
  function topLevelCommand(argv) {
37
57
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -66,10 +86,9 @@ function isDirectCliEntry() {
66
86
  }
67
87
  if (isDirectCliEntry()) runMain(process.argv.slice(2)).catch((error) => {
68
88
  (async () => {
69
- const message = error instanceof Error ? error.message : String(error);
70
- console.error(`junior command failed: ${message}`);
89
+ console.error(`junior command failed: ${formatCliFailure(error)}`);
71
90
  await flushSentry();
72
91
  process.exit(1);
73
92
  })();
74
93
  });
75
- export { runMain };
94
+ export { formatCliFailure, runMain };
@@ -1,7 +1,7 @@
1
- import { Bn as setPlugins, Vn as validatePlugins, Ya as createPluginLogger } from "../projection-D-9aVaHj.js";
2
- import { o as getDb } from "../db-DBHig2sI.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BSOlVfXi.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DHQjCRFx.js";
1
+ import { Bn as setPlugins, Vn as validatePlugins, Ya as createPluginLogger } from "../projection-D7XadqRY.js";
2
+ import { o as getDb } from "../db-c__lw9GH.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-yGnL9ywD.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-I0CqX5NC.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { Aa as SANDBOX_RUNTIME, wi as create } from "../projection-D-9aVaHj.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BSOlVfXi.js";
3
- import { t as disconnectStateAdapter } from "../adapter-CHMVy-j0.js";
4
- import { n as resolve } from "../resolve-B5WJgt9k.js";
1
+ import { Aa as SANDBOX_RUNTIME, wi as create } from "../projection-D7XadqRY.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-yGnL9ywD.js";
3
+ import { t as disconnectStateAdapter } from "../adapter-zphAlWE2.js";
4
+ import { n as resolve } from "../resolve-nUuQ8yyH.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
7
7
  function progressMessage(phase) {
@@ -1,4 +1,4 @@
1
- import "../db-DCSmv9tz.js";
1
+ import "../db-7glZCI18.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-DtmjkTza.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-DHDub41t.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-DKrtH0k_.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-CwA-kSjW.js";
1
+ import { i as getChatConfig } from "../config-UsaBOQgC.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-N8-D5Gvv.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-CTtGtXZP.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -1,6 +1,6 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-f24cZPEj.js";
3
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-QRdLPH-9.js";
2
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DbXHuhac.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-B3wmawmz.js";
4
4
  import { AwsClient } from "aws4fetch";
5
5
  import { del, get, put } from "@vercel/blob";
6
6
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
@@ -1,9 +1,9 @@
1
- import { Fi as startOAuthFlow } from "./projection-D-9aVaHj.js";
2
- import { n as botConfig } from "./config-DHDub41t.js";
3
- import { A as deleteProviderIdentityForUser, k as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db-DBHig2sI.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-CwA-kSjW.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BSOlVfXi.js";
6
- import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-CZjf6MOQ.js";
1
+ import { Fi as startOAuthFlow } from "./projection-D7XadqRY.js";
2
+ import { n as botConfig } from "./config-UsaBOQgC.js";
3
+ import { A as deleteProviderIdentityForUser, k as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db-c__lw9GH.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-CTtGtXZP.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-yGnL9ywD.js";
6
+ import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-ke-hOiuv.js";
7
7
  import { randomBytes } from "node:crypto";
8
8
  // src/handlers/oauth-html.ts
9
9
  /** Build pre-escaped callback HTML with the shared response security policy. */
@@ -500,7 +500,13 @@ const conversationSummaryReportSchema = z.object({
500
500
  * - there is no known work and the conversation was last seen within 3 hours
501
501
  */
502
502
  isPriority: z.boolean().optional(),
503
- unfinishedWork: z.boolean().optional()
503
+ unfinishedWork: z.boolean().optional(),
504
+ /**
505
+ * True on the conversation feed when a Turn in the conversation or a
506
+ * child waits on a person to finish an authorization that has not
507
+ * expired.
508
+ */
509
+ awaitingAuthorization: z.boolean().optional()
504
510
  }).strict();
505
511
  /** One Event listed on a message that holds several Events. */
506
512
  const conversationReportMessageEventSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-CwC8K3RZ.js";
1
+ import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-CtjR1Zcx.js";
2
2
  import * as z from "zod";
3
3
  // src/reporting-schema.ts
4
4
  const healthReportSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-f24cZPEj.js";
1
+ import { h as logWarn } from "./logging-DbXHuhac.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,19 +1,19 @@
1
- import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Ji as postSlackMessage, Mi as formatProviderLabel, Ni as parseOAuthStatePayload, Pi as resolveBaseUrl, Z as getConversationPendingAuth, aa as getSlackClient, d as recordAuthorizationCompleted, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-D-9aVaHj.js";
2
- import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-DHDub41t.js";
3
- import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-f24cZPEj.js";
1
+ import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Ji as postSlackMessage, Mi as formatProviderLabel, Ni as parseOAuthStatePayload, Pi as resolveBaseUrl, Z as getConversationPendingAuth, aa as getSlackClient, d as recordAuthorizationCompleted, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-D7XadqRY.js";
2
+ import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-UsaBOQgC.js";
3
+ import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DbXHuhac.js";
4
4
  import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
5
- import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-DBHig2sI.js";
5
+ import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-c__lw9GH.js";
6
6
  import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
7
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CwA-kSjW.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BSOlVfXi.js";
9
- import { t as discoverSkills } from "./skills-BFopj5ID.js";
10
- import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-CZjf6MOQ.js";
7
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CTtGtXZP.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-yGnL9ywD.js";
9
+ import { t as discoverSkills } from "./skills-CayJ8-Bj.js";
10
+ import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-ke-hOiuv.js";
11
11
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
12
- import { o as readIdentityById } from "./viewer-DG97nzP4.js";
13
- import { r as getStateAdapter } from "./adapter-CHMVy-j0.js";
14
- import { ht as getPersistedThreadState, vt as coerceThreadConversationState } from "./task-runner-XmXL9E-k.js";
15
- import { _ as getMcpProviderErrorAttributes } from "./service-account-B6OJtplS.js";
16
- import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-BAb0fedk.js";
12
+ import { o as readIdentityById } from "./viewer-so1MPU10.js";
13
+ import { r as getStateAdapter } from "./adapter-zphAlWE2.js";
14
+ import { ht as getPersistedThreadState, vt as coerceThreadConversationState } from "./task-runner-BinM1l5g.js";
15
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-_ml5D4Tk.js";
16
+ import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-CePSRCoR.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-D6xxVywK.js";
18
18
  import path from "node:path";
19
19
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import "./schema-DQaFSkZZ.js";
1
+ import "./schema-CC2RxDAV.js";
2
2
  import * as z from "zod";
3
3
  import "drizzle-orm";
4
4
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
@@ -1,8 +1,8 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { i as getChatConfig } from "./config-DHDub41t.js";
3
- import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-f24cZPEj.js";
2
+ import { i as getChatConfig } from "./config-UsaBOQgC.js";
3
+ import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-DbXHuhac.js";
4
4
  import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-6jsm_v96.js";
5
- import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-DKrtH0k_.js";
5
+ import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-N8-D5Gvv.js";
6
6
  import { d as historyReplacementSchema, f as newConversationEventSchema, p as encodeHistoryPayload, s as conversationEventDataSchema, u as decodeStoredConversationEvent, y as usageSchema } from "./media-BepyEUNm.js";
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
@@ -678,10 +678,13 @@ function systemIdentityFromSource(source) {
678
678
  };
679
679
  }
680
680
  /**
681
- * Save the Identity of a Conversation's actor and return its id. Use the
682
- * legacy source system Identity when the Conversation has no actor.
681
+ * Return the root Actor's Identity id. Save the Identity only when the
682
+ * Conversation has none yet. Use the legacy source system Identity when the
683
+ * Conversation has no actor.
683
684
  */
684
685
  async function resolveConversationActorIdentityId(executor, conversation) {
686
+ const [stored] = await executor.db().select({ actorIdentityId: juniorConversations.actorIdentityId }).from(juniorConversations).where(eq(juniorConversations.conversationId, conversation.conversationId)).limit(1);
687
+ if (stored?.actorIdentityId) return stored.actorIdentityId;
685
688
  const actor = actorFromStoredActor(conversation.actor);
686
689
  if (actor) return await resolveActorIdentityId(executor, actor, conversation.updatedAtMs);
687
690
  const fallback = systemIdentityFromSource(conversation.source);
@@ -1,6 +1,6 @@
1
1
  import { _ as withScope } from "./sentry-BRTJqumy.js";
2
- import "./config-DHDub41t.js";
3
- import { p as logException } from "./logging-f24cZPEj.js";
2
+ import "./config-UsaBOQgC.js";
3
+ import { h as logWarn, p as logException } from "./logging-DbXHuhac.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { sql } from "drizzle-orm";
6
6
  import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
@@ -771,6 +771,31 @@ const juniorSqlSchema = {
771
771
  juniorWorkspaces
772
772
  };
773
773
  // src/db/migrate.ts
774
+ const LOCK_TIMEOUT_MS = 5e3;
775
+ const LOCK_ATTEMPTS = 5;
776
+ const LOCK_RETRY_DELAY_MS = 5e3;
777
+ const LOCK_NOT_AVAILABLE = "55P03";
778
+ function isLockTimeout(error) {
779
+ let current = error;
780
+ for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {
781
+ if ("code" in current && current.code === LOCK_NOT_AVAILABLE) return true;
782
+ current = current.cause;
783
+ }
784
+ return false;
785
+ }
786
+ async function retryOnLockTimeout(tag, apply) {
787
+ for (let attempt = 1;; attempt += 1) try {
788
+ await apply();
789
+ return;
790
+ } catch (error) {
791
+ if (attempt >= LOCK_ATTEMPTS || !isLockTimeout(error)) throw error;
792
+ logWarn("db.migration.lock_timeout", {
793
+ "app.db.migration.tag": tag,
794
+ "app.db.migration.attempt": attempt
795
+ });
796
+ await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_DELAY_MS));
797
+ }
798
+ }
774
799
  /**
775
800
  * Apply pending Drizzle migrations, each in its own transaction.
776
801
  *
@@ -778,6 +803,7 @@ const juniorSqlSchema = {
778
803
  * (drizzle-orm#3249), so locks from earlier migrations stay held while later
779
804
  * migrations wait for theirs. That can deadlock with live traffic. This keeps
780
805
  * Drizzle's journal table and skip rule, so existing databases are unaffected.
806
+ * A migration that waits too long for a lock rolls back and runs again.
781
807
  */
782
808
  async function applyMigrations(executor, config) {
783
809
  const schema = config.migrationsSchema ?? "drizzle";
@@ -788,9 +814,12 @@ async function applyMigrations(executor, config) {
788
814
  const appliedAt = Number(last?.createdAt ?? 0);
789
815
  for (const migration of readMigrationFiles(config)) {
790
816
  if (migration.folderMillis <= appliedAt) continue;
791
- await executor.transaction(async () => {
792
- for (const statement of migration.sql) await executor.execute(statement);
793
- await executor.execute(`INSERT INTO ${table} (hash, created_at) VALUES ($1, $2)`, [migration.hash, migration.folderMillis]);
817
+ await retryOnLockTimeout(String(migration.folderMillis), async () => {
818
+ await executor.transaction(async () => {
819
+ await executor.execute(`SET LOCAL lock_timeout = ${LOCK_TIMEOUT_MS}`);
820
+ for (const statement of migration.sql) await executor.execute(statement);
821
+ await executor.execute(`INSERT INTO ${table} (hash, created_at) VALUES ($1, $2)`, [migration.hash, migration.folderMillis]);
822
+ });
794
823
  });
795
824
  }
796
825
  }
@@ -1,6 +1,6 @@
1
1
  import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-BRTJqumy.js";
2
- import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-f24cZPEj.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-QRdLPH-9.js";
2
+ import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-DbXHuhac.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-B3wmawmz.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
6
6
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
@@ -1,5 +1,5 @@
1
1
  import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-BRTJqumy.js";
2
- import { t as JUNIOR_VERSION } from "./version-DQgCf4FE.js";
2
+ import { t as JUNIOR_VERSION } from "./version-C3sVz3bv.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { $a as readConversationAccessFromSql, Cn as renderUntrustedTag, Xa as canAccessConversation } from "./projection-D-9aVaHj.js";
3
- import { n as botConfig } from "./config-DHDub41t.js";
4
- import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-DBHig2sI.js";
5
- import { dn as actorFromRun, fn as toolInvocationDestination, in as AgentMessageTargetError, nn as AgentMessagePausedError } from "./agent-runner-CZjf6MOQ.js";
6
- import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-hhpek6Fn.js";
7
- import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-1cku9Vm3.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-CK869JpC.js";
9
- import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-Ch3EWO6u.js";
10
- import { r as enqueueAgentMessageToParent } from "./result-B2sCVIwl.js";
2
+ import { $a as readConversationAccessFromSql, Cn as renderUntrustedTag, Xa as canAccessConversation } from "./projection-D7XadqRY.js";
3
+ import { n as botConfig } from "./config-UsaBOQgC.js";
4
+ import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-c__lw9GH.js";
5
+ import { dn as actorFromRun, fn as toolInvocationDestination, in as AgentMessageTargetError, nn as AgentMessagePausedError } from "./agent-runner-ke-hOiuv.js";
6
+ import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-DH5nE6HJ.js";
7
+ import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-BbsyIbK2.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-lotbeXq3.js";
9
+ import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-Cw6Fzvfz.js";
10
+ import { r as enqueueAgentMessageToParent } from "./result-Cr9tUdfS.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-BB1j2krL.js";
1
+ import { i as JuniorDashboardOptions } from "./app-C47PT68y.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-f24cZPEj.js";
1
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-DbXHuhac.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
3
- import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-2gKhjRD3.js";
3
+ import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-QDH_JS3D.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
5
5
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
6
6
  import path from "node:path";
@@ -1,5 +1,5 @@
1
- import { En as createUserTokenStore } from "./projection-D-9aVaHj.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-YIMGiRk7.js";
1
+ import { En as createUserTokenStore } from "./projection-D7XadqRY.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-LNRLXZCn.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,19 +1,19 @@
1
1
  import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { A as estimateTextTokens, E as resolveGatewayModel, I as unwrapCurrentInstruction, J as toOptionalTrimmed, L as escapeXml, S as completeObject, T as rerankTexts, i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName, w as embedTexts, x as completeDecision, y as GEN_AI_PROVIDER_NAME } from "./config-DHDub41t.js";
3
- import { E as withSpan, G as isRecord$2, K as toOptionalNumber, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, q as toOptionalString, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-f24cZPEj.js";
4
- import { t as canExposeConversationPayload } from "./conversation-privacy-QRdLPH-9.js";
2
+ import { A as estimateTextTokens, E as resolveGatewayModel, I as unwrapCurrentInstruction, J as toOptionalTrimmed, L as escapeXml, S as completeObject, T as rerankTexts, i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName, w as embedTexts, x as completeDecision, y as GEN_AI_PROVIDER_NAME } from "./config-UsaBOQgC.js";
3
+ import { E as withSpan, G as isRecord$2, K as toOptionalNumber, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, q as toOptionalString, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-DbXHuhac.js";
4
+ import { t as canExposeConversationPayload } from "./conversation-privacy-B3wmawmz.js";
5
5
  import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId } from "./actor-6jsm_v96.js";
6
- import { $ as sameDestination, B as addAgentTurnUsage, D as resolveActorIdentityId, I as bindProviderConversation, M as readUserTimezone, P as saveUserTimezone, W as hasAgentTurnUsage, Z as parseDestination, a as getConversationStore, d as createSqlConversationEventStore, f as eventFromRow, o as getDb, p as withConversationEventLock, q as conversationDetailTouch, r as getConversationEventStore, s as getSqlExecutor, w as startLocationThread, y as createSqlStore } from "./db-DBHig2sI.js";
7
- import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-DKrtH0k_.js";
6
+ import { $ as sameDestination, B as addAgentTurnUsage, D as resolveActorIdentityId, I as bindProviderConversation, M as readUserTimezone, P as saveUserTimezone, W as hasAgentTurnUsage, Z as parseDestination, a as getConversationStore, d as createSqlConversationEventStore, f as eventFromRow, o as getDb, p as withConversationEventLock, q as conversationDetailTouch, r as getConversationEventStore, s as getSqlExecutor, w as startLocationThread, y as createSqlStore } from "./db-c__lw9GH.js";
7
+ import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-N8-D5Gvv.js";
8
8
  import { _ as instructionProvenanceFor, g as instructionActors, h as contextProvenance, o as agentHistoryItemSchema } from "./media-BepyEUNm.js";
9
- import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-CwA-kSjW.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BSOlVfXi.js";
11
- import { d as JUNIOR_NATIVE_EVENT_NAMESPACE, f as agentsInstructionsUpdatedEvent, g as renderJuniorNativeConversationEvent, l as completeObject$1, m as authenticationUnlinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as authenticationLinkedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-C7SZhNDy.js";
9
+ import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-CTtGtXZP.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-yGnL9ywD.js";
11
+ import { d as JUNIOR_NATIVE_EVENT_NAMESPACE, f as agentsInstructionsUpdatedEvent, g as renderJuniorNativeConversationEvent, l as completeObject$1, m as authenticationUnlinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as authenticationLinkedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-CzEV4BF4.js";
12
12
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
13
- import { g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-DG97nzP4.js";
14
- import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-CHMVy-j0.js";
13
+ import { g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-so1MPU10.js";
14
+ import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-zphAlWE2.js";
15
15
  import { n as isWithinNotificationSchedule, r as notificationScheduleSchema, s as isValidTimeZone, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-cP0AACm1.js";
16
- import { I as messageCardRef, J as briefResourceLabel, P as reviewItemChangeRecordSchema, R as readMessageCardRefs, W as readMessageAttachments, X as parseBriefInput, Y as conversationBriefSchema, Z as parseStoredBrief, _ as conversationReportEventSchema, v as conversationReportMessageEventSchema } from "./conversation-CwC8K3RZ.js";
16
+ import { I as messageCardRef, J as briefResourceLabel, P as reviewItemChangeRecordSchema, R as readMessageCardRefs, W as readMessageAttachments, X as parseBriefInput, Y as conversationBriefSchema, Z as parseStoredBrief, _ as conversationReportEventSchema, v as conversationReportMessageEventSchema } from "./conversation-CtjR1Zcx.js";
17
17
  import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
18
18
  import path from "node:path";
19
19
  import { isDeepStrictEqual } from "node:util";
@@ -1,7 +1,7 @@
1
- import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-DHDub41t.js";
2
- import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-f24cZPEj.js";
3
- import { V as agentTurnCostUsd, r as getConversationEventStore } from "./db-DBHig2sI.js";
4
- import { X as parseBriefInput, Y as conversationBriefSchema, q as briefOutcomeStatusSchema } from "./conversation-CwC8K3RZ.js";
1
+ import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-UsaBOQgC.js";
2
+ import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-DbXHuhac.js";
3
+ import { V as agentTurnCostUsd, r as getConversationEventStore } from "./db-c__lw9GH.js";
4
+ import { X as parseBriefInput, Y as conversationBriefSchema, q as briefOutcomeStatusSchema } from "./conversation-CtjR1Zcx.js";
5
5
  import * as z from "zod";
6
6
  import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
7
7
  // src/chat/conversations/structured-events.ts
@@ -1,4 +1,4 @@
1
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-f24cZPEj.js";
1
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-DbXHuhac.js";
2
2
  import { o as isUserActor, s as parseActorUserId } from "./actor-6jsm_v96.js";
3
3
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJhGdS4c.js";
4
4
  import path from "node:path";
@@ -1,6 +1,6 @@
1
- import { Ei as isStale, La as SANDBOX_COMMAND_PATH, Oi as getSandboxProvider, Va as SANDBOX_WORKSPACE_ROOT, ja as sleep, qa as runNonInteractiveCommand, wi as create } from "./projection-D-9aVaHj.js";
2
- import { E as withSpan, b as setSpanAttributes } from "./logging-f24cZPEj.js";
3
- import { r as getStateAdapter } from "./adapter-CHMVy-j0.js";
1
+ import { Ei as isStale, La as SANDBOX_COMMAND_PATH, Oi as getSandboxProvider, Va as SANDBOX_WORKSPACE_ROOT, ja as sleep, qa as runNonInteractiveCommand, wi as create } from "./projection-D7XadqRY.js";
2
+ import { E as withSpan, b as setSpanAttributes } from "./logging-DbXHuhac.js";
3
+ import { r as getStateAdapter } from "./adapter-zphAlWE2.js";
4
4
  import * as z from "zod";
5
5
  // src/chat/sandbox/resources.ts
6
6
  let configuredResources;
@@ -1,12 +1,12 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Cn as renderUntrustedTag } from "./projection-D-9aVaHj.js";
3
- import { T as SYSTEM_IDENTITY_ID } from "./db-DBHig2sI.js";
4
- import { f as credentialContextForActor } from "./registry-CwA-kSjW.js";
5
- import { sn as listUnreportedSiblingAgents } from "./agent-runner-CZjf6MOQ.js";
6
- import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-hhpek6Fn.js";
7
- import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-1cku9Vm3.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-CK869JpC.js";
9
- import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-Ch3EWO6u.js";
2
+ import { Cn as renderUntrustedTag } from "./projection-D7XadqRY.js";
3
+ import { T as SYSTEM_IDENTITY_ID } from "./db-c__lw9GH.js";
4
+ import { f as credentialContextForActor } from "./registry-CTtGtXZP.js";
5
+ import { sn as listUnreportedSiblingAgents } from "./agent-runner-ke-hOiuv.js";
6
+ import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-DH5nE6HJ.js";
7
+ import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-BbsyIbK2.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-lotbeXq3.js";
9
+ import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-Cw6Fzvfz.js";
10
10
  import { n as isAgentInvocationResultEventType, t as agentInvocationResultEventType } from "./result-event-type-DD6BAgT7.js";
11
11
  // src/chat/agent-invocations/result.ts
12
12
  var result_exports = /* @__PURE__ */ __exportAll({