@medicine-wheel/developer-repository-mapping 0.27.9 → 0.27.10
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 +16 -0
- package/dist/capability-file.d.ts +168 -0
- package/dist/capability-file.d.ts.map +1 -0
- package/dist/capability-file.js +239 -0
- package/dist/capability-file.js.map +1 -0
- package/dist/capability-impact.d.ts +94 -0
- package/dist/capability-impact.d.ts.map +1 -0
- package/dist/capability-impact.js +172 -0
- package/dist/capability-impact.js.map +1 -0
- package/dist/capability-scan.d.ts +115 -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 +124 -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 +37 -1
- package/dist/index.js.map +1 -1
- package/dist/node/capability-scan.d.ts +109 -0
- package/dist/node/capability-scan.d.ts.map +1 -0
- package/dist/node/capability-scan.js +271 -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 +68 -68
- package/package.json +3 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// What a version bump touches, pure. The scan reads each package's version
|
|
3
|
+
// and the ranges it declares on other packages it maps; a `consumes` edge
|
|
4
|
+
// joins a package to each first-party package it depends on, across
|
|
5
|
+
// repositories. `impactOf` answers, for one package: what it consumes
|
|
6
|
+
// (upstream), who consumes it, directly and through others (downstream), and
|
|
7
|
+
// with a bump, which direct consumers' ranges stop reaching the new version.
|
|
8
|
+
// A range published with `workspace:*` pins the exact version, so its
|
|
9
|
+
// consumer is released again after any bump: the drift
|
|
10
|
+
// verify-published-deps reported when hooks-interpreter moved to 0.7.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PackageReadingSchema = void 0;
|
|
13
|
+
exports.consumesEdges = consumesEdges;
|
|
14
|
+
exports.bumpVersion = bumpVersion;
|
|
15
|
+
exports.satisfies = satisfies;
|
|
16
|
+
exports.impactOf = impactOf;
|
|
17
|
+
const zod_1 = require("zod");
|
|
18
|
+
exports.PackageReadingSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
/** `capability:package-…` */
|
|
21
|
+
capability: zod_1.z.string().min(1),
|
|
22
|
+
name: zod_1.z.string().min(1),
|
|
23
|
+
version: zod_1.z.string().min(1).optional(),
|
|
24
|
+
repository: zod_1.z.string().min(1),
|
|
25
|
+
path: zod_1.z.string().min(1),
|
|
26
|
+
commit: zod_1.z.string().min(1),
|
|
27
|
+
/** runtime dependencies as declared (dependencies, peer, optional): name → range */
|
|
28
|
+
dependsOn: zod_1.z.record(zod_1.z.string()),
|
|
29
|
+
/** the commands this package ships */
|
|
30
|
+
bins: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
/** `consumes` edges between the packages read, first-party only. */
|
|
34
|
+
function consumesEdges(packages) {
|
|
35
|
+
const byName = new Map(packages.map((p) => [p.name, p]));
|
|
36
|
+
return packages.flatMap((p) => Object.entries(p.dependsOn).flatMap(([name, range]) => {
|
|
37
|
+
const to = byName.get(name);
|
|
38
|
+
return to && to.name !== p.name ? [{ from: p.capability, to: to.capability, type: "consumes", fromName: p.name, toName: to.name, range }] : [];
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
function parseVersion(v) {
|
|
42
|
+
const m = v ? /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:[-+].*)?$/.exec(v.trim()) : null;
|
|
43
|
+
return m ? [Number(m[1]), Number(m[2] ?? 0), Number(m[3] ?? 0)] : undefined;
|
|
44
|
+
}
|
|
45
|
+
const cmp = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
|
|
46
|
+
function bumpVersion(version, level) {
|
|
47
|
+
const v = parseVersion(version);
|
|
48
|
+
if (!v)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (level === "major")
|
|
51
|
+
return `${v[0] + 1}.0.0`;
|
|
52
|
+
if (level === "minor")
|
|
53
|
+
return `${v[0]}.${v[1] + 1}.0`;
|
|
54
|
+
return `${v[0]}.${v[1]}.${v[2] + 1}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether `version` satisfies `range`, for the forms first-party manifests
|
|
58
|
+
* use: exact, `^`, `~`, `>=`, `*`/`latest`/empty, and pnpm's `workspace:`
|
|
59
|
+
* forms, read as pnpm publishes them against `published` (the consumed
|
|
60
|
+
* package's version when the consumer was released). Undefined for anything
|
|
61
|
+
* else (`||`, `<`, `file:`, git URLs): read it by hand.
|
|
62
|
+
*/
|
|
63
|
+
function satisfies(version, range, published) {
|
|
64
|
+
const r = range.trim();
|
|
65
|
+
if (r.startsWith("workspace:")) {
|
|
66
|
+
const form = r.slice("workspace:".length);
|
|
67
|
+
if (!published)
|
|
68
|
+
return undefined;
|
|
69
|
+
if (form === "*" || form === "")
|
|
70
|
+
return satisfies(version, published);
|
|
71
|
+
if (form === "^" || form === "~")
|
|
72
|
+
return satisfies(version, `${form}${published}`);
|
|
73
|
+
return satisfies(version, form);
|
|
74
|
+
}
|
|
75
|
+
if (r === "*" || r === "" || r === "latest" || r === "x")
|
|
76
|
+
return true;
|
|
77
|
+
const v = parseVersion(version);
|
|
78
|
+
if (!v)
|
|
79
|
+
return undefined;
|
|
80
|
+
if (/^\^/.test(r)) {
|
|
81
|
+
const base = parseVersion(r.slice(1));
|
|
82
|
+
if (!base)
|
|
83
|
+
return undefined;
|
|
84
|
+
if (cmp(v, base) < 0)
|
|
85
|
+
return false;
|
|
86
|
+
if (base[0] > 0)
|
|
87
|
+
return v[0] === base[0];
|
|
88
|
+
if (base[1] > 0)
|
|
89
|
+
return v[0] === 0 && v[1] === base[1];
|
|
90
|
+
return v[0] === 0 && v[1] === 0 && v[2] === base[2];
|
|
91
|
+
}
|
|
92
|
+
if (/^~/.test(r)) {
|
|
93
|
+
const base = parseVersion(r.slice(1));
|
|
94
|
+
return base ? cmp(v, base) >= 0 && v[0] === base[0] && v[1] === base[1] : undefined;
|
|
95
|
+
}
|
|
96
|
+
if (/^>=/.test(r)) {
|
|
97
|
+
const base = parseVersion(r.slice(2));
|
|
98
|
+
return base ? cmp(v, base) >= 0 : undefined;
|
|
99
|
+
}
|
|
100
|
+
if (/^\d/.test(r) && !/[\s|<>]/.test(r)) {
|
|
101
|
+
const base = parseVersion(r);
|
|
102
|
+
return base ? cmp(v, base) === 0 : undefined;
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
/** The impact of a package, found by name (`@miadi/x`) or capability id; undefined when no reading names it. */
|
|
107
|
+
function impactOf(packageOrCapability, packages, bump) {
|
|
108
|
+
const target = packages.find((p) => p.name === packageOrCapability || p.capability === packageOrCapability);
|
|
109
|
+
if (!target)
|
|
110
|
+
return undefined;
|
|
111
|
+
const edges = consumesEdges(packages);
|
|
112
|
+
const byCapability = new Map(packages.map((p) => [p.capability, p]));
|
|
113
|
+
const to = bump && target.version ? bumpVersion(target.version, bump) : undefined;
|
|
114
|
+
const consumes = edges
|
|
115
|
+
.filter((e) => e.from === target.capability)
|
|
116
|
+
.map((e) => {
|
|
117
|
+
const p = byCapability.get(e.to);
|
|
118
|
+
return { name: p.name, capability: p.capability, repository: p.repository, ...(p.version ? { version: p.version } : {}), range: e.range };
|
|
119
|
+
});
|
|
120
|
+
const consumers = [];
|
|
121
|
+
const seen = new Set([target.capability]);
|
|
122
|
+
let frontier = [{ capability: target.capability }];
|
|
123
|
+
for (let depth = 1; frontier.length; depth++) {
|
|
124
|
+
const next = [];
|
|
125
|
+
for (const { capability } of frontier) {
|
|
126
|
+
for (const e of edges.filter((x) => x.to === capability)) {
|
|
127
|
+
if (seen.has(e.from))
|
|
128
|
+
continue;
|
|
129
|
+
seen.add(e.from);
|
|
130
|
+
const p = byCapability.get(e.from);
|
|
131
|
+
const link = {
|
|
132
|
+
name: p.name,
|
|
133
|
+
capability: p.capability,
|
|
134
|
+
repository: p.repository,
|
|
135
|
+
...(p.version ? { version: p.version } : {}),
|
|
136
|
+
range: e.range,
|
|
137
|
+
depth,
|
|
138
|
+
...(depth > 1 ? { via: byCapability.get(capability).name } : {}),
|
|
139
|
+
};
|
|
140
|
+
if (to && target.version) {
|
|
141
|
+
if (depth === 1) {
|
|
142
|
+
const accepts = satisfies(to, e.range, target.version);
|
|
143
|
+
if (accepts !== undefined)
|
|
144
|
+
link.accepts = accepts;
|
|
145
|
+
link.action =
|
|
146
|
+
accepts === true
|
|
147
|
+
? `${e.range} already reaches ${to}`
|
|
148
|
+
: e.range.startsWith("workspace:")
|
|
149
|
+
? `release ${p.name} again: ${e.range} is published as ${e.range === "workspace:*" ? target.version : `${e.range.slice(10)}${target.version}`}, which does not reach ${to}`
|
|
150
|
+
: accepts === false
|
|
151
|
+
? `widen ${e.range} to reach ${to}, then release ${p.name}`
|
|
152
|
+
: `read ${e.range} by hand`;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
link.action = `downstream through ${link.via}`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
consumers.push(link);
|
|
159
|
+
next.push({ capability: e.from });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
frontier = next;
|
|
163
|
+
}
|
|
164
|
+
consumers.sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name));
|
|
165
|
+
return {
|
|
166
|
+
package: { name: target.name, capability: target.capability, ...(target.version ? { version: target.version } : {}), repository: target.repository },
|
|
167
|
+
...(to && bump && target.version ? { bump: { level: bump, from: target.version, to } } : {}),
|
|
168
|
+
consumes,
|
|
169
|
+
consumers,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=capability-impact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-impact.js","sourceRoot":"","sources":["../src/capability-impact.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,sEAAsE;AACtE,6EAA6E;AAC7E,6EAA6E;AAC7E,sEAAsE;AACtE,uDAAuD;AACvD,sEAAsE;;;AAmCtE,sCAQC;AAaD,kCAMC;AASD,8BAiCC;AAgCD,4BA+DC;AArMD,6BAAwB;AAEX,QAAA,oBAAoB,GAAG,OAAC;KAClC,MAAM,CAAC;IACN,6BAA6B;IAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,oFAAoF;IACpF,SAAS,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,sCAAsC;IACtC,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,MAAM,EAAE,CAAC;AAgBZ,oEAAoE;AACpE,SAAgB,aAAa,CAAC,QAAmC;IAC/D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAA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AAE,IAAI,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5F,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities, pure: what a git repository provides, read from its own files.
|
|
3
|
+
* Its packages (package.json), its CLIs (a package's `bin`) and its skills
|
|
4
|
+
* (SKILL.md, or a reader written for a file that defines them in code) become
|
|
5
|
+
* `capability` nodes of @medicine-wheel/capabilities, and the repository
|
|
6
|
+
* `provides` each one. A row states what the files say, never what a model
|
|
7
|
+
* guesses: a description over 55 words is not cut, the row is
|
|
8
|
+
* `needs-resolution` without a statement. Every row is pending until a person
|
|
9
|
+
* reads it.
|
|
10
|
+
*/
|
|
11
|
+
import { type CapabilityFacet } from "@medicine-wheel/capabilities";
|
|
12
|
+
export type CapabilityKind = "package" | "cli" | "skill";
|
|
13
|
+
export declare const CAPABILITY_KINDS: readonly CapabilityKind[];
|
|
14
|
+
/** `capability:<kind>-<slug>`: `@miadi/inquiry-weave` → `capability:package-miadi-inquiry-weave`. */
|
|
15
|
+
export declare function capabilityId(kind: CapabilityKind, name: string): string;
|
|
16
|
+
/** The kind a capability id names, or undefined for a capability no scan wrote. */
|
|
17
|
+
export declare function kindOf(nodeId: string): CapabilityKind | undefined;
|
|
18
|
+
/** One thing a repository's files say it provides. */
|
|
19
|
+
export interface Artefact {
|
|
20
|
+
kind: CapabilityKind;
|
|
21
|
+
name: string;
|
|
22
|
+
/** what the files say it is, uncut */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** the file that says so, relative to the repository */
|
|
25
|
+
path: string;
|
|
26
|
+
/** for a CLI: the package that ships it */
|
|
27
|
+
package?: string;
|
|
28
|
+
}
|
|
29
|
+
/** The fields of a package.json the scan reads. Never throws: an unreadable manifest has no name. */
|
|
30
|
+
export declare function parsePackageJson(text: string): {
|
|
31
|
+
name?: string;
|
|
32
|
+
version?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
bins: string[];
|
|
35
|
+
/** runtime dependencies (dependencies, peerDependencies, optionalDependencies): name → range */
|
|
36
|
+
dependsOn: Record<string, string>;
|
|
37
|
+
};
|
|
38
|
+
/** `name` and `description` from a SKILL.md front matter, plain, quoted or folded (`>`, `|`). */
|
|
39
|
+
export declare function parseSkillFrontMatter(text: string): {
|
|
40
|
+
name?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The folders a repository declares as its packages: `workspaces` of the root
|
|
45
|
+
* package.json (an array, or `{ packages }`), else the `packages:` list of
|
|
46
|
+
* pnpm-workspace.yaml. `.` is the root. Only `dir` and `dir/*` are expanded.
|
|
47
|
+
*/
|
|
48
|
+
export declare function workspaceGlobs(rootPackageJson?: string, pnpmWorkspace?: string): string[];
|
|
49
|
+
/** The package.json paths of a repository's declared packages, among the files it holds. */
|
|
50
|
+
export declare function packageManifests(globs: readonly string[], files: readonly string[]): string[];
|
|
51
|
+
/** The SKILL.md files a repository holds, outside dependencies and archives. */
|
|
52
|
+
/**
|
|
53
|
+
* The address a person cites a capability by, in an episode, an issue, an
|
|
54
|
+
* inquiry, a ceremony diary or a circle turn (Episode 568's Capability
|
|
55
|
+
* Registry, the scheme decided by William on 2026-11-01), for the repository
|
|
56
|
+
* that provides it: `miadi-capability://jgwill/medicine-wheel/cli/mw`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function capabilityAddress(repository: string, kind: CapabilityKind, name: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* A capability a repository defines in code rather than in a file of its own,
|
|
61
|
+
* read by a reader written for that repository and that file, never guessed
|
|
62
|
+
* from a name (Episode 568, P15). `read` gets the file's text at the scanned
|
|
63
|
+
* commit and answers what it defines.
|
|
64
|
+
*/
|
|
65
|
+
export interface CodeReader {
|
|
66
|
+
/** `repository:<owner>/<name>`, compared case-folded */
|
|
67
|
+
repository: string;
|
|
68
|
+
path: string;
|
|
69
|
+
read(text: string): Artefact[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The medicine wheel's skills: `cli/skills.ts` defines each one as a
|
|
73
|
+
* `{ name, title, description, target, … }` record, and `mw skill install` /
|
|
74
|
+
* `mwsrv skill install` write it out as a SKILL.md. The statement is the
|
|
75
|
+
* record's own description.
|
|
76
|
+
*/
|
|
77
|
+
export declare function medicineWheelSkills(text: string): Artefact[];
|
|
78
|
+
/** The readers written so far, one per repository file that defines capabilities in code. */
|
|
79
|
+
export declare const CODE_READERS: readonly CodeReader[];
|
|
80
|
+
export declare function skillFiles(files: readonly string[]): string[];
|
|
81
|
+
export interface CapabilityRowContext {
|
|
82
|
+
/** `repository:<owner>/<name>` */
|
|
83
|
+
repository: string;
|
|
84
|
+
/** the commit the files were read at */
|
|
85
|
+
commit: string;
|
|
86
|
+
observedBy: string;
|
|
87
|
+
/** ISO 8601 */
|
|
88
|
+
observedAt: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Capability rows for one repository. One row per id: two files naming the
|
|
92
|
+
* same skill are one capability with both files as its grounding.
|
|
93
|
+
*/
|
|
94
|
+
export declare function capabilityRows(artefacts: readonly Artefact[], ctx: CapabilityRowContext): CapabilityFacet[];
|
|
95
|
+
/**
|
|
96
|
+
* Rows from several repositories as one inventory: a capability two
|
|
97
|
+
* repositories provide is one row that both provide, with both files as its
|
|
98
|
+
* grounding. The first row read keeps its name and statement.
|
|
99
|
+
*/
|
|
100
|
+
export declare function mergeCapabilityRows(rows: readonly CapabilityFacet[]): CapabilityFacet[];
|
|
101
|
+
/** One `provides` edge: a repository provides a capability, said by whoever said the capability. */
|
|
102
|
+
export interface ProvidesEdge {
|
|
103
|
+
from: string;
|
|
104
|
+
to: string;
|
|
105
|
+
type: "provides";
|
|
106
|
+
statedBy: string;
|
|
107
|
+
statedAt: string;
|
|
108
|
+
grounding: string[];
|
|
109
|
+
revision: CapabilityFacet["revision"];
|
|
110
|
+
}
|
|
111
|
+
/** The `provides` edges a set of capability rows holds, one per provider. */
|
|
112
|
+
export declare function providesEdges(capabilities: readonly CapabilityFacet[]): ProvidesEdge[];
|
|
113
|
+
/** The capabilities a repository provides, matched case-folded, by kind then id. */
|
|
114
|
+
export declare function capabilitiesOf(repository: string, capabilities: readonly CapabilityFacet[]): CapabilityFacet[];
|
|
115
|
+
//# sourceMappingURL=capability-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-scan.d.ts","sourceRoot":"","sources":["../src/capability-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAAgC,CAAC;AAQvF,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAGjE;AAED,sDAAsD;AACtD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAA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wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAAE,GAAG,EAAE,oBAAoB,GAAG,eAAe,EAAE,CAyB3G;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAYvF;AAED,oGAAoG;AACpG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;CACvC;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,YAAY,EAAE,SAAS,eAAe,EAAE,GAAG,YAAY,EAAE,CAYtF;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAG9G"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Capabilities, pure: what a git repository provides, read from its own files.
|
|
4
|
+
* Its packages (package.json), its CLIs (a package's `bin`) and its skills
|
|
5
|
+
* (SKILL.md, or a reader written for a file that defines them in code) become
|
|
6
|
+
* `capability` nodes of @medicine-wheel/capabilities, and the repository
|
|
7
|
+
* `provides` each one. A row states what the files say, never what a model
|
|
8
|
+
* guesses: a description over 55 words is not cut, the row is
|
|
9
|
+
* `needs-resolution` without a statement. Every row is pending until a person
|
|
10
|
+
* reads it.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.CODE_READERS = exports.CAPABILITY_KINDS = void 0;
|
|
14
|
+
exports.capabilityId = capabilityId;
|
|
15
|
+
exports.kindOf = kindOf;
|
|
16
|
+
exports.parsePackageJson = parsePackageJson;
|
|
17
|
+
exports.parseSkillFrontMatter = parseSkillFrontMatter;
|
|
18
|
+
exports.workspaceGlobs = workspaceGlobs;
|
|
19
|
+
exports.packageManifests = packageManifests;
|
|
20
|
+
exports.capabilityAddress = capabilityAddress;
|
|
21
|
+
exports.medicineWheelSkills = medicineWheelSkills;
|
|
22
|
+
exports.skillFiles = skillFiles;
|
|
23
|
+
exports.capabilityRows = capabilityRows;
|
|
24
|
+
exports.mergeCapabilityRows = mergeCapabilityRows;
|
|
25
|
+
exports.providesEdges = providesEdges;
|
|
26
|
+
exports.capabilitiesOf = capabilitiesOf;
|
|
27
|
+
const capabilities_1 = require("@medicine-wheel/capabilities");
|
|
28
|
+
exports.CAPABILITY_KINDS = ["package", "cli", "skill"];
|
|
29
|
+
const slug = (value) => value
|
|
30
|
+
.toLowerCase()
|
|
31
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
32
|
+
.replace(/^-+|-+$/g, "");
|
|
33
|
+
/** `capability:<kind>-<slug>`: `@miadi/inquiry-weave` → `capability:package-miadi-inquiry-weave`. */
|
|
34
|
+
function capabilityId(kind, name) {
|
|
35
|
+
return `capability:${kind}-${slug(name)}`;
|
|
36
|
+
}
|
|
37
|
+
/** The kind a capability id names, or undefined for a capability no scan wrote. */
|
|
38
|
+
function kindOf(nodeId) {
|
|
39
|
+
const m = /^capability:(package|cli|skill)-/.exec(nodeId);
|
|
40
|
+
return m ? m[1] : undefined;
|
|
41
|
+
}
|
|
42
|
+
/** The fields of a package.json the scan reads. Never throws: an unreadable manifest has no name. */
|
|
43
|
+
function parsePackageJson(text) {
|
|
44
|
+
try {
|
|
45
|
+
const p = JSON.parse(text);
|
|
46
|
+
const str = (v) => (typeof v === "string" && v.trim() ? v.trim() : undefined);
|
|
47
|
+
const name = str(p.name);
|
|
48
|
+
const version = str(p.version);
|
|
49
|
+
const description = str(p.description);
|
|
50
|
+
let bins = [];
|
|
51
|
+
if (typeof p.bin === "string" && name)
|
|
52
|
+
bins = [name.replace(/^@[^/]+\//, "")];
|
|
53
|
+
else if (p.bin && typeof p.bin === "object")
|
|
54
|
+
bins = Object.keys(p.bin);
|
|
55
|
+
const dependsOn = {};
|
|
56
|
+
for (const key of ["optionalDependencies", "peerDependencies", "dependencies"]) {
|
|
57
|
+
const deps = p[key];
|
|
58
|
+
if (deps && typeof deps === "object") {
|
|
59
|
+
for (const [dep, range] of Object.entries(deps))
|
|
60
|
+
if (typeof range === "string")
|
|
61
|
+
dependsOn[dep] = range;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { ...(name ? { name } : {}), ...(version ? { version } : {}), ...(description ? { description } : {}), bins, dependsOn };
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return { bins: [], dependsOn: {} };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** `name` and `description` from a SKILL.md front matter, plain, quoted or folded (`>`, `|`). */
|
|
71
|
+
function parseSkillFrontMatter(text) {
|
|
72
|
+
const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
|
|
73
|
+
if (!m)
|
|
74
|
+
return {};
|
|
75
|
+
const lines = m[1].split(/\r?\n/);
|
|
76
|
+
const field = (key) => {
|
|
77
|
+
const i = lines.findIndex((l) => new RegExp(`^${key}:`).test(l));
|
|
78
|
+
if (i < 0)
|
|
79
|
+
return undefined;
|
|
80
|
+
let value = lines[i].slice(key.length + 1).trim();
|
|
81
|
+
if (/^[>|][+-]?$/.test(value)) {
|
|
82
|
+
const folded = [];
|
|
83
|
+
for (const l of lines.slice(i + 1)) {
|
|
84
|
+
if (/^\S/.test(l))
|
|
85
|
+
break;
|
|
86
|
+
folded.push(l.trim());
|
|
87
|
+
}
|
|
88
|
+
value = folded.join(" ").trim();
|
|
89
|
+
}
|
|
90
|
+
value = value.replace(/^(["'])([\s\S]*)\1$/, "$2").trim();
|
|
91
|
+
return value || undefined;
|
|
92
|
+
};
|
|
93
|
+
const name = field("name");
|
|
94
|
+
const description = field("description");
|
|
95
|
+
return { ...(name ? { name } : {}), ...(description ? { description } : {}) };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The folders a repository declares as its packages: `workspaces` of the root
|
|
99
|
+
* package.json (an array, or `{ packages }`), else the `packages:` list of
|
|
100
|
+
* pnpm-workspace.yaml. `.` is the root. Only `dir` and `dir/*` are expanded.
|
|
101
|
+
*/
|
|
102
|
+
function workspaceGlobs(rootPackageJson, pnpmWorkspace) {
|
|
103
|
+
try {
|
|
104
|
+
const root = rootPackageJson ? JSON.parse(rootPackageJson) : {};
|
|
105
|
+
const w = root.workspaces;
|
|
106
|
+
const list = Array.isArray(w) ? w : w && typeof w === "object" ? w.packages : undefined;
|
|
107
|
+
if (Array.isArray(list) && list.length)
|
|
108
|
+
return [".", ...list.filter((x) => typeof x === "string")];
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// an unreadable root manifest declares nothing
|
|
112
|
+
}
|
|
113
|
+
if (pnpmWorkspace) {
|
|
114
|
+
const block = /(^|\n)packages:\s*\n((?:[ \t]+-[^\n]*\n?)+)/.exec(pnpmWorkspace);
|
|
115
|
+
if (block) {
|
|
116
|
+
return block[2]
|
|
117
|
+
.split("\n")
|
|
118
|
+
.map((l) => l.replace(/^[ \t]+-\s*/, "").replace(/\s+#.*$/, "").replace(/^['"]|['"]$/g, "").trim())
|
|
119
|
+
.filter(Boolean);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return ["."];
|
|
123
|
+
}
|
|
124
|
+
/** The package.json paths of a repository's declared packages, among the files it holds. */
|
|
125
|
+
function packageManifests(globs, files) {
|
|
126
|
+
const manifests = new Set();
|
|
127
|
+
const held = new Set(files);
|
|
128
|
+
for (const glob of globs) {
|
|
129
|
+
const dir = glob.replace(/^\.\//, "").replace(/\/+$/, "");
|
|
130
|
+
if (dir === "." || dir === "") {
|
|
131
|
+
if (held.has("package.json"))
|
|
132
|
+
manifests.add("package.json");
|
|
133
|
+
}
|
|
134
|
+
else if (dir.endsWith("/*")) {
|
|
135
|
+
const base = `${dir.slice(0, -2)}/`;
|
|
136
|
+
for (const f of files) {
|
|
137
|
+
const rest = f.startsWith(base) ? f.slice(base.length) : "";
|
|
138
|
+
if (/^[^/]+\/package\.json$/.test(rest))
|
|
139
|
+
manifests.add(f);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (held.has(`${dir}/package.json`)) {
|
|
143
|
+
manifests.add(`${dir}/package.json`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return [...manifests].sort();
|
|
147
|
+
}
|
|
148
|
+
/** The SKILL.md files a repository holds, outside dependencies and archives. */
|
|
149
|
+
/**
|
|
150
|
+
* The address a person cites a capability by, in an episode, an issue, an
|
|
151
|
+
* inquiry, a ceremony diary or a circle turn (Episode 568's Capability
|
|
152
|
+
* Registry, the scheme decided by William on 2026-11-01), for the repository
|
|
153
|
+
* that provides it: `miadi-capability://jgwill/medicine-wheel/cli/mw`.
|
|
154
|
+
*/
|
|
155
|
+
function capabilityAddress(repository, kind, name) {
|
|
156
|
+
return `miadi-capability://${repository.replace(/^repository:/, "")}/${kind}/${name}`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The medicine wheel's skills: `cli/skills.ts` defines each one as a
|
|
160
|
+
* `{ name, title, description, target, … }` record, and `mw skill install` /
|
|
161
|
+
* `mwsrv skill install` write it out as a SKILL.md. The statement is the
|
|
162
|
+
* record's own description.
|
|
163
|
+
*/
|
|
164
|
+
function medicineWheelSkills(text) {
|
|
165
|
+
const out = [];
|
|
166
|
+
const re = /\{\s*name:\s*'([a-z0-9][a-z0-9-]*)',\s*title:\s*'(?:[^'\\\n]|\\.)*',\s*description:\s*'((?:[^'\\\n]|\\.)*)',\s*target:\s*'(?:cli|srv)'/g;
|
|
167
|
+
for (const m of text.matchAll(re)) {
|
|
168
|
+
out.push({ kind: "skill", name: m[1], description: m[2].replace(/\\(.)/g, "$1"), path: "cli/skills.ts" });
|
|
169
|
+
}
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
/** The readers written so far, one per repository file that defines capabilities in code. */
|
|
173
|
+
exports.CODE_READERS = [
|
|
174
|
+
{ repository: "repository:jgwill/medicine-wheel", path: "cli/skills.ts", read: medicineWheelSkills },
|
|
175
|
+
];
|
|
176
|
+
function skillFiles(files) {
|
|
177
|
+
return files
|
|
178
|
+
.filter((f) => /(^|\/)SKILL\.md$/.test(f))
|
|
179
|
+
.filter((f) => !/(^|\/)(node_modules|archives?|archived-[^/]*|dist|\.next)\//.test(f))
|
|
180
|
+
.sort();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Capability rows for one repository. One row per id: two files naming the
|
|
184
|
+
* same skill are one capability with both files as its grounding.
|
|
185
|
+
*/
|
|
186
|
+
function capabilityRows(artefacts, ctx) {
|
|
187
|
+
const where = `${ctx.repository.replace(/^repository:/, "")}@${ctx.commit.slice(0, 12)}`;
|
|
188
|
+
const rows = new Map();
|
|
189
|
+
for (const a of artefacts) {
|
|
190
|
+
const nodeId = capabilityId(a.kind, a.name);
|
|
191
|
+
const grounding = `${where}:${a.path}`;
|
|
192
|
+
const existing = rows.get(nodeId);
|
|
193
|
+
if (existing) {
|
|
194
|
+
if (!existing.grounding.includes(grounding))
|
|
195
|
+
existing.grounding.push(grounding);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const fits = a.description ? (0, capabilities_1.checkStatement)(a.description).fits : false;
|
|
199
|
+
rows.set(nodeId, {
|
|
200
|
+
nodeId,
|
|
201
|
+
name: a.name,
|
|
202
|
+
...(fits ? { statement: a.description } : {}),
|
|
203
|
+
status: fits ? "clear" : "needs-resolution",
|
|
204
|
+
providedBy: [ctx.repository],
|
|
205
|
+
statedBy: ctx.observedBy,
|
|
206
|
+
statedAt: ctx.observedAt,
|
|
207
|
+
grounding: [grounding],
|
|
208
|
+
revision: "pending",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return [...rows.values()];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Rows from several repositories as one inventory: a capability two
|
|
215
|
+
* repositories provide is one row that both provide, with both files as its
|
|
216
|
+
* grounding. The first row read keeps its name and statement.
|
|
217
|
+
*/
|
|
218
|
+
function mergeCapabilityRows(rows) {
|
|
219
|
+
const merged = new Map();
|
|
220
|
+
for (const row of rows) {
|
|
221
|
+
const existing = merged.get(row.nodeId);
|
|
222
|
+
if (!existing) {
|
|
223
|
+
merged.set(row.nodeId, { ...row, providedBy: [...row.providedBy], grounding: [...row.grounding] });
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
for (const p of row.providedBy)
|
|
227
|
+
if (!existing.providedBy.includes(p))
|
|
228
|
+
existing.providedBy.push(p);
|
|
229
|
+
for (const g of row.grounding)
|
|
230
|
+
if (!existing.grounding.includes(g))
|
|
231
|
+
existing.grounding.push(g);
|
|
232
|
+
}
|
|
233
|
+
return [...merged.values()].sort((a, b) => (a.nodeId < b.nodeId ? -1 : a.nodeId > b.nodeId ? 1 : 0));
|
|
234
|
+
}
|
|
235
|
+
/** The `provides` edges a set of capability rows holds, one per provider. */
|
|
236
|
+
function providesEdges(capabilities) {
|
|
237
|
+
return capabilities.flatMap((c) => c.providedBy.map((from) => ({
|
|
238
|
+
from,
|
|
239
|
+
to: c.nodeId,
|
|
240
|
+
type: "provides",
|
|
241
|
+
statedBy: c.statedBy,
|
|
242
|
+
statedAt: c.statedAt,
|
|
243
|
+
grounding: c.grounding,
|
|
244
|
+
revision: c.revision,
|
|
245
|
+
})));
|
|
246
|
+
}
|
|
247
|
+
/** The capabilities a repository provides, matched case-folded, by kind then id. */
|
|
248
|
+
function capabilitiesOf(repository, capabilities) {
|
|
249
|
+
const id = (repository.startsWith("repository:") ? repository : `repository:${repository}`).toLowerCase();
|
|
250
|
+
return capabilities.filter((c) => c.providedBy.some((p) => p.toLowerCase() === id));
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=capability-scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-scan.js","sourceRoot":"","sources":["../src/capability-scan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAeH,oCAEC;AAGD,wBAGC;AAeD,4CA4BC;AAGD,sDAsBC;AAOD,wCAmBC;AAGD,4CAkBC;AASD,8CAEC;AAqBD,kDAOC;AAOD,gCAKC;AAgBD,wCAyBC;AAOD,kDAYC;AAcD,sCAYC;AAGD,wCAGC;AAvRD,+DAAoF;AAIvE,QAAA,gBAAgB,GAA8B,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAEvF,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAC7B,KAAK;KACF,WAAW,EAAE;KACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;KAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAE7B,qGAAqG;AACrG,SAAgB,YAAY,CAAC,IAAoB,EAAE,IAAY;IAC7D,OAAO,cAAc,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5C,CAAC;AAED,mFAAmF;AACnF,SAAgB,MAAM,CAAC,MAAc;IACnC,MAAM,CAAC,GAAG,kCAAkC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAoB,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAcD,qGAAqG;AACrG,SAAgB,gBAAgB,CAAC,IAAY;IAQ3C,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;QAC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,EAAE,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1G,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
* mw-repomap hub [<path>] [--json]
|
|
12
12
|
* mw-repomap serve [<path>] [--port <n>] [--host <address>] [--local]
|
|
13
13
|
* mw-repomap wheel [<path>] [--local]
|
|
14
|
+
* mw-repomap capabilities scan [<clone>] [--write|--check] [--ref <ref>] [--repository <owner/name>]
|
|
15
|
+
* mw-repomap capabilities state <kind>/<name> [<statement>] --by <who> [--clone <path>]
|
|
16
|
+
* mw-repomap capabilities show [<clone>] [--ref <ref>] [--json]
|
|
17
|
+
* mw-repomap capabilities map [<clone>...] [--root <dir>] [--list <file>] [--out <file>] [--packages <file>] [--ref <ref>] [--json]
|
|
14
18
|
*
|
|
15
19
|
* <path> is a mapping folder, or an owner hub clone holding
|
|
16
20
|
* .miadi/repository-mapping/; the current directory when absent. A meta hub
|
|
@@ -20,6 +24,11 @@
|
|
|
20
24
|
* `observe --write` and `move` rewrite the folder's JSONL, and refuse while
|
|
21
25
|
* any row fails to parse: a row that did not parse would not be written back.
|
|
22
26
|
*
|
|
27
|
+
* `capabilities scan --write` keeps .miadi/capabilities.jsonl in the clone's
|
|
28
|
+
* working tree and commits nothing. `--check` writes nothing and exits 1 when
|
|
29
|
+
* the file would change. `capabilities map` goes through clones, reads each
|
|
30
|
+
* one's own file or its files, and prints one map.
|
|
31
|
+
*
|
|
23
32
|
* Exit codes: 0 done, 1 the mapping has errors or a read failed, 2 usage error.
|
|
24
33
|
*/
|
|
25
34
|
export {};
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
|