()
| 766 | } |
| 767 | |
| 768 | function createDefaultConfig(): void { |
| 769 | if (!existsSync(GLOBAL_CONFIG_DIR)) { |
| 770 | mkdirSync(GLOBAL_CONFIG_DIR, { recursive: true }) |
| 771 | } |
| 772 | |
| 773 | const configContent = `{ |
| 774 | "$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json" |
| 775 | } |
| 776 | ` |
| 777 | writeFileSync(GLOBAL_CONFIG_PATH_JSONC, configContent, "utf-8") |
| 778 | } |
| 779 | |
| 780 | interface ConfigLoadResult { |
| 781 | data: Record<string, any> | null |