juno-code 1.0.30 → 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;
@@ -3583,12 +3594,24 @@ function createExecutionRequest(options) {
3583
3594
  if (options.tools !== void 0) {
3584
3595
  result.tools = options.tools;
3585
3596
  }
3597
+ if (options.allowedTools !== void 0) {
3598
+ result.allowedTools = options.allowedTools;
3599
+ }
3600
+ if (options.appendAllowedTools !== void 0) {
3601
+ result.appendAllowedTools = options.appendAllowedTools;
3602
+ }
3586
3603
  if (options.disallowedTools !== void 0) {
3587
3604
  result.disallowedTools = options.disallowedTools;
3588
3605
  }
3589
3606
  if (options.mcpServerName !== void 0) {
3590
3607
  result.mcpServerName = options.mcpServerName;
3591
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
+ }
3592
3615
  return result;
3593
3616
  }
3594
3617
  var DEFAULT_ERROR_RECOVERY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_PROGRESS_CONFIG, ExecutionEngine;
@@ -3939,6 +3962,8 @@ var init_engine = __esm({
3939
3962
  maxIterations: context.request.maxIterations,
3940
3963
  instruction: context.request.instruction
3941
3964
  }
3965
+ }, {
3966
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3942
3967
  });
3943
3968
  }
3944
3969
  } catch (error) {
@@ -3971,6 +3996,8 @@ var init_engine = __esm({
3971
3996
  duration: context.endTime ? context.endTime.getTime() - context.startTime.getTime() : 0,
3972
3997
  success: context.status === "completed" /* COMPLETED */
3973
3998
  }
3999
+ }, {
4000
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
3974
4001
  });
3975
4002
  }
3976
4003
  } catch (error) {
@@ -4022,6 +4049,8 @@ var init_engine = __esm({
4022
4049
  maxIterations: context.request.maxIterations,
4023
4050
  subagent: context.request.subagent
4024
4051
  }
4052
+ }, {
4053
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4025
4054
  });
4026
4055
  }
4027
4056
  } catch (error) {
@@ -4036,7 +4065,11 @@ var init_engine = __esm({
4036
4065
  ...context.request.model !== void 0 && { model: context.request.model },
4037
4066
  ...context.request.agents !== void 0 && { agents: context.request.agents },
4038
4067
  ...context.request.tools !== void 0 && { tools: context.request.tools },
4068
+ ...context.request.allowedTools !== void 0 && { allowedTools: context.request.allowedTools },
4069
+ ...context.request.appendAllowedTools !== void 0 && { appendAllowedTools: context.request.appendAllowedTools },
4039
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 },
4040
4073
  iteration: iterationNumber
4041
4074
  },
4042
4075
  timeout: context.request.timeoutMs || this.engineConfig.config.mcpTimeout,
@@ -4084,6 +4117,8 @@ var init_engine = __esm({
4084
4117
  duration: iterationResult.duration,
4085
4118
  toolCallStatus: iterationResult.toolResult.status
4086
4119
  }
4120
+ }, {
4121
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4087
4122
  });
4088
4123
  }
4089
4124
  } catch (error) {
@@ -4132,6 +4167,8 @@ var init_engine = __esm({
4132
4167
  error: mcpError.message,
4133
4168
  errorType: mcpError.type
4134
4169
  }
4170
+ }, {
4171
+ commandTimeout: this.engineConfig.config.hookCommandTimeout
4135
4172
  });
4136
4173
  }
4137
4174
  } catch (hookError) {
@@ -7203,14 +7240,26 @@ var init_shell_backend = __esm({
7203
7240
  args.push("--agents", request.arguments.agents);
7204
7241
  }
7205
7242
  if (isPython && request.arguments?.tools && Array.isArray(request.arguments.tools)) {
7206
- for (const tool of request.arguments.tools) {
7207
- args.push("--tool", tool);
7208
- }
7243
+ args.push("--tools");
7244
+ args.push(...request.arguments.tools);
7245
+ }
7246
+ if (isPython && request.arguments?.allowedTools && Array.isArray(request.arguments.allowedTools)) {
7247
+ args.push("--allowedTools");
7248
+ args.push(...request.arguments.allowedTools);
7249
+ }
7250
+ if (isPython && request.arguments?.appendAllowedTools && Array.isArray(request.arguments.appendAllowedTools)) {
7251
+ args.push("--appendAllowedTools");
7252
+ args.push(...request.arguments.appendAllowedTools);
7209
7253
  }
7210
7254
  if (isPython && request.arguments?.disallowedTools && Array.isArray(request.arguments.disallowedTools)) {
7211
- for (const tool of request.arguments.disallowedTools) {
7212
- args.push("--disallowed-tool", tool);
7213
- }
7255
+ args.push("--disallowedTools");
7256
+ args.push(...request.arguments.disallowedTools);
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");
7214
7263
  }
7215
7264
  if (this.config.debug) {
7216
7265
  engineLogger.debug(`Executing script: ${command} ${args.join(" ")}`);
@@ -12617,8 +12666,12 @@ async function mainCommandHandler(args, options, command) {
12617
12666
  if (options.agents && selectedBackend !== "shell") {
12618
12667
  console.error(chalk15__default.default.yellow("\n\u26A0\uFE0F Note: --agents flag is only supported with shell backend and will be ignored"));
12619
12668
  }
12620
- if ((options.tools || options.disallowedTools) && selectedBackend !== "shell") {
12621
- console.error(chalk15__default.default.yellow("\n\u26A0\uFE0F Note: --tools and --disallowed-tools flags are only supported with shell backend and will be ignored"));
12669
+ if ((options.tools || options.allowedTools || options.appendAllowedTools || options.disallowedTools) && selectedBackend !== "shell") {
12670
+ console.error(chalk15__default.default.yellow("\n\u26A0\uFE0F Note: --tools, --allowed-tools, --append-allowed-tools and --disallowed-tools flags are only supported with shell backend and will be ignored"));
12671
+ }
12672
+ if (options.allowedTools && options.appendAllowedTools) {
12673
+ console.error(chalk15__default.default.red("\n\u274C Error: --allowed-tools and --append-allowed-tools are mutually exclusive. Use one or the other."));
12674
+ process.exit(1);
12622
12675
  }
12623
12676
  const executionRequest = createExecutionRequest({
12624
12677
  instruction,
@@ -12629,7 +12682,11 @@ async function mainCommandHandler(args, options, command) {
12629
12682
  model: options.model || config.defaultModel,
12630
12683
  agents: options.agents,
12631
12684
  tools: options.tools,
12632
- disallowedTools: options.disallowedTools
12685
+ allowedTools: options.allowedTools,
12686
+ appendAllowedTools: options.appendAllowedTools,
12687
+ disallowedTools: options.disallowedTools,
12688
+ resume: options.resume,
12689
+ continueConversation: options.continue
12633
12690
  });
12634
12691
  const coordinator = new MainExecutionCoordinator(config, options.verbose, options.enableFeedback || false);
12635
12692
  const result = await coordinator.execute(executionRequest);
@@ -16430,7 +16487,11 @@ async function startCommandHandler(args, options, command) {
16430
16487
  model: options.model,
16431
16488
  agents: options.agents,
16432
16489
  tools: options.tools,
16490
+ allowedTools: options.allowedTools,
16491
+ appendAllowedTools: options.appendAllowedTools,
16433
16492
  disallowedTools: options.disallowedTools,
16493
+ resume: options.resume,
16494
+ continue: options.continue,
16434
16495
  directory: options.directory,
16435
16496
  verbose: options.verbose,
16436
16497
  quiet: options.quiet,
@@ -23708,7 +23769,7 @@ function handleCLIError(error, verbose = false) {
23708
23769
  process.exit(EXIT_CODES.UNEXPECTED_ERROR);
23709
23770
  }
23710
23771
  function setupGlobalOptions(program) {
23711
- 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...>", "Allowed tools for Claude (passed to shell backend, ignored for MCP)").option("--disallowed-tools <tools...>", "Disallowed tools for Claude (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)");
23712
23773
  program.exitOverride((err) => {
23713
23774
  if (err.code === "commander.helpDisplayed") {
23714
23775
  process.exit(0);