callwalkietalkie 0.8.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.
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copy the Mac server into cli/runtime so the npm package is self-contained.
4
+ * No-ops when the parent git checkout isn't present (e.g. plain `npm install`
5
+ * from the registry, where runtime/ is already in the tarball).
6
+ */
7
+ import { cpSync, mkdirSync, rmSync, existsSync } from "node:fs";
8
+ import { dirname, join } from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+
11
+ const cliRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
12
+ const repoRoot = join(cliRoot, "..");
13
+ const dest = join(cliRoot, "runtime");
14
+
15
+ const winproxy = join(repoRoot, "winproxy.py");
16
+ const adapter = join(repoRoot, "cmux-adapter", "cmux_adapter.py");
17
+ const agentUi = join(repoRoot, "agent_ui.html");
18
+ const reqs = join(repoRoot, "requirements.txt");
19
+
20
+ if (!existsSync(winproxy) || !existsSync(adapter) || !existsSync(agentUi)) {
21
+ // Published install: runtime/ already shipped in the package.
22
+ if (existsSync(join(dest, "winproxy.py"))) process.exit(0);
23
+ console.error("sync-runtime: missing server sources and no bundled runtime/");
24
+ process.exit(1);
25
+ }
26
+
27
+ rmSync(dest, { recursive: true, force: true });
28
+ mkdirSync(join(dest, "cmux-adapter"), { recursive: true });
29
+ cpSync(winproxy, join(dest, "winproxy.py"));
30
+ cpSync(adapter, join(dest, "cmux-adapter", "cmux_adapter.py"));
31
+ cpSync(agentUi, join(dest, "agent_ui.html"));
32
+ cpSync(reqs, join(dest, "requirements.txt"));
33
+ console.log("synced cli/runtime");