Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.
TypeScript ai-photo-editorcomfyui-alternativegenerative-fillimage-editingimage-generationinpaintinglinuxlocal-aimacosmcpmcp-servernano-banana-alternativeofflinephoto-editorprivacyqwen-imageqwen-image-2-1stable-diffusion-cppvulkanwindows
dev: npx tauri dev refreshes the kokon-service sidecar on every platform
Gabriele Lozupone8e5d20183992
diff --git a/.gitignore b/.gitignoreindex fb07e4e..bb501b2 100644--- a/.gitignore+++ b/.gitignore@@ -28,3 +28,4 @@ __pycache__//docs/launch-day-prs.md/docs/engineering-writeup-outline.md/mcp/LICENSE+/src-tauri/binaries/kokon-*diff --git a/scripts/dev/sidecars.mjs b/scripts/dev/sidecars.mjsnew file mode 100644index 0000000..a39085c--- /dev/null+++ b/scripts/dev/sidecars.mjs@@ -0,0 +1,30 @@+// `npx tauri dev` (beforeDevCommand): builds kokon-service and puts it where Tauri takes its+// sidecars from (src-tauri/binaries/<name>-<target triple>). Tauri copies that file next to the+// dev shell, over the fresh cargo build, so a copy from an older checkout would run an old+// service. Also writes a dev stand-in for kokon-mcp on macOS/Linux when there is none (the+// Windows one is built by mcp/scripts/build-exe.mjs).+import { execFileSync } from "node:child_process";+import { chmodSync, copyFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";+import { dirname, join, resolve } from "node:path";+import { fileURLToPath } from "node:url";++const root = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");+const triple = execFileSync("rustc", ["-vV"], { encoding: "utf8" }).match(/^host: (\S+)/m)[1];+const ext = process.platform === "win32" ? ".exe" : "";+const bin = join(root, "src-tauri", "binaries");++execFileSync("cargo", ["build", "-p", "qls-service"], { cwd: root, stdio: "inherit" });+mkdirSync(bin, { recursive: true });+copyFileSync(join(root, "target", "debug", `kokon-service${ext}`), join(bin, `kokon-service-${triple}${ext}`));+console.log(`kokon-service -> src-tauri/binaries/kokon-service-${triple}${ext}`);++const mcp = join(bin, `kokon-mcp-${triple}${ext}`);+if (!existsSync(mcp)) {+ if (ext) {+ console.warn(`missing ${mcp}: run cd mcp && npm run build:exe (only needed for the MCP server)`);+ } else {+ writeFileSync(mcp, `#!/bin/sh\nexec node "${join(root, "mcp", "build", "kokon-mcp.cjs")}" "$@"\n`);+ chmodSync(mcp, 0o755);+ console.log(`kokon-mcp dev stand-in -> ${mcp}`);+ }+}diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.jsonindex 81679d8..3ed1ea8 100644--- a/src-tauri/tauri.conf.json+++ b/src-tauri/tauri.conf.json@@ -5,7 +5,7 @@"version": "0.9.4","identifier": "app.kokon.desktop","build": {- "beforeDevCommand": "npm run bundled && cargo build -p qls-service && npm run dev",+ "beforeDevCommand": "npm run bundled && node scripts/dev/sidecars.mjs && npm run dev","devUrl": "http://localhost:1420","beforeBuildCommand": "npm run bundled && npm run build","frontendDist": "../dist"