openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.56 kB
JavaScript
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";import{i as buildPluginApprovalExpiredMessage,o as buildPluginApprovalResolvedMessage}from"./plugin-approvals-NfNDMxex.mjs";import{h as normalizeApprovalRequest}from"./approval-request-account-binding-DFLDpifZ.mjs";import"./approval-gateway-runtime-DszRD0gi.mjs";import{n as buildSystemAgentApprovalResolvedText,t as SYSTEM_AGENT_APPROVAL_EXPIRED_TEXT}from"./approval-terminal-BEKbbZHB.mjs";import"./approval-handler-runtime-CNfWel-a.mjs";
//!src/plugin-sdk/approval-handler-runtime.ts
function buildChannelApprovalResolvedText(e){if(e.view.approvalKind===`system-agent`)return buildSystemAgentApprovalResolvedText({...e.view,decision:e.resolved.decision});if(e.view.approvalKind===`plugin`)return buildPluginApprovalResolvedMessage(e.resolved);const t=e.resolved.resolvedBy?` Resolved by ${e.resolved.resolvedBy}.`:``;return`✅ Exec approval ${e.resolved.decision}.${t} ID: ${e.request.id}`}function buildChannelApprovalExpiredText(e){const t=normalizeApprovalRequest(e.request);if(t.approvalKind===`system-agent`)return SYSTEM_AGENT_APPROVAL_EXPIRED_TEXT;if(t.approvalKind===`plugin`)return buildPluginApprovalExpiredMessage(t);return`⏱️ Exec approval expired. ID: ${t.id}`}function resolvePreparedApprovalAccountId(e){return normalizeOptionalString(e.plannedAccountId)??normalizeOptionalString(e.contextAccountId)??normalizeOptionalString(e.fallbackAccountId)}export{buildChannelApprovalResolvedText as n,resolvePreparedApprovalAccountId as r,buildChannelApprovalExpiredText as t};