@medicine-wheel/developer-repository-mapping 0.27.9 → 0.27.11
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 +22 -0
- package/dist/capability-file.d.ts +223 -0
- package/dist/capability-file.d.ts.map +1 -0
- package/dist/capability-file.js +344 -0
- package/dist/capability-file.js.map +1 -0
- package/dist/capability-impact.d.ts +98 -0
- package/dist/capability-impact.d.ts.map +1 -0
- package/dist/capability-impact.js +174 -0
- package/dist/capability-impact.js.map +1 -0
- package/dist/capability-scan.d.ts +117 -0
- package/dist/capability-scan.d.ts.map +1 -0
- package/dist/capability-scan.js +252 -0
- package/dist/capability-scan.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +169 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/node/capability-scan.d.ts +144 -0
- package/dist/node/capability-scan.d.ts.map +1 -0
- package/dist/node/capability-scan.js +363 -0
- package/dist/node/capability-scan.js.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +8 -1
- package/dist/node/index.js.map +1 -1
- package/dist/schemas.d.ts +72 -72
- package/package.json +4 -3
- package/schema/repository-capabilities.v1.schema.json +233 -0
package/README.md
CHANGED
|
@@ -46,6 +46,28 @@ A meta hub reads every hub it registers (from a local path, or from GitHub by de
|
|
|
46
46
|
unless `--local`. `observe --write` and `move` refuse to rewrite a folder while any row
|
|
47
47
|
fails to parse. Exit codes: 0 done, 1 errors or a failed read, 2 usage error.
|
|
48
48
|
|
|
49
|
+
## What a repository provides
|
|
50
|
+
|
|
51
|
+
Any git repository can keep what it provides in `.miadi/capabilities.jsonl`, committed with its code, so whoever clones it knows what it offers. Nothing else is needed: no account, no registry, no server.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @medicine-wheel/developer-repository-mapping capabilities scan --write # in a clone: its packages, CLIs and skills
|
|
55
|
+
git add .miadi/capabilities.jsonl && git commit -m "what this repository provides"
|
|
56
|
+
|
|
57
|
+
mw-repomap capabilities show <clone> # what a clone provides, from its own file first
|
|
58
|
+
mw-repomap capabilities state skill/greet "Says hello." --by Ava # a person states a row (55 words at most)
|
|
59
|
+
mw-repomap capabilities scan --check # exit 1 when the file is behind the code
|
|
60
|
+
mw-repomap capabilities map --root ~/repos --out map.jsonl # go through clones and answer one map
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A rescan keeps what a person wrote and leaves the file alone when nothing changed. Versions come from each `package.json` at the commit read, so a release does not touch the file. A reader skips what a newer format adds and reads the rest; it never reads a row the commit does not provide. A fork keeps the file's repository until `--repository` adopts it. If the repository ignores `*.jsonl`, add `!.miadi/capabilities.jsonl` after that rule.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
mw-repomap capabilities state package/@acme/tool --realizes capability:publish-a-prototype --by Ava # which platform capability it serves
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The JSON Schema of a line ships at `schema/repository-capabilities.v1.schema.json`. The format and its rules are in `rispecs/developer-suite/repository-mapping/capabilities.spec.md` of jgwill/medicine-wheel.
|
|
70
|
+
|
|
49
71
|
## Library
|
|
50
72
|
|
|
51
73
|
```ts
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A repository's own capability file, `.miadi/capabilities.jsonl`, pure.
|
|
3
|
+
*
|
|
4
|
+
* The file travels with the repository: whoever clones it knows what it
|
|
5
|
+
* provides, with no Factory and no registry. The first line says what the file
|
|
6
|
+
* is and which repository wrote it; each other line is one capability: its
|
|
7
|
+
* kind, its name, its address, what its files say it is, and the files that
|
|
8
|
+
* say so. Versions and dependency ranges are not here, because every release
|
|
9
|
+
* would make them stale: a reader takes them from each package.json at the
|
|
10
|
+
* commit it reads. The commit is not here either, because a committed file
|
|
11
|
+
* cannot name its own commit: a reader adds the one it read.
|
|
12
|
+
*
|
|
13
|
+
* `mw-repomap capabilities scan --write` writes it. A rescan keeps what a
|
|
14
|
+
* person wrote, and a row the scan wrote stays as it is while its statement
|
|
15
|
+
* stays the same, so a file only changes when the repository did.
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { type CapabilityFacet } from '@medicine-wheel/capabilities';
|
|
19
|
+
import type { MappingIssue } from './types';
|
|
20
|
+
import { type Artefact, type CapabilityKind } from './capability-scan';
|
|
21
|
+
/** Where a repository keeps it, relative to its root. */
|
|
22
|
+
export declare const CAPABILITY_FILE = ".miadi/capabilities.jsonl";
|
|
23
|
+
export declare const CAPABILITY_FILE_SCHEMA = "medicine-wheel/repository-capabilities";
|
|
24
|
+
/** `statedBy` of a row the scan wrote. Any other name is a person's, and a rescan keeps its words. */
|
|
25
|
+
export declare const SCAN_AUTHOR = "mw-repomap scan";
|
|
26
|
+
/** The format version this package writes. A reader takes a newer one and reads what it knows. */
|
|
27
|
+
export declare const CAPABILITY_FILE_VERSION = 1;
|
|
28
|
+
export declare const CapabilityFileHeaderSchema: z.ZodObject<{
|
|
29
|
+
schema: z.ZodLiteral<"medicine-wheel/repository-capabilities">;
|
|
30
|
+
version: z.ZodNumber;
|
|
31
|
+
/** `owner/name`, as the repository was known when the file was written. */
|
|
32
|
+
repository: z.ZodString;
|
|
33
|
+
}, "strict", z.ZodTypeAny, {
|
|
34
|
+
version: number;
|
|
35
|
+
schema: "medicine-wheel/repository-capabilities";
|
|
36
|
+
repository: string;
|
|
37
|
+
}, {
|
|
38
|
+
version: number;
|
|
39
|
+
schema: "medicine-wheel/repository-capabilities";
|
|
40
|
+
repository: string;
|
|
41
|
+
}>;
|
|
42
|
+
export type CapabilityFileHeader = z.infer<typeof CapabilityFileHeaderSchema>;
|
|
43
|
+
/** A name the registry can give an id to: printable, at most 214 characters, with a letter or a digit. */
|
|
44
|
+
export declare const CapabilityNameSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
45
|
+
/** The keys a row of this version holds. */
|
|
46
|
+
export declare const CAPABILITY_FILE_ROW_KEYS: readonly string[];
|
|
47
|
+
export declare const CapabilityFileRowSchema: z.ZodEffects<z.ZodObject<{
|
|
48
|
+
statedBy: z.ZodString;
|
|
49
|
+
statedAt: z.ZodString;
|
|
50
|
+
grounding: z.ZodArray<z.ZodString, "many">;
|
|
51
|
+
revision: z.ZodEnum<["pending", "revised", "affirmed"]>;
|
|
52
|
+
revisedBy: z.ZodOptional<z.ZodString>;
|
|
53
|
+
revisedAt: z.ZodOptional<z.ZodString>;
|
|
54
|
+
kind: z.ZodEnum<[CapabilityKind, ...CapabilityKind[]]>;
|
|
55
|
+
name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
56
|
+
/** `miadi-capability://<owner>/<repo>/<kind>/<name>` */
|
|
57
|
+
address: z.ZodEffects<z.ZodString, string, string>;
|
|
58
|
+
statement: z.ZodOptional<z.ZodIntersection<z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>>>;
|
|
59
|
+
status: z.ZodEnum<["clear", "unclear", "undefinable", "needs-resolution"]>;
|
|
60
|
+
/** For a CLI: the package that ships it. */
|
|
61
|
+
package: z.ZodOptional<z.ZodString>;
|
|
62
|
+
/**
|
|
63
|
+
* The platform capabilities this one serves (`capability:<slug>`, capabilities.spec.md):
|
|
64
|
+
* said by a person or an agent, never by the scan, and kept by every rescan.
|
|
65
|
+
*/
|
|
66
|
+
realizes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
+
capability: z.ZodString;
|
|
68
|
+
statedBy: z.ZodEffects<z.ZodString, string, string>;
|
|
69
|
+
statedAt: z.ZodString;
|
|
70
|
+
}, "strict", z.ZodTypeAny, {
|
|
71
|
+
capability: string;
|
|
72
|
+
statedBy: string;
|
|
73
|
+
statedAt: string;
|
|
74
|
+
}, {
|
|
75
|
+
capability: string;
|
|
76
|
+
statedBy: string;
|
|
77
|
+
statedAt: string;
|
|
78
|
+
}>, "many">>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
name: string;
|
|
81
|
+
revision: "pending" | "revised" | "affirmed";
|
|
82
|
+
status: "clear" | "unclear" | "undefinable" | "needs-resolution";
|
|
83
|
+
kind: CapabilityKind;
|
|
84
|
+
address: string;
|
|
85
|
+
statedBy: string;
|
|
86
|
+
statedAt: string;
|
|
87
|
+
grounding: string[];
|
|
88
|
+
realizes?: {
|
|
89
|
+
capability: string;
|
|
90
|
+
statedBy: string;
|
|
91
|
+
statedAt: string;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
package?: string | undefined;
|
|
94
|
+
statement?: string | undefined;
|
|
95
|
+
revisedBy?: string | undefined;
|
|
96
|
+
revisedAt?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
name: string;
|
|
99
|
+
revision: "pending" | "revised" | "affirmed";
|
|
100
|
+
status: "clear" | "unclear" | "undefinable" | "needs-resolution";
|
|
101
|
+
kind: CapabilityKind;
|
|
102
|
+
address: string;
|
|
103
|
+
statedBy: string;
|
|
104
|
+
statedAt: string;
|
|
105
|
+
grounding: string[];
|
|
106
|
+
realizes?: {
|
|
107
|
+
capability: string;
|
|
108
|
+
statedBy: string;
|
|
109
|
+
statedAt: string;
|
|
110
|
+
}[] | undefined;
|
|
111
|
+
package?: string | undefined;
|
|
112
|
+
statement?: string | undefined;
|
|
113
|
+
revisedBy?: string | undefined;
|
|
114
|
+
revisedAt?: string | undefined;
|
|
115
|
+
}>, {
|
|
116
|
+
name: string;
|
|
117
|
+
revision: "pending" | "revised" | "affirmed";
|
|
118
|
+
status: "clear" | "unclear" | "undefinable" | "needs-resolution";
|
|
119
|
+
kind: CapabilityKind;
|
|
120
|
+
address: string;
|
|
121
|
+
statedBy: string;
|
|
122
|
+
statedAt: string;
|
|
123
|
+
grounding: string[];
|
|
124
|
+
realizes?: {
|
|
125
|
+
capability: string;
|
|
126
|
+
statedBy: string;
|
|
127
|
+
statedAt: string;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
package?: string | undefined;
|
|
130
|
+
statement?: string | undefined;
|
|
131
|
+
revisedBy?: string | undefined;
|
|
132
|
+
revisedAt?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
name: string;
|
|
135
|
+
revision: "pending" | "revised" | "affirmed";
|
|
136
|
+
status: "clear" | "unclear" | "undefinable" | "needs-resolution";
|
|
137
|
+
kind: CapabilityKind;
|
|
138
|
+
address: string;
|
|
139
|
+
statedBy: string;
|
|
140
|
+
statedAt: string;
|
|
141
|
+
grounding: string[];
|
|
142
|
+
realizes?: {
|
|
143
|
+
capability: string;
|
|
144
|
+
statedBy: string;
|
|
145
|
+
statedAt: string;
|
|
146
|
+
}[] | undefined;
|
|
147
|
+
package?: string | undefined;
|
|
148
|
+
statement?: string | undefined;
|
|
149
|
+
revisedBy?: string | undefined;
|
|
150
|
+
revisedAt?: string | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
export type CapabilityFileRow = z.infer<typeof CapabilityFileRowSchema>;
|
|
153
|
+
export interface ParsedCapabilityFile {
|
|
154
|
+
header?: CapabilityFileHeader;
|
|
155
|
+
rows: CapabilityFileRow[];
|
|
156
|
+
issues: MappingIssue[];
|
|
157
|
+
}
|
|
158
|
+
export interface ParseCapabilityFileOptions {
|
|
159
|
+
/**
|
|
160
|
+
* `read` (the default): what a newer version of the format adds (a key, a
|
|
161
|
+
* kind, a header field, a higher version) is skipped and said as a warning,
|
|
162
|
+
* and everything this version knows is read. `write`: the same things are
|
|
163
|
+
* errors, because a rewrite by this version would lose them.
|
|
164
|
+
*/
|
|
165
|
+
mode?: 'read' | 'write';
|
|
166
|
+
}
|
|
167
|
+
/** Read the file. Never throws: a bad line is an issue, and the good lines around it are still read. */
|
|
168
|
+
export declare function parseCapabilityFile(text: string, options?: ParseCapabilityFileOptions): ParsedCapabilityFile;
|
|
169
|
+
/** The file's text: the header, then one row per line in a fixed order, so a diff shows only what changed. */
|
|
170
|
+
export declare function renderCapabilityFile(repository: string, rows: readonly CapabilityFileRow[]): string;
|
|
171
|
+
/** The rows a scan's artefacts make: one per capability, the files that say so as grounding. */
|
|
172
|
+
export declare function capabilityFileRows(artefacts: readonly Artefact[], ctx: {
|
|
173
|
+
repository: string;
|
|
174
|
+
statedAt: string;
|
|
175
|
+
}): CapabilityFileRow[];
|
|
176
|
+
export interface CapabilityFileMerge {
|
|
177
|
+
rows: CapabilityFileRow[];
|
|
178
|
+
/** Keys (`kind/name`) the scan found that the file did not hold. */
|
|
179
|
+
added: string[];
|
|
180
|
+
/** Rows the scan wrote and no longer finds. */
|
|
181
|
+
removed: string[];
|
|
182
|
+
/** Rows whose text or files changed. */
|
|
183
|
+
changed: string[];
|
|
184
|
+
/** Rows a person wrote that this scan does not find: kept, and said. */
|
|
185
|
+
keptByPerson: string[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* What the file should hold after a scan.
|
|
189
|
+
*
|
|
190
|
+
* A row a person wrote (any `statedBy` but {@link SCAN_AUTHOR}) keeps its
|
|
191
|
+
* words, its status and its attribution: `capabilities state` writes one, and
|
|
192
|
+
* so does a hand edit that puts the person's name in `statedBy`. A row the
|
|
193
|
+
* scan wrote takes the scan's statement, and goes back to pending when the
|
|
194
|
+
* statement changed or the files stopped making one. The files and the
|
|
195
|
+
* shipping package are always the scan's. The same rule serves a reader,
|
|
196
|
+
* which merges a committed file with what the commit holds.
|
|
197
|
+
*/
|
|
198
|
+
export declare function mergeCapabilityFile(existing: readonly CapabilityFileRow[], scanned: readonly CapabilityFileRow[]): CapabilityFileMerge;
|
|
199
|
+
/**
|
|
200
|
+
* The file's rows as capability facets of one repository at one commit: the
|
|
201
|
+
* files become `owner/name@commit:path`, the grounding every registry row carries.
|
|
202
|
+
*/
|
|
203
|
+
export declare function capabilityFileFacets(rows: readonly CapabilityFileRow[], ctx: {
|
|
204
|
+
repository: string;
|
|
205
|
+
commit: string;
|
|
206
|
+
}): CapabilityFacet[];
|
|
207
|
+
export interface CapabilityStatementInput {
|
|
208
|
+
kind: CapabilityKind;
|
|
209
|
+
name: string;
|
|
210
|
+
by: string;
|
|
211
|
+
at: string;
|
|
212
|
+
/** With words, the person states it; without, the person affirms what is there. */
|
|
213
|
+
statement?: string;
|
|
214
|
+
/** The platform capabilities it serves, `capability:<slug>`; each one not yet held is added, said by `by` at `at`. */
|
|
215
|
+
realizes?: string[];
|
|
216
|
+
}
|
|
217
|
+
/** A person states or affirms one row. An `error` says why not: no such row, or words that do not fit. */
|
|
218
|
+
export declare function stateCapabilityRow(rows: readonly CapabilityFileRow[], input: CapabilityStatementInput): {
|
|
219
|
+
rows: CapabilityFileRow[];
|
|
220
|
+
} | {
|
|
221
|
+
error: string;
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=capability-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-file.d.ts","sourceRoot":"","sources":["../src/capability-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqD,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1H,yDAAyD;AACzD,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAC3D,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAC/E,sGAAsG;AACtG,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAE7C,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,eAAO,MAAM,0BAA0B;;;IAInC,2EAA2E;;;;;;;;;;EAGpE,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAA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M,EAAE,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wCAAwC;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wEAAwE;IACxE,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EAAE,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,mBAAmB,CA0CtI;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,iBAAiB,EAAE,EAAE,GAAG,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,EAAE,CAevI;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sHAAsH;IACtH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,iBAAiB,EAAE,EAAE,KAAK,EAAE,wBAAwB,GAAG;IAAE,IAAI,EAAE,iBAAiB,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA4BzJ"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A repository's own capability file, `.miadi/capabilities.jsonl`, pure.
|
|
4
|
+
*
|
|
5
|
+
* The file travels with the repository: whoever clones it knows what it
|
|
6
|
+
* provides, with no Factory and no registry. The first line says what the file
|
|
7
|
+
* is and which repository wrote it; each other line is one capability: its
|
|
8
|
+
* kind, its name, its address, what its files say it is, and the files that
|
|
9
|
+
* say so. Versions and dependency ranges are not here, because every release
|
|
10
|
+
* would make them stale: a reader takes them from each package.json at the
|
|
11
|
+
* commit it reads. The commit is not here either, because a committed file
|
|
12
|
+
* cannot name its own commit: a reader adds the one it read.
|
|
13
|
+
*
|
|
14
|
+
* `mw-repomap capabilities scan --write` writes it. A rescan keeps what a
|
|
15
|
+
* person wrote, and a row the scan wrote stays as it is while its statement
|
|
16
|
+
* stays the same, so a file only changes when the repository did.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.CapabilityFileRowSchema = exports.CAPABILITY_FILE_ROW_KEYS = exports.CapabilityNameSchema = exports.CapabilityFileHeaderSchema = exports.CAPABILITY_FILE_VERSION = exports.SCAN_AUTHOR = exports.CAPABILITY_FILE_SCHEMA = exports.CAPABILITY_FILE = void 0;
|
|
20
|
+
exports.parseCapabilityFile = parseCapabilityFile;
|
|
21
|
+
exports.renderCapabilityFile = renderCapabilityFile;
|
|
22
|
+
exports.capabilityFileRows = capabilityFileRows;
|
|
23
|
+
exports.mergeCapabilityFile = mergeCapabilityFile;
|
|
24
|
+
exports.capabilityFileFacets = capabilityFileFacets;
|
|
25
|
+
exports.stateCapabilityRow = stateCapabilityRow;
|
|
26
|
+
const zod_1 = require("zod");
|
|
27
|
+
const capabilities_1 = require("@medicine-wheel/capabilities");
|
|
28
|
+
const capability_scan_1 = require("./capability-scan");
|
|
29
|
+
/** Where a repository keeps it, relative to its root. */
|
|
30
|
+
exports.CAPABILITY_FILE = '.miadi/capabilities.jsonl';
|
|
31
|
+
exports.CAPABILITY_FILE_SCHEMA = 'medicine-wheel/repository-capabilities';
|
|
32
|
+
/** `statedBy` of a row the scan wrote. Any other name is a person's, and a rescan keeps its words. */
|
|
33
|
+
exports.SCAN_AUTHOR = 'mw-repomap scan';
|
|
34
|
+
/** The format version this package writes. A reader takes a newer one and reads what it knows. */
|
|
35
|
+
exports.CAPABILITY_FILE_VERSION = 1;
|
|
36
|
+
exports.CapabilityFileHeaderSchema = zod_1.z
|
|
37
|
+
.object({
|
|
38
|
+
schema: zod_1.z.literal(exports.CAPABILITY_FILE_SCHEMA),
|
|
39
|
+
version: zod_1.z.number().int().min(1),
|
|
40
|
+
/** `owner/name`, as the repository was known when the file was written. */
|
|
41
|
+
repository: zod_1.z.string().min(1).max(200),
|
|
42
|
+
})
|
|
43
|
+
.strict();
|
|
44
|
+
/** Control characters never reach a terminal or a page from a file someone else committed. */
|
|
45
|
+
const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
|
|
46
|
+
/** A name the registry can give an id to: printable, at most 214 characters, with a letter or a digit. */
|
|
47
|
+
exports.CapabilityNameSchema = zod_1.z
|
|
48
|
+
.string()
|
|
49
|
+
.min(1)
|
|
50
|
+
.max(214)
|
|
51
|
+
.refine((t) => !CONTROL.test(t), 'a name holds no control character')
|
|
52
|
+
.refine((t) => /[a-z0-9]/i.test(t), 'a name needs a letter or a digit');
|
|
53
|
+
/** A platform capability, `capability:<kebab-case-slug>`: what the platform can do for someone. */
|
|
54
|
+
const PLATFORM_CAPABILITY = /^capability:[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
55
|
+
const CapabilityFileRowObject = zod_1.z
|
|
56
|
+
.object({
|
|
57
|
+
kind: zod_1.z.enum(capability_scan_1.CAPABILITY_KINDS),
|
|
58
|
+
name: exports.CapabilityNameSchema,
|
|
59
|
+
/** `miadi-capability://<owner>/<repo>/<kind>/<name>` */
|
|
60
|
+
address: zod_1.z.string().min(1).max(600).refine((t) => !CONTROL.test(t), 'an address holds no control character'),
|
|
61
|
+
statement: capabilities_1.StatementSchema.and(zod_1.z.string().max(1200, 'a statement is at most 1200 characters').refine((t) => !CONTROL.test(t), 'a statement holds no control character')).optional(),
|
|
62
|
+
status: capabilities_1.StatementStatusSchema,
|
|
63
|
+
/** For a CLI: the package that ships it. */
|
|
64
|
+
package: zod_1.z.string().min(1).max(214).optional(),
|
|
65
|
+
/**
|
|
66
|
+
* The platform capabilities this one serves (`capability:<slug>`, capabilities.spec.md):
|
|
67
|
+
* said by a person or an agent, never by the scan, and kept by every rescan.
|
|
68
|
+
*/
|
|
69
|
+
realizes: zod_1.z
|
|
70
|
+
.array(zod_1.z
|
|
71
|
+
.object({
|
|
72
|
+
capability: zod_1.z.string().regex(PLATFORM_CAPABILITY, 'a platform capability is capability:<kebab-case-slug>'),
|
|
73
|
+
statedBy: zod_1.z.string().min(1).max(200).refine((t) => !CONTROL.test(t) && t !== exports.SCAN_AUTHOR, 'a person or an agent says what a capability realizes'),
|
|
74
|
+
statedAt: zod_1.z.string().datetime({ offset: true }),
|
|
75
|
+
})
|
|
76
|
+
.strict())
|
|
77
|
+
.min(1)
|
|
78
|
+
.max(32)
|
|
79
|
+
.optional(),
|
|
80
|
+
/** `grounding` here is the files that say so, relative to the repository. */
|
|
81
|
+
...capabilities_1.attributionShape,
|
|
82
|
+
})
|
|
83
|
+
.strict();
|
|
84
|
+
/** The keys a row of this version holds. */
|
|
85
|
+
exports.CAPABILITY_FILE_ROW_KEYS = Object.keys(CapabilityFileRowObject.shape);
|
|
86
|
+
exports.CapabilityFileRowSchema = CapabilityFileRowObject.superRefine((row, ctx) => {
|
|
87
|
+
(0, capabilities_1.refineAttribution)(row, ctx);
|
|
88
|
+
(0, capabilities_1.refineStatementPresence)(row.status, row.statement, 'statement', ctx);
|
|
89
|
+
});
|
|
90
|
+
const rowKey = (row) => `${row.kind}/${row.name}`;
|
|
91
|
+
function firstLineEnd(text) {
|
|
92
|
+
const i = text.indexOf('\n');
|
|
93
|
+
return i < 0 ? text.length : i;
|
|
94
|
+
}
|
|
95
|
+
const KNOWN_KINDS = new Set(capability_scan_1.CAPABILITY_KINDS);
|
|
96
|
+
const HEADER_KEYS = new Set(Object.keys(exports.CapabilityFileHeaderSchema.shape));
|
|
97
|
+
const ROW_KEYS = new Set(exports.CAPABILITY_FILE_ROW_KEYS);
|
|
98
|
+
const describeZod = (issue) => (issue.path.length ? `${issue.path.join('.')}: ${issue.message}` : issue.message);
|
|
99
|
+
/** Read the file. Never throws: a bad line is an issue, and the good lines around it are still read. */
|
|
100
|
+
function parseCapabilityFile(text, options = {}) {
|
|
101
|
+
const newer = options.mode === 'write' ? 'error' : 'warning';
|
|
102
|
+
const clean = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
|
|
103
|
+
const lines = clean.split(/\r?\n/);
|
|
104
|
+
const issues = [];
|
|
105
|
+
let header;
|
|
106
|
+
try {
|
|
107
|
+
const raw = JSON.parse(lines[0] ?? '');
|
|
108
|
+
const extra = raw && typeof raw === 'object' ? Object.keys(raw).filter((k) => !HEADER_KEYS.has(k)) : [];
|
|
109
|
+
const known = raw && typeof raw === 'object' ? Object.fromEntries(Object.entries(raw).filter(([k]) => HEADER_KEYS.has(k))) : raw;
|
|
110
|
+
const parsed = exports.CapabilityFileHeaderSchema.safeParse(known);
|
|
111
|
+
if (!parsed.success) {
|
|
112
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line: 1, message: `the first line is not this file's header: ${describeZod(parsed.error.issues[0])}` });
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
header = parsed.data;
|
|
116
|
+
if (extra.length)
|
|
117
|
+
issues.push({ severity: newer, file: exports.CAPABILITY_FILE, line: 1, message: `header keys ${extra.join(', ')} are not known to format version ${exports.CAPABILITY_FILE_VERSION}` });
|
|
118
|
+
if (header.version > exports.CAPABILITY_FILE_VERSION)
|
|
119
|
+
issues.push({ severity: newer, file: exports.CAPABILITY_FILE, line: 1, message: `written in format version ${header.version}; this version reads version ${exports.CAPABILITY_FILE_VERSION} and what it knows of the rest` });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line: 1, message: `not JSON: ${error.message}` });
|
|
124
|
+
}
|
|
125
|
+
// One row per capability: a second row for the same kind and name is reported, and the first one read.
|
|
126
|
+
const seen = new Set();
|
|
127
|
+
const rows = [];
|
|
128
|
+
lines.slice(1).forEach((rawLine, index) => {
|
|
129
|
+
const line = index + 2;
|
|
130
|
+
if (!rawLine.trim())
|
|
131
|
+
return;
|
|
132
|
+
let value;
|
|
133
|
+
try {
|
|
134
|
+
value = JSON.parse(rawLine);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line, message: `not JSON: ${error.message}` });
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
141
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line, message: 'a row is a JSON object' });
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const object = value;
|
|
145
|
+
if (typeof object.kind === 'string' && !KNOWN_KINDS.has(object.kind)) {
|
|
146
|
+
issues.push({ severity: newer, file: exports.CAPABILITY_FILE, line, message: `kind ${JSON.stringify(object.kind)} is not known to format version ${exports.CAPABILITY_FILE_VERSION}; the row is not read` });
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const extra = Object.keys(object).filter((k) => !ROW_KEYS.has(k));
|
|
150
|
+
if (extra.length)
|
|
151
|
+
issues.push({ severity: newer, file: exports.CAPABILITY_FILE, line, message: `keys ${extra.join(', ')} are not known to format version ${exports.CAPABILITY_FILE_VERSION} and are not read` });
|
|
152
|
+
const parsed = exports.CapabilityFileRowSchema.safeParse(Object.fromEntries(Object.entries(object).filter(([k]) => ROW_KEYS.has(k))));
|
|
153
|
+
if (!parsed.success) {
|
|
154
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line, message: parsed.error.issues.map(describeZod).join('; ') });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const row = parsed.data;
|
|
158
|
+
const key = rowKey(row);
|
|
159
|
+
if (seen.has(key)) {
|
|
160
|
+
issues.push({ severity: 'error', file: exports.CAPABILITY_FILE, line, message: `${key} appears more than once; the first row is read` });
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
seen.add(key);
|
|
164
|
+
// The address is the header's repository, the kind and the name; a row that says otherwise is read as it should be.
|
|
165
|
+
if (header) {
|
|
166
|
+
const expected = (0, capability_scan_1.capabilityAddress)(header.repository, row.kind, row.name);
|
|
167
|
+
if (row.address !== expected) {
|
|
168
|
+
issues.push({ severity: 'warning', file: exports.CAPABILITY_FILE, line, message: `address ${row.address} is not this row's; read as ${expected}` });
|
|
169
|
+
row.address = expected;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
rows.push(row);
|
|
173
|
+
});
|
|
174
|
+
return { ...(header ? { header } : {}), rows, issues };
|
|
175
|
+
}
|
|
176
|
+
const KIND_ORDER = new Map(capability_scan_1.CAPABILITY_KINDS.map((k, i) => [k, i]));
|
|
177
|
+
const byKindThenName = (a, b) => (KIND_ORDER.get(a.kind) ?? 9) - (KIND_ORDER.get(b.kind) ?? 9) || (a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
178
|
+
/** The file's text: the header, then one row per line in a fixed order, so a diff shows only what changed. */
|
|
179
|
+
function renderCapabilityFile(repository, rows) {
|
|
180
|
+
const header = { schema: exports.CAPABILITY_FILE_SCHEMA, version: 1, repository: repository.replace(/^repository:/, '') };
|
|
181
|
+
const lines = [...rows].sort(byKindThenName).map((r) => JSON.stringify({
|
|
182
|
+
kind: r.kind,
|
|
183
|
+
name: r.name,
|
|
184
|
+
address: r.address,
|
|
185
|
+
...(r.statement ? { statement: r.statement } : {}),
|
|
186
|
+
status: r.status,
|
|
187
|
+
...(r.package ? { package: r.package } : {}),
|
|
188
|
+
...(r.realizes?.length ? { realizes: r.realizes } : {}),
|
|
189
|
+
statedBy: r.statedBy,
|
|
190
|
+
statedAt: r.statedAt,
|
|
191
|
+
grounding: r.grounding,
|
|
192
|
+
revision: r.revision,
|
|
193
|
+
...(r.revisedBy ? { revisedBy: r.revisedBy } : {}),
|
|
194
|
+
...(r.revisedAt ? { revisedAt: r.revisedAt } : {}),
|
|
195
|
+
}));
|
|
196
|
+
return [JSON.stringify(header), ...lines].join('\n') + '\n';
|
|
197
|
+
}
|
|
198
|
+
/** The rows a scan's artefacts make: one per capability, the files that say so as grounding. */
|
|
199
|
+
function capabilityFileRows(artefacts, ctx) {
|
|
200
|
+
const rows = new Map();
|
|
201
|
+
for (const a of artefacts) {
|
|
202
|
+
const key = rowKey(a);
|
|
203
|
+
const existing = rows.get(key);
|
|
204
|
+
if (existing) {
|
|
205
|
+
if (!existing.grounding.includes(a.path))
|
|
206
|
+
existing.grounding.push(a.path);
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const fits = a.description ? (0, capabilities_1.checkStatement)(a.description).fits : false;
|
|
210
|
+
rows.set(key, {
|
|
211
|
+
kind: a.kind,
|
|
212
|
+
name: a.name,
|
|
213
|
+
address: (0, capability_scan_1.capabilityAddress)(ctx.repository, a.kind, a.name),
|
|
214
|
+
...(fits ? { statement: a.description } : {}),
|
|
215
|
+
status: fits ? 'clear' : 'needs-resolution',
|
|
216
|
+
...(a.package ? { package: a.package } : {}),
|
|
217
|
+
statedBy: exports.SCAN_AUTHOR,
|
|
218
|
+
statedAt: ctx.statedAt,
|
|
219
|
+
grounding: [a.path],
|
|
220
|
+
revision: 'pending',
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return [...rows.values()].sort(byKindThenName);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* What the file should hold after a scan.
|
|
227
|
+
*
|
|
228
|
+
* A row a person wrote (any `statedBy` but {@link SCAN_AUTHOR}) keeps its
|
|
229
|
+
* words, its status and its attribution: `capabilities state` writes one, and
|
|
230
|
+
* so does a hand edit that puts the person's name in `statedBy`. A row the
|
|
231
|
+
* scan wrote takes the scan's statement, and goes back to pending when the
|
|
232
|
+
* statement changed or the files stopped making one. The files and the
|
|
233
|
+
* shipping package are always the scan's. The same rule serves a reader,
|
|
234
|
+
* which merges a committed file with what the commit holds.
|
|
235
|
+
*/
|
|
236
|
+
function mergeCapabilityFile(existing, scanned) {
|
|
237
|
+
const held = new Map(existing.map((r) => [rowKey(r), r]));
|
|
238
|
+
const seen = new Set();
|
|
239
|
+
const rows = [];
|
|
240
|
+
const added = [];
|
|
241
|
+
const changed = [];
|
|
242
|
+
for (const scan of scanned) {
|
|
243
|
+
const key = rowKey(scan);
|
|
244
|
+
seen.add(key);
|
|
245
|
+
const row = held.get(key);
|
|
246
|
+
if (!row) {
|
|
247
|
+
rows.push(scan);
|
|
248
|
+
added.push(key);
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const byPerson = row.statedBy !== exports.SCAN_AUTHOR;
|
|
252
|
+
let next;
|
|
253
|
+
if (byPerson) {
|
|
254
|
+
next = { ...row, address: scan.address, grounding: scan.grounding, ...(scan.package ? { package: scan.package } : {}) };
|
|
255
|
+
}
|
|
256
|
+
else if (row.statement === scan.statement) {
|
|
257
|
+
next = { ...row, address: scan.address, status: scan.status, grounding: scan.grounding, ...(scan.package ? { package: scan.package } : {}) };
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
next = scan;
|
|
261
|
+
}
|
|
262
|
+
// What a capability realizes is never the scan's to say: it stays through every rescan.
|
|
263
|
+
if (row.realizes?.length)
|
|
264
|
+
next = { ...next, realizes: row.realizes };
|
|
265
|
+
if (JSON.stringify(rowForCompare(next)) !== JSON.stringify(rowForCompare(row)))
|
|
266
|
+
changed.push(key);
|
|
267
|
+
rows.push(next);
|
|
268
|
+
}
|
|
269
|
+
const removed = [];
|
|
270
|
+
const keptByPerson = [];
|
|
271
|
+
for (const row of existing) {
|
|
272
|
+
const key = rowKey(row);
|
|
273
|
+
if (seen.has(key))
|
|
274
|
+
continue;
|
|
275
|
+
if (row.statedBy === exports.SCAN_AUTHOR) {
|
|
276
|
+
removed.push(key);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
rows.push(row);
|
|
280
|
+
keptByPerson.push(key);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return { rows: rows.sort(byKindThenName), added, removed, changed, keptByPerson };
|
|
284
|
+
}
|
|
285
|
+
function rowForCompare(row) {
|
|
286
|
+
return { ...row, grounding: [...row.grounding].sort() };
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The file's rows as capability facets of one repository at one commit: the
|
|
290
|
+
* files become `owner/name@commit:path`, the grounding every registry row carries.
|
|
291
|
+
*/
|
|
292
|
+
function capabilityFileFacets(rows, ctx) {
|
|
293
|
+
const where = `${ctx.repository.replace(/^repository:/, '')}@${ctx.commit.slice(0, 12)}`;
|
|
294
|
+
return rows.map((r) => ({
|
|
295
|
+
nodeId: (0, capability_scan_1.capabilityId)(r.kind, r.name),
|
|
296
|
+
name: r.name,
|
|
297
|
+
...(r.statement ? { statement: r.statement } : {}),
|
|
298
|
+
status: r.status,
|
|
299
|
+
providedBy: [ctx.repository],
|
|
300
|
+
statedBy: r.statedBy,
|
|
301
|
+
statedAt: r.statedAt,
|
|
302
|
+
grounding: r.grounding.map((p) => `${where}:${p}`),
|
|
303
|
+
revision: r.revision,
|
|
304
|
+
...(r.revisedBy ? { revisedBy: r.revisedBy } : {}),
|
|
305
|
+
...(r.revisedAt ? { revisedAt: r.revisedAt } : {}),
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
/** A person states or affirms one row. An `error` says why not: no such row, or words that do not fit. */
|
|
309
|
+
function stateCapabilityRow(rows, input) {
|
|
310
|
+
if (input.by.trim() === exports.SCAN_AUTHOR)
|
|
311
|
+
return { error: `"${exports.SCAN_AUTHOR}" is the scan's name: a statement is said by a person` };
|
|
312
|
+
if (CONTROL.test(input.by))
|
|
313
|
+
return { error: 'a name holds no control character' };
|
|
314
|
+
if (input.statement !== undefined && (CONTROL.test(input.statement) || input.statement.length > 1200))
|
|
315
|
+
return { error: 'a statement is at most 1200 printable characters' };
|
|
316
|
+
const key = rowKey(input);
|
|
317
|
+
const row = rows.find((r) => rowKey(r) === key);
|
|
318
|
+
if (!row)
|
|
319
|
+
return { error: `the file holds no ${key}: run capabilities scan --write first` };
|
|
320
|
+
if (input.statement !== undefined) {
|
|
321
|
+
const check = (0, capabilities_1.checkStatement)(input.statement);
|
|
322
|
+
if (!check.fits)
|
|
323
|
+
return { error: check.words === 0 ? 'a statement needs at least one word' : `${check.words} words, the limit is ${check.limit}` };
|
|
324
|
+
}
|
|
325
|
+
else if (!row.statement && !input.realizes) {
|
|
326
|
+
return { error: `${key} has no statement to affirm: give it one` };
|
|
327
|
+
}
|
|
328
|
+
const bad = input.realizes?.find((id) => !PLATFORM_CAPABILITY.test(id));
|
|
329
|
+
if (bad !== undefined)
|
|
330
|
+
return { error: `${bad} is not a platform capability: capability:<kebab-case-slug>` };
|
|
331
|
+
let next = input.statement !== undefined
|
|
332
|
+
? { ...row, statement: input.statement, status: 'clear', statedBy: input.by, statedAt: input.at, revision: 'revised', revisedBy: input.by, revisedAt: input.at }
|
|
333
|
+
: input.realizes
|
|
334
|
+
? // what a row realizes carries its own attribution; the row's statement and its revision stay as they are
|
|
335
|
+
{ ...row }
|
|
336
|
+
: { ...row, revision: 'affirmed', revisedBy: input.by, revisedAt: input.at };
|
|
337
|
+
if (input.realizes) {
|
|
338
|
+
const held = row.realizes ?? [];
|
|
339
|
+
const added = [...new Set(input.realizes)].filter((c) => !held.some((h) => h.capability === c)).map((capability) => ({ capability, statedBy: input.by, statedAt: input.at }));
|
|
340
|
+
next = { ...next, realizes: [...held, ...added] };
|
|
341
|
+
}
|
|
342
|
+
return { rows: rows.map((r) => (rowKey(r) === key ? next : r)) };
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=capability-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-file.js","sourceRoot":"","sources":["../src/capability-file.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAsHH,kDAoEC;AAOD,oDAoBC;AAGD,g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