skillwiki 0.2.1-beta.7 → 0.2.1-beta.9
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 +22 -16
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2177,29 +2177,35 @@ import { join as join18, dirname as dirname7 } from "path";
|
|
|
2177
2177
|
async function runArchive(input) {
|
|
2178
2178
|
const scan = await scanVault(input.vault);
|
|
2179
2179
|
if (!scan.ok) return { exitCode: ExitCode.VAULT_PATH_INVALID, result: scan };
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2180
|
+
const lookup = (pages) => {
|
|
2181
|
+
if (input.page.includes("/")) return pages.find((p) => p.relPath === input.page)?.relPath;
|
|
2182
|
+
return pages.find((p) => p.relPath.replace(/\.md$/, "").split("/").pop() === input.page)?.relPath;
|
|
2183
|
+
};
|
|
2184
|
+
let relPath = lookup(scan.data.typedKnowledge);
|
|
2185
|
+
let isRaw = false;
|
|
2186
|
+
if (!relPath) {
|
|
2187
|
+
relPath = lookup(scan.data.raw);
|
|
2188
|
+
isRaw = relPath != null;
|
|
2185
2189
|
}
|
|
2186
2190
|
if (!relPath) return { exitCode: ExitCode.ARCHIVE_TARGET_NOT_FOUND, result: err("ARCHIVE_TARGET_NOT_FOUND", { page: input.page }) };
|
|
2187
2191
|
if (relPath.startsWith("_archive/")) return { exitCode: ExitCode.ARCHIVE_ALREADY_ARCHIVED, result: err("ARCHIVE_ALREADY_ARCHIVED", { page: relPath }) };
|
|
2188
2192
|
const archivePath = join18("_archive", relPath);
|
|
2189
2193
|
await mkdir5(dirname7(join18(input.vault, archivePath)), { recursive: true });
|
|
2190
2194
|
let indexUpdated = false;
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2195
|
+
if (!isRaw) {
|
|
2196
|
+
const indexPath = join18(input.vault, "index.md");
|
|
2197
|
+
try {
|
|
2198
|
+
const idx = await readFile13(indexPath, "utf8");
|
|
2199
|
+
const slug = relPath.replace(/\.md$/, "").split("/").pop();
|
|
2200
|
+
const originalLines = idx.split("\n");
|
|
2201
|
+
const filtered = originalLines.filter((l) => !l.includes(`[[${slug}]]`));
|
|
2202
|
+
if (filtered.length !== originalLines.length) {
|
|
2203
|
+
await writeFile6(indexPath, filtered.join("\n"), "utf8");
|
|
2204
|
+
indexUpdated = true;
|
|
2205
|
+
}
|
|
2206
|
+
} catch (e) {
|
|
2207
|
+
if (e?.code !== "ENOENT") throw e;
|
|
2200
2208
|
}
|
|
2201
|
-
} catch (e) {
|
|
2202
|
-
if (e?.code !== "ENOENT") throw e;
|
|
2203
2209
|
}
|
|
2204
2210
|
await rename3(join18(input.vault, relPath), join18(input.vault, archivePath));
|
|
2205
2211
|
return { exitCode: ExitCode.OK, result: ok({ archived_from: relPath, archived_to: archivePath, index_updated: indexUpdated, humanHint: `${relPath} -> ${archivePath}${indexUpdated ? " (index updated)" : ""}` }) };
|
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.9",
|
|
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": {
|