Problem
The Publish button in the workspace header (WorkspaceHeader component) is currently a no-op. Clicking it does nothing. The user expects to deploy the generated application to a live URL, just like v0 does.
Goal
Implement real Vercel deployment integration behind the Publish button. When a user clicks Publish, the system should:
- Build the target application (the one the agent is working on)
- Create a Vercel deployment
- Show deployment status in the UI
- Provide a live preview URL
Acceptance Criteria
Files to modify / create
New files
lib/vercel/client.ts # Vercel API client (REST API wrapper)
lib/vercel/deploy.ts # Deployment logic: build → create deployment
app/api/workspace/deploy/route.ts # POST /api/workspace/deploy — trigger deployment
app/api/workspace/deployments/route.ts # GET /api/workspace/deployments — list history
components/workspace/deploy-status.tsx # Deployment status indicator (spinner, progress, URL)
components/workspace/deploy-history.tsx # List of past deployments
Files to modify
components/workspace/workspace-header.tsx # Wire onPublish to real deployment API
components/workspace/preview-panel.tsx # Add deploy button or status overlay
components/workspace/workspace.tsx # Pass deployment state through
Technical Notes
- Vercel API requires
VERCEL_TOKEN environment variable
- Use the
vercel npm package or direct REST API calls
- Build process: The target app (in
SIN_WORKSPACE_DIR) must be built (e.g., next build or npm run build)
- Deployment target: Either Vercel CLI (
vercel --yes) or API (POST /v13/deployments)
- The deployment should include the built output, not the source code
- Store deployment metadata (URL, status, createdAt) in
.sin-webui/deployments.json
Out of Scope (per AGENTS.md)
This feature is explicitly listed as "out of scope" in AGENTS.md: "Real Vercel deploys go through Docker + Cloudflare Tunnel (see PLAN_DEPLOY.md)." This issue supersedes that decision for users who want Vercel integration.
Related
- AGENTS.md §8: Real Vercel-Deploy is out of scope (Docker + Cloudflare Tunnel preferred)
- PLAN_DEPLOY.md: Existing self-hosting guide
- components/workspace/workspace-header.tsx: Publish button (currently no-op)
Problem
The Publish button in the workspace header (WorkspaceHeader component) is currently a no-op. Clicking it does nothing. The user expects to deploy the generated application to a live URL, just like v0 does.
Goal
Implement real Vercel deployment integration behind the Publish button. When a user clicks Publish, the system should:
Acceptance Criteria
Files to modify / create
New files
Files to modify
Technical Notes
VERCEL_TOKENenvironment variablevercelnpm package or direct REST API callsSIN_WORKSPACE_DIR) must be built (e.g.,next buildornpm run build)vercel --yes) or API (POST /v13/deployments).sin-webui/deployments.jsonOut of Scope (per AGENTS.md)
This feature is explicitly listed as "out of scope" in AGENTS.md: "Real Vercel deploys go through Docker + Cloudflare Tunnel (see PLAN_DEPLOY.md)." This issue supersedes that decision for users who want Vercel integration.
Related