@telpin-sistemas/orqen-desktop 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @telpin-sistemas/orqen-desktop
2
2
 
3
- The ORQEN desktop app — **AI Software Factory Kit**: the requests and issues of your project, the agents working on
3
+ The orqen desktop app — **AI Software Factory Kit**: the requests and issues of your project, the agents working on
4
4
  each one in its own worktree, terminals, a Fork-style Git panel and the spec of each request.
5
5
 
6
6
  ```sh
@@ -13,4 +13,4 @@ That is all: npm installs the app for your system (Windows x64, macOS Apple Sili
13
13
 
14
14
  - `orqen-desktop --wait` keeps the terminal attached (to see the app's log).
15
15
  - Linux needs the usual desktop libraries: `libxkbcommon-x11-0 libvulkan1 libwayland-client0 libfontconfig1`.
16
- - Update: `npm i -g @telpin-sistemas/orqen-desktop@latest`.
16
+ - Click **Update orqen** in the bottom bar, then reopen the app when the update is installed. From a terminal, run `orqen update --desktop` with the standalone CLI.
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- // `orqen-desktop [folder]`: opens the ORQEN desktop app installed with npm (npm i -g @telpin-sistemas/orqen-desktop).
2
+ // `orqen-desktop [folder]`: opens the orqen desktop app installed with npm (npm i -g @telpin-sistemas/orqen-desktop).
3
3
  // The app itself is a native binary that npm brings in the package of this platform (@telpin-sistemas/orqen-desktop-<os>-<cpu>);
4
4
  // the orqen CLI comes as a dependency, so nothing else has to be downloaded or put in the PATH by hand.
5
5
  import { spawn } from "node:child_process";
6
- import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
6
+ import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
7
7
  import { createRequire } from "node:module";
8
- import { homedir } from "node:os";
8
+ import { homedir, tmpdir } from "node:os";
9
9
  import { delimiter, dirname, join } from "node:path";
10
10
 
11
11
  const require = createRequire(import.meta.url);
@@ -33,10 +33,15 @@ if (process.platform !== "win32") { try { chmodSync(bin, 0o755); } catch { /* re
33
33
  // 2. the orqen CLI that came with it: the app runs it, and so do the agents inside the app (`orqen` in their PATH)
34
34
  const env = { ...process.env };
35
35
  const extra = [];
36
+ const manifest = require.resolve("../package.json");
37
+ delete env.ORQEN_DESKTOP_NPM_MANIFEST;
36
38
  let cli;
37
39
  try { cli = join(dirname(require.resolve("@telpin-sistemas/orqen/package.json")), "dist", "index.js"); } catch { cli = undefined; }
38
40
  if (cli && existsSync(cli)) {
39
- if (!args.includes("--cli")) extra.push("--node", process.execPath, "--cli", cli);
41
+ if (!args.includes("--cli")) {
42
+ extra.push("--node", process.execPath, "--cli", cli);
43
+ env.ORQEN_DESKTOP_NPM_MANIFEST = manifest;
44
+ }
40
45
  try {
41
46
  const shim = join(homedir(), ".orqen", "npm-bin");
42
47
  mkdirSync(shim, { recursive: true });
@@ -48,6 +53,30 @@ if (cli && existsSync(cli)) {
48
53
  }
49
54
 
50
55
  const finalArgs = [...extra, ...args.filter((a) => a !== "--wait")];
56
+ // Windows locks a running executable. Keep the npm copy free for an in-app update.
57
+ if (process.platform === "win32") {
58
+ try {
59
+ const cache = join(env.LOCALAPPDATA || tmpdir(), "orqen", "npm-desktop", require(manifest).version);
60
+ const cachedBin = join(cache, "orqen-desktop.exe");
61
+ if (!existsSync(cachedBin)) {
62
+ mkdirSync(cache, { recursive: true });
63
+ const staging = mkdtempSync(join(cache, "copy-"));
64
+ const stagedBin = join(staging, "orqen-desktop.exe");
65
+ try {
66
+ copyFileSync(bin, stagedBin);
67
+ try { renameSync(stagedBin, cachedBin); }
68
+ catch (e) { if (!existsSync(cachedBin)) throw e; }
69
+ } finally {
70
+ if (existsSync(stagedBin)) unlinkSync(stagedBin);
71
+ rmdirSync(staging);
72
+ }
73
+ }
74
+ bin = cachedBin;
75
+ } catch (e) {
76
+ fail(`could not prepare the Windows executable: ${e.message}`);
77
+ }
78
+ }
79
+
51
80
  if (process.env.ORQEN_DESKTOP_DRY) {
52
81
  console.log(JSON.stringify({ bin, args: finalArgs, path: (env.PATH ?? "").split(delimiter)[0] }));
53
82
  process.exit(0);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@telpin-sistemas/orqen-desktop",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/sistemas-telpin/orqen-gui",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/sistemas-telpin/orqen-gui.git"
9
9
  },
10
- "description": "ORQEN — AI Software Factory Kit: the desktop app (requests, agents, terminals, Git and specs)",
10
+ "description": "orqen — AI Software Factory Kit: the desktop app (requests, agents, terminals, Git and specs)",
11
11
  "type": "module",
12
12
  "bin": {
13
13
  "orqen-desktop": "bin/orqen-desktop.js"
@@ -20,13 +20,13 @@
20
20
  "node": ">=20.12"
21
21
  },
22
22
  "dependencies": {
23
- "@telpin-sistemas/orqen": ">=0.1.3"
23
+ "@telpin-sistemas/orqen": ">=0.1.7"
24
24
  },
25
25
  "optionalDependencies": {
26
- "@telpin-sistemas/orqen-desktop-win32-x64": "0.1.7",
27
- "@telpin-sistemas/orqen-desktop-darwin-arm64": "0.1.7",
28
- "@telpin-sistemas/orqen-desktop-darwin-x64": "0.1.7",
29
- "@telpin-sistemas/orqen-desktop-linux-x64": "0.1.7"
26
+ "@telpin-sistemas/orqen-desktop-win32-x64": "0.1.9",
27
+ "@telpin-sistemas/orqen-desktop-darwin-arm64": "0.1.9",
28
+ "@telpin-sistemas/orqen-desktop-darwin-x64": "0.1.9",
29
+ "@telpin-sistemas/orqen-desktop-linux-x64": "0.1.9"
30
30
  },
31
31
  "keywords": [
32
32
  "orqen",