karajan-code 1.6.0 → 1.6.2
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 +1 -1
- package/src/agents/aider-agent.js +2 -4
- package/src/agents/claude-agent.js +2 -4
- package/src/agents/codex-agent.js +2 -4
- package/src/agents/gemini-agent.js +2 -4
- package/src/cli.js +1 -1
- package/src/commands/init.js +24 -25
package/package.json
CHANGED
|
@@ -4,22 +4,20 @@ import { resolveBin } from "./resolve-bin.js";
|
|
|
4
4
|
|
|
5
5
|
export class AiderAgent extends BaseAgent {
|
|
6
6
|
async runTask(task) {
|
|
7
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
8
7
|
const role = task.role || "coder";
|
|
9
8
|
const args = ["--yes", "--message", task.prompt];
|
|
10
9
|
const model = this.getRoleModel(role);
|
|
11
10
|
if (model) args.push("--model", model);
|
|
12
|
-
const res = await runCommand(resolveBin("aider"), args, {
|
|
11
|
+
const res = await runCommand(resolveBin("aider"), args, { onOutput: task.onOutput });
|
|
13
12
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
async reviewTask(task) {
|
|
17
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
18
16
|
const role = task.role || "reviewer";
|
|
19
17
|
const args = ["--yes", "--message", task.prompt];
|
|
20
18
|
const model = this.getRoleModel(role);
|
|
21
19
|
if (model) args.push("--model", model);
|
|
22
|
-
const res = await runCommand(resolveBin("aider"), args, {
|
|
20
|
+
const res = await runCommand(resolveBin("aider"), args, { onOutput: task.onOutput });
|
|
23
21
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
24
22
|
}
|
|
25
23
|
}
|
|
@@ -4,21 +4,19 @@ import { resolveBin } from "./resolve-bin.js";
|
|
|
4
4
|
|
|
5
5
|
export class ClaudeAgent extends BaseAgent {
|
|
6
6
|
async runTask(task) {
|
|
7
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
8
7
|
const role = task.role || "coder";
|
|
9
8
|
const args = ["-p", task.prompt];
|
|
10
9
|
const model = this.getRoleModel(role);
|
|
11
10
|
if (model) args.push("--model", model);
|
|
12
|
-
const res = await runCommand(resolveBin("claude"), args, {
|
|
11
|
+
const res = await runCommand(resolveBin("claude"), args, { onOutput: task.onOutput });
|
|
13
12
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
async reviewTask(task) {
|
|
17
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
18
16
|
const args = ["-p", task.prompt, "--output-format", "json"];
|
|
19
17
|
const model = this.getRoleModel(task.role || "reviewer");
|
|
20
18
|
if (model) args.push("--model", model);
|
|
21
|
-
const res = await runCommand(resolveBin("claude"), args, {
|
|
19
|
+
const res = await runCommand(resolveBin("claude"), args, { onOutput: task.onOutput });
|
|
22
20
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
23
21
|
}
|
|
24
22
|
}
|
|
@@ -4,24 +4,22 @@ import { resolveBin } from "./resolve-bin.js";
|
|
|
4
4
|
|
|
5
5
|
export class CodexAgent extends BaseAgent {
|
|
6
6
|
async runTask(task) {
|
|
7
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
8
7
|
const role = task.role || "coder";
|
|
9
8
|
const args = ["exec"];
|
|
10
9
|
const model = this.getRoleModel(role);
|
|
11
10
|
if (model) args.push("--model", model);
|
|
12
11
|
if (this.isAutoApproveEnabled(role)) args.push("--full-auto");
|
|
13
12
|
args.push(task.prompt);
|
|
14
|
-
const res = await runCommand(resolveBin("codex"), args, {
|
|
13
|
+
const res = await runCommand(resolveBin("codex"), args, { onOutput: task.onOutput });
|
|
15
14
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
async reviewTask(task) {
|
|
19
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
20
18
|
const args = ["exec"];
|
|
21
19
|
const model = this.getRoleModel(task.role || "reviewer");
|
|
22
20
|
if (model) args.push("--model", model);
|
|
23
21
|
args.push(task.prompt);
|
|
24
|
-
const res = await runCommand(resolveBin("codex"), args, {
|
|
22
|
+
const res = await runCommand(resolveBin("codex"), args, { onOutput: task.onOutput });
|
|
25
23
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
26
24
|
}
|
|
27
25
|
}
|
|
@@ -4,22 +4,20 @@ import { resolveBin } from "./resolve-bin.js";
|
|
|
4
4
|
|
|
5
5
|
export class GeminiAgent extends BaseAgent {
|
|
6
6
|
async runTask(task) {
|
|
7
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
8
7
|
const role = task.role || "coder";
|
|
9
8
|
const args = ["-p", task.prompt];
|
|
10
9
|
const model = this.getRoleModel(role);
|
|
11
10
|
if (model) args.push("--model", model);
|
|
12
|
-
const res = await runCommand(resolveBin("gemini"), args, {
|
|
11
|
+
const res = await runCommand(resolveBin("gemini"), args, { onOutput: task.onOutput });
|
|
13
12
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
async reviewTask(task) {
|
|
17
|
-
const timeout = this.config.session.max_iteration_minutes * 60 * 1000;
|
|
18
16
|
const role = task.role || "reviewer";
|
|
19
17
|
const args = ["-p", task.prompt, "--output-format", "json"];
|
|
20
18
|
const model = this.getRoleModel(role);
|
|
21
19
|
if (model) args.push("--model", model);
|
|
22
|
-
const res = await runCommand(resolveBin("gemini"), args, {
|
|
20
|
+
const res = await runCommand(resolveBin("gemini"), args, { onOutput: task.onOutput });
|
|
23
21
|
return { ok: res.exitCode === 0, output: res.stdout, error: res.stderr, exitCode: res.exitCode };
|
|
24
22
|
}
|
|
25
23
|
}
|
package/src/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ async function withConfig(commandName, flags, fn) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const program = new Command();
|
|
27
|
-
program.name("kj").description("Karajan Code CLI").version("1.6.
|
|
27
|
+
program.name("kj").description("Karajan Code CLI").version("1.6.2");
|
|
28
28
|
|
|
29
29
|
program
|
|
30
30
|
.command("init")
|
package/src/commands/init.js
CHANGED
|
@@ -33,33 +33,32 @@ async function runWizard(config, logger) {
|
|
|
33
33
|
}
|
|
34
34
|
logger.info("");
|
|
35
35
|
|
|
36
|
-
if (available.length === 1) {
|
|
37
|
-
const only = available[0].name;
|
|
38
|
-
logger.info(`Only one agent available: ${only}. Using it for all roles.\n`);
|
|
39
|
-
config.coder = only;
|
|
40
|
-
config.reviewer = only;
|
|
41
|
-
config.roles.coder.provider = only;
|
|
42
|
-
config.roles.reviewer.provider = only;
|
|
43
|
-
return config;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
36
|
const wizard = createWizard();
|
|
47
37
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
38
|
+
if (available.length === 1) {
|
|
39
|
+
const only = available[0].name;
|
|
40
|
+
logger.info(`Only one agent available: ${only}. Using it for all roles.\n`);
|
|
41
|
+
config.coder = only;
|
|
42
|
+
config.reviewer = only;
|
|
43
|
+
config.roles.coder.provider = only;
|
|
44
|
+
config.roles.reviewer.provider = only;
|
|
45
|
+
} else {
|
|
46
|
+
const agentOptions = available.map((a) => ({
|
|
47
|
+
label: `${a.name} (${a.version})`,
|
|
48
|
+
value: a.name,
|
|
49
|
+
available: true
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
const coder = await wizard.select("Select default CODER agent:", agentOptions);
|
|
53
|
+
config.coder = coder;
|
|
54
|
+
config.roles.coder.provider = coder;
|
|
55
|
+
logger.info(` -> Coder: ${coder}`);
|
|
56
|
+
|
|
57
|
+
const reviewer = await wizard.select("Select default REVIEWER agent:", agentOptions);
|
|
58
|
+
config.reviewer = reviewer;
|
|
59
|
+
config.roles.reviewer.provider = reviewer;
|
|
60
|
+
logger.info(` -> Reviewer: ${reviewer}`);
|
|
61
|
+
}
|
|
63
62
|
|
|
64
63
|
const enableTriage = await wizard.confirm("Enable triage (auto-classify task complexity)?", false);
|
|
65
64
|
config.pipeline.triage = config.pipeline.triage || {};
|