@skill-map/cli 0.45.0 → 0.46.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 (44) hide show
  1. package/dist/cli/tutorial/sm-master/SKILL.md +29 -29
  2. package/dist/cli/tutorial/sm-master/references/fixture-templates.md +18 -13
  3. package/dist/cli/tutorial/sm-master/references/tour-authoring.md +35 -40
  4. package/dist/cli/tutorial/sm-master/references/tour-plugins.md +32 -32
  5. package/dist/cli/tutorial/sm-master/references/tour-settings.md +156 -75
  6. package/dist/cli/tutorial/sm-tutorial/SKILL.md +3 -3
  7. package/dist/cli.js +757 -452
  8. package/dist/conformance/index.js +4 -1
  9. package/dist/index.js +44 -17
  10. package/dist/kernel/index.d.ts +64 -9
  11. package/dist/kernel/index.js +44 -17
  12. package/dist/migrations/001_initial.sql +7 -0
  13. package/dist/ui/chunk-22CKFAEU.js +1 -0
  14. package/dist/ui/{chunk-I5AX4U2N.js → chunk-3YSNJXGB.js} +1 -1
  15. package/dist/ui/{chunk-MS6B7344.js → chunk-6AP364TB.js} +7 -7
  16. package/dist/ui/{chunk-VGPYYAVI.js → chunk-EPBUSS3I.js} +1 -1
  17. package/dist/ui/{chunk-IYM26L3O.js → chunk-ERUALZOV.js} +1 -1
  18. package/dist/ui/{chunk-5AD5ZV4I.js → chunk-EYBKZOMF.js} +1 -1
  19. package/dist/ui/chunk-F4RIBZ4P.js +1 -0
  20. package/dist/ui/chunk-HAWX5WNM.js +4 -0
  21. package/dist/ui/{chunk-QDUSFOBE.js → chunk-K365TVPA.js} +1 -1
  22. package/dist/ui/{chunk-CBI77N5U.js → chunk-L3JYFPSZ.js} +2 -2
  23. package/dist/ui/chunk-N3RUQDAR.js +1 -0
  24. package/dist/ui/{chunk-A7PRWMQD.js → chunk-P4E74ZOS.js} +1 -1
  25. package/dist/ui/{chunk-X227ITGS.js → chunk-RT7E4S5B.js} +1 -1
  26. package/dist/ui/{chunk-QNTAOR2L.js → chunk-RXQYLVSJ.js} +1 -1
  27. package/dist/ui/{chunk-MFLFIA7C.js → chunk-S32E6ZCZ.js} +1 -1
  28. package/dist/ui/{chunk-T3IVIRRJ.js → chunk-SF4FUT4U.js} +1 -1
  29. package/dist/ui/chunk-VNA3TMIO.js +1 -0
  30. package/dist/ui/{chunk-F7I6KMHX.js → chunk-VW2A6WZ3.js} +1 -1
  31. package/dist/ui/chunk-ZZJ7XWDX.js +1 -0
  32. package/dist/ui/index.html +1 -1
  33. package/dist/ui/main-NF5GO3JR.js +4 -0
  34. package/migrations/001_initial.sql +7 -0
  35. package/package.json +2 -2
  36. package/dist/cli.js.map +0 -1
  37. package/dist/conformance/index.js.map +0 -1
  38. package/dist/index.js.map +0 -1
  39. package/dist/kernel/index.js.map +0 -1
  40. package/dist/ui/chunk-27WQPOXP.js +0 -1
  41. package/dist/ui/chunk-555ST76V.js +0 -1
  42. package/dist/ui/chunk-IUZRAD7S.js +0 -1
  43. package/dist/ui/chunk-PZQHB7GS.js +0 -4
  44. package/dist/ui/main-ERCTR2PR.js +0 -3
@@ -1,12 +1,18 @@
1
1
  # Tour: settings + slots (step library, `settings-*` ids)
2
2
 
3
- Step bodies for two tours: option 2 (`settings-and-consent`,
4
- runs `settings-1-project` and `settings-2-local`) and the
5
- single shared step `settings-6-contributions` borrowed by
3
+ Step bodies for two tours: option 1 (`settings`, runs
4
+ `settings-1-layers`, `settings-2-resolve`, and `settings-3-lens`)
5
+ and the single shared step `settings-6-contributions` borrowed by
6
6
  option 3 (`build-and-configure`). The SKILL.md orchestrator
7
7
  dispatches each `settings-*` id here; `authoring-*` ids it
8
8
  dispatches to `tour-authoring.md`.
9
9
 
10
+ The `.sm` consent gate (companion files, `allowEditSmFiles`,
11
+ `sm sidecar annotate`) is covered end to end in the basic
12
+ `sm-tutorial`, so this tour does NOT repeat it; it focuses on the
13
+ config layer system and the `sm config` verbs, which the basic
14
+ tutorial does not teach.
15
+
10
16
  ## Precondition check
11
17
 
12
18
  Same as the authoring step library: `.skill-map/` must exist in
@@ -16,18 +22,34 @@ and appended the master-tutorial's internal entries to
16
22
  `.skill-map/` is missing, surface the bootstrap mismatch and
17
23
  stop, do not try to re-init mid-tour.
18
24
 
19
- ## Step `settings-1-project` — project settings (~2 min)
25
+ ## Step `settings-1-layers` — the config layers (~3 min)
26
+
27
+ **Context**: where settings live and how `sm` resolves a value
28
+ when more than one place sets it.
29
+
30
+ > `sm` resolves every setting through a stack of **layers**, each
31
+ > one overriding the layer below it:
32
+ >
33
+ > 1. **defaults**, baked into the CLI.
34
+ > 2. **project**, `.skill-map/settings.json`. Committed to git,
35
+ > shared with the whole team.
36
+ > 3. **project-local**, `.skill-map/settings.local.json`.
37
+ > Gitignored, per-checkout, never travels through the repo
38
+ > (this is where the `.sm` consent flag from the basic tutorial
39
+ > lives).
40
+ > 4. **override**, transient flags for a single command.
41
+ >
42
+ > There is no user or global layer: `sm` never merges anything
43
+ > from your home directory. Everything is project-scoped.
20
44
 
21
- > Every project that runs `sm init` gets a `.skill-map/`
22
- > directory with two settings files. The first one is
23
- > `settings.json`, this is the **public** project settings, the
24
- > file you commit to git.
45
+ > `sm init` already created the two files. The committed one starts
46
+ > minimal:
25
47
 
26
48
  ```bash
27
49
  cat .skill-map/settings.json
28
50
  ```
29
51
 
30
- Expected output on a fresh init:
52
+ Expected on a fresh init:
31
53
 
32
54
  ```json
33
55
  {
@@ -35,83 +57,142 @@ Expected output on a fresh init:
35
57
  }
36
58
  ```
37
59
 
38
- > Minimal on purpose. The CLI keeps the file lean and only adds
39
- > keys when you change a setting. Schema version is there so the
40
- > CLI can migrate the shape forward without surprising you.
41
- >
42
- > The settings UI in the browser (the `Settings` tab when `sm` is
43
- > running) writes back into this file. Anything you change in
44
- > there ends up here, commit it to share the choice with the
45
- > team.
60
+ > `schemaVersion` lets the CLI migrate the shape forward without
61
+ > surprising you; the file only grows keys as you change settings.
62
+ > Now list every setting the project sees, already resolved across
63
+ > the layers:
46
64
 
47
- Mark `settings-1-project: done`.
65
+ ```bash
66
+ sm config list
67
+ ```
48
68
 
49
- ## Step `settings-2-local` per-user overrides (~3 min)
69
+ Expected: a grouped table (General, Scan, Jobs, Roots & plugins,
70
+ History, Other) with each key's resolved value. A dash means
71
+ "unset, falling back to the default". The browser Settings tab
72
+ writes into `settings.json`, so anything you change there shows up
73
+ in this list too.
50
74
 
51
- > The second file is `settings.local.json`, which is **gitignored
52
- > by default**. It exists for choices that should NOT travel
53
- > across the team:
54
- >
55
- > - Whether you allowed `sm` to create `.sm` companion files in
56
- > this project (the consent gate from the basic tutorial).
57
- > - Personal token paths or credentials you do not want to
58
- > commit.
59
- > - Local preferences that depend on your dev environment.
75
+ Mark `settings-1-layers: done`.
76
+
77
+ ## Step `settings-2-resolve` — read, resolve, and set a value (~3 min)
78
+
79
+ **Context**: the four config verbs (`get`, `show`, `set`, `reset`)
80
+ and how `show --source` reveals which layer won.
81
+
82
+ > Read a single setting. We'll use `scan.maxNodes`, the cap on how
83
+ > many nodes a scan walks:
60
84
 
61
85
  ```bash
62
- cat .skill-map/settings.local.json
86
+ sm config get scan.maxNodes
87
+ sm config show scan.maxNodes --source
63
88
  ```
64
89
 
65
- Expected on a fresh init:
90
+ Expected: `get` prints the value (`256`); `show --source` adds
91
+ where it came from, `256 (from defaults)`. Nothing is set yet, so
92
+ the default wins.
66
93
 
67
- ```json
68
- {}
94
+ > Now set it in the project layer and watch the source move:
95
+
96
+ ```bash
97
+ sm config set scan.maxNodes 500 --yes
98
+ sm config show scan.maxNodes --source
69
99
  ```
70
100
 
71
- > Empty until something writes to it. The first thing that
72
- > typically lands is `allowEditSmFiles: true` after you accept
73
- > the `.sm` prompt (the consent gate is a per-user, per-project
74
- > choice, that's why it goes here).
75
-
76
- Before the demo, give the tester one sentence of context about
77
- what a `.sm` file actually is (the basic tutorial introduces it
78
- in passing, here we anchor the concept):
79
-
80
- > Every `.md` skill-map tracks gets a sibling `.sm` file (e.g.
81
- > `notes/ideas.sm` next to `notes/ideas.md`) that carries **all
82
- > of the tool's metadata about that markdown, so your `.md`
83
- > stays clean and uncluttered**. Version, history, tags,
84
- > annotations, anything that does not belong in the
85
- > human-authored body lives in the `.sm`. The `.md` is content
86
- > you write for Claude or humans, the `.sm` is bookkeeping the
87
- > tool writes. They are ordinary source files, committed to git,
88
- > and you'll see them often once you start using `sm bump` /
89
- > `sm sidecar annotate` day to day.
90
-
91
- If the tester wants to see it in action: ask them to run
92
- `sm sidecar annotate notes/ideas.md`, accept the `[Y/n]` prompt
93
- with `y`, and re-check the file:
101
+ Expected: the set prints
102
+ `✓ scan.maxNodes = 500 (wrote .skill-map/settings.json)`, and
103
+ `show --source` now reads `500 (from project)`. The value climbed
104
+ a layer, `project` overrides `defaults`. Peek at the file and the
105
+ nested key is there:
106
+
107
+ ```bash
108
+ cat .skill-map/settings.json
109
+ ```
110
+
111
+ > Last, undo it. `sm config reset` removes the key so the default
112
+ > takes over again:
113
+
114
+ ```bash
115
+ sm config reset scan.maxNodes
116
+ sm config show scan.maxNodes --source
117
+ ```
118
+
119
+ Expected: `✓ Removed scan.maxNodes from .skill-map/settings.json`,
120
+ then `256 (from defaults)`, back where we started. (A made-up key
121
+ like `scan.nope` is rejected with `✕ Unknown config key`, the
122
+ catalog is closed.)
123
+
124
+ Mark `settings-2-resolve: done`.
125
+
126
+ ## Step `settings-3-lens` — the active provider lens (~4 min)
127
+
128
+ **Context**: the single most consequential setting, the lens that
129
+ decides which provider types the project's files. It is reversible
130
+ and never touches your `.md` files, only the scan cache.
131
+
132
+ > One setting earns its own step: the **active provider lens**. A
133
+ > skill-map project sees its filesystem through exactly **one**
134
+ > provider at a time, and that lens decides how each file is read.
135
+ > Under the `claude` lens a `.claude/agents/*.md` is an agent and
136
+ > `@`-mentions / `/`-commands become links; point the lens at
137
+ > `openai` and the same tree is read against Codex's layout instead.
138
+ > Same files, different reading.
139
+
140
+ > The lens auto-detects on the first scan from the markers in your
141
+ > project (`.claude/` → claude, `.codex/` or a root `AGENTS.md` →
142
+ > openai, `.agents/` → agent-skills). Scan once and check where it
143
+ > landed:
144
+
145
+ ```bash
146
+ sm scan
147
+ sm config get activeProvider
148
+ ```
149
+
150
+ Expected: the scan prints a line like `Auto-detected activeProvider
151
+ = claude from filesystem markers; persisted to
152
+ .skill-map/settings.json`, and `get` then reports `claude`. The lens
153
+ is just a key in `settings.json`, persisted like any other setting.
154
+
155
+ > Now switch it by hand and watch what happens. We'll point it at
156
+ > `openai`:
157
+
158
+ ```bash
159
+ sm config set activeProvider openai
160
+ ```
161
+
162
+ Expected: alongside the usual `✓ activeProvider = openai (wrote
163
+ .skill-map/settings.json)`, the CLI warns `Lens switched. Cleared 7
164
+ scan table(s) ... Run sm scan to repopulate the graph under the new
165
+ lens`. The important part: it cleared the **scan cache only**, your
166
+ `.md` files are untouched. The graph is derived data; the source is
167
+ always your filesystem.
168
+
169
+ > Re-scan under the new lens, then put it back the way you found it:
94
170
 
95
171
  ```bash
96
- sm sidecar annotate notes/ideas.md
97
- cat .skill-map/settings.local.json
172
+ sm scan
173
+ sm config reset activeProvider
174
+ sm scan
98
175
  ```
99
176
 
100
- Expected: now contains `{"allowEditSmFiles": true}` (plus a
101
- `notes/ideas.sm` file landed next to the markdown).
177
+ Expected: the first scan repopulates under `openai`; `reset` removes
178
+ the key (`Removed activeProvider from .skill-map/settings.json`); the
179
+ last scan auto-detects `claude` again from your `.claude/` marker.
180
+ Back where you started, nothing lost.
102
181
 
103
- > The choice stuck. Next time `sm` wants to write a `.sm` in this
104
- > project, it skips the prompt because your consent is on
105
- > record. If you delete the file or move to a different project,
106
- > the prompt comes back.
182
+ > That's the whole idea of the lens: one project, one active
183
+ > provider at a time, chosen by `activeProvider` and backed by the
184
+ > built-in provider plugins (`claude`, `openai`, `agent-skills`,
185
+ > `antigravity`). Switching it is cheap and reversible because the
186
+ > graph is always rebuilt from your files, never the other way
187
+ > around.
107
188
 
108
- Mark `settings-2-local: done`.
189
+ Mark `settings-3-lens: done`.
109
190
 
110
191
  ## Step `settings-6-contributions` — watch contributions land (~2 min)
111
192
 
112
- > Last step. Let's see a contribution land in the inspector
113
- > live. The fixture's `master-agent` declares `tools: [Read,
114
- > Bash, Edit]`, which the `core/tools-counter` extractor picks up.
193
+ > Last step. Let's watch a contribution land on a node card live.
194
+ > The fixture's `master-agent` declares `tools: [Read, Bash,
195
+ > Edit]`, which the `core/tools-counter` extractor picks up.
115
196
 
116
197
  If the tester does not have `sm` running, ask them to launch it
117
198
  in their second terminal (same drill as the basic tutorial:
@@ -124,14 +205,14 @@ sm
124
205
 
125
206
  Once the UI is open, ask the tester to:
126
207
 
127
- > Click the `master-agent` node. The inspector opens on the
128
- > right side. Look at the **header badge cluster** (just under
129
- > the title): you should see a small chip from `tools-counter`
130
- > showing the value `3`.
208
+ > Find the `master-agent` card in the graph. Look at its **left
209
+ > footer** (the bottom-left corner of the card): you should see a
210
+ > small wrench chip from `tools-counter` labelled `tools` showing
211
+ > the value `3`. Hover it to see the tool names.
131
212
  >
132
213
  > That chip is a plugin contribution. It landed in the slot
133
- > `inspector.header.badge.counter`, the renderer is `NodeCounter`
134
- > (same one your scaffold uses), the payload was `{ value: 3 }`.
214
+ > `card.footer.left`, the renderer is `NodeCounter` (same one your
215
+ > scaffold uses), the payload was `{ value: 3 }`.
135
216
 
136
217
  If the `demo-highlight` plugin from the earlier authoring steps
137
218
  of this tour is still installed, point the tester at the
@@ -147,8 +228,8 @@ remove one tool), save, and watch the chip refresh.
147
228
  > Same flow as the basic tutorial's live UI: edit the markdown,
148
229
  > watch the UI refresh. The difference is that the value flowed
149
230
  > through a plugin (`core/tools-counter`) and landed in a specific
150
- > slot (`inspector.header.badge.counter`). You now know the full
151
- > path from `.md` to UI chip.
231
+ > slot (`card.footer.left`). You now know the full path from `.md`
232
+ > to UI chip.
152
233
 
153
234
  Have them Ctrl+C the server when done.
154
235
 
@@ -1603,11 +1603,11 @@ tester pulls on the thread.
1603
1603
 
1604
1604
  The verb is informational, passing `core/external-url-counter`
1605
1605
  validates the extension exists and then renders the **parent
1606
- bundle's** detail (i.e. the full `core` listing). The extension
1606
+ plugin's** detail (i.e. the full `core` listing). The extension
1607
1607
  you named lives in that list. This is deliberate: forcing the user
1608
- to type the bundle id just to read a single extension's manifest
1608
+ to type the plugin id just to read a single extension's manifest
1609
1609
  would be hostile, so `show` accepts the qualified shape and
1610
- resolves up. Use `sm plugins doctor` or scroll the bundle's
1610
+ resolves up. Use `sm plugins doctor` or scroll the plugin's
1611
1611
  extension table to spot the one you queried.
1612
1612
 
1613
1613
  ### IDs for `plugins disable` / `plugins enable`