feat(FN-1821): add settings and auth sync API routes for mesh nodes

- Add GET /api/nodes/:id/settings endpoint to fetch remote node settings
- Add POST /api/nodes/:id/settings/push to push local settings to a remote node
- Add POST /api/nodes/:id/settings/pull to pull settings from a remote node
- Add GET /api/nodes/:id/settings/sync-status for sync diff summary
- Add POST /api/nodes/:id/auth/sync to sync model auth credentials
- Add POST /api/settings/sync-receive inbound settings endpoint
- Add POST /api/settings/auth-receive inbound auth endpoint
- Add GET /api/settings/auth-export to export local auth credentials
- Add comprehensive route tests for all sync endpoints
- Update AGENTS.md with Node Settings Sync API reference
This commit is contained in:
Fusion
2026-04-16 06:25:37 -07:00
committed by gsxdsm
parent 261bfff9ae
commit e0266565f3
5 changed files with 1559 additions and 1 deletions

View File

@@ -92,6 +92,21 @@ const { stdout, stderr } = await execAsync(command, {
Fusion has a Node Dashboard view for managing mesh network nodes. See [docs/architecture.md](./docs/architecture.md) for dashboard components and API endpoints.
**Node Settings Sync API Endpoints:**
| Method | Path | Description |
|--------|------|-------------|
| GET | `/api/nodes/:id/settings` | Fetch settings from a remote node |
| POST | `/api/nodes/:id/settings/push` | Push local settings to a remote node |
| POST | `/api/nodes/:id/settings/pull` | Pull settings from a remote node |
| GET | `/api/nodes/:id/settings/sync-status` | Get sync status and diff summary |
| POST | `/api/nodes/:id/auth/sync` | Sync model auth credentials |
| POST | `/api/settings/sync-receive` | Receive pushed settings (inbound) |
| POST | `/api/settings/auth-receive` | Receive auth credentials (inbound) |
| GET | `/api/settings/auth-export` | Export local auth credentials |
All remote node endpoints require the target node to have an `apiKey` configured. Inbound endpoints validate the `Authorization: Bearer <apiKey>` header against the local node's apiKey.
## Pi Extension (`packages/cli/src/extension.ts`)
The pi extension provides tools and a `/fn` command for interacting with fn from within a pi session. It ships as part of `@gsxdsm/fusion`.