@hasna/machines 0.0.36 → 0.0.38

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 CHANGED
@@ -281,6 +281,57 @@ Configure database storage with `HASNA_MACHINES_DATABASE_URL` or fallback
281
281
  `HASNA_MACHINES_STORAGE_MODE` or `MACHINES_STORAGE_MODE` with `local`,
282
282
  `hybrid`, or `remote`.
283
283
 
284
+ ## Fleet daemon
285
+
286
+ `machines-agent` can run as a managed heartbeat daemon. The daemon writes local
287
+ SQLite heartbeat rows and can optionally push those rows to PostgreSQL storage
288
+ for cross-network fleet dashboards.
289
+
290
+ ```bash
291
+ machines-agent --once --json
292
+ machines-agent --interval-ms 30000
293
+ HASNA_MACHINES_DATABASE_URL=postgres://... machines-agent --storage-push --interval-ms 30000
294
+ machines-agent --doctor-summary --once --json
295
+ ```
296
+
297
+ Service lifecycle commands are dry-run plans by default and support macOS
298
+ `launchd` plus Linux `systemd` user or system services:
299
+
300
+ ```bash
301
+ machines daemon install --platform macos --mode user --storage-push --doctor-summary --json
302
+ machines daemon install --platform linux --mode user --storage-push --json
303
+ machines daemon status --platform linux --mode user --json
304
+ machines daemon logs --platform macos --mode user
305
+ machines daemon restart --platform linux --mode user --apply --yes
306
+ machines daemon uninstall --platform linux --mode user --apply --yes
307
+ ```
308
+
309
+ Install plans include generated service-file content and the exact lifecycle
310
+ commands. They do not embed raw database URLs or secrets; storage and private
311
+ settings are represented as environment variable names or safe placeholders.
312
+ `--apply` only executes when paired with `--yes`.
313
+
314
+ By default heartbeat facts are public-safe. Hostnames, usernames, serials,
315
+ private IPs, Tailscale DNS names, database URLs, and secret-like values should
316
+ not appear in public output. Operators that need private fleet facts can opt in
317
+ locally with `--private-metadata` or `HASNA_MACHINES_PRIVATE_METADATA=1`; do
318
+ not share private-mode JSON in OSS issues or docs.
319
+
320
+ HTTP dashboard/API and MCP private reads require a second operator-side gate:
321
+ set `HASNA_MACHINES_ALLOW_PRIVATE_OUTPUT=1` and pass the explicit
322
+ `privateMetadata=true` query parameter or MCP `private_metadata` argument. The
323
+ caller flag alone is ignored.
324
+
325
+ Doctor summaries are also opt-in with `--doctor-summary` or
326
+ `HASNA_MACHINES_AGENT_DOCTOR_SUMMARY=1`. The daemon records a compact
327
+ ok/warn/fail count plus redacted blockers and avoids optional private adapters
328
+ inside the heartbeat loop.
329
+
330
+ `machines topology`, `machines route`, `machines serve`, and `machines-mcp`
331
+ consume the same heartbeat rows. When Tailscale is available, route resolution
332
+ still uses `tailscale status --json` and falls back to Tailscale routes when LAN
333
+ or SSH routes are not verified.
334
+
284
335
  Machine backups are preview-only unless `--apply --yes` is passed. The backup
285
336
  target can be explicit or environment-backed:
286
337
 
@@ -354,6 +405,9 @@ The dashboard exposes:
354
405
  - `/` HTML dashboard
355
406
  - `/health` health probe
356
407
  - `/api/status` fleet status JSON
408
+ - `/api/topology` manifest, heartbeat, SSH, LAN, and Tailscale topology JSON
409
+ - `/api/routes` resolved route JSON for known machines
410
+ - `/api/daemon/status` daemon heartbeat rows
357
411
  - `/api/manifest` current manifest JSON
358
412
  - `/api/notifications` notification channel JSON
359
413
  - `/api/doctor` doctor report JSON