@sentry/junior 0.301.0 → 0.302.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 (79) hide show
  1. package/dist/adapter-context-Cx9fn9B3.js +43 -0
  2. package/dist/{admin-CRJHvCGg.js → admin-_poE5NKL.js} +2 -2
  3. package/dist/{agent-runner-H4YhvNBj.js → agent-runner-CY9RvsTX.js} +1380 -10601
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +4 -5
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +91 -68
  8. package/dist/{app-HDZglaIu.d.ts → app-BpY3wtRP.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +66 -296
  11. package/dist/{background-compaction-queue-CNrZ3QcU.js → background-compaction-queue-CXFq1_Cz.js} +94 -203
  12. package/dist/{briefs-x6Mzwxmg.js → briefs-B3NG-pid.js} +2 -2
  13. package/dist/{catalog-runtime-BEY6EGRi.js → catalog-runtime-Dss0lSV6.js} +1 -1
  14. package/dist/cli/chat.js +15 -15
  15. package/dist/cli/check.js +3 -3
  16. package/dist/cli/main.js +3 -3
  17. package/dist/cli/plugins.js +4 -4
  18. package/dist/cli/snapshot-create.js +4 -4
  19. package/dist/cli/upgrade.d.ts +1 -1
  20. package/dist/cli/upgrade.js +3 -3
  21. package/dist/{config-CmjhyqgB.js → config-CzeZiMKs.js} +2 -2
  22. package/dist/{connections-CfIRm0xv.js → connections-CDYhMfrs.js} +6 -6
  23. package/dist/{continue-in-slack-DPoABVkB.js → continue-in-slack-7Uf05ndC.js} +5 -6
  24. package/dist/{conversation-feed-CfpyFMHP.js → conversation-feed-Clf_cv0n.js} +1 -0
  25. package/dist/{conversation-privacy-0CM0V2qK.js → conversation-privacy-D9xnM5mK.js} +1 -1
  26. package/dist/{conversation-turn-C0sxyvS-.js → conversation-turn-D7SEZgTG.js} +15 -16
  27. package/dist/{credential-sync-tEMKZ_8M.js → credential-sync-DoD0gW-j.js} +13 -15
  28. package/dist/{db-Czra10QW.js → db-B-gtnNjr.js} +314 -5
  29. package/dist/{db-BdUHQhrC.d.ts → db-BdsCzytP.d.ts} +1 -1
  30. package/dist/{executor-D_023K0H.js → executor-DZg20EqU.js} +39 -4
  31. package/dist/install-t1KQyTUs.js +228 -0
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{state-CEbZuZD6.js → legacy-web-actor-id-C-cEeWqL.js} +33 -4
  34. package/dist/{lineage-DmMIE0VL.js → lineage-C79GjoQr.js} +2 -2
  35. package/dist/{logging-DcjLDDqi.js → logging-C9oDAg4M.js} +7 -3
  36. package/dist/{message-C0JY9RJP.js → message-BLUCzJXN.js} +8 -8
  37. package/dist/{model-input-CBp-p24N.js → model-input-5jwNC45G.js} +3 -3
  38. package/dist/nitro.d.ts +1 -1
  39. package/dist/nitro.js +4 -3
  40. package/dist/{oauth-callback-server-BRq9QNhU.js → oauth-callback-server-BBl66vCb.js} +2 -2
  41. package/dist/{projection-CQNDOi82.js → projection-CIBwgD3s.js} +282 -64
  42. package/dist/{prompt-DLUB5m72.js → prompt-CRQbzp5e.js} +14 -4
  43. package/dist/queue-DtCDaIct.js +115 -0
  44. package/dist/{registry-Dj377ADs.js → registry-DdFQHZ_d.js} +1 -1
  45. package/dist/{resolve-DJkh9Fky.js → resolve-CdW4BdrK.js} +4 -229
  46. package/dist/{result-C8iIpDl1.js → result-oOMv1t4O.js} +9 -9
  47. package/dist/{runner-DZqrOy8C.js → runner-DqitLtm-.js} +8 -8
  48. package/dist/{sandbox-egress-signals-CGwH86S9.js → sandbox-egress-signals-Bw9I0yfJ.js} +1 -1
  49. package/dist/{schema-CdZFn7Qd.d.ts → schema-BIFM-U1a.d.ts} +441 -30
  50. package/dist/{schema-DyHXiQKI.js → schema-DnVQepWP.js} +66 -29
  51. package/dist/{service-account-D6jGR4a1.js → service-account-B6mKAPVo.js} +3 -3
  52. package/dist/{service-account-suY004dx.js → service-account-CrZftRTb.js} +257 -6
  53. package/dist/{session-stop-BLmfFI3d.js → session-stop-DW63Z3kj.js} +543 -548
  54. package/dist/{skills-CmNG0dHb.js → skills-C16fz60Z.js} +2 -2
  55. package/dist/{slack-conversation-unfurl-Bty-DlHe.js → slack-conversation-unfurl-BHhefEb7.js} +8 -7
  56. package/dist/{spawn-CNjkpXpk.js → spawn-D_RnFYfy.js} +6 -6
  57. package/dist/{stop-Bjy2-K4H.js → stop-7p1i08CY.js} +724 -106
  58. package/dist/{store-DmV4CoNr.js → store-C28I0CVW.js} +5 -5
  59. package/dist/{task-queue-AhG1tSXR.js → task-queue-BVUJbQ28.js} +3 -3
  60. package/dist/{task-runner-BMxZI3o7.js → task-runner-CWi8j7Z6.js} +6 -8
  61. package/dist/{thread-context-CXLnbg7g.js → thread-context-D3-yYUd0.js} +7 -7
  62. package/dist/{store-Epv6t4vV.js → turn-session-routing-BFMS9ATF.js} +381 -10
  63. package/dist/{turn-user-message-DsUZi9gn.js → turn-user-message-C3-O8Omt.js} +3 -3
  64. package/dist/{validation-DOz8X9BU.js → validation-BSFKUIb4.js} +1 -1
  65. package/dist/{version-CGMRmMPK.js → version-BHHXNi-0.js} +1 -1
  66. package/dist/version.js +1 -1
  67. package/dist/{viewer-H3EsMWtJ.js → viewer-B1SO21Qa.js} +3 -3
  68. package/dist/warmup-Bz9bzkzN.js +13927 -0
  69. package/dist/{statuses-Hn-HsOph.js → web-message-id-lNodcCOI.js} +136 -1
  70. package/dist/{worker-ClphajjD.js → worker-BspReIIK.js} +7 -7
  71. package/migrations/0108_conversation_embeddings.sql +13 -0
  72. package/migrations/meta/0108_snapshot.json +4688 -0
  73. package/migrations/meta/_journal.json +7 -0
  74. package/package.json +8 -6
  75. package/dist/adapter-CNjGEJO9.js +0 -303
  76. package/dist/reporting-window-DopzcOHh.js +0 -137
  77. package/dist/turn-session-routing-BD3-jJl7.js +0 -380
  78. package/dist/users-BxvYclQg.js +0 -424
  79. package/dist/warmup-CdU5hR49.js +0 -3715
@@ -0,0 +1,228 @@
1
+ import { ao as SANDBOX_COMMAND_PATH, ho as runNonInteractiveCommand, lo as SANDBOX_WORKSPACE_ROOT } from "./projection-CIBwgD3s.js";
2
+ import { E as withSpan, b as setSpanAttributes } from "./logging-C9oDAg4M.js";
3
+ // src/chat/sandbox/resources.ts
4
+ let configuredResources;
5
+ function resourcesFromEnv() {
6
+ const value = process.env.SANDBOX_VCPUS?.trim();
7
+ if (!value || !/^\d+$/.test(value)) return;
8
+ const vcpus = Number(value);
9
+ if (!Number.isSafeInteger(vcpus) || vcpus <= 0) return;
10
+ return { vcpus };
11
+ }
12
+ /** Return the app-level sandbox sizing override. */
13
+ function getSandboxResourceConfig() {
14
+ return configuredResources;
15
+ }
16
+ /** Replace app-level sandbox sizing and return the previous setting. */
17
+ function setSandboxResourceConfig(config) {
18
+ const previous = configuredResources;
19
+ if (config?.vcpus === void 0) {
20
+ configuredResources = void 0;
21
+ return previous;
22
+ }
23
+ if (!Number.isSafeInteger(config.vcpus) || config.vcpus <= 0) throw new Error("sandbox.vcpus must be a positive integer");
24
+ configuredResources = { vcpus: config.vcpus };
25
+ return previous;
26
+ }
27
+ /**
28
+ * Resolve sandbox sizing. A Workspace vCPU setting wins over the app setting,
29
+ * which wins over the legacy environment setting.
30
+ */
31
+ function getSandboxResources(workspace) {
32
+ if (workspace?.vcpus) return { vcpus: workspace.vcpus };
33
+ return configuredResources ?? resourcesFromEnv();
34
+ }
35
+ // src/chat/sandbox/snapshot/span.ts
36
+ /** Record the reusable snapshot selected for a new Sandbox. */
37
+ function setSnapshotSpanAttributes(snapshot) {
38
+ setSpanAttributes({
39
+ "app.sandbox.source": snapshot.snapshotId ? "snapshot" : "created",
40
+ "app.sandbox.snapshot.cache_hit": snapshot.cacheHit,
41
+ "app.sandbox.snapshot.resolve_outcome": snapshot.resolveOutcome,
42
+ ...snapshot.profileHash ? { "app.sandbox.snapshot.profile_hash": snapshot.profileHash } : void 0,
43
+ "app.sandbox.snapshot.dependency_count": snapshot.dependencyCount,
44
+ ...snapshot.rebuildReason ? { "app.sandbox.snapshot.rebuild_reason": snapshot.rebuildReason } : void 0
45
+ });
46
+ }
47
+ /** Record one stage of dependency snapshot resolution or creation. */
48
+ async function trace(name, op, attributes, callback) {
49
+ return await withSpan(name, op, {}, callback, attributes);
50
+ }
51
+ // src/chat/sandbox/snapshot/install.ts
52
+ async function runOrThrow(sandbox, params, label) {
53
+ const result = await runNonInteractiveCommand(sandbox, params);
54
+ if (result.exitCode === 0) return;
55
+ const detail = result.stderr.trim() || result.stdout.trim() || "command failed";
56
+ throw new Error(`${label} failed: ${detail}`);
57
+ }
58
+ async function tryRun(sandbox, params) {
59
+ return (await runNonInteractiveCommand(sandbox, params)).exitCode === 0;
60
+ }
61
+ async function installGh(sandbox, signal, timeoutMs) {
62
+ if (await tryRun(sandbox, {
63
+ cmd: "dnf",
64
+ args: [
65
+ "install",
66
+ "-y",
67
+ "gh"
68
+ ],
69
+ signal,
70
+ sudo: true,
71
+ timeoutMs
72
+ })) return;
73
+ if (!await tryRun(sandbox, {
74
+ cmd: "dnf",
75
+ args: [
76
+ "config-manager",
77
+ "addrepo",
78
+ "--from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo"
79
+ ],
80
+ signal,
81
+ sudo: true,
82
+ timeoutMs
83
+ })) {
84
+ await runOrThrow(sandbox, {
85
+ cmd: "dnf",
86
+ args: [
87
+ "install",
88
+ "-y",
89
+ "dnf-command(config-manager)"
90
+ ],
91
+ signal,
92
+ sudo: true,
93
+ timeoutMs
94
+ }, "dnf install dnf-command(config-manager)");
95
+ await runOrThrow(sandbox, {
96
+ cmd: "dnf",
97
+ args: [
98
+ "config-manager",
99
+ "--add-repo",
100
+ "https://cli.github.com/packages/rpm/gh-cli.repo"
101
+ ],
102
+ signal,
103
+ sudo: true,
104
+ timeoutMs
105
+ }, "dnf config-manager --add-repo gh-cli.repo");
106
+ }
107
+ await runOrThrow(sandbox, {
108
+ cmd: "dnf",
109
+ args: [
110
+ "install",
111
+ "-y",
112
+ "gh",
113
+ "--repo",
114
+ "gh-cli"
115
+ ],
116
+ signal,
117
+ sudo: true,
118
+ timeoutMs
119
+ }, "dnf install gh --repo gh-cli");
120
+ }
121
+ function filePath(url, sha256) {
122
+ let basename = "package.rpm";
123
+ try {
124
+ const candidate = new URL(url).pathname.split("/").filter(Boolean).at(-1);
125
+ if (candidate) basename = candidate;
126
+ } catch {}
127
+ const sanitized = basename.replace(/[^a-zA-Z0-9._-]/g, "_");
128
+ return `/tmp/junior-runtime-${sha256.slice(0, 12)}-${sanitized}`;
129
+ }
130
+ async function installUrl(sandbox, dependency, signal, timeoutMs) {
131
+ const rpmPath = filePath(dependency.url, dependency.sha256);
132
+ await runOrThrow(sandbox, {
133
+ cmd: "curl",
134
+ args: [
135
+ "-fsSL",
136
+ dependency.url,
137
+ "-o",
138
+ rpmPath
139
+ ],
140
+ signal,
141
+ timeoutMs
142
+ }, `curl download ${dependency.url}`);
143
+ const checksum = await runNonInteractiveCommand(sandbox, {
144
+ cmd: "sha256sum",
145
+ args: [rpmPath],
146
+ signal,
147
+ timeoutMs
148
+ });
149
+ const expected = dependency.sha256;
150
+ const actual = checksum.stdout.trim().split(/\s+/)[0]?.toLowerCase();
151
+ if (checksum.exitCode !== 0) {
152
+ const detail = checksum.stderr.trim() || checksum.stdout.trim() || "command failed";
153
+ throw new Error(`sha256sum failed: ${detail}`);
154
+ }
155
+ if (!actual) throw new Error("sha256sum produced empty output");
156
+ if (actual !== expected) throw new Error(`checksum mismatch for ${dependency.url}: expected ${expected}, got ${actual}`);
157
+ await runOrThrow(sandbox, {
158
+ cmd: "dnf",
159
+ args: [
160
+ "install",
161
+ "-y",
162
+ rpmPath
163
+ ],
164
+ signal,
165
+ sudo: true,
166
+ timeoutMs
167
+ }, `dnf install ${dependency.url}`);
168
+ }
169
+ /** Install declared system and npm dependencies into a snapshot sandbox. */
170
+ async function dependencies(sandbox, values, signal, timeoutMs) {
171
+ const system = values.filter((dependency) => dependency.type === "system");
172
+ const npm = values.filter((dependency) => dependency.type === "npm").map((dependency) => `${dependency.package}@${dependency.version}`);
173
+ if (system.length > 0) await trace("sandbox.snapshot.install_system", "sandbox.snapshot.install.system", { "app.sandbox.snapshot.install.system_count": system.length }, async () => {
174
+ for (const dependency of system) {
175
+ signal?.throwIfAborted();
176
+ if ("url" in dependency) await installUrl(sandbox, dependency, signal, timeoutMs);
177
+ else if (dependency.package === "gh") await installGh(sandbox, signal, timeoutMs);
178
+ else await runOrThrow(sandbox, {
179
+ cmd: "dnf",
180
+ args: [
181
+ "install",
182
+ "-y",
183
+ dependency.package
184
+ ],
185
+ signal,
186
+ sudo: true,
187
+ timeoutMs
188
+ }, `dnf install ${dependency.package}`);
189
+ }
190
+ });
191
+ if (npm.length > 0) await trace("sandbox.snapshot.install_npm", "sandbox.snapshot.install.npm", { "app.sandbox.snapshot.install.npm_count": npm.length }, async () => {
192
+ await runOrThrow(sandbox, {
193
+ cmd: "npm",
194
+ args: [
195
+ "install",
196
+ "--global",
197
+ "--prefix",
198
+ `${SANDBOX_WORKSPACE_ROOT}/.junior`,
199
+ ...npm
200
+ ],
201
+ signal,
202
+ timeoutMs
203
+ }, "npm install");
204
+ });
205
+ }
206
+ /** Run declared postinstall commands after dependency binaries are available. */
207
+ async function postinstall(sandbox, commands, signal, timeoutMs) {
208
+ if (commands.length === 0) return;
209
+ await trace("sandbox.snapshot.runtime_postinstall", "sandbox.snapshot.runtime_postinstall", { "app.sandbox.snapshot.runtime_postinstall.count": commands.length }, async () => {
210
+ for (const command of commands) {
211
+ signal?.throwIfAborted();
212
+ const result = await runNonInteractiveCommand(sandbox, {
213
+ cmd: command.cmd,
214
+ args: command.args,
215
+ login: true,
216
+ path: SANDBOX_COMMAND_PATH,
217
+ signal,
218
+ timeoutMs,
219
+ ...command.sudo !== void 0 ? { sudo: command.sudo } : void 0
220
+ });
221
+ if (result.exitCode !== 0) {
222
+ const detail = result.stderr.trim() || result.stdout.trim() || "command failed";
223
+ throw new Error(`runtime-postinstall ${command.cmd} failed: ${detail}`);
224
+ }
225
+ }
226
+ });
227
+ }
228
+ export { getSandboxResourceConfig as a, trace as i, postinstall as n, getSandboxResources as o, setSnapshotSpanAttributes as r, setSandboxResourceConfig as s, dependencies as t };
@@ -1,6 +1,6 @@
1
1
  import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-BRTJqumy.js";
2
- import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-DcjLDDqi.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-0CM0V2qK.js";
2
+ import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-C9oDAg4M.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-D9xnM5mK.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
6
6
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
@@ -1,6 +1,9 @@
1
- import { i as getChatConfig } from "./config-CmjhyqgB.js";
2
- import { h as logWarn } from "./logging-DcjLDDqi.js";
3
- import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
1
+ import { i as getChatConfig } from "./config-CzeZiMKs.js";
2
+ import { h as logWarn } from "./logging-C9oDAg4M.js";
3
+ import { o as getDb } from "./db-B-gtnNjr.js";
4
+ import { P as juniorUsers } from "./executor-DZg20EqU.js";
5
+ import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
6
+ import { eq } from "drizzle-orm";
4
7
  // src/chat/encryption/secret.ts
5
8
  /**
6
9
  * Encrypt secrets that Junior keeps at rest, such as provider credentials.
@@ -129,4 +132,30 @@ async function readEncryptedState(state, key) {
129
132
  };
130
133
  return decode(key, stored);
131
134
  }
132
- export { readEncryptedState as n, createEncryptedState as t };
135
+ // src/chat/conversations/legacy-web-actor-id.ts
136
+ /**
137
+ * Web Actor ids that Junior stored before web Actors used the User id.
138
+ *
139
+ * Mailbox input, web authorizations, and OAuth credentials saved before that
140
+ * deploy still carry `dashboard:` and the first 24 hex characters of
141
+ * sha256(email).
142
+ *
143
+ * TODO(dcramer): Delete with its callers after that input and those
144
+ * authorizations expire and no `dashboard:` credential keys remain.
145
+ */
146
+ const USER_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
147
+ /** Return the legacy web Actor id for one email. */
148
+ function legacyWebActorUserId(email) {
149
+ return `dashboard:${createHash("sha256").update(email.trim().toLowerCase()).digest("hex").slice(0, 24)}`;
150
+ }
151
+ /** Return every web Actor id that names this User, the User id first. */
152
+ function webActorUserIds(user) {
153
+ return [user.id, legacyWebActorUserId(user.email)];
154
+ }
155
+ /** Return the legacy web Actor id of a User id, when the User exists. */
156
+ async function findLegacyWebActorUserId(userId) {
157
+ if (!USER_ID_PATTERN.test(userId)) return void 0;
158
+ const rows = await getDb().select({ email: juniorUsers.primaryEmailNormalized }).from(juniorUsers).where(eq(juniorUsers.id, userId)).limit(1);
159
+ return rows[0] ? legacyWebActorUserId(rows[0].email) : void 0;
160
+ }
161
+ export { readEncryptedState as i, webActorUserIds as n, createEncryptedState as r, findLegacyWebActorUserId as t };
@@ -1,5 +1,5 @@
1
- import { D as conversationKindFromRow, o as getDb } from "./db-Czra10QW.js";
2
- import { j as juniorConversations } from "./executor-D_023K0H.js";
1
+ import { O as conversationKindFromRow, o as getDb } from "./db-B-gtnNjr.js";
2
+ import { M as juniorConversations } from "./executor-DZg20EqU.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-BRTJqumy.js";
2
- import { t as JUNIOR_VERSION } from "./version-CGMRmMPK.js";
2
+ import { t as JUNIOR_VERSION } from "./version-BHHXNi-0.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";
@@ -132,11 +132,15 @@ function getDeploymentServiceVersion() {
132
132
  const deploymentRevision = toOptionalTrimmed(process.env.VERCEL_GIT_COMMIT_SHA);
133
133
  return deploymentRevision ? `${JUNIOR_VERSION}+${deploymentRevision}` : void 0;
134
134
  }
135
+ /** Vercel deployment that runs this process. Unset outside Vercel. */
136
+ function getDeploymentId() {
137
+ return toOptionalTrimmed(process.env.VERCEL_DEPLOYMENT_ID);
138
+ }
135
139
  /** Resolve deployment-scoped telemetry attributes from host environment. */
136
140
  function getDeploymentTelemetryAttributes() {
137
141
  const attributes = {};
138
142
  const serviceVersion = getDeploymentServiceVersion();
139
- const deploymentId = toOptionalTrimmed(process.env.VERCEL_DEPLOYMENT_ID);
143
+ const deploymentId = getDeploymentId();
140
144
  const region = toOptionalTrimmed(process.env.VERCEL_REGION);
141
145
  attributes["app.junior.version"] = JUNIOR_VERSION;
142
146
  attributes["service.instance.id"] = SERVICE_INSTANCE_ID;
@@ -1249,4 +1253,4 @@ function extractGenAiUsageAttributes(...sources) {
1249
1253
  ...cost?.total !== void 0 ? { "app.cost.total_usd": cost.total } : void 0
1250
1254
  };
1251
1255
  }
1252
- export { JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as A, getDeploymentTelemetryAttributes as B, summarizeMessageText as C, JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE as D, withSpan as E, JUNIOR_RETENTION_CRON_SCHEDULE as F, isRecord as G, GOOGLE_IDENTITY_PROVIDER as H, JUNIOR_RETENTION_ROUTE as I, toOptionalNumber as K, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as L, JUNIOR_HEARTBEAT_CRON_SCHEDULE as M, JUNIOR_HEARTBEAT_ROUTE as N, JUNIOR_AUTO_ARCHIVE_ROUTE as O, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as P, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as R, setTags as S, withLogContext as T, isNativeIdentityProvider as U, runWithLogAttributes as V, normalizeIdentityEmail as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as j, JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, toOptionalString as q, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, getDeploymentServiceVersion as z };
1256
+ export { JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as A, getDeploymentServiceVersion as B, summarizeMessageText as C, JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE as D, withSpan as E, JUNIOR_RETENTION_CRON_SCHEDULE as F, normalizeIdentityEmail as G, runWithLogAttributes as H, JUNIOR_RETENTION_ROUTE as I, toOptionalString as J, isRecord as K, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as L, JUNIOR_HEARTBEAT_CRON_SCHEDULE as M, JUNIOR_HEARTBEAT_ROUTE as N, JUNIOR_AUTO_ARCHIVE_ROUTE as O, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as P, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as R, setTags as S, withLogContext as T, GOOGLE_IDENTITY_PROVIDER as U, getDeploymentTelemetryAttributes as V, isNativeIdentityProvider as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as j, JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, toOptionalNumber as q, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, getDeploymentId as z };
@@ -1,12 +1,12 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Jn as renderUntrustedTag, vo as canAccessConversation, xo as readConversationAccessFromSql } from "./projection-CQNDOi82.js";
3
- import { n as botConfig } from "./config-CmjhyqgB.js";
4
- import { a as getConversationStore, j as SYSTEM_IDENTITY_ID, o as getDb } from "./db-Czra10QW.js";
5
- import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-H4YhvNBj.js";
6
- import { M as EVENT_WAIT_MS, Z as postAutomatedTurnLimitNoticeForConversation, nt as admitAutomatedTurn } from "./session-stop-BLmfFI3d.js";
7
- import { A as readChildConversationSender, H as enqueueAgentInvocation, Z as createAgentInvocationForMessage, at as findChildAgentConversationId, g as getActiveAgentInvocationForConversation, lt as PARENT_AGENT_TARGET, rt as AgentMessageTargetError, tt as AgentMessagePausedError, y as getLatestAgentInvocationForConversation } from "./warmup-CdU5hR49.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-DmV4CoNr.js";
9
- import { a as enqueueAgentMessageToParent } from "./result-C8iIpDl1.js";
2
+ import { Jn as renderUntrustedTag, vo as canAccessConversation, xo as readConversationAccessFromSql } from "./projection-CIBwgD3s.js";
3
+ import { n as botConfig } from "./config-CzeZiMKs.js";
4
+ import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-B-gtnNjr.js";
5
+ import { A as actorFromRun, j as toolInvocationDestination } from "./agent-runner-CY9RvsTX.js";
6
+ import { H as admitAutomatedTurn, L as postAutomatedTurnLimitNoticeForConversation, k as EVENT_WAIT_MS } from "./session-stop-DW63Z3kj.js";
7
+ import { Dn as findChildAgentConversationId, En as AgentMessageTargetError, Sn as createAgentInvocationForMessage, Tn as AgentMessagePausedError, Wt as getActiveAgentInvocationForConversation, kn as PARENT_AGENT_TARGET, mn as enqueueAgentInvocation, qt as getLatestAgentInvocationForConversation, rn as readChildConversationSender } from "./warmup-Bz9bzkzN.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-C28I0CVW.js";
9
+ import { a as enqueueAgentMessageToParent } from "./result-oOMv1t4O.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 { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { s as getSqlExecutor } from "./db-Czra10QW.js";
3
- import { vt as readLiveAttachment } from "./agent-runner-H4YhvNBj.js";
4
- import { m as isVisionImageMediaType, p as detectImageMediaType } from "./statuses-Hn-HsOph.js";
2
+ import { s as getSqlExecutor } from "./db-B-gtnNjr.js";
3
+ import { Mt as readLiveAttachment } from "./warmup-Bz9bzkzN.js";
4
+ import { h as isVisionImageMediaType, m as detectImageMediaType } from "./web-message-id-lNodcCOI.js";
5
5
  // src/chat/attachments/model-input.ts
6
6
  var model_input_exports = /* @__PURE__ */ __exportAll({
7
7
  MAX_MODEL_ATTACHMENTS: () => 3,
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-HDZglaIu.js";
1
+ import { i as JuniorDashboardOptions } from "./app-BpY3wtRP.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,7 +1,8 @@
1
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-DcjLDDqi.js";
1
+ 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-C9oDAg4M.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
3
- import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as CACHE_WARMUP_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-CNrZ3QcU.js";
4
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-AhG1tSXR.js";
3
+ import { s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-CXFq1_Cz.js";
4
+ import { o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as CACHE_WARMUP_QUEUE_TOPIC } from "./queue-DtCDaIct.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BVUJbQ28.js";
5
6
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-BBX07Jzt.js";
6
7
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
7
8
  import path from "node:path";
@@ -1,5 +1,5 @@
1
- import { Zn as createUserTokenStore } from "./projection-CQNDOi82.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-tEMKZ_8M.js";
1
+ import { Zn as createUserTokenStore } from "./projection-CIBwgD3s.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DoD0gW-j.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;