@meridian-flow/mars-schema 0.20.7 → 0.22.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 (54) hide show
  1. package/README.md +4 -4
  2. package/fixtures/normalize/pre-v1-mars-permission/expected/mars-dep/agents/reader.md +1 -1
  3. package/fixtures/normalize/pre-v1-mars-permission/normalized.json +2 -2
  4. package/fixtures/prepare/pre-v1-old-host-namespaces/expected/agents/demo.md +15 -0
  5. package/fixtures/prepare/pre-v1-old-host-namespaces/expected/mars.toml +4 -0
  6. package/fixtures/prepare/pre-v1-old-host-namespaces/expected.json +123 -0
  7. package/fixtures/prepare/pre-v1-old-host-namespaces/input/agents/demo.md +15 -0
  8. package/fixtures/prepare/pre-v1-old-host-namespaces/input/mars.toml +3 -0
  9. package/fixtures/prepare/pre-v1-old-host-namespaces/request.json +3 -0
  10. package/fixtures/prepare/schema-1-both-host-namespaces/expected/agents/demo.md +14 -0
  11. package/fixtures/prepare/schema-1-both-host-namespaces/expected.json +148 -0
  12. package/fixtures/prepare/schema-1-both-host-namespaces/input/agents/demo.md +20 -0
  13. package/fixtures/prepare/schema-1-both-host-namespaces/input/mars.toml +4 -0
  14. package/fixtures/prepare/schema-1-both-host-namespaces/request.json +4 -0
  15. package/fixtures/prepare/schema-1-meridian-keys/expected/agents/demo.md +12 -0
  16. package/fixtures/prepare/schema-1-meridian-keys/expected.json +120 -0
  17. package/fixtures/prepare/schema-1-meridian-keys/input/agents/demo.md +11 -0
  18. package/fixtures/prepare/schema-1-meridian-keys/input/mars.toml +4 -0
  19. package/fixtures/prepare/schema-1-meridian-keys/request.json +4 -0
  20. package/fixtures/prepare/schema-1-old-host-namespaces/expected/agents/demo.md +13 -0
  21. package/fixtures/prepare/schema-1-old-host-namespaces/expected.json +118 -0
  22. package/fixtures/prepare/schema-1-old-host-namespaces/input/agents/demo.md +13 -0
  23. package/fixtures/prepare/schema-1-old-host-namespaces/input/mars.toml +4 -0
  24. package/fixtures/prepare/schema-1-old-host-namespaces/request.json +4 -0
  25. package/fixtures/read/agent-harness-overrides/agent.md +1 -1
  26. package/fixtures/read/agent-harness-overrides/expected.json +2 -2
  27. package/fixtures/read/agent-integer-range/agent.md +1 -1
  28. package/fixtures/read/agent-integer-range/expected.json +2 -2
  29. package/fixtures/read/agent-meridian-namespace/agent.md +8 -0
  30. package/fixtures/read/agent-meridian-namespace/expected.json +53 -0
  31. package/fixtures/read/agent-nested-order/agent.md +1 -1
  32. package/fixtures/read/agent-nested-order/expected.json +2 -2
  33. package/fixtures/read/agent-proto-key/agent.md +1 -1
  34. package/fixtures/read/agent-proto-key/expected.json +2 -2
  35. package/fixtures/read/agent-removed-host-namespaces/agent.md +7 -0
  36. package/fixtures/read/agent-removed-host-namespaces/expected.json +59 -0
  37. package/fixtures/read/agent-removed-meridian-keys/agent.md +4 -0
  38. package/fixtures/read/agent-removed-meridian-keys/expected.json +56 -0
  39. package/fixtures/read/agent-removed-permission/expected.json +1 -1
  40. package/fixtures/upgrade/agent-claude-keys-conflict/fully-rewritten.txt +2 -0
  41. package/fixtures/upgrade/agent-meridian-keys/expected-diagnostics.json +1 -0
  42. package/fixtures/upgrade/agent-meridian-keys/expected.md +11 -0
  43. package/fixtures/upgrade/agent-meridian-keys/input.md +10 -0
  44. package/fixtures/upgrade/agent-meridian-keys/kind.txt +1 -0
  45. package/fixtures/upgrade/agent-permission/expected.md +1 -1
  46. package/fixtures/vocabulary/expected.json +1 -1
  47. package/index.d.ts +8 -2
  48. package/node/mars_schema_wasm.d.ts +4 -3
  49. package/node/mars_schema_wasm.js +4 -3
  50. package/node/mars_schema_wasm_bg.wasm +0 -0
  51. package/package.json +1 -1
  52. package/web/mars_schema_wasm.d.ts +4 -3
  53. package/web/mars_schema_wasm.js +4 -3
  54. package/web/mars_schema_wasm_bg.wasm +0 -0
package/README.md CHANGED
@@ -29,7 +29,7 @@ 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?})` | Reads one root held in memory: classifies it, upgrades or translates it, and returns each definition's normalized bytes, typed reading and change record. |
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. |
33
33
  | `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
34
  | `normalize({tree, source?, hint?, selection?})` | Turns a selection into schema v1 packages with a generated `mars.toml` and provenance. |
35
35
  | `version()` | The version of the schema crate this build was made from. |
@@ -84,10 +84,10 @@ After you splice, read the result again and check that each key's value equals t
84
84
  const { capabilities, natives } = vocabulary();
85
85
  capabilities; // [{ name: "bash", aliases: ["shell", ...] }, ...]
86
86
  natives.claude.edit; // { kind: "scoped-tools", unscoped: [...], scoped: [...], note }
87
- natives.flow.work; // { kind: "tools", tools: ["work"] }
87
+ natives["meridian-flow"].work; // { kind: "tools", tools: ["work"] }
88
88
  ```
89
89
 
90
- `natives` has one table for each of `claude`, `codex`, `opencode`, `pi`, `cursor` and `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).
90
+ `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).
91
91
 
92
92
  ### `prepare`, `inspect`, `normalize`
93
93
 
@@ -106,7 +106,7 @@ Marketplace fields are untrusted input: a marketplace is third-party text, and a
106
106
  | `read` | the file, `expected.json` | the reading of one definition or manifest |
107
107
  | `emit` | `value.json`, `expected.txt` | the YAML for one value |
108
108
  | `upgrade` | `input.md`, `expected.md`, `expected-diagnostics.json` | the pre-v1 to v1 rewrite |
109
- | `prepare` | `input/`, `request.json`, `expected.json` | classifying and reading one root |
109
+ | `prepare` | `input/`, `request.json`, `expected.json` | classifying and reading one root, and with `"migrate": true` the repair `mars migrate` writes back |
110
110
  | `normalize` | `input/`, `request.json`, `inspection.json`, `normalized.json`, `expected/` | reading a foreign repository |
111
111
  | `vocabulary` | `expected.json` | the capabilities, aliases and native tools |
112
112
 
@@ -6,7 +6,7 @@ tools:
6
6
  Read: allow
7
7
  Grep: allow
8
8
  harness-overrides:
9
- flow:
9
+ meridian-flow:
10
10
  permission: read
11
11
  ---
12
12
  Read the code.
@@ -74,7 +74,7 @@
74
74
  [
75
75
  "harness-overrides",
76
76
  {
77
- "flow": {
77
+ "meridian-flow": {
78
78
  "permission": "read"
79
79
  }
80
80
  }
@@ -117,7 +117,7 @@
117
117
  }
118
118
  ],
119
119
  "harness-overrides": {
120
- "flow": {
120
+ "meridian-flow": {
121
121
  "permission": "read"
122
122
  }
123
123
  },
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ meridian-flow:
6
+ other: 1
7
+ permission: read
8
+ claude:
9
+ x: 1
10
+ meridian-cli:
11
+ capabilities:
12
+ spawn: true
13
+ resident-rearm-budget: 4
14
+ ---
15
+ body
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,123 @@
1
+ {
2
+ "classification": {
3
+ "kind": "mars-legacy"
4
+ },
5
+ "manifest": {
6
+ "source_path": "mars.toml",
7
+ "output_path": "mars.toml",
8
+ "reading": {
9
+ "frontmatter": [
10
+ [
11
+ "name",
12
+ "demo"
13
+ ],
14
+ [
15
+ "version",
16
+ "1.0.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ]
22
+ ],
23
+ "fields": {
24
+ "name": "demo",
25
+ "version": "1.0.0",
26
+ "schema": 1
27
+ },
28
+ "body": null,
29
+ "diagnostics": []
30
+ },
31
+ "change": {
32
+ "kind": "edited",
33
+ "paths": [
34
+ [
35
+ "package",
36
+ "schema"
37
+ ]
38
+ ]
39
+ }
40
+ },
41
+ "definitions": [
42
+ {
43
+ "kind": "agent",
44
+ "slug": "demo",
45
+ "source_path": "agents/demo.md",
46
+ "output_path": "agents/demo.md",
47
+ "reading": {
48
+ "frontmatter": [
49
+ [
50
+ "name",
51
+ "demo"
52
+ ],
53
+ [
54
+ "description",
55
+ "Demo"
56
+ ],
57
+ [
58
+ "harness-overrides",
59
+ {
60
+ "meridian-flow": {
61
+ "other": 1,
62
+ "permission": "read"
63
+ },
64
+ "claude": {
65
+ "x": 1
66
+ },
67
+ "meridian-cli": {
68
+ "capabilities": {
69
+ "spawn": true
70
+ },
71
+ "resident-rearm-budget": 4
72
+ }
73
+ }
74
+ ]
75
+ ],
76
+ "fields": {
77
+ "name": "demo",
78
+ "description": "Demo",
79
+ "harness": null,
80
+ "model": null,
81
+ "mode": null,
82
+ "model-invocable": true,
83
+ "user-invocable": true,
84
+ "approval": null,
85
+ "sandbox": null,
86
+ "network": null,
87
+ "network-allow": [],
88
+ "network-deny": [],
89
+ "effort": null,
90
+ "skills": {
91
+ "load": [],
92
+ "available": []
93
+ },
94
+ "subagents": [],
95
+ "tools": [],
96
+ "harness-overrides": {
97
+ "meridian-flow": {
98
+ "other": 1,
99
+ "permission": "read"
100
+ },
101
+ "claude": {
102
+ "x": 1
103
+ },
104
+ "meridian-cli": {
105
+ "capabilities": {
106
+ "spawn": true
107
+ },
108
+ "resident-rearm-budget": 4
109
+ }
110
+ },
111
+ "model-policies": []
112
+ },
113
+ "body": "body\n",
114
+ "diagnostics": []
115
+ },
116
+ "change": {
117
+ "kind": "fully-rewritten"
118
+ }
119
+ }
120
+ ],
121
+ "payload": [],
122
+ "diagnostics": {}
123
+ }
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ permission: read
5
+ resident-rearm-budget: 4
6
+ harness-overrides:
7
+ flow:
8
+ other: 1 # kept
9
+ claude:
10
+ x: 1 # kept
11
+ meridian:
12
+ capabilities:
13
+ spawn: true
14
+ ---
15
+ body
@@ -0,0 +1,3 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
@@ -0,0 +1,3 @@
1
+ {
2
+ "context": "package"
3
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ meridian-flow:
6
+ permission: edit
7
+ meridian-cli:
8
+ capabilities:
9
+ spawn: true
10
+ extra: true
11
+ other: false
12
+ resident-rearm-budget: 2
13
+ ---
14
+ body
@@ -0,0 +1,148 @@
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
+ "demo"
13
+ ],
14
+ [
15
+ "version",
16
+ "1.0.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ]
22
+ ],
23
+ "fields": {
24
+ "name": "demo",
25
+ "version": "1.0.0",
26
+ "schema": 1
27
+ },
28
+ "body": null,
29
+ "diagnostics": []
30
+ },
31
+ "change": {
32
+ "kind": "none"
33
+ }
34
+ },
35
+ "definitions": [
36
+ {
37
+ "kind": "agent",
38
+ "slug": "demo",
39
+ "source_path": "agents/demo.md",
40
+ "output_path": "agents/demo.md",
41
+ "reading": {
42
+ "frontmatter": [
43
+ [
44
+ "name",
45
+ "demo"
46
+ ],
47
+ [
48
+ "description",
49
+ "Demo"
50
+ ],
51
+ [
52
+ "harness-overrides",
53
+ {
54
+ "meridian-flow": {
55
+ "permission": "edit"
56
+ },
57
+ "meridian-cli": {
58
+ "capabilities": {
59
+ "spawn": true,
60
+ "extra": true,
61
+ "other": false
62
+ },
63
+ "resident-rearm-budget": 2
64
+ }
65
+ }
66
+ ]
67
+ ],
68
+ "fields": {
69
+ "name": "demo",
70
+ "description": "Demo",
71
+ "harness": null,
72
+ "model": null,
73
+ "mode": null,
74
+ "model-invocable": true,
75
+ "user-invocable": true,
76
+ "approval": null,
77
+ "sandbox": null,
78
+ "network": null,
79
+ "network-allow": [],
80
+ "network-deny": [],
81
+ "effort": null,
82
+ "skills": {
83
+ "load": [],
84
+ "available": []
85
+ },
86
+ "subagents": [],
87
+ "tools": [],
88
+ "harness-overrides": {
89
+ "meridian-flow": {
90
+ "permission": "edit"
91
+ },
92
+ "meridian-cli": {
93
+ "capabilities": {
94
+ "spawn": true,
95
+ "extra": true,
96
+ "other": false
97
+ },
98
+ "resident-rearm-budget": 2
99
+ }
100
+ },
101
+ "model-policies": []
102
+ },
103
+ "body": "body\n",
104
+ "diagnostics": []
105
+ },
106
+ "change": {
107
+ "kind": "fully-rewritten"
108
+ }
109
+ }
110
+ ],
111
+ "payload": [],
112
+ "diagnostics": {},
113
+ "changes": {
114
+ "agents/demo.md": [
115
+ {
116
+ "code": "field.restriction-lost",
117
+ "severity": "warning",
118
+ "path": [
119
+ "harness-overrides",
120
+ "flow",
121
+ "permission"
122
+ ],
123
+ "message": "agent `demo` lost the restriction `permission`: it was dropped, because `harness-overrides.meridian-flow.permission` already sets a value, and an override written wins"
124
+ },
125
+ {
126
+ "code": "field.restriction-lost",
127
+ "severity": "warning",
128
+ "path": [
129
+ "harness-overrides",
130
+ "meridian",
131
+ "capabilities",
132
+ "spawn"
133
+ ],
134
+ "message": "agent `demo` lost the restriction `capabilities.spawn`: it was dropped, because `harness-overrides.meridian-cli.capabilities.spawn` already sets a value, and an override written wins"
135
+ },
136
+ {
137
+ "code": "field.removed",
138
+ "severity": "warning",
139
+ "path": [
140
+ "harness-overrides",
141
+ "meridian",
142
+ "resident-rearm-budget"
143
+ ],
144
+ "message": "dropped `harness-overrides.meridian.resident-rearm-budget`; `harness-overrides.meridian-cli.resident-rearm-budget` already sets it"
145
+ }
146
+ ]
147
+ }
148
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ meridian:
6
+ capabilities:
7
+ spawn: false
8
+ other: false
9
+ resident-rearm-budget: 4
10
+ meridian-cli:
11
+ capabilities:
12
+ spawn: true
13
+ extra: true
14
+ resident-rearm-budget: 2
15
+ flow:
16
+ permission: read
17
+ meridian-flow:
18
+ permission: edit
19
+ ---
20
+ body
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,4 @@
1
+ {
2
+ "context": "package",
3
+ "migrate": true
4
+ }
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ meridian-flow:
6
+ permission: read
7
+ meridian-cli:
8
+ resident-rearm-budget: 3
9
+ capabilities:
10
+ spawn: true
11
+ ---
12
+ body
@@ -0,0 +1,120 @@
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
+ "demo"
13
+ ],
14
+ [
15
+ "version",
16
+ "1.0.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ]
22
+ ],
23
+ "fields": {
24
+ "name": "demo",
25
+ "version": "1.0.0",
26
+ "schema": 1
27
+ },
28
+ "body": null,
29
+ "diagnostics": []
30
+ },
31
+ "change": {
32
+ "kind": "none"
33
+ }
34
+ },
35
+ "definitions": [
36
+ {
37
+ "kind": "agent",
38
+ "slug": "demo",
39
+ "source_path": "agents/demo.md",
40
+ "output_path": "agents/demo.md",
41
+ "reading": {
42
+ "frontmatter": [
43
+ [
44
+ "name",
45
+ "demo"
46
+ ],
47
+ [
48
+ "description",
49
+ "Demo"
50
+ ],
51
+ [
52
+ "harness-overrides",
53
+ {
54
+ "meridian-flow": {
55
+ "permission": "read"
56
+ },
57
+ "meridian-cli": {
58
+ "resident-rearm-budget": 3,
59
+ "capabilities": {
60
+ "spawn": true
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ ],
66
+ "fields": {
67
+ "name": "demo",
68
+ "description": "Demo",
69
+ "harness": null,
70
+ "model": null,
71
+ "mode": null,
72
+ "model-invocable": true,
73
+ "user-invocable": true,
74
+ "approval": null,
75
+ "sandbox": null,
76
+ "network": null,
77
+ "network-allow": [],
78
+ "network-deny": [],
79
+ "effort": null,
80
+ "skills": {
81
+ "load": [],
82
+ "available": []
83
+ },
84
+ "subagents": [],
85
+ "tools": [],
86
+ "harness-overrides": {
87
+ "meridian-flow": {
88
+ "permission": "read"
89
+ },
90
+ "meridian-cli": {
91
+ "resident-rearm-budget": 3,
92
+ "capabilities": {
93
+ "spawn": true
94
+ }
95
+ }
96
+ },
97
+ "model-policies": []
98
+ },
99
+ "body": "body\n",
100
+ "diagnostics": []
101
+ },
102
+ "change": {
103
+ "kind": "edited",
104
+ "paths": [
105
+ [
106
+ "harness-overrides"
107
+ ],
108
+ [
109
+ "meridian-capabilities"
110
+ ],
111
+ [
112
+ "resident-rearm-budget"
113
+ ]
114
+ ]
115
+ }
116
+ }
117
+ ],
118
+ "payload": [],
119
+ "diagnostics": {}
120
+ }
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ resident-rearm-budget: 3
5
+ meridian-capabilities:
6
+ spawn: true
7
+ harness-overrides:
8
+ meridian-flow:
9
+ permission: read
10
+ ---
11
+ body
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,4 @@
1
+ {
2
+ "context": "package",
3
+ "migrate": true
4
+ }
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ meridian-flow: # host block
6
+ permission: read
7
+ claude:
8
+ x: 1 # kept
9
+ meridian-cli:
10
+ capabilities:
11
+ spawn: true
12
+ ---
13
+ body
@@ -0,0 +1,118 @@
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
+ "demo"
13
+ ],
14
+ [
15
+ "version",
16
+ "1.0.0"
17
+ ],
18
+ [
19
+ "schema",
20
+ 1
21
+ ]
22
+ ],
23
+ "fields": {
24
+ "name": "demo",
25
+ "version": "1.0.0",
26
+ "schema": 1
27
+ },
28
+ "body": null,
29
+ "diagnostics": []
30
+ },
31
+ "change": {
32
+ "kind": "none"
33
+ }
34
+ },
35
+ "definitions": [
36
+ {
37
+ "kind": "agent",
38
+ "slug": "demo",
39
+ "source_path": "agents/demo.md",
40
+ "output_path": "agents/demo.md",
41
+ "reading": {
42
+ "frontmatter": [
43
+ [
44
+ "name",
45
+ "demo"
46
+ ],
47
+ [
48
+ "description",
49
+ "Demo"
50
+ ],
51
+ [
52
+ "harness-overrides",
53
+ {
54
+ "meridian-flow": {
55
+ "permission": "read"
56
+ },
57
+ "claude": {
58
+ "x": 1
59
+ },
60
+ "meridian-cli": {
61
+ "capabilities": {
62
+ "spawn": true
63
+ }
64
+ }
65
+ }
66
+ ]
67
+ ],
68
+ "fields": {
69
+ "name": "demo",
70
+ "description": "Demo",
71
+ "harness": null,
72
+ "model": null,
73
+ "mode": null,
74
+ "model-invocable": true,
75
+ "user-invocable": true,
76
+ "approval": null,
77
+ "sandbox": null,
78
+ "network": null,
79
+ "network-allow": [],
80
+ "network-deny": [],
81
+ "effort": null,
82
+ "skills": {
83
+ "load": [],
84
+ "available": []
85
+ },
86
+ "subagents": [],
87
+ "tools": [],
88
+ "harness-overrides": {
89
+ "meridian-flow": {
90
+ "permission": "read"
91
+ },
92
+ "claude": {
93
+ "x": 1
94
+ },
95
+ "meridian-cli": {
96
+ "capabilities": {
97
+ "spawn": true
98
+ }
99
+ }
100
+ },
101
+ "model-policies": []
102
+ },
103
+ "body": "body\n",
104
+ "diagnostics": []
105
+ },
106
+ "change": {
107
+ "kind": "edited",
108
+ "paths": [
109
+ [
110
+ "harness-overrides"
111
+ ]
112
+ ]
113
+ }
114
+ }
115
+ ],
116
+ "payload": [],
117
+ "diagnostics": {}
118
+ }
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ flow: # host block
6
+ permission: read
7
+ claude:
8
+ x: 1 # kept
9
+ meridian:
10
+ capabilities:
11
+ spawn: true
12
+ ---
13
+ body
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,4 @@
1
+ {
2
+ "context": "package",
3
+ "migrate": true
4
+ }
@@ -1,4 +1,4 @@
1
1
  ---
2
- harness-overrides: {flow: {permission: read}}
2
+ harness-overrides: {meridian-flow: {permission: read}}
3
3
  ---
4
4
  body
@@ -3,7 +3,7 @@
3
3
  [
4
4
  "harness-overrides",
5
5
  {
6
- "flow": {
6
+ "meridian-flow": {
7
7
  "permission": "read"
8
8
  }
9
9
  }
@@ -30,7 +30,7 @@
30
30
  "subagents": [],
31
31
  "tools": [],
32
32
  "harness-overrides": {
33
- "flow": {
33
+ "meridian-flow": {
34
34
  "permission": "read"
35
35
  }
36
36
  },
@@ -2,7 +2,7 @@
2
2
  x-fits: 9007199254740991
3
3
  x-big: 9007199254740993
4
4
  harness-overrides:
5
- flow:
5
+ meridian-flow:
6
6
  big: 12345678901234567890
7
7
  ---
8
8
  body
@@ -51,10 +51,10 @@
51
51
  "severity": "warning",
52
52
  "path": [
53
53
  "harness-overrides",
54
- "flow",
54
+ "meridian-flow",
55
55
  "big"
56
56
  ],
57
- "message": "agent field `harness-overrides.flow.big` has invalid value `12345678901234567890`; allowed: integer within ±(2^53 − 1)"
57
+ "message": "agent field `harness-overrides.meridian-flow.big` has invalid value `12345678901234567890`; allowed: integer within ±(2^53 − 1)"
58
58
  },
59
59
  {
60
60
  "code": "yaml.non-json-value",
@@ -0,0 +1,8 @@
1
+ ---
2
+ harness-overrides:
3
+ meridian-flow: {permission: read}
4
+ meridian-cli:
5
+ resident-rearm-budget: 3
6
+ capabilities: {spawn: true}
7
+ ---
8
+ body
@@ -0,0 +1,53 @@
1
+ {
2
+ "frontmatter": [
3
+ [
4
+ "harness-overrides",
5
+ {
6
+ "meridian-flow": {
7
+ "permission": "read"
8
+ },
9
+ "meridian-cli": {
10
+ "resident-rearm-budget": 3,
11
+ "capabilities": {
12
+ "spawn": true
13
+ }
14
+ }
15
+ }
16
+ ]
17
+ ],
18
+ "fields": {
19
+ "name": null,
20
+ "description": null,
21
+ "harness": null,
22
+ "model": null,
23
+ "mode": null,
24
+ "model-invocable": true,
25
+ "user-invocable": true,
26
+ "approval": null,
27
+ "sandbox": null,
28
+ "network": null,
29
+ "network-allow": [],
30
+ "network-deny": [],
31
+ "effort": null,
32
+ "skills": {
33
+ "load": [],
34
+ "available": []
35
+ },
36
+ "subagents": [],
37
+ "tools": [],
38
+ "harness-overrides": {
39
+ "meridian-flow": {
40
+ "permission": "read"
41
+ },
42
+ "meridian-cli": {
43
+ "resident-rearm-budget": 3,
44
+ "capabilities": {
45
+ "spawn": true
46
+ }
47
+ }
48
+ },
49
+ "model-policies": []
50
+ },
51
+ "body": "body\n",
52
+ "diagnostics": []
53
+ }
@@ -5,7 +5,7 @@ tools:
5
5
  "*": deny
6
6
  bash: ask
7
7
  harness-overrides:
8
- flow:
8
+ meridian-flow:
9
9
  zeta: {b: 1, a: 2}
10
10
  alpha: [{m: 1, k: 2}]
11
11
  claude:
@@ -15,7 +15,7 @@
15
15
  [
16
16
  "harness-overrides",
17
17
  {
18
- "flow": {
18
+ "meridian-flow": {
19
19
  "zeta": {
20
20
  "b": 1,
21
21
  "a": 2
@@ -77,7 +77,7 @@
77
77
  }
78
78
  ],
79
79
  "harness-overrides": {
80
- "flow": {
80
+ "meridian-flow": {
81
81
  "zeta": {
82
82
  "b": 1,
83
83
  "a": 2
@@ -3,7 +3,7 @@ x-u:
3
3
  __proto__: {polluted: 1}
4
4
  keep: 1
5
5
  harness-overrides:
6
- flow:
6
+ meridian-flow:
7
7
  __proto__: x
8
8
  ok: y
9
9
  ---
@@ -21,7 +21,7 @@
21
21
  "subagents": [],
22
22
  "tools": [],
23
23
  "harness-overrides": {
24
- "flow": {
24
+ "meridian-flow": {
25
25
  "ok": "y"
26
26
  }
27
27
  },
@@ -42,7 +42,7 @@
42
42
  "severity": "error",
43
43
  "path": [
44
44
  "harness-overrides",
45
- "flow",
45
+ "meridian-flow",
46
46
  "__proto__"
47
47
  ],
48
48
  "message": "key `__proto__` cannot be held as a plain property by JavaScript"
@@ -0,0 +1,7 @@
1
+ ---
2
+ harness-overrides:
3
+ flow: {permission: read}
4
+ meridian:
5
+ resident-rearm-budget: 3
6
+ ---
7
+ body
@@ -0,0 +1,59 @@
1
+ {
2
+ "frontmatter": [
3
+ [
4
+ "harness-overrides",
5
+ {
6
+ "flow": {
7
+ "permission": "read"
8
+ },
9
+ "meridian": {
10
+ "resident-rearm-budget": 3
11
+ }
12
+ }
13
+ ]
14
+ ],
15
+ "fields": {
16
+ "name": null,
17
+ "description": null,
18
+ "harness": null,
19
+ "model": null,
20
+ "mode": null,
21
+ "model-invocable": true,
22
+ "user-invocable": true,
23
+ "approval": null,
24
+ "sandbox": null,
25
+ "network": null,
26
+ "network-allow": [],
27
+ "network-deny": [],
28
+ "effort": null,
29
+ "skills": {
30
+ "load": [],
31
+ "available": []
32
+ },
33
+ "subagents": [],
34
+ "tools": [],
35
+ "harness-overrides": {},
36
+ "model-policies": []
37
+ },
38
+ "body": "body\n",
39
+ "diagnostics": [
40
+ {
41
+ "code": "field.removed",
42
+ "severity": "error",
43
+ "path": [
44
+ "harness-overrides",
45
+ "flow"
46
+ ],
47
+ "message": "`harness-overrides.flow` was renamed; use `harness-overrides.meridian-flow`"
48
+ },
49
+ {
50
+ "code": "field.removed",
51
+ "severity": "error",
52
+ "path": [
53
+ "harness-overrides",
54
+ "meridian"
55
+ ],
56
+ "message": "`harness-overrides.meridian` was renamed; use `harness-overrides.meridian-cli`"
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ resident-rearm-budget: 3
3
+ meridian-capabilities: {spawn: true}
4
+ ---
@@ -0,0 +1,56 @@
1
+ {
2
+ "frontmatter": [
3
+ [
4
+ "resident-rearm-budget",
5
+ 3
6
+ ],
7
+ [
8
+ "meridian-capabilities",
9
+ {
10
+ "spawn": true
11
+ }
12
+ ]
13
+ ],
14
+ "fields": {
15
+ "name": null,
16
+ "description": null,
17
+ "harness": null,
18
+ "model": null,
19
+ "mode": null,
20
+ "model-invocable": true,
21
+ "user-invocable": true,
22
+ "approval": null,
23
+ "sandbox": null,
24
+ "network": null,
25
+ "network-allow": [],
26
+ "network-deny": [],
27
+ "effort": null,
28
+ "skills": {
29
+ "load": [],
30
+ "available": []
31
+ },
32
+ "subagents": [],
33
+ "tools": [],
34
+ "harness-overrides": {},
35
+ "model-policies": []
36
+ },
37
+ "body": "",
38
+ "diagnostics": [
39
+ {
40
+ "code": "field.removed",
41
+ "severity": "error",
42
+ "path": [
43
+ "resident-rearm-budget"
44
+ ],
45
+ "message": "`resident-rearm-budget` was removed; move it under `harness-overrides.meridian-cli.resident-rearm-budget`"
46
+ },
47
+ {
48
+ "code": "field.removed",
49
+ "severity": "error",
50
+ "path": [
51
+ "meridian-capabilities"
52
+ ],
53
+ "message": "`meridian-capabilities` was removed; move it under `harness-overrides.meridian-cli.capabilities`"
54
+ }
55
+ ]
56
+ }
@@ -36,7 +36,7 @@
36
36
  "path": [
37
37
  "permission"
38
38
  ],
39
- "message": "`permission` was removed; move it under `harness-overrides.flow.permission`"
39
+ "message": "`permission` was removed; move it under `harness-overrides.meridian-flow.permission`"
40
40
  }
41
41
  ]
42
42
  }
@@ -0,0 +1,2 @@
1
+ The `claude` entry itself changes, so the `harness-overrides` block cannot be grown
2
+ in place: it is re-rendered, and what was written inside it is lost and reported.
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ claude:
6
+ model: opus
7
+ meridian-cli:
8
+ resident-rearm-budget: 3
9
+ capabilities:
10
+ spawn: true
11
+ ---
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: demo
3
+ meridian-capabilities:
4
+ spawn: true
5
+ description: Demo
6
+ resident-rearm-budget: 3
7
+ harness-overrides:
8
+ claude:
9
+ model: opus
10
+ ---
@@ -3,6 +3,6 @@ name: demo
3
3
  harness-overrides:
4
4
  claude:
5
5
  model: opus
6
- flow:
6
+ meridian-flow:
7
7
  permission: edit
8
8
  ---
@@ -609,7 +609,7 @@
609
609
  ]
610
610
  }
611
611
  },
612
- "flow": {
612
+ "meridian-flow": {
613
613
  "agent": {
614
614
  "kind": "tools",
615
615
  "tools": [
package/index.d.ts CHANGED
@@ -90,7 +90,7 @@ export interface AgentFields {
90
90
  skills: { load: string[]; available: string[] };
91
91
  subagents: string[];
92
92
  tools: ToolRule[];
93
- /** Per-namespace passthrough blocks; `flow` is the consumer namespace. */
93
+ /** Per-namespace passthrough blocks; `meridian-flow` and `meridian-cli` are the consumer namespaces. */
94
94
  "harness-overrides": { [namespace: string]: { [key: string]: JsonValue } };
95
95
  "model-policies": ModelPolicyRule[];
96
96
  }
@@ -177,7 +177,7 @@ export type NativeEntry =
177
177
 
178
178
  export interface Vocabulary {
179
179
  capabilities: { name: string; aliases: string[] }[];
180
- /** Per host (`claude`, `codex`, `opencode`, `pi`, `cursor`, `flow`): capability → native tools. */
180
+ /** Per host (`claude`, `codex`, `opencode`, `pi`, `cursor`, `meridian-flow`): capability → native tools. */
181
181
  natives: { [host: string]: { [capability: string]: NativeEntry } };
182
182
  }
183
183
 
@@ -272,6 +272,12 @@ export function prepare(input: {
272
272
  files: Map<string, Uint8Array>;
273
273
  context?: "package" | "authored-local" | "project";
274
274
  declaredDialect?: Dialect;
275
+ /**
276
+ * `migrate` adds `mars migrate`'s repair: a removed Agent key whose replacement is a
277
+ * `harness-overrides` key moves there. A reader leaves it off, because an authored schema 1
278
+ * file is read exactly as written.
279
+ */
280
+ migrate?: boolean;
275
281
  }): Prepared;
276
282
 
277
283
  export type Tree = Map<string, Uint8Array>;
@@ -20,9 +20,10 @@ export function inspect(input: any): any;
20
20
  export function normalize(input: any): any;
21
21
 
22
22
  /**
23
- * Prepare one root from `{files: Map<path, Uint8Array>, context?, declaredDialect?}`. A supported
24
- * export in its own right: `normalize` is this plus a selection, a generated manifest and
25
- * provenance. An unrecognized `context` or `declaredDialect` throws.
23
+ * Prepare one root from
24
+ * `{files: Map<path, Uint8Array>, context?, declaredDialect?, migrate?}`. A supported export in
25
+ * its own right: `normalize` is this plus a selection, a generated manifest and provenance. An
26
+ * unrecognized `context` or `declaredDialect` throws.
26
27
  */
27
28
  export function prepare(input: any): any;
28
29
 
@@ -80,9 +80,10 @@ function normalize(input) {
80
80
  exports.normalize = normalize;
81
81
 
82
82
  /**
83
- * Prepare one root from `{files: Map<path, Uint8Array>, context?, declaredDialect?}`. A supported
84
- * export in its own right: `normalize` is this plus a selection, a generated manifest and
85
- * provenance. An unrecognized `context` or `declaredDialect` throws.
83
+ * Prepare one root from
84
+ * `{files: Map<path, Uint8Array>, context?, declaredDialect?, migrate?}`. A supported export in
85
+ * its own right: `normalize` is this plus a selection, a generated manifest and provenance. An
86
+ * unrecognized `context` or `declaredDialect` throws.
86
87
  * @param {any} input
87
88
  * @returns {any}
88
89
  */
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridian-flow/mars-schema",
3
- "version": "0.20.7",
3
+ "version": "0.22.0",
4
4
  "description": "Mars agent schema reader and lossless editor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,9 +20,10 @@ export function inspect(input: any): any;
20
20
  export function normalize(input: any): any;
21
21
 
22
22
  /**
23
- * Prepare one root from `{files: Map<path, Uint8Array>, context?, declaredDialect?}`. A supported
24
- * export in its own right: `normalize` is this plus a selection, a generated manifest and
25
- * provenance. An unrecognized `context` or `declaredDialect` throws.
23
+ * Prepare one root from
24
+ * `{files: Map<path, Uint8Array>, context?, declaredDialect?, migrate?}`. A supported export in
25
+ * its own right: `normalize` is this plus a selection, a generated manifest and provenance. An
26
+ * unrecognized `context` or `declaredDialect` throws.
26
27
  */
27
28
  export function prepare(input: any): any;
28
29
 
@@ -77,9 +77,10 @@ export function normalize(input) {
77
77
  }
78
78
 
79
79
  /**
80
- * Prepare one root from `{files: Map<path, Uint8Array>, context?, declaredDialect?}`. A supported
81
- * export in its own right: `normalize` is this plus a selection, a generated manifest and
82
- * provenance. An unrecognized `context` or `declaredDialect` throws.
80
+ * Prepare one root from
81
+ * `{files: Map<path, Uint8Array>, context?, declaredDialect?, migrate?}`. A supported export in
82
+ * its own right: `normalize` is this plus a selection, a generated manifest and provenance. An
83
+ * unrecognized `context` or `declaredDialect` throws.
83
84
  * @param {any} input
84
85
  * @returns {any}
85
86
  */
Binary file