feat: auto-tunnel + CF Worker gateway + dashboard multi-agent #168

Merged
xiaoju merged 3 commits from feat/164-cf-worker-gateway into main 2026-05-09 10:02:36 +00:00
Owner

What

Complete implementation of #164 — dashboard can now view workflows/threads across multiple agents through a centralized CF Worker gateway.

Architecture

CF Pages (Dashboard)
  → CF Worker (API gateway + KV registry)
    → cloudflared quick tunnel (auto-created by serve)

Changes

Phase A: CF Worker Gateway (packages/workflow-gateway/)

  • Hono-based Worker at workflow-gateway.shazhou.workers.dev
  • KV endpoint registry with TTL auto-expiry
  • API proxy: /api/:agent/* → agent tunnel URL

Phase B: serve auto-tunnel (packages/cli-workflow/src/commands/serve/)

  • serve --name <agent> auto-creates cloudflared quick tunnel
  • Registers with gateway, heartbeats every 60s
  • --no-tunnel for local dev

Phase C: Dashboard multi-agent (packages/workflow-dashboard/)

  • Sidebar agent selector from /endpoints
  • All API calls scoped to selected agent via gateway
  • Hash routing: #agent/threads/id
  • Deployed to CF Pages

Ref

Fixes #164, closes #165, closes #166, closes #167

—— 小橘 🍊(NEKO Team)

## What Complete implementation of #164 — dashboard can now view workflows/threads across multiple agents through a centralized CF Worker gateway. ## Architecture ``` CF Pages (Dashboard) → CF Worker (API gateway + KV registry) → cloudflared quick tunnel (auto-created by serve) ``` ## Changes ### Phase A: CF Worker Gateway (`packages/workflow-gateway/`) - Hono-based Worker at `workflow-gateway.shazhou.workers.dev` - KV endpoint registry with TTL auto-expiry - API proxy: `/api/:agent/*` → agent tunnel URL ### Phase B: serve auto-tunnel (`packages/cli-workflow/src/commands/serve/`) - `serve --name <agent>` auto-creates cloudflared quick tunnel - Registers with gateway, heartbeats every 60s - `--no-tunnel` for local dev ### Phase C: Dashboard multi-agent (`packages/workflow-dashboard/`) - Sidebar agent selector from `/endpoints` - All API calls scoped to selected agent via gateway - Hash routing: `#agent/threads/id` - Deployed to CF Pages ## Ref Fixes #164, closes #165, closes #166, closes #167 —— 小橘 🍊(NEKO Team)
xiaoju added 3 commits 2026-05-09 10:01:47 +00:00
Phase A of #164:
- Hono-based CF Worker at workflow-gateway.shazhou.workers.dev
- POST /register — agent registration with shared secret
- DELETE /register/:name — unregister
- GET /endpoints — list online agents
- GET /api/:agent/* — proxy to agent tunnel URL
- KV-backed with TTL auto-expiry

Ref: #164, closes #165

小橘 🍊(NEKO Team)
Phase B of #164:
- serve --name <agent> starts cloudflared quick tunnel automatically
- Registers with CF Worker gateway, heartbeat every 60s
- Graceful unregister on SIGINT/SIGTERM
- --no-tunnel flag for local dev
- Default name from hostname

Ref: #164, closes #166

小橘 🍊(NEKO Team)
Phase C of #164:
- Dashboard fetches agents from gateway /endpoints
- Sidebar shows agent selector with online/offline status
- All API calls routed through gateway /api/:agent/*
- Hash routing: #agent/threads/id format
- SSE live streaming via gateway proxy
- VITE_GATEWAY_URL env var for gateway configuration
- Deployed to CF Pages: workflow-dashboard-54r.pages.dev
- Custom domain: workflow.shazhou.work (pending SSL)

Ref: #164, closes #167

小橘 🍊(NEKO Team)
xiaoju merged commit 024dd8c1e8 into main 2026-05-09 10:02:36 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#168