# @youngjurry/todo-list

Native task planning and state tracking for Pi. Array-based, branch-replayable, and displayed in a live TUI widget above the editor.

## Features

- One `todo` tool reads or replaces the complete task list
- State persists in tool-result details and follows session branch replay
- Live, width-safe TUI widget with status glyphs and task highlighting
- Ten-segment progress bar with percentage and completed/total counts
- At most one task may be `in_progress`; an all-pending draft is allowed
- Task content is trimmed and validated before replacing state

## Install

```bash
pi install npm:@youngjurry/todo-list
```

Then restart Pi or run `/reload`.

## Usage

### Read the current list

```json
todo({})
```

### Replace the complete list

```json
todo({
  "tasks": [
    { "content": "Do something", "status": "in_progress" },
    { "content": "Do something else", "status": "pending" }
  ]
})
```

### Clear the list

```json
todo({ "tasks": [] })
```

## Statuses

- `pending` — not started
- `in_progress` — actively working
- `completed` — finished

## Development

```bash
npm install
npm run check
npm test
```

## Changelog

### 0.1.2

- Restored the progress bar, percentage, highlighting, and width-safe rendering from 0.1.0
- Kept branch replay and flexible all-pending draft support
- Added whitespace normalization and rejected multiple active tasks
- Fixed package documentation and repository metadata

## License

MIT
