skillwiki 0.2.1-beta.5 → 0.2.1-beta.6
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.js +18 -3
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2248,11 +2248,25 @@ async function runDrift(input) {
|
|
|
2248
2248
|
const scan = await scanVault(input.vault);
|
|
2249
2249
|
if (!scan.ok) return { exitCode: ExitCode.VAULT_PATH_INVALID, result: scan };
|
|
2250
2250
|
const results = [];
|
|
2251
|
+
const newResults = [];
|
|
2251
2252
|
for (const raw of scan.data.raw) {
|
|
2252
2253
|
const text = await readPage(raw);
|
|
2253
2254
|
const split = splitFrontmatter(text);
|
|
2254
2255
|
if (!split.ok) continue;
|
|
2255
2256
|
const { rawFrontmatter, body } = split.data;
|
|
2257
|
+
const ingestedMatch = rawFrontmatter.match(/^ingested:\s*(.+)$/m);
|
|
2258
|
+
const ingestedRaw = ingestedMatch?.[1]?.trim() ?? "";
|
|
2259
|
+
const ingested = ingestedRaw.replace(/^["']|["']$/g, "");
|
|
2260
|
+
if (input.newSince && ingested && ingested >= input.newSince) {
|
|
2261
|
+
newResults.push({
|
|
2262
|
+
raw_path: raw.relPath,
|
|
2263
|
+
source_url: "",
|
|
2264
|
+
stored_sha256: "",
|
|
2265
|
+
current_sha256: null,
|
|
2266
|
+
status: "new",
|
|
2267
|
+
ingested
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2256
2270
|
const sourceUrlMatch = rawFrontmatter.match(/^source_url:\s*(.+)$/m);
|
|
2257
2271
|
const storedHashMatch = rawFrontmatter.match(/^sha256:\s*([a-f0-9]+)$/m);
|
|
2258
2272
|
if (!sourceUrlMatch || !storedHashMatch) continue;
|
|
@@ -2302,12 +2316,13 @@ ${body}`;
|
|
|
2302
2316
|
const unchanged = results.filter((r) => r.status === "unchanged").length;
|
|
2303
2317
|
const exitCode = drifted.length > 0 ? ExitCode.DRIFT_DETECTED : ExitCode.OK;
|
|
2304
2318
|
const hintLines = [`scanned: ${results.length}, unchanged: ${unchanged}`];
|
|
2319
|
+
if (newResults.length > 0) hintLines.push(`new: ${newResults.length}`, ...newResults.map((n) => ` ${n.raw_path} (ingested: ${n.ingested})`));
|
|
2305
2320
|
if (drifted.length > 0) hintLines.push(`drifted: ${drifted.length}`, ...drifted.map((d) => ` ${d.raw_path}`));
|
|
2306
2321
|
if (fetchFailed.length > 0) hintLines.push(`fetch_failed: ${fetchFailed.length}`, ...fetchFailed.map((f) => ` ${f.raw_path}: ${f.fetch_error}`));
|
|
2307
2322
|
if (updated.length > 0) hintLines.push(`updated: ${updated.length}`, ...updated.map((u) => ` ${u.raw_path}`));
|
|
2308
2323
|
return {
|
|
2309
2324
|
exitCode,
|
|
2310
|
-
result: ok({ scanned: results.length, drifted, fetch_failed: fetchFailed, updated, unchanged, humanHint: hintLines.join("\n") })
|
|
2325
|
+
result: ok({ scanned: results.length, drifted, fetch_failed: fetchFailed, updated, newFiles: newResults, unchanged, humanHint: hintLines.join("\n") })
|
|
2311
2326
|
};
|
|
2312
2327
|
}
|
|
2313
2328
|
|
|
@@ -2748,10 +2763,10 @@ program.command("archive <page> [vault]").description("archive a typed-knowledge
|
|
|
2748
2763
|
if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
|
|
2749
2764
|
else emit(await runArchive({ vault: v.vault, page }));
|
|
2750
2765
|
});
|
|
2751
|
-
program.command("drift [vault]").description("detect content drift in raw sources").option("--apply", "update sha256 in drifted sources").option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
|
|
2766
|
+
program.command("drift [vault]").description("detect content drift in raw sources").option("--apply", "update sha256 in drifted sources").option("--new <date>", "list raw files ingested on/after this date (YYYY-MM-DD)").option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
|
|
2752
2767
|
const v = await resolveVaultArg(vault, opts.wiki);
|
|
2753
2768
|
if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
|
|
2754
|
-
else emit(await runDrift({ vault: v.vault, apply: opts.apply }));
|
|
2769
|
+
else emit(await runDrift({ vault: v.vault, apply: opts.apply, newSince: opts.new }));
|
|
2755
2770
|
});
|
|
2756
2771
|
program.command("dedup [vault]").description("detect duplicate raw sources by sha256").option("--apply", "rewire citations and remove duplicate raw files", false).option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
|
|
2757
2772
|
const v = await resolveVaultArg(vault, opts.wiki);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.6",
|
|
4
4
|
"skills": "./",
|
|
5
5
|
"description": "Project-aware Karpathy-style knowledge base for Claude Code: 15 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
|
|
6
6
|
"author": {
|