fetch_ml/internal/api
Jeremie Fraeys c6a224d5fc
feat(cli,server): unify info command with remote/local support
Enhance ml info to query server when connected, falling back to local
manifests when offline. Unifies behavior with other commands like run,
exec, and cancel.

CLI changes:
- Add --local and --remote flags for explicit control
- Auto-detect connection state via mode.detect()
- queryRemoteRun(): Query server via WebSocket for run details
- queryLocalRun(): Read local run_manifest.json
- displayRunInfo(): Shared display logic for both sources
- Add connection status indicators (Remote: connecting.../connected)

WebSocket protocol:
- Add query_run_info opcode (0x28) to cli and server
- Add sendQueryRunInfo() method to ws/client.zig
- Protocol: [opcode:1][api_key_hash:16][run_id_len:1][run_id:var]

Server changes:
- Add handleQueryRunInfo() handler to ws/handler.go
- Returns run_id, job_name, user, timestamp, overall_sha, files_count
- Checks PermJobsRead permission
- Looks up run in experiment manager

Usage:
  ml info abc123              # Auto: tries remote, falls back to local
  ml info abc123 --local      # Force local manifest lookup
  ml info abc123 --remote     # Force remote query (fails if offline)
2026-03-05 12:07:00 -05:00
..
audit feat: add new API handlers, build scripts, and ADRs 2026-03-04 13:24:27 -05:00
datasets feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
helpers feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
jobs fix: resolve TODOs and standardize tests 2026-02-19 15:34:59 -05:00
jupyter refactor(api): internal refactoring for TUI and worker modules 2026-02-20 15:51:23 -05:00
middleware refactor(api): internal refactoring for TUI and worker modules 2026-02-20 15:51:23 -05:00
plugins feat: add new API handlers, build scripts, and ADRs 2026-03-04 13:24:27 -05:00
responses refactor(api): internal refactoring for TUI and worker modules 2026-02-20 15:51:23 -05:00
scheduler feat: add new API handlers, build scripts, and ADRs 2026-03-04 13:24:27 -05:00
validate refactor: Phase 5 complete - API packages extracted 2026-02-17 13:25:58 -05:00
ws feat(cli,server): unify info command with remote/local support 2026-03-05 12:07:00 -05:00
adapter.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
factory.go refactor(api): internal refactoring for TUI and worker modules 2026-02-20 15:51:23 -05:00
health.go feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
metrics_middleware.go feat(api): refactor websocket handlers; add health and prometheus middleware 2026-01-05 12:31:07 -05:00
middleware.go refactor(api): internal refactoring for TUI and worker modules 2026-02-20 15:51:23 -05:00
monitoring_config.go feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
protocol.go feat(api): integrate scheduler protocol and WebSocket enhancements 2026-02-26 12:05:57 -05:00
routes.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
server.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
server_config.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
server_gen.go api: regenerate OpenAPI types and server code 2026-03-04 13:23:34 -05:00
spec_embed.go feat: add new API handlers, build scripts, and ADRs 2026-03-04 13:24:27 -05:00
ws_protocol.go refactor: improve API structure and WebSocket protocol 2026-02-16 20:38:12 -05:00