@sentry/junior 0.273.0 → 0.274.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-umap1cth.js → adapter-4qThDhgF.js} +1 -1
- package/dist/{admin-0o6E_3lo.js → admin-c7ASvs6x.js} +1 -1
- package/dist/{agent-runner-D7Qz-lGO.js → agent-runner-CLHM48dh.js} +285 -120
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +4 -4
- package/dist/api.d.ts +1 -1
- package/dist/api.js +27 -27
- package/dist/{app-BcyhJq8x.d.ts → app-BlmPpPoR.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +29 -29
- package/dist/{assistant-reply-wZ7i4OFa.js → assistant-reply-2IwdFWuQ.js} +1 -1
- package/dist/{automation-yffXcZt9.js → automation-BGrd03QO.js} +1 -1
- package/dist/{briefs-CgMnlpIp.js → briefs-C1-NOh8m.js} +4 -4
- package/dist/{catalog-runtime-TygDsPOU.js → catalog-runtime-BnIJimKZ.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-DhqbV0Fe.js → client-C0ZIxoDr.js} +2 -2
- package/dist/{config-C6FTd7PX.js → config-DS-QLVSL.js} +2 -2
- package/dist/{connections-Dq72KajR.js → connections-Djb6ANAh.js} +10 -10
- package/dist/{conversation-T4oabbBi.js → conversation-BjTo9ZFL.js} +1 -1
- package/dist/{conversation-privacy-BeRgrsph.js → conversation-privacy-3IMUZSHC.js} +1 -1
- package/dist/{credential-sync-BmCbHAp4.js → credential-sync-ig88EB_v.js} +13 -13
- package/dist/{db-DOzBGLn5.d.ts → db-BMZhoYKj.d.ts} +1 -1
- package/dist/{executor-BafgvQcc.js → executor-C2moGIHS.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-C4lphW9Y.js → job-queue-Bh9sFO9t.js} +2 -2
- package/dist/{logging-CNs1e04n.js → logging-DYRS7E8s.js} +9 -2
- package/dist/{media-U6Tuz6Mi.js → media-DstkkoNP.js} +21 -2
- package/dist/{message-CETC5lsl.js → message-CicNrhCv.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DcQZsKMm.js → oauth-callback-server-BXyrepfY.js} +2 -2
- package/dist/{projection-BOpi891B.js → projection-CMRrv9Pt.js} +32 -15
- package/dist/{prompt-B1ySjUyf.js → prompt-JEWUUpLW.js} +1 -1
- package/dist/{registry-B-yUrv3h.js → registry-D92WLl5I.js} +1 -1
- package/dist/{resolve-DqVtd4Q9.js → resolve-C-Dh14ps.js} +3 -3
- package/dist/{result-DQwTiLTw.js → result-DZ8TCQkd.js} +9 -9
- package/dist/{runner-Dco5qMq6.js → runner-BBmhrQTM.js} +11 -11
- package/dist/{sandbox-egress-signals-DFc_9Mcv.js → sandbox-egress-signals-Cehpq6hC.js} +1 -1
- package/dist/{schema-5xHDGlBW.js → schema-CX9XGKCm.js} +11 -4
- package/dist/{schema-9OGdsaxF.d.ts → schema-DfdHlBnb.d.ts} +9 -2
- package/dist/{service-account-smdPFWNy.js → service-account-Bapo6l0R.js} +3 -3
- package/dist/{service-account-CWfk9Cs-.js → service-account-Ce1465Fn.js} +3 -3
- package/dist/{session-stop-DaT_7tYa.js → session-stop-CI5qJU7a.js} +11 -11
- package/dist/{skills-BbtJSF2-.js → skills-D-d79XQ6.js} +2 -2
- package/dist/{spawn-Ceikdjkp.js → spawn-C_FETz5x.js} +2 -2
- package/dist/{stop-dKUc-x2K.js → stop-CmwFHwiN.js} +33 -30
- package/dist/{store-C1xuZcLd.js → store-BIQYXvoV.js} +3 -3
- package/dist/{store-DaxUuOmD.js → store-BvI3yBGS.js} +3 -3
- package/dist/{task-queue-ymAh_-P1.js → task-queue-BdB0pab8.js} +3 -3
- package/dist/{task-runner-vlH6pEm3.js → task-runner-DQr2QfvJ.js} +7 -7
- package/dist/{thread-state-BkUpE9Ae.js → thread-state-ngCvtWNa.js} +4 -4
- package/dist/{turn-failure-response-DIsD7ip_.js → turn-failure-response-BDT3sT2v.js} +7 -7
- package/dist/{turn-lifecycle-BdPKdPS8.js → turn-lifecycle-B7O6rZEX.js} +1 -1
- package/dist/{turn-session-routing-BdCTDq9m.js → turn-session-routing-DIeqG2pO.js} +9 -9
- package/dist/{validation-BQjCfh84.js → validation-D3Xik64v.js} +1 -1
- package/dist/{version-BpiFGZZW.js → version-BoWLhNzj.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-C6Y1aXjZ.js → viewer-D25XOUHc.js} +17 -8
- package/dist/{work-ChPh_YEh.js → work-D12-wcf4.js} +11 -11
- package/dist/{worker-Be_sK_ou.js → worker-DGxfDtES.js} +6 -6
- package/package.json +4 -4
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { $ as loadTurnCheckpoint, $n as canAgentChangeReviewItem, $r as isAlreadyExistsError, $t as isAssistantMessage, Ai as findMatchingWatches, An as getPluginSystemPromptContributions, Ar as formatProviderLabel, B as createPluginEgress, Ba as matchSlackAttachments, Bn as closeReviewItem, Br as addReactionToMessage, Bt as TurnSliceLimitExceededError, Ci as STOP_WATCHING_TOOL_NAME, Cn as getOAuthAccountProviders, Cr as hash, D as fallbackShortTitle, Di as createTimerWatch, En as createPluginHookRunner, Er as getSandboxProvider, G as AuthorizationFlowDisabledError, Ga as createPluginAnnotations, Gi as getSlackClient, Gn as insertReviewItem, Gt as CODEMODE_TOOL_NAME, H as createPluginAuthOrchestration, Hi as downloadPrivateSlackFile, Hn as dismissOpenReviewItems, Hr as getSlackMessagePermalink, Ir as normalizeSlackReplyMarkdown, J as canReusePendingAuthLink, Ja as defaultTimezone, Ji as normalizeSlackConversationId, Jn as searchReviewItems, Jr as updateSlackMessage, Jt as getPiMessageRole, K as AuthorizationPauseError, Ki as isConversationScopedChannel, Kr as postSlackMessage, Mi as listWatches, Mn as getPluginUserPromptContributions, Mr as resolveBaseUrl, Nn as getPlugins, O as resolveTaskTitle, Oi as createWatch, Pr as escapeSlackMrkdwnText, Q as continuableMessages, Qr as isAbortError, Rr as slackMention, Rt as TURN_LIMIT_WRAP_UP_MESSAGE, Si as RESOURCE_WATCH_TOOL_SOURCE, Sn as createUserTokenStore, Sr as create, Ti as cancelWatch, Tr as ensureDockerDaemon, U as authorizationId, Ui as getFilePermalink, Un as getOpenReviewItemByDedupeKey, Ur as openSlackDirectMessage, Ut as createTurnLimitGate, V as PluginCredentialFailureError, Vi as SlackActionError, Vr as deleteSlackMessage, Vt as TurnToolCallLimitExceededError, W as AuthPausePersistenceError, Wa as saveObjectAnnotations, Wn as getReviewItem, Wt as isTurnExecutionLimitExceededError, Xi as withSlackRetries, Xn as updateReviewItemContent, Xt as getUserMessageInstructionText, Ya as resolveUserTimezone, Yi as runWithSlackInstallationToken, Yr as uploadFilesToConversation, Yt as getTerminalAssistantMessages, Zi as sleep, Zn as PLUGIN_REVIEW_ITEM_KEY_PREFIX, Zt as hasRuntimeTurnContext, _a as sandboxSkillDir, _i as workspaceRepoCheckoutPath, _n as getAgentContextCompactionTriggerTokens, _r as WorkspaceValidationError, a as loadLastModelProfile, ai as workspaceSnapshotNotReadyUserMessage, an as stripRuntimeTurnContext, bi as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, bn as isExperimentalFeatureEnabled, br as setWorkspaceSnapshot, c as loadTurnRoute, ca as buildCommandScript, ci as consumeSandboxEgressPermissionDeniedSignal, cn as SESSION_CONTEXT_SECTION_TAG, cr as resolveAssignee, d as recordAttachmentsDelivered, da as SANDBOX_COMMAND_PATH, dn as buildDeterministicTurnId, dr as deleteWorkspace, ei as throwSandboxOperationError, en as isContinuablePiBoundary, eo as historyItemFromPiMessage, er as canReadReviewItem, et as saveTurnCheckpoint, fa as SANDBOX_DATA_ROOT, fi as buildSandboxEgressNetworkPolicy, fr as getWorkspace, g as recordMcpProviderConnected, ga as SANDBOX_WORKSPACE_ROOT, gi as tryWorkspaceRepoCheckoutPath, gn as estimateTextTokens, gr as updateWorkspace, h as recordGuardianActionReviewed, ha as SANDBOX_SKILLS_ROOT, hi as SANDBOX_RUNTIME, i as loadConversationProjection, ia as getDashboardTaskLink, ii as isWorkspaceSnapshotNotReadyError, in as retainRuntimeTurnContext, io as getConfigDefaults, ir as requireReviewItemLinks, ji as getWatch, jn as getPluginTools, ki as deliverWatch, kr as deliverOAuthAuthorization, l as openConversationProjection, la as buildNonInteractiveShellScript, li as createSandboxEgressCredentialToken, ln as TURN_CONTEXT_TAG, lr as resolveAssignees, m as recordAuthorizationRequested, ma as SANDBOX_REPOS_ROOT, mr as listWorkspaces, ni as WorkspaceSnapshotNotReadyError, nn as isToolResultMessage, no as JUNIOR_NATIVE_EVENT_NAMESPACE, nr as readReviewItemAgentScope, oa as ToolInputError, oi as clearSandboxEgressSignals, on as trimTrailingAssistantMessages, or as EVERYONE_ASSIGNEE, pa as SANDBOX_JUNIOR_ROOT, pi as resolveSandboxCommandEnvironment, pr as getWorkspaceByName, q as abandonReplacedPendingAuth, qt as extractAssistantText, r as loadConnectedMcpProviders, ra as getDashboardReviewItemLink, ri as getWorkspaceSnapshotNotReadyError, rn as normalizeToolNameFromResult, ro as conversationNoteEvent, rr as requireReviewItemAssignees, sa as PluginToolDeniedError, si as consumeSandboxEgressAuthRequiredSignal, sn as REQUEST_CONTEXT_SECTION_TAG, sr as automationCreatorUserId, ta as getDashboardConversationLink, ti as wrapSandboxSetupError, tn as isToolResultError, to as piMessageFromHistoryItem, u as recordAgentsInstructionsUpdated, ua as runNonInteractiveCommand, ur as createWorkspace, v as recordToolExecutionStarted, va as sandboxSkillFile, vi as resolveChannelCapabilities, vn as getAgentContextInputLimitTokens, vr as invalidateReadySnapshot, wi as cancelSubscriptions, wr as isStale, xi as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, xr as setWorkspaceSnapshotBuild, y as recordTurnRoute, ya as sandboxSkillPathResolution, yi as getSlackToolContext, yr as loadSnapshotsForProfile, zt as TurnBudgetExceededError } from "./projection-
|
|
3
|
-
import { S as resolveGatewayCredential, _ as findProviderError, a as completeText, b as isProviderRetryError, c as resolveGatewayModel, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeObject, l as COMPACTION_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, p as unwrapCurrentInstruction, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as getGatewayApiKey } from "./client-
|
|
4
|
-
import { _ as normalizeSlackEmojiName, n as botConfig } from "./config-
|
|
5
|
-
import { B as
|
|
2
|
+
import { $ as loadTurnCheckpoint, $n as canAgentChangeReviewItem, $r as isAlreadyExistsError, $t as isAssistantMessage, Ai as findMatchingWatches, An as getPluginSystemPromptContributions, Ar as formatProviderLabel, B as createPluginEgress, Ba as matchSlackAttachments, Bn as closeReviewItem, Br as addReactionToMessage, Bt as TurnSliceLimitExceededError, Ci as STOP_WATCHING_TOOL_NAME, Cn as getOAuthAccountProviders, Cr as hash, D as fallbackShortTitle, Di as createTimerWatch, En as createPluginHookRunner, Er as getSandboxProvider, G as AuthorizationFlowDisabledError, Ga as createPluginAnnotations, Gi as getSlackClient, Gn as insertReviewItem, Gt as CODEMODE_TOOL_NAME, H as createPluginAuthOrchestration, Hi as downloadPrivateSlackFile, Hn as dismissOpenReviewItems, Hr as getSlackMessagePermalink, Ir as normalizeSlackReplyMarkdown, J as canReusePendingAuthLink, Ja as defaultTimezone, Ji as normalizeSlackConversationId, Jn as searchReviewItems, Jr as updateSlackMessage, Jt as getPiMessageRole, K as AuthorizationPauseError, Ki as isConversationScopedChannel, Kr as postSlackMessage, Mi as listWatches, Mn as getPluginUserPromptContributions, Mr as resolveBaseUrl, Nn as getPlugins, O as resolveTaskTitle, Oi as createWatch, Pr as escapeSlackMrkdwnText, Q as continuableMessages, Qr as isAbortError, Rr as slackMention, Rt as TURN_LIMIT_WRAP_UP_MESSAGE, Si as RESOURCE_WATCH_TOOL_SOURCE, Sn as createUserTokenStore, Sr as create, Ti as cancelWatch, Tr as ensureDockerDaemon, U as authorizationId, Ui as getFilePermalink, Un as getOpenReviewItemByDedupeKey, Ur as openSlackDirectMessage, Ut as createTurnLimitGate, V as PluginCredentialFailureError, Vi as SlackActionError, Vr as deleteSlackMessage, Vt as TurnToolCallLimitExceededError, W as AuthPausePersistenceError, Wa as saveObjectAnnotations, Wn as getReviewItem, Wt as isTurnExecutionLimitExceededError, Xi as withSlackRetries, Xn as updateReviewItemContent, Xt as getUserMessageInstructionText, Ya as resolveUserTimezone, Yi as runWithSlackInstallationToken, Yr as uploadFilesToConversation, Yt as getTerminalAssistantMessages, Zi as sleep, Zn as PLUGIN_REVIEW_ITEM_KEY_PREFIX, Zt as hasRuntimeTurnContext, _a as sandboxSkillDir, _i as workspaceRepoCheckoutPath, _n as getAgentContextCompactionTriggerTokens, _r as WorkspaceValidationError, a as loadLastModelProfile, ai as workspaceSnapshotNotReadyUserMessage, an as stripRuntimeTurnContext, bi as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, bn as isExperimentalFeatureEnabled, br as setWorkspaceSnapshot, c as loadTurnRoute, ca as buildCommandScript, ci as consumeSandboxEgressPermissionDeniedSignal, cn as SESSION_CONTEXT_SECTION_TAG, cr as resolveAssignee, d as recordAttachmentsDelivered, da as SANDBOX_COMMAND_PATH, dn as buildDeterministicTurnId, dr as deleteWorkspace, ei as throwSandboxOperationError, en as isContinuablePiBoundary, eo as historyItemFromPiMessage, er as canReadReviewItem, et as saveTurnCheckpoint, fa as SANDBOX_DATA_ROOT, fi as buildSandboxEgressNetworkPolicy, fr as getWorkspace, g as recordMcpProviderConnected, ga as SANDBOX_WORKSPACE_ROOT, gi as tryWorkspaceRepoCheckoutPath, gn as estimateTextTokens, gr as updateWorkspace, h as recordGuardianActionReviewed, ha as SANDBOX_SKILLS_ROOT, hi as SANDBOX_RUNTIME, i as loadConversationProjection, ia as getDashboardTaskLink, ii as isWorkspaceSnapshotNotReadyError, in as retainRuntimeTurnContext, io as getConfigDefaults, ir as requireReviewItemLinks, ji as getWatch, jn as getPluginTools, ki as deliverWatch, kr as deliverOAuthAuthorization, l as openConversationProjection, la as buildNonInteractiveShellScript, li as createSandboxEgressCredentialToken, ln as TURN_CONTEXT_TAG, lr as resolveAssignees, m as recordAuthorizationRequested, ma as SANDBOX_REPOS_ROOT, mr as listWorkspaces, ni as WorkspaceSnapshotNotReadyError, nn as isToolResultMessage, no as JUNIOR_NATIVE_EVENT_NAMESPACE, nr as readReviewItemAgentScope, oa as ToolInputError, oi as clearSandboxEgressSignals, on as trimTrailingAssistantMessages, or as EVERYONE_ASSIGNEE, pa as SANDBOX_JUNIOR_ROOT, pi as resolveSandboxCommandEnvironment, pr as getWorkspaceByName, q as abandonReplacedPendingAuth, qt as extractAssistantText, r as loadConnectedMcpProviders, ra as getDashboardReviewItemLink, ri as getWorkspaceSnapshotNotReadyError, rn as normalizeToolNameFromResult, ro as conversationNoteEvent, rr as requireReviewItemAssignees, sa as PluginToolDeniedError, si as consumeSandboxEgressAuthRequiredSignal, sn as REQUEST_CONTEXT_SECTION_TAG, sr as automationCreatorUserId, ta as getDashboardConversationLink, ti as wrapSandboxSetupError, tn as isToolResultError, to as piMessageFromHistoryItem, u as recordAgentsInstructionsUpdated, ua as runNonInteractiveCommand, ur as createWorkspace, v as recordToolExecutionStarted, va as sandboxSkillFile, vi as resolveChannelCapabilities, vn as getAgentContextInputLimitTokens, vr as invalidateReadySnapshot, wi as cancelSubscriptions, wr as isStale, xi as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, xr as setWorkspaceSnapshotBuild, y as recordTurnRoute, ya as sandboxSkillPathResolution, yi as getSlackToolContext, yr as loadSnapshotsForProfile, zt as TurnBudgetExceededError } from "./projection-CMRrv9Pt.js";
|
|
3
|
+
import { S as resolveGatewayCredential, _ as findProviderError, a as completeText, b as isProviderRetryError, c as resolveGatewayModel, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeObject, l as COMPACTION_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, p as unwrapCurrentInstruction, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as getGatewayApiKey } from "./client-C0ZIxoDr.js";
|
|
4
|
+
import { _ as normalizeSlackEmojiName, n as botConfig } from "./config-DS-QLVSL.js";
|
|
5
|
+
import { B as normalizeIdentityEmail, C as summarizeMessageText, E as withSpan, L as runWithLogAttributes, S as setTags, T as withLogContext, U as toOptionalString, V as isRecord$4, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, f as logError, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, l as getLogContextAttributesForSpan, m as logInfo, p as logException, u as getTracePropagationHeaders, v as serializeGenAiAttribute, x as setSpanStatus } from "./logging-DYRS7E8s.js";
|
|
6
6
|
import { g as withActiveSpan, i as getActiveSpan, m as startInactiveSpan } from "./sentry-MDkYAVPV.js";
|
|
7
|
-
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-
|
|
7
|
+
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-3IMUZSHC.js";
|
|
8
8
|
import { a as formatModelProfile, c as modelProfileSchema, l as profileConfig, n as ModelProfileNotConfiguredError, o as formatModelProfiles, r as boundProfile, s as modelIdForProfile, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
9
9
|
import { d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, n as createSlackActor, o as isUserActor, p as parseSlackUserId, u as parseSlackChannelId } from "./actor-B4DYygOB.js";
|
|
10
|
-
import { $ as sameDestination, C as getSqlExecutor, G as agentTurnCostUsd, J as hasAgentTurnUsage, M as SYSTEM_IDENTITY_ID, N as resolveActorIdentityId, S as getDb, W as addAgentTurnUsage, Z as parseDestination, a as readActorIdentityFromSql, b as getConversationMessageSearchStore, f as identityAvatarUrl, h as readUserAvatarUrls, i as readActorIdentity, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
10
|
+
import { $ as sameDestination, C as getSqlExecutor, G as agentTurnCostUsd, J as hasAgentTurnUsage, M as SYSTEM_IDENTITY_ID, N as resolveActorIdentityId, S as getDb, W as addAgentTurnUsage, Z as parseDestination, a as readActorIdentityFromSql, b as getConversationMessageSearchStore, f as identityAvatarUrl, h as readUserAvatarUrls, i as readActorIdentity, x as getConversationStore, y as getConversationEventStore } from "./viewer-D25XOUHc.js";
|
|
11
11
|
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
12
|
-
import { E as juniorArtifacts, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, d as juniorAutomations, f as juniorStats, l as juniorAutomationRuns, s as juniorReviewItemSlackCards } from "./executor-
|
|
13
|
-
import { _ as sameActorIdentity, g as instructionProvenanceFor, h as instructionActors, i as KNOWN_CONVERSATION_EVENT_TYPES, m as contextProvenance, n as detectImageMediaType, p as agentInstructionProvenance, r as isVisionImageMediaType } from "./media-
|
|
12
|
+
import { E as juniorArtifacts, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, d as juniorAutomations, f as juniorStats, l as juniorAutomationRuns, s as juniorReviewItemSlackCards } from "./executor-C2moGIHS.js";
|
|
13
|
+
import { _ as sameActorIdentity, g as instructionProvenanceFor, h as instructionActors, i as KNOWN_CONVERSATION_EVENT_TYPES, m as contextProvenance, n as detectImageMediaType, p as agentInstructionProvenance, r as isVisionImageMediaType } from "./media-DstkkoNP.js";
|
|
14
14
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-DJBompdd.js";
|
|
15
|
-
import { c as fetchWithBoundedOAuthErrorBodies, d as actorLogContext, f as credentialContextForActor, g as credentialUserSubjectId, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, s as OAuthProviderError } from "./registry-
|
|
16
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
17
|
-
import { a as parseSkillInvocation, i as parseSkillFile, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-
|
|
15
|
+
import { c as fetchWithBoundedOAuthErrorBodies, d as actorLogContext, f as credentialContextForActor, g as credentialUserSubjectId, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, s as OAuthProviderError } from "./registry-D92WLl5I.js";
|
|
16
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BnIJimKZ.js";
|
|
17
|
+
import { a as parseSkillInvocation, i as parseSkillFile, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-D-d79XQ6.js";
|
|
18
18
|
import { a as withLock, i as fenceLock } from "./locks-D-0h111u.js";
|
|
19
|
-
import { r as getStateAdapter } from "./adapter-
|
|
19
|
+
import { r as getStateAdapter } from "./adapter-4qThDhgF.js";
|
|
20
20
|
import { i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
21
|
-
import { J as briefOutcomeStatusSchema, V as removedCardSchema, Y as conversationBriefSchema, q as briefLinkSchema } from "./conversation-
|
|
22
|
-
import { r as EVENT_AUTHOR_ID } from "./prompt-
|
|
23
|
-
import { A as AgentMessagePausedError, F as CHILD_AGENT_RESULTS, I as PARENT_AGENT_TARGET, J as isTurnInputCommitLostError, L as agentNameSchema, M as AgentMessageTargetError, N as AgentNameInUseError, R as AGENT_TYPES, U as CooperativeTurnYieldError, V as formatAgentTypes, W as TurnInputCommitLostError, _ as invocationFromRow, d as getAgentInvocationMessageId, g as getLatestAgentInvocationForConversation, h as getChildAgentLockName, j as AgentMessageQueueFullError, k as AgentInvocationLimitError, t as NON_TERMINAL_AGENT_INVOCATION_STATUSES, u as getAgentInvocationIdForResult, v as isTerminalAgentInvocation } from "./store-
|
|
24
|
-
import { a as isNoReplyMarker, i as NO_REPLY_MARKER, n as getAssistantReplyText, r as sanitizeAssistantText, t as decideReply } from "./assistant-reply-
|
|
25
|
-
import { E as resolveSlackReplyTarget, L as readAutomationResult, M as FINISH_AUTOMATION_RUN_TOOL_NAME, N as automationResultSchema$1, R as remindMissingAutomationResult, _ as slackChannelMessageTrigger, a as EVENT_WAIT_MS, b as workspaceSnapshotFinishedEvent, d as getEventCatalog, n as markConversationsStopped, o as enqueueEventNotification, p as requireSlackChannelMessageScope, t as getConversationStoppedAtMs, v as WORKSPACE_SNAPSHOT_FAILED_EVENT, x as workspaceSnapshotWatch, y as WORKSPACE_SNAPSHOT_READY_EVENT } from "./session-stop-
|
|
21
|
+
import { J as briefOutcomeStatusSchema, V as removedCardSchema, Y as conversationBriefSchema, q as briefLinkSchema } from "./conversation-BjTo9ZFL.js";
|
|
22
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-JEWUUpLW.js";
|
|
23
|
+
import { A as AgentMessagePausedError, F as CHILD_AGENT_RESULTS, I as PARENT_AGENT_TARGET, J as isTurnInputCommitLostError, L as agentNameSchema, M as AgentMessageTargetError, N as AgentNameInUseError, R as AGENT_TYPES, U as CooperativeTurnYieldError, V as formatAgentTypes, W as TurnInputCommitLostError, _ as invocationFromRow, d as getAgentInvocationMessageId, g as getLatestAgentInvocationForConversation, h as getChildAgentLockName, j as AgentMessageQueueFullError, k as AgentInvocationLimitError, t as NON_TERMINAL_AGENT_INVOCATION_STATUSES, u as getAgentInvocationIdForResult, v as isTerminalAgentInvocation } from "./store-BIQYXvoV.js";
|
|
24
|
+
import { a as isNoReplyMarker, i as NO_REPLY_MARKER, n as getAssistantReplyText, r as sanitizeAssistantText, t as decideReply } from "./assistant-reply-2IwdFWuQ.js";
|
|
25
|
+
import { E as resolveSlackReplyTarget, L as readAutomationResult, M as FINISH_AUTOMATION_RUN_TOOL_NAME, N as automationResultSchema$1, R as remindMissingAutomationResult, _ as slackChannelMessageTrigger, a as EVENT_WAIT_MS, b as workspaceSnapshotFinishedEvent, d as getEventCatalog, n as markConversationsStopped, o as enqueueEventNotification, p as requireSlackChannelMessageScope, t as getConversationStoppedAtMs, v as WORKSPACE_SNAPSHOT_FAILED_EVENT, x as workspaceSnapshotWatch, y as WORKSPACE_SNAPSHOT_READY_EVENT } from "./session-stop-CI5qJU7a.js";
|
|
26
26
|
import { C as userCustomizationTextSchema, b as webMessageId, g as formatUserInputAnswer, h as buttonUserInputField, m as USER_INPUT_NOTE, p as USER_INPUT_LIMITS, s as sumUtcHoursIntoSixHours, v as normalizeUserInputAnswer, x as USER_CUSTOMIZATION_MAX_CHARS, y as userInputRequestSchema } from "./reporting-window-DgHgwQB3.js";
|
|
27
|
-
import { a as setSnapshotSpanAttributes, i as postinstall, n as resolve$1, r as dependencies, s as getSandboxResources } from "./resolve-
|
|
28
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-
|
|
29
|
-
import { D as stopConversationWork, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage } from "./store-
|
|
30
|
-
import { $ as saveEventAutomation, A as readAutomationRuns, B as readScheduledAutomation, C as readAutomationExecutionByConversationId, Ct as requireEventIdentifier, D as readAutomationExecutionStatusHours, E as readAutomationExecutionStatusDays, I as createScheduledAutomation, J as deleteEventAutomation, L as deleteScheduledAutomation, O as readAutomationExecutionSummaries, Q as parseEventAutomationRow, St as registeredResourceTypeSchema, T as readAutomationExecutionHours, V as saveScheduledAutomation, X as getEventAutomation, Z as listDeletedEventAutomationsCreatedBy, _t as eventWatchUnavailable, at as listAutomationVersions, bt as registeredEventTriggerProblems, c as getDispatchIdForConversation, et as setEventAutomationStatus, ft as automationEventCatalog, gt as eventNamespaceSchema, k as readAutomationExecutions, l as getDispatchInputMessageId, lt as automationRevision, ot as readAutomationVersion, pt as describeRegisteredEventTrigger, q as createEventAutomation, rt as automationDefinition, st as sameDefinitionValue, t as resolveConversationRouting, u as getDispatchRecord, ut as requireAutomationRevision, vt as hasEventCatalogEntries, w as readAutomationExecutionDays, wt as requireValidEventTrigger, x as emptyAutomationRunWindows, xt as registeredEventTypeSchema, yt as registeredEventMatchSchema, z as parseScheduledAutomationRow } from "./turn-session-routing-
|
|
31
|
-
import { _ as getMcpProviderErrorAttributes, a as serviceAccountOnly, c as createMcpServiceAccountClientProvider, d as PluginMcpClient, f as McpProviderError, g as getMcpAwareTelemetryMessage, h as getMcpAwareErrorType, i as serviceAccountAllows, l as getMcpServiceAccountCredentials, m as McpToolError, p as McpServiceAccountRequiredError, u as McpAuthorizationRequiredError, v as toMcpProviderError } from "./service-account-
|
|
32
|
-
import { A as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as taskOutcomeInputSchema, E as automationTitleSchema, F as scheduleIntentSchema, I as weekdaySchema, N as ScheduleIntentError, P as compileScheduleIntent, T as automationInstructionToolSchema, k as eventAutomationTriggerSchema, l as automationListQuerySchema } from "./automation-
|
|
27
|
+
import { a as setSnapshotSpanAttributes, i as postinstall, n as resolve$1, r as dependencies, s as getSandboxResources } from "./resolve-C-Dh14ps.js";
|
|
28
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-Bh9sFO9t.js";
|
|
29
|
+
import { D as stopConversationWork, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage } from "./store-BvI3yBGS.js";
|
|
30
|
+
import { $ as saveEventAutomation, A as readAutomationRuns, B as readScheduledAutomation, C as readAutomationExecutionByConversationId, Ct as requireEventIdentifier, D as readAutomationExecutionStatusHours, E as readAutomationExecutionStatusDays, I as createScheduledAutomation, J as deleteEventAutomation, L as deleteScheduledAutomation, O as readAutomationExecutionSummaries, Q as parseEventAutomationRow, St as registeredResourceTypeSchema, T as readAutomationExecutionHours, V as saveScheduledAutomation, X as getEventAutomation, Z as listDeletedEventAutomationsCreatedBy, _t as eventWatchUnavailable, at as listAutomationVersions, bt as registeredEventTriggerProblems, c as getDispatchIdForConversation, et as setEventAutomationStatus, ft as automationEventCatalog, gt as eventNamespaceSchema, k as readAutomationExecutions, l as getDispatchInputMessageId, lt as automationRevision, ot as readAutomationVersion, pt as describeRegisteredEventTrigger, q as createEventAutomation, rt as automationDefinition, st as sameDefinitionValue, t as resolveConversationRouting, u as getDispatchRecord, ut as requireAutomationRevision, vt as hasEventCatalogEntries, w as readAutomationExecutionDays, wt as requireValidEventTrigger, x as emptyAutomationRunWindows, xt as registeredEventTypeSchema, yt as registeredEventMatchSchema, z as parseScheduledAutomationRow } from "./turn-session-routing-DIeqG2pO.js";
|
|
31
|
+
import { _ as getMcpProviderErrorAttributes, a as serviceAccountOnly, c as createMcpServiceAccountClientProvider, d as PluginMcpClient, f as McpProviderError, g as getMcpAwareTelemetryMessage, h as getMcpAwareErrorType, i as serviceAccountAllows, l as getMcpServiceAccountCredentials, m as McpToolError, p as McpServiceAccountRequiredError, u as McpAuthorizationRequiredError, v as toMcpProviderError } from "./service-account-Bapo6l0R.js";
|
|
32
|
+
import { A as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as taskOutcomeInputSchema, E as automationTitleSchema, F as scheduleIntentSchema, I as weekdaySchema, N as ScheduleIntentError, P as compileScheduleIntent, T as automationInstructionToolSchema, k as eventAutomationTriggerSchema, l as automationListQuerySchema } from "./automation-BGrd03QO.js";
|
|
33
33
|
import { n as privateTraceResultAttributes } from "./private-trace-result-CE7_lEdq.js";
|
|
34
34
|
import { streamSimple } from "@earendil-works/pi-ai/compat";
|
|
35
35
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
36
36
|
import { NoImageGeneratedError, generateImage, generateText } from "ai";
|
|
37
37
|
import path from "node:path";
|
|
38
38
|
import { isDeepStrictEqual } from "node:util";
|
|
39
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
39
40
|
import { createHash, randomBytes, randomInt, randomUUID } from "node:crypto";
|
|
40
41
|
import { z } from "zod";
|
|
41
42
|
import { and, asc, count, desc, eq, exists, gt, gte, inArray, isNotNull, isNull, lt, lte, ne, notExists, notInArray, or, sql } from "drizzle-orm";
|
|
@@ -8670,8 +8671,8 @@ const REVIEW_DESK_TOOL_SOURCE = {
|
|
|
8670
8671
|
id: "review-desk",
|
|
8671
8672
|
description: "Update and search Review items: work on the review desk that needs a person."
|
|
8672
8673
|
};
|
|
8673
|
-
const DEFAULT_LIMIT$
|
|
8674
|
-
const MAX_LIMIT$
|
|
8674
|
+
const DEFAULT_LIMIT$5 = 10;
|
|
8675
|
+
const MAX_LIMIT$4 = 25;
|
|
8675
8676
|
const assigneesSchema = z.array(z.string().trim().min(1).max(320)).min(1).max(20).describe("Who can act on the item. Each entry is `everyone`, an email, or a mention such as `<@U123>`. Everyone means any person who can see the item.");
|
|
8676
8677
|
const subjectSchema = z.object({
|
|
8677
8678
|
id: z.string().trim().min(1).max(500).describe("Stable id of the thing the item is about, such as a pull request URL. Search matches it exactly."),
|
|
@@ -8973,7 +8974,7 @@ function createSearchReviewItemsTool(context, services) {
|
|
|
8973
8974
|
assignee: z.string().trim().min(1).max(320).nullable().optional().describe("`everyone`, an email, or a mention such as `<@U123>`."),
|
|
8974
8975
|
automation_id: z.string().trim().min(1).nullable().optional(),
|
|
8975
8976
|
conversation_id: z.string().trim().min(1).nullable().optional(),
|
|
8976
|
-
limit: z.number().int().min(1).max(MAX_LIMIT$
|
|
8977
|
+
limit: z.number().int().min(1).max(MAX_LIMIT$4).nullable().optional().describe(`Default ${DEFAULT_LIMIT$5}; max ${MAX_LIMIT$4}.`)
|
|
8977
8978
|
}).strict(),
|
|
8978
8979
|
outputSchema: juniorToolOutputSchema,
|
|
8979
8980
|
execute: async (input) => {
|
|
@@ -8986,7 +8987,7 @@ function createSearchReviewItemsTool(context, services) {
|
|
|
8986
8987
|
"dismissed"
|
|
8987
8988
|
] : [status];
|
|
8988
8989
|
const items = await searchReviewItems(db, scope.reader, {
|
|
8989
|
-
limit: input.limit ?? DEFAULT_LIMIT$
|
|
8990
|
+
limit: input.limit ?? DEFAULT_LIMIT$5,
|
|
8990
8991
|
statuses,
|
|
8991
8992
|
...input.assignee ? { assignee: await resolveAssignee(db, input.assignee, scope.tenant, services.findMentionedUserId) } : void 0,
|
|
8992
8993
|
...input.automation_id ? { automationId: input.automation_id } : void 0,
|
|
@@ -11989,11 +11990,11 @@ function createSlackConversationBriefSearchPort(teamId) {
|
|
|
11989
11990
|
/** Deferred tool catalog source for retained Junior conversations. */
|
|
11990
11991
|
const CONVERSATIONS_TOOL_SOURCE = {
|
|
11991
11992
|
id: "conversations",
|
|
11992
|
-
description: "Search messages and events in retained conversations."
|
|
11993
|
+
description: "Search and read messages and events in retained conversations."
|
|
11993
11994
|
};
|
|
11994
11995
|
// src/chat/slack/tools/conversation-message-search.ts
|
|
11995
|
-
const DEFAULT_LIMIT$
|
|
11996
|
-
const MAX_LIMIT$
|
|
11996
|
+
const DEFAULT_LIMIT$4 = 20;
|
|
11997
|
+
const MAX_LIMIT$3 = 50;
|
|
11997
11998
|
const conversationMessageSearchOutputSchema = juniorToolOutputSchema.extend({
|
|
11998
11999
|
after: z.string().datetime().optional(),
|
|
11999
12000
|
annotation: z.string().min(1).optional(),
|
|
@@ -12058,7 +12059,7 @@ function createSlackConversationMessageSearchTool(scope, currentConversationId)
|
|
|
12058
12059
|
before: z.string().datetime().nullable().describe("Include conversations active before this timestamp.").optional(),
|
|
12059
12060
|
channel_id: slackChannelRefParam.nullable().optional(),
|
|
12060
12061
|
query: z.string().trim().min(1).max(200).nullable().describe("Words or phrase to match in message text.").optional(),
|
|
12061
|
-
limit: z.number().int().min(1).max(MAX_LIMIT$
|
|
12062
|
+
limit: z.number().int().min(1).max(MAX_LIMIT$3).describe(`Maximum conversations. Default ${DEFAULT_LIMIT$4}; max ${MAX_LIMIT$3}.`).nullable().optional()
|
|
12062
12063
|
}).strict(),
|
|
12063
12064
|
outputSchema: conversationMessageSearchOutputSchema,
|
|
12064
12065
|
execute: async (input) => {
|
|
@@ -12071,7 +12072,7 @@ function createSlackConversationMessageSearchTool(scope, currentConversationId)
|
|
|
12071
12072
|
const matches = await getConversationMessageSearchStore().search({
|
|
12072
12073
|
currentConversationId,
|
|
12073
12074
|
filters,
|
|
12074
|
-
limit: input.limit ?? DEFAULT_LIMIT$
|
|
12075
|
+
limit: input.limit ?? DEFAULT_LIMIT$4,
|
|
12075
12076
|
scope
|
|
12076
12077
|
});
|
|
12077
12078
|
const matchesOutput = await Promise.all(matches.map(async (match) => {
|
|
@@ -12106,7 +12107,7 @@ function createSlackConversationMessageSearchTool(scope, currentConversationId)
|
|
|
12106
12107
|
});
|
|
12107
12108
|
}
|
|
12108
12109
|
// src/chat/slack/tools/public-search.ts
|
|
12109
|
-
const DEFAULT_LIMIT$
|
|
12110
|
+
const DEFAULT_LIMIT$3 = 10;
|
|
12110
12111
|
const DEFAULT_CONTENT_TYPES = ["messages"];
|
|
12111
12112
|
const CONTENT_TYPES = [
|
|
12112
12113
|
"messages",
|
|
@@ -12369,7 +12370,7 @@ function createSlackPublicSearchTool(actionToken) {
|
|
|
12369
12370
|
channel_types: ["public_channel"],
|
|
12370
12371
|
content_types: normalizedContentTypes,
|
|
12371
12372
|
include_bots: true,
|
|
12372
|
-
limit: limit ?? DEFAULT_LIMIT$
|
|
12373
|
+
limit: limit ?? DEFAULT_LIMIT$3,
|
|
12373
12374
|
...normalizedAfter !== void 0 ? { after: normalizedAfter } : void 0,
|
|
12374
12375
|
...normalizedBefore !== void 0 ? { before: normalizedBefore } : void 0,
|
|
12375
12376
|
...cursor ? { cursor } : void 0,
|
|
@@ -15095,6 +15096,198 @@ function createLoadAttachmentTool(args) {
|
|
|
15095
15096
|
}
|
|
15096
15097
|
});
|
|
15097
15098
|
}
|
|
15099
|
+
// src/chat/conversations/event-access.ts
|
|
15100
|
+
/**
|
|
15101
|
+
* Read access to a Conversation's durable event log for model-facing tools.
|
|
15102
|
+
* The current Conversation tree is always readable. Other Conversations are
|
|
15103
|
+
* readable only when they are public and in the same Slack workspace.
|
|
15104
|
+
*/
|
|
15105
|
+
/**
|
|
15106
|
+
* Throw a repairable tool error unless the active context may read the event
|
|
15107
|
+
* log of `conversationId`.
|
|
15108
|
+
*/
|
|
15109
|
+
async function assertCanReadConversationEvents(context, conversationId) {
|
|
15110
|
+
const conversationStore = getConversationStore();
|
|
15111
|
+
const target = await conversationStore.get({ conversationId });
|
|
15112
|
+
if (!target) throw new ToolInputError(`Conversation not found: ${conversationId}`);
|
|
15113
|
+
if (target.transcriptPurgedAtMs !== void 0) throw new ToolInputError(`Conversation transcript was purged: ${conversationId}`);
|
|
15114
|
+
const accessScope = await resolveAccessScope(conversationStore, context, context.conversationId);
|
|
15115
|
+
const targetRootConversationId = await resolveRootConversationId(conversationStore, conversationId, target.parentConversationId);
|
|
15116
|
+
const targetRoot = targetRootConversationId === conversationId ? target : await conversationStore.get({ conversationId: targetRootConversationId });
|
|
15117
|
+
assertScopeCanReadTarget({
|
|
15118
|
+
accessScope,
|
|
15119
|
+
targetConversationId: conversationId,
|
|
15120
|
+
targetRootConversationId,
|
|
15121
|
+
targetVisibility: targetRoot?.visibility ?? target.visibility,
|
|
15122
|
+
targetDestination: targetRoot?.destination ?? target.destination
|
|
15123
|
+
});
|
|
15124
|
+
}
|
|
15125
|
+
async function resolveAccessScope(conversationStore, context, currentConversationId) {
|
|
15126
|
+
const current = await conversationStore.get({ conversationId: currentConversationId });
|
|
15127
|
+
const currentRootConversationId = current ? await resolveRootConversationId(conversationStore, currentConversationId, current.parentConversationId) : currentConversationId;
|
|
15128
|
+
if (context.location?.provider === "slack") return {
|
|
15129
|
+
currentConversationId,
|
|
15130
|
+
currentRootConversationId,
|
|
15131
|
+
provider: "slack",
|
|
15132
|
+
providerTenantId: context.location.teamId
|
|
15133
|
+
};
|
|
15134
|
+
if (context.source.kind === "slack") return {
|
|
15135
|
+
currentConversationId,
|
|
15136
|
+
currentRootConversationId,
|
|
15137
|
+
provider: "slack",
|
|
15138
|
+
providerTenantId: context.source.teamId
|
|
15139
|
+
};
|
|
15140
|
+
if (context.destination.platform === "slack" && "teamId" in context.destination) return {
|
|
15141
|
+
currentConversationId,
|
|
15142
|
+
currentRootConversationId,
|
|
15143
|
+
provider: "slack",
|
|
15144
|
+
providerTenantId: context.destination.teamId
|
|
15145
|
+
};
|
|
15146
|
+
return {
|
|
15147
|
+
currentConversationId,
|
|
15148
|
+
currentRootConversationId
|
|
15149
|
+
};
|
|
15150
|
+
}
|
|
15151
|
+
async function resolveRootConversationId(conversationStore, conversationId, parentConversationId) {
|
|
15152
|
+
if (!parentConversationId) return conversationId;
|
|
15153
|
+
let cursor = parentConversationId;
|
|
15154
|
+
const seen = /* @__PURE__ */ new Set([conversationId]);
|
|
15155
|
+
while (cursor) {
|
|
15156
|
+
if (seen.has(cursor)) return conversationId;
|
|
15157
|
+
seen.add(cursor);
|
|
15158
|
+
const parent = await conversationStore.get({ conversationId: cursor });
|
|
15159
|
+
if (!parent) return conversationId;
|
|
15160
|
+
if (!parent.parentConversationId) return parent.conversationId;
|
|
15161
|
+
cursor = parent.parentConversationId;
|
|
15162
|
+
}
|
|
15163
|
+
return conversationId;
|
|
15164
|
+
}
|
|
15165
|
+
function assertScopeCanReadTarget(args) {
|
|
15166
|
+
const { accessScope, targetConversationId, targetRootConversationId, targetVisibility, targetDestination } = args;
|
|
15167
|
+
if (targetConversationId === accessScope.currentConversationId || targetRootConversationId !== void 0 && targetRootConversationId === accessScope.currentRootConversationId) return;
|
|
15168
|
+
if (!canExposeConversationPayload(targetVisibility ? { visibility: targetVisibility } : {})) throw new ToolInputError(`Conversation events are not accessible: ${targetConversationId}`);
|
|
15169
|
+
if (accessScope.provider === "slack" && targetDestination?.platform === "slack" && accessScope.providerTenantId && targetDestination.teamId === accessScope.providerTenantId) return;
|
|
15170
|
+
throw new ToolInputError(`Conversation events are not accessible: ${targetConversationId}`);
|
|
15171
|
+
}
|
|
15172
|
+
/** Replace replacement history with its item count; the original events stay readable by seq. */
|
|
15173
|
+
function stripReplacementHistory(data) {
|
|
15174
|
+
if (data.type === "unknown") return {
|
|
15175
|
+
...data,
|
|
15176
|
+
payload: stripReplacementHistoryField(data.payload)
|
|
15177
|
+
};
|
|
15178
|
+
if (data.type === "compaction" || data.type === "handoff") return stripReplacementHistoryField(data);
|
|
15179
|
+
return data;
|
|
15180
|
+
}
|
|
15181
|
+
function stripReplacementHistoryField(value) {
|
|
15182
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
15183
|
+
const { replacementHistory, ...rest } = value;
|
|
15184
|
+
if (replacementHistory === void 0) return value;
|
|
15185
|
+
return {
|
|
15186
|
+
...rest,
|
|
15187
|
+
replacement_history_count: Array.isArray(replacementHistory) ? replacementHistory.length : 0
|
|
15188
|
+
};
|
|
15189
|
+
}
|
|
15190
|
+
// src/chat/tools/read-conversation-event.ts
|
|
15191
|
+
const DEFAULT_LIMIT$2 = 2e4;
|
|
15192
|
+
const MAX_LIMIT$2 = 5e4;
|
|
15193
|
+
const readConversationEventOutputSchema = juniorToolOutputSchema.extend({
|
|
15194
|
+
conversation_id: z.string().min(1),
|
|
15195
|
+
seq: z.number().int().nonnegative(),
|
|
15196
|
+
history_version: z.number().int().nonnegative(),
|
|
15197
|
+
created_at: z.iso.datetime(),
|
|
15198
|
+
type: z.string().min(1).describe("Event type."),
|
|
15199
|
+
tool_name: z.string().min(1).optional().describe("Tool that produced a tool_result event."),
|
|
15200
|
+
is_error: z.boolean().optional().describe("Whether a tool_result event was an error."),
|
|
15201
|
+
text: z.string().describe("Event text from offset, at most limit chars."),
|
|
15202
|
+
offset: z.number().int().nonnegative(),
|
|
15203
|
+
total_chars: z.number().int().nonnegative(),
|
|
15204
|
+
has_more: z.boolean().describe("Whether text continues after this slice.")
|
|
15205
|
+
});
|
|
15206
|
+
/** Create a deferred tool that reads one full event of a conversation log. */
|
|
15207
|
+
function createReadConversationEventTool(context) {
|
|
15208
|
+
return zodTool({
|
|
15209
|
+
description: "Read the full text of one conversation event by seq, in pages. Works for events from earlier history versions, such as cleared tool results.",
|
|
15210
|
+
exposure: "deferred",
|
|
15211
|
+
source: CONVERSATIONS_TOOL_SOURCE,
|
|
15212
|
+
annotations: {
|
|
15213
|
+
destructiveHint: false,
|
|
15214
|
+
idempotentHint: true,
|
|
15215
|
+
openWorldHint: false,
|
|
15216
|
+
readOnlyHint: true
|
|
15217
|
+
},
|
|
15218
|
+
inputSchema: z.object({
|
|
15219
|
+
seq: z.number().int().nonnegative().describe("Event sequence number."),
|
|
15220
|
+
conversation_id: z.string().trim().min(1).nullable().describe("Conversation ID. Omit or null for the current conversation.").optional(),
|
|
15221
|
+
offset: z.number().int().nonnegative().nullable().describe("First char to return. Default 0.").optional(),
|
|
15222
|
+
limit: z.number().int().min(1).max(MAX_LIMIT$2).nullable().describe(`Maximum chars. Default ${DEFAULT_LIMIT$2}; max ${MAX_LIMIT$2}.`).optional()
|
|
15223
|
+
}).strict(),
|
|
15224
|
+
outputSchema: readConversationEventOutputSchema,
|
|
15225
|
+
execute: async (input) => {
|
|
15226
|
+
const conversationId = input.conversation_id?.trim() || context.conversationId;
|
|
15227
|
+
const offset = input.offset ?? 0;
|
|
15228
|
+
const limit = input.limit ?? DEFAULT_LIMIT$2;
|
|
15229
|
+
await assertCanReadConversationEvents(context, conversationId);
|
|
15230
|
+
const event = (await getConversationEventStore().query(conversationId, {
|
|
15231
|
+
afterSeq: input.seq - 1,
|
|
15232
|
+
beforeSeq: input.seq + 1,
|
|
15233
|
+
limit: 1
|
|
15234
|
+
})).events[0];
|
|
15235
|
+
if (!event) throw new ToolInputError(`Conversation event not found: seq ${input.seq} in ${conversationId}`);
|
|
15236
|
+
const text = eventText(event.data);
|
|
15237
|
+
if (offset > 0 && offset >= text.length) throw new ToolInputError(`offset ${offset} is past the end of the event text (${text.length} chars)`);
|
|
15238
|
+
const slice = text.slice(offset, offset + limit);
|
|
15239
|
+
return {
|
|
15240
|
+
conversation_id: conversationId,
|
|
15241
|
+
seq: event.seq,
|
|
15242
|
+
history_version: event.historyVersion,
|
|
15243
|
+
created_at: new Date(event.createdAtMs).toISOString(),
|
|
15244
|
+
type: event.data.type === "unknown" ? event.data.originalType : event.data.type,
|
|
15245
|
+
...toolResultFields(event.data),
|
|
15246
|
+
text: slice,
|
|
15247
|
+
offset,
|
|
15248
|
+
total_chars: text.length,
|
|
15249
|
+
has_more: offset + slice.length < text.length
|
|
15250
|
+
};
|
|
15251
|
+
}
|
|
15252
|
+
});
|
|
15253
|
+
}
|
|
15254
|
+
function toolResultFields(data) {
|
|
15255
|
+
if (data.type !== "tool_result") return void 0;
|
|
15256
|
+
return {
|
|
15257
|
+
...typeof data.toolName === "string" && data.toolName ? { tool_name: data.toolName } : void 0,
|
|
15258
|
+
...typeof data.isError === "boolean" ? { is_error: data.isError } : void 0
|
|
15259
|
+
};
|
|
15260
|
+
}
|
|
15261
|
+
/**
|
|
15262
|
+
* Render agent history items as the text the model saw, and messages as their
|
|
15263
|
+
* text. Other events render as JSON without replacement history, which stays
|
|
15264
|
+
* readable through its original events.
|
|
15265
|
+
*/
|
|
15266
|
+
function eventText(data) {
|
|
15267
|
+
switch (data.type) {
|
|
15268
|
+
case "user_message":
|
|
15269
|
+
case "assistant_message":
|
|
15270
|
+
case "tool_result": return contentText$1(data.content);
|
|
15271
|
+
case "message":
|
|
15272
|
+
case "message_updated": return data.text;
|
|
15273
|
+
default: return JSON.stringify(stripReplacementHistory(data), null, 2);
|
|
15274
|
+
}
|
|
15275
|
+
}
|
|
15276
|
+
function contentText$1(content) {
|
|
15277
|
+
if (typeof content === "string") return content;
|
|
15278
|
+
if (!Array.isArray(content)) return "";
|
|
15279
|
+
return content.map(contentPartText).join("\n");
|
|
15280
|
+
}
|
|
15281
|
+
function contentPartText(part) {
|
|
15282
|
+
if (!part || typeof part !== "object") return "";
|
|
15283
|
+
const value = part;
|
|
15284
|
+
switch (value.type) {
|
|
15285
|
+
case "text": return typeof value.text === "string" ? value.text : "";
|
|
15286
|
+
case "image": return `[image: ${typeof value.mimeType === "string" ? value.mimeType : "unknown type"}]`;
|
|
15287
|
+
case "toolCall": return `[tool call: ${String(value.name)} ${JSON.stringify(value.arguments ?? {})}]`;
|
|
15288
|
+
default: return "";
|
|
15289
|
+
}
|
|
15290
|
+
}
|
|
15098
15291
|
// src/chat/tools/search-conversation-events.ts
|
|
15099
15292
|
const DEFAULT_LIMIT$1 = 25;
|
|
15100
15293
|
const MAX_LIMIT$1 = 100;
|
|
@@ -15108,7 +15301,7 @@ const projectedEventSchema = z.object({
|
|
|
15108
15301
|
history_version: z.number().int().nonnegative().describe("Agent history generation after replacement."),
|
|
15109
15302
|
created_at: z.iso.datetime().describe("When the event was recorded."),
|
|
15110
15303
|
idempotency_key: z.string().min(1).optional().describe("Retry-stable event identity, when assigned."),
|
|
15111
|
-
data: z.record(z.string(), z.unknown()).describe("Bounded event data.")
|
|
15304
|
+
data: z.record(z.string(), z.unknown()).describe("Bounded event data. Read an omitted payload with readConversationEvent.")
|
|
15112
15305
|
}).strict();
|
|
15113
15306
|
const searchConversationEventsOutputSchema = juniorToolOutputSchema.extend({
|
|
15114
15307
|
conversation_id: z.string().min(1),
|
|
@@ -15145,20 +15338,7 @@ function createSearchConversationEventsTool(context) {
|
|
|
15145
15338
|
const limit = input.limit ?? DEFAULT_LIMIT$1;
|
|
15146
15339
|
const types = input.types ?? void 0;
|
|
15147
15340
|
if (afterSeq !== void 0 && beforeSeq !== void 0 && afterSeq >= beforeSeq) throw new ToolInputError("after_seq must be less than before_seq when both are provided");
|
|
15148
|
-
|
|
15149
|
-
const target = await conversationStore.get({ conversationId });
|
|
15150
|
-
if (!target) throw new ToolInputError(`Conversation not found: ${conversationId}`);
|
|
15151
|
-
if (target.transcriptPurgedAtMs !== void 0) throw new ToolInputError(`Conversation transcript was purged: ${conversationId}`);
|
|
15152
|
-
const accessScope = await resolveAccessScope(conversationStore, context, currentConversationId);
|
|
15153
|
-
const targetRootConversationId = await resolveRootConversationId(conversationStore, conversationId, target.parentConversationId);
|
|
15154
|
-
const targetRoot = targetRootConversationId === conversationId ? target : await conversationStore.get({ conversationId: targetRootConversationId });
|
|
15155
|
-
assertCanSearchConversationEvents({
|
|
15156
|
-
accessScope,
|
|
15157
|
-
targetConversationId: conversationId,
|
|
15158
|
-
targetRootConversationId,
|
|
15159
|
-
targetVisibility: targetRoot?.visibility ?? target.visibility,
|
|
15160
|
-
targetDestination: targetRoot?.destination ?? target.destination
|
|
15161
|
-
});
|
|
15341
|
+
await assertCanReadConversationEvents(context, conversationId);
|
|
15162
15342
|
const page = await getConversationEventStore().query(conversationId, {
|
|
15163
15343
|
limit,
|
|
15164
15344
|
...afterSeq === void 0 ? void 0 : { afterSeq },
|
|
@@ -15178,53 +15358,6 @@ function createSearchConversationEventsTool(context) {
|
|
|
15178
15358
|
}
|
|
15179
15359
|
});
|
|
15180
15360
|
}
|
|
15181
|
-
async function resolveAccessScope(conversationStore, context, currentConversationId) {
|
|
15182
|
-
const current = await conversationStore.get({ conversationId: currentConversationId });
|
|
15183
|
-
const currentRootConversationId = current ? await resolveRootConversationId(conversationStore, currentConversationId, current.parentConversationId) : currentConversationId;
|
|
15184
|
-
if (context.location?.provider === "slack") return {
|
|
15185
|
-
currentConversationId,
|
|
15186
|
-
currentRootConversationId,
|
|
15187
|
-
provider: "slack",
|
|
15188
|
-
providerTenantId: context.location.teamId
|
|
15189
|
-
};
|
|
15190
|
-
if (context.source.kind === "slack") return {
|
|
15191
|
-
currentConversationId,
|
|
15192
|
-
currentRootConversationId,
|
|
15193
|
-
provider: "slack",
|
|
15194
|
-
providerTenantId: context.source.teamId
|
|
15195
|
-
};
|
|
15196
|
-
if (context.destination.platform === "slack" && "teamId" in context.destination) return {
|
|
15197
|
-
currentConversationId,
|
|
15198
|
-
currentRootConversationId,
|
|
15199
|
-
provider: "slack",
|
|
15200
|
-
providerTenantId: context.destination.teamId
|
|
15201
|
-
};
|
|
15202
|
-
return {
|
|
15203
|
-
currentConversationId,
|
|
15204
|
-
currentRootConversationId
|
|
15205
|
-
};
|
|
15206
|
-
}
|
|
15207
|
-
async function resolveRootConversationId(conversationStore, conversationId, parentConversationId) {
|
|
15208
|
-
if (!parentConversationId) return conversationId;
|
|
15209
|
-
let cursor = parentConversationId;
|
|
15210
|
-
const seen = /* @__PURE__ */ new Set([conversationId]);
|
|
15211
|
-
while (cursor) {
|
|
15212
|
-
if (seen.has(cursor)) return conversationId;
|
|
15213
|
-
seen.add(cursor);
|
|
15214
|
-
const parent = await conversationStore.get({ conversationId: cursor });
|
|
15215
|
-
if (!parent) return conversationId;
|
|
15216
|
-
if (!parent.parentConversationId) return parent.conversationId;
|
|
15217
|
-
cursor = parent.parentConversationId;
|
|
15218
|
-
}
|
|
15219
|
-
return conversationId;
|
|
15220
|
-
}
|
|
15221
|
-
function assertCanSearchConversationEvents(args) {
|
|
15222
|
-
const { accessScope, targetConversationId, targetRootConversationId, targetVisibility, targetDestination } = args;
|
|
15223
|
-
if (targetConversationId === accessScope.currentConversationId || targetRootConversationId !== void 0 && targetRootConversationId === accessScope.currentRootConversationId) return;
|
|
15224
|
-
if (!canExposeConversationPayload(targetVisibility ? { visibility: targetVisibility } : {})) throw new ToolInputError(`Conversation events are not accessible: ${targetConversationId}`);
|
|
15225
|
-
if (accessScope.provider === "slack" && targetDestination?.platform === "slack" && accessScope.providerTenantId && targetDestination.teamId === accessScope.providerTenantId) return;
|
|
15226
|
-
throw new ToolInputError(`Conversation events are not accessible: ${targetConversationId}`);
|
|
15227
|
-
}
|
|
15228
15361
|
function projectEventsForTool(page, options) {
|
|
15229
15362
|
const projected = page.events.map(projectEvent);
|
|
15230
15363
|
const events = [];
|
|
@@ -15288,23 +15421,6 @@ function eventIdentity(data) {
|
|
|
15288
15421
|
return typeof value === "string" ? [[key, value.slice(0, MAX_IDENTITY_CHARS)]] : [];
|
|
15289
15422
|
}));
|
|
15290
15423
|
}
|
|
15291
|
-
function stripReplacementHistory(data) {
|
|
15292
|
-
if (data.type === "unknown") return {
|
|
15293
|
-
...data,
|
|
15294
|
-
payload: stripReplacementHistoryField(data.payload)
|
|
15295
|
-
};
|
|
15296
|
-
if (data.type === "compaction" || data.type === "handoff") return stripReplacementHistoryField(data);
|
|
15297
|
-
return data;
|
|
15298
|
-
}
|
|
15299
|
-
function stripReplacementHistoryField(value) {
|
|
15300
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
15301
|
-
const { replacementHistory, ...rest } = value;
|
|
15302
|
-
if (replacementHistory === void 0) return value;
|
|
15303
|
-
return {
|
|
15304
|
-
...rest,
|
|
15305
|
-
replacement_history_count: Array.isArray(replacementHistory) ? replacementHistory.length : 0
|
|
15306
|
-
};
|
|
15307
|
-
}
|
|
15308
15424
|
// src/chat/briefs/search.ts
|
|
15309
15425
|
/** Search the latest Brief of each public root Conversation in one scope. */
|
|
15310
15426
|
async function searchConversationBriefs(db, args) {
|
|
@@ -16418,6 +16534,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
16418
16534
|
...createUserCustomizationTools(context)
|
|
16419
16535
|
};
|
|
16420
16536
|
tools.searchConversationEvents = createSearchConversationEventsTool(context);
|
|
16537
|
+
tools.readConversationEvent = createReadConversationEventTool(context);
|
|
16421
16538
|
if (context.conversationPrivacy === "public") tools.searchConversationBriefs = createSearchConversationBriefsTool(slackContext ? {
|
|
16422
16539
|
kind: "public_provider_tenant",
|
|
16423
16540
|
provider: "slack",
|
|
@@ -20249,6 +20366,38 @@ function appendOpenPlan(continuation, messages) {
|
|
|
20249
20366
|
const plan = latestOpenPlanItems(messages);
|
|
20250
20367
|
return plan.length === 0 ? continuation : `${continuation}\n\n<${OPEN_PLAN_TAG}>\n${JSON.stringify(plan)}\n</${OPEN_PLAN_TAG}>`;
|
|
20251
20368
|
}
|
|
20369
|
+
// src/chat/services/context-compaction-telemetry.ts
|
|
20370
|
+
/**
|
|
20371
|
+
* Context compaction telemetry.
|
|
20372
|
+
*
|
|
20373
|
+
* Each compaction gets one `agent.context_compaction` span. The span and its
|
|
20374
|
+
* children, such as the summary `gen_ai.chat` span, carry
|
|
20375
|
+
* `app.compaction.mode`. The `chat.turn` span sums the time that the Turn
|
|
20376
|
+
* waited on compaction.
|
|
20377
|
+
*
|
|
20378
|
+
* Attribute keys do not contain "token": Sentry data scrubbing removes the
|
|
20379
|
+
* values of keys that match it.
|
|
20380
|
+
*/
|
|
20381
|
+
const turnCompactionWait = new AsyncLocalStorage();
|
|
20382
|
+
/** Run one compaction in its span and add its time to the Turn wait. */
|
|
20383
|
+
async function withCompactionSpan(mode, callback) {
|
|
20384
|
+
const startedAtMs = performance.now();
|
|
20385
|
+
try {
|
|
20386
|
+
return await runWithLogAttributes({ "app.compaction.mode": mode }, () => withSpan("agent.context_compaction", "agent.context_compaction", {}, callback));
|
|
20387
|
+
} finally {
|
|
20388
|
+
const wait = turnCompactionWait.getStore();
|
|
20389
|
+
if (wait) wait.ms += performance.now() - startedAtMs;
|
|
20390
|
+
}
|
|
20391
|
+
}
|
|
20392
|
+
/** Run one `chat.turn` callback and record its compaction wait, if any. */
|
|
20393
|
+
async function measureTurnCompactionWait(setTurnAttributes, callback) {
|
|
20394
|
+
const wait = { ms: 0 };
|
|
20395
|
+
try {
|
|
20396
|
+
return await turnCompactionWait.run(wait, callback);
|
|
20397
|
+
} finally {
|
|
20398
|
+
if (wait.ms > 0) setTurnAttributes({ "app.turn.compaction_wait_ms": Math.round(wait.ms) });
|
|
20399
|
+
}
|
|
20400
|
+
}
|
|
20252
20401
|
// src/chat/services/context-compaction.ts
|
|
20253
20402
|
const RETAINED_USER_MESSAGE_TOKENS = 2e4;
|
|
20254
20403
|
const MAX_SUMMARY_CHARS = 6e3;
|
|
@@ -20508,6 +20657,9 @@ async function maybeCompactWithDeps(args, deps) {
|
|
|
20508
20657
|
compacted: false,
|
|
20509
20658
|
reason: "below_threshold"
|
|
20510
20659
|
};
|
|
20660
|
+
return await withCompactionSpan("blocking", () => compactAboveThreshold(args, deps, source, triggerTokens));
|
|
20661
|
+
}
|
|
20662
|
+
async function compactAboveThreshold(args, deps, source, triggerTokens) {
|
|
20511
20663
|
await args.onCompactionStart?.();
|
|
20512
20664
|
let summary;
|
|
20513
20665
|
try {
|
|
@@ -20518,6 +20670,7 @@ async function maybeCompactWithDeps(args, deps) {
|
|
|
20518
20670
|
}, deps);
|
|
20519
20671
|
} catch (error) {
|
|
20520
20672
|
logWarn("context_compaction.summary.failed", { "exception.message": error instanceof Error ? error.message : String(error) });
|
|
20673
|
+
setSpanAttributes({ "app.compaction.outcome": "summary_failed" });
|
|
20521
20674
|
return {
|
|
20522
20675
|
compacted: false,
|
|
20523
20676
|
reason: "summary_failed"
|
|
@@ -20572,11 +20725,14 @@ async function writeCompactedThreadContext(args, sourceMessages, summary, contex
|
|
|
20572
20725
|
}
|
|
20573
20726
|
});
|
|
20574
20727
|
setSpanAttributes({
|
|
20728
|
+
"app.compaction.outcome": "compacted",
|
|
20575
20729
|
"app.compaction.input_messages": sourceMessages.length,
|
|
20576
20730
|
"app.compaction.retained_messages": replacement.length - 1,
|
|
20577
20731
|
"app.compaction.summary_chars": summary.length,
|
|
20578
|
-
|
|
20579
|
-
"app.
|
|
20732
|
+
"app.compaction.input.estimate": context.estimatedTokens,
|
|
20733
|
+
"app.compaction.replacement.estimate": replacementInputTokens,
|
|
20734
|
+
"app.compaction.input_limit": context.inputLimitTokens,
|
|
20735
|
+
...context.triggerTokens !== void 0 ? { "app.compaction.threshold": context.triggerTokens } : void 0
|
|
20580
20736
|
});
|
|
20581
20737
|
return {
|
|
20582
20738
|
compacted: true,
|
|
@@ -20589,6 +20745,9 @@ function createContextCompactor(deps) {
|
|
|
20589
20745
|
}
|
|
20590
20746
|
/** Compact the active conversation and durably bind its selected handoff profile. */
|
|
20591
20747
|
async function compactContextForHandoff(args, deps) {
|
|
20748
|
+
return await withCompactionSpan("handoff", () => compactForHandoff(args, deps));
|
|
20749
|
+
}
|
|
20750
|
+
async function compactForHandoff(args, deps) {
|
|
20592
20751
|
const retainedInstruction = await loadLastInstruction(args.conversationId);
|
|
20593
20752
|
const contextMessage = runtimeContextMessage(args.runtimeContext, retainedInstruction?.message.timestamp);
|
|
20594
20753
|
if (!contextMessage) throw new Error("Handoff requires the current runtime turn context");
|
|
@@ -20640,6 +20799,10 @@ async function compactActiveContextIfNeeded(args, deps) {
|
|
|
20640
20799
|
compacted: false,
|
|
20641
20800
|
reason: "below_threshold"
|
|
20642
20801
|
};
|
|
20802
|
+
return await withCompactionSpan("active", () => compactActiveAboveThreshold(args, deps, source, triggerTokens));
|
|
20803
|
+
}
|
|
20804
|
+
async function compactActiveAboveThreshold(args, deps, source, triggerTokens) {
|
|
20805
|
+
const pendingMessages = args.pendingMessages ?? [];
|
|
20643
20806
|
await args.onCompactionStart?.();
|
|
20644
20807
|
const inputLimitTokens = getAgentContextInputLimitTokens(args.modelId);
|
|
20645
20808
|
let summary;
|
|
@@ -20655,6 +20818,7 @@ async function compactActiveContextIfNeeded(args, deps) {
|
|
|
20655
20818
|
"app.context_tokens_estimated": source.estimatedTokens,
|
|
20656
20819
|
"exception.message": error instanceof Error ? error.message : String(error)
|
|
20657
20820
|
});
|
|
20821
|
+
setSpanAttributes({ "app.compaction.outcome": "summary_failed" });
|
|
20658
20822
|
return {
|
|
20659
20823
|
compacted: false,
|
|
20660
20824
|
reason: "summary_failed"
|
|
@@ -20709,13 +20873,14 @@ async function compactActiveContextIfNeeded(args, deps) {
|
|
|
20709
20873
|
}
|
|
20710
20874
|
});
|
|
20711
20875
|
setSpanAttributes({
|
|
20876
|
+
"app.compaction.outcome": "compacted",
|
|
20712
20877
|
"app.compaction.input_messages": source.messages.length,
|
|
20713
|
-
"app.compaction.replacement_tokens": replacementInputTokens,
|
|
20714
20878
|
"app.compaction.retained_messages": instructionMessages.length,
|
|
20715
20879
|
"app.compaction.summary_chars": summary.length,
|
|
20716
|
-
"app.compaction.
|
|
20717
|
-
"app.
|
|
20718
|
-
"app.
|
|
20880
|
+
"app.compaction.input.estimate": source.estimatedTokens,
|
|
20881
|
+
"app.compaction.replacement.estimate": replacementInputTokens,
|
|
20882
|
+
"app.compaction.input_limit": inputLimitTokens,
|
|
20883
|
+
"app.compaction.threshold": triggerTokens
|
|
20719
20884
|
});
|
|
20720
20885
|
return {
|
|
20721
20886
|
compacted: true,
|
|
@@ -21932,4 +22097,4 @@ function createAgentRunner(execute, options) {
|
|
|
21932
22097
|
return await execute(nextRun, streamFn);
|
|
21933
22098
|
} };
|
|
21934
22099
|
}
|
|
21935
|
-
export {
|
|
22100
|
+
export { readViewerAutomations as $, runWithSlackInstallation as A, readUserCustomization as At, logScheduledAutomationRunSkipped as B, readSlackReviewItemCardConversationId as C, listUnreportedSiblingAgents as Ct, parseSlackReviewItemClick as D, ingestEvent as Dt, buildSlackReviewItemModal as E, processWorkspaceSnapshotJob as Et, resolveSlackChannelIdFromThreadId as F, readBlockedReport as Ft, readViewerAutomationEdit as G, activateViewerAutomationVersion as H, getConversationInfo as I, shouldEmitDevAgentTrace as It, readConversationSourceTask as J, updateViewerAutomation as K, joinPublicChannel as L, parseSlackThreadId as M, RetryableDeliveryError as Mt, readSlackRawMessageContext as N, actorFromRun as Nt, parseSlackReviewItemFormTarget as O, buildSteeringPiMessage as Ot, resolveSlackChannelIdFromMessage as P, toolInvocationDestination as Pt, readViewerAutomationVersions as Q, listThreadReplies as R, createSlackReviewItemShow as S, listChildAgents as St, SLACK_REVIEW_ITEM_VIEW_ID as T, conversationSubtreeColumns as Tt, changeViewerAutomationLifecycle as U, scheduledAutomationRunAttributes as V, deleteViewerTask as W, readViewerAutomationRuns as X, readViewerAutomationExecutions as Y, readViewerAutomationSummary as Z, readPublicArtifact as _, storeAttachment as _t, buildAuthPauseResponse as a, acceptsWebMessages as at, renderAttachmentText as b, recordSubagentEnded as bt, deleteMcpAuthSessionsForUserProvider as c, createAndEnqueueConversation as ct, getMcpAuthSession as d, webActorFromEmail as dt, AutomationEditError as et, getMcpStoredOAuthCredentials as f, resolveConversationDestination as ft, publicArtifactHeaders as g, requestAttachmentDeletion as gt, readStats as h, readLiveAttachment as ht, measureTurnCompactionWait as i, renderReviewItemMessage as it, verifySlackSignature as j, saveUserCustomization as jt, parseSlackUserInputSubmission as k, withoutSavedSteeringMessages as kt, deleteMcpServerSessionId as l, createConversationId as lt, latestProgressStatus as m, collectAttachmentGarbage as mt, executeAgentRun as n, listOwnedWatches as nt, finalizeMcpAuthorization as o, appendAndEnqueueWebMessage as ot, putMcpStoredOAuthCredentials as p, decodeInputImages as pt, ViewerTaskNotFoundError as q, createContextCompactor as r, deliverReviewItemChange as rt, deleteMcpAuthSession as s, conversationTurnIdForMessage as st, createAgentRunner as t, effectiveTaskOutcomes as tt, deleteMcpStoredOAuthCredentials as u, recordWebConversationActivity as ut, unpublishedArtifactHeaders as v, stopChildAgentsOf as vt, syncReviewItemSlackCards as w, conversationSubtree as wt, renderBlockText as x, recordSubagentStarted as xt, lookupSlackUserProfile as y, stopConversationSession as yt, resolveDestinationVisibility as z };
|