closed-loop-cli 1.0.0 → 1.0.1

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.

Potentially problematic release.


This version of closed-loop-cli might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/dist/index.js +31 -13
  2. package/package.json +1 -1
  3. package/src/index.ts +34 -13
package/dist/index.js CHANGED
@@ -42,26 +42,38 @@ const autogenesis_1 = require("./orchestrator/autogenesis");
42
42
  const server_1 = require("./dashboard/server");
43
43
  const telegram_bot_1 = require("./orchestrator/telegram-bot");
44
44
  const task_agent_1 = require("./orchestrator/task-agent");
45
+ const tui_tools_1 = require("./tools/tui-tools");
45
46
  // Phase 3 is initialized
46
47
  // Load environment variables
47
48
  dotenv.config();
48
49
  function printHeader() {
49
- console.log('\x1b[35m%s\x1b[0m', '==================================================');
50
- console.log('\x1b[36m%s\x1b[0m', ' Closed-Loop Self-Developing Coding CLI ');
51
- console.log('\x1b[35m%s\x1b[0m', '==================================================');
52
- console.log('Using endpoint: ' + (process.env.ANTHROPIC_BASE_URL || 'default anthropic'));
53
- console.log('Main Model: ' + (process.env.ANTHROPIC_MODEL || 'mimo-v2.5-pro[1m]'));
54
- console.log('Subagent Model: ' + (process.env.CLAUDE_CODE_SUBAGENT_MODEL || 'mimo-v2.5-pro'));
55
- console.log('Type a task to begin, or type "exit" to quit.\n');
50
+ const endpoint = process.env.ANTHROPIC_BASE_URL || 'default';
51
+ const model = process.env.ANTHROPIC_MODEL || 'mimo-v2.5-pro[1m]';
52
+ const subagent = process.env.CLAUDE_CODE_SUBAGENT_MODEL || 'mimo-v2.5-pro';
53
+ const padRaw = (label, value) => {
54
+ let valStr = value;
55
+ if (valStr.length > 48) {
56
+ valStr = valStr.substring(0, 45) + '...';
57
+ }
58
+ const visibleText = ` ${label} ❯ ${valStr}`;
59
+ const padding = ' '.repeat(Math.max(0, 65 - visibleText.length));
60
+ return ` \x1b[38;5;86m${label}\x1b[0m \x1b[90m❯\x1b[0m \x1b[38;5;153m${valStr}\x1b[0m${padding}`;
61
+ };
62
+ console.log('\x1b[38;5;99m╭──────────────────────────────────────────────────────────────────╮\x1b[0m');
63
+ console.log('\x1b[38;5;99m│\x1b[0m \x1b[1;38;5;159m🤖 Closed-Loop Conversational Agent CLI\x1b[0m \x1b[38;5;99m│\x1b[0m');
64
+ console.log('\x1b[38;5;99m├──────────────────────────────────────────────────────────────────┤\x1b[0m');
65
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Endpoint', endpoint) + '\x1b[38;5;99m│\x1b[0m');
66
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Model ', model) + '\x1b[38;5;99m│\x1b[0m');
67
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Subagent', subagent) + '\x1b[38;5;99m│\x1b[0m');
68
+ console.log('\x1b[38;5;99m╰──────────────────────────────────────────────────────────────────╯\x1b[0m\n');
69
+ console.log('\x1b[90m💡 Type your task to begin, or type "exit" to quit.\x1b[0m\n');
56
70
  }
57
71
  async function startInteractiveCLI(effort = 'standard', codeactMode = false) {
58
72
  printHeader();
59
- console.log('\x1b[33m%s\x1b[0m', '--- CLAUDE CODE INTERACTIVE MODE (Conversational CLI) ---');
60
- console.log('Conversation history is maintained. Type "exit" or "quit" to leave.\n');
61
73
  const rl = readline.createInterface({
62
74
  input: process.stdin,
63
75
  output: process.stdout,
64
- prompt: '\x1b[35mClaudeCode > \x1b[0m'
76
+ prompt: '\x1b[38;5;99mclosed-loop\x1b[0m \x1b[38;5;86m❯\x1b[0m '
65
77
  });
66
78
  const history = [];
67
79
  rl.prompt();
@@ -72,28 +84,34 @@ async function startInteractiveCLI(effort = 'standard', codeactMode = false) {
72
84
  return;
73
85
  }
74
86
  if (input.toLowerCase() === 'exit' || input.toLowerCase() === 'quit') {
75
- console.log('Goodbye!');
87
+ console.log('\x1b[90mGoodbye!\x1b[0m');
76
88
  process.exit(0);
77
89
  }
78
90
  rl.pause(); // Pause standard input while agent runs
91
+ const spinner = new tui_tools_1.Spinner('Thinking...');
92
+ spinner.start();
79
93
  try {
80
94
  const response = await (0, task_agent_1.runTaskAgent)(input, {
81
95
  role: 'coder_codeact', // Coder with command execution tools
82
96
  effort,
83
97
  history: history
84
98
  });
99
+ spinner.stop(true, 'Done!');
85
100
  // Update history
86
101
  history.push({ role: 'user', content: input });
87
102
  history.push({ role: 'assistant', content: response.result });
88
- console.log(`\n\x1b[32m[Claude Code Response]:\x1b[0m\n${response.result}\n`);
103
+ console.log(`\n\x1b[38;5;86m╭── Agent Response ─────────────────────────────────────────────────────────────╮\x1b[0m`);
104
+ console.log(response.result);
105
+ console.log(`\x1b[38;5;86m╰───────────────────────────────────────────────────────────────────────────────╯\x1b[0m\n`);
89
106
  }
90
107
  catch (err) {
108
+ spinner.stop(false, 'Failed');
91
109
  console.error('\n\x1b[31m[Agent Error]:\x1b[0m', err.message);
92
110
  }
93
111
  rl.resume();
94
112
  rl.prompt();
95
113
  }).on('close', () => {
96
- console.log('\nGoodbye!');
114
+ console.log('\n\x1b[90mGoodbye!\x1b[0m');
97
115
  process.exit(0);
98
116
  });
99
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "closed-loop-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Self-Developing Multi-Agent CLI Coding Assistant",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import { AutogenesisEngine } from './orchestrator/autogenesis';
7
7
  import { startDashboardServer } from './dashboard/server';
8
8
  import { startTelegramBot } from './orchestrator/telegram-bot';
9
9
  import { runTaskAgent } from './orchestrator/task-agent';
10
+ import { Spinner } from './tools/tui-tools';
10
11
 
11
12
  // Phase 3 is initialized
12
13
 
@@ -14,24 +15,37 @@ import { runTaskAgent } from './orchestrator/task-agent';
14
15
  dotenv.config();
15
16
 
16
17
  function printHeader() {
17
- console.log('\x1b[35m%s\x1b[0m', '==================================================');
18
- console.log('\x1b[36m%s\x1b[0m', ' Closed-Loop Self-Developing Coding CLI ');
19
- console.log('\x1b[35m%s\x1b[0m', '==================================================');
20
- console.log('Using endpoint: ' + (process.env.ANTHROPIC_BASE_URL || 'default anthropic'));
21
- console.log('Main Model: ' + (process.env.ANTHROPIC_MODEL || 'mimo-v2.5-pro[1m]'));
22
- console.log('Subagent Model: ' + (process.env.CLAUDE_CODE_SUBAGENT_MODEL || 'mimo-v2.5-pro'));
23
- console.log('Type a task to begin, or type "exit" to quit.\n');
18
+ const endpoint = process.env.ANTHROPIC_BASE_URL || 'default';
19
+ const model = process.env.ANTHROPIC_MODEL || 'mimo-v2.5-pro[1m]';
20
+ const subagent = process.env.CLAUDE_CODE_SUBAGENT_MODEL || 'mimo-v2.5-pro';
21
+
22
+ const padRaw = (label: string, value: string) => {
23
+ let valStr = value;
24
+ if (valStr.length > 48) {
25
+ valStr = valStr.substring(0, 45) + '...';
26
+ }
27
+ const visibleText = ` ${label} ❯ ${valStr}`;
28
+ const padding = ' '.repeat(Math.max(0, 65 - visibleText.length));
29
+ return ` \x1b[38;5;86m${label}\x1b[0m \x1b[90m❯\x1b[0m \x1b[38;5;153m${valStr}\x1b[0m${padding}`;
30
+ };
31
+
32
+ console.log('\x1b[38;5;99m╭──────────────────────────────────────────────────────────────────╮\x1b[0m');
33
+ console.log('\x1b[38;5;99m│\x1b[0m \x1b[1;38;5;159m🤖 Closed-Loop Conversational Agent CLI\x1b[0m \x1b[38;5;99m│\x1b[0m');
34
+ console.log('\x1b[38;5;99m├──────────────────────────────────────────────────────────────────┤\x1b[0m');
35
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Endpoint', endpoint) + '\x1b[38;5;99m│\x1b[0m');
36
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Model ', model) + '\x1b[38;5;99m│\x1b[0m');
37
+ console.log('\x1b[38;5;99m│\x1b[0m' + padRaw('Subagent', subagent) + '\x1b[38;5;99m│\x1b[0m');
38
+ console.log('\x1b[38;5;99m╰──────────────────────────────────────────────────────────────────╯\x1b[0m\n');
39
+ console.log('\x1b[90m💡 Type your task to begin, or type "exit" to quit.\x1b[0m\n');
24
40
  }
25
41
 
26
42
  async function startInteractiveCLI(effort: 'standard' | 'ultracode' = 'standard', codeactMode = false) {
27
43
  printHeader();
28
- console.log('\x1b[33m%s\x1b[0m', '--- CLAUDE CODE INTERACTIVE MODE (Conversational CLI) ---');
29
- console.log('Conversation history is maintained. Type "exit" or "quit" to leave.\n');
30
44
 
31
45
  const rl = readline.createInterface({
32
46
  input: process.stdin,
33
47
  output: process.stdout,
34
- prompt: '\x1b[35mClaudeCode > \x1b[0m'
48
+ prompt: '\x1b[38;5;99mclosed-loop\x1b[0m \x1b[38;5;86m❯\x1b[0m '
35
49
  });
36
50
 
37
51
  const history: any[] = [];
@@ -45,11 +59,13 @@ async function startInteractiveCLI(effort: 'standard' | 'ultracode' = 'standard'
45
59
  }
46
60
 
47
61
  if (input.toLowerCase() === 'exit' || input.toLowerCase() === 'quit') {
48
- console.log('Goodbye!');
62
+ console.log('\x1b[90mGoodbye!\x1b[0m');
49
63
  process.exit(0);
50
64
  }
51
65
 
52
66
  rl.pause(); // Pause standard input while agent runs
67
+ const spinner = new Spinner('Thinking...');
68
+ spinner.start();
53
69
  try {
54
70
  const response = await runTaskAgent(input, {
55
71
  role: 'coder_codeact' as any, // Coder with command execution tools
@@ -57,18 +73,23 @@ async function startInteractiveCLI(effort: 'standard' | 'ultracode' = 'standard'
57
73
  history: history
58
74
  });
59
75
 
76
+ spinner.stop(true, 'Done!');
77
+
60
78
  // Update history
61
79
  history.push({ role: 'user', content: input });
62
80
  history.push({ role: 'assistant', content: response.result });
63
81
 
64
- console.log(`\n\x1b[32m[Claude Code Response]:\x1b[0m\n${response.result}\n`);
82
+ console.log(`\n\x1b[38;5;86m╭── Agent Response ─────────────────────────────────────────────────────────────╮\x1b[0m`);
83
+ console.log(response.result);
84
+ console.log(`\x1b[38;5;86m╰───────────────────────────────────────────────────────────────────────────────╯\x1b[0m\n`);
65
85
  } catch (err: any) {
86
+ spinner.stop(false, 'Failed');
66
87
  console.error('\n\x1b[31m[Agent Error]:\x1b[0m', err.message);
67
88
  }
68
89
  rl.resume();
69
90
  rl.prompt();
70
91
  }).on('close', () => {
71
- console.log('\nGoodbye!');
92
+ console.log('\n\x1b[90mGoodbye!\x1b[0m');
72
93
  process.exit(0);
73
94
  });
74
95
  }