@sentry/junior 0.317.0 → 0.318.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/{admin-CAugg87B.js → admin-UOHix_5P.js} +1 -1
  2. package/dist/{agent-runner-AjrEV6Qe.js → agent-runner-DeYymwh2.js} +183 -113
  3. package/dist/{agent-update-delivery-B_YIZcgf.js → agent-update-delivery-DH8bx7jU.js} +5 -5
  4. package/dist/api/schema.d.ts +42 -28
  5. package/dist/api/schema.js +3 -3
  6. package/dist/api.js +38 -41
  7. package/dist/{app-MoNAsVV5.d.ts → app-DKAOuaoC.d.ts} +4 -9
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +62 -91
  10. package/dist/{thread-context-CqZDKErp.js → auth-pause-state-f9hJM_zO.js} +6 -59
  11. package/dist/{catalog-runtime-DfSpJZdY.js → catalog-runtime-BfdAnztW.js} +1 -1
  12. package/dist/{channel-access-j-YAVYK4.js → channel-access-A0de5lRv.js} +1 -1
  13. package/dist/{chat-core-engine-aH85nEHv.js → chat-core-engine-D3Wd7f5n.js} +6 -6
  14. package/dist/{child-message-DHjQLEd1.js → child-message-peFWLcCZ.js} +1 -5
  15. package/dist/cli/chat.js +32 -24
  16. package/dist/cli/check.js +4 -4
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -5
  20. package/dist/cli/upgrade.js +3 -3
  21. package/dist/context-BKF_5zzI.js +1833 -0
  22. package/dist/{continue-in-slack-D-FZ8Fin.js → continue-in-slack-YxwMQVeR.js} +3 -2
  23. package/dist/{conversation-feed--9S0_PXL.js → conversation-feed-Cj7IuBtM.js} +1 -1
  24. package/dist/{conversation-privacy-B1uXn5sf.js → conversation-privacy-Cr_dNW1p.js} +1 -1
  25. package/dist/{conversation-turn-BUE_7xaN.js → conversation-turn-Bru4w_FD.js} +111 -18
  26. package/dist/{create-DoDIYgtZ.js → create-Btl1y1rq.js} +13 -15
  27. package/dist/{credential-sync-BJOqGnjV.js → credential-sync-DTarZ63K.js} +17 -17
  28. package/dist/{db-BFmyYZtJ.js → db-of6e3sGt.js} +1943 -1189
  29. package/dist/{deployment-DXq9ZLU4.js → deployment-C0qXa0FD.js} +1 -1
  30. package/dist/{engine-context-CgQ7mlHt.js → engine-context-C_QL_bMQ.js} +52 -21
  31. package/dist/{html-B3VKTGbJ.js → html-9_pS9SjY.js} +6 -6
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{job-runner-A1lCkybD.js → job-runner-B2XEvpif.js} +11 -12
  34. package/dist/{lineage-Bktb0UcV.js → lineage-nh4z9iQN.js} +1 -1
  35. package/dist/{list-Bxvg5wXf.js → list-HRP3TIRl.js} +45 -37
  36. package/dist/{logging--smS7XRK.js → logging-BnOG0qz2.js} +3 -49
  37. package/dist/{mailbox-turn-uSXhUFc9.js → mailbox-turn-Byrry9o1.js} +220 -223
  38. package/dist/{parent-result-Ck1rFYRQ.js → markers-CTTtJqYn.js} +84 -52
  39. package/dist/{message-BNenhsmB.js → message-BRUuLgrY.js} +9 -10
  40. package/dist/{model-input-BReSnwHp.js → model-input-CFC62mf-.js} +2 -2
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +4 -4
  43. package/dist/{oauth-callback-server-CE4soEIY.js → oauth-callback-server-CjnnUr4o.js} +2 -2
  44. package/dist/{oauth-relay-C36gX1gH.js → oauth-relay-BvHFH0fV.js} +1 -1
  45. package/dist/{profile-BQ-iBDsZ.js → profile-iHw1uu32.js} +7 -7
  46. package/dist/{prompt-Dv7gkpD6.js → prompt-DEkStuxG.js} +10 -10
  47. package/dist/{registry-iXMT5Jmh.js → registry-Cl7Labpe.js} +7 -7
  48. package/dist/{reports-WKHfGTsU.js → reports-C1d9azyV.js} +2 -2
  49. package/dist/{resolve-tony4ibz.js → resolve-DC6zBuDV.js} +5 -5
  50. package/dist/{result-Bta_dlWa.js → result-DxewDuXb.js} +12 -12
  51. package/dist/{run-conversation-DL6ru7iW.js → run-conversation-Cz2ubZK-.js} +6 -5
  52. package/dist/{runner-BstDRbD9.js → runner-99YxVN_r.js} +10 -18
  53. package/dist/{sandbox-egress-signals-oSJMJOnn.js → sandbox-egress-signals-CgoX5CTI.js} +1 -1
  54. package/dist/{schema-DfqrHACA.js → schema-BTojNBr5.js} +2 -2
  55. package/dist/{sender-actors-CPglLd5R.js → sender-actors-77zTQbSG.js} +7 -6
  56. package/dist/{service-account-CTV_jaNu.js → service-account-YDCPSByj.js} +3 -3
  57. package/dist/{skills-BCEU41zM.js → skills-CleC0Hze.js} +5 -4
  58. package/dist/{slack-conversation-unfurl-DxVmhbGP.js → slack-conversation-unfurl-BNQLC12R.js} +7 -7
  59. package/dist/{spawn-frczVPIr.js → spawn-DuZfodPa.js} +7 -10
  60. package/dist/{system-prompt-table-CiXy0eNR.js → system-prompt-table-Ci6Ck4gk.js} +2 -2
  61. package/dist/{task-runner-C9Yc2_ae.js → task-runner-BJ9Up3bG.js} +18 -15
  62. package/dist/{topics-SRN7IVX-.js → topics-BoCkoPJJ.js} +2 -5
  63. package/dist/{turn-membership-CENFf3kI.js → turn-membership-VT7XZh-L.js} +4 -4
  64. package/dist/{turn-wake-BhloiI2h.js → turn-wake-C7HeLHAM.js} +4 -4
  65. package/dist/{types-C4iC-IMC.js → types-DCzTAA63.js} +55 -49
  66. package/dist/{users-ByG5RCEJ.js → users-Cb9c1k9q.js} +1 -1
  67. package/dist/{validation-8gjfR91V.js → validation-BiUmWPhy.js} +1 -1
  68. package/dist/{version-BeZhWWBE.js → version-VEXiEcZu.js} +1 -1
  69. package/dist/version.js +1 -1
  70. package/dist/{worker-BqMQQNRk.js → worker-ChWYQdhm.js} +5 -5
  71. package/migrations/20261127002500_turn_discarded_usage/migration.sql +2 -0
  72. package/migrations/20261127002500_turn_discarded_usage/snapshot.json +73 -0
  73. package/package.json +5 -5
  74. package/dist/config-CHQ8X251.js +0 -2422
package/dist/app.js CHANGED
@@ -1,43 +1,42 @@
1
- import { $c as deleteExpiredInboxSnoozes, $d as juniorTurns, $i as listScheduledAutomationsForTeam, $n as getPluginApiRoutes, Bn as resolveSlackInboxItemCardConversationId, Br as getQueueProvider, Ci as slackExternalRefIdSchema, Cl as getDashboardConversationLink, Cs as createSlackActor, Da as existingConversationId, Do as takeDueTimerWatches, Ds as parseActorUserId, Du as setEventEmbeddingsConfig, Ec as dismissOpenInboxItems, Eu as isEventEmbeddingsEnabled, Fd as juniorAutomationRuns, Fl as setMemoryConfig, Fr as isConversationQueueMessageRejectedError, Ga as syncAutomationAlerts, Gd as juniorAgentBindings, Gn as parseSlackInboxItemClick, Gr as verifySlackSignature, Hn as findSlackThreadOwnerId, Hr as annotationKeyDigest, I as conversationCostOf, In as createInboxItemShow, Jd as juniorConversationEventLexemes, Jn as parseSlackUserInputSubmission, Kc as parseAvatarUrl, Kn as parseSlackInboxItemFormTarget, Ku as getStateAdapter, Ln as pushConversationInboxItemsNow, Mc as searchInboxItems, Md as juniorQuestions, Mr as verifyConversationQueueMessage, Nl as setDashboardConversationLinkOptions, O as withConversationMutationLock, Oi as slackMention, Ou as backfillConversationEmbeddings, Pl as projectConversationMessages, Pr as conversationQueueMessageSchema, Q as canAnswerInboxItem, Qd as juniorConversationEvents, Qn as createPluginEventPublisher, Qr as getDispatchConversationId, Ra as refreshAutomationLastRun, Rc as itemQuestion, Rd as juniorAutomations, Si as slackEntitySchema, Sn as isInvalidConversationRecordError, Sr as readConversationAccessFromSql, St as getRegistrations, Td as juniorTurnInbox, Tt as validatePlugins, Ud as juniorInboxItems, Ur as decodeAnnotationRef, Vn as syncInboxItemSlackCards, Vr as renderSlackObjectCard, Vt as appendAndEnqueueInboundMessage, Wn as buildSlackInboxItemModal, Wr as runWithSlackInstallation, X as canActOnInboxItem, Xd as juniorConversationEmbeddings, Xr as confirmDispatchMailboxAppend, Xs as runWithWorkspaceTeamId, Yd as juniorConversationEventEmbeddings, Ys as getWorkspaceTeamId, Yt as clearExpiredConversationLease, _d as slackMessageTsFromMs, _i as postSlackEphemeralMessage, a as getDb, aa as withScheduledAutomationLock, ad as createSlackDestination, ai as listPendingDispatchMailboxAppends, an as listActiveConversationIds, bf as getConfigDefaults, bn as hasRunnableConversationWork, bt as inboxItemVisibility, cd as parseSlackChannelId, cs as isPublicConversation, ct as inboxItemReaderForUserInConversation, di as notifyAutomationBlocked, ec as readActorIdentity, er as getPluginRoutes, es as resumeConversationDelivery, fu as EVENT_INDEX_LOCK_TTL_MS, gd as parseSlackMessageTs, gf as juniorDestinations, gi as openSlackModal, gn as CONVERSATION_WORK_STALE_ENQUEUE_MS, gr as canAddConversationMessages, i as getConversationStore, ia as scheduledRunId, id as touchConversationDetail, ii as isTerminalDispatchStatus, jr as getVercelConversationWorkQueue, kl as getDashboardTaskLink, ku as createConversationEmbedder, lf as juniorConversations, li as markDispatchFailed, m as deleteMessageLinks, mc as recordGoogleSignIn, md as slackTeamIdSchema, mu as eventIndexLockKey, n as getConversationEventStore, nn as getConversation, o as getSqlExecutor, or as sendVercelPluginTask, pd as slackChannelIdSchema, pt as isPluginInboxItem, pu as embedConversationEvents, qo as subjectKey, ra as saveScheduledAutomationInLock, rc as resolveViewerUser, rn as getConversationWorkState, ro as slackChannelMessageEvent, rr as createVercelPluginTaskCallback, rs as listConversationAnnotations, sc as resolveActorIdentityId, sr as queueCallback, st as inboxItemReaderForUser, ta as readScheduledAutomation, ti as getDispatchRecord, tn as ensureConversationWake, to as SLACK_EVENT_NAMESPACE, tt as inboxItemAddedByAnyAutomation, u as isPostgresErrorCode, v as withConversationEventLock, vd as slackMessageTsSchema, wd as juniorTurnOutbox, wl as getDashboardInboxItemLink, wn as pruneActiveConversation, wt as setPlugins, xf as setConfigDefaults, ya as automationVersionOf, yt as inboxItemOwnerConversationId, yu as storeConversationEventLexemes, zn as runInboxItemPushTimers, zs as getSlackClient } from "./db-BFmyYZtJ.js";
2
- import { N as fenceLock, P as withLock, c as installChatConfig, j as MUTATION_LOCK_TTL_MS, l as loadConfig, n as getChatConfig, t as botConfig } from "./config-CHQ8X251.js";
3
- import { E as withSpan, N as normalizeIdentityEmail, T as withLogContext, b as setSpanAttributes, h as logWarn, j as GOOGLE_IDENTITY_PROVIDER, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging--smS7XRK.js";
4
- import { A as vercelBackgroundCompactionQueue, At as parseSlackThreadId, Ft as unpublishedArtifactHeaders, K as stopConversation, N as createVercelCacheWarmupCallback, Nt as publicArtifactHeaders, Pt as readPublicArtifact, Qt as automationCardStatus, W as markConversationRead, Wt as ViewerTaskNotFoundError, X as inboxItemChangeRecord, Y as deliverInboxItemChange, Yt as readViewerAutomationSummary, Z as renderInboxItemMessage, Zt as readViewerAutomations, d as logScheduledAutomationRunSkipped, dt as createAndEnqueueConversation, en as findAutomationSkill, f as scheduledAutomationRunAttributes, gt as collectAttachmentUploadGarbage, j as verifyBackgroundCompactionMessage, k as processBackgroundCompaction, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, nn as effectiveTaskOutcomes, pt as recordWebConversationActivity, qt as readViewerAutomationExecutions, t as createAgentRunner, tn as missingAutomationSkillReason, ut as conversationTurnIdForMessage } from "./agent-runner-AjrEV6Qe.js";
5
- import { A as createUserTokenStore, C as clearSandboxEgressSignals, D as parseSandboxEgressCredentialToken, P as normalizeSandboxEgressTracePropagationDomains, T as consumeSandboxEgressPermissionDeniedSignal, c as isVercelSandboxEgressRequest, l as proxyVercelSandboxEgressRequest, w as consumeSandboxEgressAuthRequiredSignal } from "./profile-BQ-iBDsZ.js";
6
- import { I as findTrustedUser, L as isAllowedDomain, Ln as settleConversationTitleWork, Mn as appendConversationMessages, Nt as renderTaskInput, R as isTrustedSlackAuthor, V as setTrustConfig, _t as coerceThreadConversationState, en as getExperimentalFeatures, nn as setExperimentalFeatures, t as getAuthPausedConversationTurnId, tn as isExperimentalFeatureEnabled, z as parseEmail } from "./mailbox-turn-uSXhUFc9.js";
7
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DfSpJZdY.js";
8
- import { $ as reviewItemChange, At as createProductionSlackWebhookServices, B as mcpIdempotencyKeySchema, Bt as startProcessingReaction, Dt as isPublicAddress, F as mcpAuthorizationSchema$1, Ft as normalizeIncomingSlackThreadId, G as readMcpPendingWork, H as mcpMessageTextSchema, Ht as parseContent, I as mcpConversation, It as withNormalizedThreadId, K as readMcpPendingWorkAfterSend, Kt as readConversationRecordFromSql, L as mcpConversationIdSchema, Lt as recordSkippedConversationMessage, Mt as buildSlackInboundMessage, Nt as clearSlackPendingReactions, Ot as publicAddressLookup, P as mcpAcceptedMessageSchema, Pt as slackInboundMessageId, Q as readInboxItemForUser, R as mcpConversationSchema, Rt as createSlackWebApiStatusSender, St as readObjectLinkTypes, U as mcpMessages, Ut as SubscribedReplyReason, V as mcpMessageSchema, Vt as stripLeadingBotMention, W as mcpPendingMessagesSchema, Wt as getThreadStopDecision, X as actOnInboxItem, Y as InboxItemActionError, Z as closeInboxItemsAnsweredByReply, _ as createConversationForViewer, _t as backfillCacheWarmingGaps, a as resolveInboxItemSubjects, b as encodeConversationCursor, ct as listOpenAutomationQuestions, dt as getScheduledAutomationDispatch, et as createEventAppPublisher, ft as runInboxSnoozeTimers, g as appendConversationMessageForViewer, ht as runSavingsRefillSlice, jt as getProductionSlackAdapter, kt as createProductionConversationWorkOptions, lt as createHeartbeatContext, n as readConversationFeed, nt as runAutoArchiveSweep, o as readConversationDetail, ot as automationReplyAttribution, st as settleEventAutomationRuns, tt as ingestEventAutomations, ut as dispatchScheduledAutomation, vt as GET$4, w as conversationOperations, y as decodeConversationCursor, z as mcpCursorSchema, zt as bindMessageAuthorIdentityId } from "./list-Bxvg5wXf.js";
9
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-8gjfR91V.js";
1
+ import { E as parseSlackChannelId, F as slackMessageTsFromMs, G as loadConfig, I as slackMessageTsSchema, K as parseEnvList, L as botConfig, M as slackTeamIdSchema, P as parseSlackMessageTs, R as getChatConfig, S as MUTATION_LOCK_TTL_MS, T as withLock, W as installChatConfig, c as createSlackActor, j as slackChannelIdSchema, p as parseActorUserId, w as fenceLock, y as getStateAdapter } from "./context-BKF_5zzI.js";
2
+ import { Ad as juniorTurnOutbox, Ci as postSlackEphemeralMessage, Dt as validatePlugins, Ea as automationVersionOf, En as pruneActiveConversation, Et as setPlugins, Fr as verifyConversationQueueMessage, Ga as refreshAutomationLastRun, Hn as resolveSlackInboxItemCardConversationId, Hs as getWorkspaceTeamId, Jn as parseSlackInboxItemFormTarget, Jo as subjectKey, Jr as annotationKeyDigest, Kc as deleteExpiredInboxSnoozes, Kn as buildSlackInboxItemModal, Lr as conversationQueueMessageSchema, Ms as getSlackClient, Nr as getVercelConversationWorkQueue, O as withConversationMutationLock, Oi as slackEntitySchema, Pa as existingConversationId, Pi as slackMention, Po as takeDueTimerWatches, Pr as resolveConversationWorkTopic, Q as canActOnInboxItem, Qa as syncAutomationAlerts, R as conversationCostOf, Rd as juniorQuestions, Rn as createInboxItemShow, Rr as isConversationQueueMessageRejectedError, Sf as juniorDestinations, Si as openSlackModal, Sn as hasRunnableConversationWork, St as inboxItemVisibility, Su as createConversationEmbedder, Tc as searchInboxItems, Un as syncInboxItemSlackCards, Ur as getQueueProvider, Us as runWithWorkspaceTeamId, Ut as appendAndEnqueueInboundMessage, Vd as juniorAutomationRuns, Vn as runInboxItemPushTimers, Wd as juniorAutomations, Wn as findSlackThreadOwnerId, Xn as parseSlackUserInputSubmission, Xr as runWithSlackInstallation, Xs as resolveViewerUser, Yd as juniorInboxItems, Yr as decodeAnnotationRef, Zd as juniorAgentBindings, Zr as verifySlackSignature, Zt as clearExpiredConversationLease, _i as notifyAutomationBlocked, a as getDb, af as juniorTurns, an as getConversationWorkState, ar as createVercelPluginTaskCallback, bd as touchConversationDetail, bu as isEventEmbeddingsEnabled, ca as readScheduledAutomation, co as SLACK_EVENT_NAMESPACE, cr as sendVercelPluginTask, cu as embedConversationEvents, da as scheduledRunId, di as listPendingDispatchMailboxAppends, dl as projectConversationMessages, ec as resolveActorIdentityId, ef as juniorConversationEventLexemes, er as createPluginEventPublisher, et as canAnswerInboxItem, fa as withScheduledAutomationLock, fs as isPublicConversation, hf as juniorConversations, hi as markDispatchFailed, ht as isPluginInboxItem, i as getConversationStore, if as juniorConversationEvents, ii as getDispatchConversationId, in as getConversation, is as listConversationAnnotations, jc as itemQuestion, jd as juniorTurnInbox, ki as slackExternalRefIdSchema, lr as queueCallback, lt as inboxItemReaderForUser, lu as eventIndexLockKey, m as deleteMessageLinks, mu as storeConversationEventLexemes, n as getConversationEventStore, nf as juniorConversationEmbeddings, ni as confirmDispatchMailboxAppend, nl as getDashboardInboxItemLink, nr as getPluginRoutes, o as getSqlExecutor, oa as listScheduledAutomationsForTeam, qn as parseSlackInboxItemClick, qr as renderSlackObjectCard, qs as readActorIdentity, rn as ensureConversationWake, rt as inboxItemAddedByAnyAutomation, sc as recordGoogleSignIn, si as getDispatchRecord, sl as getDashboardTaskLink, sn as listActiveConversationIds, su as EVENT_INDEX_LOCK_TTL_MS, tf as juniorConversationEventEmbeddings, tl as getDashboardConversationLink, tr as getPluginApiRoutes, ts as resumeConversationDelivery, u as isPostgresErrorCode, ua as saveScheduledAutomationInLock, ui as isTerminalDispatchStatus, uo as slackChannelMessageEvent, ut as inboxItemReaderForUserInConversation, v as withConversationEventLock, vn as CONVERSATION_WORK_STALE_ENQUEUE_MS, vr as canAddConversationMessages, wn as isInvalidConversationRecordError, wr as readConversationAccessFromSql, wt as getRegistrations, xd as createSlackDestination, xt as inboxItemOwnerConversationId, xu as backfillConversationEmbeddings, yc as dismissOpenInboxItems, zc as parseAvatarUrl, zn as pushConversationInboxItemsNow } from "./db-of6e3sGt.js";
3
+ import { C as withContext, D as GOOGLE_IDENTITY_PROVIDER, T as withSpan, f as logException, k as normalizeIdentityEmail, m as logWarn, n as createRequestContext, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-BnOG0qz2.js";
4
+ import { A as vercelBackgroundCompactionQueue, At as parseSlackThreadId, Ft as unpublishedArtifactHeaders, K as stopConversation, N as createVercelCacheWarmupCallback, Nt as publicArtifactHeaders, Pt as readPublicArtifact, Qt as automationCardStatus, W as markConversationRead, Wt as ViewerTaskNotFoundError, X as inboxItemChangeRecord, Y as deliverInboxItemChange, Yt as readViewerAutomationSummary, Z as renderInboxItemMessage, Zt as readViewerAutomations, ct as appendAndEnqueueWebMessage, d as logScheduledAutomationRunSkipped, en as findAutomationSkill, f as scheduledAutomationRunAttributes, ft as recordWebConversationActivity, gt as collectAttachmentUploadGarbage, j as verifyBackgroundCompactionMessage, k as processBackgroundCompaction, lt as conversationTurnIdForMessage, n as executeAgentRun, nn as effectiveTaskOutcomes, pt as webActorFromUser, qt as readViewerAutomationExecutions, t as createAgentRunner, tn as missingAutomationSkillReason, ut as createAndEnqueueConversation } from "./agent-runner-DeYymwh2.js";
5
+ import { A as createUserTokenStore, C as clearSandboxEgressSignals, D as parseSandboxEgressCredentialToken, P as normalizeSandboxEgressTracePropagationDomains, T as consumeSandboxEgressPermissionDeniedSignal, c as isVercelSandboxEgressRequest, l as proxyVercelSandboxEgressRequest, w as consumeSandboxEgressAuthRequiredSignal } from "./profile-iHw1uu32.js";
6
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BfdAnztW.js";
7
+ import { $ as reviewItemChange, At as createProductionSlackWebhookServices, B as mcpIdempotencyKeySchema, Bt as startProcessingReaction, Dt as isPublicAddress, F as mcpAuthorizationSchema$1, Ft as normalizeIncomingSlackThreadId, G as readMcpPendingWork, H as mcpMessageTextSchema, Ht as parseContent, I as mcpConversation, It as withNormalizedThreadId, K as readMcpPendingWorkAfterSend, Kt as readConversationRecordFromSql, L as mcpConversationIdSchema, Lt as recordSkippedConversationMessage, Mt as buildSlackInboundMessage, Nt as clearSlackPendingReactions, Ot as publicAddressLookup, P as mcpAcceptedMessageSchema, Pt as slackInboundMessageId, Q as readInboxItemForUser, R as mcpConversationSchema, Rt as createSlackWebApiStatusSender, St as readObjectLinkTypes, U as mcpMessages, Ut as SubscribedReplyReason, V as mcpMessageSchema, Vt as stripLeadingBotMention, W as mcpPendingMessagesSchema, Wt as getThreadStopDecision, X as actOnInboxItem, Y as InboxItemActionError, Z as closeInboxItemsAnsweredByReply, _ as createConversationForViewer, _t as backfillCacheWarmingGaps, a as resolveInboxItemSubjects, b as encodeConversationCursor, ct as listOpenAutomationQuestions, dt as getScheduledAutomationDispatch, et as createEventAppPublisher, ft as runInboxSnoozeTimers, g as appendConversationMessageForViewer, ht as runSavingsRefillSlice, jt as getProductionSlackAdapter, kt as createProductionConversationWorkOptions, lt as createHeartbeatContext, n as readConversationFeed, nt as runAutoArchiveSweep, o as readConversationDetail, ot as automationReplyAttribution, st as settleEventAutomationRuns, tt as ingestEventAutomations, ut as dispatchScheduledAutomation, vt as GET$4, w as conversationOperations, y as decodeConversationCursor, z as mcpCursorSchema, zt as bindMessageAuthorIdentityId } from "./list-HRP3TIRl.js";
8
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BiUmWPhy.js";
10
9
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-D_Ru4CWc.js";
11
- import { n as processWorkspaceSnapshotJob, o as ingestEvent, r as verifyWorkspaceSnapshotJobMessage } from "./job-runner-A1lCkybD.js";
12
- import { o as enqueueAgentDispatch, s as failStoppedDispatch } from "./run-conversation-DL6ru7iW.js";
13
- import { Bn as getNextRunAtMs, Bt as annotationCard, Fn as automationTaskText, Pn as automationTaskSchema, _ as automationListQuerySchema, _n as buttonUserInputField, fn as inboxItemQuestion, p as automationExecutionStatusSchema, rn as scheduledRunSchema } from "./types-C4iC-IMC.js";
14
- import { t as createEndStoppedChildWork } from "./result-Bta_dlWa.js";
15
- import { l as collectAttachmentGarbage, p as requestAttachmentDeletion, y as getAttachmentStorage } from "./turn-membership-CENFf3kI.js";
16
- import { h as createPluginLogger } from "./prompt-Dv7gkpD6.js";
10
+ import { n as processWorkspaceSnapshotJob, o as ingestEvent, r as verifyWorkspaceSnapshotJobMessage } from "./job-runner-B2XEvpif.js";
11
+ import { o as enqueueAgentDispatch, s as failStoppedDispatch } from "./run-conversation-Cz2ubZK-.js";
12
+ import { I as findTrustedUser, It as renderTaskInput, L as isAllowedDomain, Nn as appendConversationMessages, R as isTrustedSlackAuthor, Rn as settleConversationTitleWork, gt as coerceThreadConversationState, rn as isExperimentalFeatureEnabled, t as getAuthPausedConversationTurnId, z as parseEmail } from "./mailbox-turn-Byrry9o1.js";
13
+ import { Bt as annotationCard, Dn as automationTaskSchema, Nn as getNextRunAtMs, On as automationTaskText, _ as automationListQuerySchema, _n as buttonUserInputField, fn as inboxItemQuestion, p as automationExecutionStatusSchema, rn as scheduledRunSchema } from "./types-DCzTAA63.js";
14
+ import { t as createEndStoppedChildWork } from "./result-DxewDuXb.js";
15
+ import { l as collectAttachmentGarbage, p as requestAttachmentDeletion, y as getAttachmentStorage } from "./turn-membership-VT7XZh-L.js";
16
+ import { h as createPluginLogger } from "./prompt-DEkStuxG.js";
17
17
  import { i as getActiveSpan, u as sentry_exports } from "./sentry-CPbZjomA.js";
18
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-BJOqGnjV.js";
18
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DTarZ63K.js";
19
19
  import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
20
20
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
21
- 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-DxVmhbGP.js";
22
- import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-B3VKTGbJ.js";
23
- import { s as joinPublicChannel } from "./channel-access-j-YAVYK4.js";
24
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, l as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, o as JUNIOR_DELIVERY_CALLBACK_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-DXq9ZLU4.js";
25
- import { a as resolveConversationWorkQueueTopic } from "./topics-SRN7IVX-.js";
26
- import { t as processConversationWork } from "./worker-BqMQQNRk.js";
27
- import { t as bindMessageAgent } from "./message-BNenhsmB.js";
28
- import { t as bindSpawnAgent } from "./spawn-frczVPIr.js";
29
- import { l as readConversationLastEventSeq, o as readConversationEventPage, s as readConversationEventPageAfter, t as processPluginTask, u as readConversationMessageEventSeq } from "./task-runner-C9Yc2_ae.js";
30
- import { c as replyText, d as publishTurnStep, f as countMetric, i as turnStepConsumer, l as createDeliveryConsumer, n as turnTools, o as findStalledTurns, p as withSpan$1, r as createGatewayModelClient, s as findStalledDeliveries, t as createEngineContext, u as publishDelivery } from "./engine-context-CgQ7mlHt.js";
31
- import { t as JUNIOR_VERSION } from "./version-BeZhWWBE.js";
32
- import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed--9S0_PXL.js";
21
+ 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-BNQLC12R.js";
22
+ import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-9_pS9SjY.js";
23
+ import { s as joinPublicChannel } from "./channel-access-A0de5lRv.js";
24
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, l as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, o as JUNIOR_DELIVERY_CALLBACK_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-C0qXa0FD.js";
25
+ import { t as processConversationWork } from "./worker-ChWYQdhm.js";
26
+ import { t as bindMessageAgent } from "./message-BRUuLgrY.js";
27
+ import { t as bindSpawnAgent } from "./spawn-DuZfodPa.js";
28
+ import { l as readConversationLastEventSeq, o as readConversationEventPage, s as readConversationEventPageAfter, t as processPluginTask, u as readConversationMessageEventSeq } from "./task-runner-BJ9Up3bG.js";
29
+ import { c as replyText, d as publishTurnStep, f as countMetric, i as turnStepConsumer, l as createDeliveryConsumer, n as turnTools, o as findStalledTurns, p as withSpan$1, r as createGatewayModelClient, s as findStalledDeliveries, t as createEngineContext, u as publishDelivery } from "./engine-context-C_QL_bMQ.js";
30
+ import { t as JUNIOR_VERSION } from "./version-VEXiEcZu.js";
31
+ import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-Cj7IuBtM.js";
33
32
  import { t as isMissingVirtualModule } from "./virtual-module-BeKA_EII.js";
34
33
  import { createRequire } from "node:module";
35
34
  import { Hono } from "hono";
36
35
  import * as z from "zod";
37
- import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
38
- import { destinationSchema, eventTriggerFiltersText, identityDispatchOptionsSchema, userSchema } from "@sentry/junior-plugin-api";
39
36
  import { and, asc, desc, eq, gt, gte, inArray, isNotNull, isNull, lt, lte, ne, not, notExists, or, sql } from "drizzle-orm";
40
37
  import { pgTable, text } from "drizzle-orm/pg-core";
38
+ import { destinationSchema, eventTriggerFiltersText, identityDispatchOptionsSchema, userSchema } from "@sentry/junior-plugin-api";
39
+ import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
41
40
  import { pathToFileURL } from "node:url";
42
41
  import { Message, ThreadImpl } from "chat";
43
42
  import net from "node:net";
@@ -1579,7 +1578,7 @@ async function handleSandboxEgressRoute(request, tracePropagationDomains, next)
1579
1578
  const SANDBOX_EGRESS_TOKEN_HEADER = "x-junior-sandbox-egress-token";
1580
1579
  function isLoopbackDevelopmentRequest(request) {
1581
1580
  const hostname = new URL(request.url).hostname;
1582
- return process.env["NODE_ENV"] === "development" && (hostname === "127.0.0.1" || hostname === "localhost");
1581
+ return getChatConfig().development.enabled && (hostname === "127.0.0.1" || hostname === "localhost");
1583
1582
  }
1584
1583
  /** Clear command-scoped sandbox egress signals through the loopback dev server. */
1585
1584
  async function DELETE(request) {
@@ -3124,7 +3123,7 @@ function resolveConversationWorkVisibilityTimeoutSeconds(functionMaxDurationSeco
3124
3123
  */
3125
3124
  function queueProcessAttributes(metadata, nowMs) {
3126
3125
  return {
3127
- "messaging.destination.name": metadata?.topicName ?? resolveConversationWorkQueueTopic(),
3126
+ "messaging.destination.name": metadata?.topicName ?? resolveConversationWorkTopic(),
3128
3127
  "messaging.system": getQueueProvider().messagingSystem,
3129
3128
  ...metadata && {
3130
3129
  "messaging.message.id": metadata.messageId,
@@ -3176,7 +3175,7 @@ async function consumeConversationQueueMessage(message, options) {
3176
3175
  createdAt: new Date(nowMs),
3177
3176
  deliveryCount: 1,
3178
3177
  messageId: options.messageId,
3179
- topicName: resolveConversationWorkQueueTopic(options)
3178
+ topicName: resolveConversationWorkTopic(options.topic)
3180
3179
  });
3181
3180
  }
3182
3181
  function logConversationQueueMessageRejected(reason, metadata, error) {
@@ -3548,7 +3547,7 @@ function createAcpConversations(options) {
3548
3547
  },
3549
3548
  async prompt({ conversationId, idempotencyKey, text, user }) {
3550
3549
  const access = await readAccess(conversationId, user);
3551
- if (!access?.isParticipant || !canAddConversationMessages(access)) return { status: "not_found" };
3550
+ if (!canAddConversationMessages(access)) return { status: "not_found" };
3552
3551
  const currentCursor = await latestEventCursor(options.eventStore, conversationId);
3553
3552
  if (await getAuthPausedConversationTurnId(conversationId)) return { status: "active" };
3554
3553
  const result = await appendAndEnqueueWebMessage({
@@ -6705,43 +6704,6 @@ async function handleAcpAuthorizationPage(args) {
6705
6704
  });
6706
6705
  return renderResult(args.agentName, result);
6707
6706
  }
6708
- // src/chat/sign-in/allowlist.ts
6709
- /**
6710
- * Read the domain list that may use Junior. Slack authors must have a Slack
6711
- * profile email on one of them, and dashboard Google sign-ins must come from
6712
- * a Google Workspace account whose `hd` claim is one of them. Slack and the
6713
- * dashboard share one list. `chat/identities/trust` decides who matches.
6714
- */
6715
- /** Parse a list env var value: a JSON string array or comma-separated values. */
6716
- function parseEnvList(name, rawValue) {
6717
- const value = rawValue?.trim();
6718
- if (!value) return void 0;
6719
- if (!value.startsWith("[")) return value.split(",");
6720
- let parsed;
6721
- try {
6722
- parsed = JSON.parse(value);
6723
- } catch (error) {
6724
- throw new Error(`${name} must be a JSON string array`, { cause: error });
6725
- }
6726
- const list = z.array(z.string()).safeParse(parsed);
6727
- if (!list.success) throw new Error(`${name} must be a JSON string array`);
6728
- return list.data;
6729
- }
6730
- /**
6731
- * Resolve the allowed domains: the `createApp` option when set, else
6732
- * `JUNIOR_ALLOWED_DOMAINS`. An empty list allows every domain.
6733
- */
6734
- function resolveAllowedDomains(allowedDomains) {
6735
- return [...new Set((allowedDomains ?? parseEnvList("JUNIOR_ALLOWED_DOMAINS", getChatConfig().signIn.allowedDomains) ?? []).map((value) => value.trim().toLowerCase()).filter(Boolean))];
6736
- }
6737
- /**
6738
- * Fail startup on the removed Google-specific option. Ignoring it would
6739
- * leave the list empty, which lets every Slack workspace member in.
6740
- * `loadConfig` rejects the removed env var the same way.
6741
- */
6742
- function assertNoLegacyAllowedDomains(dashboardOptionKeys) {
6743
- if (dashboardOptionKeys.includes("allowedGoogleDomains")) throw new Error("dashboard.allowedGoogleDomains was removed; set createApp({ allowedDomains }) instead");
6744
- }
6745
6707
  // src/chat/sign-in/auth.ts
6746
6708
  /**
6747
6709
  * Google sign-in session for the dashboard.
@@ -6915,6 +6877,16 @@ function createSignInAuth(config) {
6915
6877
  }
6916
6878
  };
6917
6879
  }
6880
+ // src/chat/sign-in/allowlist.ts
6881
+ /**
6882
+ * Fail startup on the removed Google-specific option. Ignoring it would
6883
+ * leave the allowed domain list empty, which lets every Slack workspace
6884
+ * member in. `loadConfig` resolves the list and rejects the removed env var
6885
+ * the same way.
6886
+ */
6887
+ function assertNoLegacyAllowedDomains(dashboardOptionKeys) {
6888
+ if (dashboardOptionKeys.includes("allowedGoogleDomains")) throw new Error("dashboard.allowedGoogleDomains was removed; set createApp({ allowedDomains }) instead");
6889
+ }
6918
6890
  // src/dashboard-routes.ts
6919
6891
  const DASHBOARD_PACKAGE_NAME = "@sentry/junior-dashboard";
6920
6892
  /**
@@ -7179,13 +7151,30 @@ function appConfigInput(options, virtualConfig) {
7179
7151
  refusalFallbackModelId: options?.refusalFallbackModelId,
7180
7152
  userName: virtualConfig?.botName
7181
7153
  },
7154
+ configDefaults: options?.configDefaults,
7155
+ dashboard: dashboard && {
7156
+ basePath: dashboard.basePath,
7157
+ baseURL: dashboard.baseURL,
7158
+ disabled: dashboard.disabled
7159
+ },
7182
7160
  deployment: { configuredBaseUrl: dashboard?.baseURL?.trim() || void 0 },
7161
+ eventEmbeddings: options?.eventEmbeddings,
7162
+ experimental: options?.experimental,
7183
7163
  functionMaxDurationSeconds: virtualConfig?.functionMaxDurationSeconds,
7184
7164
  limits: options?.limits,
7165
+ memory: {
7166
+ disableExtraction: options?.memory?.disableExtraction,
7167
+ disableRecall: options?.memory?.disableRecall,
7168
+ modelId: options?.memory?.modelId?.trim() || void 0
7169
+ },
7185
7170
  sandbox: { vcpus: options?.sandbox?.vcpus },
7186
7171
  slack: {
7187
7172
  completedReactionEmoji: options?.slack?.completedReactionEmoji,
7188
7173
  processingReactionEmoji: options?.slack?.processingReactionEmoji
7174
+ },
7175
+ trust: {
7176
+ allowedBotUserIds: options?.slack?.allowedBotUserIds,
7177
+ allowedDomains: options?.allowedDomains
7189
7178
  }
7190
7179
  };
7191
7180
  }
@@ -7239,23 +7228,11 @@ async function createApp(options) {
7239
7228
  const shouldValidatePluginCatalog = hasConfiguredPluginCatalog(pluginConfig) || Boolean(configuredPlugins?.registrations.length) || Boolean(Object.keys(options?.configDefaults ?? {}).length);
7240
7229
  const previousPluginCatalogConfig = pluginCatalogRuntime.setConfig(pluginConfig);
7241
7230
  const previousPlugins = setPlugins(plugins);
7242
- const previousConfigDefaults = getConfigDefaults();
7243
- const previousExperimentalFeatures = getExperimentalFeatures();
7244
- const previousEventEmbeddingsConfig = setEventEmbeddingsConfig(options?.eventEmbeddings);
7245
- const previousMemoryConfig = setMemoryConfig(options?.memory);
7246
- const previousDashboardLinkOptions = setDashboardConversationLinkOptions(dashboard);
7247
- let previousTrustConfig;
7248
7231
  let restoreChatConfig;
7249
7232
  const restoreRuntimeConfig = () => {
7250
- if (previousTrustConfig) setTrustConfig(previousTrustConfig);
7251
7233
  pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
7252
7234
  setPlugins(previousPlugins);
7253
- setConfigDefaults(previousConfigDefaults);
7254
7235
  restoreChatConfig?.();
7255
- setExperimentalFeatures(previousExperimentalFeatures);
7256
- setEventEmbeddingsConfig(previousEventEmbeddingsConfig);
7257
- setMemoryConfig(previousMemoryConfig);
7258
- setDashboardConversationLinkOptions(previousDashboardLinkOptions);
7259
7236
  };
7260
7237
  let pluginRoutes = [];
7261
7238
  let pluginApiRoutes = [];
@@ -7269,20 +7246,14 @@ async function createApp(options) {
7269
7246
  let dispatchForIdentity;
7270
7247
  try {
7271
7248
  sandboxEgressTracePropagationDomains = normalizeSandboxEgressTracePropagationDomains(options?.sandbox?.egressTracePropagationDomains);
7272
- setExperimentalFeatures(options?.experimental);
7273
- setConfigDefaults(options?.configDefaults);
7274
- warnUnregisteredConfigDefaults(options?.configDefaults);
7275
7249
  const previousChatConfig = installChatConfig(loadConfig({
7276
7250
  env: process.env,
7277
7251
  options: appConfigInput(options, virtualConfig)
7278
7252
  }));
7279
7253
  restoreChatConfig = () => installChatConfig(previousChatConfig);
7254
+ warnUnregisteredConfigDefaults(options?.configDefaults);
7280
7255
  assertNoLegacyAllowedDomains(Object.keys(dashboard ?? {}));
7281
- allowedDomains = resolveAllowedDomains(options?.allowedDomains);
7282
- previousTrustConfig = setTrustConfig({
7283
- allowedBotUserIds: options?.slack?.allowedBotUserIds ?? [],
7284
- allowedDomains
7285
- });
7256
+ allowedDomains = getChatConfig().trust.allowedDomains;
7286
7257
  if (allowedDomains.length === 0) logWarn("app.allowed_domains.unset", { "app.reason": "allowedDomains is empty, so any Slack workspace member can use the bot" });
7287
7258
  dispatchForIdentity = createIdentityDispatcher({ conversationWorkQueue: () => conversationWorkQueue });
7288
7259
  if (dashboard && !dashboard.disabled) signInConfig = resolveSignInAuthConfig(botConfig.userName, allowedDomains, dashboard);
@@ -1,9 +1,8 @@
1
- import { a as getDb, n as getConversationEventStore, rn as getConversationWorkState, rs as listConversationAnnotations } from "./db-BFmyYZtJ.js";
2
- import { b as setSpanAttributes } from "./logging--smS7XRK.js";
3
- import { L as mapBounded } from "./prompt-Dv7gkpD6.js";
4
- import { Gt as resolveMessageCards, Ut as readMessageCardRefs, Wt as removedCardSchema } from "./types-C4iC-IMC.js";
5
- import { Nn as hydrateConversationMessages, Rn as buildConversationContext, Un as markConversationMessage, Z as getTurnUserMessageId, _t as coerceThreadConversationState, ct as markTurnClosed, fr as clearPendingAuth, gt as persistThreadStateById, lt as markTurnCompleted, mt as getPersistedThreadState } from "./mailbox-turn-uSXhUFc9.js";
6
- import { n as listChildMessages } from "./child-message-DHjQLEd1.js";
1
+ import { a as getDb, an as getConversationWorkState, is as listConversationAnnotations, n as getConversationEventStore } from "./db-of6e3sGt.js";
2
+ import { Gt as resolveMessageCards, Ut as readMessageCardRefs, Wt as removedCardSchema } from "./types-DCzTAA63.js";
3
+ import { G as mapBounded } from "./prompt-DEkStuxG.js";
4
+ import { Pn as hydrateConversationMessages, Wn as markConversationMessage, X as getTurnUserMessageId, ct as markTurnCompleted, gt as coerceThreadConversationState, ht as persistThreadStateById, pt as getPersistedThreadState, st as markTurnClosed, ur as clearPendingAuth } from "./mailbox-turn-Byrry9o1.js";
5
+ import { t as listChildMessages } from "./child-message-peFWLcCZ.js";
7
6
  // src/chat/conversations/pending-cards.ts
8
7
  /**
9
8
  * Add the cards that tool results selected since the last visible assistant
@@ -111,56 +110,4 @@ async function persistAuthPauseTurnState(args) {
111
110
  });
112
111
  await persistThreadStateById(args.threadStateId, { conversation });
113
112
  }
114
- // src/chat/conversations/thread-context.ts
115
- const CURSOR_TURN_LOOKBACK = 10;
116
- async function loadThreadContextCursor(args) {
117
- const store = getConversationEventStore();
118
- const [started, completed] = await Promise.all([store.query(args.conversationId, {
119
- limit: CURSOR_TURN_LOOKBACK,
120
- types: ["turn_started"]
121
- }), store.query(args.conversationId, {
122
- limit: CURSOR_TURN_LOOKBACK,
123
- types: ["turn_completed"]
124
- })]);
125
- const finished = new Set(completed.events.flatMap((event) => event.data.type === "turn_completed" && event.data.outcome !== "cancelled" ? [event.data.turnId] : []));
126
- const previous = [...started.events].reverse().find((event) => event.data.type === "turn_started" && event.data.turnId !== args.turnId && finished.has(event.data.turnId));
127
- return previous?.data.type === "turn_started" ? previous.data.threadContextThroughSeq : void 0;
128
- }
129
- /**
130
- * Return the oldest cursor of the Turns that the cursor lookup reads. Messages
131
- * after it may still be in the thread context delta of the next Turn, also
132
- * when the latest Turns failed or the next Turn retries.
133
- */
134
- async function loadThreadContextTrimFloor(conversationId) {
135
- const cursors = (await getConversationEventStore().query(conversationId, {
136
- limit: CURSOR_TURN_LOOKBACK,
137
- types: ["turn_started"]
138
- })).events.flatMap((event) => event.data.type === "turn_started" && event.data.threadContextThroughSeq !== void 0 ? [event.data.threadContextThroughSeq] : []);
139
- return cursors.length > 0 ? Math.min(...cursors) : void 0;
140
- }
141
- /**
142
- * Build the thread context of one Turn prompt. With agent history, show only
143
- * the thread Messages saved after the cursor of the previous Turn.
144
- *
145
- * Sets `app.thread_context.*` on the active span: `chat.reply` in a Slack
146
- * Turn, `chat.turn` in a web or Event Turn. Cursor `missing` means that the
147
- * previous Turn ran before cursors existed.
148
- */
149
- async function buildTurnThreadContext(args) {
150
- const afterSeq = args.hasHistory ? await loadThreadContextCursor({
151
- conversationId: args.conversationId,
152
- turnId: args.turnId
153
- }) : void 0;
154
- const block = buildConversationContext(args.conversation, {
155
- excludeMessageIds: args.excludeMessageIds,
156
- ...args.hasHistory ? { history: { afterSeq } } : void 0
157
- });
158
- setSpanAttributes({
159
- "app.thread_context.chars": block.text?.length ?? 0,
160
- "app.thread_context.shown_messages": block.shownMessages,
161
- "app.thread_context.omitted_messages": block.omittedMessages,
162
- "app.thread_context.cursor": !args.hasHistory ? "no_history" : afterSeq === void 0 ? "missing" : "found"
163
- });
164
- return block.text;
165
- }
166
- export { buildDeliveredTurnStatePatch as a, persistAuthPauseTurnState as i, loadThreadContextTrimFloor as n, loadPendingMessageCards as o, completeAuthPauseTurn as r, buildTurnThreadContext as t };
113
+ export { loadPendingMessageCards as i, persistAuthPauseTurnState as n, buildDeliveredTurnStatePatch as r, completeAuthPauseTurn as t };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-iXMT5Jmh.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-Cl7Labpe.js";
3
3
  // src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,4 +1,4 @@
1
- import { Fs as SlackActionError, i as getConversationStore, qs as withSlackRetries, zs as getSlackClient } from "./db-BFmyYZtJ.js";
1
+ import { Bs as withSlackRetries, Ms as getSlackClient, Os as SlackActionError, i as getConversationStore } from "./db-of6e3sGt.js";
2
2
  import * as z from "zod";
3
3
  // src/chat/slack/channel.ts
4
4
  const replySubtypeSchema = z.object({ subtype: z.string().optional() });
@@ -1,13 +1,13 @@
1
- import { n as getChatConfig } from "./config-CHQ8X251.js";
2
- import { $d as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore, oc as SYSTEM_IDENTITY_ID } from "./db-BFmyYZtJ.js";
1
+ import { R as getChatConfig } from "./context-BKF_5zzI.js";
2
+ import { $s as SYSTEM_IDENTITY_ID, af as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore } from "./db-of6e3sGt.js";
3
3
  import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
4
- import { oi as projectConversationEvents } from "./mailbox-turn-uSXhUFc9.js";
4
+ import { ai as projectConversationEvents } from "./mailbox-turn-Byrry9o1.js";
5
5
  import { n as TURN_STEP_TOPIC } from "./topic-CRYYBYp-.js";
6
- import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-CgQ7mlHt.js";
7
- import { randomUUID } from "node:crypto";
6
+ import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-C_QL_bMQ.js";
7
+ import { eq } from "drizzle-orm";
8
8
  import { localDestinationSchema } from "@sentry/junior-plugin-api";
9
+ import { randomUUID } from "node:crypto";
9
10
  import { setTimeout } from "node:timers/promises";
10
- import { eq } from "drizzle-orm";
11
11
  // src/turn-steps/group-key.ts
12
12
  /** The group key of an input that this Actor Identity sent from this Source. */
13
13
  function turnGroupKey(actorIdentityId, source) {
@@ -1,8 +1,4 @@
1
1
  // src/chat/child-agents/child-message.ts
2
- /** Mailbox metadata that stores who sent one child reply or result. */
3
- function childMessageSenderMetadata(sender) {
4
- return { sender };
5
- }
6
2
  /**
7
3
  * List the child replies and results among the ids that reached one
8
4
  * mailbox, oldest first, with the sender fields that the mailbox keeps.
@@ -16,4 +12,4 @@ function listChildMessages(inboundMessageIds, messageSenders) {
16
12
  }] : [];
17
13
  });
18
14
  }
19
- export { listChildMessages as n, childMessageSenderMetadata as t };
15
+ export { listChildMessages as t };
package/dist/cli/chat.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
2
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-AjrEV6Qe.js";
2
+ import { G as loadConfig, W as installChatConfig } from "../context-BKF_5zzI.js";
3
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DeYymwh2.js";
3
4
  import path from "node:path";
4
5
  import { createHash, randomUUID } from "node:crypto";
5
6
  import { stderr, stdin, stdout } from "node:process";
@@ -86,10 +87,19 @@ function writeStream(stream, text) {
86
87
  });
87
88
  });
88
89
  }
89
- /** Keep local chat ephemeral by default; Redis is opt-in via an explicit adapter. */
90
- function defaultStateAdapterForLocalChat() {
91
- if (process.env["JUNIOR_STATE_ADAPTER"]) return;
92
- process.env["JUNIOR_STATE_ADAPTER"] = "memory";
90
+ /**
91
+ * Install the config of a local chat run. Local chat is ephemeral by default:
92
+ * it uses the memory state adapter unless `JUNIOR_STATE_ADAPTER` is set, so
93
+ * Redis is opt-in.
94
+ */
95
+ function installLocalChatConfig(options = {}) {
96
+ installChatConfig(loadConfig({
97
+ env: process.env,
98
+ options: {
99
+ ...options,
100
+ state: { adapter: process.env["JUNIOR_STATE_ADAPTER"] ? void 0 : "memory" }
101
+ }
102
+ }));
93
103
  }
94
104
  /** Load the app plugin module so source-mode local chat matches server wiring. */
95
105
  async function loadLocalPluginSet() {
@@ -99,10 +109,10 @@ async function loadLocalPluginSet() {
99
109
  async function configureLocalChatPlugins(pluginSet) {
100
110
  const [pluginsModule, registryModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
111
  import("../plugins-D_Ru4CWc.js").then((n) => n.o),
102
- import("../db-BFmyYZtJ.js").then((n) => n.Ct),
103
- import("../catalog-runtime-DfSpJZdY.js").then((n) => n.t),
104
- import("../validation-8gjfR91V.js").then((n) => n.r),
105
- import("../db-BFmyYZtJ.js").then((n) => n.t)
112
+ import("../db-of6e3sGt.js").then((n) => n.Tt),
113
+ import("../catalog-runtime-BfdAnztW.js").then((n) => n.t),
114
+ import("../validation-BiUmWPhy.js").then((n) => n.r),
115
+ import("../db-of6e3sGt.js").then((n) => n.t)
106
116
  ]);
107
117
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
118
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,21 +162,19 @@ function localDevServerUrl() {
152
162
  }
153
163
  /** Wire the shared local-turn setup so prompt and interactive runs stay identical. */
154
164
  async function prepareLocalChatRun(io, pluginSet) {
155
- defaultStateAdapterForLocalChat();
165
+ installLocalChatConfig({ eventEmbeddings: { enabled: true } });
156
166
  await configureLocalChatPlugins(pluginSet);
157
- const { setEventEmbeddingsConfig } = await import("../db-BFmyYZtJ.js").then((n) => n.Tu);
158
- setEventEmbeddingsConfig({ enabled: true });
159
- const { runLocalAgentTurn } = await import("../runner-BstDRbD9.js");
160
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CE4soEIY.js");
161
- const { createLocalOAuthState } = await import("../oauth-relay-C36gX1gH.js").then((n) => n.t);
162
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-oSJMJOnn.js");
163
- const { bindSpawnAgent } = await import("../spawn-frczVPIr.js").then((n) => n.n);
164
- const { bindMessageAgent } = await import("../message-BNenhsmB.js").then((n) => n.n);
165
- const { runConversation } = await import("../run-conversation-DL6ru7iW.js").then((n) => n.n);
166
- const { createConversationTurnWorker } = await import("../conversation-turn-BUE_7xaN.js").then((n) => n.t);
167
- const { resumeForPersonInput } = await import("../mailbox-turn-uSXhUFc9.js").then((n) => n.q);
167
+ const { runLocalAgentTurn } = await import("../runner-99YxVN_r.js");
168
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CjnnUr4o.js");
169
+ const { createLocalOAuthState } = await import("../oauth-relay-BvHFH0fV.js").then((n) => n.t);
170
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CgoX5CTI.js");
171
+ const { bindSpawnAgent } = await import("../spawn-DuZfodPa.js").then((n) => n.n);
172
+ const { bindMessageAgent } = await import("../message-BRUuLgrY.js").then((n) => n.n);
173
+ const { runConversation } = await import("../run-conversation-Cz2ubZK-.js").then((n) => n.n);
174
+ const { createConversationTurnWorker } = await import("../conversation-turn-Bru4w_FD.js").then((n) => n.t);
175
+ const { resumeForPersonInput } = await import("../mailbox-turn-Byrry9o1.js").then((n) => n.K);
168
176
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
169
- const { processConversationWork } = await import("../worker-BqMQQNRk.js").then((n) => n.n);
177
+ const { processConversationWork } = await import("../worker-ChWYQdhm.js").then((n) => n.n);
170
178
  let agentRunner;
171
179
  const localConversationWork = createLocalConversationWork(async (message) => {
172
180
  if (!agentRunner) throw new Error("Local agent runner is not ready");
@@ -231,9 +239,9 @@ async function runPrompt(options, io, pluginSet) {
231
239
  }
232
240
  }
233
241
  async function runCorePrompt(options, io, pluginSet) {
234
- defaultStateAdapterForLocalChat();
242
+ installLocalChatConfig();
235
243
  await configureLocalChatPlugins(pluginSet);
236
- const { runCoreEnginePrompt } = await import("../chat-core-engine-aH85nEHv.js");
244
+ const { runCoreEnginePrompt } = await import("../chat-core-engine-D3Wd7f5n.js");
237
245
  const result = await runCoreEnginePrompt({
238
246
  conversationId: newRunConversationId(),
239
247
  message: options.message
package/dist/cli/check.js CHANGED
@@ -1,7 +1,7 @@
1
- import { L as mapBounded } from "../prompt-Dv7gkpD6.js";
2
- import { a as parseSkillFile } from "../skills-BCEU41zM.js";
3
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-DXq9ZLU4.js";
4
- import { X as parseInlinePluginManifest, Z as parsePluginManifest } from "../registry-iXMT5Jmh.js";
1
+ import { G as mapBounded } from "../prompt-DEkStuxG.js";
2
+ import { a as parseSkillFile } from "../skills-CleC0Hze.js";
3
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-C0qXa0FD.js";
4
+ import { X as parseInlinePluginManifest, Z as parsePluginManifest } from "../registry-Cl7Labpe.js";
5
5
  import * as z from "zod";
6
6
  import path from "node:path";
7
7
  import { mentionsTag } from "@sentry/junior-plugin-api";
package/dist/cli/main.js CHANGED
@@ -45,10 +45,10 @@ 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-CAugg87B.js")).runAdmin(argv);
48
+ return await (await import("../admin-UOHix_5P.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-CTV_jaNu.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-YDCPSByj.js")).runServiceAccount(argv);
52
52
  }
53
53
  function topLevelCommand(argv) {
54
54
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { Dt as coreRegistrations, Tt as validatePlugins, a as getDb, wt as setPlugins } from "../db-BFmyYZtJ.js";
2
- import { h as createPluginLogger } from "../prompt-Dv7gkpD6.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DfSpJZdY.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-8gjfR91V.js";
1
+ import { Dt as validatePlugins, Et as setPlugins, a as getDb, kt as coreRegistrations } from "../db-of6e3sGt.js";
2
+ import { h as createPluginLogger } from "../prompt-DEkStuxG.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BfdAnztW.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BiUmWPhy.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-D_Ru4CWc.js";
7
7
  import { Command, CommanderError } from "commander";
@@ -1,8 +1,7 @@
1
- import { n as getChatConfig } from "../config-CHQ8X251.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DfSpJZdY.js";
3
- import { n as resolve } from "../resolve-tony4ibz.js";
4
- import { t as create, u as SANDBOX_RUNTIME } from "../profile-BQ-iBDsZ.js";
5
- import { Gu as disconnectStateAdapter } from "../db-BFmyYZtJ.js";
1
+ import { R as getChatConfig, _ as disconnectStateAdapter } from "../context-BKF_5zzI.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BfdAnztW.js";
3
+ import { n as resolve } from "../resolve-DC6zBuDV.js";
4
+ import { t as create, u as SANDBOX_RUNTIME } from "../profile-iHw1uu32.js";
6
5
  // src/cli/snapshot-create.ts
7
6
  const DEFAULT_TIMEOUT_MS = 6e5;
8
7
  function progressMessage(phase) {
@@ -1,7 +1,7 @@
1
- import { n as getChatConfig } from "../config-CHQ8X251.js";
2
- import { c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-BFmyYZtJ.js";
1
+ import { R as getChatConfig } from "../context-BKF_5zzI.js";
2
+ import { c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-of6e3sGt.js";
3
3
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
4
- import { t as createPluginCatalogRuntime } from "../registry-iXMT5Jmh.js";
4
+ import { t as createPluginCatalogRuntime } from "../registry-Cl7Labpe.js";
5
5
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-D_Ru4CWc.js";
6
6
  import { t as isMissingVirtualModule } from "../virtual-module-BeKA_EII.js";
7
7
  import { basename, dirname, join, resolve } from "node:path";