# KAI Paid Workspace Platform — Master Goal

**Status:** Active · **Date:** 2026-07-17 · **Owner:** Ryan (nastermodx)  
**North star:** Paying subscribers get a **tiered cloud workspace** (Drive 5TB backend) + **AI help (Antigravity / fleet)** that can work **safely in the cloud sandbox** and optionally **apply on the user’s PC** with explicit privilege modes — later **hosted as a personal Roundtable meeting on their KAIVERSE planet**.

This is **one product ladder**, not separate toys. Ship in **independently testable phases**. Do **not** jump to holograms until storage + plan assignment + basic workspace I/O work for beta humans.

---

## 1. What already exists (do not rebuild)

| Layer | Status | Where |
|--------|--------|--------|
| Plan ladder free→enterprise | Live | `shared/plan-tiers.mjs` |
| Privileges (`antigravity_workspace`, `roundtable`, vault, fleet) | Live | same |
| Credits ledger (token-like usage) | Live | `shared/credits.mjs` + Settings UI |
| Simulated checkout / tester plan switch | Live | `/api/checkout/simulate`, `/api/me/plan` |
| Guest register | Live | `/api/register` |
| Drive 5TB as cloud backend | **Phase 0–1 LIVE** | `shared/drive-storage.mjs`, `GDRIVE_*` in `.env` |
| Antigravity workspace UI + stream | Live (Builder+ guests) | `view-antigravity`, `/api/antigravity/*` |
| Encrypted vault foundation | Partial | `workspace-vault.mjs` dual-world |
| Discord/text roundtable (2D) | Live | oracle gateway / work channel |
| 3D personal planet + meeting hologram | **Not built** | design only (this doc §6) |

---

## 2. Subscriber story (how someone “pays and gets their portion”)

### Beta path (NOW — no real Stripe yet)

1. Human **registers** (guest) → plan defaults to **free**.  
2. **You (owner)** assign their paid tier:
   - UI: simulated checkout (they “buy”), **or**
   - Owner CLI / admin API: set plan on their user id/handle.  
3. Server immediately grants:
   - **Privileges** from `plan-tiers` (web browser, AG workspace, vault, roundtable, …)
   - **Cloud storage quota** from `TIER_STORAGE_BYTES`
   - **Weekly credits** from plan allowance (existing ledger)
4. Their Drive folder is created lazily:  
   `KAI-Server/users/<userId>/{workspace,attachments,memory}/`

### Production path (later)

Replace simulate with real payments (Stripe/etc.). On webhook `invoice.paid` → same `setUserPlan(userId, planId)` function. **No second privilege system.**

---

## 3. Dual execution model (your “cloud sandbox + device finalize”)

```
┌─────────────────────────────────────────────────────────────┐
│  CLOUD WORKSPACE (server / Drive)                           │
│  - Files upload/download                                    │
│  - AIs discuss + edit artifacts safely                      │
│  - Tools: search, image process, code gen, convert formats  │
│  - Roundtable session log + token usage                     │
└───────────────────────────┬─────────────────────────────────┘
                            │ export / apply (user-approved)
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  DEVICE AGENT (Antigravity-class on user's PC)              │
│  Privilege modes (user toggles):                            │
│    1. Ask every command (safest)                            │
│    2. Allowlist paths/commands                              │
│    3. YOLO / auto-approve (power users only; explicit)      │
│  Applies cloud artifacts locally, builds, tests, installs   │
└─────────────────────────────────────────────────────────────┘
```

**Rule:** Cloud never silently becomes full disk admin on a human PC. Mode 3 is **opt-in**, audited, and tier-gated (Builder+).

---

## 4. Phased delivery

### Phase A — Plan → storage + usage APIs  ✅ foundation this session
- [x] Drive module + probe  
- [x] `TIER_STORAGE_BYTES` + `planStorageBytes(planId)`  
- [x] `/api/storage/*` (upload/list/download/delete/usage/account)  
- [x] Owner `set-user-plan` (CLI + admin API) for beta subscribers  
- [x] Usage returns `{ used, limit, plan, … }`

### Phase B — Workspace UX (2D)
- Workspace panel: list Drive files, upload, download, trash  
- Gate: Creator+ limited folders; Builder+ full workspace + AG  
- Show storage meter + credit balance on Me/Settings  

### Phase C — Device agent privileges
- Privilege panel in Antigravity: ask / allowlist / auto  
- Server records mode preference per user (never secrets)  
- Bridge only executes when mode + tier allow  

### Phase D — Fleet Roundtable (2D first)
- Team+ : multi-AI session on workspace files (reuse Discord roundtable patterns)  
- Session transcript stored under `users/<id>/workspace/sessions/`  
- Credit debit per turn  

### Phase E — KAIVERSE personal Roundtable (BIG)
- On **host’s planet**: table + seats (humans/AIs) + center **holo surface**  
- Digital computer UI in-world for controls  
- Show workspace images/artifacts as holograms during tasks  
- Calendar/presence (“show up when they can”) — soft realtime  
- Same privilege gates as 2D (no free bypass)  

### Phase F — Monetize + scale
- Real payments, invoices, dunning  
- Capacity dashboard on 5TB  
- Your future physical servers replace single Drive when funded  

---

## 5. Tier → product map (beta defaults)

| Plan | $/mo | Cloud storage | Workspace files | Antigravity | Fleet RT | 3D personal RT |
|------|------|---------------|-----------------|-------------|----------|----------------|
| Free | 0 | **1 GB** | attachments only | no | no | explore only |
| Explorer | 10 | **5 GB** | attachments + tools/browser | no | no | limited actions |
| Creator | 19 | **25 GB** | yes | no | no | standard |
| Builder | 29 | **75 GB** | full + coding agent | **yes** | no | full actions |
| Team | 75 | **150 GB** | multi-seat | yes | **yes** | personal RT host |
| Enterprise | custom | **1 TB**+ | isolated | yes | yes | custom |

(Storage numbers match Drive spec §6; adjustable in one constant.)

---

## 6. Example: “image → game character” (end state)

1. Host (Builder+) uploads PNG to workspace.  
2. Opens Roundtable (Team+) or AG (Builder) with task.  
3. AIs discuss format (e.g. glTF / spritesheet for target engine).  
4. Cloud tools produce candidate assets in Drive.  
5. Holo table shows preview (Phase E).  
6. User toggles device mode → AG applies export into local project and runs test.  
7. Credits debited; storage usage updated.

---

## 7. Beta ops checklist (you)

1. Friend registers on Funnel URL → free guest.  
2. You run:  
   `node tools/oracle-discord/scripts/set-user-plan.mjs --handle theirhandle --plan builder`  
3. They hard-refresh → Antigravity + storage quota **75 GB** (Builder).  
4. They upload a test file via `/api/storage` (or Workspace UI when Phase B lands).  
5. Watch `node scripts/drive-probe.mjs` + Settings credits.

---

## 8. Out of scope until later

- Real payment processor  
- Full YOLO agent without UI  
- Public multi-tenant KAIVERSE meetings at scale  
- Building physical server farm  

---

## 9. Success criteria for “public soon / first money”

- [ ] 3–5 beta humans on assigned paid tiers  
- [ ] Each can upload/download workspace files under quota  
- [ ] Credits show real usage  
- [ ] Builder can open Antigravity on their files  
- [ ] You can revoke/downgrade a plan in one command  
- [ ] No free user can burn fleet/AG/storage headroom  

---

*Living doc — update Status as phases close. Implement only the phase you are in; keep KAIVERSE E iterative with owner screenshots.*
