@sentry/junior 0.282.0 → 0.284.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-BAqo7eOH.js → adapter-CW5UW7vL.js} +1 -1
- package/dist/{admin-DbWpMHh6.js → admin-DUWN8zZX.js} +1 -1
- package/dist/{agent-runner-h4CDcnDV.js → agent-runner-Cqr21pOU.js} +53 -25
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +167 -59
- package/dist/{app-B-0wwAxr.d.ts → app-CvGalMxi.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +34 -31
- package/dist/{assistant-reply-4Wvo95-N.js → assistant-reply-CFE-OZMS.js} +1 -1
- package/dist/{automation-sIsmIXH7.js → automation-Zvx_I9Z5.js} +2 -2
- package/dist/{background-compaction-queue-CoWqScCC.js → background-compaction-queue-CHFzrQbS.js} +2 -2
- package/dist/{briefs-CMiotFo9.js → briefs-Cx7mkfSk.js} +4 -4
- package/dist/{catalog-runtime-Cpje_Uic.js → catalog-runtime-dKOVbR7l.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 +30 -4
- package/dist/{client-BHgCXeaF.js → client-CMyH5rDz.js} +2 -2
- package/dist/{config-DBdBimZ9.js → config-Dt3CpG17.js} +97 -4
- package/dist/{connections-DjY72_uF.js → connections-CCHPybZP.js} +10 -10
- package/dist/{conversation-DNtcULyX.js → conversation-DdT7SNar.js} +3 -1
- package/dist/{conversation-pending-messages-LlFnr9-m.js → conversation-pending-messages-Dct5pheX.js} +1 -1
- package/dist/{conversation-privacy-DiDh9KE4.js → conversation-privacy-BpHHhEVp.js} +1 -1
- package/dist/{credential-sync-DUrQwccr.js → credential-sync-BBPw8dam.js} +13 -13
- package/dist/{db-hQsoB16L.d.ts → db-D7CCwAo8.d.ts} +1 -1
- package/dist/{executor-CGqJCxgR.js → executor-CyIwHz9r.js} +26 -3
- package/dist/instrumentation.js +37 -13
- package/dist/{logging-DapIaJAi.js → logging-Qo-7xGp1.js} +1 -1
- package/dist/{media-Dq9_svfQ.js → media-Bu9C6lz0.js} +3 -1
- package/dist/{message-BjN5sKad.js → message-DFbtOWqv.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DVHKrjJP.js → oauth-callback-server-BB1gixWo.js} +2 -2
- package/dist/{projection-ii_OYu6z.js → projection-0UcUeuzn.js} +319 -18
- package/dist/{prompt-DI6KCtwb.js → prompt-CCtaGgbI.js} +1 -1
- package/dist/push-endpoint-CO-nomUd.js +36 -0
- package/dist/{registry-DpjG3yS-.js → registry-DOnPkI8g.js} +1 -1
- package/dist/{resolve-iMW9Dgo2.js → resolve-Di3omymY.js} +3 -3
- package/dist/{result-BrlvfyIj.js → result-NvndYzCb.js} +9 -9
- package/dist/{runner-Bg9mr2pB.js → runner-CnX_dTKw.js} +11 -11
- package/dist/{sandbox-egress-signals-Bd3lb_Wd.js → sandbox-egress-signals-CtxLJmmg.js} +1 -1
- package/dist/{cadence-R7Em4RjE.js → schedule-BTp__wrw.js} +81 -1
- package/dist/{schema-CsqJzkP5.d.ts → schema-B017enNE.d.ts} +61 -1
- package/dist/{schema-BN34Jy-U.js → schema-Bn3miEd_.js} +42 -4
- package/dist/{service-account-Dfl9Pitm.js → service-account-KhZIqXRi.js} +3 -3
- package/dist/{service-account-Bd1348kw.js → service-account-ewDAx4Mx.js} +3 -3
- package/dist/{session-stop-CVEEx_YD.js → session-stop-D_1SysjC.js} +12 -12
- package/dist/{skills-DqUUuf4L.js → skills-CKyotM4g.js} +2 -2
- package/dist/{spawn-e7rQs14T.js → spawn-D5D2MQdz.js} +2 -2
- package/dist/{stop-DtpBUUJq.js → stop-BSKRTaRS.js} +71 -122
- package/dist/{store-nETG4KVg.js → store-G3S0kWSD.js} +4 -4
- package/dist/{store-nu3Xx08K.js → store-ymkEUWe4.js} +3 -3
- package/dist/{task-queue-CYje8WKs.js → task-queue-BcOHzXxe.js} +3 -3
- package/dist/{task-runner-CwegN45x.js → task-runner-B65cDumh.js} +18 -9
- package/dist/{thread-state-BDaMl9yd.js → thread-state-D6rNGQu9.js} +4 -4
- package/dist/{turn-failure-response-CV06tN_R.js → turn-failure-response-BlO4nuDJ.js} +7 -7
- package/dist/{turn-lifecycle-CF2N7ud5.js → turn-lifecycle-BQ8ETk63.js} +1 -1
- package/dist/{turn-session-routing-BIJGJjVh.js → turn-session-routing-D_GXfcAG.js} +9 -9
- package/dist/{validation-DXvxEEjq.js → validation-DJG_wrg2.js} +1 -1
- package/dist/{version-CzEk1KBX.js → version-i1An1eTS.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-C2PztlYX.js → viewer-BlpnzZZa.js} +4 -4
- package/dist/{work-BM_L0Pv9.js → work-BgCW3FDC.js} +11 -11
- package/dist/{worker-2no53G60.js → worker-BJz1mwYt.js} +6 -6
- package/migrations/0081_conversation_pin_position.sql +1 -0
- package/migrations/0082_push_notifications.sql +14 -0
- package/migrations/meta/0081_snapshot.json +4271 -0
- package/migrations/meta/0082_snapshot.json +4373 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +6 -4
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
import { h as startSpan, i as getActiveSpan, r as continueTrace } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { $ as completeTurnRecord, $
|
|
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
|
|
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-
|
|
2
|
+
import { $ as completeTurnRecord, $i as withSlackRetries, A as getConversationMessageSlackTs, Co as createPluginCache, D as buildConversationContext, Do as piMessageFromHistoryItem, E as appendThreadContextMessages, En as webActorUserIds, F as turnHasReply, Ga as conversationHasParticipantUser, Gi as downloadPrivateSlackFile, Gr as verifyTimerWatchCredentialSubject, H as AuthorizationFlowDisabledError, Ha as readConversationAccessFromSql, I as upsertConversationMessage, J as wasPendingAuthStopped, Ja as conversationNotArchivedForUser, Ji as getSlackClient, K as clearPendingAuth, Ka as conversationIsMemberRoot, Kr as JUNIOR_THREAD_STATE_TTL_MS, Ln as getPlugins, M as markConversationMessage, Mi as addReactionToMessage, N as normalizeConversationText, O as createConversationMemoryService, P as recordDeliveredAssistantMessage, Q as abandonTurnRecord, Qa as viewerConversationMembership, Qn as closeReviewItem, R as PluginCredentialFailureError, S as resolveConversationTitle, Sn as isExperimentalFeatureEnabled, So as lookupSlackUser, To as configValueSchema, Ua as conversationArchivedForEmail, Ut as persistWithRetry, Va as createConversationAccessReader, Wa as conversationArchivedForUser, Wi as SlackActionError, X as loadTurnCheckpoint, Xa as conversationViewerMarks, Xi as isDmChannel, Ya as conversationPinnedForUser, Z as saveTurnCheckpoint, Za as readConversationViewerMarks, Zi as normalizeSlackConversationId, _r as reviewItemNeedsUser, a as loadProjection, an as trimTrailingAssistantMessages, ar as listWaitingConversations, d as recordAuthorizationCompleted, et as failTurnRecord, fn as decideSubscribedThreadReply, fo as readAttachmentVisionSummary, fr as canReadReviewItem, h as recordSubscribedReplyRoute, i as loadConversationProjection, io as readConversationEventPageAround, ir as listReplyActionItems, j as isHumanConversationMessage, ji as truncateStatusText, k as estimateConversationContextTokens, ki as normalizeSlackStatusText, kr as cancelSubscriptions, ln as buildDeterministicAssistantMessageId, lo as notInheritedByForkChild, mn as getThreadStopDecision, mo as recordSlackAttachment, n as commitMessages, no as readConversationEventPage, nr as getReviewItem, nt as listTurnSummaries, o as loadTurnProjection, pn as getSubscribedReplyPreflightDecision, po as readSlackAttachmentsVersion, pr as isOnlyAssignee, qa as conversationNotArchivedForEmail, qi as getHeaderString, ro as readConversationEventPageAfter, rt as recordTurnSummary, so as buildSentryConversationUrl, sr as takeReviewItem, t as commitAcceptedReply, to as readLatestConversationBrief, tt as getTurnRecord, un as buildDeterministicTurnId, uo as getSlackFileId, ur as canActOnReviewItem, v as hydrateConversationMessages, vo as listConversationAnnotations, vr as reviewItemReaderForUser, w as fallbackShortTitle, wn as createUserTokenStore, x as persistConversationMessageSummaries, y as persistConversationMessages, yo as listConversationAnnotationsById, za as createPluginLogger, zi as removeReactionFromMessage, zt as buildTurnErrorResponse } from "./projection-0UcUeuzn.js";
|
|
3
|
+
import { a as completeText, c as resolveGatewayModel, m as escapeXml, r as completeDecision, x as isProviderRetryError } from "./client-CMyH5rDz.js";
|
|
4
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-Dt3CpG17.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-Qo-7xGp1.js";
|
|
6
|
+
import { t as JUNIOR_VERSION } from "./version-i1An1eTS.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
|
|
10
|
-
import {
|
|
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-
|
|
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-BlpnzZZa.js";
|
|
9
|
+
import { A as conversationReadColumns, C as isUserInstruction, D as juniorCodeChanges, M as juniorIdentities, N as juniorUsers, P as juniorDestinations, _ as juniorConversationReadPositions, b as juniorConversationBriefs, j as juniorConversations, l as juniorReviewItems, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-CyIwHz9r.js";
|
|
10
|
+
import { _ as instructionProvenanceFor, h as contextProvenance, i as isVisionImageMediaType, r as detectImageMediaType } from "./media-Bu9C6lz0.js";
|
|
11
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-DOnPkI8g.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-Cqr21pOU.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-CW5UW7vL.js";
|
|
15
|
+
import { R as readMessageAttachments, c as conversationDetailReportSchema, p as conversationFeedSchema, u as conversationEventPageSchema } from "./conversation-DdT7SNar.js";
|
|
16
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-CCtaGgbI.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-G3S0kWSD.js";
|
|
18
|
+
import { n as getAssistantReplyText, t as decideReply } from "./assistant-reply-CFE-OZMS.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-D_1SysjC.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 apiErrorSchema, f as healthReportSchema, s as conversationPendingMessagesReportSchema } from "./conversation-pending-messages-
|
|
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-CHFzrQbS.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-ymkEUWe4.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-D_GXfcAG.js";
|
|
24
|
+
import { d as apiErrorSchema, f as healthReportSchema, s as conversationPendingMessagesReportSchema } from "./conversation-pending-messages-Dct5pheX.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-NvndYzCb.js";
|
|
26
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-BQ8ETk63.js";
|
|
27
|
+
import { o as AgentRunError, s as executeTurn } from "./work-BgCW3FDC.js";
|
|
28
|
+
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-D6rNGQu9.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-CCHPybZP.js";
|
|
30
|
+
import { t as bindMessageAgent } from "./message-DFbtOWqv.js";
|
|
31
|
+
import { t as bindSpawnAgent } from "./spawn-D5D2MQdz.js";
|
|
32
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-B65cDumh.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-BlO4nuDJ.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";
|
|
37
37
|
import { conversationSidebarAnnotationSchema, createSlackSource, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
38
38
|
import { alias } from "drizzle-orm/pg-core";
|
|
39
|
-
import { del, get, put } from "@vercel/blob";
|
|
40
39
|
import { HTTPException } from "hono/http-exception";
|
|
41
40
|
import { Message, ThreadImpl, stringifyMarkdown } from "chat";
|
|
42
41
|
import { SlackFormatConverter, createSlackAdapter } from "@chat-adapter/slack";
|
|
@@ -303,83 +302,6 @@ function createAgentDispatchConversationWorker(options) {
|
|
|
303
302
|
}
|
|
304
303
|
};
|
|
305
304
|
}
|
|
306
|
-
// src/chat/attachments/memory.ts
|
|
307
|
-
/**
|
|
308
|
-
* Store attachments in process memory, for tests.
|
|
309
|
-
*
|
|
310
|
-
* Objects are lost when the process stops, and each process has its own
|
|
311
|
-
* copy. Do not use this provider for deployed apps.
|
|
312
|
-
*/
|
|
313
|
-
function createMemoryAttachmentStorage() {
|
|
314
|
-
const objects = /* @__PURE__ */ new Map();
|
|
315
|
-
return {
|
|
316
|
-
objects,
|
|
317
|
-
provider: "memory",
|
|
318
|
-
async put(input) {
|
|
319
|
-
objects.set(input.key, Buffer.from(input.body));
|
|
320
|
-
},
|
|
321
|
-
async get(key) {
|
|
322
|
-
const body = objects.get(key);
|
|
323
|
-
if (!body) return null;
|
|
324
|
-
return new ReadableStream({ start(controller) {
|
|
325
|
-
controller.enqueue(new Uint8Array(body));
|
|
326
|
-
controller.close();
|
|
327
|
-
} });
|
|
328
|
-
},
|
|
329
|
-
async delete(keys) {
|
|
330
|
-
for (const key of keys) objects.delete(key);
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
// src/chat/attachments/vercel.ts
|
|
335
|
-
/** Store private conversation attachments in Vercel Blob. */
|
|
336
|
-
function createVercelAttachmentStorage() {
|
|
337
|
-
return {
|
|
338
|
-
provider: "vercel-blob",
|
|
339
|
-
async put(input) {
|
|
340
|
-
await put(input.key, input.body, {
|
|
341
|
-
access: "private",
|
|
342
|
-
addRandomSuffix: false,
|
|
343
|
-
allowOverwrite: true,
|
|
344
|
-
contentType: input.contentType
|
|
345
|
-
});
|
|
346
|
-
},
|
|
347
|
-
async get(key) {
|
|
348
|
-
const result = await get(key, {
|
|
349
|
-
access: "private",
|
|
350
|
-
useCache: false
|
|
351
|
-
});
|
|
352
|
-
return result?.statusCode === 200 ? result.stream : null;
|
|
353
|
-
},
|
|
354
|
-
async delete(keys) {
|
|
355
|
-
if (keys.length === 0) return;
|
|
356
|
-
await del(keys);
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
// src/chat/attachments/storage.ts
|
|
361
|
-
/**
|
|
362
|
-
* Return attachment storage for the configured provider.
|
|
363
|
-
*
|
|
364
|
-
* Callers do not choose a provider. Chat config decides it.
|
|
365
|
-
*/
|
|
366
|
-
function getAttachmentStorage() {
|
|
367
|
-
return createAttachmentStorage(getChatConfig().attachmentStorage);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Create attachment storage for one provider config.
|
|
371
|
-
*
|
|
372
|
-
* Runtime code uses `getAttachmentStorage()`. Call this only to test a
|
|
373
|
-
* provider adapter with its own config.
|
|
374
|
-
*/
|
|
375
|
-
function createAttachmentStorage(config) {
|
|
376
|
-
switch (config.provider) {
|
|
377
|
-
case "vercel-blob": return createVercelAttachmentStorage();
|
|
378
|
-
case "s3": return createS3AttachmentStorage(config.s3);
|
|
379
|
-
case "memory": return createMemoryAttachmentStorage();
|
|
380
|
-
default: throw new Error(`Unsupported attachment storage provider: ${String(config.provider)}`);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
305
|
// src/chat/plugins/unfinished-work.ts
|
|
384
306
|
/**
|
|
385
307
|
* Return assigned and unfinished plugin work for the candidate conversations.
|
|
@@ -1251,7 +1173,18 @@ async function startProcessingReactionForMessage(args) {
|
|
|
1251
1173
|
}
|
|
1252
1174
|
};
|
|
1253
1175
|
}
|
|
1254
|
-
// src/chat/
|
|
1176
|
+
// src/chat/task-execution/turn-telemetry.ts
|
|
1177
|
+
/** Read the turn input timing facts from a mailbox batch, oldest first. */
|
|
1178
|
+
function turnInputTelemetry(messages) {
|
|
1179
|
+
const oldest = messages[0];
|
|
1180
|
+
if (!oldest) return void 0;
|
|
1181
|
+
return {
|
|
1182
|
+
count: messages.length,
|
|
1183
|
+
oldestCreatedAtMs: oldest.createdAtMs,
|
|
1184
|
+
oldestReceivedAtMs: oldest.receivedAtMs,
|
|
1185
|
+
traceContexts: messages.flatMap((message) => message.traceContext ?? [])
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1255
1188
|
const SENTRY_TRACE_PATTERN = /^([0-9a-f]{32})-([0-9a-f]{16})(?:-([01]))?$/;
|
|
1256
1189
|
function spanLinks({ sentryTrace }) {
|
|
1257
1190
|
const [, traceId, spanId, sampled] = SENTRY_TRACE_PATTERN.exec(sentryTrace) ?? [];
|
|
@@ -1286,7 +1219,7 @@ async function withTurnSpan(context, input, callback) {
|
|
|
1286
1219
|
/**
|
|
1287
1220
|
* Build the `chat.turn` timing attributes for the oldest input message.
|
|
1288
1221
|
*
|
|
1289
|
-
*
|
|
1222
|
+
* The provider, the ingress host, and the worker host use separate clocks. A negative
|
|
1290
1223
|
* duration is clock skew, not latency, so it is left out.
|
|
1291
1224
|
*/
|
|
1292
1225
|
function getTurnInputSpanAttributes(input, turnStartedAtMs) {
|
|
@@ -2638,15 +2571,9 @@ function createSlackConversationWorker(options) {
|
|
|
2638
2571
|
}
|
|
2639
2572
|
return { status: "completed" };
|
|
2640
2573
|
}
|
|
2641
|
-
const oldestRecord = records[0];
|
|
2642
2574
|
const latestRecord = records[records.length - 1];
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
count: records.length,
|
|
2646
|
-
oldestCreatedAtMs: oldestRecord.createdAtMs,
|
|
2647
|
-
oldestReceivedAtMs: oldestRecord.receivedAtMs,
|
|
2648
|
-
traceContexts: records.flatMap((record) => record.traceContext ?? [])
|
|
2649
|
-
};
|
|
2575
|
+
const telemetry = turnInputTelemetry(records);
|
|
2576
|
+
if (!latestRecord || !telemetry) return { status: "completed" };
|
|
2650
2577
|
const latestMetadata = parseSlackMetadata(latestRecord.input.metadata);
|
|
2651
2578
|
if (!latestMetadata) throw new Error("Latest conversation mailbox record is not Slack metadata");
|
|
2652
2579
|
if (!await context.checkIn()) return { status: "lost_lease" };
|
|
@@ -6588,14 +6515,17 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
|
|
|
6588
6515
|
const isEventTurn = source.kind === "event" || savedMessageIsEvent;
|
|
6589
6516
|
const deliverToProvider = Boolean(conversationLocation) && isEventTurn;
|
|
6590
6517
|
const surface = deliverToProvider ? "slack" : "api";
|
|
6591
|
-
|
|
6518
|
+
const inputTelemetry = resolved.kind === "mailbox" ? turnInputTelemetry(resolved.batch.map((entry) => entry.message)) : void 0;
|
|
6519
|
+
const turnTrace = inputTelemetry ?? (savedTurn?.traceContext ? { traceContexts: [savedTurn.traceContext] } : void 0);
|
|
6520
|
+
return await withTurnSpan({
|
|
6592
6521
|
conversationId: context.conversationId,
|
|
6593
6522
|
platform: actor.platform,
|
|
6594
6523
|
...webActor ? {
|
|
6595
6524
|
userId: webActor.userId,
|
|
6596
6525
|
...webActor.userName ? { userName: webActor.userName } : void 0
|
|
6597
6526
|
} : void 0
|
|
6598
|
-
}, async () => {
|
|
6527
|
+
}, turnTrace, async (setTurnSpanAttributes) => {
|
|
6528
|
+
if (inputTelemetry) setTurnSpanAttributes(getTurnInputSpanAttributes(inputTelemetry, Date.now()));
|
|
6599
6529
|
let acknowledged = isResume || context.attempt.messages.length === 0;
|
|
6600
6530
|
const acknowledge = async () => {
|
|
6601
6531
|
if (acknowledged) return;
|
|
@@ -7125,6 +7055,7 @@ async function setViewerArchive(args) {
|
|
|
7125
7055
|
set: {
|
|
7126
7056
|
archivedAt,
|
|
7127
7057
|
pinnedAt: null,
|
|
7058
|
+
pinPosition: null,
|
|
7128
7059
|
lastMessageAt: sql`greatest(${juniorConversationParticipants.lastMessageAt}, excluded.last_message_at)`
|
|
7129
7060
|
}
|
|
7130
7061
|
});
|
|
@@ -8355,6 +8286,7 @@ function conversationSummaryFromStoredConversation(args) {
|
|
|
8355
8286
|
...locationUrl ? { locationUrl } : void 0,
|
|
8356
8287
|
archivedAt: args.archivedAtMs === void 0 ? null : new Date(args.archivedAtMs).toISOString(),
|
|
8357
8288
|
pinnedAt: args.pinnedAtMs === void 0 ? null : new Date(args.pinnedAtMs).toISOString(),
|
|
8289
|
+
...args.pinPosition === void 0 ? void 0 : { pinPosition: args.pinPosition },
|
|
8358
8290
|
...slackThread ? { channel: slackThread.channelId } : void 0,
|
|
8359
8291
|
...channelName ? { channelName } : void 0,
|
|
8360
8292
|
...channelNameRedacted ? { channelNameRedacted: true } : void 0,
|
|
@@ -9541,7 +9473,10 @@ async function pinConversation(viewer, conversationId, body) {
|
|
|
9541
9473
|
const rootConversationId = await resolveRootConversationId(executor, conversationId);
|
|
9542
9474
|
const db = executor.db();
|
|
9543
9475
|
if (!body.pinned) {
|
|
9544
|
-
await db.update(juniorConversationParticipants).set({
|
|
9476
|
+
await db.update(juniorConversationParticipants).set({
|
|
9477
|
+
pinnedAt: null,
|
|
9478
|
+
pinPosition: null
|
|
9479
|
+
}).where(and(eq(juniorConversationParticipants.userId, viewer.id), eq(juniorConversationParticipants.rootConversationId, rootConversationId)));
|
|
9545
9480
|
return { pinnedAt: null };
|
|
9546
9481
|
}
|
|
9547
9482
|
const [root] = await db.select({ lastActivityAt: juniorConversations.lastActivityAt }).from(juniorConversations).where(eq(juniorConversations.conversationId, rootConversationId)).limit(1);
|
|
@@ -9556,11 +9491,25 @@ async function pinConversation(viewer, conversationId, body) {
|
|
|
9556
9491
|
target: [juniorConversationParticipants.userId, juniorConversationParticipants.rootConversationId],
|
|
9557
9492
|
set: {
|
|
9558
9493
|
archivedAt: null,
|
|
9559
|
-
pinnedAt
|
|
9494
|
+
pinnedAt,
|
|
9495
|
+
pinPosition: null
|
|
9560
9496
|
}
|
|
9561
9497
|
});
|
|
9562
9498
|
return { pinnedAt: pinnedAt.toISOString() };
|
|
9563
9499
|
}
|
|
9500
|
+
/**
|
|
9501
|
+
* Save the viewer's Pinned order. Each listed pin takes its index as its
|
|
9502
|
+
* place. The update reads only the viewer's own pinned rows, so an id that
|
|
9503
|
+
* the viewer did not pin changes nothing and grants nothing.
|
|
9504
|
+
*/
|
|
9505
|
+
async function reorderPinnedConversations(viewer, body) {
|
|
9506
|
+
const ids = body.conversationIds;
|
|
9507
|
+
const participants = juniorConversationParticipants;
|
|
9508
|
+
const positions = sql.join(ids.map((id, index) => sql`when ${id} then ${index}::integer`), sql` `);
|
|
9509
|
+
const updated = await getDb().update(participants).set({ pinPosition: sql`case ${participants.rootConversationId} ${positions} else ${participants.pinPosition} + ${ids.length}::integer end` }).where(and(eq(participants.userId, viewer.id), isNotNull(participants.pinnedAt))).returning({ rootConversationId: participants.rootConversationId });
|
|
9510
|
+
const updatedIds = new Set(updated.map((row) => row.rootConversationId));
|
|
9511
|
+
return { conversationIds: ids.filter((id) => updatedIds.has(id)) };
|
|
9512
|
+
}
|
|
9564
9513
|
// src/api/conversations/steer-pending-messages.ts
|
|
9565
9514
|
/**
|
|
9566
9515
|
* Steer the viewer's own queued web messages into the conversation now.
|
|
@@ -9632,4 +9581,4 @@ function viewerWebMessages(messages, viewer) {
|
|
|
9632
9581
|
}] : [];
|
|
9633
9582
|
});
|
|
9634
9583
|
}
|
|
9635
|
-
export {
|
|
9584
|
+
export { reviewItemChange as $, createSlackWebApiStatusSender as A, stopSlackThread as B, readConversationPendingMessages as C, createProductionConversationWorkOptions as D, archiveConversation as E, resolveAllowedDomains as F, bindMessageAuthorIdentityId as G, withNormalizedThreadId as H, recordSkippedConversationMessage as I, parseContent as J, startProcessingReaction as K, buildSlackInboundMessage as L, isAllowedDomain as M, isAllowedSignInEmail as N, createProductionSlackWebhookServices as O, readEnvList as P, readReviewItemForUser as Q, clearSlackPendingReactions as R, cancelConversationPendingMessagesForViewer as S, resolveMentions as T, stopConversationTurn as U, normalizeIncomingSlackThreadId as V, THREAD_OPTOUT_ACK as W, actOnReviewItem as X, ReviewItemActionError as Y, closeReviewItemsAnsweredByReply as Z, readFirstHumanMessageTexts as _, readConversationDetail as a, updateUserAutoArchiveSettings as at, decodeConversationCursor as b, forkConversationForViewer as c, throwApiError as ct, readConversationFeed as d, GET as dt, DEFAULT_AUTO_ARCHIVE_SETTINGS as et, readConversationRecordFromSql as f, readHealthReport as ft, conversationSummaryFromStoredConversation as g, readConversationTreeMetricsFromSql as h, reorderPinnedConversations as i, setConversationAutoArchive as it, assertNoLegacyAllowedDomains as j, getProductionSlackAdapter as k, keepQuickQuestionForViewer as l, AGENT_DISPATCH_MAX_AGE_MS as lt, childAgentTotalsReport as m, steerConversationPendingMessagesForViewer as n, readUserAutoArchiveSettings as nt, readConversationDetailEtag as o, emptyResponse as ot, readConversationAuxiliaryCostsFromSql as p, stripLeadingBotMention as q, pinConversation as r, runAutoArchiveSweep as rt, markConversationRead as s, jsonResponse as st, stopConversationTurnForViewer as t, archiveViewerDoneConversations as tt, readConversationEvents as u, enqueueAgentDispatch as ut, appendConversationMessageForViewer as v, requireConversationPendingMessages as w, encodeConversationCursor as x, createConversationForViewer as y, isSlackMessageStopped as z };
|
|
@@ -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 {
|
|
4
|
-
import { p as credentialContextSchema } from "./registry-
|
|
1
|
+
import { g as TURN_REASONING_LEVELS } from "./config-Dt3CpG17.js";
|
|
2
|
+
import { C as getSqlExecutor, x as getConversationStore } from "./viewer-BlpnzZZa.js";
|
|
3
|
+
import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-CyIwHz9r.js";
|
|
4
|
+
import { p as credentialContextSchema } from "./registry-DOnPkI8g.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,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-0UcUeuzn.js";
|
|
2
|
+
import { x as getConversationStore } from "./viewer-BlpnzZZa.js";
|
|
3
|
+
import "./background-compaction-queue-CHFzrQbS.js";
|
|
4
4
|
// src/chat/task-execution/store.ts
|
|
5
5
|
function metadataStore(options) {
|
|
6
6
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -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-Qo-7xGp1.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-CHFzrQbS.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-B65cDumh.js").then((n) => n.r);
|
|
114
114
|
await processPluginTask(message);
|
|
115
115
|
},
|
|
116
116
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $a as createPluginConversationEvents, Bn as coreTaskRegistrations, Co as createPluginCache, Gt as getPiMessageRole, Ln as getPlugins, Ra as createPluginModelCostRecorder, Ta as createPluginModel, Xt as instructionTextForProjection, ei as createPluginState, en as isToolResultError, in as stripRuntimeTurnContext, nn as normalizeToolNameFromResult, tn as isToolResultMessage, tt as getTurnRecord, v as hydrateConversationMessages, wa as createPluginEmbedder, za as createPluginLogger } from "./projection-0UcUeuzn.js";
|
|
3
|
+
import { E as withSpan } from "./logging-Qo-7xGp1.js";
|
|
3
4
|
import { h as parseSlackMessageTs } from "./actor-6jsm_v96.js";
|
|
4
|
-
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-
|
|
5
|
-
import {
|
|
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-
|
|
5
|
+
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-BlpnzZZa.js";
|
|
6
|
+
import { v as sameActorIdentity } from "./media-Bu9C6lz0.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-CW5UW7vL.js";
|
|
8
|
+
import { t as resolveConversationRouting, u as getDispatchRecord } from "./turn-session-routing-D_GXfcAG.js";
|
|
9
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-D6rNGQu9.js";
|
|
10
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-BcOHzXxe.js";
|
|
10
11
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
12
|
// src/chat/plugins/task-runner.ts
|
|
12
13
|
/**
|
|
@@ -270,12 +271,20 @@ async function scheduleSessionCompletedPluginTasks(params, options = {}) {
|
|
|
270
271
|
await send(message);
|
|
271
272
|
}));
|
|
272
273
|
}
|
|
273
|
-
/**
|
|
274
|
+
/**
|
|
275
|
+
* Execute one parsed plugin task request in a `plugin.task` span. The span
|
|
276
|
+
* includes the lock wait, because both delay the work that runs the task.
|
|
277
|
+
*/
|
|
274
278
|
async function processPluginTask(message, options = {}) {
|
|
275
|
-
|
|
279
|
+
const params = pluginTaskParamsSchema.parse(message.params);
|
|
280
|
+
await withSpan(`plugin.task ${message.plugin}.${message.name}`, "plugin.task", { conversationId: params.conversationId }, () => withPluginTaskLock(pluginTaskId(message), async () => {
|
|
276
281
|
const resolved = findPluginTask(message);
|
|
277
282
|
if (!resolved?.task) throw new Error(`Plugin task "${message.plugin}.${message.name}" is not registered`);
|
|
278
283
|
await resolved.task.run(taskPluginContext(resolved.plugin, message, options));
|
|
284
|
+
}), {
|
|
285
|
+
"app.ai.turn.session_id": params.sessionId,
|
|
286
|
+
"app.plugin.name": message.plugin,
|
|
287
|
+
"app.plugin.task": message.name
|
|
279
288
|
});
|
|
280
289
|
}
|
|
281
290
|
export { scheduleSessionCompletedPluginTasks as n, task_runner_exports as r, processPluginTask as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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 { Kr as JUNIOR_THREAD_STATE_TTL_MS, wo as createDurableLocationConfigurationService, y as persistConversationMessages } from "./projection-0UcUeuzn.js";
|
|
2
|
+
import { G as toOptionalNumber, K as toOptionalString, W as isRecord } from "./logging-Qo-7xGp1.js";
|
|
3
|
+
import { S as getDb } from "./viewer-BlpnzZZa.js";
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-CW5UW7vL.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, un as buildDeterministicTurnId, v as hydrateConversationMessages, vo as listConversationAnnotations } from "./projection-0UcUeuzn.js";
|
|
2
|
+
import { b as getProviderErrorUserMessage, g as ProviderError, v as findProviderError, y as getProviderErrorAttributes } from "./client-CMyH5rDz.js";
|
|
3
|
+
import { W as isRecord, t as buildTurnFailureResponse } from "./logging-Qo-7xGp1.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-BlpnzZZa.js";
|
|
6
|
+
import { M as readMessageCardRefs, N as removedCardSchema, P as resolveMessageCards } from "./conversation-DdT7SNar.js";
|
|
7
|
+
import { O as parseAgentInvocationResultMessageId, Q as markTurnCompleted, Z as markTurnClosed, c as getAgentInvocation, m as getAgentInvocationTurnId } from "./store-G3S0kWSD.js";
|
|
8
|
+
import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-D6rNGQu9.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-BlpnzZZa.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 {
|
|
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 {
|
|
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 { $r as ToolInputError, Di as formatSlackLink, Ei as escapeSlackMrkdwnText, Fi as openSlackDirectMessage, Kr as JUNIOR_THREAD_STATE_TTL_MS, Ri as postSlackMessage, Zr as getDashboardTaskLink, w as fallbackShortTitle } from "./projection-0UcUeuzn.js";
|
|
2
|
+
import { n as botConfig } from "./config-Dt3CpG17.js";
|
|
3
|
+
import { _ as runBestEffort, h as logWarn } from "./logging-Qo-7xGp1.js";
|
|
4
|
+
import { Q as agentTurnTotalTokens, S as getDb, Z as agentTurnCostUsd } from "./viewer-BlpnzZZa.js";
|
|
5
|
+
import { d as juniorAutomationVersions, f as juniorAutomations, j as juniorConversations, u as juniorAutomationRuns } from "./executor-CyIwHz9r.js";
|
|
6
|
+
import { h as credentialSubjectSchema } from "./registry-DOnPkI8g.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-CW5UW7vL.js";
|
|
8
|
+
import { O as eventAutomationSchema, S as automationVersionSchema, j as scheduledAutomationSchema } from "./automation-Zvx_I9Z5.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-BlpnzZZa.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-dKOVbR7l.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.284.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-i1An1eTS.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
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-Dt3CpG17.js";
|
|
3
|
+
import { U as normalizeIdentityEmail, V as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-Qo-7xGp1.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
|
|
6
|
-
import { d as
|
|
5
|
+
import { A as conversationReadColumns, E as juniorConversationAnnotations, M as juniorIdentities, N as juniorUsers, P as juniorDestinations, S as juniorConversationMetrics, j as juniorConversations, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-CyIwHz9r.js";
|
|
6
|
+
import { d as historyReplacementSchema, f as newConversationEventSchema, p as encodeHistoryPayload, r as detectImageMediaType, s as conversationEventDataSchema, u as decodeStoredConversationEvent, y as usageSchema } from "./media-Bu9C6lz0.js";
|
|
7
7
|
import { a as withLock } from "./locks-D-0h111u.js";
|
|
8
8
|
import { createHash, randomUUID } from "node:crypto";
|
|
9
9
|
import { and, asc, desc, eq, gt, gte, inArray, isNotNull, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import {
|
|
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-
|
|
1
|
+
import { H as AuthorizationFlowDisabledError, Kt as getTerminalAssistantMessages, Q as abandonTurnRecord, R as PluginCredentialFailureError, Vt as isTurnExecutionLimitExceededError, Z as saveTurnCheckpoint, co as loadForkHistory, et as failTurnRecord, s as openConversationProjection, tt as getTurnRecord } from "./projection-0UcUeuzn.js";
|
|
2
|
+
import { n as botConfig } from "./config-Dt3CpG17.js";
|
|
3
|
+
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-BlpnzZZa.js";
|
|
4
|
+
import { m as agentInstructionProvenance, v as sameActorIdentity } from "./media-Bu9C6lz0.js";
|
|
5
|
+
import { At as withoutSavedSteeringMessages, It as readBlockedReport, St as recordSubagentStarted, kt as buildSteeringPiMessage, xt as recordSubagentEnded, yt as stopChildAgentsOf } from "./agent-runner-Cqr21pOU.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-G3S0kWSD.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-CFE-OZMS.js";
|
|
8
|
+
import { E as maybePostAutomatedTurnLimitNotice, M as recordFinishedTurnForAutomatedLimit, N as resetAutomatedTurnLimit } from "./session-stop-D_1SysjC.js";
|
|
9
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-ymkEUWe4.js";
|
|
10
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-BQ8ETk63.js";
|
|
11
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-D6rNGQu9.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-0UcUeuzn.js";
|
|
3
|
+
import { x as isProviderRetryError } from "./client-CMyH5rDz.js";
|
|
4
|
+
import { i as getChatConfig } from "./config-Dt3CpG17.js";
|
|
5
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-Qo-7xGp1.js";
|
|
6
|
+
import { g as getTurnRequestDeadline, v as ConversationQueueMessageRejectedError } from "./background-compaction-queue-CHFzrQbS.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-ymkEUWe4.js";
|
|
8
8
|
// src/chat/task-execution/attempt-selection.ts
|
|
9
9
|
function selectContiguousTurnBatch(messages) {
|
|
10
10
|
const first = messages[0];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversation_participants" ADD COLUMN "pin_position" integer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE "junior_push_subscriptions" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"user_id" text NOT NULL,
|
|
4
|
+
"endpoint" text NOT NULL,
|
|
5
|
+
"p256dh" text NOT NULL,
|
|
6
|
+
"auth" text NOT NULL,
|
|
7
|
+
"created_at" timestamp with time zone NOT NULL,
|
|
8
|
+
"updated_at" timestamp with time zone NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "junior_users" ADD COLUMN "notification_schedule" jsonb;--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "junior_push_subscriptions" ADD CONSTRAINT "junior_push_subscriptions_user_id_junior_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."junior_users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
13
|
+
CREATE UNIQUE INDEX "junior_push_subscriptions_endpoint_uidx" ON "junior_push_subscriptions" USING btree ("endpoint");--> statement-breakpoint
|
|
14
|
+
CREATE INDEX "junior_push_subscriptions_user_idx" ON "junior_push_subscriptions" USING btree ("user_id");
|