@synap-core/eve 0.1.0

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.
Files changed (64) hide show
  1. package/README.md +251 -0
  2. package/dist/add-R6RGUYER.js +22 -0
  3. package/dist/add-R6RGUYER.js.map +1 -0
  4. package/dist/auth-7FFZNARZ-4OIRGZ7R.js +31 -0
  5. package/dist/auth-7FFZNARZ-4OIRGZ7R.js.map +1 -0
  6. package/dist/chunk-22RIHU4J.js +975 -0
  7. package/dist/chunk-22RIHU4J.js.map +1 -0
  8. package/dist/chunk-23XQDB7K.js +1773 -0
  9. package/dist/chunk-23XQDB7K.js.map +1 -0
  10. package/dist/chunk-5TBV2VHZ.js +6067 -0
  11. package/dist/chunk-5TBV2VHZ.js.map +1 -0
  12. package/dist/chunk-D7P3IYYR.js +44 -0
  13. package/dist/chunk-D7P3IYYR.js.map +1 -0
  14. package/dist/chunk-EHPC7CKE.js +757 -0
  15. package/dist/chunk-EHPC7CKE.js.map +1 -0
  16. package/dist/chunk-FAE5UZFE.js +17 -0
  17. package/dist/chunk-FAE5UZFE.js.map +1 -0
  18. package/dist/chunk-HRF6TNXX.js +53 -0
  19. package/dist/chunk-HRF6TNXX.js.map +1 -0
  20. package/dist/chunk-HVJEW7TU.js +495 -0
  21. package/dist/chunk-HVJEW7TU.js.map +1 -0
  22. package/dist/chunk-JO5H5G6U.js +1529 -0
  23. package/dist/chunk-JO5H5G6U.js.map +1 -0
  24. package/dist/chunk-MUEQNBE6.js +1140 -0
  25. package/dist/chunk-MUEQNBE6.js.map +1 -0
  26. package/dist/chunk-O5WTCVMZ.js +3391 -0
  27. package/dist/chunk-O5WTCVMZ.js.map +1 -0
  28. package/dist/chunk-ROKIQIEX.js +65 -0
  29. package/dist/chunk-ROKIQIEX.js.map +1 -0
  30. package/dist/chunk-T7GCAJK5.js +4895 -0
  31. package/dist/chunk-T7GCAJK5.js.map +1 -0
  32. package/dist/chunk-UOQWJ3S4.js +138 -0
  33. package/dist/chunk-UOQWJ3S4.js.map +1 -0
  34. package/dist/chunk-YQWV5W4U.js +3479 -0
  35. package/dist/chunk-YQWV5W4U.js.map +1 -0
  36. package/dist/chunk-ZPDNZRVW.js +272 -0
  37. package/dist/chunk-ZPDNZRVW.js.map +1 -0
  38. package/dist/config-store-KTOWIKAS-XVZHNPKW.js +11 -0
  39. package/dist/config-store-KTOWIKAS-XVZHNPKW.js.map +1 -0
  40. package/dist/dist-2VRFSXMO.js +40 -0
  41. package/dist/dist-2VRFSXMO.js.map +1 -0
  42. package/dist/dist-C2QB4IKT.js +340 -0
  43. package/dist/dist-C2QB4IKT.js.map +1 -0
  44. package/dist/dist-DEIUVZ57.js +299 -0
  45. package/dist/dist-DEIUVZ57.js.map +1 -0
  46. package/dist/dist-DSKHGECB.js +36 -0
  47. package/dist/dist-DSKHGECB.js.map +1 -0
  48. package/dist/dist-GN2DN7CI.js +95 -0
  49. package/dist/dist-GN2DN7CI.js.map +1 -0
  50. package/dist/dist-TZL4XW2R.js +58 -0
  51. package/dist/dist-TZL4XW2R.js.map +1 -0
  52. package/dist/dist-ZP2APOYV.js +53 -0
  53. package/dist/dist-ZP2APOYV.js.map +1 -0
  54. package/dist/index.js +15083 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/operational-5RT6AZJI-ZEMPD32Q.js +12 -0
  57. package/dist/operational-5RT6AZJI-ZEMPD32Q.js.map +1 -0
  58. package/dist/reconcile-A4I3Z7VX-GQMEN4GC.js +12 -0
  59. package/dist/reconcile-A4I3Z7VX-GQMEN4GC.js.map +1 -0
  60. package/dist/rsshub-GOJBTNOD-UNNVKBFL.js +18 -0
  61. package/dist/rsshub-GOJBTNOD-UNNVKBFL.js.map +1 -0
  62. package/dist/synap-image-install-X36REYQ5-UGO4MAOP.js +17 -0
  63. package/dist/synap-image-install-X36REYQ5-UGO4MAOP.js.map +1 -0
  64. package/package.json +44 -0
package/README.md ADDED
@@ -0,0 +1,251 @@
1
+ # @eve/cli
2
+
3
+ The `eve` command — the entry point to every operation on the Eve
4
+ sovereign stack. Installs components, configures the AI fabric, manages
5
+ domains, drives the dashboard, repairs broken setups.
6
+
7
+ ```bash
8
+ npm install -g @eve/cli
9
+ eve --help
10
+ ```
11
+
12
+ This package is thin: the actual logic lives in the organ packages
13
+ (`@eve/brain`, `@eve/arms`, `@eve/eyes`, `@eve/legs`, `@eve/builder`)
14
+ and `@eve/dna`. The CLI wires them into a single Commander program.
15
+
16
+ ---
17
+
18
+ ## Command surface
19
+
20
+ ```
21
+ eve --version
22
+ eve --help
23
+ ```
24
+
25
+ ### Lifecycle — get a stack running
26
+
27
+ | Command | What it does |
28
+ |---|---|
29
+ | `eve install` / `eve init` | Composable installer. Interactive wizard or `--components <list>` flag. Brings up Traefik, the dashboard, and whatever else you pick. |
30
+ | `eve setup` | Platform prerequisites (Docker / Compose / Node sanity checks). |
31
+ | `eve add <component>` | Install a single component. IDs: `traefik`, `eve-dashboard`, `synap`, `ollama`, `openclaw`, `rsshub`, `hermes`, `openwebui`, `openwebui-pipelines`, `dokploy`, `opencode`, `openclaude`, `nango`. Delegates to `@eve/lifecycle` — same code path the dashboard uses, so install/remove/update behavior is identical from either surface. |
32
+ | `eve remove <component>` | Stop + remove a component (data volumes are kept by default). |
33
+ | `eve birth <name>` | Bootstrap a new "entity" (named workspace inside Synap). |
34
+ | `eve grow` | Pull updates and reconcile the running stack against the registry. |
35
+ | `eve status` | What's installed, what's running, what's missing. |
36
+
37
+ ### Web dashboard
38
+
39
+ | Command | What it does |
40
+ |---|---|
41
+ | `eve ui` | Print the dashboard URL + login key, optionally open the browser. |
42
+ | `eve ui --rebuild` | Rebuild the Docker image from source and restart the container. |
43
+ | `eve ui --stop` | Stop and remove the dashboard container. |
44
+ | `eve ui --status` | Show whether the dashboard container is running. |
45
+ | `eve add eve-dashboard` | (Re-)install the dashboard container — same path as any other component. |
46
+
47
+ The dashboard is a separate package: see [`@eve/dashboard`](../eve-dashboard/README.md).
48
+
49
+ ### AI fabric
50
+
51
+ | Command | What it does |
52
+ |---|---|
53
+ | `eve ai status` | Show configured providers and routing defaults. |
54
+ | `eve ai add <provider>` | Configure OpenAI / Anthropic / OpenRouter / Ollama. Stores key in `~/.eve/secrets.json`. |
55
+ | `eve ai wire` | Push the provider policy to wired components (e.g. OpenClaw `auth-profiles.json`). |
56
+ | `eve ai sync --workspace <uuid>` | Push provider policy to a Synap workspace. |
57
+
58
+ ### Synap auth — per-agent Hub Protocol keys
59
+
60
+ Eve provisions a **separate** Hub Protocol API key for each consumer
61
+ that talks to Synap (Eve itself, OpenClaw, Hermes, OpenWebUI Pipelines).
62
+ Each one has its own pod-side user, audit trail, and revocation handle.
63
+ Keys are minted via `POST /api/hub/setup/agent` using the pod's
64
+ `PROVISIONING_TOKEN` (read from the pod's `deploy/.env`).
65
+
66
+ | Command | What it does |
67
+ |---|---|
68
+ | `eve auth status` | Table of every agent: key prefix, pod user, scopes, age, failure reason if any. |
69
+ | `eve auth status --agent <slug>` | Detail view for one agent (eve, openclaw, hermes, openwebui-pipelines). |
70
+ | `eve auth whoami [--agent <slug>]` | Tight one-liner. Defaults to the `eve` agent. |
71
+ | `eve auth provision` | Mint missing agent keys. Idempotent — skips agents that already have one. |
72
+ | `eve auth provision --agent <slug>` | Mint just one. |
73
+ | `eve auth renew --agent <slug>` | Rotate a single agent's key. |
74
+ | `eve auth renew --all` | Rotate every registered agent's key in one pass. |
75
+
76
+ How it's stored:
77
+
78
+ ```json
79
+ {
80
+ "synap": { "apiUrl": "https://pod.example.com", "apiKey": "<eve-key, mirrored>" },
81
+ "agents": {
82
+ "eve": { "hubApiKey": "...", "agentUserId": "...", "workspaceId": "..." },
83
+ "openclaw": { "hubApiKey": "...", "agentUserId": "...", "workspaceId": "..." },
84
+ "hermes": { "hubApiKey": "...", "agentUserId": "...", "workspaceId": "..." },
85
+ "openwebui-pipelines": { "hubApiKey": "...", "agentUserId": "...", "workspaceId": "..." }
86
+ }
87
+ }
88
+ ```
89
+
90
+ The legacy `synap.apiKey` field is mirrored from the `eve` agent's key
91
+ for one-release back-compat — older readers keep working until they
92
+ move to `secrets.agents[<slug>]`.
93
+
94
+ When does Eve mint keys?
95
+
96
+ - **Fresh install** — every component install runs a post-hook that
97
+ mints its agent's key (e.g. `eve add openclaw` mints
98
+ `agents.openclaw`). Synap install also mints the always-on `eve`
99
+ agent.
100
+ - **Post-update reconcile** — `eve update synap` checks the eve agent
101
+ key and auto-renews on `key_revoked`/`expired`. Detects un-migrated
102
+ installs and runs the legacy migration automatically.
103
+ - **Manual** — `eve auth provision` / `renew` whenever you want.
104
+
105
+ If a renew fails with `PROVISIONING_TOKEN unavailable`, set
106
+ `EVE_PROVISIONING_TOKEN=<token>` (the value from your pod's
107
+ `deploy/.env`) and retry, or run from the pod host so Eve can read
108
+ `deploy/.env` directly.
109
+
110
+ ### Domain & networking
111
+
112
+ | Command | What it does |
113
+ |---|---|
114
+ | `eve domain set <host>` | Set the public hostname. With `--ssl --email <email>` Traefik provisions Let's Encrypt certs. |
115
+ | `eve domain repair` | Re-render Traefik config from secrets and reload the proxy. |
116
+ | `eve domain status` | Show domain, SSL state, exposed services. |
117
+
118
+ ### How the CLI reaches the pod
119
+
120
+ Every Eve command that touches Synap (`auth provision`, `doctor`, the
121
+ update post-hooks, the builder workspace seeder) needs an HTTP base URL
122
+ for the pod. There are two of them, picked automatically:
123
+
124
+ | Where you run `eve` | URL the CLI hits | Why |
125
+ |---|---|---|
126
+ | **On the pod host** (synap-backend container detected, port 4000 reachable on host loopback) | `http://127.0.0.1:4000` — the loopback published by Eve's `docker-compose.override.yml` | Same-host, sub-millisecond, doesn't depend on DNS or TLS. Works during install before any cert is minted. |
127
+ | **Off the pod host** (laptop, remote management) | `https://pod.<domain>` — the public Traefik route from `domain.primary` in `secrets.json` | Only path that traverses the network. Requires DNS + cert + Traefik routing to be healthy. |
128
+
129
+ The transport is plain `fetch` in both cases — same HTTP semantics,
130
+ same retry/timeout knobs. The choice is purely a URL question; there
131
+ is no separate "docker-exec" code path in the happy flow. (The
132
+ `DockerExecRunner` is still exported as a `eve doctor` break-glass
133
+ diagnostic for the rare "the host port is bound but the public URL
134
+ fails" case.)
135
+
136
+ The port mapping is loopback-only (`127.0.0.1:4000:4000` in Compose
137
+ terms) — the host firewall, the Docker bridge, and the public network
138
+ see nothing on that port. Anyone with access to the host already has
139
+ root-equivalent on `/opt/synap-backend`, so this isn't a new attack
140
+ surface. Port 4000 (same as the backend listens on inside the
141
+ container) means the URL already in your `secrets.json` —
142
+ `apiUrl: "http://127.0.0.1:4000"` — is the URL that works.
143
+
144
+ If you have your own `docker-compose.override.yml` for the synap
145
+ deploy, Eve's `ensureSynapLoopbackOverride` won't clobber it (it looks
146
+ for a magic marker comment) — the CLI silently falls back to the
147
+ public URL. Drop the marker line in if you want both your overrides
148
+ and Eve's loopback port. Full design:
149
+ [`team/devops/eve-cli-transports.mdx`](https://github.com/synap-app/synap-team-docs/blob/main/content/team/devops/eve-cli-transports.mdx).
150
+
151
+ ### Image pruning on update
152
+
153
+ `eve update synap` and the from-image install path keep the **last 3
154
+ versions** of every image they pull (`ghcr.io/synap-core/backend`,
155
+ `ghcr.io/synap-core/pod-agent`, etc.) and remove older tags. The
156
+ in-flight image is always protected — Docker refuses `rmi` on an
157
+ image that has a running container, and the prune step runs *after*
158
+ the new container is up. Skipped images (still in use by another
159
+ container) are reported but never abort the update.
160
+
161
+ This solves the "pod host runs out of disk after a year of weekly
162
+ updates" failure mode without anyone needing to run `docker rmi`
163
+ manually. The keep-count is fixed at 3 (giving you 2 rollback steps
164
+ plus the live image); change it via the `pruneImages.keep` field on a
165
+ component's `UpdatePlan` in `@eve/lifecycle/src/index.ts`.
166
+
167
+ ### Debug & repair
168
+
169
+ | Command | What it does |
170
+ |---|---|
171
+ | `eve doctor` | End-to-end diagnostic — Docker, network, secrets, registry consistency. |
172
+ | `eve logs <component>` | Stream `docker logs` for a component. |
173
+ | `eve inspect <component>` | Pretty-print the registry + live container state for a component. |
174
+
175
+ ### Organs (advanced)
176
+
177
+ The CLI exposes each organ as a sub-program for fine-grained ops:
178
+
179
+ | Group | Owns |
180
+ |---|---|
181
+ | `eve brain …` | Synap, data stores, optional Ollama |
182
+ | `eve arms …` | OpenClaw (agent messaging layer), Nango (OAuth connector platform) |
183
+ | `eve eyes …` | RSSHub (perception) |
184
+ | `eve legs …` | Traefik, domains, the dashboard container |
185
+ | `eve builder …` | OpenCode, OpenClaude, Dokploy, Hermes |
186
+
187
+ Each group has its own `--help`. These are mostly used internally by
188
+ the top-level commands above; the public API for day-to-day use is
189
+ `install / add / remove / status / doctor / ui`.
190
+
191
+ ### Management
192
+
193
+ | Command | What it does |
194
+ |---|---|
195
+ | `eve config get <key>` / `eve config set <key> <value>` | Read / write `~/.eve/secrets.json` and registry settings. |
196
+ | `eve backup` / `eve update` | Snapshot + upgrade Synap data. |
197
+ | `eve purge` | Tear down the stack and (optionally) wipe data volumes. |
198
+
199
+ ### Global flags
200
+
201
+ ```
202
+ --json Machine-readable output where supported
203
+ -y, --yes Non-interactive / assume confirm
204
+ --verbose Verbose logs
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Architecture
210
+
211
+ ```
212
+ @eve/cli (this package)
213
+ └── thin Commander shell — registers commands, parses flags, dispatches
214
+
215
+ Depends on:
216
+ ├── @eve/cli-kit — colors, prompts, banners, global flag store
217
+ ├── @eve/dna — registry, secrets contract, entity state
218
+ ├── @eve/lifecycle — install / remove / update / start / stop primitives (shared with the dashboard); returns AsyncIterable<LifecycleEvent> the CLI consumes via spinners, the dashboard via SSE
219
+ ├── @eve/brain — Synap / data stores / Ollama
220
+ ├── @eve/arms — OpenClaw, Nango
221
+ ├── @eve/eyes — RSSHub
222
+ ├── @eve/legs — Traefik, domains, dashboard container
223
+ └── @eve/builder — OpenCode / OpenClaude / Dokploy / Hermes
224
+ ```
225
+
226
+ Each organ package exports a `register*Commands(program)` function that
227
+ attaches its sub-commands to a Commander program. The CLI's only job is
228
+ to wire them together and provide the lifecycle commands
229
+ (`install`, `add`, `remove`, `status`, `doctor`, `ui`, `domain`).
230
+
231
+ ---
232
+
233
+ ## Build
234
+
235
+ ```bash
236
+ pnpm --filter @eve/cli build # tsup → dist/index.js
237
+ pnpm --filter @eve/cli typecheck
238
+ pnpm --filter @eve/cli test # vitest
239
+ ```
240
+
241
+ The `bin` field maps `eve` → `dist/index.js`. After `pnpm build`, the
242
+ binary is available either via `pnpm exec eve` from the workspace root
243
+ or globally if you `npm link` / `pnpm install -g`.
244
+
245
+ ---
246
+
247
+ ## See also
248
+
249
+ - Root: [`hestia-cli/README.md`](../../README.md) — the full Eve product overview.
250
+ - Dashboard: [`packages/eve-dashboard/README.md`](../eve-dashboard/README.md) — the web UI counterpart.
251
+ - DNA: [`packages/@eve/dna`](../@eve/dna) — the registry + secrets contract every command reads from.
@@ -0,0 +1,22 @@
1
+ import { createRequire as __eveCreateRequire } from 'module'; const require = __eveCreateRequire(import.meta.url);
2
+ import {
3
+ addCommand,
4
+ runAdd
5
+ } from "./chunk-MUEQNBE6.js";
6
+ import "./chunk-YQWV5W4U.js";
7
+ import "./chunk-JO5H5G6U.js";
8
+ import "./chunk-22RIHU4J.js";
9
+ import "./chunk-23XQDB7K.js";
10
+ import "./chunk-HVJEW7TU.js";
11
+ import "./chunk-5TBV2VHZ.js";
12
+ import "./chunk-ROKIQIEX.js";
13
+ import "./chunk-O5WTCVMZ.js";
14
+ import "./chunk-T7GCAJK5.js";
15
+ import "./chunk-HRF6TNXX.js";
16
+ import "./chunk-FAE5UZFE.js";
17
+ import "./chunk-D7P3IYYR.js";
18
+ export {
19
+ addCommand,
20
+ runAdd
21
+ };
22
+ //# sourceMappingURL=add-R6RGUYER.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,31 @@
1
+ import { createRequire as __eveCreateRequire } from 'module'; const require = __eveCreateRequire(import.meta.url);
2
+ import {
3
+ ensurePodProvisioningToken,
4
+ getAuthStatus,
5
+ isKeyValid,
6
+ migrateLegacyToAgents,
7
+ provisionAgent,
8
+ provisionAllAgents,
9
+ renewAgentKey,
10
+ resolveProvisioningToken,
11
+ waitForBackend
12
+ } from "./chunk-JO5H5G6U.js";
13
+ import "./chunk-5TBV2VHZ.js";
14
+ import "./chunk-ROKIQIEX.js";
15
+ import "./chunk-O5WTCVMZ.js";
16
+ import "./chunk-T7GCAJK5.js";
17
+ import "./chunk-HRF6TNXX.js";
18
+ import "./chunk-FAE5UZFE.js";
19
+ import "./chunk-D7P3IYYR.js";
20
+ export {
21
+ ensurePodProvisioningToken,
22
+ getAuthStatus,
23
+ isKeyValid,
24
+ migrateLegacyToAgents,
25
+ provisionAgent,
26
+ provisionAllAgents,
27
+ renewAgentKey,
28
+ resolveProvisioningToken,
29
+ waitForBackend
30
+ };
31
+ //# sourceMappingURL=auth-7FFZNARZ-4OIRGZ7R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}