Commit Graph

25 Commits

Author SHA1 Message Date
Mohamed Boudra
79aec0069c Improve daemon RPC resiliency and diff handling 2026-02-04 10:21:36 +07:00
Mohamed Boudra
e9325d92be fix: clear timeout handle to prevent event loop from staying alive 2026-02-02 21:15:28 +07:00
Mohamed Boudra
3aecead839 refactor: replace agent self-ID MCP with structured metadata generation 2026-02-02 13:07:04 +07:00
Mohamed Boudra
bf9555829b refactor: replace agent_list polling with request/response RPC pattern 2026-02-01 22:37:32 +07:00
Mohamed Boudra
a473302a9f refactor: use --json flag alias instead of --format json throughout CLI 2026-02-01 12:33:18 +07:00
Mohamed Boudra
25c7d5afa9 refactor: consolidate agent wait methods and use in-memory MCP transport 2026-01-30 14:50:01 +07:00
Mohamed Boudra
0618dc6b0d refactor: rename session_state to agent_list and add subscriptions 2026-01-30 13:39:40 +07:00
Mohamed Boudra
7a8841481e feat: wait returns on permission request and improve CLI logging 2026-01-29 12:12:39 +07:00
Mohamed Boudra
c015fdbef1 refactor: replace agent-control MCP with labels system and Paseo MCP 2026-01-29 11:31:15 +07:00
Mohamed Boudra
dfda6daeed refactor(cli): rename ps to ls and add top-level agent commands 2026-01-29 10:41:19 +07:00
Mohamed Boudra
7d4636ecff feat(cli): add agent logs command
Add `paseo agent logs <id>` command to view agent activity/timeline.

Features:
- View agent timeline entries (messages, tool calls, errors)
- `-f, --follow` flag for real-time streaming
- `--tail <n>` to limit entries shown
- Proper formatting of different timeline item types
2026-01-28 23:46:13 +07:00
Mohamed Boudra
74fceed9b5 feat(cli): add agent inspect command
Add the `paseo agent inspect <id>` command that shows detailed
information about an agent:

- Id, name, provider, model, status, mode, cwd
- Creation timestamp
- Token usage (input, output, cached, cost)
- Capabilities (streaming, persistence, dynamic modes, MCP servers)
- Available modes
- Pending permissions count
- Parent agent ID

The default output is YAML-like key-value pairs. Use `--format json`
or `--format yaml` for machine-readable output with the full agent
snapshot.

Supports agent ID prefix matching.
2026-01-28 23:41:50 +07:00
Mohamed Boudra
f96a4ee3df feat(cli): add agent mode command
Add the `paseo agent mode` command for changing and listing agent
operational modes. Supports setting a mode or listing available modes
with the --list flag.

Usage:
  paseo agent mode <id> <mode>     # Set mode
  paseo agent mode --list <id>     # List available modes
2026-01-28 23:41:14 +07:00
Mohamed Boudra
d78c7d5e07 chore(cli): rename test files from .mts to .ts 2026-01-28 23:34:22 +07:00
Mohamed Boudra
d51d70a6fd feat(cli): add resolveAgentId helper for partial ID matching
Adds a utility function for resolving agent IDs from partial IDs or names.
Supports:
- Full ID match
- Prefix match (first N characters)
- Title/name match (case-insensitive)

Used by agent stop and send commands to allow flexible agent targeting.
2026-01-28 23:27:31 +07:00
Mohamed Boudra
b040e2fc6d feat(cli): add agent stop command
Implements the `agent stop` command for stopping agents.

Features:
- Stop a specific agent by ID (with prefix matching)
- --all flag to stop all running agents
- --cwd flag to stop all agents in a specific directory
- Cancels running agents before terminating them
- Graceful error handling for partially failed stops

Usage:
  paseo agent stop <id>
  paseo agent stop --all
  paseo agent stop --cwd ~/dev/paseo
2026-01-28 23:26:53 +07:00
Mohamed Boudra
851d5ef247 feat(cli): add agent send command
Implements the `agent send` command for sending messages to existing agents.

Features:
- Send follow-up tasks to running agents
- Support for ID prefix matching (e.g., "a1b2" matches "a1b2c3d4")
- --no-wait flag to return immediately without waiting for completion
- Default behavior waits for agent to become idle

Usage:
  paseo agent send <id> <prompt>
  paseo agent send --no-wait a1b2c3d "Run the linter"
2026-01-28 23:25:45 +07:00
Mohamed Boudra
dd514a4a67 feat(cli): add agent run command
Implements the `paseo agent run` command for creating and running agents:
- Creates agent with initial prompt
- `-d, --detach` flag for background execution
- `--name <name>` to assign a title
- `--provider <provider>` to select claude/codex/opencode
- `--mode <mode>` for provider-specific modes
- `--cwd <path>` for working directory
- Supports all output formats (table, json, yaml, quiet)
- Graceful error handling when daemon not running

Usage:
  paseo agent run "Fix the failing tests"
  paseo agent run -d --name "test-fixer" "Run the test suite"
  paseo agent run --mode bypass "Refactor the auth module"

Phase 4 of CLI implementation (TDD checklist 4.1-4.6)
2026-01-28 23:22:57 +07:00
Mohamed Boudra
e38f8292d4 chore(cli): enable strict TypeScript config 2026-01-28 23:22:22 +07:00
Mohamed Boudra
59e6ab2bf5 feat(cli): add agent ps command
Implements the `paseo agent ps` command for listing agents:
- Lists running agents by default
- `-a, --all` flag to include archived agents
- `--status <status>` filter by agent status
- `--cwd <path>` filter by working directory
- Supports all output formats (table, json, yaml, quiet)
- Graceful error handling when daemon not running

Output format:
AGENT ID    NAME              PROVIDER  STATUS   CWD                    CREATED
a1b2c3d     🎭 Test fixer     claude    running  ~/dev/paseo            2 minutes ago

Phase 3 of CLI implementation (TDD checklist 3.1-3.5)
2026-01-28 23:13:38 +07:00
Mohamed Boudra
3ed4d4519f test(cli): add daemon command tests
Add tests for daemon commands (Phase 2 from TDD checklist):
- daemon --help shows subcommands
- daemon status fails gracefully when daemon not running
- daemon status --format json outputs JSON
- daemon stop handles daemon not running gracefully
- daemon restart fails when daemon not running

These tests focus on error cases and help output since daemon start
may not be fully implemented yet.
2026-01-28 23:02:45 +07:00
Mohamed Boudra
a7f39f79ba feat(cli): implement output abstraction layer 2026-01-28 22:57:15 +07:00
Mohamed Boudra
aa5663a854 docs(cli): add output architecture design
Design document for the CLI output abstraction layer that enables:
- Commands returning structured data instead of formatted strings
- Multiple output formats (table, json, yaml, quiet)
- Testable output without parsing strings
- Streaming support for logs/attach commands

Draws from patterns in Docker CLI, kubectl, and GitHub CLI.
2026-01-28 22:51:06 +07:00
Mohamed Boudra
6fd4214466 test(cli): add zx TDD infrastructure and phase 1 tests
- Install zx as devDependency for E2E testing
- Create tests/ directory with setup utilities
- Add setup.ts with test context helpers:
  - Random port generation (never 6767)
  - Temp directory creation for PASEO_HOME and workDir
  - Daemon startup/waitForDaemon helper (WebSocket only)
  - Cleanup function
  - paseo() helper to run CLI commands against test daemon
- Add Phase 1 foundation tests (01-foundation.test.mts):
  - Test paseo --version outputs version
  - Test paseo --help shows commands
- Add test runner (run-all.mts) that discovers and runs all tests
- Add test:e2e script to package.json
2026-01-28 22:47:08 +07:00
Mohamed Boudra
6781c1b888 feat(cli): add foundation - package setup and entry point
Add @paseo/cli package with:
- Package structure with npm workspace integration
- bin/paseo entry point using tsx
- Commander.js setup with --version and --help
- Placeholder subcommands: agent, daemon, permit, worktree, provider
2026-01-28 22:42:08 +07:00