* feat: embedded preview proxy for local dev servers Add a same-origin server proxy under /api/preview/proxy/:id and matching UI surfaces so local dev servers (Vite, Next, etc.) can be embedded inside OpenChamber. Server (packages/web/server): - New lib/preview/proxy-runtime.js: cookie-gated HTTP+WebSocket proxy to loopback hosts only, with TTL'd targets and SSRF allowlist. - index.js wires the runtime alongside terminal/event-stream. UI (packages/ui): - ContextPanel preview tab with iframe, reload, and open-in-browser. - Inline html code-block preview in MarkdownRenderer. - Terminal auto-detects loopback URLs and offers to open them. - i18n keys across en, es, pt-BR, uk, zh-CN. * perf(preview): cache proxy targets across PreviewPane remounts Module-scoped Map keyed by upstream URL so tab switches and component remounts within the same page session reuse the existing proxy registration instead of POSTing a fresh target each time. In-memory only by design: the server holds the target map in memory and the auth cookie is HttpOnly + scoped to the proxy id, so a stale persisted entry would 404 after a server restart. Entries are evicted on registration error and on a 30s safety margin before TTL expiry. * feat(preview): surface dev-server-down state with retry overlay Iframes don't expose HTTP status to the parent, so when the proxy returns a 502 (upstream dev server is offline) the iframe just renders the raw JSON error body. Probe the proxy URL out-of-band with HEAD (falling back to GET on 404/405) and replace the iframe with a friendly 'Dev server is not responding' overlay + retry button when the upstream is unreachable. Re-probes on reload, on URL change, and on proxy re-registration. * feat(preview): strip frame-busting response headers Many dev servers (Next.js, others) send X-Frame-Options: SAMEORIGIN and/or a CSP with frame-ancestors that block embedding inside the OpenChamber iframe. The proxy is same-origin and already authenticated per-target, so embedding is otherwise safe. - Drop X-Frame-Options outright on proxied responses. - Surgically remove only the frame-ancestors directive from Content-Security-Policy and Content-Security-Policy-Report-Only, preserving every other directive. Drops the header entirely if no directives remain. - Verified end-to-end: upstream sending both headers comes through with X-Frame-Options removed, CSP retaining default-src/script-src but no frame-ancestors, and unrelated headers untouched. * docs(preview): design for remote-host relay agent Design-only doc for the next phase of the embedded preview feature: when OpenChamber runs remotely (cloud/shared/tunnel) and the user's dev server runs on their local machine. Covers architecture (local agent + outbound control WebSocket + server dispatch), pairing flow, wire protocol, security model, failure modes, open questions, and implementation milestones. No code changes. * feat(preview): auto-open preview pane for loopback URLs in chat Detect http(s) loopback URLs in incoming assistant messages and open the preview pane automatically, deduped per (session, url) pair so re-renders or repeated mentions do not steal focus. Add an inline Preview button next to loopback links in chat markdown as a manual fallback when the auto-open was dismissed or the URL appeared in an older message. - url.ts: isLoopbackHttpUrl / extractLoopbackUrls helpers - ChatContainer: module-level dedupe Set + effect on active session tail - MarkdownRendererImpl: optional onPreviewLoopback in main renderer only (SimpleMarkdownRenderer for tool diffs is intentionally untouched) - Reuses existing terminalView.preview.open i18n keys * feat: preview enhancements, dev shutdown, and reliability fixes Add preview start/stop UI in ContextPanel/Header, improve URL detection (Python HTTP server logs, trailing punctuation, IPv6 loopback), fix proxy path filtering to avoid disrupting non-preview WebSockets. Add dev-only /api/system/dev-shutdown endpoint and Header button to terminate local dev processes and orphaned preview servers. Improve terminal cleanup with process group killing, event pipeline reconnect backoff. Update file read APIs with optional flag and cache control. Add /api/system/free-port endpoint, detectDevServer.ts utility, and preview/shutdown i18n strings for 5 languages. * fix: harden preview support * fix: keep terminal toolbar interactive * fix: keep expanded terminal below header * fix: keep preview iframe under proxy path * fix: respect project action preview urls * fix: rewrite preview asset urls * feat: capture preview console logs * feat: annotate preview elements * feat: attach preview annotation screenshots * fix: improve proxied preview hmr * feat: refine preview action UX * fix: address preview review feedback * fix: show auto-discover preview wait state --------- Co-authored-by: William Biggers <will@Williams-MacBook-Pro.local> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
162 lines
6.5 KiB
JSON
162 lines
6.5 KiB
JSON
{
|
|
"name": "openchamber-monorepo",
|
|
"version": "1.9.10",
|
|
"description": "OpenChamber monorepo workspace for web, ui, and desktop runtimes",
|
|
"private": true,
|
|
"type": "module",
|
|
"packageManager": "bun@1.3.5",
|
|
"workspaces": [
|
|
"packages/*"
|
|
],
|
|
"engines": {
|
|
"node": ">=20.0.0"
|
|
},
|
|
"keywords": [
|
|
"opencode",
|
|
"ai",
|
|
"coding",
|
|
"openchamber",
|
|
"cli"
|
|
],
|
|
"author": "Bohdan Triapitsyn",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev": "OPENCHAMBER_DEV_SHUTDOWN=true concurrently -n \"server,web,ui\" -c \"cyan,magenta,yellow\" \"bun run --cwd packages/web dev:server:watch\" \"bun run --cwd packages/web build:watch\" \"bun run --cwd packages/ui dev\"",
|
|
"build": "bun run --filter '*' build",
|
|
"build:web": "bun run --cwd packages/web build",
|
|
"build:ui": "bun run --cwd packages/ui build",
|
|
"build:desktop": "bun run --cwd packages/desktop build",
|
|
"build:electron": "bun run --cwd packages/electron build",
|
|
"type-check": "bun run --filter '*' type-check",
|
|
"type-check:web": "bun run --cwd packages/web type-check",
|
|
"type-check:ui": "bun run --cwd packages/ui type-check",
|
|
"type-check:desktop": "bun run --cwd packages/desktop type-check",
|
|
"type-check:electron": "bun run --cwd packages/electron type-check",
|
|
"lint": "bun run --filter '*' lint",
|
|
"lint:web": "bun run --cwd packages/web lint",
|
|
"lint:ui": "bun run --cwd packages/ui lint",
|
|
"lint:desktop": "bun run --cwd packages/desktop lint",
|
|
"lint:electron": "bun run --cwd packages/electron lint",
|
|
"clean": "bun run --filter '*' clean",
|
|
"postinstall": "patch-package",
|
|
"dev:web": "bun run --cwd packages/web build:watch",
|
|
"dev:web:server": "bun run --cwd packages/web dev:server:watch",
|
|
"dev:web:full": "node ./scripts/dev-web-full.mjs",
|
|
"dev:web:hmr": "node ./scripts/dev-web-hmr.mjs",
|
|
"start:web": "bun run --cwd packages/web start",
|
|
"pack:web": "bun pm pack --cwd packages/web",
|
|
"desktop:start-cli": "node ./packages/desktop/scripts/opencode-cli.mjs start",
|
|
"desktop:stop-cli": "node ./packages/desktop/scripts/opencode-cli.mjs stop",
|
|
"desktop:dev": "node ./packages/desktop/scripts/desktop-dev.mjs",
|
|
"desktop:build": "bun run --cwd packages/desktop build:sidecar && bun run --cwd packages/desktop tauri build",
|
|
"electron:dev": "node ./packages/electron/scripts/electron-dev.mjs",
|
|
"electron:build": "bun run --cwd packages/electron package",
|
|
"desktop:lint": "bun run --cwd packages/desktop lint && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings",
|
|
"desktop:type-check": "bun run --cwd packages/desktop type-check && cargo fmt --manifest-path packages/desktop/src-tauri/Cargo.toml -- --check && cargo clippy --manifest-path packages/desktop/src-tauri/Cargo.toml -- -D warnings",
|
|
"vscode:dev": "node ./scripts/dev-vscode.mjs",
|
|
"vscode:build": "bun run --cwd packages/vscode build",
|
|
"vscode:package": "bun run --cwd packages/vscode package",
|
|
"vscode:type-check": "bun run --cwd packages/vscode type-check",
|
|
"docs:validate": "node scripts/docs/validate-docs.mjs",
|
|
"icons:sprite": "node scripts/generate-file-type-sprite.mjs",
|
|
"themes:port:opencode": "tsx scripts/port-opencode-theme.ts",
|
|
"version:bump": "node scripts/bump-version.mjs",
|
|
"release:prepare": "bun run build && bun run type-check && bun run lint",
|
|
"release:test": "./scripts/test-release-build.sh",
|
|
"release:test:intel": "./scripts/test-release-build.sh x86_64",
|
|
"release:test:arm": "./scripts/test-release-build.sh aarch64"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/autocomplete": "^6.20.0",
|
|
"@codemirror/commands": "^6.10.1",
|
|
"@codemirror/lang-css": "^6.3.1",
|
|
"@codemirror/lang-html": "^6.4.11",
|
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
"@codemirror/lang-json": "^6.0.2",
|
|
"@codemirror/lang-markdown": "^6.5.0",
|
|
"@codemirror/lang-python": "^6.2.1",
|
|
"@codemirror/lang-rust": "^6.0.2",
|
|
"@codemirror/lang-cpp": "^6.0.3",
|
|
"@codemirror/lang-go": "^6.0.1",
|
|
"@codemirror/lang-sql": "^6.10.0",
|
|
"@codemirror/lang-xml": "^6.1.0",
|
|
"@codemirror/lang-yaml": "^6.1.2",
|
|
"@codemirror/language": "6.12.2",
|
|
"@codemirror/lint": "^6.9.2",
|
|
"@codemirror/search": "^6.6.0",
|
|
"@codemirror/state": "^6.5.4",
|
|
"@codemirror/view": "6.39.13",
|
|
"@fontsource/ibm-plex-mono": "^5.2.7",
|
|
"@fontsource/ibm-plex-sans": "^5.1.1",
|
|
"@heroui/scroll-shadow": "^2.3.18",
|
|
"@heroui/system": "^2.4.23",
|
|
"@heroui/theme": "^2.4.23",
|
|
"@ibm/plex": "^6.4.1",
|
|
"@lezer/highlight": "^1.2.3",
|
|
"@octokit/rest": "^22.0.1",
|
|
"@opencode-ai/sdk": "^1.4.25",
|
|
"@base-ui/react": "^1.4.0",
|
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
"@radix-ui/react-select": "^2.2.6",
|
|
"@radix-ui/react-separator": "^1.1.7",
|
|
"@radix-ui/react-slot": "^1.2.3",
|
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@remixicon/react": "^4.7.0",
|
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
"bun-pty": "^0.4.5",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"express": "^5.1.0",
|
|
"ghostty-web": "0.3.0",
|
|
"http-proxy-middleware": "^3.0.5",
|
|
"next-themes": "^0.4.6",
|
|
"node-pty": "1.2.0-beta.12",
|
|
"react": "^19.1.1",
|
|
"react-dom": "^19.1.1",
|
|
"react-markdown": "^10.1.0",
|
|
"react-syntax-highlighter": "^15.6.6",
|
|
"remark-gfm": "^4.0.1",
|
|
"simple-git": "^3.28.0",
|
|
"sonner": "^2.0.7",
|
|
"tailwind-merge": "^3.3.1",
|
|
"yaml": "^2.8.1",
|
|
"zod": "^4.3.6",
|
|
"zustand": "^5.0.8"
|
|
},
|
|
"overrides": {
|
|
"@codemirror/language": "6.12.2",
|
|
"@codemirror/view": "6.39.13"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.33.0",
|
|
"@tailwindcss/postcss": "^4.0.0",
|
|
"@types/dom-speech-recognition": "^0.0.7",
|
|
"@types/node": "^24.3.1",
|
|
"@types/react": "^19.1.10",
|
|
"@types/react-dom": "^19.1.7",
|
|
"@vitejs/plugin-react": "^5.0.0",
|
|
"autoprefixer": "^10.4.21",
|
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
"concurrently": "^9.2.1",
|
|
"cors": "^2.8.5",
|
|
"cross-env": "^7.0.3",
|
|
"eslint": "^9.33.0",
|
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
"globals": "^16.3.0",
|
|
"nodemon": "^3.1.7",
|
|
"patch-package": "^8.0.0",
|
|
"tailwindcss": "^4.0.0",
|
|
"tsx": "^4.20.6",
|
|
"tw-animate-css": "^1.3.8",
|
|
"typescript": "~5.8.3",
|
|
"typescript-eslint": "^8.39.1",
|
|
"vite": "^7.1.2"
|
|
}
|
|
}
|