From 7fe8fee295777f4232a3e78a92eff77f425698fc Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:30:33 +0000 Subject: [PATCH 01/15] Fix Tauri CLI native dependency installs --- .github/workflows/build-and-upload.yml | 55 +++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 0f016523..33520871 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -4,17 +4,30 @@ on: workflow_call: inputs: version: - description: "Version to apply to workspace packages" - required: true + description: "Version to apply to workspace packages (release builds)" + required: false + default: "" type: string tag: - description: "Git tag to upload assets to" - required: true + description: "Git tag to upload assets to (release builds)" + required: false + default: "" type: string release_name: description: "Release name (unused here, for context)" - required: true + required: false + default: "" type: string + upload: + description: "Upload built artifacts to the GitHub release" + required: false + default: true + type: boolean + set_versions: + description: "Run npm version to set workspace versions" + required: false + default: true + type: boolean permissions: id-token: write @@ -41,6 +54,7 @@ jobs: cache: npm - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies @@ -53,6 +67,7 @@ jobs: run: npm run build:mac --workspace @neuralnomads/codenomad-electron-app - name: Upload release assets + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob @@ -79,6 +94,7 @@ jobs: cache: npm - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${{ env.VERSION }} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version shell: bash @@ -92,6 +108,7 @@ jobs: run: npm run build:win --workspace @neuralnomads/codenomad-electron-app - name: Upload release assets + if: ${{ inputs.upload && inputs.tag != '' }} shell: pwsh run: | Get-ChildItem -Path "packages/electron-app/release" -Filter *.zip -File | ForEach-Object { @@ -116,6 +133,7 @@ jobs: cache: npm - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies @@ -128,6 +146,7 @@ jobs: run: npm run build:linux --workspace @neuralnomads/codenomad-electron-app - name: Upload release assets + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob @@ -157,6 +176,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies @@ -165,10 +185,14 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-x64 --no-save + - name: Ensure tauri native binary + run: npm install @tauri-apps/cli-darwin-x64 --no-save + - name: Build macOS bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app - name: Package Tauri artifacts (macOS) + if: ${{ inputs.upload }} run: | set -euo pipefail BUNDLE_ROOT="packages/tauri-app/target/release/bundle" @@ -180,6 +204,7 @@ jobs: fi - name: Upload Tauri release assets (macOS) + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob @@ -209,6 +234,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies @@ -217,10 +243,14 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-arm64 --no-save + - name: Ensure tauri native binary + run: npm install @tauri-apps/cli-darwin-arm64 @tauri-apps/cli-darwin-universal --no-save + - name: Build macOS bundle (Tauri, arm64) run: npm run build --workspace @codenomad/tauri-app - name: Package Tauri artifacts (macOS arm64) + if: ${{ inputs.upload }} run: | set -euo pipefail BUNDLE_ROOT="packages/tauri-app/target/release/bundle" @@ -232,6 +262,7 @@ jobs: fi - name: Upload Tauri release assets (macOS arm64) + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob @@ -261,6 +292,7 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${{ env.VERSION }} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version shell: bash @@ -270,10 +302,14 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-win32-x64-msvc --no-save + - name: Ensure tauri native binary + run: npm install @tauri-apps/cli-win32-x64-msvc --no-save + - name: Build Windows bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app - name: Package Tauri artifacts (Windows) + if: ${{ inputs.upload }} shell: pwsh run: | $bundleRoot = "packages/tauri-app/target/release/bundle" @@ -287,6 +323,7 @@ jobs: } - name: Upload Tauri release assets (Windows) + if: ${{ inputs.upload && inputs.tag != '' }} shell: pwsh run: | if (Test-Path "packages/tauri-app/release-tauri") { @@ -329,6 +366,7 @@ jobs: librsvg2-dev - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies @@ -337,10 +375,14 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-x64-gnu --no-save + - name: Ensure tauri native binary + run: npm install @tauri-apps/cli-linux-x64-gnu --no-save + - name: Build Linux bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app - name: Package Tauri artifacts (Linux) + if: ${{ inputs.upload }} run: | set -euo pipefail SEARCH_ROOT="packages/tauri-app/target" @@ -367,6 +409,7 @@ jobs: cp "$rpm" "$ARTIFACT_DIR/CodeNomad-Tauri-${VERSION}-linux-x64.rpm" - name: Upload Tauri release assets (Linux) + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob @@ -497,6 +540,7 @@ jobs: sudo gem install --no-document fpm - name: Set workspace versions + if: ${{ inputs.set_versions && inputs.version != '' }} run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install project dependencies @@ -509,6 +553,7 @@ jobs: run: npm run build:linux-rpm --workspace @neuralnomads/codenomad-electron-app - name: Upload RPM release assets + if: ${{ inputs.upload && inputs.tag != '' }} run: | set -euo pipefail shopt -s nullglob From ac04d5daf7e26c7cb9feb5671e39690441c6487d Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:30:37 +0000 Subject: [PATCH 02/15] Run build-only CI on dev pushes --- .github/workflows/dev-release.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index aa245292..235e9bc0 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -1,16 +1,18 @@ -name: Dev Release +name: Dev CI on: + push: + branches: + - dev workflow_dispatch: permissions: - id-token: write - contents: write + contents: read jobs: - dev-release: - uses: ./.github/workflows/reusable-release.yml + dev-ci: + uses: ./.github/workflows/build-and-upload.yml with: - version_suffix: -dev - dist_tag: dev + upload: false + set_versions: false secrets: inherit From ac8dfcc60728083ad329d9b546fe8b7b696c8e05 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:30:40 +0000 Subject: [PATCH 03/15] Improve opencode-config install on Windows --- .../server/scripts/copy-opencode-config.mjs | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/packages/server/scripts/copy-opencode-config.mjs b/packages/server/scripts/copy-opencode-config.mjs index ab952f9d..295d3b45 100644 --- a/packages/server/scripts/copy-opencode-config.mjs +++ b/packages/server/scripts/copy-opencode-config.mjs @@ -10,7 +10,7 @@ const cliRoot = path.resolve(__dirname, "..") const sourceDir = path.resolve(cliRoot, "../opencode-config") const targetDir = path.resolve(cliRoot, "dist/opencode-config") const nodeModulesDir = path.resolve(sourceDir, "node_modules") -const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm" +const npmCandidates = process.platform === "win32" ? ["npm.cmd", "npm"] : ["npm"] if (!existsSync(sourceDir)) { console.error(`[copy-opencode-config] Missing source directory at ${sourceDir}`) @@ -19,24 +19,41 @@ if (!existsSync(sourceDir)) { if (!existsSync(nodeModulesDir)) { console.log(`[copy-opencode-config] Installing opencode-config dependencies in ${sourceDir}`) - const result = spawnSync( - npmCmd, - [ - "install", - "--prefix", - sourceDir, - "--omit=dev", - "--ignore-scripts", - "--fund=false", - "--audit=false", - "--package-lock=false", - "--workspaces=false", - ], - { cwd: sourceDir, stdio: "inherit", env: { ...process.env, npm_config_workspaces: "false" } }, - ) - if (result.status !== 0) { + + const npmArgs = [ + "install", + "--omit=dev", + "--ignore-scripts", + "--fund=false", + "--audit=false", + "--package-lock=false", + "--workspaces=false", + ] + + let lastResult + for (const npmCmd of npmCandidates) { + const result = spawnSync(npmCmd, npmArgs, { + cwd: sourceDir, + stdio: "inherit", + env: { ...process.env, npm_config_workspaces: "false" }, + }) + + lastResult = result + + if (result.error?.code === "ENOENT") { + console.warn(`[copy-opencode-config] ${npmCmd} not found on PATH, trying next candidate`) + continue + } + + break + } + + if (!lastResult || lastResult.status !== 0) { + if (lastResult?.error) { + console.error("[copy-opencode-config] npm install failed to start", lastResult.error) + } console.error("[copy-opencode-config] Failed to install opencode-config dependencies") - process.exit(result.status ?? 1) + process.exit(lastResult?.status ?? 1) } } From fa308696b493be94f973b41d3f4146ce51bc9482 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:32:29 +0000 Subject: [PATCH 04/15] Allow callers to control workflow permissions --- .github/workflows/build-and-upload.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 33520871..4a24ad6e 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -29,9 +29,8 @@ on: default: true type: boolean -permissions: - id-token: write - contents: write +# Permissions are intentionally omitted here so callers can choose +# least-privilege (e.g. dev CI uses read-only; releases grant write). env: NODE_VERSION: 20 From f5682ea246e60f706ec04f09ebfcb7451cde5580 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:45:40 +0000 Subject: [PATCH 05/15] Fix dev CI build tool resolution and Windows npm spawning --- .github/workflows/build-and-upload.yml | 2 +- packages/electron-app/scripts/build.js | 14 ++++++-- .../server/scripts/copy-opencode-config.mjs | 32 +++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 4a24ad6e..ef76b929 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -243,7 +243,7 @@ jobs: run: npm install @rollup/rollup-darwin-arm64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-darwin-arm64 @tauri-apps/cli-darwin-universal --no-save + run: npm install @tauri-apps/cli-darwin-arm64 --no-save - name: Build macOS bundle (Tauri, arm64) run: npm run build --workspace @codenomad/tauri-app diff --git a/packages/electron-app/scripts/build.js b/packages/electron-app/scripts/build.js index 17f58d02..4cc52ce7 100644 --- a/packages/electron-app/scripts/build.js +++ b/packages/electron-app/scripts/build.js @@ -2,7 +2,7 @@ import { spawn } from "child_process" import { existsSync } from "fs" -import { join } from "path" +import path, { join } from "path" import { fileURLToPath } from "url" const __dirname = fileURLToPath(new URL(".", import.meta.url)) @@ -55,12 +55,22 @@ const platforms = { function run(command, args, options = {}) { return new Promise((resolve, reject) => { + const env = { ...process.env, NODE_PATH: nodeModulesPath, ...(options.env || {}) } + const pathKey = Object.keys(env).find((key) => key.toLowerCase() === "path") ?? "PATH" + + const binPaths = [ + join(nodeModulesPath, ".bin"), + join(workspaceNodeModulesPath, ".bin"), + ] + + env[pathKey] = `${binPaths.join(path.delimiter)}${path.delimiter}${env[pathKey] ?? ""}` + const spawnOptions = { cwd: appDir, stdio: "inherit", shell: process.platform === "win32", ...options, - env: { ...process.env, NODE_PATH: nodeModulesPath, ...(options.env || {}) }, + env, } const child = spawn(command, args, spawnOptions) diff --git a/packages/server/scripts/copy-opencode-config.mjs b/packages/server/scripts/copy-opencode-config.mjs index 295d3b45..ec725ae2 100644 --- a/packages/server/scripts/copy-opencode-config.mjs +++ b/packages/server/scripts/copy-opencode-config.mjs @@ -10,7 +10,8 @@ const cliRoot = path.resolve(__dirname, "..") const sourceDir = path.resolve(cliRoot, "../opencode-config") const targetDir = path.resolve(cliRoot, "dist/opencode-config") const nodeModulesDir = path.resolve(sourceDir, "node_modules") -const npmCandidates = process.platform === "win32" ? ["npm.cmd", "npm"] : ["npm"] +const npmExecPath = process.env.npm_execpath +const npmNodeExecPath = process.env.npm_node_execpath if (!existsSync(sourceDir)) { console.error(`[copy-opencode-config] Missing source directory at ${sourceDir}`) @@ -30,30 +31,19 @@ if (!existsSync(nodeModulesDir)) { "--workspaces=false", ] - let lastResult - for (const npmCmd of npmCandidates) { - const result = spawnSync(npmCmd, npmArgs, { - cwd: sourceDir, - stdio: "inherit", - env: { ...process.env, npm_config_workspaces: "false" }, - }) + const env = { ...process.env, npm_config_workspaces: "false" } - lastResult = result + const npmCli = npmExecPath && npmNodeExecPath ? [npmNodeExecPath, [npmExecPath, ...npmArgs]] : null + const result = npmCli + ? spawnSync(npmCli[0], npmCli[1], { cwd: sourceDir, stdio: "inherit", env }) + : spawnSync("npm", npmArgs, { cwd: sourceDir, stdio: "inherit", env, shell: process.platform === "win32" }) - if (result.error?.code === "ENOENT") { - console.warn(`[copy-opencode-config] ${npmCmd} not found on PATH, trying next candidate`) - continue - } - - break - } - - if (!lastResult || lastResult.status !== 0) { - if (lastResult?.error) { - console.error("[copy-opencode-config] npm install failed to start", lastResult.error) + if (result.status !== 0) { + if (result.error) { + console.error("[copy-opencode-config] npm install failed to start", result.error) } console.error("[copy-opencode-config] Failed to install opencode-config dependencies") - process.exit(lastResult?.status ?? 1) + process.exit(result.status ?? 1) } } From 1fcf89b945d9917947e3362b3681c420e9774e08 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 20:58:01 +0000 Subject: [PATCH 06/15] Isolate opencode-config install from workspace --- packages/server/scripts/copy-opencode-config.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/scripts/copy-opencode-config.mjs b/packages/server/scripts/copy-opencode-config.mjs index ec725ae2..b04d276c 100644 --- a/packages/server/scripts/copy-opencode-config.mjs +++ b/packages/server/scripts/copy-opencode-config.mjs @@ -23,6 +23,8 @@ if (!existsSync(nodeModulesDir)) { const npmArgs = [ "install", + "--prefix", + sourceDir, "--omit=dev", "--ignore-scripts", "--fund=false", From f7c9db44ad7ba1a54a399a5aac293885f1a82b38 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 22:43:46 +0000 Subject: [PATCH 07/15] Fix Windows builds by tracking opencode-config package.json --- packages/opencode-config/package.json | 6 ++++++ packages/tauri-app/package.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 packages/opencode-config/package.json diff --git a/packages/opencode-config/package.json b/packages/opencode-config/package.json new file mode 100644 index 00000000..652f9071 --- /dev/null +++ b/packages/opencode-config/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@opencode-ai/plugin": "1.1.1" + }, + "version": "0.5.0" +} diff --git a/packages/tauri-app/package.json b/packages/tauri-app/package.json index 49609ce0..bae19cae 100644 --- a/packages/tauri-app/package.json +++ b/packages/tauri-app/package.json @@ -3,13 +3,13 @@ "version": "0.5.0", "private": true, "scripts": { - "dev": "npx --yes @tauri-apps/cli@^2.9.4 dev", + "dev": "tauri dev", "dev:ui": "npm run dev --workspace @codenomad/ui", "dev:prep": "node ./scripts/dev-prep.js", "dev:bootstrap": "npm run dev:prep && npm run dev:ui", "prebuild": "node ./scripts/prebuild.js", "bundle:server": "npm run prebuild", - "build": "npx --yes @tauri-apps/cli@^2.9.4 build" + "build": "tauri build" }, "devDependencies": { "@tauri-apps/cli": "^2.9.4" From 0eee325777d33f686ee7009318e438dd927f8ab8 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 22:57:38 +0000 Subject: [PATCH 08/15] Stabilize Windows opencode-config install and pin tauri bindings --- .github/workflows/build-and-upload.yml | 8 ++++---- packages/opencode-config/package.json | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index ef76b929..675b9cee 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -185,7 +185,7 @@ jobs: run: npm install @rollup/rollup-darwin-x64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-darwin-x64 --no-save + run: npm install @tauri-apps/cli-darwin-x64@2.9.4 --no-save - name: Build macOS bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -243,7 +243,7 @@ jobs: run: npm install @rollup/rollup-darwin-arm64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-darwin-arm64 --no-save + run: npm install @tauri-apps/cli-darwin-arm64@2.9.4 --no-save - name: Build macOS bundle (Tauri, arm64) run: npm run build --workspace @codenomad/tauri-app @@ -302,7 +302,7 @@ jobs: run: npm install @rollup/rollup-win32-x64-msvc --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-win32-x64-msvc --no-save + run: npm install @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save - name: Build Windows bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -375,7 +375,7 @@ jobs: run: npm install @rollup/rollup-linux-x64-gnu --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-linux-x64-gnu --no-save + run: npm install @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save - name: Build Linux bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app diff --git a/packages/opencode-config/package.json b/packages/opencode-config/package.json index 652f9071..9e990320 100644 --- a/packages/opencode-config/package.json +++ b/packages/opencode-config/package.json @@ -1,6 +1,8 @@ { + "name": "@codenomad/opencode-config", + "version": "0.5.0", + "private": true, "dependencies": { "@opencode-ai/plugin": "1.1.1" - }, - "version": "0.5.0" + } } From ce2273fe574a56366d3933060281570490076932 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 23:03:54 +0000 Subject: [PATCH 09/15] Sync package-lock for opencode-config workspace --- package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4ea34889..2dd5874f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -276,6 +276,10 @@ "node": ">=6.9.0" } }, + "node_modules/@codenomad/opencode-config": { + "resolved": "packages/opencode-config", + "link": true + }, "node_modules/@codenomad/tauri-app": { "resolved": "packages/tauri-app", "link": true @@ -5268,10 +5272,6 @@ "regex-recursion": "^6.0.2" } }, - "node_modules/opencode-config": { - "resolved": "packages/opencode-config", - "link": true - }, "node_modules/p-cancelable": { "version": "2.1.1", "dev": true, @@ -7434,6 +7434,7 @@ "license": "MIT" }, "packages/opencode-config": { + "name": "@codenomad/opencode-config", "version": "0.5.0", "dependencies": { "@opencode-ai/plugin": "1.1.1" From 62fd88cd3f3de466c8c580fc794c92764e8ca67f Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 23:10:45 +0000 Subject: [PATCH 10/15] Install @tauri-apps/cli alongside platform bindings --- .github/workflows/build-and-upload.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 675b9cee..7a780e2a 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -185,7 +185,7 @@ jobs: run: npm install @rollup/rollup-darwin-x64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-darwin-x64@2.9.4 --no-save + run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save - name: Build macOS bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -243,7 +243,7 @@ jobs: run: npm install @rollup/rollup-darwin-arm64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-darwin-arm64@2.9.4 --no-save + run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save - name: Build macOS bundle (Tauri, arm64) run: npm run build --workspace @codenomad/tauri-app @@ -302,7 +302,7 @@ jobs: run: npm install @rollup/rollup-win32-x64-msvc --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save + run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save - name: Build Windows bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -375,7 +375,7 @@ jobs: run: npm install @rollup/rollup-linux-x64-gnu --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save + run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save - name: Build Linux bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app From 3b9a44779aa7a61c8c6bd858d2bceb3f7ba47f3c Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 6 Jan 2026 23:20:45 +0000 Subject: [PATCH 11/15] Exclude opencode-config from npm workspaces --- package-lock.json | 29 +++++------------------------ package.json | 5 ++++- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2dd5874f..b7f66ca1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,10 @@ }, "workspaces": { "packages": [ - "packages/*" + "packages/server", + "packages/ui", + "packages/electron-app", + "packages/tauri-app" ] } }, @@ -276,10 +279,6 @@ "node": ">=6.9.0" } }, - "node_modules/@codenomad/opencode-config": { - "resolved": "packages/opencode-config", - "link": true - }, "node_modules/@codenomad/tauri-app": { "resolved": "packages/tauri-app", "link": true @@ -1096,25 +1095,6 @@ "node": ">= 8" } }, - "node_modules/@opencode-ai/plugin": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.1.1.tgz", - "integrity": "sha512-OZGvpDal8YsSo6dnatHfwviSToGZ6mJJyEKZGxUyWDuGCP7VhcoPkoM16ktl7TCVHkDK+TdwY9tKzkzFqQNc5w==", - "license": "MIT", - "dependencies": { - "@opencode-ai/sdk": "1.1.1", - "zod": "4.1.8" - } - }, - "node_modules/@opencode-ai/plugin/node_modules/zod": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz", - "integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@opencode-ai/sdk": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.1.1.tgz", @@ -7436,6 +7416,7 @@ "packages/opencode-config": { "name": "@codenomad/opencode-config", "version": "0.5.0", + "extraneous": true, "dependencies": { "@opencode-ai/plugin": "1.1.1" } diff --git a/package.json b/package.json index 95179b72..d7674151 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,10 @@ "description": "CodeNomad monorepo workspace", "workspaces": { "packages": [ - "packages/*" + "packages/server", + "packages/ui", + "packages/electron-app", + "packages/tauri-app" ] }, "scripts": { From b1691add1cbce0d16d6c54cb859bdf5f6f5d0d16 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 7 Jan 2026 06:10:30 +0000 Subject: [PATCH 12/15] Stabilize Tauri CLI install in CI --- .github/workflows/build-and-upload.yml | 67 +++++++++++++++++++++----- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 7a780e2a..bd0c327b 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -57,7 +57,7 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-x64 --no-save @@ -98,7 +98,7 @@ jobs: shell: bash - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-win32-x64-msvc --no-save @@ -136,7 +136,7 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-x64-gnu --no-save @@ -179,13 +179,23 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-x64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save + run: | + set -euo pipefail + for attempt in 1 2 3; do + if [ "$attempt" -gt 1 ]; then + echo "Retrying Tauri CLI install (attempt $attempt)..." + fi + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save --no-audit --no-fund + node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 + done + echo "Tauri CLI failed to load after retries" >&2 + exit 1 - name: Build macOS bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -237,13 +247,23 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-arm64 --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save + run: | + set -euo pipefail + for attempt in 1 2 3; do + if [ "$attempt" -gt 1 ]; then + echo "Retrying Tauri CLI install (attempt $attempt)..." + fi + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save --no-audit --no-fund + node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 + done + echo "Tauri CLI failed to load after retries" >&2 + exit 1 - name: Build macOS bundle (Tauri, arm64) run: npm run build --workspace @codenomad/tauri-app @@ -296,13 +316,24 @@ jobs: shell: bash - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-win32-x64-msvc --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save + shell: bash + run: | + set -euo pipefail + for attempt in 1 2 3; do + if [ "$attempt" -gt 1 ]; then + echo "Retrying Tauri CLI install (attempt $attempt)..." + fi + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save --no-audit --no-fund + node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 + done + echo "Tauri CLI failed to load after retries" >&2 + exit 1 - name: Build Windows bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -369,13 +400,23 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-x64-gnu --no-save - name: Ensure tauri native binary - run: npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save + run: | + set -euo pipefail + for attempt in 1 2 3; do + if [ "$attempt" -gt 1 ]; then + echo "Retrying Tauri CLI install (attempt $attempt)..." + fi + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save --no-audit --no-fund + node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 + done + echo "Tauri CLI failed to load after retries" >&2 + exit 1 - name: Build Linux bundle (Tauri) run: npm run build --workspace @codenomad/tauri-app @@ -471,7 +512,7 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-arm64-gnu --no-save @@ -543,7 +584,7 @@ jobs: run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version - name: Install project dependencies - run: npm ci --workspaces + run: npm ci --workspaces --include=optional - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-x64-gnu --no-save From 847faf1214f423e24c4c867bcb1b022db312e255 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 7 Jan 2026 06:25:19 +0000 Subject: [PATCH 13/15] Fix Tauri builds and Windows opencode-config loop --- .github/workflows/build-and-upload.yml | 37 +++++++++++++++---- .../server/scripts/copy-opencode-config.mjs | 5 +++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index bd0c327b..6642a151 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -184,21 +184,26 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-x64 --no-save + - name: Prebuild (Tauri) + run: npm run prebuild --workspace @codenomad/tauri-app + - name: Ensure tauri native binary + working-directory: packages/tauri-app run: | set -euo pipefail for attempt in 1 2 3; do if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save --no-audit --no-fund + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-universal@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 exit 1 - name: Build macOS bundle (Tauri) - run: npm run build --workspace @codenomad/tauri-app + working-directory: packages/tauri-app + run: npm exec -- tauri build - name: Package Tauri artifacts (macOS) if: ${{ inputs.upload }} @@ -252,21 +257,26 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-darwin-arm64 --no-save + - name: Prebuild (Tauri) + run: npm run prebuild --workspace @codenomad/tauri-app + - name: Ensure tauri native binary + working-directory: packages/tauri-app run: | set -euo pipefail for attempt in 1 2 3; do if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save --no-audit --no-fund + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-universal@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 exit 1 - name: Build macOS bundle (Tauri, arm64) - run: npm run build --workspace @codenomad/tauri-app + working-directory: packages/tauri-app + run: npm exec -- tauri build - name: Package Tauri artifacts (macOS arm64) if: ${{ inputs.upload }} @@ -321,22 +331,28 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-win32-x64-msvc --no-save + - name: Prebuild (Tauri) + run: npm run prebuild --workspace @codenomad/tauri-app + - name: Ensure tauri native binary shell: bash + working-directory: packages/tauri-app run: | set -euo pipefail for attempt in 1 2 3; do if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save --no-audit --no-fund + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-win32-x64-msvc@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 exit 1 - name: Build Windows bundle (Tauri) - run: npm run build --workspace @codenomad/tauri-app + shell: bash + working-directory: packages/tauri-app + run: npm exec -- tauri build - name: Package Tauri artifacts (Windows) if: ${{ inputs.upload }} @@ -405,21 +421,26 @@ jobs: - name: Ensure rollup native binary run: npm install @rollup/rollup-linux-x64-gnu --no-save + - name: Prebuild (Tauri) + run: npm run prebuild --workspace @codenomad/tauri-app + - name: Ensure tauri native binary + working-directory: packages/tauri-app run: | set -euo pipefail for attempt in 1 2 3; do if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save --no-audit --no-fund + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-linux-x64-gnu@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 exit 1 - name: Build Linux bundle (Tauri) - run: npm run build --workspace @codenomad/tauri-app + working-directory: packages/tauri-app + run: npm exec -- tauri build - name: Package Tauri artifacts (Linux) if: ${{ inputs.upload }} diff --git a/packages/server/scripts/copy-opencode-config.mjs b/packages/server/scripts/copy-opencode-config.mjs index b04d276c..5e714395 100644 --- a/packages/server/scripts/copy-opencode-config.mjs +++ b/packages/server/scripts/copy-opencode-config.mjs @@ -10,6 +10,7 @@ const cliRoot = path.resolve(__dirname, "..") const sourceDir = path.resolve(cliRoot, "../opencode-config") const targetDir = path.resolve(cliRoot, "dist/opencode-config") const nodeModulesDir = path.resolve(sourceDir, "node_modules") +const selfLinkDir = path.resolve(nodeModulesDir, "@codenomad", "opencode-config") const npmExecPath = process.env.npm_execpath const npmNodeExecPath = process.env.npm_node_execpath @@ -49,6 +50,10 @@ if (!existsSync(nodeModulesDir)) { } } +// npm can create a self-referential link for scoped packages on Windows. +// That link causes recursive copies (ELOOP) during bundling. +rmSync(selfLinkDir, { recursive: true, force: true }) + rmSync(targetDir, { recursive: true, force: true }) mkdirSync(path.dirname(targetDir), { recursive: true }) cpSync(sourceDir, targetDir, { recursive: true }) From f7ded37ea3973762d76801b11614c17126dc16e2 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 7 Jan 2026 06:35:59 +0000 Subject: [PATCH 14/15] Fix macOS tauri cli package name --- .github/workflows/build-and-upload.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 6642a151..47870b3b 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -195,7 +195,7 @@ jobs: if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-universal@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save --no-audit --no-fund --workspaces=false + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-x64@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 @@ -268,7 +268,7 @@ jobs: if [ "$attempt" -gt 1 ]; then echo "Retrying Tauri CLI install (attempt $attempt)..." fi - npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-universal@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save --no-audit --no-fund --workspaces=false + npm install @tauri-apps/cli@2.9.4 @tauri-apps/cli-darwin-arm64@2.9.4 --no-save --no-audit --no-fund --workspaces=false node -e "require('@tauri-apps/cli'); console.log('Tauri CLI loaded')" && exit 0 done echo "Tauri CLI failed to load after retries" >&2 From c825ff066ef59d4b4d4bfb1772286028930db800 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 7 Jan 2026 08:56:19 +0000 Subject: [PATCH 15/15] bump version to 0.5.1 --- package-lock.json | 12 ++++++------ package.json | 2 +- packages/electron-app/package.json | 2 +- packages/server/package-lock.json | 4 ++-- packages/server/package.json | 2 +- packages/tauri-app/package.json | 2 +- packages/ui/package.json | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7f66ca1..a82b5c47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codenomad-workspace", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codenomad-workspace", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "7zip-bin": "^5.2.0", "google-auth-library": "^10.5.0" @@ -7389,7 +7389,7 @@ }, "packages/electron-app": { "name": "@neuralnomads/codenomad-electron-app", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@codenomad/ui": "file:../ui", "@neuralnomads/codenomad": "file:../server" @@ -7423,7 +7423,7 @@ }, "packages/server": { "name": "@neuralnomads/codenomad", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@fastify/cors": "^8.5.0", "@fastify/reply-from": "^9.8.0", @@ -7458,14 +7458,14 @@ }, "packages/tauri-app": { "name": "@codenomad/tauri-app", - "version": "0.5.0", + "version": "0.5.1", "devDependencies": { "@tauri-apps/cli": "^2.9.4" } }, "packages/ui": { "name": "@codenomad/ui", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@git-diff-view/solid": "^0.0.8", "@kobalte/core": "0.13.11", diff --git a/package.json b/package.json index d7674151..dfe6d649 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codenomad-workspace", - "version": "0.5.0", + "version": "0.5.1", "private": true, "description": "CodeNomad monorepo workspace", "workspaces": { diff --git a/packages/electron-app/package.json b/packages/electron-app/package.json index d477d9ac..0aacc0a4 100644 --- a/packages/electron-app/package.json +++ b/packages/electron-app/package.json @@ -1,6 +1,6 @@ { "name": "@neuralnomads/codenomad-electron-app", - "version": "0.5.0", + "version": "0.5.1", "description": "CodeNomad - AI coding assistant", "author": { "name": "Neural Nomads", diff --git a/packages/server/package-lock.json b/packages/server/package-lock.json index 991f2cd7..031eefab 100644 --- a/packages/server/package-lock.json +++ b/packages/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "@neuralnomads/codenomad", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@neuralnomads/codenomad", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@fastify/cors": "^8.5.0", "commander": "^12.1.0", diff --git a/packages/server/package.json b/packages/server/package.json index 39c6d089..a2e44461 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@neuralnomads/codenomad", - "version": "0.5.0", + "version": "0.5.1", "description": "CodeNomad Server", "author": { "name": "Neural Nomads", diff --git a/packages/tauri-app/package.json b/packages/tauri-app/package.json index bae19cae..ff917284 100644 --- a/packages/tauri-app/package.json +++ b/packages/tauri-app/package.json @@ -1,6 +1,6 @@ { "name": "@codenomad/tauri-app", - "version": "0.5.0", + "version": "0.5.1", "private": true, "scripts": { "dev": "tauri dev", diff --git a/packages/ui/package.json b/packages/ui/package.json index 877be66c..4c081afb 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@codenomad/ui", - "version": "0.5.0", + "version": "0.5.1", "private": true, "type": "module", "scripts": {