cc-safety-net 2.3.3 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "id": "cc-safety-net",
3
3
  "name": "CC Safety Net",
4
4
  "description": "Block destructive commands and secret-file access before OpenClaw runs a tool.",
5
- "version": "2.3.3",
5
+ "version": "2.3.4",
6
6
  "activation": {
7
7
  "onStartup": true
8
8
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safety-net",
3
- "version": "2.3.3",
3
+ "version": "2.3.4",
4
4
  "description": "Block destructive commands and secret-file access before OpenClaw runs a tool.",
5
5
  "type": "module",
6
6
  "openclaw": {
package/dist/pi/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import{a}from"../chunks/index-y9vmf6ts.js";import{k as u,l as c,m as f,n as C,o as g,p as N}from"../chunks/index-ebfx04sr.js";import{Aa as T,Bb as v,Ca as w,Ia as d,Y as p,la as P,ya as y}from"../chunks/index-tm5km50k.js";var D="cc-safety-net",S="Operate CC Safety Net: explain blocks, rules, integrations, diagnostics",I="Help me with CC Safety Net.";function s(o){o.registerCommand(D,{description:S,handler:async(n,e)=>{o.sendUserMessage(h(n),e.isIdle()?void 0:{deliverAs:"followUp"})}})}function h(o){return`${a.slice(a.indexOf("# CC Safety Net")).trimEnd()}
1
+ import{O,ie,r,se,P,c,d}from"../chunks/index-e7vaxtyk.js";import{ce}from"../chunks/index-68v9n663.js";import{ee,K,T,te,_e,j}from"../chunks/index-zqqsva7r.js";var f="cc-safety-net",C="Operate CC Safety Net: explain blocks, rules, integrations, diagnostics",g="Help me with CC Safety Net.";function s(o){o.registerCommand(f,{description:C,handler:async(n,e)=>{o.sendUserMessage(y(n),e.isIdle()?void 0:{deliverAs:"followUp"})}})}function y(o){return`${ce.slice(ce.indexOf("# CC Safety Net")).trimEnd()}
2
2
 
3
3
  ## User request
4
4
 
5
- ${o.trim()||I}`}var x=new Map([["bash","posix"]]);function E(o){o.on("tool_call",M)}var M=O();function O(o={}){return(n,e)=>_(n,e,o)}function _(o,n,e){let t=b(o,n);if(!t)return;if("malformed"in t)return u(t.denial,()=>n.sessionManager.getSessionId(),{agent:"pi",toolName:t.denial.toolName,cwd:t.cwd}),A(t.denial);try{let i=N(t,{guard:{auditAllowed:T(),policyOptions:e.policyOptions,dependencies:e.guardDependencies},audit:{agent:"pi",getSessionId:()=>n.sessionManager.getSessionId()}});return m(i,!0)}catch(i){if(!(i instanceof v))throw i;if(w(y.debug))console.error(`CC Safety Net debug: pi tool_call analysis failed: ${g(i.cause)}`);return m(i.evaluation,t.route.kind==="command")}}function b(o,n){if(!o||typeof o!=="object")return;let e=o;if(e.type!==void 0&&e.type!=="tool_call")return;if(typeof e.toolName!=="string"||e.toolName.trim()==="")return l(n);let t=typeof n.cwd==="string"&&n.cwd.trim()!==""?p(".",[n.cwd]):void 0;if(!t)return l(n,e.toolName);let i=x.get(e.toolName);if(!e.input||typeof e.input!=="object")return i?l(n,e.toolName):void 0;if(!i)return d(e.toolName,e.input,{kind:P(e.toolName)},{configCwd:t,executionCwd:t},null);let r=e.input.command;if(typeof r!=="string"||r.trim()==="")return l(n,e.toolName);return d(e.toolName,e.input,{kind:"command",shell:i},{configCwd:t,executionCwd:t},r)}function l(o,n){return{malformed:!0,denial:f({toolName:n}),cwd:typeof o.cwd==="string"&&o.cwd.trim()?o.cwd:null}}function m(o,n){let e=c(o,{includeEvidence:n});return e?A(e):void 0}function A(o){return{block:!0,reason:C(o)}}function k(o){E(o),s(o)}export{k as default};
5
+ ${o.trim()||g}`}var w=new Map([["bash","posix"]]);function u(o){o.on("tool_call",v)}var v=N();function N(o={}){return(n,e)=>E(n,e,o)}function E(o,n,e){let t=A(o,n);if(!t)return;if("malformed"in t)return ee(t.denial,()=>n.sessionManager.getSessionId(),{agent:"pi",toolName:t.denial.toolName,cwd:t.cwd}),p(t.denial);try{let i=j(t,{guard:{auditAllowed:se(),policyOptions:e.policyOptions,dependencies:e.guardDependencies},audit:{agent:"pi",getSessionId:()=>n.sessionManager.getSessionId()}});return m(i,!0)}catch(i){if(!(i instanceof d))throw i;if(P(r.debug))console.error(`CC Safety Net debug: pi tool_call analysis failed: ${_e(i.cause)}`);return m(i.evaluation,t.route.kind==="command")}}function A(o,n){if(!o||typeof o!=="object")return;let e=o;if(e.type!==void 0&&e.type!=="tool_call")return;if(typeof e.toolName!=="string"||e.toolName.trim()==="")return l(n);let t=typeof n.cwd==="string"&&n.cwd.trim()!==""?O(".",[n.cwd]):void 0;if(!t)return l(n,e.toolName);let i=w.get(e.toolName);if(!e.input||typeof e.input!=="object")return i?l(n,e.toolName):void 0;if(!i)return c(e.toolName,e.input,{kind:ie(e.toolName)},{configCwd:t,executionCwd:t},null);let a=e.input.command;if(typeof a!=="string"||a.trim()==="")return l(n,e.toolName);return c(e.toolName,e.input,{kind:"command",shell:i},{configCwd:t,executionCwd:t},a)}function l(o,n){return{malformed:!0,denial:T({toolName:n}),cwd:typeof o.cwd==="string"&&o.cwd.trim()?o.cwd:null}}function m(o,n){let e=K(o,{includeEvidence:n});return e?p(e):void 0}function p(o){return{block:!0,reason:te(o)}}function D(o){u(o),s(o)}export{D as default};