@hawkeyexl/manni 0.0.0-bootstrap.0 → 0.2.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/LICENSE +21 -0
- package/README.md +178 -0
- package/dist/chunk-2OALUJV2.js +10820 -0
- package/dist/chunk-2OALUJV2.js.map +1 -0
- package/dist/chunk-OXH2ZM7E.js +1050 -0
- package/dist/chunk-OXH2ZM7E.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +914 -0
- package/dist/cli.js.map +1 -0
- package/dist/docmeta.d.ts +2 -0
- package/dist/docmeta.js +10 -0
- package/dist/docmeta.js.map +1 -0
- package/dist/index.d.ts +1623 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/package.json +104 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 manni contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# manni
|
|
2
|
+
|
|
3
|
+
One command line for documentation that is meant to be checked. `manni meta`
|
|
4
|
+
validates the **presence and format** of document metadata against **JSON
|
|
5
|
+
Schema**, built for CI. It was published as `docmeta` up to 4.13.1; see
|
|
6
|
+
[Coming from docmeta](#coming-from-docmeta).
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@hawkeyexl/manni)
|
|
9
|
+
[](https://github.com/hawkeyexl/manni/actions/workflows/ci.yml)
|
|
10
|
+
[](https://nodejs.org)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
|
|
13
|
+
`manni meta` checks the metadata in your documents (Markdown frontmatter and more)
|
|
14
|
+
against one or more JSON Schemas. It verifies that required fields are present
|
|
15
|
+
and correctly formatted: a `type`, an ISO 8601 `timestamp`, a URI `resource`. It
|
|
16
|
+
does not judge prose quality. It ships with 23 [built-in
|
|
17
|
+
schemas](https://hawkeyexl.github.io/manni/meta/reference/built-in-schemas/). They
|
|
18
|
+
cover content vocabularies such as the [Open Knowledge Format
|
|
19
|
+
(OKF)](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md),
|
|
20
|
+
[Diátaxis](https://diataxis.fr/), [The Good Docs
|
|
21
|
+
Project](https://www.thegooddocsproject.dev/template), and the [Seven-Action
|
|
22
|
+
model](https://passo.uno/seven-action-model/). They also cover the front matter
|
|
23
|
+
contracts of site generators such as
|
|
24
|
+
[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter)
|
|
25
|
+
3.10, Hugo, Jekyll, and MkDocs Material. Run `manni meta schemas` for the full
|
|
26
|
+
list. It follows [clig.dev](https://clig.dev) conventions and returns a nonzero
|
|
27
|
+
exit code (plus optional GitHub annotations) when validation fails.
|
|
28
|
+
|
|
29
|
+
It can also **fill in** the metadata that is missing, so adopting a standard on an existing docset is not a data-entry project.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g @hawkeyexl/manni
|
|
35
|
+
# or run it without installing:
|
|
36
|
+
npx @hawkeyexl/manni meta validate "**/*.md"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Requires Node.js 24 or later.
|
|
40
|
+
|
|
41
|
+
## Coming from docmeta?
|
|
42
|
+
|
|
43
|
+
The metadata tool used to be the whole package. Three things changed:
|
|
44
|
+
|
|
45
|
+
- **The command.** `docmeta validate …` is now `manni meta validate …`. The
|
|
46
|
+
package still installs a `docmeta` bin that runs the same program, so
|
|
47
|
+
existing scripts keep working while you move them.
|
|
48
|
+
- **The config file.** `manni.config.yaml`, shared by every tool in the
|
|
49
|
+
family, with the metadata tool's keys under `meta:`. A `docmeta.config.yaml`
|
|
50
|
+
is still read, with a warning.
|
|
51
|
+
- **The GitHub Action.** `uses: hawkeyexl/manni@v0`, same inputs.
|
|
52
|
+
|
|
53
|
+
Everything else is the same: the exit codes, the output formats, the built-in
|
|
54
|
+
schemas and their published URLs (the old `…/docmeta/schemas/` URLs stay
|
|
55
|
+
served and resolve offline), and the programmatic API.
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
Point `manni meta validate` at a file, a directory (walked recursively), or a glob. With no `--schema`, it validates against the default set: the built-in OKF schema plus `passo-uno:seven-action:1.0`, which constrains an optional `action` field and requires nothing on its own.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
manni meta validate docs/intro.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
✗ docs/intro.md
|
|
67
|
+
(root) must have required property 'type' (line 1) [google:okf:0.1]
|
|
68
|
+
/timestamp must match format "date-time" (line 9) [google:okf:0.1]
|
|
69
|
+
|
|
70
|
+
1 file checked, 0 passed, 1 failed, 0 errors
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A clean run exits `0`; validation failures exit `1`; operational errors (no input, unknown schema, parse error) exit `2`.
|
|
74
|
+
|
|
75
|
+
## Run it in CI
|
|
76
|
+
|
|
77
|
+
On GitHub Actions, use the packaged action. It sets up Node, pins the CLI, and
|
|
78
|
+
defaults to inline PR annotations:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
- uses: hawkeyexl/manni@v0
|
|
83
|
+
with:
|
|
84
|
+
paths: "docs/**/*.md"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Every input is in the [Action
|
|
88
|
+
reference](https://hawkeyexl.github.io/manni/meta/reference/action/). Other
|
|
89
|
+
platforms run the CLI directly. The [CI
|
|
90
|
+
recipes](https://hawkeyexl.github.io/manni/meta/ci/recipes/) cover GitLab CI,
|
|
91
|
+
Jenkins, and the rest.
|
|
92
|
+
|
|
93
|
+
To catch problems before they reach CI, manni meta publishes a
|
|
94
|
+
[pre-commit](https://pre-commit.com/) hook. The whole configuration is three
|
|
95
|
+
lines, and the file-matching pattern is derived from the extensions manni meta
|
|
96
|
+
actually reads rather than hand-written:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
repos:
|
|
100
|
+
- repo: https://github.com/hawkeyexl/manni
|
|
101
|
+
rev: v0.1.0
|
|
102
|
+
hooks:
|
|
103
|
+
- id: manni-meta
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Fill in what's missing
|
|
107
|
+
|
|
108
|
+
`manni meta fill` infers the metadata properties your schema asks for but a page
|
|
109
|
+
does not carry, and writes back the values it is confident about. It is the
|
|
110
|
+
fast way to clear the backlog on a repo that has never enforced metadata.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
manni meta fill docs/ --dry-run # preview; writes nothing
|
|
114
|
+
manni meta fill docs/ # apply
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
✓ docs/intro.md
|
|
119
|
+
/description A tour of the CLI and its four commands. 0.91
|
|
120
|
+
below 0.7: /resource 0.38
|
|
121
|
+
|
|
122
|
+
anthropic/claude-sonnet-4-5 · Threshold 0.7 · 1 file · 1 field written · 1 skipped
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Confidence is the last gate, not the only one. A proposal must first satisfy the
|
|
126
|
+
target property's own subschema. It must name a property your schema declares,
|
|
127
|
+
and it must leave the document still valid after the merge. Only then does
|
|
128
|
+
`--confidence` (default `0.7`) apply. Values below it are skipped and reported
|
|
129
|
+
by name. They are never written with a caveat, and the score itself never
|
|
130
|
+
reaches your document.
|
|
131
|
+
|
|
132
|
+
`fill` writes in place by default, so run it on a clean tree and review the
|
|
133
|
+
diff.
|
|
134
|
+
|
|
135
|
+
It picks an LLM provider by detecting one. The order is `ANTHROPIC_API_KEY`,
|
|
136
|
+
then `OPENAI_API_KEY`, then a signed-in `claude` CLI, then a local model that
|
|
137
|
+
needs no credentials at all. That means it works with whatever you have, and it
|
|
138
|
+
reports which provider it used. Pass `--provider` to pin one. That is worth
|
|
139
|
+
doing in CI. Left to detect, a runner that loses its key falls back to the local
|
|
140
|
+
model, and downloads it rather than failing the build.
|
|
141
|
+
|
|
142
|
+
Pass `--local` when the document must not leave the machine. It runs inference
|
|
143
|
+
on-device and **refuses every hosted provider**, a signed-in `claude` CLI
|
|
144
|
+
included. That CLI runs locally, but its inference does not. See the [`fill`
|
|
145
|
+
reference](https://hawkeyexl.github.io/manni/meta/reference/cli/#meta-fill) for every
|
|
146
|
+
flag and for what the local fallback costs.
|
|
147
|
+
|
|
148
|
+
## Supported formats
|
|
149
|
+
|
|
150
|
+
Markdown, MDX, AsciiDoc, reStructuredText, XML (including DITA topics and maps),
|
|
151
|
+
and HTML. Run `manni meta schemas` to list the built-in schemas, every supported
|
|
152
|
+
format, and which formats `fill` can write back to.
|
|
153
|
+
|
|
154
|
+
`fill` writes to all of them. It splices the exact character range of the value
|
|
155
|
+
rather than re-serializing the document. Comments, entity spellings, attribute
|
|
156
|
+
order, indentation, and a DOCTYPE all survive untouched.
|
|
157
|
+
|
|
158
|
+
## Documentation
|
|
159
|
+
|
|
160
|
+
Full guides, recipes, and reference live on the documentation site:
|
|
161
|
+
|
|
162
|
+
**https://hawkeyexl.github.io/manni/meta/**
|
|
163
|
+
|
|
164
|
+
| Track | What it covers |
|
|
165
|
+
|-------|----------------|
|
|
166
|
+
| [Get started](https://hawkeyexl.github.io/manni/meta/get-started/) | Install and run your first validation. |
|
|
167
|
+
| [Set up validation](https://hawkeyexl.github.io/manni/meta/set-up/) | Stand up validation for a repo: `manni.config.yaml`, per-folder schema overrides. |
|
|
168
|
+
| [Run it in CI](https://hawkeyexl.github.io/manni/meta/ci/) | GitHub Actions and other CI recipes, exit codes, and PR annotations. |
|
|
169
|
+
| [Define & evolve schemas](https://hawkeyexl.github.io/manni/schemas/) | Author a schema, wire up resolution, and version it without breaking the build. |
|
|
170
|
+
| [Reference](https://hawkeyexl.github.io/manni/meta/reference/cli/) | Every CLI flag, Action input, config key, the schema-resolution precedence chain, and output formats. |
|
|
171
|
+
|
|
172
|
+
## Contributing
|
|
173
|
+
|
|
174
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, the test loop, and how to add support for a new input format.
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
[MIT](LICENSE)
|