Skip to content

Commit 6064fbb

Browse files
committed
chore: tighten skill manifest validation
1 parent 748d6e6 commit 6064fbb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/skills/schema.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ export const validateSkillManifest = (value: unknown): ValidationResult => {
5050
errors.push("Missing or invalid entry.");
5151
}
5252

53-
if (
54-
!Array.isArray(record.assets) ||
55-
record.assets.some((item) => !isNonEmptyString(item))
56-
) {
57-
errors.push("Missing or invalid assets (expected an array of strings).");
53+
if (!Array.isArray(record.assets)) {
54+
errors.push("Missing assets (expected an array of strings).");
55+
} else if (record.assets.length === 0) {
56+
errors.push("Assets must include at least one file.");
57+
} else if (record.assets.some((item) => !isNonEmptyString(item))) {
58+
errors.push("Assets must be non-empty strings.");
5859
}
5960

6061
if (!isRecord(record.defaults)) {

0 commit comments

Comments
 (0)