@sentry/junior 0.229.0 → 0.231.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-hooks-BfjhfMIy.js → agent-hooks-BxL23rrY.js} +10 -10
- package/dist/{agent-runner-DtrpkWV5.js → agent-runner-mpzfRAEr.js} +120 -115
- package/dist/api/schema.d.ts +18 -267
- package/dist/api/schema.js +3 -3
- package/dist/api.js +18 -18
- package/dist/{app-BRZB3MuD.d.ts → app-xk2-Id1T.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +22 -21
- package/dist/{briefs-B6KfFLRA.js → briefs-CTIZORAN.js} +4 -4
- package/dist/{catalog-runtime-Byr3trKF.js → catalog-runtime-RSgQS4lp.js} +1 -1
- package/dist/{checkpoint-DEYb3Fqm.js → checkpoint-Q4FG2BQc.js} +7 -9
- 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-BN5U3CGw.js → client-Mj9HEEKf.js} +3 -2
- package/dist/{config-C4xZrx7G.js → config-CkmcoWGB.js} +2 -2
- package/dist/{conversation-DOI6Y60M.js → conversation-DsuDtoYR.js} +96 -74
- package/dist/{conversation-privacy-CB7wx_tP.js → conversation-privacy-DGj6F9tc.js} +1 -1
- package/dist/{credential-sync-CuEwdxwY.js → credential-sync-CHL297BH.js} +13 -13
- package/dist/{executor-DUqeOd8y.js → executor-_eMyydh0.js} +1 -1
- package/dist/history-DvqWZlYX.d.ts +86 -0
- package/dist/{images-B5JLFwJR.js → images-D9gA15-3.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-C1AJ5uJt.js → job-queue-Dl1lTGqq.js} +1 -1
- package/dist/{logging-Muw6EXro.js → logging-9VpmxvdL.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-CrD-xb8a.js → oauth-authorization-DYZeyL50.js} +1 -1
- package/dist/{oauth-callback-server-DfQos1K1.js → oauth-callback-server-BcVrxzcd.js} +2 -2
- package/dist/{pending-auth-pYQpJmtu.js → pending-auth-mB93uu9V.js} +1 -1
- package/dist/{profile-25NkcK4S.js → profile-CK1KKKfj.js} +4 -4
- package/dist/{prompt-9C-wUwwx.js → prompt-D5RPLy92.js} +1 -1
- package/dist/{registry-DrcbAs8o.js → registry-BzD2Rftl.js} +1 -1
- package/dist/{resolve-D9kl_rkl.js → resolve-C3UI1gHN.js} +2 -2
- package/dist/{runner-D3rf-_hT.js → runner-BETWa1Bq.js} +9 -9
- package/dist/{sandbox-egress-signals-BfQQz6cs.js → sandbox-egress-signals-pjWtc_9b.js} +1 -1
- package/dist/{schema-CXmCvVLn.js → schema-B-Taar1W.js} +1 -1
- package/dist/{skills-rwWf3XjQ.js → skills-B5o4x78h.js} +2 -2
- package/dist/{spawn-z0fRvZH9.js → spawn-pwMuB53X.js} +2 -2
- package/dist/{task-queue-BGo6K-BX.js → task-queue-Bb71mssX.js} +3 -3
- package/dist/{task-runner-DH8M0m7l.js → task-runner-DkaEXCEP.js} +9 -9
- package/dist/{thread-state-CS67FjfN.js → thread-state-HHHiwpYG.js} +5 -5
- package/dist/{turn-failure-response-DcaALKfm.js → turn-failure-response-CtWGQ0fz.js} +17 -15
- package/dist/{turn-lifecycle-DHcpS20C.js → turn-lifecycle-Cosdai_3.js} +1 -1
- package/dist/{turn-session-routing-DlaCHHlu.js → turn-session-routing-DDo6JGTB.js} +1 -1
- package/dist/{validation-CNUPIKMW.js → validation-DoceK2VV.js} +1 -1
- package/dist/{version-B0eXuHqw.js → version-wZ8kdUu1.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-DrXlSd3Y.js → web-authorization-C1coqBWn.js} +6 -6
- package/dist/{web-input-WFoSdz8L.js → web-input-clQr4P53.js} +49 -31
- package/dist/{work-B0cAo7nv.js → work-BW27hKZB.js} +7 -7
- package/dist/{worker-DNklqmhH.js → worker-DQ-0LzAC.js} +5 -5
- package/package.json +5 -4
- package/dist/history-H-SI5Dej.d.ts +0 -128
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { a as embedTexts, r as completeObject } from "./client-
|
|
3
|
-
import { F as normalizeIdentityEmail, I as isRecord$2, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-
|
|
2
|
+
import { a as embedTexts, r as completeObject } from "./client-Mj9HEEKf.js";
|
|
3
|
+
import { F as normalizeIdentityEmail, I as isRecord$2, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-9VpmxvdL.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-DGj6F9tc.js";
|
|
6
|
+
import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-CkmcoWGB.js";
|
|
7
7
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
8
8
|
import { b as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-0Et9iVSB.js";
|
|
9
9
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
10
|
-
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, _ as CONVERSATION_METRICS, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationMetrics, w as juniorAttachments, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-
|
|
11
|
-
import {
|
|
12
|
-
import { C as getDefaultRedisStateAdapterFor, N as SANDBOX_WORKSPACE_ROOT, k as sleep$1, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
13
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
10
|
+
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, _ as CONVERSATION_METRICS, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationMetrics, w as juniorAttachments, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-_eMyydh0.js";
|
|
11
|
+
import { $ as encodeHistoryPayload, C as conversationReportEventSchema, H as readMessageCardRefs, L as conversationBriefSchema, Q as newConversationEventSchema, R as parseBriefInput, X as decodeStoredConversationEvent, Z as historyReplacementSchema, it as usageSchema, j as readMessageAttachments, q as conversationEventDataSchema } from "./conversation-DsuDtoYR.js";
|
|
12
|
+
import { C as getDefaultRedisStateAdapterFor, N as SANDBOX_WORKSPACE_ROOT, k as sleep$1, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-CK1KKKfj.js";
|
|
13
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-D5RPLy92.js";
|
|
14
14
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -1709,7 +1709,7 @@ async function listConversationAnnotationsById(db, conversationIds) {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
//#endregion
|
|
1711
1711
|
//#region src/chat/conversations/annotation-results.ts
|
|
1712
|
-
/** Save object annotations and
|
|
1712
|
+
/** Save object annotations and retain returned facts in the tool result. */
|
|
1713
1713
|
async function saveObjectAnnotations(conversationId, plugin, value) {
|
|
1714
1714
|
const annotations = objectAnnotationSchema.array().parse(value);
|
|
1715
1715
|
await getDb().transaction(async (db) => {
|
|
@@ -2115,7 +2115,7 @@ function reportEventData(args) {
|
|
|
2115
2115
|
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : void 0,
|
|
2116
2116
|
...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta.explicitMention } : void 0,
|
|
2117
2117
|
...args.canExposePayload && typeof data.meta?.trustedSummary === "string" ? { trustedSummary: data.meta.trustedSummary } : void 0,
|
|
2118
|
-
...args.canExposePayload && (data.meta?.cards || data.meta?.objectCards) ? { cards:
|
|
2118
|
+
...args.canExposePayload && (data.meta?.cards || data.meta?.objectCards) ? { cards: readMessageCardRefs(data.meta) } : void 0,
|
|
2119
2119
|
...args.canExposePayload ? {
|
|
2120
2120
|
text: data.text,
|
|
2121
2121
|
...data.meta?.attachments ? { attachments: readMessageAttachments(data.meta.attachments) } : void 0
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { b as getGatewayApiKey, c as hasCompactedConversationContext, d as unwrapCurrentInstruction, f as escapeXml, g as getProviderErrorAttributes, h as findProviderError, i as completeText, l as isCompactionSummaryText, m as createProviderError, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as ProviderError, r as completeObject, s as COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as renderCurrentInstruction, v as isProviderRetryError, x as resolveGatewayCredential, y as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-
|
|
3
|
-
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$3, L as toOptionalNumber, R as toOptionalString, a as extractGenAiUsageSummary, b as setTags, c as getLogContextAttributesForSpan, d as logException, f as logInfo, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as getTracePropagationHeaders, m as normalizeGenAiFinishReason, p as logWarn, s as getLogContextAttributes, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-
|
|
2
|
+
import { b as getGatewayApiKey, c as hasCompactedConversationContext, d as unwrapCurrentInstruction, f as escapeXml, g as getProviderErrorAttributes, h as findProviderError, i as completeText, l as isCompactionSummaryText, m as createProviderError, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as ProviderError, r as completeObject, s as COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as renderCurrentInstruction, v as isProviderRetryError, x as resolveGatewayCredential, y as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-Mj9HEEKf.js";
|
|
3
|
+
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$3, L as toOptionalNumber, R as toOptionalString, a as extractGenAiUsageSummary, b as setTags, c as getLogContextAttributesForSpan, d as logException, f as logInfo, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as getTracePropagationHeaders, m as normalizeGenAiFinishReason, p as logWarn, s as getLogContextAttributes, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-9VpmxvdL.js";
|
|
4
4
|
import { m as startInactiveSpan, n as captureMessage, v as withActiveSpan } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
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-
|
|
6
|
-
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig } from "./config-
|
|
5
|
+
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-DGj6F9tc.js";
|
|
6
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig } from "./config-CkmcoWGB.js";
|
|
7
7
|
import { a as formatModelProfiles, c as profileConfig, i as formatModelProfile, l as TURN_REASONING_LEVELS, n as ModelProfileNotConfiguredError, o as modelIdForProfile, s as modelProfileSchema } from "./model-profile-BwU8mqwD.js";
|
|
8
8
|
import { b as parseSlackMessageTs, d as parseStoredSlackActor, 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-0Et9iVSB.js";
|
|
9
|
-
import { $t as getConversationStore, A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, Ct as createPluginLogger, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, G as isDmChannel$1, Ht as saveObjectAnnotations, J as withSlackRetries, K as normalizeSlackConversationId, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, Qt as getConversationMessageSearchStore, Rt as matchSlackAttachments, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as createPluginAnnotations, V as getFilePermalink, W as isConversationScopedChannel, Zt as getConversationEventStore, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bn as sameDestination$1, c as getPluginTools, cn as addAgentTurnUsage, dt as deliverWatch, en as getDb, fn as hasAgentTurnUsage, ft as findMatchingWatches, g as createWorkspace, gt as getDashboardConversationLink, ht as JUNIOR_THREAD_STATE_TTL_MS, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createTimerWatch, n as applyPluginFormatMarkdown, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as listWatches, r as createPluginHookRunner, rt as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, s as getPluginSystemPromptContributions, st as cancelWatch, tn as getSqlExecutor, tt as getSlackToolContext, u as getPlugins, ut as createWatch, v as getWorkspace, vn as parseDestination, vt as getDashboardTaskLink, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-
|
|
9
|
+
import { $t as getConversationStore, A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, Ct as createPluginLogger, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, G as isDmChannel$1, Ht as saveObjectAnnotations, J as withSlackRetries, K as normalizeSlackConversationId, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, Qt as getConversationMessageSearchStore, Rt as matchSlackAttachments, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as createPluginAnnotations, V as getFilePermalink, W as isConversationScopedChannel, Zt as getConversationEventStore, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bn as sameDestination$1, c as getPluginTools, cn as addAgentTurnUsage, dt as deliverWatch, en as getDb, fn as hasAgentTurnUsage, ft as findMatchingWatches, g as createWorkspace, gt as getDashboardConversationLink, ht as JUNIOR_THREAD_STATE_TTL_MS, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createTimerWatch, n as applyPluginFormatMarkdown, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as listWatches, r as createPluginHookRunner, rt as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, s as getPluginSystemPromptContributions, st as cancelWatch, tn as getSqlExecutor, tt as getSlackToolContext, u as getPlugins, ut as createWatch, v as getWorkspace, vn as parseDestination, vt as getDashboardTaskLink, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-BxL23rrY.js";
|
|
10
10
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
11
|
-
import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-
|
|
12
|
-
import {
|
|
11
|
+
import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-_eMyydh0.js";
|
|
12
|
+
import { F as briefLinkSchema, G as KNOWN_CONVERSATION_EVENT_TYPES, I as briefOutcomeStatusSchema, L as conversationBriefSchema, N as isVisionImageMediaType, U as removedCardSchema, et as contextProvenance, nt as instructionProvenanceFor, rt as sameActorIdentity, tt as instructionActors } from "./conversation-DsuDtoYR.js";
|
|
13
13
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
|
|
14
|
-
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-
|
|
15
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
16
|
-
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-
|
|
17
|
-
import { $ as fallbackShortTitle, C as isToolResultError, D as stripRuntimeTurnContext, E as retainRuntimeTurnContext, F as loadTurnRoute, G as recordToolExecutionStarted, H as recordGuardianActionReviewed, I as openConversationProjection, K as recordTurnRoute, L as recordAgentsInstructionsUpdated, M as loadConnectedMcpProviders, N as loadConversationProjection, O as trimTrailingAssistantMessages, R as recordAttachmentsDelivered, S as isContinuablePiBoundary, T as normalizeToolNameFromResult, U as recordMcpProviderConnected, V as recordAuthorizationRequested, _ as getTerminalAssistantMessages, _t as piMessageFromHistoryItem, d as TurnSliceLimitExceededError, et as generateShortTitle, f as assertTurnToolCallLimit, g as getPiMessageRole, gt as historyItemFromPiMessage, h as extractAssistantText, ht as getAgentContextInputLimitTokens, k as TURN_CONTEXT_TAG, m as isTurnExecutionLimitExceededError, mt as getAgentContextCompactionTriggerTokens, n as loadTurnCheckpoint, pt as estimateTextTokens, r as saveTurnCheckpoint, t as continuableMessages, tt as resolveTaskTitle, v as getUserMessageInstructionText, w as isToolResultMessage, x as isAssistantMessage, y as hasRuntimeTurnContext } from "./checkpoint-
|
|
18
|
-
import { A as SANDBOX_DATA_ROOT, C as getDefaultRedisStateAdapterFor, D as fenceLock, E as acquireActiveLock, F as sandboxSkillFile, I as sandboxSkillPathResolution, M as SANDBOX_SKILLS_ROOT, N as SANDBOX_WORKSPACE_ROOT, O as withLock, P as sandboxSkillDir, _ 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_REPOS_ROOT, k as sleep$2, 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 { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-
|
|
20
|
-
import { a as NO_REPLY_MARKER, c as CooperativeTurnYieldError, i as sanitizeAssistantText, l as TurnInputCommitLostError, n as decideReply, o as isNoReplyMarker, p as isTurnInputCommitLostError, r as getAssistantReplyText, t as authorizationId } from "./oauth-authorization-
|
|
21
|
-
import { r as EVENT_AUTHOR_ID } from "./prompt-
|
|
22
|
-
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 getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-
|
|
14
|
+
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-BzD2Rftl.js";
|
|
15
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-RSgQS4lp.js";
|
|
16
|
+
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-B5o4x78h.js";
|
|
17
|
+
import { $ as fallbackShortTitle, C as isToolResultError, D as stripRuntimeTurnContext, E as retainRuntimeTurnContext, F as loadTurnRoute, G as recordToolExecutionStarted, H as recordGuardianActionReviewed, I as openConversationProjection, K as recordTurnRoute, L as recordAgentsInstructionsUpdated, M as loadConnectedMcpProviders, N as loadConversationProjection, O as trimTrailingAssistantMessages, R as recordAttachmentsDelivered, S as isContinuablePiBoundary, T as normalizeToolNameFromResult, U as recordMcpProviderConnected, V as recordAuthorizationRequested, _ as getTerminalAssistantMessages, _t as piMessageFromHistoryItem, d as TurnSliceLimitExceededError, et as generateShortTitle, f as assertTurnToolCallLimit, g as getPiMessageRole, gt as historyItemFromPiMessage, h as extractAssistantText, ht as getAgentContextInputLimitTokens, k as TURN_CONTEXT_TAG, m as isTurnExecutionLimitExceededError, mt as getAgentContextCompactionTriggerTokens, n as loadTurnCheckpoint, pt as estimateTextTokens, r as saveTurnCheckpoint, t as continuableMessages, tt as resolveTaskTitle, v as getUserMessageInstructionText, w as isToolResultMessage, x as isAssistantMessage, y as hasRuntimeTurnContext } from "./checkpoint-Q4FG2BQc.js";
|
|
18
|
+
import { A as SANDBOX_DATA_ROOT, C as getDefaultRedisStateAdapterFor, D as fenceLock, E as acquireActiveLock, F as sandboxSkillFile, I as sandboxSkillPathResolution, M as SANDBOX_SKILLS_ROOT, N as SANDBOX_WORKSPACE_ROOT, O as withLock, P as sandboxSkillDir, _ 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_REPOS_ROOT, k as sleep$2, 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-CK1KKKfj.js";
|
|
19
|
+
import { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-mB93uu9V.js";
|
|
20
|
+
import { a as NO_REPLY_MARKER, c as CooperativeTurnYieldError, i as sanitizeAssistantText, l as TurnInputCommitLostError, n as decideReply, o as isNoReplyMarker, p as isTurnInputCommitLostError, r as getAssistantReplyText, t as authorizationId } from "./oauth-authorization-DYZeyL50.js";
|
|
21
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-D5RPLy92.js";
|
|
22
|
+
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-C3UI1gHN.js";
|
|
23
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-Dl1lTGqq.js";
|
|
24
24
|
import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
|
|
25
25
|
import { streamSimple } from "@earendil-works/pi-ai/compat";
|
|
26
26
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -39,6 +39,7 @@ import fs$1 from "node:fs";
|
|
|
39
39
|
import { isRetryableAssistantError } from "@earendil-works/pi-ai";
|
|
40
40
|
import { Sandbox } from "@vercel/sandbox";
|
|
41
41
|
import { Bash, defineCommand } from "just-bash";
|
|
42
|
+
import { structuredPatch } from "diff";
|
|
42
43
|
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
43
44
|
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
44
45
|
import { StreamableHTTPClientTransport, StreamableHTTPError } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
@@ -6943,16 +6944,6 @@ function createSandboxRuntime(options) {
|
|
|
6943
6944
|
//#endregion
|
|
6944
6945
|
//#region src/chat/tools/sandbox/text-edits.ts
|
|
6945
6946
|
const MAX_DIFF_LINE_CHARS = 4e3;
|
|
6946
|
-
function truncateDiffLine(value) {
|
|
6947
|
-
if (value.length <= MAX_DIFF_LINE_CHARS) return {
|
|
6948
|
-
line: value,
|
|
6949
|
-
truncated: false
|
|
6950
|
-
};
|
|
6951
|
-
return {
|
|
6952
|
-
line: `${value.slice(0, MAX_DIFF_LINE_CHARS)}... [line truncated]`,
|
|
6953
|
-
truncated: true
|
|
6954
|
-
};
|
|
6955
|
-
}
|
|
6956
6947
|
/** Preserve a text artifact's dominant line-ending style across rewrites. */
|
|
6957
6948
|
function detectLineEnding(value) {
|
|
6958
6949
|
return value.includes("\r\n") ? "\r\n" : "\n";
|
|
@@ -6982,9 +6973,7 @@ function countOccurrences(content, target) {
|
|
|
6982
6973
|
}
|
|
6983
6974
|
return count;
|
|
6984
6975
|
}
|
|
6985
|
-
function firstChangedLine(
|
|
6986
|
-
const oldLines = oldContent.split("\n");
|
|
6987
|
-
const newLines = newContent.split("\n");
|
|
6976
|
+
function firstChangedLine(oldLines, newLines) {
|
|
6988
6977
|
const count = Math.max(oldLines.length, newLines.length);
|
|
6989
6978
|
for (let index = 0; index < count; index += 1) if (oldLines[index] !== newLines[index]) return index + 1;
|
|
6990
6979
|
}
|
|
@@ -7024,35 +7013,40 @@ function prepareTextReplacementArguments(input) {
|
|
|
7024
7013
|
function buildCompactDiff(oldContent, newContent) {
|
|
7025
7014
|
const oldLines = oldContent.split("\n");
|
|
7026
7015
|
const newLines = newContent.split("\n");
|
|
7027
|
-
|
|
7028
|
-
while (prefix < oldLines.length && prefix < newLines.length && oldLines[prefix] === newLines[prefix]) prefix += 1;
|
|
7029
|
-
let oldSuffix = oldLines.length - 1;
|
|
7030
|
-
let newSuffix = newLines.length - 1;
|
|
7031
|
-
while (oldSuffix >= prefix && newSuffix >= prefix && oldLines[oldSuffix] === newLines[newSuffix]) {
|
|
7032
|
-
oldSuffix -= 1;
|
|
7033
|
-
newSuffix -= 1;
|
|
7034
|
-
}
|
|
7035
|
-
const contextStart = Math.max(0, prefix - 3);
|
|
7036
|
-
const newContextEnd = Math.min(newLines.length - 1, newSuffix + 3);
|
|
7037
|
-
const oldContextEnd = Math.min(oldLines.length - 1, oldSuffix + 3);
|
|
7016
|
+
const { hunks } = structuredPatch("", "", oldContent, newContent, void 0, void 0, { context: 3 });
|
|
7038
7017
|
const width = String(Math.max(oldLines.length, newLines.length)).length;
|
|
7039
7018
|
const output = [];
|
|
7040
7019
|
let lineTruncated = false;
|
|
7041
|
-
const pushLine = (
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
for (
|
|
7050
|
-
|
|
7051
|
-
|
|
7020
|
+
const pushLine = (line) => {
|
|
7021
|
+
if (line.length > MAX_DIFF_LINE_CHARS) {
|
|
7022
|
+
line = `${line.slice(0, MAX_DIFF_LINE_CHARS)}... [line truncated]`;
|
|
7023
|
+
lineTruncated = true;
|
|
7024
|
+
}
|
|
7025
|
+
output.push(line);
|
|
7026
|
+
};
|
|
7027
|
+
let nextLine = 1;
|
|
7028
|
+
for (const hunk of hunks) {
|
|
7029
|
+
if (hunk.newStart > nextLine) pushLine(` ${"".padStart(width)} ...`);
|
|
7030
|
+
let oldLine = hunk.oldStart;
|
|
7031
|
+
let newLine = hunk.newStart;
|
|
7032
|
+
for (const line of hunk.lines) {
|
|
7033
|
+
const prefix = line[0];
|
|
7034
|
+
if (prefix === "\\") {
|
|
7035
|
+
pushLine(line);
|
|
7036
|
+
continue;
|
|
7037
|
+
}
|
|
7038
|
+
pushLine(`${prefix}${String(prefix === "-" ? oldLine : newLine).padStart(width)} ${line.slice(1)}`);
|
|
7039
|
+
if (prefix !== "+") oldLine += 1;
|
|
7040
|
+
if (prefix !== "-") newLine += 1;
|
|
7041
|
+
}
|
|
7042
|
+
nextLine = newLine;
|
|
7043
|
+
}
|
|
7044
|
+
const newLineCount = newContent ? newLines.length - (newContent.endsWith("\n") ? 1 : 0) : 0;
|
|
7045
|
+
if (hunks.length > 0 && nextLine <= newLineCount) pushLine(` ${"".padStart(width)} ...`);
|
|
7052
7046
|
const bounded = truncateText$1(output.join("\n"), MAX_TEXT_CHARS);
|
|
7053
7047
|
return {
|
|
7054
7048
|
diff: bounded.content,
|
|
7055
|
-
firstChangedLine: firstChangedLine(
|
|
7049
|
+
firstChangedLine: firstChangedLine(oldLines, newLines),
|
|
7056
7050
|
truncated: lineTruncated || bounded.truncated
|
|
7057
7051
|
};
|
|
7058
7052
|
}
|
|
@@ -10786,7 +10780,7 @@ function createDeleteEventAutomationTool(context, catalog) {
|
|
|
10786
10780
|
executionMode: "sequential",
|
|
10787
10781
|
description: "Delete an event automation.",
|
|
10788
10782
|
inputSchema: z.object({ automationId: z.string().min(1) }).strict(),
|
|
10789
|
-
outputSchema: eventAutomationToolResultSchema.omit({ objectCards: true }).extend({ removedCards: z.array(
|
|
10783
|
+
outputSchema: eventAutomationToolResultSchema.omit({ objectCards: true }).extend({ removedCards: z.array(removedCardSchema) }),
|
|
10790
10784
|
async execute({ automationId }) {
|
|
10791
10785
|
const { actor } = requireEventAutomationSlackContext(context);
|
|
10792
10786
|
const current = await writableEventAutomation(context, automationId);
|
|
@@ -12085,7 +12079,7 @@ function createSlackScheduleDeleteAutomationTool(context) {
|
|
|
12085
12079
|
description: "Delete one scheduled Junior task from the active Slack conversation. Use only task IDs returned for this conversation. Do not delete schedules from threads, other channels, or another user's DM.",
|
|
12086
12080
|
executionMode: "sequential",
|
|
12087
12081
|
inputSchema: z.object({ automationId: z.string().min(1).describe("ID of the task to delete. Must be from this active Slack conversation.") }),
|
|
12088
|
-
outputSchema: scheduleAutomationToolResultSchema.extend({ removedCards: z.array(
|
|
12082
|
+
outputSchema: scheduleAutomationToolResultSchema.extend({ removedCards: z.array(removedCardSchema) }),
|
|
12089
12083
|
execute: async ({ automationId }) => {
|
|
12090
12084
|
const next = {
|
|
12091
12085
|
...await getWritableTask({
|
|
@@ -13636,7 +13630,7 @@ async function collectAttachmentGarbage(args) {
|
|
|
13636
13630
|
return { deleted: (await args.db.db().delete(juniorAttachments).where(inArray(juniorAttachments.id, stillEligible.map((row) => row.id))).returning({ id: juniorAttachments.id })).length };
|
|
13637
13631
|
}
|
|
13638
13632
|
//#endregion
|
|
13639
|
-
//#region src/chat/
|
|
13633
|
+
//#region src/chat/tools/send-files.ts
|
|
13640
13634
|
const sendFilesResultSchema = juniorToolOutputSchema.extend({
|
|
13641
13635
|
deduplicated: z.boolean().optional(),
|
|
13642
13636
|
attachment_refs: z.array(z.object({
|
|
@@ -13651,9 +13645,6 @@ function normalizeFiles(files) {
|
|
|
13651
13645
|
...file.mimeType ? { mimeType: file.mimeType } : void 0
|
|
13652
13646
|
}));
|
|
13653
13647
|
}
|
|
13654
|
-
function fileContentDigest(data) {
|
|
13655
|
-
return createHash("sha256").update(data).digest("hex");
|
|
13656
|
-
}
|
|
13657
13648
|
/** Include file bytes in idempotency so rewritten paths can be sent again. */
|
|
13658
13649
|
function fileOperationInput(files) {
|
|
13659
13650
|
return files.map((file) => ({
|
|
@@ -13661,11 +13652,12 @@ function fileOperationInput(files) {
|
|
|
13661
13652
|
filename: file.filename,
|
|
13662
13653
|
mimeType: file.mimeType,
|
|
13663
13654
|
path: file.path,
|
|
13664
|
-
sha256:
|
|
13655
|
+
sha256: createHash("sha256").update(file.data).digest("hex")
|
|
13665
13656
|
}));
|
|
13666
13657
|
}
|
|
13667
|
-
/**
|
|
13668
|
-
function createSendFilesTool(
|
|
13658
|
+
/** Store files in the active Conversation and optionally deliver them to its Location. */
|
|
13659
|
+
function createSendFilesTool(state, materializeFile, output) {
|
|
13660
|
+
const { attachments, delivery } = output;
|
|
13669
13661
|
return zodTool({
|
|
13670
13662
|
annotations: {
|
|
13671
13663
|
destructiveHint: false,
|
|
@@ -13673,69 +13665,76 @@ function createSendFilesTool(context, state, materializeFile, attachments) {
|
|
|
13673
13665
|
openWorldHint: true,
|
|
13674
13666
|
readOnlyHint: false
|
|
13675
13667
|
},
|
|
13676
|
-
description: "
|
|
13668
|
+
description: delivery?.description ?? "Attach one or more sandbox files to the active conversation. Files use the conversation's access rules; this does not publish public URLs.",
|
|
13677
13669
|
inputSchema: z.object({ files: z.array(sandboxFileReferenceSchema).min(1).describe("One or more existing sandbox files. Objects returned by imageGenerate or webFetch can be passed unchanged.") }),
|
|
13678
13670
|
outputSchema: sendFilesResultSchema,
|
|
13679
13671
|
execute: async ({ files }, options) => {
|
|
13680
13672
|
const filesToSend = normalizeFiles(files);
|
|
13681
|
-
const activeChannelId = context.locationChannelId;
|
|
13682
|
-
const threadTs = context.threadTs ?? context.messageTs;
|
|
13683
13673
|
const materializedFiles = await Promise.all(filesToSend.map((file) => materializeFile(file)));
|
|
13684
13674
|
const operationKey = createOperationKey("sendFiles", {
|
|
13685
|
-
|
|
13686
|
-
|
|
13675
|
+
conversation_id: attachments?.conversationId,
|
|
13676
|
+
delivery: delivery?.key,
|
|
13687
13677
|
files: fileOperationInput(materializedFiles)
|
|
13688
13678
|
});
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13679
|
+
let cached = state.getOperationResult(operationKey);
|
|
13680
|
+
const deduplicated = Boolean(cached);
|
|
13681
|
+
if (!cached) {
|
|
13682
|
+
const stored = attachments ? await storeAttachments({
|
|
13693
13683
|
conversationId: attachments.conversationId,
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13684
|
+
db: attachments.db,
|
|
13685
|
+
files: materializedFiles,
|
|
13686
|
+
storage: attachments.storage
|
|
13687
|
+
}) : [];
|
|
13688
|
+
await delivery?.send(materializedFiles);
|
|
13689
|
+
cached = {
|
|
13690
|
+
delivered: stored.map((attachment, index) => {
|
|
13691
|
+
const file = materializedFiles[index];
|
|
13692
|
+
return {
|
|
13693
|
+
id: attachment.id,
|
|
13694
|
+
filename: file.filename,
|
|
13695
|
+
contentType: file.mimeType,
|
|
13696
|
+
bytes: file.bytes
|
|
13697
|
+
};
|
|
13698
|
+
}),
|
|
13699
|
+
...options.toolCallId ? { toolCallId: options.toolCallId } : void 0
|
|
13700
|
+
};
|
|
13701
|
+
state.setOperationResult(operationKey, cached);
|
|
13700
13702
|
}
|
|
13701
|
-
|
|
13703
|
+
if (attachments && cached.delivered.length > 0) await recordAttachmentsDelivered({
|
|
13704
|
+
attachments: cached.delivered,
|
|
13702
13705
|
conversationId: attachments.conversationId,
|
|
13703
|
-
|
|
13704
|
-
files: materializedFiles,
|
|
13705
|
-
storage: attachments.storage
|
|
13706
|
-
}) : [];
|
|
13707
|
-
await uploadFilesToConversation({
|
|
13708
|
-
channelId: activeChannelId,
|
|
13709
|
-
files: materializedFiles.map((file) => ({
|
|
13710
|
-
data: file.data,
|
|
13711
|
-
filename: file.filename
|
|
13712
|
-
})),
|
|
13713
|
-
...threadTs ? { threadTs } : void 0
|
|
13714
|
-
});
|
|
13715
|
-
const delivered = stored.map((attachment, index) => {
|
|
13716
|
-
const file = materializedFiles[index];
|
|
13717
|
-
return {
|
|
13718
|
-
id: attachment.id,
|
|
13719
|
-
filename: file.filename,
|
|
13720
|
-
contentType: file.mimeType,
|
|
13721
|
-
bytes: file.bytes
|
|
13722
|
-
};
|
|
13706
|
+
...cached.toolCallId ? { toolCallId: cached.toolCallId } : void 0
|
|
13723
13707
|
});
|
|
13724
|
-
const
|
|
13725
|
-
id
|
|
13726
|
-
filename
|
|
13708
|
+
const result = { attachment_refs: cached.delivered.map(({ id, filename }) => ({
|
|
13709
|
+
id,
|
|
13710
|
+
filename
|
|
13727
13711
|
})) };
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13712
|
+
if (deduplicated) result.deduplicated = true;
|
|
13713
|
+
return result;
|
|
13714
|
+
}
|
|
13715
|
+
});
|
|
13716
|
+
}
|
|
13717
|
+
//#endregion
|
|
13718
|
+
//#region src/chat/slack/tools/send-files.ts
|
|
13719
|
+
/** Deliver files to the active Slack Location and retain Conversation attachments. */
|
|
13720
|
+
function createSlackSendFilesTool(context, state, materializeFile, attachments) {
|
|
13721
|
+
const channelId = context.locationChannelId;
|
|
13722
|
+
const threadTs = context.threadTs ?? context.messageTs;
|
|
13723
|
+
return createSendFilesTool(state, materializeFile, {
|
|
13724
|
+
attachments,
|
|
13725
|
+
delivery: {
|
|
13726
|
+
key: `${channelId}:${threadTs ?? ""}`,
|
|
13727
|
+
description: "Send one or more sandbox files into the active Slack conversation.",
|
|
13728
|
+
async send(files) {
|
|
13729
|
+
await uploadFilesToConversation({
|
|
13730
|
+
channelId,
|
|
13731
|
+
files: files.map((file) => ({
|
|
13732
|
+
data: file.data,
|
|
13733
|
+
filename: file.filename
|
|
13734
|
+
})),
|
|
13735
|
+
...threadTs ? { threadTs } : void 0
|
|
13736
|
+
});
|
|
13737
|
+
}
|
|
13739
13738
|
}
|
|
13740
13739
|
});
|
|
13741
13740
|
}
|
|
@@ -17071,7 +17070,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
17071
17070
|
const state = createToolState();
|
|
17072
17071
|
const slackContext = getSlackToolContext(context);
|
|
17073
17072
|
const slackLocationCapabilities = slackContext ? resolveChannelCapabilities(slackContext.locationChannelId) : void 0;
|
|
17074
|
-
const canSendFilesToActiveConversation = Boolean(slackContext
|
|
17073
|
+
const canSendFilesToActiveConversation = Boolean(slackContext ? slackLocationCapabilities?.canSendFiles : context.attachmentStorage);
|
|
17075
17074
|
const eventCatalog = getEventCatalog();
|
|
17076
17075
|
const tools = {
|
|
17077
17076
|
...options.includeLoadSkill === false ? void 0 : { loadSkill: createLoadSkillTool(availableSkills, { onSkillLoaded: hooks.onSkillLoaded }) },
|
|
@@ -17104,6 +17103,11 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
17104
17103
|
canSendFilesToActiveConversation
|
|
17105
17104
|
}, hooks.toolOverrides?.imageGenerate);
|
|
17106
17105
|
if (context.attachmentStorage) {
|
|
17106
|
+
if (!slackContext) tools.sendFiles = createSendFilesTool(state, (input) => readSandboxFileUpload(context.workspace, input), { attachments: {
|
|
17107
|
+
conversationId: context.conversationId,
|
|
17108
|
+
db: getSqlExecutor(),
|
|
17109
|
+
storage: context.attachmentStorage
|
|
17110
|
+
} });
|
|
17107
17111
|
tools.loadAttachment = createLoadAttachmentTool({
|
|
17108
17112
|
conversationId: context.conversationId,
|
|
17109
17113
|
db: getSqlExecutor(),
|
|
@@ -17152,7 +17156,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
17152
17156
|
const outputCapabilities = outputChannelId ? resolveChannelCapabilities(outputChannelId) : void 0;
|
|
17153
17157
|
const locationCapabilities = resolveChannelCapabilities(slackContext.locationChannelId);
|
|
17154
17158
|
if (outputCapabilities?.canCreateCanvas) tools.slackCanvasCreate = createSlackCanvasCreateTool(slackContext, state);
|
|
17155
|
-
if (locationCapabilities.canSendFiles) tools.sendFiles =
|
|
17159
|
+
if (locationCapabilities.canSendFiles) tools.sendFiles = createSlackSendFilesTool(slackContext, state, (input) => readSandboxFileUpload(context.workspace, input), context.attachmentStorage ? {
|
|
17156
17160
|
conversationId: context.conversationId,
|
|
17157
17161
|
db: getSqlExecutor(),
|
|
17158
17162
|
storage: context.attachmentStorage
|
|
@@ -20502,6 +20506,7 @@ async function summarizeContext(args, deps) {
|
|
|
20502
20506
|
].includes(message.role));
|
|
20503
20507
|
const summary = (await deps.completeText({
|
|
20504
20508
|
modelId: botConfig.fastModelId,
|
|
20509
|
+
cacheRetention: "none",
|
|
20505
20510
|
messageAttributeMode: "metadata",
|
|
20506
20511
|
temperature: 0,
|
|
20507
20512
|
signal: args.signal,
|
|
@@ -21929,7 +21934,7 @@ function createAgentRunner(execute, options) {
|
|
|
21929
21934
|
} } : void 0
|
|
21930
21935
|
};
|
|
21931
21936
|
if (run.instruction.storedAttachments?.length) {
|
|
21932
|
-
const { loadInputImages } = await import("./images-
|
|
21937
|
+
const { loadInputImages } = await import("./images-D9gA15-3.js").then((n) => n.n);
|
|
21933
21938
|
const storage = nextRun.environment?.attachmentStorage;
|
|
21934
21939
|
if (!storage) throw new Error("Attachment storage is unavailable.");
|
|
21935
21940
|
nextRun.instruction = {
|