@sentry/junior 0.204.0 → 0.205.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 (50) hide show
  1. package/dist/{agent-CMyTD4DD.js → agent-D4nu8MQV.js} +46 -34
  2. package/dist/{agent-hooks-Bbcp9e33.js → agent-hooks-DXHpTJ4m.js} +10 -8
  3. package/dist/{agent-runner-DNb1A49M.js → agent-runner-C04colea.js} +5 -5
  4. package/dist/api/schema.d.ts +8 -0
  5. package/dist/api.js +15 -15
  6. package/dist/{app-B1TOqBI8.d.ts → app-Cb776lL8.d.ts} +1 -0
  7. package/dist/app.d.ts +1 -1
  8. package/dist/app.js +34 -32
  9. package/dist/{auth-pause-state-DosEalIG.js → auth-pause-state-C2P3guS1.js} +6 -6
  10. package/dist/{catalog-runtime-BReos-D4.js → catalog-runtime-CXw3asJD.js} +1 -1
  11. package/dist/{checkpoint-CNrPyRJN.js → checkpoint-CrViJ8Ps.js} +5 -5
  12. package/dist/cli/chat.js +12 -12
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/plugins.js +3 -3
  15. package/dist/cli/snapshot-create.js +3 -3
  16. package/dist/cli/upgrade.js +3 -3
  17. package/dist/{config-nGCW1OTG.js → config-BOtJQ7Pc.js} +2 -2
  18. package/dist/{conversation-privacy-B4voFRSm.js → conversation-privacy-BZRA6Pes.js} +1 -1
  19. package/dist/{credential-sync-kXr1hvO1.js → credential-sync-Bep34IB_.js} +21 -20
  20. package/dist/{execution-stats-DWfSihcH.js → execution-stats-B6lgWxCK.js} +4 -4
  21. package/dist/{executor-DcMSlI5c.js → executor-BlUhFL7_.js} +1 -1
  22. package/dist/instrumentation.js +2 -2
  23. package/dist/{job-queue-Drn_LXlM.js → job-queue-DLMqIK74.js} +1 -1
  24. package/dist/{logging-BzAk1S_s.js → logging-BMJzdDlP.js} +1 -1
  25. package/dist/nitro.d.ts +1 -1
  26. package/dist/nitro.js +3 -3
  27. package/dist/{oauth-callback-server-JiftokvA.js → oauth-callback-server-WwG5_Zgm.js} +2 -2
  28. package/dist/{pending-auth-CWmSdZVg.js → pending-auth-CUbXq06G.js} +2 -2
  29. package/dist/{profile-CrT5nXbw.js → profile-T0tXE4zu.js} +3 -3
  30. package/dist/{registry-DH1xUo2N.js → registry-BA0__8ai.js} +1 -1
  31. package/dist/{resolve-CZHnfxaS.js → resolve-bvD1ORdv.js} +2 -2
  32. package/dist/{runner-CZV2sC46.js → runner-BXYxfIUL.js} +9 -9
  33. package/dist/{sandbox-egress-signals-bHZfmhbd.js → sandbox-egress-signals-ngEPjSEW.js} +1 -1
  34. package/dist/{skills-CIcDQSgM.js → skills-DJOlYdBs.js} +2 -2
  35. package/dist/{spawn-DdkUFRmq.js → spawn-h0R1bTEo.js} +2 -2
  36. package/dist/{stats-DTUbAb88.js → stats-3YZn-Swi.js} +26 -12
  37. package/dist/{task-queue-CJIR4RF7.js → task-queue-CoXwd2eq.js} +3 -3
  38. package/dist/{task-runner-D-O3A-Cp.js → task-runner-B2_mJZj0.js} +7 -7
  39. package/dist/{thread-state-CRc9jTJS.js → thread-state-CqZ1m-es.js} +5 -5
  40. package/dist/{turn-execution-BkinIdJF.js → turn-execution-fI6PZ0iI.js} +3 -3
  41. package/dist/{turn-lifecycle-DQV19VTW.js → turn-lifecycle-CcnwrOcp.js} +1 -1
  42. package/dist/{usage-D3EbSO7w.js → usage-B5SfMb3H.js} +2 -2
  43. package/dist/{validation-C2CR-OX3.js → validation-DfWcvhuS.js} +1 -1
  44. package/dist/{version-DxcWdoKa.js → version-oD-oPrbO.js} +1 -1
  45. package/dist/version.js +1 -1
  46. package/dist/{web-authorization-RMBxAR_t.js → web-authorization-Crbzlmzo.js} +1 -1
  47. package/dist/{web-input-3EPfpf55.js → web-input-BOuq3oKK.js} +6 -6
  48. package/dist/{work-fGofI7Op.js → work-B91LQKHr.js} +9 -9
  49. package/dist/{worker-CsOLq-mR.js → worker-BcRRTe6k.js} +4 -4
  50. package/package.json +5 -5
@@ -1,25 +1,25 @@
1
- import { A as createProviderError, C as MODEL_HANDOFF_SUMMARY_PREFIX, D as unwrapCurrentInstruction, E as renderCurrentInstruction, F as MISSING_GATEWAY_CREDENTIALS_ERROR, I as getGatewayApiKey, L as resolveGatewayCredential, M as getProviderErrorAttributes, O as escapeXml, P as isProviderRetryError, S as COMPACTION_SUMMARY_PREFIX, T as isCompactionSummaryText, _ as completeObject, b as resolveGatewayModel, g as GEN_AI_SERVER_ADDRESS, h as GEN_AI_PROVIDER_NAME, j as findProviderError, k as ProviderError, m as normalizeSlackEmojiName, n as botConfig, v as completeText, w as hasCompactedConversationContext, x as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX } from "./config-nGCW1OTG.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-BzAk1S_s.js";
1
+ import { A as createProviderError, C as MODEL_HANDOFF_SUMMARY_PREFIX, D as unwrapCurrentInstruction, E as renderCurrentInstruction, F as MISSING_GATEWAY_CREDENTIALS_ERROR, I as getGatewayApiKey, L as resolveGatewayCredential, M as getProviderErrorAttributes, O as escapeXml, P as isProviderRetryError, S as COMPACTION_SUMMARY_PREFIX, T as isCompactionSummaryText, _ as completeObject, b as resolveGatewayModel, g as GEN_AI_SERVER_ADDRESS, h as GEN_AI_PROVIDER_NAME, j as findProviderError, k as ProviderError, m as normalizeSlackEmojiName, n as botConfig, v as completeText, w as hasCompactedConversationContext, x as ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX } from "./config-BOtJQ7Pc.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-BMJzdDlP.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-B4voFRSm.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-BZRA6Pes.js";
5
5
  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";
6
6
  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-B45_WqVX.js";
7
- import { $ as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, B as getSlackClient, Bt as parseDestination, C as setWorkspaceSnapshotBuild, Ct as getConversationEventStore, D as tryWorkspaceRepoCheckoutPath, Dt as getSqlExecutor, E as getWorkspaceSnapshotBuilder, Et as getDb, G as withSlackRetries, I as SlackActionError, L as downloadPrivateSlackFile, O as workspaceRepoCheckoutPath, Q as getSlackToolContext, R as getFilePermalink, S as setWorkspaceSnapshot, T as deleteWorkspaceSnapshotBuilders, Tt as getConversationStore, U as normalizeSlackConversationId, V as isConversationScopedChannel, Y as readActorIdentity, _ as listWorkspaces, _t as createPluginLogger, b as invalidateReadySnapshot, c as getPluginTools, ct as findMatchingResourceEventSubscriptions, ft as getDashboardTaskLink, g as getWorkspaceByName, h as getWorkspace, it as cancelSubscriptions, k as resolveChannelCapabilities, l as getPluginUserPromptContributions, lt as listResourceEventSubscriptions, m as deleteWorkspace, nt as STOP_WATCHING_TOOL_NAME, ot as createResourceEventSubscription, p as createWorkspace, r as createPluginHookRunner, rt as cancelResourceEventSubscription, s as getPluginSystemPromptContributions, st as deliverResourceEventSubscription, tt as RESOURCE_WATCH_TOOL_SOURCE, u as getPlugins, ut as JUNIOR_THREAD_STATE_TTL_MS, v as updateWorkspace, w as SANDBOX_RUNTIME, wt as getConversationMessageSearchStore, x as loadSnapshotsForProfile, y as WorkspaceValidationError } from "./agent-hooks-Bbcp9e33.js";
8
- import { E as juniorArtifacts, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, w as juniorIdentities, x as juniorAttachments } from "./executor-DcMSlI5c.js";
7
+ import { $ as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, B as getSlackClient, Bt as parseDestination, C as setWorkspaceSnapshotBuild, Ct as getConversationEventStore, D as tryWorkspaceRepoCheckoutPath, Dt as getSqlExecutor, E as getWorkspaceSnapshotBuilder, Et as getDb, G as withSlackRetries, I as SlackActionError, L as downloadPrivateSlackFile, O as workspaceRepoCheckoutPath, Q as getSlackToolContext, R as getFilePermalink, S as setWorkspaceSnapshot, T as deleteWorkspaceSnapshotBuilders, Tt as getConversationStore, U as normalizeSlackConversationId, V as isConversationScopedChannel, Y as readActorIdentity, _ as listWorkspaces, _t as createPluginLogger, b as invalidateReadySnapshot, c as getPluginTools, ct as findMatchingResourceEventSubscriptions, ft as getDashboardTaskLink, g as getWorkspaceByName, h as getWorkspace, it as cancelSubscriptions, k as resolveChannelCapabilities, l as getPluginUserPromptContributions, lt as listResourceEventSubscriptions, m as deleteWorkspace, nt as STOP_WATCHING_TOOL_NAME, ot as createResourceEventSubscription, p as createWorkspace, r as createPluginHookRunner, rt as cancelResourceEventSubscription, s as getPluginSystemPromptContributions, st as deliverResourceEventSubscription, tt as RESOURCE_WATCH_TOOL_SOURCE, u as getPlugins, ut as JUNIOR_THREAD_STATE_TTL_MS, v as updateWorkspace, w as SANDBOX_RUNTIME, wt as getConversationMessageSearchStore, x as loadSnapshotsForProfile, y as WorkspaceValidationError } from "./agent-hooks-DXHpTJ4m.js";
8
+ import { E as juniorArtifacts, a as juniorSchedulerRuns, d as AGENT_INVOCATION_MAILBOX_STATUSES, w as juniorIdentities, x as juniorAttachments } from "./executor-BlUhFL7_.js";
9
9
  import { d as instructionProvenanceFor, f as sameActorIdentity, l as contextProvenance, t as KNOWN_CONVERSATION_EVENT_TYPES, u as instructionActors } from "./history-CqTuSAdI.js";
10
10
  import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
11
- import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-DH1xUo2N.js";
12
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BReos-D4.js";
13
- import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-CIcDQSgM.js";
14
- 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-CNrPyRJN.js";
15
- import { a as hasAgentTurnUsage, c as generateShortTitle, l as resolveTaskTitle, o as ToolInputError, t as addAgentTurnUsage } from "./usage-D3EbSO7w.js";
16
- 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-CrT5nXbw.js";
17
- import { $ as workspaceSnapshotWatch, B as deleteEventTask, C as SCHEDULED_TASK_SYSTEM_ACTOR, D as eventTaskMatchesDestination, E as eventTaskListToolResultSchema, F as effectiveTaskOutcomes, Ht as juniorToolOutputSchema, I as resolveTaskOutcomes, J as saveEventTask, K as listEventTasksForTeam, L as taskOutcomeInputSchema, M as requireEventTaskSlackContext, N as requireSupportedEventTaskTrigger, O as eventTaskSuccess, P as writableEventTask, Q as workspaceSnapshotFinishedEvent, T as compactEventTask, U as getEventTask, Ut as makeStructuredToolOutput, Vt as injectContinuationToolName, X as WORKSPACE_SNAPSHOT_FAILED_EVENT, Y as getResourceEventCatalog, Z as WORKSPACE_SNAPSHOT_READY_EVENT, at as registeredEventTypeSchema, c as parseSlackThreadId, ct as requireSupportedResourceEventMatch, et as eventNamespaceSchema, f as createScheduledTask, ft as appendAndEnqueueInboundMessage, g as listScheduledTasksForTeam, i as readLiveAttachment, it as pluginSupportsEvent, j as registeredEventTaskTriggerSchema, k as eventTaskToolResultSchema, lt as resourceEventGuidance, nt as hasResourceEventCatalogEntries, ot as registeredResourceEventMatchSchema, rt as normalizeEventIdentifier, s as storeAttachments, st as registeredResourceTypeSchema, t as incrementStat, tt as hasPluginResourceEventCatalogEntries, v as readScheduledTask, y as saveScheduledTask, z as createEventTask } from "./stats-DTUbAb88.js";
18
- 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-CWmSdZVg.js";
19
- 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-DNb1A49M.js";
20
- 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-CZHnfxaS.js";
11
+ import { a as resolvePluginCommandEnv, c as getOAuthProviderErrorAttributes, i as resolveAuthTokenPlaceholder, o as OAuthProviderError, s as fetchWithBoundedOAuthErrorBodies, u as CredentialUnavailableError } from "./registry-BA0__8ai.js";
12
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CXw3asJD.js";
13
+ import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-DJOlYdBs.js";
14
+ 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-CrViJ8Ps.js";
15
+ import { a as hasAgentTurnUsage, c as generateShortTitle, l as resolveTaskTitle, o as ToolInputError, t as addAgentTurnUsage } from "./usage-B5SfMb3H.js";
16
+ 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-T0tXE4zu.js";
17
+ import { $ as workspaceSnapshotFinishedEvent, B as createEventTask, C as SCHEDULED_TASK_SYSTEM_ACTOR, D as eventTaskMatchesDestination, E as eventTaskListToolResultSchema, F as effectiveTaskOutcomes, Ht as injectContinuationToolName, I as moveTaskOutcomes, L as resolveTaskOutcomes, M as requireEventTaskSlackContext, N as requireSupportedEventTaskTrigger, O as eventTaskSuccess, P as writableEventTask, Q as WORKSPACE_SNAPSHOT_READY_EVENT, R as taskOutcomeInputSchema, T as compactEventTask, Ut as juniorToolOutputSchema, V as deleteEventTask, W as getEventTask, Wt as makeStructuredToolOutput, X as getResourceEventCatalog, Y as saveEventTask, Z as WORKSPACE_SNAPSHOT_FAILED_EVENT, at as pluginSupportsEvent, c as parseSlackThreadId, ct as registeredResourceTypeSchema, et as workspaceSnapshotWatch, f as createScheduledTask, g as listScheduledTasksForTeam, i as readLiveAttachment, it as normalizeEventIdentifier, j as registeredEventTaskTriggerSchema, k as eventTaskToolResultSchema, lt as requireSupportedResourceEventMatch, nt as hasPluginResourceEventCatalogEntries, ot as registeredEventTypeSchema, pt as appendAndEnqueueInboundMessage, q as listEventTasksForTeam, rt as hasResourceEventCatalogEntries, s as storeAttachments, st as registeredResourceEventMatchSchema, t as incrementStat, tt as eventNamespaceSchema, ut as resourceEventGuidance, v as readScheduledTask, y as saveScheduledTask } from "./stats-3YZn-Swi.js";
18
+ 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-CUbXq06G.js";
19
+ 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-C04colea.js";
20
+ 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-bvD1ORdv.js";
21
21
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
22
- import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-Drn_LXlM.js";
22
+ import { a as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-DLMqIK74.js";
23
23
  import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
24
24
  import { streamSimple } from "@earendil-works/pi-ai/compat";
25
25
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -694,13 +694,25 @@ function applyProfileReasoningOverride(route, profiles) {
694
694
  reason: `profile_reasoning_override:${route.profile}:${route.reason}`
695
695
  };
696
696
  }
697
+ /**
698
+ * The fast classifier model occasionally returns a malformed object
699
+ * (`ProviderError` kind `invalid_response`, e.g. the AI SDK's
700
+ * `NoObjectGeneratedError`) even though a retry usually succeeds. Give it
701
+ * one retry before falling back to `defaultProfile`; any other error kind
702
+ * still falls back immediately.
703
+ */
704
+ const CLASSIFIER_MAX_ATTEMPTS = 2;
705
+ function isRetryableClassifierError(error) {
706
+ return error instanceof ProviderError && error.kind === "invalid_response";
707
+ }
697
708
  async function classifyTurn(args) {
698
- try {
709
+ let lastError;
710
+ for (let attempt = 1; attempt <= CLASSIFIER_MAX_ATTEMPTS; attempt++) try {
699
711
  const schema = createTurnRouteSchema(args.profiles);
700
712
  const result = await args.completeObject({
701
713
  modelId: args.fastModelId,
702
714
  schema,
703
- maxTokens: 140,
715
+ maxTokens: 5e3,
704
716
  metadata: args.metadata,
705
717
  prompt: args.prompt,
706
718
  thinkingLevel: "low",
@@ -727,14 +739,17 @@ async function classifyTurn(args) {
727
739
  source: "router"
728
740
  };
729
741
  } catch (error) {
730
- logWarn("turn.router.classifier.failed", { "exception.message": error instanceof Error ? error.message : String(error) });
731
- return {
732
- profile: args.defaultProfile,
733
- reasoningLevel: CLASSIFIER_FALLBACK_REASONING_LEVEL,
734
- reason: "classifier_error_default",
735
- source: "router"
736
- };
742
+ lastError = error;
743
+ if (attempt < CLASSIFIER_MAX_ATTEMPTS && isRetryableClassifierError(error)) continue;
744
+ break;
737
745
  }
746
+ logWarn("turn.router.classifier.failed", { "exception.message": lastError instanceof Error ? lastError.message : String(lastError) });
747
+ return {
748
+ profile: args.defaultProfile,
749
+ reasoningLevel: CLASSIFIER_FALLBACK_REASONING_LEVEL,
750
+ reason: "classifier_error_default",
751
+ source: "router"
752
+ };
738
753
  }
739
754
  /** Convert a routing bucket into the Pi Agent reasoning setting for a main turn. */
740
755
  function toPiReasoningLevel(level) {
@@ -1213,7 +1228,7 @@ function buildOutputSection(platform) {
1213
1228
  `<output format="slack-markdown">`,
1214
1229
  "- Default to the shortest complete reply—usually 1–5 sentences and under 800 characters. Include only the outcome, decisive evidence, and any blocker or required next action. If useful detail would exceed that, put it in a Slack canvas and reply with the link. An explicit user request for detail overrides this target.",
1215
1230
  "- Start with the answer or result, not internal process narration.",
1216
- "- Use Slack-flavored Markdown: **bold** section labels, `code`, [text](url) links, bullet lists, and fenced code blocks. No hash-prefixed headings and no tables. When the answer primarily lists several URLs, show each URL bare instead of as a labeled link.",
1231
+ "- Use Slack-flavored Markdown: **bold** section labels, `code`, [text](url) links, bullet lists, and fenced code blocks. No hash-prefixed headings and no tables.",
1217
1232
  "- End every turn with a final user-facing markdown response unless the Slack action rules allow a no-reply completion.",
1218
1233
  "</output>"
1219
1234
  ].join("\n");
@@ -2770,12 +2785,8 @@ async function maybePostAutomatedTurnLimitNotice(args) {
2770
2785
  //#region src/chat/task-input.ts
2771
2786
  /** Shared closing lines for the stored outcomes. */
2772
2787
  function replyContractLines(outcomes) {
2773
- if (outcomes?.length === 0) return ["Successful output is not delivered to the destination.", "Complete the work without adding a status message for people."];
2774
- return [
2775
- "When you reply, follow any reply format in the instructions.",
2776
- `If no visible reply is needed, your final assistant message must be exactly ${NO_REPLY_MARKER} and nothing else.`,
2777
- "Otherwise briefly summarize what you acted on and what you did or need next."
2778
- ];
2788
+ if (outcomes?.length === 0) return ["Do the work without writing a status message.", "No successful output will be delivered."];
2789
+ return ["When you reply, follow any reply format in the instructions.", "Briefly report what you did or what is needed next."];
2779
2790
  }
2780
2791
  function oneLine(value) {
2781
2792
  return value.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim();
@@ -8251,7 +8262,8 @@ function requireActiveConversation(context) {
8251
8262
  return {
8252
8263
  platform: "slack",
8253
8264
  teamId: parsed.data.teamId,
8254
- channelId: parsed.data.channelId
8265
+ channelId: parsed.data.channelId,
8266
+ threadTs: parsed.data.threadTs ?? parsed.data.messageTs
8255
8267
  };
8256
8268
  }
8257
8269
  /** Require a concrete Slack actor before creating scheduler ownership state. */
@@ -8682,7 +8694,7 @@ function createSlackScheduleUpdateTaskTool(context) {
8682
8694
  status: nextStatus,
8683
8695
  statusReason: nextStatus === "blocked" ? lookup.statusReason : void 0,
8684
8696
  schedule: compiled?.schedule ?? lookup.schedule,
8685
- outcomes: input.outcomes === void 0 ? lookup.outcomes : await resolveTaskOutcomes(input.outcomes, activeDestination, lookup.createdBy.slackUserId),
8697
+ outcomes: input.outcomes === void 0 ? changingDestination ? moveTaskOutcomes(lookup.outcomes, lookup.destination, nextDestination) : lookup.outcomes : await resolveTaskOutcomes(input.outcomes, nextDestination, lookup.createdBy.slackUserId),
8686
8698
  task: { text: nextInstruction }
8687
8699
  };
8688
8700
  if (instructionChanged) {
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { _ as completeObject, i as getChatConfig, n as botConfig, o as getSlackBotToken, y as embedTexts } from "./config-nGCW1OTG.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-BzAk1S_s.js";
2
+ import { _ as completeObject, i as getChatConfig, n as botConfig, o as getSlackBotToken, y as embedTexts } from "./config-BOtJQ7Pc.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-BMJzdDlP.js";
4
4
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
5
5
  import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-B45_WqVX.js";
6
6
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
7
- import { C as juniorConversations, S as conversationReadColumns, T as juniorUsers, b as juniorCodeRepositories, g as juniorConversationEvents, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationAnnotations, w as juniorIdentities, y as juniorCodeChanges } from "./executor-DcMSlI5c.js";
7
+ import { C as juniorConversations, S as conversationReadColumns, T as juniorUsers, b as juniorCodeRepositories, g as juniorConversationEvents, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationAnnotations, w as juniorIdentities, y as juniorCodeChanges } from "./executor-BlUhFL7_.js";
8
8
  import { c as newConversationEventSchema, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-CqTuSAdI.js";
9
- 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-CrT5nXbw.js";
9
+ 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-T0tXE4zu.js";
10
10
  import { AsyncLocalStorage } from "node:async_hooks";
11
11
  import { z } from "zod";
12
12
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -330,19 +330,21 @@ function locationForWrite(args) {
330
330
  const source = args.sessionSource?.kind === "slack" ? args.sessionSource : void 0;
331
331
  if (location) {
332
332
  if (destination && (location.id !== args.destinationId || location.teamId !== destination.teamId || location.channelId !== destination.channelId) || source && (location.teamId !== source.teamId || location.channelId !== source.channelId)) throw new Error("Conversation Location changed");
333
- return source?.threadTs && !location.threadTs ? {
333
+ const threadTs = location.threadTs ?? destination?.threadTs ?? source?.threadTs;
334
+ return threadTs === location.threadTs ? location : {
334
335
  ...location,
335
- threadTs: source.threadTs
336
- } : location;
336
+ threadTs
337
+ };
337
338
  }
338
339
  if (destination && source && (destination.teamId !== source.teamId || destination.channelId !== source.channelId)) throw new Error("Conversation Location does not match its session Source");
339
340
  if (!destination || !args.destinationId) return;
341
+ const threadTs = destination.threadTs ?? source?.threadTs;
340
342
  return locationSchema.parse({
341
343
  id: args.destinationId,
342
344
  provider: "slack",
343
345
  teamId: destination.teamId,
344
346
  channelId: destination.channelId,
345
- ...source?.threadTs ? { threadTs: source.threadTs } : void 0
347
+ ...threadTs ? { threadTs } : void 0
346
348
  });
347
349
  }
348
350
  /** Read one complete Location from SQL. */
@@ -1,9 +1,9 @@
1
- import { m as normalizeSlackEmojiName } from "./config-nGCW1OTG.js";
2
- import { F as isRecord, d as logInfo, f as logWarn } from "./logging-BzAk1S_s.js";
1
+ import { m as normalizeSlackEmojiName } from "./config-BOtJQ7Pc.js";
2
+ import { F as isRecord, d as logInfo, f as logWarn } from "./logging-BMJzdDlP.js";
3
3
  import { _ as parseSlackMessageTs, g as parseSlackUserId } from "./context-B45_WqVX.js";
4
- import { B as getSlackClient, Bt as parseDestination, G as withSlackRetries, H as isDmChannel, I as SlackActionError, U as normalizeSlackConversationId, n as applyPluginFormatMarkdown } from "./agent-hooks-Bbcp9e33.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BReos-D4.js";
6
- import { w as getStateAdapter } from "./profile-CrT5nXbw.js";
4
+ import { B as getSlackClient, Bt as parseDestination, G as withSlackRetries, H as isDmChannel, I as SlackActionError, U as normalizeSlackConversationId, n as applyPluginFormatMarkdown } from "./agent-hooks-DXHpTJ4m.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CXw3asJD.js";
6
+ import { w as getStateAdapter } from "./profile-T0tXE4zu.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";
@@ -2574,6 +2574,7 @@ export declare const scheduledTaskSummarySchema: z.ZodObject<{
2574
2574
  platform: z.ZodLiteral<"slack">;
2575
2575
  teamId: z.ZodString;
2576
2576
  channelId: z.ZodString;
2577
+ threadTs: z.ZodOptional<z.ZodString>;
2577
2578
  }, z.core.$strict>;
2578
2579
  }, z.core.$strict>>;
2579
2580
  title: z.ZodString;
@@ -2617,6 +2618,7 @@ export declare const eventTaskSummarySchema: z.ZodObject<{
2617
2618
  platform: z.ZodLiteral<"slack">;
2618
2619
  teamId: z.ZodString;
2619
2620
  channelId: z.ZodString;
2621
+ threadTs: z.ZodOptional<z.ZodString>;
2620
2622
  }, z.core.$strict>;
2621
2623
  }, z.core.$strict>>;
2622
2624
  title: z.ZodString;
@@ -2657,6 +2659,7 @@ export declare const taskSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2657
2659
  platform: z.ZodLiteral<"slack">;
2658
2660
  teamId: z.ZodString;
2659
2661
  channelId: z.ZodString;
2662
+ threadTs: z.ZodOptional<z.ZodString>;
2660
2663
  }, z.core.$strict>;
2661
2664
  }, z.core.$strict>>;
2662
2665
  title: z.ZodString;
@@ -2699,6 +2702,7 @@ export declare const taskSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2699
2702
  platform: z.ZodLiteral<"slack">;
2700
2703
  teamId: z.ZodString;
2701
2704
  channelId: z.ZodString;
2705
+ threadTs: z.ZodOptional<z.ZodString>;
2702
2706
  }, z.core.$strict>;
2703
2707
  }, z.core.$strict>>;
2704
2708
  title: z.ZodString;
@@ -2768,6 +2772,7 @@ export declare const taskListSchema: z.ZodObject<{
2768
2772
  platform: z.ZodLiteral<"slack">;
2769
2773
  teamId: z.ZodString;
2770
2774
  channelId: z.ZodString;
2775
+ threadTs: z.ZodOptional<z.ZodString>;
2771
2776
  }, z.core.$strict>;
2772
2777
  }, z.core.$strict>>;
2773
2778
  title: z.ZodString;
@@ -2810,6 +2815,7 @@ export declare const taskListSchema: z.ZodObject<{
2810
2815
  platform: z.ZodLiteral<"slack">;
2811
2816
  teamId: z.ZodString;
2812
2817
  channelId: z.ZodString;
2818
+ threadTs: z.ZodOptional<z.ZodString>;
2813
2819
  }, z.core.$strict>;
2814
2820
  }, z.core.$strict>>;
2815
2821
  title: z.ZodString;
@@ -2918,6 +2924,7 @@ export declare const taskExecutionListSchema: z.ZodObject<{
2918
2924
  platform: z.ZodLiteral<"slack">;
2919
2925
  teamId: z.ZodString;
2920
2926
  channelId: z.ZodString;
2927
+ threadTs: z.ZodOptional<z.ZodString>;
2921
2928
  }, z.core.$strict>;
2922
2929
  }, z.core.$strict>>;
2923
2930
  title: z.ZodString;
@@ -2960,6 +2967,7 @@ export declare const taskExecutionListSchema: z.ZodObject<{
2960
2967
  platform: z.ZodLiteral<"slack">;
2961
2968
  teamId: z.ZodString;
2962
2969
  channelId: z.ZodString;
2970
+ threadTs: z.ZodOptional<z.ZodString>;
2963
2971
  }, z.core.$strict>;
2964
2972
  }, z.core.$strict>>;
2965
2973
  title: z.ZodString;
package/dist/api.js CHANGED
@@ -1,18 +1,18 @@
1
- import { f as logWarn, u as logException } from "./logging-BzAk1S_s.js";
1
+ import { f as logWarn, u as logException } from "./logging-BMJzdDlP.js";
2
2
  import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-B45_WqVX.js";
3
- import { B as getSlackClient, Dt as getSqlExecutor, Et as getDb, Ft as resolveRootConversationId, G as withSlackRetries, J as findUserByEmail, Mt as locationFromRow, O as workspaceRepoCheckoutPath, Pt as parseSessionSource, Tt as getConversationStore, X as resolveViewerUser, Z as updateViewerDisplayName, _ as listWorkspaces, _t as createPluginLogger, bt as listConversationAnnotations, h as getWorkspace, m as deleteWorkspace, p as createWorkspace, u as getPlugins, v as updateWorkspace, w as SANDBOX_RUNTIME, xt as listConversationAnnotationsById, y as WorkspaceValidationError, yt as renderPluginConversationEvent } from "./agent-hooks-Bbcp9e33.js";
3
+ import { B as getSlackClient, Dt as getSqlExecutor, Et as getDb, Ft as resolveRootConversationId, G as withSlackRetries, J as findUserByEmail, Mt as locationFromRow, O as workspaceRepoCheckoutPath, Pt as parseSessionSource, Tt as getConversationStore, X as resolveViewerUser, Z as updateViewerDisplayName, _ as listWorkspaces, _t as createPluginLogger, bt as listConversationAnnotations, h as getWorkspace, m as deleteWorkspace, p as createWorkspace, u as getPlugins, v as updateWorkspace, w as SANDBOX_RUNTIME, xt as listConversationAnnotationsById, y as WorkspaceValidationError, yt as renderPluginConversationEvent } from "./agent-hooks-DXHpTJ4m.js";
4
4
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
5
- import { C as juniorConversations, S as conversationReadColumns, T as juniorUsers, _ as juniorApiTokens, b as juniorCodeRepositories, g as juniorConversationEvents, m as juniorConversationParticipants, o as juniorSchedulerTasks, w as juniorIdentities, y as juniorCodeChanges } from "./executor-DcMSlI5c.js";
5
+ import { C as juniorConversations, S as conversationReadColumns, T as juniorUsers, _ as juniorApiTokens, b as juniorCodeRepositories, g as juniorConversationEvents, m as juniorConversationParticipants, o as juniorSchedulerTasks, w as juniorIdentities, y as juniorCodeChanges } from "./executor-BlUhFL7_.js";
6
6
  import { o as decodeStoredConversationEvent } from "./history-CqTuSAdI.js";
7
- import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, m as renderJuniorNativeConversationEvent, s as fallbackShortTitle } from "./usage-D3EbSO7w.js";
8
- import { n as hash, t as create } from "./profile-CrT5nXbw.js";
9
- import { A as eventTaskTriggerAvailable, B as deleteEventTask, F as effectiveTaskOutcomes, G as listEventTasksCreatedBy, U as getEventTask, V as eventTaskBelongsToUser, W as listDeletedEventTasksCreatedBy, Y as getResourceEventCatalog, _ as parseScheduledTaskRow, c as parseSlackThreadId, i as readLiveAttachment, m as listPublicScheduledTasksForTeams, mt as cancelHumanFacingPendingMessages, n as readStats, p as isListedScheduledTask, q as listPublicEventTasksForTeams, v as readScheduledTask, wt as getConversation, y as saveScheduledTask } from "./stats-DTUbAb88.js";
10
- import { t as getCachedSnapshot } from "./resolve-CZHnfxaS.js";
7
+ import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, m as renderJuniorNativeConversationEvent, s as fallbackShortTitle } from "./usage-B5SfMb3H.js";
8
+ import { n as hash, t as create } from "./profile-T0tXE4zu.js";
9
+ import { A as eventTaskTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventTasksCreatedBy, H as eventTaskBelongsToUser, J as listPublicEventTasksForTeams, K as listEventTasksCreatedBy, Tt as getConversation, V as deleteEventTask, W as getEventTask, X as getResourceEventCatalog, _ as parseScheduledTaskRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledTasksForTeams, n as readStats, p as isListedScheduledTask, v as readScheduledTask, y as saveScheduledTask } from "./stats-3YZn-Swi.js";
10
+ import { t as getCachedSnapshot } from "./resolve-bvD1ORdv.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-3EPfpf55.js";
14
- import { a as readTaskExecutionStatusDays, c as readTaskExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readTaskExecutionHours, l as readTaskRuns, n as readTaskExecutionByConversationId, o as readTaskExecutionStatusHours, p as conversationRangeColumns, r as readTaskExecutionDays, s as readTaskExecutionSummaries, t as emptyTaskRunWindows } from "./execution-stats-DWfSihcH.js";
15
- import { a as buildSentryEventUrl, i as buildSentryConversationUrl, r as getWebAuthorization } from "./web-authorization-RMBxAR_t.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-BOuq3oKK.js";
14
+ import { a as readTaskExecutionStatusDays, c as readTaskExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readTaskExecutionHours, l as readTaskRuns, n as readTaskExecutionByConversationId, o as readTaskExecutionStatusHours, p as conversationRangeColumns, r as readTaskExecutionDays, s as readTaskExecutionSummaries, t as emptyTaskRunWindows } from "./execution-stats-B6lgWxCK.js";
15
+ import { a as buildSentryEventUrl, i as buildSentryConversationUrl, r as getWebAuthorization } from "./web-authorization-Crbzlmzo.js";
16
16
  import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, At as createConversationMessageBodySchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, Dt as conversationStatsReportSchema, Et as conversationReportEventSchema, 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 taskListSchema, _t as conversationEventsQuerySchema, a as workspaceBodySchema, at as acceptedConversationMessageSchema, bt as conversationParamsSchema, ct as cancelConversationPendingMessagesBodySchema, dt as conversationAttachmentParamsSchema, et as trailingUtcDayWindow, f as taskExecutionListSchema, g as taskListQuerySchema, gt as conversationEventPageSchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, jt as apiErrorSchema, k as actorDirectoryReportSchema, kt as createConversationBodySchema, l as workspaceSchema, lt as cancelConversationPendingMessagesResponseSchema, mt as conversationDetailReportSchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, ot as archiveConversationBodySchema, pt as conversationDetailQuerySchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, st as archiveConversationResponseSchema, tt as trailingUtcHourWindow, v as taskParamsSchema, vt as conversationFeedQuerySchema, w as createdPersonalTokenSchema, wt as conversationPendingMessagesReportSchema, y as taskRunListSchema, yt as conversationFeedSchema, z as activitySixHours$1 } from "./schema-Rn8-XEaN.js";
17
17
  import { Hono } from "hono";
18
18
  import path from "node:path";
@@ -3876,7 +3876,7 @@ async function readPeoplePluginReports(args) {
3876
3876
  reports: [],
3877
3877
  source: "plugins"
3878
3878
  });
3879
- const { getPluginProfileReports } = await import("./agent-hooks-Bbcp9e33.js").then((n) => n.t);
3879
+ const { getPluginProfileReports } = await import("./agent-hooks-DXHpTJ4m.js").then((n) => n.t);
3880
3880
  return pluginOperationalReportFeedSchema.parse({
3881
3881
  generatedAt: new Date(nowMs).toISOString(),
3882
3882
  reports: await getPluginProfileReports({
@@ -4485,7 +4485,7 @@ function readDescriptionText(home) {
4485
4485
  }
4486
4486
  /** Read discovered skill names for authenticated runtime diagnostics. */
4487
4487
  async function readSkillReports() {
4488
- const { discoverSkills } = await import("./skills-CIcDQSgM.js").then((n) => n.o);
4488
+ const { discoverSkills } = await import("./skills-DJOlYdBs.js").then((n) => n.o);
4489
4489
  const skills = await discoverSkills();
4490
4490
  return skillReportsSchema.parse(skills.map((skill) => ({
4491
4491
  name: skill.name,
@@ -4494,7 +4494,7 @@ async function readSkillReports() {
4494
4494
  }
4495
4495
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4496
4496
  async function readPlugins() {
4497
- const { pluginCatalogRuntime } = await import("./catalog-runtime-BReos-D4.js").then((n) => n.t);
4497
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-CXw3asJD.js").then((n) => n.t);
4498
4498
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4499
4499
  configKeys: plugin.manifest.configKeys ?? [],
4500
4500
  description: plugin.manifest.description,
@@ -4506,7 +4506,7 @@ async function readPlugins() {
4506
4506
  async function readRuntimeInfoReport() {
4507
4507
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4508
4508
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
4509
- import("./catalog-runtime-BReos-D4.js").then((n) => n.t),
4509
+ import("./catalog-runtime-CXw3asJD.js").then((n) => n.t),
4510
4510
  readPlugins(),
4511
4511
  readSkillReports()
4512
4512
  ]);
@@ -4523,7 +4523,7 @@ async function readRuntimeInfoReport() {
4523
4523
  /** Read sanitized operational summaries contributed by plugins. */
4524
4524
  async function readPluginOperationalReportFeed() {
4525
4525
  const nowMs = Date.now();
4526
- const { getPluginOperationalReports } = await import("./agent-hooks-Bbcp9e33.js").then((n) => n.t);
4526
+ const { getPluginOperationalReports } = await import("./agent-hooks-DXHpTJ4m.js").then((n) => n.t);
4527
4527
  return pluginOperationalReportFeedSchema.parse({
4528
4528
  source: "plugins",
4529
4529
  generatedAt: new Date(nowMs).toISOString(),
@@ -102,6 +102,7 @@ declare const inboundMessageSchema: z.ZodObject<{
102
102
  platform: z.ZodLiteral<"slack">;
103
103
  teamId: z.ZodString;
104
104
  channelId: z.ZodString;
105
+ threadTs: z.ZodOptional<z.ZodString>;
105
106
  }, z.core.$strict>, z.ZodObject<{
106
107
  platform: z.ZodLiteral<"local">;
107
108
  conversationId: z.ZodString;
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-B1TOqBI8.js";
1
+ import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-Cb776lL8.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BI9A1vKA.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,39 +1,39 @@
1
- import { $ as buildSteeringPiMessage, B as renderTaskInput, C as renderBlockText, D as getNextRunAtMs, E as scheduledTaskRunAttributes, F as ingestResourceEvent, G as shouldPropagateSandboxEgressTrace, H as recordFinishedTurnForAutomatedLimit, I as isResourceEventMailboxMetadata, J as consumeSandboxEgressAuthRequiredSignal, K as SANDBOX_EGRESS_PROXY_PATH, L as RESOURCE_EVENT_MESSAGE_AUTHOR, P as processWorkspaceSnapshotJob, Q as createUserTokenStore, R as RESOURCE_EVENT_SYSTEM_ACTOR, S as renderAttachmentText, T as logScheduledTaskRunSkipped, U as resolveSandboxEgressProviderForHost, V as maybePostAutomatedTurnLimitNotice, W as normalizeSandboxEgressTracePropagationDomains, X as parseSandboxEgressCredentialToken, Y as consumeSandboxEgressPermissionDeniedSignal, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as isVisionImageMediaType, f as PluginCredentialFailureError, g as publicArtifactHeaders, it as setConfigDefaults, m as latestReportedProgress, n as createContextCompactor, nt as shouldEmitDevAgentTrace, o as deleteMcpAuthSessionsForUserProvider, q as clearSandboxEgressSignals, r as executeCredentialedEgressRequest, rt as getConfigDefaults, s as deleteMcpServerSessionId, t as executeAgentRun, tt as AuthorizationFlowDisabledError, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as isResourceEventConversationMessage } from "./agent-CMyTD4DD.js";
2
- import { O as escapeXml, P as isProviderRetryError, _ as completeObject, c as getSlackClientSecret, d as setBotModelConfig, f as setProfiles, i as getChatConfig, l as getSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setSlackReactionConfig, r as configureFunctionMaxDurationSeconds, s as getSlackClientId, u as getSlackSigningSecret, v as completeText } from "./config-nGCW1OTG.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-BzAk1S_s.js";
1
+ import { $ as buildSteeringPiMessage, B as renderTaskInput, C as renderBlockText, D as getNextRunAtMs, E as scheduledTaskRunAttributes, F as ingestResourceEvent, G as shouldPropagateSandboxEgressTrace, H as recordFinishedTurnForAutomatedLimit, I as isResourceEventMailboxMetadata, J as consumeSandboxEgressAuthRequiredSignal, K as SANDBOX_EGRESS_PROXY_PATH, L as RESOURCE_EVENT_MESSAGE_AUTHOR, P as processWorkspaceSnapshotJob, Q as createUserTokenStore, R as RESOURCE_EVENT_SYSTEM_ACTOR, S as renderAttachmentText, T as logScheduledTaskRunSkipped, U as resolveSandboxEgressProviderForHost, V as maybePostAutomatedTurnLimitNotice, W as normalizeSandboxEgressTracePropagationDomains, X as parseSandboxEgressCredentialToken, Y as consumeSandboxEgressPermissionDeniedSignal, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as isVisionImageMediaType, f as PluginCredentialFailureError, g as publicArtifactHeaders, it as setConfigDefaults, m as latestReportedProgress, n as createContextCompactor, nt as shouldEmitDevAgentTrace, o as deleteMcpAuthSessionsForUserProvider, q as clearSandboxEgressSignals, r as executeCredentialedEgressRequest, rt as getConfigDefaults, s as deleteMcpServerSessionId, t as executeAgentRun, tt as AuthorizationFlowDisabledError, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as isResourceEventConversationMessage } from "./agent-D4nu8MQV.js";
2
+ import { O as escapeXml, P as isProviderRetryError, _ as completeObject, c as getSlackClientSecret, d as setBotModelConfig, f as setProfiles, i as getChatConfig, l as getSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setSlackReactionConfig, r as configureFunctionMaxDurationSeconds, s as getSlackClientId, u as getSlackSigningSecret, v as completeText } from "./config-BOtJQ7Pc.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-BMJzdDlP.js";
4
4
  import { r as continueTrace } from "./sentry-CD3SdJl-.js";
5
- import { t as JUNIOR_VERSION } from "./version-DxcWdoKa.js";
5
+ import { t as JUNIOR_VERSION } from "./version-oD-oPrbO.js";
6
6
  import { a as modelIdForProfile, n as defaultModelId } from "./model-profile-CZmVoGdX.js";
7
7
  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-B45_WqVX.js";
8
- import { A as bindEventTaskCredentialSubject, B as getSlackClient, Ct as getConversationEventStore, Dt as getSqlExecutor, Et as getDb, F as verifySlackDirectCredentialSubject, H as isDmChannel, I as SlackActionError, It as deleteProviderIdentityForSlackUser, K as getWorkspaceTeamId, L as downloadPrivateSlackFile, M as bindSlackDirectCredentialSubject, N as verifyEventTaskCredentialSubject, P as verifyScheduledTaskCredentialSubject, Tt as getConversationStore, U as normalizeSlackConversationId, Vt as requireSlackDestination, W as runWithSlackInstallationToken, _t as createPluginLogger, a as getPluginRoutes, at as collectResourceEventMatchKeys, ct as findMatchingResourceEventSubscriptions, d as setPlugins, f as validatePlugins, i as getPluginApiRoutes, it as cancelSubscriptions, j as bindScheduledTaskCredentialSubject, jt as withConversationMutationLock, kt as withConversationEventLock, mt as createPluginState, pt as setDashboardConversationLinkOptions, q as runWithWorkspaceTeamId, u as getPlugins, ut as JUNIOR_THREAD_STATE_TTL_MS, zt as createSlackDestination } from "./agent-hooks-Bbcp9e33.js";
8
+ import { A as bindEventTaskCredentialSubject, B as getSlackClient, Ct as getConversationEventStore, Dt as getSqlExecutor, Et as getDb, F as verifySlackDirectCredentialSubject, H as isDmChannel, I as SlackActionError, It as deleteProviderIdentityForSlackUser, K as getWorkspaceTeamId, L as downloadPrivateSlackFile, M as bindSlackDirectCredentialSubject, N as verifyEventTaskCredentialSubject, P as verifyScheduledTaskCredentialSubject, Tt as getConversationStore, U as normalizeSlackConversationId, Vt as requireSlackDestination, W as runWithSlackInstallationToken, _t as createPluginLogger, a as getPluginRoutes, at as collectResourceEventMatchKeys, ct as findMatchingResourceEventSubscriptions, d as setPlugins, f as validatePlugins, i as getPluginApiRoutes, it as cancelSubscriptions, j as bindScheduledTaskCredentialSubject, jt as withConversationMutationLock, kt as withConversationEventLock, mt as createPluginState, pt as setDashboardConversationLinkOptions, q as runWithWorkspaceTeamId, u as getPlugins, ut as JUNIOR_THREAD_STATE_TTL_MS, zt as createSlackDestination } from "./agent-hooks-DXHpTJ4m.js";
9
9
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
10
- import { C as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationEvents, o as juniorSchedulerTasks, p as juniorAgentInvocations } from "./executor-DcMSlI5c.js";
10
+ import { C as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationEvents, o as juniorSchedulerTasks, p as juniorAgentInvocations } from "./executor-BlUhFL7_.js";
11
11
  import { d as instructionProvenanceFor } from "./history-CqTuSAdI.js";
12
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BReos-D4.js";
13
- 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-CNrPyRJN.js";
14
- import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-CrT5nXbw.js";
15
- import { Bt as isInvalidConversationRecordError, Ct as ensureConversationWake, Dt as listActiveConversationIds, Et as hasRunnableConversationWork, F as effectiveTaskOutcomes, Ft as stopConversationWork, Gt as buildDeterministicTurnId, H as findMatchingEventTasks, Lt as CONVERSATION_WORK_STALE_ENQUEUE_MS, Nt as requestConversationWork, R as collectEventTaskMatchKeys, Rt as hasRunnableConversationWork$1, S as withScheduledTaskLock, Tt as getConversationWorkState, Wt as buildDeterministicAssistantMessageId, Y as getResourceEventCatalog, _t as clearExpiredConversationLease, a as requestAttachmentDeletion, b as saveScheduledTaskInLock, c as parseSlackThreadId, ft as appendAndEnqueueInboundMessage, g as listScheduledTasksForTeam, h as listScheduledTasks, jt as removeActiveConversation, lt as resourceEventGuidance, o as storeAttachment, r as collectAttachmentGarbage, v as readScheduledTask, w as scheduledRunSchema, wt as getConversation, x as scheduledRunId } from "./stats-DTUbAb88.js";
16
- 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-CWmSdZVg.js";
17
- import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-DNb1A49M.js";
18
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-CZHnfxaS.js";
12
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CXw3asJD.js";
13
+ 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-CrViJ8Ps.js";
14
+ import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-T0tXE4zu.js";
15
+ 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 withScheduledTaskLock, Tt as getConversation, U as findMatchingEventTasks, Vt as isInvalidConversationRecordError, X as getResourceEventCatalog, a as requestAttachmentDeletion, b as saveScheduledTaskInLock, c as parseSlackThreadId, g as listScheduledTasksForTeam, h as listScheduledTasks, o as storeAttachment, pt as appendAndEnqueueInboundMessage, r as collectAttachmentGarbage, ut as resourceEventGuidance, v as readScheduledTask, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventTaskMatchKeys, zt as hasRunnableConversationWork$1 } from "./stats-3YZn-Swi.js";
16
+ 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-CUbXq06G.js";
17
+ import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-C04colea.js";
18
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-bvD1ORdv.js";
19
19
  import { l as conversationQueueMessageSchema, n as resolveConversationWorkQueueTopic, r as verifyConversationQueueMessage, t as getVercelConversationWorkQueue, u as isConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
20
- import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-Drn_LXlM.js";
20
+ import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DLMqIK74.js";
21
21
  import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
22
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-C2CR-OX3.js";
22
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DfWcvhuS.js";
23
23
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
24
- 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-3EPfpf55.js";
25
- import { u as recordTaskExecution } from "./execution-stats-DWfSihcH.js";
26
- 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-D-O3A-Cp.js";
27
- import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-fGofI7Op.js";
28
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-DQV19VTW.js";
29
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-BkinIdJF.js";
30
- 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-CRc9jTJS.js";
31
- 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-DosEalIG.js";
32
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CJIR4RF7.js";
33
- 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-kXr1hvO1.js";
34
- import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-RMBxAR_t.js";
35
- import { t as processConversationWork } from "./worker-CsOLq-mR.js";
36
- import { t as bindSpawnAgent } from "./spawn-DdkUFRmq.js";
24
+ 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-BOuq3oKK.js";
25
+ import { u as recordTaskExecution } from "./execution-stats-B6lgWxCK.js";
26
+ 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-B2_mJZj0.js";
27
+ import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-B91LQKHr.js";
28
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CcnwrOcp.js";
29
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-fI6PZ0iI.js";
30
+ 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-CqZ1m-es.js";
31
+ 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-C2P3guS1.js";
32
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CoXwd2eq.js";
33
+ 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-Bep34IB_.js";
34
+ import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-Crbzlmzo.js";
35
+ import { t as processConversationWork } from "./worker-BcRRTe6k.js";
36
+ import { t as bindSpawnAgent } from "./spawn-h0R1bTEo.js";
37
37
  import { createRequire } from "node:module";
38
38
  import { pathToFileURL } from "node:url";
39
39
  import { Hono } from "hono";
@@ -1152,7 +1152,7 @@ async function runScheduledTaskHeartbeat(args) {
1152
1152
  input: buildDispatchInput(task),
1153
1153
  metadata,
1154
1154
  replyAttribution: replyAttribution$1(task),
1155
- outcomes: task.outcomes
1155
+ outcomes: effectiveTaskOutcomes(task.outcomes, task.destination)
1156
1156
  }
1157
1157
  });
1158
1158
  } catch (error) {
@@ -5973,7 +5973,8 @@ function createSlackTurn(deps) {
5973
5973
  channelId: outcome.destination.channelId,
5974
5974
  conversationId,
5975
5975
  replyAttribution: options.execution?.dispatch?.replyAttribution,
5976
- text
5976
+ text,
5977
+ threadTs: outcome.destination.threadTs
5977
5978
  });
5978
5979
  slackMessageTs.push(...messageIds);
5979
5980
  messageDestinations.push(...messageIds.map((messageId) => ({
@@ -6712,7 +6713,8 @@ function createSlackDispatchTurnRunner(options) {
6712
6713
  },
6713
6714
  raw: {
6714
6715
  channel: dispatch.destination.channelId,
6715
- team: dispatch.destination.teamId
6716
+ team: dispatch.destination.teamId,
6717
+ ...dispatch.destination.threadTs ? { thread_ts: dispatch.destination.threadTs } : void 0
6716
6718
  },
6717
6719
  author: {
6718
6720
  userId: dispatch.actor.name,
@@ -8071,7 +8073,7 @@ async function ingestEventTasks(input, options) {
8071
8073
  input: eventInput(task, event),
8072
8074
  metadata: { eventTaskId: task.id },
8073
8075
  replyAttribution: replyAttribution(task),
8074
- outcomes: task.outcomes
8076
+ outcomes: effectiveTaskOutcomes(task.outcomes, task.destination)
8075
8077
  }
8076
8078
  })).status === "created") dispatched += 1;
8077
8079
  } catch (error) {
@@ -1,10 +1,10 @@
1
- import { M as getProviderErrorAttributes, N as getProviderErrorUserMessage, j as findProviderError, k as ProviderError } from "./config-nGCW1OTG.js";
2
- import { t as buildTurnFailureResponse } from "./logging-BzAk1S_s.js";
1
+ import { M as getProviderErrorAttributes, N as getProviderErrorUserMessage, j as findProviderError, k as ProviderError } from "./config-BOtJQ7Pc.js";
2
+ import { t as buildTurnFailureResponse } from "./logging-BMJzdDlP.js";
3
3
  import { _ as parseSlackMessageTs } from "./context-B45_WqVX.js";
4
- import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-CNrPyRJN.js";
5
- import { Gt as buildDeterministicTurnId } from "./stats-DTUbAb88.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-CWmSdZVg.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CRc9jTJS.js";
4
+ import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-CrViJ8Ps.js";
5
+ import { Kt as buildDeterministicTurnId } from "./stats-3YZn-Swi.js";
6
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-CUbXq06G.js";
7
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CqZ1m-es.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,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-DH1xUo2N.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BA0__8ai.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,10 +1,10 @@
1
- import { D as unwrapCurrentInstruction, O as escapeXml, b as resolveGatewayModel, n as botConfig, v as completeText } from "./config-nGCW1OTG.js";
2
- import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-BzAk1S_s.js";
1
+ import { D as unwrapCurrentInstruction, O as escapeXml, b as resolveGatewayModel, n as botConfig, v as completeText } from "./config-BOtJQ7Pc.js";
2
+ import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-BMJzdDlP.js";
3
3
  import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-B45_WqVX.js";
4
- import { At as sanitizePostgresJson, Ct as getConversationEventStore, Dt as getSqlExecutor, Nt as bindProviderConversation, Ot as createSqlConversationEventStore, Tt as getConversationStore, kt as withConversationEventLock } from "./agent-hooks-Bbcp9e33.js";
4
+ import { At as sanitizePostgresJson, Ct as getConversationEventStore, Dt as getSqlExecutor, Nt as bindProviderConversation, Ot as createSqlConversationEventStore, Tt as getConversationStore, kt as withConversationEventLock } from "./agent-hooks-DXHpTJ4m.js";
5
5
  import { d as instructionProvenanceFor, l as contextProvenance, n as agentHistoryItemSchema, u as instructionActors } from "./history-CqTuSAdI.js";
6
- import { c as generateShortTitle, d as agentsInstructionsUpdatedEvent, f as authenticationLinkedEvent, o as ToolInputError, p as authenticationUnlinkedEvent, s as fallbackShortTitle, t as addAgentTurnUsage, u as JUNIOR_NATIVE_EVENT_NAMESPACE } from "./usage-D3EbSO7w.js";
7
- 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-CrT5nXbw.js";
6
+ import { c as generateShortTitle, d as agentsInstructionsUpdatedEvent, f as authenticationLinkedEvent, o as ToolInputError, p as authenticationUnlinkedEvent, s as fallbackShortTitle, t as addAgentTurnUsage, u as JUNIOR_NATIVE_EVENT_NAMESPACE } from "./usage-B5SfMb3H.js";
7
+ 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-T0tXE4zu.js";
8
8
  import path from "node:path";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { z } from "zod";