@sentry/junior 0.305.0 → 0.306.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-context-BpvbUki8.js → adapter-context-CnY-i32r.js} +2 -2
- package/dist/{admin-CoDt35ny.js → admin-BLLdLnXh.js} +2 -2
- package/dist/{agent-runner-C5d6rY5g.js → agent-runner-BaLjEjPR.js} +261 -190
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -8
- package/dist/api.d.ts +19 -4
- package/dist/api.js +137 -40
- package/dist/{app-Cs157Zc5.d.ts → app-DvYbM9UD.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +487 -434
- package/dist/{background-compaction-queue-BTqMIfTA.js → background-compaction-queue-D2wzxtGU.js} +2 -2
- package/dist/{briefs-BRdznF7c.js → briefs-DvyzXfrF.js} +3 -3
- package/dist/{catalog-runtime-J52Tej47.js → catalog-runtime-B1R-nHd3.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-CBZp0udd.js → config-DUD-zMvp.js} +111 -13
- package/dist/{connections-BYmuJ6Vm.js → connections-CDhsqPcC.js} +6 -6
- package/dist/{continue-in-slack-Cvot6S38.js → continue-in-slack-BXQizz9o.js} +5 -5
- package/dist/{conversation-BOqdRtUx.js → conversation--f85g4zL.js} +132 -132
- package/dist/{conversation-feed-CgpgP7yi.js → conversation-feed-BNs9KiqC.js} +1 -1
- package/dist/{conversation-privacy-D2pOzBNl.js → conversation-privacy-YE54gMN8.js} +1 -1
- package/dist/{conversation-turn-CI8WDpnK.js → conversation-turn-BzdmrHb0.js} +22 -40
- package/dist/{credential-sync-COqnZ1Dx.js → credential-sync-Cdm-e1vJ.js} +14 -13
- package/dist/{db-DU84dCVu.js → db-DV2ZUb1Y.js} +90 -11
- package/dist/{db-zbN5ZV_o.d.ts → db-pH357Dkt.d.ts} +1 -1
- package/dist/{executor-CFyrgOu1.js → executor-CjNhwwnj.js} +47 -4
- package/dist/{history-m2-ceTTX.js → history-N7IVbUom.js} +5 -1
- package/dist/{install-CQ76CfRw.js → install-DbD7C5td.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-DLd2UxVP.js → lineage-BFdIPb3o.js} +2 -2
- package/dist/{logging-BPNTQVFu.js → logging-oYpJYr-S.js} +1 -1
- package/dist/{message-BWJLeQ5e.js → message-BBPcMKJY.js} +8 -8
- package/dist/{model-input-DoM9Ht-d.js → model-input-DYYF3a8B.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -4
- package/dist/{oauth-callback-server-DeHbnAQl.js → oauth-callback-server-C7Q987su.js} +2 -2
- package/dist/{projection-CcFBVFUo.js → projection-CWXDE0f6.js} +7738 -6166
- package/dist/{prompt-C5LREK2p.js → prompt-P3eRqO8C.js} +15 -7
- package/dist/{queue-B2AAL3ym.js → queue-7FSijgqG.js} +4 -4
- package/dist/{registry-BjZZqKqi.js → registry-1pzXmplY.js} +1 -1
- package/dist/{resolve-CeJgXuH1.js → resolve-n87oXY-d.js} +3 -3
- package/dist/{result-icDrueyB.js → result-BmF9v9bv.js} +9 -9
- package/dist/{runner-nVfMkMMB.js → runner-4j7ZsxP5.js} +13 -15
- package/dist/{sandbox-egress-signals-H9vQ5qRf.js → sandbox-egress-signals-BRQI8HvT.js} +1 -1
- package/dist/{automation-CuA3yEcD.js → schedule-CHPWQn-x.js} +347 -5
- package/dist/{schema-CKcu-IK6.d.ts → schema-CVbIjrF3.d.ts} +71 -1
- package/dist/{schema-Bx0Mlo32.js → schema-D7iIEh6t.js} +52 -6
- package/dist/{service-account-Dw06p3zm.js → service-account-BDQ9xzta.js} +3 -3
- package/dist/{service-account-DU5865XA.js → service-account-DzQiOmqa.js} +5 -5
- package/dist/{session-stop-uotLtp4g.js → session-stop-BQxgHR4X.js} +854 -160
- package/dist/{skills-Bex1EaO5.js → skills-CPf4vNuC.js} +2 -2
- package/dist/{slack-conversation-unfurl-EPG3riWF.js → slack-conversation-unfurl-B1KEptUg.js} +10 -9
- package/dist/{spawn-CoD3vDuS.js → spawn-CjGddiAU.js} +6 -6
- package/dist/{state-nCR4Muhn.js → state-9wfj6aSD.js} +4 -4
- package/dist/{stop-BFVd0P0m.js → stop-CsQGuN5n.js} +62 -117
- package/dist/{store-Ca6G962n.js → store-Dz3YZ7gQ.js} +5 -5
- package/dist/{task-queue-BLPZU6kC.js → task-queue-CFlrJguF.js} +3 -3
- package/dist/{task-runner-xsOPIxCZ.js → task-runner-frzlUvFD.js} +8 -9
- package/dist/{thread-context-BOvZhsKK.js → thread-context-C4QuZlM8.js} +8 -91
- package/dist/turn-session-routing-BXaubz2w.js +244 -0
- package/dist/{turn-user-message-BrhuyYrH.js → turn-user-message-DNC0eRZ7.js} +3 -3
- package/dist/users-XCCKn3xW.js +181 -0
- package/dist/{validation-BnY9K5WB.js → validation-L5fdjmFX.js} +1 -1
- package/dist/{version-qROlRQGF.js → version-BFmuwgxP.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CxUiOraX.js → viewer-DKOeHpv3.js} +3 -3
- package/dist/{warmup--Gkz7iB-.js → warmup-mTMIatCV.js} +267 -272
- package/dist/{web-message-id-lNodcCOI.js → web-message-id-CUaSiGme.js} +16 -1
- package/dist/{worker-DJ8d9fmD.js → worker-Bz4KNxjI.js} +7 -7
- package/migrations/0114_plan_items.sql +22 -0
- package/migrations/meta/0114_snapshot.json +5203 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/schedule-cP0AACm1.js +0 -344
- package/dist/turn-session-routing-2bW2qfeb.js +0 -1792
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
2
|
import { s as skillRoots } from "./package-discovery-x4AvVhMj.js";
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
+
import { h as logWarn } from "./logging-oYpJYr-S.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B1R-nHd3.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
package/dist/{slack-conversation-unfurl-EPG3riWF.js → slack-conversation-unfurl-B1KEptUg.js}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Ct as deferConversationMove, Fa as readConversationAccessFromSql, Ss as formatSlackLink, Wa as readLatestConversationBrief, Zo as postSlackEphemeralMessage, es as unfurlSlackLinks, qs as parseDashboardConversationLink, vs as getWorkspaceTeamId, xs as escapeSlackMrkdwnText } from "./projection-CWXDE0f6.js";
|
|
3
3
|
import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-D2iXzvlN.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { E as withSpan } from "./logging-
|
|
7
|
-
import { i as readActorIdentity } from "./viewer-
|
|
8
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
9
|
-
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
4
|
+
import { X as createCache, a as getConversationStore, o as getDb, s as getSqlExecutor, st as getConversationIdByProviderConversation } from "./db-DV2ZUb1Y.js";
|
|
5
|
+
import { i as lookupSlackUserProfile, n as lookupSlackBot } from "./users-XCCKn3xW.js";
|
|
6
|
+
import { E as withSpan } from "./logging-oYpJYr-S.js";
|
|
7
|
+
import { i as readActorIdentity } from "./viewer-DKOeHpv3.js";
|
|
8
|
+
import { t as runWithSlackInstallation } from "./adapter-context-CnY-i32r.js";
|
|
9
|
+
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-BXQizz9o.js";
|
|
10
|
+
import { dr as checkSlackChannelReadAccess } from "./warmup-mTMIatCV.js";
|
|
11
|
+
import "./store-Dz3YZ7gQ.js";
|
|
12
|
+
import { n as botConfig } from "./config-DUD-zMvp.js";
|
|
12
13
|
import * as z from "zod";
|
|
13
14
|
// src/chat/ingress/workspace-membership.ts
|
|
14
15
|
const MEMBER_TTL_MS = 3e5;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { t as readConversationLineage } from "./lineage-
|
|
5
|
-
import { _ as getConversationWorkState } from "./store-
|
|
6
|
-
import {
|
|
7
|
-
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-
|
|
2
|
+
import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-BaLjEjPR.js";
|
|
3
|
+
import { n as botConfig } from "./config-DUD-zMvp.js";
|
|
4
|
+
import { t as readConversationLineage } from "./lineage-BFdIPb3o.js";
|
|
5
|
+
import { _ as getConversationWorkState } from "./store-Dz3YZ7gQ.js";
|
|
6
|
+
import { Vt as getAgentInvocation, bn as AgentDepthLimitError, sn as createAndEnqueueAgentInvocation, wn as getAgentBinding } from "./warmup-mTMIatCV.js";
|
|
7
|
+
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-DNC0eRZ7.js";
|
|
8
8
|
// src/chat/agent-invocations/spawn.ts
|
|
9
9
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
3
|
-
import { o as getDb } from "./db-
|
|
4
|
-
import {
|
|
1
|
+
import { i as getChatConfig } from "./config-DUD-zMvp.js";
|
|
2
|
+
import { h as logWarn } from "./logging-oYpJYr-S.js";
|
|
3
|
+
import { o as getDb } from "./db-DV2ZUb1Y.js";
|
|
4
|
+
import { L as juniorUsers } from "./executor-CjNhwwnj.js";
|
|
5
5
|
import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
|
|
6
6
|
import { eq } from "drizzle-orm";
|
|
7
7
|
// src/chat/conversations/legacy-web-actor-id.ts
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { F as textCharsForTokens, P as estimateTextTokens, V as escapeXml,
|
|
3
|
-
import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, K as isRecord, S as setTags, T as withLogContext, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, q as toOptionalNumber, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
1
|
+
import { $ as pauseLostWorkerTurn, $a as notInheritedByForkChild, $n as getPlugins, $o as removeReactionFromMessage, $t as buildTurnErrorResponse, A as normalizeConversationText, Ao as confirmDispatchMailboxAppend, B as PluginCredentialFailureError, Ba as conversationViewerMarks, Bc as readAutomationTitlesByConversationId, Bn as createUserTokenStore, Bo as markDispatchAwaitingResume, Bs as getDashboardLinkFilter, Bt as releaseInboundMessage, Cr as getReviewItem, D as isHumanConversationMessage, Ds as wrapBareSlackUserIds, E as getConversationMessageSlackTs, Eo as lookupSlackUserNames, Er as listWaitingConversations, Es as slackMentionedUserIds, Fa as readConversationAccessFromSql, Fo as getDispatchRecord, Fr as canUserReadReviewItem, Ga as readConversationEventPage, Hc as fallbackShortTitle, Ho as markDispatchCompleted, Hs as getDashboardPersonLink, Ia as conversationHasParticipantUser, Io as getDispatchTurnId, Ir as isOnlyAssignee, J as clearPendingAuth, Js as parseDashboardPersonLink, Ka as readConversationEventPageAfter, Ki as resolveBaseUrl, Ko as addReactionToMessage, Ks as isDashboardLink, La as conversationIsMemberRoot, M as trimConversationMessages, Mo as getDispatchConversationId, Mr as canActOnReviewItem, N as turnHasReply, Na as canAddConversationMessages, No as getDispatchIdForConversation, O as latestConversationMessageSeq, Os as truncateStatusText, P as upsertConversationMessage, Pa as createConversationAccessReader, Pn as trimTrailingAssistantMessages, Po as getDispatchInputMessageId, Q as lostWorkerBeforeFirstSave, Qc as configValueSchema, Ra as conversationIsNotUnsubscribedRoot, Ro as isTerminalDispatchStatus, S as resolveConversationTitle, T as estimateConversationMessagesTokens, To as lookupSlackUser, Tr as listReplyActionItems, Uo as markDispatchFailed, Va as viewerMarksFromParticipant, Vo as markDispatchBlocked, Vr as reviewItemNeedsSomeone, W as AuthorizationFlowDisabledError, Wa as readLatestConversationBrief, Wn as applyPluginFormatMarkdown, Wo as markDispatchRunning, Xa as buildSentryConversationUrl, Xc as createPluginCache, Z as loadTurnCheckpoint, a as loadProjection, ao as slackAttachmentsVersionQuery, as as SlackActionError, at as getTurnRecord, b as persistConversationMessages, bo as listConversationAnnotations, bs as SLACK_USER_MENTION_RE, cn as getAssistantReplyText, cs as getHeaderString, d as recordAuthorizationCompleted, do as storeAttachment, ds as isDmChannel, el as piMessageFromHistoryItem, eo as getSlackFileId, et as saveTurnCheckpoint, fs as isSlackRequestTimeout, gs as withSlackRetries, h as recordSubscribedReplyRoute, hs as streamPrivateSlackFile, i as loadConversationProjection, io as recordSlackAttachment, j as recordDeliveredAssistantMessage, ja as createPluginLogger, k as markConversationMessage, ko as claimDispatchMailboxAppend, kr as takeReviewItem, ls as getSlackClient, n as commitMessages, ni as cancelSubscriptions, no as readAttachmentVisionSummary, nt as completeTurnRecord, o as loadTurnProjection, os as downloadPrivateSlackFile, ot as listTurnSummaries, ps as normalizeSlackConversationId, qa as readConversationEventPageAround, qs as parseDashboardConversationLink, rt as failTurnRecord, so as isFileAttachment, st as recordTurnSummary, t as commitAcceptedReply, tt as abandonTurnRecord, v as hydrateConversationMessages, vn as persistWithRetry, vr as closeReviewItem, w as buildConversationContext, ws as normalizeSlackStatusText, xo as listConversationAnnotationsById, y as persistConversationMessageWindow, z as createPluginEgress, za as conversationPinnedForUser, zs as getDashboardConversationLink } from "./projection-CWXDE0f6.js";
|
|
2
|
+
import { F as textCharsForTokens, P as estimateTextTokens, V as escapeXml, c as getSlackClientSecret, i as getChatConfig, k as resolveGatewayModel, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, ot as isProviderRetryError, s as getSlackClientId, y as normalizeSlackEmojiName } from "./config-DUD-zMvp.js";
|
|
3
|
+
import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, K as isRecord, S as setTags, T as withLogContext, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, q as toOptionalNumber, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-oYpJYr-S.js";
|
|
4
4
|
import { h as startSpan } from "./sentry-CPbZjomA.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-BFmuwgxP.js";
|
|
6
6
|
import { f as parseSlackTeamId, i as isActorUserId, n as createSlackActor, o as isUserActor, r as createSlackResumeActor, s as parseActorUserId, t as createActor, u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
7
|
-
import { A as conversationKindFromRow, D as postsRunNotices, E as isTopLevelKind, I as resolveActorIdentityId,
|
|
8
|
-
import {
|
|
9
|
-
import { d as contextProvenance, p as instructionProvenanceFor, t as KNOWN_CONVERSATION_EVENT_TYPES } from "./history-
|
|
10
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
12
|
-
import { A as RetryableDeliveryError,
|
|
13
|
-
import { d as PluginMcpClient, u as McpAuthorizationRequiredError, v as getMcpStoredOAuthCredentials } from "./service-account-
|
|
14
|
-
import { i as webActorUserIds } from "./state-
|
|
15
|
-
import { a as EVENT_SYSTEM_ACTOR,
|
|
16
|
-
import { f as
|
|
17
|
-
import {
|
|
7
|
+
import { $ as getStateAdapter, A as conversationKindFromRow, D as postsRunNotices, E as isTopLevelKind, I as resolveActorIdentityId, L as saveActorAvatar, X as createCache, Y as readCachedUserByEmail, _ as readConversationTrees, _t as nextDetailVersion, a as getConversationStore, b as lastMessageAtSql, ct as parseSessionSource, et as getStateValues, f as copyMessageLinks, ft as agentTurnUsageSchema, h as conversationAncestors, j as locationFromRow, k as turnBehavior, lt as addAgentTurnUsage, m as withConversationEventLock, mt as resolveRootConversationId, o as getDb, pt as hasAgentTurnUsage, r as getConversationEventStore, rt as acquireActiveLock, s as getSqlExecutor, tt as setStateValues, v as setArchivedAt, w as deliversFinalText, xt as requireSlackDestination, y as loadConversationSlackTenantIds, yt as createSlackDestination } from "./db-DV2ZUb1Y.js";
|
|
8
|
+
import { A as juniorCodeChanges, C as juniorConversationBriefs, D as juniorConversationEvents, F as juniorConversations, I as juniorIdentities, L as juniorUsers, N as juniorAttachments, P as juniorMessageAttachments, R as juniorDestinations, b as juniorConversationParticipants, d as juniorReviewItems, k as juniorConversationAnnotations, l as juniorReviewItemConversations, v as juniorAgentInvocations } from "./executor-CjNhwwnj.js";
|
|
9
|
+
import { d as contextProvenance, p as instructionProvenanceFor, t as KNOWN_CONVERSATION_EVENT_TYPES } from "./history-N7IVbUom.js";
|
|
10
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-1pzXmplY.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B1R-nHd3.js";
|
|
12
|
+
import { A as RetryableDeliveryError, F as requireTurnFailureEventId, I as shouldEmitDevAgentTrace, N as finalizeFailedTurnReplyWithEvent, P as getAgentTurnDiagnosticsAttributes, T as safeLinkUrl, _ as createSlackReviewItemShow, a as buildAuthPauseResponse, c as createClientMetadata, l as readMcpClientInformation, m as resolveDestinationVisibility, n as executeAgentRun, s as getMcpOAuthCallbackPath, t as createAgentRunner, u as latestProgressStatus } from "./agent-runner-BaLjEjPR.js";
|
|
13
|
+
import { d as PluginMcpClient, u as McpAuthorizationRequiredError, v as getMcpStoredOAuthCredentials } from "./service-account-DzQiOmqa.js";
|
|
14
|
+
import { i as webActorUserIds } from "./state-9wfj6aSD.js";
|
|
15
|
+
import { a as EVENT_SYSTEM_ACTOR, d as completeText, l as completeDecision, s as isEventConversationMessage } from "./prompt-P3eRqO8C.js";
|
|
16
|
+
import { Z as MAX_ATTACHMENT_BYTES, f as conversationEventPageSchema, tt as readMessageAttachments, u as conversationDetailReportSchema } from "./conversation--f85g4zL.js";
|
|
17
|
+
import { f as identityAvatarUrl, g as userAvatarUrlsFromIdentities, h as readUserAvatarUrls } from "./viewer-DKOeHpv3.js";
|
|
18
18
|
import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { h as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
27
|
-
import { D as personObjectCard, E as messageObjectCard, O as webPageObjectCard, T as conversationObjectCard, m as healthReportSchema, r as conversationFeedSchema, t as conversationFeedBriefSchema, u as conversationPendingMessagesReportSchema } from "./conversation-feed-
|
|
28
|
-
import { c as withTurnSpan, n as createConversationTurnWorker, o as getTurnInputSpanAttributes, r as canPauseConversationDelivery, s as turnInputTelemetry } from "./conversation-turn-
|
|
29
|
-
import { n as buildStoredAttachmentPromptText } from "./model-input-
|
|
30
|
-
import { i as enqueueAgentInvocationResult, n as createDeliverToParent, s as withAgentInvocationResultActors, t as createChildConversationWorker } from "./result-
|
|
31
|
-
import { t as bindMessageAgent } from "./message-
|
|
32
|
-
import { t as readConversationLineage } from "./lineage-
|
|
33
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
34
|
-
import { a as
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
19
|
+
import { P as legacyWebMailboxMetadataSchema, Q as maybePostAutomatedTurnLimitNotice, c as loadReviewItemInput, et as resolveSlackReplyTarget, f as buildSteeringPiMessage, ft as isExperimentalFeatureEnabled, g as withoutSavedSteeringMessages, j as resolveMailboxTurnWork, l as savedInputInstruction, lt as conversationSubtree, o as skipInputAfterConversationStop, p as instructionActorFor, r as markConversationsStopped, st as recordFinishedTurnForAutomatedLimit, tt as sendSlackReply, ut as conversationSubtreeColumns } from "./session-stop-BQxgHR4X.js";
|
|
20
|
+
import { Ai as NO_REPLY_GAP_MS, At as verifyAttachmentUploads, Bn as AgentRunError, Ct as createConversationId, Dn as supersedeTurnForInput, Dt as AttachmentUploadError, Ht as getChildAgentLabel, Jn as renderAttachmentText, Kn as throwApiError, Mn as getTurnAuthorization, Nn as canJoinTurn, Oi as MINUTE_MS, On as createPausedTurns, Pn as canShareTurn, St as createAndEnqueueConversation, Tt as webActorFromUser, Vn as executeTurn, Xn as parseSlackMessageReference, Yn as renderBlockText, ar as parseSlackThreadId, bt as appendAndEnqueueWebMessage, c as isConversationWorkDone, ci as readConversationSourceTask, ct as readLastUserMessageAtByConversation, d as addHistoryPeriod, f as firstLiveSavingsDate, fn as dropOwnUnreadLoopReplies, gr as isPublicSlackChannel, gt as deliverReviewItemChange, hn as cancelSignInWait, hr as isConversationMember, i as GLOBAL_GAPS_TTL_MS, ji as gapSegment, kn as getPausedTurnRequest, l as listConversationWork, m as replaceHistorySavings, mn as stopChildAgentsOf, mr as getConversationInfo, n as CONVERSATION_STATE_TTL_MS, o as segmentGapsKey, or as readSlackRawMessageContext, p as idlePeriodSavings, pn as stopChildAgentsBelow, pr as getChannelMessage, r as GLOBAL_GAPS_MAX, sr as resolveSlackChannelIdFromMessage, t as ANSWER_TOOL_ENDINGS, ut as conversationReadPositionQuery, v as connectedState, vr as listThreadReplies, wt as recordWebConversationActivity, y as providerCacheTtlMs, yt as acceptsWebMessages, zn as getWebAuthorization } from "./warmup-mTMIatCV.js";
|
|
21
|
+
import { h as isVisionImageMediaType, l as isEmptyUserInputAnswer, m as detectImageMediaType, t as webMessageId, u as normalizeUserInputAnswer } from "./web-message-id-CUaSiGme.js";
|
|
22
|
+
import { L as buildDeterministicAssistantMessageId, R as buildDeterministicTurnId, a as ConversationTurnBoundaryError, c as TurnInputDeferredError, d as isTurnInputCommitLostError, f as isTurnInputDeferredError, g as startActiveTurn, h as markTurnFailed, i as getTurnUserSlackMessageTs, l as getConversationTurnBoundaryError, m as markTurnCompleted, o as CooperativeTurnYieldError, p as markTurnClosed, r as getTurnUserReplyAttachmentContext, s as TurnInputCommitLostError, t as getTurnUserMessage, u as isCooperativeTurnYieldError, v as getTurnLifecycle } from "./turn-user-message-DNC0eRZ7.js";
|
|
23
|
+
import { o as getVercelConversationWorkQueue, p as getTurnRequestDeadline } from "./background-compaction-queue-D2wzxtGU.js";
|
|
24
|
+
import { D as stopConversationWork, E as steerWebPendingMessages, _ as getConversationWorkState, a as cancelHumanFacingPendingMessages, g as getConversation, h as ensureConversationWake, r as appendAndEnqueueInboundMessage, s as claimInboundMessage } from "./store-Dz3YZ7gQ.js";
|
|
25
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, n as resolveTurnSessionRouting, o as persistThreadRuntimeState, r as getLocationConfigurationService, s as persistThreadStateById, t as resolveConversationRouting } from "./turn-session-routing-BXaubz2w.js";
|
|
26
|
+
import { t as runWithSlackInstallation } from "./adapter-context-CnY-i32r.js";
|
|
27
|
+
import { D as personObjectCard, E as messageObjectCard, O as webPageObjectCard, T as conversationObjectCard, m as healthReportSchema, r as conversationFeedSchema, t as conversationFeedBriefSchema, u as conversationPendingMessagesReportSchema } from "./conversation-feed-BNs9KiqC.js";
|
|
28
|
+
import { c as withTurnSpan, n as createConversationTurnWorker, o as getTurnInputSpanAttributes, r as canPauseConversationDelivery, s as turnInputTelemetry } from "./conversation-turn-BzdmrHb0.js";
|
|
29
|
+
import { n as buildStoredAttachmentPromptText } from "./model-input-DYYF3a8B.js";
|
|
30
|
+
import { i as enqueueAgentInvocationResult, n as createDeliverToParent, s as withAgentInvocationResultActors, t as createChildConversationWorker } from "./result-BmF9v9bv.js";
|
|
31
|
+
import { t as bindMessageAgent } from "./message-BBPcMKJY.js";
|
|
32
|
+
import { t as readConversationLineage } from "./lineage-BFdIPb3o.js";
|
|
33
|
+
import { t as bindSpawnAgent } from "./spawn-CjGddiAU.js";
|
|
34
|
+
import { a as buildDeliveredTurnStatePatch, i as persistAuthPauseTurnState, n as loadThreadContextTrimFloor, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-C4QuZlM8.js";
|
|
35
|
+
import { s as sendVercelPluginTask } from "./task-queue-CFlrJguF.js";
|
|
36
|
+
import { n as scheduleSessionCompletedPluginTasks } from "./task-runner-frzlUvFD.js";
|
|
37
|
+
import { r as canContinueInSlack } from "./continue-in-slack-BXQizz9o.js";
|
|
37
38
|
import * as z from "zod";
|
|
38
39
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
39
40
|
import { and, asc, count, desc, eq, gt, gte, inArray, isNotNull, isNull, lte, ne, not, or, sql } from "drizzle-orm";
|
|
@@ -3059,7 +3060,6 @@ function createSlackAdapterStatusSender(args) {
|
|
|
3059
3060
|
* `loading_messages` while `status` stays fixed and generic.
|
|
3060
3061
|
*/
|
|
3061
3062
|
function createSlackWebApiStatusSender(args) {
|
|
3062
|
-
const getClient = args.getSlackClient ?? getSlackClient;
|
|
3063
3063
|
return async (text, loadingMessages) => {
|
|
3064
3064
|
const channelId = args.channelId;
|
|
3065
3065
|
const threadTs = args.threadTs;
|
|
@@ -3068,7 +3068,7 @@ function createSlackWebApiStatusSender(args) {
|
|
|
3068
3068
|
if (!normalizedChannelId) return;
|
|
3069
3069
|
const nextLoadingMessages = text ? loadingMessages ?? [text] : void 0;
|
|
3070
3070
|
try {
|
|
3071
|
-
await withSetStatusSpan(() =>
|
|
3071
|
+
await withSetStatusSpan(() => getSlackClient().assistant.threads.setStatus({
|
|
3072
3072
|
channel_id: normalizedChannelId,
|
|
3073
3073
|
thread_ts: threadTs,
|
|
3074
3074
|
status: text ? SLACK_ASSISTANT_ACTIVE_STATUS : "",
|
|
@@ -3143,8 +3143,7 @@ function createSlackWebApiAssistantStatusSession(args) {
|
|
|
3143
3143
|
return createAssistantStatusScheduler({
|
|
3144
3144
|
sendStatus: createSlackWebApiStatusSender({
|
|
3145
3145
|
channelId: args.channelId,
|
|
3146
|
-
threadTs: args.threadTs
|
|
3147
|
-
getSlackClient: args.getSlackClient
|
|
3146
|
+
threadTs: args.threadTs
|
|
3148
3147
|
}),
|
|
3149
3148
|
loadingMessages: args.loadingMessages ?? botConfig.loadingMessages,
|
|
3150
3149
|
now: args.now,
|
|
@@ -4017,10 +4016,7 @@ function createSlackTurn(deps) {
|
|
|
4017
4016
|
let failureEventId;
|
|
4018
4017
|
let failureReason;
|
|
4019
4018
|
if (finalResult.diagnostics.outcome !== "success") {
|
|
4020
|
-
const finalized = finalizeFailedTurnReplyWithEvent({
|
|
4021
|
-
reply: finalResult,
|
|
4022
|
-
logException
|
|
4023
|
-
});
|
|
4019
|
+
const finalized = finalizeFailedTurnReplyWithEvent({ reply: finalResult });
|
|
4024
4020
|
finalResult = finalized.reply;
|
|
4025
4021
|
failureEventId = finalized.eventId;
|
|
4026
4022
|
failureReason = finalized.failureReason;
|
|
@@ -4177,7 +4173,7 @@ function createSlackTurn(deps) {
|
|
|
4177
4173
|
await scheduleSessionCompletedPluginTasks({
|
|
4178
4174
|
conversationId,
|
|
4179
4175
|
sessionId: turnId
|
|
4180
|
-
}, deps.sendPluginTask
|
|
4176
|
+
}, deps.sendPluginTask);
|
|
4181
4177
|
} catch (error) {
|
|
4182
4178
|
logException(error, "plugin.session.completed_task_schedule.failed");
|
|
4183
4179
|
}
|
|
@@ -5015,8 +5011,8 @@ function nonEmptyString(value) {
|
|
|
5015
5011
|
* Restore Slack private-file fetchers on message attachments that crossed a
|
|
5016
5012
|
* serialization boundary.
|
|
5017
5013
|
*/
|
|
5018
|
-
function rehydrateAttachmentFetchers(message
|
|
5019
|
-
for (const attachment of message.attachments) if (!attachment.fetchData && attachment.url) attachment.fetchData = () => downloadPrivateSlackFile
|
|
5014
|
+
function rehydrateAttachmentFetchers(message) {
|
|
5015
|
+
for (const attachment of message.attachments) if (!attachment.fetchData && attachment.url) attachment.fetchData = () => downloadPrivateSlackFile(attachment.url);
|
|
5020
5016
|
}
|
|
5021
5017
|
// src/chat/task-execution/slack-work.ts
|
|
5022
5018
|
const slackConversationRouteSchema = z.enum(["mention", "subscribed"]);
|
|
@@ -5305,7 +5301,7 @@ async function bindSlackActorIdentities(args) {
|
|
|
5305
5301
|
byAuthorId.set(authorId, [...byAuthorId.get(authorId) ?? [], message]);
|
|
5306
5302
|
}
|
|
5307
5303
|
await Promise.all([...byAuthorId].map(async ([authorId, messages]) => {
|
|
5308
|
-
const profile = await
|
|
5304
|
+
const profile = await lookupSlackUser(args.teamId, authorId);
|
|
5309
5305
|
await Promise.all(messages.map((message) => ensureSlackMessageActorIdentity(message, args.teamId, async () => profile)));
|
|
5310
5306
|
if (profile && messages.some(getMessageAuthorIdentityId)) await resolveActorIdentityId(getSqlExecutor(), createSlackActor(args.teamId, authorId, {
|
|
5311
5307
|
fullName: profile.fullName,
|
|
@@ -5343,7 +5339,6 @@ function getPendingRecords(work) {
|
|
|
5343
5339
|
function createSlackConversationWorker(options) {
|
|
5344
5340
|
return async (context) => {
|
|
5345
5341
|
const adapter = options.getSlackAdapter();
|
|
5346
|
-
const actorLookup = options.lookupSlackUser ?? lookupSlackUser;
|
|
5347
5342
|
const state = getConnectedState(options.state);
|
|
5348
5343
|
await state.connect();
|
|
5349
5344
|
const records = getPendingRecords({ execution: { pendingMessages: [...context.attempt.messages] } });
|
|
@@ -5399,7 +5394,6 @@ function createSlackConversationWorker(options) {
|
|
|
5399
5394
|
record
|
|
5400
5395
|
}));
|
|
5401
5396
|
await bindSlackActorIdentities({
|
|
5402
|
-
lookupSlackUser: actorLookup,
|
|
5403
5397
|
messages,
|
|
5404
5398
|
teamId: destination.teamId
|
|
5405
5399
|
});
|
|
@@ -5875,10 +5869,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
5875
5869
|
});
|
|
5876
5870
|
const outcome = await runArgs.executeTurn(run, async (result) => {
|
|
5877
5871
|
run.signal?.throwIfAborted();
|
|
5878
|
-
const finalized = finalizeFailedTurnReplyWithEvent({
|
|
5879
|
-
reply: result,
|
|
5880
|
-
logException
|
|
5881
|
-
});
|
|
5872
|
+
const finalized = finalizeFailedTurnReplyWithEvent({ reply: result });
|
|
5882
5873
|
const reply = finalized.reply;
|
|
5883
5874
|
setSpanAttributes(getAgentTurnDiagnosticsAttributes(reply));
|
|
5884
5875
|
const dispatchResult = runDispatchOutcome(reply);
|
|
@@ -5969,7 +5960,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
5969
5960
|
conversationId: runArgs.conversationId,
|
|
5970
5961
|
sessionId: runArgs.turnId
|
|
5971
5962
|
};
|
|
5972
|
-
await (runArgs.
|
|
5963
|
+
await scheduleSessionCompletedPluginTasks(params, runArgs.sendPluginTask);
|
|
5973
5964
|
} catch (scheduleError) {
|
|
5974
5965
|
logException(scheduleError, "plugin.session.completed_task_schedule.failed");
|
|
5975
5966
|
}
|
|
@@ -6235,7 +6226,6 @@ async function runPausedTurn(payload, options, runOptions = {}) {
|
|
|
6235
6226
|
}
|
|
6236
6227
|
async function runPausedTurnInContext(payload, options, runOptions) {
|
|
6237
6228
|
const destination = requireSlackDestination(payload.destination, "Paused turn");
|
|
6238
|
-
const wakePausedTurn$1 = options.wakePausedTurn ?? wakePausedTurn;
|
|
6239
6229
|
const routing = await resolveConversationRouting({ conversationId: payload.conversationId });
|
|
6240
6230
|
const pausedTurn = await getTurnRecord(payload.conversationId, payload.turnId);
|
|
6241
6231
|
const target = resolveSlackReplyTarget({
|
|
@@ -6251,7 +6241,7 @@ async function runPausedTurnInContext(payload, options, runOptions) {
|
|
|
6251
6241
|
channelId: target.channelId,
|
|
6252
6242
|
...target.threadTs ? { threadTs: target.threadTs } : void 0,
|
|
6253
6243
|
executeTurn: async (run, saveResult) => await executeTurn(options.agentRunner, run, saveResult),
|
|
6254
|
-
|
|
6244
|
+
sendPluginTask: options.sendPluginTask,
|
|
6255
6245
|
beforeStart: async () => {
|
|
6256
6246
|
let turn;
|
|
6257
6247
|
try {
|
|
@@ -6420,7 +6410,7 @@ async function runPausedTurnInContext(payload, options, runOptions) {
|
|
|
6420
6410
|
});
|
|
6421
6411
|
},
|
|
6422
6412
|
onSuspend: async (resumeVersion) => {
|
|
6423
|
-
await
|
|
6413
|
+
await options.pausedTurns.wake({
|
|
6424
6414
|
conversationId: payload.conversationId,
|
|
6425
6415
|
destination: payload.destination,
|
|
6426
6416
|
turnId: payload.turnId,
|
|
@@ -6658,7 +6648,7 @@ function createConversationWork(options) {
|
|
|
6658
6648
|
const baseRuntime = createSlackRuntime({
|
|
6659
6649
|
getSlackAdapter: options.getSlackAdapter,
|
|
6660
6650
|
pausedTurns,
|
|
6661
|
-
|
|
6651
|
+
sendPluginTask: options.sendPluginTask,
|
|
6662
6652
|
services: {
|
|
6663
6653
|
...options.services,
|
|
6664
6654
|
agentRunner: options.agentRunner
|
|
@@ -6666,13 +6656,12 @@ function createConversationWork(options) {
|
|
|
6666
6656
|
waitUntil: options.waitUntil
|
|
6667
6657
|
});
|
|
6668
6658
|
const runtime = options.wrapRuntime?.(baseRuntime) ?? baseRuntime;
|
|
6669
|
-
const scheduleCompletedPluginTasks = options.sendPluginTask ? async (params) => await scheduleSessionCompletedPluginTasks(params, { send: options.sendPluginTask }) : void 0;
|
|
6670
6659
|
const slackWorker = createSlackConversationWorker({
|
|
6671
6660
|
getSlackAdapter: options.getSlackAdapter,
|
|
6672
6661
|
runNextPausedTurn: async (conversationId, runOptions) => await runNextPausedTurn(conversationId, {
|
|
6673
6662
|
agentRunner: options.agentRunner,
|
|
6674
|
-
|
|
6675
|
-
|
|
6663
|
+
pausedTurns,
|
|
6664
|
+
sendPluginTask: options.sendPluginTask
|
|
6676
6665
|
}, runOptions),
|
|
6677
6666
|
runtime,
|
|
6678
6667
|
state: options.state
|
|
@@ -6683,8 +6672,8 @@ function createConversationWork(options) {
|
|
|
6683
6672
|
agentRunner: options.agentRunner,
|
|
6684
6673
|
inputMessageIds: [getDispatchInputMessageId(dispatch.id)],
|
|
6685
6674
|
routingContext: buildDispatchRoutingContext(dispatch),
|
|
6686
|
-
|
|
6687
|
-
|
|
6675
|
+
pausedTurns,
|
|
6676
|
+
sendPluginTask: options.sendPluginTask
|
|
6688
6677
|
}, {
|
|
6689
6678
|
checkIn: hooks.checkIn,
|
|
6690
6679
|
shouldYield: hooks.shouldYield
|
|
@@ -6796,6 +6785,7 @@ function createProductionSlackWebhookServices(options) {
|
|
|
6796
6785
|
const conversationStore = getProductionConversationStore();
|
|
6797
6786
|
const runtime = createSlackRuntime({
|
|
6798
6787
|
getSlackAdapter: getProductionSlackAdapter,
|
|
6788
|
+
sendPluginTask: sendVercelPluginTask,
|
|
6799
6789
|
services: options?.services
|
|
6800
6790
|
});
|
|
6801
6791
|
return {
|
|
@@ -7746,6 +7736,9 @@ const BACKFILL_DONE_TTL_MS = GLOBAL_GAPS_TTL_MS;
|
|
|
7746
7736
|
const CONVERSATION_BATCH_SIZE = 10;
|
|
7747
7737
|
const CONVERSATION_PAGE_SIZE = 500;
|
|
7748
7738
|
const QUERY_CANCELED = "57014";
|
|
7739
|
+
const NUL_ESCAPE = String.raw`\u0000`;
|
|
7740
|
+
const NUL_ESCAPE_PATTERN = String.raw`(?<!\\)((?:\\\\)*)\\u0000`;
|
|
7741
|
+
const NUL_ESCAPE_REPLACEMENT = String.raw`\1`;
|
|
7749
7742
|
/**
|
|
7750
7743
|
* Scan time of one backfill run. The heartbeat gives no deadline. This leaves
|
|
7751
7744
|
* most of its function time for the writes and the other heartbeat work.
|
|
@@ -7787,10 +7780,13 @@ async function loadEvents(conversationIds) {
|
|
|
7787
7780
|
const events = juniorConversationEvents;
|
|
7788
7781
|
const isUserMessage = sql`${events.type} = 'user_message'`;
|
|
7789
7782
|
const isToolResult = sql`${events.type} = 'tool_result'`;
|
|
7783
|
+
const messageText = sql`${events.payload}->>'message'`;
|
|
7790
7784
|
const message = sql`CASE
|
|
7791
7785
|
WHEN ${events.type} NOT IN ('assistant_message', 'tool_result') THEN NULL
|
|
7792
|
-
WHEN ${events.schemaVersion}
|
|
7793
|
-
|
|
7786
|
+
WHEN ${events.schemaVersion} < 2 THEN ${events.payload}
|
|
7787
|
+
WHEN (${events.payload}->'timestamp') IS NOT NULL THEN ${events.payload}
|
|
7788
|
+
WHEN strpos(${messageText}, ${NUL_ESCAPE}) = 0 THEN (${messageText})::jsonb
|
|
7789
|
+
ELSE regexp_replace(${messageText}, ${NUL_ESCAPE_PATTERN}, ${NUL_ESCAPE_REPLACEMENT}, 'g')::jsonb
|
|
7794
7790
|
END`;
|
|
7795
7791
|
return await getDb().select({
|
|
7796
7792
|
conversationId: events.conversationId,
|
|
@@ -7799,7 +7795,7 @@ async function loadEvents(conversationIds) {
|
|
|
7799
7795
|
stopReason: sql`(${message})->>'stopReason'`,
|
|
7800
7796
|
toolName: sql`(${message})->>'toolName'`,
|
|
7801
7797
|
startedAtMs: sql`(${message})->>'timestamp'`,
|
|
7802
|
-
modelId: sql
|
|
7798
|
+
modelId: sql`${events.payload}->>'model'`,
|
|
7803
7799
|
cacheRead: sql`${events.payload}->'usage'->>'cacheRead'`,
|
|
7804
7800
|
cacheWrite: sql`${events.payload}->'usage'->>'cacheWrite'`
|
|
7805
7801
|
}).from(events).innerJoin(juniorConversations, eq(juniorConversations.conversationId, events.conversationId)).where(and(inArray(events.conversationId, conversationIds), or(eq(events.type, "assistant_message"), and(isToolResult, inArray(sql`(${message})->>'toolName'`, Object.keys(ANSWER_TOOL_ENDINGS)), sql`(${message})->>'isError' IS DISTINCT FROM 'true'`), and(isUserMessage, sql`(${events.payload}->'provenance'->>'authority') = 'instruction'`)), gte(events.createdAt, juniorConversations.createdAt))).orderBy(events.conversationId, events.seq);
|
|
@@ -7888,7 +7884,7 @@ function replayConversation(kind, events, children, nowMs) {
|
|
|
7888
7884
|
const waitsOnPendingWork = turnBehavior({
|
|
7889
7885
|
kind,
|
|
7890
7886
|
personInput: userActor
|
|
7891
|
-
}).
|
|
7887
|
+
}).idleNeedsPendingWork;
|
|
7892
7888
|
idle = {
|
|
7893
7889
|
sinceMs: startedAtMs,
|
|
7894
7890
|
segment: historySegment(userActor, endedTurns),
|
|
@@ -8898,57 +8894,6 @@ async function stopConversation(args) {
|
|
|
8898
8894
|
throw error;
|
|
8899
8895
|
}
|
|
8900
8896
|
}
|
|
8901
|
-
// src/chat/sign-in/allowlist.ts
|
|
8902
|
-
/**
|
|
8903
|
-
* Domains that may use Junior. Slack authors must have a Slack profile email
|
|
8904
|
-
* on one of them, and dashboard Google sign-ins must come from a Google
|
|
8905
|
-
* Workspace account whose `hd` claim is one of them. Slack and the dashboard
|
|
8906
|
-
* share one list.
|
|
8907
|
-
*/
|
|
8908
|
-
/** Read a list env var: a JSON string array or comma-separated values. */
|
|
8909
|
-
function readEnvList(name) {
|
|
8910
|
-
const value = process.env[name]?.trim();
|
|
8911
|
-
if (!value) return void 0;
|
|
8912
|
-
if (!value.startsWith("[")) return value.split(",");
|
|
8913
|
-
let parsed;
|
|
8914
|
-
try {
|
|
8915
|
-
parsed = JSON.parse(value);
|
|
8916
|
-
} catch (error) {
|
|
8917
|
-
throw new Error(`${name} must be a JSON string array`, { cause: error });
|
|
8918
|
-
}
|
|
8919
|
-
const list = z.array(z.string()).safeParse(parsed);
|
|
8920
|
-
if (!list.success) throw new Error(`${name} must be a JSON string array`);
|
|
8921
|
-
return list.data;
|
|
8922
|
-
}
|
|
8923
|
-
/**
|
|
8924
|
-
* Resolve the allowed domains: the `createApp` option when set, else
|
|
8925
|
-
* `JUNIOR_ALLOWED_DOMAINS`. An empty list allows every domain.
|
|
8926
|
-
*/
|
|
8927
|
-
function resolveAllowedDomains(allowedDomains) {
|
|
8928
|
-
return [...new Set((allowedDomains ?? readEnvList("JUNIOR_ALLOWED_DOMAINS") ?? []).map((value) => value.trim().toLowerCase()).filter(Boolean))];
|
|
8929
|
-
}
|
|
8930
|
-
/**
|
|
8931
|
-
* Fail startup on the removed Google-specific names. Ignoring them would
|
|
8932
|
-
* leave the list empty, which lets every Slack workspace member in.
|
|
8933
|
-
*/
|
|
8934
|
-
function assertNoLegacyAllowedDomains(dashboardOptionKeys) {
|
|
8935
|
-
if (dashboardOptionKeys.includes("allowedGoogleDomains")) throw new Error("dashboard.allowedGoogleDomains was removed; set createApp({ allowedDomains }) instead");
|
|
8936
|
-
if (process.env["JUNIOR_DASHBOARD_GOOGLE_DOMAINS"]?.trim()) throw new Error("JUNIOR_DASHBOARD_GOOGLE_DOMAINS was removed; set JUNIOR_ALLOWED_DOMAINS instead");
|
|
8937
|
-
}
|
|
8938
|
-
/** Return whether a verified domain may use Junior. An empty list allows all. */
|
|
8939
|
-
function isAllowedDomain(domain, allowedDomains) {
|
|
8940
|
-
if (allowedDomains.length === 0) return true;
|
|
8941
|
-
return Boolean(domain && allowedDomains.includes(domain.toLowerCase()));
|
|
8942
|
-
}
|
|
8943
|
-
/**
|
|
8944
|
-
* Return whether a verified sign-in email is on an allowed domain. Sign-in
|
|
8945
|
-
* needs a configured list, so an empty list allows no email.
|
|
8946
|
-
*/
|
|
8947
|
-
function isAllowedSignInEmail(email, allowedDomains) {
|
|
8948
|
-
const normalized = email.trim().toLowerCase();
|
|
8949
|
-
const separator = normalized.lastIndexOf("@");
|
|
8950
|
-
return allowedDomains.length > 0 && separator > 0 && isAllowedDomain(normalized.slice(separator + 1), allowedDomains);
|
|
8951
|
-
}
|
|
8952
8897
|
// src/api/mentions.ts
|
|
8953
8898
|
function mentionedSlackUserIds(texts) {
|
|
8954
8899
|
const ids = texts.flatMap((text) => text ? slackMentionedUserIds(text) : []);
|
|
@@ -11663,4 +11608,4 @@ function viewerWebMessages(messages, viewer) {
|
|
|
11663
11608
|
}] : [];
|
|
11664
11609
|
});
|
|
11665
11610
|
}
|
|
11666
|
-
export {
|
|
11611
|
+
export { publicAddressLookup as $, actOnReviewItem as A, readSavingsRefill as B, encodeConversationCursor as C, decodeImageId as Ct, resolveMentions as D, requireConversationPendingMessages as E, runAutoArchiveSweep as F, readHealthReport as G, startSavingsRefill as H, setConversationAutoArchive as I, readObjectLinkTypes as J, OBJECT_LINK_TTL_MS as K, DEFAULT_USER_SETTINGS as L, readReviewItemForUser as M, reviewItemChange as N, stopConversation as O, archiveViewerDoneConversations as P, isPublicAddress as Q, readUserSettings as R, decodeConversationCursor as S, IMAGE_WIDTHS as St, readConversationPendingMessages as T, backfillCacheWarmingGaps as U, runSavingsRefillSlice as V, GET as W, resolveObjectLinks as X, resolveObjectLinkNow as Y, guardedFetch as Z, readConversationEvents as _, SubscribedReplyReason as _t, decodePageCursor as a, slackInboundMessageId as at, createConversationForViewer as b, readFirstHumanMessageTexts as bt, reorderPinnedConversations as c, AGENT_DISPATCH_MAX_AGE_MS as ct, childAgentTotalsReport as d, recordSkippedConversationMessage as dt, createProductionConversationWorkOptions as et, readConversationTreeMetricsFromSql as f, createSlackWebApiStatusSender as ft, keepQuickQuestionForViewer as g, parseContent as gt, forkConversationForViewer as h, stripLeadingBotMention as ht, readConversationFeed as i, clearSlackPendingReactions as it, closeReviewItemsAnsweredByReply as j, ReviewItemActionError as k, readConversationDetail as l, enqueueAgentDispatch as lt, readConversationDetailEtag as m, startProcessingReaction as mt, steerConversationPendingMessagesForViewer as n, getProductionSlackAdapter as nt, encodePageCursor as o, normalizeIncomingSlackThreadId as ot, conversationVersionQuery as p, bindMessageAuthorIdentityId as pt, readLinkObjectType as q, conversationFeedVersionQuery as r, buildSlackInboundMessage as rt, pinConversation as s, withNormalizedThreadId as st, stopConversationTurnForViewer as t, createProductionSlackWebhookServices as tt, readConversationAuxiliaryCostsFromSql as u, failStoppedDispatch as ut, readConversationRecordFromSql as v, getThreadStopDecision as vt, cancelConversationPendingMessagesForViewer as w, requireWebMessageConversation as x, createViewerMcp as xt, appendConversationMessageForViewer as y, conversationSummaryFromStoredConversation as yt, updateUserSettings as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getConversationStore } from "./db-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import "./background-compaction-queue-
|
|
4
|
-
import { At as
|
|
1
|
+
import { a as getConversationStore } from "./db-DV2ZUb1Y.js";
|
|
2
|
+
import { p as logException } from "./logging-oYpJYr-S.js";
|
|
3
|
+
import "./background-compaction-queue-D2wzxtGU.js";
|
|
4
|
+
import { At as hasRunnableConversationWork, Bt as releaseInboundMessage, Dt as getConversationWorkState$1, Et as getConversation$1, Gt as stopConversationWork$1, Ht as requestConversationWork$1, Kt as takeDeferredConversationMove, Lt as recordAttemptFailure$1, Nt as listActiveConversationIds$1, Ot as getConversationWorkStates$1, Pt as markConversationWorkEnqueued$1, Rt as recordConversationRetry$1, St as deadLetterAttempt$1, Tt as dropPendingMessages$1, Ut as startConversationWork$1, Vt as requestAnotherSlice$1, Wt as steerWebPendingMessages$1, _t as clearConsumedConversationWake$1, bt as completeConversationWork$1, dt as appendExclusiveInboundMessage, ft as appendInboundMessage, gt as claimInboundMessage$1, ht as checkInConversationWork$1, mt as cancelHumanFacingPendingMessages$1, pt as beginConversationResume$1, ut as ackMessages$1, vt as clearExpiredConversationLease$1, wt as drainConversationMailbox$1, yt as completeConversationStop$1, zt as releaseConversationWork$1 } from "./projection-CWXDE0f6.js";
|
|
5
5
|
// src/chat/task-execution/store.ts
|
|
6
6
|
function metadataStore(options) {
|
|
7
7
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -304,7 +304,7 @@ async function runDeferredMove(args) {
|
|
|
304
304
|
const move = await takeDeferredConversationMove(args);
|
|
305
305
|
if (move === void 0) return;
|
|
306
306
|
try {
|
|
307
|
-
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-
|
|
307
|
+
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-B1KEptUg.js").then((n) => n.r);
|
|
308
308
|
await continueDeferredSlackClick(move, args.getSlackAdapter);
|
|
309
309
|
} catch (error) {
|
|
310
310
|
logException(error, "slack.continue_here.deferred.failed", { "gen_ai.conversation.id": args.conversationId });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-
|
|
1
|
+
import { h as logWarn } from "./logging-oYpJYr-S.js";
|
|
2
|
+
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-D2wzxtGU.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
// src/chat/plugins/task-queue.ts
|
|
@@ -60,7 +60,7 @@ function pluginTaskCallback() {
|
|
|
60
60
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
61
61
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
62
62
|
run: async (message) => {
|
|
63
|
-
const { processPluginTask } = await import("./task-runner-
|
|
63
|
+
const { processPluginTask } = await import("./task-runner-frzlUvFD.js").then((n) => n.r);
|
|
64
64
|
await processPluginTask(message);
|
|
65
65
|
},
|
|
66
66
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { E as withSpan } from "./logging-
|
|
5
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState,
|
|
6
|
-
import { i as readActorIdentity } from "./viewer-
|
|
2
|
+
import { $n as getPlugins, Aa as createPluginModelCostRecorder, An as isToolResultMessage, Fo as getDispatchRecord, Ha as createPluginConversationEvents, Nn as stripRuntimeTurnContext, Tn as instructionTextForProjection, Xc as createPluginCache, _a as createPluginEmbedder, at as getTurnRecord, bn as getPiMessageRole, ja as createPluginLogger, jn as normalizeToolNameFromResult, kn as isToolResultError, rr as coreTaskRegistrations, v as hydrateConversationMessages, va as createPluginModel, xi as createPluginState } from "./projection-CWXDE0f6.js";
|
|
3
|
+
import { $ as getStateAdapter, a as getConversationStore, o as getDb } from "./db-DV2ZUb1Y.js";
|
|
4
|
+
import { E as withSpan } from "./logging-oYpJYr-S.js";
|
|
5
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, t as resolveConversationRouting } from "./turn-session-routing-BXaubz2w.js";
|
|
6
|
+
import { i as readActorIdentity } from "./viewer-DKOeHpv3.js";
|
|
7
7
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
8
|
-
import { m as sameActorIdentity } from "./history-
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId
|
|
8
|
+
import { m as sameActorIdentity } from "./history-N7IVbUom.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId } from "./task-queue-CFlrJguF.js";
|
|
10
10
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/plugins/task-runner.ts
|
|
12
12
|
/**
|
|
@@ -248,7 +248,7 @@ function findPluginTask(message) {
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
/** Schedule all plugin tasks interested in a completed agent-run session. */
|
|
251
|
-
async function scheduleSessionCompletedPluginTasks(params,
|
|
251
|
+
async function scheduleSessionCompletedPluginTasks(params, send) {
|
|
252
252
|
const coreParams = pluginTaskParamsSchema.parse(params);
|
|
253
253
|
const taskRegistrations = [...getPlugins(), ...coreTaskRegistrations()].flatMap((plugin) => Object.keys(plugin.tasks ?? {}).map((name) => ({
|
|
254
254
|
name,
|
|
@@ -257,7 +257,6 @@ async function scheduleSessionCompletedPluginTasks(params, options = {}) {
|
|
|
257
257
|
if (taskRegistrations.length === 0) return;
|
|
258
258
|
const record = await getTurnRecord(coreParams.conversationId, coreParams.sessionId);
|
|
259
259
|
if (!record || record.state !== "completed") throw new Error("Completed plugin task session record is not ready");
|
|
260
|
-
const send = options.send ?? sendVercelPluginTask;
|
|
261
260
|
const messages = taskRegistrations.map(({ name, plugin }) => ({
|
|
262
261
|
name,
|
|
263
262
|
params: coreParams,
|