| 897 | } |
| 898 | |
| 899 | function deepCloneConfig(config: PluginConfig): PluginConfig { |
| 900 | return { |
| 901 | ...config, |
| 902 | commands: { |
| 903 | enabled: config.commands.enabled, |
| 904 | protectedTools: [...config.commands.protectedTools], |
| 905 | }, |
| 906 | manualMode: { |
| 907 | enabled: config.manualMode.enabled, |
| 908 | automaticStrategies: config.manualMode.automaticStrategies, |
| 909 | }, |
| 910 | turnProtection: { ...config.turnProtection }, |
| 911 | experimental: { ...config.experimental }, |
| 912 | protectedFilePatterns: [...config.protectedFilePatterns], |
| 913 | compress: { |
| 914 | ...config.compress, |
| 915 | modelMaxLimits: { ...config.compress.modelMaxLimits }, |
| 916 | modelMinLimits: { ...config.compress.modelMinLimits }, |
| 917 | protectedTools: [...config.compress.protectedTools], |
| 918 | }, |
| 919 | strategies: { |
| 920 | deduplication: { |
| 921 | ...config.strategies.deduplication, |
| 922 | protectedTools: [...config.strategies.deduplication.protectedTools], |
| 923 | }, |
| 924 | purgeErrors: { |
| 925 | ...config.strategies.purgeErrors, |
| 926 | protectedTools: [...config.strategies.purgeErrors.protectedTools], |
| 927 | }, |
| 928 | }, |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | function mergeLayer(config: PluginConfig, data: Record<string, any>): PluginConfig { |
| 933 | return { |