skillwiki 0.2.1-beta.5 → 0.2.1-beta.7
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 +19 -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,16 +2248,31 @@ 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;
|
|
2259
2273
|
const sourceUrl = sourceUrlMatch[1].trim();
|
|
2260
2274
|
const storedHash = storedHashMatch[1];
|
|
2275
|
+
if (!sourceUrl.startsWith("http://") && !sourceUrl.startsWith("https://")) continue;
|
|
2261
2276
|
const resp = await doFetch(sourceUrl, FETCH_OPTS);
|
|
2262
2277
|
if (!resp.ok) {
|
|
2263
2278
|
results.push({
|
|
@@ -2302,12 +2317,13 @@ ${body}`;
|
|
|
2302
2317
|
const unchanged = results.filter((r) => r.status === "unchanged").length;
|
|
2303
2318
|
const exitCode = drifted.length > 0 ? ExitCode.DRIFT_DETECTED : ExitCode.OK;
|
|
2304
2319
|
const hintLines = [`scanned: ${results.length}, unchanged: ${unchanged}`];
|
|
2320
|
+
if (newResults.length > 0) hintLines.push(`new: ${newResults.length}`, ...newResults.map((n) => ` ${n.raw_path} (ingested: ${n.ingested})`));
|
|
2305
2321
|
if (drifted.length > 0) hintLines.push(`drifted: ${drifted.length}`, ...drifted.map((d) => ` ${d.raw_path}`));
|
|
2306
2322
|
if (fetchFailed.length > 0) hintLines.push(`fetch_failed: ${fetchFailed.length}`, ...fetchFailed.map((f) => ` ${f.raw_path}: ${f.fetch_error}`));
|
|
2307
2323
|
if (updated.length > 0) hintLines.push(`updated: ${updated.length}`, ...updated.map((u) => ` ${u.raw_path}`));
|
|
2308
2324
|
return {
|
|
2309
2325
|
exitCode,
|
|
2310
|
-
result: ok({ scanned: results.length, drifted, fetch_failed: fetchFailed, updated, unchanged, humanHint: hintLines.join("\n") })
|
|
2326
|
+
result: ok({ scanned: results.length, drifted, fetch_failed: fetchFailed, updated, newFiles: newResults, unchanged, humanHint: hintLines.join("\n") })
|
|
2311
2327
|
};
|
|
2312
2328
|
}
|
|
2313
2329
|
|
|
@@ -2748,10 +2764,10 @@ program.command("archive <page> [vault]").description("archive a typed-knowledge
|
|
|
2748
2764
|
if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
|
|
2749
2765
|
else emit(await runArchive({ vault: v.vault, page }));
|
|
2750
2766
|
});
|
|
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) => {
|
|
2767
|
+
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
2768
|
const v = await resolveVaultArg(vault, opts.wiki);
|
|
2753
2769
|
if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
|
|
2754
|
-
else emit(await runDrift({ vault: v.vault, apply: opts.apply }));
|
|
2770
|
+
else emit(await runDrift({ vault: v.vault, apply: opts.apply, newSince: opts.new }));
|
|
2755
2771
|
});
|
|
2756
2772
|
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
2773
|
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.7",
|
|
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": {
|