import { i as OpenClawConfig } from "./types.openclaw-CpnoYlBx.js"; import { A as ExecApprovalChannelRuntime, C as PluginApprovalResolvedView, G as ChannelApprovalKind, M as ExecApprovalChannelRuntimeEventKind, N as ChannelNativeApprovalDeliveryCallbacks, P as ChannelNativeApprovalTransportSpec, S as PluginApprovalPendingView, _ as ExecApprovalPendingView, a as ChannelApprovalNativeFinalAction, b as PendingApprovalView, c as ChannelApprovalNativePresentationAdapter, d as ChannelApprovalNativeTransportAdapter, f as ApprovalActionView, g as ExecApprovalExpiredView, h as ApprovalViewModel, i as ChannelApprovalNativeAvailabilityAdapter, l as ChannelApprovalNativeRuntimeAdapter, n as ApprovalResolved$1, o as ChannelApprovalNativeInteractionAdapter, p as ApprovalMetadataView, r as ChannelApprovalCapabilityHandlerContext, s as ChannelApprovalNativeObserveAdapter, t as ApprovalRequest$1, u as ChannelApprovalNativeRuntimeSpec, v as ExecApprovalResolvedView, w as ResolvedApprovalView, x as PluginApprovalExpiredView, y as ExpiredApprovalView, z as ChannelApprovalNativeAdapter } from "./approval-handler-runtime-types-Dv85jHOd.js"; import { l as ExecApprovalResolved, s as ExecApprovalRequest } from "./exec-approvals-BMVAZXjT.js"; import { l as PluginApprovalResolved, s as PluginApprovalRequest } from "./plugin-approvals-B-1AuXnw.js"; import { i as ChannelApprovalCapability } from "./types.adapters-BFws9krA.js"; import { t as resolveApprovalOverGateway } from "./approval-gateway-runtime-DGB7vDCo.js"; import { n as createLazyChannelApprovalNativeRuntimeAdapter, t as CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "./approval-handler-adapter-runtime-KzyKnFOw.js"; //#region src/infra/approval-handler-runtime.d.ts type ChannelApprovalHandler = ExecApprovalChannelRuntime; /** Adapts a strongly typed channel native approval spec into the erased runtime contract. */ declare function createChannelApprovalNativeRuntimeAdapter(spec: ChannelApprovalNativeRuntimeSpec): ChannelApprovalNativeRuntimeAdapter; type ChannelApprovalHandlerRuntimeSpec = { label: string; clientDisplayName: string; cfg: OpenClawConfig; gatewayUrl?: string; eventKinds?: readonly ExecApprovalChannelRuntimeEventKind[]; channel?: string; channelLabel?: string; accountId?: string | null; nativeAdapter?: ChannelApprovalNativeAdapter | null; resolveApprovalKind?: (request: TRequest) => ChannelApprovalKind; isConfigured: () => boolean; shouldHandle: (request: TRequest) => boolean; nowMs?: () => number; }; type ChannelApprovalHandlerContentSpec = { buildPendingContent: (params: { request: TRequest; approvalKind: ChannelApprovalKind; nowMs: number; }) => TPendingContent | Promise; }; type ChannelApprovalHandlerTransportSpec = ChannelNativeApprovalTransportSpec; type ChannelApprovalHandlerLifecycleSpec = ChannelNativeApprovalDeliveryCallbacks & { finalizeResolved: (params: { request: TRequest; resolved: TResolved; entries: TPendingEntry[]; }) => Promise; finalizeExpired?: (params: { request: TRequest; entries: TPendingEntry[]; }) => Promise; onStopped?: () => Promise | void; }; /** Adapter contract used by core to run a channel's native approval delivery lifecycle. */ type ChannelApprovalHandlerAdapter = { runtime: ChannelApprovalHandlerRuntimeSpec; content: ChannelApprovalHandlerContentSpec; transport: ChannelApprovalHandlerTransportSpec; lifecycle: ChannelApprovalHandlerLifecycleSpec; }; /** Creates the shared approval handler runtime from channel-specific content and transport hooks. */ declare function createChannelApprovalHandler(adapter: ChannelApprovalHandlerAdapter): ChannelApprovalHandler; /** Builds a shared approval handler from a plugin approval capability, or null when unsupported. */ declare function createChannelApprovalHandlerFromCapability(params: { capability?: Pick | null; label: string; clientDisplayName: string; channel: string; channelLabel: string; cfg: OpenClawConfig; accountId?: string | null; gatewayUrl?: string; context?: unknown; nowMs?: () => number; }): Promise; //#endregion //#region src/plugin-sdk/approval-handler-runtime.d.ts type ApprovalRequest = ExecApprovalRequest | PluginApprovalRequest; type ApprovalResolved = ExecApprovalResolved | PluginApprovalResolved; /** Builds channel-visible resolved approval text for exec and plugin approvals. */ declare function buildChannelApprovalResolvedText(params: { request: ApprovalRequest; resolved: ApprovalResolved; view: ResolvedApprovalView; }): string; /** Builds channel-visible expiration text for exec and plugin approvals. */ declare function buildChannelApprovalExpiredText(params: { request: ApprovalRequest; view: ExpiredApprovalView; }): string; /** Resolves the account id prepared for approval routing with planned/context fallback order. */ declare function resolvePreparedApprovalAccountId(params: { plannedAccountId?: string | null; contextAccountId?: string | null; fallbackAccountId: string; }): string; /** Resolve prepared approval account id when every source may be missing. */ declare function resolvePreparedApprovalAccountId(params: { plannedAccountId?: string | null; contextAccountId?: string | null; fallbackAccountId?: string | null; }): string | undefined; //#endregion export { type ApprovalActionView, type ApprovalMetadataView, type ApprovalViewModel, CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY, type ChannelApprovalCapabilityHandlerContext, type ChannelApprovalHandler, type ChannelApprovalHandlerAdapter, type ChannelApprovalNativeAvailabilityAdapter, type ChannelApprovalNativeFinalAction, type ChannelApprovalNativeInteractionAdapter, type ChannelApprovalNativeObserveAdapter, type ChannelApprovalNativePresentationAdapter, type ChannelApprovalNativeRuntimeAdapter, type ChannelApprovalNativeRuntimeSpec, type ChannelApprovalNativeTransportAdapter, type ExecApprovalExpiredView, type ExecApprovalPendingView, type ExecApprovalResolvedView, type ExpiredApprovalView, type PendingApprovalView, type PluginApprovalExpiredView, type PluginApprovalPendingView, type PluginApprovalResolvedView, type ResolvedApprovalView, buildChannelApprovalExpiredText, buildChannelApprovalResolvedText, createChannelApprovalHandler, createChannelApprovalHandlerFromCapability, createChannelApprovalNativeRuntimeAdapter, createLazyChannelApprovalNativeRuntimeAdapter, resolveApprovalOverGateway, resolvePreparedApprovalAccountId };