@sentry/junior 0.295.0 → 0.296.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 (62) hide show
  1. package/dist/{admin-ifgjyfpF.js → admin-z_lgDi-z.js} +2 -2
  2. package/dist/{agent-runner-DjMTPWEO.js → agent-runner-HoQiUKLL.js} +194 -132
  3. package/dist/api/schema.d.ts +1 -1
  4. package/dist/api/schema.js +1 -1
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +294 -328
  7. package/dist/{app-uiTzRbvq.d.ts → app-C75Ft-A_.d.ts} +2 -2
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +26 -26
  10. package/dist/{background-compaction-queue-DUkHZjmL.js → background-compaction-queue-Cre1wFt9.js} +4 -4
  11. package/dist/{briefs-CbNYM-q2.js → briefs-BXECHduJ.js} +2 -2
  12. package/dist/{catalog-runtime-DgouZKZm.js → catalog-runtime-CpCmlD9L.js} +1 -1
  13. package/dist/cli/chat.js +14 -14
  14. package/dist/cli/check.js +3 -3
  15. package/dist/cli/main.js +3 -3
  16. package/dist/cli/plugins.js +4 -4
  17. package/dist/cli/snapshot-create.js +4 -4
  18. package/dist/cli/upgrade.d.ts +1 -1
  19. package/dist/cli/upgrade.js +3 -3
  20. package/dist/{config-DvnTPCfp.js → config-CCPHvTqx.js} +18 -2
  21. package/dist/{connections-CWaIVl_1.js → connections-B5pWh8e2.js} +6 -6
  22. package/dist/{conversation-privacy-DPjv4SnA.js → conversation-privacy-CZD5soDW.js} +1 -1
  23. package/dist/{credential-sync-BhbaZfmO.js → credential-sync-DwLkIvXI.js} +13 -13
  24. package/dist/{db-CCUqQe0E.d.ts → db-B3iyr_Or.d.ts} +1 -1
  25. package/dist/{db-Dts2XvLu.js → db-C1M1y-bh.js} +17 -23
  26. package/dist/{executor-Ck73J0wP.js → executor-DUSEwXaO.js} +10 -4
  27. package/dist/instrumentation.js +19 -2
  28. package/dist/{logging-9OAq-fdg.js → logging-D0svFM8r.js} +1 -1
  29. package/dist/{message-CtaPzC7m.js → message-BFnIwKpx.js} +9 -9
  30. package/dist/nitro.d.ts +1 -1
  31. package/dist/nitro.js +2 -2
  32. package/dist/{oauth-callback-server-C_LXY1d4.js → oauth-callback-server-BXRtD6Fk.js} +2 -2
  33. package/dist/{projection-BzJQncZV.js → projection-B6VS7kbo.js} +156 -49
  34. package/dist/{prompt-Cbq5b4SO.js → prompt-CD11tfG8.js} +3 -3
  35. package/dist/{registry-cbpOxO4M.js → registry-CHewwYEo.js} +1 -1
  36. package/dist/{resolve-t-pmRdwS.js → resolve-1owMH4qo.js} +3 -3
  37. package/dist/{result-DhgjR3nQ.js → result-CEqQFrEf.js} +8 -8
  38. package/dist/{runner-CHv9X9TH.js → runner-BtWvJslp.js} +7 -7
  39. package/dist/{sandbox-egress-signals-Yy3fSCbg.js → sandbox-egress-signals-ByftwJVt.js} +1 -1
  40. package/dist/{schema-TSEisVJR.d.ts → schema-Ct1Zf2xy.d.ts} +16 -0
  41. package/dist/{schema-BhneuGYv.js → schema-D2iGyYIp.js} +11 -0
  42. package/dist/{service-account-C4rBP8ne.js → service-account-BZEuMKdo.js} +3 -3
  43. package/dist/{service-account-DjPIwCMj.js → service-account-DLoeoHww.js} +3 -3
  44. package/dist/{session-stop-DkxI5vc3.js → session-stop-hYNTNpVf.js} +14 -14
  45. package/dist/{skills-BZE2DP8I.js → skills-DXgd5Inh.js} +3 -3
  46. package/dist/{spawn-BvULxIiu.js → spawn-YeqlNDv8.js} +5 -5
  47. package/dist/{state-CO9ETDzk.js → state-C3CbtD_m.js} +2 -2
  48. package/dist/{stop-CL-rdtQb.js → stop-Cze_pEL8.js} +288 -246
  49. package/dist/{store-DgD78_NK.js → store-CZ9vqR4P.js} +3 -3
  50. package/dist/{task-runner-CKOj6xla.js → task-runner-CMiNGsER.js} +274 -250
  51. package/dist/{turn-failure-response-BTSo6SMJ.js → turn-failure-response-pXhZ2wMK.js} +11 -8
  52. package/dist/{validation-CXeYgBzq.js → validation-Du7NdkOR.js} +1 -1
  53. package/dist/{version-AQa7Fr2H.js → version-EN3Wnq-R.js} +1 -1
  54. package/dist/version.js +1 -1
  55. package/dist/{viewer-Bqkb678l.js → viewer-Agxi_o5c.js} +3 -3
  56. package/dist/{warmup-h6u1e9n0.js → warmup-CY2ArYag.js} +251 -103
  57. package/dist/{work-yN_GAuXY.js → work-EA98F0ia.js} +11 -11
  58. package/dist/{worker-Hl7N292I.js → worker-BALVdWbv.js} +6 -6
  59. package/migrations/0101_drop_legacy_columns.sql +12 -0
  60. package/migrations/meta/0101_snapshot.json +4496 -0
  61. package/migrations/meta/_journal.json +7 -0
  62. package/package.json +5 -4
@@ -1,6 +1,6 @@
1
1
  import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-CZyYgPF0.js";
2
- import { t as ConversationStore } from "./db-CCUqQe0E.js";
3
- import "./schema-TSEisVJR.js";
2
+ import { t as ConversationStore } from "./db-B3iyr_Or.js";
3
+ import "./schema-Ct1Zf2xy.js";
4
4
  import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
5
5
  import "./sentry-DrKC2NeM.js";
6
6
  import { Hono } from "hono";
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-uiTzRbvq.js";
1
+ import { i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-C75Ft-A_.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-B_0Cr0MO.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
4
4
  export { JUNIOR_VERSION, JuniorApp, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,41 +1,41 @@
1
1
  import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-BRTJqumy.js";
2
- import { $r as verifyScheduledAutomationCredentialSubject, Aa as normalizeSandboxEgressTracePropagationDomains, Ai as isVercelSandboxEgressRequest, At as isInvalidConversationRecordError, Bn as getPlugins, Bo as getConfigDefaults, C as settleConversationTitleWork, Ca as consumeSandboxEgressAuthRequiredSignal, Co as resolveRootVisibility, Dr as reviewItemReaderForUserInConversation, Ea as parseSandboxEgressCredentialToken, En as createUserTokenStore, Eo as listConversationAnnotations, Er as reviewItemReaderForUser, Fi as resolveBaseUrl, Fn as getPluginRoutes, Gn as setBriefsConfig, Gr as findMatchingWatches, Hn as validatePlugins, Ia as createPluginEmbedder, Ji as postSlackEphemeralMessage, Jr as takeDueTimerWatches, Li as escapeSlackMrkdwnText, Mn as createPluginEventPublisher, Ot as hasRunnableConversationWork, Pn as getPluginApiRoutes, Po as createPluginCache, Pt as pruneActiveConversation, Qr as verifyEventAutomationCredentialSubject, Ri as formatSlackLink, Sa as clearSandboxEgressSignals, Vi as slackMention, Vn as setPlugins, Vo as setConfigDefaults, Vr as collectEventMatchKeys, Xa as createPluginLogger, Xr as bindScheduledAutomationCredentialSubject, Yr as bindEventAutomationCredentialSubject, Zi as unfurlSlackLinks, Zr as bindSlackDirectCredentialSubject, _ as appendConversationMessages, ai as getDashboardReviewItemLink, ar as dismissOpenReviewItems, ca as isDmChannel, ci as parseDashboardConversationLink, di as createPluginState, do as readConversationEventPageAfter, ea as slackEntitySchema, ei as verifySlackDirectCredentialSubject, eo as readConversationAccessFromSql, fa as getWorkspaceTeamId, fr as searchReviewItems, gr as canActOnReviewItem, ji as proxyVercelSandboxEgressRequest, li as setDashboardConversationLinkOptions, lo as readLatestConversationBrief, mo as readConversationMessageEventSeq, oa as getSlackClient, pa as runWithWorkspaceTeamId, po as readConversationLastEventSeq, qi as openSlackModal, ri as getDashboardConversationLink, si as getDashboardTaskLink, ta as slackExternalRefIdSchema, tr as projectConversationMessages, uo as readConversationEventPage, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, wa as consumeSandboxEgressPermissionDeniedSignal } from "./projection-BzJQncZV.js";
3
- import { Y as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig } from "./config-DvnTPCfp.js";
4
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-9OAq-fdg.js";
5
- import { t as JUNIOR_VERSION } from "./version-AQa7Fr2H.js";
2
+ import { $r as verifyScheduledAutomationCredentialSubject, Aa as normalizeSandboxEgressTracePropagationDomains, Ai as isVercelSandboxEgressRequest, At as isInvalidConversationRecordError, Bn as getPlugins, Bo as getConfigDefaults, C as settleConversationTitleWork, Ca as consumeSandboxEgressAuthRequiredSignal, Co as resolveRootVisibility, Dr as reviewItemReaderForUserInConversation, Ea as parseSandboxEgressCredentialToken, En as createUserTokenStore, Eo as listConversationAnnotations, Er as reviewItemReaderForUser, Fi as resolveBaseUrl, Fn as getPluginRoutes, Gn as setBriefsConfig, Gr as findMatchingWatches, Hn as validatePlugins, Ia as createPluginEmbedder, Ji as postSlackEphemeralMessage, Jr as takeDueTimerWatches, Li as escapeSlackMrkdwnText, Mn as createPluginEventPublisher, Ot as hasRunnableConversationWork, Pn as getPluginApiRoutes, Po as createPluginCache, Pt as pruneActiveConversation, Qr as verifyEventAutomationCredentialSubject, Ri as formatSlackLink, Sa as clearSandboxEgressSignals, Vi as slackMention, Vn as setPlugins, Vo as setConfigDefaults, Vr as collectEventMatchKeys, Xa as createPluginLogger, Xr as bindScheduledAutomationCredentialSubject, Yr as bindEventAutomationCredentialSubject, Zi as unfurlSlackLinks, Zr as bindSlackDirectCredentialSubject, _ as appendConversationMessages, ai as getDashboardReviewItemLink, ar as dismissOpenReviewItems, ca as isDmChannel, ci as parseDashboardConversationLink, di as createPluginState, do as readConversationEventPageAfter, ea as slackEntitySchema, ei as verifySlackDirectCredentialSubject, eo as readConversationAccessFromSql, fa as getWorkspaceTeamId, fr as searchReviewItems, gr as canActOnReviewItem, ji as proxyVercelSandboxEgressRequest, li as setDashboardConversationLinkOptions, lo as readLatestConversationBrief, mo as readConversationMessageEventSeq, oa as getSlackClient, pa as runWithWorkspaceTeamId, po as readConversationLastEventSeq, qi as openSlackModal, ri as getDashboardConversationLink, si as getDashboardTaskLink, ta as slackExternalRefIdSchema, tr as projectConversationMessages, uo as readConversationEventPage, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, wa as consumeSandboxEgressPermissionDeniedSignal } from "./projection-B6VS7kbo.js";
3
+ import { Y as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig } from "./config-CCPHvTqx.js";
4
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-D0svFM8r.js";
5
+ import { t as JUNIOR_VERSION } from "./version-EN3Wnq-R.js";
6
6
  import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
7
- import { B as recordGoogleSignIn, G as getConversationIdByProviderConversation, O as conversationKindFromRow, P as resolveActorIdentityId, S as withConversationMutationLock, a as getConversationStore, nt as touchConversationDetail, o as getDb, p as withConversationEventLock, r as getConversationEventStore, rt as createSlackDestination, s as getSqlExecutor, t as closeDb } from "./db-Dts2XvLu.js";
8
- import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-Ck73J0wP.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DgouZKZm.js";
10
- import { $ as readViewerAutomationSummary, $t as resumeConversationDelivery, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, I as checkSlackChannelReadAccess, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as recordSubagentEnded, S as createSlackReviewItemShow, St as markConversationRead, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as unpublishedArtifactHeaders, at as deliverReviewItemChange, bt as archiveConversation, dn as findAutomationSkill, fn as missingAutomationSkillReason, g as readPublicArtifact, gt as collectAttachmentGarbage, h as publicArtifactHeaders, j as verifySlackSignature, k as parseSlackUserInputSubmission, ln as processWorkspaceSnapshotJob, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, ot as renderReviewItemMessage, pt as recordWebConversationActivity, r as processBackgroundCompaction, rt as effectiveTaskOutcomes, st as reviewItemChangeRecord, t as createAgentRunner, tt as readViewerAutomations, un as ingestEvent, ut as conversationTurnIdForMessage, v as setConversationSubscription, vt as requestAttachmentDeletion, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, z as joinPublicChannel } from "./agent-runner-DjMTPWEO.js";
7
+ import { B as recordGoogleSignIn, G as getConversationIdByProviderConversation, O as conversationKindFromRow, P as resolveActorIdentityId, S as withConversationMutationLock, a as getConversationStore, nt as touchConversationDetail, o as getDb, p as withConversationEventLock, r as getConversationEventStore, rt as createSlackDestination, s as getSqlExecutor, t as closeDb } from "./db-C1M1y-bh.js";
8
+ import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-DUSEwXaO.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CpCmlD9L.js";
10
+ import { $ as readViewerAutomationSummary, $t as resumeConversationDelivery, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, I as checkSlackChannelReadAccess, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as recordSubagentEnded, S as createSlackReviewItemShow, St as markConversationRead, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as unpublishedArtifactHeaders, at as deliverReviewItemChange, bt as archiveConversation, dn as findAutomationSkill, fn as missingAutomationSkillReason, g as readPublicArtifact, gt as collectAttachmentGarbage, h as publicArtifactHeaders, j as verifySlackSignature, k as parseSlackUserInputSubmission, ln as processWorkspaceSnapshotJob, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, ot as renderReviewItemMessage, pt as recordWebConversationActivity, r as processBackgroundCompaction, rt as effectiveTaskOutcomes, st as reviewItemChangeRecord, t as createAgentRunner, tt as readViewerAutomations, un as ingestEvent, ut as conversationTurnIdForMessage, v as setConversationSubscription, vt as requestAttachmentDeletion, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, z as joinPublicChannel } from "./agent-runner-HoQiUKLL.js";
11
11
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
12
- import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-Bqkb678l.js";
13
- import { a as getStateAdapter, r as disconnectStateAdapter } from "./state-CO9ETDzk.js";
12
+ import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-Agxi_o5c.js";
13
+ import { a as getStateAdapter, r as disconnectStateAdapter } from "./state-C3CbtD_m.js";
14
14
  import { a as getNextRunAtMs } from "./schedule-cP0AACm1.js";
15
15
  import { J as conversationBriefSchema, O as conversationTitleSchema, P as annotationCard, b as conversationSurfaceSchema, p as conversationFeedQuerySchema, v as conversationReportStatusSchema } from "./conversation-CMkSmi02.js";
16
16
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
17
17
  import { n as readSchedulerSecret, r as readSignInSecret } from "./secrets-DebYU866.js";
18
- import { a as segmentGapsKey, f as MINUTE_MS, g as gapSegment, m as NO_REPLY_GAP_MS, n as GLOBAL_GAPS_MAX, p as MIN_WARMUP_PREFIX_TOKENS, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS } from "./warmup-h6u1e9n0.js";
19
- import { A as getQueueProvider, C as cacheWarmupQueueConsumer, O as queueCallback, T as registerVercelCacheWarmupDevConsumer, _ as resolveConversationWorkQueueTopic, b as conversationQueueMessageSchema, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as getVercelConversationWorkQueue, h as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as verifyConversationQueueMessage, w as createVercelCacheWarmupCallback, x as isConversationQueueMessageRejectedError } from "./background-compaction-queue-DUkHZjmL.js";
20
- import { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-BTSo6SMJ.js";
21
- import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, it as setExperimentalFeatures, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, nt as getExperimentalFeatures, rt as isExperimentalFeatureEnabled, z as renderTaskInput } from "./session-stop-DkxI5vc3.js";
18
+ import { a as segmentGapsKey, f as MINUTE_MS, g as gapSegment, m as NO_REPLY_GAP_MS, n as GLOBAL_GAPS_MAX, p as MIN_WARMUP_PREFIX_TOKENS, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS } from "./warmup-CY2ArYag.js";
19
+ import { A as getQueueProvider, C as cacheWarmupQueueConsumer, O as queueCallback, T as registerVercelCacheWarmupDevConsumer, _ as resolveConversationWorkQueueTopic, b as conversationQueueMessageSchema, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as getVercelConversationWorkQueue, h as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as verifyConversationQueueMessage, w as createVercelCacheWarmupCallback, x as isConversationQueueMessageRejectedError } from "./background-compaction-queue-Cre1wFt9.js";
20
+ import { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-pXhZ2wMK.js";
21
+ import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, it as setExperimentalFeatures, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, nt as getExperimentalFeatures, rt as isExperimentalFeatureEnabled, z as renderTaskInput } from "./session-stop-hYNTNpVf.js";
22
22
  import { _ as buttonUserInputField } from "./reporting-window-B3Ze-Qnt.js";
23
- import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-t-pmRdwS.js";
24
- import { _ as listActiveConversationIds, g as getConversationWorkState, h as getConversation, l as clearExpiredConversationLease, m as ensureConversationWake, r as appendAndEnqueueInboundMessage } from "./store-DgD78_NK.js";
25
- import { A as withScheduledAutomationLock, E as readScheduledAutomation, F as findMatchingEventAutomations, H as eventAutomationRunLimitReason, M as collectEventAutomationMatchKeys, O as saveScheduledAutomationInLock, Q as existingConversationId, V as admitEventAutomationRun, W as automationVersionOf, c as getDispatchConversationId, d as getDispatchRecord, gt as coerceThreadConversationState, h as listPendingDispatchMailboxAppends, i as buildDispatchId, j as blockEventAutomation, k as scheduledRunId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, ot as recordAutomationExecution, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, w as listScheduledAutomationsForTeam, x as notifyAutomationBlocked, xt as eventGuidance, y as markDispatchFailed } from "./task-runner-CKOj6xla.js";
23
+ import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-1owMH4qo.js";
24
+ import { _ as listActiveConversationIds, g as getConversationWorkState, h as getConversation, l as clearExpiredConversationLease, m as ensureConversationWake, r as appendAndEnqueueInboundMessage } from "./store-CZ9vqR4P.js";
25
+ import { $ as automationVersionOf, B as blockEventAutomation, C as listPendingDispatchMailboxAppends, Ct as eventGuidance, D as markDispatchFailed, F as readScheduledAutomation, L as saveScheduledAutomationInLock, N as listScheduledAutomationsForTeam, R as scheduledRunId, S as isTerminalDispatchStatus, V as collectEventAutomationMatchKeys, W as findMatchingEventAutomations, X as admitEventAutomationRun, Z as eventAutomationRunLimitReason, d as coerceThreadConversationState, f as buildDispatchId, g as getDispatchConversationId, h as createOrGetDispatch, ht as recordAutomationExecution, k as notifyAutomationBlocked, m as confirmDispatchMailboxAppend, st as existingConversationId, t as processPluginTask, x as getPluginDispatchProjection, y as getDispatchRecord, z as withScheduledAutomationLock } from "./task-runner-CMiNGsER.js";
26
26
  import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-yJX3C7i3.js";
27
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CXeYgBzq.js";
27
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Du7NdkOR.js";
28
28
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-HYh_JOdw.js";
29
29
  import { s as conversationPendingMessageDeliverySchema } from "./conversation-feed-BVAOga0H.js";
30
- import { $ as actOnReviewItem, A as createProductionConversationWorkOptions, B as clearSlackPendingReactions, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as isAllowedSignInEmail, G as createSlackWebApiStatusSender, H as stripLeadingBotMention, I as readEnvList, J as stopConversation, K as SubscribedReplyReason, L as resolveAllowedDomains, M as getProductionSlackAdapter, N as assertNoLegacyAllowedDomains, P as isAllowedDomain, Q as ReviewItemActionError, R as startProcessingReaction, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as normalizeIncomingSlackThreadId, V as slackInboundMessageId, W as withNormalizedThreadId, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, at as continueConversationInSlack, b as readConversationRecordFromSql, ct as archiveViewerDoneConversations, dt as setConversationAutoArchive, et as closeReviewItemsAnsweredByReply, ht as GET$4, i as readConversationFeed, it as canContinueInSlack, j as createProductionSlackWebhookServices, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as isMovableToSlack, q as getThreadStopDecision, rt as alreadyContinuesInSlackMessage, s as readConversationDetail, t as stopConversationTurnForViewer, tt as readReviewItemForUser, ut as runAutoArchiveSweep, w as decodeConversationCursor, z as buildSlackInboundMessage } from "./stop-CL-rdtQb.js";
31
- import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-yN_GAuXY.js";
32
- import { n as enqueueAgentInvocationResult } from "./result-DhgjR3nQ.js";
33
- import { o as unlinkProvider } from "./connections-CWaIVl_1.js";
34
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-BhbaZfmO.js";
30
+ import { $ as actOnReviewItem, A as createProductionConversationWorkOptions, B as clearSlackPendingReactions, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as isAllowedSignInEmail, G as createSlackWebApiStatusSender, H as stripLeadingBotMention, I as readEnvList, J as stopConversation, K as SubscribedReplyReason, L as resolveAllowedDomains, M as getProductionSlackAdapter, N as assertNoLegacyAllowedDomains, P as isAllowedDomain, Q as ReviewItemActionError, R as startProcessingReaction, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as normalizeIncomingSlackThreadId, V as slackInboundMessageId, W as withNormalizedThreadId, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, at as continueConversationInSlack, ct as archiveViewerDoneConversations, dt as setConversationAutoArchive, et as closeReviewItemsAnsweredByReply, ht as GET$4, i as readConversationFeed, it as canContinueInSlack, j as createProductionSlackWebhookServices, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as isMovableToSlack, q as getThreadStopDecision, rt as alreadyContinuesInSlackMessage, s as readConversationDetail, t as stopConversationTurnForViewer, tt as readReviewItemForUser, ut as runAutoArchiveSweep, w as decodeConversationCursor, y as readConversationRecordFromSql, z as buildSlackInboundMessage } from "./stop-Cze_pEL8.js";
31
+ import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-EA98F0ia.js";
32
+ import { n as enqueueAgentInvocationResult } from "./result-CEqQFrEf.js";
33
+ import { o as unlinkProvider } from "./connections-B5pWh8e2.js";
34
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DwLkIvXI.js";
35
35
  import { t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
36
- import { t as processConversationWork } from "./worker-Hl7N292I.js";
37
- import { t as bindMessageAgent } from "./message-CtaPzC7m.js";
38
- import { t as bindSpawnAgent } from "./spawn-BvULxIiu.js";
36
+ import { t as processConversationWork } from "./worker-BALVdWbv.js";
37
+ import { t as bindMessageAgent } from "./message-BFnIwKpx.js";
38
+ import { t as bindSpawnAgent } from "./spawn-YeqlNDv8.js";
39
39
  import { createRequire } from "node:module";
40
40
  import { Hono } from "hono";
41
41
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-DvnTPCfp.js";
2
- import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-9OAq-fdg.js";
1
+ import { i as getChatConfig } from "./config-CCPHvTqx.js";
2
+ import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-D0svFM8r.js";
3
3
  import { t as readJuniorSecret } from "./secrets-DebYU866.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
@@ -369,7 +369,7 @@ function cacheWarmupCallback() {
369
369
  maxDeliveries: 1,
370
370
  onRejected: logCacheWarmupRejected,
371
371
  run: async (message) => {
372
- const { runCacheWarmup } = await import("./warmup-h6u1e9n0.js").then((n) => n.o);
372
+ const { runCacheWarmup } = await import("./warmup-CY2ArYag.js").then((n) => n.o);
373
373
  await runCacheWarmup(message);
374
374
  },
375
375
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -558,7 +558,7 @@ function pluginTaskCallback() {
558
558
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
559
559
  onRejected: logPluginTaskQueueMessageRejected,
560
560
  run: async (message) => {
561
- const { processPluginTask } = await import("./task-runner-CKOj6xla.js").then((n) => n.r);
561
+ const { processPluginTask } = await import("./task-runner-CMiNGsER.js").then((n) => n.r);
562
562
  await processPluginTask(message);
563
563
  },
564
564
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,4 +1,4 @@
1
- import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-Cbq5b4SO.js";
1
+ import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CD11tfG8.js";
2
2
  import { W as briefCodeChangeSchema, Y as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema, q as briefResourceLabel } from "./conversation-CMkSmi02.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import path from "node:path";
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
262
262
  * token.
263
263
  */
264
264
  async function configuredBriefModelId() {
265
- const { botConfig } = await import("./config-DvnTPCfp.js").then((n) => n.r);
265
+ const { botConfig } = await import("./config-CCPHvTqx.js").then((n) => n.r);
266
266
  return botConfig.fastModelId;
267
267
  }
268
268
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-cbpOxO4M.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-CHewwYEo.js";
3
3
  // src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DjMTPWEO.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-HoQiUKLL.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-HYh_JOdw.js").then((n) => n.o),
102
- import("../projection-BzJQncZV.js").then((n) => n.jn),
103
- import("../catalog-runtime-DgouZKZm.js").then((n) => n.t),
104
- import("../validation-CXeYgBzq.js").then((n) => n.r),
105
- import("../db-Dts2XvLu.js").then((n) => n.n)
102
+ import("../projection-B6VS7kbo.js").then((n) => n.jn),
103
+ import("../catalog-runtime-CpCmlD9L.js").then((n) => n.t),
104
+ import("../validation-Du7NdkOR.js").then((n) => n.r),
105
+ import("../db-C1M1y-bh.js").then((n) => n.n)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,18 +152,18 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-BzJQncZV.js").then((n) => n.Wn);
155
+ const { setBriefsConfig } = await import("../projection-B6VS7kbo.js").then((n) => n.Wn);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-CHv9X9TH.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-C_LXY1d4.js");
157
+ const { runLocalAgentTurn } = await import("../runner-BtWvJslp.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BXRtD6Fk.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-CsfIazeF.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Yy3fSCbg.js");
161
- const { bindSpawnAgent } = await import("../spawn-BvULxIiu.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-CtaPzC7m.js").then((n) => n.n);
163
- const { createChildConversationWorker } = await import("../result-DhgjR3nQ.js").then((n) => n.i);
164
- const { skipInputAfterConversationStop } = await import("../session-stop-DkxI5vc3.js").then((n) => n.a);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-ByftwJVt.js");
161
+ const { bindSpawnAgent } = await import("../spawn-YeqlNDv8.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-BFnIwKpx.js").then((n) => n.n);
163
+ const { createChildConversationWorker } = await import("../result-CEqQFrEf.js").then((n) => n.i);
164
+ const { skipInputAfterConversationStop } = await import("../session-stop-hYNTNpVf.js").then((n) => n.a);
165
165
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
166
- const { processConversationWork } = await import("../worker-Hl7N292I.js").then((n) => n.n);
166
+ const { processConversationWork } = await import("../worker-BALVdWbv.js").then((n) => n.n);
167
167
  let agentRunner;
168
168
  const localConversationWork = createLocalConversationWork(async (message) => {
169
169
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-9OAq-fdg.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-cbpOxO4M.js";
3
- import { i as parseSkillFile } from "../skills-BZE2DP8I.js";
1
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-D0svFM8r.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-CHewwYEo.js";
3
+ import { i as parseSkillFile } from "../skills-DXgd5Inh.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -45,13 +45,13 @@ async function runChat(argv, pluginSet) {
45
45
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
46
46
  }
47
47
  async function runAdmin(argv) {
48
- return await (await import("../admin-ifgjyfpF.js")).runAdmin(argv);
48
+ return await (await import("../admin-z_lgDi-z.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-C4rBP8ne.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-BZEuMKdo.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-CbNYM-q2.js")).runBriefs(argv);
54
+ return await (await import("../briefs-BXECHduJ.js")).runBriefs(argv);
55
55
  }
56
56
  function topLevelCommand(argv) {
57
57
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { Hn as validatePlugins, Vn as setPlugins, Xa as createPluginLogger } from "../projection-BzJQncZV.js";
2
- import { o as getDb } from "../db-Dts2XvLu.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DgouZKZm.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CXeYgBzq.js";
1
+ import { Hn as validatePlugins, Vn as setPlugins, Xa as createPluginLogger } from "../projection-B6VS7kbo.js";
2
+ import { o as getDb } from "../db-C1M1y-bh.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-CpCmlD9L.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Du7NdkOR.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { Ti as create, ja as SANDBOX_RUNTIME } from "../projection-BzJQncZV.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DgouZKZm.js";
3
- import { r as disconnectStateAdapter } from "../state-CO9ETDzk.js";
4
- import { n as resolve } from "../resolve-t-pmRdwS.js";
1
+ import { Ti as create, ja as SANDBOX_RUNTIME } from "../projection-B6VS7kbo.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-CpCmlD9L.js";
3
+ import { r as disconnectStateAdapter } from "../state-C3CbtD_m.js";
4
+ import { n as resolve } from "../resolve-1owMH4qo.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
7
7
  function progressMessage(phase) {
@@ -1,4 +1,4 @@
1
- import "../db-CCUqQe0E.js";
1
+ import "../db-B3iyr_Or.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-DvnTPCfp.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-Ck73J0wP.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-cbpOxO4M.js";
1
+ import { i as getChatConfig } from "../config-CCPHvTqx.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-DUSEwXaO.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-CHewwYEo.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -1,6 +1,6 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-9OAq-fdg.js";
3
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DPjv4SnA.js";
2
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-D0svFM8r.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-CZD5soDW.js";
4
4
  import { AwsClient } from "aws4fetch";
5
5
  import { del, get, put } from "@vercel/blob";
6
6
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
@@ -906,6 +906,22 @@ function payloadAttributes(payload) {
906
906
  * expired cache. Also counts and estimates the request's images.
907
907
  * Pass the payload that Pi gives to `onPayload`. Never throws: telemetry must
908
908
  * not fail the request.
909
+ *
910
+ * To classify a cache miss, compare a `gen_ai.chat` span with the previous
911
+ * call in the same `gen_ai.conversation.id`:
912
+ * 1. `prefix.before_last_reply.hash` differs from the previous
913
+ * `prefix.hash`: Junior changed the prefix. The system or tools hash shows
914
+ * a prompt or tool change; `thinking.type` or `effort` shows a settings
915
+ * change; with all part hashes equal, the model or a thinking budget
916
+ * changed. `messages.before_last_reply.hash` not equal to the previous
917
+ * `messages.hash` means a history rewrite, expected with
918
+ * `gen_ai.conversation.compacted`.
919
+ * 2. Equal, with a gap of 5 minutes or more: the cache expired.
920
+ * 3. Equal, with a shorter gap: the provider or the gateway did not use it.
921
+ *
922
+ * `images.estimate` is the only per-image number, because Anthropic usage has
923
+ * no per-image split. Check it against the change in
924
+ * `gen_ai.usage.input_tokens` from the previous call.
909
925
  */
910
926
  function requestPrefixAttributes(payload) {
911
927
  if (typeof payload !== "object" || payload === null) return {};
@@ -1,9 +1,9 @@
1
- import { Ii as startOAuthFlow } from "./projection-BzJQncZV.js";
2
- import { n as botConfig } from "./config-DvnTPCfp.js";
3
- import { I as deleteProviderIdentityForSlackUser, L as deleteProviderIdentityForUser, s as getSqlExecutor } from "./db-Dts2XvLu.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-cbpOxO4M.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DgouZKZm.js";
6
- import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-DjMTPWEO.js";
1
+ import { Ii as startOAuthFlow } from "./projection-B6VS7kbo.js";
2
+ import { n as botConfig } from "./config-CCPHvTqx.js";
3
+ import { I as deleteProviderIdentityForSlackUser, L as deleteProviderIdentityForUser, s as getSqlExecutor } from "./db-C1M1y-bh.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-CHewwYEo.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CpCmlD9L.js";
6
+ import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-HoQiUKLL.js";
7
7
  import { randomBytes } from "node:crypto";
8
8
  // src/handlers/oauth-html.ts
9
9
  /** Build pre-escaped callback HTML with the shared response security policy. */
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-9OAq-fdg.js";
1
+ import { h as logWarn } from "./logging-D0svFM8r.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,20 +1,20 @@
1
- import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Fi as resolveBaseUrl, Ni as formatProviderLabel, Pi as parseOAuthStatePayload, Yi as postSlackMessage, Z as getConversationPendingAuth, d as recordAuthorizationCompleted, oa as getSlackClient, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-BzJQncZV.js";
2
- import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-DvnTPCfp.js";
3
- import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-9OAq-fdg.js";
1
+ import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Fi as resolveBaseUrl, Ni as formatProviderLabel, Pi as parseOAuthStatePayload, Yi as postSlackMessage, Z as getConversationPendingAuth, d as recordAuthorizationCompleted, oa as getSlackClient, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-B6VS7kbo.js";
2
+ import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-CCPHvTqx.js";
3
+ import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-D0svFM8r.js";
4
4
  import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
5
- import { H as upsertLinkedIdentity, P as resolveActorIdentityId, R as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-Dts2XvLu.js";
5
+ import { H as upsertLinkedIdentity, P as resolveActorIdentityId, R as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-C1M1y-bh.js";
6
6
  import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
7
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-cbpOxO4M.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DgouZKZm.js";
9
- import { t as discoverSkills } from "./skills-BZE2DP8I.js";
10
- import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-DjMTPWEO.js";
7
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CHewwYEo.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CpCmlD9L.js";
9
+ import { t as discoverSkills } from "./skills-DXgd5Inh.js";
10
+ import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-HoQiUKLL.js";
11
11
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
12
- import { o as readIdentityById } from "./viewer-Bqkb678l.js";
13
- import { a as getStateAdapter } from "./state-CO9ETDzk.js";
12
+ import { o as readIdentityById } from "./viewer-Agxi_o5c.js";
13
+ import { a as getStateAdapter } from "./state-C3CbtD_m.js";
14
14
  import { t as readJuniorSecret } from "./secrets-DebYU866.js";
15
- import { gt as coerceThreadConversationState, pt as getPersistedThreadState } from "./task-runner-CKOj6xla.js";
16
- import { _ as getMcpProviderErrorAttributes } from "./service-account-DjPIwCMj.js";
17
- import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-CWaIVl_1.js";
15
+ import { c as getPersistedThreadState, d as coerceThreadConversationState } from "./task-runner-CMiNGsER.js";
16
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-DLoeoHww.js";
17
+ import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-B5pWh8e2.js";
18
18
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CsfIazeF.js";
19
19
  import path from "node:path";
20
20
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import "./schema-TSEisVJR.js";
1
+ import "./schema-Ct1Zf2xy.js";
2
2
  import * as z from "zod";
3
3
  import "drizzle-orm";
4
4
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
@@ -1,8 +1,8 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { i as getChatConfig } from "./config-DvnTPCfp.js";
3
- import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-9OAq-fdg.js";
2
+ import { i as getChatConfig } from "./config-CCPHvTqx.js";
3
+ import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-D0svFM8r.js";
4
4
  import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-6jsm_v96.js";
5
- import { A as juniorConversations, C as isUserInstruction, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-Ck73J0wP.js";
5
+ import { A as juniorConversations, C as isUserInstruction, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-DUSEwXaO.js";
6
6
  import { d as historyReplacementSchema, f as newConversationEventSchema, p as encodeHistoryPayload, s as conversationEventDataSchema, u as decodeStoredConversationEvent, y as usageSchema } from "./media-BepyEUNm.js";
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
@@ -860,9 +860,9 @@ const ROOT = {
860
860
  reviewDesk: true,
861
861
  subscriptions: true,
862
862
  userCustomization: true,
863
- reportBlocked: false,
864
- noReply: true,
865
- finishAutomationRun: false
863
+ reply: false,
864
+ reportBlocked: "none",
865
+ noReply: true
866
866
  }
867
867
  };
868
868
  const PERSON_IN_THREAD = {
@@ -881,9 +881,9 @@ const AGENT_IN_CHILD = {
881
881
  reviewDesk: false,
882
882
  subscriptions: false,
883
883
  userCustomization: false,
884
- reportBlocked: true,
885
- noReply: true,
886
- finishAutomationRun: false
884
+ reply: false,
885
+ reportBlocked: "parent",
886
+ noReply: true
887
887
  }
888
888
  };
889
889
  const AUTOMATION_RUN = {
@@ -892,19 +892,14 @@ const AUTOMATION_RUN = {
892
892
  gated: true,
893
893
  tools: {
894
894
  ...ROOT.tools,
895
- noReply: false,
896
- finishAutomationRun: true
895
+ reply: true,
896
+ reportBlocked: "automation"
897
897
  }
898
898
  };
899
- /**
900
- * Return the behavior of one Turn. `automationRun` marks the dispatch Turn of
901
- * a Scheduled or Event automation run. Kind alone cannot mark it: the
902
- * dispatch Turn is the only gated Turn on an `automation` Conversation, and a
903
- * person's reply or a Watch Event Turn there runs like a Turn on a root.
904
- */
899
+ /** Return the behavior of one Turn. */
905
900
  function turnBehavior(args) {
906
- if (args.automationRun) return AUTOMATION_RUN;
907
- if (isTopLevelKind(args.kind)) return ROOT;
901
+ if (args.kind === "root") return ROOT;
902
+ if (args.kind === "automation") return args.personInput ? ROOT : AUTOMATION_RUN;
908
903
  if (!args.personInput) return AGENT_IN_CHILD;
909
904
  if (args.kind === "thread") return PERSON_IN_THREAD;
910
905
  throw new Error("A task Conversation cannot have a person's input");
@@ -930,8 +925,8 @@ function deliversFinalText(dispatch) {
930
925
  * Return whether the runtime may post a failure reply or a status notice,
931
926
  * such as an auth prompt, for a run outside `finishedRunReply`. The rule is
932
927
  * the same as for a final response. A chat Turn may post, also in a thread
933
- * that an Automation Conversation owns. An Automation run posts only a
934
- * declared message; its failed execution shows on the Automation.
928
+ * that an Automation Conversation owns. An Automation run posts only its
929
+ * `reply` text; its failed execution shows on the Automation.
935
930
  */
936
931
  function postsRunNotices(dispatch) {
937
932
  return deliversFinalText(dispatch);
@@ -993,8 +988,7 @@ function destinationUpsertFromDestination(args) {
993
988
  };
994
989
  }
995
990
  function executionStatusFromValue(value) {
996
- if (value === "awaiting_resume" || value === "paused") return "paused";
997
- if (value === "failed" || value === "idle" || value === "pending" || value === "running") return value;
991
+ if (value === "failed" || value === "idle" || value === "paused" || value === "pending" || value === "running") return value;
998
992
  throw new Error("Conversation record execution status is invalid");
999
993
  }
1000
994
  function destinationFromRow(destination) {
@@ -1,6 +1,6 @@
1
1
  import { _ as withScope } from "./sentry-BRTJqumy.js";
2
- import "./config-DvnTPCfp.js";
3
- import { h as logWarn, p as logException } from "./logging-9OAq-fdg.js";
2
+ import "./config-CCPHvTqx.js";
3
+ import { h as logWarn, p as logException } from "./logging-D0svFM8r.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { sql } from "drizzle-orm";
6
6
  import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
@@ -895,6 +895,12 @@ async function applyMigrations(executor, config) {
895
895
  }
896
896
  // src/db/neon.ts
897
897
  const POOL_MAX = 10;
898
+ function toConnectError(error) {
899
+ if (error instanceof Error) return error;
900
+ const event = error ?? {};
901
+ const reason = typeof event.message === "string" && event.message || event.error instanceof Error && event.error.message || typeof event.type === "string" && event.type || String(error);
902
+ return new Error(`WebSocket connect failed: ${reason}`, event.error === void 0 ? void 0 : { cause: event.error });
903
+ }
898
904
  /**
899
905
  * Sends a pool query over Neon's SQL-over-HTTP endpoint when no idle
900
906
  * WebSocket client is free.
@@ -915,7 +921,7 @@ var OverflowPool = class extends Pool {
915
921
  super({
916
922
  connectionString: args.connectionString,
917
923
  max: POOL_MAX,
918
- idleTimeoutMillis: 6e4,
924
+ idleTimeoutMillis: 3e5,
919
925
  min: 1,
920
926
  statement_timeout: args.statementTimeoutMs
921
927
  });
@@ -950,7 +956,7 @@ var OverflowPool = class extends Pool {
950
956
  client.release();
951
957
  return;
952
958
  }
953
- logException(error, "db.pool.client.connect_failed", { "app.db.driver": "neon" });
959
+ logException(toConnectError(error), "db.pool.client.connect_failed", { "app.db.driver": "neon" });
954
960
  });
955
961
  }
956
962
  /** Keep every pool query in `callback` on WebSocket. */
@@ -1,6 +1,6 @@
1
1
  import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-BRTJqumy.js";
2
- import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-9OAq-fdg.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DPjv4SnA.js";
2
+ import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-D0svFM8r.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-CZD5soDW.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
6
6
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
@@ -103,6 +103,23 @@ function createGatewayRequestTimingHandlers() {
103
103
  * AI Gateway model requests onto their `gen_ai.chat` span. Telemetry must not
104
104
  * fail a request, so handler errors are dropped. Returns a function that
105
105
  * removes the subscriptions.
106
+ *
107
+ * To find where time went before the gateway saw a request, get the gateway
108
+ * latency for `gen_ai.response.id` from the AI Gateway generation API, then
109
+ * compare the phases:
110
+ * - High `queue_ms` on a reused socket, or high
111
+ * `app.ai.event_loop.utilization`: the process was busy or the pool was
112
+ * full. With a new socket, `queue_ms` includes the connect time.
113
+ * - High `connect_ms`: DNS, TCP, or TLS was slow. It is absent on a reused
114
+ * socket. It is best effort: overlapping connects to the same host usually
115
+ * record none.
116
+ * - High `body_send_ms`: the upload was slow.
117
+ * - `response_wait_ms` much larger than the gateway time to first token,
118
+ * with small Junior phases: the delay was in the network or at the Vercel
119
+ * edge. The gateway sends headers with the first token. Give Vercel
120
+ * `app.ai.gateway.vercel_id`.
121
+ * - The same `service.instance.id` on more than one slow call: they shared
122
+ * one process.
106
123
  */
107
124
  function subscribeGatewayRequestTiming() {
108
125
  const handlers = Object.entries(createGatewayRequestTimingHandlers()).map(([name, handler]) => [name, (message) => {
@@ -1,5 +1,5 @@
1
1
  import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-BRTJqumy.js";
2
- import { t as JUNIOR_VERSION } from "./version-AQa7Fr2H.js";
2
+ import { t as JUNIOR_VERSION } from "./version-EN3Wnq-R.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Cn as renderUntrustedTag, Za as canAccessConversation, eo as readConversationAccessFromSql } from "./projection-BzJQncZV.js";
3
- import { n as botConfig } from "./config-DvnTPCfp.js";
4
- import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-Dts2XvLu.js";
5
- import { hn as toolInvocationDestination, in as AgentMessageTargetError, mn as actorFromRun, nn as AgentMessagePausedError } from "./agent-runner-DjMTPWEO.js";
6
- import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-BTSo6SMJ.js";
7
- import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-DkxI5vc3.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-DgD78_NK.js";
9
- import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-yN_GAuXY.js";
10
- import { r as enqueueAgentMessageToParent } from "./result-DhgjR3nQ.js";
2
+ import { Cn as renderUntrustedTag, Za as canAccessConversation, eo as readConversationAccessFromSql } from "./projection-B6VS7kbo.js";
3
+ import { n as botConfig } from "./config-CCPHvTqx.js";
4
+ import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-C1M1y-bh.js";
5
+ import { hn as toolInvocationDestination, in as AgentMessageTargetError, mn as actorFromRun, nn as AgentMessagePausedError } from "./agent-runner-HoQiUKLL.js";
6
+ import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-pXhZ2wMK.js";
7
+ import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-hYNTNpVf.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-CZ9vqR4P.js";
9
+ import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-EA98F0ia.js";
10
+ import { r as enqueueAgentMessageToParent } from "./result-CEqQFrEf.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-uiTzRbvq.js";
1
+ import { i as JuniorDashboardOptions } from "./app-C75Ft-A_.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];