@inupedia/spotlight-client 0.2.11 → 0.2.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.
@@ -0,0 +1,9 @@
1
+ import type { ScannedSkill } from "./skillScanner.js";
2
+ import { type AgentSkillValidationResult } from "./skillValidator.js";
3
+ export type ValidateScannedSkillInput = {
4
+ projectRoot: string;
5
+ skill: ScannedSkill;
6
+ mode?: "strict" | "compat";
7
+ };
8
+ export declare function validateScannedSkill(input: ValidateScannedSkillInput): Promise<AgentSkillValidationResult>;
9
+ //# sourceMappingURL=skillFileValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillFileValidator.d.ts","sourceRoot":"","sources":["../../../src/node/capabilities/skillFileValidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,qBAAqB,CAAC;AAO7B,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B,CAAC;AAiGF,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,0BAA0B,CAAC,CAmCrC"}
@@ -0,0 +1,90 @@
1
+ import { lstat, readFile } from "node:fs/promises";
2
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
3
+ import { validateAgentSkillMarkdown, } from "./skillValidator.js";
4
+ const MAX_REFERENCE_BYTES = 1024 * 1024;
5
+ const MARKDOWN_LINK_PATTERN = /(?<!!)\[[^\]]*\]\(([^)\s]+)(?:\s+(?:"[^"]*"|'[^']*'))?\)/g;
6
+ const URI_SCHEME_PATTERN = /^[a-z][a-z\d+.-]*:/i;
7
+ function compareUtf8(left, right) {
8
+ return Buffer.compare(Buffer.from(left, "utf8"), Buffer.from(right, "utf8"));
9
+ }
10
+ function extractRelativeMarkdownLinks(markdown) {
11
+ const links = new Set();
12
+ for (const match of markdown.matchAll(MARKDOWN_LINK_PATTERN)) {
13
+ const destination = match[1];
14
+ if (!destination ||
15
+ destination.startsWith("#") ||
16
+ destination.startsWith("/") ||
17
+ URI_SCHEME_PATTERN.test(destination)) {
18
+ continue;
19
+ }
20
+ const path = destination.split(/[?#]/, 1)[0];
21
+ if (path?.toLowerCase().endsWith(".md"))
22
+ links.add(path);
23
+ }
24
+ return [...links].sort(compareUtf8);
25
+ }
26
+ function isWithin(root, candidate) {
27
+ const relativePath = relative(root, candidate);
28
+ return (relativePath === "" ||
29
+ (!relativePath.startsWith("..") && !isAbsolute(relativePath)));
30
+ }
31
+ function warning(input, code, message) {
32
+ return {
33
+ code,
34
+ severity: "warning",
35
+ message,
36
+ skillFile: input.skill.skillFile,
37
+ };
38
+ }
39
+ async function referenceWarnings(input, markdown, skillPath) {
40
+ const skillRoot = dirname(skillPath);
41
+ const diagnostics = [];
42
+ for (const link of extractRelativeMarkdownLinks(markdown)) {
43
+ const target = resolve(skillRoot, link);
44
+ if (!isWithin(skillRoot, target)) {
45
+ diagnostics.push(warning(input, "SKILL_REFERENCE_OUTSIDE_ROOT", `Markdown reference "${link}" resolves outside the Skill root.`));
46
+ continue;
47
+ }
48
+ let stats;
49
+ try {
50
+ stats = await lstat(target);
51
+ }
52
+ catch (error) {
53
+ if (error.code === "ENOENT")
54
+ continue;
55
+ throw error;
56
+ }
57
+ if (!stats.isFile() ||
58
+ stats.isSymbolicLink() ||
59
+ stats.size > MAX_REFERENCE_BYTES) {
60
+ continue;
61
+ }
62
+ const referencedMarkdown = await readFile(target, "utf8");
63
+ if (extractRelativeMarkdownLinks(referencedMarkdown).length > 0) {
64
+ diagnostics.push(warning(input, "SKILL_REFERENCE_CHAIN_DEEP", `Markdown reference "${link}" links to another Markdown reference.`));
65
+ }
66
+ }
67
+ return diagnostics;
68
+ }
69
+ export async function validateScannedSkill(input) {
70
+ const projectRoot = resolve(input.projectRoot);
71
+ const skillPath = resolve(projectRoot, input.skill.skillFile);
72
+ const markdown = (await readFile(skillPath, "utf8")).replace(/\r\n?/g, "\n");
73
+ const result = validateAgentSkillMarkdown({
74
+ directoryName: input.skill.name,
75
+ skillFile: input.skill.skillFile,
76
+ markdown,
77
+ mode: input.mode,
78
+ });
79
+ const diagnostics = [...result.diagnostics];
80
+ const lineCount = markdown.split("\n").length;
81
+ const estimatedTokens = Math.ceil(markdown.length / 4);
82
+ if (lineCount > 500) {
83
+ diagnostics.push(warning(input, "SKILL_RECOMMENDATION_LINES", `SKILL.md contains ${lineCount} lines; the Agent Skills recommendation is at most 500.`));
84
+ }
85
+ if (estimatedTokens > 5_000) {
86
+ diagnostics.push(warning(input, "SKILL_RECOMMENDATION_TOKENS", `SKILL.md has a deterministic estimate of ${estimatedTokens} tokens; the recommendation is at most 5000.`));
87
+ }
88
+ diagnostics.push(...(await referenceWarnings(input, markdown, skillPath)));
89
+ return { ...result, diagnostics };
90
+ }
@@ -0,0 +1,30 @@
1
+ export type AgentSkillDiagnosticSeverity = "error" | "warning";
2
+ export type AgentSkillDiagnosticCode = "SKILL_FRONTMATTER_MISSING" | "SKILL_FRONTMATTER_UNCLOSED" | "SKILL_FRONTMATTER_INVALID_YAML" | "SKILL_FRONTMATTER_NOT_MAPPING" | "SKILL_UNKNOWN_TOP_LEVEL_FIELD" | "SKILL_NAME_REQUIRED" | "SKILL_NAME_NOT_STRING" | "SKILL_NAME_INVALID_FORMAT" | "SKILL_NAME_TOO_LONG" | "SKILL_NAME_DIRECTORY_MISMATCH" | "SKILL_DESCRIPTION_REQUIRED" | "SKILL_DESCRIPTION_NOT_STRING" | "SKILL_DESCRIPTION_EMPTY" | "SKILL_DESCRIPTION_TOO_LONG" | "SKILL_LICENSE_NOT_STRING" | "SKILL_LICENSE_EMPTY" | "SKILL_COMPATIBILITY_NOT_STRING" | "SKILL_COMPATIBILITY_EMPTY" | "SKILL_COMPATIBILITY_TOO_LONG" | "SKILL_METADATA_NOT_MAPPING" | "SKILL_METADATA_KEY_NOT_STRING" | "SKILL_METADATA_VALUE_NOT_STRING" | "SKILL_ALLOWED_TOOLS_NOT_STRING" | "SKILL_ALLOWED_TOOLS_EMPTY" | "SKILL_ALLOWED_TOOLS_NOT_SPACE_DELIMITED" | "SKILL_RECOMMENDATION_LINES" | "SKILL_RECOMMENDATION_TOKENS" | "SKILL_REFERENCE_OUTSIDE_ROOT" | "SKILL_REFERENCE_CHAIN_DEEP";
3
+ export type AgentSkillDiagnostic = {
4
+ code: AgentSkillDiagnosticCode;
5
+ severity: AgentSkillDiagnosticSeverity;
6
+ message: string;
7
+ skillFile: string;
8
+ };
9
+ export type ValidatedAgentSkill = {
10
+ name: string;
11
+ description: string;
12
+ license?: string;
13
+ compatibility?: string;
14
+ metadata: Record<string, string>;
15
+ allowedTools: string[];
16
+ body: string;
17
+ };
18
+ export type ValidateAgentSkillMarkdownInput = {
19
+ directoryName: string;
20
+ skillFile: string;
21
+ markdown: string;
22
+ mode?: "strict" | "compat";
23
+ };
24
+ export type AgentSkillValidationResult = {
25
+ ok: boolean;
26
+ skill?: ValidatedAgentSkill;
27
+ diagnostics: AgentSkillDiagnostic[];
28
+ };
29
+ export declare function validateAgentSkillMarkdown(input: ValidateAgentSkillMarkdownInput): AgentSkillValidationResult;
30
+ //# sourceMappingURL=skillValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillValidator.d.ts","sourceRoot":"","sources":["../../../src/node/capabilities/skillValidator.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,4BAA4B,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAChC,2BAA2B,GAC3B,4BAA4B,GAC5B,gCAAgC,GAChC,+BAA+B,GAC/B,+BAA+B,GAC/B,qBAAqB,GACrB,uBAAuB,GACvB,2BAA2B,GAC3B,qBAAqB,GACrB,+BAA+B,GAC/B,4BAA4B,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ALLOWED_TOP_LEVEL_FIELDS = new Set([
3
+ "name",
4
+ "description",
5
+ "license",
6
+ "compatibility",
7
+ "metadata",
8
+ "allowed-tools",
9
+ ]);
10
+ const AGENT_SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
11
+ const COMPAT_WARNING_CODES = new Set([
12
+ "SKILL_UNKNOWN_TOP_LEVEL_FIELD",
13
+ "SKILL_NAME_INVALID_FORMAT",
14
+ "SKILL_NAME_DIRECTORY_MISMATCH",
15
+ "SKILL_ALLOWED_TOOLS_NOT_SPACE_DELIMITED",
16
+ ]);
17
+ function errorResult(skillFile, code, message) {
18
+ return {
19
+ ok: false,
20
+ diagnostics: [{ code, severity: "error", message, skillFile }],
21
+ };
22
+ }
23
+ function isMapping(value) {
24
+ return typeof value === "object" && value !== null && !Array.isArray(value);
25
+ }
26
+ function compareUtf8(left, right) {
27
+ return Buffer.compare(Buffer.from(left, "utf8"), Buffer.from(right, "utf8"));
28
+ }
29
+ function characterCount(value) {
30
+ return [...value].length;
31
+ }
32
+ function trimSurroundingBlankLines(value) {
33
+ const lines = value.split("\n");
34
+ while (lines[0]?.trim() === "")
35
+ lines.shift();
36
+ while (lines.at(-1)?.trim() === "")
37
+ lines.pop();
38
+ return lines.join("\n");
39
+ }
40
+ export function validateAgentSkillMarkdown(input) {
41
+ const normalized = input.markdown.replace(/\r\n?/g, "\n");
42
+ const lines = normalized.split("\n");
43
+ if (lines[0] !== "---") {
44
+ return errorResult(input.skillFile, "SKILL_FRONTMATTER_MISSING", "SKILL.md must begin with an exact --- frontmatter delimiter.");
45
+ }
46
+ const closingIndex = lines.indexOf("---", 1);
47
+ if (closingIndex === -1) {
48
+ return errorResult(input.skillFile, "SKILL_FRONTMATTER_UNCLOSED", "SKILL.md frontmatter must end with an exact --- delimiter.");
49
+ }
50
+ const document = parseDocument(lines.slice(1, closingIndex).join("\n"), {
51
+ uniqueKeys: true,
52
+ });
53
+ if (document.errors.length > 0) {
54
+ return errorResult(input.skillFile, "SKILL_FRONTMATTER_INVALID_YAML", `SKILL.md frontmatter is invalid YAML: ${document.errors[0]?.message ?? "unknown parse error"}`);
55
+ }
56
+ const frontmatter = document.toJS();
57
+ if (!isMapping(frontmatter)) {
58
+ return errorResult(input.skillFile, "SKILL_FRONTMATTER_NOT_MAPPING", "SKILL.md frontmatter must be a YAML mapping.");
59
+ }
60
+ const diagnostics = [];
61
+ const addError = (code, message) => {
62
+ const severity = input.mode === "compat" && COMPAT_WARNING_CODES.has(code)
63
+ ? "warning"
64
+ : "error";
65
+ diagnostics.push({
66
+ code,
67
+ severity,
68
+ message,
69
+ skillFile: input.skillFile,
70
+ });
71
+ };
72
+ Object.keys(frontmatter)
73
+ .filter((field) => !ALLOWED_TOP_LEVEL_FIELDS.has(field))
74
+ .sort(compareUtf8)
75
+ .forEach((field) => {
76
+ addError("SKILL_UNKNOWN_TOP_LEVEL_FIELD", `Unknown Agent Skills top-level field "${field}".`);
77
+ });
78
+ const hasName = Object.hasOwn(frontmatter, "name");
79
+ const name = frontmatter.name;
80
+ if (!hasName) {
81
+ addError("SKILL_NAME_REQUIRED", 'Agent Skills field "name" is required.');
82
+ }
83
+ else if (typeof name !== "string") {
84
+ addError("SKILL_NAME_NOT_STRING", 'Agent Skills field "name" must be a string.');
85
+ }
86
+ else {
87
+ if (characterCount(name) > 64) {
88
+ addError("SKILL_NAME_TOO_LONG", 'Agent Skills field "name" must contain at most 64 characters.');
89
+ }
90
+ if (!AGENT_SKILL_NAME_PATTERN.test(name)) {
91
+ addError("SKILL_NAME_INVALID_FORMAT", 'Agent Skills field "name" must contain only lowercase ASCII letters, digits, and single hyphens between segments.');
92
+ }
93
+ if (name !== input.directoryName) {
94
+ addError("SKILL_NAME_DIRECTORY_MISMATCH", `Agent Skills name "${name}" must match directory "${input.directoryName}".`);
95
+ }
96
+ }
97
+ const hasDescription = Object.hasOwn(frontmatter, "description");
98
+ const description = frontmatter.description;
99
+ if (!hasDescription) {
100
+ addError("SKILL_DESCRIPTION_REQUIRED", 'Agent Skills field "description" is required.');
101
+ }
102
+ else if (typeof description !== "string") {
103
+ addError("SKILL_DESCRIPTION_NOT_STRING", 'Agent Skills field "description" must be a string.');
104
+ }
105
+ else if (description.trim() === "") {
106
+ addError("SKILL_DESCRIPTION_EMPTY", 'Agent Skills field "description" must not be empty.');
107
+ }
108
+ else if (characterCount(description) > 1_024) {
109
+ addError("SKILL_DESCRIPTION_TOO_LONG", 'Agent Skills field "description" must contain at most 1024 characters.');
110
+ }
111
+ const license = frontmatter.license;
112
+ if (Object.hasOwn(frontmatter, "license")) {
113
+ if (typeof license !== "string") {
114
+ addError("SKILL_LICENSE_NOT_STRING", 'Agent Skills field "license" must be a string.');
115
+ }
116
+ else if (license.trim() === "") {
117
+ addError("SKILL_LICENSE_EMPTY", 'Agent Skills field "license" must not be empty.');
118
+ }
119
+ }
120
+ const compatibility = frontmatter.compatibility;
121
+ if (Object.hasOwn(frontmatter, "compatibility")) {
122
+ if (typeof compatibility !== "string") {
123
+ addError("SKILL_COMPATIBILITY_NOT_STRING", 'Agent Skills field "compatibility" must be a string.');
124
+ }
125
+ else if (compatibility.trim() === "") {
126
+ addError("SKILL_COMPATIBILITY_EMPTY", 'Agent Skills field "compatibility" must not be empty.');
127
+ }
128
+ else if (characterCount(compatibility) > 500) {
129
+ addError("SKILL_COMPATIBILITY_TOO_LONG", 'Agent Skills field "compatibility" must contain at most 500 characters.');
130
+ }
131
+ }
132
+ const metadata = {};
133
+ if (Object.hasOwn(frontmatter, "metadata")) {
134
+ const metadataValue = frontmatter.metadata;
135
+ if (!isMapping(metadataValue)) {
136
+ addError("SKILL_METADATA_NOT_MAPPING", 'Agent Skills field "metadata" must be a string-to-string mapping.');
137
+ }
138
+ else {
139
+ const metadataNode = document.get("metadata", true);
140
+ if (isMap(metadataNode)) {
141
+ metadataNode.items
142
+ .filter((pair) => !isScalar(pair.key) || typeof pair.key.value !== "string")
143
+ .map((pair) => isScalar(pair.key) ? String(pair.key.value) : String(pair.key))
144
+ .sort(compareUtf8)
145
+ .forEach((key) => {
146
+ addError("SKILL_METADATA_KEY_NOT_STRING", `Agent Skills metadata key "${key}" must be a string.`);
147
+ });
148
+ }
149
+ Object.keys(metadataValue)
150
+ .sort(compareUtf8)
151
+ .forEach((key) => {
152
+ const value = metadataValue[key];
153
+ if (typeof value !== "string") {
154
+ addError("SKILL_METADATA_VALUE_NOT_STRING", `Agent Skills metadata value for "${key}" must be a string.`);
155
+ }
156
+ else {
157
+ metadata[key] = value;
158
+ }
159
+ });
160
+ }
161
+ }
162
+ const allowedToolsValue = frontmatter["allowed-tools"];
163
+ let allowedTools = [];
164
+ if (Object.hasOwn(frontmatter, "allowed-tools")) {
165
+ if (typeof allowedToolsValue !== "string") {
166
+ addError("SKILL_ALLOWED_TOOLS_NOT_STRING", 'Agent Skills field "allowed-tools" must be a space-delimited string.');
167
+ }
168
+ else if (allowedToolsValue.trim() === "") {
169
+ addError("SKILL_ALLOWED_TOOLS_EMPTY", 'Agent Skills field "allowed-tools" must not be empty.');
170
+ }
171
+ else if (allowedToolsValue.includes(",")) {
172
+ addError("SKILL_ALLOWED_TOOLS_NOT_SPACE_DELIMITED", 'Agent Skills field "allowed-tools" must use spaces, not commas, between tool names.');
173
+ if (input.mode === "compat") {
174
+ allowedTools = allowedToolsValue
175
+ .split(/[\s,]+/)
176
+ .map((tool) => tool.trim())
177
+ .filter(Boolean);
178
+ }
179
+ }
180
+ else {
181
+ allowedTools = allowedToolsValue.trim().split(/\s+/);
182
+ }
183
+ }
184
+ if (diagnostics.some(({ severity }) => severity === "error")) {
185
+ return { ok: false, diagnostics };
186
+ }
187
+ return {
188
+ ok: true,
189
+ skill: {
190
+ name: name,
191
+ description: description,
192
+ ...(typeof license === "string" ? { license } : {}),
193
+ ...(typeof compatibility === "string" ? { compatibility } : {}),
194
+ metadata,
195
+ allowedTools,
196
+ body: trimSurroundingBlankLines(lines.slice(closingIndex + 1).join("\n")),
197
+ },
198
+ diagnostics,
199
+ };
200
+ }
@@ -1,4 +1,6 @@
1
1
  export { joinSkillScriptPath, type SkillScriptRunResult, } from "../skillScriptPath.js";
2
2
  export { createNodeSkillScriptRunner } from "./skillScriptRunner.js";
3
3
  export { DEFAULT_SKILL_ROOTS, scanProjectSkills, type ScanProjectSkillsOptions, type ScannedSkill, type SkillRootInput, type SkillScanDiagnostic, type SkillScanMode, type SkillScanResult, } from "./capabilities/skillScanner.js";
4
+ export { validateAgentSkillMarkdown, type AgentSkillDiagnostic, type AgentSkillDiagnosticCode, type AgentSkillDiagnosticSeverity, type AgentSkillValidationResult, type ValidatedAgentSkill, type ValidateAgentSkillMarkdownInput, } from "./capabilities/skillValidator.js";
5
+ export { validateScannedSkill, type ValidateScannedSkillInput, } from "./capabilities/skillFileValidator.js";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,sCAAsC,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { joinSkillScriptPath, } from "../skillScriptPath.js";
2
2
  export { createNodeSkillScriptRunner } from "./skillScriptRunner.js";
3
3
  export { DEFAULT_SKILL_ROOTS, scanProjectSkills, } from "./capabilities/skillScanner.js";
4
+ export { validateAgentSkillMarkdown, } from "./capabilities/skillValidator.js";
5
+ export { validateScannedSkill, } from "./capabilities/skillFileValidator.js";
@@ -12,6 +12,10 @@ export type SkillValidationResult = {
12
12
  /**
13
13
  * Validate skill frontmatter against Spotlight + Agent Skills conventions.
14
14
  * Use in CI or local skill authoring tools.
15
+ *
16
+ * @deprecated Legacy Inupedia compatibility validator; use
17
+ * `validateAgentSkillMarkdown` from `@inupedia/spotlight-client/node` for
18
+ * Agent Skills conformance.
15
19
  */
16
20
  export declare function validateSkillFrontmatter(data: Record<string, unknown>): SkillValidationResult;
17
21
  /** Document how to wire a capability by execution surface. */
@@ -1 +1 @@
1
- {"version":3,"file":"skillServiceStandard.d.ts","sourceRoot":"","sources":["../src/skillServiceStandard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB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K,yBAAyB,GAC/B,CAAC"}
@@ -16,6 +16,10 @@ function asStringList(value) {
16
16
  /**
17
17
  * Validate skill frontmatter against Spotlight + Agent Skills conventions.
18
18
  * Use in CI or local skill authoring tools.
19
+ *
20
+ * @deprecated Legacy Inupedia compatibility validator; use
21
+ * `validateAgentSkillMarkdown` from `@inupedia/spotlight-client/node` for
22
+ * Agent Skills conformance.
19
23
  */
20
24
  export function validateSkillFrontmatter(data) {
21
25
  const issues = [];
@@ -58,7 +62,9 @@ export function validateSkillFrontmatter(data) {
58
62
  message: "不要使用 keywords 做路由;用 description + when_to_use",
59
63
  });
60
64
  }
61
- const errors = issues.filter((i) => i.level === "error").map((i) => i.message);
65
+ const errors = issues
66
+ .filter((i) => i.level === "error")
67
+ .map((i) => i.message);
62
68
  const warnings = issues
63
69
  .filter((i) => i.level === "warning")
64
70
  .map((i) => i.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inupedia/spotlight-client",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "HTTP/SSE helpers and host tool bridge for Inupedia Spotlight (monorepo workspace package)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  "@babel/traverse": "^7.28.5",
41
41
  "@babel/types": "^7.28.5",
42
42
  "magic-string": "^0.30.21",
43
- "@inupedia/spotlight-protocol": "0.2.11"
43
+ "yaml": "^2.8.4",
44
+ "@inupedia/spotlight-protocol": "0.2.12"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
@@ -62,6 +63,7 @@
62
63
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.node.json --noEmit",
63
64
  "build": "pnpm run clean && tsc -p tsconfig.json && tsc -p tsconfig.node.json && pnpm run verify:exports",
64
65
  "verify:exports": "node ../scripts/verify-package-exports.mjs",
66
+ "verify:skills-ref-oracle": "node scripts/verify-skills-ref-oracle.mjs",
65
67
  "test": "vitest run"
66
68
  }
67
69
  }