@sentry/junior 0.252.0 → 0.254.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/{admin-C_-XEdym.js → admin-D7kYbu5l.js} +1 -1
- package/dist/{agent-hooks-DcoKnnxn.js → agent-hooks-DfPubHYm.js} +9 -9
- package/dist/{agent-invocations-D_YoNnAn.js → agent-invocations-BY60iNw-.js} +0 -4
- package/dist/{agent-runner-B-7S_DCS.js → agent-runner-BWmnJ0dD.js} +21 -21
- package/dist/api/schema.js +1 -1
- package/dist/api.js +23 -23
- package/dist/app.js +113 -83
- package/dist/{assistant-reply-DbPLvsnL.js → assistant-reply-B3J6ogAM.js} +1 -1
- package/dist/{briefs-D4SMqc-r.js → briefs-B_fgUFD2.js} +2 -2
- package/dist/{catalog-runtime-BQQiwwA7.js → catalog-runtime-TG5WF66H.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-ROZeVjq0.js → client-oBgOmQV6.js} +2 -2
- package/dist/{config-DNNkxfGS.js → config-CRlLncIj.js} +2 -2
- package/dist/{connections-DJV6mLrH.js → connections-BZAuDnYm.js} +9 -9
- package/dist/{conversation-privacy-B19umzIL.js → conversation-privacy-Dui3hTO-.js} +1 -1
- package/dist/{credential-sync-CEd2F5PS.js → credential-sync-9HiSpphh.js} +14 -14
- package/dist/{executor-_4bdoCxe.js → executor-B88oEqok.js} +41 -92
- package/dist/{images-BAN7DHuO.js → images-k8HewSp_.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DSQx1qFY.js → job-queue-B6KaQXY6.js} +1 -1
- package/dist/{logging-COUsTFIL.js → logging-B3nJLXT7.js} +1 -1
- package/dist/{message-CtDDEwwV.js → message-C9Wx3Rxx.js} +3 -3
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CCiKrS0s.js → oauth-callback-server-CetsCZng.js} +2 -2
- package/dist/{pending-auth-DDx3EU4M.js → pending-auth-m8aJlwP_.js} +2 -2
- package/dist/{profile-DP4LKL6V.js → profile-Dh73O6lZ.js} +4 -4
- package/dist/{registry-CeEpPna6.js → registry-C-jns0Be.js} +1 -1
- package/dist/{resolve-B5ma3igH.js → resolve-CDYCpS_U.js} +2 -2
- package/dist/{result-Da0RVuWG.js → result-sih-x_yN.js} +6 -6
- package/dist/{runner-se1W_jGZ.js → runner-CA43p74t.js} +9 -9
- package/dist/{sandbox-egress-signals-CS959-wm.js → sandbox-egress-signals-CxHHTu8e.js} +1 -1
- package/dist/{schema-C9Vnyb_f.js → schema-C-a9U34c.js} +1 -1
- package/dist/{session-stop-DlRDisF5.js → session-stop-DenN1GuJ.js} +11 -11
- package/dist/{skills-CSzgs0EC.js → skills-D_XDFkSx.js} +2 -2
- package/dist/{spawn-DT9fMjtd.js → spawn-CcWYt3Tl.js} +2 -2
- package/dist/{store-Dx1U69mm.js → store-CIs0Tr31.js} +6 -6
- package/dist/{task-queue-BX9YrIsw.js → task-queue-DAY-aQLX.js} +3 -3
- package/dist/{task-runner-CO55Olal.js → task-runner-BE6Jgt2u.js} +145 -127
- package/dist/{tasks-DwGlFX9i.js → tasks-DO9VM9cu.js} +15 -26
- package/dist/{thread-state-Ces6tXmB.js → thread-state-FreaCOZD.js} +7 -7
- package/dist/{turn-failure-response-B4VCvEQf.js → turn-failure-response-CJSt2ZSf.js} +7 -7
- package/dist/{turn-lifecycle-B1VV58Yo.js → turn-lifecycle-BXclEcfZ.js} +1 -1
- package/dist/{turn-session-routing-Dw2Kamg9.js → turn-session-routing-CItfUsjQ.js} +1 -1
- package/dist/{validation-yJF9LKOv.js → validation-MW8dmhF9.js} +1 -1
- package/dist/{version-CZYqvIFh.js → version-DcWD8xpq.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-D96vo_42.js → viewer-CGZiUVMU.js} +4 -13
- package/dist/{web-input-5mls-41-.js → web-input-Dpqh0oBt.js} +44 -52
- package/dist/{work-D2M2-zCO.js → work-DbA9xNO1.js} +9 -9
- package/dist/{worker-BwCpf8tB.js → worker-DuCs9-3G.js} +5 -5
- package/migrations/0056_automation_runs.sql +69 -0
- package/migrations/0057_drop_legacy_automation_tables.sql +10 -0
- package/migrations/meta/0056_snapshot.json +4280 -0
- package/migrations/meta/0057_snapshot.json +3618 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-
|
|
1
|
+
import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-CGZiUVMU.js";
|
|
2
2
|
import { CLI_USAGE } from "./cli/run.js";
|
|
3
3
|
//#region src/cli/admin.ts
|
|
4
4
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { a as embedTexts, r as completeObject } from "./client-
|
|
3
|
-
import { I as isRecord$1, a as extractGenAiUsageSummary, 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-oBgOmQV6.js";
|
|
3
|
+
import { I as isRecord$1, a as extractGenAiUsageSummary, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-B3nJLXT7.js";
|
|
4
4
|
import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
-
import { i as getChatConfig, n as botConfig, o as getSlackBotToken } from "./config-
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-Dui3hTO-.js";
|
|
6
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken } from "./config-CRlLncIj.js";
|
|
7
7
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
8
8
|
import { d as parseSlackTeamId, g as parseSlackMessageTs, i as isActorUserId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
|
|
9
|
-
import { O as readUserTimezone, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as createSqlStore, i as resolveViewerUser, k as saveUserTimezone, r as readActorIdentity } from "./viewer-
|
|
10
|
-
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-
|
|
11
|
-
import { b as
|
|
9
|
+
import { O as readUserTimezone, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as createSqlStore, i as resolveViewerUser, k as saveUserTimezone, r as readActorIdentity } from "./viewer-CGZiUVMU.js";
|
|
10
|
+
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
|
|
11
|
+
import { _ as juniorConversationAnnotations, b as juniorAttachments, f as juniorConversationBriefs, h as juniorConversationEvents, i as juniorWorkspaces, n as juniorSnapshots, r as juniorWorkspaceRepos, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-B88oEqok.js";
|
|
12
12
|
import { o as decodeStoredConversationEvent } from "./history-9pO1Zd4Y.js";
|
|
13
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
13
|
+
import { p as credentialSubjectSchema } from "./registry-C-jns0Be.js";
|
|
14
14
|
import { C as conversationReportEventSchema, F as readMessageAttachments, H as conversationBriefSchema, U as parseBriefInput, q as readMessageCardRefs } from "./conversation-T18Xlkx9.js";
|
|
15
|
-
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-
|
|
15
|
+
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-Dh73O6lZ.js";
|
|
16
16
|
import { i as isValidTimeZone } from "./cadence-D00SCzT1.js";
|
|
17
17
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C04mP1hu.js";
|
|
18
18
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -71,9 +71,6 @@ const juniorConversations = pgTable("junior_conversations", {
|
|
|
71
71
|
source: text("source").$type(),
|
|
72
72
|
/** Structured session Source locator; set-once on the conversation root. */
|
|
73
73
|
sessionSource: jsonb("source_json").$type(),
|
|
74
|
-
originType: text("origin_type"),
|
|
75
|
-
originId: text("origin_id"),
|
|
76
|
-
originRunId: text("origin_run_id"),
|
|
77
74
|
/** Complete Location associated with this Conversation. */
|
|
78
75
|
location: jsonb("location_json").$type(),
|
|
79
76
|
destinationId: text("destination_id").references(() => juniorDestinations.id),
|
|
@@ -109,7 +106,6 @@ const juniorConversations = pgTable("junior_conversations", {
|
|
|
109
106
|
index("junior_conversations_active_idx").using("btree", sql`coalesce(${table.executionUpdatedAt}, ${table.updatedAt})`, table.conversationId).where(sql`${table.executionStatus} <> 'idle'`),
|
|
110
107
|
index("junior_conversations_destination_activity_idx").on(table.destinationId, table.lastActivityAt.desc()),
|
|
111
108
|
index("junior_conversations_actor_activity_idx").on(table.actorIdentityId, table.lastActivityAt.desc()),
|
|
112
|
-
index("junior_conversations_origin_idx").on(table.originType, table.originId, table.lastActivityAt.desc()),
|
|
113
109
|
index("junior_conversations_parent_idx").on(table.parentConversationId),
|
|
114
110
|
index("junior_conversations_forked_from_idx").on(table.forkedFromConversationId),
|
|
115
111
|
index("junior_conversations_root_idx").on(table.rootConversationId)
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
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-
|
|
2
|
-
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$4, 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, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-
|
|
1
|
+
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-oBgOmQV6.js";
|
|
2
|
+
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$4, 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, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-B3nJLXT7.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 { n as botConfig, v as normalizeSlackEmojiName } 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-Dui3hTO-.js";
|
|
5
|
+
import { n as botConfig, v as normalizeSlackEmojiName } from "./config-CRlLncIj.js";
|
|
6
6
|
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";
|
|
7
7
|
import { a as isUserActor, d as parseSlackTeamId, f as parseSlackUserId, g as parseSlackMessageTs, l as parseSlackChannelId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
|
|
8
|
-
import { N as parseDestination, S as agentTurnCostUsd, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, l as getConversationMessageSearchStore, r as readActorIdentity, u as getConversationStore, x as addAgentTurnUsage } from "./viewer-
|
|
9
|
-
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, i as juniorAgentBindings, n as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, s as juniorConversations, t as AGENT_INVOCATION_MAILBOX_STATUSES } from "./agent-invocations-
|
|
10
|
-
import {
|
|
8
|
+
import { N as parseDestination, S as agentTurnCostUsd, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, l as getConversationMessageSearchStore, r as readActorIdentity, u as getConversationStore, x as addAgentTurnUsage } from "./viewer-CGZiUVMU.js";
|
|
9
|
+
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, i as juniorAgentBindings, n as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, s as juniorConversations, t as AGENT_INVOCATION_MAILBOX_STATUSES } from "./agent-invocations-BY60iNw-.js";
|
|
10
|
+
import { _ as juniorConversationAnnotations, b as juniorAttachments, c as juniorStats, f as juniorConversationBriefs, o as juniorAutomationRuns, x as juniorArtifacts } from "./executor-B88oEqok.js";
|
|
11
11
|
import { d as contextProvenance, f as instructionActors, m as sameActorIdentity, p as instructionProvenanceFor, t as KNOWN_CONVERSATION_EVENT_TYPES, u as agentInstructionProvenance } from "./history-9pO1Zd4Y.js";
|
|
12
12
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-BVvSnQBB.js";
|
|
13
|
-
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as credentialContextForActor, f as credentialContextSchema, h as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, m as credentialUserSubjectId, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-
|
|
14
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
15
|
-
import { a as parseSkillInvocation, i as parseSkillFile, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-
|
|
16
|
-
import { B as postSlackEphemeralMessage, Bt as recordMcpProviderConnected, Ct as TURN_CONTEXT_TAG, Dt as loadConnectedMcpProviders, F as slackMention, Ft as recordAttachmentsDelivered, Ht as recordToolExecutionStarted, J as saveTurnCheckpoint, K as continuableMessages, L as addReactionToMessage, M as formatSlackLink, Mt as loadTurnRoute, Nt as openConversationProjection, Ot as loadConversationProjection, Pt as recordAgentsInstructionsUpdated, Qt as resolveTaskTitle, R as getSlackMessagePermalink, Rt as recordAuthorizationRequested, St as trimTrailingAssistantMessages, U as uploadFilesToConversation, Ut as recordTurnRoute, V as postSlackMessage, Zt as fallbackShortTitle, _t as isToolResultError, a as readScheduledAutomation, at as TurnToolCallLimitExceededError, b as saveEventAutomation, bt as retainRuntimeTurnContext, ct as isTurnExecutionLimitExceededError, dn as getAgentContextCompactionTriggerTokens, dt as getTerminalAssistantMessages, f as createEventAutomation, fn as getAgentContextInputLimitTokens, ft as getUserMessageInstructionText, g as getEventAutomation, gt as isContinuablePiBoundary, ht as isAssistantMessage, it as TurnSliceLimitExceededError, j as escapeSlackMrkdwnText, k as automationRevision, kt as loadLastModelProfile, lt as extractAssistantText, mn as piMessageFromHistoryItem, nt as TURN_LIMIT_DISABLED_REASON, o as saveScheduledAutomation, p as deleteEventAutomation, pn as historyItemFromPiMessage, pt as hasRuntimeTurnContext, q as loadTurnCheckpoint, r as listScheduledAutomationsForTeam, rt as TurnBudgetExceededError, st as createTurnLimitGate, t as createScheduledAutomation, un as estimateTextTokens, ut as getPiMessageRole, v as listEventAutomationsForTeam, vt as isToolResultMessage, wt as ToolInputError, x as setEventAutomationStatus, xt as stripRuntimeTurnContext, yt as normalizeToolNameFromResult, z as openSlackDirectMessage, zt as recordGuardianActionReviewed } from "./tasks-
|
|
17
|
-
import { A as getWorkspaceSnapshotBuilder, B as STOP_WATCHING_TOOL_NAME, Bt as getFilePermalink, C as WorkspaceValidationError, D as setWorkspaceSnapshotBuild, Dt as matchSlackAttachments, E as setWorkspaceSnapshot, F as isSlackMessageTurn, Ft as defaultTimezone, G as createWatch, Gt as normalizeSlackConversationId, H as cancelWatch, Ht as getSlackClient, I as slackMessageTurnDisabledReason, It as resolveUserTimezone, J as getWatch, K as deliverWatch, L as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, M as workspaceRepoCheckoutPath, Mt as createPluginAnnotations, N as resolveChannelCapabilities, O as SANDBOX_RUNTIME, P as getSlackToolContext, R as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, Rt as SlackActionError, S as updateWorkspace, T as loadSnapshotsForProfile, Ut as isConversationScopedChannel, V as cancelSubscriptions, W as createTimerWatch, Wt as isDmChannel$1, Xt as JUNIOR_NATIVE_EVENT_NAMESPACE, Y as listWatches, _ as deleteWorkspace, at as getDashboardConversationLink, b as listWorkspaces, c as getPluginTools, en as conversationNoteEvent, ft as createPluginLogger, g as createWorkspace, j as tryWorkspaceRepoCheckoutPath, jt as saveObjectAnnotations, k as deleteWorkspaceSnapshotBuilders, l as getPluginUserPromptContributions, q as findMatchingWatches, qt as withSlackRetries, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as getDashboardTaskLink, u as getPlugins, v as getWorkspace, w as invalidateReadySnapshot, y as getWorkspaceByName, z as RESOURCE_WATCH_TOOL_SOURCE, zt as downloadPrivateSlackFile } from "./agent-hooks-
|
|
13
|
+
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as credentialContextForActor, f as credentialContextSchema, h as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, m as credentialUserSubjectId, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-C-jns0Be.js";
|
|
14
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-TG5WF66H.js";
|
|
15
|
+
import { a as parseSkillInvocation, i as parseSkillFile, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-D_XDFkSx.js";
|
|
16
|
+
import { B as postSlackEphemeralMessage, Bt as recordMcpProviderConnected, Ct as TURN_CONTEXT_TAG, Dt as loadConnectedMcpProviders, F as slackMention, Ft as recordAttachmentsDelivered, Ht as recordToolExecutionStarted, J as saveTurnCheckpoint, K as continuableMessages, L as addReactionToMessage, M as formatSlackLink, Mt as loadTurnRoute, Nt as openConversationProjection, Ot as loadConversationProjection, Pt as recordAgentsInstructionsUpdated, Qt as resolveTaskTitle, R as getSlackMessagePermalink, Rt as recordAuthorizationRequested, St as trimTrailingAssistantMessages, U as uploadFilesToConversation, Ut as recordTurnRoute, V as postSlackMessage, Zt as fallbackShortTitle, _t as isToolResultError, a as readScheduledAutomation, at as TurnToolCallLimitExceededError, b as saveEventAutomation, bt as retainRuntimeTurnContext, ct as isTurnExecutionLimitExceededError, dn as getAgentContextCompactionTriggerTokens, dt as getTerminalAssistantMessages, f as createEventAutomation, fn as getAgentContextInputLimitTokens, ft as getUserMessageInstructionText, g as getEventAutomation, gt as isContinuablePiBoundary, ht as isAssistantMessage, it as TurnSliceLimitExceededError, j as escapeSlackMrkdwnText, k as automationRevision, kt as loadLastModelProfile, lt as extractAssistantText, mn as piMessageFromHistoryItem, nt as TURN_LIMIT_DISABLED_REASON, o as saveScheduledAutomation, p as deleteEventAutomation, pn as historyItemFromPiMessage, pt as hasRuntimeTurnContext, q as loadTurnCheckpoint, r as listScheduledAutomationsForTeam, rt as TurnBudgetExceededError, st as createTurnLimitGate, t as createScheduledAutomation, un as estimateTextTokens, ut as getPiMessageRole, v as listEventAutomationsForTeam, vt as isToolResultMessage, wt as ToolInputError, x as setEventAutomationStatus, xt as stripRuntimeTurnContext, yt as normalizeToolNameFromResult, z as openSlackDirectMessage, zt as recordGuardianActionReviewed } from "./tasks-DO9VM9cu.js";
|
|
17
|
+
import { A as getWorkspaceSnapshotBuilder, B as STOP_WATCHING_TOOL_NAME, Bt as getFilePermalink, C as WorkspaceValidationError, D as setWorkspaceSnapshotBuild, Dt as matchSlackAttachments, E as setWorkspaceSnapshot, F as isSlackMessageTurn, Ft as defaultTimezone, G as createWatch, Gt as normalizeSlackConversationId, H as cancelWatch, Ht as getSlackClient, I as slackMessageTurnDisabledReason, It as resolveUserTimezone, J as getWatch, K as deliverWatch, L as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, M as workspaceRepoCheckoutPath, Mt as createPluginAnnotations, N as resolveChannelCapabilities, O as SANDBOX_RUNTIME, P as getSlackToolContext, R as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, Rt as SlackActionError, S as updateWorkspace, T as loadSnapshotsForProfile, Ut as isConversationScopedChannel, V as cancelSubscriptions, W as createTimerWatch, Wt as isDmChannel$1, Xt as JUNIOR_NATIVE_EVENT_NAMESPACE, Y as listWatches, _ as deleteWorkspace, at as getDashboardConversationLink, b as listWorkspaces, c as getPluginTools, en as conversationNoteEvent, ft as createPluginLogger, g as createWorkspace, j as tryWorkspaceRepoCheckoutPath, jt as saveObjectAnnotations, k as deleteWorkspaceSnapshotBuilders, l as getPluginUserPromptContributions, q as findMatchingWatches, qt as withSlackRetries, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as getDashboardTaskLink, u as getPlugins, v as getWorkspace, w as invalidateReadySnapshot, y as getWorkspaceByName, z as RESOURCE_WATCH_TOOL_SOURCE, zt as downloadPrivateSlackFile } from "./agent-hooks-DfPubHYm.js";
|
|
18
18
|
import { B as briefLinkSchema, H as conversationBriefSchema, J as removedCardSchema, L as detectImageMediaType, R as isVisionImageMediaType, V as briefOutcomeStatusSchema } from "./conversation-T18Xlkx9.js";
|
|
19
|
-
import { A as SANDBOX_DATA_ROOT, 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, 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-
|
|
20
|
-
import { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-
|
|
19
|
+
import { A as SANDBOX_DATA_ROOT, 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, 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-Dh73O6lZ.js";
|
|
20
|
+
import { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-m8aJlwP_.js";
|
|
21
21
|
import { c as isTurnInputCommitLostError, i as TurnInputCommitLostError, r as CooperativeTurnYieldError, t as authorizationId } from "./oauth-authorization-BA4Dt6a7.js";
|
|
22
|
-
import { a as isNoReplyMarker, i as NO_REPLY_MARKER, n as getAssistantReplyText, r as sanitizeAssistantText, t as decideReply } from "./assistant-reply-
|
|
23
|
-
import { C as registeredEventMatchSchema, D as requireSupportedEventMatch, E as requireEventIdentifier, I as readAutomationResult, L as remindMissingAutomationResult, M as FINISH_AUTOMATION_RUN_TOOL_NAME, N as automationResultSchema, S as pluginSupportsEvent, T as registeredResourceTypeSchema, _ as workspaceSnapshotWatch, b as eventNamespaceSchema, d as requireSlackChannelMessageScope, g as workspaceSnapshotFinishedEvent, h as WORKSPACE_SNAPSHOT_READY_EVENT, l as getEventCatalog, m as WORKSPACE_SNAPSHOT_FAILED_EVENT, n as markConversationsStopped, o as enqueueEventNotification, t as getConversationStoppedAtMs, v as automationEventCatalog, w as registeredEventTypeSchema, x as hasEventCatalogEntries } from "./session-stop-
|
|
22
|
+
import { a as isNoReplyMarker, i as NO_REPLY_MARKER, n as getAssistantReplyText, r as sanitizeAssistantText, t as decideReply } from "./assistant-reply-B3J6ogAM.js";
|
|
23
|
+
import { C as registeredEventMatchSchema, D as requireSupportedEventMatch, E as requireEventIdentifier, I as readAutomationResult, L as remindMissingAutomationResult, M as FINISH_AUTOMATION_RUN_TOOL_NAME, N as automationResultSchema, S as pluginSupportsEvent, T as registeredResourceTypeSchema, _ as workspaceSnapshotWatch, b as eventNamespaceSchema, d as requireSlackChannelMessageScope, g as workspaceSnapshotFinishedEvent, h as WORKSPACE_SNAPSHOT_READY_EVENT, l as getEventCatalog, m as WORKSPACE_SNAPSHOT_FAILED_EVENT, n as markConversationsStopped, o as enqueueEventNotification, t as getConversationStoppedAtMs, v as automationEventCatalog, w as registeredEventTypeSchema, x as hasEventCatalogEntries } from "./session-stop-DenN1GuJ.js";
|
|
24
24
|
import { i as isValidTimeZone, r as getZonedDateTimeParts } from "./cadence-D00SCzT1.js";
|
|
25
|
-
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-
|
|
26
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-
|
|
27
|
-
import { E as stopConversationWork } from "./store-
|
|
25
|
+
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-CDYCpS_U.js";
|
|
26
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-B6KaQXY6.js";
|
|
27
|
+
import { E as stopConversationWork } from "./store-CIs0Tr31.js";
|
|
28
28
|
import { F as taskOutcomeInputSchema, M as compileScheduleIntent, N as scheduleIntentSchema, O as automationInstructionToolSchema, T as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, j as ScheduleIntentError, k as automationTitleSchema } from "./automation-gznOMaQ2.js";
|
|
29
29
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
30
30
|
import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
|
|
@@ -10843,7 +10843,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
|
|
|
10843
10843
|
if (input.outcomes !== void 0 && !isCreator) throwToolInputError("Only the scheduled automation creator can change message destinations.");
|
|
10844
10844
|
const changingDestination = moveDestination && !alreadyHere;
|
|
10845
10845
|
if (changingDestination) {
|
|
10846
|
-
if ((await db.select({ id:
|
|
10846
|
+
if ((await db.select({ id: juniorAutomationRuns.id }).from(juniorAutomationRuns).where(and(eq(juniorAutomationRuns.automationId, lookup.id), inArray(juniorAutomationRuns.status, ["pending", "running"]))).limit(1)).length > 0) throwToolInputError("Scheduled automation cannot be moved while an occurrence is already running. Try again after the current run finishes.");
|
|
10847
10847
|
}
|
|
10848
10848
|
const nowMs = context.now?.() ?? Date.now();
|
|
10849
10849
|
const status = normalizeStatus(input.status);
|
|
@@ -20736,7 +20736,7 @@ function createAgentRunner(execute, options) {
|
|
|
20736
20736
|
} } : void 0
|
|
20737
20737
|
};
|
|
20738
20738
|
if (run.instruction.storedAttachments?.length) {
|
|
20739
|
-
const { loadInputImages } = await import("./images-
|
|
20739
|
+
const { loadInputImages } = await import("./images-k8HewSp_.js").then((n) => n.n);
|
|
20740
20740
|
const storage = nextRun.environment?.attachmentStorage;
|
|
20741
20741
|
if (!storage) throw new Error("Attachment storage is unavailable.");
|
|
20742
20742
|
nextRun.instruction = {
|
package/dist/api/schema.js
CHANGED
|
@@ -2,5 +2,5 @@ import { a as conversationTurnFailureReasonSchema, i as conversationTurnFailureC
|
|
|
2
2
|
import { A as forkConversationBodySchema, C as conversationReportEventSchema, E as conversationSummaryReportSchema, I as INPUT_IMAGE_TYPES, K as messageCardText, M as conversationChildAgentTotalsSchema, N as MAX_INPUT_IMAGES, O as createConversationBodySchema, P as MAX_INPUT_IMAGE_BYTES, S as conversationReportEventDataSchema, T as conversationStatsReportSchema, Y as resolveMessageCards, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, b as conversationPendingMessageSchema, d as conversationDetailReportSchema, f as conversationEventHistorySchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as forkConversationResponseSchema, k as createConversationMessageBodySchema, l as conversationAuxiliaryCostsSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, s as conversationActivityPreviewSchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, v as conversationPendingAuthorizationSchema, x as conversationPendingMessagesReportSchema, y as conversationPendingMessageDeliverySchema } from "../conversation-T18Xlkx9.js";
|
|
3
3
|
import { C as eventAutomationSummarySchema, S as automationVersionSchema, _ as automationSummarySchema, a as automationExecutionSchema, b as automationVersionListSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, l as automationListQuerySchema, m as automationRunWindowsSchema, n as automationEditSchema, o as automationExecutionStatusDaySchema, p as automationRunSchema, r as automationEventCatalogSchema, s as automationExecutionStatusSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, w as scheduledAutomationSummarySchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "../automation-gznOMaQ2.js";
|
|
4
4
|
import { C as skillReportsSchema, S as skillReportSchema, _ as pluginPackageContentItemReportSchema, b as pluginsSchema, g as pluginOperationalReportSchema, h as pluginOperationalReportFeedSchema, m as healthReportSchema, t as webMessageId, v as pluginPackageContentReportSchema, x as runtimeInfoReportSchema, y as pluginSchema } from "../web-message-id-xPI_EFSC.js";
|
|
5
|
-
import { A as connectionSchema, B as codeRepositorySummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeChangeSummarySchema, H as conversationChildAgentsReportSchema, I as codeOverviewReportSchema, L as codePersonReportSchema, M as startConnectionResponseSchema, N as codeActivityDaySchema, O as connectionListSchema, P as codeChangeSummaryReportSchema, R as codeRepositoryParamsSchema, S as locationDirectoryReportSchema, U as stopConversationTurnResponseSchema, V as conversationChildAgentSchema, W as apiErrorSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as disconnectConnectionResponseSchema, k as connectionParamsSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema, z as codeRepositoryReportSchema } from "../schema-
|
|
5
|
+
import { A as connectionSchema, B as codeRepositorySummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeChangeSummarySchema, H as conversationChildAgentsReportSchema, I as codeOverviewReportSchema, L as codePersonReportSchema, M as startConnectionResponseSchema, N as codeActivityDaySchema, O as connectionListSchema, P as codeChangeSummaryReportSchema, R as codeRepositoryParamsSchema, S as locationDirectoryReportSchema, U as stopConversationTurnResponseSchema, V as conversationChildAgentSchema, W as apiErrorSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as disconnectConnectionResponseSchema, k as connectionParamsSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema, z as codeRepositoryReportSchema } from "../schema-C-a9U34c.js";
|
|
6
6
|
export { INPUT_IMAGE_TYPES, MAX_INPUT_IMAGES, MAX_INPUT_IMAGE_BYTES, acceptedConversationMessageSchema, actorDirectoryReportSchema, actorProfileReportSchema, apiErrorSchema, archiveConversationBodySchema, archiveConversationResponseSchema, automationEditErrorSchema, automationEditSchema, automationEventCatalogSchema, automationExecutionListSchema, automationExecutionSchema, automationExecutionStatusDaySchema, automationExecutionStatusSchema, automationListQuerySchema, automationListSchema, automationParamsSchema, automationRunListSchema, automationRunSchema, automationRunWindowsSchema, automationScheduleIntentSchema, automationSchedulePreviewSchema, automationSummarySchema, automationUpdateSchema, automationVersionActivateSchema, automationVersionListSchema, automationVersionParamsSchema, automationVersionSchema, baselineSnapshotSchema, cancelConversationPendingMessagesBodySchema, cancelConversationPendingMessagesResponseSchema, codeActivityDaySchema, codeChangeSummaryReportSchema, codeChangeSummarySchema, codeOverviewReportSchema, codePersonReportSchema, codeRepositoryParamsSchema, codeRepositoryReportSchema, codeRepositorySummarySchema, connectionListSchema, connectionParamsSchema, connectionSchema, conversationActivityPreviewSchema, conversationAuxiliaryCostsSchema, conversationChildAgentSchema, conversationChildAgentTotalsSchema, conversationChildAgentsReportSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventHistorySchema, conversationEventPageSchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingAuthorizationSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, conversationTurnFailureCodeSchema, conversationTurnFailureReasonSchema, createConversationBodySchema, createConversationMessageBodySchema, createPersonalTokenBodySchema, createdPersonalTokenSchema, dailyConversationActivitySchema, deleteWorkspaceResponseSchema, disconnectConnectionResponseSchema, eventAutomationSummarySchema, forkConversationBodySchema, forkConversationResponseSchema, healthReportSchema, locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, locationParamsSchema, messageCardText, personParamsSchema, personalSpendReportSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginSchema, pluginsSchema, resolveMessageCards, revokePersonalTokenResponseSchema, runtimeInfoReportSchema, scheduledAutomationSummarySchema, skillReportSchema, skillReportsSchema, startConnectionResponseSchema, statSchema, statsReportSchema, stopConversationTurnResponseSchema, webMessageId, workspaceBodySchema, workspaceListSchema, workspaceParamsSchema, workspaceRepoSchema, workspaceSchema };
|
package/dist/api.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { K as listChildAgents, L as editEventAutomation, Lt as createUserTokenStore, O as parseSlackThreadId, P as editScheduledAutomation, R as AutomationEditError, T as readLiveAttachment, V as resolveTaskOutcomes, bt as conversationSubtreeColumns, g as readStats, ot as getChildAgentLabel, yt as conversationSubtree, z as eventAutomationTriggerAvailable } from "./agent-runner-
|
|
2
|
-
import { d as logException, f as logInfo, p as logWarn } from "./logging-
|
|
1
|
+
import { K as listChildAgents, L as editEventAutomation, Lt as createUserTokenStore, O as parseSlackThreadId, P as editScheduledAutomation, R as AutomationEditError, T as readLiveAttachment, V as resolveTaskOutcomes, bt as conversationSubtreeColumns, g as readStats, ot as getChildAgentLabel, yt as conversationSubtree, z as eventAutomationTriggerAvailable } from "./agent-runner-BWmnJ0dD.js";
|
|
2
|
+
import { d as logException, f as logInfo, p as logWarn } from "./logging-B3nJLXT7.js";
|
|
3
3
|
import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { E as resolveRootConversationId, T as hasAgentTurnUsage, _ as locationFromRow, b as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, w as agentTurnUsageSchema, x as addAgentTurnUsage } from "./viewer-
|
|
5
|
-
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-
|
|
6
|
-
import {
|
|
4
|
+
import { E as resolveRootConversationId, T as hasAgentTurnUsage, _ as locationFromRow, b as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, w as agentTurnUsageSchema, x as addAgentTurnUsage } from "./viewer-CGZiUVMU.js";
|
|
5
|
+
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
|
|
6
|
+
import { f as juniorConversationBriefs, g as juniorApiTokens, h as juniorConversationEvents, m as juniorConversationMetrics, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-B88oEqok.js";
|
|
7
7
|
import { d as contextProvenance } from "./history-9pO1Zd4Y.js";
|
|
8
|
-
import { A as requireAutomationRevision, D as sameDefinitionValue, E as readAutomationVersion, O as AutomationConflictError, a as readScheduledAutomation, b as saveEventAutomation, g as getEventAutomation, jt as loadTurnProjection, k as automationRevision, m as eventAutomationBelongsToUser, mn as piMessageFromHistoryItem, o as saveScheduledAutomation, w as automationDefinition, x as setEventAutomationStatus } from "./tasks-
|
|
9
|
-
import { C as WorkspaceValidationError, Ct as readLatestConversationBrief, Ht as getSlackClient, Lt as lookupSlackUser, M as workspaceRepoCheckoutPath, Nt as listConversationAnnotations, O as SANDBOX_RUNTIME, Pt as listConversationAnnotationsById, S as updateWorkspace, Tt as buildSentryConversationUrl, _ as deleteWorkspace, _t as conversationHasParticipantEmail, b as listWorkspaces, bt as conversationNotArchivedForUser, ft as createPluginLogger, g as createWorkspace, gt as conversationArchivedForUser, ht as conversationArchivedForEmail, mt as conversationArchiveTimes, pt as readConversationAccessFromSql, qt as withSlackRetries, u as getPlugins, v as getWorkspace, vt as conversationHasParticipantUser, wt as readConversationEventPage, x as listWorkspacesByRepository, xt as viewerConversationMembership, yt as conversationNotArchivedForEmail } from "./agent-hooks-
|
|
8
|
+
import { A as requireAutomationRevision, D as sameDefinitionValue, E as readAutomationVersion, O as AutomationConflictError, a as readScheduledAutomation, b as saveEventAutomation, g as getEventAutomation, jt as loadTurnProjection, k as automationRevision, m as eventAutomationBelongsToUser, mn as piMessageFromHistoryItem, o as saveScheduledAutomation, w as automationDefinition, x as setEventAutomationStatus } from "./tasks-DO9VM9cu.js";
|
|
9
|
+
import { C as WorkspaceValidationError, Ct as readLatestConversationBrief, Ht as getSlackClient, Lt as lookupSlackUser, M as workspaceRepoCheckoutPath, Nt as listConversationAnnotations, O as SANDBOX_RUNTIME, Pt as listConversationAnnotationsById, S as updateWorkspace, Tt as buildSentryConversationUrl, _ as deleteWorkspace, _t as conversationHasParticipantEmail, b as listWorkspaces, bt as conversationNotArchivedForUser, ft as createPluginLogger, g as createWorkspace, gt as conversationArchivedForUser, ht as conversationArchivedForEmail, mt as conversationArchiveTimes, pt as readConversationAccessFromSql, qt as withSlackRetries, u as getPlugins, v as getWorkspace, vt as conversationHasParticipantUser, wt as readConversationEventPage, x as listWorkspacesByRepository, xt as viewerConversationMembership, yt as conversationNotArchivedForEmail } from "./agent-hooks-DfPubHYm.js";
|
|
10
10
|
import { A as forkConversationBodySchema, F as readMessageAttachments, I as INPUT_IMAGE_TYPES, O as createConversationBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as forkConversationResponseSchema, k as createConversationMessageBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-T18Xlkx9.js";
|
|
11
|
-
import { n as hash, t as create } from "./profile-
|
|
12
|
-
import { l as getEventCatalog, v as automationEventCatalog } from "./session-stop-
|
|
11
|
+
import { n as hash, t as create } from "./profile-Dh73O6lZ.js";
|
|
12
|
+
import { l as getEventCatalog, v as automationEventCatalog } from "./session-stop-DenN1GuJ.js";
|
|
13
13
|
import { t as getFirstRunAtMs } from "./cadence-D00SCzT1.js";
|
|
14
|
-
import { t as getCachedSnapshot } from "./resolve-
|
|
15
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
16
|
-
import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-
|
|
14
|
+
import { t as getCachedSnapshot } from "./resolve-CDYCpS_U.js";
|
|
15
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-B6KaQXY6.js";
|
|
16
|
+
import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-CIs0Tr31.js";
|
|
17
17
|
import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-gznOMaQ2.js";
|
|
18
18
|
import { C as skillReportsSchema, a as fillUtcHours, b as pluginsSchema, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, h as pluginOperationalReportFeedSchema, i as fillUtcDays, l as trailingUtcDayWindow, m as healthReportSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, x as runtimeInfoReportSchema } from "./web-message-id-xPI_EFSC.js";
|
|
19
|
-
import { B as readHealthReport, I as createVercelAttachmentStorage, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, j as stopConversationTurn, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input-
|
|
20
|
-
import {
|
|
21
|
-
import { d as legacyWebMailboxMetadataSchema } from "./result-
|
|
22
|
-
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection } from "./connections-
|
|
23
|
-
import { t as decodeInputImages } from "./images-
|
|
24
|
-
import { C as locationParamsSchema, E as activitySixHours$1, H as conversationChildAgentsReportSchema, I as codeOverviewReportSchema, L as codePersonReportSchema, M as startConnectionResponseSchema, O as connectionListSchema, R as codeRepositoryParamsSchema, S as locationDirectoryReportSchema, T as activityHours$1, U as stopConversationTurnResponseSchema, W as apiErrorSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as disconnectConnectionResponseSchema, k as connectionParamsSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema, z as codeRepositoryReportSchema } from "./schema-
|
|
19
|
+
import { B as readHealthReport, I as createVercelAttachmentStorage, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, j as stopConversationTurn, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input-Dpqh0oBt.js";
|
|
20
|
+
import { F as conversationRangeColumns, N as conversationActiveDaysColumn, P as conversationAggregateColumns, j as readAutomationTitlesByConversationId } from "./task-runner-BE6Jgt2u.js";
|
|
21
|
+
import { d as legacyWebMailboxMetadataSchema } from "./result-sih-x_yN.js";
|
|
22
|
+
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection } from "./connections-BZAuDnYm.js";
|
|
23
|
+
import { t as decodeInputImages } from "./images-k8HewSp_.js";
|
|
24
|
+
import { C as locationParamsSchema, E as activitySixHours$1, H as conversationChildAgentsReportSchema, I as codeOverviewReportSchema, L as codePersonReportSchema, M as startConnectionResponseSchema, O as connectionListSchema, R as codeRepositoryParamsSchema, S as locationDirectoryReportSchema, T as activityHours$1, U as stopConversationTurnResponseSchema, W as apiErrorSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as disconnectConnectionResponseSchema, k as connectionParamsSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema, z as codeRepositoryReportSchema } from "./schema-C-a9U34c.js";
|
|
25
25
|
import { Hono } from "hono";
|
|
26
26
|
import path from "node:path";
|
|
27
27
|
import { z } from "zod";
|
|
@@ -3592,7 +3592,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3592
3592
|
reports: [],
|
|
3593
3593
|
source: "plugins"
|
|
3594
3594
|
});
|
|
3595
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
3595
|
+
const { getPluginProfileReports } = await import("./agent-hooks-DfPubHYm.js").then((n) => n.t);
|
|
3596
3596
|
return pluginOperationalReportFeedSchema.parse({
|
|
3597
3597
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3598
3598
|
reports: await getPluginProfileReports({
|
|
@@ -4565,7 +4565,7 @@ function readDescriptionText(home) {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
4567
4567
|
async function readSkillReports() {
|
|
4568
|
-
const { discoverSkills } = await import("./skills-
|
|
4568
|
+
const { discoverSkills } = await import("./skills-D_XDFkSx.js").then((n) => n.o);
|
|
4569
4569
|
const skills = await discoverSkills();
|
|
4570
4570
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
4571
4571
|
name: skill.name,
|
|
@@ -4574,7 +4574,7 @@ async function readSkillReports() {
|
|
|
4574
4574
|
}
|
|
4575
4575
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
4576
4576
|
async function readPlugins() {
|
|
4577
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4577
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-TG5WF66H.js").then((n) => n.t);
|
|
4578
4578
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4579
4579
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
4580
4580
|
description: plugin.manifest.description,
|
|
@@ -4586,7 +4586,7 @@ async function readPlugins() {
|
|
|
4586
4586
|
async function readRuntimeInfoReport() {
|
|
4587
4587
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4588
4588
|
import("./package-discovery-BVvSnQBB.js").then((n) => n.r),
|
|
4589
|
-
import("./catalog-runtime-
|
|
4589
|
+
import("./catalog-runtime-TG5WF66H.js").then((n) => n.t),
|
|
4590
4590
|
readPlugins(),
|
|
4591
4591
|
readSkillReports()
|
|
4592
4592
|
]);
|
|
@@ -4603,7 +4603,7 @@ async function readRuntimeInfoReport() {
|
|
|
4603
4603
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
4604
4604
|
async function readPluginOperationalReportFeed() {
|
|
4605
4605
|
const nowMs = Date.now();
|
|
4606
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4606
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-DfPubHYm.js").then((n) => n.t);
|
|
4607
4607
|
return pluginOperationalReportFeedSchema.parse({
|
|
4608
4608
|
source: "plugins",
|
|
4609
4609
|
generatedAt: new Date(nowMs).toISOString(),
|
package/dist/app.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { At as consumeSandboxEgressPermissionDeniedSignal, B as effectiveTaskOutcomes, Ct as ingestEvent, Dt as SANDBOX_EGRESS_PROXY_PATH, E as requestAttachmentDeletion, Et as shouldPropagateSandboxEgressTrace, F as logScheduledAutomationRunSkipped, I as scheduledAutomationRunAttributes, It as startOAuthFlow, Kt as getConfigDefaults, Lt as createUserTokenStore, Nt as formatProviderLabel, O as parseSlackThreadId, Ot as clearSandboxEgressSignals, St as processWorkspaceSnapshotJob, Tt as normalizeSandboxEgressTracePropagationDomains, U as stopConversationSession, W as recordSubagentEnded, b as unpublishedArtifactHeaders, i as executeCredentialedEgressRequest, jt as parseSandboxEgressCredentialToken, kt as consumeSandboxEgressAuthRequiredSignal, lt as listPendingAgentInvocationMailboxAppends, n as executeAgentRun, qt as setConfigDefaults, t as createAgentRunner, ut as listPendingAgentInvocationResults, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as resolveSandboxEgressProviderForHost, x as lookupSlackUserProfile, y as readPublicArtifact } from "./agent-runner-
|
|
2
|
-
import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-
|
|
1
|
+
import { At as consumeSandboxEgressPermissionDeniedSignal, B as effectiveTaskOutcomes, Ct as ingestEvent, Dt as SANDBOX_EGRESS_PROXY_PATH, E as requestAttachmentDeletion, Et as shouldPropagateSandboxEgressTrace, F as logScheduledAutomationRunSkipped, I as scheduledAutomationRunAttributes, It as startOAuthFlow, Kt as getConfigDefaults, Lt as createUserTokenStore, Nt as formatProviderLabel, O as parseSlackThreadId, Ot as clearSandboxEgressSignals, St as processWorkspaceSnapshotJob, Tt as normalizeSandboxEgressTracePropagationDomains, U as stopConversationSession, W as recordSubagentEnded, b as unpublishedArtifactHeaders, i as executeCredentialedEgressRequest, jt as parseSandboxEgressCredentialToken, kt as consumeSandboxEgressAuthRequiredSignal, lt as listPendingAgentInvocationMailboxAppends, n as executeAgentRun, qt as setConfigDefaults, t as createAgentRunner, ut as listPendingAgentInvocationResults, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as resolveSandboxEgressProviderForHost, x as lookupSlackUserProfile, y as readPublicArtifact } from "./agent-runner-BWmnJ0dD.js";
|
|
2
|
+
import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-B3nJLXT7.js";
|
|
3
3
|
import { n as captureMessage, r as continueTrace } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
-
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-
|
|
4
|
+
import { t as JUNIOR_VERSION } from "./version-DcWD8xpq.js";
|
|
5
|
+
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-CRlLncIj.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-BTtLaeWy.js";
|
|
7
|
-
import { c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
8
|
-
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-
|
|
9
|
-
import {
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import { C as eventAutomationRunLimitReason, F as slackMention, G as slackExternalRefIdSchema, S as admitEventAutomationRun, W as slackEntitySchema, Wt as appendConversationMessages, Xt as settleConversationTitleWork, a as readScheduledAutomation, c as scheduledRunId, d as collectEventAutomationMatchKeys, h as findMatchingEventAutomations, l as withScheduledAutomationLock, n as listScheduledAutomations, qt as projectConversationMessages, r as listScheduledAutomationsForTeam, s as saveScheduledAutomationInLock, u as blockEventAutomation } from "./tasks-
|
|
12
|
-
import { $ as bindSlackDirectCredentialSubject, At as resolveRootVisibility, Ht as getSlackClient, Jt as getWorkspaceTeamId, Nt as listConversationAnnotations, Q as bindScheduledAutomationCredentialSubject, U as collectEventMatchKeys, Wt as isDmChannel, X as takeDueTimerWatches, Yt as runWithWorkspaceTeamId, Z as bindEventAutomationCredentialSubject, a as getPluginRoutes, at as getDashboardConversationLink, ct as setDashboardConversationLinkOptions, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, ft as createPluginLogger, h as setBriefsConfig, i as getPluginApiRoutes, lt as createPluginState, nt as verifySlackDirectCredentialSubject, pt as readConversationAccessFromSql, q as findMatchingWatches, st as getDashboardTaskLink, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins } from "./agent-hooks-
|
|
7
|
+
import { c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-CGZiUVMU.js";
|
|
8
|
+
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
|
|
9
|
+
import { f as juniorConversationBriefs, h as juniorConversationEvents, o as juniorAutomationRuns, s as juniorAutomations } from "./executor-B88oEqok.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-TG5WF66H.js";
|
|
11
|
+
import { C as eventAutomationRunLimitReason, F as slackMention, G as slackExternalRefIdSchema, S as admitEventAutomationRun, W as slackEntitySchema, Wt as appendConversationMessages, Xt as settleConversationTitleWork, a as readScheduledAutomation, c as scheduledRunId, d as collectEventAutomationMatchKeys, h as findMatchingEventAutomations, l as withScheduledAutomationLock, n as listScheduledAutomations, qt as projectConversationMessages, r as listScheduledAutomationsForTeam, s as saveScheduledAutomationInLock, u as blockEventAutomation } from "./tasks-DO9VM9cu.js";
|
|
12
|
+
import { $ as bindSlackDirectCredentialSubject, At as resolveRootVisibility, Ht as getSlackClient, Jt as getWorkspaceTeamId, Nt as listConversationAnnotations, Q as bindScheduledAutomationCredentialSubject, U as collectEventMatchKeys, Wt as isDmChannel, X as takeDueTimerWatches, Yt as runWithWorkspaceTeamId, Z as bindEventAutomationCredentialSubject, a as getPluginRoutes, at as getDashboardConversationLink, ct as setDashboardConversationLinkOptions, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, ft as createPluginLogger, h as setBriefsConfig, i as getPluginApiRoutes, lt as createPluginState, nt as verifySlackDirectCredentialSubject, pt as readConversationAccessFromSql, q as findMatchingWatches, st as getDashboardTaskLink, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins } from "./agent-hooks-DfPubHYm.js";
|
|
13
13
|
import { W as annotationCard } from "./conversation-T18Xlkx9.js";
|
|
14
|
-
import { O as withLock$1, w as getStateAdapter } from "./profile-
|
|
15
|
-
import { c as getThreadStopDecision } from "./pending-auth-
|
|
16
|
-
import { O as renderTaskInput, f as slackChannelMessageEvent, l as getEventCatalog, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE, y as eventGuidance } from "./session-stop-
|
|
14
|
+
import { O as withLock$1, w as getStateAdapter } from "./profile-Dh73O6lZ.js";
|
|
15
|
+
import { c as getThreadStopDecision } from "./pending-auth-m8aJlwP_.js";
|
|
16
|
+
import { O as renderTaskInput, f as slackChannelMessageEvent, l as getEventCatalog, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE, y as eventGuidance } from "./session-stop-DenN1GuJ.js";
|
|
17
17
|
import { n as getNextRunAtMs } from "./cadence-D00SCzT1.js";
|
|
18
|
-
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-
|
|
19
|
-
import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
20
|
-
import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-
|
|
18
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-CDYCpS_U.js";
|
|
19
|
+
import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-B6KaQXY6.js";
|
|
20
|
+
import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-CIs0Tr31.js";
|
|
21
21
|
import { D as scheduledRunSchema } from "./automation-gznOMaQ2.js";
|
|
22
22
|
import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
23
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
23
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-MW8dmhF9.js";
|
|
24
24
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
25
|
-
import { A as withNormalizedThreadId, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as stopSlackThread, P as parseContent, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as runWithSlackInstallation, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as stopConversationTurn, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-
|
|
26
|
-
import { a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection,
|
|
27
|
-
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-
|
|
28
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
29
|
-
import { s as coerceThreadConversationState } from "./thread-state-
|
|
30
|
-
import { o as unlinkProvider } from "./connections-
|
|
31
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
32
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
33
|
-
import { t as processConversationWork } from "./worker-
|
|
34
|
-
import { t as bindMessageAgent } from "./message-
|
|
35
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
25
|
+
import { A as withNormalizedThreadId, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as stopSlackThread, P as parseContent, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as runWithSlackInstallation, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as stopConversationTurn, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-Dpqh0oBt.js";
|
|
26
|
+
import { M as recordAutomationExecution, S as existingConversationId, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, m as listPendingDispatchMailboxAppends, o as createOrGetDispatch, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed } from "./task-runner-BE6Jgt2u.js";
|
|
27
|
+
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-sih-x_yN.js";
|
|
28
|
+
import { r as enqueueAgentInvocation } from "./work-DbA9xNO1.js";
|
|
29
|
+
import { s as coerceThreadConversationState } from "./thread-state-FreaCOZD.js";
|
|
30
|
+
import { o as unlinkProvider } from "./connections-BZAuDnYm.js";
|
|
31
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-9HiSpphh.js";
|
|
32
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-DAY-aQLX.js";
|
|
33
|
+
import { t as processConversationWork } from "./worker-DuCs9-3G.js";
|
|
34
|
+
import { t as bindMessageAgent } from "./message-C9Wx3Rxx.js";
|
|
35
|
+
import { t as bindSpawnAgent } from "./spawn-CcWYt3Tl.js";
|
|
36
36
|
import { createRequire } from "node:module";
|
|
37
37
|
import { Hono } from "hono";
|
|
38
38
|
import { z } from "zod";
|
|
@@ -343,6 +343,44 @@ async function getScheduledAutomationDispatch(id) {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
|
+
//#region src/chat/event-automations/runs.ts
|
|
347
|
+
/**
|
|
348
|
+
* Record a dispatched event automation run and link its Conversation when it
|
|
349
|
+
* exists. The dispatch can finish before this write, so a stored run, or a
|
|
350
|
+
* retry of the same Event, keeps the row it has.
|
|
351
|
+
*/
|
|
352
|
+
async function recordEventAutomationRunStarted(db, args) {
|
|
353
|
+
await db.insert(juniorAutomationRuns).values({
|
|
354
|
+
id: args.dispatchId,
|
|
355
|
+
automationId: args.automationId,
|
|
356
|
+
conversationId: existingConversationId(getDispatchConversationId({ id: args.dispatchId })),
|
|
357
|
+
startedAtMs: args.nowMs,
|
|
358
|
+
status: "running"
|
|
359
|
+
}).onConflictDoNothing({ target: juniorAutomationRuns.id });
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Settle running event automation runs whose dispatch has ended. A run whose
|
|
363
|
+
* dispatch record is gone fails.
|
|
364
|
+
*/
|
|
365
|
+
async function settleEventAutomationRuns(db, nowMs) {
|
|
366
|
+
const runs = await db.select({
|
|
367
|
+
automationId: juniorAutomationRuns.automationId,
|
|
368
|
+
id: juniorAutomationRuns.id
|
|
369
|
+
}).from(juniorAutomationRuns).innerJoin(juniorAutomations, eq(juniorAutomations.id, juniorAutomationRuns.automationId)).where(and(eq(juniorAutomations.kind, "event"), eq(juniorAutomationRuns.status, "running")));
|
|
370
|
+
for (const run of runs) {
|
|
371
|
+
const dispatch = await getDispatchRecord(run.id);
|
|
372
|
+
const status = dispatch?.status ?? "failed";
|
|
373
|
+
if (status !== "blocked" && status !== "completed" && status !== "failed") continue;
|
|
374
|
+
await recordAutomationExecution(run.automationId, {
|
|
375
|
+
conversationId: getDispatchConversationId({ id: run.id }),
|
|
376
|
+
errorMessage: dispatch ? dispatch.errorMessage : "Event automation dispatch record is missing.",
|
|
377
|
+
executionId: run.id,
|
|
378
|
+
nowMs: dispatch?.updatedAtMs ?? nowMs,
|
|
379
|
+
status
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
//#endregion
|
|
346
384
|
//#region src/chat/automations/reply-attribution.ts
|
|
347
385
|
/** Name the Automation in the footer of the replies that its runs post. */
|
|
348
386
|
function automationReplyAttribution(title) {
|
|
@@ -357,45 +395,56 @@ function automationReplyAttribution(title) {
|
|
|
357
395
|
const PENDING_CLAIM_STALE_MS = 6e4;
|
|
358
396
|
const MISSED_RUN_MAX_AGE_MS = 864e5;
|
|
359
397
|
const INCOMPLETE_RUN_STATUSES = ["pending", "running"];
|
|
360
|
-
|
|
361
|
-
idempotencyKey: z.string().optional(),
|
|
362
|
-
taskVersion: z.number().optional()
|
|
363
|
-
}).strict();
|
|
364
|
-
/** Decode a scheduler run row and remove retained legacy fields. */
|
|
398
|
+
/** Decode a Scheduled automation run row. Returns undefined for an invalid row. */
|
|
365
399
|
function parseScheduledRunRow(row) {
|
|
366
|
-
const parsed =
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
400
|
+
const parsed = scheduledRunSchema.safeParse({
|
|
401
|
+
id: row.id,
|
|
402
|
+
attempt: row.attempt,
|
|
403
|
+
claimedAtMs: row.claimedAtMs,
|
|
404
|
+
completedAtMs: row.completedAtMs ?? void 0,
|
|
405
|
+
dispatchId: row.dispatchId ?? void 0,
|
|
406
|
+
errorMessage: row.errorMessage ?? void 0,
|
|
407
|
+
resultMessageTs: row.resultMessageTs ?? void 0,
|
|
408
|
+
scheduledForMs: row.scheduledForMs,
|
|
409
|
+
startedAtMs: row.startedAtMs ?? void 0,
|
|
410
|
+
status: row.status,
|
|
411
|
+
taskId: row.automationId
|
|
412
|
+
});
|
|
413
|
+
return parsed.success ? parsed.data : void 0;
|
|
370
414
|
}
|
|
371
415
|
function present(value) {
|
|
372
416
|
return value !== void 0;
|
|
373
417
|
}
|
|
374
418
|
async function readRun(db, runId) {
|
|
375
|
-
const rows = await db.select(
|
|
419
|
+
const rows = await db.select().from(juniorAutomationRuns).where(eq(juniorAutomationRuns.id, runId)).limit(1);
|
|
376
420
|
return rows[0] ? parseScheduledRunRow(rows[0]) : void 0;
|
|
377
421
|
}
|
|
378
422
|
async function writeRun(db, run) {
|
|
379
423
|
const stored = scheduledRunSchema.parse(run);
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
424
|
+
const columns = {
|
|
425
|
+
attempt: stored.attempt,
|
|
426
|
+
automationId: stored.taskId,
|
|
427
|
+
claimedAtMs: stored.claimedAtMs,
|
|
428
|
+
completedAtMs: stored.completedAtMs ?? null,
|
|
429
|
+
conversationId: stored.dispatchId ? existingConversationId(getDispatchConversationId({ id: stored.dispatchId })) : null,
|
|
430
|
+
dispatchId: stored.dispatchId ?? null,
|
|
431
|
+
errorMessage: stored.errorMessage ?? null,
|
|
432
|
+
resultMessageTs: stored.resultMessageTs ?? null,
|
|
383
433
|
scheduledForMs: stored.scheduledForMs,
|
|
384
|
-
|
|
385
|
-
|
|
434
|
+
startedAtMs: stored.startedAtMs ?? null,
|
|
435
|
+
status: stored.status
|
|
436
|
+
};
|
|
437
|
+
await db.insert(juniorAutomationRuns).values({
|
|
438
|
+
id: stored.id,
|
|
439
|
+
...columns
|
|
386
440
|
}).onConflictDoUpdate({
|
|
387
|
-
target:
|
|
388
|
-
set:
|
|
389
|
-
record: sql`excluded.record`,
|
|
390
|
-
scheduledForMs: sql`excluded.scheduled_for_ms`,
|
|
391
|
-
status: sql`excluded.status`,
|
|
392
|
-
taskId: sql`excluded.task_id`
|
|
393
|
-
}
|
|
441
|
+
target: juniorAutomationRuns.id,
|
|
442
|
+
set: columns
|
|
394
443
|
});
|
|
395
444
|
}
|
|
396
445
|
async function listIncompleteRunsForTaskIds(db, taskIds) {
|
|
397
446
|
if (taskIds.length === 0) return [];
|
|
398
|
-
return (await db.select(
|
|
447
|
+
return (await db.select().from(juniorAutomationRuns).where(and(inArray(juniorAutomationRuns.automationId, taskIds), inArray(juniorAutomationRuns.status, [...INCOMPLETE_RUN_STATUSES]))).orderBy(asc(juniorAutomationRuns.scheduledForMs), asc(juniorAutomationRuns.id))).map(parseScheduledRunRow).filter(present);
|
|
399
448
|
}
|
|
400
449
|
/** List incomplete runs for retained scheduled automations. */
|
|
401
450
|
async function listIncompleteScheduledRuns(db) {
|
|
@@ -695,15 +744,6 @@ function shouldSkipRun(task, run) {
|
|
|
695
744
|
if (task.status !== "active") return `Scheduled automation ${task.id} was ${task.status} before the run started.`;
|
|
696
745
|
if (task.nextRunAtMs !== run.scheduledForMs && task.runNowAtMs !== run.scheduledForMs) return `Scheduled automation ${task.id} no longer targets ${new Date(run.scheduledForMs).toISOString()}.`;
|
|
697
746
|
}
|
|
698
|
-
async function recordScheduledExecution(args) {
|
|
699
|
-
const dispatchId = args.run.dispatchId;
|
|
700
|
-
await recordAutomationExecution("scheduled", args.run.taskId, {
|
|
701
|
-
...dispatchId ? { conversationId: getDispatchConversationId({ id: dispatchId }) } : void 0,
|
|
702
|
-
executionId: args.run.id,
|
|
703
|
-
nowMs: args.nowMs,
|
|
704
|
-
status: args.status
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
747
|
async function logRunOutcome(args) {
|
|
708
748
|
const task = args.task ?? await readScheduledAutomation(args.db, args.run.taskId);
|
|
709
749
|
if (!task) {
|
|
@@ -735,11 +775,6 @@ async function applyDispatchResult(args) {
|
|
|
735
775
|
run: args.run,
|
|
736
776
|
status: "completed"
|
|
737
777
|
});
|
|
738
|
-
await recordScheduledExecution({
|
|
739
|
-
nowMs: args.nowMs,
|
|
740
|
-
run: args.run,
|
|
741
|
-
status: "completed"
|
|
742
|
-
});
|
|
743
778
|
await logRunOutcome({
|
|
744
779
|
eventName: "scheduled_automation.run.completed",
|
|
745
780
|
run: completed,
|
|
@@ -766,11 +801,6 @@ async function applyDispatchResult(args) {
|
|
|
766
801
|
kind: "scheduled",
|
|
767
802
|
reason: blocked.errorMessage ?? "Dispatch blocked."
|
|
768
803
|
});
|
|
769
|
-
await recordScheduledExecution({
|
|
770
|
-
nowMs: args.nowMs,
|
|
771
|
-
run: args.run,
|
|
772
|
-
status: "blocked"
|
|
773
|
-
});
|
|
774
804
|
await logRunOutcome({
|
|
775
805
|
eventName: "scheduled_automation.run.blocked",
|
|
776
806
|
run: blocked,
|
|
@@ -793,11 +823,6 @@ async function applyDispatchResult(args) {
|
|
|
793
823
|
run: args.run,
|
|
794
824
|
status: "failed"
|
|
795
825
|
});
|
|
796
|
-
await recordScheduledExecution({
|
|
797
|
-
nowMs: args.nowMs,
|
|
798
|
-
run: args.run,
|
|
799
|
-
status: "failed"
|
|
800
|
-
});
|
|
801
826
|
await logRunOutcome({
|
|
802
827
|
eventName: "scheduled_automation.run.failed",
|
|
803
828
|
run: failed,
|
|
@@ -830,11 +855,6 @@ async function finishClaimedRun(args) {
|
|
|
830
855
|
kind: "scheduled",
|
|
831
856
|
reason: args.errorMessage
|
|
832
857
|
});
|
|
833
|
-
await recordScheduledExecution({
|
|
834
|
-
nowMs: args.nowMs,
|
|
835
|
-
run: args.run,
|
|
836
|
-
status: args.status
|
|
837
|
-
});
|
|
838
858
|
await logRunOutcome({
|
|
839
859
|
eventName: args.status === "blocked" ? "scheduled_automation.run.blocked" : "scheduled_automation.run.failed",
|
|
840
860
|
run: finished,
|
|
@@ -842,9 +862,13 @@ async function finishClaimedRun(args) {
|
|
|
842
862
|
extras: { "app.task.run.error": args.errorMessage }
|
|
843
863
|
});
|
|
844
864
|
}
|
|
845
|
-
/**
|
|
865
|
+
/**
|
|
866
|
+
* Settle finished runs of both Automation kinds, then enqueue a bounded batch
|
|
867
|
+
* of due Scheduled automations.
|
|
868
|
+
*/
|
|
846
869
|
async function runScheduledAutomationHeartbeat(args) {
|
|
847
870
|
const db = getDb();
|
|
871
|
+
await settleEventAutomationRuns(db, args.nowMs);
|
|
848
872
|
let processedCount = 0;
|
|
849
873
|
let dispatchCount = 0;
|
|
850
874
|
for (const run of await listIncompleteScheduledRuns(db)) {
|
|
@@ -2069,7 +2093,7 @@ async function ingestEventAutomations(input, options) {
|
|
|
2069
2093
|
allowedWhen: "event-automation",
|
|
2070
2094
|
taskId: task.id
|
|
2071
2095
|
} : void 0;
|
|
2072
|
-
|
|
2096
|
+
const dispatch = await dispatchEventAutomation({
|
|
2073
2097
|
conversationWorkQueue: options.queue,
|
|
2074
2098
|
nowMs,
|
|
2075
2099
|
options: {
|
|
@@ -2082,7 +2106,13 @@ async function ingestEventAutomations(input, options) {
|
|
|
2082
2106
|
replyAttribution: automationReplyAttribution(task.title),
|
|
2083
2107
|
outcomes
|
|
2084
2108
|
}
|
|
2085
|
-
})
|
|
2109
|
+
});
|
|
2110
|
+
await recordEventAutomationRunStarted(db, {
|
|
2111
|
+
automationId: task.id,
|
|
2112
|
+
dispatchId: dispatch.id,
|
|
2113
|
+
nowMs
|
|
2114
|
+
});
|
|
2115
|
+
if (dispatch.status === "created") dispatched += 1;
|
|
2086
2116
|
} catch (error) {
|
|
2087
2117
|
errors.push(error);
|
|
2088
2118
|
}
|