10 Jun 2026

Agents

Agent loops read, edit, run, call MCP tools.

Modes: guided pauses every step. auto applies safe edits. developer uses blocklist instead of allowlist.

Commands: categories read, inspect, write, destructive. Auto-approve skips approval. Audit log records everything.

New files: loops only edit files in diagnostic context. Use :proposal create <path> <content>:proposal approve <id>:proposal apply <id>.

Chat triggers: loops start for temp app keywords (page, app, preview). Background jobs don't block chat.

# Start a loop
POST /api/agent/loops {"goal": "fix lint errors", "mode": "auto"}

# Create a proposal
POST /api/agent/edit-proposals {"path": "main.go", "content": "..."}

# Approve
PATCH /api/agent/edit-proposals/{id} {"status": "approved"}

# Apply
POST /api/agent/edit-proposals/{id}/apply

# Background job
POST /api/agent/background-jobs {"goal": "run tests", "mode": "auto"}
POST /api/agent/background-jobs/{id}/cancel

# Command check
POST /api/agent/command-checks {"command": "make test"}

# Approve command
POST /api/agent/command-approvals {"command": "make test", "state": "approved"}

# Auto-approve categories
GET /api/agent/auto-approve-categories
PUT /api/agent/auto-approve-categories {"categories": ["read", "inspect"]}

# List state
GET /api/agent/command-checks
GET /api/agent/command-approvals
GET /api/agent/command-runs

Config: LINEA_WORKSPACE_DIR, LINEA_AGENT_DEVELOPER_MODE, LINEA_AUTO_APPROVE_CATEGORIES, LINEA_AUDIT_LOG_PATH, LINEA_COMMAND_ALLOWLIST.

Web UI: messages like "create a React app" start loops. Edit proposals shown for review.

TUI: linea -tui. Commands: :loop <goal>, :loop auto <goal>, :loop developer <goal>, :proposal create <path> <content>, :agent, :checks, :approvals, :runs, :auto-approve <categories...>.