juno-code 1.0.20 → 1.0.23
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 +137 -11
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/cli.mjs +137 -11
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/templates/scripts/kanban.sh +17 -5
- package/dist/templates/services/claude.py +28 -10
- package/dist/templates/services/codex.py +5 -3
- package/package.json +1 -1
package/dist/bin/cli.mjs
CHANGED
|
@@ -366,7 +366,31 @@ var init_service_installer = __esm({
|
|
|
366
366
|
if (!exists) {
|
|
367
367
|
return true;
|
|
368
368
|
}
|
|
369
|
-
|
|
369
|
+
if (semver.gt(packageVersion, installedVersion)) {
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
if (semver.eq(packageVersion, installedVersion)) {
|
|
373
|
+
const codexExists = await fs3.pathExists(path3.join(this.SERVICES_DIR, "codex.py"));
|
|
374
|
+
const claudeExists = await fs3.pathExists(path3.join(this.SERVICES_DIR, "claude.py"));
|
|
375
|
+
if (!codexExists || !claudeExists) {
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
try {
|
|
379
|
+
const packageServicesDir = this.getPackageServicesDir();
|
|
380
|
+
const packageCodex = path3.join(packageServicesDir, "codex.py");
|
|
381
|
+
const packageClaude = path3.join(packageServicesDir, "claude.py");
|
|
382
|
+
const packageCodexExists = await fs3.pathExists(packageCodex);
|
|
383
|
+
const packageClaudeExists = await fs3.pathExists(packageClaude);
|
|
384
|
+
if (packageCodexExists || packageClaudeExists) {
|
|
385
|
+
const isDevelopment2 = packageServicesDir.includes("/src/");
|
|
386
|
+
if (isDevelopment2) {
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
} catch {
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return false;
|
|
370
394
|
} catch {
|
|
371
395
|
return true;
|
|
372
396
|
}
|
|
@@ -420,13 +444,28 @@ var init_service_installer = __esm({
|
|
|
420
444
|
*/
|
|
421
445
|
static async autoUpdate() {
|
|
422
446
|
try {
|
|
447
|
+
const debug = process.env.JUNO_CODE_DEBUG === "1";
|
|
448
|
+
if (debug) {
|
|
449
|
+
const packageVersion = this.getPackageVersion();
|
|
450
|
+
const installedVersion = await this.getInstalledVersion();
|
|
451
|
+
console.error(`[DEBUG] Package version: ${packageVersion}, Installed version: ${installedVersion || "not found"}`);
|
|
452
|
+
}
|
|
423
453
|
const needsUpdate = await this.needsUpdate();
|
|
454
|
+
if (debug) {
|
|
455
|
+
console.error(`[DEBUG] Needs update: ${needsUpdate}`);
|
|
456
|
+
}
|
|
424
457
|
if (needsUpdate) {
|
|
425
458
|
await this.install(true);
|
|
459
|
+
if (debug) {
|
|
460
|
+
console.error(`[DEBUG] Service scripts updated successfully`);
|
|
461
|
+
}
|
|
426
462
|
return true;
|
|
427
463
|
}
|
|
428
464
|
return false;
|
|
429
|
-
} catch {
|
|
465
|
+
} catch (error) {
|
|
466
|
+
if (process.env.JUNO_CODE_DEBUG === "1") {
|
|
467
|
+
console.error("[DEBUG] autoUpdate error:", error instanceof Error ? error.message : String(error));
|
|
468
|
+
}
|
|
430
469
|
return false;
|
|
431
470
|
}
|
|
432
471
|
}
|
|
@@ -6422,6 +6461,8 @@ var init_shell_backend = __esm({
|
|
|
6422
6461
|
eventCounter = 0;
|
|
6423
6462
|
jsonBuffer = "";
|
|
6424
6463
|
// Buffer for handling partial JSON objects
|
|
6464
|
+
logFilePath = null;
|
|
6465
|
+
// Path to current log file
|
|
6425
6466
|
/**
|
|
6426
6467
|
* Configure the shell backend
|
|
6427
6468
|
*/
|
|
@@ -6453,6 +6494,15 @@ var init_shell_backend = __esm({
|
|
|
6453
6494
|
}
|
|
6454
6495
|
const startTime = Date.now();
|
|
6455
6496
|
const toolId = `shell_${request.toolName}_${startTime}`;
|
|
6497
|
+
const subagentType = this.extractSubagentFromToolName(request.toolName);
|
|
6498
|
+
try {
|
|
6499
|
+
this.logFilePath = await this.createLogFile(subagentType);
|
|
6500
|
+
} catch (error) {
|
|
6501
|
+
if (this.config.debug) {
|
|
6502
|
+
engineLogger.warn(`Failed to create log file, continuing without file logging: ${error instanceof Error ? error.message : String(error)}`);
|
|
6503
|
+
}
|
|
6504
|
+
this.logFilePath = null;
|
|
6505
|
+
}
|
|
6456
6506
|
await this.emitProgressEvent({
|
|
6457
6507
|
sessionId: request.metadata?.sessionId || "unknown",
|
|
6458
6508
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -6468,7 +6518,6 @@ var init_shell_backend = __esm({
|
|
|
6468
6518
|
}
|
|
6469
6519
|
});
|
|
6470
6520
|
try {
|
|
6471
|
-
const subagentType = this.extractSubagentFromToolName(request.toolName);
|
|
6472
6521
|
const scriptPath = await this.findScriptForSubagent(subagentType);
|
|
6473
6522
|
const result = await this.executeScript(scriptPath, request, toolId);
|
|
6474
6523
|
const duration = Date.now() - startTime;
|
|
@@ -6558,6 +6607,46 @@ var init_shell_backend = __esm({
|
|
|
6558
6607
|
// =============================================================================
|
|
6559
6608
|
// Private Implementation Methods
|
|
6560
6609
|
// =============================================================================
|
|
6610
|
+
/**
|
|
6611
|
+
* Create log file path and ensure log directory exists
|
|
6612
|
+
*/
|
|
6613
|
+
async createLogFile(subagentName) {
|
|
6614
|
+
const now = /* @__PURE__ */ new Date();
|
|
6615
|
+
const timestamp = now.getFullYear().toString() + (now.getMonth() + 1).toString().padStart(2, "0") + now.getDate().toString().padStart(2, "0") + "_" + now.getHours().toString().padStart(2, "0") + now.getMinutes().toString().padStart(2, "0") + now.getSeconds().toString().padStart(2, "0");
|
|
6616
|
+
const logDir = path3.join(this.config.workingDirectory, ".juno_task", "logs");
|
|
6617
|
+
try {
|
|
6618
|
+
await fs3.ensureDir(logDir);
|
|
6619
|
+
} catch (error) {
|
|
6620
|
+
if (this.config?.debug) {
|
|
6621
|
+
engineLogger.warn(`Failed to create log directory: ${error instanceof Error ? error.message : String(error)}`);
|
|
6622
|
+
}
|
|
6623
|
+
throw new Error(`Failed to create log directory: ${logDir}`);
|
|
6624
|
+
}
|
|
6625
|
+
const logFileName = `${subagentName}_shell_${timestamp}.log`;
|
|
6626
|
+
const logFilePath = path3.join(logDir, logFileName);
|
|
6627
|
+
if (this.config?.debug) {
|
|
6628
|
+
engineLogger.debug(`Created log file path: ${logFilePath}`);
|
|
6629
|
+
}
|
|
6630
|
+
return logFilePath;
|
|
6631
|
+
}
|
|
6632
|
+
/**
|
|
6633
|
+
* Write log entry to file
|
|
6634
|
+
*/
|
|
6635
|
+
async writeToLogFile(message) {
|
|
6636
|
+
if (!this.logFilePath) {
|
|
6637
|
+
return;
|
|
6638
|
+
}
|
|
6639
|
+
try {
|
|
6640
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
6641
|
+
const logEntry = `[${timestamp}] ${message}
|
|
6642
|
+
`;
|
|
6643
|
+
await fs3.appendFile(this.logFilePath, logEntry, "utf-8");
|
|
6644
|
+
} catch (error) {
|
|
6645
|
+
if (this.config?.debug) {
|
|
6646
|
+
engineLogger.warn(`Failed to write to log file: ${error instanceof Error ? error.message : String(error)}`);
|
|
6647
|
+
}
|
|
6648
|
+
}
|
|
6649
|
+
}
|
|
6561
6650
|
/**
|
|
6562
6651
|
* Extract subagent type from tool name
|
|
6563
6652
|
*/
|
|
@@ -6968,6 +7057,10 @@ var init_shell_backend = __esm({
|
|
|
6968
7057
|
* Emit progress event to all callbacks
|
|
6969
7058
|
*/
|
|
6970
7059
|
async emitProgressEvent(event) {
|
|
7060
|
+
if (this.logFilePath) {
|
|
7061
|
+
const logMessage = `[${event.type}] ${event.content}${event.metadata ? " | metadata: " + JSON.stringify(event.metadata) : ""}`;
|
|
7062
|
+
await this.writeToLogFile(logMessage);
|
|
7063
|
+
}
|
|
6971
7064
|
for (const callback of this.progressCallbacks) {
|
|
6972
7065
|
try {
|
|
6973
7066
|
await callback(event);
|
|
@@ -12753,8 +12846,10 @@ var init_main = __esm({
|
|
|
12753
12846
|
}
|
|
12754
12847
|
onProgress(event) {
|
|
12755
12848
|
const timestamp = event.timestamp.toLocaleTimeString();
|
|
12756
|
-
if (event.metadata?.rawJsonOutput) {
|
|
12849
|
+
if (event.metadata?.rawJsonOutput || event.metadata?.format === "text" && event.metadata?.raw === true) {
|
|
12757
12850
|
this.hasStreamedJsonOutput = true;
|
|
12851
|
+
}
|
|
12852
|
+
if (event.metadata?.rawJsonOutput) {
|
|
12758
12853
|
try {
|
|
12759
12854
|
const jsonObj = JSON.parse(event.content);
|
|
12760
12855
|
const formattedJson = this.colorizeJson(jsonObj);
|
|
@@ -12771,11 +12866,23 @@ var init_main = __esm({
|
|
|
12771
12866
|
return;
|
|
12772
12867
|
}
|
|
12773
12868
|
}
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12869
|
+
try {
|
|
12870
|
+
const jsonObj = JSON.parse(event.content);
|
|
12871
|
+
const formattedJson = this.colorizeJson(jsonObj);
|
|
12872
|
+
const backend = event.backend ? chalk12.cyan(`[${event.backend}]`) : "";
|
|
12873
|
+
if (this.verbose) {
|
|
12874
|
+
console.error(`${chalk12.gray(timestamp)} ${backend} ${formattedJson}`);
|
|
12875
|
+
} else {
|
|
12876
|
+
console.error(`${backend} ${formattedJson}`);
|
|
12877
|
+
}
|
|
12878
|
+
return;
|
|
12879
|
+
} catch (error) {
|
|
12880
|
+
const backend = event.backend ? `[${event.backend}]` : "";
|
|
12881
|
+
if (this.verbose) {
|
|
12882
|
+
console.error(chalk12.gray(`[${timestamp}] ${backend} ${event.type}: ${event.content}`));
|
|
12883
|
+
} else {
|
|
12884
|
+
console.error(`${backend} ${chalk12.blue(`${event.type}:`)} ${event.content}`);
|
|
12885
|
+
}
|
|
12779
12886
|
}
|
|
12780
12887
|
}
|
|
12781
12888
|
/**
|
|
@@ -17821,6 +17928,19 @@ var ProgressDisplay = class {
|
|
|
17821
17928
|
return;
|
|
17822
17929
|
}
|
|
17823
17930
|
}
|
|
17931
|
+
if (event.metadata?.format === "text") {
|
|
17932
|
+
try {
|
|
17933
|
+
const jsonObj = JSON.parse(event.content);
|
|
17934
|
+
const formattedJson = this.colorizeJson(jsonObj);
|
|
17935
|
+
writeTerminalProgress(`${chalk12.gray(timestamp)} ${chalk12.cyan(backend)} ${formattedJson}
|
|
17936
|
+
`);
|
|
17937
|
+
return;
|
|
17938
|
+
} catch (error) {
|
|
17939
|
+
writeTerminalProgress(chalk12.gray(`[${timestamp}] ${backend} ${event.type}: ${event.content}
|
|
17940
|
+
`));
|
|
17941
|
+
return;
|
|
17942
|
+
}
|
|
17943
|
+
}
|
|
17824
17944
|
const toolName = event.metadata?.toolName || "unknown";
|
|
17825
17945
|
const phase = event.metadata?.phase || "";
|
|
17826
17946
|
const duration = event.metadata?.duration;
|
|
@@ -25114,8 +25234,14 @@ async function main() {
|
|
|
25114
25234
|
configureEnvironment();
|
|
25115
25235
|
try {
|
|
25116
25236
|
const { ServiceInstaller: ServiceInstaller2 } = await Promise.resolve().then(() => (init_service_installer(), service_installer_exports));
|
|
25117
|
-
await ServiceInstaller2.autoUpdate();
|
|
25118
|
-
|
|
25237
|
+
const updated = await ServiceInstaller2.autoUpdate();
|
|
25238
|
+
if (updated && (process.argv.includes("--verbose") || process.argv.includes("-v") || process.env.JUNO_CODE_DEBUG === "1")) {
|
|
25239
|
+
console.error("[DEBUG] Service scripts auto-updated to latest version");
|
|
25240
|
+
}
|
|
25241
|
+
} catch (error) {
|
|
25242
|
+
if (process.env.JUNO_CODE_DEBUG === "1") {
|
|
25243
|
+
console.error("[DEBUG] Service auto-update failed:", error instanceof Error ? error.message : String(error));
|
|
25244
|
+
}
|
|
25119
25245
|
}
|
|
25120
25246
|
program.name("juno-code").description("TypeScript implementation of juno-code CLI tool for AI subagent orchestration").version(VERSION, "-V, --version", "Display version information").helpOption("-h, --help", "Display help information");
|
|
25121
25247
|
setupGlobalOptions(program);
|