Define how repositories inside Codex Workspace are discovered, launched, previewed, stopped, and optionally routed through a mapped host or reverse proxy when that mode is configured.
This document governs the runtime and orchestration layer, not the base folder structure.
The system must support mixed project types without forcing them into one uniform stack.
Key rule:
Every repository must remain runnable without optional proxy or mapped-host tooling.
A reverse proxy or local hostname layer is useful as:
- a single local domain entry point
- a reverse proxy layer
- local HTTPS or hostname convenience
- a front door for the workspace
It is not the only runtime method.
A separate repo/app located at:
repos/workspace-hub/
This app acts as the local control centre.
Optional. Some operators use a single local domain or reverse proxy (for example Caddy, nginx, or a dev-stack app) as a unified entry point. The Hub can generate preview links for that setup when manifest fields are set.
Each repo should run according to its own stack and preferred command.
The Workspace Hub application should:
- scan the
repos/directory - list all repositories
- detect or read each repo type
- display metadata and runtime status
- start and stop supported repos
- open preview URLs
- open repos in Finder, terminal, editor, or Codex where useful
- store known ports and preferred launch methods
- optionally provide mapped-host-aware preview links when
servbayPath/servbaySubdomain(stable manifest keys) are set
Preferred v1 approach:
- lightweight local app
- good file system and process control
- easy to run without extra complexity
A strong option is:
- a local web app using React, Vite, and a small Node backend process manager
Do not over-engineer v1.
At minimum, support the following categories.
Typical indicators:
- WordPress structure
- PHP entrypoints
- composer setup for WordPress
- Local or another host mapping may already exist
Preferred handling:
- usually opened through Local or similar
- Hub may store external URL and helper actions
- Hub does not need to become a full WP environment manager in v1
Typical indicators:
index.html- no major app framework
- static asset folders
Preferred handling:
- static file server
- direct port preview
- optional proxy path when configured
Typical indicators:
vite.config.*- Vite scripts in
package.json
Preferred handling:
- run dev server via package manager
- default to direct port
- optional proxy path where compatible
Typical indicators:
- Three.js dependencies
- Vite/static setup
- WebGL or asset-heavy frontend project
Preferred handling:
- treat similarly to
viteorstatic - direct port usually preferred
- proxy path optional
Typical indicators:
package.json- server or framework app
- custom start/dev script
Preferred handling:
- run repo-native dev command
- track assigned port
- open direct preview or proxied preview
Typical indicators:
composer.json- PHP entrypoints
- non-WordPress PHP projects
Preferred handling:
- mapped-host friendly where appropriate
- or direct repo-native method depending on stack
Fallback category where launch rules are unknown or manual.
Each repo may optionally define a manifest file for the Hub to read.
Preferred path:
.workspace/project.json
Example:
{
"name": "Three Lab",
"type": "vite",
"preferredMode": "direct",
"packageManager": "pnpm",
"devCommand": "pnpm dev",
"buildCommand": "pnpm build",
"previewCommand": "pnpm preview",
"previewUrl": "http://localhost:5173",
"notes": "Needs WebGL-capable browser"
}Suggested fields:
nametypepreferredMode→direct|servbay|external(the valueservbaymeans mapped-host/proxy preview; see Hub manifest docs for stable JSON keys)packageManagerdevCommandbuildCommandpreviewCommandpreviewUrlexternalUrlrootPathnotestagsisWordPressservbayPathservbaySubdomainhealthcheckUrl
Not every field is required.
If no manifest exists, the Hub should infer repo type from files.
Examples:
vite.config.js,vite.config.ts→vitepackage.jsonwith Three.js dependency →threejs- WordPress structure →
wordpress index.htmlonly →staticcomposer.jsonand PHP entrypoints →phpDockerfilepresent → note containerised possibility, but do not require Docker in v1
Detection should be conservative.
Where uncertain, classify as other and allow manual setup.
Repos may be opened in one of three modes.
Open directly on the repo’s own local port.
Examples:
http://localhost:5173http://localhost:4321
Use this when:
- the repo works cleanly on its own dev server
- proxying adds unnecessary complexity
- the project expects to run at root
The manifest uses the stable enum value servbay for previews served through a configured path or subdomain on your local domain (see servbayPath and servbaySubdomain).
Use this when:
- clean URLs are useful
- local HTTPS or a stable hostname is desired
- proxying is stable for that project
- the Hub is being used as a single front door
For projects handled by another tool such as Local.
Example:
https://client-site.local
Use this when:
- another app already owns the runtime
- the Hub should link out instead of starting the stack itself
Default to:
externalfor WordPress projects already managed in Localdirectfor Vite, Three.js, WebGL, and most static reposservbayonly where a mapped path or subdomain is clearly useful and stable
This avoids fragile path/proxy assumptions.
Treat reverse-proxy or mapped-host tooling as:
- optional convenience
- single-domain entry point
- reverse-proxy front door
It should be able to surface:
- the Workspace Hub app
- selected repo previews
- selected local services
Recommended pattern:
- one main site entry on your local domain
- one main local hostname
- reverse-proxy rules to local repo ports where needed
Do not assume each repo needs its own site entry.
Pick a main local domain in operator docs if you use this mode (example: https://workspace.local). Suggested path structure:
/→ Workspace Hub/repo/<slug>→ proxied preview where appropriate
Examples:
/repo/three-lab/repo/static-portfolio
However, the Hub must also support direct local links if a project is better opened directly.
The Hub should support:
- starting a repo process
- tracking running/stopped/error state
- tracking PID where possible
- tracking or reading assigned port
- stopping a repo cleanly
- retrying when appropriate
- reporting failures clearly
Do not assume every repo stays alive after launch.
A repo may fail because:
- dependencies are missing
- port is in use
- command is invalid
- environment variables are missing
The Hub should eventually support light install helpers such as:
- detect missing dependencies
- run install command
- note package manager
- show lockfile presence
But v1 should not attempt to fully solve environment setup for every repo automatically.
For each repo, the Hub should aim to display:
- repo name
- slug/path
- type
- preferred mode
- package manager
- current branch
- clean/dirty Git state
- running/stopped/error
- preview URL
- last opened
- tags
- notes
Per repo, aim to support actions such as:
- Open preview
- Start
- Stop
- Restart
- Open in Finder
- Open in terminal
- Open in editor
- Open in Codex
- Install dependencies
- View README
- Copy local URL
- scan repos
- show list/grid
- detect repo type
- read optional manifest
- open repo path
- open preview URL
- manually start/stop supported repos
- track process state
- auto-detect ports
- Git status
- tags and favourites
- save metadata
- optional mapped-host integration
- proxy-aware preview links
- health checks
- install helpers
- screenshots or thumbnails
- richer logs
- domain/path rules per repo
- advanced status handling
- optional multi-user or multi-profile features if ever needed
This runtime handover is complete when Codex can implement a system where:
- repositories can be discovered from the shared workspace
- the Workspace Hub can run independently of any optional reverse-proxy front door
- an optional mapped host or proxy can act as a single local entry point when configured
- repos can still be opened directly when that is better
- repo handling differs appropriately by project type
- the Hub can start, stop, and open supported repos
- local previews remain practical for WordPress, static sites, Three.js, WebGL, and similar projects