@sentry/junior 0.204.0 → 0.206.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/{agent-CMyTD4DD.js → agent-C9yuiZUF.js} +277 -85
- package/dist/{agent-hooks-Bbcp9e33.js → agent-hooks-DNjlz2A-.js} +1084 -16
- package/dist/{agent-runner-DNb1A49M.js → agent-runner-E67lFrDG.js} +5 -5
- package/dist/api/schema.d.ts +85 -0
- package/dist/api/schema.js +2 -2
- package/dist/api.js +44 -511
- package/dist/{app-B1TOqBI8.d.ts → app-AxGmJHwK.d.ts} +8 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +56 -84
- package/dist/{auth-pause-state-DosEalIG.js → auth-pause-state-MVZ6xvEK.js} +6 -6
- package/dist/briefs-CvJFQvhJ.js +398 -0
- package/dist/{catalog-runtime-BReos-D4.js → catalog-runtime-TBR8n4e1.js} +1 -1
- package/dist/{checkpoint-CNrPyRJN.js → checkpoint-BY47jJCB.js} +7 -6
- package/dist/cli/chat.js +14 -12
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +1 -0
- package/dist/cli/main.js +5 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/run.d.ts +2 -1
- package/dist/cli/run.js +2 -1
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-nGCW1OTG.js → client-ceE7NtvC.js} +4 -367
- package/dist/config-CIE83sR2.js +386 -0
- package/dist/{schema-Rn8-XEaN.js → conversation-AA4R1VUn.js} +580 -558
- package/dist/{conversation-privacy-B4voFRSm.js → conversation-privacy-Auyq26XQ.js} +1 -1
- package/dist/{credential-sync-kXr1hvO1.js → credential-sync-BO33aNQd.js} +22 -20
- package/dist/{execution-stats-DWfSihcH.js → execution-stats-SiS2FLcv.js} +4 -4
- package/dist/{executor-DcMSlI5c.js → executor-BfbYPW63.js} +31 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-Drn_LXlM.js → job-queue-CyTc24Es.js} +1 -1
- package/dist/{logging-BzAk1S_s.js → logging-D37bayDc.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-JiftokvA.js → oauth-callback-server-BtfOeHTZ.js} +2 -2
- package/dist/{pending-auth-CWmSdZVg.js → pending-auth-BPUzcs7n.js} +2 -2
- package/dist/{profile-CrT5nXbw.js → profile-CSixooTi.js} +4 -3
- package/dist/prompt-3gqNY1Ka.js +552 -0
- package/dist/{registry-DH1xUo2N.js → registry-DiR0-xRg.js} +1 -1
- package/dist/{resolve-CZHnfxaS.js → resolve-Bn5q__9b.js} +2 -2
- package/dist/{runner-CZV2sC46.js → runner-DFx3dIJH.js} +9 -9
- package/dist/{sandbox-egress-signals-bHZfmhbd.js → sandbox-egress-signals-bwvjihxA.js} +1 -1
- package/dist/schema-8GXFfclK.js +559 -0
- package/dist/{skills-CIcDQSgM.js → skills-BhM5qyCF.js} +2 -2
- package/dist/{spawn-DdkUFRmq.js → spawn-Dk0PqdH6.js} +2 -2
- package/dist/{stats-DTUbAb88.js → stats-DKRP4rsY.js} +26 -12
- package/dist/{task-queue-CJIR4RF7.js → task-queue-CdpTvu4R.js} +3 -3
- package/dist/{task-runner-D-O3A-Cp.js → task-runner-alpjVSxQ.js} +10 -10
- package/dist/{thread-state-CRc9jTJS.js → thread-state-CRK7aA41.js} +5 -5
- package/dist/{turn-execution-BkinIdJF.js → turn-execution-XtyzIHog.js} +3 -3
- package/dist/{turn-lifecycle-DQV19VTW.js → turn-lifecycle-VbwZLfBv.js} +1 -1
- package/dist/{usage-D3EbSO7w.js → usage-D4A48Bdl.js} +4 -125
- package/dist/{validation-C2CR-OX3.js → validation-jn_46o4U.js} +1 -1
- package/dist/{version-DxcWdoKa.js → version-DcfJxB4z.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/web-authorization-CsfLSfEs.js +38 -0
- package/dist/{web-input-3EPfpf55.js → web-input-BPp_sc7t.js} +6 -6
- package/dist/{work-fGofI7Op.js → work-Di-ubSGg.js} +9 -9
- package/dist/{worker-CsOLq-mR.js → worker-Cu_D5Mr8.js} +5 -4
- package/migrations/0040_conversation_briefs.sql +17 -0
- package/migrations/meta/0040_snapshot.json +3516 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -4
- package/dist/history-CqTuSAdI.js +0 -441
- package/dist/usage-schema-CKaDkH_j.js +0 -20
- package/dist/web-authorization-RMBxAR_t.js +0 -76
|
@@ -102,6 +102,7 @@ declare const inboundMessageSchema: z.ZodObject<{
|
|
|
102
102
|
platform: z.ZodLiteral<"slack">;
|
|
103
103
|
teamId: z.ZodString;
|
|
104
104
|
channelId: z.ZodString;
|
|
105
|
+
threadTs: z.ZodOptional<z.ZodString>;
|
|
105
106
|
}, z.core.$strict>, z.ZodObject<{
|
|
106
107
|
platform: z.ZodLiteral<"local">;
|
|
107
108
|
conversationId: z.ZodString;
|
|
@@ -176,6 +177,13 @@ type WaitUntilFn = (task: Promise<unknown> | (() => Promise<unknown>)) => void;
|
|
|
176
177
|
//#endregion
|
|
177
178
|
//#region src/app.d.ts
|
|
178
179
|
interface JuniorAppOptions extends BotModelConfig {
|
|
180
|
+
/**
|
|
181
|
+
* Generate a durable Brief after each completed Turn. This costs one
|
|
182
|
+
* default-model call per completed Turn. Disabled by default.
|
|
183
|
+
*/
|
|
184
|
+
briefs?: {
|
|
185
|
+
enabled?: boolean;
|
|
186
|
+
};
|
|
179
187
|
/** Authenticated dashboard mounted by core when configured. */
|
|
180
188
|
dashboard?: JuniorDashboardOptions;
|
|
181
189
|
/**
|
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-
|
|
1
|
+
import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-AxGmJHwK.js";
|
|
2
2
|
import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BI9A1vKA.js";
|
|
3
3
|
import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
|
|
4
4
|
export { JUNIOR_VERSION, JuniorAppOptions, JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
|
package/dist/app.js
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, C as withSpan, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, F as isRecord$1, I as toOptionalNumber, L as toOptionalString, S as withLogContext, _ as setSpanAttributes, d as logInfo, f as logWarn, g as setSentryUser, l as logError, n as createChatSdkLogger, o as getActiveTraceId, r as createRequestContext, t as buildTurnFailureResponse, u as logException, v as setSpanStatus, x as withContext, y as setTags } from "./logging-
|
|
1
|
+
import { $ as shouldEmitDevAgentTrace, B as resolveSandboxEgressProviderForHost, C as renderBlockText, D as getNextRunAtMs, E as scheduledTaskRunAttributes, F as ingestResourceEvent, G as consumeSandboxEgressAuthRequiredSignal, H as shouldPropagateSandboxEgressTrace, I as isResourceEventMailboxMetadata, K as consumeSandboxEgressPermissionDeniedSignal, L as renderTaskInput, P as processWorkspaceSnapshotJob, Q as AuthorizationFlowDisabledError, R as maybePostAutomatedTurnLimitNotice, S as renderAttachmentText, T as logScheduledTaskRunSkipped, U as SANDBOX_EGRESS_PROXY_PATH, V as normalizeSandboxEgressTracePropagationDomains, W as clearSandboxEgressSignals, X as buildSteeringPiMessage, Y as createUserTokenStore, Z as isVisionImageMediaType, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as getConfigDefaults, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestReportedProgress, n as createContextCompactor, o as deleteMcpAuthSessionsForUserProvider, q as parseSandboxEgressCredentialToken, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as setConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as recordFinishedTurnForAutomatedLimit } from "./agent-C9yuiZUF.js";
|
|
2
|
+
import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-ceE7NtvC.js";
|
|
3
|
+
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, C as withSpan, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, F as isRecord$1, I as toOptionalNumber, L as toOptionalString, S as withLogContext, _ as setSpanAttributes, d as logInfo, f as logWarn, g as setSentryUser, l as logError, n as createChatSdkLogger, o as getActiveTraceId, r as createRequestContext, t as buildTurnFailureResponse, u as logException, v as setSpanStatus, x as withContext, y as setTags } from "./logging-D37bayDc.js";
|
|
4
4
|
import { r as continueTrace } from "./sentry-CD3SdJl-.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-DcfJxB4z.js";
|
|
6
|
+
import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, l as getSlackClientSecret, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-CIE83sR2.js";
|
|
6
7
|
import { a as modelIdForProfile, n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
7
8
|
import { _ as parseSlackMessageTs, a as createActor, c as isActorUserId, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-B45_WqVX.js";
|
|
8
|
-
import {
|
|
9
|
+
import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, Ft as getConversationStore, G as isDmChannel, I as verifyEventTaskCredentialSubject, It as getDb, K as normalizeSlackConversationId, Kt as deleteProviderIdentityForSlackUser, L as verifyScheduledTaskCredentialSubject, Lt as getSqlExecutor, N as bindEventTaskCredentialSubject, Nt as getConversationEventStore, P as bindScheduledTaskCredentialSubject, R as verifySlackDirectCredentialSubject, Tt as resolveRootVisibility, U as getSlackClient, Vt as withConversationMutationLock, X as runWithWorkspaceTeamId, Y as getWorkspaceTeamId, Yt as createSlackDestination, Zt as requireSlackDestination, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectResourceEventMatchKeys, d as setPlugins, dt as findMatchingResourceEventSubscriptions, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, st as cancelSubscriptions, u as getPlugins, z as SlackActionError, zt as withConversationEventLock } from "./agent-hooks-DNjlz2A-.js";
|
|
9
10
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
13
|
-
import { $ as persistConversationMessages, F as commitMessages, J as recordSubscribedReplyRoute, L as loadConversationProjection, Mt as trimTrailingAssistantMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, Z as appendConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as getTurnRecordForResume, ct as isHumanConversationMessage, d as persistWithRetry, dt as recordDeliveredAssistantMessage, et as projectConversationMessages, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, jt as stripRuntimeTurnContext, l as listTurnSummaries, lt as markConversationMessage, m as buildTurnErrorResponse, mt as estimateTextTokens, n as loadTurnCheckpoint, nt as resolveConversationTitle, o as failTurnRecord, ot as estimateConversationContextTokens, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as persistConversationMessageSummaries, u as recordTurnSummary, ut as normalizeConversationText } from "./checkpoint-
|
|
14
|
-
import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-
|
|
15
|
-
import {
|
|
16
|
-
import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-
|
|
17
|
-
import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-
|
|
18
|
-
import {
|
|
11
|
+
import { _ as juniorConversationEvents, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, w as juniorConversations } from "./executor-BfbYPW63.js";
|
|
12
|
+
import { G as instructionProvenanceFor } from "./conversation-AA4R1VUn.js";
|
|
13
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-TBR8n4e1.js";
|
|
14
|
+
import { $ as persistConversationMessages, F as commitMessages, J as recordSubscribedReplyRoute, L as loadConversationProjection, Mt as trimTrailingAssistantMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, Z as appendConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as getTurnRecordForResume, ct as isHumanConversationMessage, d as persistWithRetry, dt as recordDeliveredAssistantMessage, et as projectConversationMessages, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, jt as stripRuntimeTurnContext, l as listTurnSummaries, lt as markConversationMessage, m as buildTurnErrorResponse, mt as estimateTextTokens, n as loadTurnCheckpoint, nt as resolveConversationTitle, o as failTurnRecord, ot as estimateConversationContextTokens, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as persistConversationMessageSummaries, u as recordTurnSummary, ut as normalizeConversationText } from "./checkpoint-BY47jJCB.js";
|
|
15
|
+
import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-CSixooTi.js";
|
|
16
|
+
import { Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Gt as buildDeterministicAssistantMessageId, It as stopConversationWork, Kt as buildDeterministicTurnId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledTaskLock, Tt as getConversation, U as findMatchingEventTasks, Vt as isInvalidConversationRecordError, X as getResourceEventCatalog, a as requestAttachmentDeletion, b as saveScheduledTaskInLock, c as parseSlackThreadId, g as listScheduledTasksForTeam, h as listScheduledTasks, o as storeAttachment, pt as appendAndEnqueueInboundMessage, r as collectAttachmentGarbage, ut as resourceEventGuidance, v as readScheduledTask, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventTaskMatchKeys, zt as hasRunnableConversationWork$1 } from "./stats-DKRP4rsY.js";
|
|
17
|
+
import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-BPUzcs7n.js";
|
|
18
|
+
import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-E67lFrDG.js";
|
|
19
|
+
import { a as RESOURCE_EVENT_SYSTEM_ACTOR, i as RESOURCE_EVENT_MESSAGE_AUTHOR, o as isResourceEventConversationMessage } from "./prompt-3gqNY1Ka.js";
|
|
20
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-Bn5q__9b.js";
|
|
19
21
|
import { l as conversationQueueMessageSchema, n as resolveConversationWorkQueueTopic, r as verifyConversationQueueMessage, t as getVercelConversationWorkQueue, u as isConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
|
|
20
|
-
import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
22
|
+
import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CyTc24Es.js";
|
|
21
23
|
import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
|
|
22
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
24
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-jn_46o4U.js";
|
|
23
25
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
24
|
-
import { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, a as webActorFromEmail, g as conversationVisibilityFromSlackChannelType, h as resolveConversationDestination, i as recordWebConversationActivity, n as conversationTurnIdForMessage, o as readConversationAccessFromSql, t as appendAndEnqueueWebMessage, v as resolveSlackChannelTypeFromMessage, w as GET$3, x as lookupSlackUser, y as resolveSlackConversationContext } from "./web-input-
|
|
25
|
-
import { u as recordTaskExecution } from "./execution-stats-
|
|
26
|
-
import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-
|
|
27
|
-
import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
28
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
29
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution-
|
|
30
|
-
import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
31
|
-
import { a as requireTurnFailureEventId, d as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, t as completeAuthPauseTurn, u as getTurnUserSlackMessageTs } from "./auth-pause-state-
|
|
32
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
33
|
-
import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-
|
|
34
|
-
import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-
|
|
35
|
-
import { t as processConversationWork } from "./worker-
|
|
36
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
26
|
+
import { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, a as webActorFromEmail, g as conversationVisibilityFromSlackChannelType, h as resolveConversationDestination, i as recordWebConversationActivity, n as conversationTurnIdForMessage, o as readConversationAccessFromSql, t as appendAndEnqueueWebMessage, v as resolveSlackChannelTypeFromMessage, w as GET$3, x as lookupSlackUser, y as resolveSlackConversationContext } from "./web-input-BPp_sc7t.js";
|
|
27
|
+
import { u as recordTaskExecution } from "./execution-stats-SiS2FLcv.js";
|
|
28
|
+
import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-alpjVSxQ.js";
|
|
29
|
+
import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-Di-ubSGg.js";
|
|
30
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-VbwZLfBv.js";
|
|
31
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-XtyzIHog.js";
|
|
32
|
+
import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-CRK7aA41.js";
|
|
33
|
+
import { a as requireTurnFailureEventId, d as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, t as completeAuthPauseTurn, u as getTurnUserSlackMessageTs } from "./auth-pause-state-MVZ6xvEK.js";
|
|
34
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CdpTvu4R.js";
|
|
35
|
+
import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-BO33aNQd.js";
|
|
36
|
+
import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-CsfLSfEs.js";
|
|
37
|
+
import { t as processConversationWork } from "./worker-Cu_D5Mr8.js";
|
|
38
|
+
import { t as bindSpawnAgent } from "./spawn-Dk0PqdH6.js";
|
|
37
39
|
import { createRequire } from "node:module";
|
|
38
40
|
import { pathToFileURL } from "node:url";
|
|
39
41
|
import { Hono } from "hono";
|
|
@@ -41,7 +43,6 @@ import { z } from "zod";
|
|
|
41
43
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
42
44
|
import { and, asc, eq, inArray, isNotNull, isNull, lte, or, sql } from "drizzle-orm";
|
|
43
45
|
import { RESOURCE_EVENT_SUMMARY_MAX_LENGTH, RESOURCE_EVENT_TEXT_MAX_LENGTH, createLocalSource, createResourceEventSource, createSlackSource, createWebSource, dispatchOptionsSchema, isSlackDestination, resourceEventSchema, userSchema } from "@sentry/junior-plugin-api";
|
|
44
|
-
import { alias } from "drizzle-orm/pg-core";
|
|
45
46
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
46
47
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
47
48
|
import { ChannelImpl, Message, ThreadImpl, stringifyMarkdown } from "chat";
|
|
@@ -1152,7 +1153,7 @@ async function runScheduledTaskHeartbeat(args) {
|
|
|
1152
1153
|
input: buildDispatchInput(task),
|
|
1153
1154
|
metadata,
|
|
1154
1155
|
replyAttribution: replyAttribution$1(task),
|
|
1155
|
-
outcomes: task.outcomes
|
|
1156
|
+
outcomes: effectiveTaskOutcomes(task.outcomes, task.destination)
|
|
1156
1157
|
}
|
|
1157
1158
|
});
|
|
1158
1159
|
} catch (error) {
|
|
@@ -1316,47 +1317,6 @@ async function GET$2(request, waitUntil, options = {}) {
|
|
|
1316
1317
|
return new Response("Accepted", { status: 202 });
|
|
1317
1318
|
}
|
|
1318
1319
|
//#endregion
|
|
1319
|
-
//#region src/chat/conversations/sql/privacy.ts
|
|
1320
|
-
const privacyRoot = alias(juniorConversations, "privacy_root");
|
|
1321
|
-
/** Accept only a structurally valid persisted root as privacy authority. */
|
|
1322
|
-
async function readRootCandidate(executor, conversationId) {
|
|
1323
|
-
const row = (await executor.db().select({
|
|
1324
|
-
requestedConversationId: juniorConversations.conversationId,
|
|
1325
|
-
requestedParentConversationId: juniorConversations.parentConversationId,
|
|
1326
|
-
requestedRootConversationId: juniorConversations.rootConversationId,
|
|
1327
|
-
rootConversationId: privacyRoot.conversationId,
|
|
1328
|
-
rootDestinationId: privacyRoot.destinationId,
|
|
1329
|
-
rootParentConversationId: privacyRoot.parentConversationId,
|
|
1330
|
-
rootRootConversationId: privacyRoot.rootConversationId
|
|
1331
|
-
}).from(juniorConversations).leftJoin(privacyRoot, eq(privacyRoot.conversationId, juniorConversations.rootConversationId)).where(eq(juniorConversations.conversationId, conversationId)))[0];
|
|
1332
|
-
return row?.requestedRootConversationId !== null && (row?.requestedParentConversationId !== null || row?.requestedRootConversationId === row?.requestedConversationId) && row?.rootConversationId === row.requestedRootConversationId && row.rootRootConversationId === row.rootConversationId && row.rootParentConversationId === null && row.rootDestinationId !== null ? {
|
|
1333
|
-
destinationId: row.rootDestinationId,
|
|
1334
|
-
rootConversationId: row.rootConversationId
|
|
1335
|
-
} : void 0;
|
|
1336
|
-
}
|
|
1337
|
-
async function readCandidateVisibility(executor, candidate) {
|
|
1338
|
-
const destinations = await executor.db().select({ visibility: juniorDestinations.visibility }).from(juniorDestinations).where(eq(juniorDestinations.id, candidate.destinationId)).for("share");
|
|
1339
|
-
return {
|
|
1340
|
-
rootConversationId: candidate.rootConversationId,
|
|
1341
|
-
visibility: destinations[0]?.visibility ?? null
|
|
1342
|
-
};
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* Resolve a conversation's privacy authority from its persisted root.
|
|
1346
|
-
*
|
|
1347
|
-
* Missing or structurally invalid root metadata fails closed. The root
|
|
1348
|
-
* destination is locked so callers that keep the transaction open receive a
|
|
1349
|
-
* stable visibility decision.
|
|
1350
|
-
*/
|
|
1351
|
-
async function resolveRootVisibility(executor, conversationId) {
|
|
1352
|
-
const candidate = await readRootCandidate(executor, conversationId);
|
|
1353
|
-
if (!candidate) return {
|
|
1354
|
-
rootConversationId: conversationId,
|
|
1355
|
-
visibility: null
|
|
1356
|
-
};
|
|
1357
|
-
return readCandidateVisibility(executor, candidate);
|
|
1358
|
-
}
|
|
1359
|
-
//#endregion
|
|
1360
1320
|
//#region src/chat/conversations/sql/purge.ts
|
|
1361
1321
|
/** Discover a root and its current descendants via `parent_conversation_id`. */
|
|
1362
1322
|
async function discoverConversationTree(executor, root) {
|
|
@@ -1423,14 +1383,20 @@ async function selectExpiredRoots(executor, args) {
|
|
|
1423
1383
|
)
|
|
1424
1384
|
or (
|
|
1425
1385
|
${juniorDestinations.visibility} is distinct from 'public'
|
|
1426
|
-
and
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1386
|
+
and (
|
|
1387
|
+
exists (
|
|
1388
|
+
select 1 from junior_conversation_briefs briefs
|
|
1389
|
+
where briefs.conversation_id = tree.conversation_id
|
|
1390
|
+
)
|
|
1391
|
+
or exists (
|
|
1392
|
+
select 1 from junior_conversations metadata
|
|
1393
|
+
where metadata.conversation_id = tree.conversation_id
|
|
1394
|
+
and (
|
|
1395
|
+
metadata.title is not null
|
|
1396
|
+
or metadata.channel_name is not null
|
|
1397
|
+
or metadata.actor_json is not null
|
|
1398
|
+
)
|
|
1399
|
+
)
|
|
1434
1400
|
)
|
|
1435
1401
|
)
|
|
1436
1402
|
)`;
|
|
@@ -1493,9 +1459,11 @@ async function purgeConversationTree(executor, args) {
|
|
|
1493
1459
|
await executor.db().delete(juniorAgentInvocations).where(or(inArray(juniorAgentInvocations.parentConversationId, ids), inArray(juniorAgentInvocations.childConversationId, ids)));
|
|
1494
1460
|
await executor.db().delete(juniorAgentBindings).where(or(inArray(juniorAgentBindings.parentConversationId, ids), inArray(juniorAgentBindings.childConversationId, ids)));
|
|
1495
1461
|
await requestAttachmentDeletion(executor, ids, args.nowMs);
|
|
1462
|
+
const scrubMetadata = args.retention ? !isPublic : resolvedScrubMetadata;
|
|
1463
|
+
if (scrubMetadata) await executor.db().delete(juniorConversationBriefs).where(inArray(juniorConversationBriefs.conversationId, ids));
|
|
1496
1464
|
await executor.db().update(juniorConversations).set({
|
|
1497
1465
|
transcriptPurgedAt: new Date(args.nowMs),
|
|
1498
|
-
...
|
|
1466
|
+
...scrubMetadata ? {
|
|
1499
1467
|
title: null,
|
|
1500
1468
|
channelName: null,
|
|
1501
1469
|
actor: null
|
|
@@ -5973,7 +5941,8 @@ function createSlackTurn(deps) {
|
|
|
5973
5941
|
channelId: outcome.destination.channelId,
|
|
5974
5942
|
conversationId,
|
|
5975
5943
|
replyAttribution: options.execution?.dispatch?.replyAttribution,
|
|
5976
|
-
text
|
|
5944
|
+
text,
|
|
5945
|
+
threadTs: outcome.destination.threadTs
|
|
5977
5946
|
});
|
|
5978
5947
|
slackMessageTs.push(...messageIds);
|
|
5979
5948
|
messageDestinations.push(...messageIds.map((messageId) => ({
|
|
@@ -6712,7 +6681,8 @@ function createSlackDispatchTurnRunner(options) {
|
|
|
6712
6681
|
},
|
|
6713
6682
|
raw: {
|
|
6714
6683
|
channel: dispatch.destination.channelId,
|
|
6715
|
-
team: dispatch.destination.teamId
|
|
6684
|
+
team: dispatch.destination.teamId,
|
|
6685
|
+
...dispatch.destination.threadTs ? { thread_ts: dispatch.destination.threadTs } : void 0
|
|
6716
6686
|
},
|
|
6717
6687
|
author: {
|
|
6718
6688
|
userId: dispatch.actor.name,
|
|
@@ -8071,7 +8041,7 @@ async function ingestEventTasks(input, options) {
|
|
|
8071
8041
|
input: eventInput(task, event),
|
|
8072
8042
|
metadata: { eventTaskId: task.id },
|
|
8073
8043
|
replyAttribution: replyAttribution(task),
|
|
8074
|
-
outcomes: task.outcomes
|
|
8044
|
+
outcomes: effectiveTaskOutcomes(task.outcomes, task.destination)
|
|
8075
8045
|
}
|
|
8076
8046
|
})).status === "created") dispatched += 1;
|
|
8077
8047
|
} catch (error) {
|
|
@@ -10167,6 +10137,7 @@ async function createApp(options) {
|
|
|
10167
10137
|
const previousSlackReactionConfig = getSlackReactionConfig();
|
|
10168
10138
|
const previousSandboxResources = getSandboxResourceConfig();
|
|
10169
10139
|
const previousExperimentalFeatures = getExperimentalFeatures();
|
|
10140
|
+
const previousBriefsConfig = setBriefsConfig(options?.briefs);
|
|
10170
10141
|
const previousDashboardLinkOptions = setDashboardConversationLinkOptions(dashboard);
|
|
10171
10142
|
const restoreRuntimeConfig = () => {
|
|
10172
10143
|
pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
|
|
@@ -10176,6 +10147,7 @@ async function createApp(options) {
|
|
|
10176
10147
|
setSlackReactionConfig(previousSlackReactionConfig);
|
|
10177
10148
|
setSandboxResourceConfig(previousSandboxResources);
|
|
10178
10149
|
setExperimentalFeatures(previousExperimentalFeatures);
|
|
10150
|
+
setBriefsConfig(previousBriefsConfig);
|
|
10179
10151
|
setDashboardConversationLinkOptions(previousDashboardLinkOptions);
|
|
10180
10152
|
};
|
|
10181
10153
|
let pluginRoutes = [];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-ceE7NtvC.js";
|
|
2
|
+
import { t as buildTurnFailureResponse } from "./logging-D37bayDc.js";
|
|
3
3
|
import { _ as parseSlackMessageTs } from "./context-B45_WqVX.js";
|
|
4
|
-
import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-
|
|
5
|
-
import {
|
|
6
|
-
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-
|
|
7
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
4
|
+
import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-BY47jJCB.js";
|
|
5
|
+
import { Kt as buildDeterministicTurnId } from "./stats-DKRP4rsY.js";
|
|
6
|
+
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-BPUzcs7n.js";
|
|
7
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CRK7aA41.js";
|
|
8
8
|
//#region src/chat/runtime/delivered-turn-state.ts
|
|
9
9
|
/** Build state after destination delivery or intentional no-reply completion. */
|
|
10
10
|
function buildDeliveredTurnStatePatch(args) {
|