@sentry/junior 0.283.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.
- package/dist/{adapter-D8-lqOBF.js → adapter-DN5AB4VU.js} +37 -3
- package/dist/{admin-Dnw5SCXp.js → admin-DOITMKnn.js} +1 -1
- package/dist/{agent-runner-Bj7GhysW.js → agent-runner-BsWhHe4N.js} +583 -1655
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +8 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +214 -43
- package/dist/{app-CMBP-N43.d.ts → app-DyMs9330.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +230 -187
- package/dist/{assistant-reply-CdYsLbXL.js → assistant-reply-9Jip5bsr.js} +1 -1
- package/dist/{automation-MLWOrghe.js → automation-Mk8aaHzy.js} +2 -2
- package/dist/{background-compaction-queue-Bbsqx8Vm.js → background-compaction-queue-DXkLsWoH.js} +2 -2
- package/dist/{briefs-C4qBY-jb.js → briefs-Cl8-nK9B.js} +5 -5
- package/dist/{catalog-runtime-B7NRB7eH.js → catalog-runtime-Bte6jRB2.js} +1 -1
- package/dist/cli/chat.js +19 -16
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +3 -0
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +25 -4
- package/dist/{client-a3Ib6wxr.js → client-DDbBucBw.js} +2 -2
- package/dist/{config-DFVlYCeY.js → config-DqFnykQT.js} +1 -1
- package/dist/{connections-BtnvpBEV.js → connections-DA4LT9LL.js} +10 -10
- package/dist/{conversation-DdT7SNar.js → conversation-D8kVoCrP.js} +58 -6
- package/dist/{conversation-pending-messages-Dct5pheX.js → conversation-pending-messages-BvROq1bq.js} +1 -1
- package/dist/{conversation-privacy-DLq-abjU.js → conversation-privacy-D0j_h70R.js} +1 -1
- package/dist/{credential-sync-B4XFVcjM.js → credential-sync-hcsYatw-.js} +13 -13
- package/dist/{db-A_WrTY-s.d.ts → db-BhHZSuFw.d.ts} +18 -2
- package/dist/{executor-HPgHGAWK.js → executor-BLEMIgIZ.js} +29 -4
- package/dist/instrumentation.js +37 -13
- package/dist/{logging-2BXvW7Mp.js → logging-BfORLKoq.js} +1 -1
- package/dist/{message-BG1v1lXX.js → message-DqjuKzUx.js} +13 -23
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CXNZJymo.js → oauth-callback-server-CFSRzu1n.js} +2 -2
- package/dist/{projection-BfKkpOGQ.js → projection-DliWYrnT.js} +575 -74
- package/dist/{prompt-CCtaGgbI.js → prompt-BvIUzY4y.js} +8 -6
- package/dist/push-endpoint-CO-nomUd.js +36 -0
- package/dist/{registry-CLooHPAz.js → registry-rC7MCxu8.js} +1 -1
- package/dist/{reporting-window-B-QP9zX1.js → reporting-window-B4TwyuJo.js} +14 -14
- package/dist/{resolve-D3MK9oRJ.js → resolve-Biu8Qw3u.js} +3 -3
- package/dist/result-DxJMCX47.js +299 -0
- package/dist/result-event-type-DD6BAgT7.js +11 -0
- package/dist/{runner-Ds31u3rB.js → runner-BQJSFLKg.js} +11 -11
- package/dist/{sandbox-egress-signals-CLd5RPUw.js → sandbox-egress-signals-6aMxJSDn.js} +1 -1
- package/dist/{cadence-R7Em4RjE.js → schedule-BTp__wrw.js} +81 -1
- package/dist/{schema-jW3ccLjp.d.ts → schema-BUviRAs8.d.ts} +196 -220
- package/dist/{schema-CHNP0GfH.js → schema-BasXTvi2.js} +94 -5
- package/dist/{service-account-D6AMahy7.js → service-account-BI5Wgx22.js} +3 -3
- package/dist/{service-account-CWpTsoIM.js → service-account-CAE-_1dR.js} +3 -3
- package/dist/session-stop-CA-jOJ84.js +2924 -0
- package/dist/{skills-DuOKByQH.js → skills-B22duVJU.js} +2 -2
- package/dist/{spawn-CNIQGgAS.js → spawn-BB2_4VYn.js} +2 -2
- package/dist/{stop-DX2oOIgl.js → stop-DioIcEAu.js} +4830 -4200
- package/dist/{store-61mD4ZSh.js → store-B26LV6UP.js} +78 -311
- package/dist/{store-DAJntSEv.js → store-Dn4W7qgH.js} +30 -5
- package/dist/{task-queue-BE70Pb9p.js → task-queue-Bt0IoR2i.js} +3 -3
- package/dist/{task-runner-CmmfddSZ.js → task-runner-D8lddjzp.js} +17 -8
- package/dist/{thread-state-0UfRMWYd.js → thread-state-CrFk3K_7.js} +4 -4
- package/dist/{turn-failure-response-DKdzxJHE.js → turn-failure-response-DaJ04qVj.js} +7 -7
- package/dist/{turn-lifecycle-24sBZ4Ip.js → turn-lifecycle-C2mXS7AZ.js} +1 -1
- package/dist/{turn-session-routing-CzCnNAUO.js → turn-session-routing-CGMKrYOj.js} +10 -10
- package/dist/{validation-Cs_knhR8.js → validation-TzhfQABF.js} +1 -1
- package/dist/{version-ZMC4cXWN.js → version-DSk8CFvA.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CYB9T4rm.js → viewer-1Ea81s0b.js} +190 -53
- package/dist/{work-J1n6RQkY.js → work-ybG4_q5C.js} +238 -32
- package/dist/{worker-s1fCvj1z.js → worker-ccSyZRNz.js} +6 -6
- package/migrations/0082_push_notifications.sql +14 -0
- package/migrations/0083_conversation_kind.sql +11 -0
- package/migrations/0084_read_position_backfill.sql +25 -0
- package/migrations/0085_child_archived_at.sql +1 -0
- package/migrations/meta/0082_snapshot.json +4373 -0
- package/migrations/meta/0083_snapshot.json +4388 -0
- package/migrations/meta/0084_snapshot.json +4388 -0
- package/migrations/meta/0085_snapshot.json +4394 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +7 -5
- package/dist/result-BPCjUefO.js +0 -483
- package/dist/session-stop-D8LGC3H6.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 {
|
|
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-
|
|
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-
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
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,
|
|
8
|
-
import {
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { $ as
|
|
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-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-DN5AB4VU.js";
|
|
13
|
+
import { a as getNextRunAtMs } from "./schedule-BTp__wrw.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 {
|
|
17
|
-
import { A as
|
|
18
|
-
import {
|
|
19
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-
|
|
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-
|
|
21
|
-
import {
|
|
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-
|
|
23
|
-
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-
|
|
24
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
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-
|
|
27
|
-
import { $ as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { o as unlinkProvider } from "./connections-
|
|
32
|
-
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
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-
|
|
35
|
-
import { t as processConversationWork } from "./worker-
|
|
36
|
-
import { t as bindMessageAgent } from "./message-
|
|
37
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
38
|
-
import { t as processPluginTask } from "./task-runner-
|
|
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
|
|
2595
|
-
|
|
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)
|
|
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 (
|
|
2794
|
-
const
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2788
|
+
if (stopDecision) {
|
|
2789
|
+
const { inbound } = await buildSlackInput({
|
|
2790
|
+
adapter: args.adapter,
|
|
2791
|
+
conversationId,
|
|
2792
|
+
installation: args.installation,
|
|
2798
2793
|
message,
|
|
2799
|
-
|
|
2800
|
-
|
|
2794
|
+
receivedAtMs: args.receivedAtMs,
|
|
2795
|
+
route,
|
|
2796
|
+
state: args.state
|
|
2801
2797
|
});
|
|
2802
|
-
await
|
|
2803
|
-
|
|
2804
|
-
|
|
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}`, () =>
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
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: {
|
|
@@ -7435,6 +7474,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
|
|
|
7435
7474
|
"/_junior/dashboard/assets/*",
|
|
7436
7475
|
"/_junior/dashboard/icon-512.png",
|
|
7437
7476
|
"/_junior/dashboard/manifest.webmanifest",
|
|
7477
|
+
"/_junior/dashboard/sw.js",
|
|
7438
7478
|
loginPath,
|
|
7439
7479
|
"/api/health",
|
|
7440
7480
|
"/api/runtime",
|
|
@@ -7452,7 +7492,10 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
|
|
|
7452
7492
|
"/api/code/*",
|
|
7453
7493
|
"/api/connections",
|
|
7454
7494
|
"/api/connections/*",
|
|
7495
|
+
"/api/notifications",
|
|
7496
|
+
"/api/notifications/*",
|
|
7455
7497
|
"/api/stats",
|
|
7498
|
+
"/api/versions",
|
|
7456
7499
|
"/api/conversations",
|
|
7457
7500
|
"/api/conversations/*",
|
|
7458
7501
|
"/api/locations",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-BTp__wrw.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
|
package/dist/{background-compaction-queue-Bbsqx8Vm.js → background-compaction-queue-DXkLsWoH.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
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";
|