@paradow/ledge 0.12.1 → 0.14.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-UWADG6NX.js → attach-3U4A44ZE.js} +22 -9
- package/dist/cli/{bridge-53ZTDSST.js → bridge-7JT6P53L.js} +2 -2
- package/dist/cli/{chunk-A7YEHYLY.js → chunk-2P2SUT7A.js} +2 -2
- package/dist/cli/{chunk-YUSY3E47.js → chunk-5DDBCJX2.js} +1 -1
- package/dist/cli/{chunk-VY45MACP.js → chunk-5LVPB3ET.js} +436 -135
- package/dist/cli/{chunk-XIO4OIHR.js → chunk-6A7JPTHV.js} +2 -2
- package/dist/cli/{chunk-ZNRXLDSH.js → chunk-D3JQV5AA.js} +6 -6
- package/dist/cli/{chunk-ZEHTNFPV.js → chunk-FPW7MF5X.js} +2 -2
- package/dist/cli/{chunk-FRGNPUDO.js → chunk-IIXALRFM.js} +2 -2
- package/dist/cli/{chunk-XXFUYME7.js → chunk-PFDZ6VYG.js} +1 -1
- package/dist/cli/{chunk-FGOFRWIB.js → chunk-QBJEUZYW.js} +1 -1
- package/dist/cli/chunk-QUUZSAPI.js +6 -0
- package/dist/cli/{chunk-X34LPKG7.js → chunk-ULWVO3TH.js} +4 -3
- package/dist/cli/{chunk-QAEH5TJB.js → chunk-UWANRALT.js} +93 -4
- package/dist/cli/{daemon-LV7V2VP5.js → daemon-KHGAO6BC.js} +3340 -323
- package/dist/cli/{hook-OLZ2I4GM.js → hook-R6OWCFAQ.js} +8 -8
- package/dist/cli/index.js +11 -11
- package/dist/cli/{launch-ZGICGFVU.js → launch-PPTQEWYD.js} +7 -7
- package/dist/cli/send-74LTIRSN.js +14 -0
- package/dist/cli/{setup-TULNBDFB.js → setup-FPQK3NA7.js} +4 -4
- package/dist/cli/{status-LLITXNOW.js → status-QLTB6T3U.js} +3 -3
- package/dist/cli/{uninstall-OFSLCP4T.js → uninstall-QC5WEWDH.js} +4 -4
- package/dist/cli/{version-BGEWDJNC.js → version-AELAEF6T.js} +1 -1
- package/dist/cli/who-5F6CHRA3.js +11 -0
- package/package.json +2 -1
- package/dist/cli/chunk-DKL4DFNI.js +0 -6
- package/dist/cli/send-VV25P46X.js +0 -14
- package/dist/cli/who-K6VK7EXV.js +0 -11
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D3JQV5AA.js";
|
|
4
4
|
import {
|
|
5
5
|
connect
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-PFDZ6VYG.js";
|
|
7
|
+
import "./chunk-ULWVO3TH.js";
|
|
8
8
|
import {
|
|
9
|
-
PROTOCOL_PORT
|
|
10
|
-
|
|
9
|
+
PROTOCOL_PORT,
|
|
10
|
+
backendOf
|
|
11
|
+
} from "./chunk-5LVPB3ET.js";
|
|
11
12
|
import {
|
|
12
13
|
realTmux
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-FPW7MF5X.js";
|
|
15
|
+
import "./chunk-5DDBCJX2.js";
|
|
16
|
+
import "./chunk-QBJEUZYW.js";
|
|
16
17
|
|
|
17
18
|
// src/cli/attach.ts
|
|
18
19
|
import { spawn } from "child_process";
|
|
@@ -24,6 +25,17 @@ function attachInherit(args, env) {
|
|
|
24
25
|
child.on("exit", (c) => resolve(c ?? 1));
|
|
25
26
|
});
|
|
26
27
|
}
|
|
28
|
+
async function nativeSession(id, port) {
|
|
29
|
+
try {
|
|
30
|
+
const c = await connect({ port, timeoutMs: 800 });
|
|
31
|
+
const snap = await c.next("snapshot");
|
|
32
|
+
await Promise.race([c.close(), new Promise((r) => setTimeout(r, 500))]);
|
|
33
|
+
const s = snap.sessions.find((x) => x.id === id);
|
|
34
|
+
return s && backendOf(s) === "omp-rpc" ? s.name : null;
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
27
39
|
async function attach(id, opts = {}) {
|
|
28
40
|
if (!id) {
|
|
29
41
|
console.error("ledge attach: missing session id");
|
|
@@ -32,7 +44,8 @@ async function attach(id, opts = {}) {
|
|
|
32
44
|
const tmux = realTmux(opts.tmuxSocket ?? TMUX_SOCKET);
|
|
33
45
|
const tmuxName = `ledge-${id}`;
|
|
34
46
|
if (!await tmux.hasSession(tmuxName)) {
|
|
35
|
-
|
|
47
|
+
const native = await nativeSession(id, opts.port ?? PROTOCOL_PORT);
|
|
48
|
+
console.error(native ? `ledge attach: ${native} is driven by Ledge over OMP's own protocol: there is no terminal to attach to (open a shell from the app)` : `ledge attach: no session ${id}`);
|
|
36
49
|
return 1;
|
|
37
50
|
}
|
|
38
51
|
let title = tmuxName;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect,
|
|
3
3
|
sendMessageAndAwaitAck
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PFDZ6VYG.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEX_HOOK_VAR
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ULWVO3TH.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/send.ts
|
|
10
10
|
import { randomUUID } from "crypto";
|