@sentry/junior 0.207.0 → 0.209.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 (49) hide show
  1. package/dist/{agent-CmQlX68D.js → agent-B_tHeZp6.js} +17 -17
  2. package/dist/{agent-hooks-BBX9p6aG.js → agent-hooks-DDJGkqlR.js} +129 -7
  3. package/dist/{agent-runner-CQD4HKK2.js → agent-runner-CPBSl1Xv.js} +5 -5
  4. package/dist/api.js +15 -15
  5. package/dist/app.js +29 -29
  6. package/dist/{auth-pause-state-uv8on6cT.js → auth-pause-state-BZqtr-GX.js} +6 -6
  7. package/dist/{briefs-BXEmjD9D.js → briefs-ZLRkWQQn.js} +2 -2
  8. package/dist/{catalog-runtime-1BZEOR8J.js → catalog-runtime-D89PJa84.js} +1 -1
  9. package/dist/{checkpoint-B-JO5F3c.js → checkpoint-DBX1KyOb.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-Bp297GA0.js → client-7_NmRtoz.js} +54 -6
  17. package/dist/{config-G2gv97R1.js → config-BPGL4uP-.js} +5 -5
  18. package/dist/{conversation-privacy-BUfel19D.js → conversation-privacy-CgtRvwq8.js} +1 -1
  19. package/dist/{credential-sync-D04NWqMR.js → credential-sync-DCYT7j8m.js} +20 -20
  20. package/dist/{execution-stats-Ds4bSvam.js → execution-stats-CyehCrCF.js} +4 -4
  21. package/dist/{executor-BZu1Ta06.js → executor-ctvBB7kO.js} +32 -3
  22. package/dist/instrumentation.js +2 -2
  23. package/dist/{job-queue-rnAPfUhP.js → job-queue-C1lIZ7DE.js} +1 -1
  24. package/dist/{logging-Dx0S5k2z.js → logging-CHzH6JFD.js} +1 -1
  25. package/dist/nitro.js +3 -3
  26. package/dist/{oauth-callback-server-xGpwURIj.js → oauth-callback-server-DQvCkP93.js} +2 -2
  27. package/dist/{pending-auth-DIZ4iZjS.js → pending-auth-D6c_jWmW.js} +2 -2
  28. package/dist/{profile-d-fKypxo.js → profile-DPAFjrER.js} +4 -4
  29. package/dist/{registry-CWKdLCTG.js → registry-vUqDWPNS.js} +1 -1
  30. package/dist/{resolve-BhRB1s2A.js → resolve-CToO52ls.js} +2 -2
  31. package/dist/{runner-DNml3owD.js → runner-D3KdCdDY.js} +9 -9
  32. package/dist/{sandbox-egress-signals-DUIl3-gW.js → sandbox-egress-signals-C_zy8cZG.js} +1 -1
  33. package/dist/{skills-D9WesdJJ.js → skills-BszTHE4F.js} +2 -2
  34. package/dist/{spawn-Eh_3-s0M.js → spawn-v7JJowIu.js} +2 -2
  35. package/dist/{stats-CFlUGqVA.js → stats-t0wuykQW.js} +39 -31
  36. package/dist/{task-queue-D8I1_5wP.js → task-queue-TyHaXCpO.js} +3 -3
  37. package/dist/{task-runner-DO79gdho.js → task-runner-DVDa7fAI.js} +7 -7
  38. package/dist/{thread-state-DD6BA4xz.js → thread-state-DB_913ic.js} +5 -5
  39. package/dist/{turn-execution-BSIHxmQJ.js → turn-execution-BRd4mQlB.js} +3 -3
  40. package/dist/{turn-lifecycle-DSBK4Ars.js → turn-lifecycle-CoNJoE-n.js} +1 -1
  41. package/dist/{usage-WRXkNOHp.js → usage-D5t1yT3R.js} +2 -2
  42. package/dist/{validation-BbHZ4r4S.js → validation-sI1EnNoM.js} +1 -1
  43. package/dist/{version-C71UcRWw.js → version-BrgX_LoI.js} +1 -1
  44. package/dist/version.js +1 -1
  45. package/dist/{web-authorization-C73gJV7l.js → web-authorization-BNCTTM5f.js} +1 -1
  46. package/dist/{web-input-Ce1FcNIM.js → web-input-NEbUfS0Q.js} +5 -107
  47. package/dist/{work-BEzDU_2x.js → work-Dv5SHQ4C.js} +9 -9
  48. package/dist/{worker-MK2ubOv-.js → worker-1GzySfPG.js} +15 -10
  49. package/package.json +6 -6
@@ -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-Bp297GA0.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-Dx0S5k2z.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-7_NmRtoz.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-CHzH6JFD.js";
3
3
  import { _ as withActiveSpan, m as startInactiveSpan } from "./sentry-CD3SdJl-.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-BUfel19D.js";
5
- import { h as normalizeSlackEmojiName, n as botConfig } from "./config-G2gv97R1.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-CgtRvwq8.js";
5
+ import { h as normalizeSlackEmojiName, n as botConfig } from "./config-BPGL4uP-.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, Ft as getConversationStore, It as getDb, J as withSlackRetries, K as normalizeSlackConversationId, Lt as getSqlExecutor, M as resolveChannelCapabilities, Nt as getConversationEventStore, O as deleteWorkspaceSnapshotBuilders, Pt as getConversationMessageSearchStore, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, V as getFilePermalink, W as isConversationScopedChannel, Xt as parseDestination, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-BBX9p6aG.js";
8
+ import { A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, Gt as getDb, Ht as getConversationEventStore, J as withSlackRetries, K as normalizeSlackConversationId, Kt as getSqlExecutor, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as getConversationMessageSearchStore, V as getFilePermalink, W as isConversationScopedChannel, Wt as getConversationStore, _ as deleteWorkspace, an as parseDestination, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bt as createPluginLogger, c as getPluginTools, dt as findMatchingWatches, ft as listWatches, g as createWorkspace, ht as getDashboardTaskLink, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createWatch, mt as getDashboardConversationLink, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, r as createPluginHookRunner, s as getPluginSystemPromptContributions, st as cancelWatch, tt as getSlackToolContext, u as getPlugins, ut as deliverWatch, v as getWorkspace, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-DDJGkqlR.js";
9
9
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
10
- import { D as juniorArtifacts, S as juniorAttachments, T as juniorIdentities, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, w as juniorConversations, y as juniorConversationAnnotations } from "./executor-BZu1Ta06.js";
10
+ import { D as juniorArtifacts, S as juniorAttachments, T as juniorIdentities, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, w as juniorConversations, y as juniorConversationAnnotations } from "./executor-ctvBB7kO.js";
11
11
  import { A as briefLinkSchema, F as KNOWN_CONVERSATION_EVENT_TYPES, G as instructionProvenanceFor, K as sameActorIdentity, M as conversationBriefSchema, U as contextProvenance, W as instructionActors, j as briefOutcomeStatusSchema } from "./conversation-AA4R1VUn.js";
12
12
  import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
13
- import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-CWKdLCTG.js";
14
- import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
15
- import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-D9WesdJJ.js";
16
- import { A as normalizeToLf$1, At as retainRuntimeTurnContext, B as openConversationProjection, C as DEFAULT_SEARCH_COMMAND_TIMEOUT_MS, Ct as hasRuntimeTurnContext, D as getRipgrepSearchLocation, Dt as isToolResultError, E as collectFiles, Et as isContinuablePiBoundary, G as recordAuthorizationRequested, H as recordAttachmentsDelivered, I as loadConnectedMcpProviders, K as recordGuardianActionReviewed, L as loadConversationProjection, M as resolveWorkspacePath, Mt as trimTrailingAssistantMessages, N as truncateText$1, Nt as TURN_CONTEXT_TAG, O as isMissingPathError, Ot as isToolResultMessage, S as resolveRepositoryInstructionsForDirectories, St as getUserMessageInstructionText, T as RIPGREP_EXCLUDED_GLOBS, Tt as isAssistantMessage, V as recordAgentsInstructionsUpdated, X as recordTurnRoute, Y as recordToolExecutionStarted, _ as AGENTS_REPLACEMENT_NOTICE, _t as historyItemFromPiMessage, b as listRepositoryDirectories, bt as getPiMessageRole, f as TurnSliceLimitExceededError, g as AGENTS_REMOVAL_NOTICE, gt as getAgentContextInputLimitTokens, h as isTurnExecutionLimitExceededError, ht as getAgentContextCompactionTriggerTokens, j as positiveInteger$1, jt as stripRuntimeTurnContext, k as missingPathSearchResult, kt as normalizeToolNameFromResult, mt as estimateTextTokens, n as loadTurnCheckpoint, p as assertTurnToolCallLimit, q as recordMcpProviderConnected, r as saveTurnCheckpoint, t as continuableMessages, v as buildAgentsInstructionsMessage, vt as piMessageFromHistoryItem, w as MAX_TEXT_CHARS, x as renderAgentsInstructions, xt as getTerminalAssistantMessages, y as findVisibleAgentsInstructions, yt as extractAssistantText, z as loadTurnRoute } from "./checkpoint-B-JO5F3c.js";
17
- import { a as hasAgentTurnUsage, c as generateShortTitle, l as resolveTaskTitle, o as ToolInputError, t as addAgentTurnUsage } from "./usage-WRXkNOHp.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-d-fKypxo.js";
19
- import { $ as workspaceSnapshotFinishedEvent, B as createEventAutomation, C as SCHEDULED_AUTOMATION_SYSTEM_ACTOR, D as eventAutomationMatchesDestination, E as eventAutomationListToolResultSchema, F as effectiveTaskOutcomes, Ht as injectContinuationToolName, I as moveTaskOutcomes, L as resolveTaskOutcomes, M as requireEventAutomationSlackContext, N as requireSupportedEventAutomationTrigger, O as eventAutomationToolResult, P as writableEventAutomation, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventAutomation, Ut as juniorToolOutputSchema, V as deleteEventAutomation, W as getEventAutomation, Wt as makeStructuredToolOutput, 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-CFlUGqVA.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-DIZ4iZjS.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-CQD4HKK2.js";
13
+ import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-vUqDWPNS.js";
14
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D89PJa84.js";
15
+ import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-BszTHE4F.js";
16
+ import { A as normalizeToLf$1, At as retainRuntimeTurnContext, B as openConversationProjection, C as DEFAULT_SEARCH_COMMAND_TIMEOUT_MS, Ct as hasRuntimeTurnContext, D as getRipgrepSearchLocation, Dt as isToolResultError, E as collectFiles, Et as isContinuablePiBoundary, G as recordAuthorizationRequested, H as recordAttachmentsDelivered, I as loadConnectedMcpProviders, K as recordGuardianActionReviewed, L as loadConversationProjection, M as resolveWorkspacePath, Mt as trimTrailingAssistantMessages, N as truncateText$1, Nt as TURN_CONTEXT_TAG, O as isMissingPathError, Ot as isToolResultMessage, S as resolveRepositoryInstructionsForDirectories, St as getUserMessageInstructionText, T as RIPGREP_EXCLUDED_GLOBS, Tt as isAssistantMessage, V as recordAgentsInstructionsUpdated, X as recordTurnRoute, Y as recordToolExecutionStarted, _ as AGENTS_REPLACEMENT_NOTICE, _t as historyItemFromPiMessage, b as listRepositoryDirectories, bt as getPiMessageRole, f as TurnSliceLimitExceededError, g as AGENTS_REMOVAL_NOTICE, gt as getAgentContextInputLimitTokens, h as isTurnExecutionLimitExceededError, ht as getAgentContextCompactionTriggerTokens, j as positiveInteger$1, jt as stripRuntimeTurnContext, k as missingPathSearchResult, kt as normalizeToolNameFromResult, mt as estimateTextTokens, n as loadTurnCheckpoint, p as assertTurnToolCallLimit, q as recordMcpProviderConnected, r as saveTurnCheckpoint, t as continuableMessages, v as buildAgentsInstructionsMessage, vt as piMessageFromHistoryItem, w as MAX_TEXT_CHARS, x as renderAgentsInstructions, xt as getTerminalAssistantMessages, y as findVisibleAgentsInstructions, yt as extractAssistantText, z as loadTurnRoute } from "./checkpoint-DBX1KyOb.js";
17
+ import { a as hasAgentTurnUsage, c as generateShortTitle, l as resolveTaskTitle, o as ToolInputError, t as addAgentTurnUsage } from "./usage-D5t1yT3R.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-DPAFjrER.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, 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-t0wuykQW.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-D6c_jWmW.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-CPBSl1Xv.js";
22
22
  import { r as EVENT_AUTHOR_ID } from "./prompt-x-0ZtTyb.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-BhRB1s2A.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-CToO52ls.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-rnAPfUhP.js";
25
+ import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-C1lIZ7DE.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";
@@ -1,19 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { a as embedTexts, r as completeObject } from "./client-Bp297GA0.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-Dx0S5k2z.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-7_NmRtoz.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-CHzH6JFD.js";
4
4
  import { a as getClient$1 } from "./sentry-CD3SdJl-.js";
5
- import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-G2gv97R1.js";
5
+ import { t as canExposeConversationPayload } from "./conversation-privacy-CgtRvwq8.js";
6
+ import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-BPGL4uP-.js";
6
7
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
7
8
  import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-Bplcgypl.js";
8
9
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-BZu1Ta06.js";
10
+ import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-ctvBB7kO.js";
10
11
  import { B as decodeStoredConversationEvent, C as conversationReportEventSchema, H as newConversationEventSchema, L as conversationEventDataSchema, M as conversationBriefSchema, N as parseBriefInput, V as historyReplacementSchema } from "./conversation-AA4R1VUn.js";
11
- 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-d-fKypxo.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-DPAFjrER.js";
12
13
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-x-0ZtTyb.js";
13
14
  import { AsyncLocalStorage } from "node:async_hooks";
14
15
  import { z } from "zod";
15
16
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
16
- import { and, arrayContains, asc, desc, eq, getTableColumns, gt, gte, inArray, isNotNull, isNull, lt, lte, max, ne, or, sql } from "drizzle-orm";
17
+ import { and, arrayContains, asc, desc, eq, exists, getTableColumns, gt, gte, inArray, isNotNull, isNull, lt, lte, max, ne, notExists, or, sql } from "drizzle-orm";
17
18
  import { codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, identitySchema, locationSchema, missingToolAnnotationKeys, normalizeEventIdentifier, pluginEventsSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey, userSchema } from "@sentry/junior-plugin-api";
18
19
  import { alias } from "drizzle-orm/pg-core";
19
20
  import { WebClient } from "@slack/web-api";
@@ -2504,6 +2505,126 @@ function renderPluginConversationEvent(args) {
2504
2505
  return definition.renderEvent(definition.parse(args.content));
2505
2506
  }
2506
2507
  //#endregion
2508
+ //#region src/api/conversations/membership.ts
2509
+ /** True when the viewer is a materialized participant on this root conversation. */
2510
+ function conversationHasParticipantUser(userId) {
2511
+ const participant = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorConversationParticipants.userId, userId)));
2512
+ return exists(participant);
2513
+ }
2514
+ /**
2515
+ * True when a verified primary-email user participates on this root
2516
+ * conversation. Used only for the actorEmail feed fallback.
2517
+ */
2518
+ function conversationHasParticipantEmail(email) {
2519
+ const participant = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorUsers.primaryEmailNormalized, email)));
2520
+ return exists(participant);
2521
+ }
2522
+ /** True when one user's personal feed has archived this root after the cutoff. */
2523
+ function conversationArchivedForUser(userId, archivedAfter) {
2524
+ const archive = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorConversationParticipants.userId, userId), isNotNull(juniorConversationParticipants.archivedAt), archivedAfter ? gte(juniorConversationParticipants.archivedAt, archivedAfter) : void 0));
2525
+ return exists(archive);
2526
+ }
2527
+ /** True when one user's personal feed has not archived this root. */
2528
+ function conversationNotArchivedForUser(userId) {
2529
+ const archive = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorConversationParticipants.userId, userId), isNotNull(juniorConversationParticipants.archivedAt)));
2530
+ return notExists(archive);
2531
+ }
2532
+ /** True when one primary-email user's feed archived this root after the cutoff. */
2533
+ function conversationArchivedForEmail(email, archivedAfter) {
2534
+ const archive = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorUsers.primaryEmailNormalized, email), isNotNull(juniorConversationParticipants.archivedAt), archivedAfter ? gte(juniorConversationParticipants.archivedAt, archivedAfter) : void 0));
2535
+ return exists(archive);
2536
+ }
2537
+ /** True when one primary-email user's personal feed has not archived this root. */
2538
+ function conversationNotArchivedForEmail(email) {
2539
+ const archive = getDb().select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(and(eq(juniorConversationParticipants.rootConversationId, juniorConversations.conversationId), eq(juniorUsers.primaryEmailNormalized, email), isNotNull(juniorConversationParticipants.archivedAt)));
2540
+ return notExists(archive);
2541
+ }
2542
+ /** Root-actor ownership or a materialized participant row for the same person. */
2543
+ function viewerConversationMembership(args) {
2544
+ if (args.actorMatch && args.participantMatch) return or(args.actorMatch, args.participantMatch);
2545
+ return args.actorMatch ?? args.participantMatch;
2546
+ }
2547
+ /** Read personal archive timestamps for a bounded set of conversation roots. */
2548
+ async function conversationArchiveTimes(db, conversationIds, subject) {
2549
+ if (!subject || conversationIds.length === 0) return /* @__PURE__ */ new Map();
2550
+ const query = db.select({
2551
+ archivedAt: juniorConversationParticipants.archivedAt,
2552
+ rootConversationId: juniorConversationParticipants.rootConversationId
2553
+ }).from(juniorConversationParticipants);
2554
+ const rows = "userId" in subject ? await query.where(and(eq(juniorConversationParticipants.userId, subject.userId), inArray(juniorConversationParticipants.rootConversationId, [...conversationIds]), isNotNull(juniorConversationParticipants.archivedAt))) : await query.innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(and(eq(juniorUsers.primaryEmailNormalized, subject.email), inArray(juniorConversationParticipants.rootConversationId, [...conversationIds]), isNotNull(juniorConversationParticipants.archivedAt)));
2555
+ return new Map(rows.flatMap((row) => row.archivedAt ? [[row.rootConversationId, row.archivedAt.getTime()]] : []));
2556
+ }
2557
+ /** Find which of the supplied roots include the linked viewer as a participant. */
2558
+ async function conversationIdsWithParticipantUser(db, conversationIds, userId) {
2559
+ if (conversationIds.length === 0) return /* @__PURE__ */ new Set();
2560
+ const rows = await db.select({ rootConversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants).where(and(eq(juniorConversationParticipants.userId, userId), inArray(juniorConversationParticipants.rootConversationId, [...conversationIds])));
2561
+ return new Set(rows.map((row) => row.rootConversationId));
2562
+ }
2563
+ //#endregion
2564
+ //#region src/api/conversations/access.ts
2565
+ const rootConversation = alias(juniorConversations, "access_root_conversation");
2566
+ const rootDestination = alias(juniorDestinations, "access_root_destination");
2567
+ const rootIdentity = alias(juniorIdentities, "access_root_identity");
2568
+ /** Resolve viewer access for a bounded set of persisted conversations. */
2569
+ async function readConversationAccessFromSql(db, conversationIds, viewer) {
2570
+ if (conversationIds.length === 0) return /* @__PURE__ */ new Map();
2571
+ const normalizedViewerEmail = viewer?.email.trim().toLowerCase() || void 0;
2572
+ const rows = await db.select({
2573
+ conversationId: juniorConversations.conversationId,
2574
+ parentConversationId: juniorConversations.parentConversationId,
2575
+ storedRootConversationId: juniorConversations.rootConversationId,
2576
+ rootConversationId: rootConversation.conversationId,
2577
+ rootParentConversationId: rootConversation.parentConversationId,
2578
+ rootRootConversationId: rootConversation.rootConversationId,
2579
+ visibility: rootDestination.visibility,
2580
+ rootEmailNormalized: rootIdentity.emailNormalized,
2581
+ rootEmailVerified: rootIdentity.emailVerified,
2582
+ rootUserId: rootIdentity.userId
2583
+ }).from(juniorConversations).leftJoin(rootConversation, eq(rootConversation.conversationId, juniorConversations.rootConversationId)).leftJoin(rootDestination, eq(rootDestination.id, rootConversation.destinationId)).leftJoin(rootIdentity, eq(rootIdentity.id, rootConversation.actorIdentityId)).where(inArray(juniorConversations.conversationId, [...conversationIds]));
2584
+ const membershipConversationIds = /* @__PURE__ */ new Set();
2585
+ for (const row of rows) {
2586
+ membershipConversationIds.add(row.conversationId);
2587
+ if (row.storedRootConversationId) membershipConversationIds.add(row.storedRootConversationId);
2588
+ }
2589
+ const participantRootIds = viewer !== void 0 ? await conversationIdsWithParticipantUser(db, [...membershipConversationIds], viewer.id) : /* @__PURE__ */ new Set();
2590
+ return new Map(rows.map((row) => {
2591
+ const validRootConversationId = row.rootConversationId !== null && row.rootConversationId === row.storedRootConversationId && row.rootRootConversationId === row.rootConversationId && row.rootParentConversationId === null && (row.parentConversationId !== null || row.storedRootConversationId === row.conversationId) ? row.rootConversationId ?? void 0 : void 0;
2592
+ const visibility = validRootConversationId === void 0 ? null : row.visibility;
2593
+ const isRootActor = validRootConversationId !== void 0 && viewer !== void 0 && (row.rootUserId === viewer.id || normalizedViewerEmail !== void 0 && row.rootEmailVerified === true && row.rootEmailNormalized === normalizedViewerEmail);
2594
+ const isMaterializedParticipant = participantRootIds.has(row.conversationId) || validRootConversationId !== void 0 && participantRootIds.has(validRootConversationId);
2595
+ const isParticipant = isRootActor || isMaterializedParticipant;
2596
+ const canViewPrivateContent = isParticipant || validRootConversationId !== void 0 && canExposeConversationPayload({ visibility: visibility ?? void 0 });
2597
+ return [row.conversationId, {
2598
+ canViewPrivateContent,
2599
+ isParticipant,
2600
+ visibility
2601
+ }];
2602
+ }));
2603
+ }
2604
+ //#endregion
2605
+ //#region src/chat/plugins/conversation-event-reader.ts
2606
+ function registeredEventName$1(plugin, eventName) {
2607
+ if (!plugin.conversationEvents?.some((definition) => definition.eventName === eventName)) throw new TypeError(`Plugin "${plugin.manifest.name}" did not register event "${eventName}"`);
2608
+ return eventName;
2609
+ }
2610
+ /** Create Conversation event reads bound to one plugin namespace. */
2611
+ function createPluginConversationEventReader(plugin) {
2612
+ return { async list(input) {
2613
+ const eventName = registeredEventName$1(plugin, input.eventName);
2614
+ const db = getDb();
2615
+ if (!(await readConversationAccessFromSql(db, [input.conversationId], input.viewer)).get(input.conversationId)?.canViewPrivateContent) return void 0;
2616
+ return (await db.select({
2617
+ content: sql`${juniorConversationEvents.payload}->'content'`,
2618
+ createdAt: juniorConversationEvents.createdAt,
2619
+ version: sql`(${juniorConversationEvents.payload}->>'version')::integer`
2620
+ }).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, input.conversationId), eq(juniorConversationEvents.type, "structured_event"), sql`${juniorConversationEvents.payload}->>'namespace' = ${plugin.manifest.name}`, sql`${juniorConversationEvents.payload}->>'name' = ${eventName}`)).orderBy(desc(juniorConversationEvents.seq))).map((row) => ({
2621
+ content: row.content,
2622
+ createdAt: row.createdAt.toISOString(),
2623
+ version: row.version
2624
+ }));
2625
+ } };
2626
+ }
2627
+ //#endregion
2507
2628
  //#region src/chat/plugins/conversation-event-stats.ts
2508
2629
  const DAY_MS = 864e5;
2509
2630
  const costRowSchema = z.object({
@@ -4723,6 +4844,7 @@ function getPluginApiRoutes() {
4723
4844
  if (!hook) continue;
4724
4845
  const app = hook({
4725
4846
  ...basePluginContext(plugin),
4847
+ conversationEvents: createPluginConversationEventReader(plugin),
4726
4848
  eventStats: createPluginConversationEventStats(plugin),
4727
4849
  users: { resolve: resolveViewerUser }
4728
4850
  });
@@ -5110,4 +5232,4 @@ function createPluginHookRunner(input = {}) {
5110
5232
  };
5111
5233
  }
5112
5234
  //#endregion
5113
- export { resolveViewerUser as $, tryWorkspaceRepoCheckoutPath as A, authenticationLinkedEvent as At, downloadPrivateSlackFile as B, sanitizePostgresJson as Bt, invalidateReadySnapshot as C, readConversationEventPage as Ct, SANDBOX_RUNTIME as D, listConversationAnnotationsById as Dt, setWorkspaceSnapshotBuild as E, listConversationAnnotations as Et, bindSlackDirectCredentialSubject as F, getConversationStore as Ft, isDmChannel as G, resolveRootConversationId as Gt, getHeaderString as H, locationFromRow as Ht, verifyEventAutomationCredentialSubject as I, getDb as It, withSlackRetries as J, upsertLinkedIdentity as Jt, normalizeSlackConversationId as K, deleteProviderIdentityForSlackUser as Kt, verifyScheduledAutomationCredentialSubject as L, getSqlExecutor as Lt, resolveChannelCapabilities as M, db_exports as Mt, bindEventAutomationCredentialSubject as N, getConversationEventStore as Nt, deleteWorkspaceSnapshotBuilders as O, JUNIOR_NATIVE_EVENT_NAMESPACE as Ot, bindScheduledAutomationCredentialSubject as P, getConversationMessageSearchStore as Pt, readActorIdentity as Q, sameDestination as Qt, verifySlackDirectCredentialSubject as R, createSqlConversationEventStore as Rt, WorkspaceValidationError as S, readLatestConversationBrief as St, setWorkspaceSnapshot as T, resolveRootVisibility as Tt, getSlackClient as U, bindProviderConversation as Ut, getFilePermalink as V, withConversationMutationLock as Vt, isConversationScopedChannel as W, parseSessionSource as Wt, runWithWorkspaceTeamId as X, parseDestination as Xt, getWorkspaceTeamId as Y, createSlackDestination as Yt, findUserByEmail as Z, requireSlackDestination as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, collectEventMatchKeys as ct, setPlugins as d, findMatchingWatches as dt, updateViewerDisplayName as et, validatePlugins as f, listWatches as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, authenticationUnlinkedEvent as jt, getWorkspaceSnapshotBuilder as k, agentsInstructionsUpdatedEvent as kt, getPluginUserPromptContributions as l, createWatch as lt, registration_exports as m, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, cancelSubscriptions as ot, coreTaskRegistrations as p, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, upsertIdentity as qt, createPluginHookRunner as r, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, cancelWatch as st, agent_hooks_exports as t, getSlackToolContext as tt, getPlugins as u, deliverWatch as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, buildSentryConversationUrl as wt, updateWorkspace as x, createPluginConversationEvents as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, withConversationEventLock as zt };
5235
+ export { resolveViewerUser as $, parseSessionSource as $t, tryWorkspaceRepoCheckoutPath as A, createPluginConversationEvents as At, downloadPrivateSlackFile as B, authenticationUnlinkedEvent as Bt, invalidateReadySnapshot as C, conversationArchivedForEmail as Ct, SANDBOX_RUNTIME as D, conversationNotArchivedForEmail as Dt, setWorkspaceSnapshotBuild as E, conversationHasParticipantUser as Et, bindSlackDirectCredentialSubject as F, listConversationAnnotations as Ft, isDmChannel as G, getDb as Gt, getHeaderString as H, getConversationEventStore as Ht, verifyEventAutomationCredentialSubject as I, listConversationAnnotationsById as It, withSlackRetries as J, withConversationEventLock as Jt, normalizeSlackConversationId as K, getSqlExecutor as Kt, verifyScheduledAutomationCredentialSubject as L, JUNIOR_NATIVE_EVENT_NAMESPACE as Lt, resolveChannelCapabilities as M, readConversationEventPage as Mt, bindEventAutomationCredentialSubject as N, buildSentryConversationUrl as Nt, deleteWorkspaceSnapshotBuilders as O, conversationNotArchivedForUser as Ot, bindScheduledAutomationCredentialSubject as P, resolveRootVisibility as Pt, readActorIdentity as Q, bindProviderConversation as Qt, verifySlackDirectCredentialSubject as R, agentsInstructionsUpdatedEvent as Rt, WorkspaceValidationError as S, conversationArchiveTimes as St, setWorkspaceSnapshot as T, conversationHasParticipantEmail as Tt, getSlackClient as U, getConversationMessageSearchStore as Ut, getFilePermalink as V, db_exports as Vt, isConversationScopedChannel as W, getConversationStore as Wt, runWithWorkspaceTeamId as X, withConversationMutationLock as Xt, getWorkspaceTeamId as Y, sanitizePostgresJson as Yt, findUserByEmail as Z, locationFromRow as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, parseDestination as an, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, collectEventMatchKeys as ct, setPlugins as d, findMatchingWatches as dt, resolveRootConversationId as en, updateViewerDisplayName as et, validatePlugins as f, listWatches as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, createSlackDestination as in, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, readLatestConversationBrief as jt, getWorkspaceSnapshotBuilder as k, viewerConversationMembership as kt, getPluginUserPromptContributions as l, createWatch as lt, registration_exports as m, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, upsertIdentity as nn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, requireSlackDestination as on, cancelSubscriptions as ot, coreTaskRegistrations as p, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, createSqlConversationEventStore as qt, createPluginHookRunner as r, upsertLinkedIdentity as rn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, sameDestination as sn, cancelWatch as st, agent_hooks_exports as t, deleteProviderIdentityForSlackUser as tn, getSlackToolContext as tt, getPlugins as u, deliverWatch as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, conversationArchivedForUser as wt, updateWorkspace as x, readConversationAccessFromSql as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, authenticationLinkedEvent as zt };
@@ -1,9 +1,9 @@
1
- import { F as isRecord, d as logInfo, f as logWarn } from "./logging-Dx0S5k2z.js";
2
- import { h as normalizeSlackEmojiName } from "./config-G2gv97R1.js";
1
+ import { F as isRecord, d as logInfo, f as logWarn } from "./logging-CHzH6JFD.js";
2
+ import { h as normalizeSlackEmojiName } from "./config-BPGL4uP-.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, Xt as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-BBX9p6aG.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
6
- import { w as getStateAdapter } from "./profile-d-fKypxo.js";
4
+ import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, an as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-DDJGkqlR.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D89PJa84.js";
6
+ import { w as getStateAdapter } from "./profile-DPAFjrER.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-Dx0S5k2z.js";
1
+ import { f as logWarn, u as logException } from "./logging-CHzH6JFD.js";
2
2
  import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
3
- import { $ as resolveViewerUser, Ct as readConversationEventPage, D as SANDBOX_RUNTIME, Dt as listConversationAnnotationsById, Et as listConversationAnnotations, Ft as getConversationStore, Gt as resolveRootConversationId, Ht as locationFromRow, It as getDb, J as withSlackRetries, Lt as getSqlExecutor, S as WorkspaceValidationError, St as readLatestConversationBrief, U as getSlackClient, Wt as parseSessionSource, Z as findUserByEmail, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, u as getPlugins, v as getWorkspace, wt as buildSentryConversationUrl, x as updateWorkspace } from "./agent-hooks-BBX9p6aG.js";
3
+ import { $ as resolveViewerUser, $t as parseSessionSource, Ct as conversationArchivedForEmail, D as SANDBOX_RUNTIME, Dt as conversationNotArchivedForEmail, Et as conversationHasParticipantUser, Ft as listConversationAnnotations, Gt as getDb, It as listConversationAnnotationsById, J as withSlackRetries, Kt as getSqlExecutor, Mt as readConversationEventPage, Nt as buildSentryConversationUrl, Ot as conversationNotArchivedForUser, S as WorkspaceValidationError, St as conversationArchiveTimes, Tt as conversationHasParticipantEmail, U as getSlackClient, Wt as getConversationStore, Z as findUserByEmail, Zt as locationFromRow, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, en as resolveRootConversationId, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, jt as readLatestConversationBrief, kt as viewerConversationMembership, u as getPlugins, v as getWorkspace, wt as conversationArchivedForUser, x as updateWorkspace, xt as readConversationAccessFromSql } from "./agent-hooks-DDJGkqlR.js";
4
4
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
5
- import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-BZu1Ta06.js";
5
+ import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-ctvBB7kO.js";
6
6
  import { D as createConversationBodySchema, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-AA4R1VUn.js";
7
- import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, s as fallbackShortTitle } from "./usage-WRXkNOHp.js";
8
- import { n as hash, t as create } from "./profile-d-fKypxo.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-CFlUGqVA.js";
10
- import { t as getCachedSnapshot } from "./resolve-BhRB1s2A.js";
7
+ import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, s as fallbackShortTitle } from "./usage-D5t1yT3R.js";
8
+ import { n as hash, t as create } from "./profile-DPAFjrER.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-t0wuykQW.js";
10
+ import { t as getCachedSnapshot } from "./resolve-CToO52ls.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 { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, T as readHealthReport, _ as formatSlackConversationRedactedLabel, a as webActorFromEmail, b as resolveSlackConversationContextFromThreadId, c as conversationArchivedForEmail, d as conversationHasParticipantUser, f as conversationNotArchivedForEmail, l as conversationArchivedForUser, m as viewerConversationMembership, o as readConversationAccessFromSql, p as conversationNotArchivedForUser, r as createAndEnqueueConversation, s as conversationArchiveTimes, t as appendAndEnqueueWebMessage, u as conversationHasParticipantEmail, x as lookupSlackUser } from "./web-input-Ce1FcNIM.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-Ds4bSvam.js";
15
- import { r as getWebAuthorization } from "./web-authorization-C73gJV7l.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-NEbUfS0Q.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-CyehCrCF.js";
15
+ import { r as getWebAuthorization } from "./web-authorization-BNCTTM5f.js";
16
16
  import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, J as HOUR_MS$1, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, Q as startOfUtcHour, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, X as fillUtcHours, Y as fillUtcDays, Z as fillUtcSixHours, _ as automationRunListSchema, a as workspaceBodySchema, at as apiErrorSchema, et as trailingUtcDayWindow, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, tt as trailingUtcHourWindow, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-CwTeb-BF.js";
17
17
  import { Hono } from "hono";
18
18
  import path from "node:path";
@@ -3409,7 +3409,7 @@ async function readPeoplePluginReports(args) {
3409
3409
  reports: [],
3410
3410
  source: "plugins"
3411
3411
  });
3412
- const { getPluginProfileReports } = await import("./agent-hooks-BBX9p6aG.js").then((n) => n.t);
3412
+ const { getPluginProfileReports } = await import("./agent-hooks-DDJGkqlR.js").then((n) => n.t);
3413
3413
  return pluginOperationalReportFeedSchema.parse({
3414
3414
  generatedAt: new Date(nowMs).toISOString(),
3415
3415
  reports: await getPluginProfileReports({
@@ -4018,7 +4018,7 @@ function readDescriptionText(home) {
4018
4018
  }
4019
4019
  /** Read discovered skill names for authenticated runtime diagnostics. */
4020
4020
  async function readSkillReports() {
4021
- const { discoverSkills } = await import("./skills-D9WesdJJ.js").then((n) => n.o);
4021
+ const { discoverSkills } = await import("./skills-BszTHE4F.js").then((n) => n.o);
4022
4022
  const skills = await discoverSkills();
4023
4023
  return skillReportsSchema.parse(skills.map((skill) => ({
4024
4024
  name: skill.name,
@@ -4027,7 +4027,7 @@ async function readSkillReports() {
4027
4027
  }
4028
4028
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4029
4029
  async function readPlugins() {
4030
- const { pluginCatalogRuntime } = await import("./catalog-runtime-1BZEOR8J.js").then((n) => n.t);
4030
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-D89PJa84.js").then((n) => n.t);
4031
4031
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4032
4032
  configKeys: plugin.manifest.configKeys ?? [],
4033
4033
  description: plugin.manifest.description,
@@ -4039,7 +4039,7 @@ async function readPlugins() {
4039
4039
  async function readRuntimeInfoReport() {
4040
4040
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4041
4041
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
4042
- import("./catalog-runtime-1BZEOR8J.js").then((n) => n.t),
4042
+ import("./catalog-runtime-D89PJa84.js").then((n) => n.t),
4043
4043
  readPlugins(),
4044
4044
  readSkillReports()
4045
4045
  ]);
@@ -4056,7 +4056,7 @@ async function readRuntimeInfoReport() {
4056
4056
  /** Read sanitized operational summaries contributed by plugins. */
4057
4057
  async function readPluginOperationalReportFeed() {
4058
4058
  const nowMs = Date.now();
4059
- const { getPluginOperationalReports } = await import("./agent-hooks-BBX9p6aG.js").then((n) => n.t);
4059
+ const { getPluginOperationalReports } = await import("./agent-hooks-DDJGkqlR.js").then((n) => n.t);
4060
4060
  return pluginOperationalReportFeedSchema.parse({
4061
4061
  source: "plugins",
4062
4062
  generatedAt: new Date(nowMs).toISOString(),
package/dist/app.js CHANGED
@@ -1,41 +1,41 @@
1
- import { $ as shouldEmitDevAgentTrace, B as resolveSandboxEgressProviderForHost, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as consumeSandboxEgressAuthRequiredSignal, H as shouldPropagateSandboxEgressTrace, I as isEventMailboxMetadata, K as consumeSandboxEgressPermissionDeniedSignal, L as renderTaskInput, P as processWorkspaceSnapshotJob, Q as AuthorizationFlowDisabledError, R as maybePostAutomatedTurnLimitNotice, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as SANDBOX_EGRESS_PROXY_PATH, V as normalizeSandboxEgressTracePropagationDomains, W as clearSandboxEgressSignals, X as buildSteeringPiMessage, Y as createUserTokenStore, Z as isVisionImageMediaType, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as getConfigDefaults, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestReportedProgress, n as createContextCompactor, o as deleteMcpAuthSessionsForUserProvider, q as parseSandboxEgressCredentialToken, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as setConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as recordFinishedTurnForAutomatedLimit } from "./agent-CmQlX68D.js";
2
- import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-Bp297GA0.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-Dx0S5k2z.js";
1
+ import { $ as shouldEmitDevAgentTrace, B as resolveSandboxEgressProviderForHost, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as consumeSandboxEgressAuthRequiredSignal, H as shouldPropagateSandboxEgressTrace, I as isEventMailboxMetadata, K as consumeSandboxEgressPermissionDeniedSignal, L as renderTaskInput, P as processWorkspaceSnapshotJob, Q as AuthorizationFlowDisabledError, R as maybePostAutomatedTurnLimitNotice, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as SANDBOX_EGRESS_PROXY_PATH, V as normalizeSandboxEgressTracePropagationDomains, W as clearSandboxEgressSignals, X as buildSteeringPiMessage, Y as createUserTokenStore, Z as isVisionImageMediaType, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as getConfigDefaults, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestReportedProgress, n as createContextCompactor, o as deleteMcpAuthSessionsForUserProvider, q as parseSandboxEgressCredentialToken, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as setConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as recordFinishedTurnForAutomatedLimit } from "./agent-B_tHeZp6.js";
2
+ import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-7_NmRtoz.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-CHzH6JFD.js";
4
4
  import { r as continueTrace } from "./sentry-CD3SdJl-.js";
5
- import { t as JUNIOR_VERSION } from "./version-C71UcRWw.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-G2gv97R1.js";
5
+ import { t as JUNIOR_VERSION } from "./version-BrgX_LoI.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-BPGL4uP-.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, Ft as getConversationStore, G as isDmChannel, I as verifyEventAutomationCredentialSubject, It as getDb, K as normalizeSlackConversationId, Kt as deleteProviderIdentityForSlackUser, L as verifyScheduledAutomationCredentialSubject, Lt as getSqlExecutor, N as bindEventAutomationCredentialSubject, Nt as getConversationEventStore, P as bindScheduledAutomationCredentialSubject, R as verifySlackDirectCredentialSubject, Tt as resolveRootVisibility, U as getSlackClient, Vt as withConversationMutationLock, X as runWithWorkspaceTeamId, Y as getWorkspaceTeamId, Yt as createSlackDestination, Zt as requireSlackDestination, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, u as getPlugins, z as SlackActionError, zt as withConversationEventLock } from "./agent-hooks-BBX9p6aG.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, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, in as createSlackDestination, on as requireSlackDestination, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, tn as deleteProviderIdentityForSlackUser, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-DDJGkqlR.js";
10
10
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
11
- import { _ as juniorConversationEvents, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, w as juniorConversations } from "./executor-BZu1Ta06.js";
11
+ import { _ as juniorConversationEvents, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, w as juniorConversations } from "./executor-ctvBB7kO.js";
12
12
  import { G as instructionProvenanceFor } from "./conversation-AA4R1VUn.js";
13
- import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
14
- import { $ as persistConversationMessages, F as commitMessages, J as recordSubscribedReplyRoute, L as loadConversationProjection, Mt as trimTrailingAssistantMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, Z as appendConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as getTurnRecordForResume, ct as isHumanConversationMessage, d as persistWithRetry, dt as recordDeliveredAssistantMessage, et as projectConversationMessages, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, jt as stripRuntimeTurnContext, l as listTurnSummaries, lt as markConversationMessage, m as buildTurnErrorResponse, mt as estimateTextTokens, n as loadTurnCheckpoint, nt as resolveConversationTitle, o as failTurnRecord, ot as estimateConversationContextTokens, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as persistConversationMessageSummaries, u as recordTurnSummary, ut as normalizeConversationText } from "./checkpoint-B-JO5F3c.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-d-fKypxo.js";
16
- import { Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Gt as buildDeterministicAssistantMessageId, It as stopConversationWork, Kt as buildDeterministicTurnId, 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, Vt as isInvalidConversationRecordError, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys, zt as hasRunnableConversationWork$1 } from "./stats-CFlUGqVA.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-DIZ4iZjS.js";
18
- import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-CQD4HKK2.js";
13
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D89PJa84.js";
14
+ import { $ as persistConversationMessages, F as commitMessages, J as recordSubscribedReplyRoute, L as loadConversationProjection, Mt as trimTrailingAssistantMessages, P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, Z as appendConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as getTurnRecordForResume, ct as isHumanConversationMessage, d as persistWithRetry, dt as recordDeliveredAssistantMessage, et as projectConversationMessages, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, jt as stripRuntimeTurnContext, l as listTurnSummaries, lt as markConversationMessage, m as buildTurnErrorResponse, mt as estimateTextTokens, n as loadTurnCheckpoint, nt as resolveConversationTitle, o as failTurnRecord, ot as estimateConversationContextTokens, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as persistConversationMessageSummaries, u as recordTurnSummary, ut as normalizeConversationText } from "./checkpoint-DBX1KyOb.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-DPAFjrER.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-t0wuykQW.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-D6c_jWmW.js";
18
+ import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-CPBSl1Xv.js";
19
19
  import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-x-0ZtTyb.js";
20
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-BhRB1s2A.js";
20
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-CToO52ls.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-rnAPfUhP.js";
22
+ import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-C1lIZ7DE.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-BbHZ4r4S.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-sI1EnNoM.js";
25
25
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
26
- import { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, a as webActorFromEmail, g as conversationVisibilityFromSlackChannelType, h as resolveConversationDestination, i as recordWebConversationActivity, n as conversationTurnIdForMessage, o as readConversationAccessFromSql, t as appendAndEnqueueWebMessage, v as resolveSlackChannelTypeFromMessage, w as GET$3, x as lookupSlackUser, y as resolveSlackConversationContext } from "./web-input-Ce1FcNIM.js";
27
- import { u as recordAutomationExecution } from "./execution-stats-Ds4bSvam.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-DO79gdho.js";
29
- import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-BEzDU_2x.js";
30
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-DSBK4Ars.js";
31
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-BSIHxmQJ.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-DD6BA4xz.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-uv8on6cT.js";
34
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-D8I1_5wP.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-D04NWqMR.js";
36
- import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-C73gJV7l.js";
37
- import { t as processConversationWork } from "./worker-MK2ubOv-.js";
38
- import { t as bindSpawnAgent } from "./spawn-Eh_3-s0M.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-NEbUfS0Q.js";
27
+ import { u as recordAutomationExecution } from "./execution-stats-CyehCrCF.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-DVDa7fAI.js";
29
+ import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-Dv5SHQ4C.js";
30
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CoNJoE-n.js";
31
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-BRd4mQlB.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-DB_913ic.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-BZqtr-GX.js";
34
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-TyHaXCpO.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-DCYT7j8m.js";
36
+ import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-BNCTTM5f.js";
37
+ import { t as processConversationWork } from "./worker-1GzySfPG.js";
38
+ import { t as bindSpawnAgent } from "./spawn-v7JJowIu.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-Bp297GA0.js";
2
- import { t as buildTurnFailureResponse } from "./logging-Dx0S5k2z.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-7_NmRtoz.js";
2
+ import { t as buildTurnFailureResponse } from "./logging-CHzH6JFD.js";
3
3
  import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
- import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-B-JO5F3c.js";
5
- import { Kt as buildDeterministicTurnId } from "./stats-CFlUGqVA.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-DIZ4iZjS.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DD6BA4xz.js";
4
+ import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-DBX1KyOb.js";
5
+ import { qt as buildDeterministicTurnId } from "./stats-t0wuykQW.js";
6
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-D6c_jWmW.js";
7
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DB_913ic.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-Bp297GA0.js";
1
+ import { r as completeObject } from "./client-7_NmRtoz.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-AA4R1VUn.js";
4
4
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-x-0ZtTyb.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-G2gv97R1.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-BPGL4uP-.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-CWKdLCTG.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-vUqDWPNS.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();
@@ -1,11 +1,11 @@
1
- import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-Bp297GA0.js";
2
- import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-Dx0S5k2z.js";
3
- import { n as botConfig } from "./config-G2gv97R1.js";
1
+ import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-7_NmRtoz.js";
2
+ import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-CHzH6JFD.js";
3
+ import { n as botConfig } from "./config-BPGL4uP-.js";
4
4
  import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
5
- import { At as authenticationLinkedEvent, Bt as sanitizePostgresJson, Ft as getConversationStore, Lt as getSqlExecutor, Nt as getConversationEventStore, Ot as JUNIOR_NATIVE_EVENT_NAMESPACE, Rt as createSqlConversationEventStore, Ut as bindProviderConversation, jt as authenticationUnlinkedEvent, kt as agentsInstructionsUpdatedEvent, zt as withConversationEventLock } from "./agent-hooks-BBX9p6aG.js";
5
+ import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-DDJGkqlR.js";
6
6
  import { G as instructionProvenanceFor, I as agentHistoryItemSchema, U as contextProvenance, W as instructionActors } from "./conversation-AA4R1VUn.js";
7
- import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-WRXkNOHp.js";
8
- import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-d-fKypxo.js";
7
+ import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-D5t1yT3R.js";
8
+ import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-DPAFjrER.js";
9
9
  import path from "node:path";
10
10
  import { isDeepStrictEqual } from "node:util";
11
11
  import { z } from "zod";