khala-cli 0.4.14 → 0.4.15
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/{chunk-BSB77FJG.mjs → chunk-26TDBFRB.mjs} +2 -2
- package/dist/{chunk-H3XIRV2S.mjs → chunk-3IHM2SW7.mjs} +1 -1
- package/dist/{chunk-VQDIOGV7.mjs → chunk-4OFZP46T.mjs} +7 -7
- package/dist/{chunk-PISWOM3Q.mjs → chunk-4PZFWER6.mjs} +10 -10
- package/dist/{chunk-OPBOWFBB.mjs → chunk-5B2GYFBD.mjs} +132 -40
- package/dist/{chunk-O2NDYSYF.mjs → chunk-5W73XTCG.mjs} +6 -6
- package/dist/{chunk-WMZ7YE6H.mjs → chunk-5WXVNFMV.mjs} +3 -3
- package/dist/{chunk-G2TAYBYB.mjs → chunk-5XZKEFRD.mjs} +1 -1
- package/dist/{chunk-RXM47OGD.mjs → chunk-657MHRGF.mjs} +3 -3
- package/dist/{chunk-P2S3OAZ5.mjs → chunk-BCEKWOVJ.mjs} +6 -6
- package/dist/{chunk-PIYD4WCN.mjs → chunk-BI2TKRL3.mjs} +1 -1
- package/dist/{chunk-PFWYYXR5.mjs → chunk-C7PNUX5Y.mjs} +2 -2
- package/dist/{chunk-4YHVAWZF.mjs → chunk-CXIAXZAE.mjs} +3 -3
- package/dist/{chunk-2ZT7TFV5.mjs → chunk-EBDML25F.mjs} +8 -8
- package/dist/{chunk-4THILKJ5.mjs → chunk-EEPFMGHU.mjs} +6 -6
- package/dist/{chunk-TVWBZD24.mjs → chunk-FQPHAPKV.mjs} +16 -16
- package/dist/{chunk-KZO6BSPQ.mjs → chunk-IECJZUSO.mjs} +5 -5
- package/dist/{chunk-T3BRQFVF.mjs → chunk-LS5EHLCO.mjs} +1 -1
- package/dist/{chunk-VXHWS7JD.mjs → chunk-LYLDUHUX.mjs} +2 -2
- package/dist/{chunk-PYVAMHAG.mjs → chunk-M2CLLH63.mjs} +2 -2
- package/dist/{chunk-ZWDINIQJ.mjs → chunk-MEI5RBK5.mjs} +1 -1
- package/dist/{chunk-U2OUPWUW.mjs → chunk-MHHNDW4A.mjs} +2 -2
- package/dist/{chunk-QH5WZEIG.mjs → chunk-Q7MJTMRR.mjs} +9 -9
- package/dist/chunk-QT5ZMQHY.mjs +27 -0
- package/dist/{chunk-FOCBFFH5.mjs → chunk-RYJJVZMQ.mjs} +2 -2
- package/dist/chunk-SBJ33DW7.mjs +165 -0
- package/dist/{chunk-UBDI4XFO.mjs → chunk-UJQI2AKH.mjs} +10 -10
- package/dist/{chunk-N7B2VPDU.mjs → chunk-WE3JID2S.mjs} +1 -1
- package/dist/chunk-WF6GBYGH.mjs +20 -0
- package/dist/{chunk-RHAAMCRD.mjs → chunk-WLUNHB2O.mjs} +7 -7
- package/dist/chunk-XS66DEGZ.mjs +19 -0
- package/dist/{chunk-YXMJJAMH.mjs → chunk-XZN4X37N.mjs} +50 -9
- package/dist/{chunk-QEIYPWN4.mjs → chunk-YG6KJFZW.mjs} +12 -12
- package/dist/{chunk-W3LLNKEB.mjs → chunk-ZUGJJGF4.mjs} +3 -3
- package/dist/khala.mjs +11 -11
- package/dist/web/assets/local-Bnba1v1f.js +13 -0
- package/dist/web/assets/local-CVtKWAts.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-6CDTY2EG.mjs +0 -20
- package/dist/chunk-HPZY6LHL.mjs +0 -14
- package/dist/chunk-TMOAMJMV.mjs +0 -19
- package/dist/chunk-UQJHB4AH.mjs +0 -27
- package/dist/web/assets/local-DLmpMMaF.css +0 -1
- package/dist/web/assets/local-EzltpNwn.js +0 -11
|
@@ -14,21 +14,21 @@ import {
|
|
|
14
14
|
decodeLocalSendResult,
|
|
15
15
|
ensureHelper,
|
|
16
16
|
localRoomPath
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-IECJZUSO.mjs";
|
|
18
|
+
import "./chunk-BI2TKRL3.mjs";
|
|
19
|
+
import "./chunk-MHHNDW4A.mjs";
|
|
20
|
+
import "./chunk-LS5EHLCO.mjs";
|
|
21
21
|
import {
|
|
22
22
|
LISTENING_MODE_COMMAND_TYPE
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LYLDUHUX.mjs";
|
|
24
24
|
import {
|
|
25
25
|
CHANNEL_EVENT_TYPE,
|
|
26
26
|
memberRenameContent
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-C7PNUX5Y.mjs";
|
|
28
|
+
import "./chunk-WE3JID2S.mjs";
|
|
29
29
|
import {
|
|
30
30
|
init_define_KHALA_BUNDLE
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
32
32
|
|
|
33
33
|
// src/local/session.ts
|
|
34
34
|
init_define_KHALA_BUNDLE();
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
WAKE_HARNESSES,
|
|
4
4
|
wakeDrivers,
|
|
5
5
|
wakeStatus
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5W73XTCG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
adapterFor,
|
|
9
9
|
registerAntigravityWake,
|
|
10
10
|
resolveSources
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FQPHAPKV.mjs";
|
|
12
12
|
import {
|
|
13
13
|
CURSOR_DEFAULT_SESSION,
|
|
14
14
|
updateWakeSettings
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4OFZP46T.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SESSION_ID_PATTERN,
|
|
18
18
|
filesForDir,
|
|
19
19
|
stateRoot
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
21
21
|
import {
|
|
22
22
|
resetWakeDriver
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5XZKEFRD.mjs";
|
|
24
24
|
import {
|
|
25
25
|
init_define_KHALA_BUNDLE
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
27
27
|
|
|
28
28
|
// src/wake/cli.ts
|
|
29
29
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
readPane
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RYJJVZMQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CURSOR_DEFAULT_SESSION,
|
|
7
7
|
CURSOR_WORKSPACE_ENV,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
readListeningMode,
|
|
19
19
|
readWakeSettings,
|
|
20
20
|
verifyQwenTranscript
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4OFZP46T.mjs";
|
|
22
22
|
import {
|
|
23
23
|
listChannels,
|
|
24
24
|
readActivity,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
unwoken,
|
|
27
27
|
wakeStart,
|
|
28
28
|
wakesAgent
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-657MHRGF.mjs";
|
|
30
30
|
import {
|
|
31
31
|
HARNESS_REGISTRY,
|
|
32
32
|
SESSION_ID_PATTERN,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
stateRoot,
|
|
42
42
|
walkAncestors,
|
|
43
43
|
writeJsonAtomic
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
45
45
|
import {
|
|
46
46
|
CODEX_IDLE_WAKE_NOTICE,
|
|
47
47
|
cancelAttempt,
|
|
@@ -53,10 +53,10 @@ import {
|
|
|
53
53
|
settleAttempts,
|
|
54
54
|
wakeLine,
|
|
55
55
|
withWakeLock
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-5XZKEFRD.mjs";
|
|
57
57
|
import {
|
|
58
58
|
init_define_KHALA_BUNDLE
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
60
60
|
|
|
61
61
|
// src/harness/index.ts
|
|
62
62
|
init_define_KHALA_BUNDLE();
|
|
@@ -801,7 +801,7 @@ var codexWakeDriver = createCodexWakeDriver();
|
|
|
801
801
|
|
|
802
802
|
// src/harness/codex.ts
|
|
803
803
|
var emptyPrompt2 = { pattern: /^› ?(Ask Codex to do anything)?$/u, cursorColumn: 2 };
|
|
804
|
-
var install = async (flags, deps) => (await import("./chunk-
|
|
804
|
+
var install = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runCodexInstall(flags, deps);
|
|
805
805
|
var codex = {
|
|
806
806
|
id: "codex",
|
|
807
807
|
// A string metadata id wins even when empty or invalid; validation happens after selection.
|
|
@@ -883,7 +883,7 @@ async function resolveSources(sources, meta, env, context) {
|
|
|
883
883
|
}
|
|
884
884
|
|
|
885
885
|
// src/harness/muse.ts
|
|
886
|
-
var install2 = async (flags, deps) => (await import("./chunk-
|
|
886
|
+
var install2 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runMuseInstall(flags, deps);
|
|
887
887
|
var muse = {
|
|
888
888
|
id: "muse",
|
|
889
889
|
sessionSources: [{ kind: "env", resolve: (_meta, env) => env.MUSE_SESSION_ID, rejoinable: () => true }, hookMapSource],
|
|
@@ -946,7 +946,7 @@ var copilotCodec = createCopilotCodec();
|
|
|
946
946
|
|
|
947
947
|
// src/harness/copilot.ts
|
|
948
948
|
var emptyPrompt3 = { pattern: /^❯ ?$/u, cursorColumn: 2 };
|
|
949
|
-
var install3 = async (flags, deps) => (await import("./chunk-
|
|
949
|
+
var install3 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runCopilotInstall(flags, deps);
|
|
950
950
|
var copilot = {
|
|
951
951
|
id: "copilot",
|
|
952
952
|
sessionSources: [{ kind: "env", resolve: (_meta, env) => env.COPILOT_AGENT_SESSION_ID, rejoinable: () => true }, hookMapSource],
|
|
@@ -994,7 +994,7 @@ var cursorCodec = {
|
|
|
994
994
|
};
|
|
995
995
|
|
|
996
996
|
// src/harness/cursor.ts
|
|
997
|
-
var install4 = async (flags, deps) => (await import("./chunk-
|
|
997
|
+
var install4 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runCursorInstall(flags, deps);
|
|
998
998
|
var cursor = {
|
|
999
999
|
id: "cursor",
|
|
1000
1000
|
sessionSources: [{
|
|
@@ -1032,7 +1032,7 @@ function createQwenBackgroundDriver(platform = process.platform) {
|
|
|
1032
1032
|
verification: "none",
|
|
1033
1033
|
async available(ctx) {
|
|
1034
1034
|
const settings = await readWakeSettings(stateRoot(ctx.env));
|
|
1035
|
-
return platform === "win32" && !settings.off["qwen/socket"] && !settings.off["qwen/background-shell"] && await qwenInboundAllowed(ctx.env) && await (await import("./chunk-
|
|
1035
|
+
return platform === "win32" && !settings.off["qwen/socket"] && !settings.off["qwen/background-shell"] && await qwenInboundAllowed(ctx.env) && await (await import("./chunk-WLUNHB2O.mjs")).monitorArmed(ctx.files);
|
|
1036
1036
|
},
|
|
1037
1037
|
async unavailableReason(ctx) {
|
|
1038
1038
|
if (!await qwenInboundAllowed(ctx.env)) return "qwen_held";
|
|
@@ -1047,8 +1047,8 @@ var qwen = {
|
|
|
1047
1047
|
codec: qwenCodec,
|
|
1048
1048
|
restoreAtStartup: true,
|
|
1049
1049
|
sessionSources: [{ kind: "meta", resolve: (meta) => meta?.khala_session, rejoinable: () => true }, { kind: "env", resolve: (_meta, env) => qwenSession(env), rejoinable: () => true }, hookMapSource],
|
|
1050
|
-
install: async (flags, deps) => (await import("./chunk-
|
|
1051
|
-
uninstall: async (flags, deps) => (await import("./chunk-
|
|
1050
|
+
install: async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runQwenInstall(flags, deps),
|
|
1051
|
+
uninstall: async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runQwenInstall([...flags, "--uninstall"], deps),
|
|
1052
1052
|
wakeLadder: [createQwenSocketDriver(), createQwenBackgroundDriver()],
|
|
1053
1053
|
async verifyWake(stdin, files, now) {
|
|
1054
1054
|
const input = JSON.parse(stdin);
|
|
@@ -1092,7 +1092,7 @@ var geminiCodec = {
|
|
|
1092
1092
|
|
|
1093
1093
|
// src/harness/gemini.ts
|
|
1094
1094
|
var emptyPrompt4 = { pattern: /^ >(?: {3}Type your message or @path\/to\/file)?$/u, cursorColumn: 3 };
|
|
1095
|
-
var install5 = async (flags, deps) => (await import("./chunk-
|
|
1095
|
+
var install5 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runGeminiInstall(flags, deps);
|
|
1096
1096
|
var gemini = {
|
|
1097
1097
|
id: "gemini",
|
|
1098
1098
|
sessionSources: [{ kind: "env", resolve: (_meta, env) => env.GEMINI_SESSION_ID, rejoinable: () => true }, hookMapSource],
|
|
@@ -1270,7 +1270,7 @@ async function antigravityPromptText(input) {
|
|
|
1270
1270
|
|
|
1271
1271
|
// src/harness/antigravity.ts
|
|
1272
1272
|
var emptyPrompt5 = { pattern: /^>$/u, cursorColumn: 2 };
|
|
1273
|
-
var install6 = async (flags, deps) => (await import("./chunk-
|
|
1273
|
+
var install6 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runAntigravityInstall(flags, deps);
|
|
1274
1274
|
var antigravity = {
|
|
1275
1275
|
id: "antigravity",
|
|
1276
1276
|
restoreAtStartup: true,
|
|
@@ -1429,7 +1429,7 @@ async function pollOpenCodeWake(files, io, replay = false) {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
|
|
1431
1431
|
// src/harness/opencode.ts
|
|
1432
|
-
var install7 = async (flags, deps) => (await import("./chunk-
|
|
1432
|
+
var install7 = async (flags, deps) => (await import("./chunk-YG6KJFZW.mjs")).runOpenCodeInstall(flags, deps);
|
|
1433
1433
|
var opencode = {
|
|
1434
1434
|
id: "opencode",
|
|
1435
1435
|
sessionSources: [{ kind: "meta", resolve: (meta) => meta?.khala_session, rejoinable: () => true }, hookMapSource],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
KHALA_AGENT_VERSION
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MHHNDW4A.mjs";
|
|
5
5
|
import {
|
|
6
6
|
bundle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LS5EHLCO.mjs";
|
|
8
8
|
import {
|
|
9
9
|
LISTENING_MODES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LYLDUHUX.mjs";
|
|
11
11
|
import {
|
|
12
12
|
HARNESS_REGISTRY,
|
|
13
13
|
M1_LABEL_MAX_BYTES,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
utcTimestamp,
|
|
36
36
|
utf8Length,
|
|
37
37
|
version
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
39
39
|
import {
|
|
40
40
|
init_define_KHALA_BUNDLE
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
42
42
|
|
|
43
43
|
// src/client.ts
|
|
44
44
|
init_define_KHALA_BUNDLE();
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
object,
|
|
6
6
|
readMatrixUserId,
|
|
7
7
|
version
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
9
9
|
import {
|
|
10
10
|
init_define_KHALA_BUNDLE
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
12
12
|
|
|
13
13
|
// ../contracts/src/m1/listening-mode.ts
|
|
14
14
|
init_define_KHALA_BUNDLE();
|
|
@@ -2,10 +2,10 @@ import { createRequire as __khalaCreateRequire } from 'node:module'; const requi
|
|
|
2
2
|
import {
|
|
3
3
|
adapterFor,
|
|
4
4
|
resolveSources
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FQPHAPKV.mjs";
|
|
6
6
|
import {
|
|
7
7
|
init_define_KHALA_BUNDLE
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
9
9
|
|
|
10
10
|
// src/mcp/session-id.ts
|
|
11
11
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
init_define_KHALA_BUNDLE
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
5
5
|
|
|
6
6
|
// src/matrix/decryption-retry.ts
|
|
7
7
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
bundle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LS5EHLCO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
init_define_KHALA_BUNDLE
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
10
|
init_define_KHALA_BUNDLE();
|
|
@@ -2,7 +2,7 @@ import { createRequire as __khalaCreateRequire } from 'node:module'; const requi
|
|
|
2
2
|
import {
|
|
3
3
|
parseChannelLink,
|
|
4
4
|
resolveLocalOwnerName
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CXIAXZAE.mjs";
|
|
6
6
|
import {
|
|
7
7
|
LOCAL_AGENT_DEVICE_PREFIX,
|
|
8
8
|
LOCAL_IDLE_EXIT_MS,
|
|
@@ -32,14 +32,14 @@ import {
|
|
|
32
32
|
normalizeInitials,
|
|
33
33
|
olderHelperVersion,
|
|
34
34
|
readHelperFile
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-IECJZUSO.mjs";
|
|
36
|
+
import "./chunk-BI2TKRL3.mjs";
|
|
37
37
|
import {
|
|
38
38
|
KHALA_AGENT_VERSION
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-MHHNDW4A.mjs";
|
|
40
40
|
import {
|
|
41
41
|
bundle
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-LS5EHLCO.mjs";
|
|
43
43
|
import {
|
|
44
44
|
DEFAULT_LISTENING_MODE,
|
|
45
45
|
LISTENING_MODE_COMMAND_TYPE,
|
|
@@ -47,13 +47,13 @@ import {
|
|
|
47
47
|
decodeListeningMode,
|
|
48
48
|
decodeListeningModeCommand,
|
|
49
49
|
memberListeningMode
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-LYLDUHUX.mjs";
|
|
51
51
|
import {
|
|
52
52
|
CHANNEL_EVENT_TYPE,
|
|
53
53
|
decodeChannelEvent,
|
|
54
54
|
encodeChannelEvent,
|
|
55
55
|
memberRenameContent
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-C7PNUX5Y.mjs";
|
|
57
57
|
import {
|
|
58
58
|
LEGACY_HARNESSES,
|
|
59
59
|
StateError,
|
|
@@ -67,10 +67,10 @@ import {
|
|
|
67
67
|
validAgentRejoinSecret,
|
|
68
68
|
validAgentSessionId,
|
|
69
69
|
writeJsonAtomic
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
71
71
|
import {
|
|
72
72
|
init_define_KHALA_BUNDLE
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
74
74
|
|
|
75
75
|
// src/local/cli.ts
|
|
76
76
|
init_define_KHALA_BUNDLE();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
WAKE_USAGE,
|
|
4
|
+
cli_default,
|
|
5
|
+
consentLine,
|
|
6
|
+
runWake,
|
|
7
|
+
sessionIds,
|
|
8
|
+
setWake
|
|
9
|
+
} from "./chunk-EEPFMGHU.mjs";
|
|
10
|
+
import "./chunk-5W73XTCG.mjs";
|
|
11
|
+
import "./chunk-FQPHAPKV.mjs";
|
|
12
|
+
import "./chunk-RYJJVZMQ.mjs";
|
|
13
|
+
import "./chunk-4OFZP46T.mjs";
|
|
14
|
+
import "./chunk-LYLDUHUX.mjs";
|
|
15
|
+
import "./chunk-657MHRGF.mjs";
|
|
16
|
+
import "./chunk-C7PNUX5Y.mjs";
|
|
17
|
+
import "./chunk-WE3JID2S.mjs";
|
|
18
|
+
import "./chunk-5XZKEFRD.mjs";
|
|
19
|
+
import "./chunk-3IHM2SW7.mjs";
|
|
20
|
+
export {
|
|
21
|
+
WAKE_USAGE,
|
|
22
|
+
consentLine,
|
|
23
|
+
cli_default as default,
|
|
24
|
+
runWake,
|
|
25
|
+
sessionIds,
|
|
26
|
+
setWake
|
|
27
|
+
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readJson,
|
|
5
5
|
readProcess,
|
|
6
6
|
writeJsonAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
8
8
|
import {
|
|
9
9
|
init_define_KHALA_BUNDLE
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
11
11
|
|
|
12
12
|
// src/wake/terminal/capture.ts
|
|
13
13
|
init_define_KHALA_BUNDLE();
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_define_KHALA_BUNDLE
|
|
4
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
5
|
+
|
|
6
|
+
// ../contracts/src/m1/image.ts
|
|
7
|
+
init_define_KHALA_BUNDLE();
|
|
8
|
+
var IMAGE_MIME_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
|
|
9
|
+
var IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
10
|
+
var MAX_DIMENSION = 65535;
|
|
11
|
+
var u16be = (b, i) => b[i] << 8 | b[i + 1];
|
|
12
|
+
var u16le = (b, i) => b[i] | b[i + 1] << 8;
|
|
13
|
+
var u24le = (b, i) => b[i] | b[i + 1] << 8 | b[i + 2] << 16;
|
|
14
|
+
var ascii = (b, i, text) => [...text].every((c, k) => b[i + k] === c.charCodeAt(0));
|
|
15
|
+
function sniffType(b) {
|
|
16
|
+
if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) {
|
|
17
|
+
return { mimetype: "image/png", w: (u16be(b, 16) << 16 | u16be(b, 18)) >>> 0, h: (u16be(b, 20) << 16 | u16be(b, 22)) >>> 0 };
|
|
18
|
+
}
|
|
19
|
+
if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return { mimetype: "image/gif", w: u16le(b, 6), h: u16le(b, 8) };
|
|
20
|
+
if (b.length >= 30 && ascii(b, 0, "RIFF") && ascii(b, 8, "WEBP")) {
|
|
21
|
+
if (ascii(b, 12, "VP8 ")) return { mimetype: "image/webp", w: u16le(b, 26) & 16383, h: u16le(b, 28) & 16383 };
|
|
22
|
+
if (ascii(b, 12, "VP8L")) {
|
|
23
|
+
return { mimetype: "image/webp", w: 1 + ((b[22] & 63) << 8 | b[21]), h: 1 + ((b[24] & 15) << 10 | b[23] << 2 | (b[22] & 192) >> 6) };
|
|
24
|
+
}
|
|
25
|
+
if (ascii(b, 12, "VP8X")) return { mimetype: "image/webp", w: 1 + u24le(b, 24), h: 1 + u24le(b, 27) };
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (b.length >= 4 && b[0] === 255 && b[1] === 216) {
|
|
29
|
+
for (let i = 2; i + 9 < b.length; ) {
|
|
30
|
+
if (b[i] !== 255) return null;
|
|
31
|
+
const marker = b[i + 1];
|
|
32
|
+
if (marker === 255) {
|
|
33
|
+
i += 1;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (marker >= 192 && marker <= 207 && marker !== 196 && marker !== 200 && marker !== 204) {
|
|
37
|
+
return { mimetype: "image/jpeg", w: u16be(b, i + 7), h: u16be(b, i + 5) };
|
|
38
|
+
}
|
|
39
|
+
if (marker === 218 || marker === 217) return null;
|
|
40
|
+
i += 2 + u16be(b, i + 2);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function sniffImage(bytes) {
|
|
46
|
+
const found = sniffType(bytes);
|
|
47
|
+
return found && found.w >= 1 && found.h >= 1 && found.w <= MAX_DIMENSION && found.h <= MAX_DIMENSION ? found : null;
|
|
48
|
+
}
|
|
49
|
+
function checkImage(bytes) {
|
|
50
|
+
if (bytes.length === 0) return { ok: false, reason: "empty" };
|
|
51
|
+
if (bytes.length > IMAGE_MAX_BYTES) return { ok: false, reason: "too_large" };
|
|
52
|
+
const image = sniffImage(bytes);
|
|
53
|
+
return image ? { ok: true, image } : { ok: false, reason: "unsupported_type" };
|
|
54
|
+
}
|
|
55
|
+
function stripJpegMetadata(bytes) {
|
|
56
|
+
if (bytes[0] !== 255 || bytes[1] !== 216) return bytes;
|
|
57
|
+
const parts = [bytes.subarray(0, 2)];
|
|
58
|
+
let i = 2;
|
|
59
|
+
while (i + 3 < bytes.length && bytes[i] === 255) {
|
|
60
|
+
const marker = bytes[i + 1];
|
|
61
|
+
if (marker === 218) break;
|
|
62
|
+
const end = i + 2 + u16be(bytes, i + 2);
|
|
63
|
+
if (end > bytes.length) return bytes;
|
|
64
|
+
if (marker !== 225 && marker !== 237 && marker !== 254) parts.push(bytes.subarray(i, end));
|
|
65
|
+
i = end;
|
|
66
|
+
}
|
|
67
|
+
parts.push(bytes.subarray(i));
|
|
68
|
+
const out = new Uint8Array(parts.reduce((sum, part) => sum + part.length, 0));
|
|
69
|
+
let at = 0;
|
|
70
|
+
for (const part of parts) {
|
|
71
|
+
out.set(part, at);
|
|
72
|
+
at += part.length;
|
|
73
|
+
}
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
function base64(bytes, url = false) {
|
|
77
|
+
let binary = "";
|
|
78
|
+
for (let i = 0; i < bytes.length; i += 32768) binary += String.fromCharCode(...bytes.subarray(i, i + 32768));
|
|
79
|
+
const encoded = btoa(binary).replace(/=+$/u, "");
|
|
80
|
+
return url ? encoded.replace(/\+/gu, "-").replace(/\//gu, "_") : encoded;
|
|
81
|
+
}
|
|
82
|
+
function unbase64(text) {
|
|
83
|
+
const binary = atob(text.replace(/-/gu, "+").replace(/_/gu, "/").padEnd(Math.ceil(text.length / 4) * 4, "="));
|
|
84
|
+
return Uint8Array.from(binary, (c) => c.charCodeAt(0));
|
|
85
|
+
}
|
|
86
|
+
var sha256 = async (bytes) => base64(new Uint8Array(await crypto.subtle.digest("SHA-256", new Uint8Array(bytes))));
|
|
87
|
+
async function encryptAttachment(plaintext) {
|
|
88
|
+
const raw = crypto.getRandomValues(new Uint8Array(32));
|
|
89
|
+
const iv = new Uint8Array(16);
|
|
90
|
+
iv.set(crypto.getRandomValues(new Uint8Array(8)));
|
|
91
|
+
const key = await crypto.subtle.importKey("raw", raw, "AES-CTR", false, ["encrypt"]);
|
|
92
|
+
const ciphertext = new Uint8Array(await crypto.subtle.encrypt({ name: "AES-CTR", counter: iv, length: 64 }, key, new Uint8Array(plaintext)));
|
|
93
|
+
return { ciphertext, key: base64(raw, true), iv: base64(iv), sha256: await sha256(ciphertext) };
|
|
94
|
+
}
|
|
95
|
+
async function decryptAttachment(ciphertext, ref) {
|
|
96
|
+
if (await sha256(ciphertext) !== ref.sha256) throw new Error("attachment_hash_mismatch");
|
|
97
|
+
const key = await crypto.subtle.importKey("raw", new Uint8Array(unbase64(ref.key)), "AES-CTR", false, ["decrypt"]);
|
|
98
|
+
return new Uint8Array(await crypto.subtle.decrypt({ name: "AES-CTR", counter: new Uint8Array(unbase64(ref.iv)), length: 64 }, key, new Uint8Array(ciphertext)));
|
|
99
|
+
}
|
|
100
|
+
var MXC = /^mxc:\/\/[A-Za-z0-9.:[\]-]{1,255}\/[A-Za-z0-9_-]{1,255}$/u;
|
|
101
|
+
var NAME = /^[^\p{Cc}\p{Cf}/\\]{1,255}$/u;
|
|
102
|
+
function readImageRef(value) {
|
|
103
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
104
|
+
const v = value;
|
|
105
|
+
const keys = Object.keys(v).sort().join(",");
|
|
106
|
+
if (keys !== "h,iv,key,mimetype,name,sha256,size,url,w") return null;
|
|
107
|
+
const int = (n, max) => typeof n === "number" && Number.isInteger(n) && n >= 1 && n <= max;
|
|
108
|
+
return typeof v.name === "string" && NAME.test(v.name) && IMAGE_MIME_TYPES.includes(v.mimetype) && int(v.size, IMAGE_MAX_BYTES * 2) && int(v.w, MAX_DIMENSION) && int(v.h, MAX_DIMENSION) && typeof v.url === "string" && MXC.test(v.url) && typeof v.key === "string" && /^[A-Za-z0-9_-]{43}$/u.test(v.key) && typeof v.iv === "string" && /^[A-Za-z0-9+/]{22}(==)?$/u.test(v.iv) && typeof v.sha256 === "string" && /^[A-Za-z0-9+/]{43}$/u.test(v.sha256) ? v : null;
|
|
109
|
+
}
|
|
110
|
+
function imageEventContent(ref, caption) {
|
|
111
|
+
return {
|
|
112
|
+
msgtype: "m.image",
|
|
113
|
+
body: caption || ref.name,
|
|
114
|
+
filename: ref.name,
|
|
115
|
+
info: { mimetype: ref.mimetype, size: ref.size, w: ref.w, h: ref.h },
|
|
116
|
+
file: {
|
|
117
|
+
v: "v2",
|
|
118
|
+
url: ref.url,
|
|
119
|
+
iv: ref.iv,
|
|
120
|
+
hashes: { sha256: ref.sha256 },
|
|
121
|
+
key: { kty: "oct", key_ops: ["encrypt", "decrypt"], alg: "A256CTR", k: ref.key, ext: true }
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function readImageEvent(content) {
|
|
126
|
+
if (content.msgtype !== "m.image" || typeof content.body !== "string") return null;
|
|
127
|
+
const obj = (value) => typeof value === "object" && value !== null ? value : {};
|
|
128
|
+
const file = obj(content.file), info = obj(content.info), key = obj(file.key), hashes = obj(file.hashes);
|
|
129
|
+
if (file.v !== "v2" || key.alg !== "A256CTR" || key.kty !== "oct") return null;
|
|
130
|
+
const name = typeof content.filename === "string" ? content.filename : content.body;
|
|
131
|
+
const image = readImageRef({
|
|
132
|
+
name,
|
|
133
|
+
mimetype: info.mimetype,
|
|
134
|
+
size: info.size,
|
|
135
|
+
w: info.w,
|
|
136
|
+
h: info.h,
|
|
137
|
+
url: file.url,
|
|
138
|
+
key: key.k,
|
|
139
|
+
iv: file.iv,
|
|
140
|
+
sha256: hashes.sha256
|
|
141
|
+
});
|
|
142
|
+
return image ? { image, caption: content.body === name ? "" : content.body } : null;
|
|
143
|
+
}
|
|
144
|
+
function imageLabel(image) {
|
|
145
|
+
return `[image: ${image.name}, ${image.w}x${image.h}]`;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/transport.ts
|
|
149
|
+
init_define_KHALA_BUNDLE();
|
|
150
|
+
var RESTORE_HISTORY_MAX_PAGES = 20;
|
|
151
|
+
var startChannelSession = async (creds, options) => creds.transport === "local" ? (await import("./chunk-EBDML25F.mjs")).createLocalSession(creds) : (await import("./chunk-XZN4X37N.mjs")).createAgentMatrixSession(creds, options);
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
IMAGE_MAX_BYTES,
|
|
155
|
+
sniffImage,
|
|
156
|
+
checkImage,
|
|
157
|
+
stripJpegMetadata,
|
|
158
|
+
encryptAttachment,
|
|
159
|
+
decryptAttachment,
|
|
160
|
+
imageEventContent,
|
|
161
|
+
readImageEvent,
|
|
162
|
+
imageLabel,
|
|
163
|
+
RESTORE_HISTORY_MAX_PAGES,
|
|
164
|
+
startChannelSession
|
|
165
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
wakeDisableNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5W73XTCG.mjs";
|
|
5
5
|
import {
|
|
6
6
|
STOP_NUDGE,
|
|
7
7
|
adapterFor,
|
|
8
8
|
createCopilotCodec,
|
|
9
9
|
recordHookSession
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FQPHAPKV.mjs";
|
|
11
11
|
import {
|
|
12
12
|
capturePane
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RYJJVZMQ.mjs";
|
|
14
14
|
import {
|
|
15
15
|
readListeningMode
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-4OFZP46T.mjs";
|
|
17
|
+
import "./chunk-LYLDUHUX.mjs";
|
|
18
18
|
import {
|
|
19
19
|
advanceCursor,
|
|
20
20
|
clearUsageLimit,
|
|
@@ -29,21 +29,21 @@ import {
|
|
|
29
29
|
wakeStart,
|
|
30
30
|
wakesAgent,
|
|
31
31
|
writeActivity
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-657MHRGF.mjs";
|
|
33
|
+
import "./chunk-C7PNUX5Y.mjs";
|
|
34
34
|
import {
|
|
35
35
|
StateError,
|
|
36
36
|
TERMINAL_SESSION_DETAILS,
|
|
37
37
|
readJson,
|
|
38
38
|
readStatus,
|
|
39
39
|
sessionFiles
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WE3JID2S.mjs";
|
|
41
41
|
import {
|
|
42
42
|
settleAttempts
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-5XZKEFRD.mjs";
|
|
44
44
|
import {
|
|
45
45
|
init_define_KHALA_BUNDLE
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
47
47
|
|
|
48
48
|
// hooks/deliver.ts
|
|
49
49
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
init_define_KHALA_BUNDLE
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3IHM2SW7.mjs";
|
|
5
5
|
|
|
6
6
|
// ../contracts/src/m1/harness.ts
|
|
7
7
|
init_define_KHALA_BUNDLE();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveHarness,
|
|
4
|
+
resolveSession,
|
|
5
|
+
resolveSessionId
|
|
6
|
+
} from "./chunk-M2CLLH63.mjs";
|
|
7
|
+
import "./chunk-FQPHAPKV.mjs";
|
|
8
|
+
import "./chunk-RYJJVZMQ.mjs";
|
|
9
|
+
import "./chunk-4OFZP46T.mjs";
|
|
10
|
+
import "./chunk-LYLDUHUX.mjs";
|
|
11
|
+
import "./chunk-657MHRGF.mjs";
|
|
12
|
+
import "./chunk-C7PNUX5Y.mjs";
|
|
13
|
+
import "./chunk-WE3JID2S.mjs";
|
|
14
|
+
import "./chunk-5XZKEFRD.mjs";
|
|
15
|
+
import "./chunk-3IHM2SW7.mjs";
|
|
16
|
+
export {
|
|
17
|
+
resolveHarness,
|
|
18
|
+
resolveSession,
|
|
19
|
+
resolveSessionId
|
|
20
|
+
};
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
monitorOwner,
|
|
6
6
|
run,
|
|
7
7
|
watchSession
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-4OFZP46T.mjs";
|
|
9
|
+
import "./chunk-LYLDUHUX.mjs";
|
|
10
|
+
import "./chunk-657MHRGF.mjs";
|
|
11
|
+
import "./chunk-C7PNUX5Y.mjs";
|
|
12
|
+
import "./chunk-WE3JID2S.mjs";
|
|
13
|
+
import "./chunk-5XZKEFRD.mjs";
|
|
14
|
+
import "./chunk-3IHM2SW7.mjs";
|
|
15
15
|
export {
|
|
16
16
|
WATCH_USAGE,
|
|
17
17
|
run as default,
|