@defai.digital/ax-cli 3.15.26 → 4.0.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.
Files changed (60) hide show
  1. package/README.md +56 -21
  2. package/dist/commands/init.d.ts +3 -3
  3. package/dist/commands/init.js +175 -25
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/setup.d.ts +0 -1
  6. package/dist/commands/setup.js +7 -139
  7. package/dist/commands/setup.js.map +1 -1
  8. package/dist/llm/tools.d.ts +14 -0
  9. package/dist/llm/tools.js +17 -4
  10. package/dist/llm/tools.js.map +1 -1
  11. package/dist/planner/types.d.ts +4 -4
  12. package/dist/tools/definitions/ask-user.d.ts +8 -0
  13. package/dist/tools/definitions/ask-user.js +168 -0
  14. package/dist/tools/definitions/ask-user.js.map +1 -0
  15. package/dist/tools/definitions/ax-agent.d.ts +7 -0
  16. package/dist/tools/definitions/ax-agent.js +149 -0
  17. package/dist/tools/definitions/ax-agent.js.map +1 -0
  18. package/dist/tools/definitions/bash-output.d.ts +7 -0
  19. package/dist/tools/definitions/bash-output.js +78 -0
  20. package/dist/tools/definitions/bash-output.js.map +1 -0
  21. package/dist/tools/definitions/bash.d.ts +8 -0
  22. package/dist/tools/definitions/bash.js +152 -0
  23. package/dist/tools/definitions/bash.js.map +1 -0
  24. package/dist/tools/definitions/create-file.d.ts +7 -0
  25. package/dist/tools/definitions/create-file.js +129 -0
  26. package/dist/tools/definitions/create-file.js.map +1 -0
  27. package/dist/tools/definitions/design.d.ts +12 -0
  28. package/dist/tools/definitions/design.js +368 -0
  29. package/dist/tools/definitions/design.js.map +1 -0
  30. package/dist/tools/definitions/index.d.ts +48 -0
  31. package/dist/tools/definitions/index.js +96 -0
  32. package/dist/tools/definitions/index.js.map +1 -0
  33. package/dist/tools/definitions/multi-edit.d.ts +7 -0
  34. package/dist/tools/definitions/multi-edit.js +123 -0
  35. package/dist/tools/definitions/multi-edit.js.map +1 -0
  36. package/dist/tools/definitions/search.d.ts +7 -0
  37. package/dist/tools/definitions/search.js +159 -0
  38. package/dist/tools/definitions/search.js.map +1 -0
  39. package/dist/tools/definitions/str-replace-editor.d.ts +7 -0
  40. package/dist/tools/definitions/str-replace-editor.js +145 -0
  41. package/dist/tools/definitions/str-replace-editor.js.map +1 -0
  42. package/dist/tools/definitions/todo.d.ts +8 -0
  43. package/dist/tools/definitions/todo.js +261 -0
  44. package/dist/tools/definitions/todo.js.map +1 -0
  45. package/dist/tools/definitions/view-file.d.ts +7 -0
  46. package/dist/tools/definitions/view-file.js +111 -0
  47. package/dist/tools/definitions/view-file.js.map +1 -0
  48. package/dist/tools/format-generators.d.ts +62 -0
  49. package/dist/tools/format-generators.js +291 -0
  50. package/dist/tools/format-generators.js.map +1 -0
  51. package/dist/tools/index.d.ts +4 -0
  52. package/dist/tools/index.js +6 -0
  53. package/dist/tools/index.js.map +1 -1
  54. package/dist/tools/result-enhancer.d.ts +64 -0
  55. package/dist/tools/result-enhancer.js +215 -0
  56. package/dist/tools/result-enhancer.js.map +1 -0
  57. package/dist/tools/types.d.ts +249 -0
  58. package/dist/tools/types.js +11 -0
  59. package/dist/tools/types.js.map +1 -0
  60. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Bash Output Tool Definition - Claude Code Quality
3
+ *
4
+ * Get output from background bash tasks.
5
+ */
6
+ export const bashOutputTool = {
7
+ name: 'bash_output',
8
+ displayName: 'Bash Output',
9
+ description: `Get output from a background bash task.
10
+
11
+ Use this tool after running a command with ' &' suffix or background: true. It retrieves the stdout/stderr output from the background process.
12
+
13
+ Background tasks run independently and continue even if the agent session ends. Use this tool to:
14
+ - Check if a background task is still running
15
+ - Get incremental output from long-running processes
16
+ - Wait for a background task to complete and get final output`,
17
+ parameters: {
18
+ type: 'object',
19
+ properties: {
20
+ task_id: {
21
+ type: 'string',
22
+ description: 'The background task ID returned when starting a background command',
23
+ examples: ['task-12345', 'bg-npm-dev-001'],
24
+ },
25
+ wait: {
26
+ type: 'boolean',
27
+ description: 'Wait for task to complete before returning output. If false, returns current output immediately.',
28
+ default: false,
29
+ },
30
+ timeout: {
31
+ type: 'number',
32
+ description: 'Maximum time to wait in milliseconds if wait is true. Default: 120000 (2 min).',
33
+ default: 120000,
34
+ constraints: ['Must be between 1 and 600000'],
35
+ },
36
+ },
37
+ required: ['task_id'],
38
+ },
39
+ usageNotes: [
40
+ 'Use after starting a background task with bash tool',
41
+ 'Set wait: true to block until the task completes',
42
+ 'Without wait, returns immediately with current output',
43
+ 'Returns both stdout and stderr from the process',
44
+ 'Check the status field to see if task is still running',
45
+ 'For long-running servers, call periodically to check logs',
46
+ ],
47
+ constraints: [
48
+ 'task_id must be a valid ID from a previous background bash command',
49
+ 'Cannot cancel or kill background tasks (they run until completion)',
50
+ 'Large outputs may be truncated',
51
+ ],
52
+ antiPatterns: [
53
+ 'Using without first starting a background task',
54
+ 'Calling with invalid or expired task_id',
55
+ 'Setting very long timeout for tasks that may never complete',
56
+ ],
57
+ examples: [
58
+ {
59
+ description: 'Check background task status',
60
+ scenario: 'See output from a running dev server',
61
+ input: { task_id: 'task-12345' },
62
+ expectedBehavior: 'Returns current output and running status',
63
+ },
64
+ {
65
+ description: 'Wait for task completion',
66
+ scenario: 'Wait for a build to finish',
67
+ input: { task_id: 'task-build-001', wait: true, timeout: 300000 },
68
+ expectedBehavior: 'Blocks until build completes, returns full output',
69
+ },
70
+ ],
71
+ tokenCost: 300,
72
+ safetyLevel: 'safe',
73
+ requiresConfirmation: false,
74
+ categories: ['command-execution'],
75
+ alternatives: [],
76
+ relatedTools: ['bash'],
77
+ };
78
+ //# sourceMappingURL=bash-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash-output.js","sourceRoot":"","sources":["../../../src/tools/definitions/bash-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAE1B,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;IAChB,YAAY,EAAE,CAAC,MAAM,CAAC;CACvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Bash Tool Definition - Claude Code Quality
3
+ *
4
+ * Execute bash commands in a persistent shell session with timeout control
5
+ * and security measures.
6
+ */
7
+ import type { ToolDefinition } from '../types.js';
8
+ export declare const bashTool: ToolDefinition;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Bash Tool Definition - Claude Code Quality
3
+ *
4
+ * Execute bash commands in a persistent shell session with timeout control
5
+ * and security measures.
6
+ */
7
+ export const bashTool = {
8
+ name: 'bash',
9
+ displayName: 'Bash',
10
+ description: `Execute bash commands in a persistent shell session with timeout control and security measures.
11
+
12
+ This tool is for terminal operations like git, npm, docker, system commands, and process management. Each invocation runs in the same shell environment, preserving environment variables and working directory between calls.
13
+
14
+ IMPORTANT: This tool is for COMMAND EXECUTION only. Do NOT use it for:
15
+ - Reading files (use view_file instead)
16
+ - Editing files (use str_replace_editor or create_file instead)
17
+ - Searching files (use search instead)
18
+ - Directory listing (use view_file with a directory path)
19
+
20
+ The shell supports background processes using the ' &' suffix or background: true parameter. Background tasks return a task_id that can be monitored with bash_output.
21
+
22
+ Before executing commands that create directories or files, verify the parent directory exists using view_file. Always quote file paths containing spaces with double quotes.`,
23
+ parameters: {
24
+ type: 'object',
25
+ properties: {
26
+ command: {
27
+ type: 'string',
28
+ description: `The bash command to execute.
29
+ - Quote file paths containing spaces with double quotes
30
+ - Use && to chain dependent commands
31
+ - Use ; to chain independent commands
32
+ - Append ' &' or use background: true for background execution`,
33
+ examples: [
34
+ 'npm test',
35
+ 'git status && git diff',
36
+ 'npm run dev &',
37
+ 'cd "/path/with spaces" && ls',
38
+ ],
39
+ },
40
+ background: {
41
+ type: 'boolean',
42
+ description: 'Run command in background. Returns task_id for monitoring with bash_output. Equivalent to appending " &" to command.',
43
+ default: false,
44
+ },
45
+ timeout: {
46
+ type: 'number',
47
+ description: 'Timeout in milliseconds. Default: 120000 (2 min). Max: 600000 (10 min). Ignored for background commands.',
48
+ default: 120000,
49
+ constraints: ['Must be between 1 and 600000'],
50
+ },
51
+ },
52
+ required: ['command'],
53
+ },
54
+ usageNotes: [
55
+ 'Prefer specialized tools over bash for file operations:',
56
+ ' - File reading: Use view_file (NOT cat, head, tail)',
57
+ ' - File editing: Use str_replace_editor (NOT sed, awk)',
58
+ ' - File creation: Use create_file (NOT echo >, cat <<EOF)',
59
+ ' - File search: Use search (NOT grep, find, rg)',
60
+ ' - Directory listing: Use view_file with directory path (NOT ls)',
61
+ 'Commands can be chained:',
62
+ ' - Use && for dependent commands (second runs only if first succeeds)',
63
+ ' - Use ; for independent commands (both run regardless)',
64
+ ' - Use | for piping output',
65
+ 'Background execution:',
66
+ ' - Append " &" or set background: true for long-running processes',
67
+ ' - Use bash_output with task_id to check output',
68
+ ' - Background tasks continue even if agent session ends',
69
+ 'Output handling:',
70
+ ' - Output over 30000 characters is truncated',
71
+ ' - Use output redirection (> file) for large outputs',
72
+ 'Environment:',
73
+ ' - Shell session is persistent across invocations',
74
+ ' - Environment variables and working directory are preserved',
75
+ ' - Use cd sparingly; prefer absolute paths',
76
+ 'For git commits, use HEREDOC format for multi-line messages:',
77
+ ' git commit -m "$(cat <<\'EOF\'\\nmessage here\\nEOF\\n)"',
78
+ ],
79
+ constraints: [
80
+ 'NEVER execute destructive commands without explicit user confirmation:',
81
+ ' - rm -rf on system directories',
82
+ ' - git push --force to main/master',
83
+ ' - Database drop/delete operations',
84
+ ' - System modification commands (mkfs, dd)',
85
+ 'NEVER use interactive flags that require user input:',
86
+ ' - git rebase -i (use non-interactive alternatives)',
87
+ ' - git add -i (use git add directly)',
88
+ ' - Any command with -i that expects keyboard input',
89
+ 'NEVER expose secrets in command output:',
90
+ ' - Avoid printing environment variables with secrets',
91
+ ' - Use --quiet flags when credentials might appear',
92
+ 'NEVER skip safety mechanisms:',
93
+ ' - git push with --no-verify unless explicitly requested',
94
+ ' - Commands that bypass confirmation prompts',
95
+ ],
96
+ antiPatterns: [
97
+ 'Reading file contents with cat/head/tail (use view_file instead)',
98
+ 'Editing files with sed/awk (use str_replace_editor instead)',
99
+ 'Creating files with echo/cat (use create_file instead)',
100
+ 'Searching with grep/find/rg (use search instead)',
101
+ 'Directory listing with ls (use view_file with directory path)',
102
+ 'Any operation where a specialized tool exists',
103
+ ],
104
+ examples: [
105
+ {
106
+ description: 'Run tests',
107
+ scenario: 'Execute the project test suite',
108
+ input: { command: 'npm test' },
109
+ expectedBehavior: 'Runs tests and returns results',
110
+ notes: 'Use appropriate test command for the project (npm, pytest, go test, etc.)',
111
+ },
112
+ {
113
+ description: 'Git status and diff',
114
+ scenario: 'Check current git state before committing',
115
+ input: { command: 'git status && git diff --staged' },
116
+ expectedBehavior: 'Shows working tree status and staged changes',
117
+ },
118
+ {
119
+ description: 'Start development server in background',
120
+ scenario: 'Start a long-running process without blocking',
121
+ input: { command: 'npm run dev', background: true },
122
+ expectedBehavior: 'Returns task_id for monitoring, server runs in background',
123
+ },
124
+ {
125
+ description: 'Git commit with proper message',
126
+ scenario: 'Create a commit with multi-line message',
127
+ input: {
128
+ command: `git commit -m "$(cat <<'EOF'
129
+ feat: add user authentication
130
+
131
+ - Implement JWT tokens
132
+ - Add login/logout endpoints
133
+ EOF
134
+ )"`,
135
+ },
136
+ expectedBehavior: 'Creates commit with formatted message',
137
+ },
138
+ {
139
+ description: 'Install dependencies',
140
+ scenario: 'Install project dependencies',
141
+ input: { command: 'npm install' },
142
+ expectedBehavior: 'Installs packages and updates lock file',
143
+ },
144
+ ],
145
+ tokenCost: 1200,
146
+ safetyLevel: 'dangerous',
147
+ requiresConfirmation: true,
148
+ categories: ['command-execution'],
149
+ alternatives: ['view_file', 'str_replace_editor', 'create_file', 'search'],
150
+ relatedTools: ['bash_output'],
151
+ };
152
+ //# sourceMappingURL=bash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/tools/definitions/bash.ts"],"names":[],"mappings":"AAAA;;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rite an existing file with specified content.
5
+ */
6
+ import type { ToolDefinition } from '../types.js';
7
+ export declare const createFileTool: ToolDefinition;
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Create File Tool Definition - Claude Code Quality
3
+ *
4
+ * Create a new file or overwrite an existing file with specified content.
5
+ */
6
+ export const createFileTool = {
7
+ name: 'create_file',
8
+ displayName: 'Create File',
9
+ description: `Create a new file or overwrite an existing file with specified content.
10
+
11
+ This tool writes content to a file path. If the file exists, it will be OVERWRITTEN. If parent directories don't exist, they will be created automatically.
12
+
13
+ IMPORTANT: For modifying existing files, prefer str_replace_editor. This tool is for:
14
+ - Creating new files from scratch
15
+ - Complete file rewrites when editing is impractical
16
+
17
+ When creating code files, match the project's coding style (indentation, quotes, semicolons, etc.) and include all necessary imports and complete implementations.`,
18
+ parameters: {
19
+ type: 'object',
20
+ properties: {
21
+ path: {
22
+ type: 'string',
23
+ description: 'Path where the file should be created. Parent directories are created if needed.',
24
+ format: 'file-path',
25
+ examples: ['/project/src/utils/format.ts', './config.json'],
26
+ },
27
+ content: {
28
+ type: 'string',
29
+ description: 'Complete content to write to the file. Include all necessary code, imports, etc.',
30
+ },
31
+ },
32
+ required: ['path', 'content'],
33
+ },
34
+ usageNotes: [
35
+ 'Creates parent directories automatically if they do not exist',
36
+ 'Prefer str_replace_editor for modifying existing files',
37
+ 'For existing files, use view_file first to understand current content',
38
+ 'Do NOT create documentation files (README, etc.) unless explicitly requested',
39
+ 'Do NOT use emojis in file content unless explicitly requested',
40
+ 'Match the coding style of the project (indentation, quotes, etc.)',
41
+ 'Include complete, working code - not stubs or placeholders',
42
+ 'Always include necessary imports at the top of the file',
43
+ 'Add appropriate file headers/comments if the project uses them',
44
+ ],
45
+ constraints: [
46
+ 'OVERWRITES existing files without warning',
47
+ 'For existing files, view_file should be called first to understand context',
48
+ 'Avoid creating files that duplicate existing functionality',
49
+ 'Do not create unnecessary configuration files',
50
+ 'Do not create test files unless explicitly requested',
51
+ ],
52
+ antiPatterns: [
53
+ 'Using bash echo/cat to create files',
54
+ 'Creating files when editing would suffice',
55
+ 'Creating documentation without being asked',
56
+ 'Creating placeholder/stub files',
57
+ 'Creating files that duplicate existing patterns',
58
+ 'Overwriting files without reading them first',
59
+ ],
60
+ examples: [
61
+ {
62
+ description: 'Create a new utility file',
63
+ scenario: 'Add a new helper function file',
64
+ input: {
65
+ path: '/project/src/utils/format.ts',
66
+ content: `/**
67
+ * Format utilities
68
+ */
69
+
70
+ export function formatCurrency(amount: number, currency = 'USD'): string {
71
+ return new Intl.NumberFormat('en-US', {
72
+ style: 'currency',
73
+ currency
74
+ }).format(amount);
75
+ }
76
+
77
+ export function formatDate(date: Date): string {
78
+ return date.toISOString().split('T')[0];
79
+ }
80
+ `,
81
+ },
82
+ expectedBehavior: 'Creates format.ts with the utility functions',
83
+ },
84
+ {
85
+ description: 'Create a test file',
86
+ scenario: 'Add tests for an existing module',
87
+ input: {
88
+ path: '/project/src/utils/format.test.ts',
89
+ content: `import { formatCurrency, formatDate } from './format';
90
+
91
+ describe('formatCurrency', () => {
92
+ it('formats USD correctly', () => {
93
+ expect(formatCurrency(1234.56)).toBe('$1,234.56');
94
+ });
95
+ });
96
+
97
+ describe('formatDate', () => {
98
+ it('formats date as ISO string', () => {
99
+ const date = new Date('2024-01-15T10:30:00Z');
100
+ expect(formatDate(date)).toBe('2024-01-15');
101
+ });
102
+ });
103
+ `,
104
+ },
105
+ expectedBehavior: 'Creates format.test.ts with test cases',
106
+ },
107
+ {
108
+ description: 'Create a configuration file',
109
+ scenario: 'Add a new JSON configuration',
110
+ input: {
111
+ path: '/project/config/settings.json',
112
+ content: `{
113
+ "apiEndpoint": "https://api.example.com",
114
+ "timeout": 30000,
115
+ "retries": 3
116
+ }
117
+ `,
118
+ },
119
+ expectedBehavior: 'Creates settings.json with configuration',
120
+ },
121
+ ],
122
+ tokenCost: 400,
123
+ safetyLevel: 'moderate',
124
+ requiresConfirmation: false,
125
+ categories: ['file-operations'],
126
+ alternatives: ['str_replace_editor'],
127
+ relatedTools: ['view_file', 'str_replace_editor'],
128
+ };
129
+ //# sourceMappingURL=create-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../src/tools/definitions/create-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAE1B,WAAW,EAAE;;;;;;;;mKAQoJ;IAEjK,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kFAAkF;gBACpF,MAAM,EAAE,WAAW;gBACnB,QAAQ,EAAE,CAAC,8BAA8B,EAAE,eAAe,CAAC;aAC5D;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kFAAkF;aACrF;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;KAC9B;IAED,UAAU,EAAE;QACV,+DAA+D;QAC/D,wDAAwD;QACxD,uEAAuE;QACvE,8EAA8E;QAC9E,+DAA+D;QAC/D,mEAAmE;QACnE,4DAA4D;QAC5D,yDAAyD;QACzD,gEAAgE;KACjE;IAED,WAAW,EAAE;QACX,2CAA2C;QAC3C,4EAA4E;QAC5E,4DAA4D;QAC5D,+CAA+C;QAC/C,sDAAsD;KACvD;IAED,YAAY,EAAE;QACZ,qCAAqC;QACrC,2CAA2C;QAC3C,4CAA4C;QAC5C,iCAAiC;QACjC,iDAAiD;QACjD,8CAA8C;KAC/C;IAED,QAAQ,EAAE;QACR;YACE,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,gCAAgC;YAC1C,KAAK,EAAE;gBACL,IAAI,EAAE,8BAA8B;gBACpC,OAAO,EAAE;;;;;;;;;;;;;;CAchB;aACM;YACD,gBAAgB,EAAE,8CAA8C;SACjE;QACD;YACE,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,kCAAkC;YAC5C,KAAK,EAAE;gBACL,IAAI,EAAE,mCAAmC;gBACzC,OAAO,EAAE;;;;;;;;;;;;;;CAchB;aACM;YACD,gBAAgB,EAAE,wCAAwC;SAC3D;QACD;YACE,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,8BAA8B;YACxC,KAAK,EAAE;gBACL,IAAI,EAAE,+BAA+B;gBACrC,OAAO,EAAE;;;;;CAKhB;aACM;YACD,gBAAgB,EAAE,0CAA0C;SAC7D;KACF;IAED,SAAS,EAAE,GAAG;IACd,WAAW,EAAE,UAAU;IACvB,oBAAoB,EAAE,KAAK;IAE3B,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,YAAY,EAAE,CAAC,oBAAoB,CAAC;IACpC,YAAY,EAAE,CAAC,WAAW,EAAE,oBAAoB,CAAC;CAClD,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Design Tools Definitions - Claude Code Quality
3
+ *
4
+ * Figma integration tools for design-to-code workflows.
5
+ */
6
+ import type { ToolDefinition } from '../types.js';
7
+ export declare const figmaMapTool: ToolDefinition;
8
+ export declare const figmaTokensTool: ToolDefinition;
9
+ export declare const figmaAuditTool: ToolDefinition;
10
+ export declare const figmaSearchTool: ToolDefinition;
11
+ export declare const figmaAliasListTool: ToolDefinition;
12
+ export declare const figmaAliasResolveTool: ToolDefinition;