@hydra-acp/cli 0.1.57 → 0.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -51
- package/dist/cli.js +634 -299
- package/dist/index.d.ts +51 -1
- package/dist/index.js +217 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,24 +59,21 @@ Agents are sourced from the [ACP Registry](https://github.com/agentclientprotoco
|
|
|
59
59
|
## Architecture
|
|
60
60
|
|
|
61
61
|
```
|
|
62
|
-
editor
|
|
63
|
-
│
|
|
64
|
-
|
|
65
|
-
│
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
│ │ │
|
|
78
|
-
ACP agent A ACP agent B ACP agent C ← agents (the feet)
|
|
79
|
-
(one per session, sourced from the ACP Registry)
|
|
62
|
+
editor browser Slack ← clients
|
|
63
|
+
│ │ │
|
|
64
|
+
hydra-acp hydra-acp-browser hydra-acp-slack ← hydra extensions
|
|
65
|
+
│ │ │
|
|
66
|
+
└───────────────┼───────────────┘
|
|
67
|
+
│
|
|
68
|
+
WSS / HTTP
|
|
69
|
+
│
|
|
70
|
+
hydra-acp ← hydra daemon
|
|
71
|
+
│
|
|
72
|
+
T1 → T2 → … → Tn ← hydra transformers
|
|
73
|
+
│
|
|
74
|
+
┌───────────────┼───────────────┐
|
|
75
|
+
│ │ │
|
|
76
|
+
claude opencode gemini ← agents
|
|
80
77
|
```
|
|
81
78
|
|
|
82
79
|
### How it works
|
|
@@ -156,6 +153,15 @@ npm install -g @hydra-acp/cli
|
|
|
156
153
|
|
|
157
154
|
Drops `hydra-acp` (and `hydra`) on your PATH.
|
|
158
155
|
|
|
156
|
+
Then pick the agent the daemon should spawn by default. `defaultAgent` is the registry id used when `session/new` doesn't specify one (the common case for editor-spawned shims), and `defaultModels[<agent>]` pins a per-agent default model. Both are read once at daemon startup, so a `daemon restart` is needed for changes to take effect:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
hydra-acp agent list # browse known agent ids
|
|
160
|
+
hydra-acp agent set opencode # update the default agent
|
|
161
|
+
hydra-acp agent set opencode openai/gpt-5-codex # update the default model for agent
|
|
162
|
+
hydra-acp daemon restart # restart the daemon to pickup changes
|
|
163
|
+
```
|
|
164
|
+
|
|
159
165
|
## Quick start
|
|
160
166
|
|
|
161
167
|
```bash
|
|
@@ -255,6 +261,12 @@ hydra-acp transformer log <name> [-f] [-n] # tail (default 50) or follow a trans
|
|
|
255
261
|
|
|
256
262
|
hydra-acp agent [list] # list agents in the registry
|
|
257
263
|
hydra-acp agent install <id> # pre-install an agent (else lazy on first use)
|
|
264
|
+
hydra-acp agent set [<id>] [model] # with no args, report the daemon's current default
|
|
265
|
+
# agent and its default model. With <id>, set <id> as
|
|
266
|
+
# the default agent (config.defaultAgent). With <id>
|
|
267
|
+
# and [model], set the per-agent default model
|
|
268
|
+
# (config.defaultModels[<id>]). Writes require
|
|
269
|
+
# `daemon restart` to take effect.
|
|
258
270
|
hydra-acp agent refresh # force a registry re-fetch
|
|
259
271
|
hydra-acp agent sync <id> # spawn <id> just long enough to ACP session/list it,
|
|
260
272
|
# then persist any sessions it remembers as cold rows
|
|
@@ -513,7 +525,9 @@ client ← daemon ← [Tn ← … ← T1] ← agent
|
|
|
513
525
|
|
|
514
526
|
This means a transformer can inspect every prompt before the LLM sees it and every response before it reaches clients or mutates daemon state (model, mode, history). It cannot do this invisibly — the chain is operator-visible and each transformer's intercepts are declared up front.
|
|
515
527
|
|
|
516
|
-
A transformer is configured in the same way as an extension but under a separate key.
|
|
528
|
+
A transformer is configured in the same way as an extension but under a separate key.
|
|
529
|
+
|
|
530
|
+
```json
|
|
517
531
|
{
|
|
518
532
|
"transformers": {
|
|
519
533
|
"my-transformer": {
|
|
@@ -626,40 +640,15 @@ Capabilities advertised in the `initialize` response:
|
|
|
626
640
|
|
|
627
641
|
Hydra is a transparent proxy for prompt content and MCP server configs — they're forwarded to the underlying agent unchanged — so the daemon advertises the union of relevant capabilities. The agent ultimately determines what it accepts. If an editor sends a content type the underlying agent rejects, the rejection surfaces as a normal ACP error from the agent, not a hydra-side error.
|
|
628
642
|
|
|
629
|
-
##
|
|
630
|
-
|
|
631
|
-
All REST endpoints require `Authorization: Bearer <token>`.
|
|
643
|
+
## Protocol surfaces
|
|
632
644
|
|
|
633
|
-
|
|
634
|
-
GET /v1/health # liveness
|
|
635
|
-
GET /v1/sessions # list sessions
|
|
636
|
-
POST /v1/sessions # create session (alternative to ACP session/new)
|
|
637
|
-
POST /v1/sessions/:id/kill # demote a live session to cold (keeps the on-disk record); idempotent
|
|
638
|
-
DELETE /v1/sessions/:id # remove a session entirely (live or cold)
|
|
639
|
-
GET /v1/sessions/:id/export # download a session bundle (*.hydra JSON; meta + history)
|
|
640
|
-
POST /v1/sessions/import # body { bundle, replace? } → { sessionId, importedFromSessionId, replaced }
|
|
641
|
-
# 409 with existingSessionId on a lineageId clash unless replace:true
|
|
642
|
-
GET /v1/agents # list known agents (registry + installed)
|
|
643
|
-
POST /v1/agents/:id/install # pre-install an agent
|
|
644
|
-
GET /v1/registry # current cached registry contents
|
|
645
|
-
POST /v1/registry/refresh # force refresh
|
|
645
|
+
The daemon exposes three surfaces on a single TCP port (default `127.0.0.1:55514`):
|
|
646
646
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
POST /v1/extensions/:name/start
|
|
651
|
-
POST /v1/extensions/:name/stop
|
|
652
|
-
POST /v1/extensions/:name/restart
|
|
653
|
-
|
|
654
|
-
GET /v1/transformers # list configured transformers and live state
|
|
655
|
-
POST /v1/transformers # register a new transformer (takes effect immediately)
|
|
656
|
-
DELETE /v1/transformers/:name # unregister and stop a transformer
|
|
657
|
-
POST /v1/transformers/:name/start
|
|
658
|
-
POST /v1/transformers/:name/stop
|
|
659
|
-
POST /v1/transformers/:name/restart
|
|
660
|
-
```
|
|
647
|
+
- **REST API** at `/v1/*` — management plane (auth, sessions, agents, registry, extensions, transformers, MCP routes).
|
|
648
|
+
- **ACP WebSocket** at `/acp` — JSON-RPC 2.0. Standard ACP plus the Hydra-specific extensions (prompt queue, stdin streaming, transformer plumbing, …).
|
|
649
|
+
- **Agent-facing MCP** at `/mcp/*` — Streamable HTTP MCP transport used by spawned agents to reach the per-session stdin ring buffer and extension-contributed tools.
|
|
661
650
|
|
|
662
|
-
|
|
651
|
+
All three are documented in [`PROTOCOL.md`](PROTOCOL.md), with endpoint shapes, request/response bodies, JSON-RPC method semantics, capability discovery, and the JSON-RPC error code reservations.
|
|
663
652
|
|
|
664
653
|
## Security
|
|
665
654
|
|
|
@@ -673,7 +662,7 @@ The daemon exposes a process-management surface. Treat the service token like an
|
|
|
673
662
|
|
|
674
663
|
## Registry entry mockup
|
|
675
664
|
|
|
676
|
-
If accepted, `hydra-acp`
|
|
665
|
+
If accepted, `hydra-acp` could land in the [ACP Registry](https://github.com/agentclientprotocol/registry):
|
|
677
666
|
|
|
678
667
|
```json
|
|
679
668
|
{
|