openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 1.42 kB
JavaScript
//!src/plugin-sdk/agent-harness-exec-review-runtime.ts
async function reviewExecRequestWithConfiguredModel(e){const{createModelExecAutoReviewer:t}=await import(`../exec-auto-reviewer-DnLpLnZh.mjs`);return t({cfg:e.cfg,agentId:e.agentId,reviewer:e.reviewer})(e.input)}async function buildExecAutoReviewInputForShellCommand(e){const[{evaluateShellAllowlistWithAuthorization:t},{detectUnsafeExecControlShellCommand:n},{detectInlineEvalInSegments:r},{isBlockedShellWrapperCommand:i}]=await Promise.all([import(`../exec-approvals-3XsJcyEn.mjs`),import(`../exec-control-command-guard-sqHGDbX_.mjs`),import(`../risks-Bb--mWjP.mjs`),import(`../exec-wrapper-resolution-sIlzBlO7.mjs`)]);const a=e.command.trim();const o=e.host;if(!a)return;const s=await t({command:a,allowlist:[],safeBins:/* @__PURE__ */ new Set,cwd:e.cwd??void 0,platform:process.platform});const[c]=s.segments;if(!(s.analysisOk&&s.segments.length===1&&c!==void 0&&c.raw.trim()===a))return;if(c.resolution?.policyBlocked===true||i(c.argv))return;if(await n(a)!==null)return;const l=r(s.segments)!==null;const u=c.argv.some(e=>e.startsWith(`<<`));return{command:a,argv:c.argv,cwd:e.cwd??null,envKeys:e.envKeys,host:o,reason:l?`strict-inline-eval`:u?`heredoc`:`approval-required`,analysis:{parsed:true,allowlistMatched:false,inlineEval:l,...u?{heredoc:u}:{}},agent:e.agent}}export{buildExecAutoReviewInputForShellCommand,reviewExecRequestWithConfiguredModel};