@inupedia/spotlight-client 0.2.11 → 0.2.13

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 (37) hide show
  1. package/dist/node/capabilities/canonicalJson.d.ts +7 -0
  2. package/dist/node/capabilities/canonicalJson.d.ts.map +1 -0
  3. package/dist/node/capabilities/canonicalJson.js +122 -0
  4. package/dist/node/capabilities/capabilityArtifact.d.ts +13 -0
  5. package/dist/node/capabilities/capabilityArtifact.d.ts.map +1 -0
  6. package/dist/node/capabilities/capabilityArtifact.js +31 -0
  7. package/dist/node/capabilities/capabilityArtifactError.d.ts +7 -0
  8. package/dist/node/capabilities/capabilityArtifactError.d.ts.map +1 -0
  9. package/dist/node/capabilities/capabilityArtifactError.js +19 -0
  10. package/dist/node/capabilities/capabilityArtifactTypes.d.ts +32 -0
  11. package/dist/node/capabilities/capabilityArtifactTypes.d.ts.map +1 -0
  12. package/dist/node/capabilities/capabilityArtifactTypes.js +1 -0
  13. package/dist/node/capabilities/capabilityFileMap.d.ts +17 -0
  14. package/dist/node/capabilities/capabilityFileMap.d.ts.map +1 -0
  15. package/dist/node/capabilities/capabilityFileMap.js +235 -0
  16. package/dist/node/capabilities/deterministicGzip.d.ts +2 -0
  17. package/dist/node/capabilities/deterministicGzip.d.ts.map +1 -0
  18. package/dist/node/capabilities/deterministicGzip.js +51 -0
  19. package/dist/node/capabilities/deterministicTar.d.ts +6 -0
  20. package/dist/node/capabilities/deterministicTar.d.ts.map +1 -0
  21. package/dist/node/capabilities/deterministicTar.js +137 -0
  22. package/dist/node/capabilities/skillFileValidator.d.ts +9 -0
  23. package/dist/node/capabilities/skillFileValidator.d.ts.map +1 -0
  24. package/dist/node/capabilities/skillFileValidator.js +90 -0
  25. package/dist/node/capabilities/skillValidator.d.ts +30 -0
  26. package/dist/node/capabilities/skillValidator.d.ts.map +1 -0
  27. package/dist/node/capabilities/skillValidator.js +200 -0
  28. package/dist/node/capabilities/toolManifest.d.ts +12 -0
  29. package/dist/node/capabilities/toolManifest.d.ts.map +1 -0
  30. package/dist/node/capabilities/toolManifest.js +111 -0
  31. package/dist/node/index.d.ts +8 -0
  32. package/dist/node/index.d.ts.map +1 -1
  33. package/dist/node/index.js +7 -0
  34. package/dist/skillServiceStandard.d.ts +4 -0
  35. package/dist/skillServiceStandard.d.ts.map +1 -1
  36. package/dist/skillServiceStandard.js +7 -1
  37. package/package.json +8 -4
@@ -0,0 +1,137 @@
1
+ import { compareUtf16, containsLoneSurrogate } from "./canonicalJson.js";
2
+ import { CapabilityArtifactError } from "./capabilityArtifactError.js";
3
+ const TAR_BLOCK_SIZE = 512;
4
+ const textEncoder = new TextEncoder();
5
+ function failInvalidPath(path) {
6
+ throw new CapabilityArtifactError("ARTIFACT_PATH_INVALID", `Invalid USTAR file path: ${path}`);
7
+ }
8
+ function validateFilePath(path) {
9
+ if (path.length === 0 ||
10
+ path.startsWith("/") ||
11
+ /^[A-Za-z]:/.test(path) ||
12
+ path.includes("\\") ||
13
+ path.includes("\0") ||
14
+ containsLoneSurrogate(path) ||
15
+ path.endsWith("/")) {
16
+ failInvalidPath(path);
17
+ }
18
+ if (path.split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
19
+ failInvalidPath(path);
20
+ }
21
+ }
22
+ function byteLength(value) {
23
+ return textEncoder.encode(value).byteLength;
24
+ }
25
+ function splitUstarPath(path) {
26
+ if (byteLength(path) <= 100)
27
+ return { name: path, prefix: "" };
28
+ for (let index = path.lastIndexOf("/"); index > 0; index = path.lastIndexOf("/", index - 1)) {
29
+ const prefix = path.slice(0, index);
30
+ const name = path.slice(index + 1);
31
+ if (name.length > 0 && byteLength(prefix) <= 155 && byteLength(name) <= 100) {
32
+ return { name, prefix };
33
+ }
34
+ }
35
+ throw new CapabilityArtifactError("ARTIFACT_PATH_USTAR_UNREPRESENTABLE", `Path cannot be represented by POSIX USTAR: ${path}`);
36
+ }
37
+ function writeAscii(block, offset, length, value) {
38
+ const bytes = textEncoder.encode(value);
39
+ if (bytes.byteLength > length) {
40
+ throw new CapabilityArtifactError("ARTIFACT_PATH_USTAR_UNREPRESENTABLE", `USTAR field exceeds ${length} bytes: ${value}`);
41
+ }
42
+ block.set(bytes, offset);
43
+ }
44
+ function writeOctal(block, offset, length, value) {
45
+ if (!Number.isSafeInteger(value) || value < 0) {
46
+ throw new CapabilityArtifactError("ARTIFACT_SIZE_OVERFLOW", `USTAR numeric field is outside the safe integer range: ${value}`);
47
+ }
48
+ const octal = value.toString(8);
49
+ if (octal.length > length - 1) {
50
+ throw new CapabilityArtifactError("ARTIFACT_SIZE_OVERFLOW", `USTAR numeric field exceeds ${length - 1} octal digits: ${value}`);
51
+ }
52
+ writeAscii(block, offset, length, `${octal.padStart(length - 1, "0")}\0`);
53
+ }
54
+ function writeChecksum(block, checksum) {
55
+ const octal = checksum.toString(8);
56
+ if (octal.length > 6) {
57
+ throw new CapabilityArtifactError("ARTIFACT_SIZE_OVERFLOW", `USTAR checksum exceeds six octal digits: ${checksum}`);
58
+ }
59
+ writeAscii(block, 148, 8, `${octal.padStart(6, "0")}\0 `);
60
+ }
61
+ function createHeader(entry) {
62
+ const block = new Uint8Array(TAR_BLOCK_SIZE);
63
+ const { name, prefix } = splitUstarPath(entry.path);
64
+ writeAscii(block, 0, 100, name);
65
+ writeOctal(block, 100, 8, entry.type === "directory" ? 0o755 : 0o644);
66
+ writeOctal(block, 108, 8, 0);
67
+ writeOctal(block, 116, 8, 0);
68
+ writeOctal(block, 124, 12, entry.type === "directory" ? 0 : entry.bytes.byteLength);
69
+ writeOctal(block, 136, 12, 0);
70
+ block.fill(0x20, 148, 156);
71
+ block[156] = (entry.type === "directory" ? "5" : "0").charCodeAt(0);
72
+ writeAscii(block, 257, 6, "ustar\0");
73
+ writeAscii(block, 263, 2, "00");
74
+ writeOctal(block, 329, 8, 0);
75
+ writeOctal(block, 337, 8, 0);
76
+ writeAscii(block, 345, 155, prefix);
77
+ let checksum = 0;
78
+ for (const byte of block)
79
+ checksum += byte;
80
+ writeChecksum(block, checksum);
81
+ return block;
82
+ }
83
+ function collectEntries(files) {
84
+ const filePaths = new Set();
85
+ const directoryPaths = new Set();
86
+ const fileEntries = [];
87
+ for (const file of files) {
88
+ validateFilePath(file.path);
89
+ splitUstarPath(file.path);
90
+ if (filePaths.has(file.path)) {
91
+ throw new CapabilityArtifactError("ARTIFACT_PATH_DUPLICATE", `Duplicate USTAR file path: ${file.path}`);
92
+ }
93
+ filePaths.add(file.path);
94
+ fileEntries.push({ path: file.path, type: "file", bytes: file.bytes });
95
+ const segments = file.path.split("/");
96
+ for (let index = 1; index < segments.length; index += 1) {
97
+ const directory = `${segments.slice(0, index).join("/")}/`;
98
+ splitUstarPath(directory);
99
+ directoryPaths.add(directory);
100
+ }
101
+ }
102
+ for (const directory of directoryPaths) {
103
+ if (filePaths.has(directory.slice(0, -1))) {
104
+ throw new CapabilityArtifactError("ARTIFACT_PATH_DUPLICATE", `USTAR path is both a file and directory: ${directory}`);
105
+ }
106
+ }
107
+ const entries = [
108
+ ...[...directoryPaths].map((path) => ({ path, type: "directory" })),
109
+ ...fileEntries,
110
+ ];
111
+ entries.sort((left, right) => compareUtf16(left.path, right.path));
112
+ return entries;
113
+ }
114
+ export function encodeDeterministicUstarV1(files) {
115
+ const entries = collectEntries(files);
116
+ let totalLength = TAR_BLOCK_SIZE * 2;
117
+ for (const entry of entries) {
118
+ totalLength += TAR_BLOCK_SIZE;
119
+ if (entry.type === "file") {
120
+ totalLength += Math.ceil(entry.bytes.byteLength / TAR_BLOCK_SIZE) * TAR_BLOCK_SIZE;
121
+ }
122
+ if (!Number.isSafeInteger(totalLength)) {
123
+ throw new CapabilityArtifactError("ARTIFACT_SIZE_OVERFLOW", "USTAR archive size exceeds the safe integer range");
124
+ }
125
+ }
126
+ const archive = new Uint8Array(totalLength);
127
+ let offset = 0;
128
+ for (const entry of entries) {
129
+ archive.set(createHeader(entry), offset);
130
+ offset += TAR_BLOCK_SIZE;
131
+ if (entry.type === "file") {
132
+ archive.set(entry.bytes, offset);
133
+ offset += Math.ceil(entry.bytes.byteLength / TAR_BLOCK_SIZE) * TAR_BLOCK_SIZE;
134
+ }
135
+ }
136
+ return archive;
137
+ }
@@ -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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ument } from "yaml";
2
+ const 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
+ }
@@ -0,0 +1,12 @@
1
+ import type { FrontendToolDescriptorV1 } from "@inupedia/spotlight-protocol";
2
+ export interface ToolManifestV1 {
3
+ schemaVersion: "spotlight.tool-manifest/1";
4
+ tools: FrontendToolDescriptorV1[];
5
+ }
6
+ export interface BuiltToolManifestV1 {
7
+ manifest: ToolManifestV1;
8
+ bytes: Uint8Array;
9
+ digest: string;
10
+ }
11
+ export declare function buildToolManifestV1(tools: FrontendToolDescriptorV1[]): BuiltToolManifestV1;
12
+ //# sourceMappingURL=toolManifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolManifest.d.ts","sourceRoot":"","sources":["../../../src/node/capabilities/toolManifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAK7E,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,2BAA2B,CAAC;IAC3C,KAAK,EAAE,wBAAwB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAwGD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,EAAE,GAChC,mBAAmB,CAkCrB"}
@@ -0,0 +1,111 @@
1
+ import { createHash } from "node:crypto";
2
+ import { isProxy } from "node:util/types";
3
+ import { canonicalizeJson, compareUtf16 } from "./canonicalJson.js";
4
+ import { CapabilityArtifactError } from "./capabilityArtifactError.js";
5
+ const TOOL_FIELDS = new Set([
6
+ "name",
7
+ "version",
8
+ "description",
9
+ "inputSchema",
10
+ "outputSchema",
11
+ "maxOutputBytes",
12
+ "sideEffect",
13
+ "replayPolicy",
14
+ "riskLevel",
15
+ "requiresConfirmation",
16
+ ]);
17
+ const SIDE_EFFECTS = new Set(["none", "ui", "external"]);
18
+ const REPLAY_POLICIES = new Set(["safe", "idempotency-key", "never"]);
19
+ const RISK_LEVELS = new Set(["low", "medium", "high"]);
20
+ function sha256(bytes) {
21
+ return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
22
+ }
23
+ function compareTools(left, right) {
24
+ return compareUtf16(left.name, right.name) || compareUtf16(left.version, right.version);
25
+ }
26
+ function invalidTool(message) {
27
+ throw new CapabilityArtifactError("ARTIFACT_TOOL_INVALID", message);
28
+ }
29
+ function isPlainObject(value) {
30
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
31
+ return false;
32
+ }
33
+ const prototype = Object.getPrototypeOf(value);
34
+ return prototype === Object.prototype || prototype === null;
35
+ }
36
+ function validateToolDescriptor(value) {
37
+ canonicalizeJson(value);
38
+ if (!isPlainObject(value)) {
39
+ invalidTool("Tool descriptor must be a plain JSON object");
40
+ }
41
+ const unknownFields = Object.keys(value)
42
+ .filter((field) => !TOOL_FIELDS.has(field))
43
+ .sort(compareUtf16);
44
+ if (unknownFields.length > 0) {
45
+ invalidTool(`Unknown Tool descriptor fields: ${unknownFields.join(", ")}`);
46
+ }
47
+ const tool = value;
48
+ if (typeof tool.name !== "string" || tool.name.trim().length === 0) {
49
+ invalidTool("Tool name must be a non-empty string");
50
+ }
51
+ if (typeof tool.version !== "string" || tool.version.trim().length === 0) {
52
+ invalidTool(`Tool ${tool.name} version must be a non-empty string`);
53
+ }
54
+ if (typeof tool.description !== "string" ||
55
+ tool.description.trim().length === 0) {
56
+ invalidTool(`Tool ${tool.name} description must be a non-empty string`);
57
+ }
58
+ if (!isPlainObject(tool.inputSchema)) {
59
+ invalidTool(`Tool ${tool.name} inputSchema must be a JSON object`);
60
+ }
61
+ if (tool.outputSchema !== undefined && !isPlainObject(tool.outputSchema)) {
62
+ invalidTool(`Tool ${tool.name} outputSchema must be a JSON object`);
63
+ }
64
+ if (tool.maxOutputBytes !== undefined &&
65
+ (!Number.isSafeInteger(tool.maxOutputBytes) || tool.maxOutputBytes <= 0)) {
66
+ invalidTool(`Tool ${tool.name} maxOutputBytes must be a positive safe integer`);
67
+ }
68
+ if (typeof tool.sideEffect !== "string" || !SIDE_EFFECTS.has(tool.sideEffect)) {
69
+ invalidTool(`Tool ${tool.name} has an invalid sideEffect`);
70
+ }
71
+ if (typeof tool.replayPolicy !== "string" ||
72
+ !REPLAY_POLICIES.has(tool.replayPolicy)) {
73
+ invalidTool(`Tool ${tool.name} has an invalid replayPolicy`);
74
+ }
75
+ if (tool.riskLevel !== undefined &&
76
+ (typeof tool.riskLevel !== "string" || !RISK_LEVELS.has(tool.riskLevel))) {
77
+ invalidTool(`Tool ${tool.name} has an invalid riskLevel`);
78
+ }
79
+ if (tool.requiresConfirmation !== undefined &&
80
+ typeof tool.requiresConfirmation !== "boolean") {
81
+ invalidTool(`Tool ${tool.name} requiresConfirmation must be boolean`);
82
+ }
83
+ }
84
+ export function buildToolManifestV1(tools) {
85
+ if (isProxy(tools) || !Array.isArray(tools)) {
86
+ invalidTool("Tool collection must be an array");
87
+ }
88
+ canonicalizeJson(tools);
89
+ for (const tool of tools)
90
+ validateToolDescriptor(tool);
91
+ const sortedTools = [...tools].sort(compareTools);
92
+ for (let index = 1; index < sortedTools.length; index += 1) {
93
+ const previous = sortedTools[index - 1];
94
+ const current = sortedTools[index];
95
+ if (previous?.name === current?.name &&
96
+ previous.version === current.version) {
97
+ throw new CapabilityArtifactError("ARTIFACT_TOOL_DUPLICATE", `Duplicate Tool identity: ${current.name}@${current.version}`);
98
+ }
99
+ }
100
+ const candidate = {
101
+ schemaVersion: "spotlight.tool-manifest/1",
102
+ tools: sortedTools,
103
+ };
104
+ const bytes = canonicalizeJson(candidate);
105
+ const manifest = JSON.parse(new TextDecoder().decode(bytes));
106
+ return {
107
+ manifest,
108
+ bytes,
109
+ digest: sha256(bytes),
110
+ };
111
+ }
@@ -1,4 +1,12 @@
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";
6
+ export { buildCapabilityArtifactV1, type CapabilityArtifactBuildV1, } from "./capabilities/capabilityArtifact.js";
7
+ export { buildCapabilityFileMapV1, computeArtifactDigestV1, type BuiltCapabilityFileMapV1, } from "./capabilities/capabilityFileMap.js";
8
+ export { CAPABILITY_ARTIFACT_ERROR_CODES, CapabilityArtifactError, type CapabilityArtifactErrorCode, } from "./capabilities/capabilityArtifactError.js";
9
+ export type { CanonicalSkillFileInputV1, CanonicalSkillInputV1, CapabilityArtifactInputV1, CapabilityFileManifestEntryV1, CapabilityFileManifestV1, CapabilityPayloadFileV1, } from "./capabilities/capabilityArtifactTypes.js";
10
+ export { canonicalizeJson, compareUtf16, type CanonicalJsonValue, } from "./capabilities/canonicalJson.js";
11
+ export { buildToolManifestV1, type BuiltToolManifestV1, type ToolManifestV1, } from "./capabilities/toolManifest.js";
4
12
  //# 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,K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,CAAC"}
@@ -1,3 +1,10 @@
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";
6
+ export { buildCapabilityArtifactV1, } from "./capabilities/capabilityArtifact.js";
7
+ export { buildCapabilityFileMapV1, computeArtifactDigestV1, } from "./capabilities/capabilityFileMap.js";
8
+ export { CAPABILITY_ARTIFACT_ERROR_CODES, CapabilityArtifactError, } from "./capabilities/capabilityArtifactError.js";
9
+ export { canonicalizeJson, compareUtf16, } from "./capabilities/canonicalJson.js";
10
+ export { buildToolManifestV1, } from "./capabilities/toolManifest.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,GAAG;IAClC,EAA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