@defai.digital/ax-cli 0.0.34

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 (181) hide show
  1. package/.automatosx/agents/aerospace-scientist.yaml +159 -0
  2. package/.automatosx/agents/architecture.yaml +244 -0
  3. package/.automatosx/agents/backend.yaml +172 -0
  4. package/.automatosx/agents/ceo.yaml +105 -0
  5. package/.automatosx/agents/creative-marketer.yaml +173 -0
  6. package/.automatosx/agents/cto.yaml +118 -0
  7. package/.automatosx/agents/data-scientist.yaml +200 -0
  8. package/.automatosx/agents/data.yaml +106 -0
  9. package/.automatosx/agents/design.yaml +115 -0
  10. package/.automatosx/agents/devops.yaml +124 -0
  11. package/.automatosx/agents/frontend.yaml +171 -0
  12. package/.automatosx/agents/fullstack.yaml +172 -0
  13. package/.automatosx/agents/mobile.yaml +185 -0
  14. package/.automatosx/agents/product.yaml +103 -0
  15. package/.automatosx/agents/quality.yaml +93 -0
  16. package/.automatosx/agents/quantum-engineer.yaml +167 -0
  17. package/.automatosx/agents/researcher.yaml +122 -0
  18. package/.automatosx/agents/security.yaml +115 -0
  19. package/.automatosx/agents/standard.yaml +214 -0
  20. package/.automatosx/agents/writer.yaml +122 -0
  21. package/.automatosx/feature-flags.json +13 -0
  22. package/.automatosx/memory/memory.db +0 -0
  23. package/.automatosx/providers/README.md +117 -0
  24. package/.automatosx/providers/grok-zai.yaml.template +61 -0
  25. package/.automatosx/providers/grok.yaml.template +71 -0
  26. package/.automatosx/status/backend-1763517593334-85037.json +9 -0
  27. package/.automatosx/status/quality-1763516867087-82043.json +9 -0
  28. package/.automatosx/status/quality-1763516976722-84817.json +9 -0
  29. package/.automatosx/status/security-1763517871950-87357.json +9 -0
  30. package/.automatosx/teams/business.yaml +56 -0
  31. package/.automatosx/teams/core.yaml +60 -0
  32. package/.automatosx/teams/design.yaml +58 -0
  33. package/.automatosx/teams/engineering.yaml +69 -0
  34. package/.automatosx/teams/research.yaml +56 -0
  35. package/.automatosx/templates/analyst.yaml +60 -0
  36. package/.automatosx/templates/assistant.yaml +48 -0
  37. package/.automatosx/templates/basic-agent.yaml +28 -0
  38. package/.automatosx/templates/code-reviewer.yaml +52 -0
  39. package/.automatosx/templates/debugger.yaml +63 -0
  40. package/.automatosx/templates/designer.yaml +69 -0
  41. package/.automatosx/templates/developer.yaml +60 -0
  42. package/.automatosx/templates/fullstack-developer.yaml +395 -0
  43. package/.automatosx/templates/qa-specialist.yaml +71 -0
  44. package/.claude/mcp/automatosx.json +244 -0
  45. package/.claude/settings.local.json +34 -0
  46. package/.grok/settings.json +37 -0
  47. package/LICENSE +26 -0
  48. package/README.md +518 -0
  49. package/automatosx/PRD/README.md +9 -0
  50. package/automatosx/tmp/README.md +10 -0
  51. package/automatosx.config.json +333 -0
  52. package/dist/agent/grok-agent.d.ts +52 -0
  53. package/dist/agent/grok-agent.js +627 -0
  54. package/dist/agent/grok-agent.js.map +1 -0
  55. package/dist/agent/index.d.ts +14 -0
  56. package/dist/agent/index.js +136 -0
  57. package/dist/agent/index.js.map +1 -0
  58. package/dist/commands/mcp.d.ts +2 -0
  59. package/dist/commands/mcp.js +239 -0
  60. package/dist/commands/mcp.js.map +1 -0
  61. package/dist/grok/client.d.ts +49 -0
  62. package/dist/grok/client.js +80 -0
  63. package/dist/grok/client.js.map +1 -0
  64. package/dist/grok/tools.d.ts +8 -0
  65. package/dist/grok/tools.js +349 -0
  66. package/dist/grok/tools.js.map +1 -0
  67. package/dist/hooks/use-enhanced-input.d.ts +37 -0
  68. package/dist/hooks/use-enhanced-input.js +214 -0
  69. package/dist/hooks/use-enhanced-input.js.map +1 -0
  70. package/dist/hooks/use-input-handler.d.ts +34 -0
  71. package/dist/hooks/use-input-handler.js +608 -0
  72. package/dist/hooks/use-input-handler.js.map +1 -0
  73. package/dist/hooks/use-input-history.d.ts +9 -0
  74. package/dist/hooks/use-input-history.js +69 -0
  75. package/dist/hooks/use-input-history.js.map +1 -0
  76. package/dist/index.d.ts +2 -0
  77. package/dist/index.js +339 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/mcp/client.d.ts +31 -0
  80. package/dist/mcp/client.js +152 -0
  81. package/dist/mcp/client.js.map +1 -0
  82. package/dist/mcp/config.d.ts +13 -0
  83. package/dist/mcp/config.js +43 -0
  84. package/dist/mcp/config.js.map +1 -0
  85. package/dist/mcp/transports.d.ts +48 -0
  86. package/dist/mcp/transports.js +217 -0
  87. package/dist/mcp/transports.js.map +1 -0
  88. package/dist/schemas/index.d.ts +102 -0
  89. package/dist/schemas/index.js +105 -0
  90. package/dist/schemas/index.js.map +1 -0
  91. package/dist/tools/bash.d.ts +10 -0
  92. package/dist/tools/bash.js +82 -0
  93. package/dist/tools/bash.js.map +1 -0
  94. package/dist/tools/confirmation-tool.d.ts +16 -0
  95. package/dist/tools/confirmation-tool.js +72 -0
  96. package/dist/tools/confirmation-tool.js.map +1 -0
  97. package/dist/tools/index.d.ts +6 -0
  98. package/dist/tools/index.js +7 -0
  99. package/dist/tools/index.js.map +1 -0
  100. package/dist/tools/morph-editor.d.ts +36 -0
  101. package/dist/tools/morph-editor.js +308 -0
  102. package/dist/tools/morph-editor.js.map +1 -0
  103. package/dist/tools/search.d.ts +68 -0
  104. package/dist/tools/search.js +300 -0
  105. package/dist/tools/search.js.map +1 -0
  106. package/dist/tools/text-editor.d.ts +16 -0
  107. package/dist/tools/text-editor.js +526 -0
  108. package/dist/tools/text-editor.js.map +1 -0
  109. package/dist/tools/todo-tool.d.ts +20 -0
  110. package/dist/tools/todo-tool.js +129 -0
  111. package/dist/tools/todo-tool.js.map +1 -0
  112. package/dist/types/index.d.ts +30 -0
  113. package/dist/types/index.js +2 -0
  114. package/dist/types/index.js.map +1 -0
  115. package/dist/ui/app.d.ts +7 -0
  116. package/dist/ui/app.js +99 -0
  117. package/dist/ui/app.js.map +1 -0
  118. package/dist/ui/components/api-key-input.d.ts +7 -0
  119. package/dist/ui/components/api-key-input.js +80 -0
  120. package/dist/ui/components/api-key-input.js.map +1 -0
  121. package/dist/ui/components/chat-history.d.ts +8 -0
  122. package/dist/ui/components/chat-history.js +157 -0
  123. package/dist/ui/components/chat-history.js.map +1 -0
  124. package/dist/ui/components/chat-input.d.ts +9 -0
  125. package/dist/ui/components/chat-input.js +67 -0
  126. package/dist/ui/components/chat-input.js.map +1 -0
  127. package/dist/ui/components/chat-interface.d.ts +8 -0
  128. package/dist/ui/components/chat-interface.js +272 -0
  129. package/dist/ui/components/chat-interface.js.map +1 -0
  130. package/dist/ui/components/command-suggestions.d.ts +17 -0
  131. package/dist/ui/components/command-suggestions.js +22 -0
  132. package/dist/ui/components/command-suggestions.js.map +1 -0
  133. package/dist/ui/components/confirmation-dialog.d.ts +11 -0
  134. package/dist/ui/components/confirmation-dialog.js +105 -0
  135. package/dist/ui/components/confirmation-dialog.js.map +1 -0
  136. package/dist/ui/components/diff-renderer.d.ts +13 -0
  137. package/dist/ui/components/diff-renderer.js +186 -0
  138. package/dist/ui/components/diff-renderer.js.map +1 -0
  139. package/dist/ui/components/loading-spinner.d.ts +8 -0
  140. package/dist/ui/components/loading-spinner.js +59 -0
  141. package/dist/ui/components/loading-spinner.js.map +1 -0
  142. package/dist/ui/components/mcp-status.d.ts +5 -0
  143. package/dist/ui/components/mcp-status.js +36 -0
  144. package/dist/ui/components/mcp-status.js.map +1 -0
  145. package/dist/ui/components/model-selection.d.ts +12 -0
  146. package/dist/ui/components/model-selection.js +17 -0
  147. package/dist/ui/components/model-selection.js.map +1 -0
  148. package/dist/ui/shared/max-sized-box.d.ts +8 -0
  149. package/dist/ui/shared/max-sized-box.js +6 -0
  150. package/dist/ui/shared/max-sized-box.js.map +1 -0
  151. package/dist/ui/utils/code-colorizer.d.ts +2 -0
  152. package/dist/ui/utils/code-colorizer.js +7 -0
  153. package/dist/ui/utils/code-colorizer.js.map +1 -0
  154. package/dist/ui/utils/colors.d.ts +14 -0
  155. package/dist/ui/utils/colors.js +15 -0
  156. package/dist/ui/utils/colors.js.map +1 -0
  157. package/dist/ui/utils/markdown-renderer.d.ts +4 -0
  158. package/dist/ui/utils/markdown-renderer.js +23 -0
  159. package/dist/ui/utils/markdown-renderer.js.map +1 -0
  160. package/dist/utils/confirmation-service.d.ts +32 -0
  161. package/dist/utils/confirmation-service.js +109 -0
  162. package/dist/utils/confirmation-service.js.map +1 -0
  163. package/dist/utils/custom-instructions.d.ts +1 -0
  164. package/dist/utils/custom-instructions.js +17 -0
  165. package/dist/utils/custom-instructions.js.map +1 -0
  166. package/dist/utils/model-config.d.ts +28 -0
  167. package/dist/utils/model-config.js +42 -0
  168. package/dist/utils/model-config.js.map +1 -0
  169. package/dist/utils/settings-manager.d.ts +94 -0
  170. package/dist/utils/settings-manager.js +240 -0
  171. package/dist/utils/settings-manager.js.map +1 -0
  172. package/dist/utils/settings.d.ts +1 -0
  173. package/dist/utils/settings.js +4 -0
  174. package/dist/utils/settings.js.map +1 -0
  175. package/dist/utils/text-utils.d.ts +80 -0
  176. package/dist/utils/text-utils.js +182 -0
  177. package/dist/utils/text-utils.js.map +1 -0
  178. package/dist/utils/token-counter.d.ts +33 -0
  179. package/dist/utils/token-counter.js +78 -0
  180. package/dist/utils/token-counter.js.map +1 -0
  181. package/package.json +70 -0
@@ -0,0 +1,129 @@
1
+ export class TodoTool {
2
+ todos = [];
3
+ formatTodoList() {
4
+ if (this.todos.length === 0) {
5
+ return 'No todos created yet';
6
+ }
7
+ const getCheckbox = (status) => {
8
+ switch (status) {
9
+ case 'completed':
10
+ return '●';
11
+ case 'in_progress':
12
+ return '◐';
13
+ case 'pending':
14
+ return '○';
15
+ default:
16
+ return '○';
17
+ }
18
+ };
19
+ const getStatusColor = (status) => {
20
+ switch (status) {
21
+ case 'completed':
22
+ return '\x1b[32m'; // Green
23
+ case 'in_progress':
24
+ return '\x1b[36m'; // Cyan
25
+ case 'pending':
26
+ return '\x1b[37m'; // White/default
27
+ default:
28
+ return '\x1b[0m'; // Reset
29
+ }
30
+ };
31
+ const reset = '\x1b[0m';
32
+ let output = '';
33
+ this.todos.forEach((todo, index) => {
34
+ const checkbox = getCheckbox(todo.status);
35
+ const statusColor = getStatusColor(todo.status);
36
+ const strikethrough = todo.status === 'completed' ? '\x1b[9m' : '';
37
+ const indent = index === 0 ? '' : ' ';
38
+ output += `${indent}${statusColor}${strikethrough}${checkbox} ${todo.content}${reset}\n`;
39
+ });
40
+ return output;
41
+ }
42
+ async createTodoList(todos) {
43
+ try {
44
+ // Validate todos
45
+ for (const todo of todos) {
46
+ if (!todo.id || !todo.content || !todo.status || !todo.priority) {
47
+ return {
48
+ success: false,
49
+ error: 'Each todo must have id, content, status, and priority fields'
50
+ };
51
+ }
52
+ if (!['pending', 'in_progress', 'completed'].includes(todo.status)) {
53
+ return {
54
+ success: false,
55
+ error: `Invalid status: ${todo.status}. Must be pending, in_progress, or completed`
56
+ };
57
+ }
58
+ if (!['high', 'medium', 'low'].includes(todo.priority)) {
59
+ return {
60
+ success: false,
61
+ error: `Invalid priority: ${todo.priority}. Must be high, medium, or low`
62
+ };
63
+ }
64
+ }
65
+ this.todos = todos;
66
+ return {
67
+ success: true,
68
+ output: this.formatTodoList()
69
+ };
70
+ }
71
+ catch (error) {
72
+ return {
73
+ success: false,
74
+ error: `Error creating todo list: ${error instanceof Error ? error.message : String(error)}`
75
+ };
76
+ }
77
+ }
78
+ async updateTodoList(updates) {
79
+ try {
80
+ const updatedIds = [];
81
+ for (const update of updates) {
82
+ const todoIndex = this.todos.findIndex(t => t.id === update.id);
83
+ if (todoIndex === -1) {
84
+ return {
85
+ success: false,
86
+ error: `Todo with id ${update.id} not found`
87
+ };
88
+ }
89
+ const todo = this.todos[todoIndex];
90
+ if (update.status && !['pending', 'in_progress', 'completed'].includes(update.status)) {
91
+ return {
92
+ success: false,
93
+ error: `Invalid status: ${update.status}. Must be pending, in_progress, or completed`
94
+ };
95
+ }
96
+ if (update.priority && !['high', 'medium', 'low'].includes(update.priority)) {
97
+ return {
98
+ success: false,
99
+ error: `Invalid priority: ${update.priority}. Must be high, medium, or low`
100
+ };
101
+ }
102
+ if (update.status)
103
+ todo.status = update.status;
104
+ if (update.content)
105
+ todo.content = update.content;
106
+ if (update.priority)
107
+ todo.priority = update.priority;
108
+ updatedIds.push(update.id);
109
+ }
110
+ return {
111
+ success: true,
112
+ output: this.formatTodoList()
113
+ };
114
+ }
115
+ catch (error) {
116
+ return {
117
+ success: false,
118
+ error: `Error updating todo list: ${error instanceof Error ? error.message : String(error)}`
119
+ };
120
+ }
121
+ }
122
+ async viewTodoList() {
123
+ return {
124
+ success: true,
125
+ output: this.formatTodoList()
126
+ };
127
+ }
128
+ }
129
+ //# sourceMappingURL=todo-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-tool.js","sourceRoot":"","sources":["../../src/tools/todo-tool.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,QAAQ;IACX,KAAK,GAAe,EAAE,CAAC;IAE/B,cAAc;QACZ,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,sBAAsB,CAAC;QAChC,CAAC;QAED,MAAM,WAAW,GAAG,CAAC,MAAc,EAAU,EAAE;YAC7C,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,WAAW;oBACd,OAAO,GAAG,CAAC;gBACb,KAAK,aAAa;oBAChB,OAAO,GAAG,CAAC;gBACb,KAAK,SAAS;oBACZ,OAAO,GAAG,CAAC;gBACb;oBACE,OAAO,GAAG,CAAC;YACf,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,cAAc,GAAG,CAAC,MAAc,EAAU,EAAE;YAChD,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,WAAW;oBACd,OAAO,UAAU,CAAC,CAAC,QAAQ;gBAC7B,KAAK,aAAa;oBAChB,OAAO,UAAU,CAAC,CAAC,OAAO;gBAC5B,KAAK,SAAS;oBACZ,OAAO,UAAU,CAAC,CAAC,gBAAgB;gBACrC;oBACE,OAAO,SAAS,CAAC,CAAC,QA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AAc,EAAE;SAC9B,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ export interface ToolResult {
2
+ success: boolean;
3
+ output?: string;
4
+ error?: string;
5
+ data?: any;
6
+ }
7
+ export interface Tool {
8
+ name: string;
9
+ description: string;
10
+ execute: (...args: any[]) => Promise<ToolResult>;
11
+ }
12
+ export interface EditorCommand {
13
+ command: 'view' | 'str_replace' | 'create' | 'insert' | 'undo_edit';
14
+ path?: string;
15
+ old_str?: string;
16
+ new_str?: string;
17
+ content?: string;
18
+ insert_line?: number;
19
+ view_range?: [number, number];
20
+ replace_all?: boolean;
21
+ }
22
+ export interface AgentState {
23
+ currentDirectory: string;
24
+ editHistory: EditorCommand[];
25
+ tools: Tool[];
26
+ }
27
+ export interface ConfirmationState {
28
+ skipThisSession: boolean;
29
+ pendingOperation: boolean;
30
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Agent } from '../agent/index.js';
3
+ interface Props {
4
+ agent: Agent;
5
+ }
6
+ export default function App({ agent }: Props): React.JSX.Element;
7
+ export {};
package/dist/ui/app.js ADDED
@@ -0,0 +1,99 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { Box, Text, useInput } from 'ink';
3
+ import { ConfirmationService } from '../utils/confirmation-service.js';
4
+ import ConfirmationDialog from './components/confirmation-dialog.js';
5
+ export default function App({ agent }) {
6
+ const [input, setInput] = useState('');
7
+ const [history, setHistory] = useState([]);
8
+ const [isProcessing, setIsProcessing] = useState(false);
9
+ const [confirmationOptions, setConfirmationOptions] = useState(null);
10
+ // Removed useApp().exit - using process.exit(0) instead for better terminal handling
11
+ const confirmationService = ConfirmationService.getInstance();
12
+ useEffect(() => {
13
+ const handleConfirmationRequest = (options) => {
14
+ setConfirmationOptions(options);
15
+ };
16
+ confirmationService.on('confirmation-requested', handleConfirmationRequest);
17
+ return () => {
18
+ confirmationService.off('confirmation-requested', handleConfirmationRequest);
19
+ };
20
+ }, [confirmationService]);
21
+ // Reset confirmation service session on app start
22
+ useEffect(() => {
23
+ confirmationService.resetSession();
24
+ }, []);
25
+ useInput(async (inputChar, key) => {
26
+ // If confirmation dialog is open, don't handle normal input
27
+ if (confirmationOptions) {
28
+ return;
29
+ }
30
+ if (key.ctrl && inputChar === 'c') {
31
+ process.exit(0);
32
+ return;
33
+ }
34
+ if (key.return) {
35
+ if (input.trim() === 'exit' || input.trim() === 'quit') {
36
+ process.exit(0);
37
+ return;
38
+ }
39
+ if (input.trim()) {
40
+ setIsProcessing(true);
41
+ const result = await agent.processCommand(input.trim());
42
+ setHistory(prev => [...prev, { command: input.trim(), result }]);
43
+ setInput('');
44
+ setIsProcessing(false);
45
+ }
46
+ return;
47
+ }
48
+ if (key.backspace || key.delete) {
49
+ setInput(prev => prev.slice(0, -1));
50
+ return;
51
+ }
52
+ if (inputChar && !key.ctrl && !key.meta) {
53
+ setInput(prev => prev + inputChar);
54
+ }
55
+ });
56
+ const renderResult = (result) => {
57
+ if (result.success) {
58
+ return (React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
59
+ React.createElement(Text, { color: "green" }, "\u2713 Success"),
60
+ result.output && (React.createElement(Box, { marginLeft: 2 },
61
+ React.createElement(Text, null, result.output)))));
62
+ }
63
+ else {
64
+ return (React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
65
+ React.createElement(Text, { color: "red" }, "\u2717 Error"),
66
+ result.error && (React.createElement(Box, { marginLeft: 2 },
67
+ React.createElement(Text, { color: "red" }, result.error)))));
68
+ }
69
+ };
70
+ const handleConfirmation = (dontAskAgain) => {
71
+ confirmationService.confirmOperation(true, dontAskAgain);
72
+ setConfirmationOptions(null);
73
+ };
74
+ const handleRejection = (feedback) => {
75
+ confirmationService.rejectOperation(feedback);
76
+ setConfirmationOptions(null);
77
+ };
78
+ if (confirmationOptions) {
79
+ return (React.createElement(ConfirmationDialog, { operation: confirmationOptions.operation, filename: confirmationOptions.filename, showVSCodeOpen: confirmationOptions.showVSCodeOpen, onConfirm: handleConfirmation, onReject: handleRejection }));
80
+ }
81
+ return (React.createElement(Box, { flexDirection: "column", padding: 1 },
82
+ React.createElement(Box, { marginBottom: 1 },
83
+ React.createElement(Text, { bold: true, color: "cyan" }, "\uD83D\uDD27 Grok CLI - Text Editor Agent")),
84
+ React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
85
+ React.createElement(Text, { dimColor: true }, "Available commands: view, str_replace, create, insert, undo_edit, bash, help"),
86
+ React.createElement(Text, { dimColor: true }, "Type 'help' for detailed usage, 'exit' or Ctrl+C to quit")),
87
+ React.createElement(Box, { flexDirection: "column", marginBottom: 1 }, history.slice(-10).map((entry, index) => (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 1 },
88
+ React.createElement(Box, null,
89
+ React.createElement(Text, { color: "blue" }, "$ "),
90
+ React.createElement(Text, null, entry.command)),
91
+ renderResult(entry.result))))),
92
+ React.createElement(Box, null,
93
+ React.createElement(Text, { color: "blue" }, "$ "),
94
+ React.createElement(Text, null,
95
+ input,
96
+ !isProcessing && React.createElement(Text, { color: "white" }, "\u2588")),
97
+ isProcessing && React.createElement(Text, { color: "yellow" }, " (processing...)"))));
98
+ }
99
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/ui/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAuB,MAAM,kCAAkC,CAAC;AAC5F,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AAMrE,MAAM,CAAC,OAAO,UAA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,oBAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,gDAEhB,CACH;QAEN,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;YACzC,oBAAC,IAAI,IAAC,QAAQ,yFAEP;YACP,oBAAC,IAAI,IAAC,QAAQ,qEAEP,CACH;QAEN,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,IACxC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,oBAAC,GAAG,IAAC,GAAG,EAAE,KAAK,EAAE,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;YACrD,oBAAC,GAAG;gBACF,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,SAAU;gBAC5B,oBAAC,IAAI,QAAE,KAAK,CAAC,OAAO,CAAQ,CACxB;YACL,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CACvB,CACP,CAAC,CACE;QAEN,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,SAAU;YAC5B,oBAAC,IAAI;gBACF,KAAK;gBACL,CAAC,YAAY,IAAI,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAAS,CACzC;YACN,YAAY,IAAI,oBAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,uBAAwB,CACzD,CACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { GrokAgent } from "../../agent/grok-agent.js";
3
+ interface ApiKeyInputProps {
4
+ onApiKeySet: (agent: GrokAgent) => void;
5
+ }
6
+ export default function ApiKeyInput({ onApiKeySet }: ApiKeyInputProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,80 @@
1
+ import React, { useState } from "react";
2
+ import { Box, Text, useInput, useApp } from "ink";
3
+ import { GrokAgent } from "../../agent/grok-agent.js";
4
+ import { getSettingsManager } from "../../utils/settings-manager.js";
5
+ export default function ApiKeyInput({ onApiKeySet }) {
6
+ const [input, setInput] = useState("");
7
+ const [error, setError] = useState("");
8
+ const [isSubmitting, setIsSubmitting] = useState(false);
9
+ const { exit } = useApp();
10
+ useInput((inputChar, key) => {
11
+ if (isSubmitting)
12
+ return;
13
+ if (key.ctrl && inputChar === "c") {
14
+ exit();
15
+ return;
16
+ }
17
+ if (key.return) {
18
+ handleSubmit();
19
+ return;
20
+ }
21
+ if (key.backspace || key.delete) {
22
+ setInput((prev) => prev.slice(0, -1));
23
+ setError("");
24
+ return;
25
+ }
26
+ if (inputChar && !key.ctrl && !key.meta) {
27
+ setInput((prev) => prev + inputChar);
28
+ setError("");
29
+ }
30
+ });
31
+ const handleSubmit = async () => {
32
+ if (!input.trim()) {
33
+ setError("API key cannot be empty");
34
+ return;
35
+ }
36
+ setIsSubmitting(true);
37
+ try {
38
+ const apiKey = input.trim();
39
+ const agent = new GrokAgent(apiKey);
40
+ // Set environment variable for current process
41
+ process.env.GROK_API_KEY = apiKey;
42
+ // Save to user settings
43
+ try {
44
+ const manager = getSettingsManager();
45
+ manager.updateUserSetting('apiKey', apiKey);
46
+ console.log(`\n✅ API key saved to ~/.grok/user-settings.json`);
47
+ }
48
+ catch (error) {
49
+ console.log('\n⚠️ Could not save API key to settings file');
50
+ console.log('API key set for current session only');
51
+ }
52
+ onApiKeySet(agent);
53
+ }
54
+ catch (error) {
55
+ setError("Invalid API key format");
56
+ setIsSubmitting(false);
57
+ }
58
+ };
59
+ const displayText = input.length > 0 ?
60
+ (isSubmitting ? "*".repeat(input.length) : "*".repeat(input.length) + "█") :
61
+ (isSubmitting ? " " : "█");
62
+ return (React.createElement(Box, { flexDirection: "column", paddingX: 2, paddingY: 1 },
63
+ React.createElement(Text, { color: "yellow" }, "\uD83D\uDD11 Grok API Key Required"),
64
+ React.createElement(Box, { marginBottom: 1 },
65
+ React.createElement(Text, { color: "gray" }, "Please enter your Grok API key to continue:")),
66
+ React.createElement(Box, { borderStyle: "round", borderColor: "blue", paddingX: 1, marginBottom: 1 },
67
+ React.createElement(Text, { color: "gray" }, "\u276F "),
68
+ React.createElement(Text, null, displayText)),
69
+ error ? (React.createElement(Box, { marginBottom: 1 },
70
+ React.createElement(Text, { color: "red" },
71
+ "\u274C ",
72
+ error))) : null,
73
+ React.createElement(Box, { flexDirection: "column", marginTop: 1 },
74
+ React.createElement(Text, { color: "gray", dimColor: true }, "\u2022 Press Enter to submit"),
75
+ React.createElement(Text, { color: "gray", dimColor: true }, "\u2022 Press Ctrl+C to exit"),
76
+ React.createElement(Text, { color: "gray", dimColor: true }, "Note: API key will be saved to ~/.grok/user-settings.json")),
77
+ isSubmitting ? (React.createElement(Box, { marginTop: 1 },
78
+ React.createElement(Text, { color: "yellow" }, "\uD83D\uDD04 Validating API key..."))) : null));
79
+ }
80
+ //# sourceMappingURL=api-key-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key-input.js","sourceRoot":"","sources":["../../../src/ui/components/api-key-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAMrE,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,WAAW,EAAoB;IACnE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,C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tE,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,cAAU;YAC5B,oBAAC,IAAI,QAAE,WAAW,CAAQ,CACtB;QAEL,KAAK,CAAC,CAAC,CAAC,CACP,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK;;gBAAI,KAAK,CAAQ,CAC9B,CACP,CAAC,CAAC,CAAC,IAAI;QAER,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC;YACtC,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,yCAA+B;YAC1D,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,wCAA8B;YACzD,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,sEAAiE,CACxF;QAEL,YAAY,CAAC,CAAC,CAAC,CACd,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,yCAAgC,CAChD,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { ChatEntry } from "../../agent/grok-agent.js";
3
+ interface ChatHistoryProps {
4
+ entries: ChatEntry[];
5
+ isConfirmationActive?: boolean;
6
+ }
7
+ export declare function ChatHistory({ entries, isConfirmationActive, }: ChatHistoryProps): React.JSX.Element;
8
+ export {};
@@ -0,0 +1,157 @@
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+ import { DiffRenderer } from "./diff-renderer.js";
4
+ import { MarkdownRenderer } from "../utils/markdown-renderer.js";
5
+ // Memoized ChatEntry component to prevent unnecessary re-renders
6
+ const MemoizedChatEntry = React.memo(({ entry, index }) => {
7
+ const renderDiff = (diffContent, filename) => {
8
+ return (React.createElement(DiffRenderer, { diffContent: diffContent, filename: filename, terminalWidth: 80 }));
9
+ };
10
+ const renderFileContent = (content) => {
11
+ const lines = content.split("\n");
12
+ // Calculate minimum indentation like DiffRenderer does
13
+ let baseIndentation = Infinity;
14
+ for (const line of lines) {
15
+ if (line.trim() === "")
16
+ continue;
17
+ const firstCharIndex = line.search(/\S/);
18
+ const currentIndent = firstCharIndex === -1 ? 0 : firstCharIndex;
19
+ baseIndentation = Math.min(baseIndentation, currentIndent);
20
+ }
21
+ if (!isFinite(baseIndentation)) {
22
+ baseIndentation = 0;
23
+ }
24
+ return lines.map((line, index) => {
25
+ const displayContent = line.substring(baseIndentation);
26
+ return (React.createElement(Text, { key: index, color: "gray" }, displayContent));
27
+ });
28
+ };
29
+ switch (entry.type) {
30
+ case "user":
31
+ return (React.createElement(Box, { key: index, flexDirection: "column", marginTop: 1 },
32
+ React.createElement(Box, null,
33
+ React.createElement(Text, { color: "gray" },
34
+ ">",
35
+ " ",
36
+ entry.content))));
37
+ case "assistant":
38
+ return (React.createElement(Box, { key: index, flexDirection: "column", marginTop: 1 },
39
+ React.createElement(Box, { flexDirection: "row", alignItems: "flex-start" },
40
+ React.createElement(Text, { color: "white" }, "\u23FA "),
41
+ React.createElement(Box, { flexDirection: "column", flexGrow: 1 },
42
+ entry.toolCalls ? (
43
+ // If there are tool calls, just show plain text
44
+ React.createElement(Text, { color: "white" }, entry.content.trim())) : (
45
+ // If no tool calls, render as markdown
46
+ React.createElement(MarkdownRenderer, { content: entry.content.trim() })),
47
+ entry.isStreaming && React.createElement(Text, { color: "cyan" }, "\u2588")))));
48
+ case "tool_call":
49
+ case "tool_result":
50
+ const getToolActionName = (toolName) => {
51
+ // Handle MCP tools with mcp__servername__toolname format
52
+ if (toolName.startsWith("mcp__")) {
53
+ const parts = toolName.split("__");
54
+ if (parts.length >= 3) {
55
+ const serverName = parts[1];
56
+ const actualToolName = parts.slice(2).join("__");
57
+ return `${serverName.charAt(0).toUpperCase() + serverName.slice(1)}(${actualToolName.replace(/_/g, " ")})`;
58
+ }
59
+ }
60
+ switch (toolName) {
61
+ case "view_file":
62
+ return "Read";
63
+ case "str_replace_editor":
64
+ return "Update";
65
+ case "create_file":
66
+ return "Create";
67
+ case "bash":
68
+ return "Bash";
69
+ case "search":
70
+ return "Search";
71
+ case "create_todo_list":
72
+ return "Created Todo";
73
+ case "update_todo_list":
74
+ return "Updated Todo";
75
+ default:
76
+ return "Tool";
77
+ }
78
+ };
79
+ const toolName = entry.toolCall?.function?.name || "unknown";
80
+ const actionName = getToolActionName(toolName);
81
+ const getFilePath = (toolCall) => {
82
+ if (toolCall?.function?.arguments) {
83
+ try {
84
+ const args = JSON.parse(toolCall.function.arguments);
85
+ if (toolCall.function.name === "search") {
86
+ return args.query;
87
+ }
88
+ return args.path || args.file_path || args.command || "";
89
+ }
90
+ catch {
91
+ return "";
92
+ }
93
+ }
94
+ return "";
95
+ };
96
+ const filePath = getFilePath(entry.toolCall);
97
+ const isExecuting = entry.type === "tool_call" || !entry.toolResult;
98
+ // Format JSON content for better readability
99
+ const formatToolContent = (content, toolName) => {
100
+ if (toolName.startsWith("mcp__")) {
101
+ try {
102
+ // Try to parse as JSON and format it
103
+ const parsed = JSON.parse(content);
104
+ if (Array.isArray(parsed)) {
105
+ // For arrays, show a summary instead of full JSON
106
+ return `Found ${parsed.length} items`;
107
+ }
108
+ else if (typeof parsed === 'object') {
109
+ // For objects, show a formatted version
110
+ return JSON.stringify(parsed, null, 2);
111
+ }
112
+ }
113
+ catch {
114
+ // If not JSON, return as is
115
+ return content;
116
+ }
117
+ }
118
+ return content;
119
+ };
120
+ const shouldShowDiff = entry.toolCall?.function?.name === "str_replace_editor" &&
121
+ entry.toolResult?.success &&
122
+ entry.content.includes("Updated") &&
123
+ entry.content.includes("---") &&
124
+ entry.content.includes("+++");
125
+ const shouldShowFileContent = (entry.toolCall?.function?.name === "view_file" ||
126
+ entry.toolCall?.function?.name === "create_file") &&
127
+ entry.toolResult?.success &&
128
+ !shouldShowDiff;
129
+ return (React.createElement(Box, { key: index, flexDirection: "column", marginTop: 1 },
130
+ React.createElement(Box, null,
131
+ React.createElement(Text, { color: "magenta" }, "\u23FA"),
132
+ React.createElement(Text, { color: "white" },
133
+ " ",
134
+ filePath ? `${actionName}(${filePath})` : actionName)),
135
+ React.createElement(Box, { marginLeft: 2, flexDirection: "column" }, isExecuting ? (React.createElement(Text, { color: "cyan" }, "\u23BF Executing...")) : shouldShowFileContent ? (React.createElement(Box, { flexDirection: "column" },
136
+ React.createElement(Text, { color: "gray" }, "\u23BF File contents:"),
137
+ React.createElement(Box, { marginLeft: 2, flexDirection: "column" }, renderFileContent(entry.content)))) : shouldShowDiff ? (
138
+ // For diff results, show only the summary line, not the raw content
139
+ React.createElement(Text, { color: "gray" },
140
+ "\u23BF ",
141
+ entry.content.split("\n")[0])) : (React.createElement(Text, { color: "gray" },
142
+ "\u23BF ",
143
+ formatToolContent(entry.content, toolName)))),
144
+ shouldShowDiff && !isExecuting && (React.createElement(Box, { marginLeft: 4, flexDirection: "column" }, renderDiff(entry.content, filePath)))));
145
+ default:
146
+ return null;
147
+ }
148
+ });
149
+ MemoizedChatEntry.displayName = "MemoizedChatEntry";
150
+ export function ChatHistory({ entries, isConfirmationActive = false, }) {
151
+ // Filter out tool_call entries with "Executing..." when confirmation is active
152
+ const filteredEntries = isConfirmationActive
153
+ ? entries.filter((entry) => !(entry.type === "tool_call" && entry.content === "Executing..."))
154
+ : entries;
155
+ return (React.createElement(Box, { flexDirection: "column" }, filteredEntries.slice(-20).map((entry, index) => (React.createElement(MemoizedChatEntry, { key: `${entry.timestamp.getTime()}-${index}`, entry: entry, index: index })))));
156
+ }
157
+ //# sourceMappingURL=chat-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-history.js","sourceRoot":"","sources":["../../../src/ui/components/chat-history.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MA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AI,KAAK,EAAE,EAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACZ,CACH,CAAC,CACE,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface ChatInputProps {
3
+ input: string;
4
+ cursorPosition: number;
5
+ isProcessing: boolean;
6
+ isStreaming: boolean;
7
+ }
8
+ export declare function ChatInput({ input, cursorPosition, isProcessing, isStreaming, }: ChatInputProps): React.JSX.Element;
9
+ export {};