@sentry/junior 0.303.0 → 0.305.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 (82) hide show
  1. package/dist/{adapter-context-BdVnSuY5.js → adapter-context-BpvbUki8.js} +2 -2
  2. package/dist/{admin-AfeAdS3J.js → admin-CoDt35ny.js} +5 -5
  3. package/dist/{agent-runner-BP8_DLUv.js → agent-runner-C5d6rY5g.js} +600 -389
  4. package/dist/api/schema.d.ts +1 -1
  5. package/dist/api/schema.js +5 -5
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +59 -61
  8. package/dist/{app-Dd9v1mNx.d.ts → app-Cs157Zc5.d.ts} +5 -3
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +86 -82
  11. package/dist/{automation-D9MvhOWY.js → automation-CuA3yEcD.js} +1 -1
  12. package/dist/{background-compaction-queue-xaE05jxH.js → background-compaction-queue-BTqMIfTA.js} +7 -3
  13. package/dist/{briefs-D8i-dKTp.js → briefs-BRdznF7c.js} +11 -8
  14. package/dist/{catalog-runtime-d1EM6Z0V.js → catalog-runtime-J52Tej47.js} +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +5 -5
  17. package/dist/cli/init.js +1 -1
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +5 -5
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +4 -4
  23. package/dist/{config-oGM7KA9M.js → config-CBZp0udd.js} +101 -7
  24. package/dist/{connections-BlikzEJv.js → connections-BYmuJ6Vm.js} +6 -6
  25. package/dist/{continue-in-slack-BZnYifiG.js → continue-in-slack-Cvot6S38.js} +8 -8
  26. package/dist/{conversation-CY1jnBiC.js → conversation-BOqdRtUx.js} +4 -12
  27. package/dist/{conversation-feed-BZJRk6UV.js → conversation-feed-CgpgP7yi.js} +35 -2
  28. package/dist/{conversation-privacy-Cx515ddM.js → conversation-privacy-D2pOzBNl.js} +10 -2
  29. package/dist/{conversation-turn-DAhRdX4m.js → conversation-turn-CI8WDpnK.js} +17 -17
  30. package/dist/{credential-sync-DfhmWFeo.js → credential-sync-COqnZ1Dx.js} +14 -14
  31. package/dist/{db-C-2tFxk3.js → db-DU84dCVu.js} +169 -6
  32. package/dist/{db-DPqcEM9_.d.ts → db-zbN5ZV_o.d.ts} +2 -2
  33. package/dist/{executor-NVfS8aQ2.js → executor-CFyrgOu1.js} +43 -9
  34. package/dist/{history-UZ3M2M9r.js → history-m2-ceTTX.js} +8 -2
  35. package/dist/{install-CHLrpRZc.js → install-CQ76CfRw.js} +2 -2
  36. package/dist/instrumentation.js +7 -3
  37. package/dist/{lineage-HGLhd_-N.js → lineage-DLd2UxVP.js} +2 -2
  38. package/dist/{logging-DiyqRLBx.js → logging-BPNTQVFu.js} +1 -1
  39. package/dist/{message-CkCOcbFH.js → message-BWJLeQ5e.js} +8 -8
  40. package/dist/{model-input-DmoPPtPE.js → model-input-DoM9Ht-d.js} +2 -2
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +5 -5
  43. package/dist/{oauth-callback-server-CIf_6YmA.js → oauth-callback-server-DeHbnAQl.js} +2 -2
  44. package/dist/{projection-DBq8tsA5.js → projection-CcFBVFUo.js} +552 -63
  45. package/dist/{prompt-D2KlJopL.js → prompt-C5LREK2p.js} +185 -12
  46. package/dist/{queue-DFaOscp5.js → queue-B2AAL3ym.js} +4 -4
  47. package/dist/{registry-Bu0Z9BEO.js → registry-BjZZqKqi.js} +1 -1
  48. package/dist/{resolve-DXuA3G0g.js → resolve-CeJgXuH1.js} +3 -3
  49. package/dist/{result-DpiNseDA.js → result-icDrueyB.js} +8 -8
  50. package/dist/{runner-iu1heRFv.js → runner-nVfMkMMB.js} +9 -9
  51. package/dist/{sandbox-egress-signals-2HFYDcQf.js → sandbox-egress-signals-H9vQ5qRf.js} +1 -1
  52. package/dist/{schema-DvfX3Gq_.js → schema-Bx0Mlo32.js} +3 -3
  53. package/dist/{schema-DHMOaRzC.d.ts → schema-CKcu-IK6.d.ts} +43 -11
  54. package/dist/{service-account-BcT5LR7V.js → service-account-DU5865XA.js} +6 -5
  55. package/dist/{service-account-xYkaQTrw.js → service-account-Dw06p3zm.js} +5 -5
  56. package/dist/{session-stop-BLLp1IP_.js → session-stop-uotLtp4g.js} +181 -59
  57. package/dist/{skills-CNAGH4ju.js → skills-Bex1EaO5.js} +2 -2
  58. package/dist/{slack-conversation-unfurl-DYnqe5ci.js → slack-conversation-unfurl-EPG3riWF.js} +12 -11
  59. package/dist/{spawn-cGasWW33.js → spawn-CoD3vDuS.js} +6 -6
  60. package/dist/{state-CDS6h_Wv.js → state-nCR4Muhn.js} +4 -4
  61. package/dist/{stop-DMMA67yT.js → stop-BFVd0P0m.js} +170 -65
  62. package/dist/{store-Dgs7Oe44.js → store-Ca6G962n.js} +5 -5
  63. package/dist/{task-queue-DcF0nhhz.js → task-queue-BLPZU6kC.js} +3 -3
  64. package/dist/{task-runner-BGXF7Fo7.js → task-runner-xsOPIxCZ.js} +7 -7
  65. package/dist/{thread-context-BPky1KBe.js → thread-context-BOvZhsKK.js} +8 -8
  66. package/dist/{turn-session-routing-DGvn9MSl.js → turn-session-routing-2bW2qfeb.js} +8 -8
  67. package/dist/{turn-user-message-19CkuUvM.js → turn-user-message-BrhuyYrH.js} +3 -3
  68. package/dist/{validation-lu1DgjNQ.js → validation-BnY9K5WB.js} +1 -1
  69. package/dist/{version-Uo3c94Dx.js → version-qROlRQGF.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{viewer-BPQHMx3-.js → viewer-CxUiOraX.js} +3 -3
  72. package/dist/{warmup-H8uLvW9e.js → warmup--Gkz7iB-.js} +79 -476
  73. package/dist/{worker-B-pM_-3K.js → worker-DJ8d9fmD.js} +7 -7
  74. package/migrations/0111_attachment_kinds.sql +14 -0
  75. package/migrations/0112_attachment_url_fill.sql +51 -0
  76. package/migrations/0113_attachment_url_index.sql +1 -0
  77. package/migrations/meta/0099_snapshot.json +102 -326
  78. package/migrations/meta/0111_snapshot.json +5011 -0
  79. package/migrations/meta/0112_snapshot.json +5011 -0
  80. package/migrations/meta/0113_snapshot.json +5033 -0
  81. package/migrations/meta/_journal.json +21 -0
  82. package/package.json +7 -7
package/dist/app.js CHANGED
@@ -1,43 +1,43 @@
1
- import { $r as reviewItemReaderForUser, As as setConfigDefaults, C as settleConversationTitleWork, Ci as bindEventAutomationCredentialSubject, Co as readConversationAccessFromSql, Cs as createPluginCache, Da as openSlackModal, Di as verifyScheduledAutomationCredentialSubject, Dr as createPluginReviewItems, Ei as verifyEventAutomationCredentialSubject, Er as projectConversationMessages, Fa as slackExternalRefIdSchema, Fi as getDashboardReviewItemLink, Ga as consumeSandboxEgressAuthRequiredSignal, Hi as createPluginState, Io as readConversationLastEventSeq, Ja as parseSandboxEgressCredentialToken, Ka as consumeSandboxEgressPermissionDeniedSignal, Li as getDashboardTaskLink, Lo as readConversationMessageEventSeq, Mr as dismissOpenReviewItems, Mt as hasRunnableConversationWork, No as readConversationEventPage, Oa as postSlackEphemeralMessage, Oi as verifySlackDirectCredentialSubject, Pa as slackEntitySchema, Po as readConversationEventPageAfter, Pt as isInvalidConversationRecordError, Qa as normalizeSandboxEgressTracePropagationDomains, Qo as getSlackClient, Rt as pruneActiveConversation, Si as takeDueTimerWatches, Ti as bindSlackDirectCredentialSubject, Ur as canActOnReviewItem, Vi as setDashboardConversationLinkOptions, Wa as clearSandboxEgressSignals, Zn as createUserTokenStore, _ as appendConversationMessages, ao as createPluginEmbedder, ar as getPluginRoutes, ca as proxyVercelSandboxEgressRequest, cs as runWithWorkspaceTeamId, dt as CONVERSATION_WORK_STALE_ENQUEUE_MS, ei as reviewItemReaderForUserInConversation, es as isDmChannel, fa as resolveBaseUrl, fr as setPlugins, gr as setBriefsConfig, hi as collectEventMatchKeys, hs as listConversationAnnotations, ir as getPluginApiRoutes, ji as getDashboardConversationLink, ks as getConfigDefaults, ms as createPluginAnnotations, nr as createPluginEventPublisher, oi as createCodeChangePublisher, pr as validatePlugins, sa as isVercelSandboxEgressRequest, ss as getWorkspaceTeamId, ur as getPlugins, us as resolveRootVisibility, wi as bindScheduledAutomationCredentialSubject, ya as slackMention, yi as findMatchingWatches, yo as createPluginLogger, zr as searchReviewItems } from "./projection-DBq8tsA5.js";
2
- import { Z as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setBotName, u as resetRuntimeConfig } from "./config-oGM7KA9M.js";
3
- import { $ as fenceLock, B as recordGoogleSignIn, G as createCache, J as getStateAdapter, K as disconnectStateAdapter, P as resolveActorIdentityId, Z as MUTATION_LOCK_TTL_MS, a as getConversationStore, et as withLock, f as withConversationEventLock, mt as createSlackDestination, o as getDb, pt as touchConversationDetail, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, x as withConversationMutationLock } from "./db-C-2tFxk3.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-DiyqRLBx.js";
5
- import { D as parseSlackUserInputSubmission, E as parseSlackReviewItemFormTarget, S as findSlackThreadOwnerId, T as parseSlackReviewItemClick, _ as logScheduledAutomationRunSkipped, b as resolveSlackReviewItemCardConversationId, h as unpublishedArtifactHeaders, m as readPublicArtifact, n as executeAgentRun, p as publicArtifactHeaders, r as processBackgroundCompaction, t as createAgentRunner, v as scheduledAutomationRunAttributes, w as buildSlackReviewItemModal, x as syncReviewItemSlackCards, y as createSlackReviewItemShow } from "./agent-runner-BP8_DLUv.js";
6
- import { $ as slackChannelMessageEvent, F as renderTaskInput, J as isExperimentalFeatureEnabled, V as renderSlackObjectCard, X as getEventCatalog, Y as setExperimentalFeatures, Z as SLACK_EVENT_NAMESPACE, b as getAuthPausedConversationTurnId, et as slackChannelMessageReplyThreadTs, q as getExperimentalFeatures, tt as slackChannelMessageRunsAutomation } from "./session-stop-BLLp1IP_.js";
7
- import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-CHLrpRZc.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
9
- import { $ as readObjectLinkTypes, A as isAllowedSignInEmail, B as runAutoArchiveSweep, C as encodeConversationCursor, Ct as getThreadStopDecision, F as actOnReviewItem, I as closeReviewItemsAnsweredByReply, J as backfillCacheWarmingGaps, K as runSavingsRefillSlice, L as readReviewItemForUser, M as resolveAllowedDomains, N as stopConversation, O as assertNoLegacyAllowedDomains, P as ReviewItemActionError, R as reviewItemChange, S as decodeConversationCursor, St as SubscribedReplyReason, T as readConversationPendingMessages, V as setConversationAutoArchive, Y as GET$4, _t as createSlackWebApiStatusSender, at as createProductionConversationWorkOptions, b as createConversationForViewer, bt as stripLeadingBotMention, ct as buildSlackInboundMessage, dt as normalizeIncomingSlackThreadId, ft as withNormalizedThreadId, gt as recordSkippedConversationMessage, ht as failStoppedDispatch, i as readConversationFeed, it as publicAddressLookup, j as readEnvList, k as isAllowedDomain, l as readConversationDetail, lt as clearSlackPendingReactions, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, ot as createProductionSlackWebhookServices, rt as isPublicAddress, s as pinConversation, st as getProductionSlackAdapter, t as stopConversationTurnForViewer, ut as slackInboundMessageId, v as readConversationRecordFromSql, vt as bindMessageAuthorIdentityId, w as cancelConversationPendingMessagesForViewer, xt as parseContent, y as appendConversationMessageForViewer, yt as startProcessingReaction, z as archiveViewerDoneConversations } from "./stop-DMMA67yT.js";
10
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-lu1DgjNQ.js";
1
+ import { Ar as dismissOpenReviewItems, Bi as createPluginState, C as settleConversationTitleWork, Ci as bindSlackDirectCredentialSubject, Ea as postSlackEphemeralMessage, Ei as verifySlackDirectCredentialSubject, Fi as getDashboardTaskLink, Fo as readConversationMessageEventSeq, Fs as getConfigDefaults, Ha as clearSandboxEgressSignals, Is as setConfigDefaults, Ka as parseSandboxEgressCredentialToken, Ko as collectAttachmentGarbage, Lr as searchReviewItems, Ma as slackEntitySchema, Mo as readConversationEventPageAfter, Mt as hasRunnableConversationWork, Na as slackExternalRefIdSchema, Ni as getDashboardReviewItemLink, Po as readConversationLastEventSeq, Pt as isInvalidConversationRecordError, Qr as reviewItemReaderForUserInConversation, Rt as pruneActiveConversation, Si as bindScheduledAutomationCredentialSubject, Ta as openSlackModal, Ti as verifyScheduledAutomationCredentialSubject, Tr as createPluginReviewItems, Ua as consumeSandboxEgressAuthRequiredSignal, Vr as canActOnReviewItem, Wa as consumeSandboxEgressPermissionDeniedSignal, Xa as normalizeSandboxEgressTracePropagationDomains, Xo as requestAttachmentDeletion, Yn as createUserTokenStore, Zr as reviewItemReaderForUser, _ as appendConversationMessages, _a as slackMention, _i as findMatchingWatches, _o as createPluginLogger, aa as isVercelSandboxEgressRequest, bi as takeDueTimerWatches, bs as createPluginAnnotations, cr as getPlugins, dr as validatePlugins, dt as CONVERSATION_WORK_STALE_ENQUEUE_MS, er as createPluginEventPublisher, gs as resolveRootVisibility, ii as createCodeChangePublisher, is as getSlackClient, jo as readConversationEventPage, ki as getDashboardConversationLink, ks as createPluginCache, mr as setBriefsConfig, ms as runWithWorkspaceTeamId, nr as getPluginApiRoutes, oa as proxyVercelSandboxEgressRequest, os as isDmChannel, pi as collectEventMatchKeys, ps as getWorkspaceTeamId, ro as createPluginEmbedder, rr as getPluginRoutes, ua as resolveBaseUrl, ur as setPlugins, wi as verifyEventAutomationCredentialSubject, wr as projectConversationMessages, xi as bindEventAutomationCredentialSubject, xo as readConversationAccessFromSql, xs as listConversationAnnotations, zi as setDashboardConversationLinkOptions } from "./projection-CcFBVFUo.js";
2
+ import { d as restoreRuntimeConfig, et as getAttachmentStorage, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setBotName, u as resetRuntimeConfig } from "./config-CBZp0udd.js";
3
+ import { $ as MUTATION_LOCK_TTL_MS, C as withConversationMutationLock, H as recordGoogleSignIn, I as resolveActorIdentityId, J as disconnectStateAdapter, X as getStateAdapter, a as getConversationStore, gt as createSlackDestination, ht as touchConversationDetail, m as withConversationEventLock, nt as withLock, o as getDb, p as deleteMessageLinks, q as createCache, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, tt as fenceLock } from "./db-DU84dCVu.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-BPNTQVFu.js";
5
+ import { 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-C5d6rY5g.js";
6
+ import { $ as SLACK_EVENT_NAMESPACE, F as renderTaskInput, H as annotationKeyDigest, Q as getEventCatalog, U as decodeAnnotationRef, V as renderSlackObjectCard, X as isExperimentalFeatureEnabled, Y as getExperimentalFeatures, Z as setExperimentalFeatures, b as getAuthPausedConversationTurnId, nt as slackChannelMessageReplyThreadTs, rt as slackChannelMessageRunsAutomation, tt as slackChannelMessageEvent } from "./session-stop-uotLtp4g.js";
7
+ import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-CQ76CfRw.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
9
+ import { $ as readObjectLinkTypes, A as isAllowedSignInEmail, B as runAutoArchiveSweep, C as encodeConversationCursor, Ct as getThreadStopDecision, F as actOnReviewItem, I as closeReviewItemsAnsweredByReply, J as backfillCacheWarmingGaps, K as runSavingsRefillSlice, L as readReviewItemForUser, M as resolveAllowedDomains, N as stopConversation, O as assertNoLegacyAllowedDomains, P as ReviewItemActionError, R as reviewItemChange, S as decodeConversationCursor, St as SubscribedReplyReason, T as readConversationPendingMessages, V as setConversationAutoArchive, Y as GET$4, _t as createSlackWebApiStatusSender, at as createProductionConversationWorkOptions, b as createConversationForViewer, bt as stripLeadingBotMention, ct as buildSlackInboundMessage, dt as normalizeIncomingSlackThreadId, ft as withNormalizedThreadId, gt as recordSkippedConversationMessage, ht as failStoppedDispatch, i as readConversationFeed, it as publicAddressLookup, j as readEnvList, k as isAllowedDomain, l as readConversationDetail, lt as clearSlackPendingReactions, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, ot as createProductionSlackWebhookServices, rt as isPublicAddress, s as pinConversation, st as getProductionSlackAdapter, t as stopConversationTurnForViewer, ut as slackInboundMessageId, v as readConversationRecordFromSql, vt as bindMessageAuthorIdentityId, w as cancelConversationPendingMessagesForViewer, xt as parseContent, y as appendConversationMessageForViewer, yt as startProcessingReaction, z as archiveViewerDoneConversations } from "./stop-BFVd0P0m.js";
10
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BnY9K5WB.js";
11
11
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-Bkk0XRo2.js";
12
- import { Cr as joinPublicChannel, Di as missingAutomationSkillReason, E as processWorkspaceSnapshotJob, Ei as findAutomationSkill, Jn as setConversationSubscription, L as lookupSlackUserProfile, Mt as collectAttachmentGarbage, Oi as effectiveTaskOutcomes, Ot as collectAttachmentUploadGarbage, Pt as requestAttachmentDeletion, Qt as listPendingAgentInvocationResults, Sn as recordSubagentEnded, Tt as webActorFromUser, Zt as listPendingAgentInvocationMailboxAppends, _t as renderReviewItemMessage, bt as appendAndEnqueueWebMessage, dt as markConversationRead, fi as ViewerTaskNotFoundError, gi as readViewerAutomationSummary, gt as deliverReviewItemChange, hn as enqueueAgentInvocation, k as ingestEvent, lt as archiveConversation, mi as readViewerAutomationExecutions, ur as parseSlackThreadId, vi as readViewerAutomations, vt as reviewItemChangeRecord, wt as recordWebConversationActivity, xt as conversationTurnIdForMessage } from "./warmup-H8uLvW9e.js";
13
- import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-D9MvhOWY.js";
14
- import { E as notifyAutomationBlocked, G as readScheduledAutomation, I as recordAutomationExecution, J as scheduledRunId, O as existingConversationId, U as listScheduledAutomationsForTeam, X as blockEventAutomation, Y as withScheduledAutomationLock, Z as collectEventAutomationMatchKeys, b as listPendingDispatchMailboxAppends, bt as eventGuidance, c as coerceThreadConversationState, d as confirmDispatchMailboxAppend, et as findMatchingEventAutomations, f as createOrGetDispatch, g as getDispatchRecord, l as buildDispatchId, lt as automationVersionOf, ot as admitEventAutomationRun, p as getDispatchConversationId, q as saveScheduledAutomationInLock, st as eventAutomationRunLimitReason, v as getPluginDispatchProjection, w as markDispatchFailed, y as isTerminalDispatchStatus } from "./turn-session-routing-DGvn9MSl.js";
15
- import { F as juniorDestinations, M as juniorConversations, T as juniorConversationEvents, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, x as juniorConversationBriefs } from "./executor-NVfS8aQ2.js";
12
+ import { At as collectAttachmentUploadGarbage, Ci as missingAutomationSkillReason, Ct as conversationTurnIdForMessage, Dt as webActorFromUser, E as processWorkspaceSnapshotJob, Et as recordWebConversationActivity, Gn as setConversationSubscription, Jt as listPendingAgentInvocationMailboxAppends, L as lookupSlackUserProfile, Si as findAutomationSkill, St as appendAndEnqueueWebMessage, Yt as listPendingAgentInvocationResults, bt as reviewItemChangeRecord, ci as ViewerTaskNotFoundError, dt as archiveConversation, fi as readViewerAutomationSummary, fn as enqueueAgentInvocation, k as ingestEvent, mi as readViewerAutomations, pt as markConversationRead, sr as parseSlackThreadId, ui as readViewerAutomationExecutions, vt as deliverReviewItemChange, wi as effectiveTaskOutcomes, yn as recordSubagentEnded, yr as joinPublicChannel, yt as renderReviewItemMessage } from "./warmup--Gkz7iB-.js";
13
+ import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-CuA3yEcD.js";
14
+ import { E as notifyAutomationBlocked, G as readScheduledAutomation, I as recordAutomationExecution, J as scheduledRunId, O as existingConversationId, U as listScheduledAutomationsForTeam, X as blockEventAutomation, Y as withScheduledAutomationLock, Z as collectEventAutomationMatchKeys, b as listPendingDispatchMailboxAppends, bt as eventGuidance, c as coerceThreadConversationState, d as confirmDispatchMailboxAppend, et as findMatchingEventAutomations, f as createOrGetDispatch, g as getDispatchRecord, l as buildDispatchId, lt as automationVersionOf, ot as admitEventAutomationRun, p as getDispatchConversationId, q as saveScheduledAutomationInLock, st as eventAutomationRunLimitReason, v as getPluginDispatchProjection, w as markDispatchFailed, y as isTerminalDispatchStatus } from "./turn-session-routing-2bW2qfeb.js";
15
+ import { I as juniorDestinations, N as juniorConversations, T as juniorConversationEvents, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, x as juniorConversationBriefs } from "./executor-CFyrgOu1.js";
16
16
  import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-CPbZjomA.js";
17
- import { a as queueCallback, c as verifyConversationQueueMessage, f as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyBackgroundCompactionMessage, o as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-xaE05jxH.js";
18
- import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-Dgs7Oe44.js";
17
+ import { a as queueCallback, c as verifyConversationQueueMessage, f as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyBackgroundCompactionMessage, o as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-BTqMIfTA.js";
18
+ import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-Ca6G962n.js";
19
19
  import { a as getNextRunAtMs } from "./schedule-cP0AACm1.js";
20
- import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-DpiNseDA.js";
20
+ import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-icDrueyB.js";
21
21
  import { n as readSchedulerSecret, r as readSignInSecret } from "./secrets-DHaJ5TTn.js";
22
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DfhmWFeo.js";
22
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-COqnZ1Dx.js";
23
23
  import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
24
24
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
25
- import { P as conversationTitleSchema, et as conversationBriefSchema, m as conversationFeedQuerySchema, x as conversationSurfaceSchema, y as conversationReportStatusSchema, z as annotationCard } from "./conversation-CY1jnBiC.js";
26
- import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-BPQHMx3-.js";
25
+ import { $ as conversationBriefSchema, N as conversationTitleSchema, R as annotationCard, b as conversationSurfaceSchema, v as conversationReportStatusSchema } from "./conversation-BOqdRtUx.js";
26
+ import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-CxUiOraX.js";
27
27
  import { b as slackMessageTsSchema, g as slackTeamIdSchema, h as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId, v as parseSlackMessageTs, y as slackMessageTsFromMs } from "./actor-D2iXzvlN.js";
28
- 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-DYnqe5ci.js";
29
- import { o as unlinkProvider } from "./connections-BlikzEJv.js";
28
+ 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-EPG3riWF.js";
29
+ import { o as unlinkProvider } from "./connections-BYmuJ6Vm.js";
30
30
  import { s as buttonUserInputField } from "./web-message-id-lNodcCOI.js";
31
- import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-BdVnSuY5.js";
32
- import { a as resumeConversationDelivery } from "./conversation-turn-DAhRdX4m.js";
33
- import { t as processConversationWork } from "./worker-B-pM_-3K.js";
34
- import { t as bindMessageAgent } from "./message-CkCOcbFH.js";
35
- import { t as bindSpawnAgent } from "./spawn-cGasWW33.js";
36
- import { a as pluginTaskQueueConsumer, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-DcF0nhhz.js";
37
- import { t as processPluginTask } from "./task-runner-BGXF7Fo7.js";
38
- import { i as registerVercelCacheWarmupDevConsumer, l as verifyWorkspaceSnapshotJobMessage, n as cacheWarmupQueueConsumer, o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, r as createVercelCacheWarmupCallback } from "./queue-DFaOscp5.js";
39
- import { t as JUNIOR_VERSION } from "./version-Uo3c94Dx.js";
40
- import { s as conversationPendingMessageDeliverySchema } from "./conversation-feed-BZJRk6UV.js";
31
+ import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-BpvbUki8.js";
32
+ import { a as resumeConversationDelivery } from "./conversation-turn-CI8WDpnK.js";
33
+ import { t as processConversationWork } from "./worker-DJ8d9fmD.js";
34
+ import { t as bindMessageAgent } from "./message-BWJLeQ5e.js";
35
+ import { t as bindSpawnAgent } from "./spawn-CoD3vDuS.js";
36
+ import { a as pluginTaskQueueConsumer, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-BLPZU6kC.js";
37
+ import { t as processPluginTask } from "./task-runner-xsOPIxCZ.js";
38
+ import { i as registerVercelCacheWarmupDevConsumer, l as verifyWorkspaceSnapshotJobMessage, n as cacheWarmupQueueConsumer, o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, r as createVercelCacheWarmupCallback } from "./queue-B2AAL3ym.js";
39
+ import { t as JUNIOR_VERSION } from "./version-qROlRQGF.js";
40
+ import { c as conversationPendingMessageDeliverySchema, n as conversationFeedQuerySchema } from "./conversation-feed-CgpgP7yi.js";
41
41
  import { createRequire } from "node:module";
42
42
  import { Hono } from "hono";
43
43
  import * as z from "zod";
@@ -1574,6 +1574,7 @@ async function purgeConversationTree(executor, args) {
1574
1574
  };
1575
1575
  }
1576
1576
  await executor.db().delete(juniorConversationEvents).where(inArray(juniorConversationEvents.conversationId, ids));
1577
+ await deleteMessageLinks(executor, ids);
1577
1578
  await executor.db().delete(juniorAgentInvocations).where(or(inArray(juniorAgentInvocations.parentConversationId, ids), inArray(juniorAgentInvocations.childConversationId, ids)));
1578
1579
  await executor.db().delete(juniorAgentBindings).where(or(inArray(juniorAgentBindings.parentConversationId, ids), inArray(juniorAgentBindings.childConversationId, ids)));
1579
1580
  await dismissOpenReviewItems(executor.db(), {
@@ -1775,14 +1776,9 @@ const eventSchema = z.object({
1775
1776
  user: z.string().min(1),
1776
1777
  external_ref: z.object({
1777
1778
  type: z.literal("annotation"),
1778
- id: slackExternalRefIdSchema.max(4096)
1779
+ id: slackExternalRefIdSchema
1779
1780
  })
1780
1781
  });
1781
- const refSchema = z.tuple([
1782
- z.string().min(1),
1783
- z.string().min(1),
1784
- z.string().min(1)
1785
- ]);
1786
1782
  /** Show saved annotation facts only to a viewer who can read their Conversation. */
1787
1783
  async function presentSlackAnnotationDetails(event, teamId) {
1788
1784
  const triggerId = event["trigger_id"];
@@ -1797,19 +1793,12 @@ async function presentSlackAnnotationDetails(event, teamId) {
1797
1793
  await missing();
1798
1794
  return;
1799
1795
  }
1800
- let value;
1801
- try {
1802
- value = JSON.parse(Buffer.from(parsed.data.external_ref.id, "base64url").toString("utf8"));
1803
- } catch {
1796
+ const ref = decodeAnnotationRef(parsed.data.external_ref.id);
1797
+ if (!ref) {
1804
1798
  await missing();
1805
1799
  return;
1806
1800
  }
1807
- const ref = refSchema.safeParse(value);
1808
- if (!ref.success) {
1809
- await missing();
1810
- return;
1811
- }
1812
- const [conversationId, plugin, key] = ref.data;
1801
+ const { conversationId, keyDigest } = ref;
1813
1802
  const db = getDb();
1814
1803
  const identity = await readActorIdentity({
1815
1804
  platform: "slack",
@@ -1832,7 +1821,7 @@ async function presentSlackAnnotationDetails(event, teamId) {
1832
1821
  await missing();
1833
1822
  return;
1834
1823
  }
1835
- const annotation = (await listConversationAnnotations(db, conversationId)).find((item) => item.plugin === plugin && item.key === key);
1824
+ const annotation = (await listConversationAnnotations(db, conversationId)).find((item) => annotationKeyDigest(item.plugin, item.key) === keyDigest);
1836
1825
  if (!annotation) {
1837
1826
  await missing();
1838
1827
  return;
@@ -1844,7 +1833,10 @@ async function presentSlackAnnotationDetails(event, teamId) {
1844
1833
  }
1845
1834
  await client.entity.presentDetails({
1846
1835
  trigger_id: parsed.data.trigger_id,
1847
- metadata: slackEntitySchema.parse(entity)
1836
+ metadata: slackEntitySchema.parse({
1837
+ ...entity,
1838
+ external_ref: parsed.data.external_ref
1839
+ })
1848
1840
  });
1849
1841
  }
1850
1842
  // src/chat/ingress/slack-payload.ts
@@ -4182,7 +4174,7 @@ async function streamPrompt(args) {
4182
4174
  })) return false;
4183
4175
  }
4184
4176
  if (page.terminal?.status === "completed") return await args.emit(resultMessage$2(args.output.requestId, { stopReason: page.terminal.outcome === "cancelled" ? "cancelled" : "end_turn" }));
4185
- if (page.terminal?.status === "failed") return await args.emit(errorMessage$1(args.output.requestId, acp.RequestError.internalError({ failureCode: page.terminal.failureCode }, "Junior Turn failed")));
4177
+ if (page.terminal?.status === "failed") return await args.emit(errorMessage$1(args.output.requestId, acp.RequestError.internalError({ failureCode: page.terminal.failureCode }, "Turn failed")));
4186
4178
  }
4187
4179
  return false;
4188
4180
  }
@@ -4383,11 +4375,15 @@ const acpAuthorizationPointerSchema = z.object({
4383
4375
  expiresAtMs: z.number().int().positive(),
4384
4376
  transactionId: z.string().uuid()
4385
4377
  }).strict();
4386
- const ACP_AUTH_METHOD = {
4387
- id: "junior",
4388
- name: "Sign in to Junior",
4389
- description: "Sign in with the Google account allowed by this Junior app."
4390
- };
4378
+ const ACP_AUTH_METHOD_ID = "junior";
4379
+ /** Describe browser sign-in with the configured bot name. */
4380
+ function acpAuthMethod(agentName) {
4381
+ return {
4382
+ id: ACP_AUTH_METHOD_ID,
4383
+ name: `Sign in to ${agentName}`,
4384
+ description: "Sign in with the Google account that this app allows."
4385
+ };
4386
+ }
4391
4387
  function authorizationKey$1(transactionId) {
4392
4388
  return `junior:acp:v1:authorization:${transactionId}`;
4393
4389
  }
@@ -4453,7 +4449,7 @@ function hasAcpConnectionCredential(request, expectedHash) {
4453
4449
  /** Resolve a trusted browser origin, with request fallback only on loopback. */
4454
4450
  function authorizationBaseURL(request, configured) {
4455
4451
  const url = resolvePublicOrigin(request, configured);
4456
- if (!url) throw acp.RequestError.internalError(void 0, "Junior ACP sign-in requires a configured public base URL");
4452
+ if (!url) throw acp.RequestError.internalError(void 0, "ACP sign-in requires a configured public base URL");
4457
4453
  return url;
4458
4454
  }
4459
4455
  async function readAuthorization(state, transactionId) {
@@ -4503,7 +4499,7 @@ function resultMessage$1(requestId) {
4503
4499
  result: {}
4504
4500
  };
4505
4501
  }
4506
- function cancelledMessage(requestId, message = "Junior sign-in was cancelled") {
4502
+ function cancelledMessage(requestId, message = "Sign-in was cancelled") {
4507
4503
  return {
4508
4504
  jsonrpc: "2.0",
4509
4505
  id: requestId,
@@ -4516,7 +4512,7 @@ async function beginAcpAuthorization(args) {
4516
4512
  const result = await withLock(args.state, authorizationPointerLockKey(args.connectionId), async (lock) => {
4517
4513
  const pointer = await readAuthorizationPointer(args.state, args.connectionId);
4518
4514
  if (pointer) {
4519
- if ((await readAuthorization(args.state, pointer.transactionId))?.connectionId === args.connectionId) throw acp.RequestError.invalidRequest(void 0, "Junior sign-in is already in progress");
4515
+ if ((await readAuthorization(args.state, pointer.transactionId))?.connectionId === args.connectionId) throw acp.RequestError.invalidRequest(void 0, "Sign-in is already in progress");
4520
4516
  await fenceLock(args.state, lock, MUTATION_LOCK_TTL_MS);
4521
4517
  await args.state.delete(authorizationPointerKey(args.connectionId));
4522
4518
  }
@@ -4552,7 +4548,7 @@ async function beginAcpAuthorization(args) {
4552
4548
  url.pathname = `/_junior/acp/auth/${transactionId}`;
4553
4549
  const params = {
4554
4550
  mode: "url",
4555
- message: `Sign in to Junior in your browser. Enter verification code ${userCode}.`,
4551
+ message: `Sign in to ${args.agentName} in your browser. Enter verification code ${userCode}.`,
4556
4552
  elicitationId: transactionId,
4557
4553
  requestId: args.requestId,
4558
4554
  url: url.toString()
@@ -4587,7 +4583,7 @@ async function completeAcpAuthorization(args) {
4587
4583
  if (authorization.expiresAtMs <= Date.now()) {
4588
4584
  const completion = await finishAuthorization({
4589
4585
  authorization,
4590
- response: cancelledMessage(authorization.requestId, "Junior sign-in request expired"),
4586
+ response: cancelledMessage(authorization.requestId, "Sign-in request expired"),
4591
4587
  state: args.state
4592
4588
  });
4593
4589
  if (completion === "busy") return completion;
@@ -4605,7 +4601,7 @@ async function completeAcpAuthorization(args) {
4605
4601
  if (binding !== "completed") {
4606
4602
  const completion = await finishAuthorization({
4607
4603
  authorization,
4608
- response: cancelledMessage(authorization.requestId, "Junior sign-in could not bind this connection"),
4604
+ response: cancelledMessage(authorization.requestId, "Sign-in could not bind this connection"),
4609
4605
  state: args.state
4610
4606
  });
4611
4607
  if (completion !== "completed") return completion;
@@ -4670,7 +4666,7 @@ async function expireAcpAuthorization(args) {
4670
4666
  if (authorization.expiresAtMs > Date.now()) return false;
4671
4667
  if (await finishAuthorization({
4672
4668
  authorization,
4673
- response: cancelledMessage(authorization.requestId, "Junior sign-in request expired"),
4669
+ response: cancelledMessage(authorization.requestId, "Sign-in request expired"),
4674
4670
  state: args.state
4675
4671
  }) === "busy") return false;
4676
4672
  await fenceLock(args.state, lock, MUTATION_LOCK_TTL_MS);
@@ -4688,7 +4684,7 @@ async function expireAcpAuthorization(args) {
4688
4684
  /**
4689
4685
  * Own the remote ACP v1 Streamable HTTP edge.
4690
4686
  *
4691
- * Shared state records route short-lived JSON-RPC messages. Junior's
4687
+ * Shared state records route short-lived JSON-RPC messages. The
4692
4688
  * Conversation log remains the source for session replay and Turn output. No
4693
4689
  * request relies on another request reaching the same app process.
4694
4690
  */
@@ -4716,9 +4712,9 @@ function parseParams(schema, params) {
4716
4712
  const firstPath = parsed.error.issues[0]?.path[0];
4717
4713
  throw acp.RequestError.invalidParams({ field: typeof firstPath === "string" || typeof firstPath === "number" ? String(firstPath) : "params" });
4718
4714
  }
4719
- /** Reject client MCP servers because Junior does not use the client workspace. */
4715
+ /** Reject client MCP servers because the agent does not use the client workspace. */
4720
4716
  function rejectUnsupportedMcpServers(mcpServers) {
4721
- if (mcpServers.length > 0) throw acp.RequestError.invalidParams({ field: "mcpServers" }, "Junior does not accept client MCP servers");
4717
+ if (mcpServers.length > 0) throw acp.RequestError.invalidParams({ field: "mcpServers" }, "Client MCP servers are not supported");
4722
4718
  }
4723
4719
  function resourceLinkText(block) {
4724
4720
  return [
@@ -4733,18 +4729,18 @@ function resourceLinkText(block) {
4733
4729
  }
4734
4730
  /** Convert supported ACP content blocks to one bounded Conversation Message. */
4735
4731
  function promptText(prompt) {
4736
- if (prompt.length === 0) throw acp.RequestError.invalidParams({ field: "prompt" }, "Junior accepts one or more text or resource link blocks");
4732
+ if (prompt.length === 0) throw acp.RequestError.invalidParams({ field: "prompt" }, "Prompt must have one or more text or resource link blocks");
4737
4733
  const blocks = [];
4738
4734
  for (const block of prompt) {
4739
4735
  if (block.type === "resource_link") {
4740
4736
  blocks.push(resourceLinkText(block));
4741
4737
  continue;
4742
4738
  }
4743
- if (!block.text.trim()) throw acp.RequestError.invalidParams({ field: "prompt" }, "Junior accepts non-empty text blocks only");
4739
+ if (!block.text.trim()) throw acp.RequestError.invalidParams({ field: "prompt" }, "Text blocks must not be empty");
4744
4740
  blocks.push(block.text);
4745
4741
  }
4746
4742
  const text = blocks.join("\n");
4747
- if (text.length > MAX_PROMPT_TEXT_LENGTH) throw acp.RequestError.invalidParams({ field: "prompt" }, `Junior accepts at most ${MAX_PROMPT_TEXT_LENGTH} prompt characters`);
4743
+ if (text.length > MAX_PROMPT_TEXT_LENGTH) throw acp.RequestError.invalidParams({ field: "prompt" }, `Prompt must have at most ${MAX_PROMPT_TEXT_LENGTH} characters`);
4748
4744
  return text;
4749
4745
  }
4750
4746
  function stableHex(value, length = 32) {
@@ -4900,7 +4896,7 @@ async function handleInitialize(args) {
4900
4896
  if (requestId === void 0) return textResponse("Initialize request must include an ID", 400);
4901
4897
  try {
4902
4898
  parseParams(initializeParamsSchema, args.call.params);
4903
- if (!supportsUrlElicitation(args.call.params)) throw acp.RequestError.invalidParams({ field: "clientCapabilities.elicitation.url" }, "Remote Junior authentication requires URL elicitation support");
4899
+ if (!supportsUrlElicitation(args.call.params)) throw acp.RequestError.invalidParams({ field: "clientCapabilities.elicitation.url" }, "Remote authentication requires URL elicitation support");
4904
4900
  const credential = createAcpConnectionCredential(args.request);
4905
4901
  const result = {
4906
4902
  protocolVersion: acp.PROTOCOL_VERSION,
@@ -4912,7 +4908,7 @@ async function handleInitialize(args) {
4912
4908
  embeddedContext: false
4913
4909
  }
4914
4910
  },
4915
- authMethods: args.browserAuthAvailable ? [ACP_AUTH_METHOD] : [],
4911
+ authMethods: args.browserAuthAgentName ? [acpAuthMethod(args.browserAuthAgentName)] : [],
4916
4912
  agentInfo: {
4917
4913
  name: "junior",
4918
4914
  version: args.version
@@ -4954,13 +4950,14 @@ async function handleConnectedPost(args) {
4954
4950
  createReceipt: async () => {
4955
4951
  try {
4956
4952
  if (identifiedCall.method === acp.methods.agent.authenticate) {
4957
- if (parseParams(authenticateParamsSchema, identifiedCall.params).methodId !== "junior") throw acp.RequestError.invalidParams({ field: "methodId" }, "Junior did not advertise this authentication method");
4953
+ if (parseParams(authenticateParamsSchema, identifiedCall.params).methodId !== "junior") throw acp.RequestError.invalidParams({ field: "methodId" }, "This authentication method was not advertised");
4958
4954
  if (args.authenticated) return { outputs: [{
4959
4955
  kind: "message",
4960
4956
  message: resultMessage(requestId, {})
4961
4957
  }] };
4962
- if (!args.options.browserAuth) throw acp.RequestError.internalError(void 0, "Junior ACP authentication requires an enabled dashboard");
4958
+ if (!args.options.browserAuth) throw acp.RequestError.internalError(void 0, "ACP authentication requires an enabled dashboard");
4963
4959
  return await beginAcpAuthorization({
4960
+ agentName: args.options.browserAuth.agentName,
4964
4961
  baseURL: args.options.browserAuth.baseURL,
4965
4962
  connectionId: args.connectionId,
4966
4963
  credentialHash: args.connection.credentialHash,
@@ -5042,7 +5039,7 @@ function createAcpHttpHandler(options) {
5042
5039
  call = message;
5043
5040
  if (connectionId) return textResponse("Initialize not allowed on existing connection", 400);
5044
5041
  return await handleInitialize({
5045
- browserAuthAvailable: options.browserAuth !== void 0,
5042
+ browserAuthAgentName: options.browserAuth?.agentName,
5046
5043
  call,
5047
5044
  request,
5048
5045
  state,
@@ -5433,7 +5430,7 @@ const MCP_SCOPES = [
5433
5430
  const MCP_SCOPE_DESCRIPTIONS = {
5434
5431
  "conversations:read": "List and read the conversations that you started or take part in",
5435
5432
  "conversations:manage": "Archive, pin, and mark your conversations read, stop a running Turn, and cancel queued messages",
5436
- "conversations:write": "Start conversations and send messages as you. Junior runs agent work for each message",
5433
+ "conversations:write": "Start conversations and send messages as you. Each message starts agent work",
5437
5434
  "review_items:read": "List and read your review items",
5438
5435
  "automations:read": "List and read the automations that you can see"
5439
5436
  };
@@ -5810,7 +5807,7 @@ const MCP_CONSENT_PATH = "/_junior/mcp/authorize/:authorizationId";
5810
5807
  /** Resolve the MCP URLs for this request from the trusted public origin. */
5811
5808
  function resolveMcpUrls(request, baseURL) {
5812
5809
  const origin = resolvePublicOrigin(request, baseURL);
5813
- if (!origin) throw new Error("Junior MCP requires a configured public base URL");
5810
+ if (!origin) throw new Error("MCP requires a configured public base URL");
5814
5811
  const url = (path) => new URL(path, origin).toString();
5815
5812
  return {
5816
5813
  authorize: url(MCP_AUTHORIZE_PATH),
@@ -6932,14 +6929,18 @@ const TOOLS_BY_SCOPE = {
6932
6929
  "review_items:read": [registerSearchReviewItemsTool, registerGetReviewItemTool],
6933
6930
  "automations:read": [registerSearchAutomationsTool, registerGetAutomationTool]
6934
6931
  };
6935
- const READ_INSTRUCTIONS = "Junior is a Slack agent. These tools read and manage your Junior conversations, and read your review items and automations. They cannot send a message or start agent work. To ask Junior for work or to answer a review item, use the Slack or dashboard link in a result.";
6936
- const WRITE_INSTRUCTIONS = "Junior is a Slack agent. These tools read and manage your Junior conversations, and read your review items and automations. createConversation and sendMessage send a message as you, and Junior works on it in the background. They return a `cursor`. Call getConversation with `after` set to the newest `cursor` to read the new messages. Repeat until `status` is not `active` and `hasMore` is not set. `authorization` means a turn waits for you to connect an account. To answer a review item, use the dashboard link in a result.";
6932
+ function readInstructions(agentName) {
6933
+ return `${agentName} is a Slack agent. These tools read and manage your ${agentName} conversations, and read your review items and automations. They cannot send a message or start agent work. To ask ${agentName} for work or to answer a review item, use the Slack or dashboard link in a result.`;
6934
+ }
6935
+ function writeInstructions(agentName) {
6936
+ return `${agentName} is a Slack agent. These tools read and manage your ${agentName} conversations, and read your review items and automations. createConversation and sendMessage send a message as you, and ${agentName} works on it in the background. They return a \`cursor\`. Call getConversation with \`after\` set to the newest \`cursor\` to read the new messages. Repeat until \`status\` is not \`active\` and \`hasMore\` is not set. \`authorization\` means a turn waits for you to connect an account. To answer a review item, use the dashboard link in a result.`;
6937
+ }
6937
6938
  /** Build the MCP server for one authenticated user and granted scopes. */
6938
6939
  function createMcpServer(context, scopes) {
6939
6940
  const server = new McpServer({
6940
6941
  name: "junior",
6941
6942
  version: JUNIOR_VERSION
6942
- }, { instructions: scopes.includes("conversations:write") ? WRITE_INSTRUCTIONS : READ_INSTRUCTIONS });
6943
+ }, { instructions: scopes.includes("conversations:write") ? writeInstructions(botConfig.userName) : readInstructions(botConfig.userName) });
6943
6944
  for (const scope of scopes) for (const register of TOOLS_BY_SCOPE[scope]) register(server, context);
6944
6945
  return server;
6945
6946
  }
@@ -7232,7 +7233,7 @@ function resolveSignInAuthConfig(agentName, allowedDomains, options = {}) {
7232
7233
  };
7233
7234
  }
7234
7235
  function required(value, name) {
7235
- if (!value?.trim()) throw new Error(`${name} is required for Junior sign-in`);
7236
+ if (!value?.trim()) throw new Error(`${name} is required for sign-in`);
7236
7237
  return value.trim();
7237
7238
  }
7238
7239
  function createBetterAuth(config) {
@@ -7697,7 +7698,7 @@ async function createApp(options) {
7697
7698
  setSlackReactionConfig(options?.slack ?? {});
7698
7699
  assertNoLegacyAllowedDomains(Object.keys(dashboard ?? {}));
7699
7700
  allowedDomains = resolveAllowedDomains(options?.allowedDomains);
7700
- if (allowedDomains.length === 0) logWarn("app.allowed_domains.unset", { "app.reason": "allowedDomains is empty, so any Slack workspace member can use Junior" });
7701
+ if (allowedDomains.length === 0) logWarn("app.allowed_domains.unset", { "app.reason": "allowedDomains is empty, so any Slack workspace member can use the bot" });
7701
7702
  if (dashboard && !dashboard.disabled) signInConfig = resolveSignInAuthConfig(botConfig.userName, allowedDomains, dashboard);
7702
7703
  if (shouldValidatePluginCatalog) {
7703
7704
  pluginCatalogRuntime.getSignature();
@@ -7762,7 +7763,10 @@ async function createApp(options) {
7762
7763
  const state = work.state ?? getStateAdapter();
7763
7764
  acpRuntime = {
7764
7765
  handleRequest: createAcpHttpHandler({
7765
- ...dashboard && !dashboard.disabled ? { browserAuth: { baseURL: resolvePublicBaseURL(dashboard) } } : void 0,
7766
+ ...dashboard && !dashboard.disabled ? { browserAuth: {
7767
+ agentName: botConfig.userName,
7768
+ baseURL: resolvePublicBaseURL(dashboard)
7769
+ } } : void 0,
7766
7770
  conversations: createAcpConversations({
7767
7771
  conversationStore: work.conversationStore,
7768
7772
  eventStore: getConversationEventStore(),
@@ -1,5 +1,5 @@
1
1
  import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
2
- import { i as actorIdentitySchema } from "./conversation-CY1jnBiC.js";
2
+ import { i as actorIdentitySchema } from "./conversation-BOqdRtUx.js";
3
3
  import * as z from "zod";
4
4
  import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
5
5
  // src/chat/automations/task.ts
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-oGM7KA9M.js";
2
- import { E as withSpan, m as logInfo, p as logException } from "./logging-DiyqRLBx.js";
1
+ import { i as getChatConfig } from "./config-CBZp0udd.js";
2
+ import { E as withSpan, m as logInfo, p as logException } from "./logging-BPNTQVFu.js";
3
3
  import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
4
4
  import * as z from "zod";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -43,6 +43,10 @@ function getTurnRequestDeadline() {
43
43
  /** Run work with one host request deadline shared by nested queued turns. */
44
44
  function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
45
45
  if (requestDeadlineStorage.getStore()) return callback();
46
+ return runWithNewTurnRequestDeadline(callback, startedAtMs);
47
+ }
48
+ /** Run work that a new host request owns, even inside another request. */
49
+ function runWithNewTurnRequestDeadline(callback, startedAtMs = Date.now()) {
46
50
  return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
47
51
  }
48
52
  // src/chat/queue/bullmq.ts
@@ -367,7 +371,7 @@ function queueCallback(options) {
367
371
  return;
368
372
  }
369
373
  if (checked.status === "unavailable") throw new Error(`Queue message verification unavailable: ${checked.reason}`);
370
- await consume(checked.message, metadata);
374
+ await runWithNewTurnRequestDeadline(() => consume(checked.message, metadata));
371
375
  };
372
376
  const retry = (error, metadata) => {
373
377
  const reason = options.permanentError?.(error);
@@ -1,5 +1,5 @@
1
- import { $ as briefResourceLabel, X as briefCodeChangeSchema, f as conversationEventPageSchema, tt as parseBriefInput, u as conversationDetailReportSchema } from "./conversation-CY1jnBiC.js";
2
- import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-D2KlJopL.js";
1
+ import { Q as briefResourceLabel, Y as briefCodeChangeSchema, et as parseBriefInput, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-BOqdRtUx.js";
2
+ import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C5LREK2p.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -71,7 +71,7 @@ function renderBriefMarkdown(args) {
71
71
  "",
72
72
  list(brief.decisions.filter((decision) => decision.kind === "confirmed").map((decision) => `${decision.text}${decision.by ? ` — ${decision.by}` : ""}`), "None."),
73
73
  "",
74
- "### Assumed by Junior (not confirmed)",
74
+ "### Assumed (not confirmed)",
75
75
  "",
76
76
  list(brief.decisions.filter((decision) => decision.kind === "assumed").map((decision) => `${decision.text}${decision.by ? ` — ${decision.by}` : ""}`), "None."),
77
77
  "",
@@ -248,8 +248,10 @@ async function parseRunOptions(argv) {
248
248
  else snapshots.push(argument);
249
249
  }
250
250
  if (snapshots.length === 0) throw new Error(CLI_USAGE);
251
+ const bot = await configuredBot();
251
252
  return {
252
- model: model ?? await configuredBriefModelId(),
253
+ assistantName: bot.userName,
254
+ model: model ?? bot.fastModelId,
253
255
  out,
254
256
  promptFile,
255
257
  snapshots,
@@ -257,13 +259,13 @@ async function parseRunOptions(argv) {
257
259
  };
258
260
  }
259
261
  /**
260
- * Read the production Brief model only when a run needs it. `chat/config`
262
+ * Read the production bot config only when a run needs it. `chat/config`
261
263
  * reads `DATABASE_URL` at import, and `briefs pull` must work with only a
262
264
  * token.
263
265
  */
264
- async function configuredBriefModelId() {
265
- const { botConfig } = await import("./config-oGM7KA9M.js").then((n) => n.r);
266
- return botConfig.fastModelId;
266
+ async function configuredBot() {
267
+ const { botConfig } = await import("./config-CBZp0udd.js").then((n) => n.r);
268
+ return botConfig;
267
269
  }
268
270
  function apiUrl(baseUrl, pathname) {
269
271
  const base = new URL(baseUrl);
@@ -332,6 +334,7 @@ async function runSnapshot(snapshotPath, options, prompt) {
332
334
  const input = briefInputFromSnapshot(snapshot, finalThroughIndex);
333
335
  const versions = [];
334
336
  for (const throughIndex of generationIndexes(snapshot, options.turnByTurn, finalThroughIndex)) versions.push(await generateBrief({
337
+ assistantName: options.assistantName,
335
338
  completeObject: (request) => completeObject({
336
339
  ...request,
337
340
  modelId: options.model,
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-Bu0Z9BEO.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BjZZqKqi.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-BP8_DLUv.js";
2
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-C5d6rY5g.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-DBq8tsA5.js").then((n) => n.er),
103
- import("../catalog-runtime-d1EM6Z0V.js").then((n) => n.t),
104
- import("../validation-lu1DgjNQ.js").then((n) => n.r),
105
- import("../db-C-2tFxk3.js").then((n) => n.n)
102
+ import("../projection-CcFBVFUo.js").then((n) => n.Qn),
103
+ import("../catalog-runtime-J52Tej47.js").then((n) => n.t),
104
+ import("../validation-BnY9K5WB.js").then((n) => n.r),
105
+ import("../db-DU84dCVu.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,19 +152,19 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-DBq8tsA5.js").then((n) => n.hr);
155
+ const { setBriefsConfig } = await import("../projection-CcFBVFUo.js").then((n) => n.pr);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-iu1heRFv.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CIf_6YmA.js");
157
+ const { runLocalAgentTurn } = await import("../runner-nVfMkMMB.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DeHbnAQl.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-DAmfVmJu.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-2HFYDcQf.js");
161
- const { bindSpawnAgent } = await import("../spawn-cGasWW33.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-CkCOcbFH.js").then((n) => n.n);
163
- const { createChildConversationWorker, createDeliverToParent } = await import("../result-DpiNseDA.js").then((n) => n.o);
164
- const { createConversationTurnWorker } = await import("../conversation-turn-DAhRdX4m.js").then((n) => n.t);
165
- const { skipInputAfterConversationStop } = await import("../session-stop-BLLp1IP_.js").then((n) => n.a);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-H9vQ5qRf.js");
161
+ const { bindSpawnAgent } = await import("../spawn-CoD3vDuS.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-BWJLeQ5e.js").then((n) => n.n);
163
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-icDrueyB.js").then((n) => n.o);
164
+ const { createConversationTurnWorker } = await import("../conversation-turn-CI8WDpnK.js").then((n) => n.t);
165
+ const { skipInputAfterConversationStop } = await import("../session-stop-uotLtp4g.js").then((n) => n.a);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
167
- const { processConversationWork } = await import("../worker-B-pM_-3K.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-DJ8d9fmD.js").then((n) => n.n);
168
168
  let agentRunner;
169
169
  const localConversationWork = createLocalConversationWork(async (message) => {
170
170
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as parseSkillFile } from "../skills-CNAGH4ju.js";
2
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DiyqRLBx.js";
3
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-Bu0Z9BEO.js";
1
+ import { i as parseSkillFile } from "../skills-Bex1EaO5.js";
2
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-BPNTQVFu.js";
3
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BjZZqKqi.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
@@ -383,7 +383,7 @@ async function validateDeploymentConfig(rootDir, packages) {
383
383
  const hasJuniorMarkers = await hasJuniorDeploymentMarkers(rootDir, packages, nitroConfig);
384
384
  if (nitroConfig !== void 0 && hasJuniorMarkers) {
385
385
  checked = true;
386
- if (!/\bjuniorNitro\s*\(/.test(nitroConfig)) errors.push(`${nitroConfigPath}: missing juniorNitro(). The Nitro module emits Junior's Vercel queue trigger and heartbeat cron into the deployed build output.`);
386
+ if (!/\bjuniorNitro\s*\(/.test(nitroConfig)) errors.push(`${nitroConfigPath}: missing juniorNitro(). The Nitro module emits the Vercel queue trigger and heartbeat cron into the deployed build output.`);
387
387
  }
388
388
  const vercelConfigPath = path.join(rootDir, "vercel.json");
389
389
  const vercelConfigText = await readTextFile(vercelConfigPath);
@@ -411,7 +411,7 @@ async function validateDeploymentConfig(rootDir, packages) {
411
411
  }
412
412
  if (hasJuniorMarkers && vercelConfig.framework !== void 0 && vercelConfig.framework !== "nitro") {
413
413
  checked = true;
414
- errors.push(`${vercelConfigPath}: framework must be "nitro" for Junior's Vercel deployment wiring.`);
414
+ errors.push(`${vercelConfigPath}: framework must be "nitro" for the Vercel deployment wiring.`);
415
415
  }
416
416
  if (isRecord(vercelConfig.functions)) {
417
417
  if (vercelConfig.functions["api/internal/agent/continue.ts"] !== void 0) {