@sentry/junior 0.321.0 → 0.322.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 (65) hide show
  1. package/dist/{adapter-BkDQYdg6.js → adapter-CKtEUuWD.js} +23 -2
  2. package/dist/{admin-XS3G9BOj.js → admin-BGOiUGwR.js} +1 -1
  3. package/dist/{agent-CL9ZkOgx.js → agent-OUkEw6Bv.js} +272 -1647
  4. package/dist/{agent-status-Bq_AIpyp.js → agent-status-C_HHxO_d.js} +1 -10
  5. package/dist/{agent-update-delivery-t0bXEgPs.js → agent-update-delivery-H6mnPI4q.js} +4 -4
  6. package/dist/api/schema.d.ts +98 -6
  7. package/dist/api/schema.js +6 -6
  8. package/dist/api.js +81 -36
  9. package/dist/{app-CwFRvmEH.d.ts → app-BK_vhZIq.d.ts} +1 -1
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +85 -48
  12. package/dist/{change-record-CRuG9Mu3.d.ts → change-record-DdrJxahk.d.ts} +26 -10
  13. package/dist/{channel-access-BUHB0saC.js → channel-access-DRhVJIuQ.js} +1 -1
  14. package/dist/{chat-core-engine-DuBaPbqK.js → chat-core-engine-El308gYr.js} +5 -10
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +4 -4
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +3 -3
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.js +2 -2
  21. package/dist/{continue-in-slack-D9naZmqM.js → continue-in-slack-DYl631oM.js} +3 -3
  22. package/dist/{conversation-feed-B1_1NJc8.js → conversation-feed-BUaMmSLi.js} +1 -1
  23. package/dist/{conversation-privacy-C0mixZKx.js → conversation-privacy-DR_j5Tqf.js} +1 -1
  24. package/dist/{create-CLV0M1vw.js → create-ZkI-_JAs.js} +2 -2
  25. package/dist/{credential-sync-DL9r-ry5.js → credential-sync-Bo6_FtCI.js} +12 -12
  26. package/dist/{db-CbURDbaB.js → db-RDpWIeRK.js} +1733 -213
  27. package/dist/{deployment-D9uPRDMD.js → deployment-CeKaP0ZJ.js} +1 -1
  28. package/dist/{html-l4hKICAL.js → html-BMv4fAPu.js} +5 -5
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{list-cGaO9_Hf.js → list-CuLf7Ob2.js} +38 -35
  31. package/dist/{logging-CqgOoICc.js → logging-BQsfrLHl.js} +1 -1
  32. package/dist/{markers-BtUv4-oc.js → markers-Bh0vqJ5k.js} +3178 -1748
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -4
  35. package/dist/{oauth-callback-server-C3GxhsuB.js → oauth-callback-server-BxuN0Jqz.js} +2 -2
  36. package/dist/{oauth-relay-BGm6sLCB.js → oauth-relay-vyG2gOwY.js} +1 -1
  37. package/dist/{profile-bLo0h7Le.js → profile-DiAB4QfT.js} +31 -6
  38. package/dist/{prompt-CX29OGO9.js → prompt-5PDkRQ1K.js} +2 -1
  39. package/dist/{reports-DeDCCu_H.js → reports-CbqB7unq.js} +2 -2
  40. package/dist/{resolve-D9RKNH3v.js → resolve-C7e0pwuP.js} +5 -5
  41. package/dist/{result-BFBwK1M2.js → result-D_D-2Adp.js} +5 -5
  42. package/dist/{runner-DNdoVQg8.js → runner-CCVTdp0x.js} +7 -7
  43. package/dist/{sandbox-egress-signals-BBcCiEhm.js → sandbox-egress-signals-D4OKOFgy.js} +1 -1
  44. package/dist/{schema-RzsplzdI.js → schema-CmPO8BfI.js} +50 -12
  45. package/dist/{service-account-B7E7OIFP.js → service-account-CeWsFrBi.js} +2 -2
  46. package/dist/{skills-DMJsS5e4.js → skills-DfbOjWxl.js} +5 -5
  47. package/dist/{slack-conversation-unfurl-EWYTnBZI.js → slack-conversation-unfurl-BxF0Yb3-.js} +10 -9
  48. package/dist/{system-prompt-table-C886lsT9.js → system-prompt-table-DySHMtu0.js} +15 -15
  49. package/dist/{topics-DxuKurCX.js → topic-ChZe9WPj.js} +6 -1
  50. package/dist/{engine-context-BP0h6u4m.js → turn-ended-DQ10G3in.js} +11 -845
  51. package/dist/{types-CGgQ3-Bb.js → types-BWAgOJtR.js} +95 -70
  52. package/dist/{user-customization-CvfuY9Eo.js → user-customization-DNzu_r1x.js} +10 -1
  53. package/dist/{users-DBrcQl47.js → users-BmZlg_ci.js} +13 -7
  54. package/dist/{validation-CofUHWqz.js → validation-BU4tXvH3.js} +1 -1
  55. package/dist/{version-D_vbXyNw.js → version-D9yLYOBu.js} +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/{worker-buhFcpl9.js → worker-C7EDSL3d.js} +4 -4
  58. package/migrations/20261127184420_question_answerer/migration.sql +36 -0
  59. package/migrations/20261127184420_question_answerer/snapshot.json +108 -0
  60. package/migrations/20261127224730_inbox_item_close_action/migration.sql +1 -0
  61. package/migrations/20261127224730_inbox_item_close_action/snapshot.json +42 -0
  62. package/package.json +6 -6
  63. package/skills/design-automation-skill/SKILL.md +1 -1
  64. package/dist/storage-XD0lB4Gk.js +0 -273
  65. package/dist/topic-B2EWKKBT.js +0 -6
package/dist/app.js CHANGED
@@ -1,28 +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-BkDQYdg6.js";
2
- import { $ as canActOnInboxItem, $f as juniorTurnOutbox, $r as annotationKeyDigest, As as isPublicConversation, Au as eventIndexLockKey, Br as verifyConversationQueueMessage, Cp as juniorConversationEventLexemes, Cr as canAddConversationMessages, Ct as inboxItemOwnerConversationId, Di as openSlackModal, Dl as getDashboardTaskLink, Dp as juniorConversationEvents, Dt as validatePlugins, Ec as recordGoogleSignIn, En as pruneActiveConversation, Et as getRegistrations, Fu as storeConversationEventLexemes, Gp as juniorDestinations, Hn as resolveSlackInboxItemCardConversationId, Hr as conversationQueueMessageSchema, Hu as backfillConversationEmbeddings, Jn as parseSlackInboxItemFormTarget, Jr as getQueueProvider, Kn as buildSlackInboxItemModal, Md as createAppContext, Ml as projectConversationMessages, Nd as getAppContext, Ni as slackEntitySchema, O as withConversationMutationLock, Oi as postSlackEphemeralMessage, Op as juniorTurns, Ou as EVENT_INDEX_LOCK_TTL_MS, Pd as installAppContext, Pi as slackExternalRefIdSchema, Qr as renderSlackObjectCard, Rc as dismissOpenInboxItems, Rn as createInboxItemShow, Rp as juniorConversations, Rr as getVercelConversationWorkQueue, Si as notifyAutomationBlocked, Sl as getDashboardInboxItemLink, Sn as hasRunnableConversationWork, Tp as juniorConversationEmbeddings, U as conversationIsActiveSql, Uf as touchConversationDetail, Un as syncInboxItemSlackCards, Ur as isConversationQueueMessageRejectedError, Ut as appendAndEnqueueInboundMessage, Uu as createConversationEmbedder, Vn as runInboxItemPushTimers, Vu as isEventEmbeddingsEnabled, Wc as searchInboxItems, Wf as createSlackDestination, Wn as findSlackThreadOwnerId, Xa as refreshAutomationLastRun, Xn as parseSlackUserInputSubmission, Xs as getSlackClient, Yc as itemQuestion, Zt as clearExpiredConversationLease, _a as withScheduledAutomationLock, a as getDb, al as parseAvatarUrl, an as getConversationWorkState, ar as createVercelPluginTaskCallback, at as inboxItemAddedByAnyAutomation, bi as markDispatchFailed, bp as juniorAgentBindings, cr as sendVercelPluginTask, da as listScheduledAutomationsForTeam, dc as readActorIdentity, dt as inboxItemReaderForUserInConversation, ei as decodeAnnotationRef, ep as juniorTurnInbox, er as createPluginEventPublisher, es as resumeConversationDelivery, fi as getDispatchRecord, fl as deleteExpiredInboxSnoozes, 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, kr as readConversationAccessFromSql, ku as embedConversationEvents, li as getDispatchConversationId, lr as queueCallback, m as deleteMessageLinks, n as getConversationEventStore, ni as verifySlackSignature, nr as getPluginRoutes, o as getSqlExecutor, oc as getWorkspaceTeamId, pa as readScheduledAutomation, po as SLACK_EVENT_NAMESPACE, pp as juniorAutomations, qn as parseSlackInboxItemClick, rn as ensureConversationWake, ro as syncAutomationAlerts, sc as runWithWorkspaceTeamId, si as confirmDispatchMailboxAppend, sn as listActiveConversationIds, sp as juniorQuestions, ss as subjectKey, ti as runWithSlackInstallation, tr as getPluginApiRoutes, tt as canAnswerInboxItem, u as isPostgresErrorCode, up as juniorAutomationRuns, ut as inboxItemReaderForUser, v as withConversationEventLock, vn as CONVERSATION_WORK_STALE_ENQUEUE_MS, vp as juniorInboxItems, wn as isInvalidConversationRecordError, wp as juniorConversationEventEmbeddings, wt as inboxItemVisibility, xl as getDashboardConversationLink, yc as resolveActorIdentityId, ys as listConversationAnnotations, z as conversationCostOf, za as existingConversationId, zi as slackMention, zn as pushConversationInboxItemsNow, zo as takeDueTimerWatches, zr as resolveConversationWorkTopic } from "./db-CbURDbaB.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-CqgOoICc.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-CL9ZkOgx.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-bLo0h7Le.js";
6
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CofUHWqz.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-CKtEUuWD.js";
2
+ import { $c as getWorkspaceTeamId, $n as publishTurnEnded, $r as createVercelPluginTaskCallback, $t as getConversation, Af as createAppContext, Bd as backfillConversationEmbeddings, Bn as findStalledTurns, Br as buildSlackInboxItemModal, Cc as isPublicConversation, Ci as readConversationAccessFromSql, Cm as juniorConversationEmbeddings, Cr as runInboxItemPushTimers, Da as slackEntitySchema, Dd as embedConversationEvents, Ed as EVENT_INDEX_LOCK_TTL_MS, Em as juniorTurns, F as conversationCostOf, Hi as getQueueProvider, Hl as itemQuestion, Hp as createSlackDestination, Hr as parseSlackInboxItemFormTarget, Ii as conversationQueueMessageSchema, Im as juniorConversations, Ir as resolveSlackInboxItemCardConversationId, Ji as decodeAnnotationRef, Jr as createPluginEventPublisher, Ki as renderSlackObjectCard, Kt as clearExpiredConversationLease, Li as isConversationQueueMessageRejectedError, Ll as searchInboxItems, Lr as syncInboxItemSlackCards, Mf as installAppContext, Mi as getVercelConversationWorkQueue, Mn as createEngineContext, Ms as takeDueTimerWatches, Na as slackMention, Nd as storeConversationEventLexemes, Ni as resolveConversationWorkTopic, No as existingConversationId, Oa as slackExternalRefIdSchema, Od as eventIndexLockKey, Pi as verifyConversationQueueMessage, Qp as juniorTurnInbox, Qt as ensureConversationWake, Rr as findSlackThreadOwnerId, Rt as appendAndEnqueueInboundMessage, Sa as postSlackEphemeralMessage, Sm as juniorConversationEventEmbeddings, St as validatePlugins, Tm as juniorConversationEvents, To as automationVersionOf, Uc as getSlackClient, Um as juniorDestinations, Vd as createConversationEmbedder, Vp as touchConversationDetail, Vr as parseSlackInboxItemClick, Wo as refreshAutomationLastRun, Wr as parseSlackUserInputSubmission, Xi as verifySlackSignature, Xr as getPluginRoutes, Y as canActOnInboxItem, Yi as runWithSlackInstallation, Yr as getPluginApiRoutes, Z as canAnswerInboxItem, Zo as syncAutomationAlerts, Zp as juniorTurnOutbox, _i as canAddConversationMessages, _n as hasRunnableConversationWork, a as getDb, am as juniorQuestions, ao as listScheduledAutomationsForTeam, at as inboxItemReaderForUser, br as createInboxItemShow, cl as resolveViewerUser, cm as juniorAutomationRuns, cs as slackChannelMessageEvent, dm as juniorAutomations, do as withScheduledAutomationLock, dt as isPluginInboxItem, ec as subjectKey, el as runWithWorkspaceTeamId, en as getConversationWorkState, et as inboxItemAddedByAnyAutomation, eu as parseAvatarUrl, fc as listConversationAnnotations, fl as resolveActorIdentityId, ga as notifyAutomationBlocked, gm as juniorInboxItems, gr as withConversationEventLock, i as getConversationStore, il as readActorIdentity, jf as getAppContext, jl as dismissOpenInboxItems, ku as projectConversationMessages, la as isTerminalDispatchStatus, lo as saveScheduledAutomationInLock, m as deleteMessageLinks, ma as markDispatchFailed, n as getConversationEventStore, ni as sendVercelPluginTask, nn as listActiveConversationIds, o as getSqlExecutor, oa as getDispatchRecord, os as SLACK_EVENT_NAMESPACE, ot as inboxItemReaderForUserInConversation, pn as CONVERSATION_WORK_STALE_ENQUEUE_MS, qi as annotationKeyDigest, qn as publishTurnStep, qs as resumeConversationDelivery, ra as getDispatchConversationId, ri as queueCallback, rr as withSpan, so as readScheduledAutomation, su as deleteExpiredInboxSnoozes, ta as confirmDispatchMailboxAppend, tr as countMetric, u as isPostgresErrorCode, ua as listPendingDispatchMailboxAppends, uo as scheduledRunId, ur as parseSlackThreadId, vm as juniorAgentBindings, vt as inboxItemOwnerConversationId, vu as getDashboardConversationLink, w as withConversationMutationLock, wu as getDashboardTaskLink, xa as openSlackModal, xm as juniorConversationEventLexemes, xn as pruneActiveConversation, xr as pushConversationInboxItemsNow, xt as getRegistrations, yl as recordGoogleSignIn, yn as isInvalidConversationRecordError, yt as inboxItemVisibility, yu as getDashboardInboxItemLink, z as conversationIsActiveSql, zd as isEventEmbeddingsEnabled } from "./db-RDpWIeRK.js";
3
+ import { C as withContext, D as GOOGLE_IDENTITY_PROVIDER, T as withSpan$1, f as logException, k as normalizeIdentityEmail, m as logWarn, n as createRequestContext, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-BQsfrLHl.js";
4
+ import { $ as withNormalizedThreadId, $t as bindSpawnAgent, Bn as readViewerAutomationSummary, C as processWorkspaceSnapshotJob, Dn as unpublishedArtifactHeaders, Dt as readObjectLinkTypes, En as readPublicArtifact, F as markConversationRead, Fn as ViewerTaskNotFoundError, G as createProductionSlackWebhookServices, Gn as missingAutomationSkillReason, Hn as readViewerAutomations, K as getProductionSlackAdapter, Kn as effectiveTaskOutcomes, L as deliverInboxItemChange, Nt as isPublicAddress, Pt as publicAddressLookup, Q as normalizeIncomingSlackThreadId, Rn as readViewerAutomationExecutions, S as createVercelCacheWarmupCallback, St as readLiveAnnotations, T as ingestEvent, Tn as publicArtifactHeaders, Vt as readConversationRecordFromSql, W as createProductionConversationWorkOptions, Wn as findAutomationSkill, X as clearSlackPendingReactions, Y as buildSlackInboundMessage, Z as slackInboundMessageId, _t as createSlackWebApiStatusSender, an as bindMessageAuthorIdentityId, at as processPluginTask, b as vercelBackgroundCompactionQueue, cn as parseContent, dn as getThreadStopDecision, ft as readConversationLastEventSeq, gt as stopConversation, ht as recordSkippedConversationMessage, i as scheduledAutomationRunAttributes, in as createAgentRunner, it as failStoppedDispatch, lt as readConversationEventPage, nn as bindMessageAgent, on as startProcessingReaction, pt as readConversationMessageEventSeq, r as logScheduledAutomationRunSkipped, rt as enqueueAgentDispatch, sn as stripLeadingBotMention, t as executeAgentRun, un as SubscribedReplyReason, ut as readConversationEventPageAfter, w as verifyWorkspaceSnapshotJobMessage, x as verifyBackgroundCompactionMessage, y as processBackgroundCompaction } from "./agent-OUkEw6Bv.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-DiAB4QfT.js";
6
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BU4tXvH3.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-cGaO9_Hf.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-BtUv4-oc.js";
10
- import { Bt as annotationCard, Dn as automationTaskSchema, Kt as automationCardStatus, Nn as getNextRunAtMs, On as automationTaskText, _ as automationListQuerySchema, _n as buttonUserInputField, in as scheduledRunSchema, p as automationExecutionStatusSchema, pn as inboxItemQuestion } from "./types-CGgQ3-Bb.js";
11
- import { t as createEndStoppedChildWork } from "./result-BFBwK1M2.js";
12
- import { h as createPluginLogger } from "./prompt-CX29OGO9.js";
13
- import { n as getAttachmentStorage } from "./storage-XD0lB4Gk.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-CuLf7Ob2.js";
9
+ import { $ as renderInboxItemMessage, $t as recordWebConversationActivity, A as getAuthPausedConversationTurnId, G as coerceThreadConversationState, In as isExperimentalFeatureEnabled, Q as inboxItemChangeRecord, Xt as conversationTurnIdForMessage, Yt as appendAndEnqueueWebMessage, Zt as createAndEnqueueConversation, b as isTrustedSlackAuthor, bn as getAttachmentStorage, en as webActorFromUser, fr as appendConversationMessages, mn as requestAttachmentDeletion, mt as renderTaskInput, on as collectAttachmentUploadGarbage, un as collectAttachmentGarbage, v as findTrustedUser, vr as settleConversationTitleWork, x as parseEmail, y as isAllowedDomain } from "./markers-Bh0vqJ5k.js";
10
+ import { An as automationTaskText, Fn as getNextRunAtMs, Nt as spaceRefSchema, Rt as conversationKindSchema, Tn as userInputQuestionText, Vt as annotationCard, _ as automationListQuerySchema, _n as inboxItemQuestion, an as scheduledRunSchema, kn as automationTaskSchema, p as automationExecutionStatusSchema, qt as automationCardStatus, xn as buttonUserInputField } from "./types-BWAgOJtR.js";
11
+ import { t as createEndStoppedChildWork } from "./result-D_D-2Adp.js";
12
+ import { h as createPluginLogger } from "./prompt-5PDkRQ1K.js";
14
13
  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-DL9r-ry5.js";
14
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-Bo6_FtCI.js";
16
15
  import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
17
16
  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-EWYTnBZI.js";
19
- import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-l4hKICAL.js";
20
- import { s as joinPublicChannel } from "./channel-access-BUHB0saC.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-D9uPRDMD.js";
22
- import { t as processConversationWork } from "./worker-buhFcpl9.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-BP0h6u4m.js";
24
- import { t as JUNIOR_VERSION } from "./version-D_vbXyNw.js";
25
- import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-B1_1NJc8.js";
17
+ 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-BxF0Yb3-.js";
18
+ import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-BMv4fAPu.js";
19
+ import { s as joinPublicChannel } from "./channel-access-DRhVJIuQ.js";
20
+ 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-CeKaP0ZJ.js";
21
+ import { t as processConversationWork } from "./worker-C7EDSL3d.js";
22
+ import { a as turnStepConsumer, i as createGatewayModelClient, n as turnEndedConsumer, r as turnTools, t as createDeploymentDelivery } from "./turn-ended-DQ10G3in.js";
23
+ import { t as JUNIOR_VERSION } from "./version-D9yLYOBu.js";
24
+ import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-BUaMmSLi.js";
26
25
  import { t as isMissingVirtualModule } from "./virtual-module-BeKA_EII.js";
27
26
  import { createRequire } from "node:module";
28
27
  import { Hono } from "hono";
@@ -53,7 +52,7 @@ async function runConversationEmbeddingBackfill(embedder) {
53
52
  const key = `junior:conversation_embeddings:backfill:${embedder.provider}:${embedder.model}`;
54
53
  const state = getStateAdapter();
55
54
  if (!await state.setIfNotExists(key, "running", BACKFILL_CLAIM_TTL_MS$1)) return;
56
- await withSpan("conversation_embeddings.backfill", "conversation_embeddings.backfill", {}, async (setSpanAttributes) => {
55
+ await withSpan$1("conversation_embeddings.backfill", "conversation_embeddings.backfill", {}, async (setSpanAttributes) => {
57
56
  const result = await backfillConversationEmbeddings({
58
57
  db: getDb(),
59
58
  deadlineMs: Date.now() + BACKFILL_BUDGET_MS$1,
@@ -225,7 +224,7 @@ async function runEventSearchBackfill(args) {
225
224
  const deadlineMs = Date.now() + BACKFILL_BUDGET_MS;
226
225
  let done = false;
227
226
  try {
228
- await withSpan("event_search.backfill", "event_search.backfill", {}, async (setSpanAttributes) => {
227
+ await withSpan$1("event_search.backfill", "event_search.backfill", {}, async (setSpanAttributes) => {
229
228
  const stored = backfillPassSchema.safeParse(await state.get(passKey));
230
229
  const result = await backfillEventSearchIndex({
231
230
  db: getDb(),
@@ -1865,11 +1864,10 @@ async function refreshCards(services, user, itemId) {
1865
1864
  /**
1866
1865
  * Do one person action from a Slack card. The thread of the card gets an
1867
1866
  * answer as Slack input from the person, like a typed reply. A dismiss, or
1868
- * the answer to a plugin item, starts no Turn, so the thread gets the same
1869
- * recorded Message as the other linked Conversations, from
1870
- * `actOnInboxItem`. An expected failure, such as
1871
- * an item that is already closed, goes to the person as an ephemeral
1872
- * message.
1867
+ * an answer or action on a plugin item, starts no Turn, so the thread gets
1868
+ * the same recorded Message as the other linked Conversations, from
1869
+ * `actOnInboxItem`. An expected failure, such as an item that is already
1870
+ * closed, goes to the person as an ephemeral message.
1873
1871
  */
1874
1872
  async function act(args) {
1875
1873
  const { services, target } = args;
@@ -1888,7 +1886,7 @@ async function act(args) {
1888
1886
  let item;
1889
1887
  try {
1890
1888
  const current = await readInboxItemForUser(actor.user, args.itemId);
1891
- const pluginAnswer = args.action === "submit" && isPluginInboxItem(current);
1889
+ const pluginAnswer = (args.action === "submit" || args.action === "done") && isPluginInboxItem(current);
1892
1890
  recordOnly ||= pluginAnswer;
1893
1891
  item = await actOnInboxItem({
1894
1892
  action: args.action,
@@ -1897,7 +1895,8 @@ async function act(args) {
1897
1895
  delivery,
1898
1896
  id: current.id,
1899
1897
  user: actor.user,
1900
- ...args.answer ? { answer: args.answer(current) } : void 0
1898
+ ...args.answer ? { answer: args.answer(current) } : void 0,
1899
+ ...args.kindAction ? { kindAction: args.kindAction } : void 0
1901
1900
  });
1902
1901
  } catch (error) {
1903
1902
  if (!(error instanceof InboxItemActionError)) throw error;
@@ -1998,6 +1997,14 @@ async function handleSlackInboxItemClick(args) {
1998
1997
  });
1999
1998
  return;
2000
1999
  }
2000
+ if (click.kind === "action") {
2001
+ await act({
2002
+ ...common,
2003
+ action: "done",
2004
+ kindAction: click.action
2005
+ });
2006
+ return;
2007
+ }
2001
2008
  await act({
2002
2009
  ...common,
2003
2010
  action: "submit",
@@ -2052,7 +2059,7 @@ function requireSlackPayloadUserId(value, source) {
2052
2059
  return userId;
2053
2060
  }
2054
2061
  async function handleAppHomeDisconnect(args) {
2055
- await withSpan("chat.app_home_disconnect", "chat.app_home_disconnect", { userId: args.userId }, async () => {
2062
+ await withSpan$1("chat.app_home_disconnect", "chat.app_home_disconnect", { userId: args.userId }, async () => {
2056
2063
  try {
2057
2064
  await unlinkProvider(args.userId, args.provider, args.userTokenStore, getWorkspaceTeamId());
2058
2065
  } catch (error) {
@@ -2072,7 +2079,7 @@ async function handleAppHomeDisconnect(args) {
2072
2079
  async function handleSlackInteractivePayload(args) {
2073
2080
  const spanAttributes = { userId: args.payload.user?.id?.trim() || void 0 };
2074
2081
  if (args.payload.type === "view_submission" && args.payload.view?.callback_id === "junior_review_item") {
2075
- await withSpan("chat.slack_inbox_item_submit", "chat.slack_inbox_item_submit", spanAttributes, () => handleSlackInboxItemSubmission({
2082
+ await withSpan$1("chat.slack_inbox_item_submit", "chat.slack_inbox_item_submit", spanAttributes, () => handleSlackInboxItemSubmission({
2076
2083
  payload: args.payload,
2077
2084
  services: args
2078
2085
  }));
@@ -2082,7 +2089,7 @@ async function handleSlackInteractivePayload(args) {
2082
2089
  for (const action of args.payload.actions ?? []) {
2083
2090
  const click = parseSlackInboxItemClick(action);
2084
2091
  if (click) {
2085
- await withSpan("chat.slack_inbox_item_click", "chat.slack_inbox_item_click", spanAttributes, () => handleSlackInboxItemClick({
2092
+ await withSpan$1("chat.slack_inbox_item_click", "chat.slack_inbox_item_click", spanAttributes, () => handleSlackInboxItemClick({
2086
2093
  action,
2087
2094
  click,
2088
2095
  payload: args.payload,
@@ -2093,7 +2100,7 @@ async function handleSlackInteractivePayload(args) {
2093
2100
  }
2094
2101
  const continueHere = args.payload.actions?.find((candidate) => candidate.action_id === SLACK_CONTINUE_HERE_ACTION_ID);
2095
2102
  if (continueHere) {
2096
- await withSpan("chat.slack_continue_here_click", "chat.slack_continue_here_click", spanAttributes, () => handleSlackContinueHereClick({
2103
+ await withSpan$1("chat.slack_continue_here_click", "chat.slack_continue_here_click", spanAttributes, () => handleSlackContinueHereClick({
2097
2104
  isAuthorAllowed: args.isAuthorAllowed,
2098
2105
  payload: args.payload,
2099
2106
  state: args.state,
@@ -3054,7 +3061,7 @@ async function handleSlackWebhook(args) {
3054
3061
  if (shouldPersistBeforeAck(parsed)) {
3055
3062
  const failureResponse = await withLogContext(eventLogContext, async () => {
3056
3063
  try {
3057
- await withSpan("slack.message.ingress", "slack.message.ingress", eventLogContext, () => handleSlackEvent({
3064
+ await withSpan$1("slack.message.ingress", "slack.message.ingress", eventLogContext, () => handleSlackEvent({
3058
3065
  body: parsed,
3059
3066
  services: args.services
3060
3067
  }), {
@@ -3145,7 +3152,7 @@ function queueProcessAttributes(metadata, nowMs) {
3145
3152
  async function processConversationQueueMessage(message, options, metadata) {
3146
3153
  const parsed = parseConversationQueueMessage(message);
3147
3154
  try {
3148
- return await withSpan("conversation.work.process", "queue.process", { conversationId: parsed.conversationId }, async (setSpanAttributes) => {
3155
+ return await withSpan$1("conversation.work.process", "queue.process", { conversationId: parsed.conversationId }, async (setSpanAttributes) => {
3149
3156
  try {
3150
3157
  const result = await processConversationWork(parsed, {
3151
3158
  beforeWorkStops: options.beforeWorkStops,
@@ -3274,7 +3281,7 @@ const STALE_MS$1 = 3e5;
3274
3281
  const BATCH$1 = 100;
3275
3282
  /** Sends the step message again for each Turn that no message will reach. */
3276
3283
  async function sweepTurns(ctx) {
3277
- await withSpan$1("turn.sweep", {}, async (span) => {
3284
+ await withSpan("turn.sweep", {}, async (span) => {
3278
3285
  const turns = await findStalledTurns(ctx, {
3279
3286
  staleMs: STALE_MS$1,
3280
3287
  limit: BATCH$1
@@ -3306,7 +3313,7 @@ const BATCH = 100;
3306
3313
  * replies no message will send.
3307
3314
  */
3308
3315
  async function sweepDeliveries(ctx) {
3309
- await withSpan$1("delivery.sweep", {}, async (span) => {
3316
+ await withSpan("delivery.sweep", {}, async (span) => {
3310
3317
  const stalled = await findStalledDeliveries(ctx, {
3311
3318
  staleMs: STALE_MS,
3312
3319
  limit: BATCH
@@ -5322,17 +5329,21 @@ async function claimMcpAuthorization(state, authorizationId) {
5322
5329
  }
5323
5330
  return claimed;
5324
5331
  }
5325
- /** Build the client redirect for an OAuth authorization response. */
5326
- function authorizationRedirect(args) {
5332
+ /** Build the client callback URL for an OAuth authorization response. */
5333
+ function authorizationResponseUrl(args) {
5327
5334
  const url = new URL(args.redirectUri);
5328
5335
  for (const [name, value] of Object.entries(args.params)) url.searchParams.set(name, value);
5329
5336
  if (args.state !== void 0) url.searchParams.set("state", args.state);
5330
5337
  url.searchParams.set("iss", args.issuer);
5338
+ return url;
5339
+ }
5340
+ /** Build the client redirect for an OAuth authorization response. */
5341
+ function authorizationRedirect(args) {
5331
5342
  return new Response(null, {
5332
5343
  status: 303,
5333
5344
  headers: {
5334
5345
  "cache-control": "no-store",
5335
- location: url.toString()
5346
+ location: authorizationResponseUrl(args).toString()
5336
5347
  }
5337
5348
  });
5338
5349
  }
@@ -5653,9 +5664,27 @@ function blockedPage() {
5653
5664
  title: "Request blocked"
5654
5665
  });
5655
5666
  }
5667
+ function isWebUrl(url) {
5668
+ return url.protocol === "https:" || url.protocol === "http:";
5669
+ }
5656
5670
  function formActionSource(redirectUri) {
5657
5671
  const url = new URL(redirectUri);
5658
- return url.protocol === "https:" || url.protocol === "http:" ? url.origin : url.protocol;
5672
+ return isWebUrl(url) ? void 0 : url.protocol;
5673
+ }
5674
+ function authorizationResponse(args) {
5675
+ const url = authorizationResponseUrl(args);
5676
+ if (!isWebUrl(url)) return authorizationRedirect(args);
5677
+ const href = escapeHtml(url.toString());
5678
+ return renderHtmlPage({
5679
+ bodyHtml: ` <p><a href="${href}">Continue to the app</a> if nothing happens.</p>`,
5680
+ headHtml: ` <meta http-equiv="refresh" content="0;url=${href}" />`,
5681
+ headers: {
5682
+ "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'; form-action 'none'; base-uri 'none'",
5683
+ "referrer-policy": "no-referrer"
5684
+ },
5685
+ status: 200,
5686
+ title: "Redirecting…"
5687
+ });
5659
5688
  }
5660
5689
  function consentPage(args) {
5661
5690
  const clientHost = new URL(args.authorization.clientId).host;
@@ -5719,7 +5748,7 @@ async function handleMcpConsentPage(args) {
5719
5748
  if (!requestHasSameOrigin(args.request) || consent?.userId !== args.user.id || !form.csrf || !csrfMatches(form.csrf, consent.csrfHash) || form.action !== "approve" && form.action !== "deny") return blockedPage();
5720
5749
  if (!await claimMcpAuthorization(args.state, authorizationId)) return expiredPage();
5721
5750
  const { issuer } = resolveMcpUrls(args.request, args.baseURL);
5722
- if (form.action === "deny") return authorizationRedirect({
5751
+ if (form.action === "deny") return authorizationResponse({
5723
5752
  issuer,
5724
5753
  params: {
5725
5754
  error: "access_denied",
@@ -5728,7 +5757,7 @@ async function handleMcpConsentPage(args) {
5728
5757
  redirectUri: authorization.redirectUri,
5729
5758
  state: authorization.state
5730
5759
  });
5731
- return authorizationRedirect({
5760
+ return authorizationResponse({
5732
5761
  issuer,
5733
5762
  params: { code: await issueAuthorizationCode({
5734
5763
  clientId: authorization.clientId,
@@ -6081,7 +6110,7 @@ function mcpInboxItem(item, userId, views) {
6081
6110
  status: item.status,
6082
6111
  title: item.title,
6083
6112
  body: item.body,
6084
- ...question ? { question: question.question } : void 0,
6113
+ ...question ? { question: userInputQuestionText(question) } : void 0,
6085
6114
  assignees: item.assignedToEveryone ? [] : item.assignees.map((person) => person.displayName ?? person.email),
6086
6115
  canAct: canActOnInboxItem(item, userId),
6087
6116
  conversationIds: item.conversationIds,
@@ -6238,17 +6267,21 @@ function registerMarkConversationReadTool(server, { user }) {
6238
6267
  });
6239
6268
  }
6240
6269
  // src/api/mcp/tools/search-conversations.ts
6270
+ const searchRowSchema = mcpConversationSchema.extend({
6271
+ kind: conversationKindSchema.describe("`lead` for the Lead of a Space, whose title is the Space's name. `automation` for an Automation run. `thread` otherwise."),
6272
+ space: spaceRefSchema.optional().describe("The Space that it is in. Missing when it is in no Space, or when you may not read the Space.")
6273
+ });
6241
6274
  /** Register `searchConversations`, which searches the Conversations of the user. */
6242
6275
  function registerSearchConversationsTool(server, { user }) {
6243
6276
  const feedQuery = conversationFeedQuerySchema.shape;
6244
6277
  server.registerTool("searchConversations", {
6245
6278
  title: "Search conversations",
6246
- description: "Search your conversations and return up to 50, newest activity first. Only conversations that you started or take part in match.",
6279
+ description: "Search your conversations and return up to 50, newest activity first. Only conversations that you started or take part in match. A text search also finds each Space that you are a member of, as its Lead.",
6247
6280
  inputSchema: {
6248
6281
  q: feedQuery.q.describe("Text to search for in titles, summaries, and Annotation labels and titles."),
6249
6282
  status: feedQuery.status.describe("Return conversations that are not archived (default) or that are archived. A search ignores this filter.")
6250
6283
  },
6251
- outputSchema: { conversations: z.array(mcpConversationSchema) },
6284
+ outputSchema: { conversations: z.array(searchRowSchema) },
6252
6285
  annotations: {
6253
6286
  destructiveHint: false,
6254
6287
  idempotentHint: true,
@@ -6260,7 +6293,11 @@ function registerSearchConversationsTool(server, { user }) {
6260
6293
  q,
6261
6294
  status,
6262
6295
  viewer: user
6263
- })).conversations.map(mcpConversation) });
6296
+ })).conversations.map((row) => ({
6297
+ ...mcpConversation(row),
6298
+ kind: row.kind,
6299
+ space: row.space ?? void 0
6300
+ })) });
6264
6301
  });
6265
6302
  }
6266
6303
  // src/api/mcp/tools/search-inbox-items.ts
@@ -26,9 +26,13 @@ declare const messageAttachmentSchema: z.ZodObject<{
26
26
  pending: z.ZodOptional<z.ZodLiteral<true>>;
27
27
  }, z.core.$strict>;
28
28
  type MessageAttachment = z.output<typeof messageAttachmentSchema>;
29
- /** A request that an agent writes. Each choice field has two options or more. */
30
- declare const userInputRequestSchema: z.ZodObject<{
31
- question: z.ZodString;
29
+ /**
30
+ * A saved request: an optional question that its fields share, and the
31
+ * fields. A question that an agent asks has no shared question: each field
32
+ * holds its own question.
33
+ */
34
+ declare const savedUserInputRequestSchema: z.ZodObject<{
35
+ question: z.ZodOptional<z.ZodString>;
32
36
  fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
33
37
  id: z.ZodString;
34
38
  label: z.ZodString;
@@ -62,23 +66,29 @@ declare const userInputRequestSchema: z.ZodObject<{
62
66
  * every surface says that in the same words.
63
67
  */
64
68
  declare const USER_INPUT_NOTE: {
65
- readonly label: "Anything else?";
66
- readonly description: "Optional. This note is sent together with your answers above.";
69
+ readonly label: "Additional notes";
70
+ readonly description: "Optional. Sent with your answers.";
67
71
  };
68
72
  /** One field of a user input request. */
69
73
  type UserInputField = UserInputRequest["fields"][number];
70
74
  /** A question with one or more fields for a person to answer. */
71
- type UserInputRequest = z.output<typeof userInputRequestSchema>;
75
+ type UserInputRequest = z.output<typeof savedUserInputRequestSchema>;
72
76
  /**
73
77
  * A person's answer to one user input request. `values` maps field ids to
74
- * the picked option labels or the typed text. `other` is free text that the
75
- * person can always add.
78
+ * the picked option labels or the typed text. `other` is the card's
79
+ * additional notes, where the person can also write an answer that no
80
+ * choice fits.
76
81
  */
77
82
  interface UserInputAnswer {
78
83
  other?: string | undefined;
79
84
  requestId: string;
80
85
  values: Record<string, string[]>;
81
86
  }
87
+ /**
88
+ * Return the text that a request asks: its shared question, else the
89
+ * question of each field, one paragraph each.
90
+ */
91
+ declare function userInputQuestionText(request: UserInputRequest): string;
82
92
  /**
83
93
  * Return the single choice field of a request that a surface can show as
84
94
  * one row of buttons, where one click is the whole answer.
@@ -98,7 +108,7 @@ declare function isEmptyUserInputAnswer(answer: UserInputAnswer): boolean;
98
108
  * of the question, so they are stored with it in `request`.
99
109
  */
100
110
  declare const inboxItemRequestSchema: z.ZodObject<{
101
- question: z.ZodString;
111
+ question: z.ZodOptional<z.ZodString>;
102
112
  fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
103
113
  id: z.ZodString;
104
114
  label: z.ZodString;
@@ -152,6 +162,12 @@ type InboxItemNoticeRequest = z.output<typeof inboxItemNoticeRequestSchema>;
152
162
  * related links, so it has none.
153
163
  */
154
164
  declare function inboxItemQuestion(request: InboxItemRequest | InboxItemNoticeRequest | null | undefined): InboxItemRequest | undefined;
165
+ /**
166
+ * Tool names that ask a person a question. Turns from before
167
+ * `askUserQuestion` have an old name in their history, so readers of a
168
+ * transcript match every name.
169
+ */
170
+ declare const ASK_TOOL_NAMES: ReadonlySet<string>;
155
171
  /** Saved automation facts shown with a Message, not a live status view. */
156
172
  declare const automationCardSchema: z.ZodObject<{
157
173
  kind: z.ZodLiteral<"automation">;
@@ -230,4 +246,4 @@ declare const inboxItemChangeRecordSchema: z.ZodObject<{
230
246
  reviewItemId: z.ZodString;
231
247
  }, z.core.$strict>;
232
248
  type InboxItemChangeRecord = z.output<typeof inboxItemChangeRecordSchema>;
233
- export { InputFile as _, annotationCard as a, MessageAttachment as b, AutomationCard as c, UserInputAnswer as d, UserInputField as f, normalizeUserInputAnswer as g, isEmptyUserInputAnswer as h, MessageCard as i, inboxItemQuestion as l, buttonUserInputField as m, conversationTurnFailureCodeSchema as n, messageCardText as o, UserInputRequest as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, USER_INPUT_NOTE as u, MAX_ATTACHMENT_BYTES as v, MAX_INPUT_ATTACHMENTS as y };
249
+ export { MessageAttachment as S, normalizeUserInputAnswer as _, annotationCard as a, MAX_ATTACHMENT_BYTES as b, AutomationCard as c, USER_INPUT_NOTE as d, UserInputAnswer as f, isEmptyUserInputAnswer as g, buttonUserInputField as h, MessageCard as i, ASK_TOOL_NAMES as l, UserInputRequest as m, conversationTurnFailureCodeSchema as n, messageCardText as o, UserInputField as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, inboxItemQuestion as u, userInputQuestionText as v, MAX_INPUT_ATTACHMENTS as x, InputFile as y };
@@ -1,4 +1,4 @@
1
- import { Ks as SlackActionError, Xs as getSlackClient, i as getConversationStore, ic as withSlackRetries } from "./db-CbURDbaB.js";
1
+ import { Uc as getSlackClient, Zc as withSlackRetries, i as getConversationStore, zc as SlackActionError } from "./db-RDpWIeRK.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,18 +1,13 @@
1
- import { R as getChatConfig } from "./adapter-BkDQYdg6.js";
2
- import { Op as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore, vc as SYSTEM_IDENTITY_ID } from "./db-CbURDbaB.js";
1
+ import { R as getChatConfig } from "./adapter-CKtEUuWD.js";
2
+ import { Em as juniorTurns, Fn as scheduleInput, Mn as createEngineContext, d as createSqlConversationEventStore, dl as SYSTEM_IDENTITY_ID, i as getConversationStore, jn as turnGroupKey } from "./db-RDpWIeRK.js";
3
3
  import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
4
- import { mi as projectConversationEvents } from "./markers-BtUv4-oc.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-BP0h6u4m.js";
4
+ import { Bi as projectConversationEvents } from "./markers-Bh0vqJ5k.js";
5
+ import { n as TURN_STEP_TOPIC, t as TURN_ENDED_TOPIC } from "./topic-ChZe9WPj.js";
6
+ import { a as turnStepConsumer, i as createGatewayModelClient, n as turnEndedConsumer, r as turnTools } from "./turn-ended-DQ10G3in.js";
7
7
  import { eq } from "drizzle-orm";
8
8
  import { localDestinationSchema } from "@sentry/junior-plugin-api";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { setTimeout } from "node:timers/promises";
11
- // src/turn-steps/group-key.ts
12
- /** The group key of an input that this Actor Identity sent from this Source. */
13
- function turnGroupKey(actorIdentityId, source) {
14
- return `${actorIdentityId}:${source.kind}`;
15
- }
16
11
  // src/cli/chat-core-engine.ts
17
12
  /**
18
13
  * `junior chat --engine core -p`: one message through the core Turn engine.
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-BkDQYdg6.js";
3
- import { on as createAgentRunner, t as executeAgentRun } from "../agent-CL9ZkOgx.js";
2
+ import { G as loadConfig, W as installChatConfig } from "../adapter-CKtEUuWD.js";
3
+ import { in as createAgentRunner, t as executeAgentRun } from "../agent-OUkEw6Bv.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-CbURDbaB.js").then((n) => n.jd),
113
- import("../validation-CofUHWqz.js").then((n) => n.r),
114
- import("../db-CbURDbaB.js").then((n) => n.t)
112
+ import("../db-RDpWIeRK.js").then((n) => n.kf),
113
+ import("../validation-BU4tXvH3.js").then((n) => n.r),
114
+ import("../db-RDpWIeRK.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-DNdoVQg8.js");
168
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-C3GxhsuB.js");
169
- const { createLocalOAuthState } = await import("../oauth-relay-BGm6sLCB.js").then((n) => n.t);
170
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BBcCiEhm.js");
171
- const { bindSpawnAgent } = await import("../agent-CL9ZkOgx.js").then((n) => n.nn);
172
- const { bindMessageAgent } = await import("../agent-CL9ZkOgx.js").then((n) => n.an);
173
- const { runConversation } = await import("../agent-CL9ZkOgx.js").then((n) => n.Y);
174
- const { createConversationTurnWorker } = await import("../agent-CL9ZkOgx.js").then((n) => n.X);
175
- const { resumeForPersonInput } = await import("../markers-BtUv4-oc.js").then((n) => n.M);
167
+ const { runLocalAgentTurn } = await import("../runner-CCVTdp0x.js");
168
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BxuN0Jqz.js");
169
+ const { createLocalOAuthState } = await import("../oauth-relay-vyG2gOwY.js").then((n) => n.t);
170
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-D4OKOFgy.js");
171
+ const { bindSpawnAgent } = await import("../agent-OUkEw6Bv.js").then((n) => n.en);
172
+ const { bindMessageAgent } = await import("../agent-OUkEw6Bv.js").then((n) => n.rn);
173
+ const { runConversation } = await import("../agent-OUkEw6Bv.js").then((n) => n.q);
174
+ const { createConversationTurnWorker } = await import("../agent-OUkEw6Bv.js").then((n) => n.J);
175
+ const { resumeForPersonInput } = await import("../markers-Bh0vqJ5k.js").then((n) => n.D);
176
176
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
177
- const { processConversationWork } = await import("../worker-buhFcpl9.js").then((n) => n.n);
177
+ const { processConversationWork } = await import("../worker-C7EDSL3d.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-DuBaPbqK.js");
244
+ const { runCoreEnginePrompt } = await import("../chat-core-engine-El308gYr.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-CX29OGO9.js";
2
- import { a as parseSkillFile } from "../skills-DMJsS5e4.js";
3
- import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-D9uPRDMD.js";
4
- import { Af as parseInlinePluginManifest, jf as parsePluginManifest } from "../db-CbURDbaB.js";
1
+ import { G as mapBounded } from "../prompt-5PDkRQ1K.js";
2
+ import { a as parseSkillFile } from "../skills-DfbOjWxl.js";
3
+ import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-CeKaP0ZJ.js";
4
+ import { Op as parseInlinePluginManifest, kp as parsePluginManifest } from "../db-RDpWIeRK.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-XS3G9BOj.js")).runAdmin(argv);
48
+ return await (await import("../admin-BGOiUGwR.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-B7E7OIFP.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-CeWsFrBi.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 { Md as createAppContext, Pd as installAppContext, a as getDb, kt as coreRegistrations } from "../db-CbURDbaB.js";
2
- import { h as createPluginLogger } from "../prompt-CX29OGO9.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CofUHWqz.js";
1
+ import { Af as createAppContext, Mf as installAppContext, a as getDb, wt as coreRegistrations } from "../db-RDpWIeRK.js";
2
+ import { h as createPluginLogger } from "../prompt-5PDkRQ1K.js";
3
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BU4tXvH3.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-BkDQYdg6.js";
2
- import { Nd as getAppContext } from "../db-CbURDbaB.js";
3
- import { n as resolve } from "../resolve-D9RKNH3v.js";
4
- import { t as create, u as SANDBOX_RUNTIME } from "../profile-bLo0h7Le.js";
1
+ import { R as getChatConfig, n as disconnectStateAdapter } from "../adapter-CKtEUuWD.js";
2
+ import { jf as getAppContext } from "../db-RDpWIeRK.js";
3
+ import { n as resolve } from "../resolve-C7e0pwuP.js";
4
+ import { t as create, u as SANDBOX_RUNTIME } from "../profile-DiAB4QfT.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-BkDQYdg6.js";
2
- import { Fd as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-CbURDbaB.js";
1
+ import { R as getChatConfig } from "../adapter-CKtEUuWD.js";
2
+ import { Nf as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-RDpWIeRK.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, Gp as juniorDestinations, Ii as escapeSlackMrkdwnText, Li as formatSlackLink, N as claimProviderConversation, O as withConversationMutationLock, P as getConversationIdByProviderConversation, Ti as getSlackMessagePermalink, Tn as moveIdleConversationDestination, a as getDb, i as getConversationStore, ki as postSlackMessage, o as getSqlExecutor, wi as deleteSlackMessage, xl as getDashboardConversationLink } from "./db-CbURDbaB.js";
2
- import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-BkDQYdg6.js";
3
- import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-BUHB0saC.js";
1
+ import { A as getConversationIdByProviderConversation, Aa as escapeSlackMrkdwnText, Ca as postSlackMessage, E as setFirstConversationLocation, Um as juniorDestinations, a as getDb, bn as moveIdleConversationDestination, i as getConversationStore, ja as formatSlackLink, k as claimProviderConversation, o as getSqlExecutor, va as deleteSlackMessage, vu as getDashboardConversationLink, w as withConversationMutationLock, ya as getSlackMessagePermalink } from "./db-RDpWIeRK.js";
2
+ import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-CKtEUuWD.js";
3
+ import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-DRhVJIuQ.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 { F as actorIdentitySchema, Nt as spaceRefSchema, V as conversationDetailReportSchema, X as conversationSummaryReportSchema, Xt as messageAttachmentSchema, zt as inboxItemChangeRecordSchema } from "./types-CGgQ3-Bb.js";
1
+ import { Bt as inboxItemChangeRecordSchema, F as actorIdentitySchema, Nt as spaceRefSchema, V as conversationDetailReportSchema, X as conversationSummaryReportSchema, Zt as messageAttachmentSchema } from "./types-BWAgOJtR.js";
2
2
  import * as z from "zod";
3
3
  // src/reporting-schema.ts
4
4
  const healthReportSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { m as logWarn } from "./logging-CqgOoICc.js";
1
+ import { m as logWarn } from "./logging-BQsfrLHl.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