@sentry/junior 0.321.0 → 0.322.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-BkDQYdg6.js → adapter-CKtEUuWD.js} +23 -2
- package/dist/{admin-XS3G9BOj.js → admin-BGOiUGwR.js} +1 -1
- package/dist/{agent-CL9ZkOgx.js → agent-OUkEw6Bv.js} +272 -1647
- package/dist/{agent-status-Bq_AIpyp.js → agent-status-C_HHxO_d.js} +1 -10
- package/dist/{agent-update-delivery-t0bXEgPs.js → agent-update-delivery-H6mnPI4q.js} +4 -4
- package/dist/api/schema.d.ts +98 -6
- package/dist/api/schema.js +6 -6
- package/dist/api.js +81 -36
- package/dist/{app-CwFRvmEH.d.ts → app-BK_vhZIq.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +85 -48
- package/dist/{change-record-CRuG9Mu3.d.ts → change-record-DdrJxahk.d.ts} +26 -10
- package/dist/{channel-access-BUHB0saC.js → channel-access-DRhVJIuQ.js} +1 -1
- package/dist/{chat-core-engine-DuBaPbqK.js → chat-core-engine-El308gYr.js} +5 -10
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +2 -2
- package/dist/{continue-in-slack-D9naZmqM.js → continue-in-slack-DYl631oM.js} +3 -3
- package/dist/{conversation-feed-B1_1NJc8.js → conversation-feed-BUaMmSLi.js} +1 -1
- package/dist/{conversation-privacy-C0mixZKx.js → conversation-privacy-DR_j5Tqf.js} +1 -1
- package/dist/{create-CLV0M1vw.js → create-ZkI-_JAs.js} +2 -2
- package/dist/{credential-sync-DL9r-ry5.js → credential-sync-Bo6_FtCI.js} +12 -12
- package/dist/{db-CbURDbaB.js → db-RDpWIeRK.js} +1733 -213
- package/dist/{deployment-D9uPRDMD.js → deployment-CeKaP0ZJ.js} +1 -1
- package/dist/{html-l4hKICAL.js → html-BMv4fAPu.js} +5 -5
- package/dist/instrumentation.js +2 -2
- package/dist/{list-cGaO9_Hf.js → list-CuLf7Ob2.js} +38 -35
- package/dist/{logging-CqgOoICc.js → logging-BQsfrLHl.js} +1 -1
- package/dist/{markers-BtUv4-oc.js → markers-Bh0vqJ5k.js} +3178 -1748
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -4
- package/dist/{oauth-callback-server-C3GxhsuB.js → oauth-callback-server-BxuN0Jqz.js} +2 -2
- package/dist/{oauth-relay-BGm6sLCB.js → oauth-relay-vyG2gOwY.js} +1 -1
- package/dist/{profile-bLo0h7Le.js → profile-DiAB4QfT.js} +31 -6
- package/dist/{prompt-CX29OGO9.js → prompt-5PDkRQ1K.js} +2 -1
- package/dist/{reports-DeDCCu_H.js → reports-CbqB7unq.js} +2 -2
- package/dist/{resolve-D9RKNH3v.js → resolve-C7e0pwuP.js} +5 -5
- package/dist/{result-BFBwK1M2.js → result-D_D-2Adp.js} +5 -5
- package/dist/{runner-DNdoVQg8.js → runner-CCVTdp0x.js} +7 -7
- package/dist/{sandbox-egress-signals-BBcCiEhm.js → sandbox-egress-signals-D4OKOFgy.js} +1 -1
- package/dist/{schema-RzsplzdI.js → schema-CmPO8BfI.js} +50 -12
- package/dist/{service-account-B7E7OIFP.js → service-account-CeWsFrBi.js} +2 -2
- package/dist/{skills-DMJsS5e4.js → skills-DfbOjWxl.js} +5 -5
- package/dist/{slack-conversation-unfurl-EWYTnBZI.js → slack-conversation-unfurl-BxF0Yb3-.js} +10 -9
- package/dist/{system-prompt-table-C886lsT9.js → system-prompt-table-DySHMtu0.js} +15 -15
- package/dist/{topics-DxuKurCX.js → topic-ChZe9WPj.js} +6 -1
- package/dist/{engine-context-BP0h6u4m.js → turn-ended-DQ10G3in.js} +11 -845
- package/dist/{types-CGgQ3-Bb.js → types-BWAgOJtR.js} +95 -70
- package/dist/{user-customization-CvfuY9Eo.js → user-customization-DNzu_r1x.js} +10 -1
- package/dist/{users-DBrcQl47.js → users-BmZlg_ci.js} +13 -7
- package/dist/{validation-CofUHWqz.js → validation-BU4tXvH3.js} +1 -1
- package/dist/{version-D_vbXyNw.js → version-D9yLYOBu.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-buhFcpl9.js → worker-C7EDSL3d.js} +4 -4
- package/migrations/20261127184420_question_answerer/migration.sql +36 -0
- package/migrations/20261127184420_question_answerer/snapshot.json +108 -0
- package/migrations/20261127224730_inbox_item_close_action/migration.sql +1 -0
- package/migrations/20261127224730_inbox_item_close_action/snapshot.json +42 -0
- package/package.json +6 -6
- package/skills/design-automation-skill/SKILL.md +1 -1
- package/dist/storage-XD0lB4Gk.js +0 -273
- package/dist/topic-B2EWKKBT.js +0 -6
package/dist/app.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { C as parseActorUserId, E as parseSlackChannelId, F as slackMessageTsFromMs, G as loadConfig, I as slackMessageTsSchema, K as parseEnvList, L as botConfig, M as slackTeamIdSchema, P as parseSlackMessageTs, R as getChatConfig, W as installChatConfig, i as getStateAdapter, j as slackChannelIdSchema, l as fenceLock, s as MUTATION_LOCK_TTL_MS, u as withLock, v as createSlackActor } from "./adapter-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { C as withContext, D as GOOGLE_IDENTITY_PROVIDER, T as withSpan, f as logException, k as normalizeIdentityEmail, m as logWarn, n as createRequestContext, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-
|
|
4
|
-
import { $ as
|
|
5
|
-
import { A as createUserTokenStore, C as clearSandboxEgressSignals, D as parseSandboxEgressCredentialToken, P as normalizeSandboxEgressTracePropagationDomains, T as consumeSandboxEgressPermissionDeniedSignal, c as isVercelSandboxEgressRequest, l as proxyVercelSandboxEgressRequest, w as consumeSandboxEgressAuthRequiredSignal } from "./profile-
|
|
6
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
1
|
+
import { C as parseActorUserId, E as parseSlackChannelId, F as slackMessageTsFromMs, G as loadConfig, I as slackMessageTsSchema, K as parseEnvList, L as botConfig, M as slackTeamIdSchema, P as parseSlackMessageTs, R as getChatConfig, W as installChatConfig, i as getStateAdapter, j as slackChannelIdSchema, l as fenceLock, s as MUTATION_LOCK_TTL_MS, u as withLock, v as createSlackActor } from "./adapter-CKtEUuWD.js";
|
|
2
|
+
import { $c as getWorkspaceTeamId, $n as publishTurnEnded, $r as createVercelPluginTaskCallback, $t as getConversation, Af as createAppContext, Bd as backfillConversationEmbeddings, Bn as findStalledTurns, Br as buildSlackInboxItemModal, Cc as isPublicConversation, Ci as readConversationAccessFromSql, Cm as juniorConversationEmbeddings, Cr as runInboxItemPushTimers, Da as slackEntitySchema, Dd as embedConversationEvents, Ed as EVENT_INDEX_LOCK_TTL_MS, Em as juniorTurns, F as conversationCostOf, Hi as getQueueProvider, Hl as itemQuestion, Hp as createSlackDestination, Hr as parseSlackInboxItemFormTarget, Ii as conversationQueueMessageSchema, Im as juniorConversations, Ir as resolveSlackInboxItemCardConversationId, Ji as decodeAnnotationRef, Jr as createPluginEventPublisher, Ki as renderSlackObjectCard, Kt as clearExpiredConversationLease, Li as isConversationQueueMessageRejectedError, Ll as searchInboxItems, Lr as syncInboxItemSlackCards, Mf as installAppContext, Mi as getVercelConversationWorkQueue, Mn as createEngineContext, Ms as takeDueTimerWatches, Na as slackMention, Nd as storeConversationEventLexemes, Ni as resolveConversationWorkTopic, No as existingConversationId, Oa as slackExternalRefIdSchema, Od as eventIndexLockKey, Pi as verifyConversationQueueMessage, Qp as juniorTurnInbox, Qt as ensureConversationWake, Rr as findSlackThreadOwnerId, Rt as appendAndEnqueueInboundMessage, Sa as postSlackEphemeralMessage, Sm as juniorConversationEventEmbeddings, St as validatePlugins, Tm as juniorConversationEvents, To as automationVersionOf, Uc as getSlackClient, Um as juniorDestinations, Vd as createConversationEmbedder, Vp as touchConversationDetail, Vr as parseSlackInboxItemClick, Wo as refreshAutomationLastRun, Wr as parseSlackUserInputSubmission, Xi as verifySlackSignature, Xr as getPluginRoutes, Y as canActOnInboxItem, Yi as runWithSlackInstallation, Yr as getPluginApiRoutes, Z as canAnswerInboxItem, Zo as syncAutomationAlerts, Zp as juniorTurnOutbox, _i as canAddConversationMessages, _n as hasRunnableConversationWork, a as getDb, am as juniorQuestions, ao as listScheduledAutomationsForTeam, at as inboxItemReaderForUser, br as createInboxItemShow, cl as resolveViewerUser, cm as juniorAutomationRuns, cs as slackChannelMessageEvent, dm as juniorAutomations, do as withScheduledAutomationLock, dt as isPluginInboxItem, ec as subjectKey, el as runWithWorkspaceTeamId, en as getConversationWorkState, et as inboxItemAddedByAnyAutomation, eu as parseAvatarUrl, fc as listConversationAnnotations, fl as resolveActorIdentityId, ga as notifyAutomationBlocked, gm as juniorInboxItems, gr as withConversationEventLock, i as getConversationStore, il as readActorIdentity, jf as getAppContext, jl as dismissOpenInboxItems, ku as projectConversationMessages, la as isTerminalDispatchStatus, lo as saveScheduledAutomationInLock, m as deleteMessageLinks, ma as markDispatchFailed, n as getConversationEventStore, ni as sendVercelPluginTask, nn as listActiveConversationIds, o as getSqlExecutor, oa as getDispatchRecord, os as SLACK_EVENT_NAMESPACE, ot as inboxItemReaderForUserInConversation, pn as CONVERSATION_WORK_STALE_ENQUEUE_MS, qi as annotationKeyDigest, qn as publishTurnStep, qs as resumeConversationDelivery, ra as getDispatchConversationId, ri as queueCallback, rr as withSpan, so as readScheduledAutomation, su as deleteExpiredInboxSnoozes, ta as confirmDispatchMailboxAppend, tr as countMetric, u as isPostgresErrorCode, ua as listPendingDispatchMailboxAppends, uo as scheduledRunId, ur as parseSlackThreadId, vm as juniorAgentBindings, vt as inboxItemOwnerConversationId, vu as getDashboardConversationLink, w as withConversationMutationLock, wu as getDashboardTaskLink, xa as openSlackModal, xm as juniorConversationEventLexemes, xn as pruneActiveConversation, xr as pushConversationInboxItemsNow, xt as getRegistrations, yl as recordGoogleSignIn, yn as isInvalidConversationRecordError, yt as inboxItemVisibility, yu as getDashboardInboxItemLink, z as conversationIsActiveSql, zd as isEventEmbeddingsEnabled } from "./db-RDpWIeRK.js";
|
|
3
|
+
import { C as withContext, D as GOOGLE_IDENTITY_PROVIDER, T as withSpan$1, f as logException, k as normalizeIdentityEmail, m as logWarn, n as createRequestContext, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-BQsfrLHl.js";
|
|
4
|
+
import { $ as withNormalizedThreadId, $t as bindSpawnAgent, Bn as readViewerAutomationSummary, C as processWorkspaceSnapshotJob, Dn as unpublishedArtifactHeaders, Dt as readObjectLinkTypes, En as readPublicArtifact, F as markConversationRead, Fn as ViewerTaskNotFoundError, G as createProductionSlackWebhookServices, Gn as missingAutomationSkillReason, Hn as readViewerAutomations, K as getProductionSlackAdapter, Kn as effectiveTaskOutcomes, L as deliverInboxItemChange, Nt as isPublicAddress, Pt as publicAddressLookup, Q as normalizeIncomingSlackThreadId, Rn as readViewerAutomationExecutions, S as createVercelCacheWarmupCallback, St as readLiveAnnotations, T as ingestEvent, Tn as publicArtifactHeaders, Vt as readConversationRecordFromSql, W as createProductionConversationWorkOptions, Wn as findAutomationSkill, X as clearSlackPendingReactions, Y as buildSlackInboundMessage, Z as slackInboundMessageId, _t as createSlackWebApiStatusSender, an as bindMessageAuthorIdentityId, at as processPluginTask, b as vercelBackgroundCompactionQueue, cn as parseContent, dn as getThreadStopDecision, ft as readConversationLastEventSeq, gt as stopConversation, ht as recordSkippedConversationMessage, i as scheduledAutomationRunAttributes, in as createAgentRunner, it as failStoppedDispatch, lt as readConversationEventPage, nn as bindMessageAgent, on as startProcessingReaction, pt as readConversationMessageEventSeq, r as logScheduledAutomationRunSkipped, rt as enqueueAgentDispatch, sn as stripLeadingBotMention, t as executeAgentRun, un as SubscribedReplyReason, ut as readConversationEventPageAfter, w as verifyWorkspaceSnapshotJobMessage, x as verifyBackgroundCompactionMessage, y as processBackgroundCompaction } from "./agent-OUkEw6Bv.js";
|
|
5
|
+
import { A as createUserTokenStore, C as clearSandboxEgressSignals, D as parseSandboxEgressCredentialToken, P as normalizeSandboxEgressTracePropagationDomains, T as consumeSandboxEgressPermissionDeniedSignal, c as isVercelSandboxEgressRequest, l as proxyVercelSandboxEgressRequest, w as consumeSandboxEgressAuthRequiredSignal } from "./profile-DiAB4QfT.js";
|
|
6
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BU4tXvH3.js";
|
|
7
7
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-D_Ru4CWc.js";
|
|
8
|
-
import { $ as reviewItemChange, B as mcpIdempotencyKeySchema, F as mcpAuthorizationSchema$1, G as readMcpPendingWork, H as mcpMessageTextSchema, I as mcpConversation, K as readMcpPendingWorkAfterSend, L as mcpConversationIdSchema, P as mcpAcceptedMessageSchema, Q as readInboxItemForUser, R as mcpConversationSchema, U as mcpMessages, V as mcpMessageSchema, W as mcpPendingMessagesSchema, X as actOnInboxItem, Y as InboxItemActionError, Z as closeInboxItemsAnsweredByReply, _ as createConversationForViewer, _t as backfillCacheWarmingGaps, a as resolveInboxItemSubjects, b as encodeConversationCursor, ct as listOpenAutomationQuestions, dt as getScheduledAutomationDispatch, et as createEventAppPublisher, ft as runInboxSnoozeTimers, g as appendConversationMessageForViewer, ht as runSavingsRefillSlice, lt as createHeartbeatContext, n as readConversationFeed, nt as runAutoArchiveSweep, o as readConversationDetail, ot as automationReplyAttribution, st as settleEventAutomationRuns, tt as ingestEventAutomations, ut as dispatchScheduledAutomation, vt as GET$4, w as conversationOperations, y as decodeConversationCursor, z as mcpCursorSchema } from "./list-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as createEndStoppedChildWork } from "./result-
|
|
12
|
-
import { h as createPluginLogger } from "./prompt-
|
|
13
|
-
import { n as getAttachmentStorage } from "./storage-XD0lB4Gk.js";
|
|
8
|
+
import { $ as reviewItemChange, B as mcpIdempotencyKeySchema, F as mcpAuthorizationSchema$1, G as readMcpPendingWork, H as mcpMessageTextSchema, I as mcpConversation, K as readMcpPendingWorkAfterSend, L as mcpConversationIdSchema, P as mcpAcceptedMessageSchema, Q as readInboxItemForUser, R as mcpConversationSchema, U as mcpMessages, V as mcpMessageSchema, W as mcpPendingMessagesSchema, X as actOnInboxItem, Y as InboxItemActionError, Z as closeInboxItemsAnsweredByReply, _ as createConversationForViewer, _t as backfillCacheWarmingGaps, a as resolveInboxItemSubjects, b as encodeConversationCursor, ct as listOpenAutomationQuestions, dt as getScheduledAutomationDispatch, et as createEventAppPublisher, ft as runInboxSnoozeTimers, g as appendConversationMessageForViewer, ht as runSavingsRefillSlice, lt as createHeartbeatContext, n as readConversationFeed, nt as runAutoArchiveSweep, o as readConversationDetail, ot as automationReplyAttribution, st as settleEventAutomationRuns, tt as ingestEventAutomations, ut as dispatchScheduledAutomation, vt as GET$4, w as conversationOperations, y as decodeConversationCursor, z as mcpCursorSchema } from "./list-CuLf7Ob2.js";
|
|
9
|
+
import { $ as renderInboxItemMessage, $t as recordWebConversationActivity, A as getAuthPausedConversationTurnId, G as coerceThreadConversationState, In as isExperimentalFeatureEnabled, Q as inboxItemChangeRecord, Xt as conversationTurnIdForMessage, Yt as appendAndEnqueueWebMessage, Zt as createAndEnqueueConversation, b as isTrustedSlackAuthor, bn as getAttachmentStorage, en as webActorFromUser, fr as appendConversationMessages, mn as requestAttachmentDeletion, mt as renderTaskInput, on as collectAttachmentUploadGarbage, un as collectAttachmentGarbage, v as findTrustedUser, vr as settleConversationTitleWork, x as parseEmail, y as isAllowedDomain } from "./markers-Bh0vqJ5k.js";
|
|
10
|
+
import { An as automationTaskText, Fn as getNextRunAtMs, Nt as spaceRefSchema, Rt as conversationKindSchema, Tn as userInputQuestionText, Vt as annotationCard, _ as automationListQuerySchema, _n as inboxItemQuestion, an as scheduledRunSchema, kn as automationTaskSchema, p as automationExecutionStatusSchema, qt as automationCardStatus, xn as buttonUserInputField } from "./types-BWAgOJtR.js";
|
|
11
|
+
import { t as createEndStoppedChildWork } from "./result-D_D-2Adp.js";
|
|
12
|
+
import { h as createPluginLogger } from "./prompt-5PDkRQ1K.js";
|
|
14
13
|
import { i as getActiveSpan, u as sentry_exports } from "./sentry-CPbZjomA.js";
|
|
15
|
-
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
14
|
+
import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-Bo6_FtCI.js";
|
|
16
15
|
import { t as nameRequestRoute } from "./sentry-route-name-C6EIzAGP.js";
|
|
17
16
|
import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
18
|
-
import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-
|
|
19
|
-
import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-
|
|
20
|
-
import { s as joinPublicChannel } from "./channel-access-
|
|
21
|
-
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, d as JUNIOR_TURN_ENDED_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-
|
|
22
|
-
import { t as processConversationWork } from "./worker-
|
|
23
|
-
import { a as
|
|
24
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
25
|
-
import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-
|
|
17
|
+
import { a as resolveSlackActingUser, i as unfurlDashboardConversationLinks, n as handleSlackContinueHereClick, o as isSlackWorkspaceMember, s as slackWorkspaceBotId, t as SLACK_CONTINUE_HERE_ACTION_ID } from "./slack-conversation-unfurl-BxF0Yb3-.js";
|
|
18
|
+
import { l as unlinkProvider, n as renderHtmlPage, r as requestHasSameOrigin, t as escapeHtml } from "./html-BMv4fAPu.js";
|
|
19
|
+
import { s as joinPublicChannel } from "./channel-access-DRhVJIuQ.js";
|
|
20
|
+
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, d as JUNIOR_TURN_ENDED_CALLBACK_ROUTE, f as JUNIOR_TURN_STEP_CALLBACK_ROUTE, i as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, n as JUNIOR_AUTO_ARCHIVE_ROUTE, p as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, r as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./deployment-CeKaP0ZJ.js";
|
|
21
|
+
import { t as processConversationWork } from "./worker-C7EDSL3d.js";
|
|
22
|
+
import { a as turnStepConsumer, i as createGatewayModelClient, n as turnEndedConsumer, r as turnTools, t as createDeploymentDelivery } from "./turn-ended-DQ10G3in.js";
|
|
23
|
+
import { t as JUNIOR_VERSION } from "./version-D9yLYOBu.js";
|
|
24
|
+
import { D as conversationPendingMessageDeliverySchema, f as conversationTitleSchema, t as conversationFeedQuerySchema } from "./conversation-feed-BUaMmSLi.js";
|
|
26
25
|
import { t as isMissingVirtualModule } from "./virtual-module-BeKA_EII.js";
|
|
27
26
|
import { createRequire } from "node:module";
|
|
28
27
|
import { Hono } from "hono";
|
|
@@ -53,7 +52,7 @@ async function runConversationEmbeddingBackfill(embedder) {
|
|
|
53
52
|
const key = `junior:conversation_embeddings:backfill:${embedder.provider}:${embedder.model}`;
|
|
54
53
|
const state = getStateAdapter();
|
|
55
54
|
if (!await state.setIfNotExists(key, "running", BACKFILL_CLAIM_TTL_MS$1)) return;
|
|
56
|
-
await withSpan("conversation_embeddings.backfill", "conversation_embeddings.backfill", {}, async (setSpanAttributes) => {
|
|
55
|
+
await withSpan$1("conversation_embeddings.backfill", "conversation_embeddings.backfill", {}, async (setSpanAttributes) => {
|
|
57
56
|
const result = await backfillConversationEmbeddings({
|
|
58
57
|
db: getDb(),
|
|
59
58
|
deadlineMs: Date.now() + BACKFILL_BUDGET_MS$1,
|
|
@@ -225,7 +224,7 @@ async function runEventSearchBackfill(args) {
|
|
|
225
224
|
const deadlineMs = Date.now() + BACKFILL_BUDGET_MS;
|
|
226
225
|
let done = false;
|
|
227
226
|
try {
|
|
228
|
-
await withSpan("event_search.backfill", "event_search.backfill", {}, async (setSpanAttributes) => {
|
|
227
|
+
await withSpan$1("event_search.backfill", "event_search.backfill", {}, async (setSpanAttributes) => {
|
|
229
228
|
const stored = backfillPassSchema.safeParse(await state.get(passKey));
|
|
230
229
|
const result = await backfillEventSearchIndex({
|
|
231
230
|
db: getDb(),
|
|
@@ -1865,11 +1864,10 @@ async function refreshCards(services, user, itemId) {
|
|
|
1865
1864
|
/**
|
|
1866
1865
|
* Do one person action from a Slack card. The thread of the card gets an
|
|
1867
1866
|
* answer as Slack input from the person, like a typed reply. A dismiss, or
|
|
1868
|
-
*
|
|
1869
|
-
* recorded Message as the other linked Conversations, from
|
|
1870
|
-
* `actOnInboxItem`. An expected failure, such as
|
|
1871
|
-
*
|
|
1872
|
-
* message.
|
|
1867
|
+
* an answer or action on a plugin item, starts no Turn, so the thread gets
|
|
1868
|
+
* the same recorded Message as the other linked Conversations, from
|
|
1869
|
+
* `actOnInboxItem`. An expected failure, such as an item that is already
|
|
1870
|
+
* closed, goes to the person as an ephemeral message.
|
|
1873
1871
|
*/
|
|
1874
1872
|
async function act(args) {
|
|
1875
1873
|
const { services, target } = args;
|
|
@@ -1888,7 +1886,7 @@ async function act(args) {
|
|
|
1888
1886
|
let item;
|
|
1889
1887
|
try {
|
|
1890
1888
|
const current = await readInboxItemForUser(actor.user, args.itemId);
|
|
1891
|
-
const pluginAnswer = args.action === "submit" && isPluginInboxItem(current);
|
|
1889
|
+
const pluginAnswer = (args.action === "submit" || args.action === "done") && isPluginInboxItem(current);
|
|
1892
1890
|
recordOnly ||= pluginAnswer;
|
|
1893
1891
|
item = await actOnInboxItem({
|
|
1894
1892
|
action: args.action,
|
|
@@ -1897,7 +1895,8 @@ async function act(args) {
|
|
|
1897
1895
|
delivery,
|
|
1898
1896
|
id: current.id,
|
|
1899
1897
|
user: actor.user,
|
|
1900
|
-
...args.answer ? { answer: args.answer(current) } : void 0
|
|
1898
|
+
...args.answer ? { answer: args.answer(current) } : void 0,
|
|
1899
|
+
...args.kindAction ? { kindAction: args.kindAction } : void 0
|
|
1901
1900
|
});
|
|
1902
1901
|
} catch (error) {
|
|
1903
1902
|
if (!(error instanceof InboxItemActionError)) throw error;
|
|
@@ -1998,6 +1997,14 @@ async function handleSlackInboxItemClick(args) {
|
|
|
1998
1997
|
});
|
|
1999
1998
|
return;
|
|
2000
1999
|
}
|
|
2000
|
+
if (click.kind === "action") {
|
|
2001
|
+
await act({
|
|
2002
|
+
...common,
|
|
2003
|
+
action: "done",
|
|
2004
|
+
kindAction: click.action
|
|
2005
|
+
});
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2001
2008
|
await act({
|
|
2002
2009
|
...common,
|
|
2003
2010
|
action: "submit",
|
|
@@ -2052,7 +2059,7 @@ function requireSlackPayloadUserId(value, source) {
|
|
|
2052
2059
|
return userId;
|
|
2053
2060
|
}
|
|
2054
2061
|
async function handleAppHomeDisconnect(args) {
|
|
2055
|
-
await withSpan("chat.app_home_disconnect", "chat.app_home_disconnect", { userId: args.userId }, async () => {
|
|
2062
|
+
await withSpan$1("chat.app_home_disconnect", "chat.app_home_disconnect", { userId: args.userId }, async () => {
|
|
2056
2063
|
try {
|
|
2057
2064
|
await unlinkProvider(args.userId, args.provider, args.userTokenStore, getWorkspaceTeamId());
|
|
2058
2065
|
} catch (error) {
|
|
@@ -2072,7 +2079,7 @@ async function handleAppHomeDisconnect(args) {
|
|
|
2072
2079
|
async function handleSlackInteractivePayload(args) {
|
|
2073
2080
|
const spanAttributes = { userId: args.payload.user?.id?.trim() || void 0 };
|
|
2074
2081
|
if (args.payload.type === "view_submission" && args.payload.view?.callback_id === "junior_review_item") {
|
|
2075
|
-
await withSpan("chat.slack_inbox_item_submit", "chat.slack_inbox_item_submit", spanAttributes, () => handleSlackInboxItemSubmission({
|
|
2082
|
+
await withSpan$1("chat.slack_inbox_item_submit", "chat.slack_inbox_item_submit", spanAttributes, () => handleSlackInboxItemSubmission({
|
|
2076
2083
|
payload: args.payload,
|
|
2077
2084
|
services: args
|
|
2078
2085
|
}));
|
|
@@ -2082,7 +2089,7 @@ async function handleSlackInteractivePayload(args) {
|
|
|
2082
2089
|
for (const action of args.payload.actions ?? []) {
|
|
2083
2090
|
const click = parseSlackInboxItemClick(action);
|
|
2084
2091
|
if (click) {
|
|
2085
|
-
await withSpan("chat.slack_inbox_item_click", "chat.slack_inbox_item_click", spanAttributes, () => handleSlackInboxItemClick({
|
|
2092
|
+
await withSpan$1("chat.slack_inbox_item_click", "chat.slack_inbox_item_click", spanAttributes, () => handleSlackInboxItemClick({
|
|
2086
2093
|
action,
|
|
2087
2094
|
click,
|
|
2088
2095
|
payload: args.payload,
|
|
@@ -2093,7 +2100,7 @@ async function handleSlackInteractivePayload(args) {
|
|
|
2093
2100
|
}
|
|
2094
2101
|
const continueHere = args.payload.actions?.find((candidate) => candidate.action_id === SLACK_CONTINUE_HERE_ACTION_ID);
|
|
2095
2102
|
if (continueHere) {
|
|
2096
|
-
await withSpan("chat.slack_continue_here_click", "chat.slack_continue_here_click", spanAttributes, () => handleSlackContinueHereClick({
|
|
2103
|
+
await withSpan$1("chat.slack_continue_here_click", "chat.slack_continue_here_click", spanAttributes, () => handleSlackContinueHereClick({
|
|
2097
2104
|
isAuthorAllowed: args.isAuthorAllowed,
|
|
2098
2105
|
payload: args.payload,
|
|
2099
2106
|
state: args.state,
|
|
@@ -3054,7 +3061,7 @@ async function handleSlackWebhook(args) {
|
|
|
3054
3061
|
if (shouldPersistBeforeAck(parsed)) {
|
|
3055
3062
|
const failureResponse = await withLogContext(eventLogContext, async () => {
|
|
3056
3063
|
try {
|
|
3057
|
-
await withSpan("slack.message.ingress", "slack.message.ingress", eventLogContext, () => handleSlackEvent({
|
|
3064
|
+
await withSpan$1("slack.message.ingress", "slack.message.ingress", eventLogContext, () => handleSlackEvent({
|
|
3058
3065
|
body: parsed,
|
|
3059
3066
|
services: args.services
|
|
3060
3067
|
}), {
|
|
@@ -3145,7 +3152,7 @@ function queueProcessAttributes(metadata, nowMs) {
|
|
|
3145
3152
|
async function processConversationQueueMessage(message, options, metadata) {
|
|
3146
3153
|
const parsed = parseConversationQueueMessage(message);
|
|
3147
3154
|
try {
|
|
3148
|
-
return await withSpan("conversation.work.process", "queue.process", { conversationId: parsed.conversationId }, async (setSpanAttributes) => {
|
|
3155
|
+
return await withSpan$1("conversation.work.process", "queue.process", { conversationId: parsed.conversationId }, async (setSpanAttributes) => {
|
|
3149
3156
|
try {
|
|
3150
3157
|
const result = await processConversationWork(parsed, {
|
|
3151
3158
|
beforeWorkStops: options.beforeWorkStops,
|
|
@@ -3274,7 +3281,7 @@ const STALE_MS$1 = 3e5;
|
|
|
3274
3281
|
const BATCH$1 = 100;
|
|
3275
3282
|
/** Sends the step message again for each Turn that no message will reach. */
|
|
3276
3283
|
async function sweepTurns(ctx) {
|
|
3277
|
-
await withSpan
|
|
3284
|
+
await withSpan("turn.sweep", {}, async (span) => {
|
|
3278
3285
|
const turns = await findStalledTurns(ctx, {
|
|
3279
3286
|
staleMs: STALE_MS$1,
|
|
3280
3287
|
limit: BATCH$1
|
|
@@ -3306,7 +3313,7 @@ const BATCH = 100;
|
|
|
3306
3313
|
* replies no message will send.
|
|
3307
3314
|
*/
|
|
3308
3315
|
async function sweepDeliveries(ctx) {
|
|
3309
|
-
await withSpan
|
|
3316
|
+
await withSpan("delivery.sweep", {}, async (span) => {
|
|
3310
3317
|
const stalled = await findStalledDeliveries(ctx, {
|
|
3311
3318
|
staleMs: STALE_MS,
|
|
3312
3319
|
limit: BATCH
|
|
@@ -5322,17 +5329,21 @@ async function claimMcpAuthorization(state, authorizationId) {
|
|
|
5322
5329
|
}
|
|
5323
5330
|
return claimed;
|
|
5324
5331
|
}
|
|
5325
|
-
/** Build the client
|
|
5326
|
-
function
|
|
5332
|
+
/** Build the client callback URL for an OAuth authorization response. */
|
|
5333
|
+
function authorizationResponseUrl(args) {
|
|
5327
5334
|
const url = new URL(args.redirectUri);
|
|
5328
5335
|
for (const [name, value] of Object.entries(args.params)) url.searchParams.set(name, value);
|
|
5329
5336
|
if (args.state !== void 0) url.searchParams.set("state", args.state);
|
|
5330
5337
|
url.searchParams.set("iss", args.issuer);
|
|
5338
|
+
return url;
|
|
5339
|
+
}
|
|
5340
|
+
/** Build the client redirect for an OAuth authorization response. */
|
|
5341
|
+
function authorizationRedirect(args) {
|
|
5331
5342
|
return new Response(null, {
|
|
5332
5343
|
status: 303,
|
|
5333
5344
|
headers: {
|
|
5334
5345
|
"cache-control": "no-store",
|
|
5335
|
-
location:
|
|
5346
|
+
location: authorizationResponseUrl(args).toString()
|
|
5336
5347
|
}
|
|
5337
5348
|
});
|
|
5338
5349
|
}
|
|
@@ -5653,9 +5664,27 @@ function blockedPage() {
|
|
|
5653
5664
|
title: "Request blocked"
|
|
5654
5665
|
});
|
|
5655
5666
|
}
|
|
5667
|
+
function isWebUrl(url) {
|
|
5668
|
+
return url.protocol === "https:" || url.protocol === "http:";
|
|
5669
|
+
}
|
|
5656
5670
|
function formActionSource(redirectUri) {
|
|
5657
5671
|
const url = new URL(redirectUri);
|
|
5658
|
-
return url
|
|
5672
|
+
return isWebUrl(url) ? void 0 : url.protocol;
|
|
5673
|
+
}
|
|
5674
|
+
function authorizationResponse(args) {
|
|
5675
|
+
const url = authorizationResponseUrl(args);
|
|
5676
|
+
if (!isWebUrl(url)) return authorizationRedirect(args);
|
|
5677
|
+
const href = escapeHtml(url.toString());
|
|
5678
|
+
return renderHtmlPage({
|
|
5679
|
+
bodyHtml: ` <p><a href="${href}">Continue to the app</a> if nothing happens.</p>`,
|
|
5680
|
+
headHtml: ` <meta http-equiv="refresh" content="0;url=${href}" />`,
|
|
5681
|
+
headers: {
|
|
5682
|
+
"content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'; form-action 'none'; base-uri 'none'",
|
|
5683
|
+
"referrer-policy": "no-referrer"
|
|
5684
|
+
},
|
|
5685
|
+
status: 200,
|
|
5686
|
+
title: "Redirecting…"
|
|
5687
|
+
});
|
|
5659
5688
|
}
|
|
5660
5689
|
function consentPage(args) {
|
|
5661
5690
|
const clientHost = new URL(args.authorization.clientId).host;
|
|
@@ -5719,7 +5748,7 @@ async function handleMcpConsentPage(args) {
|
|
|
5719
5748
|
if (!requestHasSameOrigin(args.request) || consent?.userId !== args.user.id || !form.csrf || !csrfMatches(form.csrf, consent.csrfHash) || form.action !== "approve" && form.action !== "deny") return blockedPage();
|
|
5720
5749
|
if (!await claimMcpAuthorization(args.state, authorizationId)) return expiredPage();
|
|
5721
5750
|
const { issuer } = resolveMcpUrls(args.request, args.baseURL);
|
|
5722
|
-
if (form.action === "deny") return
|
|
5751
|
+
if (form.action === "deny") return authorizationResponse({
|
|
5723
5752
|
issuer,
|
|
5724
5753
|
params: {
|
|
5725
5754
|
error: "access_denied",
|
|
@@ -5728,7 +5757,7 @@ async function handleMcpConsentPage(args) {
|
|
|
5728
5757
|
redirectUri: authorization.redirectUri,
|
|
5729
5758
|
state: authorization.state
|
|
5730
5759
|
});
|
|
5731
|
-
return
|
|
5760
|
+
return authorizationResponse({
|
|
5732
5761
|
issuer,
|
|
5733
5762
|
params: { code: await issueAuthorizationCode({
|
|
5734
5763
|
clientId: authorization.clientId,
|
|
@@ -6081,7 +6110,7 @@ function mcpInboxItem(item, userId, views) {
|
|
|
6081
6110
|
status: item.status,
|
|
6082
6111
|
title: item.title,
|
|
6083
6112
|
body: item.body,
|
|
6084
|
-
...question ? { question: question
|
|
6113
|
+
...question ? { question: userInputQuestionText(question) } : void 0,
|
|
6085
6114
|
assignees: item.assignedToEveryone ? [] : item.assignees.map((person) => person.displayName ?? person.email),
|
|
6086
6115
|
canAct: canActOnInboxItem(item, userId),
|
|
6087
6116
|
conversationIds: item.conversationIds,
|
|
@@ -6238,17 +6267,21 @@ function registerMarkConversationReadTool(server, { user }) {
|
|
|
6238
6267
|
});
|
|
6239
6268
|
}
|
|
6240
6269
|
// src/api/mcp/tools/search-conversations.ts
|
|
6270
|
+
const searchRowSchema = mcpConversationSchema.extend({
|
|
6271
|
+
kind: conversationKindSchema.describe("`lead` for the Lead of a Space, whose title is the Space's name. `automation` for an Automation run. `thread` otherwise."),
|
|
6272
|
+
space: spaceRefSchema.optional().describe("The Space that it is in. Missing when it is in no Space, or when you may not read the Space.")
|
|
6273
|
+
});
|
|
6241
6274
|
/** Register `searchConversations`, which searches the Conversations of the user. */
|
|
6242
6275
|
function registerSearchConversationsTool(server, { user }) {
|
|
6243
6276
|
const feedQuery = conversationFeedQuerySchema.shape;
|
|
6244
6277
|
server.registerTool("searchConversations", {
|
|
6245
6278
|
title: "Search conversations",
|
|
6246
|
-
description: "Search your conversations and return up to 50, newest activity first. Only conversations that you started or take part in match.",
|
|
6279
|
+
description: "Search your conversations and return up to 50, newest activity first. Only conversations that you started or take part in match. A text search also finds each Space that you are a member of, as its Lead.",
|
|
6247
6280
|
inputSchema: {
|
|
6248
6281
|
q: feedQuery.q.describe("Text to search for in titles, summaries, and Annotation labels and titles."),
|
|
6249
6282
|
status: feedQuery.status.describe("Return conversations that are not archived (default) or that are archived. A search ignores this filter.")
|
|
6250
6283
|
},
|
|
6251
|
-
outputSchema: { conversations: z.array(
|
|
6284
|
+
outputSchema: { conversations: z.array(searchRowSchema) },
|
|
6252
6285
|
annotations: {
|
|
6253
6286
|
destructiveHint: false,
|
|
6254
6287
|
idempotentHint: true,
|
|
@@ -6260,7 +6293,11 @@ function registerSearchConversationsTool(server, { user }) {
|
|
|
6260
6293
|
q,
|
|
6261
6294
|
status,
|
|
6262
6295
|
viewer: user
|
|
6263
|
-
})).conversations.map(
|
|
6296
|
+
})).conversations.map((row) => ({
|
|
6297
|
+
...mcpConversation(row),
|
|
6298
|
+
kind: row.kind,
|
|
6299
|
+
space: row.space ?? void 0
|
|
6300
|
+
})) });
|
|
6264
6301
|
});
|
|
6265
6302
|
}
|
|
6266
6303
|
// src/api/mcp/tools/search-inbox-items.ts
|
|
@@ -26,9 +26,13 @@ declare const messageAttachmentSchema: z.ZodObject<{
|
|
|
26
26
|
pending: z.ZodOptional<z.ZodLiteral<true>>;
|
|
27
27
|
}, z.core.$strict>;
|
|
28
28
|
type MessageAttachment = z.output<typeof messageAttachmentSchema>;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A saved request: an optional question that its fields share, and the
|
|
31
|
+
* fields. A question that an agent asks has no shared question: each field
|
|
32
|
+
* holds its own question.
|
|
33
|
+
*/
|
|
34
|
+
declare const savedUserInputRequestSchema: z.ZodObject<{
|
|
35
|
+
question: z.ZodOptional<z.ZodString>;
|
|
32
36
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
37
|
id: z.ZodString;
|
|
34
38
|
label: z.ZodString;
|
|
@@ -62,23 +66,29 @@ declare const userInputRequestSchema: z.ZodObject<{
|
|
|
62
66
|
* every surface says that in the same words.
|
|
63
67
|
*/
|
|
64
68
|
declare const USER_INPUT_NOTE: {
|
|
65
|
-
readonly label: "
|
|
66
|
-
readonly description: "Optional.
|
|
69
|
+
readonly label: "Additional notes";
|
|
70
|
+
readonly description: "Optional. Sent with your answers.";
|
|
67
71
|
};
|
|
68
72
|
/** One field of a user input request. */
|
|
69
73
|
type UserInputField = UserInputRequest["fields"][number];
|
|
70
74
|
/** A question with one or more fields for a person to answer. */
|
|
71
|
-
type UserInputRequest = z.output<typeof
|
|
75
|
+
type UserInputRequest = z.output<typeof savedUserInputRequestSchema>;
|
|
72
76
|
/**
|
|
73
77
|
* A person's answer to one user input request. `values` maps field ids to
|
|
74
|
-
* the picked option labels or the typed text. `other` is
|
|
75
|
-
* person can
|
|
78
|
+
* the picked option labels or the typed text. `other` is the card's
|
|
79
|
+
* additional notes, where the person can also write an answer that no
|
|
80
|
+
* choice fits.
|
|
76
81
|
*/
|
|
77
82
|
interface UserInputAnswer {
|
|
78
83
|
other?: string | undefined;
|
|
79
84
|
requestId: string;
|
|
80
85
|
values: Record<string, string[]>;
|
|
81
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Return the text that a request asks: its shared question, else the
|
|
89
|
+
* question of each field, one paragraph each.
|
|
90
|
+
*/
|
|
91
|
+
declare function userInputQuestionText(request: UserInputRequest): string;
|
|
82
92
|
/**
|
|
83
93
|
* Return the single choice field of a request that a surface can show as
|
|
84
94
|
* one row of buttons, where one click is the whole answer.
|
|
@@ -98,7 +108,7 @@ declare function isEmptyUserInputAnswer(answer: UserInputAnswer): boolean;
|
|
|
98
108
|
* of the question, so they are stored with it in `request`.
|
|
99
109
|
*/
|
|
100
110
|
declare const inboxItemRequestSchema: z.ZodObject<{
|
|
101
|
-
question: z.ZodString
|
|
111
|
+
question: z.ZodOptional<z.ZodString>;
|
|
102
112
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
113
|
id: z.ZodString;
|
|
104
114
|
label: z.ZodString;
|
|
@@ -152,6 +162,12 @@ type InboxItemNoticeRequest = z.output<typeof inboxItemNoticeRequestSchema>;
|
|
|
152
162
|
* related links, so it has none.
|
|
153
163
|
*/
|
|
154
164
|
declare function inboxItemQuestion(request: InboxItemRequest | InboxItemNoticeRequest | null | undefined): InboxItemRequest | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Tool names that ask a person a question. Turns from before
|
|
167
|
+
* `askUserQuestion` have an old name in their history, so readers of a
|
|
168
|
+
* transcript match every name.
|
|
169
|
+
*/
|
|
170
|
+
declare const ASK_TOOL_NAMES: ReadonlySet<string>;
|
|
155
171
|
/** Saved automation facts shown with a Message, not a live status view. */
|
|
156
172
|
declare const automationCardSchema: z.ZodObject<{
|
|
157
173
|
kind: z.ZodLiteral<"automation">;
|
|
@@ -230,4 +246,4 @@ declare const inboxItemChangeRecordSchema: z.ZodObject<{
|
|
|
230
246
|
reviewItemId: z.ZodString;
|
|
231
247
|
}, z.core.$strict>;
|
|
232
248
|
type InboxItemChangeRecord = z.output<typeof inboxItemChangeRecordSchema>;
|
|
233
|
-
export {
|
|
249
|
+
export { MessageAttachment as S, normalizeUserInputAnswer as _, annotationCard as a, MAX_ATTACHMENT_BYTES as b, AutomationCard as c, USER_INPUT_NOTE as d, UserInputAnswer as f, isEmptyUserInputAnswer as g, buttonUserInputField as h, MessageCard as i, ASK_TOOL_NAMES as l, UserInputRequest as m, conversationTurnFailureCodeSchema as n, messageCardText as o, UserInputField as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, inboxItemQuestion as u, userInputQuestionText as v, MAX_INPUT_ATTACHMENTS as x, InputFile as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Uc as getSlackClient, Zc as withSlackRetries, i as getConversationStore, zc as SlackActionError } from "./db-RDpWIeRK.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/slack/channel.ts
|
|
4
4
|
const replySubtypeSchema = z.object({ subtype: z.string().optional() });
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { R as getChatConfig } from "./adapter-
|
|
2
|
-
import {
|
|
1
|
+
import { R as getChatConfig } from "./adapter-CKtEUuWD.js";
|
|
2
|
+
import { Em as juniorTurns, Fn as scheduleInput, Mn as createEngineContext, d as createSqlConversationEventStore, dl as SYSTEM_IDENTITY_ID, i as getConversationStore, jn as turnGroupKey } from "./db-RDpWIeRK.js";
|
|
3
3
|
import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as TURN_STEP_TOPIC, t as TURN_ENDED_TOPIC } from "./topic-
|
|
6
|
-
import { a as
|
|
4
|
+
import { Bi as projectConversationEvents } from "./markers-Bh0vqJ5k.js";
|
|
5
|
+
import { n as TURN_STEP_TOPIC, t as TURN_ENDED_TOPIC } from "./topic-ChZe9WPj.js";
|
|
6
|
+
import { a as turnStepConsumer, i as createGatewayModelClient, n as turnEndedConsumer, r as turnTools } from "./turn-ended-DQ10G3in.js";
|
|
7
7
|
import { eq } from "drizzle-orm";
|
|
8
8
|
import { localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { setTimeout } from "node:timers/promises";
|
|
11
|
-
// src/turn-steps/group-key.ts
|
|
12
|
-
/** The group key of an input that this Actor Identity sent from this Source. */
|
|
13
|
-
function turnGroupKey(actorIdentityId, source) {
|
|
14
|
-
return `${actorIdentityId}:${source.kind}`;
|
|
15
|
-
}
|
|
16
11
|
// src/cli/chat-core-engine.ts
|
|
17
12
|
/**
|
|
18
13
|
* `junior chat --engine core -p`: one message through the core Turn engine.
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
2
|
-
import { G as loadConfig, W as installChatConfig } from "../adapter-
|
|
3
|
-
import {
|
|
2
|
+
import { G as loadConfig, W as installChatConfig } from "../adapter-CKtEUuWD.js";
|
|
3
|
+
import { in as createAgentRunner, t as executeAgentRun } from "../agent-OUkEw6Bv.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
6
6
|
import { stderr, stdin, stdout } from "node:process";
|
|
@@ -109,9 +109,9 @@ async function loadLocalPluginSet() {
|
|
|
109
109
|
async function configureLocalChatPlugins(pluginSet) {
|
|
110
110
|
const [pluginsModule, appContextModule, validationModule, databaseModule] = await Promise.all([
|
|
111
111
|
import("../plugins-D_Ru4CWc.js").then((n) => n.o),
|
|
112
|
-
import("../db-
|
|
113
|
-
import("../validation-
|
|
114
|
-
import("../db-
|
|
112
|
+
import("../db-RDpWIeRK.js").then((n) => n.kf),
|
|
113
|
+
import("../validation-BU4tXvH3.js").then((n) => n.r),
|
|
114
|
+
import("../db-RDpWIeRK.js").then((n) => n.t)
|
|
115
115
|
]);
|
|
116
116
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
117
117
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -164,17 +164,17 @@ function localDevServerUrl() {
|
|
|
164
164
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
165
165
|
installLocalChatConfig({ eventEmbeddings: { enabled: true } });
|
|
166
166
|
await configureLocalChatPlugins(pluginSet);
|
|
167
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
168
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
169
|
-
const { createLocalOAuthState } = await import("../oauth-relay-
|
|
170
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
171
|
-
const { bindSpawnAgent } = await import("../agent-
|
|
172
|
-
const { bindMessageAgent } = await import("../agent-
|
|
173
|
-
const { runConversation } = await import("../agent-
|
|
174
|
-
const { createConversationTurnWorker } = await import("../agent-
|
|
175
|
-
const { resumeForPersonInput } = await import("../markers-
|
|
167
|
+
const { runLocalAgentTurn } = await import("../runner-CCVTdp0x.js");
|
|
168
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BxuN0Jqz.js");
|
|
169
|
+
const { createLocalOAuthState } = await import("../oauth-relay-vyG2gOwY.js").then((n) => n.t);
|
|
170
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-D4OKOFgy.js");
|
|
171
|
+
const { bindSpawnAgent } = await import("../agent-OUkEw6Bv.js").then((n) => n.en);
|
|
172
|
+
const { bindMessageAgent } = await import("../agent-OUkEw6Bv.js").then((n) => n.rn);
|
|
173
|
+
const { runConversation } = await import("../agent-OUkEw6Bv.js").then((n) => n.q);
|
|
174
|
+
const { createConversationTurnWorker } = await import("../agent-OUkEw6Bv.js").then((n) => n.J);
|
|
175
|
+
const { resumeForPersonInput } = await import("../markers-Bh0vqJ5k.js").then((n) => n.D);
|
|
176
176
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
177
|
-
const { processConversationWork } = await import("../worker-
|
|
177
|
+
const { processConversationWork } = await import("../worker-C7EDSL3d.js").then((n) => n.n);
|
|
178
178
|
let agentRunner;
|
|
179
179
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
180
180
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
|
@@ -241,7 +241,7 @@ async function runPrompt(options, io, pluginSet) {
|
|
|
241
241
|
async function runCorePrompt(options, io, pluginSet) {
|
|
242
242
|
installLocalChatConfig();
|
|
243
243
|
await configureLocalChatPlugins(pluginSet);
|
|
244
|
-
const { runCoreEnginePrompt } = await import("../chat-core-engine-
|
|
244
|
+
const { runCoreEnginePrompt } = await import("../chat-core-engine-El308gYr.js");
|
|
245
245
|
const result = await runCoreEnginePrompt({
|
|
246
246
|
conversationId: newRunConversationId(),
|
|
247
247
|
message: options.message
|
package/dist/cli/check.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as mapBounded } from "../prompt-
|
|
2
|
-
import { a as parseSkillFile } from "../skills-
|
|
3
|
-
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-
|
|
4
|
-
import {
|
|
1
|
+
import { G as mapBounded } from "../prompt-5PDkRQ1K.js";
|
|
2
|
+
import { a as parseSkillFile } from "../skills-DfbOjWxl.js";
|
|
3
|
+
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, s as JUNIOR_HEARTBEAT_ROUTE } from "../deployment-CeKaP0ZJ.js";
|
|
4
|
+
import { Op as parseInlinePluginManifest, kp as parsePluginManifest } from "../db-RDpWIeRK.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { mentionsTag } from "@sentry/junior-plugin-api";
|
package/dist/cli/main.js
CHANGED
|
@@ -45,10 +45,10 @@ async function runChat(argv, pluginSet) {
|
|
|
45
45
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
46
46
|
}
|
|
47
47
|
async function runAdmin(argv) {
|
|
48
|
-
return await (await import("../admin-
|
|
48
|
+
return await (await import("../admin-BGOiUGwR.js")).runAdmin(argv);
|
|
49
49
|
}
|
|
50
50
|
async function runServiceAccount(argv) {
|
|
51
|
-
return await (await import("../service-account-
|
|
51
|
+
return await (await import("../service-account-CeWsFrBi.js")).runServiceAccount(argv);
|
|
52
52
|
}
|
|
53
53
|
function topLevelCommand(argv) {
|
|
54
54
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as createPluginLogger } from "../prompt-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Af as createAppContext, Mf as installAppContext, a as getDb, wt as coreRegistrations } from "../db-RDpWIeRK.js";
|
|
2
|
+
import { h as createPluginLogger } from "../prompt-5PDkRQ1K.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BU4tXvH3.js";
|
|
4
4
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-D_Ru4CWc.js";
|
|
6
6
|
import { Command, CommanderError } from "commander";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as getChatConfig, n as disconnectStateAdapter } from "../adapter-
|
|
2
|
-
import {
|
|
3
|
-
import { n as resolve } from "../resolve-
|
|
4
|
-
import { t as create, u as SANDBOX_RUNTIME } from "../profile-
|
|
1
|
+
import { R as getChatConfig, n as disconnectStateAdapter } from "../adapter-CKtEUuWD.js";
|
|
2
|
+
import { jf as getAppContext } from "../db-RDpWIeRK.js";
|
|
3
|
+
import { n as resolve } from "../resolve-C7e0pwuP.js";
|
|
4
|
+
import { t as create, u as SANDBOX_RUNTIME } from "../profile-DiAB4QfT.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
7
7
|
function progressMessage(phase) {
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as getChatConfig } from "../adapter-
|
|
2
|
-
import {
|
|
1
|
+
import { R as getChatConfig } from "../adapter-CKtEUuWD.js";
|
|
2
|
+
import { Nf as createPluginCatalogRuntime, c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-RDpWIeRK.js";
|
|
3
3
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-D_Ru4CWc.js";
|
|
5
5
|
import { t as isMissingVirtualModule } from "../virtual-module-BeKA_EII.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-
|
|
3
|
-
import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-
|
|
1
|
+
import { A as getConversationIdByProviderConversation, Aa as escapeSlackMrkdwnText, Ca as postSlackMessage, E as setFirstConversationLocation, Um as juniorDestinations, a as getDb, bn as moveIdleConversationDestination, i as getConversationStore, ja as formatSlackLink, k as claimProviderConversation, o as getSqlExecutor, va as deleteSlackMessage, vu as getDashboardConversationLink, w as withConversationMutationLock, ya as getSlackMessagePermalink } from "./db-RDpWIeRK.js";
|
|
2
|
+
import { E as parseSlackChannelId, P as parseSlackMessageTs, i as getStateAdapter } from "./adapter-CKtEUuWD.js";
|
|
3
|
+
import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-DRhVJIuQ.js";
|
|
4
4
|
import { and, eq } from "drizzle-orm";
|
|
5
5
|
// src/chat/slack/continue-in-slack.ts
|
|
6
6
|
/** Refusal for a move that cannot wait for the active Run. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as actorIdentitySchema, Nt as spaceRefSchema, V as conversationDetailReportSchema, X as conversationSummaryReportSchema,
|
|
1
|
+
import { Bt as inboxItemChangeRecordSchema, F as actorIdentitySchema, Nt as spaceRefSchema, V as conversationDetailReportSchema, X as conversationSummaryReportSchema, Zt as messageAttachmentSchema } from "./types-BWAgOJtR.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/reporting-schema.ts
|
|
4
4
|
const healthReportSchema = z.object({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as logWarn } from "./logging-
|
|
1
|
+
import { m as logWarn } from "./logging-BQsfrLHl.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
|
|
4
4
|
// src/chat/conversation-privacy.ts
|