@miadi/relational-git-repository-mapper 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,7 +91,11 @@ scan now lives, so it runs without the Factory. `scan` reads a repository's defa
91
91
  (`origin/HEAD`) from git objects, never its
92
92
  working tree, so a clone on another branch or with edits of its own reads the same. It reads
93
93
  the packages the repository declares (`workspaces`, or `pnpm-workspace.yaml`), each
94
- package's `bin`, and every `SKILL.md` outside `node_modules` and archives. A statement is the
94
+ package's `bin`, every `SKILL.md` outside `node_modules` and archives, and what a file is
95
+ read for by a reader written for it: the medicine wheel's skills in `cli/skills.ts`, and the
96
+ decision of which model a mission runs on in Miadi's `packages/connector/src/claude-models.ts`
97
+ (`miadi-capability://jgwill/Miadi/decision/miadi.claude_model_routing`, kind `decision`,
98
+ jgwill/Miadi#1030). A statement is the
95
99
  file's own description, kept only within 55 words; longer, the row is `needs-resolution`
96
100
  without one. Every row names the commit it was read at and stays `pending` until a person
97
101
  reads it.
package/dist/cli.js CHANGED
@@ -232,7 +232,7 @@ async function main() {
232
232
  return 0;
233
233
  }
234
234
  const subject = answer.repository ? short(answer.repository) : "every repository";
235
- console.log(`${subject} provides ${answer.capabilities.length}: ${answer.counts.package} packages, ${answer.counts.cli} CLIs, ${answer.counts.skill} skills`);
235
+ console.log(`${subject} provides ${answer.capabilities.length}: ${answer.counts.package} packages, ${answer.counts.cli} CLIs, ${answer.counts.skill} skills, ${answer.counts.decision} decisions`);
236
236
  for (const c of answer.capabilities) {
237
237
  const by = answer.repository ? "" : ` (${c.providedBy.map(short).join(", ")})`;
238
238
  console.log(` ${(c.kind ?? "other").padEnd(8)} ${c.name}${by}${c.statement ? ` — ${c.statement}` : ` [${c.status}]`}`);
package/dist/commit.js CHANGED
@@ -144,8 +144,9 @@ function changedCapabilities(input) {
144
144
  const path = groundedPath(row);
145
145
  if (!path)
146
146
  continue;
147
- if (kind === "skill" && defining.includes(path))
148
- add(row, "skill", path);
147
+ // A skill and a decision are read from one file each: the commit changed them when it changed that file.
148
+ if ((kind === "skill" || kind === "decision") && defining.includes(path))
149
+ add(row, kind, path);
149
150
  // A CLI's entry point lives in its package's folder: a commit that changed nothing there reads no manifest for it.
150
151
  if (kind === "cli" && node_path_1.posix.basename(path) === "package.json" && defining.some((f) => inFolder(f, node_path_1.posix.dirname(path)))) {
151
152
  const entry = binEntry(input.read(path, "after") ?? input.read(path, "before"), row.name);
@@ -161,7 +162,7 @@ function changedCapabilities(input) {
161
162
  const capabilities = [...changed.values()]
162
163
  .map(({ row, kind, files }) => {
163
164
  // A package and a CLI are versioned by the manifest their row is grounded in, as it reads at the commit.
164
- const manifest = kind === "skill" ? undefined : groundedPath(row);
165
+ const manifest = kind === "skill" || kind === "decision" ? undefined : groundedPath(row);
165
166
  const isManifest = manifest !== undefined && node_path_1.posix.basename(manifest) === "package.json";
166
167
  const version = isManifest ? manifestVersion(input.read(manifest, "after")) : undefined;
167
168
  const versionChanged = isManifest && version !== undefined && manifestVersion(input.read(manifest, "before")) !== version;
package/dist/join.js CHANGED
@@ -116,9 +116,10 @@ function sessionsByRepository(records) {
116
116
  list.sort(newestFirst);
117
117
  return { sessions, spelled, records: records.size, withoutRepo };
118
118
  }
119
+ const CAPABILITY_ADDRESS = new RegExp(`^miadi-capability:(?:\\/\\/)?([^/\\s]+)\\/([^/\\s]+)\\/(${capabilities_1.CAPABILITY_KINDS.join("|")})\\/(.+)$`);
119
120
  /** A capability address without its scheme, owner and repository case-folded: `miadi-capability:` and `miadi-capability://` read the same. */
120
121
  function capabilityKey(address) {
121
- const m = /^miadi-capability:(?:\/\/)?([^/\s]+)\/([^/\s]+)\/(package|cli|skill)\/(.+)$/.exec(address.trim());
122
+ const m = CAPABILITY_ADDRESS.exec(address.trim());
122
123
  return m ? `${m[1].toLowerCase()}/${m[2].toLowerCase()}/${m[3]}/${m[4]}` : undefined;
123
124
  }
124
125
  /** The sessions whose record's `capabilities[]` names this capability, newest first. */
package/dist/read.js CHANGED
@@ -137,7 +137,7 @@ function repositoryCapabilities(repository, options = {}) {
137
137
  const read = readCapabilities(options.capabilities);
138
138
  const id = repository ? (repository.startsWith("repository:") ? repository : `repository:${repository}`) : undefined;
139
139
  const rows = id ? (0, capabilities_2.capabilitiesOf)(id, read.capabilities) : read.capabilities;
140
- const counts = { package: 0, cli: 0, skill: 0, other: 0 };
140
+ const counts = Object.fromEntries([...capabilities_2.CAPABILITY_KINDS, "other"].map((k) => [k, 0]));
141
141
  const capabilities = rows.map((c) => {
142
142
  const kind = (0, capabilities_2.kindOf)(c.nodeId);
143
143
  counts[kind ?? "other"] += 1;