Summary
Replace single dual.toml with a two-part architecture:
~/.dual/workspaces.toml — Centralized workspace state
WorkspaceState struct with workspace_root + Vec of workspace entries
- Each entry: repo name, git URL, branch, optional explicit path
- New
src/state.rs module with load/save/add/remove/resolve operations
- State persisted to disk, survives restarts
.dual.toml per repo — Runtime hints
RepoHints struct: image (default: node:20), ports, setup command, env vars
- Lives in workspace directory root, checked into repo
- Read-only at runtime, written by
dual add
CLI changes
dual add — register current repo as workspace + create .dual.toml
dual create <repo> <branch> — add branch workspace to state
dual launch <workspace> — launch workspace
dual list — list all workspaces
dual destroy <workspace> — destroy workspace
dual open, dual urls, dual proxy, dual shell-rc — retained
All consumers updated
clone, container, proxy modules updated to use new state + hints APIs
- All 98 tests pass (64 lib + 14 main + 3 e2e + 7 fixture + 10 harness)
PR
Phase 1 issues advanced by this work
- DUAL-21: Workspace state machine — state persistence layer now implemented
- DUAL-22: Project service/port configuration —
.dual.toml hints now cover ports, image, setup, env
Summary
Replace single
dual.tomlwith a two-part architecture:~/.dual/workspaces.toml— Centralized workspace stateWorkspaceStatestruct with workspace_root + Vec of workspace entriessrc/state.rsmodule with load/save/add/remove/resolve operations.dual.tomlper repo — Runtime hintsRepoHintsstruct: image (default: node:20), ports, setup command, env varsdual addCLI changes
dual add— register current repo as workspace + create.dual.tomldual create <repo> <branch>— add branch workspace to statedual launch <workspace>— launch workspacedual list— list all workspacesdual destroy <workspace>— destroy workspacedual open,dual urls,dual proxy,dual shell-rc— retainedAll consumers updated
clone,container,proxymodules updated to use new state + hints APIsPR
Phase 1 issues advanced by this work
.dual.tomlhints now cover ports, image, setup, env