juno-code 1.0.29 → 1.0.31

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
@@ -1140,8 +1140,23 @@ async function ensureHooksConfig(baseDir) {
1140
1140
  await fs3__default.default.writeJson(configPath, defaultConfig, { spaces: 2 });
1141
1141
  } else {
1142
1142
  const existingConfig = await fs3__default.default.readJson(configPath);
1143
+ let needsUpdate = false;
1143
1144
  if (!existingConfig.hooks) {
1144
1145
  existingConfig.hooks = allHookTypes;
1146
+ needsUpdate = true;
1147
+ }
1148
+ if (!existingConfig.defaultModel) {
1149
+ const subagent = existingConfig.defaultSubagent || "claude";
1150
+ const modelDefaults = {
1151
+ claude: ":sonnet",
1152
+ codex: "gpt-5",
1153
+ gemini: "gemini-2.5-pro",
1154
+ cursor: "auto"
1155
+ };
1156
+ existingConfig.defaultModel = modelDefaults[subagent] || ":sonnet";
1157
+ needsUpdate = true;
1158
+ }
1159
+ if (needsUpdate) {
1145
1160
  await fs3__default.default.writeJson(configPath, existingConfig, { spaces: 2 });
1146
1161
  }
1147
1162
  }
@@ -3565,6 +3580,18 @@ function createExecutionRequest(options) {
3565
3580
  if (options.agents !== void 0) {
3566
3581
  result.agents = options.agents;
3567
3582
  }
3583
+ if (options.tools !== void 0) {
3584
+ result.tools = options.tools;
3585
+ }
3586
+ if (options.allowedTools !== void 0) {
3587
+ result.allowedTools = options.allowedTools;
3588
+ }
3589
+ if (options.appendAllowedTools !== void 0) {
3590
+ result.appendAllowedTools = options.appendAllowedTools;
3591
+ }
3592
+ if (options.disallowedTools !== void 0) {
3593
+ result.disallowedTools = options.disallowedTools;
3594
+ }
3568
3595
  if (options.mcpServerName !== void 0) {
3569
3596
  result.mcpServerName = options.mcpServerName;
3570
3597
  }
@@ -4014,6 +4041,10 @@ var init_engine = __esm({
4014
4041
  project_path: context.request.workingDirectory,
4015
4042
  ...context.request.model !== void 0 && { model: context.request.model },
4016
4043
  ...context.request.agents !== void 0 && { agents: context.request.agents },
4044
+ ...context.request.tools !== void 0 && { tools: context.request.tools },
4045
+ ...context.request.allowedTools !== void 0 && { allowedTools: context.request.allowedTools },
4046
+ ...context.request.appendAllowedTools !== void 0 && { appendAllowedTools: context.request.appendAllowedTools },
4047
+ ...context.request.disallowedTools !== void 0 && { disallowedTools: context.request.disallowedTools },
4017
4048
  iteration: iterationNumber
4018
4049
  },
4019
4050
  timeout: context.request.timeoutMs || this.engineConfig.config.mcpTimeout,
@@ -7179,6 +7210,22 @@ var init_shell_backend = __esm({
7179
7210
  if (isPython && request.arguments?.agents) {
7180
7211
  args.push("--agents", request.arguments.agents);
7181
7212
  }
7213
+ if (isPython && request.arguments?.tools && Array.isArray(request.arguments.tools)) {
7214
+ args.push("--tools");
7215
+ args.push(...request.arguments.tools);
7216
+ }
7217
+ if (isPython && request.arguments?.allowedTools && Array.isArray(request.arguments.allowedTools)) {
7218
+ args.push("--allowedTools");
7219
+ args.push(...request.arguments.allowedTools);
7220
+ }
7221
+ if (isPython && request.arguments?.appendAllowedTools && Array.isArray(request.arguments.appendAllowedTools)) {
7222
+ args.push("--appendAllowedTools");
7223
+ args.push(...request.arguments.appendAllowedTools);
7224
+ }
7225
+ if (isPython && request.arguments?.disallowedTools && Array.isArray(request.arguments.disallowedTools)) {
7226
+ args.push("--disallowedTools");
7227
+ args.push(...request.arguments.disallowedTools);
7228
+ }
7182
7229
  if (this.config.debug) {
7183
7230
  engineLogger.debug(`Executing script: ${command} ${args.join(" ")}`);
7184
7231
  engineLogger.debug(`Working directory: ${this.config.workingDirectory}`);
@@ -12584,6 +12631,13 @@ async function mainCommandHandler(args, options, command) {
12584
12631
  if (options.agents && selectedBackend !== "shell") {
12585
12632
  console.error(chalk15__default.default.yellow("\n\u26A0\uFE0F Note: --agents flag is only supported with shell backend and will be ignored"));
12586
12633
  }
12634
+ if ((options.tools || options.allowedTools || options.appendAllowedTools || options.disallowedTools) && selectedBackend !== "shell") {
12635
+ 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"));
12636
+ }
12637
+ if (options.allowedTools && options.appendAllowedTools) {
12638
+ console.error(chalk15__default.default.red("\n\u274C Error: --allowed-tools and --append-allowed-tools are mutually exclusive. Use one or the other."));
12639
+ process.exit(1);
12640
+ }
12587
12641
  const executionRequest = createExecutionRequest({
12588
12642
  instruction,
12589
12643
  subagent: options.subagent,
@@ -12591,7 +12645,11 @@ async function mainCommandHandler(args, options, command) {
12591
12645
  workingDirectory: config.workingDirectory,
12592
12646
  maxIterations: options.maxIterations || config.defaultMaxIterations,
12593
12647
  model: options.model || config.defaultModel,
12594
- agents: options.agents
12648
+ agents: options.agents,
12649
+ tools: options.tools,
12650
+ allowedTools: options.allowedTools,
12651
+ appendAllowedTools: options.appendAllowedTools,
12652
+ disallowedTools: options.disallowedTools
12595
12653
  });
12596
12654
  const coordinator = new MainExecutionCoordinator(config, options.verbose, options.enableFeedback || false);
12597
12655
  const result = await coordinator.execute(executionRequest);
@@ -15974,7 +16032,7 @@ ${variables.EDITOR ? `using ${variables.EDITOR} as primary AI subagent` : ""}
15974
16032
  }
15975
16033
  getDefaultModelForSubagent(subagent) {
15976
16034
  const modelDefaults = {
15977
- claude: "sonnet-4",
16035
+ claude: ":sonnet",
15978
16036
  codex: "gpt-5",
15979
16037
  gemini: "gemini-2.5-pro",
15980
16038
  cursor: "auto"
@@ -16391,6 +16449,10 @@ async function startCommandHandler(args, options, command) {
16391
16449
  maxIterations: options.maxIterations,
16392
16450
  model: options.model,
16393
16451
  agents: options.agents,
16452
+ tools: options.tools,
16453
+ allowedTools: options.allowedTools,
16454
+ appendAllowedTools: options.appendAllowedTools,
16455
+ disallowedTools: options.disallowedTools,
16394
16456
  directory: options.directory,
16395
16457
  verbose: options.verbose,
16396
16458
  quiet: options.quiet,
@@ -23668,7 +23730,7 @@ function handleCLIError(error, verbose = false) {
23668
23730
  process.exit(EXIT_CODES.UNEXPECTED_ERROR);
23669
23731
  }
23670
23732
  function setupGlobalOptions(program) {
23671
- 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("--mcp-timeout <number>", "MCP server timeout in milliseconds", parseInt).option("--enable-feedback", "Enable interactive feedback mode (F+Enter to enter, Q+Enter to submit)");
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)");
23672
23734
  program.exitOverride((err) => {
23673
23735
  if (err.code === "commander.helpDisplayed") {
23674
23736
  process.exit(0);
@@ -23686,7 +23748,7 @@ function setupGlobalOptions(program) {
23686
23748
  });
23687
23749
  }
23688
23750
  function setupMainCommand(program) {
23689
- program.option("-p, --prompt <text>", "Prompt input (file path or inline text)").option("-w, --cwd <path>", "Working directory").option("-i, --max-iterations <number>", "Maximum iterations (-1 for unlimited)", parseInt).option("-m, --model <name>", "Model to use (subagent-specific)").option("--agents <agents>", "Agents configuration (forwarded to claude.py when using shell backend)").option("-b, --backend <type>", "Backend to use (mcp, shell)").option("-I, --interactive", "Interactive mode for typing prompts").option("-ip, --interactive-prompt", "Launch TUI prompt editor").action(async (options, command) => {
23751
+ program.option("-p, --prompt <text>", "Prompt input (file path or inline text)").option("-w, --cwd <path>", "Working directory").option("-i, --max-iterations <number>", "Maximum iterations (-1 for unlimited)", parseInt).option("-I, --interactive", "Interactive mode for typing prompts").option("-ip, --interactive-prompt", "Launch TUI prompt editor").action(async (options, command) => {
23690
23752
  try {
23691
23753
  const globalOptions = program.opts();
23692
23754
  const definedGlobalOptions = Object.fromEntries(
@@ -23769,11 +23831,13 @@ function setupCompletion(program) {
23769
23831
  function setupAliases(program) {
23770
23832
  const subagents = ["claude", "cursor", "codex", "gemini"];
23771
23833
  for (const subagent of subagents) {
23772
- program.command(subagent, { hidden: true }).description(`Execute with ${subagent} subagent`).argument("[prompt...]", "Prompt text or file path").option("-i, --max-iterations <number>", "Maximum iterations", parseInt).option("-m, --model <name>", "Model to use").option("-b, --backend <type>", "Backend to use (mcp, shell)").option("-w, --cwd <path>", "Working directory").action(async (prompt, options, command) => {
23834
+ program.command(subagent, { hidden: true }).description(`Execute with ${subagent} subagent`).argument("[prompt...]", "Prompt text or file path").option("-i, --max-iterations <number>", "Maximum iterations", parseInt).option("-w, --cwd <path>", "Working directory").action(async (prompt, options, command) => {
23773
23835
  try {
23774
23836
  const { mainCommandHandler: mainCommandHandler2 } = await Promise.resolve().then(() => (init_main(), main_exports));
23775
23837
  const promptText = Array.isArray(prompt) ? prompt.join(" ") : prompt;
23838
+ const globalOptions = program.opts();
23776
23839
  await mainCommandHandler2([], {
23840
+ ...globalOptions,
23777
23841
  ...options,
23778
23842
  subagent,
23779
23843
  prompt: promptText