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.mjs CHANGED
@@ -1174,6 +1174,8 @@ var init_config = __esm({
1174
1174
  JUNO_CODE_MCP_RETRIES: "mcpRetries",
1175
1175
  JUNO_CODE_MCP_SERVER_PATH: "mcpServerPath",
1176
1176
  JUNO_CODE_MCP_SERVER_NAME: "mcpServerName",
1177
+ // Hook settings
1178
+ JUNO_CODE_HOOK_COMMAND_TIMEOUT: "hookCommandTimeout",
1177
1179
  // TUI settings
1178
1180
  JUNO_CODE_INTERACTIVE: "interactive",
1179
1181
  JUNO_CODE_HEADLESS_MODE: "headlessMode",
@@ -1197,6 +1199,8 @@ var init_config = __esm({
1197
1199
  JUNO_TASK_MCP_RETRIES: "mcpRetries",
1198
1200
  JUNO_TASK_MCP_SERVER_PATH: "mcpServerPath",
1199
1201
  JUNO_TASK_MCP_SERVER_NAME: "mcpServerName",
1202
+ // Hook settings
1203
+ JUNO_TASK_HOOK_COMMAND_TIMEOUT: "hookCommandTimeout",
1200
1204
  // TUI settings
1201
1205
  JUNO_TASK_INTERACTIVE: "interactive",
1202
1206
  JUNO_TASK_HEADLESS_MODE: "headlessMode",
@@ -1228,6 +1232,8 @@ var init_config = __esm({
1228
1232
  mcpRetries: z.number().int().min(0).max(10).describe("Number of retries for MCP operations"),
1229
1233
  mcpServerPath: z.string().optional().describe("Path to MCP server executable (auto-discovered if not specified)"),
1230
1234
  mcpServerName: z.string().optional().describe('Named MCP server to connect to (e.g., "roundtable-ai")'),
1235
+ // Hook settings
1236
+ hookCommandTimeout: z.number().int().min(1e3).max(36e5).optional().describe("Timeout for individual hook commands in milliseconds (default: 300000 = 5 minutes)"),
1231
1237
  // TUI settings
1232
1238
  interactive: z.boolean().describe("Enable interactive mode"),
1233
1239
  headlessMode: z.boolean().describe("Enable headless mode (no TUI)"),
@@ -3337,7 +3343,8 @@ var init_advanced_logger = __esm({
3337
3343
  async function executeHook(hookType, hooks, context = {}, options = {}) {
3338
3344
  const startTime = Date.now();
3339
3345
  const {
3340
- commandTimeout = 3e4,
3346
+ commandTimeout = 3e5,
3347
+ // 5 minutes default (increased from 30s to support long-running hook scripts)
3341
3348
  env: env2 = {},
3342
3349
  continueOnError = true,
3343
3350
  logContext = "SYSTEM" /* SYSTEM */
@@ -3412,8 +3419,12 @@ async function executeHook(hookType, hooks, context = {}, options = {}) {
3412
3419
  env: execEnv,
3413
3420
  // Capture both stdout and stderr
3414
3421
  all: true,
3415
- reject: false
3422
+ reject: false,
3416
3423
  // Don't throw on non-zero exit codes
3424
+ // Use input: '' to provide empty stdin and properly close it (sends EOF)
3425
+ // This prevents commands from hanging waiting for stdin while still
3426
+ // allowing internal pipe operations to work correctly
3427
+ input: ""
3417
3428
  });
3418
3429
  const duration = Date.now() - commandStartTime;
3419
3430
  const success2 = result2.exitCode === 0;
@@ -3559,6 +3570,12 @@ function createExecutionRequest(options) {
3559
3570
  if (options.mcpServerName !== void 0) {
3560
3571
  result.mcpServerName = options.mcpServerName;
3561
3572
  }
3573
+ if (options.resume !== void 0) {
3574
+ result.resume = options.resume;
3575
+ }
3576
+ if (options.continueConversation !== void 0) {
3577
+ result.continueConversation = options.continueConversation;
3578
+ }
3562
3579
  return result;
3563
3580
  }
3564
3581
  var DEFAULT_ERROR_RECOVERY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_PROGRESS_CONFIG, ExecutionEngine;
@@ -3909,6 +3926,8 @@ var init_engine = __esm({
3909
3926
  maxIterations: context.request.maxIterations,
3910
3927
  instruction: context.request.instruction
3911
3928
  }
3929
+ }, {
3930
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3912
3931
  });
3913
3932
  }
3914
3933
  } catch (error) {
@@ -3941,6 +3960,8 @@ var init_engine = __esm({
3941
3960
  duration: context.endTime ? context.endTime.getTime() - context.startTime.getTime() : 0,
3942
3961
  success: context.status === "completed" /* COMPLETED */
3943
3962
  }
3963
+ }, {
3964
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3944
3965
  });
3945
3966
  }
3946
3967
  } catch (error) {
@@ -3992,6 +4013,8 @@ var init_engine = __esm({
3992
4013
  maxIterations: context.request.maxIterations,
3993
4014
  subagent: context.request.subagent
3994
4015
  }
4016
+ }, {
4017
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3995
4018
  });
3996
4019
  }
3997
4020
  } catch (error) {
@@ -4009,6 +4032,8 @@ var init_engine = __esm({
4009
4032
  ...context.request.allowedTools !== void 0 && { allowedTools: context.request.allowedTools },
4010
4033
  ...context.request.appendAllowedTools !== void 0 && { appendAllowedTools: context.request.appendAllowedTools },
4011
4034
  ...context.request.disallowedTools !== void 0 && { disallowedTools: context.request.disallowedTools },
4035
+ ...context.request.resume !== void 0 && { resume: context.request.resume },
4036
+ ...context.request.continueConversation !== void 0 && { continueConversation: context.request.continueConversation },
4012
4037
  iteration: iterationNumber
4013
4038
  },
4014
4039
  timeout: context.request.timeoutMs || this.engineConfig.config.mcpTimeout,
@@ -4056,6 +4081,8 @@ var init_engine = __esm({
4056
4081
  duration: iterationResult.duration,
4057
4082
  toolCallStatus: iterationResult.toolResult.status
4058
4083
  }
4084
+ }, {
4085
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4059
4086
  });
4060
4087
  }
4061
4088
  } catch (error) {
@@ -4104,6 +4131,8 @@ var init_engine = __esm({
4104
4131
  error: mcpError.message,
4105
4132
  errorType: mcpError.type
4106
4133
  }
4134
+ }, {
4135
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4107
4136
  });
4108
4137
  }
4109
4138
  } catch (hookError) {
@@ -7190,6 +7219,12 @@ var init_shell_backend = __esm({
7190
7219
  args.push("--disallowedTools");
7191
7220
  args.push(...request.arguments.disallowedTools);
7192
7221
  }
7222
+ if (isPython && request.arguments?.resume) {
7223
+ args.push("--resume", request.arguments.resume);
7224
+ }
7225
+ if (isPython && request.arguments?.continueConversation) {
7226
+ args.push("--continue");
7227
+ }
7193
7228
  if (this.config.debug) {
7194
7229
  engineLogger.debug(`Executing script: ${command} ${args.join(" ")}`);
7195
7230
  engineLogger.debug(`Working directory: ${this.config.workingDirectory}`);
@@ -12613,7 +12648,9 @@ async function mainCommandHandler(args, options, command) {
12613
12648
  tools: options.tools,
12614
12649
  allowedTools: options.allowedTools,
12615
12650
  appendAllowedTools: options.appendAllowedTools,
12616
- disallowedTools: options.disallowedTools
12651
+ disallowedTools: options.disallowedTools,
12652
+ resume: options.resume,
12653
+ continueConversation: options.continue
12617
12654
  });
12618
12655
  const coordinator = new MainExecutionCoordinator(config, options.verbose, options.enableFeedback || false);
12619
12656
  const result = await coordinator.execute(executionRequest);
@@ -16417,6 +16454,8 @@ async function startCommandHandler(args, options, command) {
16417
16454
  allowedTools: options.allowedTools,
16418
16455
  appendAllowedTools: options.appendAllowedTools,
16419
16456
  disallowedTools: options.disallowedTools,
16457
+ resume: options.resume,
16458
+ continue: options.continue,
16420
16459
  directory: options.directory,
16421
16460
  verbose: options.verbose,
16422
16461
  quiet: options.quiet,
@@ -23694,7 +23733,7 @@ function handleCLIError(error, verbose = false) {
23694
23733
  process.exit(EXIT_CODES.UNEXPECTED_ERROR);
23695
23734
  }
23696
23735
  function setupGlobalOptions(program) {
23697
- 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)");
23736
+ 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)");
23698
23737
  program.exitOverride((err) => {
23699
23738
  if (err.code === "commander.helpDisplayed") {
23700
23739
  process.exit(0);