@sentry/junior 0.284.0 → 0.285.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 (79) hide show
  1. package/dist/{adapter-CW5UW7vL.js → adapter-DN5AB4VU.js} +37 -3
  2. package/dist/{admin-DUWN8zZX.js → admin-DOITMKnn.js} +1 -1
  3. package/dist/{agent-runner-Cqr21pOU.js → agent-runner-BsWhHe4N.js} +579 -1653
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +7 -6
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +141 -43
  8. package/dist/{app-CvGalMxi.d.ts → app-DyMs9330.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +226 -186
  11. package/dist/{assistant-reply-CFE-OZMS.js → assistant-reply-9Jip5bsr.js} +1 -1
  12. package/dist/{automation-Zvx_I9Z5.js → automation-Mk8aaHzy.js} +1 -1
  13. package/dist/{background-compaction-queue-CHFzrQbS.js → background-compaction-queue-DXkLsWoH.js} +2 -2
  14. package/dist/{briefs-Cx7mkfSk.js → briefs-Cl8-nK9B.js} +5 -5
  15. package/dist/{catalog-runtime-dKOVbR7l.js → catalog-runtime-Bte6jRB2.js} +1 -1
  16. package/dist/cli/chat.js +19 -16
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/init.js +3 -0
  19. package/dist/cli/main.js +3 -3
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/snapshot-create.js +4 -4
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +12 -17
  24. package/dist/{client-CMyH5rDz.js → client-DDbBucBw.js} +2 -2
  25. package/dist/{config-Dt3CpG17.js → config-DqFnykQT.js} +1 -1
  26. package/dist/{connections-CCHPybZP.js → connections-DA4LT9LL.js} +10 -10
  27. package/dist/{conversation-DdT7SNar.js → conversation-D8kVoCrP.js} +58 -6
  28. package/dist/{conversation-pending-messages-Dct5pheX.js → conversation-pending-messages-BvROq1bq.js} +1 -1
  29. package/dist/{conversation-privacy-BpHHhEVp.js → conversation-privacy-D0j_h70R.js} +1 -1
  30. package/dist/{credential-sync-BBPw8dam.js → credential-sync-hcsYatw-.js} +13 -13
  31. package/dist/{db-D7CCwAo8.d.ts → db-BhHZSuFw.d.ts} +18 -2
  32. package/dist/{executor-CyIwHz9r.js → executor-BLEMIgIZ.js} +11 -3
  33. package/dist/instrumentation.js +2 -2
  34. package/dist/{logging-Qo-7xGp1.js → logging-BfORLKoq.js} +1 -1
  35. package/dist/{message-DFbtOWqv.js → message-DqjuKzUx.js} +13 -23
  36. package/dist/nitro.d.ts +1 -1
  37. package/dist/nitro.js +3 -3
  38. package/dist/{oauth-callback-server-BB1gixWo.js → oauth-callback-server-CFSRzu1n.js} +2 -2
  39. package/dist/{projection-0UcUeuzn.js → projection-DliWYrnT.js} +280 -71
  40. package/dist/{prompt-CCtaGgbI.js → prompt-BvIUzY4y.js} +8 -6
  41. package/dist/{registry-DOnPkI8g.js → registry-rC7MCxu8.js} +1 -1
  42. package/dist/{reporting-window-B-QP9zX1.js → reporting-window-B4TwyuJo.js} +14 -14
  43. package/dist/{resolve-Di3omymY.js → resolve-Biu8Qw3u.js} +3 -3
  44. package/dist/result-DxJMCX47.js +299 -0
  45. package/dist/result-event-type-DD6BAgT7.js +11 -0
  46. package/dist/{runner-CnX_dTKw.js → runner-BQJSFLKg.js} +11 -11
  47. package/dist/{sandbox-egress-signals-CtxLJmmg.js → sandbox-egress-signals-6aMxJSDn.js} +1 -1
  48. package/dist/{schema-B017enNE.d.ts → schema-BUviRAs8.d.ts} +157 -220
  49. package/dist/{schema-Bn3miEd_.js → schema-BasXTvi2.js} +63 -5
  50. package/dist/{service-account-KhZIqXRi.js → service-account-BI5Wgx22.js} +3 -3
  51. package/dist/{service-account-ewDAx4Mx.js → service-account-CAE-_1dR.js} +3 -3
  52. package/dist/session-stop-CA-jOJ84.js +2924 -0
  53. package/dist/{skills-CKyotM4g.js → skills-B22duVJU.js} +2 -2
  54. package/dist/{spawn-D5D2MQdz.js → spawn-BB2_4VYn.js} +2 -2
  55. package/dist/{stop-BSKRTaRS.js → stop-DioIcEAu.js} +4821 -4199
  56. package/dist/{store-G3S0kWSD.js → store-B26LV6UP.js} +78 -311
  57. package/dist/{store-ymkEUWe4.js → store-Dn4W7qgH.js} +30 -5
  58. package/dist/{task-queue-BcOHzXxe.js → task-queue-Bt0IoR2i.js} +3 -3
  59. package/dist/{task-runner-B65cDumh.js → task-runner-D8lddjzp.js} +7 -7
  60. package/dist/{thread-state-D6rNGQu9.js → thread-state-CrFk3K_7.js} +4 -4
  61. package/dist/{turn-failure-response-BlO4nuDJ.js → turn-failure-response-DaJ04qVj.js} +7 -7
  62. package/dist/{turn-lifecycle-BQ8ETk63.js → turn-lifecycle-C2mXS7AZ.js} +1 -1
  63. package/dist/{turn-session-routing-D_GXfcAG.js → turn-session-routing-CGMKrYOj.js} +10 -10
  64. package/dist/{validation-DJG_wrg2.js → validation-TzhfQABF.js} +1 -1
  65. package/dist/{version-i1An1eTS.js → version-DSk8CFvA.js} +1 -1
  66. package/dist/version.js +1 -1
  67. package/dist/{viewer-BlpnzZZa.js → viewer-1Ea81s0b.js} +190 -53
  68. package/dist/{work-BgCW3FDC.js → work-ybG4_q5C.js} +238 -32
  69. package/dist/{worker-BJz1mwYt.js → worker-ccSyZRNz.js} +6 -6
  70. package/migrations/0083_conversation_kind.sql +11 -0
  71. package/migrations/0084_read_position_backfill.sql +25 -0
  72. package/migrations/0085_child_archived_at.sql +1 -0
  73. package/migrations/meta/0083_snapshot.json +4388 -0
  74. package/migrations/meta/0084_snapshot.json +4388 -0
  75. package/migrations/meta/0085_snapshot.json +4394 -0
  76. package/migrations/meta/_journal.json +21 -0
  77. package/package.json +4 -4
  78. package/dist/result-NvndYzCb.js +0 -483
  79. package/dist/session-stop-D_1SysjC.js +0 -1438
package/dist/app.js CHANGED
@@ -1,41 +1,41 @@
1
1
  import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-BRTJqumy.js";
2
- import { Ai as slackMention, Br as bindScheduledAutomationCredentialSubject, C as settleConversationTitleWork, Cn as setExperimentalFeatures, Co as createPluginCache, Ct as isInvalidConversationRecordError, Fr as findMatchingWatches, Ha as readConversationAccessFromSql, Hi as slackEntitySchema, Hn as setBriefsConfig, Hr as verifyEventAutomationCredentialSubject, Ii as openSlackModal, Ji as getSlackClient, Li as postSlackEphemeralMessage, Ln as getPlugins, Mn as getPluginRoutes, Mo as setConfigDefaults, Qr as setDashboardConversationLinkOptions, Rn as setPlugins, Rr as takeDueTimerWatches, Sn as isExperimentalFeatureEnabled, Ui as slackExternalRefIdSchema, Ur as verifyScheduledAutomationCredentialSubject, Vr as bindSlackDirectCredentialSubject, Wr as verifySlackDirectCredentialSubject, Xi as isDmChannel, Yr as getDashboardReviewItemLink, Zr as getDashboardTaskLink, _ as appendConversationMessages, ao as readConversationLastEventSeq, at as CONVERSATION_WORK_STALE_ENQUEUE_MS, b as projectConversationMessages, bi as proxyVercelSandboxEgressRequest, da as consumeSandboxEgressAuthRequiredSignal, dn as SubscribedReplyReason, ea as getWorkspaceTeamId, ei as createPluginState, er as dismissOpenReviewItems, fa as consumeSandboxEgressPermissionDeniedSignal, ho as resolveRootVisibility, jn as getPluginApiRoutes, jo as getConfigDefaults, jr as collectEventMatchKeys, ma as parseSandboxEgressCredentialToken, mn as getThreadStopDecision, no as readConversationEventPage, oo as readConversationMessageEventSeq, or as searchReviewItems, qr as getDashboardConversationLink, ro as readConversationEventPageAfter, ta as runWithWorkspaceTeamId, ua as clearSandboxEgressSignals, ur as canActOnReviewItem, va as normalizeSandboxEgressTracePropagationDomains, vo as listConversationAnnotations, vr as reviewItemReaderForUser, wa as createPluginEmbedder, wi as resolveBaseUrl, wn as createUserTokenStore, xn as getExperimentalFeatures, xt as hasRunnableConversationWork, yi as isVercelSandboxEgressRequest, za as createPluginLogger, zn as validatePlugins, zr as bindEventAutomationCredentialSubject } from "./projection-0UcUeuzn.js";
3
- import { d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig, y as getAttachmentStorage } from "./config-Dt3CpG17.js";
4
- import { E as withSpan, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, T as withLogContext, U as normalizeIdentityEmail, V as GOOGLE_IDENTITY_PROVIDER, b as setSpanAttributes, h as logWarn, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-Qo-7xGp1.js";
5
- import { t as JUNIOR_VERSION } from "./version-i1An1eTS.js";
2
+ import { $i as slackEntitySchema, $r as verifyEventAutomationCredentialSubject, Ai as isVercelSandboxEgressRequest, Bo as setConfigDefaults, Ca as consumeSandboxEgressPermissionDeniedSignal, Co as resolveRootVisibility, Ct as hasRunnableConversationWork, Eo as listConversationAnnotations, Fa as createPluginEmbedder, Fi as resolveBaseUrl, Hn as getPluginRoutes, Hr as collectEventMatchKeys, Ji as postSlackEphemeralMessage, Jn as setPlugins, Kr as findMatchingWatches, Mn as isExperimentalFeatureEnabled, Nn as setExperimentalFeatures, Pn as createUserTokenStore, Qa as readConversationAccessFromSql, Qn as setBriefsConfig, Qr as bindSlackDirectCredentialSubject, Sa as consumeSandboxEgressAuthRequiredSignal, Ta as parseSandboxEgressCredentialToken, Tt as isInvalidConversationRecordError, Vi as slackMention, Vn as getPluginApiRoutes, Xr as bindEventAutomationCredentialSubject, Ya as createPluginLogger, Yn as validatePlugins, Yr as takeDueTimerWatches, Zr as bindScheduledAutomationCredentialSubject, _ as appendConversationMessages, _r as searchReviewItems, aa as getSlackClient, ci as getDashboardTaskLink, da as getWorkspaceTeamId, di as createPluginState, do as readConversationEventPageAfter, ea as slackExternalRefIdSchema, ei as verifyScheduledAutomationCredentialSubject, fa as runWithWorkspaceTeamId, ii as getDashboardConversationLink, ji as proxyVercelSandboxEgressRequest, jn as getExperimentalFeatures, jo as createPluginCache, ka as normalizeSandboxEgressTracePropagationDomains, kr as reviewItemReaderForUser, li as setDashboardConversationLinkOptions, mo as readConversationMessageEventSeq, oi as getDashboardReviewItemLink, ot as CONVERSATION_WORK_STALE_ENQUEUE_MS, po as readConversationLastEventSeq, qi as openSlackModal, qn as getPlugins, sa as isDmChannel, ti as verifySlackDirectCredentialSubject, uo as readConversationEventPage, ur as dismissOpenReviewItems, w as settleConversationTitleWork, wn as getThreadStopDecision, x as projectConversationMessages, xa as clearSandboxEgressSignals, xn as SubscribedReplyReason, xr as canActOnReviewItem, zo as getConfigDefaults } from "./projection-DliWYrnT.js";
3
+ import { d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig, y as getAttachmentStorage } from "./config-DqFnykQT.js";
4
+ import { E as withSpan, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, T as withLogContext, U as normalizeIdentityEmail, V as GOOGLE_IDENTITY_PROVIDER, b as setSpanAttributes, h as logWarn, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-BfORLKoq.js";
5
+ import { t as JUNIOR_VERSION } from "./version-DSk8CFvA.js";
6
6
  import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
7
- import { C as getSqlExecutor, H as recordGoogleSignIn, I as resolveActorIdentityId, M as withConversationMutationLock, S as getDb, Y as touchConversationDetail, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationEventLock, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-BlpnzZZa.js";
8
- import { P as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorConversations, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-CyIwHz9r.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-dKOVbR7l.js";
10
- import { $ as readViewerAutomations, A as runWithSlackInstallation, B as logScheduledAutomationRunSkipped, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, Dt as processWorkspaceSnapshotJob, E as buildSlackReviewItemModal, L as joinPublicChannel, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as ingestEvent, S as createSlackReviewItemShow, V as scheduledAutomationRunAttributes, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, _ as readPublicArtifact, _t as requestAttachmentDeletion, at as reviewItemChangeRecord, bt as stopConversationSession, ct as conversationTurnIdForMessage, dt as recordWebConversationActivity, ft as webActorFromUser, g as publicArtifactHeaders, ht as collectAttachmentGarbage, it as renderReviewItemMessage, j as verifySlackSignature, k as parseSlackUserInputSubmission, n as executeAgentRun, q as ViewerTaskNotFoundError, r as processBackgroundCompaction, rt as deliverReviewItemChange, st as appendAndEnqueueWebMessage, t as createAgentRunner, tt as effectiveTaskOutcomes, v as unpublishedArtifactHeaders, w as syncReviewItemSlackCards, xt as recordSubagentEnded, y as lookupSlackUserProfile } from "./agent-runner-Cqr21pOU.js";
7
+ import { C as getSqlExecutor, I as withConversationMutationLock, S as getDb, U as resolveActorIdentityId, Y as recordGoogleSignIn, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationEventLock, l as resolveViewerUser, lt as createSlackDestination, nt as touchConversationDetail, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-1Ea81s0b.js";
8
+ import { P as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorConversations, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-BLEMIgIZ.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bte6jRB2.js";
10
+ import { $ as readViewerAutomationSummary, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, Ct as recordSubagentEnded, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, M as parseSlackThreadId, Mt as processWorkspaceSnapshotJob, Nt as ingestEvent, O as parseSlackReviewItemFormTarget, S as createSlackReviewItemShow, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as readPublicArtifact, _t as collectAttachmentGarbage, at as deliverReviewItemChange, g as publicArtifactHeaders, j as verifySlackSignature, k as parseSlackUserInputSubmission, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, ot as renderReviewItemMessage, pt as recordWebConversationActivity, r as processBackgroundCompaction, rt as effectiveTaskOutcomes, st as reviewItemChangeRecord, t as createAgentRunner, tt as readViewerAutomations, ut as conversationTurnIdForMessage, v as unpublishedArtifactHeaders, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, yt as requestAttachmentDeletion, z as joinPublicChannel } from "./agent-runner-BsWhHe4N.js";
11
11
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
12
- import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-CW5UW7vL.js";
12
+ import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-DN5AB4VU.js";
13
13
  import { a as getNextRunAtMs } from "./schedule-BTp__wrw.js";
14
- import { H as conversationBriefSchema, b as conversationSurfaceSchema, f as conversationFeedQuerySchema, k as annotationCard, v as conversationReportStatusSchema } from "./conversation-DdT7SNar.js";
14
+ import { G as conversationBriefSchema, j as annotationCard, p as conversationFeedQuerySchema, x as conversationSurfaceSchema, y as conversationReportStatusSchema } from "./conversation-D8kVoCrP.js";
15
15
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
16
- import { S as listPendingAgentInvocationResults, x as listPendingAgentInvocationMailboxAppends } from "./store-G3S0kWSD.js";
17
- import { A as renderSlackObjectCard, T as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-D_1SysjC.js";
18
- import { h as buttonUserInputField } from "./reporting-window-B-QP9zX1.js";
19
- import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-Di3omymY.js";
20
- import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, b as isConversationQueueMessageRejectedError, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, h as getQueueProvider, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, y as conversationQueueMessageSchema } from "./background-compaction-queue-CHFzrQbS.js";
21
- import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-ymkEUWe4.js";
22
- import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-D_GXfcAG.js";
23
- import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-Zvx_I9Z5.js";
24
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DJG_wrg2.js";
16
+ import { f as listPendingAgentInvocationMailboxAppends, p as listPendingAgentInvocationResults } from "./store-B26LV6UP.js";
17
+ import { A as slackChannelMessageReplyThreadTs, D as SLACK_EVENT_NAMESPACE, E as getEventCatalog, H as renderSlackObjectCard, L as renderTaskInput, j as slackChannelMessageRunsAutomation, k as slackChannelMessageEvent, u as getAuthPausedConversationTurnId } from "./session-stop-CA-jOJ84.js";
18
+ import { g as buttonUserInputField } from "./reporting-window-B4TwyuJo.js";
19
+ import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-Biu8Qw3u.js";
20
+ import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, b as isConversationQueueMessageRejectedError, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, h as getQueueProvider, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, y as conversationQueueMessageSchema } from "./background-compaction-queue-DXkLsWoH.js";
21
+ import { C as removeActiveConversation, _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, v as hasRunnableConversationWork$1, y as listActiveConversationIds } from "./store-Dn4W7qgH.js";
22
+ import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-CGMKrYOj.js";
23
+ import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-Mk8aaHzy.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-TzhfQABF.js";
25
25
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-HYh_JOdw.js";
26
- import { a as conversationPendingMessageDeliverySchema } from "./conversation-pending-messages-Dct5pheX.js";
27
- import { $ as reviewItemChange, A as createSlackWebApiStatusSender, B as stopSlackThread, C as readConversationPendingMessages, D as createProductionConversationWorkOptions, E as archiveConversation, F as resolveAllowedDomains, G as bindMessageAuthorIdentityId, H as withNormalizedThreadId, I as recordSkippedConversationMessage, J as parseContent, K as startProcessingReaction, L as buildSlackInboundMessage, M as isAllowedDomain, N as isAllowedSignInEmail, O as createProductionSlackWebhookServices, P as readEnvList, Q as readReviewItemForUser, R as clearSlackPendingReactions, S as cancelConversationPendingMessagesForViewer, U as stopConversationTurn, V as normalizeIncomingSlackThreadId, W as THREAD_OPTOUT_ACK, X as actOnReviewItem, Y as ReviewItemActionError, Z as closeReviewItemsAnsweredByReply, a as readConversationDetail, b as decodeConversationCursor, d as readConversationFeed, dt as GET$4, f as readConversationRecordFromSql, it as setConversationAutoArchive, j as assertNoLegacyAllowedDomains, k as getProductionSlackAdapter, n as steerConversationPendingMessagesForViewer, q as stripLeadingBotMention, r as pinConversation, rt as runAutoArchiveSweep, s as markConversationRead, t as stopConversationTurnForViewer, tt as archiveViewerDoneConversations, ut as enqueueAgentDispatch, v as appendConversationMessageForViewer, x as encodeConversationCursor, y as createConversationForViewer, z as isSlackMessageStopped } from "./stop-BSKRTaRS.js";
28
- import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-NvndYzCb.js";
29
- import { i as enqueueAgentInvocation, r as endAgentInvocationsOfStoppedWork } from "./work-BgCW3FDC.js";
30
- import { o as coerceThreadConversationState } from "./thread-state-D6rNGQu9.js";
31
- import { o as unlinkProvider } from "./connections-CCHPybZP.js";
32
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-BBPw8dam.js";
26
+ import { a as conversationPendingMessageDeliverySchema } from "./conversation-pending-messages-BvROq1bq.js";
27
+ import { $ as actOnReviewItem, A as archiveConversation, B as startProcessingReaction, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as assertNoLegacyAllowedDomains, G as normalizeIncomingSlackThreadId, H as clearSlackPendingReactions, I as isAllowedDomain, J as stopConversation, K as withNormalizedThreadId, L as isAllowedSignInEmail, M as createProductionConversationWorkOptions, N as createProductionSlackWebhookServices, P as getProductionSlackAdapter, Q as ReviewItemActionError, R as readEnvList, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as slackInboundMessageId, V as buildSlackInboundMessage, W as stripLeadingBotMention, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, b as readConversationRecordFromSql, et as closeReviewItemsAnsweredByReply, i as readConversationFeed, it as archiveViewerDoneConversations, j as markConversationRead, mt as GET$4, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as runAutoArchiveSweep, pt as enqueueAgentDispatch, q as createSlackWebApiStatusSender, s as readConversationDetail, st as setConversationAutoArchive, t as stopConversationTurnForViewer, tt as readReviewItemForUser, w as decodeConversationCursor, z as resolveAllowedDomains } from "./stop-DioIcEAu.js";
28
+ import { i as enqueueAgentInvocation, r as endAgentInvocationsOfStoppedWork } from "./work-ybG4_q5C.js";
29
+ import { o as coerceThreadConversationState } from "./thread-state-CrFk3K_7.js";
30
+ import { n as enqueueAgentInvocationResult } from "./result-DxJMCX47.js";
31
+ import { o as unlinkProvider } from "./connections-DA4LT9LL.js";
32
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-hcsYatw-.js";
33
33
  import { t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
34
- import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-BcOHzXxe.js";
35
- import { t as processConversationWork } from "./worker-BJz1mwYt.js";
36
- import { t as bindMessageAgent } from "./message-DFbtOWqv.js";
37
- import { t as bindSpawnAgent } from "./spawn-D5D2MQdz.js";
38
- import { t as processPluginTask } from "./task-runner-B65cDumh.js";
34
+ import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-Bt0IoR2i.js";
35
+ import { t as processConversationWork } from "./worker-ccSyZRNz.js";
36
+ import { t as bindMessageAgent } from "./message-DqjuKzUx.js";
37
+ import { t as bindSpawnAgent } from "./spawn-BB2_4VYn.js";
38
+ import { t as processPluginTask } from "./task-runner-D8lddjzp.js";
39
39
  import { createRequire } from "node:module";
40
40
  import { Hono } from "hono";
41
41
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -2088,6 +2088,100 @@ async function handleSlackForm(args) {
2088
2088
  })));
2089
2089
  return new Response("", { status: 200 });
2090
2090
  }
2091
+ // src/chat/ingress/slack-skipped-message.ts
2092
+ /**
2093
+ * Save a Slack message that starts no Turn as a skipped Message, so later
2094
+ * Turns see it. A redelivery saves nothing new: the Message id is the
2095
+ * idempotency key.
2096
+ */
2097
+ async function saveSkippedSlackMessage(args) {
2098
+ const conversation = coerceThreadConversationState(void 0);
2099
+ recordSkippedConversationMessage({
2100
+ conversation,
2101
+ message: args.message,
2102
+ skippedReason: args.skippedReason,
2103
+ text: parseContent(args.message).text
2104
+ });
2105
+ await appendConversationMessages(getConversationEventStore(), {
2106
+ conversation,
2107
+ conversationId: args.conversationId
2108
+ });
2109
+ }
2110
+ // src/chat/ingress/slack-stop.ts
2111
+ /** Acknowledge a Slack stop. */
2112
+ const SLACK_STOP_ACK = "Stopped.";
2113
+ /**
2114
+ * Claim Slack's native stop button press. Slack sends a retry with the same
2115
+ * `event_ts`, so the claim dedupes it, and the press time is the stop time.
2116
+ */
2117
+ function slackStopButtonRequest(args) {
2118
+ return {
2119
+ conversationId: args.conversationId,
2120
+ createdAtMs: Math.floor(Number(args.eventTs) * 1e3),
2121
+ destination: createSlackDestination({
2122
+ channelId: args.channelId,
2123
+ teamId: args.installation.teamId
2124
+ }),
2125
+ inboundMessageId: slackInboundMessageId({
2126
+ conversationId: args.conversationId,
2127
+ installation: args.installation,
2128
+ slackId: `agent_session_stopped:${args.eventTs}`
2129
+ }),
2130
+ source: "slack"
2131
+ };
2132
+ }
2133
+ /**
2134
+ * Stop a Slack thread's Conversation for the `stop` keyword or Slack's native
2135
+ * agent stop button. The thread stays subscribed, and the next person input
2136
+ * that reaches the worker ends the stop. A keyword stop message is saved as
2137
+ * a skipped Message and never enters the mailbox. Slack does not leave the
2138
+ * `processing` status by itself, so clear the status even when no work runs.
2139
+ *
2140
+ * Slack sends one mention as both `message` and `app_mention`, and it retries
2141
+ * events. The stop claims its `inboundMessageId` in the mailbox, the same
2142
+ * duplicate guard that ordinary messages get, so a second delivery stops
2143
+ * nothing and posts no ack. The keyword uses its message id and the button
2144
+ * its `event_ts`. This replaces the old stop watermark's duplicate guard.
2145
+ * https://docs.slack.dev/reference/events/agent_session_stopped
2146
+ */
2147
+ async function handleSlackStop(args) {
2148
+ if (args.stopMessage) await saveSkippedSlackMessage({
2149
+ conversationId: args.conversationId,
2150
+ message: args.stopMessage.message,
2151
+ skippedReason: `${SubscribedReplyReason.ThreadOptOut}:${args.stopMessage.stopReason}`
2152
+ });
2153
+ let duplicate = false;
2154
+ let stopped;
2155
+ try {
2156
+ stopped = await stopConversation({
2157
+ conversationId: args.conversationId,
2158
+ conversationStore: args.conversationStore,
2159
+ message: args.request,
2160
+ queue: args.queue,
2161
+ state: args.state
2162
+ });
2163
+ duplicate = stopped.status === "duplicate";
2164
+ } finally {
2165
+ if (!duplicate) await createSlackWebApiStatusSender({
2166
+ channelId: args.slackThread?.channelId,
2167
+ threadTs: args.slackThread?.threadTs
2168
+ })("");
2169
+ }
2170
+ if (stopped.status === "duplicate") return;
2171
+ if (stopped.status === "requested") await clearSlackPendingReactions({
2172
+ getSlackAdapter: () => args.adapter,
2173
+ messages: stopped.pendingMessages,
2174
+ state: args.state
2175
+ });
2176
+ if (!args.stopMessage && stopped.status !== "requested") return;
2177
+ await new ThreadImpl({
2178
+ adapter: args.adapter,
2179
+ stateAdapter: args.state,
2180
+ id: args.canonicalThreadId,
2181
+ channelId: args.adapter.channelIdFromThreadId(args.canonicalThreadId),
2182
+ isDM: args.adapter.isDM(args.canonicalThreadId)
2183
+ }).post(SLACK_STOP_ACK);
2184
+ }
2091
2185
  // src/chat/ingress/slack-message-subtypes.ts
2092
2186
  const IGNORED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
2093
2187
  "message_changed",
@@ -2228,6 +2322,8 @@ function eventInput(task, event, outcomes, catalog) {
2228
2322
  const guidance = eventGuidance(catalog, event.namespace, event.eventType);
2229
2323
  return renderTaskInput({
2230
2324
  about: task.trigger.label,
2325
+ event: event.eventType,
2326
+ source: event.namespace,
2231
2327
  creator: slackMention(task.createdBy.slackUserId),
2232
2328
  instructions: task.task.text,
2233
2329
  outcomes,
@@ -2584,6 +2680,25 @@ async function resolveSlackConversationId(args) {
2584
2680
  providerConversationId: providerThread.threadTs
2585
2681
  }) ?? args.canonicalThreadId;
2586
2682
  }
2683
+ /**
2684
+ * Build the mailbox input for one Slack message. A message and a `stop` get
2685
+ * the same `inboundMessageId`, so each Slack message is handled once.
2686
+ */
2687
+ async function buildSlackInput(args) {
2688
+ const thread = await buildThread(args);
2689
+ return {
2690
+ inbound: buildSlackInboundMessage({
2691
+ conversationId: args.conversationId,
2692
+ installation: args.installation,
2693
+ reviewItemChange: args.facts?.reviewItemChange,
2694
+ message: args.message,
2695
+ receivedAtMs: args.receivedAtMs,
2696
+ route: args.route,
2697
+ thread
2698
+ }),
2699
+ thread
2700
+ };
2701
+ }
2587
2702
  async function persistSlackMessage(args) {
2588
2703
  const canonicalThreadId = normalizeIncomingSlackThreadId(args.message.threadId, args.message);
2589
2704
  const conversationId = args.conversationId ?? await resolveSlackConversationId({
@@ -2591,26 +2706,16 @@ async function persistSlackMessage(args) {
2591
2706
  conversationStore: args.conversationStore,
2592
2707
  installation: args.installation
2593
2708
  });
2594
- const thread = await buildThread(args);
2595
- const inbound = buildSlackInboundMessage({
2596
- conversationId,
2597
- installation: args.installation,
2598
- reviewItemChange: args.facts?.reviewItemChange,
2599
- message: args.message,
2600
- receivedAtMs: args.receivedAtMs,
2601
- route: args.route,
2602
- thread
2709
+ const { inbound, thread } = await buildSlackInput({
2710
+ ...args,
2711
+ conversationId
2603
2712
  });
2604
2713
  const work = await getConversationWorkState({
2605
2714
  conversationId,
2606
2715
  state: args.state
2607
2716
  });
2608
2717
  let receipt;
2609
- if (args.route === "mention" && !work?.execution.inboundMessageIds.includes(inbound.inboundMessageId) && !await isSlackMessageStopped({
2610
- messageCreatedAtMs: args.message.metadata.dateSent.getTime(),
2611
- state: args.state,
2612
- threadId: canonicalThreadId
2613
- })) receipt = await startProcessingReaction({
2718
+ if (args.route === "mention" && !work?.execution.inboundMessageIds.includes(inbound.inboundMessageId)) receipt = await startProcessingReaction({
2614
2719
  message: args.message,
2615
2720
  thread,
2616
2721
  timeoutMs: 1e3
@@ -2629,102 +2734,6 @@ async function persistSlackMessage(args) {
2629
2734
  throw new SlackEventPersistenceError(error, kept);
2630
2735
  });
2631
2736
  }
2632
- /**
2633
- * Interrupt the active Run, stop the session, unsubscribe, and record
2634
- * the stop message in history. Stop input never enters the mailbox, so a
2635
- * mention-route stop cannot resubscribe the thread by starting a new Turn.
2636
- *
2637
- * A late or stale stop that a newer mention already superseded is a no-op:
2638
- * cancelling the Turn or posting the ack here would clobber that mention.
2639
- */
2640
- async function handleSlackThreadStop(args) {
2641
- const thread = await buildThread(args);
2642
- const conversationId = await resolveSlackConversationId({
2643
- canonicalThreadId: args.canonicalThreadId,
2644
- conversationStore: args.conversationStore,
2645
- installation: args.installation
2646
- });
2647
- const work = await getConversationWorkState({
2648
- conversationId,
2649
- state: args.state
2650
- });
2651
- const { applied } = await stopSlackThread({
2652
- state: args.state,
2653
- stoppedAtMs: args.message.metadata.dateSent.getTime(),
2654
- thread
2655
- });
2656
- if (!applied) return;
2657
- await stopConversationTurn({
2658
- conversationId,
2659
- conversationStore: args.conversationStore,
2660
- queue: args.queue,
2661
- state: args.state
2662
- });
2663
- await clearSlackPendingReactions({
2664
- getSlackAdapter: () => args.adapter,
2665
- messages: work?.execution.pendingMessages ?? [],
2666
- state: args.state
2667
- });
2668
- await stopConversationSession({
2669
- conversationId,
2670
- state: args.state
2671
- });
2672
- await bindSlackAuthorIdentity(args.message, args.installation);
2673
- const content = parseContent(args.message);
2674
- const conversation = coerceThreadConversationState(void 0);
2675
- recordSkippedConversationMessage({
2676
- conversation,
2677
- message: args.message,
2678
- skippedReason: `${SubscribedReplyReason.ThreadOptOut}:${args.stopReason}`,
2679
- text: content.text
2680
- });
2681
- await appendConversationMessages(getConversationEventStore(), {
2682
- conversation,
2683
- conversationId
2684
- });
2685
- await thread.post(THREAD_OPTOUT_ACK);
2686
- }
2687
- /** Acknowledge a native Slack stop that interrupted active work. */
2688
- const SLACK_SESSION_STOP_ACK = "Stopped.";
2689
- /**
2690
- * Stop the active Turn when a user clicks Slack's native agent stop button.
2691
- *
2692
- * Unlike the `stop` keyword, this only interrupts current work. The thread
2693
- * stays subscribed and resource watches stay active. Slack does not leave the
2694
- * `processing` status by itself, so clear the status even when no work runs.
2695
- * https://docs.slack.dev/reference/events/agent_session_stopped
2696
- */
2697
- async function handleSlackSessionStop(args) {
2698
- const canonicalThreadId = `slack:${args.channelId}:${args.threadTs}`;
2699
- const conversationId = await resolveSlackConversationId({
2700
- canonicalThreadId,
2701
- conversationStore: args.conversationStore,
2702
- installation: args.installation
2703
- });
2704
- const stopped = await stopConversationTurn({
2705
- conversationId,
2706
- conversationStore: args.conversationStore,
2707
- queue: args.queue,
2708
- state: args.state
2709
- });
2710
- await createSlackWebApiStatusSender({
2711
- channelId: args.channelId,
2712
- threadTs: args.threadTs
2713
- })("");
2714
- if (stopped.status !== "requested") return;
2715
- await clearSlackPendingReactions({
2716
- getSlackAdapter: () => args.adapter,
2717
- messages: stopped.pendingMessages,
2718
- state: args.state
2719
- });
2720
- await new ThreadImpl({
2721
- adapter: args.adapter,
2722
- stateAdapter: args.state,
2723
- id: canonicalThreadId,
2724
- channelId: args.adapter.channelIdFromThreadId(canonicalThreadId),
2725
- isDM: args.adapter.isDM(canonicalThreadId)
2726
- }).post(SLACK_SESSION_STOP_ACK);
2727
- }
2728
2737
  async function routeParsedMessage(args) {
2729
2738
  if (shouldIgnoreMessage(args.message)) return;
2730
2739
  const normalized = normalizeMessageThreadId(args.message);
@@ -2762,20 +2771,6 @@ async function routeParsedMessage(args) {
2762
2771
  text: args.event.text ?? "",
2763
2772
  isExplicitMention: isMention
2764
2773
  });
2765
- if (stopDecision) {
2766
- await handleSlackThreadStop({
2767
- adapter: args.adapter,
2768
- canonicalThreadId,
2769
- conversationStore: args.conversationStore,
2770
- installation: args.installation,
2771
- message,
2772
- queue: args.queue,
2773
- route,
2774
- state: args.state,
2775
- stopReason: stopDecision.reasonDetail ?? stopDecision.reason
2776
- });
2777
- return;
2778
- }
2779
2774
  const isAuthorDomainAllowed = () => isSlackAuthorDomainAllowed({
2780
2775
  allowedBotUserIds: args.allowedBotUserIds,
2781
2776
  allowedDomains: args.allowedDomains,
@@ -2783,25 +2778,44 @@ async function routeParsedMessage(args) {
2783
2778
  teamId: args.installation.teamId,
2784
2779
  user: args.event.user
2785
2780
  });
2786
- if (route === "mention" && !await isAuthorDomainAllowed()) return;
2781
+ if (!stopDecision && route === "mention" && !await isAuthorDomainAllowed()) return;
2787
2782
  await bindSlackAuthorIdentity(message, args.installation);
2788
2783
  const conversationId = await resolveSlackConversationId({
2789
2784
  canonicalThreadId,
2790
2785
  conversationStore: args.conversationStore,
2791
2786
  installation: args.installation
2792
2787
  });
2793
- if (isSubscribed && !isExperimentalFeatureEnabled("passive-routing")) {
2794
- const content = parseContent(message);
2795
- const conversation = coerceThreadConversationState(void 0);
2796
- recordSkippedConversationMessage({
2797
- conversation,
2788
+ if (stopDecision) {
2789
+ const { inbound } = await buildSlackInput({
2790
+ adapter: args.adapter,
2791
+ conversationId,
2792
+ installation: args.installation,
2798
2793
  message,
2799
- skippedReason: `${SubscribedReplyReason.PassiveDisabled}:passive-routing`,
2800
- text: content.text
2794
+ receivedAtMs: args.receivedAtMs,
2795
+ route,
2796
+ state: args.state
2801
2797
  });
2802
- await appendConversationMessages(getConversationEventStore(), {
2803
- conversation,
2804
- conversationId
2798
+ await handleSlackStop({
2799
+ adapter: args.adapter,
2800
+ canonicalThreadId,
2801
+ conversationId,
2802
+ conversationStore: args.conversationStore,
2803
+ queue: args.queue,
2804
+ request: inbound,
2805
+ slackThread: parseSlackThreadId(canonicalThreadId),
2806
+ state: args.state,
2807
+ stopMessage: {
2808
+ message,
2809
+ stopReason: stopDecision.reasonDetail ?? stopDecision.reason
2810
+ }
2811
+ });
2812
+ return;
2813
+ }
2814
+ if (isSubscribed && !isExperimentalFeatureEnabled("passive-routing")) {
2815
+ await saveSkippedSlackMessage({
2816
+ conversationId,
2817
+ message,
2818
+ skippedReason: `${SubscribedReplyReason.PassiveDisabled}:passive-routing`
2805
2819
  });
2806
2820
  return;
2807
2821
  }
@@ -2902,15 +2916,32 @@ async function handleSlackEvent(args) {
2902
2916
  if (!await isSlackWorkspaceMember(event, state)) return;
2903
2917
  const channelId = event.channel;
2904
2918
  const threadTs = event.thread_ts;
2905
- if (!(await withLock(state, `slack:ingress:slack:${channelId}:${threadTs}`, () => handleSlackSessionStop({
2906
- adapter,
2907
- channelId,
2908
- conversationStore: args.services.conversationStore,
2909
- installation,
2910
- queue: args.services.queue,
2911
- state,
2912
- threadTs
2913
- }), {
2919
+ if (!(await withLock(state, `slack:ingress:slack:${channelId}:${threadTs}`, async () => {
2920
+ const canonicalThreadId = `slack:${channelId}:${threadTs}`;
2921
+ const conversationId = await resolveSlackConversationId({
2922
+ canonicalThreadId,
2923
+ conversationStore: args.services.conversationStore,
2924
+ installation
2925
+ });
2926
+ await handleSlackStop({
2927
+ adapter,
2928
+ canonicalThreadId,
2929
+ conversationId,
2930
+ conversationStore: args.services.conversationStore,
2931
+ queue: args.services.queue,
2932
+ request: event.event_ts ? slackStopButtonRequest({
2933
+ channelId,
2934
+ conversationId,
2935
+ eventTs: event.event_ts,
2936
+ installation
2937
+ }) : void 0,
2938
+ slackThread: {
2939
+ channelId,
2940
+ threadTs
2941
+ },
2942
+ state
2943
+ });
2944
+ }, {
2914
2945
  keepAlive: true,
2915
2946
  waitMs: 1e4
2916
2947
  })).acquired) throw new Error("Could not acquire Slack ingress lock");
@@ -3405,7 +3436,7 @@ function createAcpConversations(options) {
3405
3436
  return {
3406
3437
  async cancel({ conversationId, user }) {
3407
3438
  if (!await hasConversationAccess(conversationId, user)) return "not_found";
3408
- const stopped = await stopConversationTurn({
3439
+ const stopped = await stopConversation({
3409
3440
  conversationId,
3410
3441
  conversationStore: options.conversationStore,
3411
3442
  queue: options.queue,
@@ -6001,13 +6032,13 @@ async function handleMcpConsentPage(args) {
6001
6032
  const mcpConversationSchema = z.object({
6002
6033
  conversationId: z.string(),
6003
6034
  title: z.string(),
6004
- status: conversationReportStatusSchema.describe("`active` while work runs, waits to start, or waits on you. `completed` when no work is left. `failed` when the last turn failed."),
6035
+ status: conversationReportStatusSchema.describe("`active` while work runs, waits to start, or waits on you. `completed` when no work is left. `failed` when the last turn failed. `stopped` after a person or a parent agent stopped it, until a person sends it input or its parent gives it new work."),
6005
6036
  surface: conversationSurfaceSchema.describe("Where it started: `slack`, `api` (the dashboard or MCP), `scheduler` (an automation), or `internal`."),
6006
6037
  channelName: z.string().optional().describe("Slack channel name."),
6007
6038
  locationUrl: z.string().optional().describe("Slack thread link."),
6008
6039
  startedAt: z.string(),
6009
6040
  lastSeenAt: z.string().describe("Time of the newest activity. archiveConversation takes this value."),
6010
- archivedAt: z.string().optional().describe("Set when you archived it."),
6041
+ archivedAt: z.string().optional().describe("Set when you archived it, or when anyone archived a Thread."),
6011
6042
  pinnedAt: z.string().optional().describe("Set when you pinned it."),
6012
6043
  url: z.string().optional().describe("Dashboard link.")
6013
6044
  }).strict();
@@ -6022,7 +6053,7 @@ function mcpConversation(summary) {
6022
6053
  locationUrl: summary.locationUrl,
6023
6054
  startedAt: summary.startedAt,
6024
6055
  lastSeenAt: summary.lastSeenAt,
6025
- archivedAt: summary.archivedAt ?? void 0,
6056
+ archivedAt: (summary.kind !== "root" ? summary.childArchivedAt : summary.archivedAt) ?? void 0,
6026
6057
  pinnedAt: summary.pinnedAt ?? void 0,
6027
6058
  url: getDashboardConversationLink(summary.conversationId)
6028
6059
  };
@@ -6197,14 +6228,18 @@ async function isConversationParticipant(user, conversationId) {
6197
6228
  return (await readConversationAccessFromSql(getDb(), [conversationId], user)).get(conversationId)?.isParticipant ?? false;
6198
6229
  }
6199
6230
  // src/api/mcp/tools/archive-conversation.ts
6200
- /** Register `archiveConversation`, which archives or restores for the user. */
6231
+ /**
6232
+ * Register `archiveConversation`. It archives or restores a root for the
6233
+ * user, or a child Conversation and optionally its children for everyone.
6234
+ */
6201
6235
  function registerArchiveConversationTool(server, { user }) {
6202
6236
  server.registerTool("archiveConversation", {
6203
6237
  title: "Archive conversation",
6204
- description: "Archive one of your conversations, or restore it. Archiving hides it only for you, and new activity restores it.",
6238
+ description: "Archive one of your conversations, or restore it. Archiving a top-level conversation hides it and its child conversations only for you, and writes nothing to the children. Archiving a child conversation, a Thread or a Task, hides it and its children for everyone. A child restore fails while a conversation above it is archived. A new message from a person restores a child and the archived conversations above it.",
6205
6239
  inputSchema: {
6206
6240
  conversationId: mcpConversationIdSchema,
6207
6241
  archived: z.boolean().default(true).describe("False restores an archived conversation."),
6242
+ applyToChildren: z.boolean().default(false).describe("Child conversations only. On archive, true also archives every child of this conversation at any depth; without it, a child archive fails while any of its children is not archived. On restore, true also restores the children that were archived with this conversation. Ignored for a top-level conversation."),
6208
6243
  lastSeenAt: z.string().datetime().describe("`lastSeenAt` from searchConversations or getConversation. The archive fails when the conversation has newer activity.")
6209
6244
  },
6210
6245
  outputSchema: { archivedAt: z.string().nullable().describe("Null when the conversation is not archived.") },
@@ -6214,9 +6249,10 @@ function registerArchiveConversationTool(server, { user }) {
6214
6249
  openWorldHint: false,
6215
6250
  readOnlyHint: false
6216
6251
  }
6217
- }, async ({ archived, conversationId, lastSeenAt }) => {
6252
+ }, async ({ applyToChildren, archived, conversationId, lastSeenAt }) => {
6218
6253
  try {
6219
6254
  return mcpToolResult(await archiveConversation(user, conversationId, {
6255
+ applyToChildren,
6220
6256
  archived,
6221
6257
  lastSeenAt
6222
6258
  }));
@@ -6233,7 +6269,7 @@ function registerArchiveConversationTool(server, { user }) {
6233
6269
  function registerArchiveDoneConversationsTool(server, { user }) {
6234
6270
  server.registerTool("archiveDoneConversations", {
6235
6271
  title: "Archive done conversations",
6236
- description: "Archive all of your conversations whose work is done, once. It skips pinned conversations, conversations with auto-archive off, and conversations that wait on you. Archiving hides them only for you.",
6272
+ description: "Archive all of your conversations whose work is done and that stayed quiet for your auto-archive wait time, once. It skips pinned conversations, conversations with auto-archive off, and conversations that wait on you. Archiving hides them only for you.",
6237
6273
  inputSchema: {},
6238
6274
  outputSchema: { archived: z.number().int().describe("Conversations archived.") },
6239
6275
  annotations: {
@@ -6872,14 +6908,17 @@ function registerSetConversationAutoArchiveTool(server, { user }) {
6872
6908
  });
6873
6909
  }
6874
6910
  // src/api/mcp/tools/stop-conversation.ts
6875
- /** Register `stopConversation`, which stops the active Turn. */
6911
+ /**
6912
+ * Register `stopConversation`, which stops the Conversation and every child
6913
+ * agent below it until the person sends the Conversation input.
6914
+ */
6876
6915
  function registerStopConversationTool(server, { queue, user }) {
6877
6916
  server.registerTool("stopConversation", {
6878
6917
  title: "Stop conversation",
6879
- description: "Stop the running turn of one of your conversations. Messages that wait for the turn are dropped. It starts no new work.",
6918
+ description: "Stop one of your conversations: its running turn and every child agent below it. Until you send the conversation a message, watch events of it and its child agents are saved to the conversation but start no turn. Messages that wait for the turn are dropped. It starts no new work.",
6880
6919
  inputSchema: { conversationId: mcpConversationIdSchema },
6881
6920
  outputSchema: {
6882
- status: z.enum(["no_work", "requested"]).describe("`requested` when the running turn was asked to stop. `no_work` when nothing was running."),
6921
+ status: z.enum(["no_work", "requested"]).describe("`requested` when the running turn was asked to stop. `no_work` when no turn was running. Child agents are stopped in both cases."),
6883
6922
  droppedMessages: z.number().int().describe("Messages that waited for the turn and were dropped.")
6884
6923
  },
6885
6924
  annotations: {
@@ -7456,6 +7495,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
7456
7495
  "/api/notifications",
7457
7496
  "/api/notifications/*",
7458
7497
  "/api/stats",
7498
+ "/api/versions",
7459
7499
  "/api/conversations",
7460
7500
  "/api/conversations/*",
7461
7501
  "/api/locations",
@@ -1,4 +1,4 @@
1
- import { Wt as extractAssistantText } from "./projection-0UcUeuzn.js";
1
+ import { Jt as extractAssistantText } from "./projection-DliWYrnT.js";
2
2
  // src/chat/no-reply.ts
3
3
  const NO_REPLY_MARKER = "[[NO_REPLY]]";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-BTp__wrw.js";
2
- import { r as actorIdentitySchema } from "./conversation-DdT7SNar.js";
2
+ import { i as actorIdentitySchema } from "./conversation-D8kVoCrP.js";
3
3
  import * as z from "zod";
4
4
  import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
5
5
  // src/chat/scheduled-automations/schedule-intent.ts
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-Dt3CpG17.js";
2
- import { E as withSpan, m as logInfo, p as logException } from "./logging-Qo-7xGp1.js";
1
+ import { i as getChatConfig } from "./config-DqFnykQT.js";
2
+ import { E as withSpan, m as logInfo, p as logException } from "./logging-BfORLKoq.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
5
5
  import * as z from "zod";