cc-safety-net 2.5.2 → 2.6.1
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 +46 -42
- package/dist/api.js +1 -1
- package/dist/bin/hook.js +45 -41
- package/dist/chunks/{index-1sddy8kp.js → index-5ht7pdm3.js} +2 -2
- package/dist/chunks/index-k4yfpsk1.js +4 -0
- package/dist/chunks/index-mqmy0cce.js +49 -0
- package/dist/chunks/index-tyab2dd4.js +2 -0
- package/dist/cli.js +3850 -4015
- package/dist/deepseek-harness/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/openclaw/cc-safety-net/index.js +45 -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 +10 -5
- 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-mqmy0cce.js";import{re}from"../chunks/index-5ht7pdm3.js";import{j,de,Se}from"../chunks/index-tyab2dd4.js";import"../chunks/index-k4yfpsk1.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.1",
|
|
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",
|
|
@@ -74,10 +78,11 @@
|
|
|
74
78
|
"test:e2e:live": "CC_SAFETY_NET_E2E_LIVE=1 bun test tests/e2e-live",
|
|
75
79
|
"test:coverage": "AGENT=1 bun test tests --path-ignore-patterns 'tests/e2e-live/**' --coverage --coverage-reporter=text --coverage-reporter=lcov",
|
|
76
80
|
"cc-safety-net": "bun run src/entries/bin.ts",
|
|
81
|
+
"gui:dev": "bun scripts/gui-dev.ts",
|
|
77
82
|
"eval": "claude plugin eval . --ablation with-without --judge-model sonnet --allow-tools \"Bash(npx -y cc-safety-net:*)\" \"Bash(npx cc-safety-net:*)\"",
|
|
78
83
|
"lint:fix": "oxlint --fix src tests scripts knip.ts",
|
|
79
|
-
"format": "oxfmt src tests scripts knip.ts .oxfmtrc.json .oxlintrc.json package.json kimi.plugin.json tsconfig.json tsconfig.build.json tsconfig.gui.json .claude-plugin .codex-plugin assets/cc-safety-net.schema.json docs/residual-risk-registry.json hooks",
|
|
80
|
-
"format:check": "oxfmt --check src tests scripts knip.ts .oxfmtrc.json .oxlintrc.json package.json kimi.plugin.json tsconfig.json tsconfig.build.json tsconfig.gui.json .claude-plugin .codex-plugin assets/cc-safety-net.schema.json docs/residual-risk-registry.json hooks"
|
|
84
|
+
"format": "oxfmt src tests scripts knip.ts .oxfmtrc.json .oxlintrc.json package.json kimi.plugin.json tsconfig.json tsconfig.build.json tsconfig.gui.json .claude-plugin .codex-plugin .cursor-plugin assets/cc-safety-net.schema.json docs/residual-risk-registry.json hooks",
|
|
85
|
+
"format:check": "oxfmt --check src tests scripts knip.ts .oxfmtrc.json .oxlintrc.json package.json kimi.plugin.json tsconfig.json tsconfig.build.json tsconfig.gui.json .claude-plugin .codex-plugin .cursor-plugin assets/cc-safety-net.schema.json docs/residual-risk-registry.json hooks"
|
|
81
86
|
},
|
|
82
87
|
"devDependencies": {
|
|
83
88
|
"@ampcode/plugin": "0.0.0-20260724002649-ga3413e7",
|
|
@@ -112,7 +117,7 @@
|
|
|
112
117
|
"js-yaml": "^4.3.1",
|
|
113
118
|
"picomatch@^2.3.1": "2.3.2",
|
|
114
119
|
"picomatch@^4.0.1": "^4.0.5",
|
|
115
|
-
"smol-toml": "^1.
|
|
120
|
+
"smol-toml": "^1.9.0",
|
|
116
121
|
"yaml": "^2.9.0"
|
|
117
122
|
},
|
|
118
123
|
"engines": {
|
|
@@ -129,5 +134,5 @@
|
|
|
129
134
|
"./dist/pi/index.js"
|
|
130
135
|
]
|
|
131
136
|
},
|
|
132
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "9c1af13ca623246b76470ee714b5cb90b92af71a"
|
|
133
138
|
}
|