@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 +2 -2
- package/fixtures/prepare/schema-1-meridian-keys/expected/agents/demo.md +12 -0
- package/fixtures/prepare/schema-1-meridian-keys/expected.json +120 -0
- package/fixtures/prepare/schema-1-meridian-keys/input/agents/demo.md +11 -0
- package/fixtures/prepare/schema-1-meridian-keys/input/mars.toml +4 -0
- package/fixtures/prepare/schema-1-meridian-keys/request.json +4 -0
- package/fixtures/read/agent-meridian-namespace/agent.md +8 -0
- package/fixtures/read/agent-meridian-namespace/expected.json +53 -0
- package/fixtures/read/agent-removed-meridian-keys/agent.md +4 -0
- package/fixtures/read/agent-removed-meridian-keys/expected.json +56 -0
- package/fixtures/upgrade/agent-claude-keys-conflict/fully-rewritten.txt +2 -0
- package/fixtures/upgrade/agent-meridian-keys/expected-diagnostics.json +1 -0
- package/fixtures/upgrade/agent-meridian-keys/expected.md +11 -0
- package/fixtures/upgrade/agent-meridian-keys/input.md +10 -0
- package/fixtures/upgrade/agent-meridian-keys/kind.txt +1 -0
- package/index.d.ts +7 -1
- package/node/mars_schema_wasm.d.ts +4 -3
- package/node/mars_schema_wasm.js +4 -3
- package/node/mars_schema_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/web/mars_schema_wasm.d.ts +4 -3
- package/web/mars_schema_wasm.js +4 -3
- 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. |
|
|
@@ -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,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,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,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 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
agent
|
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`
|
|
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
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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
|
|
package/node/mars_schema_wasm.js
CHANGED
|
@@ -80,9 +80,10 @@ function normalize(input) {
|
|
|
80
80
|
exports.normalize = normalize;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
* Prepare one root from
|
|
84
|
-
*
|
|
85
|
-
*
|
|
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
|
@@ -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
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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
|
|
package/web/mars_schema_wasm.js
CHANGED
|
@@ -77,9 +77,10 @@ export function normalize(input) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* Prepare one root from
|
|
81
|
-
*
|
|
82
|
-
*
|
|
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
|