MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / mapSkillMetadata

Function mapSkillMetadata

packages/codex-native-api/src/codex_app_client.ts:2883–2907  ·  view source on GitHub ↗
(raw: CodexAppSkillMetadata)

Source from the content-addressed store, hash-verified

2881}
2882
2883function 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
2909function mapSkillErrorInfo(raw: CodexAppSkillErrorInfo): ProviderSkillError | null {
2910 const skillPath = normalizeNullableString(raw?.path);

Callers

nothing calls this directly

Calls 1

normalizeNullableStringFunction · 0.70

Tested by

no test coverage detected