@agentvault/muse-bridge 0.1.3 → 0.1.4
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/bridge.d.ts +6 -0
- package/dist/index.js +721 -499
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -239,465 +239,7 @@ var init_log = __esm({
|
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
|
|
242
|
-
//
|
|
243
|
-
import { dirname as dirname2 } from "node:path";
|
|
244
|
-
function sq(s2) {
|
|
245
|
-
return `'${s2.replace(/'/g, `'\\''`)}'`;
|
|
246
|
-
}
|
|
247
|
-
function candidateExpr(c2) {
|
|
248
|
-
return c2.includes("$") ? `"${c2}"` : sq(c2);
|
|
249
|
-
}
|
|
250
|
-
function renderLauncher(opts) {
|
|
251
|
-
const candidates = ["node", ...opts.fallbacks ?? FALLBACK_NODES];
|
|
252
|
-
const lines = [
|
|
253
|
-
"#!/usr/bin/env bash",
|
|
254
|
-
"# AgentVault muse-bridge launcher \u2014 regenerated on every `install`. Resolves node at",
|
|
255
|
-
"# boot so a node upgrade / version-manager switch can't strand the daemon."
|
|
256
|
-
];
|
|
257
|
-
if (opts.installPath) lines.push(`export PATH=${sq(opts.installPath)}:"$PATH"`);
|
|
258
|
-
for (const c2 of candidates) {
|
|
259
|
-
lines.push(`if n=$(command -v ${candidateExpr(c2)} 2>/dev/null); then exec "$n" ${sq(opts.entrypoint)} "$@"; fi`);
|
|
260
|
-
}
|
|
261
|
-
lines.push(
|
|
262
|
-
`echo "[muse-bridge] node not found on PATH or known locations \u2014 re-run: agentvault-muse-bridge install" >&2`,
|
|
263
|
-
"exit 0"
|
|
264
|
-
);
|
|
265
|
-
return lines.join("\n") + "\n";
|
|
266
|
-
}
|
|
267
|
-
function writeLauncher(deps, spec) {
|
|
268
|
-
deps.mkdir(dirname2(spec.launcherPath));
|
|
269
|
-
deps.writeFile(spec.launcherPath, spec.launcherScript);
|
|
270
|
-
deps.chmod(spec.launcherPath, 493);
|
|
271
|
-
}
|
|
272
|
-
var FALLBACK_NODES;
|
|
273
|
-
var init_launcher = __esm({
|
|
274
|
-
"src/service/launcher.ts"() {
|
|
275
|
-
"use strict";
|
|
276
|
-
FALLBACK_NODES = [
|
|
277
|
-
"/opt/homebrew/bin/node",
|
|
278
|
-
"/usr/local/bin/node",
|
|
279
|
-
"/usr/bin/node",
|
|
280
|
-
"$HOME/.volta/bin/node",
|
|
281
|
-
"$HOME/.asdf/shims/node",
|
|
282
|
-
"$HOME/.local/bin/node"
|
|
283
|
-
];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
// src/service/spec.ts
|
|
288
|
-
import { join as join6 } from "node:path";
|
|
289
|
-
function buildServiceSpec(cfg, opts) {
|
|
290
|
-
const env = {
|
|
291
|
-
AV_AGENT_NAME: cfg.agentName,
|
|
292
|
-
AV_DATA_DIR: cfg.dataDir,
|
|
293
|
-
AV_API_URL: cfg.apiUrl,
|
|
294
|
-
AV_FENCE_HOME: cfg.fenceHome,
|
|
295
|
-
AV_MUSE_PATH: cfg.musePath
|
|
296
|
-
};
|
|
297
|
-
if (cfg.workspaceDir) env.AV_WORKSPACE_DIR = cfg.workspaceDir;
|
|
298
|
-
const launcherPath = join6(cfg.dataDir, "launch-muse-bridge.sh");
|
|
299
|
-
return {
|
|
300
|
-
label: `dev.agentvault.muse-${slugify(cfg.agentName)}`,
|
|
301
|
-
programArgs: [launcherPath],
|
|
302
|
-
launcherPath,
|
|
303
|
-
launcherScript: renderLauncher({ installPath: opts.path, entrypoint: opts.entrypoint }),
|
|
304
|
-
env,
|
|
305
|
-
workingDir: cfg.workspaceDir ? cfg.workspaceDir : opts.home,
|
|
306
|
-
logOut: join6(cfg.dataDir, "logs", "muse-bridge.log"),
|
|
307
|
-
logErr: join6(cfg.dataDir, "logs", "muse-bridge.error.log"),
|
|
308
|
-
keepAliveUnlessCleanExit: true,
|
|
309
|
-
runAtLoad: true
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
var init_spec = __esm({
|
|
313
|
-
"src/service/spec.ts"() {
|
|
314
|
-
"use strict";
|
|
315
|
-
init_config();
|
|
316
|
-
init_launcher();
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
// src/service/launchd.ts
|
|
321
|
-
import { dirname as dirname3, join as join7 } from "node:path";
|
|
322
|
-
function esc(s2) {
|
|
323
|
-
return s2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
324
|
-
}
|
|
325
|
-
function renderLaunchdPlist(spec) {
|
|
326
|
-
const args = spec.programArgs.map((a2) => ` <string>${esc(a2)}</string>`).join("\n");
|
|
327
|
-
const envEntries = Object.entries(spec.env).map(([k2, v2]) => ` <key>${esc(k2)}</key>
|
|
328
|
-
<string>${esc(v2)}</string>`).join("\n");
|
|
329
|
-
const keepAlive = spec.keepAliveUnlessCleanExit ? "<key>KeepAlive</key>\n <dict>\n <key>SuccessfulExit</key>\n <false/>\n </dict>" : "<key>KeepAlive</key>\n <false/>";
|
|
330
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
331
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
332
|
-
<plist version="1.0">
|
|
333
|
-
<dict>
|
|
334
|
-
<key>Label</key>
|
|
335
|
-
<string>${esc(spec.label)}</string>
|
|
336
|
-
<key>ProgramArguments</key>
|
|
337
|
-
<array>
|
|
338
|
-
${args}
|
|
339
|
-
</array>
|
|
340
|
-
<key>EnvironmentVariables</key>
|
|
341
|
-
<dict>
|
|
342
|
-
${envEntries}
|
|
343
|
-
</dict>
|
|
344
|
-
<key>WorkingDirectory</key>
|
|
345
|
-
<string>${esc(spec.workingDir)}</string>
|
|
346
|
-
<key>StandardOutPath</key>
|
|
347
|
-
<string>${esc(spec.logOut)}</string>
|
|
348
|
-
<key>StandardErrorPath</key>
|
|
349
|
-
<string>${esc(spec.logErr)}</string>
|
|
350
|
-
${keepAlive}
|
|
351
|
-
<key>RunAtLoad</key>
|
|
352
|
-
${spec.runAtLoad ? "<true/>" : "<false/>"}
|
|
353
|
-
</dict>
|
|
354
|
-
</plist>
|
|
355
|
-
`;
|
|
356
|
-
}
|
|
357
|
-
function parsePlistEnv(xml) {
|
|
358
|
-
const out = {};
|
|
359
|
-
const keyIdx = xml.indexOf("<key>EnvironmentVariables</key>");
|
|
360
|
-
if (keyIdx < 0) return out;
|
|
361
|
-
const open = xml.indexOf("<dict>", keyIdx);
|
|
362
|
-
if (open < 0) return out;
|
|
363
|
-
let depth = 0;
|
|
364
|
-
let i2 = open;
|
|
365
|
-
let close = -1;
|
|
366
|
-
const tag = /<(\/?)dict>/g;
|
|
367
|
-
tag.lastIndex = open;
|
|
368
|
-
let m2;
|
|
369
|
-
while (m2 = tag.exec(xml)) {
|
|
370
|
-
depth += m2[1] ? -1 : 1;
|
|
371
|
-
if (depth === 0) {
|
|
372
|
-
close = m2.index;
|
|
373
|
-
break;
|
|
374
|
-
}
|
|
375
|
-
i2 = m2.index;
|
|
376
|
-
}
|
|
377
|
-
void i2;
|
|
378
|
-
if (close < 0) return out;
|
|
379
|
-
const body = xml.slice(open, close);
|
|
380
|
-
const pair = /<key>([\s\S]*?)<\/key>\s*<string>([\s\S]*?)<\/string>/g;
|
|
381
|
-
let p2;
|
|
382
|
-
while (p2 = pair.exec(body)) out[unesc(p2[1])] = unesc(p2[2]);
|
|
383
|
-
return out;
|
|
384
|
-
}
|
|
385
|
-
function unesc(s2) {
|
|
386
|
-
return s2.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
387
|
-
}
|
|
388
|
-
var LaunchdBackend;
|
|
389
|
-
var init_launchd = __esm({
|
|
390
|
-
"src/service/launchd.ts"() {
|
|
391
|
-
"use strict";
|
|
392
|
-
init_launcher();
|
|
393
|
-
LaunchdBackend = class {
|
|
394
|
-
constructor(deps) {
|
|
395
|
-
this.deps = deps;
|
|
396
|
-
}
|
|
397
|
-
deps;
|
|
398
|
-
plistPath(label) {
|
|
399
|
-
return join7(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
400
|
-
}
|
|
401
|
-
domain() {
|
|
402
|
-
return `gui/${this.deps.uid}`;
|
|
403
|
-
}
|
|
404
|
-
install(spec) {
|
|
405
|
-
const path2 = this.plistPath(spec.label);
|
|
406
|
-
this.deps.mkdir(dirname3(spec.logOut));
|
|
407
|
-
writeLauncher(this.deps, spec);
|
|
408
|
-
this.deps.mkdir(dirname3(path2));
|
|
409
|
-
this.deps.writeFile(path2, renderLaunchdPlist(spec));
|
|
410
|
-
const svc = `${this.domain()}/${spec.label}`;
|
|
411
|
-
this.deps.exec("launchctl", ["bootout", svc]);
|
|
412
|
-
this.waitUntilGone(svc);
|
|
413
|
-
let r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
414
|
-
for (let i2 = 0; i2 < 5 && r2.code !== 0; i2++) {
|
|
415
|
-
this.deps.exec("sleep", ["0.3"]);
|
|
416
|
-
r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
417
|
-
}
|
|
418
|
-
this.deps.exec("launchctl", ["kickstart", "-k", svc]);
|
|
419
|
-
}
|
|
420
|
-
waitUntilGone(svc) {
|
|
421
|
-
for (let i2 = 0; i2 < 20; i2++) {
|
|
422
|
-
if (this.deps.exec("launchctl", ["print", svc]).code !== 0) return;
|
|
423
|
-
this.deps.exec("sleep", ["0.25"]);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
restart(label) {
|
|
427
|
-
this.deps.exec("launchctl", ["kickstart", "-k", `${this.domain()}/${label}`]);
|
|
428
|
-
}
|
|
429
|
-
uninstall(label) {
|
|
430
|
-
this.deps.exec("launchctl", ["bootout", `${this.domain()}/${label}`]);
|
|
431
|
-
const path2 = this.plistPath(label);
|
|
432
|
-
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
433
|
-
}
|
|
434
|
-
status(label) {
|
|
435
|
-
const r2 = this.deps.exec("launchctl", ["print", `${this.domain()}/${label}`]);
|
|
436
|
-
return { loaded: r2.code === 0, detail: r2.stdout };
|
|
437
|
-
}
|
|
438
|
-
list(prefix) {
|
|
439
|
-
const dir = join7(this.deps.home, "Library", "LaunchAgents");
|
|
440
|
-
const out = [];
|
|
441
|
-
for (const name of this.deps.readdir(dir)) {
|
|
442
|
-
if (!name.startsWith(prefix) || !name.endsWith(".plist")) continue;
|
|
443
|
-
const path2 = join7(dir, name);
|
|
444
|
-
out.push({
|
|
445
|
-
label: name.slice(0, -".plist".length),
|
|
446
|
-
path: path2,
|
|
447
|
-
env: parsePlistEnv(this.deps.readFile(path2))
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
// src/service/systemd.ts
|
|
457
|
-
import { dirname as dirname4, join as join8 } from "node:path";
|
|
458
|
-
function q(s2) {
|
|
459
|
-
const esc3 = s2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/%/g, "%%");
|
|
460
|
-
return `"${esc3}"`;
|
|
461
|
-
}
|
|
462
|
-
function renderSystemdUnit(spec) {
|
|
463
|
-
const exec = spec.programArgs.map(q).join(" ");
|
|
464
|
-
const envLines = Object.entries(spec.env).map(([k2, v2]) => `Environment=${q(`${k2}=${v2}`)}`).join("\n");
|
|
465
|
-
return `[Unit]
|
|
466
|
-
Description=AgentVault muse bridge (${spec.label})
|
|
467
|
-
Wants=network-online.target
|
|
468
|
-
After=network-online.target
|
|
469
|
-
|
|
470
|
-
[Service]
|
|
471
|
-
ExecStart=${exec}
|
|
472
|
-
WorkingDirectory=${spec.workingDir}
|
|
473
|
-
${envLines}
|
|
474
|
-
Restart=on-failure
|
|
475
|
-
SuccessExitStatus=0
|
|
476
|
-
StandardOutput=append:${spec.logOut}
|
|
477
|
-
StandardError=append:${spec.logErr}
|
|
478
|
-
|
|
479
|
-
[Install]
|
|
480
|
-
WantedBy=default.target
|
|
481
|
-
`;
|
|
482
|
-
}
|
|
483
|
-
function parseUnitEnv(text) {
|
|
484
|
-
const out = {};
|
|
485
|
-
for (const line of text.split("\n")) {
|
|
486
|
-
const m2 = /^Environment="([\s\S]*)"\s*$/.exec(line.trim());
|
|
487
|
-
if (!m2) continue;
|
|
488
|
-
const eq = unq(m2[1]);
|
|
489
|
-
const at = eq.indexOf("=");
|
|
490
|
-
if (at <= 0) continue;
|
|
491
|
-
out[eq.slice(0, at)] = eq.slice(at + 1);
|
|
492
|
-
}
|
|
493
|
-
return out;
|
|
494
|
-
}
|
|
495
|
-
function unq(s2) {
|
|
496
|
-
return s2.replace(/%%/g, "%").replace(
|
|
497
|
-
/\\([\s\S])/g,
|
|
498
|
-
(_2, c2) => c2 === "n" ? "\n" : c2 === "r" ? "\r" : c2 === "t" ? " " : c2
|
|
499
|
-
);
|
|
500
|
-
}
|
|
501
|
-
var SystemdBackend;
|
|
502
|
-
var init_systemd = __esm({
|
|
503
|
-
"src/service/systemd.ts"() {
|
|
504
|
-
"use strict";
|
|
505
|
-
init_launcher();
|
|
506
|
-
SystemdBackend = class {
|
|
507
|
-
constructor(deps) {
|
|
508
|
-
this.deps = deps;
|
|
509
|
-
}
|
|
510
|
-
deps;
|
|
511
|
-
unitPath(label) {
|
|
512
|
-
return join8(this.deps.home, ".config", "systemd", "user", `${label}.service`);
|
|
513
|
-
}
|
|
514
|
-
install(spec) {
|
|
515
|
-
const path2 = this.unitPath(spec.label);
|
|
516
|
-
this.deps.mkdir(dirname4(spec.logOut));
|
|
517
|
-
writeLauncher(this.deps, spec);
|
|
518
|
-
this.deps.mkdir(dirname4(path2));
|
|
519
|
-
this.deps.writeFile(path2, renderSystemdUnit(spec));
|
|
520
|
-
this.deps.exec("loginctl", ["enable-linger", this.deps.user]);
|
|
521
|
-
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
522
|
-
this.deps.exec("systemctl", ["--user", "enable", `${spec.label}.service`]);
|
|
523
|
-
this.deps.exec("systemctl", ["--user", "restart", `${spec.label}.service`]);
|
|
524
|
-
}
|
|
525
|
-
restart(label) {
|
|
526
|
-
this.deps.exec("systemctl", ["--user", "restart", `${label}.service`]);
|
|
527
|
-
}
|
|
528
|
-
uninstall(label) {
|
|
529
|
-
this.deps.exec("systemctl", ["--user", "disable", "--now", `${label}.service`]);
|
|
530
|
-
const path2 = this.unitPath(label);
|
|
531
|
-
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
532
|
-
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
533
|
-
}
|
|
534
|
-
status(label) {
|
|
535
|
-
const enabled = this.deps.exec("systemctl", ["--user", "is-enabled", `${label}.service`]);
|
|
536
|
-
const active = this.deps.exec("systemctl", ["--user", "is-active", `${label}.service`]);
|
|
537
|
-
return { loaded: enabled.code === 0, detail: `${enabled.stdout.trim() || "?"} / ${active.stdout.trim() || "?"}` };
|
|
538
|
-
}
|
|
539
|
-
list(prefix) {
|
|
540
|
-
const dir = join8(this.deps.home, ".config", "systemd", "user");
|
|
541
|
-
const out = [];
|
|
542
|
-
for (const name of this.deps.readdir(dir)) {
|
|
543
|
-
if (!name.startsWith(prefix) || !name.endsWith(".service")) continue;
|
|
544
|
-
const path2 = join8(dir, name);
|
|
545
|
-
out.push({
|
|
546
|
-
label: name.slice(0, -".service".length),
|
|
547
|
-
path: path2,
|
|
548
|
-
env: parseUnitEnv(this.deps.readFile(path2))
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
|
|
557
|
-
// src/service/backend.ts
|
|
558
|
-
import { spawnSync } from "node:child_process";
|
|
559
|
-
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync4, rmSync, existsSync as existsSync4, chmodSync as chmodSync4, readdirSync, readFileSync as readFileSync4 } from "node:fs";
|
|
560
|
-
import { userInfo } from "node:os";
|
|
561
|
-
function defaultDeps() {
|
|
562
|
-
return {
|
|
563
|
-
home: process.env.HOME ?? "",
|
|
564
|
-
uid: userInfo().uid,
|
|
565
|
-
user: userInfo().username,
|
|
566
|
-
exec: (cmd, args) => {
|
|
567
|
-
const r2 = spawnSync(cmd, args, { encoding: "utf8" });
|
|
568
|
-
return { code: r2.status ?? 1, stdout: r2.stdout ?? "" };
|
|
569
|
-
},
|
|
570
|
-
writeFile: (p2, d2) => writeFileSync4(p2, d2),
|
|
571
|
-
mkdir: (p2) => mkdirSync5(p2, { recursive: true }),
|
|
572
|
-
chmod: (p2, m2) => chmodSync4(p2, m2),
|
|
573
|
-
rm: (p2) => rmSync(p2, { force: true }),
|
|
574
|
-
exists: (p2) => existsSync4(p2),
|
|
575
|
-
readdir: (p2) => {
|
|
576
|
-
try {
|
|
577
|
-
return readdirSync(p2);
|
|
578
|
-
} catch {
|
|
579
|
-
return [];
|
|
580
|
-
}
|
|
581
|
-
},
|
|
582
|
-
readFile: (p2) => {
|
|
583
|
-
try {
|
|
584
|
-
return readFileSync4(p2, "utf8");
|
|
585
|
-
} catch {
|
|
586
|
-
return "";
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
function selectBackend(platform, deps) {
|
|
592
|
-
if (platform === "darwin") {
|
|
593
|
-
return new LaunchdBackend(deps ?? defaultDeps());
|
|
594
|
-
}
|
|
595
|
-
if (platform === "linux") {
|
|
596
|
-
return new SystemdBackend(deps ?? defaultDeps());
|
|
597
|
-
}
|
|
598
|
-
throw new Error(`unsupported platform for muse-bridge service install: ${platform}`);
|
|
599
|
-
}
|
|
600
|
-
var init_backend = __esm({
|
|
601
|
-
"src/service/backend.ts"() {
|
|
602
|
-
"use strict";
|
|
603
|
-
init_launchd();
|
|
604
|
-
init_systemd();
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
// src/service/subcommand.ts
|
|
609
|
-
var subcommand_exports = {};
|
|
610
|
-
__export(subcommand_exports, {
|
|
611
|
-
labelFor: () => labelFor,
|
|
612
|
-
maybeRunServiceSubcommand: () => maybeRunServiceSubcommand
|
|
613
|
-
});
|
|
614
|
-
import { join as join9 } from "node:path";
|
|
615
|
-
function requireAgentName(env) {
|
|
616
|
-
const name = env.AV_AGENT_NAME?.trim();
|
|
617
|
-
if (!name) {
|
|
618
|
-
throw new Error(
|
|
619
|
-
"AV_AGENT_NAME is required \u2014 it names WHICH agent's service to act on. Re-run as: AV_AGENT_NAME=<agent-name> agentvault-muse-bridge <subcommand>"
|
|
620
|
-
);
|
|
621
|
-
}
|
|
622
|
-
return name;
|
|
623
|
-
}
|
|
624
|
-
function labelFor(env) {
|
|
625
|
-
return `dev.agentvault.muse-${slugify(requireAgentName(env))}`;
|
|
626
|
-
}
|
|
627
|
-
function dataDirFor(env, agentName) {
|
|
628
|
-
if (env.AV_DATA_DIR) return env.AV_DATA_DIR;
|
|
629
|
-
return join9(env.HOME ?? "", ".agentvault", "muse-room-bridge", slugify(agentName));
|
|
630
|
-
}
|
|
631
|
-
function maybeRunServiceSubcommand(argv, env, deps) {
|
|
632
|
-
const cmd = argv[2];
|
|
633
|
-
if (!cmd) return false;
|
|
634
|
-
if (!SERVICE_CMDS.has(cmd)) {
|
|
635
|
-
const looksLikeToken = cmd.startsWith("av_tok_");
|
|
636
|
-
const looksLikeFlag = cmd.startsWith("-");
|
|
637
|
-
if (!looksLikeToken && !looksLikeFlag) {
|
|
638
|
-
throw new Error(
|
|
639
|
-
`unknown subcommand: ${cmd} \u2014 expected one of ${[...SERVICE_CMDS].join(", ")}, an invite token, or no argument at all`
|
|
640
|
-
);
|
|
641
|
-
}
|
|
642
|
-
return false;
|
|
643
|
-
}
|
|
644
|
-
const backend = deps?.backend ?? selectBackend(process.platform);
|
|
645
|
-
const entrypoint = deps?.entrypoint ?? process.argv[1];
|
|
646
|
-
const log = deps?.log ?? ((m2) => logLine("[muse-bridge] " + m2));
|
|
647
|
-
try {
|
|
648
|
-
if (cmd === "install") {
|
|
649
|
-
const agentName = requireAgentName(env);
|
|
650
|
-
assertInstallableEntrypoint(entrypoint);
|
|
651
|
-
const dataDir = dataDirFor(env, agentName);
|
|
652
|
-
if (!hasPersistedCreds(dataDir)) {
|
|
653
|
-
throw new Error(
|
|
654
|
-
"cannot install a supervised service before this agent has enrolled \u2014 run agentvault-muse-bridge <invite-token> once so credentials persist, then: AV_AGENT_NAME=<agent-name> agentvault-muse-bridge install"
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
const cfg = loadConfig(env, []);
|
|
658
|
-
const spec = buildServiceSpec(cfg, {
|
|
659
|
-
entrypoint,
|
|
660
|
-
home: env.HOME ?? "",
|
|
661
|
-
path: env.PATH ?? ""
|
|
662
|
-
});
|
|
663
|
-
backend.install(spec);
|
|
664
|
-
log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
|
|
665
|
-
log(`check it with: AV_AGENT_NAME=${cfg.agentName} agentvault-muse-bridge status`);
|
|
666
|
-
} else if (cmd === "uninstall") {
|
|
667
|
-
const label = labelFor(env);
|
|
668
|
-
backend.uninstall(label);
|
|
669
|
-
log(`uninstalled service ${label}`);
|
|
670
|
-
} else if (cmd === "restart") {
|
|
671
|
-
const label = labelFor(env);
|
|
672
|
-
backend.restart(label);
|
|
673
|
-
log(`restarted service ${label}`);
|
|
674
|
-
} else if (cmd === "status") {
|
|
675
|
-
const label = labelFor(env);
|
|
676
|
-
const st = backend.status(label);
|
|
677
|
-
log(`${label}: ${st.loaded ? "loaded" : "not loaded"}`);
|
|
678
|
-
} else if (cmd === "logs") {
|
|
679
|
-
const label = labelFor(env);
|
|
680
|
-
log(`logs for ${label} are at <dataDir>/logs/muse-bridge.log (tail -f it)`);
|
|
681
|
-
}
|
|
682
|
-
} catch (e) {
|
|
683
|
-
log(e.message);
|
|
684
|
-
process.exitCode = 1;
|
|
685
|
-
}
|
|
686
|
-
return true;
|
|
687
|
-
}
|
|
688
|
-
var SERVICE_CMDS;
|
|
689
|
-
var init_subcommand = __esm({
|
|
690
|
-
"src/service/subcommand.ts"() {
|
|
691
|
-
"use strict";
|
|
692
|
-
init_config();
|
|
693
|
-
init_log();
|
|
694
|
-
init_spec();
|
|
695
|
-
init_backend();
|
|
696
|
-
SERVICE_CMDS = /* @__PURE__ */ new Set(["install", "uninstall", "restart", "status", "logs"]);
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
|
|
700
|
-
// ../../../../packages/plugin/dist/index.js
|
|
242
|
+
// ../plugin/dist/index.js
|
|
701
243
|
var dist_exports = {};
|
|
702
244
|
__export(dist_exports, {
|
|
703
245
|
AgentVaultMcpServer: () => AgentVaultMcpServer,
|
|
@@ -725,6 +267,8 @@ __export(dist_exports, {
|
|
|
725
267
|
mergeSkills: () => mergeSkills,
|
|
726
268
|
onAgentEvent: () => onAgentEvent,
|
|
727
269
|
onSessionTranscriptUpdate: () => onSessionTranscriptUpdate,
|
|
270
|
+
owesRoomReply: () => owesRoomReply,
|
|
271
|
+
parseMentions: () => parseMentions,
|
|
728
272
|
parseSkillMd: () => parseSkillMd,
|
|
729
273
|
parseTarget: () => parseTarget,
|
|
730
274
|
reportSkillInvocation: () => reportSkillInvocation,
|
|
@@ -735,12 +279,13 @@ __export(dist_exports, {
|
|
|
735
279
|
sendToRoom: () => sendToRoom,
|
|
736
280
|
sendToTarget: () => sendToTarget,
|
|
737
281
|
setOcRuntime: () => setOcRuntime,
|
|
282
|
+
stripMentions: () => stripMentions,
|
|
738
283
|
wrapSkillExecution: () => wrapSkillExecution
|
|
739
284
|
});
|
|
740
285
|
import * as nc from "node:crypto";
|
|
741
286
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
742
287
|
import { readdir, readFile, rename, rm } from "node:fs/promises";
|
|
743
|
-
import { join as
|
|
288
|
+
import { join as join6 } from "node:path";
|
|
744
289
|
import { readFile as readFile2, rename as rename2, rm as rm2 } from "node:fs/promises";
|
|
745
290
|
import { join as join22 } from "node:path";
|
|
746
291
|
import { Readable } from "node:stream";
|
|
@@ -750,7 +295,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
|
|
|
750
295
|
import { EventEmitter } from "node:events";
|
|
751
296
|
import { createServer as createServer2 } from "node:http";
|
|
752
297
|
import { randomUUID as randomUUID22, createHash } from "node:crypto";
|
|
753
|
-
import { readFileSync as
|
|
298
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
754
299
|
import { homedir as osHomedir } from "node:os";
|
|
755
300
|
import { writeFile as writeFile3, mkdir as mkdir3 } from "node:fs/promises";
|
|
756
301
|
import { join as join42 } from "node:path";
|
|
@@ -762,8 +307,19 @@ import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
|
|
|
762
307
|
import { Http2ServerRequest } from "http2";
|
|
763
308
|
import { Readable as Readable2 } from "stream";
|
|
764
309
|
import crypto3 from "crypto";
|
|
765
|
-
import { readFileSync as readFileSync22, existsSync as
|
|
310
|
+
import { readFileSync as readFileSync22, existsSync as existsSync4, readdirSync } from "node:fs";
|
|
766
311
|
import { resolve as resolve22, join as join52 } from "node:path";
|
|
312
|
+
function stripWrappers(s2) {
|
|
313
|
+
let start = 0;
|
|
314
|
+
let end = s2.length;
|
|
315
|
+
while (start < end && WRAPPERS.includes(s2[start])) start++;
|
|
316
|
+
while (end > start && WRAPPERS.includes(s2[end - 1])) end--;
|
|
317
|
+
return s2.slice(start, end);
|
|
318
|
+
}
|
|
319
|
+
function isAbstention(text) {
|
|
320
|
+
if (typeof text !== "string") return false;
|
|
321
|
+
return stripWrappers(text).toLowerCase().startsWith(SENTINEL);
|
|
322
|
+
}
|
|
767
323
|
function toEpoch(v2) {
|
|
768
324
|
if (typeof v2 === "bigint") return v2;
|
|
769
325
|
if (typeof v2 === "number") {
|
|
@@ -1340,7 +896,7 @@ function W(e) {
|
|
|
1340
896
|
var n2 = p(t2, e);
|
|
1341
897
|
return g(r2), n2;
|
|
1342
898
|
}
|
|
1343
|
-
function
|
|
899
|
+
function q(e, r2, t2) {
|
|
1344
900
|
var _2 = [];
|
|
1345
901
|
i(t2);
|
|
1346
902
|
var n2 = u(e = E(_2, e, "message")), s2 = e.length;
|
|
@@ -11760,7 +11316,7 @@ async function writeSecureFile(filePath, data, flag) {
|
|
|
11760
11316
|
}
|
|
11761
11317
|
function syncLockPath(dataDir, channelId) {
|
|
11762
11318
|
const safe = channelId.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
11763
|
-
return
|
|
11319
|
+
return join6(dataDir, `mls-a2a-sync-${safe}.lock`);
|
|
11764
11320
|
}
|
|
11765
11321
|
async function acquireA2ASyncLock(dataDir, channelId) {
|
|
11766
11322
|
await ensureSecureDir(dataDir);
|
|
@@ -11843,12 +11399,12 @@ async function clearPendingWelcome(dataDir, groupId) {
|
|
|
11843
11399
|
}
|
|
11844
11400
|
async function saveMlsState(dataDir, groupId, state) {
|
|
11845
11401
|
await ensureSecureDir(dataDir);
|
|
11846
|
-
const filePath =
|
|
11402
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11847
11403
|
await writeSecureFile(filePath, state);
|
|
11848
11404
|
}
|
|
11849
11405
|
async function loadMlsState(dataDir, groupId) {
|
|
11850
11406
|
try {
|
|
11851
|
-
const filePath =
|
|
11407
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11852
11408
|
return await readFile(filePath, "utf-8");
|
|
11853
11409
|
} catch {
|
|
11854
11410
|
return null;
|
|
@@ -11856,7 +11412,7 @@ async function loadMlsState(dataDir, groupId) {
|
|
|
11856
11412
|
}
|
|
11857
11413
|
async function deleteMlsState(dataDir, groupId) {
|
|
11858
11414
|
try {
|
|
11859
|
-
const filePath =
|
|
11415
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11860
11416
|
await rm(filePath);
|
|
11861
11417
|
} catch {
|
|
11862
11418
|
}
|
|
@@ -11883,7 +11439,7 @@ async function quarantineOrphanedMlsState(dataDir, isStillMember, opts = {}) {
|
|
|
11883
11439
|
}
|
|
11884
11440
|
if (member === null || member === true) continue;
|
|
11885
11441
|
try {
|
|
11886
|
-
await rename(
|
|
11442
|
+
await rename(join6(dataDir, name), join6(dataDir, `${name}.orphaned`));
|
|
11887
11443
|
quarantined.push(groupId);
|
|
11888
11444
|
} catch {
|
|
11889
11445
|
}
|
|
@@ -11909,10 +11465,10 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11909
11465
|
return null;
|
|
11910
11466
|
}
|
|
11911
11467
|
function ownIdentity() {
|
|
11912
|
-
const v2 = true ? "0.23.
|
|
11468
|
+
const v2 = true ? "0.23.29" : FALLBACK;
|
|
11913
11469
|
return `${PACKAGE}@${v2}`;
|
|
11914
11470
|
}
|
|
11915
|
-
function
|
|
11471
|
+
function buildClientVersion(override) {
|
|
11916
11472
|
try {
|
|
11917
11473
|
const candidate = (override ?? "").trim();
|
|
11918
11474
|
if (candidate) {
|
|
@@ -12634,7 +12190,7 @@ function formatChannelError(err) {
|
|
|
12634
12190
|
}
|
|
12635
12191
|
return `[AgentVault] channel error (non-fatal to the connection): ${msg}`;
|
|
12636
12192
|
}
|
|
12637
|
-
function
|
|
12193
|
+
function attachLifecycle(channel, opts = {}) {
|
|
12638
12194
|
const log = opts.log ?? (() => {
|
|
12639
12195
|
});
|
|
12640
12196
|
const agentName = opts.agentName ?? "";
|
|
@@ -12907,6 +12463,51 @@ async function checkGateway(options) {
|
|
|
12907
12463
|
return { ok: false, error: friendlyError(err) };
|
|
12908
12464
|
}
|
|
12909
12465
|
}
|
|
12466
|
+
function parseMentions(text) {
|
|
12467
|
+
const mentions = [];
|
|
12468
|
+
const re2 = /@(\w[\w]*)/gi;
|
|
12469
|
+
let match;
|
|
12470
|
+
while ((match = re2.exec(text)) !== null) {
|
|
12471
|
+
mentions.push(match[1].toLowerCase());
|
|
12472
|
+
}
|
|
12473
|
+
return mentions;
|
|
12474
|
+
}
|
|
12475
|
+
function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true) {
|
|
12476
|
+
const mentions = parseMentions(plaintext);
|
|
12477
|
+
if (mentions.length === 0) return false;
|
|
12478
|
+
if (mentions.includes("all") || mentions.includes("everyone")) {
|
|
12479
|
+
return senderIsAgent !== true;
|
|
12480
|
+
}
|
|
12481
|
+
const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
|
|
12482
|
+
if (mentions.some((m2) => ownNames.has(m2))) return true;
|
|
12483
|
+
if (!selfResolved) return true;
|
|
12484
|
+
return false;
|
|
12485
|
+
}
|
|
12486
|
+
function ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName) {
|
|
12487
|
+
const names = /* @__PURE__ */ new Set();
|
|
12488
|
+
const add4 = (n2) => {
|
|
12489
|
+
if (!n2) return;
|
|
12490
|
+
const lower = n2.toLowerCase();
|
|
12491
|
+
names.add(lower);
|
|
12492
|
+
names.add(lower.split(/[\s(]/)[0]);
|
|
12493
|
+
};
|
|
12494
|
+
add4(agentName);
|
|
12495
|
+
add4(accountId);
|
|
12496
|
+
add4(roomDisplayName);
|
|
12497
|
+
add4(ownDisplayName);
|
|
12498
|
+
return names;
|
|
12499
|
+
}
|
|
12500
|
+
function stripMentions(text, agentName, accountId, roomDisplayName, ownDisplayName) {
|
|
12501
|
+
const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
|
|
12502
|
+
return text.replace(/@(\w[\w]*)/gi, (full, name) => {
|
|
12503
|
+
const lower = name.toLowerCase();
|
|
12504
|
+
if (ownNames.has(lower)) {
|
|
12505
|
+
return "";
|
|
12506
|
+
}
|
|
12507
|
+
if (lower === "all" || lower === "everyone") return "";
|
|
12508
|
+
return full;
|
|
12509
|
+
}).replace(/^\s+/, "").trim();
|
|
12510
|
+
}
|
|
12910
12511
|
function getErrorMap() {
|
|
12911
12512
|
return overrideErrorMap;
|
|
12912
12513
|
}
|
|
@@ -13280,7 +12881,7 @@ function randomString(length = 10) {
|
|
|
13280
12881
|
}
|
|
13281
12882
|
return str;
|
|
13282
12883
|
}
|
|
13283
|
-
function
|
|
12884
|
+
function esc(str) {
|
|
13284
12885
|
return JSON.stringify(str);
|
|
13285
12886
|
}
|
|
13286
12887
|
function slugify2(input) {
|
|
@@ -17190,7 +16791,7 @@ function parseSimpleYaml(yaml) {
|
|
|
17190
16791
|
function loadSkillsFromDirectory(dir) {
|
|
17191
16792
|
const skills = [];
|
|
17192
16793
|
const absDir = resolve22(dir);
|
|
17193
|
-
if (!
|
|
16794
|
+
if (!existsSync4(absDir)) return skills;
|
|
17194
16795
|
const seen = /* @__PURE__ */ new Set();
|
|
17195
16796
|
function tryLoad(filePath) {
|
|
17196
16797
|
if (seen.has(filePath)) return;
|
|
@@ -17203,13 +16804,13 @@ function loadSkillsFromDirectory(dir) {
|
|
|
17203
16804
|
}
|
|
17204
16805
|
}
|
|
17205
16806
|
try {
|
|
17206
|
-
const entries =
|
|
16807
|
+
const entries = readdirSync(absDir, { withFileTypes: true });
|
|
17207
16808
|
for (const entry of entries) {
|
|
17208
16809
|
if (entry.isFile() && entry.name.endsWith("SKILL.md")) {
|
|
17209
16810
|
tryLoad(join52(absDir, entry.name));
|
|
17210
16811
|
} else if (entry.isDirectory()) {
|
|
17211
16812
|
const subSkill = join52(absDir, entry.name, "SKILL.md");
|
|
17212
|
-
if (
|
|
16813
|
+
if (existsSync4(subSkill)) {
|
|
17213
16814
|
tryLoad(subSkill);
|
|
17214
16815
|
}
|
|
17215
16816
|
}
|
|
@@ -17437,9 +17038,9 @@ function reportSkillInvocation(opts) {
|
|
|
17437
17038
|
spanBuffer.push(span);
|
|
17438
17039
|
return span;
|
|
17439
17040
|
}
|
|
17440
|
-
var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, init_mls_commit_classify, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md, U32_MASK64, _32n, init_u64, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE2, wrapCipher, init_utils, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE3, swap32IfBE2, hasHexBuiltin, hexes, asciis, Hash, init_utils2, HashMD2, SHA256_IV2, SHA384_IV2, SHA512_IV2, init_md2, U32_MASK642, _32n2, shrSH2, shrSL2, rotrSH2, rotrSL2, rotrBH2, rotrBL2, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L2, add3H2, add4L2, add4H2, add5L2, add5H2, init_u642, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils3, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, oidNist2, init_utils4, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES2, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, isUsingManagedRoutes, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
|
|
17041
|
+
var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_mls_commit_classify, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md, U32_MASK64, _32n, init_u64, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE2, wrapCipher, init_utils, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE3, swap32IfBE2, hasHexBuiltin, hexes, asciis, Hash, init_utils2, HashMD2, SHA256_IV2, SHA384_IV2, SHA512_IV2, init_md2, U32_MASK642, _32n2, shrSH2, shrSL2, rotrSH2, rotrSL2, rotrBH2, rotrBL2, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L2, add3H2, add4L2, add4H2, add5L2, add5H2, init_u642, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils3, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, oidNist2, init_utils4, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES2, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_room_protocol, init_llm_response_parser, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, isUsingManagedRoutes, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
|
|
17441
17042
|
var init_dist = __esm({
|
|
17442
|
-
async "
|
|
17043
|
+
async "../plugin/dist/index.js"() {
|
|
17443
17044
|
"use strict";
|
|
17444
17045
|
__create = Object.create;
|
|
17445
17046
|
__defProp2 = Object.defineProperty;
|
|
@@ -17473,6 +17074,14 @@ var init_dist = __esm({
|
|
|
17473
17074
|
isNodeMode || !mod4 || !mod4.__esModule ? __defProp2(target, "default", { value: mod4, enumerable: true }) : target,
|
|
17474
17075
|
mod4
|
|
17475
17076
|
));
|
|
17077
|
+
init_abstention = __esm2({
|
|
17078
|
+
"src/abstention.ts"() {
|
|
17079
|
+
"use strict";
|
|
17080
|
+
SENTINEL = "[[no-reply]]";
|
|
17081
|
+
WRAPPERS = " \r\n`\"'*_";
|
|
17082
|
+
INSTRUCTION = "not every message needs an answer from you: if this one is not addressed to you and asks nothing of you, reply with exactly " + SENTINEL + " and nothing else \u2014 that is discarded, not posted, and is how you stay quiet; never post a message SAYING that you are staying quiet";
|
|
17083
|
+
}
|
|
17084
|
+
});
|
|
17476
17085
|
init_mls_commit_classify = __esm2({
|
|
17477
17086
|
"src/mls-commit-classify.ts"() {
|
|
17478
17087
|
"use strict";
|
|
@@ -59482,7 +59091,7 @@ var init_dist = __esm({
|
|
|
59482
59091
|
t = libsodium_sumo_default.ready.then(function() {
|
|
59483
59092
|
function t2() {
|
|
59484
59093
|
if (a._sodium_init() < 0) throw new Error("libsodium was not correctly initialized.");
|
|
59485
|
-
for (var e = ["crypto_aead_aegis128l_decrypt", "crypto_aead_aegis128l_decrypt_detached", "crypto_aead_aegis128l_encrypt", "crypto_aead_aegis128l_encrypt_detached", "crypto_aead_aegis128l_keygen", "crypto_aead_aegis256_decrypt", "crypto_aead_aegis256_decrypt_detached", "crypto_aead_aegis256_encrypt", "crypto_aead_aegis256_encrypt_detached", "crypto_aead_aegis256_keygen", "crypto_aead_chacha20poly1305_decrypt", "crypto_aead_chacha20poly1305_decrypt_detached", "crypto_aead_chacha20poly1305_encrypt", "crypto_aead_chacha20poly1305_encrypt_detached", "crypto_aead_chacha20poly1305_ietf_decrypt", "crypto_aead_chacha20poly1305_ietf_decrypt_detached", "crypto_aead_chacha20poly1305_ietf_encrypt", "crypto_aead_chacha20poly1305_ietf_encrypt_detached", "crypto_aead_chacha20poly1305_ietf_keygen", "crypto_aead_chacha20poly1305_keygen", "crypto_aead_xchacha20poly1305_ietf_decrypt", "crypto_aead_xchacha20poly1305_ietf_decrypt_detached", "crypto_aead_xchacha20poly1305_ietf_encrypt", "crypto_aead_xchacha20poly1305_ietf_encrypt_detached", "crypto_aead_xchacha20poly1305_ietf_keygen", "crypto_auth", "crypto_auth_hmacsha256", "crypto_auth_hmacsha256_final", "crypto_auth_hmacsha256_init", "crypto_auth_hmacsha256_keygen", "crypto_auth_hmacsha256_update", "crypto_auth_hmacsha256_verify", "crypto_auth_hmacsha512", "crypto_auth_hmacsha512256", "crypto_auth_hmacsha512256_final", "crypto_auth_hmacsha512256_init", "crypto_auth_hmacsha512256_keygen", "crypto_auth_hmacsha512256_update", "crypto_auth_hmacsha512256_verify", "crypto_auth_hmacsha512_final", "crypto_auth_hmacsha512_init", "crypto_auth_hmacsha512_keygen", "crypto_auth_hmacsha512_update", "crypto_auth_hmacsha512_verify", "crypto_auth_keygen", "crypto_auth_verify", "crypto_box_beforenm", "crypto_box_curve25519xchacha20poly1305_beforenm", "crypto_box_curve25519xchacha20poly1305_detached", "crypto_box_curve25519xchacha20poly1305_detached_afternm", "crypto_box_curve25519xchacha20poly1305_easy", "crypto_box_curve25519xchacha20poly1305_easy_afternm", "crypto_box_curve25519xchacha20poly1305_keypair", "crypto_box_curve25519xchacha20poly1305_open_detached", "crypto_box_curve25519xchacha20poly1305_open_detached_afternm", "crypto_box_curve25519xchacha20poly1305_open_easy", "crypto_box_curve25519xchacha20poly1305_open_easy_afternm", "crypto_box_curve25519xchacha20poly1305_seal", "crypto_box_curve25519xchacha20poly1305_seal_open", "crypto_box_curve25519xchacha20poly1305_seed_keypair", "crypto_box_detached", "crypto_box_easy", "crypto_box_easy_afternm", "crypto_box_keypair", "crypto_box_open_detached", "crypto_box_open_easy", "crypto_box_open_easy_afternm", "crypto_box_seal", "crypto_box_seal_open", "crypto_box_seed_keypair", "crypto_core_ed25519_add", "crypto_core_ed25519_from_hash", "crypto_core_ed25519_from_uniform", "crypto_core_ed25519_is_valid_point", "crypto_core_ed25519_random", "crypto_core_ed25519_scalar_add", "crypto_core_ed25519_scalar_complement", "crypto_core_ed25519_scalar_invert", "crypto_core_ed25519_scalar_mul", "crypto_core_ed25519_scalar_negate", "crypto_core_ed25519_scalar_random", "crypto_core_ed25519_scalar_reduce", "crypto_core_ed25519_scalar_sub", "crypto_core_ed25519_sub", "crypto_core_hchacha20", "crypto_core_hsalsa20", "crypto_core_ristretto255_add", "crypto_core_ristretto255_from_hash", "crypto_core_ristretto255_is_valid_point", "crypto_core_ristretto255_random", "crypto_core_ristretto255_scalar_add", "crypto_core_ristretto255_scalar_complement", "crypto_core_ristretto255_scalar_invert", "crypto_core_ristretto255_scalar_mul", "crypto_core_ristretto255_scalar_negate", "crypto_core_ristretto255_scalar_random", "crypto_core_ristretto255_scalar_reduce", "crypto_core_ristretto255_scalar_sub", "crypto_core_ristretto255_sub", "crypto_generichash", "crypto_generichash_blake2b_salt_personal", "crypto_generichash_final", "crypto_generichash_init", "crypto_generichash_keygen", "crypto_generichash_update", "crypto_hash", "crypto_hash_sha256", "crypto_hash_sha256_final", "crypto_hash_sha256_init", "crypto_hash_sha256_update", "crypto_hash_sha512", "crypto_hash_sha512_final", "crypto_hash_sha512_init", "crypto_hash_sha512_update", "crypto_kdf_derive_from_key", "crypto_kdf_keygen", "crypto_kx_client_session_keys", "crypto_kx_keypair", "crypto_kx_seed_keypair", "crypto_kx_server_session_keys", "crypto_onetimeauth", "crypto_onetimeauth_final", "crypto_onetimeauth_init", "crypto_onetimeauth_keygen", "crypto_onetimeauth_update", "crypto_onetimeauth_verify", "crypto_pwhash", "crypto_pwhash_scryptsalsa208sha256", "crypto_pwhash_scryptsalsa208sha256_ll", "crypto_pwhash_scryptsalsa208sha256_str", "crypto_pwhash_scryptsalsa208sha256_str_verify", "crypto_pwhash_str", "crypto_pwhash_str_needs_rehash", "crypto_pwhash_str_verify", "crypto_scalarmult", "crypto_scalarmult_base", "crypto_scalarmult_ed25519", "crypto_scalarmult_ed25519_base", "crypto_scalarmult_ed25519_base_noclamp", "crypto_scalarmult_ed25519_noclamp", "crypto_scalarmult_ristretto255", "crypto_scalarmult_ristretto255_base", "crypto_secretbox_detached", "crypto_secretbox_easy", "crypto_secretbox_keygen", "crypto_secretbox_open_detached", "crypto_secretbox_open_easy", "crypto_secretstream_xchacha20poly1305_init_pull", "crypto_secretstream_xchacha20poly1305_init_push", "crypto_secretstream_xchacha20poly1305_keygen", "crypto_secretstream_xchacha20poly1305_pull", "crypto_secretstream_xchacha20poly1305_push", "crypto_secretstream_xchacha20poly1305_rekey", "crypto_shorthash", "crypto_shorthash_keygen", "crypto_shorthash_siphashx24", "crypto_sign", "crypto_sign_detached", "crypto_sign_ed25519_pk_to_curve25519", "crypto_sign_ed25519_sk_to_curve25519", "crypto_sign_ed25519_sk_to_pk", "crypto_sign_ed25519_sk_to_seed", "crypto_sign_final_create", "crypto_sign_final_verify", "crypto_sign_init", "crypto_sign_keypair", "crypto_sign_open", "crypto_sign_seed_keypair", "crypto_sign_update", "crypto_sign_verify_detached", "crypto_stream_chacha20", "crypto_stream_chacha20_ietf_xor", "crypto_stream_chacha20_ietf_xor_ic", "crypto_stream_chacha20_keygen", "crypto_stream_chacha20_xor", "crypto_stream_chacha20_xor_ic", "crypto_stream_keygen", "crypto_stream_xchacha20_keygen", "crypto_stream_xchacha20_xor", "crypto_stream_xchacha20_xor_ic", "randombytes_buf", "randombytes_buf_deterministic", "randombytes_close", "randombytes_random", "randombytes_set_implementation", "randombytes_stir", "randombytes_uniform", "sodium_version_string"], t3 = [x, k, S, T, w, Y, B, A, M, I, K, N, L, O, U, C, P, R, X, G, D, F, V, H, W,
|
|
59094
|
+
for (var e = ["crypto_aead_aegis128l_decrypt", "crypto_aead_aegis128l_decrypt_detached", "crypto_aead_aegis128l_encrypt", "crypto_aead_aegis128l_encrypt_detached", "crypto_aead_aegis128l_keygen", "crypto_aead_aegis256_decrypt", "crypto_aead_aegis256_decrypt_detached", "crypto_aead_aegis256_encrypt", "crypto_aead_aegis256_encrypt_detached", "crypto_aead_aegis256_keygen", "crypto_aead_chacha20poly1305_decrypt", "crypto_aead_chacha20poly1305_decrypt_detached", "crypto_aead_chacha20poly1305_encrypt", "crypto_aead_chacha20poly1305_encrypt_detached", "crypto_aead_chacha20poly1305_ietf_decrypt", "crypto_aead_chacha20poly1305_ietf_decrypt_detached", "crypto_aead_chacha20poly1305_ietf_encrypt", "crypto_aead_chacha20poly1305_ietf_encrypt_detached", "crypto_aead_chacha20poly1305_ietf_keygen", "crypto_aead_chacha20poly1305_keygen", "crypto_aead_xchacha20poly1305_ietf_decrypt", "crypto_aead_xchacha20poly1305_ietf_decrypt_detached", "crypto_aead_xchacha20poly1305_ietf_encrypt", "crypto_aead_xchacha20poly1305_ietf_encrypt_detached", "crypto_aead_xchacha20poly1305_ietf_keygen", "crypto_auth", "crypto_auth_hmacsha256", "crypto_auth_hmacsha256_final", "crypto_auth_hmacsha256_init", "crypto_auth_hmacsha256_keygen", "crypto_auth_hmacsha256_update", "crypto_auth_hmacsha256_verify", "crypto_auth_hmacsha512", "crypto_auth_hmacsha512256", "crypto_auth_hmacsha512256_final", "crypto_auth_hmacsha512256_init", "crypto_auth_hmacsha512256_keygen", "crypto_auth_hmacsha512256_update", "crypto_auth_hmacsha512256_verify", "crypto_auth_hmacsha512_final", "crypto_auth_hmacsha512_init", "crypto_auth_hmacsha512_keygen", "crypto_auth_hmacsha512_update", "crypto_auth_hmacsha512_verify", "crypto_auth_keygen", "crypto_auth_verify", "crypto_box_beforenm", "crypto_box_curve25519xchacha20poly1305_beforenm", "crypto_box_curve25519xchacha20poly1305_detached", "crypto_box_curve25519xchacha20poly1305_detached_afternm", "crypto_box_curve25519xchacha20poly1305_easy", "crypto_box_curve25519xchacha20poly1305_easy_afternm", "crypto_box_curve25519xchacha20poly1305_keypair", "crypto_box_curve25519xchacha20poly1305_open_detached", "crypto_box_curve25519xchacha20poly1305_open_detached_afternm", "crypto_box_curve25519xchacha20poly1305_open_easy", "crypto_box_curve25519xchacha20poly1305_open_easy_afternm", "crypto_box_curve25519xchacha20poly1305_seal", "crypto_box_curve25519xchacha20poly1305_seal_open", "crypto_box_curve25519xchacha20poly1305_seed_keypair", "crypto_box_detached", "crypto_box_easy", "crypto_box_easy_afternm", "crypto_box_keypair", "crypto_box_open_detached", "crypto_box_open_easy", "crypto_box_open_easy_afternm", "crypto_box_seal", "crypto_box_seal_open", "crypto_box_seed_keypair", "crypto_core_ed25519_add", "crypto_core_ed25519_from_hash", "crypto_core_ed25519_from_uniform", "crypto_core_ed25519_is_valid_point", "crypto_core_ed25519_random", "crypto_core_ed25519_scalar_add", "crypto_core_ed25519_scalar_complement", "crypto_core_ed25519_scalar_invert", "crypto_core_ed25519_scalar_mul", "crypto_core_ed25519_scalar_negate", "crypto_core_ed25519_scalar_random", "crypto_core_ed25519_scalar_reduce", "crypto_core_ed25519_scalar_sub", "crypto_core_ed25519_sub", "crypto_core_hchacha20", "crypto_core_hsalsa20", "crypto_core_ristretto255_add", "crypto_core_ristretto255_from_hash", "crypto_core_ristretto255_is_valid_point", "crypto_core_ristretto255_random", "crypto_core_ristretto255_scalar_add", "crypto_core_ristretto255_scalar_complement", "crypto_core_ristretto255_scalar_invert", "crypto_core_ristretto255_scalar_mul", "crypto_core_ristretto255_scalar_negate", "crypto_core_ristretto255_scalar_random", "crypto_core_ristretto255_scalar_reduce", "crypto_core_ristretto255_scalar_sub", "crypto_core_ristretto255_sub", "crypto_generichash", "crypto_generichash_blake2b_salt_personal", "crypto_generichash_final", "crypto_generichash_init", "crypto_generichash_keygen", "crypto_generichash_update", "crypto_hash", "crypto_hash_sha256", "crypto_hash_sha256_final", "crypto_hash_sha256_init", "crypto_hash_sha256_update", "crypto_hash_sha512", "crypto_hash_sha512_final", "crypto_hash_sha512_init", "crypto_hash_sha512_update", "crypto_kdf_derive_from_key", "crypto_kdf_keygen", "crypto_kx_client_session_keys", "crypto_kx_keypair", "crypto_kx_seed_keypair", "crypto_kx_server_session_keys", "crypto_onetimeauth", "crypto_onetimeauth_final", "crypto_onetimeauth_init", "crypto_onetimeauth_keygen", "crypto_onetimeauth_update", "crypto_onetimeauth_verify", "crypto_pwhash", "crypto_pwhash_scryptsalsa208sha256", "crypto_pwhash_scryptsalsa208sha256_ll", "crypto_pwhash_scryptsalsa208sha256_str", "crypto_pwhash_scryptsalsa208sha256_str_verify", "crypto_pwhash_str", "crypto_pwhash_str_needs_rehash", "crypto_pwhash_str_verify", "crypto_scalarmult", "crypto_scalarmult_base", "crypto_scalarmult_ed25519", "crypto_scalarmult_ed25519_base", "crypto_scalarmult_ed25519_base_noclamp", "crypto_scalarmult_ed25519_noclamp", "crypto_scalarmult_ristretto255", "crypto_scalarmult_ristretto255_base", "crypto_secretbox_detached", "crypto_secretbox_easy", "crypto_secretbox_keygen", "crypto_secretbox_open_detached", "crypto_secretbox_open_easy", "crypto_secretstream_xchacha20poly1305_init_pull", "crypto_secretstream_xchacha20poly1305_init_push", "crypto_secretstream_xchacha20poly1305_keygen", "crypto_secretstream_xchacha20poly1305_pull", "crypto_secretstream_xchacha20poly1305_push", "crypto_secretstream_xchacha20poly1305_rekey", "crypto_shorthash", "crypto_shorthash_keygen", "crypto_shorthash_siphashx24", "crypto_sign", "crypto_sign_detached", "crypto_sign_ed25519_pk_to_curve25519", "crypto_sign_ed25519_sk_to_curve25519", "crypto_sign_ed25519_sk_to_pk", "crypto_sign_ed25519_sk_to_seed", "crypto_sign_final_create", "crypto_sign_final_verify", "crypto_sign_init", "crypto_sign_keypair", "crypto_sign_open", "crypto_sign_seed_keypair", "crypto_sign_update", "crypto_sign_verify_detached", "crypto_stream_chacha20", "crypto_stream_chacha20_ietf_xor", "crypto_stream_chacha20_ietf_xor_ic", "crypto_stream_chacha20_keygen", "crypto_stream_chacha20_xor", "crypto_stream_chacha20_xor_ic", "crypto_stream_keygen", "crypto_stream_xchacha20_keygen", "crypto_stream_xchacha20_xor", "crypto_stream_xchacha20_xor_ic", "randombytes_buf", "randombytes_buf_deterministic", "randombytes_close", "randombytes_random", "randombytes_set_implementation", "randombytes_stir", "randombytes_uniform", "sodium_version_string"], t3 = [x, k, S, T, w, Y, B, A, M, I, K, N, L, O, U, C, P, R, X, G, D, F, V, H, W, q, z, j, J, Q, Z, $, ee, ae, re, te, _e, ne, se, ce, he, oe, pe, ye, ie, le, ue, de, ve, ge, be, fe, me, Ee, xe, ke, Se, Te, we, Ye, Be, Ae, Me, Ie, Ke, Ne, Le, Oe, Ue, Ce, Pe, Re, Xe, Ge, De, Fe, Ve, He, We, qe, ze, je, Je, Qe, Ze, $e, ea, aa, ra, ta, _a, na, sa, ca, ha, oa, pa, ya, ia, la, ua, da, va, ga, ba, fa, ma, Ea, xa, ka, Sa, Ta, wa, Ya, Ba, Aa, Ma, Ia, Ka, Na, La, Oa, Ua, Ca, Pa, Ra, Xa, Ga, Da, Fa, Va, Ha, Wa, qa, za, ja, Ja, Qa, Za, $a, er, ar, rr, tr, _r, nr, sr, cr, hr, or, pr, yr, ir, lr, ur, dr, vr, gr, br, fr, mr, Er, xr, kr, Sr, Tr, wr, Yr, Br, Ar, Mr, Ir, Kr, Nr, Lr, Or, Ur, Cr, Pr, Rr, Xr, Gr, Dr, Fr, Vr, Hr, Wr, qr], _3 = 0; _3 < t3.length; _3++) "function" == typeof a["_" + e[_3]] && (r[e[_3]] = t3[_3]);
|
|
59486
59095
|
var n3 = ["SODIUM_LIBRARY_VERSION_MAJOR", "SODIUM_LIBRARY_VERSION_MINOR", "crypto_aead_aegis128l_ABYTES", "crypto_aead_aegis128l_KEYBYTES", "crypto_aead_aegis128l_MESSAGEBYTES_MAX", "crypto_aead_aegis128l_NPUBBYTES", "crypto_aead_aegis128l_NSECBYTES", "crypto_aead_aegis256_ABYTES", "crypto_aead_aegis256_KEYBYTES", "crypto_aead_aegis256_MESSAGEBYTES_MAX", "crypto_aead_aegis256_NPUBBYTES", "crypto_aead_aegis256_NSECBYTES", "crypto_aead_aes256gcm_ABYTES", "crypto_aead_aes256gcm_KEYBYTES", "crypto_aead_aes256gcm_MESSAGEBYTES_MAX", "crypto_aead_aes256gcm_NPUBBYTES", "crypto_aead_aes256gcm_NSECBYTES", "crypto_aead_chacha20poly1305_ABYTES", "crypto_aead_chacha20poly1305_IETF_ABYTES", "crypto_aead_chacha20poly1305_IETF_KEYBYTES", "crypto_aead_chacha20poly1305_IETF_MESSAGEBYTES_MAX", "crypto_aead_chacha20poly1305_IETF_NPUBBYTES", "crypto_aead_chacha20poly1305_IETF_NSECBYTES", "crypto_aead_chacha20poly1305_KEYBYTES", "crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX", "crypto_aead_chacha20poly1305_NPUBBYTES", "crypto_aead_chacha20poly1305_NSECBYTES", "crypto_aead_chacha20poly1305_ietf_ABYTES", "crypto_aead_chacha20poly1305_ietf_KEYBYTES", "crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX", "crypto_aead_chacha20poly1305_ietf_NPUBBYTES", "crypto_aead_chacha20poly1305_ietf_NSECBYTES", "crypto_aead_xchacha20poly1305_IETF_ABYTES", "crypto_aead_xchacha20poly1305_IETF_KEYBYTES", "crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX", "crypto_aead_xchacha20poly1305_IETF_NPUBBYTES", "crypto_aead_xchacha20poly1305_IETF_NSECBYTES", "crypto_aead_xchacha20poly1305_ietf_ABYTES", "crypto_aead_xchacha20poly1305_ietf_KEYBYTES", "crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX", "crypto_aead_xchacha20poly1305_ietf_NPUBBYTES", "crypto_aead_xchacha20poly1305_ietf_NSECBYTES", "crypto_auth_BYTES", "crypto_auth_KEYBYTES", "crypto_auth_hmacsha256_BYTES", "crypto_auth_hmacsha256_KEYBYTES", "crypto_auth_hmacsha512256_BYTES", "crypto_auth_hmacsha512256_KEYBYTES", "crypto_auth_hmacsha512_BYTES", "crypto_auth_hmacsha512_KEYBYTES", "crypto_box_BEFORENMBYTES", "crypto_box_MACBYTES", "crypto_box_MESSAGEBYTES_MAX", "crypto_box_NONCEBYTES", "crypto_box_PUBLICKEYBYTES", "crypto_box_SEALBYTES", "crypto_box_SECRETKEYBYTES", "crypto_box_SEEDBYTES", "crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES", "crypto_box_curve25519xchacha20poly1305_MACBYTES", "crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX", "crypto_box_curve25519xchacha20poly1305_NONCEBYTES", "crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES", "crypto_box_curve25519xchacha20poly1305_SEALBYTES", "crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES", "crypto_box_curve25519xchacha20poly1305_SEEDBYTES", "crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES", "crypto_box_curve25519xsalsa20poly1305_MACBYTES", "crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX", "crypto_box_curve25519xsalsa20poly1305_NONCEBYTES", "crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES", "crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES", "crypto_box_curve25519xsalsa20poly1305_SEEDBYTES", "crypto_core_ed25519_BYTES", "crypto_core_ed25519_HASHBYTES", "crypto_core_ed25519_NONREDUCEDSCALARBYTES", "crypto_core_ed25519_SCALARBYTES", "crypto_core_ed25519_UNIFORMBYTES", "crypto_core_hchacha20_CONSTBYTES", "crypto_core_hchacha20_INPUTBYTES", "crypto_core_hchacha20_KEYBYTES", "crypto_core_hchacha20_OUTPUTBYTES", "crypto_core_hsalsa20_CONSTBYTES", "crypto_core_hsalsa20_INPUTBYTES", "crypto_core_hsalsa20_KEYBYTES", "crypto_core_hsalsa20_OUTPUTBYTES", "crypto_core_ristretto255_BYTES", "crypto_core_ristretto255_HASHBYTES", "crypto_core_ristretto255_NONREDUCEDSCALARBYTES", "crypto_core_ristretto255_SCALARBYTES", "crypto_core_salsa2012_CONSTBYTES", "crypto_core_salsa2012_INPUTBYTES", "crypto_core_salsa2012_KEYBYTES", "crypto_core_salsa2012_OUTPUTBYTES", "crypto_core_salsa208_CONSTBYTES", "crypto_core_salsa208_INPUTBYTES", "crypto_core_salsa208_KEYBYTES", "crypto_core_salsa208_OUTPUTBYTES", "crypto_core_salsa20_CONSTBYTES", "crypto_core_salsa20_INPUTBYTES", "crypto_core_salsa20_KEYBYTES", "crypto_core_salsa20_OUTPUTBYTES", "crypto_generichash_BYTES", "crypto_generichash_BYTES_MAX", "crypto_generichash_BYTES_MIN", "crypto_generichash_KEYBYTES", "crypto_generichash_KEYBYTES_MAX", "crypto_generichash_KEYBYTES_MIN", "crypto_generichash_blake2b_BYTES", "crypto_generichash_blake2b_BYTES_MAX", "crypto_generichash_blake2b_BYTES_MIN", "crypto_generichash_blake2b_KEYBYTES", "crypto_generichash_blake2b_KEYBYTES_MAX", "crypto_generichash_blake2b_KEYBYTES_MIN", "crypto_generichash_blake2b_PERSONALBYTES", "crypto_generichash_blake2b_SALTBYTES", "crypto_hash_BYTES", "crypto_hash_sha256_BYTES", "crypto_hash_sha512_BYTES", "crypto_kdf_BYTES_MAX", "crypto_kdf_BYTES_MIN", "crypto_kdf_CONTEXTBYTES", "crypto_kdf_KEYBYTES", "crypto_kdf_blake2b_BYTES_MAX", "crypto_kdf_blake2b_BYTES_MIN", "crypto_kdf_blake2b_CONTEXTBYTES", "crypto_kdf_blake2b_KEYBYTES", "crypto_kdf_hkdf_sha256_BYTES_MAX", "crypto_kdf_hkdf_sha256_BYTES_MIN", "crypto_kdf_hkdf_sha256_KEYBYTES", "crypto_kdf_hkdf_sha512_BYTES_MAX", "crypto_kdf_hkdf_sha512_BYTES_MIN", "crypto_kdf_hkdf_sha512_KEYBYTES", "crypto_kx_PUBLICKEYBYTES", "crypto_kx_SECRETKEYBYTES", "crypto_kx_SEEDBYTES", "crypto_kx_SESSIONKEYBYTES", "crypto_onetimeauth_BYTES", "crypto_onetimeauth_KEYBYTES", "crypto_onetimeauth_poly1305_BYTES", "crypto_onetimeauth_poly1305_KEYBYTES", "crypto_pwhash_ALG_ARGON2I13", "crypto_pwhash_ALG_ARGON2ID13", "crypto_pwhash_ALG_DEFAULT", "crypto_pwhash_BYTES_MAX", "crypto_pwhash_BYTES_MIN", "crypto_pwhash_MEMLIMIT_INTERACTIVE", "crypto_pwhash_MEMLIMIT_MAX", "crypto_pwhash_MEMLIMIT_MIN", "crypto_pwhash_MEMLIMIT_MODERATE", "crypto_pwhash_MEMLIMIT_SENSITIVE", "crypto_pwhash_OPSLIMIT_INTERACTIVE", "crypto_pwhash_OPSLIMIT_MAX", "crypto_pwhash_OPSLIMIT_MIN", "crypto_pwhash_OPSLIMIT_MODERATE", "crypto_pwhash_OPSLIMIT_SENSITIVE", "crypto_pwhash_PASSWD_MAX", "crypto_pwhash_PASSWD_MIN", "crypto_pwhash_SALTBYTES", "crypto_pwhash_STRBYTES", "crypto_pwhash_argon2i_BYTES_MAX", "crypto_pwhash_argon2i_BYTES_MIN", "crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE", "crypto_pwhash_argon2i_MEMLIMIT_MAX", "crypto_pwhash_argon2i_MEMLIMIT_MIN", "crypto_pwhash_argon2i_MEMLIMIT_MODERATE", "crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE", "crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE", "crypto_pwhash_argon2i_OPSLIMIT_MAX", "crypto_pwhash_argon2i_OPSLIMIT_MIN", "crypto_pwhash_argon2i_OPSLIMIT_MODERATE", "crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE", "crypto_pwhash_argon2i_PASSWD_MAX", "crypto_pwhash_argon2i_PASSWD_MIN", "crypto_pwhash_argon2i_SALTBYTES", "crypto_pwhash_argon2i_STRBYTES", "crypto_pwhash_argon2id_BYTES_MAX", "crypto_pwhash_argon2id_BYTES_MIN", "crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE", "crypto_pwhash_argon2id_MEMLIMIT_MAX", "crypto_pwhash_argon2id_MEMLIMIT_MIN", "crypto_pwhash_argon2id_MEMLIMIT_MODERATE", "crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE", "crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE", "crypto_pwhash_argon2id_OPSLIMIT_MAX", "crypto_pwhash_argon2id_OPSLIMIT_MIN", "crypto_pwhash_argon2id_OPSLIMIT_MODERATE", "crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE", "crypto_pwhash_argon2id_PASSWD_MAX", "crypto_pwhash_argon2id_PASSWD_MIN", "crypto_pwhash_argon2id_SALTBYTES", "crypto_pwhash_argon2id_STRBYTES", "crypto_pwhash_scryptsalsa208sha256_BYTES_MAX", "crypto_pwhash_scryptsalsa208sha256_BYTES_MIN", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN", "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN", "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE", "crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX", "crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN", "crypto_pwhash_scryptsalsa208sha256_SALTBYTES", "crypto_pwhash_scryptsalsa208sha256_STRBYTES", "crypto_scalarmult_BYTES", "crypto_scalarmult_SCALARBYTES", "crypto_scalarmult_curve25519_BYTES", "crypto_scalarmult_curve25519_SCALARBYTES", "crypto_scalarmult_ed25519_BYTES", "crypto_scalarmult_ed25519_SCALARBYTES", "crypto_scalarmult_ristretto255_BYTES", "crypto_scalarmult_ristretto255_SCALARBYTES", "crypto_secretbox_KEYBYTES", "crypto_secretbox_MACBYTES", "crypto_secretbox_MESSAGEBYTES_MAX", "crypto_secretbox_NONCEBYTES", "crypto_secretbox_xchacha20poly1305_KEYBYTES", "crypto_secretbox_xchacha20poly1305_MACBYTES", "crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX", "crypto_secretbox_xchacha20poly1305_NONCEBYTES", "crypto_secretbox_xsalsa20poly1305_KEYBYTES", "crypto_secretbox_xsalsa20poly1305_MACBYTES", "crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX", "crypto_secretbox_xsalsa20poly1305_NONCEBYTES", "crypto_secretstream_xchacha20poly1305_ABYTES", "crypto_secretstream_xchacha20poly1305_HEADERBYTES", "crypto_secretstream_xchacha20poly1305_KEYBYTES", "crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX", "crypto_secretstream_xchacha20poly1305_TAG_FINAL", "crypto_secretstream_xchacha20poly1305_TAG_MESSAGE", "crypto_secretstream_xchacha20poly1305_TAG_PUSH", "crypto_secretstream_xchacha20poly1305_TAG_REKEY", "crypto_shorthash_BYTES", "crypto_shorthash_KEYBYTES", "crypto_shorthash_siphash24_BYTES", "crypto_shorthash_siphash24_KEYBYTES", "crypto_shorthash_siphashx24_BYTES", "crypto_shorthash_siphashx24_KEYBYTES", "crypto_sign_BYTES", "crypto_sign_MESSAGEBYTES_MAX", "crypto_sign_PUBLICKEYBYTES", "crypto_sign_SECRETKEYBYTES", "crypto_sign_SEEDBYTES", "crypto_sign_ed25519_BYTES", "crypto_sign_ed25519_MESSAGEBYTES_MAX", "crypto_sign_ed25519_PUBLICKEYBYTES", "crypto_sign_ed25519_SECRETKEYBYTES", "crypto_sign_ed25519_SEEDBYTES", "crypto_stream_KEYBYTES", "crypto_stream_MESSAGEBYTES_MAX", "crypto_stream_NONCEBYTES", "crypto_stream_chacha20_IETF_KEYBYTES", "crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX", "crypto_stream_chacha20_IETF_NONCEBYTES", "crypto_stream_chacha20_KEYBYTES", "crypto_stream_chacha20_MESSAGEBYTES_MAX", "crypto_stream_chacha20_NONCEBYTES", "crypto_stream_chacha20_ietf_KEYBYTES", "crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX", "crypto_stream_chacha20_ietf_NONCEBYTES", "crypto_stream_salsa2012_KEYBYTES", "crypto_stream_salsa2012_MESSAGEBYTES_MAX", "crypto_stream_salsa2012_NONCEBYTES", "crypto_stream_salsa208_KEYBYTES", "crypto_stream_salsa208_MESSAGEBYTES_MAX", "crypto_stream_salsa208_NONCEBYTES", "crypto_stream_salsa20_KEYBYTES", "crypto_stream_salsa20_MESSAGEBYTES_MAX", "crypto_stream_salsa20_NONCEBYTES", "crypto_stream_xchacha20_KEYBYTES", "crypto_stream_xchacha20_MESSAGEBYTES_MAX", "crypto_stream_xchacha20_NONCEBYTES", "crypto_stream_xsalsa20_KEYBYTES", "crypto_stream_xsalsa20_MESSAGEBYTES_MAX", "crypto_stream_xsalsa20_NONCEBYTES", "crypto_verify_16_BYTES", "crypto_verify_32_BYTES", "crypto_verify_64_BYTES"];
|
|
59487
59096
|
for (_3 = 0; _3 < n3.length; _3++) "function" == typeof (c3 = a["_" + n3[_3].toLowerCase()]) && (r[n3[_3]] = c3());
|
|
59488
59097
|
var s3 = ["SODIUM_VERSION_STRING", "crypto_pwhash_STRPREFIX", "crypto_pwhash_argon2i_STRPREFIX", "crypto_pwhash_argon2id_STRPREFIX", "crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];
|
|
@@ -68426,6 +68035,39 @@ var init_dist = __esm({
|
|
|
68426
68035
|
const s2 = this._requireState();
|
|
68427
68036
|
return s2.groupContext.groupId;
|
|
68428
68037
|
}
|
|
68038
|
+
/**
|
|
68039
|
+
* Proof that this client actually holds the group's keys at its current
|
|
68040
|
+
* epoch. Throws if not initialized.
|
|
68041
|
+
*
|
|
68042
|
+
* RFC 9420 §8.2's `epoch_authenticator`, derived from the epoch secret. Two
|
|
68043
|
+
* properties make it the thing this codebase has been missing:
|
|
68044
|
+
*
|
|
68045
|
+
* * every member at the same epoch computes the SAME value, so it is
|
|
68046
|
+
* comparable across clients and can be checked by a server;
|
|
68047
|
+
* * it cannot be computed without the key schedule, so possessing it is
|
|
68048
|
+
* evidence of membership rather than a claim about it. RFC 9420 names
|
|
68049
|
+
* this as its purpose: "to authenticate the shared group state".
|
|
68050
|
+
*
|
|
68051
|
+
* It is safe to publish. It is a KDF output over the epoch secret, not the
|
|
68052
|
+
* secret, and the RFC intends it to be shown to out-of-band verifiers.
|
|
68053
|
+
*
|
|
68054
|
+
* WHY THIS EXISTS. `mls_groups.member_device_ids` records membership; the
|
|
68055
|
+
* ability to decrypt lives only in one browser's localStorage. Nothing
|
|
68056
|
+
* compared the two, and nothing could — so a device in the roster holding no
|
|
68057
|
+
* keys was indistinguishable from a healthy one, on every signal the server
|
|
68058
|
+
* has. Measured on production 2026-08-26: one owner device carried the keys
|
|
68059
|
+
* for 19 of the 21 owner leaves on the platform, and one 1:1 group had been
|
|
68060
|
+
* unreadable by its owner's browser for two months while every status column
|
|
68061
|
+
* read healthy.
|
|
68062
|
+
*
|
|
68063
|
+
* `epoch` alone cannot do this job: it is a number the client reports about
|
|
68064
|
+
* itself, it collides across groups, and a client that has lost its state
|
|
68065
|
+
* still remembers one.
|
|
68066
|
+
*/
|
|
68067
|
+
get epochAuthenticator() {
|
|
68068
|
+
const s2 = this._requireState();
|
|
68069
|
+
return s2.keySchedule.epochAuthenticator;
|
|
68070
|
+
}
|
|
68429
68071
|
/** The cipher suite name in use. */
|
|
68430
68072
|
get ciphersuiteName() {
|
|
68431
68073
|
return this._ciphersuiteName;
|
|
@@ -68576,11 +68218,84 @@ var init_dist = __esm({
|
|
|
68576
68218
|
return { commit: commitBytes, welcome: welcomeBytes };
|
|
68577
68219
|
}
|
|
68578
68220
|
/**
|
|
68579
|
-
*
|
|
68221
|
+
* Admit N members with TWO commits total, replacing any stale leaf they hold.
|
|
68222
|
+
*
|
|
68223
|
+
* `addMembers` cannot do this alone: MLS rejects an Add for an identity
|
|
68224
|
+
* already in the tree, so a member that lost its local state must be removed
|
|
68225
|
+
* first. Doing that pair PER MEMBER is what the fulfiller did, and it is not
|
|
68226
|
+
* merely slow — it is self-defeating.
|
|
68227
|
+
*
|
|
68228
|
+
* Live 2026-08-28 14:02:21-28Z: the owner sweep re-admitted 7 room members
|
|
68229
|
+
* sequentially, each as its own removeMember + addMembers. Room 007 ran
|
|
68230
|
+
* **epoch 71 -> 85 in seven seconds**, and the Welcome minted for member n
|
|
68231
|
+
* named an epoch that member n+1's commit had already replaced — so six of
|
|
68232
|
+
* seven were stale before they finished joining, and one (`smartcode`) could
|
|
68233
|
+
* not replay forward afterwards at all.
|
|
68580
68234
|
*
|
|
68581
|
-
*
|
|
68582
|
-
*
|
|
68235
|
+
* 🎯 A REPAIR THAT MOVES THE EPOCH ONCE PER MEMBER IS RACING ITSELF.
|
|
68236
|
+
*
|
|
68237
|
+
* ⚠️ **Why two commits and not one.** RFC 9420 §12.3 allows Remove and Add in
|
|
68238
|
+
* a single commit, and ts-mls builds it happily — but with MORE THAN ONE of
|
|
68239
|
+
* each, a REMAINING member fails to process it:
|
|
68240
|
+
*
|
|
68241
|
+
* OpenError at applyUpdatePathSecret (ts-mls/src/createCommit.ts:471)
|
|
68242
|
+
* at updatePrivateKeyPath (processMessages.ts:397)
|
|
68243
|
+
*
|
|
68244
|
+
* One remove + one add in a single commit is fine; 2+2 is not. That is
|
|
68245
|
+
* pinned by a test in `mls-group.test.ts` so this cannot be "optimised" back
|
|
68246
|
+
* into one commit without the failure showing up first. Two commits still
|
|
68247
|
+
* turns 7 members from 14 epochs into 2, and every joiner lands current.
|
|
68248
|
+
*
|
|
68249
|
+
* @param keyPackages - Fresh KeyPackages, one per member to admit. Members
|
|
68250
|
+
* already holding a leaf are removed by the first commit; members with no
|
|
68251
|
+
* leaf are plain adds. Duplicate identities keep the first KeyPackage.
|
|
68252
|
+
* @returns Every commit to broadcast IN ORDER, and the Welcome to deliver to
|
|
68253
|
+
* EVERY member in the batch (each finds its own secrets inside it).
|
|
68583
68254
|
*/
|
|
68255
|
+
async reAdmitMembers(keyPackages) {
|
|
68256
|
+
this._requireState();
|
|
68257
|
+
await this._ensureCiphersuite();
|
|
68258
|
+
const seenIdentities = [];
|
|
68259
|
+
const toAdd = [];
|
|
68260
|
+
const leavesToRemove = [];
|
|
68261
|
+
for (const kp of keyPackages) {
|
|
68262
|
+
const identity = keyPackageIdentity(kp);
|
|
68263
|
+
if (identity !== null) {
|
|
68264
|
+
if (seenIdentities.some((id) => bytesEqual(id, identity)))
|
|
68265
|
+
continue;
|
|
68266
|
+
seenIdentities.push(identity);
|
|
68267
|
+
const leaf = this.memberLeafIndex(identity);
|
|
68268
|
+
if (leaf !== null)
|
|
68269
|
+
leavesToRemove.push(leaf);
|
|
68270
|
+
}
|
|
68271
|
+
toAdd.push(kp);
|
|
68272
|
+
}
|
|
68273
|
+
if (toAdd.length === 0) {
|
|
68274
|
+
throw new Error("reAdmitMembers: no members to admit");
|
|
68275
|
+
}
|
|
68276
|
+
const commits = [];
|
|
68277
|
+
if (leavesToRemove.length > 0) {
|
|
68278
|
+
const { commit } = await this.removeMembers(leavesToRemove);
|
|
68279
|
+
commits.push({ commit, epoch: this.epoch });
|
|
68280
|
+
}
|
|
68281
|
+
const added = await this.addMembers(toAdd);
|
|
68282
|
+
commits.push({ commit: added.commit, epoch: this.epoch });
|
|
68283
|
+
return { commits, welcome: added.welcome };
|
|
68284
|
+
}
|
|
68285
|
+
async removeMembers(memberIndices) {
|
|
68286
|
+
const s2 = this._requireState();
|
|
68287
|
+
const cs = await this._ensureCiphersuite();
|
|
68288
|
+
if (memberIndices.length === 0) {
|
|
68289
|
+
throw new Error("removeMembers: no members to remove");
|
|
68290
|
+
}
|
|
68291
|
+
const extraProposals = memberIndices.map((removed) => ({
|
|
68292
|
+
proposalType: "remove",
|
|
68293
|
+
remove: { removed }
|
|
68294
|
+
}));
|
|
68295
|
+
const result = await createCommit({ state: s2, cipherSuite: cs, pskIndex: this._pskIndex }, { extraProposals });
|
|
68296
|
+
this.state = result.newState;
|
|
68297
|
+
return { commit: encodeMlsMessage(result.commit) };
|
|
68298
|
+
}
|
|
68584
68299
|
async removeMember(memberIndex) {
|
|
68585
68300
|
const s2 = this._requireState();
|
|
68586
68301
|
const cs = await this._ensureCiphersuite();
|
|
@@ -68884,7 +68599,7 @@ var init_dist = __esm({
|
|
|
68884
68599
|
"use strict";
|
|
68885
68600
|
init_secure_file();
|
|
68886
68601
|
SYNC_LOCK_STALE_MS = 5 * 60 * 1e3;
|
|
68887
|
-
pendingKpPath = (dataDir, groupId) =>
|
|
68602
|
+
pendingKpPath = (dataDir, groupId) => join6(dataDir, `mls-kp-pending-${groupId.replace(/[^a-zA-Z0-9_-]/g, "_")}.json`);
|
|
68888
68603
|
}
|
|
68889
68604
|
});
|
|
68890
68605
|
init_mls_kp_pool = __esm2({
|
|
@@ -69140,6 +68855,7 @@ var init_dist = __esm({
|
|
|
69140
68855
|
init_channel = __esm2({
|
|
69141
68856
|
async "src/channel.ts"() {
|
|
69142
68857
|
"use strict";
|
|
68858
|
+
init_abstention();
|
|
69143
68859
|
init_mls_commit_classify();
|
|
69144
68860
|
await init_libsodium_wrappers();
|
|
69145
68861
|
await init_dist2();
|
|
@@ -69569,6 +69285,18 @@ var init_dist = __esm({
|
|
|
69569
69285
|
get ownHubAddress() {
|
|
69570
69286
|
return this._persisted?.hubAddress ?? "";
|
|
69571
69287
|
}
|
|
69288
|
+
/** This agent's AgentVault hub_id. "" until enrolment persists it.
|
|
69289
|
+
*
|
|
69290
|
+
* Lives in the credential store, NOT in the channel config — which is where
|
|
69291
|
+
* the memory-recall helper was reading it from. `channel.config.hubId` is
|
|
69292
|
+
* unset for every agent enrolled through the normal flow, so
|
|
69293
|
+
* `channel.config.hubId || ""` produced `/api/v1/agents//memory/search`, a
|
|
69294
|
+
* 404 on every inbound message, swallowed by `if (!res.ok) return ""`.
|
|
69295
|
+
* Memory recall was silently dead while the hub_id sat right here.
|
|
69296
|
+
*/
|
|
69297
|
+
get ownHubId() {
|
|
69298
|
+
return this._persisted?.hubId ?? "";
|
|
69299
|
+
}
|
|
69572
69300
|
/** Public best-effort trigger to (re)resolve this agent's display_name.
|
|
69573
69301
|
* Called lazily from the 1:1 DM path when the name is still unknown, so a
|
|
69574
69302
|
* resolve that failed at connect (or a fresh agent that hadn't registered
|
|
@@ -69957,6 +69685,7 @@ var init_dist = __esm({
|
|
|
69957
69685
|
* Each session gets the same plaintext encrypted independently.
|
|
69958
69686
|
*/
|
|
69959
69687
|
async send(plaintext, options) {
|
|
69688
|
+
if (isAbstention(plaintext)) return;
|
|
69960
69689
|
if (this._state === "error" || this._state === "idle") {
|
|
69961
69690
|
throw new Error("Channel is not ready");
|
|
69962
69691
|
}
|
|
@@ -70285,7 +70014,7 @@ var init_dist = __esm({
|
|
|
70285
70014
|
*/
|
|
70286
70015
|
sendActivitySpan(spanData) {
|
|
70287
70016
|
if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
|
|
70288
|
-
const pluginVersion = true ? "0.23.
|
|
70017
|
+
const pluginVersion = true ? "0.23.29" : "0.0.0-dev";
|
|
70289
70018
|
const agentName = this.config.agentName ?? "Agent";
|
|
70290
70019
|
const resource = {
|
|
70291
70020
|
"service.name": "agentvault-agent",
|
|
@@ -70479,6 +70208,7 @@ var init_dist = __esm({
|
|
|
70479
70208
|
* Uses MLS (preferred) or pairwise fan-out as fallback.
|
|
70480
70209
|
*/
|
|
70481
70210
|
async sendToRoom(roomId, plaintext, opts) {
|
|
70211
|
+
if (isAbstention(plaintext)) return;
|
|
70482
70212
|
if (!this._persisted?.rooms?.[roomId]) {
|
|
70483
70213
|
throw new Error(`Room ${roomId} not found`);
|
|
70484
70214
|
}
|
|
@@ -72178,7 +71908,7 @@ var init_dist = __esm({
|
|
|
72178
71908
|
return;
|
|
72179
71909
|
}
|
|
72180
71910
|
const wsUrl = this.config.apiUrl.replace(/^http/, "ws");
|
|
72181
|
-
const url22 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(
|
|
71911
|
+
const url22 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(buildClientVersion(this.config.clientVersion))}`;
|
|
72182
71912
|
const ws = new WebSocket(url22);
|
|
72183
71913
|
this._ws = ws;
|
|
72184
71914
|
ws.on("open", async () => {
|
|
@@ -72222,7 +71952,7 @@ var init_dist = __esm({
|
|
|
72222
71952
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
72223
71953
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
72224
71954
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
72225
|
-
pluginVersion: true ? "0.23.
|
|
71955
|
+
pluginVersion: true ? "0.23.29" : "0.0.0-dev"
|
|
72226
71956
|
});
|
|
72227
71957
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
72228
71958
|
}
|
|
@@ -72546,7 +72276,7 @@ var init_dist = __esm({
|
|
|
72546
72276
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
72547
72277
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
72548
72278
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
72549
|
-
pluginVersion: true ? "0.23.
|
|
72279
|
+
pluginVersion: true ? "0.23.29" : "0.0.0-dev"
|
|
72550
72280
|
});
|
|
72551
72281
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
72552
72282
|
}
|
|
@@ -73443,7 +73173,7 @@ ${messageText}`;
|
|
|
73443
73173
|
}
|
|
73444
73174
|
try {
|
|
73445
73175
|
const configPath = join42(homedir, ".openclaw", "openclaw.json");
|
|
73446
|
-
const raw =
|
|
73176
|
+
const raw = readFileSync4(configPath, "utf-8");
|
|
73447
73177
|
const config2 = JSON.parse(raw);
|
|
73448
73178
|
const agents = config2?.agents?.list;
|
|
73449
73179
|
if (Array.isArray(agents) && agentName) {
|
|
@@ -76410,7 +76140,7 @@ ${messageText}`;
|
|
|
76410
76140
|
channel.on("error", (err) => {
|
|
76411
76141
|
_log?.(formatChannelError(err));
|
|
76412
76142
|
});
|
|
76413
|
-
|
|
76143
|
+
attachLifecycle(channel, {
|
|
76414
76144
|
agentName: account.agentName,
|
|
76415
76145
|
log: (m2) => _log?.(`[AgentVault] ${m2}`),
|
|
76416
76146
|
onTerminal: async () => {
|
|
@@ -76526,6 +76256,11 @@ ${actionsText}`);
|
|
|
76526
76256
|
init_openclaw_compat();
|
|
76527
76257
|
}
|
|
76528
76258
|
});
|
|
76259
|
+
init_room_protocol = __esm2({
|
|
76260
|
+
"src/room-protocol.ts"() {
|
|
76261
|
+
"use strict";
|
|
76262
|
+
}
|
|
76263
|
+
});
|
|
76529
76264
|
init_llm_response_parser = __esm2({
|
|
76530
76265
|
"src/llm-response-parser.ts"() {
|
|
76531
76266
|
"use strict";
|
|
@@ -76557,6 +76292,7 @@ ${actionsText}`);
|
|
|
76557
76292
|
init_openclaw_entry = __esm2({
|
|
76558
76293
|
"src/openclaw-entry.ts"() {
|
|
76559
76294
|
"use strict";
|
|
76295
|
+
init_room_protocol();
|
|
76560
76296
|
init_account_config();
|
|
76561
76297
|
init_fetch_interceptor();
|
|
76562
76298
|
init_http_handlers();
|
|
@@ -80340,7 +80076,7 @@ ${actionsText}`);
|
|
|
80340
80076
|
cloneDef: () => cloneDef,
|
|
80341
80077
|
createTransparentProxy: () => createTransparentProxy,
|
|
80342
80078
|
defineLazy: () => defineLazy,
|
|
80343
|
-
esc: () =>
|
|
80079
|
+
esc: () => esc,
|
|
80344
80080
|
escapeRegex: () => escapeRegex,
|
|
80345
80081
|
extend: () => extend,
|
|
80346
80082
|
finalizeIssue: () => finalizeIssue,
|
|
@@ -81976,7 +81712,7 @@ ${actionsText}`);
|
|
|
81976
81712
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
81977
81713
|
const normalized = _normalized.value;
|
|
81978
81714
|
const parseStr = (key) => {
|
|
81979
|
-
const k2 =
|
|
81715
|
+
const k2 = esc(key);
|
|
81980
81716
|
return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`;
|
|
81981
81717
|
};
|
|
81982
81718
|
doc.write(`const input = payload.value;`);
|
|
@@ -81988,7 +81724,7 @@ ${actionsText}`);
|
|
|
81988
81724
|
doc.write(`const newResult = {};`);
|
|
81989
81725
|
for (const key of normalized.keys) {
|
|
81990
81726
|
const id = ids[key];
|
|
81991
|
-
const k2 =
|
|
81727
|
+
const k2 = esc(key);
|
|
81992
81728
|
const schema = shape[key];
|
|
81993
81729
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
81994
81730
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
@@ -97779,13 +97515,472 @@ data:
|
|
|
97779
97515
|
init_skill_invoker();
|
|
97780
97516
|
await init_skill_telemetry();
|
|
97781
97517
|
await init_policy_enforcer();
|
|
97782
|
-
|
|
97518
|
+
init_room_protocol();
|
|
97519
|
+
VERSION = true ? "0.23.29" : "0.0.0-dev";
|
|
97783
97520
|
}
|
|
97784
97521
|
});
|
|
97785
97522
|
await init_index();
|
|
97786
97523
|
}
|
|
97787
97524
|
});
|
|
97788
97525
|
|
|
97526
|
+
// src/service/launcher.ts
|
|
97527
|
+
import { dirname as dirname2 } from "node:path";
|
|
97528
|
+
function sq(s2) {
|
|
97529
|
+
return `'${s2.replace(/'/g, `'\\''`)}'`;
|
|
97530
|
+
}
|
|
97531
|
+
function candidateExpr(c2) {
|
|
97532
|
+
return c2.includes("$") ? `"${c2}"` : sq(c2);
|
|
97533
|
+
}
|
|
97534
|
+
function renderLauncher(opts) {
|
|
97535
|
+
const candidates = ["node", ...opts.fallbacks ?? FALLBACK_NODES];
|
|
97536
|
+
const lines = [
|
|
97537
|
+
"#!/usr/bin/env bash",
|
|
97538
|
+
"# AgentVault muse-bridge launcher \u2014 regenerated on every `install`. Resolves node at",
|
|
97539
|
+
"# boot so a node upgrade / version-manager switch can't strand the daemon."
|
|
97540
|
+
];
|
|
97541
|
+
if (opts.installPath) lines.push(`export PATH=${sq(opts.installPath)}:"$PATH"`);
|
|
97542
|
+
for (const c2 of candidates) {
|
|
97543
|
+
lines.push(`if n=$(command -v ${candidateExpr(c2)} 2>/dev/null); then exec "$n" ${sq(opts.entrypoint)} "$@"; fi`);
|
|
97544
|
+
}
|
|
97545
|
+
lines.push(
|
|
97546
|
+
`echo "[muse-bridge] node not found on PATH or known locations \u2014 re-run: agentvault-muse-bridge install" >&2`,
|
|
97547
|
+
"exit 0"
|
|
97548
|
+
);
|
|
97549
|
+
return lines.join("\n") + "\n";
|
|
97550
|
+
}
|
|
97551
|
+
function writeLauncher(deps, spec) {
|
|
97552
|
+
deps.mkdir(dirname2(spec.launcherPath));
|
|
97553
|
+
deps.writeFile(spec.launcherPath, spec.launcherScript);
|
|
97554
|
+
deps.chmod(spec.launcherPath, 493);
|
|
97555
|
+
}
|
|
97556
|
+
var FALLBACK_NODES;
|
|
97557
|
+
var init_launcher = __esm({
|
|
97558
|
+
"src/service/launcher.ts"() {
|
|
97559
|
+
"use strict";
|
|
97560
|
+
FALLBACK_NODES = [
|
|
97561
|
+
"/opt/homebrew/bin/node",
|
|
97562
|
+
"/usr/local/bin/node",
|
|
97563
|
+
"/usr/bin/node",
|
|
97564
|
+
"$HOME/.volta/bin/node",
|
|
97565
|
+
"$HOME/.asdf/shims/node",
|
|
97566
|
+
"$HOME/.local/bin/node"
|
|
97567
|
+
];
|
|
97568
|
+
}
|
|
97569
|
+
});
|
|
97570
|
+
|
|
97571
|
+
// src/service/spec.ts
|
|
97572
|
+
import { join as join7 } from "node:path";
|
|
97573
|
+
function buildServiceSpec(cfg, opts) {
|
|
97574
|
+
const env = {
|
|
97575
|
+
AV_AGENT_NAME: cfg.agentName,
|
|
97576
|
+
AV_DATA_DIR: cfg.dataDir,
|
|
97577
|
+
AV_API_URL: cfg.apiUrl,
|
|
97578
|
+
AV_FENCE_HOME: cfg.fenceHome,
|
|
97579
|
+
AV_MUSE_PATH: cfg.musePath
|
|
97580
|
+
};
|
|
97581
|
+
if (cfg.workspaceDir) env.AV_WORKSPACE_DIR = cfg.workspaceDir;
|
|
97582
|
+
const launcherPath = join7(cfg.dataDir, "launch-muse-bridge.sh");
|
|
97583
|
+
return {
|
|
97584
|
+
label: `dev.agentvault.muse-${slugify(cfg.agentName)}`,
|
|
97585
|
+
programArgs: [launcherPath],
|
|
97586
|
+
launcherPath,
|
|
97587
|
+
launcherScript: renderLauncher({ installPath: opts.path, entrypoint: opts.entrypoint }),
|
|
97588
|
+
env,
|
|
97589
|
+
workingDir: cfg.workspaceDir ? cfg.workspaceDir : opts.home,
|
|
97590
|
+
logOut: join7(cfg.dataDir, "logs", "muse-bridge.log"),
|
|
97591
|
+
logErr: join7(cfg.dataDir, "logs", "muse-bridge.error.log"),
|
|
97592
|
+
keepAliveUnlessCleanExit: true,
|
|
97593
|
+
runAtLoad: true
|
|
97594
|
+
};
|
|
97595
|
+
}
|
|
97596
|
+
var init_spec = __esm({
|
|
97597
|
+
"src/service/spec.ts"() {
|
|
97598
|
+
"use strict";
|
|
97599
|
+
init_config();
|
|
97600
|
+
init_launcher();
|
|
97601
|
+
}
|
|
97602
|
+
});
|
|
97603
|
+
|
|
97604
|
+
// src/service/launchd.ts
|
|
97605
|
+
import { dirname as dirname3, join as join8 } from "node:path";
|
|
97606
|
+
function esc2(s2) {
|
|
97607
|
+
return s2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
97608
|
+
}
|
|
97609
|
+
function renderLaunchdPlist(spec) {
|
|
97610
|
+
const args = spec.programArgs.map((a2) => ` <string>${esc2(a2)}</string>`).join("\n");
|
|
97611
|
+
const envEntries = Object.entries(spec.env).map(([k2, v2]) => ` <key>${esc2(k2)}</key>
|
|
97612
|
+
<string>${esc2(v2)}</string>`).join("\n");
|
|
97613
|
+
const keepAlive = spec.keepAliveUnlessCleanExit ? "<key>KeepAlive</key>\n <dict>\n <key>SuccessfulExit</key>\n <false/>\n </dict>" : "<key>KeepAlive</key>\n <false/>";
|
|
97614
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
97615
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
97616
|
+
<plist version="1.0">
|
|
97617
|
+
<dict>
|
|
97618
|
+
<key>Label</key>
|
|
97619
|
+
<string>${esc2(spec.label)}</string>
|
|
97620
|
+
<key>ProgramArguments</key>
|
|
97621
|
+
<array>
|
|
97622
|
+
${args}
|
|
97623
|
+
</array>
|
|
97624
|
+
<key>EnvironmentVariables</key>
|
|
97625
|
+
<dict>
|
|
97626
|
+
${envEntries}
|
|
97627
|
+
</dict>
|
|
97628
|
+
<key>WorkingDirectory</key>
|
|
97629
|
+
<string>${esc2(spec.workingDir)}</string>
|
|
97630
|
+
<key>StandardOutPath</key>
|
|
97631
|
+
<string>${esc2(spec.logOut)}</string>
|
|
97632
|
+
<key>StandardErrorPath</key>
|
|
97633
|
+
<string>${esc2(spec.logErr)}</string>
|
|
97634
|
+
${keepAlive}
|
|
97635
|
+
<key>RunAtLoad</key>
|
|
97636
|
+
${spec.runAtLoad ? "<true/>" : "<false/>"}
|
|
97637
|
+
</dict>
|
|
97638
|
+
</plist>
|
|
97639
|
+
`;
|
|
97640
|
+
}
|
|
97641
|
+
function parsePlistEnv(xml) {
|
|
97642
|
+
const out = {};
|
|
97643
|
+
const keyIdx = xml.indexOf("<key>EnvironmentVariables</key>");
|
|
97644
|
+
if (keyIdx < 0) return out;
|
|
97645
|
+
const open = xml.indexOf("<dict>", keyIdx);
|
|
97646
|
+
if (open < 0) return out;
|
|
97647
|
+
let depth = 0;
|
|
97648
|
+
let i2 = open;
|
|
97649
|
+
let close = -1;
|
|
97650
|
+
const tag = /<(\/?)dict>/g;
|
|
97651
|
+
tag.lastIndex = open;
|
|
97652
|
+
let m2;
|
|
97653
|
+
while (m2 = tag.exec(xml)) {
|
|
97654
|
+
depth += m2[1] ? -1 : 1;
|
|
97655
|
+
if (depth === 0) {
|
|
97656
|
+
close = m2.index;
|
|
97657
|
+
break;
|
|
97658
|
+
}
|
|
97659
|
+
i2 = m2.index;
|
|
97660
|
+
}
|
|
97661
|
+
void i2;
|
|
97662
|
+
if (close < 0) return out;
|
|
97663
|
+
const body = xml.slice(open, close);
|
|
97664
|
+
const pair = /<key>([\s\S]*?)<\/key>\s*<string>([\s\S]*?)<\/string>/g;
|
|
97665
|
+
let p2;
|
|
97666
|
+
while (p2 = pair.exec(body)) out[unesc(p2[1])] = unesc(p2[2]);
|
|
97667
|
+
return out;
|
|
97668
|
+
}
|
|
97669
|
+
function unesc(s2) {
|
|
97670
|
+
return s2.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
97671
|
+
}
|
|
97672
|
+
var LaunchdBackend;
|
|
97673
|
+
var init_launchd = __esm({
|
|
97674
|
+
"src/service/launchd.ts"() {
|
|
97675
|
+
"use strict";
|
|
97676
|
+
init_launcher();
|
|
97677
|
+
LaunchdBackend = class {
|
|
97678
|
+
constructor(deps) {
|
|
97679
|
+
this.deps = deps;
|
|
97680
|
+
}
|
|
97681
|
+
deps;
|
|
97682
|
+
plistPath(label) {
|
|
97683
|
+
return join8(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
97684
|
+
}
|
|
97685
|
+
domain() {
|
|
97686
|
+
return `gui/${this.deps.uid}`;
|
|
97687
|
+
}
|
|
97688
|
+
install(spec) {
|
|
97689
|
+
const path2 = this.plistPath(spec.label);
|
|
97690
|
+
this.deps.mkdir(dirname3(spec.logOut));
|
|
97691
|
+
writeLauncher(this.deps, spec);
|
|
97692
|
+
this.deps.mkdir(dirname3(path2));
|
|
97693
|
+
this.deps.writeFile(path2, renderLaunchdPlist(spec));
|
|
97694
|
+
const svc = `${this.domain()}/${spec.label}`;
|
|
97695
|
+
this.deps.exec("launchctl", ["bootout", svc]);
|
|
97696
|
+
this.waitUntilGone(svc);
|
|
97697
|
+
let r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
97698
|
+
for (let i2 = 0; i2 < 5 && r2.code !== 0; i2++) {
|
|
97699
|
+
this.deps.exec("sleep", ["0.3"]);
|
|
97700
|
+
r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
97701
|
+
}
|
|
97702
|
+
this.deps.exec("launchctl", ["kickstart", "-k", svc]);
|
|
97703
|
+
}
|
|
97704
|
+
waitUntilGone(svc) {
|
|
97705
|
+
for (let i2 = 0; i2 < 20; i2++) {
|
|
97706
|
+
if (this.deps.exec("launchctl", ["print", svc]).code !== 0) return;
|
|
97707
|
+
this.deps.exec("sleep", ["0.25"]);
|
|
97708
|
+
}
|
|
97709
|
+
}
|
|
97710
|
+
restart(label) {
|
|
97711
|
+
this.deps.exec("launchctl", ["kickstart", "-k", `${this.domain()}/${label}`]);
|
|
97712
|
+
}
|
|
97713
|
+
uninstall(label) {
|
|
97714
|
+
this.deps.exec("launchctl", ["bootout", `${this.domain()}/${label}`]);
|
|
97715
|
+
const path2 = this.plistPath(label);
|
|
97716
|
+
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
97717
|
+
}
|
|
97718
|
+
status(label) {
|
|
97719
|
+
const r2 = this.deps.exec("launchctl", ["print", `${this.domain()}/${label}`]);
|
|
97720
|
+
return { loaded: r2.code === 0, detail: r2.stdout };
|
|
97721
|
+
}
|
|
97722
|
+
list(prefix) {
|
|
97723
|
+
const dir = join8(this.deps.home, "Library", "LaunchAgents");
|
|
97724
|
+
const out = [];
|
|
97725
|
+
for (const name of this.deps.readdir(dir)) {
|
|
97726
|
+
if (!name.startsWith(prefix) || !name.endsWith(".plist")) continue;
|
|
97727
|
+
const path2 = join8(dir, name);
|
|
97728
|
+
out.push({
|
|
97729
|
+
label: name.slice(0, -".plist".length),
|
|
97730
|
+
path: path2,
|
|
97731
|
+
env: parsePlistEnv(this.deps.readFile(path2))
|
|
97732
|
+
});
|
|
97733
|
+
}
|
|
97734
|
+
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
97735
|
+
}
|
|
97736
|
+
};
|
|
97737
|
+
}
|
|
97738
|
+
});
|
|
97739
|
+
|
|
97740
|
+
// src/service/systemd.ts
|
|
97741
|
+
import { dirname as dirname4, join as join9 } from "node:path";
|
|
97742
|
+
function q2(s2) {
|
|
97743
|
+
const esc3 = s2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/%/g, "%%");
|
|
97744
|
+
return `"${esc3}"`;
|
|
97745
|
+
}
|
|
97746
|
+
function renderSystemdUnit(spec) {
|
|
97747
|
+
const exec = spec.programArgs.map(q2).join(" ");
|
|
97748
|
+
const envLines = Object.entries(spec.env).map(([k2, v2]) => `Environment=${q2(`${k2}=${v2}`)}`).join("\n");
|
|
97749
|
+
return `[Unit]
|
|
97750
|
+
Description=AgentVault muse bridge (${spec.label})
|
|
97751
|
+
Wants=network-online.target
|
|
97752
|
+
After=network-online.target
|
|
97753
|
+
|
|
97754
|
+
[Service]
|
|
97755
|
+
ExecStart=${exec}
|
|
97756
|
+
WorkingDirectory=${spec.workingDir}
|
|
97757
|
+
${envLines}
|
|
97758
|
+
Restart=on-failure
|
|
97759
|
+
SuccessExitStatus=0
|
|
97760
|
+
StandardOutput=append:${spec.logOut}
|
|
97761
|
+
StandardError=append:${spec.logErr}
|
|
97762
|
+
|
|
97763
|
+
[Install]
|
|
97764
|
+
WantedBy=default.target
|
|
97765
|
+
`;
|
|
97766
|
+
}
|
|
97767
|
+
function parseUnitEnv(text) {
|
|
97768
|
+
const out = {};
|
|
97769
|
+
for (const line of text.split("\n")) {
|
|
97770
|
+
const m2 = /^Environment="([\s\S]*)"\s*$/.exec(line.trim());
|
|
97771
|
+
if (!m2) continue;
|
|
97772
|
+
const eq = unq(m2[1]);
|
|
97773
|
+
const at = eq.indexOf("=");
|
|
97774
|
+
if (at <= 0) continue;
|
|
97775
|
+
out[eq.slice(0, at)] = eq.slice(at + 1);
|
|
97776
|
+
}
|
|
97777
|
+
return out;
|
|
97778
|
+
}
|
|
97779
|
+
function unq(s2) {
|
|
97780
|
+
return s2.replace(/%%/g, "%").replace(
|
|
97781
|
+
/\\([\s\S])/g,
|
|
97782
|
+
(_2, c2) => c2 === "n" ? "\n" : c2 === "r" ? "\r" : c2 === "t" ? " " : c2
|
|
97783
|
+
);
|
|
97784
|
+
}
|
|
97785
|
+
var SystemdBackend;
|
|
97786
|
+
var init_systemd = __esm({
|
|
97787
|
+
"src/service/systemd.ts"() {
|
|
97788
|
+
"use strict";
|
|
97789
|
+
init_launcher();
|
|
97790
|
+
SystemdBackend = class {
|
|
97791
|
+
constructor(deps) {
|
|
97792
|
+
this.deps = deps;
|
|
97793
|
+
}
|
|
97794
|
+
deps;
|
|
97795
|
+
unitPath(label) {
|
|
97796
|
+
return join9(this.deps.home, ".config", "systemd", "user", `${label}.service`);
|
|
97797
|
+
}
|
|
97798
|
+
install(spec) {
|
|
97799
|
+
const path2 = this.unitPath(spec.label);
|
|
97800
|
+
this.deps.mkdir(dirname4(spec.logOut));
|
|
97801
|
+
writeLauncher(this.deps, spec);
|
|
97802
|
+
this.deps.mkdir(dirname4(path2));
|
|
97803
|
+
this.deps.writeFile(path2, renderSystemdUnit(spec));
|
|
97804
|
+
this.deps.exec("loginctl", ["enable-linger", this.deps.user]);
|
|
97805
|
+
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
97806
|
+
this.deps.exec("systemctl", ["--user", "enable", `${spec.label}.service`]);
|
|
97807
|
+
this.deps.exec("systemctl", ["--user", "restart", `${spec.label}.service`]);
|
|
97808
|
+
}
|
|
97809
|
+
restart(label) {
|
|
97810
|
+
this.deps.exec("systemctl", ["--user", "restart", `${label}.service`]);
|
|
97811
|
+
}
|
|
97812
|
+
uninstall(label) {
|
|
97813
|
+
this.deps.exec("systemctl", ["--user", "disable", "--now", `${label}.service`]);
|
|
97814
|
+
const path2 = this.unitPath(label);
|
|
97815
|
+
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
97816
|
+
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
97817
|
+
}
|
|
97818
|
+
status(label) {
|
|
97819
|
+
const enabled = this.deps.exec("systemctl", ["--user", "is-enabled", `${label}.service`]);
|
|
97820
|
+
const active = this.deps.exec("systemctl", ["--user", "is-active", `${label}.service`]);
|
|
97821
|
+
return { loaded: enabled.code === 0, detail: `${enabled.stdout.trim() || "?"} / ${active.stdout.trim() || "?"}` };
|
|
97822
|
+
}
|
|
97823
|
+
list(prefix) {
|
|
97824
|
+
const dir = join9(this.deps.home, ".config", "systemd", "user");
|
|
97825
|
+
const out = [];
|
|
97826
|
+
for (const name of this.deps.readdir(dir)) {
|
|
97827
|
+
if (!name.startsWith(prefix) || !name.endsWith(".service")) continue;
|
|
97828
|
+
const path2 = join9(dir, name);
|
|
97829
|
+
out.push({
|
|
97830
|
+
label: name.slice(0, -".service".length),
|
|
97831
|
+
path: path2,
|
|
97832
|
+
env: parseUnitEnv(this.deps.readFile(path2))
|
|
97833
|
+
});
|
|
97834
|
+
}
|
|
97835
|
+
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
97836
|
+
}
|
|
97837
|
+
};
|
|
97838
|
+
}
|
|
97839
|
+
});
|
|
97840
|
+
|
|
97841
|
+
// src/service/backend.ts
|
|
97842
|
+
import { spawnSync } from "node:child_process";
|
|
97843
|
+
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync4, rmSync, existsSync as existsSync5, chmodSync as chmodSync4, readdirSync as readdirSync2, readFileSync as readFileSync5 } from "node:fs";
|
|
97844
|
+
import { userInfo } from "node:os";
|
|
97845
|
+
function defaultDeps() {
|
|
97846
|
+
return {
|
|
97847
|
+
home: process.env.HOME ?? "",
|
|
97848
|
+
uid: userInfo().uid,
|
|
97849
|
+
user: userInfo().username,
|
|
97850
|
+
exec: (cmd, args) => {
|
|
97851
|
+
const r2 = spawnSync(cmd, args, { encoding: "utf8" });
|
|
97852
|
+
return { code: r2.status ?? 1, stdout: r2.stdout ?? "" };
|
|
97853
|
+
},
|
|
97854
|
+
writeFile: (p2, d2) => writeFileSync4(p2, d2),
|
|
97855
|
+
mkdir: (p2) => mkdirSync5(p2, { recursive: true }),
|
|
97856
|
+
chmod: (p2, m2) => chmodSync4(p2, m2),
|
|
97857
|
+
rm: (p2) => rmSync(p2, { force: true }),
|
|
97858
|
+
exists: (p2) => existsSync5(p2),
|
|
97859
|
+
readdir: (p2) => {
|
|
97860
|
+
try {
|
|
97861
|
+
return readdirSync2(p2);
|
|
97862
|
+
} catch {
|
|
97863
|
+
return [];
|
|
97864
|
+
}
|
|
97865
|
+
},
|
|
97866
|
+
readFile: (p2) => {
|
|
97867
|
+
try {
|
|
97868
|
+
return readFileSync5(p2, "utf8");
|
|
97869
|
+
} catch {
|
|
97870
|
+
return "";
|
|
97871
|
+
}
|
|
97872
|
+
}
|
|
97873
|
+
};
|
|
97874
|
+
}
|
|
97875
|
+
function selectBackend(platform, deps) {
|
|
97876
|
+
if (platform === "darwin") {
|
|
97877
|
+
return new LaunchdBackend(deps ?? defaultDeps());
|
|
97878
|
+
}
|
|
97879
|
+
if (platform === "linux") {
|
|
97880
|
+
return new SystemdBackend(deps ?? defaultDeps());
|
|
97881
|
+
}
|
|
97882
|
+
throw new Error(`unsupported platform for muse-bridge service install: ${platform}`);
|
|
97883
|
+
}
|
|
97884
|
+
var init_backend = __esm({
|
|
97885
|
+
"src/service/backend.ts"() {
|
|
97886
|
+
"use strict";
|
|
97887
|
+
init_launchd();
|
|
97888
|
+
init_systemd();
|
|
97889
|
+
}
|
|
97890
|
+
});
|
|
97891
|
+
|
|
97892
|
+
// src/service/subcommand.ts
|
|
97893
|
+
var subcommand_exports = {};
|
|
97894
|
+
__export(subcommand_exports, {
|
|
97895
|
+
labelFor: () => labelFor,
|
|
97896
|
+
maybeRunServiceSubcommand: () => maybeRunServiceSubcommand
|
|
97897
|
+
});
|
|
97898
|
+
import { join as join10 } from "node:path";
|
|
97899
|
+
function requireAgentName(env) {
|
|
97900
|
+
const name = env.AV_AGENT_NAME?.trim();
|
|
97901
|
+
if (!name) {
|
|
97902
|
+
throw new Error(
|
|
97903
|
+
"AV_AGENT_NAME is required \u2014 it names WHICH agent's service to act on. Re-run as: AV_AGENT_NAME=<agent-name> agentvault-muse-bridge <subcommand>"
|
|
97904
|
+
);
|
|
97905
|
+
}
|
|
97906
|
+
return name;
|
|
97907
|
+
}
|
|
97908
|
+
function labelFor(env) {
|
|
97909
|
+
return `dev.agentvault.muse-${slugify(requireAgentName(env))}`;
|
|
97910
|
+
}
|
|
97911
|
+
function dataDirFor(env, agentName) {
|
|
97912
|
+
if (env.AV_DATA_DIR) return env.AV_DATA_DIR;
|
|
97913
|
+
return join10(env.HOME ?? "", ".agentvault", "muse-room-bridge", slugify(agentName));
|
|
97914
|
+
}
|
|
97915
|
+
function maybeRunServiceSubcommand(argv, env, deps) {
|
|
97916
|
+
const cmd = argv[2];
|
|
97917
|
+
if (!cmd) return false;
|
|
97918
|
+
if (!SERVICE_CMDS.has(cmd)) {
|
|
97919
|
+
const looksLikeToken = cmd.startsWith("av_tok_");
|
|
97920
|
+
const looksLikeFlag = cmd.startsWith("-");
|
|
97921
|
+
if (!looksLikeToken && !looksLikeFlag) {
|
|
97922
|
+
throw new Error(
|
|
97923
|
+
`unknown subcommand: ${cmd} \u2014 expected one of ${[...SERVICE_CMDS].join(", ")}, an invite token, or no argument at all`
|
|
97924
|
+
);
|
|
97925
|
+
}
|
|
97926
|
+
return false;
|
|
97927
|
+
}
|
|
97928
|
+
const backend = deps?.backend ?? selectBackend(process.platform);
|
|
97929
|
+
const entrypoint = deps?.entrypoint ?? process.argv[1];
|
|
97930
|
+
const log = deps?.log ?? ((m2) => logLine("[muse-bridge] " + m2));
|
|
97931
|
+
try {
|
|
97932
|
+
if (cmd === "install") {
|
|
97933
|
+
const agentName = requireAgentName(env);
|
|
97934
|
+
assertInstallableEntrypoint(entrypoint);
|
|
97935
|
+
const dataDir = dataDirFor(env, agentName);
|
|
97936
|
+
if (!hasPersistedCreds(dataDir)) {
|
|
97937
|
+
throw new Error(
|
|
97938
|
+
"cannot install a supervised service before this agent has enrolled \u2014 run agentvault-muse-bridge <invite-token> once so credentials persist, then: AV_AGENT_NAME=<agent-name> agentvault-muse-bridge install"
|
|
97939
|
+
);
|
|
97940
|
+
}
|
|
97941
|
+
const cfg = loadConfig(env, []);
|
|
97942
|
+
const spec = buildServiceSpec(cfg, {
|
|
97943
|
+
entrypoint,
|
|
97944
|
+
home: env.HOME ?? "",
|
|
97945
|
+
path: env.PATH ?? ""
|
|
97946
|
+
});
|
|
97947
|
+
backend.install(spec);
|
|
97948
|
+
log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
|
|
97949
|
+
log(`check it with: AV_AGENT_NAME=${cfg.agentName} agentvault-muse-bridge status`);
|
|
97950
|
+
} else if (cmd === "uninstall") {
|
|
97951
|
+
const label = labelFor(env);
|
|
97952
|
+
backend.uninstall(label);
|
|
97953
|
+
log(`uninstalled service ${label}`);
|
|
97954
|
+
} else if (cmd === "restart") {
|
|
97955
|
+
const label = labelFor(env);
|
|
97956
|
+
backend.restart(label);
|
|
97957
|
+
log(`restarted service ${label}`);
|
|
97958
|
+
} else if (cmd === "status") {
|
|
97959
|
+
const label = labelFor(env);
|
|
97960
|
+
const st = backend.status(label);
|
|
97961
|
+
log(`${label}: ${st.loaded ? "loaded" : "not loaded"}`);
|
|
97962
|
+
} else if (cmd === "logs") {
|
|
97963
|
+
const label = labelFor(env);
|
|
97964
|
+
log(`logs for ${label} are at <dataDir>/logs/muse-bridge.log (tail -f it)`);
|
|
97965
|
+
}
|
|
97966
|
+
} catch (e) {
|
|
97967
|
+
log(e.message);
|
|
97968
|
+
process.exitCode = 1;
|
|
97969
|
+
}
|
|
97970
|
+
return true;
|
|
97971
|
+
}
|
|
97972
|
+
var SERVICE_CMDS;
|
|
97973
|
+
var init_subcommand = __esm({
|
|
97974
|
+
"src/service/subcommand.ts"() {
|
|
97975
|
+
"use strict";
|
|
97976
|
+
init_config();
|
|
97977
|
+
init_log();
|
|
97978
|
+
init_spec();
|
|
97979
|
+
init_backend();
|
|
97980
|
+
SERVICE_CMDS = /* @__PURE__ */ new Set(["install", "uninstall", "restart", "status", "logs"]);
|
|
97981
|
+
}
|
|
97982
|
+
});
|
|
97983
|
+
|
|
97789
97984
|
// src/index.ts
|
|
97790
97985
|
init_config();
|
|
97791
97986
|
init_log();
|
|
@@ -98516,6 +98711,7 @@ function writeFenceMcpSettings(fenceHome, opts) {
|
|
|
98516
98711
|
}
|
|
98517
98712
|
|
|
98518
98713
|
// src/bridge.ts
|
|
98714
|
+
await init_dist();
|
|
98519
98715
|
var workAllowedFlag = false;
|
|
98520
98716
|
var gatesRemovedFlag = false;
|
|
98521
98717
|
function workAllowed() {
|
|
@@ -98572,7 +98768,7 @@ var ActiveTarget = class {
|
|
|
98572
98768
|
};
|
|
98573
98769
|
}
|
|
98574
98770
|
};
|
|
98575
|
-
function
|
|
98771
|
+
function attachLifecycle2(channel, opts = {}) {
|
|
98576
98772
|
const log = opts.log ?? (() => {
|
|
98577
98773
|
});
|
|
98578
98774
|
const onTerminal = opts.onTerminal ?? ((_reason, o2) => process.exit(o2.restart ? 1 : 0));
|
|
@@ -98596,9 +98792,32 @@ function roomTurnPrefix(roomId, senderName, roomName) {
|
|
|
98596
98792
|
const room = roomName ? `"${roomName}"` : roomId.slice(0, 8);
|
|
98597
98793
|
return `[room ${room} | ${senderName}]`;
|
|
98598
98794
|
}
|
|
98795
|
+
function _makeOwesReply(agentName, channel, log) {
|
|
98796
|
+
let warnedNoIdentity = false;
|
|
98797
|
+
return (e) => {
|
|
98798
|
+
const own = agentName ?? "";
|
|
98799
|
+
const hub = channel.ownDisplayName ?? "";
|
|
98800
|
+
if (!own && !hub && !warnedNoIdentity) {
|
|
98801
|
+
warnedNoIdentity = true;
|
|
98802
|
+
log(
|
|
98803
|
+
"WARNING: this bridge has no agentName and no hub display_name, so it cannot recognise its own @mention (#1107). It will answer @all and any @-addressed message (fail-open), but targeted replies will be unreliable. Set the agent name in the bridge config."
|
|
98804
|
+
);
|
|
98805
|
+
}
|
|
98806
|
+
return owesRoomReply(
|
|
98807
|
+
e.plaintext,
|
|
98808
|
+
own,
|
|
98809
|
+
own,
|
|
98810
|
+
e.senderIsAgent,
|
|
98811
|
+
void 0,
|
|
98812
|
+
hub,
|
|
98813
|
+
Boolean(own || hub)
|
|
98814
|
+
);
|
|
98815
|
+
};
|
|
98816
|
+
}
|
|
98599
98817
|
function wireBridge(channel, session, target, opts = {}) {
|
|
98600
98818
|
const log = opts.log ?? (() => {
|
|
98601
98819
|
});
|
|
98820
|
+
const _owesReply = _makeOwesReply(opts.agentName, channel, log);
|
|
98602
98821
|
channel.on("error", (err) => {
|
|
98603
98822
|
const msg = err instanceof Error ? err.message : String(err);
|
|
98604
98823
|
log(`channel error (non-fatal, not a reconnect trigger): ${msg}`);
|
|
@@ -98645,7 +98864,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
98645
98864
|
target.snapshotReply(channel, log),
|
|
98646
98865
|
{
|
|
98647
98866
|
autoReplyOnText: false,
|
|
98648
|
-
replyExpected: e
|
|
98867
|
+
replyExpected: _owesReply(e)
|
|
98649
98868
|
}
|
|
98650
98869
|
);
|
|
98651
98870
|
});
|
|
@@ -98663,7 +98882,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
98663
98882
|
}
|
|
98664
98883
|
|
|
98665
98884
|
// src/version.ts
|
|
98666
|
-
function
|
|
98885
|
+
function buildClientVersion2(version2) {
|
|
98667
98886
|
return `@agentvault/muse-bridge@${version2 ?? "dev"}`;
|
|
98668
98887
|
}
|
|
98669
98888
|
|
|
@@ -98673,7 +98892,7 @@ function mkdir700(path2) {
|
|
|
98673
98892
|
chmodSync5(path2, 448);
|
|
98674
98893
|
}
|
|
98675
98894
|
function packageVersion() {
|
|
98676
|
-
return true ? "0.1.
|
|
98895
|
+
return true ? "0.1.4" : void 0;
|
|
98677
98896
|
}
|
|
98678
98897
|
function helpText(version2) {
|
|
98679
98898
|
return [
|
|
@@ -98719,7 +98938,7 @@ async function main(opts = {}) {
|
|
|
98719
98938
|
}
|
|
98720
98939
|
const info = parseInfoFlags(argv.slice(2));
|
|
98721
98940
|
if (info.showVersion || info.showHelp) {
|
|
98722
|
-
const version2 =
|
|
98941
|
+
const version2 = buildClientVersion2(packageVersion());
|
|
98723
98942
|
if (info.showVersion) printLine(version2);
|
|
98724
98943
|
if (info.showHelp) printLine(helpText(version2));
|
|
98725
98944
|
exit(0);
|
|
@@ -98801,7 +99020,7 @@ async function main(opts = {}) {
|
|
|
98801
99020
|
return;
|
|
98802
99021
|
}
|
|
98803
99022
|
logLine(`[muse-bridge] muse session ${driver.sessionId()} ready`);
|
|
98804
|
-
const clientVersion =
|
|
99023
|
+
const clientVersion = buildClientVersion2(packageVersion());
|
|
98805
99024
|
if (opts.createChannel) {
|
|
98806
99025
|
channel = opts.createChannel({
|
|
98807
99026
|
inviteToken: cfg.inviteToken,
|
|
@@ -98824,9 +99043,12 @@ async function main(opts = {}) {
|
|
|
98824
99043
|
}
|
|
98825
99044
|
const target = new ActiveTarget();
|
|
98826
99045
|
wireBridge(channel, session, target, {
|
|
99046
|
+
// #1107: needed to recognise this agent's own @mention. Without it the
|
|
99047
|
+
// agent can only answer @all.
|
|
99048
|
+
agentName: cfg.agentName,
|
|
98827
99049
|
log: (m2) => logLine("[muse-bridge] " + m2)
|
|
98828
99050
|
});
|
|
98829
|
-
|
|
99051
|
+
attachLifecycle2(channel, {
|
|
98830
99052
|
log: (m2) => logLine("[muse-bridge] " + m2),
|
|
98831
99053
|
onTerminal: (_reason, o2) => void shutdown(o2.restart ? 1 : 0)
|
|
98832
99054
|
});
|