zwarm 2.3.5__py3-none-any.whl → 3.0__py3-none-any.whl
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.
- zwarm/cli/main.py +107 -0
- zwarm/cli/pilot.py +1000 -0
- zwarm/prompts/__init__.py +3 -0
- zwarm/prompts/orchestrator.py +36 -29
- zwarm/prompts/pilot.py +147 -0
- zwarm/tools/delegation.py +71 -27
- {zwarm-2.3.5.dist-info → zwarm-3.0.dist-info}/METADATA +1 -1
- {zwarm-2.3.5.dist-info → zwarm-3.0.dist-info}/RECORD +10 -8
- {zwarm-2.3.5.dist-info → zwarm-3.0.dist-info}/WHEEL +0 -0
- {zwarm-2.3.5.dist-info → zwarm-3.0.dist-info}/entry_points.txt +0 -0
zwarm/cli/main.py
CHANGED
|
@@ -79,6 +79,7 @@ app = typer.Typer(
|
|
|
79
79
|
[cyan]init[/] Initialize zwarm (creates .zwarm/ with config)
|
|
80
80
|
[cyan]reset[/] Reset state and optionally config files
|
|
81
81
|
[cyan]orchestrate[/] Start orchestrator to delegate tasks to executors
|
|
82
|
+
[cyan]pilot[/] Conversational orchestrator REPL (interactive)
|
|
82
83
|
[cyan]exec[/] Run a single executor directly (for testing)
|
|
83
84
|
[cyan]status[/] Show current state (sessions, tasks, events)
|
|
84
85
|
[cyan]history[/] Show event history log
|
|
@@ -274,6 +275,112 @@ def orchestrate(
|
|
|
274
275
|
sys.exit(1)
|
|
275
276
|
|
|
276
277
|
|
|
278
|
+
class PilotLM(str, Enum):
|
|
279
|
+
"""LM options for pilot mode."""
|
|
280
|
+
gpt5_mini = "gpt5-mini" # GPT5MiniTester - fast, cheap, good for testing
|
|
281
|
+
gpt5 = "gpt5" # GPT5Large - standard
|
|
282
|
+
gpt5_verbose = "gpt5-verbose" # GPT5LargeVerbose - with extended thinking
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
@app.command()
|
|
286
|
+
def pilot(
|
|
287
|
+
task: Annotated[Optional[str], typer.Option("--task", "-t", help="Initial task (optional)")] = None,
|
|
288
|
+
task_file: Annotated[Optional[Path], typer.Option("--task-file", "-f", help="Read task from file")] = None,
|
|
289
|
+
config: Annotated[Optional[Path], typer.Option("--config", "-c", help="Path to config YAML")] = None,
|
|
290
|
+
overrides: Annotated[Optional[list[str]], typer.Option("--set", help="Override config (key=value)")] = None,
|
|
291
|
+
working_dir: Annotated[Path, typer.Option("--working-dir", "-w", help="Working directory")] = Path("."),
|
|
292
|
+
instance: Annotated[Optional[str], typer.Option("--instance", "-i", help="Instance ID (for isolation)")] = None,
|
|
293
|
+
instance_name: Annotated[Optional[str], typer.Option("--name", "-n", help="Human-readable instance name")] = None,
|
|
294
|
+
model: Annotated[PilotLM, typer.Option("--model", "-m", help="LM to use")] = PilotLM.gpt5_verbose,
|
|
295
|
+
):
|
|
296
|
+
"""
|
|
297
|
+
Interactive conversational orchestrator REPL.
|
|
298
|
+
|
|
299
|
+
Like 'orchestrate' but conversational: give instructions, watch the
|
|
300
|
+
orchestrator work, course-correct in real-time, time-travel to checkpoints.
|
|
301
|
+
|
|
302
|
+
[bold]Features:[/]
|
|
303
|
+
- Streaming display of orchestrator thinking and tool calls
|
|
304
|
+
- Turn-by-turn execution with checkpoints
|
|
305
|
+
- Time travel (:goto T1) to return to previous states
|
|
306
|
+
- Session visibility (:sessions) and state inspection (:state)
|
|
307
|
+
|
|
308
|
+
[bold]Commands:[/]
|
|
309
|
+
:help Show help
|
|
310
|
+
:history [N|all] Show turn checkpoints
|
|
311
|
+
:goto <turn|root> Time travel (e.g., :goto T1)
|
|
312
|
+
:state Show orchestrator state
|
|
313
|
+
:sessions Show active executor sessions
|
|
314
|
+
:reasoning on|off Toggle reasoning display
|
|
315
|
+
:quit Exit
|
|
316
|
+
|
|
317
|
+
[bold]LM Options:[/]
|
|
318
|
+
gpt5-mini GPT5MiniTester - fast/cheap, good for testing
|
|
319
|
+
gpt5 GPT5Large - standard model
|
|
320
|
+
gpt5-verbose GPT5LargeVerbose - with extended thinking (default)
|
|
321
|
+
|
|
322
|
+
[bold]Examples:[/]
|
|
323
|
+
[dim]# Start fresh, give instructions interactively[/]
|
|
324
|
+
$ zwarm pilot
|
|
325
|
+
|
|
326
|
+
[dim]# Start with an initial task[/]
|
|
327
|
+
$ zwarm pilot --task "Build user authentication"
|
|
328
|
+
|
|
329
|
+
[dim]# Use faster model for testing[/]
|
|
330
|
+
$ zwarm pilot --model gpt5-mini
|
|
331
|
+
|
|
332
|
+
[dim]# Named instance[/]
|
|
333
|
+
$ zwarm pilot --name my-feature
|
|
334
|
+
"""
|
|
335
|
+
from zwarm.cli.pilot import run_pilot, build_pilot_orchestrator
|
|
336
|
+
|
|
337
|
+
# Resolve task (optional for pilot)
|
|
338
|
+
resolved_task = _resolve_task(task, task_file)
|
|
339
|
+
|
|
340
|
+
console.print(f"[bold]Starting pilot session...[/]")
|
|
341
|
+
console.print(f" Working dir: {working_dir.absolute()}")
|
|
342
|
+
console.print(f" Model: {model.value}")
|
|
343
|
+
if resolved_task:
|
|
344
|
+
console.print(f" Initial task: {resolved_task[:60]}...")
|
|
345
|
+
if instance:
|
|
346
|
+
console.print(f" Instance: {instance}" + (f" ({instance_name})" if instance_name else ""))
|
|
347
|
+
console.print()
|
|
348
|
+
|
|
349
|
+
orchestrator = None
|
|
350
|
+
try:
|
|
351
|
+
orchestrator = build_pilot_orchestrator(
|
|
352
|
+
config_path=config,
|
|
353
|
+
working_dir=working_dir.absolute(),
|
|
354
|
+
overrides=list(overrides or []),
|
|
355
|
+
instance_id=instance,
|
|
356
|
+
instance_name=instance_name,
|
|
357
|
+
lm_choice=model.value,
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
# Show instance ID if auto-generated
|
|
361
|
+
if orchestrator.instance_id and not instance:
|
|
362
|
+
console.print(f" [dim]Instance: {orchestrator.instance_id[:8]}[/]")
|
|
363
|
+
|
|
364
|
+
# Run the pilot REPL
|
|
365
|
+
run_pilot(orchestrator, initial_task=resolved_task)
|
|
366
|
+
|
|
367
|
+
# Save state on exit
|
|
368
|
+
orchestrator.save_state()
|
|
369
|
+
console.print("\n[dim]State saved.[/]")
|
|
370
|
+
|
|
371
|
+
except KeyboardInterrupt:
|
|
372
|
+
console.print("\n\n[yellow]Interrupted.[/]")
|
|
373
|
+
if orchestrator:
|
|
374
|
+
orchestrator.save_state()
|
|
375
|
+
console.print("[dim]State saved.[/]")
|
|
376
|
+
sys.exit(1)
|
|
377
|
+
except Exception as e:
|
|
378
|
+
console.print(f"\n[red]Error:[/] {e}")
|
|
379
|
+
import traceback
|
|
380
|
+
traceback.print_exc()
|
|
381
|
+
sys.exit(1)
|
|
382
|
+
|
|
383
|
+
|
|
277
384
|
@app.command()
|
|
278
385
|
def exec(
|
|
279
386
|
task: Annotated[str, typer.Option("--task", "-t", help="Task to execute")],
|