MCPcopy Create free account
hub / github.com/Noumena-Network/code / skillHasOnlySafeProperties

Function skillHasOnlySafeProperties

src/tools/SkillTool/SkillTool.ts:911–934  ·  view source on GitHub ↗
(command: Command)

Source from the content-addressed store, hash-verified

909])
910
911function skillHasOnlySafeProperties(command: Command): boolean {
912 for (const key of Object.keys(command)) {
913 if (SAFE_SKILL_PROPERTIES.has(key)) {
914 continue
915 }
916 // Property not in safe allowlist - check if it has a meaningful value
917 const value = (command as Record<string, unknown>)[key]
918 if (value === undefined || value === null) {
919 continue
920 }
921 if (Array.isArray(value) && value.length === 0) {
922 continue
923 }
924 if (
925 typeof value === 'object' &&
926 !Array.isArray(value) &&
927 Object.keys(value).length === 0
928 ) {
929 continue
930 }
931 return false
932 }
933 return true
934}
935
936function isOfficialMarketplaceSkill(command: PromptCommand): boolean {
937 if (command.source !== 'plugin' || !command.pluginInfo?.repository) {

Callers 1

checkPermissionsFunction · 0.85

Calls 2

keysMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected