@sentry/junior 0.256.0 → 0.258.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 (106) hide show
  1. package/dist/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
  2. package/dist/{admin-BhucwVfy.js → admin-My1SLGVO.js} +2 -3
  3. package/dist/{agent-hooks-DlSK8PQQ.js → agent-hooks-BJ_5mlRH.js} +71 -111
  4. package/dist/{agent-invocations-BY60iNw-.js → agent-invocations-Qfz7dWgU.js} +8 -13
  5. package/dist/{agent-runner-C6_cd61V.js → agent-runner-DGsFQw72.js} +278 -467
  6. package/dist/api/schema.d.ts +454 -448
  7. package/dist/api/schema.js +5 -5
  8. package/dist/api.d.ts +2 -12
  9. package/dist/api.js +189 -165
  10. package/dist/{app-B0gT1Slp.d.ts → app-PX2H1PxU.d.ts} +20 -37
  11. package/dist/app.d.ts +3 -3
  12. package/dist/app.js +565 -305
  13. package/dist/{assistant-reply-yn5G-YEG.js → assistant-reply-H1M-91oF.js} +3 -5
  14. package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
  15. package/dist/{briefs-U6Bi3IYw.js → briefs-vYoK85rJ.js} +8 -11
  16. package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
  17. package/dist/{catalog-runtime-DF5OWqCc.js → catalog-runtime-BN4DVxco.js} +3 -4
  18. package/dist/cli/chat.d.ts +2 -4
  19. package/dist/cli/chat.js +22 -24
  20. package/dist/cli/check.d.ts +1 -3
  21. package/dist/cli/check.js +4 -5
  22. package/dist/cli/env.d.ts +1 -3
  23. package/dist/cli/env.js +1 -2
  24. package/dist/cli/init.d.ts +1 -3
  25. package/dist/cli/init.js +3 -3
  26. package/dist/cli/main.d.ts +1 -3
  27. package/dist/cli/main.js +4 -5
  28. package/dist/cli/plugins.d.ts +2 -4
  29. package/dist/cli/plugins.js +7 -8
  30. package/dist/cli/run.d.ts +1 -2
  31. package/dist/cli/run.js +1 -2
  32. package/dist/cli/snapshot-create.d.ts +1 -3
  33. package/dist/cli/snapshot-create.js +4 -5
  34. package/dist/cli/upgrade.d.ts +3 -6
  35. package/dist/cli/upgrade.js +11 -17
  36. package/dist/{client-BVrAp-pq.js → client-DbyHuMFU.js} +9 -16
  37. package/dist/{config-DdBiDanf.js → config-_WO_AjCB.js} +18 -15
  38. package/dist/{connections-CG04HdpC.js → connections-ag_1JOhB.js} +21 -21
  39. package/dist/{conversation-T18Xlkx9.js → conversation-DjN3mlog.js} +11 -17
  40. package/dist/{conversation-privacy-CpSYOWnP.js → conversation-privacy-DHP_xnVj.js} +2 -3
  41. package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
  42. package/dist/{credential-sync-DKWNdcgm.js → credential-sync-B-CPX_ag.js} +89 -52
  43. package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
  44. package/dist/{executor-BroK9oKy.js → executor-RvG6kVe1.js} +58 -70
  45. package/dist/{experimental-Qn9rKLgx.js → experimental-BNK1l1jv.js} +2 -3
  46. package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
  47. package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
  48. package/dist/{images-D0VZ5nv0.js → images-C2J_bj2g.js} +5 -6
  49. package/dist/instrumentation.d.ts +1 -3
  50. package/dist/instrumentation.js +6 -8
  51. package/dist/{job-queue-BbGg3gvu.js → job-queue-DVe37it2.js} +6 -12
  52. package/dist/{logging-tPQeUe2i.js → logging-DsHONhVm.js} +54 -24
  53. package/dist/{message-DdPGRYQP.js → message-DyitL8no.js} +5 -6
  54. package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
  55. package/dist/nitro.d.ts +3 -5
  56. package/dist/nitro.js +12 -17
  57. package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
  58. package/dist/{oauth-callback-server-B-2errCX.js → oauth-callback-server-CDby-pCn.js} +3 -4
  59. package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
  60. package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
  61. package/dist/{pending-auth-DT3MRVW8.js → pending-auth-D8J1uJUS.js} +37 -28
  62. package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
  63. package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B11Mfkmv.d.ts} +0 -4
  64. package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
  65. package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
  66. package/dist/{profile-Bb1zCVGP.js → profile-DpYjfKke.js} +16 -28
  67. package/dist/{prompt-C04mP1hu.js → prompt-xgpyMtg7.js} +5 -9
  68. package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
  69. package/dist/{registry-CsNavQ_Z.js → registry-Du566MtJ.js} +57 -30
  70. package/dist/{resolve-B6ZZ9duG.js → resolve-ClCIgh8E.js} +7 -12
  71. package/dist/{result-j9nS0se-.js → result-BBbKA61B.js} +13 -17
  72. package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
  73. package/dist/{runner-Y331DoZ5.js → runner-CCuqFSqx.js} +12 -13
  74. package/dist/{sandbox-egress-signals-BUfjEdHY.js → sandbox-egress-signals-DY1mbKF4.js} +2 -3
  75. package/dist/{schema-BBgv0MNf.js → schema-DrMh3NtR.js} +17 -27
  76. package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
  77. package/dist/{session-stop-q-6GNHx6.js → session-stop-CIoFiwwe.js} +57 -41
  78. package/dist/{skills-CyvTsR9M.js → skills-DyQBLIrK.js} +9 -9
  79. package/dist/{spawn-Do5mX3d_.js → spawn-Dqfeo7XP.js} +4 -5
  80. package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
  81. package/dist/{store-D2It0ozF.js → store-DJLwq4x8.js} +13 -15
  82. package/dist/{task-queue-ZMk9bLRT.js → task-queue-BzW4MaWU.js} +5 -7
  83. package/dist/{task-runner-cIGU5VwJ.js → task-runner-D3qJh4fK.js} +22 -26
  84. package/dist/{tasks-CODtRzvX.js → tasks-CEXKTASS.js} +78 -79
  85. package/dist/{thread-state-BPkwVmvK.js → thread-state-W3f6kAtz.js} +13 -19
  86. package/dist/{turn-failure-response-ChmMeKar.js → turn-failure-response-CWx7aNIh.js} +16 -22
  87. package/dist/{turn-lifecycle-BUP7ZOVa.js → turn-lifecycle-C9JFst7-.js} +2 -3
  88. package/dist/{turn-session-routing-BcWM3PLm.js → turn-session-routing-CUxtfpr7.js} +2 -3
  89. package/dist/{validation-DCd69-cP.js → validation-BHRxa5G4.js} +3 -4
  90. package/dist/vercel.d.ts +1 -3
  91. package/dist/vercel.js +1 -2
  92. package/dist/{version-DBc4Qt_P.js → version-C0U6rHg0.js} +3 -5
  93. package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
  94. package/dist/version.d.ts +1 -1
  95. package/dist/version.js +1 -2
  96. package/dist/{viewer-C-9nFKYr.js → viewer-CGvvRqKp.js} +61 -44
  97. package/dist/{web-input-Cv42P3ni.js → web-input-Keb5GRWj.js} +139 -198
  98. package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
  99. package/dist/{work-6UmVQq1V.js → work-DRcsJ3hV.js} +14 -16
  100. package/dist/{worker-DAoBZuZn.js → worker-Cjo-QqPq.js} +7 -8
  101. package/migrations/0059_automation_run_version.sql +2 -0
  102. package/migrations/0060_identity_signed_in_at.sql +1 -0
  103. package/migrations/meta/0059_snapshot.json +3619 -0
  104. package/migrations/meta/0060_snapshot.json +3465 -0
  105. package/migrations/meta/_journal.json +15 -1
  106. package/package.json +8 -6
@@ -1,39 +1,39 @@
1
- import { A as resolveSlackChannelIdFromMessage, B as effectiveTaskOutcomes, Bt as RetryableDeliveryError, C as renderBlockText, D as storeAttachment, Gt as shouldEmitDevAgentTrace, Lt as createUserTokenStore, M as getConversationInfo, N as listThreadReplies, O as parseSlackThreadId, Rt as buildSteeringPiMessage, S as renderAttachmentText, Ut as AuthorizationFlowDisabledError, a as buildAuthPauseResponse, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, r as createContextCompactor, t as createAgentRunner, z as eventAutomationTriggerAvailable, zt as withoutSavedSteeringMessages } from "./agent-runner-C6_cd61V.js";
2
- import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-BVrAp-pq.js";
3
- import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-tPQeUe2i.js";
4
- import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-DdBiDanf.js";
5
- import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
6
- import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-BTtLaeWy.js";
7
- import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-C-9nFKYr.js";
8
- import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers } from "./agent-invocations-BY60iNw-.js";
9
- import { o as juniorAutomationRuns, s as juniorAutomations } from "./executor-BroK9oKy.js";
10
- import { p as instructionProvenanceFor } from "./history-9pO1Zd4Y.js";
11
- import { d as credentialContextForActor } from "./registry-CsNavQ_Z.js";
12
- import { $ as persistWithRetry, $t as createConversationMemoryService, A as formatSlackLink, B as removeReactionFromMessage, C as listAutomationVersions, Ct as commitAcceptedReply, Et as loadConversationProjection, F as addReactionToMessage, Ft as recordAuthorizationCompleted, G as loadTurnCheckpoint, J as completeTurnRecord, K as saveTurnCheckpoint, Kt as persistConversationMessageSummaries, M as normalizeSlackStatusText, Ot as loadProjection, P as truncateStatusText, Q as recordTurnSummary, Qt as buildConversationContext, S as automationDefinition, T as sameDefinitionValue, Ut as hydrateConversationMessages, Wt as persistConversationMessages, X as getTurnRecord, Y as failTurnRecord, Yt as fallbackShortTitle, Z as listTurnSummaries, Zt as appendThreadContextMessages, _ as parseEventAutomationRow, an as recordDeliveredAssistantMessage, bt as trimTrailingAssistantMessages, c as withScheduledAutomationLock, en as estimateConversationContextTokens, f as deleteEventAutomation, h as listDeletedEventAutomationsCreatedBy, i as readScheduledAutomation, in as normalizeConversationText, it as buildTurnErrorResponse, j as normalizeSlackReplyMarkdown, k as escapeSlackMrkdwnText, nn as isHumanConversationMessage, o as saveScheduledAutomationInLock, on as turnHasReply, q as abandonTurnRecord, qt as resolveConversationTitle, r as parseScheduledAutomationRow, rn as markConversationMessage, sn as upsertConversationMessage, tn as getConversationMessageSlackTs, wt as commitMessages, z as postSlackMessage, zt as recordSubscribedReplyRoute } from "./tasks-CODtRzvX.js";
13
- import { Et as getSlackFileId, Gt as normalizeSlackConversationId, Ht as getSlackClient, Kt as runWithSlackInstallationToken, Lt as lookupSlackUser, Ot as readAttachmentVisionSummary, Rt as SlackActionError, Tt as buildSentryConversationUrl, V as cancelSubscriptions, Vt as getHeaderString, Wt as isDmChannel, at as getDashboardConversationLink, it as JUNIOR_THREAD_STATE_TTL_MS, kt as recordSlackAttachment, o as getPluginSlackConversationLink, ot as getDashboardObjectIconLink, rt as verifyTimerWatchCredentialSubject, zt as downloadPrivateSlackFile } from "./agent-hooks-DlSK8PQQ.js";
14
- import { F as readMessageAttachments, R as isVisionImageMediaType } from "./conversation-T18Xlkx9.js";
15
- import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-Bb1zCVGP.js";
16
- import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-DT3MRVW8.js";
17
- import { a as TurnInputDeferredError, c as isTurnInputCommitLostError, d as markTurnCompleted, f as markTurnFailed, i as TurnInputCommitLostError, l as isTurnInputDeferredError, n as ConversationTurnBoundaryError, o as getConversationTurnBoundaryError, p as startActiveTurn, r as CooperativeTurnYieldError, s as isCooperativeTurnYieldError, u as markTurnClosed } from "./oauth-authorization-BA4Dt6a7.js";
18
- import { n as getAssistantReplyText } from "./assistant-reply-yn5G-YEG.js";
19
- import { A as recordFinishedTurnForAutomatedLimit, F as finishedRunReply, P as deliversFinalText, R as runDispatchOutcome, c as timerWatchCredentialSubject, i as skipInputBeforeConversationStop, k as maybePostAutomatedTurnLimitNotice, l as getEventCatalog, s as isEventMailboxMetadata, v as automationEventCatalog } from "./session-stop-q-6GNHx6.js";
20
- import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-C04mP1hu.js";
21
- import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-BbGg3gvu.js";
22
- import { E as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-D2It0ozF.js";
23
- import { l as automationListQuerySchema } from "./automation-CHdlHVZP.js";
24
- import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
25
- import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-xPI_EFSC.js";
26
- import { A as readAutomationRuns, C as readAutomationExecutionByConversationId, D as readAutomationExecutionStatusHours, E as readAutomationExecutionStatusDays, O as readAutomationExecutionSummaries, T as readAutomationExecutionHours, _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, c as getDispatchIdForConversation, d as getDispatchTurnId, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as claimDispatchMailboxAppend, k as readAutomationExecutions, l as getDispatchInputMessageId, n as scheduleSessionCompletedPluginTasks, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, w as readAutomationExecutionDays, x as emptyAutomationRunWindows, y as markDispatchRunning } from "./task-runner-cIGU5VwJ.js";
27
- import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, f as joinMailboxText, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-j9nS0se-.js";
28
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-BUP7ZOVa.js";
29
- import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-6UmVQq1V.js";
30
- import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-BPkwVmvK.js";
31
- import { c as deleteWebAuthorization, d as getPausedTurnRequest, m as getTurnAuthorization, p as wakePausedTurn, s as createWebAuthorization, u as createPausedTurns } from "./connections-CG04HdpC.js";
32
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-BcWM3PLm.js";
33
- import { t as bindMessageAgent } from "./message-DdPGRYQP.js";
34
- import { t as bindSpawnAgent } from "./spawn-Do5mX3d_.js";
35
- import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-ChmMeKar.js";
36
- import { r as storeInputImages } from "./images-D0VZ5nv0.js";
1
+ import { A as resolveSlackChannelIdFromMessage, B as effectiveTaskOutcomes, Bt as RetryableDeliveryError, C as renderBlockText, D as storeAttachment, Gt as shouldEmitDevAgentTrace, Lt as createUserTokenStore, M as getConversationInfo, N as listThreadReplies, O as parseSlackThreadId, Rt as buildSteeringPiMessage, S as renderAttachmentText, Ut as AuthorizationFlowDisabledError, a as buildAuthPauseResponse, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, r as createContextCompactor, t as createAgentRunner, z as eventAutomationTriggerAvailable, zt as withoutSavedSteeringMessages } from "./agent-runner-DGsFQw72.js";
2
+ import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-DbyHuMFU.js";
3
+ import { B as toOptionalNumber, T as withSpan, V as toOptionalString, d as logError, f as logException, m as logWarn, n as createChatSdkLogger, o as getActiveTraceId, p as logInfo, t as buildTurnFailureResponse, v as setSentryUser, w as withLogContext, x as setTags, y as setSpanAttributes, z as isRecord } from "./logging-DsHONhVm.js";
4
+ import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-_WO_AjCB.js";
5
+ import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
6
+ import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-tlxzqaRe.js";
7
+ import { L as createSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore, z as requireSlackDestination } from "./viewer-CGvvRqKp.js";
8
+ import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers } from "./agent-invocations-Qfz7dWgU.js";
9
+ import { a as juniorAutomationRuns, s as juniorAutomations } from "./executor-RvG6kVe1.js";
10
+ import { p as instructionProvenanceFor } from "./history-AY8rs-FR.js";
11
+ import { d as actorLogContext, f as credentialContextForActor } from "./registry-Du566MtJ.js";
12
+ import { $ as recordTurnSummary, $t as buildConversationContext, A as escapeSlackMrkdwnText, B as postSlackMessage, Bt as recordSubscribedReplyRoute, Dt as loadConversationProjection, E as sameDefinitionValue, F as truncateStatusText, Gt as persistConversationMessages, I as addReactionToMessage, It as recordAuthorizationCompleted, J as abandonTurnRecord, Jt as resolveConversationTitle, K as loadTurnCheckpoint, M as normalizeSlackReplyMarkdown, N as normalizeSlackStatusText, Q as listTurnSummaries, Qt as appendThreadContextMessages, S as automationDefinition, Tt as commitMessages, V as removeReactionFromMessage, Wt as hydrateConversationMessages, X as failTurnRecord, Xt as fallbackShortTitle, Y as completeTurnRecord, Z as getTurnRecord, _ as parseEventAutomationRow, an as normalizeConversationText, at as buildTurnErrorResponse, c as withScheduledAutomationLock, cn as upsertConversationMessage, en as createConversationMemoryService, et as persistWithRetry, f as deleteEventAutomation, h as listDeletedEventAutomationsCreatedBy, i as readScheduledAutomation, in as markConversationMessage, j as formatSlackLink, kt as loadProjection, nn as getConversationMessageSlackTs, o as saveScheduledAutomationInLock, on as recordDeliveredAssistantMessage, q as saveTurnCheckpoint, qt as persistConversationMessageSummaries, r as parseScheduledAutomationRow, rn as isHumanConversationMessage, sn as turnHasReply, tn as estimateConversationContextTokens, w as listAutomationVersions, wt as commitAcceptedReply, xt as trimTrailingAssistantMessages } from "./tasks-CEXKTASS.js";
13
+ import { Et as getSlackFileId, Gt as normalizeSlackConversationId, Ht as getSlackClient, Kt as runWithSlackInstallationToken, Lt as lookupSlackUser, Ot as readAttachmentVisionSummary, Rt as SlackActionError, Tt as buildSentryConversationUrl, V as cancelSubscriptions, Vt as getHeaderString, Wt as isDmChannel, at as getDashboardConversationLink, it as JUNIOR_THREAD_STATE_TTL_MS, kt as recordSlackAttachment, o as getPluginSlackConversationLink, ot as getDashboardObjectIconLink, rt as verifyTimerWatchCredentialSubject, zt as downloadPrivateSlackFile } from "./agent-hooks-BJ_5mlRH.js";
14
+ import { F as readMessageAttachments, R as isVisionImageMediaType } from "./conversation-DjN3mlog.js";
15
+ import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-DpYjfKke.js";
16
+ import { a as wasPendingAuthStopped, c as getSubscribedReplyPreflightDecision, d as buildDeterministicTurnId, l as getThreadStopDecision, r as clearPendingAuth, s as decideSubscribedThreadReply, u as buildDeterministicAssistantMessageId } from "./pending-auth-D8J1uJUS.js";
17
+ import { a as TurnInputDeferredError, c as isTurnInputCommitLostError, d as markTurnCompleted, f as markTurnFailed, i as TurnInputCommitLostError, l as isTurnInputDeferredError, n as ConversationTurnBoundaryError, o as getConversationTurnBoundaryError, p as startActiveTurn, r as CooperativeTurnYieldError, s as isCooperativeTurnYieldError, u as markTurnClosed } from "./oauth-authorization-djQn5Nhy.js";
18
+ import { n as getAssistantReplyText } from "./assistant-reply-H1M-91oF.js";
19
+ import { A as maybePostAutomatedTurnLimitNotice, F as deliversFinalText, I as finishedRunReply, c as timerWatchCredentialSubject, i as skipInputBeforeConversationStop, j as recordFinishedTurnForAutomatedLimit, l as getEventCatalog, s as isEventMailboxMetadata, y as automationEventCatalog, z as runDispatchOutcome } from "./session-stop-CIoFiwwe.js";
20
+ import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-xgpyMtg7.js";
21
+ import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-DVe37it2.js";
22
+ import { E as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-DJLwq4x8.js";
23
+ import { l as automationListQuerySchema } from "./automation-DWBFBenG.js";
24
+ import { r as isExperimentalFeatureEnabled } from "./experimental-BNK1l1jv.js";
25
+ import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-CJSUiksE.js";
26
+ import { A as readAutomationExecutions, D as readAutomationExecutionStatusDays, E as readAutomationExecutionHours, O as readAutomationExecutionStatusHours, S as emptyAutomationRunWindows, T as readAutomationExecutionDays, _ as markDispatchBlocked, a as claimDispatchMailboxAppend, b as markDispatchRunning, c as getDispatchConversationId, d as getDispatchRecord, f as getDispatchTurnId, g as markDispatchAwaitingResume, j as readAutomationRuns, k as readAutomationExecutionSummaries, l as getDispatchIdForConversation, m as isTerminalDispatchStatus, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, t as processPluginTask, u as getDispatchInputMessageId, v as markDispatchCompleted, w as readAutomationExecutionByConversationId, y as markDispatchFailed } from "./task-runner-D3qJh4fK.js";
27
+ import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, f as joinMailboxText, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-BBbKA61B.js";
28
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-C9JFst7-.js";
29
+ import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-DRcsJ3hV.js";
30
+ import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-W3f6kAtz.js";
31
+ import { c as deleteWebAuthorization, d as getPausedTurnRequest, m as getTurnAuthorization, p as wakePausedTurn, s as createWebAuthorization, u as createPausedTurns } from "./connections-ag_1JOhB.js";
32
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-CUxtfpr7.js";
33
+ import { t as bindMessageAgent } from "./message-DyitL8no.js";
34
+ import { t as bindSpawnAgent } from "./spawn-Dqfeo7XP.js";
35
+ import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-CWx7aNIh.js";
36
+ import { r as storeInputImages } from "./images-C2J_bj2g.js";
37
37
  import { z } from "zod";
38
38
  import { createHash } from "node:crypto";
39
39
  import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
@@ -41,7 +41,7 @@ import { createSlackSource, createWebSource, localDestinationSchema, objectFactF
41
41
  import { del, get, put } from "@vercel/blob";
42
42
  import { Message, ThreadImpl, stringifyMarkdown } from "chat";
43
43
  import { SlackFormatConverter, createSlackAdapter } from "@chat-adapter/slack";
44
- //#region src/handlers/health.ts
44
+ // src/handlers/health.ts
45
45
  /** Build Junior's process health value for HTTP and reporting consumers. */
46
46
  function readHealthReport() {
47
47
  return healthReportSchema.parse({
@@ -56,8 +56,7 @@ function readHealthReport() {
56
56
  function GET() {
57
57
  return Response.json(readHealthReport());
58
58
  }
59
- //#endregion
60
- //#region src/chat/agent-dispatch/work.ts
59
+ // src/chat/agent-dispatch/work.ts
61
60
  const agentDispatchMailboxMetadataSchema = z.object({
62
61
  dispatchId: z.string().min(1),
63
62
  kind: z.literal("agent_dispatch")
@@ -306,8 +305,7 @@ function createAgentDispatchConversationWorker(options) {
306
305
  }
307
306
  };
308
307
  }
309
- //#endregion
310
- //#region src/chat/attachments/vercel.ts
308
+ // src/chat/attachments/vercel.ts
311
309
  /** Store private conversation attachments in Vercel Blob. */
312
310
  function createVercelAttachmentStorage() {
313
311
  return {
@@ -333,8 +331,7 @@ function createVercelAttachmentStorage() {
333
331
  }
334
332
  };
335
333
  }
336
- //#endregion
337
- //#region src/chat/slack/automation-card.ts
334
+ // src/chat/slack/automation-card.ts
338
335
  function preview(text, length) {
339
336
  const compact = text.replace(/\s+/g, " ").trim();
340
337
  return compact.length > length ? `${compact.slice(0, length - 1)}…` : compact;
@@ -390,8 +387,7 @@ function renderSlackAutomationCard(card) {
390
387
  }
391
388
  };
392
389
  }
393
- //#endregion
394
- //#region src/chat/slack/object-card.ts
390
+ // src/chat/slack/object-card.ts
395
391
  function descriptionPreview(value) {
396
392
  const text = value?.replace(/\r\n/g, "\n").trim() ?? "";
397
393
  const preview = text.split("\n").slice(0, 6).join("\n").slice(0, 500);
@@ -497,8 +493,47 @@ function renderSlackObjectCard(card, conversationId, surface = "preview") {
497
493
  }
498
494
  };
499
495
  }
500
- //#endregion
501
- //#region src/chat/slack/errors.ts
496
+ // src/chat/slack/adapter-context.ts
497
+ const initializedAdapters = /* @__PURE__ */ new WeakSet();
498
+ async function getConnectedState$1(stateAdapter) {
499
+ const state = stateAdapter ?? getStateAdapter();
500
+ await state.connect();
501
+ return state;
502
+ }
503
+ /** Initialize the Slack adapter against the repository state adapter. */
504
+ async function ensureSlackAdapterInitialized(args) {
505
+ if (initializedAdapters.has(args.adapter)) return;
506
+ const state = await getConnectedState$1(args.state);
507
+ await args.adapter.initialize({ getState: () => state });
508
+ if (args.adapter.defaultBotTokenProvider && !args.adapter.botUserId) throw new Error("Slack adapter initialized without a resolved bot user id");
509
+ initializedAdapters.add(args.adapter);
510
+ }
511
+ /** Verify a Slack request using the adapter's configured signing secret. */
512
+ function verifySlackSignature(args) {
513
+ const verifySignature = args.adapter.verifySignature;
514
+ if (!verifySignature) throw new Error("Slack adapter does not expose signature verification");
515
+ return verifySignature.call(args.adapter, args.body, args.request.headers.get("x-slack-request-timestamp"), args.request.headers.get("x-slack-signature"));
516
+ }
517
+ /** Run Slack work with the installation token that matches the inbound event. */
518
+ async function runWithSlackInstallation(args) {
519
+ await ensureSlackAdapterInitialized({
520
+ adapter: args.adapter,
521
+ state: args.state
522
+ });
523
+ const internals = args.adapter;
524
+ if (internals.defaultBotTokenProvider) return await args.task();
525
+ const installationId = args.installation.isEnterpriseInstall ? args.installation.enterpriseId : args.installation.teamId;
526
+ if (!installationId) throw new Error("Slack installation context is missing team id");
527
+ if (!internals.resolveTokenForTeam || !internals.requestContext) throw new Error("Slack adapter cannot resolve workspace installations");
528
+ const tokenContext = await internals.resolveTokenForTeam.call(args.adapter, installationId, args.installation.isEnterpriseInstall);
529
+ if (!tokenContext) throw new Error(`Slack installation token was not found for ${installationId}`);
530
+ return await internals.requestContext.run({
531
+ ...tokenContext,
532
+ enterpriseId: args.installation.enterpriseId,
533
+ isEnterpriseInstall: args.installation.isEnterpriseInstall
534
+ }, () => runWithSlackInstallationToken(tokenContext.token, args.task));
535
+ }
536
+ // src/chat/slack/errors.ts
502
537
  /** Extract Slack's stable API error code from Web API errors. */
503
538
  function getSlackApiErrorCode(error) {
504
539
  if (!error || typeof error !== "object") return;
@@ -544,8 +579,7 @@ function isSlackTitlePermissionError(error) {
544
579
  const code = getSlackApiErrorCode(error);
545
580
  return code === "no_permission" || code === "missing_scope" || code === "not_allowed_token_type";
546
581
  }
547
- //#endregion
548
- //#region src/chat/slack/message/content.ts
582
+ // src/chat/slack/message/content.ts
549
583
  /**
550
584
  * Slack message content projection.
551
585
  *
@@ -606,8 +640,7 @@ function parseContent(message) {
606
640
  topLevelText
607
641
  };
608
642
  }
609
- //#endregion
610
- //#region src/chat/runtime/thread-context.ts
643
+ // src/chat/runtime/thread-context.ts
611
644
  function escapeRegExp(value) {
612
645
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
613
646
  }
@@ -679,8 +712,7 @@ function getMessageTs(message) {
679
712
  if (ts) return ts;
680
713
  }
681
714
  }
682
- //#endregion
683
- //#region src/chat/providers/slack/processing-reaction.ts
715
+ // src/chat/providers/slack/processing-reaction.ts
684
716
  const noProcessingReaction = {
685
717
  complete: async () => void 0,
686
718
  keep: () => void 0,
@@ -768,16 +800,14 @@ async function startProcessingReactionForMessage(args) {
768
800
  }
769
801
  };
770
802
  }
771
- //#endregion
772
- //#region src/chat/slack/message-control.ts
803
+ // src/chat/slack/message-control.ts
773
804
  /** Leading Slack mention forms that may precede an explicit steering marker. */
774
805
  const LEADING_MENTION_BEFORE_STEERING_RE = /^(\s*(?:<@[^>]+>|@[A-Za-z0-9._-]+\b)[\s,:-]*)!!\s*/;
775
806
  /** Remove the explicit Slack steering marker before building agent input. */
776
807
  function stripLeadingSteeringOverride(text) {
777
808
  return text.replace(LEADING_MENTION_BEFORE_STEERING_RE, "$1").replace(/^\s*!!\s*/, "");
778
809
  }
779
- //#endregion
780
- //#region src/chat/runtime/turn-input.ts
810
+ // src/chat/runtime/turn-input.ts
781
811
  function combineTextParts(queuedTexts, latestText) {
782
812
  const parts = [...queuedTexts, latestText].filter((part) => part.trim().length > 0);
783
813
  return parts.length > 0 ? parts.join("\n\n") : latestText;
@@ -789,8 +819,7 @@ function combineTurnText(queuedMessages, latestText) {
789
819
  userText: combineTextParts(queuedMessages.map((message) => message.userText), latestText.userText)
790
820
  };
791
821
  }
792
- //#endregion
793
- //#region src/chat/services/message-actor-identity.ts
822
+ // src/chat/services/message-actor-identity.ts
794
823
  const messageActors = /* @__PURE__ */ new WeakMap();
795
824
  function canonicalUserId(author, actor) {
796
825
  const authorUserId = parseActorUserId(author.userId);
@@ -839,8 +868,7 @@ async function ensureSlackMessageActorIdentity(message, teamId, lookupSlackUser)
839
868
  if (actor.platform !== "slack") throw new Error("Slack message actor identity requires a Slack actor");
840
869
  return actor;
841
870
  }
842
- //#endregion
843
- //#region src/chat/providers/slack/runtime.ts
871
+ // src/chat/providers/slack/runtime.ts
844
872
  /** Sent when a stop decision unsubscribes a thread. */
845
873
  const THREAD_OPTOUT_ACK = "Understood. I'll stay out of this thread unless someone @mentions me again.";
846
874
  /** Preserve retry/yield control flow for the durable worker boundary. */
@@ -944,7 +972,7 @@ function createSlackTurnRuntime(deps) {
944
972
  const processingReactions = [];
945
973
  const processingReactionByMessage = /* @__PURE__ */ new Map();
946
974
  return {
947
- start: async (context, targetMessage) => {
975
+ start: async (_context, targetMessage) => {
948
976
  const channelId = getChannelId(thread, targetMessage);
949
977
  const messageTs = getMessageTs(targetMessage);
950
978
  const reactionKey = channelId && messageTs ? `${channelId}:${messageTs}` : void 0;
@@ -1571,8 +1599,7 @@ function createSlackTurnRuntime(deps) {
1571
1599
  }
1572
1600
  };
1573
1601
  }
1574
- //#endregion
1575
- //#region src/chat/conversations/stop.ts
1602
+ // src/chat/conversations/stop.ts
1576
1603
  /** Stop the current Conversation Turn and wake an idle resume when needed. */
1577
1604
  async function stopConversationTurn(args) {
1578
1605
  const nowMs = args.nowMs ?? Date.now();
@@ -1608,8 +1635,7 @@ async function stopConversationTurn(args) {
1608
1635
  });
1609
1636
  return result;
1610
1637
  }
1611
- //#endregion
1612
- //#region src/chat/ingress/message-router.ts
1638
+ // src/chat/ingress/message-router.ts
1613
1639
  /** Derive canonical Slack thread IDs from the raw event payload. */
1614
1640
  /** Rebuild a Message onto a normalized Slack thread id. */
1615
1641
  function withNormalizedThreadId(message, threadId) {
@@ -1641,8 +1667,7 @@ function nonEmptyString(value) {
1641
1667
  if (typeof value !== "string") return void 0;
1642
1668
  return value.trim() || void 0;
1643
1669
  }
1644
- //#endregion
1645
- //#region src/chat/slack/attachment-fetchers.ts
1670
+ // src/chat/slack/attachment-fetchers.ts
1646
1671
  /**
1647
1672
  * Restore Slack private-file fetchers on message attachments that crossed a
1648
1673
  * serialization boundary.
@@ -1650,8 +1675,7 @@ function nonEmptyString(value) {
1650
1675
  function rehydrateAttachmentFetchers(message, downloadPrivateSlackFile$1 = downloadPrivateSlackFile) {
1651
1676
  for (const attachment of message.attachments) if (!attachment.fetchData && attachment.url) attachment.fetchData = () => downloadPrivateSlackFile$1(attachment.url);
1652
1677
  }
1653
- //#endregion
1654
- //#region src/chat/slack/thread-stop.ts
1678
+ // src/chat/slack/thread-stop.ts
1655
1679
  const watermarksSchema = z.object({
1656
1680
  mentionAtMs: z.number().finite().optional(),
1657
1681
  stopAtMs: z.number().finite().optional()
@@ -1727,49 +1751,7 @@ async function subscribeSlackThreadForMessage(args) {
1727
1751
  if (!result.acquired) throw new Error(`Could not lock Slack stop state for ${args.thread.id}`);
1728
1752
  return result.value;
1729
1753
  }
1730
- //#endregion
1731
- //#region src/chat/slack/adapter-context.ts
1732
- const initializedAdapters = /* @__PURE__ */ new WeakSet();
1733
- async function getConnectedState$1(stateAdapter) {
1734
- const state = stateAdapter ?? getStateAdapter();
1735
- await state.connect();
1736
- return state;
1737
- }
1738
- /** Initialize the Slack adapter against the repository state adapter. */
1739
- async function ensureSlackAdapterInitialized(args) {
1740
- if (initializedAdapters.has(args.adapter)) return;
1741
- const state = await getConnectedState$1(args.state);
1742
- await args.adapter.initialize({ getState: () => state });
1743
- if (args.adapter.defaultBotTokenProvider && !args.adapter.botUserId) throw new Error("Slack adapter initialized without a resolved bot user id");
1744
- initializedAdapters.add(args.adapter);
1745
- }
1746
- /** Verify a Slack request using the adapter's configured signing secret. */
1747
- function verifySlackSignature(args) {
1748
- const verifySignature = args.adapter.verifySignature;
1749
- if (!verifySignature) throw new Error("Slack adapter does not expose signature verification");
1750
- return verifySignature.call(args.adapter, args.body, args.request.headers.get("x-slack-request-timestamp"), args.request.headers.get("x-slack-signature"));
1751
- }
1752
- /** Run Slack work with the installation token that matches the inbound event. */
1753
- async function runWithSlackInstallation(args) {
1754
- await ensureSlackAdapterInitialized({
1755
- adapter: args.adapter,
1756
- state: args.state
1757
- });
1758
- const internals = args.adapter;
1759
- if (internals.defaultBotTokenProvider) return await args.task();
1760
- const installationId = args.installation.isEnterpriseInstall ? args.installation.enterpriseId : args.installation.teamId;
1761
- if (!installationId) throw new Error("Slack installation context is missing team id");
1762
- if (!internals.resolveTokenForTeam || !internals.requestContext) throw new Error("Slack adapter cannot resolve workspace installations");
1763
- const tokenContext = await internals.resolveTokenForTeam.call(args.adapter, installationId, args.installation.isEnterpriseInstall);
1764
- if (!tokenContext) throw new Error(`Slack installation token was not found for ${installationId}`);
1765
- return await internals.requestContext.run({
1766
- ...tokenContext,
1767
- enterpriseId: args.installation.enterpriseId,
1768
- isEnterpriseInstall: args.installation.isEnterpriseInstall
1769
- }, () => runWithSlackInstallationToken(tokenContext.token, args.task));
1770
- }
1771
- //#endregion
1772
- //#region src/chat/task-execution/slack-work.ts
1754
+ // src/chat/task-execution/slack-work.ts
1773
1755
  const slackConversationRouteSchema = z.enum(["mention", "subscribed"]);
1774
1756
  function hasSteeringOverride(text) {
1775
1757
  return stripLeadingSteeringOverride(text) !== text;
@@ -2241,8 +2223,7 @@ function buildSlackInboundMessage(args) {
2241
2223
  }
2242
2224
  };
2243
2225
  }
2244
- //#endregion
2245
- //#region src/chat/slack/message/identity.ts
2226
+ // src/chat/slack/message/identity.ts
2246
2227
  /**
2247
2228
  * Preserve the native Slack message timestamp when a synthetic message ID is
2248
2229
  * used for routing or deduplication.
@@ -2252,8 +2233,7 @@ function getMessageTimestamp(message) {
2252
2233
  if (idTs) return idTs;
2253
2234
  if (message.raw && typeof message.raw === "object") return parseSlackMessageTs(message.raw.ts);
2254
2235
  }
2255
- //#endregion
2256
- //#region src/chat/slack/vision-context.ts
2236
+ // src/chat/slack/vision-context.ts
2257
2237
  const MAX_USER_ATTACHMENTS = 3;
2258
2238
  const MAX_USER_ATTACHMENT_BYTES = 5242880;
2259
2239
  const MAX_MESSAGE_IMAGE_ATTACHMENTS = 3;
@@ -2676,8 +2656,7 @@ function createVisionContextService(deps) {
2676
2656
  hydrateConversationVisionContext: async (conversation, context) => await hydrateConversationVisionContextWithDeps(conversation, context, deps)
2677
2657
  };
2678
2658
  }
2679
- //#endregion
2680
- //#region src/chat/runtime/conversation-message.ts
2659
+ // src/chat/runtime/conversation-message.ts
2681
2660
  const NON_TEXT_MESSAGE_TEXT = "[non-text message]";
2682
2661
  function resolveMessageText(args) {
2683
2662
  return normalizeConversationText(args.text) || NON_TEXT_MESSAGE_TEXT;
@@ -2729,8 +2708,7 @@ function recordSkippedConversationMessage(args) {
2729
2708
  }
2730
2709
  });
2731
2710
  }
2732
- //#endregion
2733
- //#region src/chat/automations/collection.ts
2711
+ // src/chat/automations/collection.ts
2734
2712
  /**
2735
2713
  * The web collection applies access before counts, filter options, and paging.
2736
2714
  * Keep its ownership rules aligned with the direct Automation reader. A public
@@ -2809,8 +2787,7 @@ async function readAutomationCollection(user, input) {
2809
2787
  destinations
2810
2788
  };
2811
2789
  }
2812
- //#endregion
2813
- //#region src/chat/automations/creator.ts
2790
+ // src/chat/automations/creator.ts
2814
2791
  /**
2815
2792
  * Return whether the user created the Automation. Both kinds store the
2816
2793
  * creating Junior identity, so one rule decides ownership.
@@ -2818,8 +2795,7 @@ async function readAutomationCollection(user, input) {
2818
2795
  function isAutomationCreator(user, automation) {
2819
2796
  return user.identities.some((identity) => identity.id === automation.creatorIdentityId);
2820
2797
  }
2821
- //#endregion
2822
- //#region src/chat/scheduled-automations/personal.ts
2798
+ // src/chat/scheduled-automations/personal.ts
2823
2799
  var PersonalScheduledAutomationNotFoundError = class extends Error {
2824
2800
  constructor() {
2825
2801
  super("Scheduled automation was not found.");
@@ -2840,8 +2816,7 @@ async function deleteViewerScheduledAutomation(db, user, id, nowMs = Date.now())
2840
2816
  }, task);
2841
2817
  });
2842
2818
  }
2843
- //#endregion
2844
- //#region src/chat/automations/read.ts
2819
+ // src/chat/automations/read.ts
2845
2820
  const TASK_EXECUTION_LIST_LIMIT = 100;
2846
2821
  const AUTOMATION_VERSION_LIST_LIMIT = 100;
2847
2822
  function creatorLabel(creator) {
@@ -3287,8 +3262,7 @@ async function deleteViewerTask(user, id) {
3287
3262
  }
3288
3263
  await deleteEventAutomation(getDb(), id);
3289
3264
  }
3290
- //#endregion
3291
- //#region src/chat/slack/assistant-thread/status-send.ts
3265
+ // src/chat/slack/assistant-thread/status-send.ts
3292
3266
  /**
3293
3267
  * Slack's assistant loading UI accepts both `status` and `loading_messages`,
3294
3268
  * but product policy keeps `status` stable and generic. User-visible progress
@@ -3374,8 +3348,7 @@ function logAssistantStatusFailure(args) {
3374
3348
  "exception.message": args.error instanceof Error ? args.error.message : String(args.error)
3375
3349
  });
3376
3350
  }
3377
- //#endregion
3378
- //#region src/chat/services/subscribed-reply-policy.ts
3351
+ // src/chat/services/subscribed-reply-policy.ts
3379
3352
  function createSubscribedReplyPolicy(deps) {
3380
3353
  return async (args) => {
3381
3354
  const decision = await decideSubscribedThreadReply({
@@ -3396,8 +3369,7 @@ function createSubscribedReplyPolicy(deps) {
3396
3369
  };
3397
3370
  };
3398
3371
  }
3399
- //#endregion
3400
- //#region src/chat/app/services.ts
3372
+ // src/chat/app/services.ts
3401
3373
  function createJuniorRuntimeServices(overrides = {}) {
3402
3374
  const conversationMemory = createConversationMemoryService({ completeText: overrides.conversationMemory?.completeText ?? completeText });
3403
3375
  const contextCompactor = createContextCompactor({
@@ -3423,8 +3395,7 @@ function createJuniorRuntimeServices(overrides = {}) {
3423
3395
  visionContext
3424
3396
  };
3425
3397
  }
3426
- //#endregion
3427
- //#region src/chat/slack/action-token.ts
3398
+ // src/chat/slack/action-token.ts
3428
3399
  const slackActionTokenSchema = z.string().trim().min(1).brand();
3429
3400
  const slackMessageEnvelopeSchema = z.object({ raw: z.object({ action_token: z.unknown().optional() }).optional() });
3430
3401
  /** Parse the ephemeral search token from an untrusted Slack message envelope. */
@@ -3434,8 +3405,7 @@ function readSlackActionToken(message) {
3434
3405
  const token = slackActionTokenSchema.safeParse(envelope.data.raw?.action_token);
3435
3406
  return token.success ? token.data : void 0;
3436
3407
  }
3437
- //#endregion
3438
- //#region src/chat/slack/cards.ts
3408
+ // src/chat/slack/cards.ts
3439
3409
  /** Select the Slack object renderer for a built-in card. */
3440
3410
  function renderSlackCard(card, conversationId) {
3441
3411
  switch (card.kind) {
@@ -3443,8 +3413,7 @@ function renderSlackCard(card, conversationId) {
3443
3413
  case "automation": return renderSlackAutomationCard(card);
3444
3414
  }
3445
3415
  }
3446
- //#endregion
3447
- //#region src/chat/slack/footer.ts
3416
+ // src/chat/slack/footer.ts
3448
3417
  /** Render compact reply attribution for the Slack footer. */
3449
3418
  function formatReplyAttribution(attribution) {
3450
3419
  return attribution.detail ? `${attribution.label} · ${attribution.detail}` : attribution.label;
@@ -3492,8 +3461,7 @@ function buildSlackReplyBlocks(text, footer) {
3492
3461
  }
3493
3462
  return blocks.length ? blocks : void 0;
3494
3463
  }
3495
- //#endregion
3496
- //#region src/chat/slack/output.ts
3464
+ // src/chat/slack/output.ts
3497
3465
  const MAX_INLINE_CHARS = 2200;
3498
3466
  const MAX_INLINE_LINES = 45;
3499
3467
  const CONTINUED_MARKER = "\n\n[Continued below]";
@@ -3537,7 +3505,7 @@ function getFenceContinuation(text) {
3537
3505
  for (const line of text.split("\n")) {
3538
3506
  const trimmed = line.trimStart();
3539
3507
  const openerMatch = trimmed.match(/^(`{3,}|~{3,})(.*)$/);
3540
- if (!openerMatch) continue;
3508
+ if (!openerMatch?.[1]) continue;
3541
3509
  if (!open) {
3542
3510
  open = {
3543
3511
  fence: openerMatch[1],
@@ -3666,8 +3634,7 @@ function buildSlackOutputMessage(text) {
3666
3634
  if (!normalized) throw new Error(`Slack output normalized to empty content: original_length=${text.length} parsed_length=${normalized.length}`);
3667
3635
  return { markdown: normalized };
3668
3636
  }
3669
- //#endregion
3670
- //#region src/chat/slack/reply.ts
3637
+ // src/chat/slack/reply.ts
3671
3638
  /**
3672
3639
  * Send one destination-visible Slack reply.
3673
3640
  *
@@ -3724,8 +3691,7 @@ async function sendSlackReply(args) {
3724
3691
  }
3725
3692
  return messageTs;
3726
3693
  }
3727
- //#endregion
3728
- //#region src/chat/slack/assistant-thread/status-render.ts
3694
+ // src/chat/slack/assistant-thread/status-render.ts
3729
3695
  const DEFAULT_STATUS_CONTEXTS = {
3730
3696
  thinking: "…",
3731
3697
  searching: "sources",
@@ -3765,8 +3731,7 @@ function selectAssistantLoadingMessages(args) {
3765
3731
  }
3766
3732
  return shuffled.slice(0, 10);
3767
3733
  }
3768
- //#endregion
3769
- //#region src/chat/slack/assistant-thread/status-scheduler.ts
3734
+ // src/chat/slack/assistant-thread/status-scheduler.ts
3770
3735
  const STATUS_UPDATE_DEBOUNCE_MS = 1e3;
3771
3736
  const STATUS_MIN_VISIBLE_MS = 1200;
3772
3737
  const STATUS_ROTATION_INTERVAL_MS = 3e4;
@@ -3819,7 +3784,8 @@ function createAssistantStatusScheduler(args) {
3819
3784
  };
3820
3785
  const getLoadingMessagesForVisibleStatus = (visible) => visible ? [visible] : void 0;
3821
3786
  const getInitialStatusText = () => {
3822
- if (loadingMessages?.length) return loadingMessages[0];
3787
+ const [firstLoadingMessage] = loadingMessages ?? [];
3788
+ if (firstLoadingMessage) return firstLoadingMessage;
3823
3789
  return defaultStatus.text;
3824
3790
  };
3825
3791
  const haveSameLoadingMessages = (left, right) => {
@@ -3916,8 +3882,7 @@ function createAssistantStatusScheduler(args) {
3916
3882
  }
3917
3883
  };
3918
3884
  }
3919
- //#endregion
3920
- //#region src/chat/slack/assistant-thread/status.ts
3885
+ // src/chat/slack/assistant-thread/status.ts
3921
3886
  /**
3922
3887
  * Create a Slack adapter-backed session for Slack's assistant loading state.
3923
3888
  *
@@ -3957,8 +3922,7 @@ function createSlackWebApiAssistantStatusSession(args) {
3957
3922
  random: args.random
3958
3923
  });
3959
3924
  }
3960
- //#endregion
3961
- //#region src/chat/slack/assistant-thread/title.ts
3925
+ // src/chat/slack/assistant-thread/title.ts
3962
3926
  /** Set-once DM title projection for the current process. */
3963
3927
  const projectedAssistantTitles = /* @__PURE__ */ new Set();
3964
3928
  function assistantTitleKey(channelId, threadTs) {
@@ -3995,8 +3959,7 @@ async function maybeSyncAssistantTitle(args) {
3995
3959
  logWarn("thread.title.slack_update.failed", { "exception.message": error instanceof Error ? error.message : String(error) });
3996
3960
  }
3997
3961
  }
3998
- //#endregion
3999
- //#region src/chat/slack/conversation-context.ts
3962
+ // src/chat/slack/conversation-context.ts
4000
3963
  function normalizeConversationName(type, channelName) {
4001
3964
  const trimmed = channelName?.trim();
4002
3965
  if (!trimmed) return void 0;
@@ -4085,8 +4048,7 @@ function formatSlackConversationRedactedLabel(context) {
4085
4048
  if (!context) return void 0;
4086
4049
  return formatSlackConversationTypeLabel(context.type);
4087
4050
  }
4088
- //#endregion
4089
- //#region src/chat/services/provider-default-config.ts
4051
+ // src/chat/services/provider-default-config.ts
4090
4052
  const GITHUB_REPO_PART = String.raw`[A-Za-z0-9_.-]*[A-Za-z0-9_-]`;
4091
4053
  const GITHUB_REPO_RE = new RegExp(String.raw`^\s*(?:set|use)\s+(?:the\s+)?default\s+(?:github\s+)?repo(?:sitory)?\s+(?:to|as)\s+(${GITHUB_REPO_PART}/${GITHUB_REPO_PART})(?:\s+for\s+this\s+channel)?[.!?]?\s*$`, "i");
4092
4054
  /** Apply explicit provider-default config requests that do not need agent reasoning. */
@@ -4101,8 +4063,7 @@ async function maybeApplyProviderDefaultConfigRequest(args) {
4101
4063
  });
4102
4064
  return { text: `Default GitHub repo set to \`${repo}\`.` };
4103
4065
  }
4104
- //#endregion
4105
- //#region src/chat/conversations/destination-visibility.ts
4066
+ // src/chat/conversations/destination-visibility.ts
4106
4067
  /** Read confirmed visibility from the current signal or persisted destination. */
4107
4068
  async function resolveDestinationVisibility(args) {
4108
4069
  if (args.visibility) return args.visibility;
@@ -4113,8 +4074,7 @@ async function resolveDestinationVisibility(args) {
4113
4074
  providerTenantId: args.destination.teamId
4114
4075
  });
4115
4076
  }
4116
- //#endregion
4117
- //#region src/chat/providers/slack/input.ts
4077
+ // src/chat/providers/slack/input.ts
4118
4078
  function renderRecentThreadMessageLines(conversationContext, messages) {
4119
4079
  const messagesForContext = messages.filter((queued) => {
4120
4080
  if (queued.explicitMention) return false;
@@ -4221,8 +4181,7 @@ async function saveSteeringMessages(args) {
4221
4181
  await state.releaseLock(lock);
4222
4182
  }
4223
4183
  }
4224
- //#endregion
4225
- //#region src/chat/providers/slack/turn.ts
4184
+ // src/chat/providers/slack/turn.ts
4226
4185
  /**
4227
4186
  * Add Slack behavior around one Turn.
4228
4187
  *
@@ -5131,8 +5090,7 @@ function createSlackTurn(deps) {
5131
5090
  });
5132
5091
  };
5133
5092
  }
5134
- //#endregion
5135
- //#region src/chat/slack/assistant-thread/lifecycle.ts
5093
+ // src/chat/slack/assistant-thread/lifecycle.ts
5136
5094
  async function syncAssistantThreadContext(event, options) {
5137
5095
  const channelId = normalizeSlackConversationId(event.channelId);
5138
5096
  if (!channelId) throw new Error("Assistant thread initialization requires a channel ID");
@@ -5161,8 +5119,7 @@ async function initializeAssistantThread(event) {
5161
5119
  async function refreshAssistantThreadContext(event) {
5162
5120
  await syncAssistantThreadContext(event, { setInitialTitle: false });
5163
5121
  }
5164
- //#endregion
5165
- //#region src/chat/slack/vision-cache.ts
5122
+ // src/chat/slack/vision-cache.ts
5166
5123
  const VISION_CACHE_SCHEMA_VERSION = 1;
5167
5124
  const VISION_CACHE_TTL_MS = 6048e5;
5168
5125
  function visionCacheKey(conversationId) {
@@ -5203,8 +5160,7 @@ async function persistConversationVisionCache(conversationId, vision) {
5203
5160
  byFileId: vision.byFileId
5204
5161
  }, VISION_CACHE_TTL_MS);
5205
5162
  }
5206
- //#endregion
5207
- //#region src/chat/runtime/turn-preparation.ts
5163
+ // src/chat/runtime/turn-preparation.ts
5208
5164
  const BACKFILL_MESSAGE_LIMIT = 80;
5209
5165
  function hasPendingImageHydration(conversation) {
5210
5166
  return conversation.messages.some((message) => isHumanConversationMessage(message) && !message.meta?.imagesHydrated);
@@ -5337,8 +5293,7 @@ function createPrepareTurnState(deps) {
5337
5293
  };
5338
5294
  };
5339
5295
  }
5340
- //#endregion
5341
- //#region src/chat/slack/dispatch-turn.ts
5296
+ // src/chat/slack/dispatch-turn.ts
5342
5297
  /** Build the Slack provider adapter for agent-dispatched conversation turns. */
5343
5298
  function createSlackDispatchTurnRunner(options) {
5344
5299
  return async function runSlackDispatchTurn(dispatch, hooks) {
@@ -5420,8 +5375,7 @@ function createSlackDispatchTurnRunner(options) {
5420
5375
  };
5421
5376
  };
5422
5377
  }
5423
- //#endregion
5424
- //#region src/chat/app/factory.ts
5378
+ // src/chat/app/factory.ts
5425
5379
  function clearSkippedTurnIfActive(conversation, messageId) {
5426
5380
  if (conversation.processing.activeTurnId === buildDeterministicTurnId(messageId)) conversation.processing.activeTurnId = void 0;
5427
5381
  }
@@ -5528,8 +5482,7 @@ function createSlackRuntime(options) {
5528
5482
  })
5529
5483
  };
5530
5484
  }
5531
- //#endregion
5532
- //#region src/chat/slack/adapter.ts
5485
+ // src/chat/slack/adapter.ts
5533
5486
  /**
5534
5487
  * Create the repository's Slack adapter.
5535
5488
  *
@@ -5540,8 +5493,7 @@ function createSlackRuntime(options) {
5540
5493
  function createJuniorSlackAdapter(config) {
5541
5494
  return createSlackAdapter(config);
5542
5495
  }
5543
- //#endregion
5544
- //#region src/chat/providers/slack/resume.ts
5496
+ // src/chat/providers/slack/resume.ts
5545
5497
  /**
5546
5498
  * Resume a Slack Turn from saved Run state.
5547
5499
  *
@@ -5598,12 +5550,10 @@ function createReadOnlyConfigService(rawValues) {
5598
5550
  };
5599
5551
  }
5600
5552
  function getResumeLogContext(args) {
5601
- const actor = args.run?.actor;
5602
5553
  return {
5603
5554
  conversationId: args.conversationId,
5604
5555
  messageConversationId: args.conversationId,
5605
- userId: isUserActor(actor) ? actor.userId : void 0,
5606
- userName: isUserActor(actor) ? actor.userName : void 0,
5556
+ ...actorLogContext(args.run?.actor, args.run?.credentialContext),
5607
5557
  destinationName: args.channelId,
5608
5558
  assistantUserName: botConfig.userName,
5609
5559
  modelId: defaultModelId(botConfig)
@@ -6036,8 +5986,7 @@ async function resumeSlackTurnInContext(args) {
6036
5986
  if (deferredFailureHandler) await deferredFailureHandler();
6037
5987
  return true;
6038
5988
  }
6039
- //#endregion
6040
- //#region src/chat/task-execution/paused-turn.ts
5989
+ // src/chat/task-execution/paused-turn.ts
6041
5990
  /**
6042
5991
  * Worker continue for paused turns under the conversation lease.
6043
5992
  *
@@ -6523,8 +6472,7 @@ async function runNextPausedTurnInContext(conversationId, options, runOptions) {
6523
6472
  }
6524
6473
  return false;
6525
6474
  }
6526
- //#endregion
6527
- //#region src/chat/task-execution/assistant-message.ts
6475
+ // src/chat/task-execution/assistant-message.ts
6528
6476
  /** Store one assistant Message and its Agent history. */
6529
6477
  async function commitAssistantMessage(args) {
6530
6478
  const conversationMessageId = recordDeliveredAssistantMessage({
@@ -6548,8 +6496,7 @@ async function commitAssistantMessage(args) {
6548
6496
  logException(error, "conversation.assistant.message_persist.failed");
6549
6497
  }
6550
6498
  }
6551
- //#endregion
6552
- //#region src/chat/conversations/destination.ts
6499
+ // src/chat/conversations/destination.ts
6553
6500
  function requireLocalDestination(conversationId) {
6554
6501
  const parsed = localDestinationSchema.safeParse({
6555
6502
  platform: "local",
@@ -6568,8 +6515,7 @@ function requireLocalDestination(conversationId) {
6568
6515
  function resolveConversationDestination(args) {
6569
6516
  return args.existing ?? requireLocalDestination(args.conversationId);
6570
6517
  }
6571
- //#endregion
6572
- //#region src/chat/task-execution/conversation-turn.ts
6518
+ // src/chat/task-execution/conversation-turn.ts
6573
6519
  /** Run a mailbox Turn and store its assistant Messages. */
6574
6520
  function stableHex$1(...parts) {
6575
6521
  return createHash("sha256").update(parts.join("\0")).digest("hex").slice(0, 24);
@@ -7029,8 +6975,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7029
6975
  });
7030
6976
  };
7031
6977
  }
7032
- //#endregion
7033
- //#region src/chat/providers/slack/system-turn.ts
6978
+ // src/chat/providers/slack/system-turn.ts
7034
6979
  /**
7035
6980
  * Deliver system Turn output to Slack without a webhook Message.
7036
6981
  *
@@ -7071,8 +7016,7 @@ function createSlackSystemTurnDelivery(args) {
7071
7016
  };
7072
7017
  };
7073
7018
  }
7074
- //#endregion
7075
- //#region src/chat/app/conversation-work.ts
7019
+ // src/chat/app/conversation-work.ts
7076
7020
  /**
7077
7021
  * Build conversation work once for production and integration tests.
7078
7022
  * The app chooses the queue, state, Slack, and agent values here.
@@ -7159,8 +7103,7 @@ function createConversationWork(options) {
7159
7103
  waitUntil: options.waitUntil
7160
7104
  };
7161
7105
  }
7162
- //#endregion
7163
- //#region src/chat/app/production.ts
7106
+ // src/chat/app/production.ts
7164
7107
  let productionSlackAdapter;
7165
7108
  function createProductionSlackAdapter() {
7166
7109
  const signingSecret = getSlackSigningSecret();
@@ -7213,8 +7156,7 @@ function createProductionConversationWorkOptions(options) {
7213
7156
  waitUntil: options.waitUntil
7214
7157
  });
7215
7158
  }
7216
- //#endregion
7217
- //#region src/chat/conversations/web-input.ts
7159
+ // src/chat/conversations/web-input.ts
7218
7160
  function normalizeEmail(email) {
7219
7161
  return email.trim().toLowerCase();
7220
7162
  }
@@ -7375,5 +7317,4 @@ async function appendAndEnqueueWebMessage(input, options) {
7375
7317
  status
7376
7318
  };
7377
7319
  }
7378
- //#endregion
7379
- export { withNormalizedThreadId as A, readHealthReport as B, buildSlackInboundMessage as C, isSlackMessageStopped as D, verifySlackSignature as E, renderSlackObjectCard as F, createVercelAttachmentStorage as I, AGENT_DISPATCH_MAX_AGE_MS as L, THREAD_OPTOUT_ACK as M, startProcessingReaction as N, stopSlackThread as O, parseContent as P, enqueueAgentDispatch as R, recordSkippedConversationMessage as S, runWithSlackInstallation as T, readViewerAutomationRuns as _, recordWebConversationActivity as a, readViewerAutomations as b, createProductionSlackWebhookServices as c, resolveSlackConversationContextFromThreadId as d, createSlackWebApiStatusSender as f, readViewerAutomationExecutions as g, readConversationSourceTask as h, createConversationId as i, stopConversationTurn as j, normalizeIncomingSlackThreadId as k, getProductionSlackAdapter as l, deleteViewerTask as m, conversationTurnIdForMessage as n, webActorFromEmail as o, ViewerTaskNotFoundError as p, createAndEnqueueConversation as r, createProductionConversationWorkOptions as s, appendAndEnqueueWebMessage as t, formatSlackConversationRedactedLabel as u, readViewerAutomationSummary as v, clearSlackPendingReactions as w, resolveViewerTaskCandidate as x, readViewerAutomationVersions as y, GET as z };
7320
+ export { THREAD_OPTOUT_ACK as A, readHealthReport as B, buildSlackInboundMessage as C, normalizeIncomingSlackThreadId as D, stopSlackThread as E, renderSlackObjectCard as F, createVercelAttachmentStorage as I, AGENT_DISPATCH_MAX_AGE_MS as L, parseContent as M, runWithSlackInstallation as N, withNormalizedThreadId as O, verifySlackSignature as P, enqueueAgentDispatch as R, recordSkippedConversationMessage as S, isSlackMessageStopped as T, readViewerAutomationRuns as _, recordWebConversationActivity as a, readViewerAutomations as b, createProductionSlackWebhookServices as c, resolveSlackConversationContextFromThreadId as d, createSlackWebApiStatusSender as f, readViewerAutomationExecutions as g, readConversationSourceTask as h, createConversationId as i, startProcessingReaction as j, stopConversationTurn as k, getProductionSlackAdapter as l, deleteViewerTask as m, conversationTurnIdForMessage as n, webActorFromEmail as o, ViewerTaskNotFoundError as p, createAndEnqueueConversation as r, createProductionConversationWorkOptions as s, appendAndEnqueueWebMessage as t, formatSlackConversationRedactedLabel as u, readViewerAutomationSummary as v, clearSlackPendingReactions as w, resolveViewerTaskCandidate as x, readViewerAutomationVersions as y, GET as z };