okforest 0.15.0 → 0.16.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.
- package/README.md +2 -2
- package/dist/cli.mjs +20 -13
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# okforest
|
|
2
2
|
|
|
3
3
|
The OKForest CLI: validate, inventory, and scaffold
|
|
4
|
-
[Open Knowledge Format (OKF)](https://github.com/
|
|
5
|
-
|
|
4
|
+
[Open Knowledge Format (OKF)](https://github.com/open-knowledge-format/open-knowledge-format)
|
|
5
|
+
trees, 0.2 and 0.3.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
npx okforest validate . # exit 1 on errors; warnings never fail
|
package/dist/cli.mjs
CHANGED
|
@@ -58,9 +58,10 @@ function starterFiles(name, date) {
|
|
|
58
58
|
<!-- Started by \`okforest init\`. Make it yours: add how your team works with
|
|
59
59
|
this repository, and remove anything that doesn't apply. -->
|
|
60
60
|
|
|
61
|
-
${name}: an [OKF
|
|
62
|
-
bundle in \`okf/\`, managed with [OKForest](https://www.okforest.ai).
|
|
63
|
-
|
|
61
|
+
${name}: an [OKF](https://raw.githubusercontent.com/open-knowledge-format/open-knowledge-format/refs/heads/main/SPEC.md)
|
|
62
|
+
bundle in \`okf/\`, managed with [OKForest](https://www.okforest.ai). The OKF
|
|
63
|
+
version it follows is \`okf_version\` in \`okf/index.md\`. People read it to
|
|
64
|
+
learn; AI assistants use it to answer questions. Write for both.
|
|
64
65
|
|
|
65
66
|
Everything outside \`okf/\` (this file, \`README.md\`, \`.github/\`,
|
|
66
67
|
\`.betterleaks.toml\`) is repository setup, not knowledge. Commands below run
|
|
@@ -87,6 +88,9 @@ from the repository root.
|
|
|
87
88
|
tag, to reuse an existing one.
|
|
88
89
|
- Every concept has a \`title\` and a one-sentence \`description\`. New or
|
|
89
90
|
unreviewed pages are \`status: draft\`.
|
|
91
|
+
- Fields OKF doesn't define start with \`x-\` (\`x-owner\`), so a later OKF
|
|
92
|
+
version can't give them another meaning. Add a new field to its type's
|
|
93
|
+
schema and template in the same change.
|
|
90
94
|
- Link with standard markdown links, using absolute paths from the bundle
|
|
91
95
|
root (\`okf/\`): \`[refunds](/policies/refunds.md)\`.
|
|
92
96
|
- \`index.md\` and \`log.md\` are reserved names in every folder. Keep each
|
|
@@ -119,9 +123,10 @@ from the repository root.
|
|
|
119
123
|
`,
|
|
120
124
|
"README.md": `# ${name}
|
|
121
125
|
|
|
122
|
-
${name}: an [Open Knowledge Format (OKF)](https://github.com/
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
${name}: an [Open Knowledge Format (OKF)](https://github.com/open-knowledge-format/open-knowledge-format/blob/main/SPEC.md)
|
|
127
|
+
bundle in [\`okf/\`](okf/index.md), one markdown file per concept, with YAML
|
|
128
|
+
frontmatter. Start at [\`okf/index.md\`](okf/index.md), which declares the OKF
|
|
129
|
+
version it follows (\`okf_version\`).
|
|
125
130
|
|
|
126
131
|
## Getting started
|
|
127
132
|
|
|
@@ -169,7 +174,7 @@ New pages are drafts (\`status: draft\`): fill them in and mark them \`stable\`.
|
|
|
169
174
|
Never commit secrets; record where each is kept instead.
|
|
170
175
|
`,
|
|
171
176
|
[`okf/index.md`]: `---
|
|
172
|
-
okf_version: "0.
|
|
177
|
+
okf_version: "0.3"
|
|
173
178
|
---
|
|
174
179
|
|
|
175
180
|
# ${name}
|
|
@@ -295,7 +300,7 @@ matchesAny(finding["secret"], [\`^/\`, \`://\`])
|
|
|
295
300
|
const COMPANY_TEMPLATE = "okforest/template-company-knowledge";
|
|
296
301
|
const HELP$6 = `Usage: okforest init [path] [--name <name>]
|
|
297
302
|
|
|
298
|
-
Create a repository for an OKF
|
|
303
|
+
Create a repository for an OKF 0.3 tree at path (default: the current
|
|
299
304
|
directory, which must be empty apart from .git): an empty bundle in okf/
|
|
300
305
|
(its index.md, log.md, and .okforest/settings.yaml), with a README.md, an
|
|
301
306
|
AGENTS.md for AI agents, a .gitignore, and GitHub workflows that scan for
|
|
@@ -389,7 +394,7 @@ const REASONS = {
|
|
|
389
394
|
function inventoryText(inventory, io) {
|
|
390
395
|
const out = [];
|
|
391
396
|
const { statuses: s, trustTiers: t } = inventory;
|
|
392
|
-
out.push(`${inventory.concepts} concepts · ${inventory.types.length} types · ${inventory.tags.length} tags · ${inventory.keys.length} frontmatter keys`, `Status: ${s.stable} stable, ${s.draft} draft, ${s.deprecated} deprecated · Trust: ${t["human-reviewed"]} human-reviewed, ${t["machine-confirmed"]} machine-confirmed, ${t.unverified} unverified · ${inventory.stale} stale`);
|
|
397
|
+
out.push(`${inventory.concepts} concepts · ${inventory.types.length} types · ${inventory.tags.length} tags · ${inventory.keys.length} frontmatter keys`, `Status: ${s.stable} stable, ${s.draft} draft, ${s.deprecated} deprecated${s.unrecognized > 0 ? `, ${s.unrecognized} unrecognized` : ""} · Trust: ${t["human-reviewed"]} human-reviewed, ${t["machine-confirmed"]} machine-confirmed, ${t.unverified} unverified · ${inventory.stale} stale`);
|
|
393
398
|
if (inventory.untyped > 0) out.push(paint(io, "yellow", `${inventory.untyped} concepts have no usable type`));
|
|
394
399
|
const section = (title, counts) => {
|
|
395
400
|
out.push("", paint(io, "bold", title));
|
|
@@ -412,8 +417,9 @@ function inventoryText(inventory, io) {
|
|
|
412
417
|
// src/commands/validate.ts
|
|
413
418
|
const HELP$4 = `Usage: okforest validate [path] [--format text|json]
|
|
414
419
|
|
|
415
|
-
Check the OKF
|
|
416
|
-
OKF specification
|
|
420
|
+
Check the OKF tree at path (default: the current directory) against the
|
|
421
|
+
OKF specification, by the version its root index.md declares (0.2, or 0.3),
|
|
422
|
+
and OKForest conventions. Exits 1 when there are errors;
|
|
417
423
|
warnings and info are reported but never fail.
|
|
418
424
|
|
|
419
425
|
Options
|
|
@@ -848,7 +854,7 @@ function slug(type) {
|
|
|
848
854
|
return type.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "") || "type";
|
|
849
855
|
}
|
|
850
856
|
// src/main.ts
|
|
851
|
-
const HELP = `okforest ${VERSION}: validate, inventory, and scaffold Open Knowledge Format (OKF)
|
|
857
|
+
const HELP = `okforest ${VERSION}: validate, inventory, and scaffold Open Knowledge Format (OKF) trees
|
|
852
858
|
|
|
853
859
|
Usage
|
|
854
860
|
okforest validate [path] [--format text|json]
|
|
@@ -859,7 +865,8 @@ Usage
|
|
|
859
865
|
okforest types init [path] [--type <type>]... [--dry-run]
|
|
860
866
|
|
|
861
867
|
Commands
|
|
862
|
-
validate Check a tree against OKF
|
|
868
|
+
validate Check a tree against OKF, by the version it declares, and
|
|
869
|
+
OKForest conventions.
|
|
863
870
|
Exits 1 when there are errors; warnings and info never fail.
|
|
864
871
|
inventory List every type, tag, and frontmatter key in use, with counts
|
|
865
872
|
and likely near-duplicates.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "okforest",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The OKForest CLI: validate Open Knowledge Format (OKF)
|
|
3
|
+
"version": "0.16.1",
|
|
4
|
+
"description": "The OKForest CLI: validate Open Knowledge Format (OKF) trees, 0.2 and 0.3, inventory their metadata, and scaffold new trees and pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"okf",
|
|
7
7
|
"open-knowledge-format",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"node": ">=22"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@okforest/okf": "0.
|
|
35
|
-
"@okforest/validate": "0.
|
|
34
|
+
"@okforest/okf": "0.16.1",
|
|
35
|
+
"@okforest/validate": "0.16.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^26.6.6",
|