@sentry/junior 0.303.0 → 0.304.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-B1IpoELr.js} +2 -2
  2. package/dist/{admin-AfeAdS3J.js → admin-BnVFGo_z.js} +5 -5
  3. package/dist/{agent-runner-BP8_DLUv.js → agent-runner-CoEeZSRh.js} +546 -372
  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 +77 -64
  11. package/dist/{automation-D9MvhOWY.js → automation-CuA3yEcD.js} +1 -1
  12. package/dist/{background-compaction-queue-xaE05jxH.js → background-compaction-queue-WLPNSF_b.js} +2 -2
  13. package/dist/{briefs-D8i-dKTp.js → briefs-CagVVefw.js} +11 -8
  14. package/dist/{catalog-runtime-d1EM6Z0V.js → catalog-runtime-B8ZXvXWm.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-DdO1BNcw.js} +101 -7
  24. package/dist/{connections-BlikzEJv.js → connections-D20kp0j5.js} +6 -6
  25. package/dist/{continue-in-slack-BZnYifiG.js → continue-in-slack-BKEVMBj1.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-L1SK_v0V.js} +10 -2
  29. package/dist/{conversation-turn-DAhRdX4m.js → conversation-turn-BptVJylj.js} +17 -17
  30. package/dist/{credential-sync-DfhmWFeo.js → credential-sync-D1J1CGzL.js} +14 -14
  31. package/dist/{db-C-2tFxk3.js → db-EKJnkrIb.js} +169 -6
  32. package/dist/{db-DPqcEM9_.d.ts → db-zbN5ZV_o.d.ts} +2 -2
  33. package/dist/{executor-NVfS8aQ2.js → executor-CoIZmFK8.js} +43 -9
  34. package/dist/{history-UZ3M2M9r.js → history-m2-ceTTX.js} +8 -2
  35. package/dist/{install-CHLrpRZc.js → install-BT2Pf6HP.js} +2 -2
  36. package/dist/instrumentation.js +7 -3
  37. package/dist/{lineage-HGLhd_-N.js → lineage-C5DGQCS_.js} +2 -2
  38. package/dist/{logging-DiyqRLBx.js → logging-QSZuMcvo.js} +1 -1
  39. package/dist/{message-CkCOcbFH.js → message-TtxftRHj.js} +8 -8
  40. package/dist/{model-input-DmoPPtPE.js → model-input-BHXfA29g.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-B0enqHtZ.js} +2 -2
  44. package/dist/{projection-DBq8tsA5.js → projection-CNKK7doO.js} +547 -61
  45. package/dist/{prompt-D2KlJopL.js → prompt-DSjhoKu5.js} +185 -12
  46. package/dist/{queue-DFaOscp5.js → queue-CDxkit82.js} +4 -4
  47. package/dist/{registry-Bu0Z9BEO.js → registry-DBDNUUmz.js} +1 -1
  48. package/dist/{resolve-DXuA3G0g.js → resolve-CQLhMWSu.js} +3 -3
  49. package/dist/{result-DpiNseDA.js → result-B-pauj42.js} +8 -8
  50. package/dist/{runner-iu1heRFv.js → runner-B3KxKks5.js} +9 -9
  51. package/dist/{sandbox-egress-signals-2HFYDcQf.js → sandbox-egress-signals-DJJX9ClG.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-2HmlNPvy.js} +6 -5
  55. package/dist/{service-account-xYkaQTrw.js → service-account-DQLqkSVv.js} +5 -5
  56. package/dist/{session-stop-BLLp1IP_.js → session-stop-DEeZKqbX.js} +114 -49
  57. package/dist/{skills-CNAGH4ju.js → skills-2UrD7JkN.js} +2 -2
  58. package/dist/{slack-conversation-unfurl-DYnqe5ci.js → slack-conversation-unfurl-Dd129Uov.js} +12 -11
  59. package/dist/{spawn-cGasWW33.js → spawn-eMho9HDJ.js} +6 -6
  60. package/dist/{state-CDS6h_Wv.js → state-Bveuc4Zh.js} +4 -4
  61. package/dist/{stop-DMMA67yT.js → stop-D_ltJLDS.js} +170 -64
  62. package/dist/{store-Dgs7Oe44.js → store-COeYnPL_.js} +5 -5
  63. package/dist/{task-queue-DcF0nhhz.js → task-queue-CBIDXZpV.js} +3 -3
  64. package/dist/{task-runner-BGXF7Fo7.js → task-runner-CJF7zIJL.js} +7 -7
  65. package/dist/{thread-context-BPky1KBe.js → thread-context-Cg0jt0aE.js} +8 -8
  66. package/dist/{turn-session-routing-DGvn9MSl.js → turn-session-routing-CaY3Tp8m.js} +8 -8
  67. package/dist/{turn-user-message-19CkuUvM.js → turn-user-message-tcom1RYd.js} +3 -3
  68. package/dist/{validation-lu1DgjNQ.js → validation-EU91JwIT.js} +1 -1
  69. package/dist/{version-Uo3c94Dx.js → version-BYRPhY5G.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{viewer-BPQHMx3-.js → viewer-Cf8ISkAc.js} +3 -3
  72. package/dist/{warmup-H8uLvW9e.js → warmup-TgY4S1vx.js} +75 -469
  73. package/dist/{worker-B-pM_-3K.js → worker-C6Uq4OKD.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-CNKK7doO.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-DdO1BNcw.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-EKJnkrIb.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-QSZuMcvo.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-CoEeZSRh.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-DEeZKqbX.js";
7
+ import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-BT2Pf6HP.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-B8ZXvXWm.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-D_ltJLDS.js";
10
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-EU91JwIT.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-TgY4S1vx.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-CaY3Tp8m.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-CoIZmFK8.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-WLPNSF_b.js";
18
+ import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-COeYnPL_.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-B-pauj42.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-D1J1CGzL.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-Cf8ISkAc.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-Dd129Uov.js";
29
+ import { o as unlinkProvider } from "./connections-D20kp0j5.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-B1IpoELr.js";
32
+ import { a as resumeConversationDelivery } from "./conversation-turn-BptVJylj.js";
33
+ import { t as processConversationWork } from "./worker-C6Uq4OKD.js";
34
+ import { t as bindMessageAgent } from "./message-TtxftRHj.js";
35
+ import { t as bindSpawnAgent } from "./spawn-eMho9HDJ.js";
36
+ import { a as pluginTaskQueueConsumer, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-CBIDXZpV.js";
37
+ import { t as processPluginTask } from "./task-runner-CJF7zIJL.js";
38
+ import { i as registerVercelCacheWarmupDevConsumer, l as verifyWorkspaceSnapshotJobMessage, n as cacheWarmupQueueConsumer, o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, r as createVercelCacheWarmupCallback } from "./queue-CDxkit82.js";
39
+ import { t as JUNIOR_VERSION } from "./version-BYRPhY5G.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(), {
@@ -4182,7 +4183,7 @@ async function streamPrompt(args) {
4182
4183
  })) return false;
4183
4184
  }
4184
4185
  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")));
4186
+ if (page.terminal?.status === "failed") return await args.emit(errorMessage$1(args.output.requestId, acp.RequestError.internalError({ failureCode: page.terminal.failureCode }, "Turn failed")));
4186
4187
  }
4187
4188
  return false;
4188
4189
  }
@@ -4383,11 +4384,15 @@ const acpAuthorizationPointerSchema = z.object({
4383
4384
  expiresAtMs: z.number().int().positive(),
4384
4385
  transactionId: z.string().uuid()
4385
4386
  }).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
- };
4387
+ const ACP_AUTH_METHOD_ID = "junior";
4388
+ /** Describe browser sign-in with the configured bot name. */
4389
+ function acpAuthMethod(agentName) {
4390
+ return {
4391
+ id: ACP_AUTH_METHOD_ID,
4392
+ name: `Sign in to ${agentName}`,
4393
+ description: "Sign in with the Google account that this app allows."
4394
+ };
4395
+ }
4391
4396
  function authorizationKey$1(transactionId) {
4392
4397
  return `junior:acp:v1:authorization:${transactionId}`;
4393
4398
  }
@@ -4453,7 +4458,7 @@ function hasAcpConnectionCredential(request, expectedHash) {
4453
4458
  /** Resolve a trusted browser origin, with request fallback only on loopback. */
4454
4459
  function authorizationBaseURL(request, configured) {
4455
4460
  const url = resolvePublicOrigin(request, configured);
4456
- if (!url) throw acp.RequestError.internalError(void 0, "Junior ACP sign-in requires a configured public base URL");
4461
+ if (!url) throw acp.RequestError.internalError(void 0, "ACP sign-in requires a configured public base URL");
4457
4462
  return url;
4458
4463
  }
4459
4464
  async function readAuthorization(state, transactionId) {
@@ -4503,7 +4508,7 @@ function resultMessage$1(requestId) {
4503
4508
  result: {}
4504
4509
  };
4505
4510
  }
4506
- function cancelledMessage(requestId, message = "Junior sign-in was cancelled") {
4511
+ function cancelledMessage(requestId, message = "Sign-in was cancelled") {
4507
4512
  return {
4508
4513
  jsonrpc: "2.0",
4509
4514
  id: requestId,
@@ -4516,7 +4521,7 @@ async function beginAcpAuthorization(args) {
4516
4521
  const result = await withLock(args.state, authorizationPointerLockKey(args.connectionId), async (lock) => {
4517
4522
  const pointer = await readAuthorizationPointer(args.state, args.connectionId);
4518
4523
  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");
4524
+ if ((await readAuthorization(args.state, pointer.transactionId))?.connectionId === args.connectionId) throw acp.RequestError.invalidRequest(void 0, "Sign-in is already in progress");
4520
4525
  await fenceLock(args.state, lock, MUTATION_LOCK_TTL_MS);
4521
4526
  await args.state.delete(authorizationPointerKey(args.connectionId));
4522
4527
  }
@@ -4552,7 +4557,7 @@ async function beginAcpAuthorization(args) {
4552
4557
  url.pathname = `/_junior/acp/auth/${transactionId}`;
4553
4558
  const params = {
4554
4559
  mode: "url",
4555
- message: `Sign in to Junior in your browser. Enter verification code ${userCode}.`,
4560
+ message: `Sign in to ${args.agentName} in your browser. Enter verification code ${userCode}.`,
4556
4561
  elicitationId: transactionId,
4557
4562
  requestId: args.requestId,
4558
4563
  url: url.toString()
@@ -4587,7 +4592,7 @@ async function completeAcpAuthorization(args) {
4587
4592
  if (authorization.expiresAtMs <= Date.now()) {
4588
4593
  const completion = await finishAuthorization({
4589
4594
  authorization,
4590
- response: cancelledMessage(authorization.requestId, "Junior sign-in request expired"),
4595
+ response: cancelledMessage(authorization.requestId, "Sign-in request expired"),
4591
4596
  state: args.state
4592
4597
  });
4593
4598
  if (completion === "busy") return completion;
@@ -4605,7 +4610,7 @@ async function completeAcpAuthorization(args) {
4605
4610
  if (binding !== "completed") {
4606
4611
  const completion = await finishAuthorization({
4607
4612
  authorization,
4608
- response: cancelledMessage(authorization.requestId, "Junior sign-in could not bind this connection"),
4613
+ response: cancelledMessage(authorization.requestId, "Sign-in could not bind this connection"),
4609
4614
  state: args.state
4610
4615
  });
4611
4616
  if (completion !== "completed") return completion;
@@ -4670,7 +4675,7 @@ async function expireAcpAuthorization(args) {
4670
4675
  if (authorization.expiresAtMs > Date.now()) return false;
4671
4676
  if (await finishAuthorization({
4672
4677
  authorization,
4673
- response: cancelledMessage(authorization.requestId, "Junior sign-in request expired"),
4678
+ response: cancelledMessage(authorization.requestId, "Sign-in request expired"),
4674
4679
  state: args.state
4675
4680
  }) === "busy") return false;
4676
4681
  await fenceLock(args.state, lock, MUTATION_LOCK_TTL_MS);
@@ -4688,7 +4693,7 @@ async function expireAcpAuthorization(args) {
4688
4693
  /**
4689
4694
  * Own the remote ACP v1 Streamable HTTP edge.
4690
4695
  *
4691
- * Shared state records route short-lived JSON-RPC messages. Junior's
4696
+ * Shared state records route short-lived JSON-RPC messages. The
4692
4697
  * Conversation log remains the source for session replay and Turn output. No
4693
4698
  * request relies on another request reaching the same app process.
4694
4699
  */
@@ -4716,9 +4721,9 @@ function parseParams(schema, params) {
4716
4721
  const firstPath = parsed.error.issues[0]?.path[0];
4717
4722
  throw acp.RequestError.invalidParams({ field: typeof firstPath === "string" || typeof firstPath === "number" ? String(firstPath) : "params" });
4718
4723
  }
4719
- /** Reject client MCP servers because Junior does not use the client workspace. */
4724
+ /** Reject client MCP servers because the agent does not use the client workspace. */
4720
4725
  function rejectUnsupportedMcpServers(mcpServers) {
4721
- if (mcpServers.length > 0) throw acp.RequestError.invalidParams({ field: "mcpServers" }, "Junior does not accept client MCP servers");
4726
+ if (mcpServers.length > 0) throw acp.RequestError.invalidParams({ field: "mcpServers" }, "Client MCP servers are not supported");
4722
4727
  }
4723
4728
  function resourceLinkText(block) {
4724
4729
  return [
@@ -4733,18 +4738,18 @@ function resourceLinkText(block) {
4733
4738
  }
4734
4739
  /** Convert supported ACP content blocks to one bounded Conversation Message. */
4735
4740
  function promptText(prompt) {
4736
- if (prompt.length === 0) throw acp.RequestError.invalidParams({ field: "prompt" }, "Junior accepts one or more text or resource link blocks");
4741
+ if (prompt.length === 0) throw acp.RequestError.invalidParams({ field: "prompt" }, "Prompt must have one or more text or resource link blocks");
4737
4742
  const blocks = [];
4738
4743
  for (const block of prompt) {
4739
4744
  if (block.type === "resource_link") {
4740
4745
  blocks.push(resourceLinkText(block));
4741
4746
  continue;
4742
4747
  }
4743
- if (!block.text.trim()) throw acp.RequestError.invalidParams({ field: "prompt" }, "Junior accepts non-empty text blocks only");
4748
+ if (!block.text.trim()) throw acp.RequestError.invalidParams({ field: "prompt" }, "Text blocks must not be empty");
4744
4749
  blocks.push(block.text);
4745
4750
  }
4746
4751
  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`);
4752
+ if (text.length > MAX_PROMPT_TEXT_LENGTH) throw acp.RequestError.invalidParams({ field: "prompt" }, `Prompt must have at most ${MAX_PROMPT_TEXT_LENGTH} characters`);
4748
4753
  return text;
4749
4754
  }
4750
4755
  function stableHex(value, length = 32) {
@@ -4900,7 +4905,7 @@ async function handleInitialize(args) {
4900
4905
  if (requestId === void 0) return textResponse("Initialize request must include an ID", 400);
4901
4906
  try {
4902
4907
  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");
4908
+ if (!supportsUrlElicitation(args.call.params)) throw acp.RequestError.invalidParams({ field: "clientCapabilities.elicitation.url" }, "Remote authentication requires URL elicitation support");
4904
4909
  const credential = createAcpConnectionCredential(args.request);
4905
4910
  const result = {
4906
4911
  protocolVersion: acp.PROTOCOL_VERSION,
@@ -4912,7 +4917,7 @@ async function handleInitialize(args) {
4912
4917
  embeddedContext: false
4913
4918
  }
4914
4919
  },
4915
- authMethods: args.browserAuthAvailable ? [ACP_AUTH_METHOD] : [],
4920
+ authMethods: args.browserAuthAgentName ? [acpAuthMethod(args.browserAuthAgentName)] : [],
4916
4921
  agentInfo: {
4917
4922
  name: "junior",
4918
4923
  version: args.version
@@ -4954,13 +4959,14 @@ async function handleConnectedPost(args) {
4954
4959
  createReceipt: async () => {
4955
4960
  try {
4956
4961
  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");
4962
+ if (parseParams(authenticateParamsSchema, identifiedCall.params).methodId !== "junior") throw acp.RequestError.invalidParams({ field: "methodId" }, "This authentication method was not advertised");
4958
4963
  if (args.authenticated) return { outputs: [{
4959
4964
  kind: "message",
4960
4965
  message: resultMessage(requestId, {})
4961
4966
  }] };
4962
- if (!args.options.browserAuth) throw acp.RequestError.internalError(void 0, "Junior ACP authentication requires an enabled dashboard");
4967
+ if (!args.options.browserAuth) throw acp.RequestError.internalError(void 0, "ACP authentication requires an enabled dashboard");
4963
4968
  return await beginAcpAuthorization({
4969
+ agentName: args.options.browserAuth.agentName,
4964
4970
  baseURL: args.options.browserAuth.baseURL,
4965
4971
  connectionId: args.connectionId,
4966
4972
  credentialHash: args.connection.credentialHash,
@@ -5042,7 +5048,7 @@ function createAcpHttpHandler(options) {
5042
5048
  call = message;
5043
5049
  if (connectionId) return textResponse("Initialize not allowed on existing connection", 400);
5044
5050
  return await handleInitialize({
5045
- browserAuthAvailable: options.browserAuth !== void 0,
5051
+ browserAuthAgentName: options.browserAuth?.agentName,
5046
5052
  call,
5047
5053
  request,
5048
5054
  state,
@@ -5433,7 +5439,7 @@ const MCP_SCOPES = [
5433
5439
  const MCP_SCOPE_DESCRIPTIONS = {
5434
5440
  "conversations:read": "List and read the conversations that you started or take part in",
5435
5441
  "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",
5442
+ "conversations:write": "Start conversations and send messages as you. Each message starts agent work",
5437
5443
  "review_items:read": "List and read your review items",
5438
5444
  "automations:read": "List and read the automations that you can see"
5439
5445
  };
@@ -5810,7 +5816,7 @@ const MCP_CONSENT_PATH = "/_junior/mcp/authorize/:authorizationId";
5810
5816
  /** Resolve the MCP URLs for this request from the trusted public origin. */
5811
5817
  function resolveMcpUrls(request, baseURL) {
5812
5818
  const origin = resolvePublicOrigin(request, baseURL);
5813
- if (!origin) throw new Error("Junior MCP requires a configured public base URL");
5819
+ if (!origin) throw new Error("MCP requires a configured public base URL");
5814
5820
  const url = (path) => new URL(path, origin).toString();
5815
5821
  return {
5816
5822
  authorize: url(MCP_AUTHORIZE_PATH),
@@ -6932,14 +6938,18 @@ const TOOLS_BY_SCOPE = {
6932
6938
  "review_items:read": [registerSearchReviewItemsTool, registerGetReviewItemTool],
6933
6939
  "automations:read": [registerSearchAutomationsTool, registerGetAutomationTool]
6934
6940
  };
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.";
6941
+ function readInstructions(agentName) {
6942
+ 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.`;
6943
+ }
6944
+ function writeInstructions(agentName) {
6945
+ 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.`;
6946
+ }
6937
6947
  /** Build the MCP server for one authenticated user and granted scopes. */
6938
6948
  function createMcpServer(context, scopes) {
6939
6949
  const server = new McpServer({
6940
6950
  name: "junior",
6941
6951
  version: JUNIOR_VERSION
6942
- }, { instructions: scopes.includes("conversations:write") ? WRITE_INSTRUCTIONS : READ_INSTRUCTIONS });
6952
+ }, { instructions: scopes.includes("conversations:write") ? writeInstructions(botConfig.userName) : readInstructions(botConfig.userName) });
6943
6953
  for (const scope of scopes) for (const register of TOOLS_BY_SCOPE[scope]) register(server, context);
6944
6954
  return server;
6945
6955
  }
@@ -7232,7 +7242,7 @@ function resolveSignInAuthConfig(agentName, allowedDomains, options = {}) {
7232
7242
  };
7233
7243
  }
7234
7244
  function required(value, name) {
7235
- if (!value?.trim()) throw new Error(`${name} is required for Junior sign-in`);
7245
+ if (!value?.trim()) throw new Error(`${name} is required for sign-in`);
7236
7246
  return value.trim();
7237
7247
  }
7238
7248
  function createBetterAuth(config) {
@@ -7697,7 +7707,7 @@ async function createApp(options) {
7697
7707
  setSlackReactionConfig(options?.slack ?? {});
7698
7708
  assertNoLegacyAllowedDomains(Object.keys(dashboard ?? {}));
7699
7709
  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" });
7710
+ if (allowedDomains.length === 0) logWarn("app.allowed_domains.unset", { "app.reason": "allowedDomains is empty, so any Slack workspace member can use the bot" });
7701
7711
  if (dashboard && !dashboard.disabled) signInConfig = resolveSignInAuthConfig(botConfig.userName, allowedDomains, dashboard);
7702
7712
  if (shouldValidatePluginCatalog) {
7703
7713
  pluginCatalogRuntime.getSignature();
@@ -7762,7 +7772,10 @@ async function createApp(options) {
7762
7772
  const state = work.state ?? getStateAdapter();
7763
7773
  acpRuntime = {
7764
7774
  handleRequest: createAcpHttpHandler({
7765
- ...dashboard && !dashboard.disabled ? { browserAuth: { baseURL: resolvePublicBaseURL(dashboard) } } : void 0,
7775
+ ...dashboard && !dashboard.disabled ? { browserAuth: {
7776
+ agentName: botConfig.userName,
7777
+ baseURL: resolvePublicBaseURL(dashboard)
7778
+ } } : void 0,
7766
7779
  conversations: createAcpConversations({
7767
7780
  conversationStore: work.conversationStore,
7768
7781
  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-DdO1BNcw.js";
2
+ import { E as withSpan, m as logInfo, p as logException } from "./logging-QSZuMcvo.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";
@@ -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-DSjhoKu5.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-DdO1BNcw.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-DBDNUUmz.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-CoEeZSRh.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-CNKK7doO.js").then((n) => n.Qn),
103
+ import("../catalog-runtime-B8ZXvXWm.js").then((n) => n.t),
104
+ import("../validation-EU91JwIT.js").then((n) => n.r),
105
+ import("../db-EKJnkrIb.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-CNKK7doO.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-B3KxKks5.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-B0enqHtZ.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-DJJX9ClG.js");
161
+ const { bindSpawnAgent } = await import("../spawn-eMho9HDJ.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-TtxftRHj.js").then((n) => n.n);
163
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-B-pauj42.js").then((n) => n.o);
164
+ const { createConversationTurnWorker } = await import("../conversation-turn-BptVJylj.js").then((n) => n.t);
165
+ const { skipInputAfterConversationStop } = await import("../session-stop-DEeZKqbX.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-C6Uq4OKD.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-2UrD7JkN.js";
2
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-QSZuMcvo.js";
3
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DBDNUUmz.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) {
package/dist/cli/init.js CHANGED
@@ -68,7 +68,7 @@ function writePnpmWorkspace(targetDir) {
68
68
  minimumReleaseAgeExclude:
69
69
  - "@sentry/*"
70
70
  # pnpm fails the install when a dependency has an unreviewed build script.
71
- # These are the Junior runtime dependencies that have one.
71
+ # These are the @sentry/junior runtime dependencies that have one.
72
72
  allowBuilds:
73
73
  "@google/genai": true
74
74
  "@mongodb-js/zstd": true
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-AfeAdS3J.js")).runAdmin(argv);
48
+ return await (await import("../admin-BnVFGo_z.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-xYkaQTrw.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-DQLqkSVv.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-D8i-dKTp.js")).runBriefs(argv);
54
+ return await (await import("../briefs-CagVVefw.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-C-2tFxk3.js";
2
- import { fr as setPlugins, pr as validatePlugins, yo as createPluginLogger } from "../projection-DBq8tsA5.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-d1EM6Z0V.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-lu1DgjNQ.js";
1
+ import { o as getDb } from "../db-EKJnkrIb.js";
2
+ import { _o as createPluginLogger, dr as validatePlugins, ur as setPlugins } from "../projection-CNKK7doO.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-EU91JwIT.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-oGM7KA9M.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-d1EM6Z0V.js";
3
- import { n as resolve } from "../resolve-DXuA3G0g.js";
4
- import { $a as SANDBOX_RUNTIME, na as create } from "../projection-DBq8tsA5.js";
5
- import { K as disconnectStateAdapter } from "../db-C-2tFxk3.js";
1
+ import { i as getChatConfig } from "../config-DdO1BNcw.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
3
+ import { n as resolve } from "../resolve-CQLhMWSu.js";
4
+ import { Za as SANDBOX_RUNTIME, ea as create } from "../projection-CNKK7doO.js";
5
+ import { J as disconnectStateAdapter } from "../db-EKJnkrIb.js";
6
6
  // src/cli/snapshot-create.ts
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
8
8
  function progressMessage(phase) {
@@ -1,5 +1,5 @@
1
1
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
2
- import "../db-DPqcEM9_.js";
2
+ import "../db-zbN5ZV_o.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
5
5
  }