import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { t as ChannelId } from "./channel-id.types-B_AcMzNT.js"; import { i as resolveHumanDelayConfig, r as resolveEffectiveMessagesConfig } from "./identity-Dhui1gaI.js"; import { $ as ReadSessionUpdatedAt$1, et as RecordSessionMetaFromInbound$1, o as PluginRuntimeCore, tt as UpdateLastRoute$1 } from "./types-core-BH2BbD0A.js"; import { m as resolveStorePath } from "./store-CGcilHJ_.js"; import { _ as chunkTextWithMode, g as chunkText, h as chunkMarkdownTextWithMode, m as chunkMarkdownText, n as ChannelOutboundAdapter, p as chunkByNewline, v as resolveChunkMode, y as resolveTextChunkLimit } from "./outbound.types-P0E6jGE1.js"; import { n as ReplyDispatcher } from "./reply-dispatcher.types-DrTstzbu.js"; import { s as CommandNormalizeOptions, u as ShouldHandleTextCommandsParams } from "./commands-registry.types-Dz6P-u3o.js"; import { i as MatchesMentionWithExplicit$1, r as MatchesMentionPatterns$1, t as BuildMentionRegexes$1 } from "./mentions.types-rUsMyq83.js"; import { n as RecordInboundSession$1 } from "./session.types-BxIs5pjf.js"; import { c as SessionBindingRecord } from "./session-binding.types-C0nDEI7H.js"; import { t as hasControlCommand } from "./command-detection-Bhf0i4Af.js"; import { t as ResolveMarkdownTableMode } from "./markdown-tables.types-anxiSuHP.js"; import { t as convertMarkdownTables } from "./tables-GDADrLaD.js"; import { n as DispatchReplyFromConfig } from "./dispatch-from-config.types-C7798lTY.js"; import { t as finalizeInboundContext } from "./inbound-context-DlPUv4cf.js"; import { a as resolveEnvelopeFormatOptions, n as formatAgentEnvelope, r as formatInboundEnvelope } from "./envelope-DGk7PaA0.js"; import { i as buildAgentSessionKey, o as resolveAgentRoute } from "./resolve-route-y2Gdf0IY.js"; import { n as ReadChannelAllowFromStoreForAccount, r as UpsertChannelPairingRequestForAccount } from "./pairing-store.types-uMt4e6rQ.js"; import { t as buildPairingReply } from "./pairing-messages-CkjLfdTj.js"; import { p as saveMediaBuffer } from "./store-Dv-FHc1j.js"; import { d as readRemoteMediaBuffer, f as saveRemoteMedia, p as saveResponseMedia, u as fetchRemoteMedia } from "./fetch-CqRWo-7M.js"; import { n as getChannelActivity, r as recordChannelActivity } from "./channel-activity-B5--G30d.js"; import { f as implicitMentionKindWhen, p as resolveInboundMentionDecision } from "./mention-gating-Dd6fxRUW.js"; import { a as createAckReactionHandle, c as shouldAckReaction, o as removeAckReactionAfterReply, s as removeAckReactionHandleAfterReply } from "./ack-reactions-CXbF2_CE.js"; import { n as resolveChannelGroupPolicy, r as resolveChannelGroupRequireMention } from "./group-policy-DgMkFV1M.js"; import { n as createInboundDebouncer, r as resolveInboundDebounceMs } from "./inbound-debounce-BpI9B7vg.js"; import { r as resolveCommandAuthorizedFromAuthorizers } from "./command-gating-sz2c_YIu.js"; import { o as createReplyDispatcherWithTyping, t as DispatchReplyWithBufferedBlockDispatcher } from "./provider-dispatcher.types-Ddx7dYu6.js"; import { r as buildChannelInboundEventContext } from "./context-DZObMCCS.js"; import { a as runPreparedChannelTurn, i as runChannelTurn, o as runResolvedChannelTurn, t as dispatchAssembledChannelTurn } from "./kernel-U-3TwuAx.js"; //#region src/auto-reply/commands-registry.runtime-types.d.ts type ShouldHandleTextCommands$1 = (params: ShouldHandleTextCommandsParams) => boolean; //#endregion //#region src/auto-reply/command-detection.runtime-types.d.ts type IsControlCommandMessage$1 = (text?: string, cfg?: KlawConfig, options?: CommandNormalizeOptions) => boolean; type ShouldComputeCommandAuthorized$1 = (text?: string, cfg?: KlawConfig, options?: CommandNormalizeOptions) => boolean; //#endregion //#region src/auto-reply/dispatch-dispatcher.d.ts declare function settleReplyDispatcher(params: { dispatcher: ReplyDispatcher; onSettled?: () => void | Promise; }): Promise; declare function withReplyDispatcher(params: { dispatcher: ReplyDispatcher; run: () => Promise; onSettled?: () => void | Promise; }): Promise; //#endregion //#region src/channels/plugins/outbound/load.types.d.ts type LoadChannelOutboundAdapter = (id: ChannelId) => Promise; //#endregion //#region src/auto-reply/reply/reply-dispatcher.runtime-types.d.ts type CreateReplyDispatcherWithTyping = typeof createReplyDispatcherWithTyping; //#endregion //#region src/plugins/runtime/types-channel.d.ts type ShouldHandleTextCommands = ShouldHandleTextCommands$1; type IsControlCommandMessage = IsControlCommandMessage$1; type ShouldComputeCommandAuthorized = ShouldComputeCommandAuthorized$1; type BuildMentionRegexes = BuildMentionRegexes$1; type MatchesMentionPatterns = MatchesMentionPatterns$1; type MatchesMentionWithExplicit = MatchesMentionWithExplicit$1; type ReadSessionUpdatedAt = ReadSessionUpdatedAt$1; type RecordSessionMetaFromInbound = RecordSessionMetaFromInbound$1; type UpdateLastRoute = UpdateLastRoute$1; type RecordInboundSession = RecordInboundSession$1; type RuntimeThreadBindingLifecycleRecord = SessionBindingRecord | { boundAt: number; lastActivityAt: number; idleTimeoutMs?: number; maxAgeMs?: number; }; type PluginRuntimeChannelContextKey = { channelId: string; accountId?: string | null; capability: string; }; type PluginRuntimeChannelContextEvent = { type: "registered" | "unregistered"; key: { channelId: string; accountId?: string; capability: string; }; context?: unknown; }; type PluginRuntimeChannelContextRegistry = { register: (params: PluginRuntimeChannelContextKey & { context: unknown; abortSignal?: AbortSignal; }) => { dispose: () => void; }; get: (params: PluginRuntimeChannelContextKey) => T | undefined; watch: (params: { channelId?: string; accountId?: string | null; capability?: string; onEvent: (event: PluginRuntimeChannelContextEvent) => void; }) => () => void; }; type PluginRuntimeChannel = { text: { chunkByNewline: typeof chunkByNewline; chunkMarkdownText: typeof chunkMarkdownText; chunkMarkdownTextWithMode: typeof chunkMarkdownTextWithMode; chunkText: typeof chunkText; chunkTextWithMode: typeof chunkTextWithMode; resolveChunkMode: typeof resolveChunkMode; resolveTextChunkLimit: typeof resolveTextChunkLimit; hasControlCommand: typeof hasControlCommand; resolveMarkdownTableMode: ResolveMarkdownTableMode; convertMarkdownTables: typeof convertMarkdownTables; }; reply: { dispatchReplyWithBufferedBlockDispatcher: DispatchReplyWithBufferedBlockDispatcher; /** * @deprecated Prefer `klaw/plugin-sdk/channel-message` adapters plus * `dispatchReplyWithBufferedBlockDispatcher` or channel turn helpers. * This is a low-level legacy dispatcher escape hatch. */ createReplyDispatcherWithTyping: CreateReplyDispatcherWithTyping; resolveEffectiveMessagesConfig: typeof resolveEffectiveMessagesConfig; /** * @deprecated Prefer the channel-message reply pipeline helpers. This is * tied to the low-level legacy dispatcher path. */ resolveHumanDelayConfig: typeof resolveHumanDelayConfig; /** * @deprecated Prefer `dispatchReplyWithBufferedBlockDispatcher` with a * channel-message adapter or the channel turn helpers. Direct use must * manually preserve source reply delivery metadata such as * `sourceReplyDeliveryMode`. */ dispatchReplyFromConfig: DispatchReplyFromConfig; withReplyDispatcher: typeof withReplyDispatcher; settleReplyDispatcher: typeof settleReplyDispatcher; /** * @deprecated Prefer `buildChannelInboundEventContext` / * `buildChannelTurnContext` from `klaw/plugin-sdk/channel-inbound` so * inbound event metadata is carried into reply dispatch. */ finalizeInboundContext: typeof finalizeInboundContext; formatAgentEnvelope: typeof formatAgentEnvelope; /** @deprecated Prefer `BodyForAgent` + structured user-context blocks (do not build plaintext envelopes for prompts). */ formatInboundEnvelope: typeof formatInboundEnvelope; resolveEnvelopeFormatOptions: typeof resolveEnvelopeFormatOptions; }; routing: { buildAgentSessionKey: typeof buildAgentSessionKey; resolveAgentRoute: typeof resolveAgentRoute; }; pairing: { buildPairingReply: typeof buildPairingReply; readAllowFromStore: ReadChannelAllowFromStoreForAccount; upsertPairingRequest: UpsertChannelPairingRequestForAccount; }; media: { readRemoteMediaBuffer: typeof readRemoteMediaBuffer; /** @deprecated Use `readRemoteMediaBuffer`. */ fetchRemoteMedia: typeof fetchRemoteMedia; saveRemoteMedia: typeof saveRemoteMedia; saveResponseMedia: typeof saveResponseMedia; saveMediaBuffer: typeof saveMediaBuffer; }; activity: { record: typeof recordChannelActivity; get: typeof getChannelActivity; }; session: { /** @deprecated Prefer channel turn helpers that record inbound sessions as part of dispatch. */resolveStorePath: typeof resolveStorePath; readSessionUpdatedAt: ReadSessionUpdatedAt; recordSessionMetaFromInbound: RecordSessionMetaFromInbound; /** @deprecated Prefer channel turn helpers that record inbound sessions as part of dispatch. */ recordInboundSession: RecordInboundSession; updateLastRoute: UpdateLastRoute; }; mentions: { buildMentionRegexes: BuildMentionRegexes; matchesMentionPatterns: MatchesMentionPatterns; matchesMentionWithExplicit: MatchesMentionWithExplicit; implicitMentionKindWhen: typeof implicitMentionKindWhen; resolveInboundMentionDecision: typeof resolveInboundMentionDecision; }; reactions: { createAckReactionHandle: typeof createAckReactionHandle; shouldAckReaction: typeof shouldAckReaction; removeAckReactionAfterReply: typeof removeAckReactionAfterReply; removeAckReactionHandleAfterReply: typeof removeAckReactionHandleAfterReply; }; groups: { resolveGroupPolicy: typeof resolveChannelGroupPolicy; resolveRequireMention: typeof resolveChannelGroupRequireMention; }; debounce: { createInboundDebouncer: typeof createInboundDebouncer; resolveInboundDebounceMs: typeof resolveInboundDebounceMs; }; commands: { resolveCommandAuthorizedFromAuthorizers: typeof resolveCommandAuthorizedFromAuthorizers; isControlCommandMessage: IsControlCommandMessage; shouldComputeCommandAuthorized: ShouldComputeCommandAuthorized; shouldHandleTextCommands: ShouldHandleTextCommands; }; outbound: { loadAdapter: LoadChannelOutboundAdapter; }; turn: { run: typeof runChannelTurn; runAssembled: typeof dispatchAssembledChannelTurn; /** @deprecated Prefer `run(...)`. */ runResolved: typeof runResolvedChannelTurn; buildContext: typeof buildChannelInboundEventContext; runPrepared: typeof runPreparedChannelTurn; /** @deprecated Prefer `runAssembled(...)`. */ dispatchAssembled: typeof dispatchAssembledChannelTurn; }; threadBindings: { setIdleTimeoutBySessionKey: (params: { channelId: string; targetSessionKey: string; accountId?: string; idleTimeoutMs: number; }) => RuntimeThreadBindingLifecycleRecord[]; setMaxAgeBySessionKey: (params: { channelId: string; targetSessionKey: string; accountId?: string; maxAgeMs: number; }) => RuntimeThreadBindingLifecycleRecord[]; }; runtimeContexts: PluginRuntimeChannelContextRegistry; }; //#endregion //#region src/plugins/runtime/types.d.ts type SubagentRunParams = { sessionKey: string; message: string; provider?: string; model?: string; extraSystemPrompt?: string; lane?: string; lightContext?: boolean; deliver?: boolean; idempotencyKey?: string; }; type SubagentRunResult = { runId: string; }; type SubagentWaitParams = { runId: string; timeoutMs?: number; }; type SubagentWaitResult = { status: "ok" | "error" | "timeout"; error?: string; }; type SubagentGetSessionMessagesParams = { sessionKey: string; limit?: number; }; type SubagentGetSessionMessagesResult = { messages: unknown[]; }; /** @deprecated Use SubagentGetSessionMessagesParams. */ type SubagentGetSessionParams = SubagentGetSessionMessagesParams; /** @deprecated Use SubagentGetSessionMessagesResult. */ type SubagentGetSessionResult = SubagentGetSessionMessagesResult; type SubagentDeleteSessionParams = { sessionKey: string; deleteTranscript?: boolean; }; type RuntimeNodeListParams = { connected?: boolean; }; type RuntimeNodeListResult = { nodes: Array<{ nodeId: string; displayName?: string; remoteIp?: string; connected?: boolean; caps?: string[]; commands?: string[]; }>; }; type RuntimeNodeInvokeParams = { nodeId: string; command: string; params?: unknown; timeoutMs?: number; idempotencyKey?: string; }; /** Trusted in-process runtime surface injected into native plugins. */ type PluginRuntime = PluginRuntimeCore & { subagent: { run: (params: SubagentRunParams) => Promise; waitForRun: (params: SubagentWaitParams) => Promise; getSessionMessages: (params: SubagentGetSessionMessagesParams) => Promise; /** @deprecated Use getSessionMessages. */ getSession: (params: SubagentGetSessionParams) => Promise; deleteSession: (params: SubagentDeleteSessionParams) => Promise; }; nodes: { list: (params?: RuntimeNodeListParams) => Promise; invoke: (params: RuntimeNodeInvokeParams) => Promise; }; channel: PluginRuntimeChannel; }; type CreatePluginRuntimeOptions = { subagent?: PluginRuntime["subagent"]; nodes?: PluginRuntime["nodes"]; allowGatewaySubagentBinding?: boolean; }; //#endregion export { settleReplyDispatcher as a, SubagentRunResult as i, PluginRuntime as n, SubagentRunParams as r, CreatePluginRuntimeOptions as t };