@skill-map/cli 0.18.0 → 0.20.0

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.
Files changed (43) hide show
  1. package/README.md +4 -0
  2. package/dist/cli/tutorial/sm-tutorial.md +9 -10
  3. package/dist/cli.js +11062 -7069
  4. package/dist/cli.js.map +1 -1
  5. package/dist/conformance/index.js +1 -1
  6. package/dist/conformance/index.js.map +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +424 -148
  9. package/dist/index.js.map +1 -1
  10. package/dist/kernel/index.d.ts +776 -119
  11. package/dist/kernel/index.js +424 -148
  12. package/dist/kernel/index.js.map +1 -1
  13. package/dist/migrations/001_initial.sql +125 -15
  14. package/dist/ui/chunk-2W62S3FU.js +2638 -0
  15. package/dist/ui/chunk-C7QWBAYP.js +247 -0
  16. package/dist/ui/chunk-DLT5AP43.js +237 -0
  17. package/dist/ui/chunk-HJSRMZTK.js +450 -0
  18. package/dist/ui/chunk-HOBQ4G4O.js +125 -0
  19. package/dist/ui/chunk-IBUV6OG2.js +1 -0
  20. package/dist/ui/chunk-LQTUSDHD.js +124 -0
  21. package/dist/ui/chunk-QICH7GU2.js +5 -0
  22. package/dist/ui/chunk-UJRROL5X.js +1 -0
  23. package/dist/ui/chunk-VLNLJAUB.js +61 -0
  24. package/dist/ui/chunk-W3JLG7BI.js +965 -0
  25. package/dist/ui/index.html +10 -2
  26. package/dist/ui/main-QHE47BCM.js +1 -0
  27. package/dist/ui/{styles-CBPFNGXA.css → styles-VJ5Q6D2X.css} +1 -1
  28. package/migrations/001_initial.sql +125 -15
  29. package/package.json +2 -2
  30. package/dist/migrations/002_sidecar_columns.sql +0 -53
  31. package/dist/migrations/003_drop_node_author.sql +0 -20
  32. package/dist/migrations/004_sidecar_root_json.sql +0 -23
  33. package/dist/migrations/005_node_favorites.sql +0 -20
  34. package/dist/ui/chunk-JKJGGXCS.js +0 -1025
  35. package/dist/ui/chunk-SX2A3WBX.js +0 -247
  36. package/dist/ui/chunk-TWZHUCAT.js +0 -237
  37. package/dist/ui/chunk-WTAL2RK4.js +0 -1
  38. package/dist/ui/chunk-Z3UJHHTC.js +0 -3091
  39. package/dist/ui/main-AAYGMON4.js +0 -1
  40. package/migrations/002_sidecar_columns.sql +0 -53
  41. package/migrations/003_drop_node_author.sql +0 -20
  42. package/migrations/004_sidecar_root_json.sql +0 -23
  43. package/migrations/005_node_favorites.sql +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skill-map/cli",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "skill-map reference implementation — kernel + CLI + adapters.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@hono/node-server": "2.0.1",
69
- "@skill-map/spec": "0.18.0",
69
+ "@skill-map/spec": "0.20.0",
70
70
  "ajv": "8.18.0",
71
71
  "ajv-formats": "3.0.1",
72
72
  "chokidar": "5.0.0",
@@ -1,53 +0,0 @@
1
- -- Step 9.6.2 — kernel sidecar reader + drift detection.
2
- --
3
- -- Extends `scan_nodes` with three new columns to denormalise the
4
- -- sidecar-derived state for fast queries:
5
- --
6
- -- - `sidecar_present` — boolean flag, 1 when a co-located `.sm` file
7
- -- accompanies this node, 0 otherwise. Default 0.
8
- -- - `sidecar_status` — fresh / stale-body / stale-frontmatter /
9
- -- stale-both. NULL when no sidecar is present.
10
- -- - `annotations_json` — JSON-encoded `annotations:` block from the
11
- -- parsed sidecar (the typed surface declared by
12
- -- `spec/schemas/annotations.schema.json`). NULL when no sidecar or
13
- -- when the block is empty.
14
- --
15
- -- Hard-cut migration of the source-of-truth for three pre-existing
16
- -- columns (Decision #3 — option (a), extend `scan_nodes`):
17
- --
18
- -- - `stability` — was sourced from `frontmatter.metadata.stability`,
19
- -- now sourced from sidecar `annotations.stability`.
20
- -- - `version` — was `TEXT` (semver string from
21
- -- `frontmatter.metadata.version`); now `INTEGER` (monotonic counter
22
- -- from sidecar `annotations.version`). Pre-9.6.2 rows reset to
23
- -- NULL — greenfield migration, no automatic semver→integer
24
- -- conversion (Decision #125 / per-project policy).
25
- -- - `author` — was sourced from `frontmatter.author`, now sourced
26
- -- from sidecar `annotations.author`.
27
- --
28
- -- The fallback path through `pickMetadata` for these three fields is
29
- -- removed in the kernel; other consumers of `metadata.*` (e.g.
30
- -- broken-ref's `metadata.related`) are out of scope for 9.6.2.
31
- --
32
- -- SQLite limitation note: the three pre-existing columns retain their
33
- -- original types where possible. For `version` we change the type by
34
- -- dropping and re-adding the column (safe: greenfield reset to NULL
35
- -- is the documented migration outcome). DROP COLUMN requires SQLite
36
- -- 3.35+; node:sqlite (Node 22+) ships SQLite ≥ 3.45.
37
-
38
- ALTER TABLE scan_nodes DROP COLUMN version;
39
- ALTER TABLE scan_nodes ADD COLUMN version INTEGER;
40
-
41
- ALTER TABLE scan_nodes ADD COLUMN sidecar_present INTEGER NOT NULL DEFAULT 0;
42
- ALTER TABLE scan_nodes ADD COLUMN sidecar_status TEXT;
43
- ALTER TABLE scan_nodes ADD COLUMN annotations_json TEXT;
44
-
45
- -- Reset stability + author to NULL — they used to be populated from
46
- -- frontmatter.metadata.{stability,author}; the new source is
47
- -- sidecar `annotations.{stability,author}` and a re-scan repopulates.
48
- UPDATE scan_nodes SET stability = NULL, author = NULL;
49
-
50
- -- Constraint mirrors the four legal values returned by the kernel's
51
- -- drift detector. NULL is allowed (and required) when no sidecar is
52
- -- present.
53
- CREATE INDEX ix_scan_nodes_sidecar_status ON scan_nodes(sidecar_status);
@@ -1,20 +0,0 @@
1
- -- Step 9.6 catalog-curation follow-up (2026-05-07).
2
- --
3
- -- Drop the vestigial `scan_nodes.author` column. The 9.6.2 migration
4
- -- denormalised `annotations.author` into the column; the 2026-05-07
5
- -- catalog curation removed `author` from `annotations.schema.json`,
6
- -- which left the column without a canonical source. Anyone who still
7
- -- writes `author:` in their `.sm` rides on `additionalProperties: true`
8
- -- — the value lands in `annotations_json` (no longer in a typed
9
- -- column), and `unknown-field` warns on it as a typo guard.
10
- --
11
- -- Greenfield drop: pre-9.6 rows had the column reset to NULL by
12
- -- migration 002, and the curation rolled out before any released
13
- -- consumer pinned the post-9.6.2 shape. No automatic salvage path —
14
- -- if a deployed DB carried real data, it is preserved verbatim under
15
- -- `scan_nodes.annotations_json` until the next scan rewrites the row.
16
- --
17
- -- DROP COLUMN requires SQLite 3.35+; node:sqlite (Node 22+) ships
18
- -- SQLite ≥ 3.45.
19
-
20
- ALTER TABLE scan_nodes DROP COLUMN author;
@@ -1,23 +0,0 @@
1
- -- R15 closure (2026-05-07) — surface the full parsed `.sm` root on the
2
- -- BFF wire shape (`Node.sidecar.root`).
3
- --
4
- -- Adds `scan_nodes.sidecar_root_json`, sibling to `annotations_json`
5
- -- (Decision: option (b), additive — no rewrite of the existing read
6
- -- path; duplicates the `annotations:` sub-block by design so
7
- -- pre-R15 consumers reading `annotations_json` keep working unchanged).
8
- --
9
- -- Column shape:
10
- -- - JSON-encoded full parsed YAML root of the matching `.sm` file
11
- -- (every top-level reserved block — `for` / `annotations` /
12
- -- `settings` / `audit` — plus `<plugin-id>:` namespaces a plugin
13
- -- opt-in to root via `annotationContributions`).
14
- -- - NULL when no sidecar accompanies the node, or when the sidecar
15
- -- exists but failed to parse / validate (in that case
16
- -- `sidecar_present` stays 1 and `sidecar_status` stays NULL).
17
- --
18
- -- Backfill on existing rows: NULL. Re-scan repopulates the column from
19
- -- the live `.sm` file via `parseSidecar()`'s already-computed `raw`
20
- -- payload. Greenfield posture per `feedback_greenfield_no_versioning.md`
21
- -- — no released consumer depends on the prior shape.
22
-
23
- ALTER TABLE scan_nodes ADD COLUMN sidecar_root_json TEXT;
@@ -1,20 +0,0 @@
1
- -- Per-node "favorite" flag persisted per user (single-user local DB).
2
- --
3
- -- Zone `state_` because favorites are user-authored preference and must
4
- -- survive `sm scan` truncation and `sm db reset` (which drops only
5
- -- `scan_*`). Absence of a row means "not favorited".
6
- --
7
- -- `node_path` is FK-semantic to `scan_nodes.path`. The rename heuristic
8
- -- (`migrateNodeFks` in src/kernel/adapters/sqlite/history.ts) MUST migrate
9
- -- rows here when a path is renamed, same protocol as the other state_*
10
- -- tables. Simple PK update — no composite key, no collision shape.
11
- --
12
- -- The BFF's `/api/nodes` route loads the full set of paths once per
13
- -- request (typical favorite count is small) and decorates the in-memory
14
- -- node list with a derived `isFavorite` boolean by Set membership. No
15
- -- SQL JOIN against `scan_nodes` is required.
16
-
17
- CREATE TABLE state_node_favorites (
18
- node_path TEXT PRIMARY KEY,
19
- favorited_at INTEGER NOT NULL
20
- );