cc-safety-net 2.5.2 → 2.6.0
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.
- package/README.md +6 -2
- package/dist/amp/cc-safety-net/index.ts +44 -42
- package/dist/api.js +1 -1
- package/dist/bin/hook.js +43 -41
- package/dist/chunks/{index-1sddy8kp.js → index-5ht7pdm3.js} +2 -2
- package/dist/chunks/index-6r8xp8d7.js +2 -0
- package/dist/chunks/index-a00fdxyv.js +4 -0
- package/dist/chunks/index-wwg1vy7s.js +47 -0
- package/dist/cli.js +174 -138
- package/dist/deepseek-harness/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/openclaw/cc-safety-net/index.js +43 -41
- package/dist/openclaw/cc-safety-net/openclaw.plugin.json +1 -1
- package/dist/openclaw/cc-safety-net/package.json +1 -1
- package/dist/pi/index.js +2 -2
- package/package.json +6 -2
- package/dist/chunks/index-0naqmp5p.js +0 -45
- package/dist/chunks/index-e1xw96x7.js +0 -4
- package/dist/chunks/index-n8c4p97n.js +0 -2
package/dist/pi/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Y,P,it,u}from"../chunks/index-wwg1vy7s.js";import{re}from"../chunks/index-5ht7pdm3.js";import{j,de,Se}from"../chunks/index-6r8xp8d7.js";import"../chunks/index-a00fdxyv.js";var m="cc-safety-net",C="Operate CC Safety Net: explain blocks, rules, integrations, diagnostics",p="Help me with CC Safety Net.";function s(o){o.registerCommand(m,{description:C,handler:async(n,t)=>{o.sendUserMessage(c(n),t.isIdle()?void 0:{deliverAs:"followUp"})}})}function c(o){return`${re.slice(re.indexOf("# CC Safety Net")).trimEnd()}
|
|
2
2
|
|
|
3
3
|
## User request
|
|
4
4
|
|
|
5
|
-
${o.trim()||p}`}var f=new Map([["bash","posix"],["powershell","powershell"]]),g={agent:"pi",debugLabel:"pi tool_call",extract:(o,n,t)=>
|
|
5
|
+
${o.trim()||p}`}var f=new Map([["bash","posix"],["powershell","powershell"]]),g={agent:"pi",debugLabel:"pi tool_call",extract:(o,n,t)=>w(o,n,t),getSessionId:(o,n)=>n.sessionManager.getSessionId(),allow:void 0,block:(o)=>v(o),includeEvidenceOnError:(o)=>o.route.kind==="command"};function d(o){o.on("tool_call",T)}var T=y();function y(o={}){return Se(g,o)}function w(o,n,t){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 i(n);if(typeof n.cwd!=="string"||n.cwd.trim()==="")return i(n,e.toolName);let l=it(".",[n.cwd],t);if(!l)return de({directory:"session",problem:"unusable",cwd:n.cwd},{toolName:e.toolName});let r=f.get(e.toolName);if(!e.input||typeof e.input!=="object")return r?i(n,e.toolName):void 0;if(!r)return u(e.toolName,e.input,{kind:P(e.toolName)},{configCwd:l,executionCwd:l},null);let a=e.input.command;if(typeof a!=="string"||a.trim()==="")return i(n,e.toolName);return u(e.toolName,e.input,{kind:"command",shell:r},{configCwd:l,executionCwd:l},a)}function i(o,n){return j(typeof o.cwd==="string"&&o.cwd.trim()?o.cwd:null,{toolName:n})}function v(o){return{block:!0,reason:Y(o)}}function N(o){d(o),s(o)}export{N as default};
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safety-net",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "A coding agent CLI hook - block destructive commands and secret file access",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"amp",
|
|
7
7
|
"claude-code",
|
|
8
8
|
"cursor",
|
|
9
9
|
"deepseek-harness",
|
|
10
|
+
"devin",
|
|
11
|
+
"devin-cli",
|
|
12
|
+
"droid",
|
|
13
|
+
"factory-droid",
|
|
10
14
|
"grok",
|
|
11
15
|
"grok-build",
|
|
12
16
|
"opencode",
|
|
@@ -129,5 +133,5 @@
|
|
|
129
133
|
"./dist/pi/index.js"
|
|
130
134
|
]
|
|
131
135
|
},
|
|
132
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "3793a43e9b1cab3458622c95175103bcf48ef1c6"
|
|
133
137
|
}
|