khala-cli 0.4.9 → 0.4.10
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/THIRD_PARTY_NOTICES.txt +28 -0
- package/dist/{chunk-NIX5F4LT.mjs → chunk-2AMWQ7RB.mjs} +330 -66
- package/dist/{chunk-PAJ4JJPV.mjs → chunk-3E5DH3Y6.mjs} +43 -6
- package/dist/{chunk-NGSYOVQ4.mjs → chunk-4BP7V3OP.mjs} +2 -2
- package/dist/{chunk-TEFOQXBK.mjs → chunk-4BZQ4GVW.mjs} +3 -3
- package/dist/{chunk-ITFD3JZS.mjs → chunk-5JSGA6OB.mjs} +424 -78
- package/dist/{chunk-QKWEZXR3.mjs → chunk-6AQVW5W7.mjs} +12 -4
- package/dist/{chunk-UK5GJO4Y.mjs → chunk-6J2PUM7L.mjs} +6 -5
- package/dist/{chunk-P3YIN7G7.mjs → chunk-6SUV3EW6.mjs} +11 -10
- package/dist/{chunk-GSZADJMW.mjs → chunk-ARIDZOTI.mjs} +309 -81
- package/dist/chunk-C2WEDMAF.mjs +15 -0
- package/dist/{chunk-DJM23SIU.mjs → chunk-CHC4VZF5.mjs} +7 -8
- package/dist/{chunk-BLCRVRIK.mjs → chunk-CKLCR5G4.mjs} +456 -87
- package/dist/{chunk-7R3EIDGR.mjs → chunk-EVT2DWNZ.mjs} +1 -1
- package/dist/{chunk-KMLXOPBQ.mjs → chunk-FJVVSKZ3.mjs} +4 -2
- package/dist/{chunk-3KDOTR54.mjs → chunk-G3NMB4PY.mjs} +1 -1
- package/dist/{chunk-SSO5RFOX.mjs → chunk-HHEZVPRR.mjs} +1 -1
- package/dist/{chunk-BV45NK7K.mjs → chunk-JKOJQTFT.mjs} +100 -6
- package/dist/{chunk-T7IL7V7Q.mjs → chunk-NDMFD5IM.mjs} +13 -10
- package/dist/{chunk-TANCKTDK.mjs → chunk-OEV5DFLW.mjs} +70 -5
- package/dist/{chunk-BEO7WIIM.mjs → chunk-OIZ4R5H7.mjs} +28 -8
- package/dist/{chunk-FZEH2IXZ.mjs → chunk-PJKI7SRI.mjs} +176 -26
- package/dist/{chunk-NPSQNCOY.mjs → chunk-PN25BUQ4.mjs} +13 -4
- package/dist/{chunk-3R6HFSLL.mjs → chunk-QDPJ4VT2.mjs} +92 -38
- package/dist/{chunk-FO5GXCST.mjs → chunk-SRZTHCXP.mjs} +5 -5
- package/dist/{chunk-LBT47HLZ.mjs → chunk-TSK3HJEG.mjs} +10 -9
- package/dist/{chunk-6BO3JSUP.mjs → chunk-UX34IVN5.mjs} +2 -2
- package/dist/{chunk-V4F3SYKW.mjs → chunk-VAC3JTAV.mjs} +25 -17
- package/dist/{chunk-PDZ5Z5ZE.mjs → chunk-VDZK4LW3.mjs} +24 -9
- package/dist/chunk-W6HM6F2U.mjs +901 -0
- package/dist/{chunk-WDOHRV3D.mjs → chunk-WPNMWNCL.mjs} +14 -14
- package/dist/chunk-WUDXHF2Q.mjs +14 -0
- package/dist/{chunk-XBQDIKB5.mjs → chunk-WZJ6DQJV.mjs} +9 -8
- package/dist/{chunk-ANSR4IAW.mjs → chunk-XR625T3I.mjs} +2 -2
- package/dist/{chunk-K7V7X6WU.mjs → chunk-ZSKLNZWZ.mjs} +21 -4
- package/dist/iterm2_send.py +56 -0
- package/dist/khala.mjs +11 -11
- package/dist/web/assets/local-CSPuGnH2.css +1 -0
- package/dist/web/assets/local-Dtyxaacx.js +9 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-47XNLAJG.mjs +0 -38
- package/dist/chunk-XUCWSYVS.mjs +0 -148
- package/dist/web/assets/local-CFzRHZpB.js +0 -9
- package/dist/web/assets/local-ciypUFoK.css +0 -1
|
@@ -4,19 +4,20 @@ import {
|
|
|
4
4
|
readJson,
|
|
5
5
|
readProcess,
|
|
6
6
|
writeJsonAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PN25BUQ4.mjs";
|
|
8
8
|
import {
|
|
9
9
|
init_define_KHALA_BUNDLE
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EVT2DWNZ.mjs";
|
|
11
11
|
|
|
12
12
|
// src/wake/terminal/capture.ts
|
|
13
13
|
init_define_KHALA_BUNDLE();
|
|
14
14
|
import path from "node:path";
|
|
15
15
|
import { unlink } from "node:fs/promises";
|
|
16
|
+
var sessionUuid = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
|
16
17
|
function validPane(value) {
|
|
17
18
|
if (!value || typeof value !== "object") return false;
|
|
18
19
|
const pane = value;
|
|
19
|
-
return typeof pane.paneId === "string" && (pane.kind === "tmux" ? /^%\d+$/.test(pane.paneId) : pane.kind === "wezterm" && /^\d+$/.test(pane.paneId)) && Number.isSafeInteger(pane.agentPid) && pane.agentPid > 0 && typeof pane.capturedAt === "string" && Number.isFinite(Date.parse(pane.capturedAt)) && (pane.socket === void 0 || pane.
|
|
20
|
+
return typeof pane.paneId === "string" && (pane.kind === "tmux" ? /^%\d+$/.test(pane.paneId) : pane.kind === "iterm2" ? sessionUuid.test(pane.paneId) : ["wezterm", "kitty"].includes(pane.kind) && /^\d+$/.test(pane.paneId)) && Number.isSafeInteger(pane.agentPid) && pane.agentPid > 0 && typeof pane.capturedAt === "string" && Number.isFinite(Date.parse(pane.capturedAt)) && (pane.socket === void 0 || typeof pane.socket === "string" && !pane.socket.includes("\0") && (pane.kind === "kitty" || pane.kind === "tmux" && pane.socket.startsWith("/"))) && (pane.agentStartTime === void 0 || typeof pane.agentStartTime === "string" && pane.agentStartTime.length > 0);
|
|
20
21
|
}
|
|
21
22
|
async function readPane(files) {
|
|
22
23
|
const pane = await readJson(path.join(files.dir, "pane.json"));
|
|
@@ -37,7 +38,14 @@ async function capturePane(files, env, options = {}) {
|
|
|
37
38
|
if (!socket?.startsWith("/") || socket.includes("\0") || !/^%\d+$/.test(env.TMUX_PANE ?? "")) return clear();
|
|
38
39
|
target = { kind: "tmux", paneId: env.TMUX_PANE, socket };
|
|
39
40
|
} else if (/^\d+$/.test(env.WEZTERM_PANE ?? "")) target = { kind: "wezterm", paneId: env.WEZTERM_PANE };
|
|
40
|
-
else
|
|
41
|
+
else if (env.KITTY_WINDOW_ID !== void 0) {
|
|
42
|
+
if (!/^\d+$/.test(env.KITTY_WINDOW_ID)) return clear();
|
|
43
|
+
target = { kind: "kitty", paneId: env.KITTY_WINDOW_ID, ...env.KITTY_LISTEN_ON === void 0 ? {} : { socket: env.KITTY_LISTEN_ON } };
|
|
44
|
+
} else if (env.ITERM_SESSION_ID !== void 0) {
|
|
45
|
+
const uuid = /^w\d+t\d+p\d+:(.+)$/.exec(env.ITERM_SESSION_ID)?.[1];
|
|
46
|
+
if (!uuid || !sessionUuid.test(uuid)) return clear();
|
|
47
|
+
target = { kind: "iterm2", paneId: uuid };
|
|
48
|
+
} else return clear();
|
|
41
49
|
const agent = await nearestNonShellAncestor(options.pid ?? process.pid, options.readProcess ?? readProcess);
|
|
42
50
|
if (!agent) return clear();
|
|
43
51
|
const pane = { ...target, agentPid: agent.pid, agentStartTime: agent.startTime, capturedAt: (options.now ?? (() => /* @__PURE__ */ new Date()))().toISOString() };
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
sessionStartWakeChannels
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4BZQ4GVW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
capturePane
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6AQVW5W7.mjs";
|
|
8
8
|
import {
|
|
9
9
|
listChannels,
|
|
10
10
|
writeActivity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OEV5DFLW.mjs";
|
|
12
|
+
import "./chunk-JKOJQTFT.mjs";
|
|
12
13
|
import {
|
|
13
14
|
TERMINAL_SESSION_DETAILS,
|
|
14
15
|
openSessionDir,
|
|
15
16
|
readJson
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PN25BUQ4.mjs";
|
|
17
18
|
import {
|
|
18
19
|
init_define_KHALA_BUNDLE
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EVT2DWNZ.mjs";
|
|
20
21
|
|
|
21
22
|
// hooks/session-start.ts
|
|
22
23
|
init_define_KHALA_BUNDLE();
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
runWake,
|
|
7
7
|
sessionIds,
|
|
8
8
|
setWake
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-OIZ4R5H7.mjs";
|
|
10
|
+
import "./chunk-W6HM6F2U.mjs";
|
|
11
|
+
import "./chunk-5JSGA6OB.mjs";
|
|
12
|
+
import "./chunk-6AQVW5W7.mjs";
|
|
13
|
+
import "./chunk-2AMWQ7RB.mjs";
|
|
14
|
+
import "./chunk-4BP7V3OP.mjs";
|
|
15
|
+
import "./chunk-OEV5DFLW.mjs";
|
|
16
|
+
import "./chunk-JKOJQTFT.mjs";
|
|
17
|
+
import "./chunk-PN25BUQ4.mjs";
|
|
18
|
+
import "./chunk-ZSKLNZWZ.mjs";
|
|
19
|
+
import "./chunk-EVT2DWNZ.mjs";
|
|
19
20
|
export {
|
|
20
21
|
WAKE_USAGE,
|
|
21
22
|
consentLine,
|