Skip to content
Merged
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
3 changes: 2 additions & 1 deletion apps/ide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Following Electron's [security checklist](https://www.electronjs.org/docs/latest
| No network request unless the person asks: the update check runs from Help > Check for Updates…, or at start-up only if `update.checkOnStartup` is turned on (off by default); it reads the public GitHub releases list, downloads nothing and only opens the release page in the browser | `src/main/updates/` (`updateRelease.ts` pure, `updateCheck.ts`) | Unit tests (`test/updateCheck.test.ts`: tags, drafts, pre-releases, versions); never run in the smoke run. |
| Extensions (#251) are unpacked only from checked archives: entries under `extension/` only, no `..`, absolute paths, drive letters or links, size limits; an Open VSX download must match the registry's SHA-256; a native dialog shows publisher, verification, licence and whether it runs code before anything is installed; nothing goes online unless the person searches or installs | `src/main/extensions/` (`vsix.ts`, `openVsx.ts`, `extensionsService.ts`) | Unit tests (`test/extensions.test.ts`: zip-slip, symlink and garbage archives, wrong and missing checksums, http downloads, tampered `extensions.json`). |
| The renderer may compile WebAssembly (`'wasm-unsafe-eval'`) for the TextMate regex engine of extension grammars (#258); `eval` stays blocked | `buildContentSecurityPolicy` | Unit tests; smoke checks `eval` throws. |
| Extensions' code (#259) runs only in the extension host, a separate Node process per window, never in the renderer or main; what it asks of main is checked there (files only inside the folder, links only http/https/mailto, secrets in the OS store per extension); only workbench activation events are accepted from the renderer | `src/extensionHost/`, `src/main/extensions/extensionHostManager.ts` | Unit tests (`test/extensionHost.test.ts`, with a real host process). |
| The dev server URL is ignored in a packaged build | `src/main/index.ts` (`app.isPackaged`) | Code review. |

Running as root (containers, some CI images) requires `--no-sandbox`, which the scripts add only in that case. It turns off Chromium's OS-level sandbox and `app.enableSandbox()`; the per-window `sandbox: true` preference and its assertion stay.
Expand Down Expand Up @@ -362,7 +363,7 @@ The parsers (`statusParser.ts`, `blameParser.ts`) are pure and unit-tested on st

## VS Code extensions (stream `ide-extensions`, epic #251)

The Extensions view (activity bar, puzzle icon, `Ctrl/Cmd+Shift+X`) installs VS Code extensions from **Open VSX** (never the Visual Studio Marketplace, whose terms only allow Microsoft products; ADR [0002](../../adr/0002-vscode-extensions-in-the-ide.md)) or from a `.vsix` file, and enables, disables and uninstalls them. Colour themes, languages, TextMate grammars and snippets apply at once; extensions with code run in the extension host (#259, in progress). Design, state and how to try it: [`docs/ide/extensions.md`](../../docs/ide/extensions.md).
The Extensions view (activity bar, puzzle icon, `Ctrl/Cmd+Shift+X`) installs VS Code extensions from **Open VSX** (never the Visual Studio Marketplace, whose terms only allow Microsoft products; ADR [0002](../../adr/0002-vscode-extensions-in-the-ide.md)) or from a `.vsix` file, and enables, disables and uninstalls them. Colour themes, languages, TextMate grammars and snippets apply at once; extensions with code run in an extension host process per window (`src/extensionHost/`, #259), with their commands in the palette and their messages, pickers, progress and status bar items in the workbench. Design, state and how to try it: [`docs/ide/extensions.md`](../../docs/ide/extensions.md).

## AI agent hub (stream `ai-agents`)

Expand Down
4 changes: 3 additions & 1 deletion apps/ide/electron-builder.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// npm run dist --workspace=code-xr-ide the current OS's installers
//
// The app itself is apps/ide/out (main, preloads, renderer: every npm
// The app itself is apps/ide/out (main, preloads, renderer, extension host: every npm
// dependency is bundled by Vite except node-pty), plus the three runtime
// packages that run as files: node-pty (native), and typescript-language-
// server with TypeScript, which run as a separate process (#21). Those three
Expand Down Expand Up @@ -42,6 +42,8 @@ module.exports = {
'**/node_modules/node-pty/**',
'**/node_modules/typescript-language-server/**',
'**/node_modules/typescript/**',
// #259: the extension host is forked as a script: a real file, not one inside the archive.
'out/extensionHost/**',
],
extraResources: [
{ from: `${EXTENSION}/dist/code_analysis`, to: 'dist/code_analysis' },
Expand Down
1 change: 1 addition & 0 deletions apps/ide/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ import { nodeTargetConfig, rendererConfig } from './viteConfigs.mjs';
await build(nodeTargetConfig('main'));
await build(nodeTargetConfig('preload'));
await build(nodeTargetConfig('scenePreload'));
await build(nodeTargetConfig('extensionHost'));
await build(rendererConfig());
console.log('[code-xr-ide] built into apps/ide/out/');
6 changes: 3 additions & 3 deletions apps/ide/scripts/dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ function restartElectron() {
startElectron();
}

// Watch main and both preloads (the window's and the scene view's, #16); restart Electron after each successful rebuild.
const pending = new Set(['main', 'preload', 'scenePreload']);
for (const target of /** @type {const} */ (['main', 'preload', 'scenePreload'])) {
// Watch main, both preloads (the window's and the scene view's, #16) and the extension host (#259); restart Electron after each successful rebuild.
const pending = new Set(['main', 'preload', 'scenePreload', 'extensionHost']);
for (const target of /** @type {const} */ (['main', 'preload', 'scenePreload', 'extensionHost'])) {
const config = nodeTargetConfig(target, { dev: true });
config.build.watch = {};
const watcher = /** @type {import('vite').Rollup.RollupWatcher} */ (await build(config));
Expand Down
3 changes: 2 additions & 1 deletion apps/ide/scripts/viteConfigs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// out/main/index.cjs main process (Node, CommonJS)
// out/preload/index.cjs preload (sandboxed: may only require 'electron')
// out/renderer/ renderer (browser, served from codexr://app/)
// out/extensionHost/index.cjs extension host (#259: a Node child process on Electron's own Node)
import { builtinModules } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand All @@ -27,7 +28,7 @@ const NODE_EXTERNALS = ['electron', /^electron\//, ...builtinModules, ...builtin
*/
const MAIN_NATIVE_EXTERNALS = ['node-pty'];

/** @param {'main' | 'preload' | 'scenePreload'} target @param {{ dev?: boolean }} [opts] */
/** @param {'main' | 'preload' | 'scenePreload' | 'extensionHost'} target @param {{ dev?: boolean }} [opts] */
export function nodeTargetConfig(target, opts = {}) {
return {
configFile: false,
Expand Down
Loading
Loading