@sentry/junior 0.319.0 → 0.320.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 (55) hide show
  1. package/dist/{adapter-8_S6Birm.js → adapter-DlLLoJKj.js} +1 -1
  2. package/dist/{admin-EsbUON1j.js → admin-BzRXDVfh.js} +1 -1
  3. package/dist/{agent-CtzMl32d.js → agent-DxZ7nHfD.js} +40 -50
  4. package/dist/{agent-update-delivery-pAvsbuGL.js → agent-update-delivery-CO4FU5Gg.js} +3 -3
  5. package/dist/api/schema.d.ts +2 -0
  6. package/dist/api/schema.js +1 -1
  7. package/dist/api.js +28 -23
  8. package/dist/{app-tACXxJPI.d.ts → app-CHCFIIDu.d.ts} +1 -0
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +20 -217
  11. package/dist/{channel-access-DET5hzZM.js → channel-access-BghWqlXx.js} +1 -1
  12. package/dist/{chat-core-engine-DpM3tMVi.js → chat-core-engine-BgfSLrDu.js} +31 -14
  13. package/dist/cli/chat.js +16 -16
  14. package/dist/cli/check.js +4 -4
  15. package/dist/cli/main.js +2 -2
  16. package/dist/cli/plugins.js +3 -3
  17. package/dist/cli/snapshot-create.js +4 -4
  18. package/dist/cli/upgrade.js +2 -2
  19. package/dist/{continue-in-slack-CFzDyxkH.js → continue-in-slack-DBlQP4PC.js} +3 -3
  20. package/dist/{conversation-privacy-C2vYK55O.js → conversation-privacy-qoh95v90.js} +1 -1
  21. package/dist/{create-Ta3SEIB5.js → create-jZSaDrCR.js} +2 -2
  22. package/dist/{credential-sync-DyRqDmY4.js → credential-sync-Bj9-UlNE.js} +11 -11
  23. package/dist/{db-BCaNWl9p.js → db-BacvswT0.js} +36 -23
  24. package/dist/{deployment-CfOew1Tm.js → deployment-BoJkRPDt.js} +1 -1
  25. package/dist/{engine-context-CiExoy1B.js → engine-context-Bi3Ync5t.js} +388 -12
  26. package/dist/{html-Bb2Si1bR.js → html-DW0pw5Pr.js} +4 -4
  27. package/dist/instrumentation.js +2 -2
  28. package/dist/{list-wwDcROh9.js → list-Dz3CdP3g.js} +20 -11
  29. package/dist/{logging-BRPTXAdf.js → logging-DsTnMqyi.js} +1 -1
  30. package/dist/{markers-9QoqW5ov.js → markers-C33gNYNE.js} +31 -30
  31. package/dist/nitro.d.ts +1 -1
  32. package/dist/nitro.js +2 -2
  33. package/dist/{oauth-callback-server-vhL9b-PZ.js → oauth-callback-server-C-pEhAQK.js} +2 -2
  34. package/dist/{oauth-relay-CH2v7WiB.js → oauth-relay-DIXdH-io.js} +1 -1
  35. package/dist/{profile-D9LdwmZi.js → profile-v9vA3RvH.js} +4 -4
  36. package/dist/{prompt-3TqxEOtc.js → prompt-C5CW2wKO.js} +1 -1
  37. package/dist/{reports-K-tbtEyx.js → reports-eBgrhPXS.js} +2 -2
  38. package/dist/{resolve-BBV2qf8A.js → resolve-HVXmbeCr.js} +5 -5
  39. package/dist/{result-5IdGJP4M.js → result-BPNzgeTl.js} +4 -4
  40. package/dist/{runner-BK_joPlM.js → runner-aNSDTST6.js} +6 -6
  41. package/dist/{sandbox-egress-signals-DXgWXXmm.js → sandbox-egress-signals-nzp9Ykf7.js} +1 -1
  42. package/dist/{schema-zWGG6VC1.js → schema-BlTO5M1d.js} +3 -1
  43. package/dist/{service-account-CateFyhw.js → service-account-DWIf1t6p.js} +2 -2
  44. package/dist/{skills-Ccjw8h2P.js → skills-50izzzdK.js} +4 -4
  45. package/dist/{slack-conversation-unfurl-ZC_TSpc4.js → slack-conversation-unfurl-C6jXhVYg.js} +7 -7
  46. package/dist/{storage-C9U7R5rM.js → storage-BtCxXiNt.js} +2 -2
  47. package/dist/{system-prompt-table-YBTHIFlP.js → system-prompt-table-CIR1B44Z.js} +3 -3
  48. package/dist/{users-CCRAqYb_.js → users-DOVo9sdU.js} +1 -1
  49. package/dist/{validation-BCUpJa8K.js → validation-CK0vuEHB.js} +1 -1
  50. package/dist/{version-BNm0JYj3.js → version-BuLVNlxB.js} +1 -1
  51. package/dist/version.js +1 -1
  52. package/dist/{worker-BhgpZ7_b.js → worker-C82kHU1R.js} +4 -4
  53. package/migrations/20261127150242_drop_space_members/migration.sql +9 -0
  54. package/migrations/20261127150242_drop_space_members/snapshot.json +53 -0
  55. package/package.json +6 -6
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as MemoryOptions, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-tACXxJPI.js";
1
+ import { i as MemoryOptions, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-CHCFIIDu.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-DhGXZjlu.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
4
4
  export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type MemoryOptions, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,27 +1,27 @@
1
- import { C as parseActorUserId, 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, W as installChatConfig, i as getStateAdapter, j as slackChannelIdSchema, l as fenceLock, s as MUTATION_LOCK_TTL_MS, u as withLock, v as createSlackActor } from "./adapter-8_S6Birm.js";
2
- import { $ as canActOnInboxItem, $n as sendSlackReply, $r as renderSlackObjectCard, Ap as juniorTurns, Ar as readConversationAccessFromSql, Au as EVENT_INDEX_LOCK_TTL_MS, Ba as existingConversationId, Bi as slackMention, Bn as pushConversationInboxItemsNow, Bo as takeDueTimerWatches, Bp as juniorConversations, Br as resolveConversationWorkTopic, Ci as notifyAutomationBlocked, Cl as getDashboardConversationLink, Cn as hasRunnableConversationWork, Dc as recordGoogleSignIn, Dn as pruneActiveConversation, Dp as juniorConversationEmbeddings, Dt as getRegistrations, Ep as juniorConversationEventEmbeddings, Fd as getAppContext, Fi as slackExternalRefIdSchema, Gc as searchInboxItems, Gf as touchConversationDetail, Gn as findSlackThreadOwnerId, Gu as createConversationEmbedder, Hn as runInboxItemPushTimers, Id as installAppContext, Jn as parseSlackInboxItemClick, Kf as createSlackDestination, Lu as storeConversationEventLexemes, Ma as automationVersionOf, Mu as eventIndexLockKey, O as withConversationMutationLock, Oi as openSlackModal, Ot as validatePlugins, Pd as createAppContext, Pi as slackEntitySchema, Pl as projectConversationMessages, Qt as clearExpiredConversationLease, R as replaceConversationMetrics, Sp as juniorAgentBindings, Tn as isInvalidConversationRecordError, Tp as juniorConversationEventLexemes, Tt as inboxItemVisibility, U as conversationIsActiveSql, Un as resolveSlackInboxItemCardConversationId, Ur as conversationQueueMessageSchema, Uu as isEventEmbeddingsEnabled, Vr as verifyConversationQueueMessage, Wn as syncInboxItemSlackCards, Wr as isConversationQueueMessageRejectedError, Wt as appendAndEnqueueInboundMessage, Wu as backfillConversationEmbeddings, Yn as parseSlackInboxItemFormTarget, Yr as getQueueProvider, Za as refreshAutomationLastRun, Zc as itemQuestion, Zn as parseSlackUserInputSubmission, Zs as getSlackClient, _a as scheduledRunId, _i as listPendingDispatchMailboxAppends, _t as isPluginInboxItem, a as getDb, an as getConversation, at as inboxItemAddedByAnyAutomation, bc as resolveActorIdentityId, bp as juniorInboxItems, bs as listConversationAnnotations, cc as runWithWorkspaceTeamId, ci as confirmDispatchMailboxAppend, cn as listActiveConversationIds, cs as subjectKey, dt as inboxItemReaderForUser, ei as annotationKeyDigest, fa as listScheduledAutomationsForTeam, fc as readActorIdentity, fp as juniorAutomationRuns, ft as inboxItemReaderForUserInConversation, ga as saveScheduledAutomationInLock, gc as resolveViewerUser, gi as isTerminalDispatchStatus, go as slackChannelMessageEvent, hp as juniorAutomations, i as getConversationStore, in as ensureConversationWake, io as syncAutomationAlerts, js as isPublicConversation, ju as embedConversationEvents, ki as postSlackEphemeralMessage, kl as getDashboardTaskLink, kp as juniorConversationEvents, lp as juniorQuestions, lr as sendVercelPluginTask, m as deleteMessageLinks, ma as readScheduledAutomation, ml as deleteExpiredInboxSnoozes, mo as SLACK_EVENT_NAMESPACE, n as getConversationEventStore, ni as runWithSlackInstallation, np as juniorTurnInbox, nr as getPluginApiRoutes, o as getSqlExecutor, on as getConversationWorkState, or as createVercelPluginTaskCallback, pi as getDispatchRecord, qn as buildSlackInboxItemModal, qp as juniorDestinations, ri as verifySlackSignature, rr as getPluginRoutes, sc as getWorkspaceTeamId, sl as parseAvatarUrl, ti as decodeAnnotationRef, tp as juniorTurnOutbox, tr as createPluginEventPublisher, ts as resumeConversationDelivery, tt as canAnswerInboxItem, u as isPostgresErrorCode, ui as getDispatchConversationId, ur as queueCallback, v as withConversationEventLock, va as withScheduledAutomationLock, wl as getDashboardInboxItemLink, wr as canAddConversationMessages, wt as inboxItemOwnerConversationId, xi as markDispatchFailed, yn as CONVERSATION_WORK_STALE_ENQUEUE_MS, z as conversationCostOf, zc as dismissOpenInboxItems, zn as createInboxItemShow, zr as getVercelConversationWorkQueue } from "./db-BCaNWl9p.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-BRPTXAdf.js";
4
- import { $ as slackInboundMessageId, C as verifyWorkspaceSnapshotJobMessage, Cn as recordWebConversationActivity, En as collectAttachmentUploadGarbage, F as markConversationRead, Ft as isPublicAddress, Gn as readPublicArtifact, Hn as requestAttachmentDeletion, It as publicAddressLookup, J as getProductionSlackAdapter, K as createProductionConversationWorkOptions, Kn as unpublishedArtifactHeaders, L as deliverInboxItemChange, Q as clearSlackPendingReactions, R as inboxItemChangeRecord, S as processWorkspaceSnapshotJob, Un as parseSlackThreadId, Ut as readConversationRecordFromSql, Wn as publicArtifactHeaders, Z as buildSlackInboundMessage, _t as recordSkippedConversationMessage, ar as readViewerAutomationSummary, at as enqueueAgentDispatch, b as verifyBackgroundCompactionMessage, bn as conversationTurnIdForMessage, cn as startProcessingReaction, dn as isRetryableSlackPostError, dr as effectiveTaskOutcomes, dt as readConversationEventPage, er as ViewerTaskNotFoundError, et as normalizeIncomingSlackThreadId, fn as SubscribedReplyReason, ft as readConversationEventPageAfter, ht as readConversationMessageEventSeq, i as scheduledAutomationRunAttributes, in as bindMessageAgent, kt as readObjectLinkTypes, ln as stripLeadingBotMention, lr as findAutomationSkill, mt as readConversationLastEventSeq, on as createAgentRunner, ot as failStoppedDispatch, pn as getThreadStopDecision, q as createProductionSlackWebhookServices, r as logScheduledAutomationRunSkipped, rr as readViewerAutomationExecutions, sn as bindMessageAuthorIdentityId, sr as readViewerAutomations, st as processPluginTask, t as executeAgentRun, tn as bindSpawnAgent, tt as withNormalizedThreadId, un as parseContent, ur as missingAutomationSkillReason, v as processBackgroundCompaction, vt as stopConversation, w as ingestEvent, wn as webActorFromUser, wt as readLiveAnnotations, x as createVercelCacheWarmupCallback, xn as createAndEnqueueConversation, y as vercelBackgroundCompactionQueue, yn as appendAndEnqueueWebMessage, yt as createSlackWebApiStatusSender, z as renderInboxItemMessage, zn as collectAttachmentGarbage } from "./agent-CtzMl32d.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-D9LdwmZi.js";
6
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BCUpJa8K.js";
1
+ import { C as parseActorUserId, 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, W as installChatConfig, i as getStateAdapter, j as slackChannelIdSchema, l as fenceLock, s as MUTATION_LOCK_TTL_MS, u as withLock, v as createSlackActor } from "./adapter-DlLLoJKj.js";
2
+ import { $ as canActOnInboxItem, $r as annotationKeyDigest, As as isPublicConversation, Au as embedConversationEvents, Br as verifyConversationQueueMessage, Cl as getDashboardInboxItemLink, Cr as canAddConversationMessages, Ct as inboxItemOwnerConversationId, Di as openSlackModal, Dt as validatePlugins, Ec as recordGoogleSignIn, En as pruneActiveConversation, Ep as juniorConversationEmbeddings, Et as getRegistrations, Fd as installAppContext, Gf as createSlackDestination, Hn as resolveSlackInboxItemCardConversationId, Hr as conversationQueueMessageSchema, Hu as isEventEmbeddingsEnabled, Iu as storeConversationEventLexemes, Jn as parseSlackInboxItemFormTarget, Jr as getQueueProvider, Kn as buildSlackInboxItemModal, Kp as juniorDestinations, Nd as createAppContext, Ni as slackEntitySchema, Nl as projectConversationMessages, O as withConversationMutationLock, Oi as postSlackEphemeralMessage, Ol as getDashboardTaskLink, Op as juniorConversationEvents, Pd as getAppContext, Pi as slackExternalRefIdSchema, Qr as renderSlackObjectCard, Rc as dismissOpenInboxItems, Rn as createInboxItemShow, Rr as getVercelConversationWorkQueue, Si as notifyAutomationBlocked, Sl as getDashboardConversationLink, Sn as hasRunnableConversationWork, Tp as juniorConversationEventEmbeddings, U as conversationIsActiveSql, Un as syncInboxItemSlackCards, Ur as isConversationQueueMessageRejectedError, Ut as appendAndEnqueueInboundMessage, Uu as backfillConversationEmbeddings, Vn as runInboxItemPushTimers, Wc as searchInboxItems, Wf as touchConversationDetail, Wn as findSlackThreadOwnerId, Wu as createConversationEmbedder, Xa as refreshAutomationLastRun, Xc as itemQuestion, Xn as parseSlackUserInputSubmission, Xs as getSlackClient, Zt as clearExpiredConversationLease, _a as withScheduledAutomationLock, a as getDb, an as getConversationWorkState, ar as createVercelPluginTaskCallback, at as inboxItemAddedByAnyAutomation, bi as markDispatchFailed, cp as juniorQuestions, cr as sendVercelPluginTask, da as listScheduledAutomationsForTeam, dc as readActorIdentity, dp as juniorAutomationRuns, dt as inboxItemReaderForUserInConversation, ei as decodeAnnotationRef, ep as juniorTurnOutbox, er as createPluginEventPublisher, es as resumeConversationDelivery, fi as getDispatchRecord, ga as scheduledRunId, gi as listPendingDispatchMailboxAppends, gt as isPluginInboxItem, ha as saveScheduledAutomationInLock, hc as resolveViewerUser, hi as isTerminalDispatchStatus, ho as slackChannelMessageEvent, i as getConversationStore, in as getConversation, ja as automationVersionOf, ju as eventIndexLockKey, kp as juniorTurns, kr as readConversationAccessFromSql, ku as EVENT_INDEX_LOCK_TTL_MS, li as getDispatchConversationId, lr as queueCallback, m as deleteMessageLinks, mp as juniorAutomations, n as getConversationEventStore, ni as verifySlackSignature, nr as getPluginRoutes, o as getSqlExecutor, oc as getWorkspaceTeamId, ol as parseAvatarUrl, pa as readScheduledAutomation, pl as deleteExpiredInboxSnoozes, po as SLACK_EVENT_NAMESPACE, qn as parseSlackInboxItemClick, rn as ensureConversationWake, ro as syncAutomationAlerts, sc as runWithWorkspaceTeamId, si as confirmDispatchMailboxAppend, sn as listActiveConversationIds, ss as subjectKey, ti as runWithSlackInstallation, tp as juniorTurnInbox, tr as getPluginApiRoutes, tt as canAnswerInboxItem, u as isPostgresErrorCode, ut as inboxItemReaderForUser, v as withConversationEventLock, vn as CONVERSATION_WORK_STALE_ENQUEUE_MS, wn as isInvalidConversationRecordError, wp as juniorConversationEventLexemes, wt as inboxItemVisibility, xp as juniorAgentBindings, yc as resolveActorIdentityId, yp as juniorInboxItems, ys as listConversationAnnotations, z as conversationCostOf, za as existingConversationId, zi as slackMention, zn as pushConversationInboxItemsNow, zo as takeDueTimerWatches, zp as juniorConversations, zr as resolveConversationWorkTopic } from "./db-BacvswT0.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-DsTnMqyi.js";
4
+ import { $ as slackInboundMessageId, C as processWorkspaceSnapshotJob, Cn as recordWebConversationActivity, En as collectAttachmentUploadGarbage, F as markConversationRead, Ft as isPublicAddress, Gn as readPublicArtifact, Hn as requestAttachmentDeletion, It as publicAddressLookup, J as getProductionSlackAdapter, K as createProductionConversationWorkOptions, Kn as unpublishedArtifactHeaders, L as deliverInboxItemChange, Q as clearSlackPendingReactions, R as inboxItemChangeRecord, S as createVercelCacheWarmupCallback, T as ingestEvent, Un as parseSlackThreadId, Ut as readConversationRecordFromSql, Wn as publicArtifactHeaders, Z as buildSlackInboundMessage, _t as recordSkippedConversationMessage, ar as readViewerAutomationSummary, at as enqueueAgentDispatch, b as vercelBackgroundCompactionQueue, bn as conversationTurnIdForMessage, cn as startProcessingReaction, dr as effectiveTaskOutcomes, dt as readConversationEventPage, er as ViewerTaskNotFoundError, et as normalizeIncomingSlackThreadId, fn as SubscribedReplyReason, ft as readConversationEventPageAfter, ht as readConversationMessageEventSeq, i as scheduledAutomationRunAttributes, in as bindMessageAgent, kt as readObjectLinkTypes, ln as stripLeadingBotMention, lr as findAutomationSkill, mt as readConversationLastEventSeq, on as createAgentRunner, ot as failStoppedDispatch, pn as getThreadStopDecision, q as createProductionSlackWebhookServices, r as logScheduledAutomationRunSkipped, rr as readViewerAutomationExecutions, sn as bindMessageAuthorIdentityId, sr as readViewerAutomations, st as processPluginTask, t as executeAgentRun, tn as bindSpawnAgent, tt as withNormalizedThreadId, un as parseContent, ur as missingAutomationSkillReason, vt as stopConversation, w as verifyWorkspaceSnapshotJobMessage, wn as webActorFromUser, wt as readLiveAnnotations, x as verifyBackgroundCompactionMessage, xn as createAndEnqueueConversation, y as processBackgroundCompaction, yn as appendAndEnqueueWebMessage, yt as createSlackWebApiStatusSender, z as renderInboxItemMessage, zn as collectAttachmentGarbage } from "./agent-DxZ7nHfD.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-v9vA3RvH.js";
6
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CK0vuEHB.js";
7
7
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-D_Ru4CWc.js";
8
- import { $ as reviewItemChange, B as mcpIdempotencyKeySchema, F as mcpAuthorizationSchema$1, G as readMcpPendingWork, H as mcpMessageTextSchema, I as mcpConversation, K as readMcpPendingWorkAfterSend, L as mcpConversationIdSchema, P as mcpAcceptedMessageSchema, Q as readInboxItemForUser, R as mcpConversationSchema, U as mcpMessages, V as mcpMessageSchema, W as mcpPendingMessagesSchema, 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, 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 } from "./list-wwDcROh9.js";
9
- import { I as getAuthPausedConversationTurnId, Kn as settleConversationTitleWork, Mt as renderTaskInput, Q as coerceThreadConversationState, Vn as appendConversationMessages, dn as isExperimentalFeatureEnabled, gt as parseEmail, ht as isTrustedSlackAuthor, mt as isAllowedDomain, pt as findTrustedUser, q as getLocationConfigurationService } from "./markers-9QoqW5ov.js";
8
+ import { $ as reviewItemChange, B as mcpIdempotencyKeySchema, F as mcpAuthorizationSchema$1, G as readMcpPendingWork, H as mcpMessageTextSchema, I as mcpConversation, K as readMcpPendingWorkAfterSend, L as mcpConversationIdSchema, P as mcpAcceptedMessageSchema, Q as readInboxItemForUser, R as mcpConversationSchema, U as mcpMessages, V as mcpMessageSchema, W as mcpPendingMessagesSchema, 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, 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 } from "./list-Dz3CdP3g.js";
9
+ import { Bn as appendConversationMessages, F as getAuthPausedConversationTurnId, Kn as settleConversationTitleWork, Z as coerceThreadConversationState, ft as findTrustedUser, ht as parseEmail, jt as renderTaskInput, mt as isTrustedSlackAuthor, pt as isAllowedDomain, un as isExperimentalFeatureEnabled } from "./markers-C33gNYNE.js";
10
10
  import { Bt as annotationCard, Kt as automationCardStatus, On as automationTaskSchema, Pn as getNextRunAtMs, _ as automationListQuerySchema, in as scheduledRunSchema, kn as automationTaskText, p as automationExecutionStatusSchema, pn as inboxItemQuestion, vn as buttonUserInputField } from "./types-BNHkJrOP.js";
11
- import { t as createEndStoppedChildWork } from "./result-5IdGJP4M.js";
12
- import { h as createPluginLogger } from "./prompt-3TqxEOtc.js";
13
- import { n as getAttachmentStorage } from "./storage-C9U7R5rM.js";
11
+ import { t as createEndStoppedChildWork } from "./result-BPNzgeTl.js";
12
+ import { h as createPluginLogger } from "./prompt-C5CW2wKO.js";
13
+ import { n as getAttachmentStorage } from "./storage-BtCxXiNt.js";
14
14
  import { i as getActiveSpan, u as sentry_exports } from "./sentry-CPbZjomA.js";
15
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DyRqDmY4.js";
15
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-Bj9-UlNE.js";
16
16
  import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
17
17
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
18
- 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-ZC_TSpc4.js";
19
- import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-Bb2Si1bR.js";
20
- import { s as joinPublicChannel } from "./channel-access-DET5hzZM.js";
21
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, d as JUNIOR_TURN_ENDED_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-CfOew1Tm.js";
22
- import { t as processConversationWork } from "./worker-BhgpZ7_b.js";
23
- import { a as turnStepConsumer, c as findTurn, d as readTurnEndedMessages, f as publishTurnStep, g as withSpan$1, h as countMetric, i as createGatewayModelClient, l as replyText, m as loadTurnAgentHistory, n as turnTools, p as findTurnActor, r as turnUsage, s as findStalledTurns, t as createEngineContext, u as publishTurnEnded } from "./engine-context-CiExoy1B.js";
24
- import { t as JUNIOR_VERSION } from "./version-BNm0JYj3.js";
18
+ 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-C6jXhVYg.js";
19
+ import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-DW0pw5Pr.js";
20
+ import { s as joinPublicChannel } from "./channel-access-BghWqlXx.js";
21
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, d as JUNIOR_TURN_ENDED_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-BoJkRPDt.js";
22
+ import { t as processConversationWork } from "./worker-C82kHU1R.js";
23
+ import { a as createGatewayModelClient, c as findStalledTurns, d as countMetric, f as withSpan$1, i as turnTools, l as publishTurnEnded, n as createDeploymentDelivery, o as turnStepConsumer, r as turnEndedConsumer, t as createEngineContext, u as publishTurnStep } from "./engine-context-Bi3Ync5t.js";
24
+ import { t as JUNIOR_VERSION } from "./version-BuLVNlxB.js";
25
25
  import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-DEUdD7mb.js";
26
26
  import { t as isMissingVirtualModule } from "./virtual-module-BeKA_EII.js";
27
27
  import { createRequire } from "node:module";
@@ -29,7 +29,7 @@ import { Hono } from "hono";
29
29
  import * as z from "zod";
30
30
  import { and, asc, desc, eq, gt, gte, inArray, isNotNull, isNull, lt, lte, ne, not, notExists, notInArray, or, sql } from "drizzle-orm";
31
31
  import { alias, pgTable, text } from "drizzle-orm/pg-core";
32
- import { destinationSchema, eventTriggerFiltersText, identityDispatchOptionsSchema, userSchema } from "@sentry/junior-plugin-api";
32
+ import { eventTriggerFiltersText, identityDispatchOptionsSchema, userSchema } from "@sentry/junior-plugin-api";
33
33
  import { pathToFileURL } from "node:url";
34
34
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
35
35
  import { Message, ThreadImpl } from "chat";
@@ -3269,203 +3269,6 @@ function backgroundCompactionCallback() {
3269
3269
  function createVercelBackgroundCompactionCallback() {
3270
3270
  return backgroundCompactionCallback().create();
3271
3271
  }
3272
- // src/delivery/deliver.ts
3273
- /**
3274
- * A send that failed but can work on a later try. The sender sets
3275
- * `retryAfterMs` when the provider says when to try again.
3276
- */
3277
- var DeliveryRetryableError = class extends Error {
3278
- retryAfterMs;
3279
- constructor(message, options = {}) {
3280
- super(message, { cause: options.cause });
3281
- this.name = "DeliveryRetryableError";
3282
- this.retryAfterMs = options.retryAfterMs;
3283
- }
3284
- };
3285
- const LOCK_MISS_DELAY_MS = 1e3;
3286
- const MAX_DELIVERY_ATTEMPTS = 5;
3287
- const RETRY_BASE_DELAY_MS = 1e3;
3288
- const RETRY_MAX_DELAY_MS = 6e4;
3289
- const tryLockResultSchema = z.object({ rows: z.tuple([z.object({ locked: z.boolean() })]) });
3290
- /**
3291
- * Sends the Conversation's pending outbox rows in event order, each to the
3292
- * Destination stored on its row. To try again later, it sends the message
3293
- * that the Turn ended again, with a delay.
3294
- */
3295
- async function deliverTurn({ executor, queue }, message, delivery) {
3296
- while (true) {
3297
- const next = await executor.transaction(() => sendNextRow({ executor }, message.conversationId, delivery));
3298
- if (next.kind === "idle") return;
3299
- if (next.kind === "later") {
3300
- await publishTurnEnded({ queue }, message, { delayMs: next.delayMs });
3301
- return;
3302
- }
3303
- }
3304
- }
3305
- /**
3306
- * Sends the Conversation's first pending row, if this transaction gets the
3307
- * Conversation's lock and the row's Turn has ended. A retryable failure
3308
- * leaves the row pending, so the rows after it wait.
3309
- */
3310
- async function sendNextRow({ executor }, conversationId, delivery) {
3311
- const db = executor.db();
3312
- if (!tryLockResultSchema.parse(await db.execute(sql`select pg_try_advisory_xact_lock(hashtext(${`junior:delivery:${conversationId}`})) as locked`)).rows[0].locked) return {
3313
- kind: "later",
3314
- delayMs: LOCK_MISS_DELAY_MS
3315
- };
3316
- const [row] = await db.select({
3317
- id: juniorTurnOutbox.id,
3318
- eventSeq: juniorTurnOutbox.eventSeq,
3319
- destination: juniorTurnOutbox.destination,
3320
- attempts: juniorTurnOutbox.attempts,
3321
- turnState: juniorTurns.state
3322
- }).from(juniorTurnOutbox).innerJoin(juniorTurns, eq(juniorTurns.id, juniorTurnOutbox.turnId)).where(and(eq(juniorTurnOutbox.conversationId, conversationId), eq(juniorTurnOutbox.state, "pending"))).orderBy(asc(juniorTurnOutbox.eventSeq)).limit(1);
3323
- if (!row || row.turnState === "queued" || row.turnState === "running") return { kind: "idle" };
3324
- const markFailed = async (error) => {
3325
- await db.update(juniorTurnOutbox).set({
3326
- state: "failed",
3327
- error,
3328
- updatedAt: /* @__PURE__ */ new Date()
3329
- }).where(eq(juniorTurnOutbox.id, row.id));
3330
- return { kind: "settled" };
3331
- };
3332
- const parsed = destinationSchema.safeParse(row.destination);
3333
- if (!parsed.success) {
3334
- logException(parsed.error, "turn.delivery.failed", { "gen_ai.conversation.id": conversationId });
3335
- return markFailed("The Destination is not valid");
3336
- }
3337
- const destination = parsed.data;
3338
- const [event] = await db.select().from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, conversationId), eq(juniorConversationEvents.seq, row.eventSeq)));
3339
- const text = event ? replyText(event) : void 0;
3340
- if (!text) return markFailed("The event is not a reply");
3341
- try {
3342
- const result = await delivery.send({
3343
- conversationId,
3344
- destination,
3345
- text
3346
- });
3347
- const now = /* @__PURE__ */ new Date();
3348
- await db.update(juniorTurnOutbox).set({
3349
- state: "sent",
3350
- sentAt: now,
3351
- updatedAt: now,
3352
- providerMessageId: result.providerMessageId ?? null
3353
- }).where(eq(juniorTurnOutbox.id, row.id));
3354
- return { kind: "settled" };
3355
- } catch (error) {
3356
- const attempts = row.attempts + 1;
3357
- if (error instanceof DeliveryRetryableError && attempts < MAX_DELIVERY_ATTEMPTS) {
3358
- await db.update(juniorTurnOutbox).set({
3359
- attempts,
3360
- updatedAt: /* @__PURE__ */ new Date()
3361
- }).where(eq(juniorTurnOutbox.id, row.id));
3362
- return {
3363
- kind: "later",
3364
- delayMs: retryDelayMs(error, attempts)
3365
- };
3366
- }
3367
- logException(error, "turn.delivery.failed", { "gen_ai.conversation.id": conversationId });
3368
- await db.update(juniorTurnOutbox).set({
3369
- state: "failed",
3370
- attempts,
3371
- error: error instanceof Error ? error.message : String(error),
3372
- updatedAt: /* @__PURE__ */ new Date()
3373
- }).where(eq(juniorTurnOutbox.id, row.id));
3374
- return { kind: "settled" };
3375
- }
3376
- }
3377
- /**
3378
- * The wait before the next try of a retryable send. The cap keeps a row that
3379
- * waits for its retry well inside the sweep's stale window.
3380
- */
3381
- function retryDelayMs(error, attempts) {
3382
- return Math.min(error.retryAfterMs ?? RETRY_BASE_DELAY_MS * 2 ** (attempts - 1), RETRY_MAX_DELAY_MS);
3383
- }
3384
- // src/delivery/slack.ts
3385
- /**
3386
- * Creates the sender of replies to Slack Destinations. A Slack failure that a
3387
- * later try can fix throws `DeliveryRetryableError`.
3388
- */
3389
- function createSlackSender(args) {
3390
- return async (reply) => {
3391
- const { channelId, teamId, threadTs } = reply.destination;
3392
- let messageIds;
3393
- try {
3394
- messageIds = await runWithSlackInstallation({
3395
- adapter: args.getSlackAdapter(),
3396
- installation: { teamId },
3397
- task: async () => sendSlackReply({
3398
- channelId,
3399
- threadTs,
3400
- conversationId: reply.conversationId,
3401
- formatting: {
3402
- configuration: await getLocationConfigurationService({
3403
- platform: "slack",
3404
- teamId,
3405
- channelId
3406
- }).resolveValues(),
3407
- teamId
3408
- },
3409
- text: reply.text
3410
- })
3411
- });
3412
- } catch (error) {
3413
- if (isRetryableSlackPostError(error)) throw new DeliveryRetryableError("Slack did not take the reply", { cause: error });
3414
- throw error;
3415
- }
3416
- const providerMessageId = messageIds.at(-1);
3417
- return providerMessageId ? { providerMessageId } : {};
3418
- };
3419
- }
3420
- // src/turn-steps/metrics.ts
3421
- /**
3422
- * Writes the metrics of an ended Turn. A rerun replaces the same rows, so a
3423
- * Turn counts once however often its Turn-ended message arrives. A Turn that
3424
- * never ran or has not ended writes nothing.
3425
- */
3426
- async function recordTurnMetrics(ctx, message) {
3427
- const turn = await findTurn(ctx, message.turnId);
3428
- if (!turn?.startedAt || !turn.endedAt) return;
3429
- const [history, actorIdentityId] = await Promise.all([loadTurnAgentHistory(ctx, message.turnId), findTurnActor(ctx, message.turnId)]);
3430
- const usage = await turnUsage(ctx, message.turnId, history);
3431
- const { startedAt, endedAt } = turn;
3432
- await withConversationMutationLock(ctx.executor, message.conversationId, () => replaceConversationMetrics(ctx.executor, {
3433
- actorIdentityId,
3434
- conversationId: message.conversationId,
3435
- runId: message.turnId,
3436
- occurredAtMs: startedAt.getTime(),
3437
- updatedAtMs: endedAt.getTime(),
3438
- durationMs: endedAt.getTime() - startedAt.getTime(),
3439
- usage
3440
- }));
3441
- }
3442
- // src/turn-steps/turn-ended.ts
3443
- /**
3444
- * Creates the Delivery of this deployment. It sends replies to Slack
3445
- * Destinations. Other platforms have no sender yet, so their replies fail.
3446
- */
3447
- function createDeploymentDelivery(args) {
3448
- const sendToSlack = createSlackSender(args);
3449
- return { send: async (reply) => {
3450
- const { destination } = reply;
3451
- if (destination.platform === "slack") return sendToSlack({
3452
- ...reply,
3453
- destination
3454
- });
3455
- throw new Error(`No sender for ${destination.platform} Destinations`);
3456
- } };
3457
- }
3458
- /**
3459
- * The queue consumer of the messages that a Turn ended. It records the Turn's
3460
- * metrics, then sends its replies, so a send that waits does not hold back
3461
- * the spend. The host mounts it on `engineCtx.queue`.
3462
- */
3463
- function turnEndedConsumer(engineCtx, delivery) {
3464
- return readTurnEndedMessages(engineCtx, async (message) => {
3465
- await recordTurnMetrics(engineCtx, message);
3466
- await deliverTurn(engineCtx, message, delivery);
3467
- });
3468
- }
3469
3272
  // src/core/turn/sweep.ts
3470
3273
  const STALE_MS$1 = 3e5;
3471
3274
  const BATCH$1 = 100;
@@ -1,4 +1,4 @@
1
- import { Zs as getSlackClient, ac as withSlackRetries, i as getConversationStore, qs as SlackActionError } from "./db-BCaNWl9p.js";
1
+ import { Ks as SlackActionError, Xs as getSlackClient, i as getConversationStore, ic as withSlackRetries } from "./db-BacvswT0.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,9 +1,9 @@
1
- import { R as getChatConfig } from "./adapter-8_S6Birm.js";
2
- import { Ap as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore, yc as SYSTEM_IDENTITY_ID } from "./db-BCaNWl9p.js";
1
+ import { R as getChatConfig } from "./adapter-DlLLoJKj.js";
2
+ import { d as createSqlConversationEventStore, i as getConversationStore, kp as juniorTurns, vc as SYSTEM_IDENTITY_ID } from "./db-BacvswT0.js";
3
3
  import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
4
- import { fi as projectConversationEvents } from "./markers-9QoqW5ov.js";
5
- import { n as TURN_STEP_TOPIC } from "./topic-B2EWKKBT.js";
6
- import { a as turnStepConsumer, i as createGatewayModelClient, n as turnTools, o as scheduleInput, t as createEngineContext } from "./engine-context-CiExoy1B.js";
4
+ import { mi as projectConversationEvents } from "./markers-C33gNYNE.js";
5
+ import { n as TURN_STEP_TOPIC, t as TURN_ENDED_TOPIC } from "./topic-B2EWKKBT.js";
6
+ import { a as createGatewayModelClient, i as turnTools, o as turnStepConsumer, r as turnEndedConsumer, s as scheduleInput, t as createEngineContext } from "./engine-context-Bi3Ync5t.js";
7
7
  import { eq } from "drizzle-orm";
8
8
  import { localDestinationSchema } from "@sentry/junior-plugin-api";
9
9
  import { randomUUID } from "node:crypto";
@@ -17,11 +17,11 @@ function turnGroupKey(actorIdentityId, source) {
17
17
  /**
18
18
  * `junior chat --engine core -p`: one message through the core Turn engine.
19
19
  *
20
- * The CLI is the Source. It schedules the message as an input, runs a local
21
- * Vercel Queues server that pushes each Turn step message to the Turn step
22
- * consumer in this process, and reads the reply from the stored history when
23
- * the Turn ends. The engine has no Delivery yet, so
24
- * the history is the only place that has the reply.
20
+ * The CLI is the Source. It runs a local Vercel Queues server that pushes
21
+ * each Turn step message and Turn-ended message to their consumers in this
22
+ * process, and reads the reply from the stored history when the Turn ends.
23
+ * The Turn has no Destination, so the history is the only place that has
24
+ * the reply.
25
25
  */
26
26
  const LOCAL_ACTOR = {
27
27
  fullName: "Local CLI",
@@ -31,20 +31,24 @@ const LOCAL_ACTOR = {
31
31
  };
32
32
  const TURN_POLL_INTERVAL_MS = 250;
33
33
  const TURN_STEP_CALLBACK_URL = `http://cli.localhost/${TURN_STEP_TOPIC}`;
34
+ const TURN_ENDED_CALLBACK_URL = `http://cli.localhost/${TURN_ENDED_TOPIC}`;
35
+ const NO_DELIVERY = { send: async () => {
36
+ throw new Error("The CLI has no Destination to send a reply to");
37
+ } };
34
38
  const TURN_WAIT_TIMEOUT_MS = 6e5;
35
39
  const ENDED_STATES = /* @__PURE__ */ new Set([
36
40
  "completed",
37
41
  "failed",
38
42
  "cancelled"
39
43
  ]);
40
- async function waitForTurnEnd({ executor }, turnId) {
44
+ async function waitForTurnEnd({ executor }, turnId, endHandled) {
41
45
  const deadline = Date.now() + TURN_WAIT_TIMEOUT_MS;
42
46
  while (Date.now() < deadline) {
43
47
  const [turn] = await executor.db().select({
44
48
  state: juniorTurns.state,
45
49
  endReason: juniorTurns.endReason
46
50
  }).from(juniorTurns).where(eq(juniorTurns.id, turnId));
47
- if (turn && ENDED_STATES.has(turn.state)) return turn;
51
+ if (turn && ENDED_STATES.has(turn.state) && endHandled()) return turn;
48
52
  await setTimeout(TURN_POLL_INTERVAL_MS);
49
53
  }
50
54
  throw new Error(`Turn ${turnId} did not end within ${TURN_WAIT_TIMEOUT_MS} ms`);
@@ -68,13 +72,26 @@ async function runCoreEnginePrompt(args) {
68
72
  bot: config.bot,
69
73
  tools: turnTools
70
74
  }));
75
+ let endHandled = false;
76
+ const turnEnds = turnEndedConsumer(engineCtx, NO_DELIVERY);
77
+ const turnEndedCallback = engineCtx.queue.createCallback({
78
+ ...turnEnds,
79
+ handler: async (payload, metadata) => {
80
+ await turnEnds.handler(payload, metadata);
81
+ endHandled = true;
82
+ }
83
+ });
71
84
  const server = await startLocalVercelQueueServer({
72
85
  consumers: [{
73
86
  consumerGroup: "local",
74
87
  topic: TURN_STEP_TOPIC,
75
88
  url: TURN_STEP_CALLBACK_URL
89
+ }, {
90
+ consumerGroup: "local",
91
+ topic: TURN_ENDED_TOPIC,
92
+ url: TURN_ENDED_CALLBACK_URL
76
93
  }],
77
- fetch: async (request) => request.url === TURN_STEP_CALLBACK_URL ? turnStepCallback(request) : new Response(null, { status: 404 }),
94
+ fetch: async (request) => request.url === TURN_STEP_CALLBACK_URL ? turnStepCallback(request) : request.url === TURN_ENDED_CALLBACK_URL ? turnEndedCallback(request) : new Response(null, { status: 404 }),
78
95
  port
79
96
  });
80
97
  try {
@@ -108,7 +125,7 @@ async function runCoreEnginePrompt(args) {
108
125
  destination: null,
109
126
  delivery: "defer"
110
127
  });
111
- const turn = await waitForTurnEnd(engineCtx, turnId);
128
+ const turn = await waitForTurnEnd(engineCtx, turnId, () => endHandled);
112
129
  if (turn.state !== "completed") return {
113
130
  outcome: turn.state === "cancelled" ? "cancelled" : "failed",
114
131
  reason: turn.endReason ?? turn.state
package/dist/cli/chat.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
2
- import { G as loadConfig, W as installChatConfig } from "../adapter-8_S6Birm.js";
3
- import { on as createAgentRunner, t as executeAgentRun } from "../agent-CtzMl32d.js";
2
+ import { G as loadConfig, W as installChatConfig } from "../adapter-DlLLoJKj.js";
3
+ import { on as createAgentRunner, t as executeAgentRun } from "../agent-DxZ7nHfD.js";
4
4
  import path from "node:path";
5
5
  import { createHash, randomUUID } from "node:crypto";
6
6
  import { stderr, stdin, stdout } from "node:process";
@@ -109,9 +109,9 @@ async function loadLocalPluginSet() {
109
109
  async function configureLocalChatPlugins(pluginSet) {
110
110
  const [pluginsModule, appContextModule, validationModule, databaseModule] = await Promise.all([
111
111
  import("../plugins-D_Ru4CWc.js").then((n) => n.o),
112
- import("../db-BCaNWl9p.js").then((n) => n.Nd),
113
- import("../validation-BCUpJa8K.js").then((n) => n.r),
114
- import("../db-BCaNWl9p.js").then((n) => n.t)
112
+ import("../db-BacvswT0.js").then((n) => n.Md),
113
+ import("../validation-CK0vuEHB.js").then((n) => n.r),
114
+ import("../db-BacvswT0.js").then((n) => n.t)
115
115
  ]);
116
116
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
117
117
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -164,17 +164,17 @@ function localDevServerUrl() {
164
164
  async function prepareLocalChatRun(io, pluginSet) {
165
165
  installLocalChatConfig({ eventEmbeddings: { enabled: true } });
166
166
  await configureLocalChatPlugins(pluginSet);
167
- const { runLocalAgentTurn } = await import("../runner-BK_joPlM.js");
168
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-vhL9b-PZ.js");
169
- const { createLocalOAuthState } = await import("../oauth-relay-CH2v7WiB.js").then((n) => n.t);
170
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DXgWXXmm.js");
171
- const { bindSpawnAgent } = await import("../agent-CtzMl32d.js").then((n) => n.nn);
172
- const { bindMessageAgent } = await import("../agent-CtzMl32d.js").then((n) => n.an);
173
- const { runConversation } = await import("../agent-CtzMl32d.js").then((n) => n.Y);
174
- const { createConversationTurnWorker } = await import("../agent-CtzMl32d.js").then((n) => n.X);
175
- const { resumeForPersonInput } = await import("../markers-9QoqW5ov.js").then((n) => n.N);
167
+ const { runLocalAgentTurn } = await import("../runner-aNSDTST6.js");
168
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-C-pEhAQK.js");
169
+ const { createLocalOAuthState } = await import("../oauth-relay-DIXdH-io.js").then((n) => n.t);
170
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-nzp9Ykf7.js");
171
+ const { bindSpawnAgent } = await import("../agent-DxZ7nHfD.js").then((n) => n.nn);
172
+ const { bindMessageAgent } = await import("../agent-DxZ7nHfD.js").then((n) => n.an);
173
+ const { runConversation } = await import("../agent-DxZ7nHfD.js").then((n) => n.Y);
174
+ const { createConversationTurnWorker } = await import("../agent-DxZ7nHfD.js").then((n) => n.X);
175
+ const { resumeForPersonInput } = await import("../markers-C33gNYNE.js").then((n) => n.M);
176
176
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
177
- const { processConversationWork } = await import("../worker-BhgpZ7_b.js").then((n) => n.n);
177
+ const { processConversationWork } = await import("../worker-C82kHU1R.js").then((n) => n.n);
178
178
  let agentRunner;
179
179
  const localConversationWork = createLocalConversationWork(async (message) => {
180
180
  if (!agentRunner) throw new Error("Local agent runner is not ready");
@@ -241,7 +241,7 @@ async function runPrompt(options, io, pluginSet) {
241
241
  async function runCorePrompt(options, io, pluginSet) {
242
242
  installLocalChatConfig();
243
243
  await configureLocalChatPlugins(pluginSet);
244
- const { runCoreEnginePrompt } = await import("../chat-core-engine-DpM3tMVi.js");
244
+ const { runCoreEnginePrompt } = await import("../chat-core-engine-BgfSLrDu.js");
245
245
  const result = await runCoreEnginePrompt({
246
246
  conversationId: newRunConversationId(),
247
247
  message: options.message
package/dist/cli/check.js CHANGED
@@ -1,7 +1,7 @@
1
- import { G as mapBounded } from "../prompt-3TqxEOtc.js";
2
- import { a as parseSkillFile } from "../skills-Ccjw8h2P.js";
3
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-CfOew1Tm.js";
4
- import { Mf as parseInlinePluginManifest, Nf as parsePluginManifest } from "../db-BCaNWl9p.js";
1
+ import { G as mapBounded } from "../prompt-C5CW2wKO.js";
2
+ import { a as parseSkillFile } from "../skills-50izzzdK.js";
3
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-BoJkRPDt.js";
4
+ import { Mf as parsePluginManifest, jf as parseInlinePluginManifest } from "../db-BacvswT0.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-EsbUON1j.js")).runAdmin(argv);
48
+ return await (await import("../admin-BzRXDVfh.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-CateFyhw.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-DWIf1t6p.js")).runServiceAccount(argv);
52
52
  }
53
53
  function topLevelCommand(argv) {
54
54
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,6 +1,6 @@
1
- import { At as coreRegistrations, Id as installAppContext, Pd as createAppContext, a as getDb } from "../db-BCaNWl9p.js";
2
- import { h as createPluginLogger } from "../prompt-3TqxEOtc.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BCUpJa8K.js";
1
+ import { Fd as installAppContext, Nd as createAppContext, a as getDb, kt as coreRegistrations } from "../db-BacvswT0.js";
2
+ import { h as createPluginLogger } from "../prompt-C5CW2wKO.js";
3
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CK0vuEHB.js";
4
4
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-D_Ru4CWc.js";
6
6
  import { Command, CommanderError } from "commander";
@@ -1,7 +1,7 @@
1
- import { R as getChatConfig, n as disconnectStateAdapter } from "../adapter-8_S6Birm.js";
2
- import { Fd as getAppContext } from "../db-BCaNWl9p.js";
3
- import { n as resolve } from "../resolve-BBV2qf8A.js";
4
- import { t as create, u as SANDBOX_RUNTIME } from "../profile-D9LdwmZi.js";
1
+ import { R as getChatConfig, n as disconnectStateAdapter } from "../adapter-DlLLoJKj.js";
2
+ import { Pd as getAppContext } from "../db-BacvswT0.js";
3
+ import { n as resolve } from "../resolve-HVXmbeCr.js";
4
+ import { t as create, u as SANDBOX_RUNTIME } from "../profile-v9vA3RvH.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
7
7
  function progressMessage(phase) {
@@ -1,5 +1,5 @@
1
- import { R as getChatConfig } from "../adapter-8_S6Birm.js";
2
- import { Ld as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-BCaNWl9p.js";
1
+ import { R as getChatConfig } from "../adapter-DlLLoJKj.js";
2
+ import { Id as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-BacvswT0.js";
3
3
  import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-D_Ru4CWc.js";
5
5
  import { t as isMissingVirtualModule } from "../virtual-module-BeKA_EII.js";
@@ -1,6 +1,6 @@
1
- import { A as setFirstConversationLocation, Ai as postSlackMessage, Cl as getDashboardConversationLink, Ei as getSlackMessagePermalink, En as moveIdleConversationDestination, Li as escapeSlackMrkdwnText, N as claimProviderConversation, O as withConversationMutationLock, P as getConversationIdByProviderConversation, Ri as formatSlackLink, Ti as deleteSlackMessage, a as getDb, i as getConversationStore, o as getSqlExecutor, qp as juniorDestinations } from "./db-BCaNWl9p.js";
2
- import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-8_S6Birm.js";
3
- import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-DET5hzZM.js";
1
+ import { A as setFirstConversationLocation, Ii as escapeSlackMrkdwnText, Kp as juniorDestinations, Li as formatSlackLink, N as claimProviderConversation, O as withConversationMutationLock, P as getConversationIdByProviderConversation, Sl as getDashboardConversationLink, Ti as getSlackMessagePermalink, Tn as moveIdleConversationDestination, a as getDb, i as getConversationStore, ki as postSlackMessage, o as getSqlExecutor, wi as deleteSlackMessage } from "./db-BacvswT0.js";
2
+ import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-DlLLoJKj.js";
3
+ import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-BghWqlXx.js";
4
4
  import { and, eq } from "drizzle-orm";
5
5
  // src/chat/slack/continue-in-slack.ts
6
6
  /** Refusal for a move that cannot wait for the active Run. */
@@ -1,4 +1,4 @@
1
- import { m as logWarn } from "./logging-BRPTXAdf.js";
1
+ import { m as logWarn } from "./logging-DsTnMqyi.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
4
4
  // src/chat/conversation-privacy.ts
@@ -1,5 +1,5 @@
1
- import { Bp as juniorConversations, Ft as getAgentBinding, Sn as hasConversationStop, Sp as juniorAgentBindings, Wf as nextDetailVersion, i as getConversationStore, in as ensureConversationWake, o as getSqlExecutor, on as getConversationWorkState, zt as spawnChildAgentInputSchema } from "./db-BCaNWl9p.js";
2
- import { A as getConversationStoppedAtMs, E as getSpawnedChildConversationId, Ft as addConversationNote, Nr as loadTurnStart, b as agentConfigSchema, f as readChildConversationSender, m as buildParentMessage, n as recordSubagentStartedMarker, o as listOpenChildAgents, p as appendParentMessage, w as getChildAgentLockName, x as readAgentConfig } from "./markers-9QoqW5ov.js";
1
+ import { Pt as getAgentBinding, Rt as spawnChildAgentInputSchema, Uf as nextDetailVersion, an as getConversationWorkState, i as getConversationStore, o as getSqlExecutor, rn as ensureConversationWake, xn as hasConversationStop, xp as juniorAgentBindings, zp as juniorConversations } from "./db-BacvswT0.js";
2
+ import { C as getChildAgentLockName, Nr as loadTurnStart, Pt as addConversationNote, T as getSpawnedChildConversationId, b as readAgentConfig, f as readChildConversationSender, k as getConversationStoppedAtMs, m as buildParentMessage, n as recordSubagentStartedMarker, o as listOpenChildAgents, p as appendParentMessage, y as agentConfigSchema } from "./markers-C33gNYNE.js";
3
3
  import { eq } from "drizzle-orm";
4
4
  import { randomUUID } from "node:crypto";
5
5
  // src/chat/agent/types.ts
@@ -1,15 +1,15 @@
1
1
  import { l as homeDir } from "./topics-DxuKurCX.js";
2
- import { L as botConfig, R as getChatConfig, c as acquireActiveLock, i as getStateAdapter, k as parseSlackUserId, z as getRuntimeMetadata } from "./adapter-8_S6Birm.js";
3
- import { Ai as postSlackMessage, Ec as findUserByVerifiedEmails, Fd as getAppContext, Jd as buildOAuthTokenRequest, Oc as upsertLinkedIdentity, Xd as hasRequiredOAuthScope, Yd as parseOAuthTokenResponse, Zs as getSlackClient, af as getMcpAuthSession, bc as resolveActorIdentityId, df as putMcpStoredOAuthCredentials, o as getSqlExecutor, pc as readIdentityById, sf as getMcpStoredOAuthCredentials, tf as deleteMcpAuthSession, wf as getMcpProviderErrorAttributes } from "./db-BCaNWl9p.js";
4
- import { O as isNativeIdentityProvider, f as logException, g as runBestEffort, m as logWarn } from "./logging-BRPTXAdf.js";
5
- import { G as mapBounded } from "./prompt-3TqxEOtc.js";
6
- import { Nn as recordAuthenticationLinked, Or as getTurnRecord, Pn as recordAuthorizationCompleted, Q as coerceThreadConversationState, Y as getPersistedThreadState, et as deleteWebAuthorization, fr as authorizationId, li as formatProviderLabel, ui as parseOAuthStatePayload, yr as getConversationPendingAuth } from "./markers-9QoqW5ov.js";
7
- import { Zt as finalizeMcpAuthorization, nt as wakeAuthorizedTurn, rt as wakePausedTurn } from "./agent-CtzMl32d.js";
8
- import { t as discoverSkills } from "./skills-Ccjw8h2P.js";
9
- import { A as createUserTokenStore, I as resolvePluginOAuthAccount } from "./profile-D9LdwmZi.js";
10
- import { i as lookupSlackUserProfile } from "./users-CCRAqYb_.js";
11
- import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-Bb2Si1bR.js";
12
- import { n as relayLocalOAuthCallback } from "./oauth-relay-CH2v7WiB.js";
2
+ import { L as botConfig, R as getChatConfig, c as acquireActiveLock, i as getStateAdapter, k as parseSlackUserId, z as getRuntimeMetadata } from "./adapter-DlLLoJKj.js";
3
+ import { Cf as getMcpProviderErrorAttributes, Dc as upsertLinkedIdentity, Jd as parseOAuthTokenResponse, Pd as getAppContext, Tc as findUserByVerifiedEmails, Xs as getSlackClient, Yd as hasRequiredOAuthScope, ef as deleteMcpAuthSession, fc as readIdentityById, if as getMcpAuthSession, ki as postSlackMessage, o as getSqlExecutor, of as getMcpStoredOAuthCredentials, qd as buildOAuthTokenRequest, uf as putMcpStoredOAuthCredentials, yc as resolveActorIdentityId } from "./db-BacvswT0.js";
4
+ import { O as isNativeIdentityProvider, f as logException, g as runBestEffort, m as logWarn } from "./logging-DsTnMqyi.js";
5
+ import { G as mapBounded } from "./prompt-C5CW2wKO.js";
6
+ import { $ as deleteWebAuthorization, J as getPersistedThreadState, Mn as recordAuthenticationLinked, Nn as recordAuthorizationCompleted, Or as getTurnRecord, Z as coerceThreadConversationState, di as formatProviderLabel, fi as parseOAuthStatePayload, fr as authorizationId, yr as getConversationPendingAuth } from "./markers-C33gNYNE.js";
7
+ import { Zt as finalizeMcpAuthorization, nt as wakeAuthorizedTurn, rt as wakePausedTurn } from "./agent-DxZ7nHfD.js";
8
+ import { t as discoverSkills } from "./skills-50izzzdK.js";
9
+ import { A as createUserTokenStore, I as resolvePluginOAuthAccount } from "./profile-v9vA3RvH.js";
10
+ import { i as lookupSlackUserProfile } from "./users-DOVo9sdU.js";
11
+ import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-DW0pw5Pr.js";
12
+ import { n as relayLocalOAuthCallback } from "./oauth-relay-DIXdH-io.js";
13
13
  import * as z from "zod";
14
14
  import path from "node:path";
15
15
  import { pluginStoredTokensSchema } from "@sentry/junior-plugin-api";