khala-cli 0.4.18 → 0.4.19

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.
Files changed (42) hide show
  1. package/dist/{chunk-VK7ZSKQZ.mjs → chunk-2CM6MFLQ.mjs} +8 -7
  2. package/dist/chunk-5T2T2BGP.mjs +25 -0
  3. package/dist/{chunk-TYRNBET6.mjs → chunk-6CUBZHAI.mjs} +2 -2
  4. package/dist/{chunk-XXKDMHR2.mjs → chunk-7BR55Y3K.mjs} +2 -2
  5. package/dist/{chunk-ELI3YCFF.mjs → chunk-7JLJ2IVR.mjs} +19 -81
  6. package/dist/{chunk-4WHRO5ZU.mjs → chunk-A76X5SLZ.mjs} +9 -7
  7. package/dist/{chunk-UA6DEWBA.mjs → chunk-BUFSSWDE.mjs} +1 -1
  8. package/dist/{chunk-SRUPGV2G.mjs → chunk-CR2MQIB4.mjs} +11 -13
  9. package/dist/{chunk-FDSHLUCQ.mjs → chunk-DP24LQAW.mjs} +44 -22
  10. package/dist/{chunk-IESMCVXV.mjs → chunk-ERWPSB27.mjs} +1 -1
  11. package/dist/{chunk-YAXWRS5U.mjs → chunk-I3UIC3DD.mjs} +2 -2
  12. package/dist/chunk-IH5ALDEX.mjs +17 -0
  13. package/dist/{chunk-RJZ6FAFC.mjs → chunk-JALXEI56.mjs} +3 -3
  14. package/dist/{chunk-WM75XLND.mjs → chunk-K7YTGI7R.mjs} +6 -6
  15. package/dist/chunk-LOVF37KO.mjs +72 -0
  16. package/dist/{chunk-FCOL5HBH.mjs → chunk-LUQ2K5K2.mjs} +10 -12
  17. package/dist/chunk-LZXXWDKB.mjs +18 -0
  18. package/dist/{chunk-3RCRNCG3.mjs → chunk-ME3G775Q.mjs} +140 -5
  19. package/dist/{chunk-QYVSNP2P.mjs → chunk-NDII2VEP.mjs} +1 -1
  20. package/dist/{chunk-BG4JGKQG.mjs → chunk-NYMXWKOF.mjs} +2 -2
  21. package/dist/{chunk-LOGBYBPA.mjs → chunk-OFLK3DF2.mjs} +1 -1
  22. package/dist/{chunk-RWT4I2XJ.mjs → chunk-OPBCYCDJ.mjs} +23 -25
  23. package/dist/{chunk-OZ5C2ZMB.mjs → chunk-POSW5KU5.mjs} +10 -12
  24. package/dist/{chunk-43THPTMD.mjs → chunk-PQ6Y7QRL.mjs} +7 -7
  25. package/dist/{chunk-KCWHDC7S.mjs → chunk-PXNKY5ZM.mjs} +8 -10
  26. package/dist/{chunk-GVIPYERE.mjs → chunk-Q2ENNHOG.mjs} +3 -3
  27. package/dist/{chunk-HOKMRMNP.mjs → chunk-RYBGLMUZ.mjs} +2 -2
  28. package/dist/{chunk-MTDLNIUY.mjs → chunk-TJUM3DPB.mjs} +1 -1
  29. package/dist/{chunk-6ZL6OFW4.mjs → chunk-TZLAEDD2.mjs} +5 -5
  30. package/dist/{chunk-H2X64ISL.mjs → chunk-UI5OJ2TY.mjs} +3 -3
  31. package/dist/{chunk-5IZ3WN3S.mjs → chunk-V5SWPOLN.mjs} +53 -53
  32. package/dist/{chunk-JXV5S7FC.mjs → chunk-WOHXD3RS.mjs} +433 -129
  33. package/dist/{chunk-4IOLQB34.mjs → chunk-YN334EWZ.mjs} +1 -1
  34. package/dist/khala.mjs +11 -11
  35. package/dist/web/assets/{local-3eMi9596.js → local-SRORuW7r.js} +2 -2
  36. package/dist/web/index.html +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-4FUYRD3G.mjs +0 -27
  39. package/dist/chunk-AU2FBBUY.mjs +0 -20
  40. package/dist/chunk-EBKZETYL.mjs +0 -142
  41. package/dist/chunk-KXLGRISD.mjs +0 -19
  42. package/dist/chunk-LNDZI73C.mjs +0 -323
@@ -1,19 +1,19 @@
1
1
  import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
2
2
  import {
3
3
  bundle
4
- } from "./chunk-IESMCVXV.mjs";
4
+ } from "./chunk-ERWPSB27.mjs";
5
5
  import {
6
6
  consentLine,
7
7
  setWake
8
- } from "./chunk-WM75XLND.mjs";
8
+ } from "./chunk-K7YTGI7R.mjs";
9
9
  import {
10
10
  antigravityRegisterHint,
11
11
  wakeDrivers
12
- } from "./chunk-VK7ZSKQZ.mjs";
12
+ } from "./chunk-2CM6MFLQ.mjs";
13
13
  import {
14
14
  adapterFor
15
- } from "./chunk-RWT4I2XJ.mjs";
16
- import "./chunk-HOKMRMNP.mjs";
15
+ } from "./chunk-OPBCYCDJ.mjs";
16
+ import "./chunk-RYBGLMUZ.mjs";
17
17
  import {
18
18
  ManagedFiles,
19
19
  cursorPaths,
@@ -29,19 +29,17 @@ import {
29
29
  qwenHome,
30
30
  readManaged,
31
31
  textFormat
32
- } from "./chunk-JXV5S7FC.mjs";
33
- import "./chunk-EBKZETYL.mjs";
34
- import "./chunk-LNDZI73C.mjs";
35
- import "./chunk-3RCRNCG3.mjs";
32
+ } from "./chunk-WOHXD3RS.mjs";
33
+ import "./chunk-ME3G775Q.mjs";
36
34
  import {
37
35
  ensureStateDir,
38
36
  isHarnessId,
39
37
  stateRoot
40
- } from "./chunk-4IOLQB34.mjs";
41
- import "./chunk-LOGBYBPA.mjs";
38
+ } from "./chunk-YN334EWZ.mjs";
39
+ import "./chunk-OFLK3DF2.mjs";
42
40
  import {
43
41
  init_define_KHALA_BUNDLE
44
- } from "./chunk-QYVSNP2P.mjs";
42
+ } from "./chunk-NDII2VEP.mjs";
45
43
 
46
44
  // src/install/main.ts
47
45
  init_define_KHALA_BUNDLE();
@@ -0,0 +1,18 @@
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-NYMXWKOF.mjs";
7
+ import "./chunk-OPBCYCDJ.mjs";
8
+ import "./chunk-RYBGLMUZ.mjs";
9
+ import "./chunk-WOHXD3RS.mjs";
10
+ import "./chunk-ME3G775Q.mjs";
11
+ import "./chunk-YN334EWZ.mjs";
12
+ import "./chunk-OFLK3DF2.mjs";
13
+ import "./chunk-NDII2VEP.mjs";
14
+ export {
15
+ resolveHarness,
16
+ resolveSession,
17
+ resolveSessionId
18
+ };
@@ -6,14 +6,15 @@ import {
6
6
  label,
7
7
  literal,
8
8
  object,
9
+ readMatrixUserId,
9
10
  safeInteger,
10
11
  utcTimestamp,
11
12
  utf8Length,
12
13
  version
13
- } from "./chunk-4IOLQB34.mjs";
14
+ } from "./chunk-YN334EWZ.mjs";
14
15
  import {
15
16
  init_define_KHALA_BUNDLE
16
- } from "./chunk-QYVSNP2P.mjs";
17
+ } from "./chunk-NDII2VEP.mjs";
17
18
 
18
19
  // ../contracts/src/m1/channel-event.ts
19
20
  init_define_KHALA_BUNDLE();
@@ -236,11 +237,11 @@ function statusFor(content) {
236
237
  return content.kind.startsWith("agent.attention.") && !content.kind.endsWith(".resolved") ? "attention" : "info";
237
238
  }
238
239
  }
239
- function foldCoordination(events) {
240
+ function foldCoordination(events2) {
240
241
  const handoffs = /* @__PURE__ */ new Map();
241
242
  const claims = /* @__PURE__ */ new Map();
242
243
  const notes = /* @__PURE__ */ new Map();
243
- for (const { sender, by, at, content: { kind, data } } of events) {
244
+ for (const { sender, by, at, content: { kind, data } } of events2) {
244
245
  if (!data) continue;
245
246
  const s = (key) => String(data[key]);
246
247
  if (kind === "handoff") {
@@ -257,6 +258,128 @@ function foldCoordination(events) {
257
258
  return { openHandoffs: [...handoffs.values()], activeClaims: [...claims.values()], notes: Object.fromEntries(notes) };
258
259
  }
259
260
 
261
+ // ../contracts/src/m1/listening-mode.ts
262
+ init_define_KHALA_BUNDLE();
263
+
264
+ // ../listener/src/index.ts
265
+ init_define_KHALA_BUNDLE();
266
+
267
+ // ../listener/src/modes.ts
268
+ init_define_KHALA_BUNDLE();
269
+ var DELIVERY_MODES = ["steer", "sync", "async"];
270
+ var LISTENING_MODES = [...DELIVERY_MODES, "mute"];
271
+ var DEFAULT_LISTENING_MODE = "sync";
272
+ function wakesOn(mode, addressed, fromAgent) {
273
+ if (mode === "mute") return false;
274
+ if (mode === "async") return addressed;
275
+ return mode === "steer" || addressed || !fromAgent;
276
+ }
277
+
278
+ // ../listener/src/decision.ts
279
+ init_define_KHALA_BUNDLE();
280
+ function decideDelivery(input) {
281
+ if (input.event === "start") return { deliverModes: [], markIdleOnly: false };
282
+ if (input.event === "stop" && input.continuation) return { deliverModes: [], markIdleOnly: true };
283
+ const steerOnly = input.event === "tool" || input.event === "prompt" && input.harness === "claude" && input.busy && input.busyAgeMs !== null && input.busyAgeMs < 12e4 && !input.interruptedSinceBusy;
284
+ return { deliverModes: steerOnly ? ["steer"] : ["steer", "sync"], markIdleOnly: false };
285
+ }
286
+
287
+ // ../listener/src/frame.ts
288
+ init_define_KHALA_BUNDLE();
289
+ var MAX_FRAME_BYTES = 64 * 1024;
290
+ var MAX_FRAME_MESSAGES = 50;
291
+ var encoder = new TextEncoder();
292
+ var utf8Length2 = (value) => encoder.encode(value).byteLength;
293
+ function selectFrame(entries, render, truncatedSuffix, budget = MAX_FRAME_BYTES, truncate = true) {
294
+ const rendered = [];
295
+ let consumedCount = 0;
296
+ for (let i = 0; i < entries.length; i++) {
297
+ const entry = entries[i];
298
+ if (rendered.length === MAX_FRAME_MESSAGES) break;
299
+ if (utf8Length2(render([...rendered, entry])) > budget) {
300
+ if (rendered.length || !truncate) break;
301
+ const body = Array.from(entry.body);
302
+ let low = 0, high = body.length;
303
+ while (low < high) {
304
+ const middle = Math.ceil((low + high) / 2);
305
+ const candidate = { ...entry, body: body.slice(0, middle).join("") + truncatedSuffix };
306
+ if (utf8Length2(render([candidate])) <= budget) low = middle;
307
+ else high = middle - 1;
308
+ }
309
+ const truncated = { ...entry, body: body.slice(0, low).join("") + truncatedSuffix };
310
+ if (utf8Length2(render([truncated])) > budget) throw new Error("frame_metadata_too_large");
311
+ rendered.push(truncated);
312
+ consumedCount = i + 1;
313
+ break;
314
+ }
315
+ rendered.push(entry);
316
+ consumedCount = i + 1;
317
+ }
318
+ return {
319
+ frame: rendered.length ? render(rendered) : null,
320
+ consumed: entries.slice(0, consumedCount)
321
+ };
322
+ }
323
+
324
+ // ../listener/src/codecs/claude-style.ts
325
+ init_define_KHALA_BUNDLE();
326
+ var events = { SessionStart: "start", UserPromptSubmit: "prompt", PostToolUse: "tool", Stop: "stop", StopFailure: "limit" };
327
+ var LIMIT_ERRORS = ["rate_limit", "billing_error"];
328
+ var names = { prompt: "UserPromptSubmit", tool: "PostToolUse", stop: "Stop" };
329
+ function createClaudeStyleCodec(stopNudge) {
330
+ return {
331
+ promptDeliversWithoutWake: true,
332
+ promptAcceptsContext: true,
333
+ suppressOutputErrors: false,
334
+ parse(stdin) {
335
+ try {
336
+ const input = JSON.parse(stdin);
337
+ if (!input || typeof input.session_id !== "string" || typeof input.hook_event_name !== "string" || !Object.hasOwn(events, input.hook_event_name) || input.stop_hook_active !== void 0 && typeof input.stop_hook_active !== "boolean" || input.hook_event_name === "StopFailure" && !LIMIT_ERRORS.includes(input.error)) return null;
338
+ return {
339
+ sessionId: input.session_id,
340
+ event: events[input.hook_event_name],
341
+ continuation: input.stop_hook_active === true,
342
+ ...typeof input.cwd === "string" ? { workspace: input.cwd } : {},
343
+ ...typeof input.transcript_path === "string" ? { transcriptPath: input.transcript_path } : {},
344
+ ...typeof input.prompt === "string" ? { promptText: input.prompt } : {}
345
+ };
346
+ } catch {
347
+ return null;
348
+ }
349
+ },
350
+ noop: () => "",
351
+ render(kind, frame, stopContext = false) {
352
+ return JSON.stringify(kind === "stop" && !stopContext ? { decision: "block", reason: stopNudge } : { hookSpecificOutput: { hookEventName: names[kind], additionalContext: frame } }) + "\n";
353
+ }
354
+ };
355
+ }
356
+
357
+ // ../contracts/src/m1/listening-mode.ts
358
+ function decodeListeningMode(input) {
359
+ return decodeWith(() => literal(input, "", LISTENING_MODES));
360
+ }
361
+ var LISTENING_MODE_COMMAND_TYPE = "com.khala.listening_mode.v1";
362
+ var LISTENING_MODE_MEMBER_KEY = "com.khala.listening_mode";
363
+ function decodeListeningModeCommand(input) {
364
+ return decodeWith(() => {
365
+ const hasLock = typeof input === "object" && input !== null && Object.hasOwn(input, "locked");
366
+ const r = object(input, "", hasLock ? ["v", "agent", "mode", "locked"] : ["v", "agent", "mode"]);
367
+ if (hasLock && typeof r.field("locked") !== "boolean") fail(r.at("locked"), "wrong_type");
368
+ return {
369
+ v: version(r.field("v"), r.at("v")),
370
+ agent: readMatrixUserId(r.field("agent"), r.at("agent")),
371
+ mode: literal(r.field("mode"), r.at("mode"), LISTENING_MODES),
372
+ ...hasLock ? { locked: r.field("locked") } : {}
373
+ };
374
+ });
375
+ }
376
+ function memberListeningMode(content) {
377
+ const value = typeof content === "object" && content !== null ? content[LISTENING_MODE_MEMBER_KEY] : void 0;
378
+ if (value === void 0) return DEFAULT_LISTENING_MODE;
379
+ const decoded = decodeListeningMode(value);
380
+ return decoded.ok ? decoded.value : "async";
381
+ }
382
+
260
383
  export {
261
384
  CHANNEL_EVENT_TYPE,
262
385
  decodeChannelEvent,
@@ -264,5 +387,17 @@ export {
264
387
  encodeChannelEvent,
265
388
  memberRenameContent,
266
389
  statusFor,
267
- foldCoordination
390
+ foldCoordination,
391
+ LISTENING_MODES,
392
+ DEFAULT_LISTENING_MODE,
393
+ wakesOn,
394
+ decideDelivery,
395
+ MAX_FRAME_BYTES,
396
+ selectFrame,
397
+ createClaudeStyleCodec,
398
+ decodeListeningMode,
399
+ LISTENING_MODE_COMMAND_TYPE,
400
+ LISTENING_MODE_MEMBER_KEY,
401
+ decodeListeningModeCommand,
402
+ memberListeningMode
268
403
  };
@@ -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.18" };
48
+ define_KHALA_BUNDLE_default = { name: "khala-cli", version: "0.4.19" };
49
49
  }
50
50
  });
51
51
 
@@ -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-RWT4I2XJ.mjs";
5
+ } from "./chunk-OPBCYCDJ.mjs";
6
6
  import {
7
7
  init_define_KHALA_BUNDLE
8
- } from "./chunk-QYVSNP2P.mjs";
8
+ } from "./chunk-NDII2VEP.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-QYVSNP2P.mjs";
4
+ } from "./chunk-NDII2VEP.mjs";
5
5
 
6
6
  // src/wake/shared/nonce.ts
7
7
  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-HOKMRMNP.mjs";
4
+ } from "./chunk-RYBGLMUZ.mjs";
5
5
  import {
6
6
  CURSOR_DEFAULT_SESSION,
7
7
  CURSOR_WORKSPACE_ENV,
@@ -9,27 +9,25 @@ import {
9
9
  createQwenSocketDriver,
10
10
  cursorSessionId,
11
11
  driverAllowed,
12
+ listChannels,
12
13
  museCliPath,
13
14
  museMonitorInstruction,
14
15
  museStopWakeText,
15
16
  museWatchCommand,
16
17
  qwenInboundAllowed,
17
18
  qwenSession,
18
- readListeningMode,
19
- readWakeSettings,
20
- verifyQwenTranscript
21
- } from "./chunk-JXV5S7FC.mjs";
22
- import {
23
- createClaudeStyleCodec
24
- } from "./chunk-EBKZETYL.mjs";
25
- import {
26
- listChannels,
27
19
  readActivity,
28
20
  readCursor,
21
+ readListeningMode,
22
+ readWakeSettings,
29
23
  unwoken,
24
+ verifyQwenTranscript,
30
25
  wakeStart,
31
26
  wakesAgent
32
- } from "./chunk-LNDZI73C.mjs";
27
+ } from "./chunk-WOHXD3RS.mjs";
28
+ import {
29
+ createClaudeStyleCodec
30
+ } from "./chunk-ME3G775Q.mjs";
33
31
  import {
34
32
  HARNESS_REGISTRY,
35
33
  SESSION_ID_PATTERN,
@@ -44,7 +42,7 @@ import {
44
42
  stateRoot,
45
43
  walkAncestors,
46
44
  writeJsonAtomic
47
- } from "./chunk-4IOLQB34.mjs";
45
+ } from "./chunk-YN334EWZ.mjs";
48
46
  import {
49
47
  CODEX_IDLE_WAKE_NOTICE,
50
48
  cancelAttempt,
@@ -56,10 +54,10 @@ import {
56
54
  settleAttempts,
57
55
  wakeLine,
58
56
  withWakeLock
59
- } from "./chunk-LOGBYBPA.mjs";
57
+ } from "./chunk-OFLK3DF2.mjs";
60
58
  import {
61
59
  init_define_KHALA_BUNDLE
62
- } from "./chunk-QYVSNP2P.mjs";
60
+ } from "./chunk-NDII2VEP.mjs";
63
61
 
64
62
  // src/harness/index.ts
65
63
  init_define_KHALA_BUNDLE();
@@ -777,7 +775,7 @@ var codexWakeDriver = createCodexWakeDriver();
777
775
 
778
776
  // src/harness/codex.ts
779
777
  var emptyPrompt2 = { pattern: /^› ?(Ask Codex to do anything)?$/u, cursorColumn: 2 };
780
- var install = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runCodexInstall(flags, deps);
778
+ var install = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runCodexInstall(flags, deps);
781
779
  var codex = {
782
780
  id: "codex",
783
781
  // A string metadata id wins even when empty or invalid; validation happens after selection.
@@ -859,7 +857,7 @@ async function resolveSources(sources, meta, env, context) {
859
857
  }
860
858
 
861
859
  // src/harness/muse.ts
862
- var install2 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runMuseInstall(flags, deps);
860
+ var install2 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runMuseInstall(flags, deps);
863
861
  var muse = {
864
862
  id: "muse",
865
863
  sessionSources: [{ kind: "env", resolve: (_meta, env) => env.MUSE_SESSION_ID, rejoinable: () => true }, hookMapSource],
@@ -922,7 +920,7 @@ var copilotCodec = createCopilotCodec();
922
920
 
923
921
  // src/harness/copilot.ts
924
922
  var emptyPrompt3 = { pattern: /^❯ ?$/u, cursorColumn: 2 };
925
- var install3 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runCopilotInstall(flags, deps);
923
+ var install3 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runCopilotInstall(flags, deps);
926
924
  var copilot = {
927
925
  id: "copilot",
928
926
  sessionSources: [{ kind: "env", resolve: (_meta, env) => env.COPILOT_AGENT_SESSION_ID, rejoinable: () => true }, hookMapSource],
@@ -970,7 +968,7 @@ var cursorCodec = {
970
968
  };
971
969
 
972
970
  // src/harness/cursor.ts
973
- var install4 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runCursorInstall(flags, deps);
971
+ var install4 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runCursorInstall(flags, deps);
974
972
  var cursor = {
975
973
  id: "cursor",
976
974
  sessionSources: [{
@@ -1008,7 +1006,7 @@ function createQwenBackgroundDriver(platform = process.platform) {
1008
1006
  verification: "none",
1009
1007
  async available(ctx) {
1010
1008
  const settings = await readWakeSettings(stateRoot(ctx.env));
1011
- return platform === "win32" && !settings.off["qwen/socket"] && !settings.off["qwen/background-shell"] && await qwenInboundAllowed(ctx.env) && await (await import("./chunk-43THPTMD.mjs")).monitorArmed(ctx.files);
1009
+ return platform === "win32" && !settings.off["qwen/socket"] && !settings.off["qwen/background-shell"] && await qwenInboundAllowed(ctx.env) && await (await import("./chunk-PQ6Y7QRL.mjs")).monitorArmed(ctx.files);
1012
1010
  },
1013
1011
  async unavailableReason(ctx) {
1014
1012
  if (!await qwenInboundAllowed(ctx.env)) return "qwen_held";
@@ -1023,8 +1021,8 @@ var qwen = {
1023
1021
  codec: qwenCodec,
1024
1022
  restoreAtStartup: true,
1025
1023
  sessionSources: [{ kind: "meta", resolve: (meta) => meta?.khala_session, rejoinable: () => true }, { kind: "env", resolve: (_meta, env) => qwenSession(env), rejoinable: () => true }, hookMapSource],
1026
- install: async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runQwenInstall(flags, deps),
1027
- uninstall: async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runQwenInstall([...flags, "--uninstall"], deps),
1024
+ install: async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runQwenInstall(flags, deps),
1025
+ uninstall: async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runQwenInstall([...flags, "--uninstall"], deps),
1028
1026
  wakeLadder: [createQwenSocketDriver(), createQwenBackgroundDriver()],
1029
1027
  async verifyWake(stdin, files, now) {
1030
1028
  const input = JSON.parse(stdin);
@@ -1068,7 +1066,7 @@ var geminiCodec = {
1068
1066
 
1069
1067
  // src/harness/gemini.ts
1070
1068
  var emptyPrompt4 = { pattern: /^ >(?: {3}Type your message or @path\/to\/file)?$/u, cursorColumn: 3 };
1071
- var install5 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runGeminiInstall(flags, deps);
1069
+ var install5 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runGeminiInstall(flags, deps);
1072
1070
  var gemini = {
1073
1071
  id: "gemini",
1074
1072
  sessionSources: [{ kind: "env", resolve: (_meta, env) => env.GEMINI_SESSION_ID, rejoinable: () => true }, hookMapSource],
@@ -1246,7 +1244,7 @@ async function antigravityPromptText(input) {
1246
1244
 
1247
1245
  // src/harness/antigravity.ts
1248
1246
  var emptyPrompt5 = { pattern: /^>$/u, cursorColumn: 2 };
1249
- var install6 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runAntigravityInstall(flags, deps);
1247
+ var install6 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runAntigravityInstall(flags, deps);
1250
1248
  var antigravity = {
1251
1249
  id: "antigravity",
1252
1250
  restoreAtStartup: true,
@@ -1405,7 +1403,7 @@ async function pollOpenCodeWake(files, io, replay = false) {
1405
1403
  }
1406
1404
 
1407
1405
  // src/harness/opencode.ts
1408
- var install7 = async (flags, deps) => (await import("./chunk-FCOL5HBH.mjs")).runOpenCodeInstall(flags, deps);
1406
+ var install7 = async (flags, deps) => (await import("./chunk-LUQ2K5K2.mjs")).runOpenCodeInstall(flags, deps);
1409
1407
  var opencode = {
1410
1408
  id: "opencode",
1411
1409
  sessionSources: [{ kind: "meta", resolve: (meta) => meta?.khala_session, rejoinable: () => true }, hookMapSource],
@@ -1450,12 +1448,12 @@ function adapterFor(id) {
1450
1448
 
1451
1449
  export {
1452
1450
  STOP_NUDGE,
1453
- createCopilotCodec,
1454
1451
  createWakeLadder,
1455
1452
  registerAntigravityWake,
1456
1453
  SESSION_UNKNOWN_HINT,
1457
1454
  recordHookSession,
1458
1455
  resolveSources,
1456
+ createCopilotCodec,
1459
1457
  createAdapterRegistry,
1460
1458
  ADAPTERS,
1461
1459
  adapterFor
@@ -1,28 +1,26 @@
1
1
  import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
2
2
  import {
3
3
  retryUnexpired
4
- } from "./chunk-UA6DEWBA.mjs";
4
+ } from "./chunk-BUFSSWDE.mjs";
5
5
  import {
6
6
  IMAGE_MAX_BYTES,
7
7
  RESTORE_HISTORY_MAX_PAGES
8
- } from "./chunk-TYRNBET6.mjs";
9
- import "./chunk-MTDLNIUY.mjs";
8
+ } from "./chunk-6CUBZHAI.mjs";
9
+ import "./chunk-TJUM3DPB.mjs";
10
10
  import {
11
+ CHANNEL_EVENT_TYPE,
11
12
  LISTENING_MODE_COMMAND_TYPE,
12
13
  LISTENING_MODE_MEMBER_KEY,
13
- memberListeningMode
14
- } from "./chunk-EBKZETYL.mjs";
15
- import {
16
- CHANNEL_EVENT_TYPE,
17
14
  encodeChannelEvent,
15
+ memberListeningMode,
18
16
  memberRenameContent
19
- } from "./chunk-3RCRNCG3.mjs";
17
+ } from "./chunk-ME3G775Q.mjs";
20
18
  import {
21
19
  StateError
22
- } from "./chunk-4IOLQB34.mjs";
20
+ } from "./chunk-YN334EWZ.mjs";
23
21
  import {
24
22
  init_define_KHALA_BUNDLE
25
- } from "./chunk-QYVSNP2P.mjs";
23
+ } from "./chunk-NDII2VEP.mjs";
26
24
 
27
25
  // src/matrix/session.ts
28
26
  init_define_KHALA_BUNDLE();
@@ -61,7 +59,7 @@ async function createAgentMatrixSession(creds, opts) {
61
59
  const started = Date.now();
62
60
  const rejoinTxnId = `khala.rejoin.${randomUUID()}`;
63
61
  const log = (line) => opts?.log?.(line);
64
- const persistent = opts?.cryptoStore ? await (await import("./chunk-H2X64ISL.mjs")).openCryptoStore(opts.cryptoStore.dir, opts.cryptoStore.root, creds) : void 0;
62
+ const persistent = opts?.cryptoStore ? await (await import("./chunk-UI5OJ2TY.mjs")).openCryptoStore(opts.cryptoStore.dir, opts.cryptoStore.root, creds) : void 0;
65
63
  const client = createClient({ ...persistent ? { store: persistent.sync } : {}, baseUrl: creds.homeserver, userId: creds.userId, accessToken: creds.accessToken, deviceId: creds.deviceId });
66
64
  const handlers = /* @__PURE__ */ new Set();
67
65
  const ended = /* @__PURE__ */ new Set();
@@ -320,7 +318,7 @@ async function createAgentMatrixSession(creds, opts) {
320
318
  await client.initRustCrypto(persistent ? { useIndexedDB: true, cryptoDatabasePrefix: persistent.prefix } : { useIndexedDB: false });
321
319
  } catch (error) {
322
320
  if (!persistent?.restored || error instanceof StateError && error.code === "unsafe_state_dir") throw error;
323
- throw new (await import("./chunk-H2X64ISL.mjs")).CryptoStoreCorruptError();
321
+ throw new (await import("./chunk-UI5OJ2TY.mjs")).CryptoStoreCorruptError();
324
322
  }
325
323
  const crypto = client.getCrypto();
326
324
  if (!crypto) throw new Error("crypto_unavailable");
@@ -1,19 +1,19 @@
1
1
  import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
2
2
  import {
3
3
  WATCH_USAGE,
4
+ claudeWatchCommand,
4
5
  monitorArmed,
5
6
  monitorOwner,
6
7
  run,
7
8
  watchSession
8
- } from "./chunk-JXV5S7FC.mjs";
9
- import "./chunk-EBKZETYL.mjs";
10
- import "./chunk-LNDZI73C.mjs";
11
- import "./chunk-3RCRNCG3.mjs";
12
- import "./chunk-4IOLQB34.mjs";
13
- import "./chunk-LOGBYBPA.mjs";
14
- import "./chunk-QYVSNP2P.mjs";
9
+ } from "./chunk-WOHXD3RS.mjs";
10
+ import "./chunk-ME3G775Q.mjs";
11
+ import "./chunk-YN334EWZ.mjs";
12
+ import "./chunk-OFLK3DF2.mjs";
13
+ import "./chunk-NDII2VEP.mjs";
15
14
  export {
16
15
  WATCH_USAGE,
16
+ claudeWatchCommand,
17
17
  run as default,
18
18
  monitorArmed,
19
19
  monitorOwner,
@@ -14,21 +14,19 @@ import {
14
14
  decodeLocalSendResult,
15
15
  ensureHelper,
16
16
  localRoomPath
17
- } from "./chunk-6ZL6OFW4.mjs";
18
- import "./chunk-MTDLNIUY.mjs";
19
- import "./chunk-XXKDMHR2.mjs";
20
- import "./chunk-IESMCVXV.mjs";
21
- import {
22
- LISTENING_MODE_COMMAND_TYPE
23
- } from "./chunk-EBKZETYL.mjs";
17
+ } from "./chunk-TZLAEDD2.mjs";
18
+ import "./chunk-TJUM3DPB.mjs";
19
+ import "./chunk-7BR55Y3K.mjs";
20
+ import "./chunk-ERWPSB27.mjs";
24
21
  import {
25
22
  CHANNEL_EVENT_TYPE,
23
+ LISTENING_MODE_COMMAND_TYPE,
26
24
  memberRenameContent
27
- } from "./chunk-3RCRNCG3.mjs";
28
- import "./chunk-4IOLQB34.mjs";
25
+ } from "./chunk-ME3G775Q.mjs";
26
+ import "./chunk-YN334EWZ.mjs";
29
27
  import {
30
28
  init_define_KHALA_BUNDLE
31
- } from "./chunk-QYVSNP2P.mjs";
29
+ } from "./chunk-NDII2VEP.mjs";
32
30
 
33
31
  // src/local/session.ts
34
32
  init_define_KHALA_BUNDLE();
@@ -4,7 +4,7 @@ import {
4
4
  checkName,
5
5
  isDefaultAgentName,
6
6
  restartHelper
7
- } from "./chunk-6ZL6OFW4.mjs";
7
+ } from "./chunk-TZLAEDD2.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-4IOLQB34.mjs";
16
+ } from "./chunk-YN334EWZ.mjs";
17
17
  import {
18
18
  init_define_KHALA_BUNDLE
19
- } from "./chunk-QYVSNP2P.mjs";
19
+ } from "./chunk-NDII2VEP.mjs";
20
20
 
21
21
  // src/local/identity.ts
22
22
  init_define_KHALA_BUNDLE();
@@ -4,10 +4,10 @@ import {
4
4
  readJson,
5
5
  readProcess,
6
6
  writeJsonAtomic
7
- } from "./chunk-4IOLQB34.mjs";
7
+ } from "./chunk-YN334EWZ.mjs";
8
8
  import {
9
9
  init_define_KHALA_BUNDLE
10
- } from "./chunk-QYVSNP2P.mjs";
10
+ } from "./chunk-NDII2VEP.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-QYVSNP2P.mjs";
4
+ } from "./chunk-NDII2VEP.mjs";
5
5
 
6
6
  // src/events/member-rename.ts
7
7
  init_define_KHALA_BUNDLE();
@@ -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-XXKDMHR2.mjs";
4
+ } from "./chunk-7BR55Y3K.mjs";
5
5
  import {
6
6
  bundle
7
- } from "./chunk-IESMCVXV.mjs";
7
+ } from "./chunk-ERWPSB27.mjs";
8
8
  import {
9
9
  LISTENING_MODES
10
- } from "./chunk-EBKZETYL.mjs";
10
+ } from "./chunk-ME3G775Q.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-4IOLQB34.mjs";
38
+ } from "./chunk-YN334EWZ.mjs";
39
39
  import {
40
40
  init_define_KHALA_BUNDLE
41
- } from "./chunk-QYVSNP2P.mjs";
41
+ } from "./chunk-NDII2VEP.mjs";
42
42
 
43
43
  // src/client.ts
44
44
  init_define_KHALA_BUNDLE();
@@ -1,18 +1,18 @@
1
1
  import { createRequire as __khalaCreateRequire } from 'node:module'; const require = __khalaCreateRequire(import.meta.url);
2
2
  import {
3
3
  retryUnexpired
4
- } from "./chunk-UA6DEWBA.mjs";
4
+ } from "./chunk-BUFSSWDE.mjs";
5
5
  import {
6
6
  StateError,
7
7
  ensureStateDir,
8
8
  writeJsonAtomic
9
- } from "./chunk-4IOLQB34.mjs";
9
+ } from "./chunk-YN334EWZ.mjs";
10
10
  import {
11
11
  __commonJS,
12
12
  __export,
13
13
  __toESM,
14
14
  init_define_KHALA_BUNDLE
15
- } from "./chunk-QYVSNP2P.mjs";
15
+ } from "./chunk-NDII2VEP.mjs";
16
16
 
17
17
  // ../../node_modules/.pnpm/immediate@3.3.0/node_modules/immediate/lib/nextTick.js
18
18
  var require_nextTick = __commonJS({