@meridian-flow/mars-schema 0.20.6 → 0.21.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.
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. |
@@ -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
 
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: demo
3
+ description: Demo
4
+ harness-overrides:
5
+ flow:
6
+ permission: read
7
+ meridian:
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
+ "flow": {
55
+ "permission": "read"
56
+ },
57
+ "meridian": {
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
+ "flow": {
88
+ "permission": "read"
89
+ },
90
+ "meridian": {
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
+ 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,8 @@
1
+ ---
2
+ harness-overrides:
3
+ flow: {permission: read}
4
+ meridian:
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
+ "flow": {
7
+ "permission": "read"
8
+ },
9
+ "meridian": {
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
+ "flow": {
40
+ "permission": "read"
41
+ },
42
+ "meridian": {
43
+ "resident-rearm-budget": 3,
44
+ "capabilities": {
45
+ "spawn": true
46
+ }
47
+ }
48
+ },
49
+ "model-policies": []
50
+ },
51
+ "body": "body\n",
52
+ "diagnostics": []
53
+ }
@@ -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.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.capabilities`"
54
+ }
55
+ ]
56
+ }
@@ -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:
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
+ ---
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; `flow` and `meridian` are the consumer namespaces. */
94
94
  "harness-overrides": { [namespace: string]: { [key: string]: JsonValue } };
95
95
  "model-policies": ModelPolicyRule[];
96
96
  }
@@ -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.6",
3
+ "version": "0.21.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