claude-task-master 0.1.4__py3-none-any.whl → 0.1.6__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.
Files changed (34) hide show
  1. claude_task_master/__init__.py +1 -1
  2. claude_task_master/api/models.py +309 -0
  3. claude_task_master/api/routes.py +229 -0
  4. claude_task_master/api/routes_repo.py +317 -0
  5. claude_task_master/bin/claudetm +1 -1
  6. claude_task_master/cli.py +3 -1
  7. claude_task_master/cli_commands/mailbox.py +295 -0
  8. claude_task_master/cli_commands/workflow.py +37 -0
  9. claude_task_master/core/__init__.py +5 -0
  10. claude_task_master/core/agent_phases.py +1 -1
  11. claude_task_master/core/config.py +3 -3
  12. claude_task_master/core/orchestrator.py +432 -9
  13. claude_task_master/core/parallel.py +4 -4
  14. claude_task_master/core/plan_updater.py +199 -0
  15. claude_task_master/core/pr_context.py +176 -62
  16. claude_task_master/core/prompts.py +4 -0
  17. claude_task_master/core/prompts_plan_update.py +148 -0
  18. claude_task_master/core/prompts_planning.py +6 -2
  19. claude_task_master/core/state.py +5 -1
  20. claude_task_master/core/task_runner.py +73 -34
  21. claude_task_master/core/workflow_stages.py +229 -22
  22. claude_task_master/github/client_pr.py +86 -20
  23. claude_task_master/mailbox/__init__.py +23 -0
  24. claude_task_master/mailbox/merger.py +163 -0
  25. claude_task_master/mailbox/models.py +95 -0
  26. claude_task_master/mailbox/storage.py +209 -0
  27. claude_task_master/mcp/server.py +183 -0
  28. claude_task_master/mcp/tools.py +921 -0
  29. claude_task_master/webhooks/events.py +356 -2
  30. {claude_task_master-0.1.4.dist-info → claude_task_master-0.1.6.dist-info}/METADATA +223 -4
  31. {claude_task_master-0.1.4.dist-info → claude_task_master-0.1.6.dist-info}/RECORD +34 -26
  32. {claude_task_master-0.1.4.dist-info → claude_task_master-0.1.6.dist-info}/WHEEL +1 -1
  33. {claude_task_master-0.1.4.dist-info → claude_task_master-0.1.6.dist-info}/entry_points.txt +0 -0
  34. {claude_task_master-0.1.4.dist-info → claude_task_master-0.1.6.dist-info}/top_level.txt +0 -0
@@ -13,6 +13,7 @@ from ..core.context_accumulator import ContextAccumulator
13
13
  from ..core.credentials import CredentialManager
14
14
  from ..core.logger import LogFormat, LogLevel, TaskLogger
15
15
  from ..core.orchestrator import WorkLoopOrchestrator
16
+ from ..core.plan_updater import PlanUpdater
16
17
  from ..core.planner import Planner
17
18
  from ..core.state import StateManager, StateResumeValidationError, TaskOptions
18
19
  from ..webhooks import WebhookClient
@@ -276,6 +277,12 @@ def start(
276
277
 
277
278
 
278
279
  def resume(
280
+ message: Annotated[
281
+ str | None,
282
+ typer.Argument(
283
+ help="Optional change request to update the plan before resuming",
284
+ ),
285
+ ] = None,
279
286
  force: Annotated[
280
287
  bool,
281
288
  typer.Option("--force", "-f", help="Force resume from failed/blocked state"),
@@ -288,11 +295,16 @@ def resume(
288
295
  - Interrupted by Ctrl+C
289
296
  - Blocked and waiting for intervention
290
297
 
298
+ Optionally provide a message to update the plan before resuming.
299
+ This is useful when requirements change mid-task.
300
+
291
301
  Use --force to recover from a failed state.
292
302
 
293
303
  Examples:
294
304
  claudetm resume
295
305
  claudetm resume --force # Recover from failed state
306
+ claudetm resume "Add authentication to the API"
307
+ claudetm resume "Fix the bug in the login form instead"
296
308
  """
297
309
  console.print("[bold blue]Resuming task...[/bold blue]")
298
310
 
@@ -383,6 +395,31 @@ def resume(
383
395
  state_manager.save_state(state)
384
396
  console.print("\n[yellow]Attempting to resume blocked task...[/yellow]")
385
397
 
398
+ # If a message was provided, update the plan first
399
+ if message:
400
+ console.print("\n[bold cyan]Updating plan with change request...[/bold cyan]")
401
+ console.print(
402
+ f"[dim]Message: {message[:100]}{'...' if len(message) > 100 else ''}[/dim]"
403
+ )
404
+
405
+ plan_updater = PlanUpdater(agent, state_manager, logger=logger)
406
+ try:
407
+ update_result = plan_updater.update_plan(message)
408
+ if update_result["changes_made"]:
409
+ console.print("[green]Plan updated successfully[/green]")
410
+ # Display a brief summary of the updated plan
411
+ plan = state_manager.load_plan()
412
+ if plan:
413
+ # Count tasks
414
+ completed = plan.count("- [x]")
415
+ pending = plan.count("- [ ]")
416
+ console.print(f"[dim]Tasks: {completed} completed, {pending} pending[/dim]")
417
+ else:
418
+ console.print("[yellow]No changes needed to plan[/yellow]")
419
+ except Exception as e:
420
+ console.print(f"[red]Error updating plan: {e}[/red]")
421
+ console.print("[yellow]Continuing with existing plan...[/yellow]")
422
+
386
423
  # Create webhook client if URL was configured
387
424
  wh_client: WebhookClient | None = None
388
425
  if state.options.webhook_url:
@@ -120,6 +120,7 @@ from claude_task_master.core.parallel import (
120
120
  TaskResult,
121
121
  TaskStatus,
122
122
  )
123
+ from claude_task_master.core.plan_updater import PlanUpdater
123
124
  from claude_task_master.core.pr_context import PRContextManager
124
125
  from claude_task_master.core.progress_tracker import (
125
126
  ExecutionTracker,
@@ -132,6 +133,7 @@ from claude_task_master.core.prompts import (
132
133
  PromptSection,
133
134
  build_context_extraction_prompt,
134
135
  build_error_recovery_prompt,
136
+ build_plan_update_prompt,
135
137
  build_planning_prompt,
136
138
  build_task_completion_check_prompt,
137
139
  build_verification_prompt,
@@ -274,6 +276,8 @@ __all__ = [
274
276
  "MaxSessionsReachedError",
275
277
  # Orchestrator classes
276
278
  "WorkLoopOrchestrator",
279
+ # Plan updater classes
280
+ "PlanUpdater",
277
281
  # Task runner exceptions
278
282
  "TaskRunnerError",
279
283
  "NoPlanFoundError",
@@ -309,6 +313,7 @@ __all__ = [
309
313
  "PromptBuilder",
310
314
  "PromptSection",
311
315
  "build_planning_prompt",
316
+ "build_plan_update_prompt",
312
317
  "build_work_prompt",
313
318
  "build_verification_prompt",
314
319
  "build_task_completion_check_prompt",
@@ -22,7 +22,7 @@ if TYPE_CHECKING:
22
22
  T = TypeVar("T")
23
23
 
24
24
 
25
- def run_async_with_cleanup(coro: Coroutine[Any, Any, T]) -> T:
25
+ def run_async_with_cleanup[T](coro: Coroutine[Any, Any, T]) -> T:
26
26
  """Run async coroutine with proper cleanup on KeyboardInterrupt.
27
27
 
28
28
  This ensures that when Ctrl+C is pressed, all pending tasks are cancelled
@@ -109,8 +109,8 @@ class ToolsConfig(BaseModel):
109
109
  """
110
110
 
111
111
  planning: list[str] = Field(
112
- default_factory=lambda: ["Read", "Glob", "Grep", "Bash"],
113
- description="Tools available during planning phase (read-only + bash for checks).",
112
+ default_factory=lambda: ["Read", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"],
113
+ description="Tools available during planning phase (read-only + bash for checks + web tools for research).",
114
114
  )
115
115
  verification: list[str] = Field(
116
116
  default_factory=lambda: ["Read", "Glob", "Grep", "Bash"],
@@ -152,7 +152,7 @@ class ClaudeTaskMasterConfig(BaseModel):
152
152
  "auto_push": true
153
153
  },
154
154
  "tools": {
155
- "planning": ["Read", "Glob", "Grep", "Bash"],
155
+ "planning": ["Read", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"],
156
156
  "verification": ["Read", "Glob", "Grep", "Bash"],
157
157
  "working": []
158
158
  }