@sentry/junior 0.301.0 → 0.302.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-context-Cx9fn9B3.js +43 -0
- package/dist/{admin-CRJHvCGg.js → admin-_poE5NKL.js} +2 -2
- package/dist/{agent-runner-H4YhvNBj.js → agent-runner-CY9RvsTX.js} +1380 -10601
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +91 -68
- package/dist/{app-HDZglaIu.d.ts → app-BpY3wtRP.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +66 -296
- package/dist/{background-compaction-queue-CNrZ3QcU.js → background-compaction-queue-CXFq1_Cz.js} +94 -203
- package/dist/{briefs-x6Mzwxmg.js → briefs-B3NG-pid.js} +2 -2
- package/dist/{catalog-runtime-BEY6EGRi.js → catalog-runtime-Dss0lSV6.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- 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 +3 -3
- package/dist/{config-CmjhyqgB.js → config-CzeZiMKs.js} +2 -2
- package/dist/{connections-CfIRm0xv.js → connections-CDYhMfrs.js} +6 -6
- package/dist/{continue-in-slack-DPoABVkB.js → continue-in-slack-7Uf05ndC.js} +5 -6
- package/dist/{conversation-feed-CfpyFMHP.js → conversation-feed-Clf_cv0n.js} +1 -0
- package/dist/{conversation-privacy-0CM0V2qK.js → conversation-privacy-D9xnM5mK.js} +1 -1
- package/dist/{conversation-turn-C0sxyvS-.js → conversation-turn-D7SEZgTG.js} +15 -16
- package/dist/{credential-sync-tEMKZ_8M.js → credential-sync-DoD0gW-j.js} +13 -15
- package/dist/{db-Czra10QW.js → db-B-gtnNjr.js} +314 -5
- package/dist/{db-BdUHQhrC.d.ts → db-BdsCzytP.d.ts} +1 -1
- package/dist/{executor-D_023K0H.js → executor-DZg20EqU.js} +39 -4
- package/dist/install-t1KQyTUs.js +228 -0
- package/dist/instrumentation.js +2 -2
- package/dist/{state-CEbZuZD6.js → legacy-web-actor-id-C-cEeWqL.js} +33 -4
- package/dist/{lineage-DmMIE0VL.js → lineage-C79GjoQr.js} +2 -2
- package/dist/{logging-DcjLDDqi.js → logging-C9oDAg4M.js} +7 -3
- package/dist/{message-C0JY9RJP.js → message-BLUCzJXN.js} +8 -8
- package/dist/{model-input-CBp-p24N.js → model-input-5jwNC45G.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -3
- package/dist/{oauth-callback-server-BRq9QNhU.js → oauth-callback-server-BBl66vCb.js} +2 -2
- package/dist/{projection-CQNDOi82.js → projection-CIBwgD3s.js} +282 -64
- package/dist/{prompt-DLUB5m72.js → prompt-CRQbzp5e.js} +14 -4
- package/dist/queue-DtCDaIct.js +115 -0
- package/dist/{registry-Dj377ADs.js → registry-DdFQHZ_d.js} +1 -1
- package/dist/{resolve-DJkh9Fky.js → resolve-CdW4BdrK.js} +4 -229
- package/dist/{result-C8iIpDl1.js → result-oOMv1t4O.js} +9 -9
- package/dist/{runner-DZqrOy8C.js → runner-DqitLtm-.js} +8 -8
- package/dist/{sandbox-egress-signals-CGwH86S9.js → sandbox-egress-signals-Bw9I0yfJ.js} +1 -1
- package/dist/{schema-CdZFn7Qd.d.ts → schema-BIFM-U1a.d.ts} +441 -30
- package/dist/{schema-DyHXiQKI.js → schema-DnVQepWP.js} +66 -29
- package/dist/{service-account-D6jGR4a1.js → service-account-B6mKAPVo.js} +3 -3
- package/dist/{service-account-suY004dx.js → service-account-CrZftRTb.js} +257 -6
- package/dist/{session-stop-BLmfFI3d.js → session-stop-DW63Z3kj.js} +543 -548
- package/dist/{skills-CmNG0dHb.js → skills-C16fz60Z.js} +2 -2
- package/dist/{slack-conversation-unfurl-Bty-DlHe.js → slack-conversation-unfurl-BHhefEb7.js} +8 -7
- package/dist/{spawn-CNjkpXpk.js → spawn-D_RnFYfy.js} +6 -6
- package/dist/{stop-Bjy2-K4H.js → stop-7p1i08CY.js} +724 -106
- package/dist/{store-DmV4CoNr.js → store-C28I0CVW.js} +5 -5
- package/dist/{task-queue-AhG1tSXR.js → task-queue-BVUJbQ28.js} +3 -3
- package/dist/{task-runner-BMxZI3o7.js → task-runner-CWi8j7Z6.js} +6 -8
- package/dist/{thread-context-CXLnbg7g.js → thread-context-D3-yYUd0.js} +7 -7
- package/dist/{store-Epv6t4vV.js → turn-session-routing-BFMS9ATF.js} +381 -10
- package/dist/{turn-user-message-DsUZi9gn.js → turn-user-message-C3-O8Omt.js} +3 -3
- package/dist/{validation-DOz8X9BU.js → validation-BSFKUIb4.js} +1 -1
- package/dist/{version-CGMRmMPK.js → version-BHHXNi-0.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-H3EsMWtJ.js → viewer-B1SO21Qa.js} +3 -3
- package/dist/warmup-Bz9bzkzN.js +13927 -0
- package/dist/{statuses-Hn-HsOph.js → web-message-id-lNodcCOI.js} +136 -1
- package/dist/{worker-ClphajjD.js → worker-BspReIIK.js} +7 -7
- package/migrations/0108_conversation_embeddings.sql +13 -0
- package/migrations/meta/0108_snapshot.json +4688 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +8 -6
- package/dist/adapter-CNjGEJO9.js +0 -303
- package/dist/reporting-window-DopzcOHh.js +0 -137
- package/dist/turn-session-routing-BD3-jJl7.js +0 -380
- package/dist/users-BxvYclQg.js +0 -424
- package/dist/warmup-CdU5hR49.js +0 -3715
package/dist/app.js
CHANGED
|
@@ -1,56 +1,54 @@
|
|
|
1
1
|
import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Bi as createPluginState, C as settleConversationTitleWork, Ci as bindSlackDirectCredentialSubject, Dr as
|
|
3
|
-
import { Z as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setBotName, u as resetRuntimeConfig } from "./config-
|
|
4
|
-
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan,
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { Bi as createPluginState, C as settleConversationTitleWork, Ci as bindSlackDirectCredentialSubject, Dr as createPluginReviewItems, Ds as getConfigDefaults, Ea as postSlackEphemeralMessage, Ei as verifySlackDirectCredentialSubject, Er as projectConversationMessages, Fi as getDashboardTaskLink, Fo as readConversationMessageEventSeq, Ha as clearSandboxEgressSignals, Hr as canActOnReviewItem, Ka as parseSandboxEgressCredentialToken, Ma as slackEntitySchema, Mo as readConversationEventPageAfter, Mt as hasRunnableConversationWork, Na as slackExternalRefIdSchema, Ni as getDashboardReviewItemLink, Os as setConfigDefaults, Po as readConversationLastEventSeq, Pt as isInvalidConversationRecordError, Qo as isDmChannel, Qr as reviewItemReaderForUserInConversation, Rr as searchReviewItems, Rt as pruneActiveConversation, Si as bindScheduledAutomationCredentialSubject, Ta as openSlackModal, Ti as verifyScheduledAutomationCredentialSubject, Ua as consumeSandboxEgressAuthRequiredSignal, Wa as consumeSandboxEgressPermissionDeniedSignal, Xa as normalizeSandboxEgressTracePropagationDomains, Xo as getSlackClient, Zn as createUserTokenStore, Zr as reviewItemReaderForUser, _ as appendConversationMessages, _a as slackMention, _i as findMatchingWatches, _o as createPluginLogger, aa as isVercelSandboxEgressRequest, ar as getPluginRoutes, as as getWorkspaceTeamId, bi as takeDueTimerWatches, cs as resolveRootVisibility, dt as CONVERSATION_WORK_STALE_ENQUEUE_MS, fr as setPlugins, fs as createPluginAnnotations, gr as setBriefsConfig, ii as createCodeChangePublisher, ir as getPluginApiRoutes, jo as readConversationEventPage, jr as dismissOpenReviewItems, ki as getDashboardConversationLink, nr as createPluginEventPublisher, oa as proxyVercelSandboxEgressRequest, os as runWithWorkspaceTeamId, pi as collectEventMatchKeys, pr as validatePlugins, ps as listConversationAnnotations, ro as createPluginEmbedder, ua as resolveBaseUrl, ur as getPlugins, wi as verifyEventAutomationCredentialSubject, xi as bindEventAutomationCredentialSubject, xo as readConversationAccessFromSql, xs as createPluginCache, zi as setDashboardConversationLinkOptions } from "./projection-CIBwgD3s.js";
|
|
3
|
+
import { Z as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setBotName, u as resetRuntimeConfig } from "./config-CzeZiMKs.js";
|
|
4
|
+
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, G as normalizeIdentityEmail, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, U as GOOGLE_IDENTITY_PROVIDER, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-C9oDAg4M.js";
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-BHHXNi-0.js";
|
|
6
6
|
import { b as slackMessageTsSchema, g as slackTeamIdSchema, h as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId, v as parseSlackMessageTs, y as slackMessageTsFromMs } from "./actor-D2iXzvlN.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import { $ as effectiveTaskOutcomes, A as parseSlackReviewItemClick, At as ingestEvent, Ct as markConversationRead, D as syncReviewItemSlackCards, E as readSlackReviewItemCardConversationId, G as ViewerTaskNotFoundError, M as parseSlackUserInputSubmission, Mt as missingAutomationSkillReason, N as parseSlackThreadId, R as logScheduledAutomationRunSkipped, T as createSlackReviewItemShow, Y as readViewerAutomationSummary, Z as readViewerAutomations, _t as collectAttachmentGarbage, at as appendAndEnqueueWebMessage, b as unpublishedArtifactHeaders, j as parseSlackReviewItemFormTarget, jt as findAutomationSkill, k as buildSlackReviewItemModal, kt as processWorkspaceSnapshotJob, lt as recordWebConversationActivity, n as executeAgentRun, nt as renderReviewItemMessage, ot as conversationTurnIdForMessage, pt as collectAttachmentUploadGarbage, q as readViewerAutomationExecutions, r as processBackgroundCompaction, rt as reviewItemChangeRecord, t as createAgentRunner, tt as deliverReviewItemChange, ut as webActorFromUser, v as publicArtifactHeaders, x as setConversationSubscription, xt as archiveConversation, y as readPublicArtifact, yt as requestAttachmentDeletion, z as scheduledAutomationRunAttributes } from "./agent-runner-H4YhvNBj.js";
|
|
7
|
+
import { $ as fenceLock, B as recordGoogleSignIn, G as createCache, J as getStateAdapter, K as disconnectStateAdapter, P as resolveActorIdentityId, Z as MUTATION_LOCK_TTL_MS, a as getConversationStore, et as withLock, f as withConversationEventLock, mt as createSlackDestination, o as getDb, pt as touchConversationDetail, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, x as withConversationMutationLock } from "./db-B-gtnNjr.js";
|
|
8
|
+
import { F as juniorDestinations, M as juniorConversations, T as juniorConversationEvents, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, x as juniorConversationBriefs } from "./executor-DZg20EqU.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Dss0lSV6.js";
|
|
10
|
+
import { D as parseSlackUserInputSubmission, E as parseSlackReviewItemFormTarget, S as findSlackThreadOwnerId, T as parseSlackReviewItemClick, _ as logScheduledAutomationRunSkipped, b as resolveSlackReviewItemCardConversationId, h as unpublishedArtifactHeaders, m as readPublicArtifact, n as executeAgentRun, p as publicArtifactHeaders, r as processBackgroundCompaction, t as createAgentRunner, v as scheduledAutomationRunAttributes, w as buildSlackReviewItemModal, x as syncReviewItemSlackCards, y as createSlackReviewItemShow } from "./agent-runner-CY9RvsTX.js";
|
|
12
11
|
import { a as getNextRunAtMs } from "./schedule-cP0AACm1.js";
|
|
13
|
-
import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-
|
|
12
|
+
import { i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-B1SO21Qa.js";
|
|
14
13
|
import { P as conversationTitleSchema, et as conversationBriefSchema, m as conversationFeedQuerySchema, x as conversationSurfaceSchema, y as conversationReportStatusSchema, z as annotationCard } from "./conversation-BNXfq6Lb.js";
|
|
15
14
|
import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
16
15
|
import { n as readSchedulerSecret, r as readSignInSecret } from "./secrets-DebYU866.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { E as getQueueProvider, _ as cacheWarmupQueueConsumer, a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, m as isConversationQueueMessageRejectedError, p as conversationQueueMessageSchema, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, v as createVercelCacheWarmupCallback, w as queueCallback, y as registerVercelCacheWarmupDevConsumer } from "./background-compaction-queue-CNrZ3QcU.js";
|
|
20
|
-
import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-DmV4CoNr.js";
|
|
21
|
-
import { c as coerceThreadConversationState, p as eventGuidance } from "./turn-session-routing-BD3-jJl7.js";
|
|
22
|
-
import { o as buttonUserInputField } from "./statuses-Hn-HsOph.js";
|
|
23
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-DJkh9Fky.js";
|
|
16
|
+
import { $ as slackChannelMessageEvent, F as renderTaskInput, J as isExperimentalFeatureEnabled, V as renderSlackObjectCard, X as getEventCatalog, Y as setExperimentalFeatures, Z as SLACK_EVENT_NAMESPACE, b as getAuthPausedConversationTurnId, et as slackChannelMessageReplyThreadTs, q as getExperimentalFeatures, tt as slackChannelMessageRunsAutomation } from "./session-stop-DW63Z3kj.js";
|
|
17
|
+
import { Ct as recordWebConversationActivity, Di as effectiveTaskOutcomes, Dt as collectAttachmentUploadGarbage, Ei as missingAutomationSkillReason, I as lookupSlackUserProfile, Nt as requestAttachmentDeletion, O as ingestEvent, Sr as joinPublicChannel, T as processWorkspaceSnapshotJob, Ti as findAutomationSkill, Xt as listPendingAgentInvocationMailboxAppends, Zt as listPendingAgentInvocationResults, _i as readViewerAutomations, _t as reviewItemChangeRecord, bt as conversationTurnIdForMessage, ct as archiveConversation, di as ViewerTaskNotFoundError, gt as renderReviewItemMessage, hi as readViewerAutomationSummary, ht as deliverReviewItemChange, jt as collectAttachmentGarbage, lr as parseSlackThreadId, mn as enqueueAgentInvocation, pi as readViewerAutomationExecutions, qn as setConversationSubscription, ut as markConversationRead, wt as webActorFromUser, xn as recordSubagentEnded, yt as appendAndEnqueueWebMessage } from "./warmup-Bz9bzkzN.js";
|
|
24
18
|
import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-Cva5ZOwW.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { a as
|
|
30
|
-
import { i as
|
|
31
|
-
import { t as
|
|
32
|
-
import { t as
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
19
|
+
import { E as notifyAutomationBlocked, G as readScheduledAutomation, I as recordAutomationExecution, J as scheduledRunId, O as existingConversationId, U as listScheduledAutomationsForTeam, X as blockEventAutomation, Y as withScheduledAutomationLock, Z as collectEventAutomationMatchKeys, b as listPendingDispatchMailboxAppends, bt as eventGuidance, c as coerceThreadConversationState, d as confirmDispatchMailboxAppend, et as findMatchingEventAutomations, f as createOrGetDispatch, g as getDispatchRecord, l as buildDispatchId, lt as automationVersionOf, ot as admitEventAutomationRun, p as getDispatchConversationId, q as saveScheduledAutomationInLock, st as eventAutomationRunLimitReason, v as getPluginDispatchProjection, w as markDispatchFailed, y as isTerminalDispatchStatus } from "./turn-session-routing-BFMS9ATF.js";
|
|
20
|
+
import { s as buttonUserInputField } from "./web-message-id-lNodcCOI.js";
|
|
21
|
+
import { a as queueCallback, c as verifyConversationQueueMessage, f as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyBackgroundCompactionMessage, o as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, s as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-CXFq1_Cz.js";
|
|
22
|
+
import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, y as listActiveConversationIds } from "./store-C28I0CVW.js";
|
|
23
|
+
import { a as getSandboxResourceConfig, s as setSandboxResourceConfig } from "./install-t1KQyTUs.js";
|
|
24
|
+
import { i as registerVercelCacheWarmupDevConsumer, l as verifyWorkspaceSnapshotJobMessage, n as cacheWarmupQueueConsumer, o as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, r as createVercelCacheWarmupCallback } from "./queue-DtCDaIct.js";
|
|
25
|
+
import { n as verifySlackSignature, t as runWithSlackInstallation } from "./adapter-context-Cx9fn9B3.js";
|
|
26
|
+
import { A as resolveAllowedDomains, B as runAutoArchiveSweep, C as readConversationPendingMessages, D as isAllowedDomain, E as assertNoLegacyAllowedDomains, F as readReviewItemForUser, I as reviewItemChange, K as backfillCacheWarmingGaps, M as ReviewItemActionError, N as actOnReviewItem, O as isAllowedSignInEmail, P as closeReviewItemsAnsweredByReply, R as archiveViewerDoneConversations, S as cancelConversationPendingMessagesForViewer, V as setConversationAutoArchive, W as runSavingsRefillSlice, X as readObjectLinkTypes, _ as appendConversationMessageForViewer, _t as stripLeadingBotMention, a as pinConversation, at as buildSlackInboundMessage, b as decodeConversationCursor, bt as getThreadStopDecision, ct as normalizeIncomingSlackThreadId, dt as enqueueAgentDispatch, et as isPublicAddress, ft as failStoppedDispatch, g as readConversationRecordFromSql, gt as startProcessingReaction, ht as bindMessageAuthorIdentityId, i as readConversationFeed, it as getProductionSlackAdapter, j as stopConversation, k as readEnvList, lt as withNormalizedThreadId, mt as createSlackWebApiStatusSender, n as steerConversationPendingMessagesForViewer, nt as createProductionConversationWorkOptions, ot as clearSlackPendingReactions, pt as recordSkippedConversationMessage, q as GET$4, rt as createProductionSlackWebhookServices, s as readConversationDetail, st as slackInboundMessageId, t as stopConversationTurnForViewer, tt as publicAddressLookup, v as createConversationForViewer, vt as parseContent, x as encodeConversationCursor, yt as SubscribedReplyReason } from "./stop-7p1i08CY.js";
|
|
27
|
+
import { s as conversationPendingMessageDeliverySchema } from "./conversation-feed-Clf_cv0n.js";
|
|
28
|
+
import { a as resumeConversationDelivery } from "./conversation-turn-D7SEZgTG.js";
|
|
29
|
+
import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-oOMv1t4O.js";
|
|
30
|
+
import { t as bindMessageAgent } from "./message-BLUCzJXN.js";
|
|
31
|
+
import { t as bindSpawnAgent } from "./spawn-D_RnFYfy.js";
|
|
32
|
+
import { a as pluginTaskQueueConsumer, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-BVUJbQ28.js";
|
|
33
|
+
import { t as processPluginTask } from "./task-runner-CWi8j7Z6.js";
|
|
34
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BSFKUIb4.js";
|
|
36
35
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-BBX07Jzt.js";
|
|
37
|
-
import { o as unlinkProvider } from "./connections-
|
|
38
|
-
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
36
|
+
import { o as unlinkProvider } from "./connections-CDYhMfrs.js";
|
|
37
|
+
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DoD0gW-j.js";
|
|
39
38
|
import { t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
|
|
40
|
-
import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-
|
|
41
|
-
import { t as processConversationWork } from "./worker-
|
|
39
|
+
import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-BHhefEb7.js";
|
|
40
|
+
import { t as processConversationWork } from "./worker-BspReIIK.js";
|
|
42
41
|
import { createRequire } from "node:module";
|
|
43
42
|
import { Hono } from "hono";
|
|
44
43
|
import * as z from "zod";
|
|
45
44
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
46
|
-
import { and, asc,
|
|
45
|
+
import { and, asc, eq, inArray, isNotNull, isNull, lte, ne, or, sql } from "drizzle-orm";
|
|
47
46
|
import { EVENT_SUMMARY_MAX_LENGTH, EVENT_TEXT_MAX_LENGTH, dispatchOptionsSchema, eventSchema, eventTriggerFiltersText, isSlackDestination, userSchema } from "@sentry/junior-plugin-api";
|
|
48
47
|
import { pathToFileURL } from "node:url";
|
|
49
48
|
import { Message, ThreadImpl } from "chat";
|
|
50
49
|
import pLimit from "p-limit";
|
|
51
50
|
import net from "node:net";
|
|
52
51
|
import { decodeJwt } from "jose";
|
|
53
|
-
import { performance } from "node:perf_hooks";
|
|
54
52
|
import { HTTPException } from "hono/http-exception";
|
|
55
53
|
import https from "node:https";
|
|
56
54
|
import * as acp from "@agentclientprotocol/sdk";
|
|
@@ -60,250 +58,6 @@ import { bodyLimit } from "hono/body-limit";
|
|
|
60
58
|
import { createAuthMiddleware } from "better-auth/api";
|
|
61
59
|
import { getSessionCookie } from "better-auth/cookies";
|
|
62
60
|
import { betterAuth } from "better-auth/minimal";
|
|
63
|
-
// src/chat/cache-warming/backfill.ts
|
|
64
|
-
/**
|
|
65
|
-
* Fill of the empty cache warming gap lists from stored Conversation
|
|
66
|
-
* history, about once a month.
|
|
67
|
-
*
|
|
68
|
-
* `warmup.ts` learns reply gaps only from idle periods after it is deployed.
|
|
69
|
-
* Until a `gapSegment` has gaps, Junior sends no warmups for it. This replays
|
|
70
|
-
* the stored model calls of the last `GLOBAL_GAPS_TTL_MS` with the same rules
|
|
71
|
-
* as live recording, so warming can start soon after the first deploy.
|
|
72
|
-
*
|
|
73
|
-
* The heartbeat runs it. Only one run claims it, and a completed run marks
|
|
74
|
-
* the install as done, also when it stopped on its time budget or skipped a
|
|
75
|
-
* batch that the statement timeout canceled. It fills only segment lists
|
|
76
|
-
* that are empty when it starts, so it does not add history to gaps that
|
|
77
|
-
* live recording already has.
|
|
78
|
-
*
|
|
79
|
-
* History does not tell the plugin work state or the archive state that a
|
|
80
|
-
* Conversation had when an idle period started. So it fills only the
|
|
81
|
-
* segments of Conversations that are not archived and have work state
|
|
82
|
-
* `none`, which most Conversations have. The `open` and `done` segments and
|
|
83
|
-
* the `archived:*` segments stay empty until live gaps arrive. Until then,
|
|
84
|
-
* `decideWarmup` leans on their `parentGapSegment`, a `none` segment that
|
|
85
|
-
* this fills. Each idle period still records its gap, so the segment fills
|
|
86
|
-
* from live idle periods.
|
|
87
|
-
*/
|
|
88
|
-
const BACKFILL_KEY = "junior:cache_warming:backfill:work_state:v2";
|
|
89
|
-
const BACKFILL_CLAIM_TTL_MS = 60 * MINUTE_MS;
|
|
90
|
-
const BACKFILL_DONE_TTL_MS = GLOBAL_GAPS_TTL_MS;
|
|
91
|
-
const CONVERSATION_BATCH_SIZE = 10;
|
|
92
|
-
const QUERY_CANCELED = "57014";
|
|
93
|
-
const BACKFILL_BUDGET_MS = 6e4;
|
|
94
|
-
const BACKFILL_GAPS_MAX = GLOBAL_GAPS_MAX / 2;
|
|
95
|
-
const BACKFILL_SEGMENTS = new Set([true, false].flatMap((userActor) => [
|
|
96
|
-
0,
|
|
97
|
-
1,
|
|
98
|
-
2,
|
|
99
|
-
3
|
|
100
|
-
].map((endedTurns) => historySegment(userActor, endedTurns))));
|
|
101
|
-
function historySegment(userActor, endedTurns) {
|
|
102
|
-
return gapSegment({
|
|
103
|
-
userActor,
|
|
104
|
-
endedTurns,
|
|
105
|
-
workState: "none",
|
|
106
|
-
archived: false
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
async function loadConversations(windowStartMs) {
|
|
110
|
-
return await getDb().select({
|
|
111
|
-
conversationId: juniorConversations.conversationId,
|
|
112
|
-
kind: juniorConversations.kind,
|
|
113
|
-
parentConversationId: juniorConversations.parentConversationId
|
|
114
|
-
}).from(juniorConversations).where(and(gte(juniorConversations.lastActivityAt, new Date(windowStartMs)), isNull(juniorConversations.transcriptPurgedAt))).orderBy(desc(juniorConversations.lastActivityAt), juniorConversations.conversationId);
|
|
115
|
-
}
|
|
116
|
-
async function loadEvents(conversationIds) {
|
|
117
|
-
const events = juniorConversationEvents;
|
|
118
|
-
const isUserMessage = sql`${events.type} = 'user_message'`;
|
|
119
|
-
const message = sql`CASE
|
|
120
|
-
WHEN ${events.type} <> 'assistant_message' THEN NULL
|
|
121
|
-
WHEN ${events.schemaVersion} >= 2 THEN (${events.payload}->>'message')::jsonb
|
|
122
|
-
ELSE ${events.payload}
|
|
123
|
-
END`;
|
|
124
|
-
return await getDb().select({
|
|
125
|
-
conversationId: events.conversationId,
|
|
126
|
-
type: sql`${events.type}`,
|
|
127
|
-
personInstruction: sql`CASE WHEN ${isUserMessage} THEN (${events.payload}->'provenance'->'actor'->>'userId') IS NOT NULL END`,
|
|
128
|
-
stopReason: sql`(${message})->>'stopReason'`,
|
|
129
|
-
startedAtMs: sql`(${message})->>'timestamp'`,
|
|
130
|
-
cacheRead: sql`${events.payload}->'usage'->>'cacheRead'`,
|
|
131
|
-
cacheWrite: sql`${events.payload}->'usage'->>'cacheWrite'`
|
|
132
|
-
}).from(events).innerJoin(juniorConversations, eq(juniorConversations.conversationId, events.conversationId)).where(and(inArray(events.conversationId, conversationIds), or(eq(events.type, "assistant_message"), and(isUserMessage, sql`(${events.payload}->'provenance'->>'authority') = 'instruction'`)), gte(events.createdAt, juniorConversations.createdAt))).orderBy(events.conversationId, events.seq);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Replay the model calls of one Conversation the way the recorder in
|
|
136
|
-
* `warmup.ts` sees them, and return the gap of each idle period.
|
|
137
|
-
*
|
|
138
|
-
* Live recording measures from the start of the request that ended a Turn to
|
|
139
|
-
* the start of the next recorded request. Here both times are the
|
|
140
|
-
* `timestamp` of the stored assistant message, which Pi sets when it starts
|
|
141
|
-
* the request. That is the closest stored time to the recorder's clock.
|
|
142
|
-
*
|
|
143
|
-
* Live recording records gaps only for idle periods that it could warm. The
|
|
144
|
-
* stored usage gives the prefix size, so periods with a prefix below
|
|
145
|
-
* `MIN_WARMUP_PREFIX_TOKENS` are skipped. The model, cache retention, and
|
|
146
|
-
* snapshot size of the request are not checked: this assumes that reply
|
|
147
|
-
* timing does not depend on them.
|
|
148
|
-
*/
|
|
149
|
-
function replayConversation(kind, events, nowMs) {
|
|
150
|
-
const gaps = [];
|
|
151
|
-
const close = (idle, untilMs) => {
|
|
152
|
-
const gapMs = untilMs - idle.sinceMs;
|
|
153
|
-
if (!idle.eligible || gapMs <= 0) return;
|
|
154
|
-
gaps.push({
|
|
155
|
-
segment: idle.segment,
|
|
156
|
-
sinceMs: idle.sinceMs,
|
|
157
|
-
gapMs: gapMs >= 33e5 ? NO_REPLY_GAP_MS : gapMs
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
let userActor = false;
|
|
161
|
-
let inTurn = false;
|
|
162
|
-
let endedTurns = 0;
|
|
163
|
-
let lastCallMs;
|
|
164
|
-
let idle;
|
|
165
|
-
for (const event of events) {
|
|
166
|
-
if (event.type === "user_message") {
|
|
167
|
-
if (!inTurn) {
|
|
168
|
-
userActor = event.personInstruction === true && kind !== "task";
|
|
169
|
-
inTurn = true;
|
|
170
|
-
}
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
if (event.stopReason !== "toolUse") inTurn = false;
|
|
174
|
-
const startedAtMs = event.startedAtMs === null ? NaN : Number(event.startedAtMs);
|
|
175
|
-
if (!Number.isFinite(startedAtMs) || event.stopReason === "error" || event.stopReason === "aborted") continue;
|
|
176
|
-
if (idle) close(idle, startedAtMs);
|
|
177
|
-
idle = void 0;
|
|
178
|
-
if (lastCallMs !== void 0 && startedAtMs - lastCallMs > CONVERSATION_STATE_TTL_MS) endedTurns = 0;
|
|
179
|
-
lastCallMs = startedAtMs;
|
|
180
|
-
if (event.stopReason === "stop") {
|
|
181
|
-
const prefixTokens = Number(event.cacheRead ?? 0) + Number(event.cacheWrite ?? 0);
|
|
182
|
-
idle = {
|
|
183
|
-
sinceMs: startedAtMs,
|
|
184
|
-
segment: historySegment(userActor, endedTurns),
|
|
185
|
-
eligible: prefixTokens >= MIN_WARMUP_PREFIX_TOKENS
|
|
186
|
-
};
|
|
187
|
-
endedTurns += 1;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (idle && nowMs - idle.sinceMs >= 33e5) close(idle, nowMs);
|
|
191
|
-
return gaps;
|
|
192
|
-
}
|
|
193
|
-
function isQueryCanceled(error) {
|
|
194
|
-
let current = error;
|
|
195
|
-
for (let depth = 0; current && depth < 6; depth += 1) {
|
|
196
|
-
if (typeof current !== "object") return false;
|
|
197
|
-
if (current.code === QUERY_CANCELED) return true;
|
|
198
|
-
current = current.cause;
|
|
199
|
-
}
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
async function collectGaps(nowMs, budgetMs) {
|
|
203
|
-
const startedAt = performance.now();
|
|
204
|
-
const windowStartMs = nowMs - GLOBAL_GAPS_TTL_MS;
|
|
205
|
-
const conversations = await loadConversations(windowStartMs);
|
|
206
|
-
const recorded = [];
|
|
207
|
-
let scanned = 0;
|
|
208
|
-
let canceledBatches = 0;
|
|
209
|
-
let budgetExceeded = false;
|
|
210
|
-
for (let i = 0; i < conversations.length; i += CONVERSATION_BATCH_SIZE) {
|
|
211
|
-
if (i > 0 && performance.now() - startedAt >= budgetMs) {
|
|
212
|
-
budgetExceeded = true;
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
const batch = conversations.slice(i, i + CONVERSATION_BATCH_SIZE);
|
|
216
|
-
let rows;
|
|
217
|
-
try {
|
|
218
|
-
rows = await loadEvents(batch.map((row) => row.conversationId));
|
|
219
|
-
} catch (error) {
|
|
220
|
-
if (!isQueryCanceled(error)) throw error;
|
|
221
|
-
canceledBatches += 1;
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
|
-
const events = /* @__PURE__ */ new Map();
|
|
225
|
-
for (const event of rows) {
|
|
226
|
-
const list = events.get(event.conversationId) ?? [];
|
|
227
|
-
list.push(event);
|
|
228
|
-
events.set(event.conversationId, list);
|
|
229
|
-
}
|
|
230
|
-
for (const conversation of batch) {
|
|
231
|
-
const gaps = replayConversation(conversationKindFromRow(conversation), events.get(conversation.conversationId) ?? [], nowMs);
|
|
232
|
-
recorded.push(...gaps.filter((gap) => gap.sinceMs >= windowStartMs));
|
|
233
|
-
}
|
|
234
|
-
scanned += batch.length;
|
|
235
|
-
}
|
|
236
|
-
recorded.sort((a, b) => a.sinceMs - b.sinceMs);
|
|
237
|
-
const bySegment = /* @__PURE__ */ new Map();
|
|
238
|
-
for (const gap of recorded) {
|
|
239
|
-
const list = bySegment.get(gap.segment) ?? [];
|
|
240
|
-
list.push(gap.gapMs);
|
|
241
|
-
bySegment.set(gap.segment, list);
|
|
242
|
-
}
|
|
243
|
-
return {
|
|
244
|
-
bySegment,
|
|
245
|
-
scanned,
|
|
246
|
-
canceledBatches,
|
|
247
|
-
budgetExceeded
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Fill each empty cache warming gap list from the stored Conversation
|
|
252
|
-
* history. The heartbeat calls it each minute. After a run completes, a call
|
|
253
|
-
* makes one state request and returns, until the completed run expires.
|
|
254
|
-
*
|
|
255
|
-
* A run that uses its scan budget writes the gaps that it has and also
|
|
256
|
-
* completes. Some gaps are better than none, and a run that cannot finish
|
|
257
|
-
* would otherwise try again each hour.
|
|
258
|
-
*/
|
|
259
|
-
async function backfillCacheWarmingGaps(args) {
|
|
260
|
-
if (!getChatConfig().cacheWarmingEnabled) return;
|
|
261
|
-
const state = getStateAdapter();
|
|
262
|
-
await state.connect();
|
|
263
|
-
if (!await state.setIfNotExists(BACKFILL_KEY, "running", BACKFILL_CLAIM_TTL_MS)) return;
|
|
264
|
-
await withSpan("cache_warming.backfill", "cache_warming.backfill", {}, async (setSpanAttributes) => {
|
|
265
|
-
const emptySegments = /* @__PURE__ */ new Set();
|
|
266
|
-
for (const segment of BACKFILL_SEGMENTS) if ((await state.getList(segmentGapsKey(segment))).length === 0) emptySegments.add(segment);
|
|
267
|
-
const { bySegment, scanned, canceledBatches, budgetExceeded } = await collectGaps(args.nowMs, args.budgetMs ?? BACKFILL_BUDGET_MS);
|
|
268
|
-
const logAttributes = {
|
|
269
|
-
"app.cache_warming.backfill.conversation_count": scanned,
|
|
270
|
-
"app.cache_warming.backfill.canceled_batch_count": canceledBatches,
|
|
271
|
-
"app.cache_warming.backfill.budget_exceeded": budgetExceeded
|
|
272
|
-
};
|
|
273
|
-
if (scanned === 0 && canceledBatches > 0) {
|
|
274
|
-
logInfo("cache_warming.backfill.not_completed", logAttributes);
|
|
275
|
-
setSpanAttributes({
|
|
276
|
-
...logAttributes,
|
|
277
|
-
"app.cache_warming.backfill.outcome": "not_completed"
|
|
278
|
-
});
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
let gapCount = 0;
|
|
282
|
-
let segmentCount = 0;
|
|
283
|
-
for (const [segment, gaps] of bySegment) {
|
|
284
|
-
if (!emptySegments.has(segment)) continue;
|
|
285
|
-
const key = segmentGapsKey(segment);
|
|
286
|
-
const newest = gaps.slice(-BACKFILL_GAPS_MAX);
|
|
287
|
-
for (const gapMs of newest) await state.appendToList(key, gapMs, {
|
|
288
|
-
maxLength: GLOBAL_GAPS_MAX,
|
|
289
|
-
ttlMs: GLOBAL_GAPS_TTL_MS
|
|
290
|
-
});
|
|
291
|
-
gapCount += newest.length;
|
|
292
|
-
segmentCount += 1;
|
|
293
|
-
}
|
|
294
|
-
await state.set(BACKFILL_KEY, "done", BACKFILL_DONE_TTL_MS);
|
|
295
|
-
const completed = {
|
|
296
|
-
...logAttributes,
|
|
297
|
-
"app.cache_warming.backfill.gap_count": gapCount,
|
|
298
|
-
"app.cache_warming.backfill.segment_count": segmentCount
|
|
299
|
-
};
|
|
300
|
-
logInfo("cache_warming.backfill.completed", completed);
|
|
301
|
-
setSpanAttributes({
|
|
302
|
-
...completed,
|
|
303
|
-
"app.cache_warming.backfill.outcome": "completed"
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
61
|
// src/chat/events/timers.ts
|
|
308
62
|
/** Publish a bounded batch of due timers; the mailbox owns agent execution. */
|
|
309
63
|
async function runTimerWatchHeartbeat(args) {
|
|
@@ -431,6 +185,11 @@ function createHeartbeatContext(args) {
|
|
|
431
185
|
db: getDb(),
|
|
432
186
|
embedder: createPluginEmbedder(pluginName),
|
|
433
187
|
events: args.events,
|
|
188
|
+
reviewItems: { forConversation: (conversationId) => createPluginReviewItems({
|
|
189
|
+
conversationId,
|
|
190
|
+
plugin: pluginName,
|
|
191
|
+
show: args.showReviewItem ?? (async () => {})
|
|
192
|
+
}) },
|
|
434
193
|
state: createPluginState(pluginName),
|
|
435
194
|
log: createPluginLogger(pluginName),
|
|
436
195
|
agent: {
|
|
@@ -1510,7 +1269,8 @@ async function runPluginHeartbeats(args) {
|
|
|
1510
1269
|
conversationWorkQueue: args.conversationWorkQueue,
|
|
1511
1270
|
events: createPluginEventPublisher(plugin, args.events),
|
|
1512
1271
|
plugin,
|
|
1513
|
-
nowMs: args.nowMs
|
|
1272
|
+
nowMs: args.nowMs,
|
|
1273
|
+
showReviewItem: args.showReviewItem
|
|
1514
1274
|
}))), PLUGIN_HEARTBEAT_TIMEOUT_MS);
|
|
1515
1275
|
if (typeof result?.dispatchCount === "number" && result.dispatchCount > 0) logInfo("plugin.heartbeat.dispatched", {
|
|
1516
1276
|
"app.dispatch.count": result.dispatchCount,
|
|
@@ -1618,13 +1378,19 @@ async function runHeartbeat(args) {
|
|
|
1618
1378
|
await runPluginHeartbeats({
|
|
1619
1379
|
conversationWorkQueue: queue,
|
|
1620
1380
|
events,
|
|
1621
|
-
nowMs: args.nowMs
|
|
1381
|
+
nowMs: args.nowMs,
|
|
1382
|
+
showReviewItem: args.showReviewItem
|
|
1622
1383
|
});
|
|
1623
1384
|
try {
|
|
1624
1385
|
await backfillCacheWarmingGaps({ nowMs: args.nowMs });
|
|
1625
1386
|
} catch (error) {
|
|
1626
1387
|
logException(error, "cache_warming.backfill.failed");
|
|
1627
1388
|
}
|
|
1389
|
+
try {
|
|
1390
|
+
await runSavingsRefillSlice({ nowMs: args.nowMs });
|
|
1391
|
+
} catch (error) {
|
|
1392
|
+
logException(error, "cache_warming.savings_refill.failed");
|
|
1393
|
+
}
|
|
1628
1394
|
}
|
|
1629
1395
|
// src/handlers/scheduler-auth.ts
|
|
1630
1396
|
/** Check the bearer secret that internal cron requests must send. */
|
|
@@ -1645,7 +1411,8 @@ async function GET$3(request, waitUntil, options = {}) {
|
|
|
1645
1411
|
waitUntil(() => runHeartbeat({
|
|
1646
1412
|
conversationWorkQueue: options.conversationWorkQueue,
|
|
1647
1413
|
events: options.events,
|
|
1648
|
-
nowMs
|
|
1414
|
+
nowMs,
|
|
1415
|
+
showReviewItem: options.showReviewItem
|
|
1649
1416
|
}).catch((error) => {
|
|
1650
1417
|
logException(error, "heartbeat.failed", { "app.heartbeat.now_ms": nowMs });
|
|
1651
1418
|
}));
|
|
@@ -2280,10 +2047,11 @@ async function act(args) {
|
|
|
2280
2047
|
const { services, target } = args;
|
|
2281
2048
|
const actor = await resolveActingUser(services, args.payload, target);
|
|
2282
2049
|
if (!actor) return;
|
|
2283
|
-
const conversationId = await
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2050
|
+
const conversationId = await resolveSlackReviewItemCardConversationId({
|
|
2051
|
+
channelId: target.channelId,
|
|
2052
|
+
teamId: actor.teamId,
|
|
2053
|
+
threadTs: target.threadTs
|
|
2054
|
+
});
|
|
2287
2055
|
const delivery = {
|
|
2288
2056
|
queue: services.queue,
|
|
2289
2057
|
show: createSlackReviewItemShow(() => services.adapter)
|
|
@@ -3029,19 +2797,21 @@ async function resolveSlackConversationId(args) {
|
|
|
3029
2797
|
const providerThread = parseSlackThreadId(args.canonicalThreadId);
|
|
3030
2798
|
const conversationStore = args.conversationStore ?? getConversationStore();
|
|
3031
2799
|
if (!providerThread) return args.canonicalThreadId;
|
|
3032
|
-
const
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
};
|
|
3038
|
-
const ownerId = await conversationStore.getConversationIdByProviderConversation(thread);
|
|
2800
|
+
const ownerId = await findSlackThreadOwnerId({
|
|
2801
|
+
channelId: providerThread.channelId,
|
|
2802
|
+
conversationStore,
|
|
2803
|
+
teamId: args.installation.teamId ?? "",
|
|
2804
|
+
threadTs: providerThread.threadTs
|
|
2805
|
+
});
|
|
3039
2806
|
if (ownerId) return ownerId;
|
|
3040
2807
|
if (args.claimAtMs === void 0 || !args.installation.teamId) return args.canonicalThreadId;
|
|
3041
2808
|
return await conversationStore.claimProviderConversation({
|
|
3042
|
-
...thread,
|
|
3043
2809
|
atMs: args.claimAtMs,
|
|
3044
|
-
conversationId: args.canonicalThreadId
|
|
2810
|
+
conversationId: args.canonicalThreadId,
|
|
2811
|
+
provider: "slack",
|
|
2812
|
+
providerConversationId: providerThread.threadTs,
|
|
2813
|
+
providerDestinationId: providerThread.channelId,
|
|
2814
|
+
providerTenantId: args.installation.teamId
|
|
3045
2815
|
});
|
|
3046
2816
|
}
|
|
3047
2817
|
/**
|
|
@@ -7692,7 +7462,6 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
|
|
|
7692
7462
|
"/api/images/*",
|
|
7693
7463
|
"/api/objects",
|
|
7694
7464
|
"/api/stats",
|
|
7695
|
-
"/api/reply-times",
|
|
7696
7465
|
"/api/versions",
|
|
7697
7466
|
"/api/conversations",
|
|
7698
7467
|
"/api/conversations/*",
|
|
@@ -8155,7 +7924,8 @@ async function createApp(options) {
|
|
|
8155
7924
|
app.get("/api/internal/heartbeat", (c) => {
|
|
8156
7925
|
return GET$3(c.req.raw, waitUntil, {
|
|
8157
7926
|
conversationWorkQueue,
|
|
8158
|
-
events
|
|
7927
|
+
events,
|
|
7928
|
+
showReviewItem: createSlackReviewItemShow(getProductionSlackAdapter)
|
|
8159
7929
|
});
|
|
8160
7930
|
});
|
|
8161
7931
|
app.get("/api/internal/retention", (c) => {
|