@sentry/junior 0.280.0 → 0.282.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 (73) hide show
  1. package/dist/{adapter-DVN3iwf9.js → adapter-BAqo7eOH.js} +1 -1
  2. package/dist/{admin-Q_UI--9W.js → admin-DbWpMHh6.js} +1 -1
  3. package/dist/{agent-runner-_PYLv4Qo.js → agent-runner-h4CDcnDV.js} +1001 -981
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +5 -5
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +39 -33
  8. package/dist/{app-CL2zzzE0.d.ts → app-B-0wwAxr.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +42 -34
  11. package/dist/{assistant-reply-DbebsAxi.js → assistant-reply-4Wvo95-N.js} +1 -1
  12. package/dist/{automation-CPqRFjIa.js → automation-sIsmIXH7.js} +1 -1
  13. package/dist/{background-compaction-queue-B9lmh8Ml.js → background-compaction-queue-CoWqScCC.js} +2 -2
  14. package/dist/{briefs-Dej7V0Bz.js → briefs-CMiotFo9.js} +4 -8
  15. package/dist/{catalog-runtime-DpN0sWQ6.js → catalog-runtime-Cpje_Uic.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +74 -7
  23. package/dist/{client-h2A2ZPzY.js → client-BHgCXeaF.js} +2 -2
  24. package/dist/{config-CusBFORe.js → config-DBdBimZ9.js} +1 -1
  25. package/dist/{connections-C4h6mGha.js → connections-DjY72_uF.js} +10 -10
  26. package/dist/{conversation-DExTZw8B.js → conversation-DNtcULyX.js} +29 -8
  27. package/dist/{conversation-pending-messages-Dgz6hrJs.js → conversation-pending-messages-LlFnr9-m.js} +10 -2
  28. package/dist/{conversation-privacy-2cm6OpNg.js → conversation-privacy-DiDh9KE4.js} +1 -1
  29. package/dist/{credential-sync-DK06Jgt-.js → credential-sync-DUrQwccr.js} +13 -13
  30. package/dist/{db-Dsvk1Tp1.d.ts → db-hQsoB16L.d.ts} +2 -1
  31. package/dist/{executor-Cmr0J8W3.js → executor-CGqJCxgR.js} +14 -3
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{logging-CGnh65_X.js → logging-DapIaJAi.js} +1 -1
  34. package/dist/{message-RpAnqHPY.js → message-BjN5sKad.js} +9 -9
  35. package/dist/nitro.d.ts +1 -1
  36. package/dist/nitro.js +3 -11
  37. package/dist/{oauth-callback-server-BBnhVKuX.js → oauth-callback-server-DVHKrjJP.js} +2 -2
  38. package/dist/{projection-C1MghKyI.js → projection-ii_OYu6z.js} +78 -30
  39. package/dist/{prompt-BcHg-BMy.js → prompt-DI6KCtwb.js} +5 -26
  40. package/dist/{registry-DR7DjX9H.js → registry-DpjG3yS-.js} +1 -1
  41. package/dist/{resolve-0Ful4oDv.js → resolve-iMW9Dgo2.js} +3 -3
  42. package/dist/{result-Dd9kCuQ-.js → result-BrlvfyIj.js} +9 -9
  43. package/dist/{runner-yiY8gUUu.js → runner-Bg9mr2pB.js} +11 -11
  44. package/dist/{sandbox-egress-signals-BzQVHCMz.js → sandbox-egress-signals-Bd3lb_Wd.js} +1 -1
  45. package/dist/{schema-C5pEgfHc.js → schema-BN34Jy-U.js} +3 -3
  46. package/dist/{schema-BkMmF552.d.ts → schema-CsqJzkP5.d.ts} +68 -9
  47. package/dist/{service-account-Cu7HFLZQ.js → service-account-Bd1348kw.js} +3 -3
  48. package/dist/{service-account-PIMpWZHF.js → service-account-Dfl9Pitm.js} +3 -3
  49. package/dist/{session-stop-CDEMsNtv.js → session-stop-CVEEx_YD.js} +12 -12
  50. package/dist/{skills-B2xIoe0f.js → skills-DqUUuf4L.js} +2 -2
  51. package/dist/{spawn-C0DySQRV.js → spawn-e7rQs14T.js} +2 -2
  52. package/dist/{stop-Dj5-nrAo.js → stop-DtpBUUJq.js} +353 -135
  53. package/dist/{store-Dlio-o6u.js → store-nETG4KVg.js} +4 -4
  54. package/dist/{store-QzOfDwKA.js → store-nu3Xx08K.js} +3 -3
  55. package/dist/{task-queue-Cp1V_XW3.js → task-queue-CYje8WKs.js} +3 -3
  56. package/dist/{task-runner-CQkkUj3o.js → task-runner-CwegN45x.js} +6 -6
  57. package/dist/{thread-state-Bn87cfzE.js → thread-state-BDaMl9yd.js} +4 -4
  58. package/dist/{turn-failure-response-CQebxByj.js → turn-failure-response-CV06tN_R.js} +7 -7
  59. package/dist/{turn-lifecycle-CJJsOhXB.js → turn-lifecycle-CF2N7ud5.js} +1 -1
  60. package/dist/{turn-session-routing-bmG330Cf.js → turn-session-routing-BIJGJjVh.js} +9 -9
  61. package/dist/{validation-D1wcf7hp.js → validation-DXvxEEjq.js} +1 -1
  62. package/dist/{version-BeHSXUK6.js → version-CzEk1KBX.js} +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/{viewer-BZ0Hp5Nb.js → viewer-C2PztlYX.js} +22 -8
  65. package/dist/{work-BTcCIbWu.js → work-BM_L0Pv9.js} +10 -10
  66. package/dist/{worker-D3fDK6zc.js → worker-2no53G60.js} +6 -6
  67. package/migrations/0062_plugin_report_index.sql +3 -3
  68. package/migrations/0078_plugin_conversation_index.sql +3 -3
  69. package/migrations/0079_conversation_event_author_index.sql +3 -3
  70. package/migrations/0080_conversation_event_latest_message_indexes.sql +27 -0
  71. package/migrations/meta/0080_snapshot.json +4265 -0
  72. package/migrations/meta/_journal.json +7 -0
  73. package/package.json +5 -5
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, L as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, M as JUNIOR_HEARTBEAT_ROUTE } from "../logging-CGnh65_X.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DR7DjX9H.js";
3
- import { i as parseSkillFile } from "../skills-B2xIoe0f.js";
1
+ import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, L as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, M as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DapIaJAi.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DpjG3yS-.js";
3
+ import { i as parseSkillFile } from "../skills-DqUUuf4L.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
27
  async function runAdmin(argv) {
28
- return await (await import("../admin-Q_UI--9W.js")).runAdmin(argv);
28
+ return await (await import("../admin-DbWpMHh6.js")).runAdmin(argv);
29
29
  }
30
30
  async function runServiceAccount(argv) {
31
- return await (await import("../service-account-Cu7HFLZQ.js")).runServiceAccount(argv);
31
+ return await (await import("../service-account-Bd1348kw.js")).runServiceAccount(argv);
32
32
  }
33
33
  async function runBriefs(argv) {
34
- return await (await import("../briefs-Dej7V0Bz.js")).runBriefs(argv);
34
+ return await (await import("../briefs-CMiotFo9.js")).runBriefs(argv);
35
35
  }
36
36
  function topLevelCommand(argv) {
37
37
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { Aa as createPluginLogger, Rn as setPlugins, zn as validatePlugins } from "../projection-C1MghKyI.js";
2
- import { S as getDb } from "../viewer-BZ0Hp5Nb.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DpN0sWQ6.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-D1wcf7hp.js";
1
+ import { Aa as createPluginLogger, Rn as setPlugins, zn as validatePlugins } from "../projection-ii_OYu6z.js";
2
+ import { S as getDb } from "../viewer-C2PztlYX.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Cpje_Uic.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DXvxEEjq.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { ai as create } from "../projection-C1MghKyI.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DpN0sWQ6.js";
3
- import { t as disconnectStateAdapter } from "../adapter-DVN3iwf9.js";
4
- import { n as resolve } from "../resolve-0Ful4oDv.js";
1
+ import { ai as create } from "../projection-ii_OYu6z.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Cpje_Uic.js";
3
+ import { t as disconnectStateAdapter } from "../adapter-BAqo7eOH.js";
4
+ import { n as resolve } from "../resolve-iMW9Dgo2.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_RUNTIME = "node22";
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,4 +1,4 @@
1
- import "../db-Dsvk1Tp1.js";
1
+ import "../db-hQsoB16L.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-DtmjkTza.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-CusBFORe.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-Cmr0J8W3.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-DR7DjX9H.js";
1
+ import { i as getChatConfig } from "../config-DBdBimZ9.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-CGqJCxgR.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-DpjG3yS-.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -8,6 +8,69 @@ import { createHash } from "node:crypto";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { createJiti } from "jiti";
10
10
  import { readMigrationFiles } from "drizzle-orm/migrator";
11
+ // src/db/concurrent-indexes.ts
12
+ const CONCURRENT_INDEX_MARKER = "-- junior:concurrent-index";
13
+ const INDEX_STATEMENT = /^CREATE INDEX "([a-z0-9_]+)" ON "([a-z0-9_]+)" .+;$/;
14
+ function markedIndexes(migration) {
15
+ const lines = migration.sql.join("").split("\n").map((line) => line.trim());
16
+ const indexes = [];
17
+ for (const [index, line] of lines.entries()) {
18
+ if (line !== CONCURRENT_INDEX_MARKER) continue;
19
+ const statement = lines[index + 1] ?? "";
20
+ const match = INDEX_STATEMENT.exec(statement);
21
+ if (!match?.[1] || !match[2]) throw new Error(`Migration ${migration.folderMillis}: the line after "${CONCURRENT_INDEX_MARKER}" must be one CREATE INDEX statement on one line.`);
22
+ indexes.push({
23
+ name: match[1],
24
+ statement,
25
+ table: match[2]
26
+ });
27
+ }
28
+ return indexes;
29
+ }
30
+ /** Remove the schema name so indexes on same-name tables compare equal. */
31
+ function withoutSchema(definition) {
32
+ return definition.replace(/ ON [^ ]+\./, " ON ");
33
+ }
34
+ async function readIndexState(executor, name) {
35
+ const [row] = await executor.query(`SELECT pg_get_indexdef(indexrelid) AS definition,
36
+ indisvalid AND indisready AS usable
37
+ FROM pg_index
38
+ WHERE indexrelid = to_regclass($1)`, [name]);
39
+ return row;
40
+ }
41
+ async function expectedDefinition(executor, index) {
42
+ return await executor.transaction(async () => {
43
+ await executor.execute(`CREATE TEMPORARY TABLE "${index.table}" (LIKE "${index.table}") ON COMMIT DROP`);
44
+ await executor.execute(index.statement);
45
+ const [row] = await executor.query(`SELECT pg_get_indexdef(format('pg_temp.%I', $1::text)::regclass) AS definition`, [index.name]);
46
+ if (!row) throw new Error(`Index ${index.name} was not built on the empty copy.`);
47
+ return withoutSchema(row.definition);
48
+ });
49
+ }
50
+ async function buildConcurrentIndex(executor, index) {
51
+ const [table] = await executor.query(`SELECT to_regclass($1) IS NOT NULL AS "exists"`, [index.table]);
52
+ if (!table?.exists) return;
53
+ const expected = await expectedDefinition(executor, index);
54
+ let state = await readIndexState(executor, index.name);
55
+ if (state && !state.usable) {
56
+ await executor.execute(`DROP INDEX CONCURRENTLY IF EXISTS "${index.name}"`);
57
+ state = void 0;
58
+ }
59
+ if (!state) {
60
+ await executor.execute(index.statement.replace(/^CREATE INDEX /, "CREATE INDEX CONCURRENTLY "));
61
+ state = await readIndexState(executor, index.name);
62
+ }
63
+ if (!state?.usable || withoutSchema(state.definition) !== expected) throw new Error(`Index ${index.name} does not match its migration. Expected "${expected}", found "${state?.definition ?? "no index"}". Drop the index, then run junior upgrade again.`);
64
+ }
65
+ /**
66
+ * Build the marked indexes of pending migrations before the transactional
67
+ * migrate, so that the migrate does not block writes to existing tables.
68
+ * Call it while the migration lock is held.
69
+ */
70
+ async function buildPendingConcurrentIndexes(executor, migrations, appliedAt) {
71
+ const pending = migrations.filter((migration) => appliedAt === void 0 || migration.folderMillis > appliedAt);
72
+ for (const index of pending.flatMap(markedIndexes)) await buildConcurrentIndex(executor, index);
73
+ }
11
74
  // src/db/postgres-error.ts
12
75
  /** Return whether an unknown PostgreSQL failure has the requested SQLSTATE. */
13
76
  function isPostgresErrorCode(error, code) {
@@ -79,6 +142,7 @@ async function migrateSchema(executor) {
79
142
  const lockedState = await loadCoreMigrationState(executor);
80
143
  if (isCurrentMigrationState(lockedState, latestMigration.folderMillis)) return migrationResult(migrations, lockedState);
81
144
  assertSupportedMigrationState(lockedState);
145
+ await buildPendingConcurrentIndexes(executor, migrations, lockedState.appliedAt);
82
146
  await executor.migrate({
83
147
  migrationsFolder,
84
148
  migrationsTable: MIGRATIONS_TABLE
@@ -172,10 +236,13 @@ async function migratePluginSchemas(executor, roots, options = {}) {
172
236
  table
173
237
  });
174
238
  const existing = appliedCount(migrations, currentTime);
175
- if (existing < migrations.length) await executor.migrate({
176
- migrationsFolder: root.dir,
177
- migrationsTable: table
178
- });
239
+ if (existing < migrations.length) {
240
+ await buildPendingConcurrentIndexes(executor, migrations, currentTime);
241
+ await executor.migrate({
242
+ migrationsFolder: root.dir,
243
+ migrationsTable: table
244
+ });
245
+ }
179
246
  return {
180
247
  existing,
181
248
  migrated: migrations.length - existing,
@@ -1,5 +1,5 @@
1
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-CGnh65_X.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-2cm6OpNg.js";
1
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DapIaJAi.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DiDh9KE4.js";
3
3
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
4
4
  import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
5
5
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -1,5 +1,5 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-h2A2ZPzY.js";
2
+ import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-BHgCXeaF.js";
3
3
  import { AwsClient } from "aws4fetch";
4
4
  import * as z from "zod";
5
5
  // src/chat/attachments/s3.ts
@@ -1,13 +1,13 @@
1
- import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-C1MghKyI.js";
2
- import { n as botConfig } from "./config-CusBFORe.js";
3
- import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-BZ0Hp5Nb.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-DR7DjX9H.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DpN0sWQ6.js";
6
- import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-_PYLv4Qo.js";
7
- import { r as getStateAdapter } from "./adapter-DVN3iwf9.js";
8
- import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-B9lmh8Ml.js";
9
- import { m as ensureConversationWake, w as requestConversationWork } from "./store-QzOfDwKA.js";
10
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-bmG330Cf.js";
1
+ import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-ii_OYu6z.js";
2
+ import { n as botConfig } from "./config-DBdBimZ9.js";
3
+ import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-C2PztlYX.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-DpjG3yS-.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
6
+ import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-h4CDcnDV.js";
7
+ import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
8
+ import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-CoWqScCC.js";
9
+ import { m as ensureConversationWake, w as requestConversationWork } from "./store-nu3Xx08K.js";
10
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-BIJGJjVh.js";
11
11
  import { randomBytes, randomUUID } from "node:crypto";
12
12
  import * as z from "zod";
13
13
  // src/chat/task-execution/authorized-turn.ts
@@ -75,14 +75,18 @@ const conversationBriefSchema = z.object({
75
75
  "assumed"
76
76
  ])
77
77
  }).strict()).max(20),
78
- openDecisions: z.array(z.object({
79
- text: lineSchema,
80
- owner: lineSchema.optional()
81
- }).strict()).max(20),
82
78
  facts: z.array(lineSchema).max(30),
83
79
  links: z.array(briefLinkSchema).max(40),
84
80
  keywords: z.array(z.string().trim().toLowerCase().min(1).max(400)).max(12)
85
81
  }).strict();
82
+ /** Parse a stored Brief row, dropping fields that older versions wrote. */
83
+ function parseStoredBrief(content) {
84
+ if (content && typeof content === "object" && "openDecisions" in content) {
85
+ const { openDecisions: _openDecisions, ...rest } = content;
86
+ return conversationBriefSchema.parse(rest);
87
+ }
88
+ return conversationBriefSchema.parse(content);
89
+ }
86
90
  const briefEntrySchema = z.object({
87
91
  index: z.number().int().nonnegative(),
88
92
  role: z.enum([
@@ -290,10 +294,16 @@ const conversationDetailQuerySchema = z.object({
290
294
  /** Also return `unreadPage` when the detail has an `unreadCursor`. */
291
295
  unreadPage: z.stringbool().optional(),
292
296
  /**
293
- * Also return `mailbox`, read before history, and never answer 304. A
294
- * first load gets both in one request.
297
+ * Also return `mailbox`, read before history. A sent version that still
298
+ * matches gets `{ unchanged: true, mailbox }` instead of 304, so a poll
299
+ * needs one request.
300
+ */
301
+ mailbox: z.stringbool().optional(),
302
+ /**
303
+ * An `appendCursor` from an earlier detail. Events then hold only newer
304
+ * events, with `appended: true`, while the cursor still applies.
295
305
  */
296
- mailbox: z.stringbool().optional()
306
+ after: z.string().min(1).optional()
297
307
  }).strict();
298
308
  const conversationEventsLimitSchema = z.coerce.number().int().min(1).max(1e3).default(150);
299
309
  /**
@@ -840,6 +850,17 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
840
850
  */
841
851
  authors: z.record(z.string(), actorIdentitySchema).optional(),
842
852
  events: z.array(conversationReportEventSchema),
853
+ /**
854
+ * Events hold only the events after the request's `after` cursor. The
855
+ * report omits `previousCursor` and `unreadCursor`: the reader keeps its
856
+ * own.
857
+ */
858
+ appended: z.literal(true).optional(),
859
+ /**
860
+ * Pass as `after` on the next detail read to get only newer events.
861
+ * Absent after a purge.
862
+ */
863
+ appendCursor: z.string().min(1).optional(),
843
864
  eventHistory: conversationEventHistorySchema,
844
865
  previousCursor: z.string().min(1).optional(),
845
866
  generatedAt: z.string(),
@@ -851,4 +872,4 @@ const conversationFeedSchema = z.object({
851
872
  source: z.literal("conversation_index"),
852
873
  generatedAt: z.string()
853
874
  }).strict();
854
- export { messageCardRef as A, briefLinkSchema as B, createConversationMessageBodySchema as C, conversationReadPositionSchema as D, conversationChildAgentTotalsSchema as E, MAX_INPUT_IMAGES as F, conversationBriefSchema as H, MAX_INPUT_IMAGE_BYTES as I, messageAttachmentSchema as L, readMessageCardRefs as M, removedCardSchema as N, reviewItemChangeRecordSchema as O, resolveMessageCards as P, readMessageAttachments as R, createConversationBodySchema as S, forkConversationResponseSchema as T, parseBriefInput as U, briefOutcomeStatusSchema as V, conversationReportMessageEventSchema as _, conversationAttachmentParamsSchema as a, conversationSurfaceSchema as b, conversationDetailReportSchema as c, conversationEventsQuerySchema as d, conversationFeedQuerySchema as f, conversationReportEventSchema as g, conversationReportEventDataSchema as h, conversationActivityPreviewSchema as i, messageCardText as j, annotationCard as k, conversationEventHistorySchema as l, conversationParamsSchema as m, acceptedConversationMessageSchema as n, conversationAuxiliaryCostsSchema as o, conversationFeedSchema as p, actorIdentitySchema as r, conversationDetailQuerySchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, conversationEventPageSchema as u, conversationReportStatusSchema as v, forkConversationBodySchema as w, conversationUsageSchema as x, conversationSummaryReportSchema as y, briefCodeChangeSchema as z };
875
+ export { messageCardRef as A, briefLinkSchema as B, createConversationMessageBodySchema as C, conversationReadPositionSchema as D, conversationChildAgentTotalsSchema as E, MAX_INPUT_IMAGES as F, conversationBriefSchema as H, MAX_INPUT_IMAGE_BYTES as I, messageAttachmentSchema as L, readMessageCardRefs as M, removedCardSchema as N, reviewItemChangeRecordSchema as O, resolveMessageCards as P, readMessageAttachments as R, createConversationBodySchema as S, forkConversationResponseSchema as T, parseBriefInput as U, briefOutcomeStatusSchema as V, parseStoredBrief as W, conversationReportMessageEventSchema as _, conversationAttachmentParamsSchema as a, conversationSurfaceSchema as b, conversationDetailReportSchema as c, conversationEventsQuerySchema as d, conversationFeedQuerySchema as f, conversationReportEventSchema as g, conversationReportEventDataSchema as h, conversationActivityPreviewSchema as i, messageCardText as j, annotationCard as k, conversationEventHistorySchema as l, conversationParamsSchema as m, acceptedConversationMessageSchema as n, conversationAuxiliaryCostsSchema as o, conversationFeedSchema as p, actorIdentitySchema as r, conversationDetailQuerySchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, conversationEventPageSchema as u, conversationReportStatusSchema as v, forkConversationBodySchema as w, conversationUsageSchema as x, conversationSummaryReportSchema as y, briefCodeChangeSchema as z };
@@ -1,4 +1,4 @@
1
- import { L as messageAttachmentSchema, O as reviewItemChangeRecordSchema, c as conversationDetailReportSchema, r as actorIdentitySchema } from "./conversation-DExTZw8B.js";
1
+ import { L as messageAttachmentSchema, O as reviewItemChangeRecordSchema, c as conversationDetailReportSchema, r as actorIdentitySchema } from "./conversation-DNtcULyX.js";
2
2
  import * as z from "zod";
3
3
  // src/reporting-schema.ts
4
4
  const healthReportSchema = z.object({
@@ -152,6 +152,14 @@ const conversationPendingMessagesReportSchema = z.object({
152
152
  }).strict();
153
153
  /** Detail report with the mailbox that was read before its history. */
154
154
  const conversationDetailWithMailboxReportSchema = conversationDetailReportSchema.extend({ mailbox: conversationPendingMessagesReportSchema });
155
+ /**
156
+ * Answer to a `mailbox=true` poll whose detail version still matches. The
157
+ * client keeps its cached detail and takes the new mailbox.
158
+ */
159
+ const conversationUnchangedDetailWithMailboxSchema = z.object({
160
+ mailbox: conversationPendingMessagesReportSchema,
161
+ unchanged: z.literal(true)
162
+ }).strict();
155
163
  /** Optional filters for cancelling accepted mailbox rows. */
156
164
  const cancelConversationPendingMessagesBodySchema = z.object({
157
165
  inboundMessageIds: z.array(z.string().min(1)).min(1).optional(),
@@ -170,4 +178,4 @@ const steerConversationPendingMessagesResponseSchema = z.object({
170
178
  conversationId: z.string().min(1),
171
179
  steeredInboundMessageIds: z.array(z.string().min(1))
172
180
  }).strict();
173
- export { pluginsSchema as _, conversationPendingMessageDeliverySchema as a, skillReportsSchema as b, steerConversationPendingMessagesBodySchema as c, healthReportSchema as d, pluginOperationalReportFeedSchema as f, pluginSchema as g, pluginPackageContentReportSchema as h, conversationPendingAuthorizationSchema as i, steerConversationPendingMessagesResponseSchema as l, pluginPackageContentItemReportSchema as m, cancelConversationPendingMessagesResponseSchema as n, conversationPendingMessageSchema as o, pluginOperationalReportSchema as p, conversationDetailWithMailboxReportSchema as r, conversationPendingMessagesReportSchema as s, cancelConversationPendingMessagesBodySchema as t, apiErrorSchema as u, runtimeInfoReportSchema as v, skillReportSchema as y };
181
+ export { pluginSchema as _, conversationPendingMessageDeliverySchema as a, skillReportSchema as b, conversationUnchangedDetailWithMailboxSchema as c, apiErrorSchema as d, healthReportSchema as f, pluginPackageContentReportSchema as g, pluginPackageContentItemReportSchema as h, conversationPendingAuthorizationSchema as i, steerConversationPendingMessagesBodySchema as l, pluginOperationalReportSchema as m, cancelConversationPendingMessagesResponseSchema as n, conversationPendingMessageSchema as o, pluginOperationalReportFeedSchema as p, conversationDetailWithMailboxReportSchema as r, conversationPendingMessagesReportSchema as s, cancelConversationPendingMessagesBodySchema as t, steerConversationPendingMessagesResponseSchema as u, pluginsSchema as v, skillReportsSchema as x, runtimeInfoReportSchema as y };
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-CGnh65_X.js";
1
+ import { h as logWarn } from "./logging-DapIaJAi.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,19 +1,19 @@
1
- import { On as resolvePluginOAuthAccount, d as recordAuthorizationCompleted, hi as resolveBaseUrl, ki as postSlackMessage, mi as parseOAuthStatePayload, pi as formatProviderLabel, q as getConversationPendingAuth, tt as getTurnRecord, u as recordAuthenticationLinked, wn as createUserTokenStore, zi as getSlackClient } from "./projection-C1MghKyI.js";
2
- import { m as escapeXml } from "./client-h2A2ZPzY.js";
3
- import { a as getRuntimeMetadata, n as botConfig } from "./config-CusBFORe.js";
4
- import { H as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-CGnh65_X.js";
1
+ import { On as resolvePluginOAuthAccount, d as recordAuthorizationCompleted, hi as resolveBaseUrl, ki as postSlackMessage, mi as parseOAuthStatePayload, pi as formatProviderLabel, q as getConversationPendingAuth, tt as getTurnRecord, u as recordAuthenticationLinked, wn as createUserTokenStore, zi as getSlackClient } from "./projection-ii_OYu6z.js";
2
+ import { m as escapeXml } from "./client-BHgCXeaF.js";
3
+ import { a as getRuntimeMetadata, n as botConfig } from "./config-DBdBimZ9.js";
4
+ import { H as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DapIaJAi.js";
5
5
  import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
6
- import { B as findUserByVerifiedEmails, C as getSqlExecutor, I as resolveActorIdentityId, W as upsertLinkedIdentity, o as readIdentityById } from "./viewer-BZ0Hp5Nb.js";
6
+ import { B as findUserByVerifiedEmails, C as getSqlExecutor, I as resolveActorIdentityId, W as upsertLinkedIdentity, o as readIdentityById } from "./viewer-C2PztlYX.js";
7
7
  import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DR7DjX9H.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DpN0sWQ6.js";
10
- import { t as discoverSkills } from "./skills-B2xIoe0f.js";
11
- import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-_PYLv4Qo.js";
8
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DpjG3yS-.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
10
+ import { t as discoverSkills } from "./skills-DqUUuf4L.js";
11
+ import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-h4CDcnDV.js";
12
12
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
13
- import { r as getStateAdapter } from "./adapter-DVN3iwf9.js";
14
- import { _ as getMcpProviderErrorAttributes } from "./service-account-PIMpWZHF.js";
15
- import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Bn87cfzE.js";
16
- import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-C4h6mGha.js";
13
+ import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
14
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-Dfl9Pitm.js";
15
+ import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BDaMl9yd.js";
16
+ import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-DjY72_uF.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-D6xxVywK.js";
18
18
  import path from "node:path";
19
19
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,5 +1,6 @@
1
- import "./schema-BkMmF552.js";
1
+ import "./schema-CsqJzkP5.js";
2
2
  import * as z from "zod";
3
+ import "drizzle-orm";
3
4
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
4
5
  import "drizzle-orm/pg-core";
5
6
  import "@earendil-works/pi-ai";
@@ -1,5 +1,5 @@
1
- import "./config-CusBFORe.js";
2
- import { p as logException } from "./logging-CGnh65_X.js";
1
+ import "./config-DBdBimZ9.js";
2
+ import { p as logException } from "./logging-DapIaJAi.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { getTableColumns, sql } from "drizzle-orm";
5
5
  import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
@@ -232,6 +232,14 @@ const juniorApiTokens = pgTable("junior_api_tokens", {
232
232
  }, (table) => [uniqueIndex("junior_api_tokens_token_hash_uidx").on(table.tokenHash), index("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)]);
233
233
  // src/db/schema/conversation-events.ts
234
234
  /**
235
+ * Match a user_message payload that a person sent as an instruction from a
236
+ * chat surface. `junior_conversation_events_user_message_time_idx` has this
237
+ * predicate, so a query with it can use the index and skip other events.
238
+ */
239
+ function isUserInstruction(payload) {
240
+ return sql`(${payload}->'provenance'->>'authority') = 'instruction' and (${payload}->'provenance'->'actor'->>'platform') in ('slack', 'local', 'web')`;
241
+ }
242
+ /**
235
243
  * Append-only canonical conversation history. `history_version` partitions
236
244
  * model-history replacements, while `(conversation_id, seq)` is the stable
237
245
  * event identity and lease-fencing tripwire.
@@ -265,6 +273,8 @@ const juniorConversationEvents = pgTable("junior_conversation_events", {
265
273
  index("junior_conversation_events_plugin_conversation_idx").on(table.conversationId, sql`(${table.payload}->>'namespace')`, sql`(${table.payload}->>'name')`, table.seq).where(sql`${table.type} = 'structured_event'`),
266
274
  index("junior_conversation_events_actor_identity_idx").on(table.actorIdentityId, table.conversationId, table.seq),
267
275
  index("junior_conversation_events_author_idx").on(table.conversationId, table.actorIdentityId, table.seq).where(sql`${table.actorIdentityId} is not null`),
276
+ index("junior_conversation_events_message_role_idx").on(table.conversationId, sql`(${table.payload}->>'role')`, table.createdAt, table.seq).where(sql`${table.type} = 'message'`),
277
+ index("junior_conversation_events_user_message_time_idx").on(table.conversationId, table.createdAt, table.seq).where(sql`${table.type} = 'user_message' and ${isUserInstruction(table.payload)}`),
268
278
  index("junior_conversation_events_message_search_idx").using("gin", sql`to_tsvector('english', ${table.payload}->>'text')`).where(sql`${table.type} = 'message'`),
269
279
  uniqueIndex("junior_conversation_events_idempotency_idx").on(table.conversationId, table.idempotencyKey)
270
280
  ]);
@@ -822,6 +832,7 @@ function createNeonJuniorSqlExecutor(args) {
822
832
  const pool = new Pool({
823
833
  connectionString: args.connectionString,
824
834
  max: 10,
835
+ idleTimeoutMillis: 6e4,
825
836
  statement_timeout: args.statementTimeoutMs
826
837
  });
827
838
  pool.on("error", (error) => {
@@ -959,4 +970,4 @@ function createJuniorSqlExecutor(args) {
959
970
  statementTimeoutMs
960
971
  });
961
972
  }
962
- export { juniorIdentities as A, juniorApiTokens as C, juniorAttachments as D, juniorCodeRepositories as E, juniorDestinations as M, juniorArtifacts as N, conversationReadColumns as O, juniorConversationEvents as S, juniorCodeChanges as T, juniorConversationParticipants as _, juniorReviewItemAssignees as a, CONVERSATION_METRICS as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationReadPositions as g, juniorAgentInvocations as h, juniorWorkspaces as i, juniorUsers as j, juniorConversations as k, juniorAutomationRuns as l, juniorAgentBindings as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, juniorConversationBindings as v, juniorConversationAnnotations as w, juniorConversationMetrics as x, juniorConversationBriefs as y };
973
+ export { juniorConversations as A, juniorConversationEvents as C, juniorCodeRepositories as D, juniorCodeChanges as E, juniorUsers as M, juniorDestinations as N, juniorAttachments as O, juniorArtifacts as P, isUserInstruction as S, juniorConversationAnnotations as T, juniorConversationParticipants as _, juniorReviewItemAssignees as a, CONVERSATION_METRICS as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationReadPositions as g, juniorAgentInvocations as h, juniorWorkspaces as i, juniorIdentities as j, conversationReadColumns as k, juniorAutomationRuns as l, juniorAgentBindings as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, juniorConversationBindings as v, juniorApiTokens as w, juniorConversationMetrics as x, juniorConversationBriefs as y };
@@ -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 { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-CGnh65_X.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-2cm6OpNg.js";
2
+ import { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-DapIaJAi.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DiDh9KE4.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
6
6
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
@@ -1,5 +1,5 @@
1
1
  import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-BRTJqumy.js";
2
- import { t as JUNIOR_VERSION } from "./version-BeHSXUK6.js";
2
+ import { t as JUNIOR_VERSION } from "./version-CzEk1KBX.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Ma as readConversationAccessFromSql, ja as canAccessConversation } from "./projection-C1MghKyI.js";
3
- import { n as botConfig } from "./config-CusBFORe.js";
4
- import { F as SYSTEM_IDENTITY_ID, S as getDb, x as getConversationStore } from "./viewer-BZ0Hp5Nb.js";
5
- import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-_PYLv4Qo.js";
6
- import { F as findChildAgentConversationId, L as PARENT_AGENT_TARGET, N as AgentMessageTargetError, a as createAgentInvocationForMessage, j as AgentMessagePausedError, s as getActiveAgentInvocationForConversation } from "./store-Dlio-o6u.js";
7
- import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-CDEMsNtv.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-QzOfDwKA.js";
9
- import { r as enqueueAgentMessageToParent } from "./result-Dd9kCuQ-.js";
10
- import { i as enqueueAgentInvocation } from "./work-BTcCIbWu.js";
2
+ import { Na as readConversationAccessFromSql, ja as canAccessConversation } from "./projection-ii_OYu6z.js";
3
+ import { n as botConfig } from "./config-DBdBimZ9.js";
4
+ import { F as SYSTEM_IDENTITY_ID, S as getDb, x as getConversationStore } from "./viewer-C2PztlYX.js";
5
+ import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-h4CDcnDV.js";
6
+ import { F as findChildAgentConversationId, L as PARENT_AGENT_TARGET, N as AgentMessageTargetError, a as createAgentInvocationForMessage, j as AgentMessagePausedError, s as getActiveAgentInvocationForConversation } from "./store-nETG4KVg.js";
7
+ import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-CVEEx_YD.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-nu3Xx08K.js";
9
+ import { r as enqueueAgentMessageToParent } from "./result-BrlvfyIj.js";
10
+ import { i as enqueueAgentInvocation } from "./work-BM_L0Pv9.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-CL2zzzE0.js";
1
+ import { i as JuniorDashboardOptions } from "./app-B-0wwAxr.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-CGnh65_X.js";
1
+ import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-DapIaJAi.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, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-B9lmh8Ml.js";
3
+ import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-CoWqScCC.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-Cp1V_XW3.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CYje8WKs.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
7
7
  import path from "node:path";
8
8
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -39,7 +39,6 @@ function globToRegex(pattern) {
39
39
  // src/build/copy-build-content.ts
40
40
  const DASHBOARD_PACKAGE_NAME = "@sentry/junior-dashboard";
41
41
  const JUNIOR_PACKAGE_NAME = "@sentry/junior";
42
- const DASHBOARD_ASSET_NAMES = ["tailwind.css"];
43
42
  /** Copy app, built-in skill, and declared plugin content into server output. */
44
43
  function copyRuntimeContent(cwd, serverRoot, packageNames) {
45
44
  copyIfExists(path.join(cwd, "app"), path.join(serverRoot, "app"));
@@ -58,12 +57,6 @@ function copyRuntimeContent(cwd, serverRoot, packageNames) {
58
57
  for (const root of packagedContent.skillRoots) copyRootIntoServerOutput(cwd, serverRoot, root);
59
58
  for (const pkg of packagedContent.packages) if (pkg.hasMigrationsDir) copyRootIntoServerOutput(cwd, serverRoot, path.join(pkg.dir, "migrations"));
60
59
  }
61
- /** Copy dashboard browser assets when core dashboard routes are enabled. */
62
- function copyDashboardAssets(cwd, serverRoot) {
63
- const packageDir = resolvePackageDir(cwd, DASHBOARD_PACKAGE_NAME);
64
- if (!packageDir) throw new Error(`createApp({ dashboard }) requires installing "${DASHBOARD_PACKAGE_NAME}"`);
65
- for (const fileName of DASHBOARD_ASSET_NAMES) copyIfExists(dashboardAssetPath(packageDir, fileName), path.join(serverRoot, "node_modules", DASHBOARD_PACKAGE_NAME, "dist", fileName));
66
- }
67
60
  /** Find the dashboard folder of content-hashed browser files that Nitro serves as static assets. */
68
61
  function resolveDashboardPublicAssetsDir(cwd) {
69
62
  const packageDir = resolvePackageDir(cwd, DASHBOARD_PACKAGE_NAME);
@@ -327,7 +320,6 @@ function juniorNitro(options = {}) {
327
320
  const pluginSet = await loadConfiguredPluginSet();
328
321
  const compiledPluginCatalogConfig = pluginCatalogConfigFromPluginSet(pluginSet);
329
322
  copyRuntimeContent(cwd, nitro.options.output.serverDir, compiledPluginCatalogConfig?.packages);
330
- if (dashboardEnabled(options.dashboard)) copyDashboardAssets(cwd, nitro.options.output.serverDir);
331
323
  copyIncludedFiles(cwd, nitro.options.output.serverDir, options.includeFiles);
332
324
  };
333
325
  nitro.hooks.hook("rollup:before", (_nitro, config) => {
@@ -1,5 +1,5 @@
1
- import { wn as createUserTokenStore } from "./projection-C1MghKyI.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DK06Jgt-.js";
1
+ import { wn as createUserTokenStore } from "./projection-ii_OYu6z.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DUrQwccr.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;