feat: Refactor CLI tool configuration management and introduce skill context loader

- Updated `claude-cli-tools.ts` to support new model configurations and migration from older versions.
- Added `getPredefinedModels` and `getAllPredefinedModels` functions for better model management.
- Deprecated `cli-config-manager.ts` in favor of `claude-cli-tools.ts`, maintaining backward compatibility.
- Introduced `skill-context-loader.ts` to handle skill context loading based on user prompts and keywords.
- Enhanced tool configuration functions to include secondary models and improved migration logic.
- Updated index file to register the new skill context loader tool.
This commit is contained in:
catlog22
2026-01-11 13:56:20 +08:00
parent 2c11392848
commit 16083130f8
11 changed files with 1959 additions and 420 deletions

View File

@@ -159,8 +159,23 @@ async function execAction(toolName: string | undefined, jsonParams: string | und
// Execute tool
const result = await executeTool(toolName, params);
// Always output JSON
console.log(JSON.stringify(result, null, 2));
// Output raw result value for hooks, or JSON on error
if (result.success && result.result !== undefined) {
// For string results, output directly (useful for hooks)
if (typeof result.result === 'string') {
if (result.result) {
console.log(result.result);
}
// Empty string = silent (no output)
} else {
// For object results, output JSON
console.log(JSON.stringify(result.result, null, 2));
}
} else if (!result.success) {
// Error case - output full JSON for debugging
console.error(JSON.stringify(result, null, 2));
process.exit(1);
}
}
/**