skillwiki 0.2.1-beta.11 → 0.2.1-beta.12
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 +28 -4
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -162,9 +162,25 @@ var CompoundSchema = z.object({
|
|
|
162
162
|
promoted_to: wikilink.optional(),
|
|
163
163
|
cssclasses: z.array(z.string()).optional()
|
|
164
164
|
});
|
|
165
|
+
var MetaSchema = z.object({
|
|
166
|
+
title: z.string().min(1),
|
|
167
|
+
aliases: z.array(z.string()).optional(),
|
|
168
|
+
created: isoDate,
|
|
169
|
+
updated: isoDate,
|
|
170
|
+
type: z.literal("meta"),
|
|
171
|
+
tags: z.array(z.string()),
|
|
172
|
+
confidence: z.enum(["high", "medium", "low"]).optional(),
|
|
173
|
+
provenance: z.enum(["research", "project", "mixed"]).optional(),
|
|
174
|
+
provenance_projects: z.array(wikilink).min(2, "meta pages must reference \u22652 projects")
|
|
175
|
+
}).superRefine((v, ctx) => {
|
|
176
|
+
if (v.provenance && v.provenance !== "research" && (!v.provenance_projects || v.provenance_projects.length === 0)) {
|
|
177
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["provenance_projects"], message: "required when provenance != research" });
|
|
178
|
+
}
|
|
179
|
+
});
|
|
165
180
|
function detectSchema(fm) {
|
|
166
181
|
const COMPOUND_TYPES = /* @__PURE__ */ new Set(["lesson", "pattern", "antipattern", "gotcha"]);
|
|
167
182
|
if (typeof fm.type === "string" && COMPOUND_TYPES.has(fm.type) && "project" in fm) return { schema: "compound" };
|
|
183
|
+
if (fm.type === "meta") return { schema: "meta" };
|
|
168
184
|
if ("type" in fm && "sources" in fm) return { schema: "typed-knowledge" };
|
|
169
185
|
if (typeof fm.sha256 === "string" && "ingested" in fm) return { schema: "raw" };
|
|
170
186
|
if ("kind" in fm && "status" in fm) return { schema: "work-item" };
|
|
@@ -303,7 +319,8 @@ var SCHEMAS = {
|
|
|
303
319
|
"typed-knowledge": TypedKnowledgeSchema,
|
|
304
320
|
"raw": RawSourceSchema,
|
|
305
321
|
"work-item": WorkItemSchema,
|
|
306
|
-
"compound": CompoundSchema
|
|
322
|
+
"compound": CompoundSchema,
|
|
323
|
+
"meta": MetaSchema
|
|
307
324
|
};
|
|
308
325
|
async function runValidate(input) {
|
|
309
326
|
let text;
|
|
@@ -342,7 +359,7 @@ import { dirname } from "path";
|
|
|
342
359
|
// src/utils/vault.ts
|
|
343
360
|
import { readFile as readFile3, readdir, stat } from "fs/promises";
|
|
344
361
|
import { join, relative, sep } from "path";
|
|
345
|
-
var TYPED_DIRS = ["entities", "concepts", "comparisons", "queries"];
|
|
362
|
+
var TYPED_DIRS = ["entities", "concepts", "comparisons", "queries", "meta"];
|
|
346
363
|
async function scanVault(root) {
|
|
347
364
|
try {
|
|
348
365
|
await stat(join(root, "SCHEMA.md"));
|
|
@@ -1896,10 +1913,17 @@ async function runLint(input) {
|
|
|
1896
1913
|
}
|
|
1897
1914
|
let newBody = newBodyLines.join("\n");
|
|
1898
1915
|
const dedupedMarkers = [...new Set(inlineMarkers)];
|
|
1899
|
-
const sourceLines = dedupedMarkers.map((m) => `- ${m}`);
|
|
1900
1916
|
if (inSrc) {
|
|
1901
|
-
|
|
1917
|
+
const existingSources = new Set(
|
|
1918
|
+
body.split("\n").filter((l) => /^- \^\[raw\//.test(l.trim())).map((l) => l.trim().replace(/^- /, ""))
|
|
1919
|
+
);
|
|
1920
|
+
const newMarkers = dedupedMarkers.filter((m) => !existingSources.has(m));
|
|
1921
|
+
const sourceLines = newMarkers.map((m) => `- ${m}`);
|
|
1922
|
+
if (sourceLines.length > 0) {
|
|
1923
|
+
newBody = newBody.trimEnd() + "\n" + sourceLines.join("\n") + "\n";
|
|
1924
|
+
}
|
|
1902
1925
|
} else {
|
|
1926
|
+
const sourceLines = dedupedMarkers.map((m) => `- ${m}`);
|
|
1903
1927
|
newBody = newBody.trimEnd() + "\n\n## Sources\n\n" + sourceLines.join("\n") + "\n";
|
|
1904
1928
|
}
|
|
1905
1929
|
const newContent = `---
|
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.12",
|
|
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": {
|