@sentry/junior 0.279.0 → 0.280.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/{actor-B4DYygOB.js → actor-6jsm_v96.js} +1 -1
  2. package/dist/{adapter-phTTgw7H.js → adapter-DVN3iwf9.js} +1 -1
  3. package/dist/{admin-PcpJDugZ.js → admin-Q_UI--9W.js} +1 -1
  4. package/dist/{agent-runner-DwvT1BY0.js → agent-runner-_PYLv4Qo.js} +26 -27
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +7 -7
  7. package/dist/api.d.ts +3 -3
  8. package/dist/api.js +181 -85
  9. package/dist/{app-DVs6noo7.d.ts → app-CL2zzzE0.d.ts} +4 -4
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +33 -34
  12. package/dist/{assistant-reply-BXfxczd7.js → assistant-reply-DbebsAxi.js} +1 -1
  13. package/dist/{automation-BehArCcq.js → automation-CPqRFjIa.js} +2 -2
  14. package/dist/{background-compaction-queue-CcbuLJrZ.js → background-compaction-queue-B9lmh8Ml.js} +3 -3
  15. package/dist/{briefs-Dd_ezwED.js → briefs-Dej7V0Bz.js} +5 -5
  16. package/dist/{catalog-runtime-BWVMeZhW.js → catalog-runtime-DpN0sWQ6.js} +1 -1
  17. package/dist/cli/chat.js +15 -15
  18. package/dist/cli/check.js +3 -3
  19. package/dist/cli/main.js +3 -3
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/snapshot-create.js +4 -4
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +3 -3
  24. package/dist/{client-Bpxe4vKa.js → client-h2A2ZPzY.js} +2 -2
  25. package/dist/{config-C_bmRhrJ.js → config-CusBFORe.js} +2 -2
  26. package/dist/{connections-B2rHe5W5.js → connections-C4h6mGha.js} +11 -11
  27. package/dist/{conversation-CIiJtx5q.js → conversation-DExTZw8B.js} +16 -6
  28. package/dist/{conversation-pending-messages-CnBvE6-6.js → conversation-pending-messages-Dgz6hrJs.js} +2 -2
  29. package/dist/{conversation-privacy-CzOfcz0U.js → conversation-privacy-2cm6OpNg.js} +1 -1
  30. package/dist/{credential-sync-Dal_unpv.js → credential-sync-DK06Jgt-.js} +16 -16
  31. package/dist/{db-CyLrV9C7.d.ts → db-Dsvk1Tp1.d.ts} +2 -2
  32. package/dist/{executor-BfYH-Wws.js → executor-Cmr0J8W3.js} +149 -6
  33. package/dist/instrumentation.js +2 -2
  34. package/dist/{logging-CkT3_Xxp.js → logging-CGnh65_X.js} +1 -1
  35. package/dist/{media-DTAA8Qs_.js → media-Dq9_svfQ.js} +1 -1
  36. package/dist/{message-Q5dkgaJ5.js → message-RpAnqHPY.js} +9 -9
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +3 -3
  39. package/dist/{oauth-callback-server-BDRaqe8O.js → oauth-callback-server-BBnhVKuX.js} +2 -2
  40. package/dist/{oauth-relay-D0G3T16m.js → oauth-relay-D6xxVywK.js} +1 -1
  41. package/dist/{projection-DWxX7pb1.js → projection-C1MghKyI.js} +148 -106
  42. package/dist/{prompt--dwus7Y-.js → prompt-BcHg-BMy.js} +2 -2
  43. package/dist/{queue-C37RbDVc.d.ts → queue-CZyYgPF0.d.ts} +1 -1
  44. package/dist/{registry-DnrdeO4s.js → registry-DR7DjX9H.js} +3 -3
  45. package/dist/{reporting-window-DgHgwQB3.js → reporting-window-B-QP9zX1.js} +28 -2
  46. package/dist/{resolve-C_QXfqD_.js → resolve-0Ful4oDv.js} +4 -4
  47. package/dist/{result-DNmOxT-N.js → result-Dd9kCuQ-.js} +11 -11
  48. package/dist/{runner-zd_noJ1l.js → runner-yiY8gUUu.js} +11 -11
  49. package/dist/{sandbox-egress-signals-DQjv-nbG.js → sandbox-egress-signals-BzQVHCMz.js} +1 -1
  50. package/dist/{schema-e90H5FIN.d.ts → schema-BkMmF552.d.ts} +28 -5
  51. package/dist/{schema-CNJNzvr8.js → schema-C5pEgfHc.js} +30 -7
  52. package/dist/{service-account-BK26XlHo.js → service-account-Cu7HFLZQ.js} +3 -3
  53. package/dist/{service-account-CCH2Hv4h.js → service-account-PIMpWZHF.js} +3 -3
  54. package/dist/{session-stop-6Tf--T7G.js → session-stop-CDEMsNtv.js} +13 -14
  55. package/dist/{skills-BNrk8gi4.js → skills-B2xIoe0f.js} +3 -3
  56. package/dist/{spawn-C75hAB9l.js → spawn-C0DySQRV.js} +2 -2
  57. package/dist/{stop-RYbf7PWi.js → stop-Dj5-nrAo.js} +255 -144
  58. package/dist/{store-CO5vGjwD.js → store-Dlio-o6u.js} +6 -6
  59. package/dist/{store-G3h2djJU.js → store-QzOfDwKA.js} +3 -3
  60. package/dist/{task-queue-DlN58XeM.js → task-queue-Cp1V_XW3.js} +4 -4
  61. package/dist/{task-runner-B-Bdm23d.js → task-runner-CQkkUj3o.js} +8 -8
  62. package/dist/{thread-state-Cj_7Slru.js → thread-state-Bn87cfzE.js} +4 -4
  63. package/dist/{turn-failure-response-CE7gaoC7.js → turn-failure-response-CQebxByj.js} +8 -8
  64. package/dist/{turn-lifecycle-7sXwXLJ6.js → turn-lifecycle-CJJsOhXB.js} +1 -1
  65. package/dist/{turn-session-routing-FBdaH1zf.js → turn-session-routing-bmG330Cf.js} +10 -11
  66. package/dist/{validation-DLWxEzWW.js → validation-D1wcf7hp.js} +1 -1
  67. package/dist/{version-DtQ8WFIZ.js → version-BeHSXUK6.js} +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/{viewer-vsM8_90o.js → viewer-BZ0Hp5Nb.js} +5 -6
  70. package/dist/{work-DsoFRO_0.js → work-BTcCIbWu.js} +12 -12
  71. package/dist/{worker-6kZEsCXs.js → worker-D3fDK6zc.js} +6 -6
  72. package/package.json +5 -5
  73. package/dist/agent-invocations-CUg_SODU.js +0 -181
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DwvT1BY0.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-_PYLv4Qo.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-HYh_JOdw.js").then((n) => n.o),
102
- import("../projection-DWxX7pb1.js").then((n) => n.kn),
103
- import("../catalog-runtime-BWVMeZhW.js").then((n) => n.t),
104
- import("../validation-DLWxEzWW.js").then((n) => n.r),
105
- import("../viewer-vsM8_90o.js").then((n) => n.v)
102
+ import("../projection-C1MghKyI.js").then((n) => n.kn),
103
+ import("../catalog-runtime-DpN0sWQ6.js").then((n) => n.t),
104
+ import("../validation-D1wcf7hp.js").then((n) => n.r),
105
+ import("../viewer-BZ0Hp5Nb.js").then((n) => n.v)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,18 +152,18 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-DWxX7pb1.js").then((n) => n.Vn);
155
+ const { setBriefsConfig } = await import("../projection-C1MghKyI.js").then((n) => n.Vn);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-zd_noJ1l.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BDRaqe8O.js");
159
- const { createLocalOAuthState } = await import("../oauth-relay-D0G3T16m.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DQjv-nbG.js");
161
- const { bindSpawnAgent } = await import("../spawn-C75hAB9l.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-Q5dkgaJ5.js").then((n) => n.n);
163
- const { createChildConversationWorker } = await import("../result-DNmOxT-N.js").then((n) => n.i);
164
- const { skipInputBeforeConversationStop } = await import("../session-stop-6Tf--T7G.js").then((n) => n.r);
157
+ const { runLocalAgentTurn } = await import("../runner-yiY8gUUu.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BBnhVKuX.js");
159
+ const { createLocalOAuthState } = await import("../oauth-relay-D6xxVywK.js").then((n) => n.t);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BzQVHCMz.js");
161
+ const { bindSpawnAgent } = await import("../spawn-C0DySQRV.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-RpAnqHPY.js").then((n) => n.n);
163
+ const { createChildConversationWorker } = await import("../result-Dd9kCuQ-.js").then((n) => n.i);
164
+ const { skipInputBeforeConversationStop } = await import("../session-stop-CDEMsNtv.js").then((n) => n.r);
165
165
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
166
- const { processConversationWork } = await import("../worker-6kZEsCXs.js").then((n) => n.n);
166
+ const { processConversationWork } = await import("../worker-D3fDK6zc.js").then((n) => n.n);
167
167
  let agentRunner;
168
168
  const localConversationWork = createLocalConversationWork(async (message) => {
169
169
  if (!agentRunner) throw new Error("Local agent runner is not ready");
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-CkT3_Xxp.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DnrdeO4s.js";
3
- import { i as parseSkillFile } from "../skills-BNrk8gi4.js";
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";
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-PcpJDugZ.js")).runAdmin(argv);
28
+ return await (await import("../admin-Q_UI--9W.js")).runAdmin(argv);
29
29
  }
30
30
  async function runServiceAccount(argv) {
31
- return await (await import("../service-account-BK26XlHo.js")).runServiceAccount(argv);
31
+ return await (await import("../service-account-Cu7HFLZQ.js")).runServiceAccount(argv);
32
32
  }
33
33
  async function runBriefs(argv) {
34
- return await (await import("../briefs-Dd_ezwED.js")).runBriefs(argv);
34
+ return await (await import("../briefs-Dej7V0Bz.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-DWxX7pb1.js";
2
- import { S as getDb } from "../viewer-vsM8_90o.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BWVMeZhW.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DLWxEzWW.js";
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";
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-DWxX7pb1.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BWVMeZhW.js";
3
- import { t as disconnectStateAdapter } from "../adapter-phTTgw7H.js";
4
- import { n as resolve } from "../resolve-C_QXfqD_.js";
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";
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-CyLrV9C7.js";
1
+ import "../db-Dsvk1Tp1.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-C_bmRhrJ.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-BfYH-Wws.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-DnrdeO4s.js";
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";
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";
@@ -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-CkT3_Xxp.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-CzOfcz0U.js";
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";
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,7 +1,7 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-Bpxe4vKa.js";
2
+ import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-h2A2ZPzY.js";
3
3
  import { AwsClient } from "aws4fetch";
4
- import { z } from "zod";
4
+ import * as z from "zod";
5
5
  // src/chat/attachments/s3.ts
6
6
  function readRequiredSetting(env, name) {
7
7
  const value = toOptionalTrimmed(env[name]);
@@ -1,15 +1,15 @@
1
- import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-DWxX7pb1.js";
2
- import { n as botConfig } from "./config-C_bmRhrJ.js";
3
- import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-vsM8_90o.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-DnrdeO4s.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.js";
6
- import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-DwvT1BY0.js";
7
- import { r as getStateAdapter } from "./adapter-phTTgw7H.js";
8
- import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-CcbuLJrZ.js";
9
- import { m as ensureConversationWake, w as requestConversationWork } from "./store-G3h2djJU.js";
10
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-FBdaH1zf.js";
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";
11
11
  import { randomBytes, randomUUID } from "node:crypto";
12
- import { z } from "zod";
12
+ import * as z from "zod";
13
13
  // src/chat/task-execution/authorized-turn.ts
14
14
  /**
15
15
  * OAuth callbacks save readiness, not agent history. The conversation worker
@@ -1,5 +1,5 @@
1
- import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-DTAA8Qs_.js";
2
- import { z } from "zod";
1
+ import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-Dq9_svfQ.js";
2
+ import * as z from "zod";
3
3
  import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
4
4
  // src/chat/briefs/schema.ts
5
5
  /**
@@ -251,7 +251,7 @@ const reviewItemChangeRecordSchema = z.object({
251
251
  *
252
252
  * `lastReadSeq` is the event sequence of the last transcript row the viewer
253
253
  * saw. The server keeps the highest value it receives, so it only moves
254
- * forward.
254
+ * forward. It is never before the viewer's own latest Message.
255
255
  */
256
256
  const conversationReadPositionSchema = z.object({ lastReadSeq: z.number().int().nonnegative() }).strict();
257
257
  // src/api/schema/child-agent-totals.ts
@@ -285,7 +285,8 @@ const conversationAttachmentParamsSchema = z.object({
285
285
  conversationId: z.string().min(1)
286
286
  }).strict();
287
287
  const conversationDetailQuerySchema = z.object({
288
- limit: z.coerce.number().int().min(1).max(1e3).default(500),
288
+ /** Omit to get the latest three Turns, up to the default page limit. */
289
+ limit: z.coerce.number().int().min(1).max(1e3).optional(),
289
290
  /** Also return `unreadPage` when the detail has an `unreadCursor`. */
290
291
  unreadPage: z.stringbool().optional(),
291
292
  /**
@@ -294,10 +295,11 @@ const conversationDetailQuerySchema = z.object({
294
295
  */
295
296
  mailbox: z.stringbool().optional()
296
297
  }).strict();
297
- const conversationEventsLimitSchema = z.coerce.number().int().min(1).max(1e3).default(500);
298
+ const conversationEventsLimitSchema = z.coerce.number().int().min(1).max(1e3).default(150);
298
299
  /**
299
300
  * Page toward the start with `before`, toward the latest with `after`, or
300
- * both ways from one event with `around`.
301
+ * both ways from one event with `around`. A link target asks for the page
302
+ * around one event by its `event` seq, or around the start of a `turn`.
301
303
  */
302
304
  const conversationEventsQuerySchema = z.union([
303
305
  z.object({
@@ -311,6 +313,14 @@ const conversationEventsQuerySchema = z.union([
311
313
  z.object({
312
314
  around: z.string().min(1),
313
315
  limit: conversationEventsLimitSchema
316
+ }).strict(),
317
+ z.object({
318
+ event: z.coerce.number().int().min(0),
319
+ limit: conversationEventsLimitSchema
320
+ }).strict(),
321
+ z.object({
322
+ turn: z.string().min(1),
323
+ limit: conversationEventsLimitSchema
314
324
  }).strict()
315
325
  ]);
316
326
  const conversationFeedQuerySchema = z.object({
@@ -1,5 +1,5 @@
1
- import { L as messageAttachmentSchema, O as reviewItemChangeRecordSchema, c as conversationDetailReportSchema, r as actorIdentitySchema } from "./conversation-CIiJtx5q.js";
2
- import { z } from "zod";
1
+ import { L as messageAttachmentSchema, O as reviewItemChangeRecordSchema, c as conversationDetailReportSchema, r as actorIdentitySchema } from "./conversation-DExTZw8B.js";
2
+ import * as z from "zod";
3
3
  // src/reporting-schema.ts
4
4
  const healthReportSchema = z.object({
5
5
  status: z.literal("ok"),
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-CkT3_Xxp.js";
1
+ import { h as logWarn } from "./logging-CGnh65_X.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,23 +1,23 @@
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-DWxX7pb1.js";
2
- import { m as escapeXml } from "./client-Bpxe4vKa.js";
3
- import { a as getRuntimeMetadata, n as botConfig } from "./config-C_bmRhrJ.js";
4
- import { H as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-CkT3_Xxp.js";
5
- import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
6
- import { B as findUserByVerifiedEmails, C as getSqlExecutor, I as resolveActorIdentityId, W as upsertLinkedIdentity, o as readIdentityById } from "./viewer-vsM8_90o.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-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";
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";
7
7
  import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DnrdeO4s.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.js";
10
- import { t as discoverSkills } from "./skills-BNrk8gi4.js";
11
- import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-DwvT1BY0.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";
12
12
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
13
- import { r as getStateAdapter } from "./adapter-phTTgw7H.js";
14
- import { _ as getMcpProviderErrorAttributes } from "./service-account-CCH2Hv4h.js";
15
- import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Cj_7Slru.js";
16
- import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-B2rHe5W5.js";
17
- import { n as relayLocalOAuthCallback } from "./oauth-relay-D0G3T16m.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";
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";
20
- import { z } from "zod";
20
+ import * as z from "zod";
21
21
  import { pluginStoredTokensSchema } from "@sentry/junior-plugin-api";
22
22
  import fs from "node:fs";
23
23
  // src/handlers/mcp-oauth-callback.ts
@@ -1,5 +1,5 @@
1
- import "./schema-e90H5FIN.js";
2
- import { z } from "zod";
1
+ import "./schema-BkMmF552.js";
2
+ import * as z from "zod";
3
3
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
4
4
  import "drizzle-orm/pg-core";
5
5
  import "@earendil-works/pi-ai";
@@ -1,15 +1,16 @@
1
- import "./config-C_bmRhrJ.js";
2
- import { p as logException } from "./logging-CkT3_Xxp.js";
3
- import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-CUg_SODU.js";
1
+ import "./config-CusBFORe.js";
2
+ import { p as logException } from "./logging-CGnh65_X.js";
4
3
  import { AsyncLocalStorage } from "node:async_hooks";
5
- import { sql } from "drizzle-orm";
6
- import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
4
+ import { getTableColumns, sql } from "drizzle-orm";
5
+ import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
7
6
  import { Pool } from "@neondatabase/serverless";
8
7
  import { drizzle } from "drizzle-orm/neon-serverless";
9
8
  import { migrate } from "drizzle-orm/neon-serverless/migrator";
10
9
  import pg from "pg";
11
10
  import { drizzle as drizzle$1 } from "drizzle-orm/node-postgres";
12
11
  import { migrate as migrate$1 } from "drizzle-orm/node-postgres/migrator";
12
+ // src/db/schema/timestamps.ts
13
+ const timestamptz = (name) => timestamp(name, { withTimezone: true });
13
14
  // src/db/schema/artifacts.ts
14
15
  /** Durable metadata for conversation-owned public artifacts. */
15
16
  const juniorArtifacts = pgTable("junior_artifacts", {
@@ -30,6 +31,114 @@ const juniorArtifacts = pgTable("junior_artifacts", {
30
31
  index("junior_artifacts_gc_idx").on(table.deleteRequestedAt, table.createdAt),
31
32
  index("junior_artifacts_conversation_idx").on(table.conversationId)
32
33
  ]);
34
+ // src/db/schema/destinations.ts
35
+ const juniorDestinations = pgTable("junior_destinations", {
36
+ id: text("id").primaryKey(),
37
+ provider: text("provider").notNull(),
38
+ providerTenantId: text("provider_tenant_id").notNull().default(""),
39
+ providerDestinationId: text("provider_destination_id").notNull(),
40
+ kind: text("kind").$type().notNull(),
41
+ parentDestinationId: text("parent_destination_id"),
42
+ displayName: text("display_name"),
43
+ visibility: text("visibility").$type().notNull().default("unknown"),
44
+ metadata: jsonb("metadata_json"),
45
+ createdAt: timestamptz("created_at").notNull(),
46
+ updatedAt: timestamptz("updated_at").notNull()
47
+ }, (table) => [uniqueIndex("junior_destinations_provider_destination_uidx").on(table.provider, table.providerTenantId, table.providerDestinationId), index("junior_destinations_provider_kind_idx").on(table.provider, table.kind)]);
48
+ const juniorUsers = pgTable("junior_users", {
49
+ id: text("id").primaryKey(),
50
+ primaryEmail: text("primary_email").notNull(),
51
+ primaryEmailNormalized: text("primary_email_normalized").notNull(),
52
+ displayName: text("display_name"),
53
+ timezone: text("timezone"),
54
+ /** Text the user saved to change how Junior replies to them. */
55
+ customization: text("customization"),
56
+ /** Junior-wide admin role. Only the `junior admin` CLI changes it. */
57
+ isAdmin: boolean("is_admin").notNull().default(false),
58
+ /** Auto-archive this user's conversations when their work is done. */
59
+ autoArchiveDefault: boolean("auto_archive_default").notNull().default(false),
60
+ /** Hours done work and the conversation stay quiet before auto-archive. */
61
+ autoArchiveGraceHours: integer("auto_archive_grace_hours").notNull().default(24),
62
+ createdAt: timestamptz("created_at").notNull(),
63
+ updatedAt: timestamptz("updated_at").notNull()
64
+ }, (table) => [uniqueIndex("junior_users_primary_email_normalized_uidx").on(table.primaryEmailNormalized)]);
65
+ // src/db/schema/identities.ts
66
+ const juniorIdentities = pgTable("junior_identities", {
67
+ id: text("id").primaryKey(),
68
+ kind: text("kind").$type().notNull(),
69
+ provider: text("provider").notNull(),
70
+ providerTenantId: text("provider_tenant_id").notNull().default(""),
71
+ providerSubjectId: text("provider_subject_id").notNull(),
72
+ displayName: text("display_name"),
73
+ handle: text("handle"),
74
+ email: text("email"),
75
+ avatarUrl: text("avatar_url"),
76
+ metadata: jsonb("metadata_json"),
77
+ createdAt: timestamptz("created_at").notNull(),
78
+ updatedAt: timestamptz("updated_at").notNull(),
79
+ userId: text("user_id").references(() => juniorUsers.id),
80
+ emailNormalized: text("email_normalized"),
81
+ emailVerified: boolean("email_verified").notNull().default(false),
82
+ signedInAt: timestamptz("signed_in_at")
83
+ }, (table) => [
84
+ uniqueIndex("junior_identities_provider_subject_uidx").on(table.provider, table.providerTenantId, table.providerSubjectId),
85
+ index("junior_identities_user_idx").on(table.userId),
86
+ index("junior_identities_verified_email_idx").on(table.emailNormalized).where(sql`${table.emailVerified} = true AND ${table.emailNormalized} IS NOT NULL`),
87
+ index("junior_identities_kind_provider_idx").on(table.kind, table.provider)
88
+ ]);
89
+ // src/db/schema/conversations.ts
90
+ const juniorConversations = pgTable("junior_conversations", {
91
+ conversationId: text("conversation_id").primaryKey(),
92
+ schemaVersion: integer("schema_version").notNull().default(1),
93
+ source: text("source").$type(),
94
+ /** Structured session Source locator; set-once on the conversation root. */
95
+ sessionSource: jsonb("source_json").$type(),
96
+ /** Complete Location associated with this Conversation. */
97
+ location: jsonb("location_json").$type(),
98
+ destinationId: text("destination_id").references(() => juniorDestinations.id),
99
+ destination: jsonb("destination_json").$type(),
100
+ actorIdentityId: text("actor_identity_id").references(() => juniorIdentities.id),
101
+ creatorIdentityId: text("creator_identity_id").references(() => juniorIdentities.id),
102
+ credentialSubjectIdentityId: text("credential_subject_identity_id").references(() => juniorIdentities.id),
103
+ actor: jsonb("actor_json").$type(),
104
+ channelName: text("channel_name"),
105
+ title: text("title"),
106
+ createdAt: timestamptz("created_at").notNull(),
107
+ lastActivityAt: timestamptz("last_activity_at").notNull(),
108
+ updatedAt: timestamptz("updated_at").notNull(),
109
+ executionUpdatedAt: timestamptz("execution_updated_at"),
110
+ executionStatus: text("execution_status").$type().notNull(),
111
+ runId: text("run_id"),
112
+ lastCheckpointAt: timestamptz("last_checkpoint_at"),
113
+ lastEnqueuedAt: timestamptz("last_enqueued_at"),
114
+ parentConversationId: text("parent_conversation_id").references(() => juniorConversations.conversationId),
115
+ forkedFromConversationId: text("forked_from_conversation_id").references(() => juniorConversations.conversationId, { onDelete: "set null" }),
116
+ quickQuestionAt: timestamptz("quick_question_at"),
117
+ rootConversationId: text("root_conversation_id").references(() => juniorConversations.conversationId),
118
+ transcriptPurgedAt: timestamptz("transcript_purged_at"),
119
+ /** Latest session stop. Automated input received before it is dropped. */
120
+ stoppedAt: timestamptz("stopped_at"),
121
+ durationMs: integer("duration_ms").notNull().default(0),
122
+ usage: jsonb("usage_json").$type(),
123
+ executionDurationMs: integer("execution_duration_ms").notNull().default(0),
124
+ executionUsage: jsonb("execution_usage_json").$type(),
125
+ metricRunId: text("metric_run_id"),
126
+ detailVersion: integer("detail_version").notNull().default(0),
127
+ legacyArchivedAt: timestamptz("archived_at")
128
+ }, (table) => [
129
+ index("junior_conversations_last_activity_idx").on(table.lastActivityAt.desc(), table.conversationId),
130
+ index("junior_conversations_active_idx").using("btree", sql`coalesce(${table.executionUpdatedAt}, ${table.updatedAt})`, table.conversationId).where(sql`${table.executionStatus} <> 'idle'`),
131
+ index("junior_conversations_destination_activity_idx").on(table.destinationId, table.lastActivityAt.desc()),
132
+ index("junior_conversations_actor_activity_idx").on(table.actorIdentityId, table.lastActivityAt.desc()),
133
+ index("junior_conversations_parent_idx").on(table.parentConversationId),
134
+ index("junior_conversations_forked_from_idx").on(table.forkedFromConversationId),
135
+ index("junior_conversations_root_idx").on(table.rootConversationId)
136
+ ]);
137
+ /** Select runtime conversation fields without reading the legacy archive column. */
138
+ function conversationReadColumns() {
139
+ const { legacyArchivedAt, ...columns } = getTableColumns(juniorConversations);
140
+ return columns;
141
+ }
33
142
  // src/db/schema/attachments.ts
34
143
  /** Durable metadata for files owned by one conversation. */
35
144
  const juniorAttachments = pgTable("junior_attachments", {
@@ -282,6 +391,40 @@ const juniorConversationReadPositions = pgTable("junior_conversation_read_positi
282
391
  name: "junior_conversation_read_positions_user_conversation_pk",
283
392
  columns: [table.userId, table.conversationId]
284
393
  })]);
394
+ // src/db/schema/agent-invocations.ts
395
+ const juniorAgentBindings = pgTable("junior_agent_bindings", {
396
+ parentConversationId: text("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
397
+ name: text("name").notNull(),
398
+ childConversationId: text("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
399
+ }, (table) => [primaryKey({ columns: [table.parentConversationId, table.name] }), uniqueIndex("junior_agent_bindings_child_idx").on(table.childConversationId)]);
400
+ const juniorAgentInvocations = pgTable("junior_agent_invocations", {
401
+ invocationId: text("invocation_id").primaryKey(),
402
+ parentConversationId: text("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
403
+ childConversationId: text("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
404
+ agentName: text("agent_name"),
405
+ input: text("input").notNull(),
406
+ title: text("title"),
407
+ actor: jsonb("actor_json").$type().notNull(),
408
+ credentialContext: jsonb("credential_context_json").$type(),
409
+ source: jsonb("source_json").$type().notNull(),
410
+ destination: jsonb("destination_json").$type().notNull(),
411
+ destinationVisibility: text("destination_visibility").$type(),
412
+ agentType: text("agent_type").$type(),
413
+ reasoningLevel: text("reasoning_level").$type(),
414
+ parentToolCallId: text("parent_tool_call_id"),
415
+ status: text("status").$type().notNull(),
416
+ mailboxStatus: text("mailbox_status").$type().notNull(),
417
+ parentMailboxStatus: text("parent_mailbox_status").$type(),
418
+ result: text("result"),
419
+ errorMessage: text("error_message"),
420
+ createdAt: timestamptz("created_at").notNull(),
421
+ updatedAt: timestamptz("updated_at").notNull(),
422
+ terminalAt: timestamptz("terminal_at")
423
+ }, (table) => [
424
+ index("junior_agent_invocations_child_idx").on(table.childConversationId),
425
+ index("junior_agent_invocations_mailbox_idx").on(table.mailboxStatus, table.createdAt),
426
+ index("junior_agent_invocations_parent_mailbox_idx").on(table.parentMailboxStatus, table.terminalAt)
427
+ ]);
285
428
  // src/db/schema/location-configurations.ts
286
429
  /** Durable user configuration entries scoped to provider Locations. */
287
430
  const juniorLocationConfigurations = pgTable("junior_location_configurations", {
@@ -816,4 +959,4 @@ function createJuniorSqlExecutor(args) {
816
959
  statementTimeoutMs
817
960
  });
818
961
  }
819
- export { juniorCodeChanges as C, juniorArtifacts as E, juniorConversationAnnotations as S, juniorAttachments as T, juniorConversationBriefs as _, juniorReviewItemAssignees as a, juniorConversationEvents as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationBindings as g, juniorConversationParticipants as h, juniorWorkspaces as i, juniorAutomationRuns as l, juniorConversationReadPositions as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, CONVERSATION_METRICS as v, juniorCodeRepositories as w, juniorApiTokens as x, juniorConversationMetrics as y };
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 };
@@ -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-CkT3_Xxp.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-CzOfcz0U.js";
2
+ import { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-CGnh65_X.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-2cm6OpNg.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-DtQ8WFIZ.js";
2
+ import { t as JUNIOR_VERSION } from "./version-BeHSXUK6.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,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod";
2
2
  import { actorSchema } from "@sentry/junior-plugin-api";
3
3
  // src/usage-schema.ts
4
4
  const usageCostSchema = z.object({
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Ma as readConversationAccessFromSql, ja as canAccessConversation } from "./projection-DWxX7pb1.js";
3
- import { n as botConfig } from "./config-C_bmRhrJ.js";
4
- import { F as SYSTEM_IDENTITY_ID, S as getDb, x as getConversationStore } from "./viewer-vsM8_90o.js";
5
- import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-DwvT1BY0.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-CO5vGjwD.js";
7
- import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-6Tf--T7G.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-G3h2djJU.js";
9
- import { r as enqueueAgentMessageToParent } from "./result-DNmOxT-N.js";
10
- import { i as enqueueAgentInvocation } from "./work-DsoFRO_0.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";
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-DVs6noo7.js";
1
+ import { i as JuniorDashboardOptions } from "./app-CL2zzzE0.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-CkT3_Xxp.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-CGnh65_X.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-CcbuLJrZ.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";
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-DlN58XeM.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-Cp1V_XW3.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";
@@ -1,5 +1,5 @@
1
- import { wn as createUserTokenStore } from "./projection-DWxX7pb1.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-Dal_unpv.js";
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";
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,6 +1,6 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
2
  import { randomBytes } from "node:crypto";
3
- import { z } from "zod";
3
+ import * as z from "zod";
4
4
  import { SignJWT, jwtVerify } from "jose";
5
5
  // src/chat/local/oauth-relay.ts
6
6
  var oauth_relay_exports = /* @__PURE__ */ __exportAll({