@sentry/junior 0.222.0 → 0.223.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-7kKtDe-6.js → agent-Bzbf92vv.js} +87 -52
- package/dist/{agent-hooks-DkriF84n.js → agent-hooks-DZU5nsd1.js} +60 -16
- package/dist/{agent-runner-D0ImXS7U.js → agent-runner-2VQ9WhkG.js} +5 -5
- package/dist/api/schema.d.ts +160 -11
- package/dist/api/schema.js +2 -2
- package/dist/api.js +16 -16
- package/dist/{app-C0zbsnr7.d.ts → app-BbSD6EtD.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +120 -39
- package/dist/{auth-pause-state-3OT67TA8.js → auth-pause-state-Bn2vX4PA.js} +14 -25
- package/dist/{briefs-CNH1ztn5.js → briefs-BJPfCrlT.js} +6 -6
- package/dist/{catalog-runtime-XH_LFA_7.js → catalog-runtime-BthunUDD.js} +1 -1
- package/dist/{checkpoint-CRod8es5.js → checkpoint-Deu-OVb3.js} +11 -8
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-CcSboWx_.js → client-DjC6-6iU.js} +56 -6
- package/dist/{config-CGYv-YPE.js → config-CtoUVs72.js} +6 -7
- package/dist/{conversation-BBDt88di.js → conversation-1HUoZr2l.js} +33 -5
- package/dist/{conversation-privacy-BGjdDVWD.js → conversation-privacy-xS1t92xa.js} +1 -1
- package/dist/{credential-sync-BfzGNruT.js → credential-sync-CKdXEUDO.js} +77 -23
- package/dist/{execution-stats-D97ePWuM.js → execution-stats-CrXs9vSH.js} +3 -3
- package/dist/{executor-BLBZ-UB8.js → executor-AOhG9X1t.js} +1 -1
- package/dist/{history-CaV8Ww7M.d.ts → history-yaSjGMD_.d.ts} +18 -0
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-_8gxwDzt.js → job-queue-CNd9cpIy.js} +1 -1
- package/dist/{logging-qmsMdU0y.js → logging-DiN3o3nB.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-Mjfm46A5.js → oauth-callback-server-Ca0VLUEw.js} +2 -2
- package/dist/{pending-auth-_1Ry-_Bw.js → pending-auth-D7vmttn_.js} +2 -2
- package/dist/{profile-DbG8AlNd.js → profile-BsNrw8lj.js} +4 -4
- package/dist/{prompt-B8rCQI7K.js → prompt-90miy8VV.js} +1 -1
- package/dist/{registry-DGyQCsiy.js → registry-Dankt-Pl.js} +1 -1
- package/dist/{resolve-D5SqDbCA.js → resolve-B38CpJe2.js} +2 -2
- package/dist/{runner-BRAFjJhe.js → runner-Ck5rEjCm.js} +10 -10
- package/dist/{sandbox-egress-signals-CdI1aVHT.js → sandbox-egress-signals-BOfFkvly.js} +1 -1
- package/dist/{schema-CTOODa3L.js → schema-RpbW5Od2.js} +1 -1
- package/dist/{short-title-CB2fxEyx.js → short-title-BHd_jUFX.js} +2 -2
- package/dist/{skills-BoS3b8cg.js → skills-DbP4TDft.js} +2 -2
- package/dist/{spawn-BXCU1udr.js → spawn-DzXc_PKO.js} +2 -2
- package/dist/{stats-qUXQZq-w.js → stats-pNGp3G5q.js} +19 -17
- package/dist/{task-queue-Di_q8922.js → task-queue-Cy9y1foT.js} +3 -3
- package/dist/{task-runner-4rCppQMo.js → task-runner-DI1FBJFJ.js} +8 -8
- package/dist/{thread-state-2Paza8DV.js → thread-state-DXgxOYpZ.js} +5 -5
- package/dist/{turn-execution--F7a9kEU.js → turn-execution-BNOXrZ-M.js} +3 -3
- package/dist/{turn-lifecycle-f-y0Irpi.js → turn-lifecycle-Bjf6y2GO.js} +1 -1
- package/dist/{validation-Be9lSORU.js → validation-D5CIslEu.js} +1 -1
- package/dist/{version-BydrOZMQ.js → version-_ZQFlslB.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BdfOkTuG.js → web-authorization-6mmfS_o-.js} +1 -1
- package/dist/{web-input-DegYUyKU.js → web-input-BJpWm6go.js} +7 -7
- package/dist/{work-Citqpnfc.js → work-DvIlJR3C.js} +9 -9
- package/dist/{worker-Bn_HFyvM.js → worker-D1qidg-Y.js} +5 -5
- package/package.json +4 -4
package/dist/app.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { $ as AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-
|
|
2
|
-
import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-
|
|
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 AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-Bzbf92vv.js";
|
|
2
|
+
import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-DjC6-6iU.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-DiN3o3nB.js";
|
|
4
4
|
import { r as continueTrace } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
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-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-_ZQFlslB.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-CtoUVs72.js";
|
|
7
7
|
import { a as modelIdForProfile, n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
8
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-Bplcgypl.js";
|
|
9
|
-
import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel,
|
|
9
|
+
import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel, I as verifyEventAutomationCredentialSubject, Jt as getSqlExecutor, K as normalizeSlackConversationId, Kt as getConversationStore, L as verifyScheduledAutomationCredentialSubject, Lt as listConversationAnnotations, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, Q as readActorIdentity, Qt as withConversationMutationLock, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationEventStore, X as runWithWorkspaceTeamId, Xt as withConversationEventLock, Y as getWorkspaceTeamId, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, cn as deleteProviderIdentityForSlackUser, ct as collectEventMatchKeys, d as setPlugins, dn as createSlackDestination, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, ht as getDashboardTaskLink, i as getPluginApiRoutes, mt as getDashboardConversationLink, ot as cancelSubscriptions, pn as requireSlackDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, qt as getDb, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-DZU5nsd1.js";
|
|
10
10
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
11
|
-
import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-
|
|
12
|
-
import {
|
|
13
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
14
|
-
import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-
|
|
15
|
-
import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-
|
|
16
|
-
import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats-
|
|
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-
|
|
18
|
-
import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-
|
|
19
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-
|
|
20
|
-
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-
|
|
11
|
+
import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-AOhG9X1t.js";
|
|
12
|
+
import { Y as instructionProvenanceFor, k as annotationCard } from "./conversation-1HUoZr2l.js";
|
|
13
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BthunUDD.js";
|
|
14
|
+
import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-Deu-OVb3.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-BsNrw8lj.js";
|
|
16
|
+
import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats-pNGp3G5q.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-D7vmttn_.js";
|
|
18
|
+
import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-2VQ9WhkG.js";
|
|
19
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-90miy8VV.js";
|
|
20
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-B38CpJe2.js";
|
|
21
21
|
import { l as conversationQueueMessageSchema, n as resolveConversationWorkQueueTopic, r as verifyConversationQueueMessage, t as getVercelConversationWorkQueue, u as isConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
|
|
22
|
-
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-CNd9cpIy.js";
|
|
23
23
|
import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
|
|
24
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
24
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-D5CIslEu.js";
|
|
25
25
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
26
|
-
import { S as GET$3, _ as readViewerAutomationSummary, a as webActorFromEmail, b as legacyWebMailboxMetadataSchema, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, n as conversationTurnIdForMessage, o as resolveConversationDestination, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext, x as createVercelAttachmentStorage, y as lookupSlackUser } from "./web-input-
|
|
27
|
-
import { u as recordAutomationExecution } from "./execution-stats-
|
|
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-
|
|
29
|
-
import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
30
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
31
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution
|
|
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-
|
|
33
|
-
import { a as requireTurnFailureEventId, c as getTurnUserMessage, d as getTurnUserSlackMessageTs, f as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, t as completeAuthPauseTurn, u as getTurnUserReplyAttachmentContext } from "./auth-pause-state-
|
|
34
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
35
|
-
import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as
|
|
36
|
-
import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-
|
|
37
|
-
import { t as processConversationWork } from "./worker-
|
|
38
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
26
|
+
import { S as GET$3, _ as readViewerAutomationSummary, a as webActorFromEmail, b as legacyWebMailboxMetadataSchema, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, n as conversationTurnIdForMessage, o as resolveConversationDestination, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext, x as createVercelAttachmentStorage, y as lookupSlackUser } from "./web-input-BJpWm6go.js";
|
|
27
|
+
import { u as recordAutomationExecution } from "./execution-stats-CrXs9vSH.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-DI1FBJFJ.js";
|
|
29
|
+
import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-DvIlJR3C.js";
|
|
30
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bjf6y2GO.js";
|
|
31
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-BNOXrZ-M.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-DXgxOYpZ.js";
|
|
33
|
+
import { a as requireTurnFailureEventId, c as getTurnUserMessage, d as getTurnUserSlackMessageTs, f as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, t as completeAuthPauseTurn, u as getTurnUserReplyAttachmentContext } from "./auth-pause-state-Bn2vX4PA.js";
|
|
34
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-Cy9y1foT.js";
|
|
35
|
+
import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as renderSlackObjectCard, 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-CKdXEUDO.js";
|
|
36
|
+
import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-6mmfS_o-.js";
|
|
37
|
+
import { t as processConversationWork } from "./worker-D1qidg-Y.js";
|
|
38
|
+
import { t as bindSpawnAgent } from "./spawn-DzXc_PKO.js";
|
|
39
39
|
import { createRequire } from "node:module";
|
|
40
40
|
import { pathToFileURL } from "node:url";
|
|
41
41
|
import { Hono } from "hono";
|
|
@@ -1920,6 +1920,85 @@ async function GET(request) {
|
|
|
1920
1920
|
});
|
|
1921
1921
|
}
|
|
1922
1922
|
//#endregion
|
|
1923
|
+
//#region src/chat/slack/annotation-details.ts
|
|
1924
|
+
const eventSchema$1 = z.object({
|
|
1925
|
+
trigger_id: z.string().min(1),
|
|
1926
|
+
user: z.string().min(1),
|
|
1927
|
+
external_ref: z.object({
|
|
1928
|
+
type: z.literal("annotation"),
|
|
1929
|
+
id: z.string().max(4096)
|
|
1930
|
+
})
|
|
1931
|
+
});
|
|
1932
|
+
const refSchema = z.tuple([
|
|
1933
|
+
z.string().min(1),
|
|
1934
|
+
z.string().min(1),
|
|
1935
|
+
z.string().min(1)
|
|
1936
|
+
]);
|
|
1937
|
+
/** Show saved annotation facts only to a viewer who can read their Conversation. */
|
|
1938
|
+
async function presentSlackAnnotationDetails(event, teamId) {
|
|
1939
|
+
const triggerId = event.trigger_id;
|
|
1940
|
+
if (typeof triggerId !== "string" || !triggerId) return;
|
|
1941
|
+
const client = getSlackClient();
|
|
1942
|
+
const missing = () => client.entity.presentDetails({
|
|
1943
|
+
trigger_id: triggerId,
|
|
1944
|
+
error: { status: "not_found" }
|
|
1945
|
+
});
|
|
1946
|
+
const parsed = eventSchema$1.safeParse(event);
|
|
1947
|
+
if (!parsed.success || !teamId) {
|
|
1948
|
+
await missing();
|
|
1949
|
+
return;
|
|
1950
|
+
}
|
|
1951
|
+
let value;
|
|
1952
|
+
try {
|
|
1953
|
+
value = JSON.parse(parsed.data.external_ref.id);
|
|
1954
|
+
} catch {
|
|
1955
|
+
await missing();
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
const ref = refSchema.safeParse(value);
|
|
1959
|
+
if (!ref.success) {
|
|
1960
|
+
await missing();
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
const [conversationId, plugin, key] = ref.data;
|
|
1964
|
+
const db = getDb();
|
|
1965
|
+
const identity = await readActorIdentity({
|
|
1966
|
+
platform: "slack",
|
|
1967
|
+
teamId,
|
|
1968
|
+
userId: parsed.data.user
|
|
1969
|
+
});
|
|
1970
|
+
if (!identity?.user) {
|
|
1971
|
+
await missing();
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
const [location] = await db.select({
|
|
1975
|
+
teamId: juniorDestinations.providerTenantId,
|
|
1976
|
+
provider: juniorDestinations.provider
|
|
1977
|
+
}).from(juniorConversations).innerJoin(juniorDestinations, eq(juniorDestinations.id, juniorConversations.destinationId)).where(eq(juniorConversations.conversationId, conversationId));
|
|
1978
|
+
if (location?.provider !== "slack" || location.teamId !== teamId) {
|
|
1979
|
+
await missing();
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
if (!(await readConversationAccessFromSql(db, [conversationId], identity.user)).get(conversationId)?.canViewPrivateContent) {
|
|
1983
|
+
await missing();
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
const annotation = (await listConversationAnnotations(db, conversationId)).find((item) => item.plugin === plugin && item.key === key);
|
|
1987
|
+
if (!annotation) {
|
|
1988
|
+
await missing();
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
const entity = renderSlackObjectCard(annotationCard(annotation), conversationId).entity;
|
|
1992
|
+
if (!entity) {
|
|
1993
|
+
await missing();
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
await client.entity.presentDetails({
|
|
1997
|
+
trigger_id: parsed.data.trigger_id,
|
|
1998
|
+
metadata: entity
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
//#endregion
|
|
1923
2002
|
//#region src/chat/services/subscribed-reply-router-policy.ts
|
|
1924
2003
|
/**
|
|
1925
2004
|
* Passive subscribed-thread reply router policy.
|
|
@@ -2314,8 +2393,11 @@ function readRawBlocks(raw) {
|
|
|
2314
2393
|
return raw.blocks;
|
|
2315
2394
|
}
|
|
2316
2395
|
function renderTopLevelText(message) {
|
|
2396
|
+
const blocks = readRawBlocks(message.raw);
|
|
2397
|
+
const blockText = renderBlockText(blocks);
|
|
2398
|
+
if (Array.isArray(blocks) && blocks.some((block) => block?.type === "section") && blockText) return blockText;
|
|
2317
2399
|
if (message.formatted.children.length > 0) return stringifyMarkdown(message.formatted).trim();
|
|
2318
|
-
return message.text.trim() ||
|
|
2400
|
+
return message.text.trim() || blockText;
|
|
2319
2401
|
}
|
|
2320
2402
|
/** Parse the agent-visible content and attachment state of a Slack message. */
|
|
2321
2403
|
function parseContent(message) {
|
|
@@ -4851,7 +4933,7 @@ async function routeParsedMessage(args) {
|
|
|
4851
4933
|
const message = normalized.message;
|
|
4852
4934
|
const canonicalThreadId = normalized.threadId;
|
|
4853
4935
|
const botUserId = args.adapter.botUserId;
|
|
4854
|
-
const isMention = Boolean(botUserId && textMentionsBot(args.event.text ?? "", botUserId));
|
|
4936
|
+
const isMention = Boolean(botUserId && (textMentionsBot(args.event.text ?? "", botUserId) || args.event.blocks?.some((block) => block.type === "section" && block.text?.type === "mrkdwn" && textMentionsBot(block.text.text, botUserId))));
|
|
4855
4937
|
if (isMention) message.isMention = true;
|
|
4856
4938
|
const isDirectMessage = isDmEvent(args.event);
|
|
4857
4939
|
const isSubscribed = !isDirectMessage && !isMention && await args.state.isSubscribed(canonicalThreadId);
|
|
@@ -4961,7 +5043,9 @@ async function handleSlackEvent(args) {
|
|
|
4961
5043
|
return;
|
|
4962
5044
|
}
|
|
4963
5045
|
if (event.type === "entity_details_requested") {
|
|
4964
|
-
|
|
5046
|
+
const ref = event.external_ref;
|
|
5047
|
+
if (ref && typeof ref === "object" && "type" in ref && ref.type === "annotation") await presentSlackAnnotationDetails(event, installation.teamId);
|
|
5048
|
+
else await presentSlackAutomationDetails(event, installation.teamId);
|
|
4965
5049
|
return;
|
|
4966
5050
|
}
|
|
4967
5051
|
if (event.type === "app_home_opened" && event.user) {
|
|
@@ -5937,10 +6021,10 @@ function createSlackTurn(deps) {
|
|
|
5937
6021
|
messageId
|
|
5938
6022
|
})));
|
|
5939
6023
|
}
|
|
5940
|
-
else
|
|
6024
|
+
else {
|
|
5941
6025
|
slackMessageTs = await sendSlackReply({
|
|
5942
6026
|
cards,
|
|
5943
|
-
channelId,
|
|
6027
|
+
channelId: destination.channelId,
|
|
5944
6028
|
conversationId,
|
|
5945
6029
|
replyAttribution: options.execution?.dispatch?.replyAttribution,
|
|
5946
6030
|
text,
|
|
@@ -5950,9 +6034,6 @@ function createSlackTurn(deps) {
|
|
|
5950
6034
|
destination,
|
|
5951
6035
|
messageId: threadTs ?? messageId
|
|
5952
6036
|
})));
|
|
5953
|
-
} else for (const part of splitSlackReplyText(text)) {
|
|
5954
|
-
const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
|
|
5955
|
-
if (postedMessageTs) slackMessageTs.push(postedMessageTs);
|
|
5956
6037
|
}
|
|
5957
6038
|
} catch (error) {
|
|
5958
6039
|
if (isRetryableSlackPostError(error)) throw new RetryableDeliveryError(error);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-
|
|
2
|
-
import { F as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-DjC6-6iU.js";
|
|
2
|
+
import { F as isRecord, t as buildTurnFailureResponse } from "./logging-DiN3o3nB.js";
|
|
3
3
|
import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
|
|
4
|
-
import {
|
|
5
|
-
import { A as readMessageCards } from "./conversation-
|
|
6
|
-
import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-
|
|
7
|
-
import { qt as buildDeterministicTurnId } from "./stats-
|
|
8
|
-
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-
|
|
9
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
4
|
+
import { Wt as getConversationEventStore } from "./agent-hooks-DZU5nsd1.js";
|
|
5
|
+
import { A as messageCardKey, N as readMessageCards, j as messageCardRefSchema } from "./conversation-1HUoZr2l.js";
|
|
6
|
+
import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-Deu-OVb3.js";
|
|
7
|
+
import { qt as buildDeterministicTurnId } from "./stats-pNGp3G5q.js";
|
|
8
|
+
import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-D7vmttn_.js";
|
|
9
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DXgxOYpZ.js";
|
|
10
10
|
//#region src/chat/runtime/delivered-turn-state.ts
|
|
11
11
|
/** Build state after destination delivery or intentional no-reply completion. */
|
|
12
12
|
function buildDeliveredTurnStatePatch(args) {
|
|
@@ -56,14 +56,6 @@ function getTurnUserReplyAttachmentContext(message) {
|
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/chat/conversations/pending-cards.ts
|
|
59
|
-
const CARD_TOOLS = /* @__PURE__ */ new Set([
|
|
60
|
-
"createEventAutomation",
|
|
61
|
-
"updateEventAutomation",
|
|
62
|
-
"deleteEventAutomation",
|
|
63
|
-
"slackScheduleCreateAutomation",
|
|
64
|
-
"slackScheduleUpdateAutomation",
|
|
65
|
-
"slackScheduleDeleteAutomation"
|
|
66
|
-
]);
|
|
67
59
|
/** Read undelivered card snapshots across resume and history replacement. */
|
|
68
60
|
async function loadPendingMessageCards(conversationId) {
|
|
69
61
|
const cards = /* @__PURE__ */ new Map();
|
|
@@ -82,15 +74,12 @@ async function loadPendingMessageCards(conversationId) {
|
|
|
82
74
|
for (const event of [...page.events].reverse()) {
|
|
83
75
|
const data = event.data;
|
|
84
76
|
if (data.type === "turn_started" || data.type === "message" && data.role === "assistant") return [...cards.values()].reverse();
|
|
85
|
-
if (data.type !== "tool_result" || data.isError || typeof data.toolName !== "string" || !
|
|
86
|
-
if (data.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
for (const card of readMessageCards(data.details.cards)) {
|
|
92
|
-
const key = `${card.kind}:${card.id}`;
|
|
93
|
-
if (!deleted.has(card.id) && !cards.has(key)) cards.set(key, card);
|
|
77
|
+
if (data.type !== "tool_result" || data.isError || typeof data.toolName !== "string" || !isRecord(data.details)) continue;
|
|
78
|
+
if (data.details.timed_out === true) continue;
|
|
79
|
+
if (Array.isArray(data.details.removedCards)) for (const ref of messageCardRefSchema.array().parse(data.details.removedCards)) deleted.add(JSON.stringify([ref.plugin, ref.key]));
|
|
80
|
+
for (const card of readMessageCards(data.details)) {
|
|
81
|
+
const key = messageCardKey(card);
|
|
82
|
+
if (!deleted.has(key) && !cards.has(key)) cards.set(key, card);
|
|
94
83
|
}
|
|
95
84
|
}
|
|
96
85
|
if (!page.hasOlder || page.events.length === 0) return [...cards.values()].reverse();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-DjC6-6iU.js";
|
|
2
2
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { P as briefCodeChangeSchema, R as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-1HUoZr2l.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-90miy8VV.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -179,11 +179,11 @@ function briefInputFromSnapshot(snapshot, throughIndex) {
|
|
|
179
179
|
const bounded = codeChangeAt(change, boundaryMs);
|
|
180
180
|
return bounded ? [bounded] : [];
|
|
181
181
|
}),
|
|
182
|
-
resources: (detail.annotations ?? []).
|
|
182
|
+
resources: (detail.annotations ?? []).flatMap((annotation) => annotation.url !== null && Date.parse(annotation.createdAt) <= boundaryMs ? [{
|
|
183
183
|
label: annotation.label,
|
|
184
184
|
url: annotation.url,
|
|
185
185
|
...annotation.status ? { status: annotation.status } : void 0
|
|
186
|
-
})
|
|
186
|
+
}] : [])
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
/** Return the last event index included in a conversation snapshot. */
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-CtoUVs72.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-Dankt-Pl.js";
|
|
3
3
|
//#region src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-DjC6-6iU.js";
|
|
2
|
+
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-DiN3o3nB.js";
|
|
3
|
+
import { n as botConfig } from "./config-CtoUVs72.js";
|
|
4
4
|
import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
|
|
5
|
-
import { Bt as
|
|
6
|
-
import {
|
|
7
|
-
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-
|
|
8
|
-
import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-
|
|
5
|
+
import { Bt as agentsInstructionsUpdatedEvent, Ht as authenticationUnlinkedEvent, Jt as getSqlExecutor, Kt as getConversationStore, Vt as authenticationLinkedEvent, Wt as getConversationEventStore, Xt as withConversationEventLock, Yt as createSqlConversationEventStore, Zt as sanitizePostgresJson, en as bindProviderConversation, nn as addAgentTurnUsage, zt as JUNIOR_NATIVE_EVENT_NAMESPACE } from "./agent-hooks-DZU5nsd1.js";
|
|
6
|
+
import { B as agentHistoryItemSchema, J as instructionActors, Y as instructionProvenanceFor, q as contextProvenance } from "./conversation-1HUoZr2l.js";
|
|
7
|
+
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-BHd_jUFX.js";
|
|
8
|
+
import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-BsNrw8lj.js";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
@@ -237,6 +237,8 @@ function recordDeliveredAssistantMessage(args) {
|
|
|
237
237
|
replied: true,
|
|
238
238
|
skippedReason: void 0
|
|
239
239
|
});
|
|
240
|
+
const cards = args.cards?.filter((card) => card.kind === "automation");
|
|
241
|
+
const objectCards = args.cards?.filter((card) => card.kind === "object");
|
|
240
242
|
upsertConversationMessage(args.conversation, {
|
|
241
243
|
id: messageId,
|
|
242
244
|
role: "assistant",
|
|
@@ -247,7 +249,8 @@ function recordDeliveredAssistantMessage(args) {
|
|
|
247
249
|
isBot: true
|
|
248
250
|
},
|
|
249
251
|
meta: {
|
|
250
|
-
...
|
|
252
|
+
...cards?.length ? { cards } : void 0,
|
|
253
|
+
...objectCards?.length ? { objectCards } : void 0,
|
|
251
254
|
replied: true,
|
|
252
255
|
...args.source ? { source: args.source } : void 0
|
|
253
256
|
}
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as executeAgentRun } from "../agent-
|
|
2
|
-
import { t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { t as executeAgentRun } from "../agent-Bzbf92vv.js";
|
|
2
|
+
import { t as createAgentRunner } from "../agent-runner-2VQ9WhkG.js";
|
|
3
3
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -101,10 +101,10 @@ async function loadLocalPluginSet() {
|
|
|
101
101
|
async function configureLocalChatPlugins(pluginSet) {
|
|
102
102
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
103
103
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
104
|
-
import("../agent-hooks-
|
|
105
|
-
import("../catalog-runtime-
|
|
106
|
-
import("../validation-
|
|
107
|
-
import("../agent-hooks-
|
|
104
|
+
import("../agent-hooks-DZU5nsd1.js").then((n) => n.t),
|
|
105
|
+
import("../catalog-runtime-BthunUDD.js").then((n) => n.t),
|
|
106
|
+
import("../validation-D5CIslEu.js").then((n) => n.r),
|
|
107
|
+
import("../agent-hooks-DZU5nsd1.js").then((n) => n.Ut)
|
|
108
108
|
]);
|
|
109
109
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
110
110
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -156,16 +156,16 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
156
156
|
await configureLocalChatPlugins(pluginSet);
|
|
157
157
|
const { setExperimentalFeatures } = await import("../experimental-CIXf7Uye.js").then((n) => n.t);
|
|
158
158
|
setExperimentalFeatures({ subagents: true });
|
|
159
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
159
|
+
const { setBriefsConfig } = await import("../agent-hooks-DZU5nsd1.js").then((n) => n.m);
|
|
160
160
|
setBriefsConfig({ enabled: true });
|
|
161
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
162
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
161
|
+
const { runLocalAgentTurn } = await import("../runner-Ck5rEjCm.js");
|
|
162
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Ca0VLUEw.js");
|
|
163
163
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
164
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
165
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
164
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BOfFkvly.js");
|
|
165
|
+
const { bindSpawnAgent } = await import("../spawn-DzXc_PKO.js").then((n) => n.n);
|
|
166
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-DvIlJR3C.js").then((n) => n.a);
|
|
167
167
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
168
|
-
const { processConversationWork } = await import("../worker-
|
|
168
|
+
const { processConversationWork } = await import("../worker-D1qidg-Y.js").then((n) => n.n);
|
|
169
169
|
let agentRunner;
|
|
170
170
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
171
171
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DiN3o3nB.js";
|
|
2
|
+
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-Dankt-Pl.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DbP4TDft.js";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runBriefs(argv) {
|
|
28
|
-
return await (await import("../briefs-
|
|
28
|
+
return await (await import("../briefs-BJPfCrlT.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { bt as createPluginLogger, d as setPlugins, f as validatePlugins, qt as getDb } from "../agent-hooks-DZU5nsd1.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BthunUDD.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-D5CIslEu.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BthunUDD.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-BsNrw8lj.js";
|
|
3
|
+
import { r as resolve } from "../resolve-B38CpJe2.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-CtoUVs72.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-AOhG9X1t.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-Dankt-Pl.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-xS1t92xa.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";
|
|
@@ -304,6 +304,31 @@ registerApiProvider({
|
|
|
304
304
|
const GATEWAY_PROVIDER = "vercel-ai-gateway";
|
|
305
305
|
const GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh";
|
|
306
306
|
const GATEWAY_MODEL_OVERRIDES = {
|
|
307
|
+
"anthropic/claude-opus-5.5": {
|
|
308
|
+
id: "anthropic/claude-opus-5.5",
|
|
309
|
+
name: "Claude Opus 5.5",
|
|
310
|
+
api: "anthropic-messages",
|
|
311
|
+
provider: GATEWAY_PROVIDER,
|
|
312
|
+
baseUrl: GATEWAY_BASE_URL,
|
|
313
|
+
reasoning: true,
|
|
314
|
+
input: ["text", "image"],
|
|
315
|
+
cost: {
|
|
316
|
+
input: 4,
|
|
317
|
+
output: 20,
|
|
318
|
+
cacheRead: .2,
|
|
319
|
+
cacheWrite: 5
|
|
320
|
+
},
|
|
321
|
+
contextWindow: 1e6,
|
|
322
|
+
maxTokens: 128e3,
|
|
323
|
+
thinkingLevelMap: {
|
|
324
|
+
xhigh: "xhigh",
|
|
325
|
+
max: "max"
|
|
326
|
+
},
|
|
327
|
+
compat: {
|
|
328
|
+
forceAdaptiveThinking: true,
|
|
329
|
+
supportsTemperature: false
|
|
330
|
+
}
|
|
331
|
+
},
|
|
307
332
|
"xai/grok-4.5": {
|
|
308
333
|
id: "xai/grok-4.5",
|
|
309
334
|
name: "Grok 4.5",
|
|
@@ -321,6 +346,34 @@ const GATEWAY_MODEL_OVERRIDES = {
|
|
|
321
346
|
contextWindow: 5e5,
|
|
322
347
|
maxTokens: 5e5
|
|
323
348
|
},
|
|
349
|
+
"openai/gpt-6-luna": {
|
|
350
|
+
id: "openai/gpt-6-luna",
|
|
351
|
+
name: "GPT-6 Luna",
|
|
352
|
+
api: "anthropic-messages",
|
|
353
|
+
provider: GATEWAY_PROVIDER,
|
|
354
|
+
baseUrl: GATEWAY_BASE_URL,
|
|
355
|
+
reasoning: true,
|
|
356
|
+
input: ["text", "image"],
|
|
357
|
+
cost: {
|
|
358
|
+
input: .1,
|
|
359
|
+
output: .5,
|
|
360
|
+
cacheRead: .01,
|
|
361
|
+
cacheWrite: .125,
|
|
362
|
+
tiers: [{
|
|
363
|
+
inputTokensAbove: 272e3,
|
|
364
|
+
input: .2,
|
|
365
|
+
output: .75,
|
|
366
|
+
cacheRead: .02,
|
|
367
|
+
cacheWrite: .25
|
|
368
|
+
}]
|
|
369
|
+
},
|
|
370
|
+
contextWindow: 105e4,
|
|
371
|
+
maxTokens: 128e3,
|
|
372
|
+
thinkingLevelMap: {
|
|
373
|
+
xhigh: "xhigh",
|
|
374
|
+
max: "max"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
324
377
|
"openai/gpt-6-astra": {
|
|
325
378
|
id: "openai/gpt-6-astra",
|
|
326
379
|
name: "GPT-6 Astra",
|
|
@@ -373,10 +426,7 @@ function embeddingCostUsd(modelId, inputTokens) {
|
|
|
373
426
|
function extractText(message) {
|
|
374
427
|
return (message.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text ?? "").join("").trim();
|
|
375
428
|
}
|
|
376
|
-
/**
|
|
377
|
-
* Look up a gateway model by id. Junior-owned overrides let new gateway
|
|
378
|
-
* models work before pi-ai publishes an updated bundled catalog.
|
|
379
|
-
*/
|
|
429
|
+
/** Resolve gateway models through local overrides, then Pi's bundled catalog. */
|
|
380
430
|
function resolveGatewayModel(modelId) {
|
|
381
431
|
const matched = GATEWAY_MODEL_OVERRIDES[modelId] ?? getModels(GATEWAY_PROVIDER).find((model) => model.id === modelId);
|
|
382
432
|
if (!matched) throw new Error(`Unknown AI Gateway model id: ${modelId}`);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-DjC6-6iU.js";
|
|
3
|
+
import { f as logWarn } from "./logging-DiN3o3nB.js";
|
|
4
4
|
import { c as TURN_REASONING_LEVELS, l as parseTurnReasoningLevel, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
|
|
5
|
-
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
6
5
|
//#region src/chat/slack/emoji.ts
|
|
7
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
8
7
|
function normalizeSlackEmojiName(value) {
|
|
@@ -126,10 +125,10 @@ function parseCrossActorMidRunMode(rawValue) {
|
|
|
126
125
|
throw new Error("JUNIOR_CROSS_ACTOR_MID_RUN_MODE must be follow_up or steer");
|
|
127
126
|
}
|
|
128
127
|
const DEFAULT_MODEL_ID = "xai/grok-4.5";
|
|
129
|
-
const DEFAULT_FAST_MODEL_ID =
|
|
130
|
-
const DEFAULT_GUARDIAN_MODEL_ID =
|
|
131
|
-
const DEFAULT_HANDOFF_MODEL_ID =
|
|
132
|
-
const DEFAULT_WEB_SEARCH_MODEL_ID =
|
|
128
|
+
const DEFAULT_FAST_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
129
|
+
const DEFAULT_GUARDIAN_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
130
|
+
const DEFAULT_HANDOFF_MODEL_ID = resolveGatewayModel("anthropic/claude-opus-5.5").id;
|
|
131
|
+
const DEFAULT_WEB_SEARCH_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
133
132
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
134
133
|
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "google/gemini-3-pro-image";
|
|
135
134
|
function validateGatewayModelId(raw) {
|