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
31 changes: 17 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,32 +300,35 @@ jobs:
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile

# Build the `codeg-mcp` companion binary for the matrix target and
# stage it as a Tauri sidecar at
# `src-tauri/binaries/codeg-mcp-<triple>{.exe}`. `tauri-action` (below)
# then bundles it via the `bundle.externalBin` entry in
# Build the `codeg-mcp` companion and the fixed, offline Browser runtime
# package for the matrix target. Stage 2 Browser support is Windows-only;
# non-Windows targets receive an explicit fail-closed stub so Tauri's
# externalBin validation remains honest. `tauri-action` then bundles both
# files via the `bundle.externalBin` entry in
# `tauri.conf.json` — Tauri installs it next to the main executable
# (Contents/MacOS on macOS, install root on Linux/Windows) where the
# runtime `locate_codeg_mcp_binary()` finds it via `current_exe`
# sibling lookup. The Linux arm64 cross env vars set above also
# runtime locators find them via `current_exe` sibling lookup. The Linux
# arm64 cross env vars set above also
# apply to this cargo invocation.
- name: Stage codeg-mcp sidecar for Tauri bundle
- name: Stage Tauri sidecars
shell: bash
run: pnpm tauri:prepare-sidecars --target ${{ matrix.target }}

- name: Verify codeg-mcp sidecar landed
- name: Verify Tauri sidecars landed
shell: bash
run: |
ext=""
case "${{ matrix.target }}" in
*windows*) ext=".exe" ;;
esac
file="src-tauri/binaries/codeg-mcp-${{ matrix.target }}${ext}"
if [ ! -f "$file" ]; then
echo "FATAL: sidecar $file missing after prepare-sidecars"
exit 1
fi
ls -la "$file"
for name in codeg-mcp codeg-browser-sidecar; do
file="src-tauri/binaries/${name}-${{ matrix.target }}${ext}"
if [ ! -s "$file" ]; then
echo "FATAL: non-empty sidecar $file missing after prepare-sidecars"
exit 1
fi
ls -la "$file"
done

- name: Import Apple Developer ID certificate
if: contains(matrix.target, 'apple-darwin')
Expand Down
47 changes: 47 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Third-party notices

Codeg is licensed under Apache-2.0. The stage 2 Browser sidecar additionally
bundles the following MIT-licensed projects at fixed versions:

- `@modelcontextprotocol/sdk` 1.30.0 — Model Context Protocol TypeScript SDK,
https://github.com/modelcontextprotocol/typescript-sdk
- `ipaddr.js` 2.5.0 — IPv4 and IPv6 address parsing,
https://github.com/whitequark/ipaddr.js
- `ws` 8.21.3 — WebSocket implementation for Node.js,
https://github.com/websockets/ws
- `zod` 4.4.3 — TypeScript-first schema validation,
https://github.com/colinhacks/zod
- Node.js 22.23.2 runtime embedded by the fixed `@yao-pkg/pkg` build tool —
https://github.com/nodejs/node/blob/v22.23.2/LICENSE

Build-only MIT dependencies used to create the packaged sidecar are:

- `esbuild` 0.28.2 — https://github.com/evanw/esbuild
- `@yao-pkg/pkg` 6.22.0 — https://github.com/yao-pkg/pkg
- `@yao-pkg/pkg-fetch` 3.6.5 — https://github.com/yao-pkg/pkg-fetch

The package itself is Apache-2.0 under the repository `LICENSE`. The following
MIT terms apply to the MIT components listed above (their individual copyright
notices remain attributed to their respective authors and contributors):

> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

Node.js includes additional third-party component notices in its fixed-version
license file linked above. `pnpm-lock.yaml` records the complete JavaScript
dependency graph used for the packaged sidecar.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const eslintConfig = defineConfig([
"next-env.d.ts",
"src-tauri/target/**",
"src-tauri/experts/**",
"packages/*/dist/**",
"public/vs/**",
// Gitignored scratch space for planning/review docs and one-off probe
// scripts. Prettier already skips it — its `--ignore-path` defaults to
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"browser:build": "pnpm --filter @codeg/browser-mcp build",
"browser:test": "pnpm --filter @codeg/browser-mcp test",
"browser:smoke:windows": "node packages/codeg-plus-browser-mcp/scripts/smoke-windows.mjs",
"server:build": "cd src-tauri && cargo build --release --bin codeg-server --no-default-features",
"server:dev": "cd src-tauri && cargo run --bin codeg-server --no-default-features",
"tauri:prepare-sidecars": "node src-tauri/scripts/prepare-sidecars.mjs",
Expand Down
62 changes: 62 additions & 0 deletions packages/codeg-plus-browser-mcp/PROVENANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Browser sidecar source and packaging record

## Source boundary

All files under `src/` and `scripts/` in this package are original Codeg
implementation authored for stage 2. No Cindy or OpenClaw source file is copied
into this package.

Cindy was used only as an architectural and behavioral reference for these
facts:

- keep the Browser runtime independent from the desktop renderer;
- expose progressive MCP discovery through `list_tools` and `call_tool`;
- isolate the managed browser profile from the user's default Chrome profile;
- enforce a 200,000-byte bound on textual tool output;
- own and clean up the complete browser process tree.

The reviewed Cindy reference is Apache-2.0. Its vendored OpenClaw runtime is
MIT and pinned there at commit
`b972feb3f791ed38dafc27c1961dc87f2e30b210`, but none of that generated runtime
is imported here. In particular, Codeg does not carry Cindy's generated
`npx chrome-devtools-mcp@latest` fallback.

## Fixed production dependencies

| Package | Version | License | Purpose |
| --------------------------- | ------: | ------- | -------------------------------------------- |
| `@modelcontextprotocol/sdk` | 1.30.0 | MIT | MCP server and Streamable HTTP transport |
| `ipaddr.js` | 2.5.0 | MIT | IP range classification for SSRF enforcement |
| `ws` | 8.21.3 | MIT | Chrome DevTools Protocol WebSocket transport |
| `zod` | 4.4.3 | MIT | Strict public tool schemas |

## Fixed build-only dependencies

| Package | Version | License | Purpose |
| -------------------- | ------: | ---------- | ------------------------------------------------------------ |
| `esbuild` | 0.28.2 | MIT | Produce one deterministic CommonJS sidecar bundle |
| `@yao-pkg/pkg` | 6.22.0 | MIT | Embed the bundle and Node 22 runtime in a Windows executable |
| `@yao-pkg/pkg-fetch` | 3.6.5 | MIT | Fetch checksum-verified base runtimes for `pkg` |
| `typescript` | 5.8.x | Apache-2.0 | Static type checking |

`pnpm-lock.yaml` is the authoritative transitive dependency lock. Release and
local Tauri builds run `src-tauri/scripts/prepare-sidecars.mjs`, which first
builds the bundle and then produces
`codeg-browser-sidecar-<target>.exe`. The installed client never runs npm,
pnpm, npx, or another online installer.

`@yao-pkg/pkg-fetch` 3.6.5 resolves the `node22` targets to Node.js 22.23.2.
Its checked-in expected SHA-256 values for the Windows targets used by Codeg
Plus are:

- `node-v22.23.2-win-x64`:
`555d3dceaaf1c5628ac8fa23d1ebde46a424d2ad6782cc2412be8eed4a7a6b69`
- `node-v22.23.2-win-arm64`:
`d625fdb98c359a0b234566ff66d50e802c9f48abad732b46d54014e41d9389db`

The packaged executable therefore has a fixed base-runtime version and an
upstream checksum gate in addition to the workspace lockfile.

Non-Windows Tauri targets receive a non-functional packaged stub so existing
macOS/Linux builds remain valid. Stage 2 runtime support and acceptance are
Windows-only.
31 changes: 31 additions & 0 deletions packages/codeg-plus-browser-mcp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@codeg/browser-mcp",
"version": "0.1.0",
"private": true,
"description": "Codeg managed Browser MCP sidecar",
"license": "Apache-2.0",
"type": "module",
"bin": {
"codeg-browser-sidecar": "dist/cli.cjs"
},
"scripts": {
"build": "tsc --noEmit && node scripts/build.mjs",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@modelcontextprotocol/sdk": "1.30.0",
"ipaddr.js": "2.5.0",
"ws": "8.21.3",
"zod": "4.4.3"
},
"devDependencies": {
"@types/node": "26.2.0",
"@types/ws": "8.18.1",
"@yao-pkg/pkg": "6.22.0",
"esbuild": "0.28.2",
"typescript": "~5.8.3",
"vitest": "2.1.8"
}
}
20 changes: 20 additions & 0 deletions packages/codeg-plus-browser-mcp/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { mkdir } from "node:fs/promises"
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"

import { build } from "esbuild"

const packageDir = resolve(dirname(fileURLToPath(import.meta.url)), "..")
const output = resolve(packageDir, "dist", "cli.cjs")

await mkdir(dirname(output), { recursive: true })
await build({
entryPoints: [resolve(packageDir, "src", "cli.ts")],
outfile: output,
bundle: true,
platform: "node",
target: "node22",
format: "cjs",
sourcemap: false,
legalComments: "none",
})
Loading