@flame0510/project-aether 1.1.15 → 1.3.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 (60) hide show
  1. package/README.md +2 -1
  2. package/app/agents/ModelSection.tsx +313 -0
  3. package/app/agents/PageClient.tsx +83 -4
  4. package/app/agents/create/page.tsx +8 -21
  5. package/app/api/agents/[id]/model/route.ts +113 -0
  6. package/app/api/agents/[id]/recreate/route.ts +10 -34
  7. package/app/api/agents/[id]/route.ts +10 -29
  8. package/app/api/agents/create/route.ts +59 -57
  9. package/app/api/agents/models-summary/route.ts +163 -0
  10. package/app/api/assistant/route.ts +36 -15
  11. package/app/api/credentials/[id]/sync/route.ts +3 -3
  12. package/app/api/credentials/detect/route.ts +126 -176
  13. package/app/api/credentials/route.ts +3 -0
  14. package/app/api/gateway/agent/route.ts +23 -6
  15. package/app/api/gateway/provider/keys.ts +13 -1
  16. package/app/api/gateway/provider/route.ts +43 -12
  17. package/app/api/gateway/sync.ts +248 -72
  18. package/app/api/models/route.ts +28 -34
  19. package/app/api/provider/auth.ts +65 -0
  20. package/app/api/provider/upstream.ts +9 -2
  21. package/app/api/provider/v1/chat/completions/route.ts +22 -16
  22. package/app/api/provider/v1/models/route.ts +26 -133
  23. package/app/components/PulseChat.tsx +25 -39
  24. package/app/components/Skeleton.tsx +132 -0
  25. package/app/components/ui/RemoveButton.tsx +46 -0
  26. package/app/components/ui/Select.tsx +3 -2
  27. package/app/components/ui/index.ts +1 -0
  28. package/app/credentials/PageClient.tsx +461 -140
  29. package/app/credentials/loading.tsx +19 -5
  30. package/app/gateway/PageClient.tsx +257 -673
  31. package/app/globals.css +8 -0
  32. package/app/lib/models-context.tsx +43 -7
  33. package/app/wizard/useWizard.ts +6 -1
  34. package/bin/rev4a.js +73 -9
  35. package/docs/ARCHITECTURE.md +92 -33
  36. package/docs/FRONTEND-ARCHITECTURE.md +36 -6
  37. package/docs/REV4A.md +62 -30
  38. package/docs/dev/API-REFERENCE.md +490 -227
  39. package/docs/dev/DATABASE.md +8 -3
  40. package/docs/dev/GATEWAY.md +236 -92
  41. package/docs/dev/PROVIDERS.md +44 -44
  42. package/docs/rag/DATA-FRESHNESS.md +57 -28
  43. package/docs/rag/GLOSSARY.md +20 -18
  44. package/docs/rag/REV4A-OVERVIEW.md +28 -32
  45. package/docs/rag/WHAT-I-CAN-ANSWER.md +10 -12
  46. package/instrumentation.ts +9 -1
  47. package/lib/agent-readiness.ts +110 -0
  48. package/lib/channelManager.ts +64 -22
  49. package/lib/container-file.ts +27 -0
  50. package/lib/credentials/delivery.ts +212 -119
  51. package/lib/credentials/detect.ts +229 -97
  52. package/lib/credentials/providers.ts +38 -7
  53. package/lib/credentials/vault.ts +78 -13
  54. package/lib/docker-exec.ts +50 -14
  55. package/lib/model-catalogue.ts +140 -27
  56. package/lib/rev4a-paths.ts +0 -21
  57. package/model-pricing.json +118 -110
  58. package/models.config.json +27 -12
  59. package/package.json +1 -1
  60. package/app/api/gateway/route.ts +0 -191
package/docs/REV4A.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rev4a — VPS Dashboard
2
2
 
3
- > **Last updated:** 2026-08-09
3
+ > **Last updated:** 2026-09-14
4
4
 
5
5
  A Next.js 16 dashboard for monitoring and managing the OpenClaw ecosystem.
6
6
 
@@ -107,22 +107,21 @@ When environment variables are saved via the Config page (Save & Restart):
107
107
 
108
108
  | Route | Description |
109
109
  |---|---|
110
- | `/dashboard` | System overview — containers, resources, quick links |
110
+ | `/` | System overview — containers, resources, quick links |
111
111
  | `/agents` | Running agents (Docker containers with `AGENT_ID`), gateway token management, agent creation wizard, channel manager (Telegram pairing) |
112
112
  | `/containers` | All Docker containers on the host |
113
- | `/onboarding` | First-run setup wizard (Welcome → Providers → Agent → Ready) |
113
+ | `/wizard` | First-run setup wizard (Welcome → Providers → Agent → Ready) |
114
114
  | `/workspace` | File explorer with tree view + editor — VPS host or container workspaces |
115
115
  | `/lineage` | Agent lineage / orchestration tree |
116
116
  | `/memory` | Agent memory browser |
117
117
  | `/crons` | Scheduled cron jobs — auto-discovered from the host gateway and every running agent container (Docker containers with `AGENT_ID` label), on/off toggle, run history per job |
118
- | `/credentials` | Third-party tool credentials (GitHub, Trello, Vercel, Supabase) — JSON vault with audit trail, sync to agent containers via CLI auth (gh, vercel, supabase) or env files (trello) |
118
+ | `/credentials` | Third-party tool credentials (GitHub, Trello, Vercel, Supabase, Notion) — SQLite vault, synced into agent containers as CLI config or, for the REST-only providers, as a config file the agent reads |
119
+ | `/setup` | First-run password setup — sets `REV4A_PASSWORD` and the JWT secret before the dashboard is reachable |
119
120
  | `/plugins` | Plugin manager |
120
- | `/plugins-skills` | Plugin skills |
121
121
  | `/skills` | Skill registry — browse/edit all skills (shared, per-agent workspace, bundled). Promote agent skills to shared with one click. |
122
122
  | `/tools` | Tool configuration |
123
- | `/gateway` | LLM provider sync + agent model configuration — see [GATEWAY.md](dev/GATEWAY.md) |
123
+ | `/gateway` | LLM provider keys, model catalogue and sync — see [GATEWAY.md](dev/GATEWAY.md) |
124
124
  | `/config` | Environment management and server restart |
125
- | `/vault` | Credential storage (per-agent permissions) — see [PROVIDERS.md](dev/PROVIDERS.md) |
126
125
  | `/login` | Authentication page |
127
126
 
128
127
  ---
@@ -189,6 +188,18 @@ sudo systemctl status rev4a.service
189
188
  sudo journalctl -u rev4a -f
190
189
  ```
191
190
 
191
+ ### Start-up and Docker
192
+
193
+ `rev4a serve` waits for the Docker daemon before its Docker-dependent steps, up to
194
+ `REV4A_DOCKER_WAIT_SECONDS` (default 90, capped at 600; `0` checks once without
195
+ waiting; a negative or non-numeric value means 90). It asks the daemon itself with
196
+ `docker info`, so the wait works the same on any Docker install. The variable is
197
+ read from the process environment, not from the `.env` file.
198
+
199
+ If the daemon never answers, `serve` starts anyway, skips the network and image
200
+ checks, and says so in the log. The startup sync then reaches no agent, and logs
201
+ that too; run Sync All Agents once Docker is up.
202
+
192
203
  ### Systemd environment override
193
204
 
194
205
  File: `/etc/systemd/system/rev4a-next.service` (EnvironmentFile)
@@ -261,19 +272,29 @@ Container workspaces are discovered dynamically — any Docker container with an
261
272
 
262
273
  ## Features (current)
263
274
 
264
- ### Vault (`/vault`)
265
- Store and manage credentials (API keys, tokens) with per-agent permissions.
266
-
267
- - **SQLite storage:** `credentials.db` in the data directory
268
- - **Provider keys:** stored in `data/provider-keys.json`, managed via the Gateway UI
269
- - **Agent permissions:** each credential can be scoped to specific agents
270
- - **Service management:** add/remove provider API keys and service tokens via the UI
275
+ ### Credentials (`/credentials`)
276
+ Store third-party service credentials and install them into agent containers.
277
+
278
+ - **SQLite storage:** `credentials.db` in the data directory. Secrets are held
279
+ **unencrypted**; anything that can read the file has them in the clear.
280
+ - **Provider keys** are a separate store — `provider-keys.json`, managed from the
281
+ Gateway UI.
282
+ - **Five providers.** GitHub, Vercel and Supabase are handed to their CLI —
283
+ `gh auth login --with-token`, `~/.local/share/com.vercel.cli/auth.json`,
284
+ `supabase login --token`. Trello and Notion have no CLI in the loop: their
285
+ credentials are written to `~/.config/trello/config.json` and
286
+ `~/.config/notion/config.json`, and TOOLS.md tells the agent how to call each
287
+ REST API with them.
288
+ - **Delivery is explicit.** A credential reaches a container only on sync, and
289
+ leaves only on de-sync. There is no per-agent permission model: any stored
290
+ credential can be synced to any container.
291
+ - **Live detection** shows which credentials are actually installed, matching
292
+ SHA-256 hashes of the tokens found in each container against the stored ones.
271
293
 
272
294
  ### Container management (`/containers`)
273
295
  View all running Docker containers with:
274
296
  - Name, image, status, ports, uptime
275
297
  - Resource usage (CPU, memory)
276
- - Per-container logs
277
298
  - Quick links to agent control UIs
278
299
 
279
300
  ### Agent management (`/agents`)
@@ -302,15 +323,16 @@ Available templates:
302
323
  **Post-creation pipeline:**
303
324
  1. The container boots with the **openclaw-agent-base:latest** image — see [Agent Templates](#agent-templates) below.
304
325
  2. OpenClaw gateway starts automatically with `--allow-unconfigured`, generating its own default config.
305
- 3. The route waits for the gateway to be fully ready (health check poll, up to 60 s).
326
+ 3. The route waits for the gateway to finish starting with `waitForGatewayReady()`, up
327
+ to 60 s. On OpenClaw 9.x it waits for `/startupz` to report `started`. The
328
+ 2026.7.1-2 image has no `/startupz`, so there it waits for `/health`, which only
329
+ shows the server is listening.
306
330
  4. Once ready, the route writes:
307
331
  - `gateway.controlUi.allowedOrigins` — Rev4a dashboard URL + Traefik hostname (required for browser Control UI access)
308
332
  - `agents.defaults.model.primary` + fallbacks — the primary model selected in the wizard
309
- 5. `syncAgent(name)` writes `models.providers.rev4a` into the container.
333
+ 5. The route builds `models.providers.rev4a` with `buildRev4aProviderConfig()` and writes it with `openclaw config patch --stdin`.
310
334
  6. The agent's control UI is immediately accessible at `https://<name>.<your-domain>.com#token=<gateway-token>`.
311
335
 
312
- **Key difference from the old pipeline:** the entrypoint no longer generates `openclaw.json`. The bootstrap config (including `controlUi.allowedOrigins`) is written by the create route after the gateway has already started. This eliminates the race condition where the entrypoint would overwrite synced provider config on boot.
313
-
314
336
  ---
315
337
 
316
338
  ## Agent persistence & lifecycle
@@ -376,23 +398,33 @@ repo. The copy is skipped when the workspace is already populated (see
376
398
 
377
399
  ## Gateway Page (`/gateway`)
378
400
 
379
- Two panels:
401
+ One job: provider configuration. API keys, which catalogue models this deployment
402
+ offers, and pushing that catalogue to every agent.
403
+
404
+ - Reads the model catalogue from `models.config.json`, merged with user toggles in
405
+ `<data dir>/model-overrides.json`
406
+ - Scans providers with keys in `<data dir>/provider-keys.json`
407
+ - `PUT /api/gateway/provider` runs `syncAllAgents()`, which writes
408
+ `models.providers.rev4a` into every agent container
409
+ - **Does NOT touch** `agents.defaults.model` or `agents.list[].model` — those are
410
+ per-agent settings
411
+
412
+ ### Per-agent model, elsewhere
380
413
 
381
- ### Provider Sync
382
- - Reads active models from `models.config.json` (file-based model catalogue)
383
- - Scans providers with keys in `data/provider-keys.json`
384
- - `PUT /api/gateway/provider` runs `syncAllAgents()` which writes `models.providers.rev4a` to every agent container
385
- - **Does NOT touch** `agents.defaults.model` or `agents.list[].model` — model references are managed per-container from the Agents Tab
414
+ Choosing which model one agent runs is not on this page. It lives in the Model
415
+ section of that agent's detail panel on the Agents page
416
+ (`app/agents/ModelSection.tsx`), which calls `PUT /api/gateway/agent` to write the
417
+ model ref into that container's `openclaw.json`. No gateway restart: OpenClaw
418
+ watches the file and hot-applies the change.
386
419
 
387
- ### Agent Model Config
388
- - Select a container and set its primary model
389
- - `PUT /api/gateway/agent` writes the model ref (`primary`, `fallbacks`) directly into the container's `openclaw.json`
390
- - Does NOT restart the gateway — writes are live via file write
420
+ The model is a property of the agent, not of the gateway. See
421
+ [GATEWAY.md](dev/GATEWAY.md) for the write semantics: omitting `fallbacks` keeps the
422
+ agent's current list, `[]` clears it.
391
423
 
392
424
  ### Model Catalogue (`models.config.json`)
393
425
  File-based, tracked in git. Each entry:
394
426
  ```json
395
- { "id": "deepseek/deepseek-v4-flash", "name": "DeepSeek V4 Flash", "provider": "deepseek", "enabled": true }
427
+ { "id": "deepseek/deepseek-flash", "name": "DeepSeek Flash", "provider": "deepseek", "enabled": true }
396
428
  ```
397
429
  Models with `enabled: false` are ignored.
398
430
  Only models whose provider has a key in `data/provider-keys.json` are synced.