workspace-dev
v1.0.2
Published
Autonomous local workspace runtime for REST + deterministic Figma-to-code generation
Maintainers
Readme
workspace-dev
Autonomous local Workspace runtime for REST-based deterministic Figma-to-code generation.
workspace-dev runs directly in a customer project as a dev dependency and does not require the full Workspace Dev platform backend stack.
Package and release channels
- npm distribution (authoritative): https://www.npmjs.com/package/workspace-dev
- GitHub release notes and signed evidence assets (SBOM/OpenVEX): https://github.com/oscharko-dev/workspace-dev/releases
- GitHub Packages is intentionally not used for
workspace-devdistribution.
Prerequisites
- Node.js
>=22.0.0 - npm
>=10or pnpm>=10
Installation
npm install --save-dev workspace-devQuickstart
npx workspace-dev startDefault runtime URL: http://127.0.0.1:1983/workspace
- UI:
http://127.0.0.1:1983/workspace/ui - Deep link by file key:
http://127.0.0.1:1983/workspace/<figmaFileKey>
Frontend stack
The workspace UI is implemented as a Vite + React + TypeScript + Tailwind app:
- Vite 8 build output is emitted into
dist/ui - Runtime serves
index.htmland hashed bundles under/workspace/ui/assets/* - API contracts remain unchanged (
/workspace,/healthz,/workspace/submit,/workspace/jobs/*)
Useful scripts:
pnpm run ui:devpnpm run ui:buildpnpm run ui:typecheckpnpm run ui:lintpnpm run ui:testpnpm run ui:test:e2e
Scope and mode lock
workspace-dev enforces:
figmaSourceMode=restllmCodegenMode=deterministic
Not available:
- MCP (
figmaSourceMode=mcp) - Hybrid modes
llm_strict
Required submit input
figmaFileKeyfigmaAccessToken
Optional Git/PR input:
enableGitPr(defaultfalse)repoUrl(required only whenenableGitPr=true)repoToken(required only whenenableGitPr=true)projectName(optional)targetPath(optional, defaults tofigma-generated)
With enableGitPr=false, generation is local-only.
Runtime API
GET /workspace- runtime statusGET /healthz- health checkGET /workspace/:figmaFileKey- deep-link to workspace UI for a Figma file keyPOST /workspace/submit- start autonomous generation (202 Accepted)GET /workspace/jobs/:id- job polling (stages/logs/artifacts)GET /workspace/jobs/:id/result- compact result payloadGET /workspace/repros/:id/- generated local preview
Output layout
By default, generated files are written under:
.workspace-dev/jobs/<jobId>/generated-app.workspace-dev/jobs/<jobId>/figma.json.workspace-dev/jobs/<jobId>/design-ir.json.workspace-dev/repros/<jobId>/.workspace-dev/jobs/<jobId>/repo/(only whenenableGitPr=true)
CLI
workspace-dev start [options]Options
--port <port>(default1983)--host <host>(default127.0.0.1)--output-root <path>(default.workspace-dev)--figma-timeout-ms <ms>(default30000)--figma-retries <count>(default3)--preview <true|false>(defaulttrue)--perf-validation <true|false>(defaultfalse, runs templateperf:assertinvalidate.project)
Environment variables
FIGMAPIPE_WORKSPACE_PORTFIGMAPIPE_WORKSPACE_HOSTFIGMAPIPE_WORKSPACE_OUTPUT_ROOTFIGMAPIPE_WORKSPACE_FIGMA_TIMEOUT_MSFIGMAPIPE_WORKSPACE_FIGMA_RETRIESFIGMAPIPE_WORKSPACE_ENABLE_PREVIEWFIGMAPIPE_WORKSPACE_ENABLE_PERF_VALIDATIONFIGMAPIPE_ENABLE_PERF_VALIDATION(legacy alias)
Web performance workflow
Bundled template (template/react-mui-app) includes a baseline + assertion pipeline:
pnpm --dir template/react-mui-app run perf:baselinepnpm --dir template/react-mui-app run perf:assert
Artifacts are written to template/react-mui-app/artifacts/performance by default.
Budget policy is configured in template/react-mui-app/perf-budget.json.
Detailed operating notes: docs/react-web-performance.md.
Example API flow
curl -sS -X POST http://127.0.0.1:1983/workspace/submit \
-H 'content-type: application/json' \
-d '{
"figmaFileKey":"demo-file-key",
"figmaAccessToken":"figd_...",
"enableGitPr": false,
"figmaSourceMode":"rest",
"llmCodegenMode":"deterministic"
}'Then poll:
curl -sS http://127.0.0.1:1983/workspace/jobs/<jobId>Security notes
- Tokens are used in process memory for runtime execution.
- Token-like values are redacted in public job logs and error surfaces.
- If
enableGitPr=true, a temporary authenticated clone is created under.workspace-dev/jobs/<jobId>/repo/during execution; treat the output root as sensitive local state. - Local runtime defaults to
127.0.0.1.
Migration note (v1.0.0)
- The legacy CLI alias was removed.
- Use
workspace-devexclusively:
npx workspace-dev start