You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part 2 of MPP compute on Jack Cloud. Part 1 (execute_code, PR #27) ships instant sandboxed code execution. This issue covers persistent hosting: an agent pays via MPP and gets a live URL that stays up.
Agent calls deploy_project MCP tool without a human account. Jack returns an MPP session challenge. Agent opens a Tempo payment channel ($5 min deposit). Agent deploys code, gets a live URL. Subsequent deploys (redeploys, iterations) deduct from session balance. Services suspend when balance hits zero.
Architecture
Agent → MCP Worker → deploy_project tool
├── chargeSession() → ComputeSession DO
│ ├── No session → 402 MPP challenge (session intent)
│ └── Valid voucher → deduct $0.05 per deploy
├── bundleCode(files) → esbuild-wasm
├── Create project via control plane API (ephemeral org)
├── Upload deployment via FormData
└── Return { url, deployment_id, expires_at }
Key decisions needed
Bundler location: Extract apps/mcp-worker/src/bundler.ts to packages/bundler/ so template and MCP worker share one implementation? Or duplicate?
Ephemeral orgs: MPP sessions need a control plane org to own projects. Create ephemeral orgs with no human owner? Or reuse existing org model with a machine flag?
Deploy TTL: 24h auto-expire? Or keep alive until session balance exhausted? (Design doc says "until balance exhausted with 7-day inactivity timeout")
Runtime metering: Free deploys, metered runtime (requests + CPU). Requires dispatch worker changes. How much latency does DO balance checking add? (Design doc targets <5ms p50)
Cleanup: Cron to garbage-collect expired/abandoned deployments from dispatch namespace
Implementation pieces
deploy_project MCP tool with MPP session gating
Ephemeral org creation in control plane for MPP sessions
Session-to-project cardinality tracking in ComputeSession DO
Extract bundler to shared package (DRY with MCP worker)
Dispatch worker metering integration (Phase 2)
Auto-suspend on zero balance (Phase 2)
Cleanup cron for expired deployments (Phase 2)
Pricing model (from design doc)
Resource
Rate
Deploy / redeploy
$0.05 per deploy
Worker requests
$0.50 / million
CPU time
$12.50 / million ms
D1 reads/writes
$0.25-1.00 / million
Deploys have a small fixed cost. Runtime is metered. Session minimum $5 USDC.
Summary
Part 2 of MPP compute on Jack Cloud. Part 1 (execute_code, PR #27) ships instant sandboxed code execution. This issue covers persistent hosting: an agent pays via MPP and gets a live URL that stays up.
Context
execute_codeMCP tool with MPP payments (live, verified)/executehandles the "compute" half. This issue handles the "hosting" half.~/.gstack/projects/getjack-org-jack/hellno-machine-payments-design-*.mdWhat this enables
Agent calls
deploy_projectMCP tool without a human account. Jack returns an MPP session challenge. Agent opens a Tempo payment channel ($5 min deposit). Agent deploys code, gets a live URL. Subsequent deploys (redeploys, iterations) deduct from session balance. Services suspend when balance hits zero.Architecture
Key decisions needed
apps/mcp-worker/src/bundler.tstopackages/bundler/so template and MCP worker share one implementation? Or duplicate?Implementation pieces
deploy_projectMCP tool with MPP session gatingPricing model (from design doc)
Deploys have a small fixed cost. Runtime is metered. Session minimum $5 USDC.
Dependencies
References