@agentxm/registry-protocol 0.28.12 → 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.
Files changed (131) hide show
  1. package/README.md +13 -5
  2. package/dist/src/unstable/publish/index.d.ts +1 -6
  3. package/dist/src/unstable/publish/index.js +1 -6
  4. package/dist/src/unstable/registry/discover-schema.d.ts +4 -4
  5. package/dist/src/unstable/registry/index.d.ts +1 -0
  6. package/dist/src/unstable/registry/index.js +1 -0
  7. package/dist/src/unstable/registry/version-selection.d.ts +22 -0
  8. package/dist/src/unstable/registry/version-selection.js +39 -0
  9. package/package.json +11 -192
  10. package/dist/src/unstable/content/agent-skills-standard.d.ts +0 -17
  11. package/dist/src/unstable/content/agent-skills-standard.js +0 -24
  12. package/dist/src/unstable/content/frontmatter.d.ts +0 -52
  13. package/dist/src/unstable/content/frontmatter.js +0 -115
  14. package/dist/src/unstable/content/index.d.ts +0 -11
  15. package/dist/src/unstable/content/index.js +0 -11
  16. package/dist/src/unstable/content/skill-content.d.ts +0 -43
  17. package/dist/src/unstable/content/skill-content.js +0 -184
  18. package/dist/src/unstable/content/skill-types.d.ts +0 -22
  19. package/dist/src/unstable/content/skill-types.js +0 -9
  20. package/dist/src/unstable/content/subagent-content.d.ts +0 -58
  21. package/dist/src/unstable/content/subagent-content.js +0 -101
  22. package/dist/src/unstable/knowledge/index.d.ts +0 -8
  23. package/dist/src/unstable/knowledge/index.js +0 -8
  24. package/dist/src/unstable/knowledge/knowledge-search.d.ts +0 -32
  25. package/dist/src/unstable/knowledge/knowledge-search.js +0 -147
  26. package/dist/src/unstable/knowledge/okf.d.ts +0 -86
  27. package/dist/src/unstable/knowledge/okf.js +0 -1090
  28. package/dist/src/unstable/lint/catalog/hook/decision-portability.d.ts +0 -4
  29. package/dist/src/unstable/lint/catalog/hook/decision-portability.js +0 -40
  30. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.d.ts +0 -4
  31. package/dist/src/unstable/lint/catalog/hook/entrypoint-exists.js +0 -39
  32. package/dist/src/unstable/lint/catalog/hook/envelope.d.ts +0 -6
  33. package/dist/src/unstable/lint/catalog/hook/envelope.js +0 -15
  34. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.d.ts +0 -4
  35. package/dist/src/unstable/lint/catalog/hook/matcher-raw-portability.js +0 -51
  36. package/dist/src/unstable/lint/catalog/hook.d.ts +0 -4
  37. package/dist/src/unstable/lint/catalog/hook.js +0 -15
  38. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.d.ts +0 -128
  39. package/dist/src/unstable/lint/catalog/knowledge/diagnostics.js +0 -78
  40. package/dist/src/unstable/lint/catalog/knowledge/envelope.d.ts +0 -6
  41. package/dist/src/unstable/lint/catalog/knowledge/envelope.js +0 -15
  42. package/dist/src/unstable/lint/catalog/knowledge.d.ts +0 -5
  43. package/dist/src/unstable/lint/catalog/knowledge.js +0 -9
  44. package/dist/src/unstable/lint/catalog/mcp-server/envelope.d.ts +0 -6
  45. package/dist/src/unstable/lint/catalog/mcp-server/envelope.js +0 -15
  46. package/dist/src/unstable/lint/catalog/mcp-server.d.ts +0 -4
  47. package/dist/src/unstable/lint/catalog/mcp-server.js +0 -4
  48. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +0 -28
  49. package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +0 -38
  50. package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +0 -17
  51. package/dist/src/unstable/lint/catalog/pack/manifest-present.js +0 -24
  52. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +0 -25
  53. package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +0 -33
  54. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +0 -51
  55. package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +0 -45
  56. package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +0 -60
  57. package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +0 -85
  58. package/dist/src/unstable/lint/catalog/pack.d.ts +0 -31
  59. package/dist/src/unstable/lint/catalog/pack.js +0 -36
  60. package/dist/src/unstable/lint/catalog/rule/envelope.d.ts +0 -6
  61. package/dist/src/unstable/lint/catalog/rule/envelope.js +0 -15
  62. package/dist/src/unstable/lint/catalog/rule.d.ts +0 -4
  63. package/dist/src/unstable/lint/catalog/rule.js +0 -4
  64. package/dist/src/unstable/lint/catalog/shared/envelope-rules.d.ts +0 -88
  65. package/dist/src/unstable/lint/catalog/shared/envelope-rules.js +0 -84
  66. package/dist/src/unstable/lint/catalog/shared/manifest-json.d.ts +0 -18
  67. package/dist/src/unstable/lint/catalog/shared/manifest-json.js +0 -28
  68. package/dist/src/unstable/lint/catalog/shared/manifest-present.d.ts +0 -25
  69. package/dist/src/unstable/lint/catalog/shared/manifest-present.js +0 -37
  70. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.d.ts +0 -70
  71. package/dist/src/unstable/lint/catalog/shared/recommended-packs-rules.js +0 -139
  72. package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +0 -57
  73. package/dist/src/unstable/lint/catalog/shared/schema-rule.js +0 -102
  74. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +0 -31
  75. package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +0 -148
  76. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.d.ts +0 -13
  77. package/dist/src/unstable/lint/catalog/skill/frontmatter-standard-valid.js +0 -61
  78. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +0 -26
  79. package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +0 -41
  80. package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +0 -23
  81. package/dist/src/unstable/lint/catalog/skill/manifest-present.js +0 -32
  82. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +0 -21
  83. package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +0 -36
  84. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.d.ts +0 -8
  85. package/dist/src/unstable/lint/catalog/skill/recommended-packs-valid.js +0 -12
  86. package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +0 -17
  87. package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +0 -37
  88. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.d.ts +0 -8
  89. package/dist/src/unstable/lint/catalog/skill/standalone-declaration-valid.js +0 -12
  90. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +0 -61
  91. package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +0 -55
  92. package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +0 -77
  93. package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +0 -135
  94. package/dist/src/unstable/lint/catalog/skill.d.ts +0 -38
  95. package/dist/src/unstable/lint/catalog/skill.js +0 -53
  96. package/dist/src/unstable/lint/catalog/subagent/envelope.d.ts +0 -6
  97. package/dist/src/unstable/lint/catalog/subagent/envelope.js +0 -15
  98. package/dist/src/unstable/lint/catalog/subagent.d.ts +0 -4
  99. package/dist/src/unstable/lint/catalog/subagent.js +0 -4
  100. package/dist/src/unstable/lint/catalog-metadata.d.ts +0 -125
  101. package/dist/src/unstable/lint/catalog-metadata.js +0 -642
  102. package/dist/src/unstable/lint/compose-path.d.ts +0 -28
  103. package/dist/src/unstable/lint/compose-path.js +0 -64
  104. package/dist/src/unstable/lint/config.d.ts +0 -77
  105. package/dist/src/unstable/lint/config.js +0 -99
  106. package/dist/src/unstable/lint/context.d.ts +0 -239
  107. package/dist/src/unstable/lint/context.js +0 -17
  108. package/dist/src/unstable/lint/describe-document.d.ts +0 -31
  109. package/dist/src/unstable/lint/describe-document.js +0 -50
  110. package/dist/src/unstable/lint/evaluate.d.ts +0 -47
  111. package/dist/src/unstable/lint/evaluate.js +0 -73
  112. package/dist/src/unstable/lint/issues-to-findings.d.ts +0 -35
  113. package/dist/src/unstable/lint/issues-to-findings.js +0 -149
  114. package/dist/src/unstable/lint/publish.d.ts +0 -49
  115. package/dist/src/unstable/lint/publish.js +0 -86
  116. package/dist/src/unstable/lint/rule.d.ts +0 -97
  117. package/dist/src/unstable/lint/rule.js +0 -17
  118. package/dist/src/unstable/publish/archive-guardrails.d.ts +0 -39
  119. package/dist/src/unstable/publish/archive-guardrails.js +0 -250
  120. package/dist/src/unstable/publish/filtered-package-validation.d.ts +0 -24
  121. package/dist/src/unstable/publish/filtered-package-validation.js +0 -117
  122. package/dist/src/unstable/publish/ingest-limits.d.ts +0 -25
  123. package/dist/src/unstable/publish/ingest-limits.js +0 -41
  124. package/dist/src/unstable/publish/input-normalization.d.ts +0 -40
  125. package/dist/src/unstable/publish/input-normalization.js +0 -125
  126. package/dist/src/unstable/publish/manifest-policy.d.ts +0 -611
  127. package/dist/src/unstable/publish/manifest-policy.js +0 -196
  128. package/dist/src/unstable/publish/test-zip-helpers.d.ts +0 -13
  129. package/dist/src/unstable/publish/test-zip-helpers.js +0 -117
  130. package/dist/src/unstable/registry/release-age-policy.d.ts +0 -57
  131. package/dist/src/unstable/registry/release-age-policy.js +0 -117
@@ -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
@@ -1,147 +0,0 @@
1
- export const KNOWLEDGE_SEARCH_TOKENIZER_PROFILE = {
2
- id: "axm-knowledge-lexical-v1",
3
- unicodeNormalization: "NFKC",
4
- caseNormalization: "unicode-case-fold",
5
- termBoundary: "unicode-whitespace-punctuation-camel-code",
6
- stemming: false,
7
- };
8
- const normalizeTokenSource = (value) => value
9
- .normalize("NFKC")
10
- .replace(/([\p{Ll}\p{N}])(\p{Lu})/gu, "$1 $2")
11
- .replace(/(\p{Lu})(\p{Lu}\p{Ll})/gu, "$1 $2")
12
- .replace(/(\p{L})(\p{N})/gu, "$1 $2")
13
- .replace(/(\p{N})(\p{L})/gu, "$1 $2")
14
- // ECMAScript does not expose Unicode's CaseFolding.txt operation directly.
15
- // Upper-then-lower handles multi-character folds such as ß -> ss while
16
- // remaining deterministic and locale-independent.
17
- .toUpperCase()
18
- .toLowerCase();
19
- export const tokenizeKnowledgeSearchText = (value) => normalizeTokenSource(value).match(/[\p{L}\p{M}\p{N}]+/gu) ?? [];
20
- const normalizeLiteral = (value) => value.normalize("NFC").toLowerCase();
21
- const parseQuotedValue = (input, quoteIndex) => {
22
- let value = "";
23
- let escaped = false;
24
- for (let index = quoteIndex + 1; index < input.length; index += 1) {
25
- const character = input[index];
26
- if (character === undefined)
27
- break;
28
- if (escaped) {
29
- value += character;
30
- escaped = false;
31
- continue;
32
- }
33
- if (character === "\\") {
34
- escaped = true;
35
- continue;
36
- }
37
- if (character === '"') {
38
- return { ok: true, value, nextIndex: index + 1 };
39
- }
40
- value += character;
41
- }
42
- return { ok: false };
43
- };
44
- const addOrdinaryTerms = (clauses, value) => {
45
- for (const token of tokenizeKnowledgeSearchText(value)) {
46
- clauses.push({ kind: "term", token });
47
- }
48
- };
49
- const startsWithLiteralOperator = (input, index) => input.slice(index, index + "literal:".length).toLowerCase() === "literal:";
50
- export const parseKnowledgeSearchQuery = (input) => {
51
- const clauses = [];
52
- let index = 0;
53
- while (index < input.length) {
54
- if (/\s/u.test(input[index] ?? "")) {
55
- index += 1;
56
- continue;
57
- }
58
- if (startsWithLiteralOperator(input, index)) {
59
- index += "literal:".length;
60
- if (input[index] === '"') {
61
- const quoted = parseQuotedValue(input, index);
62
- if (!quoted.ok) {
63
- return { ok: false, detail: "Explicit literals must end with a closing quote." };
64
- }
65
- if (quoted.value.trim().length === 0) {
66
- return { ok: false, detail: "Explicit literals cannot be empty." };
67
- }
68
- clauses.push({ kind: "literal", value: normalizeLiteral(quoted.value) });
69
- index = quoted.nextIndex;
70
- continue;
71
- }
72
- const end = input.slice(index).search(/\s/u);
73
- const nextIndex = end === -1 ? input.length : index + end;
74
- const value = input.slice(index, nextIndex);
75
- if (value.length === 0) {
76
- return { ok: false, detail: "Explicit literals cannot be empty." };
77
- }
78
- clauses.push({ kind: "literal", value: normalizeLiteral(value) });
79
- index = nextIndex;
80
- continue;
81
- }
82
- if (input[index] === '"') {
83
- const quoted = parseQuotedValue(input, index);
84
- if (!quoted.ok) {
85
- return { ok: false, detail: "Quoted phrases must end with a closing quote." };
86
- }
87
- if (quoted.value.length === 0) {
88
- return { ok: false, detail: "Quoted phrases cannot be empty." };
89
- }
90
- const tokens = tokenizeKnowledgeSearchText(quoted.value);
91
- if (tokens.length === 0) {
92
- return {
93
- ok: false,
94
- detail: "Quoted phrases must contain at least one searchable token.",
95
- };
96
- }
97
- clauses.push({ kind: "phrase", tokens });
98
- index = quoted.nextIndex;
99
- continue;
100
- }
101
- let end = index;
102
- while (end < input.length && !/\s/u.test(input[end] ?? "") && input[end] !== '"') {
103
- end += 1;
104
- }
105
- addOrdinaryTerms(clauses, input.slice(index, end));
106
- index = end;
107
- }
108
- return clauses.length === 0
109
- ? { ok: false, detail: "Search query must contain at least one term, phrase, or literal." }
110
- : { ok: true, query: { clauses } };
111
- };
112
- const containsPhrase = (fieldTokens, phraseTokens) => {
113
- if (phraseTokens.length > fieldTokens.length)
114
- return false;
115
- const finalStart = fieldTokens.length - phraseTokens.length;
116
- for (let start = 0; start <= finalStart; start += 1) {
117
- if (phraseTokens.every((token, offset) => fieldTokens[start + offset] === token))
118
- return true;
119
- }
120
- return false;
121
- };
122
- const searchableFields = (concept) => [
123
- concept.id,
124
- concept.title,
125
- ...(concept.description === undefined ? [] : [concept.description]),
126
- ...(concept.tags ?? []),
127
- ...(concept.type === undefined ? [] : [concept.type]),
128
- concept.body,
129
- ];
130
- export const matchesKnowledgeSearchQuery = (concept, query) => {
131
- const fields = searchableFields(concept);
132
- const tokenFields = fields.map(tokenizeKnowledgeSearchText);
133
- const literalFields = fields.map(normalizeLiteral);
134
- return query.clauses.every((clause) => {
135
- switch (clause.kind) {
136
- case "term":
137
- return tokenFields.some((tokens) => tokens.includes(clause.token));
138
- case "phrase":
139
- return tokenFields.some((tokens) => containsPhrase(tokens, clause.tokens));
140
- case "literal":
141
- return literalFields.some((field) => field.includes(clause.value));
142
- default:
143
- return clause;
144
- }
145
- });
146
- };
147
- //# sourceMappingURL=knowledge-search.js.map