@telpin-sistemas/orqen-studio 0.0.0-stage → 0.1.12

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,3 +1,16 @@
1
- # Temporary Holding Version
1
+ # @telpin-sistemas/orqen-studio
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The orqen desktop app — **AI Software Factory Kit**: the requests and issues of your project, the agents working on
4
+ each one in its own worktree, terminals, a Fork-style Git panel and the spec of each request.
5
+
6
+ ```sh
7
+ npm i -g @telpin-sistemas/orqen-studio
8
+ orqen-studio # or: orqen-studio <project folder>
9
+ ```
10
+
11
+ That is all: npm installs the app for your system (Windows x64, macOS Apple Silicon / Intel, Linux x64) and the
12
+ [`orqen`](https://www.npmjs.com/package/@telpin-sistemas/orqen) CLI it runs. Requires Node.js 20.12 or later.
13
+
14
+ - `orqen-studio --wait` keeps the terminal attached (to see the app's log).
15
+ - Linux needs the usual desktop libraries: `libxkbcommon-x11-0 libvulkan1 libwayland-client0 libfontconfig1`.
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.
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ // Opens orqen Studio with the command exposed by the installed npm package.
3
+ // The app itself is a native binary that npm brings in the package of this platform (@telpin-sistemas/orqen-desktop-<os>-<cpu>);
4
+ // the orqen CLI comes as a dependency, so nothing else has to be downloaded or put in the PATH by hand.
5
+ import { spawn } from "node:child_process";
6
+ import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, renameSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
7
+ import { createRequire } from "node:module";
8
+ import { homedir, tmpdir } from "node:os";
9
+ import { delimiter, dirname, join } from "node:path";
10
+
11
+ const require = createRequire(import.meta.url);
12
+ const manifest = require.resolve("../package.json");
13
+ const { name: packageName, version, bin: commands } = require(manifest);
14
+ const [command] = Object.keys(commands);
15
+ const SUPPORTED = ["win32-x64", "darwin-arm64", "darwin-x64", "linux-x64"];
16
+ const platform = `${process.platform}-${process.arch}`;
17
+ const args = process.argv.slice(2);
18
+
19
+ function fail(msg) {
20
+ console.error(`${command}: ${msg}`);
21
+ process.exit(1);
22
+ }
23
+
24
+ // 1. the app for this platform
25
+ let bin;
26
+ try {
27
+ const pkg = require.resolve(`@telpin-sistemas/orqen-desktop-${platform}/package.json`);
28
+ bin = join(dirname(pkg), "bin", process.platform === "win32" ? "orqen-desktop.exe" : "orqen-desktop");
29
+ } catch {
30
+ if (!SUPPORTED.includes(platform)) fail(`there is no build for ${platform} yet (available: ${SUPPORTED.join(", ")}).`);
31
+ fail(`the package @telpin-sistemas/orqen-desktop-${platform} is missing. Reinstall without --omit=optional / --no-optional: npm i -g ${packageName}`);
32
+ }
33
+ if (!existsSync(bin)) fail(`${bin} is missing. Reinstall: npm i -g ${packageName}`);
34
+ if (process.platform !== "win32") { try { chmodSync(bin, 0o755); } catch { /* read-only install: it already has the bit */ } }
35
+
36
+ // 2. the orqen CLI that came with it: the app runs it, and so do the agents inside the app (`orqen` in their PATH)
37
+ const env = { ...process.env };
38
+ const extra = [];
39
+ delete env.ORQEN_DESKTOP_NPM_MANIFEST;
40
+ let cli;
41
+ try { cli = join(dirname(require.resolve("@telpin-sistemas/orqen/package.json")), "dist", "index.js"); } catch { cli = undefined; }
42
+ if (cli && existsSync(cli)) {
43
+ if (!args.includes("--cli")) {
44
+ extra.push("--node", process.execPath, "--cli", cli);
45
+ env.ORQEN_DESKTOP_NPM_MANIFEST = manifest;
46
+ }
47
+ try {
48
+ const shim = join(homedir(), ".orqen", "npm-bin");
49
+ mkdirSync(shim, { recursive: true });
50
+ writeFileSync(join(shim, "orqen.cmd"), `@"${process.execPath}" "${cli}" %*\r\n`);
51
+ writeFileSync(join(shim, "orqen"), `#!/bin/sh\nexec "${process.execPath}" "${cli}" "$@"\n`, { mode: 0o755 });
52
+ env.PATH = `${shim}${delimiter}${env.PATH ?? env.Path ?? ""}`;
53
+ if (process.platform === "win32") env.Path = env.PATH;
54
+ } catch { /* without the shim the agents use the orqen of the PATH, if any */ }
55
+ }
56
+
57
+ const finalArgs = [...extra, ...args.filter((a) => a !== "--wait")];
58
+ // Windows locks a running executable. Keep the npm copy free for an in-app update.
59
+ if (process.platform === "win32") {
60
+ try {
61
+ const cache = join(env.LOCALAPPDATA || tmpdir(), "orqen", "npm-desktop", version);
62
+ const cachedBin = join(cache, "orqen-desktop.exe");
63
+ if (!existsSync(cachedBin)) {
64
+ mkdirSync(cache, { recursive: true });
65
+ const staging = mkdtempSync(join(cache, "copy-"));
66
+ const stagedBin = join(staging, "orqen-desktop.exe");
67
+ try {
68
+ copyFileSync(bin, stagedBin);
69
+ try { renameSync(stagedBin, cachedBin); }
70
+ catch (e) { if (!existsSync(cachedBin)) throw e; }
71
+ } finally {
72
+ if (existsSync(stagedBin)) unlinkSync(stagedBin);
73
+ rmdirSync(staging);
74
+ }
75
+ }
76
+ bin = cachedBin;
77
+ } catch (e) {
78
+ fail(`could not prepare the Windows executable: ${e.message}`);
79
+ }
80
+ }
81
+
82
+ if (process.env.ORQEN_DESKTOP_DRY) {
83
+ console.log(JSON.stringify({ bin, args: finalArgs, path: (env.PATH ?? "").split(delimiter)[0] }));
84
+ process.exit(0);
85
+ }
86
+
87
+ // 3. open it and give the terminal back (--wait: stay attached, to see its log)
88
+ const wait = args.includes("--wait");
89
+ const child = spawn(bin, finalArgs, { env, stdio: wait ? "inherit" : "ignore", detached: !wait, windowsHide: false });
90
+ child.on("error", (e) => fail(`could not start ${bin}: ${e.message}`));
91
+ if (wait) child.on("exit", (code) => process.exit(code ?? 0));
92
+ else child.unref();
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@telpin-sistemas/orqen-studio",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.12",
4
+ "license": "MIT",
5
+ "homepage": "https://github.com/sistemas-telpin/orqen-studio",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/sistemas-telpin/orqen-studio.git"
9
+ },
10
+ "description": "orqen Studio — AI Software Factory Kit for requests, agents, terminals, Git and specs",
11
+ "type": "module",
12
+ "bin": {
13
+ "orqen-studio": "bin/orqen-desktop.js"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ "README.md"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20.12"
21
+ },
22
+ "dependencies": {
23
+ "@telpin-sistemas/orqen": ">=0.1.10"
24
+ },
25
+ "optionalDependencies": {
26
+ "@telpin-sistemas/orqen-desktop-win32-x64": "0.1.12",
27
+ "@telpin-sistemas/orqen-desktop-darwin-arm64": "0.1.12",
28
+ "@telpin-sistemas/orqen-desktop-darwin-x64": "0.1.12",
29
+ "@telpin-sistemas/orqen-desktop-linux-x64": "0.1.12"
30
+ },
31
+ "keywords": [
32
+ "orqen",
33
+ "ai",
34
+ "agents",
35
+ "openspec",
36
+ "desktop"
37
+ ]
38
+ }