@skill-map/cli 0.11.1 → 0.12.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.js +122 -107
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# skill-map
|
|
2
2
|
|
|
3
|
-
Map, inspect, and manage collections of interrelated Markdown files — skills, agents, commands, hooks, and notes that compose AI-agent ecosystems (Claude Code, Codex, Gemini, Copilot,
|
|
3
|
+
Map, inspect, and manage collections of interrelated Markdown files — skills, agents, commands, hooks, and notes that compose AI-agent ecosystems (Claude Code, Codex, Gemini, Copilot, docs sites).
|
|
4
4
|
|
|
5
5
|
**Status**: pre-1.0, active development. Steps 0a–9 are complete (spec, kernel, plugin loader, full CLI surface, plugin author UX). Step 14 (Full Web UI) is in progress with sub-steps 14.1–14.4 closed (Hono BFF + REST + WebSocket broadcaster + reactive UI); 14.5–14.7 (polish + bundle budgets + responsive scope) still pending. The full deterministic scan, check, history, orphans, plugin authoring, and `sm serve` are live; the optional LLM layer (Phase B / `v0.8.0`) lands after Step 14 closes. See [`ROADMAP.md`](../ROADMAP.md) for the canonical completeness marker and full execution plan. Releases follow the standard changeset flow.
|
|
6
6
|
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// cli/entry.ts
|
|
2
|
+
import { existsSync as existsSync19 } from "fs";
|
|
2
3
|
import { Builtins, Cli as Cli2 } from "clipanion";
|
|
3
4
|
|
|
4
5
|
// kernel/adapters/silent-logger.ts
|
|
@@ -28,6 +29,30 @@ function configureLogger(impl) {
|
|
|
28
29
|
active = impl;
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
// kernel/util/tx.ts
|
|
33
|
+
var TOKEN_RE = /\{\{\s*([A-Za-z][A-Za-z0-9_]*)\s*\}\}/g;
|
|
34
|
+
function tx(template, vars = {}) {
|
|
35
|
+
return template.replace(TOKEN_RE, (_match, name) => {
|
|
36
|
+
if (!Object.prototype.hasOwnProperty.call(vars, name)) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`tx: missing variable "${name}" for template "${template.slice(0, 80)}${template.length > 80 ? "\u2026" : ""}"`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const value = vars[name];
|
|
42
|
+
if (value === null || value === void 0) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
`tx: variable "${name}" is null/undefined for template "${template.slice(0, 80)}${template.length > 80 ? "\u2026" : ""}"`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
return String(value);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// cli/i18n/entry.texts.ts
|
|
52
|
+
var ENTRY_TEXTS = {
|
|
53
|
+
bareNoProject: 'No skill-map project found in {{cwd}}.\nRun "sm init" to bootstrap one, or "sm --help" to see all commands.\n'
|
|
54
|
+
};
|
|
55
|
+
|
|
31
56
|
// kernel/ports/logger.ts
|
|
32
57
|
var LOG_LEVELS = [
|
|
33
58
|
"trace",
|
|
@@ -65,25 +90,6 @@ function sanitizeForTerminal(text) {
|
|
|
65
90
|
return text.replace(ANSI_ESCAPE_RE, "").replace(C0_CONTROL_RE, "");
|
|
66
91
|
}
|
|
67
92
|
|
|
68
|
-
// kernel/util/tx.ts
|
|
69
|
-
var TOKEN_RE = /\{\{\s*([A-Za-z][A-Za-z0-9_]*)\s*\}\}/g;
|
|
70
|
-
function tx(template, vars = {}) {
|
|
71
|
-
return template.replace(TOKEN_RE, (_match, name) => {
|
|
72
|
-
if (!Object.prototype.hasOwnProperty.call(vars, name)) {
|
|
73
|
-
throw new Error(
|
|
74
|
-
`tx: missing variable "${name}" for template "${template.slice(0, 80)}${template.length > 80 ? "\u2026" : ""}"`
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
const value = vars[name];
|
|
78
|
-
if (value === null || value === void 0) {
|
|
79
|
-
throw new Error(
|
|
80
|
-
`tx: variable "${name}" is null/undefined for template "${template.slice(0, 80)}${template.length > 80 ? "\u2026" : ""}"`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
return String(value);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
93
|
// cli/i18n/logger.texts.ts
|
|
88
94
|
var LOGGER_TEXTS = {
|
|
89
95
|
invalidLevel: 'invalid log level "{{value}}" (expected one of: {{allowed}})\n'
|
|
@@ -179,6 +185,91 @@ function extractLogLevelFlag(argv) {
|
|
|
179
185
|
}
|
|
180
186
|
var LOGGER_ENV_VAR = ENV_VAR;
|
|
181
187
|
|
|
188
|
+
// cli/util/db-path.ts
|
|
189
|
+
import { existsSync } from "fs";
|
|
190
|
+
import { join, resolve } from "path";
|
|
191
|
+
|
|
192
|
+
// cli/i18n/util.texts.ts
|
|
193
|
+
var UTIL_TEXTS = {
|
|
194
|
+
// db-path.ts
|
|
195
|
+
dbNotFound: "DB not found at {{path}}; run `sm scan` first.\n",
|
|
196
|
+
// elapsed.ts
|
|
197
|
+
doneIn: "done in {{elapsed}}\n",
|
|
198
|
+
// confirm.ts (default-no prompt suffix)
|
|
199
|
+
confirmPromptSuffix: " [y/N] ",
|
|
200
|
+
/**
|
|
201
|
+
* Regex source matching affirmative answers in `confirm()`. Compiled
|
|
202
|
+
* with the `i` flag in the helper. Pre-i18n today the pattern is
|
|
203
|
+
* English-only; when a non-English locale lands the catalog grows
|
|
204
|
+
* alternations (e.g. `^(y(es)?|s(í|i)?)$`).
|
|
205
|
+
*/
|
|
206
|
+
confirmYesPatternSource: "^y(es)?$"
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// cli/util/db-path.ts
|
|
210
|
+
var SKILL_MAP_DIR = ".skill-map";
|
|
211
|
+
var DB_FILENAME = "skill-map.db";
|
|
212
|
+
var JOBS_DIRNAME = "jobs";
|
|
213
|
+
var PLUGINS_DIRNAME = "plugins";
|
|
214
|
+
var SETTINGS_FILENAME = "settings.json";
|
|
215
|
+
var LOCAL_SETTINGS_FILENAME = "settings.local.json";
|
|
216
|
+
var IGNORE_FILENAME = ".skill-mapignore";
|
|
217
|
+
var DEFAULT_DB_REL = `${SKILL_MAP_DIR}/${DB_FILENAME}`;
|
|
218
|
+
var GITIGNORE_ENTRIES = [
|
|
219
|
+
`${SKILL_MAP_DIR}/${LOCAL_SETTINGS_FILENAME}`,
|
|
220
|
+
`${SKILL_MAP_DIR}/${DB_FILENAME}`
|
|
221
|
+
];
|
|
222
|
+
function resolveDbPath(options) {
|
|
223
|
+
if (options.db) return resolve(options.db);
|
|
224
|
+
if (options.global) return join(options.homedir, DEFAULT_DB_REL);
|
|
225
|
+
return resolve(options.cwd, DEFAULT_DB_REL);
|
|
226
|
+
}
|
|
227
|
+
function defaultProjectDbPath(ctx) {
|
|
228
|
+
return resolve(ctx.cwd, DEFAULT_DB_REL);
|
|
229
|
+
}
|
|
230
|
+
function defaultProjectJobsDir(ctx) {
|
|
231
|
+
return resolve(ctx.cwd, SKILL_MAP_DIR, JOBS_DIRNAME);
|
|
232
|
+
}
|
|
233
|
+
function defaultProjectPluginsDir(ctx) {
|
|
234
|
+
return resolve(ctx.cwd, SKILL_MAP_DIR, PLUGINS_DIRNAME);
|
|
235
|
+
}
|
|
236
|
+
function defaultUserPluginsDir(ctx) {
|
|
237
|
+
return join(ctx.homedir, SKILL_MAP_DIR, PLUGINS_DIRNAME);
|
|
238
|
+
}
|
|
239
|
+
function defaultDbPath(scopeRoot) {
|
|
240
|
+
return join(scopeRoot, SKILL_MAP_DIR, DB_FILENAME);
|
|
241
|
+
}
|
|
242
|
+
function defaultSettingsPath(scopeRoot) {
|
|
243
|
+
return join(scopeRoot, SKILL_MAP_DIR, SETTINGS_FILENAME);
|
|
244
|
+
}
|
|
245
|
+
function defaultLocalSettingsPath(scopeRoot) {
|
|
246
|
+
return join(scopeRoot, SKILL_MAP_DIR, LOCAL_SETTINGS_FILENAME);
|
|
247
|
+
}
|
|
248
|
+
function defaultIgnoreFilePath(scopeRoot) {
|
|
249
|
+
return join(scopeRoot, IGNORE_FILENAME);
|
|
250
|
+
}
|
|
251
|
+
function assertDbExists(path, stderr) {
|
|
252
|
+
if (path === ":memory:" || existsSync(path)) return true;
|
|
253
|
+
stderr.write(tx(UTIL_TEXTS.dbNotFound, { path }));
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// cli/util/exit-codes.ts
|
|
258
|
+
var ExitCode = {
|
|
259
|
+
Ok: 0,
|
|
260
|
+
Issues: 1,
|
|
261
|
+
Error: 2,
|
|
262
|
+
Duplicate: 3,
|
|
263
|
+
NonceMismatch: 4,
|
|
264
|
+
NotFound: 5
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// cli/util/runtime-context.ts
|
|
268
|
+
import { homedir } from "os";
|
|
269
|
+
function defaultRuntimeContext() {
|
|
270
|
+
return { cwd: process.cwd(), homedir: homedir() };
|
|
271
|
+
}
|
|
272
|
+
|
|
182
273
|
// cli/commands/check.ts
|
|
183
274
|
import { Command as Command2, Option as Option2 } from "clipanion";
|
|
184
275
|
|
|
@@ -271,91 +362,6 @@ var CHECK_TEXTS = {
|
|
|
271
362
|
probStubAdvisoryAsync: "sm check --include-prob --async: probabilistic Rule dispatch requires the job subsystem (Step 10). Stub: skipped {{count}} probabilistic rule(s) \u2014 {{ruleIds}}. The --async flag is reserved for future encoding (returns job ids without waiting once jobs land); today it is a no-op. Deterministic rules ran as usual.\n"
|
|
272
363
|
};
|
|
273
364
|
|
|
274
|
-
// cli/util/db-path.ts
|
|
275
|
-
import { existsSync } from "fs";
|
|
276
|
-
import { join, resolve } from "path";
|
|
277
|
-
|
|
278
|
-
// cli/i18n/util.texts.ts
|
|
279
|
-
var UTIL_TEXTS = {
|
|
280
|
-
// db-path.ts
|
|
281
|
-
dbNotFound: "DB not found at {{path}}; run `sm scan` first.\n",
|
|
282
|
-
// elapsed.ts
|
|
283
|
-
doneIn: "done in {{elapsed}}\n",
|
|
284
|
-
// confirm.ts (default-no prompt suffix)
|
|
285
|
-
confirmPromptSuffix: " [y/N] ",
|
|
286
|
-
/**
|
|
287
|
-
* Regex source matching affirmative answers in `confirm()`. Compiled
|
|
288
|
-
* with the `i` flag in the helper. Pre-i18n today the pattern is
|
|
289
|
-
* English-only; when a non-English locale lands the catalog grows
|
|
290
|
-
* alternations (e.g. `^(y(es)?|s(í|i)?)$`).
|
|
291
|
-
*/
|
|
292
|
-
confirmYesPatternSource: "^y(es)?$"
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// cli/util/db-path.ts
|
|
296
|
-
var SKILL_MAP_DIR = ".skill-map";
|
|
297
|
-
var DB_FILENAME = "skill-map.db";
|
|
298
|
-
var JOBS_DIRNAME = "jobs";
|
|
299
|
-
var PLUGINS_DIRNAME = "plugins";
|
|
300
|
-
var SETTINGS_FILENAME = "settings.json";
|
|
301
|
-
var LOCAL_SETTINGS_FILENAME = "settings.local.json";
|
|
302
|
-
var IGNORE_FILENAME = ".skill-mapignore";
|
|
303
|
-
var DEFAULT_DB_REL = `${SKILL_MAP_DIR}/${DB_FILENAME}`;
|
|
304
|
-
var GITIGNORE_ENTRIES = [
|
|
305
|
-
`${SKILL_MAP_DIR}/${LOCAL_SETTINGS_FILENAME}`,
|
|
306
|
-
`${SKILL_MAP_DIR}/${DB_FILENAME}`
|
|
307
|
-
];
|
|
308
|
-
function resolveDbPath(options) {
|
|
309
|
-
if (options.db) return resolve(options.db);
|
|
310
|
-
if (options.global) return join(options.homedir, DEFAULT_DB_REL);
|
|
311
|
-
return resolve(options.cwd, DEFAULT_DB_REL);
|
|
312
|
-
}
|
|
313
|
-
function defaultProjectDbPath(ctx) {
|
|
314
|
-
return resolve(ctx.cwd, DEFAULT_DB_REL);
|
|
315
|
-
}
|
|
316
|
-
function defaultProjectJobsDir(ctx) {
|
|
317
|
-
return resolve(ctx.cwd, SKILL_MAP_DIR, JOBS_DIRNAME);
|
|
318
|
-
}
|
|
319
|
-
function defaultProjectPluginsDir(ctx) {
|
|
320
|
-
return resolve(ctx.cwd, SKILL_MAP_DIR, PLUGINS_DIRNAME);
|
|
321
|
-
}
|
|
322
|
-
function defaultUserPluginsDir(ctx) {
|
|
323
|
-
return join(ctx.homedir, SKILL_MAP_DIR, PLUGINS_DIRNAME);
|
|
324
|
-
}
|
|
325
|
-
function defaultDbPath(scopeRoot) {
|
|
326
|
-
return join(scopeRoot, SKILL_MAP_DIR, DB_FILENAME);
|
|
327
|
-
}
|
|
328
|
-
function defaultSettingsPath(scopeRoot) {
|
|
329
|
-
return join(scopeRoot, SKILL_MAP_DIR, SETTINGS_FILENAME);
|
|
330
|
-
}
|
|
331
|
-
function defaultLocalSettingsPath(scopeRoot) {
|
|
332
|
-
return join(scopeRoot, SKILL_MAP_DIR, LOCAL_SETTINGS_FILENAME);
|
|
333
|
-
}
|
|
334
|
-
function defaultIgnoreFilePath(scopeRoot) {
|
|
335
|
-
return join(scopeRoot, IGNORE_FILENAME);
|
|
336
|
-
}
|
|
337
|
-
function assertDbExists(path, stderr) {
|
|
338
|
-
if (path === ":memory:" || existsSync(path)) return true;
|
|
339
|
-
stderr.write(tx(UTIL_TEXTS.dbNotFound, { path }));
|
|
340
|
-
return false;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// cli/util/runtime-context.ts
|
|
344
|
-
import { homedir } from "os";
|
|
345
|
-
function defaultRuntimeContext() {
|
|
346
|
-
return { cwd: process.cwd(), homedir: homedir() };
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// cli/util/exit-codes.ts
|
|
350
|
-
var ExitCode = {
|
|
351
|
-
Ok: 0,
|
|
352
|
-
Issues: 1,
|
|
353
|
-
Error: 2,
|
|
354
|
-
Duplicate: 3,
|
|
355
|
-
NonceMismatch: 4,
|
|
356
|
-
NotFound: 5
|
|
357
|
-
};
|
|
358
|
-
|
|
359
365
|
// cli/util/plugin-runtime.ts
|
|
360
366
|
import { resolve as resolve8 } from "path";
|
|
361
367
|
|
|
@@ -7028,7 +7034,7 @@ import { Command as Command8, Option as Option8 } from "clipanion";
|
|
|
7028
7034
|
// package.json
|
|
7029
7035
|
var package_default = {
|
|
7030
7036
|
name: "@skill-map/cli",
|
|
7031
|
-
version: "0.
|
|
7037
|
+
version: "0.12.0",
|
|
7032
7038
|
description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
|
|
7033
7039
|
license: "MIT",
|
|
7034
7040
|
type: "module",
|
|
@@ -7540,7 +7546,7 @@ function renderCompactOverview(verbs) {
|
|
|
7540
7546
|
return lines.join("\n") + "\n";
|
|
7541
7547
|
}
|
|
7542
7548
|
var RootHelpCommand = class extends Command8 {
|
|
7543
|
-
static paths = [["-h"], ["--help"]
|
|
7549
|
+
static paths = [["-h"], ["--help"]];
|
|
7544
7550
|
async execute() {
|
|
7545
7551
|
const rawDefs = this.cli.definitions();
|
|
7546
7552
|
const verbs = rawDefs.filter((d) => !isBuiltin(d)).map(normalizeDefinition).sort(byPath);
|
|
@@ -14064,11 +14070,20 @@ var logLevel = resolveLogLevel({
|
|
|
14064
14070
|
errStream: process.stderr
|
|
14065
14071
|
});
|
|
14066
14072
|
configureLogger(new Logger({ level: logLevel, stream: process.stderr }));
|
|
14067
|
-
var
|
|
14073
|
+
var bareArgs = args.length === 0 ? resolveBareDefault() : null;
|
|
14074
|
+
var routedArgs = routeHelpArgs(bareArgs ?? args, cli);
|
|
14068
14075
|
var exitCode = await cli.run(routedArgs, {
|
|
14069
14076
|
stdin: process.stdin,
|
|
14070
14077
|
stdout: process.stdout,
|
|
14071
14078
|
stderr: process.stderr
|
|
14072
14079
|
});
|
|
14073
14080
|
process.exit(exitCode);
|
|
14081
|
+
function resolveBareDefault() {
|
|
14082
|
+
const ctx = defaultRuntimeContext();
|
|
14083
|
+
if (existsSync19(defaultProjectDbPath(ctx))) {
|
|
14084
|
+
return ["serve"];
|
|
14085
|
+
}
|
|
14086
|
+
process.stderr.write(tx(ENTRY_TEXTS.bareNoProject, { cwd: ctx.cwd }));
|
|
14087
|
+
process.exit(ExitCode.Error);
|
|
14088
|
+
}
|
|
14074
14089
|
//# sourceMappingURL=cli.js.map
|