@agentxm/registry-protocol 0.28.11 → 0.28.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.
- package/README.md +13 -5
- package/dist/src/unstable/human-handoff.d.ts +16 -0
- package/dist/src/unstable/human-handoff.js +19 -0
- package/dist/src/unstable/publish/index.d.ts +1 -6
- package/dist/src/unstable/publish/index.js +1 -6
- package/dist/src/unstable/publish-authorization.d.ts +26 -0
- package/dist/src/unstable/publish-authorization.js +41 -0
- package/dist/src/unstable/registry/discover-schema.d.ts +4 -4
- package/dist/src/unstable/registry/index.d.ts +1 -0
- package/dist/src/unstable/registry/index.js +1 -0
- package/dist/src/unstable/registry/version-selection.d.ts +22 -0
- package/dist/src/unstable/registry/version-selection.js +39 -0
- package/package.json +19 -190
- package/dist/src/unstable/content/agent-skills-standard.d.ts +0 -17
- package/dist/src/unstable/content/agent-skills-standard.js +0 -24
- package/dist/src/unstable/content/frontmatter.d.ts +0 -52
- package/dist/src/unstable/content/frontmatter.js +0 -115
- package/dist/src/unstable/content/index.d.ts +0 -11
- package/dist/src/unstable/content/index.js +0 -11
- package/dist/src/unstable/content/skill-content.d.ts +0 -43
- package/dist/src/unstable/content/skill-content.js +0 -184
- package/dist/src/unstable/content/skill-types.d.ts +0 -22
- package/dist/src/unstable/content/skill-types.js +0 -9
- package/dist/src/unstable/content/subagent-content.d.ts +0 -58
- package/dist/src/unstable/content/subagent-content.js +0 -101
- package/dist/src/unstable/knowledge/index.d.ts +0 -8
- package/dist/src/unstable/knowledge/index.js +0 -8
- package/dist/src/unstable/knowledge/knowledge-search.d.ts +0 -32
- package/dist/src/unstable/knowledge/knowledge-search.js +0 -147
- package/dist/src/unstable/knowledge/okf.d.ts +0 -86
- package/dist/src/unstable/knowledge/okf.js +0 -1090
- package/dist/src/unstable/lint/catalog/hook/decision-portability.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/hook/decision-portability.js +0 -40
- package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.js +0 -39
- package/dist/src/unstable/lint/catalog/hook/envelope.d.ts +0 -6
- package/dist/src/unstable/lint/catalog/hook/envelope.js +0 -15
- package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.js +0 -51
- package/dist/src/unstable/lint/catalog/hook.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/hook.js +0 -15
- package/dist/src/unstable/lint/catalog/knowledge/diagnostics.d.ts +0 -128
- package/dist/src/unstable/lint/catalog/knowledge/diagnostics.js +0 -78
- package/dist/src/unstable/lint/catalog/knowledge/envelope.d.ts +0 -6
- package/dist/src/unstable/lint/catalog/knowledge/envelope.js +0 -15
- package/dist/src/unstable/lint/catalog/knowledge.d.ts +0 -5
- package/dist/src/unstable/lint/catalog/knowledge.js +0 -9
- package/dist/src/unstable/lint/catalog/mcp-server/envelope.d.ts +0 -6
- package/dist/src/unstable/lint/catalog/mcp-server/envelope.js +0 -15
- package/dist/src/unstable/lint/catalog/mcp-server.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/mcp-server.js +0 -4
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +0 -28
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +0 -38
- package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +0 -17
- package/dist/src/unstable/lint/catalog/pack/manifest-present.js +0 -24
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +0 -25
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +0 -33
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +0 -51
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +0 -45
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +0 -60
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +0 -85
- package/dist/src/unstable/lint/catalog/pack.d.ts +0 -31
- package/dist/src/unstable/lint/catalog/pack.js +0 -36
- package/dist/src/unstable/lint/catalog/rule/envelope.d.ts +0 -6
- package/dist/src/unstable/lint/catalog/rule/envelope.js +0 -15
- package/dist/src/unstable/lint/catalog/rule.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/rule.js +0 -4
- package/dist/src/unstable/lint/catalog/shared/envelope-rules.d.ts +0 -88
- package/dist/src/unstable/lint/catalog/shared/envelope-rules.js +0 -84
- package/dist/src/unstable/lint/catalog/shared/manifest-json.d.ts +0 -18
- package/dist/src/unstable/lint/catalog/shared/manifest-json.js +0 -28
- package/dist/src/unstable/lint/catalog/shared/manifest-present.d.ts +0 -25
- package/dist/src/unstable/lint/catalog/shared/manifest-present.js +0 -37
- package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.d.ts +0 -70
- package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.js +0 -139
- package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +0 -57
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js +0 -102
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +0 -31
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +0 -148
- package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.d.ts +0 -13
- package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.js +0 -61
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +0 -26
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +0 -41
- package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +0 -23
- package/dist/src/unstable/lint/catalog/skill/manifest-present.js +0 -32
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +0 -21
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +0 -36
- package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.d.ts +0 -8
- package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.js +0 -12
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +0 -17
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +0 -37
- package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.d.ts +0 -8
- package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.js +0 -12
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +0 -61
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +0 -55
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +0 -77
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +0 -135
- package/dist/src/unstable/lint/catalog/skill.d.ts +0 -38
- package/dist/src/unstable/lint/catalog/skill.js +0 -53
- package/dist/src/unstable/lint/catalog/subagent/envelope.d.ts +0 -6
- package/dist/src/unstable/lint/catalog/subagent/envelope.js +0 -15
- package/dist/src/unstable/lint/catalog/subagent.d.ts +0 -4
- package/dist/src/unstable/lint/catalog/subagent.js +0 -4
- package/dist/src/unstable/lint/catalog-metadata.d.ts +0 -125
- package/dist/src/unstable/lint/catalog-metadata.js +0 -642
- package/dist/src/unstable/lint/compose-path.d.ts +0 -28
- package/dist/src/unstable/lint/compose-path.js +0 -64
- package/dist/src/unstable/lint/config.d.ts +0 -77
- package/dist/src/unstable/lint/config.js +0 -99
- package/dist/src/unstable/lint/context.d.ts +0 -239
- package/dist/src/unstable/lint/context.js +0 -17
- package/dist/src/unstable/lint/describe-document.d.ts +0 -31
- package/dist/src/unstable/lint/describe-document.js +0 -50
- package/dist/src/unstable/lint/evaluate.d.ts +0 -47
- package/dist/src/unstable/lint/evaluate.js +0 -73
- package/dist/src/unstable/lint/issues-to-findings.d.ts +0 -35
- package/dist/src/unstable/lint/issues-to-findings.js +0 -149
- package/dist/src/unstable/lint/publish.d.ts +0 -49
- package/dist/src/unstable/lint/publish.js +0 -86
- package/dist/src/unstable/lint/rule.d.ts +0 -97
- package/dist/src/unstable/lint/rule.js +0 -17
- package/dist/src/unstable/publish/archive-guardrails.d.ts +0 -39
- package/dist/src/unstable/publish/archive-guardrails.js +0 -250
- package/dist/src/unstable/publish/filtered-package-validation.d.ts +0 -24
- package/dist/src/unstable/publish/filtered-package-validation.js +0 -117
- package/dist/src/unstable/publish/ingest-limits.d.ts +0 -25
- package/dist/src/unstable/publish/ingest-limits.js +0 -41
- package/dist/src/unstable/publish/input-normalization.d.ts +0 -40
- package/dist/src/unstable/publish/input-normalization.js +0 -125
- package/dist/src/unstable/publish/manifest-policy.d.ts +0 -611
- package/dist/src/unstable/publish/manifest-policy.js +0 -196
- package/dist/src/unstable/publish/test-zip-helpers.d.ts +0 -13
- package/dist/src/unstable/publish/test-zip-helpers.js +0 -117
- package/dist/src/unstable/registry/release-age-policy.d.ts +0 -57
- package/dist/src/unstable/registry/release-age-policy.js +0 -117
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic YAML frontmatter parser.
|
|
3
|
-
*
|
|
4
|
-
* Parses content that may begin with a YAML frontmatter block delimited
|
|
5
|
-
* by `---`. Returns the parsed frontmatter as `unknown` so each consumer
|
|
6
|
-
* can apply its own Schema validation.
|
|
7
|
-
*
|
|
8
|
-
* @experimental This API is unstable and may change without notice.
|
|
9
|
-
*/
|
|
10
|
-
import * as Effect from "effect/Effect";
|
|
11
|
-
/**
|
|
12
|
-
* Result of parsing frontmatter from content.
|
|
13
|
-
*
|
|
14
|
-
* @experimental This API is unstable and may change without notice.
|
|
15
|
-
*/
|
|
16
|
-
export interface FrontmatterResult {
|
|
17
|
-
/** Parsed YAML frontmatter, or undefined if no frontmatter block was found. */
|
|
18
|
-
readonly frontmatter: unknown;
|
|
19
|
-
/** Content body after the frontmatter block, or full content if no frontmatter. */
|
|
20
|
-
readonly body: string;
|
|
21
|
-
}
|
|
22
|
-
declare const FrontmatterParseFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
23
|
-
readonly _tag: "FrontmatterParseFailure";
|
|
24
|
-
} & Readonly<A>;
|
|
25
|
-
/** Bounded, document-relative failure from parsing a YAML frontmatter block. */
|
|
26
|
-
export declare class FrontmatterParseFailure extends FrontmatterParseFailure_base<{
|
|
27
|
-
readonly reason: string;
|
|
28
|
-
readonly line?: number;
|
|
29
|
-
readonly column?: number;
|
|
30
|
-
}> {
|
|
31
|
-
}
|
|
32
|
-
export declare const FRONTMATTER_PARSE_FALLBACK_REASON = "YAML frontmatter could not be parsed";
|
|
33
|
-
/** Normalize a foreign YAML failure without retaining its raw cause or parser code. */
|
|
34
|
-
export declare const normalizeFrontmatterParseFailure: (error: unknown, documentLineOffset: number) => FrontmatterParseFailure;
|
|
35
|
-
/**
|
|
36
|
-
* Parse frontmatter from content synchronously.
|
|
37
|
-
*
|
|
38
|
-
* Throws on malformed YAML. Use `parseFrontmatterEffect` for full error channel.
|
|
39
|
-
*
|
|
40
|
-
* @experimental This API is unstable and may change without notice.
|
|
41
|
-
*/
|
|
42
|
-
export declare const parseFrontmatterSync: (content: string) => FrontmatterResult;
|
|
43
|
-
/**
|
|
44
|
-
* Parse frontmatter from content as an Effect.
|
|
45
|
-
*
|
|
46
|
-
* Returns `FrontmatterParseFailure` in the error channel for malformed YAML.
|
|
47
|
-
*
|
|
48
|
-
* @experimental This API is unstable and may change without notice.
|
|
49
|
-
*/
|
|
50
|
-
export declare const parseFrontmatterEffect: (content: string) => Effect.Effect<FrontmatterResult, FrontmatterParseFailure>;
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic YAML frontmatter parser.
|
|
3
|
-
*
|
|
4
|
-
* Parses content that may begin with a YAML frontmatter block delimited
|
|
5
|
-
* by `---`. Returns the parsed frontmatter as `unknown` so each consumer
|
|
6
|
-
* can apply its own Schema validation.
|
|
7
|
-
*
|
|
8
|
-
* @experimental This API is unstable and may change without notice.
|
|
9
|
-
*/
|
|
10
|
-
import * as Data from "effect/Data";
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import YAML, { YAMLParseError } from "yaml";
|
|
13
|
-
/** Bounded, document-relative failure from parsing a YAML frontmatter block. */
|
|
14
|
-
export class FrontmatterParseFailure extends Data.TaggedError("FrontmatterParseFailure") {
|
|
15
|
-
}
|
|
16
|
-
const FRONTMATTER_DELIMITER = "---";
|
|
17
|
-
export const FRONTMATTER_PARSE_FALLBACK_REASON = "YAML frontmatter could not be parsed";
|
|
18
|
-
const FRONTMATTER_PARSE_REASON_MAX_CODE_POINTS = 256;
|
|
19
|
-
const boundedReason = (reason) => {
|
|
20
|
-
const codePoints = Array.from(reason);
|
|
21
|
-
if (codePoints.length <= FRONTMATTER_PARSE_REASON_MAX_CODE_POINTS)
|
|
22
|
-
return reason;
|
|
23
|
-
return `${codePoints.slice(0, FRONTMATTER_PARSE_REASON_MAX_CODE_POINTS - 1).join("")}…`;
|
|
24
|
-
};
|
|
25
|
-
const parserReason = (error) => {
|
|
26
|
-
const firstLine = error.message.split(/\r?\n/, 1)[0]?.trim() ?? "";
|
|
27
|
-
const withoutLocation = firstLine
|
|
28
|
-
.replace(/\s+at line \d+, column \d+:?$/, "")
|
|
29
|
-
.replace(/^Missing closing ["']quote$/, "Missing closing quote")
|
|
30
|
-
.trim();
|
|
31
|
-
return boundedReason(withoutLocation || FRONTMATTER_PARSE_FALLBACK_REASON);
|
|
32
|
-
};
|
|
33
|
-
/** Normalize a foreign YAML failure without retaining its raw cause or parser code. */
|
|
34
|
-
export const normalizeFrontmatterParseFailure = (error, documentLineOffset) => {
|
|
35
|
-
if (!(error instanceof YAMLParseError)) {
|
|
36
|
-
return new FrontmatterParseFailure({ reason: FRONTMATTER_PARSE_FALLBACK_REASON });
|
|
37
|
-
}
|
|
38
|
-
const position = error.linePos?.[0];
|
|
39
|
-
if (position === undefined || !Number.isSafeInteger(position.line) || position.line < 1) {
|
|
40
|
-
return new FrontmatterParseFailure({ reason: parserReason(error) });
|
|
41
|
-
}
|
|
42
|
-
const line = position.line + documentLineOffset;
|
|
43
|
-
const column = Number.isSafeInteger(position.col) && position.col > 0 ? position.col : undefined;
|
|
44
|
-
return new FrontmatterParseFailure({
|
|
45
|
-
reason: parserReason(error),
|
|
46
|
-
line,
|
|
47
|
-
...(column === undefined ? {} : { column }),
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Find the frontmatter boundaries in content.
|
|
52
|
-
* Returns [endOfOpening, startOfClosing] indices, or undefined if no frontmatter.
|
|
53
|
-
*/
|
|
54
|
-
const findFrontmatterBoundaries = (content) => {
|
|
55
|
-
if (!content.startsWith(FRONTMATTER_DELIMITER)) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
const afterOpening = content.indexOf("\n");
|
|
59
|
-
if (afterOpening === -1) {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
const closingIndex = content.indexOf(`\n${FRONTMATTER_DELIMITER}`, afterOpening);
|
|
63
|
-
if (closingIndex === -1) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
const closingEnd = closingIndex + 1 + FRONTMATTER_DELIMITER.length;
|
|
67
|
-
const bodyStart = content.startsWith("\r\n", closingEnd)
|
|
68
|
-
? closingEnd + 2
|
|
69
|
-
: content[closingEnd] === "\n"
|
|
70
|
-
? closingEnd + 1
|
|
71
|
-
: closingEnd;
|
|
72
|
-
return {
|
|
73
|
-
yamlStart: afterOpening + 1,
|
|
74
|
-
bodyStart,
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Parse frontmatter from content synchronously.
|
|
79
|
-
*
|
|
80
|
-
* Throws on malformed YAML. Use `parseFrontmatterEffect` for full error channel.
|
|
81
|
-
*
|
|
82
|
-
* @experimental This API is unstable and may change without notice.
|
|
83
|
-
*/
|
|
84
|
-
export const parseFrontmatterSync = (content) => {
|
|
85
|
-
const boundaries = findFrontmatterBoundaries(content);
|
|
86
|
-
if (boundaries === undefined) {
|
|
87
|
-
return { frontmatter: undefined, body: content };
|
|
88
|
-
}
|
|
89
|
-
const yamlContent = content.slice(boundaries.yamlStart, boundaries.bodyStart).split("---")[0];
|
|
90
|
-
const frontmatter = (() => {
|
|
91
|
-
try {
|
|
92
|
-
return YAML.parse(yamlContent ?? "");
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
const documentLineOffset = content.slice(0, boundaries.yamlStart).split("\n").length - 1;
|
|
96
|
-
throw normalizeFrontmatterParseFailure(error, documentLineOffset);
|
|
97
|
-
}
|
|
98
|
-
})();
|
|
99
|
-
const body = content.slice(boundaries.bodyStart);
|
|
100
|
-
return { frontmatter: frontmatter ?? undefined, body };
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Parse frontmatter from content as an Effect.
|
|
104
|
-
*
|
|
105
|
-
* Returns `FrontmatterParseFailure` in the error channel for malformed YAML.
|
|
106
|
-
*
|
|
107
|
-
* @experimental This API is unstable and may change without notice.
|
|
108
|
-
*/
|
|
109
|
-
export const parseFrontmatterEffect = (content) => Effect.try({
|
|
110
|
-
try: () => parseFrontmatterSync(content),
|
|
111
|
-
catch: (error) => error instanceof FrontmatterParseFailure
|
|
112
|
-
? error
|
|
113
|
-
: new FrontmatterParseFailure({ reason: FRONTMATTER_PARSE_FALLBACK_REASON }),
|
|
114
|
-
});
|
|
115
|
-
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Area barrel for the package public surface.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
*/
|
|
6
|
-
export { AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH, AGENT_SKILLS_DESCRIPTION_MAX_LENGTH, AGENT_SKILLS_FRONTMATTER_FIELDS, AGENT_SKILLS_NAME_MAX_LENGTH, AGENT_SKILLS_REFERENCE_VALIDATOR_URL, AGENT_SKILLS_SPECIFICATION_URL, AGENT_SKILLS_STANDARD_REVISION, } from "./agent-skills-standard.js";
|
|
7
|
-
export { FrontmatterParseFailure, type FrontmatterResult, parseFrontmatterEffect, parseFrontmatterSync, } from "./frontmatter.js";
|
|
8
|
-
export { type SkillFrontmatter, SkillFrontmatterSchema, type SkillFrontmatterValidation, parseSkillMd, validateSkillFrontmatter, } from "./skill-content.js";
|
|
9
|
-
export { type Skill } from "./skill-types.js";
|
|
10
|
-
export { type SubagentAgentOverrides, type SubagentContentResult, parseSubagentMd, } from "./subagent-content.js";
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Area barrel for the package public surface.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
*/
|
|
6
|
-
export { AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH, AGENT_SKILLS_DESCRIPTION_MAX_LENGTH, AGENT_SKILLS_FRONTMATTER_FIELDS, AGENT_SKILLS_NAME_MAX_LENGTH, AGENT_SKILLS_REFERENCE_VALIDATOR_URL, AGENT_SKILLS_SPECIFICATION_URL, AGENT_SKILLS_STANDARD_REVISION, } from "./agent-skills-standard.js";
|
|
7
|
-
export { FrontmatterParseFailure, parseFrontmatterEffect, parseFrontmatterSync, } from "./frontmatter.js";
|
|
8
|
-
export { SkillFrontmatterSchema, parseSkillMd, validateSkillFrontmatter, } from "./skill-content.js";
|
|
9
|
-
export {} from "./skill-types.js";
|
|
10
|
-
export { parseSubagentMd, } from "./subagent-content.js";
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill content file module for SKILL.md parsing and frontmatter schemas.
|
|
3
|
-
*
|
|
4
|
-
* Defines the frontmatter schema for SKILL.md files and a parser that
|
|
5
|
-
* combines the shared frontmatter utility with skill-specific validation.
|
|
6
|
-
*
|
|
7
|
-
* @experimental This API is unstable and may change without notice.
|
|
8
|
-
*/
|
|
9
|
-
import * as Option from "effect/Option";
|
|
10
|
-
import * as Schema from "effect/Schema";
|
|
11
|
-
import type { Skill } from "./skill-types.js";
|
|
12
|
-
/**
|
|
13
|
-
* Schema for SKILL.md frontmatter fields.
|
|
14
|
-
*
|
|
15
|
-
* @experimental This API is unstable and may change without notice.
|
|
16
|
-
*/
|
|
17
|
-
export declare const SkillFrontmatterSchema: Schema.Struct<{
|
|
18
|
-
readonly name: Schema.String;
|
|
19
|
-
readonly description: Schema.String;
|
|
20
|
-
readonly license: Schema.optionalKey<Schema.String>;
|
|
21
|
-
readonly compatibility: Schema.optionalKey<Schema.String>;
|
|
22
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
23
|
-
readonly "allowed-tools": Schema.optionalKey<Schema.String>;
|
|
24
|
-
}>;
|
|
25
|
-
export type SkillFrontmatter = Schema.Schema.Type<typeof SkillFrontmatterSchema>;
|
|
26
|
-
export type SkillFrontmatterValidation = {
|
|
27
|
-
readonly valid: true;
|
|
28
|
-
readonly frontmatter: SkillFrontmatter;
|
|
29
|
-
} | {
|
|
30
|
-
readonly valid: false;
|
|
31
|
-
readonly errors: ReadonlyArray<string>;
|
|
32
|
-
};
|
|
33
|
-
/** Validate parsed YAML against the pinned Agent Skills metadata contract. */
|
|
34
|
-
export declare const validateSkillFrontmatter: (input: unknown, expectedDirectoryName?: string) => SkillFrontmatterValidation;
|
|
35
|
-
/**
|
|
36
|
-
* Parse a SKILL.md file's content and extract skill metadata from frontmatter.
|
|
37
|
-
*
|
|
38
|
-
* Returns `Option.some(Skill)` when the file has valid YAML frontmatter with
|
|
39
|
-
* non-empty `name` and `description` fields. Returns `Option.none()` for any
|
|
40
|
-
* invalid input: missing frontmatter, invalid YAML, or missing/empty required fields.
|
|
41
|
-
*/
|
|
42
|
-
export declare const parseSkillMd: (content: string, expectedDirectoryName?: string) => Option.Option<Skill>;
|
|
43
|
-
//# sourceMappingURL=skill-content.d.ts.map
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill content file module for SKILL.md parsing and frontmatter schemas.
|
|
3
|
-
*
|
|
4
|
-
* Defines the frontmatter schema for SKILL.md files and a parser that
|
|
5
|
-
* combines the shared frontmatter utility with skill-specific validation.
|
|
6
|
-
*
|
|
7
|
-
* @experimental This API is unstable and may change without notice.
|
|
8
|
-
*/
|
|
9
|
-
import * as Option from "effect/Option";
|
|
10
|
-
import * as Schema from "effect/Schema";
|
|
11
|
-
import { parseFrontmatterSync } from "./frontmatter.js";
|
|
12
|
-
import { AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH, AGENT_SKILLS_DESCRIPTION_MAX_LENGTH, AGENT_SKILLS_FRONTMATTER_FIELDS, AGENT_SKILLS_NAME_MAX_LENGTH, } from "./agent-skills-standard.js";
|
|
13
|
-
const NonEmptyTrimmedStringSchema = Schema.String.pipe(Schema.check(Schema.makeFilter((input) => input.trim().length > 0 ? undefined : "Expected a non-empty string")));
|
|
14
|
-
const BoundedNonEmptyStringSchema = (maximumLength) => NonEmptyTrimmedStringSchema.pipe(Schema.check(Schema.makeFilter((input) => [...input].length <= maximumLength
|
|
15
|
-
? undefined
|
|
16
|
-
: `Expected at most ${maximumLength} characters`)));
|
|
17
|
-
const SkillNameSchema = BoundedNonEmptyStringSchema(AGENT_SKILLS_NAME_MAX_LENGTH).pipe(Schema.check(Schema.makeFilter((input) => {
|
|
18
|
-
const normalized = input.trim().normalize("NFKC");
|
|
19
|
-
if (normalized !== normalized.toLowerCase())
|
|
20
|
-
return "Skill name must be lowercase";
|
|
21
|
-
if (normalized.startsWith("-") || normalized.endsWith("-")) {
|
|
22
|
-
return "Skill name cannot start or end with a hyphen";
|
|
23
|
-
}
|
|
24
|
-
if (normalized.includes("--"))
|
|
25
|
-
return "Skill name cannot contain consecutive hyphens";
|
|
26
|
-
return [...normalized].every((character) => /[\p{L}\p{N}-]/u.test(character))
|
|
27
|
-
? undefined
|
|
28
|
-
: "Skill name may contain only Unicode letters, numbers, and hyphens";
|
|
29
|
-
})));
|
|
30
|
-
const AllowedToolsSchema = NonEmptyTrimmedStringSchema.pipe(Schema.check(Schema.makeFilter((input) => /^\S+(?: \S+)*$/u.test(input) ? undefined : "Allowed tools must be a space-delimited string")));
|
|
31
|
-
/**
|
|
32
|
-
* Schema for SKILL.md frontmatter fields.
|
|
33
|
-
*
|
|
34
|
-
* @experimental This API is unstable and may change without notice.
|
|
35
|
-
*/
|
|
36
|
-
export const SkillFrontmatterSchema = Schema.Struct({
|
|
37
|
-
name: SkillNameSchema.pipe(Schema.annotateKey({ messageMissingKey: "skill name is required in SKILL.md frontmatter" })),
|
|
38
|
-
description: BoundedNonEmptyStringSchema(AGENT_SKILLS_DESCRIPTION_MAX_LENGTH).pipe(Schema.annotateKey({
|
|
39
|
-
messageMissingKey: "skill description is required in SKILL.md frontmatter",
|
|
40
|
-
})),
|
|
41
|
-
license: Schema.optionalKey(Schema.String),
|
|
42
|
-
compatibility: Schema.optionalKey(BoundedNonEmptyStringSchema(AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH)),
|
|
43
|
-
metadata: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
44
|
-
"allowed-tools": Schema.optionalKey(AllowedToolsSchema),
|
|
45
|
-
}).annotate({
|
|
46
|
-
identifier: "SkillFrontmatter",
|
|
47
|
-
title: "Skill Frontmatter",
|
|
48
|
-
description: "Agent Skills standard metadata at the top of a SKILL.md file.",
|
|
49
|
-
});
|
|
50
|
-
const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
51
|
-
const allowedFrontmatterFields = new Set(AGENT_SKILLS_FRONTMATTER_FIELDS);
|
|
52
|
-
/** Validate parsed YAML against the pinned Agent Skills metadata contract. */
|
|
53
|
-
export const validateSkillFrontmatter = (input, expectedDirectoryName) => {
|
|
54
|
-
if (!isRecord(input)) {
|
|
55
|
-
return { valid: false, errors: ["SKILL.md frontmatter must be a YAML mapping"] };
|
|
56
|
-
}
|
|
57
|
-
const errors = [];
|
|
58
|
-
const unexpected = Object.keys(input)
|
|
59
|
-
.filter((key) => !allowedFrontmatterFields.has(key))
|
|
60
|
-
.sort();
|
|
61
|
-
if (unexpected.length > 0) {
|
|
62
|
-
errors.push(`Unexpected frontmatter fields: ${unexpected.join(", ")}`);
|
|
63
|
-
}
|
|
64
|
-
const nameValue = input["name"];
|
|
65
|
-
let normalizedName;
|
|
66
|
-
if (typeof nameValue !== "string" || nameValue.trim().length === 0) {
|
|
67
|
-
errors.push("Field 'name' must be a non-empty string");
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
normalizedName = nameValue.trim().normalize("NFKC");
|
|
71
|
-
if ([...normalizedName].length > AGENT_SKILLS_NAME_MAX_LENGTH) {
|
|
72
|
-
errors.push(`Skill name exceeds ${AGENT_SKILLS_NAME_MAX_LENGTH} character limit`);
|
|
73
|
-
}
|
|
74
|
-
if (normalizedName !== normalizedName.toLowerCase()) {
|
|
75
|
-
errors.push("Skill name must be lowercase");
|
|
76
|
-
}
|
|
77
|
-
if (normalizedName.startsWith("-") || normalizedName.endsWith("-")) {
|
|
78
|
-
errors.push("Skill name cannot start or end with a hyphen");
|
|
79
|
-
}
|
|
80
|
-
if (normalizedName.includes("--")) {
|
|
81
|
-
errors.push("Skill name cannot contain consecutive hyphens");
|
|
82
|
-
}
|
|
83
|
-
if (![...normalizedName].every((character) => /[\p{L}\p{N}-]/u.test(character))) {
|
|
84
|
-
errors.push("Skill name may contain only Unicode letters, numbers, and hyphens");
|
|
85
|
-
}
|
|
86
|
-
if (expectedDirectoryName !== undefined &&
|
|
87
|
-
expectedDirectoryName.normalize("NFKC") !== normalizedName) {
|
|
88
|
-
errors.push(`Directory name '${expectedDirectoryName}' must match skill name '${normalizedName}'`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const descriptionValue = input["description"];
|
|
92
|
-
if (typeof descriptionValue !== "string" || descriptionValue.trim().length === 0) {
|
|
93
|
-
errors.push("Field 'description' must be a non-empty string");
|
|
94
|
-
}
|
|
95
|
-
else if ([...descriptionValue].length > AGENT_SKILLS_DESCRIPTION_MAX_LENGTH) {
|
|
96
|
-
errors.push(`Description exceeds ${AGENT_SKILLS_DESCRIPTION_MAX_LENGTH} character limit`);
|
|
97
|
-
}
|
|
98
|
-
const licenseValue = input["license"];
|
|
99
|
-
if (licenseValue !== undefined && typeof licenseValue !== "string") {
|
|
100
|
-
errors.push("Field 'license' must be a string");
|
|
101
|
-
}
|
|
102
|
-
const compatibilityValue = input["compatibility"];
|
|
103
|
-
if (compatibilityValue !== undefined) {
|
|
104
|
-
if (typeof compatibilityValue !== "string" || compatibilityValue.trim().length === 0) {
|
|
105
|
-
errors.push("Field 'compatibility' must be a non-empty string");
|
|
106
|
-
}
|
|
107
|
-
else if ([...compatibilityValue].length > AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH) {
|
|
108
|
-
errors.push(`Compatibility exceeds ${AGENT_SKILLS_COMPATIBILITY_MAX_LENGTH} character limit`);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const metadataValue = input["metadata"];
|
|
112
|
-
const metadata = {};
|
|
113
|
-
if (metadataValue !== undefined) {
|
|
114
|
-
if (!isRecord(metadataValue)) {
|
|
115
|
-
errors.push("Field 'metadata' must be a mapping from strings to strings");
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
for (const [key, value] of Object.entries(metadataValue)) {
|
|
119
|
-
if (typeof value !== "string") {
|
|
120
|
-
errors.push(`Metadata value for '${key}' must be a string`);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
metadata[key] = value;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const allowedToolsValue = input["allowed-tools"];
|
|
129
|
-
if (allowedToolsValue !== undefined) {
|
|
130
|
-
if (typeof allowedToolsValue !== "string" || !/^\S+(?: \S+)*$/u.test(allowedToolsValue)) {
|
|
131
|
-
errors.push("Field 'allowed-tools' must be a non-empty space-delimited string");
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (errors.length > 0 || normalizedName === undefined || typeof descriptionValue !== "string") {
|
|
135
|
-
return { valid: false, errors };
|
|
136
|
-
}
|
|
137
|
-
return {
|
|
138
|
-
valid: true,
|
|
139
|
-
frontmatter: {
|
|
140
|
-
name: normalizedName,
|
|
141
|
-
description: descriptionValue,
|
|
142
|
-
...(licenseValue !== undefined && typeof licenseValue === "string"
|
|
143
|
-
? { license: licenseValue }
|
|
144
|
-
: {}),
|
|
145
|
-
...(compatibilityValue !== undefined && typeof compatibilityValue === "string"
|
|
146
|
-
? { compatibility: compatibilityValue }
|
|
147
|
-
: {}),
|
|
148
|
-
...(metadataValue !== undefined ? { metadata } : {}),
|
|
149
|
-
...(allowedToolsValue !== undefined && typeof allowedToolsValue === "string"
|
|
150
|
-
? { "allowed-tools": allowedToolsValue }
|
|
151
|
-
: {}),
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Parse a SKILL.md file's content and extract skill metadata from frontmatter.
|
|
157
|
-
*
|
|
158
|
-
* Returns `Option.some(Skill)` when the file has valid YAML frontmatter with
|
|
159
|
-
* non-empty `name` and `description` fields. Returns `Option.none()` for any
|
|
160
|
-
* invalid input: missing frontmatter, invalid YAML, or missing/empty required fields.
|
|
161
|
-
*/
|
|
162
|
-
export const parseSkillMd = (content, expectedDirectoryName) => {
|
|
163
|
-
try {
|
|
164
|
-
const parsed = parseFrontmatterSync(content);
|
|
165
|
-
if (parsed.frontmatter === undefined) {
|
|
166
|
-
return Option.none();
|
|
167
|
-
}
|
|
168
|
-
const validation = validateSkillFrontmatter(parsed.frontmatter, expectedDirectoryName);
|
|
169
|
-
if (!validation.valid) {
|
|
170
|
-
return Option.none();
|
|
171
|
-
}
|
|
172
|
-
const frontmatter = validation.frontmatter;
|
|
173
|
-
return Option.some({
|
|
174
|
-
name: frontmatter.name,
|
|
175
|
-
description: frontmatter.description,
|
|
176
|
-
metadata: frontmatter.metadata === undefined ? Option.none() : Option.some(frontmatter.metadata),
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
catch {
|
|
180
|
-
// Invalid YAML or other parsing errors — silently skip
|
|
181
|
-
return Option.none();
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
//# sourceMappingURL=skill-content.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain types for skills management.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import * as Option from "effect/Option";
|
|
8
|
-
import * as Record from "effect/Record";
|
|
9
|
-
/**
|
|
10
|
-
* Represents a discovered skill.
|
|
11
|
-
*
|
|
12
|
-
* @experimental This API is unstable and may change without notice.
|
|
13
|
-
*/
|
|
14
|
-
export interface Skill {
|
|
15
|
-
/** Unique name of the skill */
|
|
16
|
-
readonly name: string;
|
|
17
|
-
/** Description of the skill */
|
|
18
|
-
readonly description: string;
|
|
19
|
-
/** Optional metadata from SKILL.md frontmatter */
|
|
20
|
-
readonly metadata: Option.Option<Record.ReadonlyRecord<string, string>>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=skill-types.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core domain types for skills management.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import * as Option from "effect/Option";
|
|
8
|
-
import * as Record from "effect/Record";
|
|
9
|
-
//# sourceMappingURL=skill-types.js.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subagent content file module for subagent content parsing.
|
|
3
|
-
*
|
|
4
|
-
* The content file's YAML frontmatter is largely free-form: only `name` is
|
|
5
|
-
* required and validated. `agentOverrides`, when present, is recognized for
|
|
6
|
-
* use in per-agent rendering. Any other frontmatter keys flow through
|
|
7
|
-
* verbatim to the agent-native file produced by the renderer.
|
|
8
|
-
*
|
|
9
|
-
* @experimental This API is unstable and may change without notice.
|
|
10
|
-
*/
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import * as Option from "effect/Option";
|
|
13
|
-
declare const SubagentContentError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
14
|
-
readonly _tag: "SubagentContentError";
|
|
15
|
-
} & Readonly<A>;
|
|
16
|
-
/**
|
|
17
|
-
* Typed failure produced while parsing a subagent content file. Application
|
|
18
|
-
* layers translate this into their own error vocabulary.
|
|
19
|
-
*
|
|
20
|
-
* @experimental This API is unstable and may change without notice.
|
|
21
|
-
*/
|
|
22
|
-
export declare class SubagentContentError extends SubagentContentError_base<{
|
|
23
|
-
readonly reason: "frontmatter-parse" | "missing-frontmatter" | "invalid-frontmatter" | "name-mismatch";
|
|
24
|
-
readonly detail: string;
|
|
25
|
-
readonly suggestion?: string;
|
|
26
|
-
readonly cause?: unknown;
|
|
27
|
-
}> {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Map of agent-id → merge patch applied during per-agent rendering.
|
|
31
|
-
*
|
|
32
|
-
* @experimental This API is unstable and may change without notice.
|
|
33
|
-
*/
|
|
34
|
-
export type SubagentAgentOverrides = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
35
|
-
/**
|
|
36
|
-
* Result of parsing a subagent content file.
|
|
37
|
-
*
|
|
38
|
-
* @experimental This API is unstable and may change without notice.
|
|
39
|
-
*/
|
|
40
|
-
export interface SubagentContentResult {
|
|
41
|
-
/** The full frontmatter map, opaque except for `name`. Empty when no frontmatter. */
|
|
42
|
-
readonly frontmatter: Option.Option<Readonly<Record<string, unknown>>>;
|
|
43
|
-
/** The `agentOverrides` map keyed by agent id, when present and structurally valid. */
|
|
44
|
-
readonly agentOverrides: Option.Option<SubagentAgentOverrides>;
|
|
45
|
-
/** Content body after the frontmatter block, or full content if no frontmatter. */
|
|
46
|
-
readonly body: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Parse a subagent content file into validated frontmatter and body.
|
|
50
|
-
*
|
|
51
|
-
* Validates only that frontmatter is present and that its `name` matches
|
|
52
|
-
* the expected name. All other keys are preserved verbatim.
|
|
53
|
-
*
|
|
54
|
-
* @experimental This API is unstable and may change without notice.
|
|
55
|
-
*/
|
|
56
|
-
export declare const parseSubagentMd: (content: string, expectedName: string) => Effect.Effect<SubagentContentResult, SubagentContentError>;
|
|
57
|
-
export {};
|
|
58
|
-
//# sourceMappingURL=subagent-content.d.ts.map
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subagent content file module for subagent content parsing.
|
|
3
|
-
*
|
|
4
|
-
* The content file's YAML frontmatter is largely free-form: only `name` is
|
|
5
|
-
* required and validated. `agentOverrides`, when present, is recognized for
|
|
6
|
-
* use in per-agent rendering. Any other frontmatter keys flow through
|
|
7
|
-
* verbatim to the agent-native file produced by the renderer.
|
|
8
|
-
*
|
|
9
|
-
* @experimental This API is unstable and may change without notice.
|
|
10
|
-
*/
|
|
11
|
-
import * as Data from "effect/Data";
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import * as Option from "effect/Option";
|
|
14
|
-
import * as Schema from "effect/Schema";
|
|
15
|
-
import { parseFrontmatterEffect } from "./frontmatter.js";
|
|
16
|
-
/**
|
|
17
|
-
* Typed failure produced while parsing a subagent content file. Application
|
|
18
|
-
* layers translate this into their own error vocabulary.
|
|
19
|
-
*
|
|
20
|
-
* @experimental This API is unstable and may change without notice.
|
|
21
|
-
*/
|
|
22
|
-
export class SubagentContentError extends Data.TaggedError("SubagentContentError") {
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Schema for the only required frontmatter field — `name`.
|
|
26
|
-
*
|
|
27
|
-
* Used to validate that `name` is present and a string. The full frontmatter
|
|
28
|
-
* map is preserved verbatim and surfaced as `frontmatter`.
|
|
29
|
-
*/
|
|
30
|
-
const NameOnlySchema = Schema.Struct({
|
|
31
|
-
name: Schema.String,
|
|
32
|
-
}).annotate({
|
|
33
|
-
identifier: "SubagentFrontmatterName",
|
|
34
|
-
description: "Required `name` field for subagent frontmatter.",
|
|
35
|
-
});
|
|
36
|
-
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37
|
-
const extractAgentOverrides = (fm) => {
|
|
38
|
-
const raw = fm["agentOverrides"];
|
|
39
|
-
if (!isPlainObject(raw))
|
|
40
|
-
return Option.none();
|
|
41
|
-
const out = {};
|
|
42
|
-
for (const [agentId, patch] of Object.entries(raw)) {
|
|
43
|
-
if (isPlainObject(patch))
|
|
44
|
-
out[agentId] = patch;
|
|
45
|
-
}
|
|
46
|
-
return Option.some(out);
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Parse a subagent content file into validated frontmatter and body.
|
|
50
|
-
*
|
|
51
|
-
* Validates only that frontmatter is present and that its `name` matches
|
|
52
|
-
* the expected name. All other keys are preserved verbatim.
|
|
53
|
-
*
|
|
54
|
-
* @experimental This API is unstable and may change without notice.
|
|
55
|
-
*/
|
|
56
|
-
export const parseSubagentMd = (content, expectedName) => Effect.gen(function* () {
|
|
57
|
-
const parsed = yield* parseFrontmatterEffect(content).pipe(Effect.mapError((cause) => new SubagentContentError({
|
|
58
|
-
reason: "frontmatter-parse",
|
|
59
|
-
detail: "YAML frontmatter could not be parsed",
|
|
60
|
-
suggestion: "Ensure the frontmatter block contains valid YAML between --- delimiters.",
|
|
61
|
-
cause,
|
|
62
|
-
})));
|
|
63
|
-
if (parsed.frontmatter === undefined) {
|
|
64
|
-
return yield* new SubagentContentError({
|
|
65
|
-
reason: "missing-frontmatter",
|
|
66
|
-
detail: `Missing subagent frontmatter for "${expectedName}"`,
|
|
67
|
-
suggestion: `Add YAML frontmatter with name: ${expectedName}.`,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
yield* Effect.try({
|
|
71
|
-
try: () => Schema.decodeUnknownSync(NameOnlySchema)(parsed.frontmatter),
|
|
72
|
-
catch: (error) => new SubagentContentError({
|
|
73
|
-
reason: "invalid-frontmatter",
|
|
74
|
-
detail: "Invalid subagent frontmatter",
|
|
75
|
-
suggestion: "Frontmatter must include a string `name` field.",
|
|
76
|
-
cause: error,
|
|
77
|
-
}),
|
|
78
|
-
});
|
|
79
|
-
if (!isPlainObject(parsed.frontmatter)) {
|
|
80
|
-
return yield* new SubagentContentError({
|
|
81
|
-
reason: "invalid-frontmatter",
|
|
82
|
-
detail: "Subagent frontmatter must be a YAML mapping",
|
|
83
|
-
suggestion: `Add YAML frontmatter with name: ${expectedName}.`,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const fm = parsed.frontmatter;
|
|
87
|
-
const name = fm["name"];
|
|
88
|
-
if (name !== expectedName) {
|
|
89
|
-
return yield* new SubagentContentError({
|
|
90
|
-
reason: "name-mismatch",
|
|
91
|
-
detail: `Subagent frontmatter name "${String(name)}" does not match expected name "${expectedName}"`,
|
|
92
|
-
suggestion: `Set subagent.json name, frontmatter name, and filename to ${expectedName}.`,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
frontmatter: Option.some(fm),
|
|
97
|
-
agentOverrides: extractAgentOverrides(fm),
|
|
98
|
-
body: parsed.body,
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=subagent-content.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Area barrel for the package public surface.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
*/
|
|
6
|
-
export { KNOWLEDGE_SEARCH_TOKENIZER_PROFILE, type KnowledgeSearchClause, type KnowledgeSearchQuery, type KnowledgeSearchQueryParseResult, matchesKnowledgeSearchQuery, parseKnowledgeSearchQuery, tokenizeKnowledgeSearchText, } from "./knowledge-search.js";
|
|
7
|
-
export { KNOWLEDGE_DIAGNOSTIC_CODES, type KnowledgeActorRecord, type KnowledgeAuthoredLink, type KnowledgeBundleEntry, type KnowledgeConcept, type KnowledgeDiagnostic, type KnowledgeDiagnosticCode, type KnowledgeDocumentKind, type KnowledgeFrontmatterParseDetails, type KnowledgeInspection, type KnowledgeTrustTier, collectKnowledgeBundleEntries, inspectKnowledgeBundle, inspectKnowledgeEntries, openKnowledgeConcept, searchKnowledgeConcepts, } from "./okf.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Area barrel for the package public surface.
|
|
3
|
-
*
|
|
4
|
-
* @experimental This API is unstable and may change without notice.
|
|
5
|
-
*/
|
|
6
|
-
export { KNOWLEDGE_SEARCH_TOKENIZER_PROFILE, matchesKnowledgeSearchQuery, parseKnowledgeSearchQuery, tokenizeKnowledgeSearchText, } from "./knowledge-search.js";
|
|
7
|
-
export { KNOWLEDGE_DIAGNOSTIC_CODES, collectKnowledgeBundleEntries, inspectKnowledgeBundle, inspectKnowledgeEntries, openKnowledgeConcept, searchKnowledgeConcepts, } from "./okf.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { KnowledgeConcept } from "./okf.js";
|
|
2
|
-
export declare const KNOWLEDGE_SEARCH_TOKENIZER_PROFILE: {
|
|
3
|
-
readonly id: "axm-knowledge-lexical-v1";
|
|
4
|
-
readonly unicodeNormalization: "NFKC";
|
|
5
|
-
readonly caseNormalization: "unicode-case-fold";
|
|
6
|
-
readonly termBoundary: "unicode-whitespace-punctuation-camel-code";
|
|
7
|
-
readonly stemming: false;
|
|
8
|
-
};
|
|
9
|
-
export type KnowledgeSearchClause = {
|
|
10
|
-
readonly kind: "term";
|
|
11
|
-
readonly token: string;
|
|
12
|
-
} | {
|
|
13
|
-
readonly kind: "phrase";
|
|
14
|
-
readonly tokens: ReadonlyArray<string>;
|
|
15
|
-
} | {
|
|
16
|
-
readonly kind: "literal";
|
|
17
|
-
readonly value: string;
|
|
18
|
-
};
|
|
19
|
-
export interface KnowledgeSearchQuery {
|
|
20
|
-
readonly clauses: ReadonlyArray<KnowledgeSearchClause>;
|
|
21
|
-
}
|
|
22
|
-
export type KnowledgeSearchQueryParseResult = {
|
|
23
|
-
readonly ok: true;
|
|
24
|
-
readonly query: KnowledgeSearchQuery;
|
|
25
|
-
} | {
|
|
26
|
-
readonly ok: false;
|
|
27
|
-
readonly detail: string;
|
|
28
|
-
};
|
|
29
|
-
export declare const tokenizeKnowledgeSearchText: (value: string) => ReadonlyArray<string>;
|
|
30
|
-
export declare const parseKnowledgeSearchQuery: (input: string) => KnowledgeSearchQueryParseResult;
|
|
31
|
-
export declare const matchesKnowledgeSearchQuery: (concept: KnowledgeConcept, query: KnowledgeSearchQuery) => boolean;
|
|
32
|
-
//# sourceMappingURL=knowledge-search.d.ts.map
|