Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions app/electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
import { defineConfig } from 'electron-vite';
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'node:url';
import { realpathSync } from 'node:fs';

// The renderer imports the protocol schemas from ../docs/protocol/schema —
// outside the renderer root, so the dev server needs the repo root allowed.
const repoRoot = fileURLToPath(new URL('..', import.meta.url));

// Allow the REAL node_modules location too: in a normal checkout this is inside
// repoRoot (a no-op), but when node_modules is a symlink (monorepo / git
// worktree dev), assets like @fontsource woff2 resolve to the link target and
// would otherwise fall outside the fs allow list.
const nodeModulesReal = (() => {
try {
return realpathSync(fileURLToPath(new URL('./node_modules', import.meta.url)));
} catch {
return null;
}
})();
const fsAllow = nodeModulesReal ? [repoRoot, nodeModulesReal] : [repoRoot];

// `ws` lazily require()s the optional native addons bufferutil / utf-8-validate.
// If `ws` is bundled into the main process, the bundler tries to resolve those
// addons at build time and the main process crashes at launch ("bufferutil").
// Keep `ws` (and the optional addons) external so they load from node_modules
// at runtime, where ws's try/catch falls back to its pure-JS path cleanly.
const wsExternals = ['ws', 'bufferutil', 'utf-8-validate'];

export default defineConfig({
main: {},
preload: {},
main: {
plugins: [externalizeDepsPlugin()],
build: { rollupOptions: { external: wsExternals } },
},
preload: {
plugins: [externalizeDepsPlugin()],
build: { rollupOptions: { external: wsExternals } },
},
renderer: {
plugins: [react()],
server: { fs: { allow: [repoRoot] } },
server: { fs: { allow: fsAllow } },
},
});
5 changes: 5 additions & 0 deletions app/src/renderer/src/lx/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// VENDORED MIRROR of @omadia/canvas-core src/lx/index.ts — single source of
// truth is byte5ai/omadia middleware/packages/canvas-core. Keep in sync.
export * from './types.js';
export { evaluate, runTransition } from './interpreter.js';
export { validateLumenSemantics, type SemanticResult } from './validate.js';
Loading
Loading