@meridian-flow/mars-schema 0.31.1 → 0.32.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.
Files changed (43) hide show
  1. package/README.md +16 -2
  2. package/fixtures/prepare/package-tools/expected.json +213 -0
  3. package/fixtures/prepare/package-tools/input/agents/a.md +7 -0
  4. package/fixtures/prepare/package-tools/input/agents/b.md +4 -0
  5. package/fixtures/prepare/package-tools/input/mars.toml +10 -0
  6. package/fixtures/prepare/package-tools/request.json +3 -0
  7. package/fixtures/prepare/package-tools-invalid/expected.json +112 -0
  8. package/fixtures/prepare/package-tools-invalid/input/agents/b.md +4 -0
  9. package/fixtures/prepare/package-tools-invalid/input/mars.toml +8 -0
  10. package/fixtures/prepare/package-tools-invalid/request.json +3 -0
  11. package/fixtures/project/aliases-reach-one-capability/expected.json +47 -0
  12. package/fixtures/project/aliases-reach-one-capability/request.json +15 -0
  13. package/fixtures/project/claude-allowlist-covered/expected.json +60 -0
  14. package/fixtures/project/claude-allowlist-covered/request.json +20 -0
  15. package/fixtures/project/claude-edit-beats-write/expected.json +53 -0
  16. package/fixtures/project/claude-edit-beats-write/request.json +15 -0
  17. package/fixtures/project/claude-scoped-file-rules/expected.json +68 -0
  18. package/fixtures/project/claude-scoped-file-rules/request.json +20 -0
  19. package/fixtures/project/codex-no-switch-and-absent/expected.json +49 -0
  20. package/fixtures/project/codex-no-switch-and-absent/request.json +20 -0
  21. package/fixtures/project/flow-allowlist/expected.json +44 -0
  22. package/fixtures/project/flow-allowlist/request.json +15 -0
  23. package/fixtures/project/flow-closed-tool-set/expected.json +75 -0
  24. package/fixtures/project/flow-closed-tool-set/request.json +10 -0
  25. package/fixtures/project/flow-gaps-and-ask/expected.json +57 -0
  26. package/fixtures/project/flow-gaps-and-ask/request.json +20 -0
  27. package/fixtures/project/flow-scoped-pattern/expected.json +23 -0
  28. package/fixtures/project/flow-scoped-pattern/request.json +10 -0
  29. package/fixtures/project/flow-write-deny/expected.json +29 -0
  30. package/fixtures/project/flow-write-deny/request.json +10 -0
  31. package/fixtures/project/key-with-pattern/expected.json +68 -0
  32. package/fixtures/project/key-with-pattern/request.json +8 -0
  33. package/fixtures/vocabulary/expected.json +54 -0
  34. package/index.d.ts +55 -0
  35. package/node/mars_schema_wasm.d.ts +7 -0
  36. package/node/mars_schema_wasm.js +27 -0
  37. package/node/mars_schema_wasm_bg.wasm +0 -0
  38. package/node/mars_schema_wasm_bg.wasm.d.ts +1 -0
  39. package/package.json +1 -1
  40. package/web/mars_schema_wasm.d.ts +8 -0
  41. package/web/mars_schema_wasm.js +26 -0
  42. package/web/mars_schema_wasm_bg.wasm +0 -0
  43. package/web/mars_schema_wasm_bg.wasm.d.ts +1 -0
package/README.md CHANGED
@@ -29,7 +29,8 @@ await init();
29
29
  | `emitValue(value, indent)` | YAML for one value, to splice after a key. |
30
30
  | `rewriteBlock(frontmatter)` | The whole frontmatter block between the `---` fences for ordered `[key, value]` pairs. |
31
31
  | `vocabulary()` | The tool capabilities, their aliases, and the native tools of each host. |
32
- | `prepare({files, context?, declaredDialect?, migrate?})` | Reads one root held in memory: classifies it, upgrades or translates it, and returns each definition's normalized bytes, typed reading and change record. `migrate` adds `mars migrate`'s repair: a removed Agent key whose replacement is a `harness-overrides` key moves there. |
32
+ | `project(rules, host)` | Lowers an Agent's tool rules (a `capability` may be a whole key such as `bash(git *)`) onto a host with the code `mars sync` uses: the native names each action ends with, each rule's gap or stricter rule, and how the host handles `ask`. |
33
+ | `prepare({files, context?, declaredDialect?, migrate?})` | Reads one root held in memory: classifies it, upgrades or translates it, and returns each definition's normalized bytes, typed reading and change record. `migrate` adds `mars migrate`'s repair: a removed Agent key whose replacement is a `harness-overrides` key moves there. Each Agent's `fields.tools` also holds the package's `[package.tools]` rules for keys the Agent does not name, with `origin: "package"`, as `mars sync` writes them. |
33
34
  | `inspect({tree, hint?})` | Reports what a repository is: a marketplace's plugins, a plugin's or skill tree's items, the dialect and the evidence for it. |
34
35
  | `normalize({tree, source?, hint?, selection?})` | Turns a selection into schema v1 packages with a generated `mars.toml` and provenance. |
35
36
  | `satisfies(constraint, version)` | Whether a version meets a dependency entry's `version` (`^1.2`, `v2`, a bare `0.20` as `^0.20`, `latest`; a branch or commit pin is met by none). |
@@ -94,9 +95,21 @@ natives["meridian-flow"].work; // { kind: "tools", tools: ["work
94
95
 
95
96
  `natives` has one table for each of `claude`, `codex`, `opencode`, `pi`, `cursor` and `meridian-flow` (Meridian Flow's own tools, which is not a harness). An entry is the host's tool names (`tools`), file tools scoped through a permission category (`scoped-tools`), `absent` (the host has no such tool) or `no-switch` (the host can do it but has no tool to turn off). The capability table is explained in [Tool capabilities](https://github.com/haowjy/mars-agents/blob/main/docs/config/schema-v1.md#tool-capabilities).
96
97
 
98
+ ### `project`
99
+
100
+ ```ts
101
+ const { tools } = read("agents/a.md", text).fields; // [{ capability, pattern, action }, ...]
102
+ const p = project(tools, "meridian-flow");
103
+ p.allow; p.deny; p.ask; // native tool names after stricter rules win shared names
104
+ p.default; // "deny" for `{"*": deny}`: what a tool no rule names gets; null without a `*` rule
105
+ p.rules[0].status; // "known" | "absent" | "unknown" | "unscopable" | null (for `*`)
106
+ ```
107
+
108
+ `host` is `claude`, `codex`, `pi`, `opencode`, `cursor` or `meridian-flow`. A rule with a gap has `status` other than `known`, no `native` names and the reason in `note`; a rule a stricter rule beats keeps its place in `rules` with `covered_by` set or the shared name missing from `native`. The result decides nothing: whether a gap is a warning or an error is the caller's policy. Meridian Flow's tools take no scope, so a rule with a pattern there is `unscopable`.
109
+
97
110
  ### `prepare`, `inspect`, `normalize`
98
111
 
99
- `prepare` is the single-root core. It classifies the root (`schema-1`, `mars-legacy`, `schema-newer`, a foreign dialect, `marketplace`, `invalid` or `empty`), selects definitions, upgrades a pre-v1 package or translates a foreign one, and reads each result. For each definition it returns the source and output paths, the normalized bytes, the typed reading, and a change record (`none`, `generated`, `edited` with the changed key paths, or `fully-rewritten`); payload files come back as source-to-output paths without bytes. Findings are keyed by source path in `diagnostics`; what preparing dropped, moved or repaired in each file (a pre-v1 upgrade's removals, a foreign translation's moves) is keyed the same way in `changes`, and a file counts as changed when its change record is not `none` or `generated`. `context` is `"package"` (the default), `"authored-local"` (a consumer project's `.mars-src`) or `"project"` (a project directory: a `mars.toml` with no `[package]` is consumer configuration, and the tree is read as authored content). A tree with no manifest is read as one dialect, Claude unless an Agent has a `permission` map or a `tools` map of booleans (OpenCode), and the keys only pre-v1 Mars defined are rewritten one by one whatever that dialect is, so they never change how the rest of the tree is read. A translated or upgraded definition is never refused: what schema v1 does not accept is moved under `harness-overrides.<dialect>` or dropped, except a key Mars lowers itself (`model`, `effort`, `tools`, `disallowed-tools`, `skills`, `mode`), which is never moved: a mapping loses only its invalid entries and a scalar is dropped. Losing a restriction is a change coded `field.restriction-lost` that names the agent; report these every time, since each leaves an agent less restricted than its file says. `prepare` is supported on its own, for reading one root without choosing items; `normalize` is `prepare` plus a selection, a generated `mars.toml` and provenance.
112
+ `prepare` is the single-root core. It classifies the root (`schema-1`, `mars-legacy`, `schema-newer`, a foreign dialect, `marketplace`, `invalid` or `empty`), selects definitions, upgrades a pre-v1 package or translates a foreign one, and reads each result. For each definition it returns the source and output paths, the normalized bytes, the typed reading, and a change record (`none`, `generated`, `edited` with the changed key paths, or `fully-rewritten`); payload files come back as source-to-output paths without bytes. Findings are keyed by source path in `diagnostics`; what preparing dropped, moved or repaired in each file (a pre-v1 upgrade's removals, a foreign translation's moves) is keyed the same way in `changes`, and a file counts as changed when its change record is not `none` or `generated`. `context` is `"package"` (the default), `"authored-local"` (a consumer project's `.mars-src`) or `"project"` (a project directory: a `mars.toml` with no `[package]` is consumer configuration, and the tree is read as authored content). A tree with no manifest is read as one dialect, Claude unless an Agent has a `permission` map or a `tools` map of booleans (OpenCode), and the keys only pre-v1 Mars defined are rewritten one by one whatever that dialect is, so they never change how the rest of the tree is read. A translated or upgraded definition is never refused: what schema v1 does not accept is moved under `harness-overrides.<dialect>` or dropped, except a key Mars lowers itself (`model`, `effort`, `tools`, `disallowed-tools`, `skills`, `mode`), which is never moved: a mapping loses only its invalid entries and a scalar is dropped. Losing a restriction is a change coded `field.restriction-lost` that names the agent; report these every time, since each leaves an agent less restricted than its file says. `fields.tools` of an Agent in `prepare`'s result is what `mars sync` installs: the package's `[package.tools]` rules for each key the Agent's own `tools:` does not name (two spellings of one key are one key) follow its own rules, marked `origin: "package"`; `normalized_bytes` stay the authored file's. `read` sees one file, so it never adds them. When the package's `mars.toml` has any error (an invalid `[package.tools]` entry included), each Agent's reading carries a `package-tools.unreadable` error: `mars sync` refuses that package and installs no Agent, so a consumer must not install it either. `prepare` is supported on its own, for reading one root without choosing items; `normalize` is `prepare` plus a selection, a generated `mars.toml` and provenance.
100
113
 
101
114
  `inspect` reports what is in a repository before anything is chosen, and `normalize` builds the packages for a selection. A remote marketplace plugin is fetched by the caller: `inspect` the marketplace, fetch the entry's repository, then `inspect` or `normalize` the fetched tree with `hint.plugin` set to the entry.
102
115
 
@@ -133,6 +146,7 @@ Each package's edges and `uses-providers` are read from `prepared.selection`, so
133
146
  | `prepare` | `input/`, `request.json`, `expected.json` | classifying and reading one root, and with `"migrate": true` the repair `mars migrate` writes back |
134
147
  | `normalize` | `input/`, `request.json`, `inspection.json`, `normalized.json`, `expected/` | reading a foreign repository |
135
148
  | `vocabulary` | `expected.json` | the capabilities, aliases and native tools |
149
+ | `project` | `request.json`, `expected.json` | `project` for one rule list on one host |
136
150
  | `version` | `input.json`, `expected.json` | `satisfies`, `satisfiesRequirement` and `selectVersion`, with the `code` of each refusal (the Rust leg also pins `parse-constraint` and `parse-tag`, which are not exported) |
137
151
  | `selection` | `request.json`, `packages/` (or `packages_from`: a sibling case's), `expected.json` | `selectItems` over packages prepared from `packages/` |
138
152
 
@@ -0,0 +1,213 @@
1
+ {
2
+ "classification": {
3
+ "kind": "schema-1"
4
+ },
5
+ "manifest": {
6
+ "source_path": "mars.toml",
7
+ "output_path": "mars.toml",
8
+ "reading": {
9
+ "frontmatter": [
10
+ [
11
+ "name",
12
+ "p"
13
+ ],
14
+ [
15
+ "version",
16
+ "0.1.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ],
22
+ [
23
+ "tools",
24
+ {
25
+ "write": "deny",
26
+ "bash(git *)": "ask",
27
+ "read": "deny",
28
+ "bash(rm:*)": "deny"
29
+ }
30
+ ]
31
+ ],
32
+ "fields": {
33
+ "name": "p",
34
+ "version": "0.1.0",
35
+ "schema": 1,
36
+ "tools": {
37
+ "bash(git *)": "ask",
38
+ "bash(rm:*)": "deny",
39
+ "read": "deny",
40
+ "write": "deny"
41
+ }
42
+ },
43
+ "body": null,
44
+ "diagnostics": []
45
+ },
46
+ "change": {
47
+ "kind": "none"
48
+ }
49
+ },
50
+ "definitions": [
51
+ {
52
+ "kind": "agent",
53
+ "slug": "a",
54
+ "source_path": "agents/a.md",
55
+ "output_path": "agents/a.md",
56
+ "reading": {
57
+ "frontmatter": [
58
+ [
59
+ "name",
60
+ "A"
61
+ ],
62
+ [
63
+ "tools",
64
+ {
65
+ "read": "allow",
66
+ "bash(rm *)": "allow"
67
+ }
68
+ ]
69
+ ],
70
+ "fields": {
71
+ "name": "A",
72
+ "description": null,
73
+ "harness": null,
74
+ "model": null,
75
+ "mode": null,
76
+ "model-invocable": true,
77
+ "user-invocable": true,
78
+ "approval": null,
79
+ "sandbox": null,
80
+ "network": null,
81
+ "network-allow": [],
82
+ "network-deny": [],
83
+ "effort": null,
84
+ "skills": {
85
+ "load": [],
86
+ "available": []
87
+ },
88
+ "subagents": [],
89
+ "tools": [
90
+ {
91
+ "capability": "read",
92
+ "pattern": null,
93
+ "action": "allow",
94
+ "origin": "profile"
95
+ },
96
+ {
97
+ "capability": "bash",
98
+ "pattern": "rm *",
99
+ "action": "allow",
100
+ "origin": "profile"
101
+ },
102
+ {
103
+ "capability": "bash",
104
+ "pattern": "git *",
105
+ "action": "ask",
106
+ "origin": "package"
107
+ },
108
+ {
109
+ "capability": "write",
110
+ "pattern": null,
111
+ "action": "deny",
112
+ "origin": "package"
113
+ }
114
+ ],
115
+ "harness-overrides": {},
116
+ "model-policies": []
117
+ },
118
+ "body": "body\n",
119
+ "diagnostics": []
120
+ },
121
+ "change": {
122
+ "kind": "none"
123
+ }
124
+ },
125
+ {
126
+ "kind": "agent",
127
+ "slug": "b",
128
+ "source_path": "agents/b.md",
129
+ "output_path": "agents/b.md",
130
+ "reading": {
131
+ "frontmatter": [
132
+ [
133
+ "name",
134
+ "B"
135
+ ]
136
+ ],
137
+ "fields": {
138
+ "name": "B",
139
+ "description": null,
140
+ "harness": null,
141
+ "model": null,
142
+ "mode": null,
143
+ "model-invocable": true,
144
+ "user-invocable": true,
145
+ "approval": null,
146
+ "sandbox": null,
147
+ "network": null,
148
+ "network-allow": [],
149
+ "network-deny": [],
150
+ "effort": null,
151
+ "skills": {
152
+ "load": [],
153
+ "available": []
154
+ },
155
+ "subagents": [],
156
+ "tools": [
157
+ {
158
+ "capability": "bash",
159
+ "pattern": "git *",
160
+ "action": "ask",
161
+ "origin": "package"
162
+ },
163
+ {
164
+ "capability": "bash",
165
+ "pattern": "rm *",
166
+ "action": "deny",
167
+ "origin": "package"
168
+ },
169
+ {
170
+ "capability": "read",
171
+ "pattern": null,
172
+ "action": "deny",
173
+ "origin": "package"
174
+ },
175
+ {
176
+ "capability": "write",
177
+ "pattern": null,
178
+ "action": "deny",
179
+ "origin": "package"
180
+ }
181
+ ],
182
+ "harness-overrides": {},
183
+ "model-policies": []
184
+ },
185
+ "body": "body\n",
186
+ "diagnostics": []
187
+ },
188
+ "change": {
189
+ "kind": "none"
190
+ }
191
+ }
192
+ ],
193
+ "payload": [],
194
+ "selection": {
195
+ "definitions": [
196
+ {
197
+ "kind": "agent",
198
+ "slug": "a",
199
+ "output_path": "agents/a.md",
200
+ "skills": []
201
+ },
202
+ {
203
+ "kind": "agent",
204
+ "slug": "b",
205
+ "output_path": "agents/b.md",
206
+ "skills": []
207
+ }
208
+ ],
209
+ "edges": [],
210
+ "uses_providers": []
211
+ },
212
+ "diagnostics": {}
213
+ }
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: A
3
+ tools:
4
+ read: allow
5
+ "bash(rm *)": allow
6
+ ---
7
+ body
@@ -0,0 +1,4 @@
1
+ ---
2
+ name: B
3
+ ---
4
+ body
@@ -0,0 +1,10 @@
1
+ [package]
2
+ name = "p"
3
+ version = "0.1.0"
4
+ schema = 1
5
+
6
+ [package.tools]
7
+ write = "deny"
8
+ "bash(git *)" = "ask"
9
+ read = "deny"
10
+ "bash(rm:*)" = "deny"
@@ -0,0 +1,3 @@
1
+ {
2
+ "context": "package"
3
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "classification": {
3
+ "kind": "schema-1"
4
+ },
5
+ "manifest": {
6
+ "source_path": "mars.toml",
7
+ "output_path": "mars.toml",
8
+ "reading": {
9
+ "frontmatter": [
10
+ [
11
+ "name",
12
+ "p"
13
+ ],
14
+ [
15
+ "version",
16
+ "0.1.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ],
22
+ [
23
+ "tools",
24
+ {
25
+ "write": "deny",
26
+ "read": "maybe"
27
+ }
28
+ ]
29
+ ],
30
+ "fields": null,
31
+ "body": null,
32
+ "diagnostics": [
33
+ {
34
+ "code": "manifest.invalid-field",
35
+ "severity": "error",
36
+ "path": [
37
+ "package"
38
+ ],
39
+ "message": "invalid package field: unknown variant `maybe`, expected one of `allow`, `deny`, `ask`\nin `tools.read`\n"
40
+ }
41
+ ]
42
+ },
43
+ "change": {
44
+ "kind": "none"
45
+ }
46
+ },
47
+ "definitions": [
48
+ {
49
+ "kind": "agent",
50
+ "slug": "b",
51
+ "source_path": "agents/b.md",
52
+ "output_path": "agents/b.md",
53
+ "reading": {
54
+ "frontmatter": [
55
+ [
56
+ "name",
57
+ "B"
58
+ ]
59
+ ],
60
+ "fields": {
61
+ "name": "B",
62
+ "description": null,
63
+ "harness": null,
64
+ "model": null,
65
+ "mode": null,
66
+ "model-invocable": true,
67
+ "user-invocable": true,
68
+ "approval": null,
69
+ "sandbox": null,
70
+ "network": null,
71
+ "network-allow": [],
72
+ "network-deny": [],
73
+ "effort": null,
74
+ "skills": {
75
+ "load": [],
76
+ "available": []
77
+ },
78
+ "subagents": [],
79
+ "tools": [],
80
+ "harness-overrides": {},
81
+ "model-policies": []
82
+ },
83
+ "body": "body\n",
84
+ "diagnostics": [
85
+ {
86
+ "code": "package-tools.unreadable",
87
+ "severity": "error",
88
+ "path": [],
89
+ "message": "the package's mars.toml has an error, so its `[package.tools]` rules cannot be added and `mars sync` refuses the package: invalid package field: unknown variant `maybe`, expected one of `allow`, `deny`, `ask`\nin `tools.read`\n"
90
+ }
91
+ ]
92
+ },
93
+ "change": {
94
+ "kind": "none"
95
+ }
96
+ }
97
+ ],
98
+ "payload": [],
99
+ "selection": {
100
+ "definitions": [
101
+ {
102
+ "kind": "agent",
103
+ "slug": "b",
104
+ "output_path": "agents/b.md",
105
+ "skills": []
106
+ }
107
+ ],
108
+ "edges": [],
109
+ "uses_providers": []
110
+ },
111
+ "diagnostics": {}
112
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ name: B
3
+ ---
4
+ body
@@ -0,0 +1,8 @@
1
+ [package]
2
+ name = "p"
3
+ version = "0.1.0"
4
+ schema = 1
5
+
6
+ [package.tools]
7
+ write = "deny"
8
+ read = "maybe"
@@ -0,0 +1,3 @@
1
+ {
2
+ "context": "package"
3
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "host": "claude",
3
+ "default": null,
4
+ "rules": [
5
+ {
6
+ "rule": {
7
+ "capability": "bash",
8
+ "pattern": null,
9
+ "action": "deny",
10
+ "origin": "profile"
11
+ },
12
+ "status": "known",
13
+ "native": [
14
+ "Bash"
15
+ ],
16
+ "native_tools": [
17
+ "Bash"
18
+ ],
19
+ "note": null,
20
+ "covered_by": null
21
+ },
22
+ {
23
+ "rule": {
24
+ "capability": "bash",
25
+ "pattern": null,
26
+ "action": "allow",
27
+ "origin": "profile"
28
+ },
29
+ "status": "known",
30
+ "native": [],
31
+ "native_tools": [],
32
+ "note": "a stricter rule controls the same native tool and wins (deny, then ask, then allow); this rule is left out",
33
+ "covered_by": {
34
+ "action": "deny",
35
+ "key": "bash"
36
+ }
37
+ }
38
+ ],
39
+ "allow": [],
40
+ "deny": [
41
+ "Bash"
42
+ ],
43
+ "ask": [],
44
+ "available": [
45
+ "Bash"
46
+ ]
47
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "host": "claude",
3
+ "rules": [
4
+ {
5
+ "capability": "shell",
6
+ "pattern": null,
7
+ "action": "deny"
8
+ },
9
+ {
10
+ "capability": "exec_command",
11
+ "pattern": null,
12
+ "action": "allow"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "host": "claude",
3
+ "default": "deny",
4
+ "rules": [
5
+ {
6
+ "rule": {
7
+ "capability": "*",
8
+ "pattern": null,
9
+ "action": "deny",
10
+ "origin": "profile"
11
+ },
12
+ "status": null,
13
+ "native": [],
14
+ "native_tools": [],
15
+ "note": null,
16
+ "covered_by": null
17
+ },
18
+ {
19
+ "rule": {
20
+ "capability": "bash",
21
+ "pattern": "git status *",
22
+ "action": "allow",
23
+ "origin": "profile"
24
+ },
25
+ "status": "known",
26
+ "native": [],
27
+ "native_tools": [],
28
+ "note": null,
29
+ "covered_by": {
30
+ "action": "deny",
31
+ "key": "bash"
32
+ }
33
+ },
34
+ {
35
+ "rule": {
36
+ "capability": "bash",
37
+ "pattern": null,
38
+ "action": "deny",
39
+ "origin": "profile"
40
+ },
41
+ "status": "known",
42
+ "native": [
43
+ "Bash"
44
+ ],
45
+ "native_tools": [
46
+ "Bash"
47
+ ],
48
+ "note": null,
49
+ "covered_by": null
50
+ }
51
+ ],
52
+ "allow": [],
53
+ "deny": [
54
+ "Bash"
55
+ ],
56
+ "ask": [],
57
+ "available": [
58
+ "Bash(git status *)"
59
+ ]
60
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "host": "claude",
3
+ "rules": [
4
+ {
5
+ "capability": "*",
6
+ "pattern": null,
7
+ "action": "deny"
8
+ },
9
+ {
10
+ "capability": "bash",
11
+ "pattern": "git status *",
12
+ "action": "allow"
13
+ },
14
+ {
15
+ "capability": "bash",
16
+ "pattern": null,
17
+ "action": "deny"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "host": "claude",
3
+ "default": null,
4
+ "rules": [
5
+ {
6
+ "rule": {
7
+ "capability": "edit",
8
+ "pattern": null,
9
+ "action": "deny",
10
+ "origin": "profile"
11
+ },
12
+ "status": "known",
13
+ "native": [
14
+ "Edit",
15
+ "Write",
16
+ "NotebookEdit"
17
+ ],
18
+ "native_tools": [
19
+ "Edit",
20
+ "Write",
21
+ "NotebookEdit"
22
+ ],
23
+ "note": null,
24
+ "covered_by": null
25
+ },
26
+ {
27
+ "rule": {
28
+ "capability": "write",
29
+ "pattern": null,
30
+ "action": "allow",
31
+ "origin": "profile"
32
+ },
33
+ "status": "known",
34
+ "native": [],
35
+ "native_tools": [],
36
+ "note": "a stricter rule controls the same native tool and wins (deny, then ask, then allow); this rule is left out",
37
+ "covered_by": {
38
+ "action": "deny",
39
+ "key": "edit"
40
+ }
41
+ }
42
+ ],
43
+ "allow": [],
44
+ "deny": [
45
+ "Edit",
46
+ "Write",
47
+ "NotebookEdit"
48
+ ],
49
+ "ask": [],
50
+ "available": [
51
+ "Write"
52
+ ]
53
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "host": "claude",
3
+ "rules": [
4
+ {
5
+ "capability": "edit",
6
+ "pattern": null,
7
+ "action": "deny"
8
+ },
9
+ {
10
+ "capability": "write",
11
+ "pattern": null,
12
+ "action": "allow"
13
+ }
14
+ ]
15
+ }