@sentry/junior 0.210.1 → 0.211.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-CbAaXPT7.js → agent-XXC-9m0B.js} +356 -31
- package/dist/{agent-hooks-CbFeRDRP.js → agent-hooks-7vR8uZw2.js} +6 -6
- package/dist/{agent-runner-CcPlgDIx.js → agent-runner-CqXaUvvQ.js} +5 -5
- package/dist/api.js +15 -15
- package/dist/app.js +30 -48
- package/dist/{auth-pause-state-BImcZ0Wo.js → auth-pause-state-r-1vEoSX.js} +6 -6
- package/dist/{briefs-D1rYGjCn.js → briefs-DIj_YgLE.js} +2 -2
- package/dist/{catalog-runtime-Dj_tC_Hx.js → catalog-runtime-BMMLIpxX.js} +1 -1
- package/dist/{checkpoint-CTBVbFYq.js → checkpoint-B6jEtGHN.js} +150 -527
- 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-BvhLSDdj.js → client-BBPo9KiG.js} +2 -2
- package/dist/{config-DfGsDs-7.js → config-DMq-uJAV.js} +2 -2
- package/dist/{conversation-privacy-Cj51CVTB.js → conversation-privacy-D99FrYrV.js} +1 -1
- package/dist/{credential-sync-DfJK1MWh.js → credential-sync-Cz1T9Ws-.js} +23 -32
- package/dist/{execution-stats--y9Jggoy.js → execution-stats-BkCnuVBv.js} +4 -4
- package/dist/{executor-DotJl2jl.js → executor-B5VURdwg.js} +1 -1
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-pdf1uj5X.js → job-queue-DUs_jnBa.js} +1 -1
- package/dist/{logging-Bb_U9Vff.js → logging-CXQcqM-W.js} +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DyJkq4qL.js → oauth-callback-server-B0KXcd24.js} +2 -2
- package/dist/{pending-auth-D0_QYjpu.js → pending-auth-CxZjizu_.js} +2 -2
- package/dist/{profile-BGU13Ftr.js → profile-8K6D5LHD.js} +4 -4
- package/dist/{registry-DmJtt89-.js → registry-DUa5NdZP.js} +1 -1
- package/dist/{resolve-DOmkFjRY.js → resolve-E_-QQ8pM.js} +2 -2
- package/dist/{runner-Bw_iSMQT.js → runner-Bf0HnWqY.js} +10 -10
- package/dist/{sandbox-egress-signals-BcD4xbJ5.js → sandbox-egress-signals-BW9FzWoQ.js} +1 -1
- package/dist/{skills-BosqkO9V.js → skills-B1f5Ku_s.js} +2 -2
- package/dist/{spawn-DZQ3VVgQ.js → spawn-BsOCLy8T.js} +2 -2
- package/dist/{stats-C9s5HTPZ.js → stats-CrITkCy5.js} +15 -7
- package/dist/{task-queue-CpgBemXY.js → task-queue-CcqJCAUd.js} +3 -3
- package/dist/{task-runner-DZa0IGwl.js → task-runner-7IOXx_Uo.js} +7 -7
- package/dist/{thread-state-BnTTDCWs.js → thread-state-Y3PGLZQa.js} +5 -5
- package/dist/{turn-execution-Ba_SruNW.js → turn-execution-Bm6Xbaoi.js} +3 -3
- package/dist/{turn-lifecycle-BQtgEQo-.js → turn-lifecycle-Czzk8ila.js} +1 -1
- package/dist/{usage-D0KzRV9P.js → usage-DHJ3ng2s.js} +3 -12
- package/dist/{validation-DCl2ucHB.js → validation-A2SMrAkJ.js} +1 -1
- package/dist/{version-w5qqIpsQ.js → version-CfRx6f_C.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-KnR0oZcQ.js → web-authorization-DN3cJuLB.js} +1 -1
- package/dist/{web-input-BiDGtDS0.js → web-input-lJH42B_R.js} +4 -4
- package/dist/{work-CaIyEe2C.js → work-CRHJu3hb.js} +9 -9
- package/dist/{worker-BQWJdxvm.js → worker-D6oTNemM.js} +5 -5
- package/package.json +4 -4
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { C as resolveGatewayCredential, S as getGatewayApiKey, _ as findProviderError, b as isProviderRetryError, c as COMPACTION_SUMMARY_PREFIX, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeText, l as MODEL_HANDOFF_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as unwrapCurrentInstruction, r as completeObject, s as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-
|
|
2
|
-
import { C as withSpan, F as isRecord$2, P as normalizeIdentityEmail, S as withLogContext, _ as setSpanAttributes, a as extractGenAiUsageSummary, b as summarizeMessageText, c as getTracePropagationHeaders, d as logInfo, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as logError, p as normalizeGenAiFinishReason, s as getLogContextAttributesForSpan, u as logException, v as setSpanStatus, y as setTags } from "./logging-
|
|
1
|
+
import { C as resolveGatewayCredential, S as getGatewayApiKey, _ as findProviderError, b as isProviderRetryError, c as COMPACTION_SUMMARY_PREFIX, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeText, l as MODEL_HANDOFF_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as unwrapCurrentInstruction, r as completeObject, s as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-BBPo9KiG.js";
|
|
2
|
+
import { C as withSpan, F as isRecord$2, P as normalizeIdentityEmail, S as withLogContext, _ as setSpanAttributes, a as extractGenAiUsageSummary, b as summarizeMessageText, c as getTracePropagationHeaders, d as logInfo, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as logError, p as normalizeGenAiFinishReason, s as getLogContextAttributesForSpan, u as logException, v as setSpanStatus, y as setTags } from "./logging-CXQcqM-W.js";
|
|
3
3
|
import { m as startInactiveSpan, v as withActiveSpan } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-
|
|
5
|
-
import { h as normalizeSlackEmojiName, n as botConfig } from "./config-
|
|
4
|
+
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-D99FrYrV.js";
|
|
5
|
+
import { h as normalizeSlackEmojiName, n as botConfig } from "./config-DMq-uJAV.js";
|
|
6
6
|
import { a as modelIdForProfile, c as TURN_REASONING_LEVELS, i as formatModelProfiles, o as modelProfileSchema, r as formatModelProfile, s as profileConfig, t as ModelProfileNotConfiguredError } from "./model-profile-CZmVoGdX.js";
|
|
7
7
|
import { _ as parseSlackMessageTs, g as parseSlackUserId, h as parseSlackTeamId, i as credentialUserSubjectId, l as isUserActor, m as parseSlackChannelReferenceId, n as credentialContextSchema, p as parseSlackChannelId, t as credentialContextForActor } from "./context-Bplcgypl.js";
|
|
8
|
-
import { A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, Gt as getDb, Ht as getConversationEventStore, J as withSlackRetries, K as normalizeSlackConversationId, Kt as getSqlExecutor, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as getConversationMessageSearchStore, V as getFilePermalink, W as isConversationScopedChannel, Wt as getConversationStore, _ as deleteWorkspace, an as parseDestination, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-
|
|
8
|
+
import { A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, Gt as getDb, Ht as getConversationEventStore, J as withSlackRetries, K as normalizeSlackConversationId, Kt as getSqlExecutor, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as getConversationMessageSearchStore, V as getFilePermalink, W as isConversationScopedChannel, Wt as getConversationStore, _ as deleteWorkspace, an as parseDestination, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-7vR8uZw2.js";
|
|
9
9
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
10
|
-
import { D as juniorArtifacts, S as juniorAttachments, T as juniorIdentities, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, w as juniorConversations, y as juniorConversationAnnotations } from "./executor-
|
|
10
|
+
import { D as juniorArtifacts, S as juniorAttachments, T as juniorIdentities, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, w as juniorConversations, y as juniorConversationAnnotations } from "./executor-B5VURdwg.js";
|
|
11
11
|
import { A as briefLinkSchema, F as KNOWN_CONVERSATION_EVENT_TYPES, G as instructionProvenanceFor, K as sameActorIdentity, M as conversationBriefSchema, U as contextProvenance, W as instructionActors, j as briefOutcomeStatusSchema } from "./conversation-AA4R1VUn.js";
|
|
12
12
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
|
|
13
|
-
import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-
|
|
14
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
15
|
-
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-
|
|
16
|
-
import { A as
|
|
17
|
-
import { a as hasAgentTurnUsage, c as
|
|
18
|
-
import { A as sleep$1, D as fenceLock, E as acquireActiveLock, F as sandboxSkillDir, I as sandboxSkillFile, L as sandboxSkillPathResolution, M as SANDBOX_REPOS_ROOT, N as SANDBOX_SKILLS_ROOT, P as SANDBOX_WORKSPACE_ROOT, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_DATA_ROOT, k as withLock, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-
|
|
19
|
-
import { $ as workspaceSnapshotFinishedEvent, B as createEventAutomation, C as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as eventAutomationMatchesDestination, E as eventAutomationListToolResultSchema, F as effectiveTaskOutcomes, Gt as makeStructuredToolOutput, I as moveTaskOutcomes, L as resolveTaskOutcomes, M as requireEventAutomationSlackContext, N as requireSupportedEventAutomationTrigger, O as eventAutomationToolResult, P as writableEventAutomation, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventAutomation, Ut as injectContinuationToolName, V as deleteEventAutomation, W as getEventAutomation, Wt as juniorToolOutputSchema, X as getEventCatalog, Y as saveEventAutomation, Z as WORKSPACE_SNAPSHOT_FAILED_EVENT, at as normalizeCatalogEventIdentifier, c as parseSlackThreadId, ct as registeredEventTypeSchema, et as workspaceSnapshotWatch, f as createScheduledAutomation, g as listScheduledAutomationsForTeam, i as readLiveAttachment, it as hasPluginEventCatalogEntries, j as registeredEventAutomationTriggerSchema, k as eventAutomationToolResultSchema, lt as registeredResourceTypeSchema, nt as eventNamespaceSchema, ot as pluginSupportsEvent, pt as appendAndEnqueueInboundMessage, q as listEventAutomationsForTeam, rt as hasEventCatalogEntries, s as storeAttachments, st as registeredEventMatchSchema, t as incrementStat, tt as eventGuidance, ut as requireSupportedEventMatch, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-
|
|
20
|
-
import { _ as isTurnInputCommitLostError, c as sanitizeAssistantText, f as CooperativeTurnYieldError, l as NO_REPLY_MARKER, n as canReusePendingAuthLink, o as decideReply, p as TurnInputCommitLostError, s as getAssistantReplyText, t as abandonReplacedPendingAuth, u as isNoReplyMarker } from "./pending-auth-
|
|
21
|
-
import { C as toolInvocationDestination, S as surfaceFromRun, _ as uploadFilesToConversation, b as assertRunConsistency, h as postSlackMessage, i as formatProviderLabel, m as getSlackMessagePermalink, o as resolveBaseUrl, p as addReactionToMessage, r as deliverOAuthAuthorization, s as startOAuthFlow, v as RetryableDeliveryError, x as isAgentRunFeatureDisabled, y as actorFromRun } from "./agent-runner-
|
|
13
|
+
import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-DUa5NdZP.js";
|
|
14
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
|
|
15
|
+
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-B1f5Ku_s.js";
|
|
16
|
+
import { A as TURN_CONTEXT_TAG, C as isContinuablePiBoundary, D as retainRuntimeTurnContext, E as normalizeToolNameFromResult, H as recordAuthorizationRequested, I as loadTurnRoute, K as recordToolExecutionStarted, L as openConversationProjection, N as loadConnectedMcpProviders, O as stripRuntimeTurnContext, P as loadConversationProjection, R as recordAgentsInstructionsUpdated, S as isAssistantMessage, T as isToolResultMessage, U as recordGuardianActionReviewed, W as recordMcpProviderConnected, _ as getPiMessageRole, b as hasRuntimeTurnContext, dt as estimateTextTokens, f as TurnSliceLimitExceededError, ft as getAgentContextCompactionTriggerTokens, g as extractAssistantText, h as isTurnExecutionLimitExceededError, ht as piMessageFromHistoryItem, k as trimTrailingAssistantMessages, mt as historyItemFromPiMessage, n as loadTurnCheckpoint, p as assertTurnToolCallLimit, pt as getAgentContextInputLimitTokens, q as recordTurnRoute, r as saveTurnCheckpoint, t as continuableMessages, v as getTerminalAssistantMessages, w as isToolResultError, y as getUserMessageInstructionText, z as recordAttachmentsDelivered } from "./checkpoint-B6jEtGHN.js";
|
|
17
|
+
import { a as hasAgentTurnUsage, c as resolveTaskTitle, s as generateShortTitle, t as addAgentTurnUsage } from "./usage-DHJ3ng2s.js";
|
|
18
|
+
import { A as sleep$1, D as fenceLock, E as acquireActiveLock, F as sandboxSkillDir, I as sandboxSkillFile, L as sandboxSkillPathResolution, M as SANDBOX_REPOS_ROOT, N as SANDBOX_SKILLS_ROOT, P as SANDBOX_WORKSPACE_ROOT, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_DATA_ROOT, k as withLock, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-8K6D5LHD.js";
|
|
19
|
+
import { $ as workspaceSnapshotFinishedEvent, B as createEventAutomation, C as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as eventAutomationMatchesDestination, E as eventAutomationListToolResultSchema, F as effectiveTaskOutcomes, Gt as makeStructuredToolOutput, I as moveTaskOutcomes, Jt as ToolInputError, L as resolveTaskOutcomes, M as requireEventAutomationSlackContext, N as requireSupportedEventAutomationTrigger, O as eventAutomationToolResult, P as writableEventAutomation, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventAutomation, Ut as injectContinuationToolName, V as deleteEventAutomation, W as getEventAutomation, Wt as juniorToolOutputSchema, X as getEventCatalog, Y as saveEventAutomation, Z as WORKSPACE_SNAPSHOT_FAILED_EVENT, at as normalizeCatalogEventIdentifier, c as parseSlackThreadId, ct as registeredEventTypeSchema, et as workspaceSnapshotWatch, f as createScheduledAutomation, g as listScheduledAutomationsForTeam, i as readLiveAttachment, it as hasPluginEventCatalogEntries, j as registeredEventAutomationTriggerSchema, k as eventAutomationToolResultSchema, lt as registeredResourceTypeSchema, nt as eventNamespaceSchema, ot as pluginSupportsEvent, pt as appendAndEnqueueInboundMessage, q as listEventAutomationsForTeam, rt as hasEventCatalogEntries, s as storeAttachments, st as registeredEventMatchSchema, t as incrementStat, tt as eventGuidance, ut as requireSupportedEventMatch, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-CrITkCy5.js";
|
|
20
|
+
import { _ as isTurnInputCommitLostError, c as sanitizeAssistantText, f as CooperativeTurnYieldError, l as NO_REPLY_MARKER, n as canReusePendingAuthLink, o as decideReply, p as TurnInputCommitLostError, s as getAssistantReplyText, t as abandonReplacedPendingAuth, u as isNoReplyMarker } from "./pending-auth-CxZjizu_.js";
|
|
21
|
+
import { C as toolInvocationDestination, S as surfaceFromRun, _ as uploadFilesToConversation, b as assertRunConsistency, h as postSlackMessage, i as formatProviderLabel, m as getSlackMessagePermalink, o as resolveBaseUrl, p as addReactionToMessage, r as deliverOAuthAuthorization, s as startOAuthFlow, v as RetryableDeliveryError, x as isAgentRunFeatureDisabled, y as actorFromRun } from "./agent-runner-CqXaUvvQ.js";
|
|
22
22
|
import { r as EVENT_AUTHOR_ID } from "./prompt-C1IA4qkj.js";
|
|
23
|
-
import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-
|
|
23
|
+
import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-E_-QQ8pM.js";
|
|
24
24
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
25
|
-
import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-
|
|
25
|
+
import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-DUs_jnBa.js";
|
|
26
26
|
import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
|
|
27
27
|
import { streamSimple } from "@earendil-works/pi-ai/compat";
|
|
28
28
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -218,6 +218,339 @@ var SkillSandbox = class {
|
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
//#endregion
|
|
221
|
+
//#region src/chat/tools/sandbox/file-utils.ts
|
|
222
|
+
const MAX_TEXT_CHARS = 6e4;
|
|
223
|
+
const RIPGREP_EXCLUDED_GLOBS = ["!**/.git/**", "!**/node_modules/**"];
|
|
224
|
+
const DEFAULT_SEARCH_COMMAND_TIMEOUT_MS = 3e4;
|
|
225
|
+
const SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
226
|
+
/** Normalize model-supplied numeric knobs before they reach filesystem tools. */
|
|
227
|
+
function positiveInteger$1(value) {
|
|
228
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return;
|
|
229
|
+
const integer = Math.floor(value);
|
|
230
|
+
return integer > 0 ? integer : void 0;
|
|
231
|
+
}
|
|
232
|
+
/** Compare and slice text in one line-ending space while preserving callers' output rules. */
|
|
233
|
+
function normalizeToLf$1(value) {
|
|
234
|
+
return value.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
235
|
+
}
|
|
236
|
+
/** Keep tool output inside the model-facing budget with an explicit notice. */
|
|
237
|
+
function truncateText$1(value, maxChars = MAX_TEXT_CHARS) {
|
|
238
|
+
if (value.length <= maxChars) return {
|
|
239
|
+
content: value,
|
|
240
|
+
truncated: false
|
|
241
|
+
};
|
|
242
|
+
const removed = value.length - maxChars;
|
|
243
|
+
return {
|
|
244
|
+
content: `${value.slice(0, maxChars)}\n\n[output truncated: ${removed} characters removed]`,
|
|
245
|
+
truncated: true
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
/** Detect model-facing missing paths without swallowing sandbox lifecycle/API failures. */
|
|
249
|
+
function isMissingPathError(error) {
|
|
250
|
+
if (!error || typeof error !== "object") return false;
|
|
251
|
+
const candidate = error;
|
|
252
|
+
if (candidate.code === "ENOENT") return true;
|
|
253
|
+
return typeof candidate.message === "string" && candidate.message.startsWith("File not found:");
|
|
254
|
+
}
|
|
255
|
+
/** Reject an expected missing search/list path through the tool-error channel. */
|
|
256
|
+
function missingPathSearchResult(params) {
|
|
257
|
+
const textPath = params.displayPath ?? params.missingPath ?? params.path;
|
|
258
|
+
throw new ToolInputError(`Path not found: ${textPath}`);
|
|
259
|
+
}
|
|
260
|
+
function escapeRegExp(value) {
|
|
261
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
262
|
+
}
|
|
263
|
+
function globToRegExp(pattern) {
|
|
264
|
+
let source = "";
|
|
265
|
+
for (let index = 0; index < pattern.length; index += 1) {
|
|
266
|
+
const char = pattern[index];
|
|
267
|
+
const next = pattern[index + 1];
|
|
268
|
+
if (char === "*" && next === "*") {
|
|
269
|
+
if (pattern[index + 2] === "/") {
|
|
270
|
+
source += "(?:.*/)?";
|
|
271
|
+
index += 2;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
source += ".*";
|
|
275
|
+
index += 1;
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (char === "*") {
|
|
279
|
+
source += "[^/]*";
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if (char === "?") {
|
|
283
|
+
source += "[^/]";
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
source += escapeRegExp(char);
|
|
287
|
+
}
|
|
288
|
+
return new RegExp(`^${source}$`);
|
|
289
|
+
}
|
|
290
|
+
function matchesGlob(relativePath, pattern) {
|
|
291
|
+
const matcher = globToRegExp(pattern);
|
|
292
|
+
if (matcher.test(relativePath)) return true;
|
|
293
|
+
if (pattern.startsWith("**/") && matchesGlob(relativePath, pattern.slice(3))) return true;
|
|
294
|
+
return !pattern.includes("/") && matcher.test(path.posix.basename(relativePath));
|
|
295
|
+
}
|
|
296
|
+
/** Keep sandbox filesystem tools scoped to the mounted workspace root. */
|
|
297
|
+
function resolveWorkspacePath(input, fallback = ".") {
|
|
298
|
+
const requested = (input ?? "").trim() || fallback;
|
|
299
|
+
const absolute = requested.startsWith("/") ? requested : path.posix.join(SANDBOX_WORKSPACE_ROOT, requested);
|
|
300
|
+
const normalized = path.posix.normalize(absolute);
|
|
301
|
+
if (normalized !== SANDBOX_WORKSPACE_ROOT && !normalized.startsWith(`${SANDBOX_WORKSPACE_ROOT}/`)) throw new ToolInputError(`Path must stay within ${SANDBOX_WORKSPACE_ROOT}: ${requested}`);
|
|
302
|
+
return normalized;
|
|
303
|
+
}
|
|
304
|
+
/** Anchor ripgrep paths and globs to the requested search root. */
|
|
305
|
+
function getRipgrepSearchLocation(root, rootIsDirectory) {
|
|
306
|
+
if (rootIsDirectory) return {
|
|
307
|
+
cwd: root,
|
|
308
|
+
target: "."
|
|
309
|
+
};
|
|
310
|
+
return {
|
|
311
|
+
cwd: path.posix.dirname(root),
|
|
312
|
+
target: path.posix.basename(root)
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/** Share bounded workspace traversal across search tools so their skip rules stay aligned. */
|
|
316
|
+
async function collectFiles(params) {
|
|
317
|
+
const files = [];
|
|
318
|
+
let limitReached = false;
|
|
319
|
+
let missingPath;
|
|
320
|
+
const visit = async (dirPath) => {
|
|
321
|
+
if (missingPath) return;
|
|
322
|
+
let entries;
|
|
323
|
+
try {
|
|
324
|
+
entries = (await params.fs.readdir(dirPath)).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
|
325
|
+
} catch (error) {
|
|
326
|
+
if (isMissingPathError(error)) {
|
|
327
|
+
missingPath = dirPath;
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
throw error;
|
|
331
|
+
}
|
|
332
|
+
for (const entry of entries) {
|
|
333
|
+
const fullPath = path.posix.join(dirPath, entry);
|
|
334
|
+
let stat;
|
|
335
|
+
try {
|
|
336
|
+
stat = await params.fs.stat(fullPath);
|
|
337
|
+
} catch (error) {
|
|
338
|
+
if (isMissingPathError(error)) {
|
|
339
|
+
missingPath = fullPath;
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
if (stat.isDirectory()) {
|
|
345
|
+
if (!SKIPPED_DIRECTORIES.has(entry)) await visit(fullPath);
|
|
346
|
+
if (limitReached) return;
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
const relativePath = path.posix.relative(params.root, fullPath);
|
|
350
|
+
if (!params.pattern || matchesGlob(relativePath, params.pattern)) {
|
|
351
|
+
files.push(fullPath);
|
|
352
|
+
if (params.limit && files.length >= params.limit) {
|
|
353
|
+
limitReached = true;
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
let stat;
|
|
360
|
+
try {
|
|
361
|
+
stat = await params.fs.stat(params.root);
|
|
362
|
+
} catch (error) {
|
|
363
|
+
if (isMissingPathError(error)) return {
|
|
364
|
+
files,
|
|
365
|
+
limitReached: false,
|
|
366
|
+
missingPath: params.root,
|
|
367
|
+
missingRoot: true
|
|
368
|
+
};
|
|
369
|
+
throw error;
|
|
370
|
+
}
|
|
371
|
+
if (!stat.isDirectory()) {
|
|
372
|
+
const relativePath = path.posix.basename(params.root);
|
|
373
|
+
return {
|
|
374
|
+
files: !params.pattern || matchesGlob(relativePath, params.pattern) ? [params.root] : [],
|
|
375
|
+
limitReached: false,
|
|
376
|
+
missingRoot: false
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
await visit(params.root);
|
|
380
|
+
return {
|
|
381
|
+
files,
|
|
382
|
+
limitReached,
|
|
383
|
+
missingPath,
|
|
384
|
+
missingRoot: missingPath === params.root
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/chat/repository-instructions.ts
|
|
389
|
+
const AGENTS_FILENAME = "AGENTS.md";
|
|
390
|
+
const MAX_REPOSITORY_INSTRUCTIONS_BYTES = 32768;
|
|
391
|
+
const AGENTS_REPLACEMENT_NOTICE = "These AGENTS.md instructions replace all previously provided AGENTS.md instructions.";
|
|
392
|
+
const AGENTS_REMOVAL_NOTICE = "The previously provided AGENTS.md instructions no longer apply.";
|
|
393
|
+
async function pathExists(fs, target) {
|
|
394
|
+
try {
|
|
395
|
+
await fs.stat(target);
|
|
396
|
+
return true;
|
|
397
|
+
} catch (error) {
|
|
398
|
+
if (isMissingPathError(error)) return false;
|
|
399
|
+
throw error;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
async function directoryExists(fs, target) {
|
|
403
|
+
try {
|
|
404
|
+
return (await fs.stat(target)).isDirectory();
|
|
405
|
+
} catch (error) {
|
|
406
|
+
if (isMissingPathError(error)) return false;
|
|
407
|
+
throw error;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
async function findGitRoot(fs, cwd) {
|
|
411
|
+
let current = cwd;
|
|
412
|
+
for (;;) {
|
|
413
|
+
if (await pathExists(fs, path.posix.join(current, ".git"))) return current;
|
|
414
|
+
if (current === SANDBOX_WORKSPACE_ROOT) return;
|
|
415
|
+
const parent = path.posix.dirname(current);
|
|
416
|
+
if (parent === current || parent !== SANDBOX_WORKSPACE_ROOT && !parent.startsWith(`${SANDBOX_WORKSPACE_ROOT}/`)) return;
|
|
417
|
+
current = parent;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/** Return Git worktrees under repos/, sorted for stable instruction capture. */
|
|
421
|
+
async function listRepositoryDirectories(fs) {
|
|
422
|
+
if (!await directoryExists(fs, SANDBOX_REPOS_ROOT)) return [];
|
|
423
|
+
const entries = await fs.readdir(SANDBOX_REPOS_ROOT);
|
|
424
|
+
const repositories = [];
|
|
425
|
+
for (const entry of entries) {
|
|
426
|
+
const candidate = path.posix.join(SANDBOX_REPOS_ROOT, entry);
|
|
427
|
+
if (await directoryExists(fs, candidate) && await pathExists(fs, path.posix.join(candidate, ".git"))) repositories.push(candidate);
|
|
428
|
+
}
|
|
429
|
+
return repositories.sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
|
|
430
|
+
}
|
|
431
|
+
async function readInstructionFile(fs, filePath) {
|
|
432
|
+
try {
|
|
433
|
+
const content = await fs.readFile(filePath, { encoding: "utf8" });
|
|
434
|
+
return content.trim() ? content : void 0;
|
|
435
|
+
} catch (error) {
|
|
436
|
+
if (isMissingPathError(error)) return;
|
|
437
|
+
throw error;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/** Resolve the effective root-to-cwd AGENTS.md bundle for one selected directory. */
|
|
441
|
+
async function resolveRepositoryInstructions(args) {
|
|
442
|
+
const gitRoot = await findGitRoot(args.fs, args.cwd);
|
|
443
|
+
if (!gitRoot) return;
|
|
444
|
+
const directories = [];
|
|
445
|
+
let current = args.cwd;
|
|
446
|
+
for (;;) {
|
|
447
|
+
directories.push(current);
|
|
448
|
+
if (current === gitRoot) break;
|
|
449
|
+
current = path.posix.dirname(current);
|
|
450
|
+
}
|
|
451
|
+
directories.reverse();
|
|
452
|
+
const sources = [];
|
|
453
|
+
let remaining = Math.max(0, args.maxBytes ?? MAX_REPOSITORY_INSTRUCTIONS_BYTES);
|
|
454
|
+
for (const directory of directories) {
|
|
455
|
+
if (remaining <= 0) break;
|
|
456
|
+
const filePath = path.posix.join(directory, AGENTS_FILENAME);
|
|
457
|
+
const content = await readInstructionFile(args.fs, filePath);
|
|
458
|
+
if (!content) continue;
|
|
459
|
+
const bytes = Buffer.from(content, "utf8");
|
|
460
|
+
const bounded = bytes.length <= remaining ? content : bytes.subarray(0, remaining).toString("utf8");
|
|
461
|
+
sources.push({
|
|
462
|
+
content: bounded,
|
|
463
|
+
path: filePath
|
|
464
|
+
});
|
|
465
|
+
remaining -= Buffer.byteLength(bounded, "utf8");
|
|
466
|
+
}
|
|
467
|
+
if (sources.length === 0) return;
|
|
468
|
+
const text = formatInstructionSources(sources);
|
|
469
|
+
const fingerprint = createHash("sha256").update(JSON.stringify({
|
|
470
|
+
directory: args.cwd,
|
|
471
|
+
sources
|
|
472
|
+
})).digest("hex");
|
|
473
|
+
return {
|
|
474
|
+
directory: args.cwd,
|
|
475
|
+
fingerprint,
|
|
476
|
+
sources,
|
|
477
|
+
text
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function formatInstructionSources(sources) {
|
|
481
|
+
if (sources.length === 1) return sources[0].content;
|
|
482
|
+
return sources.map((source) => `## ${path.posix.dirname(source.path)}\n\n${source.content}`).join("\n\n");
|
|
483
|
+
}
|
|
484
|
+
/** Combine AGENTS.md bundles from one or more repository directories. */
|
|
485
|
+
function mergeRepositoryInstructions(bundles) {
|
|
486
|
+
if (bundles.length === 0) return;
|
|
487
|
+
if (bundles.length === 1) return bundles[0];
|
|
488
|
+
const sources = bundles.flatMap((bundle) => bundle.sources);
|
|
489
|
+
const text = formatInstructionSources(sources);
|
|
490
|
+
return {
|
|
491
|
+
fingerprint: createHash("sha256").update(JSON.stringify({
|
|
492
|
+
directories: bundles.map((bundle) => bundle.directory ?? null),
|
|
493
|
+
sources
|
|
494
|
+
})).digest("hex"),
|
|
495
|
+
sources,
|
|
496
|
+
text
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
/** Resolve AGENTS.md instructions for each selected repository directory. */
|
|
500
|
+
async function resolveRepositoryInstructionsForDirectories(args) {
|
|
501
|
+
const uniqueDirectories = [...new Set(args.directories.filter((directory) => directory === SANDBOX_WORKSPACE_ROOT || directory.startsWith(`${SANDBOX_WORKSPACE_ROOT}/`)))].sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
|
|
502
|
+
let remaining = MAX_REPOSITORY_INSTRUCTIONS_BYTES;
|
|
503
|
+
const bundles = [];
|
|
504
|
+
for (const directory of uniqueDirectories) {
|
|
505
|
+
if (remaining <= 0) break;
|
|
506
|
+
const instructions = await resolveRepositoryInstructions({
|
|
507
|
+
cwd: directory,
|
|
508
|
+
fs: args.fs,
|
|
509
|
+
maxBytes: remaining
|
|
510
|
+
});
|
|
511
|
+
if (!instructions) continue;
|
|
512
|
+
bundles.push(instructions);
|
|
513
|
+
remaining -= instructions.sources.reduce((total, source) => total + Buffer.byteLength(source.content, "utf8"), 0);
|
|
514
|
+
}
|
|
515
|
+
return mergeRepositoryInstructions(bundles);
|
|
516
|
+
}
|
|
517
|
+
/** Render repository instructions with Codex's exact model-visible wrapper. */
|
|
518
|
+
function renderAgentsInstructions(args) {
|
|
519
|
+
return `# AGENTS.md instructions${args.directory ? ` for ${args.directory}` : ""}\n\n<INSTRUCTIONS>\n${args.text}\n</INSTRUCTIONS>`;
|
|
520
|
+
}
|
|
521
|
+
/** Build one user-role repository-instructions context message. */
|
|
522
|
+
function buildAgentsInstructionsMessage(args) {
|
|
523
|
+
return {
|
|
524
|
+
role: "user",
|
|
525
|
+
content: [{
|
|
526
|
+
type: "text",
|
|
527
|
+
text: renderAgentsInstructions(args)
|
|
528
|
+
}],
|
|
529
|
+
timestamp: args.timestamp ?? Date.now()
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
/** Read the latest effective AGENTS.md state from model-visible history. */
|
|
533
|
+
function findVisibleAgentsInstructions(messages) {
|
|
534
|
+
for (let messageIndex = messages.length - 1; messageIndex >= 0; messageIndex -= 1) {
|
|
535
|
+
const message = messages[messageIndex];
|
|
536
|
+
if (message.role !== "user" || !Array.isArray(message.content)) continue;
|
|
537
|
+
for (let partIndex = message.content.length - 1; partIndex >= 0; partIndex -= 1) {
|
|
538
|
+
const part = message.content[partIndex];
|
|
539
|
+
if (part.type !== "text" || typeof part.text !== "string" || !part.text.startsWith("# AGENTS.md instructions")) continue;
|
|
540
|
+
const match = part.text.match(/^# AGENTS\.md instructions(?: for ([^\n]+))?\n\n<INSTRUCTIONS>\n([\s\S]*)\n<\/INSTRUCTIONS>$/);
|
|
541
|
+
if (!match) continue;
|
|
542
|
+
let text = match[2];
|
|
543
|
+
if (text === "The previously provided AGENTS.md instructions no longer apply.") return { active: false };
|
|
544
|
+
if (text.startsWith(`These AGENTS.md instructions replace all previously provided AGENTS.md instructions.\n\n`)) text = text.slice(86);
|
|
545
|
+
return {
|
|
546
|
+
active: true,
|
|
547
|
+
...match[1] ? { directory: match[1] } : void 0,
|
|
548
|
+
text
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
//#endregion
|
|
221
554
|
//#region src/chat/agent/repository-context.ts
|
|
222
555
|
function findRestoredInstructions(messages, provenance) {
|
|
223
556
|
const restoredContext = messages?.map((message, index) => ({
|
|
@@ -1185,7 +1518,6 @@ const CONVERSATION_RULES = [
|
|
|
1185
1518
|
"- Runtime owns continuation and authorization notices; on resumed turns, answer with the final requested content only."
|
|
1186
1519
|
];
|
|
1187
1520
|
const SLACK_ACTION_RULES = [
|
|
1188
|
-
"- For a large task with multiple substantive steps, first call `reportProgress` with `intentAcknowledgment: true` before any other tool. State what you are starting so the runtime posts a linked intent acknowledgment while work continues. Do not send a standalone assistant reply for this acknowledgment, and skip it for short or routine work. After the initial update, use `reportProgress` without `intentAcknowledgment` only for later major phase changes.",
|
|
1189
1521
|
"- Slack tools target the current runtime context; if the requested Slack target differs, explain the limitation instead of calling the tool.",
|
|
1190
1522
|
"- Assistant text is delivered only into the active conversation or thread. You cannot create a new top-level channel post; if asked to do so, explain that limitation and do not present the requested text as delivered.",
|
|
1191
1523
|
"- Ambient reaction requests target the current inbound message; do not ask for a message reference.",
|
|
@@ -5450,9 +5782,8 @@ function createSandbox(options) {
|
|
|
5450
5782
|
if (!runtime.sandboxRef()) return;
|
|
5451
5783
|
const { fs } = await runtime.tools();
|
|
5452
5784
|
const workspaceDirectories = activeWorkspace?.repos.map((repo) => tryWorkspaceRepoCheckoutPath(repo.repo)).filter((checkoutPath) => Boolean(checkoutPath)).map((checkoutPath) => `${SANDBOX_WORKSPACE_ROOT}/${checkoutPath}`) ?? [];
|
|
5453
|
-
const directories = workspaceDirectories.length > 0 ? workspaceDirectories : await listRepositoryDirectories(fs);
|
|
5454
5785
|
return await resolveRepositoryInstructionsForDirectories({
|
|
5455
|
-
directories,
|
|
5786
|
+
directories: workspaceDirectories.length > 0 ? workspaceDirectories : await listRepositoryDirectories(fs),
|
|
5456
5787
|
fs
|
|
5457
5788
|
});
|
|
5458
5789
|
},
|
|
@@ -7039,11 +7370,8 @@ function createReportProgressTool() {
|
|
|
7039
7370
|
openWorldHint: true,
|
|
7040
7371
|
readOnlyHint: false
|
|
7041
7372
|
},
|
|
7042
|
-
description: "Update the user-visible assistant loading message with a short progress phase.
|
|
7043
|
-
inputSchema: z.object({
|
|
7044
|
-
message: z.string().min(1).describe("Short user-facing progress message."),
|
|
7045
|
-
intentAcknowledgment: z.boolean().optional().describe("True only for the first update of a large Slack task, when the runtime should also post a linked acknowledgment.")
|
|
7046
|
-
}),
|
|
7373
|
+
description: "Update the user-visible assistant loading message with a short progress phase. Use this only for work with multiple substantive phases or a materially long wait. Skip short lookups, routine commands, generic filler, and minor substeps. After an initial update, call it again only when the major phase meaningfully changes. Messages must be written in sentence case with a present-participle verb (e.g. 'Searching docs', 'Reviewing results', 'Running checks').",
|
|
7374
|
+
inputSchema: z.object({ message: z.string().min(1).describe("Short user-facing progress message.") }),
|
|
7047
7375
|
outputSchema: juniorToolOutputSchema,
|
|
7048
7376
|
execute: async () => ({})
|
|
7049
7377
|
});
|
|
@@ -13179,10 +13507,7 @@ function buildReportedProgressStatus(input) {
|
|
|
13179
13507
|
if (typeof message !== "string") return;
|
|
13180
13508
|
const text = message.trim();
|
|
13181
13509
|
if (!text) return;
|
|
13182
|
-
return {
|
|
13183
|
-
text,
|
|
13184
|
-
...input.intentAcknowledgment === true ? { intentAcknowledgment: true } : void 0
|
|
13185
|
-
};
|
|
13510
|
+
return { text };
|
|
13186
13511
|
}
|
|
13187
13512
|
/** Recover the latest explicit progress update from a resumable Pi transcript. */
|
|
13188
13513
|
function latestReportedProgress(messages) {
|
|
@@ -15974,7 +16299,7 @@ async function wireAgentTools(args) {
|
|
|
15974
16299
|
const onStatus = emitEvent ? async (status) => {
|
|
15975
16300
|
await emitEvent({
|
|
15976
16301
|
type: "status",
|
|
15977
|
-
|
|
16302
|
+
text: status.text
|
|
15978
16303
|
});
|
|
15979
16304
|
} : void 0;
|
|
15980
16305
|
const onToolResult = emitEvent ? async (report) => {
|
|
@@ -16898,7 +17223,7 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
16898
17223
|
onStatus: run.onEvent ? async (status) => {
|
|
16899
17224
|
await run.onEvent?.({
|
|
16900
17225
|
type: "status",
|
|
16901
|
-
|
|
17226
|
+
text: status.text
|
|
16902
17227
|
});
|
|
16903
17228
|
} : void 0,
|
|
16904
17229
|
onToolInvocation: run.onEvent ? async (invocation) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { a as embedTexts, r as completeObject } from "./client-
|
|
3
|
-
import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-
|
|
2
|
+
import { a as embedTexts, r as completeObject } from "./client-BBPo9KiG.js";
|
|
3
|
+
import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-CXQcqM-W.js";
|
|
4
4
|
import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
-
import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-D99FrYrV.js";
|
|
6
|
+
import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-DMq-uJAV.js";
|
|
7
7
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
8
8
|
import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-Bplcgypl.js";
|
|
9
9
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
10
|
-
import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-
|
|
10
|
+
import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-B5VURdwg.js";
|
|
11
11
|
import { B as decodeStoredConversationEvent, C as conversationReportEventSchema, H as newConversationEventSchema, L as conversationEventDataSchema, M as conversationBriefSchema, N as parseBriefInput, V as historyReplacementSchema } from "./conversation-AA4R1VUn.js";
|
|
12
|
-
import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
12
|
+
import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-8K6D5LHD.js";
|
|
13
13
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C1IA4qkj.js";
|
|
14
14
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { F as isRecord, d as logInfo, f as logWarn } from "./logging-
|
|
2
|
-
import { h as normalizeSlackEmojiName } from "./config-
|
|
1
|
+
import { F as isRecord, d as logInfo, f as logWarn } from "./logging-CXQcqM-W.js";
|
|
2
|
+
import { h as normalizeSlackEmojiName } from "./config-DMq-uJAV.js";
|
|
3
3
|
import { _ as parseSlackMessageTs, g as parseSlackUserId } from "./context-Bplcgypl.js";
|
|
4
|
-
import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, an as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, an as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-7vR8uZw2.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BMMLIpxX.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-8K6D5LHD.js";
|
|
7
7
|
import { r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
|
|
8
8
|
import { randomBytes } from "node:crypto";
|
|
9
9
|
import { actorSchema, sourceSchema } from "@sentry/junior-plugin-api";
|
package/dist/api.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { f as logWarn, u as logException } from "./logging-
|
|
1
|
+
import { f as logWarn, u as logException } from "./logging-CXQcqM-W.js";
|
|
2
2
|
import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
|
|
3
|
-
import { $ as resolveViewerUser, $t as parseSessionSource, Ct as conversationArchivedForEmail, D as SANDBOX_RUNTIME, Dt as conversationNotArchivedForEmail, Et as conversationHasParticipantUser, Ft as listConversationAnnotations, Gt as getDb, It as listConversationAnnotationsById, J as withSlackRetries, Kt as getSqlExecutor, Mt as readConversationEventPage, Nt as buildSentryConversationUrl, Ot as conversationNotArchivedForUser, S as WorkspaceValidationError, St as conversationArchiveTimes, Tt as conversationHasParticipantEmail, U as getSlackClient, Wt as getConversationStore, Z as findUserByEmail, Zt as locationFromRow, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, en as resolveRootConversationId, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, jt as readLatestConversationBrief, kt as viewerConversationMembership, u as getPlugins, v as getWorkspace, wt as conversationArchivedForUser, x as updateWorkspace, xt as readConversationAccessFromSql } from "./agent-hooks-
|
|
3
|
+
import { $ as resolveViewerUser, $t as parseSessionSource, Ct as conversationArchivedForEmail, D as SANDBOX_RUNTIME, Dt as conversationNotArchivedForEmail, Et as conversationHasParticipantUser, Ft as listConversationAnnotations, Gt as getDb, It as listConversationAnnotationsById, J as withSlackRetries, Kt as getSqlExecutor, Mt as readConversationEventPage, Nt as buildSentryConversationUrl, Ot as conversationNotArchivedForUser, S as WorkspaceValidationError, St as conversationArchiveTimes, Tt as conversationHasParticipantEmail, U as getSlackClient, Wt as getConversationStore, Z as findUserByEmail, Zt as locationFromRow, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, en as resolveRootConversationId, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, jt as readLatestConversationBrief, kt as viewerConversationMembership, u as getPlugins, v as getWorkspace, wt as conversationArchivedForUser, x as updateWorkspace, xt as readConversationAccessFromSql } from "./agent-hooks-7vR8uZw2.js";
|
|
4
4
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
5
|
-
import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-
|
|
5
|
+
import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-B5VURdwg.js";
|
|
6
6
|
import { D as createConversationBodySchema, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-AA4R1VUn.js";
|
|
7
|
-
import { a as hasAgentTurnUsage, i as agentTurnUsageSchema,
|
|
8
|
-
import { n as hash, t as create } from "./profile-
|
|
9
|
-
import { A as eventAutomationTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventAutomationsCreatedBy, H as eventAutomationBelongsToUser, J as listPublicEventAutomationsForTeams, K as listEventAutomationsCreatedBy, Tt as getConversation, V as deleteEventAutomation, W as getEventAutomation, X as getEventCatalog, _ as parseScheduledAutomationRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledAutomationsForTeams, n as readStats, p as isListedScheduledAutomation, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-
|
|
10
|
-
import { t as getCachedSnapshot } from "./resolve-
|
|
7
|
+
import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, o as fallbackShortTitle } from "./usage-DHJ3ng2s.js";
|
|
8
|
+
import { n as hash, t as create } from "./profile-8K6D5LHD.js";
|
|
9
|
+
import { A as eventAutomationTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventAutomationsCreatedBy, H as eventAutomationBelongsToUser, J as listPublicEventAutomationsForTeams, K as listEventAutomationsCreatedBy, Tt as getConversation, V as deleteEventAutomation, W as getEventAutomation, X as getEventCatalog, _ as parseScheduledAutomationRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledAutomationsForTeams, n as readStats, p as isListedScheduledAutomation, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-CrITkCy5.js";
|
|
10
|
+
import { t as getCachedSnapshot } from "./resolve-E_-QQ8pM.js";
|
|
11
11
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
12
12
|
import { c as runtimeInfoReportSchema, n as pluginOperationalReportFeedSchema, s as pluginsSchema, t as healthReportSchema, u as skillReportsSchema } from "./reporting-schema-DosTN__Q.js";
|
|
13
|
-
import { a as webActorFromEmail, c as formatSlackConversationRedactedLabel, d as resolveSlackConversationContextFromThreadId, f as lookupSlackUser, g as readHealthReport, m as createVercelAttachmentStorage, p as legacyWebMailboxMetadataSchema, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage } from "./web-input-
|
|
14
|
-
import { a as readAutomationExecutionStatusDays, c as readAutomationExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readAutomationExecutionHours, l as readAutomationRuns, n as readAutomationExecutionByConversationId, o as readAutomationExecutionStatusHours, p as conversationRangeColumns, r as readAutomationExecutionDays, s as readAutomationExecutionSummaries, t as emptyAutomationRunWindows } from "./execution-stats
|
|
15
|
-
import { r as getWebAuthorization } from "./web-authorization-
|
|
13
|
+
import { a as webActorFromEmail, c as formatSlackConversationRedactedLabel, d as resolveSlackConversationContextFromThreadId, f as lookupSlackUser, g as readHealthReport, m as createVercelAttachmentStorage, p as legacyWebMailboxMetadataSchema, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage } from "./web-input-lJH42B_R.js";
|
|
14
|
+
import { a as readAutomationExecutionStatusDays, c as readAutomationExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readAutomationExecutionHours, l as readAutomationRuns, n as readAutomationExecutionByConversationId, o as readAutomationExecutionStatusHours, p as conversationRangeColumns, r as readAutomationExecutionDays, s as readAutomationExecutionSummaries, t as emptyAutomationRunWindows } from "./execution-stats-BkCnuVBv.js";
|
|
15
|
+
import { r as getWebAuthorization } from "./web-authorization-DN3cJuLB.js";
|
|
16
16
|
import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, J as HOUR_MS$1, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, Q as startOfUtcHour, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, X as fillUtcHours, Y as fillUtcDays, Z as fillUtcSixHours, _ as automationRunListSchema, a as workspaceBodySchema, at as apiErrorSchema, et as trailingUtcDayWindow, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, tt as trailingUtcHourWindow, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-CwTeb-BF.js";
|
|
17
17
|
import { Hono } from "hono";
|
|
18
18
|
import path from "node:path";
|
|
@@ -3409,7 +3409,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3409
3409
|
reports: [],
|
|
3410
3410
|
source: "plugins"
|
|
3411
3411
|
});
|
|
3412
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
3412
|
+
const { getPluginProfileReports } = await import("./agent-hooks-7vR8uZw2.js").then((n) => n.t);
|
|
3413
3413
|
return pluginOperationalReportFeedSchema.parse({
|
|
3414
3414
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3415
3415
|
reports: await getPluginProfileReports({
|
|
@@ -4018,7 +4018,7 @@ function readDescriptionText(home) {
|
|
|
4018
4018
|
}
|
|
4019
4019
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
4020
4020
|
async function readSkillReports() {
|
|
4021
|
-
const { discoverSkills } = await import("./skills-
|
|
4021
|
+
const { discoverSkills } = await import("./skills-B1f5Ku_s.js").then((n) => n.o);
|
|
4022
4022
|
const skills = await discoverSkills();
|
|
4023
4023
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
4024
4024
|
name: skill.name,
|
|
@@ -4027,7 +4027,7 @@ async function readSkillReports() {
|
|
|
4027
4027
|
}
|
|
4028
4028
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
4029
4029
|
async function readPlugins() {
|
|
4030
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4030
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-BMMLIpxX.js").then((n) => n.t);
|
|
4031
4031
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4032
4032
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
4033
4033
|
description: plugin.manifest.description,
|
|
@@ -4039,7 +4039,7 @@ async function readPlugins() {
|
|
|
4039
4039
|
async function readRuntimeInfoReport() {
|
|
4040
4040
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4041
4041
|
import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
|
|
4042
|
-
import("./catalog-runtime-
|
|
4042
|
+
import("./catalog-runtime-BMMLIpxX.js").then((n) => n.t),
|
|
4043
4043
|
readPlugins(),
|
|
4044
4044
|
readSkillReports()
|
|
4045
4045
|
]);
|
|
@@ -4056,7 +4056,7 @@ async function readRuntimeInfoReport() {
|
|
|
4056
4056
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
4057
4057
|
async function readPluginOperationalReportFeed() {
|
|
4058
4058
|
const nowMs = Date.now();
|
|
4059
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4059
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-7vR8uZw2.js").then((n) => n.t);
|
|
4060
4060
|
return pluginOperationalReportFeedSchema.parse({
|
|
4061
4061
|
source: "plugins",
|
|
4062
4062
|
generatedAt: new Date(nowMs).toISOString(),
|