(raw: CodexAppSkillMetadata)
| 2881 | } |
| 2882 | |
| 2883 | function mapSkillMetadata(raw: CodexAppSkillMetadata): ProviderSkillInfo | null { |
| 2884 | const name = normalizeNullableString(raw?.name); |
| 2885 | const description = normalizeNullableString(raw?.description); |
| 2886 | const skillPath = normalizeNullableString(raw?.path); |
| 2887 | const scope = normalizeNullableString(raw?.scope); |
| 2888 | if (!name || !description || !skillPath || !scope) { |
| 2889 | return null; |
| 2890 | } |
| 2891 | const dependencies = Array.isArray(raw?.dependencies?.tools) |
| 2892 | ? raw.dependencies.tools.map(mapSkillToolDependency).filter(Boolean) |
| 2893 | : []; |
| 2894 | return { |
| 2895 | name, |
| 2896 | description, |
| 2897 | enabled: raw?.enabled !== false, |
| 2898 | path: skillPath, |
| 2899 | scope, |
| 2900 | shortDescription: normalizeNullableString(raw?.interface?.shortDescription) |
| 2901 | ?? normalizeNullableString(raw?.shortDescription), |
| 2902 | displayName: normalizeNullableString(raw?.interface?.displayName), |
| 2903 | defaultPrompt: normalizeNullableString(raw?.interface?.defaultPrompt), |
| 2904 | brandColor: normalizeNullableString(raw?.interface?.brandColor), |
| 2905 | dependencies, |
| 2906 | }; |
| 2907 | } |
| 2908 | |
| 2909 | function mapSkillErrorInfo(raw: CodexAppSkillErrorInfo): ProviderSkillError | null { |
| 2910 | const skillPath = normalizeNullableString(raw?.path); |
nothing calls this directly
no test coverage detected