@medicine-wheel/developer-repository-mapping 0.27.19 → 0.27.21
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 +45 -1
- package/dist/capability-file.d.ts +108 -5
- package/dist/capability-file.d.ts.map +1 -1
- package/dist/capability-file.js +193 -20
- package/dist/capability-file.js.map +1 -1
- package/dist/capability-scan.d.ts +43 -9
- package/dist/capability-scan.d.ts.map +1 -1
- package/dist/capability-scan.js +90 -14
- package/dist/capability-scan.js.map +1 -1
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +16 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +11 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +166 -15
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/merge.d.ts.map +1 -1
- package/dist/merge.js +9 -0
- package/dist/merge.js.map +1 -1
- package/dist/node/capability-index.d.ts +65 -0
- package/dist/node/capability-index.d.ts.map +1 -0
- package/dist/node/capability-index.js +127 -0
- package/dist/node/capability-index.js.map +1 -0
- package/dist/node/capability-scan.d.ts +28 -2
- package/dist/node/capability-scan.d.ts.map +1 -1
- package/dist/node/capability-scan.js +104 -11
- package/dist/node/capability-scan.js.map +1 -1
- package/dist/node/fs.d.ts +10 -0
- package/dist/node/fs.d.ts.map +1 -1
- package/dist/node/fs.js +28 -0
- package/dist/node/fs.js.map +1 -1
- package/dist/node/index.d.ts +7 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +13 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/skills.d.ts +37 -0
- package/dist/node/skills.d.ts.map +1 -0
- package/dist/node/skills.js +99 -0
- package/dist/node/skills.js.map +1 -0
- package/dist/package-evidence.d.ts +10 -10
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +7 -0
- package/dist/read.js.map +1 -1
- package/dist/schemas.d.ts +20 -20
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +4 -3
- package/schema/repository-capabilities.v5.schema.json +748 -0
- package/skills/capability-hub/SKILL.md +105 -0
- package/skills/capability-mapping/SKILL.md +162 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: capability-hub
|
|
3
|
+
description: Keep an owner's hub, the folder .miadi/repository-mapping/ in the repository named after the owner, so other members of a community see what each of the owner's repositories is and what it provides, with no service between them. Use when asked to index, publish or share an owner's capabilities, or to read another owner's.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Capability hub: an owner says what their repositories are and provide
|
|
7
|
+
|
|
8
|
+
A hub is a folder of JSON Lines files in the repository named after its owner,
|
|
9
|
+
`<owner>/<owner>` on GitHub. It says what each of the owner's repositories is and what
|
|
10
|
+
each provides. It is plain files in git: publishing is `git push`, and anyone reads it
|
|
11
|
+
from the repository, with this tool or without it. No account, registry or server stands
|
|
12
|
+
between two members of a community.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
<owner>/<owner>/.miadi/repository-mapping/
|
|
16
|
+
manifest.json what the folder is: owner, hub, kind (owner | meta)
|
|
17
|
+
repositories.jsonl each repository: lifecycle, purpose in at most 55 words, git reading
|
|
18
|
+
provided.jsonl what each repository provides, copied from its own capability file
|
|
19
|
+
relations.jsonl forked-from, grew-into, consumes, provides, realizes, field-aligns-with
|
|
20
|
+
features.jsonl features a reader observed in a repository
|
|
21
|
+
capabilities.jsonl platform capabilities, usually in a meta hub
|
|
22
|
+
owners.jsonl meta hub only: the other owners' hubs it reads
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The tool is `mw-repomap` (`mw-repomap --version`, 0.27.20 or later for `provided.jsonl`).
|
|
26
|
+
Each repository's own file is written with the `capability-mapping` skill
|
|
27
|
+
(`mw-repomap skill show capability-mapping`). Do that first: the hub repeats what a
|
|
28
|
+
repository said of itself and never writes a reading of its own in a repository's name.
|
|
29
|
+
|
|
30
|
+
## Make a hub
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone git@github.com:<owner>/<owner>.git
|
|
34
|
+
mw-repomap init <owner> --owner <owner> # an empty .miadi/repository-mapping/ in that clone
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Add one line per repository to `repositories.jsonl`. The purpose is at most 55 words, and
|
|
38
|
+
`statedBy` is who wrote the row: an agent's model id or a person's name.
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{"nodeId":"repository:<owner>/<name>","origin":"own","lifecycle":"unclassified","purpose":"<what it is and has done>","status":"clear","fields":[],"prototypes":[],"statedBy":"<who>","statedAt":"2026-11-30T12:00:00Z","grounding":["https://github.com/<owner>/<name>"],"revision":"pending"}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
mw-repomap observe <clone>... --dir <owner> --write # each clone's git reading, stored on its row
|
|
46
|
+
mw-repomap move <owner>/<name> explore <owner> --by <who> # its lifecycle: explore, implement, concretize, release, archive, reopen
|
|
47
|
+
mw-repomap validate <owner> --local # 0 errors before every commit
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Index what the repositories provide
|
|
51
|
+
|
|
52
|
+
1. In each repository, write and push its own `.miadi/capabilities.jsonl`
|
|
53
|
+
(`capability-mapping`).
|
|
54
|
+
2. Fetch the clones, then copy their rows into the hub:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mw-repomap capabilities index <owner> <clone>... --write # or --root <folder of clones>, or --list <file>
|
|
58
|
+
mw-repomap validate <owner> --local
|
|
59
|
+
git -C <owner> add .miadi/repository-mapping/provided.jsonl
|
|
60
|
+
git -C <owner> commit -m "what <owner>'s repositories provide" && git -C <owner> push
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Each row names the commit it was read at. Rows of repositories that were not read this
|
|
64
|
+
time stay as they are. `mw-repomap capabilities index <owner> <clone>... --check` exits 1
|
|
65
|
+
when the index is behind.
|
|
66
|
+
|
|
67
|
+
## A public hub and a private repository
|
|
68
|
+
|
|
69
|
+
The index writes rows only for repositories the hub lists, read from clones whose
|
|
70
|
+
committed capability file exists.
|
|
71
|
+
|
|
72
|
+
- A public hub lists public repositories only. A private repository has no row there, so
|
|
73
|
+
nothing it provides is written into the hub, whatever clones are given. The command
|
|
74
|
+
says "is not a repository this hub lists" and moves on.
|
|
75
|
+
- `validate` refuses a `provided.jsonl` row whose repository the hub does not list, so a
|
|
76
|
+
hand edit cannot add one either.
|
|
77
|
+
- A package published from a private repository is public on its registry and absent
|
|
78
|
+
from a public hub by this rule. Whether and how to list it is the owner's decision.
|
|
79
|
+
The tool does not make it.
|
|
80
|
+
|
|
81
|
+
## Read another owner's hub
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
mw-repomap show <owner>/<name> <hub clone> # one repository: what it is, its relations, what it provides
|
|
85
|
+
mw-repomap list <hub clone> # every repository with its lifecycle and git reading
|
|
86
|
+
mw-repomap serve <hub clone> # a read-only page at http://127.0.0.1:3967/
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
A meta hub reads other owners' hubs where they live, without copying them. It registers
|
|
90
|
+
each one with a line in its `owners.jsonl`, and reads the hub from GitHub unless `source`
|
|
91
|
+
names a local path or another URL:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{"owner":"<login>","hub":"<login>/<login>","registeredBy":"<who>","registeredAt":"2026-11-30T12:00:00Z"}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
mw-repomap hub <meta hub clone> # every registered hub, read or not
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Each owner speaks for their own repositories: a row about someone else's repository in
|
|
102
|
+
your hub is skipped and reported.
|
|
103
|
+
|
|
104
|
+
The format and its rules:
|
|
105
|
+
https://github.com/jgwill/medicine-wheel/tree/main/rispecs/developer-suite/repository-mapping
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: capability-mapping
|
|
3
|
+
description: Write and keep a repository's own capability file, .miadi/capabilities.jsonl, with mw-repomap, so whoever clones it knows what it provides - packages, command lines and their commands, skills, apps and plugins, each with its stage, its issues and who reads it. Use when asked to inventory or map what a repository or a package provides.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Capability mapping: a repository says what it provides
|
|
7
|
+
|
|
8
|
+
A repository keeps what it provides in one file committed with its code,
|
|
9
|
+
`.miadi/capabilities.jsonl`. Whoever clones it, a person or an agent, knows what it
|
|
10
|
+
offers with no registry, no account and no service. Each line is one capability: its
|
|
11
|
+
kind, its name, its address (`miadi-capability://<owner>/<repo>/<kind>/<name>`), what it
|
|
12
|
+
is in at most 55 words, and who said so.
|
|
13
|
+
|
|
14
|
+
The tool is `mw-repomap`, shipped by `@medicine-wheel/developer-repository-mapping`, the
|
|
15
|
+
package this skill came with. This text describes that version:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
mw-repomap --version # the installed version; this skill needs 0.27.20 or later
|
|
19
|
+
mw-repomap capabilities --help # the tool decides when it and this text disagree
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Without a global install, write `npx -y @medicine-wheel/developer-repository-mapping` in
|
|
23
|
+
place of `mw-repomap`.
|
|
24
|
+
|
|
25
|
+
## The file is the repository's
|
|
26
|
+
|
|
27
|
+
An ask that names one package ("inventory what <package> provides") is answered by the
|
|
28
|
+
whole repository's file, with that package's rows stated. There is one file per
|
|
29
|
+
repository, at its root.
|
|
30
|
+
|
|
31
|
+
## The loop
|
|
32
|
+
|
|
33
|
+
1. **Commit first.** The scan reads a commit (`HEAD`) from git objects, never the working
|
|
34
|
+
tree. A package or a skill that is not committed is not seen.
|
|
35
|
+
2. `mw-repomap capabilities scan <clone> --check`. Exit 1 means the file is behind the
|
|
36
|
+
code, or does not exist yet.
|
|
37
|
+
3. `mw-repomap capabilities scan <clone> --write`. It writes the file in the working tree
|
|
38
|
+
and commits nothing.
|
|
39
|
+
4. **Read what it found before stating anything**, and read its warnings. The shapes
|
|
40
|
+
below say what to do when something is missing.
|
|
41
|
+
5. State what only a person or an agent can say (next section).
|
|
42
|
+
6. `scan --check` again: it must say the file is up to date.
|
|
43
|
+
7. Commit `.miadi/capabilities.jsonl` alone, by path, and push.
|
|
44
|
+
|
|
45
|
+
A rescan keeps everything a person or an agent stated, and changes nothing when the
|
|
46
|
+
repository did not change.
|
|
47
|
+
|
|
48
|
+
## What the scan finds, and what it needs to be told
|
|
49
|
+
|
|
50
|
+
| What | Found by the scan when | Otherwise |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| a package | its `package.json` is the root's, or in a folder the root `workspaces` or `pnpm-workspace.yaml` lists | declare its folder (below) |
|
|
53
|
+
| a command line | a package read above has a `bin` | nothing to do |
|
|
54
|
+
| a skill | a `SKILL.md` is committed, outside `node_modules`, `dist` and archives | make it a file (below) |
|
|
55
|
+
| a command of a command line | someone enrolled it by naming its file | enroll it (below) |
|
|
56
|
+
| an app, a plugin | someone named its folder | `--path <folder>` (below) |
|
|
57
|
+
|
|
58
|
+
**Packages no workspace joins.** A repository whose packages sit in folders with no
|
|
59
|
+
workspace declaration, or whose workspace leaves some out, declares those folders in the
|
|
60
|
+
file's own header. The scan warns with the exact command when it sees a `package.json`
|
|
61
|
+
it did not read:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mw-repomap capabilities scan <clone> --write --package-folders cli,server,tools/*
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`dir` is one folder and `dir/*` each folder under it. The root package is always read.
|
|
68
|
+
`--package-folders .` removes the declaration. No file for a package manager is needed.
|
|
69
|
+
A package marked `"private": true` is read for what consumes what and never listed.
|
|
70
|
+
|
|
71
|
+
**A skill shipped inside a package.** When a `SKILL.md` sits in a package's folder and
|
|
72
|
+
the package's `files` list ships it, its row names that package, and it is read at that
|
|
73
|
+
package's stage until someone states a stage for it. A skill whose text lives in code is
|
|
74
|
+
not seen: move the text to `<package>/skills/<name>/SKILL.md`, list `skills` in the
|
|
75
|
+
package's `files`, and have the code read the file.
|
|
76
|
+
|
|
77
|
+
**The commands of a command line.** Each command people use by name gets its own row,
|
|
78
|
+
kind `command`, named `<cli>/<command>`. Enroll it by naming the file that defines it,
|
|
79
|
+
with what it does in at most 55 words. Flags go in the statement:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mw-repomap capabilities state command/acme/deploy "Deploys the build to a named target. --dry-run prints the plan." \
|
|
83
|
+
--path src/commands/deploy.ts --by <who> --clone <clone>
|
|
84
|
+
mw-repomap capabilities scan <clone> --write # the command line's row now lists its commands
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Every scan confirms that file and that command line in the commit it reads. A command
|
|
88
|
+
whose file is gone is reported and no longer read. A command is read at its command
|
|
89
|
+
line's stage until someone states its own.
|
|
90
|
+
|
|
91
|
+
**An app or a plugin** is never guessed:
|
|
92
|
+
`mw-repomap capabilities state app/<name> --path <folder> --by <who>`, or
|
|
93
|
+
`plugin/<name> --path <folder>`, then rescan.
|
|
94
|
+
|
|
95
|
+
## What only a person or an agent says
|
|
96
|
+
|
|
97
|
+
The scan never says any of these. Each is signed with `--by` and kept through every
|
|
98
|
+
rescan.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# what it is, when its own description is over 55 words (the row says needs-resolution)
|
|
102
|
+
mw-repomap capabilities state skill/<name> "<at most 55 words>" --by <who>
|
|
103
|
+
|
|
104
|
+
# where it stands, from evidence, and what it is for
|
|
105
|
+
mw-repomap capabilities state package/<name> --stage released --stage-grounding npm:<name>@<version> \
|
|
106
|
+
--achieves "<at most 55 words: what someone can do because it exists>" --issue <owner>/<repo>#<n> --by <who>
|
|
107
|
+
|
|
108
|
+
# written down, not built yet
|
|
109
|
+
mw-repomap capabilities state command/<cli>/<command> "<statement>" --stage specified \
|
|
110
|
+
--specification <path|rise://…|https://…> --by <who>
|
|
111
|
+
|
|
112
|
+
# being built somewhere else than this commit: a pull request, an issue, a branch
|
|
113
|
+
mw-repomap capabilities state command/<cli>/<command> "<statement>" --stage implementation \
|
|
114
|
+
--stage-grounding <owner>/<repo>#<n> --by <who>
|
|
115
|
+
mw-repomap capabilities state skill/<name> "<statement>" --stage prototype \
|
|
116
|
+
--stage-grounding <owner>/<repo>@<branch> --by <who>
|
|
117
|
+
|
|
118
|
+
# who reads it, where no package.json says so
|
|
119
|
+
mw-repomap capabilities state cli/<name> --consumer miadi-capability://<owner>/<repo>/package/<package> \
|
|
120
|
+
--reads "<at most 55 words: what it reads>" --by <who>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Stages are `specified`, `prototype`, `implementation`, `released` and `retired`. A row
|
|
124
|
+
the commit does not provide is read only at `specified` or `retired`, or at `prototype`
|
|
125
|
+
or `implementation` when its stage is grounded in `owner/repo#n` or
|
|
126
|
+
`owner/repo@<branch>`. Any other row the commit does not provide is the file's claim:
|
|
127
|
+
reported, never read.
|
|
128
|
+
|
|
129
|
+
A consumer is a capability address or an `https://` URL. Name it when something reads
|
|
130
|
+
what a capability produces without depending on its package, such as a page that reads
|
|
131
|
+
the folders a command writes. A dependency declared in a `package.json` needs no
|
|
132
|
+
statement: `capabilities map` reads it.
|
|
133
|
+
|
|
134
|
+
Also available: `--realizes capability:<slug>`, `--episode miadi-chronicle://<n>`,
|
|
135
|
+
`--system rise://…sysdf.json`, and for an app `--deployed-by` with `--hosting-grounding`.
|
|
136
|
+
|
|
137
|
+
## Signing
|
|
138
|
+
|
|
139
|
+
`--by` names who said it. An agent signs with its model id, a person with their name.
|
|
140
|
+
Every row starts `pending`. A row becomes `affirmed` only when a person read it:
|
|
141
|
+
`mw-repomap capabilities state <kind>/<name> --by <person>` with nothing else affirms
|
|
142
|
+
what is there. An agent never records that for a person.
|
|
143
|
+
|
|
144
|
+
## What the scan never does
|
|
145
|
+
|
|
146
|
+
It never commits or pushes. It never guesses an app, a plugin or a command. It never
|
|
147
|
+
lists a private package. It never writes a version or a commit into the file: a reader
|
|
148
|
+
takes those from the commit it reads, so a release does not change the file.
|
|
149
|
+
|
|
150
|
+
## Reading
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
mw-repomap capabilities show <clone> # the repository's own file first, with what the commit says beside it
|
|
154
|
+
mw-repomap capabilities map <clone>... --json # several clones as one map: who provides what, who consumes what
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
"it holds no capability file" means nobody wrote one yet. To let other members of a
|
|
158
|
+
community see what an owner's repositories provide, see the `capability-hub` skill
|
|
159
|
+
(`mw-repomap skill show capability-hub`).
|
|
160
|
+
|
|
161
|
+
The format and its rules:
|
|
162
|
+
https://github.com/jgwill/medicine-wheel/blob/main/rispecs/developer-suite/repository-mapping/capabilities.spec.md
|