pytxo 0.4.0 → 0.6.0

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,10 +1,10 @@
1
- # pytxo (npm)
2
-
3
- npm wrapper for the [Pytxo](https://pytxo.com) CLI. Downloads the matching prebuilt binary from the public [pytxo-releases](https://github.com/Pytxo-dev/pytxo-releases) repo on `postinstall`.
4
-
5
- ```bash
6
- npm i -g pytxo
7
- pytxo doctor
8
- ```
9
-
10
- Set `PYTXO_SKIP_DOWNLOAD=1` and `PYTXO_BINARY=/path/to/pytxo` for local development.
1
+ # pytxo (npm)
2
+
3
+ npm wrapper for the [Pytxo](https://pytxo.com) CLI. Downloads the matching prebuilt binary from the public [pytxo-releases](https://github.com/Pytxo-dev/pytxo-releases) repo on `postinstall`.
4
+
5
+ ```bash
6
+ npm i -g pytxo
7
+ pytxo doctor
8
+ ```
9
+
10
+ Set `PYTXO_SKIP_DOWNLOAD=1` and `PYTXO_BINARY=/path/to/pytxo` for local development.
package/bin/pytxo.js CHANGED
@@ -1,28 +1,28 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const { spawnSync } = require("node:child_process");
5
- const fs = require("node:fs");
6
- const path = require("node:path");
7
-
8
- const binName = process.platform === "win32" ? "pytxo.exe" : "pytxo";
9
- const vendor = path.join(__dirname, "..", "vendor", binName);
10
- const envBin = process.env.PYTXO_BINARY;
11
-
12
- const candidates = [envBin, vendor].filter(Boolean);
13
-
14
- for (const bin of candidates) {
15
- if (fs.existsSync(bin)) {
16
- const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
17
- if (result.error) {
18
- console.error(result.error.message);
19
- process.exit(1);
20
- }
21
- process.exit(result.status ?? 1);
22
- }
23
- }
24
-
25
- console.error(
26
- "pytxo binary not found. Re-run npm install or set PYTXO_BINARY to a local build.",
27
- );
28
- process.exit(1);
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("node:child_process");
5
+ const fs = require("node:fs");
6
+ const path = require("node:path");
7
+
8
+ const binName = process.platform === "win32" ? "pytxo.exe" : "pytxo";
9
+ const vendor = path.join(__dirname, "..", "vendor", binName);
10
+ const envBin = process.env.PYTXO_BINARY;
11
+
12
+ const candidates = [envBin, vendor].filter(Boolean);
13
+
14
+ for (const bin of candidates) {
15
+ if (fs.existsSync(bin)) {
16
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
17
+ if (result.error) {
18
+ console.error(result.error.message);
19
+ process.exit(1);
20
+ }
21
+ process.exit(result.status ?? 1);
22
+ }
23
+ }
24
+
25
+ console.error(
26
+ "pytxo binary not found. Re-run npm install or set PYTXO_BINARY to a local build.",
27
+ );
28
+ process.exit(1);
package/lib/platform.js CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";
2
-
3
- const { platform, arch } = process;
4
-
5
- function getAssetName() {
6
- if (platform === "win32") {
7
- if (arch === "arm64") return "pytxo-windows-arm64.exe";
8
- return "pytxo-windows-x64.exe";
9
- }
10
- if (platform === "darwin") {
11
- if (arch === "arm64") return "pytxo-darwin-arm64";
12
- return "pytxo-darwin-x64";
13
- }
14
- if (platform === "linux") {
15
- if (arch === "arm64") return "pytxo-linux-arm64";
16
- return "pytxo-linux-x64";
17
- }
18
- throw new Error(`Unsupported platform: ${platform} ${arch}`);
19
- }
20
-
21
- module.exports = { getAssetName };
1
+ "use strict";
2
+
3
+ const { platform, arch } = process;
4
+
5
+ function getAssetName() {
6
+ if (platform === "win32") {
7
+ if (arch === "arm64") return "pytxo-windows-arm64.exe";
8
+ return "pytxo-windows-x64.exe";
9
+ }
10
+ if (platform === "darwin") {
11
+ if (arch === "arm64") return "pytxo-darwin-arm64";
12
+ return "pytxo-darwin-x64";
13
+ }
14
+ if (platform === "linux") {
15
+ if (arch === "arm64") return "pytxo-linux-arm64";
16
+ return "pytxo-linux-x64";
17
+ }
18
+ throw new Error(`Unsupported platform: ${platform} ${arch}`);
19
+ }
20
+
21
+ module.exports = { getAssetName };
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
- {
2
- "name": "pytxo",
3
- "version": "0.4.0",
4
- "description": "Pytxo agent hypervisor CLI — local-first PTY orchestration",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/Pytxo-dev/pytxo-releases.git"
9
- },
10
- "homepage": "https://pytxo.com",
11
- "bugs": "https://github.com/Pytxo-dev/pytxo-releases/issues",
12
- "keywords": [
13
- "pytxo",
14
- "cli",
15
- "ai-agents",
16
- "mcp",
17
- "orchestration",
18
- "terminal",
19
- "rust"
20
- ],
21
- "engines": {
22
- "node": ">=18"
23
- },
24
- "bin": {
25
- "pytxo": "bin/pytxo.js"
26
- },
27
- "files": [
28
- "bin",
29
- "lib",
30
- "postinstall.js",
31
- "README.md"
32
- ],
33
- "scripts": {
34
- "postinstall": "node postinstall.js"
35
- }
36
- }
1
+ {
2
+ "name": "pytxo",
3
+ "version": "0.6.0",
4
+ "description": "Pytxo agent hypervisor CLI — local-first PTY orchestration",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Pytxo-dev/pytxo-releases.git"
9
+ },
10
+ "homepage": "https://pytxo.com",
11
+ "bugs": "https://github.com/Pytxo-dev/pytxo-releases/issues",
12
+ "keywords": [
13
+ "pytxo",
14
+ "cli",
15
+ "ai-agents",
16
+ "mcp",
17
+ "orchestration",
18
+ "terminal",
19
+ "rust"
20
+ ],
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "bin": {
25
+ "pytxo": "bin/pytxo.js"
26
+ },
27
+ "files": [
28
+ "bin",
29
+ "lib",
30
+ "postinstall.js",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "postinstall": "node postinstall.js"
35
+ }
36
+ }
package/postinstall.js CHANGED
@@ -1,65 +1,65 @@
1
- "use strict";
2
-
3
- const fs = require("node:fs");
4
- const path = require("node:path");
5
- const https = require("node:https");
6
-
7
- const { getAssetName } = require("./lib/platform");
8
-
9
- const REPO = process.env.PYTXO_REPO || "Pytxo-dev/pytxo-releases";
10
- const VERSION = process.env.PYTXO_VERSION || require("./package.json").version;
11
- const TAG = VERSION.startsWith("v") ? VERSION : `v${VERSION}`;
12
-
13
- const vendorDir = path.join(__dirname, "vendor");
14
- const asset = getAssetName();
15
- const destName = process.platform === "win32" ? "pytxo.exe" : "pytxo";
16
- const dest = path.join(vendorDir, destName);
17
-
18
- function download(url) {
19
- return new Promise((resolve, reject) => {
20
- const file = fs.createWriteStream(dest);
21
- https
22
- .get(url, (res) => {
23
- if (res.statusCode === 302 || res.statusCode === 301) {
24
- const loc = res.headers.location;
25
- if (!loc) return reject(new Error("Redirect without location"));
26
- res.resume();
27
- return download(loc).then(resolve, reject);
28
- }
29
- if (res.statusCode !== 200) {
30
- res.resume();
31
- return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
32
- }
33
- res.pipe(file);
34
- file.on("finish", () => file.close(resolve));
35
- })
36
- .on("error", reject);
37
- });
38
- }
39
-
40
- async function main() {
41
- if (process.env.PYTXO_SKIP_DOWNLOAD === "1") {
42
- console.log("pytxo: PYTXO_SKIP_DOWNLOAD=1, skipping binary download");
43
- return;
44
- }
45
- if (fs.existsSync(dest)) {
46
- return;
47
- }
48
- fs.mkdirSync(vendorDir, { recursive: true });
49
- const url = `https://github.com/${REPO}/releases/download/${TAG}/${asset}`;
50
- console.log(`pytxo: downloading ${asset} from ${TAG}…`);
51
- try {
52
- await download(url);
53
- if (process.platform !== "win32") {
54
- fs.chmodSync(dest, 0o755);
55
- }
56
- } catch (err) {
57
- console.warn(
58
- `pytxo: could not download release binary (${err.message}).\n` +
59
- ` Manual download: https://github.com/${REPO}/releases\n` +
60
- ` Or run: curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash`,
61
- );
62
- }
63
- }
64
-
65
- main();
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const https = require("node:https");
6
+
7
+ const { getAssetName } = require("./lib/platform");
8
+
9
+ const REPO = process.env.PYTXO_REPO || "Pytxo-dev/pytxo-releases";
10
+ const VERSION = process.env.PYTXO_VERSION || require("./package.json").version;
11
+ const TAG = VERSION.startsWith("v") ? VERSION : `v${VERSION}`;
12
+
13
+ const vendorDir = path.join(__dirname, "vendor");
14
+ const asset = getAssetName();
15
+ const destName = process.platform === "win32" ? "pytxo.exe" : "pytxo";
16
+ const dest = path.join(vendorDir, destName);
17
+
18
+ function download(url) {
19
+ return new Promise((resolve, reject) => {
20
+ const file = fs.createWriteStream(dest);
21
+ https
22
+ .get(url, (res) => {
23
+ if (res.statusCode === 302 || res.statusCode === 301) {
24
+ const loc = res.headers.location;
25
+ if (!loc) return reject(new Error("Redirect without location"));
26
+ res.resume();
27
+ return download(loc).then(resolve, reject);
28
+ }
29
+ if (res.statusCode !== 200) {
30
+ res.resume();
31
+ return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
32
+ }
33
+ res.pipe(file);
34
+ file.on("finish", () => file.close(resolve));
35
+ })
36
+ .on("error", reject);
37
+ });
38
+ }
39
+
40
+ async function main() {
41
+ if (process.env.PYTXO_SKIP_DOWNLOAD === "1") {
42
+ console.log("pytxo: PYTXO_SKIP_DOWNLOAD=1, skipping binary download");
43
+ return;
44
+ }
45
+ if (fs.existsSync(dest)) {
46
+ return;
47
+ }
48
+ fs.mkdirSync(vendorDir, { recursive: true });
49
+ const url = `https://github.com/${REPO}/releases/download/${TAG}/${asset}`;
50
+ console.log(`pytxo: downloading ${asset} from ${TAG}…`);
51
+ try {
52
+ await download(url);
53
+ if (process.platform !== "win32") {
54
+ fs.chmodSync(dest, 0o755);
55
+ }
56
+ } catch (err) {
57
+ console.warn(
58
+ `pytxo: could not download release binary (${err.message}).\n` +
59
+ ` Manual download: https://github.com/${REPO}/releases\n` +
60
+ ` Or run: curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash`,
61
+ );
62
+ }
63
+ }
64
+
65
+ main();