# `Agentic.Loop.ContinuationDetector`

Detects plan steps and completion signals in LLM text output.

Ported from Homunculus ContinuationDetector. Uses regex patterns to detect
when the agent signals step completion or task completion.

## Detection Categories

1. **Step completion** — "Step 1 is complete", "Completed step 2"
2. **Task completion** — "All done", "Task finished", "Nothing left to do"
3. **Continuation intent** — "Let me continue", "Moving on to"
4. **Blockers** — "I can't proceed", "I need clarification"
5. **Summary signals** — "In summary", "To summarize"

# `detection`

```elixir
@type detection() :: %{
  category:
    :step_complete | :task_complete | :continuation | :blocker | :summary,
  match: String.t(),
  confidence: float()
}
```

# `blocked?`

```elixir
@spec blocked?(String.t()) :: boolean()
```

Returns true if a blocker is detected.

# `detect`

```elixir
@spec detect(
  String.t(),
  keyword()
) :: [detection()]
```

Detect continuation signals in text. Returns a list of detections sorted
by confidence (highest first). Pass `steps: false` to suppress step detection.

# `extract_step_number`

```elixir
@spec extract_step_number(String.t()) :: integer() | nil
```

Extract the first step number mentioned as complete.

# `step_complete?`

```elixir
@spec step_complete?(String.t()) :: boolean()
```

Returns true if any step completion is detected.

# `task_complete?`

```elixir
@spec task_complete?(String.t()) :: boolean()
```

Returns true if task completion is detected.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
