@sentry/junior 0.208.0 → 0.210.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 (54) hide show
  1. package/dist/{agent-BfxfHsf1.js → agent-DKboUiLS.js} +34 -25
  2. package/dist/{agent-hooks-CuGjLjmR.js → agent-hooks-4I-C-LhZ.js} +8 -8
  3. package/dist/{agent-runner-Dz1PMKP0.js → agent-runner-DgqYKBZm.js} +5 -5
  4. package/dist/api.js +15 -15
  5. package/dist/{app-DfNrn_gS.d.ts → app-gyu3D9Gn.d.ts} +2 -0
  6. package/dist/app.d.ts +1 -1
  7. package/dist/app.js +64 -31
  8. package/dist/{auth-pause-state-Bjoh8wCy.js → auth-pause-state-3wQ2cGwW.js} +6 -6
  9. package/dist/{briefs-q_onrGmf.js → briefs-DsJVC55W.js} +3 -3
  10. package/dist/{catalog-runtime-D8YUMNhb.js → catalog-runtime-D11j6L4T.js} +1 -1
  11. package/dist/{checkpoint-FKMcINix.js → checkpoint-CHdApjyQ.js} +6 -6
  12. package/dist/cli/chat.js +13 -13
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +2 -2
  15. package/dist/cli/plugins.js +3 -3
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-bRyPqwAV.js → client-CuyBdpWp.js} +54 -6
  19. package/dist/{config-EtF2uEaW.js → config-DoMOvr4Z.js} +3 -3
  20. package/dist/{conversation-privacy-whGaV2TG.js → conversation-privacy-Dxiz_d9l.js} +1 -1
  21. package/dist/{credential-sync-DM-EE1ey.js → credential-sync-6WRLsSQy.js} +32 -23
  22. package/dist/{execution-stats-C-f8zwMU.js → execution-stats-D7Q3Mo8Y.js} +4 -4
  23. package/dist/{executor-BW5qp0jC.js → executor-BR-u7Eiz.js} +277 -21
  24. package/dist/instrumentation.js +3 -3
  25. package/dist/{job-queue-BIHNIEIX.js → job-queue-FcjDDzOt.js} +1 -1
  26. package/dist/{logging-sNS84Yuu.js → logging-GTB-Z6hs.js} +2 -2
  27. package/dist/nitro.d.ts +1 -1
  28. package/dist/nitro.js +3 -3
  29. package/dist/{oauth-callback-server-Co6D_yXP.js → oauth-callback-server-CuLHQpGM.js} +2 -2
  30. package/dist/{pending-auth-CRJCt9Ux.js → pending-auth-DZKNc2-v.js} +2 -2
  31. package/dist/{profile-BfLMVhWo.js → profile-DEoalaoa.js} +4 -4
  32. package/dist/{prompt-x-0ZtTyb.js → prompt-Calvr7V2.js} +3 -3
  33. package/dist/{registry-Cyww_jnC.js → registry-wMxSBovn.js} +1 -1
  34. package/dist/{resolve-BApIFQXX.js → resolve-C0ds-bvC.js} +2 -2
  35. package/dist/{runner-C9okx4GL.js → runner-BoK9ACgc.js} +9 -9
  36. package/dist/{sandbox-egress-signals-BHfx0esj.js → sandbox-egress-signals-CnzazNxY.js} +1 -1
  37. package/dist/{sentry-CD3SdJl-.js → sentry-CgWZM_kV.js} +3 -2
  38. package/dist/{skills-DhL_wXEp.js → skills-CbGNcUOh.js} +2 -2
  39. package/dist/{spawn-msnzfE8_.js → spawn-Dm3kRFmC.js} +2 -2
  40. package/dist/{stats-Cq5w_Awk.js → stats-DROv84Z6.js} +46 -34
  41. package/dist/{task-queue-JfmWmpjS.js → task-queue-BUAVtd2X.js} +3 -3
  42. package/dist/{task-runner-Cm0gXoLH.js → task-runner-ByBGnm9Q.js} +7 -7
  43. package/dist/{thread-state-lw2QwQ-y.js → thread-state-BTFCRXKk.js} +5 -5
  44. package/dist/{turn-execution-C7K6lQp1.js → turn-execution-BXKiBFtp.js} +3 -3
  45. package/dist/{turn-lifecycle-DVlJLwB0.js → turn-lifecycle-Bu7HgoE6.js} +1 -1
  46. package/dist/{usage-BMuAlKIW.js → usage-DJ2WBjfc.js} +2 -2
  47. package/dist/{validation-BI-r3iQA.js → validation-ZZEOV02h.js} +1 -1
  48. package/dist/{version-s6smK6lP.js → version-Cf7Fwr1w.js} +1 -1
  49. package/dist/version.js +1 -1
  50. package/dist/{web-authorization-C9MxPvXX.js → web-authorization-D74eDSAs.js} +1 -1
  51. package/dist/{web-input-CwVlaLd0.js → web-input-c6W_exA0.js} +4 -4
  52. package/dist/{work-BK0W1QAt.js → work-zBMuzR-T.js} +9 -9
  53. package/dist/{worker-D-WWKHQD.js → worker-C-9UqHKm.js} +19 -11
  54. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- import { a as getChatConfig } from "./config-EtF2uEaW.js";
1
+ import { a as getChatConfig } from "./config-DoMOvr4Z.js";
2
2
  import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { z } from "zod";
@@ -1,5 +1,5 @@
1
- import { 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, v as withScope } from "./sentry-CD3SdJl-.js";
2
- import { t as JUNIOR_VERSION } from "./version-s6smK6lP.js";
1
+ import { 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, y as withScope } from "./sentry-CgWZM_kV.js";
2
+ import { t as JUNIOR_VERSION } from "./version-Cf7Fwr1w.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";
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as JuniorDashboardOptions } from "./app-DfNrn_gS.js";
1
+ import { n as JuniorDashboardOptions } from "./app-gyu3D9Gn.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-BI9A1vKA.js";
3
3
  //#region src/nitro.d.ts
4
4
  export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
package/dist/nitro.js CHANGED
@@ -1,9 +1,9 @@
1
- import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-sNS84Yuu.js";
1
+ import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-GTB-Z6hs.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.js";
3
3
  import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-DIkVcfK4.js";
4
- import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-BIHNIEIX.js";
4
+ import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-FcjDDzOt.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
6
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-JfmWmpjS.js";
6
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BUAVtd2X.js";
7
7
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.js";
8
8
  import path from "node:path";
9
9
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { Y as createUserTokenStore } from "./agent-BfxfHsf1.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DM-EE1ey.js";
1
+ import { X as createUserTokenStore } from "./agent-DKboUiLS.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-6WRLsSQy.js";
3
3
  import { createServer } from "node:http";
4
4
  //#region src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,5 +1,5 @@
1
- import { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-FKMcINix.js";
2
- import { Kt as buildDeterministicTurnId } from "./stats-Cq5w_Awk.js";
1
+ import { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-CHdApjyQ.js";
2
+ import { qt as buildDeterministicTurnId } from "./stats-DROv84Z6.js";
3
3
  //#region src/chat/runtime/turn.ts
4
4
  /** Classified Slack turn failure carrying the owning Sentry capture outward. */
5
5
  var ConversationTurnBoundaryError = class extends Error {
@@ -1,7 +1,7 @@
1
- import { w as toOptionalTrimmed } from "./client-bRyPqwAV.js";
2
- import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-sNS84Yuu.js";
3
- import { a as getChatConfig } from "./config-EtF2uEaW.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-D8YUMNhb.js";
1
+ import { w as toOptionalTrimmed } from "./client-CuyBdpWp.js";
2
+ import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-GTB-Z6hs.js";
3
+ import { a as getChatConfig } from "./config-DoMOvr4Z.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D11j6L4T.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
7
7
  import { createRedisState } from "@chat-adapter/state-redis";
@@ -34,7 +34,7 @@ const modelBriefSchema = z.object({
34
34
  }).strict(),
35
35
  decisions: z.array(z.object({
36
36
  text: z.string().trim().min(1),
37
- by: z.string().trim().min(1).optional(),
37
+ by: z.string().trim().min(1).nullable(),
38
38
  kind: z.enum([
39
39
  "stated",
40
40
  "confirmed",
@@ -43,7 +43,7 @@ const modelBriefSchema = z.object({
43
43
  }).strict()),
44
44
  openDecisions: z.array(z.object({
45
45
  text: z.string().trim().min(1),
46
- owner: z.string().trim().min(1).optional()
46
+ owner: z.string().trim().min(1).nullable()
47
47
  }).strict()),
48
48
  facts: z.array(z.string().trim().min(1)),
49
49
  keywords: z.array(z.string().trim().min(1)),
@@ -542,7 +542,7 @@ Rules:
542
542
  - Facts are durable one-line facts that help after the transcript expires. Prefer ids, versions, owners, constraints, and numbers. Do not list fields, recap the transcript, or include transient progress.
543
543
  - Ignore Junior runtime mechanics, context tags, and markers such as [[NO_REPLY]].
544
544
  - Never say that a code change was merged, closed, deployed, or released unless a supplied code change or resource has that status. Say opened for an open code change.
545
- - Attribute by or owner only to a participant in the supplied record. Junior is also valid.
545
+ - Attribute by or owner only to a participant in the supplied record. Junior is also valid. Set by or owner to null when no supported attribution exists.
546
546
  - Choose the outcome status that best describes where the Conversation ended.
547
547
  - Follow the supplied size class caps. Keep the first items that matter most.
548
548
  - Cite a URL only when its exact full string occurs in an entry, evidence, or the previous Brief. Return cited URLs in urls. Core adds code changes and resources separately.
@@ -1,4 +1,4 @@
1
- import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-sNS84Yuu.js";
1
+ import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-GTB-Z6hs.js";
2
2
  import { i as credentialUserSubjectId } from "./context-Bplcgypl.js";
3
3
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-7a9YqLhE.js";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
- import { C as withSpan, _ as setSpanAttributes } from "./logging-sNS84Yuu.js";
2
- import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-BfLMVhWo.js";
1
+ import { C as withSpan, _ as setSpanAttributes } from "./logging-GTB-Z6hs.js";
2
+ import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-DEoalaoa.js";
3
3
  import { z } from "zod";
4
4
  import { FileSystem, Sandbox } from "@vercel/sandbox";
5
5
  //#region src/chat/sandbox/resources.ts
@@ -1,13 +1,13 @@
1
- import { p as authorizationId } from "./agent-BfxfHsf1.js";
2
- import { S as withLogContext, u as logException, y as setTags } from "./logging-sNS84Yuu.js";
1
+ import { p as authorizationId } from "./agent-DKboUiLS.js";
2
+ import { S as withLogContext, u as logException, y as setTags } from "./logging-GTB-Z6hs.js";
3
3
  import { t as credentialContextForActor } from "./context-Bplcgypl.js";
4
- import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-CuGjLjmR.js";
5
- import { $ as persistConversationMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, it as buildConversationContext, jt as stripRuntimeTurnContext, lt as markConversationMessage, pt as upsertConversationMessage, r as saveTurnCheckpoint, ut as normalizeConversationText } from "./checkpoint-FKMcINix.js";
6
- import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CRJCt9Ux.js";
7
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-Cm0gXoLH.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DVlJLwB0.js";
9
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-lw2QwQ-y.js";
10
- import { d as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-Bjoh8wCy.js";
4
+ import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-4I-C-LhZ.js";
5
+ import { $ as persistConversationMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, it as buildConversationContext, jt as stripRuntimeTurnContext, lt as markConversationMessage, pt as upsertConversationMessage, r as saveTurnCheckpoint, ut as normalizeConversationText } from "./checkpoint-CHdApjyQ.js";
6
+ import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-DZKNc2-v.js";
7
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-ByBGnm9Q.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bu7HgoE6.js";
9
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BTFCRXKk.js";
10
+ import { d as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-3wQ2cGwW.js";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
13
13
  //#region src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { J as sandboxEgressSignalsResponseSchema } from "./agent-BfxfHsf1.js";
1
+ import { Y as sandboxEgressSignalsResponseSchema } from "./agent-DKboUiLS.js";
2
2
  //#region src/chat/local/sandbox-egress-signals.ts
3
3
  const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
4
4
  const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, vercelAIIntegration, withActiveSpan, withScope, withStreamedSpan } from "@sentry/node";
2
+ import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, startSpanManual, vercelAIIntegration, withActiveSpan, withScope, withStreamedSpan } from "@sentry/node";
3
3
  //#region src/chat/sentry.ts
4
4
  var sentry_exports = /* @__PURE__ */ __exportAll({
5
5
  captureException: () => captureException,
@@ -17,10 +17,11 @@ var sentry_exports = /* @__PURE__ */ __exportAll({
17
17
  spanToJSON: () => spanToJSON,
18
18
  startInactiveSpan: () => startInactiveSpan,
19
19
  startSpan: () => startSpan,
20
+ startSpanManual: () => startSpanManual,
20
21
  vercelAIIntegration: () => vercelAIIntegration,
21
22
  withActiveSpan: () => withActiveSpan,
22
23
  withScope: () => withScope,
23
24
  withStreamedSpan: () => withStreamedSpan
24
25
  });
25
26
  //#endregion
26
- export { withActiveSpan as _, getClient as a, init as c, setTag as d, setUser as f, vercelAIIntegration as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u, withScope as v, withStreamedSpan as y };
27
+ export { vercelAIIntegration as _, getClient as a, withStreamedSpan as b, init as c, setTag as d, setUser as f, startSpanManual as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u, withActiveSpan as v, withScope as y };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { f as logWarn } from "./logging-sNS84Yuu.js";
2
+ import { f as logWarn } from "./logging-GTB-Z6hs.js";
3
3
  import { s as skillRoots } from "./package-discovery-7a9YqLhE.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-D8YUMNhb.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D11j6L4T.js";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
7
7
  import fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-Dz1PMKP0.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-BK0W1QAt.js";
2
+ import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-DgqYKBZm.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-zBMuzR-T.js";
4
4
  //#region src/chat/agent-invocations/spawn.ts
5
5
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
6
6
  /** Bind a Run's Actor and credentials to new Agent invocations. */
@@ -1,11 +1,11 @@
1
- import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-sNS84Yuu.js";
2
- import { a as getChatConfig } from "./config-EtF2uEaW.js";
1
+ import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-GTB-Z6hs.js";
2
+ import { a as getChatConfig } from "./config-DoMOvr4Z.js";
3
3
  import { _ as parseSlackMessageTs, d as parseStoredSlackActor, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
4
- import { Gt as getDb, J as withSlackRetries, U as getSlackClient, Wt as getConversationStore, an as parseDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, sn as sameDestination, u as getPlugins } from "./agent-hooks-CuGjLjmR.js";
4
+ import { Gt as getDb, J as withSlackRetries, U as getSlackClient, Wt as getConversationStore, an as parseDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, sn as sameDestination, u as getPlugins } from "./agent-hooks-4I-C-LhZ.js";
5
5
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
6
- import { S as juniorAttachments, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorConversations } from "./executor-BW5qp0jC.js";
7
- import { o as ToolInputError } from "./usage-BMuAlKIW.js";
8
- import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-BfLMVhWo.js";
6
+ import { S as juniorAttachments, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorConversations } from "./executor-BR-u7Eiz.js";
7
+ import { o as ToolInputError } from "./usage-DJ2WBjfc.js";
8
+ import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-DEoalaoa.js";
9
9
  import "./vercel-queue-DIkVcfK4.js";
10
10
  import { z } from "zod";
11
11
  import { createHash, randomUUID } from "node:crypto";
@@ -138,6 +138,9 @@ const storedInboundMessageSchema = z.object({
138
138
  function conversationKey(conversationId) {
139
139
  return `${CONVERSATION_PREFIX}:${conversationId}`;
140
140
  }
141
+ function conversationStopKey(conversationId) {
142
+ return `${CONVERSATION_PREFIX}:stop:${conversationId}`;
143
+ }
141
144
  function indexLockKey(indexKey) {
142
145
  return `${indexKey}:lock`;
143
146
  }
@@ -249,8 +252,6 @@ function normalizeExecution(conversationId, value) {
249
252
  const inboundMessageIds = Array.isArray(value.inboundMessageIds) ? uniqueStrings(value.inboundMessageIds.map((id) => typeof id === "string" ? id : void 0).filter((id) => Boolean(id))) : [];
250
253
  const lease = normalizeLease(value.lease);
251
254
  const runId = toOptionalString(value.runId);
252
- const normalizedStop = normalizeStop(value.stop);
253
- const stop = normalizedStop?.runId === runId ? normalizedStop : void 0;
254
255
  return {
255
256
  status: status === "idle" && lease ? "running" : status === "idle" && pendingMessages.length > 0 ? "pending" : status,
256
257
  inboundMessageIds: uniqueStrings([...inboundMessageIds, ...pendingMessages.map((message) => message.inboundMessageId)]),
@@ -262,7 +263,6 @@ function normalizeExecution(conversationId, value) {
262
263
  lastProgressAtMs: toOptionalNumber(value.lastProgressAtMs),
263
264
  retryCount: toOptionalNumber(value.retryCount),
264
265
  runId,
265
- stop,
266
266
  updatedAtMs: toOptionalNumber(value.updatedAtMs)
267
267
  };
268
268
  }
@@ -577,7 +577,7 @@ async function writeConversation(state, lock, conversation) {
577
577
  ...conversation,
578
578
  execution
579
579
  };
580
- if (!await state.extendLock(lock, CONVERSATION_MUTATION_LOCK_TTL_MS)) throw new ConversationMutationFencedError(next.conversationId);
580
+ await fenceConversationMutation(state, lock, next.conversationId);
581
581
  const hasSlackDestination = next.destination?.platform === "slack";
582
582
  const stored = {
583
583
  ...next,
@@ -870,6 +870,16 @@ async function ackMessages$1(args) {
870
870
  function isHumanFacingMessage(message) {
871
871
  return message.source === "web" || message.source === "slack";
872
872
  }
873
+ async function readConversationStop(state, conversationId) {
874
+ return normalizeStop(await state.get(conversationStopKey(conversationId)));
875
+ }
876
+ async function fenceConversationMutation(state, lock, conversationId) {
877
+ if (!await state.extendLock(lock, CONVERSATION_MUTATION_LOCK_TTL_MS)) throw new ConversationMutationFencedError(conversationId);
878
+ }
879
+ /** Return whether one Conversation run has a durable stop request. */
880
+ async function hasConversationStop(args) {
881
+ return (await readConversationStop(await getConnectedState(args.state), args.conversationId))?.runId === args.runId;
882
+ }
873
883
  /** Persist a stop request for the current run without process affinity. */
874
884
  async function stopConversationWork$1(args) {
875
885
  const nowMs = args.nowMs ?? now$1();
@@ -878,14 +888,15 @@ async function stopConversationWork$1(args) {
878
888
  if (!current || !hasRunnableWork(current)) return { status: "no_work" };
879
889
  const runId = current.execution.runId ?? randomUUID();
880
890
  const inboundMessageIds = current.execution.pendingMessages.filter(isHumanFacingMessage).map((message) => message.inboundMessageId);
881
- await writeConversation(state, lock, withExecutionUpdate(current, {
891
+ if (current.execution.runId === void 0) await writeConversation(state, lock, withExecutionUpdate(current, {
882
892
  ...current.execution,
883
- runId,
884
- stop: {
885
- inboundMessageIds,
886
- runId
887
- }
893
+ runId
888
894
  }, nowMs));
895
+ await fenceConversationMutation(state, lock, args.conversationId);
896
+ await state.set(conversationStopKey(args.conversationId), {
897
+ inboundMessageIds,
898
+ runId
899
+ }, JUNIOR_THREAD_STATE_TTL_MS);
889
900
  return {
890
901
  runId,
891
902
  status: "requested"
@@ -901,7 +912,7 @@ async function completeConversationStop$1(args) {
901
912
  status: "lost_lease",
902
913
  removedInboundMessageIds: []
903
914
  };
904
- const stop = current.execution.stop;
915
+ const stop = await readConversationStop(state, args.conversationId);
905
916
  if (!stop || stop.runId !== args.runId) return {
906
917
  status: "none",
907
918
  removedInboundMessageIds: []
@@ -916,9 +927,10 @@ async function completeConversationStop$1(args) {
916
927
  await writeConversation(state, lock, withExecutionUpdate(current, {
917
928
  ...current.execution,
918
929
  lastEnqueuedAtMs: pendingMessages.length === 0 ? void 0 : current.execution.lastEnqueuedAtMs,
919
- pendingMessages,
920
- stop: void 0
930
+ pendingMessages
921
931
  }, nowMs));
932
+ await fenceConversationMutation(state, lock, args.conversationId);
933
+ await state.delete(conversationStopKey(args.conversationId));
922
934
  return {
923
935
  status: "cleared",
924
936
  removedInboundMessageIds
@@ -951,8 +963,7 @@ async function cancelHumanFacingPendingMessages$1(args) {
951
963
  pendingMessages,
952
964
  retryCount: becomesIdle ? 0 : current.execution.retryCount,
953
965
  runId: becomesIdle ? void 0 : current.execution.runId,
954
- status: becomesIdle ? "idle" : current.execution.status,
955
- stop: becomesIdle ? void 0 : current.execution.stop
966
+ status: becomesIdle ? "idle" : current.execution.status
956
967
  }, nowMs));
957
968
  return { cancelledInboundMessageIds };
958
969
  });
@@ -1017,8 +1028,7 @@ async function recordConversationRetry$1(args) {
1017
1028
  retryCount: count,
1018
1029
  pendingMessages: stopped ? [] : current.execution.pendingMessages,
1019
1030
  runId: stopped ? void 0 : current.execution.runId,
1020
- status: stopped ? "failed" : "paused",
1021
- stop: stopped ? void 0 : current.execution.stop
1031
+ status: stopped ? "failed" : "paused"
1022
1032
  }, nowMs));
1023
1033
  return stopped ? "stopped" : "recorded";
1024
1034
  });
@@ -1030,7 +1040,8 @@ async function completeConversationWork$1(args) {
1030
1040
  const current = await readConversation(state, args.conversationId);
1031
1041
  if (!current || current.execution.lease?.token !== args.leaseToken) return "lost_lease";
1032
1042
  const hasPending = pendingMessages(current).length > 0;
1033
- const needsRun = current.execution.status === "paused" || args.resumeIfStopped === true && current.execution.stop !== void 0;
1043
+ const stopped = args.resumeIfStopped === true && (await readConversationStop(state, args.conversationId))?.runId === current.execution.runId;
1044
+ const needsRun = current.execution.status === "paused" || stopped;
1034
1045
  const runnable = needsRun || hasPending;
1035
1046
  await writeConversation(state, lock, withExecutionUpdate(current, {
1036
1047
  ...current.execution,
@@ -1038,8 +1049,7 @@ async function completeConversationWork$1(args) {
1038
1049
  status: needsRun ? "paused" : hasPending ? "pending" : "idle",
1039
1050
  lastProgressAtMs: args.madeProgress === false ? current.execution.lastProgressAtMs : nowMs,
1040
1051
  retryCount: runnable || args.madeProgress === false ? current.execution.retryCount : 0,
1041
- runId: runnable ? current.execution.runId : void 0,
1042
- stop: runnable ? current.execution.stop : void 0
1052
+ runId: runnable ? current.execution.runId : void 0
1043
1053
  }, nowMs));
1044
1054
  return runnable ? "pending" : "completed";
1045
1055
  });
@@ -1116,8 +1126,7 @@ async function deadLetterAttempt$1(args) {
1116
1126
  ...current.execution,
1117
1127
  lease: void 0,
1118
1128
  status: runnable ? "pending" : "failed",
1119
- runId: runnable ? current.execution.runId : void 0,
1120
- stop: runnable ? current.execution.stop : void 0
1129
+ runId: runnable ? current.execution.runId : void 0
1121
1130
  }, nowMs));
1122
1131
  return runnable ? "pending" : "failed";
1123
1132
  });
@@ -1137,8 +1146,7 @@ async function clearExpiredConversationLease$1(args) {
1137
1146
  retryCount,
1138
1147
  pendingMessages: stopped ? [] : current.execution.pendingMessages,
1139
1148
  runId: stopped ? void 0 : current.execution.runId,
1140
- status: stopped ? "failed" : "paused",
1141
- stop: stopped ? void 0 : current.execution.stop
1149
+ status: stopped ? "failed" : "paused"
1142
1150
  }, nowMs));
1143
1151
  return stopped ? "stopped" : "requeued";
1144
1152
  });
@@ -1226,8 +1234,9 @@ function hasRunnableConversationWork(conversation) {
1226
1234
  /**
1227
1235
  * Ensure runnable conversation work has one accepted queue wake-up nudge.
1228
1236
  *
1229
- * Ordinary wakes coalesce on a recent accepted marker. Replacement is only for
1230
- * consumed or known-stale deliveries where another queue nudge must exist.
1237
+ * Ordinary wakes coalesce on a recent accepted marker. A caller can ignore the
1238
+ * marker without replacing an active lease. Replacement is only for consumed
1239
+ * or known-stale deliveries where another queue nudge must exist.
1231
1240
  */
1232
1241
  async function ensureConversationWake(args) {
1233
1242
  const nowMs = args.nowMs ?? now();
@@ -1237,7 +1246,7 @@ async function ensureConversationWake(args) {
1237
1246
  });
1238
1247
  if (!conversation || !hasRunnableConversationWork(conversation)) return { status: "no_work" };
1239
1248
  if (args.replaceExistingWake !== true && conversation.execution.lease && conversation.execution.lease.expiresAtMs > nowMs) return { status: "lease_active" };
1240
- if (args.replaceExistingWake !== true && hasRecentEnqueueMarker(conversation, nowMs)) return { status: "already_enqueued" };
1249
+ if (args.ignoreEnqueueMarker !== true && args.replaceExistingWake !== true && hasRecentEnqueueMarker(conversation, nowMs)) return { status: "already_enqueued" };
1241
1250
  const queueResult = await args.queue.send({
1242
1251
  schemaVersion: 2,
1243
1252
  conversationId: args.conversationId
@@ -1288,9 +1297,12 @@ async function enqueueAfterAppend(args) {
1288
1297
  const wake = await ensureConversationWake({
1289
1298
  conversationId: args.message.conversationId,
1290
1299
  conversationStore: args.conversationStore,
1300
+ delayMs: args.queueDelayMs,
1291
1301
  idempotencyKey,
1302
+ ignoreEnqueueMarker: args.message.source === "event" ? void 0 : true,
1292
1303
  nowMs,
1293
1304
  queue: args.queue,
1305
+ replaceExistingWake: args.replaceExistingWake,
1294
1306
  state: args.state
1295
1307
  });
1296
1308
  if (wake.status !== "enqueued") await recordExecutionMetadata({
@@ -2669,4 +2681,4 @@ async function readStats(start, end) {
2669
2681
  return await getDb().select().from(juniorStats).where(and(gte(juniorStats.date, start), lte(juniorStats.date, end))).orderBy(asc(juniorStats.date), asc(juniorStats.namespace), asc(juniorStats.metric), asc(juniorStats.name));
2670
2682
  }
2671
2683
  //#endregion
2672
- export { workspaceSnapshotFinishedEvent as $, eventAutomationTriggerAvailable as A, recordConversationRetry as At, createEventAutomation as B, isFinalAttempt as Bt, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as C, drainConversationMailbox as Ct, eventAutomationMatchesDestination as D, hasRunnableConversationWork as Dt, eventAutomationListToolResultSchema as E, getConversationWorkState as Et, effectiveTaskOutcomes as F, startConversationWork as Ft, listDeletedEventAutomationsCreatedBy as G, buildDeterministicAssistantMessageId as Gt, eventAutomationBelongsToUser as H, injectContinuationToolName as Ht, moveTaskOutcomes as I, stopConversationWork as It, listPublicEventAutomationsForTeams as J, listEventAutomationsCreatedBy as K, buildDeterministicTurnId as Kt, resolveTaskOutcomes as L, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as Lt, requireEventAutomationSlackContext as M, removeActiveConversation as Mt, requireSupportedEventAutomationTrigger as N, requestAnotherSlice as Nt, eventAutomationToolResult as O, listActiveConversationIds as Ot, writableEventAutomation as P, requestConversationWork as Pt, WORKSPACE_SNAPSHOT_READY_EVENT as Q, taskOutcomeInputSchema as R, CONVERSATION_WORK_STALE_ENQUEUE_MS as Rt, withScheduledAutomationLock as S, deadLetterAttempt as St, compactEventAutomation as T, getConversation as Tt, findMatchingEventAutomations as U, juniorToolOutputSchema as Ut, deleteEventAutomation as V, isInvalidConversationRecordError as Vt, getEventAutomation as W, makeStructuredToolOutput as Wt, getEventCatalog as X, saveEventAutomation as Y, WORKSPACE_SNAPSHOT_FAILED_EVENT as Z, parseScheduledAutomationRow as _, clearConsumedConversationWake as _t, requestAttachmentDeletion as a, normalizeCatalogEventIdentifier as at, saveScheduledAutomationInLock as b, completeConversationWork as bt, parseSlackThreadId as c, registeredEventTypeSchema as ct, resolveSlackChannelIdFromThreadId as d, ackMessages as dt, workspaceSnapshotWatch as et, createScheduledAutomation as f, appendAndEnqueueExclusiveInboundMessage as ft, listScheduledAutomationsForTeam as g, checkInConversationWork as gt, listScheduledAutomations as h, cancelHumanFacingPendingMessages as ht, readLiveAttachment as i, hasPluginEventCatalogEntries as it, registeredEventAutomationTriggerSchema as j, releaseConversationWork as jt, eventAutomationToolResultSchema as k, recordAttemptFailure as kt, readSlackRawMessageContext as l, registeredResourceTypeSchema as lt, listPublicScheduledAutomationsForTeams as m, beginConversationResume as mt, readStats as n, eventNamespaceSchema as nt, storeAttachment as o, pluginSupportsEvent as ot, isListedScheduledAutomation as p, appendAndEnqueueInboundMessage as pt, listEventAutomationsForTeam as q, collectAttachmentGarbage as r, hasEventCatalogEntries as rt, storeAttachments as s, registeredEventMatchSchema as st, incrementStat as t, eventGuidance as tt, resolveSlackChannelIdFromMessage as u, requireSupportedEventMatch as ut, readScheduledAutomation as v, clearExpiredConversationLease as vt, scheduledRunSchema as w, ensureConversationWake as wt, scheduledRunId as x, countPendingConversationMessages as xt, saveScheduledAutomation as y, completeConversationStop as yt, collectEventAutomationMatchKeys as z, hasRunnableConversationWork$1 as zt };
2684
+ export { workspaceSnapshotFinishedEvent as $, eventAutomationTriggerAvailable as A, recordConversationRetry as At, createEventAutomation as B, hasRunnableConversationWork$1 as Bt, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as C, drainConversationMailbox as Ct, eventAutomationMatchesDestination as D, hasRunnableConversationWork as Dt, eventAutomationListToolResultSchema as E, getConversationWorkState as Et, effectiveTaskOutcomes as F, startConversationWork as Ft, listDeletedEventAutomationsCreatedBy as G, makeStructuredToolOutput as Gt, eventAutomationBelongsToUser as H, isInvalidConversationRecordError as Ht, moveTaskOutcomes as I, stopConversationWork as It, listPublicEventAutomationsForTeams as J, listEventAutomationsCreatedBy as K, buildDeterministicAssistantMessageId as Kt, resolveTaskOutcomes as L, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as Lt, requireEventAutomationSlackContext as M, removeActiveConversation as Mt, requireSupportedEventAutomationTrigger as N, requestAnotherSlice as Nt, eventAutomationToolResult as O, listActiveConversationIds as Ot, writableEventAutomation as P, requestConversationWork as Pt, WORKSPACE_SNAPSHOT_READY_EVENT as Q, taskOutcomeInputSchema as R, CONVERSATION_WORK_STALE_ENQUEUE_MS as Rt, withScheduledAutomationLock as S, deadLetterAttempt as St, compactEventAutomation as T, getConversation as Tt, findMatchingEventAutomations as U, injectContinuationToolName as Ut, deleteEventAutomation as V, isFinalAttempt as Vt, getEventAutomation as W, juniorToolOutputSchema as Wt, getEventCatalog as X, saveEventAutomation as Y, WORKSPACE_SNAPSHOT_FAILED_EVENT as Z, parseScheduledAutomationRow as _, clearConsumedConversationWake as _t, requestAttachmentDeletion as a, normalizeCatalogEventIdentifier as at, saveScheduledAutomationInLock as b, completeConversationWork as bt, parseSlackThreadId as c, registeredEventTypeSchema as ct, resolveSlackChannelIdFromThreadId as d, ackMessages as dt, workspaceSnapshotWatch as et, createScheduledAutomation as f, appendAndEnqueueExclusiveInboundMessage as ft, listScheduledAutomationsForTeam as g, checkInConversationWork as gt, listScheduledAutomations as h, cancelHumanFacingPendingMessages as ht, readLiveAttachment as i, hasPluginEventCatalogEntries as it, registeredEventAutomationTriggerSchema as j, releaseConversationWork as jt, eventAutomationToolResultSchema as k, recordAttemptFailure as kt, readSlackRawMessageContext as l, registeredResourceTypeSchema as lt, listPublicScheduledAutomationsForTeams as m, beginConversationResume as mt, readStats as n, eventNamespaceSchema as nt, storeAttachment as o, pluginSupportsEvent as ot, isListedScheduledAutomation as p, appendAndEnqueueInboundMessage as pt, listEventAutomationsForTeam as q, buildDeterministicTurnId as qt, collectAttachmentGarbage as r, hasEventCatalogEntries as rt, storeAttachments as s, registeredEventMatchSchema as st, incrementStat as t, eventGuidance as tt, resolveSlackChannelIdFromMessage as u, requireSupportedEventMatch as ut, readScheduledAutomation as v, clearExpiredConversationLease as vt, scheduledRunSchema as w, ensureConversationWake as wt, scheduledRunId as x, countPendingConversationMessages as xt, saveScheduledAutomation as y, completeConversationStop as yt, collectEventAutomationMatchKeys as z, hasConversationStop as zt };
@@ -1,6 +1,6 @@
1
- import { f as logWarn } from "./logging-sNS84Yuu.js";
1
+ import { f as logWarn } from "./logging-GTB-Z6hs.js";
2
2
  import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
3
- import { o as runWithTurnRequestDeadline } from "./job-queue-BIHNIEIX.js";
3
+ import { o as runWithTurnRequestDeadline } from "./job-queue-FcjDDzOt.js";
4
4
  import { z } from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  import { handleCallback, registerDevConsumer } from "@vercel/queue";
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
110
110
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
111
111
  onRejected: logPluginTaskQueueMessageRejected,
112
112
  run: async (message) => {
113
- const { processPluginTask } = await import("./task-runner-Cm0gXoLH.js").then((n) => n.r);
113
+ const { processPluginTask } = await import("./task-runner-ByBGnm9Q.js").then((n) => n.r);
114
114
  await processPluginTask(message);
115
115
  },
116
116
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
2
  import { _ as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-Bplcgypl.js";
3
- import { At as createPluginConversationEvents, Gt as getDb, Q as readActorIdentity, Wt as getConversationStore, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, yt as createPluginModel } from "./agent-hooks-CuGjLjmR.js";
3
+ import { At as createPluginConversationEvents, Gt as getDb, Q as readActorIdentity, Wt as getConversationStore, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, yt as createPluginModel } from "./agent-hooks-4I-C-LhZ.js";
4
4
  import { K as sameActorIdentity } from "./conversation-AA4R1VUn.js";
5
- import { Dt as isToolResultError, Ot as isToolResultMessage, Q as hydrateConversationMessages, bt as getPiMessageRole, jt as stripRuntimeTurnContext, kt as normalizeToolNameFromResult, s as getTurnRecord, wt as instructionTextForProjection } from "./checkpoint-FKMcINix.js";
6
- import { w as getStateAdapter } from "./profile-BfLMVhWo.js";
7
- import { u as recordAutomationExecution } from "./execution-stats-C-f8zwMU.js";
8
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-lw2QwQ-y.js";
9
- import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-JfmWmpjS.js";
5
+ import { Dt as isToolResultError, Ot as isToolResultMessage, Q as hydrateConversationMessages, bt as getPiMessageRole, jt as stripRuntimeTurnContext, kt as normalizeToolNameFromResult, s as getTurnRecord, wt as instructionTextForProjection } from "./checkpoint-CHdApjyQ.js";
6
+ import { w as getStateAdapter } from "./profile-DEoalaoa.js";
7
+ import { u as recordAutomationExecution } from "./execution-stats-D7Q3Mo8Y.js";
8
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BTFCRXKk.js";
9
+ import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-BUAVtd2X.js";
10
10
  import { z } from "zod";
11
11
  import { createHash } from "node:crypto";
12
12
  import { destinationSchema, destinationVisibilitySchema, isSlackDestination, pluginRunContextSchema, replyAttributionSchema, sourceSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
@@ -345,7 +345,7 @@ function slackSourceForDestination(args) {
345
345
  * Reads parent Conversations when this Conversation has no Destination.
346
346
  */
347
347
  async function resolveConversationRouting(args) {
348
- const conversationStore = args.conversationStore ?? (await import("./agent-hooks-CuGjLjmR.js").then((n) => n.Vt)).getConversationStore();
348
+ const conversationStore = args.conversationStore ?? (await import("./agent-hooks-4I-C-LhZ.js").then((n) => n.Vt)).getConversationStore();
349
349
  const chain = await loadConversationChain(args.conversationId, conversationStore);
350
350
  let destination;
351
351
  let source;
@@ -1,9 +1,9 @@
1
- import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-sNS84Yuu.js";
2
- import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-CuGjLjmR.js";
1
+ import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-GTB-Z6hs.js";
2
+ import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-4I-C-LhZ.js";
3
3
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
4
- import { u as juniorLocationConfigurations } from "./executor-BW5qp0jC.js";
5
- import { $ as persistConversationMessages } from "./checkpoint-FKMcINix.js";
6
- import { w as getStateAdapter } from "./profile-BfLMVhWo.js";
4
+ import { u as juniorLocationConfigurations } from "./executor-BR-u7Eiz.js";
5
+ import { $ as persistConversationMessages } from "./checkpoint-CHdApjyQ.js";
6
+ import { w as getStateAdapter } from "./profile-DEoalaoa.js";
7
7
  import { z } from "zod";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { and, eq, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
- import { Ht as getConversationEventStore } from "./agent-hooks-CuGjLjmR.js";
2
- import { n as runAgentWithTimeout } from "./agent-runner-Dz1PMKP0.js";
3
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DVlJLwB0.js";
1
+ import { Ht as getConversationEventStore } from "./agent-hooks-4I-C-LhZ.js";
2
+ import { n as runAgentWithTimeout } from "./agent-runner-DgqYKBZm.js";
3
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bu7HgoE6.js";
4
4
  //#region src/chat/runtime/turn-execution.ts
5
5
  /** An error thrown while the agent advances a Run. */
6
6
  var AgentRunError = class extends Error {
@@ -1,4 +1,4 @@
1
- import { Ht as getConversationEventStore } from "./agent-hooks-CuGjLjmR.js";
1
+ import { Ht as getConversationEventStore } from "./agent-hooks-4I-C-LhZ.js";
2
2
  //#region src/chat/conversations/turn-lifecycle.ts
3
3
  /** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
4
4
  var ConversationTurnLifecycleService = class {
@@ -1,5 +1,5 @@
1
- import { f as logWarn } from "./logging-sNS84Yuu.js";
2
- import { n as botConfig } from "./config-EtF2uEaW.js";
1
+ import { f as logWarn } from "./logging-GTB-Z6hs.js";
2
+ import { n as botConfig } from "./config-DoMOvr4Z.js";
3
3
  import { P as usageSchema } from "./conversation-AA4R1VUn.js";
4
4
  const TITLE_PROMPTS = {
5
5
  conversation: [
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-D8YUMNhb.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D11j6L4T.js";
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  //#region src/chat/plugins/validation.ts
5
5
  var validation_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.208.0";
2
+ var version = "0.210.0";
3
3
  //#endregion
4
4
  //#region src/version.ts
5
5
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as JUNIOR_VERSION } from "./version-s6smK6lP.js";
1
+ import { t as JUNIOR_VERSION } from "./version-Cf7Fwr1w.js";
2
2
  export { JUNIOR_VERSION };
@@ -1,4 +1,4 @@
1
- import { w as getStateAdapter } from "./profile-BfLMVhWo.js";
1
+ import { w as getStateAdapter } from "./profile-DEoalaoa.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/chat/conversations/web-authorization.ts
4
4
  const WEB_AUTHORIZATION_PREFIX = "junior:web_authorization:v1";
@@ -1,8 +1,8 @@
1
- import { f as logWarn } from "./logging-sNS84Yuu.js";
2
- import { s as getSlackBotToken } from "./config-EtF2uEaW.js";
1
+ import { f as logWarn } from "./logging-GTB-Z6hs.js";
2
+ import { s as getSlackBotToken } from "./config-DoMOvr4Z.js";
3
3
  import "./context-Bplcgypl.js";
4
- import { K as normalizeSlackConversationId, Wt as getConversationStore } from "./agent-hooks-CuGjLjmR.js";
5
- import { Kt as buildDeterministicTurnId, c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage } from "./stats-Cq5w_Awk.js";
4
+ import { K as normalizeSlackConversationId, Wt as getConversationStore } from "./agent-hooks-4I-C-LhZ.js";
5
+ import { c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId } from "./stats-DROv84Z6.js";
6
6
  import { t as healthReportSchema } from "./reporting-schema-DosTN__Q.js";
7
7
  import { z } from "zod";
8
8
  import { createHash } from "node:crypto";
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { A as createAgentInvocationSchema, M as AgentInvocationLimitError, O as agentBindingSchema, Q as AuthorizationFlowDisabledError, f as PluginCredentialFailureError, j as AgentInvocationBusyError, k as agentInvocationSchema } from "./agent-BfxfHsf1.js";
3
- import { Ht as getConversationEventStore, Kt as getSqlExecutor, Wt as getConversationStore } from "./agent-hooks-CuGjLjmR.js";
4
- import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-BW5qp0jC.js";
5
- import { B as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, xt as getTerminalAssistantMessages } from "./checkpoint-FKMcINix.js";
6
- import { pt as appendAndEnqueueInboundMessage } from "./stats-Cq5w_Awk.js";
7
- import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-CRJCt9Ux.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DVlJLwB0.js";
9
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-C7K6lQp1.js";
10
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-lw2QwQ-y.js";
2
+ import { $ as AuthorizationFlowDisabledError, A as createAgentInvocationSchema, M as AgentInvocationLimitError, O as agentBindingSchema, f as PluginCredentialFailureError, j as AgentInvocationBusyError, k as agentInvocationSchema } from "./agent-DKboUiLS.js";
3
+ import { Ht as getConversationEventStore, Kt as getSqlExecutor, Wt as getConversationStore } from "./agent-hooks-4I-C-LhZ.js";
4
+ import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-BR-u7Eiz.js";
5
+ import { B as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, xt as getTerminalAssistantMessages } from "./checkpoint-CHdApjyQ.js";
6
+ import { pt as appendAndEnqueueInboundMessage } from "./stats-DROv84Z6.js";
7
+ import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-DZKNc2-v.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bu7HgoE6.js";
9
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-BXKiBFtp.js";
10
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-BTFCRXKk.js";
11
11
  import { z } from "zod";
12
12
  import { createHash } from "node:crypto";
13
13
  import { and, asc, count, eq, inArray } from "drizzle-orm";