@sentry/junior 0.269.0 → 0.271.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/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
- package/dist/{adapter-2-CG25be.js → adapter-Bqbtr1RV.js} +1 -1
- package/dist/{admin-DSs8S5Uy.js → admin-CWBjzyN0.js} +1 -1
- package/dist/{agent-runner-CrDrPUtY.js → agent-runner-BiHsH8O_.js} +1174 -262
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +70 -38
- package/dist/{app-BrMMzjYm.d.ts → app-C81xfpNa.d.ts} +9 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +84 -37
- package/dist/{interruption-marker-g6Xup3Fk.js → assistant-reply-DgtX9DaJ.js} +2 -8
- package/dist/{automation-p87hg_AV.js → automation-Dwh_xcqM.js} +1 -1
- package/dist/{briefs-PtODdLNu.js → briefs-0FeSJHQ3.js} +5 -5
- package/dist/{catalog-runtime-BsoSmTM0.js → catalog-runtime-Bw9kjGVu.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Cqf4TboL.js → client-B0jlQSgO.js} +13 -3
- package/dist/{config-CPsE4T5L.js → config-DrAeD8sr.js} +3 -3
- package/dist/{connections-upFXLmhG.js → connections-BzN2K0G9.js} +10 -10
- package/dist/{conversation-CTpD_PGk.js → conversation-AhOVzN_k.js} +5 -3
- package/dist/{conversation-privacy-D6zJc8ff.js → conversation-privacy-D1NhUxyo.js} +1 -1
- package/dist/{credential-sync-CS_6IC-f.js → credential-sync-DpNWl4yy.js} +15 -15
- package/dist/{credentialed-BU-OW7HP.js → credentialed-mh7HBqey.js} +51 -39
- package/dist/{db-BzOCzVb1.d.ts → db-DSabI7jJ.d.ts} +1 -1
- package/dist/{executor-CNS7ONt-.js → executor-C2cRw0hZ.js} +7 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DI-k-Bbk.js → job-queue-CEeLYkSj.js} +2 -2
- package/dist/{list-CGoQdXTp.js → list-DjJJ5K0x.js} +168 -36
- package/dist/{logging-n7knse-O.js → logging-DuwXUuIY.js} +1 -1
- package/dist/{media-85PDJxO_.js → media-U6Tuz6Mi.js} +1 -1
- package/dist/{message-BpaWd8TT.js → message-CRe3WBKc.js} +4 -4
- package/dist/{model-profile-Bg8EoCKD.js → model-profile-B998sjVd.js} +9 -2
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +5 -3
- package/dist/{oauth-callback-server-CpGmEw_i.js → oauth-callback-server-oM5TJt34.js} +2 -2
- package/dist/{prompt-BlQB0QQt.js → prompt-BPSdXYXV.js} +1 -1
- package/dist/{registry-By36_xsm.js → registry-BPtbAVFo.js} +2 -2
- package/dist/{reporting-window-CVarfId9.js → reporting-window-DgHgwQB3.js} +16 -2
- package/dist/{resolve-CUIBcdPd.js → resolve-D44G1jJm.js} +3 -3
- package/dist/{result-BemsOMOO.js → result-CvP8c5bb.js} +10 -10
- package/dist/{runner-BVok7PAA.js → runner-FIGIKvk2.js} +11 -11
- package/dist/{sandbox-egress-signals-BSUWQI95.js → sandbox-egress-signals-C_JzucwP.js} +1 -1
- package/dist/{schema-ChnFo5f2.js → schema-DKZgO-xf.js} +12 -7
- package/dist/{schema-jK4-1u_H.d.ts → schema-DPCvePop.d.ts} +37 -3
- package/dist/{service-account-hMmESDcr.js → service-account-1mJGRAvx.js} +3 -3
- package/dist/{service-account-DHvlLnZw.js → service-account-CHO3YXpt.js} +3 -3
- package/dist/{session-stop-BQW_iFcd.js → session-stop-DuUB1rwQ.js} +51 -141
- package/dist/{skills-DmJJIuLF.js → skills-DHK7L9Eo.js} +2 -2
- package/dist/{spawn-ChCm46i-.js → spawn-CKl_ySIq.js} +2 -2
- package/dist/{store-DCo2n5iJ.js → store-BF2XEeQz.js} +3 -3
- package/dist/{store-1DVhoKOL.js → store-Di0E4EvU.js} +4 -4
- package/dist/{task-queue-HMC4QjFm.js → task-queue-CC7IFtbT.js} +3 -3
- package/dist/{task-runner-cA6yjn_E.js → task-runner-DKZtMFwa.js} +8 -8
- package/dist/{thread-state-CHy8LS0C.js → thread-state-BQ1T3eeF.js} +5 -5
- package/dist/{turn-failure-response-Dr7erLWs.js → turn-failure-response-B5eSFoHn.js} +15 -10
- package/dist/{turn-lifecycle-bf2fIYi_.js → turn-lifecycle-CTLEIEOn.js} +1 -1
- package/dist/{turn-session-routing-BqO0qXLk.js → turn-session-routing-BFVp8TbU.js} +26 -19
- package/dist/{validation-DHR1ivfh.js → validation-Cjo-3yt3.js} +1 -1
- package/dist/{version-CXCHLgWm.js → version-D30MBLLw.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DSbD6DF6.js → viewer-D3jhuP66.js} +27 -12
- package/dist/{work-BE_qTYGi.js → work-CL9QwQcl.js} +11 -11
- package/dist/{worker-Cm9_sWXg.js → worker-S2P7IJDI.js} +6 -6
- package/migrations/0071_review_item_turn.sql +1 -0
- package/migrations/AGENTS.md +3 -12
- package/migrations/meta/0071_snapshot.json +4003 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -4
package/dist/app.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { B as readScheduledAutomation,
|
|
2
|
-
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-
|
|
3
|
-
import { A as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as withSpan, L as GOOGLE_IDENTITY_PROVIDER, N as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as normalizeIdentityEmail } from "./logging-
|
|
1
|
+
import { B as readScheduledAutomation, G as blockEventAutomation, Gr as setExperimentalFeatures, H as saveScheduledAutomationInLock, Ir as SubscribedReplyReason, Jn as hasRunnableConversationWork, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, Mn as CONVERSATION_WORK_STALE_ENQUEUE_MS, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, Ur as getExperimentalFeatures, W as withScheduledAutomationLock, Wr as isExperimentalFeatureEnabled, Wt as appendConversationMessages, Xn as isInvalidConversationRecordError, Xr as getConfigDefaults, Xt as settleConversationTitleWork, Y as findMatchingEventAutomations, Zr as setConfigDefaults, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, qt as projectConversationMessages, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed, zr as getThreadStopDecision } from "./turn-session-routing-BFVp8TbU.js";
|
|
2
|
+
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-DrAeD8sr.js";
|
|
3
|
+
import { A as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as withSpan, L as GOOGLE_IDENTITY_PROVIDER, N as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as normalizeIdentityEmail } from "./logging-DuwXUuIY.js";
|
|
4
4
|
import { n as captureMessage } from "./sentry-MDkYAVPV.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
6
|
-
import { f as parseSlackTeamId, g as
|
|
7
|
-
import { C as getSqlExecutor, M as resolveActorIdentityId, O as withConversationMutationLock, R as recordGoogleSignIn, S as getDb, T as withConversationEventLock, _ as closeDb, g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-D30MBLLw.js";
|
|
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-B4DYygOB.js";
|
|
7
|
+
import { C as getSqlExecutor, M as resolveActorIdentityId, O as withConversationMutationLock, R as recordGoogleSignIn, S as getDb, T as withConversationEventLock, _ as closeDb, g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
|
|
8
8
|
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
9
|
-
import { c as juniorReviewItems, d as juniorAutomations, g as juniorConversationBriefs, l as juniorAutomationRuns, y as juniorConversationEvents } from "./executor-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import {
|
|
12
|
-
import { At as slackEntitySchema, Bn as getDashboardTaskLink, Bt as clearSandboxEgressSignals, Cr as resolveRootVisibility, Dn as getSlackClient, Er as listConversationAnnotations, Fn as runWithWorkspaceTeamId, Ht as consumeSandboxEgressPermissionDeniedSignal, Ln as getDashboardConversationLink, M as canActOnReviewItem, Pn as getWorkspaceTeamId, S as dismissOpenReviewItems, Tt as postSlackEphemeralMessage, Vn as setDashboardConversationLinkOptions, Vt as consumeSandboxEgressAuthRequiredSignal, Wt as parseSandboxEgressCredentialToken, Xt as normalizeSandboxEgressTracePropagationDomains, _n as bindScheduledAutomationCredentialSubject, ar as createPluginLogger, bn as verifyScheduledAutomationCredentialSubject, c as getPluginRoutes, cn as collectEventMatchKeys, ct as proxyVercelSandboxEgressRequest, fn as findMatchingWatches, ft as resolveBaseUrl, gn as bindEventAutomationCredentialSubject, h as validatePlugins, hn as takeDueTimerWatches, jr as createPluginCache, jt as slackExternalRefIdSchema, kn as isDmChannel, m as setPlugins, n as createUserTokenStore, nr as createPluginState, or as readConversationAccessFromSql, p as getPlugins, s as getPluginApiRoutes, st as isVercelSandboxEgressRequest, v as setBriefsConfig, vn as bindSlackDirectCredentialSubject, vt as slackMention, wt as openSlackModal, xn as verifySlackDirectCredentialSubject, yn as verifyEventAutomationCredentialSubject } from "./credentialed-
|
|
9
|
+
import { c as juniorReviewItems, d as juniorAutomations, g as juniorConversationBriefs, l as juniorAutomationRuns, y as juniorConversationEvents } from "./executor-C2cRw0hZ.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
|
|
11
|
+
import { $ as effectiveTaskOutcomes, A as verifySlackSignature, C as syncReviewItemSlackCards, D as parseSlackReviewItemFormTarget, E as parseSlackReviewItemClick, I as joinPublicChannel, O as parseSlackUserInputSubmission, R as logScheduledAutomationRunSkipped, S as readSlackReviewItemCardConversationId, T as buildSlackReviewItemModal, Tt as ingestEvent, Y as readViewerAutomationSummary, _ as unpublishedArtifactHeaders, _t as stopConversationSession, at as conversationTurnIdForMessage, ct as recordWebConversationActivity, ft as collectAttachmentGarbage, g as readPublicArtifact, h as publicArtifactHeaders, it as appendAndEnqueueWebMessage, j as parseSlackThreadId, k as runWithSlackInstallation, lt as webActorFromEmail, mt as requestAttachmentDeletion, n as executeAgentRun, nt as renderReviewItemMessage, t as createAgentRunner, tt as deliverReviewItemChange, v as lookupSlackUserProfile, vt as recordSubagentEnded, wt as processWorkspaceSnapshotJob, x as createSlackReviewItemShow, z as scheduledAutomationRunAttributes } from "./agent-runner-BiHsH8O_.js";
|
|
12
|
+
import { At as slackEntitySchema, Bn as getDashboardTaskLink, Bt as clearSandboxEgressSignals, Cr as resolveRootVisibility, Dn as getSlackClient, Er as listConversationAnnotations, Fn as runWithWorkspaceTeamId, Ht as consumeSandboxEgressPermissionDeniedSignal, Ln as getDashboardConversationLink, M as canActOnReviewItem, Pn as getWorkspaceTeamId, S as dismissOpenReviewItems, Tt as postSlackEphemeralMessage, Vn as setDashboardConversationLinkOptions, Vt as consumeSandboxEgressAuthRequiredSignal, Wt as parseSandboxEgressCredentialToken, Xt as normalizeSandboxEgressTracePropagationDomains, _n as bindScheduledAutomationCredentialSubject, ar as createPluginLogger, bn as verifyScheduledAutomationCredentialSubject, c as getPluginRoutes, cn as collectEventMatchKeys, ct as proxyVercelSandboxEgressRequest, fn as findMatchingWatches, ft as resolveBaseUrl, gn as bindEventAutomationCredentialSubject, h as validatePlugins, hn as takeDueTimerWatches, jr as createPluginCache, jt as slackExternalRefIdSchema, kn as isDmChannel, m as setPlugins, n as createUserTokenStore, nr as createPluginState, or as readConversationAccessFromSql, p as getPlugins, rr as createPluginEmbedder, s as getPluginApiRoutes, st as isVercelSandboxEgressRequest, v as setBriefsConfig, vn as bindSlackDirectCredentialSubject, vt as slackMention, wt as openSlackModal, xn as verifySlackDirectCredentialSubject, yn as verifyEventAutomationCredentialSubject } from "./credentialed-mh7HBqey.js";
|
|
13
13
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
14
|
-
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-
|
|
14
|
+
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-Bqbtr1RV.js";
|
|
15
15
|
import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
16
|
-
import { D as conversationSurfaceSchema, I as annotationCard, T as conversationReportStatusSchema, h as conversationFeedQuerySchema } from "./conversation-
|
|
17
|
-
import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-
|
|
18
|
-
import { E as renderSlackObjectCard, S as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-
|
|
19
|
-
import {
|
|
20
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-
|
|
21
|
-
import { a as getVercelConversationWorkQueue, d as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
22
|
-
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-
|
|
23
|
-
import { M as scheduledRunSchema } from "./automation-
|
|
24
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
16
|
+
import { D as conversationSurfaceSchema, I as annotationCard, T as conversationReportStatusSchema, h as conversationFeedQuerySchema } from "./conversation-AhOVzN_k.js";
|
|
17
|
+
import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-Di0E4EvU.js";
|
|
18
|
+
import { E as renderSlackObjectCard, S as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-DuUB1rwQ.js";
|
|
19
|
+
import { h as buttonUserInputField } from "./reporting-window-DgHgwQB3.js";
|
|
20
|
+
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-D44G1jJm.js";
|
|
21
|
+
import { a as getVercelConversationWorkQueue, d as getQueueProvider, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CEeLYkSj.js";
|
|
22
|
+
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-BF2XEeQz.js";
|
|
23
|
+
import { M as scheduledRunSchema } from "./automation-Dwh_xcqM.js";
|
|
24
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Cjo-3yt3.js";
|
|
25
25
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
|
|
26
|
-
import { A as stopSlackThread, B as actOnReviewItem, C as isAllowedSignInEmail, D as buildSlackInboundMessage, E as recordSkippedConversationMessage, F as bindMessageAuthorIdentityId, H as readReviewItemForUser, I as startProcessingReaction, K as enqueueAgentDispatch, L as stripLeadingBotMention, M as withNormalizedThreadId, N as stopConversationTurn, O as clearSlackPendingReactions, P as THREAD_OPTOUT_ACK, R as parseContent, S as isAllowedDomain, T as resolveAllowedDomains, U as reviewItemChange, V as closeReviewItemsAnsweredByReply, W as getAttachmentStorage, _ as createProductionConversationWorkOptions, b as createSlackWebApiStatusSender, j as normalizeIncomingSlackThreadId, k as isSlackMessageStopped, q as GET$3, t as readConversationFeed, v as createProductionSlackWebhookServices, w as readEnvList, x as assertNoLegacyAllowedDomains, y as getProductionSlackAdapter, z as ReviewItemActionError } from "./list-
|
|
27
|
-
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-
|
|
28
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
29
|
-
import { o as coerceThreadConversationState } from "./thread-state-
|
|
30
|
-
import { o as unlinkProvider } from "./connections-
|
|
31
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
32
|
-
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-
|
|
33
|
-
import { t as processConversationWork } from "./worker-
|
|
34
|
-
import { t as bindMessageAgent } from "./message-
|
|
35
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
36
|
-
import { t as processPluginTask } from "./task-runner-
|
|
26
|
+
import { A as stopSlackThread, B as actOnReviewItem, C as isAllowedSignInEmail, D as buildSlackInboundMessage, E as recordSkippedConversationMessage, F as bindMessageAuthorIdentityId, H as readReviewItemForUser, I as startProcessingReaction, K as enqueueAgentDispatch, L as stripLeadingBotMention, M as withNormalizedThreadId, N as stopConversationTurn, O as clearSlackPendingReactions, P as THREAD_OPTOUT_ACK, R as parseContent, S as isAllowedDomain, T as resolveAllowedDomains, U as reviewItemChange, V as closeReviewItemsAnsweredByReply, W as getAttachmentStorage, _ as createProductionConversationWorkOptions, b as createSlackWebApiStatusSender, j as normalizeIncomingSlackThreadId, k as isSlackMessageStopped, q as GET$3, t as readConversationFeed, v as createProductionSlackWebhookServices, w as readEnvList, x as assertNoLegacyAllowedDomains, y as getProductionSlackAdapter, z as ReviewItemActionError } from "./list-DjJJ5K0x.js";
|
|
27
|
+
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-CvP8c5bb.js";
|
|
28
|
+
import { r as enqueueAgentInvocation } from "./work-CL9QwQcl.js";
|
|
29
|
+
import { o as coerceThreadConversationState } from "./thread-state-BQ1T3eeF.js";
|
|
30
|
+
import { o as unlinkProvider } from "./connections-BzN2K0G9.js";
|
|
31
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-DpNWl4yy.js";
|
|
32
|
+
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-CC7IFtbT.js";
|
|
33
|
+
import { t as processConversationWork } from "./worker-S2P7IJDI.js";
|
|
34
|
+
import { t as bindMessageAgent } from "./message-CRe3WBKc.js";
|
|
35
|
+
import { t as bindSpawnAgent } from "./spawn-CKl_ySIq.js";
|
|
36
|
+
import { t as processPluginTask } from "./task-runner-DKZtMFwa.js";
|
|
37
37
|
import { createRequire } from "node:module";
|
|
38
38
|
import { Hono } from "hono";
|
|
39
39
|
import { z } from "zod";
|
|
@@ -270,6 +270,7 @@ function createHeartbeatContext(args) {
|
|
|
270
270
|
cache: createPluginCache(pluginName),
|
|
271
271
|
nowMs: args.nowMs,
|
|
272
272
|
db: getDb(),
|
|
273
|
+
embedder: createPluginEmbedder(pluginName),
|
|
273
274
|
state: createPluginState(pluginName),
|
|
274
275
|
log: createPluginLogger(pluginName),
|
|
275
276
|
agent: {
|
|
@@ -2078,6 +2079,27 @@ async function handleSlackForm(args) {
|
|
|
2078
2079
|
})));
|
|
2079
2080
|
return new Response("", { status: 200 });
|
|
2080
2081
|
}
|
|
2082
|
+
// src/chat/ingress/slack-channel-created.ts
|
|
2083
|
+
const slackChannelCreatedEnvelopeSchema = z.object({
|
|
2084
|
+
type: z.literal("event_callback"),
|
|
2085
|
+
team_id: z.string().optional(),
|
|
2086
|
+
enterprise_id: z.string().optional(),
|
|
2087
|
+
is_enterprise_install: z.boolean().optional(),
|
|
2088
|
+
event: z.object({
|
|
2089
|
+
type: z.literal("channel_created"),
|
|
2090
|
+
channel: z.looseObject({ id: slackChannelIdSchema })
|
|
2091
|
+
})
|
|
2092
|
+
});
|
|
2093
|
+
/** Join a newly created public channel for the installation that sent it. */
|
|
2094
|
+
async function joinCreatedSlackChannel(args) {
|
|
2095
|
+
await args.state.connect();
|
|
2096
|
+
await runWithWorkspaceTeamId(args.installation.teamId, () => runWithSlackInstallation({
|
|
2097
|
+
adapter: args.adapter,
|
|
2098
|
+
installation: args.installation,
|
|
2099
|
+
state: args.state,
|
|
2100
|
+
task: () => joinPublicChannel(args.channelId)
|
|
2101
|
+
}));
|
|
2102
|
+
}
|
|
2081
2103
|
// src/chat/ingress/bot-mention.ts
|
|
2082
2104
|
/**
|
|
2083
2105
|
* Detect Slack bot @mentions that should activate Junior.
|
|
@@ -2806,10 +2828,10 @@ async function routeParsedMessage(args) {
|
|
|
2806
2828
|
try {
|
|
2807
2829
|
await persist();
|
|
2808
2830
|
} catch (error) {
|
|
2809
|
-
if (error instanceof SlackEventPersistenceError && error.saved)
|
|
2831
|
+
if (error instanceof SlackEventPersistenceError && error.saved) args.runAfterUnlock(closeAnswered);
|
|
2810
2832
|
throw error;
|
|
2811
2833
|
}
|
|
2812
|
-
|
|
2834
|
+
args.runAfterUnlock(closeAnswered);
|
|
2813
2835
|
}
|
|
2814
2836
|
async function handleSlackEvent(args) {
|
|
2815
2837
|
const event = args.body.event;
|
|
@@ -2887,6 +2909,7 @@ async function handleSlackEvent(args) {
|
|
|
2887
2909
|
setSpanAttributes({ "app.slack.membership": member ? "verified" : "unverified" });
|
|
2888
2910
|
if (!member) return;
|
|
2889
2911
|
const message = adapter.parseMessage(event);
|
|
2912
|
+
let afterUnlock;
|
|
2890
2913
|
if (!(await withLock(state, `slack:ingress:${normalizeMessageThreadId(message).threadId}`, () => routeParsedMessage({
|
|
2891
2914
|
adapter,
|
|
2892
2915
|
event,
|
|
@@ -2897,11 +2920,14 @@ async function handleSlackEvent(args) {
|
|
|
2897
2920
|
receivedAtMs,
|
|
2898
2921
|
allowedBotUserIds: args.services.allowedBotUserIds ?? [],
|
|
2899
2922
|
allowedDomains: args.services.allowedDomains ?? [],
|
|
2923
|
+
runAfterUnlock: (task) => {
|
|
2924
|
+
afterUnlock = task;
|
|
2925
|
+
},
|
|
2900
2926
|
state
|
|
2901
2927
|
}), {
|
|
2902
2928
|
keepAlive: true,
|
|
2903
2929
|
waitMs: 1e4
|
|
2904
|
-
})).acquired) throw new Error("Could not acquire Slack ingress lock");
|
|
2930
|
+
}).finally(() => afterUnlock?.())).acquired) throw new Error("Could not acquire Slack ingress lock");
|
|
2905
2931
|
}
|
|
2906
2932
|
}
|
|
2907
2933
|
}));
|
|
@@ -2970,7 +2996,26 @@ async function handleSlackWebhook(args) {
|
|
|
2970
2996
|
waitUntil: args.waitUntil
|
|
2971
2997
|
});
|
|
2972
2998
|
}
|
|
2973
|
-
const
|
|
2999
|
+
const json = parseJson(body);
|
|
3000
|
+
const channelCreated = slackChannelCreatedEnvelopeSchema.safeParse(json);
|
|
3001
|
+
if (channelCreated.success) {
|
|
3002
|
+
if (args.services.autoJoinNewChannels) {
|
|
3003
|
+
const channelId = channelCreated.data.event.channel.id;
|
|
3004
|
+
enqueue(args.waitUntil, withLogContext({
|
|
3005
|
+
platform: "slack",
|
|
3006
|
+
destinationName: channelId
|
|
3007
|
+
}, () => joinCreatedSlackChannel({
|
|
3008
|
+
adapter,
|
|
3009
|
+
channelId,
|
|
3010
|
+
installation: installationFromEnvelope(channelCreated.data),
|
|
3011
|
+
state: args.services.state ?? getStateAdapter()
|
|
3012
|
+
}).catch((error) => {
|
|
3013
|
+
logException(error, "slack.channel.auto_join.failed");
|
|
3014
|
+
})));
|
|
3015
|
+
}
|
|
3016
|
+
return new Response("ok", { status: 200 });
|
|
3017
|
+
}
|
|
3018
|
+
const result = slackEventEnvelopeSchema.safeParse(json);
|
|
2974
3019
|
if (!result.success) return new Response("Invalid JSON", { status: 400 });
|
|
2975
3020
|
const parsed = result.data;
|
|
2976
3021
|
if (parsed.type === "url_verification") return Response.json({ challenge: parsed.challenge });
|
|
@@ -6132,6 +6177,7 @@ function createBetterAuth(config) {
|
|
|
6132
6177
|
hd: hostedDomain,
|
|
6133
6178
|
prompt: "select_account",
|
|
6134
6179
|
disableIdTokenSignIn: true,
|
|
6180
|
+
overrideUserInfoOnSignIn: true,
|
|
6135
6181
|
async getUserInfo(token) {
|
|
6136
6182
|
if (!token.idToken) return null;
|
|
6137
6183
|
const claims = readGoogleClaims(token.idToken);
|
|
@@ -6141,7 +6187,7 @@ function createBetterAuth(config) {
|
|
|
6141
6187
|
user: {
|
|
6142
6188
|
email: claims.email,
|
|
6143
6189
|
emailVerified: claims.email_verified === true,
|
|
6144
|
-
image: claims.picture,
|
|
6190
|
+
image: claims.picture ?? null,
|
|
6145
6191
|
name: claims.name
|
|
6146
6192
|
},
|
|
6147
6193
|
data: claims
|
|
@@ -6685,7 +6731,8 @@ async function createApp(options) {
|
|
|
6685
6731
|
services: runtimeServiceOverrides
|
|
6686
6732
|
}),
|
|
6687
6733
|
allowedBotUserIds: options?.slack?.allowedBotUserIds ?? [],
|
|
6688
|
-
allowedDomains
|
|
6734
|
+
allowedDomains,
|
|
6735
|
+
autoJoinNewChannels: options?.slack?.autoJoinNewChannels === true
|
|
6689
6736
|
};
|
|
6690
6737
|
const app = new Hono();
|
|
6691
6738
|
app.onError((err, c) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _r as extractAssistantText } from "./turn-session-routing-BFVp8TbU.js";
|
|
2
2
|
// src/chat/no-reply.ts
|
|
3
3
|
const NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
4
4
|
/**
|
|
@@ -40,10 +40,4 @@ function getAssistantReplyText(message) {
|
|
|
40
40
|
const decision = decideReply(message);
|
|
41
41
|
return decision.kind === "deliver" ? decision.text : void 0;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
|
|
45
|
-
/** Return the marker added when a visible reply ended mid-execution. */
|
|
46
|
-
function getInterruptionMarker() {
|
|
47
|
-
return INTERRUPTED_MARKER;
|
|
48
|
-
}
|
|
49
|
-
export { NO_REPLY_MARKER as a, sanitizeAssistantText as i, decideReply as n, isNoReplyMarker as o, getAssistantReplyText as r, getInterruptionMarker as t };
|
|
43
|
+
export { isNoReplyMarker as a, NO_REPLY_MARKER as i, getAssistantReplyText as n, sanitizeAssistantText as r, decideReply as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
|
-
import { n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { n as actorIdentitySchema } from "./conversation-AhOVzN_k.js";
|
|
3
3
|
import { 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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { G as briefCodeChangeSchema, Y as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
1
|
+
import { i as completeObject } from "./client-B0jlQSgO.js";
|
|
2
|
+
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
3
|
+
import { G as briefCodeChangeSchema, Y as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-AhOVzN_k.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BPSdXYXV.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
267
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
268
|
*/
|
|
269
269
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-DrAeD8sr.js").then((n) => n.r);
|
|
271
271
|
return defaultModelId(botConfig);
|
|
272
272
|
}
|
|
273
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-BPtbAVFo.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-BiHsH8O_.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-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
-
import("../credentialed-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../credentialed-mh7HBqey.js").then((n) => n.a),
|
|
103
|
+
import("../catalog-runtime-Bw9kjGVu.js").then((n) => n.t),
|
|
104
|
+
import("../validation-Cjo-3yt3.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-D3jhuP66.js").then((n) => n.v)
|
|
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("../credentialed-
|
|
155
|
+
const { setBriefsConfig } = await import("../credentialed-mh7HBqey.js").then((n) => n._);
|
|
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-FIGIKvk2.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-oM5TJt34.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.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 { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C_JzucwP.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-CKl_ySIq.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-CRe3WBKc.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-CvP8c5bb.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-DuUB1rwQ.js").then((n) => n.r);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-S2P7IJDI.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 { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DuwXUuIY.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BPtbAVFo.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DHK7L9Eo.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.js
CHANGED
|
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-CWBjzyN0.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
31
|
+
return await (await import("../service-account-1mJGRAvx.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-0FeSJHQ3.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as getDb } from "../viewer-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { S as getDb } from "../viewer-D3jhuP66.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-Bw9kjGVu.js";
|
|
3
|
+
import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-mh7HBqey.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Cjo-3yt3.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.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 { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { nt as create } from "../credentialed-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-Bw9kjGVu.js";
|
|
2
|
+
import { nt as create } from "../credentialed-mh7HBqey.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-Bqbtr1RV.js";
|
|
4
|
+
import { n as resolve } from "../resolve-D44G1jJm.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
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-DrAeD8sr.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-C2cRw0hZ.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-BPtbAVFo.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DuwXUuIY.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D1NhUxyo.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -415,7 +415,10 @@ const EMBEDDING_INPUT_COST_USD_PER_MILLION_TOKENS = {
|
|
|
415
415
|
"openai/text-embedding-3-small": .02,
|
|
416
416
|
"openai/text-embedding-ada-002": .1,
|
|
417
417
|
"voyage/voyage-3.5": .06,
|
|
418
|
-
"voyage/voyage-3.5-lite": .02
|
|
418
|
+
"voyage/voyage-3.5-lite": .02,
|
|
419
|
+
"voyage/voyage-4": .06,
|
|
420
|
+
"voyage/voyage-4-large": .12,
|
|
421
|
+
"voyage/voyage-4-lite": .02
|
|
419
422
|
};
|
|
420
423
|
const DECISION_INPUT_COST_USD_PER_MILLION_TOKENS = {
|
|
421
424
|
"openai/gpt-6-luna-decisions": .1,
|
|
@@ -658,17 +661,24 @@ async function completeDecision(params) {
|
|
|
658
661
|
});
|
|
659
662
|
}
|
|
660
663
|
}
|
|
664
|
+
/** Map the input type to the provider option for models that embed queries and documents differently. */
|
|
665
|
+
function embeddingProviderOptions(modelId, inputType) {
|
|
666
|
+
if (inputType === void 0 || !modelId.startsWith("voyage/")) return;
|
|
667
|
+
return { voyage: { inputType } };
|
|
668
|
+
}
|
|
661
669
|
/** Generate text embeddings through the host-owned AI Gateway provider. */
|
|
662
670
|
async function embedTexts(params) {
|
|
663
671
|
const texts = params.texts.map((text) => text.trim());
|
|
664
672
|
if (texts.length === 0 || texts.some((text) => text.length === 0)) throw new Error("Embedding text is required.");
|
|
665
673
|
const credential = await resolveGatewayCredential();
|
|
666
674
|
const provider = createGatewayProvider({ apiKey: credential.token });
|
|
675
|
+
const providerOptions = embeddingProviderOptions(params.modelId, params.inputType);
|
|
667
676
|
try {
|
|
668
677
|
const result = await withSpan(`${GEN_AI_OPERATION_EMBEDDINGS} ${params.modelId}`, "gen_ai.embeddings", logContextFromMetadata(params.modelId, params.metadata), async (setSpanAttributes) => {
|
|
669
678
|
const result = await embedMany({
|
|
670
679
|
model: provider.embeddingModel(params.modelId),
|
|
671
680
|
values: texts,
|
|
681
|
+
...providerOptions !== void 0 ? { providerOptions } : void 0,
|
|
672
682
|
...params.signal !== void 0 ? { abortSignal: params.signal } : void 0
|
|
673
683
|
});
|
|
674
684
|
const dimensions = result.embeddings[0]?.length;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
4
|
-
import {
|
|
2
|
+
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-B0jlQSgO.js";
|
|
3
|
+
import { h as logWarn } from "./logging-DuwXUuIY.js";
|
|
4
|
+
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
7
7
|
function readRequiredSetting(env, name) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-
|
|
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-
|
|
7
|
-
import { pt as startOAuthFlow } from "./credentialed-
|
|
8
|
-
import { r as getStateAdapter } from "./adapter-
|
|
9
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
10
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
1
|
+
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BFVp8TbU.js";
|
|
2
|
+
import { n as botConfig } from "./config-DrAeD8sr.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-BPtbAVFo.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-BiHsH8O_.js";
|
|
7
|
+
import { pt as startOAuthFlow } from "./credentialed-mh7HBqey.js";
|
|
8
|
+
import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
|
|
9
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CEeLYkSj.js";
|
|
10
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-BF2XEeQz.js";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-
|
|
1
|
+
import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-U6Tuz6Mi.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
// src/chat/briefs/schema.ts
|
|
@@ -313,6 +313,8 @@ const conversationPendingMessageSchema = z.object({
|
|
|
313
313
|
role: z.literal("user"),
|
|
314
314
|
source: z.enum(["slack", "web"]),
|
|
315
315
|
text: z.string().optional(),
|
|
316
|
+
/** People mentioned in the text, resolved at read time. */
|
|
317
|
+
mentions: z.array(actorIdentitySchema).optional(),
|
|
316
318
|
attachments: z.array(messageAttachmentSchema).optional(),
|
|
317
319
|
redacted: z.literal(true).optional()
|
|
318
320
|
}).strict().superRefine((data, context) => {
|
|
@@ -320,9 +322,9 @@ const conversationPendingMessageSchema = z.object({
|
|
|
320
322
|
code: "custom",
|
|
321
323
|
message: "pending message content must be text or explicitly redacted"
|
|
322
324
|
});
|
|
323
|
-
if (data.redacted && (data.actorIdentity || data.attachments)) context.addIssue({
|
|
325
|
+
if (data.redacted && (data.actorIdentity || data.attachments || data.mentions)) context.addIssue({
|
|
324
326
|
code: "custom",
|
|
325
|
-
message: "redacted pending messages must not expose actor identity or
|
|
327
|
+
message: "redacted pending messages must not expose actor identity, attachments, or mentions"
|
|
326
328
|
});
|
|
327
329
|
});
|
|
328
330
|
/** Participant-only authorization prompt for a parked web turn. */
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-
|
|
2
|
-
import { p as escapeXml } from "./client-
|
|
3
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
4
|
-
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
5
|
-
import { p as parseSlackUserId } from "./actor-
|
|
6
|
-
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-
|
|
1
|
+
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-BFVp8TbU.js";
|
|
2
|
+
import { p as escapeXml } from "./client-B0jlQSgO.js";
|
|
3
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-DrAeD8sr.js";
|
|
4
|
+
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DuwXUuIY.js";
|
|
5
|
+
import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
|
|
6
|
+
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-D3jhuP66.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-DJBompdd.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-
|
|
12
|
-
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BPtbAVFo.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-DHK7L9Eo.js";
|
|
11
|
+
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-BiHsH8O_.js";
|
|
12
|
+
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-mh7HBqey.js";
|
|
13
13
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { r as getStateAdapter } from "./adapter-
|
|
15
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
16
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
17
|
-
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-
|
|
14
|
+
import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
|
|
15
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-CHO3YXpt.js";
|
|
16
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BQ1T3eeF.js";
|
|
17
|
+
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-BzN2K0G9.js";
|
|
18
18
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { z } from "zod";
|