juno-code 1.0.31 → 1.0.32

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 CHANGED
@@ -1210,6 +1210,8 @@ var init_config = __esm({
1210
1210
  JUNO_CODE_MCP_RETRIES: "mcpRetries",
1211
1211
  JUNO_CODE_MCP_SERVER_PATH: "mcpServerPath",
1212
1212
  JUNO_CODE_MCP_SERVER_NAME: "mcpServerName",
1213
+ // Hook settings
1214
+ JUNO_CODE_HOOK_COMMAND_TIMEOUT: "hookCommandTimeout",
1213
1215
  // TUI settings
1214
1216
  JUNO_CODE_INTERACTIVE: "interactive",
1215
1217
  JUNO_CODE_HEADLESS_MODE: "headlessMode",
@@ -1233,6 +1235,8 @@ var init_config = __esm({
1233
1235
  JUNO_TASK_MCP_RETRIES: "mcpRetries",
1234
1236
  JUNO_TASK_MCP_SERVER_PATH: "mcpServerPath",
1235
1237
  JUNO_TASK_MCP_SERVER_NAME: "mcpServerName",
1238
+ // Hook settings
1239
+ JUNO_TASK_HOOK_COMMAND_TIMEOUT: "hookCommandTimeout",
1236
1240
  // TUI settings
1237
1241
  JUNO_TASK_INTERACTIVE: "interactive",
1238
1242
  JUNO_TASK_HEADLESS_MODE: "headlessMode",
@@ -1264,6 +1268,8 @@ var init_config = __esm({
1264
1268
  mcpRetries: zod.z.number().int().min(0).max(10).describe("Number of retries for MCP operations"),
1265
1269
  mcpServerPath: zod.z.string().optional().describe("Path to MCP server executable (auto-discovered if not specified)"),
1266
1270
  mcpServerName: zod.z.string().optional().describe('Named MCP server to connect to (e.g., "roundtable-ai")'),
1271
+ // Hook settings
1272
+ hookCommandTimeout: zod.z.number().int().min(1e3).max(36e5).optional().describe("Timeout for individual hook commands in milliseconds (default: 300000 = 5 minutes)"),
1267
1273
  // TUI settings
1268
1274
  interactive: zod.z.boolean().describe("Enable interactive mode"),
1269
1275
  headlessMode: zod.z.boolean().describe("Enable headless mode (no TUI)"),
@@ -3373,7 +3379,8 @@ var init_advanced_logger = __esm({
3373
3379
  async function executeHook(hookType, hooks, context = {}, options = {}) {
3374
3380
  const startTime = Date.now();
3375
3381
  const {
3376
- commandTimeout = 3e4,
3382
+ commandTimeout = 3e5,
3383
+ // 5 minutes default (increased from 30s to support long-running hook scripts)
3377
3384
  env: env2 = {},
3378
3385
  continueOnError = true,
3379
3386
  logContext = "SYSTEM" /* SYSTEM */
@@ -3448,8 +3455,12 @@ async function executeHook(hookType, hooks, context = {}, options = {}) {
3448
3455
  env: execEnv,
3449
3456
  // Capture both stdout and stderr
3450
3457
  all: true,
3451
- reject: false
3458
+ reject: false,
3452
3459
  // Don't throw on non-zero exit codes
3460
+ // Use input: '' to provide empty stdin and properly close it (sends EOF)
3461
+ // This prevents commands from hanging waiting for stdin while still
3462
+ // allowing internal pipe operations to work correctly
3463
+ input: ""
3453
3464
  });
3454
3465
  const duration = Date.now() - commandStartTime;
3455
3466
  const success2 = result2.exitCode === 0;
@@ -3595,6 +3606,12 @@ function createExecutionRequest(options) {
3595
3606
  if (options.mcpServerName !== void 0) {
3596
3607
  result.mcpServerName = options.mcpServerName;
3597
3608
  }
3609
+ if (options.resume !== void 0) {
3610
+ result.resume = options.resume;
3611
+ }
3612
+ if (options.continueConversation !== void 0) {
3613
+ result.continueConversation = options.continueConversation;
3614
+ }
3598
3615
  return result;
3599
3616
  }
3600
3617
  var DEFAULT_ERROR_RECOVERY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_PROGRESS_CONFIG, ExecutionEngine;
@@ -3945,6 +3962,8 @@ var init_engine = __esm({
3945
3962
  maxIterations: context.request.maxIterations,
3946
3963
  instruction: context.request.instruction
3947
3964
  }
3965
+ }, {
3966
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3948
3967
  });
3949
3968
  }
3950
3969
  } catch (error) {
@@ -3977,6 +3996,8 @@ var init_engine = __esm({
3977
3996
  duration: context.endTime ? context.endTime.getTime() - context.startTime.getTime() : 0,
3978
3997
  success: context.status === "completed" /* COMPLETED */
3979
3998
  }
3999
+ }, {
4000
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3980
4001
  });
3981
4002
  }
3982
4003
  } catch (error) {
@@ -4028,6 +4049,8 @@ var init_engine = __esm({
4028
4049
  maxIterations: context.request.maxIterations,
4029
4050
  subagent: context.request.subagent
4030
4051
  }
4052
+ }, {
4053
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4031
4054
  });
4032
4055
  }
4033
4056
  } catch (error) {
@@ -4045,6 +4068,8 @@ var init_engine = __esm({
4045
4068
  ...context.request.allowedTools !== void 0 && { allowedTools: context.request.allowedTools },
4046
4069
  ...context.request.appendAllowedTools !== void 0 && { appendAllowedTools: context.request.appendAllowedTools },
4047
4070
  ...context.request.disallowedTools !== void 0 && { disallowedTools: context.request.disallowedTools },
4071
+ ...context.request.resume !== void 0 && { resume: context.request.resume },
4072
+ ...context.request.continueConversation !== void 0 && { continueConversation: context.request.continueConversation },
4048
4073
  iteration: iterationNumber
4049
4074
  },
4050
4075
  timeout: context.request.timeoutMs || this.engineConfig.config.mcpTimeout,
@@ -4092,6 +4117,8 @@ var init_engine = __esm({
4092
4117
  duration: iterationResult.duration,
4093
4118
  toolCallStatus: iterationResult.toolResult.status
4094
4119
  }
4120
+ }, {
4121
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4095
4122
  });
4096
4123
  }
4097
4124
  } catch (error) {
@@ -4140,6 +4167,8 @@ var init_engine = __esm({
4140
4167
  error: mcpError.message,
4141
4168
  errorType: mcpError.type
4142
4169
  }
4170
+ }, {
4171
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4143
4172
  });
4144
4173
  }
4145
4174
  } catch (hookError) {
@@ -7226,6 +7255,12 @@ var init_shell_backend = __esm({
7226
7255
  args.push("--disallowedTools");
7227
7256
  args.push(...request.arguments.disallowedTools);
7228
7257
  }
7258
+ if (isPython && request.arguments?.resume) {
7259
+ args.push("--resume", request.arguments.resume);
7260
+ }
7261
+ if (isPython && request.arguments?.continueConversation) {
7262
+ args.push("--continue");
7263
+ }
7229
7264
  if (this.config.debug) {
7230
7265
  engineLogger.debug(`Executing script: ${command} ${args.join(" ")}`);
7231
7266
  engineLogger.debug(`Working directory: ${this.config.workingDirectory}`);
@@ -12649,7 +12684,9 @@ async function mainCommandHandler(args, options, command) {
12649
12684
  tools: options.tools,
12650
12685
  allowedTools: options.allowedTools,
12651
12686
  appendAllowedTools: options.appendAllowedTools,
12652
- disallowedTools: options.disallowedTools
12687
+ disallowedTools: options.disallowedTools,
12688
+ resume: options.resume,
12689
+ continueConversation: options.continue
12653
12690
  });
12654
12691
  const coordinator = new MainExecutionCoordinator(config, options.verbose, options.enableFeedback || false);
12655
12692
  const result = await coordinator.execute(executionRequest);
@@ -16453,6 +16490,8 @@ async function startCommandHandler(args, options, command) {
16453
16490
  allowedTools: options.allowedTools,
16454
16491
  appendAllowedTools: options.appendAllowedTools,
16455
16492
  disallowedTools: options.disallowedTools,
16493
+ resume: options.resume,
16494
+ continue: options.continue,
16456
16495
  directory: options.directory,
16457
16496
  verbose: options.verbose,
16458
16497
  quiet: options.quiet,
@@ -23730,7 +23769,7 @@ function handleCLIError(error, verbose = false) {
23730
23769
  process.exit(EXIT_CODES.UNEXPECTED_ERROR);
23731
23770
  }
23732
23771
  function setupGlobalOptions(program) {
23733
- program.option("-v, --verbose", "Enable verbose output with detailed progress").option("-q, --quiet", "Disable rich formatting, use plain text").option("-c, --config <path>", "Configuration file path (.json, .toml, pyproject.toml)").option("-l, --log-file <path>", "Log file path (auto-generated if not specified)").option("--no-color", "Disable colored output").option("--log-level <level>", "Log level for output (error, warn, info, debug, trace)", "info").option("-s, --subagent <name>", "Subagent to use (claude, cursor, codex, gemini)").option("-b, --backend <type>", "Backend to use (mcp, shell)").option("-m, --model <name>", "Model to use (subagent-specific)").option("--agents <config>", "Agents configuration (forwarded to shell backend, ignored for MCP)").option("--tools <tools...>", 'Specify the list of available tools from the built-in set (only works with --print mode). Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read"). Passed to shell backend, ignored for MCP.').option("--allowed-tools <tools...>", 'Permission-based filtering of specific tool instances (e.g. "Bash(git:*) Edit"). Default when not specified: Task, Bash, Glob, Grep, ExitPlanMode, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Skill, SlashCommand, EnterPlanMode. Passed to shell backend, ignored for MCP.').option("--disallowed-tools <tools...>", "Disallowed tools for Claude (passed to shell backend, ignored for MCP). By default, no tools are disallowed").option("--append-allowed-tools <tools...>", "Append tools to the default allowed-tools list (mutually exclusive with --allowed-tools). Passed to shell backend, ignored for MCP.").option("--mcp-timeout <number>", "MCP server timeout in milliseconds", parseInt).option("--enable-feedback", "Enable interactive feedback mode (F+Enter to enter, Q+Enter to submit)");
23772
+ program.option("-v, --verbose", "Enable verbose output with detailed progress").option("-q, --quiet", "Disable rich formatting, use plain text").option("-c, --config <path>", "Configuration file path (.json, .toml, pyproject.toml)").option("-l, --log-file <path>", "Log file path (auto-generated if not specified)").option("--no-color", "Disable colored output").option("--log-level <level>", "Log level for output (error, warn, info, debug, trace)", "info").option("-s, --subagent <name>", "Subagent to use (claude, cursor, codex, gemini)").option("-b, --backend <type>", "Backend to use (mcp, shell)").option("-m, --model <name>", "Model to use (subagent-specific)").option("--agents <config>", "Agents configuration (forwarded to shell backend, ignored for MCP)").option("--tools <tools...>", 'Specify the list of available tools from the built-in set (only works with --print mode). Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read"). Passed to shell backend, ignored for MCP.').option("--allowed-tools <tools...>", 'Permission-based filtering of specific tool instances (e.g. "Bash(git:*) Edit"). Default when not specified: Task, Bash, Glob, Grep, ExitPlanMode, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Skill, SlashCommand, EnterPlanMode. Passed to shell backend, ignored for MCP.').option("--disallowed-tools <tools...>", "Disallowed tools for Claude (passed to shell backend, ignored for MCP). By default, no tools are disallowed").option("--append-allowed-tools <tools...>", "Append tools to the default allowed-tools list (mutually exclusive with --allowed-tools). Passed to shell backend, ignored for MCP.").option("--mcp-timeout <number>", "MCP server timeout in milliseconds", parseInt).option("--enable-feedback", "Enable interactive feedback mode (F+Enter to enter, Q+Enter to submit)").option("-r, --resume <sessionId>", "Resume a conversation by session ID (shell backend only)").option("--continue", "Continue the most recent conversation (shell backend only)");
23734
23773
  program.exitOverride((err) => {
23735
23774
  if (err.code === "commander.helpDisplayed") {
23736
23775
  process.exit(0);