@paradow/ledge 0.5.4 → 0.7.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/dist/cli/{attach-QE22G2GY.js → attach-P6CWCJ2R.js} +6 -6
- package/dist/cli/{bridge-7RXMJSOP.js → bridge-ZYR3IBVM.js} +5 -2
- package/dist/cli/{chunk-XZMLFV6H.js → chunk-3TNPEAMR.js} +6 -1
- package/dist/cli/{chunk-U4RU6V35.js → chunk-3TXM4DM7.js} +4 -4
- package/dist/cli/chunk-4BBKLTDB.js +722 -0
- package/dist/cli/{chunk-NKBJ3LD4.js → chunk-GZFSUQZJ.js} +22 -3
- package/dist/cli/{chunk-ISPFJBJM.js → chunk-HR6VWBLT.js} +5 -5
- package/dist/cli/chunk-KD7LKXIF.js +6 -0
- package/dist/cli/{chunk-P2SHPHAN.js → chunk-L6IGH4LF.js} +1 -1
- package/dist/cli/{chunk-IDGN7JGC.js → chunk-MK7NEXY7.js} +1 -1
- package/dist/cli/{chunk-HGNMPXXR.js → chunk-Q5CLZPYJ.js} +2 -2
- package/dist/cli/{daemon-P5XWP2UC.js → daemon-GREPJUOS.js} +984 -164
- package/dist/cli/{hook-ARQEXMYY.js → hook-ZVXQ3MGS.js} +11 -9
- package/dist/cli/index.js +9 -9
- package/dist/cli/{launch-GRWEWGSC.js → launch-PIFVOOJV.js} +6 -6
- package/dist/cli/{setup-EXA6OG5W.js → setup-RMPIUCPH.js} +3 -3
- package/dist/cli/{status-6OOVUG3V.js → status-RVD4U2XH.js} +2 -2
- package/dist/cli/{uninstall-34TVL5BP.js → uninstall-GI4WT3UQ.js} +3 -3
- package/dist/cli/{version-G5DZ7PFI.js → version-X3LYAGKA.js} +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-BRJSMZ7B.js +0 -6
- package/dist/cli/chunk-E6ZQOGY4.js +0 -448
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachEnv
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HR6VWBLT.js";
|
|
4
|
+
import "./chunk-3TXM4DM7.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3TNPEAMR.js";
|
|
8
|
+
import "./chunk-L6IGH4LF.js";
|
|
9
9
|
import {
|
|
10
10
|
connect
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MK7NEXY7.js";
|
|
12
12
|
import {
|
|
13
13
|
PROTOCOL_PORT
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4BBKLTDB.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/attach.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
PROTOCOL_PORT,
|
|
7
7
|
parseClientMessage,
|
|
8
8
|
parseServerMessage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4BBKLTDB.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/bridge.ts
|
|
12
12
|
import WebSocket from "ws";
|
|
@@ -37,6 +37,7 @@ function bridge(opts = {}) {
|
|
|
37
37
|
ws.on("open", () => {
|
|
38
38
|
off = readFrames(input, (raw) => {
|
|
39
39
|
const msg = parseClientMessage(raw);
|
|
40
|
+
if (msg.type === "machines.set" || msg.type === "projects.set" || msg.type === "island.set") return;
|
|
40
41
|
if (ws.bufferedAmount > MAX_FRAME) throw new Error("Ledge bridge is overloaded");
|
|
41
42
|
ws.send(JSON.stringify(msg));
|
|
42
43
|
}, fail);
|
|
@@ -45,7 +46,9 @@ function bridge(opts = {}) {
|
|
|
45
46
|
});
|
|
46
47
|
ws.on("message", (data) => {
|
|
47
48
|
try {
|
|
48
|
-
|
|
49
|
+
const msg = parseServerMessage(JSON.parse(String(data)));
|
|
50
|
+
if (msg.type === "machines" || msg.type === "projects" || msg.type === "island") return;
|
|
51
|
+
if (!output.write(`${JSON.stringify(msg)}
|
|
49
52
|
`)) ws.pause();
|
|
50
53
|
} catch (e) {
|
|
51
54
|
fail(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log,
|
|
3
3
|
paths
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L6IGH4LF.js";
|
|
5
5
|
|
|
6
6
|
// src/tmux.ts
|
|
7
7
|
import { execFile } from "child_process";
|
|
@@ -57,6 +57,11 @@ function realTmux(socket = "ledge", opts = {}) {
|
|
|
57
57
|
if (r.code !== 0) return null;
|
|
58
58
|
return r.stdout.replace(/\s+$/g, "").split("\n").slice(-lines).join("\n");
|
|
59
59
|
},
|
|
60
|
+
async width(name) {
|
|
61
|
+
const r = await t(["display-message", "-p", "-t", `=${name}:`, "#{pane_width}"]);
|
|
62
|
+
const n = Number(r.stdout.trim());
|
|
63
|
+
return r.code === 0 && Number.isInteger(n) && n > 0 ? n : null;
|
|
64
|
+
},
|
|
60
65
|
async hasSession(name) {
|
|
61
66
|
return (await t(["has-session", "-t", `=${name}`])).code === 0;
|
|
62
67
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L6IGH4LF.js";
|
|
4
4
|
import {
|
|
5
5
|
pickName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4BBKLTDB.js";
|
|
7
7
|
|
|
8
8
|
// src/daemon/transcript.ts
|
|
9
9
|
import { closeSync, fstatSync, openSync, readSync } from "fs";
|
|
@@ -120,8 +120,8 @@ function agentEnv(base, extra) {
|
|
|
120
120
|
async function spawnSession(opts) {
|
|
121
121
|
const now = opts.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
|
|
122
122
|
const takenIds = new Set(opts.taken.ids);
|
|
123
|
-
let id;
|
|
124
|
-
do
|
|
123
|
+
let id = opts.id;
|
|
124
|
+
if (id === void 0) do
|
|
125
125
|
id = randomBytes(2).toString("hex");
|
|
126
126
|
while (takenIds.has(id));
|
|
127
127
|
const name = pickName(opts.taken.names, opts.name);
|