vskill 1.0.2 → 1.0.4

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.
Files changed (30) hide show
  1. package/agents.json +1 -1
  2. package/dist/commands/outdated.d.ts +1 -0
  3. package/dist/commands/outdated.js +63 -25
  4. package/dist/commands/outdated.js.map +1 -1
  5. package/dist/commands/plugin.js +39 -7
  6. package/dist/commands/plugin.js.map +1 -1
  7. package/dist/commands/submit.js +61 -1
  8. package/dist/commands/submit.js.map +1 -1
  9. package/dist/eval-server/authoring-routes.js +90 -17
  10. package/dist/eval-server/authoring-routes.js.map +1 -1
  11. package/dist/eval-server/plugin-cli-routes.js +20 -13
  12. package/dist/eval-server/plugin-cli-routes.js.map +1 -1
  13. package/dist/eval-server/plugin-discovery.d.ts +17 -0
  14. package/dist/eval-server/plugin-discovery.js +183 -0
  15. package/dist/eval-server/plugin-discovery.js.map +1 -0
  16. package/dist/eval-ui/assets/{CreateSkillPage-Cvqa6K5i.js → CreateSkillPage-D9ZsmNub.js} +1 -1
  17. package/dist/eval-ui/assets/{FindSkillsPalette-CWHvEBnP.js → FindSkillsPalette-BBj-hoqE.js} +2 -2
  18. package/dist/eval-ui/assets/{SearchPaletteCore-CqA31vP2.js → SearchPaletteCore-Ddcfdn9a.js} +1 -1
  19. package/dist/eval-ui/assets/{SkillDetailPanel-u4KHBlUQ.js → SkillDetailPanel-Xymi4aZg.js} +1 -1
  20. package/dist/eval-ui/assets/{UpdateDropdown-DslQOd6_.js → UpdateDropdown-DTP2sv27.js} +1 -1
  21. package/dist/eval-ui/assets/index-BmriQsHr.js +122 -0
  22. package/dist/eval-ui/index.html +1 -1
  23. package/dist/lib/frontmatter.d.ts +33 -0
  24. package/dist/lib/frontmatter.js +85 -0
  25. package/dist/lib/frontmatter.js.map +1 -0
  26. package/dist/lockfile/authored.d.ts +35 -0
  27. package/dist/lockfile/authored.js +82 -0
  28. package/dist/lockfile/authored.js.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/eval-ui/assets/index-DVbvMGAg.js +0 -122
@@ -46,7 +46,7 @@
46
46
  }
47
47
  })();
48
48
  </script>
49
- <script type="module" crossorigin src="/assets/index-DVbvMGAg.js"></script>
49
+ <script type="module" crossorigin src="/assets/index-BmriQsHr.js"></script>
50
50
  <link rel="stylesheet" crossorigin href="/assets/index-CycZyHaL.css">
51
51
  <link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
52
52
  </head>
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Frontmatter version upsert.
3
+ *
4
+ * After `vskill skill publish` succeeds, the registry returns the new
5
+ * version (which may have been auto-bumped server-side). To prevent the
6
+ * "phantom update available immediately after install" trap recorded in
7
+ * project_skill_version_publish_desync.md, the CLI writes the registry
8
+ * version back to the source SKILL.md frontmatter so that the next
9
+ * `vskill outdated` poll sees identical local + remote versions.
10
+ *
11
+ * Increment 0794 — US-002b / T-004.
12
+ */
13
+ /**
14
+ * Insert or replace the top-level `version:` field in YAML frontmatter.
15
+ *
16
+ * Behaviour:
17
+ * - If `version:` exists at column 1: replace its value (preserves
18
+ * surrounding lines and quoting style of the source whenever possible).
19
+ * - Else if `description:` exists at column 1: insert immediately after
20
+ * the description block (skipping indented continuation lines).
21
+ * - Else: append the version line at the end of the frontmatter.
22
+ * - If the file has no frontmatter block at all: synthesise a minimal one.
23
+ * - Indented `metadata.version` is never touched.
24
+ *
25
+ * Returns the full file content with the change applied. Pure function.
26
+ */
27
+ export declare function upsertFrontmatterVersion(content: string, newVersion: string): string;
28
+ /**
29
+ * Lightweight validation: round-trip the result through the frontmatter regex
30
+ * and ensure we still have a valid `---\n...\n---` block. Used by submit.ts
31
+ * as a defensive guard before writing back to disk (AC-US2b-04).
32
+ */
33
+ export declare function validatesAsYamlFrontmatter(content: string): boolean;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Frontmatter version upsert.
3
+ *
4
+ * After `vskill skill publish` succeeds, the registry returns the new
5
+ * version (which may have been auto-bumped server-side). To prevent the
6
+ * "phantom update available immediately after install" trap recorded in
7
+ * project_skill_version_publish_desync.md, the CLI writes the registry
8
+ * version back to the source SKILL.md frontmatter so that the next
9
+ * `vskill outdated` poll sees identical local + remote versions.
10
+ *
11
+ * Increment 0794 — US-002b / T-004.
12
+ */
13
+ const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n/;
14
+ const TOP_VERSION_RE = /^version\s*:\s*[^\n]*\r?\n?/m;
15
+ const HAS_DESCRIPTION_RE = /^description\s*:/m;
16
+ /**
17
+ * Insert or replace the top-level `version:` field in YAML frontmatter.
18
+ *
19
+ * Behaviour:
20
+ * - If `version:` exists at column 1: replace its value (preserves
21
+ * surrounding lines and quoting style of the source whenever possible).
22
+ * - Else if `description:` exists at column 1: insert immediately after
23
+ * the description block (skipping indented continuation lines).
24
+ * - Else: append the version line at the end of the frontmatter.
25
+ * - If the file has no frontmatter block at all: synthesise a minimal one.
26
+ * - Indented `metadata.version` is never touched.
27
+ *
28
+ * Returns the full file content with the change applied. Pure function.
29
+ */
30
+ export function upsertFrontmatterVersion(content, newVersion) {
31
+ const match = content.match(FRONTMATTER_RE);
32
+ if (!match) {
33
+ return `---\nversion: ${newVersion}\n---\n${content}`;
34
+ }
35
+ const fmBody = match[1];
36
+ // Replace existing top-level `version:`
37
+ if (TOP_VERSION_RE.test(fmBody)) {
38
+ const newFm = fmBody.replace(TOP_VERSION_RE, (line) => {
39
+ // Preserve quoting style if present
40
+ const quotedMatch = line.match(/^version\s*:\s*("|')/);
41
+ if (quotedMatch) {
42
+ const quote = quotedMatch[1];
43
+ return `version: ${quote}${newVersion}${quote}\n`;
44
+ }
45
+ return `version: ${newVersion}\n`;
46
+ });
47
+ return content.replace(FRONTMATTER_RE, `---\n${newFm}\n---\n`);
48
+ }
49
+ // Insert after `description:` if present
50
+ const lines = fmBody.split(/\r?\n/);
51
+ const descIdx = lines.findIndex((line) => HAS_DESCRIPTION_RE.test(line));
52
+ let updatedLines;
53
+ if (descIdx >= 0) {
54
+ let insertAt = descIdx + 1;
55
+ // Skip continuation lines (indented under description)
56
+ while (insertAt < lines.length && /^\s+\S/.test(lines[insertAt]))
57
+ insertAt++;
58
+ updatedLines = [
59
+ ...lines.slice(0, insertAt),
60
+ `version: ${newVersion}`,
61
+ ...lines.slice(insertAt),
62
+ ];
63
+ }
64
+ else {
65
+ updatedLines = [...lines, `version: ${newVersion}`];
66
+ }
67
+ const newFm = updatedLines.join("\n");
68
+ return content.replace(FRONTMATTER_RE, `---\n${newFm}\n---\n`);
69
+ }
70
+ /**
71
+ * Lightweight validation: round-trip the result through the frontmatter regex
72
+ * and ensure we still have a valid `---\n...\n---` block. Used by submit.ts
73
+ * as a defensive guard before writing back to disk (AC-US2b-04).
74
+ */
75
+ export function validatesAsYamlFrontmatter(content) {
76
+ const m = content.match(FRONTMATTER_RE);
77
+ if (!m)
78
+ return false;
79
+ // Sanity: no nested unclosed --- markers
80
+ const body = m[1];
81
+ if (/^---\s*$/m.test(body))
82
+ return false;
83
+ return true;
84
+ }
85
+ //# sourceMappingURL=frontmatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/lib/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,cAAc,GAAG,8BAA8B,CAAC;AACtD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,UAAkB;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,iBAAiB,UAAU,UAAU,OAAO,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAExB,wCAAwC;IACx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AAE,YAAY,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,yCAAyC;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClB,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Authored-skill tracking.
3
+ *
4
+ * Records skills that the current user has *published* (as opposed to
5
+ * *installed*). Source-origin skills don't appear in `vskill.lock` (only
6
+ * installs do), so without a separate manifest the `vskill outdated`
7
+ * poll silently ignores them — leaving publishers blind to their own
8
+ * downstream version drift (project_vskill_source_origin_update_tracking.md).
9
+ *
10
+ * File: `vskill.authored.json` at project root.
11
+ *
12
+ * Increment 0794 — US-006 / T-006.
13
+ */
14
+ export interface AuthoredEntry {
15
+ /** Fully-qualified registry name, e.g. "owner/repo/skill". */
16
+ name: string;
17
+ /** Absolute or project-relative path to the source SKILL.md. */
18
+ sourcePath: string;
19
+ /** ISO timestamp of the most recent successful publish. */
20
+ publishedAt: string;
21
+ }
22
+ /**
23
+ * Insert or update an authored-skill entry. Idempotent: same name on the
24
+ * same source path is a no-op except for refreshing `publishedAt`.
25
+ */
26
+ export declare function addAuthoredSkill(projectRoot: string, name: string, sourcePath: string, publishedAt?: string): void;
27
+ /**
28
+ * Remove an authored-skill entry. No-op when the name is absent.
29
+ */
30
+ export declare function removeAuthoredSkill(projectRoot: string, name: string): void;
31
+ /**
32
+ * Read all authored entries as a flat array. Returns `[]` when the
33
+ * `vskill.authored.json` file is missing or unreadable (graceful degrade).
34
+ */
35
+ export declare function readAuthored(projectRoot: string): AuthoredEntry[];
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Authored-skill tracking.
3
+ *
4
+ * Records skills that the current user has *published* (as opposed to
5
+ * *installed*). Source-origin skills don't appear in `vskill.lock` (only
6
+ * installs do), so without a separate manifest the `vskill outdated`
7
+ * poll silently ignores them — leaving publishers blind to their own
8
+ * downstream version drift (project_vskill_source_origin_update_tracking.md).
9
+ *
10
+ * File: `vskill.authored.json` at project root.
11
+ *
12
+ * Increment 0794 — US-006 / T-006.
13
+ */
14
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
15
+ import { dirname, join } from "node:path";
16
+ const FILE_NAME = "vskill.authored.json";
17
+ const SCHEMA_VERSION = 1;
18
+ function authoredPath(projectRoot) {
19
+ return join(projectRoot, FILE_NAME);
20
+ }
21
+ function emptyFile() {
22
+ return { version: SCHEMA_VERSION, skills: {} };
23
+ }
24
+ function readFile(projectRoot) {
25
+ const filePath = authoredPath(projectRoot);
26
+ if (!existsSync(filePath))
27
+ return emptyFile();
28
+ try {
29
+ const parsed = JSON.parse(readFileSync(filePath, "utf8"));
30
+ // Backward-compatible read: tolerate older shapes.
31
+ if (parsed && typeof parsed === "object" && parsed.skills && typeof parsed.skills === "object") {
32
+ return {
33
+ version: typeof parsed.version === "number" ? parsed.version : SCHEMA_VERSION,
34
+ skills: parsed.skills,
35
+ };
36
+ }
37
+ return emptyFile();
38
+ }
39
+ catch {
40
+ return emptyFile();
41
+ }
42
+ }
43
+ function writeFile(projectRoot, file) {
44
+ const filePath = authoredPath(projectRoot);
45
+ mkdirSync(dirname(filePath), { recursive: true });
46
+ writeFileSync(filePath, JSON.stringify(file, null, 2) + "\n");
47
+ }
48
+ /**
49
+ * Insert or update an authored-skill entry. Idempotent: same name on the
50
+ * same source path is a no-op except for refreshing `publishedAt`.
51
+ */
52
+ export function addAuthoredSkill(projectRoot, name, sourcePath, publishedAt) {
53
+ const file = readFile(projectRoot);
54
+ file.skills[name] = {
55
+ sourcePath,
56
+ publishedAt: publishedAt ?? new Date().toISOString(),
57
+ };
58
+ writeFile(projectRoot, file);
59
+ }
60
+ /**
61
+ * Remove an authored-skill entry. No-op when the name is absent.
62
+ */
63
+ export function removeAuthoredSkill(projectRoot, name) {
64
+ const file = readFile(projectRoot);
65
+ if (!(name in file.skills))
66
+ return;
67
+ delete file.skills[name];
68
+ writeFile(projectRoot, file);
69
+ }
70
+ /**
71
+ * Read all authored entries as a flat array. Returns `[]` when the
72
+ * `vskill.authored.json` file is missing or unreadable (graceful degrade).
73
+ */
74
+ export function readAuthored(projectRoot) {
75
+ const file = readFile(projectRoot);
76
+ return Object.entries(file.skills).map(([name, entry]) => ({
77
+ name,
78
+ sourcePath: entry.sourcePath,
79
+ publishedAt: entry.publishedAt,
80
+ }));
81
+ }
82
+ //# sourceMappingURL=authored.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authored.js","sourceRoot":"","sources":["../../src/lockfile/authored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,cAAc,GAAG,CAAC,CAAC;AAgBzB,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,QAAQ,CAAC,WAAmB;IACnC,MAAM,QAA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,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACrD,CAAC;IACF,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,IAAY;IACnE,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IACnC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO;IACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI;QACJ,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC,CAAC,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vskill",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "Secure multi-platform AI skill installer — scan before you install",
6
6
  "bin": {