mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
* feat(server): add workspace session read APIs Expose workspace-scoped session list, detail, message, and snapshot reads so the client can fetch session data without depending on activation choreography. * feat(app): route mounted session reads through OpenWork APIs Use the new workspace-scoped session read endpoints for mounted OpenWork clients so the current frontend stops depending on direct session proxy reads for list, detail, message, and todo loading. * feat(app): add React read-only session transcript Introduce a feature-gated React island for the session transcript so we can replace the session surface incrementally while keeping the Solid shell intact. * feat(app): add React session composer surface Extend the feature-gated React session island to own its draft, prompt send, stop flow, and snapshot polling so the session body can evolve independently from the Solid composer. * feat(app): add React session transition model Keep the React session surface stable during session switches by tracking rendered vs intended session state and exposing a developer debug panel for render-source and transition inspection. * docs(prd): add React migration plan to repo Copy the incremental React adoption PRD into the OpenWork repo so the migration plan lives next to the implementation and PR branch. * docs(prd): sync full React migration plan Replace the shortened repo copy with the full incremental React adoption PRD so the implementation branch and product plan stay in sync. * feat(desktop): add React session launch modes Add dedicated Tauri dev and debug-build entrypoints for the React session path and honor a build-time React session flag before local storage so the alternate shell is easy to launch and reproduce. * fix(app): fall back to legacy mounted session reads Keep the new app working against older OpenWork servers by falling back to the original mounted OpenCode session reads when the workspace-scoped session read APIs are unavailable.
65 lines
1.9 KiB
TypeScript
65 lines
1.9 KiB
TypeScript
import os from "node:os";
|
|
import { resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import devtools from "solid-devtools/vite";
|
|
import solid from "vite-plugin-solid";
|
|
|
|
const portValue = Number.parseInt(process.env.PORT ?? "", 10);
|
|
const devPort = Number.isFinite(portValue) && portValue > 0 ? portValue : 5173;
|
|
const allowedHosts = new Set<string>();
|
|
const envAllowedHosts = process.env.VITE_ALLOWED_HOSTS ?? "";
|
|
|
|
const addHost = (value?: string | null) => {
|
|
const trimmed = value?.trim();
|
|
if (!trimmed) return;
|
|
allowedHosts.add(trimmed);
|
|
};
|
|
|
|
envAllowedHosts.split(",").forEach(addHost);
|
|
addHost(process.env.OPENWORK_PUBLIC_HOST ?? null);
|
|
const hostname = os.hostname();
|
|
addHost(hostname);
|
|
const shortHostname = hostname.split(".")[0];
|
|
if (shortHostname && shortHostname !== hostname) {
|
|
addHost(shortHostname);
|
|
}
|
|
const appRoot = resolve(fileURLToPath(new URL(".", import.meta.url)));
|
|
const reactFiles = /\.react\.[tj]sx?$/;
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: "openwork-dev-server-id",
|
|
configureServer(server) {
|
|
server.middlewares.use("/__openwork_dev_server_id", (_req, res) => {
|
|
res.setHeader("Content-Type", "application/json");
|
|
res.end(JSON.stringify({ appRoot }));
|
|
});
|
|
},
|
|
},
|
|
tailwindcss(),
|
|
react({ include: reactFiles }),
|
|
devtools({
|
|
autoname: true,
|
|
// jsxLocation is required for in-page locator: map DOM → Solid components (hold Option/Alt while hovering).
|
|
locator: {
|
|
targetIDE: "vscode",
|
|
jsxLocation: true,
|
|
componentLocation: true,
|
|
},
|
|
}),
|
|
solid({ exclude: [reactFiles] }),
|
|
],
|
|
server: {
|
|
port: devPort,
|
|
strictPort: true,
|
|
...(allowedHosts.size > 0 ? { allowedHosts: Array.from(allowedHosts) } : {}),
|
|
},
|
|
build: {
|
|
target: "esnext",
|
|
},
|
|
});
|