@sentry/junior 0.308.0 → 0.310.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 (89) hide show
  1. package/dist/{actor-D2iXzvlN.js → actor-BsBdxDXQ.js} +0 -1
  2. package/dist/{adapter-context-BO432242.js → adapter-context-BhKpjpGD.js} +2 -2
  3. package/dist/{admin-vSmheo3Z.js → admin-tgZEZAk2.js} +2 -2
  4. package/dist/{agent-runner-BnOofGFG.js → agent-runner-D9cvNlQl.js} +245 -204
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.d.ts +4 -2
  8. package/dist/api.js +416 -272
  9. package/dist/{app-CqYqy541.d.ts → app-B_7Wn0en.d.ts} +4 -6
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +74 -193
  12. package/dist/{background-compaction-queue-BpmDEQf6.js → background-compaction-queue-BGHqkhkY.js} +4 -4
  13. package/dist/{briefs-Dbh94cRp.js → briefs-DKxkoruh.js} +3 -3
  14. package/dist/{catalog-runtime-q9AJjuUN.js → catalog-runtime-BxwzbLKY.js} +1 -1
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +10 -10
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +5 -5
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-Cx8H0MRw.js → config-Dkt2Le2b.js} +51 -92
  23. package/dist/{continue-in-slack-CtTv1tkn.js → continue-in-slack-BWVwePKD.js} +6 -6
  24. package/dist/{conversation--f85g4zL.js → conversation-M9KZ5JxF.js} +7 -2
  25. package/dist/{conversation-feed-BNs9KiqC.js → conversation-feed-Ci6YD1N-.js} +1 -1
  26. package/dist/{conversation-privacy-CivmFlWP.js → conversation-privacy-C39g8BY4.js} +1 -1
  27. package/dist/{conversation-turn-C9-Nfnsy.js → conversation-turn-CBlZIH02.js} +20 -21
  28. package/dist/{credential-sync-CWIORwD9.js → credential-sync-vGnrB0BY.js} +31 -23
  29. package/dist/{db-C41UgdBj.d.ts → db-B4Hjxr-u.d.ts} +2 -2
  30. package/dist/{db-CO6Y10eM.js → db-CFZggNoy.js} +20 -10
  31. package/dist/{executor-Doo-N6Yn.js → executor-BPkZDx5-.js} +12 -4
  32. package/dist/fan-out-Cod-yEHG.js +10 -0
  33. package/dist/{history-N7IVbUom.js → history-CYstOMKX.js} +6 -0
  34. package/dist/{connections-DUylBPiR.js → html-2r2KmLwi.js} +146 -11
  35. package/dist/{install-Y2s9ZPvk.js → install-C-oE6C_u.js} +2 -2
  36. package/dist/instrumentation.js +2 -2
  37. package/dist/{lineage-BcqyhMyp.js → lineage-CsvrEFQe.js} +2 -2
  38. package/dist/{logging-DnBYBM8z.js → logging-D5gkyvnK.js} +1 -1
  39. package/dist/{message-fSnXIqvl.js → message-DwvJ-I3w.js} +8 -8
  40. package/dist/{model-input-DRChpXJ7.js → model-input-MAq2881y.js} +15 -10
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +4 -4
  43. package/dist/{oauth-callback-server-BUU6zd_T.js → oauth-callback-server-DIF6Li06.js} +2 -2
  44. package/dist/{oauth-relay-gO_Ynmpb.js → oauth-relay-DPE-wrwO.js} +1 -1
  45. package/dist/{package-discovery-x4AvVhMj.js → package-discovery-DD9vencX.js} +0 -1
  46. package/dist/{projection-Bqn6zdVT.js → projection-jZSlEAXG.js} +116 -123
  47. package/dist/{prompt-DAjjk5fm.js → prompt-CaMyeCpA.js} +25 -14
  48. package/dist/{registry-tHJLCtKS.js → registry-BBkWFCl8.js} +3 -3
  49. package/dist/{resolve-z2sKt8xM.js → resolve-B38MkHXE.js} +3 -3
  50. package/dist/{result-D2wshngt.js → result-BaqSZcJb.js} +12 -13
  51. package/dist/{runner-BvNPWLAy.js → runner-11h8PrHh.js} +10 -10
  52. package/dist/{sandbox-egress-signals-CmHD-6vr.js → sandbox-egress-signals-CTcACAtJ.js} +1 -1
  53. package/dist/{schedule-BG1tEbRF.js → schedule-DWxZ3kja.js} +1 -1
  54. package/dist/{schema-CRXcj4fj.d.ts → schema-DriSvB40.d.ts} +43 -43
  55. package/dist/{schema-D4jdesIu.js → schema-obw5jvR4.js} +65 -28
  56. package/dist/{service-account-B2d1Er_r.js → service-account-Bx93N1n1.js} +3 -3
  57. package/dist/{service-account-CddxU-yC.js → service-account-Zc5bUcIJ.js} +7 -8
  58. package/dist/{session-stop-BQ0J0Fph.js → session-stop-BfY4rhJs.js} +179 -199
  59. package/dist/{skills-Dm2-5nn5.js → skills-C8Npu5zO.js} +99 -57
  60. package/dist/{slack-conversation-unfurl-CLH0tTLk.js → slack-conversation-unfurl-DlRVA02H.js} +18 -15
  61. package/dist/{spawn-PwAuSN59.js → spawn-CXr58R0x.js} +6 -6
  62. package/dist/{state-rXH58smZ.js → state-CGrGVeQC.js} +4 -4
  63. package/dist/{stop-CcHPEcFE.js → stop-DYzjRf2U.js} +176 -135
  64. package/dist/{store-7QA00oK6.js → store-D4FQ1Nml.js} +5 -5
  65. package/dist/{task-queue-DvQZH5rG.js → task-queue-CaZffYaH.js} +7 -4
  66. package/dist/{task-runner-CyZMcuZy.js → task-runner-Dm7BHbGp.js} +11 -12
  67. package/dist/{thread-context-C-hLTQST.js → thread-context-Dyj1KWaY.js} +13 -11
  68. package/dist/{turn-session-routing-Cqjj1B3i.js → turn-session-routing-CD0BRCex.js} +4 -4
  69. package/dist/{turn-user-message-DbU7MNd9.js → turn-user-message-9IxeEv5v.js} +14 -5
  70. package/dist/{queue-CbEHUO0l.d.ts → types-fnU7Xs__.d.ts} +3 -1
  71. package/dist/{users-B-UpCmw9.js → users-CaUAYMb3.js} +1 -1
  72. package/dist/{validation-BEUlev32.js → validation-DxVNIxA0.js} +1 -1
  73. package/dist/{version-BE1OyrXV.js → version-Cr7Z71yG.js} +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/{viewer-CqOkWizK.js → viewer-AHldghAD.js} +7 -5
  76. package/dist/{warmup-HFgFZFwS.js → warmup-C6LOZ2d2.js} +138 -80
  77. package/dist/{worker-CCEDWbsY.js → worker-CUBtu1Li.js} +8 -8
  78. package/migrations/0121_people_list_metric_index.sql +1 -0
  79. package/migrations/0122_automation_rollout_repair.sql +56 -0
  80. package/migrations/0123_cache_warming_history_reset.sql +10 -0
  81. package/migrations/0124_artifact_visibility.sql +9 -0
  82. package/migrations/0125_artifact_public_sha_index.sql +1 -0
  83. package/migrations/meta/0121_snapshot.json +5481 -0
  84. package/migrations/meta/0122_snapshot.json +5481 -0
  85. package/migrations/meta/0123_snapshot.json +5481 -0
  86. package/migrations/meta/0124_snapshot.json +5516 -0
  87. package/migrations/meta/0125_snapshot.json +5516 -0
  88. package/migrations/meta/_journal.json +35 -0
  89. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
1
  import { n as JuniorPluginSet } from "./plugins-fBrz8PCV.js";
2
- import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-CbEHUO0l.js";
3
- import "./schema-CRXcj4fj.js";
4
- import { t as ConversationStore } from "./db-C41UgdBj.js";
2
+ import { n as ConversationQueueMessage, r as ConversationWorkQueue, t as WaitUntilFn } from "./types-fnU7Xs__.js";
3
+ import "./schema-DriSvB40.js";
4
+ import { t as ConversationStore } from "./db-B4Hjxr-u.js";
5
5
  import "./sentry-DrKC2NeM.js";
6
6
  import { Hono } from "hono";
7
7
  import * as z from "zod";
@@ -9,8 +9,8 @@ import "@earendil-works/pi-ai/compat";
9
9
  import "@earendil-works/pi-ai/api/anthropic-messages";
10
10
  import "ai";
11
11
  import "@earendil-works/pi-ai";
12
- import "drizzle-orm";
13
12
  import { Destination } from "@sentry/junior-plugin-api";
13
+ import "drizzle-orm";
14
14
  import "@earendil-works/pi-agent-core";
15
15
  import "@modelcontextprotocol/sdk/client/auth.js";
16
16
  import "@modelcontextprotocol/sdk/client";
@@ -223,8 +223,6 @@ interface VercelConversationWorkCallbackOptions extends ProcessConversationQueue
223
223
  visibilityTimeoutSeconds?: number;
224
224
  }
225
225
  type ConversationWorkCallbackOptions = VercelConversationWorkCallbackOptions;
226
- /** Callback to schedule background work that must finish before the function exits. */
227
- type WaitUntilFn = (task: Promise<unknown> | (() => Promise<unknown>)) => void;
228
226
  interface JuniorDashboardOptions {
229
227
  /** Browser auth route prefix used by Better Auth. */
230
228
  authPath?: string;
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-CqYqy541.js";
1
+ import { i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-B_7Wn0en.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-fBrz8PCV.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,46 +1,46 @@
1
- import { $i as proxyVercelSandboxEgressRequest, $o as listPendingDispatchMailboxAppends, $r as reviewItemReaderForUser, $s as scheduledRunId, Ai as verifySlackDirectCredentialSubject, Ao as createConversationEmbedder, At as hasRunnableConversationWork, C as settleConversationTitleWork, Ca as normalizeSandboxEgressTracePropagationDomains, Cc as eventAutomationRunLimitReason, Ci as takeDueTimerWatches, Di as bindSlackDirectCredentialSubject, Dn as getPluginApiRoutes, Do as resolveRootVisibility, Dr as createPluginReviewItems, Ei as bindScheduledAutomationCredentialSubject, Er as projectConversationMessages, Es as isDmChannel, Fn as setPlugins, Go as createOrGetDispatch, Hn as setEventEmbeddingsConfig, Ho as buildDispatchId, In as validatePlugins, It as pruneActiveConversation, Js as listScheduledAutomationsForTeam, Ko as getDispatchConversationId, Mi as createPluginState, Mr as dismissOpenReviewItems, Mt as isInvalidConversationRecordError, Nn as getPlugins, No as createPluginAnnotations, Ns as getWorkspaceTeamId, Oa as createPluginEmbedder, Oc as eventGuidance, Oi as verifyEventAutomationCredentialSubject, On as getPluginRoutes, Po as listConversationAnnotations, Ps as runWithWorkspaceTeamId, Qi as isVercelSandboxEgressRequest, Qo as isTerminalDispatchStatus, Qs as saveScheduledAutomationInLock, Rn as isBriefsEnabled, Sc as admitEventAutomationRun, So as requestAttachmentDeletion, Ti as bindEventAutomationCredentialSubject, Tn as createPluginEventPublisher, Ua as createPluginLogger, Ur as canActOnReviewItem, Vn as setBriefsConfig, Vs as slackMention, Wo as confirmDispatchMailboxAppend, Xs as readScheduledAutomation, Yc as existingConversationId, Yo as getDispatchRecord, Zo as getPluginDispatchProjection, _ as appendConversationMessages, _a as consumeSandboxEgressPermissionDeniedSignal, _l as getConfigDefaults, ac as getDashboardReviewItemLink, al as refreshAutomationLastRun, as as notifyAutomationBlocked, bn as createUserTokenStore, dc as setDashboardConversationLinkOptions, dl as createPluginCache, ds as postSlackEphemeralMessage, ec as withScheduledAutomationLock, ei as reviewItemReaderForUserInConversation, fc as blockEventAutomation, ga as consumeSandboxEgressAuthRequiredSignal, gc as findMatchingEventAutomations, ha as clearSandboxEgressSignals, hi as collectEventMatchKeys, il as recordAutomationExecution, io as readConversationEventPageAfter, ki as verifyScheduledAutomationCredentialSubject, ko as backfillConversationEmbeddings, lt as CONVERSATION_WORK_STALE_ENQUEUE_MS, oi as createCodeChangePublisher, oo as readConversationLastEventSeq, pc as collectEventAutomationMatchKeys, qa as readConversationAccessFromSql, ra as resolveBaseUrl, ro as readConversationEventPage, rs as markDispatchFailed, sc as getDashboardTaskLink, so as readConversationMessageEventSeq, tc as getDashboardConversationLink, us as openSlackModal, vl as setConfigDefaults, vo as collectAttachmentGarbage, vs as slackEntitySchema, ws as getSlackClient, ya as parseSandboxEgressCredentialToken, yi as findMatchingWatches, ys as slackExternalRefIdSchema, zc as automationVersionOf, zr as searchReviewItems } from "./projection-Bqn6zdVT.js";
2
- import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, p as setBotName, u as resetRuntimeConfig, ut as getAttachmentStorage } from "./config-Cx8H0MRw.js";
3
- import { $ as getStateAdapter, C as withConversationMutationLock, Et as createSlackDestination, G as recordGoogleSignIn, I as resolveActorIdentityId, Tt as touchConversationDetail, Z as disconnectStateAdapter, a as getConversationStore, at as withLock, it as fenceLock, lt as conversationCostOf, m as withConversationEventLock, nt as MUTATION_LOCK_TTL_MS, o as getDb, p as deleteMessageLinks, r as getConversationEventStore, s as getSqlExecutor, t as closeDb } from "./db-CO6Y10eM.js";
4
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, G as normalizeIdentityEmail, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, U as GOOGLE_IDENTITY_PROVIDER, 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-DnBYBM8z.js";
5
- import { A as resumeConversationDelivery, C as parseSlackReviewItemClick, E as parseSlackUserInputSubmission, S as buildSlackReviewItemModal, _ as createSlackReviewItemShow, b as findSlackThreadOwnerId, d as publicArtifactHeaders, f as readPublicArtifact, g as scheduledAutomationRunAttributes, h as logScheduledAutomationRunSkipped, n as executeAgentRun, p as unpublishedArtifactHeaders, r as processBackgroundCompaction, t as createAgentRunner, v as resolveSlackReviewItemCardConversationId, w as parseSlackReviewItemFormTarget, y as syncReviewItemSlackCards } from "./agent-runner-BnOofGFG.js";
6
- import { E as getAuthPausedConversationTurnId, G as isAllowedDomain, J as resolveEventAuthor, K as isTrustedSlackAuthor, U as eventAuthorText, W as findTrustedUser, X as resolveBotSlackTeamId, Y as setTrustConfig, Z as renderTaskInput, _t as slackChannelMessageEvent, at as decodeAnnotationRef, b as deletePlanItems, dt as getExperimentalFeatures, ft as isExperimentalFeatureEnabled, ht as SLACK_EVENT_NAMESPACE, it as annotationKeyDigest, mt as getEventCatalog, pt as setExperimentalFeatures, q as parseEmail, rt as renderSlackObjectCard, vt as slackChannelMessageReplyThreadTs, yt as slackChannelMessageRunsAutomation } from "./session-stop-BQ0J0Fph.js";
7
- import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-Y2s9ZPvk.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-q9AJjuUN.js";
9
- import { $ as publicAddressLookup, A as actOnReviewItem, C as encodeConversationCursor, F as runAutoArchiveSweep, I as setConversationAutoArchive, J as readObjectLinkTypes, M as readReviewItemForUser, N as reviewItemChange, O as stopConversation, P as archiveViewerDoneConversations, Q as isPublicAddress, S as decodeConversationCursor, T as readConversationPendingMessages, U as backfillCacheWarmingGaps, V as runSavingsRefillSlice, W as GET$4, _t as SubscribedReplyReason, at as slackInboundMessageId, b as createConversationForViewer, dt as recordSkippedConversationMessage, et as createProductionConversationWorkOptions, ft as createSlackWebApiStatusSender, gt as parseContent, ht as stripLeadingBotMention, i as readConversationFeed, it as clearSlackPendingReactions, j as closeReviewItemsAnsweredByReply, k as ReviewItemActionError, l as readConversationDetail, lt as enqueueAgentDispatch, mt as startProcessingReaction, n as steerConversationPendingMessagesForViewer, nt as getProductionSlackAdapter, ot as normalizeIncomingSlackThreadId, pt as bindMessageAuthorIdentityId, rt as buildSlackInboundMessage, s as pinConversation, st as withNormalizedThreadId, t as stopConversationTurnForViewer, tt as createProductionSlackWebhookServices, ut as failStoppedDispatch, v as readConversationRecordFromSql, vt as getThreadStopDecision, w as cancelConversationPendingMessagesForViewer, y as appendConversationMessageForViewer } from "./stop-CcHPEcFE.js";
10
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BEUlev32.js";
1
+ import { $s as readScheduledAutomation, Ai as bindSlackDirectCredentialSubject, An as getPluginRoutes, Ao as resolveRootVisibility, Bn as isBriefsEnabled, Dn as createPluginEventPublisher, Ds as getSlackClient, Ea as normalizeSandboxEgressTracePropagationDomains, Ec as eventAutomationRunLimitReason, Ei as takeDueTimerWatches, Fi as createPluginState, Fn as getPlugins, Go as buildDispatchId, Gr as canActOnReviewItem, Hc as automationVersionOf, Io as createPluginAnnotations, Is as getWorkspaceTeamId, Jo as createOrGetDispatch, Ka as createPluginLogger, Ln as setPlugins, Lo as listConversationAnnotations, Ls as runWithWorkspaceTeamId, Mi as verifyScheduledAutomationCredentialSubject, Mo as backfillConversationEmbeddings, Mt as hasRunnableConversationWork, Ni as verifySlackDirectCredentialSubject, No as createConversationEmbedder, Oi as bindEventAutomationCredentialSubject, Or as projectConversationMessages, Pr as dismissOpenReviewItems, Pt as isInvalidConversationRecordError, Qc as existingConversationId, Qo as getDispatchRecord, Rn as validatePlugins, Rt as pruneActiveConversation, Sa as parseSandboxEgressCredentialToken, Si as findMatchingWatches, Sn as createUserTokenStore, Ss as slackExternalRefIdSchema, T as settleConversationTitleWork, Tc as admitEventAutomationRun, To as requestAttachmentDeletion, Un as setBriefsConfig, Vr as searchReviewItems, Wn as setEventEmbeddingsConfig, Ws as slackMention, Xa as readConversationAccessFromSql, Yo as getDispatchConversationId, Zs as listScheduledAutomationsForTeam, ba as consumeSandboxEgressPermissionDeniedSignal, bl as getConfigDefaults, cc as getDashboardReviewItemLink, cl as refreshAutomationLastRun, cs as notifyAutomationBlocked, dt as CONVERSATION_WORK_STALE_ENQUEUE_MS, es as getPluginDispatchProjection, gc as collectEventAutomationMatchKeys, hc as blockEventAutomation, ic as getDashboardConversationLink, ja as createPluginEmbedder, jc as eventGuidance, ji as verifyEventAutomationCredentialSubject, ki as bindScheduledAutomationCredentialSubject, kn as getPluginApiRoutes, kr as createPluginReviewItems, ks as isDmChannel, li as createCodeChangePublisher, lo as readConversationLastEventSeq, mc as setDashboardConversationLinkOptions, ml as createPluginCache, ms as postSlackEphemeralMessage, na as proxyVercelSandboxEgressRequest, nc as scheduledRunId, ni as reviewItemReaderForUserInConversation, ns as listPendingDispatchMailboxAppends, oa as resolveBaseUrl, oo as readConversationEventPage, os as markDispatchFailed, ps as openSlackModal, qo as confirmDispatchMailboxAppend, rc as withScheduledAutomationLock, sl as recordAutomationExecution, so as readConversationEventPageAfter, ta as isVercelSandboxEgressRequest, tc as saveScheduledAutomationInLock, ti as reviewItemReaderForUser, ts as isTerminalDispatchStatus, uc as getDashboardTaskLink, uo as readConversationMessageEventSeq, va as clearSandboxEgressSignals, vi as collectEventMatchKeys, xl as setConfigDefaults, xo as collectAttachmentGarbage, xs as slackEntitySchema, y as appendConversationMessages, ya as consumeSandboxEgressAuthRequiredSignal, yc as findMatchingEventAutomations } from "./projection-jZSlEAXG.js";
2
+ import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, ot as getAttachmentStorage, p as setBotName, u as resetRuntimeConfig } from "./config-Dkt2Le2b.js";
3
+ import { $ as disconnectStateAdapter, C as withConversationMutationLock, Dt as touchConversationDetail, K as recordGoogleSignIn, L as resolveActorIdentityId, Ot as createSlackDestination, a as getConversationStore, dt as conversationCostOf, it as MUTATION_LOCK_TTL_MS, m as withConversationEventLock, o as getDb, ot as fenceLock, p as deleteMessageLinks, r as getConversationEventStore, s as getSqlExecutor, st as withLock, t as closeDb, tt as getStateAdapter } from "./db-CFZggNoy.js";
4
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, G as normalizeIdentityEmail, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, U as GOOGLE_IDENTITY_PROVIDER, 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-D5gkyvnK.js";
5
+ import { A as resumeConversationDelivery, C as parseSlackReviewItemClick, E as parseSlackUserInputSubmission, S as buildSlackReviewItemModal, _ as createSlackReviewItemShow, b as findSlackThreadOwnerId, d as publicArtifactHeaders, f as readPublicArtifact, g as scheduledAutomationRunAttributes, h as logScheduledAutomationRunSkipped, n as executeAgentRun, p as unpublishedArtifactHeaders, r as processBackgroundCompaction, t as createAgentRunner, v as resolveSlackReviewItemCardConversationId, w as parseSlackReviewItemFormTarget, y as syncReviewItemSlackCards } from "./agent-runner-D9cvNlQl.js";
6
+ import { E as getAuthPausedConversationTurnId, G as isAllowedDomain, J as resolveEventAuthor, K as isTrustedSlackAuthor, Q as renderTaskInput, U as eventAuthorText, W as findTrustedUser, X as resolveBotSlackTeamId, Y as setTrustConfig, at as annotationKeyDigest, b as deletePlanItems, bt as slackChannelMessageRunsAutomation, ft as getExperimentalFeatures, gt as SLACK_EVENT_NAMESPACE, ht as getEventCatalog, it as renderSlackObjectCard, mt as setExperimentalFeatures, ot as decodeAnnotationRef, pt as isExperimentalFeatureEnabled, q as parseEmail, vt as slackChannelMessageEvent, yt as slackChannelMessageReplyThreadTs } from "./session-stop-BfY4rhJs.js";
7
+ import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-C-oE6C_u.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BxwzbLKY.js";
9
+ import { $ as publicAddressLookup, A as actOnReviewItem, C as encodeConversationCursor, F as runAutoArchiveSweep, I as setConversationAutoArchive, J as readObjectLinkTypes, M as readReviewItemForUser, N as reviewItemChange, O as stopConversation, P as archiveViewerDoneConversations, Q as isPublicAddress, S as decodeConversationCursor, T as readConversationPendingMessages, U as backfillCacheWarmingGaps, V as runSavingsRefillSlice, W as GET$4, _t as SubscribedReplyReason, at as slackInboundMessageId, b as createConversationForViewer, dt as recordSkippedConversationMessage, et as createProductionConversationWorkOptions, ft as createSlackWebApiStatusSender, gt as parseContent, ht as stripLeadingBotMention, i as readConversationFeed, it as clearSlackPendingReactions, j as closeReviewItemsAnsweredByReply, k as ReviewItemActionError, l as readConversationDetail, lt as enqueueAgentDispatch, mt as startProcessingReaction, n as steerConversationPendingMessagesForViewer, nt as getProductionSlackAdapter, ot as normalizeIncomingSlackThreadId, pt as bindMessageAuthorIdentityId, rt as buildSlackInboundMessage, s as pinConversation, st as withNormalizedThreadId, t as stopConversationTurnForViewer, tt as createProductionSlackWebhookServices, ut as failStoppedDispatch, v as readConversationRecordFromSql, vt as getThreadStopDecision, w as cancelConversationPendingMessagesForViewer, y as appendConversationMessageForViewer } from "./stop-DYzjRf2U.js";
10
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DxVNIxA0.js";
11
11
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-Bkk0XRo2.js";
12
- import { Ci as findAutomationSkill, E as processWorkspaceSnapshotJob, Kt as listPendingAgentInvocationMailboxAppends, Ot as collectAttachmentUploadGarbage, St as createAndEnqueueConversation, Ti as effectiveTaskOutcomes, Tt as webActorFromUser, Wn as setConversationSubscription, _n as recordSubagentEnded, _t as renderReviewItemMessage, bt as appendAndEnqueueWebMessage, ci as ViewerTaskNotFoundError, dt as markConversationRead, fi as readViewerAutomationSummary, gt as deliverReviewItemChange, k as ingestEvent, lt as archiveConversation, mi as readViewerAutomations, or as parseSlackThreadId, qt as listPendingAgentInvocationResults, ui as readViewerAutomationExecutions, un as enqueueAgentInvocation, vr as joinPublicChannel, vt as reviewItemChangeRecord, wi as missingAutomationSkillReason, wt as recordWebConversationActivity, xt as conversationTurnIdForMessage, yi as automationCardStatus } from "./warmup-HFgFZFwS.js";
13
- import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-7QA00oK6.js";
14
- import { G as getNextRunAtMs, Q as automationTaskText, R as scheduledRunSchema, Z as automationTaskSchema, m as automationListQuerySchema, u as automationExecutionStatusSchema } from "./schedule-BG1tEbRF.js";
15
- import { A as juniorConversationEvents, E as juniorConversationBriefs, R as juniorConversations, V as juniorDestinations, f as juniorReviewItems, h as juniorAutomations, p as juniorAutomationRuns, v as juniorAgentBindings, y as juniorAgentInvocations } from "./executor-Doo-N6Yn.js";
16
- import { c as registerVercelCacheWarmupDevConsumer, g as verifyConversationQueueMessage, h as resolveConversationWorkQueueTopic, i as verifyBackgroundCompactionMessage, m as getVercelConversationWorkQueue, o as cacheWarmupQueueConsumer, p as verifyWorkspaceSnapshotJobMessage, r as vercelBackgroundCompactionQueue, s as createVercelCacheWarmupCallback, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, v as conversationQueueMessageSchema, y as isConversationQueueMessageRejectedError } from "./background-compaction-queue-BpmDEQf6.js";
17
- import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-D2wshngt.js";
18
- import { _ as getQueueProvider, a as pluginTaskQueueConsumer, f as readSchedulerSecret, h as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer, p as readSignInSecret, s as sendVercelPluginTask } from "./task-queue-DvQZH5rG.js";
19
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-CWIORwD9.js";
12
+ import { A as ingestEvent, Ct as createAndEnqueueConversation, D as processWorkspaceSnapshotJob, Ei as effectiveTaskOutcomes, Et as webActorFromUser, Gn as setConversationSubscription, Jt as listPendingAgentInvocationResults, St as conversationTurnIdForMessage, Ti as missingAutomationSkillReason, Tt as recordWebConversationActivity, _t as deliverReviewItemChange, bi as automationCardStatus, di as readViewerAutomationExecutions, dn as enqueueAgentInvocation, ft as markConversationRead, hi as readViewerAutomations, kt as collectAttachmentUploadGarbage, li as ViewerTaskNotFoundError, pi as readViewerAutomationSummary, qt as listPendingAgentInvocationMailboxAppends, sr as parseSlackThreadId, ut as archiveConversation, vn as recordSubagentEnded, vt as renderReviewItemMessage, wi as findAutomationSkill, xt as appendAndEnqueueWebMessage, yr as joinPublicChannel, yt as reviewItemChangeRecord } from "./warmup-C6LOZ2d2.js";
13
+ import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-D4FQ1Nml.js";
14
+ import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
15
+ import { G as getNextRunAtMs, Q as automationTaskText, R as scheduledRunSchema, Z as automationTaskSchema, m as automationListQuerySchema, u as automationExecutionStatusSchema } from "./schedule-DWxZ3kja.js";
16
+ import { A as juniorConversationEvents, E as juniorConversationBriefs, R as juniorConversations, V as juniorDestinations, f as juniorReviewItems, h as juniorAutomations, p as juniorAutomationRuns, v as juniorAgentBindings, y as juniorAgentInvocations } from "./executor-BPkZDx5-.js";
17
+ import { c as registerVercelCacheWarmupDevConsumer, g as verifyConversationQueueMessage, h as resolveConversationWorkQueueTopic, i as verifyBackgroundCompactionMessage, m as getVercelConversationWorkQueue, o as cacheWarmupQueueConsumer, p as verifyWorkspaceSnapshotJobMessage, r as vercelBackgroundCompactionQueue, s as createVercelCacheWarmupCallback, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, v as conversationQueueMessageSchema, y as isConversationQueueMessageRejectedError } from "./background-compaction-queue-BGHqkhkY.js";
18
+ import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-BaqSZcJb.js";
19
+ import { _ as getQueueProvider, a as pluginTaskQueueConsumer, f as readSchedulerSecret, h as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer, p as readSignInSecret, s as sendVercelPluginTask } from "./task-queue-CaZffYaH.js";
20
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-vGnrB0BY.js";
20
21
  import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
21
22
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
22
- import { B as conversationTitleSchema, G as annotationCard, I as conversationBriefSchema, b as conversationSurfaceSchema, v as conversationReportStatusSchema } from "./conversation--f85g4zL.js";
23
- import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-CqOkWizK.js";
24
- import { b as slackMessageTsSchema, g as slackTeamIdSchema, h as slackChannelIdSchema, n as createSlackActor, s as parseActorUserId, u as parseSlackChannelId, v as parseSlackMessageTs, y as slackMessageTsFromMs } from "./actor-D2iXzvlN.js";
25
- import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-CLH0tTLk.js";
26
- import { o as unlinkProvider } from "./connections-DUylBPiR.js";
23
+ import { B as conversationTitleSchema, G as annotationCard, I as conversationBriefSchema, b as conversationSurfaceSchema, v as conversationReportStatusSchema } from "./conversation-M9KZ5JxF.js";
24
+ import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-AHldghAD.js";
25
+ import { b as slackMessageTsSchema, g as slackTeamIdSchema, h as slackChannelIdSchema, n as createSlackActor, s as parseActorUserId, u as parseSlackChannelId, v as parseSlackMessageTs, y as slackMessageTsFromMs } from "./actor-BsBdxDXQ.js";
26
+ import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-DlRVA02H.js";
27
+ import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-2r2KmLwi.js";
27
28
  import { s as buttonUserInputField } from "./web-message-id-BT8Mg8LL.js";
28
- import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-BO432242.js";
29
- import { c as coerceThreadConversationState } from "./turn-session-routing-Cqjj1B3i.js";
29
+ import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-BhKpjpGD.js";
30
+ import { c as coerceThreadConversationState } from "./turn-session-routing-CD0BRCex.js";
30
31
  import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-CPbZjomA.js";
31
- import { t as processConversationWork } from "./worker-CCEDWbsY.js";
32
- import { t as bindMessageAgent } from "./message-fSnXIqvl.js";
33
- import { t as bindSpawnAgent } from "./spawn-PwAuSN59.js";
34
- import { t as processPluginTask } from "./task-runner-CyZMcuZy.js";
35
- import { t as JUNIOR_VERSION } from "./version-BE1OyrXV.js";
36
- import { c as conversationPendingMessageDeliverySchema, n as conversationFeedQuerySchema } from "./conversation-feed-BNs9KiqC.js";
32
+ import { t as processConversationWork } from "./worker-CUBtu1Li.js";
33
+ import { t as bindMessageAgent } from "./message-DwvJ-I3w.js";
34
+ import { t as bindSpawnAgent } from "./spawn-CXr58R0x.js";
35
+ import { t as processPluginTask } from "./task-runner-Dm7BHbGp.js";
36
+ import { t as JUNIOR_VERSION } from "./version-Cr7Z71yG.js";
37
+ import { c as conversationPendingMessageDeliverySchema, n as conversationFeedQuerySchema } from "./conversation-feed-Ci6YD1N-.js";
37
38
  import { createRequire } from "node:module";
38
39
  import { Hono } from "hono";
39
- import pLimit from "p-limit";
40
40
  import * as z from "zod";
41
41
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
42
- import { and, asc, eq, inArray, isNotNull, isNull, lte, ne, or, sql } from "drizzle-orm";
43
42
  import { EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, dispatchOptionsSchema, eventSchema as eventSchema$1, eventTriggerFiltersText, identityDispatchOptionsSchema, isSlackDestination, userSchema } from "@sentry/junior-plugin-api";
43
+ import { and, asc, eq, inArray, isNotNull, isNull, lte, ne, or, sql } from "drizzle-orm";
44
44
  import { pathToFileURL } from "node:url";
45
45
  import { Message, ThreadImpl } from "chat";
46
46
  import net from "node:net";
@@ -425,8 +425,9 @@ async function settleEventAutomationRuns(db, nowMs) {
425
425
  automationId: juniorAutomationRuns.automationId,
426
426
  id: juniorAutomationRuns.id
427
427
  }).from(juniorAutomationRuns).innerJoin(juniorAutomations, eq(juniorAutomations.id, juniorAutomationRuns.automationId)).where(and(eq(juniorAutomations.kind, "event"), eq(juniorAutomationRuns.status, "running")));
428
- for (const run of runs) {
429
- const dispatch = await getDispatchRecord(run.id);
428
+ const dispatches = await mapBounded(runs, (run) => getDispatchRecord(run.id));
429
+ for (const [index, run] of runs.entries()) {
430
+ const dispatch = dispatches[index];
430
431
  const status = dispatch?.status ?? "failed";
431
432
  if (status !== "blocked" && status !== "completed" && status !== "failed") continue;
432
433
  await recordAutomationExecution(run.automationId, {
@@ -1131,30 +1132,46 @@ async function recoverPendingDispatchMailboxAppends(args) {
1131
1132
  logException(error, "dispatch.mailbox.append_recovery.failed", { "app.dispatch.id": id });
1132
1133
  }
1133
1134
  }
1135
+ /**
1136
+ * Run `work` for each item. Items for one mailbox run one at a time in list
1137
+ * order, so its appends keep that order. Different mailboxes run at once.
1138
+ */
1139
+ async function runPerMailbox(items, mailboxOf, work) {
1140
+ const byMailbox = /* @__PURE__ */ new Map();
1141
+ for (const item of items) {
1142
+ const mailbox = mailboxOf(item);
1143
+ byMailbox.set(mailbox, [...byMailbox.get(mailbox) ?? [], item]);
1144
+ }
1145
+ await mapBounded([...byMailbox.values()], async (group) => {
1146
+ for (const item of group) await work(item);
1147
+ });
1148
+ }
1134
1149
  /** Repair invocation creation that stopped before its idempotent mailbox append. */
1135
1150
  async function recoverPendingAgentInvocationMailboxAppends(args) {
1136
- const invocations = await listPendingAgentInvocationMailboxAppends(AGENT_INVOCATION_MAILBOX_APPEND_LIMIT);
1137
- for (const invocation of invocations) try {
1138
- await enqueueAgentInvocation(invocation, {
1139
- nowMs: args.nowMs,
1140
- queue: args.conversationWorkQueue
1141
- });
1142
- } catch (error) {
1143
- logException(error, "agent.invocation.mailbox.append_recovery.failed", { "app.agent.invocation_id": invocation.invocationId });
1144
- }
1151
+ await runPerMailbox(await listPendingAgentInvocationMailboxAppends(AGENT_INVOCATION_MAILBOX_APPEND_LIMIT), (invocation) => invocation.childConversationId, async (invocation) => {
1152
+ try {
1153
+ await enqueueAgentInvocation(invocation, {
1154
+ nowMs: args.nowMs,
1155
+ queue: args.conversationWorkQueue
1156
+ });
1157
+ } catch (error) {
1158
+ logException(error, "agent.invocation.mailbox.append_recovery.failed", { "app.agent.invocation_id": invocation.invocationId });
1159
+ }
1160
+ });
1145
1161
  }
1146
1162
  /** Repair terminal agent invocation results that never reached their parent. */
1147
1163
  async function recoverPendingAgentInvocationResults(args) {
1148
- const invocations = await listPendingAgentInvocationResults(AGENT_INVOCATION_MAILBOX_APPEND_LIMIT);
1149
- for (const invocation of invocations) try {
1150
- await recordSubagentEnded(invocation);
1151
- await enqueueAgentInvocationResult(invocation, {
1152
- nowMs: args.nowMs,
1153
- queue: args.conversationWorkQueue
1154
- });
1155
- } catch (error) {
1156
- logException(error, "agent.invocation.result.recovery.failed", { "app.agent.invocation_id": invocation.invocationId });
1157
- }
1164
+ await runPerMailbox(await listPendingAgentInvocationResults(AGENT_INVOCATION_MAILBOX_APPEND_LIMIT), (invocation) => invocation.parentConversationId, async (invocation) => {
1165
+ try {
1166
+ await recordSubagentEnded(invocation);
1167
+ await enqueueAgentInvocationResult(invocation, {
1168
+ nowMs: args.nowMs,
1169
+ queue: args.conversationWorkQueue
1170
+ });
1171
+ } catch (error) {
1172
+ logException(error, "agent.invocation.result.recovery.failed", { "app.agent.invocation_id": invocation.invocationId });
1173
+ }
1174
+ });
1158
1175
  }
1159
1176
  /** Run the core heartbeat phases. */
1160
1177
  async function runHeartbeat(args) {
@@ -3052,6 +3069,7 @@ async function handleSlackEvent(args) {
3052
3069
  return;
3053
3070
  }
3054
3071
  if ((event.type === "message" || event.type === "app_mention") && !shouldIgnoreMessageSubtype(event) && event.channel && event.ts) {
3072
+ if (channelScope === "external") return;
3055
3073
  if (event.user === void 0 && event.bot_id !== void 0) {
3056
3074
  const botId = await slackWorkspaceBotId(event, channelScope, state);
3057
3075
  setSpanAttributes({ "app.slack.membership": botId ? "verified" : "unverified" });
@@ -3459,14 +3477,13 @@ function createEventAppPublisher(args) {
3459
3477
  async hasMatch(events) {
3460
3478
  const work = args.conversationWork();
3461
3479
  const eventAutomationTeamId = await resolveBotSlackTeamId();
3462
- const limit = pLimit(WATCH_MATCH_CONCURRENCY);
3463
- const [subscriptions, tasks] = await Promise.all([Promise.all(events.map((event) => limit(() => findMatchingWatches({
3480
+ const [subscriptions, tasks] = await Promise.all([mapBounded(events, (event) => findMatchingWatches({
3464
3481
  data: event.data,
3465
3482
  eventType: event.eventType,
3466
3483
  namespace: event.namespace,
3467
3484
  identifier: event.identifier,
3468
3485
  state: work.state
3469
- })))), eventAutomationTeamId ? findMatchingEventAutomations(getDb(), events, eventAutomationTeamId, getEventCatalog()) : Promise.resolve([])]);
3486
+ }), WATCH_MATCH_CONCURRENCY), eventAutomationTeamId ? findMatchingEventAutomations(getDb(), events, eventAutomationTeamId, getEventCatalog()) : Promise.resolve([])]);
3470
3487
  return [...subscriptions, ...tasks].some((matched) => matched.length > 0);
3471
3488
  },
3472
3489
  async neededMatchKeys(input) {
@@ -5155,142 +5172,6 @@ function createAcpHttpHandler(options) {
5155
5172
  }
5156
5173
  };
5157
5174
  }
5158
- // src/api/html.ts
5159
- /** Escape text before it enters server-rendered HTML. */
5160
- function escapeHtml(value) {
5161
- return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#039;");
5162
- }
5163
- /** Return true when a browser request comes from its own URL origin. */
5164
- function requestHasSameOrigin(request) {
5165
- const origin = request.headers.get("origin");
5166
- return origin !== null && URL.parse(origin)?.origin === new URL(request.url).origin;
5167
- }
5168
- const PAGE_STYLE = `
5169
- :root {
5170
- color-scheme: dark;
5171
- --bg: #060607;
5172
- --panel: #0c0c0e;
5173
- --raised: #101013;
5174
- --hover: #17171a;
5175
- --text: #f4f4f5;
5176
- --muted: #a1a1aa;
5177
- --faint: #8a8a93;
5178
- --solid: #ffffff;
5179
- --subtle: #c4c4cc;
5180
- --inverse: #000000;
5181
- --focus: #beaaff;
5182
- --border: rgb(255 255 255 / 0.08);
5183
- --border-emphasis: rgb(255 255 255 / 0.15);
5184
- --border-heavy: rgb(255 255 255 / 0.3);
5185
- --warning-bg: rgb(251 191 36 / 0.08);
5186
- --warning-border: rgb(251 191 36 / 0.3);
5187
- --warning-text: #fcd34d;
5188
- --shadow: 0 16px 40px rgb(0 0 0 / 0.5);
5189
- }
5190
- @media (prefers-color-scheme: light) {
5191
- :root {
5192
- color-scheme: light;
5193
- --bg: #ffffff;
5194
- --panel: #f9f9fa;
5195
- --raised: #ffffff;
5196
- --hover: #f1f1f3;
5197
- --text: #18181b;
5198
- --muted: #52525b;
5199
- --faint: #71717a;
5200
- --solid: #09090b;
5201
- --subtle: #3f3f46;
5202
- --inverse: #ffffff;
5203
- --focus: #7553ff;
5204
- --border: rgb(0 0 0 / 0.09);
5205
- --border-emphasis: rgb(0 0 0 / 0.16);
5206
- --border-heavy: rgb(0 0 0 / 0.32);
5207
- --warning-bg: rgb(245 158 11 / 0.1);
5208
- --warning-border: rgb(217 119 6 / 0.35);
5209
- --warning-text: #92400e;
5210
- --shadow: 0 16px 40px rgb(0 0 0 / 0.08);
5211
- }
5212
- }
5213
- * { box-sizing: border-box; }
5214
- body {
5215
- margin: 0;
5216
- min-height: 100vh;
5217
- display: grid;
5218
- place-items: center;
5219
- padding: 24px 16px;
5220
- background: var(--bg);
5221
- color: var(--text);
5222
- font: 16px/1.5 Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
5223
- }
5224
- main {
5225
- width: 100%;
5226
- max-width: 28rem;
5227
- padding: 32px;
5228
- border: 1px solid var(--border);
5229
- border-radius: 12px;
5230
- background: var(--panel);
5231
- box-shadow: var(--shadow);
5232
- }
5233
- h1, h2 { font-family: Outfit, "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif; }
5234
- h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
5235
- h2 { margin: 24px 0 8px; font-size: 0.875rem; line-height: 1.35; font-weight: 600; color: var(--subtle); }
5236
- p { margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }
5237
- p:last-child { margin-bottom: 0; }
5238
- strong { color: var(--text); font-weight: 600; }
5239
- code { font: 0.8125rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--faint); overflow-wrap: anywhere; }
5240
- .list { margin: 0 0 24px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); }
5241
- .list li { padding: 12px 16px; font-size: 0.875rem; line-height: 1.35; }
5242
- .list li + li { border-top: 1px solid var(--border); }
5243
- .list code { display: block; margin-top: 4px; }
5244
- .warning { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--warning-border); border-radius: 8px; background: var(--warning-bg); color: var(--warning-text); font-size: 0.875rem; line-height: 1.35; }
5245
- .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
5246
- label { display: block; margin: 0 0 16px; font-size: 0.875rem; font-weight: 600; color: var(--subtle); }
5247
- label input {
5248
- display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px;
5249
- border: 1px solid var(--border-emphasis); border-radius: 6px; background: var(--raised);
5250
- color: var(--text); font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
5251
- }
5252
- button {
5253
- width: 100%; min-height: 44px; padding: 8px 16px; border: 1px solid var(--border-emphasis); border-radius: 6px;
5254
- background: var(--raised); color: var(--text); cursor: pointer;
5255
- font-family: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1; transition: background-color 0.2s ease, border-color 0.2s ease;
5256
- }
5257
- button:hover { border-color: var(--border-heavy); background: var(--hover); }
5258
- button.primary { border-color: var(--solid); background: var(--solid); color: var(--inverse); }
5259
- button.primary:hover { border-color: var(--subtle); background: var(--subtle); }
5260
- button:focus-visible, label input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
5261
- @media (max-width: 480px) { main { padding: 24px; } }
5262
- @media (prefers-reduced-motion: reduce) { button { transition: none; } }
5263
- `;
5264
- /**
5265
- * Render one sign-in page that browsers cannot frame or cache. `bodyHtml`
5266
- * follows the heading, and the caller escapes every value in it. Callers use
5267
- * the `list`, `warning`, `actions`, and `primary` classes from `PAGE_STYLE`.
5268
- */
5269
- function renderHtmlPage(page) {
5270
- return new Response(`<!DOCTYPE html>
5271
- <html lang="en">
5272
- <head>
5273
- <meta charset="utf-8" />
5274
- <meta name="viewport" content="width=device-width, initial-scale=1" />
5275
- <title>${escapeHtml(page.title)}</title>
5276
- <style>${PAGE_STYLE}</style>
5277
- </head>
5278
- <body>
5279
- <main>
5280
- <h1>${escapeHtml(page.title)}</h1>
5281
- ${page.bodyHtml}
5282
- </main>
5283
- </body>
5284
- </html>`, {
5285
- status: page.status,
5286
- headers: {
5287
- "cache-control": "no-store",
5288
- "content-type": "text/html; charset=utf-8",
5289
- "x-frame-options": "DENY",
5290
- ...page.headers
5291
- }
5292
- });
5293
- }
5294
5175
  // src/api/mcp/oauth/state.ts
5295
5176
  /** Return the SHA-256 hex digest of a secret or unbounded value. */
5296
5177
  function sha256Hex(value) {
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "./config-Cx8H0MRw.js";
2
- import { E as withSpan, h as logWarn } from "./logging-DnBYBM8z.js";
3
- import { _ as getQueueProvider, c as QUEUE_SIGNATURE_MAX_AGE_MS, h as queueCallback, l as signQueueMessage, u as verifyQueueMessage } from "./task-queue-DvQZH5rG.js";
1
+ import { i as getChatConfig } from "./config-Dkt2Le2b.js";
2
+ import { E as withSpan, h as logWarn } from "./logging-D5gkyvnK.js";
3
+ import { _ as getQueueProvider, c as QUEUE_SIGNATURE_MAX_AGE_MS, h as queueCallback, l as signQueueMessage, u as verifyQueueMessage } from "./task-queue-CaZffYaH.js";
4
4
  import * as z from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  /** Validate the v2 conversation work hint sent through Vercel Queue. */
@@ -169,7 +169,7 @@ function cacheWarmupCallback() {
169
169
  maxDeliveries: 1,
170
170
  onRejected: logCacheWarmupRejected,
171
171
  run: async (message) => {
172
- const { runCacheWarmup } = await import("./warmup-HFgFZFwS.js").then((n) => n.s);
172
+ const { runCacheWarmup } = await import("./warmup-C6LOZ2d2.js").then((n) => n.s);
173
173
  await runCacheWarmup(message);
174
174
  },
175
175
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -1,5 +1,5 @@
1
- import { F as briefResourceLabel, L as parseBriefInput, M as briefCodeChangeSchema, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation--f85g4zL.js";
2
- import { c as generateBrief, n as briefEntriesFromReportEvents, t as BRIEF_PROMPT, u as completeObject } from "./prompt-DAjjk5fm.js";
1
+ import { F as briefResourceLabel, L as parseBriefInput, M as briefCodeChangeSchema, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-M9KZ5JxF.js";
2
+ import { c as generateBrief, n as briefEntriesFromReportEvents, t as BRIEF_PROMPT, u as completeObject } from "./prompt-CaMyeCpA.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -264,7 +264,7 @@ async function parseRunOptions(argv) {
264
264
  * token.
265
265
  */
266
266
  async function configuredBot() {
267
- const { botConfig } = await import("./config-Cx8H0MRw.js").then((n) => n.r);
267
+ const { botConfig } = await import("./config-Dkt2Le2b.js").then((n) => n.r);
268
268
  return botConfig;
269
269
  }
270
270
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-tHJLCtKS.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BBkWFCl8.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,5 +1,5 @@
1
1
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
2
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-BnOofGFG.js";
2
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-D9cvNlQl.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
5
5
  import { stderr, stdin, stdout } from "node:process";
@@ -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-Bkk0XRo2.js").then((n) => n.o),
102
- import("../projection-Bqn6zdVT.js").then((n) => n.Cn),
103
- import("../catalog-runtime-q9AJjuUN.js").then((n) => n.t),
104
- import("../validation-BEUlev32.js").then((n) => n.r),
105
- import("../db-CO6Y10eM.js").then((n) => n.n)
102
+ import("../projection-jZSlEAXG.js").then((n) => n.Tn),
103
+ import("../catalog-runtime-BxwzbLKY.js").then((n) => n.t),
104
+ import("../validation-DxVNIxA0.js").then((n) => n.r),
105
+ import("../db-CFZggNoy.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,20 +152,20 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig, setEventEmbeddingsConfig } = await import("../projection-Bqn6zdVT.js").then((n) => n.Bn);
155
+ const { setBriefsConfig, setEventEmbeddingsConfig } = await import("../projection-jZSlEAXG.js").then((n) => n.Hn);
156
156
  setBriefsConfig({ enabled: true });
157
157
  setEventEmbeddingsConfig({ enabled: true });
158
- const { runLocalAgentTurn } = await import("../runner-BvNPWLAy.js");
159
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BUU6zd_T.js");
160
- const { createLocalOAuthState } = await import("../oauth-relay-gO_Ynmpb.js").then((n) => n.t);
161
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CmHD-6vr.js");
162
- const { bindSpawnAgent } = await import("../spawn-PwAuSN59.js").then((n) => n.n);
163
- const { bindMessageAgent } = await import("../message-fSnXIqvl.js").then((n) => n.n);
164
- const { createChildConversationWorker, createDeliverToParent } = await import("../result-D2wshngt.js").then((n) => n.o);
165
- const { createConversationTurnWorker } = await import("../conversation-turn-C9-Nfnsy.js").then((n) => n.t);
166
- const { skipInputAfterConversationStop } = await import("../session-stop-BQ0J0Fph.js").then((n) => n.a);
158
+ const { runLocalAgentTurn } = await import("../runner-11h8PrHh.js");
159
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DIF6Li06.js");
160
+ const { createLocalOAuthState } = await import("../oauth-relay-DPE-wrwO.js").then((n) => n.t);
161
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CTcACAtJ.js");
162
+ const { bindSpawnAgent } = await import("../spawn-CXr58R0x.js").then((n) => n.n);
163
+ const { bindMessageAgent } = await import("../message-DwvJ-I3w.js").then((n) => n.n);
164
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-BaqSZcJb.js").then((n) => n.o);
165
+ const { createConversationTurnWorker } = await import("../conversation-turn-CBlZIH02.js").then((n) => n.t);
166
+ const { skipInputAfterConversationStop } = await import("../session-stop-BfY4rhJs.js").then((n) => n.a);
167
167
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
168
- const { processConversationWork } = await import("../worker-CCEDWbsY.js").then((n) => n.n);
168
+ const { processConversationWork } = await import("../worker-CUBtu1Li.js").then((n) => n.n);
169
169
  let agentRunner;
170
170
  const localConversationWork = createLocalConversationWork(async (message) => {
171
171
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,8 +1,10 @@
1
- import { i as parseSkillFile } from "../skills-Dm2-5nn5.js";
2
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DnBYBM8z.js";
3
- import { b as parsePluginManifest, y as parseInlinePluginManifest } from "../registry-tHJLCtKS.js";
1
+ import { t as mapBounded } from "../fan-out-Cod-yEHG.js";
2
+ import { a as parseSkillFile } from "../skills-C8Npu5zO.js";
3
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-D5gkyvnK.js";
4
+ import { b as parsePluginManifest, y as parseInlinePluginManifest } from "../registry-BBkWFCl8.js";
4
5
  import pLimit from "p-limit";
5
6
  import path from "node:path";
7
+ import { mentionsTag } from "@sentry/junior-plugin-api";
6
8
  import fs from "node:fs/promises";
7
9
  import { pathToFileURL } from "node:url";
8
10
  // src/cli/check.ts
@@ -95,15 +97,14 @@ async function collectPackageWarnings(rootDir, packages) {
95
97
  const packageSpecByName = new Map(packages.map((declaredPackage) => [declaredPackage.name, declaredPackage.spec]));
96
98
  const coreVersion = comparableVersion(await readInstalledPackageVersion(rootDir, "@sentry/junior") ?? packageSpecByName.get("@sentry/junior"));
97
99
  if (!coreVersion) return warnings;
98
- const limit = pLimit(8);
99
- const pluginVersions = await Promise.all(packages.filter((declaredPackage) => declaredPackage.name.startsWith("@sentry/junior-")).map((declaredPackage) => limit(async () => {
100
+ const pluginVersions = await mapBounded(packages.filter((declaredPackage) => declaredPackage.name.startsWith("@sentry/junior-")), async (declaredPackage) => {
100
101
  if (!await packageHasPluginContent(rootDir, declaredPackage.name)) return;
101
102
  const version = comparableVersion(await readInstalledPackageVersion(rootDir, declaredPackage.name) ?? declaredPackage.spec);
102
103
  return {
103
104
  name: declaredPackage.name,
104
105
  version
105
106
  };
106
- })));
107
+ });
107
108
  for (const plugin of pluginVersions) if (plugin?.version && plugin.version !== coreVersion) warnings.push(`${path.join(rootDir, "package.json")}: ${plugin.name} version ${plugin.version} does not match @sentry/junior version ${coreVersion}`);
108
109
  return warnings;
109
110
  }
@@ -136,7 +137,7 @@ async function validateSkillDirectory(skillDir, duplicateNames) {
136
137
  if (firstSeen) errors.push(`${skillFile}: duplicate skill name "${name}" (already defined in ${firstSeen})`);
137
138
  else duplicateNames.set(name, skillFile);
138
139
  if (!parsed.skill.body) warnings.push(`${skillFile}: no skill instructions after frontmatter`);
139
- if (/\b(?:searchTools|searchMcpTools|useTool|callMcpTool|available_tools)\b|<active-mcp-(?:tools|catalogs)>/.test(parsed.skill.body)) errors.push(`${skillFile}: skill instructions must not hardcode harness tool-discovery or MCP dispatcher mechanics`);
140
+ if (/\b(?:searchTools|searchMcpTools|useTool|callMcpTool|available_tools)\b/.test(parsed.skill.body) || mentionsTag(parsed.skill.body, ["active-mcp-tools", "active-mcp-catalogs"])) errors.push(`${skillFile}: skill instructions must not hardcode harness tool-discovery or MCP dispatcher mechanics`);
140
141
  return {
141
142
  skillFile,
142
143
  skill: parsed.skill,
@@ -263,11 +264,10 @@ async function collectPluginDirectories(rootDir) {
263
264
  } catch {
264
265
  return pluginDirs;
265
266
  }
266
- const limit = pLimit(8);
267
- await Promise.all(entries.filter((entry) => entry.isDirectory()).map((entry) => limit(async () => {
267
+ await mapBounded(entries.filter((entry) => entry.isDirectory()), async (entry) => {
268
268
  const pluginDir = path.join(contentRoot(rootDir, "plugins"), entry.name);
269
269
  if (await pathIsFile(path.join(pluginDir, "plugin.yaml"))) pluginDirs.push(pluginDir);
270
- })));
270
+ });
271
271
  return pluginDirs.sort((left, right) => left.localeCompare(right));
272
272
  }
273
273
  async function collectPackagedContent(rootDir, packages) {
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-vSmheo3Z.js")).runAdmin(argv);
48
+ return await (await import("../admin-tgZEZAk2.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-B2d1Er_r.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-Bx93N1n1.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-Dbh94cRp.js")).runBriefs(argv);
54
+ return await (await import("../briefs-DKxkoruh.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 { o as getDb } from "../db-CO6Y10eM.js";
2
- import { Fn as setPlugins, In as validatePlugins, Ua as createPluginLogger } from "../projection-Bqn6zdVT.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-q9AJjuUN.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BEUlev32.js";
1
+ import { o as getDb } from "../db-CFZggNoy.js";
2
+ import { Ka as createPluginLogger, Ln as setPlugins, Rn as validatePlugins } from "../projection-jZSlEAXG.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BxwzbLKY.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DxVNIxA0.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
6
6
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-Bkk0XRo2.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,8 +1,8 @@
1
- import { i as getChatConfig } from "../config-Cx8H0MRw.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-q9AJjuUN.js";
3
- import { n as resolve } from "../resolve-z2sKt8xM.js";
4
- import { Ki as create, wa as SANDBOX_RUNTIME } from "../projection-Bqn6zdVT.js";
5
- import { Z as disconnectStateAdapter } from "../db-CO6Y10eM.js";
1
+ import { i as getChatConfig } from "../config-Dkt2Le2b.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BxwzbLKY.js";
3
+ import { n as resolve } from "../resolve-B38MkHXE.js";
4
+ import { Da as SANDBOX_RUNTIME, Yi as create } from "../projection-jZSlEAXG.js";
5
+ import { $ as disconnectStateAdapter } from "../db-CFZggNoy.js";
6
6
  // src/cli/snapshot-create.ts
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
8
8
  function progressMessage(phase) {