@sentry/junior 0.308.0 → 0.310.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 (89) hide show
  1. package/dist/{actor-D2iXzvlN.js → actor-BsBdxDXQ.js} +0 -1
  2. package/dist/{adapter-context-BO432242.js → adapter-context-BhKpjpGD.js} +2 -2
  3. package/dist/{admin-vSmheo3Z.js → admin-tgZEZAk2.js} +2 -2
  4. package/dist/{agent-runner-BnOofGFG.js → agent-runner-D9cvNlQl.js} +245 -204
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.d.ts +4 -2
  8. package/dist/api.js +416 -272
  9. package/dist/{app-CqYqy541.d.ts → app-B_7Wn0en.d.ts} +4 -6
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +74 -193
  12. package/dist/{background-compaction-queue-BpmDEQf6.js → background-compaction-queue-BGHqkhkY.js} +4 -4
  13. package/dist/{briefs-Dbh94cRp.js → briefs-DKxkoruh.js} +3 -3
  14. package/dist/{catalog-runtime-q9AJjuUN.js → catalog-runtime-BxwzbLKY.js} +1 -1
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +10 -10
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +5 -5
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-Cx8H0MRw.js → config-Dkt2Le2b.js} +51 -92
  23. package/dist/{continue-in-slack-CtTv1tkn.js → continue-in-slack-BWVwePKD.js} +6 -6
  24. package/dist/{conversation--f85g4zL.js → conversation-M9KZ5JxF.js} +7 -2
  25. package/dist/{conversation-feed-BNs9KiqC.js → conversation-feed-Ci6YD1N-.js} +1 -1
  26. package/dist/{conversation-privacy-CivmFlWP.js → conversation-privacy-C39g8BY4.js} +1 -1
  27. package/dist/{conversation-turn-C9-Nfnsy.js → conversation-turn-CBlZIH02.js} +20 -21
  28. package/dist/{credential-sync-CWIORwD9.js → credential-sync-vGnrB0BY.js} +31 -23
  29. package/dist/{db-C41UgdBj.d.ts → db-B4Hjxr-u.d.ts} +2 -2
  30. package/dist/{db-CO6Y10eM.js → db-CFZggNoy.js} +20 -10
  31. package/dist/{executor-Doo-N6Yn.js → executor-BPkZDx5-.js} +12 -4
  32. package/dist/fan-out-Cod-yEHG.js +10 -0
  33. package/dist/{history-N7IVbUom.js → history-CYstOMKX.js} +6 -0
  34. package/dist/{connections-DUylBPiR.js → html-2r2KmLwi.js} +146 -11
  35. package/dist/{install-Y2s9ZPvk.js → install-C-oE6C_u.js} +2 -2
  36. package/dist/instrumentation.js +2 -2
  37. package/dist/{lineage-BcqyhMyp.js → lineage-CsvrEFQe.js} +2 -2
  38. package/dist/{logging-DnBYBM8z.js → logging-D5gkyvnK.js} +1 -1
  39. package/dist/{message-fSnXIqvl.js → message-DwvJ-I3w.js} +8 -8
  40. package/dist/{model-input-DRChpXJ7.js → model-input-MAq2881y.js} +15 -10
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +4 -4
  43. package/dist/{oauth-callback-server-BUU6zd_T.js → oauth-callback-server-DIF6Li06.js} +2 -2
  44. package/dist/{oauth-relay-gO_Ynmpb.js → oauth-relay-DPE-wrwO.js} +1 -1
  45. package/dist/{package-discovery-x4AvVhMj.js → package-discovery-DD9vencX.js} +0 -1
  46. package/dist/{projection-Bqn6zdVT.js → projection-jZSlEAXG.js} +116 -123
  47. package/dist/{prompt-DAjjk5fm.js → prompt-CaMyeCpA.js} +25 -14
  48. package/dist/{registry-tHJLCtKS.js → registry-BBkWFCl8.js} +3 -3
  49. package/dist/{resolve-z2sKt8xM.js → resolve-B38MkHXE.js} +3 -3
  50. package/dist/{result-D2wshngt.js → result-BaqSZcJb.js} +12 -13
  51. package/dist/{runner-BvNPWLAy.js → runner-11h8PrHh.js} +10 -10
  52. package/dist/{sandbox-egress-signals-CmHD-6vr.js → sandbox-egress-signals-CTcACAtJ.js} +1 -1
  53. package/dist/{schedule-BG1tEbRF.js → schedule-DWxZ3kja.js} +1 -1
  54. package/dist/{schema-CRXcj4fj.d.ts → schema-DriSvB40.d.ts} +43 -43
  55. package/dist/{schema-D4jdesIu.js → schema-obw5jvR4.js} +65 -28
  56. package/dist/{service-account-B2d1Er_r.js → service-account-Bx93N1n1.js} +3 -3
  57. package/dist/{service-account-CddxU-yC.js → service-account-Zc5bUcIJ.js} +7 -8
  58. package/dist/{session-stop-BQ0J0Fph.js → session-stop-BfY4rhJs.js} +179 -199
  59. package/dist/{skills-Dm2-5nn5.js → skills-C8Npu5zO.js} +99 -57
  60. package/dist/{slack-conversation-unfurl-CLH0tTLk.js → slack-conversation-unfurl-DlRVA02H.js} +18 -15
  61. package/dist/{spawn-PwAuSN59.js → spawn-CXr58R0x.js} +6 -6
  62. package/dist/{state-rXH58smZ.js → state-CGrGVeQC.js} +4 -4
  63. package/dist/{stop-CcHPEcFE.js → stop-DYzjRf2U.js} +176 -135
  64. package/dist/{store-7QA00oK6.js → store-D4FQ1Nml.js} +5 -5
  65. package/dist/{task-queue-DvQZH5rG.js → task-queue-CaZffYaH.js} +7 -4
  66. package/dist/{task-runner-CyZMcuZy.js → task-runner-Dm7BHbGp.js} +11 -12
  67. package/dist/{thread-context-C-hLTQST.js → thread-context-Dyj1KWaY.js} +13 -11
  68. package/dist/{turn-session-routing-Cqjj1B3i.js → turn-session-routing-CD0BRCex.js} +4 -4
  69. package/dist/{turn-user-message-DbU7MNd9.js → turn-user-message-9IxeEv5v.js} +14 -5
  70. package/dist/{queue-CbEHUO0l.d.ts → types-fnU7Xs__.d.ts} +3 -1
  71. package/dist/{users-B-UpCmw9.js → users-CaUAYMb3.js} +1 -1
  72. package/dist/{validation-BEUlev32.js → validation-DxVNIxA0.js} +1 -1
  73. package/dist/{version-BE1OyrXV.js → version-Cr7Z71yG.js} +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/{viewer-CqOkWizK.js → viewer-AHldghAD.js} +7 -5
  76. package/dist/{warmup-HFgFZFwS.js → warmup-C6LOZ2d2.js} +138 -80
  77. package/dist/{worker-CCEDWbsY.js → worker-CUBtu1Li.js} +8 -8
  78. package/migrations/0121_people_list_metric_index.sql +1 -0
  79. package/migrations/0122_automation_rollout_repair.sql +56 -0
  80. package/migrations/0123_cache_warming_history_reset.sql +10 -0
  81. package/migrations/0124_artifact_visibility.sql +9 -0
  82. package/migrations/0125_artifact_public_sha_index.sql +1 -0
  83. package/migrations/meta/0121_snapshot.json +5481 -0
  84. package/migrations/meta/0122_snapshot.json +5481 -0
  85. package/migrations/meta/0123_snapshot.json +5481 -0
  86. package/migrations/meta/0124_snapshot.json +5516 -0
  87. package/migrations/meta/0125_snapshot.json +5516 -0
  88. package/migrations/meta/_journal.json +35 -0
  89. package/package.json +7 -7
@@ -212,6 +212,10 @@ const mcpProviderConnectedEventDataSchema = z.object({
212
212
  provider: z.string().min(1),
213
213
  credentialSubjectId: z.string().min(1)
214
214
  }).strict();
215
+ const skillLoadedEventDataSchema = z.object({
216
+ type: z.literal("skill_loaded"),
217
+ skillName: z.string().min(1)
218
+ }).strict();
215
219
  const unownedMcpProviderConnectedEventDataSchema = z.object({
216
220
  type: z.literal("mcp_provider_connected_unowned"),
217
221
  provider: z.string().min(1)
@@ -444,6 +448,7 @@ const appendableConversationEventDataSchema = z.union([
444
448
  messageUpdatedEventDataSchema,
445
449
  agentHistoryItemSchema,
446
450
  mcpProviderConnectedEventDataSchema,
451
+ skillLoadedEventDataSchema,
447
452
  authorizationRequestedEventDataSchema,
448
453
  authorizationCompletedEventDataSchema,
449
454
  toolExecutionStartedEventDataSchema,
@@ -480,6 +485,7 @@ const KNOWN_CONVERSATION_EVENT_TYPES = [
480
485
  "system_message",
481
486
  "mcp_provider_connected",
482
487
  "mcp_provider_connected_unowned",
488
+ "skill_loaded",
483
489
  "authorization_requested",
484
490
  "authorization_completed",
485
491
  "tool_execution_started",
@@ -1,10 +1,10 @@
1
- import { ia as startOAuthFlow } from "./projection-Bqn6zdVT.js";
2
- import { n as botConfig } from "./config-Cx8H0MRw.js";
3
- import { R as deleteProviderIdentityForSlackUser, s as getSqlExecutor, z as deleteProviderIdentityForUser } from "./db-CO6Y10eM.js";
4
- import { d as hasRequiredOAuthScope } from "./registry-tHJLCtKS.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-q9AJjuUN.js";
6
- import { h as deleteMcpStoredOAuthCredentials, m as deleteMcpServerSessionId, p as deleteMcpAuthSessionsForUserProvider } from "./service-account-CddxU-yC.js";
7
- import pLimit from "p-limit";
1
+ import { sa as startOAuthFlow } from "./projection-jZSlEAXG.js";
2
+ import { n as botConfig } from "./config-Dkt2Le2b.js";
3
+ import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
4
+ import { B as deleteProviderIdentityForUser, s as getSqlExecutor, z as deleteProviderIdentityForSlackUser } from "./db-CFZggNoy.js";
5
+ import { d as hasRequiredOAuthScope } from "./registry-BBkWFCl8.js";
6
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BxwzbLKY.js";
7
+ import { h as deleteMcpStoredOAuthCredentials, m as deleteMcpServerSessionId, p as deleteMcpAuthSessionsForUserProvider } from "./service-account-Zc5bUcIJ.js";
8
8
  import { randomBytes } from "node:crypto";
9
9
  // src/handlers/oauth-html.ts
10
10
  /** Build pre-escaped callback HTML with the shared response security policy. */
@@ -195,8 +195,7 @@ function connectablePlugin(provider) {
195
195
  /** List OAuth plugins and the user's connection state for each one. */
196
196
  async function listConnections(userId, userTokenStore) {
197
197
  const plugins = pluginCatalogRuntime.getProviders().filter((plugin) => Boolean(plugin.manifest.oauth));
198
- const limit = pLimit(8);
199
- return await Promise.all(plugins.map((plugin) => limit(async () => {
198
+ return await mapBounded(plugins, async (plugin) => {
200
199
  const tokens = await readConnectedOAuthTokens(userId, plugin, userTokenStore);
201
200
  const account = tokens?.account;
202
201
  return {
@@ -209,7 +208,7 @@ async function listConnections(userId, userTokenStore) {
209
208
  ...account.url ? { url: account.url } : void 0
210
209
  } } : void 0
211
210
  };
212
- })));
211
+ });
213
212
  }
214
213
  /** True when the provider is an installed plugin with user OAuth. */
215
214
  function isConnectableProvider(provider) {
@@ -247,4 +246,140 @@ async function disconnectConnection(userId, provider, userTokenStore) {
247
246
  if (tokens?.account) await deleteProviderIdentityForUser(getSqlExecutor(), userId, provider, tokens.account.id);
248
247
  await unlinkProvider(userId, provider, userTokenStore);
249
248
  }
250
- export { startConnection as a, readConnectedOAuthTokens as i, isConnectableProvider as n, unlinkProvider as o, listConnections as r, htmlCallbackResponse as s, disconnectConnection as t };
249
+ // src/api/html.ts
250
+ /** Escape text before it enters server-rendered HTML. */
251
+ function escapeHtml(value) {
252
+ return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#039;");
253
+ }
254
+ /** Return true when a browser request comes from its own URL origin. */
255
+ function requestHasSameOrigin(request) {
256
+ const origin = request.headers.get("origin");
257
+ return origin !== null && URL.parse(origin)?.origin === new URL(request.url).origin;
258
+ }
259
+ const PAGE_STYLE = `
260
+ :root {
261
+ color-scheme: dark;
262
+ --bg: #060607;
263
+ --panel: #0c0c0e;
264
+ --raised: #101013;
265
+ --hover: #17171a;
266
+ --text: #f4f4f5;
267
+ --muted: #a1a1aa;
268
+ --faint: #8a8a93;
269
+ --solid: #ffffff;
270
+ --subtle: #c4c4cc;
271
+ --inverse: #000000;
272
+ --focus: #beaaff;
273
+ --border: rgb(255 255 255 / 0.08);
274
+ --border-emphasis: rgb(255 255 255 / 0.15);
275
+ --border-heavy: rgb(255 255 255 / 0.3);
276
+ --warning-bg: rgb(251 191 36 / 0.08);
277
+ --warning-border: rgb(251 191 36 / 0.3);
278
+ --warning-text: #fcd34d;
279
+ --shadow: 0 16px 40px rgb(0 0 0 / 0.5);
280
+ }
281
+ @media (prefers-color-scheme: light) {
282
+ :root {
283
+ color-scheme: light;
284
+ --bg: #ffffff;
285
+ --panel: #f9f9fa;
286
+ --raised: #ffffff;
287
+ --hover: #f1f1f3;
288
+ --text: #18181b;
289
+ --muted: #52525b;
290
+ --faint: #71717a;
291
+ --solid: #09090b;
292
+ --subtle: #3f3f46;
293
+ --inverse: #ffffff;
294
+ --focus: #7553ff;
295
+ --border: rgb(0 0 0 / 0.09);
296
+ --border-emphasis: rgb(0 0 0 / 0.16);
297
+ --border-heavy: rgb(0 0 0 / 0.32);
298
+ --warning-bg: rgb(245 158 11 / 0.1);
299
+ --warning-border: rgb(217 119 6 / 0.35);
300
+ --warning-text: #92400e;
301
+ --shadow: 0 16px 40px rgb(0 0 0 / 0.08);
302
+ }
303
+ }
304
+ * { box-sizing: border-box; }
305
+ body {
306
+ margin: 0;
307
+ min-height: 100vh;
308
+ display: grid;
309
+ place-items: center;
310
+ padding: 24px 16px;
311
+ background: var(--bg);
312
+ color: var(--text);
313
+ font: 16px/1.5 Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
314
+ }
315
+ main {
316
+ width: 100%;
317
+ max-width: 28rem;
318
+ padding: 32px;
319
+ border: 1px solid var(--border);
320
+ border-radius: 12px;
321
+ background: var(--panel);
322
+ box-shadow: var(--shadow);
323
+ }
324
+ h1, h2 { font-family: Outfit, "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif; }
325
+ h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
326
+ h2 { margin: 24px 0 8px; font-size: 0.875rem; line-height: 1.35; font-weight: 600; color: var(--subtle); }
327
+ p { margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }
328
+ p:last-child { margin-bottom: 0; }
329
+ strong { color: var(--text); font-weight: 600; }
330
+ code { font: 0.8125rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--faint); overflow-wrap: anywhere; }
331
+ .list { margin: 0 0 24px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); }
332
+ .list li { padding: 12px 16px; font-size: 0.875rem; line-height: 1.35; }
333
+ .list li + li { border-top: 1px solid var(--border); }
334
+ .list code { display: block; margin-top: 4px; }
335
+ .warning { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--warning-border); border-radius: 8px; background: var(--warning-bg); color: var(--warning-text); font-size: 0.875rem; line-height: 1.35; }
336
+ .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
337
+ label { display: block; margin: 0 0 16px; font-size: 0.875rem; font-weight: 600; color: var(--subtle); }
338
+ label input {
339
+ display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px;
340
+ border: 1px solid var(--border-emphasis); border-radius: 6px; background: var(--raised);
341
+ color: var(--text); font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
342
+ }
343
+ button {
344
+ width: 100%; min-height: 44px; padding: 8px 16px; border: 1px solid var(--border-emphasis); border-radius: 6px;
345
+ background: var(--raised); color: var(--text); cursor: pointer;
346
+ font-family: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1; transition: background-color 0.2s ease, border-color 0.2s ease;
347
+ }
348
+ button:hover { border-color: var(--border-heavy); background: var(--hover); }
349
+ button.primary { border-color: var(--solid); background: var(--solid); color: var(--inverse); }
350
+ button.primary:hover { border-color: var(--subtle); background: var(--subtle); }
351
+ button:focus-visible, label input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
352
+ @media (max-width: 480px) { main { padding: 24px; } }
353
+ @media (prefers-reduced-motion: reduce) { button { transition: none; } }
354
+ `;
355
+ /**
356
+ * Render one sign-in page that browsers cannot frame or cache. `bodyHtml`
357
+ * follows the heading, and the caller escapes every value in it. Callers use
358
+ * the `list`, `warning`, `actions`, and `primary` classes from `PAGE_STYLE`.
359
+ */
360
+ function renderHtmlPage(page) {
361
+ return new Response(`<!DOCTYPE html>
362
+ <html lang="en">
363
+ <head>
364
+ <meta charset="utf-8" />
365
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
366
+ <title>${escapeHtml(page.title)}</title>
367
+ <style>${PAGE_STYLE}</style>
368
+ </head>
369
+ <body>
370
+ <main>
371
+ <h1>${escapeHtml(page.title)}</h1>
372
+ ${page.bodyHtml}
373
+ </main>
374
+ </body>
375
+ </html>`, {
376
+ status: page.status,
377
+ headers: {
378
+ "cache-control": "no-store",
379
+ "content-type": "text/html; charset=utf-8",
380
+ "x-frame-options": "DENY",
381
+ ...page.headers
382
+ }
383
+ });
384
+ }
385
+ export { isConnectableProvider as a, startConnection as c, disconnectConnection as i, unlinkProvider as l, renderHtmlPage as n, listConnections as o, requestHasSameOrigin as r, readConnectedOAuthTokens as s, escapeHtml as t, htmlCallbackResponse as u };
@@ -1,5 +1,5 @@
1
- import { Aa as SANDBOX_COMMAND_PATH, Fa as SANDBOX_WORKSPACE_ROOT, Va as runNonInteractiveCommand } from "./projection-Bqn6zdVT.js";
2
- import { E as withSpan, b as setSpanAttributes } from "./logging-DnBYBM8z.js";
1
+ import { Na as SANDBOX_COMMAND_PATH, Ra as SANDBOX_WORKSPACE_ROOT, Wa as runNonInteractiveCommand } from "./projection-jZSlEAXG.js";
2
+ import { E as withSpan, b as setSpanAttributes } from "./logging-D5gkyvnK.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-CivmFlWP.js";
2
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-C39g8BY4.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-DnBYBM8z.js";
7
+ import { B as getDeploymentServiceVersion, V as getDeploymentTelemetryAttributes } from "./logging-D5gkyvnK.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-CO6Y10eM.js";
2
- import { R as juniorConversations } from "./executor-Doo-N6Yn.js";
1
+ import { j as conversationKindFromRow, o as getDb } from "./db-CFZggNoy.js";
2
+ import { R as juniorConversations } from "./executor-BPkZDx5-.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-BE1OyrXV.js";
2
+ import { t as JUNIOR_VERSION } from "./version-Cr7Z71yG.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 { F as actorFromRun, I as toolInvocationDestination } from "./agent-runner-BnOofGFG.js";
3
- import { $t as readChildConversationSender, Bt as getActiveAgentInvocationForConversation, Cn as findChildAgentConversationId, Sn as AgentMessageTargetError, Tn as PARENT_AGENT_TARGET, Ut as getLatestAgentInvocationForConversation, un as enqueueAgentInvocation, vn as createAgentInvocationForMessage, xn as AgentMessagePausedError } from "./warmup-HFgFZFwS.js";
4
- import { a as enqueueAgentMessageToParent } from "./result-D2wshngt.js";
5
- import { Wa as canAccessConversation, qa as readConversationAccessFromSql } from "./projection-Bqn6zdVT.js";
6
- import { Z as renderUntrustedTag, n as botConfig } from "./config-Cx8H0MRw.js";
7
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-CO6Y10eM.js";
8
- import { $ as postAutomatedTurnLimitNoticeForConversation, F as EVENT_WAIT_MS, ot as admitAutomatedTurn } from "./session-stop-BQ0J0Fph.js";
9
- import { r as appendAndEnqueueInboundMessage } from "./store-7QA00oK6.js";
2
+ import { F as actorFromRun, I as toolInvocationDestination } from "./agent-runner-D9cvNlQl.js";
3
+ import { Cn as AgentMessageTargetError, En as PARENT_AGENT_TARGET, Sn as AgentMessagePausedError, Vt as getActiveAgentInvocationForConversation, Wt as getLatestAgentInvocationForConversation, dn as enqueueAgentInvocation, en as readChildConversationSender, wn as findChildAgentConversationId, yn as createAgentInvocationForMessage } from "./warmup-C6LOZ2d2.js";
4
+ import { a as enqueueAgentMessageToParent } from "./result-BaqSZcJb.js";
5
+ import { Xa as readConversationAccessFromSql, qa as canAccessConversation } from "./projection-jZSlEAXG.js";
6
+ import { J as renderUntrustedTag, n as botConfig } from "./config-Dkt2Le2b.js";
7
+ import { F as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-CFZggNoy.js";
8
+ import { F as EVENT_WAIT_MS, et as postAutomatedTurnLimitNoticeForConversation, st as admitAutomatedTurn } from "./session-stop-BfY4rhJs.js";
9
+ import { r as appendAndEnqueueInboundMessage } from "./store-D4FQ1Nml.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,21 +1,26 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { s as getSqlExecutor } from "./db-CO6Y10eM.js";
2
+ import { s as getSqlExecutor } from "./db-CFZggNoy.js";
3
3
  import { h as isVisionImageMediaType, m as detectImageMediaType } from "./web-message-id-BT8Mg8LL.js";
4
- import { bo as readLiveAttachment } from "./projection-Bqn6zdVT.js";
4
+ import { Co as readLiveAttachment } from "./projection-jZSlEAXG.js";
5
+ import { escapeTagText, renderTag } from "@sentry/junior-plugin-api";
5
6
  // src/chat/attachments/model-input.ts
6
7
  var model_input_exports = /* @__PURE__ */ __exportAll({ loadInputAttachments: () => loadInputAttachments });
7
8
  /** Largest file that Slack and web send to the model in the prompt. */
8
9
  const MAX_MODEL_ATTACHMENT_BYTES = 5242880;
10
+ /**
11
+ * Render the name and type lines of an attachment tag. The person who
12
+ * attached the file chose its name, so both are escaped.
13
+ */
14
+ function attachmentFactLines(args) {
15
+ return [`filename: ${escapeTagText(args.filename ?? "unnamed")}`, `media_type: ${escapeTagText(args.mediaType)}`];
16
+ }
9
17
  /** Tell the model how to read a stored file that the prompt does not carry. */
10
18
  function buildStoredAttachmentPromptText(args) {
11
- return [
12
- "<attachment>",
13
- `filename: ${args.filename ?? "unnamed"}`,
14
- `media_type: ${args.mediaType}`,
19
+ return renderTag("attachment", {}, [
20
+ ...attachmentFactLines(args),
15
21
  `attachment_id: ${args.attachmentId}`,
16
- "Use loadAttachment with this id to access the original file.",
17
- "</attachment>"
18
- ].join("\n");
22
+ "Use loadAttachment with this id to access the original file."
23
+ ]);
19
24
  }
20
25
  async function readStoredBytes(args) {
21
26
  const record = await readLiveAttachment({
@@ -74,4 +79,4 @@ async function loadInputAttachments(args) {
74
79
  };
75
80
  }));
76
81
  }
77
- export { buildStoredAttachmentPromptText as n, model_input_exports as r, MAX_MODEL_ATTACHMENT_BYTES as t };
82
+ export { model_input_exports as i, attachmentFactLines as n, buildStoredAttachmentPromptText as r, MAX_MODEL_ATTACHMENT_BYTES as t };
package/dist/nitro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as JuniorPluginSet } from "./plugins-fBrz8PCV.js";
2
- import { i as JuniorDashboardOptions } from "./app-CqYqy541.js";
2
+ import { i as JuniorDashboardOptions } from "./app-B_7Wn0en.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
5
5
  type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-x4AvVhMj.js";
1
+ import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DD9vencX.js";
2
2
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-Bkk0XRo2.js";
3
- import { a as CACHE_WARMUP_QUEUE_TOPIC, h as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./background-compaction-queue-BpmDEQf6.js";
4
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-DvQZH5rG.js";
5
- 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-DnBYBM8z.js";
3
+ import { a as CACHE_WARMUP_QUEUE_TOPIC, h as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./background-compaction-queue-BGHqkhkY.js";
4
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CaZffYaH.js";
5
+ 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-D5gkyvnK.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cv2ETe8Y.js";
7
7
  import path from "node:path";
8
8
  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-CWIORwD9.js";
2
- import { bn as createUserTokenStore } from "./projection-Bqn6zdVT.js";
1
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-vGnrB0BY.js";
2
+ import { Sn as createUserTokenStore } from "./projection-jZSlEAXG.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,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { d as readJuniorSecret } from "./task-queue-DvQZH5rG.js";
2
+ import { d as readJuniorSecret } from "./task-queue-CaZffYaH.js";
3
3
  import * as z from "zod";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { SignJWT, jwtVerify } from "jose";
@@ -114,7 +114,6 @@ var discovery_exports = /* @__PURE__ */ __exportAll({
114
114
  descriptionPath: () => descriptionPath,
115
115
  descriptionPathCandidates: () => descriptionPathCandidates,
116
116
  discoverNodeModulesDirs: () => discoverNodeModulesDirs,
117
- discoverProjectRoots: () => discoverProjectRoots,
118
117
  homeDir: () => homeDir,
119
118
  isDirectory: () => isDirectory,
120
119
  isFile: () => isFile,