63 Commits

Author SHA1 Message Date
Mohamed Boudra
25a6f204a4 chore(release): cut 0.1.4 2026-02-14 13:52:34 +07:00
Mohamed Boudra
c4bebb97ab Improve connection selection and agent hydration reliability 2026-02-14 11:31:57 +07:00
Mohamed Boudra
d6f21b3568 refactor(cli): centralize worktree ls path resolution
What I changed:\n- Refactored worktree path handling in worktree ls into focused helpers: resolvePaseoHomePath, resolvePaseoWorktreesDir, and isAgentInManagedWorktree.\n- Switched worktree name extraction to node:path basename for clearer intent and path handling.\n- Added a focused regression test (20-worktree-ls-paths.test.ts) covering explicit PASEO_HOME and fallback home resolution behavior.\n\nReasoning:\n- The prior implementation repeated path derivation inline inside the agent loop, mixed decision logic with mapping, and relied on string concatenation for filesystem boundaries.\n- Extracting this logic reduces cognitive load, keeps policy in one place, and makes behavior directly testable without daemon dependencies.\n\nVerification:\n- npx tsx packages/cli/tests/20-worktree-ls-paths.test.ts\n- npx tsx packages/cli/tests/14-worktree.test.ts\n- npm run typecheck (all workspaces)\n\nNotes for next agent:\n- Similar inline PASEO_HOME/path derivation still exists in other CLI commands; these helpers can be reused to continue consistency work.\n- No behavior change intended for command output or error semantics; this was a structural-only refactor aligned with refactor-skill constraints.
2026-02-14 08:38:06 +07:00
Mohamed Boudra
86b291814b test(cli): deflake daemon command integration assertions
What changed:
- Updated packages/cli/tests/03-daemon.test.ts to match current daemon command semantics where  reports local state and exits successfully when stopped.
- Removed host-based failure assumptions from status/status --json checks and asserted deterministic  output for an isolated PASEO_HOME.
- Hardened restart coverage to use an isolated random port and explicit cleanup via .
- Added best-effort forced cleanup in  to avoid leaking a daemon process if assertions fail mid-test.

Reasoning:
- Recent CLI refactors switched  from connection-failure behavior to local PID/config introspection, so the old test expectation () became incorrect and flaky.
- The restart path can occasionally exceed graceful stop timeout immediately after spawn; forced cleanup makes the test reliable without changing product behavior.
- This is a behavior-preserving test hardening refactor aligned with the refactor skill contract.

Verification:
- npx tsx packages/cli/tests/03-daemon.test.ts
- npm run typecheck

Accomplishments for next agent:
-  now validates current status semantics and no longer depends on transient host connectivity assumptions.
- Restart coverage now cleans up deterministically, reducing local test pollution and follow-on failures.

Challenges / notes for next agent:
- Restart cleanup still depends on process management timing; this test now uses  cleanup intentionally to keep CI/dev runs stable.
- If you later tighten restart lifecycle behavior, consider adding a dedicated unit-level test around stop timeout + escalation in local daemon utilities.
2026-02-14 08:25:50 +07:00
Mohamed Boudra
004bb0ea33 refactor(cli): unify daemon start error message handling
What changed:
- Added a shared utility `getErrorMessage(error: unknown)` in `packages/cli/src/utils/errors.ts`.
- Refactored `packages/cli/src/commands/daemon/start.ts` to use `getErrorMessage` and a local `exitWithError` helper instead of repeating inline error-message extraction + exit logic in each catch block.
- Added `packages/cli/tests/19-errors-utils.test.ts` to lock utility behavior for Error and non-Error throw values.

Reasoning:
- `runStart` had repeated branching (`err instanceof Error ? err.message : String(err)`) across multiple catch sites.
- Centralizing this keeps behavior stable while reducing duplication and cognitive overhead, aligned with the refactor skill guidance to simplify structure without changing user-visible behavior.

Verification:
- Ran `npx tsx packages/cli/tests/18-local-daemon-utils.test.ts` (pass).
- Ran `npx tsx packages/cli/tests/19-errors-utils.test.ts` (pass).
- Ran `npm run -w @getpaseo/cli typecheck` (pass).

Notes for next agent:
- Existing `scripts/codex-refactor-loop.sh` was already modified before this change and is intentionally not included.
- `packages/cli/tests/03-daemon.test.ts` currently failed in this environment because Test 3 expected daemon status failure, but command exited successfully (likely environment state dependent). This refactor does not touch that path; worth deflakifying or isolating in a follow-up.
2026-02-14 01:51:36 +07:00
Mohamed Boudra
6ff1c42132 refactor(cli): simplify agent mode validation flow
What I changed:
- extracted a single missingModeError helper in agent/mode.ts so the command no longer duplicates the same command error payload in two branches
- flattened control flow by returning early for --list and using one set-mode path guarded by explicit missing-mode validation
- tightened tests/10-agent-mode.test.ts to assert the exact missing-mode error message instead of allowing a daemon-connection fallback

Reasoning:
- this keeps behavior the same while reducing branch duplication and making the validation contract explicit
- the hardened test protects the intended precedence: missing required mode should fail before any daemon interaction

Verification:
- npm run typecheck
- (cd packages/cli && npx tsx tests/10-agent-mode.test.ts)

Notes for next agent:
- repository had a pre-existing local modification in scripts/codex-refactor-loop.sh; I intentionally did not touch or stage it
- no blockers encountered for this refactor
2026-02-14 01:39:01 +07:00
Mohamed Boudra
80f0ca08f9 refactor(cli): centralize daemon errno parsing and add utility tests
What changed:
- extracted shared readNodeErrnoCode helper in local daemon process control code
- updated isProcessRunning and signalProcess to use the shared helper
- added packages/cli/tests/18-local-daemon-utils.test.ts covering resolveTcpHostFromListen cases (numeric, host:port, unix sockets, empty/non-host)

Why:
- removes duplicated low-level error-shape branching and keeps errno handling consistent in one place
- adds deterministic coverage for pure listen parsing logic without depending on daemon runtime state

Accomplishments for next agent:
- this area now has a focused utility test entry that runs fast and is independent of daemon availability
- full workspace typecheck is clean after this change

Challenges / notes for next agent:
- packages/cli/tests/03-daemon.test.ts can be environment-sensitive when a daemon is already running (baseline in this workspace did not reliably represent daemon not running)
- existing unstaged change remains in scripts/codex-refactor-loop.sh and was intentionally left untouched
2026-02-14 01:26:54 +07:00
Mohamed Boudra
193c723714 refactor(cli): simplify agent mode command control flow
Context from recent agent work
- Prior commits focused on voice/background model gating, speech resolver typing, and timeline cursor loading.
- This change targets a separate CLI command path to avoid overlap.

What changed
- Normalized the optional mode argument once (`mode?.trim()`) and reused it.
- Removed duplicated `client.close()` calls and centralized cleanup in a `finally` block.
- Typed the daemon client variable explicitly (`Awaited<ReturnType<typeof connectToDaemon>> | undefined`).
- Kept user-facing behavior and error codes stable, including DAEMON_NOT_RUNNING and MODE_OPERATION_FAILED.

Reasoning
- The previous implementation duplicated lifecycle handling and relied on non-null assertions for mode values.
- Centralized resource cleanup lowers leak risk and makes control flow easier to audit.
- This is a behavior-preserving refactor aligned with the refactor skill contract.

Verification
- `npm run typecheck`
- `npx tsx packages/cli/tests/10-agent-mode.test.ts`

Accomplishments for next agent
- `runModeCommand` now has a single cleanup path and clearer branching for list vs set mode.
- Mode argument handling is explicit and trimmed before use.

Challenges / follow-up
- CLI output typing still requires `AnyCommandResult<any>` for mixed-shape commands due the current `withOutput` generic design.
- If desired, a future refactor can redesign output typing to support per-branch result schemas without `any`.
2026-02-14 01:23:01 +07:00
Mohamed Boudra
b8f6115465 Merge pull request #29 from getpaseo/voice/background-downloading
Decouple onboarding from voice model downloads and gate unavailable voice starts
2026-02-14 01:04:06 +07:00
Mohamed Boudra
8169134ac3 refactor timeline loading to cursor-based fetch API 2026-02-14 01:03:36 +07:00
Mohamed Boudra
cfd061a86d feat(voice): background local model downloads with runtime gating 2026-02-13 23:23:28 +07:00
Mohamed Boudra
69f851aa14 Update files 2026-02-13 09:09:39 +00:00
Mohamed Boudra
6f6677fc7a chore(release): cut 0.1.3 and add release playbook 2026-02-12 18:22:33 +07:00
Mohamed Boudra
cb2e4aacfe feat(cli): add --output-schema flag for structured agent output 2026-02-12 18:04:39 +07:00
Mohamed Boudra
018edef3bb feat: add onboarding command and migrate git diff to checkout API 2026-02-12 17:00:35 +07:00
Mohamed Boudra
fba7c73c8b feat(cli): add agent update command for name and labels 2026-02-12 14:15:33 +07:00
Mohamed Boudra
6053ee7c34 fix(cli): list all non-archived agents by default and drop ls --ui 2026-02-12 14:05:46 +07:00
Mohamed Boudra
00be27c9cc chore: bump workspace versions to 0.1.2 2026-02-11 14:39:30 +07:00
Mohamed Boudra
7e924e208a chore: sync internal workspace deps for 0.1.1 2026-02-11 14:37:41 +07:00
Mohamed Boudra
5181d715bf chore: bump workspace versions to 0.1.1 2026-02-11 14:34:36 +07:00
Mohamed Boudra
a57c907013 Default paseo to start daemon and seed first-run config 2026-02-11 12:41:17 +07:00
Mohamed Boudra
ec7ea4b55a Update files 2026-02-10 16:26:51 +07:00
Mohamed Boudra
7e5537bcc5 Update files 2026-02-10 13:43:07 +07:00
Mohamed Boudra
ade4fb2e45 Update files 2026-02-10 11:43:07 +07:00
Mohamed Boudra
6d115074e9 Update files 2026-02-09 11:11:11 +07:00
Mohamed Boudra
f9ebf6b523 Add device pairing command and voice mute toggle
Introduce `paseo daemon pair` CLI command that generates a local pairing offer URL with QR code without requiring a running daemon. Update message input to support mute/unmute toggle during realtime voice sessions with visual feedback (MicOff icon). Fix android:prod build script to use prebuild + assembleRelease flow.
2026-02-07 15:56:14 +07:00
Mohamed Boudra
6cfae77a71 Update files 2026-02-07 12:52:22 +07:00
Mohamed Boudra
8c70b3d86b voice: harden local voice stack and enforce UUID agent ids 2026-02-06 21:27:50 +07:00
Mohamed Boudra
e782fdd35d voice: switch internal MCP path to stdio unix-socket bridge 2026-02-06 19:05:45 +07:00
Mohamed Boudra
4d28499482 Merge origin/main into local-streaming-speech-tts 2026-02-06 13:45:31 +07:00
Mohamed Boudra
277080a004 Refactor speech providers to stream-first local/openai architecture 2026-02-06 12:43:10 +07:00
Mohamed Boudra
88ec20a511 Use system Claude binary for model listing
The bundled SDK binary had stale model definitions. Resolve the
system `claude` path once and pass it via pathToClaudeCodeExecutable
so both agent sessions and supportedModels() use the up-to-date
binary.

Replace the CLI's hardcoded static model list with a live call to
the daemon's listProviderModels endpoint.
2026-02-06 12:14:52 +07:00
Mohamed Boudra
8f9100f6a9 chore: remove packages/cli/docs 2026-02-05 14:35:55 +07:00
Mohamed Boudra
8d1d7b7603 chore: migrate PASEO_PORT to PASEO_LISTEN across codebase 2026-02-05 14:35:35 +07:00
Mohamed Boudra
8cf86a5d98 chore: align server package name for workspaces 2026-02-05 13:12:53 +07:00
Mohamed Boudra
058c03684a Update files 2026-02-05 12:50:15 +07:00
Mohamed Boudra
807a29e8f4 Merge remote-tracking branch 'origin/main' into error-handling/rpc-unknown-schema
# Conflicts:
#	packages/server/src/utils/checkout-git.ts
2026-02-04 10:22:32 +07:00
Mohamed Boudra
79aec0069c Improve daemon RPC resiliency and diff handling 2026-02-04 10:21:36 +07:00
Mohamed Boudra
0aa2fede08 Update files 2026-02-04 10:18:51 +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