@medicine-wheel/app 0.27.3 → 0.27.5
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/dist/cli/skills.js +279 -122
- package/package.json +30 -30
package/dist/cli/skills.js
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* Skills are curated capabilities that can be installed into a local
|
|
6
6
|
* `.mw/skills/` directory. Each CLI (mw, mwsrv) exposes its own
|
|
7
7
|
* relevant subset via `skill view` and `skill install`.
|
|
8
|
+
*
|
|
9
|
+
* An installed SKILL.md opens with front matter (`name`, `description`),
|
|
10
|
+
* rendered from the definition by `renderSkill`, so an agent that loads
|
|
11
|
+
* skills from a folder reads it as one. A body names only calls that run
|
|
12
|
+
* today; `tests/skills-catalog.test.ts` checks every MCP tool a body names
|
|
13
|
+
* against the tools the MCP server registers.
|
|
8
14
|
*/
|
|
9
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
16
|
if (k2 === undefined) k2 = k;
|
|
@@ -42,6 +48,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
42
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
49
|
exports.listSkills = listSkills;
|
|
44
50
|
exports.getSkill = getSkill;
|
|
51
|
+
exports.renderSkill = renderSkill;
|
|
45
52
|
exports.getComplement = getComplement;
|
|
46
53
|
exports.explainSkillRunUnavailable = explainSkillRunUnavailable;
|
|
47
54
|
exports.viewSkills = viewSkills;
|
|
@@ -54,33 +61,52 @@ const SKILLS = [
|
|
|
54
61
|
{
|
|
55
62
|
name: 'direction-inquiry',
|
|
56
63
|
title: 'Direction Inquiry',
|
|
57
|
-
description: '
|
|
64
|
+
description: 'Read a task through the Four Directions (East / South / West / North) with mw_decompose_prompt before acting on it',
|
|
58
65
|
target: 'cli',
|
|
59
|
-
complement: 'api-health',
|
|
60
66
|
body: `# Skill: Direction Inquiry
|
|
61
67
|
|
|
62
68
|
## Purpose
|
|
63
|
-
|
|
69
|
+
Read an engineering task through the Four Directions before acting on it: East
|
|
70
|
+
for vision, South for analysis, West for validation, North for action.
|
|
71
|
+
|
|
72
|
+
## What runs today
|
|
73
|
+
|
|
74
|
+
\`\`\`
|
|
75
|
+
mw_decompose_prompt { prompt: "Refactor the auth module" }
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
It answers \`primary_intent\`, \`balance_score\`, \`neglected_directions\`,
|
|
79
|
+
\`ceremony_required\`, \`ceremony_guidance\` and an \`action_stack\` whose items
|
|
80
|
+
carry \`text\`, \`direction\` and \`implicit\`. An implicit item is one the prompt
|
|
81
|
+
implied without saying. Read the neglected directions first: they name the
|
|
82
|
+
questions the prompt did not ask.
|
|
64
83
|
|
|
65
|
-
|
|
66
|
-
- Engineering task description
|
|
67
|
-
- Optional: constraints, repo paths
|
|
84
|
+
A direction's medicine, season, teaching, life stage and colour:
|
|
68
85
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
86
|
+
\`\`\`
|
|
87
|
+
mw direction east # mw directions for all four
|
|
88
|
+
mw_get_direction { direction: "east" }
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
Before debugging, fixing or root-cause work, ask which orientation the outcome
|
|
92
|
+
calls for:
|
|
93
|
+
|
|
94
|
+
\`\`\`
|
|
95
|
+
mw orient "<outcome>" [--restores "<prior state>"] [--evidence "<when it existed>"]
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
## What is NOT here
|
|
99
|
+
|
|
100
|
+
\`mw_decompose_prompt\` writes no file. The \`.pde/<yymmddHHMM>--<uuid>/\` vessels
|
|
101
|
+
in this workspace are written by tools outside this repository (\`mcp-pde\`,
|
|
102
|
+
\`miaco decompose run\`).
|
|
75
103
|
|
|
76
104
|
## Usage
|
|
77
105
|
|
|
78
|
-
>
|
|
79
|
-
>
|
|
106
|
+
> \`mw skill run\` has no implementation and exits 3. A skill is a document, not
|
|
107
|
+
> a program. **The calls above are real.**
|
|
80
108
|
>
|
|
81
|
-
>
|
|
82
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
83
|
-
> file to an agent.
|
|
109
|
+
> \`mw skill install direction-inquiry\` writes this SKILL.md into \`.mw/skills/\`.
|
|
84
110
|
|
|
85
111
|
Planned invocation (does not run yet):
|
|
86
112
|
\`\`\`
|
|
@@ -91,34 +117,54 @@ mw skill run direction-inquiry "Refactor auth module"
|
|
|
91
117
|
{
|
|
92
118
|
name: 'fire-keeper-check',
|
|
93
119
|
title: 'Fire Keeper Check',
|
|
94
|
-
description: '
|
|
120
|
+
description: 'Before an action, read the Fire Keeper status of its inquiry and run the four-step relational check-back',
|
|
95
121
|
target: 'cli',
|
|
96
|
-
complement: '
|
|
122
|
+
complement: 'precondition-guard',
|
|
97
123
|
body: `# Skill: Fire Keeper Check
|
|
98
124
|
|
|
99
125
|
## Purpose
|
|
100
|
-
|
|
126
|
+
Before an action, read whether the inquiry it serves is aligned, and run the
|
|
127
|
+
four-step relational check-back on the action itself.
|
|
128
|
+
|
|
129
|
+
## What runs today
|
|
130
|
+
|
|
131
|
+
\`\`\`
|
|
132
|
+
mw_fire_keeper_status { inquiryRef: "<inquiry or cycle>" }
|
|
133
|
+
mw_relational_check_back { action: "Deploy to production", inquiryRef: "<inquiry or cycle>" }
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
\`mw_fire_keeper_status\` answers \`status\` (\`aligned\` or \`tension\`),
|
|
137
|
+
\`confidence\`, \`issues\`, the ceremony \`phase\` and the \`active_ceremonies\`
|
|
138
|
+
linked to the inquiry.
|
|
139
|
+
|
|
140
|
+
\`mw_relational_check_back\` answers \`approved\`, a \`summary\` and four \`steps\`,
|
|
141
|
+
each with its \`question\`, \`passed\` and \`reason\`. It needs an open ceremony
|
|
142
|
+
linked to the inquiry and refuses without one, so open that first:
|
|
143
|
+
|
|
144
|
+
\`\`\`
|
|
145
|
+
mw_ceremony_open { intention: "<what this work holds>", inquiryRef: "<inquiry or cycle>" }
|
|
146
|
+
\`\`\`
|
|
101
147
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
148
|
+
The paradigm checks also run from the CLI:
|
|
149
|
+
|
|
150
|
+
\`\`\`
|
|
151
|
+
mw validate wilson "<description>" # Wilson paradigm check
|
|
152
|
+
mw validate ocap '<data_plan_json>' # OCAP® compliance check
|
|
153
|
+
mw validate accountability '<plan_json>' # accountability audit
|
|
154
|
+
\`\`\`
|
|
155
|
+
|
|
156
|
+
## What is NOT here
|
|
107
157
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- Suggested next move
|
|
158
|
+
No tool here answers "accept", "hold" or "human-needed". \`approved: false\` and
|
|
159
|
+
\`tension\` are information for the person who decides, not a decision. A gate
|
|
160
|
+
on infrastructure (linger, a free port, consent to a root step) is
|
|
161
|
+
\`mw_enforce_gate\`: see \`precondition-guard\`.
|
|
113
162
|
|
|
114
163
|
## Usage
|
|
115
164
|
|
|
116
|
-
>
|
|
117
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
165
|
+
> \`mw skill run\` has no implementation and exits 3. The calls above are real.
|
|
118
166
|
>
|
|
119
|
-
>
|
|
120
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
121
|
-
> file to an agent.
|
|
167
|
+
> \`mw skill install fire-keeper-check\` writes this SKILL.md into \`.mw/skills/\`.
|
|
122
168
|
|
|
123
169
|
Planned invocation (does not run yet):
|
|
124
170
|
\`\`\`
|
|
@@ -129,32 +175,49 @@ mw skill run fire-keeper-check "Deploy to production"
|
|
|
129
175
|
{
|
|
130
176
|
name: 'wave-spec-generator',
|
|
131
177
|
title: 'Wave Spec Generator',
|
|
132
|
-
description: '
|
|
178
|
+
description: 'Turn a goal into a wave bundle in a .pde vessel, decomposed with mw_decompose_prompt and written by hand',
|
|
133
179
|
target: 'cli',
|
|
134
|
-
complement: 'storage-config',
|
|
135
180
|
body: `# Skill: Wave Spec Generator
|
|
136
181
|
|
|
137
182
|
## Purpose
|
|
138
|
-
|
|
183
|
+
Turn a goal into a wave bundle that a supervised development cycle is launched
|
|
184
|
+
from, kept in the \`.pde/\` vessel of its decomposition.
|
|
185
|
+
|
|
186
|
+
## What runs today
|
|
187
|
+
|
|
188
|
+
\`\`\`
|
|
189
|
+
mw_decompose_prompt { prompt: "Add a caching layer" }
|
|
190
|
+
\`\`\`
|
|
139
191
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- Relevant specs
|
|
143
|
-
- Target paths and constraints
|
|
192
|
+
It gives the action stack by direction and the directions the goal neglects.
|
|
193
|
+
Nothing in this repository writes a wave bundle: it is written by hand.
|
|
144
194
|
|
|
145
|
-
##
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
195
|
+
## The shape of a vessel here
|
|
196
|
+
|
|
197
|
+
\`.pde/<yymmddHHMM>--<uuid>/\` holds \`input-prompt.md\`, \`meta.json\`,
|
|
198
|
+
\`pde-<uuid>.json\` and \`pde-<uuid>.md\`, sometimes \`revised-prompt.md\`. It is
|
|
199
|
+
written by \`mcp-pde\` or \`miaco decompose run\`, outside this repository.
|
|
200
|
+
|
|
201
|
+
The one wave bundle in this repository is
|
|
202
|
+
\`.pde/20260423-092004-copilot-storage-provider-wave/\`:
|
|
203
|
+
|
|
204
|
+
- \`ORCHESTRATION.md\`, the contract: operating sequence, constraints, context
|
|
205
|
+
directories to load, deliverables, completion criteria.
|
|
206
|
+
- \`PROMPT.txt\`, what the executing agent is given: the working directory, the
|
|
207
|
+
contract to follow, and the sequence of passes it runs.
|
|
208
|
+
|
|
209
|
+
## Steps
|
|
210
|
+
|
|
211
|
+
1. Decompose the goal, and keep the vessel the decomposition wrote.
|
|
212
|
+
2. Write \`ORCHESTRATION.md\` in it from the action stack, with the five sections above.
|
|
213
|
+
3. Write \`PROMPT.txt\` naming \`ORCHESTRATION.md\` as the contract.
|
|
214
|
+
4. Commit the vessel. An uncommitted \`.pde/\` folder is invisible to the next session.
|
|
149
215
|
|
|
150
216
|
## Usage
|
|
151
217
|
|
|
152
|
-
>
|
|
153
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
218
|
+
> \`mw skill run\` has no implementation and exits 3. \`mw_decompose_prompt\` is real.
|
|
154
219
|
>
|
|
155
|
-
>
|
|
156
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
157
|
-
> file to an agent.
|
|
220
|
+
> \`mw skill install wave-spec-generator\` writes this SKILL.md into \`.mw/skills/\`.
|
|
158
221
|
|
|
159
222
|
Planned invocation (does not run yet):
|
|
160
223
|
\`\`\`
|
|
@@ -165,32 +228,60 @@ mw skill run wave-spec-generator "Add caching layer"
|
|
|
165
228
|
{
|
|
166
229
|
name: 'ceremony-guide',
|
|
167
230
|
title: 'Ceremony Guide',
|
|
168
|
-
description: '
|
|
231
|
+
description: 'Open a ceremony bound to its episode and circle, list it, and close it with its learnings, by CLI or MCP',
|
|
169
232
|
target: 'cli',
|
|
170
|
-
complement: 'docker-setup',
|
|
171
233
|
body: `# Skill: Ceremony Guide
|
|
172
234
|
|
|
173
235
|
## Purpose
|
|
174
|
-
|
|
236
|
+
Open a ceremony, bind it to the episode and the circle it belongs to, and close
|
|
237
|
+
it with what was learned.
|
|
238
|
+
|
|
239
|
+
## What runs today
|
|
240
|
+
|
|
241
|
+
From the CLI:
|
|
242
|
+
|
|
243
|
+
\`\`\`
|
|
244
|
+
mw ceremony open "<intention>" # an opening, in the East
|
|
245
|
+
mw ceremony list [--direction east]
|
|
246
|
+
mw ceremony get <id>
|
|
247
|
+
mw ceremony close <id> "<summary>"
|
|
248
|
+
\`\`\`
|
|
249
|
+
|
|
250
|
+
Through MCP:
|
|
175
251
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
252
|
+
\`\`\`
|
|
253
|
+
mw_ceremony_open { intention: "<the intention>", type: "talking_circle", direction: "east",
|
|
254
|
+
episode_path: "<episode directory name>", circle_id: "<circle id>" }
|
|
255
|
+
list_ceremonies { episode_path: "<episode directory name>" }
|
|
256
|
+
get_ceremony { ceremony_id: "<id>" }
|
|
257
|
+
mw_ceremony_close { ceremony_id: "<id>", summary: "<what happened>", learnings: ["<one>"] }
|
|
258
|
+
\`\`\`
|
|
259
|
+
|
|
260
|
+
\`mw_ceremony_open\` also takes \`participants\`, \`medicines\`, \`inquiryRef\` and
|
|
261
|
+
\`cycleId\`. \`type\` is \`opening\` (the default), \`talking_circle\`, \`smudging\` or
|
|
262
|
+
\`spirit_feeding\`. A \`closing\` is written by \`mw_ceremony_close\`, linked to
|
|
263
|
+
the opening it closes. \`episode_path\` is the episode's directory name, never
|
|
264
|
+
its number. \`list_ceremonies\` filters by \`direction\`, \`type\`,
|
|
265
|
+
\`episode_path\`, \`circle_id\` and \`subject_id\`.
|
|
266
|
+
|
|
267
|
+
## Phases
|
|
268
|
+
|
|
269
|
+
\`ontology-core\` names four: \`opening\`, \`council\`, \`integration\`, \`closure\`.
|
|
270
|
+
\`ceremony-protocol\` carries a longer cycle: \`gathering\`, \`kindling\`,
|
|
271
|
+
\`tending\`, \`harvesting\`, \`resting\`.
|
|
272
|
+
|
|
273
|
+
## What is NOT here
|
|
179
274
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- Completion criteria
|
|
275
|
+
These tools check no seat, write no episode note and keep no audit: they are
|
|
276
|
+
the door for an agent's own ceremony. A talking circle that people sit in, with
|
|
277
|
+
seats, spoken turns and a note in the episode, opens through Miadi
|
|
278
|
+
(\`POST /api/circles/<id>/ceremonies\`).
|
|
185
279
|
|
|
186
280
|
## Usage
|
|
187
281
|
|
|
188
|
-
>
|
|
189
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
282
|
+
> \`mw skill run\` has no implementation and exits 3. The calls above are real.
|
|
190
283
|
>
|
|
191
|
-
>
|
|
192
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
193
|
-
> file to an agent.
|
|
284
|
+
> \`mw skill install ceremony-guide\` writes this SKILL.md into \`.mw/skills/\`.
|
|
194
285
|
|
|
195
286
|
Planned invocation (does not run yet):
|
|
196
287
|
\`\`\`
|
|
@@ -419,28 +510,43 @@ mw skill run drift-reconciliation --host gaia --propose
|
|
|
419
510
|
{
|
|
420
511
|
name: 'docker-setup',
|
|
421
512
|
title: 'Docker Setup',
|
|
422
|
-
description: '
|
|
513
|
+
description: 'Run the Medicine Wheel server in Docker with mwsrv --docker, and check that it answers',
|
|
423
514
|
target: 'srv',
|
|
424
|
-
complement: 'ceremony-guide',
|
|
425
515
|
body: `# Skill: Docker Setup
|
|
426
516
|
|
|
427
517
|
## Purpose
|
|
428
|
-
|
|
518
|
+
Run the Medicine Wheel server in a container, with its data kept on the host,
|
|
519
|
+
and check that it answers.
|
|
520
|
+
|
|
521
|
+
## What runs today
|
|
522
|
+
|
|
523
|
+
\`\`\`
|
|
524
|
+
mwsrv --docker [--pull] [-p 8040] [-D <dir>]
|
|
525
|
+
\`\`\`
|
|
526
|
+
|
|
527
|
+
It runs \`jgwill/medicine-wheel:app\` with the host's \`<dir>/.mw/store\` (default:
|
|
528
|
+
the working directory) mounted at \`/data/store\`, and passes
|
|
529
|
+
\`MW_DATA_DIR=/data/store\`, \`MW_STORAGE_PROVIDER=jsonl\` and \`PORT=8040\`. It
|
|
530
|
+
prints the \`docker run\` line before running it. \`--pull\` updates the image
|
|
531
|
+
first. Without \`--docker\`, \`mwsrv\` runs the same server from the installed
|
|
532
|
+
package.
|
|
533
|
+
|
|
534
|
+
The image is built and pushed from this repository by
|
|
535
|
+
\`./docker-build-push.sh [tag]\` (tag \`app\` by default).
|
|
429
536
|
|
|
430
537
|
## Checks
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
-
|
|
538
|
+
|
|
539
|
+
\`\`\`
|
|
540
|
+
docker info >/dev/null && echo "docker answers"
|
|
541
|
+
docker image inspect jgwill/medicine-wheel:app >/dev/null && echo "image present"
|
|
542
|
+
curl -s http://localhost:8040/api/health # read it with api-health
|
|
543
|
+
\`\`\`
|
|
435
544
|
|
|
436
545
|
## Usage
|
|
437
546
|
|
|
438
|
-
>
|
|
439
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
547
|
+
> \`mwsrv skill run\` has no implementation and exits 3. The commands above are real.
|
|
440
548
|
>
|
|
441
|
-
>
|
|
442
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
443
|
-
> file to an agent.
|
|
549
|
+
> \`mwsrv skill install docker-setup\` writes this SKILL.md into \`.mw/skills/\`.
|
|
444
550
|
|
|
445
551
|
Planned invocation (does not run yet):
|
|
446
552
|
\`\`\`
|
|
@@ -451,32 +557,44 @@ mwsrv skill run docker-setup
|
|
|
451
557
|
{
|
|
452
558
|
name: 'storage-config',
|
|
453
559
|
title: 'Storage Configuration',
|
|
454
|
-
description: '
|
|
560
|
+
description: 'Choose the storage provider (JSONL by default, Neon with a database URL) and check that the server took it',
|
|
455
561
|
target: 'srv',
|
|
456
|
-
complement: 'wave-spec-generator',
|
|
457
562
|
body: `# Skill: Storage Configuration
|
|
458
563
|
|
|
459
564
|
## Purpose
|
|
460
|
-
|
|
565
|
+
Choose where the wheel keeps its nodes, edges, ceremonies and beats, and check
|
|
566
|
+
that the server took the choice.
|
|
567
|
+
|
|
568
|
+
## Providers (\`@medicine-wheel/storage-provider\`)
|
|
461
569
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
570
|
+
| \`MW_STORAGE_PROVIDER\` | stores in | needs |
|
|
571
|
+
|---|---|---|
|
|
572
|
+
| \`jsonl\` (default) | JSONL files | \`MW_DATA_DIR\`, else a \`.mw/store\` folder resolved from the working directory |
|
|
573
|
+
| \`neon\` | PostgreSQL (Neon) | \`DATABASE_URL\`, \`POSTGRES_URL\` or \`NEON_DATABASE_URL\` |
|
|
574
|
+
| \`redis\` | | named and not implemented: the factory refuses it |
|
|
465
575
|
|
|
466
576
|
## Checks
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
-
|
|
470
|
-
|
|
577
|
+
|
|
578
|
+
\`\`\`
|
|
579
|
+
curl -s "$MW_API_URL/api/health"
|
|
580
|
+
mw status
|
|
581
|
+
\`\`\`
|
|
582
|
+
|
|
583
|
+
In \`/api/health\`, \`provider\` names the provider the server chose, \`counts\`
|
|
584
|
+
are the whole store's nodes and ceremonies, and \`env\` says whether
|
|
585
|
+
\`MW_STORAGE_PROVIDER\` and \`DATABASE_URL\` are set, never their values.
|
|
586
|
+
\`mw status\` prints the store directory the CLI resolves.
|
|
587
|
+
|
|
588
|
+
## What is NOT here
|
|
589
|
+
|
|
590
|
+
No migration runner ships in this repository, and moving data from one provider
|
|
591
|
+
to another is not a command.
|
|
471
592
|
|
|
472
593
|
## Usage
|
|
473
594
|
|
|
474
|
-
>
|
|
475
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
595
|
+
> \`mwsrv skill run\` has no implementation and exits 3. The checks above are real.
|
|
476
596
|
>
|
|
477
|
-
>
|
|
478
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
479
|
-
> file to an agent.
|
|
597
|
+
> \`mwsrv skill install storage-config\` writes this SKILL.md into \`.mw/skills/\`.
|
|
480
598
|
|
|
481
599
|
Planned invocation (does not run yet):
|
|
482
600
|
\`\`\`
|
|
@@ -487,28 +605,47 @@ mwsrv skill run storage-config
|
|
|
487
605
|
{
|
|
488
606
|
name: 'api-health',
|
|
489
607
|
title: 'API Health Monitor',
|
|
490
|
-
description: '
|
|
608
|
+
description: 'Read /api/health (the provider, whole-store counts, the Honcho projection and the event log) and check a wheel answers',
|
|
491
609
|
target: 'srv',
|
|
492
|
-
complement: 'direction-inquiry',
|
|
493
610
|
body: `# Skill: API Health Monitor
|
|
494
611
|
|
|
495
612
|
## Purpose
|
|
496
|
-
|
|
613
|
+
Say whether a wheel answers, from which store, and what it still owes.
|
|
497
614
|
|
|
498
|
-
##
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
|
|
615
|
+
## What runs today
|
|
616
|
+
|
|
617
|
+
\`\`\`
|
|
618
|
+
curl -s "$MW_API_URL/api/health" # MW_API_URL defaults to http://localhost:8040
|
|
619
|
+
mw status
|
|
620
|
+
\`\`\`
|
|
621
|
+
|
|
622
|
+
\`/api/health\` answers:
|
|
623
|
+
|
|
624
|
+
- \`status\`, \`healthy\` or \`unhealthy\` (with the \`error\`);
|
|
625
|
+
- \`provider\`, the storage provider in use;
|
|
626
|
+
- \`counts\`, nodes and ceremonies across the whole store, never a page of it;
|
|
627
|
+
- \`honcho\`, the projection to Honcho (enabled when \`HONCHO_URL\` is set) and
|
|
628
|
+
what is still \`pending\`;
|
|
629
|
+
- \`events\`, the event log: how many events, the last one, and what a
|
|
630
|
+
publisher still owes;
|
|
631
|
+
- \`env\`, whether \`MW_STORAGE_PROVIDER\` and \`DATABASE_URL\` are set.
|
|
632
|
+
|
|
633
|
+
\`mw status\` says whether \`/api/directions\` answers within two seconds, where
|
|
634
|
+
the MCP server is, and which store directory the CLI resolves.
|
|
635
|
+
|
|
636
|
+
Other routes worth reading: \`/api/directions\`, \`/api/nodes\`,
|
|
637
|
+
\`/api/ceremonies\`, \`/api/events\`.
|
|
638
|
+
|
|
639
|
+
## What is NOT here
|
|
640
|
+
|
|
641
|
+
No response-time measurement ships here. \`curl -s -o /dev/null -w '%{time_total}\\n' <url>\`
|
|
642
|
+
gives one.
|
|
503
643
|
|
|
504
644
|
## Usage
|
|
505
645
|
|
|
506
|
-
>
|
|
507
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
646
|
+
> \`mwsrv skill run\` has no implementation and exits 3. The calls above are real.
|
|
508
647
|
>
|
|
509
|
-
>
|
|
510
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
511
|
-
> file to an agent.
|
|
648
|
+
> \`mwsrv skill install api-health\` writes this SKILL.md into \`.mw/skills/\`.
|
|
512
649
|
|
|
513
650
|
Planned invocation (does not run yet):
|
|
514
651
|
\`\`\`
|
|
@@ -519,28 +656,39 @@ mwsrv skill run api-health
|
|
|
519
656
|
{
|
|
520
657
|
name: 'session-manager',
|
|
521
658
|
title: 'Session Manager',
|
|
522
|
-
description: '
|
|
659
|
+
description: 'Read what a recorded agent session did, from its _sessiondata events, with mw_analyze_session',
|
|
523
660
|
target: 'srv',
|
|
524
|
-
complement: 'fire-keeper-check',
|
|
525
661
|
body: `# Skill: Session Manager
|
|
526
662
|
|
|
527
663
|
## Purpose
|
|
528
|
-
|
|
664
|
+
Read what an agent session did, from the events recorded for it.
|
|
529
665
|
|
|
530
|
-
##
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
666
|
+
## What runs today
|
|
667
|
+
|
|
668
|
+
\`\`\`
|
|
669
|
+
mw_analyze_session { sessionId: "<session id>" }
|
|
670
|
+
\`\`\`
|
|
671
|
+
|
|
672
|
+
It reads the session's JSONL events from \`_sessiondata/\` under the working
|
|
673
|
+
directory, or from \`SESSION_DATA_DIR\`, and answers the \`model\`, the
|
|
674
|
+
\`eventCount\`, the \`analytics\` and the five tools the session used most.
|
|
675
|
+
|
|
676
|
+
\`@medicine-wheel/session-reader\` holds the rest as a library: \`listSessions\`,
|
|
677
|
+
\`searchSessions\`, \`getSessionSummary\`, \`getSessionEvents\`,
|
|
678
|
+
\`getSessionDetail\`, and \`getSessionBindings\` (a session's binding lines: one
|
|
679
|
+
per start, resume, rename and end).
|
|
680
|
+
|
|
681
|
+
## What is NOT here
|
|
682
|
+
|
|
683
|
+
No CLI command, route or MCP tool lists sessions, and nothing here deletes
|
|
684
|
+
session data. A session still running is someone's work in progress: read it,
|
|
685
|
+
never clear it.
|
|
535
686
|
|
|
536
687
|
## Usage
|
|
537
688
|
|
|
538
|
-
>
|
|
539
|
-
> It prints this explanation and exits 3 — nothing is executed. Planned, not shipped.
|
|
689
|
+
> \`mwsrv skill run\` has no implementation and exits 3. \`mw_analyze_session\` is real.
|
|
540
690
|
>
|
|
541
|
-
>
|
|
542
|
-
> SKILL.md into \`.mw/skills/\`. Follow the steps above yourself, or hand this
|
|
543
|
-
> file to an agent.
|
|
691
|
+
> \`mwsrv skill install session-manager\` writes this SKILL.md into \`.mw/skills/\`.
|
|
544
692
|
|
|
545
693
|
Planned invocation (does not run yet):
|
|
546
694
|
\`\`\`
|
|
@@ -717,6 +865,14 @@ function listSkills(target) {
|
|
|
717
865
|
function getSkill(name) {
|
|
718
866
|
return SKILLS.find((s) => s.name === name);
|
|
719
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* The SKILL.md a skill installs as: front matter carrying its name and
|
|
870
|
+
* description, then its body. Descriptions are written as plain YAML scalars
|
|
871
|
+
* (no `: `, no ` #`, no leading indicator), so the front matter needs no quoting.
|
|
872
|
+
*/
|
|
873
|
+
function renderSkill(skill) {
|
|
874
|
+
return `---\nname: ${skill.name}\ndescription: ${skill.description}\n---\n\n${skill.body}`;
|
|
875
|
+
}
|
|
720
876
|
/** Return the complement skill for a given skill. */
|
|
721
877
|
function getComplement(skill) {
|
|
722
878
|
return skill.complement ? getSkill(skill.complement) : undefined;
|
|
@@ -799,6 +955,7 @@ function installSkill(target, name, colors) {
|
|
|
799
955
|
for (const skill of toInstall) {
|
|
800
956
|
const skillDir = path.join(dir, skill.name);
|
|
801
957
|
const skillFile = path.join(skillDir, 'SKILL.md');
|
|
958
|
+
const content = renderSkill(skill);
|
|
802
959
|
if (fs.existsSync(skillFile)) {
|
|
803
960
|
// An existing file is never overwritten. Say so honestly when the copy
|
|
804
961
|
// on disk no longer matches the catalog, otherwise "already installed"
|
|
@@ -808,7 +965,7 @@ function installSkill(target, name, colors) {
|
|
|
808
965
|
onDisk = fs.readFileSync(skillFile, 'utf8');
|
|
809
966
|
}
|
|
810
967
|
catch { /* unreadable → treat as drifted */ }
|
|
811
|
-
if (onDisk ===
|
|
968
|
+
if (onDisk === content) {
|
|
812
969
|
console.log(` ${C.dim}⊘ ${skill.name} (already installed)${C.reset}`);
|
|
813
970
|
}
|
|
814
971
|
else {
|
|
@@ -819,7 +976,7 @@ function installSkill(target, name, colors) {
|
|
|
819
976
|
continue;
|
|
820
977
|
}
|
|
821
978
|
fs.mkdirSync(skillDir, { recursive: true });
|
|
822
|
-
fs.writeFileSync(skillFile,
|
|
979
|
+
fs.writeFileSync(skillFile, content, 'utf8');
|
|
823
980
|
installed++;
|
|
824
981
|
console.log(` ${C.green}✓${C.reset} Installed ${skill.name}`);
|
|
825
982
|
// Show complement relationship
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/app",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.5",
|
|
4
4
|
"description": "Medicine Wheel — Interactive visual layer for Indigenous relational research with Four Directions, ceremonies, and narrative arcs",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mw": "dist/cli/mw.js",
|
|
@@ -96,35 +96,35 @@
|
|
|
96
96
|
"release:major": "npm run version:major && npm run publish:all && npm run release:commit"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@medicine-wheel/ceremonial-diary": "^0.27.
|
|
100
|
-
"@medicine-wheel/ceremony-protocol": "^0.27.
|
|
101
|
-
"@medicine-wheel/community-identity": "^0.27.
|
|
102
|
-
"@medicine-wheel/community-review": "^0.27.
|
|
103
|
-
"@medicine-wheel/consent-lifecycle": "^0.27.
|
|
104
|
-
"@medicine-wheel/creative-orientation": "^0.27.
|
|
105
|
-
"@medicine-wheel/data-store": "^0.27.
|
|
106
|
-
"@medicine-wheel/data-store-postgres": "^0.27.
|
|
107
|
-
"@medicine-wheel/episode-ui": "^0.27.
|
|
108
|
-
"@medicine-wheel/episode-vessel": "^0.27.
|
|
109
|
-
"@medicine-wheel/events": "^0.27.
|
|
110
|
-
"@medicine-wheel/fire-keeper": "^0.27.
|
|
111
|
-
"@medicine-wheel/github-ceremony": "^0.27.
|
|
112
|
-
"@medicine-wheel/graph-viz": "^0.27.
|
|
113
|
-
"@medicine-wheel/honcho": "^0.27.
|
|
114
|
-
"@medicine-wheel/importance-unit": "^0.27.
|
|
115
|
-
"@medicine-wheel/mcp": "^4.27.
|
|
116
|
-
"@medicine-wheel/memory": "^0.27.
|
|
117
|
-
"@medicine-wheel/narrative-cluster": "^0.27.
|
|
118
|
-
"@medicine-wheel/narrative-engine": "^0.27.
|
|
119
|
-
"@medicine-wheel/ontology-core": "^0.27.
|
|
120
|
-
"@medicine-wheel/perception-layer": "^0.27.
|
|
121
|
-
"@medicine-wheel/prompt-decomposition": "^0.27.
|
|
122
|
-
"@medicine-wheel/relational-index": "^0.27.
|
|
123
|
-
"@medicine-wheel/relational-query": "^0.27.
|
|
124
|
-
"@medicine-wheel/session-reader": "^0.27.
|
|
125
|
-
"@medicine-wheel/storage-provider": "^0.27.
|
|
126
|
-
"@medicine-wheel/transformation-tracker": "^0.27.
|
|
127
|
-
"@medicine-wheel/ui-components": "^0.27.
|
|
99
|
+
"@medicine-wheel/ceremonial-diary": "^0.27.5",
|
|
100
|
+
"@medicine-wheel/ceremony-protocol": "^0.27.5",
|
|
101
|
+
"@medicine-wheel/community-identity": "^0.27.5",
|
|
102
|
+
"@medicine-wheel/community-review": "^0.27.5",
|
|
103
|
+
"@medicine-wheel/consent-lifecycle": "^0.27.5",
|
|
104
|
+
"@medicine-wheel/creative-orientation": "^0.27.5",
|
|
105
|
+
"@medicine-wheel/data-store": "^0.27.5",
|
|
106
|
+
"@medicine-wheel/data-store-postgres": "^0.27.5",
|
|
107
|
+
"@medicine-wheel/episode-ui": "^0.27.5",
|
|
108
|
+
"@medicine-wheel/episode-vessel": "^0.27.5",
|
|
109
|
+
"@medicine-wheel/events": "^0.27.5",
|
|
110
|
+
"@medicine-wheel/fire-keeper": "^0.27.5",
|
|
111
|
+
"@medicine-wheel/github-ceremony": "^0.27.5",
|
|
112
|
+
"@medicine-wheel/graph-viz": "^0.27.5",
|
|
113
|
+
"@medicine-wheel/honcho": "^0.27.5",
|
|
114
|
+
"@medicine-wheel/importance-unit": "^0.27.5",
|
|
115
|
+
"@medicine-wheel/mcp": "^4.27.5",
|
|
116
|
+
"@medicine-wheel/memory": "^0.27.5",
|
|
117
|
+
"@medicine-wheel/narrative-cluster": "^0.27.5",
|
|
118
|
+
"@medicine-wheel/narrative-engine": "^0.27.5",
|
|
119
|
+
"@medicine-wheel/ontology-core": "^0.27.5",
|
|
120
|
+
"@medicine-wheel/perception-layer": "^0.27.5",
|
|
121
|
+
"@medicine-wheel/prompt-decomposition": "^0.27.5",
|
|
122
|
+
"@medicine-wheel/relational-index": "^0.27.5",
|
|
123
|
+
"@medicine-wheel/relational-query": "^0.27.5",
|
|
124
|
+
"@medicine-wheel/session-reader": "^0.27.5",
|
|
125
|
+
"@medicine-wheel/storage-provider": "^0.27.5",
|
|
126
|
+
"@medicine-wheel/transformation-tracker": "^0.27.5",
|
|
127
|
+
"@medicine-wheel/ui-components": "^0.27.5",
|
|
128
128
|
"@neondatabase/serverless": "^0.10.0",
|
|
129
129
|
"@xyflow/react": "^12.3.0",
|
|
130
130
|
"clsx": "^2.1.1",
|