feat(coding-agent): converted capability loading and discovery providers to async APIs with caching fs layer

- Converted SettingsManager.create(), loadSettings(), discoverSkills(), loadSlashCommands(), buildSystemPrompt(), loadSkills(), loadProjectContextFiles(), and getShellConfig() from synchronous to asynchronous APIs.
- Changed capability provider load() method from supporting both sync and async to async-only by removing loadSync().
- Removed fs property from LoadContext interface in capability types.
- Added new fs.ts module with caching layer for filesystem operations using readFile, readDirEntries, readDir, walkUp, and cache management functions.
- Refactored all discovery providers (builtin, claude, cline, codex, cursor, gemini, github, mcp-json, ssh, vscode, windsurf) to use async file operations with Promise.all for parallel loading.
This commit is contained in:
can1357
2026-01-11 04:26:43 +01:00
parent 969eb8fc00
commit e6d33e0a48
53 changed files with 1720 additions and 1853 deletions
@@ -7,11 +7,11 @@
import { createAgentSession, loadSettings, SessionManager, SettingsManager } from "@oh-my-pi/pi-coding-agent";
// Load current settings (merged global + project)
const settings = loadSettings();
const settings = await loadSettings();
console.log("Current settings:", JSON.stringify(settings, null, 2));
// Override specific settings
const settingsManager = SettingsManager.create();
const settingsManager = await SettingsManager.create();
settingsManager.applyOverrides({
compaction: { enabled: false },
retry: { enabled: true, maxRetries: 5, baseDelayMs: 1000 },