UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

30 lines (29 loc) 826 B
import { r as analyzeArgvCommand } from "./exec-approvals-analysis-CaqIBAfQ.js"; import { s as detectInlineEvalInSegments } from "./risks-CTJz9z0K.js"; //#region src/infra/command-analysis/policy.ts /** Parses a shell or argv command into command segments for approval policy checks. */ function analyzeCommandForPolicy(params) { const analysis = analyzeArgvCommand({ argv: params.argv, cwd: params.cwd, env: params.env }); if (!analysis.ok) return { ok: false, source: params.source, reason: analysis.reason, analysis, segments: [] }; return { ok: true, source: params.source, analysis, segments: analysis.segments }; } function detectPolicyInlineEval(segments) { return detectInlineEvalInSegments(segments); } //#endregion export { detectPolicyInlineEval as n, analyzeCommandForPolicy as t };