Files
Lucas Bento d0cc28d339 feat(daemon): add Amp CLI as a coding-agent adapter (#3861)
* feat(daemon): add Amp CLI as a coding-agent adapter

Amp (ampcode.com) runs headless via `amp -x --stream-json`, which emits
the Claude Code-compatible stream JSON format the daemon already parses,
with the prompt delivered over stdin. Add it as a coding-agent adapter
reusing the claude-stream-json parser; the model picker maps to Amp's
agent --mode (smart/deep/rush).

- new ampAgentDef + registry entry + install metadata
- web agent label/alias
- replay mock (renders via the claude renderer)
- docs adapter-catalog row + README CLI count (21 -> 22)
- adapter buildArgs/stream-format test

* fix(daemon): order Amp adapter at P2, not first-run default

Move ampAgentDef next to copilot (the other P2 local headless CLI adapter)
instead of the head of BASE_AGENT_DEFS. The daemon preserves AGENT_DEFS
order in /api/agents and the web app fills an empty config with
agents.find((a) => a.available), so listing Amp first made it the default
engine ahead of AMR/Claude/Codex for any user with amp on PATH and no
persisted agentId — inconsistent with its P2 classification. Reordering
restores the prior first-run default. Addresses PR review feedback.

---------

Co-authored-by: Siri-Ray <2667192167@qq.com>
2026-06-11 15:17:07 +00:00

11 lines
557 B
Bash
Executable File

#!/usr/bin/env bash
# Mock wrapper for amp — runs the bundled mock-agent in this agent's
# stdout protocol. Amp's `-x --stream-json` emits the Claude Code-compatible
# stream JSON format, so the mock renders via the claude renderer. The
# wrapper accepts (and ignores) any flags the real CLI would take; the mock
# doesn't honor mode selection or tool gates — recording selection is via
# OD_MOCKS_* env vars (see ../README.md).
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
exec node "$HERE/../mock-agent.mjs" --as amp "$@"