Skip to content

Commit fd05be6

Browse files
docs: add web-only mode PRD (anomalyco#100)
1 parent a7f42ce commit fd05be6

1 file changed

Lines changed: 116 additions & 0 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Web-Only Mode + Resilient Workspaces PRD
2+
3+
## Summary
4+
Enable OpenWork to run fully in a browser without the Tauri shell, extract shared UI components for web views, and make core flows resilient when no working directory is available. This PRD defines the product shape, user experience, and architectural shifts required to maintain parity with OpenCode primitives while expanding access to web and mobile environments.
5+
6+
## Goals
7+
- Deliver a web-only runtime that does not require the Tauri browser.
8+
- Extract shared UI components so views are reusable across web and desktop.
9+
- Allow users to start tasks without a working directory and recover when one is missing.
10+
- Preserve safety, permissions, and transparency standards from the desktop experience.
11+
- Keep UX premium, calm, and mobile-friendly.
12+
13+
## Non-goals
14+
- Replace the Tauri desktop app.
15+
- Build a full web IDE or generalized file manager.
16+
- Enable fully offline execution without a host or engine.
17+
- Add new compute backends beyond OpenCode.
18+
19+
## Definitions
20+
- **Web-only mode**: OpenWork runs in a standard browser, with no Tauri shell.
21+
- **Host**: A trusted device running OpenCode that can execute tasks and stream events.
22+
- **Workspace**: The authorized folder or project context for tasks.
23+
- **No-workspace mode**: Tasks that run without an attached workspace, using minimal context.
24+
25+
## Guiding principles
26+
- Parity with OpenCode primitives (sessions, events, permissions, artifacts).
27+
- Least-privilege access with explicit user intent.
28+
- Calm, clear UX with minimal jargon.
29+
- Graceful degradation when access or connectivity is missing.
30+
- Single codepath for UI, with platform-specific adapters.
31+
32+
## Current state / problem
33+
- OpenWork is tightly coupled to Tauri runtime expectations, limiting web-only execution.
34+
- Several UI components assume local filesystem access and a working directory.
35+
- When a working directory is missing, flows break or block instead of degrading.
36+
- Component reuse across web and desktop is limited by platform-specific dependencies.
37+
38+
## Proposal
39+
### 1) Web-only runtime
40+
- Introduce a browser runtime mode that connects to an OpenCode host via a secure bridge.
41+
- Detect runtime capabilities at launch (web-only, web+host, desktop).
42+
- Gate features and show capability badges based on runtime.
43+
44+
### 2) Shared component extraction
45+
- Create a platform-agnostic UI layer for:
46+
- task composer
47+
- session timeline
48+
- permissions prompts
49+
- artifacts list
50+
- templates and history views
51+
- Move platform bindings (filesystem, IPC, process control) to adapters.
52+
53+
### 3) No-workspace resilience
54+
- Support task creation without a workspace.
55+
- Only require a workspace when tasks explicitly need filesystem access.
56+
- Provide fallback options:
57+
- connect a workspace later
58+
- use a sample workspace
59+
- run in view-only mode
60+
61+
### 4) Safety and permissions in web-only mode
62+
- Default to read-only or no-file access in the browser.
63+
- Require explicit approval for host connections and workspace access.
64+
- Provide clear “why” explanations for permission requests.
65+
66+
## UX / flows
67+
### Entry (web-only)
68+
1. User opens OpenWork in browser.
69+
2. Runtime banner indicates “Web Mode”.
70+
3. User chooses:
71+
- Connect to a host
72+
- Continue without workspace
73+
4. App lands in a task-ready home view with clear status.
74+
75+
### No-workspace task flow
76+
1. User starts a task without workspace.
77+
2. UI shows a “limited context” tag with explanation.
78+
3. If the task requires files, prompt to attach or connect workspace.
79+
4. Task continues or is paused until workspace is provided.
80+
81+
### Host connection flow
82+
1. User selects “Connect to host.”
83+
2. QR / token flow establishes secure connection.
84+
3. Health check runs (global.health).
85+
4. User can access sessions and run tasks.
86+
87+
### Permission flow
88+
1. Permission request appears with context and scope.
89+
2. Options: allow once, allow for session, deny.
90+
3. Audit log records decision.
91+
92+
## Data / storage
93+
- Web-only mode stores UI state + session metadata in IndexedDB.
94+
- Full session history can be synced from host when connected.
95+
- Artifacts remain on host unless explicitly exported or shared.
96+
- Clear messaging on where data lives (browser vs host).
97+
98+
## Migration
99+
- Introduce runtime detection without breaking desktop defaults.
100+
- Add adapter interfaces and migrate components incrementally.
101+
- Keep desktop experience unchanged while enabling web-only parity.
102+
103+
## Acceptance criteria
104+
1. OpenWork runs in a browser with no Tauri dependencies.
105+
2. Core task flow works without a workspace, with clear limitations.
106+
3. Users can connect to a host and run sessions end-to-end.
107+
4. Components render identically across web and desktop for shared views.
108+
5. Permission prompts and audit logs work in web-only mode.
109+
6. No-workspace paths never hard-block; they guide users forward.
110+
111+
## Open questions
112+
1. Should the host bridge be LAN-only or allow optional tunneling?
113+
2. How is authentication handled for shared or public web clients?
114+
3. What is the minimal task set that must support no-workspace mode?
115+
4. How should large artifacts be exported in web-only mode?
116+
5. What is the best fallback when host is unreachable mid-session?

0 commit comments

Comments
 (0)