@elizaos/plugin-agent-orchestrator 0.3.14 → 0.3.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"action-examples.d.ts","sourceRoot":"","sources":["../../src/providers/action-examples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;AAyG5E,eAAO,MAAM,2BAA2B,EAAE,QAsCzC,CAAC"}
1
+ {"version":3,"file":"action-examples.d.ts","sourceRoot":"","sources":["../../src/providers/action-examples.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAS,MAAM,eAAe,CAAC;AAgJ5E,eAAO,MAAM,2BAA2B,EAAE,QAuDzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-agent-orchestrator",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Coding agent orchestration plugin - spawn and manage CLI coding agents via PTY",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "files": [
19
19
  "dist",
20
+ "scripts",
20
21
  "README.md",
21
22
  "package.json"
22
23
  ],
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ensures node-pty's native addon is available and spawn-helper is executable.
4
+ *
5
+ * node-pty >=1.0 ships prebuilt binaries under `prebuilds/<platform>-<arch>/`.
6
+ * `bun install` extracts tarballs but can strip execute permissions from the
7
+ * `spawn-helper` Mach-O executable, causing `posix_spawnp failed` at runtime.
8
+ *
9
+ * This script:
10
+ * 1. Looks for prebuilt binaries first (node-pty >=1.0).
11
+ * 2. Falls back to checking for a node-gyp compiled binary (older versions).
12
+ * 3. Ensures `spawn-helper` has execute permissions on Unix platforms.
13
+ */
14
+ import { existsSync, chmodSync, readdirSync } from "node:fs";
15
+ import { execSync } from "node:child_process";
16
+ import { dirname, resolve, join } from "node:path";
17
+ import { fileURLToPath } from "node:url";
18
+
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+ const root = resolve(__dirname, "..");
21
+
22
+ // Check both direct and nested (inside pty-manager) locations
23
+ const candidates = [
24
+ resolve(root, "node_modules", "node-pty"),
25
+ resolve(root, "node_modules", "pty-manager", "node_modules", "node-pty"),
26
+ ];
27
+
28
+ /** Ensure all spawn-helper binaries under prebuilds/ are executable. */
29
+ function fixSpawnHelperPermissions(ptyDir) {
30
+ const prebuildsDir = resolve(ptyDir, "prebuilds");
31
+ if (!existsSync(prebuildsDir)) return;
32
+
33
+ let fixed = 0;
34
+ for (const platform of readdirSync(prebuildsDir)) {
35
+ const helper = join(prebuildsDir, platform, "spawn-helper");
36
+ if (existsSync(helper)) {
37
+ try {
38
+ chmodSync(helper, 0o755);
39
+ fixed++;
40
+ } catch {
41
+ // Ignore permission errors (e.g. read-only filesystem)
42
+ }
43
+ }
44
+ }
45
+ if (fixed > 0) {
46
+ console.log(
47
+ `[ensure-node-pty] Fixed spawn-helper permissions (${fixed} platform(s)) at ${ptyDir}`,
48
+ );
49
+ }
50
+ }
51
+
52
+ for (const ptyDir of candidates) {
53
+ if (!existsSync(ptyDir)) continue;
54
+
55
+ // node-pty >=1.0: prebuilds
56
+ const arch = process.arch;
57
+ const platform = process.platform;
58
+ const prebuildBinary = resolve(
59
+ ptyDir,
60
+ "prebuilds",
61
+ `${platform}-${arch}`,
62
+ "pty.node",
63
+ );
64
+
65
+ if (existsSync(prebuildBinary)) {
66
+ console.log(
67
+ `[ensure-node-pty] Prebuild binary found at ${ptyDir} (${platform}-${arch})`,
68
+ );
69
+ fixSpawnHelperPermissions(ptyDir);
70
+ continue;
71
+ }
72
+
73
+ // Older node-pty: node-gyp compiled binary
74
+ const gypBinary = resolve(ptyDir, "build", "Release", "pty.node");
75
+ if (existsSync(gypBinary)) {
76
+ console.log(`[ensure-node-pty] Native addon already built at ${ptyDir}`);
77
+ fixSpawnHelperPermissions(ptyDir);
78
+ continue;
79
+ }
80
+
81
+ // No binary found — try node-gyp rebuild
82
+ console.log(`[ensure-node-pty] Building native addon at ${ptyDir}...`);
83
+ try {
84
+ execSync("node-gyp rebuild", {
85
+ cwd: ptyDir,
86
+ stdio: "inherit",
87
+ timeout: 120_000,
88
+ });
89
+ console.log("[ensure-node-pty] Build complete.");
90
+ } catch (err) {
91
+ console.error(
92
+ "[ensure-node-pty] Failed to build node-pty native addon.",
93
+ "PTY-based coding agents will not work.",
94
+ err.message,
95
+ );
96
+ }
97
+
98
+ // Fix permissions even after rebuild
99
+ fixSpawnHelperPermissions(ptyDir);
100
+ }