@celljs/ta-permission-gate 4.6.1 → 4.7.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.
Files changed (2) hide show
  1. package/README.en.md +28 -0
  2. package/package.json +1 -1
package/README.en.md ADDED
@@ -0,0 +1,28 @@
1
+ # Cell - Ta Permission Gate
2
+
3
+ A pi package: allows, asks for permission on, or denies tool calls based on rules. No Cell dependency; both Ta and pi can install it:
4
+
5
+ ```bash
6
+ ta install npm:@celljs/ta-permission-gate
7
+ pi install npm:@celljs/ta-permission-gate
8
+ ```
9
+
10
+ Rules are written in `permissions.json`, with one global file (in the agent directory) and one per project (in `.ta/` or `.pi/`):
11
+
12
+ ```json
13
+ {
14
+ "default": "allow",
15
+ "rules": [
16
+ { "tool": "bash", "command": "git push*", "action": "ask" },
17
+ { "tool": "bash", "command": "*rm -rf*", "action": "deny" },
18
+ { "path": "*/.env*", "action": "deny" }
19
+ ]
20
+ }
21
+ ```
22
+
23
+ - The first matching rule in each file takes effect. If none match, use `default` (default is `allow`); `*` matches any characters, others are literal.
24
+ - Both files take the stricter result: a project can only tighten permissions, not loosen them; otherwise an untrusted repo could give itself permissions.
25
+ - `ask` calls `ctx.ui.confirm`. If no answer arrives within 5 minutes, it's treated as deny. Without a UI (`-p`) it's directly denied. Under `ta serve`, the dialog is sent to all connected clients.
26
+ - If a file cannot be read or has bad format, all calls are denied.
27
+
28
+ When there's no `permissions.json`, nothing is restricted, consistent with pi's default behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-permission-gate",
3
- "version": "4.6.1",
3
+ "version": "4.7.0",
4
4
  "description": "A pi package: allow, ask or deny tool calls by rules. Works in Ta and in pi.",
5
5
  "keywords": [
6
6
  "pi-package"