Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit b4f543f

Browse files
committed
fix: relax resource type validation to support plural forms
1 parent ff4a9ad commit b4f543f

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/services/SkillResourceResolver.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import { readSkillFile } from '../lib/SkillFs';
1212
* - return the content and mime type of the resource.
1313
*/
1414
export function createSkillResourceResolver(provider: SkillRegistry) {
15-
const resolveResourceMap = (skill: Skill, type: 'script' | 'asset' | 'reference') => {
16-
if (type === 'script') {
15+
const resolveResourceMap = (skill: Skill, type: string) => {
16+
if (type === 'script' || type === 'scripts') {
1717
return skill.scripts;
18-
} else if (type === 'asset') {
18+
} else if (type === 'asset' || type === 'assets') {
1919
return skill.assets;
20-
} else if (type === 'reference') {
20+
} else if (type === 'reference' || type === 'references') {
2121
return skill.references;
2222
} else {
2323
throw new Error(`Unknown resource type: ${type}`);
@@ -26,7 +26,7 @@ export function createSkillResourceResolver(provider: SkillRegistry) {
2626

2727
return async (args: {
2828
skill_name: string;
29-
type: 'script' | 'asset' | 'reference';
29+
type: string;
3030
relative_path: string;
3131
}): Promise<{
3232
absolute_path: string;

src/tools/SkillResourceReader.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import path from 'node:path';
3434
import { createSkillResourceResolver } from '../services/SkillResourceResolver';
35-
import { assertIsValidResourceType, SkillRegistry } from '../types';
35+
import { SkillRegistry } from '../types';
3636

3737
export function createSkillResourceReader(provider: SkillRegistry) {
3838
const skillResourceResolver = createSkillResourceResolver(provider);
@@ -42,8 +42,6 @@ export function createSkillResourceReader(provider: SkillRegistry) {
4242

4343
const [type, ...restPath] = args.relative_path.split('/');
4444

45-
assertIsValidResourceType(type);
46-
4745
const resource = await skillResourceResolver({
4846
skill_name: args.skill_name,
4947
type,

0 commit comments

Comments
 (0)