juno-code 1.0.15 → 1.0.19
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/dist/bin/cli.js +7592 -4586
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/cli.mjs +7591 -4586
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/index.js +43 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -15
- package/dist/index.mjs.map +1 -1
- package/dist/templates/scripts/kanban.sh +160 -6
- package/dist/templates/services/README.md +271 -0
- package/dist/templates/services/claude.py +397 -0
- package/dist/templates/services/codex.py +268 -0
- package/package.json +73 -8
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var __export = (target, all) => {
|
|
|
75
75
|
exports.version = void 0;
|
|
76
76
|
var init_version = __esm({
|
|
77
77
|
"src/version.ts"() {
|
|
78
|
-
exports.version = "1.0.
|
|
78
|
+
exports.version = "1.0.19";
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
function isHeadlessEnvironment() {
|
|
@@ -4455,6 +4455,7 @@ var CircularInheritanceError = class extends ProfileError {
|
|
|
4455
4455
|
var ENV_VAR_MAPPING = {
|
|
4456
4456
|
// Core settings
|
|
4457
4457
|
JUNO_CODE_DEFAULT_SUBAGENT: "defaultSubagent",
|
|
4458
|
+
JUNO_CODE_DEFAULT_BACKEND: "defaultBackend",
|
|
4458
4459
|
JUNO_CODE_DEFAULT_MAX_ITERATIONS: "defaultMaxIterations",
|
|
4459
4460
|
JUNO_CODE_DEFAULT_MODEL: "defaultModel",
|
|
4460
4461
|
// Logging settings
|
|
@@ -4477,6 +4478,7 @@ var ENV_VAR_MAPPING = {
|
|
|
4477
4478
|
var LEGACY_ENV_VAR_MAPPING = {
|
|
4478
4479
|
// Core settings
|
|
4479
4480
|
JUNO_TASK_DEFAULT_SUBAGENT: "defaultSubagent",
|
|
4481
|
+
JUNO_TASK_DEFAULT_BACKEND: "defaultBackend",
|
|
4480
4482
|
JUNO_TASK_DEFAULT_MAX_ITERATIONS: "defaultMaxIterations",
|
|
4481
4483
|
JUNO_TASK_DEFAULT_MODEL: "defaultModel",
|
|
4482
4484
|
// Logging settings
|
|
@@ -4497,6 +4499,7 @@ var LEGACY_ENV_VAR_MAPPING = {
|
|
|
4497
4499
|
JUNO_TASK_SESSION_DIRECTORY: "sessionDirectory"
|
|
4498
4500
|
};
|
|
4499
4501
|
var SubagentTypeSchema = zod.z.enum(["claude", "cursor", "codex", "gemini"]);
|
|
4502
|
+
var BackendTypeSchema = zod.z.enum(["mcp", "shell"]);
|
|
4500
4503
|
var LogLevelSchema = zod.z.enum(["error", "warn", "info", "debug", "trace"]);
|
|
4501
4504
|
var HookTypeSchema = zod.z.enum(["START_RUN", "START_ITERATION", "END_ITERATION", "END_RUN"]);
|
|
4502
4505
|
var HookSchema = zod.z.object({
|
|
@@ -4506,6 +4509,7 @@ var HooksSchema = zod.z.record(HookTypeSchema, HookSchema).optional();
|
|
|
4506
4509
|
var JunoTaskConfigSchema = zod.z.object({
|
|
4507
4510
|
// Core settings
|
|
4508
4511
|
defaultSubagent: SubagentTypeSchema.describe("Default subagent to use for task execution"),
|
|
4512
|
+
defaultBackend: BackendTypeSchema.describe("Default backend to use for task execution"),
|
|
4509
4513
|
defaultMaxIterations: zod.z.number().int().min(1).max(1e3).describe("Default maximum number of iterations for task execution"),
|
|
4510
4514
|
defaultModel: zod.z.string().optional().describe("Default model to use for the subagent"),
|
|
4511
4515
|
// Logging settings
|
|
@@ -4530,6 +4534,7 @@ var JunoTaskConfigSchema = zod.z.object({
|
|
|
4530
4534
|
var DEFAULT_CONFIG = {
|
|
4531
4535
|
// Core settings
|
|
4532
4536
|
defaultSubagent: "claude",
|
|
4537
|
+
defaultBackend: "mcp",
|
|
4533
4538
|
defaultMaxIterations: 50,
|
|
4534
4539
|
// Logging settings
|
|
4535
4540
|
logLevel: "info",
|
|
@@ -6361,7 +6366,7 @@ var AdvancedLogger = class {
|
|
|
6361
6366
|
};
|
|
6362
6367
|
this.addEntry(entry);
|
|
6363
6368
|
const formatted = this.formatter.format(entry, this.options);
|
|
6364
|
-
this.output(formatted);
|
|
6369
|
+
this.output(formatted, level);
|
|
6365
6370
|
}
|
|
6366
6371
|
/**
|
|
6367
6372
|
* Start a timer for performance logging
|
|
@@ -6390,7 +6395,7 @@ var AdvancedLogger = class {
|
|
|
6390
6395
|
};
|
|
6391
6396
|
this.addEntry(entry);
|
|
6392
6397
|
const formatted = this.formatter.format(entry, this.options);
|
|
6393
|
-
this.output(formatted);
|
|
6398
|
+
this.output(formatted, level);
|
|
6394
6399
|
}
|
|
6395
6400
|
return duration;
|
|
6396
6401
|
}
|
|
@@ -6409,7 +6414,7 @@ var AdvancedLogger = class {
|
|
|
6409
6414
|
};
|
|
6410
6415
|
this.addEntry(entry);
|
|
6411
6416
|
const formatted = this.formatter.format(entry, this.options);
|
|
6412
|
-
this.output(formatted);
|
|
6417
|
+
this.output(formatted, level);
|
|
6413
6418
|
}
|
|
6414
6419
|
/**
|
|
6415
6420
|
* Log with specific session ID
|
|
@@ -6426,7 +6431,7 @@ var AdvancedLogger = class {
|
|
|
6426
6431
|
};
|
|
6427
6432
|
this.addEntry(entry);
|
|
6428
6433
|
const formatted = this.formatter.format(entry, this.options);
|
|
6429
|
-
this.output(formatted);
|
|
6434
|
+
this.output(formatted, level);
|
|
6430
6435
|
}
|
|
6431
6436
|
/**
|
|
6432
6437
|
* Create a child logger with specific context
|
|
@@ -6494,9 +6499,13 @@ var AdvancedLogger = class {
|
|
|
6494
6499
|
/**
|
|
6495
6500
|
* Output formatted log
|
|
6496
6501
|
*/
|
|
6497
|
-
output(formatted) {
|
|
6502
|
+
output(formatted, level) {
|
|
6498
6503
|
if (this.options.output === "console" || this.options.output === "both") {
|
|
6499
|
-
|
|
6504
|
+
if (level >= 3 /* WARN */) {
|
|
6505
|
+
console.error(formatted);
|
|
6506
|
+
} else {
|
|
6507
|
+
console.log(formatted);
|
|
6508
|
+
}
|
|
6500
6509
|
}
|
|
6501
6510
|
if (this.options.output === "file" || this.options.output === "both") {
|
|
6502
6511
|
this.writeToFile(formatted);
|
|
@@ -7000,9 +7009,6 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7000
7009
|
* Setup error handling for the engine
|
|
7001
7010
|
*/
|
|
7002
7011
|
setupErrorHandling() {
|
|
7003
|
-
this.engineConfig.mcpClient.on("connection:error", (error) => {
|
|
7004
|
-
this.emit("engine:error", error);
|
|
7005
|
-
});
|
|
7006
7012
|
process.on("uncaughtException", (error) => {
|
|
7007
7013
|
this.emit("engine:uncaught-exception", error);
|
|
7008
7014
|
});
|
|
@@ -7014,7 +7020,22 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7014
7020
|
* Setup progress tracking for the engine
|
|
7015
7021
|
*/
|
|
7016
7022
|
setupProgressTracking() {
|
|
7017
|
-
|
|
7023
|
+
}
|
|
7024
|
+
/**
|
|
7025
|
+
* Initialize backend for execution request
|
|
7026
|
+
*/
|
|
7027
|
+
async initializeBackend(request) {
|
|
7028
|
+
const backend = await this.engineConfig.backendManager.selectBackend({
|
|
7029
|
+
type: request.backend,
|
|
7030
|
+
config: this.engineConfig.config,
|
|
7031
|
+
workingDirectory: request.workingDirectory,
|
|
7032
|
+
mcpServerName: request.mcpServerName || this.engineConfig.config.mcpServerName,
|
|
7033
|
+
additionalOptions: {
|
|
7034
|
+
sessionId: request.requestId,
|
|
7035
|
+
timeout: request.timeoutMs || this.engineConfig.config.mcpTimeout
|
|
7036
|
+
}
|
|
7037
|
+
});
|
|
7038
|
+
backend.onProgress(async (event) => {
|
|
7018
7039
|
try {
|
|
7019
7040
|
for (const processor of this.engineConfig.progressConfig.processors) {
|
|
7020
7041
|
await processor.process(event);
|
|
@@ -7027,6 +7048,7 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7027
7048
|
this.emit("progress:error", { event, error });
|
|
7028
7049
|
}
|
|
7029
7050
|
});
|
|
7051
|
+
engineLogger.info(`Initialized ${backend.name} backend for execution`);
|
|
7030
7052
|
}
|
|
7031
7053
|
/**
|
|
7032
7054
|
* Validate execution request parameters
|
|
@@ -7127,6 +7149,7 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7127
7149
|
async executeInternal(context) {
|
|
7128
7150
|
context.status = "running" /* RUNNING */;
|
|
7129
7151
|
context.sessionContext = { ...context.sessionContext, state: "active" };
|
|
7152
|
+
await this.initializeBackend(context.request);
|
|
7130
7153
|
try {
|
|
7131
7154
|
if (this.engineConfig.config.hooks) {
|
|
7132
7155
|
await executeHook("START_RUN", this.engineConfig.config.hooks, {
|
|
@@ -7137,6 +7160,7 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7137
7160
|
sessionId: context.sessionContext.sessionId,
|
|
7138
7161
|
requestId: context.request.requestId,
|
|
7139
7162
|
subagent: context.request.subagent,
|
|
7163
|
+
backend: context.request.backend,
|
|
7140
7164
|
maxIterations: context.request.maxIterations,
|
|
7141
7165
|
instruction: context.request.instruction
|
|
7142
7166
|
}
|
|
@@ -7250,7 +7274,7 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7250
7274
|
}
|
|
7251
7275
|
};
|
|
7252
7276
|
try {
|
|
7253
|
-
const toolResult = await this.engineConfig.
|
|
7277
|
+
const toolResult = await this.engineConfig.backendManager.execute(toolRequest);
|
|
7254
7278
|
const iterationEnd = /* @__PURE__ */ new Date();
|
|
7255
7279
|
const duration = iterationEnd.getTime() - iterationStart.getTime();
|
|
7256
7280
|
const iterationResult = {
|
|
@@ -7647,10 +7671,10 @@ var ExecutionEngine = class extends events.EventEmitter {
|
|
|
7647
7671
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
7648
7672
|
}
|
|
7649
7673
|
};
|
|
7650
|
-
function createExecutionEngine(config,
|
|
7674
|
+
function createExecutionEngine(config, backendManager) {
|
|
7651
7675
|
return new ExecutionEngine({
|
|
7652
7676
|
config,
|
|
7653
|
-
|
|
7677
|
+
backendManager,
|
|
7654
7678
|
errorRecovery: DEFAULT_ERROR_RECOVERY_CONFIG,
|
|
7655
7679
|
rateLimitConfig: DEFAULT_RATE_LIMIT_CONFIG,
|
|
7656
7680
|
progressConfig: DEFAULT_PROGRESS_CONFIG
|
|
@@ -7661,12 +7685,16 @@ function createExecutionRequest(options) {
|
|
|
7661
7685
|
requestId: options.requestId || `req-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
7662
7686
|
instruction: options.instruction,
|
|
7663
7687
|
subagent: options.subagent || "claude",
|
|
7688
|
+
backend: options.backend || "mcp",
|
|
7664
7689
|
workingDirectory: options.workingDirectory || process.cwd(),
|
|
7665
7690
|
maxIterations: options.maxIterations || 50
|
|
7666
7691
|
};
|
|
7667
7692
|
if (options.model !== void 0) {
|
|
7668
7693
|
result.model = options.model;
|
|
7669
7694
|
}
|
|
7695
|
+
if (options.mcpServerName !== void 0) {
|
|
7696
|
+
result.mcpServerName = options.mcpServerName;
|
|
7697
|
+
}
|
|
7670
7698
|
return result;
|
|
7671
7699
|
}
|
|
7672
7700
|
|
|
@@ -11097,7 +11125,7 @@ var JunoLogger = class {
|
|
|
11097
11125
|
const formattedMessage = this.formatMessage(levelName, message);
|
|
11098
11126
|
await this.writeToLog(formattedMessage);
|
|
11099
11127
|
if (this.enableConsoleLogging && writeToConsole) {
|
|
11100
|
-
console.
|
|
11128
|
+
console.error(formattedMessage.trim());
|
|
11101
11129
|
}
|
|
11102
11130
|
}
|
|
11103
11131
|
/**
|