@defai.digital/ax-cli 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ax-cli/CUSTOM.md +111 -89
- package/.ax-cli/index.json +4 -3
- package/README.md +43 -16
- package/config/prompts.yaml +9 -0
- package/config/settings.yaml +2 -0
- package/dist/agent/llm-agent.d.ts +17 -0
- package/dist/agent/llm-agent.js +151 -52
- package/dist/agent/llm-agent.js.map +1 -1
- package/dist/commands/init/wizard.d.ts +66 -0
- package/dist/commands/init/wizard.js +310 -0
- package/dist/commands/init/wizard.js.map +1 -0
- package/dist/commands/init.js +146 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +3 -2
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/memory.d.ts +5 -0
- package/dist/commands/memory.js +257 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/setup.js +1 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/templates.d.ts +5 -0
- package/dist/commands/templates.js +244 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/commands/update.js +9 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/usage.js +1 -1
- package/dist/commands/usage.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/use-input-handler.js +49 -12
- package/dist/hooks/use-input-handler.js.map +1 -1
- package/dist/index.js +143 -16
- package/dist/index.js.map +1 -1
- package/dist/llm/client.d.ts +5 -0
- package/dist/llm/client.js +43 -37
- package/dist/llm/client.js.map +1 -1
- package/dist/schemas/index.d.ts +69 -0
- package/dist/schemas/index.js +29 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/yaml-schemas.d.ts +10 -0
- package/dist/schemas/yaml-schemas.js +2 -0
- package/dist/schemas/yaml-schemas.js.map +1 -1
- package/dist/tools/search.js +7 -1
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/text-editor.js +24 -14
- package/dist/tools/text-editor.js.map +1 -1
- package/dist/tools/todo-tool.js +62 -21
- package/dist/tools/todo-tool.js.map +1 -1
- package/dist/types/template.d.ts +53 -0
- package/dist/types/template.js +5 -0
- package/dist/types/template.js.map +1 -0
- package/dist/ui/components/command-suggestions.js +2 -2
- package/dist/ui/components/command-suggestions.js.map +1 -1
- package/dist/utils/cache.d.ts +1 -0
- package/dist/utils/cache.js +39 -5
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/config-loader.d.ts +2 -0
- package/dist/utils/config-loader.js +2 -1
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/confirmation-service.js +6 -3
- package/dist/utils/confirmation-service.js.map +1 -1
- package/dist/utils/error-handler.d.ts +5 -0
- package/dist/utils/error-handler.js +9 -3
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/init-previewer.d.ts +56 -0
- package/dist/utils/init-previewer.js +217 -0
- package/dist/utils/init-previewer.js.map +1 -0
- package/dist/utils/init-validator.d.ts +61 -0
- package/dist/utils/init-validator.js +248 -0
- package/dist/utils/init-validator.js.map +1 -0
- package/dist/utils/llm-optimized-instruction-generator.d.ts +31 -0
- package/dist/utils/llm-optimized-instruction-generator.js +296 -0
- package/dist/utils/llm-optimized-instruction-generator.js.map +1 -0
- package/dist/utils/onboarding-manager.d.ts +45 -0
- package/dist/utils/onboarding-manager.js +130 -0
- package/dist/utils/onboarding-manager.js.map +1 -0
- package/dist/utils/path-utils.d.ts +83 -0
- package/dist/utils/path-utils.js +122 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/dist/utils/progress-tracker.d.ts +51 -0
- package/dist/utils/progress-tracker.js +152 -0
- package/dist/utils/progress-tracker.js.map +1 -0
- package/dist/utils/project-analyzer.js +8 -14
- package/dist/utils/project-analyzer.js.map +1 -1
- package/dist/utils/settings-manager.d.ts +3 -3
- package/dist/utils/settings-manager.js +6 -13
- package/dist/utils/settings-manager.js.map +1 -1
- package/dist/utils/string-utils.d.ts +19 -0
- package/dist/utils/string-utils.js +28 -0
- package/dist/utils/string-utils.js.map +1 -0
- package/dist/utils/template-manager.d.ts +54 -0
- package/dist/utils/template-manager.js +421 -0
- package/dist/utils/template-manager.js.map +1 -0
- package/dist/utils/text-utils.js +3 -1
- package/dist/utils/text-utils.js.map +1 -1
- package/package.json +2 -1
- package/vitest.config.ts +6 -0
- package/dist/utils/model-config.d.ts +0 -28
- package/dist/utils/model-config.js +0 -43
- package/dist/utils/model-config.js.map +0 -1
- package/dist/utils/tool-helpers.d.ts +0 -25
- package/dist/utils/tool-helpers.js +0 -53
- package/dist/utils/tool-helpers.js.map +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ToolResult } from "../types/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Execute a tool operation with standardized error handling
|
|
4
|
-
*
|
|
5
|
-
* @param operation - The async operation to execute
|
|
6
|
-
* @param context - Context string for error messages (e.g., "View file", "Execute bash")
|
|
7
|
-
* @returns ToolResult with success/failure status
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* return executeTool(async () => {
|
|
12
|
-
* const content = await fs.readFile(path, 'utf-8');
|
|
13
|
-
* return `File contents: ${content}`;
|
|
14
|
-
* }, `View ${path}`);
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function executeTool<T>(operation: () => Promise<T>, context: string): Promise<ToolResult>;
|
|
18
|
-
/**
|
|
19
|
-
* Execute a tool operation synchronously with standardized error handling
|
|
20
|
-
*
|
|
21
|
-
* @param operation - The sync operation to execute
|
|
22
|
-
* @param context - Context string for error messages
|
|
23
|
-
* @returns ToolResult with success/failure status
|
|
24
|
-
*/
|
|
25
|
-
export declare function executeToolSync<T>(operation: () => T, context: string): ToolResult;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execute a tool operation with standardized error handling
|
|
3
|
-
*
|
|
4
|
-
* @param operation - The async operation to execute
|
|
5
|
-
* @param context - Context string for error messages (e.g., "View file", "Execute bash")
|
|
6
|
-
* @returns ToolResult with success/failure status
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* return executeTool(async () => {
|
|
11
|
-
* const content = await fs.readFile(path, 'utf-8');
|
|
12
|
-
* return `File contents: ${content}`;
|
|
13
|
-
* }, `View ${path}`);
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export async function executeTool(operation, context) {
|
|
17
|
-
try {
|
|
18
|
-
const result = await operation();
|
|
19
|
-
return {
|
|
20
|
-
success: true,
|
|
21
|
-
output: typeof result === 'string' ? result : JSON.stringify(result)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
return {
|
|
26
|
-
success: false,
|
|
27
|
-
error: `${context}: ${error.message}`
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Execute a tool operation synchronously with standardized error handling
|
|
33
|
-
*
|
|
34
|
-
* @param operation - The sync operation to execute
|
|
35
|
-
* @param context - Context string for error messages
|
|
36
|
-
* @returns ToolResult with success/failure status
|
|
37
|
-
*/
|
|
38
|
-
export function executeToolSync(operation, context) {
|
|
39
|
-
try {
|
|
40
|
-
const result = operation();
|
|
41
|
-
return {
|
|
42
|
-
success: true,
|
|
43
|
-
output: typeof result === 'string' ? result : JSON.stringify(result)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
return {
|
|
48
|
-
success: false,
|
|
49
|
-
error: `${context}: ${error.message}`
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=tool-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.js","sourceRoot":"","sources":["../../src/utils/tool-helpers.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,SAA2B,EAC3B,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,OAAO;YACL,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SACrE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE;SACtC,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAkB,EAClB,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SACrE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE;SACtC,CAAC;IACJ,CAAC;AACH,CAAC"}
|