feat(FN-986): add agent stop/start CLI commands and extension tools

- Add `fn agent stop <id>` and `fn agent start <id>` CLI commands for pausing/resuming agents
- Add `kb_agent_stop` and `kb_agent_start` tools to the pi extension for in-session agent control
- Validate state transitions using AGENT_VALID_TRANSITIONS before applying changes
- Export AgentStore from @fusion/core public API
- Add comprehensive tests for agent CLI commands (210 lines)
- Add changeset for @gsxdsm/fusion patch release
This commit is contained in:
gsxdsm
2026-04-05 16:15:22 -07:00
parent 7f68136e5b
commit 3fb3e819af
11 changed files with 498 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ Mission → Milestone → Slice → Feature → Task
- **Task tools** — `kb_task_create`, `kb_task_update`, `kb_task_list`, `kb_task_show`, `kb_task_attach`, `kb_task_pause`, `kb_task_unpause`, `kb_task_retry`, `kb_task_duplicate`, `kb_task_refine`, `kb_task_archive`, `kb_task_unarchive`, `kb_task_delete`, `kb_task_plan`
- **GitHub tools** — `kb_task_import_github`, `kb_task_import_github_issue`, `kb_task_browse_github_issues`
- **Mission tools** — `kb_mission_create`, `kb_mission_list`, `kb_mission_show`, `kb_mission_delete`, `kb_milestone_add`, `kb_slice_add`, `kb_feature_add`, `kb_slice_activate`, `kb_feature_link_task`
- **Agent tools** — `kb_agent_stop`, `kb_agent_start`
- **Dashboard** — Use `/fn` command to start/stop the dashboard
</essential_principles>

View File

@@ -246,6 +246,22 @@ Link a feature to a kb task. Updates feature status to triaged.
| `featureId` | string | ✓ | Feature ID (e.g., F-001) |
| `taskId` | string | ✓ | Task ID (e.g., KB-001) |
### kb_agent_stop
Stop (pause) a running agent. Transitions the agent from running/active to paused state.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | ✓ | Agent ID to stop (e.g., agent-abc123) |
### kb_agent_start
Start (resume) a stopped agent. Transitions the agent from paused to active state.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | ✓ | Agent ID to start (e.g., agent-abc123) |
## Dashboard Command
### /fn

View File

@@ -35,6 +35,8 @@ Triage → Todo → In Progress → In Review → Done → Archived
| `kb_feature_add` | Add a feature to a slice |
| `kb_slice_activate` | Activate a pending slice |
| `kb_feature_link_task` | Link a feature to a task |
| `kb_agent_stop` | Stop (pause) a running agent |
| `kb_agent_start` | Start (resume) a stopped agent |
## CLI Commands (fn)