@skill-map/cli 0.60.3 → 0.61.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.
- package/README.md +1 -1
- package/dist/cli/tutorial/sm-tutorial/SKILL.md +149 -263
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/agents-hub/en/agents-hub.md +2 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/agents-hub/es/agents-hub.md +2 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/content-editor-style/en/content-editor-style.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/content-editor-style/es/content-editor-style.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/en/todo-bullet-agent.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/en/todo-bullet-command.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/en/todo-bullet-guideline.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/en/todo-bullet-guideline2.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/en/todo-bullet-skill.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/es/todo-bullet-agent.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/es/todo-bullet-command.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/es/todo-bullet-guideline.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/es/todo-bullet-guideline2.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/edits/todo-connectors/es/todo-bullet-skill.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/manifest.json +87 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/cli-external/en/link-validation/hijoA/note-with-external-link.md +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/cli-external/en/link-validation/hijoB/spec.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/cli-external/es/link-validation/hijoA/note-with-external-link.md +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/cli-external/es/link-validation/hijoB/spec.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/en/__PROVIDER__/commands/publish.md +15 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/en/__PROVIDER__/skills/check-links/SKILL.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/es/__PROVIDER__/commands/publish.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/harness/es/__PROVIDER__/skills/check-links/SKILL.md +17 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/en/__PROVIDER__/agents/master-agent.md +14 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/en/__PROVIDER__/skills/master-skill/SKILL.md +18 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/en/notes/ideas.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/es/__PROVIDER__/agents/master-agent.md +15 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/es/__PROVIDER__/skills/master-skill/SKILL.md +18 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/master/es/notes/ideas.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/en/AGENTS.md +6 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/en/__PROVIDER__/agents/content-editor.md +21 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/en/docs/DEPLOY.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/en/docs/STYLE.md +20 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/en/public/index.html +5 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/es/AGENTS.md +7 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/es/__PROVIDER__/agents/content-editor.md +21 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/es/docs/DEPLOY.md +12 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/es/docs/STYLE.md +21 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/es/public/index.html +5 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/shared/CLAUDE.md +1 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/shared/package.json +6 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/portfolio/shared/server.js +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/__PROVIDER__/agents/demo-agent.md +18 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/__PROVIDER__/commands/demo-command.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/__PROVIDER__/skills/demo-skill/SKILL.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/notes/demo-guideline.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/notes/demo-guideline2.md +12 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/notes/private-credentials.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/en/notes/todo.md +9 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/__PROVIDER__/agents/demo-agent.md +18 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/__PROVIDER__/commands/demo-command.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/__PROVIDER__/skills/demo-skill/SKILL.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/notes/demo-guideline.md +16 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/notes/demo-guideline2.md +13 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/notes/private-credentials.md +11 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/prologue/es/notes/todo.md +9 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/universal/en/findings.md +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/universal/es/findings.md +10 -0
- package/dist/cli/tutorial/sm-tutorial/fixtures-data/sets/universal/shared/.skillmapignore +28 -0
- package/dist/cli/tutorial/sm-tutorial/references/_core.md +55 -40
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.json +309 -0
- package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +1 -1
- package/dist/cli/tutorial/sm-tutorial/references/fixtures.md +94 -271
- package/dist/cli/tutorial/sm-tutorial/references/part-authoring.md +1 -2
- package/dist/cli/tutorial/sm-tutorial/references/part-cli.md +7 -30
- package/dist/cli/tutorial/sm-tutorial/references/part-connect-harness.md +12 -30
- package/dist/cli/tutorial/sm-tutorial/references/part-daily-loop.md +6 -4
- package/dist/cli/tutorial/sm-tutorial/references/part-fundamentals.md +14 -116
- package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +2 -3
- package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +13 -69
- package/dist/cli/tutorial/sm-tutorial/scripts/fixtures.js +238 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/args.js +29 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/fixtures-manifest.js +32 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/io.js +37 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/manifest.js +24 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/lib/paths.js +68 -0
- package/dist/cli/tutorial/sm-tutorial/scripts/state.js +262 -0
- package/dist/cli.js +7 -8
- package/dist/index.js +6 -4
- package/dist/kernel/index.js +6 -4
- package/dist/ui/chunk-FDBHGLTW.js +3 -0
- package/dist/ui/index.html +1 -1
- package/dist/ui/{main-HAPQJZOA.js → main-5GMGTLYQ.js} +1 -1
- package/package.json +5 -3
- package/dist/ui/chunk-HOIHEE6W.js +0 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider resolution shared by the tutorial scripts. The `__PROVIDER__`
|
|
3
|
+
* path token resolves to the on-disk base dir, and each provider claims
|
|
4
|
+
* a closed set of node kinds (see `_core.md` §Provider detection).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const PROVIDER_TOKEN = '__PROVIDER__';
|
|
8
|
+
|
|
9
|
+
export function providerDir(provider) {
|
|
10
|
+
// agent-skills and Antigravity share the open `.agents/skills/` layout.
|
|
11
|
+
return provider === 'agent-skills' || provider === 'antigravity'
|
|
12
|
+
? '.agents/skills'
|
|
13
|
+
: '.claude';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PROVIDER_KINDS = {
|
|
17
|
+
claude: new Set(['agent', 'command', 'skill', 'markdown']),
|
|
18
|
+
'agent-skills': new Set(['skill', 'markdown']),
|
|
19
|
+
antigravity: new Set(['skill', 'markdown']),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function kindsFor(provider) {
|
|
23
|
+
return PROVIDER_KINDS[provider] ?? PROVIDER_KINDS.claude;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Per-provider kind directories. The token path is always written in
|
|
28
|
+
* the claude shape (`__PROVIDER__/skills/<name>/...`); resolving it is
|
|
29
|
+
* NOT a flat string swap, because agent-skills puts skills directly
|
|
30
|
+
* under `.agents/skills/<name>/` (no intermediate `skills/` segment).
|
|
31
|
+
*/
|
|
32
|
+
const KIND_DIRS = {
|
|
33
|
+
claude: { agents: '.claude/agents', commands: '.claude/commands', skills: '.claude/skills' },
|
|
34
|
+
'agent-skills': { skills: '.agents/skills' },
|
|
35
|
+
antigravity: { skills: '.agents/skills' },
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a token-form relative path (`__PROVIDER__/skills/x/SKILL.md`,
|
|
40
|
+
* `notes/todo.md`) to its real on-disk path for the provider. Paths
|
|
41
|
+
* without the token are returned unchanged. Unsupported kinds fall back
|
|
42
|
+
* to a flat join, callers skip them before laying, so the fallback only
|
|
43
|
+
* matters for footprint deletes (a no-op on a path never written).
|
|
44
|
+
*/
|
|
45
|
+
export function resolveTargetPath(tokenRel, provider) {
|
|
46
|
+
if (!tokenRel.startsWith(`${PROVIDER_TOKEN}/`)) return tokenRel;
|
|
47
|
+
const rest = tokenRel.slice(PROVIDER_TOKEN.length + 1);
|
|
48
|
+
const slash = rest.indexOf('/');
|
|
49
|
+
const kindSeg = slash >= 0 ? rest.slice(0, slash) : rest;
|
|
50
|
+
const tail = slash >= 0 ? rest.slice(slash + 1) : '';
|
|
51
|
+
const base = (KIND_DIRS[provider] ?? KIND_DIRS.claude)[kindSeg];
|
|
52
|
+
if (!base) return `${providerDir(provider)}/${rest}`;
|
|
53
|
+
return tail ? `${base}/${tail}` : base;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Derive a node kind from a token-form relative path. Matches how
|
|
58
|
+
* skill-map's providers classify by directory: agents / commands /
|
|
59
|
+
* skills folders under the provider dir, everything else markdown.
|
|
60
|
+
*/
|
|
61
|
+
export function kindForPath(tokenRelPath) {
|
|
62
|
+
if (tokenRelPath.startsWith(`${PROVIDER_TOKEN}/agents/`)) return 'agent';
|
|
63
|
+
if (tokenRelPath.startsWith(`${PROVIDER_TOKEN}/commands/`)) return 'command';
|
|
64
|
+
if (tokenRelPath.startsWith(`${PROVIDER_TOKEN}/skills/`)) return 'skill';
|
|
65
|
+
return 'markdown';
|
|
66
|
+
}
|
|
67
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="af99c74c-ee9a-5bf3-8daf-f0b9320a3e61")}catch(e){}}();
|
|
68
|
+
//# debugId=af99c74c-ee9a-5bf3-8daf-f0b9320a3e61
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* state.js, the sm-tutorial state engine.
|
|
4
|
+
*
|
|
5
|
+
* Owns `tutorial-state.json` entirely; the orchestrating agent calls
|
|
6
|
+
* these verbs instead of hand-editing the file. Zero-dep, Node 24+,
|
|
7
|
+
* ESM. This is backstage machinery (same class as `Write`), NOT a
|
|
8
|
+
* teaching `sm` verb the tester runs.
|
|
9
|
+
*
|
|
10
|
+
* Every verb prints ONE JSON line to stdout and exits 0 on success, or
|
|
11
|
+
* a `{ ok: false, code, error }` envelope with a non-zero exit on
|
|
12
|
+
* failure. The agent parses stdout.
|
|
13
|
+
*
|
|
14
|
+
* Verbs:
|
|
15
|
+
* init --cwd <abs> --sm-version <s> --provider <p> --lang <l> [--force]
|
|
16
|
+
* pick <partId>
|
|
17
|
+
* mark <partId> <chapterId> <done|failed|skipped>
|
|
18
|
+
* set-part <partId> <not_started|in_progress|done|declined|skipped>
|
|
19
|
+
* set-identity --name <s> --tagline <s>
|
|
20
|
+
* status
|
|
21
|
+
* wipe-list
|
|
22
|
+
* wipe --confirm
|
|
23
|
+
*
|
|
24
|
+
* State path is `<cwd>/tutorial-state.json` (cwd = process.cwd()). The
|
|
25
|
+
* stored `tutorial.cwd` is the safety anchor for wipe.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { join } from 'node:path';
|
|
29
|
+
import { rmSync, rmdirSync, readdirSync } from 'node:fs';
|
|
30
|
+
|
|
31
|
+
import { parseArgs } from './lib/args.js';
|
|
32
|
+
import { exists, readJson, writeJson, succeed, die } from './lib/io.js';
|
|
33
|
+
import { loadManifest, findPart } from './lib/manifest.js';
|
|
34
|
+
import { providerDir } from './lib/paths.js';
|
|
35
|
+
import { loadFixturesManifest, resolveFootprint } from './lib/fixtures-manifest.js';
|
|
36
|
+
|
|
37
|
+
const STATE_FILE = 'tutorial-state.json';
|
|
38
|
+
const STATE_VERSION = 2;
|
|
39
|
+
const PART_STATUS = new Set(['not_started', 'in_progress', 'done', 'declined', 'skipped']);
|
|
40
|
+
const CHAPTER_STATUS = new Set(['done', 'failed', 'skipped']);
|
|
41
|
+
|
|
42
|
+
const statePath = () => join(process.cwd(), STATE_FILE);
|
|
43
|
+
const now = () => new Date().toISOString();
|
|
44
|
+
|
|
45
|
+
function loadState() {
|
|
46
|
+
const p = statePath();
|
|
47
|
+
if (!exists(p)) {
|
|
48
|
+
die('no-state', `${STATE_FILE} not found in ${process.cwd()}; run \`state init\` first.`);
|
|
49
|
+
}
|
|
50
|
+
return readJson(p);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function saveState(state) {
|
|
54
|
+
writeJson(statePath(), state);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function seedPart(manifest, id) {
|
|
58
|
+
const def = findPart(manifest, id);
|
|
59
|
+
if (!def) die('unknown-part', `part '${id}' is not in the manifest.`);
|
|
60
|
+
const chapters = {};
|
|
61
|
+
for (const ch of def.chapters) chapters[ch.id] = { status: 'pending' };
|
|
62
|
+
return { status: 'in_progress', chapters };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const VERBS = {
|
|
66
|
+
init(args) {
|
|
67
|
+
const p = statePath();
|
|
68
|
+
if (exists(p) && !args.flags.force) {
|
|
69
|
+
die('exists', `${STATE_FILE} already exists; pass --force to overwrite.`);
|
|
70
|
+
}
|
|
71
|
+
const state = {
|
|
72
|
+
tutorial: {
|
|
73
|
+
version: STATE_VERSION,
|
|
74
|
+
started_at: now(),
|
|
75
|
+
cwd: args.flags.cwd ?? process.cwd(),
|
|
76
|
+
sm_version: args.flags['sm-version'] ?? null,
|
|
77
|
+
provider: args.flags.provider ?? 'claude',
|
|
78
|
+
lang: args.flags.lang ?? 'en',
|
|
79
|
+
},
|
|
80
|
+
tester: { level: 2 },
|
|
81
|
+
parts: {},
|
|
82
|
+
findings_file: './findings.md',
|
|
83
|
+
};
|
|
84
|
+
saveState(state);
|
|
85
|
+
succeed({ state });
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
pick(args) {
|
|
89
|
+
const id = args.positional[0];
|
|
90
|
+
if (!id) die('bad-args', 'usage: pick <partId>');
|
|
91
|
+
const state = loadState();
|
|
92
|
+
const manifest = loadManifest();
|
|
93
|
+
if (!state.parts[id]) {
|
|
94
|
+
state.parts[id] = seedPart(manifest, id);
|
|
95
|
+
saveState(state);
|
|
96
|
+
}
|
|
97
|
+
succeed({ part: { id, ...state.parts[id] } });
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
mark(args) {
|
|
101
|
+
const [id, chapterId, status] = args.positional;
|
|
102
|
+
if (!id || !chapterId || !status) {
|
|
103
|
+
die('bad-args', 'usage: mark <partId> <chapterId> <done|failed|skipped>');
|
|
104
|
+
}
|
|
105
|
+
if (!CHAPTER_STATUS.has(status)) {
|
|
106
|
+
die('bad-status', `chapter status must be one of ${[...CHAPTER_STATUS].join(', ')}`);
|
|
107
|
+
}
|
|
108
|
+
const state = loadState();
|
|
109
|
+
const part = state.parts[id];
|
|
110
|
+
if (!part) die('not-picked', `part '${id}' has not been picked; run \`pick ${id}\` first.`);
|
|
111
|
+
if (!part.chapters[chapterId]) die('unknown-chapter', `chapter '${chapterId}' not in part '${id}'.`);
|
|
112
|
+
|
|
113
|
+
part.chapters[chapterId] = { status, at: now() };
|
|
114
|
+
const statuses = Object.values(part.chapters).map((c) => c.status);
|
|
115
|
+
const allDone = !statuses.includes('pending');
|
|
116
|
+
// Auto-promote the part only on a clean finish (every chapter done
|
|
117
|
+
// or skipped). A `failed` chapter leaves the part in_progress so the
|
|
118
|
+
// agent decides how to surface it; `allDone` still reports the walk
|
|
119
|
+
// is complete.
|
|
120
|
+
if (allDone && !statuses.includes('failed')) part.status = 'done';
|
|
121
|
+
saveState(state);
|
|
122
|
+
succeed({ part: { id, ...part }, allDone });
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
'set-part'(args) {
|
|
126
|
+
const [id, status] = args.positional;
|
|
127
|
+
if (!id || !status) die('bad-args', 'usage: set-part <partId> <status>');
|
|
128
|
+
if (!PART_STATUS.has(status)) {
|
|
129
|
+
die('bad-status', `part status must be one of ${[...PART_STATUS].join(', ')}`);
|
|
130
|
+
}
|
|
131
|
+
const state = loadState();
|
|
132
|
+
const manifest = loadManifest();
|
|
133
|
+
if (!state.parts[id]) state.parts[id] = seedPart(manifest, id);
|
|
134
|
+
state.parts[id].status = status;
|
|
135
|
+
saveState(state);
|
|
136
|
+
succeed({ part: { id, ...state.parts[id] } });
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
'set-identity'(args) {
|
|
140
|
+
const { name, tagline } = args.flags;
|
|
141
|
+
if (!name || !tagline) die('bad-args', 'usage: set-identity --name <s> --tagline <s>');
|
|
142
|
+
const state = loadState();
|
|
143
|
+
state.tester.site_identity = { name: String(name), tagline: String(tagline) };
|
|
144
|
+
saveState(state);
|
|
145
|
+
succeed({ site_identity: state.tester.site_identity });
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
status() {
|
|
149
|
+
const state = loadState();
|
|
150
|
+
const manifest = loadManifest();
|
|
151
|
+
const parts = manifest.parts
|
|
152
|
+
.filter((p) => p.status === 'active' || state.parts[p.id])
|
|
153
|
+
.map((p) => {
|
|
154
|
+
const tracked = state.parts[p.id];
|
|
155
|
+
return {
|
|
156
|
+
id: p.id,
|
|
157
|
+
title: p.title,
|
|
158
|
+
order: p.order,
|
|
159
|
+
status: tracked?.status ?? 'not_started',
|
|
160
|
+
chapters: p.chapters.map((c) => ({
|
|
161
|
+
id: c.id,
|
|
162
|
+
title: c.title,
|
|
163
|
+
status: tracked?.chapters?.[c.id]?.status ?? 'pending',
|
|
164
|
+
})),
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
succeed({ tutorial: state.tutorial, tester: state.tester, parts });
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
'wipe-list'() {
|
|
171
|
+
const state = loadState();
|
|
172
|
+
const guard = cwdGuard(state);
|
|
173
|
+
if (guard) die(guard.code, guard.error);
|
|
174
|
+
succeed({ cwd: state.tutorial.cwd, paths: computeWipePaths(state) });
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
wipe(args) {
|
|
178
|
+
if (!args.flags.confirm) {
|
|
179
|
+
die('confirm-required', 'pass --confirm to delete; use `wipe-list` to preview.');
|
|
180
|
+
}
|
|
181
|
+
const state = loadState();
|
|
182
|
+
const guard = cwdGuard(state);
|
|
183
|
+
if (guard) die(guard.code, guard.error);
|
|
184
|
+
const deleted = [];
|
|
185
|
+
for (const rel of computeWipePaths(state)) {
|
|
186
|
+
const abs = join(process.cwd(), rel);
|
|
187
|
+
if (exists(abs)) {
|
|
188
|
+
rmSync(abs, { recursive: true, force: true });
|
|
189
|
+
deleted.push(rel);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
rmdirEmptyParents(state);
|
|
193
|
+
succeed({ deleted });
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
function cwdGuard(state) {
|
|
198
|
+
const stored = state.tutorial?.cwd;
|
|
199
|
+
if (stored && stored !== process.cwd()) {
|
|
200
|
+
return {
|
|
201
|
+
code: 'cwd-mismatch',
|
|
202
|
+
error: `state cwd (${stored}) != current dir (${process.cwd()}); refusing. Move to the saved dir or delete ${STATE_FILE} by hand.`,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The exact paths to remove on start-over, derived from which parts the
|
|
210
|
+
* state records as run. The per-fixture footprints (the on-disk reach
|
|
211
|
+
* of each fixture, including files taught later in its chapters) live
|
|
212
|
+
* once in `fixtures-data/manifest.json` and are shared with
|
|
213
|
+
* `fixtures.js clear`; here we union the footprints of the tracked
|
|
214
|
+
* parts with the universals. Never lists a bare user dir (`notes/`);
|
|
215
|
+
* empty parents are rmdir'd afterwards.
|
|
216
|
+
*/
|
|
217
|
+
function computeWipePaths(state) {
|
|
218
|
+
const provider = state.tutorial?.provider ?? 'claude';
|
|
219
|
+
const has = (id) => Boolean(state.parts?.[id]);
|
|
220
|
+
const manifest = loadFixturesManifest();
|
|
221
|
+
const paths = new Set(['tutorial-state.json', 'findings.md', '.skillmapignore', '.skill-map']);
|
|
222
|
+
const addFootprint = (name) => resolveFootprint(manifest, name, provider).forEach((p) => paths.add(p));
|
|
223
|
+
|
|
224
|
+
if (has('fundamentals')) addFootprint('prologue');
|
|
225
|
+
if (has('project-kickoff') || has('connect-harness') || has('daily-loop')) addFootprint('portfolio');
|
|
226
|
+
if (has('extend')) addFootprint('master');
|
|
227
|
+
// `cli` seeds the prologue demo fixture plus its external-ref demo.
|
|
228
|
+
if (has('cli')) { addFootprint('prologue'); addFootprint('cli-external'); }
|
|
229
|
+
|
|
230
|
+
try {
|
|
231
|
+
for (const entry of readdirSync(process.cwd())) {
|
|
232
|
+
if (/^export\./.test(entry) || entry === 'dump.sql') paths.add(entry);
|
|
233
|
+
}
|
|
234
|
+
} catch { /* cwd unreadable, skip the glob */ }
|
|
235
|
+
|
|
236
|
+
return [...paths];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function rmdirEmptyParents(state) {
|
|
240
|
+
const pd = providerDir(state.tutorial?.provider ?? 'claude');
|
|
241
|
+
// Children before parents; `rmdirSync` only removes empty dirs, so the
|
|
242
|
+
// tutorial's own skill dir under `<pd>/skills/` keeps `<pd>` alive.
|
|
243
|
+
const candidates = ['notes', 'docs', 'public', `${pd}/agents`, `${pd}/skills`, `${pd}/commands`, pd];
|
|
244
|
+
for (const rel of candidates) {
|
|
245
|
+
try {
|
|
246
|
+
rmdirSync(join(process.cwd(), rel));
|
|
247
|
+
} catch { /* not empty or missing, leave it */ }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function main() {
|
|
252
|
+
const [verb, ...rest] = process.argv.slice(2);
|
|
253
|
+
const handler = VERBS[verb];
|
|
254
|
+
if (!handler) {
|
|
255
|
+
die('unknown-verb', `unknown verb '${verb ?? ''}'; expected one of ${Object.keys(VERBS).join(', ')}`);
|
|
256
|
+
}
|
|
257
|
+
handler(parseArgs(rest));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
main();
|
|
261
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="547a8c8d-f962-571c-ae72-8edbb1fc756c")}catch(e){}}();
|
|
262
|
+
//# debugId=547a8c8d-f962-571c-ae72-8edbb1fc756c
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// cli/entry.ts
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="81a4f94d-0bdd-5d3c-8319-4331c127c6bd")}catch(e){}}();
|
|
4
4
|
import { existsSync as existsSync33 } from "fs";
|
|
5
5
|
import { Builtins, Cli as Cli2 } from "clipanion";
|
|
6
6
|
|
|
@@ -250,7 +250,7 @@ function bucketByKind(kind, instance, bag) {
|
|
|
250
250
|
// package.json
|
|
251
251
|
var package_default = {
|
|
252
252
|
name: "@skill-map/cli",
|
|
253
|
-
version: "0.
|
|
253
|
+
version: "0.61.0",
|
|
254
254
|
description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
|
|
255
255
|
license: "MIT",
|
|
256
256
|
type: "module",
|
|
@@ -305,9 +305,11 @@ var package_default = {
|
|
|
305
305
|
"built-ins:check": "node ../scripts/generate-built-ins.js --check",
|
|
306
306
|
"view-catalog": "node ../scripts/generate-view-catalog.js",
|
|
307
307
|
"view-catalog:check": "node ../scripts/generate-view-catalog.js --check",
|
|
308
|
+
"tutorial-manifest": "node scripts/generate-tutorial-manifest.js",
|
|
309
|
+
"tutorial-manifest:check": "node scripts/generate-tutorial-manifest.js --check",
|
|
308
310
|
prebuild: "pnpm build-built-ins",
|
|
309
311
|
validate: "pnpm validate:compile && pnpm validate:test",
|
|
310
|
-
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check",
|
|
312
|
+
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check && pnpm tutorial-manifest:check",
|
|
311
313
|
"validate:test": "pnpm test:ci && pnpm conformance",
|
|
312
314
|
conformance: "SKILL_MAP_TELEMETRY=0 SM_NO_UPDATE_CHECK=1 node --import tsx cli/entry.ts conformance run",
|
|
313
315
|
pretest: "tsup",
|
|
@@ -30861,21 +30863,19 @@ var VersionCommand = class extends SmCommand {
|
|
|
30861
30863
|
static paths = [["version"]];
|
|
30862
30864
|
static usage = Command39.Usage({
|
|
30863
30865
|
category: "Introspection",
|
|
30864
|
-
description: "Print the CLI /
|
|
30866
|
+
description: "Print the CLI / spec / runtime / db-schema version matrix."
|
|
30865
30867
|
});
|
|
30866
30868
|
// Informational verb, no `done in <…>` line; the version matrix is
|
|
30867
30869
|
// the entire output.
|
|
30868
30870
|
emitElapsed = false;
|
|
30869
30871
|
async run() {
|
|
30870
30872
|
const runtime = `Node ${process.version}`;
|
|
30871
|
-
const kernelVersion = VERSION;
|
|
30872
30873
|
const specVersion = await resolveSpecVersion3();
|
|
30873
30874
|
const dbSchema = await resolveDbSchemaVersion();
|
|
30874
30875
|
const dev = isDevBuild();
|
|
30875
30876
|
if (this.json) {
|
|
30876
30877
|
const payload = {
|
|
30877
30878
|
sm: VERSION,
|
|
30878
|
-
kernel: kernelVersion,
|
|
30879
30879
|
spec: specVersion,
|
|
30880
30880
|
dbSchema
|
|
30881
30881
|
};
|
|
@@ -30887,7 +30887,6 @@ var VersionCommand = class extends SmCommand {
|
|
|
30887
30887
|
const smValue = dev ? `${VERSION} ${ansi.yellow("[dev]")}` : VERSION;
|
|
30888
30888
|
const lines = [
|
|
30889
30889
|
["sm", smValue],
|
|
30890
|
-
["kernel", kernelVersion],
|
|
30891
30890
|
["spec", specVersion],
|
|
30892
30891
|
["runtime", runtime],
|
|
30893
30892
|
["db-schema", dbSchema]
|
|
@@ -31058,4 +31057,4 @@ function resolveBareDefault() {
|
|
|
31058
31057
|
process.exit(ExitCode.Error);
|
|
31059
31058
|
}
|
|
31060
31059
|
//# sourceMappingURL=cli.js.map
|
|
31061
|
-
//# debugId=
|
|
31060
|
+
//# debugId=81a4f94d-0bdd-5d3c-8319-4331c127c6bd
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// kernel/i18n/registry.texts.ts
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="67729ef7-56b3-52e1-842e-a6529ab3dec8")}catch(e){}}();
|
|
4
4
|
var REGISTRY_TEXTS = {
|
|
5
5
|
duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
|
|
6
6
|
unknownKind: "Unknown extension kind: {{kind}}",
|
|
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
|
|
|
102
102
|
// package.json
|
|
103
103
|
var package_default = {
|
|
104
104
|
name: "@skill-map/cli",
|
|
105
|
-
version: "0.
|
|
105
|
+
version: "0.61.0",
|
|
106
106
|
description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
|
|
107
107
|
license: "MIT",
|
|
108
108
|
type: "module",
|
|
@@ -157,9 +157,11 @@ var package_default = {
|
|
|
157
157
|
"built-ins:check": "node ../scripts/generate-built-ins.js --check",
|
|
158
158
|
"view-catalog": "node ../scripts/generate-view-catalog.js",
|
|
159
159
|
"view-catalog:check": "node ../scripts/generate-view-catalog.js --check",
|
|
160
|
+
"tutorial-manifest": "node scripts/generate-tutorial-manifest.js",
|
|
161
|
+
"tutorial-manifest:check": "node scripts/generate-tutorial-manifest.js --check",
|
|
160
162
|
prebuild: "pnpm build-built-ins",
|
|
161
163
|
validate: "pnpm validate:compile && pnpm validate:test",
|
|
162
|
-
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check",
|
|
164
|
+
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check && pnpm tutorial-manifest:check",
|
|
163
165
|
"validate:test": "pnpm test:ci && pnpm conformance",
|
|
164
166
|
conformance: "SKILL_MAP_TELEMETRY=0 SM_NO_UPDATE_CHECK=1 node --import tsx cli/entry.ts conformance run",
|
|
165
167
|
pretest: "tsup",
|
|
@@ -3845,4 +3847,4 @@ export {
|
|
|
3845
3847
|
runScanWithRenames
|
|
3846
3848
|
};
|
|
3847
3849
|
//# sourceMappingURL=index.js.map
|
|
3848
|
-
//# debugId=
|
|
3850
|
+
//# debugId=67729ef7-56b3-52e1-842e-a6529ab3dec8
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// kernel/i18n/registry.texts.ts
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a6c637fa-361c-5922-ade9-901c3b64c47a")}catch(e){}}();
|
|
4
4
|
var REGISTRY_TEXTS = {
|
|
5
5
|
duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
|
|
6
6
|
unknownKind: "Unknown extension kind: {{kind}}",
|
|
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
|
|
|
102
102
|
// package.json
|
|
103
103
|
var package_default = {
|
|
104
104
|
name: "@skill-map/cli",
|
|
105
|
-
version: "0.
|
|
105
|
+
version: "0.61.0",
|
|
106
106
|
description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
|
|
107
107
|
license: "MIT",
|
|
108
108
|
type: "module",
|
|
@@ -157,9 +157,11 @@ var package_default = {
|
|
|
157
157
|
"built-ins:check": "node ../scripts/generate-built-ins.js --check",
|
|
158
158
|
"view-catalog": "node ../scripts/generate-view-catalog.js",
|
|
159
159
|
"view-catalog:check": "node ../scripts/generate-view-catalog.js --check",
|
|
160
|
+
"tutorial-manifest": "node scripts/generate-tutorial-manifest.js",
|
|
161
|
+
"tutorial-manifest:check": "node scripts/generate-tutorial-manifest.js --check",
|
|
160
162
|
prebuild: "pnpm build-built-ins",
|
|
161
163
|
validate: "pnpm validate:compile && pnpm validate:test",
|
|
162
|
-
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check",
|
|
164
|
+
"validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm built-ins:check && pnpm view-catalog:check && pnpm tutorial-manifest:check",
|
|
163
165
|
"validate:test": "pnpm test:ci && pnpm conformance",
|
|
164
166
|
conformance: "SKILL_MAP_TELEMETRY=0 SM_NO_UPDATE_CHECK=1 node --import tsx cli/entry.ts conformance run",
|
|
165
167
|
pretest: "tsup",
|
|
@@ -3845,4 +3847,4 @@ export {
|
|
|
3845
3847
|
runScanWithRenames
|
|
3846
3848
|
};
|
|
3847
3849
|
//# sourceMappingURL=index.js.map
|
|
3848
|
-
//# debugId=
|
|
3850
|
+
//# debugId=a6c637fa-361c-5922-ade9-901c3b64c47a
|