@sentry/junior 0.290.0 → 0.292.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/bin/junior.mjs +19 -15
- package/dist/{adapter-CHMVy-j0.js → adapter-Cigb1MTr.js} +1 -1
- package/dist/{admin-C45Ap5Tn.js → admin-BO9V7vnn.js} +2 -2
- package/dist/{agent-runner-CZjf6MOQ.js → agent-runner-BuH7EHrX.js} +35 -28
- 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-BB1j2krL.d.ts → app-C47PT68y.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +29 -29
- package/dist/{assistant-reply-BtIV0hq6.js → assistant-reply-ZjLRGHm2.js} +1 -1
- package/dist/{automation-DWbjJltM.js → automation-CrsYnvdV.js} +1 -1
- package/dist/{background-compaction-queue-2gKhjRD3.js → background-compaction-queue-CqZBPe9g.js} +4 -4
- package/dist/{briefs-BGke_Cz5.js → briefs-DZrhXJss.js} +3 -3
- package/dist/{catalog-runtime-BSOlVfXi.js → catalog-runtime-Cj9I0dco.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.js +25 -6
- 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 +4 -3
- package/dist/{config-DHDub41t.js → config-BerMjSVL.js} +2 -2
- package/dist/{connections-BAb0fedk.js → connections-BWmTOVPB.js} +6 -6
- package/dist/{conversation-CwC8K3RZ.js → conversation-CtjR1Zcx.js} +7 -1
- package/dist/{conversation-pending-messages-B0cuLReP.js → conversation-pending-messages-Cd7ShwBs.js} +1 -1
- package/dist/{conversation-privacy-QRdLPH-9.js → conversation-privacy-BMfbOUCo.js} +1 -1
- package/dist/{credential-sync-YIMGiRk7.js → credential-sync-DZDij2CU.js} +13 -13
- package/dist/{db-DCSmv9tz.d.ts → db-7glZCI18.d.ts} +1 -1
- package/dist/{db-DBHig2sI.js → db-BlfjuqzW.js} +8 -5
- package/dist/{executor-DKrtH0k_.js → executor-ikZvFaMD.js} +54 -6
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-f24cZPEj.js → logging-CTCH5jOy.js} +1 -1
- package/dist/{message-BbBOajiX.js → message-C1ID1tKi.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-rHJYjFoz.js → oauth-callback-server-CStBgDU7.js} +2 -2
- package/dist/{projection-D-9aVaHj.js → projection-DY93nCfX.js} +11 -11
- package/dist/{prompt-C7SZhNDy.js → prompt-exicBZeb.js} +4 -4
- package/dist/{registry-CwA-kSjW.js → registry-X_xdFY9L.js} +1 -1
- package/dist/{resolve-B5WJgt9k.js → resolve-B9dYN-nS.js} +3 -3
- package/dist/{result-B2sCVIwl.js → result-CC8bV8Fl.js} +8 -8
- package/dist/{runner-CZq7wyIh.js → runner-D44qp4rc.js} +8 -8
- package/dist/{sandbox-egress-signals-C4d6Pa9a.js → sandbox-egress-signals-BrH6DWkt.js} +1 -1
- package/dist/{schema-DQaFSkZZ.d.ts → schema-CC2RxDAV.d.ts} +5 -0
- package/dist/{schema-Bptz19Ja.js → schema-CVV5r-qP.js} +3 -3
- package/dist/{service-account-B6OJtplS.js → service-account-89JZHWCE.js} +3 -3
- package/dist/{service-account-BC73M8rj.js → service-account-DoNZuJb-.js} +3 -3
- package/dist/{session-stop-1cku9Vm3.js → session-stop-DNucbmPf.js} +11 -11
- package/dist/{skills-BFopj5ID.js → skills-BeUfmYXL.js} +2 -2
- package/dist/{spawn-B-1JlJwH.js → spawn-CIAcfcvZ.js} +5 -5
- package/dist/{stop-CJweYiOH.js → stop-Ckd3735h.js} +89 -32
- package/dist/{store-CK869JpC.js → store-CS0xoqXW.js} +3 -3
- package/dist/{task-runner-XmXL9E-k.js → task-runner-DjjHCX_m.js} +11 -11
- package/dist/{turn-failure-response-hhpek6Fn.js → turn-failure-response-D0bwI462.js} +8 -8
- package/dist/{validation-DHQjCRFx.js → validation-Cvx_AupF.js} +1 -1
- package/dist/{version-DQgCf4FE.js → version-BrDx4Fzc.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DG97nzP4.js → viewer-4CxdwLLQ.js} +3 -3
- package/dist/{warmup-C00-jOoN.js → warmup-B62hd4lD.js} +8 -8
- package/dist/{work-Ch3EWO6u.js → work-Cu315oJl.js} +11 -11
- package/dist/{worker-B8kyM1fB.js → worker-4ClZu6ry.js} +6 -6
- package/migrations/0095_web_linked_slack_identity_repair.sql +252 -0
- package/migrations/meta/0095_snapshot.json +4452 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
package/dist/app.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { $a as readConversationAccessFromSql, $i as slackEntitySchema, $r as verifySlackDirectCredentialSubject, Ai as proxyVercelSandboxEgressRequest, At as isInvalidConversationRecordError, Bi as slackMention, Bn as setPlugins, Br as collectEventMatchKeys, C as settleConversationTitleWork, Ca as consumeSandboxEgressPermissionDeniedSignal, En as createUserTokenStore, Er as reviewItemReaderForUserInConversation, Fa as createPluginEmbedder, Ii as escapeSlackMrkdwnText, Jr as bindEventAutomationCredentialSubject, Ki as openSlackModal, Li as formatSlackLink, Lo as getConfigDefaults, Nn as getPluginApiRoutes, Ot as hasRunnableConversationWork, Pi as resolveBaseUrl, Pn as getPluginRoutes, Pt as pruneActiveConversation, Qr as verifyScheduledAutomationCredentialSubject, Ro as setConfigDefaults, Sa as consumeSandboxEgressAuthRequiredSignal, So as resolveRootVisibility, Ta as parseSandboxEgressCredentialToken, To as listConversationAnnotations, Tr as reviewItemReaderForUser, Vn as validatePlugins, Wn as setBriefsConfig, Wr as findMatchingWatches, Xi as unfurlSlackLinks, Xr as bindSlackDirectCredentialSubject, Ya as createPluginLogger, Yr as bindScheduledAutomationCredentialSubject, Zr as verifyEventAutomationCredentialSubject, _ as appendConversationMessages, aa as getSlackClient, ci as setDashboardConversationLinkOptions, co as readLatestConversationBrief, da as getWorkspaceTeamId, dr as searchReviewItems, ea as slackExternalRefIdSchema, er as projectConversationMessages, fa as runWithWorkspaceTeamId, fo as readConversationLastEventSeq, hr as canActOnReviewItem, ii as getDashboardReviewItemLink, ir as dismissOpenReviewItems, jo as createPluginCache, ka as normalizeSandboxEgressTracePropagationDomains, ki as isVercelSandboxEgressRequest, lo as readConversationEventPage, ni as getDashboardConversationLink, oi as getDashboardTaskLink, po as readConversationMessageEventSeq, qi as postSlackEphemeralMessage, qr as takeDueTimerWatches, sa as isDmChannel, si as parseDashboardConversationLink, ui as createPluginState, uo as readConversationEventPageAfter, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, xa as clearSandboxEgressSignals, zn as getPlugins } from "./projection-
|
|
3
|
-
import { d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, q as getAttachmentStorage, u as resetRuntimeConfig } from "./config-
|
|
4
|
-
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { $a as readConversationAccessFromSql, $i as slackEntitySchema, $r as verifySlackDirectCredentialSubject, Ai as proxyVercelSandboxEgressRequest, At as isInvalidConversationRecordError, Bi as slackMention, Bn as setPlugins, Br as collectEventMatchKeys, C as settleConversationTitleWork, Ca as consumeSandboxEgressPermissionDeniedSignal, En as createUserTokenStore, Er as reviewItemReaderForUserInConversation, Fa as createPluginEmbedder, Ii as escapeSlackMrkdwnText, Jr as bindEventAutomationCredentialSubject, Ki as openSlackModal, Li as formatSlackLink, Lo as getConfigDefaults, Nn as getPluginApiRoutes, Ot as hasRunnableConversationWork, Pi as resolveBaseUrl, Pn as getPluginRoutes, Pt as pruneActiveConversation, Qr as verifyScheduledAutomationCredentialSubject, Ro as setConfigDefaults, Sa as consumeSandboxEgressAuthRequiredSignal, So as resolveRootVisibility, Ta as parseSandboxEgressCredentialToken, To as listConversationAnnotations, Tr as reviewItemReaderForUser, Vn as validatePlugins, Wn as setBriefsConfig, Wr as findMatchingWatches, Xi as unfurlSlackLinks, Xr as bindSlackDirectCredentialSubject, Ya as createPluginLogger, Yr as bindScheduledAutomationCredentialSubject, Zr as verifyEventAutomationCredentialSubject, _ as appendConversationMessages, aa as getSlackClient, ci as setDashboardConversationLinkOptions, co as readLatestConversationBrief, da as getWorkspaceTeamId, dr as searchReviewItems, ea as slackExternalRefIdSchema, er as projectConversationMessages, fa as runWithWorkspaceTeamId, fo as readConversationLastEventSeq, hr as canActOnReviewItem, ii as getDashboardReviewItemLink, ir as dismissOpenReviewItems, jo as createPluginCache, ka as normalizeSandboxEgressTracePropagationDomains, ki as isVercelSandboxEgressRequest, lo as readConversationEventPage, ni as getDashboardConversationLink, oi as getDashboardTaskLink, po as readConversationMessageEventSeq, qi as postSlackEphemeralMessage, qr as takeDueTimerWatches, sa as isDmChannel, si as parseDashboardConversationLink, ui as createPluginState, uo as readConversationEventPageAfter, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, xa as clearSandboxEgressSignals, zn as getPlugins } from "./projection-DY93nCfX.js";
|
|
3
|
+
import { d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, q as getAttachmentStorage, u as resetRuntimeConfig } from "./config-BerMjSVL.js";
|
|
4
|
+
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-CTCH5jOy.js";
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-BrDx4Fzc.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
|
|
7
|
-
import { D as resolveActorIdentityId, N as recordGoogleSignIn, R as getConversationIdByProviderConversation, X as createSlackDestination, Y as touchConversationDetail, a as getConversationStore, b as withConversationMutationLock, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, x as conversationKindFromRow } from "./db-
|
|
8
|
-
import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { $ as readViewerAutomationSummary, $t as resumeConversationDelivery, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, I as checkSlackChannelReadAccess, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as recordSubagentEnded, S as createSlackReviewItemShow, St as markConversationRead, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as unpublishedArtifactHeaders, at as deliverReviewItemChange, bt as archiveConversation,
|
|
7
|
+
import { D as resolveActorIdentityId, N as recordGoogleSignIn, R as getConversationIdByProviderConversation, X as createSlackDestination, Y as touchConversationDetail, a as getConversationStore, b as withConversationMutationLock, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, x as conversationKindFromRow } from "./db-BlfjuqzW.js";
|
|
8
|
+
import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-ikZvFaMD.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cj9I0dco.js";
|
|
10
|
+
import { $ as readViewerAutomationSummary, $t as resumeConversationDelivery, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, I as checkSlackChannelReadAccess, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as recordSubagentEnded, S as createSlackReviewItemShow, St as markConversationRead, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as unpublishedArtifactHeaders, at as deliverReviewItemChange, bt as archiveConversation, g as readPublicArtifact, gt as collectAttachmentGarbage, h as publicArtifactHeaders, j as verifySlackSignature, k as parseSlackUserInputSubmission, ln as processWorkspaceSnapshotJob, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, ot as renderReviewItemMessage, pt as recordWebConversationActivity, r as processBackgroundCompaction, rt as effectiveTaskOutcomes, st as reviewItemChangeRecord, t as createAgentRunner, tt as readViewerAutomations, un as ingestEvent, ut as conversationTurnIdForMessage, v as setConversationSubscription, vt as requestAttachmentDeletion, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, z as joinPublicChannel } from "./agent-runner-BuH7EHrX.js";
|
|
11
11
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
12
|
-
import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-
|
|
13
|
-
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-
|
|
12
|
+
import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-4CxdwLLQ.js";
|
|
13
|
+
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-Cigb1MTr.js";
|
|
14
14
|
import { a as getNextRunAtMs } from "./schedule-cP0AACm1.js";
|
|
15
|
-
import { F as annotationCard, Y as conversationBriefSchema, k as conversationTitleSchema, p as conversationFeedQuerySchema, x as conversationSurfaceSchema, y as conversationReportStatusSchema } from "./conversation-
|
|
15
|
+
import { F as annotationCard, Y as conversationBriefSchema, k as conversationTitleSchema, p as conversationFeedQuerySchema, x as conversationSurfaceSchema, y as conversationReportStatusSchema } from "./conversation-CtjR1Zcx.js";
|
|
16
16
|
import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
17
|
-
import { a as segmentGapsKey, d as MINUTE_MS, f as MIN_WARMUP_PREFIX_TOKENS, m as gapSegment, n as GLOBAL_GAPS_MAX, p as NO_REPLY_GAP_MS, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS } from "./warmup-
|
|
18
|
-
import { A as getQueueProvider, C as cacheWarmupQueueConsumer, O as queueCallback, T as registerVercelCacheWarmupDevConsumer, _ as resolveConversationWorkQueueTopic, b as conversationQueueMessageSchema, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as getVercelConversationWorkQueue, h as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as verifyConversationQueueMessage, w as createVercelCacheWarmupCallback, x as isConversationQueueMessageRejectedError } from "./background-compaction-queue-
|
|
19
|
-
import { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-
|
|
20
|
-
import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, it as setExperimentalFeatures, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, nt as getExperimentalFeatures, rt as isExperimentalFeatureEnabled, z as renderTaskInput } from "./session-stop-
|
|
17
|
+
import { a as segmentGapsKey, d as MINUTE_MS, f as MIN_WARMUP_PREFIX_TOKENS, m as gapSegment, n as GLOBAL_GAPS_MAX, p as NO_REPLY_GAP_MS, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS } from "./warmup-B62hd4lD.js";
|
|
18
|
+
import { A as getQueueProvider, C as cacheWarmupQueueConsumer, O as queueCallback, T as registerVercelCacheWarmupDevConsumer, _ as resolveConversationWorkQueueTopic, b as conversationQueueMessageSchema, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as getVercelConversationWorkQueue, h as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as verifyConversationQueueMessage, w as createVercelCacheWarmupCallback, x as isConversationQueueMessageRejectedError } from "./background-compaction-queue-CqZBPe9g.js";
|
|
19
|
+
import { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-D0bwI462.js";
|
|
20
|
+
import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, it as setExperimentalFeatures, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, nt as getExperimentalFeatures, rt as isExperimentalFeatureEnabled, z as renderTaskInput } from "./session-stop-DNucbmPf.js";
|
|
21
21
|
import { _ as buttonUserInputField } from "./reporting-window-B3Ze-Qnt.js";
|
|
22
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-
|
|
23
|
-
import { _ as listActiveConversationIds, g as getConversationWorkState, h as getConversation, l as clearExpiredConversationLease, m as ensureConversationWake, r as appendAndEnqueueInboundMessage } from "./store-
|
|
24
|
-
import { A as withScheduledAutomationLock, Ct as eventGuidance, E as readScheduledAutomation, F as findMatchingEventAutomations, H as eventAutomationRunLimitReason, M as collectEventAutomationMatchKeys, O as saveScheduledAutomationInLock, Q as existingConversationId, V as admitEventAutomationRun, W as automationVersionOf, c as getDispatchConversationId, ct as recordAutomationExecution, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, j as blockEventAutomation, k as scheduledRunId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, vt as coerceThreadConversationState, w as listScheduledAutomationsForTeam, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-
|
|
25
|
-
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-
|
|
26
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
22
|
+
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-B9dYN-nS.js";
|
|
23
|
+
import { _ as listActiveConversationIds, g as getConversationWorkState, h as getConversation, l as clearExpiredConversationLease, m as ensureConversationWake, r as appendAndEnqueueInboundMessage } from "./store-CS0xoqXW.js";
|
|
24
|
+
import { A as withScheduledAutomationLock, Ct as eventGuidance, E as readScheduledAutomation, F as findMatchingEventAutomations, H as eventAutomationRunLimitReason, M as collectEventAutomationMatchKeys, O as saveScheduledAutomationInLock, Q as existingConversationId, V as admitEventAutomationRun, W as automationVersionOf, c as getDispatchConversationId, ct as recordAutomationExecution, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, j as blockEventAutomation, k as scheduledRunId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, vt as coerceThreadConversationState, w as listScheduledAutomationsForTeam, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-DjjHCX_m.js";
|
|
25
|
+
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-CrsYnvdV.js";
|
|
26
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Cvx_AupF.js";
|
|
27
27
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-HYh_JOdw.js";
|
|
28
|
-
import { a as conversationPendingMessageDeliverySchema } from "./conversation-pending-messages-
|
|
29
|
-
import { $ as actOnReviewItem, A as createProductionConversationWorkOptions, B as clearSlackPendingReactions, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as isAllowedSignInEmail, G as createSlackWebApiStatusSender, H as stripLeadingBotMention, I as readEnvList, J as stopConversation, K as SubscribedReplyReason, L as resolveAllowedDomains, M as getProductionSlackAdapter, N as assertNoLegacyAllowedDomains, P as isAllowedDomain, Q as ReviewItemActionError, R as startProcessingReaction, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as normalizeIncomingSlackThreadId, V as slackInboundMessageId, W as withNormalizedThreadId, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, at as continueConversationInSlack, b as readConversationRecordFromSql, ct as archiveViewerDoneConversations, dt as setConversationAutoArchive, et as closeReviewItemsAnsweredByReply, ht as GET$4, i as readConversationFeed, it as canContinueInSlack, j as createProductionSlackWebhookServices, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as isMovableToSlack, q as getThreadStopDecision, rt as alreadyContinuesInSlackMessage, s as readConversationDetail, t as stopConversationTurnForViewer, tt as readReviewItemForUser, ut as runAutoArchiveSweep, w as decodeConversationCursor, z as buildSlackInboundMessage } from "./stop-
|
|
30
|
-
import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-
|
|
31
|
-
import { n as enqueueAgentInvocationResult } from "./result-
|
|
32
|
-
import { o as unlinkProvider } from "./connections-
|
|
33
|
-
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
28
|
+
import { a as conversationPendingMessageDeliverySchema } from "./conversation-pending-messages-Cd7ShwBs.js";
|
|
29
|
+
import { $ as actOnReviewItem, A as createProductionConversationWorkOptions, B as clearSlackPendingReactions, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as isAllowedSignInEmail, G as createSlackWebApiStatusSender, H as stripLeadingBotMention, I as readEnvList, J as stopConversation, K as SubscribedReplyReason, L as resolveAllowedDomains, M as getProductionSlackAdapter, N as assertNoLegacyAllowedDomains, P as isAllowedDomain, Q as ReviewItemActionError, R as startProcessingReaction, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as normalizeIncomingSlackThreadId, V as slackInboundMessageId, W as withNormalizedThreadId, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, at as continueConversationInSlack, b as readConversationRecordFromSql, ct as archiveViewerDoneConversations, dt as setConversationAutoArchive, et as closeReviewItemsAnsweredByReply, ht as GET$4, i as readConversationFeed, it as canContinueInSlack, j as createProductionSlackWebhookServices, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as isMovableToSlack, q as getThreadStopDecision, rt as alreadyContinuesInSlackMessage, s as readConversationDetail, t as stopConversationTurnForViewer, tt as readReviewItemForUser, ut as runAutoArchiveSweep, w as decodeConversationCursor, z as buildSlackInboundMessage } from "./stop-Ckd3735h.js";
|
|
30
|
+
import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-Cu315oJl.js";
|
|
31
|
+
import { n as enqueueAgentInvocationResult } from "./result-CC8bV8Fl.js";
|
|
32
|
+
import { o as unlinkProvider } from "./connections-BWmTOVPB.js";
|
|
33
|
+
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DZDij2CU.js";
|
|
34
34
|
import { t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
|
|
35
|
-
import { t as processConversationWork } from "./worker-
|
|
36
|
-
import { t as bindMessageAgent } from "./message-
|
|
37
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
35
|
+
import { t as processConversationWork } from "./worker-4ClZu6ry.js";
|
|
36
|
+
import { t as bindMessageAgent } from "./message-C1ID1tKi.js";
|
|
37
|
+
import { t as bindSpawnAgent } from "./spawn-CIAcfcvZ.js";
|
|
38
38
|
import { createRequire } from "node:module";
|
|
39
39
|
import { Hono } from "hono";
|
|
40
40
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as extractAssistantText, dn as normalizeToolNameFromResult, ln as isToolResultError, un as isToolResultMessage } from "./projection-
|
|
1
|
+
import { $t as extractAssistantText, dn as normalizeToolNameFromResult, ln as isToolResultError, un as isToolResultMessage } from "./projection-DY93nCfX.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/no-reply.ts
|
|
4
4
|
/** No-reply result of a Turn. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
|
|
2
|
-
import { i as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { i as actorIdentitySchema } from "./conversation-CtjR1Zcx.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
5
|
// src/chat/scheduled-automations/schedule-intent.ts
|
package/dist/{background-compaction-queue-2gKhjRD3.js → background-compaction-queue-CqZBPe9g.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-BerMjSVL.js";
|
|
2
|
+
import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-CTCH5jOy.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -371,7 +371,7 @@ function cacheWarmupCallback() {
|
|
|
371
371
|
maxDeliveries: 1,
|
|
372
372
|
onRejected: logCacheWarmupRejected,
|
|
373
373
|
run: async (message) => {
|
|
374
|
-
const { runCacheWarmup } = await import("./warmup-
|
|
374
|
+
const { runCacheWarmup } = await import("./warmup-B62hd4lD.js").then((n) => n.o);
|
|
375
375
|
await runCacheWarmup(message);
|
|
376
376
|
},
|
|
377
377
|
skip: () => !getChatConfig().cacheWarmingEnabled,
|
|
@@ -560,7 +560,7 @@ function pluginTaskCallback() {
|
|
|
560
560
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
561
561
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
562
562
|
run: async (message) => {
|
|
563
|
-
const { processPluginTask } = await import("./task-runner-
|
|
563
|
+
const { processPluginTask } = await import("./task-runner-DjjHCX_m.js").then((n) => n.r);
|
|
564
564
|
await processPluginTask(message);
|
|
565
565
|
},
|
|
566
566
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
2
|
-
import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-
|
|
1
|
+
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-exicBZeb.js";
|
|
2
|
+
import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-CtjR1Zcx.js";
|
|
3
3
|
import { CLI_USAGE } from "./cli/run.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
|
|
|
262
262
|
* token.
|
|
263
263
|
*/
|
|
264
264
|
async function configuredBriefModelId() {
|
|
265
|
-
const { botConfig } = await import("./config-
|
|
265
|
+
const { botConfig } = await import("./config-BerMjSVL.js").then((n) => n.r);
|
|
266
266
|
return botConfig.fastModelId;
|
|
267
267
|
}
|
|
268
268
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-X_xdFY9L.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-BuH7EHrX.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
|
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
101
|
import("../plugins-HYh_JOdw.js").then((n) => n.o),
|
|
102
|
-
import("../projection-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../db-
|
|
102
|
+
import("../projection-DY93nCfX.js").then((n) => n.jn),
|
|
103
|
+
import("../catalog-runtime-Cj9I0dco.js").then((n) => n.t),
|
|
104
|
+
import("../validation-Cvx_AupF.js").then((n) => n.r),
|
|
105
|
+
import("../db-BlfjuqzW.js").then((n) => n.n)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,18 +152,18 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../projection-
|
|
155
|
+
const { setBriefsConfig } = await import("../projection-DY93nCfX.js").then((n) => n.Un);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-D44qp4rc.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CStBgDU7.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-D6xxVywK.js").then((n) => n.t);
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker } = await import("../result-
|
|
164
|
-
const { skipInputAfterConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BrH6DWkt.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-CIAcfcvZ.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-C1ID1tKi.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-CC8bV8Fl.js").then((n) => n.i);
|
|
164
|
+
const { skipInputAfterConversationStop } = await import("../session-stop-DNucbmPf.js").then((n) => n.a);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-4ClZu6ry.js").then((n) => n.n);
|
|
167
167
|
let agentRunner;
|
|
168
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
169
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-CTCH5jOy.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-X_xdFY9L.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-BeUfmYXL.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/main.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a failed CLI command with its cause chain. Drizzle wraps database
|
|
3
|
+
* errors in "Failed query: ...", so the Postgres reason is only in `cause`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatCliFailure(error: unknown): string;
|
|
1
6
|
/** Run the packaged CLI entrypoint with plugin command bootstrap enabled. */
|
|
2
7
|
export declare function runMain(argv: string[], options?: {
|
|
3
8
|
instrument?: boolean;
|
package/dist/cli/main.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { loadCliEnvFiles } from "./env.js";
|
|
2
2
|
import { runCli } from "./run.js";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
+
// src/cli/failure.ts
|
|
5
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
6
|
+
/**
|
|
7
|
+
* Format a failed CLI command with its cause chain. Drizzle wraps database
|
|
8
|
+
* errors in "Failed query: ...", so the Postgres reason is only in `cause`.
|
|
9
|
+
*/
|
|
10
|
+
function formatCliFailure(error) {
|
|
11
|
+
const lines = [];
|
|
12
|
+
let current = error;
|
|
13
|
+
while (current !== void 0 && lines.length < MAX_CAUSE_DEPTH) {
|
|
14
|
+
if (!(current instanceof Error)) {
|
|
15
|
+
lines.push(String(current));
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
const code = "code" in current ? current.code : void 0;
|
|
19
|
+
lines.push(typeof code === "string" && code ? `${current.message.trim()} (${code})` : current.message.trim());
|
|
20
|
+
current = current.cause;
|
|
21
|
+
}
|
|
22
|
+
return lines.join("\ncaused by: ");
|
|
23
|
+
}
|
|
4
24
|
// src/cli/main.ts
|
|
5
25
|
const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
6
26
|
async function flushSentry() {
|
|
@@ -25,13 +45,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
45
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
46
|
}
|
|
27
47
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
48
|
+
return await (await import("../admin-BO9V7vnn.js")).runAdmin(argv);
|
|
29
49
|
}
|
|
30
50
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
51
|
+
return await (await import("../service-account-DoNZuJb-.js")).runServiceAccount(argv);
|
|
32
52
|
}
|
|
33
53
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
54
|
+
return await (await import("../briefs-DZrhXJss.js")).runBriefs(argv);
|
|
35
55
|
}
|
|
36
56
|
function topLevelCommand(argv) {
|
|
37
57
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
|
@@ -66,10 +86,9 @@ function isDirectCliEntry() {
|
|
|
66
86
|
}
|
|
67
87
|
if (isDirectCliEntry()) runMain(process.argv.slice(2)).catch((error) => {
|
|
68
88
|
(async () => {
|
|
69
|
-
|
|
70
|
-
console.error(`junior command failed: ${message}`);
|
|
89
|
+
console.error(`junior command failed: ${formatCliFailure(error)}`);
|
|
71
90
|
await flushSentry();
|
|
72
91
|
process.exit(1);
|
|
73
92
|
})();
|
|
74
93
|
});
|
|
75
|
-
export { runMain };
|
|
94
|
+
export { formatCliFailure, runMain };
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bn as setPlugins, Vn as validatePlugins, Ya as createPluginLogger } from "../projection-
|
|
2
|
-
import { o as getDb } from "../db-
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Bn as setPlugins, Vn as validatePlugins, Ya as createPluginLogger } from "../projection-DY93nCfX.js";
|
|
2
|
+
import { o as getDb } from "../db-BlfjuqzW.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-Cj9I0dco.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Cvx_AupF.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Aa as SANDBOX_RUNTIME, wi as create } from "../projection-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { Aa as SANDBOX_RUNTIME, wi as create } from "../projection-DY93nCfX.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-Cj9I0dco.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-Cigb1MTr.js";
|
|
4
|
+
import { n as resolve } from "../resolve-B9dYN-nS.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
7
7
|
function progressMessage(phase) {
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-BerMjSVL.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-ikZvFaMD.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-X_xdFY9L.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -381,6 +381,7 @@ async function runUpgrade(io = DEFAULT_IO, options = {}) {
|
|
|
381
381
|
const sqlExecutor = createJuniorSqlExecutor({
|
|
382
382
|
connectionString: readMigrationDatabaseUrl(sql.databaseUrl),
|
|
383
383
|
driver: sql.driver,
|
|
384
|
+
onInfo: (message) => io.info(` ${message}`),
|
|
384
385
|
statementTimeoutMs: false
|
|
385
386
|
});
|
|
386
387
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
3
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
2
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-CTCH5jOy.js";
|
|
3
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BMfbOUCo.js";
|
|
4
4
|
import { AwsClient } from "aws4fetch";
|
|
5
5
|
import { del, get, put } from "@vercel/blob";
|
|
6
6
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Fi as startOAuthFlow } from "./projection-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { A as deleteProviderIdentityForUser, k as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-
|
|
1
|
+
import { Fi as startOAuthFlow } from "./projection-DY93nCfX.js";
|
|
2
|
+
import { n as botConfig } from "./config-BerMjSVL.js";
|
|
3
|
+
import { A as deleteProviderIdentityForUser, k as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db-BlfjuqzW.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-X_xdFY9L.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cj9I0dco.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-BuH7EHrX.js";
|
|
7
7
|
import { randomBytes } from "node:crypto";
|
|
8
8
|
// src/handlers/oauth-html.ts
|
|
9
9
|
/** Build pre-escaped callback HTML with the shared response security policy. */
|
|
@@ -500,7 +500,13 @@ const conversationSummaryReportSchema = z.object({
|
|
|
500
500
|
* - there is no known work and the conversation was last seen within 3 hours
|
|
501
501
|
*/
|
|
502
502
|
isPriority: z.boolean().optional(),
|
|
503
|
-
unfinishedWork: z.boolean().optional()
|
|
503
|
+
unfinishedWork: z.boolean().optional(),
|
|
504
|
+
/**
|
|
505
|
+
* True on the conversation feed when a Turn in the conversation or a
|
|
506
|
+
* child waits on a person to finish an authorization that has not
|
|
507
|
+
* expired.
|
|
508
|
+
*/
|
|
509
|
+
awaitingAuthorization: z.boolean().optional()
|
|
504
510
|
}).strict();
|
|
505
511
|
/** One Event listed on a message that holds several Events. */
|
|
506
512
|
const conversationReportMessageEventSchema = z.object({
|
package/dist/{conversation-pending-messages-B0cuLReP.js → conversation-pending-messages-Cd7ShwBs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-
|
|
1
|
+
import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-CtjR1Zcx.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/reporting-schema.ts
|
|
4
4
|
const healthReportSchema = z.object({
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Ji as postSlackMessage, Mi as formatProviderLabel, Ni as parseOAuthStatePayload, Pi as resolveBaseUrl, Z as getConversationPendingAuth, aa as getSlackClient, d as recordAuthorizationCompleted, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-
|
|
2
|
-
import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
3
|
-
import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
1
|
+
import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Ji as postSlackMessage, Mi as formatProviderLabel, Ni as parseOAuthStatePayload, Pi as resolveBaseUrl, Z as getConversationPendingAuth, aa as getSlackClient, d as recordAuthorizationCompleted, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-DY93nCfX.js";
|
|
2
|
+
import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-BerMjSVL.js";
|
|
3
|
+
import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-CTCH5jOy.js";
|
|
4
4
|
import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
|
|
5
|
-
import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-
|
|
5
|
+
import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-BlfjuqzW.js";
|
|
6
6
|
import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
|
|
7
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
8
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
9
|
-
import { t as discoverSkills } from "./skills-
|
|
10
|
-
import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-
|
|
7
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-X_xdFY9L.js";
|
|
8
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cj9I0dco.js";
|
|
9
|
+
import { t as discoverSkills } from "./skills-BeUfmYXL.js";
|
|
10
|
+
import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-BuH7EHrX.js";
|
|
11
11
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
12
|
-
import { o as readIdentityById } from "./viewer-
|
|
13
|
-
import { r as getStateAdapter } from "./adapter-
|
|
14
|
-
import { ht as getPersistedThreadState, vt as coerceThreadConversationState } from "./task-runner-
|
|
15
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
16
|
-
import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-
|
|
12
|
+
import { o as readIdentityById } from "./viewer-4CxdwLLQ.js";
|
|
13
|
+
import { r as getStateAdapter } from "./adapter-Cigb1MTr.js";
|
|
14
|
+
import { ht as getPersistedThreadState, vt as coerceThreadConversationState } from "./task-runner-DjjHCX_m.js";
|
|
15
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-89JZHWCE.js";
|
|
16
|
+
import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-BWmTOVPB.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-D6xxVywK.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { i as getChatConfig } from "./config-
|
|
3
|
-
import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-
|
|
2
|
+
import { i as getChatConfig } from "./config-BerMjSVL.js";
|
|
3
|
+
import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-CTCH5jOy.js";
|
|
4
4
|
import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
5
|
-
import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-
|
|
5
|
+
import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-ikZvFaMD.js";
|
|
6
6
|
import { d as historyReplacementSchema, f as newConversationEventSchema, p as encodeHistoryPayload, s as conversationEventDataSchema, u as decodeStoredConversationEvent, y as usageSchema } from "./media-BepyEUNm.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
|
|
@@ -678,10 +678,13 @@ function systemIdentityFromSource(source) {
|
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
680
|
/**
|
|
681
|
-
*
|
|
682
|
-
* legacy source system Identity when the
|
|
681
|
+
* Return the root Actor's Identity id. Save the Identity only when the
|
|
682
|
+
* Conversation has none yet. Use the legacy source system Identity when the
|
|
683
|
+
* Conversation has no actor.
|
|
683
684
|
*/
|
|
684
685
|
async function resolveConversationActorIdentityId(executor, conversation) {
|
|
686
|
+
const [stored] = await executor.db().select({ actorIdentityId: juniorConversations.actorIdentityId }).from(juniorConversations).where(eq(juniorConversations.conversationId, conversation.conversationId)).limit(1);
|
|
687
|
+
if (stored?.actorIdentityId) return stored.actorIdentityId;
|
|
685
688
|
const actor = actorFromStoredActor(conversation.actor);
|
|
686
689
|
if (actor) return await resolveActorIdentityId(executor, actor, conversation.updatedAtMs);
|
|
687
690
|
const fallback = systemIdentityFromSource(conversation.source);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as withScope } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import "./config-
|
|
3
|
-
import { p as logException } from "./logging-
|
|
2
|
+
import "./config-BerMjSVL.js";
|
|
3
|
+
import { h as logWarn, p as logException } from "./logging-CTCH5jOy.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
6
6
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -770,7 +770,46 @@ const juniorSqlSchema = {
|
|
|
770
770
|
juniorWorkspaceRepos,
|
|
771
771
|
juniorWorkspaces
|
|
772
772
|
};
|
|
773
|
+
// src/db/info-messages.ts
|
|
774
|
+
/**
|
|
775
|
+
* Send Postgres `INFO` messages from every pool connection to `onInfo`.
|
|
776
|
+
* A migration uses `RAISE INFO` to report its result to the operator.
|
|
777
|
+
* Postgres always sends `INFO` to the client. Its own messages, such as
|
|
778
|
+
* "already exists, skipping", are `NOTICE`, so they stay out.
|
|
779
|
+
*/
|
|
780
|
+
function forwardInfoMessages(pool, onInfo) {
|
|
781
|
+
pool.on("connect", (client) => {
|
|
782
|
+
client.on("notice", (notice) => {
|
|
783
|
+
if (notice.severity === "INFO" && notice.message) onInfo(notice.message);
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
}
|
|
773
787
|
// src/db/migrate.ts
|
|
788
|
+
const LOCK_TIMEOUT_MS = 5e3;
|
|
789
|
+
const LOCK_ATTEMPTS = 5;
|
|
790
|
+
const LOCK_RETRY_DELAY_MS = 5e3;
|
|
791
|
+
const LOCK_NOT_AVAILABLE = "55P03";
|
|
792
|
+
function isLockTimeout(error) {
|
|
793
|
+
let current = error;
|
|
794
|
+
for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {
|
|
795
|
+
if ("code" in current && current.code === LOCK_NOT_AVAILABLE) return true;
|
|
796
|
+
current = current.cause;
|
|
797
|
+
}
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
async function retryOnLockTimeout(tag, apply) {
|
|
801
|
+
for (let attempt = 1;; attempt += 1) try {
|
|
802
|
+
await apply();
|
|
803
|
+
return;
|
|
804
|
+
} catch (error) {
|
|
805
|
+
if (attempt >= LOCK_ATTEMPTS || !isLockTimeout(error)) throw error;
|
|
806
|
+
logWarn("db.migration.lock_timeout", {
|
|
807
|
+
"app.db.migration.tag": tag,
|
|
808
|
+
"app.db.migration.attempt": attempt
|
|
809
|
+
});
|
|
810
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_DELAY_MS));
|
|
811
|
+
}
|
|
812
|
+
}
|
|
774
813
|
/**
|
|
775
814
|
* Apply pending Drizzle migrations, each in its own transaction.
|
|
776
815
|
*
|
|
@@ -778,6 +817,7 @@ const juniorSqlSchema = {
|
|
|
778
817
|
* (drizzle-orm#3249), so locks from earlier migrations stay held while later
|
|
779
818
|
* migrations wait for theirs. That can deadlock with live traffic. This keeps
|
|
780
819
|
* Drizzle's journal table and skip rule, so existing databases are unaffected.
|
|
820
|
+
* A migration that waits too long for a lock rolls back and runs again.
|
|
781
821
|
*/
|
|
782
822
|
async function applyMigrations(executor, config) {
|
|
783
823
|
const schema = config.migrationsSchema ?? "drizzle";
|
|
@@ -788,9 +828,12 @@ async function applyMigrations(executor, config) {
|
|
|
788
828
|
const appliedAt = Number(last?.createdAt ?? 0);
|
|
789
829
|
for (const migration of readMigrationFiles(config)) {
|
|
790
830
|
if (migration.folderMillis <= appliedAt) continue;
|
|
791
|
-
await
|
|
792
|
-
|
|
793
|
-
|
|
831
|
+
await retryOnLockTimeout(String(migration.folderMillis), async () => {
|
|
832
|
+
await executor.transaction(async () => {
|
|
833
|
+
await executor.execute(`SET LOCAL lock_timeout = ${LOCK_TIMEOUT_MS}`);
|
|
834
|
+
for (const statement of migration.sql) await executor.execute(statement);
|
|
835
|
+
await executor.execute(`INSERT INTO ${table} (hash, created_at) VALUES ($1, $2)`, [migration.hash, migration.folderMillis]);
|
|
836
|
+
});
|
|
794
837
|
});
|
|
795
838
|
}
|
|
796
839
|
}
|
|
@@ -992,14 +1035,16 @@ var NeonExecutor = class {
|
|
|
992
1035
|
};
|
|
993
1036
|
/** Create the shared Neon-backed Junior SQL executor. */
|
|
994
1037
|
function createNeonJuniorSqlExecutor(args) {
|
|
1038
|
+
const { onInfo, ...poolArgs } = args;
|
|
995
1039
|
const dispatcher = new Agent({ allowH2: true });
|
|
996
1040
|
const pool = new OverflowPool({
|
|
997
|
-
...
|
|
1041
|
+
...poolArgs,
|
|
998
1042
|
dispatcher
|
|
999
1043
|
});
|
|
1000
1044
|
pool.on("error", (error) => {
|
|
1001
1045
|
logException(error, "db.pool.client.failed", { "app.db.driver": "neon" });
|
|
1002
1046
|
});
|
|
1047
|
+
if (onInfo) forwardInfoMessages(pool, onInfo);
|
|
1003
1048
|
return new NeonExecutor(pool, dispatcher);
|
|
1004
1049
|
}
|
|
1005
1050
|
// src/db/postgres.ts
|
|
@@ -1117,6 +1162,7 @@ function createPostgresJuniorSqlExecutor(args) {
|
|
|
1117
1162
|
pool.on("error", (error) => {
|
|
1118
1163
|
logException(error, "db.pool.client.failed", { "app.db.driver": "postgres" });
|
|
1119
1164
|
});
|
|
1165
|
+
if (args.onInfo) forwardInfoMessages(pool, args.onInfo);
|
|
1120
1166
|
return new PostgresExecutor(pool);
|
|
1121
1167
|
}
|
|
1122
1168
|
// src/db/executor.ts
|
|
@@ -1125,10 +1171,12 @@ function createJuniorSqlExecutor(args) {
|
|
|
1125
1171
|
const statementTimeoutMs = args.statementTimeoutMs ?? 3e4;
|
|
1126
1172
|
if (args.driver === "postgres") return createPostgresJuniorSqlExecutor({
|
|
1127
1173
|
connectionString: args.connectionString,
|
|
1174
|
+
onInfo: args.onInfo,
|
|
1128
1175
|
statementTimeoutMs
|
|
1129
1176
|
});
|
|
1130
1177
|
return createNeonJuniorSqlExecutor({
|
|
1131
1178
|
connectionString: args.connectionString,
|
|
1179
|
+
onInfo: args.onInfo,
|
|
1132
1180
|
statementTimeoutMs
|
|
1133
1181
|
});
|
|
1134
1182
|
}
|