skillwiki 0.2.1-beta.7 → 0.2.1-beta.8

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 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
- let relPath;
2181
- if (input.page.includes("/")) {
2182
- relPath = scan.data.typedKnowledge.find((p) => p.relPath === input.page)?.relPath;
2183
- } else {
2184
- relPath = scan.data.typedKnowledge.find((p) => p.relPath.replace(/\.md$/, "").split("/").pop() === input.page)?.relPath;
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
- const indexPath = join18(input.vault, "index.md");
2192
- try {
2193
- const idx = await readFile13(indexPath, "utf8");
2194
- const slug = relPath.replace(/\.md$/, "").split("/").pop();
2195
- const originalLines = idx.split("\n");
2196
- const filtered = originalLines.filter((l) => !l.includes(`[[${slug}]]`));
2197
- if (filtered.length !== originalLines.length) {
2198
- await writeFile6(indexPath, filtered.join("\n"), "utf8");
2199
- indexUpdated = true;
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.7",
3
+ "version": "0.2.1-beta.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.2.1-beta.7",
3
+ "version": "0.2.1-beta.8",
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": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.2.1-beta.7",
3
+ "version": "0.2.1-beta.8",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",