feat: marketplace UI + gateway + console + streaming (Phase 1–2) - #8
Merged
Conversation
- /agents marketplace (search + protocol/pricing/category filters + sort), replacing the old coding-agent-type browse - /agents/[slug] detail (capabilities, skills, integration panel) - /submit-agent publish form (AgentCard URL or manual) - /admin/agents review page + Agents tab in the admin nav - AgentCard component - Home rebranded to "One API to access all agents" with a Featured Agents row; skills retained as a sub-category Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unified "one API to access all agents" gateway (data-plane; cloud infra
deferred to deploy).
- Schema: ApiKey (hashed key + prefix) + Invocation (usage metering) +
migration 004_gateway_keys_usage
- src/lib/apikey.ts: key gen / SHA-256 hash / Bearer auth
- POST /api/keys (create, returns secret once) + GET (list)
- Gateway: POST /v1/agents/{slug}/message — A2A JSON-RPC passthrough
- OpenAI-compatible shim: POST /v1/chat/completions (model = agent slug)
- Per-call metering (Invocation) + callsCount; rate limit per key
Verified locally against a mock A2A agent: auth (401 on bad key),
passthrough, OpenAI shim, and metering. tsc clean.
Deferred (deploy/next): Cloud SQL upsize + PgBouncer + Upstash Redis
(swap in-memory rate limit), streaming/SSE, BYOK, credits/billing (Phase 3).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- DELETE /api/keys/{id} (revoke; owner-only, soft-delete via revokedAt)
- GET /api/usage (per-user call totals + recent invocations)
- /dashboard: create / copy-once / revoke API keys, a gateway quickstart,
and a usage table (agent, protocol, status, latency)
- Header: "API & Usage" link in the account menu
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
POST /v1/agents/{slug}/stream — A2A message/stream proxied to the agent and
piped back to the client as Server-Sent Events. Metered like the sync path.
Verified locally against a streaming mock: status/artifact SSE events pass
through word-by-word. tsc clean.
Note: behind a Global HTTPS LB + serverless NEG, SSE may be throttled — prefer
the direct Cloud Run URL for streaming (documented in 03-technical-architecture).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Consolidates the remaining Phase 1–2 work onto
main. (The earlier stacked PRs #4/#6 tangled during merge; this lands ui + gateway + dashboard + streaming cleanly on top of the already-merged backend #3.)Includes
/agentsbrowse + detail,/submit-agent,/admin/agents, home rebrand to "One API to access all agents".POST /v1/agents/{slug}/message(A2A),POST /v1/chat/completions(OpenAI shim), metering./dashboardkeys + usage.POST /v1/agents/{slug}/stream.Verification
tsc --noEmitclean (post-rebase). All verified locally end-to-end earlier (browser + curl).🤖 Generated with Claude Code