@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
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities on Node: read a clone at one commit, from git objects, never
|
|
3
|
+
* from its working tree. A clone on another branch or with edits of its own
|
|
4
|
+
* reads the same as a clean one, and every row names the commit it was read
|
|
5
|
+
* at. `readRepositoryCapabilities` takes the repository's own file first;
|
|
6
|
+
* `writeCapabilityFile` writes it; `buildCapabilityMap` goes through many
|
|
7
|
+
* clones and answers one map. Reading runs git ls-tree, git show and git
|
|
8
|
+
* rev-parse only. Writing touches the one file and commits nothing.
|
|
9
|
+
*/
|
|
10
|
+
import type { CapabilityFacet } from '@medicine-wheel/capabilities';
|
|
11
|
+
import type { MappingIssue } from '../types';
|
|
12
|
+
import { type CapabilityKind } from '../capability-scan';
|
|
13
|
+
import { type ConsumesEdge, type PackageReading } from '../capability-impact';
|
|
14
|
+
import { type CapabilityFileMerge, type CapabilityFileRow } from '../capability-file';
|
|
15
|
+
export interface ScanOptions {
|
|
16
|
+
/** the ref to read; default the remote's default branch (`origin/HEAD`), else HEAD */
|
|
17
|
+
ref?: string;
|
|
18
|
+
/** `owner/name` or `repository:owner/name`; default from the `origin` remote */
|
|
19
|
+
repository?: string;
|
|
20
|
+
observedBy: string;
|
|
21
|
+
now?: Date;
|
|
22
|
+
}
|
|
23
|
+
export interface ScanResult {
|
|
24
|
+
repository: string;
|
|
25
|
+
ref: string;
|
|
26
|
+
commit: string;
|
|
27
|
+
capabilities: CapabilityFacet[];
|
|
28
|
+
/** each package's version, the ranges it declares and the commands it ships, all of them */
|
|
29
|
+
packages: PackageReading[];
|
|
30
|
+
/** the rows this commit's files make, as the repository's own file would hold them */
|
|
31
|
+
fileRows: CapabilityFileRow[];
|
|
32
|
+
/** what could not be read: a package.json that is not JSON, a name no id can be made from */
|
|
33
|
+
issues: MappingIssue[];
|
|
34
|
+
}
|
|
35
|
+
export declare function scanRepository(clone: string, options: ScanOptions): Promise<ScanResult>;
|
|
36
|
+
/** A provided capability serves a platform capability (`capability:<slug>`), said by a person in the repository's file. */
|
|
37
|
+
export interface RealizesEdge {
|
|
38
|
+
/** the provided capability's id, `capability:<kind>-<slug>` */
|
|
39
|
+
from: string;
|
|
40
|
+
/** the platform capability, `capability:<slug>` */
|
|
41
|
+
to: string;
|
|
42
|
+
type: 'realizes';
|
|
43
|
+
repository: string;
|
|
44
|
+
statedBy: string;
|
|
45
|
+
statedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface RepositoryCapabilities extends ScanResult {
|
|
48
|
+
/** what the file says each capability serves; none when the repository holds no file */
|
|
49
|
+
realizes: RealizesEdge[];
|
|
50
|
+
/** `file` when the commit holds the repository's own file, `scan` when only its files were read */
|
|
51
|
+
source: 'file' | 'scan';
|
|
52
|
+
issues: MappingIssue[];
|
|
53
|
+
/** with a file: how it differs from what the commit's files say */
|
|
54
|
+
drift?: Pick<CapabilityFileMerge, 'added' | 'removed' | 'changed' | 'keptByPerson'>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* What a repository provides at one commit: its own file when the commit
|
|
58
|
+
* holds one, merged with what the commit's files say by the rule a rescan
|
|
59
|
+
* uses, so a file behind its repository still answers every capability.
|
|
60
|
+
* Versions and ranges always come from the commit's package.json files.
|
|
61
|
+
*/
|
|
62
|
+
export declare function readRepositoryCapabilities(clone: string, options: ScanOptions): Promise<RepositoryCapabilities>;
|
|
63
|
+
export interface WriteCapabilityFileResult extends Pick<CapabilityFileMerge, 'added' | 'removed' | 'changed' | 'keptByPerson'> {
|
|
64
|
+
file: string;
|
|
65
|
+
text: string;
|
|
66
|
+
/** the repository the file is written for: its header's when it has one, else the scan's */
|
|
67
|
+
repository: string;
|
|
68
|
+
/** the file would change (or does not exist yet) */
|
|
69
|
+
differs: boolean;
|
|
70
|
+
wrote: boolean;
|
|
71
|
+
/** the repository's ignore rules match the file, so `git add` would leave it out */
|
|
72
|
+
ignored: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Bring the working tree's file up to what a scan found, keeping what a person
|
|
76
|
+
* wrote. With `write: false` nothing is touched and `differs` says whether a
|
|
77
|
+
* write would change it. Refuses a file with a bad line, because a line that
|
|
78
|
+
* did not parse would not be written back.
|
|
79
|
+
*/
|
|
80
|
+
export declare function writeCapabilityFile(clone: string, scan: ScanResult, options: {
|
|
81
|
+
write: boolean; /** names the repository instead of the file's header */
|
|
82
|
+
repository?: string;
|
|
83
|
+
}): Promise<WriteCapabilityFileResult>;
|
|
84
|
+
/** A person states or affirms one capability in the working tree's file. */
|
|
85
|
+
export declare function stateCapability(clone: string, input: {
|
|
86
|
+
kind: CapabilityKind;
|
|
87
|
+
name: string;
|
|
88
|
+
by: string;
|
|
89
|
+
statement?: string;
|
|
90
|
+
realizes?: string[];
|
|
91
|
+
now?: Date;
|
|
92
|
+
}): Promise<{
|
|
93
|
+
file: string;
|
|
94
|
+
row: CapabilityFileRow;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* The git clones under a folder: itself when it is one, else its children, or
|
|
98
|
+
* `owner/name` two levels down. Hidden folders are skipped, a symlinked folder
|
|
99
|
+
* is followed once, and a folder that cannot be read is skipped and said
|
|
100
|
+
* through `onSkip`, so one locked folder never stops the others.
|
|
101
|
+
*/
|
|
102
|
+
export declare function findClones(root: string, options?: {
|
|
103
|
+
onSkip?: (dir: string, reason: string) => void;
|
|
104
|
+
}): string[];
|
|
105
|
+
export interface CapabilityMapRepository {
|
|
106
|
+
clone: string;
|
|
107
|
+
repository?: string;
|
|
108
|
+
commit?: string;
|
|
109
|
+
source?: 'file' | 'scan';
|
|
110
|
+
counts?: {
|
|
111
|
+
package: number;
|
|
112
|
+
cli: number;
|
|
113
|
+
skill: number;
|
|
114
|
+
};
|
|
115
|
+
issues: MappingIssue[];
|
|
116
|
+
drift?: RepositoryCapabilities['drift'];
|
|
117
|
+
/** why this clone could not be read */
|
|
118
|
+
error?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface CapabilityMap {
|
|
121
|
+
repositories: CapabilityMapRepository[];
|
|
122
|
+
/** ids that two different names make (`@a/b` and `a-b`): one row stands for both, and that is said */
|
|
123
|
+
collisions: {
|
|
124
|
+
nodeId: string;
|
|
125
|
+
names: string[];
|
|
126
|
+
}[];
|
|
127
|
+
/** one row per capability; a capability two repositories provide is one row both provide */
|
|
128
|
+
capabilities: CapabilityFacet[];
|
|
129
|
+
packages: PackageReading[];
|
|
130
|
+
/** which package consumes which, across every repository read */
|
|
131
|
+
consumes: ConsumesEdge[];
|
|
132
|
+
/** what each repository's file says its capabilities serve */
|
|
133
|
+
realizes: RealizesEdge[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Go through clones and answer one map of what they provide. A clone that
|
|
137
|
+
* cannot be read is reported and the others are still read.
|
|
138
|
+
*/
|
|
139
|
+
export declare function buildCapabilityMap(clones: readonly string[], options: {
|
|
140
|
+
observedBy: string;
|
|
141
|
+
ref?: string;
|
|
142
|
+
now?: Date;
|
|
143
|
+
}): Promise<CapabilityMap>;
|
|
144
|
+
//# sourceMappingURL=capability-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-scan.d.ts","sourceRoot":"","sources":["../../src/node/capability-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAYL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAqB5B,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,EAAE,iBAAiB,EAAE,C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B;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,uBAAuB,EAAE,CAAC;IACxC,sGAAsG;IACtG,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAClD,4FAA4F;IAC5F,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CA+BrJ"}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Capabilities on Node: read a clone at one commit, from git objects, never
|
|
4
|
+
* from its working tree. A clone on another branch or with edits of its own
|
|
5
|
+
* reads the same as a clean one, and every row names the commit it was read
|
|
6
|
+
* at. `readRepositoryCapabilities` takes the repository's own file first;
|
|
7
|
+
* `writeCapabilityFile` writes it; `buildCapabilityMap` goes through many
|
|
8
|
+
* clones and answers one map. Reading runs git ls-tree, git show and git
|
|
9
|
+
* rev-parse only. Writing touches the one file and commits nothing.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.scanRepository = scanRepository;
|
|
46
|
+
exports.readRepositoryCapabilities = readRepositoryCapabilities;
|
|
47
|
+
exports.writeCapabilityFile = writeCapabilityFile;
|
|
48
|
+
exports.stateCapability = stateCapability;
|
|
49
|
+
exports.findClones = findClones;
|
|
50
|
+
exports.buildCapabilityMap = buildCapabilityMap;
|
|
51
|
+
const node_child_process_1 = require("node:child_process");
|
|
52
|
+
const node_fs_1 = require("node:fs");
|
|
53
|
+
const path = __importStar(require("node:path"));
|
|
54
|
+
const node_util_1 = require("node:util");
|
|
55
|
+
const ids_1 = require("../ids");
|
|
56
|
+
const capability_scan_1 = require("../capability-scan");
|
|
57
|
+
const capability_impact_1 = require("../capability-impact");
|
|
58
|
+
const capability_file_1 = require("../capability-file");
|
|
59
|
+
const run = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
60
|
+
async function git(clone, args) {
|
|
61
|
+
try {
|
|
62
|
+
const { stdout } = await run('git', ['-C', clone, ...args], { maxBuffer: 256 * 1024 * 1024 });
|
|
63
|
+
return stdout;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** `owner/name` from any remote URL: GitHub's forms first, else the last two path segments. */
|
|
70
|
+
function remoteRepository(url) {
|
|
71
|
+
const github = (0, ids_1.parseGithubRemote)(url);
|
|
72
|
+
if (github)
|
|
73
|
+
return github;
|
|
74
|
+
const m = /([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?\/?$/.exec(url.trim());
|
|
75
|
+
return m && m[1] && m[2] ? { owner: m[1], name: m[2] } : undefined;
|
|
76
|
+
}
|
|
77
|
+
async function scanRepository(clone, options) {
|
|
78
|
+
if ((await git(clone, ['rev-parse', '--git-dir'])) === undefined)
|
|
79
|
+
throw new Error(`not a git clone: ${clone}`);
|
|
80
|
+
const ref = options.ref ?? ((await git(clone, ['rev-parse', '--verify', '-q', 'origin/HEAD'])) ? 'origin/HEAD' : 'HEAD');
|
|
81
|
+
const commit = (await git(clone, ['rev-parse', '--verify', `${ref}^{commit}`]))?.trim();
|
|
82
|
+
if (!commit)
|
|
83
|
+
throw new Error(`${clone}: no commit at ${ref}`);
|
|
84
|
+
let repository = options.repository
|
|
85
|
+
? options.repository.startsWith('repository:')
|
|
86
|
+
? options.repository
|
|
87
|
+
: `repository:${options.repository}`
|
|
88
|
+
: undefined;
|
|
89
|
+
if (!repository) {
|
|
90
|
+
const remote = remoteRepository((await git(clone, ['remote', 'get-url', 'origin']))?.trim() ?? '');
|
|
91
|
+
if (!remote)
|
|
92
|
+
throw new Error(`${clone}: no origin remote to name it by; pass --repository owner/name`);
|
|
93
|
+
repository = (0, ids_1.repositoryNodeId)(remote.owner, remote.name);
|
|
94
|
+
}
|
|
95
|
+
// -z: a path with a character git would quote (é, a space, a tab) is read as it is.
|
|
96
|
+
const files = ((await git(clone, ['ls-tree', '-r', '-z', '--name-only', commit])) ?? '').split('\0').filter(Boolean);
|
|
97
|
+
const show = (file) => git(clone, ['show', `${commit}:${file}`]);
|
|
98
|
+
const globs = (0, capability_scan_1.workspaceGlobs)(await show('package.json'), files.includes('pnpm-workspace.yaml') ? await show('pnpm-workspace.yaml') : undefined);
|
|
99
|
+
const artefacts = [];
|
|
100
|
+
const packages = [];
|
|
101
|
+
const issues = [];
|
|
102
|
+
for (const manifest of (0, capability_scan_1.packageManifests)(globs, files)) {
|
|
103
|
+
const text = (await show(manifest)) ?? '';
|
|
104
|
+
try {
|
|
105
|
+
JSON.parse(text);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
issues.push({ severity: 'error', file: manifest, message: `not JSON, so its package and commands are not read: ${error.message}` });
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const pkg = (0, capability_scan_1.parsePackageJson)(text);
|
|
112
|
+
if (!pkg.name)
|
|
113
|
+
continue;
|
|
114
|
+
// A private package is read for what consumes what, and not listed as something the repository provides.
|
|
115
|
+
packages.push({
|
|
116
|
+
capability: (0, capability_scan_1.capabilityId)('package', pkg.name),
|
|
117
|
+
name: pkg.name,
|
|
118
|
+
...(pkg.version ? { version: pkg.version } : {}),
|
|
119
|
+
repository,
|
|
120
|
+
path: manifest,
|
|
121
|
+
commit: commit.slice(0, 12),
|
|
122
|
+
dependsOn: pkg.dependsOn,
|
|
123
|
+
...(pkg.bins.length ? { bins: pkg.bins } : {}),
|
|
124
|
+
...(pkg.private ? { private: true } : {}),
|
|
125
|
+
});
|
|
126
|
+
if (pkg.private)
|
|
127
|
+
continue;
|
|
128
|
+
artefacts.push({ kind: 'package', name: pkg.name, ...(pkg.description ? { description: pkg.description } : {}), path: manifest });
|
|
129
|
+
for (const bin of pkg.bins) {
|
|
130
|
+
artefacts.push({ kind: 'cli', name: bin, description: `The ${bin} command, shipped by ${pkg.name}.`, path: manifest, package: pkg.name });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (const file of (0, capability_scan_1.skillFiles)(files)) {
|
|
134
|
+
const front = (0, capability_scan_1.parseSkillFrontMatter)((await show(file)) ?? '');
|
|
135
|
+
const name = front.name ?? file.split('/').slice(-2, -1)[0];
|
|
136
|
+
if (!name)
|
|
137
|
+
continue;
|
|
138
|
+
artefacts.push({ kind: 'skill', name, ...(front.description ? { description: front.description } : {}), path: file });
|
|
139
|
+
}
|
|
140
|
+
// Capabilities defined in code, each by the reader written for its repository's file.
|
|
141
|
+
for (const reader of capability_scan_1.CODE_READERS) {
|
|
142
|
+
if (reader.repository.toLowerCase() !== repository.toLowerCase() || !files.includes(reader.path))
|
|
143
|
+
continue;
|
|
144
|
+
artefacts.push(...reader.read((await show(reader.path)) ?? ''));
|
|
145
|
+
}
|
|
146
|
+
// A name no id can be made from, or one carrying control characters, is reported and not read.
|
|
147
|
+
const readable = artefacts.filter((a) => {
|
|
148
|
+
const named = capability_file_1.CapabilityNameSchema.safeParse(a.name);
|
|
149
|
+
if (!named.success)
|
|
150
|
+
issues.push({ severity: 'warning', file: a.path, message: `${a.kind} name ${JSON.stringify(a.name)} is not read: ${named.error.issues[0]?.message}` });
|
|
151
|
+
return named.success;
|
|
152
|
+
});
|
|
153
|
+
const observedAt = (options.now ?? new Date()).toISOString();
|
|
154
|
+
return {
|
|
155
|
+
repository,
|
|
156
|
+
ref,
|
|
157
|
+
commit,
|
|
158
|
+
capabilities: (0, capability_scan_1.capabilityRows)(readable, { repository, commit, observedBy: options.observedBy, observedAt }),
|
|
159
|
+
packages,
|
|
160
|
+
fileRows: (0, capability_file_1.capabilityFileRows)(readable, { repository, statedAt: observedAt }),
|
|
161
|
+
issues,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* What a repository provides at one commit: its own file when the commit
|
|
166
|
+
* holds one, merged with what the commit's files say by the rule a rescan
|
|
167
|
+
* uses, so a file behind its repository still answers every capability.
|
|
168
|
+
* Versions and ranges always come from the commit's package.json files.
|
|
169
|
+
*/
|
|
170
|
+
async function readRepositoryCapabilities(clone, options) {
|
|
171
|
+
const scan = await scanRepository(clone, options);
|
|
172
|
+
const text = await git(clone, ['show', `${scan.commit}:${capability_file_1.CAPABILITY_FILE}`]);
|
|
173
|
+
if (text === undefined)
|
|
174
|
+
return { ...scan, source: 'scan', realizes: [] };
|
|
175
|
+
const parsed = (0, capability_file_1.parseCapabilityFile)(text);
|
|
176
|
+
const merge = (0, capability_file_1.mergeCapabilityFile)(parsed.rows, scan.fileRows);
|
|
177
|
+
const issues = [...scan.issues, ...parsed.issues];
|
|
178
|
+
const named = `repository:${parsed.header?.repository ?? ''}`;
|
|
179
|
+
if (parsed.header && named.toLowerCase() !== scan.repository.toLowerCase()) {
|
|
180
|
+
issues.push({ severity: 'warning', file: capability_file_1.CAPABILITY_FILE, message: `written for ${parsed.header.repository}; this clone's origin is ${scan.repository.replace(/^repository:/, '')}` });
|
|
181
|
+
}
|
|
182
|
+
// A row the commit does not provide is the file's claim, not the repository's: reported, never read as a capability.
|
|
183
|
+
const grounded = merge.rows.filter((r) => {
|
|
184
|
+
const found = scan.fileRows.some((s) => s.kind === r.kind && s.name === r.name);
|
|
185
|
+
if (!found)
|
|
186
|
+
issues.push({ severity: 'warning', file: capability_file_1.CAPABILITY_FILE, message: `${r.kind}/${r.name} is in the file but this commit provides no such ${r.kind}; it is not read` });
|
|
187
|
+
return found;
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
...scan,
|
|
191
|
+
capabilities: (0, capability_file_1.capabilityFileFacets)(grounded, { repository: scan.repository, commit: scan.commit }),
|
|
192
|
+
realizes: grounded.flatMap((r) => (r.realizes ?? []).map((x) => ({ from: (0, capability_scan_1.capabilityId)(r.kind, r.name), to: x.capability, type: 'realizes', repository: scan.repository, statedBy: x.statedBy, statedAt: x.statedAt }))),
|
|
193
|
+
source: 'file',
|
|
194
|
+
issues,
|
|
195
|
+
drift: { added: merge.added, removed: merge.removed, changed: merge.changed, keptByPerson: merge.keptByPerson },
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
async function workingRoot(clone) {
|
|
199
|
+
const root = (await git(clone, ['rev-parse', '--show-toplevel']))?.trim();
|
|
200
|
+
if (!root)
|
|
201
|
+
throw new Error(`not a git working tree: ${clone}`);
|
|
202
|
+
return root;
|
|
203
|
+
}
|
|
204
|
+
/** The working tree's file, read to be rewritten: anything this version does not know is an error, because the rewrite would lose it. */
|
|
205
|
+
function readWorkingFile(file) {
|
|
206
|
+
return (0, node_fs_1.existsSync)(file) ? (0, capability_file_1.parseCapabilityFile)((0, node_fs_1.readFileSync)(file, 'utf8'), { mode: 'write' }) : undefined;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Bring the working tree's file up to what a scan found, keeping what a person
|
|
210
|
+
* wrote. With `write: false` nothing is touched and `differs` says whether a
|
|
211
|
+
* write would change it. Refuses a file with a bad line, because a line that
|
|
212
|
+
* did not parse would not be written back.
|
|
213
|
+
*/
|
|
214
|
+
async function writeCapabilityFile(clone, scan, options) {
|
|
215
|
+
const root = await workingRoot(clone);
|
|
216
|
+
const file = path.join(root, capability_file_1.CAPABILITY_FILE);
|
|
217
|
+
const current = readWorkingFile(file);
|
|
218
|
+
const bad = current?.issues.find((i) => i.severity === 'error');
|
|
219
|
+
if (bad)
|
|
220
|
+
throw new Error(`${capability_file_1.CAPABILITY_FILE}${bad.line ? `:${bad.line}` : ''}: ${bad.message} (nothing was written)`);
|
|
221
|
+
const unread = scan.issues.find((i) => i.severity === 'error');
|
|
222
|
+
if (unread)
|
|
223
|
+
throw new Error(`${unread.file}: ${unread.message}; its rows would be removed, so nothing was written`);
|
|
224
|
+
// A fork, a mirror or a remote spelled in another case keeps the repository the file was written for.
|
|
225
|
+
const named = options.repository?.replace(/^repository:/, '') ?? current?.header?.repository ?? scan.repository.replace(/^repository:/, '');
|
|
226
|
+
const scanned = scan.fileRows.map((r) => ({ ...r, address: (0, capability_scan_1.capabilityAddress)(named, r.kind, r.name) }));
|
|
227
|
+
const merge = (0, capability_file_1.mergeCapabilityFile)(current?.rows ?? [], scanned);
|
|
228
|
+
const text = (0, capability_file_1.renderCapabilityFile)(named, merge.rows);
|
|
229
|
+
const differs = !(0, node_fs_1.existsSync)(file) || (0, node_fs_1.readFileSync)(file, 'utf8') !== text;
|
|
230
|
+
if (differs && options.write) {
|
|
231
|
+
(0, node_fs_1.mkdirSync)(path.dirname(file), { recursive: true });
|
|
232
|
+
(0, node_fs_1.writeFileSync)(file, text, 'utf8');
|
|
233
|
+
}
|
|
234
|
+
const ignored = (await git(root, ['check-ignore', '-q', '--', capability_file_1.CAPABILITY_FILE])) !== undefined;
|
|
235
|
+
return { file, text, repository: named, differs, wrote: differs && options.write, ignored, added: merge.added, removed: merge.removed, changed: merge.changed, keptByPerson: merge.keptByPerson };
|
|
236
|
+
}
|
|
237
|
+
/** A person states or affirms one capability in the working tree's file. */
|
|
238
|
+
async function stateCapability(clone, input) {
|
|
239
|
+
const root = await workingRoot(clone);
|
|
240
|
+
const file = path.join(root, capability_file_1.CAPABILITY_FILE);
|
|
241
|
+
const current = readWorkingFile(file);
|
|
242
|
+
if (!current)
|
|
243
|
+
throw new Error(`${capability_file_1.CAPABILITY_FILE} does not exist: run capabilities scan --write first`);
|
|
244
|
+
const bad = current.issues.find((i) => i.severity === 'error');
|
|
245
|
+
if (bad)
|
|
246
|
+
throw new Error(`${capability_file_1.CAPABILITY_FILE}${bad.line ? `:${bad.line}` : ''}: ${bad.message} (nothing was written)`);
|
|
247
|
+
if (!current.header)
|
|
248
|
+
throw new Error(`${capability_file_1.CAPABILITY_FILE} has no header line (nothing was written)`);
|
|
249
|
+
const answer = (0, capability_file_1.stateCapabilityRow)(current.rows, {
|
|
250
|
+
kind: input.kind,
|
|
251
|
+
name: input.name,
|
|
252
|
+
by: input.by,
|
|
253
|
+
at: (input.now ?? new Date()).toISOString(),
|
|
254
|
+
...(input.statement !== undefined ? { statement: input.statement } : {}),
|
|
255
|
+
...(input.realizes ? { realizes: input.realizes } : {}),
|
|
256
|
+
});
|
|
257
|
+
if ('error' in answer)
|
|
258
|
+
throw new Error(answer.error);
|
|
259
|
+
(0, node_fs_1.writeFileSync)(file, (0, capability_file_1.renderCapabilityFile)(current.header.repository, answer.rows), 'utf8');
|
|
260
|
+
return { file, row: answer.rows.find((r) => r.kind === input.kind && r.name === input.name) };
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* The git clones under a folder: itself when it is one, else its children, or
|
|
264
|
+
* `owner/name` two levels down. Hidden folders are skipped, a symlinked folder
|
|
265
|
+
* is followed once, and a folder that cannot be read is skipped and said
|
|
266
|
+
* through `onSkip`, so one locked folder never stops the others.
|
|
267
|
+
*/
|
|
268
|
+
function findClones(root, options = {}) {
|
|
269
|
+
const isClone = (dir) => (0, node_fs_1.existsSync)(path.join(dir, '.git'));
|
|
270
|
+
if (isClone(root))
|
|
271
|
+
return [root];
|
|
272
|
+
const seen = new Set();
|
|
273
|
+
const children = (dir) => {
|
|
274
|
+
let entries;
|
|
275
|
+
try {
|
|
276
|
+
entries = (0, node_fs_1.readdirSync)(dir, { withFileTypes: true });
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
options.onSkip?.(dir, error.message);
|
|
280
|
+
return [];
|
|
281
|
+
}
|
|
282
|
+
const out = [];
|
|
283
|
+
for (const d of entries) {
|
|
284
|
+
if (d.name.startsWith('.'))
|
|
285
|
+
continue;
|
|
286
|
+
const full = path.join(dir, d.name);
|
|
287
|
+
let isDir = d.isDirectory();
|
|
288
|
+
if (d.isSymbolicLink()) {
|
|
289
|
+
try {
|
|
290
|
+
isDir = (0, node_fs_1.statSync)(full).isDirectory();
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
options.onSkip?.(full, `a link that does not resolve: ${error.message}`);
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (!isDir)
|
|
298
|
+
continue;
|
|
299
|
+
let real = full;
|
|
300
|
+
try {
|
|
301
|
+
real = (0, node_fs_1.realpathSync)(full);
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
// read it by its own path
|
|
305
|
+
}
|
|
306
|
+
if (seen.has(real))
|
|
307
|
+
continue;
|
|
308
|
+
seen.add(real);
|
|
309
|
+
out.push(full);
|
|
310
|
+
}
|
|
311
|
+
return out;
|
|
312
|
+
};
|
|
313
|
+
const clones = [];
|
|
314
|
+
for (const child of children(root)) {
|
|
315
|
+
if (isClone(child))
|
|
316
|
+
clones.push(child);
|
|
317
|
+
else
|
|
318
|
+
for (const grandchild of children(child))
|
|
319
|
+
if (isClone(grandchild))
|
|
320
|
+
clones.push(grandchild);
|
|
321
|
+
}
|
|
322
|
+
return clones.sort();
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Go through clones and answer one map of what they provide. A clone that
|
|
326
|
+
* cannot be read is reported and the others are still read.
|
|
327
|
+
*/
|
|
328
|
+
async function buildCapabilityMap(clones, options) {
|
|
329
|
+
const repositories = [];
|
|
330
|
+
const facets = [];
|
|
331
|
+
const packages = [];
|
|
332
|
+
const realizes = [];
|
|
333
|
+
for (const clone of clones) {
|
|
334
|
+
try {
|
|
335
|
+
const read = await readRepositoryCapabilities(clone, options);
|
|
336
|
+
const counts = { package: 0, cli: 0, skill: 0 };
|
|
337
|
+
for (const r of read.capabilities) {
|
|
338
|
+
const kind = /^capability:(package|cli|skill)-/.exec(r.nodeId)?.[1];
|
|
339
|
+
if (kind)
|
|
340
|
+
counts[kind] += 1;
|
|
341
|
+
}
|
|
342
|
+
repositories.push({ clone, repository: read.repository, commit: read.commit, source: read.source, counts, issues: read.issues, ...(read.drift ? { drift: read.drift } : {}) });
|
|
343
|
+
facets.push(...read.capabilities);
|
|
344
|
+
packages.push(...read.packages);
|
|
345
|
+
realizes.push(...read.realizes);
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
repositories.push({ clone, issues: [], error: error.message });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// One reading per repository and package: a fork and its upstream each keep their own.
|
|
352
|
+
const seen = new Set();
|
|
353
|
+
const unique = packages.filter((p) => {
|
|
354
|
+
const key = `${p.repository.toLowerCase()}|${p.name}`;
|
|
355
|
+
return seen.has(key) ? false : (seen.add(key), true);
|
|
356
|
+
});
|
|
357
|
+
const names = new Map();
|
|
358
|
+
for (const f of facets)
|
|
359
|
+
names.set(f.nodeId, (names.get(f.nodeId) ?? new Set()).add(f.name));
|
|
360
|
+
const collisions = [...names].filter(([, n]) => n.size > 1).map(([nodeId, n]) => ({ nodeId, names: [...n].sort() }));
|
|
361
|
+
return { repositories, collisions, capabilities: (0, capability_scan_1.mergeCapabilityRows)(facets), packages: unique, consumes: (0, capability_impact_1.consumesEdges)(unique), realizes };
|
|
362
|
+
}
|
|
363
|
+
//# sourceMappingURL=capability-scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-scan.js","sourceRoot":"","sources":["../../src/node/capability-scan.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EH,wCAiFC;AA8BD,gEA2BC;AA+BD,kDAwBC;AAGD,0CAsBC;AAQD,gCA4CC;AA+BD,gDA+BC;AAxZD,2DAA8C;AAC9C,qCAAkH;AAClH,gDAAkC;AAClC,yCAAsC;AAEtC,gCAA6D;AAE7D,wDAa4B;AAC5B,4DAA6F;AAC7F,wDAW4B;AAE5B,MAAM,GAAG,GAAG,IAAA,qBAAS,EAAC,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AAmB,EAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAA,iCAAa,EAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;AAC9I,CAAC"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export type { FetchLike, HubStatus, HubRead, ReadHubOptions } from './hub';
|
|
|
13
13
|
export { createMappingServer, toView, LOOPBACK_HOSTS } from './server';
|
|
14
14
|
export type { MappingView, MappingServerOptions } from './server';
|
|
15
15
|
export { MAPPING_PAGE } from './page';
|
|
16
|
+
export { buildCapabilityMap, findClones, readRepositoryCapabilities, scanRepository, stateCapability, writeCapabilityFile } from './capability-scan';
|
|
17
|
+
export type { CapabilityMap, CapabilityMapRepository, RealizesEdge, RepositoryCapabilities, ScanOptions, ScanResult, WriteCapabilityFileResult } from './capability-scan';
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC3F,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC3F,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,0BAA0B,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrJ,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/node/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* meta hub with every owner hub it registers, and serve the small web page.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.MAPPING_PAGE = exports.LOOPBACK_HOSTS = exports.toView = exports.createMappingServer = exports.HUB_FETCH_TIMEOUT_MS = exports.readHub = exports.readMappingSource = exports.defaultHubSource = exports.originRepository = exports.readActivity = exports.initMappingDir = exports.writeMappingDir = exports.readMappingDir = exports.findMappingDir = void 0;
|
|
10
|
+
exports.writeCapabilityFile = exports.stateCapability = exports.scanRepository = exports.readRepositoryCapabilities = exports.findClones = exports.buildCapabilityMap = exports.MAPPING_PAGE = exports.LOOPBACK_HOSTS = exports.toView = exports.createMappingServer = exports.HUB_FETCH_TIMEOUT_MS = exports.readHub = exports.readMappingSource = exports.defaultHubSource = exports.originRepository = exports.readActivity = exports.initMappingDir = exports.writeMappingDir = exports.readMappingDir = exports.findMappingDir = void 0;
|
|
11
11
|
var fs_1 = require("./fs");
|
|
12
12
|
Object.defineProperty(exports, "findMappingDir", { enumerable: true, get: function () { return fs_1.findMappingDir; } });
|
|
13
13
|
Object.defineProperty(exports, "readMappingDir", { enumerable: true, get: function () { return fs_1.readMappingDir; } });
|
|
@@ -27,4 +27,11 @@ Object.defineProperty(exports, "toView", { enumerable: true, get: function () {
|
|
|
27
27
|
Object.defineProperty(exports, "LOOPBACK_HOSTS", { enumerable: true, get: function () { return server_1.LOOPBACK_HOSTS; } });
|
|
28
28
|
var page_1 = require("./page");
|
|
29
29
|
Object.defineProperty(exports, "MAPPING_PAGE", { enumerable: true, get: function () { return page_1.MAPPING_PAGE; } });
|
|
30
|
+
var capability_scan_1 = require("./capability-scan");
|
|
31
|
+
Object.defineProperty(exports, "buildCapabilityMap", { enumerable: true, get: function () { return capability_scan_1.buildCapabilityMap; } });
|
|
32
|
+
Object.defineProperty(exports, "findClones", { enumerable: true, get: function () { return capability_scan_1.findClones; } });
|
|
33
|
+
Object.defineProperty(exports, "readRepositoryCapabilities", { enumerable: true, get: function () { return capability_scan_1.readRepositoryCapabilities; } });
|
|
34
|
+
Object.defineProperty(exports, "scanRepository", { enumerable: true, get: function () { return capability_scan_1.scanRepository; } });
|
|
35
|
+
Object.defineProperty(exports, "stateCapability", { enumerable: true, get: function () { return capability_scan_1.stateCapability; } });
|
|
36
|
+
Object.defineProperty(exports, "writeCapabilityFile", { enumerable: true, get: function () { return capability_scan_1.writeCapabilityFile; } });
|
|
30
37
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2BAAuF;AAA9E,oGAAA,cAAc,OAAA;AAAE,oGAAA,cAAc,OAAA;AAAE,qGAAA,eAAe,OAAA;AAAE,oGAAA,cAAc,OAAA;AACxE,6BAAuD;AAA9C,mGAAA,YAAY,OAAA;AAAE,uGAAA,gBAAgB,OAAA;AAEvC,6BAA2F;AAAlF,uGAAA,gBAAgB,OAAA;AAAE,wGAAA,iBAAiB,OAAA;AAAE,8FAAA,OAAO,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAE3E,mCAAuE;AAA9D,6GAAA,mBAAmB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA;AAEpD,+BAAsC;AAA7B,oGAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2BAAuF;AAA9E,oGAAA,cAAc,OAAA;AAAE,oGAAA,cAAc,OAAA;AAAE,qGAAA,eAAe,OAAA;AAAE,oGAAA,cAAc,OAAA;AACxE,6BAAuD;AAA9C,mGAAA,YAAY,OAAA;AAAE,uGAAA,gBAAgB,OAAA;AAEvC,6BAA2F;AAAlF,uGAAA,gBAAgB,OAAA;AAAE,wGAAA,iBAAiB,OAAA;AAAE,8FAAA,OAAO,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAE3E,mCAAuE;AAA9D,6GAAA,mBAAmB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA;AAEpD,+BAAsC;AAA7B,oGAAA,YAAY,OAAA;AACrB,qDAAqJ;AAA5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