@meridian-flow/mars-schema 0.34.3 → 0.34.5
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 +2 -0
- package/fixtures/project/flow-closed-tool-set/expected.json +19 -7
- package/fixtures/project/flow-mcp-allow-no-allowlist/expected.json +58 -0
- package/fixtures/project/flow-mcp-allow-no-allowlist/request.json +7 -0
- package/fixtures/project/flow-mcp-allow-under-allowlist/expected.json +57 -0
- package/fixtures/project/flow-mcp-allow-under-allowlist/request.json +8 -0
- package/fixtures/project/flow-mcp-ask/expected.json +39 -0
- package/fixtures/project/flow-mcp-ask/request.json +6 -0
- package/fixtures/project/flow-mcp-ask-under-allowlist/expected.json +36 -0
- package/fixtures/project/flow-mcp-ask-under-allowlist/request.json +7 -0
- package/fixtures/project/flow-mcp-deny/expected.json +75 -0
- package/fixtures/project/flow-mcp-deny/request.json +8 -0
- package/fixtures/project/flow-mcp-wire-token/expected.json +56 -0
- package/fixtures/project/flow-mcp-wire-token/request.json +7 -0
- package/index.d.ts +7 -0
- 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
|
@@ -109,6 +109,8 @@ p.rules[0].status; // "known" | "absent" | "unknown" | "unscopable" | n
|
|
|
109
109
|
|
|
110
110
|
`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`.
|
|
111
111
|
|
|
112
|
+
On `meridian-flow`, `mcp(...)` rules and MCP wire tokens (`mcp__server__tool`) lower onto Flow's connection tools (`mcp_describe`, `mcp_call`, `mcp_run`), which take the server as an argument and cannot be scoped to one. An `mcp(...)` deny, whatever it names, is `known` and disallows all of them, which can be broader than written, the safe direction (the rule's `note` says it covers every server). An `ask` lands on all of them the same way. An `allow` or `ask` under an allow-list (a `*` rule that is not `allow`) is `known` with no native names and a `note` saying none is granted, because granting them would give every connection and not the one named; show the note as a warning. With no allow-list the tools are available anyway, so an `allow` is `known` and loses nothing.
|
|
113
|
+
|
|
112
114
|
### `prepare`, `inspect`, `normalize`
|
|
113
115
|
|
|
114
116
|
`prepare` is the single-root core. It classifies the root (`schema-1`, `schema-newer`, a foreign dialect, `marketplace`, `invalid` or `empty`), selects definitions, translates a foreign package, 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` 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 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). A translated 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. The findings that cost the author nothing are `info`: `manifest.version-missing`, `skill.name-invalid`, `skill.description-too-long` and `frontmatter.repaired`. The warning `skill.name-mismatch` no longer exists: a name that differs from the file or folder is `definition.name-mismatch` (`info`) in `check`, for every dialect. `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.
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"action": "allow",
|
|
36
36
|
"origin": "profile"
|
|
37
37
|
},
|
|
38
|
-
"status": "
|
|
38
|
+
"status": "known",
|
|
39
39
|
"native": [],
|
|
40
40
|
"native_tools": [],
|
|
41
|
-
"note":
|
|
41
|
+
"note": "Flow cannot scope a connection tool to one server or tool, so granting them would give every connection; none is given",
|
|
42
42
|
"covered_by": null
|
|
43
43
|
},
|
|
44
44
|
{
|
|
@@ -48,10 +48,18 @@
|
|
|
48
48
|
"action": "deny",
|
|
49
49
|
"origin": "profile"
|
|
50
50
|
},
|
|
51
|
-
"status": "
|
|
52
|
-
"native": [
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
"status": "known",
|
|
52
|
+
"native": [
|
|
53
|
+
"mcp_describe",
|
|
54
|
+
"mcp_call",
|
|
55
|
+
"mcp_run"
|
|
56
|
+
],
|
|
57
|
+
"native_tools": [
|
|
58
|
+
"mcp_describe",
|
|
59
|
+
"mcp_call",
|
|
60
|
+
"mcp_run"
|
|
61
|
+
],
|
|
62
|
+
"note": "Flow's connection tools are not scoped to one server or tool, so this rule disallows all of them, for every server",
|
|
55
63
|
"covered_by": null
|
|
56
64
|
},
|
|
57
65
|
{
|
|
@@ -69,7 +77,11 @@
|
|
|
69
77
|
}
|
|
70
78
|
],
|
|
71
79
|
"allow": [],
|
|
72
|
-
"deny": [
|
|
80
|
+
"deny": [
|
|
81
|
+
"mcp_describe",
|
|
82
|
+
"mcp_call",
|
|
83
|
+
"mcp_run"
|
|
84
|
+
],
|
|
73
85
|
"ask": [],
|
|
74
86
|
"available": []
|
|
75
87
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
3
|
+
"default": null,
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"rule": {
|
|
7
|
+
"capability": "read",
|
|
8
|
+
"pattern": null,
|
|
9
|
+
"action": "allow",
|
|
10
|
+
"origin": "profile"
|
|
11
|
+
},
|
|
12
|
+
"status": "known",
|
|
13
|
+
"native": [
|
|
14
|
+
"read"
|
|
15
|
+
],
|
|
16
|
+
"native_tools": [
|
|
17
|
+
"read"
|
|
18
|
+
],
|
|
19
|
+
"note": null,
|
|
20
|
+
"covered_by": null
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"rule": {
|
|
24
|
+
"capability": "mcp",
|
|
25
|
+
"pattern": "pubmed/search",
|
|
26
|
+
"action": "allow",
|
|
27
|
+
"origin": "profile"
|
|
28
|
+
},
|
|
29
|
+
"status": "known",
|
|
30
|
+
"native": [
|
|
31
|
+
"mcp_describe",
|
|
32
|
+
"mcp_call",
|
|
33
|
+
"mcp_run"
|
|
34
|
+
],
|
|
35
|
+
"native_tools": [
|
|
36
|
+
"mcp_describe",
|
|
37
|
+
"mcp_call",
|
|
38
|
+
"mcp_run"
|
|
39
|
+
],
|
|
40
|
+
"note": null,
|
|
41
|
+
"covered_by": null
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"allow": [
|
|
45
|
+
"read",
|
|
46
|
+
"mcp_describe",
|
|
47
|
+
"mcp_call",
|
|
48
|
+
"mcp_run"
|
|
49
|
+
],
|
|
50
|
+
"deny": [],
|
|
51
|
+
"ask": [],
|
|
52
|
+
"available": [
|
|
53
|
+
"read",
|
|
54
|
+
"mcp_describe",
|
|
55
|
+
"mcp_call",
|
|
56
|
+
"mcp_run"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
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": "read",
|
|
21
|
+
"pattern": null,
|
|
22
|
+
"action": "allow",
|
|
23
|
+
"origin": "profile"
|
|
24
|
+
},
|
|
25
|
+
"status": "known",
|
|
26
|
+
"native": [
|
|
27
|
+
"read"
|
|
28
|
+
],
|
|
29
|
+
"native_tools": [
|
|
30
|
+
"read"
|
|
31
|
+
],
|
|
32
|
+
"note": null,
|
|
33
|
+
"covered_by": null
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"rule": {
|
|
37
|
+
"capability": "mcp",
|
|
38
|
+
"pattern": "pubmed/*",
|
|
39
|
+
"action": "allow",
|
|
40
|
+
"origin": "profile"
|
|
41
|
+
},
|
|
42
|
+
"status": "known",
|
|
43
|
+
"native": [],
|
|
44
|
+
"native_tools": [],
|
|
45
|
+
"note": "Flow cannot scope a connection tool to one server or tool, so granting them would give every connection; none is given",
|
|
46
|
+
"covered_by": null
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"allow": [
|
|
50
|
+
"read"
|
|
51
|
+
],
|
|
52
|
+
"deny": [],
|
|
53
|
+
"ask": [],
|
|
54
|
+
"available": [
|
|
55
|
+
"read"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
3
|
+
"default": null,
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"rule": {
|
|
7
|
+
"capability": "mcp",
|
|
8
|
+
"pattern": "pubmed/*",
|
|
9
|
+
"action": "ask",
|
|
10
|
+
"origin": "profile"
|
|
11
|
+
},
|
|
12
|
+
"status": "known",
|
|
13
|
+
"native": [
|
|
14
|
+
"mcp_describe",
|
|
15
|
+
"mcp_call",
|
|
16
|
+
"mcp_run"
|
|
17
|
+
],
|
|
18
|
+
"native_tools": [
|
|
19
|
+
"mcp_describe",
|
|
20
|
+
"mcp_call",
|
|
21
|
+
"mcp_run"
|
|
22
|
+
],
|
|
23
|
+
"note": "Flow's connection tools are not scoped to one server or tool, so this rule asks before every connection tool, for every server",
|
|
24
|
+
"covered_by": null
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"allow": [],
|
|
28
|
+
"deny": [],
|
|
29
|
+
"ask": [
|
|
30
|
+
"mcp_describe",
|
|
31
|
+
"mcp_call",
|
|
32
|
+
"mcp_run"
|
|
33
|
+
],
|
|
34
|
+
"available": [
|
|
35
|
+
"mcp_describe",
|
|
36
|
+
"mcp_call",
|
|
37
|
+
"mcp_run"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
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": "mcp",
|
|
21
|
+
"pattern": "pubmed/*",
|
|
22
|
+
"action": "ask",
|
|
23
|
+
"origin": "profile"
|
|
24
|
+
},
|
|
25
|
+
"status": "known",
|
|
26
|
+
"native": [],
|
|
27
|
+
"native_tools": [],
|
|
28
|
+
"note": "Flow cannot scope a connection tool to one server or tool, so granting them would give every connection; none is given",
|
|
29
|
+
"covered_by": null
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"allow": [],
|
|
33
|
+
"deny": [],
|
|
34
|
+
"ask": [],
|
|
35
|
+
"available": []
|
|
36
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
3
|
+
"default": null,
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"rule": {
|
|
7
|
+
"capability": "mcp",
|
|
8
|
+
"pattern": "github/*",
|
|
9
|
+
"action": "deny",
|
|
10
|
+
"origin": "profile"
|
|
11
|
+
},
|
|
12
|
+
"status": "known",
|
|
13
|
+
"native": [
|
|
14
|
+
"mcp_describe",
|
|
15
|
+
"mcp_call",
|
|
16
|
+
"mcp_run"
|
|
17
|
+
],
|
|
18
|
+
"native_tools": [
|
|
19
|
+
"mcp_describe",
|
|
20
|
+
"mcp_call",
|
|
21
|
+
"mcp_run"
|
|
22
|
+
],
|
|
23
|
+
"note": "Flow's connection tools are not scoped to one server or tool, so this rule disallows all of them, for every server",
|
|
24
|
+
"covered_by": null
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"rule": {
|
|
28
|
+
"capability": "mcp",
|
|
29
|
+
"pattern": "pubmed/*",
|
|
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": "mcp(github/*)"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"rule": {
|
|
44
|
+
"capability": "read",
|
|
45
|
+
"pattern": null,
|
|
46
|
+
"action": "allow",
|
|
47
|
+
"origin": "profile"
|
|
48
|
+
},
|
|
49
|
+
"status": "known",
|
|
50
|
+
"native": [
|
|
51
|
+
"read"
|
|
52
|
+
],
|
|
53
|
+
"native_tools": [
|
|
54
|
+
"read"
|
|
55
|
+
],
|
|
56
|
+
"note": null,
|
|
57
|
+
"covered_by": null
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"allow": [
|
|
61
|
+
"read"
|
|
62
|
+
],
|
|
63
|
+
"deny": [
|
|
64
|
+
"mcp_describe",
|
|
65
|
+
"mcp_call",
|
|
66
|
+
"mcp_run"
|
|
67
|
+
],
|
|
68
|
+
"ask": [],
|
|
69
|
+
"available": [
|
|
70
|
+
"read",
|
|
71
|
+
"mcp_describe",
|
|
72
|
+
"mcp_call",
|
|
73
|
+
"mcp_run"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": "meridian-flow",
|
|
3
|
+
"default": null,
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"rule": {
|
|
7
|
+
"capability": "mcp__pubmed__search",
|
|
8
|
+
"pattern": null,
|
|
9
|
+
"action": "deny",
|
|
10
|
+
"origin": "profile"
|
|
11
|
+
},
|
|
12
|
+
"status": "known",
|
|
13
|
+
"native": [
|
|
14
|
+
"mcp_describe",
|
|
15
|
+
"mcp_call",
|
|
16
|
+
"mcp_run"
|
|
17
|
+
],
|
|
18
|
+
"native_tools": [
|
|
19
|
+
"mcp_describe",
|
|
20
|
+
"mcp_call",
|
|
21
|
+
"mcp_run"
|
|
22
|
+
],
|
|
23
|
+
"note": "Flow's connection tools are not scoped to one server or tool, so this rule disallows all of them, for every server",
|
|
24
|
+
"covered_by": null
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"rule": {
|
|
28
|
+
"capability": "mcp",
|
|
29
|
+
"pattern": "*/*",
|
|
30
|
+
"action": "deny",
|
|
31
|
+
"origin": "profile"
|
|
32
|
+
},
|
|
33
|
+
"status": "known",
|
|
34
|
+
"native": [
|
|
35
|
+
"mcp_describe",
|
|
36
|
+
"mcp_call",
|
|
37
|
+
"mcp_run"
|
|
38
|
+
],
|
|
39
|
+
"native_tools": [
|
|
40
|
+
"mcp_describe",
|
|
41
|
+
"mcp_call",
|
|
42
|
+
"mcp_run"
|
|
43
|
+
],
|
|
44
|
+
"note": "Flow's connection tools are not scoped to one server or tool, so this rule disallows all of them, for every server",
|
|
45
|
+
"covered_by": null
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"allow": [],
|
|
49
|
+
"deny": [
|
|
50
|
+
"mcp_describe",
|
|
51
|
+
"mcp_call",
|
|
52
|
+
"mcp_run"
|
|
53
|
+
],
|
|
54
|
+
"ask": [],
|
|
55
|
+
"available": []
|
|
56
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -266,6 +266,12 @@ export interface ProjectedRule {
|
|
|
266
266
|
* name it (the host has no switch for it, Mars has no row, or it is not a tool Mars knows),
|
|
267
267
|
* with the reason in `note`; `unscopable`: the rule has a pattern and the host's tool takes
|
|
268
268
|
* none. `null` for `*`, which names no tool.
|
|
269
|
+
*
|
|
270
|
+
* On `meridian-flow`, `mcp(...)` rules and MCP wire tokens lower onto the connection tools
|
|
271
|
+
* `mcp_describe`, `mcp_call` and `mcp_run`: a deny of any server or tool covers all of them
|
|
272
|
+
* (which can be broader than written), as does an ask with no allow-list; an allow with no
|
|
273
|
+
* allow-list loses nothing, and an allow or ask under an allow-list is `known` with no native
|
|
274
|
+
* names and a `note` saying none is granted, since granting them would give every connection.
|
|
269
275
|
*/
|
|
270
276
|
status: "known" | "absent" | "unknown" | "unscopable" | null;
|
|
271
277
|
/** The permission names the rule keeps. Empty for a gap, and when a stricter rule won every name. */
|
|
@@ -297,6 +303,7 @@ export interface ToolProjection {
|
|
|
297
303
|
* does for a harness. Throws `input.invalid` for an unknown host or a rule that does not parse.
|
|
298
304
|
* A consumer must refuse a rule whose `status` is `unscopable` or `unknown` rather than read only
|
|
299
305
|
* `allow`/`deny`/`ask`: an unscopable `read(src/**): deny` leaves `allow: ["read"]` granting every read.
|
|
306
|
+
* When a tool is in both `available` and `deny`, `deny` wins.
|
|
300
307
|
*/
|
|
301
308
|
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;
|
|
302
309
|
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|