@sentry/junior 0.304.0 → 0.305.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 (59) hide show
  1. package/dist/{adapter-context-B1IpoELr.js → adapter-context-BpvbUki8.js} +2 -2
  2. package/dist/{admin-BnVFGo_z.js → admin-CoDt35ny.js} +2 -2
  3. package/dist/{agent-runner-CoEeZSRh.js → agent-runner-C5d6rY5g.js} +75 -38
  4. package/dist/api.js +28 -28
  5. package/dist/app.js +38 -47
  6. package/dist/{background-compaction-queue-WLPNSF_b.js → background-compaction-queue-BTqMIfTA.js} +7 -3
  7. package/dist/{briefs-CagVVefw.js → briefs-BRdznF7c.js} +2 -2
  8. package/dist/{catalog-runtime-B8ZXvXWm.js → catalog-runtime-J52Tej47.js} +1 -1
  9. package/dist/cli/chat.js +15 -15
  10. package/dist/cli/check.js +3 -3
  11. package/dist/cli/main.js +3 -3
  12. package/dist/cli/plugins.js +4 -4
  13. package/dist/cli/snapshot-create.js +5 -5
  14. package/dist/cli/upgrade.js +3 -3
  15. package/dist/{config-DdO1BNcw.js → config-CBZp0udd.js} +2 -2
  16. package/dist/{connections-D20kp0j5.js → connections-BYmuJ6Vm.js} +6 -6
  17. package/dist/{continue-in-slack-BKEVMBj1.js → continue-in-slack-Cvot6S38.js} +5 -5
  18. package/dist/{conversation-privacy-L1SK_v0V.js → conversation-privacy-D2pOzBNl.js} +1 -1
  19. package/dist/{conversation-turn-BptVJylj.js → conversation-turn-CI8WDpnK.js} +15 -15
  20. package/dist/{credential-sync-D1J1CGzL.js → credential-sync-COqnZ1Dx.js} +13 -13
  21. package/dist/{db-EKJnkrIb.js → db-DU84dCVu.js} +3 -3
  22. package/dist/{executor-CoIZmFK8.js → executor-CFyrgOu1.js} +2 -2
  23. package/dist/{install-BT2Pf6HP.js → install-CQ76CfRw.js} +2 -2
  24. package/dist/instrumentation.js +2 -2
  25. package/dist/{lineage-C5DGQCS_.js → lineage-DLd2UxVP.js} +2 -2
  26. package/dist/{logging-QSZuMcvo.js → logging-BPNTQVFu.js} +1 -1
  27. package/dist/{message-TtxftRHj.js → message-BWJLeQ5e.js} +8 -8
  28. package/dist/{model-input-BHXfA29g.js → model-input-DoM9Ht-d.js} +2 -2
  29. package/dist/nitro.js +4 -4
  30. package/dist/{oauth-callback-server-B0enqHtZ.js → oauth-callback-server-DeHbnAQl.js} +2 -2
  31. package/dist/{projection-CNKK7doO.js → projection-CcFBVFUo.js} +15 -12
  32. package/dist/{prompt-DSjhoKu5.js → prompt-C5LREK2p.js} +3 -3
  33. package/dist/{queue-CDxkit82.js → queue-B2AAL3ym.js} +4 -4
  34. package/dist/{registry-DBDNUUmz.js → registry-BjZZqKqi.js} +1 -1
  35. package/dist/{resolve-CQLhMWSu.js → resolve-CeJgXuH1.js} +3 -3
  36. package/dist/{result-B-pauj42.js → result-icDrueyB.js} +8 -8
  37. package/dist/{runner-B3KxKks5.js → runner-nVfMkMMB.js} +8 -8
  38. package/dist/{sandbox-egress-signals-DJJX9ClG.js → sandbox-egress-signals-H9vQ5qRf.js} +1 -1
  39. package/dist/{service-account-2HmlNPvy.js → service-account-DU5865XA.js} +5 -5
  40. package/dist/{service-account-DQLqkSVv.js → service-account-Dw06p3zm.js} +3 -3
  41. package/dist/{session-stop-DEeZKqbX.js → session-stop-uotLtp4g.js} +79 -22
  42. package/dist/{skills-2UrD7JkN.js → skills-Bex1EaO5.js} +2 -2
  43. package/dist/{slack-conversation-unfurl-Dd129Uov.js → slack-conversation-unfurl-EPG3riWF.js} +9 -9
  44. package/dist/{spawn-eMho9HDJ.js → spawn-CoD3vDuS.js} +6 -6
  45. package/dist/{state-Bveuc4Zh.js → state-nCR4Muhn.js} +4 -4
  46. package/dist/{stop-D_ltJLDS.js → stop-BFVd0P0m.js} +29 -30
  47. package/dist/{store-COeYnPL_.js → store-Ca6G962n.js} +5 -5
  48. package/dist/{task-queue-CBIDXZpV.js → task-queue-BLPZU6kC.js} +3 -3
  49. package/dist/{task-runner-CJF7zIJL.js → task-runner-xsOPIxCZ.js} +6 -6
  50. package/dist/{thread-context-Cg0jt0aE.js → thread-context-BOvZhsKK.js} +7 -7
  51. package/dist/{turn-session-routing-CaY3Tp8m.js → turn-session-routing-2bW2qfeb.js} +7 -7
  52. package/dist/{turn-user-message-tcom1RYd.js → turn-user-message-BrhuyYrH.js} +3 -3
  53. package/dist/{validation-EU91JwIT.js → validation-BnY9K5WB.js} +1 -1
  54. package/dist/{version-BYRPhY5G.js → version-qROlRQGF.js} +1 -1
  55. package/dist/version.js +1 -1
  56. package/dist/{viewer-Cf8ISkAc.js → viewer-CxUiOraX.js} +3 -3
  57. package/dist/{warmup-TgY4S1vx.js → warmup--Gkz7iB-.js} +21 -24
  58. package/dist/{worker-C6Uq4OKD.js → worker-DJ8d9fmD.js} +7 -7
  59. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-DdO1BNcw.js";
2
- import { E as withSpan, m as logInfo, p as logException } from "./logging-QSZuMcvo.js";
1
+ import { i as getChatConfig } from "./config-CBZp0udd.js";
2
+ import { E as withSpan, m as logInfo, p as logException } from "./logging-BPNTQVFu.js";
3
3
  import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
4
4
  import * as z from "zod";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -43,6 +43,10 @@ function getTurnRequestDeadline() {
43
43
  /** Run work with one host request deadline shared by nested queued turns. */
44
44
  function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
45
45
  if (requestDeadlineStorage.getStore()) return callback();
46
+ return runWithNewTurnRequestDeadline(callback, startedAtMs);
47
+ }
48
+ /** Run work that a new host request owns, even inside another request. */
49
+ function runWithNewTurnRequestDeadline(callback, startedAtMs = Date.now()) {
46
50
  return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
47
51
  }
48
52
  // src/chat/queue/bullmq.ts
@@ -367,7 +371,7 @@ function queueCallback(options) {
367
371
  return;
368
372
  }
369
373
  if (checked.status === "unavailable") throw new Error(`Queue message verification unavailable: ${checked.reason}`);
370
- await consume(checked.message, metadata);
374
+ await runWithNewTurnRequestDeadline(() => consume(checked.message, metadata));
371
375
  };
372
376
  const retry = (error, metadata) => {
373
377
  const reason = options.permanentError?.(error);
@@ -1,5 +1,5 @@
1
1
  import { Q as briefResourceLabel, Y as briefCodeChangeSchema, et as parseBriefInput, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-BOqdRtUx.js";
2
- import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DSjhoKu5.js";
2
+ import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C5LREK2p.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -264,7 +264,7 @@ async function parseRunOptions(argv) {
264
264
  * token.
265
265
  */
266
266
  async function configuredBot() {
267
- const { botConfig } = await import("./config-DdO1BNcw.js").then((n) => n.r);
267
+ const { botConfig } = await import("./config-CBZp0udd.js").then((n) => n.r);
268
268
  return botConfig;
269
269
  }
270
270
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-DBDNUUmz.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BjZZqKqi.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,5 +1,5 @@
1
1
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
2
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CoEeZSRh.js";
2
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-C5d6rY5g.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
5
5
  import { stderr, stdin, stdout } from "node:process";
@@ -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-Bkk0XRo2.js").then((n) => n.o),
102
- import("../projection-CNKK7doO.js").then((n) => n.Qn),
103
- import("../catalog-runtime-B8ZXvXWm.js").then((n) => n.t),
104
- import("../validation-EU91JwIT.js").then((n) => n.r),
105
- import("../db-EKJnkrIb.js").then((n) => n.n)
102
+ import("../projection-CcFBVFUo.js").then((n) => n.Qn),
103
+ import("../catalog-runtime-J52Tej47.js").then((n) => n.t),
104
+ import("../validation-BnY9K5WB.js").then((n) => n.r),
105
+ import("../db-DU84dCVu.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,19 +152,19 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-CNKK7doO.js").then((n) => n.pr);
155
+ const { setBriefsConfig } = await import("../projection-CcFBVFUo.js").then((n) => n.pr);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-B3KxKks5.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-B0enqHtZ.js");
157
+ const { runLocalAgentTurn } = await import("../runner-nVfMkMMB.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DeHbnAQl.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-DAmfVmJu.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DJJX9ClG.js");
161
- const { bindSpawnAgent } = await import("../spawn-eMho9HDJ.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-TtxftRHj.js").then((n) => n.n);
163
- const { createChildConversationWorker, createDeliverToParent } = await import("../result-B-pauj42.js").then((n) => n.o);
164
- const { createConversationTurnWorker } = await import("../conversation-turn-BptVJylj.js").then((n) => n.t);
165
- const { skipInputAfterConversationStop } = await import("../session-stop-DEeZKqbX.js").then((n) => n.a);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-H9vQ5qRf.js");
161
+ const { bindSpawnAgent } = await import("../spawn-CoD3vDuS.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-BWJLeQ5e.js").then((n) => n.n);
163
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-icDrueyB.js").then((n) => n.o);
164
+ const { createConversationTurnWorker } = await import("../conversation-turn-CI8WDpnK.js").then((n) => n.t);
165
+ const { skipInputAfterConversationStop } = await import("../session-stop-uotLtp4g.js").then((n) => n.a);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
167
- const { processConversationWork } = await import("../worker-C6Uq4OKD.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-DJ8d9fmD.js").then((n) => n.n);
168
168
  let agentRunner;
169
169
  const localConversationWork = createLocalConversationWork(async (message) => {
170
170
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as parseSkillFile } from "../skills-2UrD7JkN.js";
2
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-QSZuMcvo.js";
3
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DBDNUUmz.js";
1
+ import { i as parseSkillFile } from "../skills-Bex1EaO5.js";
2
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-BPNTQVFu.js";
3
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BjZZqKqi.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -45,13 +45,13 @@ async function runChat(argv, pluginSet) {
45
45
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
46
46
  }
47
47
  async function runAdmin(argv) {
48
- return await (await import("../admin-BnVFGo_z.js")).runAdmin(argv);
48
+ return await (await import("../admin-CoDt35ny.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-DQLqkSVv.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-Dw06p3zm.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-CagVVefw.js")).runBriefs(argv);
54
+ return await (await import("../briefs-BRdznF7c.js")).runBriefs(argv);
55
55
  }
56
56
  function topLevelCommand(argv) {
57
57
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { o as getDb } from "../db-EKJnkrIb.js";
2
- import { _o as createPluginLogger, dr as validatePlugins, ur as setPlugins } from "../projection-CNKK7doO.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-EU91JwIT.js";
1
+ import { o as getDb } from "../db-DU84dCVu.js";
2
+ import { _o as createPluginLogger, dr as validatePlugins, ur as setPlugins } from "../projection-CcFBVFUo.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-J52Tej47.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BnY9K5WB.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
6
6
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-Bkk0XRo2.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,8 +1,8 @@
1
- import { i as getChatConfig } from "../config-DdO1BNcw.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
3
- import { n as resolve } from "../resolve-CQLhMWSu.js";
4
- import { Za as SANDBOX_RUNTIME, ea as create } from "../projection-CNKK7doO.js";
5
- import { J as disconnectStateAdapter } from "../db-EKJnkrIb.js";
1
+ import { i as getChatConfig } from "../config-CBZp0udd.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-J52Tej47.js";
3
+ import { n as resolve } from "../resolve-CeJgXuH1.js";
4
+ import { Za as SANDBOX_RUNTIME, ea as create } from "../projection-CcFBVFUo.js";
5
+ import { J as disconnectStateAdapter } from "../db-DU84dCVu.js";
6
6
  // src/cli/snapshot-create.ts
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
8
8
  function progressMessage(phase) {
@@ -1,7 +1,7 @@
1
- import { i as getChatConfig } from "../config-DdO1BNcw.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-CoIZmFK8.js";
1
+ import { i as getChatConfig } from "../config-CBZp0udd.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-CFyrgOu1.js";
3
3
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
4
- import { t as createPluginCatalogRuntime } from "../registry-DBDNUUmz.js";
4
+ import { t as createPluginCatalogRuntime } from "../registry-BjZZqKqi.js";
5
5
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-Bkk0XRo2.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
7
7
  import { createHash } from "node:crypto";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-QSZuMcvo.js";
3
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-L1SK_v0V.js";
2
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-BPNTQVFu.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D2pOzBNl.js";
4
4
  import { AwsClient } from "aws4fetch";
5
5
  import { del, get, issueSignedToken, presignUrl, put } from "@vercel/blob";
6
6
  import * as z from "zod";
@@ -1,9 +1,9 @@
1
- import { da as startOAuthFlow } from "./projection-CNKK7doO.js";
2
- import { n as botConfig } from "./config-DdO1BNcw.js";
3
- import { R as deleteProviderIdentityForSlackUser, s as getSqlExecutor, z as deleteProviderIdentityForUser } from "./db-EKJnkrIb.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-DBDNUUmz.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-B8ZXvXWm.js";
6
- import { h as deleteMcpStoredOAuthCredentials, m as deleteMcpServerSessionId, p as deleteMcpAuthSessionsForUserProvider } from "./service-account-2HmlNPvy.js";
1
+ import { da as startOAuthFlow } from "./projection-CcFBVFUo.js";
2
+ import { n as botConfig } from "./config-CBZp0udd.js";
3
+ import { R as deleteProviderIdentityForSlackUser, s as getSqlExecutor, z as deleteProviderIdentityForUser } from "./db-DU84dCVu.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-BjZZqKqi.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
6
+ import { h as deleteMcpStoredOAuthCredentials, m as deleteMcpServerSessionId, p as deleteMcpAuthSessionsForUserProvider } from "./service-account-DU5865XA.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. */
@@ -1,9 +1,9 @@
1
- import { Ao as readLatestConversationBrief, Ca as getSlackMessagePermalink, Da as postSlackMessage, Lt as moveIdleConversationDestination, Sa as deleteSlackMessage, ki as getDashboardConversationLink, ma as formatSlackLink, pa as escapeSlackMrkdwnText } from "./projection-CNKK7doO.js";
2
- import { C as withConversationMutationLock, M as setFirstConversationLocation, X as getStateAdapter, a as getConversationStore, it as getConversationIdByProviderConversation, o as getDb, rt as claimProviderConversation, s as getSqlExecutor } from "./db-EKJnkrIb.js";
1
+ import { Ao as readLatestConversationBrief, Ca as getSlackMessagePermalink, Da as postSlackMessage, Lt as moveIdleConversationDestination, Sa as deleteSlackMessage, ki as getDashboardConversationLink, ma as formatSlackLink, pa as escapeSlackMrkdwnText } from "./projection-CcFBVFUo.js";
2
+ import { C as withConversationMutationLock, M as setFirstConversationLocation, X as getStateAdapter, a as getConversationStore, it as getConversationIdByProviderConversation, o as getDb, rt as claimProviderConversation, s as getSqlExecutor } from "./db-DU84dCVu.js";
3
3
  import { u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
4
- import { mr as joinPublicChannelForRead, pr as checkSlackChannelReadAccess } from "./warmup-TgY4S1vx.js";
5
- import "./store-COeYnPL_.js";
6
- import { I as juniorDestinations } from "./executor-CoIZmFK8.js";
4
+ import { mr as joinPublicChannelForRead, pr as checkSlackChannelReadAccess } from "./warmup--Gkz7iB-.js";
5
+ import "./store-Ca6G962n.js";
6
+ import { I as juniorDestinations } from "./executor-CFyrgOu1.js";
7
7
  import { and, eq } from "drizzle-orm";
8
8
  // src/chat/slack/continue-in-slack.ts
9
9
  /** Refusal for a move that cannot wait for the active Run. */
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-QSZuMcvo.js";
1
+ import { h as logWarn } from "./logging-BPNTQVFu.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
4
4
  // src/chat/conversation-privacy.ts
@@ -1,22 +1,22 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { B as blockScheduledAutomation, E as notifyAutomationBlocked, X as blockEventAutomation, a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, i as getPersistedSandboxState, k as readAutomationExecutionByConversationId, m as getDispatchIdForConversation, s as persistThreadStateById } from "./turn-session-routing-CaY3Tp8m.js";
3
- import { E as isTopLevelKind, T as isPersonInput, a as getConversationStore, k as turnBehavior, mt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-EKJnkrIb.js";
4
- import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-QSZuMcvo.js";
2
+ import { B as blockScheduledAutomation, E as notifyAutomationBlocked, X as blockEventAutomation, a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, i as getPersistedSandboxState, k as readAutomationExecutionByConversationId, m as getDispatchIdForConversation, s as persistThreadStateById } from "./turn-session-routing-2bW2qfeb.js";
3
+ import { E as isTopLevelKind, T as isPersonInput, a as getConversationStore, k as turnBehavior, mt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-DU84dCVu.js";
4
+ import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-BPNTQVFu.js";
5
5
  import { J as readMessageAttachments } from "./conversation-BOqdRtUx.js";
6
- import { N as juniorConversations } from "./executor-CoIZmFK8.js";
7
- import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-Cg0jt0aE.js";
8
- import { Hn as AgentRunError, On as supersedeOpenMailboxTurns, Ot as resolveConversationDestination, Un as executeTurn, in as isParentMessageMeta, rn as childAgentTurnOptions, sn as readParentMessage, vn as completeCancelledConversationTurn, zn as createWebAuthorization } from "./warmup-TgY4S1vx.js";
9
- import { A as latestConversationMessageSeq, Di as verifyTimerWatchCredentialSubject, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, a as loadProjection, at as failTurnRecord, b as persistConversationMessages, bn as persistWithRetry, j as markConversationMessage, nt as saveTurnCheckpoint, st as getTurnRecord, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-CNKK7doO.js";
10
- import { R as buildDeterministicTurnId, _ as ConversationTurnLifecycleService, d as isTurnInputCommitLostError, g as startActiveTurn, h as markTurnFailed, l as getConversationTurnBoundaryError, s as TurnInputCommitLostError, t as getTurnUserMessage } from "./turn-user-message-tcom1RYd.js";
11
- import { f as credentialContextForActor } from "./registry-DBDNUUmz.js";
6
+ import { N as juniorConversations } from "./executor-CFyrgOu1.js";
7
+ import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-BOvZhsKK.js";
8
+ import { Hn as AgentRunError, On as supersedeOpenMailboxTurns, Ot as resolveConversationDestination, Un as executeTurn, in as isParentMessageMeta, rn as childAgentTurnOptions, sn as readParentMessage, vn as completeCancelledConversationTurn, zn as createWebAuthorization } from "./warmup--Gkz7iB-.js";
9
+ import { A as latestConversationMessageSeq, Di as verifyTimerWatchCredentialSubject, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, a as loadProjection, at as failTurnRecord, b as persistConversationMessages, bn as persistWithRetry, j as markConversationMessage, nt as saveTurnCheckpoint, st as getTurnRecord, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-CcFBVFUo.js";
10
+ import { R as buildDeterministicTurnId, _ as ConversationTurnLifecycleService, d as isTurnInputCommitLostError, g as startActiveTurn, h as markTurnFailed, l as getConversationTurnBoundaryError, s as TurnInputCommitLostError, t as getTurnUserMessage } from "./turn-user-message-BrhuyYrH.js";
11
+ import { f as credentialContextForActor } from "./registry-BjZZqKqi.js";
12
12
  import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
13
- import { i as measureTurnCompactionWait } from "./agent-runner-CoEeZSRh.js";
14
- import { n as botConfig } from "./config-DdO1BNcw.js";
15
- import { D as turnInputFactsFromConversationMessage, E as sourceFromTurnInput, I as maybePostAutomatedTurnLimitNotice, M as isEventMailboxMetadata, N as renderEventBatchInputs, O as legacyWebMailboxMetadataSchema, P as timerWatchCredentialSubject, U as recordFinishedTurnForAutomatedLimit, c as loadReviewItemInput, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, j as eventBatchMessageMeta, m as instructionForInputs, p as instructionActorFor, s as eventReviewItemInputs, x as getEventBatchDelayMs } from "./session-stop-DEeZKqbX.js";
16
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CJF7zIJL.js";
13
+ import { i as measureTurnCompactionWait } from "./agent-runner-C5d6rY5g.js";
14
+ import { n as botConfig } from "./config-CBZp0udd.js";
15
+ import { D as turnInputFactsFromConversationMessage, E as sourceFromTurnInput, G as recordFinishedTurnForAutomatedLimit, I as maybePostAutomatedTurnLimitNotice, M as isEventMailboxMetadata, N as renderEventBatchInputs, O as legacyWebMailboxMetadataSchema, P as timerWatchCredentialSubject, c as loadReviewItemInput, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, j as eventBatchMessageMeta, m as instructionForInputs, p as instructionActorFor, s as eventReviewItemInputs, x as getEventBatchDelayMs } from "./session-stop-uotLtp4g.js";
16
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-xsOPIxCZ.js";
17
17
  import { p as instructionProvenanceFor } from "./history-m2-ceTTX.js";
18
- import { o as isEventConversationMessage } from "./prompt-DSjhoKu5.js";
19
- import { t as readConversationLineage } from "./lineage-C5DGQCS_.js";
18
+ import { o as isEventConversationMessage } from "./prompt-C5LREK2p.js";
19
+ import { t as readConversationLineage } from "./lineage-DLd2UxVP.js";
20
20
  import { isDeepStrictEqual } from "node:util";
21
21
  import { createHash } from "node:crypto";
22
22
  import { and, eq, isNotNull, isNull } from "drizzle-orm";
@@ -1,19 +1,19 @@
1
- import { Da as postSlackMessage, Yn as createUserTokenStore, Z as getConversationPendingAuth, Zn as resolvePluginOAuthAccount, ca as formatProviderLabel, d as recordAuthorizationCompleted, is as getSlackClient, la as parseOAuthStatePayload, st as getTurnRecord, u as recordAuthenticationLinked, ua as resolveBaseUrl } from "./projection-CNKK7doO.js";
2
- import { V as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-DdO1BNcw.js";
3
- import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-QSZuMcvo.js";
1
+ import { Da as postSlackMessage, Yn as createUserTokenStore, Z as getConversationPendingAuth, Zn as resolvePluginOAuthAccount, ca as formatProviderLabel, d as recordAuthorizationCompleted, is as getSlackClient, la as parseOAuthStatePayload, st as getTurnRecord, u as recordAuthenticationLinked, ua as resolveBaseUrl } from "./projection-CcFBVFUo.js";
2
+ import { V as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-CBZp0udd.js";
3
+ import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-BPNTQVFu.js";
4
4
  import { p as parseSlackUserId } from "./actor-D2iXzvlN.js";
5
- import { B as findUserByVerifiedEmails, I as resolveActorIdentityId, W as upsertLinkedIdentity, X as getStateAdapter, et as acquireActiveLock, s as getSqlExecutor } from "./db-EKJnkrIb.js";
5
+ import { B as findUserByVerifiedEmails, I as resolveActorIdentityId, W as upsertLinkedIdentity, X as getStateAdapter, et as acquireActiveLock, s as getSqlExecutor } from "./db-DU84dCVu.js";
6
6
  import { i as homeDir } from "./package-discovery-x4AvVhMj.js";
7
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DBDNUUmz.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-B8ZXvXWm.js";
9
- import { t as discoverSkills } from "./skills-2UrD7JkN.js";
10
- import { o as finalizeMcpAuthorization } from "./agent-runner-CoEeZSRh.js";
11
- import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-2HmlNPvy.js";
12
- import { o as readIdentityById } from "./viewer-Cf8ISkAc.js";
7
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BjZZqKqi.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
9
+ import { t as discoverSkills } from "./skills-Bex1EaO5.js";
10
+ import { o as finalizeMcpAuthorization } from "./agent-runner-C5d6rY5g.js";
11
+ import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-DU5865XA.js";
12
+ import { o as readIdentityById } from "./viewer-CxUiOraX.js";
13
13
  import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
14
- import { Bn as deleteWebAuthorization, L as lookupSlackUserProfile, Mn as wakeAuthorizedTurn, Nn as wakePausedTurn } from "./warmup-TgY4S1vx.js";
15
- import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-CaY3Tp8m.js";
16
- import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-D20kp0j5.js";
14
+ import { Bn as deleteWebAuthorization, L as lookupSlackUserProfile, Mn as wakeAuthorizedTurn, Nn as wakePausedTurn } from "./warmup--Gkz7iB-.js";
15
+ import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-2bW2qfeb.js";
16
+ import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-BYmuJ6Vm.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-DAmfVmJu.js";
18
18
  import * as z from "zod";
19
19
  import path from "node:path";
@@ -1,9 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { i as getChatConfig } from "./config-DdO1BNcw.js";
2
+ import { i as getChatConfig } from "./config-CBZp0udd.js";
3
3
  import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-D2iXzvlN.js";
4
- import { C as juniorConversationMetrics, D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, P as juniorIdentities, S as CONVERSATION_METRICS, T as juniorConversationEvents, j as juniorAttachments, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as isUserInstruction, y as juniorConversationBindings } from "./executor-CoIZmFK8.js";
4
+ import { C as juniorConversationMetrics, D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, P as juniorIdentities, S as CONVERSATION_METRICS, T as juniorConversationEvents, j as juniorAttachments, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as isUserInstruction, y as juniorConversationBindings } from "./executor-CFyrgOu1.js";
5
5
  import { c as newConversationEventSchema, h as usageSchema, l as encodeHistoryPayload, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-m2-ceTTX.js";
6
- import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-QSZuMcvo.js";
6
+ import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-BPNTQVFu.js";
7
7
  import * as z from "zod";
8
8
  import { createHash, randomUUID } from "node:crypto";
9
9
  import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
- import { h as logWarn, p as logException } from "./logging-QSZuMcvo.js";
1
+ import { h as logWarn, p as logException } from "./logging-BPNTQVFu.js";
2
2
  import { _ as withScope } from "./sentry-CPbZjomA.js";
3
- import "./config-DdO1BNcw.js";
3
+ import "./config-CBZp0udd.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { sql } from "drizzle-orm";
6
6
  import { bigint, boolean, check, customType, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
@@ -1,5 +1,5 @@
1
- import { ao as SANDBOX_COMMAND_PATH, ho as runNonInteractiveCommand, lo as SANDBOX_WORKSPACE_ROOT } from "./projection-CNKK7doO.js";
2
- import { E as withSpan, b as setSpanAttributes } from "./logging-QSZuMcvo.js";
1
+ import { ao as SANDBOX_COMMAND_PATH, ho as runNonInteractiveCommand, lo as SANDBOX_WORKSPACE_ROOT } from "./projection-CcFBVFUo.js";
2
+ import { E as withSpan, b as setSpanAttributes } from "./logging-BPNTQVFu.js";
3
3
  // src/chat/sandbox/resources.ts
4
4
  let configuredResources;
5
5
  function resourcesFromEnv() {
@@ -1,10 +1,10 @@
1
1
  import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-CPbZjomA.js";
2
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-L1SK_v0V.js";
2
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-D2pOzBNl.js";
3
3
  import { n as isPushServiceHost } from "./push-endpoint-CO-nomUd.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
6
6
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
7
- import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-QSZuMcvo.js";
7
+ import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-BPNTQVFu.js";
8
8
  import { performance } from "node:perf_hooks";
9
9
  import { subscribe, unsubscribe } from "node:diagnostics_channel";
10
10
  // src/chat/pi/gateway-request-timing.ts
@@ -1,5 +1,5 @@
1
- import { A as conversationKindFromRow, o as getDb } from "./db-EKJnkrIb.js";
2
- import { N as juniorConversations } from "./executor-CoIZmFK8.js";
1
+ import { A as conversationKindFromRow, o as getDb } from "./db-DU84dCVu.js";
2
+ import { N as juniorConversations } from "./executor-CFyrgOu1.js";
3
3
  import { desc, eq, sql } from "drizzle-orm";
4
4
  // src/chat/conversations/lineage.ts
5
5
  /**
@@ -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-CPbZjomA.js";
2
- import { t as JUNIOR_VERSION } from "./version-BYRPhY5G.js";
2
+ import { t as JUNIOR_VERSION } from "./version-qROlRQGF.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,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-CoEeZSRh.js";
3
- import { Cn as AgentMessagePausedError, Dn as PARENT_AGENT_TARGET, Gt as getLatestAgentInvocationForConversation, Ht as getActiveAgentInvocationForConversation, Tn as findChildAgentConversationId, bn as createAgentInvocationForMessage, fn as enqueueAgentInvocation, tn as readChildConversationSender, wn as AgentMessageTargetError } from "./warmup-TgY4S1vx.js";
4
- import { a as enqueueAgentMessageToParent } from "./result-B-pauj42.js";
5
- import { Kn as renderUntrustedTag, vo as canAccessConversation, xo as readConversationAccessFromSql } from "./projection-CNKK7doO.js";
6
- import { n as botConfig } from "./config-DdO1BNcw.js";
7
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-EKJnkrIb.js";
8
- import { H as admitAutomatedTurn, L as postAutomatedTurnLimitNoticeForConversation, k as EVENT_WAIT_MS } from "./session-stop-DEeZKqbX.js";
9
- import { r as appendAndEnqueueInboundMessage } from "./store-COeYnPL_.js";
2
+ import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-C5d6rY5g.js";
3
+ import { Cn as AgentMessagePausedError, Dn as PARENT_AGENT_TARGET, Gt as getLatestAgentInvocationForConversation, Ht as getActiveAgentInvocationForConversation, Tn as findChildAgentConversationId, bn as createAgentInvocationForMessage, fn as enqueueAgentInvocation, tn as readChildConversationSender, wn as AgentMessageTargetError } from "./warmup--Gkz7iB-.js";
4
+ import { a as enqueueAgentMessageToParent } from "./result-icDrueyB.js";
5
+ import { Kn as renderUntrustedTag, vo as canAccessConversation, xo as readConversationAccessFromSql } from "./projection-CcFBVFUo.js";
6
+ import { n as botConfig } from "./config-CBZp0udd.js";
7
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-DU84dCVu.js";
8
+ import { L as postAutomatedTurnLimitNoticeForConversation, W as admitAutomatedTurn, k as EVENT_WAIT_MS } from "./session-stop-uotLtp4g.js";
9
+ import { r as appendAndEnqueueInboundMessage } from "./store-Ca6G962n.js";
10
10
  // src/chat/agent-invocations/top-level-message.ts
11
11
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
12
12
  /** Event type of a message from another top-level agent. */
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { s as getSqlExecutor } from "./db-EKJnkrIb.js";
2
+ import { s as getSqlExecutor } from "./db-DU84dCVu.js";
3
3
  import { h as isVisionImageMediaType, m as detectImageMediaType } from "./web-message-id-lNodcCOI.js";
4
- import { Jo as readLiveAttachment } from "./projection-CNKK7doO.js";
4
+ import { Jo as readLiveAttachment } from "./projection-CcFBVFUo.js";
5
5
  // src/chat/attachments/model-input.ts
6
6
  var model_input_exports = /* @__PURE__ */ __exportAll({ loadInputAttachments: () => loadInputAttachments });
7
7
  /** Largest file that Slack and web send to the model in the prompt. */
package/dist/nitro.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-x4AvVhMj.js";
2
2
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-Bkk0XRo2.js";
3
- import { o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as CACHE_WARMUP_QUEUE_TOPIC } from "./queue-CDxkit82.js";
4
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CBIDXZpV.js";
5
- import { s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-WLPNSF_b.js";
6
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, 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 } from "./logging-QSZuMcvo.js";
3
+ import { o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as CACHE_WARMUP_QUEUE_TOPIC } from "./queue-B2AAL3ym.js";
4
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BLPZU6kC.js";
5
+ import { s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-BTqMIfTA.js";
6
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, 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 } from "./logging-BPNTQVFu.js";
7
7
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cv2ETe8Y.js";
8
8
  import path from "node:path";
9
9
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-D1J1CGzL.js";
2
- import { Yn as createUserTokenStore } from "./projection-CNKK7doO.js";
1
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-COqnZ1Dx.js";
2
+ import { Yn as createUserTokenStore } from "./projection-CcFBVFUo.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,20 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
2
  import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-m2-ceTTX.js";
3
- import { _ as agentsInstructionsUpdatedEvent, d as embedTexts, g as JUNIOR_NATIVE_EVENT_NAMESPACE, l as completeObject, n as briefEntriesFromReportEvents, o as isEventConversationMessage, s as generateBrief, t as BRIEF_PROMPT, u as completeText, v as authenticationLinkedEvent, x as renderJuniorNativeConversationEvent, y as authenticationUnlinkedEvent } from "./prompt-DSjhoKu5.js";
4
- import { $ as MUTATION_LOCK_TTL_MS, I as resolveActorIdentityId, N as startLocationThread, Q as setStateValues, S as createSqlStore, T as isPersonInput, U as saveUserTimezone, V as readUserTimezone, X as getStateAdapter, Y as getDefaultRedisStateAdapterFor, Z as getStateValues, _t as parseDestination, a as getConversationStore, c as hasAnnotationKey, d as eventFromRow, et as acquireActiveLock, ht as touchConversationDetail, l as treeHasAnnotationKey, m as withConversationEventLock, nt as withLock, o as getDb, ot as addAgentTurnUsage, pt as conversationDetailTouch, q as createCache, r as getConversationEventStore, rt as claimProviderConversation, s as getSqlExecutor, tt as fenceLock, u as createSqlConversationEventStore, ut as hasAgentTurnUsage, yt as sameDestination } from "./db-EKJnkrIb.js";
5
- import { D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, O as juniorCodeChanges, P as juniorIdentities, T as juniorConversationEvents, a as juniorPushSubscriptions, b as juniorConversationEmbeddings, f as juniorAutomations, i as juniorWorkspaces, j as juniorAttachments, k as juniorCodeRepositories, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, x as juniorConversationBriefs } from "./executor-CoIZmFK8.js";
6
- import { E as withSpan, J as toOptionalString, K as isRecord$2, _ 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 toOptionalNumber, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-QSZuMcvo.js";
7
- import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, g as credentialUserSubjectId, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DBDNUUmz.js";
3
+ import { _ as agentsInstructionsUpdatedEvent, d as embedTexts, g as JUNIOR_NATIVE_EVENT_NAMESPACE, l as completeObject, n as briefEntriesFromReportEvents, o as isEventConversationMessage, s as generateBrief, t as BRIEF_PROMPT, u as completeText, v as authenticationLinkedEvent, x as renderJuniorNativeConversationEvent, y as authenticationUnlinkedEvent } from "./prompt-C5LREK2p.js";
4
+ import { $ as MUTATION_LOCK_TTL_MS, I as resolveActorIdentityId, N as startLocationThread, Q as setStateValues, S as createSqlStore, T as isPersonInput, U as saveUserTimezone, V as readUserTimezone, X as getStateAdapter, Y as getDefaultRedisStateAdapterFor, Z as getStateValues, _t as parseDestination, a as getConversationStore, c as hasAnnotationKey, d as eventFromRow, et as acquireActiveLock, ht as touchConversationDetail, l as treeHasAnnotationKey, m as withConversationEventLock, nt as withLock, o as getDb, ot as addAgentTurnUsage, pt as conversationDetailTouch, q as createCache, r as getConversationEventStore, rt as claimProviderConversation, s as getSqlExecutor, tt as fenceLock, u as createSqlConversationEventStore, ut as hasAgentTurnUsage, yt as sameDestination } from "./db-DU84dCVu.js";
5
+ import { D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, O as juniorCodeChanges, P as juniorIdentities, T as juniorConversationEvents, a as juniorPushSubscriptions, b as juniorConversationEmbeddings, f as juniorAutomations, i as juniorWorkspaces, j as juniorAttachments, k as juniorCodeRepositories, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, x as juniorConversationBriefs } from "./executor-CFyrgOu1.js";
6
+ import { E as withSpan, J as toOptionalString, K as isRecord$2, _ 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 toOptionalNumber, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-BPNTQVFu.js";
7
+ import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, g as credentialUserSubjectId, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-BjZZqKqi.js";
8
8
  import { n as isWithinNotificationSchedule, r as notificationScheduleSchema, s as isValidTimeZone, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-cP0AACm1.js";
9
- import { $ as bufferBody, B as unwrapCurrentInstruction, C as completeObject$1, O as rerankTexts, P as estimateTextTokens, S as completeDecision, T as embedTexts$1, V as escapeXml, b as GEN_AI_PROVIDER_NAME, i as getChatConfig, k as resolveGatewayModel, n as botConfig, o as getSlackBotToken, tt as toOptionalTrimmed, y as normalizeSlackEmojiName } from "./config-DdO1BNcw.js";
9
+ import { $ as bufferBody, B as unwrapCurrentInstruction, C as completeObject$1, O as rerankTexts, P as estimateTextTokens, S as completeDecision, T as embedTexts$1, V as escapeXml, b as GEN_AI_PROVIDER_NAME, i as getChatConfig, k as resolveGatewayModel, n as botConfig, o as getSlackBotToken, tt as toOptionalTrimmed, y as normalizeSlackEmojiName } from "./config-CBZp0udd.js";
10
10
  import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
11
- import { i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-Cf8ISkAc.js";
11
+ import { i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-CxUiOraX.js";
12
12
  import { $ as conversationBriefSchema, J as readMessageAttachments, L as reviewItemChangeRecordSchema, Q as briefResourceLabel, V as readMessageCardRefs, _ as conversationReportMessageEventSchema, et as parseBriefInput, g as conversationReportEventSchema, tt as parseStoredBrief, z as messageCardRef } from "./conversation-BOqdRtUx.js";
13
13
  import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace } from "./sentry-CPbZjomA.js";
14
- import { t as canExposeConversationPayload } from "./conversation-privacy-L1SK_v0V.js";
15
- import { n as pluginCatalogRuntime } from "./catalog-runtime-B8ZXvXWm.js";
14
+ import { t as canExposeConversationPayload } from "./conversation-privacy-D2pOzBNl.js";
15
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
16
16
  import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
17
- import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-Bveuc4Zh.js";
17
+ import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-nCR4Muhn.js";
18
18
  import { i as readWebPushPrivateKey, t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
19
19
  import * as z from "zod";
20
20
  import path from "node:path";
@@ -6758,8 +6758,11 @@ const payload = z.strictObject({
6758
6758
  custom_fields: z.array(customField).optional(),
6759
6759
  display_order: z.array(z.string()).optional()
6760
6760
  });
6761
- /** Limit IDs to Junior's safe subset; Slack silently rejects JSON punctuation. */
6762
- const slackExternalRefIdSchema = z.string().min(1).regex(/^[A-Za-z0-9_-]+$/, "Unsupported Slack external reference ID");
6761
+ /**
6762
+ * Limit IDs to Junior's safe subset. Slack drops all message metadata when an
6763
+ * ID has JSON punctuation or is longer than 128 characters.
6764
+ */
6765
+ const slackExternalRefIdSchema = z.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/, "Unsupported Slack external reference ID");
6763
6766
  const entity = z.strictObject({
6764
6767
  external_ref: z.strictObject({
6765
6768
  id: slackExternalRefIdSchema,
@@ -1,6 +1,6 @@
1
- import { A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, G as createProviderError, Q as resolveGatewayCredential, S as completeDecision$1, T as embedTexts$1, U as ProviderError, X as isProviderRetryError, b as GEN_AI_PROVIDER_NAME, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-DdO1BNcw.js";
2
- import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-QSZuMcvo.js";
3
- import { r as getConversationEventStore, st as agentTurnCostUsd } from "./db-EKJnkrIb.js";
1
+ import { A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, G as createProviderError, Q as resolveGatewayCredential, S as completeDecision$1, T as embedTexts$1, U as ProviderError, X as isProviderRetryError, b as GEN_AI_PROVIDER_NAME, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-CBZp0udd.js";
2
+ import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-BPNTQVFu.js";
3
+ import { r as getConversationEventStore, st as agentTurnCostUsd } from "./db-DU84dCVu.js";
4
4
  import { $ as conversationBriefSchema, Z as briefOutcomeStatusSchema, et as parseBriefInput } from "./conversation-BOqdRtUx.js";
5
5
  import * as z from "zod";
6
6
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "./config-DdO1BNcw.js";
2
- import { h as logWarn } from "./logging-QSZuMcvo.js";
3
- import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-WLPNSF_b.js";
1
+ import { i as getChatConfig } from "./config-CBZp0udd.js";
2
+ import { h as logWarn } from "./logging-BPNTQVFu.js";
3
+ import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-BTqMIfTA.js";
4
4
  import * as z from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  // src/chat/sandbox/snapshot/job-queue.ts
@@ -92,7 +92,7 @@ function cacheWarmupCallback() {
92
92
  maxDeliveries: 1,
93
93
  onRejected: logCacheWarmupRejected,
94
94
  run: async (message) => {
95
- const { runCacheWarmup } = await import("./warmup-TgY4S1vx.js").then((n) => n.s);
95
+ const { runCacheWarmup } = await import("./warmup--Gkz7iB-.js").then((n) => n.s);
96
96
  await runCacheWarmup(message);
97
97
  },
98
98
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -1,5 +1,5 @@
1
1
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-x4AvVhMj.js";
2
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-QSZuMcvo.js";
2
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-BPNTQVFu.js";
3
3
  import { o as isUserActor, s as parseActorUserId } from "./actor-D2iXzvlN.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -1,6 +1,6 @@
1
- import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-BT2Pf6HP.js";
2
- import { ea as create, fs as sleep, ia as getSandboxProvider, na as isStale } from "./projection-CNKK7doO.js";
3
- import { X as getStateAdapter } from "./db-EKJnkrIb.js";
1
+ import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-CQ76CfRw.js";
2
+ import { ea as create, fs as sleep, ia as getSandboxProvider, na as isStale } from "./projection-CcFBVFUo.js";
3
+ import { X as getStateAdapter } from "./db-DU84dCVu.js";
4
4
  import * as z from "zod";
5
5
  // src/chat/sandbox/snapshot/resolve.ts
6
6
  const SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile:v2";
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, k as turnBehavior } from "./db-EKJnkrIb.js";
3
- import { C as listActiveMailboxTurns, N as renderEventBatchInputs, P as timerWatchCredentialSubject, T as resolveMailboxTurnWork, j as eventBatchMessageMeta, k as EVENT_WAIT_MS, s as eventReviewItemInputs, t as getConversationStoppedAtMs, w as parseEventMessages, x as getEventBatchDelayMs } from "./session-stop-DEeZKqbX.js";
4
- import { a as EVENT_SYSTEM_ACTOR } from "./prompt-DSjhoKu5.js";
5
- import { f as credentialContextForActor } from "./registry-DBDNUUmz.js";
6
- import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-tcom1RYd.js";
7
- import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-COeYnPL_.js";
8
- import { $t as childAgentInput, Bt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Gt as getLatestAgentInvocationForConversation, Kt as isTerminalAgentInvocation, Qt as sendsResultToParent, Vt as TERMINAL_AGENT_INVOCATION_STATUSES, Xt as markAgentInvocationParentMailboxAppended, Zt as reportReplacedWithoutOpenWork, an as logDroppedParentMessage, cn as createAgentInvocationWorker, dn as endAgentInvocationsOfStoppedWork, en as getChildAgentInputSender, fn as enqueueAgentInvocation, nn as routeChildInput, on as parentMessageText, pn as resolveAgentInvocationId, qt as listAgentInvocationsForConversation, sn as readParentMessage, tn as readChildConversationSender, un as endActiveAgentInvocations, xn as createAgentInvocationFromLatest, zt as listUnreportedSiblingAgents } from "./warmup-TgY4S1vx.js";
9
- import { Kn as renderUntrustedTag } from "./projection-CNKK7doO.js";
2
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, k as turnBehavior } from "./db-DU84dCVu.js";
3
+ import { C as listActiveMailboxTurns, N as renderEventBatchInputs, P as timerWatchCredentialSubject, T as resolveMailboxTurnWork, j as eventBatchMessageMeta, k as EVENT_WAIT_MS, s as eventReviewItemInputs, t as getConversationStoppedAtMs, w as parseEventMessages, x as getEventBatchDelayMs } from "./session-stop-uotLtp4g.js";
4
+ import { a as EVENT_SYSTEM_ACTOR } from "./prompt-C5LREK2p.js";
5
+ import { f as credentialContextForActor } from "./registry-BjZZqKqi.js";
6
+ import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-BrhuyYrH.js";
7
+ import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-Ca6G962n.js";
8
+ import { $t as childAgentInput, Bt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Gt as getLatestAgentInvocationForConversation, Kt as isTerminalAgentInvocation, Qt as sendsResultToParent, Vt as TERMINAL_AGENT_INVOCATION_STATUSES, Xt as markAgentInvocationParentMailboxAppended, Zt as reportReplacedWithoutOpenWork, an as logDroppedParentMessage, cn as createAgentInvocationWorker, dn as endAgentInvocationsOfStoppedWork, en as getChildAgentInputSender, fn as enqueueAgentInvocation, nn as routeChildInput, on as parentMessageText, pn as resolveAgentInvocationId, qt as listAgentInvocationsForConversation, sn as readParentMessage, tn as readChildConversationSender, un as endActiveAgentInvocations, xn as createAgentInvocationFromLatest, zt as listUnreportedSiblingAgents } from "./warmup--Gkz7iB-.js";
9
+ import { Kn as renderUntrustedTag } from "./projection-CcFBVFUo.js";
10
10
  import { C as agentInvocationResultEventType, S as AGENT_REPLY_EVENT_TYPE, b as AGENT_MESSAGE_EVENT_TYPE, y as AGENT_INVOCATION_EVENT_NAMESPACE } from "./web-message-id-lNodcCOI.js";
11
11
  import { actorSchema } from "@sentry/junior-plugin-api";
12
12
  // src/chat/agent-invocations/result.ts