@sentry/junior 0.307.1 → 0.309.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 (84) hide show
  1. package/dist/{actor-D2iXzvlN.js → actor-BsBdxDXQ.js} +0 -1
  2. package/dist/{adapter-context-HrBTD8rJ.js → adapter-context-1YUbMpD3.js} +2 -2
  3. package/dist/{admin-B78_KmfR.js → admin-u30A8TcD.js} +2 -2
  4. package/dist/{agent-runner-DxivxUYd.js → agent-runner-sJLhgPQV.js} +93 -90
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.d.ts +4 -2
  8. package/dist/api.js +416 -272
  9. package/dist/{app-EZur8cVC.d.ts → app-B_7Wn0en.d.ts} +6 -7
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +73 -193
  12. package/dist/{background-compaction-queue-HlljT9ql.js → background-compaction-queue-CUJXVKG3.js} +4 -4
  13. package/dist/{briefs-DR8mp-TK.js → briefs-BHi70IR5.js} +3 -3
  14. package/dist/{catalog-runtime-Se9idiDR.js → catalog-runtime-Chc_IP2o.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-DY5c1E0l.js → config-BIyIdTtA.js} +52 -93
  23. package/dist/{continue-in-slack-DNkrrWuQ.js → continue-in-slack-BQJBfiQh.js} +6 -6
  24. package/dist/{conversation--f85g4zL.js → conversation-CzrLhdHG.js} +6 -1
  25. package/dist/{conversation-feed-BNs9KiqC.js → conversation-feed-B9e3_gxz.js} +1 -1
  26. package/dist/{conversation-privacy-CVj9vSrP.js → conversation-privacy-CkTW29hd.js} +1 -1
  27. package/dist/{conversation-turn-CkzrIfJ2.js → conversation-turn-CZaYQUum.js} +19 -20
  28. package/dist/{credential-sync-B9CIkgOT.js → credential-sync-58m_CyIJ.js} +31 -23
  29. package/dist/{db-C41UgdBj.d.ts → db-B4Hjxr-u.d.ts} +2 -2
  30. package/dist/{db-C21CyyTE.js → db-CFUpEZi9.js} +11 -9
  31. package/dist/{executor-DfNoVVGd.js → executor-DXL0O0MV.js} +4 -3
  32. package/dist/fan-out-Cod-yEHG.js +10 -0
  33. package/dist/{connections-C-SqzubG.js → html-CaBu2VbT.js} +146 -11
  34. package/dist/{install-lYZs8UCL.js → install-DhTBUUov.js} +2 -2
  35. package/dist/instrumentation.js +2 -2
  36. package/dist/{lineage-BJTSY53A.js → lineage-CxtOI2_p.js} +2 -2
  37. package/dist/{logging-DjW7LjgJ.js → logging-BNUovdcX.js} +1 -1
  38. package/dist/{message-BPPZpdoZ.js → message-DcUsS2vg.js} +8 -8
  39. package/dist/{model-input-DKqiLFGa.js → model-input-o3rEqgwM.js} +15 -10
  40. package/dist/nitro.d.ts +1 -1
  41. package/dist/nitro.js +4 -4
  42. package/dist/{oauth-callback-server-OJP8Y4Ca.js → oauth-callback-server-1Fizd1EM.js} +2 -2
  43. package/dist/{oauth-relay-KwDz41Z3.js → oauth-relay-DOwngqdM.js} +1 -1
  44. package/dist/{package-discovery-x4AvVhMj.js → package-discovery-DD9vencX.js} +0 -1
  45. package/dist/{projection-D47mlszd.js → projection-Ce4pmhKP.js} +108 -125
  46. package/dist/{prompt-DuWH_YIb.js → prompt-DEqjDVMs.js} +25 -14
  47. package/dist/{registry-yht0oxq6.js → registry-CNE4ZBnG.js} +3 -3
  48. package/dist/{resolve-gZ-hVMYl.js → resolve-qbPg-aC-.js} +3 -3
  49. package/dist/{result-CP99Ok0_.js → result-ZGnDzcsb.js} +12 -13
  50. package/dist/{runner-eVlnUkY7.js → runner-eGIxpAMf.js} +10 -10
  51. package/dist/{sandbox-egress-signals-DZL_0lnG.js → sandbox-egress-signals-DMFB1kCp.js} +1 -1
  52. package/dist/{schedule-BG1tEbRF.js → schedule-Cire6NU7.js} +1 -1
  53. package/dist/{schema-D4jdesIu.js → schema-CfIey9Ao.js} +65 -28
  54. package/dist/{schema-CRXcj4fj.d.ts → schema-DriSvB40.d.ts} +43 -43
  55. package/dist/{service-account-tI3LBg2_.js → service-account-B1VXCTqg.js} +3 -3
  56. package/dist/{service-account-CZneZHh7.js → service-account-Cw_LWZ4-.js} +7 -8
  57. package/dist/{session-stop-D3S7mSkX.js → session-stop-P2XdTiwr.js} +191 -187
  58. package/dist/{skills-Bm6uSO9V.js → skills-Zg8-vrje.js} +25 -29
  59. package/dist/{slack-conversation-unfurl-BeBvg3xU.js → slack-conversation-unfurl-DA51qH0c.js} +18 -15
  60. package/dist/{spawn-vhMAmLuh.js → spawn-DBi4-zD8.js} +6 -6
  61. package/dist/{state-3Yiy2FvP.js → state-C-Ftk23K.js} +4 -4
  62. package/dist/{stop-Bh53GUoX.js → stop-D9xideLM.js} +175 -134
  63. package/dist/{store-BZJdHYR7.js → store-BjIXA0Al.js} +5 -5
  64. package/dist/{task-queue-BEl5G38v.js → task-queue-D0_qbnpo.js} +7 -4
  65. package/dist/{task-runner-C6Bujc6h.js → task-runner-DQMq4XY0.js} +10 -11
  66. package/dist/{thread-context-DxMQGGd_.js → thread-context-D0i1e-5O.js} +13 -11
  67. package/dist/{turn-session-routing-CmQY0T60.js → turn-session-routing-C0l68I_O.js} +4 -4
  68. package/dist/{turn-user-message-Dfbr3Ud9.js → turn-user-message-nBVvOXjs.js} +14 -5
  69. package/dist/{queue-CbEHUO0l.d.ts → types-fnU7Xs__.d.ts} +3 -1
  70. package/dist/{users-6rSdqXXk.js → users-DdjMjbmM.js} +1 -1
  71. package/dist/{validation--hsjOLRL.js → validation-CRbvRPvu.js} +1 -1
  72. package/dist/{version-9iMT25Hq.js → version-BYdVs12p.js} +1 -1
  73. package/dist/version.js +1 -1
  74. package/dist/{viewer-De1vmuEA.js → viewer-DudYrQGj.js} +7 -5
  75. package/dist/{warmup-C0IblNtf.js → warmup-DN9OHN1-.js} +136 -78
  76. package/dist/{worker-CiyRr2q7.js → worker-C9ZfJXmV.js} +8 -8
  77. package/migrations/0121_people_list_metric_index.sql +1 -0
  78. package/migrations/0122_automation_rollout_repair.sql +56 -0
  79. package/migrations/0123_cache_warming_history_reset.sql +10 -0
  80. package/migrations/meta/0121_snapshot.json +5481 -0
  81. package/migrations/meta/0122_snapshot.json +5481 -0
  82. package/migrations/meta/0123_snapshot.json +5481 -0
  83. package/migrations/meta/_journal.json +21 -0
  84. 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";
@@ -47,7 +47,8 @@ interface RuntimeLimits {
47
47
  contextWindowTokens?: number;
48
48
  /**
49
49
  * Levels of child agents that can start their own child agents. The
50
- * default, 0, lets only the root Conversation start child agents.
50
+ * default, 1, lets a child of the root start child agents, and those
51
+ * cannot start more. 0 lets only the root Conversation start them.
51
52
  */
52
53
  maxAgentDepth?: number;
53
54
  /** Automated turns in a row before Junior stops answering automation. */
@@ -222,8 +223,6 @@ interface VercelConversationWorkCallbackOptions extends ProcessConversationQueue
222
223
  visibilityTimeoutSeconds?: number;
223
224
  }
224
225
  type ConversationWorkCallbackOptions = VercelConversationWorkCallbackOptions;
225
- /** Callback to schedule background work that must finish before the function exits. */
226
- type WaitUntilFn = (task: Promise<unknown> | (() => Promise<unknown>)) => void;
227
226
  interface JuniorDashboardOptions {
228
227
  /** Browser auth route prefix used by Better Auth. */
229
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-EZur8cVC.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 withScheduledAutomationLock, Ai as verifySlackDirectCredentialSubject, Ao as createConversationEmbedder, At as hasRunnableConversationWork, Bs as slackMention, C as settleConversationTitleWork, Ca as normalizeSandboxEgressTracePropagationDomains, Ci as takeDueTimerWatches, Dc as eventGuidance, 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, Jc as existingConversationId, Ko as getDispatchConversationId, Mi as createPluginState, Mr as dismissOpenReviewItems, Mt as isInvalidConversationRecordError, Nn as getPlugins, No as createPluginAnnotations, Ns as getWorkspaceTeamId, Oa as createPluginEmbedder, Oi as verifyEventAutomationCredentialSubject, On as getPluginRoutes, Po as listConversationAnnotations, Ps as runWithWorkspaceTeamId, Qi as isVercelSandboxEgressRequest, Qo as isTerminalDispatchStatus, Qs as scheduledRunId, Rc as automationVersionOf, Rn as isBriefsEnabled, Sc as eventAutomationRunLimitReason, So as requestAttachmentDeletion, Ti as bindEventAutomationCredentialSubject, Tn as createPluginEventPublisher, Ua as createPluginLogger, Ur as canActOnReviewItem, Vn as setBriefsConfig, Wo as confirmDispatchMailboxAppend, Yo as getDispatchRecord, Ys as readScheduledAutomation, Zo as getPluginDispatchProjection, Zs as saveScheduledAutomationInLock, _ as appendConversationMessages, _a as consumeSandboxEgressPermissionDeniedSignal, _l as setConfigDefaults, as as notifyAutomationBlocked, bn as createUserTokenStore, dc as blockEventAutomation, ds as postSlackEphemeralMessage, ec as getDashboardConversationLink, ei as reviewItemReaderForUserInConversation, fc as collectEventAutomationMatchKeys, ga as consumeSandboxEgressAuthRequiredSignal, gl as getConfigDefaults, ha as clearSandboxEgressSignals, hc as findMatchingEventAutomations, hi as collectEventMatchKeys, ic as getDashboardReviewItemLink, il as refreshAutomationLastRun, io as readConversationEventPageAfter, ki as verifyScheduledAutomationCredentialSubject, ko as backfillConversationEmbeddings, lt as CONVERSATION_WORK_STALE_ENQUEUE_MS, oc as getDashboardTaskLink, oi as createCodeChangePublisher, oo as readConversationLastEventSeq, qa as readConversationAccessFromSql, qs as listScheduledAutomationsForTeam, ra as resolveBaseUrl, rl as recordAutomationExecution, ro as readConversationEventPage, rs as markDispatchFailed, so as readConversationMessageEventSeq, uc as setDashboardConversationLinkOptions, ul as createPluginCache, us as openSlackModal, vo as collectAttachmentGarbage, vs as slackEntitySchema, ws as getSlackClient, xc as admitEventAutomationRun, ya as parseSandboxEgressCredentialToken, yi as findMatchingWatches, ys as slackExternalRefIdSchema, zr as searchReviewItems } from "./projection-D47mlszd.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-DY5c1E0l.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-C21CyyTE.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-DjW7LjgJ.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-DxivxUYd.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-D3S7mSkX.js";
7
- import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-lYZs8UCL.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Se9idiDR.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-Bh53GUoX.js";
10
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation--hsjOLRL.js";
1
+ import { $i as isVercelSandboxEgressRequest, $o as isTerminalDispatchStatus, $r as reviewItemReaderForUser, $s as saveScheduledAutomationInLock, Ai as verifyScheduledAutomationCredentialSubject, Ao as backfillConversationEmbeddings, At as hasRunnableConversationWork, Bc as automationVersionOf, C as settleConversationTitleWork, Cc as admitEventAutomationRun, Co as requestAttachmentDeletion, Di as bindScheduledAutomationCredentialSubject, Dn as getPluginApiRoutes, Dr as createPluginReviewItems, Ds as isDmChannel, Ei as bindEventAutomationCredentialSubject, Er as projectConversationMessages, Fn as setPlugins, Fo as listConversationAnnotations, Fs as runWithWorkspaceTeamId, Go as confirmDispatchMailboxAppend, Hn as setEventEmbeddingsConfig, Hs as slackMention, In as validatePlugins, It as pruneActiveConversation, Ja as readConversationAccessFromSql, Ko as createOrGetDispatch, Mr as dismissOpenReviewItems, Mt as isInvalidConversationRecordError, Ni as createPluginState, Nn as getPlugins, Oi as bindSlackDirectCredentialSubject, On as getPluginRoutes, Oo as resolveRootVisibility, Po as createPluginAnnotations, Ps as getWorkspaceTeamId, Qo as getPluginDispatchProjection, Rn as isBriefsEnabled, Tn as createPluginEventPublisher, Ts as getSlackClient, Uo as buildDispatchId, Ur as canActOnReviewItem, Vn as setBriefsConfig, Wa as createPluginLogger, Xc as existingConversationId, Xo as getDispatchRecord, Ys as listScheduledAutomationsForTeam, Zs as readScheduledAutomation, _ as appendConversationMessages, _a as consumeSandboxEgressAuthRequiredSignal, _c as findMatchingEventAutomations, al as recordAutomationExecution, ao as readConversationEventPageAfter, ba as parseSandboxEgressCredentialToken, bi as findMatchingWatches, bn as createUserTokenStore, bs as slackExternalRefIdSchema, cc as getDashboardTaskLink, co as readConversationMessageEventSeq, ds as openSlackModal, ea as proxyVercelSandboxEgressRequest, ec as scheduledRunId, ei as reviewItemReaderForUserInConversation, es as listPendingDispatchMailboxAppends, fc as setDashboardConversationLinkOptions, fl as createPluginCache, fs as postSlackEphemeralMessage, ga as clearSandboxEgressSignals, gi as collectEventMatchKeys, ia as resolveBaseUrl, io as readConversationEventPage, is as markDispatchFailed, ji as verifySlackDirectCredentialSubject, jo as createConversationEmbedder, ka as createPluginEmbedder, kc as eventGuidance, ki as verifyEventAutomationCredentialSubject, lt as CONVERSATION_WORK_STALE_ENQUEUE_MS, mc as collectEventAutomationMatchKeys, nc as getDashboardConversationLink, oc as getDashboardReviewItemLink, ol as refreshAutomationLastRun, os as notifyAutomationBlocked, pc as blockEventAutomation, qo as getDispatchConversationId, si as createCodeChangePublisher, so as readConversationLastEventSeq, tc as withScheduledAutomationLock, va as consumeSandboxEgressPermissionDeniedSignal, vl as getConfigDefaults, wa as normalizeSandboxEgressTracePropagationDomains, wc as eventAutomationRunLimitReason, wi as takeDueTimerWatches, yl as setConfigDefaults, yo as collectAttachmentGarbage, ys as slackEntitySchema, zr as searchReviewItems } from "./projection-Ce4pmhKP.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-BIyIdTtA.js";
3
+ import { C as withConversationMutationLock, Dt as createSlackDestination, Et as touchConversationDetail, G as recordGoogleSignIn, I as resolveActorIdentityId, Q as disconnectStateAdapter, a as getConversationStore, at as fenceLock, et as getStateAdapter, m as withConversationEventLock, o as getDb, ot as withLock, p as deleteMessageLinks, r as getConversationEventStore, rt as MUTATION_LOCK_TTL_MS, s as getSqlExecutor, t as closeDb, ut as conversationCostOf } from "./db-CFUpEZi9.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-BNUovdcX.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-sJLhgPQV.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-P2XdTiwr.js";
7
+ import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-DhTBUUov.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Chc_IP2o.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-D9xideLM.js";
10
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CRbvRPvu.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-C0IblNtf.js";
13
- import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-BZJdHYR7.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-DfNoVVGd.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-HlljT9ql.js";
17
- import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-CP99Ok0_.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-BEl5G38v.js";
19
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-B9CIkgOT.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-DN9OHN1-.js";
13
+ import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-BjIXA0Al.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-Cire6NU7.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-DXL0O0MV.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-CUJXVKG3.js";
18
+ import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-ZGnDzcsb.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-D0_qbnpo.js";
20
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-58m_CyIJ.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-De1vmuEA.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-BeBvg3xU.js";
26
- import { o as unlinkProvider } from "./connections-C-SqzubG.js";
23
+ import { B as conversationTitleSchema, G as annotationCard, I as conversationBriefSchema, b as conversationSurfaceSchema, v as conversationReportStatusSchema } from "./conversation-CzrLhdHG.js";
24
+ import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-DudYrQGj.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-DA51qH0c.js";
27
+ import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-CaBu2VbT.js";
27
28
  import { s as buttonUserInputField } from "./web-message-id-BT8Mg8LL.js";
28
- import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-HrBTD8rJ.js";
29
- import { c as coerceThreadConversationState } from "./turn-session-routing-CmQY0T60.js";
29
+ import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-1YUbMpD3.js";
30
+ import { c as coerceThreadConversationState } from "./turn-session-routing-C0l68I_O.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-CiyRr2q7.js";
32
- import { t as bindMessageAgent } from "./message-BPPZpdoZ.js";
33
- import { t as bindSpawnAgent } from "./spawn-vhMAmLuh.js";
34
- import { t as processPluginTask } from "./task-runner-C6Bujc6h.js";
35
- import { t as JUNIOR_VERSION } from "./version-9iMT25Hq.js";
36
- import { c as conversationPendingMessageDeliverySchema, n as conversationFeedQuerySchema } from "./conversation-feed-BNs9KiqC.js";
32
+ import { t as processConversationWork } from "./worker-C9ZfJXmV.js";
33
+ import { t as bindMessageAgent } from "./message-DcUsS2vg.js";
34
+ import { t as bindSpawnAgent } from "./spawn-DBi4-zD8.js";
35
+ import { t as processPluginTask } from "./task-runner-DQMq4XY0.js";
36
+ import { t as JUNIOR_VERSION } from "./version-BYdVs12p.js";
37
+ import { c as conversationPendingMessageDeliverySchema, n as conversationFeedQuerySchema } from "./conversation-feed-B9e3_gxz.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) {
@@ -3459,14 +3476,13 @@ function createEventAppPublisher(args) {
3459
3476
  async hasMatch(events) {
3460
3477
  const work = args.conversationWork();
3461
3478
  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({
3479
+ const [subscriptions, tasks] = await Promise.all([mapBounded(events, (event) => findMatchingWatches({
3464
3480
  data: event.data,
3465
3481
  eventType: event.eventType,
3466
3482
  namespace: event.namespace,
3467
3483
  identifier: event.identifier,
3468
3484
  state: work.state
3469
- })))), eventAutomationTeamId ? findMatchingEventAutomations(getDb(), events, eventAutomationTeamId, getEventCatalog()) : Promise.resolve([])]);
3485
+ }), WATCH_MATCH_CONCURRENCY), eventAutomationTeamId ? findMatchingEventAutomations(getDb(), events, eventAutomationTeamId, getEventCatalog()) : Promise.resolve([])]);
3470
3486
  return [...subscriptions, ...tasks].some((matched) => matched.length > 0);
3471
3487
  },
3472
3488
  async neededMatchKeys(input) {
@@ -5155,142 +5171,6 @@ function createAcpHttpHandler(options) {
5155
5171
  }
5156
5172
  };
5157
5173
  }
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
5174
  // src/api/mcp/oauth/state.ts
5295
5175
  /** Return the SHA-256 hex digest of a secret or unbounded value. */
5296
5176
  function sha256Hex(value) {
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "./config-DY5c1E0l.js";
2
- import { E as withSpan, h as logWarn } from "./logging-DjW7LjgJ.js";
3
- import { _ as getQueueProvider, c as QUEUE_SIGNATURE_MAX_AGE_MS, h as queueCallback, l as signQueueMessage, u as verifyQueueMessage } from "./task-queue-BEl5G38v.js";
1
+ import { i as getChatConfig } from "./config-BIyIdTtA.js";
2
+ import { E as withSpan, h as logWarn } from "./logging-BNUovdcX.js";
3
+ import { _ as getQueueProvider, c as QUEUE_SIGNATURE_MAX_AGE_MS, h as queueCallback, l as signQueueMessage, u as verifyQueueMessage } from "./task-queue-D0_qbnpo.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-C0IblNtf.js").then((n) => n.s);
172
+ const { runCacheWarmup } = await import("./warmup-DN9OHN1-.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-DuWH_YIb.js";
1
+ import { F as briefResourceLabel, L as parseBriefInput, M as briefCodeChangeSchema, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-CzrLhdHG.js";
2
+ import { c as generateBrief, n as briefEntriesFromReportEvents, t as BRIEF_PROMPT, u as completeObject } from "./prompt-DEqjDVMs.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-DY5c1E0l.js").then((n) => n.r);
267
+ const { botConfig } = await import("./config-BIyIdTtA.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-yht0oxq6.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-CNE4ZBnG.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-DxivxUYd.js";
2
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-sJLhgPQV.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-D47mlszd.js").then((n) => n.Cn),
103
- import("../catalog-runtime-Se9idiDR.js").then((n) => n.t),
104
- import("../validation--hsjOLRL.js").then((n) => n.r),
105
- import("../db-C21CyyTE.js").then((n) => n.n)
102
+ import("../projection-Ce4pmhKP.js").then((n) => n.Cn),
103
+ import("../catalog-runtime-Chc_IP2o.js").then((n) => n.t),
104
+ import("../validation-CRbvRPvu.js").then((n) => n.r),
105
+ import("../db-CFUpEZi9.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-D47mlszd.js").then((n) => n.Bn);
155
+ const { setBriefsConfig, setEventEmbeddingsConfig } = await import("../projection-Ce4pmhKP.js").then((n) => n.Bn);
156
156
  setBriefsConfig({ enabled: true });
157
157
  setEventEmbeddingsConfig({ enabled: true });
158
- const { runLocalAgentTurn } = await import("../runner-eVlnUkY7.js");
159
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-OJP8Y4Ca.js");
160
- const { createLocalOAuthState } = await import("../oauth-relay-KwDz41Z3.js").then((n) => n.t);
161
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DZL_0lnG.js");
162
- const { bindSpawnAgent } = await import("../spawn-vhMAmLuh.js").then((n) => n.n);
163
- const { bindMessageAgent } = await import("../message-BPPZpdoZ.js").then((n) => n.n);
164
- const { createChildConversationWorker, createDeliverToParent } = await import("../result-CP99Ok0_.js").then((n) => n.o);
165
- const { createConversationTurnWorker } = await import("../conversation-turn-CkzrIfJ2.js").then((n) => n.t);
166
- const { skipInputAfterConversationStop } = await import("../session-stop-D3S7mSkX.js").then((n) => n.a);
158
+ const { runLocalAgentTurn } = await import("../runner-eGIxpAMf.js");
159
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-1Fizd1EM.js");
160
+ const { createLocalOAuthState } = await import("../oauth-relay-DOwngqdM.js").then((n) => n.t);
161
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DMFB1kCp.js");
162
+ const { bindSpawnAgent } = await import("../spawn-DBi4-zD8.js").then((n) => n.n);
163
+ const { bindMessageAgent } = await import("../message-DcUsS2vg.js").then((n) => n.n);
164
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-ZGnDzcsb.js").then((n) => n.o);
165
+ const { createConversationTurnWorker } = await import("../conversation-turn-CZaYQUum.js").then((n) => n.t);
166
+ const { skipInputAfterConversationStop } = await import("../session-stop-P2XdTiwr.js").then((n) => n.a);
167
167
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
168
- const { processConversationWork } = await import("../worker-CiyRr2q7.js").then((n) => n.n);
168
+ const { processConversationWork } = await import("../worker-C9ZfJXmV.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-Bm6uSO9V.js";
2
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DjW7LjgJ.js";
3
- import { b as parsePluginManifest, y as parseInlinePluginManifest } from "../registry-yht0oxq6.js";
1
+ import { t as mapBounded } from "../fan-out-Cod-yEHG.js";
2
+ import { i as parseSkillFile } from "../skills-Zg8-vrje.js";
3
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-BNUovdcX.js";
4
+ import { b as parsePluginManifest, y as parseInlinePluginManifest } from "../registry-CNE4ZBnG.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-B78_KmfR.js")).runAdmin(argv);
48
+ return await (await import("../admin-u30A8TcD.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-tI3LBg2_.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-B1VXCTqg.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-DR8mp-TK.js")).runBriefs(argv);
54
+ return await (await import("../briefs-BHi70IR5.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-C21CyyTE.js";
2
- import { Fn as setPlugins, In as validatePlugins, Ua as createPluginLogger } from "../projection-D47mlszd.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-Se9idiDR.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation--hsjOLRL.js";
1
+ import { o as getDb } from "../db-CFUpEZi9.js";
2
+ import { Fn as setPlugins, In as validatePlugins, Wa as createPluginLogger } from "../projection-Ce4pmhKP.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Chc_IP2o.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CRbvRPvu.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-DY5c1E0l.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-Se9idiDR.js";
3
- import { n as resolve } from "../resolve-gZ-hVMYl.js";
4
- import { Ki as create, wa as SANDBOX_RUNTIME } from "../projection-D47mlszd.js";
5
- import { Z as disconnectStateAdapter } from "../db-C21CyyTE.js";
1
+ import { i as getChatConfig } from "../config-BIyIdTtA.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Chc_IP2o.js";
3
+ import { n as resolve } from "../resolve-qbPg-aC-.js";
4
+ import { Ta as SANDBOX_RUNTIME, qi as create } from "../projection-Ce4pmhKP.js";
5
+ import { Q as disconnectStateAdapter } from "../db-CFUpEZi9.js";
6
6
  // src/cli/snapshot-create.ts
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
8
8
  function progressMessage(phase) {