@sentry/junior 0.221.1 → 0.222.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 (64) hide show
  1. package/dist/{agent-CY49A4pN.js → agent-7kKtDe-6.js} +47 -27
  2. package/dist/{agent-hooks-BnZBgDPe.js → agent-hooks-DkriF84n.js} +9 -8
  3. package/dist/{agent-runner-BC8iSAfE.js → agent-runner-D0ImXS7U.js} +6 -5
  4. package/dist/api/schema.d.ts +51 -2
  5. package/dist/api/schema.js +4 -4
  6. package/dist/api.js +18 -515
  7. package/dist/{app-BYD2Nyji.d.ts → app-C0zbsnr7.d.ts} +1 -1
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +153 -32
  10. package/dist/{auth-pause-state-CJwPs1cT.js → auth-pause-state-3OT67TA8.js} +52 -7
  11. package/dist/{briefs-BSOhy23c.js → briefs-CNH1ztn5.js} +4 -4
  12. package/dist/{catalog-runtime-0oMD2jas.js → catalog-runtime-XH_LFA_7.js} +1 -1
  13. package/dist/{checkpoint-Bl47qAIY.js → checkpoint-CRod8es5.js} +8 -7
  14. package/dist/cli/chat.js +13 -13
  15. package/dist/cli/check.js +3 -3
  16. package/dist/cli/main.js +1 -1
  17. package/dist/cli/plugins.js +3 -3
  18. package/dist/cli/snapshot-create.js +3 -3
  19. package/dist/cli/upgrade.js +3 -3
  20. package/dist/{client-BrThxuRI.js → client-CcSboWx_.js} +2 -2
  21. package/dist/{config-CEuC6CFj.js → config-CGYv-YPE.js} +2 -2
  22. package/dist/{conversation-BSRGzJmY.js → conversation-BBDt88di.js} +46 -3
  23. package/dist/{conversation-privacy-aHn1OwXL.js → conversation-privacy-BGjdDVWD.js} +1 -1
  24. package/dist/{credential-sync-Dht95TJQ.js → credential-sync-BfzGNruT.js} +125 -30
  25. package/dist/{execution-stats-D9m2kmmg.js → execution-stats-D97ePWuM.js} +3 -3
  26. package/dist/{executor-3IasVOqK.js → executor-BLBZ-UB8.js} +1 -1
  27. package/dist/{history-ClE4toxe.d.ts → history-CaV8Ww7M.d.ts} +16 -1
  28. package/dist/instrumentation.js +2 -2
  29. package/dist/{job-queue-36liupTq.js → job-queue-_8gxwDzt.js} +1 -1
  30. package/dist/{logging-gR24QCo_.js → logging-qmsMdU0y.js} +1 -1
  31. package/dist/nitro.d.ts +1 -1
  32. package/dist/nitro.js +3 -3
  33. package/dist/{oauth-callback-server-BvNIWVA3.js → oauth-callback-server-Mjfm46A5.js} +2 -2
  34. package/dist/{pending-auth-Cl4BsopG.js → pending-auth-_1Ry-_Bw.js} +2 -2
  35. package/dist/{profile-VmUpQuOm.js → profile-DbG8AlNd.js} +4 -4
  36. package/dist/{prompt-BkaHwBW0.js → prompt-B8rCQI7K.js} +1 -1
  37. package/dist/{registry-BATk1X_v.js → registry-DGyQCsiy.js} +1 -1
  38. package/dist/reporting-window-DbUqng0P.js +229 -0
  39. package/dist/{resolve-Cf79l1H8.js → resolve-D5SqDbCA.js} +2 -2
  40. package/dist/{runner-DNN4EPj_.js → runner-BRAFjJhe.js} +21 -10
  41. package/dist/{sandbox-egress-signals-C-HUJW1G.js → sandbox-egress-signals-CdI1aVHT.js} +1 -1
  42. package/dist/{schema-YPJXVcOW.js → schema-CTOODa3L.js} +5 -128
  43. package/dist/{short-title-Cy3D8vg1.js → short-title-CB2fxEyx.js} +2 -2
  44. package/dist/{skills-DMQkR1Yu.js → skills-BoS3b8cg.js} +2 -2
  45. package/dist/{spawn-BHk7RpYw.js → spawn-BXCU1udr.js} +2 -2
  46. package/dist/{stats-8Bzht8zO.js → stats-qUXQZq-w.js} +52 -13
  47. package/dist/{task-queue-Cm4FhC0n.js → task-queue-Di_q8922.js} +3 -3
  48. package/dist/{task-runner-dQwOhCYs.js → task-runner-4rCppQMo.js} +8 -8
  49. package/dist/{thread-state-D0Ktlch_.js → thread-state-2Paza8DV.js} +5 -5
  50. package/dist/{turn-execution-BfLZfabf.js → turn-execution--F7a9kEU.js} +3 -3
  51. package/dist/{turn-lifecycle-D75pWL8e.js → turn-lifecycle-f-y0Irpi.js} +1 -1
  52. package/dist/{validation-D5fdtuzG.js → validation-Be9lSORU.js} +1 -1
  53. package/dist/{version-DErORHQC.js → version-BydrOZMQ.js} +1 -1
  54. package/dist/version.js +1 -1
  55. package/dist/{web-authorization-IHMPbDay.js → web-authorization-BdfOkTuG.js} +1 -1
  56. package/dist/web-input-DegYUyKU.js +899 -0
  57. package/dist/{work-CaaSjlNk.js → work-Citqpnfc.js} +9 -9
  58. package/dist/{worker-Eom9CfBl.js → worker-Bn_HFyvM.js} +5 -5
  59. package/migrations/0044_event_automation_channel_destinations.sql +36 -0
  60. package/migrations/meta/0044_snapshot.json +3473 -0
  61. package/migrations/meta/_journal.json +7 -0
  62. package/package.json +4 -4
  63. package/dist/reporting-schema-DosTN__Q.js +0 -105
  64. package/dist/web-input-DskRJhrK.js +0 -392
package/dist/app.js CHANGED
@@ -1,41 +1,41 @@
1
- import { $ as AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-CY49A4pN.js";
2
- import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-BrThxuRI.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-gR24QCo_.js";
1
+ import { $ as AuthorizationFlowDisabledError, B as recordFinishedTurnForAutomatedLimit, C as renderBlockText, D as getNextRunAtMs, E as scheduledAutomationRunAttributes, F as ingestEvent, G as clearSandboxEgressSignals, H as normalizeSandboxEgressTracePropagationDomains, I as EVENT_WAIT_MS, J as parseSandboxEgressCredentialToken, K as consumeSandboxEgressAuthRequiredSignal, L as isEventMailboxMetadata, P as processWorkspaceSnapshotJob, Q as isVisionImageMediaType, R as renderTaskInput, S as renderAttachmentText, T as logScheduledAutomationRunSkipped, U as shouldPropagateSandboxEgressTrace, V as resolveSandboxEgressProviderForHost, W as SANDBOX_EGRESS_PROXY_PATH, X as createUserTokenStore, Z as buildSteeringPiMessage, _ as readPublicArtifact, b as readAttachmentVisionSummary, c as deleteMcpStoredOAuthCredentials, et as shouldEmitDevAgentTrace, f as PluginCredentialFailureError, g as publicArtifactHeaders, m as latestProgressStatus, n as createContextCompactor, nt as setConfigDefaults, o as deleteMcpAuthSessionsForUserProvider, q as consumeSandboxEgressPermissionDeniedSignal, r as executeCredentialedEgressRequest, s as deleteMcpServerSessionId, t as executeAgentRun, tt as getConfigDefaults, v as unpublishedArtifactHeaders, w as listThreadReplies, x as recordSlackAttachment, z as maybePostAutomatedTurnLimitNotice } from "./agent-7kKtDe-6.js";
2
+ import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-CcSboWx_.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-qmsMdU0y.js";
4
4
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
5
- import { t as JUNIOR_VERSION } from "./version-DErORHQC.js";
6
- import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, l as getSlackClientSecret, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-CEuC6CFj.js";
5
+ import { t as JUNIOR_VERSION } from "./version-BydrOZMQ.js";
6
+ import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, l as getSlackClientSecret, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-CGYv-YPE.js";
7
7
  import { a as modelIdForProfile, n as defaultModelId } from "./model-profile-CZmVoGdX.js";
8
8
  import { _ as parseSlackMessageTs, a as createActor, c as isActorUserId, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-Bplcgypl.js";
9
- import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel, Gt as getDb, Ht as getConversationEventStore, I as verifyEventAutomationCredentialSubject, Jt as withConversationEventLock, K as normalizeSlackConversationId, Kt as getSqlExecutor, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationStore, X as runWithWorkspaceTeamId, Xt as withConversationMutationLock, Y as getWorkspaceTeamId, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dn as requireSlackDestination, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, i as getPluginApiRoutes, ln as createSlackDestination, on as deleteProviderIdentityForSlackUser, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-BnZBgDPe.js";
9
+ import { B as downloadPrivateSlackFile, F as bindSlackDirectCredentialSubject, G as isDmChannel, Gt as getDb, Ht as getConversationEventStore, I as verifyEventAutomationCredentialSubject, Jt as withConversationEventLock, K as normalizeSlackConversationId, Kt as getSqlExecutor, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, Q as readActorIdentity, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationStore, X as runWithWorkspaceTeamId, Xt as withConversationMutationLock, Y as getWorkspaceTeamId, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dn as requireSlackDestination, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, ht as getDashboardTaskLink, i as getPluginApiRoutes, ln as createSlackDestination, mt as getDashboardConversationLink, on as deleteProviderIdentityForSlackUser, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, u as getPlugins, xt as readConversationAccessFromSql, z as SlackActionError } from "./agent-hooks-DkriF84n.js";
10
10
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
11
- import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-3IasVOqK.js";
12
- import { W as instructionProvenanceFor } from "./conversation-BSRGzJmY.js";
13
- import { n as pluginCatalogRuntime } from "./catalog-runtime-0oMD2jas.js";
14
- import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-Bl47qAIY.js";
15
- import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-VmUpQuOm.js";
16
- import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats-8Bzht8zO.js";
17
- import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-Cl4BsopG.js";
18
- import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-BC8iSAfE.js";
19
- import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-BkaHwBW0.js";
20
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-Cf79l1H8.js";
11
+ import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-BLBZ-UB8.js";
12
+ import { q as instructionProvenanceFor } from "./conversation-BBDt88di.js";
13
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-XH_LFA_7.js";
14
+ import { $ as resolveConversationTitle, F as loadProjection, G as recordSubscribedReplyRoute, J as appendConversationMessages, M as commitMessages, P as loadConversationProjection, Q as persistConversationMessageSummaries, X as persistConversationMessages, Y as hydrateConversationMessages, Z as projectConversationMessages, a as completeTurnRecord, at as isHumanConversationMessage, c as getTurnRecordForResume, ct as recordDeliveredAssistantMessage, d as persistWithRetry, dt as estimateTextTokens, et as appendThreadContextMessages, i as abandonTurnRecord, it as getConversationMessageSlackTs, j as commitAcceptedReply, k as trimTrailingAssistantMessages, l as listTurnSummaries, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, nt as createConversationMemoryService, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, rt as estimateConversationContextTokens, s as getTurnRecord, st as normalizeConversationText, tt as buildConversationContext, u as recordTurnSummary, ut as upsertConversationMessage } from "./checkpoint-CRod8es5.js";
15
+ import { E as acquireActiveLock, O as withActiveLock, T as MUTATION_LOCK_TTL_MS$1, k as withLock$1, w as getStateAdapter } from "./profile-DbG8AlNd.js";
16
+ import { Bt as hasRunnableConversationWork$1, Dt as hasRunnableConversationWork, Et as getConversationWorkState, F as effectiveTaskOutcomes, Ht as isInvalidConversationRecordError, It as stopConversationWork, Kt as buildDeterministicAssistantMessageId, Mt as removeActiveConversation, Ot as listActiveConversationIds, Pt as requestConversationWork, Rt as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as withScheduledAutomationLock, Tt as getConversation, U as findMatchingEventAutomations, X as getEventCatalog, a as requestAttachmentDeletion, b as saveScheduledAutomationInLock, c as parseSlackThreadId, g as listScheduledAutomationsForTeam, h as listScheduledAutomations, o as storeAttachment, pt as appendAndEnqueueInboundMessage, qt as buildDeterministicTurnId, r as collectAttachmentGarbage, tt as eventGuidance, v as readScheduledAutomation, vt as clearExpiredConversationLease, w as scheduledRunSchema, wt as ensureConversationWake, x as scheduledRunId, z as collectEventAutomationMatchKeys } from "./stats-qUXQZq-w.js";
17
+ import { S as startActiveTurn, _ as isTurnInputCommitLostError, b as markTurnCompleted, d as ConversationTurnBoundaryError, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, h as getConversationTurnBoundaryError, m as TurnInputDeferredError, p as TurnInputCommitLostError, r as clearPendingAuth, s as getAssistantReplyText, v as isTurnInputDeferredError, x as markTurnFailed, y as markTurnClosed } from "./pending-auth-_1Ry-_Bw.js";
18
+ import { h as postSlackMessage, i as formatProviderLabel, s as startOAuthFlow, t as createAgentRunner, v as RetryableDeliveryError } from "./agent-runner-D0ImXS7U.js";
19
+ import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-B8rCQI7K.js";
20
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-D5SqDbCA.js";
21
21
  import { l as conversationQueueMessageSchema, n as resolveConversationWorkQueueTopic, r as verifyConversationQueueMessage, t as getVercelConversationWorkQueue, u as isConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
22
- import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-36liupTq.js";
22
+ import { a as getTurnRequestDeadline, i as verifyWorkspaceSnapshotJobMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-_8gxwDzt.js";
23
23
  import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
24
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-D5fdtuzG.js";
24
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Be9lSORU.js";
25
25
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
26
- import { a as webActorFromEmail, f as lookupSlackUser, h as GET$3, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, m as createVercelAttachmentStorage, n as conversationTurnIdForMessage, o as resolveConversationDestination, p as legacyWebMailboxMetadataSchema, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext } from "./web-input-DskRJhrK.js";
27
- import { u as recordAutomationExecution } from "./execution-stats-D9m2kmmg.js";
28
- import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-dQwOhCYs.js";
29
- import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-CaaSjlNk.js";
30
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-D75pWL8e.js";
31
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-BfLZfabf.js";
32
- import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-D0Ktlch_.js";
33
- import { a as requireTurnFailureEventId, d as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, t as completeAuthPauseTurn, u as getTurnUserSlackMessageTs } from "./auth-pause-state-CJwPs1cT.js";
34
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-Cm4FhC0n.js";
35
- import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-Dht95TJQ.js";
36
- import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-IHMPbDay.js";
37
- import { t as processConversationWork } from "./worker-Eom9CfBl.js";
38
- import { t as bindSpawnAgent } from "./spawn-BHk7RpYw.js";
26
+ import { S as GET$3, _ as readViewerAutomationSummary, a as webActorFromEmail, b as legacyWebMailboxMetadataSchema, i as recordWebConversationActivity, l as resolveSlackChannelTypeFromMessage, n as conversationTurnIdForMessage, o as resolveConversationDestination, s as conversationVisibilityFromSlackChannelType, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContext, x as createVercelAttachmentStorage, y as lookupSlackUser } from "./web-input-DegYUyKU.js";
27
+ import { u as recordAutomationExecution } from "./execution-stats-D97ePWuM.js";
28
+ import { _ as markDispatchCompleted, a as claimDispatchMailboxAppend, c as getDispatchConversationId, d as getDispatchTurnId, f as getPluginDispatchProjection, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as resolveTurnSessionRouting, l as getDispatchInputMessageId, m as listPendingDispatchMailboxAppends, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, p as isTerminalDispatchStatus, s as createOrGetDispatch, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./task-runner-4rCppQMo.js";
29
+ import { i as resolveAgentInvocationId, o as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-Citqpnfc.js";
30
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-f-y0Irpi.js";
31
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution--F7a9kEU.js";
32
+ import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-2Paza8DV.js";
33
+ import { a as requireTurnFailureEventId, c as getTurnUserMessage, d as getTurnUserSlackMessageTs, f as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, n as persistAuthPauseTurnState, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, t as completeAuthPauseTurn, u as getTurnUserReplyAttachmentContext } from "./auth-pause-state-3OT67TA8.js";
34
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-Di_q8922.js";
35
+ import { C as isSlackTitlePermissionError, D as createSlackAdapterAssistantStatusSession, E as splitSlackReplyText, S as isRetryableSlackPostError, T as buildSlackOutputMessage, _ as getThreadId, a as GET$4, b as getSlackApiErrorCode, c as wakePausedTurn, d as shouldKeepProcessingReactionForToolInvocation, f as startProcessingReaction, g as getRunId, h as getMessageTs, i as publishAppHomeView, l as resumeSlackTurn, m as getChannelId, o as createPausedTurns, p as getAssistantThreadContext, r as GET$5, s as getPausedTurnRequest, t as receiveLocalOAuthCredential, u as buildAuthPauseResponse, v as getThreadTs, w as sendSlackReply, x as getSlackErrorObservabilityAttributes, y as stripLeadingBotMention } from "./credential-sync-BfzGNruT.js";
36
+ import { n as deleteWebAuthorization, t as createWebAuthorization } from "./web-authorization-BdfOkTuG.js";
37
+ import { t as processConversationWork } from "./worker-Bn_HFyvM.js";
38
+ import { t as bindSpawnAgent } from "./spawn-BXCU1udr.js";
39
39
  import { createRequire } from "node:module";
40
40
  import { pathToFileURL } from "node:url";
41
41
  import { Hono } from "hono";
@@ -4567,6 +4567,108 @@ async function handleSlashCommand(event) {
4567
4567
  else await handleUnlink(event, actorId, normalized);
4568
4568
  }
4569
4569
  //#endregion
4570
+ //#region src/chat/slack/automation-details.ts
4571
+ function textField(key, label, value) {
4572
+ return {
4573
+ key,
4574
+ label,
4575
+ type: "string",
4576
+ value
4577
+ };
4578
+ }
4579
+ function dateField(key, label, value, empty) {
4580
+ return value ? {
4581
+ key,
4582
+ label,
4583
+ type: "slack#/types/timestamp",
4584
+ value: Math.floor(Date.parse(value) / 1e3)
4585
+ } : textField(key, label, empty);
4586
+ }
4587
+ function renderAutomationDetails(automation) {
4588
+ const url = getDashboardTaskLink(automation.id);
4589
+ if (!url) return void 0;
4590
+ const fields = [textField("status", "Status", automation.kind === "scheduled" ? automation.status : automation.triggerAvailable ? "ready" : "unavailable"), {
4591
+ ...textField("description", "Instruction", automation.instruction),
4592
+ format: "markdown",
4593
+ long: true
4594
+ }];
4595
+ if (automation.kind === "scheduled") fields.push({
4596
+ ...textField("trigger", "Schedule", automation.schedule),
4597
+ long: true
4598
+ }, dateField("next_run", "Next run", automation.nextRunAt, "None"));
4599
+ else {
4600
+ fields.push(textField("source", "Source", automation.source), {
4601
+ ...textField("resource", "Resource", automation.resource),
4602
+ long: true
4603
+ }, {
4604
+ ...textField("events", "Events", automation.events.join(", ")),
4605
+ long: true
4606
+ });
4607
+ if (!automation.triggerAvailable) fields.push({
4608
+ ...textField("warning", "Needs attention", "Trigger unavailable. This automation cannot receive events."),
4609
+ long: true
4610
+ });
4611
+ }
4612
+ const lastRun = dateField("last_run", "Last execution", automation.lastRunAt, "Never run");
4613
+ if (automation.lastRunAt && automation.lastConversationId) lastRun.link = getDashboardConversationLink(automation.lastConversationId);
4614
+ fields.push(textField("outcomes", "Outcomes", automation.outcomes.length === 0 ? "None (silent)" : `${automation.outcomes.length} message${automation.outcomes.length === 1 ? "" : "s"}`), textField("destination", "Destination", `${automation.destination.label} · ${automation.destination.visibility}`), textField("created_by", "Created by", automation.createdBy), dateField("date_created", "Created", automation.createdAt, "Unknown"), textField("executions", "Executions", `${automation.totalRuns} total · ${automation.runs[30]} in the last 30 days`), lastRun);
4615
+ return {
4616
+ entity_type: "slack#/entities/item",
4617
+ external_ref: {
4618
+ id: automation.id,
4619
+ type: "automation"
4620
+ },
4621
+ url,
4622
+ entity_payload: {
4623
+ attributes: {
4624
+ title: { text: automation.title },
4625
+ display_type: automation.kind === "scheduled" ? "Scheduled automation" : "Event automation"
4626
+ },
4627
+ custom_fields: fields
4628
+ }
4629
+ };
4630
+ }
4631
+ const detailsEventSchema = z.object({
4632
+ trigger_id: z.string().min(1),
4633
+ user: z.string().min(1),
4634
+ external_ref: z.object({
4635
+ id: z.string().min(1),
4636
+ type: z.literal("automation")
4637
+ })
4638
+ });
4639
+ /** Answer a Work Object open or refresh with current, viewer-visible facts. */
4640
+ async function presentSlackAutomationDetails(event, teamId) {
4641
+ const parsed = detailsEventSchema.safeParse(event);
4642
+ const client = getSlackClient();
4643
+ const triggerId = event.trigger_id;
4644
+ if (typeof triggerId !== "string" || !triggerId) return;
4645
+ if (!parsed.success || !teamId) {
4646
+ await client.entity.presentDetails({
4647
+ trigger_id: triggerId,
4648
+ error: { status: "not_found" }
4649
+ });
4650
+ return;
4651
+ }
4652
+ const identity = await readActorIdentity({
4653
+ platform: "slack",
4654
+ teamId,
4655
+ userId: parsed.data.user
4656
+ });
4657
+ const automation = identity?.user ? await readViewerAutomationSummary(identity.user, parsed.data.external_ref.id) : void 0;
4658
+ const entity = automation ? renderAutomationDetails(automation) : void 0;
4659
+ if (!entity) {
4660
+ await client.entity.presentDetails({
4661
+ trigger_id: triggerId,
4662
+ error: { status: "not_found" }
4663
+ });
4664
+ return;
4665
+ }
4666
+ await client.entity.presentDetails({
4667
+ trigger_id: triggerId,
4668
+ metadata: entity
4669
+ });
4670
+ }
4671
+ //#endregion
4570
4672
  //#region src/chat/ingress/slack-webhook.ts
4571
4673
  function slackEventLogContext(event) {
4572
4674
  const channelId = event?.channel?.trim() || void 0;
@@ -4858,6 +4960,10 @@ async function handleSlackEvent(args) {
4858
4960
  });
4859
4961
  return;
4860
4962
  }
4963
+ if (event.type === "entity_details_requested") {
4964
+ await presentSlackAutomationDetails(event, installation.teamId);
4965
+ return;
4966
+ }
4861
4967
  if (event.type === "app_home_opened" && event.user) {
4862
4968
  await publishAppHomeViewBestEffort(event.user);
4863
4969
  return;
@@ -5424,6 +5530,12 @@ async function saveSteeringMessages(args) {
5424
5530
  //#endregion
5425
5531
  //#region src/chat/providers/slack/turn.ts
5426
5532
  /**
5533
+ * Add Slack behavior around one Turn.
5534
+ *
5535
+ * This module owns Slack status, delivery, and state.
5536
+ * It calls `executeTurn` to run and finish the Turn.
5537
+ */
5538
+ /**
5427
5539
  * Persist post-delivery Redis scratch with a short retry after durable SQL
5428
5540
  * completion has succeeded.
5429
5541
  */
@@ -5804,6 +5916,7 @@ function createSlackTurn(deps) {
5804
5916
  const text = typeof reply === "string" ? reply : getAssistantReplyText(reply);
5805
5917
  if (!text?.trim()) return;
5806
5918
  boundaryFailureCode = "delivery_failed";
5919
+ const cards = await loadPendingMessageCards(conversationId);
5807
5920
  let slackMessageTs = [];
5808
5921
  const messageDestinations = [];
5809
5922
  await beforeFirstResponsePost();
@@ -5811,6 +5924,7 @@ function createSlackTurn(deps) {
5811
5924
  const outcomes = options.execution?.dispatch?.outcomes;
5812
5925
  if (outcomes) for (const outcome of outcomes) {
5813
5926
  const messageIds = await sendSlackReply({
5927
+ cards,
5814
5928
  channelId: outcome.destination.channelId,
5815
5929
  conversationId,
5816
5930
  replyAttribution: options.execution?.dispatch?.replyAttribution,
@@ -5825,6 +5939,7 @@ function createSlackTurn(deps) {
5825
5939
  }
5826
5940
  else if (channelId && thread.adapter.name === "slack") {
5827
5941
  slackMessageTs = await sendSlackReply({
5942
+ cards,
5828
5943
  channelId,
5829
5944
  conversationId,
5830
5945
  replyAttribution: options.execution?.dispatch?.replyAttribution,
@@ -5857,6 +5972,7 @@ function createSlackTurn(deps) {
5857
5972
  acceptedDeliveryId = slackTs;
5858
5973
  options.onTurnDeliveryAccepted?.(slackTs);
5859
5974
  const recordedMessageId = recordDeliveredAssistantMessage({
5975
+ cards,
5860
5976
  conversation: preparedState.conversation,
5861
5977
  sessionId: turnId,
5862
5978
  source: "slack",
@@ -7204,6 +7320,7 @@ async function runNextPausedTurnInContext(conversationId, options, runOptions) {
7204
7320
  /** Store one assistant Message and its Agent history. */
7205
7321
  async function commitAssistantMessage(args) {
7206
7322
  const conversationMessageId = recordDeliveredAssistantMessage({
7323
+ cards: args.cards,
7207
7324
  conversation: args.conversation,
7208
7325
  sessionId: args.sessionId,
7209
7326
  source: args.source,
@@ -7444,16 +7561,19 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7444
7561
  const replyText = typeof value === "string" ? value : getAssistantReplyText(value);
7445
7562
  if (!replyText?.trim()) return;
7446
7563
  failureCode = "delivery_failed";
7564
+ const cards = await loadPendingMessageCards(context.conversationId);
7447
7565
  let deliveryResult;
7448
7566
  if (deliverToProvider) {
7449
7567
  if (!conversationLocation || !deliverMessage) throw new Error(`Conversation ${context.conversationId} cannot deliver to its Location`);
7450
7568
  deliveryResult = await deliverMessage({
7569
+ cards,
7451
7570
  conversationId: context.conversationId,
7452
7571
  location: conversationLocation,
7453
7572
  text: replyText
7454
7573
  });
7455
7574
  }
7456
7575
  await commitAssistantMessage({
7576
+ cards,
7457
7577
  ...agentMessage ? { agentMessage } : void 0,
7458
7578
  conversation,
7459
7579
  conversationId: context.conversationId,
@@ -7687,7 +7807,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7687
7807
  * Location after Event work supplies Delivery before the Run.
7688
7808
  */
7689
7809
  function createSlackSystemTurnDelivery(args) {
7690
- return async ({ conversationId, location, text }) => {
7810
+ return async ({ conversationId, location, text, cards }) => {
7691
7811
  if (location.provider !== "slack") throw new Error(`Slack system Turn cannot deliver to ${location.provider} Location`);
7692
7812
  let messageIds;
7693
7813
  try {
@@ -7696,6 +7816,7 @@ function createSlackSystemTurnDelivery(args) {
7696
7816
  installation: { teamId: location.teamId },
7697
7817
  state: args.state,
7698
7818
  task: async () => await sendSlackReply({
7819
+ cards,
7699
7820
  channelId: location.channelId,
7700
7821
  conversationId,
7701
7822
  text,
@@ -1,10 +1,12 @@
1
- import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-BrThxuRI.js";
2
- import { t as buildTurnFailureResponse } from "./logging-gR24QCo_.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-CcSboWx_.js";
2
+ import { F as isRecord, t as buildTurnFailureResponse } from "./logging-qmsMdU0y.js";
3
3
  import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
- import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-Bl47qAIY.js";
5
- import { qt as buildDeterministicTurnId } from "./stats-8Bzht8zO.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-Cl4BsopG.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-D0Ktlch_.js";
4
+ import { Ht as getConversationEventStore } from "./agent-hooks-DkriF84n.js";
5
+ import { A as readMessageCards } from "./conversation-BBDt88di.js";
6
+ import { Y as hydrateConversationMessages, ot as markConversationMessage } from "./checkpoint-CRod8es5.js";
7
+ import { qt as buildDeterministicTurnId } from "./stats-qUXQZq-w.js";
8
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-_1Ry-_Bw.js";
9
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-2Paza8DV.js";
8
10
  //#region src/chat/runtime/delivered-turn-state.ts
9
11
  /** Build state after destination delivery or intentional no-reply completion. */
10
12
  function buildDeliveredTurnStatePatch(args) {
@@ -53,6 +55,49 @@ function getTurnUserReplyAttachmentContext(message) {
53
55
  };
54
56
  }
55
57
  //#endregion
58
+ //#region src/chat/conversations/pending-cards.ts
59
+ const CARD_TOOLS = /* @__PURE__ */ new Set([
60
+ "createEventAutomation",
61
+ "updateEventAutomation",
62
+ "deleteEventAutomation",
63
+ "slackScheduleCreateAutomation",
64
+ "slackScheduleUpdateAutomation",
65
+ "slackScheduleDeleteAutomation"
66
+ ]);
67
+ /** Read undelivered card snapshots across resume and history replacement. */
68
+ async function loadPendingMessageCards(conversationId) {
69
+ const cards = /* @__PURE__ */ new Map();
70
+ const deleted = /* @__PURE__ */ new Set();
71
+ let beforeSeq;
72
+ while (true) {
73
+ const page = await getConversationEventStore().query(conversationId, {
74
+ beforeSeq,
75
+ limit: 100,
76
+ types: [
77
+ "tool_result",
78
+ "message",
79
+ "turn_started"
80
+ ]
81
+ });
82
+ for (const event of [...page.events].reverse()) {
83
+ const data = event.data;
84
+ if (data.type === "turn_started" || data.type === "message" && data.role === "assistant") return [...cards.values()].reverse();
85
+ if (data.type !== "tool_result" || data.isError || typeof data.toolName !== "string" || !CARD_TOOLS.has(data.toolName) || !isRecord(data.details)) continue;
86
+ if (data.toolName === "deleteEventAutomation" || data.toolName === "slackScheduleDeleteAutomation") {
87
+ if (isRecord(data.details.automation) && typeof data.details.automation.id === "string") deleted.add(data.details.automation.id);
88
+ continue;
89
+ }
90
+ if (!Array.isArray(data.details.cards)) continue;
91
+ for (const card of readMessageCards(data.details.cards)) {
92
+ const key = `${card.kind}:${card.id}`;
93
+ if (!deleted.has(card.id) && !cards.has(key)) cards.set(key, card);
94
+ }
95
+ }
96
+ if (!page.hasOlder || page.events.length === 0) return [...cards.values()].reverse();
97
+ beforeSeq = page.events[0].seq;
98
+ }
99
+ }
100
+ //#endregion
56
101
  //#region src/chat/interruption-marker.ts
57
102
  const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
58
103
  /** Return the marker added when a visible reply ended mid-execution. */
@@ -165,4 +210,4 @@ async function persistAuthPauseTurnState(args) {
165
210
  await persistThreadStateById(args.threadStateId, { conversation });
166
211
  }
167
212
  //#endregion
168
- export { requireTurnFailureEventId as a, getTurnUserMessageId as c, buildDeliveredTurnStatePatch as d, getAgentTurnDiagnosticsAttributes as i, getTurnUserReplyAttachmentContext as l, persistAuthPauseTurnState as n, getInterruptionMarker as o, finalizeFailedTurnReplyWithEvent as r, getTurnUserMessage as s, completeAuthPauseTurn as t, getTurnUserSlackMessageTs as u };
213
+ export { requireTurnFailureEventId as a, getTurnUserMessage as c, getTurnUserSlackMessageTs as d, buildDeliveredTurnStatePatch as f, getAgentTurnDiagnosticsAttributes as i, getTurnUserMessageId as l, persistAuthPauseTurnState as n, getInterruptionMarker as o, finalizeFailedTurnReplyWithEvent as r, loadPendingMessageCards as s, completeAuthPauseTurn as t, getTurnUserReplyAttachmentContext as u };
@@ -1,7 +1,7 @@
1
- import { r as completeObject } from "./client-BrThxuRI.js";
1
+ import { r as completeObject } from "./client-CcSboWx_.js";
2
2
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
3
- import { N as parseBriefInput, d as conversationDetailReportSchema, k as briefCodeChangeSchema, p as conversationEventPageSchema } from "./conversation-BSRGzJmY.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BkaHwBW0.js";
3
+ import { I as parseBriefInput, M as briefCodeChangeSchema, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-BBDt88di.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-B8rCQI7K.js";
5
5
  import { CLI_USAGE } from "./cli/run.js";
6
6
  import path from "node:path";
7
7
  import { z } from "zod";
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
269
269
  * `DATABASE_URL` at import, and `briefs pull` must work with only a token.
270
270
  */
271
271
  async function configuredDefaultModelId() {
272
- const { botConfig } = await import("./config-CEuC6CFj.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-CGYv-YPE.js").then((n) => n.r);
273
273
  return defaultModelId(botConfig);
274
274
  }
275
275
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-BATk1X_v.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-DGyQCsiy.js";
3
3
  //#region src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,11 +1,11 @@
1
- import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-BrThxuRI.js";
2
- import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-gR24QCo_.js";
3
- import { n as botConfig } from "./config-CEuC6CFj.js";
1
+ import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-CcSboWx_.js";
2
+ import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-qmsMdU0y.js";
3
+ import { n as botConfig } from "./config-CGYv-YPE.js";
4
4
  import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
5
- import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, en as addAgentTurnUsage, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-BnZBgDPe.js";
6
- import { F as agentHistoryItemSchema, H as contextProvenance, U as instructionActors, W as instructionProvenanceFor } from "./conversation-BSRGzJmY.js";
7
- import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-Cy3D8vg1.js";
8
- import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-VmUpQuOm.js";
5
+ import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, en as addAgentTurnUsage, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-DkriF84n.js";
6
+ import { G as contextProvenance, K as instructionActors, R as agentHistoryItemSchema, q as instructionProvenanceFor } from "./conversation-BBDt88di.js";
7
+ import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-CB2fxEyx.js";
8
+ import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-DbG8AlNd.js";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { z } from "zod";
11
11
  import { createHash } from "node:crypto";
@@ -247,6 +247,7 @@ function recordDeliveredAssistantMessage(args) {
247
247
  isBot: true
248
248
  },
249
249
  meta: {
250
+ ...args.cards?.length ? { cards: args.cards } : void 0,
250
251
  replied: true,
251
252
  ...args.source ? { source: args.source } : void 0
252
253
  }
package/dist/cli/chat.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as executeAgentRun } from "../agent-CY49A4pN.js";
2
- import { t as createAgentRunner } from "../agent-runner-BC8iSAfE.js";
1
+ import { t as executeAgentRun } from "../agent-7kKtDe-6.js";
2
+ import { t as createAgentRunner } from "../agent-runner-D0ImXS7U.js";
3
3
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
4
4
  import path from "node:path";
5
5
  import { createHash, randomUUID } from "node:crypto";
@@ -101,10 +101,10 @@ async function loadLocalPluginSet() {
101
101
  async function configureLocalChatPlugins(pluginSet) {
102
102
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
103
103
  import("../plugins-egKWjgue.js").then((n) => n.o),
104
- import("../agent-hooks-BnZBgDPe.js").then((n) => n.t),
105
- import("../catalog-runtime-0oMD2jas.js").then((n) => n.t),
106
- import("../validation-D5fdtuzG.js").then((n) => n.r),
107
- import("../agent-hooks-BnZBgDPe.js").then((n) => n.Vt)
104
+ import("../agent-hooks-DkriF84n.js").then((n) => n.t),
105
+ import("../catalog-runtime-XH_LFA_7.js").then((n) => n.t),
106
+ import("../validation-Be9lSORU.js").then((n) => n.r),
107
+ import("../agent-hooks-DkriF84n.js").then((n) => n.Vt)
108
108
  ]);
109
109
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
110
110
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -156,16 +156,16 @@ async function prepareLocalChatRun(io, pluginSet) {
156
156
  await configureLocalChatPlugins(pluginSet);
157
157
  const { setExperimentalFeatures } = await import("../experimental-CIXf7Uye.js").then((n) => n.t);
158
158
  setExperimentalFeatures({ subagents: true });
159
- const { setBriefsConfig } = await import("../agent-hooks-BnZBgDPe.js").then((n) => n.m);
159
+ const { setBriefsConfig } = await import("../agent-hooks-DkriF84n.js").then((n) => n.m);
160
160
  setBriefsConfig({ enabled: true });
161
- const { runLocalAgentTurn } = await import("../runner-DNN4EPj_.js");
162
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BvNIWVA3.js");
161
+ const { runLocalAgentTurn } = await import("../runner-BRAFjJhe.js");
162
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Mjfm46A5.js");
163
163
  const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
164
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C-HUJW1G.js");
165
- const { bindSpawnAgent } = await import("../spawn-BHk7RpYw.js").then((n) => n.n);
166
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-CaaSjlNk.js").then((n) => n.a);
164
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CdI1aVHT.js");
165
+ const { bindSpawnAgent } = await import("../spawn-BXCU1udr.js").then((n) => n.n);
166
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-Citqpnfc.js").then((n) => n.a);
167
167
  const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
168
- const { processConversationWork } = await import("../worker-Eom9CfBl.js").then((n) => n.n);
168
+ const { processConversationWork } = await import("../worker-Bn_HFyvM.js").then((n) => n.n);
169
169
  let agentRunner;
170
170
  const localConversationWork = createLocalConversationWork(async (message) => {
171
171
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-gR24QCo_.js";
2
- import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-BATk1X_v.js";
3
- import { i as parseSkillFile } from "../skills-DMQkR1Yu.js";
1
+ import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-qmsMdU0y.js";
2
+ import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-DGyQCsiy.js";
3
+ import { i as parseSkillFile } from "../skills-BoS3b8cg.js";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import path from "node:path";
6
6
  import fs from "node:fs/promises";
package/dist/cli/main.js CHANGED
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
27
  async function runBriefs(argv) {
28
- return await (await import("../briefs-BSOhy23c.js")).runBriefs(argv);
28
+ return await (await import("../briefs-CNH1ztn5.js")).runBriefs(argv);
29
29
  }
30
30
  function topLevelCommand(argv) {
31
31
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,6 +1,6 @@
1
- import { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-BnZBgDPe.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-0oMD2jas.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-D5fdtuzG.js";
1
+ import { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-DkriF84n.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-XH_LFA_7.js";
3
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Be9lSORU.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
6
6
  import { stderr, stdout } from "node:process";
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "../catalog-runtime-0oMD2jas.js";
2
- import { S as disconnectStateAdapter, t as create } from "../profile-VmUpQuOm.js";
3
- import { r as resolve } from "../resolve-Cf79l1H8.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-XH_LFA_7.js";
2
+ import { S as disconnectStateAdapter, t as create } from "../profile-DbG8AlNd.js";
3
+ import { r as resolve } from "../resolve-D5SqDbCA.js";
4
4
  //#region src/cli/snapshot-create.ts
5
5
  const DEFAULT_RUNTIME = "node22";
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,6 +1,6 @@
1
- import { a as getChatConfig } from "../config-CEuC6CFj.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-3IasVOqK.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-BATk1X_v.js";
1
+ import { a as getChatConfig } from "../config-CGYv-YPE.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-BLBZ-UB8.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-DGyQCsiy.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
6
6
  import { fileURLToPath } from "node:url";
@@ -1,5 +1,5 @@
1
- import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-gR24QCo_.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-aHn1OwXL.js";
1
+ import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-qmsMdU0y.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BGjdDVWD.js";
3
3
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
4
4
  import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
5
5
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-BrThxuRI.js";
3
- import { f as logWarn } from "./logging-gR24QCo_.js";
2
+ import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-CcSboWx_.js";
3
+ import { f as logWarn } from "./logging-qmsMdU0y.js";
4
4
  import { c as TURN_REASONING_LEVELS, l as parseTurnReasoningLevel, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
5
5
  import { getModel } from "@earendil-works/pi-ai/compat";
6
6
  //#region src/chat/slack/emoji.ts