mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user