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