mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
Exposes --agent-host-port/--agent-host-path to specify an additional
port for them to listen on. This runs as a separate process mirroring
the architecture from main.
Does a 'hello world', I need to keep testing it some more. I honestly
don't know a lot about the import changes Opus is doing here. Without
them, there is an error:
```
import { CopilotClient } from "@github/copilot-sdk";
^^^^^^^^^^^^^
SyntaxError: The requested module '@github/copilot-sdk' does not provide an export named 'CopilotClient'
```
This was Copilot's explanation for why they're needed here but not in Electron:
>The agent host process itself didn't change — the issue is the **module resolution environment** differs between Electron and the server.
>
>**Electron (desktop):** `ElectronAgentHostStarter` spawns a utility process that inherits the main process's module resolution. It resolves packages from the **root** node_modules, where `@github/copilot-sdk`, `ws`, etc. are all installed. Everything just works.
>
>**Server:** `NodeAgentHostStarter` spawns a child via `bootstrap-fork.js`, which registers a custom ESM resolver hook (bootstrap-import.ts) that **redirects** all module lookups to node_modules instead of root node_modules. That's the `[bootstrap-import] Initialized node_modules redirector for: ...\remote\node_modules` log line. The remote folder has its own package.json with a curated set of server-specific dependencies.
>
>The problems were:
>1. **Missing deps** — `@github/copilot-sdk`, `@github/copilot`, and `ws` weren't in package.json because the agent host had never run in the server context before
>2. **Resolver bugs** — bootstrap-import.ts was written when all remote deps were CJS. It hardcoded `format: 'commonjs'`, didn't handle `exports` maps, didn't handle `.mjs` files, and didn't resolve subpath imports like `vscode-jsonrpc/node`. These are pre-existing limitations that never mattered until now because no server component previously depended on ESM-only npm packages.
>
>So in short: the agent host code is identical — it's the server's module resolution plumbing that needed updating to support the ESM packages the agent host depends on.
cc @bpasero as the expert in this area
55 lines
1.7 KiB
JSON
55 lines
1.7 KiB
JSON
{
|
|
"name": "vscode-reh",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"dependencies": {
|
|
"@anthropic-ai/sandbox-runtime": "0.0.23",
|
|
"@github/copilot": "^1.0.4-0",
|
|
"@github/copilot-sdk": "^0.1.32",
|
|
"@microsoft/1ds-core-js": "^3.2.13",
|
|
"@microsoft/1ds-post-js": "^3.2.13",
|
|
"@parcel/watcher": "^2.5.6",
|
|
"@vscode/deviceid": "^0.1.1",
|
|
"@vscode/iconv-lite-umd": "0.7.1",
|
|
"@vscode/native-watchdog": "^1.4.6",
|
|
"@vscode/proxy-agent": "^0.39.1",
|
|
"@vscode/ripgrep": "^1.17.1",
|
|
"@vscode/spdlog": "^0.15.7",
|
|
"@vscode/tree-sitter-wasm": "^0.3.0",
|
|
"@vscode/vscode-languagedetection": "1.0.23",
|
|
"@vscode/windows-process-tree": "^0.6.0",
|
|
"@vscode/windows-registry": "^1.2.0",
|
|
"@xterm/addon-clipboard": "^0.3.0-beta.191",
|
|
"@xterm/addon-image": "^0.10.0-beta.191",
|
|
"@xterm/addon-ligatures": "^0.11.0-beta.191",
|
|
"@xterm/addon-progress": "^0.3.0-beta.191",
|
|
"@xterm/addon-search": "^0.17.0-beta.191",
|
|
"@xterm/addon-serialize": "^0.15.0-beta.191",
|
|
"@xterm/addon-unicode11": "^0.10.0-beta.191",
|
|
"@xterm/addon-webgl": "^0.20.0-beta.190",
|
|
"@xterm/headless": "^6.1.0-beta.191",
|
|
"@xterm/xterm": "^6.1.0-beta.191",
|
|
"cookie": "^0.7.0",
|
|
"http-proxy-agent": "^7.0.0",
|
|
"https-proxy-agent": "^7.0.2",
|
|
"jschardet": "3.1.4",
|
|
"katex": "^0.16.22",
|
|
"kerberos": "2.1.1",
|
|
"minimist": "^1.2.8",
|
|
"node-pty": "^1.2.0-beta.10",
|
|
"tas-client": "0.3.1",
|
|
"vscode-oniguruma": "1.7.0",
|
|
"vscode-regexpp": "^3.1.0",
|
|
"vscode-textmate": "^9.3.2",
|
|
"ws": "^8.19.0",
|
|
"yauzl": "^3.0.0",
|
|
"yazl": "^2.4.3"
|
|
},
|
|
"overrides": {
|
|
"node-gyp-build": "4.8.1",
|
|
"kerberos@2.1.1": {
|
|
"node-addon-api": "7.1.0"
|
|
}
|
|
}
|
|
}
|