Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Split Stable and Beta desktop identities (#4879)
Andrew Mikofalvy15cd5fd9c264
diff --git a/.changeset/stable-beta-desktop-products.md b/.changeset/stable-beta-desktop-products.mdnew file mode 100644index 000000000..bad6e5a76--- /dev/null+++ b/.changeset/stable-beta-desktop-products.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge-desktop": patch+---++Install Stable and Beta as isolated desktop products. Legacy Beta users must reinstall Beta from `/download/beta`. Their old app cannot update; reinstall Stable from `/download` to keep its settings, recents, and `ok` commands on a working Stable updater.diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjsindex bc2ecf226..0b61cd5b7 100644--- a/.github/scripts/release-cascade-shape.test.mjs+++ b/.github/scripts/release-cascade-shape.test.mjs@@ -1,9 +1,11 @@+// biome-ignore-all lint/suspicious/noTemplateCurlyInString: shell and GitHub expression fixtures must remain literal.import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { createRequire } from 'node:module';import { tmpdir } from 'node:os';import { dirname, join } from 'node:path';import { fileURLToPath } from 'node:url';import { afterAll, describe, expect, test } from 'vitest';+import { DESKTOP_VARIANTS } from '../../packages/desktop/src/shared/desktop-variant.ts';import { buildSlackPayload } from './build-smoke-alert-payload.mjs';import { selectPromotion } from './select-beta-to-promote.mjs';import { smokePackagedDmg, VERDICT } from './smoke-packaged-dmg.mjs';@@ -158,9 +160,7 @@ describe('the optional Windows signing lane proves what it reports', () => {expect(desktopBuildWinLinux.slice(attestation)).toContain("Add-Content -LiteralPath $env:GITHUB_OUTPUT -Value 'signing_ran=true'",);- expect(desktopBuildWinLinux).toContain(- 'steps.attest-windows-signing.outputs.signing_ran',- );+ expect(desktopBuildWinLinux).toContain('steps.attest-windows-signing.outputs.signing_ran');});test('attests and package-checks both Windows outer architectures', () => {@@ -270,18 +270,18 @@ describe('the publishing Windows lane attests its signed native payload', () =>describe('the fan-in publication DAG gates every platform', () => {test('publish-assets waits on all four build jobs', () => {- expect(desktopRelease).toContain(- 'needs: [prepare, build-macos, build-windows, build-linux]',- );+ expect(desktopRelease).toContain('needs: [prepare, build-macos, build-windows, build-linux]');});test('finalize waits on publish-assets (and the smoke via build-macos)', () => {expect(desktopRelease).toContain('needs: [prepare, build-macos, publish-assets]');});- test('no electron-builder invocation publishes; only the fan-in touches the Release', () => {+ test('no variant builder invocation publishes; only the fan-in touches the Release', () => {expect(desktopRelease).not.toContain('--publish always');- const invocations = [...desktopRelease.matchAll(/electron-builder --\w+/g)];+ const invocations = [+ ...desktopRelease.matchAll(/run-electron-builder\.mjs --(?:mac|win|linux)/g),+ ];expect(invocations.length).toBeGreaterThanOrEqual(3);expect(desktopRelease).toContain('gh release upload "$RELEASE_TAG"');});@@ -558,10 +558,7 @@ describe('the bug lane verifies the synthetic tree at the same bar as main', ()test('a red tier gets one retry before the tick is refused', () => {const runs = [...verify.matchAll(/turbo run typecheck test/g)];- expect(- runs.length,- 'verify must invoke the tiers twice: once, then one flake retry',- ).toBe(2);+ expect(runs.length, 'verify must invoke the tiers twice: once, then one flake retry').toBe(2);expect(verify).toContain('case "$FIRST_STATUS" in');const ordinaryArm = verify.indexOf('*)', verify.indexOf('case "$FIRST_STATUS" in'));expect(ordinaryArm, 'the ordinary-failure arm must exist').toBeGreaterThan(-1);@@ -592,7 +589,9 @@ describe('the bug lane verifies the synthetic tree at the same bar as main', ()const wrappers = [...verify.matchAll(/timeout --foreground --kill-after=\d+s/g)];expect(wrappers.length, 'both attempts must carry their own budget').toBe(2);- const gateAt = verify.indexOf('"${TIER_VERDICT:-fail}" == "could-not-verify" ]]; then\n echo');+ const gateAt = verify.indexOf(+ '"${TIER_VERDICT:-fail}" == "could-not-verify" ]]; then\n echo',+ );expect(gateAt, 'the warning must branch on the computed budget flag').toBeGreaterThan(-1);const couldNotVerifyAt = verify.indexOf('COULD NOT VERIFY', gateAt);const notFlakeAt = verify.indexOf('not flake-class', gateAt);@@ -643,7 +642,10 @@ describe('the bug lane verifies the synthetic tree at the same bar as main', ()const refusalPage = bugLaneVerifyStep('Page on a refusal (armed only)');expect(refusalPage).toContain('echo "delivered=${delivered}" >> "$GITHUB_OUTPUT"');expect(refusalPage).toContain('delivered=true');- for (const step of ['Record that this refusal was paged', 'Remember the refusal across ticks']) {+ for (const step of [+ 'Record that this refusal was paged',+ 'Remember the refusal across ticks',+ ]) {expect(bugLaneVerifyStep(step), `${step} must gate on delivery`).toContain("if: steps.page.outputs.delivered == 'true'",);@@ -756,10 +758,7 @@ describe('every release-pipeline post prefers the releases webhook', () => {const stepAfter = (source, name, next) => {const start = source.indexOf(`- name: ${name}`);if (start === -1) throw new Error(`no step named ${name}`);- return source.slice(- start,- next === undefined ? undefined : source.indexOf(`- name: ${next}`),- );+ return source.slice(start, next === undefined ? undefined : source.indexOf(`- name: ${next}`));};for (const { label, step } of [@@ -792,7 +791,9 @@ describe('every release-pipeline post prefers the releases webhook', () => {test('the aggregate smoke alarm resolves the releases webhook first', () => {const alarm = stepAfter(selectBeta, 'Page the release channel');- expect(alarm).toContain('SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}');+ expect(alarm).toContain(+ 'SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}',+ );expect(alarm).toContain('post "${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}" Slack');expect(alarm).not.toContain('post "${SLACK_WEBHOOK_URL:-}" Slack');});@@ -864,6 +865,41 @@ describe('macOS signing stays on the workflow-staged keychain', () => {});});+describe('public desktop product variants stay independently buildable', () => {+ const desktopBuild = read('desktop-build.yml');++ test('manual public packaging workflows expose Stable and Beta only', () => {+ for (const workflow of [desktopBuild, desktopBuildWinLinux]) {+ expect(workflow).toContain('options: [stable, beta]');+ expect(workflow).toContain('OK_DESKTOP_VARIANT:');+ expect(workflow).toContain('run-electron-builder.mjs');+ }+ });++ test('the release workflow maps public product tags to disjoint updater channels', () => {+ for (const pair of [+ ['*-beta.*', 'artifact_name=OpenKnowledge-Beta'],+ ['channel=latest', 'artifact_name=OpenKnowledge'],+ ]) {+ expect(desktopRelease).toContain(pair[0]);+ expect(desktopRelease).toContain(pair[1]);+ }+ expect(desktopRelease).toContain('ARTIFACT_NAME: ${{ needs.prepare.outputs.artifact_name }}');+ expect(desktopRelease).toContain('${ARTIFACT_NAME}-${VERSION}-arm64-mac.zip');+ });++ test('signed Beta builds require their own provisioning profile', () => {+ for (const workflow of [desktopBuild, desktopRelease]) {+ expect(workflow).toContain('embedded.${OK_DESKTOP_VARIANT}.provisionprofile');+ expect(workflow).toContain('security cms -D -i "$PROFILE_PATH"');+ }+ });++ test('the fast-tier smoke downloads the Beta product artifact', () => {+ expect(selectBeta).toContain(`--pattern '${DESKTOP_VARIANTS.beta.artifactName}-*.dmg'`);+ });+});+describe('the macOS artifact is attested signed before it can ship', () => {const desktopBuild = read('desktop-build.yml');const ATTEST = 'Attest the signed macOS app';diff --git a/.github/scripts/retry-transient.test.mjs b/.github/scripts/retry-transient.test.mjsindex 044f8f0cb..babbd6a8b 100644--- a/.github/scripts/retry-transient.test.mjs+++ b/.github/scripts/retry-transient.test.mjs@@ -1615,7 +1615,9 @@ describe('workflow wiring', () => {expect(packageStep).toContain(`--attempt-timeout "${timeout}"`);expect(packageStep).toContain('--deadline-epoch-ms "$PACKAGING_DEADLINE_EPOCH_MS"');const command = packageStep.split('\n').find((line) => /^\s*PKG_CMD:/.test(line));- expect(command).toContain("PKG_CMD: 'rm -rf dist-desktop && pnpm exec electron-builder");+ expect(command).toContain(+ "PKG_CMD: 'rm -rf dist-desktop && node scripts/run-electron-builder.mjs",+ );expect(command).toContain('--publish never');},);diff --git a/.github/workflows/desktop-build-win-linux.yml b/.github/workflows/desktop-build-win-linux.ymlindex 5d17983f9..91638ed1b 100644--- a/.github/workflows/desktop-build-win-linux.yml+++ b/.github/workflows/desktop-build-win-linux.yml@@ -43,6 +43,11 @@ on:type: choicedefault: bothoptions: [both, windows, linux]+ variant:+ description: "Desktop product identity"+ type: choice+ default: stable+ options: [stable, beta]permissions:contents: read@@ -59,6 +64,8 @@ defaults:env:TURBO_TELEMETRY_DISABLED: 1+ OK_DESKTOP_VARIANT: ${{ inputs.variant }}+ OK_DESKTOP_PRODUCT_NAME: ${{ inputs.variant == 'stable' && 'OpenKnowledge' || 'OpenKnowledge Beta' }}jobs:prepare:@@ -251,7 +258,7 @@ jobs:echo "::warning::No (complete) Azure signing config — building UNSIGNED installers (internal QA only; never distribute)."echo "signing_requested=false" >> "$GITHUB_OUTPUT"fi- pnpm exec electron-builder --win --publish never "${extra[@]}"+ node scripts/run-electron-builder.mjs --win --publish never "${extra[@]}"- name: Attest signed Windows packages and preserved Microsoft signaturesid: attest-windows-signing@@ -275,9 +282,9 @@ jobs:throw "Signing-enabled build produced no $($package.Arch) outer package at $($package.Path)."}- $appExecutable = Join-Path $package.Path 'OpenKnowledge.exe'+ $appExecutable = Join-Path $package.Path "$env:OK_DESKTOP_PRODUCT_NAME.exe"if (-not (Test-Path -LiteralPath $appExecutable -PathType Leaf)) {- throw "Signing-enabled $($package.Arch) package has no OpenKnowledge.exe."+ throw "Signing-enabled $($package.Arch) package has no $env:OK_DESKTOP_PRODUCT_NAME.exe."}$signature = Get-AuthenticodeSignature $appExecutableif ($signature.Status -ne 'Valid') {@@ -359,7 +366,7 @@ jobs:- name: Upload Windows x64 installeruses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-Setup-x64+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-Setup-x64path: packages/desktop/dist-desktop/*Setup-x64.exe*retention-days: 14if-no-files-found: error@@ -367,7 +374,7 @@ jobs:- name: Upload Windows arm64 installeruses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-Setup-arm64+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-Setup-arm64path: packages/desktop/dist-desktop/*Setup-arm64.exe*retention-days: 14if-no-files-found: error@@ -378,15 +385,15 @@ jobs:- name: Upload Windows update metadatauses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-windows-update-metadata- path: packages/desktop/dist-desktop/latest.yml+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-windows-update-metadata+ path: packages/desktop/dist-desktop/*.ymlretention-days: 14if-no-files-found: error# Two cells, each on a NATIVE runner for its arch. Cross-compiling the arm64# native deps from an x64 host is impractical (pnpm installs only the- # host-matching `@parcel/watcher-*` prebuild, and the Linux build skips- # @electron/rebuild by design — see electron-builder.linux.yml), so+ # host-matching `@parcel/watcher-*` prebuild, and the generated Linux config+ # skips @electron/rebuild by design), so# the arm64 deb is built on GitHub's arm64 Linux runner where pnpm installs# the arm64 prebuilds directly and `scripts/stage-parcel-watcher.mjs` stages# the right binary.@@ -488,12 +495,10 @@ jobs:# emulation or system fpm is involved.- name: Package ${{ matrix.targets }}working-directory: packages/desktop- # --config: the Linux overlay turns off the native-rebuild pass WITHOUT- # asserting that node_modules are staged externally. See- # electron-builder.linux.yml.+ # The variant wrapper turns off the native-rebuild pass for `--linux`+ # without asserting that node_modules are staged externally.run: |- pnpm exec electron-builder --linux ${{ matrix.targets }} --publish never \- --config electron-builder.linux.yml+ node scripts/run-electron-builder.mjs --linux ${{ matrix.targets }} --publish never- name: Assert Linux terminal native package compatibilityworking-directory: packages/desktop@@ -516,7 +521,7 @@ jobs:if: matrix.arch == 'x64'uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-amd64-deb+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-amd64-debpath: packages/desktop/dist-desktop/*amd64.debretention-days: 14if-no-files-found: error@@ -525,7 +530,7 @@ jobs:if: matrix.arch == 'arm64'uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-arm64-deb+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-arm64-debpath: packages/desktop/dist-desktop/*arm64.debretention-days: 14if-no-files-found: error@@ -538,7 +543,7 @@ jobs:if: matrix.arch == 'x64'uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-x86_64-rpm+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-x86_64-rpmpath: packages/desktop/dist-desktop/*x86_64.rpmretention-days: 14if-no-files-found: error@@ -547,7 +552,7 @@ jobs:if: matrix.arch == 'arm64'uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:- name: OpenKnowledge-aarch64-rpm+ name: OpenKnowledge-${{ env.OK_DESKTOP_VARIANT }}-aarch64-rpmpath: packages/desktop/dist-desktop/*aarch64.rpmretention-days: 14if-no-files-found: errordiff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.ymlindex 000cd0a64..55bec10bc 100644--- a/.github/workflows/desktop-build.yml+++ b/.github/workflows/desktop-build.yml@@ -46,7 +46,13 @@ name: Desktop build# cannot accidentally attempt to notarize an ad-hoc-signed .app.on:- workflow_dispatch: {}+ workflow_dispatch:+ inputs:+ variant:+ description: Desktop product identity+ type: choice+ options: [stable, beta]+ default: stablepermissions:contents: read@@ -62,6 +68,7 @@ concurrency:env:TURBO_TELEMETRY_DISABLED: 1+ OK_DESKTOP_VARIANT: ${{ inputs.variant }}jobs:build-macos-dmg:@@ -316,6 +323,18 @@ jobs:working-directory: packages/desktoprun: node scripts/stage-parcel-watcher.mjs+ - name: Validate variant provisioning profile+ if: steps.signmode.outputs.mode == 'signed' && env.OK_DESKTOP_VARIANT != 'stable'+ working-directory: packages/desktop+ run: |+ set -euo pipefail+ PROFILE_PATH="build/embedded.${OK_DESKTOP_VARIANT}.provisionprofile"+ if [[ ! -f "$PROFILE_PATH" ]]; then+ echo "::error::The committed ${OK_DESKTOP_VARIANT} Developer ID provisioning profile is missing."+ exit 1+ fi+ security cms -D -i "$PROFILE_PATH" >/dev/null+# Step B: package via electron-builder. Kept as a separate runner step# from step A (rather than chained via && in a single shell). The split# was originally forced by a packaging bug in the previous script runner:@@ -350,9 +369,9 @@ jobs:working-directory: packages/desktoprun: |if [[ "${{ steps.signmode.outputs.mode }}" == "unsigned" ]]; then- pnpm exec electron-builder --mac --publish never -c.mac.identity=null+ node scripts/run-electron-builder.mjs --mac --publish never -c.mac.identity=nullelse- pnpm exec electron-builder --mac --publish never+ node scripts/run-electron-builder.mjs --mac --publish neverfi# Twin of desktop-release.yml's "Attest the signed macOS app": with@@ -402,11 +421,11 @@ jobs:# on another Mac) can filter by prefix without inspecting the# DMG signature. Unsigned DMGs can run locally after `xattr -cr`# but must never be shipped as if they were a release build.- name: open-knowledge-macos-${{ steps.signmode.outputs.mode }}-${{ github.sha }}+ name: open-knowledge-${{ env.OK_DESKTOP_VARIANT }}-macos-${{ steps.signmode.outputs.mode }}-${{ github.sha }}path: |packages/desktop/dist-desktop/*.dmgpackages/desktop/dist-desktop/*.dmg.blockmap- packages/desktop/dist-desktop/latest-mac.yml+ packages/desktop/dist-desktop/*-mac.ymlretention-days: 14if-no-files-found: errordiff --git a/.github/workflows/desktop-release-draft-janitor.yml b/.github/workflows/desktop-release-draft-janitor.ymlindex 99e85a0f3..42b1343ab 100644--- a/.github/workflows/desktop-release-draft-janitor.yml+++ b/.github/workflows/desktop-release-draft-janitor.yml@@ -52,9 +52,8 @@ name: Draft release janitor# cold caches and build-macos's one retry. An earlier 5400 was derived from# build-macos's 75-minute timeout alone and did not cover the path.#-# The list is narrowed to drafts plus PUBLISHED STABLES, which is exactly what-# the selector reads (drafts are the candidates, published stables set the-# ceiling). The narrowing is gh's LOCAL --jq transform of the full paginated+# The list is narrowed to drafts plus PUBLISHED STABLES. Stable and beta drafts+# share the stable-cycle ceiling. The narrowing is gh's LOCAL --jq transform of the full paginated# response: the releases endpoint has no filter parameter, so every release# still crosses the wire; what is bounded is the payload handed to the module.# That matters because Published betas are dead weight and this repo hasdiff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.ymlindex 0068d5575..52449f551 100644--- a/.github/workflows/desktop-release.yml+++ b/.github/workflows/desktop-release.yml@@ -155,6 +155,9 @@ jobs:outputs:channel: ${{ steps.channel.outputs.channel }}version: ${{ steps.channel.outputs.version }}+ variant: ${{ steps.channel.outputs.variant }}+ product_name: ${{ steps.channel.outputs.product_name }}+ artifact_name: ${{ steps.channel.outputs.artifact_name }}required: ${{ steps.required.outputs.required }}steps:- name: Link to triggering run@@ -215,6 +218,9 @@ jobs:if [[ "$VERSION" == *-beta.* ]]; then{echo "channel=beta"+ echo "variant=beta"+ echo "product_name=OpenKnowledge Beta"+ echo "artifact_name=OpenKnowledge-Beta"echo "version=$VERSION"} >> "$GITHUB_OUTPUT"echo "::notice::Building BETA channel from tag $RELEASE_TAG"@@ -227,11 +233,14 @@ jobs:echo "::error::Tag $RELEASE_TAG is missing the .N suffix — beta releases must be tagged -beta.N (e.g. -beta.0, -beta.1) so electron-updater's cascade walk can order them. See packages/desktop/README.md beta-channel runbook."exit 1elif [[ "$VERSION" == *-* ]]; then- echo "::error::Unsupported prerelease ID in tag $RELEASE_TAG — only -beta.N is supported. See packages/desktop/README.md beta-channel runbook for the supported lifecycle."+ echo "::error::Unsupported prerelease ID in tag $RELEASE_TAG — desktop releases accept only -beta.N."exit 1else{echo "channel=latest"+ echo "variant=stable"+ echo "product_name=OpenKnowledge"+ echo "artifact_name=OpenKnowledge"echo "version=$VERSION"} >> "$GITHUB_OUTPUT"echo "::notice::Building LATEST channel from tag $RELEASE_TAG"@@ -537,16 +546,20 @@ jobs:if [[ "$VERSION" == *-beta.* ]]; then{echo "channel=beta"+ echo "variant=beta"echo "version=$VERSION"} >> "$GITHUB_OUTPUT"+ echo "OK_DESKTOP_VARIANT=beta" >> "$GITHUB_ENV"elif [[ "$VERSION" == *-* ]]; then- echo "::error::Unsupported prerelease ID in tag $RELEASE_TAG — only -beta.N is supported (prepare's twin step carries the full diagnostics)."+ echo "::error::Unsupported prerelease ID in tag $RELEASE_TAG — this public publisher accepts only -beta.N (prepare's twin step carries the full diagnostics)."exit 1else{echo "channel=latest"+ echo "variant=stable"echo "version=$VERSION"} >> "$GITHUB_OUTPUT"+ echo "OK_DESKTOP_VARIANT=stable" >> "$GITHUB_ENV"fi- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0@@ -796,6 +809,18 @@ jobs:working-directory: packages/desktoprun: pnpm run build:desktop+ - name: Validate variant provisioning profile+ if: steps.channel.outputs.variant != 'stable'+ working-directory: packages/desktop+ run: |+ set -euo pipefail+ PROFILE_PATH="build/embedded.${OK_DESKTOP_VARIANT}.provisionprofile"+ if [[ ! -f "$PROFILE_PATH" ]]; then+ echo "::error::The committed ${OK_DESKTOP_VARIANT} Developer ID provisioning profile is missing."+ exit 1+ fi+ security cms -D -i "$PROFILE_PATH" >/dev/null+- name: Build + sign + notarize DMG/ZIP# electron-builder signs with the identity in CSC_KEYCHAIN (pushed# into $GITHUB_ENV by the "Prepare signing keychain" step). CSC_LINK@@ -805,7 +830,7 @@ jobs:# + staples + fuse-verifies. `--publish never`: the fan-in publish-assets job is# the only publication point — this job stages its outputs as a run# artifact below. electron-builder still writes the channel manifest- # (`latest-mac.yml` or `beta-mac.yml`, per `--config.publish.channel`)+ # (`latest-mac.yml` or `beta-mac.yml`, per the generated config's publish channel)# into dist-desktop locally (proven by desktop-build.yml, whose# --publish never build uploads that same file).#@@ -830,7 +855,7 @@ jobs:BUILD_VERSION: ${{ steps.channel.outputs.version }}BUILD_CHANNEL: ${{ steps.channel.outputs.channel }}GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}- PKG_CMD: 'rm -rf dist-desktop && pnpm exec electron-builder --mac --publish never --config.extraMetadata.version="${BUILD_VERSION}" --config.publish.channel="${BUILD_CHANNEL}"'+ PKG_CMD: 'rm -rf dist-desktop && node scripts/run-electron-builder.mjs --mac --publish never --config.extraMetadata.version="${BUILD_VERSION}"'working-directory: packages/desktoprun: |# extraMetadata.version override: kept as defense-in-depth so the@@ -1012,6 +1037,9 @@ jobs:needs: prepareruns-on: windows-latesttimeout-minutes: 45+ env:+ OK_DESKTOP_VARIANT: ${{ needs.prepare.outputs.variant }}+ OK_DESKTOP_PRODUCT_NAME: ${{ needs.prepare.outputs.product_name }}permissions:# See build-macos — packaging jobs are read-only by design.contents: read@@ -1129,7 +1157,7 @@ jobs:BUILD_VERSION: ${{ needs.prepare.outputs.version }}BUILD_CHANNEL: ${{ needs.prepare.outputs.channel }}GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}- PKG_CMD: 'rm -rf dist-desktop && pnpm exec electron-builder --win --publish never --config.extraMetadata.version="${BUILD_VERSION}" --config.publish.channel="${BUILD_CHANNEL}" --config.win.azureSignOptions.endpoint="${AZURE_SIGNING_ENDPOINT}" --config.win.azureSignOptions.codeSigningAccountName="${AZURE_SIGNING_ACCOUNT}" --config.win.azureSignOptions.certificateProfileName="${AZURE_SIGNING_PROFILE}" --config.win.azureSignOptions.publisherName="${AZURE_SIGNING_PUBLISHER}"'+ PKG_CMD: 'rm -rf dist-desktop && node scripts/run-electron-builder.mjs --win --publish never --config.extraMetadata.version="${BUILD_VERSION}" --config.win.azureSignOptions.endpoint="${AZURE_SIGNING_ENDPOINT}" --config.win.azureSignOptions.codeSigningAccountName="${AZURE_SIGNING_ACCOUNT}" --config.win.azureSignOptions.certificateProfileName="${AZURE_SIGNING_PROFILE}" --config.win.azureSignOptions.publisherName="${AZURE_SIGNING_PUBLISHER}"'run: |set -euo pipefailmissing=()@@ -1211,9 +1239,9 @@ jobs:throw "Signed release produced no $($package.Arch) outer package at $($package.Path)."}- $appExecutable = Join-Path $package.Path 'OpenKnowledge.exe'+ $appExecutable = Join-Path $package.Path "$env:OK_DESKTOP_PRODUCT_NAME.exe"if (-not (Test-Path -LiteralPath $appExecutable -PathType Leaf)) {- throw "Signed $($package.Arch) release package has no OpenKnowledge.exe."+ throw "Signed $($package.Arch) release package has no $env:OK_DESKTOP_PRODUCT_NAME.exe."}$signature = Get-AuthenticodeSignature $appExecutableif ($signature.Status -ne 'Valid') {@@ -1320,14 +1348,16 @@ jobs:# Two cells, each on a NATIVE runner for its arch. Cross-compiling the arm64# native deps from an x64 host is impractical (pnpm installs only the- # host-matching `@parcel/watcher-*` prebuild, and the Linux build skips- # @electron/rebuild by design — see electron-builder.linux.yml), so the+ # host-matching `@parcel/watcher-*` prebuild, and the generated Linux config+ # skips @electron/rebuild by design), so the# arm64 installers are built on GitHub's arm64 Linux runner where pnpm# installs the arm64 prebuilds directly.build-linux:needs: prepareruns-on: ${{ matrix.runner }}timeout-minutes: 45+ env:+ OK_DESKTOP_VARIANT: ${{ needs.prepare.outputs.variant }}permissions:# See build-macos — packaging jobs are read-only by design.contents: read@@ -1383,9 +1413,8 @@ jobs:env:# Rebuild native modules against Electron's Node ABI — mirrors the# mac job. (The packaging pass itself skips @electron/rebuild via- # the Linux overlay config; this install-time rebuild is what- # provides the ABI-correct prebuilds the overlay's rationale- # depends on.)+ # the generated variant config; this install-time rebuild provides+ # the ABI-correct prebuilds that decision depends on.)ELECTRON_SKIP_REBUILD: "0"run: pnpm install --frozen-lockfile@@ -1434,47 +1463,6 @@ jobs:sudo apt-get updatesudo apt-get install -y rpm- # The Linux packaging pass needs THREE config inputs at once: the- # `npmRebuild: false` overlay (electron-builder.linux.yml — a top-level- # option that CANNOT be passed as a CLI flag, because yargs leaves- # `-c.npmRebuild=false` as the string "false" and the packager's strict- # `=== false` ignores it), the channel, and the version override.- # Mixing a `--config <file>` with `--config.dot=flags` on one command- # line is yargs-merge territory nobody should trust a release to, so- # compose them the deterministic way: generate a release overlay that- # `extends` the Linux overlay (which itself extends the base config)- # and carries the channel + version inline. A broken extends chain- # fails LOUD (the node-liblzma -Werror explosion the Linux overlay's- # header documents), never silently.- #- # `publish` is deliberately the OBJECT form, not a one-element list.- # `extends` merges list-valued keys by CONCATENATION (deepAssign unions- # arrays), so a list here would APPEND a second publish entry after the- # base config's `channel: latest` one — and app-update.yml is written- # from the FIRST entry, silently pinning every Linux install to the- # wrong channel (the channel-correct assert below caught exactly this- # on the first live cut). An object hits deepAssign's array-vs-object- # branch and replaces the base list wholesale; the schema accepts both- # shapes.- - name: Generate the release overlay config (channel + version)- working-directory: packages/desktop- env:- CHANNEL: ${{ needs.prepare.outputs.channel }}- VERSION: ${{ needs.prepare.outputs.version }}- run: |- set -euo pipefail- cat > electron-builder.release-linux.yml <<EOF- extends: file:./electron-builder.linux.yml- extraMetadata:- version: ${VERSION}- publish:- provider: github- owner: inkeep- repo: open-knowledge- channel: ${CHANNEL}- EOF- cat electron-builder.release-linux.yml-# Each cell packages only its own arch, on a runner of that arch — so the# `.deb` / `.rpm` ship the matching `@parcel/watcher` / `@napi-rs/keyring`# prebuilds rather than degrading file-watching to chokidar. The deb and@@ -1485,8 +1473,9 @@ jobs:working-directory: packages/desktopenv:LINUX_TARGETS: ${{ matrix.targets }}+ VERSION: ${{ needs.prepare.outputs.version }}GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}- PKG_CMD: 'rm -rf dist-desktop && pnpm exec electron-builder --linux ${LINUX_TARGETS} --publish never --config electron-builder.release-linux.yml'+ PKG_CMD: 'rm -rf dist-desktop && node scripts/run-electron-builder.mjs --linux ${LINUX_TARGETS} --publish never --config.extraMetadata.version="${VERSION}"'run: |set -euo pipefailWRAPPER="${RUNNER_TEMP}/retry-transient.mjs"@@ -1557,7 +1546,7 @@ jobs:# deb + rpm + the per-arch channel manifest. electron-builder names the# Linux manifest by arch: `latest-linux.yml` (x64) /- # `latest-linux-arm64.yml` (arm64), or beta-* on the beta channel —+ # `latest-linux-arm64.yml` (arm64), or the matching beta-* channel files —# which is exactly the name electron-updater's provider computes from# process.arch on the client, and why each cell uploads a distinct# manifest with no collision. The deb and rpm entries share one@@ -1612,6 +1601,7 @@ jobs:RELEASE_TAG: ${{ github.event.client_payload.release_tag || inputs.release_tag }}CHANNEL: ${{ needs.prepare.outputs.channel }}VERSION: ${{ needs.prepare.outputs.version }}+ ARTIFACT_NAME: ${{ needs.prepare.outputs.artifact_name }}REQUIRED: ${{ needs.prepare.outputs.required }}steps:- name: Download all platform release assets@@ -1650,21 +1640,21 @@ jobs:# app-update/package-type asserts.{echo "EXPECTED_ASSETS<<OK_INVENTORY_EOF"- echo "OpenKnowledge-arm64.dmg"- echo "OpenKnowledge-arm64.dmg.blockmap"- echo "OpenKnowledge-${VERSION}-arm64-mac.zip"- echo "OpenKnowledge-${VERSION}-arm64-mac.zip.blockmap"+ echo "${ARTIFACT_NAME}-arm64.dmg"+ echo "${ARTIFACT_NAME}-arm64.dmg.blockmap"+ echo "${ARTIFACT_NAME}-${VERSION}-arm64-mac.zip"+ echo "${ARTIFACT_NAME}-${VERSION}-arm64-mac.zip.blockmap"echo "${CHANNEL}-mac.yml"if [[ "$REQUIRED" == *windows* ]]; then- echo "OpenKnowledge-Setup-x64.exe"- echo "OpenKnowledge-Setup-arm64.exe"+ echo "${ARTIFACT_NAME}-Setup-x64.exe"+ echo "${ARTIFACT_NAME}-Setup-arm64.exe"echo "${CHANNEL}.yml"fiif [[ "$REQUIRED" == *linux* ]]; then- echo "OpenKnowledge-amd64.deb"- echo "OpenKnowledge-arm64.deb"- echo "OpenKnowledge-x86_64.rpm"- echo "OpenKnowledge-aarch64.rpm"+ echo "${ARTIFACT_NAME}-amd64.deb"+ echo "${ARTIFACT_NAME}-arm64.deb"+ echo "${ARTIFACT_NAME}-x86_64.rpm"+ echo "${ARTIFACT_NAME}-aarch64.rpm"echo "${CHANNEL}-linux.yml"echo "${CHANNEL}-linux-arm64.yml"fi@@ -1672,18 +1662,18 @@ jobs:# line — without it the runner rejects the whole env file.echo "OK_INVENTORY_EOF"echo "ALLOWED_ASSETS<<OK_ALLOWED_EOF"- echo "OpenKnowledge-arm64.dmg"- echo "OpenKnowledge-arm64.dmg.blockmap"- echo "OpenKnowledge-${VERSION}-arm64-mac.zip"- echo "OpenKnowledge-${VERSION}-arm64-mac.zip.blockmap"+ echo "${ARTIFACT_NAME}-arm64.dmg"+ echo "${ARTIFACT_NAME}-arm64.dmg.blockmap"+ echo "${ARTIFACT_NAME}-${VERSION}-arm64-mac.zip"+ echo "${ARTIFACT_NAME}-${VERSION}-arm64-mac.zip.blockmap"echo "${CHANNEL}-mac.yml"- echo "OpenKnowledge-Setup-x64.exe"- echo "OpenKnowledge-Setup-arm64.exe"+ echo "${ARTIFACT_NAME}-Setup-x64.exe"+ echo "${ARTIFACT_NAME}-Setup-arm64.exe"echo "${CHANNEL}.yml"- echo "OpenKnowledge-amd64.deb"- echo "OpenKnowledge-arm64.deb"- echo "OpenKnowledge-x86_64.rpm"- echo "OpenKnowledge-aarch64.rpm"+ echo "${ARTIFACT_NAME}-amd64.deb"+ echo "${ARTIFACT_NAME}-arm64.deb"+ echo "${ARTIFACT_NAME}-x86_64.rpm"+ echo "${ARTIFACT_NAME}-aarch64.rpm"echo "${CHANNEL}-linux.yml"echo "${CHANNEL}-linux-arm64.yml"echo "OK_ALLOWED_EOF"diff --git a/.github/workflows/point-release.yml b/.github/workflows/point-release.ymlindex 2dd76e8ea..28fb48dab 100644--- a/.github/workflows/point-release.yml+++ b/.github/workflows/point-release.yml@@ -253,6 +253,7 @@ jobs:echo "- Tag: \`${POINT_RELEASE_TAG}\` at \`${SYNTHETIC_SHA}\`"echo "- Over stable: \`${LATEST_STABLE_TAG}\`"echo "- Mode: \`${MODE}\` of \`${FIX_REFS}\`"+ echo "- Desktop product: \`stable\` (Beta has an independent release lane)"echo "- Changeset delta for main-reset: \`${DELTA_IDS}\` (dispatched: ${MAIN_RESET_DISPATCHED})"if [[ -n "${RESOLVED_PATHS:-}" && "$RESOLVED_PATHS" != "[]" ]]; thenecho "- **Re-derived config paths: \`${RESOLVED_PATHS}\`** — the pick conflicted there and the file"diff --git a/.github/workflows/select-beta-to-promote.yml b/.github/workflows/select-beta-to-promote.ymlindex 195bdd101..46cda8877 100644--- a/.github/workflows/select-beta-to-promote.yml+++ b/.github/workflows/select-beta-to-promote.yml@@ -347,7 +347,7 @@ jobs:run: |set -euo pipefailmkdir -p "${RUNNER_TEMP}/fast-tier-dmg"- gh release download "$CANDIDATE" --pattern '*.dmg' --dir "${RUNNER_TEMP}/fast-tier-dmg"+ gh release download "$CANDIDATE" --pattern 'OpenKnowledge-Beta-*.dmg' --dir "${RUNNER_TEMP}/fast-tier-dmg"- name: Smoke the DMGid: smokediff --git a/docs/content/reference/what-open-knowledge-writes.mdx b/docs/content/reference/what-open-knowledge-writes.mdxindex 62e8f9d8d..c73b5fa12 100644--- a/docs/content/reference/what-open-knowledge-writes.mdx+++ b/docs/content/reference/what-open-knowledge-writes.mdx@@ -31,15 +31,17 @@ OpenKnowledge installs one of two ways, and the footprint differs a little betweHow the app lands depends on your platform:- **macOS** — a signed `.dmg` you drag into `/Applications`. Because a `.dmg` app can't put a CLI on your `PATH` on its own, first launch asks, in one dialog, whether to register the MCP server with your AI editors and whether to add `ok` to your shell's `PATH` (both covered below, both with your consent).-- **Windows** — a per-user installer: the app lands under `%LOCALAPPDATA%\Programs\`, with no admin prompt. The installer itself adds the bundled `ok` CLI to your **user** `PATH` (a registry value under `HKCU\Environment`) and registers the `openknowledge://` URL scheme under `HKCU\Software\Classes` — both removed by its uninstaller. It also registers OpenKnowledge for `.md` and `.mdx` files under `HKCU\Software\Classes`, which can make it the default opener when you have not explicitly chosen one in Windows. Uninstall removes its Open With and file-handler registrations but does not restore a previous file-type default. To choose another opener, use **Settings → Apps → Default apps**. Your shell startup files are never touched.-- **Linux** — a deb or rpm package: the app installs to `/opt/OpenKnowledge/`, and the package's post-install script symlinks `/usr/bin/ok`, `/usr/bin/open-knowledge`, and `/usr/bin/openknowledge` (plus a desktop entry that registers the `openknowledge://` scheme, and an AppArmor profile on Ubuntu 24.04+ so the Chromium sandbox keeps working). Your shell startup files are touched only with your consent, as described below.+- **Windows** — a per-user installer: the app lands under `%LOCALAPPDATA%\Programs\`, with no admin prompt. Stable adds `ok` to your **user** `PATH` and registers `openknowledge://`; Beta adds `ok-beta` and `open-knowledge-beta` and registers `openknowledge-beta://`. These are registry values under `HKCU\Environment` and `HKCU\Software\Classes`, removed by the matching uninstaller. Each product also registers itself for `.md` and `.mdx` files under `HKCU\Software\Classes`, which can make it the default opener when you have not explicitly chosen one in Windows. Uninstall removes that product's Open With and file-handler registrations but does not restore a previous file-type default. To choose another opener, use **Settings → Apps → Default apps**. Your shell startup files are never touched.+- **Linux** — a deb or rpm package: Stable installs to `/opt/OpenKnowledge/` and symlinks `/usr/bin/ok`, `/usr/bin/open-knowledge`, and `/usr/bin/openknowledge`; Beta installs to `/opt/OpenKnowledge Beta/` and symlinks `/usr/bin/ok-beta`, `/usr/bin/open-knowledge-beta`, and `/usr/bin/openknowledge-beta`. Their desktop entries register `openknowledge://` and `openknowledge-beta://` respectively, and each installs its own AppArmor profile on Ubuntu 24.04+ so the Chromium sandbox keeps working. Your shell startup files are touched only with your consent, as described below.-On every platform the app writes app-level state and logs on launch. The table below shows the macOS locations; on Windows the same app-state files live under `%APPDATA%\OpenKnowledge\` and staged updates under `%LOCALAPPDATA%\@inkeepopen-knowledge-desktop-updater\`. On Linux, app state defaults to `~/.config/OpenKnowledge/` and staged updates to `~/.cache/@inkeepopen-knowledge-desktop-updater/` (or the corresponding XDG config and cache directories). The `~/.ok/` paths are the same everywhere.+On every platform the app writes app-level state and logs on launch. The table below shows the macOS locations; Beta substitutes `OpenKnowledge Beta` for the app-data directory and uses its own updater cache. On Windows, Stable app state lives under `%APPDATA%\OpenKnowledge\` and Beta under `%APPDATA%\OpenKnowledge Beta\`. On Linux, the corresponding defaults are `~/.config/OpenKnowledge/` and `~/.config/OpenKnowledge Beta/` (or the matching XDG directories). Stable owns the traditional `~/.ok/bin` paths; Beta owns `~/.ok/variants/beta`.| Path | What it is | Scope || --- | --- | --- || `~/Library/Application Support/OpenKnowledge/state.json` | Recent projects, window/view state, update channel | Outside-project (home dir) || `~/Library/Application Support/OpenKnowledge/path-install.json` | Records the `PATH`/shell changes it made and your `PATH`-consent choice, so they can be reverted | Outside-project (home dir) |+| `~/Library/Application Support/OpenKnowledge Beta/state.json` | Beta's separate recent projects, window/view state, and update channel | Outside-project (home dir) |+| `~/.ok/variants/beta/path-install.json` | Records Beta's separate `PATH`/shell changes and consent choice | Outside-project (home dir) || `~/.ok/logs/desktop.<date>.log` | Desktop app + renderer log | Outside-project (home dir) || `~/.ok/mcp-status.json` | Records your first-launch MCP-setup consent choice | Outside-project (home dir) || `~/Library/Caches/@inkeepopen-knowledge-desktop-updater/` | Staged auto-update downloads (electron-updater) | Outside-project (home dir) |@@ -50,7 +52,7 @@ On every platform the app writes app-level state and logs on launch. The table b| `~/Library/Application Support/OpenKnowledge/bug-report-crash-acks.json` | Records which crash-report invitations you already answered or dismissed, so the same crash never re-prompts. Answering is what retires a crash: an invitation you simply never saw — because it went unanswered for a day, or the window it was waiting on never appeared — is dropped rather than answered, so that crash can be offered again the next time you open the app | Outside-project (home dir) || `~/Library/Application Support/OpenKnowledge/bug-report-main-thread-liveness.json` | Main-thread liveness witness. A background worker rewrites it every five seconds while the app runs. The next launch can identify a main-thread block that had lasted at least 15 seconds at the last successful sample. A sample below that threshold does not rule out a shorter or recovered block, or a block after the worker stopped writing. Read only at the next launch; left in place on a clean quit and overwritten on the next run, through a `.tmp-` sibling during each write. The verdict lands in the desktop log a bug report carries; it does not change whether the app prompts you | Outside-project (home dir) |-The app registers the `openknowledge://` URL scheme (for deep links) and checks for updates — on launch and periodically while it runs — against the OpenKnowledge update service at `openknowledge.ai/updates`, which redirects to the GitHub release asset and counts the update per version and channel (falling back to GitHub directly if it's unreachable). On macOS and Windows an update on your channel downloads in the background and installs on the next quit; on Linux — where there is no apt/rpm repository — the app downloads the new deb/rpm from the release feed and asks you to authorize the install (a `pkexec` password prompt) each time. You can also check on demand from **Check for updates…** in the app and Help menus. The channel (stable or beta) is fixed by the build you installed. Reinstall a stable build for any supported platform from `openknowledge.ai/download`. The `/download/beta` shortcut serves the latest Apple Silicon macOS beta; Windows and Linux beta installers are available from [GitHub Releases](https://github.com/inkeep/open-knowledge/releases). Override the feed with `OK_UPDATER_FEED_URL`.+Stable registers `openknowledge://`; Beta registers `openknowledge-beta://`. Both check for updates — on launch and periodically while running — against separate Stable/Beta paths on the OpenKnowledge update service at `openknowledge.ai/updates`, which redirects to the matching GitHub release asset and counts the update per version and channel (Stable alone can fall back to GitHub directly if the proxy is unreachable). On macOS and Windows an update on your channel downloads in the background and installs on the next quit; on Linux — where there is no apt/rpm repository — the app downloads the new deb/rpm from the release feed and asks you to authorize the install (a `pkexec` password prompt) each time. You can also check on demand from **Check for updates…** in the app and Help menus. The channel is fixed by the product you installed. Reinstall Stable from `openknowledge.ai/download` or Beta from `openknowledge.ai/download/beta`; Windows and Linux installers are available from [GitHub Releases](https://github.com/inkeep/open-knowledge/releases). Override the feed with `OK_UPDATER_FEED_URL`.On its first launch the app also opens your default browser once to `openknowledge.ai/continue`, to check whether you installed from a share link and redeem it if so; the exchange completes over a short-lived local loopback listener.@@ -65,6 +67,8 @@ The first two rows below live in OpenKnowledge's own `~/.ok/` directory and are| `~/.ok/bin/ok`, `~/.ok/bin/open-knowledge` | Symlinks to the CLI bundled inside the app | Outside-project (home dir) || `~/.ok/env.sh` | A managed shim that prepends `~/.ok/bin` to your `PATH` | Outside-project (home dir) || `~/.zshrc`, `~/.bash_profile`, `~/.bashrc` (Linux), `~/.config/fish/conf.d/open-knowledge.fish` | A **fenced managed block** that sources `~/.ok/env.sh` — written **only if you consent** in the first-launch dialog. The block is created in the startup file for your login shell, and maintained in any of these that already exists, except `~/.bashrc`, which is only ever touched on Linux | Outside-project (shell config) |+| `~/.ok/variants/beta/bin/ok-beta`, `~/.ok/variants/beta/bin/open-knowledge-beta` | Beta-only symlinks to the CLI bundled inside OpenKnowledge Beta | Outside-project (home dir) |+| `~/.ok/variants/beta/env.sh`, `~/.config/fish/conf.d/open-knowledge-beta.fish` | Beta's separate environment shim and fish startup file; other shells receive a separately fenced `open-knowledge beta cli` block | Outside-project (home dir / shell config) |If you decline, only `ok` typed in an *external* terminal (Terminal, iTerm) is affected — the app's built-in terminal, the MCP server, and the "Open with AI" launches all work without it. You can add it later from **File → Set up OpenKnowledge integrations…**. Machines that already had the block from a version before the consent dialog are treated as consented: the block is left in place and maintained.diff --git a/docs/src/app/.well-known/apple-app-site-association/route.ts b/docs/src/app/.well-known/apple-app-site-association/route.tsindex 915463f69..49d7bd6e7 100644--- a/docs/src/app/.well-known/apple-app-site-association/route.ts+++ b/docs/src/app/.well-known/apple-app-site-association/route.ts@@ -1,13 +1,13 @@export const dynamic = 'force-static';const APPLE_TEAM_ID = '6NZGSG335T';-const APP_BUNDLE_ID = 'com.inkeep.open-knowledge';+const APP_BUNDLE_IDS = ['com.inkeep.open-knowledge', 'com.inkeep.open-knowledge.beta'] as const;const AASA_MANIFEST = {applinks: {details: [{- appIDs: [`${APPLE_TEAM_ID}.${APP_BUNDLE_ID}`],+ appIDs: APP_BUNDLE_IDS.map((bundleId) => `${APPLE_TEAM_ID}.${bundleId}`),components: [{ '/': '/d/*', comment: 'Share splash routes' }],},],diff --git a/docs/src/app/download/beta/route.test.ts b/docs/src/app/download/beta/route.test.tsindex 0de161897..3e60a334c 100644--- a/docs/src/app/download/beta/route.test.ts+++ b/docs/src/app/download/beta/route.test.ts@@ -1,19 +1,19 @@import { describe, expect, test, vi } from 'vitest';import {- type BetaRedirect,- DMG_ASSET_NAME,+ BETA_DMG_ASSET_NAME,FALLBACK_CACHE_CONTROL,+ type PrereleaseRedirect,RELEASES_PAGE_URL,SUCCESS_CACHE_CONTROL,} from '../../../lib/download-links.ts';-const TEST_DMG_URL = `https://github.com/inkeep/open-knowledge/releases/download/v0.1.0-beta.1/${DMG_ASSET_NAME}`;+const TEST_DMG_URL = `https://github.com/inkeep/open-knowledge/releases/download/v0.1.0-beta.1/${BETA_DMG_ASSET_NAME}`;-let _redirect: BetaRedirect = { kind: 'fresh', url: TEST_DMG_URL };+let _redirect: PrereleaseRedirect = { kind: 'fresh', url: TEST_DMG_URL };vi.doMock('../../../lib/download-links.ts', () => ({createBetaResolver: () => () => Promise.resolve(_redirect),- toRedirectResponse: (r: BetaRedirect): Response =>+ toRedirectResponse: (r: PrereleaseRedirect): Response =>new Response(null, {status: 302,headers: {diff --git a/docs/src/app/updates/[channel]/[...path]/route.test.ts b/docs/src/app/updates/[channel]/[...path]/route.test.tsindex 49f2eb4c3..3188a56b4 100644--- a/docs/src/app/updates/[channel]/[...path]/route.test.ts+++ b/docs/src/app/updates/[channel]/[...path]/route.test.ts@@ -16,7 +16,7 @@ vi.doMock('../../../../lib/track.ts', () => ({}));const BETA_DMG_URL =- 'https://github.com/inkeep/open-knowledge/releases/download/v0.20.0-beta.4/OpenKnowledge-arm64.dmg';+ 'https://github.com/inkeep/open-knowledge/releases/download/v0.20.0-beta.4/OpenKnowledge-Beta-arm64.dmg';type BetaRedirect = { kind: string; url: string; cause?: string; refreshError?: string };let _betaRedirect: BetaRedirect = { kind: 'fresh', url: BETA_DMG_URL };vi.doMock('../../../../lib/download-links.ts', () => ({@@ -76,7 +76,7 @@ describe('GET /updates/[channel]/[...path]', () => {test('beta zip parses the prerelease version and counts (no from_version header)', async () => {_lastCapture = null;- const file = 'OpenKnowledge-0.20.0-beta.4-arm64-mac.zip';+ const file = 'OpenKnowledge-Beta-0.20.0-beta.4-arm64-mac.zip';const res = await call('beta', [file]);expect(res.status).toBe(302);expect(res.headers.get('location')).toBe(`${REL}/download/v0.20.0-beta.4/${file}`);@@ -123,6 +123,15 @@ describe('GET /updates/[channel]/[...path]', () => {expect((await call('canary', ['latest-mac.yml'])).status).toBe(404);});+ test('public channel paths reject the other product manifest or artifact', async () => {+ expect((await call('stable', ['beta-mac.yml'])).status).toBe(404);+ expect((await call('beta', ['latest-mac.yml'])).status).toBe(404);+ expect((await call('stable', ['OpenKnowledge-Beta-0.21.0-beta.4-arm64-mac.zip'])).status).toBe(+ 404,+ );+ expect((await call('beta', ['OpenKnowledge-0.21.0-arm64-mac.zip'])).status).toBe(404);+ });+test('path traversal / multi-segment → 404', async () => {expect((await call('stable', ['..', 'secret'])).status).toBe(404);});@@ -229,13 +238,13 @@ describe('GET /updates/[channel]/[...path]', () => {expect(_lastCapture?.properties?.to_version).toBe('0.20.0');_lastCapture = null;- await call('beta', ['OpenKnowledge-arm64.deb'], { 'x-ok-to-version': '9.9.9' });+ await call('beta', ['OpenKnowledge-Beta-arm64.deb'], { 'x-ok-to-version': '9.9.9' });expect(_lastCapture?.properties?.to_version).toBe('0.20.0-beta.4');});test('Linux beta deb counts with to_version derived from the resolved beta tag', async () => {_lastCapture = null;- const file = 'OpenKnowledge-arm64.deb';+ const file = 'OpenKnowledge-Beta-arm64.deb';const res = await call('beta', [file]);expect(res.status).toBe(302);expect(res.headers.get('location')).toBe(`${REL}/download/v0.20.0-beta.4/${file}`);diff --git a/docs/src/app/updates/[channel]/[...path]/route.ts b/docs/src/app/updates/[channel]/[...path]/route.tsindex 52267a4de..2d6ff5164 100644--- a/docs/src/app/updates/[channel]/[...path]/route.ts+++ b/docs/src/app/updates/[channel]/[...path]/route.ts@@ -4,12 +4,16 @@ import { captureServerEvent, resolveDistinctId, userAgentProperties } from '@/liexport const dynamic = 'force-dynamic';const RELEASES_BASE = 'https://github.com/inkeep/open-knowledge/releases';-const VALID_CHANNELS = new Set(['stable', 'beta']);+const CHANNELS = {+ stable: { manifestPrefix: 'latest', productPrefix: 'OpenKnowledge-' },+ beta: { manifestPrefix: 'beta', productPrefix: 'OpenKnowledge-Beta-' },+} as const;+type UpdateChannel = keyof typeof CHANNELS;const SAFE_FILENAME = /^[A-Za-z0-9._-]+$/;const ARTIFACT_VERSION =/-(\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?)-(?:arm64|x64|universal)-mac\.zip(?:\.blockmap)?$/;const MANIFEST = /^(?:latest|beta)(?:-mac|-linux(?:-arm64)?)?\.yml$/;-const BETA_TAG_FROM_URL = /\/releases\/download\/([^/]+)\//;+const TAG_FROM_URL = /\/releases\/download\/([^/]+)\//;const HEADER_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?$/;function headerVersion(request: Request, name: string): string | undefined {@@ -75,7 +79,27 @@ async function latestBetaTag(): Promise<string | null> {);}if (redirect.kind === 'fallback') return null;- return BETA_TAG_FROM_URL.exec(redirect.url)?.[1] ?? null;+ return TAG_FROM_URL.exec(redirect.url)?.[1] ?? null;+}++function isUpdateChannel(value: string): value is UpdateChannel {+ return Object.hasOwn(CHANNELS, value);+}++function matchesChannelIdentity(+ channel: UpdateChannel,+ filename: string,+ type: ArtifactType,+): boolean {+ const config = CHANNELS[channel];+ if (type === 'manifest') {+ return (+ filename.startsWith(`${config.manifestPrefix}-`) ||+ filename === `${config.manifestPrefix}.yml`+ );+ }+ if (!filename.startsWith(config.productPrefix)) return false;+ return channel !== 'stable' || !filename.startsWith(CHANNELS.beta.productPrefix);}export async function GET(@@ -83,13 +107,15 @@ export async function GET({ params }: { params: Promise<{ channel: string; path: string[] }> },): Promise<Response> {const { channel, path } = await params;- if (!VALID_CHANNELS.has(channel)) return errorResponse(404);+ if (!isUpdateChannel(channel)) return errorResponse(404);const filename = path.join('/');- if (!SAFE_FILENAME.test(filename)) return errorResponse(404);+ if (path.length !== 1 || !SAFE_FILENAME.test(filename)) return errorResponse(404);const type = classify(filename);- if (type === 'other') return errorResponse(404);+ if (type === 'other' || !matchesChannelIdentity(channel, filename, type)) {+ return errorResponse(404);+ }const version = ARTIFACT_VERSION.exec(filename)?.[1];diff --git a/docs/src/lib/download-links.test.ts b/docs/src/lib/download-links.test.tsindex 661c6a7b0..c4980385e 100644--- a/docs/src/lib/download-links.test.ts+++ b/docs/src/lib/download-links.test.ts@@ -1,5 +1,6 @@import { describe, expect, test } from 'vitest';import {+ BETA_DMG_ASSET_NAME,createBetaResolver,DMG_ASSET_NAME,FALLBACK_CACHE_CONTROL,@@ -17,7 +18,7 @@ function release(const {draft = false,prerelease = true,- assetNames = [DMG_ASSET_NAME],+ assetNames = [BETA_DMG_ASSET_NAME],assetHost = 'https://github.com/inkeep/open-knowledge/releases/download',} = opts;return {@@ -31,8 +32,8 @@ function release(};}-function dmgUrl(tag: string) {- return `https://github.com/inkeep/open-knowledge/releases/download/${tag}/${DMG_ASSET_NAME}`;+function dmgUrl(tag: string, assetName = BETA_DMG_ASSET_NAME) {+ return `https://github.com/inkeep/open-knowledge/releases/download/${tag}/${assetName}`;}function jsonResponse(payload: unknown, status = 200) {@@ -117,6 +118,14 @@ describe('pickLatestBetaDmgUrl', () => {expect(url).toBe(dmgUrl('v0.12.0-beta.6'));});+ test('skips legacy shared-identity beta artifacts', () => {+ const url = pickLatestBetaDmgUrl([+ release('v0.12.0-beta.8', { assetNames: [DMG_ASSET_NAME] }),+ release('v0.12.0-beta.7'),+ ]);+ expect(url).toBe(dmgUrl('v0.12.0-beta.7'));+ });+test('rejects asset URLs outside our release-download prefix', () => {const url = pickLatestBetaDmgUrl([release('v0.12.0-beta.7', { assetHost: 'https://evil.example.com/releases/download' }),diff --git a/docs/src/lib/download-links.ts b/docs/src/lib/download-links.tsindex 94b7bd6d9..cdaa02767 100644--- a/docs/src/lib/download-links.ts+++ b/docs/src/lib/download-links.ts@@ -1,8 +1,9 @@import { z } from 'zod';-const RELEASES_API_URL = 'https://api.github.com/repos/inkeep/open-knowledge/releases?per_page=15';+const RELEASES_API_URL = 'https://api.github.com/repos/inkeep/open-knowledge/releases?per_page=100';export const DMG_ASSET_NAME = 'OpenKnowledge-arm64.dmg';+export const BETA_DMG_ASSET_NAME = 'OpenKnowledge-Beta-arm64.dmg';export const STABLE_DMG_URL = `https://github.com/inkeep/open-knowledge/releases/latest/download/${DMG_ASSET_NAME}`;@@ -20,9 +21,9 @@ const ASSET_URL_PREFIX = 'https://github.com/inkeep/open-knowledge/releases/downconst BETA_TAG_PATTERN = /^v(\d+)\.(\d+)\.(\d+)-beta\.(\d+)$/;-type BetaRank = readonly [number, number, number, number];+type PrereleaseRank = readonly [number, number, number, number];-function compareBetaRank(a: BetaRank, b: BetaRank): number {+function comparePrereleaseRank(a: PrereleaseRank, b: PrereleaseRank): number {for (let i = 0; i < 4; i++) {if (a[i] !== b[i]) return a[i] - b[i];}@@ -54,25 +55,31 @@ export function pickLatestBetaDmgUrl(payload: unknown): string | null {return null;}- let best: { rank: BetaRank; url: string } | null = null;+ let best: { rank: PrereleaseRank; url: string } | null = null;for (const release of parsed.data) {if (release.draft || !release.prerelease) continue;const parts = BETA_TAG_PATTERN.exec(release.tag_name);if (!parts) continue;const dmg = release.assets.find((asset) =>- asset.name === DMG_ASSET_NAME && asset.browser_download_url.startsWith(ASSET_URL_PREFIX),+ asset.name === BETA_DMG_ASSET_NAME &&+ asset.browser_download_url.startsWith(ASSET_URL_PREFIX),);if (!dmg) continue;- const rank: BetaRank = [Number(parts[1]), Number(parts[2]), Number(parts[3]), Number(parts[4])];- if (!best || compareBetaRank(rank, best.rank) > 0) {+ const rank: PrereleaseRank = [+ Number(parts[1]),+ Number(parts[2]),+ Number(parts[3]),+ Number(parts[4]),+ ];+ if (!best || comparePrereleaseRank(rank, best.rank) > 0) {best = { rank, url: dmg.browser_download_url };}}return best?.url ?? null;}-export type BetaRedirect =+export type PrereleaseRedirect =| { kind: 'fresh' | 'cached'; url: string }| { kind: 'stale-lkg'; url: string; refreshError: string }| { kind: 'fallback'; url: string; cause: string };@@ -86,12 +93,12 @@ function describeError(err: unknown): string {export function createBetaResolver(deps: { fetchImpl?: typeof fetch; now?: () => number } = {},-): () => Promise<BetaRedirect> {+): () => Promise<PrereleaseRedirect> {const fetchImpl = deps.fetchImpl ?? fetch;const now = deps.now ?? Date.now;let lkg: { url: string; fetchedAt: number } | null = null;- return async function resolveBetaRedirect(): Promise<BetaRedirect> {+ return async function resolveBetaRedirect(): Promise<PrereleaseRedirect> {if (lkg && now() - lkg.fetchedAt < LKG_TTL_MS) {return { kind: 'cached', url: lkg.url };}@@ -116,7 +123,7 @@ export function createBetaResolver(}const url = pickLatestBetaDmgUrl(payload);if (!url) {- throw new Error('no published beta release carries the DMG asset');+ throw new Error('no published beta release carries the Beta DMG asset');}lkg = { url, fetchedAt: now() };return { kind: 'fresh', url };@@ -136,7 +143,7 @@ export const SUCCESS_CACHE_CONTROL = 'public, max-age=0, s-maxage=300, stale-whiexport const FALLBACK_CACHE_CONTROL = 'no-store';-export function toRedirectResponse(redirect: BetaRedirect): Response {+export function toRedirectResponse(redirect: PrereleaseRedirect): Response {return new Response(null, {status: 302,headers: {diff --git a/packages/app/src/components/InstanceBadge.dom.test.tsx b/packages/app/src/components/InstanceBadge.dom.test.tsxindex 1899f7ebf..a119d50a7 100644--- a/packages/app/src/components/InstanceBadge.dom.test.tsx+++ b/packages/app/src/components/InstanceBadge.dom.test.tsx@@ -44,7 +44,7 @@ describe('InstanceBadge runtime behavior', () => {const badge = screen.getByTestId('instance-badge');expect(badge.textContent).toContain('theming-as-plugin');- expect(badge.getAttribute('aria-label')).toBe('Dev instance: theming-as-plugin');+ expect(badge.getAttribute('aria-label')).toBe('App instance: theming-as-plugin');expect(badge.getAttribute('data-variant')).toBe('secondary');expect(badge.classList.contains('ml-1')).toBe(true);});diff --git a/packages/app/src/components/InstanceBadge.tsx b/packages/app/src/components/InstanceBadge.tsxindex 13bb4a337..0a25c59fd 100644--- a/packages/app/src/components/InstanceBadge.tsx+++ b/packages/app/src/components/InstanceBadge.tsx@@ -16,7 +16,7 @@ export function InstanceBadge({ className }: InstanceBadgeProps) {<TooltipTrigger asChild><Badgevariant="secondary"- aria-label={t`Dev instance: ${label}`}+ aria-label={t`App instance: ${label}`}data-testid="instance-badge"className={className}>@@ -24,7 +24,7 @@ export function InstanceBadge({ className }: InstanceBadgeProps) {<span className="max-w-40 truncate">{label}</span></Badge></TooltipTrigger>- <TooltipContent>{t`Dev instance: ${label} (isolated from other worktrees)`}</TooltipContent>+ <TooltipContent>{t`${label} uses isolated app data`}</TooltipContent></Tooltip>);}diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.jsonindex 919bdbf9f..966ed6d3b 100644--- a/packages/app/src/locales/ar/messages.json+++ b/packages/app/src/locales/ar/messages.json@@ -3691,6 +3691,7 @@"aaI6cN": ["تعذّر الاتصال بخدمة الوكيل. تأكد من أن خادم OpenKnowledge يعمل ومحدَّث (أعد تشغيله إن كان يعمل بالفعل)، ثم أعد المحاولة."],+ "aaiiRa": ["مثيل التطبيق: ", ["label"]],"aalx4E": ["يجري تحرير مصدر MDX معطوب: ", ["reason"]],"aatPoi": ["الملفات التي تم إنشاؤها"],"abiHje": ["حذف العناصر المحددة"],@@ -3796,7 +3797,6 @@"c3ZGrq": ["المستند ", ["0"]],"c4OLjD": ["التثبيت لـ Claude Chat و Cowork (تطبيق سطح المكتب)"],"c4fVUV": ["إصلاح"],- "c5PTFE": ["نسخة التطوير: ", ["label"], " (معزولة عن أشجار العمل الأخرى)"],"c5f7sm": ["لغة كتلة الكود: ", ["currentLabel"], ". انقر للتغيير."],"c5rF4v": ["ما الغرض من قاعدة المعرفة هذه؟"],"c863eW": ["تعذّر التبديل إلى ", ["shareBranch"], ". حاول التبديل يدويًا."],@@ -4456,6 +4456,7 @@"hFmYGU": ["ملفات السمات المرتبطة غير مدعومة"],"hGmuTc": ["مستندات موسومة بـ #", ["tagDocsName"]],"hHMv6l": ["حذف الكتلة"],+ "hHQHPX": ["يستخدم ", ["label"], " بيانات تطبيق معزولة"],"hIQkLb": ["محادثة جديدة"],"hItdtk": ["استعراض مجلد"],"hLKfZe": ["استخدم رمزًا بدلًا من ذلك"],@@ -4566,7 +4567,6 @@"النسخة مجلد حقيقي قائم بذاته، ويبقيها OK متوافقة مع المصدر: حرِّر المهارة هنا فتُحدَّث كل نسخة. يتوقف ذلك لحظة تحريرك نسخةً يدويًا خارج OK — عندها تسير في طريقها الخاص وتظهر كمهارة منفصلة."],"iOHg1t": ["فتح الرابط المضمَّن في تبويب جديد"],- "iRdfLr": ["نسخة التطوير: ", ["label"]],"iSLIjg": ["اتصال"],"iSQTsg": ["قائمة مرتّبة"],"iSWh95": ["هدف الصورة \"", ["shown"], "\" لا يشير إلى ملف موجود."],diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.poindex 37626bd50..1938738ec 100644--- a/packages/app/src/locales/ar/messages.po+++ b/packages/app/src/locales/ar/messages.po@@ -928,6 +928,10 @@ msgstr "{label} مفعَّل"msgid "{label} problems"msgstr "{label} مشكلة"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "يستخدم {label} بيانات تطبيق معزولة"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, zero {يزيل # تعديل أحدث على هذا الملف.} one {يزيل تعديلًا واحدًا أحدث على هذا الملف.} two {يزيل تعديلين أحدث على هذا الملف.} few {يزيل # تعديلات أحدث على هذا الملف.} many {يزيل # تعديلًا أحدث على هذا الملف.} other {يزيل # تعديل أحدث على هذا الملف.}}"@@ -2058,6 +2062,10 @@ msgstr "هل تودّ إضافة شيء؟ (اختياري)"msgid "API key set"msgstr "تم ضبط مفتاح API"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "مثيل التطبيق: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "سجل للإلحاق فقط بما تغيّر."@@ -5048,14 +5056,6 @@ msgstr "مشاريع OpenKnowledge المكتشفة"msgid "Detecting"msgstr "يجري الاكتشاف"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "نسخة التطوير: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "نسخة التطوير: {label} (معزولة عن أشجار العمل الأخرى)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.jsonindex 1a41ba87f..fe8e5f9f9 100644--- a/packages/app/src/locales/bn/messages.json+++ b/packages/app/src/locales/bn/messages.json@@ -3146,6 +3146,7 @@"aaI6cN": ["এজেন্ট সেবার সঙ্গে যুক্ত হওয়া যায়নি। নিশ্চিত করুন OpenKnowledge সার্ভার চলছে ও হালনাগাদ আছে (আগে থেকে চললে সেটি পুনরায় চালু করুন), তারপর আবার চেষ্টা করুন।"],+ "aaiiRa": ["অ্যাপ ইনস্ট্যান্স: ", ["label"]],"aalx4E": ["ভাঙা MDX সোর্স সম্পাদনা করা হচ্ছে: ", ["reason"]],"aatPoi": ["জেনারেটেড ফাইল"],"abiHje": ["নির্বাচিত আইটেম মুছুন"],@@ -3238,7 +3239,6 @@"c3ZGrq": ["নথি ", ["0"]],"c4OLjD": ["Claude Chat ও Cowork-এর জন্য ইনস্টল করুন (ডেস্কটপ অ্যাপ)"],"c4fVUV": ["ঠিক করুন"],- "c5PTFE": ["ডেভ ইনস্ট্যান্স: ", ["label"], " (অন্য ওয়ার্কট্রি থেকে পৃথক)"],"c5f7sm": ["কোড ব্লকের ভাষা: ", ["currentLabel"], "। বদলাতে ক্লিক করুন।"],"c5rF4v": ["এই জ্ঞানভাণ্ডারটি কিসের জন্য?"],"c863eW": [["shareBranch"], "-এ যাওয়া যায়নি। হাতে বদলে দেখুন।"],@@ -3758,6 +3758,7 @@"hFmYGU": ["লিঙ্ক করা থিম ফাইল সমর্থিত নয়"],"hGmuTc": ["#", ["tagDocsName"], " ট্যাগযুক্ত নথি"],"hHMv6l": ["ব্লক মুছুন"],+ "hHQHPX": [["label"], " আলাদা অ্যাপ ডেটা ব্যবহার করে"],"hIQkLb": ["নতুন আলাপ"],"hItdtk": ["ফোল্ডার ব্রাউজ করুন"],"hLKfZe": ["বদলে একটি টোকেন ব্যবহার করুন"],@@ -3870,7 +3871,6 @@"অনুলিপি নিজেই একটি সত্যিকারের ফোল্ডার, আর OK সেটিকে উৎসের সঙ্গে মিলিয়ে রাখে: স্কিলটি এখানে সম্পাদনা করুন, প্রতিটি অনুলিপি সতেজ হয়ে যায়। আপনি OK-এর বাইরে কোনো অনুলিপি হাতে সম্পাদনা করলেই সেটি বন্ধ হয়ে যায় — তারপর থেকে সেটি নিজের পথে চলে এবং আলাদা স্কিল হিসেবে দেখা দেয়।"],"iOHg1t": ["এমবেড করা URL নতুন ট্যাবে খুলুন"],- "iRdfLr": ["ডেভ ইনস্ট্যান্স: ", ["label"]],"iSLIjg": ["যুক্ত করুন"],"iSQTsg": ["ক্রমিক তালিকা"],"iSWh95": ["ছবির লক্ষ্য \"", ["shown"], "\" কোনো বিদ্যমান ফাইলকে নির্দেশ করে না।"],diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.poindex 92094ff6e..a865fde44 100644--- a/packages/app/src/locales/bn/messages.po+++ b/packages/app/src/locales/bn/messages.po@@ -928,6 +928,10 @@ msgstr "{label} সক্রিয়"msgid "{label} problems"msgstr "{label} সমস্যা"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} আলাদা অ্যাপ ডেটা ব্যবহার করে"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {এই ফাইলের # নতুন সম্পাদনা সরিয়ে দেয়।} other {এই ফাইলের # নতুন সম্পাদনা সরিয়ে দেয়।}}"@@ -2054,6 +2058,10 @@ msgstr "আর কিছু যোগ করতে চান? (ঐচ্ছিmsgid "API key set"msgstr "API কী নির্ধারিত"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "অ্যাপ ইনস্ট্যান্স: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "কী বদলেছে তার শুধু-যোগ-হওয়া লগ।"@@ -5044,14 +5052,6 @@ msgstr "শনাক্ত হওয়া OpenKnowledge প্রকল্প"msgid "Detecting"msgstr "শনাক্ত করা হচ্ছে"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "ডেভ ইনস্ট্যান্স: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "ডেভ ইনস্ট্যান্স: {label} (অন্য ওয়ার্কট্রি থেকে পৃথক)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex 24ba8107d..272a21ce2 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -3228,6 +3228,7 @@"aaI6cN": ["Couldn't connect to the agent service. Make sure the OpenKnowledge server is running and up to date (restart it if it was already running), then try again."],+ "aaiiRa": ["App instance: ", ["label"]],"aalx4E": ["Editing broken MDX source: ", ["reason"]],"aatPoi": ["Generated files"],"abiHje": ["Delete selected items"],@@ -3322,7 +3323,6 @@"c3ZGrq": ["the doc ", ["0"]],"c4OLjD": ["Install for Claude Chat & Cowork (desktop app)"],"c4fVUV": ["Fix"],- "c5PTFE": ["Dev instance: ", ["label"], " (isolated from other worktrees)"],"c5f7sm": ["Code block language: ", ["currentLabel"], ". Click to change."],"c5rF4v": ["What is this knowledge base for?"],"c863eW": ["Could not switch to ", ["shareBranch"], ". Try switching manually."],@@ -3885,6 +3885,7 @@"hFmYGU": ["Linked theme files aren’t supported"],"hGmuTc": ["Docs tagged #", ["tagDocsName"]],"hHMv6l": ["Delete block"],+ "hHQHPX": [["label"], " uses isolated app data"],"hIQkLb": ["New chat"],"hItdtk": ["Browse folder"],"hLKfZe": ["Use a token instead"],@@ -3996,7 +3997,6 @@"A copy is a real folder of its own, and OK keeps it in step with the source: edit the skill here and every copy is refreshed. That stops the moment you hand-edit a copy outside OK — from then on it goes its own way and shows up as a separate skill."],"iOHg1t": ["Open embedded URL in new tab"],- "iRdfLr": ["Dev instance: ", ["label"]],"iSLIjg": ["Connect"],"iSQTsg": ["Ordered list"],"iSWh95": ["Image target \"", ["shown"], "\" does not resolve to an existing file."],diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex 0691d7ebc..6264d2963 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -928,6 +928,10 @@ msgstr "{label} enabled"msgid "{label} problems"msgstr "{label} problems"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} uses isolated app data"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"@@ -2058,6 +2062,10 @@ msgstr "Anything you'd like to add? (optional)"msgid "API key set"msgstr "API key set"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "App instance: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "Append-only log of what changed."@@ -5048,14 +5056,6 @@ msgstr "Detected OpenKnowledge projects"msgid "Detecting"msgstr "Detecting"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "Dev instance: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "Dev instance: {label} (isolated from other worktrees)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.jsonindex e42c15f53..cbaff2104 100644--- a/packages/app/src/locales/es/messages.json+++ b/packages/app/src/locales/es/messages.json@@ -3740,6 +3740,7 @@"aaI6cN": ["No se pudo conectar con el servicio de agentes. Asegúrate de que el servidor de OpenKnowledge esté en marcha y actualizado (reinícialo si ya estaba en marcha) y vuelve a intentarlo."],+ "aaiiRa": ["Instancia de la aplicación: ", ["label"]],"aalx4E": ["Editando código MDX defectuoso: ", ["reason"]],"aatPoi": ["Archivos generados"],"abiHje": ["Eliminar los elementos seleccionados"],@@ -3861,7 +3862,6 @@"c3ZGrq": ["el documento ", ["0"]],"c4OLjD": ["Instalar para Claude Chat y Cowork (aplicación de escritorio)"],"c4fVUV": ["Arreglar"],- "c5PTFE": ["Instancia de desarrollo: ", ["label"], " (aislada de otros worktrees)"],"c5f7sm": ["Lenguaje del bloque de código: ", ["currentLabel"], ". Haz clic para cambiarlo."],"c5rF4v": ["¿Para qué es esta base de conocimiento?"],"c863eW": ["No se pudo cambiar a ", ["shareBranch"], ". Prueba a cambiar manualmente."],@@ -4533,6 +4533,7 @@"hFmYGU": ["No se admiten archivos de tema vinculados"],"hGmuTc": ["Documentos etiquetados con #", ["tagDocsName"]],"hHMv6l": ["Eliminar el bloque"],+ "hHQHPX": [["label"], " usa datos de aplicación aislados"],"hIQkLb": ["Nuevo chat"],"hItdtk": ["Elegir carpeta"],"hLKfZe": ["Usar un token en su lugar"],@@ -4658,7 +4659,6 @@"Una copia es una carpeta propia, y OK la mantiene alineada con el origen: edita la habilidad aquí y todas las copias se actualizan. Eso se detiene en cuanto editas a mano una copia fuera de OK; a partir de ahí sigue su propio camino y aparece como una habilidad aparte."],"iOHg1t": ["Abrir la URL incrustada en una pestaña nueva"],- "iRdfLr": ["Instancia de desarrollo: ", ["label"]],"iSLIjg": ["Conectar"],"iSQTsg": ["Lista numerada"],"iSWh95": ["El destino de la imagen «", ["shown"], "» no corresponde a un archivo existente."],diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.poindex ebdd0c4cd..daddb97a9 100644--- a/packages/app/src/locales/es/messages.po+++ b/packages/app/src/locales/es/messages.po@@ -928,6 +928,10 @@ msgstr "{label} activado"msgid "{label} problems"msgstr "{label} problemas"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} usa datos de aplicación aislados"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Elimina # edición más reciente de este archivo.} many {Elimina # ediciones más recientes de este archivo.} other {Elimina # ediciones más recientes de este archivo.}}"@@ -2058,6 +2062,10 @@ msgstr "¿Quieres añadir algo? (opcional)"msgid "API key set"msgstr "Clave de API definida"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "Instancia de la aplicación: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "Registro de solo anexado con lo que ha cambiado."@@ -5048,14 +5056,6 @@ msgstr "Proyectos de OpenKnowledge detectados"msgid "Detecting"msgstr "Detectando"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "Instancia de desarrollo: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "Instancia de desarrollo: {label} (aislada de otros worktrees)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.jsonindex 8bd222ac2..bc1f84c19 100644--- a/packages/app/src/locales/fr/messages.json+++ b/packages/app/src/locales/fr/messages.json@@ -3789,6 +3789,7 @@"aaI6cN": ["Impossible de joindre le service d'agents. Vérifiez que le serveur OpenKnowledge est en cours d'exécution et à jour (redémarrez-le s'il tournait déjà), puis réessayez."],+ "aaiiRa": ["Instance de l’application : ", ["label"]],"aalx4E": ["Modification d'une source MDX cassée : ", ["reason"]],"aatPoi": ["Fichiers générés"],"abiHje": ["Supprimer les éléments sélectionnés"],@@ -3910,7 +3911,6 @@"c3ZGrq": ["le document ", ["0"]],"c4OLjD": ["Installer pour Claude Chat et Cowork (application de bureau)"],"c4fVUV": ["Corriger"],- "c5PTFE": ["Instance de développement : ", ["label"], " (isolée des autres worktrees)"],"c5f7sm": ["Langage du bloc de code : ", ["currentLabel"], ". Cliquez pour changer."],"c5rF4v": ["À quoi sert cette base de connaissances ?"],"c863eW": [@@ -4568,6 +4568,7 @@"hFmYGU": ["Les fichiers de thème liés ne sont pas pris en charge"],"hGmuTc": ["Documents étiquetés #", ["tagDocsName"]],"hHMv6l": ["Supprimer le bloc"],+ "hHQHPX": [["label"], " utilise des données d’application isolées"],"hIQkLb": ["Nouvelle discussion"],"hItdtk": ["Parcourir le dossier"],"hLKfZe": ["Utiliser plutôt un jeton"],@@ -4695,7 +4696,6 @@"Une copie est un vrai dossier à part entière, et OK la maintient alignée sur la source : modifiez la compétence ici et chaque copie est actualisée. Cela s'arrête dès que vous modifiez une copie à la main en dehors d'OK — à partir de là elle suit son propre chemin et apparaît comme une compétence distincte."],"iOHg1t": ["Ouvrir l'URL intégrée dans un nouvel onglet"],- "iRdfLr": ["Instance de développement : ", ["label"]],"iSLIjg": ["Connecter"],"iSQTsg": ["Liste numérotée"],"iSWh95": ["La cible de l’image « ", ["shown"], " » ne correspond à aucun fichier existant."],diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.poindex 80926604f..16a1b3ea9 100644--- a/packages/app/src/locales/fr/messages.po+++ b/packages/app/src/locales/fr/messages.po@@ -928,6 +928,10 @@ msgstr "{label} activé"msgid "{label} problems"msgstr "{label} problèmes"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} utilise des données d’application isolées"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Supprime # modification plus récente de ce fichier.} many {Supprime # modifications plus récentes de ce fichier.} other {Supprime # modifications plus récentes de ce fichier.}}"@@ -2058,6 +2062,10 @@ msgstr "Vous souhaitez ajouter quelque chose ? (facultatif)"msgid "API key set"msgstr "Clé API définie"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "Instance de l’application : {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "Journal en ajout seul de ce qui a changé."@@ -5048,14 +5056,6 @@ msgstr "Projets OpenKnowledge détectés"msgid "Detecting"msgstr "Détection"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "Instance de développement : {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "Instance de développement : {label} (isolée des autres worktrees)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.jsonindex 2e80c75ca..9e333e5b7 100644--- a/packages/app/src/locales/hi/messages.json+++ b/packages/app/src/locales/hi/messages.json@@ -3140,6 +3140,7 @@"aaI6cN": ["एजेंट सेवा से नहीं जुड़ा जा सका। सुनिश्चित करें कि OpenKnowledge सर्वर चल रहा है और अद्यतित है (यदि पहले से चल रहा था तो उसे पुनः आरंभ करें), फिर कोशिश करें।"],+ "aaiiRa": ["ऐप इंस्टेंस: ", ["label"]],"aalx4E": ["टूटा हुआ MDX स्रोत संपादित किया जा रहा है: ", ["reason"]],"aatPoi": ["जेनरेट की गई फ़ाइलें"],"abiHje": ["चयनित आइटम हटाएँ"],@@ -3237,7 +3238,6 @@"c3ZGrq": ["दस्तावेज़ ", ["0"]],"c4OLjD": ["Claude Chat और Cowork के लिए इंस्टॉल करें (डेस्कटॉप ऐप)"],"c4fVUV": ["ठीक करें"],- "c5PTFE": ["डेव इंस्टेंस: ", ["label"], " (अन्य वर्कट्री से अलग)"],"c5f7sm": ["कोड ब्लॉक भाषा: ", ["currentLabel"], ". बदलने के लिए क्लिक करें।"],"c5rF4v": ["यह ज्ञान आधार किस लिए है?"],"c863eW": [["shareBranch"], " पर नहीं जाया जा सका। हाथ से बदलने की कोशिश करें।"],@@ -3753,6 +3753,7 @@"hFmYGU": ["लिंक की गई थीम फ़ाइलें समर्थित नहीं हैं"],"hGmuTc": ["#", ["tagDocsName"], " टैग वाले दस्तावेज़"],"hHMv6l": ["ब्लॉक हटाएँ"],+ "hHQHPX": [["label"], " अलग ऐप डेटा का उपयोग करता है"],"hIQkLb": ["नई चैट"],"hItdtk": ["फ़ोल्डर ब्राउज़ करें"],"hLKfZe": ["इसके बजाय कोई टोकन उपयोग करें"],@@ -3865,7 +3866,6 @@"प्रति अपने आप में एक असली फ़ोल्डर है, और OK उसे स्रोत के साथ तालमेल में रखता है: स्किल को यहाँ संपादित करें और हर प्रति ताज़ा हो जाती है। यह उसी क्षण रुक जाता है जब आप OK के बाहर किसी प्रति को हाथ से संपादित करते हैं — उसके बाद वह अपने रास्ते चली जाती है और एक अलग स्किल के रूप में दिखती है।"],"iOHg1t": ["एम्बेड किया गया URL नए टैब में खोलें"],- "iRdfLr": ["डेव इंस्टेंस: ", ["label"]],"iSLIjg": ["जोड़ें"],"iSQTsg": ["क्रमित सूची"],"iSWh95": ["चित्र लक्ष्य \"", ["shown"], "\" किसी मौजूदा फ़ाइल पर हल नहीं होता।"],diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.poindex 155d4e3ee..e47205f04 100644--- a/packages/app/src/locales/hi/messages.po+++ b/packages/app/src/locales/hi/messages.po@@ -928,6 +928,10 @@ msgstr "{label} सक्षम"msgid "{label} problems"msgstr "{label} समस्याएँ"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} अलग ऐप डेटा का उपयोग करता है"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {इस फ़ाइल पर # नया संपादन हटाता है।} other {इस फ़ाइल पर # नए संपादन हटाता है।}}"@@ -2054,6 +2058,10 @@ msgstr "कुछ और जोड़ना चाहेंगे? (वैकलmsgid "API key set"msgstr "API कुंजी सेट है"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "ऐप इंस्टेंस: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "क्या बदला इसका केवल-जोड़ा-जाने वाला लॉग।"@@ -5044,14 +5052,6 @@ msgstr "पाए गए OpenKnowledge प्रोजेक्ट"msgid "Detecting"msgstr "खोजा जा रहा है"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "डेव इंस्टेंस: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "डेव इंस्टेंस: {label} (अन्य वर्कट्री से अलग)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.jsonindex 9f11b080d..b4e138897 100644--- a/packages/app/src/locales/id/messages.json+++ b/packages/app/src/locales/id/messages.json@@ -3256,6 +3256,7 @@"aaI6cN": ["Tidak bisa terhubung ke layanan agen. Pastikan server OpenKnowledge berjalan dan mutakhir (mulai ulang jika sudah berjalan), lalu coba lagi."],+ "aaiiRa": ["Instans aplikasi: ", ["label"]],"aalx4E": ["Menyunting sumber MDX yang rusak: ", ["reason"]],"aatPoi": ["File yang dihasilkan"],"abiHje": ["Hapus item terpilih"],@@ -3367,7 +3368,6 @@"c3ZGrq": ["dokumen ", ["0"]],"c4OLjD": ["Pasang untuk Claude Chat dan Cowork (aplikasi desktop)"],"c4fVUV": ["Perbaiki"],- "c5PTFE": ["Instans pengembangan: ", ["label"], " (terpisah dari worktree lain)"],"c5f7sm": ["Bahasa blok kode: ", ["currentLabel"], ". Klik untuk mengubah."],"c5rF4v": ["Untuk apa basis pengetahuan ini?"],"c863eW": ["Tidak dapat berpindah ke ", ["shareBranch"], ". Coba berpindah secara manual."],@@ -3913,6 +3913,7 @@"hFmYGU": ["Berkas tema tertaut tidak didukung"],"hGmuTc": ["Dokumen bertag #", ["tagDocsName"]],"hHMv6l": ["Hapus blok"],+ "hHQHPX": [["label"], " menggunakan data aplikasi terisolasi"],"hIQkLb": ["Obrolan baru"],"hItdtk": ["Pilih folder"],"hLKfZe": ["Pakai token saja"],@@ -4031,7 +4032,6 @@"Salinan adalah folder tersendiri, dan OK menjaganya tetap selaras dengan sumbernya: sunting keterampilan di sini dan setiap salinan ikut diperbarui. Itu berhenti begitu Anda menyunting sebuah salinan secara manual di luar OK — sejak saat itu ia berjalan sendiri dan muncul sebagai keterampilan terpisah."],"iOHg1t": ["Buka URL tersemat di tab baru"],- "iRdfLr": ["Instans pengembangan: ", ["label"]],"iSLIjg": ["Hubungkan"],"iSQTsg": ["Daftar berurut"],"iSWh95": ["Target gambar \"", ["shown"], "\" tidak merujuk ke file yang ada."],diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.poindex 826dcc2b7..9e8a6269e 100644--- a/packages/app/src/locales/id/messages.po+++ b/packages/app/src/locales/id/messages.po@@ -928,6 +928,10 @@ msgstr "{label} diaktifkan"msgid "{label} problems"msgstr "{label} masalah"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} menggunakan data aplikasi terisolasi"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {Menghapus # suntingan yang lebih baru pada berkas ini.}}"@@ -2054,6 +2058,10 @@ msgstr "Ada yang ingin Anda tambahkan? (opsional)"msgid "API key set"msgstr "Kunci API disetel"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "Instans aplikasi: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "Log tambah-saja tentang apa yang berubah."@@ -5044,14 +5052,6 @@ msgstr "Proyek OpenKnowledge yang terdeteksi"msgid "Detecting"msgstr "Mendeteksi"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "Instans pengembangan: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "Instans pengembangan: {label} (terpisah dari worktree lain)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.jsonindex 38161629d..f3a45d6db 100644--- a/packages/app/src/locales/ko/messages.json+++ b/packages/app/src/locales/ko/messages.json@@ -3126,6 +3126,7 @@"aaI6cN": ["에이전트 서비스 연결 실패. OpenKnowledge 서버 실행 및 최신 상태 확인 후 다시 시도하세요. 이미 실행 중이면 재시작하세요."],+ "aaiiRa": ["앱 인스턴스: ", ["label"]],"aalx4E": ["손상된 MDX 소스 편집 중: ", ["reason"]],"aatPoi": ["생성된 파일"],"abiHje": ["선택 항목 삭제"],@@ -3218,7 +3219,6 @@"c3ZGrq": ["문서 ", ["0"]],"c4OLjD": ["Claude Chat 및 Cowork(데스크톱 앱)용 설치"],"c4fVUV": ["수정"],- "c5PTFE": ["개발 인스턴스: ", ["label"], " (다른 워크트리와 격리됨)"],"c5f7sm": ["코드 블록 언어: ", ["currentLabel"], ". 클릭하여 변경하세요."],"c5rF4v": ["이 지식 베이스는 무엇에 쓰나요?"],"c863eW": [["shareBranch"], " 브랜치로 전환할 수 없습니다. 직접 전환해 보세요."],@@ -3747,6 +3747,7 @@"hFmYGU": ["연결된 테마 파일은 지원되지 않습니다"],"hGmuTc": ["#", ["tagDocsName"], " 태그가 지정된 문서"],"hHMv6l": ["블록 삭제"],+ "hHQHPX": [["label"], "에서는 격리된 앱 데이터를 사용합니다"],"hIQkLb": ["새 채팅"],"hItdtk": ["폴더 찾아보기"],"hLKfZe": ["대신 토큰 사용"],@@ -3855,7 +3856,6 @@"복사본은 독립된 실제 폴더이며, OK가 소스와 동기화합니다. 여기에서 스킬을 편집하면 모든 복사본이 새로고침됩니다. OK 외부에서 복사본을 직접 편집하는 순간 동기화가 중단됩니다. 그때부터 복사본은 별도 경로로 작동하며 별도 스킬로 표시됩니다."],"iOHg1t": ["새 탭에서 삽입된 URL 열기"],- "iRdfLr": ["개발 인스턴스: ", ["label"]],"iSLIjg": ["연결"],"iSQTsg": ["번호 매기기 목록"],"iSWh95": ["이미지 대상 \"", ["shown"], "\"이 존재하는 파일로 확인되지 않습니다."],diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.poindex 287efaa7f..dde633331 100644--- a/packages/app/src/locales/ko/messages.po+++ b/packages/app/src/locales/ko/messages.po@@ -928,6 +928,10 @@ msgstr "{label} 활성화됨"msgid "{label} problems"msgstr "문제 {label}개"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label}에서는 격리된 앱 데이터를 사용합니다"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {이 파일의 최신 편집 #개를 제거합니다.}}"@@ -2058,6 +2062,10 @@ msgstr "추가할 내용이 있나요? (선택 사항)"msgid "API key set"msgstr "API 키 설정됨"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "앱 인스턴스: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "변경 사항의 추가 전용 로그입니다."@@ -5048,14 +5056,6 @@ msgstr "감지된 OpenKnowledge 프로젝트"msgid "Detecting"msgstr "감지 중"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "개발 인스턴스: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "개발 인스턴스: {label} (다른 워크트리와 격리됨)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex 078b566f7..ce5e95294 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -3228,6 +3228,7 @@"aaI6cN": ["Ćōũĺďń'ţ ćōńńēćţ ţō ţĥē àĝēńţ śēŕvĩćē. Ḿàķē śũŕē ţĥē ŌƥēńĶńōŵĺēďĝē śēŕvēŕ ĩś ŕũńńĩńĝ àńď ũƥ ţō ďàţē (ŕēśţàŕţ ĩţ ĩƒ ĩţ ŵàś àĺŕēàďŷ ŕũńńĩńĝ), ţĥēń ţŕŷ àĝàĩń."],+ "aaiiRa": ["Ãƥƥ îńśţãńćê: ", ["label"]],"aalx4E": ["Ēďĩţĩńĝ ƀŕōķēń ḾĎX śōũŕćē: ", ["reason"]],"aatPoi": ["Ĝēńēŕàţēď ƒĩĺēś"],"abiHje": ["Ďēĺēţē śēĺēćţēď ĩţēḿś"],@@ -3322,7 +3323,6 @@"c3ZGrq": ["ţĥē ďōć ", ["0"]],"c4OLjD": ["Ĩńśţàĺĺ ƒōŕ Ćĺàũďē Ćĥàţ & Ćōŵōŕķ (ďēśķţōƥ àƥƥ)"],"c4fVUV": ["Ƒĩx"],- "c5PTFE": ["Ďēv ĩńśţàńćē: ", ["label"], " (ĩśōĺàţēď ƒŕōḿ ōţĥēŕ ŵōŕķţŕēēś)"],"c5f7sm": ["Ćōďē ƀĺōćķ ĺàńĝũàĝē: ", ["currentLabel"], ". Ćĺĩćķ ţō ćĥàńĝē."],"c5rF4v": ["Ŵĥàţ ĩś ţĥĩś ķńōŵĺēďĝē ƀàśē ƒōŕ?"],"c863eW": ["Ćōũĺď ńōţ śŵĩţćĥ ţō ", ["shareBranch"], ". Ţŕŷ śŵĩţćĥĩńĝ ḿàńũàĺĺŷ."],@@ -3885,6 +3885,7 @@"hFmYGU": ["Ĺĩńķēď ţĥēḿē ƒĩĺēś àŕēń’ţ śũƥƥōŕţēď"],"hGmuTc": ["Ďōćś ţàĝĝēď #", ["tagDocsName"]],"hHMv6l": ["Ďēĺēţē ƀĺōćķ"],+ "hHQHPX": [["label"], " ûśêś îśõĺãţêď ãƥƥ ďãţã"],"hIQkLb": ["Ńēŵ ćĥàţ"],"hItdtk": ["ßŕōŵśē ƒōĺďēŕ"],"hLKfZe": ["Ũśē à ţōķēń ĩńśţēàď"],@@ -3996,7 +3997,6 @@"À ćōƥŷ ĩś à ŕēàĺ ƒōĺďēŕ ōƒ ĩţś ōŵń, àńď ŌĶ ķēēƥś ĩţ ĩń śţēƥ ŵĩţĥ ţĥē śōũŕćē: ēďĩţ ţĥē śķĩĺĺ ĥēŕē àńď ēvēŕŷ ćōƥŷ ĩś ŕēƒŕēśĥēď. Ţĥàţ śţōƥś ţĥē ḿōḿēńţ ŷōũ ĥàńď-ēďĩţ à ćōƥŷ ōũţśĩďē ŌĶ — ƒŕōḿ ţĥēń ōń ĩţ ĝōēś ĩţś ōŵń ŵàŷ àńď śĥōŵś ũƥ àś à śēƥàŕàţē śķĩĺĺ."],"iOHg1t": ["Ōƥēń ēḿƀēďďēď ŨŔĹ ĩń ńēŵ ţàƀ"],- "iRdfLr": ["Ďēv ĩńśţàńćē: ", ["label"]],"iSLIjg": ["Ćōńńēćţ"],"iSQTsg": ["Ōŕďēŕēď ĺĩśţ"],"iSWh95": ["Ĩḿàĝē ţàŕĝēţ \"", ["shown"], "\" ďōēś ńōţ ŕēśōĺvē ţō àń ēxĩśţĩńĝ ƒĩĺē."],diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex 784444aad..3ae1a5bb6 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -928,6 +928,10 @@ msgstr ""msgid "{label} problems"msgstr ""+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} ûsês îsõlãtêd ãpp dãtã"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr ""@@ -2054,6 +2058,10 @@ msgstr ""msgid "API key set"msgstr ""+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "Ãpp înstãncê: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr ""@@ -5044,14 +5052,6 @@ msgstr ""msgid "Detecting"msgstr ""-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr ""--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr ""-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr ""diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.jsonindex d494956f1..8fb0751a5 100644--- a/packages/app/src/locales/pt-BR/messages.json+++ b/packages/app/src/locales/pt-BR/messages.json@@ -3666,6 +3666,7 @@"aaI6cN": ["Não deu para conectar ao serviço de agentes. Confira se o servidor do OpenKnowledge está rodando e atualizado (reinicie se já estava rodando) e tente de novo."],+ "aaiiRa": ["Instância do aplicativo: ", ["label"]],"aalx4E": ["Editando código MDX quebrado: ", ["reason"]],"aatPoi": ["Arquivos gerados"],"abiHje": ["Excluir os itens selecionados"],@@ -3781,7 +3782,6 @@"c3ZGrq": ["o documento ", ["0"]],"c4OLjD": ["Instalar para o Claude Chat e o Cowork (aplicativo de desktop)"],"c4fVUV": ["Corrigir"],- "c5PTFE": ["Instância de desenvolvimento: ", ["label"], " (isolada de outros worktrees)"],"c5f7sm": ["Linguagem do bloco de código: ", ["currentLabel"], ". Clique para alterar."],"c5rF4v": ["Para que serve esta base de conhecimento?"],"c863eW": ["Não foi possível mudar para ", ["shareBranch"], ". Tente mudar manualmente."],@@ -4435,6 +4435,7 @@"hFmYGU": ["Arquivos de tema vinculados não são compatíveis"],"hGmuTc": ["Documentos com a tag #", ["tagDocsName"]],"hHMv6l": ["Excluir o bloco"],+ "hHQHPX": [["label"], " usa dados isolados do aplicativo"],"hIQkLb": ["Novo chat"],"hItdtk": ["Escolher pasta"],"hLKfZe": ["Usar um token em vez disso"],@@ -4560,7 +4561,6 @@"Uma cópia é uma pasta de verdade, e o OK a mantém em sintonia com a fonte: edite a habilidade aqui e todas as cópias são atualizadas. Isso para no momento em que você edita uma cópia à mão fora do OK — a partir daí ela segue seu próprio caminho e aparece como uma habilidade separada."],"iOHg1t": ["Abrir a URL incorporada em uma nova aba"],- "iRdfLr": ["Instância de desenvolvimento: ", ["label"]],"iSLIjg": ["Conectar"],"iSQTsg": ["Lista ordenada"],"iSWh95": ["O destino da imagem \"", ["shown"], "\" não corresponde a um arquivo existente."],diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.poindex 730507f86..8f5d13929 100644--- a/packages/app/src/locales/pt-BR/messages.po+++ b/packages/app/src/locales/pt-BR/messages.po@@ -928,6 +928,10 @@ msgstr "{label} ativado"msgid "{label} problems"msgstr "{label} problemas"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} usa dados isolados do aplicativo"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Remove # edição mais recente deste arquivo.} many {Remove # edições mais recentes deste arquivo.} other {Remove # edições mais recentes deste arquivo.}}"@@ -2054,6 +2058,10 @@ msgstr "Quer acrescentar alguma coisa? (opcional)"msgid "API key set"msgstr "Chave de API definida"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "Instância do aplicativo: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "Log somente de acréscimo com o que mudou."@@ -5044,14 +5052,6 @@ msgstr "Projetos do OpenKnowledge detectados"msgid "Detecting"msgstr "Detectando"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "Instância de desenvolvimento: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "Instância de desenvolvimento: {label} (isolada de outros worktrees)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.jsonindex 96c2abf84..a24394f03 100644--- a/packages/app/src/locales/ur/messages.json+++ b/packages/app/src/locales/ur/messages.json@@ -3300,6 +3300,7 @@"aaI6cN": ["ایجنٹ سروس سے رابطہ نہیں ہو سکا۔ یقینی بنائیں کہ OpenKnowledge سرور چل رہا ہے اور تازہ ترین ہے (اگر پہلے سے چل رہا تھا تو اسے دوبارہ چلائیں)، پھر دوبارہ کوشش کریں۔"],+ "aaiiRa": ["ایپ انسٹینس: ", ["label"]],"aalx4E": ["ٹوٹے ہوئے MDX سورس میں ترمیم: ", ["reason"]],"aatPoi": ["تیار کردہ فائلیں۔"],"abiHje": ["منتخب آئٹمز حذف کریں"],@@ -3408,7 +3409,6 @@"c3ZGrq": ["دستاویز ", ["0"]],"c4OLjD": ["Claude Chat اور Cowork کے لیے انسٹال کریں (ڈیسک ٹاپ ایپ)"],"c4fVUV": ["ٹھیک کریں"],- "c5PTFE": ["ڈیو انسٹینس: ", ["label"], " (دیگر ورک ٹریز سے الگ)"],"c5f7sm": ["کوڈ بلاک کی زبان: ", ["currentLabel"], "۔ تبدیل کرنے کے لیے کلک کریں۔"],"c5rF4v": ["یہ نالج بیس کس لیے ہے؟"],"c863eW": [["shareBranch"], " پر تبدیل نہیں ہو سکا۔ دستی طور پر تبدیل کرنے کی کوشش کریں۔"],@@ -3968,6 +3968,7 @@"hFmYGU": ["منسلک تھیم فائلوں کی معاونت نہیں ہے"],"hGmuTc": ["#", ["tagDocsName"], " سے ٹیگ شدہ دستاویزات"],"hHMv6l": ["بلاک حذف کریں"],+ "hHQHPX": [["label"], " علیحدہ ایپ ڈیٹا استعمال کرتا ہے"],"hIQkLb": ["نئی گفتگو"],"hItdtk": ["فولڈر براؤز کریں"],"hLKfZe": ["اس کے بجائے ٹوکن استعمال کریں"],@@ -4082,7 +4083,6 @@"نقل اپنا الگ حقیقی فولڈر ہوتی ہے، اور OK اسے ماخذ کے ساتھ ہم آہنگ رکھتا ہے: یہاں مہارت میں ترمیم کریں اور ہر نقل تازہ ہو جاتی ہے۔ یہ اسی لمحے رک جاتا ہے جب آپ OK سے باہر کسی نقل میں ہاتھ سے ترمیم کر دیں — اس کے بعد وہ اپنی راہ چلتی ہے اور الگ مہارت کے طور پر ظاہر ہوتی ہے۔"],"iOHg1t": ["شامل کیا گیا URL نئے ٹیب میں کھولیں"],- "iRdfLr": ["ڈیو انسٹینس: ", ["label"]],"iSLIjg": ["منسلک کریں"],"iSQTsg": ["مرتب فہرست"],"iSWh95": ["تصویر کا ہدف \"", ["shown"], "\" کسی موجودہ فائل کی طرف اشارہ نہیں کرتا۔"],diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.poindex a0238656d..61f0590eb 100644--- a/packages/app/src/locales/ur/messages.po+++ b/packages/app/src/locales/ur/messages.po@@ -928,6 +928,10 @@ msgstr "{label} فعال"msgid "{label} problems"msgstr "{label} مسائل"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} علیحدہ ایپ ڈیٹا استعمال کرتا ہے"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {اس فائل پر # نئی ترمیم ہٹاتا ہے۔} other {اس فائل پر # نئی ترامیم ہٹاتا ہے۔}}"@@ -2058,6 +2062,10 @@ msgstr "کچھ اور شامل کرنا چاہیں گے؟ (اختیاری)"msgid "API key set"msgstr "API کلید مقرر ہے"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "ایپ انسٹینس: {label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "کیا بدلا اس کا صرف اضافے والا لاگ۔"@@ -5048,14 +5056,6 @@ msgstr "پائے گئے OpenKnowledge پروجیکٹس"msgid "Detecting"msgstr "پتا لگایا جا رہا ہے"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "ڈیو انسٹینس: {label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "ڈیو انسٹینس: {label} (دیگر ورک ٹریز سے الگ)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.jsonindex af3a1acf2..e8f52d014 100644--- a/packages/app/src/locales/zh-Hans/messages.json+++ b/packages/app/src/locales/zh-Hans/messages.json@@ -2837,6 +2837,7 @@"aaI6cN": ["无法连接到智能体服务。请确认 OpenKnowledge 服务器正在运行且为最新版本(如果它已在运行,请重启),然后重试。"],+ "aaiiRa": ["应用实例:", ["label"]],"aalx4E": ["正在编辑损坏的 MDX 源码:", ["reason"]],"aatPoi": ["生成的文件"],"abiHje": ["删除选中的项目"],@@ -2925,7 +2926,6 @@"c3ZGrq": ["文档 ", ["0"]],"c4OLjD": ["为 Claude Chat 和 Cowork 安装(桌面应用)"],"c4fVUV": ["修复"],- "c5PTFE": ["开发实例:", ["label"], "(与其他 worktree 隔离)"],"c5f7sm": ["代码块语言:", ["currentLabel"], "。点击可更改。"],"c5rF4v": ["这个知识库是做什么用的?"],"c863eW": ["无法切换到 ", ["shareBranch"], "。请尝试手动切换。"],@@ -3393,6 +3393,7 @@"hFmYGU": ["不支持链接的主题文件"],"hGmuTc": ["带 #", ["tagDocsName"], " 标签的文档"],"hHMv6l": ["删除块"],+ "hHQHPX": [["label"], " 使用隔离的应用数据"],"hIQkLb": ["新建对话"],"hItdtk": ["浏览文件夹"],"hLKfZe": ["改用令牌"],@@ -3492,7 +3493,6 @@"副本是一个独立的真实文件夹,OK 会让它与来源保持一致:在这里编辑技能,每个副本都会同步更新。一旦你在 OK 之外手动改动某个副本,同步就会停止——从那时起它就自成一份,并显示为一个单独的技能。"],"iOHg1t": ["在新标签页中打开嵌入的 URL"],- "iRdfLr": ["开发实例:", ["label"]],"iSLIjg": ["连接"],"iSQTsg": ["有序列表"],"iSWh95": ["图片目标“", ["shown"], "”未指向现有文件。"],diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.poindex 209dbbfa5..d8c622e53 100644--- a/packages/app/src/locales/zh-Hans/messages.po+++ b/packages/app/src/locales/zh-Hans/messages.po@@ -928,6 +928,10 @@ msgstr "已启用 {label}"msgid "{label} problems"msgstr "{label} 个问题"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} 使用隔离的应用数据"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {会移除这个文件上 # 处较新的编辑。}}"@@ -2058,6 +2062,10 @@ msgstr "还有什么想补充的吗?(可选)"msgid "API key set"msgstr "API 密钥已设置"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "应用实例:{label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "记录改动内容的只追加日志。"@@ -5048,14 +5056,6 @@ msgstr "检测到的 OpenKnowledge 项目"msgid "Detecting"msgstr "正在检测"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "开发实例:{label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "开发实例:{label}(与其他 worktree 隔离)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.jsonindex 5425ebb13..7966704c2 100644--- a/packages/app/src/locales/zh-Hant/messages.json+++ b/packages/app/src/locales/zh-Hant/messages.json@@ -2855,6 +2855,7 @@"aaI6cN": ["無法連接到代理服務。請確認 OpenKnowledge 伺服器正在執行而且是最新版本(如果它已經在執行,請重新啟動),然後再試一次。"],+ "aaiiRa": ["應用程式實例:", ["label"]],"aalx4E": ["正在編輯壞掉的 MDX 原始碼:", ["reason"]],"aatPoi": ["產生的文件"],"abiHje": ["刪除選取的項目"],@@ -2943,7 +2944,6 @@"c3ZGrq": ["文件 ", ["0"]],"c4OLjD": ["為 Claude Chat 和 Cowork 安裝(桌面應用程式)"],"c4fVUV": ["修正"],- "c5PTFE": ["開發執行個體:", ["label"], "(與其他 worktree 隔離)"],"c5f7sm": ["程式碼區塊語言:", ["currentLabel"], "。點一下可變更。"],"c5rF4v": ["這個知識庫是要做什麼用的?"],"c863eW": ["無法切換到 ", ["shareBranch"], "。請試著手動切換。"],@@ -3415,6 +3415,7 @@"hFmYGU": ["不支援連結的主題檔案"],"hGmuTc": ["標了 #", ["tagDocsName"], " 的文件"],"hHMv6l": ["刪除區塊"],+ "hHQHPX": [["label"], " 使用隔離的應用程式資料"],"hIQkLb": ["新對話"],"hItdtk": ["瀏覽資料夾"],"hLKfZe": ["改用權杖"],@@ -3510,7 +3511,6 @@"副本是一個獨立的真實資料夾,OK 會讓它與來源保持同步:在這裡編輯技能,每個副本都會跟著更新。一旦你在 OK 之外手動改動某個副本,同步就會停止——從那時起它就自成一份,並顯示為另一個技能。"],"iOHg1t": ["在新分頁中開啟嵌入的 URL"],- "iRdfLr": ["開發執行個體:", ["label"]],"iSLIjg": ["連接"],"iSQTsg": ["編號清單"],"iSWh95": ["圖片目標「", ["shown"], "」未指向現有檔案。"],diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.poindex 4bd012e07..dba66709d 100644--- a/packages/app/src/locales/zh-Hant/messages.po+++ b/packages/app/src/locales/zh-Hant/messages.po@@ -928,6 +928,10 @@ msgstr "已啟用 {label}"msgid "{label} problems"msgstr "{label} 個問題"+#: src/components/InstanceBadge.tsx+msgid "{label} uses isolated app data"+msgstr "{label} 使用隔離的應用程式資料"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {會移除這個檔案上 # 處較新的編輯。}}"@@ -2058,6 +2062,10 @@ msgstr "還有什麼想補充的嗎?(選填)"msgid "API key set"msgstr "API 金鑰已設定"+#: src/components/InstanceBadge.tsx+msgid "App instance: {label}"+msgstr "應用程式實例:{label}"+#: src/components/CreatedItemsList.tsxmsgid "Append-only log of what changed."msgstr "記錄變更內容的唯附加記錄檔。"@@ -5048,14 +5056,6 @@ msgstr "偵測到的 OpenKnowledge 專案"msgid "Detecting"msgstr "正在偵測"-#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label}"-msgstr "開發執行個體:{label}"--#: src/components/InstanceBadge.tsx-msgid "Dev instance: {label} (isolated from other worktrees)"-msgstr "開發執行個體:{label}(與其他 worktree 隔離)"-#: src/components/ExploreSkills.tsxmsgid "DevOps"msgstr "DevOps"diff --git a/packages/cli/src/commands/desktop-dispatch.test.ts b/packages/cli/src/commands/desktop-dispatch.test.tsindex 1b5b7fa14..9dc6a520f 100644--- a/packages/cli/src/commands/desktop-dispatch.test.ts+++ b/packages/cli/src/commands/desktop-dispatch.test.ts@@ -26,6 +26,9 @@ function statForFile(path: string): DetectDeps['statSync'] {const APP_EXEC = '/Applications/OpenKnowledge.app/Contents/MacOS/OpenKnowledge';const HOME_EXEC = '/Users/andrew/Applications/OpenKnowledge.app/Contents/MacOS/OpenKnowledge';+const BETA_APP_EXEC = '/Applications/OpenKnowledge Beta.app/Contents/MacOS/OpenKnowledge Beta';+const HOME_BETA_APP_EXEC =+ '/Users/andrew/Applications/OpenKnowledge Beta.app/Contents/MacOS/OpenKnowledge Beta';describe('detectDesktop — platform gate (FR10)', () => {test('unknown platform → unsupported-platform', () => {@@ -49,7 +52,10 @@ describe('detectDesktop — platform gate (FR10)', () => {describe('detectDesktop — Windows/Linux install resolution', () => {const WIN_EXE ='C:\\Users\\u\\AppData\\Local\\Programs\\@inkeepopen-knowledge-desktop\\OpenKnowledge.exe';+ const BETA_WIN_EXE =+ 'C:\\Users\\u\\AppData\\Local\\Programs\\openknowledge-beta-desktop\\OpenKnowledge Beta.exe';const DEB_EXE = '/opt/OpenKnowledge/openknowledge';+ const BETA_DEB_EXE = '/opt/OpenKnowledge Beta/openknowledge-beta';test('win32: %LOCALAPPDATA% per-user install → available', () => {const result = detectDesktop(@@ -74,6 +80,17 @@ describe('detectDesktop — Windows/Linux install resolution', () => {expect(result).toEqual({ available: true, reason: 'available', bundlePath: WIN_EXE });});+ test('win32: Beta per-user install → available', () => {+ const result = detectDesktop(+ baseDeps({+ platform: 'win32',+ env: { LOCALAPPDATA: 'C:\\Users\\u\\AppData\\Local' },+ statSync: statForFile(BETA_WIN_EXE),+ }),+ );+ expect(result).toEqual({ available: true, reason: 'available', bundlePath: BETA_WIN_EXE });+ });+test('linux: deb install at /opt → available (with a display)', () => {const result = detectDesktop(baseDeps({@@ -91,6 +108,17 @@ describe('detectDesktop — Windows/Linux install resolution', () => {);expect(result).toEqual({ available: false, reason: 'headless', bundlePath: DEB_EXE });});++ test('linux: Beta deb install at /opt → available', () => {+ const result = detectDesktop(+ baseDeps({+ platform: 'linux',+ env: { DISPLAY: ':0' },+ statSync: statForFile(BETA_DEB_EXE),+ }),+ );+ expect(result).toEqual({ available: true, reason: 'available', bundlePath: BETA_DEB_EXE });+ });});describe('detectDesktop — bundle resolution (FR10 D2 a/b/c)', () => {@@ -107,6 +135,23 @@ describe('detectDesktop — bundle resolution (FR10 D2 a/b/c)', () => {expect(result.bundlePath).toBe('/Users/andrew/Applications/OpenKnowledge.app');});+ test('darwin + only Beta in /Applications → available', () => {+ const result = detectDesktop(baseDeps({ statSync: statForFile(BETA_APP_EXEC) }));+ expect(result).toEqual({+ available: true,+ reason: 'available',+ bundlePath: '/Applications/OpenKnowledge Beta.app',+ });+ });++ test('darwin prefers Stable across install locations when both products exist', () => {+ const installed = new Set([APP_EXEC, HOME_BETA_APP_EXEC]);+ const result = detectDesktop(+ baseDeps({ statSync: (path) => (installed.has(path) ? { isFile: () => true } : null) }),+ );+ expect(result.bundlePath).toBe('/Applications/OpenKnowledge.app');+ });+test('darwin + no bundle → no-bundle', () => {const result = detectDesktop(baseDeps());expect(result).toEqual({ available: false, reason: 'no-bundle' });@@ -303,7 +348,7 @@ describe('detectDesktop — headless gate (FR9 — CI is intentionally NOT a tri});describe('launchDesktop — spawn shape (FR11)', () => {- test('spawns open with -b <bundle-id>, detached, stdio:ignore, unref()', () => {+ test('spawns open with the detected bundle path, detached, stdio:ignore, unref()', () => {let captured: { command?: string; args?: readonly string[]; opts?: SpawnOptions } = {};let unrefCalled = false;@@ -318,10 +363,13 @@ describe('launchDesktop — spawn shape (FR11)', () => {}) as unknown as Parameters<typeof launchDesktop>[0]['spawn'];let logged = '';- launchDesktop({ spawn: fakeSpawn, log: (m) => (logged = m), platform: 'darwin' });+ launchDesktop(+ { spawn: fakeSpawn, log: (m) => (logged = m), platform: 'darwin' },+ { available: true, reason: 'available', bundlePath: '/Applications/OpenKnowledge Beta.app' },+ );expect(captured.command).toBe('open');- expect(captured.args).toEqual(['-b', DESKTOP_BUNDLE_ID]);+ expect(captured.args).toEqual(['-a', '/Applications/OpenKnowledge Beta.app']);expect(captured.opts?.detached).toBe(true);expect(captured.opts?.stdio).toBe('ignore');expect(unrefCalled).toBe(true);@@ -370,7 +418,10 @@ describe('launchDesktop — spawn shape (FR11)', () => {return { unref: () => {} };}) as unknown as Parameters<typeof launchDesktop>[0]['spawn'];- launchDesktop({ spawn: fakeSpawn, log: () => {}, platform: 'darwin' });+ launchDesktop(+ { spawn: fakeSpawn, log: () => {}, platform: 'darwin' },+ { available: true, reason: 'available', bundlePath: '/Applications/OpenKnowledge.app' },+ );expect(captured.opts?.env).toBeDefined();expect(captured.opts?.env).not.toHaveProperty('ELECTRON_RUN_AS_NODE');diff --git a/packages/cli/src/commands/desktop-dispatch.ts b/packages/cli/src/commands/desktop-dispatch.tsindex 872fd9b5b..71199aec4 100644--- a/packages/cli/src/commands/desktop-dispatch.ts+++ b/packages/cli/src/commands/desktop-dispatch.ts@@ -2,13 +2,16 @@ import type { spawn as NativeSpawn } from 'node:child_process';import { statSync } from 'node:fs';import { homedir } from 'node:os';import { join, win32 } from 'node:path';+import {+ DESKTOP_PRODUCTS,+ desktopWindowsExecutableName,+ desktopWindowsInstallDirNames,+} from '@inkeep/open-knowledge-core';import { spawnDetachedScrubbed } from '../utils/detached-spawn.ts';-export const DESKTOP_BUNDLE_ID = 'com.inkeep.open-knowledge';+export const DESKTOP_BUNDLE_ID = DESKTOP_PRODUCTS.stable.appId;-const DESKTOP_BUNDLE_NAME = 'OpenKnowledge.app';--const APPLICATIONS_BUNDLE_PATH = `/Applications/${DESKTOP_BUNDLE_NAME}`;+const DESKTOP_PRODUCT_LIST = [DESKTOP_PRODUCTS.stable, DESKTOP_PRODUCTS.beta] as const;type DetectReason =| 'available'@@ -60,23 +63,19 @@ function resolveBundlePath(deps: DetectDeps): string | null {}}- if (probeBundle(deps, APPLICATIONS_BUNDLE_PATH)) {- return APPLICATIONS_BUNDLE_PATH;- }-const home = deps.homeDir ?? homedir();- const userBundlePath = join(home, 'Applications', DESKTOP_BUNDLE_NAME);- if (probeBundle(deps, userBundlePath)) {- return userBundlePath;+ for (const product of DESKTOP_PRODUCT_LIST) {+ for (const applicationsDir of [join(home, 'Applications'), '/Applications']) {+ const bundlePath = join(applicationsDir, `${product.productName}.app`);+ if (probeExecutable(deps, join(bundlePath, 'Contents', 'MacOS', product.productName))) {+ return bundlePath;+ }+ }}return null;}-function probeBundle(deps: DetectDeps, bundlePath: string): boolean {- return probeExecutable(deps, join(bundlePath, 'Contents', 'MacOS', 'OpenKnowledge'));-}-function probeExecutable(deps: DetectDeps, path: string): boolean {try {const meta = deps.statSync(path);@@ -87,28 +86,43 @@ function probeExecutable(deps: DetectDeps, path: string): boolean {}}-const WIN_INSTALL_DIR_NAMES = ['@inkeepopen-knowledge-desktop', 'OpenKnowledge'] as const;-function resolveWindowsExecutable(deps: DetectDeps): string | null {- if (deps.env.ELECTRON_RUN_AS_NODE === '1' && /\\OpenKnowledge\.exe$/i.test(deps.execPath)) {- return deps.execPath;+ if (deps.env.ELECTRON_RUN_AS_NODE === '1') {+ const bundledProduct = DESKTOP_PRODUCT_LIST.find((product) =>+ deps.execPath+ .toLowerCase()+ .endsWith(`\\${desktopWindowsExecutableName(product).toLowerCase()}`),+ );+ if (bundledProduct) return deps.execPath;}const localAppData = deps.env.LOCALAPPDATA;if (localAppData) {- for (const dirName of WIN_INSTALL_DIR_NAMES) {- const exe = win32.join(localAppData, 'Programs', dirName, 'OpenKnowledge.exe');- if (probeExecutable(deps, exe)) return exe;+ for (const product of DESKTOP_PRODUCT_LIST) {+ for (const dirName of desktopWindowsInstallDirNames(product)) {+ const exe = win32.join(+ localAppData,+ 'Programs',+ dirName,+ desktopWindowsExecutableName(product),+ );+ if (probeExecutable(deps, exe)) return exe;+ }}}return null;}function resolveLinuxExecutable(deps: DetectDeps): string | null {- if (deps.env.ELECTRON_RUN_AS_NODE === '1' && deps.execPath.endsWith('/openknowledge')) {- return deps.execPath;+ if (deps.env.ELECTRON_RUN_AS_NODE === '1') {+ const bundledProduct = DESKTOP_PRODUCT_LIST.find((product) =>+ deps.execPath.endsWith(`/${product.linuxExecutableName}`),+ );+ if (bundledProduct) return deps.execPath;+ }+ for (const product of DESKTOP_PRODUCT_LIST) {+ const debExe = `/opt/${product.productName}/${product.linuxExecutableName}`;+ if (probeExecutable(deps, debExe)) return debExe;}- const debExe = '/opt/OpenKnowledge/openknowledge';- if (probeExecutable(deps, debExe)) return debExe;return null;}@@ -166,15 +180,15 @@ export function launchDesktop(deps: LaunchDeps, detection?: DetectResult): voidlog('Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)',);- if (platform === 'darwin') {- spawnDetachedScrubbed('open', ['-b', DESKTOP_BUNDLE_ID], { spawn: deps.spawn });- return;- }const target = detection?.bundlePath;if (!target) {log('Desktop launch skipped: no resolved desktop executable (caller bug).');return;}+ if (platform === 'darwin') {+ spawnDetachedScrubbed('open', ['-a', target], { spawn: deps.spawn });+ return;+ }spawnDetachedScrubbed(target, [], { spawn: deps.spawn });}diff --git a/packages/cli/src/commands/uninstall.test.ts b/packages/cli/src/commands/uninstall.test.tsindex f5de6af1f..032dc5455 100644--- a/packages/cli/src/commands/uninstall.test.ts+++ b/packages/cli/src/commands/uninstall.test.ts@@ -37,6 +37,26 @@ describe('detectInstallMethods', () => {}});+ test('reports Stable and Beta app bundles separately on macOS', () => {+ const home = '/Users/jane';+ const installed = new Set([+ '/Applications/OpenKnowledge.app',+ join(home, 'Applications', 'OpenKnowledge Beta.app'),+ ]);+ const methods = detectInstallMethods(+ home,+ undefined,+ () => null,+ (path) => installed.has(path),+ { platform: 'darwin' },+ );+ expect(methods).toHaveLength(2);+ expect(methods.map((method) => method.label)).toEqual([+ 'OpenKnowledge (/Applications/OpenKnowledge.app)',+ 'OpenKnowledge Beta (/Users/jane/Applications/OpenKnowledge Beta.app)',+ ]);+ });+test('detects the Windows NSIS install and points at Settings → Apps', () => {const localAppData = 'C:\\Users\\Jane\\AppData\\Local';const exe = join(@@ -59,6 +79,26 @@ describe('detectInstallMethods', () => {expect(methods[0]?.instruction).toContain('Settings');});+ test('reports Stable and Beta Windows installs separately', () => {+ const localAppData = 'C:\\Users\\Jane\\AppData\\Local';+ const installed = new Set([+ join(localAppData, 'Programs', '@inkeepopen-knowledge-desktop', 'OpenKnowledge.exe'),+ join(localAppData, 'Programs', 'openknowledge-beta-desktop', 'OpenKnowledge Beta.exe'),+ ]);+ const methods = detectInstallMethods(+ 'C:\\Users\\Jane',+ undefined,+ () => null,+ (path) => installed.has(path),+ { platform: 'win32', env: { LOCALAPPDATA: localAppData } },+ );+ expect(methods).toHaveLength(2);+ expect(methods.map((method) => method.label)).toEqual([+ expect.stringContaining('OpenKnowledge ('),+ expect.stringContaining('OpenKnowledge Beta ('),+ ]);+ });+test('detects the Linux deb/rpm install and names both package managers', () => {const methods = detectInstallMethods('/home/jane',@@ -72,6 +112,24 @@ describe('detectInstallMethods', () => {expect(methods[0]?.instruction).toContain('dnf remove OpenKnowledge');});+ test('reports the Beta Linux install by product name', () => {+ const methods = detectInstallMethods(+ '/home/jane',+ undefined,+ () => null,+ (path) => path === '/opt/OpenKnowledge Beta/openknowledge-beta',+ { platform: 'linux' },+ );+ expect(methods).toEqual([+ {+ method: 'app',+ label: 'OpenKnowledge Beta (/opt/OpenKnowledge Beta)',+ instruction:+ 'Remove with your package manager: sudo apt remove openknowledge-beta-desktop (Debian/Ubuntu) or sudo dnf remove openknowledge-beta-desktop (Fedora/RHEL)',+ },+ ]);+ });+test('returns nothing when no install is detected', () => {const home = mkdtempSync(join(tmpdir(), 'ok-detect-'));try {diff --git a/packages/cli/src/commands/uninstall.ts b/packages/cli/src/commands/uninstall.tsindex 223a875b1..9190f8d71 100644--- a/packages/cli/src/commands/uninstall.ts+++ b/packages/cli/src/commands/uninstall.ts@@ -2,6 +2,11 @@ import { execFileSync } from 'node:child_process';import { existsSync } from 'node:fs';import { homedir } from 'node:os';import { join, resolve } from 'node:path';+import {+ DESKTOP_PRODUCTS,+ desktopWindowsExecutableName,+ desktopWindowsInstallDirNames,+} from '@inkeep/open-knowledge-core';import { findEnclosingProjectRoot, withHiddenWindowsConsole } from '@inkeep/open-knowledge-server';import checkbox from '@inquirer/checkbox';import { Command } from 'commander';@@ -31,11 +36,7 @@ export interface InstallMethod {instruction: string;}-const WINDOWS_APP_REMOVAL =- 'Uninstall from Windows Settings → Apps → Installed apps → OpenKnowledge';--const LINUX_APP_REMOVAL =- 'Remove with your package manager: sudo apt remove openknowledge (Debian/Ubuntu) or sudo dnf remove OpenKnowledge (Fedora/RHEL)';+const DESKTOP_PRODUCT_LIST = [DESKTOP_PRODUCTS.stable, DESKTOP_PRODUCTS.beta] as const;export function detectInstallMethods(home: string,@@ -49,40 +50,51 @@ export function detectInstallMethods(const env = opts.env ?? process.env;if (platform === 'darwin') {- for (const app of [- '/Applications/OpenKnowledge.app',- join(home, 'Applications', 'OpenKnowledge.app'),- ]) {- if (exists(app)) {- methods.push({- method: 'app',- label: `OK Desktop (${app})`,- instruction: `Move ${app} to the Trash (or: rm -rf "${app}")`,- });+ for (const product of DESKTOP_PRODUCT_LIST) {+ for (const applicationsDir of ['/Applications', join(home, 'Applications')]) {+ const app = join(applicationsDir, `${product.productName}.app`);+ if (exists(app)) {+ methods.push({+ method: 'app',+ label: `${product.productName} (${app})`,+ instruction: `Move ${app} to the Trash (or: rm -rf "${app}")`,+ });+ }}}} else if (platform === 'win32') {const localAppData = env.LOCALAPPDATA;if (localAppData) {- for (const dirName of ['@inkeepopen-knowledge-desktop', 'OpenKnowledge']) {- const exe = join(localAppData, 'Programs', dirName, 'OpenKnowledge.exe');- if (exists(exe)) {- methods.push({- method: 'app',- label: `OK Desktop (${exe})`,- instruction: WINDOWS_APP_REMOVAL,- });- break;+ for (const product of DESKTOP_PRODUCT_LIST) {+ for (const dirName of desktopWindowsInstallDirNames(product)) {+ const exe = join(+ localAppData,+ 'Programs',+ dirName,+ desktopWindowsExecutableName(product),+ );+ if (exists(exe)) {+ methods.push({+ method: 'app',+ label: `${product.productName} (${exe})`,+ instruction: `Uninstall from Windows Settings → Apps → Installed apps → ${product.productName}`,+ });+ break;+ }}}}} else if (platform === 'linux') {- if (exists('/opt/OpenKnowledge/openknowledge')) {- methods.push({- method: 'app',- label: 'OK Desktop (/opt/OpenKnowledge)',- instruction: LINUX_APP_REMOVAL,- });+ for (const product of DESKTOP_PRODUCT_LIST) {+ const installDir = `/opt/${product.productName}`;+ if (exists(join(installDir, product.linuxExecutableName))) {+ const { deb: debPackageName, rpm: rpmPackageName } = product.linuxPackageNames;+ methods.push({+ method: 'app',+ label: `${product.productName} (${installDir})`,+ instruction: `Remove with your package manager: sudo apt remove ${debPackageName} (Debian/Ubuntu) or sudo dnf remove ${rpmPackageName} (Fedora/RHEL)`,+ });+ }}}diff --git a/packages/cli/src/mcp/bundle-proxy.test.ts b/packages/cli/src/mcp/bundle-proxy.test.tsindex c40354c96..102f869f6 100644--- a/packages/cli/src/mcp/bundle-proxy.test.ts+++ b/packages/cli/src/mcp/bundle-proxy.test.ts@@ -9,6 +9,9 @@ import {const userBundle = '/Users/alice/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh';const systemBundle = '/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh';+const userBetaBundle =+ '/Users/alice/Applications/OpenKnowledge Beta.app/Contents/Resources/cli/bin/ok.sh';+const systemBetaBundle = '/Applications/OpenKnowledge Beta.app/Contents/Resources/cli/bin/ok.sh';describe('findBundledOkPath', () => {test('returns the user-local bundle before /Applications', () => {@@ -24,6 +27,26 @@ describe('findBundledOkPath', () => {).toBe(systemBundle);});+ test('returns Beta from user or system Applications when Stable is absent', () => {+ expect(+ findBundledOkPath('darwin', '/Users/alice', {+ existsSync: (p) => p === userBetaBundle,+ }),+ ).toBe(userBetaBundle);+ expect(+ findBundledOkPath('darwin', '/Users/alice', {+ existsSync: (p) => p === systemBetaBundle,+ }),+ ).toBe(systemBetaBundle);+ });++ test('prefers Stable across install locations when both products exist', () => {+ const seen = new Set([systemBundle, userBetaBundle]);+ expect(findBundledOkPath('darwin', '/Users/alice', { existsSync: (p) => seen.has(p) })).toBe(+ systemBundle,+ );+ });+test('returns null for absent bundles and non-macOS platforms', () => {expect(findBundledOkPath('darwin', '/Users/alice', { existsSync: () => false })).toBeNull();expect(findBundledOkPath('linux', '/Users/alice', { existsSync: () => true })).toBeNull();diff --git a/packages/cli/src/mcp/bundle-proxy.ts b/packages/cli/src/mcp/bundle-proxy.tsindex 3d7324151..11b484096 100644--- a/packages/cli/src/mcp/bundle-proxy.ts+++ b/packages/cli/src/mcp/bundle-proxy.ts@@ -1,5 +1,6 @@import { spawn } from 'node:child_process';import { join } from 'node:path';+import { DESKTOP_PRODUCTS } from '@inkeep/open-knowledge-core';type BundleProxySuppression = 'env' | 'flag' | 'platform' | 'self' | null;@@ -28,10 +29,12 @@ export function findBundledOkPath(fs: { existsSync(p: string): boolean },): string | null {if (platform !== 'darwin') return null;- const candidates = [- join(home, 'Applications', 'OpenKnowledge.app', BUNDLE_RELATIVE_OK),- join('/Applications', 'OpenKnowledge.app', BUNDLE_RELATIVE_OK),- ];+ const products = [DESKTOP_PRODUCTS.stable, DESKTOP_PRODUCTS.beta] as const;+ const candidates = products.flatMap((product) =>+ [join(home, 'Applications'), '/Applications'].map((applicationsDir) =>+ join(applicationsDir, `${product.productName}.app`, BUNDLE_RELATIVE_OK),+ ),+ );return candidates.find((candidate) => fs.existsSync(candidate)) ?? null;}diff --git a/packages/core/src/constants/product.ts b/packages/core/src/constants/product.tsindex 7461b2fff..824f0df45 100644--- a/packages/core/src/constants/product.ts+++ b/packages/core/src/constants/product.ts@@ -1 +1,35 @@-export const PRODUCT_NAME = 'OpenKnowledge';+export const DESKTOP_PRODUCTS = {+ stable: {+ appId: 'com.inkeep.open-knowledge',+ productName: 'OpenKnowledge',+ packageName: '@inkeep/open-knowledge-desktop',+ linuxExecutableName: 'openknowledge',+ linuxPackageNames: {+ deb: 'openknowledge',+ rpm: 'OpenKnowledge',+ },+ },+ beta: {+ appId: 'com.inkeep.open-knowledge.beta',+ productName: 'OpenKnowledge Beta',+ packageName: 'openknowledge-beta-desktop',+ linuxExecutableName: 'openknowledge-beta',+ linuxPackageNames: {+ deb: 'openknowledge-beta-desktop',+ rpm: 'openknowledge-beta-desktop',+ },+ },+} as const;++export type DesktopProductName = keyof typeof DESKTOP_PRODUCTS;+export type DesktopProduct = (typeof DESKTOP_PRODUCTS)[DesktopProductName];++export function desktopWindowsExecutableName(product: DesktopProduct): string {+ return `${product.productName}.exe`;+}++export function desktopWindowsInstallDirNames(product: DesktopProduct): readonly string[] {+ return [product.packageName.replaceAll('/', ''), product.productName];+}++export const PRODUCT_NAME = DESKTOP_PRODUCTS.stable.productName;diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 1a89d4d63..baed5ae22 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -520,7 +520,14 @@ export {PREVIEW_THEME_TOKENS,type PreviewThemeToken,} from './constants/preview-theme-tokens.ts';-export { PRODUCT_NAME } from './constants/product.ts';+export {+ DESKTOP_PRODUCTS,+ type DesktopProduct,+ type DesktopProductName,+ desktopWindowsExecutableName,+ desktopWindowsInstallDirNames,+ PRODUCT_NAME,+} from './constants/product.ts';export { isReservedLogDoc } from './constants/reserved-docs.ts';export { DEFAULT_SERVER_HOST } from './constants/server.ts';export {diff --git a/packages/desktop/build/UNIVERSAL_LINK_ACTIVATION.md b/packages/desktop/build/UNIVERSAL_LINK_ACTIVATION.mdindex 8c9bb630d..201383bf5 100644--- a/packages/desktop/build/UNIVERSAL_LINK_ACTIVATION.md+++ b/packages/desktop/build/UNIVERSAL_LINK_ACTIVATION.md@@ -8,8 +8,8 @@ The macOS share-receive flow routes inbound `https://openknowledge.ai/d/<encoded1. **`build/entitlements.mac.plist`** — declares the `com.apple.developer.associated-domains` entitlement with `applinks:openknowledge.ai` + `applinks:www.openknowledge.ai`. This is what the kernel checks when AppKit is asked to deliver an inbound Universal Link to the app. **Applied to the MAIN binary only** (`mac.entitlements` in `electron-builder.yml`).2. **`build/entitlements.mac.inherit.plist`** — helper-only plist for helper processes (Renderer / GPU / Plugin / utility-process.fork children). Excludes `com.apple.developer.associated-domains` because that entitlement is restricted (requires an embedded provisioning profile to claim, and helpers do not carry one — macOS 26.4.x AMFI SIGKILLs helpers that claim restricted entitlements without a profile, producing the `exit_code=9` failure mode that blocks project open). Wired via `mac.entitlementsInherit` in `electron-builder.yml`. The contract test at `tests/unit/entitlements-helper-split.test.ts` prevents drift.-3. **`build/embedded.provisionprofile`** — Developer-ID provisioning profile, CMS-signed by Apple, granting the app the right to use the restricted `com.apple.developer.associated-domains` entitlement at codesign time. Without it, `codesign` rejects the binary at notarize time with "not authorized to use restricted entitlement."-4. **`electron-builder.yml`** — `mac.provisioningProfile: build/embedded.provisionprofile` setting that tells electron-builder to embed the profile inside the packaged `.app`. Plus `mac.extendInfo.NSUserActivityTypes: [NSUserActivityTypeBrowsingWeb]` which is required for AppKit to dispatch `continue-activity` events to the app — without it, even a perfectly-entitled binary silently drops Handoff payloads (`LSOpenURLsWithRole error -10810` in console.app). Plus the `mac.entitlements` vs `mac.entitlementsInherit` split called out above — pointing both at the same plist is the documented anti-pattern that broke helper spawn on macOS 26.4.x.+3. **The product provisioning profile** — Stable commits `build/embedded.provisionprofile`, and Beta commits `build/embedded.beta.provisionprofile`. Each profile is CMS-signed by Apple for its exact App ID and grants the restricted `com.apple.developer.associated-domains` entitlement. Without the matching profile, `codesign` rejects the binary at notarize time with "not authorized to use restricted entitlement."+4. **`electron-builder.yml` plus `scripts/run-electron-builder.mjs`** — the variant builder selects the matching profile, App ID, product name, icon, protocol, and update channel. `mac.extendInfo.NSUserActivityTypes: [NSUserActivityTypeBrowsingWeb]` is required for AppKit to dispatch `continue-activity` events to the app. The `mac.entitlements` vs `mac.entitlementsInherit` split remains load-bearing because helpers do not embed provisioning profiles.Cross-references:- [`SPEC.md`](../../../specs/2026-05-14-sharing-virality-flow/SPEC.md) §9 (Proposed solution / Architecture overview), §13 (Deployment / rollout considerations)@@ -76,7 +76,7 @@ If signing isn't available locally (the common dev case), skip this check and resudo swcutil dl -d openknowledge.ai```-Apple's `swcd` daemon caches the AASA file for up to 8 days (including negative caches per Apple's published behavior). Force a refresh with this command. Output should show a successful 200 OK fetch + JSON body matching the expected schema (`appID: 6NZGSG335T.com.inkeep.open-knowledge`, `paths: [/d/*]`).+Apple's `swcd` daemon caches the AASA file for up to 8 days (including negative caches per Apple's published behavior). Force a refresh with this command. Output should show a successful 200 OK fetch and an `appIDs` array containing `6NZGSG335T.com.inkeep.open-knowledge` and `6NZGSG335T.com.inkeep.open-knowledge.beta`, both scoped to `/d/*`.If `swcutil dl` shows a 404 or stale entry past the deploy window, the AASA file isn't reaching macOS clients. Re-verify:- `https://openknowledge.ai/.well-known/apple-app-site-association` returns 200 with `Content-Type: application/json` (NOT `application/json; charset=utf-8`).diff --git a/packages/desktop/build/embedded.beta.provisionprofile b/packages/desktop/build/embedded.beta.provisionprofilenew file mode 100644index 000000000..6345c6d61Binary files /dev/null and b/packages/desktop/build/embedded.beta.provisionprofile differdiff --git a/packages/desktop/build/icon-beta.png b/packages/desktop/build/icon-beta.pngnew file mode 100644index 000000000..dce4ab9f1Binary files /dev/null and b/packages/desktop/build/icon-beta.png differdiff --git a/packages/desktop/electron-builder.linux.yml b/packages/desktop/electron-builder.linux.ymlindex 95868aeb3..1bdecb16a 100644--- a/packages/desktop/electron-builder.linux.yml+++ b/packages/desktop/electron-builder.linux.yml@@ -30,9 +30,9 @@# dependencies. It is a top-level-only option (not per-platform), which is why# it lives in a Linux-only overlay instead of in the shared config.#-# Linux builds MUST pass `--config electron-builder.linux.yml`. Forgetting it-# fails the build loudly on node-liblzma rather than producing a silently-# broken package, which is the failure mode this file is here to prevent.+# Current build scripts use `run-electron-builder.mjs`, which applies this same+# value to its generated config whenever `--linux` is present. This overlay is+# retained for direct electron-builder callers, including monorepo validation.extends: file:./electron-builder.ymlnpmRebuild: falsediff --git a/packages/desktop/electron-builder.yml b/packages/desktop/electron-builder.ymlindex 345424f6e..e81e57e8f 100644--- a/packages/desktop/electron-builder.yml+++ b/packages/desktop/electron-builder.yml@@ -15,12 +15,12 @@ electronVersion: "43.4.0"# other native modules still use that pass. node-pty's N-API prebuilds do not# require an Electron ABI rebuild.#-# Linux skips the pass instead, via the `electron-builder.linux.yml` overlay-# (`npmRebuild: false`) — Linux builds MUST pass `--config-# electron-builder.linux.yml`. The skip is NOT expressed as a `beforeBuild` hook-# returning false: in app-builder-lib that also asserts "node_modules are staged-# externally", which suppresses dependency collection entirely and ships an asar-# the app cannot start from. That overlay documents the mechanism in full.+# Linux skips the pass instead: `run-electron-builder.mjs` sets+# `npmRebuild: false` in its generated config whenever `--linux` is present. The+# skip is NOT expressed as a `beforeBuild` hook returning false: in+# app-builder-lib that also asserts "node_modules are staged externally", which+# suppresses dependency collection entirely and ships an asar the app cannot+# start from.directories:output: dist-desktop@@ -363,10 +363,8 @@ dmg:# actual asset is `OpenKnowledge-0.4.1-arm64.dmg`. The arch suffix stays# because we only ship arm64 today; an x64 / universal build would need# a parallel artifactName + a splash decision rule.- # The docs site's /download/beta and /download/stable redirects also- # reference this exact asset name via DMG_ASSET_NAME in- # docs/src/lib/download-links.ts — changing the pattern breaks both- # routes and the share-splash URL together.+ # The docs site's Stable/Beta download resolvers derive their product-specific+ # names from this pattern in docs/src/lib/download-links.ts.artifactName: ${productName}-${arch}.${ext}title: ${productName}# The "drag me to Applications" arrow and branding are painted INTO the@@ -526,7 +524,7 @@ linux:# The arm64 deb is built on a NATIVE arm64 runner (the `build-linux` matrix# in .github/workflows/desktop-build-win-linux.yml), never cross-compiled:# pnpm installs only the host-arch `@parcel/watcher` prebuild and the Linux- # build skips @electron/rebuild by design (see the overlay config), so an+ # build skips @electron/rebuild in the generated config, so an# x64-host arm64 deb would package but ship the wrong native binaries.target:- target: deb@@ -679,9 +677,7 @@ publish:- provider: githubowner: inkeeprepo: open-knowledge- # Explicit default — beta builds override at the CLI via- # `--config.publish.channel=beta`, which routes the manifest to- # `beta-mac.yml` instead of `latest-mac.yml`. Keeping this explicit so- # the channel intent is grep-able rather than relying on the implicit- # no-channel-field default.+ # Stable defaults live here. `scripts/run-electron-builder.mjs` derives the+ # Beta product identity, protocol, icon, CLI integration, and+ # channel from `OK_DESKTOP_VARIANT` before invoking electron-builder.channel: latestdiff --git a/packages/desktop/electron.vite.config.ts b/packages/desktop/electron.vite.config.tsindex e1ceb33f9..517be20c2 100644--- a/packages/desktop/electron.vite.config.ts+++ b/packages/desktop/electron.vite.config.ts@@ -7,6 +7,7 @@ import { chromeTokensVitePlugin } from '../app/src/build/chrome-tokens-vite-plugimport { RENDERER_DEDUPE } from '../app/vite.dedupe';import { rendererHtmlInput } from '../app/vite.entries';import { RENDERER_BABEL_OPTIONS } from '../app/vite.react-babel';+import { parseDesktopVariantName } from './src/shared/desktop-variant';// Inject the app's version onto import.meta.env.VITE_APP_VERSION for the// renderer this config builds, which serves unpackaged runs only. A PACKAGED@@ -39,6 +40,7 @@ injectAppVersionEnv();*/const appRoot = resolve(__dirname, '../app');+const desktopVariant = parseDesktopVariantName(process.env.OK_DESKTOP_VARIANT);// The Lingui macro resolves `lingui.config.ts` relative to cwd. electron-vite// runs from `packages/desktop`, so without this the renderer Babel pass fails@@ -49,6 +51,9 @@ process.env.LINGUI_CONFIG ??= resolve(appRoot, 'lingui.config.ts');export default defineConfig({main: {+ define: {+ __OK_DESKTOP_VARIANT__: JSON.stringify(desktopVariant),+ },build: {externalizeDeps: true,sourcemap: 'hidden',diff --git a/packages/desktop/package.json b/packages/desktop/package.jsonindex 22db0123b..91920d052 100644--- a/packages/desktop/package.json+++ b/packages/desktop/package.json@@ -18,11 +18,11 @@"dev": "turbo run dev:electron --filter=@inkeep/open-knowledge-desktop","dev:electron": "electron-vite dev --watch","build:desktop": "electron-vite build",- "build:dir": "pnpm run build:desktop && electron-builder --dir --publish never",- "build:mac": "pnpm run build:desktop && node scripts/prepare-universal.mjs && node scripts/stage-parcel-watcher.mjs && electron-builder --mac --publish never",- "build:mac:unsigned": "pnpm run build:desktop && node scripts/prepare-universal.mjs && node scripts/stage-parcel-watcher.mjs && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --mac --publish never -c.mac.identity=null",- "build:win": "pnpm run build:desktop && node scripts/prepare-platform-natives.mjs && node scripts/stage-parcel-watcher.mjs && electron-builder --win --publish never",- "build:linux": "pnpm run build:desktop && node scripts/prepare-platform-natives.mjs && node scripts/stage-parcel-watcher.mjs && electron-builder --linux --publish never --config electron-builder.linux.yml",+ "build:dir": "pnpm run build:desktop && node scripts/run-electron-builder.mjs --dir --publish never",+ "build:mac": "pnpm run build:desktop && node scripts/prepare-universal.mjs && node scripts/stage-parcel-watcher.mjs && node scripts/run-electron-builder.mjs --mac --publish never",+ "build:mac:unsigned": "pnpm run build:desktop && node scripts/prepare-universal.mjs && node scripts/stage-parcel-watcher.mjs && CSC_IDENTITY_AUTO_DISCOVERY=false node scripts/run-electron-builder.mjs --mac --publish never -c.mac.identity=null",+ "build:win": "pnpm run build:desktop && node scripts/prepare-platform-natives.mjs && node scripts/stage-parcel-watcher.mjs && node scripts/run-electron-builder.mjs --win --publish never",+ "build:linux": "pnpm run build:desktop && node scripts/prepare-platform-natives.mjs && node scripts/stage-parcel-watcher.mjs && node scripts/run-electron-builder.mjs --linux --publish never","prepare:universal": "node scripts/prepare-universal.mjs","prepare:platform-natives": "node scripts/prepare-platform-natives.mjs","postinstall": "node scripts/postinstall.mjs",diff --git a/packages/desktop/resources/cli/bin/ok-linux.sh b/packages/desktop/resources/cli/bin/ok-linux.shindex 540693d52..fca2c1463 100755--- a/packages/desktop/resources/cli/bin/ok-linux.sh+++ b/packages/desktop/resources/cli/bin/ok-linux.sh@@ -9,7 +9,13 @@ doneBIN_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"ROOT_DIR="$(cd -P "$BIN_DIR/../../.." >/dev/null 2>&1 && pwd)"-ELECTRON="$ROOT_DIR/openknowledge"+ELECTRON=""+for NAME in openknowledge openknowledge-beta; do+ if [ -x "$ROOT_DIR/$NAME" ]; then+ ELECTRON="$ROOT_DIR/$NAME"+ break+ fi+doneCLI="$BIN_DIR/../dist/cli.mjs"if [ ! -f "$CLI" ] || [ ! -x "$ELECTRON" ]; thendiff --git a/packages/desktop/resources/cli/bin/ok.cmd b/packages/desktop/resources/cli/bin/ok.cmdindex 0d57697c9..3714818e0 100644--- a/packages/desktop/resources/cli/bin/ok.cmd+++ b/packages/desktop/resources/cli/bin/ok.cmd@@ -22,10 +22,13 @@ set "NODE_OPTIONS="set "ELECTRON_RUN_AS_NODE=1"-if not exist "%~dp0..\..\..\OpenKnowledge.exe" goto :missingif not exist "%~dp0..\dist\cli.mjs" goto :missing-"%~dp0..\..\..\OpenKnowledge.exe" "%~dp0..\dist\cli.mjs" %*+set "ELECTRON="+for %%N in ("OpenKnowledge.exe" "OpenKnowledge Beta.exe") do if exist "%~dp0..\..\..\%%~N" set "ELECTRON=%~dp0..\..\..\%%~N"+if not defined ELECTRON goto :missing++"%ELECTRON%" "%~dp0..\dist\cli.mjs" %*endlocal & exit /b %ERRORLEVEL%:missingdiff --git a/packages/desktop/resources/cli/bin/ok.ps1 b/packages/desktop/resources/cli/bin/ok.ps1index d77c58b2d..5b91fbba0 100644--- a/packages/desktop/resources/cli/bin/ok.ps1+++ b/packages/desktop/resources/cli/bin/ok.ps1@@ -5,10 +5,13 @@# ELECTRON_RUN_AS_NODE=1 - no separate Node install required.$installDir = Resolve-Path (Join-Path $PSScriptRoot '..\..\..')-$electron = Join-Path $installDir 'OpenKnowledge.exe'+$electron = @('OpenKnowledge.exe', 'OpenKnowledge Beta.exe') |+ ForEach-Object { Join-Path $installDir $_ } |+ Where-Object { Test-Path $_ } |+ Select-Object -First 1$cli = Join-Path $PSScriptRoot '..\dist\cli.mjs'-if (-not (Test-Path $electron) -or -not (Test-Path $cli)) {+if (-not $electron -or -not (Test-Path $cli)) {# Mirrors ok.sh / ok.cmd's ok-bundle-missing contract: two-line stderr# (human-readable + machine-readable JSON), exit 69 (EX_UNAVAILABLE).[Console]::Error.WriteLine('OpenKnowledge has been removed. Reinstall from the OpenKnowledge installer.')diff --git a/packages/desktop/resources/cli/bin/ok.sh b/packages/desktop/resources/cli/bin/ok.shindex 5557a0d78..4e8c818bc 100755--- a/packages/desktop/resources/cli/bin/ok.sh+++ b/packages/desktop/resources/cli/bin/ok.sh@@ -24,7 +24,8 @@ if [ -z "$APP_PATH" ]; thenfiCONTENTS="$APP_PATH/Contents"-ELECTRON="$CONTENTS/MacOS/OpenKnowledge"+APP_NAME="$(basename "$APP_PATH" .app)"+ELECTRON="$CONTENTS/MacOS/$APP_NAME"CLI="$CONTENTS/Resources/cli/dist/cli.mjs"if [ ! -f "$CLI" ] || [ ! -x "$ELECTRON" ]; then@@ -39,7 +40,7 @@ fiRUNTIME="$ELECTRON"case "$1" inmcp|start)- HELPER="$CONTENTS/Frameworks/OpenKnowledge Server.app/Contents/MacOS/OpenKnowledge Helper"+ HELPER="$CONTENTS/Frameworks/$APP_NAME Server.app/Contents/MacOS/$APP_NAME Helper"if [ -x "$HELPER" ]; thenRUNTIME="$HELPER"fidiff --git a/packages/desktop/scripts/afterPack.mjs b/packages/desktop/scripts/afterPack.mjsindex a25797503..24f262dfc 100644--- a/packages/desktop/scripts/afterPack.mjs+++ b/packages/desktop/scripts/afterPack.mjs@@ -76,7 +76,7 @@ export default async function afterPack(context) {`${appName}.app`,'Contents','Frameworks',- 'OpenKnowledge Server.app',+ `${appName} Server.app`,);const serverHelperBinary = join(serverHelperBundleDir, 'Contents', 'MacOS', `${appName} Helper`);if (!existsSync(electronHelperStub)) {diff --git a/packages/desktop/scripts/desktop-variant-config.ts b/packages/desktop/scripts/desktop-variant-config.tsnew file mode 100644index 000000000..317d09ac0--- /dev/null+++ b/packages/desktop/scripts/desktop-variant-config.ts@@ -0,0 +1,244 @@+import { parse as parseYaml } from 'yaml';+import { DESKTOP_VARIANTS, type DesktopVariantName } from '../src/shared/desktop-variant.ts';++interface ResourceEntry {+ from: string;+ to: string;+ filter?: string[];+}++interface LinuxPackageTargetConfig {+ afterInstall: string;+ afterRemove: string;+ packageName?: string;+ depends?: string[];+}++interface BuilderConfig {+ appId: string;+ productName: string;+ extraMetadata?: Record<string, unknown>;+ protocols: Array<{ name: string; schemes: string[]; role?: string }>;+ publish: Array<{+ provider: string;+ owner: string;+ repo: string;+ channel: string;+ private?: boolean;+ }>;+ mac: {+ icon: string;+ artifactName?: string;+ entitlements: string;+ provisioningProfile?: string;+ extraResources: ResourceEntry[];+ extraFiles: ResourceEntry[];+ extendInfo?: Record<string, unknown>;+ };+ win: { icon: string; extraResources: ResourceEntry[] };+ dmg: { artifactName: string };+ linux: {+ icon: string;+ artifactName: string;+ executableName: string;+ extraResources: ResourceEntry[];+ };+ nsis: { artifactName: string; include: string };+ deb: LinuxPackageTargetConfig;+ rpm: LinuxPackageTargetConfig;+ npmRebuild?: boolean;+}++export interface VariantConfigPaths {+ readonly includePath: string;+ readonly postInstallPath: string;+ readonly postRemovePath: string;+ readonly localEntitlementsPath: string;+ readonly helperInfoPath: string;+ readonly profileAvailable: boolean;+}++function replaceRequired(+ source: string,+ search: string | RegExp,+ replacement: string,+ label: string,+): string {+ const found = typeof search === 'string' ? source.includes(search) : search.test(source);+ if (!found) throw new Error(`Desktop packaging template is missing ${label}.`);+ return source.replace(search, replacement);+}++function replaceAllRequired(+ source: string,+ search: string,+ replacement: string,+ label: string,+): string {+ if (!source.includes(search)) throw new Error(`Desktop packaging template is missing ${label}.`);+ return source.replaceAll(search, replacement);+}++export function parseBuilderConfig(text: string): BuilderConfig {+ return parseYaml(text) as BuilderConfig;+}++export function createVariantBuilderConfig(+ base: BuilderConfig,+ variantName: DesktopVariantName,+ paths: VariantConfigPaths,+ sourceVersion: string,+): BuilderConfig {+ const variant = DESKTOP_VARIANTS[variantName];+ const config = structuredClone(base);+ config.appId = variant.appId;+ config.productName = variant.productName;+ config.extraMetadata = {+ ...config.extraMetadata,+ okDesktopVariant: variant.name,+ productName: variant.productName,+ ...(variant.name === 'stable' ? {} : { name: variant.packageName }),+ ...(variant.name === 'beta' ? { version: betaBuildVersion(sourceVersion) } : {}),+ };+ config.protocols = [+ { name: `${variant.productName} URL`, schemes: [variant.protocolScheme], role: 'Editor' },+ ];+ config.publish = config.publish.map((entry) => ({+ ...entry,+ channel: variant.updateChannel,+ }));+ config.mac.icon = variant.name === 'stable' ? config.mac.icon : variant.iconPath;+ config.mac.artifactName = `${variant.artifactName}-\${version}-\${arch}-mac.\${ext}`;+ config.win.icon = variant.iconPath;+ config.linux.icon = variant.iconPath;+ config.dmg.artifactName = `${variant.artifactName}-\${arch}.\${ext}`;+ config.nsis.artifactName = `${variant.artifactName}-Setup-\${arch}.\${ext}`;+ config.linux.artifactName = `${variant.artifactName}-\${arch}.\${ext}`;+ config.linux.executableName = variant.linuxExecutableName;+ config.deb.packageName = variant.linuxPackageNames.deb;+ config.rpm.packageName = variant.linuxPackageNames.rpm;+ config.nsis.include = paths.includePath;+ config.deb.afterInstall = paths.postInstallPath;+ config.deb.afterRemove = paths.postRemovePath;+ config.rpm.afterInstall = paths.postInstallPath;+ config.rpm.afterRemove = paths.postRemovePath;+ config.mac.extendInfo = {+ ...config.mac.extendInfo,+ NSMicrophoneUsageDescription: `A program running in ${variant.productName}'s terminal wants to use the microphone.`,+ };+ config.mac.extraFiles = [+ {+ from: paths.helperInfoPath,+ to: `Frameworks/${variant.productName} Server.app/Contents/Info.plist`,+ },+ ];+ if (variant.name === 'stable' || paths.profileAvailable) {+ config.mac.provisioningProfile =+ variant.name === 'stable'+ ? 'build/embedded.provisionprofile'+ : `build/embedded.${variant.name}.provisionprofile`;+ } else {+ delete config.mac.provisioningProfile;+ config.mac.entitlements = paths.localEntitlementsPath;+ }+ if (variant.name === 'beta') {+ const wrapperEntries = config.win.extraResources.filter(+ (entry) =>+ entry.from !== 'resources/cli/bin/ok.cmd' && entry.from !== 'resources/cli/bin/ok.ps1',+ );+ config.win.extraResources = [+ ...variant.cliCommandNames.flatMap((name) => [+ { from: 'resources/cli/bin/ok.cmd', to: `cli/bin/${name}.cmd` },+ { from: 'resources/cli/bin/ok.ps1', to: `cli/bin/${name}.ps1` },+ ]),+ ...wrapperEntries,+ ];+ }+ return config;+}++export function betaBuildVersion(sourceVersion: string): string {+ const base = /^\d+\.\d+\.\d+/.exec(sourceVersion)?.[0];+ if (!base)+ throw new Error(`Desktop package version ${JSON.stringify(sourceVersion)} is invalid.`);+ return /-beta\.\d+(?:\+.*)?$/.test(sourceVersion) ? sourceVersion : `${base}-beta.0`;+}++export function createVariantNsisInclude(source: string, variantName: DesktopVariantName): string {+ const variant = DESKTOP_VARIANTS[variantName];+ const withScheme = replaceAllRequired(+ source,+ 'openknowledge://',+ `${variant.protocolScheme}://`,+ 'the openknowledge:// URL scheme in build/installer.nsh',+ );+ const withRegistryKey = replaceAllRequired(+ withScheme,+ 'Software\\Classes\\openknowledge',+ `Software\\Classes\\${variant.protocolScheme}`,+ 'the openknowledge registry key in build/installer.nsh',+ );+ return replaceAllRequired(+ withRegistryKey,+ 'URL:OpenKnowledge',+ `URL:${variant.productName}`,+ 'the OpenKnowledge protocol label in build/installer.nsh',+ );+}++export function createVariantPostInstall(source: string, variantName: DesktopVariantName): string {+ const [shortName, longName] = DESKTOP_VARIANTS[variantName].cliCommandNames;+ const withShortName = replaceRequired(+ source,+ 'ln -sf "$OK_WRAPPER" /usr/bin/ok',+ `ln -sf "$OK_WRAPPER" /usr/bin/${shortName}`,+ 'the /usr/bin/ok install command in build/deb-postinst.sh',+ );+ return replaceRequired(+ withShortName,+ 'ln -sf "$OK_WRAPPER" /usr/bin/open-knowledge',+ `ln -sf "$OK_WRAPPER" /usr/bin/${longName}`,+ 'the /usr/bin/open-knowledge install command in build/deb-postinst.sh',+ );+}++export function createVariantPostRemove(source: string, variantName: DesktopVariantName): string {+ const [shortName, longName] = DESKTOP_VARIANTS[variantName].cliCommandNames;+ return replaceRequired(+ source,+ 'for link in /usr/bin/ok /usr/bin/open-knowledge; do',+ `for link in /usr/bin/${shortName} /usr/bin/${longName}; do`,+ 'the Linux CLI removal loop in build/deb-postrm.sh',+ );+}++export function createLocalEntitlements(source: string): string {+ return replaceRequired(+ source,+ /\n\s*<key>com\.apple\.developer\.associated-domains<\/key>\s*<array>[\s\S]*?<\/array>/,+ '',+ 'the associated-domains entitlement in build/entitlements.mac.plist',+ );+}++export function createVariantHelperInfo(source: string, variantName: DesktopVariantName): string {+ const variant = DESKTOP_VARIANTS[variantName];+ const withAppId = replaceAllRequired(+ source,+ 'com.inkeep.open-knowledge.server',+ `${variant.appId}.server`,+ 'the helper bundle identifier in build/helper-bundle/Info.plist',+ );+ const withServerName = replaceAllRequired(+ withAppId,+ 'OpenKnowledge Server',+ `${variant.productName} Server`,+ 'the helper bundle name in build/helper-bundle/Info.plist',+ );+ return replaceAllRequired(+ withServerName,+ 'OpenKnowledge Helper',+ `${variant.productName} Helper`,+ 'the helper executable name in build/helper-bundle/Info.plist',+ );+}diff --git a/packages/desktop/scripts/run-electron-builder.mjs b/packages/desktop/scripts/run-electron-builder.mjsnew file mode 100644index 000000000..d00678cdf--- /dev/null+++ b/packages/desktop/scripts/run-electron-builder.mjs@@ -0,0 +1,97 @@+#!/usr/bin/env node+import { spawnSync } from 'node:child_process';+import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+import { createRequire } from 'node:module';+import { join } from 'node:path';+import { stringify as stringifyYaml } from 'yaml';+import { DESKTOP_VARIANTS, parseDesktopVariantName } from '../src/shared/desktop-variant.ts';+import {+ createLocalEntitlements,+ createVariantBuilderConfig,+ createVariantHelperInfo,+ createVariantNsisInclude,+ createVariantPostInstall,+ createVariantPostRemove,+ parseBuilderConfig,+} from './desktop-variant-config.ts';++const variantName = parseDesktopVariantName(process.env.OK_DESKTOP_VARIANT);+const variant = DESKTOP_VARIANTS[variantName];+const args = process.argv.slice(2);+const buildDir = join(process.cwd(), '.variant-build');+const profilePath = join(process.cwd(), `build/embedded.${variantName}.provisionprofile`);+const profileAvailable = variantName === 'stable' || existsSync(profilePath);+const packagingMac = args.includes('--mac') || args.includes('--dir');+const signingRequested = Boolean(process.env.CSC_LINK || process.env.CSC_KEYCHAIN);++if (packagingMac && signingRequested && !profileAvailable) {+ throw new Error(+ `${variant.productName} cannot be signed with associated domains until ${profilePath} exists.`,+ );+}++rmSync(buildDir, { recursive: true, force: true });+mkdirSync(buildDir, { recursive: true });++const includePath = '.variant-build/installer.nsh';+const postInstallPath = '.variant-build/deb-postinst.sh';+const postRemovePath = '.variant-build/deb-postrm.sh';+const localEntitlementsPath = '.variant-build/entitlements.mac.local.plist';+const helperInfoPath = '.variant-build/helper-Info.plist';++const base = parseBuilderConfig(readFileSync('electron-builder.yml', 'utf8'));+const sourceVersion = JSON.parse(readFileSync('package.json', 'utf8')).version;+const config = createVariantBuilderConfig(+ base,+ variantName,+ {+ includePath,+ postInstallPath,+ postRemovePath,+ localEntitlementsPath,+ helperInfoPath,+ profileAvailable,+ },+ sourceVersion,+);+if (args.includes('--linux')) config.npmRebuild = false;++writeFileSync(+ includePath,+ createVariantNsisInclude(readFileSync('build/installer.nsh', 'utf8'), variantName),+);+writeFileSync(+ postInstallPath,+ createVariantPostInstall(readFileSync('build/deb-postinst.sh', 'utf8'), variantName),+);+writeFileSync(+ postRemovePath,+ createVariantPostRemove(readFileSync('build/deb-postrm.sh', 'utf8'), variantName),+);+writeFileSync(+ localEntitlementsPath,+ createLocalEntitlements(readFileSync('build/entitlements.mac.plist', 'utf8')),+);+writeFileSync(+ helperInfoPath,+ createVariantHelperInfo(readFileSync('build/helper-bundle/Info.plist', 'utf8'), variantName),+);+const generatedConfigPath = '.variant-build/electron-builder.yml';+writeFileSync(generatedConfigPath, stringifyYaml(config, { lineWidth: 0 }));++const require = createRequire(import.meta.url);+const electronBuilderCli = require.resolve('electron-builder/cli.js');+const result = spawnSync(+ process.execPath,+ [electronBuilderCli, ...args, '--config', generatedConfigPath],+ {+ cwd: process.cwd(),+ env: process.env,+ stdio: 'inherit',+ },+);+if (result.error) throw result.error;+if (result.signal) {+ console.error(`[desktop-builder] electron-builder terminated by ${result.signal}`);+}+process.exit(result.status ?? 1);diff --git a/packages/desktop/src/main/auto-updater.ts b/packages/desktop/src/main/auto-updater.tsindex 0cbdb4aaf..2f379040b 100644--- a/packages/desktop/src/main/auto-updater.ts+++ b/packages/desktop/src/main/auto-updater.ts@@ -101,6 +101,7 @@ interface StartAutoUpdaterOpts {getPrimaryWindow: () => { webContents: SendableWebContents } | null;getAllWindows?: () => readonly { webContents: SendableWebContents }[];getAppVersion: () => string;+ buildChannel?: UpdateChannel;isPackaged: boolean;platform?: NodeJS.Platform;forceDevBypass?: boolean;@@ -379,6 +380,7 @@ export function startAutoUpdater(opts: StartAutoUpdaterOpts): StartAutoUpdaterHagetPrimaryWindow,getAllWindows,getAppVersion,+ buildChannel: configuredBuildChannel,isPackaged,platform = process.platform,forceDevBypass = false,@@ -398,7 +400,7 @@ export function startAutoUpdater(opts: StartAutoUpdaterOpts): StartAutoUpdaterHaupdater.autoDownload = false;updater.autoInstallOnAppQuit = platform !== 'linux';const appVersion = getAppVersion();- const buildChannel = channelFromVersion(appVersion);+ const buildChannel = configuredBuildChannel ?? channelFromVersion(appVersion);applyChannelSettings(updater, buildChannel);updater.forceDevUpdateConfig = forceDevBypass;diff --git a/packages/desktop/src/main/index.ts b/packages/desktop/src/main/index.tsindex aac7bbbef..c0d1be9f9 100644--- a/packages/desktop/src/main/index.ts+++ b/packages/desktop/src/main/index.ts@@ -143,6 +143,7 @@ import type {OkMenuAction,OkMenuActionOrigin,} from '../shared/bridge-contract.ts';+import { DESKTOP_VARIANT } from '../shared/desktop-variant.ts';import { type EntryPoint, isEntryPoint } from '../shared/entry-point.ts';import type {EditorActiveTargetSnapshot,@@ -177,7 +178,6 @@ import { attachAssetSafetyNet } from './asset-safety-net.ts';import { resolveEffectiveInstanceName } from './auto-instance.ts';import {bootAutoUpdater,- channelFromVersion,installWasInFlightDuring,type StartAutoUpdaterHandle,} from './auto-updater.ts';@@ -281,7 +281,11 @@ import { createBootBudgetDirSizeProbe } from './fs-walk-budget.ts';import { ensureGitAvailable } from './git-preflight-handler.ts';import { readCanonicalGitHubRemoteUrl } from './git-remote.ts';import { classifyInstallShape } from './install-shape.ts';-import { formatInstanceAppName, resolveInstanceLabel } from './instance-identity.ts';+import {+ combineInstanceLabels,+ formatInstanceAppName,+ resolveInstanceLabel,+} from './instance-identity.ts';import { deriveInstanceUserDataDir } from './instance-isolation.ts';import {type EditorPresenceProbes,@@ -1612,6 +1616,7 @@ function openNavigator(pendingPayload?: ShareNavigatorPayload) {: join(__dirname, '../renderer/index.html'),rendererDevUrl,appVersion: app.getVersion(),+ productName: DESKTOP_VARIANT.productName,languagePreference: userPreferences.language,themePreference: userPreferences.theme,showGate,@@ -2413,7 +2418,7 @@ function applyMenuDispatchRole(role: MenuDispatchRole, sender: Electron.WebContewc.reloadIgnoringCache();return;case 'toggleDevTools':- if (!app.isPackaged || channelFromVersion(app.getVersion()) === 'beta') {+ if (!app.isPackaged || DESKTOP_VARIANT.name !== 'stable') {wc.toggleDevTools();}return;@@ -2445,7 +2450,7 @@ async function runApplicationMenuRefresh(): Promise<void> {await installApplicationMenu({appName: app.name,translate: currentMenuTranslator(),- showDevToolsMenu: !app.isPackaged || channelFromVersion(app.getVersion()) === 'beta',+ showDevToolsMenu: !app.isPackaged || DESKTOP_VARIANT.name !== 'stable',terminalCapable: isTerminalAvailable(),dialog,openNavigator,@@ -4456,7 +4461,7 @@ function registerIpcHandlers() {return {recentProjects: appState.recentProjects.map((r) => ({ path: r.path, name: r.name })),spellCheckEnabled: appState.spellCheckEnabled,- showDevToolsMenu: !app.isPackaged || channelFromVersion(app.getVersion()) === 'beta',+ showDevToolsMenu: !app.isPackaged || DESKTOP_VARIANT.name !== 'stable',canCheckForUpdates: autoUpdaterHandle != null,canReconfigureMcpWiring: app.isPackaged && supportedPackagedInstall(),activeTarget: currentActiveTarget(),@@ -4719,7 +4724,7 @@ function registerIpcHandlers() {desktopMeta: {version: app.getVersion(),packaged: app.isPackaged,- channel: channelFromVersion(app.getVersion()),+ channel: DESKTOP_VARIANT.updateChannel,},readLanguage: () =>describeDesktopLanguage({@@ -5210,7 +5215,7 @@ function registerIpcHandlers() {appState = s;},saveAppState,- getBuildChannel: () => channelFromVersion(app.getVersion()),+ getBuildChannel: () => DESKTOP_VARIANT.updateChannel,getPendingSchemaIncompatibility,clearPendingSchemaIncompatibility,});@@ -5781,9 +5786,12 @@ if (!app.isPackaged) {}}-const instanceLabel = resolveInstanceLabel(app.getPath('userData'));+const parallelInstanceLabel = resolveInstanceLabel(app.getPath('userData'));+const instanceLabel = combineInstanceLabels(DESKTOP_VARIANT.instanceLabel, parallelInstanceLabel);+if (parallelInstanceLabel) {+ app.setName(formatInstanceAppName(app.getName(), parallelInstanceLabel));+}if (instanceLabel) {- app.setName(formatInstanceAppName(app.getName(), instanceLabel));setWindowInstanceLabel(instanceLabel);}@@ -6039,6 +6047,7 @@ function bootPrimaryInstance(): void {});const protocolControl = registerProtocolHandler({+ protocolScheme: DESKTOP_VARIANT.protocolScheme,app: {on: (event, cb) => {app.on(event as Parameters<typeof app.on>[0], cb as Parameters<typeof app.on>[1]);@@ -6479,6 +6488,7 @@ function bootPrimaryInstance(): void {},getAllWindows: () => BrowserWindow.getAllWindows(),getAppVersion: () => app.getVersion(),+ buildChannel: DESKTOP_VARIANT.updateChannel,isPackaged: app.isPackaged,forceDevBypass: process.env.OK_UPDATER_FORCE_DEV === '1',feedUrl: process.env.OK_UPDATER_FEED_URL || undefined,diff --git a/packages/desktop/src/main/instance-identity.test.ts b/packages/desktop/src/main/instance-identity.test.tsindex b66368857..baf1edcf5 100644--- a/packages/desktop/src/main/instance-identity.test.ts+++ b/packages/desktop/src/main/instance-identity.test.ts@@ -1,10 +1,17 @@import { describe, expect, test } from 'vitest';-import { formatInstanceAppName, resolveInstanceLabel } from './instance-identity.ts';+import {+ combineInstanceLabels,+ formatInstanceAppName,+ resolveInstanceLabel,+} from './instance-identity.ts';describe('resolveInstanceLabel', () => {test('returns null for the default install userData names', () => {expect(resolveInstanceLabel('/Users/me/Library/Application Support/OpenKnowledge')).toBeNull();expect(resolveInstanceLabel('/Users/me/Library/Application Support/Open Knowledge')).toBeNull();+ expect(+ resolveInstanceLabel('/Users/me/Library/Application Support/OpenKnowledge Beta'),+ ).toBeNull();expect(resolveInstanceLabel('/tmp/Electron')).toBeNull();});@@ -30,3 +37,11 @@ describe('formatInstanceAppName', () => {expect(formatInstanceAppName('OpenKnowledge', 'work')).toBe('OpenKnowledge (work)');});});++describe('combineInstanceLabels', () => {+ test('reuses one label surface for product and dev identities', () => {+ expect(combineInstanceLabels('Beta', 'work')).toBe('Beta · work');+ expect(combineInstanceLabels('Beta', null)).toBe('Beta');+ expect(combineInstanceLabels(null, null)).toBeNull();+ });+});diff --git a/packages/desktop/src/main/instance-identity.ts b/packages/desktop/src/main/instance-identity.tsindex 1279ce138..72ecfdae5 100644--- a/packages/desktop/src/main/instance-identity.ts+++ b/packages/desktop/src/main/instance-identity.ts@@ -1,6 +1,11 @@import { basename } from 'node:path';-const DEFAULT_USERDATA_NAMES = new Set(['OpenKnowledge', 'Open Knowledge', 'Electron']);+const DEFAULT_USERDATA_NAMES = new Set([+ 'OpenKnowledge',+ 'Open Knowledge',+ 'OpenKnowledge Beta',+ 'Electron',+]);const DEV_WRAPPER = /^(?:OpenKnowledge|Open Knowledge) \((.+)\)$/;@@ -15,3 +20,8 @@ export function resolveInstanceLabel(userDataDir: string): string | null {export function formatInstanceAppName(appName: string, label: string): string {return `${appName} (${label})`;}++export function combineInstanceLabels(...labels: Array<string | null>): string | null {+ const present = labels.filter((label): label is string => label !== null && label.length > 0);+ return present.length > 0 ? present.join(' · ') : null;+}diff --git a/packages/desktop/src/main/navigator-window.ts b/packages/desktop/src/main/navigator-window.tsindex 3cc9961ac..da04d4856 100644--- a/packages/desktop/src/main/navigator-window.ts+++ b/packages/desktop/src/main/navigator-window.ts@@ -53,6 +53,7 @@ interface NavigatorDeps extends BootHeartbeatDeps {rendererEntryPath: string;rendererDevUrl?: string | null;appVersion: string;+ productName?: string;languagePreference: LanguagePreference;themePreference: OkThemeSource;showGate: ShowGateRegistry;@@ -71,7 +72,7 @@ export function createNavigatorWindow(deps: NavigatorDeps): BrowserWindowLike {`--ok-${LANGUAGE_PREFERENCE_ARG_NAME}=${deps.languagePreference}`,`--ok-${THEME_PREFERENCE_ARG_NAME}=${deps.themePreference}`,],- title: 'OpenKnowledge',+ title: deps.productName ?? 'OpenKnowledge',});const disposeShowGate = deps.showGate.register(window, { kind: 'navigator' });window.on('closed', () => {diff --git a/packages/desktop/src/main/path-install-beta.test.ts b/packages/desktop/src/main/path-install-beta.test.tsnew file mode 100644index 000000000..7e13488a1--- /dev/null+++ b/packages/desktop/src/main/path-install-beta.test.ts@@ -0,0 +1,66 @@+import { existsSync, mkdtempSync, readFileSync, readlinkSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+import { describe, expect, test, vi } from 'vitest';++vi.mock('../shared/desktop-variant.ts', async (importOriginal) => {+ const actual = await importOriginal<typeof import('../shared/desktop-variant.ts')>();+ return { ...actual, DESKTOP_VARIANT: actual.DESKTOP_VARIANTS.beta };+});++import {+ ensureCliOnPath,+ pathInstallMarkerPath,+ removePathShimFromRcFiles,+} from './path-install.ts';++const BETA_EXE = '/Applications/OpenKnowledge Beta.app/Contents/MacOS/OpenKnowledge Beta';+const BETA_WRAPPER = '/Applications/OpenKnowledge Beta.app/Contents/Resources/cli/bin/ok.sh';++function home(): string {+ return mkdtempSync(join(tmpdir(), 'ok-beta-path-install-'));+}++describe('Beta CLI path install', () => {+ test('isolates marker, shims, environment, and rc block from Stable', async () => {+ const userHome = home();+ const zshrc = join(userHome, '.zshrc');+ const stableBlock = '# >>> open-knowledge cli >>>\nstable\n# <<< open-knowledge cli <<<\n';+ writeFileSync(zshrc, stableBlock);++ const result = await ensureCliOnPath({+ executablePath: BETA_EXE,+ isPackaged: true,+ platform: 'darwin',+ home: userHome,+ bundleVersion: '0.77.7-beta.0',+ env: { HOME: userHome, SHELL: '/bin/zsh' },+ spawn: async () => ({ code: 0, stdout: '/usr/bin:/bin', stderr: '' }),+ consentDecision: { status: 'granted', at: '2026-09-23T00:00:00.000Z' },+ });++ expect(result.status).toBe('installed');+ const betaRoot = join(userHome, '.ok', 'variants', 'beta');+ expect(pathInstallMarkerPath(userHome)).toBe(join(betaRoot, 'path-install.json'));+ expect(readlinkSync(join(betaRoot, 'bin', 'ok-beta'))).toBe(BETA_WRAPPER);+ expect(readlinkSync(join(betaRoot, 'bin', 'open-knowledge-beta'))).toBe(BETA_WRAPPER);+ expect(readFileSync(join(betaRoot, 'env.sh'), 'utf8')).toContain(+ '$' + '{HOME}/.ok/variants/beta/bin',+ );+ const installedRc = readFileSync(zshrc, 'utf8');+ expect(installedRc).toContain(stableBlock);+ expect(installedRc).toContain('# >>> open-knowledge beta cli >>>');++ expect(+ removePathShimFromRcFiles({+ home: userHome,+ platform: 'darwin',+ env: { SHELL: '/bin/zsh' },+ }),+ ).toMatchObject({ status: 'removed' });+ const removedRc = readFileSync(zshrc, 'utf8');+ expect(removedRc).toContain(stableBlock);+ expect(removedRc).not.toContain('open-knowledge beta cli');+ expect(existsSync(join(userHome, '.ok', 'path-install.json'))).toBe(false);+ });+});diff --git a/packages/desktop/src/main/path-install.ts b/packages/desktop/src/main/path-install.tsindex 754f2008b..96ad33b57 100644--- a/packages/desktop/src/main/path-install.ts+++ b/packages/desktop/src/main/path-install.ts@@ -12,21 +12,35 @@ import {} from 'node:fs';import { dirname, join } from 'node:path';import {- PATH_SHIM_BEGIN as BEGIN,- PATH_SHIM_BLOCK_RE as BLOCK_RE,- PATH_SHIM_END as END,type PathDiscovery,type PathInstallConsent,type PathInstallMarker,- pathInstallMarkerPath,+ pathInstallMarkerPath as stablePathInstallMarkerPath,} from '@inkeep/open-knowledge';import { posixOkManagedBinDir } from '@inkeep/open-knowledge-core';+import { DESKTOP_VARIANT } from '../shared/desktop-variant.ts';import type { McpWiringPathInstallDescriptor } from '../shared/ipc-channels.ts';import { classifyInstallShape } from './install-shape.ts';-export { pathInstallMarkerPath };--const NAMES = ['ok', 'open-knowledge'] as const;+const NAMES = DESKTOP_VARIANT.cliCommandNames;+const CLI_HOME_PREFIX = DESKTOP_VARIANT.cliHomeSegment+ ? `.ok/variants/${DESKTOP_VARIANT.cliHomeSegment}`+ : '.ok';+const CLI_BLOCK_NAME =+ DESKTOP_VARIANT.name === 'stable'+ ? 'open-knowledge cli'+ : `open-knowledge ${DESKTOP_VARIANT.name} cli`;+const BEGIN = `# >>> ${CLI_BLOCK_NAME} >>>`;+const END = `# <<< ${CLI_BLOCK_NAME} <<<`;+const BLOCK_RE = new RegExp(+ `^${BEGIN.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\n[\\s\\S]*?^${END.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\n?`,+ 'm',+);++export function pathInstallMarkerPath(home: string): string {+ if (DESKTOP_VARIANT.name === 'stable') return stablePathInstallMarkerPath(home);+ return join(home, CLI_HOME_PREFIX, 'path-install.json');+}interface PathInstallFsOps {existsSync(path: string): boolean;@@ -149,22 +163,24 @@ function writeMarker(home: string, marker: PathInstallMarker, fs: PathInstallFsO}function okBin(home: string): string {- return posixOkManagedBinDir(home);+ return DESKTOP_VARIANT.name === 'stable'+ ? posixOkManagedBinDir(home)+ : join(home, CLI_HOME_PREFIX, 'bin');}function envShim(home: string): string {- return join(home, '.ok', 'env.sh');+ return join(home, CLI_HOME_PREFIX, 'env.sh');}const MANAGED_HINT ='# ! Contents within this block are managed by OpenKnowledge. Do not edit.\n# ! Delete this whole block to opt out — OpenKnowledge will not re-add it.';function block(): string {- return `${BEGIN}\n${MANAGED_HINT}\n[ -f "$HOME/.ok/env.sh" ] && . "$HOME/.ok/env.sh"\n${END}\n`;+ return `${BEGIN}\n${MANAGED_HINT}\n[ -f "$HOME/${CLI_HOME_PREFIX}/env.sh" ] && . "$HOME/${CLI_HOME_PREFIX}/env.sh"\n${END}\n`;}function fishBlock(): string {- return `${BEGIN}\n${MANAGED_HINT}\nif test -d "$HOME/.ok/bin"\n if not contains "$HOME/.ok/bin" $PATH\n set -gx PATH "$HOME/.ok/bin" $PATH\n end\nend\n${END}\n`;+ return `${BEGIN}\n${MANAGED_HINT}\nif test -d "$HOME/${CLI_HOME_PREFIX}/bin"\n if not contains "$HOME/${CLI_HOME_PREFIX}/bin" $PATH\n set -gx PATH "$HOME/${CLI_HOME_PREFIX}/bin" $PATH\n end\nend\n${END}\n`;}function rcTargets(@@ -197,7 +213,13 @@ function rcTargets(...(fishDetected? [{- path: join(fishConfigDir, 'conf.d', 'open-knowledge.fish'),+ path: join(+ fishConfigDir,+ 'conf.d',+ DESKTOP_VARIANT.name === 'stable'+ ? 'open-knowledge.fish'+ : `open-knowledge-${DESKTOP_VARIANT.name}.fish`,+ ),create: true,content: fishBlock(),},@@ -478,11 +500,7 @@ export async function ensureCliOnPath(opts: EnsureCliOnPathOpts): Promise<Ensurefs.mkdirSync(dirname(shim), { recursive: true });fs.writeFileSync(shim,- '# OpenKnowledge CLI environment — managed file, do not edit.\ncase ":$' +- '{PATH}:" in\n *:"$' +- '{HOME}/.ok/bin":*) ;;\n *) export PATH="$' +- '{HOME}/.ok/bin:$' +- '{PATH}" ;;\nesac\n',+ `# ${DESKTOP_VARIANT.productName} CLI environment — managed file, do not edit.\ncase ":\${PATH}:" in\n *:"\${HOME}/${CLI_HOME_PREFIX}/bin":*) ;;\n *) export PATH="\${HOME}/${CLI_HOME_PREFIX}/bin:\${PATH}" ;;\nesac\n`,);phase = 'discoverPath';@@ -640,7 +658,15 @@ export function removePathShimFromRcFiles(opts: {}): RemovePathShimResult {const { home, fs = defaultFsOps, logger = DEFAULT_LOGGER } = opts;const marker = readMarker(home, fs, logger);- const okOwnedFishConf = join(home, '.config', 'fish', 'conf.d', 'open-knowledge.fish');+ const okOwnedFishConf = join(+ home,+ '.config',+ 'fish',+ 'conf.d',+ DESKTOP_VARIANT.name === 'stable'+ ? 'open-knowledge.fish'+ : `open-knowledge-${DESKTOP_VARIANT.name}.fish`,+ );const candidates = new Set<string>([...rcTargets(home, (opts.env ?? process.env).SHELL, fs, opts.platform).map((target) => target.path,diff --git a/packages/desktop/src/main/url-scheme.test.ts b/packages/desktop/src/main/url-scheme.test.tsindex 41a38decd..6fa8f9496 100644--- a/packages/desktop/src/main/url-scheme.test.ts+++ b/packages/desktop/src/main/url-scheme.test.ts@@ -108,6 +108,16 @@ describe('parseOpenKnowledgeUrl — valid inputs', () => {});describe('parseOpenKnowledgeUrl — protocol + host validation', () => {+ test('accepts only the active variant scheme when one is supplied', () => {+ const betaUrl = 'openknowledge-beta://open?project=/abs/path&doc=foo.md';+ expect(parseOpenKnowledgeUrl(betaUrl, 'openknowledge-beta')).toMatchObject({+ host: 'open',+ project: '/abs/path',+ doc: 'foo.md',+ });+ expect(parseOpenKnowledgeUrl(betaUrl)).toBeNull();+ });+test('rejects non-openknowledge protocol', () => {expect(parseOpenKnowledgeUrl('https://open?project=/abs/path&doc=foo.md')).toBeNull();});diff --git a/packages/desktop/src/main/url-scheme.ts b/packages/desktop/src/main/url-scheme.tsindex dd0aad8ca..8ad3f8105 100644--- a/packages/desktop/src/main/url-scheme.ts+++ b/packages/desktop/src/main/url-scheme.ts@@ -65,8 +65,8 @@ export type ShareParseResult =}| { readonly kind: 'invalid'; readonly source: ShareUrlSource };-function classifyShareUrlSource(url: URL): ShareUrlSource | null {- if (url.protocol === 'openknowledge:' && url.hostname === 'share') return 'custom-scheme';+function classifyShareUrlSource(url: URL, protocolScheme: string): ShareUrlSource | null {+ if (url.protocol === `${protocolScheme}:` && url.hostname === 'share') return 'custom-scheme';if ((url.protocol === 'https:' || url.protocol === 'http:') &&SHARE_UNIVERSAL_LINK_HOSTS.has(url.hostname) &&@@ -77,8 +77,9 @@ function classifyShareUrlSource(url: URL): ShareUrlSource | null {return null;}-function classifyRawShareUrlSource(input: string): ShareUrlSource | null {- if (/^openknowledge:\/\/share(?::[^/?#@]*)?(?:[/?#]|$)/i.test(input)) {+function classifyRawShareUrlSource(input: string, protocolScheme: string): ShareUrlSource | null {+ const escapedScheme = protocolScheme.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');+ if (new RegExp(`^${escapedScheme}:\\/\\/share(?::[^/?#@]*)?(?:[/?#]|$)`, 'i').test(input)) {return 'custom-scheme';}if (/^https?:\/\/(?:www\.)?openknowledge\.ai(?::[^/?#@]*)?\/d\//i.test(input)) {@@ -102,9 +103,12 @@ export type ShareNavigatorPayload = Extract<{ readonly kind: 'launcher-consent' } | { readonly kind: 'launcher-miss' }>;-export function parseShareUrl(input: string): ShareParseResult | null {+export function parseShareUrl(+ input: string,+ protocolScheme: string = 'openknowledge',+): ShareParseResult | null {if (typeof input !== 'string' || input.length === 0) return null;- const rawSource = classifyRawShareUrlSource(input);+ const rawSource = classifyRawShareUrlSource(input, protocolScheme);if (input.includes('\x00') || /%00/i.test(input)) {return rawSource === null ? null : { kind: 'invalid', source: rawSource };}@@ -116,7 +120,7 @@ export function parseShareUrl(input: string): ShareParseResult | null {return rawSource === null ? null : { kind: 'invalid', source: rawSource };}- const source = classifyShareUrlSource(url);+ const source = classifyShareUrlSource(url, protocolScheme);if (source === 'custom-scheme') {return parseShareCustomScheme(url);}@@ -245,7 +249,10 @@ function finalizeV1ShareResult(sharedUrl: string, source: ShareUrlSource): Share};}-export function parseOpenKnowledgeUrl(input: string): ParsedOpenKnowledgeUrl | null {+export function parseOpenKnowledgeUrl(+ input: string,+ protocolScheme: string = 'openknowledge',+): ParsedOpenKnowledgeUrl | null {if (typeof input !== 'string' || input.length === 0) return null;if (input.includes('\x00') || /%00/i.test(input)) return null;@@ -255,7 +262,7 @@ export function parseOpenKnowledgeUrl(input: string): ParsedOpenKnowledgeUrl | n} catch {return null;}- if (parsed.protocol !== 'openknowledge:') return null;+ if (parsed.protocol !== `${protocolScheme}:`) return null;if (parsed.hostname !== 'open') return null;const project = parsed.searchParams.get('project');@@ -290,7 +297,10 @@ interface ParsedOpenKnowledgeFileUrl {readonly file: string;}-export function parseOpenKnowledgeFileUrl(input: string): ParsedOpenKnowledgeFileUrl | null {+export function parseOpenKnowledgeFileUrl(+ input: string,+ protocolScheme: string = 'openknowledge',+): ParsedOpenKnowledgeFileUrl | null {if (typeof input !== 'string' || input.length === 0) return null;if (input.includes('\x00') || /%00/i.test(input)) return null;@@ -300,7 +310,7 @@ export function parseOpenKnowledgeFileUrl(input: string): ParsedOpenKnowledgeFil} catch {return null;}- if (parsed.protocol !== 'openknowledge:') return null;+ if (parsed.protocol !== `${protocolScheme}:`) return null;if (parsed.hostname !== 'open') return null;const file = parsed.searchParams.get('file');@@ -326,7 +336,10 @@ function isScreenTarget(value: string): value is ScreenTarget {return (SCREEN_TARGETS as readonly string[]).includes(value);}-export function parseScreenUrl(input: string): ParsedScreenUrl | null {+export function parseScreenUrl(+ input: string,+ protocolScheme: string = 'openknowledge',+): ParsedScreenUrl | null {if (typeof input !== 'string' || input.length === 0) return null;if (input.includes('\x00') || /%00/i.test(input)) return null;@@ -336,7 +349,7 @@ export function parseScreenUrl(input: string): ParsedScreenUrl | null {} catch {return null;}- if (parsed.protocol !== 'openknowledge:') return null;+ if (parsed.protocol !== `${protocolScheme}:`) return null;if (parsed.hostname !== 'screen') return null;const name = parsed.searchParams.get('name');@@ -412,6 +425,7 @@ interface ProtocolHandlerDeps {getInitialArgv?: () => readonly string[];setTimeout?: (cb: () => void, ms: number) => unknown;platform?: NodeJS.Platform;+ protocolScheme?: string;now?: () => number;log?: {warn(obj: Record<string, unknown>, msg: string): void;@@ -441,6 +455,7 @@ const URL_LAUNCH_SETTLE_GRACE_MS = 250;export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHandlerControl {const schedule = deps.setTimeout ?? ((cb, ms) => setTimeout(cb, ms));const platform = deps.platform ?? process.platform;+ const protocolScheme = deps.protocolScheme ?? 'openknowledge';const urlQueue: string[] = [];const shareDedup = new Map<string, number>();let flushed = false;@@ -461,7 +476,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHandif (!deps.app.isPackaged) {try {- const ok = deps.app.setAsDefaultProtocolClient('openknowledge');+ const ok = deps.app.setAsDefaultProtocolClient(protocolScheme);if (!ok) {deps.log?.warn({},@@ -470,7 +485,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHand} else {deps.app.on('before-quit', () => {try {- deps.app.removeAsDefaultProtocolClient('openknowledge');+ deps.app.removeAsDefaultProtocolClient(protocolScheme);} catch (err) {deps.log?.warn({ err },@@ -484,7 +499,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHand}} else {try {- const ok = deps.app.setAsDefaultProtocolClient('openknowledge');+ const ok = deps.app.setAsDefaultProtocolClient(protocolScheme);if (!ok) {deps.log?.error({},@@ -773,17 +788,17 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHand};const routeUrl = (url: string): void => {- const share = parseShareUrl(url);+ const share = parseShareUrl(url, protocolScheme);if (share !== null) {routeShare(share);return;}- const screen = parseScreenUrl(url);+ const screen = parseScreenUrl(url, protocolScheme);if (screen !== null) {routeScreen(url, screen.name);return;}- const fileOpen = parseOpenKnowledgeFileUrl(url);+ const fileOpen = parseOpenKnowledgeFileUrl(url, protocolScheme);if (fileOpen !== null) {const open = deps.openEphemeralFile;if (!open) {@@ -798,7 +813,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHand});return;}- const parsed = parseOpenKnowledgeUrl(url);+ const parsed = parseOpenKnowledgeUrl(url, protocolScheme);if (!parsed) {deps.log?.warn({}, '[url-scheme] dropped malformed URL');return;@@ -826,11 +841,11 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHand};const enqueueOrRoute = (url: string): void => {- const isSingleFile = parseOpenKnowledgeFileUrl(url) !== null;+ const isSingleFile = parseOpenKnowledgeFileUrl(url, protocolScheme) !== null;if (isSingleFile) {singleFileLaunch = true;}- if (isSingleFile || parseShareUrl(url)?.kind === 'ok') {+ if (isSingleFile || parseShareUrl(url, protocolScheme)?.kind === 'ok') {urlLaunchOwnsWindow = true;settleNow();}@@ -848,7 +863,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHanddeps.app.on('open-file', (event, filePath) => {event.preventDefault();- enqueueOrRoute(`openknowledge://open?file=${encodeURIComponent(filePath)}`);+ enqueueOrRoute(`${protocolScheme}://open?file=${encodeURIComponent(filePath)}`);});deps.app.on('continue-activity', (event, type, userInfo, details) => {@@ -873,7 +888,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHandlet fileArguments = 0;let unencodableArguments = 0;for (const arg of argv) {- if (arg.startsWith('openknowledge://')) {+ if (arg.startsWith(`${protocolScheme}://`)) {urlArguments += 1;enqueueOrRoute(arg);} else if (@@ -887,7 +902,7 @@ export function registerProtocolHandler(deps: ProtocolHandlerDeps): ProtocolHandcontinue;}fileArguments += 1;- enqueueOrRoute(`openknowledge://open?file=${encodeURIComponent(arg)}`);+ enqueueOrRoute(`${protocolScheme}://open?file=${encodeURIComponent(arg)}`);}}deps.log?.info?.(diff --git a/packages/desktop/src/shared/desktop-variant.test.ts b/packages/desktop/src/shared/desktop-variant.test.tsnew file mode 100644index 000000000..e89fb4a59--- /dev/null+++ b/packages/desktop/src/shared/desktop-variant.test.ts@@ -0,0 +1,48 @@+import { describe, expect, test } from 'vitest';+import {+ DESKTOP_VARIANTS,+ type DesktopVariantName,+ parseDesktopVariantName,+} from './desktop-variant.ts';++describe('desktop variant identities', () => {+ test('keeps Stable on every existing identity', () => {+ expect(DESKTOP_VARIANTS.stable).toMatchObject({+ appId: 'com.inkeep.open-knowledge',+ productName: 'OpenKnowledge',+ artifactName: 'OpenKnowledge',+ protocolScheme: 'openknowledge',+ updateChannel: 'latest',+ cliCommandNames: ['ok', 'open-knowledge'],+ });+ });++ test('gives every variant a disjoint persistent identity', () => {+ const identities = Object.values(DESKTOP_VARIANTS);+ const keys: Array<keyof (typeof identities)[number]> = [+ 'appId',+ 'productName',+ 'artifactName',+ 'packageName',+ 'protocolScheme',+ 'updateChannel',+ 'linuxExecutableName',+ ];+ for (const key of keys) {+ expect(new Set(identities.map((identity) => identity[key])).size).toBe(identities.length);+ }+ expect(new Set(identities.flatMap((identity) => identity.cliCommandNames)).size).toBe(4);+ });++ test.each<[string | undefined, DesktopVariantName]>([+ [undefined, 'stable'],+ ['', 'stable'],+ [' BETA ', 'beta'],+ ])('parses %j as %s', (raw, expected) => {+ expect(parseDesktopVariantName(raw)).toBe(expected);+ });++ test('rejects unknown variants before a build starts', () => {+ expect(() => parseDesktopVariantName('nightly')).toThrow(/stable or beta/);+ });+});diff --git a/packages/desktop/src/shared/desktop-variant.ts b/packages/desktop/src/shared/desktop-variant.tsnew file mode 100644index 000000000..ee0bdef5f--- /dev/null+++ b/packages/desktop/src/shared/desktop-variant.ts@@ -0,0 +1,76 @@+import { DESKTOP_PRODUCTS, type DesktopProductName } from '@inkeep/open-knowledge-core';++const DESKTOP_VARIANT_NAMES = ['stable', 'beta'] as const satisfies readonly DesktopProductName[];++export type DesktopVariantName = (typeof DESKTOP_VARIANT_NAMES)[number];++interface DesktopVariantIdentity {+ readonly name: DesktopVariantName;+ readonly appId: string;+ readonly productName: string;+ readonly artifactName: string;+ readonly packageName: string;+ readonly protocolScheme: string;+ readonly updateChannel: 'latest' | 'beta';+ readonly instanceLabel: string | null;+ readonly iconPath: string;+ readonly linuxExecutableName: string;+ readonly linuxPackageNames: {+ readonly deb: string;+ readonly rpm: string;+ };+ readonly cliCommandNames: readonly [string, string];+ readonly cliHomeSegment: string | null;+}++export const DESKTOP_VARIANTS = {+ stable: {+ name: 'stable',+ appId: DESKTOP_PRODUCTS.stable.appId,+ productName: DESKTOP_PRODUCTS.stable.productName,+ artifactName: 'OpenKnowledge',+ packageName: DESKTOP_PRODUCTS.stable.packageName,+ protocolScheme: 'openknowledge',+ updateChannel: 'latest',+ instanceLabel: null,+ iconPath: 'build/icon.png',+ linuxExecutableName: DESKTOP_PRODUCTS.stable.linuxExecutableName,+ linuxPackageNames: DESKTOP_PRODUCTS.stable.linuxPackageNames,+ cliCommandNames: ['ok', 'open-knowledge'],+ cliHomeSegment: null,+ },+ beta: {+ name: 'beta',+ appId: DESKTOP_PRODUCTS.beta.appId,+ productName: DESKTOP_PRODUCTS.beta.productName,+ artifactName: 'OpenKnowledge-Beta',+ packageName: DESKTOP_PRODUCTS.beta.packageName,+ protocolScheme: 'openknowledge-beta',+ updateChannel: 'beta',+ instanceLabel: 'Beta',+ iconPath: 'build/icon-beta.png',+ linuxExecutableName: DESKTOP_PRODUCTS.beta.linuxExecutableName,+ linuxPackageNames: DESKTOP_PRODUCTS.beta.linuxPackageNames,+ cliCommandNames: ['ok-beta', 'open-knowledge-beta'],+ cliHomeSegment: 'beta',+ },+} as const satisfies Record<DesktopVariantName, DesktopVariantIdentity>;++export function parseDesktopVariantName(raw: string | undefined): DesktopVariantName {+ const normalized = raw?.trim().toLowerCase() || 'stable';+ if ((DESKTOP_VARIANT_NAMES as readonly string[]).includes(normalized)) {+ return normalized as DesktopVariantName;+ }+ throw new Error(+ `Unsupported OK_DESKTOP_VARIANT=${JSON.stringify(raw)}. Expected stable or beta.`,+ );+}++declare const __OK_DESKTOP_VARIANT__: string | undefined;++export const DESKTOP_VARIANT =+ DESKTOP_VARIANTS[+ parseDesktopVariantName(+ typeof __OK_DESKTOP_VARIANT__ === 'string' ? __OK_DESKTOP_VARIANT__ : undefined,+ )+ ];diff --git a/packages/desktop/tests/integration/auto-updater.test.ts b/packages/desktop/tests/integration/auto-updater.test.tsindex 8459bf3af..9ed72075c 100644--- a/packages/desktop/tests/integration/auto-updater.test.ts+++ b/packages/desktop/tests/integration/auto-updater.test.ts@@ -191,6 +191,7 @@ interface TestRig {function makeRig(overrides?: Partial<AppState> & {appVersion?: string;+ buildChannel?: Parameters<typeof startAutoUpdater>[0]['buildChannel'];isPackaged?: boolean;platform?: NodeJS.Platform;forceDevBypass?: boolean;@@ -212,6 +213,7 @@ function makeRig(} {const {appVersion = '0.3.1',+ buildChannel,isPackaged = true,platform = 'darwin',forceDevBypass,@@ -265,6 +267,7 @@ function makeRig(getPrimaryWindow: () => primaryWindow,getAllWindows: extraWindowCount > 0 ? () => fanOutTargets : undefined,getAppVersion: () => appVersion,+ buildChannel,isPackaged,platform,forceDevBypass,@@ -399,6 +402,13 @@ describe('startAutoUpdater — initial configuration (parent §8.10 LOCKED)', ()expect(rig.updater.allowDowngrade).toBe(false);});+ test('compiled product channel overrides a mismatched package version', () => {+ const { rig } = makeRig({ appVersion: '0.4.0', buildChannel: 'beta' });+ expect(rig.updater.channel).toBe('beta');+ expect(rig.updater.allowPrerelease).toBe(true);+ expect(rig.updater.allowDowngrade).toBe(false);+ });+test('channel is build-derived only — no persisted preference is consulted', () => {const stable = makeRig({ appVersion: '0.4.0' });expect(stable.rig.updater.channel).toBe('latest');diff --git a/packages/desktop/tests/main/url-scheme-handler.test.ts b/packages/desktop/tests/main/url-scheme-handler.test.tsindex f10a954e5..95f7bdbf8 100644--- a/packages/desktop/tests/main/url-scheme-handler.test.ts+++ b/packages/desktop/tests/main/url-scheme-handler.test.ts@@ -193,6 +193,28 @@ describe('registerProtocolHandler — setAsDefaultProtocolClient', () => {expect(env.app.setAsDefaultProtocolClient).toHaveBeenCalledWith('openknowledge');});+ test('registers and routes file opens through the Beta scheme', async () => {+ const env = makeEnv({ isPackaged: true });+ const control = registerProtocolHandler({+ app: env.app,+ focusWindowForProject: env.focusWindowForProject,+ openProject: env.openProject,+ openEphemeralFile: env.openEphemeralFile,+ sendDeepLink: env.sendDeepLink,+ getAnyReadyWindow: env.getAnyReadyWindow,+ setTimeout: (cb, ms) => env.timers.push({ cb, ms }),+ protocolScheme: 'openknowledge-beta',+ });++ expect(env.app.setAsDefaultProtocolClient).toHaveBeenCalledWith('openknowledge-beta');+ env.app.fireOpenFile('/Users/me/notes/beta.md');+ env.app.resolveReady();+ await flushPromises();+ control.drainQueuedUrls();+ await flushPromises();+ expect(env.openEphemeralFile).toHaveBeenCalledWith('/Users/me/notes/beta.md');+ });+for (const platform of ['darwin', 'win32', 'linux'] as const) {test(`packaged ${platform} builds self-heal the scheme binding per boot`, () => {const env = makeEnv({ isPackaged: true });diff --git a/packages/desktop/tests/unit/desktop-variant-config.test.ts b/packages/desktop/tests/unit/desktop-variant-config.test.tsnew file mode 100644index 000000000..59c14bc41--- /dev/null+++ b/packages/desktop/tests/unit/desktop-variant-config.test.ts@@ -0,0 +1,270 @@+import { readFileSync } from 'node:fs';+import { dirname, resolve } from 'node:path';+import { fileURLToPath } from 'node:url';+import { describe, expect, test } from 'vitest';+import {+ betaBuildVersion,+ createLocalEntitlements,+ createVariantBuilderConfig,+ createVariantHelperInfo,+ createVariantNsisInclude,+ createVariantPostInstall,+ createVariantPostRemove,+ parseBuilderConfig,+} from '../../scripts/desktop-variant-config.ts';++const desktopRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..');++const configSource = `+appId: com.inkeep.open-knowledge+productName: OpenKnowledge+protocols:+ - name: OpenKnowledge URL+ schemes: [openknowledge]+publish:+ - provider: github+ owner: inkeep+ repo: open-knowledge+ channel: latest+mac:+ icon: build/okglass.icon+ entitlements: build/entitlements.mac.plist+ provisioningProfile: build/embedded.provisionprofile+ extraResources: []+ extraFiles: []+ extendInfo: {}+win:+ icon: build/icon.png+ extraResources:+ - from: resources/cli/bin/ok.cmd+ to: cli/bin/ok.cmd+ - from: resources/cli/bin/ok.ps1+ to: cli/bin/ok.ps1+dmg:+ artifactName: \${productName}-\${arch}.\${ext}+linux:+ icon: build/icon.png+ artifactName: \${productName}-\${arch}.\${ext}+ executableName: openknowledge+ extraResources: []+nsis:+ artifactName: \${productName}-Setup-\${arch}.\${ext}+ include: build/installer.nsh+deb:+ afterInstall: build/deb-postinst.sh+ afterRemove: build/deb-postrm.sh+rpm:+ afterInstall: build/deb-postinst.sh+ afterRemove: build/deb-postrm.sh+ depends: [libsecret]+`;++const paths = {+ includePath: '.variant-build/installer.nsh',+ postInstallPath: '.variant-build/deb-postinst.sh',+ postRemovePath: '.variant-build/deb-postrm.sh',+ localEntitlementsPath: '.variant-build/entitlements.mac.local.plist',+ helperInfoPath: '.variant-build/helper-Info.plist',+ profileAvailable: false,+};++const token = (name: string): string => `\${${name}}`;+const macArtifact = (name: string): string =>+ `${name}-${token('version')}-${token('arch')}-mac.${token('ext')}`;+const platformArtifact = (name: string): string => `${name}-${token('arch')}.${token('ext')}`;+const nsisArtifact = (name: string): string => `${name}-Setup-${token('arch')}.${token('ext')}`;++describe('desktop variant builder config', () => {+ test('preserves Stable identity', () => {+ const config = createVariantBuilderConfig(+ parseBuilderConfig(configSource),+ 'stable',+ paths,+ '0.77.7',+ );+ expect(config).toMatchObject({+ appId: 'com.inkeep.open-knowledge',+ productName: 'OpenKnowledge',+ protocols: [{ schemes: ['openknowledge'] }],+ publish: [{ channel: 'latest' }],+ mac: {+ icon: 'build/okglass.icon',+ artifactName: macArtifact('OpenKnowledge'),+ provisioningProfile: 'build/embedded.provisionprofile',+ },+ dmg: { artifactName: platformArtifact('OpenKnowledge') },+ nsis: { artifactName: nsisArtifact('OpenKnowledge') },+ linux: {+ artifactName: platformArtifact('OpenKnowledge'),+ executableName: 'openknowledge',+ },+ deb: {+ afterInstall: paths.postInstallPath,+ afterRemove: paths.postRemovePath,+ packageName: 'openknowledge',+ },+ rpm: {+ afterInstall: paths.postInstallPath,+ afterRemove: paths.postRemovePath,+ packageName: 'OpenKnowledge',+ depends: ['libsecret'],+ },+ });+ expect(config.win.extraResources).toEqual([+ { from: 'resources/cli/bin/ok.cmd', to: 'cli/bin/ok.cmd' },+ { from: 'resources/cli/bin/ok.ps1', to: 'cli/bin/ok.ps1' },+ ]);+ });++ test('builds isolated Beta config', () => {+ const beta = createVariantBuilderConfig(+ parseBuilderConfig(configSource),+ 'beta',+ paths,+ '0.77.7',+ );+ expect(beta).toMatchObject({+ appId: 'com.inkeep.open-knowledge.beta',+ productName: 'OpenKnowledge Beta',+ protocols: [{ schemes: ['openknowledge-beta'] }],+ publish: [{ channel: 'beta' }],+ extraMetadata: {+ name: 'openknowledge-beta-desktop',+ productName: 'OpenKnowledge Beta',+ version: '0.77.7-beta.0',+ },+ mac: {+ icon: 'build/icon-beta.png',+ artifactName: macArtifact('OpenKnowledge-Beta'),+ entitlements: paths.localEntitlementsPath,+ },+ dmg: { artifactName: platformArtifact('OpenKnowledge-Beta') },+ nsis: { artifactName: nsisArtifact('OpenKnowledge-Beta') },+ linux: {+ artifactName: platformArtifact('OpenKnowledge-Beta'),+ executableName: 'openknowledge-beta',+ },+ deb: {+ afterInstall: paths.postInstallPath,+ afterRemove: paths.postRemovePath,+ packageName: 'openknowledge-beta-desktop',+ },+ rpm: {+ afterInstall: paths.postInstallPath,+ afterRemove: paths.postRemovePath,+ packageName: 'openknowledge-beta-desktop',+ depends: ['libsecret'],+ },+ });+ expect(beta.mac.provisioningProfile).toBeUndefined();+ expect(beta.win.extraResources.map((entry) => entry.to)).toEqual([+ 'cli/bin/ok-beta.cmd',+ 'cli/bin/ok-beta.ps1',+ 'cli/bin/open-knowledge-beta.cmd',+ 'cli/bin/open-knowledge-beta.ps1',+ ]);+ });++ test('selects the matching signed profile when it is available', () => {+ const beta = createVariantBuilderConfig(+ parseBuilderConfig(configSource),+ 'beta',+ {+ ...paths,+ profileAvailable: true,+ },+ '0.77.7-beta.4',+ );+ expect(beta.mac.provisioningProfile).toBe('build/embedded.beta.provisionprofile');+ expect(beta.mac.entitlements).toBe('build/entitlements.mac.plist');+ expect(beta.extraMetadata?.version).toBe('0.77.7-beta.4');+ });++ test('derives a valid manual Beta version from the package version', () => {+ expect(betaBuildVersion('0.77.7')).toBe('0.77.7-beta.0');+ expect(betaBuildVersion('0.77.7-beta.4')).toBe('0.77.7-beta.4');+ expect(() => betaBuildVersion('dev')).toThrow(/invalid/);+ });++ test('names platform integration shims per variant', () => {+ expect(+ createVariantNsisInclude(+ 'openknowledge:// Software\\Classes\\openknowledge URL:OpenKnowledge',+ 'beta',+ ),+ ).toBe('openknowledge-beta:// Software\\Classes\\openknowledge-beta URL:OpenKnowledge Beta');+ expect(+ createVariantPostInstall(+ 'ln -sf "$OK_WRAPPER" /usr/bin/ok\nln -sf "$OK_WRAPPER" /usr/bin/open-knowledge',+ 'beta',+ ),+ ).toContain(+ 'ln -sf "$OK_WRAPPER" /usr/bin/ok-beta\nln -sf "$OK_WRAPPER" /usr/bin/open-knowledge-beta',+ );+ expect(+ createVariantPostRemove('for link in /usr/bin/ok /usr/bin/open-knowledge; do', 'beta'),+ ).toContain('/usr/bin/ok-beta /usr/bin/open-knowledge-beta');+ });++ test('drops the restricted entitlement for unsigned local variant builds', () => {+ expect(+ createLocalEntitlements(+ '<dict>\n<key>com.apple.developer.associated-domains</key><array><string>x</string></array>\n</dict>',+ ),+ ).toBe('<dict>\n</dict>');+ });++ test('names the detached helper bundle with the variant identity', () => {+ expect(+ createVariantHelperInfo(+ 'com.inkeep.open-knowledge.server OpenKnowledge Server OpenKnowledge Helper',+ 'beta',+ ),+ ).toBe(+ 'com.inkeep.open-knowledge.beta.server OpenKnowledge Beta Server OpenKnowledge Beta Helper',+ );+ });++ test('transforms every committed packaging template for both variants', () => {+ const installer = readFileSync(resolve(desktopRoot, 'build/installer.nsh'), 'utf8');+ const postInstall = readFileSync(resolve(desktopRoot, 'build/deb-postinst.sh'), 'utf8');+ const postRemove = readFileSync(resolve(desktopRoot, 'build/deb-postrm.sh'), 'utf8');+ const entitlements = readFileSync(resolve(desktopRoot, 'build/entitlements.mac.plist'), 'utf8');+ const helperInfo = readFileSync(resolve(desktopRoot, 'build/helper-bundle/Info.plist'), 'utf8');++ for (const variant of ['stable', 'beta'] as const) {+ expect(() => createVariantNsisInclude(installer, variant)).not.toThrow();+ expect(() => createVariantPostInstall(postInstall, variant)).not.toThrow();+ expect(() => createVariantPostRemove(postRemove, variant)).not.toThrow();+ expect(() => createVariantHelperInfo(helperInfo, variant)).not.toThrow();+ }+ expect(() => createLocalEntitlements(entitlements)).not.toThrow();+ });++ test('fails closed when a packaging template loses a required anchor', () => {+ expect(() => createVariantNsisInclude('openknowledge://', 'beta')).toThrow(/registry key/);+ expect(() => createVariantPostInstall('ln -sf "$OK_WRAPPER" /usr/bin/ok', 'beta')).toThrow(+ /open-knowledge install command/,+ );+ expect(() => createVariantPostRemove('missing', 'beta')).toThrow(/removal loop/);+ expect(() => createLocalEntitlements('<dict/>')).toThrow(/associated-domains/);+ expect(() => createVariantHelperInfo('OpenKnowledge Server', 'beta')).toThrow(+ /bundle identifier/,+ );+ });++ test('invokes the builder JavaScript entrypoint without a Windows command shim', () => {+ const wrapper = readFileSync(resolve(desktopRoot, 'scripts/run-electron-builder.mjs'), 'utf8');+ expect(wrapper).toContain("require.resolve('electron-builder/cli.js')");+ expect(wrapper).toMatch(/spawnSync\(\s*process\.execPath/);+ expect(wrapper).not.toContain('pnpm.cmd');+ expect(wrapper).toMatch(/electron-builder terminated by \$\{result\.signal\}/);+ });++ test('keeps direct and generated Linux configs aligned on the rebuild policy', () => {+ const wrapper = readFileSync(resolve(desktopRoot, 'scripts/run-electron-builder.mjs'), 'utf8');+ const overlay = readFileSync(resolve(desktopRoot, 'electron-builder.linux.yml'), 'utf8');+ expect(wrapper).toContain("if (args.includes('--linux')) config.npmRebuild = false;");+ expect(overlay).toMatch(/^npmRebuild:\s*false$/m);+ });+});diff --git a/packages/desktop/tests/unit/helper-bundle-name-agreement.test.ts b/packages/desktop/tests/unit/helper-bundle-name-agreement.test.tsindex 5843042e4..9cf2ebef5 100644--- a/packages/desktop/tests/unit/helper-bundle-name-agreement.test.ts+++ b/packages/desktop/tests/unit/helper-bundle-name-agreement.test.ts@@ -1,6 +1,7 @@import { readFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';+import { DESKTOP_PRODUCTS, desktopWindowsExecutableName } from '@inkeep/open-knowledge-core';import {HELPER_BUNDLE_NAME,HELPER_EXECUTABLE_NAME,@@ -13,6 +14,9 @@ const helperPlistPath = resolve(desktopRoot, 'build/helper-bundle/Info.plist');const afterPackPath = resolve(desktopRoot, 'scripts/afterPack.mjs');const electronBuilderYmlPath = resolve(desktopRoot, 'electron-builder.yml');const okShPath = resolve(desktopRoot, 'resources/cli/bin/ok.sh');+const okCmdPath = resolve(desktopRoot, 'resources/cli/bin/ok.cmd');+const okPs1Path = resolve(desktopRoot, 'resources/cli/bin/ok.ps1');+const okLinuxPath = resolve(desktopRoot, 'resources/cli/bin/ok-linux.sh');function extractPlistString(content: string, key: string): string | null {const re = new RegExp(`<key>${key}</key>\\s*<string>([^<]*)</string>`);@@ -42,10 +46,10 @@ describe('helper-bundle name agreement across spawn site / Info.plist / afterPacexpect(HELPER_BUNDLE_NAME).not.toBe(`${HELPER_EXECUTABLE_NAME}.app`);});- test('afterPack.mjs uses `<appName> Helper` as the cloned-binary basename (not a custom name)', () => {+ test('afterPack.mjs derives the helper bundle and executable from the product name', () => {const afterPack = readFileSync(afterPackPath, 'utf8');expect(afterPack).toMatch(/`\$\{appName\}\s+Helper`/);- expect(afterPack).toMatch(new RegExp(`['"]${HELPER_BUNDLE_NAME.replace(/\./g, '\\.')}['"]`));+ expect(afterPack).toMatch(/`\$\{appName\} Server\.app`/);});test('electron-builder.yml extraFiles `to:` value references HELPER_BUNDLE_NAME (not just a YAML comment)', () => {@@ -58,10 +62,10 @@ describe('helper-bundle name agreement across spawn site / Info.plist / afterPac);});- test('ok.sh hardcodes the helper bundle path consistent with HELPER_BUNDLE_NAME + HELPER_EXECUTABLE_NAME', () => {+ test('ok.sh derives the helper path from its enclosing app bundle', () => {const okSh = readFileSync(okShPath, 'utf8');- const expectedHelperPath = `Frameworks/${HELPER_BUNDLE_NAME}/Contents/MacOS/${HELPER_EXECUTABLE_NAME}`;- expect(okSh).toContain(expectedHelperPath);+ expect(okSh).toContain('APP_NAME="$(basename "$APP_PATH" .app)"');+ expect(okSh).toContain('Frameworks/$APP_NAME Server.app/Contents/MacOS/$APP_NAME Helper');});test('ok.sh gates the helper redirect to the mcp + start subcommands only', () => {@@ -70,6 +74,17 @@ describe('helper-bundle name agreement across spawn site / Info.plist / afterPacexpect(okSh).toMatch(/mcp\|start\)/);});+ test('platform wrappers recognize every packaged desktop executable', () => {+ const cmd = readFileSync(okCmdPath, 'utf8');+ const ps1 = readFileSync(okPs1Path, 'utf8');+ const linux = readFileSync(okLinuxPath, 'utf8');+ for (const product of Object.values(DESKTOP_PRODUCTS)) {+ expect(cmd).toContain(`"${desktopWindowsExecutableName(product)}"`);+ expect(ps1).toContain(`'${desktopWindowsExecutableName(product)}'`);+ expect(linux).toContain(product.linuxExecutableName);+ }+ });+test('all five sites agree on the executable name (single string-of-truth)', () => {const plist = readFileSync(helperPlistPath, 'utf8');const afterPack = readFileSync(afterPackPath, 'utf8');@@ -86,8 +101,6 @@ describe('helper-bundle name agreement across spawn site / Info.plist / afterPac'm',),);- expect(okSh).toContain(- `Frameworks/${HELPER_BUNDLE_NAME}/Contents/MacOS/${HELPER_EXECUTABLE_NAME}`,- );+ expect(okSh).toContain('Frameworks/$APP_NAME Server.app/Contents/MacOS/$APP_NAME Helper');});});diff --git a/packages/desktop/tsconfig.json b/packages/desktop/tsconfig.jsonindex af30251a6..01781d67c 100644--- a/packages/desktop/tsconfig.json+++ b/packages/desktop/tsconfig.json@@ -6,6 +6,6 @@"lib": ["ES2024", "DOM"],"types": ["node"]},- "include": ["src", "tests", "*.ts"],+ "include": ["src", "tests", "scripts/**/*.ts", "*.ts"],"exclude": ["node_modules", "out", "dist-desktop", "**/*.test.ts"]}