feat(coding-agent): refactored settings system with new singleton API and unified schema
- Replaced SettingsManager class with new Settings singleton providing synchronous get/set API and background persistence.
- Introduced settings-schema.ts as single source of truth for all configuration definitions with 100+ settings organized into logical groups.
- Migrated from method-based settings access (getTheme(), setTheme()) to path-based access using dot notation (settings.get('theme'), settings.set('theme', value)).
- Removed 2035-line settings-manager.ts file and replaced with modular settings.ts (693 lines) and settings-schema.ts (836 lines) for improved maintainability.
- Unified settings schema into single source of truth eliminating duplicate definitions across settings-defs.ts and settings-manager.ts.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it, vi } from "bun:test";
|
||||
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
|
||||
import * as pythonExecutor from "@oh-my-pi/pi-coding-agent/ipy/executor";
|
||||
import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools";
|
||||
import { PythonTool } from "@oh-my-pi/pi-coding-agent/tools/python";
|
||||
@@ -10,18 +11,12 @@ function createSession(cwd: string): ToolSession {
|
||||
hasUI: false,
|
||||
getSessionFile: () => "session-file",
|
||||
getSessionSpawns: () => "*",
|
||||
settings: {
|
||||
getImageAutoResize: () => true,
|
||||
getLspFormatOnWrite: () => true,
|
||||
getLspDiagnosticsOnWrite: () => true,
|
||||
getLspDiagnosticsOnEdit: () => false,
|
||||
getEditFuzzyMatch: () => true,
|
||||
getBashInterceptorEnabled: () => true,
|
||||
getBashInterceptorSimpleLsEnabled: () => true,
|
||||
getBashInterceptorRules: () => [],
|
||||
getPythonToolMode: () => "ipy-only",
|
||||
getPythonKernelMode: () => "per-call",
|
||||
},
|
||||
settings: Settings.isolated({
|
||||
"lsp.formatOnWrite": true,
|
||||
"bashInterceptor.enabled": true,
|
||||
"python.toolMode": "ipy-only",
|
||||
"python.kernelMode": "per-call",
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user