skillwiki 0.9.49 → 0.9.50
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.
|
@@ -3135,7 +3135,7 @@ function severityForBucket(kind) {
|
|
|
3135
3135
|
if (WARNING_ORDER.includes(kind)) return "warning";
|
|
3136
3136
|
return "info";
|
|
3137
3137
|
}
|
|
3138
|
-
function outputForOnlyBucket(input, match, fixed, unresolved) {
|
|
3138
|
+
function outputForOnlyBucket(input, match, fixed, unresolved, readVault = lintReadVault(input)) {
|
|
3139
3139
|
const severity = severityForBucket(input.only);
|
|
3140
3140
|
const filtered = severity === "error" ? { error: match, warning: [], info: [] } : severity === "warning" ? { error: [], warning: match, info: [] } : { error: [], warning: [], info: match };
|
|
3141
3141
|
const summary = {
|
|
@@ -3146,14 +3146,19 @@ function outputForOnlyBucket(input, match, fixed, unresolved) {
|
|
|
3146
3146
|
let exitCode = ExitCode.OK;
|
|
3147
3147
|
if (summary.errors > 0) exitCode = ExitCode.LINT_HAS_ERRORS;
|
|
3148
3148
|
else if (summary.warnings > 0 || summary.info > 0) exitCode = ExitCode.LINT_HAS_WARNINGS;
|
|
3149
|
+
const vault = lintVaultOutput(input, readVault);
|
|
3150
|
+
const hintLines = [
|
|
3151
|
+
...readMirrorHintLines(vault),
|
|
3152
|
+
`--only ${input.only}`,
|
|
3153
|
+
match.length === 0 ? "0 violations" : match.map((b) => ` ${b.kind}: ${b.items.length}`).join("\n")
|
|
3154
|
+
];
|
|
3149
3155
|
const output = {
|
|
3150
|
-
vault
|
|
3156
|
+
vault,
|
|
3151
3157
|
summary,
|
|
3152
3158
|
by_severity: filtered,
|
|
3153
3159
|
fixed,
|
|
3154
3160
|
unresolved,
|
|
3155
|
-
humanHint:
|
|
3156
|
-
${match.length === 0 ? "0 violations" : match.map((b) => ` ${b.kind}: ${b.items.length}`).join("\n")}`
|
|
3161
|
+
humanHint: hintLines.join("\n")
|
|
3157
3162
|
};
|
|
3158
3163
|
if (input.fix) appendLintFixLastOp(input.vault, fixed);
|
|
3159
3164
|
return {
|
|
@@ -3162,7 +3167,27 @@ ${match.length === 0 ? "0 violations" : match.map((b) => ` ${b.kind}: ${b.items
|
|
|
3162
3167
|
};
|
|
3163
3168
|
}
|
|
3164
3169
|
function lintReadVault(input) {
|
|
3165
|
-
|
|
3170
|
+
if (input.fix) {
|
|
3171
|
+
return { readPath: input.vault, readMirror: false };
|
|
3172
|
+
}
|
|
3173
|
+
const resolved = resolveReadOnlyVaultRoot(input.vault);
|
|
3174
|
+
return { readPath: resolved.root, readMirror: resolved.mirrored };
|
|
3175
|
+
}
|
|
3176
|
+
function lintVaultOutput(input, readVault) {
|
|
3177
|
+
return {
|
|
3178
|
+
path: input.vault,
|
|
3179
|
+
source: input.source ?? "resolved",
|
|
3180
|
+
read_path: readVault.readPath,
|
|
3181
|
+
read_mirror: readVault.readMirror
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
function readMirrorHintLines(vault) {
|
|
3185
|
+
if (!vault.read_mirror) return [];
|
|
3186
|
+
return [
|
|
3187
|
+
`read mirror: ${vault.read_path}`,
|
|
3188
|
+
`requested vault: ${vault.path}`,
|
|
3189
|
+
"if results look stale, refresh the read mirror or rerun with SKILLWIKI_DISABLE_VAULT_READ_MIRROR=1 for a live scan; live scans may be slower"
|
|
3190
|
+
];
|
|
3166
3191
|
}
|
|
3167
3192
|
function recomputeRawSha256IfPresent(content) {
|
|
3168
3193
|
const split = splitFrontmatter(content);
|
|
@@ -3191,6 +3216,7 @@ function summarizeLintOutput(output, examplesLimit = 3) {
|
|
|
3191
3216
|
...output.by_severity.info.map((bucket) => summarizeBucket(bucket, "info", output.vault.path, examplesLimit))
|
|
3192
3217
|
];
|
|
3193
3218
|
const lines = [];
|
|
3219
|
+
lines.push(...readMirrorHintLines(output.vault));
|
|
3194
3220
|
lines.push(`errors: ${output.summary.errors}`);
|
|
3195
3221
|
lines.push(`warnings: ${output.summary.warnings}`);
|
|
3196
3222
|
lines.push(`info: ${output.summary.info}`);
|
|
@@ -3238,7 +3264,8 @@ async function collectCliRefsPages(vault) {
|
|
|
3238
3264
|
return ok(pages);
|
|
3239
3265
|
}
|
|
3240
3266
|
async function runCliRefsOnly(input) {
|
|
3241
|
-
const
|
|
3267
|
+
const readVault = lintReadVault(input);
|
|
3268
|
+
const lintVault = readVault.readPath;
|
|
3242
3269
|
const pages = await collectCliRefsPages(lintVault);
|
|
3243
3270
|
if (!pages.ok) {
|
|
3244
3271
|
return { exitCode: ExitCode.VAULT_PATH_INVALID, result: pages };
|
|
@@ -3255,14 +3282,19 @@ async function runCliRefsOnly(input) {
|
|
|
3255
3282
|
const infoOut = cliRefFlags.length > 0 ? [{ kind: "cli_refs", items: cliRefFlags }] : [];
|
|
3256
3283
|
const summary = { errors: 0, warnings: 0, info: cliRefFlags.length };
|
|
3257
3284
|
const exitCode = cliRefFlags.length > 0 ? ExitCode.LINT_HAS_WARNINGS : ExitCode.OK;
|
|
3285
|
+
const vault = lintVaultOutput(input, readVault);
|
|
3286
|
+
const hintLines = [
|
|
3287
|
+
...readMirrorHintLines(vault),
|
|
3288
|
+
`--only cli_refs`,
|
|
3289
|
+
cliRefFlags.length === 0 ? "0 violations" : ` cli_refs: ${cliRefFlags.length}`
|
|
3290
|
+
];
|
|
3258
3291
|
const output = {
|
|
3259
|
-
vault
|
|
3292
|
+
vault,
|
|
3260
3293
|
summary,
|
|
3261
3294
|
by_severity: { error: [], warning: [], info: infoOut },
|
|
3262
3295
|
fixed: [],
|
|
3263
3296
|
unresolved: [],
|
|
3264
|
-
humanHint:
|
|
3265
|
-
${cliRefFlags.length === 0 ? "0 violations" : ` cli_refs: ${cliRefFlags.length}`}`
|
|
3297
|
+
humanHint: hintLines.join("\n")
|
|
3266
3298
|
};
|
|
3267
3299
|
return {
|
|
3268
3300
|
exitCode,
|
|
@@ -3397,7 +3429,8 @@ async function applyFileSourceUrlFix(input, scan, fileSourceUrlFlags, fileSource
|
|
|
3397
3429
|
return remaining;
|
|
3398
3430
|
}
|
|
3399
3431
|
async function runFileSourceUrlOnly(input) {
|
|
3400
|
-
const
|
|
3432
|
+
const readVault = lintReadVault(input);
|
|
3433
|
+
const lintVault = readVault.readPath;
|
|
3401
3434
|
const scanResult = await scanVault(lintVault);
|
|
3402
3435
|
if (!scanResult.ok) return { exitCode: ExitCode.VAULT_PATH_INVALID, result: scanResult };
|
|
3403
3436
|
const pageTextCache = /* @__PURE__ */ new Map();
|
|
@@ -3413,7 +3446,7 @@ async function runFileSourceUrlOnly(input) {
|
|
|
3413
3446
|
unresolved
|
|
3414
3447
|
);
|
|
3415
3448
|
const match = remaining.size > 0 ? [{ kind: "file_source_url", items: [...remaining] }] : [];
|
|
3416
|
-
return outputForOnlyBucket(input, match, fixed, unresolved);
|
|
3449
|
+
return outputForOnlyBucket(input, match, fixed, unresolved, readVault);
|
|
3417
3450
|
}
|
|
3418
3451
|
async function runLint(input) {
|
|
3419
3452
|
if (input.only && !KNOWN_BUCKETS.includes(input.only)) {
|
|
@@ -3429,7 +3462,8 @@ async function runLint(input) {
|
|
|
3429
3462
|
return runFileSourceUrlOnly(input);
|
|
3430
3463
|
}
|
|
3431
3464
|
const shouldFix = (bucket) => !!input.fix && (!input.only || input.only === bucket);
|
|
3432
|
-
const
|
|
3465
|
+
const readVault = lintReadVault(input);
|
|
3466
|
+
const lintVault = readVault.readPath;
|
|
3433
3467
|
const buckets = {};
|
|
3434
3468
|
const fixed = [];
|
|
3435
3469
|
const unresolved = [];
|
|
@@ -4150,7 +4184,7 @@ ${split.data.body}`;
|
|
|
4150
4184
|
const infoOut = INFO_ORDER.flatMap((k) => buckets[k] ? [{ kind: k, items: buckets[k] }] : []);
|
|
4151
4185
|
if (input.only) {
|
|
4152
4186
|
const match = [...errorOut, ...warningOut, ...infoOut].filter((b) => b.kind === input.only);
|
|
4153
|
-
return outputForOnlyBucket(input, match, fixed, unresolved);
|
|
4187
|
+
return outputForOnlyBucket(input, match, fixed, unresolved, readVault);
|
|
4154
4188
|
}
|
|
4155
4189
|
const summary = {
|
|
4156
4190
|
errors: errorOut.reduce((n, b) => n + b.items.length, 0),
|
|
@@ -4160,7 +4194,9 @@ ${split.data.body}`;
|
|
|
4160
4194
|
let exitCode = ExitCode.OK;
|
|
4161
4195
|
if (summary.errors > 0) exitCode = ExitCode.LINT_HAS_ERRORS;
|
|
4162
4196
|
else if (summary.warnings > 0 || summary.info > 0) exitCode = ExitCode.LINT_HAS_WARNINGS;
|
|
4197
|
+
const vault = lintVaultOutput(input, readVault);
|
|
4163
4198
|
const hintLines = [];
|
|
4199
|
+
hintLines.push(...readMirrorHintLines(vault));
|
|
4164
4200
|
if (summary.errors > 0) hintLines.push(`errors: ${summary.errors}`);
|
|
4165
4201
|
if (summary.warnings > 0) hintLines.push(`warnings: ${summary.warnings}`);
|
|
4166
4202
|
if (summary.info > 0) hintLines.push(`info: ${summary.info}`);
|
|
@@ -4171,7 +4207,7 @@ ${split.data.body}`;
|
|
|
4171
4207
|
if (hintLines.length === 0) hintLines.push("0 errors, 0 warnings, 0 info");
|
|
4172
4208
|
if (input.fix) appendLintFixLastOp(input.vault, fixed);
|
|
4173
4209
|
const output = {
|
|
4174
|
-
vault
|
|
4210
|
+
vault,
|
|
4175
4211
|
summary,
|
|
4176
4212
|
by_severity: { error: errorOut, warning: warningOut, info: infoOut },
|
|
4177
4213
|
fixed,
|
package/dist/cli.js
CHANGED
package/dist/skillwiki-mcp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.50",
|
|
4
4
|
"skills": "./",
|
|
5
5
|
"description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
|
|
6
6
|
"author": {
|