juno-code 1.0.30 → 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.
@@ -33,6 +33,13 @@ class ClaudeService:
33
33
  ":opus": "claude-opus-4-5-20251101",
34
34
  }
35
35
 
36
+ # Default allowed tools (used with --append-allowed-tools)
37
+ DEFAULT_ALLOWED_TOOLS = [
38
+ "Task", "Bash", "Glob", "Grep", "ExitPlanMode", "Read", "Edit", "Write",
39
+ "NotebookEdit", "WebFetch", "TodoWrite", "WebSearch", "BashOutput",
40
+ "KillShell", "Skill", "SlashCommand", "EnterPlanMode"
41
+ ]
42
+
36
43
  def __init__(self):
37
44
  self.model_name = self.DEFAULT_MODEL
38
45
  self.permission_mode = self.DEFAULT_PERMISSION_MODE
@@ -86,6 +93,12 @@ Examples:
86
93
  %(prog)s -p "Add tests" -m :opus --tool Bash --tool Edit
87
94
  %(prog)s -p "Quick task" -m :haiku --disallowed-tool Bash
88
95
  %(prog)s -p "Complex task" -m claude-opus-4-20250514 --tool Read --tool Write
96
+ %(prog)s -p "Multi-tool task" --allowed-tools Bash Edit Read Write
97
+ %(prog)s -p "Restricted task" --disallowed-tools Bash WebSearch
98
+
99
+ Default Tools (enabled by default when no --allowed-tools specified):
100
+ Task, Bash, Glob, Grep, ExitPlanMode, Read, Edit, Write, NotebookEdit,
101
+ WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Skill, SlashCommand, EnterPlanMode
89
102
 
90
103
  Environment Variables:
91
104
  CLAUDE_PROJECT_PATH Project path (default: current directory)
@@ -133,17 +146,31 @@ Environment Variables:
133
146
  )
134
147
 
135
148
  parser.add_argument(
136
- "--tool",
149
+ "--tools",
150
+ action="append",
151
+ dest="tools",
152
+ help="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\"). Forwarded to claude CLI."
153
+ )
154
+
155
+ parser.add_argument(
156
+ "--allowedTools", "--allowed-tools",
137
157
  action="append",
138
158
  dest="allowed_tools",
139
- help="Allowed tools (can be used multiple times, e.g. 'Bash' 'Edit')"
159
+ help="Permission-based filtering of specific tool instances (e.g. 'Bash(git:*)' 'Edit'). Accepts both --allowedTools and --allowed-tools. Default when not specified: Task, Bash, Glob, Grep, ExitPlanMode, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Skill, SlashCommand, EnterPlanMode"
140
160
  )
141
161
 
142
162
  parser.add_argument(
143
- "--disallowed-tool",
163
+ "--disallowedTools", "--disallowed-tools",
144
164
  action="append",
145
165
  dest="disallowed_tools",
146
- help="Disallowed tools (can be used multiple times, e.g. 'Bash' 'Edit'). Default: empty"
166
+ help="Disallowed tools (can be used multiple times, e.g. 'Bash' 'Edit'). Accepts both --disallowedTools and --disallowed-tools. By default, no tools are disallowed"
167
+ )
168
+
169
+ parser.add_argument(
170
+ "--appendAllowedTools", "--append-allowed-tools",
171
+ action="append",
172
+ dest="append_allowed_tools",
173
+ help="Append tools to the default allowed-tools list (mutually exclusive with --allowed-tools). Accepts both --appendAllowedTools and --append-allowed-tools."
147
174
  )
148
175
 
149
176
  parser.add_argument(
@@ -220,28 +247,39 @@ Environment Variables:
220
247
  ]
221
248
 
222
249
  # Build the full prompt (auto_instruction + user prompt)
223
- # IMPORTANT: Prompt must come BEFORE --allowed-tools
224
- # because --allowed-tools consumes all following arguments as tool names
250
+ # IMPORTANT: Prompt must come BEFORE tool-related flags
251
+ # because some flags consume all following arguments
225
252
  full_prompt = f"{self.auto_instruction}\n\n{self.prompt}"
226
253
  cmd.append(full_prompt)
227
254
 
228
- # Add allowed tools if specified (AFTER the prompt)
255
+ # Add available tools from built-in set if specified (AFTER the prompt)
256
+ # Note: --tools controls which built-in Claude tools are available (only works with --print mode)
257
+ if args.tools:
258
+ cmd.append("--tools")
259
+ cmd.extend(args.tools)
260
+ # No else block: By default Claude enables all tools
261
+
262
+ # Handle allowed tools (either --allowed-tools or --append-allowed-tools, but not both)
263
+ # These are mutually exclusive - validation already done above
264
+ # When neither is specified, use the default allowed-tools list
229
265
  if args.allowed_tools:
230
- cmd.append("--allowed-tools")
266
+ # Use the explicitly specified allowed tools (replaces default)
267
+ cmd.append("--allowedTools")
231
268
  cmd.extend(args.allowed_tools)
269
+ elif args.append_allowed_tools:
270
+ # Append specified tools to the default list
271
+ combined_tools = self.DEFAULT_ALLOWED_TOOLS + args.append_allowed_tools
272
+ cmd.append("--allowedTools")
273
+ cmd.extend(combined_tools)
232
274
  else:
233
- # Default allowed tools similar to claude_code.py
234
- default_tools = [
235
- "Read", "Write", "Edit", "MultiEdit",
236
- "Bash", "Glob", "Grep", "WebFetch",
237
- "WebSearch", "TodoWrite"
238
- ]
239
- cmd.append("--allowed-tools")
240
- cmd.extend(default_tools)
275
+ # Use default allowed-tools list when no explicit list is provided
276
+ cmd.append("--allowedTools")
277
+ cmd.extend(self.DEFAULT_ALLOWED_TOOLS)
241
278
 
242
279
  # Add disallowed tools if specified (AFTER the prompt)
280
+ # Note: claude CLI expects camelCase --disallowedTools (not kebab-case --disallowed-tools)
243
281
  if args.disallowed_tools:
244
- cmd.append("--disallowed-tools")
282
+ cmd.append("--disallowedTools")
245
283
  cmd.extend(args.disallowed_tools)
246
284
 
247
285
  # Add continue flag if specified
@@ -541,6 +579,14 @@ Environment Variables:
541
579
  # Parse arguments first to handle --help
542
580
  args = self.parse_arguments()
543
581
 
582
+ # Validate that --allowed-tools and --append-allowed-tools are mutually exclusive
583
+ if args.allowed_tools and args.append_allowed_tools:
584
+ print(
585
+ "Error: --allowed-tools and --append-allowed-tools are mutually exclusive. Use one or the other.",
586
+ file=sys.stderr
587
+ )
588
+ return 1
589
+
544
590
  # Check if prompt is provided
545
591
  if not args.prompt and not args.prompt_file:
546
592
  print(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juno-code",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "TypeScript CLI tool for AI subagent orchestration with code automation",
5
5
  "keywords": [
6
6
  "ai",