@meridian-flow/mars-schema 0.32.0 → 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.
- package/README.md +3 -3
- package/fixtures/prepare/package-tools/expected.json +213 -0
- package/fixtures/prepare/package-tools/input/agents/a.md +7 -0
- package/fixtures/prepare/package-tools/input/agents/b.md +4 -0
- package/fixtures/prepare/package-tools/input/mars.toml +10 -0
- package/fixtures/prepare/package-tools/request.json +3 -0
- package/fixtures/prepare/package-tools-invalid/expected.json +112 -0
- package/fixtures/prepare/package-tools-invalid/input/agents/b.md +4 -0
- package/fixtures/prepare/package-tools-invalid/input/mars.toml +8 -0
- package/fixtures/prepare/package-tools-invalid/request.json +3 -0
- package/fixtures/project/key-with-pattern/expected.json +68 -0
- package/fixtures/project/key-with-pattern/request.json +8 -0
- package/index.d.ts +10 -4
- package/node/mars_schema_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/web/mars_schema_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -29,8 +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
|
-
| `project(rules, host)` | Lowers an Agent's tool rules 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. |
|
|
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. |
|
|
34
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. |
|
|
35
35
|
| `normalize({tree, source?, hint?, selection?})` | Turns a selection into schema v1 packages with a generated `mars.toml` and provenance. |
|
|
36
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). |
|
|
@@ -109,7 +109,7 @@ p.rules[0].status; // "known" | "absent" | "unknown" | "unscopable" | n
|
|
|
109
109
|
|
|
110
110
|
### `prepare`, `inspect`, `normalize`
|
|
111
111
|
|
|
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. `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.
|
|
113
113
|
|
|
114
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.
|
|
115
115
|
|
|
@@ -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,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,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "claude",
|
|
3
|
+
"default": null,
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"rule": {
|
|
7
|
+
"capability": "bash",
|
|
8
|
+
"pattern": "git *",
|
|
9
|
+
"action": "ask",
|
|
10
|
+
"origin": "profile"
|
|
11
|
+
},
|
|
12
|
+
"status": "known",
|
|
13
|
+
"native": [
|
|
14
|
+
"Bash(git *)"
|
|
15
|
+
],
|
|
16
|
+
"native_tools": [
|
|
17
|
+
"Bash"
|
|
18
|
+
],
|
|
19
|
+
"note": null,
|
|
20
|
+
"covered_by": null
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"rule": {
|
|
24
|
+
"capability": "bash",
|
|
25
|
+
"pattern": "git push *",
|
|
26
|
+
"action": "deny",
|
|
27
|
+
"origin": "profile"
|
|
28
|
+
},
|
|
29
|
+
"status": "known",
|
|
30
|
+
"native": [
|
|
31
|
+
"Bash(git push *)"
|
|
32
|
+
],
|
|
33
|
+
"native_tools": [
|
|
34
|
+
"Bash"
|
|
35
|
+
],
|
|
36
|
+
"note": null,
|
|
37
|
+
"covered_by": null
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"rule": {
|
|
41
|
+
"capability": "write",
|
|
42
|
+
"pattern": null,
|
|
43
|
+
"action": "deny",
|
|
44
|
+
"origin": "package"
|
|
45
|
+
},
|
|
46
|
+
"status": "known",
|
|
47
|
+
"native": [
|
|
48
|
+
"Write"
|
|
49
|
+
],
|
|
50
|
+
"native_tools": [
|
|
51
|
+
"Write"
|
|
52
|
+
],
|
|
53
|
+
"note": null,
|
|
54
|
+
"covered_by": null
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"allow": [],
|
|
58
|
+
"deny": [
|
|
59
|
+
"Bash(git push *)",
|
|
60
|
+
"Write"
|
|
61
|
+
],
|
|
62
|
+
"ask": [
|
|
63
|
+
"Bash(git *)"
|
|
64
|
+
],
|
|
65
|
+
"available": [
|
|
66
|
+
"Bash(git *)"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "claude",
|
|
3
|
+
"rules": [
|
|
4
|
+
{ "capability": "bash(git *)", "pattern": null, "action": "ask" },
|
|
5
|
+
{ "capability": "Bash(git push:*)", "pattern": null, "action": "deny" },
|
|
6
|
+
{ "capability": "write", "pattern": null, "action": "deny", "origin": "package" }
|
|
7
|
+
]
|
|
8
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -88,6 +88,12 @@ export interface ToolRule {
|
|
|
88
88
|
capability: string;
|
|
89
89
|
pattern: string | null;
|
|
90
90
|
action: "allow" | "deny" | "ask";
|
|
91
|
+
/**
|
|
92
|
+
* Where the rule came from: `"profile"` (the Agent's own `tools`) or `"package"` (the package's
|
|
93
|
+
* `[package.tools]`, added by `prepare` to an Agent that does not name the key). `read` of one
|
|
94
|
+
* file reports only `"profile"`; the launch bundle also has `"overlay"` and `"project"`.
|
|
95
|
+
*/
|
|
96
|
+
origin: "profile" | "package" | "overlay" | "project";
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
export interface ModelPolicyRule {
|
|
@@ -253,8 +259,8 @@ export type Host = Harness | "meridian-flow";
|
|
|
253
259
|
|
|
254
260
|
/** One rule's lowering on a host. */
|
|
255
261
|
export interface ProjectedRule {
|
|
256
|
-
/** The rule as given, in the shape `read` reports it
|
|
257
|
-
rule: ToolRule
|
|
262
|
+
/** The rule as given, in the shape `read` reports it. `origin` is the input's, `"profile"` when it gave none. */
|
|
263
|
+
rule: ToolRule;
|
|
258
264
|
/**
|
|
259
265
|
* `known`: Mars names the tool; `absent`: the host has no such tool; `unknown`: Mars cannot
|
|
260
266
|
* name it (the host has no switch for it, Mars has no row, or it is not a tool Mars knows),
|
|
@@ -287,12 +293,12 @@ export interface ToolProjection {
|
|
|
287
293
|
}
|
|
288
294
|
|
|
289
295
|
/**
|
|
290
|
-
* Lower tool rules (an Agent's `tools` as `
|
|
296
|
+
* Lower tool rules (an Agent's `tools` as `prepare` reports it) onto a host, the way `mars sync`
|
|
291
297
|
* does for a harness. Throws `input.invalid` for an unknown host or a rule that does not parse.
|
|
292
298
|
* A consumer must refuse a rule whose `status` is `unscopable` or `unknown` rather than read only
|
|
293
299
|
* `allow`/`deny`/`ask`: an unscopable `read(src/**): deny` leaves `allow: ["read"]` granting every read.
|
|
294
300
|
*/
|
|
295
|
-
export function project(rules: { capability: string; pattern
|
|
301
|
+
export function project(rules: { /** A capability, or a whole key such as `bash(git *)` or `Bash(git push:*)` when `pattern` is absent. */ capability: string; pattern?: string | null; action: "allow" | "deny" | "ask"; origin?: ToolRule["origin"] }[], host: Host): ToolProjection;
|
|
296
302
|
|
|
297
303
|
// ---------------------------------------------------------------------------------------
|
|
298
304
|
// prepare, inspect, normalize
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|