@sentry/junior 0.284.0 → 0.286.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 (84) hide show
  1. package/dist/{adapter-CW5UW7vL.js → adapter-JQZaJ-B_.js} +37 -3
  2. package/dist/{admin-DUWN8zZX.js → admin-Dm2bimJ-.js} +1 -1
  3. package/dist/{agent-runner-Cqr21pOU.js → agent-runner-DGCwOEyL.js} +2180 -2735
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +8 -7
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +166 -90
  8. package/dist/{app-CvGalMxi.d.ts → app-BKq0JzWx.d.ts} +2 -3
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +225 -188
  11. package/dist/{assistant-reply-CFE-OZMS.js → assistant-reply-CAPafcUY.js} +1 -1
  12. package/dist/{automation-Zvx_I9Z5.js → automation-B-jJN_gM.js} +1 -1
  13. package/dist/{background-compaction-queue-CHFzrQbS.js → background-compaction-queue-Btu2oab_.js} +137 -3
  14. package/dist/{briefs-Cx7mkfSk.js → briefs-UMeYehUe.js} +5 -5
  15. package/dist/{catalog-runtime-dKOVbR7l.js → catalog-runtime-Bym8GVdh.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 +5 -6
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +12 -17
  24. package/dist/{client-CMyH5rDz.js → client-B0aAs7wC.js} +2 -2
  25. package/dist/{config-Dt3CpG17.js → config-B9f9Lqo5.js} +1 -1
  26. package/dist/{connections-CCHPybZP.js → connections-CQ7p0aNJ.js} +16 -50
  27. package/dist/{conversation-DdT7SNar.js → conversation-BusI2uzj.js} +68 -7
  28. package/dist/{conversation-pending-messages-Dct5pheX.js → conversation-pending-messages-DwehU0Fd.js} +1 -1
  29. package/dist/{conversation-privacy-BpHHhEVp.js → conversation-privacy-Cd_nZZBM.js} +1 -1
  30. package/dist/{credential-sync-BBPw8dam.js → credential-sync-DmiJi_At.js} +13 -13
  31. package/dist/{db-D7CCwAo8.d.ts → db-C5zi4ecs.d.ts} +18 -2
  32. package/dist/{executor-CyIwHz9r.js → executor-Dipi2Ixl.js} +19 -17
  33. package/dist/instrumentation.js +2 -2
  34. package/dist/{logging-Qo-7xGp1.js → logging-CMFhLLj4.js} +1 -1
  35. package/dist/{media-Bu9C6lz0.js → media-B-BpXo41.js} +14 -2
  36. package/dist/{message-DFbtOWqv.js → message-D1xLljUF.js} +13 -23
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +2 -3
  39. package/dist/{oauth-callback-server-BB1gixWo.js → oauth-callback-server-DCAFIUQr.js} +2 -2
  40. package/dist/{projection-0UcUeuzn.js → projection-CoeMNxJ4.js} +545 -262
  41. package/dist/{prompt-CCtaGgbI.js → prompt-C9OQEfan.js} +8 -6
  42. package/dist/{registry-DOnPkI8g.js → registry-u-sFYtx_.js} +1 -1
  43. package/dist/{reporting-window-B-QP9zX1.js → reporting-window-B4TwyuJo.js} +14 -14
  44. package/dist/{resolve-Di3omymY.js → resolve-DYqgL3Eo.js} +3 -3
  45. package/dist/result-CescSwAw.js +299 -0
  46. package/dist/result-event-type-DD6BAgT7.js +11 -0
  47. package/dist/{runner-CnX_dTKw.js → runner-Cr67a8TB.js} +16 -12
  48. package/dist/{sandbox-egress-signals-CtxLJmmg.js → sandbox-egress-signals-DLOazy5W.js} +1 -1
  49. package/dist/{schema-Bn3miEd_.js → schema-BUSi3sgv.js} +63 -5
  50. package/dist/{schema-B017enNE.d.ts → schema-Ih60j59-.d.ts} +194 -220
  51. package/dist/{service-account-KhZIqXRi.js → service-account-CGEqz9wG.js} +3 -3
  52. package/dist/{service-account-ewDAx4Mx.js → service-account-CsKxktLk.js} +3 -3
  53. package/dist/session-stop-CGz5DByb.js +2926 -0
  54. package/dist/{skills-CKyotM4g.js → skills-COCqf61f.js} +2 -2
  55. package/dist/{spawn-D5D2MQdz.js → spawn-C8F_iXWO.js} +13 -2
  56. package/dist/{stop-BSKRTaRS.js → stop-GyFZkHuQ.js} +7730 -7818
  57. package/dist/{store-ymkEUWe4.js → store-D0-8plWp.js} +30 -5
  58. package/dist/{turn-session-routing-D_GXfcAG.js → task-runner-xPuQmEot.js} +1440 -994
  59. package/dist/{store-G3S0kWSD.js → turn-failure-response-BOviBdT-.js} +404 -311
  60. package/dist/{validation-DJG_wrg2.js → validation-DZDKorGz.js} +1 -1
  61. package/dist/{version-i1An1eTS.js → version-BTIz7fGi.js} +1 -1
  62. package/dist/version.js +1 -1
  63. package/dist/{viewer-BlpnzZZa.js → viewer-CH-ASQzh.js} +208 -68
  64. package/dist/{work-BgCW3FDC.js → work-C75_IM5e.js} +311 -100
  65. package/dist/{worker-BJz1mwYt.js → worker-Dl47I729.js} +6 -6
  66. package/migrations/0083_conversation_kind.sql +11 -0
  67. package/migrations/0084_read_position_backfill.sql +25 -0
  68. package/migrations/0085_child_archived_at.sql +1 -0
  69. package/migrations/0086_shared_archive.sql +31 -0
  70. package/migrations/0087_child_location.sql +64 -0
  71. package/migrations/meta/0083_snapshot.json +4388 -0
  72. package/migrations/meta/0084_snapshot.json +4388 -0
  73. package/migrations/meta/0085_snapshot.json +4394 -0
  74. package/migrations/meta/0086_snapshot.json +4366 -0
  75. package/migrations/meta/0087_snapshot.json +4366 -0
  76. package/migrations/meta/_journal.json +35 -0
  77. package/package.json +5 -4
  78. package/dist/result-NvndYzCb.js +0 -483
  79. package/dist/session-stop-D_1SysjC.js +0 -1438
  80. package/dist/task-queue-BcOHzXxe.js +0 -139
  81. package/dist/task-runner-B65cDumh.js +0 -290
  82. package/dist/thread-state-D6rNGQu9.js +0 -173
  83. package/dist/turn-failure-response-BlO4nuDJ.js +0 -224
  84. package/dist/turn-lifecycle-BQ8ETk63.js +0 -58
package/dist/app.js CHANGED
@@ -1,41 +1,38 @@
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 { $r as bindScheduledAutomationCredentialSubject, Bo as getConfigDefaults, Ca as clearSandboxEgressSignals, Cn as SubscribedReplyReason, Co as resolveRootVisibility, Cr as canActOnReviewItem, Da as parseSandboxEgressCredentialToken, Dt as isInvalidConversationRecordError, En as getThreadStopDecision, Eo as listConversationAnnotations, Fn as setExperimentalFeatures, In as createUserTokenStore, Jr as findMatchingWatches, La as createPluginEmbedder, Li as resolveBaseUrl, Mi as isVercelSandboxEgressRequest, Mo as createPluginCache, Ni as proxyVercelSandboxEgressRequest, Nn as getExperimentalFeatures, Pn as isExperimentalFeatureEnabled, Qr as bindEventAutomationCredentialSubject, S as projectConversationMessages, Ta as consumeSandboxEgressPermissionDeniedSignal, Tt as hasRunnableConversationWork, Ui as slackMention, Un as getPluginApiRoutes, Vo as setConfigDefaults, Wn as getPluginRoutes, Wr as collectEventMatchKeys, Xi as postSlackEphemeralMessage, Xn as setPlugins, Yi as openSlackModal, Yn as getPlugins, Za as createPluginLogger, Zn as validatePlugins, Zr as takeDueTimerWatches, _ as appendConversationMessages, ci as getDashboardReviewItemLink, ct as CONVERSATION_WORK_STALE_ENQUEUE_MS, di as setDashboardConversationLinkOptions, do as readConversationEventPageAfter, ei as bindSlackDirectCredentialSubject, eo as readConversationAccessFromSql, er as setBriefsConfig, fr as dismissOpenReviewItems, ja as normalizeSandboxEgressTracePropagationDomains, jr as reviewItemReaderForUser, la as isDmChannel, ma as runWithWorkspaceTeamId, mo as readConversationMessageEventSeq, na as slackExternalRefIdSchema, ni as verifyScheduledAutomationCredentialSubject, oi as getDashboardConversationLink, pa as getWorkspaceTeamId, pi as createPluginState, po as readConversationLastEventSeq, ri as verifySlackDirectCredentialSubject, sa as getSlackClient, ta as slackEntitySchema, ti as verifyEventAutomationCredentialSubject, ui as getDashboardTaskLink, uo as readConversationEventPage, w as settleConversationTitleWork, wa as consumeSandboxEgressAuthRequiredSignal, yr as searchReviewItems } from "./projection-CoeMNxJ4.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-B9f9Lqo5.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-CMFhLLj4.js";
5
+ import { t as JUNIOR_VERSION } from "./version-BTIz7fGi.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, H as resolveActorIdentityId, I as withConversationMutationLock, J as recordGoogleSignIn, S as getDb, _ as closeDb, ct as createSlackDestination, g as createCache, i as readActorIdentity, k as withConversationEventLock, l as resolveViewerUser, p as parseAvatarUrl, tt as touchConversationDetail, x as getConversationStore, y as getConversationEventStore } from "./viewer-CH-ASQzh.js";
8
+ import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-Dipi2Ixl.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bym8GVdh.js";
10
+ import { $ as readViewerAutomationSummary, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, Ht as processWorkspaceSnapshotJob, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, S as createSlackReviewItemShow, St as recordSubagentEnded, U as scheduledAutomationRunAttributes, Ut as ingestEvent, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as readPublicArtifact, at as deliverReviewItemChange, g as publicArtifactHeaders, gt as collectAttachmentGarbage, 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, vt as requestAttachmentDeletion, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, z as joinPublicChannel } from "./agent-runner-DGCwOEyL.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-JQZaJ-B_.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-BusI2uzj.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 { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-BOviBdT-.js";
17
+ import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, z as renderTaskInput } from "./session-stop-CGz5DByb.js";
18
+ import { g as buttonUserInputField } from "./reporting-window-B4TwyuJo.js";
19
+ import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-DYqgL3Eo.js";
20
+ import { T as isConversationQueueMessageRejectedError, _ as getVercelConversationWorkQueue, f as queueCallback, g as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, p as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as resolveConversationWorkQueueTopic, w as conversationQueueMessageSchema, x as getQueueProvider, y as verifyConversationQueueMessage } from "./background-compaction-queue-Btu2oab_.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-D0-8plWp.js";
22
+ import { A as withScheduledAutomationLock, E as readScheduledAutomation, F as findMatchingEventAutomations, H as eventAutomationRunLimitReason, M as collectEventAutomationMatchKeys, O as saveScheduledAutomationInLock, Q as existingConversationId, Tt as eventGuidance, V as admitEventAutomationRun, W as automationVersionOf, bt as coerceThreadConversationState, c as getDispatchConversationId, ct as recordAutomationExecution, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, j as blockEventAutomation, k as scheduledRunId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, w as listScheduledAutomationsForTeam, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-xPuQmEot.js";
23
+ import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-B-jJN_gM.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DZDKorGz.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-DwehU0Fd.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-GyFZkHuQ.js";
28
+ import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-C75_IM5e.js";
29
+ import { n as enqueueAgentInvocationResult } from "./result-CescSwAw.js";
30
+ import { o as unlinkProvider } from "./connections-CQ7p0aNJ.js";
31
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DmiJi_At.js";
33
32
  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";
33
+ import { t as processConversationWork } from "./worker-Dl47I729.js";
34
+ import { t as bindMessageAgent } from "./message-D1xLljUF.js";
35
+ import { t as bindSpawnAgent } from "./spawn-C8F_iXWO.js";
39
36
  import { createRequire } from "node:module";
40
37
  import { Hono } from "hono";
41
38
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -2088,6 +2085,100 @@ async function handleSlackForm(args) {
2088
2085
  })));
2089
2086
  return new Response("", { status: 200 });
2090
2087
  }
2088
+ // src/chat/ingress/slack-skipped-message.ts
2089
+ /**
2090
+ * Save a Slack message that starts no Turn as a skipped Message, so later
2091
+ * Turns see it. A redelivery saves nothing new: the Message id is the
2092
+ * idempotency key.
2093
+ */
2094
+ async function saveSkippedSlackMessage(args) {
2095
+ const conversation = coerceThreadConversationState(void 0);
2096
+ recordSkippedConversationMessage({
2097
+ conversation,
2098
+ message: args.message,
2099
+ skippedReason: args.skippedReason,
2100
+ text: parseContent(args.message).text
2101
+ });
2102
+ await appendConversationMessages(getConversationEventStore(), {
2103
+ conversation,
2104
+ conversationId: args.conversationId
2105
+ });
2106
+ }
2107
+ // src/chat/ingress/slack-stop.ts
2108
+ /** Acknowledge a Slack stop. */
2109
+ const SLACK_STOP_ACK = "Stopped.";
2110
+ /**
2111
+ * Claim Slack's native stop button press. Slack sends a retry with the same
2112
+ * `event_ts`, so the claim dedupes it, and the press time is the stop time.
2113
+ */
2114
+ function slackStopButtonRequest(args) {
2115
+ return {
2116
+ conversationId: args.conversationId,
2117
+ createdAtMs: Math.floor(Number(args.eventTs) * 1e3),
2118
+ destination: createSlackDestination({
2119
+ channelId: args.channelId,
2120
+ teamId: args.installation.teamId
2121
+ }),
2122
+ inboundMessageId: slackInboundMessageId({
2123
+ conversationId: args.conversationId,
2124
+ installation: args.installation,
2125
+ slackId: `agent_session_stopped:${args.eventTs}`
2126
+ }),
2127
+ source: "slack"
2128
+ };
2129
+ }
2130
+ /**
2131
+ * Stop a Slack thread's Conversation for the `stop` keyword or Slack's native
2132
+ * agent stop button. The thread stays subscribed, and the next person input
2133
+ * that reaches the worker ends the stop. A keyword stop message is saved as
2134
+ * a skipped Message and never enters the mailbox. Slack does not leave the
2135
+ * `processing` status by itself, so clear the status even when no work runs.
2136
+ *
2137
+ * Slack sends one mention as both `message` and `app_mention`, and it retries
2138
+ * events. The stop claims its `inboundMessageId` in the mailbox, the same
2139
+ * duplicate guard that ordinary messages get, so a second delivery stops
2140
+ * nothing and posts no ack. The keyword uses its message id and the button
2141
+ * its `event_ts`. This replaces the old stop watermark's duplicate guard.
2142
+ * https://docs.slack.dev/reference/events/agent_session_stopped
2143
+ */
2144
+ async function handleSlackStop(args) {
2145
+ if (args.stopMessage) await saveSkippedSlackMessage({
2146
+ conversationId: args.conversationId,
2147
+ message: args.stopMessage.message,
2148
+ skippedReason: `${SubscribedReplyReason.ThreadOptOut}:${args.stopMessage.stopReason}`
2149
+ });
2150
+ let duplicate = false;
2151
+ let stopped;
2152
+ try {
2153
+ stopped = await stopConversation({
2154
+ conversationId: args.conversationId,
2155
+ conversationStore: args.conversationStore,
2156
+ message: args.request,
2157
+ queue: args.queue,
2158
+ state: args.state
2159
+ });
2160
+ duplicate = stopped.status === "duplicate";
2161
+ } finally {
2162
+ if (!duplicate) await createSlackWebApiStatusSender({
2163
+ channelId: args.slackThread?.channelId,
2164
+ threadTs: args.slackThread?.threadTs
2165
+ })("");
2166
+ }
2167
+ if (stopped.status === "duplicate") return;
2168
+ if (stopped.status === "requested") await clearSlackPendingReactions({
2169
+ getSlackAdapter: () => args.adapter,
2170
+ messages: stopped.pendingMessages,
2171
+ state: args.state
2172
+ });
2173
+ if (!args.stopMessage && stopped.status !== "requested") return;
2174
+ await new ThreadImpl({
2175
+ adapter: args.adapter,
2176
+ stateAdapter: args.state,
2177
+ id: args.canonicalThreadId,
2178
+ channelId: args.adapter.channelIdFromThreadId(args.canonicalThreadId),
2179
+ isDM: args.adapter.isDM(args.canonicalThreadId)
2180
+ }).post(SLACK_STOP_ACK);
2181
+ }
2091
2182
  // src/chat/ingress/slack-message-subtypes.ts
2092
2183
  const IGNORED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
2093
2184
  "message_changed",
@@ -2228,6 +2319,8 @@ function eventInput(task, event, outcomes, catalog) {
2228
2319
  const guidance = eventGuidance(catalog, event.namespace, event.eventType);
2229
2320
  return renderTaskInput({
2230
2321
  about: task.trigger.label,
2322
+ event: event.eventType,
2323
+ source: event.namespace,
2231
2324
  creator: slackMention(task.createdBy.slackUserId),
2232
2325
  instructions: task.task.text,
2233
2326
  outcomes,
@@ -2584,6 +2677,25 @@ async function resolveSlackConversationId(args) {
2584
2677
  providerConversationId: providerThread.threadTs
2585
2678
  }) ?? args.canonicalThreadId;
2586
2679
  }
2680
+ /**
2681
+ * Build the mailbox input for one Slack message. A message and a `stop` get
2682
+ * the same `inboundMessageId`, so each Slack message is handled once.
2683
+ */
2684
+ async function buildSlackInput(args) {
2685
+ const thread = await buildThread(args);
2686
+ return {
2687
+ inbound: buildSlackInboundMessage({
2688
+ conversationId: args.conversationId,
2689
+ installation: args.installation,
2690
+ reviewItemChange: args.facts?.reviewItemChange,
2691
+ message: args.message,
2692
+ receivedAtMs: args.receivedAtMs,
2693
+ route: args.route,
2694
+ thread
2695
+ }),
2696
+ thread
2697
+ };
2698
+ }
2587
2699
  async function persistSlackMessage(args) {
2588
2700
  const canonicalThreadId = normalizeIncomingSlackThreadId(args.message.threadId, args.message);
2589
2701
  const conversationId = args.conversationId ?? await resolveSlackConversationId({
@@ -2591,26 +2703,16 @@ async function persistSlackMessage(args) {
2591
2703
  conversationStore: args.conversationStore,
2592
2704
  installation: args.installation
2593
2705
  });
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
2706
+ const { inbound, thread } = await buildSlackInput({
2707
+ ...args,
2708
+ conversationId
2603
2709
  });
2604
2710
  const work = await getConversationWorkState({
2605
2711
  conversationId,
2606
2712
  state: args.state
2607
2713
  });
2608
2714
  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({
2715
+ if (args.route === "mention" && !work?.execution.inboundMessageIds.includes(inbound.inboundMessageId)) receipt = await startProcessingReaction({
2614
2716
  message: args.message,
2615
2717
  thread,
2616
2718
  timeoutMs: 1e3
@@ -2629,102 +2731,6 @@ async function persistSlackMessage(args) {
2629
2731
  throw new SlackEventPersistenceError(error, kept);
2630
2732
  });
2631
2733
  }
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
2734
  async function routeParsedMessage(args) {
2729
2735
  if (shouldIgnoreMessage(args.message)) return;
2730
2736
  const normalized = normalizeMessageThreadId(args.message);
@@ -2762,20 +2768,6 @@ async function routeParsedMessage(args) {
2762
2768
  text: args.event.text ?? "",
2763
2769
  isExplicitMention: isMention
2764
2770
  });
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
2771
  const isAuthorDomainAllowed = () => isSlackAuthorDomainAllowed({
2780
2772
  allowedBotUserIds: args.allowedBotUserIds,
2781
2773
  allowedDomains: args.allowedDomains,
@@ -2783,25 +2775,44 @@ async function routeParsedMessage(args) {
2783
2775
  teamId: args.installation.teamId,
2784
2776
  user: args.event.user
2785
2777
  });
2786
- if (route === "mention" && !await isAuthorDomainAllowed()) return;
2778
+ if (!stopDecision && route === "mention" && !await isAuthorDomainAllowed()) return;
2787
2779
  await bindSlackAuthorIdentity(message, args.installation);
2788
2780
  const conversationId = await resolveSlackConversationId({
2789
2781
  canonicalThreadId,
2790
2782
  conversationStore: args.conversationStore,
2791
2783
  installation: args.installation
2792
2784
  });
2793
- if (isSubscribed && !isExperimentalFeatureEnabled("passive-routing")) {
2794
- const content = parseContent(message);
2795
- const conversation = coerceThreadConversationState(void 0);
2796
- recordSkippedConversationMessage({
2797
- conversation,
2785
+ if (stopDecision) {
2786
+ const { inbound } = await buildSlackInput({
2787
+ adapter: args.adapter,
2788
+ conversationId,
2789
+ installation: args.installation,
2798
2790
  message,
2799
- skippedReason: `${SubscribedReplyReason.PassiveDisabled}:passive-routing`,
2800
- text: content.text
2791
+ receivedAtMs: args.receivedAtMs,
2792
+ route,
2793
+ state: args.state
2801
2794
  });
2802
- await appendConversationMessages(getConversationEventStore(), {
2803
- conversation,
2804
- conversationId
2795
+ await handleSlackStop({
2796
+ adapter: args.adapter,
2797
+ canonicalThreadId,
2798
+ conversationId,
2799
+ conversationStore: args.conversationStore,
2800
+ queue: args.queue,
2801
+ request: inbound,
2802
+ slackThread: parseSlackThreadId(canonicalThreadId),
2803
+ state: args.state,
2804
+ stopMessage: {
2805
+ message,
2806
+ stopReason: stopDecision.reasonDetail ?? stopDecision.reason
2807
+ }
2808
+ });
2809
+ return;
2810
+ }
2811
+ if (isSubscribed && !isExperimentalFeatureEnabled("passive-routing")) {
2812
+ await saveSkippedSlackMessage({
2813
+ conversationId,
2814
+ message,
2815
+ skippedReason: `${SubscribedReplyReason.PassiveDisabled}:passive-routing`
2805
2816
  });
2806
2817
  return;
2807
2818
  }
@@ -2902,15 +2913,32 @@ async function handleSlackEvent(args) {
2902
2913
  if (!await isSlackWorkspaceMember(event, state)) return;
2903
2914
  const channelId = event.channel;
2904
2915
  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
- }), {
2916
+ if (!(await withLock(state, `slack:ingress:slack:${channelId}:${threadTs}`, async () => {
2917
+ const canonicalThreadId = `slack:${channelId}:${threadTs}`;
2918
+ const conversationId = await resolveSlackConversationId({
2919
+ canonicalThreadId,
2920
+ conversationStore: args.services.conversationStore,
2921
+ installation
2922
+ });
2923
+ await handleSlackStop({
2924
+ adapter,
2925
+ canonicalThreadId,
2926
+ conversationId,
2927
+ conversationStore: args.services.conversationStore,
2928
+ queue: args.services.queue,
2929
+ request: event.event_ts ? slackStopButtonRequest({
2930
+ channelId,
2931
+ conversationId,
2932
+ eventTs: event.event_ts,
2933
+ installation
2934
+ }) : void 0,
2935
+ slackThread: {
2936
+ channelId,
2937
+ threadTs
2938
+ },
2939
+ state
2940
+ });
2941
+ }, {
2914
2942
  keepAlive: true,
2915
2943
  waitMs: 1e4
2916
2944
  })).acquired) throw new Error("Could not acquire Slack ingress lock");
@@ -3405,7 +3433,7 @@ function createAcpConversations(options) {
3405
3433
  return {
3406
3434
  async cancel({ conversationId, user }) {
3407
3435
  if (!await hasConversationAccess(conversationId, user)) return "not_found";
3408
- const stopped = await stopConversationTurn({
3436
+ const stopped = await stopConversation({
3409
3437
  conversationId,
3410
3438
  conversationStore: options.conversationStore,
3411
3439
  queue: options.queue,
@@ -6001,13 +6029,13 @@ async function handleMcpConsentPage(args) {
6001
6029
  const mcpConversationSchema = z.object({
6002
6030
  conversationId: z.string(),
6003
6031
  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."),
6032
+ 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
6033
  surface: conversationSurfaceSchema.describe("Where it started: `slack`, `api` (the dashboard or MCP), `scheduler` (an automation), or `internal`."),
6006
6034
  channelName: z.string().optional().describe("Slack channel name."),
6007
6035
  locationUrl: z.string().optional().describe("Slack thread link."),
6008
6036
  startedAt: z.string(),
6009
6037
  lastSeenAt: z.string().describe("Time of the newest activity. archiveConversation takes this value."),
6010
- archivedAt: z.string().optional().describe("Set when you archived it."),
6038
+ archivedAt: z.string().optional().describe("Set when anyone archived it. Archive applies to everyone."),
6011
6039
  pinnedAt: z.string().optional().describe("Set when you pinned it."),
6012
6040
  url: z.string().optional().describe("Dashboard link.")
6013
6041
  }).strict();
@@ -6197,14 +6225,18 @@ async function isConversationParticipant(user, conversationId) {
6197
6225
  return (await readConversationAccessFromSql(getDb(), [conversationId], user)).get(conversationId)?.isParticipant ?? false;
6198
6226
  }
6199
6227
  // src/api/mcp/tools/archive-conversation.ts
6200
- /** Register `archiveConversation`, which archives or restores for the user. */
6228
+ /**
6229
+ * Register `archiveConversation`. It archives or restores one Conversation,
6230
+ * and optionally its children, for everyone.
6231
+ */
6201
6232
  function registerArchiveConversationTool(server, { user }) {
6202
6233
  server.registerTool("archiveConversation", {
6203
6234
  title: "Archive conversation",
6204
- description: "Archive one of your conversations, or restore it. Archiving hides it only for you, and new activity restores it.",
6235
+ description: "Archive one of your conversations, or restore it, for everyone in it. Archiving a conversation hides it and its child conversations. A restore fails while a conversation above it is archived. A new message from a person restores the conversation and the archived conversations above it.",
6205
6236
  inputSchema: {
6206
6237
  conversationId: mcpConversationIdSchema,
6207
6238
  archived: z.boolean().default(true).describe("False restores an archived conversation."),
6239
+ applyToChildren: z.boolean().default(false).describe("On archive, true also archives every child of this conversation at any depth; without it, the archive fails while any of its children is not archived. On restore, true also restores the children that were archived with this conversation."),
6208
6240
  lastSeenAt: z.string().datetime().describe("`lastSeenAt` from searchConversations or getConversation. The archive fails when the conversation has newer activity.")
6209
6241
  },
6210
6242
  outputSchema: { archivedAt: z.string().nullable().describe("Null when the conversation is not archived.") },
@@ -6214,9 +6246,10 @@ function registerArchiveConversationTool(server, { user }) {
6214
6246
  openWorldHint: false,
6215
6247
  readOnlyHint: false
6216
6248
  }
6217
- }, async ({ archived, conversationId, lastSeenAt }) => {
6249
+ }, async ({ applyToChildren, archived, conversationId, lastSeenAt }) => {
6218
6250
  try {
6219
6251
  return mcpToolResult(await archiveConversation(user, conversationId, {
6252
+ applyToChildren,
6220
6253
  archived,
6221
6254
  lastSeenAt
6222
6255
  }));
@@ -6233,7 +6266,7 @@ function registerArchiveConversationTool(server, { user }) {
6233
6266
  function registerArchiveDoneConversationsTool(server, { user }) {
6234
6267
  server.registerTool("archiveDoneConversations", {
6235
6268
  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.",
6269
+ description: "Archive all of your conversations whose work is done and that stayed quiet for your auto-archive wait time, once. It skips conversations that anyone pinned or turned auto-archive off for, and conversations that wait on a person. Archive applies to everyone in the conversation.",
6237
6270
  inputSchema: {},
6238
6271
  outputSchema: { archived: z.number().int().describe("Conversations archived.") },
6239
6272
  annotations: {
@@ -6709,7 +6742,7 @@ function registerMarkConversationReadTool(server, { user }) {
6709
6742
  function registerPinConversationTool(server, { user }) {
6710
6743
  server.registerTool("pinConversation", {
6711
6744
  title: "Pin conversation",
6712
- description: "Pin one of your conversations, or unpin it. A pin applies only to you, restores an archived conversation, and keeps auto-archive from archiving it.",
6745
+ description: "Pin one of your top-level conversations, or unpin it. A child conversation cannot be pinned or unpinned; it uses the pin of its root. A pin applies only to you, restores an archived conversation, and keeps auto-archive from archiving it.",
6713
6746
  inputSchema: {
6714
6747
  conversationId: mcpConversationIdSchema,
6715
6748
  pinned: z.boolean().default(true).describe("False unpins the conversation.")
@@ -6738,7 +6771,7 @@ function registerSearchConversationsTool(server, { user }) {
6738
6771
  description: "Search your conversations and return up to 50, newest activity first. Only conversations that you started or take part in match.",
6739
6772
  inputSchema: {
6740
6773
  q: feedQuery.q.describe("Text to search for in titles and Briefs."),
6741
- status: feedQuery.status.describe("Return conversations that you have not archived (default) or that you archived. A search ignores this filter.")
6774
+ status: feedQuery.status.describe("Return conversations that are not archived (default) or that are archived. A search ignores this filter.")
6742
6775
  },
6743
6776
  outputSchema: { conversations: z.array(mcpConversationSchema) },
6744
6777
  annotations: {
@@ -6854,7 +6887,7 @@ function registerSetConversationAutoArchiveTool(server, { user }) {
6854
6887
  description: "Turn auto-archive on or off for one of your conversations. This overrides your default for that conversation only.",
6855
6888
  inputSchema: {
6856
6889
  conversationId: mcpConversationIdSchema,
6857
- autoArchive: z.boolean().describe("True archives the conversation for you after its work is done. False keeps it in your list.")
6890
+ autoArchive: z.boolean().describe("True lets auto-archive archive the conversation for everyone after its work is done. False keeps it from auto-archive for everyone.")
6858
6891
  },
6859
6892
  outputSchema: { autoArchive: z.boolean() },
6860
6893
  annotations: {
@@ -6872,14 +6905,17 @@ function registerSetConversationAutoArchiveTool(server, { user }) {
6872
6905
  });
6873
6906
  }
6874
6907
  // src/api/mcp/tools/stop-conversation.ts
6875
- /** Register `stopConversation`, which stops the active Turn. */
6908
+ /**
6909
+ * Register `stopConversation`, which stops the Conversation and every child
6910
+ * agent below it until the person sends the Conversation input.
6911
+ */
6876
6912
  function registerStopConversationTool(server, { queue, user }) {
6877
6913
  server.registerTool("stopConversation", {
6878
6914
  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.",
6915
+ 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
6916
  inputSchema: { conversationId: mcpConversationIdSchema },
6881
6917
  outputSchema: {
6882
- status: z.enum(["no_work", "requested"]).describe("`requested` when the running turn was asked to stop. `no_work` when nothing was running."),
6918
+ 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
6919
  droppedMessages: z.number().int().describe("Messages that waited for the turn and were dropped.")
6884
6920
  },
6885
6921
  annotations: {
@@ -7456,6 +7492,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
7456
7492
  "/api/notifications",
7457
7493
  "/api/notifications/*",
7458
7494
  "/api/stats",
7495
+ "/api/versions",
7459
7496
  "/api/conversations",
7460
7497
  "/api/conversations/*",
7461
7498
  "/api/locations",
@@ -1,4 +1,4 @@
1
- import { Wt as extractAssistantText } from "./projection-0UcUeuzn.js";
1
+ import { Xt as extractAssistantText } from "./projection-CoeMNxJ4.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-BusI2uzj.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