agentk8 1.0.4 → 2.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.
package/package.json CHANGED
@@ -1,49 +1,38 @@
1
1
  {
2
2
  "name": "agentk8",
3
- "version": "1.0.4",
4
- "description": "Multi-Agent Claude Code Terminal Suite - Orchestrate multiple Claude agents for software development and ML research",
5
- "keywords": [
6
- "claude",
7
- "claude-code",
8
- "ai",
9
- "agents",
10
- "multi-agent",
11
- "llm",
12
- "cli",
13
- "terminal",
14
- "developer-tools",
15
- "ml",
16
- "machine-learning"
17
- ],
18
- "author": "Aditya Katiyar",
19
- "license": "MIT",
20
- "homepage": "https://github.com/de5truct0/agentk#readme",
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/de5truct0/agentk.git"
24
- },
25
- "bugs": {
26
- "url": "https://github.com/de5truct0/agentk/issues"
27
- },
3
+ "version": "2.0.0",
4
+ "description": "Multi-Agent Claude Code Terminal Suite",
5
+ "type": "module",
6
+ "main": "dist/index.js",
28
7
  "bin": {
29
- "agentk": "./bin/agentk-wrapper.js"
8
+ "agentk": "dist/cli.js"
30
9
  },
31
10
  "files": [
32
- "bin/",
33
- "lib/",
34
- "modes/",
35
- "agentk"
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
36
14
  ],
37
15
  "scripts": {
38
- "postinstall": "node bin/postinstall.js",
39
- "test": "echo \"Tests not implemented yet\" && exit 0"
16
+ "build": "tsc",
17
+ "dev": "tsx src/cli.tsx",
18
+ "start": "node dist/cli.js",
19
+ "prepublishOnly": "npm run build"
40
20
  },
41
- "engines": {
42
- "node": ">=14.0.0"
21
+ "keywords": ["claude", "ai", "agents", "multi-agent", "cli", "terminal"],
22
+ "author": "Aditya Katiyar",
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "ink": "^5.0.1",
26
+ "ink-text-input": "^6.0.0",
27
+ "react": "^18.2.0",
28
+ "chalk": "^5.3.0",
29
+ "meow": "^13.0.0"
43
30
  },
44
- "os": [
45
- "darwin",
46
- "linux"
47
- ],
48
- "preferGlobal": true
31
+ "devDependencies": {
32
+ "@types/node": "^20.0.0",
33
+ "@types/react": "^18.2.0",
34
+ "@types/figlet": "^1.5.8",
35
+ "typescript": "^5.0.0",
36
+ "tsx": "^4.0.0"
37
+ }
49
38
  }
package/agentk DELETED
@@ -1,497 +0,0 @@
1
- #!/usr/bin/env bash
2
- # AGENT-K - Multi-Agent Claude Code Terminal Suite
3
- # Main entry point CLI
4
-
5
- set -euo pipefail
6
-
7
- # =============================================================================
8
- # INITIALIZATION
9
- # =============================================================================
10
-
11
- _AGENTK_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
- export AGENTK_ROOT="$_AGENTK_SCRIPT_DIR"
13
-
14
- # Source libraries (use AGENTK_ROOT to avoid variable scope issues)
15
- source "$AGENTK_ROOT/lib/core.sh"
16
- source "$AGENTK_ROOT/lib/ui.sh"
17
- source "$AGENTK_ROOT/lib/ipc.sh"
18
- source "$AGENTK_ROOT/lib/spawn.sh"
19
-
20
- # =============================================================================
21
- # CONFIGURATION
22
- # =============================================================================
23
-
24
- # Default mode
25
- AGENTK_MODE="${AGENTK_MODE:-dev}"
26
- VISUAL_MODE=false
27
- ONE_SHOT=false
28
- ONE_SHOT_PROMPT=""
29
- FOCUSED_AGENT=""
30
-
31
- # =============================================================================
32
- # USAGE
33
- # =============================================================================
34
-
35
- show_usage() {
36
- cat <<EOF
37
- ${BOLD}AGENT-K${RESET} - Multi-Agent Claude Code Terminal Suite
38
-
39
- ${BOLD}USAGE:${RESET}
40
- agentk Start interactive session (dev mode)
41
- agentk --mode ml Start ML research & training mode
42
- agentk --visual Start with tmux visual panels
43
- agentk -c "prompt" One-shot mode (run task, exit)
44
-
45
- ${BOLD}OPTIONS:${RESET}
46
- -m, --mode <mode> Set mode: dev (default) or ml
47
- -v, --visual Enable tmux visual mode
48
- -c, --command <prompt> Run single command and exit
49
- -h, --help Show this help message
50
- --version Show version
51
-
52
- ${BOLD}SESSION COMMANDS:${RESET}
53
- /status Show all agent states
54
- /logs <agent> View agent output
55
- /kill <agent|all> Stop agent(s)
56
- /focus <agent> Talk directly to agent
57
- /unfocus Return to orchestrator
58
- /visual Toggle tmux view
59
- /clear Clear screen
60
- /help Show commands
61
- /exit End session
62
-
63
- ${BOLD}SCOUT COMMANDS:${RESET}
64
- /search <query> Web search
65
- /github <query> Search GitHub
66
- /papers <topic> Search papers (ML mode)
67
- /libs <task> Find libraries
68
- /sota <topic> State-of-the-art
69
-
70
- ${BOLD}ML MODE COMMANDS:${RESET}
71
- /experiment <name> Start experiment
72
- /metrics Show metrics
73
- /tensorboard Open TensorBoard
74
- /huggingface <query> Search HF Hub
75
-
76
- ${BOLD}EXAMPLES:${RESET}
77
- agentk # Start dev mode chat
78
- agentk --mode ml # Start ML mode
79
- agentk -c "Build a REST API" # One-shot task
80
-
81
- EOF
82
- }
83
-
84
- show_version() {
85
- echo "AGENT-K v${AGENTK_VERSION}"
86
- }
87
-
88
- # =============================================================================
89
- # ARGUMENT PARSING
90
- # =============================================================================
91
-
92
- parse_args() {
93
- while [[ $# -gt 0 ]]; do
94
- case "$1" in
95
- -m|--mode)
96
- AGENTK_MODE="$2"
97
- shift 2
98
- ;;
99
- -v|--visual)
100
- VISUAL_MODE=true
101
- shift
102
- ;;
103
- -c|--command)
104
- ONE_SHOT=true
105
- ONE_SHOT_PROMPT="$2"
106
- shift 2
107
- ;;
108
- -h|--help)
109
- show_usage
110
- exit 0
111
- ;;
112
- --version)
113
- show_version
114
- exit 0
115
- ;;
116
- *)
117
- log_error "Unknown option: $1"
118
- show_usage
119
- exit 1
120
- ;;
121
- esac
122
- done
123
-
124
- # Validate mode
125
- if [[ "$AGENTK_MODE" != "dev" && "$AGENTK_MODE" != "ml" ]]; then
126
- log_error "Invalid mode: $AGENTK_MODE (must be 'dev' or 'ml')"
127
- exit 1
128
- fi
129
-
130
- export AGENTK_MODE
131
- }
132
-
133
- # =============================================================================
134
- # SESSION COMMANDS
135
- # =============================================================================
136
-
137
- handle_command() {
138
- local cmd="$1"
139
- local args="${2:-}"
140
-
141
- case "$cmd" in
142
- /status)
143
- cmd_status
144
- ;;
145
- /logs)
146
- cmd_logs "$args"
147
- ;;
148
- /kill)
149
- cmd_kill "$args"
150
- ;;
151
- /focus)
152
- cmd_focus "$args"
153
- ;;
154
- /unfocus)
155
- cmd_unfocus
156
- ;;
157
- /visual)
158
- cmd_visual
159
- ;;
160
- /clear)
161
- clear_screen
162
- print_banner
163
- print_mode_banner "$AGENTK_MODE"
164
- ;;
165
- /help)
166
- print_command_help
167
- print_scout_commands
168
- [[ "$AGENTK_MODE" == "ml" ]] && print_ml_commands
169
- ;;
170
- /exit|/quit)
171
- cmd_exit
172
- ;;
173
- /search|/github|/papers|/libs|/sota|/huggingface)
174
- cmd_scout "$cmd" "$args"
175
- ;;
176
- /experiment|/metrics|/tensorboard|/checkpoint|/compare)
177
- cmd_ml "$cmd" "$args"
178
- ;;
179
- *)
180
- print_error "Unknown command: $cmd"
181
- echo "Type /help for available commands"
182
- ;;
183
- esac
184
- }
185
-
186
- cmd_status() {
187
- print_section "Agent Status"
188
-
189
- local agents
190
- case "$AGENTK_MODE" in
191
- dev) agents="orchestrator engineer tester security scout" ;;
192
- ml) agents="orchestrator researcher ml-engineer data-engineer evaluator scout" ;;
193
- esac
194
-
195
- for agent in $agents; do
196
- local status
197
- status=$(get_agent_status "$agent")
198
- local message=""
199
- local task_id
200
- task_id=$(_get_agent_task "$agent" 2>/dev/null || echo "")
201
-
202
- if [[ -n "$task_id" ]]; then
203
- message=$(get_task_field "$task_id" "prompt" 2>/dev/null | head -c 40)
204
- [[ ${#message} -eq 40 ]] && message="${message}..."
205
- fi
206
-
207
- print_agent_status "$agent" "$status" "$message"
208
- done
209
- echo
210
- }
211
-
212
- cmd_logs() {
213
- local agent="$1"
214
-
215
- if [[ -z "$agent" ]]; then
216
- print_error "Usage: /logs <agent>"
217
- return
218
- fi
219
-
220
- print_section "Logs: $agent"
221
- view_agent_log "$agent" 30
222
- }
223
-
224
- cmd_kill() {
225
- local target="$1"
226
-
227
- if [[ -z "$target" ]]; then
228
- print_error "Usage: /kill <agent|all>"
229
- return
230
- fi
231
-
232
- if [[ "$target" == "all" ]]; then
233
- kill_all_agents
234
- print_success "All agents stopped"
235
- else
236
- kill_agent "$target"
237
- print_success "Agent $target stopped"
238
- fi
239
- }
240
-
241
- cmd_focus() {
242
- local agent="$1"
243
-
244
- if [[ -z "$agent" ]]; then
245
- print_error "Usage: /focus <agent>"
246
- return
247
- fi
248
-
249
- FOCUSED_AGENT="$agent"
250
- print_info "Now talking directly to: $agent"
251
- echo "${DIM}Type /unfocus to return to orchestrator${RESET}"
252
- }
253
-
254
- cmd_unfocus() {
255
- if [[ -z "$FOCUSED_AGENT" ]]; then
256
- print_info "Not focused on any agent"
257
- return
258
- fi
259
-
260
- print_info "Returning to orchestrator"
261
- FOCUSED_AGENT=""
262
- }
263
-
264
- cmd_visual() {
265
- if ! command -v tmux &>/dev/null; then
266
- print_error "tmux is not installed. Install with: brew install tmux"
267
- return
268
- fi
269
-
270
- if [[ "$VISUAL_MODE" == "true" ]]; then
271
- print_info "Disabling visual mode..."
272
- VISUAL_MODE=false
273
- # Would detach from tmux here
274
- else
275
- print_info "Enabling visual mode..."
276
- VISUAL_MODE=true
277
- start_visual_mode
278
- fi
279
- }
280
-
281
- cmd_exit() {
282
- echo
283
- kill_all_agents
284
- print_session_stats
285
- end_session
286
- echo "${GREEN}✦ Goodbye!${RESET}"
287
- echo
288
- exit 0
289
- }
290
-
291
- cmd_scout() {
292
- local cmd="$1"
293
- local query="$2"
294
-
295
- if [[ -z "$query" ]]; then
296
- print_error "Usage: $cmd <query>"
297
- return
298
- fi
299
-
300
- local scout_task="$cmd: $query"
301
-
302
- # Show Scout response box
303
- print_agent_response_start "Scout"
304
- printf "${CYAN}│${RESET} Searching: %s\n" "$query"
305
-
306
- # Create task for scout
307
- local task_id
308
- task_id=$(create_task "" "research" "scout" "$scout_task" 1)
309
-
310
- # Spawn scout agent
311
- spawn_agent "scout" "$task_id" "$AGENTK_MODE"
312
-
313
- # Wait for result
314
- printf "${CYAN}│${RESET} ${DIM}Processing...${RESET}\n"
315
- watch_task "$task_id" 120
316
-
317
- # Display result
318
- local result_file
319
- result_file=$(get_result_file "$task_id")
320
- if [[ -f "$result_file" ]]; then
321
- local output
322
- output=$(jq -r '.output' "$result_file")
323
- print_chat_content "$output" "${CYAN}│${RESET}"
324
- fi
325
-
326
- print_agent_response_end
327
- }
328
-
329
- cmd_ml() {
330
- local cmd="$1"
331
- local args="$2"
332
-
333
- if [[ "$AGENTK_MODE" != "ml" ]]; then
334
- print_error "ML commands only available in ML mode. Use: agentk --mode ml"
335
- return
336
- fi
337
-
338
- case "$cmd" in
339
- /experiment)
340
- print_info "Starting experiment: $args"
341
- # Would create experiment directory and tracking
342
- ;;
343
- /metrics)
344
- print_info "Current metrics:"
345
- # Would display training metrics
346
- ;;
347
- /tensorboard)
348
- print_info "Opening TensorBoard..."
349
- tensorboard --logdir="$AGENTK_WORKSPACE/experiments" &
350
- ;;
351
- *)
352
- print_error "ML command not implemented: $cmd"
353
- ;;
354
- esac
355
- }
356
-
357
- # =============================================================================
358
- # VISUAL MODE (TMUX)
359
- # =============================================================================
360
-
361
- start_visual_mode() {
362
- source "$SCRIPT_DIR/lib/visual.sh" 2>/dev/null || {
363
- print_error "Visual mode library not found"
364
- VISUAL_MODE=false
365
- return
366
- }
367
-
368
- setup_tmux_session "$AGENTK_MODE"
369
- }
370
-
371
- # =============================================================================
372
- # INTERACTIVE LOOP
373
- # =============================================================================
374
-
375
- run_interactive() {
376
- # Initialize workspace
377
- ensure_workspace
378
- check_dependencies
379
-
380
- # Create session
381
- create_session
382
-
383
- # Print banner
384
- clear_screen
385
- print_banner
386
- print_mode_banner "$AGENTK_MODE"
387
-
388
- # Main loop
389
- while true; do
390
- # Show prompt
391
- if [[ -n "$FOCUSED_AGENT" ]]; then
392
- print_focus_prompt "$FOCUSED_AGENT"
393
- else
394
- print_user_prompt
395
- fi
396
-
397
- # Read input with readline support
398
- local input
399
- if ! read -r -e input; then
400
- # EOF (Ctrl+D)
401
- echo
402
- cmd_exit
403
- fi
404
-
405
- # Skip empty input
406
- [[ -z "$input" ]] && continue
407
-
408
- # Add to history
409
- history -s "$input"
410
-
411
- # Check for command
412
- if [[ "$input" == /* ]]; then
413
- local cmd="${input%% *}"
414
- local args="${input#* }"
415
- [[ "$cmd" == "$args" ]] && args=""
416
- handle_command "$cmd" "$args"
417
- continue
418
- fi
419
-
420
- # Show user message in a box
421
- print_user_input_box "$input"
422
-
423
- # Regular input - send to orchestrator (or focused agent)
424
- local target_agent="${FOCUSED_AGENT:-orchestrator}"
425
-
426
- # Show agent response
427
- print_agent_response_start "Orchestrator"
428
- printf "${CYAN}│${RESET} Analyzing task...\n"
429
-
430
- # Create task
431
- local task_id
432
- task_id=$(create_task "" "analyze" "$target_agent" "$input" 1)
433
-
434
- # For now, spawn the agent interactively
435
- spawn_agent_interactive "$target_agent" "$AGENTK_MODE" "$input"
436
-
437
- print_agent_response_end
438
- done
439
- }
440
-
441
- # =============================================================================
442
- # ONE-SHOT MODE
443
- # =============================================================================
444
-
445
- run_one_shot() {
446
- local prompt="$1"
447
-
448
- # Initialize
449
- ensure_workspace
450
- check_dependencies
451
- create_session
452
-
453
- print_banner
454
- print_mode_banner "$AGENTK_MODE"
455
-
456
- # Show user input with chat boundaries
457
- print_user_input_box "$prompt"
458
-
459
- # Create task for orchestrator
460
- local task_id
461
- task_id=$(create_task "" "orchestrate" "orchestrator" "$prompt" 1)
462
-
463
- # Show orchestrator response
464
- print_agent_response_start "Orchestrator"
465
- printf "${CYAN}│${RESET} Processing your request...\n"
466
-
467
- # Spawn orchestrator interactively
468
- spawn_agent_interactive "orchestrator" "$AGENTK_MODE" "$prompt"
469
-
470
- print_agent_response_end
471
-
472
- # Cleanup
473
- end_session
474
- }
475
-
476
- # =============================================================================
477
- # MAIN
478
- # =============================================================================
479
-
480
- main() {
481
- parse_args "$@"
482
-
483
- # Check if running in visual mode from start
484
- if [[ "$VISUAL_MODE" == "true" ]]; then
485
- start_visual_mode
486
- fi
487
-
488
- # One-shot or interactive
489
- if [[ "$ONE_SHOT" == "true" ]]; then
490
- run_one_shot "$ONE_SHOT_PROMPT"
491
- else
492
- run_interactive
493
- fi
494
- }
495
-
496
- # Run
497
- main "$@"
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * AGENT-K npm wrapper
4
- * Executes the bash script with proper paths
5
- */
6
-
7
- const { spawn } = require('child_process');
8
- const path = require('path');
9
-
10
- // Get the path to the actual agentk script
11
- const agentkPath = path.join(__dirname, '..', 'agentk');
12
-
13
- // Set AGENTK_ROOT environment variable
14
- const env = {
15
- ...process.env,
16
- AGENTK_ROOT: path.join(__dirname, '..')
17
- };
18
-
19
- // Spawn the bash script with all arguments
20
- const child = spawn('bash', [agentkPath, ...process.argv.slice(2)], {
21
- stdio: 'inherit',
22
- env
23
- });
24
-
25
- // Handle exit
26
- child.on('exit', (code) => {
27
- process.exit(code || 0);
28
- });
29
-
30
- // Handle errors
31
- child.on('error', (err) => {
32
- console.error('Failed to start agentk:', err.message);
33
- console.error('Make sure bash is installed and in your PATH');
34
- process.exit(1);
35
- });
@@ -1,97 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * AGENT-K npm postinstall script
4
- * Checks dependencies and provides setup instructions
5
- */
6
-
7
- const { execSync } = require('child_process');
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- const GREEN = '\x1b[32m';
12
- const YELLOW = '\x1b[33m';
13
- const RED = '\x1b[31m';
14
- const CYAN = '\x1b[36m';
15
- const RESET = '\x1b[0m';
16
- const BOLD = '\x1b[1m';
17
-
18
- function checkCommand(cmd) {
19
- try {
20
- execSync(`which ${cmd}`, { stdio: 'ignore' });
21
- return true;
22
- } catch {
23
- return false;
24
- }
25
- }
26
-
27
- function main() {
28
- console.log();
29
- console.log(`${CYAN}╭─────────────────────────────────────────────────╮${RESET}`);
30
- console.log(`${CYAN}│${RESET} ${BOLD}AGENT-K Installed${RESET} ${CYAN}│${RESET}`);
31
- console.log(`${CYAN}╰─────────────────────────────────────────────────╯${RESET}`);
32
- console.log();
33
-
34
- // Make scripts executable
35
- const agentkPath = path.join(__dirname, '..', 'agentk');
36
- const libPath = path.join(__dirname, '..', 'lib');
37
-
38
- try {
39
- fs.chmodSync(agentkPath, '755');
40
- fs.readdirSync(libPath).forEach(file => {
41
- if (file.endsWith('.sh')) {
42
- fs.chmodSync(path.join(libPath, file), '755');
43
- }
44
- });
45
- } catch (err) {
46
- console.warn(`${YELLOW}Warning: Could not set executable permissions${RESET}`);
47
- }
48
-
49
- // Check dependencies
50
- console.log('Checking dependencies...');
51
- console.log();
52
-
53
- const deps = [
54
- { name: 'bash', required: true },
55
- { name: 'jq', required: true },
56
- { name: 'claude', required: true, note: 'Claude Code CLI' },
57
- { name: 'tmux', required: false, note: 'for visual mode' }
58
- ];
59
-
60
- let hasIssues = false;
61
-
62
- deps.forEach(dep => {
63
- const installed = checkCommand(dep.name);
64
- const status = installed ? `${GREEN}✓${RESET}` : (dep.required ? `${RED}✗${RESET}` : `${YELLOW}○${RESET}`);
65
- const note = dep.note ? ` (${dep.note})` : '';
66
-
67
- console.log(` ${status} ${dep.name}${note}`);
68
-
69
- if (!installed && dep.required) {
70
- hasIssues = true;
71
- }
72
- });
73
-
74
- console.log();
75
-
76
- if (hasIssues) {
77
- console.log(`${RED}Missing required dependencies!${RESET}`);
78
- console.log();
79
- console.log('Install missing dependencies:');
80
- console.log(' brew install jq # macOS');
81
- console.log(' sudo apt install jq # Linux');
82
- console.log();
83
- console.log('Install Claude Code CLI:');
84
- console.log(' https://claude.ai/code');
85
- console.log();
86
- } else {
87
- console.log(`${GREEN}All required dependencies found!${RESET}`);
88
- console.log();
89
- console.log('Get started:');
90
- console.log(` ${CYAN}agentk${RESET} # Start dev mode`);
91
- console.log(` ${CYAN}agentk --mode ml${RESET} # Start ML mode`);
92
- console.log(` ${CYAN}agentk --help${RESET} # Show all options`);
93
- console.log();
94
- }
95
- }
96
-
97
- main();