@sentry/junior 0.269.0 → 0.271.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 (74) hide show
  1. package/dist/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
  2. package/dist/{adapter-2-CG25be.js → adapter-Bqbtr1RV.js} +1 -1
  3. package/dist/{admin-DSs8S5Uy.js → admin-CWBjzyN0.js} +1 -1
  4. package/dist/{agent-runner-CrDrPUtY.js → agent-runner-BiHsH8O_.js} +1174 -262
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +6 -6
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +70 -38
  9. package/dist/{app-BrMMzjYm.d.ts → app-C81xfpNa.d.ts} +9 -3
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +84 -37
  12. package/dist/{interruption-marker-g6Xup3Fk.js → assistant-reply-DgtX9DaJ.js} +2 -8
  13. package/dist/{automation-p87hg_AV.js → automation-Dwh_xcqM.js} +1 -1
  14. package/dist/{briefs-PtODdLNu.js → briefs-0FeSJHQ3.js} +5 -5
  15. package/dist/{catalog-runtime-BsoSmTM0.js → catalog-runtime-Bw9kjGVu.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{client-Cqf4TboL.js → client-B0jlQSgO.js} +13 -3
  24. package/dist/{config-CPsE4T5L.js → config-DrAeD8sr.js} +3 -3
  25. package/dist/{connections-upFXLmhG.js → connections-BzN2K0G9.js} +10 -10
  26. package/dist/{conversation-CTpD_PGk.js → conversation-AhOVzN_k.js} +5 -3
  27. package/dist/{conversation-privacy-D6zJc8ff.js → conversation-privacy-D1NhUxyo.js} +1 -1
  28. package/dist/{credential-sync-CS_6IC-f.js → credential-sync-DpNWl4yy.js} +15 -15
  29. package/dist/{credentialed-BU-OW7HP.js → credentialed-mh7HBqey.js} +51 -39
  30. package/dist/{db-BzOCzVb1.d.ts → db-DSabI7jJ.d.ts} +1 -1
  31. package/dist/{executor-CNS7ONt-.js → executor-C2cRw0hZ.js} +7 -2
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{job-queue-DI-k-Bbk.js → job-queue-CEeLYkSj.js} +2 -2
  34. package/dist/{list-CGoQdXTp.js → list-DjJJ5K0x.js} +168 -36
  35. package/dist/{logging-n7knse-O.js → logging-DuwXUuIY.js} +1 -1
  36. package/dist/{media-85PDJxO_.js → media-U6Tuz6Mi.js} +1 -1
  37. package/dist/{message-BpaWd8TT.js → message-CRe3WBKc.js} +4 -4
  38. package/dist/{model-profile-Bg8EoCKD.js → model-profile-B998sjVd.js} +9 -2
  39. package/dist/nitro.d.ts +1 -1
  40. package/dist/nitro.js +5 -3
  41. package/dist/{oauth-callback-server-CpGmEw_i.js → oauth-callback-server-oM5TJt34.js} +2 -2
  42. package/dist/{prompt-BlQB0QQt.js → prompt-BPSdXYXV.js} +1 -1
  43. package/dist/{registry-By36_xsm.js → registry-BPtbAVFo.js} +2 -2
  44. package/dist/{reporting-window-CVarfId9.js → reporting-window-DgHgwQB3.js} +16 -2
  45. package/dist/{resolve-CUIBcdPd.js → resolve-D44G1jJm.js} +3 -3
  46. package/dist/{result-BemsOMOO.js → result-CvP8c5bb.js} +10 -10
  47. package/dist/{runner-BVok7PAA.js → runner-FIGIKvk2.js} +11 -11
  48. package/dist/{sandbox-egress-signals-BSUWQI95.js → sandbox-egress-signals-C_JzucwP.js} +1 -1
  49. package/dist/{schema-ChnFo5f2.js → schema-DKZgO-xf.js} +12 -7
  50. package/dist/{schema-jK4-1u_H.d.ts → schema-DPCvePop.d.ts} +37 -3
  51. package/dist/{service-account-hMmESDcr.js → service-account-1mJGRAvx.js} +3 -3
  52. package/dist/{service-account-DHvlLnZw.js → service-account-CHO3YXpt.js} +3 -3
  53. package/dist/{session-stop-BQW_iFcd.js → session-stop-DuUB1rwQ.js} +51 -141
  54. package/dist/{skills-DmJJIuLF.js → skills-DHK7L9Eo.js} +2 -2
  55. package/dist/{spawn-ChCm46i-.js → spawn-CKl_ySIq.js} +2 -2
  56. package/dist/{store-DCo2n5iJ.js → store-BF2XEeQz.js} +3 -3
  57. package/dist/{store-1DVhoKOL.js → store-Di0E4EvU.js} +4 -4
  58. package/dist/{task-queue-HMC4QjFm.js → task-queue-CC7IFtbT.js} +3 -3
  59. package/dist/{task-runner-cA6yjn_E.js → task-runner-DKZtMFwa.js} +8 -8
  60. package/dist/{thread-state-CHy8LS0C.js → thread-state-BQ1T3eeF.js} +5 -5
  61. package/dist/{turn-failure-response-Dr7erLWs.js → turn-failure-response-B5eSFoHn.js} +15 -10
  62. package/dist/{turn-lifecycle-bf2fIYi_.js → turn-lifecycle-CTLEIEOn.js} +1 -1
  63. package/dist/{turn-session-routing-BqO0qXLk.js → turn-session-routing-BFVp8TbU.js} +26 -19
  64. package/dist/{validation-DHR1ivfh.js → validation-Cjo-3yt3.js} +1 -1
  65. package/dist/{version-CXCHLgWm.js → version-D30MBLLw.js} +1 -1
  66. package/dist/version.js +1 -1
  67. package/dist/{viewer-DSbD6DF6.js → viewer-D3jhuP66.js} +27 -12
  68. package/dist/{work-BE_qTYGi.js → work-CL9QwQcl.js} +11 -11
  69. package/dist/{worker-Cm9_sWXg.js → worker-S2P7IJDI.js} +6 -6
  70. package/migrations/0071_review_item_turn.sql +1 -0
  71. package/migrations/AGENTS.md +3 -12
  72. package/migrations/meta/0071_snapshot.json +4003 -0
  73. package/migrations/meta/_journal.json +7 -0
  74. package/package.json +5 -4
package/dist/app.js CHANGED
@@ -1,39 +1,39 @@
1
- import { B as readScheduledAutomation, Fr as SubscribedReplyReason, G as blockEventAutomation, H as saveScheduledAutomationInLock, Hr as getExperimentalFeatures, Jn as hasRunnableConversationWork, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, Mn as CONVERSATION_WORK_STALE_ENQUEUE_MS, R as listScheduledAutomationsForTeam, Rr as getThreadStopDecision, S as existingConversationId, U as scheduledRunId, Ur as isExperimentalFeatureEnabled, W as withScheduledAutomationLock, Wr as setExperimentalFeatures, Wt as appendConversationMessages, Xn as isInvalidConversationRecordError, Xr as setConfigDefaults, Xt as settleConversationTitleWork, Y as findMatchingEventAutomations, Yr as getConfigDefaults, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, qt as projectConversationMessages, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-BqO0qXLk.js";
2
- import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-CPsE4T5L.js";
3
- import { A as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as withSpan, L as GOOGLE_IDENTITY_PROVIDER, N as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as normalizeIdentityEmail } from "./logging-n7knse-O.js";
1
+ import { B as readScheduledAutomation, G as blockEventAutomation, Gr as setExperimentalFeatures, H as saveScheduledAutomationInLock, Ir as SubscribedReplyReason, Jn as hasRunnableConversationWork, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, Mn as CONVERSATION_WORK_STALE_ENQUEUE_MS, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, Ur as getExperimentalFeatures, W as withScheduledAutomationLock, Wr as isExperimentalFeatureEnabled, Wt as appendConversationMessages, Xn as isInvalidConversationRecordError, Xr as getConfigDefaults, Xt as settleConversationTitleWork, Y as findMatchingEventAutomations, Zr as setConfigDefaults, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, qt as projectConversationMessages, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed, zr as getThreadStopDecision } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-DrAeD8sr.js";
3
+ import { A as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as withSpan, L as GOOGLE_IDENTITY_PROVIDER, N as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as normalizeIdentityEmail } from "./logging-DuwXUuIY.js";
4
4
  import { n as captureMessage } from "./sentry-MDkYAVPV.js";
5
- import { t as JUNIOR_VERSION } from "./version-CXCHLgWm.js";
6
- import { f as parseSlackTeamId, g as slackMessageTsSchema, h as slackMessageTsFromMs, m as parseSlackMessageTs, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-CP9K2Idu.js";
7
- import { C as getSqlExecutor, M as resolveActorIdentityId, O as withConversationMutationLock, R as recordGoogleSignIn, S as getDb, T as withConversationEventLock, _ as closeDb, g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-DSbD6DF6.js";
5
+ import { t as JUNIOR_VERSION } from "./version-D30MBLLw.js";
6
+ import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-B4DYygOB.js";
7
+ import { C as getSqlExecutor, M as resolveActorIdentityId, O as withConversationMutationLock, R as recordGoogleSignIn, S as getDb, T as withConversationEventLock, _ as closeDb, g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
8
8
  import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
9
- import { c as juniorReviewItems, d as juniorAutomations, g as juniorConversationBriefs, l as juniorAutomationRuns, y as juniorConversationEvents } from "./executor-CNS7ONt-.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BsoSmTM0.js";
11
- import { A as verifySlackSignature, C as syncReviewItemSlackCards, Ct as processWorkspaceSnapshotJob, D as parseSlackReviewItemFormTarget, E as parseSlackReviewItemClick, J as readViewerAutomationSummary, L as logScheduledAutomationRunSkipped, O as parseSlackUserInputSubmission, Q as effectiveTaskOutcomes, R as scheduledAutomationRunAttributes, S as readSlackReviewItemCardConversationId, T as buildSlackReviewItemModal, _ as unpublishedArtifactHeaders, _t as recordSubagentEnded, ct as webActorFromEmail, dt as collectAttachmentGarbage, et as deliverReviewItemChange, g as readPublicArtifact, gt as stopConversationSession, h as publicArtifactHeaders, it as conversationTurnIdForMessage, j as parseSlackThreadId, k as runWithSlackInstallation, n as executeAgentRun, pt as requestAttachmentDeletion, rt as appendAndEnqueueWebMessage, st as recordWebConversationActivity, t as createAgentRunner, tt as renderReviewItemMessage, v as lookupSlackUserProfile, wt as ingestEvent, x as createSlackReviewItemShow } from "./agent-runner-CrDrPUtY.js";
12
- import { At as slackEntitySchema, Bn as getDashboardTaskLink, Bt as clearSandboxEgressSignals, Cr as resolveRootVisibility, Dn as getSlackClient, Er as listConversationAnnotations, Fn as runWithWorkspaceTeamId, Ht as consumeSandboxEgressPermissionDeniedSignal, Ln as getDashboardConversationLink, M as canActOnReviewItem, Pn as getWorkspaceTeamId, S as dismissOpenReviewItems, Tt as postSlackEphemeralMessage, Vn as setDashboardConversationLinkOptions, Vt as consumeSandboxEgressAuthRequiredSignal, Wt as parseSandboxEgressCredentialToken, Xt as normalizeSandboxEgressTracePropagationDomains, _n as bindScheduledAutomationCredentialSubject, ar as createPluginLogger, bn as verifyScheduledAutomationCredentialSubject, c as getPluginRoutes, cn as collectEventMatchKeys, ct as proxyVercelSandboxEgressRequest, fn as findMatchingWatches, ft as resolveBaseUrl, gn as bindEventAutomationCredentialSubject, h as validatePlugins, hn as takeDueTimerWatches, jr as createPluginCache, jt as slackExternalRefIdSchema, kn as isDmChannel, m as setPlugins, n as createUserTokenStore, nr as createPluginState, or as readConversationAccessFromSql, p as getPlugins, s as getPluginApiRoutes, st as isVercelSandboxEgressRequest, v as setBriefsConfig, vn as bindSlackDirectCredentialSubject, vt as slackMention, wt as openSlackModal, xn as verifySlackDirectCredentialSubject, yn as verifyEventAutomationCredentialSubject } from "./credentialed-BU-OW7HP.js";
9
+ import { c as juniorReviewItems, d as juniorAutomations, g as juniorConversationBriefs, l as juniorAutomationRuns, y as juniorConversationEvents } from "./executor-C2cRw0hZ.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
11
+ import { $ as effectiveTaskOutcomes, A as verifySlackSignature, C as syncReviewItemSlackCards, D as parseSlackReviewItemFormTarget, E as parseSlackReviewItemClick, I as joinPublicChannel, O as parseSlackUserInputSubmission, R as logScheduledAutomationRunSkipped, S as readSlackReviewItemCardConversationId, T as buildSlackReviewItemModal, Tt as ingestEvent, Y as readViewerAutomationSummary, _ as unpublishedArtifactHeaders, _t as stopConversationSession, at as conversationTurnIdForMessage, ct as recordWebConversationActivity, ft as collectAttachmentGarbage, g as readPublicArtifact, h as publicArtifactHeaders, it as appendAndEnqueueWebMessage, j as parseSlackThreadId, k as runWithSlackInstallation, lt as webActorFromEmail, mt as requestAttachmentDeletion, n as executeAgentRun, nt as renderReviewItemMessage, t as createAgentRunner, tt as deliverReviewItemChange, v as lookupSlackUserProfile, vt as recordSubagentEnded, wt as processWorkspaceSnapshotJob, x as createSlackReviewItemShow, z as scheduledAutomationRunAttributes } from "./agent-runner-BiHsH8O_.js";
12
+ import { At as slackEntitySchema, Bn as getDashboardTaskLink, Bt as clearSandboxEgressSignals, Cr as resolveRootVisibility, Dn as getSlackClient, Er as listConversationAnnotations, Fn as runWithWorkspaceTeamId, Ht as consumeSandboxEgressPermissionDeniedSignal, Ln as getDashboardConversationLink, M as canActOnReviewItem, Pn as getWorkspaceTeamId, S as dismissOpenReviewItems, Tt as postSlackEphemeralMessage, Vn as setDashboardConversationLinkOptions, Vt as consumeSandboxEgressAuthRequiredSignal, Wt as parseSandboxEgressCredentialToken, Xt as normalizeSandboxEgressTracePropagationDomains, _n as bindScheduledAutomationCredentialSubject, ar as createPluginLogger, bn as verifyScheduledAutomationCredentialSubject, c as getPluginRoutes, cn as collectEventMatchKeys, ct as proxyVercelSandboxEgressRequest, fn as findMatchingWatches, ft as resolveBaseUrl, gn as bindEventAutomationCredentialSubject, h as validatePlugins, hn as takeDueTimerWatches, jr as createPluginCache, jt as slackExternalRefIdSchema, kn as isDmChannel, m as setPlugins, n as createUserTokenStore, nr as createPluginState, or as readConversationAccessFromSql, p as getPlugins, rr as createPluginEmbedder, s as getPluginApiRoutes, st as isVercelSandboxEgressRequest, v as setBriefsConfig, vn as bindSlackDirectCredentialSubject, vt as slackMention, wt as openSlackModal, xn as verifySlackDirectCredentialSubject, yn as verifyEventAutomationCredentialSubject } from "./credentialed-mh7HBqey.js";
13
13
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
14
- import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-2-CG25be.js";
14
+ import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-Bqbtr1RV.js";
15
15
  import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
16
- import { D as conversationSurfaceSchema, I as annotationCard, T as conversationReportStatusSchema, h as conversationFeedQuerySchema } from "./conversation-CTpD_PGk.js";
17
- import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-1DVhoKOL.js";
18
- import { E as renderSlackObjectCard, S as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-BQW_iFcd.js";
19
- import { m as buttonUserInputField } from "./reporting-window-CVarfId9.js";
20
- import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-CUIBcdPd.js";
21
- import { a as getVercelConversationWorkQueue, d as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DI-k-Bbk.js";
22
- import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-DCo2n5iJ.js";
23
- import { M as scheduledRunSchema } from "./automation-p87hg_AV.js";
24
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DHR1ivfh.js";
16
+ import { D as conversationSurfaceSchema, I as annotationCard, T as conversationReportStatusSchema, h as conversationFeedQuerySchema } from "./conversation-AhOVzN_k.js";
17
+ import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-Di0E4EvU.js";
18
+ import { E as renderSlackObjectCard, S as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-DuUB1rwQ.js";
19
+ import { h as buttonUserInputField } from "./reporting-window-DgHgwQB3.js";
20
+ import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-D44G1jJm.js";
21
+ import { a as getVercelConversationWorkQueue, d as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CEeLYkSj.js";
22
+ import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-BF2XEeQz.js";
23
+ import { M as scheduledRunSchema } from "./automation-Dwh_xcqM.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Cjo-3yt3.js";
25
25
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
26
- import { A as stopSlackThread, B as actOnReviewItem, C as isAllowedSignInEmail, D as buildSlackInboundMessage, E as recordSkippedConversationMessage, F as bindMessageAuthorIdentityId, H as readReviewItemForUser, I as startProcessingReaction, K as enqueueAgentDispatch, L as stripLeadingBotMention, M as withNormalizedThreadId, N as stopConversationTurn, O as clearSlackPendingReactions, P as THREAD_OPTOUT_ACK, R as parseContent, S as isAllowedDomain, T as resolveAllowedDomains, U as reviewItemChange, V as closeReviewItemsAnsweredByReply, W as getAttachmentStorage, _ as createProductionConversationWorkOptions, b as createSlackWebApiStatusSender, j as normalizeIncomingSlackThreadId, k as isSlackMessageStopped, q as GET$3, t as readConversationFeed, v as createProductionSlackWebhookServices, w as readEnvList, x as assertNoLegacyAllowedDomains, y as getProductionSlackAdapter, z as ReviewItemActionError } from "./list-CGoQdXTp.js";
27
- import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-BemsOMOO.js";
28
- import { r as enqueueAgentInvocation } from "./work-BE_qTYGi.js";
29
- import { o as coerceThreadConversationState } from "./thread-state-CHy8LS0C.js";
30
- import { o as unlinkProvider } from "./connections-upFXLmhG.js";
31
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-CS_6IC-f.js";
32
- import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-HMC4QjFm.js";
33
- import { t as processConversationWork } from "./worker-Cm9_sWXg.js";
34
- import { t as bindMessageAgent } from "./message-BpaWd8TT.js";
35
- import { t as bindSpawnAgent } from "./spawn-ChCm46i-.js";
36
- import { t as processPluginTask } from "./task-runner-cA6yjn_E.js";
26
+ import { A as stopSlackThread, B as actOnReviewItem, C as isAllowedSignInEmail, D as buildSlackInboundMessage, E as recordSkippedConversationMessage, F as bindMessageAuthorIdentityId, H as readReviewItemForUser, I as startProcessingReaction, K as enqueueAgentDispatch, L as stripLeadingBotMention, M as withNormalizedThreadId, N as stopConversationTurn, O as clearSlackPendingReactions, P as THREAD_OPTOUT_ACK, R as parseContent, S as isAllowedDomain, T as resolveAllowedDomains, U as reviewItemChange, V as closeReviewItemsAnsweredByReply, W as getAttachmentStorage, _ as createProductionConversationWorkOptions, b as createSlackWebApiStatusSender, j as normalizeIncomingSlackThreadId, k as isSlackMessageStopped, q as GET$3, t as readConversationFeed, v as createProductionSlackWebhookServices, w as readEnvList, x as assertNoLegacyAllowedDomains, y as getProductionSlackAdapter, z as ReviewItemActionError } from "./list-DjJJ5K0x.js";
27
+ import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-CvP8c5bb.js";
28
+ import { r as enqueueAgentInvocation } from "./work-CL9QwQcl.js";
29
+ import { o as coerceThreadConversationState } from "./thread-state-BQ1T3eeF.js";
30
+ import { o as unlinkProvider } from "./connections-BzN2K0G9.js";
31
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-DpNWl4yy.js";
32
+ import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-CC7IFtbT.js";
33
+ import { t as processConversationWork } from "./worker-S2P7IJDI.js";
34
+ import { t as bindMessageAgent } from "./message-CRe3WBKc.js";
35
+ import { t as bindSpawnAgent } from "./spawn-CKl_ySIq.js";
36
+ import { t as processPluginTask } from "./task-runner-DKZtMFwa.js";
37
37
  import { createRequire } from "node:module";
38
38
  import { Hono } from "hono";
39
39
  import { z } from "zod";
@@ -270,6 +270,7 @@ function createHeartbeatContext(args) {
270
270
  cache: createPluginCache(pluginName),
271
271
  nowMs: args.nowMs,
272
272
  db: getDb(),
273
+ embedder: createPluginEmbedder(pluginName),
273
274
  state: createPluginState(pluginName),
274
275
  log: createPluginLogger(pluginName),
275
276
  agent: {
@@ -2078,6 +2079,27 @@ async function handleSlackForm(args) {
2078
2079
  })));
2079
2080
  return new Response("", { status: 200 });
2080
2081
  }
2082
+ // src/chat/ingress/slack-channel-created.ts
2083
+ const slackChannelCreatedEnvelopeSchema = z.object({
2084
+ type: z.literal("event_callback"),
2085
+ team_id: z.string().optional(),
2086
+ enterprise_id: z.string().optional(),
2087
+ is_enterprise_install: z.boolean().optional(),
2088
+ event: z.object({
2089
+ type: z.literal("channel_created"),
2090
+ channel: z.looseObject({ id: slackChannelIdSchema })
2091
+ })
2092
+ });
2093
+ /** Join a newly created public channel for the installation that sent it. */
2094
+ async function joinCreatedSlackChannel(args) {
2095
+ await args.state.connect();
2096
+ await runWithWorkspaceTeamId(args.installation.teamId, () => runWithSlackInstallation({
2097
+ adapter: args.adapter,
2098
+ installation: args.installation,
2099
+ state: args.state,
2100
+ task: () => joinPublicChannel(args.channelId)
2101
+ }));
2102
+ }
2081
2103
  // src/chat/ingress/bot-mention.ts
2082
2104
  /**
2083
2105
  * Detect Slack bot @mentions that should activate Junior.
@@ -2806,10 +2828,10 @@ async function routeParsedMessage(args) {
2806
2828
  try {
2807
2829
  await persist();
2808
2830
  } catch (error) {
2809
- if (error instanceof SlackEventPersistenceError && error.saved) await closeAnswered();
2831
+ if (error instanceof SlackEventPersistenceError && error.saved) args.runAfterUnlock(closeAnswered);
2810
2832
  throw error;
2811
2833
  }
2812
- await closeAnswered();
2834
+ args.runAfterUnlock(closeAnswered);
2813
2835
  }
2814
2836
  async function handleSlackEvent(args) {
2815
2837
  const event = args.body.event;
@@ -2887,6 +2909,7 @@ async function handleSlackEvent(args) {
2887
2909
  setSpanAttributes({ "app.slack.membership": member ? "verified" : "unverified" });
2888
2910
  if (!member) return;
2889
2911
  const message = adapter.parseMessage(event);
2912
+ let afterUnlock;
2890
2913
  if (!(await withLock(state, `slack:ingress:${normalizeMessageThreadId(message).threadId}`, () => routeParsedMessage({
2891
2914
  adapter,
2892
2915
  event,
@@ -2897,11 +2920,14 @@ async function handleSlackEvent(args) {
2897
2920
  receivedAtMs,
2898
2921
  allowedBotUserIds: args.services.allowedBotUserIds ?? [],
2899
2922
  allowedDomains: args.services.allowedDomains ?? [],
2923
+ runAfterUnlock: (task) => {
2924
+ afterUnlock = task;
2925
+ },
2900
2926
  state
2901
2927
  }), {
2902
2928
  keepAlive: true,
2903
2929
  waitMs: 1e4
2904
- })).acquired) throw new Error("Could not acquire Slack ingress lock");
2930
+ }).finally(() => afterUnlock?.())).acquired) throw new Error("Could not acquire Slack ingress lock");
2905
2931
  }
2906
2932
  }
2907
2933
  }));
@@ -2970,7 +2996,26 @@ async function handleSlackWebhook(args) {
2970
2996
  waitUntil: args.waitUntil
2971
2997
  });
2972
2998
  }
2973
- const result = slackEventEnvelopeSchema.safeParse(parseJson(body));
2999
+ const json = parseJson(body);
3000
+ const channelCreated = slackChannelCreatedEnvelopeSchema.safeParse(json);
3001
+ if (channelCreated.success) {
3002
+ if (args.services.autoJoinNewChannels) {
3003
+ const channelId = channelCreated.data.event.channel.id;
3004
+ enqueue(args.waitUntil, withLogContext({
3005
+ platform: "slack",
3006
+ destinationName: channelId
3007
+ }, () => joinCreatedSlackChannel({
3008
+ adapter,
3009
+ channelId,
3010
+ installation: installationFromEnvelope(channelCreated.data),
3011
+ state: args.services.state ?? getStateAdapter()
3012
+ }).catch((error) => {
3013
+ logException(error, "slack.channel.auto_join.failed");
3014
+ })));
3015
+ }
3016
+ return new Response("ok", { status: 200 });
3017
+ }
3018
+ const result = slackEventEnvelopeSchema.safeParse(json);
2974
3019
  if (!result.success) return new Response("Invalid JSON", { status: 400 });
2975
3020
  const parsed = result.data;
2976
3021
  if (parsed.type === "url_verification") return Response.json({ challenge: parsed.challenge });
@@ -6132,6 +6177,7 @@ function createBetterAuth(config) {
6132
6177
  hd: hostedDomain,
6133
6178
  prompt: "select_account",
6134
6179
  disableIdTokenSignIn: true,
6180
+ overrideUserInfoOnSignIn: true,
6135
6181
  async getUserInfo(token) {
6136
6182
  if (!token.idToken) return null;
6137
6183
  const claims = readGoogleClaims(token.idToken);
@@ -6141,7 +6187,7 @@ function createBetterAuth(config) {
6141
6187
  user: {
6142
6188
  email: claims.email,
6143
6189
  emailVerified: claims.email_verified === true,
6144
- image: claims.picture,
6190
+ image: claims.picture ?? null,
6145
6191
  name: claims.name
6146
6192
  },
6147
6193
  data: claims
@@ -6685,7 +6731,8 @@ async function createApp(options) {
6685
6731
  services: runtimeServiceOverrides
6686
6732
  }),
6687
6733
  allowedBotUserIds: options?.slack?.allowedBotUserIds ?? [],
6688
- allowedDomains
6734
+ allowedDomains,
6735
+ autoJoinNewChannels: options?.slack?.autoJoinNewChannels === true
6689
6736
  };
6690
6737
  const app = new Hono();
6691
6738
  app.onError((err, c) => {
@@ -1,4 +1,4 @@
1
- import { gr as extractAssistantText } from "./turn-session-routing-BqO0qXLk.js";
1
+ import { _r as extractAssistantText } from "./turn-session-routing-BFVp8TbU.js";
2
2
  // src/chat/no-reply.ts
3
3
  const NO_REPLY_MARKER = "[[NO_REPLY]]";
4
4
  /**
@@ -40,10 +40,4 @@ function getAssistantReplyText(message) {
40
40
  const decision = decideReply(message);
41
41
  return decision.kind === "deliver" ? decision.text : void 0;
42
42
  }
43
- // src/chat/interruption-marker.ts
44
- const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
45
- /** Return the marker added when a visible reply ended mid-execution. */
46
- function getInterruptionMarker() {
47
- return INTERRUPTED_MARKER;
48
- }
49
- export { NO_REPLY_MARKER as a, sanitizeAssistantText as i, decideReply as n, isNoReplyMarker as o, getAssistantReplyText as r, getInterruptionMarker as t };
43
+ export { isNoReplyMarker as a, NO_REPLY_MARKER as i, getAssistantReplyText as n, sanitizeAssistantText as r, decideReply as t };
@@ -1,5 +1,5 @@
1
1
  import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
2
- import { n as actorIdentitySchema } from "./conversation-CTpD_PGk.js";
2
+ import { n as actorIdentitySchema } from "./conversation-AhOVzN_k.js";
3
3
  import { z } from "zod";
4
4
  import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
5
5
  // src/chat/scheduled-automations/schedule-intent.ts
@@ -1,7 +1,7 @@
1
- import { i as completeObject } from "./client-Cqf4TboL.js";
2
- import { r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
3
- import { G as briefCodeChangeSchema, Y as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-CTpD_PGk.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BlQB0QQt.js";
1
+ import { i as completeObject } from "./client-B0jlQSgO.js";
2
+ import { i as defaultModelId } from "./model-profile-B998sjVd.js";
3
+ import { G as briefCodeChangeSchema, Y as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-AhOVzN_k.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BPSdXYXV.js";
5
5
  import { CLI_USAGE } from "./cli/run.js";
6
6
  import path from "node:path";
7
7
  import { z } from "zod";
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
267
267
  * `DATABASE_URL` at import, and `briefs pull` must work with only a token.
268
268
  */
269
269
  async function configuredDefaultModelId() {
270
- const { botConfig } = await import("./config-CPsE4T5L.js").then((n) => n.r);
270
+ const { botConfig } = await import("./config-DrAeD8sr.js").then((n) => n.r);
271
271
  return defaultModelId(botConfig);
272
272
  }
273
273
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-By36_xsm.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BPtbAVFo.js";
3
3
  // src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CrDrPUtY.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-BiHsH8O_.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-DOm9Y6qI.js").then((n) => n.o),
102
- import("../credentialed-BU-OW7HP.js").then((n) => n.a),
103
- import("../catalog-runtime-BsoSmTM0.js").then((n) => n.t),
104
- import("../validation-DHR1ivfh.js").then((n) => n.r),
105
- import("../viewer-DSbD6DF6.js").then((n) => n.v)
102
+ import("../credentialed-mh7HBqey.js").then((n) => n.a),
103
+ import("../catalog-runtime-Bw9kjGVu.js").then((n) => n.t),
104
+ import("../validation-Cjo-3yt3.js").then((n) => n.r),
105
+ import("../viewer-D3jhuP66.js").then((n) => n.v)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,18 +152,18 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../credentialed-BU-OW7HP.js").then((n) => n._);
155
+ const { setBriefsConfig } = await import("../credentialed-mh7HBqey.js").then((n) => n._);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-BVok7PAA.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CpGmEw_i.js");
157
+ const { runLocalAgentTurn } = await import("../runner-FIGIKvk2.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-oM5TJt34.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BSUWQI95.js");
161
- const { bindSpawnAgent } = await import("../spawn-ChCm46i-.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-BpaWd8TT.js").then((n) => n.n);
163
- const { createChildConversationWorker } = await import("../result-BemsOMOO.js").then((n) => n.i);
164
- const { skipInputBeforeConversationStop } = await import("../session-stop-BQW_iFcd.js").then((n) => n.r);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C_JzucwP.js");
161
+ const { bindSpawnAgent } = await import("../spawn-CKl_ySIq.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-CRe3WBKc.js").then((n) => n.n);
163
+ const { createChildConversationWorker } = await import("../result-CvP8c5bb.js").then((n) => n.i);
164
+ const { skipInputBeforeConversationStop } = await import("../session-stop-DuUB1rwQ.js").then((n) => n.r);
165
165
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
166
- const { processConversationWork } = await import("../worker-Cm9_sWXg.js").then((n) => n.n);
166
+ const { processConversationWork } = await import("../worker-S2P7IJDI.js").then((n) => n.n);
167
167
  let agentRunner;
168
168
  const localConversationWork = createLocalConversationWork(async (message) => {
169
169
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-n7knse-O.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-By36_xsm.js";
3
- import { i as parseSkillFile } from "../skills-DmJJIuLF.js";
1
+ import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DuwXUuIY.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BPtbAVFo.js";
3
+ import { i as parseSkillFile } from "../skills-DHK7L9Eo.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
27
  async function runAdmin(argv) {
28
- return await (await import("../admin-DSs8S5Uy.js")).runAdmin(argv);
28
+ return await (await import("../admin-CWBjzyN0.js")).runAdmin(argv);
29
29
  }
30
30
  async function runServiceAccount(argv) {
31
- return await (await import("../service-account-hMmESDcr.js")).runServiceAccount(argv);
31
+ return await (await import("../service-account-1mJGRAvx.js")).runServiceAccount(argv);
32
32
  }
33
33
  async function runBriefs(argv) {
34
- return await (await import("../briefs-PtODdLNu.js")).runBriefs(argv);
34
+ return await (await import("../briefs-0FeSJHQ3.js")).runBriefs(argv);
35
35
  }
36
36
  function topLevelCommand(argv) {
37
37
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { S as getDb } from "../viewer-DSbD6DF6.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BsoSmTM0.js";
3
- import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-BU-OW7HP.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DHR1ivfh.js";
1
+ import { S as getDb } from "../viewer-D3jhuP66.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Bw9kjGVu.js";
3
+ import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-mh7HBqey.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Cjo-3yt3.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BsoSmTM0.js";
2
- import { nt as create } from "../credentialed-BU-OW7HP.js";
3
- import { t as disconnectStateAdapter } from "../adapter-2-CG25be.js";
4
- import { n as resolve } from "../resolve-CUIBcdPd.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-Bw9kjGVu.js";
2
+ import { nt as create } from "../credentialed-mh7HBqey.js";
3
+ import { t as disconnectStateAdapter } from "../adapter-Bqbtr1RV.js";
4
+ import { n as resolve } from "../resolve-D44G1jJm.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_RUNTIME = "node22";
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,4 +1,4 @@
1
- import "../db-BzOCzVb1.js";
1
+ import "../db-DSabI7jJ.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-CPsE4T5L.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-CNS7ONt-.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-By36_xsm.js";
1
+ import { i as getChatConfig } from "../config-DrAeD8sr.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-C2cRw0hZ.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-BPtbAVFo.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -1,5 +1,5 @@
1
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-n7knse-O.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D6zJc8ff.js";
1
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DuwXUuIY.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D1NhUxyo.js";
3
3
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
4
4
  import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
5
5
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -415,7 +415,10 @@ const EMBEDDING_INPUT_COST_USD_PER_MILLION_TOKENS = {
415
415
  "openai/text-embedding-3-small": .02,
416
416
  "openai/text-embedding-ada-002": .1,
417
417
  "voyage/voyage-3.5": .06,
418
- "voyage/voyage-3.5-lite": .02
418
+ "voyage/voyage-3.5-lite": .02,
419
+ "voyage/voyage-4": .06,
420
+ "voyage/voyage-4-large": .12,
421
+ "voyage/voyage-4-lite": .02
419
422
  };
420
423
  const DECISION_INPUT_COST_USD_PER_MILLION_TOKENS = {
421
424
  "openai/gpt-6-luna-decisions": .1,
@@ -658,17 +661,24 @@ async function completeDecision(params) {
658
661
  });
659
662
  }
660
663
  }
664
+ /** Map the input type to the provider option for models that embed queries and documents differently. */
665
+ function embeddingProviderOptions(modelId, inputType) {
666
+ if (inputType === void 0 || !modelId.startsWith("voyage/")) return;
667
+ return { voyage: { inputType } };
668
+ }
661
669
  /** Generate text embeddings through the host-owned AI Gateway provider. */
662
670
  async function embedTexts(params) {
663
671
  const texts = params.texts.map((text) => text.trim());
664
672
  if (texts.length === 0 || texts.some((text) => text.length === 0)) throw new Error("Embedding text is required.");
665
673
  const credential = await resolveGatewayCredential();
666
674
  const provider = createGatewayProvider({ apiKey: credential.token });
675
+ const providerOptions = embeddingProviderOptions(params.modelId, params.inputType);
667
676
  try {
668
677
  const result = await withSpan(`${GEN_AI_OPERATION_EMBEDDINGS} ${params.modelId}`, "gen_ai.embeddings", logContextFromMetadata(params.modelId, params.metadata), async (setSpanAttributes) => {
669
678
  const result = await embedMany({
670
679
  model: provider.embeddingModel(params.modelId),
671
680
  values: texts,
681
+ ...providerOptions !== void 0 ? { providerOptions } : void 0,
672
682
  ...params.signal !== void 0 ? { abortSignal: params.signal } : void 0
673
683
  });
674
684
  const dimensions = result.embeddings[0]?.length;
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-Cqf4TboL.js";
3
- import { h as logWarn } from "./logging-n7knse-O.js";
4
- import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-Bg8EoCKD.js";
2
+ import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-B0jlQSgO.js";
3
+ import { h as logWarn } from "./logging-DuwXUuIY.js";
4
+ import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
5
5
  import { AwsClient } from "aws4fetch";
6
6
  // src/chat/attachments/s3.ts
7
7
  function readRequiredSetting(env, name) {
@@ -1,13 +1,13 @@
1
- import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BqO0qXLk.js";
2
- import { n as botConfig } from "./config-CPsE4T5L.js";
3
- import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-DSbD6DF6.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-By36_xsm.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BsoSmTM0.js";
6
- import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-CrDrPUtY.js";
7
- import { pt as startOAuthFlow } from "./credentialed-BU-OW7HP.js";
8
- import { r as getStateAdapter } from "./adapter-2-CG25be.js";
9
- import { a as getVercelConversationWorkQueue } from "./job-queue-DI-k-Bbk.js";
10
- import { m as ensureConversationWake, w as requestConversationWork } from "./store-DCo2n5iJ.js";
1
+ import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { n as botConfig } from "./config-DrAeD8sr.js";
3
+ import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-BPtbAVFo.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
6
+ import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-BiHsH8O_.js";
7
+ import { pt as startOAuthFlow } from "./credentialed-mh7HBqey.js";
8
+ import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
9
+ import { a as getVercelConversationWorkQueue } from "./job-queue-CEeLYkSj.js";
10
+ import { m as ensureConversationWake, w as requestConversationWork } from "./store-BF2XEeQz.js";
11
11
  import { z } from "zod";
12
12
  import { randomBytes, randomUUID } from "node:crypto";
13
13
  // src/chat/task-execution/authorized-turn.ts
@@ -1,4 +1,4 @@
1
- import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-85PDJxO_.js";
1
+ import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-U6Tuz6Mi.js";
2
2
  import { z } from "zod";
3
3
  import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
4
4
  // src/chat/briefs/schema.ts
@@ -313,6 +313,8 @@ const conversationPendingMessageSchema = z.object({
313
313
  role: z.literal("user"),
314
314
  source: z.enum(["slack", "web"]),
315
315
  text: z.string().optional(),
316
+ /** People mentioned in the text, resolved at read time. */
317
+ mentions: z.array(actorIdentitySchema).optional(),
316
318
  attachments: z.array(messageAttachmentSchema).optional(),
317
319
  redacted: z.literal(true).optional()
318
320
  }).strict().superRefine((data, context) => {
@@ -320,9 +322,9 @@ const conversationPendingMessageSchema = z.object({
320
322
  code: "custom",
321
323
  message: "pending message content must be text or explicitly redacted"
322
324
  });
323
- if (data.redacted && (data.actorIdentity || data.attachments)) context.addIssue({
325
+ if (data.redacted && (data.actorIdentity || data.attachments || data.mentions)) context.addIssue({
324
326
  code: "custom",
325
- message: "redacted pending messages must not expose actor identity or attachments"
327
+ message: "redacted pending messages must not expose actor identity, attachments, or mentions"
326
328
  });
327
329
  });
328
330
  /** Participant-only authorization prompt for a parked web turn. */
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-n7knse-O.js";
1
+ import { h as logWarn } from "./logging-DuwXUuIY.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,20 +1,20 @@
1
- import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-BqO0qXLk.js";
2
- import { p as escapeXml } from "./client-Cqf4TboL.js";
3
- import { a as getRuntimeMetadata, n as botConfig } from "./config-CPsE4T5L.js";
4
- import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-n7knse-O.js";
5
- import { p as parseSlackUserId } from "./actor-CP9K2Idu.js";
6
- import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-DSbD6DF6.js";
1
+ import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { p as escapeXml } from "./client-B0jlQSgO.js";
3
+ import { a as getRuntimeMetadata, n as botConfig } from "./config-DrAeD8sr.js";
4
+ import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DuwXUuIY.js";
5
+ import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
6
+ import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-D3jhuP66.js";
7
7
  import { i as homeDir } from "./package-discovery-DJBompdd.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-By36_xsm.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BsoSmTM0.js";
10
- import { t as discoverSkills } from "./skills-DmJJIuLF.js";
11
- import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-CrDrPUtY.js";
12
- import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-BU-OW7HP.js";
8
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BPtbAVFo.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
10
+ import { t as discoverSkills } from "./skills-DHK7L9Eo.js";
11
+ import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-BiHsH8O_.js";
12
+ import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-mh7HBqey.js";
13
13
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
14
- import { r as getStateAdapter } from "./adapter-2-CG25be.js";
15
- import { _ as getMcpProviderErrorAttributes } from "./service-account-DHvlLnZw.js";
16
- import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-CHy8LS0C.js";
17
- import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-upFXLmhG.js";
14
+ import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
15
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-CHO3YXpt.js";
16
+ import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BQ1T3eeF.js";
17
+ import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-BzN2K0G9.js";
18
18
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
19
19
  import path from "node:path";
20
20
  import { z } from "zod";