@meridian-flow/mars-schema 0.32.1 → 0.33.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.
Files changed (25) hide show
  1. package/README.md +1 -0
  2. package/fixtures/normalize/agent-translation/normalized.json +20 -0
  3. package/fixtures/normalize/claude-plugin-default/normalized.json +10 -0
  4. package/fixtures/normalize/skill-translation/expected/package/skills/everything/SKILL.md +2 -0
  5. package/fixtures/normalize/skill-translation/normalized.json +3 -7
  6. package/fixtures/prepare/declared-dialect/expected.json +10 -1
  7. package/fixtures/prepare/legacy-agent-no-frontmatter/expected/mars.toml +4 -0
  8. package/fixtures/prepare/legacy-agent-no-frontmatter/expected.json +94 -0
  9. package/fixtures/prepare/legacy-agent-no-frontmatter/input/agents/coder.md +1 -0
  10. package/fixtures/prepare/legacy-agent-no-frontmatter/input/mars.toml +3 -0
  11. package/fixtures/prepare/legacy-agent-no-frontmatter/request.json +3 -0
  12. package/fixtures/prepare/schema-1-agent-no-frontmatter/expected.json +95 -0
  13. package/fixtures/prepare/schema-1-agent-no-frontmatter/input/agents/coder.md +5 -0
  14. package/fixtures/prepare/schema-1-agent-no-frontmatter/input/mars.toml +4 -0
  15. package/fixtures/prepare/schema-1-agent-no-frontmatter/request.json +3 -0
  16. package/fixtures/read/agent-frontmatter-clean/agent.md +5 -0
  17. package/fixtures/read/agent-frontmatter-clean/expected.json +37 -0
  18. package/fixtures/read/agent-no-frontmatter-body-only/agent.md +1 -0
  19. package/fixtures/read/agent-no-frontmatter-body-only/expected.json +35 -0
  20. package/fixtures/read/agent-no-frontmatter-stray-line/agent.md +6 -0
  21. package/fixtures/read/agent-no-frontmatter-stray-line/expected.json +35 -0
  22. package/fixtures/vocabulary/expected.json +9 -3
  23. package/node/mars_schema_wasm_bg.wasm +0 -0
  24. package/package.json +1 -1
  25. package/web/mars_schema_wasm_bg.wasm +0 -0
package/README.md CHANGED
@@ -58,6 +58,7 @@ interface DefinitionRead<Fields> {
58
58
  - `fields` has the kebab-case spellings the file uses (`"model-invocable"`, `"harness-overrides"`), `xhigh` and `read-only` as written, and `null` or `[]` where the file sets nothing. `AgentFields`, `SkillFields` and `ManifestFields` are in `index.d.ts`; for `mars.toml`, `frontmatter` holds the pairs of the `[package]` table.
59
59
  - `diagnostics` carry a stable `code` (`field.removed`, `field.unknown`, `yaml.anchor`, ...), a `severity` of `error`, `warning` or `info`, and a `path` of keys and indexes into the file (`["model-policies", 0, "when"]`). Locate the diagnostic in the text with your own parser: `range` is for fence and YAML-syntax errors only, and no reader sets it yet. Errors do not stop the reading, so an editor can show the form and the problem together.
60
60
  - `frontmatter` omits a key whose value has no JSON form (a YAML tag, a non-string key, an integer beyond ±(2^53 − 1), a `__proto__` key) and reports it as `yaml.non-json-value` (`toml.non-json-value` for `mars.toml`). Mapping keys keep file order at every depth; JavaScript objects list integer-like keys such as `"1"` first.
61
+ - An Agent whose first line is not `---` has no frontmatter, so every field takes its default and the file reads as the widest Agent. `read("agents/<slug>.md", text)` reports it as the error `frontmatter.missing`, with the defaults in `fields` and the whole file in `body`; `prepare` reports it the same way for a schema 1 package. A pre-v1 or foreign package's body-only Agent is not an error, and a skill with no frontmatter keeps its `skill.no-frontmatter` warning.
61
62
  - Frontmatter has two limits, because the YAML scanners take time that grows with the square of the nesting depth and a server that reads untrusted files must not stall: a block over 64 KiB is `frontmatter.too-large`, and one that opens `[` or `{` more than 64 deep (counted over the raw text) is `frontmatter.too-deep`. Either gives `fields: null` and no other diagnostic. Real frontmatter is under 2 KiB and nests a few levels; the limits apply to `read`, `prepare` and `normalize` alike.
62
63
 
63
64
  ### Editing without losing the rest of the file
@@ -520,11 +520,31 @@
520
520
  "severity": "warning",
521
521
  "path": [],
522
522
  "message": "inline `mcpServers` definitions are not converted; only the server names carry over"
523
+ },
524
+ {
525
+ "code": "agent.tools-widened",
526
+ "severity": "warning",
527
+ "path": [],
528
+ "message": "Mars reads each tool as a capability, so Claude also gets SendMessage, ListAgents, which the list did not name"
529
+ }
530
+ ],
531
+ "agents/list.md": [
532
+ {
533
+ "code": "agent.tools-widened",
534
+ "severity": "warning",
535
+ "path": [],
536
+ "message": "Mars reads each tool as a capability, so Claude also gets Write, NotebookEdit, which the list did not name"
523
537
  }
524
538
  ]
525
539
  },
526
540
  "changes": {
527
541
  "agents/everything.md": [
542
+ {
543
+ "code": "agent.model-inherit",
544
+ "severity": "info",
545
+ "path": [],
546
+ "message": "removed `model: inherit`: a Claude agent with no `model` runs on the model of the session that starts it"
547
+ },
528
548
  {
529
549
  "code": "agent.claude-keys-moved",
530
550
  "severity": "info",
@@ -449,6 +449,16 @@
449
449
  "message": "hooks are not converted yet"
450
450
  }
451
451
  ]
452
+ },
453
+ "changes": {
454
+ "agents/helper.md": [
455
+ {
456
+ "code": "agent.model-inherit",
457
+ "severity": "info",
458
+ "path": [],
459
+ "message": "removed `model: inherit`: a Claude agent with no `model` runs on the model of the session that starts it"
460
+ }
461
+ ]
452
462
  }
453
463
  }
454
464
  }
@@ -12,6 +12,8 @@ x-custom: kept
12
12
  model-invocable: false
13
13
  harness-overrides:
14
14
  claude:
15
+ allowed-tools: Bash(git status *) Bash(git add *) Read
16
+ disallowed-tools: WebFetch
15
17
  argument-hint: '[file]'
16
18
  model: sonnet
17
19
  hooks:
@@ -186,6 +186,8 @@
186
186
  "harness-overrides",
187
187
  {
188
188
  "claude": {
189
+ "allowed-tools": "Bash(git status *) Bash(git add *) Read",
190
+ "disallowed-tools": "WebFetch",
189
191
  "argument-hint": "[file]",
190
192
  "model": "sonnet",
191
193
  "hooks": {
@@ -387,17 +389,11 @@
387
389
  }
388
390
  ],
389
391
  "skills/everything/SKILL.md": [
390
- {
391
- "code": "skill.tools-dropped",
392
- "severity": "warning",
393
- "path": [],
394
- "message": "removed allowed-tools, disallowed-tools: schema v1 has no skill tool rules, and Claude's `allowed-tools` grants without restricting"
395
- },
396
392
  {
397
393
  "code": "skill.claude-keys-moved",
398
394
  "severity": "info",
399
395
  "path": [],
400
- "message": "moved Claude-only keys to harness-overrides.claude: `argument-hint`, `model`, `hooks`"
396
+ "message": "moved Claude-only keys to harness-overrides.claude: `allowed-tools`, `disallowed-tools`, `argument-hint`, `model`, `hooks`"
401
397
  }
402
398
  ]
403
399
  }
@@ -95,5 +95,14 @@
95
95
  "edges": [],
96
96
  "uses_providers": []
97
97
  },
98
- "diagnostics": {}
98
+ "diagnostics": {
99
+ "agents/native.md": [
100
+ {
101
+ "code": "agent.tools-widened",
102
+ "severity": "warning",
103
+ "path": [],
104
+ "message": "Mars reads each tool as a capability, so Claude also gets SendMessage, ListAgents, which the list did not name"
105
+ }
106
+ ]
107
+ }
99
108
  }
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,94 @@
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": "coder",
45
+ "source_path": "agents/coder.md",
46
+ "output_path": "agents/coder.md",
47
+ "reading": {
48
+ "frontmatter": [],
49
+ "fields": {
50
+ "name": null,
51
+ "description": null,
52
+ "harness": null,
53
+ "model": null,
54
+ "mode": null,
55
+ "model-invocable": true,
56
+ "user-invocable": true,
57
+ "approval": null,
58
+ "sandbox": null,
59
+ "network": null,
60
+ "network-allow": [],
61
+ "network-deny": [],
62
+ "effort": null,
63
+ "skills": {
64
+ "load": [],
65
+ "available": []
66
+ },
67
+ "subagents": [],
68
+ "tools": [],
69
+ "harness-overrides": {},
70
+ "model-policies": []
71
+ },
72
+ "body": "Body only\n",
73
+ "diagnostics": []
74
+ },
75
+ "change": {
76
+ "kind": "none"
77
+ }
78
+ }
79
+ ],
80
+ "payload": [],
81
+ "selection": {
82
+ "definitions": [
83
+ {
84
+ "kind": "agent",
85
+ "slug": "coder",
86
+ "output_path": "agents/coder.md",
87
+ "skills": []
88
+ }
89
+ ],
90
+ "edges": [],
91
+ "uses_providers": []
92
+ },
93
+ "diagnostics": {}
94
+ }
@@ -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,95 @@
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": "coder",
39
+ "source_path": "agents/coder.md",
40
+ "output_path": "agents/coder.md",
41
+ "reading": {
42
+ "frontmatter": [],
43
+ "fields": {
44
+ "name": null,
45
+ "description": null,
46
+ "harness": null,
47
+ "model": null,
48
+ "mode": null,
49
+ "model-invocable": true,
50
+ "user-invocable": true,
51
+ "approval": null,
52
+ "sandbox": null,
53
+ "network": null,
54
+ "network-allow": [],
55
+ "network-deny": [],
56
+ "effort": null,
57
+ "skills": {
58
+ "load": [],
59
+ "available": []
60
+ },
61
+ "subagents": [],
62
+ "tools": [],
63
+ "harness-overrides": {},
64
+ "model-policies": []
65
+ },
66
+ "body": "stray\n---\nsandbox: read-only\n---\nBody\n",
67
+ "diagnostics": [
68
+ {
69
+ "code": "frontmatter.missing",
70
+ "severity": "error",
71
+ "path": [],
72
+ "message": "an Agent's frontmatter must open with a first line that is exactly `---`; without it every field takes its default"
73
+ }
74
+ ]
75
+ },
76
+ "change": {
77
+ "kind": "none"
78
+ }
79
+ }
80
+ ],
81
+ "payload": [],
82
+ "selection": {
83
+ "definitions": [
84
+ {
85
+ "kind": "agent",
86
+ "slug": "coder",
87
+ "output_path": "agents/coder.md",
88
+ "skills": []
89
+ }
90
+ ],
91
+ "edges": [],
92
+ "uses_providers": []
93
+ },
94
+ "diagnostics": {}
95
+ }
@@ -0,0 +1,5 @@
1
+ stray
2
+ ---
3
+ sandbox: read-only
4
+ ---
5
+ Body
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "demo"
3
+ version = "1.0.0"
4
+ schema = 1
@@ -0,0 +1,3 @@
1
+ {
2
+ "context": "package"
3
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ name: reviewer
3
+ sandbox: read-only
4
+ ---
5
+ You are a reviewer.
@@ -0,0 +1,37 @@
1
+ {
2
+ "frontmatter": [
3
+ [
4
+ "name",
5
+ "reviewer"
6
+ ],
7
+ [
8
+ "sandbox",
9
+ "read-only"
10
+ ]
11
+ ],
12
+ "fields": {
13
+ "name": "reviewer",
14
+ "description": null,
15
+ "harness": null,
16
+ "model": null,
17
+ "mode": null,
18
+ "model-invocable": true,
19
+ "user-invocable": true,
20
+ "approval": null,
21
+ "sandbox": "read-only",
22
+ "network": null,
23
+ "network-allow": [],
24
+ "network-deny": [],
25
+ "effort": null,
26
+ "skills": {
27
+ "load": [],
28
+ "available": []
29
+ },
30
+ "subagents": [],
31
+ "tools": [],
32
+ "harness-overrides": {},
33
+ "model-policies": []
34
+ },
35
+ "body": "You are a reviewer.\n",
36
+ "diagnostics": []
37
+ }
@@ -0,0 +1 @@
1
+ You are a reviewer.
@@ -0,0 +1,35 @@
1
+ {
2
+ "frontmatter": [],
3
+ "fields": {
4
+ "name": null,
5
+ "description": null,
6
+ "harness": null,
7
+ "model": null,
8
+ "mode": null,
9
+ "model-invocable": true,
10
+ "user-invocable": true,
11
+ "approval": null,
12
+ "sandbox": null,
13
+ "network": null,
14
+ "network-allow": [],
15
+ "network-deny": [],
16
+ "effort": null,
17
+ "skills": {
18
+ "load": [],
19
+ "available": []
20
+ },
21
+ "subagents": [],
22
+ "tools": [],
23
+ "harness-overrides": {},
24
+ "model-policies": []
25
+ },
26
+ "body": "You are a reviewer.\n",
27
+ "diagnostics": [
28
+ {
29
+ "code": "frontmatter.missing",
30
+ "severity": "error",
31
+ "path": [],
32
+ "message": "an Agent's frontmatter must open with a first line that is exactly `---`; without it every field takes its default"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,6 @@
1
+ oops
2
+ ---
3
+ name: reviewer
4
+ sandbox: read-only
5
+ ---
6
+ You are a reviewer.
@@ -0,0 +1,35 @@
1
+ {
2
+ "frontmatter": [],
3
+ "fields": {
4
+ "name": null,
5
+ "description": null,
6
+ "harness": null,
7
+ "model": null,
8
+ "mode": null,
9
+ "model-invocable": true,
10
+ "user-invocable": true,
11
+ "approval": null,
12
+ "sandbox": null,
13
+ "network": null,
14
+ "network-allow": [],
15
+ "network-deny": [],
16
+ "effort": null,
17
+ "skills": {
18
+ "load": [],
19
+ "available": []
20
+ },
21
+ "subagents": [],
22
+ "tools": [],
23
+ "harness-overrides": {},
24
+ "model-policies": []
25
+ },
26
+ "body": "oops\n---\nname: reviewer\nsandbox: read-only\n---\nYou are a reviewer.\n",
27
+ "diagnostics": [
28
+ {
29
+ "code": "frontmatter.missing",
30
+ "severity": "error",
31
+ "path": [],
32
+ "message": "an Agent's frontmatter must open with a first line that is exactly `---`; without it every field takes its default"
33
+ }
34
+ ]
35
+ }
@@ -53,6 +53,8 @@
53
53
  "tasklist",
54
54
  "task_update",
55
55
  "taskupdate",
56
+ "task_stop",
57
+ "taskstop",
56
58
  "update_plan"
57
59
  ]
58
60
  },
@@ -186,12 +188,16 @@
186
188
  "natives": {
187
189
  "claude": {
188
190
  "agent": {
189
- "kind": "tools",
190
- "tools": [
191
+ "kind": "scoped-tools",
192
+ "unscoped": [
191
193
  "Agent",
192
194
  "SendMessage",
193
195
  "ListAgents"
194
- ]
196
+ ],
197
+ "scoped": [
198
+ "Agent"
199
+ ],
200
+ "note": "Claude's `Agent(type, ...)` limits which sub-agent types can be started; SendMessage and ListAgents take no scope"
195
201
  },
196
202
  "ask_user": {
197
203
  "kind": "tools",
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridian-flow/mars-schema",
3
- "version": "0.32.1",
3
+ "version": "0.33.1",
4
4
  "description": "Mars agent schema reader and lossless editor",
5
5
  "license": "MIT",
6
6
  "repository": {
Binary file