@vibe-agent-toolkit/agent-skills 0.1.38 → 0.1.39-rc.2
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/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/inventory/detectors/declared-but-missing.d.ts +1 -1
- package/dist/inventory/detectors/declared-but-missing.d.ts.map +1 -1
- package/dist/inventory/detectors/declared-but-missing.js.map +1 -1
- package/dist/inventory/detectors/marketplace-source-missing.d.ts +1 -1
- package/dist/inventory/detectors/marketplace-source-missing.d.ts.map +1 -1
- package/dist/inventory/detectors/marketplace-source-missing.js.map +1 -1
- package/dist/inventory/detectors/present-but-undeclared.d.ts +1 -1
- package/dist/inventory/detectors/present-but-undeclared.d.ts.map +1 -1
- package/dist/inventory/detectors/present-but-undeclared.js.map +1 -1
- package/dist/inventory/detectors/reference-target-missing.d.ts +1 -1
- package/dist/inventory/detectors/reference-target-missing.d.ts.map +1 -1
- package/dist/inventory/detectors/reference-target-missing.js.map +1 -1
- package/dist/post-build-checks.d.ts +6 -6
- package/dist/post-build-checks.d.ts.map +1 -1
- package/dist/post-build-checks.js +105 -54
- package/dist/post-build-checks.js.map +1 -1
- package/dist/skill-packager.d.ts +1 -2
- package/dist/skill-packager.d.ts.map +1 -1
- package/dist/skill-packager.js +28 -8
- package/dist/skill-packager.js.map +1 -1
- package/dist/validators/bundled-resource-link-detection.d.ts +1 -1
- package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
- package/dist/validators/bundled-resource-link-detection.js +1 -1
- package/dist/validators/bundled-resource-link-detection.js.map +1 -1
- package/dist/validators/compat-detectors.d.ts +1 -1
- package/dist/validators/compat-detectors.d.ts.map +1 -1
- package/dist/validators/compat-detectors.js +1 -1
- package/dist/validators/compat-detectors.js.map +1 -1
- package/dist/validators/cross-skill-dependency-detection.d.ts +1 -1
- package/dist/validators/cross-skill-dependency-detection.d.ts.map +1 -1
- package/dist/validators/cross-skill-dependency-detection.js +1 -1
- package/dist/validators/cross-skill-dependency-detection.js.map +1 -1
- package/dist/validators/description-style-detection.d.ts +1 -1
- package/dist/validators/description-style-detection.d.ts.map +1 -1
- package/dist/validators/description-style-detection.js +1 -1
- package/dist/validators/description-style-detection.js.map +1 -1
- package/dist/validators/frontmatter-validation.d.ts +1 -1
- package/dist/validators/frontmatter-validation.d.ts.map +1 -1
- package/dist/validators/frontmatter-validation.js +1 -1
- package/dist/validators/frontmatter-validation.js.map +1 -1
- package/dist/validators/imperative-body-detection.d.ts +1 -1
- package/dist/validators/imperative-body-detection.d.ts.map +1 -1
- package/dist/validators/imperative-body-detection.js +1 -1
- package/dist/validators/imperative-body-detection.js.map +1 -1
- package/dist/validators/index.d.ts +2 -1
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/kebab-case-detection.d.ts +1 -1
- package/dist/validators/kebab-case-detection.d.ts.map +1 -1
- package/dist/validators/kebab-case-detection.js +1 -1
- package/dist/validators/kebab-case-detection.js.map +1 -1
- package/dist/validators/marketplace-validator.d.ts.map +1 -1
- package/dist/validators/marketplace-validator.js.map +1 -1
- package/dist/validators/packaging-validator.d.ts +1 -3
- package/dist/validators/packaging-validator.d.ts.map +1 -1
- package/dist/validators/packaging-validator.js +20 -7
- package/dist/validators/packaging-validator.js.map +1 -1
- package/dist/validators/plugin-recommended-fields.d.ts +1 -1
- package/dist/validators/plugin-recommended-fields.d.ts.map +1 -1
- package/dist/validators/plugin-recommended-fields.js +1 -1
- package/dist/validators/plugin-recommended-fields.js.map +1 -1
- package/dist/validators/registry-validator.d.ts.map +1 -1
- package/dist/validators/registry-validator.js.map +1 -1
- package/dist/validators/skill-validator.d.ts.map +1 -1
- package/dist/validators/skill-validator.js +4 -3
- package/dist/validators/skill-validator.js.map +1 -1
- package/dist/validators/types.d.ts +1 -20
- package/dist/validators/types.d.ts.map +1 -1
- package/dist/validators/validation-rules.d.ts +1 -1
- package/dist/validators/validation-rules.d.ts.map +1 -1
- package/dist/validators/validation-rules.js +2 -2
- package/dist/validators/validation-rules.js.map +1 -1
- package/dist/validators/validation-utils.d.ts +1 -1
- package/dist/validators/validation-utils.d.ts.map +1 -1
- package/dist/validators/validation-utils.js.map +1 -1
- package/dist/validators/walker-to-issues.d.ts +1 -1
- package/dist/validators/walker-to-issues.d.ts.map +1 -1
- package/dist/validators/walker-to-issues.js +7 -2
- package/dist/validators/walker-to-issues.js.map +1 -1
- package/dist/walk-link-graph.d.ts.map +1 -1
- package/dist/walk-link-graph.js +2 -1
- package/dist/walk-link-graph.js.map +1 -1
- package/package.json +6 -5
- package/dist/validators/allow-filter.d.ts +0 -37
- package/dist/validators/allow-filter.d.ts.map +0 -1
- package/dist/validators/allow-filter.js +0 -86
- package/dist/validators/allow-filter.js.map +0 -1
- package/dist/validators/code-registry.d.ts +0 -23
- package/dist/validators/code-registry.d.ts.map +0 -1
- package/dist/validators/code-registry.js +0 -58
- package/dist/validators/code-registry.js.map +0 -1
- package/dist/validators/severity-resolver.d.ts +0 -6
- package/dist/validators/severity-resolver.d.ts.map +0 -1
- package/dist/validators/severity-resolver.js +0 -9
- package/dist/validators/severity-resolver.js.map +0 -1
- package/dist/validators/validation-framework.d.ts +0 -21
- package/dist/validators/validation-framework.d.ts.map +0 -1
- package/dist/validators/validation-framework.js +0 -67
- package/dist/validators/validation-framework.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,16 +14,14 @@ export { parseFrontmatter, type FrontmatterResult, } from './parsers/frontmatter
|
|
|
14
14
|
export { calculateValidationStatus, generateFixSuggestion } from './validators/validation-utils.js';
|
|
15
15
|
export { detectKebabCaseViolation, type KebabCaseSurface } from './validators/kebab-case-detection.js';
|
|
16
16
|
export { detectMissingRecommendedFields } from './validators/plugin-recommended-fields.js';
|
|
17
|
-
export { observationToIssue, runCompatDetectors, type DetectorOutput, } from './validators/compat-detectors.js';
|
|
18
|
-
export { CODE_REGISTRY, type CodeRegistryEntry } from './validators/code-registry.js';
|
|
17
|
+
export { deriveObservations, observationToIssue, runCompatDetectors, type DetectorOutput, } from './validators/compat-detectors.js';
|
|
19
18
|
export { validateMarketplace } from './validators/marketplace-validator.js';
|
|
20
19
|
export { validateSkill } from './validators/skill-validator.js';
|
|
21
20
|
export { validate, type UnifiedValidateOptions } from './validators/unified-validator.js';
|
|
22
21
|
export { detectResourceFormat, enumerateSurfaces } from './validators/format-detection.js';
|
|
23
22
|
export { crawlAndResolveRegistry, validateSkillForPackaging, type ExcludedReferenceDetail, type PackagingValidationResult, type SkillPackagingConfig, type SkillValidationSharedContext, } from './validators/packaging-validator.js';
|
|
24
|
-
export { type ValidationConfig } from './validators/validation-framework.js';
|
|
25
23
|
export { createIssue, NAVIGATION_FILE_PATTERNS, VALIDATION_RULES, VALIDATION_THRESHOLDS, type RuleCategory, type ValidationRule, type ValidationRuleCode, } from './validators/validation-rules.js';
|
|
26
|
-
export type { ValidationResult,
|
|
24
|
+
export type { ValidationResult, ValidateOptions, ResourceFormat, Surface, } from './validators/types.js';
|
|
27
25
|
export { importSkillToAgent, type ImportOptions, type ImportResult, } from './import.js';
|
|
28
26
|
export type { EvidenceRecord, EvidenceSource, EvidenceConfidence, EvidenceLocation, PatternDefinition, Observation, } from './evidence/index.js';
|
|
29
27
|
export { PATTERN_REGISTRY, getPatternDefinition, assertPatternRegistered, deriveObservationsFromEvidence, } from './evidence/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc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B,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,oCAAoC,EACpC,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,7 @@ export { parseFrontmatter, } from './parsers/frontmatter-parser.js';
|
|
|
14
14
|
export { calculateValidationStatus, generateFixSuggestion } from './validators/validation-utils.js';
|
|
15
15
|
export { detectKebabCaseViolation } from './validators/kebab-case-detection.js';
|
|
16
16
|
export { detectMissingRecommendedFields } from './validators/plugin-recommended-fields.js';
|
|
17
|
-
export { observationToIssue, runCompatDetectors, } from './validators/compat-detectors.js';
|
|
18
|
-
export { CODE_REGISTRY } from './validators/code-registry.js';
|
|
17
|
+
export { deriveObservations, observationToIssue, runCompatDetectors, } from './validators/compat-detectors.js';
|
|
19
18
|
export { validateMarketplace } from './validators/marketplace-validator.js';
|
|
20
19
|
export { validateSkill } from './validators/skill-validator.js';
|
|
21
20
|
export { validate } from './validators/unified-validator.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAuC,MAAM,cAAc,CAAC;AAEpF,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,iBAAiB,GAMlB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,GAMd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,eAAe,EACf,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,GAG/B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,yBAAyB,EAA4B,MAAM,mCAA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2C,CAAC;AAC3F,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAA+B,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAK1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GAItB,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EACL,kBAAkB,GAGnB,MAAM,aAAa,CAAC;AAWrB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAoB7B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,oCAAoC,EACpC,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ValidationIssue for each declared component path that does not exist on
|
|
6
6
|
* disk. Covers all seven component fields in the manifest.
|
|
7
7
|
*/
|
|
8
|
-
import type { ValidationIssue } from '
|
|
8
|
+
import type { ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
9
9
|
import type { PluginInventory } from '../types.js';
|
|
10
10
|
export declare function detectDeclaredButMissing(inv: PluginInventory): ValidationIssue[];
|
|
11
11
|
//# sourceMappingURL=declared-but-missing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-but-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/declared-but-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"declared-but-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/declared-but-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAanD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,EAAE,CAkBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-but-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/declared-but-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"declared-but-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/declared-but-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,MAAM,GAAqB;IAChC,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,cAAc;IACd,YAAY;CACZ,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,GAAoB;IAC5D,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;oBACX,QAAQ,EAAE,SAAS;oBACnB,IAAI,EAAE,gCAAgC;oBACtC,OAAO,EAAE,qBAAqB,KAAK,MAAM,GAAG,CAAC,YAAY,wCAAwC;oBACjG,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,6BAA6B;oBAClD,GAAG,EAAE,oEAAoE;iBACzE,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* path does not exist on disk. Git/npm/unknown source types are out of scope
|
|
7
7
|
* and are silently skipped.
|
|
8
8
|
*/
|
|
9
|
-
import type { ValidationIssue } from '
|
|
9
|
+
import type { ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
10
10
|
import type { MarketplaceInventory } from '../types.js';
|
|
11
11
|
export declare function detectMarketplacePluginSourceMissing(inv: MarketplaceInventory): ValidationIssue[];
|
|
12
12
|
//# sourceMappingURL=marketplace-source-missing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace-source-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/marketplace-source-missing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"marketplace-source-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/marketplace-source-missing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,oBAAoB,GAAG,eAAe,EAAE,CAUjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace-source-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/marketplace-source-missing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"marketplace-source-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/marketplace-source-missing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,UAAU,oCAAoC,CAAC,GAAyB;IAC7E,OAAO,GAAG,CAAC,QAAQ,CAAC,OAAO;SACzB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;SAC7C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACV,QAAQ,EAAE,OAAgB;QAC1B,IAAI,EAAE,mCAA4C;QAClD,OAAO,EAAE,4CAA4C,CAAC,CAAC,YAAY,gCAAgC;QACnG,QAAQ,EAAE,CAAC,CAAC,YAAY;QACxB,GAAG,EAAE,yEAAyE;KAC9E,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* declares an explicit list (including []) — omitting the field entirely
|
|
8
8
|
* means auto-discovery is intentional and this detector is silent.
|
|
9
9
|
*/
|
|
10
|
-
import type { ValidationIssue } from '
|
|
10
|
+
import type { ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
11
11
|
import type { PluginInventory } from '../types.js';
|
|
12
12
|
export declare function detectPresentButUndeclared(inv: PluginInventory): ValidationIssue[];
|
|
13
13
|
//# sourceMappingURL=present-but-undeclared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"present-but-undeclared.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/present-but-undeclared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"present-but-undeclared.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/present-but-undeclared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,aAAa,CAAC;AAEjE,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,EAAE,CAMlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"present-but-undeclared.js","sourceRoot":"","sources":["../../../src/inventory/detectors/present-but-undeclared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"present-but-undeclared.js","sourceRoot":"","sources":["../../../src/inventory/detectors/present-but-undeclared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,UAAU,0BAA0B,CAAC,GAAoB;IAC9D,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzB,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,GAAoB,EAAE,MAAyB;IACnE,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;IACrC,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,CAAC,6BAA6B;IAC5D,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAC3C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CACpB,KAA4B,EAC5B,UAA0B,EAC1B,QAA+B,EAC/B,MAAyB;IAEzB,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO;IAC9B,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,SAAS,CAAC,KAAa,EAAE,QAAgB;IACjD,OAAO;QACN,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,kCAAkC;QACxC,OAAO,EAAE,GAAG,KAAK,MAAM,QAAQ,sDAAsD,KAAK,sBAAsB;QAChH,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,OAAO,QAAQ,uBAAuB,KAAK,8BAA8B;KAC9E,CAAC;AACH,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ValidationIssue for each cross-component reference in the manifest that
|
|
6
6
|
* resolves to a path that does not exist on disk.
|
|
7
7
|
*/
|
|
8
|
-
import type { ValidationIssue } from '
|
|
8
|
+
import type { ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
9
9
|
import type { PluginInventory } from '../types.js';
|
|
10
10
|
export declare function detectReferenceTargetMissing(inv: PluginInventory): ValidationIssue[];
|
|
11
11
|
//# sourceMappingURL=reference-target-missing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-target-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/reference-target-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reference-target-missing.d.ts","sourceRoot":"","sources":["../../../src/inventory/detectors/reference-target-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,EAAE,CAUpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-target-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/reference-target-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"reference-target-missing.js","sourceRoot":"","sources":["../../../src/inventory/detectors/reference-target-missing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,UAAU,4BAA4B,CAAC,GAAoB;IAChE,OAAO,GAAG,CAAC,UAAU;SACnB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;SAC1B,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACZ,QAAQ,EAAE,OAAgB;QAC1B,IAAI,EAAE,0BAAmC;QACzC,OAAO,EAAE,gBAAgB,GAAG,CAAC,IAAI,iBAAiB,GAAG,CAAC,EAAE,yBAAyB;QACjF,QAAQ,EAAE,GAAG,CAAC,EAAE;QAChB,GAAG,EAAE,8DAA8D;KACnE,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
* Run after packageSkill() completes — all files are copied, all links rewritten.
|
|
5
5
|
* Detects unreferenced files and broken links in the packaged output.
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
8
8
|
/**
|
|
9
|
-
* Check that every file in the packaged output is referenced from some markdown file.
|
|
9
|
+
* Check that every file in the packaged output is referenced from some markdown or HTML file.
|
|
10
10
|
*
|
|
11
11
|
* Two-pass detection:
|
|
12
|
-
* 1. Walk
|
|
12
|
+
* 1. Walk formal link graph from SKILL.md (strict, transitive, covers .md and .html/.htm).
|
|
13
13
|
* 2. For files not covered by pass 1, check whether their output-relative path
|
|
14
|
-
* is mentioned anywhere in packaged
|
|
14
|
+
* is mentioned anywhere in packaged content files (markdown or HTML).
|
|
15
15
|
* Authors often document CLI scripts via invocation examples rather than
|
|
16
|
-
*
|
|
16
|
+
* formal links, and that counts as documented.
|
|
17
17
|
*/
|
|
18
18
|
export declare function checkUnreferencedFiles(outputDir: string): Promise<ValidationIssue[]>;
|
|
19
19
|
/**
|
|
20
|
-
* Check that every local file link in packaged markdown files resolves to a file
|
|
20
|
+
* Check that every local file link in packaged markdown and HTML files resolves to a file
|
|
21
21
|
* that exists in the packaged output.
|
|
22
22
|
*/
|
|
23
23
|
export declare function checkBrokenPackagedLinks(outputDir: string): Promise<ValidationIssue[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-build-checks.d.ts","sourceRoot":"","sources":["../src/post-build-checks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"post-build-checks.d.ts","sourceRoot":"","sources":["../src/post-build-checks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAsOvF;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA8B1F;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAe5F"}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Run after packageSkill() completes — all files are copied, all links rewritten.
|
|
5
5
|
* Detects unreferenced files and broken links in the packaged output.
|
|
6
6
|
*/
|
|
7
|
-
import { existsSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
8
8
|
import { readFile } from 'node:fs/promises';
|
|
9
9
|
import { dirname } from 'node:path';
|
|
10
|
+
import { CODE_REGISTRY } from '@vibe-agent-toolkit/agent-schema';
|
|
11
|
+
import { parseHtml } from '@vibe-agent-toolkit/resources';
|
|
10
12
|
import { safePath, toForwardSlash } from '@vibe-agent-toolkit/utils';
|
|
11
|
-
import { CODE_REGISTRY } from './validators/code-registry.js';
|
|
12
13
|
/**
|
|
13
14
|
* Regex matching markdown inline links: [text](href).
|
|
14
15
|
* Negated character classes [^\]\\] and [^)] are non-backtracking by design.
|
|
@@ -76,38 +77,103 @@ function extractLocalLinks(content) {
|
|
|
76
77
|
return links;
|
|
77
78
|
}
|
|
78
79
|
/**
|
|
79
|
-
*
|
|
80
|
+
* Extract local file hrefs from a content file — markdown or HTML.
|
|
81
|
+
*
|
|
82
|
+
* For markdown: regex-matches `[text](href)` links, skipping code blocks.
|
|
83
|
+
* For HTML/HTM: uses `parseHtml` (parse5-based) and returns `local_file` hrefs only.
|
|
84
|
+
* Fragments are stripped from all returned hrefs.
|
|
85
|
+
*/
|
|
86
|
+
async function extractLocalHrefs(filePath) {
|
|
87
|
+
if (filePath.endsWith('.html') || filePath.endsWith('.htm')) {
|
|
88
|
+
const result = await parseHtml(filePath);
|
|
89
|
+
return result.links
|
|
90
|
+
.filter(link => link.type === 'local_file')
|
|
91
|
+
.map(link => {
|
|
92
|
+
const [withoutFragment] = link.href.split('#');
|
|
93
|
+
return withoutFragment ?? '';
|
|
94
|
+
})
|
|
95
|
+
.filter(href => href.length > 0);
|
|
96
|
+
}
|
|
97
|
+
// Markdown: read content and regex-match
|
|
98
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- filePath from walkDir
|
|
99
|
+
const content = await readFile(filePath, 'utf-8');
|
|
100
|
+
return extractLocalLinks(content);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Check hrefs from a content file against allFileSet and return PACKAGED_BROKEN_LINK
|
|
104
|
+
* issues for any that don't resolve to a file in the packaged output.
|
|
105
|
+
*
|
|
106
|
+
* Shared by markdown and HTML broken-link checks to eliminate duplicate resolve/emit logic.
|
|
107
|
+
*/
|
|
108
|
+
function collectBrokenLinkIssues(sourceFile, hrefs, allFileSet, outputDir) {
|
|
109
|
+
const issues = [];
|
|
110
|
+
const relativeSourcePath = toForwardSlash(safePath.relative(outputDir, sourceFile));
|
|
111
|
+
for (const href of hrefs) {
|
|
112
|
+
const resolved = toForwardSlash(safePath.resolve(dirname(sourceFile), href));
|
|
113
|
+
if (!allFileSet.has(resolved)) {
|
|
114
|
+
// A navigational directory link (href ending in `/`, classified `local_directory`)
|
|
115
|
+
// is a valid target if the directory itself exists on disk — walkDir populates
|
|
116
|
+
// allFileSet with FILES only, so directory paths are never in the set.
|
|
117
|
+
// Note: a NO-SLASH link (`[Concepts](concepts)`, classified `local_file`) that
|
|
118
|
+
// happens to resolve to a directory is a different case — it matches the
|
|
119
|
+
// link-rewrite bundled-link rule (skill-packager.ts buildRewriteRules) and
|
|
120
|
+
// renders with an undefined `link.resource.*`. Fixing that is the
|
|
121
|
+
// link-rewrite engine's job, tracked under #129 (slice 3, built-path
|
|
122
|
+
// unification). The slash form (`concepts/`, `local_directory`) survives
|
|
123
|
+
// rewrite verbatim and is the realistic navigational case this guard covers.
|
|
124
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved is a normalized path from a validated output directory
|
|
125
|
+
const isExistingDirectory = statSync(resolved, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
126
|
+
if (isExistingDirectory) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
issues.push({
|
|
130
|
+
severity: CODE_REGISTRY.PACKAGED_BROKEN_LINK.defaultSeverity,
|
|
131
|
+
code: 'PACKAGED_BROKEN_LINK',
|
|
132
|
+
message: `Broken link in packaged output: ${href} (from ${relativeSourcePath})`,
|
|
133
|
+
location: relativeSourcePath,
|
|
134
|
+
fix: CODE_REGISTRY.PACKAGED_BROKEN_LINK.fix,
|
|
135
|
+
reference: CODE_REGISTRY.PACKAGED_BROKEN_LINK.reference,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return issues;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Walk the markdown and HTML link graph starting at SKILL.md and return the set of
|
|
80
143
|
* referenced file paths (normalized to forward slashes).
|
|
81
144
|
*
|
|
82
|
-
* SKILL.md itself is always included as the root.
|
|
145
|
+
* SKILL.md itself is always included as the root. Traversal follows `.md`, `.html`,
|
|
146
|
+
* and `.htm` links transitively so an HTML file referenced only by another HTML file
|
|
147
|
+
* is not reported as unreferenced.
|
|
83
148
|
*/
|
|
84
149
|
async function collectReferencedPaths(outputDir, allFileSet) {
|
|
85
150
|
const referenced = new Set();
|
|
86
151
|
const skillMdPath = safePath.join(outputDir, 'SKILL.md');
|
|
87
|
-
const
|
|
152
|
+
const fileQueue = [skillMdPath];
|
|
88
153
|
const visited = new Set();
|
|
89
154
|
// SKILL.md itself is the root — always referenced
|
|
90
155
|
referenced.add(toForwardSlash(skillMdPath));
|
|
91
|
-
while (
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
156
|
+
while (fileQueue.length > 0) {
|
|
157
|
+
const filePath = fileQueue.shift();
|
|
158
|
+
if (!filePath)
|
|
94
159
|
break;
|
|
95
|
-
const normalized = toForwardSlash(
|
|
160
|
+
const normalized = toForwardSlash(filePath);
|
|
96
161
|
if (visited.has(normalized))
|
|
97
162
|
continue;
|
|
98
163
|
visited.add(normalized);
|
|
99
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename --
|
|
100
|
-
if (!existsSync(
|
|
164
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- filePath from walkDir output
|
|
165
|
+
if (!existsSync(filePath))
|
|
101
166
|
continue;
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
for (const href of links) {
|
|
106
|
-
const resolved = toForwardSlash(safePath.resolve(dirname(mdFile), href));
|
|
167
|
+
const hrefs = await extractLocalHrefs(filePath);
|
|
168
|
+
for (const href of hrefs) {
|
|
169
|
+
const resolved = toForwardSlash(safePath.resolve(dirname(filePath), href));
|
|
107
170
|
referenced.add(resolved);
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
171
|
+
// Traverse .md, .html, and .htm files transitively
|
|
172
|
+
const isTraversable = (resolved.endsWith('.md') || resolved.endsWith('.html') || resolved.endsWith('.htm')) &&
|
|
173
|
+
allFileSet.has(resolved) &&
|
|
174
|
+
!visited.has(resolved);
|
|
175
|
+
if (isTraversable) {
|
|
176
|
+
fileQueue.push(resolved);
|
|
111
177
|
}
|
|
112
178
|
}
|
|
113
179
|
}
|
|
@@ -115,22 +181,22 @@ async function collectReferencedPaths(outputDir, allFileSet) {
|
|
|
115
181
|
}
|
|
116
182
|
/**
|
|
117
183
|
* Record packaged files whose output-relative path appears anywhere in any
|
|
118
|
-
* packaged markdown — inside code blocks
|
|
119
|
-
*
|
|
184
|
+
* packaged content file (markdown or HTML) — inside code blocks, inline code
|
|
185
|
+
* spans, or prose — as "documented" references.
|
|
120
186
|
*
|
|
121
187
|
* A file that a skill author chose to bundle but never documents is the real
|
|
122
188
|
* problem this check exists to catch; documentation by code-block invocation
|
|
123
189
|
* is still documentation. By contrast, `collectReferencedPaths` is intentionally
|
|
124
|
-
* strict (only
|
|
190
|
+
* strict (only formal link syntax) because it also walks the transitive link
|
|
125
191
|
* graph, which would be unbounded if we followed substring hits.
|
|
126
192
|
*/
|
|
127
|
-
async function addMentionReferences(outputDir, referenced, candidates,
|
|
128
|
-
if (candidates.length === 0 ||
|
|
193
|
+
async function addMentionReferences(outputDir, referenced, candidates, contentFiles) {
|
|
194
|
+
if (candidates.length === 0 || contentFiles.length === 0) {
|
|
129
195
|
return;
|
|
130
196
|
}
|
|
131
197
|
const contents = await Promise.all(
|
|
132
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename --
|
|
133
|
-
|
|
198
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- contentFile from walkDir
|
|
199
|
+
contentFiles.map(f => readFile(f, 'utf-8')));
|
|
134
200
|
const haystack = contents.join('\n');
|
|
135
201
|
for (const candidate of candidates) {
|
|
136
202
|
const relativePath = toForwardSlash(safePath.relative(outputDir, candidate));
|
|
@@ -140,23 +206,23 @@ async function addMentionReferences(outputDir, referenced, candidates, mdFiles)
|
|
|
140
206
|
}
|
|
141
207
|
}
|
|
142
208
|
/**
|
|
143
|
-
* Check that every file in the packaged output is referenced from some markdown file.
|
|
209
|
+
* Check that every file in the packaged output is referenced from some markdown or HTML file.
|
|
144
210
|
*
|
|
145
211
|
* Two-pass detection:
|
|
146
|
-
* 1. Walk
|
|
212
|
+
* 1. Walk formal link graph from SKILL.md (strict, transitive, covers .md and .html/.htm).
|
|
147
213
|
* 2. For files not covered by pass 1, check whether their output-relative path
|
|
148
|
-
* is mentioned anywhere in packaged
|
|
214
|
+
* is mentioned anywhere in packaged content files (markdown or HTML).
|
|
149
215
|
* Authors often document CLI scripts via invocation examples rather than
|
|
150
|
-
*
|
|
216
|
+
* formal links, and that counts as documented.
|
|
151
217
|
*/
|
|
152
218
|
export async function checkUnreferencedFiles(outputDir) {
|
|
153
219
|
const allFiles = walkDir(outputDir);
|
|
154
220
|
const allFileSet = new Set(allFiles.map(f => toForwardSlash(f)));
|
|
155
221
|
const referenced = await collectReferencedPaths(outputDir, allFileSet);
|
|
156
|
-
// Second pass: treat any path mention in packaged
|
|
222
|
+
// Second pass: treat any path mention in packaged content files as documentation.
|
|
157
223
|
const candidates = allFiles.filter(f => !referenced.has(toForwardSlash(f)));
|
|
158
|
-
const
|
|
159
|
-
await addMentionReferences(outputDir, referenced, candidates,
|
|
224
|
+
const contentFiles = allFiles.filter(f => f.endsWith('.md') || f.endsWith('.html') || f.endsWith('.htm'));
|
|
225
|
+
await addMentionReferences(outputDir, referenced, candidates, contentFiles);
|
|
160
226
|
// Find unreferenced files
|
|
161
227
|
const issues = [];
|
|
162
228
|
for (const file of allFiles) {
|
|
@@ -166,7 +232,7 @@ export async function checkUnreferencedFiles(outputDir) {
|
|
|
166
232
|
issues.push({
|
|
167
233
|
severity: CODE_REGISTRY.PACKAGED_UNREFERENCED_FILE.defaultSeverity,
|
|
168
234
|
code: 'PACKAGED_UNREFERENCED_FILE',
|
|
169
|
-
message: `Packaged file not referenced from any markdown: ${relativePath}`,
|
|
235
|
+
message: `Packaged file not referenced from any content file (markdown or HTML): ${relativePath}`,
|
|
170
236
|
location: relativePath,
|
|
171
237
|
fix: CODE_REGISTRY.PACKAGED_UNREFERENCED_FILE.fix,
|
|
172
238
|
reference: CODE_REGISTRY.PACKAGED_UNREFERENCED_FILE.reference,
|
|
@@ -176,32 +242,17 @@ export async function checkUnreferencedFiles(outputDir) {
|
|
|
176
242
|
return issues;
|
|
177
243
|
}
|
|
178
244
|
/**
|
|
179
|
-
* Check that every local file link in packaged markdown files resolves to a file
|
|
245
|
+
* Check that every local file link in packaged markdown and HTML files resolves to a file
|
|
180
246
|
* that exists in the packaged output.
|
|
181
247
|
*/
|
|
182
248
|
export async function checkBrokenPackagedLinks(outputDir) {
|
|
183
249
|
const allFiles = walkDir(outputDir);
|
|
184
|
-
const
|
|
250
|
+
const linkableFiles = allFiles.filter(f => f.endsWith('.md') || f.endsWith('.html') || f.endsWith('.htm'));
|
|
185
251
|
const allFileSet = new Set(allFiles.map(f => toForwardSlash(f)));
|
|
186
252
|
const issues = [];
|
|
187
|
-
for (const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const links = extractLocalLinks(content);
|
|
191
|
-
const relativeMdPath = toForwardSlash(safePath.relative(outputDir, mdFile));
|
|
192
|
-
for (const href of links) {
|
|
193
|
-
const resolved = toForwardSlash(safePath.resolve(dirname(mdFile), href));
|
|
194
|
-
if (!allFileSet.has(resolved)) {
|
|
195
|
-
issues.push({
|
|
196
|
-
severity: CODE_REGISTRY.PACKAGED_BROKEN_LINK.defaultSeverity,
|
|
197
|
-
code: 'PACKAGED_BROKEN_LINK',
|
|
198
|
-
message: `Broken link in packaged output: ${href} (from ${relativeMdPath})`,
|
|
199
|
-
location: relativeMdPath,
|
|
200
|
-
fix: CODE_REGISTRY.PACKAGED_BROKEN_LINK.fix,
|
|
201
|
-
reference: CODE_REGISTRY.PACKAGED_BROKEN_LINK.reference,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
253
|
+
for (const sourceFile of linkableFiles) {
|
|
254
|
+
const hrefs = await extractLocalHrefs(sourceFile);
|
|
255
|
+
issues.push(...collectBrokenLinkIssues(sourceFile, hrefs, allFileSet, outputDir));
|
|
205
256
|
}
|
|
206
257
|
return issues;
|
|
207
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-build-checks.js","sourceRoot":"","sources":["../src/post-build-checks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"post-build-checks.js","sourceRoot":"","sources":["../src/post-build-checks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAwB,MAAM,k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S;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,SAAiB;IAC9D,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACxC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC/D,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjE,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/skill-packager.d.ts
CHANGED
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
* Uses ResourceRegistry + transformContent() from @vibe-agent-toolkit/resources
|
|
15
15
|
* for link resolution and rewriting (replacing the previous inline regex approach).
|
|
16
16
|
*/
|
|
17
|
+
import { type ValidationConfig, type ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
17
18
|
import { ResourceRegistry } from '@vibe-agent-toolkit/resources';
|
|
18
19
|
import { type GitTracker } from '@vibe-agent-toolkit/utils';
|
|
19
20
|
import type { SkillFileEntry } from './files-config.js';
|
|
20
21
|
import { type PackagingValidationResult } from './validators/packaging-validator.js';
|
|
21
|
-
import type { ValidationIssue } from './validators/types.js';
|
|
22
|
-
import { type ValidationConfig } from './validators/validation-framework.js';
|
|
23
22
|
/**
|
|
24
23
|
* Resource naming strategy type
|
|
25
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-packager.d.ts","sourceRoot":"","sources":["../src/skill-packager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"skill-packager.d.ts","sourceRoot":"","sources":["../src/skill-packager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAYjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAA6B,KAAK,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAShH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,aAAa,GAAG,eAAe,CAAC;AAElF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,YAAY,CAAC;AAK3D,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,aAAa,CAAC,EAAE,CAAC;IAE1D;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC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{ existsSync, readdirSync, statSync } from 'node:fs';
|
|
18
18
|
import { copyFile, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
19
19
|
import { basename, dirname } from 'node:path';
|
|
20
|
-
import {
|
|
20
|
+
import { runValidationFramework, } from '@vibe-agent-toolkit/agent-schema';
|
|
21
|
+
import { ResourceRegistry, loadConfig, openFrontmatter, resolveLocalHref, rewriteFrontmatterUriReferencesFromSchema, rewriteHtmlLinks, transformContent, parseMarkdown, } from '@vibe-agent-toolkit/resources';
|
|
21
22
|
import { findProjectRoot, resolveAssetReference, toForwardSlash, safePath, } from '@vibe-agent-toolkit/utils';
|
|
22
23
|
import { getTargetSubdir } from './content-type-routing.js';
|
|
23
24
|
import { checkBrokenPackagedLinks, checkUnreferencedFiles } from './post-build-checks.js';
|
|
24
25
|
import { validateSkillForPackaging } from './validators/packaging-validator.js';
|
|
25
|
-
import { runValidationFramework } from './validators/validation-framework.js';
|
|
26
26
|
import { walkerExclusionsToIssues } from './validators/walker-to-issues.js';
|
|
27
27
|
import { walkLinkGraph } from './walk-link-graph.js';
|
|
28
28
|
const PACKAGE_JSON_FILENAME = 'package.json';
|
|
@@ -213,6 +213,7 @@ export async function packageSkill(skillPath, options = {}) {
|
|
|
213
213
|
templateContext: { skill: { name: skillMetadata.name } },
|
|
214
214
|
collectionSchemas,
|
|
215
215
|
projectRoot,
|
|
216
|
+
warn: (message) => process.stderr.write(`warning: ${message}\n`),
|
|
216
217
|
});
|
|
217
218
|
// 12b. Copy files config entries that were not auto-discovered via link traversal.
|
|
218
219
|
await copyFilesConfigEntries(filesConfig, bundledFiles, projectRoot, outputPath);
|
|
@@ -616,8 +617,11 @@ async function copyAndRewriteFile(sourcePath, targetPath, ctx) {
|
|
|
616
617
|
// Ensure target directory exists
|
|
617
618
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- targetPath is constructed from validated paths
|
|
618
619
|
await mkdir(dirname(targetPath), { recursive: true });
|
|
619
|
-
|
|
620
|
-
|
|
620
|
+
const lower = sourcePath.toLowerCase();
|
|
621
|
+
const isMarkdown = lower.endsWith('.md');
|
|
622
|
+
const isHtml = lower.endsWith('.html') || lower.endsWith('.htm');
|
|
623
|
+
// Non-rewritable files or rewriting disabled: plain binary copy
|
|
624
|
+
if ((!isMarkdown && !isHtml) || !ctx.rewriteLinks) {
|
|
621
625
|
await copyFile(sourcePath, targetPath);
|
|
622
626
|
return;
|
|
623
627
|
}
|
|
@@ -627,11 +631,27 @@ async function copyAndRewriteFile(sourcePath, targetPath, ctx) {
|
|
|
627
631
|
// Look up the resource in the "from" registry
|
|
628
632
|
const resource = ctx.fromRegistry.getResource(safePath.resolve(sourcePath));
|
|
629
633
|
if (!resource) {
|
|
630
|
-
// Resource not in registry — write content as-is
|
|
634
|
+
// Resource not in registry — write content as-is. For HTML this is only
|
|
635
|
+
// reachable on an ID collision (e.g. page.html + page.md), where the asset
|
|
636
|
+
// is copied verbatim and its links are NOT rewritten (v1 limitation,
|
|
637
|
+
// mirrors the pre-existing asset-collision behavior).
|
|
638
|
+
ctx.warn(`Copied '${sourcePath}' verbatim without link rewriting: it is not in the resource registry ` +
|
|
639
|
+
`(typically an ID collision with a same-named markdown file). Source-relative links inside it are not rewritten.`);
|
|
631
640
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- targetPath is constructed from validated paths
|
|
632
641
|
await writeFile(targetPath, content, 'utf-8');
|
|
633
642
|
return;
|
|
634
643
|
}
|
|
644
|
+
// HTML: offset-splice link rewrite (no frontmatter, no template body rewrite).
|
|
645
|
+
if (isHtml) {
|
|
646
|
+
const rewriteHref = buildHrefRewriter(ctx.fromRegistry, ctx.toRegistry, sourcePath, targetPath, ctx.projectRoot);
|
|
647
|
+
const rewritten = rewriteHtmlLinks(content, rewriteHref, (info) => {
|
|
648
|
+
ctx.warn(`Could not rewrite <${info.tagName} ${info.attr}="${info.from}"> in '${sourcePath}' (${info.reason}); ` +
|
|
649
|
+
`the original value was kept.`);
|
|
650
|
+
});
|
|
651
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- targetPath is constructed from validated paths
|
|
652
|
+
await writeFile(targetPath, rewritten, 'utf-8');
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
635
655
|
// Parse once via FrontmatterEditor so comments survive any frontmatter
|
|
636
656
|
// rewrites. The body is held verbatim; we run it through transformContent
|
|
637
657
|
// for the existing rule/template body-link rewrite contract (unchanged).
|
|
@@ -649,7 +669,7 @@ async function copyAndRewriteFile(sourcePath, targetPath, ctx) {
|
|
|
649
669
|
// and body agree on target paths.
|
|
650
670
|
const matchingCollections = (resource.collections ?? []).filter((id) => ctx.collectionSchemas.has(id));
|
|
651
671
|
if (matchingCollections.length > 0) {
|
|
652
|
-
const rewriteHref =
|
|
672
|
+
const rewriteHref = buildHrefRewriter(ctx.fromRegistry, ctx.toRegistry, sourcePath, targetPath, ctx.projectRoot);
|
|
653
673
|
for (const collectionId of matchingCollections) {
|
|
654
674
|
const schema = ctx.collectionSchemas.get(collectionId);
|
|
655
675
|
if (schema) {
|
|
@@ -661,7 +681,7 @@ async function copyAndRewriteFile(sourcePath, targetPath, ctx) {
|
|
|
661
681
|
await writeFile(targetPath, editor.toString(), 'utf-8');
|
|
662
682
|
}
|
|
663
683
|
/**
|
|
664
|
-
* Build the per-href rewrite callback used for frontmatter URI-refs.
|
|
684
|
+
* Build the per-href rewrite callback used for frontmatter URI-refs and HTML attributes.
|
|
665
685
|
*
|
|
666
686
|
* Mirrors the body-rewrite path so frontmatter and body link rewriting agree
|
|
667
687
|
* on target paths:
|
|
@@ -676,7 +696,7 @@ async function copyAndRewriteFile(sourcePath, targetPath, ctx) {
|
|
|
676
696
|
*
|
|
677
697
|
* Returns the original href when no rewrite applies.
|
|
678
698
|
*/
|
|
679
|
-
function
|
|
699
|
+
function buildHrefRewriter(fromRegistry, toRegistry, sourcePath, targetPath, projectRoot) {
|
|
680
700
|
const targetDir = dirname(targetPath);
|
|
681
701
|
return (href) => {
|
|
682
702
|
const resolution = resolveLocalHref(href, sourcePath, projectRoot);
|