karajan-code 1.11.0 → 1.11.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.
package/README.md CHANGED
@@ -30,7 +30,7 @@ Instead of running one AI agent and manually reviewing its output, `kj` chains a
30
30
  **Key features:**
31
31
  - **Multi-agent pipeline** with 11 configurable roles
32
32
  - **4 AI agents supported**: Claude, Codex, Gemini, Aider
33
- - **MCP server** with 11 tools — use `kj` from Claude, Codex, or any MCP-compatible host without leaving your agent. [See MCP setup](#mcp-server)
33
+ - **MCP server** with 15 tools — use `kj` from Claude, Codex, or any MCP-compatible host without leaving your agent. [See MCP setup](#mcp-server)
34
34
  - **TDD enforcement** — test changes required when source files change
35
35
  - **SonarQube integration** — static analysis with quality gate enforcement (requires [Docker](#requirements))
36
36
  - **Review profiles** — standard, strict, relaxed, paranoid
@@ -44,6 +44,9 @@ Instead of running one AI agent and manually reviewing its output, `kj` chains a
44
44
  - **Retry with backoff** — automatic recovery from transient API errors (429, 5xx) with exponential backoff and jitter
45
45
  - **Pipeline stage tracker** — cumulative progress view during `kj_run` showing which stages are done, running, or pending — both in CLI and via MCP events for real-time host rendering
46
46
  - **Planner observability guardrails** — continuous heartbeat/stall telemetry, configurable max-silence protection (`session.max_agent_silence_minutes`), and hard runtime cap (`session.max_planner_minutes`) to avoid long stuck planner runs
47
+ - **Rate-limit standby** — when agents hit rate limits, Karajan parses cooldown times, waits with exponential backoff, and auto-resumes instead of failing
48
+ - **Preflight handshake** — `kj_preflight` requires human confirmation of agent assignments before execution, preventing AI from silently overriding your config
49
+ - **3-tier config** — session > project > global config layering with `kj_agents` scoping
47
50
  - **Planning Game integration** — optionally pair with [Planning Game](https://github.com/AgenteIA-Geniova/planning-game) for agile project management (tasks, sprints, estimation) — like Jira, but open-source and XP-native
48
51
 
49
52
  > **Best with MCP** — Karajan Code is designed to be used as an MCP server inside your AI agent (Claude, Codex, etc.). The agent sends tasks to `kj_run`, gets real-time progress notifications, and receives structured results — no copy-pasting needed.
@@ -62,16 +65,16 @@ triage? ─> researcher? ─> planner? ─> coder ─> refactorer? ─> sonar?
62
65
 
63
66
  | Role | Description | Default |
64
67
  |------|-------------|---------|
65
- | **triage** | Classifies task complexity (trivial/simple/medium/complex) and activates only necessary roles | Off |
68
+ | **triage** | Pipeline director — analyzes task complexity and activates roles dynamically | **On** |
66
69
  | **researcher** | Investigates codebase context before planning | Off |
67
70
  | **planner** | Generates structured implementation plans | Off |
68
71
  | **coder** | Writes code and tests following TDD methodology | **Always on** |
69
72
  | **refactorer** | Improves code clarity without changing behavior | Off |
70
73
  | **sonar** | Runs SonarQube static analysis and quality gate checks | On (if configured) |
71
74
  | **reviewer** | Code review with configurable strictness profiles | **Always on** |
72
- | **tester** | Test quality gate and coverage verification | Off |
73
- | **security** | OWASP security audit | Off |
74
- | **solomon** | Conflict resolver when coder and reviewer disagree | Off |
75
+ | **tester** | Test quality gate and coverage verification | **On** |
76
+ | **security** | OWASP security audit | **On** |
77
+ | **solomon** | Session supervisor monitors iteration health with 4 rules, escalates on anomalies | **On** |
75
78
  | **commiter** | Git commit, push, and PR automation after approval | Off |
76
79
 
77
80
  Roles marked with `?` are optional and can be enabled per-run or via config.
@@ -272,6 +275,16 @@ Resume a paused session (e.g., after fail-fast).
272
275
  kj resume s_2026-02-28T20-47-24-270Z --answer "yes, proceed with the fix"
273
276
  ```
274
277
 
278
+ ### `kj agents`
279
+
280
+ List or change AI agent assignments per role.
281
+
282
+ ```bash
283
+ kj agents # List current agents (with scope column)
284
+ kj agents set coder gemini # Set coder to gemini (project scope)
285
+ kj agents set reviewer claude --global # Set reviewer globally
286
+ ```
287
+
275
288
  ### `kj roles`
276
289
 
277
290
  Inspect pipeline roles and their template instructions.
@@ -416,9 +429,12 @@ After `npm install -g karajan-code`, the MCP server is auto-registered in Claude
416
429
  | `kj_resume` | Resume a paused session |
417
430
  | `kj_report` | Read session reports (supports `--trace`) |
418
431
  | `kj_roles` | List roles or show role templates |
419
- | `kj_code` | Run coder-only mode |
420
- | `kj_review` | Run reviewer-only mode |
421
- | `kj_plan` | Generate implementation plan with heartbeat/stall telemetry and clearer diagnostics |
432
+ | `kj_agents` | List or change agent assignments (session/project/global scope) |
433
+ | `kj_preflight` | Human confirms agent config before kj_run/kj_code executes |
434
+ | `kj_code` | Run coder-only mode (with progress notifications) |
435
+ | `kj_review` | Run reviewer-only mode (with progress notifications) |
436
+ | `kj_plan` | Generate implementation plan (with progress notifications) |
437
+ | `kj_status` | Live parsed status of current run (stage, agent, iteration, errors) |
422
438
 
423
439
  ### MCP restart after version updates
424
440
 
@@ -461,7 +477,7 @@ Use `kj roles show <role>` to inspect any template. Create a project override to
461
477
  git clone https://github.com/manufosela/karajan-code.git
462
478
  cd karajan-code
463
479
  npm install
464
- npm test # Run 1040+ tests with Vitest
480
+ npm test # Run 1180+ tests with Vitest
465
481
  npm run test:watch # Watch mode
466
482
  npm run validate # Lint + test
467
483
  ```
package/docs/README.es.md CHANGED
@@ -30,7 +30,7 @@ En lugar de ejecutar un agente de IA y revisar manualmente su output, `kj` encad
30
30
  **Caracteristicas principales:**
31
31
  - **Pipeline multi-agente** con 11 roles configurables
32
32
  - **4 agentes de IA soportados**: Claude, Codex, Gemini, Aider
33
- - **Servidor MCP** con 11 herramientas — usa `kj` desde Claude, Codex o cualquier host compatible con MCP sin salir de tu agente. [Ver configuracion MCP](#servidor-mcp)
33
+ - **Servidor MCP** con 15 herramientas — usa `kj` desde Claude, Codex o cualquier host compatible con MCP sin salir de tu agente. [Ver configuracion MCP](#servidor-mcp)
34
34
  - **TDD obligatorio** — se exigen cambios en tests cuando se modifican ficheros fuente
35
35
  - **Integracion con SonarQube** — analisis estatico con quality gates (requiere [Docker](#requisitos))
36
36
  - **Perfiles de revision** — standard, strict, relaxed, paranoid
@@ -43,6 +43,9 @@ En lugar de ejecutar un agente de IA y revisar manualmente su output, `kj` encad
43
43
  - **Retry con backoff** — recuperacion automatica ante errores transitorios de API (429, 5xx) con backoff exponencial y jitter
44
44
  - **Pipeline stage tracker** — vista de progreso acumulativo durante `kj_run` mostrando que stages estan completadas, en ejecucion o pendientes — tanto en CLI como via eventos MCP para renderizado en tiempo real en el host
45
45
  - **Guardarrailes de observabilidad del planner** — telemetria continua de heartbeat/stall, proteccion configurable por silencio maximo (`session.max_agent_silence_minutes`) y limite duro de ejecucion (`session.max_planner_minutes`) para evitar bloqueos prolongados en `kj_plan`/planner
46
+ - **Standby por rate-limit** — cuando un agente alcanza limites de uso, Karajan parsea el tiempo de espera, espera con backoff exponencial y reanuda automaticamente en vez de fallar
47
+ - **Preflight handshake** — `kj_preflight` requiere confirmacion humana de la configuracion de agentes antes de ejecutar, previniendo que la IA cambie asignaciones silenciosamente
48
+ - **Config de 3 niveles** — sesion > proyecto > global con scoping de `kj_agents`
46
49
  - **Integracion con Planning Game** — combina opcionalmente con [Planning Game](https://github.com/AgenteIA-Geniova/planning-game) para gestion agil de proyectos (tareas, sprints, estimacion) — como Jira, pero open-source y nativo XP
47
50
 
48
51
  > **Mejor con MCP** — Karajan Code esta disenado para usarse como servidor MCP dentro de tu agente de IA (Claude, Codex, etc.). El agente envia tareas a `kj_run`, recibe notificaciones de progreso en tiempo real, y obtiene resultados estructurados — sin copiar y pegar.
@@ -61,16 +64,16 @@ triage? ─> researcher? ─> planner? ─> coder ─> refactorer? ─> sonar?
61
64
 
62
65
  | Rol | Descripcion | Por defecto |
63
66
  |-----|-------------|-------------|
64
- | **triage** | Clasifica la complejidad de la tarea (trivial/simple/media/compleja) y activa solo los roles necesarios | Off |
67
+ | **triage** | Director de pipeline analiza la complejidad y activa roles dinamicamente | **On** |
65
68
  | **researcher** | Investiga el contexto del codebase antes de planificar | Off |
66
69
  | **planner** | Genera planes de implementacion estructurados | Off |
67
70
  | **coder** | Escribe codigo y tests siguiendo metodologia TDD | **Siempre activo** |
68
71
  | **refactorer** | Mejora la claridad del codigo sin cambiar comportamiento | Off |
69
72
  | **sonar** | Ejecuta analisis estatico SonarQube y quality gates | On (si configurado) |
70
73
  | **reviewer** | Revision de codigo con perfiles de exigencia configurables | **Siempre activo** |
71
- | **tester** | Quality gate de tests y verificacion de cobertura | Off |
72
- | **security** | Auditoria de seguridad OWASP | Off |
73
- | **solomon** | Resolutor de conflictos cuando coder y reviewer discrepan | Off |
74
+ | **tester** | Quality gate de tests y verificacion de cobertura | **On** |
75
+ | **security** | Auditoria de seguridad OWASP | **On** |
76
+ | **solomon** | Supervisor de sesion monitoriza salud de iteraciones con 4 reglas, escala ante anomalias | **On** |
74
77
  | **commiter** | Automatizacion de git commit, push y PR tras aprobacion | Off |
75
78
 
76
79
  Los roles marcados con `?` son opcionales y se pueden activar por ejecucion o via config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karajan-code",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "Local multi-agent coding orchestrator with TDD, SonarQube, and code review pipeline",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -101,10 +101,20 @@ function pickOutput(res) {
101
101
  return res.stdout || res.stderr || "";
102
102
  }
103
103
 
104
+ /**
105
+ * Default tools to allow for Claude subprocess.
106
+ * Since claude -p runs non-interactively (stdin: "ignore"), it cannot ask for
107
+ * permission approval. Without --allowedTools, it blocks waiting for approval
108
+ * that never comes.
109
+ */
110
+ const ALLOWED_TOOLS = [
111
+ "Read", "Write", "Edit", "Bash", "Glob", "Grep"
112
+ ];
113
+
104
114
  export class ClaudeAgent extends BaseAgent {
105
115
  async runTask(task) {
106
116
  const role = task.role || "coder";
107
- const args = ["-p", task.prompt];
117
+ const args = ["-p", task.prompt, "--allowedTools", ...ALLOWED_TOOLS];
108
118
  const model = this.getRoleModel(role);
109
119
  if (model) args.push("--model", model);
110
120
 
@@ -131,7 +141,7 @@ export class ClaudeAgent extends BaseAgent {
131
141
  }
132
142
 
133
143
  async reviewTask(task) {
134
- const args = ["-p", task.prompt, "--output-format", "stream-json"];
144
+ const args = ["-p", task.prompt, "--allowedTools", ...ALLOWED_TOOLS, "--output-format", "stream-json"];
135
145
  const model = this.getRoleModel(task.role || "reviewer");
136
146
  if (model) args.push("--model", model);
137
147
  const res = await runCommand(resolveBin("claude"), args, cleanExecaOpts({