@sentry/junior 0.211.0 → 0.212.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 (64) hide show
  1. package/dist/{agent-XXC-9m0B.js → agent-Cgc7jAIH.js} +19 -19
  2. package/dist/{agent-hooks-7vR8uZw2.js → agent-hooks-B2Yt2b88.js} +207 -47
  3. package/dist/{agent-runner-CqXaUvvQ.js → agent-runner-CkNX-ynf.js} +5 -5
  4. package/dist/api/schema.js +2 -2
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +72 -33
  7. package/dist/{app-gyu3D9Gn.d.ts → app-D4nNdzPG.d.ts} +1 -1
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +31 -31
  10. package/dist/{auth-pause-state-r-1vEoSX.js → auth-pause-state-BbcDkPac.js} +6 -6
  11. package/dist/{briefs-DIj_YgLE.js → briefs-4-OVELML.js} +4 -4
  12. package/dist/{catalog-runtime-BMMLIpxX.js → catalog-runtime-BvN_lNVo.js} +1 -1
  13. package/dist/{checkpoint-B6jEtGHN.js → checkpoint-EAQ5Xerb.js} +7 -7
  14. package/dist/cli/chat.js +13 -13
  15. package/dist/cli/check.js +3 -3
  16. package/dist/cli/main.js +1 -1
  17. package/dist/cli/plugins.js +3 -3
  18. package/dist/cli/snapshot-create.js +3 -3
  19. package/dist/cli/upgrade.d.ts +1 -1
  20. package/dist/cli/upgrade.js +3 -3
  21. package/dist/{client-BBPo9KiG.js → client-C1KycWNq.js} +2 -2
  22. package/dist/{config-DMq-uJAV.js → config-C0-PnQoF.js} +2 -2
  23. package/dist/{conversation-AA4R1VUn.js → conversation-CRWntH-A.js} +19 -19
  24. package/dist/{conversation-privacy-D99FrYrV.js → conversation-privacy-BFzYxnTS.js} +1 -1
  25. package/dist/{credential-sync-Cz1T9Ws-.js → credential-sync-CZz6Vk6X.js} +20 -20
  26. package/dist/{db-D74z7BZH.d.ts → db-Ca9Nt5ci.d.ts} +1 -1
  27. package/dist/{execution-stats-BkCnuVBv.js → execution-stats-CoDjBQbE.js} +3 -4
  28. package/dist/{executor-B5VURdwg.js → executor-CaVeGYeA.js} +39 -2
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{job-queue-DUs_jnBa.js → job-queue-BhaNX9DL.js} +1 -1
  31. package/dist/{logging-CXQcqM-W.js → logging-B5-PLvDo.js} +1 -1
  32. package/dist/nitro.d.ts +1 -1
  33. package/dist/nitro.js +3 -3
  34. package/dist/{oauth-callback-server-B0KXcd24.js → oauth-callback-server-G5q7i0Qp.js} +2 -2
  35. package/dist/{pending-auth-CxZjizu_.js → pending-auth-CDndLOLO.js} +2 -2
  36. package/dist/{profile-8K6D5LHD.js → profile-BcZ6EBQ4.js} +4 -4
  37. package/dist/{prompt-C1IA4qkj.js → prompt-kRlibHYT.js} +1 -1
  38. package/dist/{registry-DUa5NdZP.js → registry-BIeo1ST6.js} +1 -1
  39. package/dist/{resolve-E_-QQ8pM.js → resolve-BgAZ4KxF.js} +2 -2
  40. package/dist/{runner-Bf0HnWqY.js → runner-Cqd0EG3G.js} +9 -9
  41. package/dist/{sandbox-egress-signals-BW9FzWoQ.js → sandbox-egress-signals-DrOoklMj.js} +1 -1
  42. package/dist/{schema-CwTeb-BF.js → schema-xHUgeh46.js} +1 -1
  43. package/dist/short-title-CxQHLU3_.js +65 -0
  44. package/dist/{skills-B1f5Ku_s.js → skills-DlrAH1on.js} +2 -2
  45. package/dist/{spawn-BsOCLy8T.js → spawn-BtMqHjwx.js} +2 -2
  46. package/dist/{stats-CrITkCy5.js → stats-D5OWazLs.js} +5 -5
  47. package/dist/{store-Det8MQ9g.d.ts → store-DoewL5mG.d.ts} +3 -2
  48. package/dist/{task-queue-CcqJCAUd.js → task-queue-C-o2Q4O-.js} +3 -3
  49. package/dist/{task-runner-7IOXx_Uo.js → task-runner-Mt_TGUBH.js} +8 -8
  50. package/dist/{thread-state-Y3PGLZQa.js → thread-state-C81fvhJu.js} +5 -5
  51. package/dist/{turn-execution-Bm6Xbaoi.js → turn-execution-Ruj9SSJU.js} +3 -3
  52. package/dist/{turn-lifecycle-Czzk8ila.js → turn-lifecycle-xIZNwgaq.js} +1 -1
  53. package/dist/{validation-A2SMrAkJ.js → validation-sgYqCVwr.js} +1 -1
  54. package/dist/{version-CfRx6f_C.js → version-BE7Zf9Wx.js} +1 -1
  55. package/dist/version.js +1 -1
  56. package/dist/{web-authorization-DN3cJuLB.js → web-authorization-BXrGezGm.js} +1 -1
  57. package/dist/{web-input-lJH42B_R.js → web-input-FJ7NNJDx.js} +4 -4
  58. package/dist/{work-CRHJu3hb.js → work-DlYdbVfB.js} +9 -9
  59. package/dist/{worker-D6oTNemM.js → worker-BfxedsTU.js} +5 -5
  60. package/migrations/0042_conversation_metrics.sql +26 -0
  61. package/migrations/meta/0042_snapshot.json +3610 -0
  62. package/migrations/meta/_journal.json +7 -0
  63. package/package.json +5 -5
  64. package/dist/usage-DHJ3ng2s.js +0 -166
@@ -1,28 +1,28 @@
1
- import { N as getMcpProviderErrorAttributes, X as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-XXC-9m0B.js";
2
- import { m as escapeXml } from "./client-BBPo9KiG.js";
3
- import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-CXQcqM-W.js";
4
- import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-DMq-uJAV.js";
1
+ import { N as getMcpProviderErrorAttributes, X as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-Cgc7jAIH.js";
2
+ import { m as escapeXml } from "./client-C1KycWNq.js";
3
+ import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-B5-PLvDo.js";
4
+ import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-C0-PnQoF.js";
5
5
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
6
6
  import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
7
- import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as getSqlExecutor, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationStore, mt as getDashboardConversationLink, nn as upsertIdentity, o as getPluginSlackConversationLink, on as requireSlackDestination, rn as upsertLinkedIdentity, z as SlackActionError } from "./agent-hooks-7vR8uZw2.js";
7
+ import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as getSqlExecutor, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationStore, cn as upsertLinkedIdentity, dn as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, sn as upsertIdentity, z as SlackActionError } from "./agent-hooks-B2Yt2b88.js";
8
8
  import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
9
- import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-DUa5NdZP.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
11
- import { t as discoverSkills } from "./skills-B1f5Ku_s.js";
12
- import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-B6jEtGHN.js";
13
- import { E as acquireActiveLock, w as getStateAdapter } from "./profile-8K6D5LHD.js";
14
- import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-CrITkCy5.js";
15
- import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CxZjizu_.js";
16
- import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-CqXaUvvQ.js";
9
+ import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-BIeo1ST6.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BvN_lNVo.js";
11
+ import { t as discoverSkills } from "./skills-DlrAH1on.js";
12
+ import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-EAQ5Xerb.js";
13
+ import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BcZ6EBQ4.js";
14
+ import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-D5OWazLs.js";
15
+ import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CDndLOLO.js";
16
+ import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-CkNX-ynf.js";
17
17
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
18
- import { a as getTurnRequestDeadline } from "./job-queue-DUs_jnBa.js";
19
- import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-7IOXx_Uo.js";
20
- import { n as getTurnLifecycle } from "./turn-lifecycle-Czzk8ila.js";
21
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-Bm6Xbaoi.js";
22
- import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-Y3PGLZQa.js";
23
- import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-r-1vEoSX.js";
18
+ import { a as getTurnRequestDeadline } from "./job-queue-BhaNX9DL.js";
19
+ import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-Mt_TGUBH.js";
20
+ import { n as getTurnLifecycle } from "./turn-lifecycle-xIZNwgaq.js";
21
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-Ruj9SSJU.js";
22
+ import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-C81fvhJu.js";
23
+ import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-BbcDkPac.js";
24
24
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
25
- import { n as deleteWebAuthorization } from "./web-authorization-DN3cJuLB.js";
25
+ import { n as deleteWebAuthorization } from "./web-authorization-BXrGezGm.js";
26
26
  import path from "node:path";
27
27
  import { z } from "zod";
28
28
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import "./store-Det8MQ9g.js";
1
+ import "./store-DoewL5mG.js";
2
2
  import { z } from "zod";
3
3
  import "drizzle-orm/pg-core";
4
4
  import "drizzle-orm/migrator";
@@ -1,7 +1,6 @@
1
- import { f as logWarn } from "./logging-CXQcqM-W.js";
2
- import { Gt as getDb } from "./agent-hooks-7vR8uZw2.js";
3
- import { s as juniorAutomationExecutions, w as juniorConversations } from "./executor-B5VURdwg.js";
4
- import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-DHJ3ng2s.js";
1
+ import { f as logWarn } from "./logging-B5-PLvDo.js";
2
+ import { Gt as getDb, nn as agentTurnTotalTokens, tn as agentTurnCostUsd } from "./agent-hooks-B2Yt2b88.js";
3
+ import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-CaVeGYeA.js";
5
4
  import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
6
5
  //#region src/api/conversations/aggregate.ts
7
6
  function usageTokenValue(source, field) {
@@ -1,5 +1,5 @@
1
1
  import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
2
- import "./config-DMq-uJAV.js";
2
+ import "./config-C0-PnQoF.js";
3
3
  import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { getTableColumns, sql } from "drizzle-orm";
@@ -249,6 +249,42 @@ const juniorConversationEvents = pgTable("junior_conversation_events", {
249
249
  uniqueIndex("junior_conversation_events_idempotency_idx").on(table.conversationId, table.idempotencyKey)
250
250
  ]);
251
251
  //#endregion
252
+ //#region src/db/schema/conversation-metrics.ts
253
+ const CONVERSATION_METRICS = [
254
+ "duration_ms",
255
+ "total_tokens",
256
+ "input_tokens",
257
+ "output_tokens",
258
+ "cached_input_tokens",
259
+ "cache_creation_tokens",
260
+ "reasoning_tokens",
261
+ "cost_usd"
262
+ ];
263
+ /** One metric value for one Conversation Run. */
264
+ const juniorConversationMetrics = pgTable("junior_conversation_metrics", {
265
+ conversationId: text("conversation_id").notNull(),
266
+ runId: text("run_id").notNull(),
267
+ metric: text("metric").$type().notNull(),
268
+ value: doublePrecision("value").notNull(),
269
+ occurredAt: timestamptz("occurred_at").notNull(),
270
+ updatedAt: timestamptz("updated_at").notNull()
271
+ }, (table) => [
272
+ primaryKey({
273
+ name: "junior_conversation_metrics_conversation_id_run_id_metric_pk",
274
+ columns: [
275
+ table.conversationId,
276
+ table.runId,
277
+ table.metric
278
+ ]
279
+ }),
280
+ foreignKey({
281
+ name: "junior_conversation_metrics_conversation_id_junior_conversations_conversation_id_fk",
282
+ columns: [table.conversationId],
283
+ foreignColumns: [juniorConversations.conversationId]
284
+ }),
285
+ index("junior_conversation_metrics_occurred_at_metric_idx").on(table.occurredAt, table.metric)
286
+ ]);
287
+ //#endregion
252
288
  //#region src/db/schema/conversation-briefs.ts
253
289
  /** Append-only Brief versions produced for completed Conversation turns. */
254
290
  const juniorConversationBriefs = pgTable("junior_conversation_briefs", {
@@ -516,6 +552,7 @@ const juniorSqlSchema = {
516
552
  juniorAgentBindings,
517
553
  juniorAgentInvocations,
518
554
  juniorConversationEvents,
555
+ juniorConversationMetrics,
519
556
  juniorConversationBriefs,
520
557
  juniorConversationBindings,
521
558
  juniorConversationParticipants,
@@ -1031,4 +1068,4 @@ function createJuniorSqlExecutor(args) {
1031
1068
  });
1032
1069
  }
1033
1070
  //#endregion
1034
- export { conversationReadColumns as C, juniorArtifacts as D, juniorUsers as E, juniorAttachments as S, juniorIdentities as T, juniorConversationEvents as _, juniorSchedulerRuns as a, juniorCodeChanges as b, juniorStats as c, AGENT_INVOCATION_MAILBOX_STATUSES as d, juniorAgentBindings as f, juniorConversationBriefs as g, juniorConversationBindings as h, juniorWorkspaces as i, juniorEventAutomations as l, juniorConversationParticipants as m, juniorSnapshots as n, juniorSchedulerTasks as o, juniorAgentInvocations as p, juniorWorkspaceRepos as r, juniorAutomationExecutions as s, createJuniorSqlExecutor as t, juniorLocationConfigurations as u, juniorApiTokens as v, juniorConversations as w, juniorCodeRepositories as x, juniorConversationAnnotations as y };
1071
+ export { juniorCodeRepositories as C, juniorIdentities as D, juniorConversations as E, juniorUsers as O, juniorCodeChanges as S, conversationReadColumns as T, CONVERSATION_METRICS as _, juniorSchedulerRuns as a, juniorApiTokens as b, juniorStats as c, AGENT_INVOCATION_MAILBOX_STATUSES as d, juniorAgentBindings as f, juniorConversationBriefs as g, juniorConversationBindings as h, juniorWorkspaces as i, juniorArtifacts as k, juniorEventAutomations as l, juniorConversationParticipants as m, juniorSnapshots as n, juniorSchedulerTasks as o, juniorAgentInvocations as p, juniorWorkspaceRepos as r, juniorAutomationExecutions as s, createJuniorSqlExecutor as t, juniorLocationConfigurations as u, juniorConversationMetrics as v, juniorAttachments as w, juniorConversationAnnotations as x, juniorConversationEvents as y };
@@ -1,6 +1,6 @@
1
- import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-CXQcqM-W.js";
1
+ import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-B5-PLvDo.js";
2
2
  import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-D99FrYrV.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BFzYxnTS.js";
4
4
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
5
5
  //#region src/chat/sentry-payload-filter.ts
6
6
  const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { a as getChatConfig } from "./config-DMq-uJAV.js";
1
+ import { a as getChatConfig } from "./config-C0-PnQoF.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
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-CfRx6f_C.js";
2
+ import { t as JUNIOR_VERSION } from "./version-BE7Zf9Wx.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-gyu3D9Gn.js";
1
+ import { n as JuniorDashboardOptions } from "./app-D4nNdzPG.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-CXQcqM-W.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-B5-PLvDo.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-DUs_jnBa.js";
4
+ import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-BhaNX9DL.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-CcqJCAUd.js";
6
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-C-o2Q4O-.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 { X as createUserTokenStore } from "./agent-XXC-9m0B.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-Cz1T9Ws-.js";
1
+ import { X as createUserTokenStore } from "./agent-Cgc7jAIH.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CZz6Vk6X.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 { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-B6jEtGHN.js";
2
- import { qt as buildDeterministicTurnId } from "./stats-CrITkCy5.js";
1
+ import { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-EAQ5Xerb.js";
2
+ import { qt as buildDeterministicTurnId } from "./stats-D5OWazLs.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-BBPo9KiG.js";
2
- import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-CXQcqM-W.js";
3
- import { a as getChatConfig } from "./config-DMq-uJAV.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
1
+ import { w as toOptionalTrimmed } from "./client-C1KycWNq.js";
2
+ import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-B5-PLvDo.js";
3
+ import { a as getChatConfig } from "./config-C0-PnQoF.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BvN_lNVo.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";
@@ -1,4 +1,4 @@
1
- import { M as conversationBriefSchema, N as parseBriefInput, j as briefOutcomeStatusSchema } from "./conversation-AA4R1VUn.js";
1
+ import { M as conversationBriefSchema, N as parseBriefInput, j as briefOutcomeStatusSchema } from "./conversation-CRWntH-A.js";
2
2
  import { z } from "zod";
3
3
  //#region src/chat/briefs/generate.ts
4
4
  const MAX_INPUT_CHARS = 6e4;
@@ -1,4 +1,4 @@
1
- import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-CXQcqM-W.js";
1
+ import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-B5-PLvDo.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-CXQcqM-W.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-8K6D5LHD.js";
1
+ import { C as withSpan, _ as setSpanAttributes } from "./logging-B5-PLvDo.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-BcZ6EBQ4.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-XXC-9m0B.js";
2
- import { S as withLogContext, u as logException, y as setTags } from "./logging-CXQcqM-W.js";
1
+ import { p as authorizationId } from "./agent-Cgc7jAIH.js";
2
+ import { S as withLogContext, u as logException, y as setTags } from "./logging-B5-PLvDo.js";
3
3
  import { t as credentialContextForActor } from "./context-Bplcgypl.js";
4
- import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-7vR8uZw2.js";
5
- import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-B6jEtGHN.js";
6
- import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CxZjizu_.js";
7
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-7IOXx_Uo.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Czzk8ila.js";
9
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Y3PGLZQa.js";
10
- import { d as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-r-1vEoSX.js";
4
+ import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-B2Yt2b88.js";
5
+ import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-EAQ5Xerb.js";
6
+ import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-CDndLOLO.js";
7
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-Mt_TGUBH.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-xIZNwgaq.js";
9
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-C81fvhJu.js";
10
+ import { d as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-BbcDkPac.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 { Y as sandboxEgressSignalsResponseSchema } from "./agent-XXC-9m0B.js";
1
+ import { Y as sandboxEgressSignalsResponseSchema } from "./agent-Cgc7jAIH.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 juniorDestinationKindSchema } from "./destinations-BeBiJeEM.js";
2
- import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-AA4R1VUn.js";
2
+ import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-CRWntH-A.js";
3
3
  import "./reporting-schema-DosTN__Q.js";
4
4
  import { z } from "zod";
5
5
  import { codeChangeStateSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
@@ -0,0 +1,65 @@
1
+ import { f as logWarn } from "./logging-B5-PLvDo.js";
2
+ import { n as botConfig } from "./config-C0-PnQoF.js";
3
+ const TITLE_PROMPTS = {
4
+ conversation: [
5
+ "Generate a concise 5-8 word conversation title from the first user message below.",
6
+ "Capture the user's main request.",
7
+ "Reply with ONLY the title, with no quotes or trailing punctuation."
8
+ ],
9
+ task: [
10
+ "Generate a concise 5-8 word task title from the task instruction below.",
11
+ "Capture the task's main purpose.",
12
+ "Reply with ONLY the title, with no quotes or trailing punctuation."
13
+ ]
14
+ };
15
+ /** Collapse whitespace and cap a candidate short title. */
16
+ function normalizeShortTitle(value) {
17
+ return value.replace(/\s+/g, " ").trim().slice(0, 60);
18
+ }
19
+ /**
20
+ * Deterministic display title when no generated title is stored.
21
+ * Uses the first non-empty line of the source text, capped like generated titles.
22
+ */
23
+ function fallbackShortTitle(sourceText, fallback = "Untitled") {
24
+ return normalizeShortTitle(sourceText.split(/\r?\n/).map((line) => line.trim()).find((line) => line.length > 0) ?? "") || fallback;
25
+ }
26
+ /** Generate a short title with the fast model, or return undefined on failure. */
27
+ async function generateShortTitle(args) {
28
+ const sourceText = args.sourceText.trim();
29
+ if (!sourceText) return void 0;
30
+ try {
31
+ return normalizeShortTitle((await args.completeText({
32
+ modelId: botConfig.fastModelId,
33
+ temperature: 0,
34
+ promptName: `junior.${args.kind}_title`,
35
+ messages: [{
36
+ role: "user",
37
+ content: [
38
+ ...TITLE_PROMPTS[args.kind],
39
+ "",
40
+ args.kind === "conversation" ? `First user message: ${sourceText.slice(0, 500)}` : `Task instruction: ${sourceText.slice(0, 500)}`
41
+ ].join("\n"),
42
+ timestamp: Date.now()
43
+ }],
44
+ metadata: { modelId: botConfig.fastModelId }
45
+ })).text) || void 0;
46
+ } catch (error) {
47
+ logWarn(`${args.kind}.title.generation.failed`, { "exception.message": error instanceof Error ? error.message : String(error) });
48
+ return;
49
+ }
50
+ }
51
+ /**
52
+ * Prefer an explicit task title when provided; otherwise generate one from the
53
+ * instruction with the fast model.
54
+ */
55
+ async function resolveTaskTitle(args) {
56
+ const explicit = normalizeShortTitle(args.title ?? "");
57
+ if (explicit) return explicit;
58
+ return generateShortTitle({
59
+ completeText: args.completeText,
60
+ kind: "task",
61
+ sourceText: args.instruction
62
+ });
63
+ }
64
+ //#endregion
65
+ export { generateShortTitle as n, resolveTaskTitle as r, fallbackShortTitle as t };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { f as logWarn } from "./logging-CXQcqM-W.js";
2
+ import { f as logWarn } from "./logging-B5-PLvDo.js";
3
3
  import { s as skillRoots } from "./package-discovery-7a9YqLhE.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BvN_lNVo.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-CqXaUvvQ.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-CRHJu3hb.js";
2
+ import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-CkNX-ynf.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-DlYdbVfB.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,10 +1,10 @@
1
- import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-CXQcqM-W.js";
2
- import { a as getChatConfig } from "./config-DMq-uJAV.js";
1
+ import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-B5-PLvDo.js";
2
+ import { a as getChatConfig } from "./config-C0-PnQoF.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-7vR8uZw2.js";
4
+ import { Gt as getDb, J as withSlackRetries, U as getSlackClient, Wt as getConversationStore, fn as sameDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, un as parseDestination } from "./agent-hooks-B2Yt2b88.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-B5VURdwg.js";
7
- import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-8K6D5LHD.js";
6
+ import { E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments } from "./executor-CaVeGYeA.js";
7
+ import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-BcZ6EBQ4.js";
8
8
  import "./vercel-queue-DIkVcfK4.js";
9
9
  import { z } from "zod";
10
10
  import { createHash, randomUUID } from "node:crypto";
@@ -178,12 +178,13 @@ interface ConversationStore {
178
178
  visibility?: ConversationPrivacy;
179
179
  }): Promise<void>;
180
180
  /**
181
- * Materialize execution and usage aggregates beside canonical metadata.
182
- * These fields serve reporting and runtime control, never history hydration.
181
+ * Store execution state and one Run's metrics.
182
+ * Conversation metric fields cache totals for existing readers.
183
183
  */
184
184
  recordExecution(args: {
185
185
  channelName?: string;
186
186
  conversationId: string;
187
+ /** When this Run started. */
187
188
  createdAtMs: number;
188
189
  destination?: Destination;
189
190
  execution: ConversationExecution;
@@ -1,6 +1,6 @@
1
- import { f as logWarn } from "./logging-CXQcqM-W.js";
1
+ import { f as logWarn } from "./logging-B5-PLvDo.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-DUs_jnBa.js";
3
+ import { o as runWithTurnRequestDeadline } from "./job-queue-BhaNX9DL.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-7IOXx_Uo.js").then((n) => n.r);
113
+ const { processPluginTask } = await import("./task-runner-Mt_TGUBH.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-7vR8uZw2.js";
4
- import { K as sameActorIdentity } from "./conversation-AA4R1VUn.js";
5
- import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-B6jEtGHN.js";
6
- import { w as getStateAdapter } from "./profile-8K6D5LHD.js";
7
- import { u as recordAutomationExecution } from "./execution-stats-BkCnuVBv.js";
8
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Y3PGLZQa.js";
9
- import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-CcqJCAUd.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-B2Yt2b88.js";
4
+ import { G as sameActorIdentity } from "./conversation-CRWntH-A.js";
5
+ import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-EAQ5Xerb.js";
6
+ import { w as getStateAdapter } from "./profile-BcZ6EBQ4.js";
7
+ import { u as recordAutomationExecution } from "./execution-stats-CoDjBQbE.js";
8
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-C81fvhJu.js";
9
+ import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-C-o2Q4O-.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-7vR8uZw2.js").then((n) => n.Vt)).getConversationStore();
348
+ const conversationStore = args.conversationStore ?? (await import("./agent-hooks-B2Yt2b88.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-CXQcqM-W.js";
2
- import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-7vR8uZw2.js";
1
+ import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-B5-PLvDo.js";
2
+ import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-B2Yt2b88.js";
3
3
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
4
- import { u as juniorLocationConfigurations } from "./executor-B5VURdwg.js";
5
- import { X as persistConversationMessages } from "./checkpoint-B6jEtGHN.js";
6
- import { w as getStateAdapter } from "./profile-8K6D5LHD.js";
4
+ import { u as juniorLocationConfigurations } from "./executor-CaVeGYeA.js";
5
+ import { X as persistConversationMessages } from "./checkpoint-EAQ5Xerb.js";
6
+ import { w as getStateAdapter } from "./profile-BcZ6EBQ4.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-7vR8uZw2.js";
2
- import { n as runAgentWithTimeout } from "./agent-runner-CqXaUvvQ.js";
3
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Czzk8ila.js";
1
+ import { Ht as getConversationEventStore } from "./agent-hooks-B2Yt2b88.js";
2
+ import { n as runAgentWithTimeout } from "./agent-runner-CkNX-ynf.js";
3
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-xIZNwgaq.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-7vR8uZw2.js";
1
+ import { Ht as getConversationEventStore } from "./agent-hooks-B2Yt2b88.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
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BvN_lNVo.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.211.0";
2
+ var version = "0.212.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-CfRx6f_C.js";
1
+ import { t as JUNIOR_VERSION } from "./version-BE7Zf9Wx.js";
2
2
  export { JUNIOR_VERSION };
@@ -1,4 +1,4 @@
1
- import { w as getStateAdapter } from "./profile-8K6D5LHD.js";
1
+ import { w as getStateAdapter } from "./profile-BcZ6EBQ4.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-CXQcqM-W.js";
2
- import { s as getSlackBotToken } from "./config-DMq-uJAV.js";
1
+ import { f as logWarn } from "./logging-B5-PLvDo.js";
2
+ import { s as getSlackBotToken } from "./config-C0-PnQoF.js";
3
3
  import "./context-Bplcgypl.js";
4
- import { K as normalizeSlackConversationId, Wt as getConversationStore } from "./agent-hooks-7vR8uZw2.js";
5
- import { c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId } from "./stats-CrITkCy5.js";
4
+ import { K as normalizeSlackConversationId, Wt as getConversationStore } from "./agent-hooks-B2Yt2b88.js";
5
+ import { c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId } from "./stats-D5OWazLs.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 { $ as AuthorizationFlowDisabledError, A as createAgentInvocationSchema, M as AgentInvocationLimitError, O as agentBindingSchema, f as PluginCredentialFailureError, j as AgentInvocationBusyError, k as agentInvocationSchema } from "./agent-XXC-9m0B.js";
3
- import { Ht as getConversationEventStore, Kt as getSqlExecutor, Wt as getConversationStore } from "./agent-hooks-7vR8uZw2.js";
4
- import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-B5VURdwg.js";
5
- import { L as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, v as getTerminalAssistantMessages } from "./checkpoint-B6jEtGHN.js";
6
- import { pt as appendAndEnqueueInboundMessage } from "./stats-CrITkCy5.js";
7
- import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-CxZjizu_.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Czzk8ila.js";
9
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-Bm6Xbaoi.js";
10
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-Y3PGLZQa.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-Cgc7jAIH.js";
3
+ import { Ht as getConversationEventStore, Kt as getSqlExecutor, Wt as getConversationStore } from "./agent-hooks-B2Yt2b88.js";
4
+ import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-CaVeGYeA.js";
5
+ import { L as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, v as getTerminalAssistantMessages } from "./checkpoint-EAQ5Xerb.js";
6
+ import { pt as appendAndEnqueueInboundMessage } from "./stats-D5OWazLs.js";
7
+ import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-CDndLOLO.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-xIZNwgaq.js";
9
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-Ruj9SSJU.js";
10
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-C81fvhJu.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";
@@ -1,10 +1,10 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { b as isProviderRetryError } from "./client-BBPo9KiG.js";
3
- import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-CXQcqM-W.js";
4
- import { a as getChatConfig } from "./config-DMq-uJAV.js";
5
- import { At as recordConversationRetry, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Ht as isInvalidConversationRecordError, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isFinalAttempt, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop, zt as hasConversationStop } from "./stats-CrITkCy5.js";
2
+ import { b as isProviderRetryError } from "./client-C1KycWNq.js";
3
+ import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-B5-PLvDo.js";
4
+ import { a as getChatConfig } from "./config-C0-PnQoF.js";
5
+ import { At as recordConversationRetry, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Ht as isInvalidConversationRecordError, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isFinalAttempt, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop, zt as hasConversationStop } from "./stats-D5OWazLs.js";
6
6
  import { c as ConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
7
- import { a as getTurnRequestDeadline } from "./job-queue-DUs_jnBa.js";
7
+ import { a as getTurnRequestDeadline } from "./job-queue-BhaNX9DL.js";
8
8
  //#region src/chat/task-execution/worker.ts
9
9
  var worker_exports = /* @__PURE__ */ __exportAll({
10
10
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,