@sentry/junior 0.301.0 → 0.303.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 (101) hide show
  1. package/dist/adapter-context-BdVnSuY5.js +43 -0
  2. package/dist/{admin-CRJHvCGg.js → admin-AfeAdS3J.js} +2 -2
  3. package/dist/{agent-runner-H4YhvNBj.js → agent-runner-BP8_DLUv.js} +4688 -13870
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +7 -8
  6. package/dist/api.d.ts +13 -12
  7. package/dist/api.js +268 -118
  8. package/dist/{app-HDZglaIu.d.ts → app-Dd9v1mNx.d.ts} +15 -15
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +99 -330
  11. package/dist/{automation-Cva5ZOwW.js → automation-D9MvhOWY.js} +3 -1
  12. package/dist/{background-compaction-queue-CNrZ3QcU.js → background-compaction-queue-xaE05jxH.js} +97 -206
  13. package/dist/{briefs-x6Mzwxmg.js → briefs-D8i-dKTp.js} +4 -4
  14. package/dist/{catalog-runtime-BEY6EGRi.js → catalog-runtime-d1EM6Z0V.js} +2 -2
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +21 -21
  17. package/dist/cli/check.js +8 -8
  18. package/dist/cli/env.d.ts +1 -0
  19. package/dist/cli/env.js +8 -7
  20. package/dist/cli/init.js +13 -4
  21. package/dist/cli/main.js +4 -4
  22. package/dist/cli/plugins.js +6 -6
  23. package/dist/cli/snapshot-create.js +7 -5
  24. package/dist/cli/upgrade.d.ts +2 -2
  25. package/dist/cli/upgrade.js +5 -5
  26. package/dist/{config-CmjhyqgB.js → config-oGM7KA9M.js} +44 -63
  27. package/dist/{connections-CfIRm0xv.js → connections-BlikzEJv.js} +6 -6
  28. package/dist/{continue-in-slack-DPoABVkB.js → continue-in-slack-BZnYifiG.js} +5 -6
  29. package/dist/{conversation-BNXfq6Lb.js → conversation-CY1jnBiC.js} +1 -1
  30. package/dist/{conversation-feed-CfpyFMHP.js → conversation-feed-BZJRk6UV.js} +2 -1
  31. package/dist/{conversation-privacy-0CM0V2qK.js → conversation-privacy-Cx515ddM.js} +7 -7
  32. package/dist/{conversation-turn-C0sxyvS-.js → conversation-turn-DAhRdX4m.js} +20 -24
  33. package/dist/{credential-sync-tEMKZ_8M.js → credential-sync-DfhmWFeo.js} +18 -20
  34. package/dist/{db-Czra10QW.js → db-C-2tFxk3.js} +326 -17
  35. package/dist/{db-BdUHQhrC.d.ts → db-DPqcEM9_.d.ts} +25 -25
  36. package/dist/{executor-D_023K0H.js → executor-NVfS8aQ2.js} +51 -10
  37. package/dist/{history-IjdmO_r6.js → history-UZ3M2M9r.js} +13 -10
  38. package/dist/install-CHLrpRZc.js +228 -0
  39. package/dist/instrumentation.d.ts +4 -4
  40. package/dist/instrumentation.js +10 -10
  41. package/dist/{lineage-DmMIE0VL.js → lineage-HGLhd_-N.js} +2 -2
  42. package/dist/{logging-DcjLDDqi.js → logging-DiyqRLBx.js} +24 -20
  43. package/dist/{message-C0JY9RJP.js → message-CkCOcbFH.js} +9 -9
  44. package/dist/{model-input-CBp-p24N.js → model-input-DmoPPtPE.js} +5 -10
  45. package/dist/nitro.d.ts +1 -1
  46. package/dist/nitro.js +7 -6
  47. package/dist/{oauth-callback-server-BRq9QNhU.js → oauth-callback-server-CIf_6YmA.js} +5 -4
  48. package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
  49. package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
  50. package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
  51. package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
  52. package/dist/{projection-CQNDOi82.js → projection-DBq8tsA5.js} +489 -223
  53. package/dist/{prompt-DLUB5m72.js → prompt-D2KlJopL.js} +15 -5
  54. package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
  55. package/dist/queue-DFaOscp5.js +115 -0
  56. package/dist/{registry-Dj377ADs.js → registry-Bu0Z9BEO.js} +37 -37
  57. package/dist/{resolve-DJkh9Fky.js → resolve-DXuA3G0g.js} +4 -229
  58. package/dist/{result-C8iIpDl1.js → result-DpiNseDA.js} +11 -16
  59. package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
  60. package/dist/{runner-DZqrOy8C.js → runner-iu1heRFv.js} +10 -10
  61. package/dist/{sandbox-egress-signals-CGwH86S9.js → sandbox-egress-signals-2HFYDcQf.js} +1 -1
  62. package/dist/{schema-CdZFn7Qd.d.ts → schema-DHMOaRzC.d.ts} +959 -41
  63. package/dist/{schema-DyHXiQKI.js → schema-DvfX3Gq_.js} +141 -40
  64. package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
  65. package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
  66. package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
  67. package/dist/{service-account-suY004dx.js → service-account-BcT5LR7V.js} +271 -20
  68. package/dist/{service-account-D6jGR4a1.js → service-account-xYkaQTrw.js} +3 -3
  69. package/dist/{session-stop-BLmfFI3d.js → session-stop-BLLp1IP_.js} +1098 -1110
  70. package/dist/{skills-CmNG0dHb.js → skills-CNAGH4ju.js} +6 -9
  71. package/dist/{slack-conversation-unfurl-Bty-DlHe.js → slack-conversation-unfurl-DYnqe5ci.js} +10 -14
  72. package/dist/{spawn-CNjkpXpk.js → spawn-cGasWW33.js} +7 -7
  73. package/dist/{state-CEbZuZD6.js → state-CDS6h_Wv.js} +34 -5
  74. package/dist/{stop-Bjy2-K4H.js → stop-DMMA67yT.js} +896 -196
  75. package/dist/{store-DmV4CoNr.js → store-Dgs7Oe44.js} +5 -5
  76. package/dist/{task-queue-AhG1tSXR.js → task-queue-DcF0nhhz.js} +3 -3
  77. package/dist/{task-runner-BMxZI3o7.js → task-runner-BGXF7Fo7.js} +15 -20
  78. package/dist/{thread-context-CXLnbg7g.js → thread-context-BPky1KBe.js} +12 -12
  79. package/dist/{store-Epv6t4vV.js → turn-session-routing-DGvn9MSl.js} +384 -13
  80. package/dist/{turn-user-message-DsUZi9gn.js → turn-user-message-19CkuUvM.js} +3 -3
  81. package/dist/{validation-DOz8X9BU.js → validation-lu1DgjNQ.js} +2 -2
  82. package/dist/vercel.js +1 -1
  83. package/dist/{version-CGMRmMPK.js → version-Uo3c94Dx.js} +1 -1
  84. package/dist/version.js +1 -1
  85. package/dist/{viewer-H3EsMWtJ.js → viewer-BPQHMx3-.js} +3 -3
  86. package/dist/warmup-H8uLvW9e.js +13946 -0
  87. package/dist/{statuses-Hn-HsOph.js → web-message-id-lNodcCOI.js} +136 -1
  88. package/dist/{worker-ClphajjD.js → worker-B-pM_-3K.js} +9 -12
  89. package/migrations/0108_conversation_embeddings.sql +13 -0
  90. package/migrations/0109_user_preferences.sql +1 -0
  91. package/migrations/0110_code_change_repository_state_index.sql +1 -0
  92. package/migrations/meta/0108_snapshot.json +4688 -0
  93. package/migrations/meta/0109_snapshot.json +4925 -0
  94. package/migrations/meta/0110_snapshot.json +4952 -0
  95. package/migrations/meta/_journal.json +22 -1
  96. package/package.json +16 -17
  97. package/dist/adapter-CNjGEJO9.js +0 -303
  98. package/dist/reporting-window-DopzcOHh.js +0 -137
  99. package/dist/turn-session-routing-BD3-jJl7.js +0 -380
  100. package/dist/users-BxvYclQg.js +0 -424
  101. package/dist/warmup-CdU5hR49.js +0 -3715
package/dist/cli/main.js CHANGED
@@ -24,7 +24,7 @@ function formatCliFailure(error) {
24
24
  // src/cli/main.ts
25
25
  const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
26
26
  async function flushSentry() {
27
- await (await import("../sentry-BRTJqumy.js").then((n) => n.u)).flush(SENTRY_FLUSH_TIMEOUT_MS);
27
+ await (await import("../sentry-CPbZjomA.js").then((n) => n.u)).flush(SENTRY_FLUSH_TIMEOUT_MS);
28
28
  }
29
29
  async function initSentry() {
30
30
  (await import("../instrumentation.js")).initSentry();
@@ -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-CRJHvCGg.js")).runAdmin(argv);
48
+ return await (await import("../admin-AfeAdS3J.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-D6jGR4a1.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-xYkaQTrw.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-x6Mzwxmg.js")).runBriefs(argv);
54
+ return await (await import("../briefs-D8i-dKTp.js")).runBriefs(argv);
55
55
  }
56
56
  function topLevelCommand(argv) {
57
57
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,9 +1,9 @@
1
- import { _o as createPluginLogger, mr as validatePlugins, pr as setPlugins } from "../projection-CQNDOi82.js";
2
- import { o as getDb } from "../db-Czra10QW.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BEY6EGRi.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DOz8X9BU.js";
5
- import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-BBX07Jzt.js";
6
- import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
1
+ import { o as getDb } from "../db-C-2tFxk3.js";
2
+ import { fr as setPlugins, pr as validatePlugins, yo as createPluginLogger } from "../projection-DBq8tsA5.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-d1EM6Z0V.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-lu1DgjNQ.js";
5
+ import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
6
+ import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-Bkk0XRo2.js";
7
7
  import { stderr, stdout } from "node:process";
8
8
  import { createJiti } from "jiti";
9
9
  import { Command, CommanderError } from "commander";
@@ -1,7 +1,8 @@
1
- import { Za as SANDBOX_RUNTIME, ea as create } from "../projection-CQNDOi82.js";
2
- import { t as disconnectStateAdapter } from "../adapter-CNjGEJO9.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BEY6EGRi.js";
4
- import { n as resolve } from "../resolve-DJkh9Fky.js";
1
+ import { i as getChatConfig } from "../config-oGM7KA9M.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-d1EM6Z0V.js";
3
+ import { n as resolve } from "../resolve-DXuA3G0g.js";
4
+ import { $a as SANDBOX_RUNTIME, na as create } from "../projection-DBq8tsA5.js";
5
+ import { K as disconnectStateAdapter } from "../db-C-2tFxk3.js";
5
6
  // src/cli/snapshot-create.ts
6
7
  const DEFAULT_TIMEOUT_MS = 6e5;
7
8
  function progressMessage(phase) {
@@ -44,7 +45,7 @@ function logSnapshotProfile(runtime, log) {
44
45
  }
45
46
  /** Resolve or create the default sandbox snapshot and report its progress. */
46
47
  async function runSnapshotCreate(log = console.log) {
47
- if (process.env.JUNIOR_SKIP_SNAPSHOT === "1") {
48
+ if (process.env["JUNIOR_SKIP_SNAPSHOT"] === "1") {
48
49
  log("Skipping sandbox snapshot create (JUNIOR_SKIP_SNAPSHOT=1)");
49
50
  return;
50
51
  }
@@ -67,6 +68,7 @@ async function runSnapshotCreate(log = console.log) {
67
68
  `resolve_outcome=${snapshot.resolveOutcome}`,
68
69
  `cache_hit=${snapshot.cacheHit}`,
69
70
  `dependency_count=${snapshot.dependencyCount}`,
71
+ `state=${getChatConfig().state.adapter}`,
70
72
  ...snapshot.profileHash ? [`profile_hash=${snapshot.profileHash}`] : [],
71
73
  ...snapshot.snapshotId ? [`snapshot_id=${snapshot.snapshotId}`] : [],
72
74
  ...snapshot.rebuildReason ? [`rebuild_reason=${snapshot.rebuildReason}`] : []
@@ -1,5 +1,5 @@
1
- import "../db-BdUHQhrC.js";
2
1
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
2
+ import "../db-DPqcEM9_.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
5
5
  }
@@ -7,6 +7,6 @@ interface UpgradeIo {
7
7
  export declare function resolveUpgradePluginSet(): Promise<JuniorPluginSet | undefined>;
8
8
  /** Apply Junior and enabled-plugin database migrations. */
9
9
  export declare function runUpgrade(io?: UpgradeIo, options?: {
10
- pluginSet?: JuniorPluginSet | null;
10
+ pluginSet?: JuniorPluginSet | null | undefined;
11
11
  }): Promise<void>;
12
12
  export {};
@@ -1,8 +1,8 @@
1
- import { i as getChatConfig } from "../config-CmjhyqgB.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-D_023K0H.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-Dj377ADs.js";
4
- import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-BBX07Jzt.js";
5
- import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
1
+ import { i as getChatConfig } from "../config-oGM7KA9M.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-NVfS8aQ2.js";
3
+ import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
4
+ import { t as createPluginCatalogRuntime } from "../registry-Bu0Z9BEO.js";
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";
8
8
  import { readMigrationFiles } from "drizzle-orm/migrator";
@@ -1,6 +1,6 @@
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-DcjLDDqi.js";
3
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-0CM0V2qK.js";
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-DiyqRLBx.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-Cx515ddM.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";
@@ -167,7 +167,7 @@ function readS3StorageConfig(env) {
167
167
  accessKeyId: readRequiredSetting(env, "JUNIOR_S3_ACCESS_KEY_ID"),
168
168
  bucket: readRequiredSetting(env, "JUNIOR_S3_BUCKET"),
169
169
  endpoint: readRequiredSetting(env, "JUNIOR_S3_ENDPOINT"),
170
- region: toOptionalTrimmed(env.JUNIOR_S3_REGION) ?? "us-east-1",
170
+ region: toOptionalTrimmed(env["JUNIOR_S3_REGION"]) ?? "us-east-1",
171
171
  secretAccessKey: readRequiredSetting(env, "JUNIOR_S3_SECRET_ACCESS_KEY")
172
172
  };
173
173
  }
@@ -277,7 +277,7 @@ function createS3AttachmentStorage(config) {
277
277
  // src/chat/attachments/config.ts
278
278
  /** Read attachment storage settings from environment variables. */
279
279
  function readAttachmentStorageConfig(env) {
280
- const provider = toOptionalTrimmed(env.JUNIOR_ATTACHMENT_STORAGE_PROVIDER) ?? "vercel-blob";
280
+ const provider = toOptionalTrimmed(env["JUNIOR_ATTACHMENT_STORAGE_PROVIDER"]) ?? "vercel-blob";
281
281
  switch (provider) {
282
282
  case "vercel-blob":
283
283
  case "memory": return { provider };
@@ -315,11 +315,11 @@ function parseKey(entry, index) {
315
315
  }
316
316
  /** Parse and check the encryption keyring from environment variables. */
317
317
  function readEncryptionKeyring(env) {
318
- const entries = (env.JUNIOR_ENCRYPTION_KEYS ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
318
+ const entries = (env["JUNIOR_ENCRYPTION_KEYS"] ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
319
319
  if (entries.length === 0) throw new Error("JUNIOR_ENCRYPTION_KEYS is required. Generate a key with: node -e \"console.log('k1:' + require('node:crypto').randomBytes(32).toString('base64url'))\"");
320
320
  const keys = entries.map(parseKey);
321
321
  if (new Set(keys.map((key) => key.id)).size !== keys.length) throw new Error("JUNIOR_ENCRYPTION_KEYS must not repeat a key id");
322
- const activeId = env.JUNIOR_ENCRYPTION_KEY_ID?.trim() || (keys.length === 1 ? keys[0]?.id : void 0);
322
+ const activeId = env["JUNIOR_ENCRYPTION_KEY_ID"]?.trim() || (keys.length === 1 ? keys[0]?.id : void 0);
323
323
  if (!activeId) throw new Error("JUNIOR_ENCRYPTION_KEY_ID is required when JUNIOR_ENCRYPTION_KEYS has more than one key");
324
324
  const active = keys.find((key) => key.id === activeId);
325
325
  if (!active) throw new Error(`JUNIOR_ENCRYPTION_KEY_ID "${activeId}" is not in JUNIOR_ENCRYPTION_KEYS`);
@@ -340,16 +340,16 @@ function readWorkerConcurrency(value) {
340
340
  }
341
341
  /** Read queue settings from environment variables. */
342
342
  function readQueueConfig(env) {
343
- const provider = toOptionalTrimmed(env.JUNIOR_QUEUE_PROVIDER) ?? "vercel";
343
+ const provider = toOptionalTrimmed(env["JUNIOR_QUEUE_PROVIDER"]) ?? "vercel";
344
344
  switch (provider) {
345
345
  case "vercel": return { provider };
346
346
  case "bullmq": {
347
- const redisUrl = toOptionalTrimmed(env.JUNIOR_QUEUE_REDIS_URL);
347
+ const redisUrl = toOptionalTrimmed(env["JUNIOR_QUEUE_REDIS_URL"]);
348
348
  if (!redisUrl) throw new Error("JUNIOR_QUEUE_REDIS_URL is required when JUNIOR_QUEUE_PROVIDER is bullmq");
349
349
  return {
350
350
  provider,
351
351
  redisUrl,
352
- workerConcurrency: readWorkerConcurrency(env.JUNIOR_QUEUE_WORKER_CONCURRENCY)
352
+ workerConcurrency: readWorkerConcurrency(env["JUNIOR_QUEUE_WORKER_CONCURRENCY"])
353
353
  };
354
354
  }
355
355
  default: throw new Error("JUNIOR_QUEUE_PROVIDER must be vercel or bullmq");
@@ -1261,10 +1261,10 @@ async function completeText(params) {
1261
1261
  }, startAttributes);
1262
1262
  }
1263
1263
  function logContextFromMetadata(modelId, metadata) {
1264
- const conversationId = typeof metadata?.conversationId === "string" ? metadata.conversationId : typeof metadata?.threadId === "string" ? metadata.threadId : void 0;
1265
- const messageConversationId = typeof metadata?.threadId === "string" ? metadata.threadId : void 0;
1266
- const destinationName = typeof metadata?.channelId === "string" ? metadata.channelId : void 0;
1267
- const runId = typeof metadata?.runId === "string" ? metadata.runId : void 0;
1264
+ const conversationId = typeof metadata?.["conversationId"] === "string" ? metadata["conversationId"] : typeof metadata?.["threadId"] === "string" ? metadata["threadId"] : void 0;
1265
+ const messageConversationId = typeof metadata?.["threadId"] === "string" ? metadata["threadId"] : void 0;
1266
+ const destinationName = typeof metadata?.["channelId"] === "string" ? metadata["channelId"] : void 0;
1267
+ const runId = typeof metadata?.["runId"] === "string" ? metadata["runId"] : void 0;
1268
1268
  return {
1269
1269
  modelId,
1270
1270
  ...conversationId ? { conversationId } : void 0,
@@ -1548,26 +1548,7 @@ function toPiReasoningLevel(level) {
1548
1548
  return level === "none" ? "off" : level;
1549
1549
  }
1550
1550
  // src/chat/config.ts
1551
- var config_exports = /* @__PURE__ */ __exportAll({
1552
- CONVERSATION_WORK_SOFT_YIELD_BUFFER_SECONDS: () => 40,
1553
- DEFAULT_SQL_STATEMENT_TIMEOUT_MS: () => DEFAULT_SQL_STATEMENT_TIMEOUT_MS,
1554
- FUNCTION_TIMEOUT_BUFFER_SECONDS: () => 20,
1555
- botConfig: () => botConfig,
1556
- getChatConfig: () => getChatConfig,
1557
- getRuntimeMetadata: () => getRuntimeMetadata,
1558
- getSlackBotToken: () => getSlackBotToken,
1559
- getSlackClientId: () => getSlackClientId,
1560
- getSlackClientSecret: () => getSlackClientSecret,
1561
- getSlackSigningSecret: () => getSlackSigningSecret,
1562
- readChatConfig: () => readChatConfig,
1563
- resetRuntimeConfig: () => resetRuntimeConfig,
1564
- restoreRuntimeConfig: () => restoreRuntimeConfig,
1565
- setBotModelConfig: () => setBotModelConfig,
1566
- setBotName: () => setBotName,
1567
- setRuntimeLimits: () => setRuntimeLimits,
1568
- setSlackReactionConfig: () => setSlackReactionConfig,
1569
- snapshotRuntimeConfig: () => snapshotRuntimeConfig
1570
- });
1551
+ var config_exports = /* @__PURE__ */ __exportAll({ botConfig: () => botConfig });
1571
1552
  const MIN_AGENT_TURN_TIMEOUT_MS = 1e4;
1572
1553
  const DEFAULT_AGENT_TURN_TIMEOUT_MS = 72e4;
1573
1554
  const MAX_SLICES_PER_TURN = 100;
@@ -1698,24 +1679,24 @@ function parseReactionEmoji(envName, rawValue, defaultEmoji) {
1698
1679
  }
1699
1680
  function readBotConfig(env, functionMaxDurationSeconds) {
1700
1681
  const maxTurnTimeoutMs = resolveMaxTurnTimeoutMs(functionMaxDurationSeconds);
1701
- const modelId = validateGatewayModelId(env.AI_MODEL) ?? DEFAULT_MODEL_ID;
1702
- const reasoningLevel = toOptionalTrimmed(env.AI_REASONING_LEVEL);
1703
- const fastModelId = validateGatewayModelId(env.AI_FAST_MODEL ?? env.AI_MODEL) ?? DEFAULT_FAST_MODEL_ID;
1704
- const guardianModelId = validateGatewayModelId(env.AI_GUARDIAN_MODEL) ?? DEFAULT_GUARDIAN_MODEL_ID;
1682
+ const modelId = validateGatewayModelId(env["AI_MODEL"]) ?? DEFAULT_MODEL_ID;
1683
+ const reasoningLevel = toOptionalTrimmed(env["AI_REASONING_LEVEL"]);
1684
+ const fastModelId = validateGatewayModelId(env["AI_FAST_MODEL"] ?? env["AI_MODEL"]) ?? DEFAULT_FAST_MODEL_ID;
1685
+ const guardianModelId = validateGatewayModelId(env["AI_GUARDIAN_MODEL"]) ?? DEFAULT_GUARDIAN_MODEL_ID;
1705
1686
  return {
1706
- userName: toOptionalTrimmed(env.JUNIOR_BOT_NAME) ?? "junior",
1687
+ userName: toOptionalTrimmed(env["JUNIOR_BOT_NAME"]) ?? "junior",
1707
1688
  modelId,
1708
- contextWindowTokens: parseOptionalPositiveInteger("AI_MODEL_CONTEXT_WINDOW_TOKENS", env.AI_MODEL_CONTEXT_WINDOW_TOKENS) ?? DEFAULT_MODEL_CONTEXT_WINDOW_TOKENS,
1689
+ contextWindowTokens: parseOptionalPositiveInteger("AI_MODEL_CONTEXT_WINDOW_TOKENS", env["AI_MODEL_CONTEXT_WINDOW_TOKENS"]) ?? DEFAULT_MODEL_CONTEXT_WINDOW_TOKENS,
1709
1690
  reasoningLevel: reasoningLevel === void 0 ? DEFAULT_REASONING_LEVEL : parseTurnReasoningLevel(reasoningLevel),
1710
- decisionModelId: toOptionalTrimmed(env.AI_DECISION_MODEL) ?? DEFAULT_DECISION_MODEL_ID,
1691
+ decisionModelId: toOptionalTrimmed(env["AI_DECISION_MODEL"]) ?? DEFAULT_DECISION_MODEL_ID,
1711
1692
  fastModelId,
1712
1693
  guardianModelId,
1713
- imageGenerationModelId: toOptionalTrimmed(env.AI_IMAGE_MODEL) ?? DEFAULT_IMAGE_GENERATION_MODEL_ID,
1714
- embeddingModelId: validateEmbeddingModelId(env.AI_EMBEDDING_MODEL) ?? DEFAULT_EMBEDDING_MODEL_ID,
1715
- rerankingModelId: toOptionalTrimmed(env.AI_RERANKING_MODEL) ?? DEFAULT_RERANKING_MODEL_ID,
1716
- loadingMessages: parseLoadingMessages(env.JUNIOR_LOADING_MESSAGES),
1717
- refusalFallbackModelId: validateGatewayModelId(env.AI_REFUSAL_FALLBACK_MODEL),
1718
- visionModelId: env.AI_VISION_MODEL === void 0 ? DEFAULT_VISION_MODEL_ID : validateGatewayModelId(env.AI_VISION_MODEL),
1694
+ imageGenerationModelId: toOptionalTrimmed(env["AI_IMAGE_MODEL"]) ?? DEFAULT_IMAGE_GENERATION_MODEL_ID,
1695
+ embeddingModelId: validateEmbeddingModelId(env["AI_EMBEDDING_MODEL"]) ?? DEFAULT_EMBEDDING_MODEL_ID,
1696
+ rerankingModelId: toOptionalTrimmed(env["AI_RERANKING_MODEL"]) ?? DEFAULT_RERANKING_MODEL_ID,
1697
+ loadingMessages: parseLoadingMessages(env["JUNIOR_LOADING_MESSAGES"]),
1698
+ refusalFallbackModelId: validateGatewayModelId(env["AI_REFUSAL_FALLBACK_MODEL"]),
1699
+ visionModelId: env["AI_VISION_MODEL"] === void 0 ? DEFAULT_VISION_MODEL_ID : validateGatewayModelId(env["AI_VISION_MODEL"]),
1719
1700
  maxAgentDepth: 0,
1720
1701
  maxSlicesPerTurn: MAX_SLICES_PER_TURN,
1721
1702
  maxToolCallsPerTurn: MAX_TOOL_CALLS_PER_TURN,
@@ -1723,12 +1704,12 @@ function readBotConfig(env, functionMaxDurationSeconds) {
1723
1704
  maxConsecutiveAutomatedTurns: MAX_CONSECUTIVE_AUTOMATED_TURNS,
1724
1705
  maxEventAutomationRuns: MAX_EVENT_AUTOMATION_RUNS,
1725
1706
  eventAutomationRunWindowMs: EVENT_AUTOMATION_RUN_WINDOW_MS,
1726
- turnTimeoutMs: parseAgentTurnTimeoutMs(env.AGENT_TURN_TIMEOUT_MS, maxTurnTimeoutMs),
1727
- webSearchModelId: validateGatewayModelId(env.AI_WEB_SEARCH_MODEL) ?? DEFAULT_WEB_SEARCH_MODEL_ID
1707
+ turnTimeoutMs: parseAgentTurnTimeoutMs(env["AGENT_TURN_TIMEOUT_MS"], maxTurnTimeoutMs),
1708
+ webSearchModelId: validateGatewayModelId(env["AI_WEB_SEARCH_MODEL"]) ?? DEFAULT_WEB_SEARCH_MODEL_ID
1728
1709
  };
1729
1710
  }
1730
1711
  function readDatabaseUrl(env) {
1731
- const databaseUrl = toOptionalTrimmed(env.DATABASE_URL);
1712
+ const databaseUrl = toOptionalTrimmed(env["DATABASE_URL"]);
1732
1713
  if (!databaseUrl) throw new Error("DATABASE_URL is required");
1733
1714
  return databaseUrl;
1734
1715
  }
@@ -1741,7 +1722,7 @@ function isLocalDatabaseUrl(databaseUrl) {
1741
1722
  }
1742
1723
  }
1743
1724
  function readSqlDriver(env, databaseUrl) {
1744
- const value = toOptionalTrimmed(env.JUNIOR_DATABASE_DRIVER);
1725
+ const value = toOptionalTrimmed(env["JUNIOR_DATABASE_DRIVER"]);
1745
1726
  if (value === void 0) {
1746
1727
  if (isLocalDatabaseUrl(databaseUrl)) return "postgres";
1747
1728
  return "neon";
@@ -1750,7 +1731,7 @@ function readSqlDriver(env, databaseUrl) {
1750
1731
  throw new Error("JUNIOR_DATABASE_DRIVER must be postgres or neon");
1751
1732
  }
1752
1733
  function readSqlStatementTimeoutMs(env) {
1753
- const rawValue = toOptionalTrimmed(env.JUNIOR_SQL_STATEMENT_TIMEOUT_MS);
1734
+ const rawValue = toOptionalTrimmed(env["JUNIOR_SQL_STATEMENT_TIMEOUT_MS"]);
1754
1735
  if (rawValue === void 0) return DEFAULT_SQL_STATEMENT_TIMEOUT_MS;
1755
1736
  const value = Number.parseInt(rawValue, 10);
1756
1737
  if (!Number.isSafeInteger(value) || value < 0 || String(value) !== rawValue) throw new Error("JUNIOR_SQL_STATEMENT_TIMEOUT_MS must be a non-negative integer");
@@ -1765,8 +1746,8 @@ function readChatConfig(env = process.env, functionMaxDurationSeconds = DEFAULT_
1765
1746
  bot: readBotConfig(env, resolvedFunctionMaxDurationSeconds),
1766
1747
  queue: readQueueConfig(env),
1767
1748
  functionMaxDurationSeconds: resolvedFunctionMaxDurationSeconds,
1768
- cacheWarmingEnabled: parseKillSwitch("JUNIOR_CACHE_WARMING_ENABLED", env.JUNIOR_CACHE_WARMING_ENABLED),
1769
- conversationWorkEnabled: parseKillSwitch("JUNIOR_CONVERSATION_WORK_ENABLED", env.JUNIOR_CONVERSATION_WORK_ENABLED),
1749
+ cacheWarmingEnabled: parseKillSwitch("JUNIOR_CACHE_WARMING_ENABLED", env["JUNIOR_CACHE_WARMING_ENABLED"]),
1750
+ conversationWorkEnabled: parseKillSwitch("JUNIOR_CONVERSATION_WORK_ENABLED", env["JUNIOR_CONVERSATION_WORK_ENABLED"]),
1770
1751
  conversationWorkSoftYieldAfterMs: resolveConversationWorkSoftYieldAfterMs(resolvedFunctionMaxDurationSeconds),
1771
1752
  encryption: readEncryptionKeyring(env),
1772
1753
  sql: {
@@ -1775,18 +1756,18 @@ function readChatConfig(env = process.env, functionMaxDurationSeconds = DEFAULT_
1775
1756
  statementTimeoutMs: readSqlStatementTimeoutMs(env)
1776
1757
  },
1777
1758
  slack: {
1778
- botToken: toOptionalTrimmed(env.SLACK_BOT_TOKEN) ?? toOptionalTrimmed(env.SLACK_BOT_USER_TOKEN),
1779
- clientId: toOptionalTrimmed(env.SLACK_CLIENT_ID),
1780
- clientSecret: toOptionalTrimmed(env.SLACK_CLIENT_SECRET),
1759
+ botToken: toOptionalTrimmed(env["SLACK_BOT_TOKEN"]) ?? toOptionalTrimmed(env["SLACK_BOT_USER_TOKEN"]),
1760
+ clientId: toOptionalTrimmed(env["SLACK_CLIENT_ID"]),
1761
+ clientSecret: toOptionalTrimmed(env["SLACK_CLIENT_SECRET"]),
1781
1762
  completedReactionEmoji: DEFAULT_COMPLETED_REACTION_EMOJI,
1782
1763
  processingReactionEmoji: DEFAULT_PROCESSING_REACTION_EMOJI,
1783
- signingSecret: toOptionalTrimmed(env.SLACK_SIGNING_SECRET)
1764
+ signingSecret: toOptionalTrimmed(env["SLACK_SIGNING_SECRET"])
1784
1765
  },
1785
- sandbox: { provider: env.JUNIOR_SANDBOX_PROVIDER?.trim().toLowerCase() === "docker" ? "docker" : "vercel" },
1766
+ sandbox: { provider: env["JUNIOR_SANDBOX_PROVIDER"]?.trim().toLowerCase() === "docker" ? "docker" : "vercel" },
1786
1767
  state: {
1787
- adapter: env.JUNIOR_STATE_ADAPTER?.trim().toLowerCase() === "memory" ? "memory" : "redis",
1788
- keyPrefix: toOptionalTrimmed(env.JUNIOR_STATE_KEY_PREFIX),
1789
- redisUrl: toOptionalTrimmed(env.REDIS_URL)
1768
+ adapter: env["JUNIOR_STATE_ADAPTER"]?.trim().toLowerCase() === "memory" ? "memory" : "redis",
1769
+ keyPrefix: toOptionalTrimmed(env["JUNIOR_STATE_KEY_PREFIX"]),
1770
+ redisUrl: toOptionalTrimmed(env["REDIS_URL"])
1790
1771
  }
1791
1772
  };
1792
1773
  }
@@ -1867,7 +1848,7 @@ function getSlackClientSecret() {
1867
1848
  }
1868
1849
  /** Return runtime metadata (version from deploy environment). */
1869
1850
  function getRuntimeMetadata() {
1870
- return { version: toOptionalTrimmed(process.env.VERCEL_GIT_COMMIT_SHA) };
1851
+ return { version: toOptionalTrimmed(process.env["VERCEL_GIT_COMMIT_SHA"]) };
1871
1852
  }
1872
1853
  /** Apply model overrides from createApp(). */
1873
1854
  function setBotModelConfig(config) {
@@ -1,9 +1,9 @@
1
- import { da as startOAuthFlow } from "./projection-CQNDOi82.js";
2
- import { n as botConfig } from "./config-CmjhyqgB.js";
3
- import { F as deleteProviderIdentityForSlackUser, I as deleteProviderIdentityForUser, s as getSqlExecutor } from "./db-Czra10QW.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-Dj377ADs.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BEY6EGRi.js";
6
- import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-H4YhvNBj.js";
1
+ import { pa as startOAuthFlow } from "./projection-DBq8tsA5.js";
2
+ import { n as botConfig } from "./config-oGM7KA9M.js";
3
+ import { I as deleteProviderIdentityForSlackUser, L as deleteProviderIdentityForUser, s as getSqlExecutor } from "./db-C-2tFxk3.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-Bu0Z9BEO.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
6
+ import { h as deleteMcpStoredOAuthCredentials, m as deleteMcpServerSessionId, p as deleteMcpAuthSessionsForUserProvider } from "./service-account-BcT5LR7V.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,10 +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-CQNDOi82.js";
1
+ import { Lt as moveIdleConversationDestination, Mo as readLatestConversationBrief, Ta as getSlackMessagePermalink, ga as formatSlackLink, ha as escapeSlackMrkdwnText, ji as getDashboardConversationLink, ka as postSlackMessage, wa as deleteSlackMessage } from "./projection-DBq8tsA5.js";
2
+ import { A as setFirstConversationLocation, J as getStateAdapter, a as getConversationStore, nt as getConversationIdByProviderConversation, o as getDb, s as getSqlExecutor, tt as claimProviderConversation, x as withConversationMutationLock } from "./db-C-2tFxk3.js";
2
3
  import { u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
3
- import { G as claimProviderConversation, K as getConversationIdByProviderConversation, a as getConversationStore, k as setFirstConversationLocation, o as getDb, s as getSqlExecutor, x as withConversationMutationLock } from "./db-Czra10QW.js";
4
- import { P as juniorDestinations } from "./executor-D_023K0H.js";
5
- import { r as getStateAdapter } from "./adapter-CNjGEJO9.js";
6
- import "./store-DmV4CoNr.js";
7
- import { c as joinPublicChannelForRead, s as checkSlackChannelReadAccess } from "./users-BxvYclQg.js";
4
+ import { _r as checkSlackChannelReadAccess, vr as joinPublicChannelForRead } from "./warmup-H8uLvW9e.js";
5
+ import "./store-Dgs7Oe44.js";
6
+ import { F as juniorDestinations } from "./executor-NVfS8aQ2.js";
8
7
  import { and, eq } from "drizzle-orm";
9
8
  // src/chat/slack/continue-in-slack.ts
10
9
  /** Refusal for a move that cannot wait for the active Run. */
@@ -1,4 +1,4 @@
1
- import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-IjdmO_r6.js";
1
+ import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-UZ3M2M9r.js";
2
2
  import * as z from "zod";
3
3
  import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
4
4
  // src/chat/briefs/schema.ts
@@ -1,4 +1,4 @@
1
- import { J as messageAttachmentSchema, Q as briefOutcomeStatusSchema, R as reviewItemChangeRecordSchema, b as conversationSummaryReportSchema, i as actorIdentitySchema, u as conversationDetailReportSchema } from "./conversation-BNXfq6Lb.js";
1
+ import { J as messageAttachmentSchema, Q as briefOutcomeStatusSchema, R as reviewItemChangeRecordSchema, b as conversationSummaryReportSchema, i as actorIdentitySchema, u as conversationDetailReportSchema } from "./conversation-CY1jnBiC.js";
2
2
  import * as z from "zod";
3
3
  // src/api/objects/cards.ts
4
4
  const MAX_LABEL_CHARS = 256;
@@ -100,6 +100,7 @@ function webPageObjectCard(args) {
100
100
  type: "web_page",
101
101
  ...args.siteName ? { siteName: truncate(args.siteName, MAX_FACT_CHARS) } : void 0,
102
102
  ...args.author ? { author: truncate(args.author, MAX_FACT_CHARS) } : void 0,
103
+ ...args.media ? { media: args.media } : void 0,
103
104
  ...args.thumbnailUrl ? { thumbnailUrl: args.thumbnailUrl } : void 0
104
105
  }
105
106
  };
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-DcjLDDqi.js";
1
+ import { h as logWarn } from "./logging-DiyqRLBx.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -79,11 +79,11 @@ function summarizeContent(content) {
79
79
  continue;
80
80
  }
81
81
  const record = part;
82
- const type = canonicalContentPartType(typeof record.type === "string" ? record.type : "unknown");
82
+ const type = canonicalContentPartType(typeof record["type"] === "string" ? record["type"] : "unknown");
83
83
  partTypes.add(type);
84
- if (typeof record.text === "string") chars += record.text.length;
85
- else if (typeof record.thinking === "string") chars += record.thinking.length;
86
- else if (typeof record.data === "string") chars += record.data.length;
84
+ if (typeof record["text"] === "string") chars += record["text"].length;
85
+ else if (typeof record["thinking"] === "string") chars += record["thinking"].length;
86
+ else if (typeof record["data"] === "string") chars += record["data"].length;
87
87
  else chars += serializedLength(part);
88
88
  }
89
89
  return {
@@ -165,8 +165,8 @@ function toGenAiMessagesTraceAttributes(prefix, messages) {
165
165
  continue;
166
166
  }
167
167
  const record = message;
168
- if (typeof record.role === "string") roles.add(record.role);
169
- const summary = summarizeContent(record.content);
168
+ if (typeof record["role"] === "string") roles.add(record["role"]);
169
+ const summary = summarizeContent(record["content"]);
170
170
  contentChars += summary.chars;
171
171
  for (const partType of summary.partTypes) partTypes.add(partType);
172
172
  }
@@ -1,22 +1,22 @@
1
- import { i as getActiveSpan, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
2
- 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-CQNDOi82.js";
3
- import { n as botConfig } from "./config-CmjhyqgB.js";
4
- import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-DcjLDDqi.js";
5
- import { C as isPersonInput, E as turnBehavior, a as getConversationStore, nt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor, w as isTopLevelKind } from "./db-Czra10QW.js";
6
- import { j as juniorConversations } from "./executor-D_023K0H.js";
7
- import { p as instructionProvenanceFor } from "./history-IjdmO_r6.js";
8
- import { f as credentialContextForActor } from "./registry-Dj377ADs.js";
9
- import { dt as resolveConversationDestination, i as measureTurnCompactionWait } from "./agent-runner-H4YhvNBj.js";
10
- import { o as isEventConversationMessage } from "./prompt-DLUB5m72.js";
11
- import { Y as readMessageAttachments } from "./conversation-BNXfq6Lb.js";
12
- import { A as turnInputFactsFromConversationMessage, F as isEventMailboxMetadata, I as renderEventBatchInputs, L as timerWatchCredentialSubject, P as eventBatchMessageMeta, X as maybePostAutomatedTurnLimitNotice, c as loadReviewItemInput, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, j as legacyWebMailboxMetadataSchema, k as sourceFromTurnInput, m as instructionForInputs, p as instructionActorFor, rt as recordFinishedTurnForAutomatedLimit, s as eventReviewItemInputs, w as getEventBatchDelayMs } from "./session-stop-BLmfFI3d.js";
13
- import { Et as executeTurn, L as readParentMessage, M as childAgentTurnOptions, N as isParentMessageMeta, St as createWebAuthorization, Tt as AgentRunError, Y as completeCancelledConversationTurn, dt as supersedeOpenMailboxTurns } from "./warmup-CdU5hR49.js";
14
- 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-DsUZi9gn.js";
15
- import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-BD3-jJl7.js";
16
- import { H as blockEventAutomation, M as blockScheduledAutomation, c as getDispatchRecord, o as getDispatchIdForConversation, v as notifyAutomationBlocked, x as readAutomationExecutionByConversationId } from "./store-Epv6t4vV.js";
17
- import { t as readConversationLineage } from "./lineage-DmMIE0VL.js";
18
- import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-CXLnbg7g.js";
19
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-BMxZI3o7.js";
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-DGvn9MSl.js";
3
+ import { C as isPersonInput, D as turnBehavior, a as getConversationStore, ft as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor, w as isTopLevelKind } from "./db-C-2tFxk3.js";
4
+ import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-DiyqRLBx.js";
5
+ import { Y as readMessageAttachments } from "./conversation-CY1jnBiC.js";
6
+ import { M as juniorConversations } from "./executor-NVfS8aQ2.js";
7
+ import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-BPky1KBe.js";
8
+ import { Et as resolveConversationDestination, Gn as AgentRunError, Hn as createWebAuthorization, Kn as executeTurn, jn as supersedeOpenMailboxTurns, on as childAgentTurnOptions, sn as isParentMessageMeta, un as readParentMessage, xn as completeCancelledConversationTurn } from "./warmup-H8uLvW9e.js";
9
+ import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, a as loadProjection, at as failTurnRecord, b as persistConversationMessages, bn as persistWithRetry, j as markConversationMessage, ki as verifyTimerWatchCredentialSubject, nt as saveTurnCheckpoint, st as getTurnRecord, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-DBq8tsA5.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-19CkuUvM.js";
11
+ import { f as credentialContextForActor } from "./registry-Bu0Z9BEO.js";
12
+ import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
13
+ import { i as measureTurnCompactionWait } from "./agent-runner-BP8_DLUv.js";
14
+ import { n as botConfig } from "./config-oGM7KA9M.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-BLLp1IP_.js";
16
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-BGXF7Fo7.js";
17
+ import { p as instructionProvenanceFor } from "./history-UZ3M2M9r.js";
18
+ import { o as isEventConversationMessage } from "./prompt-D2KlJopL.js";
19
+ import { t as readConversationLineage } from "./lineage-HGLhd_-N.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";
@@ -147,7 +147,6 @@ async function commitAssistantMessage(args) {
147
147
  const conversationMessageId = recordDeliveredAssistantMessage({
148
148
  cards: args.cards,
149
149
  conversation: args.conversation,
150
- ...args.quiet ? { quiet: args.quiet } : void 0,
151
150
  sessionId: args.sessionId,
152
151
  source: args.source,
153
152
  text: args.text,
@@ -532,9 +531,8 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
532
531
  if (!replyText?.trim()) return;
533
532
  failureCode = "delivery_failed";
534
533
  const cards = await loadPendingMessageCards(context.conversationId);
535
- const quiet = options?.quiet === true && isEventTurn && cards.length === 0;
536
534
  let deliveryResult;
537
- if ((options?.reply ? postsToProvider : deliverToProvider) && !quiet && !await isConversationDeliveryPaused(context.conversationId)) {
535
+ if ((options?.reply ? postsToProvider : deliverToProvider) && !await isConversationDeliveryPaused(context.conversationId)) {
538
536
  if (!conversationLocation || !deliverMessage) throw new Error(`Conversation ${context.conversationId} cannot deliver to its Location`);
539
537
  deliveryResult = await deliverMessage({
540
538
  cards,
@@ -549,7 +547,6 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
549
547
  conversation,
550
548
  conversationId: context.conversationId,
551
549
  ...deliveryResult ? { deliveryResult } : void 0,
552
- ...quiet ? { quiet } : void 0,
553
550
  sessionId: turnId,
554
551
  ...deliveryResult ? { source: "slack" } : source.kind === "web" ? { source: "web" } : void 0,
555
552
  text: replyText,
@@ -668,7 +665,6 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
668
665
  text: reply.blocked.missing
669
666
  });
670
667
  else if (reply.blocked) await blockRunAutomation(context.conversationId, reply.blocked);
671
- else if (reply.noReply?.note && isEventTurn) await deliverAssistantMessage(reply.noReply.note, { quiet: true });
672
668
  const completedState = buildDeliveredTurnStatePatch({
673
669
  conversation,
674
670
  reply,
@@ -1,22 +1,20 @@
1
- import { Da as postSlackMessage, Xo as getSlackClient, Z as getConversationPendingAuth, Zn as createUserTokenStore, ca as formatProviderLabel, d as recordAuthorizationCompleted, la as parseOAuthStatePayload, st as getTurnRecord, tr as resolvePluginOAuthAccount, u as recordAuthenticationLinked, ua as resolveBaseUrl } from "./projection-CQNDOi82.js";
2
- import { R as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-CmjhyqgB.js";
3
- import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DcjLDDqi.js";
1
+ import { $n as resolvePluginOAuthAccount, Qo as getSlackClient, Z as getConversationPendingAuth, Zn as createUserTokenStore, d as recordAuthorizationCompleted, da as parseOAuthStatePayload, fa as resolveBaseUrl, ka as postSlackMessage, st as getTurnRecord, u as recordAuthenticationLinked, ua as formatProviderLabel } from "./projection-DBq8tsA5.js";
2
+ import { R as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-oGM7KA9M.js";
3
+ import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DiyqRLBx.js";
4
4
  import { p as parseSlackUserId } from "./actor-D2iXzvlN.js";
5
- import { L as findUserByVerifiedEmails, N as resolveActorIdentityId, V as upsertLinkedIdentity, s as getSqlExecutor } from "./db-Czra10QW.js";
6
- import { r as getStateAdapter, s as acquireActiveLock } from "./adapter-CNjGEJO9.js";
7
- import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-Dj377ADs.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BEY6EGRi.js";
10
- import { t as discoverSkills } from "./skills-CmNG0dHb.js";
11
- import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession } from "./agent-runner-H4YhvNBj.js";
12
- import { o as readIdentityById } from "./viewer-H3EsMWtJ.js";
13
- import { t as readJuniorSecret } from "./secrets-DebYU866.js";
14
- import { Ct as deleteWebAuthorization, gt as wakePausedTurn, ht as wakeAuthorizedTurn } from "./warmup-CdU5hR49.js";
15
- import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-BD3-jJl7.js";
16
- import { _ as getMcpProviderErrorAttributes } from "./service-account-suY004dx.js";
17
- import { r as lookupSlackUserProfile } from "./users-BxvYclQg.js";
18
- import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-CfIRm0xv.js";
19
- import { n as relayLocalOAuthCallback } from "./oauth-relay-DRzq73b6.js";
5
+ import { H as upsertLinkedIdentity, J as getStateAdapter, P as resolveActorIdentityId, Q as acquireActiveLock, R as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-C-2tFxk3.js";
6
+ import { i as homeDir } from "./package-discovery-x4AvVhMj.js";
7
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-Bu0Z9BEO.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
9
+ import { t as discoverSkills } from "./skills-CNAGH4ju.js";
10
+ import { o as finalizeMcpAuthorization } from "./agent-runner-BP8_DLUv.js";
11
+ import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-BcT5LR7V.js";
12
+ import { o as readIdentityById } from "./viewer-BPQHMx3-.js";
13
+ import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
14
+ import { Fn as wakeAuthorizedTurn, In as wakePausedTurn, L as lookupSlackUserProfile, Un as deleteWebAuthorization } from "./warmup-H8uLvW9e.js";
15
+ import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-DGvn9MSl.js";
16
+ import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-BlikzEJv.js";
17
+ import { n as relayLocalOAuthCallback } from "./oauth-relay-DAmfVmJu.js";
20
18
  import * as z from "zod";
21
19
  import path from "node:path";
22
20
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -663,7 +661,7 @@ async function syncLocalOAuthCredential(provider, tokens) {
663
661
  provider,
664
662
  tokens
665
663
  });
666
- const port = process.env.PORT?.trim() || "3000";
664
+ const port = process.env["PORT"]?.trim() || "3000";
667
665
  const response = await fetch(`http://127.0.0.1:${port}/api/internal/local-oauth-credentials`, {
668
666
  method: "POST",
669
667
  headers: {
@@ -677,7 +675,7 @@ async function syncLocalOAuthCredential(provider, tokens) {
677
675
  /** Verify and store one credential sent by the local CLI over loopback. */
678
676
  async function receiveLocalOAuthCredential(request) {
679
677
  const hostname = new URL(request.url).hostname;
680
- if (process.env.NODE_ENV !== "development" || hostname !== "127.0.0.1" && hostname !== "localhost") return new Response(null, { status: 404 });
678
+ if (process.env["NODE_ENV"] !== "development" || hostname !== "127.0.0.1" && hostname !== "localhost") return new Response(null, { status: 404 });
681
679
  const body = await request.text();
682
680
  const actualSignature = request.headers.get("x-junior-local-credential-signature");
683
681
  if (!actualSignature || !signaturesMatch(signature(body), actualSignature)) return Response.json({ error: "Unauthorized" }, { status: 401 });