@sentry/junior 0.220.0 → 0.221.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.
Files changed (52) hide show
  1. package/dist/{agent-CJ_-GRPT.js → agent-CFrfUdN5.js} +63 -69
  2. package/dist/{agent-hooks-DsFlR7gi.js → agent-hooks-kjLDY-Aa.js} +6 -6
  3. package/dist/{agent-runner-D82gVT0O.js → agent-runner-DMMa36Zl.js} +5 -5
  4. package/dist/api.js +15 -15
  5. package/dist/app.js +31 -31
  6. package/dist/{auth-pause-state-DL5YJXnT.js → auth-pause-state-TdhAyYM4.js} +6 -6
  7. package/dist/{briefs-CvXfErSa.js → briefs-CIN2DMSo.js} +2 -2
  8. package/dist/{catalog-runtime-DSEzvNVT.js → catalog-runtime-D1v0KsgY.js} +1 -1
  9. package/dist/{checkpoint-DfpPyo-x.js → checkpoint-B2-uc-1h.js} +6 -6
  10. package/dist/cli/chat.js +13 -13
  11. package/dist/cli/check.js +3 -3
  12. package/dist/cli/main.js +1 -1
  13. package/dist/cli/plugins.js +3 -3
  14. package/dist/cli/snapshot-create.js +3 -3
  15. package/dist/cli/upgrade.js +3 -3
  16. package/dist/{client-pBijNHYx.js → client-DIe9JhwF.js} +2 -2
  17. package/dist/{config-DYi2mx6N.js → config-0_JixokJ.js} +2 -2
  18. package/dist/{conversation-privacy-TiU3SGZh.js → conversation-privacy-6NLCEkzx.js} +1 -1
  19. package/dist/{credential-sync-hBiu11zS.js → credential-sync-Dqg2o90r.js} +21 -21
  20. package/dist/{execution-stats-DAWGg9WH.js → execution-stats-vnXVMVeu.js} +3 -3
  21. package/dist/{executor-t2OCqFgz.js → executor-CmZKtNpH.js} +1 -1
  22. package/dist/instrumentation.js +8 -6
  23. package/dist/{job-queue-Deruj7qS.js → job-queue-B1k3woMW.js} +1 -1
  24. package/dist/{logging-wngKXw7u.js → logging-D2YJv_PA.js} +1 -1
  25. package/dist/nitro.js +3 -3
  26. package/dist/{oauth-callback-server-D1jNG0lr.js → oauth-callback-server-BQtO5l5M.js} +2 -2
  27. package/dist/{pending-auth-DJa76b68.js → pending-auth-DuSNoTpn.js} +2 -2
  28. package/dist/{profile-Mv2uNsKJ.js → profile-C3TEFAVI.js} +4 -4
  29. package/dist/{registry-6_Zog2YF.js → registry-Bp0kd2xe.js} +1 -1
  30. package/dist/{resolve-BI3Dfm9p.js → resolve-BABNNBLL.js} +2 -2
  31. package/dist/{runner-CzrmejYr.js → runner-Bvn90ijl.js} +10 -10
  32. package/dist/{sandbox-egress-signals-BcSCyPKx.js → sandbox-egress-signals-DLfYAOiO.js} +1 -1
  33. package/dist/{short-title-Bs3wWE1M.js → short-title-C2fM-ERl.js} +2 -2
  34. package/dist/{skills-DOE_QPVJ.js → skills-D1otDVYp.js} +2 -2
  35. package/dist/{spawn-DylJoJnT.js → spawn-C-fAS-Rk.js} +2 -2
  36. package/dist/{stats--FeHjGJ1.js → stats-BfUFTUrM.js} +33 -8
  37. package/dist/{task-queue-CSEo5Ly9.js → task-queue-VdYCCwO0.js} +3 -3
  38. package/dist/{task-runner-BDwZj8OX.js → task-runner-6tzKHNbM.js} +7 -7
  39. package/dist/{thread-state-CpZAVpdG.js → thread-state-CD_fsyrM.js} +5 -5
  40. package/dist/{turn-execution-AROC0tUZ.js → turn-execution-eVhqozjK.js} +3 -3
  41. package/dist/{turn-lifecycle-CGNjfgbT.js → turn-lifecycle-CxAtVANu.js} +1 -1
  42. package/dist/{validation-QFwh6qzp.js → validation-CMERqrCD.js} +1 -1
  43. package/dist/{version-FAS9qrpM.js → version-C8XFxpkQ.js} +1 -1
  44. package/dist/version.js +1 -1
  45. package/dist/{web-authorization-ZAQcIE4e.js → web-authorization-Dq2NDhY0.js} +1 -1
  46. package/dist/{web-input-C5nhIX0j.js → web-input-Bdh_rCZ7.js} +4 -4
  47. package/dist/{work-BNw2Vmxi.js → work-DCwaUeWu.js} +9 -9
  48. package/dist/{worker-9Us77-te.js → worker-grswNVoc.js} +5 -5
  49. package/migrations/0043_scheduled_automation_channel_destinations.sql +36 -0
  50. package/migrations/meta/0043_snapshot.json +3610 -0
  51. package/migrations/meta/_journal.json +8 -1
  52. package/package.json +4 -4
@@ -1,28 +1,28 @@
1
- import { C as resolveGatewayCredential, S as getGatewayApiKey, _ as findProviderError, b as isProviderRetryError, c as COMPACTION_SUMMARY_PREFIX, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeText, l as MODEL_HANDOFF_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as unwrapCurrentInstruction, r as completeObject, s as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-pBijNHYx.js";
2
- import { C as withSpan, F as isRecord$2, P as normalizeIdentityEmail, S as withLogContext, _ as setSpanAttributes, a as extractGenAiUsageSummary, b as summarizeMessageText, c as getTracePropagationHeaders, d as logInfo, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as logError, p as normalizeGenAiFinishReason, s as getLogContextAttributesForSpan, u as logException, v as setSpanStatus, y as setTags } from "./logging-wngKXw7u.js";
1
+ import { C as resolveGatewayCredential, S as getGatewayApiKey, _ as findProviderError, b as isProviderRetryError, c as COMPACTION_SUMMARY_PREFIX, d as isCompactionSummaryText, f as renderCurrentInstruction, g as createProviderError, h as ProviderError, i as completeText, l as MODEL_HANDOFF_SUMMARY_PREFIX, m as escapeXml, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as unwrapCurrentInstruction, r as completeObject, s as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as hasCompactedConversationContext, v as getProviderErrorAttributes, x as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-DIe9JhwF.js";
2
+ import { C as withSpan, F as isRecord$2, P as normalizeIdentityEmail, S as withLogContext, _ as setSpanAttributes, a as extractGenAiUsageSummary, b as summarizeMessageText, c as getTracePropagationHeaders, d as logInfo, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as logError, p as normalizeGenAiFinishReason, s as getLogContextAttributesForSpan, u as logException, v as setSpanStatus, y as setTags } from "./logging-D2YJv_PA.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-TiU3SGZh.js";
5
- import { h as normalizeSlackEmojiName, n as botConfig } from "./config-DYi2mx6N.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-6NLCEkzx.js";
5
+ import { h as normalizeSlackEmojiName, n as botConfig } from "./config-0_JixokJ.js";
6
6
  import { a as modelIdForProfile, c as TURN_REASONING_LEVELS, i as formatModelProfiles, o as modelProfileSchema, r as formatModelProfile, s as profileConfig, t as ModelProfileNotConfiguredError } from "./model-profile-CZmVoGdX.js";
7
7
  import { _ as parseSlackMessageTs, g as parseSlackUserId, h as parseSlackTeamId, i as credentialUserSubjectId, l as isUserActor, m as parseSlackChannelReferenceId, n as credentialContextSchema, p as parseSlackChannelId, t as credentialContextForActor } from "./context-Bplcgypl.js";
8
- import { A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, Gt as getDb, Ht as getConversationEventStore, J as withSlackRetries, K as normalizeSlackConversationId, Kt as getSqlExecutor, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as getConversationMessageSearchStore, V as getFilePermalink, W as isConversationScopedChannel, Wt as getConversationStore, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, en as addAgentTurnUsage, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, in as hasAgentTurnUsage, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, un as parseDestination, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-DsFlR7gi.js";
8
+ import { A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, Gt as getDb, Ht as getConversationEventStore, J as withSlackRetries, K as normalizeSlackConversationId, Kt as getSqlExecutor, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as getConversationMessageSearchStore, V as getFilePermalink, W as isConversationScopedChannel, Wt as getConversationStore, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, en as addAgentTurnUsage, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, in as hasAgentTurnUsage, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, un as parseDestination, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-kjLDY-Aa.js";
9
9
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
10
- import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-t2OCqFgz.js";
10
+ import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-CmZKtNpH.js";
11
11
  import { A as briefLinkSchema, G as sameActorIdentity, H as contextProvenance, M as conversationBriefSchema, P as KNOWN_CONVERSATION_EVENT_TYPES, U as instructionActors, W as instructionProvenanceFor, j as briefOutcomeStatusSchema } from "./conversation-BSRGzJmY.js";
12
12
  import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
13
- import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-6_Zog2YF.js";
14
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DSEzvNVT.js";
15
- import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-DOE_QPVJ.js";
16
- import { A as TURN_CONTEXT_TAG, C as isContinuablePiBoundary, D as retainRuntimeTurnContext, E as normalizeToolNameFromResult, H as recordAuthorizationRequested, I as loadTurnRoute, K as recordToolExecutionStarted, L as openConversationProjection, N as loadConnectedMcpProviders, O as stripRuntimeTurnContext, P as loadConversationProjection, R as recordAgentsInstructionsUpdated, S as isAssistantMessage, T as isToolResultMessage, U as recordGuardianActionReviewed, W as recordMcpProviderConnected, _ as getPiMessageRole, b as hasRuntimeTurnContext, dt as estimateTextTokens, f as TurnSliceLimitExceededError, ft as getAgentContextCompactionTriggerTokens, g as extractAssistantText, h as isTurnExecutionLimitExceededError, ht as piMessageFromHistoryItem, k as trimTrailingAssistantMessages, mt as historyItemFromPiMessage, n as loadTurnCheckpoint, p as assertTurnToolCallLimit, pt as getAgentContextInputLimitTokens, q as recordTurnRoute, r as saveTurnCheckpoint, t as continuableMessages, v as getTerminalAssistantMessages, w as isToolResultError, y as getUserMessageInstructionText, z as recordAttachmentsDelivered } from "./checkpoint-DfpPyo-x.js";
17
- import { n as generateShortTitle, r as resolveTaskTitle } from "./short-title-Bs3wWE1M.js";
18
- import { A as sleep$1, D as fenceLock, E as acquireActiveLock, F as sandboxSkillDir, I as sandboxSkillFile, L as sandboxSkillPathResolution, M as SANDBOX_REPOS_ROOT, N as SANDBOX_SKILLS_ROOT, P as SANDBOX_WORKSPACE_ROOT, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_DATA_ROOT, k as withLock, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-Mv2uNsKJ.js";
19
- import { $ as workspaceSnapshotFinishedEvent, B as createEventAutomation, C as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as eventAutomationMatchesDestination, E as eventAutomationListToolResultSchema, F as effectiveTaskOutcomes, Gt as makeStructuredToolOutput, I as moveTaskOutcomes, Jt as ToolInputError, L as resolveTaskOutcomes, M as requireEventAutomationSlackContext, N as requireSupportedEventAutomationTrigger, O as eventAutomationToolResult, P as writableEventAutomation, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventAutomation, Ut as injectContinuationToolName, V as deleteEventAutomation, W as getEventAutomation, Wt as juniorToolOutputSchema, X as getEventCatalog, Y as saveEventAutomation, Z as WORKSPACE_SNAPSHOT_FAILED_EVENT, at as normalizeCatalogEventIdentifier, c as parseSlackThreadId, ct as registeredEventTypeSchema, et as workspaceSnapshotWatch, f as createScheduledAutomation, g as listScheduledAutomationsForTeam, i as readLiveAttachment, it as hasPluginEventCatalogEntries, j as registeredEventAutomationTriggerSchema, k as eventAutomationToolResultSchema, lt as registeredResourceTypeSchema, nt as eventNamespaceSchema, ot as pluginSupportsEvent, pt as appendAndEnqueueInboundMessage, q as listEventAutomationsForTeam, rt as hasEventCatalogEntries, s as storeAttachments, st as registeredEventMatchSchema, t as incrementStat, tt as eventGuidance, ut as requireSupportedEventMatch, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats--FeHjGJ1.js";
20
- import { _ as isTurnInputCommitLostError, c as sanitizeAssistantText, f as CooperativeTurnYieldError, l as NO_REPLY_MARKER, n as canReusePendingAuthLink, o as decideReply, p as TurnInputCommitLostError, s as getAssistantReplyText, t as abandonReplacedPendingAuth, u as isNoReplyMarker } from "./pending-auth-DJa76b68.js";
21
- import { C as toolInvocationDestination, S as surfaceFromRun, _ as uploadFilesToConversation, b as assertRunConsistency, h as postSlackMessage, i as formatProviderLabel, m as getSlackMessagePermalink, o as resolveBaseUrl, p as addReactionToMessage, r as deliverOAuthAuthorization, s as startOAuthFlow, v as RetryableDeliveryError, x as isAgentRunFeatureDisabled, y as actorFromRun } from "./agent-runner-D82gVT0O.js";
13
+ import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-Bp0kd2xe.js";
14
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D1v0KsgY.js";
15
+ import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-D1otDVYp.js";
16
+ import { A as TURN_CONTEXT_TAG, C as isContinuablePiBoundary, D as retainRuntimeTurnContext, E as normalizeToolNameFromResult, H as recordAuthorizationRequested, I as loadTurnRoute, K as recordToolExecutionStarted, L as openConversationProjection, N as loadConnectedMcpProviders, O as stripRuntimeTurnContext, P as loadConversationProjection, R as recordAgentsInstructionsUpdated, S as isAssistantMessage, T as isToolResultMessage, U as recordGuardianActionReviewed, W as recordMcpProviderConnected, _ as getPiMessageRole, b as hasRuntimeTurnContext, dt as estimateTextTokens, f as TurnSliceLimitExceededError, ft as getAgentContextCompactionTriggerTokens, g as extractAssistantText, h as isTurnExecutionLimitExceededError, ht as piMessageFromHistoryItem, k as trimTrailingAssistantMessages, mt as historyItemFromPiMessage, n as loadTurnCheckpoint, p as assertTurnToolCallLimit, pt as getAgentContextInputLimitTokens, q as recordTurnRoute, r as saveTurnCheckpoint, t as continuableMessages, v as getTerminalAssistantMessages, w as isToolResultError, y as getUserMessageInstructionText, z as recordAttachmentsDelivered } from "./checkpoint-B2-uc-1h.js";
17
+ import { n as generateShortTitle, r as resolveTaskTitle } from "./short-title-C2fM-ERl.js";
18
+ import { A as sleep$1, D as fenceLock, E as acquireActiveLock, F as sandboxSkillDir, I as sandboxSkillFile, L as sandboxSkillPathResolution, M as SANDBOX_REPOS_ROOT, N as SANDBOX_SKILLS_ROOT, P as SANDBOX_WORKSPACE_ROOT, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_DATA_ROOT, k as withLock, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-C3TEFAVI.js";
19
+ import { $ as workspaceSnapshotFinishedEvent, B as createEventAutomation, C as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as eventAutomationMatchesDestination, E as eventAutomationListToolResultSchema, F as effectiveTaskOutcomes, Gt as makeStructuredToolOutput, I as moveTaskOutcomes, Jt as ToolInputError, L as resolveTaskOutcomes, M as requireEventAutomationSlackContext, N as requireSupportedEventAutomationTrigger, O as eventAutomationToolResult, P as writableEventAutomation, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventAutomation, Ut as injectContinuationToolName, V as deleteEventAutomation, W as getEventAutomation, Wt as juniorToolOutputSchema, X as getEventCatalog, Y as saveEventAutomation, Z as WORKSPACE_SNAPSHOT_FAILED_EVENT, at as normalizeCatalogEventIdentifier, c as parseSlackThreadId, ct as registeredEventTypeSchema, et as workspaceSnapshotWatch, f as createScheduledAutomation, g as listScheduledAutomationsForTeam, i as readLiveAttachment, it as hasPluginEventCatalogEntries, j as registeredEventAutomationTriggerSchema, k as eventAutomationToolResultSchema, lt as registeredResourceTypeSchema, nt as eventNamespaceSchema, ot as pluginSupportsEvent, pt as appendAndEnqueueInboundMessage, q as listEventAutomationsForTeam, rt as hasEventCatalogEntries, s as storeAttachments, st as registeredEventMatchSchema, t as incrementStat, tt as eventGuidance, ut as requireSupportedEventMatch, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-BfUFTUrM.js";
20
+ import { _ as isTurnInputCommitLostError, c as sanitizeAssistantText, f as CooperativeTurnYieldError, l as NO_REPLY_MARKER, n as canReusePendingAuthLink, o as decideReply, p as TurnInputCommitLostError, s as getAssistantReplyText, t as abandonReplacedPendingAuth, u as isNoReplyMarker } from "./pending-auth-DuSNoTpn.js";
21
+ import { C as toolInvocationDestination, S as surfaceFromRun, _ as uploadFilesToConversation, b as assertRunConsistency, h as postSlackMessage, i as formatProviderLabel, m as getSlackMessagePermalink, o as resolveBaseUrl, p as addReactionToMessage, r as deliverOAuthAuthorization, s as startOAuthFlow, v as RetryableDeliveryError, x as isAgentRunFeatureDisabled, y as actorFromRun } from "./agent-runner-DMMa36Zl.js";
22
22
  import { r as EVENT_AUTHOR_ID } from "./prompt-BkaHwBW0.js";
23
- import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-BI3Dfm9p.js";
23
+ import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-BABNNBLL.js";
24
24
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
25
- import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-Deruj7qS.js";
25
+ import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-B1k3woMW.js";
26
26
  import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
27
27
  import { streamSimple } from "@earendil-works/pi-ai/compat";
28
28
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -8680,8 +8680,8 @@ const scheduleListToolResultSchema = juniorToolOutputSchema.extend({
8680
8680
  function throwToolInputError(error) {
8681
8681
  throw new ToolInputError(error);
8682
8682
  }
8683
- /** Require scheduler mutations to stay scoped to the active Slack conversation. */
8684
- function requireActiveConversation(context) {
8683
+ /** Resolve the active Slack channel for scheduled automation operations. */
8684
+ function requireActiveChannel(context) {
8685
8685
  const parsed = sourceSchema.safeParse(context.source);
8686
8686
  if (!parsed.success) {
8687
8687
  const source = context.source;
@@ -8696,8 +8696,7 @@ function requireActiveConversation(context) {
8696
8696
  return {
8697
8697
  platform: "slack",
8698
8698
  teamId: parsed.data.teamId,
8699
- channelId: parsed.data.channelId,
8700
- threadTs: parsed.data.threadTs ?? parsed.data.messageTs
8699
+ channelId: parsed.data.channelId
8701
8700
  };
8702
8701
  }
8703
8702
  /** Require a concrete Slack actor before creating scheduler ownership state. */
@@ -8729,14 +8728,14 @@ function getConversationAccess(destination, source) {
8729
8728
  visibility: source?.visibility === "public" ? "public" : "private"
8730
8729
  };
8731
8730
  }
8732
- /** Keep scheduler management operations bound to the task's current Slack destination. */
8731
+ /** Keep scheduler management operations bound to the task's current Slack channel. */
8733
8732
  function sameDestination(task, destination) {
8734
8733
  const taskDestination = task.destination;
8735
8734
  return taskDestination.platform === "slack" && taskDestination.teamId === destination.teamId && taskDestination.channelId === destination.channelId;
8736
8735
  }
8737
8736
  /** Look up a mutable task only after enforcing active-conversation ownership. */
8738
8737
  async function getWritableTask(args) {
8739
- const destination = requireActiveConversation(args.context);
8738
+ const destination = requireActiveChannel(args.context);
8740
8739
  const task = await readScheduledAutomation(getDb(), args.taskId);
8741
8740
  if (!task || task.status === "deleted") throwToolInputError("Scheduled automation was not found in the active Slack conversation.");
8742
8741
  if (!sameDestination(task, destination)) throwToolInputError("Scheduled automation can only be managed from the Slack destination where it currently delivers.");
@@ -8767,7 +8766,7 @@ function compactTask(task, requesterSlackUserId) {
8767
8766
  nextRunAt: task.nextRunAtMs ? new Date(task.nextRunAtMs).toISOString() : null,
8768
8767
  destination: {
8769
8768
  channel: task.destination.channelId,
8770
- thread: task.destination.threadTs ?? null
8769
+ thread: null
8771
8770
  },
8772
8771
  conversationAccess: task.conversationAccess,
8773
8772
  credentialMode: task.credentialMode,
@@ -8832,13 +8831,12 @@ function createSlackScheduleCreateAutomationTool(context) {
8832
8831
  openWorldHint: true,
8833
8832
  readOnlyHint: false
8834
8833
  },
8835
- description: "Create a one-time or recurring Junior task in the active Slack conversation. Set destination to \"channel\" when the user asks for top-level delivery in the active channel.",
8834
+ description: "Create a one-time or recurring Junior task in the active Slack channel.",
8836
8835
  executionMode: "sequential",
8837
8836
  inputSchema: z.object({
8838
8837
  instruction: z.string().min(1).max(4e3),
8839
8838
  title: z.string().trim().min(1).max(60).nullable().describe("Optional short display title. Omit or use null to generate one from the task instruction.").optional(),
8840
8839
  schedule: scheduleIntentSchema.describe("When the task runs. The scheduler computes the exact next run from this intent and the server clock."),
8841
- destination: z.literal("channel").nullable().describe("Set to \"channel\" to post at the active channel top level. Omit to use this Slack conversation.").optional(),
8842
8840
  outcomes: z.array(taskOutcomeInputSchema).max(5).describe("Successful work is silent by default. Omit this field or use an empty list when the Automation should act through tools without a status message. Add send_message only when the user asks for a reminder, post, digest, summary, or other visible result.").optional(),
8843
8841
  credentialMode: z.enum(["creator", "system"]).nullable().describe("Use creator to make the task creator's connected credentials available, or system when the creator says not to use them. Omit or use null for the creator default.").optional()
8844
8842
  }).strict(),
@@ -8850,12 +8848,7 @@ function createSlackScheduleCreateAutomationTool(context) {
8850
8848
  },
8851
8849
  outputSchema: scheduleAutomationToolResultSchema,
8852
8850
  execute: async (input, options) => {
8853
- const activeDestination = requireActiveConversation(context);
8854
- const destination = input.destination === "channel" ? {
8855
- platform: "slack",
8856
- teamId: activeDestination.teamId,
8857
- channelId: activeDestination.channelId
8858
- } : activeDestination;
8851
+ const destination = requireActiveChannel(context);
8859
8852
  const actor = requireActor(context, destination);
8860
8853
  const id = buildTaskId({
8861
8854
  actor,
@@ -9007,7 +9000,7 @@ function createSlackScheduleListAutomationsTool(context) {
9007
9000
  }).strict(),
9008
9001
  outputSchema: scheduleListToolResultSchema,
9009
9002
  execute: async (input) => {
9010
- const destination = requireActiveConversation(context);
9003
+ const destination = requireActiveChannel(context);
9011
9004
  const actor = requireActor(context, destination);
9012
9005
  let channelId;
9013
9006
  if (input.channel_id != null) {
@@ -9080,7 +9073,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
9080
9073
  openWorldHint: true,
9081
9074
  readOnlyHint: false
9082
9075
  },
9083
- description: "Update a scheduled automation. Set destination to \"here\" for this Slack conversation or \"channel\" for the active channel top level.",
9076
+ description: "Update a scheduled automation. Set destination to \"here\" to move it to the active Slack channel.",
9084
9077
  executionMode: "sequential",
9085
9078
  inputSchema: z.object({
9086
9079
  automationId: z.string().min(1).describe("Scheduled automation ID returned by slackScheduleListAutomations."),
@@ -9088,12 +9081,12 @@ function createSlackScheduleUpdateAutomationTool(context) {
9088
9081
  schedule: scheduleIntentSchema.describe("Complete replacement schedule. Omit to keep it unchanged.").nullable().optional(),
9089
9082
  outcomes: z.array(taskOutcomeInputSchema).max(5).describe("Replacement messages to send after successful work. Use an empty list to send nothing. Omit to keep unchanged.").optional(),
9090
9083
  status: z.enum(["active", "blocked"]).describe("Set active to resume a blocked task, or blocked to stop dispatch.").optional(),
9091
- destination: z.enum(["here", "channel"]).nullable().describe("Set to \"here\" to move the creator's task into this Slack conversation, or \"channel\" to post at the active channel top level. Omit to keep its destination.").optional(),
9084
+ destination: z.literal("here").nullable().describe("Set to \"here\" to move the creator's task into the active Slack channel. Omit to keep its destination.").optional(),
9092
9085
  credentialMode: z.enum(["system", "creator"]).nullable().describe("Use creator credentials or system credentials. Only the task creator may enable creator mode. Omit to keep unchanged.").optional()
9093
9086
  }).strict(),
9094
9087
  outputSchema: scheduleAutomationToolResultSchema,
9095
9088
  execute: async (input) => {
9096
- const activeDestination = requireActiveConversation(context);
9089
+ const activeDestination = requireActiveChannel(context);
9097
9090
  const actor = requireActor(context, activeDestination);
9098
9091
  const db = getDb();
9099
9092
  const lookup = await readScheduledAutomation(db, input.automationId);
@@ -9102,18 +9095,14 @@ function createSlackScheduleUpdateAutomationTool(context) {
9102
9095
  if (lookup.destination.platform !== "slack") throwToolInputError("Scheduled automation destination is invalid.");
9103
9096
  if (lookup.destination.teamId !== activeDestination.teamId) throwToolInputError("Scheduled automations can only be managed within the same Slack workspace.");
9104
9097
  const moveDestination = input.destination != null;
9105
- const requestedDestination = input.destination === "channel" ? {
9106
- platform: "slack",
9107
- teamId: activeDestination.teamId,
9108
- channelId: activeDestination.channelId
9109
- } : activeDestination;
9098
+ const requestedDestination = activeDestination;
9110
9099
  const alreadyHere = sameDestination(lookup, activeDestination);
9111
9100
  const isCreator = actor.slackUserId === lookup.createdBy.slackUserId;
9112
9101
  if (!alreadyHere && !moveDestination) throwToolInputError("Scheduled automation can only be managed from the Slack destination where it currently delivers. Set destination to \"here\" to move it into this conversation.");
9113
9102
  if (moveDestination && !isCreator) throwToolInputError("Only the scheduled automation creator can move this task.");
9114
9103
  if (input.credentialMode === "creator" && !isCreator) throwToolInputError("Only the scheduled automation creator can enable creator credential use.");
9115
9104
  if (input.outcomes !== void 0 && !isCreator) throwToolInputError("Only the scheduled automation creator can change message destinations.");
9116
- const changingDestination = moveDestination && (!alreadyHere || lookup.destination.threadTs !== requestedDestination.threadTs);
9105
+ const changingDestination = moveDestination && !alreadyHere;
9117
9106
  if (changingDestination) {
9118
9107
  if ((await db.select({ id: juniorSchedulerRuns.id }).from(juniorSchedulerRuns).where(and(eq(juniorSchedulerRuns.taskId, lookup.id), inArray(juniorSchedulerRuns.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.");
9119
9108
  }
@@ -9520,19 +9509,19 @@ function createSlackChannelListMessagesTool(context) {
9520
9509
  readOnlyHint: true
9521
9510
  },
9522
9511
  inputSchema: z.object({
9523
- channel_id: slackChannelRefParam.optional(),
9524
- limit: z.coerce.number().int().min(1).max(1e3).describe("Maximum number of messages to return across pages.").optional(),
9525
- cursor: z.string().min(1).describe("Optional cursor to continue from a prior call.").optional(),
9526
- oldest: slackTimestampParam("Oldest message timestamp (Slack ts) for range filtering.").optional(),
9527
- latest: slackTimestampParam("Latest message timestamp (Slack ts) for range filtering.").optional(),
9528
- inclusive: booleanInput$1("Whether oldest/latest bounds should be inclusive.").optional(),
9529
- max_pages: z.coerce.number().int().min(1).max(10).describe("Maximum number of API pages to traverse in a single call.").optional()
9512
+ channel_id: slackChannelRefParam.nullable().optional(),
9513
+ limit: z.coerce.number().int().min(1).max(1e3).describe("Maximum number of messages to return across pages.").nullable().optional(),
9514
+ cursor: z.string().min(1).describe("Cursor from `next_cursor` in a prior result. Use null or omit it for the first page; never invent a cursor.").nullable().optional(),
9515
+ oldest: slackTimestampParam("Oldest message timestamp (Slack ts) for range filtering.").nullable().optional(),
9516
+ latest: slackTimestampParam("Latest message timestamp (Slack ts) for range filtering.").nullable().optional(),
9517
+ inclusive: booleanInput$1("Whether oldest/latest bounds should be inclusive.").nullable().optional(),
9518
+ max_pages: z.coerce.number().int().min(1).max(10).describe("Maximum number of API pages to traverse in a single call.").nullable().optional()
9530
9519
  }),
9531
9520
  outputSchema: juniorToolOutputSchema,
9532
9521
  execute: async ({ channel_id, limit, cursor, oldest, latest, inclusive, max_pages }) => {
9533
9522
  const target = await resolveOptionalSlackChannelRef({
9534
9523
  field: "channel_id",
9535
- value: channel_id,
9524
+ value: channel_id ?? void 0,
9536
9525
  defaultChannelId: context.destinationChannelId,
9537
9526
  teamId: context.teamId
9538
9527
  });
@@ -9543,18 +9532,18 @@ function createSlackChannelListMessagesTool(context) {
9543
9532
  teamId: context.teamId
9544
9533
  });
9545
9534
  if (!access.allowed) throw new ToolInputError(access.error);
9546
- const normalizedOldest = normalizeRangeTimestamp("oldest", oldest, targetChannelId);
9535
+ const normalizedOldest = normalizeRangeTimestamp("oldest", oldest ?? void 0, targetChannelId);
9547
9536
  if (!normalizedOldest.ok) throw new ToolInputError(normalizedOldest.error);
9548
- const normalizedLatest = normalizeRangeTimestamp("latest", latest, targetChannelId);
9537
+ const normalizedLatest = normalizeRangeTimestamp("latest", latest ?? void 0, targetChannelId);
9549
9538
  if (!normalizedLatest.ok) throw new ToolInputError(normalizedLatest.error);
9550
9539
  const readHistory = async () => listChannelMessages({
9551
9540
  channelId: targetChannelId,
9552
9541
  limit: limit ?? 100,
9553
- cursor,
9542
+ cursor: cursor ?? void 0,
9554
9543
  oldest: normalizedOldest.value,
9555
9544
  latest: normalizedLatest.value,
9556
- inclusive,
9557
- maxPages: max_pages
9545
+ inclusive: inclusive ?? void 0,
9546
+ maxPages: max_pages ?? void 0
9558
9547
  });
9559
9548
  let result;
9560
9549
  let joined = false;
@@ -9995,13 +9984,13 @@ function createSlackPublicSearchTool(actionToken) {
9995
9984
  },
9996
9985
  inputSchema: z.object({
9997
9986
  query: z.string().trim().min(1).max(500).describe("Slack search query."),
9998
- content_types: z.array(z.enum(CONTENT_TYPES)).min(1).max(4).describe("Content types to include. Defaults to messages.").optional(),
9999
- after: optionalUnixTimestampParam("Unix timestamp lower bound."),
10000
- before: optionalUnixTimestampParam("Unix timestamp upper bound."),
10001
- cursor: z.string().min(1).describe("Cursor for the next result page.").optional(),
10002
- limit: z.coerce.number().int().min(1).max(20).describe("Maximum results to return; Slack allows at most 20.").optional(),
10003
- sort: z.enum(["score", "timestamp"]).describe("Rank by relevance or timestamp.").optional(),
10004
- sort_dir: z.enum(["asc", "desc"]).describe("Sort direction.").optional()
9987
+ content_types: z.array(z.enum(CONTENT_TYPES)).min(1).max(4).nullable().describe("Content types to include. Omit or use null for messages.").optional(),
9988
+ after: optionalUnixTimestampParam("Unix timestamp lower bound.").nullable(),
9989
+ before: optionalUnixTimestampParam("Unix timestamp upper bound.").nullable(),
9990
+ cursor: z.string().min(1).nullable().describe("Cursor for the next result page. Omit or use null for the first page.").optional(),
9991
+ limit: z.coerce.number().int().min(1).max(20).nullable().describe("Maximum results to return; Slack allows at most 20.").optional(),
9992
+ sort: z.enum(["score", "timestamp"]).nullable().describe("Rank by relevance or timestamp.").optional(),
9993
+ sort_dir: z.enum(["asc", "desc"]).nullable().describe("Sort direction.").optional()
10005
9994
  }),
10006
9995
  outputSchema: publicSearchOutputSchema,
10007
9996
  execute: async ({ query, content_types, after, before, cursor, limit, sort, sort_dir }) => {
@@ -11384,6 +11373,11 @@ function sanitizeMessage(msg, attachmentIdsBySlackFileId) {
11384
11373
  subtype: msg.subtype,
11385
11374
  bot_id: msg.bot_id,
11386
11375
  type: msg.type,
11376
+ ...msg.reactions?.length ? { reactions: msg.reactions.map((reaction) => ({
11377
+ name: reaction.name,
11378
+ count: reaction.count,
11379
+ users: reaction.users
11380
+ })) } : void 0,
11387
11381
  ...attachmentText ? { attachment_text: attachmentText } : void 0,
11388
11382
  ...files.length ? { files: files.map((f) => ({
11389
11383
  id: f.id,
@@ -11415,7 +11409,7 @@ function truncateMessages(messages, maxChars) {
11415
11409
  /** Create a tool that reads a Slack thread from a shared message URL or explicit coordinates. */
11416
11410
  function createSlackThreadReadTool(context, attachmentDeps) {
11417
11411
  return zodTool({
11418
- description: "Read a Slack thread from a shared archive URL or explicit channel + timestamp. Works for the current conversation and public channels.",
11412
+ description: "Read a Slack thread, including message reaction users, from a shared archive URL or explicit channel + timestamp. Works for the current conversation and public channels.",
11419
11413
  annotations: {
11420
11414
  destructiveHint: false,
11421
11415
  idempotentHint: true,
@@ -11423,11 +11417,11 @@ function createSlackThreadReadTool(context, attachmentDeps) {
11423
11417
  readOnlyHint: true
11424
11418
  },
11425
11419
  inputSchema: z.object({
11426
- url: z.string().min(1).describe("Slack message archive URL.").optional(),
11427
- channel_id: slackChannelRefParam.optional(),
11428
- ts: slackTimestampParam("Slack message timestamp. May be the thread root or any message in the thread.").optional(),
11429
- limit: z.coerce.number().int().min(1).max(1e3).describe("Maximum number of thread messages to fetch.").optional(),
11430
- max_pages: z.coerce.number().int().min(1).max(10).describe("Maximum number of Slack API pages to traverse.").optional()
11420
+ url: z.string().min(1).describe("Slack message archive URL.").nullable().optional(),
11421
+ channel_id: slackChannelRefParam.nullable().optional(),
11422
+ ts: slackTimestampParam("Slack message timestamp. May be the thread root or any message in the thread.").nullable().optional(),
11423
+ limit: z.coerce.number().int().min(1).max(1e3).describe("Maximum number of thread messages to fetch.").nullable().optional(),
11424
+ max_pages: z.coerce.number().int().min(1).max(10).describe("Maximum number of Slack API pages to traverse.").nullable().optional()
11431
11425
  }),
11432
11426
  outputSchema: juniorToolOutputSchema,
11433
11427
  execute: async ({ url, channel_id, ts, limit, max_pages }) => {
@@ -11461,7 +11455,7 @@ function createSlackThreadReadTool(context, attachmentDeps) {
11461
11455
  channelId,
11462
11456
  threadTs: lookupTs,
11463
11457
  limit: limit ?? 1e3,
11464
- maxPages: max_pages
11458
+ maxPages: max_pages ?? void 0
11465
11459
  });
11466
11460
  let replies;
11467
11461
  let joined = false;
@@ -1,15 +1,15 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { a as embedTexts, r as completeObject } from "./client-pBijNHYx.js";
3
- import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-wngKXw7u.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-DIe9JhwF.js";
3
+ import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-D2YJv_PA.js";
4
4
  import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
5
- import { t as canExposeConversationPayload } from "./conversation-privacy-TiU3SGZh.js";
6
- import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-DYi2mx6N.js";
5
+ import { t as canExposeConversationPayload } from "./conversation-privacy-6NLCEkzx.js";
6
+ import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-0_JixokJ.js";
7
7
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
8
8
  import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-Bplcgypl.js";
9
9
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
10
- import { C as 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, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-t2OCqFgz.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, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-CmZKtNpH.js";
11
11
  import { B as historyReplacementSchema, C as conversationReportEventSchema, I as conversationEventDataSchema, K as usageSchema, M as conversationBriefSchema, N as parseBriefInput, V as newConversationEventSchema, z as decodeStoredConversationEvent } from "./conversation-BSRGzJmY.js";
12
- import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-Mv2uNsKJ.js";
12
+ import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-C3TEFAVI.js";
13
13
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BkaHwBW0.js";
14
14
  import { AsyncLocalStorage } from "node:async_hooks";
15
15
  import { z } from "zod";
@@ -1,9 +1,9 @@
1
- import { F as isRecord, d as logInfo, f as logWarn } from "./logging-wngKXw7u.js";
2
- import { h as normalizeSlackEmojiName } from "./config-DYi2mx6N.js";
1
+ import { F as isRecord, d as logInfo, f as logWarn } from "./logging-D2YJv_PA.js";
2
+ import { h as normalizeSlackEmojiName } from "./config-0_JixokJ.js";
3
3
  import { _ as parseSlackMessageTs, g as parseSlackUserId } from "./context-Bplcgypl.js";
4
- import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, n as applyPluginFormatMarkdown, un as parseDestination, z as SlackActionError } from "./agent-hooks-DsFlR7gi.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DSEzvNVT.js";
6
- import { w as getStateAdapter } from "./profile-Mv2uNsKJ.js";
4
+ import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, n as applyPluginFormatMarkdown, un as parseDestination, z as SlackActionError } from "./agent-hooks-kjLDY-Aa.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D1v0KsgY.js";
6
+ import { w as getStateAdapter } from "./profile-C3TEFAVI.js";
7
7
  import { r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
8
8
  import { randomBytes } from "node:crypto";
9
9
  import { actorSchema, sourceSchema } from "@sentry/junior-plugin-api";
package/dist/api.js CHANGED
@@ -1,18 +1,18 @@
1
- import { f as logWarn, u as logException } from "./logging-wngKXw7u.js";
1
+ import { f as logWarn, u as logException } from "./logging-D2YJv_PA.js";
2
2
  import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
3
- import { $ as resolveViewerUser, $t as parseSessionSource, Ct as conversationArchivedForEmail, D as SANDBOX_RUNTIME, Dt as conversationNotArchivedForEmail, Et as conversationHasParticipantUser, Ft as listConversationAnnotations, Gt as getDb, It as listConversationAnnotationsById, J as withSlackRetries, Kt as getSqlExecutor, Mt as readConversationEventPage, Nt as buildSentryConversationUrl, Ot as conversationNotArchivedForUser, S as WorkspaceValidationError, St as conversationArchiveTimes, Tt as conversationHasParticipantEmail, U as getSlackClient, Wt as getConversationStore, Z as findUserByEmail, Zt as locationFromRow, _ as deleteWorkspace, an as resolveRootConversationId, b as listWorkspaces, bt as createPluginLogger, et as updateViewerDisplayName, g as createWorkspace, in as hasAgentTurnUsage, j as workspaceRepoCheckoutPath, jt as readLatestConversationBrief, kt as viewerConversationMembership, rn as agentTurnUsageSchema, u as getPlugins, v as getWorkspace, wt as conversationArchivedForUser, x as updateWorkspace, xt as readConversationAccessFromSql } from "./agent-hooks-DsFlR7gi.js";
3
+ import { $ as resolveViewerUser, $t as parseSessionSource, Ct as conversationArchivedForEmail, D as SANDBOX_RUNTIME, Dt as conversationNotArchivedForEmail, Et as conversationHasParticipantUser, Ft as listConversationAnnotations, Gt as getDb, It as listConversationAnnotationsById, J as withSlackRetries, Kt as getSqlExecutor, Mt as readConversationEventPage, Nt as buildSentryConversationUrl, Ot as conversationNotArchivedForUser, S as WorkspaceValidationError, St as conversationArchiveTimes, Tt as conversationHasParticipantEmail, U as getSlackClient, Wt as getConversationStore, Z as findUserByEmail, Zt as locationFromRow, _ as deleteWorkspace, an as resolveRootConversationId, b as listWorkspaces, bt as createPluginLogger, et as updateViewerDisplayName, g as createWorkspace, in as hasAgentTurnUsage, j as workspaceRepoCheckoutPath, jt as readLatestConversationBrief, kt as viewerConversationMembership, rn as agentTurnUsageSchema, u as getPlugins, v as getWorkspace, wt as conversationArchivedForUser, x as updateWorkspace, xt as readConversationAccessFromSql } from "./agent-hooks-kjLDY-Aa.js";
4
4
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
5
- import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, b as juniorApiTokens, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorConversationMetrics, y as juniorConversationEvents } from "./executor-t2OCqFgz.js";
5
+ import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, b as juniorApiTokens, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorConversationMetrics, y as juniorConversationEvents } from "./executor-CmZKtNpH.js";
6
6
  import { D as createConversationBodySchema, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-BSRGzJmY.js";
7
- import { t as fallbackShortTitle } from "./short-title-Bs3wWE1M.js";
8
- import { n as hash, t as create } from "./profile-Mv2uNsKJ.js";
9
- import { A as eventAutomationTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventAutomationsCreatedBy, H as eventAutomationBelongsToUser, J as listPublicEventAutomationsForTeams, K as listEventAutomationsCreatedBy, Tt as getConversation, V as deleteEventAutomation, W as getEventAutomation, X as getEventCatalog, _ as parseScheduledAutomationRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledAutomationsForTeams, n as readStats, p as isListedScheduledAutomation, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats--FeHjGJ1.js";
10
- import { t as getCachedSnapshot } from "./resolve-BI3Dfm9p.js";
7
+ import { t as fallbackShortTitle } from "./short-title-C2fM-ERl.js";
8
+ import { n as hash, t as create } from "./profile-C3TEFAVI.js";
9
+ import { A as eventAutomationTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventAutomationsCreatedBy, H as eventAutomationBelongsToUser, J as listPublicEventAutomationsForTeams, K as listEventAutomationsCreatedBy, Tt as getConversation, V as deleteEventAutomation, W as getEventAutomation, X as getEventCatalog, _ as parseScheduledAutomationRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledAutomationsForTeams, n as readStats, p as isListedScheduledAutomation, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-BfUFTUrM.js";
10
+ import { t as getCachedSnapshot } from "./resolve-BABNNBLL.js";
11
11
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
12
12
  import { c as runtimeInfoReportSchema, n as pluginOperationalReportFeedSchema, s as pluginsSchema, t as healthReportSchema, u as skillReportsSchema } from "./reporting-schema-DosTN__Q.js";
13
- import { a as webActorFromEmail, c as formatSlackConversationRedactedLabel, d as resolveSlackConversationContextFromThreadId, f as lookupSlackUser, g as readHealthReport, m as createVercelAttachmentStorage, p as legacyWebMailboxMetadataSchema, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage } from "./web-input-C5nhIX0j.js";
14
- import { a as readAutomationExecutionStatusDays, c as readAutomationExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readAutomationExecutionHours, l as readAutomationRuns, n as readAutomationExecutionByConversationId, o as readAutomationExecutionStatusHours, p as conversationRangeColumns, r as readAutomationExecutionDays, s as readAutomationExecutionSummaries, t as emptyAutomationRunWindows } from "./execution-stats-DAWGg9WH.js";
15
- import { r as getWebAuthorization } from "./web-authorization-ZAQcIE4e.js";
13
+ import { a as webActorFromEmail, c as formatSlackConversationRedactedLabel, d as resolveSlackConversationContextFromThreadId, f as lookupSlackUser, g as readHealthReport, m as createVercelAttachmentStorage, p as legacyWebMailboxMetadataSchema, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage } from "./web-input-Bdh_rCZ7.js";
14
+ import { a as readAutomationExecutionStatusDays, c as readAutomationExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readAutomationExecutionHours, l as readAutomationRuns, n as readAutomationExecutionByConversationId, o as readAutomationExecutionStatusHours, p as conversationRangeColumns, r as readAutomationExecutionDays, s as readAutomationExecutionSummaries, t as emptyAutomationRunWindows } from "./execution-stats-vnXVMVeu.js";
15
+ import { r as getWebAuthorization } from "./web-authorization-Dq2NDhY0.js";
16
16
  import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, J as HOUR_MS$1, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, Q as startOfUtcHour, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, X as fillUtcHours, Y as fillUtcDays, Z as fillUtcSixHours, _ as automationRunListSchema, a as workspaceBodySchema, at as apiErrorSchema, et as trailingUtcDayWindow, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, tt as trailingUtcHourWindow, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-YPJXVcOW.js";
17
17
  import { Hono } from "hono";
18
18
  import path from "node:path";
@@ -3514,7 +3514,7 @@ async function readPeoplePluginReports(args) {
3514
3514
  reports: [],
3515
3515
  source: "plugins"
3516
3516
  });
3517
- const { getPluginProfileReports } = await import("./agent-hooks-DsFlR7gi.js").then((n) => n.t);
3517
+ const { getPluginProfileReports } = await import("./agent-hooks-kjLDY-Aa.js").then((n) => n.t);
3518
3518
  return pluginOperationalReportFeedSchema.parse({
3519
3519
  generatedAt: new Date(nowMs).toISOString(),
3520
3520
  reports: await getPluginProfileReports({
@@ -4123,7 +4123,7 @@ function readDescriptionText(home) {
4123
4123
  }
4124
4124
  /** Read discovered skill names for authenticated runtime diagnostics. */
4125
4125
  async function readSkillReports() {
4126
- const { discoverSkills } = await import("./skills-DOE_QPVJ.js").then((n) => n.o);
4126
+ const { discoverSkills } = await import("./skills-D1otDVYp.js").then((n) => n.o);
4127
4127
  const skills = await discoverSkills();
4128
4128
  return skillReportsSchema.parse(skills.map((skill) => ({
4129
4129
  name: skill.name,
@@ -4132,7 +4132,7 @@ async function readSkillReports() {
4132
4132
  }
4133
4133
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4134
4134
  async function readPlugins() {
4135
- const { pluginCatalogRuntime } = await import("./catalog-runtime-DSEzvNVT.js").then((n) => n.t);
4135
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-D1v0KsgY.js").then((n) => n.t);
4136
4136
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4137
4137
  configKeys: plugin.manifest.configKeys ?? [],
4138
4138
  description: plugin.manifest.description,
@@ -4144,7 +4144,7 @@ async function readPlugins() {
4144
4144
  async function readRuntimeInfoReport() {
4145
4145
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4146
4146
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
4147
- import("./catalog-runtime-DSEzvNVT.js").then((n) => n.t),
4147
+ import("./catalog-runtime-D1v0KsgY.js").then((n) => n.t),
4148
4148
  readPlugins(),
4149
4149
  readSkillReports()
4150
4150
  ]);
@@ -4161,7 +4161,7 @@ async function readRuntimeInfoReport() {
4161
4161
  /** Read sanitized operational summaries contributed by plugins. */
4162
4162
  async function readPluginOperationalReportFeed() {
4163
4163
  const nowMs = Date.now();
4164
- const { getPluginOperationalReports } = await import("./agent-hooks-DsFlR7gi.js").then((n) => n.t);
4164
+ const { getPluginOperationalReports } = await import("./agent-hooks-kjLDY-Aa.js").then((n) => n.t);
4165
4165
  return pluginOperationalReportFeedSchema.parse({
4166
4166
  source: "plugins",
4167
4167
  generatedAt: new Date(nowMs).toISOString(),
package/dist/app.js CHANGED
@@ -1,41 +1,41 @@
1
- import { $ as AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-CJ_-GRPT.js";
2
- import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-pBijNHYx.js";
3
- import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, C as withSpan, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, F as isRecord$1, I as toOptionalNumber, L as toOptionalString, S as withLogContext, _ as setSpanAttributes, d as logInfo, f as logWarn, g as setSentryUser, l as logError, n as createChatSdkLogger, o as getActiveTraceId, r as createRequestContext, t as buildTurnFailureResponse, u as logException, v as setSpanStatus, x as withContext, y as setTags } from "./logging-wngKXw7u.js";
1
+ import { $ as AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-CFrfUdN5.js";
2
+ import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-DIe9JhwF.js";
3
+ import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, C as withSpan, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, F as isRecord$1, I as toOptionalNumber, L as toOptionalString, S as withLogContext, _ as setSpanAttributes, d as logInfo, f as logWarn, g as setSentryUser, l as logError, n as createChatSdkLogger, o as getActiveTraceId, r as createRequestContext, t as buildTurnFailureResponse, u as logException, v as setSpanStatus, x as withContext, y as setTags } from "./logging-D2YJv_PA.js";
4
4
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
5
- import { t as JUNIOR_VERSION } from "./version-FAS9qrpM.js";
6
- import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, l as getSlackClientSecret, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-DYi2mx6N.js";
5
+ import { t as JUNIOR_VERSION } from "./version-C8XFxpkQ.js";
6
+ import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, l as getSlackClientSecret, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-0_JixokJ.js";
7
7
  import { a as modelIdForProfile, n as defaultModelId } from "./model-profile-CZmVoGdX.js";
8
8
  import { _ as parseSlackMessageTs, a as createActor, c as isActorUserId, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-Bplcgypl.js";
9
- import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel, Gt as getDb, Ht as getConversationEventStore, I as verifyEventAutomationCredentialSubject, Jt as withConversationEventLock, K as normalizeSlackConversationId, Kt as getSqlExecutor, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationStore, X as runWithWorkspaceTeamId, Xt as withConversationMutationLock, Y as getWorkspaceTeamId, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dn as requireSlackDestination, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, ln as createSlackDestination, on as deleteProviderIdentityForSlackUser, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-DsFlR7gi.js";
9
+ import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel, Gt as getDb, Ht as getConversationEventStore, I as verifyEventAutomationCredentialSubject, Jt as withConversationEventLock, K as normalizeSlackConversationId, Kt as getSqlExecutor, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationStore, X as runWithWorkspaceTeamId, Xt as withConversationMutationLock, Y as getWorkspaceTeamId, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dn as requireSlackDestination, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, ln as createSlackDestination, on as deleteProviderIdentityForSlackUser, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-kjLDY-Aa.js";
10
10
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
11
- import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-t2OCqFgz.js";
11
+ import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-CmZKtNpH.js";
12
12
  import { W as instructionProvenanceFor } from "./conversation-BSRGzJmY.js";
13
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DSEzvNVT.js";
14
- import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-DfpPyo-x.js";
15
- import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-Mv2uNsKJ.js";
16
- import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats--FeHjGJ1.js";
17
- import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-DJa76b68.js";
18
- import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-D82gVT0O.js";
13
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D1v0KsgY.js";
14
+ import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-B2-uc-1h.js";
15
+ import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-C3TEFAVI.js";
16
+ import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats-BfUFTUrM.js";
17
+ import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-DuSNoTpn.js";
18
+ import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-DMMa36Zl.js";
19
19
  import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-BkaHwBW0.js";
20
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-BI3Dfm9p.js";
20
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-BABNNBLL.js";
21
21
  import { l as conversationQueueMessageSchema, n as resolveConversationWorkQueueTopic, r as verifyConversationQueueMessage, t as getVercelConversationWorkQueue, u as isConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
22
- import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-Deruj7qS.js";
22
+ import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-B1k3woMW.js";
23
23
  import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
24
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-QFwh6qzp.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CMERqrCD.js";
25
25
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
26
- import { a as webActorFromEmail, f as lookupSlackUser, h as GET$3, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, m as createVercelAttachmentStorage, n as conversationTurnIdForMessage, o as resolveConversationDestination, p as legacyWebMailboxMetadataSchema, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext } from "./web-input-C5nhIX0j.js";
27
- import { u as recordAutomationExecution } from "./execution-stats-DAWGg9WH.js";
28
- import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-BDwZj8OX.js";
29
- import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-BNw2Vmxi.js";
30
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CGNjfgbT.js";
31
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-AROC0tUZ.js";
32
- import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-CpZAVpdG.js";
33
- import { a as requireTurnFailureEventId, d as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, t as completeAuthPauseTurn, u as getTurnUserSlackMessageTs } from "./auth-pause-state-DL5YJXnT.js";
34
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CSEo5Ly9.js";
35
- import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-hBiu11zS.js";
36
- import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-ZAQcIE4e.js";
37
- import { t as processConversationWork } from "./worker-9Us77-te.js";
38
- import { t as bindSpawnAgent } from "./spawn-DylJoJnT.js";
26
+ import { a as webActorFromEmail, f as lookupSlackUser, h as GET$3, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, m as createVercelAttachmentStorage, n as conversationTurnIdForMessage, o as resolveConversationDestination, p as legacyWebMailboxMetadataSchema, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext } from "./web-input-Bdh_rCZ7.js";
27
+ import { u as recordAutomationExecution } from "./execution-stats-vnXVMVeu.js";
28
+ import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-6tzKHNbM.js";
29
+ import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-DCwaUeWu.js";
30
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CxAtVANu.js";
31
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-eVhqozjK.js";
32
+ import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-CD_fsyrM.js";
33
+ import { a as requireTurnFailureEventId, d as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, t as completeAuthPauseTurn, u as getTurnUserSlackMessageTs } from "./auth-pause-state-TdhAyYM4.js";
34
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-VdYCCwO0.js";
35
+ import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-Dqg2o90r.js";
36
+ import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-Dq2NDhY0.js";
37
+ import { t as processConversationWork } from "./worker-grswNVoc.js";
38
+ import { t as bindSpawnAgent } from "./spawn-C-fAS-Rk.js";
39
39
  import { createRequire } from "node:module";
40
40
  import { pathToFileURL } from "node:url";
41
41
  import { Hono } from "hono";
@@ -5879,7 +5879,7 @@ function createSlackTurn(deps) {
5879
5879
  }));
5880
5880
  await options.onTurnStatePersisted?.();
5881
5881
  } catch (error) {
5882
- logException(/* @__PURE__ */ new Error("Accepted assistant message persistence failed"), "slack.assistant.message_post_delivery_persist.failed", { "error.type": error instanceof Error ? error.name : typeof error });
5882
+ logException(error, "slack.assistant.message_post_delivery_persist.failed");
5883
5883
  }
5884
5884
  if (slackTs && options.execution?.dispatch?.id) try {
5885
5885
  await persistWithRetry(() => recordTurnSummary({
@@ -7220,7 +7220,7 @@ async function commitAssistantMessage(args) {
7220
7220
  providerConversationBindings: args.deliveryResult?.providerConversationBindings
7221
7221
  }));
7222
7222
  } catch (error) {
7223
- logException(/* @__PURE__ */ new Error("Assistant message persistence failed"), "conversation.assistant.message_persist.failed", { "error.type": error instanceof Error ? error.name : typeof error });
7223
+ logException(error, "conversation.assistant.message_persist.failed");
7224
7224
  }
7225
7225
  }
7226
7226
  //#endregion
@@ -1,10 +1,10 @@
1
- import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-pBijNHYx.js";
2
- import { t as buildTurnFailureResponse } from "./logging-wngKXw7u.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-DIe9JhwF.js";
2
+ import { t as buildTurnFailureResponse } from "./logging-D2YJv_PA.js";
3
3
  import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
- import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-DfpPyo-x.js";
5
- import { qt as buildDeterministicTurnId } from "./stats--FeHjGJ1.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-DJa76b68.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CpZAVpdG.js";
4
+ import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-B2-uc-1h.js";
5
+ import { qt as buildDeterministicTurnId } from "./stats-BfUFTUrM.js";
6
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-DuSNoTpn.js";
7
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CD_fsyrM.js";
8
8
  //#region src/chat/runtime/delivered-turn-state.ts
9
9
  /** Build state after destination delivery or intentional no-reply completion. */
10
10
  function buildDeliveredTurnStatePatch(args) {