@sentry/junior 0.280.0 → 0.281.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-DVN3iwf9.js → adapter-RVQGEa98.js} +1 -1
- package/dist/{admin-Q_UI--9W.js → admin-DQpHx6Og.js} +1 -1
- package/dist/{agent-runner-_PYLv4Qo.js → agent-runner-B229gXUY.js} +998 -975
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +39 -33
- package/dist/{app-CL2zzzE0.d.ts → app-BQ9RZS43.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +42 -34
- package/dist/{assistant-reply-DbebsAxi.js → assistant-reply-DQbtwc6j.js} +1 -1
- package/dist/{automation-CPqRFjIa.js → automation-sIsmIXH7.js} +1 -1
- package/dist/{background-compaction-queue-B9lmh8Ml.js → background-compaction-queue-oegyrxSe.js} +2 -2
- package/dist/{briefs-Dej7V0Bz.js → briefs-BwzGWJgR.js} +4 -8
- package/dist/{catalog-runtime-DpN0sWQ6.js → catalog-runtime-ClKzLvbN.js} +1 -1
- package/dist/cli/chat.js +14 -14
- 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/{client-h2A2ZPzY.js → client-DkG0Tj53.js} +2 -2
- package/dist/{config-CusBFORe.js → config-3AZ11aSM.js} +1 -1
- package/dist/{connections-C4h6mGha.js → connections-C0ut_6RW.js} +10 -10
- package/dist/{conversation-DExTZw8B.js → conversation-DNtcULyX.js} +29 -8
- package/dist/{conversation-pending-messages-Dgz6hrJs.js → conversation-pending-messages-LlFnr9-m.js} +10 -2
- package/dist/{conversation-privacy-2cm6OpNg.js → conversation-privacy-DAgeBGLN.js} +1 -1
- package/dist/{credential-sync-DK06Jgt-.js → credential-sync-Bg8NPuvj.js} +13 -13
- package/dist/{db-Dsvk1Tp1.d.ts → db-BCFM0CUX.d.ts} +1 -1
- package/dist/{executor-Cmr0J8W3.js → executor-DLKnzP6S.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-CGnh65_X.js → logging-DHzrobea.js} +1 -1
- package/dist/{message-RpAnqHPY.js → message-LR8z5jXJ.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-BBnhVKuX.js → oauth-callback-server-EWdpj0_y.js} +2 -2
- package/dist/{projection-C1MghKyI.js → projection-Bhz1tp0G.js} +60 -27
- package/dist/{prompt-BcHg-BMy.js → prompt-DI6KCtwb.js} +5 -26
- package/dist/{registry-DR7DjX9H.js → registry-EjhulgQW.js} +1 -1
- package/dist/{resolve-0Ful4oDv.js → resolve-Cw6OW4Fj.js} +3 -3
- package/dist/{result-Dd9kCuQ-.js → result-BoD0jevy.js} +9 -9
- package/dist/{runner-yiY8gUUu.js → runner-D22bsBDS.js} +11 -11
- package/dist/{sandbox-egress-signals-BzQVHCMz.js → sandbox-egress-signals-BG5GYacQ.js} +1 -1
- package/dist/{schema-C5pEgfHc.js → schema-BN34Jy-U.js} +3 -3
- package/dist/{schema-BkMmF552.d.ts → schema-CsqJzkP5.d.ts} +68 -9
- package/dist/{service-account-PIMpWZHF.js → service-account-Dd1nnAQZ.js} +3 -3
- package/dist/{service-account-Cu7HFLZQ.js → service-account-xo-CeMqI.js} +3 -3
- package/dist/{session-stop-CDEMsNtv.js → session-stop-CHSYB2uw.js} +12 -12
- package/dist/{skills-B2xIoe0f.js → skills-BGJr6xtW.js} +2 -2
- package/dist/{spawn-C0DySQRV.js → spawn-Cl8WS7zi.js} +2 -2
- package/dist/{stop-Dj5-nrAo.js → stop-C9lHWpvl.js} +120 -48
- package/dist/{store-QzOfDwKA.js → store-C4z8gOgZ.js} +3 -3
- package/dist/{store-Dlio-o6u.js → store-DeTnwVJt.js} +4 -4
- package/dist/{task-queue-Cp1V_XW3.js → task-queue-BBos68l0.js} +3 -3
- package/dist/{task-runner-CQkkUj3o.js → task-runner-BSF9zO-H.js} +6 -6
- package/dist/{thread-state-Bn87cfzE.js → thread-state-DGq1o5JX.js} +4 -4
- package/dist/{turn-failure-response-CQebxByj.js → turn-failure-response--9bA4uLP.js} +7 -7
- package/dist/{turn-lifecycle-CJJsOhXB.js → turn-lifecycle-t5fimxwQ.js} +1 -1
- package/dist/{turn-session-routing-bmG330Cf.js → turn-session-routing-RBtUe-3y.js} +9 -9
- package/dist/{validation-D1wcf7hp.js → validation-DrR0leBT.js} +1 -1
- package/dist/{version-BeHSXUK6.js → version-D_HFt_Dq.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BZ0Hp5Nb.js → viewer-DWlpSFdj.js} +7 -5
- package/dist/{work-BTcCIbWu.js → work-pPoqtRea.js} +10 -10
- package/dist/{worker-D3fDK6zc.js → worker-CoVKgJ-O.js} +6 -6
- package/package.json +4 -4
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { i as getActiveSpan, r as continueTrace } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { $ as completeTurnRecord, $a as notInheritedByForkChild, $n as takeReviewItem, A as getConversationMessageSlackTs, Aa as createPluginLogger, Ai as removeReactionFromMessage, Ba as conversationViewerMarks, Ci as addReactionToMessage, D as buildConversationContext, E as appendThreadContextMessages, En as webActorUserIds, F as turnHasReply, Fa as conversationHasParticipantUser, Fi as SlackActionError, Ga as readLatestConversationBrief, H as AuthorizationFlowDisabledError, Ha as viewerConversationMembership, Hi as normalizeSlackConversationId, I as upsertConversationMessage, Ia as conversationIsMemberRoot, Ii as downloadPrivateSlackFile, J as wasPendingAuthStopped, Ja as readConversationEventPageAround, Jn as getReviewItem, K as clearPendingAuth, Ka as readConversationEventPage, La as conversationNotArchivedForEmail, Ln as getPlugins, Lr as verifyTimerWatchCredentialSubject, M as markConversationMessage, Ma as readConversationAccessFromSql, N as normalizeConversationText, Na as conversationArchivedForEmail, O as createConversationMemoryService, P as recordDeliveredAssistantMessage, Pa as conversationArchivedForUser, Q as abandonTurnRecord, R as PluginCredentialFailureError, Ra as conversationNotArchivedForUser, Ri as getHeaderString, Rr as JUNIOR_THREAD_STATE_TTL_MS, S as resolveConversationTitle, Si as truncateStatusText, Sn as isExperimentalFeatureEnabled, Ut as persistWithRetry, Va as readConversationViewerMarks, Vi as isDmChannel, Wi as withSlackRetries, Wn as closeReviewItem, X as loadTurnCheckpoint, Xn as listReplyActionItems, Z as saveTurnCheckpoint, Za as buildSentryConversationUrl, Zn as listWaitingConversations, a as loadProjection, an as trimTrailingAssistantMessages, ar as isOnlyAssignee, bi as normalizeSlackStatusText, co as
|
|
3
|
-
import { a as completeText, c as resolveGatewayModel, m as escapeXml, r as completeDecision, x as isProviderRetryError } from "./client-
|
|
4
|
-
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName, y as createS3AttachmentStorage } from "./config-
|
|
5
|
-
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, S as setTags, T as withLogContext, W as isRecord, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
6
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
import { h as startSpan, i as getActiveSpan, r as continueTrace } from "./sentry-BRTJqumy.js";
|
|
2
|
+
import { $ as completeTurnRecord, $a as notInheritedByForkChild, $n as takeReviewItem, A as getConversationMessageSlackTs, Aa as createPluginLogger, Ai as removeReactionFromMessage, Ba as conversationViewerMarks, Ci as addReactionToMessage, D as buildConversationContext, E as appendThreadContextMessages, En as webActorUserIds, F as turnHasReply, Fa as conversationHasParticipantUser, Fi as SlackActionError, Ga as readLatestConversationBrief, H as AuthorizationFlowDisabledError, Ha as viewerConversationMembership, Hi as normalizeSlackConversationId, I as upsertConversationMessage, Ia as conversationIsMemberRoot, Ii as downloadPrivateSlackFile, J as wasPendingAuthStopped, Ja as readConversationEventPageAround, Jn as getReviewItem, K as clearPendingAuth, Ka as readConversationEventPage, La as conversationNotArchivedForEmail, Ln as getPlugins, Lr as verifyTimerWatchCredentialSubject, M as markConversationMessage, Ma as readConversationAccessFromSql, N as normalizeConversationText, Na as conversationArchivedForEmail, O as createConversationMemoryService, P as recordDeliveredAssistantMessage, Pa as conversationArchivedForUser, Q as abandonTurnRecord, R as PluginCredentialFailureError, Ra as conversationNotArchivedForUser, Ri as getHeaderString, Rr as JUNIOR_THREAD_STATE_TTL_MS, S as resolveConversationTitle, Si as truncateStatusText, Sn as isExperimentalFeatureEnabled, Ut as persistWithRetry, Va as readConversationViewerMarks, Vi as isDmChannel, Wi as withSlackRetries, Wn as closeReviewItem, X as loadTurnCheckpoint, Xn as listReplyActionItems, Z as saveTurnCheckpoint, Za as buildSentryConversationUrl, Zn as listWaitingConversations, _o as piMessageFromHistoryItem, a as loadProjection, an as trimTrailingAssistantMessages, ar as isOnlyAssignee, bi as normalizeSlackStatusText, co as listConversationAnnotations, d as recordAuthorizationCompleted, eo as getSlackFileId, et as failTurnRecord, fn as decideSubscribedThreadReply, fo as lookupSlackUser, h as recordSubscribedReplyRoute, ho as configValueSchema, i as loadConversationProjection, io as recordSlackAttachment, ir as canReadReviewItem, j as isHumanConversationMessage, k as estimateConversationContextTokens, ln as buildDeterministicAssistantMessageId, lo as listConversationAnnotationsById, lr as reviewItemNeedsUser, mn as getThreadStopDecision, n as commitMessages, no as readAttachmentVisionSummary, nr as canActOnReviewItem, nt as listTurnSummaries, o as loadTurnProjection, pn as getSubscribedReplyPreflightDecision, po as createPluginCache, qa as readConversationEventPageAfter, ro as readSlackAttachmentsVersion, rt as recordTurnSummary, t as commitAcceptedReply, tt as getTurnRecord, un as buildDeterministicTurnId, ur as reviewItemReaderForUser, v as hydrateConversationMessages, w as fallbackShortTitle, wn as createUserTokenStore, x as persistConversationMessageSummaries, xr as cancelSubscriptions, y as persistConversationMessages, za as conversationPinnedForUser, zi as getSlackClient, zt as buildTurnErrorResponse } from "./projection-Bhz1tp0G.js";
|
|
3
|
+
import { a as completeText, c as resolveGatewayModel, m as escapeXml, r as completeDecision, x as isProviderRetryError } from "./client-DkG0Tj53.js";
|
|
4
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName, y as createS3AttachmentStorage } from "./config-3AZ11aSM.js";
|
|
5
|
+
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, S as setTags, T as withLogContext, W as isRecord, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-DHzrobea.js";
|
|
6
|
+
import { t as JUNIOR_VERSION } from "./version-D_HFt_Dq.js";
|
|
7
7
|
import { f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, n as createSlackActor, o as isUserActor, r as createSlackResumeActor, s as parseActorUserId, t as createActor, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
|
|
8
|
-
import { $ as agentTurnUsageSchema, A as loadConversationSlackTenantIds, C as getSqlExecutor, I as resolveActorIdentityId, J as nextDetailVersion, K as parseSessionSource, L as saveActorAvatar, N as locationFromRow, S as getDb, X as addAgentTurnUsage, et as hasAgentTurnUsage, f as identityAvatarUrl, h as readUserAvatarUrls, it as requireSlackDestination, k as withConversationEventLock, nt as createSlackDestination, q as conversationDetailTouch, tt as resolveRootConversationId, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
9
|
-
import { A as juniorIdentities, M as juniorDestinations, O as conversationReadColumns, S as juniorConversationEvents, T as juniorCodeChanges, _ as juniorConversationParticipants, c as juniorReviewItems, g as juniorConversationReadPositions, j as juniorUsers, k as juniorConversations, o as juniorReviewItemConversations, y as juniorConversationBriefs } from "./executor-
|
|
8
|
+
import { $ as agentTurnUsageSchema, A as loadConversationSlackTenantIds, C as getSqlExecutor, I as resolveActorIdentityId, J as nextDetailVersion, K as parseSessionSource, L as saveActorAvatar, N as locationFromRow, S as getDb, X as addAgentTurnUsage, et as hasAgentTurnUsage, f as identityAvatarUrl, h as readUserAvatarUrls, it as requireSlackDestination, k as withConversationEventLock, nt as createSlackDestination, q as conversationDetailTouch, tt as resolveRootConversationId, x as getConversationStore, y as getConversationEventStore } from "./viewer-DWlpSFdj.js";
|
|
9
|
+
import { A as juniorIdentities, M as juniorDestinations, O as conversationReadColumns, S as juniorConversationEvents, T as juniorCodeChanges, _ as juniorConversationParticipants, c as juniorReviewItems, g as juniorConversationReadPositions, j as juniorUsers, k as juniorConversations, o as juniorReviewItemConversations, y as juniorConversationBriefs } from "./executor-DLKnzP6S.js";
|
|
10
10
|
import { g as instructionProvenanceFor, m as contextProvenance, n as detectImageMediaType, r as isVisionImageMediaType } from "./media-Dq9_svfQ.js";
|
|
11
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
12
|
-
import { A as runWithSlackInstallation, At as withoutSavedSteeringMessages, Et as conversationSubtreeColumns, F as resolveSlackChannelIdFromThreadId, I as getConversationInfo, J as readConversationSourceTask, Lt as shouldEmitDevAgentTrace, M as parseSlackThreadId, N as readSlackRawMessageContext, Nt as RetryableDeliveryError, P as resolveSlackChannelIdFromMessage, R as listThreadReplies, S as createSlackReviewItemShow, Tt as conversationSubtree, a as buildAuthPauseResponse, b as renderAttachmentText, dt as recordWebConversationActivity, ft as webActorFromUser, i as measureTurnCompactionWait, kt as buildSteeringPiMessage, lt as createAndEnqueueConversation, m as latestProgressStatus, mt as decodeInputImages, n as executeAgentRun, ot as acceptsWebMessages, pt as resolveConversationDestination, rt as deliverReviewItemChange, st as appendAndEnqueueWebMessage, t as createAgentRunner, ut as createConversationId, vt as storeAttachment, x as renderBlockText, z as resolveDestinationVisibility } from "./agent-runner-
|
|
11
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-EjhulgQW.js";
|
|
12
|
+
import { A as runWithSlackInstallation, At as withoutSavedSteeringMessages, Et as conversationSubtreeColumns, F as resolveSlackChannelIdFromThreadId, I as getConversationInfo, J as readConversationSourceTask, Lt as shouldEmitDevAgentTrace, M as parseSlackThreadId, N as readSlackRawMessageContext, Nt as RetryableDeliveryError, P as resolveSlackChannelIdFromMessage, R as listThreadReplies, S as createSlackReviewItemShow, Tt as conversationSubtree, a as buildAuthPauseResponse, b as renderAttachmentText, dt as recordWebConversationActivity, ft as webActorFromUser, i as measureTurnCompactionWait, kt as buildSteeringPiMessage, lt as createAndEnqueueConversation, m as latestProgressStatus, mt as decodeInputImages, n as executeAgentRun, ot as acceptsWebMessages, pt as resolveConversationDestination, rt as deliverReviewItemChange, st as appendAndEnqueueWebMessage, t as createAgentRunner, ut as createConversationId, vt as storeAttachment, x as renderBlockText, z as resolveDestinationVisibility } from "./agent-runner-B229gXUY.js";
|
|
13
13
|
import { a as withLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { r as getStateAdapter } from "./adapter-
|
|
15
|
-
import { R as readMessageAttachments, c as conversationDetailReportSchema, p as conversationFeedSchema, u as conversationEventPageSchema } from "./conversation-
|
|
16
|
-
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-
|
|
17
|
-
import { $ as markTurnFailed, G as TurnInputCommitLostError, J as isCooperativeTurnYieldError, K as TurnInputDeferredError, Q as markTurnCompleted, U as ConversationTurnBoundaryError, W as CooperativeTurnYieldError, X as isTurnInputDeferredError, Y as isTurnInputCommitLostError, Z as markTurnClosed, et as startActiveTurn, h as getChildAgentLabel, q as getConversationTurnBoundaryError } from "./store-
|
|
18
|
-
import { n as getAssistantReplyText, t as decideReply } from "./assistant-reply-
|
|
19
|
-
import { C as savedTurnInputMessages, E as maybePostAutomatedTurnLimitNotice, I as deliversFinalText, L as finishedRunReply, M as recordFinishedTurnForAutomatedLimit, O as resolveSlackReplyTarget, R as postsRunNotices, S as joinMailboxText, V as runDispatchOutcome, c as isEventMailboxMetadata, i as skipInputBeforeConversationStop, k as sendSlackReply, l as renderEventBatchText, s as eventBatchMessageMeta, u as timerWatchCredentialSubject, w as webConversationMessage } from "./session-stop-
|
|
14
|
+
import { r as getStateAdapter } from "./adapter-RVQGEa98.js";
|
|
15
|
+
import { R as readMessageAttachments, c as conversationDetailReportSchema, p as conversationFeedSchema, u as conversationEventPageSchema } from "./conversation-DNtcULyX.js";
|
|
16
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-DI6KCtwb.js";
|
|
17
|
+
import { $ as markTurnFailed, G as TurnInputCommitLostError, J as isCooperativeTurnYieldError, K as TurnInputDeferredError, Q as markTurnCompleted, U as ConversationTurnBoundaryError, W as CooperativeTurnYieldError, X as isTurnInputDeferredError, Y as isTurnInputCommitLostError, Z as markTurnClosed, et as startActiveTurn, h as getChildAgentLabel, q as getConversationTurnBoundaryError } from "./store-DeTnwVJt.js";
|
|
18
|
+
import { n as getAssistantReplyText, t as decideReply } from "./assistant-reply-DQbtwc6j.js";
|
|
19
|
+
import { C as savedTurnInputMessages, E as maybePostAutomatedTurnLimitNotice, I as deliversFinalText, L as finishedRunReply, M as recordFinishedTurnForAutomatedLimit, O as resolveSlackReplyTarget, R as postsRunNotices, S as joinMailboxText, V as runDispatchOutcome, c as isEventMailboxMetadata, i as skipInputBeforeConversationStop, k as sendSlackReply, l as renderEventBatchText, s as eventBatchMessageMeta, u as timerWatchCredentialSubject, w as webConversationMessage } from "./session-stop-CHSYB2uw.js";
|
|
20
20
|
import { _ as isEmptyUserInputAnswer, b as webMessageId, v as normalizeUserInputAnswer } from "./reporting-window-B-QP9zX1.js";
|
|
21
|
-
import { g as getTurnRequestDeadline, l as getVercelConversationWorkQueue } from "./background-compaction-queue-
|
|
22
|
-
import { D as stopConversationWork, E as steerWebPendingMessages, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-
|
|
23
|
-
import { _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, d as getDispatchTurnId, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as claimDispatchMailboxAppend, j as readAutomationTitlesByConversationId, l as getDispatchInputMessageId, n as resolveTurnSessionRouting, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as resolveConversationRouting, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./turn-session-routing-
|
|
24
|
-
import { d as
|
|
25
|
-
import { a as withAgentInvocationResultActors, c as listActiveMailboxTurns, d as turnInputFactsFromConversationMessage, f as legacyWebMailboxMetadataSchema, l as resolveMailboxTurnWork, n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as createChildConversationWorker, u as sourceFromTurnInput } from "./result-
|
|
26
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
27
|
-
import { o as AgentRunError, s as executeTurn } from "./work-
|
|
28
|
-
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-
|
|
29
|
-
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, l as getWebAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-
|
|
30
|
-
import { t as bindMessageAgent } from "./message-
|
|
31
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
32
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
33
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response
|
|
21
|
+
import { g as getTurnRequestDeadline, l as getVercelConversationWorkQueue } from "./background-compaction-queue-oegyrxSe.js";
|
|
22
|
+
import { D as stopConversationWork, E as steerWebPendingMessages, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-C4z8gOgZ.js";
|
|
23
|
+
import { _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, d as getDispatchTurnId, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as claimDispatchMailboxAppend, j as readAutomationTitlesByConversationId, l as getDispatchInputMessageId, n as resolveTurnSessionRouting, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as resolveConversationRouting, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./turn-session-routing-RBtUe-3y.js";
|
|
24
|
+
import { d as apiErrorSchema, f as healthReportSchema, s as conversationPendingMessagesReportSchema } from "./conversation-pending-messages-LlFnr9-m.js";
|
|
25
|
+
import { a as withAgentInvocationResultActors, c as listActiveMailboxTurns, d as turnInputFactsFromConversationMessage, f as legacyWebMailboxMetadataSchema, l as resolveMailboxTurnWork, n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as createChildConversationWorker, u as sourceFromTurnInput } from "./result-BoD0jevy.js";
|
|
26
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-t5fimxwQ.js";
|
|
27
|
+
import { o as AgentRunError, s as executeTurn } from "./work-pPoqtRea.js";
|
|
28
|
+
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-DGq1o5JX.js";
|
|
29
|
+
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, l as getWebAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-C0ut_6RW.js";
|
|
30
|
+
import { t as bindMessageAgent } from "./message-LR8z5jXJ.js";
|
|
31
|
+
import { t as bindSpawnAgent } from "./spawn-Cl8WS7zi.js";
|
|
32
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-BSF9zO-H.js";
|
|
33
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response--9bA4uLP.js";
|
|
34
34
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
35
35
|
import * as z from "zod";
|
|
36
36
|
import { and, asc, desc, eq, gt, inArray, isNotNull, isNull, lte, max, ne, or, sql } from "drizzle-orm";
|
|
@@ -449,7 +449,27 @@ function noStoreInit(init) {
|
|
|
449
449
|
}
|
|
450
450
|
/** Serialize a REST response only after it satisfies its declared schema. */
|
|
451
451
|
function jsonResponse(schema, value, init) {
|
|
452
|
-
return
|
|
452
|
+
return startSpan({
|
|
453
|
+
name: "Write API response",
|
|
454
|
+
op: "serialize"
|
|
455
|
+
}, (span) => {
|
|
456
|
+
const startedAt = performance.now();
|
|
457
|
+
const parsed = schema.parse(value);
|
|
458
|
+
const parsedAt = performance.now();
|
|
459
|
+
const body = JSON.stringify(parsed);
|
|
460
|
+
span.setAttributes({
|
|
461
|
+
"app.api.response.chars": body.length,
|
|
462
|
+
"app.api.response.json_stringify_ms": Math.round(performance.now() - parsedAt),
|
|
463
|
+
"app.api.response.schema_parse_ms": Math.round(parsedAt - startedAt)
|
|
464
|
+
});
|
|
465
|
+
const responseInit = noStoreInit(init);
|
|
466
|
+
const headers = new Headers(responseInit.headers);
|
|
467
|
+
if (!headers.has("content-type")) headers.set("content-type", "application/json");
|
|
468
|
+
return new Response(body, {
|
|
469
|
+
...responseInit,
|
|
470
|
+
headers
|
|
471
|
+
});
|
|
472
|
+
});
|
|
453
473
|
}
|
|
454
474
|
/** Return an empty personalized API response with no-store caching. */
|
|
455
475
|
function emptyResponse(status = 204) {
|
|
@@ -7397,6 +7417,8 @@ const CURSOR_CONTEXT = "junior-conversation-report-cursor";
|
|
|
7397
7417
|
const conversationCursorPayloadSchema = z.object({
|
|
7398
7418
|
conversationId: z.string().min(1),
|
|
7399
7419
|
seq: z.number().int().min(-1),
|
|
7420
|
+
/** Transcript version of the detail that issued an `appendCursor`. */
|
|
7421
|
+
transcript: z.string().min(1).optional(),
|
|
7400
7422
|
version: z.literal(1)
|
|
7401
7423
|
}).strict();
|
|
7402
7424
|
function cursorSecret() {
|
|
@@ -7426,7 +7448,10 @@ function decodeConversationCursor(args) {
|
|
|
7426
7448
|
try {
|
|
7427
7449
|
const parsed = conversationCursorPayloadSchema.parse(JSON.parse(Buffer.from(encoded, "base64url").toString("utf8")));
|
|
7428
7450
|
if (parsed.conversationId !== args.conversationId) return;
|
|
7429
|
-
return {
|
|
7451
|
+
return {
|
|
7452
|
+
seq: parsed.seq,
|
|
7453
|
+
...parsed.transcript ? { transcript: parsed.transcript } : void 0
|
|
7454
|
+
};
|
|
7430
7455
|
} catch {
|
|
7431
7456
|
return;
|
|
7432
7457
|
}
|
|
@@ -8119,7 +8144,6 @@ function briefMentionTexts(brief) {
|
|
|
8119
8144
|
brief.intent,
|
|
8120
8145
|
brief.outcome.text,
|
|
8121
8146
|
...brief.decisions.flatMap((decision) => [decision.text, decision.by]),
|
|
8122
|
-
...brief.openDecisions.flatMap((decision) => [decision.text, decision.owner]),
|
|
8123
8147
|
...brief.facts
|
|
8124
8148
|
];
|
|
8125
8149
|
}
|
|
@@ -9102,20 +9126,27 @@ async function readSubtreeDetailVersion(conversationId) {
|
|
|
9102
9126
|
}
|
|
9103
9127
|
/** Read the detail state that the ETag hashes and the report shows. */
|
|
9104
9128
|
async function readConversationDetailState(conversationId, viewer) {
|
|
9105
|
-
const [
|
|
9129
|
+
const [accessById, viewerMarks, forks, agentTree, readPosition, autoArchive, attachmentsVersion] = await Promise.all([
|
|
9106
9130
|
readConversationAccessFromSql(getDb(), [conversationId], viewer),
|
|
9107
9131
|
viewer ? readConversationViewerMarks(viewer, conversationId) : void 0,
|
|
9108
9132
|
readConversationForks(conversationId, viewer),
|
|
9109
9133
|
readConversationAgentTree(conversationId, viewer),
|
|
9110
9134
|
viewer ? readConversationReadPosition(viewer, conversationId) : void 0,
|
|
9111
|
-
viewer ? readConversationAutoArchive(viewer, conversationId) : void 0
|
|
9135
|
+
viewer ? readConversationAutoArchive(viewer, conversationId) : void 0,
|
|
9136
|
+
readSlackAttachmentsVersion(getSqlExecutor(), conversationId)
|
|
9112
9137
|
]);
|
|
9138
|
+
const access = accessById.get(conversationId);
|
|
9113
9139
|
return {
|
|
9114
|
-
access
|
|
9140
|
+
access,
|
|
9115
9141
|
agentTree,
|
|
9116
9142
|
autoArchive,
|
|
9117
9143
|
forks,
|
|
9118
9144
|
readPosition,
|
|
9145
|
+
transcriptVersion: createHash("sha256").update(JSON.stringify({
|
|
9146
|
+
attachments: attachmentsVersion,
|
|
9147
|
+
canViewPrivateContent: access?.canViewPrivateContent ?? false,
|
|
9148
|
+
junior: JUNIOR_VERSION
|
|
9149
|
+
})).digest("base64url"),
|
|
9119
9150
|
viewerMarks
|
|
9120
9151
|
};
|
|
9121
9152
|
}
|
|
@@ -9180,6 +9211,8 @@ function projectConversationDetail(args) {
|
|
|
9180
9211
|
sidebarAnnotations: canExposePayload ? args.sidebarAnnotations : void 0,
|
|
9181
9212
|
...canExposePayload && args.brief ? { brief: args.brief } : void 0,
|
|
9182
9213
|
events: args.events,
|
|
9214
|
+
...args.appended ? { appended: true } : void 0,
|
|
9215
|
+
...args.appendCursor ? { appendCursor: args.appendCursor } : void 0,
|
|
9183
9216
|
...canExposePayload && args.participants.length > 0 ? {
|
|
9184
9217
|
authors: args.authors,
|
|
9185
9218
|
participants: args.participants
|
|
@@ -9210,14 +9243,40 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
9210
9243
|
const { access, readPosition } = state;
|
|
9211
9244
|
const canExposePayload = access?.canViewPrivateContent ?? false;
|
|
9212
9245
|
const executor = getSqlExecutor();
|
|
9213
|
-
const
|
|
9246
|
+
const isPurged = record.conversation.transcriptPurgedAtMs !== void 0;
|
|
9247
|
+
const after = options.after && !options.unreadPage && !isPurged ? decodeConversationCursor({
|
|
9248
|
+
conversationId,
|
|
9249
|
+
cursor: options.after
|
|
9250
|
+
}) : void 0;
|
|
9251
|
+
const afterSeq = after && after.transcript === state.transcriptVersion ? after.seq : void 0;
|
|
9252
|
+
const readPage = async () => {
|
|
9253
|
+
if (isPurged) return { events: [] };
|
|
9254
|
+
if (afterSeq !== void 0) {
|
|
9255
|
+
const newer = await readConversationEventPageAfter(executor, {
|
|
9256
|
+
afterSeq,
|
|
9257
|
+
canExposePayload,
|
|
9258
|
+
conversationId,
|
|
9259
|
+
limit: options.limit
|
|
9260
|
+
});
|
|
9261
|
+
if (newer.nextSeq === void 0) return {
|
|
9262
|
+
appended: true,
|
|
9263
|
+
events: newer.events
|
|
9264
|
+
};
|
|
9265
|
+
}
|
|
9266
|
+
return readConversationEventPage(executor, {
|
|
9267
|
+
canExposePayload,
|
|
9268
|
+
conversationId,
|
|
9269
|
+
latestTurns: options.latestTurns,
|
|
9270
|
+
limit: options.limit
|
|
9271
|
+
});
|
|
9272
|
+
};
|
|
9214
9273
|
const [annotations, automationTitleByConversation, auxiliaryCostsByConversation, briefVersion, firstHumanMessageTextByConversation, modelUsage, metricsByConversation, people, sourceTask, teamDomainByTeamId, page] = await Promise.all([
|
|
9215
9274
|
listConversationAnnotations(getDb(), conversationId),
|
|
9216
9275
|
readAutomationTitlesByConversationId([record.conversation]),
|
|
9217
9276
|
readConversationAuxiliaryCostsFromSql(getDb(), [conversationId]),
|
|
9218
9277
|
readLatestConversationBrief(getDb(), conversationId),
|
|
9219
9278
|
readFirstHumanMessageTexts(getDb(), [record.conversation]),
|
|
9220
|
-
|
|
9279
|
+
isPurged ? Promise.resolve([]) : readConversationModelUsageFromSql(executor, { conversationId }),
|
|
9221
9280
|
readConversationTreeMetricsFromSql(getDb(), [conversationId]),
|
|
9222
9281
|
readConversationAuthors(getDb(), conversationId),
|
|
9223
9282
|
readConversationSourceTask({
|
|
@@ -9225,21 +9284,19 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
9225
9284
|
...options.viewer ? { viewer: options.viewer } : void 0
|
|
9226
9285
|
}),
|
|
9227
9286
|
resolveSlackTeamDomains(record.conversation.location?.provider === "slack" ? [record.conversation.location.teamId] : []),
|
|
9228
|
-
|
|
9229
|
-
canExposePayload,
|
|
9230
|
-
conversationId,
|
|
9231
|
-
latestTurns: options.latestTurns,
|
|
9232
|
-
limit: options.limit
|
|
9233
|
-
}) : purgedPage
|
|
9287
|
+
readPage()
|
|
9234
9288
|
]);
|
|
9235
9289
|
const firstSeq = page.events[0]?.seq;
|
|
9236
9290
|
const unreadAfterSeq = readPosition !== void 0 && page.previousSeq !== void 0 && firstSeq !== void 0 && readPosition.lastReadSeq + 1 < firstSeq ? readPosition.lastReadSeq : void 0;
|
|
9237
9291
|
const brief = canExposePayload ? briefVersion?.content : void 0;
|
|
9238
9292
|
const [{ briefMentions, events }, unreadPage, sidebarAnnotations] = await Promise.all([
|
|
9239
|
-
|
|
9293
|
+
startSpan({
|
|
9294
|
+
name: "Attach conversation mentions",
|
|
9295
|
+
op: "function"
|
|
9296
|
+
}, () => attachConversationMentions(executor, conversationId, {
|
|
9240
9297
|
...brief ? { brief } : void 0,
|
|
9241
9298
|
events: page.events
|
|
9242
|
-
}),
|
|
9299
|
+
})),
|
|
9243
9300
|
options.unreadPage && unreadAfterSeq !== void 0 ? readConversationEventPageAround(executor, {
|
|
9244
9301
|
canExposePayload,
|
|
9245
9302
|
conversationId,
|
|
@@ -9252,12 +9309,19 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
9252
9309
|
})).catch(() => void 0) : void 0,
|
|
9253
9310
|
canExposePayload ? listConversationSidebarAnnotations([conversationId], /* @__PURE__ */ new Map([[conversationId, annotations]])).then((byConversation) => byConversation[conversationId]) : void 0
|
|
9254
9311
|
]);
|
|
9312
|
+
const appendedAfterSeq = page.appended ? afterSeq : void 0;
|
|
9255
9313
|
const metrics = metricsByConversation.get(conversationId);
|
|
9256
9314
|
const auxiliaryCosts = auxiliaryCostsByConversation.get(conversationId);
|
|
9257
9315
|
const childAgentTotals = childAgentTotalsReport(metrics, auxiliaryCosts);
|
|
9258
|
-
const
|
|
9316
|
+
const detail = {
|
|
9259
9317
|
...record,
|
|
9260
9318
|
access,
|
|
9319
|
+
...page.appended ? { appended: true } : void 0,
|
|
9320
|
+
...isPurged ? void 0 : { appendCursor: encodeConversationCursor({
|
|
9321
|
+
conversationId,
|
|
9322
|
+
seq: page.events.at(-1)?.seq ?? appendedAfterSeq ?? -1,
|
|
9323
|
+
transcript: state.transcriptVersion
|
|
9324
|
+
}) },
|
|
9261
9325
|
...state.viewerMarks,
|
|
9262
9326
|
automationTitle: automationTitleByConversation.get(conversationId),
|
|
9263
9327
|
annotations,
|
|
@@ -9283,7 +9347,11 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
9283
9347
|
...unreadAfterSeq === void 0 ? void 0 : { unreadAfterSeq },
|
|
9284
9348
|
...unreadPage ? { unreadPage } : void 0,
|
|
9285
9349
|
usage: metrics?.usage ?? record.usage ?? void 0
|
|
9286
|
-
}
|
|
9350
|
+
};
|
|
9351
|
+
const report = startSpan({
|
|
9352
|
+
name: "Project conversation detail",
|
|
9353
|
+
op: "function"
|
|
9354
|
+
}, () => projectConversationDetail(detail));
|
|
9287
9355
|
return {
|
|
9288
9356
|
...report,
|
|
9289
9357
|
...state.forks,
|
|
@@ -9305,7 +9373,11 @@ async function readConversationDetail(conversationId, options = {}) {
|
|
|
9305
9373
|
limit: 150
|
|
9306
9374
|
} : { limit: options.limit }
|
|
9307
9375
|
});
|
|
9308
|
-
|
|
9376
|
+
if (!report) return void 0;
|
|
9377
|
+
return startSpan({
|
|
9378
|
+
name: "Validate conversation detail",
|
|
9379
|
+
op: "function"
|
|
9380
|
+
}, () => conversationDetailReportSchema.parse(report));
|
|
9309
9381
|
}
|
|
9310
9382
|
// src/api/conversations/pin.ts
|
|
9311
9383
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { At as requestAnotherSlice$1, Dt as recordConversationRetry$1, Et as recordAttemptFailure$1, Mt as startConversationWork$1, Nt as steerWebPendingMessages$1, Ot as releaseConversationWork$1, Pt as stopConversationWork$1, Tt as markConversationWorkEnqueued$1, _t as drainConversationMailbox$1, ct as appendInboundMessage, dt as checkInConversationWork$1, ft as clearConsumedConversationWake$1, gt as deadLetterAttempt$1, ht as completeConversationWork$1, jt as requestConversationWork$1, kt as removeActiveConversation$1, lt as beginConversationResume$1, mt as completeConversationStop$1, ot as ackMessages$1, pt as clearExpiredConversationLease$1, st as appendExclusiveInboundMessage, ut as cancelHumanFacingPendingMessages$1, vt as getConversation$1, wt as listActiveConversationIds$1, yt as getConversationWorkState$1 } from "./projection-
|
|
2
|
-
import { x as getConversationStore } from "./viewer-
|
|
3
|
-
import "./background-compaction-queue-
|
|
1
|
+
import { At as requestAnotherSlice$1, Dt as recordConversationRetry$1, Et as recordAttemptFailure$1, Mt as startConversationWork$1, Nt as steerWebPendingMessages$1, Ot as releaseConversationWork$1, Pt as stopConversationWork$1, Tt as markConversationWorkEnqueued$1, _t as drainConversationMailbox$1, ct as appendInboundMessage, dt as checkInConversationWork$1, ft as clearConsumedConversationWake$1, gt as deadLetterAttempt$1, ht as completeConversationWork$1, jt as requestConversationWork$1, kt as removeActiveConversation$1, lt as beginConversationResume$1, mt as completeConversationStop$1, ot as ackMessages$1, pt as clearExpiredConversationLease$1, st as appendExclusiveInboundMessage, ut as cancelHumanFacingPendingMessages$1, vt as getConversation$1, wt as listActiveConversationIds$1, yt as getConversationWorkState$1 } from "./projection-Bhz1tp0G.js";
|
|
2
|
+
import { x as getConversationStore } from "./viewer-DWlpSFdj.js";
|
|
3
|
+
import "./background-compaction-queue-oegyrxSe.js";
|
|
4
4
|
// src/chat/task-execution/store.ts
|
|
5
5
|
function metadataStore(options) {
|
|
6
6
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as TURN_REASONING_LEVELS } from "./config-
|
|
2
|
-
import { C as getSqlExecutor, x as getConversationStore } from "./viewer-
|
|
3
|
-
import { h as juniorAgentInvocations, m as juniorAgentBindings } from "./executor-
|
|
4
|
-
import { p as credentialContextSchema } from "./registry-
|
|
1
|
+
import { g as TURN_REASONING_LEVELS } from "./config-3AZ11aSM.js";
|
|
2
|
+
import { C as getSqlExecutor, x as getConversationStore } from "./viewer-DWlpSFdj.js";
|
|
3
|
+
import { h as juniorAgentInvocations, m as juniorAgentBindings } from "./executor-DLKnzP6S.js";
|
|
4
|
+
import { p as credentialContextSchema } from "./registry-EjhulgQW.js";
|
|
5
5
|
import { S as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, x as AGENT_INVOCATION_MAILBOX_STATUSES } from "./reporting-window-B-QP9zX1.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import * as z from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import { _ as runWithTurnRequestDeadline, f as QUEUE_SIGNATURE_MAX_AGE_MS, h as getQueueProvider, m as verifyQueueMessage, p as signQueueMessage } from "./background-compaction-queue-
|
|
1
|
+
import { h as logWarn } from "./logging-DHzrobea.js";
|
|
2
|
+
import { _ as runWithTurnRequestDeadline, f as QUEUE_SIGNATURE_MAX_AGE_MS, h as getQueueProvider, m as verifyQueueMessage, p as signQueueMessage } from "./background-compaction-queue-oegyrxSe.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/queue/callback.ts
|
|
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
|
|
|
110
110
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
111
111
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
112
112
|
run: async (message) => {
|
|
113
|
-
const { processPluginTask } = await import("./task-runner-
|
|
113
|
+
const { processPluginTask } = await import("./task-runner-BSF9zO-H.js").then((n) => n.r);
|
|
114
114
|
await processPluginTask(message);
|
|
115
115
|
},
|
|
116
116
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Aa as createPluginLogger, Bn as coreTaskRegistrations, Gr as createPluginState, Gt as getPiMessageRole, Ln as getPlugins, Ua as createPluginConversationEvents, Xt as instructionTextForProjection, en as isToolResultError,
|
|
2
|
+
import { Aa as createPluginLogger, Bn as coreTaskRegistrations, Gr as createPluginState, Gt as getPiMessageRole, Ln as getPlugins, Ua as createPluginConversationEvents, Xt as instructionTextForProjection, en as isToolResultError, ga as createPluginModel, ha as createPluginEmbedder, in as stripRuntimeTurnContext, ka as createPluginModelCostRecorder, nn as normalizeToolNameFromResult, po as createPluginCache, tn as isToolResultMessage, tt as getTurnRecord, v as hydrateConversationMessages } from "./projection-Bhz1tp0G.js";
|
|
3
3
|
import { h as parseSlackMessageTs } from "./actor-6jsm_v96.js";
|
|
4
|
-
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-
|
|
4
|
+
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-DWlpSFdj.js";
|
|
5
5
|
import { _ as sameActorIdentity } from "./media-Dq9_svfQ.js";
|
|
6
|
-
import { r as getStateAdapter } from "./adapter-
|
|
7
|
-
import { t as resolveConversationRouting, u as getDispatchRecord } from "./turn-session-routing-
|
|
8
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-
|
|
6
|
+
import { r as getStateAdapter } from "./adapter-RVQGEa98.js";
|
|
7
|
+
import { t as resolveConversationRouting, u as getDispatchRecord } from "./turn-session-routing-RBtUe-3y.js";
|
|
8
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-DGq1o5JX.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-BBos68l0.js";
|
|
10
10
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/plugins/task-runner.ts
|
|
12
12
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Rr as JUNIOR_THREAD_STATE_TTL_MS,
|
|
2
|
-
import { G as toOptionalNumber, K as toOptionalString, W as isRecord } from "./logging-
|
|
3
|
-
import { S as getDb } from "./viewer-
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Rr as JUNIOR_THREAD_STATE_TTL_MS, mo as createDurableLocationConfigurationService, y as persistConversationMessages } from "./projection-Bhz1tp0G.js";
|
|
2
|
+
import { G as toOptionalNumber, K as toOptionalString, W as isRecord } from "./logging-DHzrobea.js";
|
|
3
|
+
import { S as getDb } from "./viewer-DWlpSFdj.js";
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-RVQGEa98.js";
|
|
5
5
|
// src/chat/state/conversation.ts
|
|
6
6
|
function defaultConversationState() {
|
|
7
7
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { K as clearPendingAuth, M as markConversationMessage,
|
|
2
|
-
import { b as getProviderErrorUserMessage, g as ProviderError, v as findProviderError, y as getProviderErrorAttributes } from "./client-
|
|
3
|
-
import { W as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { K as clearPendingAuth, M as markConversationMessage, co as listConversationAnnotations, un as buildDeterministicTurnId, v as hydrateConversationMessages } from "./projection-Bhz1tp0G.js";
|
|
2
|
+
import { b as getProviderErrorUserMessage, g as ProviderError, v as findProviderError, y as getProviderErrorAttributes } from "./client-DkG0Tj53.js";
|
|
3
|
+
import { W as isRecord, t as buildTurnFailureResponse } from "./logging-DHzrobea.js";
|
|
4
4
|
import { h as parseSlackMessageTs } from "./actor-6jsm_v96.js";
|
|
5
|
-
import { S as getDb, y as getConversationEventStore } from "./viewer-
|
|
6
|
-
import { M as readMessageCardRefs, N as removedCardSchema, P as resolveMessageCards } from "./conversation-
|
|
7
|
-
import { O as parseAgentInvocationResultMessageId, Q as markTurnCompleted, Z as markTurnClosed, c as getAgentInvocation, m as getAgentInvocationTurnId } from "./store-
|
|
8
|
-
import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
5
|
+
import { S as getDb, y as getConversationEventStore } from "./viewer-DWlpSFdj.js";
|
|
6
|
+
import { M as readMessageCardRefs, N as removedCardSchema, P as resolveMessageCards } from "./conversation-DNtcULyX.js";
|
|
7
|
+
import { O as parseAgentInvocationResultMessageId, Q as markTurnCompleted, Z as markTurnClosed, c as getAgentInvocation, m as getAgentInvocationTurnId } from "./store-DeTnwVJt.js";
|
|
8
|
+
import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-DGq1o5JX.js";
|
|
9
9
|
// src/chat/conversations/pending-cards.ts
|
|
10
10
|
/**
|
|
11
11
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { y as getConversationEventStore } from "./viewer-DWlpSFdj.js";
|
|
2
2
|
// src/chat/conversations/turn-lifecycle.ts
|
|
3
3
|
/** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
|
|
4
4
|
var ConversationTurnLifecycleService = class {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Ei as openSlackDirectMessage, Hr as getDashboardTaskLink, Rr as JUNIOR_THREAD_STATE_TTL_MS, Wr as ToolInputError, _i as escapeSlackMrkdwnText, ki as postSlackMessage, vi as formatSlackLink, w as fallbackShortTitle } from "./projection-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { _ as runBestEffort, h as logWarn } from "./logging-
|
|
4
|
-
import { Q as agentTurnTotalTokens, S as getDb, Z as agentTurnCostUsd } from "./viewer-
|
|
5
|
-
import { d as juniorAutomations, k as juniorConversations, l as juniorAutomationRuns, u as juniorAutomationVersions } from "./executor-
|
|
6
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import { O as eventAutomationSchema, S as automationVersionSchema, j as scheduledAutomationSchema } from "./automation-
|
|
1
|
+
import { Ei as openSlackDirectMessage, Hr as getDashboardTaskLink, Rr as JUNIOR_THREAD_STATE_TTL_MS, Wr as ToolInputError, _i as escapeSlackMrkdwnText, ki as postSlackMessage, vi as formatSlackLink, w as fallbackShortTitle } from "./projection-Bhz1tp0G.js";
|
|
2
|
+
import { n as botConfig } from "./config-3AZ11aSM.js";
|
|
3
|
+
import { _ as runBestEffort, h as logWarn } from "./logging-DHzrobea.js";
|
|
4
|
+
import { Q as agentTurnTotalTokens, S as getDb, Z as agentTurnCostUsd } from "./viewer-DWlpSFdj.js";
|
|
5
|
+
import { d as juniorAutomations, k as juniorConversations, l as juniorAutomationRuns, u as juniorAutomationVersions } from "./executor-DLKnzP6S.js";
|
|
6
|
+
import { h as credentialSubjectSchema } from "./registry-EjhulgQW.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-RVQGEa98.js";
|
|
8
|
+
import { O as eventAutomationSchema, S as automationVersionSchema, j as scheduledAutomationSchema } from "./automation-sIsmIXH7.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { and, asc, count, desc, eq, gte, inArray, isNotNull, isNull, lte, max, ne, or, sql } from "drizzle-orm";
|
|
@@ -1583,7 +1583,7 @@ function slackSourceForDestination(args) {
|
|
|
1583
1583
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
1584
1584
|
*/
|
|
1585
1585
|
async function resolveConversationRouting(args) {
|
|
1586
|
-
const conversationStore = args.conversationStore ?? (await import("./viewer-
|
|
1586
|
+
const conversationStore = args.conversationStore ?? (await import("./viewer-DWlpSFdj.js").then((n) => n.v)).getConversationStore();
|
|
1587
1587
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
1588
1588
|
let destination;
|
|
1589
1589
|
let source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-ClKzLvbN.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.281.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-D_HFt_Dq.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { i as getChatConfig } from "./config-
|
|
3
|
-
import { U as normalizeIdentityEmail, V as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-
|
|
2
|
+
import { i as getChatConfig } from "./config-3AZ11aSM.js";
|
|
3
|
+
import { U as normalizeIdentityEmail, V as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-DHzrobea.js";
|
|
4
4
|
import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
5
|
-
import { A as juniorIdentities, M as juniorDestinations, O as conversationReadColumns, S as juniorConversationEvents, _ as juniorConversationParticipants, b as CONVERSATION_METRICS, j as juniorUsers, k as juniorConversations, t as createJuniorSqlExecutor, v as juniorConversationBindings, w as juniorConversationAnnotations, x as juniorConversationMetrics } from "./executor-
|
|
5
|
+
import { A as juniorIdentities, M as juniorDestinations, O as conversationReadColumns, S as juniorConversationEvents, _ as juniorConversationParticipants, b as CONVERSATION_METRICS, j as juniorUsers, k as juniorConversations, t as createJuniorSqlExecutor, v as juniorConversationBindings, w as juniorConversationAnnotations, x as juniorConversationMetrics } from "./executor-DLKnzP6S.js";
|
|
6
6
|
import { d as newConversationEventSchema, f as encodeHistoryPayload, l as decodeStoredConversationEvent, n as detectImageMediaType, o as conversationEventDataSchema, u as historyReplacementSchema, v as usageSchema } from "./media-Dq9_svfQ.js";
|
|
7
7
|
import { a as withLock } from "./locks-D-0h111u.js";
|
|
8
8
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -494,7 +494,8 @@ async function deleteProviderIdentityForUser(executor, userId, provider, provide
|
|
|
494
494
|
}
|
|
495
495
|
/**
|
|
496
496
|
* Save one Google sign-in. Link the Google identity to the user of its
|
|
497
|
-
* verified email, and set its sign-in time.
|
|
497
|
+
* verified email, and set its sign-in time. Return the previous sign-in
|
|
498
|
+
* time, if any.
|
|
498
499
|
*/
|
|
499
500
|
async function recordGoogleSignIn(executor, account, nowMs = Date.now()) {
|
|
500
501
|
const stored = await upsertIdentity(executor, {
|
|
@@ -506,8 +507,9 @@ async function recordGoogleSignIn(executor, account, nowMs = Date.now()) {
|
|
|
506
507
|
displayName: account.displayName,
|
|
507
508
|
avatarUrl: account.avatarUrl ?? null
|
|
508
509
|
}, nowMs);
|
|
510
|
+
const [previous] = await executor.db().select({ signedInAt: juniorIdentities.signedInAt }).from(juniorIdentities).where(eq(juniorIdentities.id, stored.id)).limit(1);
|
|
509
511
|
await executor.db().update(juniorIdentities).set({ signedInAt: dateFromMs$1(nowMs) }).where(eq(juniorIdentities.id, stored.id));
|
|
510
|
-
return
|
|
512
|
+
return previous?.signedInAt?.getTime();
|
|
511
513
|
}
|
|
512
514
|
// src/chat/identities/actor.ts
|
|
513
515
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { H as AuthorizationFlowDisabledError, Kt as getTerminalAssistantMessages, Q as abandonTurnRecord, Qa as loadForkHistory, R as PluginCredentialFailureError, Vt as isTurnExecutionLimitExceededError, Z as saveTurnCheckpoint, et as failTurnRecord, s as openConversationProjection, tt as getTurnRecord } from "./projection-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { H as AuthorizationFlowDisabledError, Kt as getTerminalAssistantMessages, Q as abandonTurnRecord, Qa as loadForkHistory, R as PluginCredentialFailureError, Vt as isTurnExecutionLimitExceededError, Z as saveTurnCheckpoint, et as failTurnRecord, s as openConversationProjection, tt as getTurnRecord } from "./projection-Bhz1tp0G.js";
|
|
2
|
+
import { n as botConfig } from "./config-3AZ11aSM.js";
|
|
3
|
+
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-DWlpSFdj.js";
|
|
4
4
|
import { _ as sameActorIdentity, p as agentInstructionProvenance } from "./media-Dq9_svfQ.js";
|
|
5
|
-
import { At as withoutSavedSteeringMessages, It as readBlockedReport, St as recordSubagentStarted, kt as buildSteeringPiMessage, xt as recordSubagentEnded, yt as stopChildAgentsOf } from "./agent-runner-
|
|
6
|
-
import { B as agentTypeInstructions, C as markAgentInvocationMailboxAppended, D as markAgentInvocationSteered, E as markAgentInvocationRunning, G as TurnInputCommitLostError, T as markAgentInvocationPaused, V as agentTypeStartsWithParentHistory, Y as isTurnInputCommitLostError, _ as getLatestAgentInvocationForConversation, b as listAgentInvocationsForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, i as createAgentInvocation, k as reportReplacedAgentInvocation, m as getAgentInvocationTurnId, n as NON_TERMINAL_AGENT_INVOCATION_STATUSES, q as getConversationTurnBoundaryError, r as completeAgentInvocation, s as getActiveAgentInvocationForConversation, t as ACTIVE_AGENT_INVOCATION_STATUSES, y as isTerminalAgentInvocation } from "./store-
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { E as maybePostAutomatedTurnLimitNotice, M as recordFinishedTurnForAutomatedLimit, N as resetAutomatedTurnLimit } from "./session-stop-
|
|
9
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
10
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
11
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-
|
|
5
|
+
import { At as withoutSavedSteeringMessages, It as readBlockedReport, St as recordSubagentStarted, kt as buildSteeringPiMessage, xt as recordSubagentEnded, yt as stopChildAgentsOf } from "./agent-runner-B229gXUY.js";
|
|
6
|
+
import { B as agentTypeInstructions, C as markAgentInvocationMailboxAppended, D as markAgentInvocationSteered, E as markAgentInvocationRunning, G as TurnInputCommitLostError, T as markAgentInvocationPaused, V as agentTypeStartsWithParentHistory, Y as isTurnInputCommitLostError, _ as getLatestAgentInvocationForConversation, b as listAgentInvocationsForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, i as createAgentInvocation, k as reportReplacedAgentInvocation, m as getAgentInvocationTurnId, n as NON_TERMINAL_AGENT_INVOCATION_STATUSES, q as getConversationTurnBoundaryError, r as completeAgentInvocation, s as getActiveAgentInvocationForConversation, t as ACTIVE_AGENT_INVOCATION_STATUSES, y as isTerminalAgentInvocation } from "./store-DeTnwVJt.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-DQbtwc6j.js";
|
|
8
|
+
import { E as maybePostAutomatedTurnLimitNotice, M as recordFinishedTurnForAutomatedLimit, N as resetAutomatedTurnLimit } from "./session-stop-CHSYB2uw.js";
|
|
9
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-C4z8gOgZ.js";
|
|
10
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-t5fimxwQ.js";
|
|
11
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-DGq1o5JX.js";
|
|
12
12
|
import { isDeepStrictEqual } from "node:util";
|
|
13
13
|
import * as z from "zod";
|
|
14
14
|
// src/chat/runtime/turn-execution.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Ct as isInvalidConversationRecordError, St as isFinalAttempt, bt as hasConversationStop } from "./projection-
|
|
3
|
-
import { x as isProviderRetryError } from "./client-
|
|
4
|
-
import { i as getChatConfig } from "./config-
|
|
5
|
-
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
6
|
-
import { g as getTurnRequestDeadline, v as ConversationQueueMessageRejectedError } from "./background-compaction-queue-
|
|
7
|
-
import { C as requestAnotherSlice, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-
|
|
2
|
+
import { Ct as isInvalidConversationRecordError, St as isFinalAttempt, bt as hasConversationStop } from "./projection-Bhz1tp0G.js";
|
|
3
|
+
import { x as isProviderRetryError } from "./client-DkG0Tj53.js";
|
|
4
|
+
import { i as getChatConfig } from "./config-3AZ11aSM.js";
|
|
5
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-DHzrobea.js";
|
|
6
|
+
import { g as getTurnRequestDeadline, v as ConversationQueueMessageRejectedError } from "./background-compaction-queue-oegyrxSe.js";
|
|
7
|
+
import { C as requestAnotherSlice, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-C4z8gOgZ.js";
|
|
8
8
|
// src/chat/task-execution/attempt-selection.ts
|
|
9
9
|
function selectContiguousTurnBatch(messages) {
|
|
10
10
|
const first = messages[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.281.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"sharp": "^0.35.3",
|
|
92
92
|
"yaml": "^2.9.0",
|
|
93
93
|
"zod": "^4.5.4",
|
|
94
|
-
"@sentry/junior-plugin-api": "0.
|
|
94
|
+
"@sentry/junior-plugin-api": "0.281.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"bullmq": "^6.5.0",
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
"typescript": "^7.0.2",
|
|
127
127
|
"vercel": "^54.4.0",
|
|
128
128
|
"vitest": "^4.1.12",
|
|
129
|
-
"@sentry/junior-github": "0.
|
|
129
|
+
"@sentry/junior-github": "0.281.0",
|
|
130
130
|
"@sentry/junior-testing": "0.0.0",
|
|
131
|
-
"@sentry/junior-memory": "0.
|
|
131
|
+
"@sentry/junior-memory": "0.281.0"
|
|
132
132
|
},
|
|
133
133
|
"scripts": {
|
|
134
134
|
"build": "tsdown",
|