khala-cli 0.4.13 → 0.4.14
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-QPYXV4BQ.mjs → chunk-2ZT7TFV5.mjs} +10 -10
- package/dist/{chunk-SDBMJPIA.mjs → chunk-4THILKJ5.mjs} +6 -6
- package/dist/{chunk-O4QJ3ZT6.mjs → chunk-4YHVAWZF.mjs} +3 -3
- package/dist/chunk-6CDTY2EG.mjs +20 -0
- package/dist/{chunk-QZUBLJW7.mjs → chunk-BSB77FJG.mjs} +2 -2
- package/dist/{chunk-ZWWTVM6R.mjs → chunk-FOCBFFH5.mjs} +2 -2
- package/dist/{chunk-SUUEWCY5.mjs → chunk-G2TAYBYB.mjs} +1 -1
- package/dist/{chunk-3JA3Q5MK.mjs → chunk-H3XIRV2S.mjs} +1 -1
- package/dist/{chunk-JZZNVQKH.mjs → chunk-HPZY6LHL.mjs} +2 -2
- package/dist/{chunk-6P4PKPJW.mjs → chunk-KZO6BSPQ.mjs} +5 -5
- package/dist/{chunk-NHW62KEB.mjs → chunk-N7B2VPDU.mjs} +1 -1
- package/dist/{chunk-2AIADANH.mjs → chunk-O2NDYSYF.mjs} +6 -6
- package/dist/{chunk-JLENHMKE.mjs → chunk-OPBOWFBB.mjs} +33 -32
- package/dist/{chunk-SUT7AKNZ.mjs → chunk-P2S3OAZ5.mjs} +6 -6
- package/dist/{chunk-XI5FPUNN.mjs → chunk-PFWYYXR5.mjs} +2 -2
- package/dist/{chunk-SKJ6YV3G.mjs → chunk-PISWOM3Q.mjs} +14 -13
- package/dist/{chunk-P3XZEYZF.mjs → chunk-PIYD4WCN.mjs} +1 -1
- package/dist/{chunk-KMDLTHDW.mjs → chunk-PYVAMHAG.mjs} +2 -2
- package/dist/{chunk-BWVC3EKG.mjs → chunk-QEIYPWN4.mjs} +13 -13
- package/dist/{chunk-3GUVMXTM.mjs → chunk-QH5WZEIG.mjs} +23 -17
- package/dist/{chunk-OIYAR2ND.mjs → chunk-RHAAMCRD.mjs} +7 -7
- package/dist/{chunk-72W7IC2O.mjs → chunk-RXM47OGD.mjs} +26 -5
- package/dist/{chunk-RUQDE5DI.mjs → chunk-T3BRQFVF.mjs} +1 -1
- package/dist/chunk-TMOAMJMV.mjs +19 -0
- package/dist/{chunk-BJVJ5WJS.mjs → chunk-TVWBZD24.mjs} +32 -29
- package/dist/{chunk-32SGUUP5.mjs → chunk-U2OUPWUW.mjs} +2 -2
- package/dist/{chunk-6DE4V756.mjs → chunk-UBDI4XFO.mjs} +32 -12
- package/dist/chunk-UQJHB4AH.mjs +27 -0
- package/dist/{chunk-XR3JSUPF.mjs → chunk-VQDIOGV7.mjs} +24 -14
- package/dist/chunk-VXHWS7JD.mjs +47 -0
- package/dist/{chunk-XRV5GUSI.mjs → chunk-W3LLNKEB.mjs} +3 -3
- package/dist/{chunk-ICTAFDO6.mjs → chunk-WMZ7YE6H.mjs} +3 -3
- package/dist/{chunk-ONAZVGVO.mjs → chunk-YXMJJAMH.mjs} +9 -9
- package/dist/{chunk-MRSZOWFU.mjs → chunk-ZWDINIQJ.mjs} +1 -1
- package/dist/khala.mjs +11 -11
- package/dist/web/assets/{local-mElTRGcH.js → local-EzltpNwn.js} +4 -4
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BNIPJVW.mjs +0 -27
- package/dist/chunk-I4POSYHZ.mjs +0 -132
- package/dist/chunk-TVQ5NHFX.mjs +0 -20
- package/dist/chunk-WZD4JAG6.mjs +0 -19
|
@@ -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-KZO6BSPQ.mjs";
|
|
18
|
+
import "./chunk-PIYD4WCN.mjs";
|
|
19
|
+
import "./chunk-U2OUPWUW.mjs";
|
|
20
|
+
import "./chunk-T3BRQFVF.mjs";
|
|
21
21
|
import {
|
|
22
22
|
LISTENING_MODE_COMMAND_TYPE
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VXHWS7JD.mjs";
|
|
24
24
|
import {
|
|
25
25
|
CHANNEL_EVENT_TYPE,
|
|
26
26
|
memberRenameContent
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-PFWYYXR5.mjs";
|
|
28
|
+
import "./chunk-N7B2VPDU.mjs";
|
|
29
29
|
import {
|
|
30
30
|
init_define_KHALA_BUNDLE
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
32
32
|
|
|
33
33
|
// src/local/session.ts
|
|
34
34
|
init_define_KHALA_BUNDLE();
|
|
@@ -229,7 +229,7 @@ async function createLocalSession(creds, opts = {}) {
|
|
|
229
229
|
try {
|
|
230
230
|
const page = decoded(await request(
|
|
231
231
|
"GET",
|
|
232
|
-
`events?after=${after}&wait=${LOCAL_LONG_POLL_MAX_S}&prev=1&wire=2`,
|
|
232
|
+
`events?after=${after}&wait=${LOCAL_LONG_POLL_MAX_S}&prev=1&wire=2&mute=1`,
|
|
233
233
|
void 0,
|
|
234
234
|
controller.signal,
|
|
235
235
|
(LOCAL_LONG_POLL_MAX_S + 10) * 1e3
|
|
@@ -326,7 +326,7 @@ async function createLocalSession(creds, opts = {}) {
|
|
|
326
326
|
after = result.seq;
|
|
327
327
|
joinedAt = result.ts;
|
|
328
328
|
await me();
|
|
329
|
-
const members = decoded(await withHelper(() => request("GET", "members?wire=2")), decodeLocalMembersResponse);
|
|
329
|
+
const members = decoded(await withHelper(() => request("GET", "members?wire=2&mute=1")), decodeLocalMembersResponse);
|
|
330
330
|
check(roomId);
|
|
331
331
|
for (const member of members.members) {
|
|
332
332
|
names.set(member.userId, member.displayName);
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
WAKE_HARNESSES,
|
|
4
4
|
wakeDrivers,
|
|
5
5
|
wakeStatus
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O2NDYSYF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
adapterFor,
|
|
9
9
|
registerAntigravityWake,
|
|
10
10
|
resolveSources
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TVWBZD24.mjs";
|
|
12
12
|
import {
|
|
13
13
|
CURSOR_DEFAULT_SESSION,
|
|
14
14
|
updateWakeSettings
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VQDIOGV7.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SESSION_ID_PATTERN,
|
|
18
18
|
filesForDir,
|
|
19
19
|
stateRoot
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
21
21
|
import {
|
|
22
22
|
resetWakeDriver
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-G2TAYBYB.mjs";
|
|
24
24
|
import {
|
|
25
25
|
init_define_KHALA_BUNDLE
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
27
27
|
|
|
28
28
|
// src/wake/cli.ts
|
|
29
29
|
init_define_KHALA_BUNDLE();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
checkName,
|
|
5
5
|
isDefaultAgentName,
|
|
6
6
|
restartHelper
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KZO6BSPQ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
StateError,
|
|
10
10
|
harnessInfo,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
stateRoot,
|
|
14
14
|
validateAgentName,
|
|
15
15
|
writeJsonAtomic
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
init_define_KHALA_BUNDLE
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
20
20
|
|
|
21
21
|
// src/local/identity.ts
|
|
22
22
|
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-PYVAMHAG.mjs";
|
|
7
|
+
import "./chunk-TVWBZD24.mjs";
|
|
8
|
+
import "./chunk-FOCBFFH5.mjs";
|
|
9
|
+
import "./chunk-VQDIOGV7.mjs";
|
|
10
|
+
import "./chunk-VXHWS7JD.mjs";
|
|
11
|
+
import "./chunk-RXM47OGD.mjs";
|
|
12
|
+
import "./chunk-PFWYYXR5.mjs";
|
|
13
|
+
import "./chunk-N7B2VPDU.mjs";
|
|
14
|
+
import "./chunk-G2TAYBYB.mjs";
|
|
15
|
+
import "./chunk-H3XIRV2S.mjs";
|
|
16
|
+
export {
|
|
17
|
+
resolveHarness,
|
|
18
|
+
resolveSession,
|
|
19
|
+
resolveSessionId
|
|
20
|
+
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readJson,
|
|
5
5
|
readProcess,
|
|
6
6
|
writeJsonAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
8
8
|
import {
|
|
9
9
|
init_define_KHALA_BUNDLE
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
11
11
|
|
|
12
12
|
// src/wake/terminal/capture.ts
|
|
13
13
|
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-H3XIRV2S.mjs";
|
|
5
5
|
|
|
6
6
|
// src/wake/shared/nonce.ts
|
|
7
7
|
init_define_KHALA_BUNDLE();
|
|
@@ -45,7 +45,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
45
45
|
var define_KHALA_BUNDLE_default;
|
|
46
46
|
var init_define_KHALA_BUNDLE = __esm({
|
|
47
47
|
"<define:__KHALA_BUNDLE__>"() {
|
|
48
|
-
define_KHALA_BUNDLE_default = { name: "khala-cli", version: "0.4.
|
|
48
|
+
define_KHALA_BUNDLE_default = { name: "khala-cli", version: "0.4.14" };
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -1,12 +1,12 @@
|
|
|
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-H3XIRV2S.mjs";
|
|
5
5
|
|
|
6
6
|
// src/transport.ts
|
|
7
7
|
init_define_KHALA_BUNDLE();
|
|
8
8
|
var RESTORE_HISTORY_MAX_PAGES = 20;
|
|
9
|
-
var startChannelSession = async (creds, options) => creds.transport === "local" ? (await import("./chunk-
|
|
9
|
+
var startChannelSession = async (creds, options) => creds.transport === "local" ? (await import("./chunk-2ZT7TFV5.mjs")).createLocalSession(creds) : (await import("./chunk-YXMJJAMH.mjs")).createAgentMatrixSession(creds, options);
|
|
10
10
|
|
|
11
11
|
export {
|
|
12
12
|
RESTORE_HISTORY_MAX_PAGES,
|
|
@@ -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-U2OUPWUW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
bundle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T3BRQFVF.mjs";
|
|
8
8
|
import {
|
|
9
9
|
LISTENING_MODES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VXHWS7JD.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-N7B2VPDU.mjs";
|
|
39
39
|
import {
|
|
40
40
|
init_define_KHALA_BUNDLE
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
42
42
|
|
|
43
43
|
// src/client.ts
|
|
44
44
|
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-H3XIRV2S.mjs";
|
|
5
5
|
|
|
6
6
|
// ../contracts/src/m1/harness.ts
|
|
7
7
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
adapterFor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TVWBZD24.mjs";
|
|
5
5
|
import {
|
|
6
6
|
installedLauncher,
|
|
7
7
|
launcherShellQuote,
|
|
8
8
|
readWakeSettings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VQDIOGV7.mjs";
|
|
10
10
|
import {
|
|
11
11
|
HARNESS_REGISTRY,
|
|
12
12
|
filesForDir,
|
|
13
13
|
readStateFile,
|
|
14
14
|
stateRoot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
16
16
|
import {
|
|
17
17
|
readWakeState
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-G2TAYBYB.mjs";
|
|
19
19
|
import {
|
|
20
20
|
init_define_KHALA_BUNDLE
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
22
22
|
|
|
23
23
|
// src/wake/status.ts
|
|
24
24
|
init_define_KHALA_BUNDLE();
|
|
@@ -875,7 +875,7 @@ function selectedWakeStatus(rows) {
|
|
|
875
875
|
}
|
|
876
876
|
var WAKE_HARNESSES = HARNESS_REGISTRY.map((row) => row.id);
|
|
877
877
|
async function wakeDisableNotice(dir) {
|
|
878
|
-
const { takeWakeDisableNotices } = await import("./chunk-
|
|
878
|
+
const { takeWakeDisableNotices } = await import("./chunk-BSB77FJG.mjs");
|
|
879
879
|
let drivers;
|
|
880
880
|
try {
|
|
881
881
|
const states = await readWakeState(dir);
|
|
@@ -2,40 +2,40 @@ import { createRequire as __khalaCreateRequire } from 'node:module'; const requi
|
|
|
2
2
|
import {
|
|
3
3
|
RESTORE_HISTORY_MAX_PAGES,
|
|
4
4
|
startChannelSession
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HPZY6LHL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
hostedUsernameFromAgentName,
|
|
8
8
|
pollJoin,
|
|
9
9
|
reportReady,
|
|
10
10
|
requestJoin,
|
|
11
11
|
saveHostedUsername
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4YHVAWZF.mjs";
|
|
13
13
|
import {
|
|
14
14
|
KhalaClientError,
|
|
15
15
|
LOCAL_OWNER_USER_ID
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-KZO6BSPQ.mjs";
|
|
17
|
+
import "./chunk-PIYD4WCN.mjs";
|
|
18
18
|
import {
|
|
19
19
|
KHALA_AGENT_VERSION
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-U2OUPWUW.mjs";
|
|
21
21
|
import {
|
|
22
22
|
resolveHarness,
|
|
23
23
|
resolveSession
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-PYVAMHAG.mjs";
|
|
25
|
+
import "./chunk-T3BRQFVF.mjs";
|
|
26
26
|
import {
|
|
27
27
|
antigravityRegisterHint,
|
|
28
28
|
selectedWakeStatus,
|
|
29
29
|
wakeDisableNotice,
|
|
30
30
|
wakeStatus,
|
|
31
31
|
wakeStatusText
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-O2NDYSYF.mjs";
|
|
33
33
|
import {
|
|
34
34
|
SESSION_UNKNOWN_HINT,
|
|
35
35
|
adapterFor,
|
|
36
36
|
createWakeLadder
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-TVWBZD24.mjs";
|
|
38
|
+
import "./chunk-FOCBFFH5.mjs";
|
|
39
39
|
import {
|
|
40
40
|
ATTENTION,
|
|
41
41
|
applyArchived,
|
|
@@ -49,11 +49,11 @@ import {
|
|
|
49
49
|
qwenInboundAllowed,
|
|
50
50
|
readModeState,
|
|
51
51
|
readWakeSettings
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-VQDIOGV7.mjs";
|
|
53
53
|
import {
|
|
54
54
|
LISTENING_MODES,
|
|
55
55
|
decodeListeningModeCommand
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-VXHWS7JD.mjs";
|
|
57
57
|
import {
|
|
58
58
|
advanceCursor,
|
|
59
59
|
appendInbox,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
unreadCount,
|
|
73
73
|
usageLimited,
|
|
74
74
|
wakesAgent
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-RXM47OGD.mjs";
|
|
76
76
|
import {
|
|
77
77
|
CHANNEL_EVENT_TYPE,
|
|
78
78
|
encodeChannelEvent,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
formatChannelEventLine,
|
|
81
81
|
memberRenameContent,
|
|
82
82
|
statusFor
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-PFWYYXR5.mjs";
|
|
84
84
|
import {
|
|
85
85
|
SESSION_ID_PATTERN,
|
|
86
86
|
StateError,
|
|
@@ -105,11 +105,11 @@ import {
|
|
|
105
105
|
validAgentRejoinSecret,
|
|
106
106
|
writeJoinFile,
|
|
107
107
|
writeStateFile
|
|
108
|
-
} from "./chunk-
|
|
109
|
-
import "./chunk-
|
|
108
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
109
|
+
import "./chunk-G2TAYBYB.mjs";
|
|
110
110
|
import {
|
|
111
111
|
init_define_KHALA_BUNDLE
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
113
113
|
|
|
114
114
|
// src/mcp/main.ts
|
|
115
115
|
init_define_KHALA_BUNDLE();
|
|
@@ -1102,7 +1102,7 @@ function createKhalaAgentClient(options) {
|
|
|
1102
1102
|
await removeStateFile(attempt.files.dir, "session.json");
|
|
1103
1103
|
if (discardResume) await removeStateFile(attempt.files.dir, "resume.json");
|
|
1104
1104
|
if (discardResume && attempt.credentials?.transport !== "local" && !attempt.restore?.localCredentials) {
|
|
1105
|
-
await (await import("./chunk-
|
|
1105
|
+
await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(attempt.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
@@ -1209,11 +1209,11 @@ function createKhalaAgentClient(options) {
|
|
|
1209
1209
|
let credentials = issuedCredentials;
|
|
1210
1210
|
if (attempt.restore && credentials.roomId !== attempt.restore.roomId) {
|
|
1211
1211
|
await removeStateFile(attempt.files.dir, "resume.json");
|
|
1212
|
-
await (await import("./chunk-
|
|
1212
|
+
await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(attempt.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1213
1213
|
throw new KhalaClientError("not_connected", "unauthorized");
|
|
1214
1214
|
}
|
|
1215
1215
|
if (attempt.restore && !attempt.restore.localCredentials) {
|
|
1216
|
-
const cryptoStore = await import("./chunk-
|
|
1216
|
+
const cryptoStore = await import("./chunk-W3LLNKEB.mjs");
|
|
1217
1217
|
try {
|
|
1218
1218
|
credentials = await cryptoStore.restoredCredentials(attempt.files.dir, credentials);
|
|
1219
1219
|
} catch (error) {
|
|
@@ -1279,7 +1279,7 @@ function createKhalaAgentClient(options) {
|
|
|
1279
1279
|
try {
|
|
1280
1280
|
session = await wait(start());
|
|
1281
1281
|
} catch (error) {
|
|
1282
|
-
const cryptoStore = await import("./chunk-
|
|
1282
|
+
const cryptoStore = await import("./chunk-W3LLNKEB.mjs");
|
|
1283
1283
|
if (!(error instanceof cryptoStore.CryptoStoreCorruptError) || credentials.accessToken === issuedCredentials.accessToken) throw error;
|
|
1284
1284
|
await cryptoStore.wipeCryptoStore(channelDir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1285
1285
|
credentials = issuedCredentials;
|
|
@@ -1333,7 +1333,7 @@ function createKhalaAgentClient(options) {
|
|
|
1333
1333
|
if (!current(attempt)) return;
|
|
1334
1334
|
const previous = await readStateFile(channelDir, "mode.json");
|
|
1335
1335
|
if (previous?.eventId === command.eventId && !previous.pendingPublish || previous?.eventTs !== void 0 && command.ts < previous.eventTs) return;
|
|
1336
|
-
const mode = asyncOnly ? "async" : decoded.value.mode;
|
|
1336
|
+
const mode = asyncOnly && decoded.value.mode !== "mute" ? "async" : decoded.value.mode;
|
|
1337
1337
|
const published = await publishMode(attempt, session, credentials.roomId, mode);
|
|
1338
1338
|
await applyListeningMode(attempt.files, mode, { changedBy: "owner", eventId: command.eventId, eventTs: command.ts, ...published ? {} : { pendingPublish: true } }, now);
|
|
1339
1339
|
}).catch(async () => {
|
|
@@ -1368,8 +1368,9 @@ function createKhalaAgentClient(options) {
|
|
|
1368
1368
|
const membershipTime = session.joinedAt?.(credentials.roomId);
|
|
1369
1369
|
if (!savedJoinBoundary && membershipTime !== void 0) originalJoinedAt = new Date(membershipTime).toISOString();
|
|
1370
1370
|
if (asyncOnly) {
|
|
1371
|
-
await
|
|
1372
|
-
await
|
|
1371
|
+
const mode = (await readModeState(attempt.files)).mode === "mute" ? "mute" : "async";
|
|
1372
|
+
await writeStateFile(channelDir, "mode.json", { mode });
|
|
1373
|
+
await publishMode(attempt, session, credentials.roomId, mode);
|
|
1373
1374
|
} else if (session.listeningMode) {
|
|
1374
1375
|
const previous = await readStateFile(channelDir, "mode.json");
|
|
1375
1376
|
await writeStateFile(channelDir, "mode.json", { ...previous, mode: session.listeningMode(credentials.roomId) });
|
|
@@ -1499,9 +1500,9 @@ function createKhalaAgentClient(options) {
|
|
|
1499
1500
|
}
|
|
1500
1501
|
try {
|
|
1501
1502
|
if (restore && !restore.localCredentials) {
|
|
1502
|
-
const state = await (await import("./chunk-
|
|
1503
|
+
const state = await (await import("./chunk-W3LLNKEB.mjs")).validateCryptoToken(attempt.files.dir, options.fetch ?? fetch);
|
|
1503
1504
|
if (state === "corrupt") {
|
|
1504
|
-
await (await import("./chunk-
|
|
1505
|
+
await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(attempt.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1505
1506
|
attempt.cryptoReset = true;
|
|
1506
1507
|
}
|
|
1507
1508
|
if (state === "revoked") throw new KhalaClientError("not_connected", "unauthorized");
|
|
@@ -1532,7 +1533,7 @@ function createKhalaAgentClient(options) {
|
|
|
1532
1533
|
} catch (error) {
|
|
1533
1534
|
if (restore && terminal.includes(safeError(error).message)) {
|
|
1534
1535
|
await removeStateFile(attempt.files.dir, "resume.json");
|
|
1535
|
-
if (!restore.localCredentials) await (await import("./chunk-
|
|
1536
|
+
if (!restore.localCredentials) await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(attempt.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1536
1537
|
}
|
|
1537
1538
|
if (restore && !closed && !attempt.controller.signal.aborted) await setStatus(attempt, "disconnected", safeError(error).message);
|
|
1538
1539
|
attempts.delete(link);
|
|
@@ -1605,12 +1606,12 @@ function createKhalaAgentClient(options) {
|
|
|
1605
1606
|
const previous = priorStatuses.get(ref.key);
|
|
1606
1607
|
if (terminal.includes(previous?.detail ?? "")) {
|
|
1607
1608
|
await removeStateFile(ref.files.dir, "resume.json");
|
|
1608
|
-
await (await import("./chunk-
|
|
1609
|
+
await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(ref.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1609
1610
|
return;
|
|
1610
1611
|
}
|
|
1611
1612
|
if (!savedSecret || authorization.secretHash !== secretHash() || authorization.workspace !== workspace || authorization.roomId !== ref.roomId || authorization.localCredentials && (authorization.localCredentials.transport !== "local" || authorization.localCredentials.roomId !== ref.roomId) || typeof authorization.link !== "string" || typeof authorization.label !== "string") {
|
|
1612
1613
|
await removeStateFile(ref.files.dir, "resume.json");
|
|
1613
|
-
await (await import("./chunk-
|
|
1614
|
+
await (await import("./chunk-W3LLNKEB.mjs")).wipeCryptoStore(ref.files.dir, stateRoot(options.env), options.fetch ?? fetch);
|
|
1614
1615
|
return;
|
|
1615
1616
|
}
|
|
1616
1617
|
const restoring = join(authorization.link, authorization.label, authorization).catch(() => {
|
|
@@ -1706,8 +1707,8 @@ function createKhalaAgentClient(options) {
|
|
|
1706
1707
|
await delegateChannel(files, wait * 1e3 + DELEGATE_GRACE_MS);
|
|
1707
1708
|
for (; ; ) {
|
|
1708
1709
|
const state = await readModeState(files), pending = await unread(files);
|
|
1709
|
-
const mode = state.archived ? "
|
|
1710
|
-
if (
|
|
1710
|
+
const mode = state.archived ? "mute" : state.mode;
|
|
1711
|
+
if (pending.entries.some((entry) => wakesAgent(entry, mode, ownName(session)))) {
|
|
1711
1712
|
if (await advanceCursor(files, pending.cursor, pending.entries, true) !== "conflict") {
|
|
1712
1713
|
consumed = pending.entries.length;
|
|
1713
1714
|
break;
|
|
@@ -1795,7 +1796,7 @@ function createKhalaAgentClient(options) {
|
|
|
1795
1796
|
if (!current(attempt)) throw new KhalaClientError("not_connected");
|
|
1796
1797
|
const { mode: previous, archived } = await readModeState(files);
|
|
1797
1798
|
if (archived) throw refuse("archived");
|
|
1798
|
-
if (asyncOnly && mode !== "async") throw refuse("async_only");
|
|
1799
|
+
if (asyncOnly && mode !== "async" && mode !== "mute") throw refuse("async_only");
|
|
1799
1800
|
if (input.trigger === "self" && ATTENTION[mode] > ATTENTION[previous]) throw refuse("raise_requires_owner_request");
|
|
1800
1801
|
const name = attempt.status.channelName ?? credentials.roomId;
|
|
1801
1802
|
if (mode === previous) return { channel: name, previous, mode };
|
|
@@ -1,23 +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-WMZ7YE6H.mjs";
|
|
5
5
|
import {
|
|
6
6
|
capturePane
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FOCBFFH5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
listChannels,
|
|
10
10
|
writeActivity
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-RXM47OGD.mjs";
|
|
12
|
+
import "./chunk-PFWYYXR5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
TERMINAL_SESSION_DETAILS,
|
|
15
15
|
openSessionDir,
|
|
16
16
|
readJson
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
18
18
|
import {
|
|
19
19
|
init_define_KHALA_BUNDLE
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
21
21
|
|
|
22
22
|
// hooks/session-start.ts
|
|
23
23
|
init_define_KHALA_BUNDLE();
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
utcTimestamp,
|
|
11
11
|
utf8Length,
|
|
12
12
|
version
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
14
14
|
import {
|
|
15
15
|
init_define_KHALA_BUNDLE
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
17
17
|
|
|
18
18
|
// ../contracts/src/m1/channel-event.ts
|
|
19
19
|
init_define_KHALA_BUNDLE();
|
|
@@ -1,30 +1,31 @@
|
|
|
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-WMZ7YE6H.mjs";
|
|
5
5
|
import {
|
|
6
6
|
adapterFor
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-TVWBZD24.mjs";
|
|
8
|
+
import "./chunk-FOCBFFH5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
driverAllowed,
|
|
11
11
|
readListeningMode
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-VQDIOGV7.mjs";
|
|
13
|
+
import "./chunk-VXHWS7JD.mjs";
|
|
14
14
|
import {
|
|
15
|
+
wakeStart,
|
|
15
16
|
wakesAgent
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-RXM47OGD.mjs";
|
|
18
|
+
import "./chunk-PFWYYXR5.mjs";
|
|
18
19
|
import {
|
|
19
20
|
filesForDir,
|
|
20
21
|
readJson,
|
|
21
22
|
resolveStateDir,
|
|
22
23
|
stateRoot
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-N7B2VPDU.mjs";
|
|
25
|
+
import "./chunk-G2TAYBYB.mjs";
|
|
25
26
|
import {
|
|
26
27
|
init_define_KHALA_BUNDLE
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
28
29
|
|
|
29
30
|
// hooks/claude-wake.ts
|
|
30
31
|
init_define_KHALA_BUNDLE();
|
|
@@ -48,7 +49,7 @@ async function unreadChannelMessages(dir) {
|
|
|
48
49
|
const mode = await readListeningMode(files);
|
|
49
50
|
const you = (await readJson(files.status))?.displayName;
|
|
50
51
|
const cursor = await readJson2(path.join(dir, "cursor.json"));
|
|
51
|
-
const delivered = cursor && (cursor.lastDeliveredEventId === null || typeof cursor.lastDeliveredEventId === "string") && Number.isSafeInteger(cursor.deliveredCount) && typeof cursor.deliveredCount === "number" && cursor.deliveredCount >= 0 ? cursor.deliveredCount : 0;
|
|
52
|
+
const delivered = cursor && (cursor.lastDeliveredEventId === null || typeof cursor.lastDeliveredEventId === "string") && Number.isSafeInteger(cursor.deliveredCount) && typeof cursor.deliveredCount === "number" && cursor.deliveredCount >= 0 ? wakeStart({ ...cursor, deliveredCount: cursor.deliveredCount }) : 0;
|
|
52
53
|
let content;
|
|
53
54
|
try {
|
|
54
55
|
content = await fs.readFile(path.join(dir, "inbox.jsonl"), "utf8");
|
|
@@ -80,7 +81,7 @@ async function unreadMessages(dir) {
|
|
|
80
81
|
}
|
|
81
82
|
let messages = 0;
|
|
82
83
|
for (const directory of directories) {
|
|
83
|
-
if (await readListeningMode(filesForDir(directory)) === "
|
|
84
|
+
if (await readListeningMode(filesForDir(directory)) === "mute") continue;
|
|
84
85
|
messages += await unreadChannelMessages(directory);
|
|
85
86
|
}
|
|
86
87
|
return messages;
|
|
@@ -145,7 +146,7 @@ async function watch(stdin, _argv, io = { stderr: process.stderr, env: process.e
|
|
|
145
146
|
if (input.hook_event_name !== "SessionStart") return unreadMessages(dir);
|
|
146
147
|
let messages = 0;
|
|
147
148
|
for (const channel of await sessionStartWakeChannels(filesForDir(dir), io.env)) {
|
|
148
|
-
if (channel.connected && await readListeningMode(channel.files) !== "
|
|
149
|
+
if (channel.connected && await readListeningMode(channel.files) !== "mute") messages += await unreadChannelMessages(channel.files.dir);
|
|
149
150
|
}
|
|
150
151
|
return messages;
|
|
151
152
|
};
|
|
@@ -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-H3XIRV2S.mjs";
|
|
5
5
|
|
|
6
6
|
// src/events/member-rename.ts
|
|
7
7
|
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-TVWBZD24.mjs";
|
|
6
6
|
import {
|
|
7
7
|
init_define_KHALA_BUNDLE
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-H3XIRV2S.mjs";
|
|
9
9
|
|
|
10
10
|
// src/mcp/session-id.ts
|
|
11
11
|
init_define_KHALA_BUNDLE();
|