@sentry/junior 0.217.0 → 0.219.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 (56) hide show
  1. package/dist/{agent-CV4MPfCD.js → agent-DFeJ0yVy.js} +119 -33
  2. package/dist/{agent-hooks-BtGATjr2.js → agent-hooks-CKaIOT4I.js} +6 -6
  3. package/dist/{agent-runner-DCj_cPjl.js → agent-runner-DifJddqY.js} +5 -5
  4. package/dist/api.js +15 -15
  5. package/dist/{app-D4nNdzPG.d.ts → app-BYD2Nyji.d.ts} +1 -1
  6. package/dist/app.d.ts +2 -2
  7. package/dist/app.js +29 -29
  8. package/dist/{auth-pause-state-C7GMUpb9.js → auth-pause-state-nAyuKldT.js} +6 -6
  9. package/dist/{briefs-eG5Jo1xa.js → briefs-D2iu2JPg.js} +2 -2
  10. package/dist/{catalog-runtime-LUAIHslF.js → catalog-runtime-v3x4peOv.js} +1 -1
  11. package/dist/{checkpoint-CmkbGGiR.js → checkpoint-Cc7ba7dw.js} +6 -6
  12. package/dist/cli/chat.d.ts +1 -1
  13. package/dist/cli/chat.js +13 -13
  14. package/dist/cli/check.js +3 -3
  15. package/dist/cli/main.js +1 -1
  16. package/dist/cli/plugins.d.ts +1 -1
  17. package/dist/cli/plugins.js +3 -3
  18. package/dist/cli/snapshot-create.js +3 -3
  19. package/dist/cli/upgrade.d.ts +1 -1
  20. package/dist/cli/upgrade.js +3 -3
  21. package/dist/{client-ciJRmcY5.js → client-DVKLZG01.js} +2 -2
  22. package/dist/{config-BMwzCmw-.js → config-BXIOxlCK.js} +2 -2
  23. package/dist/{conversation-privacy-CLkpzAlt.js → conversation-privacy-8-WR4KBo.js} +1 -1
  24. package/dist/{credential-sync-BoWHpDBP.js → credential-sync-BOcckr3l.js} +20 -20
  25. package/dist/{execution-stats-C-E5FIsT.js → execution-stats-G61-pwq6.js} +3 -3
  26. package/dist/{executor-D0xETqi8.js → executor-D_aAfzGp.js} +1 -1
  27. package/dist/instrumentation.js +2 -2
  28. package/dist/{job-queue-C8FZ3LSY.js → job-queue-DjgMEeqJ.js} +1 -1
  29. package/dist/{logging-CHZ0aJXO.js → logging-1iHJtqBM.js} +1 -1
  30. package/dist/nitro.d.ts +2 -2
  31. package/dist/nitro.js +3 -3
  32. package/dist/{oauth-callback-server-D2JPUvY4.js → oauth-callback-server-wwYSbTaU.js} +2 -2
  33. package/dist/{pending-auth-HNSPyxoN.js → pending-auth-B2qOCIx1.js} +2 -2
  34. package/dist/{plugins-BI9A1vKA.d.ts → plugins-BT2l4We3.d.ts} +2 -1
  35. package/dist/{profile-6veboDue.js → profile-B4e6XN37.js} +4 -4
  36. package/dist/{registry-DR6TJe4J.js → registry-C0DT9wqc.js} +62 -18
  37. package/dist/{resolve-DprAzyQN.js → resolve-DugfbPdI.js} +2 -2
  38. package/dist/{runner-CV9Wahh9.js → runner-RE9Lp-M8.js} +9 -9
  39. package/dist/{sandbox-egress-signals-BpRsWlQP.js → sandbox-egress-signals-BqkV7azF.js} +1 -1
  40. package/dist/{short-title-XUBD7AYC.js → short-title-C7tWtQQy.js} +2 -2
  41. package/dist/{skills-DeUBvhdn.js → skills-B6OcxCOp.js} +2 -2
  42. package/dist/{spawn-BFzlrZae.js → spawn-BmZvmNYc.js} +2 -2
  43. package/dist/{stats-BvNqVRdB.js → stats-BtMLD1n8.js} +5 -5
  44. package/dist/{task-queue-CbxNVEAg.js → task-queue-a2aXjkx2.js} +3 -3
  45. package/dist/{task-runner-BH5M3JHb.js → task-runner-Bg2trvKT.js} +7 -7
  46. package/dist/{thread-state-Db98GdYL.js → thread-state-D4zlHEq1.js} +5 -5
  47. package/dist/{turn-execution-mZIWtngI.js → turn-execution-CgCTt4YP.js} +3 -3
  48. package/dist/{turn-lifecycle-CNsgouon.js → turn-lifecycle-ClF1kY55.js} +1 -1
  49. package/dist/{validation-Dy7SUhLv.js → validation-CGkLLzS9.js} +1 -1
  50. package/dist/{version-Es4nurl1.js → version-CZfM8Kly.js} +1 -1
  51. package/dist/version.js +1 -1
  52. package/dist/{web-authorization-DG2K_bpi.js → web-authorization-DCSwmiua.js} +1 -1
  53. package/dist/{web-input-CZjYeCFh.js → web-input-CQrFGEv9.js} +4 -4
  54. package/dist/{work-DTqDMGeD.js → work-lRFwhKJe.js} +9 -9
  55. package/dist/{worker-BvuVxS4T.js → worker-BV4FekSX.js} +5 -5
  56. 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-ciJRmcY5.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-CHZ0aJXO.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-DVKLZG01.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-1iHJtqBM.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-CLkpzAlt.js";
5
- import { h as normalizeSlackEmojiName, n as botConfig } from "./config-BMwzCmw-.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-8-WR4KBo.js";
5
+ import { h as normalizeSlackEmojiName, n as botConfig } from "./config-BXIOxlCK.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-BtGATjr2.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-CKaIOT4I.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-D0xETqi8.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-D_aAfzGp.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-BpqLg4MM.js";
12
12
  import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
13
- import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-DR6TJe4J.js";
14
- import { n as pluginCatalogRuntime } from "./catalog-runtime-LUAIHslF.js";
15
- import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-DeUBvhdn.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-CmkbGGiR.js";
17
- import { n as generateShortTitle, r as resolveTaskTitle } from "./short-title-XUBD7AYC.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-6veboDue.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-BvNqVRdB.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-HNSPyxoN.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-DCj_cPjl.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-C0DT9wqc.js";
14
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-v3x4peOv.js";
15
+ import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-B6OcxCOp.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-Cc7ba7dw.js";
17
+ import { n as generateShortTitle, r as resolveTaskTitle } from "./short-title-C7tWtQQy.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-B4e6XN37.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-BtMLD1n8.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-B2qOCIx1.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-DifJddqY.js";
22
22
  import { r as EVENT_AUTHOR_ID } from "./prompt-DAoaq0CT.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-DprAzyQN.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-DugfbPdI.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-C8FZ3LSY.js";
25
+ import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-DjgMEeqJ.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";
@@ -51,6 +51,7 @@ import net from "node:net";
51
51
  import { NodeHtmlMarkdown } from "node-html-markdown";
52
52
  import { Value } from "@sinclair/typebox/value";
53
53
  import { Kind } from "@sinclair/typebox";
54
+ import { SignJWT, importPKCS8 } from "jose";
54
55
  //#region src/chat/configuration/defaults.ts
55
56
  let installDefaults = {};
56
57
  function cloneDefaults(defaults) {
@@ -6461,12 +6462,11 @@ var PluginMcpClient = class {
6461
6462
  async connectClient() {
6462
6463
  const mcp = this.plugin.manifest.mcp;
6463
6464
  if (!mcp) throw new Error(`Plugin "${this.plugin.manifest.name}" does not declare MCP config`);
6464
- const requestInit = {};
6465
- if (mcp.headers && Object.keys(mcp.headers).length > 0) requestInit.headers = new Headers(mcp.headers);
6465
+ const headers = mcp.headers ? resolvePluginHeaderEnvRefs(this.plugin.manifest.name, mcp.headers, "MCP header") : void 0;
6466
6466
  const sessionId = await this.getStoredTransportSessionId();
6467
6467
  this.lastAttemptedTransportSessionId = sessionId;
6468
6468
  const transport = new StreamableHTTPClientTransport(new URL(mcp.url), {
6469
- ...Object.keys(requestInit).length > 0 ? { requestInit } : void 0,
6469
+ ...headers ? { requestInit: { headers } } : void 0,
6470
6470
  fetch: fetchWithBoundedOAuthErrorBodies(this.options.fetch, (status) => {
6471
6471
  const store = this.providerStatusStore.getStore();
6472
6472
  if (store) store.status = status;
@@ -8832,12 +8832,13 @@ function createSlackScheduleCreateAutomationTool(context) {
8832
8832
  openWorldHint: true,
8833
8833
  readOnlyHint: false
8834
8834
  },
8835
- description: "Create a one-time or recurring Junior task in the active Slack conversation when the user asks Junior to do work later or repeatedly.",
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.",
8836
8836
  executionMode: "sequential",
8837
8837
  inputSchema: z.object({
8838
8838
  instruction: z.string().min(1).max(4e3),
8839
8839
  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
8840
  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(),
8841
8842
  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(),
8842
8843
  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()
8843
8844
  }).strict(),
@@ -8849,7 +8850,12 @@ function createSlackScheduleCreateAutomationTool(context) {
8849
8850
  },
8850
8851
  outputSchema: scheduleAutomationToolResultSchema,
8851
8852
  execute: async (input, options) => {
8852
- const destination = requireActiveConversation(context);
8853
+ const activeDestination = requireActiveConversation(context);
8854
+ const destination = input.destination === "channel" ? {
8855
+ platform: "slack",
8856
+ teamId: activeDestination.teamId,
8857
+ channelId: activeDestination.channelId
8858
+ } : activeDestination;
8853
8859
  const actor = requireActor(context, destination);
8854
8860
  const id = buildTaskId({
8855
8861
  actor,
@@ -9074,7 +9080,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
9074
9080
  openWorldHint: true,
9075
9081
  readOnlyHint: false
9076
9082
  },
9077
- description: "Update a scheduled automation. To move the requester's task into this Slack conversation, set destination to \"here\".",
9083
+ description: "Update a scheduled automation. Set destination to \"here\" for this Slack conversation or \"channel\" for the active channel top level.",
9078
9084
  executionMode: "sequential",
9079
9085
  inputSchema: z.object({
9080
9086
  automationId: z.string().min(1).describe("Scheduled automation ID returned by slackScheduleListAutomations."),
@@ -9082,7 +9088,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
9082
9088
  schedule: scheduleIntentSchema.describe("Complete replacement schedule. Omit to keep it unchanged.").nullable().optional(),
9083
9089
  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(),
9084
9090
  status: z.enum(["active", "blocked"]).describe("Set active to resume a blocked task, or blocked to stop dispatch.").optional(),
9085
- destination: z.literal("here").nullable().describe("Set to \"here\" to move the creator's task into this Slack conversation. Omit to keep its destination.").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(),
9086
9092
  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()
9087
9093
  }).strict(),
9088
9094
  outputSchema: scheduleAutomationToolResultSchema,
@@ -9095,14 +9101,19 @@ function createSlackScheduleUpdateAutomationTool(context) {
9095
9101
  if (lookup.status === "completed") throwToolInputError("Completed scheduled automations cannot be updated. Create a new automation instead.");
9096
9102
  if (lookup.destination.platform !== "slack") throwToolInputError("Scheduled automation destination is invalid.");
9097
9103
  if (lookup.destination.teamId !== activeDestination.teamId) throwToolInputError("Scheduled automations can only be managed within the same Slack workspace.");
9098
- const moveHere = input.destination === "here";
9104
+ const moveDestination = input.destination != null;
9105
+ const requestedDestination = input.destination === "channel" ? {
9106
+ platform: "slack",
9107
+ teamId: activeDestination.teamId,
9108
+ channelId: activeDestination.channelId
9109
+ } : activeDestination;
9099
9110
  const alreadyHere = sameDestination(lookup, activeDestination);
9100
9111
  const isCreator = actor.slackUserId === lookup.createdBy.slackUserId;
9101
- if (!alreadyHere && !moveHere) 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.");
9102
- if (moveHere && !isCreator) throwToolInputError("Only the scheduled automation creator can move this task.");
9112
+ 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
+ if (moveDestination && !isCreator) throwToolInputError("Only the scheduled automation creator can move this task.");
9103
9114
  if (input.credentialMode === "creator" && !isCreator) throwToolInputError("Only the scheduled automation creator can enable creator credential use.");
9104
9115
  if (input.outcomes !== void 0 && !isCreator) throwToolInputError("Only the scheduled automation creator can change message destinations.");
9105
- const changingDestination = moveHere && !alreadyHere;
9116
+ const changingDestination = moveDestination && (!alreadyHere || lookup.destination.threadTs !== requestedDestination.threadTs);
9106
9117
  if (changingDestination) {
9107
9118
  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.");
9108
9119
  }
@@ -9126,7 +9137,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
9126
9137
  const credentialMode = input.instruction !== void 0 && input.instruction !== lookup.task.text && !isCreator ? "system" : input.credentialMode ?? lookup.credentialMode;
9127
9138
  const nextInstruction = input.instruction !== void 0 ? input.instruction : lookup.task.text;
9128
9139
  const instructionChanged = nextInstruction !== lookup.task.text;
9129
- const nextDestination = changingDestination ? activeDestination : lookup.destination;
9140
+ const nextDestination = changingDestination ? requestedDestination : lookup.destination;
9130
9141
  const next = {
9131
9142
  ...lookup,
9132
9143
  conversationAccess: changingDestination ? getConversationAccess(activeDestination, context.source) : lookup.conversationAccess,
@@ -9150,7 +9161,7 @@ function createSlackScheduleUpdateAutomationTool(context) {
9150
9161
  if (title) next.title = title;
9151
9162
  else delete next.title;
9152
9163
  }
9153
- if (!changingDestination && !instructionChanged && !compiled && status === void 0 && (input.credentialMode === void 0 || input.credentialMode === null || input.credentialMode === lookup.credentialMode) && input.outcomes === void 0 && moveHere) return scheduleAutomationToolResult(lookup, actor.slackUserId);
9164
+ if (!changingDestination && !instructionChanged && !compiled && status === void 0 && (input.credentialMode === void 0 || input.credentialMode === null || input.credentialMode === lookup.credentialMode) && input.outcomes === void 0 && moveDestination) return scheduleAutomationToolResult(lookup, actor.slackUserId);
9154
9165
  const committed = await saveScheduledAutomation(db, next);
9155
9166
  if (changingDestination) logInfo("scheduled_automation.move.completed", scheduledAutomationAttributes(committed));
9156
9167
  return scheduleAutomationToolResult(committed, actor.slackUserId);
@@ -14661,6 +14672,75 @@ function createPiAgentTools(tools, sandbox, spanContext, onStatus, sandboxTools,
14661
14672
  }));
14662
14673
  }
14663
14674
  //#endregion
14675
+ //#region src/chat/mcp/jwt-bearer-provider.ts
14676
+ /**
14677
+ * Non-interactive MCP auth for bot plugins.
14678
+ *
14679
+ * When a manifest declares `mcp.auth`, this provider signs a short-lived assertion with a
14680
+ * plugin-held private key and the SDK exchanges it at the server token endpoint. No user, no
14681
+ * browser redirect; expired access tokens re-mint automatically on the next 401.
14682
+ *
14683
+ * This is the ID-JAG profile of RFC 7523: the assertion is the grant (§2.1), it carries
14684
+ * `client_id` and `resource` claims, and `aud` is the authorization server issuer. The SDK's
14685
+ * own PrivateKeyJwtProvider implements §2.2 client authentication with a client_credentials
14686
+ * grant instead, which Python MCP servers do not accept yet, so it does not fit here.
14687
+ *
14688
+ * The absent redirectUrl is what routes the SDK into its non-interactive token flow, the
14689
+ * `oauth-id-jag+jwt` typ header is what identity-assertion servers require, and the placeholder
14690
+ * redirect_uri exists only because dynamic client registration rejects an empty list.
14691
+ */
14692
+ const JWT_BEARER_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
14693
+ const ALGORITHM = "RS256";
14694
+ function nonInteractive() {
14695
+ throw new Error("jwt-bearer MCP auth is non-interactive");
14696
+ }
14697
+ /** Build the OAuth client provider that signs jwt-bearer assertions for one bot MCP plugin. */
14698
+ function createJwtBearerMcpClientProvider(subject, mcpUrl, auth) {
14699
+ let discovery;
14700
+ let clientInfo;
14701
+ let tokens;
14702
+ return {
14703
+ redirectUrl: void 0,
14704
+ clientMetadata: {
14705
+ client_name: subject,
14706
+ redirect_uris: ["http://localhost"],
14707
+ token_endpoint_auth_method: "none"
14708
+ },
14709
+ discoveryState: () => discovery,
14710
+ saveDiscoveryState: (state) => {
14711
+ discovery = state;
14712
+ },
14713
+ clientInformation: () => clientInfo,
14714
+ saveClientInformation: (info) => {
14715
+ clientInfo = info;
14716
+ },
14717
+ tokens: () => tokens,
14718
+ saveTokens: (next) => {
14719
+ tokens = next;
14720
+ },
14721
+ redirectToAuthorization: nonInteractive,
14722
+ saveCodeVerifier: nonInteractive,
14723
+ codeVerifier: nonInteractive,
14724
+ prepareTokenRequest: async () => {
14725
+ if (!discovery) throw new Error("jwt-bearer token request requires discovered server metadata");
14726
+ const privateKeyPem = process.env[auth.privateKeyEnv];
14727
+ if (!privateKeyPem) throw new Error(`jwt-bearer MCP auth env var ${auth.privateKeyEnv} is unset`);
14728
+ const assertion = await new SignJWT({
14729
+ client_id: clientInfo?.client_id,
14730
+ resource: mcpUrl
14731
+ }).setProtectedHeader({
14732
+ alg: ALGORITHM,
14733
+ kid: auth.keyId,
14734
+ typ: "oauth-id-jag+jwt"
14735
+ }).setIssuer(auth.issuer).setSubject(subject).setAudience(discovery.authorizationServerMetadata?.issuer ?? discovery.authorizationServerUrl).setIssuedAt().setExpirationTime("5m").setJti(randomUUID()).sign(await importPKCS8(privateKeyPem, ALGORITHM));
14736
+ return new URLSearchParams({
14737
+ grant_type: JWT_BEARER_GRANT_TYPE,
14738
+ assertion
14739
+ });
14740
+ }
14741
+ };
14742
+ }
14743
+ //#endregion
14664
14744
  //#region src/chat/mcp/auth-store.ts
14665
14745
  const MCP_AUTH_SESSION_PREFIX = "junior:mcp_oauth_attempt:v2";
14666
14746
  const MCP_AUTH_CREDENTIALS_PREFIX = "junior:mcp_auth_credentials";
@@ -15012,11 +15092,10 @@ async function finalizeMcpAuthorization(provider, authSessionId, authorizationCo
15012
15092
  const baseUrl = resolveBaseUrl();
15013
15093
  if (!baseUrl) throw new Error("Cannot determine base URL (set JUNIOR_BASE_URL or deploy to Vercel)");
15014
15094
  const authProvider = new StateBackedMcpOAuthClientProvider(authSessionId, `${baseUrl}${getMcpOAuthCallbackPath(provider)}`, void 0, runCredentialMutation);
15015
- const requestInit = {};
15016
- if (mcp.headers && Object.keys(mcp.headers).length > 0) requestInit.headers = new Headers(mcp.headers);
15095
+ const headers = mcp.headers ? resolvePluginHeaderEnvRefs(provider, mcp.headers, "MCP header") : void 0;
15017
15096
  let providerStatus;
15018
15097
  const transport = new StreamableHTTPClientTransport(new URL(mcp.url), {
15019
- ...Object.keys(requestInit).length > 0 ? { requestInit } : void 0,
15098
+ ...headers ? { requestInit: { headers } } : void 0,
15020
15099
  authProvider,
15021
15100
  fetch: fetchWithBoundedOAuthErrorBodies(void 0, (status) => {
15022
15101
  providerStatus = status;
@@ -15058,7 +15137,13 @@ var McpAuthorizationPauseError = class extends AuthorizationPauseError {
15058
15137
  function createMcpAuthOrchestration(input) {
15059
15138
  let pendingPause;
15060
15139
  const authSessionIdsByProvider = /* @__PURE__ */ new Map();
15140
+ const botAuthProviders = /* @__PURE__ */ new Set();
15061
15141
  const authProviderFactory = async (plugin) => {
15142
+ const mcp = plugin.manifest.mcp;
15143
+ if (mcp?.auth) {
15144
+ botAuthProviders.add(plugin.manifest.name);
15145
+ return createJwtBearerMcpClientProvider(plugin.manifest.name, mcp.url, mcp.auth);
15146
+ }
15062
15147
  if (!input.conversationId || !input.sessionId || !input.actorId) return;
15063
15148
  if (!input.recordPendingAuth && input.interactiveAuthEnabled !== false) throw new Error(`Missing pending auth recorder for MCP authorization pause "${plugin.manifest.name}"`);
15064
15149
  const provider = await createMcpOAuthClientProvider({
@@ -15079,6 +15164,7 @@ function createMcpAuthOrchestration(input) {
15079
15164
  return provider;
15080
15165
  };
15081
15166
  const onAuthorizationRequired = async (provider) => {
15167
+ if (botAuthProviders.has(provider)) return false;
15082
15168
  if (pendingPause) return true;
15083
15169
  const authSessionId = authSessionIdsByProvider.get(provider);
15084
15170
  const conversationId = input.conversationId;
@@ -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-ciJRmcY5.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-CHZ0aJXO.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-DVKLZG01.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-1iHJtqBM.js";
4
4
  import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
5
- import { t as canExposeConversationPayload } from "./conversation-privacy-CLkpzAlt.js";
6
- import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-BMwzCmw-.js";
5
+ import { t as canExposeConversationPayload } from "./conversation-privacy-8-WR4KBo.js";
6
+ import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-BXIOxlCK.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-D0xETqi8.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-D_aAfzGp.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-BpqLg4MM.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-6veboDue.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-B4e6XN37.js";
13
13
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DAoaq0CT.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-CHZ0aJXO.js";
2
- import { h as normalizeSlackEmojiName } from "./config-BMwzCmw-.js";
1
+ import { F as isRecord, d as logInfo, f as logWarn } from "./logging-1iHJtqBM.js";
2
+ import { h as normalizeSlackEmojiName } from "./config-BXIOxlCK.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-BtGATjr2.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-LUAIHslF.js";
6
- import { w as getStateAdapter } from "./profile-6veboDue.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-CKaIOT4I.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-v3x4peOv.js";
6
+ import { w as getStateAdapter } from "./profile-B4e6XN37.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-CHZ0aJXO.js";
1
+ import { f as logWarn, u as logException } from "./logging-1iHJtqBM.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-BtGATjr2.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-CKaIOT4I.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-D0xETqi8.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-D_aAfzGp.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-BpqLg4MM.js";
7
- import { t as fallbackShortTitle } from "./short-title-XUBD7AYC.js";
8
- import { n as hash, t as create } from "./profile-6veboDue.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-BvNqVRdB.js";
10
- import { t as getCachedSnapshot } from "./resolve-DprAzyQN.js";
7
+ import { t as fallbackShortTitle } from "./short-title-C7tWtQQy.js";
8
+ import { n as hash, t as create } from "./profile-B4e6XN37.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-BtMLD1n8.js";
10
+ import { t as getCachedSnapshot } from "./resolve-DugfbPdI.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-CZjYeCFh.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-C-E5FIsT.js";
15
- import { r as getWebAuthorization } from "./web-authorization-DG2K_bpi.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-CQrFGEv9.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-G61-pwq6.js";
15
+ import { r as getWebAuthorization } from "./web-authorization-DCSwmiua.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-BMG8MJPJ.js";
17
17
  import { Hono } from "hono";
18
18
  import path from "node:path";
@@ -3453,7 +3453,7 @@ async function readPeoplePluginReports(args) {
3453
3453
  reports: [],
3454
3454
  source: "plugins"
3455
3455
  });
3456
- const { getPluginProfileReports } = await import("./agent-hooks-BtGATjr2.js").then((n) => n.t);
3456
+ const { getPluginProfileReports } = await import("./agent-hooks-CKaIOT4I.js").then((n) => n.t);
3457
3457
  return pluginOperationalReportFeedSchema.parse({
3458
3458
  generatedAt: new Date(nowMs).toISOString(),
3459
3459
  reports: await getPluginProfileReports({
@@ -4062,7 +4062,7 @@ function readDescriptionText(home) {
4062
4062
  }
4063
4063
  /** Read discovered skill names for authenticated runtime diagnostics. */
4064
4064
  async function readSkillReports() {
4065
- const { discoverSkills } = await import("./skills-DeUBvhdn.js").then((n) => n.o);
4065
+ const { discoverSkills } = await import("./skills-B6OcxCOp.js").then((n) => n.o);
4066
4066
  const skills = await discoverSkills();
4067
4067
  return skillReportsSchema.parse(skills.map((skill) => ({
4068
4068
  name: skill.name,
@@ -4071,7 +4071,7 @@ async function readSkillReports() {
4071
4071
  }
4072
4072
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4073
4073
  async function readPlugins() {
4074
- const { pluginCatalogRuntime } = await import("./catalog-runtime-LUAIHslF.js").then((n) => n.t);
4074
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-v3x4peOv.js").then((n) => n.t);
4075
4075
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4076
4076
  configKeys: plugin.manifest.configKeys ?? [],
4077
4077
  description: plugin.manifest.description,
@@ -4083,7 +4083,7 @@ async function readPlugins() {
4083
4083
  async function readRuntimeInfoReport() {
4084
4084
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4085
4085
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
4086
- import("./catalog-runtime-LUAIHslF.js").then((n) => n.t),
4086
+ import("./catalog-runtime-v3x4peOv.js").then((n) => n.t),
4087
4087
  readPlugins(),
4088
4088
  readSkillReports()
4089
4089
  ]);
@@ -4100,7 +4100,7 @@ async function readRuntimeInfoReport() {
4100
4100
  /** Read sanitized operational summaries contributed by plugins. */
4101
4101
  async function readPluginOperationalReportFeed() {
4102
4102
  const nowMs = Date.now();
4103
- const { getPluginOperationalReports } = await import("./agent-hooks-BtGATjr2.js").then((n) => n.t);
4103
+ const { getPluginOperationalReports } = await import("./agent-hooks-CKaIOT4I.js").then((n) => n.t);
4104
4104
  return pluginOperationalReportFeedSchema.parse({
4105
4105
  source: "plugins",
4106
4106
  generatedAt: new Date(nowMs).toISOString(),
@@ -1,6 +1,6 @@
1
1
  import { t as ConversationStore } from "./store-DoewL5mG.js";
2
2
  import "./history-ClE4toxe.js";
3
- import { n as JuniorPluginSet } from "./plugins-BI9A1vKA.js";
3
+ import { n as JuniorPluginSet } from "./plugins-BT2l4We3.js";
4
4
  import { Hono } from "hono";
5
5
  import "@earendil-works/pi-ai/compat";
6
6
  import "@earendil-works/pi-ai/api/anthropic-messages";
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-D4nNdzPG.js";
2
- import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BI9A1vKA.js";
1
+ import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-BYD2Nyji.js";
2
+ import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BT2l4We3.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
4
4
  export { JUNIOR_VERSION, JuniorAppOptions, JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
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-CV4MPfCD.js";
2
- import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-ciJRmcY5.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-CHZ0aJXO.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-DFeJ0yVy.js";
2
+ import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-DVKLZG01.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-1iHJtqBM.js";
4
4
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
5
- import { t as JUNIOR_VERSION } from "./version-Es4nurl1.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-BMwzCmw-.js";
5
+ import { t as JUNIOR_VERSION } from "./version-CZfM8Kly.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-BXIOxlCK.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-BtGATjr2.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-CKaIOT4I.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-D0xETqi8.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-D_aAfzGp.js";
12
12
  import { W as instructionProvenanceFor } from "./conversation-BpqLg4MM.js";
13
- import { n as pluginCatalogRuntime } from "./catalog-runtime-LUAIHslF.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-CmkbGGiR.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-6veboDue.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-BvNqVRdB.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-HNSPyxoN.js";
18
- import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-DCj_cPjl.js";
13
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-v3x4peOv.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-Cc7ba7dw.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-B4e6XN37.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-BtMLD1n8.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-B2qOCIx1.js";
18
+ import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-DifJddqY.js";
19
19
  import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-DAoaq0CT.js";
20
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-DprAzyQN.js";
20
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-DugfbPdI.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-C8FZ3LSY.js";
22
+ import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DjgMEeqJ.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-Dy7SUhLv.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-CGkLLzS9.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-CZjYeCFh.js";
27
- import { u as recordAutomationExecution } from "./execution-stats-C-E5FIsT.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-BH5M3JHb.js";
29
- import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-DTqDMGeD.js";
30
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CNsgouon.js";
31
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-mZIWtngI.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-Db98GdYL.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-C7GMUpb9.js";
34
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CbxNVEAg.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-BoWHpDBP.js";
36
- import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-DG2K_bpi.js";
37
- import { t as processConversationWork } from "./worker-BvuVxS4T.js";
38
- import { t as bindSpawnAgent } from "./spawn-BFzlrZae.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-CQrFGEv9.js";
27
+ import { u as recordAutomationExecution } from "./execution-stats-G61-pwq6.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-Bg2trvKT.js";
29
+ import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-lRFwhKJe.js";
30
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-ClF1kY55.js";
31
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-CgCTt4YP.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-D4zlHEq1.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-nAyuKldT.js";
34
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-a2aXjkx2.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-BOcckr3l.js";
36
+ import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-DCSwmiua.js";
37
+ import { t as processConversationWork } from "./worker-BV4FekSX.js";
38
+ import { t as bindSpawnAgent } from "./spawn-BmZvmNYc.js";
39
39
  import { createRequire } from "node:module";
40
40
  import { pathToFileURL } from "node:url";
41
41
  import { Hono } from "hono";
@@ -1,10 +1,10 @@
1
- import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-ciJRmcY5.js";
2
- import { t as buildTurnFailureResponse } from "./logging-CHZ0aJXO.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-DVKLZG01.js";
2
+ import { t as buildTurnFailureResponse } from "./logging-1iHJtqBM.js";
3
3
  import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
- import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-CmkbGGiR.js";
5
- import { qt as buildDeterministicTurnId } from "./stats-BvNqVRdB.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-HNSPyxoN.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Db98GdYL.js";
4
+ import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-Cc7ba7dw.js";
5
+ import { qt as buildDeterministicTurnId } from "./stats-BtMLD1n8.js";
6
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-B2qOCIx1.js";
7
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-D4zlHEq1.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) {
@@ -1,4 +1,4 @@
1
- import { r as completeObject } from "./client-ciJRmcY5.js";
1
+ import { r as completeObject } from "./client-DVKLZG01.js";
2
2
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
3
3
  import { N as parseBriefInput, d as conversationDetailReportSchema, k as briefCodeChangeSchema, p as conversationEventPageSchema } from "./conversation-BpqLg4MM.js";
4
4
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DAoaq0CT.js";
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
269
269
  * `DATABASE_URL` at import, and `briefs pull` must work with only a token.
270
270
  */
271
271
  async function configuredDefaultModelId() {
272
- const { botConfig } = await import("./config-BMwzCmw-.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-BXIOxlCK.js").then((n) => n.r);
273
273
  return defaultModelId(botConfig);
274
274
  }
275
275
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-DR6TJe4J.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-C0DT9wqc.js";
3
3
  //#region src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();