@agentvault/muse-bridge 0.1.2 → 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/README.md +8 -3
- package/dist/bridge.d.ts +6 -0
- package/dist/fence-auth.d.ts +19 -2
- package/dist/index.js +855 -533
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,20 +9,132 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/fence-auth.ts
|
|
13
|
+
import {
|
|
14
|
+
copyFileSync,
|
|
15
|
+
chmodSync,
|
|
16
|
+
existsSync,
|
|
17
|
+
mkdirSync,
|
|
18
|
+
readFileSync,
|
|
19
|
+
unlinkSync,
|
|
20
|
+
writeFileSync
|
|
21
|
+
} from "node:fs";
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
function parseAuthJson(path2) {
|
|
24
|
+
try {
|
|
25
|
+
if (!existsSync(path2)) return void 0;
|
|
26
|
+
return JSON.parse(readFileSync(path2, "utf8"));
|
|
27
|
+
} catch {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function metaApiKeyFromAuth(parsed) {
|
|
32
|
+
if (!parsed || typeof parsed !== "object") return void 0;
|
|
33
|
+
const providers = parsed.providers;
|
|
34
|
+
if (!providers || typeof providers !== "object") return void 0;
|
|
35
|
+
const meta3 = providers.meta;
|
|
36
|
+
if (!meta3 || typeof meta3 !== "object") return void 0;
|
|
37
|
+
const key = meta3.api_key;
|
|
38
|
+
if (typeof key !== "string") return void 0;
|
|
39
|
+
const trimmed = key.trim();
|
|
40
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
41
|
+
}
|
|
42
|
+
function isKeychainOnlyAuth(parsed) {
|
|
43
|
+
if (!parsed || typeof parsed !== "object") return false;
|
|
44
|
+
const providers = parsed.providers;
|
|
45
|
+
if (!providers || typeof providers !== "object") return false;
|
|
46
|
+
const meta3 = providers.meta;
|
|
47
|
+
if (!meta3 || typeof meta3 !== "object") return false;
|
|
48
|
+
return meta3.storage === "keychain" && !metaApiKeyFromAuth(parsed);
|
|
49
|
+
}
|
|
50
|
+
function readFenceMetaApiKey(fenceHome) {
|
|
51
|
+
return metaApiKeyFromAuth(parseAuthJson(join(fenceHome, ".config", "muse", "auth.json")));
|
|
52
|
+
}
|
|
53
|
+
function sidecarMetaApiKeyPath(dataDir) {
|
|
54
|
+
return join(dataDir, "meta-api-key.json");
|
|
55
|
+
}
|
|
56
|
+
function apiKeyFromSidecar(parsed) {
|
|
57
|
+
if (!parsed || typeof parsed !== "object") return void 0;
|
|
58
|
+
const key = parsed.api_key;
|
|
59
|
+
if (typeof key !== "string") return void 0;
|
|
60
|
+
const trimmed = key.trim();
|
|
61
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
62
|
+
}
|
|
63
|
+
function readSidecarMetaApiKey(dataDir) {
|
|
64
|
+
return apiKeyFromSidecar(parseAuthJson(sidecarMetaApiKeyPath(dataDir)));
|
|
65
|
+
}
|
|
66
|
+
function harvestFenceApiKeyToSidecar(opts) {
|
|
67
|
+
const log = opts.log ?? (() => {
|
|
68
|
+
});
|
|
69
|
+
const fenceAuth = join(opts.fenceHome, ".config", "muse", "auth.json");
|
|
70
|
+
const fenceKey = readFenceMetaApiKey(opts.fenceHome);
|
|
71
|
+
const sidecar = sidecarMetaApiKeyPath(opts.dataDir);
|
|
72
|
+
const hadSidecar = !!readSidecarMetaApiKey(opts.dataDir);
|
|
73
|
+
if (fenceKey && !hadSidecar) {
|
|
74
|
+
mkdirSync(opts.dataDir, { recursive: true, mode: 448 });
|
|
75
|
+
writeFileSync(sidecar, JSON.stringify({ api_key: fenceKey }) + "\n", { encoding: "utf8" });
|
|
76
|
+
chmodSync(sidecar, 384);
|
|
77
|
+
log("[muse-bridge] moved fence Meta key out of auth.json so Muse will not hit the Keychain");
|
|
78
|
+
}
|
|
79
|
+
if (fenceKey && existsSync(fenceAuth)) {
|
|
80
|
+
unlinkSync(fenceAuth);
|
|
81
|
+
}
|
|
82
|
+
if (fenceKey && !hadSidecar) return "harvested";
|
|
83
|
+
if (hadSidecar) return "already-sidecar";
|
|
84
|
+
return "none";
|
|
85
|
+
}
|
|
86
|
+
function seedFenceCredential(opts) {
|
|
87
|
+
const log = opts.log ?? (() => {
|
|
88
|
+
});
|
|
89
|
+
const fenceAuth = join(opts.fenceHome, ".config", "muse", "auth.json");
|
|
90
|
+
if (existsSync(fenceAuth)) {
|
|
91
|
+
if (isKeychainOnlyAuth(parseAuthJson(fenceAuth))) {
|
|
92
|
+
unlinkSync(fenceAuth);
|
|
93
|
+
log(
|
|
94
|
+
"[muse-bridge] fence credential is keychain-only; removing it so the child does not hit the Keychain"
|
|
95
|
+
);
|
|
96
|
+
} else {
|
|
97
|
+
log("[muse-bridge] fence credential already present; leaving it untouched");
|
|
98
|
+
return "already-present";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const hostAuth = join(opts.hostHome, ".config", "muse", "auth.json");
|
|
102
|
+
if (!existsSync(hostAuth)) {
|
|
103
|
+
log("[muse-bridge] no host credential to seed (run `muse login`, or set META_API_KEY)");
|
|
104
|
+
return "no-host-credential";
|
|
105
|
+
}
|
|
106
|
+
if (isKeychainOnlyAuth(parseAuthJson(hostAuth))) {
|
|
107
|
+
log(
|
|
108
|
+
"[muse-bridge] host muse login is keychain-only; not copying it into the fence. Set META_API_KEY."
|
|
109
|
+
);
|
|
110
|
+
return "host-credential-keychain-only";
|
|
111
|
+
}
|
|
112
|
+
mkdirSync(join(opts.fenceHome, ".config", "muse"), { recursive: true });
|
|
113
|
+
copyFileSync(hostAuth, fenceAuth);
|
|
114
|
+
chmodSync(fenceAuth, 384);
|
|
115
|
+
log("[muse-bridge] seeded fence credential from the host muse login");
|
|
116
|
+
return "seeded";
|
|
117
|
+
}
|
|
118
|
+
var init_fence_auth = __esm({
|
|
119
|
+
"src/fence-auth.ts"() {
|
|
120
|
+
"use strict";
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
12
124
|
// src/config.ts
|
|
13
|
-
import { existsSync, readFileSync, mkdirSync, chmodSync } from "node:fs";
|
|
14
|
-
import { join, resolve, sep, dirname } from "node:path";
|
|
125
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, mkdirSync as mkdirSync2, chmodSync as chmodSync2 } from "node:fs";
|
|
126
|
+
import { join as join2, resolve, sep, dirname } from "node:path";
|
|
15
127
|
import { tmpdir } from "node:os";
|
|
16
128
|
function hasRecoverableBackup(dataDir) {
|
|
17
129
|
try {
|
|
18
|
-
const parsed = JSON.parse(
|
|
130
|
+
const parsed = JSON.parse(readFileSync2(join2(dataDir, BACKUP_FILE), "utf-8"));
|
|
19
131
|
return !!(parsed && parsed.deviceId && parsed.deviceJwt && parsed.sessions && Object.keys(parsed.sessions).length > 0);
|
|
20
132
|
} catch {
|
|
21
133
|
return false;
|
|
22
134
|
}
|
|
23
135
|
}
|
|
24
136
|
function hasPersistedCreds(dataDir) {
|
|
25
|
-
if (CRED_FILES.some((f2) =>
|
|
137
|
+
if (CRED_FILES.some((f2) => existsSync2(join2(dataDir, f2)))) return true;
|
|
26
138
|
return hasRecoverableBackup(dataDir);
|
|
27
139
|
}
|
|
28
140
|
function slugify(name) {
|
|
@@ -54,8 +166,8 @@ function loadConfig(env, argv = []) {
|
|
|
54
166
|
}
|
|
55
167
|
const slug = slugify(agentName);
|
|
56
168
|
const hostHome = env.HOME ?? "";
|
|
57
|
-
const dataDir = env.AV_DATA_DIR ||
|
|
58
|
-
const workspaceDir = env.AV_WORKSPACE_DIR ||
|
|
169
|
+
const dataDir = env.AV_DATA_DIR || join2(hostHome, ".agentvault", "muse-room-bridge", slug);
|
|
170
|
+
const workspaceDir = env.AV_WORKSPACE_DIR || join2(dirname(dataDir), "workspaces", slug);
|
|
59
171
|
const wsReal = resolve(workspaceDir);
|
|
60
172
|
const ddReal = resolve(dataDir);
|
|
61
173
|
if (wsReal === ddReal || wsReal.startsWith(ddReal + sep) || ddReal.startsWith(wsReal + sep)) {
|
|
@@ -64,8 +176,8 @@ function loadConfig(env, argv = []) {
|
|
|
64
176
|
);
|
|
65
177
|
}
|
|
66
178
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
179
|
+
mkdirSync2(workspaceDir, { recursive: true, mode: 448 });
|
|
180
|
+
chmodSync2(workspaceDir, 448);
|
|
69
181
|
} catch (e) {
|
|
70
182
|
throw new Error(
|
|
71
183
|
`Failed to create/secure the agent workspace at ${workspaceDir} (override with AV_WORKSPACE_DIR): ${e.message}`
|
|
@@ -83,14 +195,15 @@ function loadConfig(env, argv = []) {
|
|
|
83
195
|
"invite token required: pass it as the first argument or set AV_INVITE_TOKEN (or start from a data dir with existing credentials to reconnect)"
|
|
84
196
|
);
|
|
85
197
|
}
|
|
198
|
+
const fenceHome = env.AV_FENCE_HOME || join2(dataDir, "fence");
|
|
86
199
|
return {
|
|
87
200
|
inviteToken,
|
|
88
201
|
dataDir,
|
|
89
202
|
agentName,
|
|
90
203
|
workspaceDir,
|
|
91
204
|
musePath: env.AV_MUSE_PATH || "muse",
|
|
92
|
-
fenceHome
|
|
93
|
-
apiKey: env.META_API_KEY || void 0,
|
|
205
|
+
fenceHome,
|
|
206
|
+
apiKey: env.META_API_KEY || readSidecarMetaApiKey(dataDir) || readFenceMetaApiKey(fenceHome) || void 0,
|
|
94
207
|
hostHome,
|
|
95
208
|
apiUrl: env.AV_API_URL ?? "https://api.agentvault.chat"
|
|
96
209
|
};
|
|
@@ -99,6 +212,7 @@ var CRED_FILES, BACKUP_FILE, VERSION_FLAGS, HELP_FLAGS, KNOWN_FLAGS;
|
|
|
99
212
|
var init_config = __esm({
|
|
100
213
|
"src/config.ts"() {
|
|
101
214
|
"use strict";
|
|
215
|
+
init_fence_auth();
|
|
102
216
|
CRED_FILES = ["agentvault.json", "secure-channel.json"];
|
|
103
217
|
BACKUP_FILE = "agentvault.json.bak";
|
|
104
218
|
VERSION_FLAGS = ["--version", "-v"];
|
|
@@ -125,464 +239,6 @@ var init_log = __esm({
|
|
|
125
239
|
}
|
|
126
240
|
});
|
|
127
241
|
|
|
128
|
-
// src/service/launcher.ts
|
|
129
|
-
import { dirname as dirname2 } from "node:path";
|
|
130
|
-
function sq(s2) {
|
|
131
|
-
return `'${s2.replace(/'/g, `'\\''`)}'`;
|
|
132
|
-
}
|
|
133
|
-
function candidateExpr(c2) {
|
|
134
|
-
return c2.includes("$") ? `"${c2}"` : sq(c2);
|
|
135
|
-
}
|
|
136
|
-
function renderLauncher(opts) {
|
|
137
|
-
const candidates = ["node", ...opts.fallbacks ?? FALLBACK_NODES];
|
|
138
|
-
const lines = [
|
|
139
|
-
"#!/usr/bin/env bash",
|
|
140
|
-
"# AgentVault muse-bridge launcher \u2014 regenerated on every `install`. Resolves node at",
|
|
141
|
-
"# boot so a node upgrade / version-manager switch can't strand the daemon."
|
|
142
|
-
];
|
|
143
|
-
if (opts.installPath) lines.push(`export PATH=${sq(opts.installPath)}:"$PATH"`);
|
|
144
|
-
for (const c2 of candidates) {
|
|
145
|
-
lines.push(`if n=$(command -v ${candidateExpr(c2)} 2>/dev/null); then exec "$n" ${sq(opts.entrypoint)} "$@"; fi`);
|
|
146
|
-
}
|
|
147
|
-
lines.push(
|
|
148
|
-
`echo "[muse-bridge] node not found on PATH or known locations \u2014 re-run: agentvault-muse-bridge install" >&2`,
|
|
149
|
-
"exit 0"
|
|
150
|
-
);
|
|
151
|
-
return lines.join("\n") + "\n";
|
|
152
|
-
}
|
|
153
|
-
function writeLauncher(deps, spec) {
|
|
154
|
-
deps.mkdir(dirname2(spec.launcherPath));
|
|
155
|
-
deps.writeFile(spec.launcherPath, spec.launcherScript);
|
|
156
|
-
deps.chmod(spec.launcherPath, 493);
|
|
157
|
-
}
|
|
158
|
-
var FALLBACK_NODES;
|
|
159
|
-
var init_launcher = __esm({
|
|
160
|
-
"src/service/launcher.ts"() {
|
|
161
|
-
"use strict";
|
|
162
|
-
FALLBACK_NODES = [
|
|
163
|
-
"/opt/homebrew/bin/node",
|
|
164
|
-
"/usr/local/bin/node",
|
|
165
|
-
"/usr/bin/node",
|
|
166
|
-
"$HOME/.volta/bin/node",
|
|
167
|
-
"$HOME/.asdf/shims/node",
|
|
168
|
-
"$HOME/.local/bin/node"
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
// src/service/spec.ts
|
|
174
|
-
import { join as join6 } from "node:path";
|
|
175
|
-
function buildServiceSpec(cfg, opts) {
|
|
176
|
-
const env = {
|
|
177
|
-
AV_AGENT_NAME: cfg.agentName,
|
|
178
|
-
AV_DATA_DIR: cfg.dataDir,
|
|
179
|
-
AV_API_URL: cfg.apiUrl,
|
|
180
|
-
AV_FENCE_HOME: cfg.fenceHome,
|
|
181
|
-
AV_MUSE_PATH: cfg.musePath
|
|
182
|
-
};
|
|
183
|
-
if (cfg.workspaceDir) env.AV_WORKSPACE_DIR = cfg.workspaceDir;
|
|
184
|
-
const launcherPath = join6(cfg.dataDir, "launch-muse-bridge.sh");
|
|
185
|
-
return {
|
|
186
|
-
label: `dev.agentvault.muse-${slugify(cfg.agentName)}`,
|
|
187
|
-
programArgs: [launcherPath],
|
|
188
|
-
launcherPath,
|
|
189
|
-
launcherScript: renderLauncher({ installPath: opts.path, entrypoint: opts.entrypoint }),
|
|
190
|
-
env,
|
|
191
|
-
workingDir: cfg.workspaceDir ? cfg.workspaceDir : opts.home,
|
|
192
|
-
logOut: join6(cfg.dataDir, "logs", "muse-bridge.log"),
|
|
193
|
-
logErr: join6(cfg.dataDir, "logs", "muse-bridge.error.log"),
|
|
194
|
-
keepAliveUnlessCleanExit: true,
|
|
195
|
-
runAtLoad: true
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
var init_spec = __esm({
|
|
199
|
-
"src/service/spec.ts"() {
|
|
200
|
-
"use strict";
|
|
201
|
-
init_config();
|
|
202
|
-
init_launcher();
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
// src/service/launchd.ts
|
|
207
|
-
import { dirname as dirname3, join as join7 } from "node:path";
|
|
208
|
-
function esc(s2) {
|
|
209
|
-
return s2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
210
|
-
}
|
|
211
|
-
function renderLaunchdPlist(spec) {
|
|
212
|
-
const args = spec.programArgs.map((a2) => ` <string>${esc(a2)}</string>`).join("\n");
|
|
213
|
-
const envEntries = Object.entries(spec.env).map(([k2, v2]) => ` <key>${esc(k2)}</key>
|
|
214
|
-
<string>${esc(v2)}</string>`).join("\n");
|
|
215
|
-
const keepAlive = spec.keepAliveUnlessCleanExit ? "<key>KeepAlive</key>\n <dict>\n <key>SuccessfulExit</key>\n <false/>\n </dict>" : "<key>KeepAlive</key>\n <false/>";
|
|
216
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
217
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
218
|
-
<plist version="1.0">
|
|
219
|
-
<dict>
|
|
220
|
-
<key>Label</key>
|
|
221
|
-
<string>${esc(spec.label)}</string>
|
|
222
|
-
<key>ProgramArguments</key>
|
|
223
|
-
<array>
|
|
224
|
-
${args}
|
|
225
|
-
</array>
|
|
226
|
-
<key>EnvironmentVariables</key>
|
|
227
|
-
<dict>
|
|
228
|
-
${envEntries}
|
|
229
|
-
</dict>
|
|
230
|
-
<key>WorkingDirectory</key>
|
|
231
|
-
<string>${esc(spec.workingDir)}</string>
|
|
232
|
-
<key>StandardOutPath</key>
|
|
233
|
-
<string>${esc(spec.logOut)}</string>
|
|
234
|
-
<key>StandardErrorPath</key>
|
|
235
|
-
<string>${esc(spec.logErr)}</string>
|
|
236
|
-
${keepAlive}
|
|
237
|
-
<key>RunAtLoad</key>
|
|
238
|
-
${spec.runAtLoad ? "<true/>" : "<false/>"}
|
|
239
|
-
</dict>
|
|
240
|
-
</plist>
|
|
241
|
-
`;
|
|
242
|
-
}
|
|
243
|
-
function parsePlistEnv(xml) {
|
|
244
|
-
const out = {};
|
|
245
|
-
const keyIdx = xml.indexOf("<key>EnvironmentVariables</key>");
|
|
246
|
-
if (keyIdx < 0) return out;
|
|
247
|
-
const open = xml.indexOf("<dict>", keyIdx);
|
|
248
|
-
if (open < 0) return out;
|
|
249
|
-
let depth = 0;
|
|
250
|
-
let i2 = open;
|
|
251
|
-
let close = -1;
|
|
252
|
-
const tag = /<(\/?)dict>/g;
|
|
253
|
-
tag.lastIndex = open;
|
|
254
|
-
let m2;
|
|
255
|
-
while (m2 = tag.exec(xml)) {
|
|
256
|
-
depth += m2[1] ? -1 : 1;
|
|
257
|
-
if (depth === 0) {
|
|
258
|
-
close = m2.index;
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
i2 = m2.index;
|
|
262
|
-
}
|
|
263
|
-
void i2;
|
|
264
|
-
if (close < 0) return out;
|
|
265
|
-
const body = xml.slice(open, close);
|
|
266
|
-
const pair = /<key>([\s\S]*?)<\/key>\s*<string>([\s\S]*?)<\/string>/g;
|
|
267
|
-
let p2;
|
|
268
|
-
while (p2 = pair.exec(body)) out[unesc(p2[1])] = unesc(p2[2]);
|
|
269
|
-
return out;
|
|
270
|
-
}
|
|
271
|
-
function unesc(s2) {
|
|
272
|
-
return s2.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
273
|
-
}
|
|
274
|
-
var LaunchdBackend;
|
|
275
|
-
var init_launchd = __esm({
|
|
276
|
-
"src/service/launchd.ts"() {
|
|
277
|
-
"use strict";
|
|
278
|
-
init_launcher();
|
|
279
|
-
LaunchdBackend = class {
|
|
280
|
-
constructor(deps) {
|
|
281
|
-
this.deps = deps;
|
|
282
|
-
}
|
|
283
|
-
deps;
|
|
284
|
-
plistPath(label) {
|
|
285
|
-
return join7(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
286
|
-
}
|
|
287
|
-
domain() {
|
|
288
|
-
return `gui/${this.deps.uid}`;
|
|
289
|
-
}
|
|
290
|
-
install(spec) {
|
|
291
|
-
const path2 = this.plistPath(spec.label);
|
|
292
|
-
this.deps.mkdir(dirname3(spec.logOut));
|
|
293
|
-
writeLauncher(this.deps, spec);
|
|
294
|
-
this.deps.mkdir(dirname3(path2));
|
|
295
|
-
this.deps.writeFile(path2, renderLaunchdPlist(spec));
|
|
296
|
-
const svc = `${this.domain()}/${spec.label}`;
|
|
297
|
-
this.deps.exec("launchctl", ["bootout", svc]);
|
|
298
|
-
this.waitUntilGone(svc);
|
|
299
|
-
let r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
300
|
-
for (let i2 = 0; i2 < 5 && r2.code !== 0; i2++) {
|
|
301
|
-
this.deps.exec("sleep", ["0.3"]);
|
|
302
|
-
r2 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
|
|
303
|
-
}
|
|
304
|
-
this.deps.exec("launchctl", ["kickstart", "-k", svc]);
|
|
305
|
-
}
|
|
306
|
-
waitUntilGone(svc) {
|
|
307
|
-
for (let i2 = 0; i2 < 20; i2++) {
|
|
308
|
-
if (this.deps.exec("launchctl", ["print", svc]).code !== 0) return;
|
|
309
|
-
this.deps.exec("sleep", ["0.25"]);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
restart(label) {
|
|
313
|
-
this.deps.exec("launchctl", ["kickstart", "-k", `${this.domain()}/${label}`]);
|
|
314
|
-
}
|
|
315
|
-
uninstall(label) {
|
|
316
|
-
this.deps.exec("launchctl", ["bootout", `${this.domain()}/${label}`]);
|
|
317
|
-
const path2 = this.plistPath(label);
|
|
318
|
-
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
319
|
-
}
|
|
320
|
-
status(label) {
|
|
321
|
-
const r2 = this.deps.exec("launchctl", ["print", `${this.domain()}/${label}`]);
|
|
322
|
-
return { loaded: r2.code === 0, detail: r2.stdout };
|
|
323
|
-
}
|
|
324
|
-
list(prefix) {
|
|
325
|
-
const dir = join7(this.deps.home, "Library", "LaunchAgents");
|
|
326
|
-
const out = [];
|
|
327
|
-
for (const name of this.deps.readdir(dir)) {
|
|
328
|
-
if (!name.startsWith(prefix) || !name.endsWith(".plist")) continue;
|
|
329
|
-
const path2 = join7(dir, name);
|
|
330
|
-
out.push({
|
|
331
|
-
label: name.slice(0, -".plist".length),
|
|
332
|
-
path: path2,
|
|
333
|
-
env: parsePlistEnv(this.deps.readFile(path2))
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
// src/service/systemd.ts
|
|
343
|
-
import { dirname as dirname4, join as join8 } from "node:path";
|
|
344
|
-
function q(s2) {
|
|
345
|
-
const esc3 = s2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/%/g, "%%");
|
|
346
|
-
return `"${esc3}"`;
|
|
347
|
-
}
|
|
348
|
-
function renderSystemdUnit(spec) {
|
|
349
|
-
const exec = spec.programArgs.map(q).join(" ");
|
|
350
|
-
const envLines = Object.entries(spec.env).map(([k2, v2]) => `Environment=${q(`${k2}=${v2}`)}`).join("\n");
|
|
351
|
-
return `[Unit]
|
|
352
|
-
Description=AgentVault muse bridge (${spec.label})
|
|
353
|
-
Wants=network-online.target
|
|
354
|
-
After=network-online.target
|
|
355
|
-
|
|
356
|
-
[Service]
|
|
357
|
-
ExecStart=${exec}
|
|
358
|
-
WorkingDirectory=${spec.workingDir}
|
|
359
|
-
${envLines}
|
|
360
|
-
Restart=on-failure
|
|
361
|
-
SuccessExitStatus=0
|
|
362
|
-
StandardOutput=append:${spec.logOut}
|
|
363
|
-
StandardError=append:${spec.logErr}
|
|
364
|
-
|
|
365
|
-
[Install]
|
|
366
|
-
WantedBy=default.target
|
|
367
|
-
`;
|
|
368
|
-
}
|
|
369
|
-
function parseUnitEnv(text) {
|
|
370
|
-
const out = {};
|
|
371
|
-
for (const line of text.split("\n")) {
|
|
372
|
-
const m2 = /^Environment="([\s\S]*)"\s*$/.exec(line.trim());
|
|
373
|
-
if (!m2) continue;
|
|
374
|
-
const eq = unq(m2[1]);
|
|
375
|
-
const at = eq.indexOf("=");
|
|
376
|
-
if (at <= 0) continue;
|
|
377
|
-
out[eq.slice(0, at)] = eq.slice(at + 1);
|
|
378
|
-
}
|
|
379
|
-
return out;
|
|
380
|
-
}
|
|
381
|
-
function unq(s2) {
|
|
382
|
-
return s2.replace(/%%/g, "%").replace(
|
|
383
|
-
/\\([\s\S])/g,
|
|
384
|
-
(_2, c2) => c2 === "n" ? "\n" : c2 === "r" ? "\r" : c2 === "t" ? " " : c2
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
var SystemdBackend;
|
|
388
|
-
var init_systemd = __esm({
|
|
389
|
-
"src/service/systemd.ts"() {
|
|
390
|
-
"use strict";
|
|
391
|
-
init_launcher();
|
|
392
|
-
SystemdBackend = class {
|
|
393
|
-
constructor(deps) {
|
|
394
|
-
this.deps = deps;
|
|
395
|
-
}
|
|
396
|
-
deps;
|
|
397
|
-
unitPath(label) {
|
|
398
|
-
return join8(this.deps.home, ".config", "systemd", "user", `${label}.service`);
|
|
399
|
-
}
|
|
400
|
-
install(spec) {
|
|
401
|
-
const path2 = this.unitPath(spec.label);
|
|
402
|
-
this.deps.mkdir(dirname4(spec.logOut));
|
|
403
|
-
writeLauncher(this.deps, spec);
|
|
404
|
-
this.deps.mkdir(dirname4(path2));
|
|
405
|
-
this.deps.writeFile(path2, renderSystemdUnit(spec));
|
|
406
|
-
this.deps.exec("loginctl", ["enable-linger", this.deps.user]);
|
|
407
|
-
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
408
|
-
this.deps.exec("systemctl", ["--user", "enable", `${spec.label}.service`]);
|
|
409
|
-
this.deps.exec("systemctl", ["--user", "restart", `${spec.label}.service`]);
|
|
410
|
-
}
|
|
411
|
-
restart(label) {
|
|
412
|
-
this.deps.exec("systemctl", ["--user", "restart", `${label}.service`]);
|
|
413
|
-
}
|
|
414
|
-
uninstall(label) {
|
|
415
|
-
this.deps.exec("systemctl", ["--user", "disable", "--now", `${label}.service`]);
|
|
416
|
-
const path2 = this.unitPath(label);
|
|
417
|
-
if (this.deps.exists(path2)) this.deps.rm(path2);
|
|
418
|
-
this.deps.exec("systemctl", ["--user", "daemon-reload"]);
|
|
419
|
-
}
|
|
420
|
-
status(label) {
|
|
421
|
-
const enabled = this.deps.exec("systemctl", ["--user", "is-enabled", `${label}.service`]);
|
|
422
|
-
const active = this.deps.exec("systemctl", ["--user", "is-active", `${label}.service`]);
|
|
423
|
-
return { loaded: enabled.code === 0, detail: `${enabled.stdout.trim() || "?"} / ${active.stdout.trim() || "?"}` };
|
|
424
|
-
}
|
|
425
|
-
list(prefix) {
|
|
426
|
-
const dir = join8(this.deps.home, ".config", "systemd", "user");
|
|
427
|
-
const out = [];
|
|
428
|
-
for (const name of this.deps.readdir(dir)) {
|
|
429
|
-
if (!name.startsWith(prefix) || !name.endsWith(".service")) continue;
|
|
430
|
-
const path2 = join8(dir, name);
|
|
431
|
-
out.push({
|
|
432
|
-
label: name.slice(0, -".service".length),
|
|
433
|
-
path: path2,
|
|
434
|
-
env: parseUnitEnv(this.deps.readFile(path2))
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
return out.sort((a2, b2) => a2.label.localeCompare(b2.label));
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
// src/service/backend.ts
|
|
444
|
-
import { spawnSync } from "node:child_process";
|
|
445
|
-
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync3, rmSync, existsSync as existsSync4, chmodSync as chmodSync4, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
446
|
-
import { userInfo } from "node:os";
|
|
447
|
-
function defaultDeps() {
|
|
448
|
-
return {
|
|
449
|
-
home: process.env.HOME ?? "",
|
|
450
|
-
uid: userInfo().uid,
|
|
451
|
-
user: userInfo().username,
|
|
452
|
-
exec: (cmd, args) => {
|
|
453
|
-
const r2 = spawnSync(cmd, args, { encoding: "utf8" });
|
|
454
|
-
return { code: r2.status ?? 1, stdout: r2.stdout ?? "" };
|
|
455
|
-
},
|
|
456
|
-
writeFile: (p2, d2) => writeFileSync3(p2, d2),
|
|
457
|
-
mkdir: (p2) => mkdirSync5(p2, { recursive: true }),
|
|
458
|
-
chmod: (p2, m2) => chmodSync4(p2, m2),
|
|
459
|
-
rm: (p2) => rmSync(p2, { force: true }),
|
|
460
|
-
exists: (p2) => existsSync4(p2),
|
|
461
|
-
readdir: (p2) => {
|
|
462
|
-
try {
|
|
463
|
-
return readdirSync(p2);
|
|
464
|
-
} catch {
|
|
465
|
-
return [];
|
|
466
|
-
}
|
|
467
|
-
},
|
|
468
|
-
readFile: (p2) => {
|
|
469
|
-
try {
|
|
470
|
-
return readFileSync3(p2, "utf8");
|
|
471
|
-
} catch {
|
|
472
|
-
return "";
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function selectBackend(platform, deps) {
|
|
478
|
-
if (platform === "darwin") {
|
|
479
|
-
return new LaunchdBackend(deps ?? defaultDeps());
|
|
480
|
-
}
|
|
481
|
-
if (platform === "linux") {
|
|
482
|
-
return new SystemdBackend(deps ?? defaultDeps());
|
|
483
|
-
}
|
|
484
|
-
throw new Error(`unsupported platform for muse-bridge service install: ${platform}`);
|
|
485
|
-
}
|
|
486
|
-
var init_backend = __esm({
|
|
487
|
-
"src/service/backend.ts"() {
|
|
488
|
-
"use strict";
|
|
489
|
-
init_launchd();
|
|
490
|
-
init_systemd();
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
// src/service/subcommand.ts
|
|
495
|
-
var subcommand_exports = {};
|
|
496
|
-
__export(subcommand_exports, {
|
|
497
|
-
labelFor: () => labelFor,
|
|
498
|
-
maybeRunServiceSubcommand: () => maybeRunServiceSubcommand
|
|
499
|
-
});
|
|
500
|
-
import { join as join9 } from "node:path";
|
|
501
|
-
function requireAgentName(env) {
|
|
502
|
-
const name = env.AV_AGENT_NAME?.trim();
|
|
503
|
-
if (!name) {
|
|
504
|
-
throw new Error(
|
|
505
|
-
"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>"
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
return name;
|
|
509
|
-
}
|
|
510
|
-
function labelFor(env) {
|
|
511
|
-
return `dev.agentvault.muse-${slugify(requireAgentName(env))}`;
|
|
512
|
-
}
|
|
513
|
-
function dataDirFor(env, agentName) {
|
|
514
|
-
if (env.AV_DATA_DIR) return env.AV_DATA_DIR;
|
|
515
|
-
return join9(env.HOME ?? "", ".agentvault", "muse-room-bridge", slugify(agentName));
|
|
516
|
-
}
|
|
517
|
-
function maybeRunServiceSubcommand(argv, env, deps) {
|
|
518
|
-
const cmd = argv[2];
|
|
519
|
-
if (!cmd) return false;
|
|
520
|
-
if (!SERVICE_CMDS.has(cmd)) {
|
|
521
|
-
const looksLikeToken = cmd.startsWith("av_tok_");
|
|
522
|
-
const looksLikeFlag = cmd.startsWith("-");
|
|
523
|
-
if (!looksLikeToken && !looksLikeFlag) {
|
|
524
|
-
throw new Error(
|
|
525
|
-
`unknown subcommand: ${cmd} \u2014 expected one of ${[...SERVICE_CMDS].join(", ")}, an invite token, or no argument at all`
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
const backend = deps?.backend ?? selectBackend(process.platform);
|
|
531
|
-
const entrypoint = deps?.entrypoint ?? process.argv[1];
|
|
532
|
-
const log = deps?.log ?? ((m2) => logLine("[muse-bridge] " + m2));
|
|
533
|
-
try {
|
|
534
|
-
if (cmd === "install") {
|
|
535
|
-
const agentName = requireAgentName(env);
|
|
536
|
-
assertInstallableEntrypoint(entrypoint);
|
|
537
|
-
const dataDir = dataDirFor(env, agentName);
|
|
538
|
-
if (!hasPersistedCreds(dataDir)) {
|
|
539
|
-
throw new Error(
|
|
540
|
-
"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"
|
|
541
|
-
);
|
|
542
|
-
}
|
|
543
|
-
const cfg = loadConfig(env, []);
|
|
544
|
-
const spec = buildServiceSpec(cfg, {
|
|
545
|
-
entrypoint,
|
|
546
|
-
home: env.HOME ?? "",
|
|
547
|
-
path: env.PATH ?? ""
|
|
548
|
-
});
|
|
549
|
-
backend.install(spec);
|
|
550
|
-
log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
|
|
551
|
-
log(`check it with: AV_AGENT_NAME=${cfg.agentName} agentvault-muse-bridge status`);
|
|
552
|
-
} else if (cmd === "uninstall") {
|
|
553
|
-
const label = labelFor(env);
|
|
554
|
-
backend.uninstall(label);
|
|
555
|
-
log(`uninstalled service ${label}`);
|
|
556
|
-
} else if (cmd === "restart") {
|
|
557
|
-
const label = labelFor(env);
|
|
558
|
-
backend.restart(label);
|
|
559
|
-
log(`restarted service ${label}`);
|
|
560
|
-
} else if (cmd === "status") {
|
|
561
|
-
const label = labelFor(env);
|
|
562
|
-
const st = backend.status(label);
|
|
563
|
-
log(`${label}: ${st.loaded ? "loaded" : "not loaded"}`);
|
|
564
|
-
} else if (cmd === "logs") {
|
|
565
|
-
const label = labelFor(env);
|
|
566
|
-
log(`logs for ${label} are at <dataDir>/logs/muse-bridge.log (tail -f it)`);
|
|
567
|
-
}
|
|
568
|
-
} catch (e) {
|
|
569
|
-
log(e.message);
|
|
570
|
-
process.exitCode = 1;
|
|
571
|
-
}
|
|
572
|
-
return true;
|
|
573
|
-
}
|
|
574
|
-
var SERVICE_CMDS;
|
|
575
|
-
var init_subcommand = __esm({
|
|
576
|
-
"src/service/subcommand.ts"() {
|
|
577
|
-
"use strict";
|
|
578
|
-
init_config();
|
|
579
|
-
init_log();
|
|
580
|
-
init_spec();
|
|
581
|
-
init_backend();
|
|
582
|
-
SERVICE_CMDS = /* @__PURE__ */ new Set(["install", "uninstall", "restart", "status", "logs"]);
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
|
|
586
242
|
// ../plugin/dist/index.js
|
|
587
243
|
var dist_exports = {};
|
|
588
244
|
__export(dist_exports, {
|
|
@@ -611,6 +267,8 @@ __export(dist_exports, {
|
|
|
611
267
|
mergeSkills: () => mergeSkills,
|
|
612
268
|
onAgentEvent: () => onAgentEvent,
|
|
613
269
|
onSessionTranscriptUpdate: () => onSessionTranscriptUpdate,
|
|
270
|
+
owesRoomReply: () => owesRoomReply,
|
|
271
|
+
parseMentions: () => parseMentions,
|
|
614
272
|
parseSkillMd: () => parseSkillMd,
|
|
615
273
|
parseTarget: () => parseTarget,
|
|
616
274
|
reportSkillInvocation: () => reportSkillInvocation,
|
|
@@ -621,12 +279,13 @@ __export(dist_exports, {
|
|
|
621
279
|
sendToRoom: () => sendToRoom,
|
|
622
280
|
sendToTarget: () => sendToTarget,
|
|
623
281
|
setOcRuntime: () => setOcRuntime,
|
|
282
|
+
stripMentions: () => stripMentions,
|
|
624
283
|
wrapSkillExecution: () => wrapSkillExecution
|
|
625
284
|
});
|
|
626
285
|
import * as nc from "node:crypto";
|
|
627
286
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
628
287
|
import { readdir, readFile, rename, rm } from "node:fs/promises";
|
|
629
|
-
import { join as
|
|
288
|
+
import { join as join6 } from "node:path";
|
|
630
289
|
import { readFile as readFile2, rename as rename2, rm as rm2 } from "node:fs/promises";
|
|
631
290
|
import { join as join22 } from "node:path";
|
|
632
291
|
import { Readable } from "node:stream";
|
|
@@ -648,8 +307,19 @@ import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
|
|
|
648
307
|
import { Http2ServerRequest } from "http2";
|
|
649
308
|
import { Readable as Readable2 } from "stream";
|
|
650
309
|
import crypto3 from "crypto";
|
|
651
|
-
import { readFileSync as readFileSync22, existsSync as
|
|
310
|
+
import { readFileSync as readFileSync22, existsSync as existsSync4, readdirSync } from "node:fs";
|
|
652
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
|
+
}
|
|
653
323
|
function toEpoch(v2) {
|
|
654
324
|
if (typeof v2 === "bigint") return v2;
|
|
655
325
|
if (typeof v2 === "number") {
|
|
@@ -1226,7 +896,7 @@ function W(e) {
|
|
|
1226
896
|
var n2 = p(t2, e);
|
|
1227
897
|
return g(r2), n2;
|
|
1228
898
|
}
|
|
1229
|
-
function
|
|
899
|
+
function q(e, r2, t2) {
|
|
1230
900
|
var _2 = [];
|
|
1231
901
|
i(t2);
|
|
1232
902
|
var n2 = u(e = E(_2, e, "message")), s2 = e.length;
|
|
@@ -11646,7 +11316,7 @@ async function writeSecureFile(filePath, data, flag) {
|
|
|
11646
11316
|
}
|
|
11647
11317
|
function syncLockPath(dataDir, channelId) {
|
|
11648
11318
|
const safe = channelId.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
11649
|
-
return
|
|
11319
|
+
return join6(dataDir, `mls-a2a-sync-${safe}.lock`);
|
|
11650
11320
|
}
|
|
11651
11321
|
async function acquireA2ASyncLock(dataDir, channelId) {
|
|
11652
11322
|
await ensureSecureDir(dataDir);
|
|
@@ -11729,12 +11399,12 @@ async function clearPendingWelcome(dataDir, groupId) {
|
|
|
11729
11399
|
}
|
|
11730
11400
|
async function saveMlsState(dataDir, groupId, state) {
|
|
11731
11401
|
await ensureSecureDir(dataDir);
|
|
11732
|
-
const filePath =
|
|
11402
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11733
11403
|
await writeSecureFile(filePath, state);
|
|
11734
11404
|
}
|
|
11735
11405
|
async function loadMlsState(dataDir, groupId) {
|
|
11736
11406
|
try {
|
|
11737
|
-
const filePath =
|
|
11407
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11738
11408
|
return await readFile(filePath, "utf-8");
|
|
11739
11409
|
} catch {
|
|
11740
11410
|
return null;
|
|
@@ -11742,7 +11412,7 @@ async function loadMlsState(dataDir, groupId) {
|
|
|
11742
11412
|
}
|
|
11743
11413
|
async function deleteMlsState(dataDir, groupId) {
|
|
11744
11414
|
try {
|
|
11745
|
-
const filePath =
|
|
11415
|
+
const filePath = join6(dataDir, mlsFileName(groupId));
|
|
11746
11416
|
await rm(filePath);
|
|
11747
11417
|
} catch {
|
|
11748
11418
|
}
|
|
@@ -11769,7 +11439,7 @@ async function quarantineOrphanedMlsState(dataDir, isStillMember, opts = {}) {
|
|
|
11769
11439
|
}
|
|
11770
11440
|
if (member === null || member === true) continue;
|
|
11771
11441
|
try {
|
|
11772
|
-
await rename(
|
|
11442
|
+
await rename(join6(dataDir, name), join6(dataDir, `${name}.orphaned`));
|
|
11773
11443
|
quarantined.push(groupId);
|
|
11774
11444
|
} catch {
|
|
11775
11445
|
}
|
|
@@ -11795,10 +11465,10 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11795
11465
|
return null;
|
|
11796
11466
|
}
|
|
11797
11467
|
function ownIdentity() {
|
|
11798
|
-
const v2 = true ? "0.23.
|
|
11468
|
+
const v2 = true ? "0.23.29" : FALLBACK;
|
|
11799
11469
|
return `${PACKAGE}@${v2}`;
|
|
11800
11470
|
}
|
|
11801
|
-
function
|
|
11471
|
+
function buildClientVersion(override) {
|
|
11802
11472
|
try {
|
|
11803
11473
|
const candidate = (override ?? "").trim();
|
|
11804
11474
|
if (candidate) {
|
|
@@ -12520,7 +12190,7 @@ function formatChannelError(err) {
|
|
|
12520
12190
|
}
|
|
12521
12191
|
return `[AgentVault] channel error (non-fatal to the connection): ${msg}`;
|
|
12522
12192
|
}
|
|
12523
|
-
function
|
|
12193
|
+
function attachLifecycle(channel, opts = {}) {
|
|
12524
12194
|
const log = opts.log ?? (() => {
|
|
12525
12195
|
});
|
|
12526
12196
|
const agentName = opts.agentName ?? "";
|
|
@@ -12793,6 +12463,51 @@ async function checkGateway(options) {
|
|
|
12793
12463
|
return { ok: false, error: friendlyError(err) };
|
|
12794
12464
|
}
|
|
12795
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
|
+
}
|
|
12796
12511
|
function getErrorMap() {
|
|
12797
12512
|
return overrideErrorMap;
|
|
12798
12513
|
}
|
|
@@ -13166,7 +12881,7 @@ function randomString(length = 10) {
|
|
|
13166
12881
|
}
|
|
13167
12882
|
return str;
|
|
13168
12883
|
}
|
|
13169
|
-
function
|
|
12884
|
+
function esc(str) {
|
|
13170
12885
|
return JSON.stringify(str);
|
|
13171
12886
|
}
|
|
13172
12887
|
function slugify2(input) {
|
|
@@ -17076,7 +16791,7 @@ function parseSimpleYaml(yaml) {
|
|
|
17076
16791
|
function loadSkillsFromDirectory(dir) {
|
|
17077
16792
|
const skills = [];
|
|
17078
16793
|
const absDir = resolve22(dir);
|
|
17079
|
-
if (!
|
|
16794
|
+
if (!existsSync4(absDir)) return skills;
|
|
17080
16795
|
const seen = /* @__PURE__ */ new Set();
|
|
17081
16796
|
function tryLoad(filePath) {
|
|
17082
16797
|
if (seen.has(filePath)) return;
|
|
@@ -17089,13 +16804,13 @@ function loadSkillsFromDirectory(dir) {
|
|
|
17089
16804
|
}
|
|
17090
16805
|
}
|
|
17091
16806
|
try {
|
|
17092
|
-
const entries =
|
|
16807
|
+
const entries = readdirSync(absDir, { withFileTypes: true });
|
|
17093
16808
|
for (const entry of entries) {
|
|
17094
16809
|
if (entry.isFile() && entry.name.endsWith("SKILL.md")) {
|
|
17095
16810
|
tryLoad(join52(absDir, entry.name));
|
|
17096
16811
|
} else if (entry.isDirectory()) {
|
|
17097
16812
|
const subSkill = join52(absDir, entry.name, "SKILL.md");
|
|
17098
|
-
if (
|
|
16813
|
+
if (existsSync4(subSkill)) {
|
|
17099
16814
|
tryLoad(subSkill);
|
|
17100
16815
|
}
|
|
17101
16816
|
}
|
|
@@ -17323,7 +17038,7 @@ function reportSkillInvocation(opts) {
|
|
|
17323
17038
|
spanBuffer.push(span);
|
|
17324
17039
|
return span;
|
|
17325
17040
|
}
|
|
17326
|
-
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;
|
|
17327
17042
|
var init_dist = __esm({
|
|
17328
17043
|
async "../plugin/dist/index.js"() {
|
|
17329
17044
|
"use strict";
|
|
@@ -17359,6 +17074,14 @@ var init_dist = __esm({
|
|
|
17359
17074
|
isNodeMode || !mod4 || !mod4.__esModule ? __defProp2(target, "default", { value: mod4, enumerable: true }) : target,
|
|
17360
17075
|
mod4
|
|
17361
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
|
+
});
|
|
17362
17085
|
init_mls_commit_classify = __esm2({
|
|
17363
17086
|
"src/mls-commit-classify.ts"() {
|
|
17364
17087
|
"use strict";
|
|
@@ -59368,7 +59091,7 @@ var init_dist = __esm({
|
|
|
59368
59091
|
t = libsodium_sumo_default.ready.then(function() {
|
|
59369
59092
|
function t2() {
|
|
59370
59093
|
if (a._sodium_init() < 0) throw new Error("libsodium was not correctly initialized.");
|
|
59371
|
-
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]);
|
|
59372
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"];
|
|
59373
59096
|
for (_3 = 0; _3 < n3.length; _3++) "function" == typeof (c3 = a["_" + n3[_3].toLowerCase()]) && (r[n3[_3]] = c3());
|
|
59374
59097
|
var s3 = ["SODIUM_VERSION_STRING", "crypto_pwhash_STRPREFIX", "crypto_pwhash_argon2i_STRPREFIX", "crypto_pwhash_argon2id_STRPREFIX", "crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];
|
|
@@ -68312,6 +68035,39 @@ var init_dist = __esm({
|
|
|
68312
68035
|
const s2 = this._requireState();
|
|
68313
68036
|
return s2.groupContext.groupId;
|
|
68314
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
|
+
}
|
|
68315
68071
|
/** The cipher suite name in use. */
|
|
68316
68072
|
get ciphersuiteName() {
|
|
68317
68073
|
return this._ciphersuiteName;
|
|
@@ -68462,11 +68218,84 @@ var init_dist = __esm({
|
|
|
68462
68218
|
return { commit: commitBytes, welcome: welcomeBytes };
|
|
68463
68219
|
}
|
|
68464
68220
|
/**
|
|
68465
|
-
*
|
|
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.
|
|
68466
68234
|
*
|
|
68467
|
-
*
|
|
68468
|
-
*
|
|
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).
|
|
68469
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
|
+
}
|
|
68470
68299
|
async removeMember(memberIndex) {
|
|
68471
68300
|
const s2 = this._requireState();
|
|
68472
68301
|
const cs = await this._ensureCiphersuite();
|
|
@@ -68770,7 +68599,7 @@ var init_dist = __esm({
|
|
|
68770
68599
|
"use strict";
|
|
68771
68600
|
init_secure_file();
|
|
68772
68601
|
SYNC_LOCK_STALE_MS = 5 * 60 * 1e3;
|
|
68773
|
-
pendingKpPath = (dataDir, groupId) =>
|
|
68602
|
+
pendingKpPath = (dataDir, groupId) => join6(dataDir, `mls-kp-pending-${groupId.replace(/[^a-zA-Z0-9_-]/g, "_")}.json`);
|
|
68774
68603
|
}
|
|
68775
68604
|
});
|
|
68776
68605
|
init_mls_kp_pool = __esm2({
|
|
@@ -69026,6 +68855,7 @@ var init_dist = __esm({
|
|
|
69026
68855
|
init_channel = __esm2({
|
|
69027
68856
|
async "src/channel.ts"() {
|
|
69028
68857
|
"use strict";
|
|
68858
|
+
init_abstention();
|
|
69029
68859
|
init_mls_commit_classify();
|
|
69030
68860
|
await init_libsodium_wrappers();
|
|
69031
68861
|
await init_dist2();
|
|
@@ -69455,6 +69285,18 @@ var init_dist = __esm({
|
|
|
69455
69285
|
get ownHubAddress() {
|
|
69456
69286
|
return this._persisted?.hubAddress ?? "";
|
|
69457
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
|
+
}
|
|
69458
69300
|
/** Public best-effort trigger to (re)resolve this agent's display_name.
|
|
69459
69301
|
* Called lazily from the 1:1 DM path when the name is still unknown, so a
|
|
69460
69302
|
* resolve that failed at connect (or a fresh agent that hadn't registered
|
|
@@ -69843,6 +69685,7 @@ var init_dist = __esm({
|
|
|
69843
69685
|
* Each session gets the same plaintext encrypted independently.
|
|
69844
69686
|
*/
|
|
69845
69687
|
async send(plaintext, options) {
|
|
69688
|
+
if (isAbstention(plaintext)) return;
|
|
69846
69689
|
if (this._state === "error" || this._state === "idle") {
|
|
69847
69690
|
throw new Error("Channel is not ready");
|
|
69848
69691
|
}
|
|
@@ -70171,7 +70014,7 @@ var init_dist = __esm({
|
|
|
70171
70014
|
*/
|
|
70172
70015
|
sendActivitySpan(spanData) {
|
|
70173
70016
|
if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
|
|
70174
|
-
const pluginVersion = true ? "0.23.
|
|
70017
|
+
const pluginVersion = true ? "0.23.29" : "0.0.0-dev";
|
|
70175
70018
|
const agentName = this.config.agentName ?? "Agent";
|
|
70176
70019
|
const resource = {
|
|
70177
70020
|
"service.name": "agentvault-agent",
|
|
@@ -70365,6 +70208,7 @@ var init_dist = __esm({
|
|
|
70365
70208
|
* Uses MLS (preferred) or pairwise fan-out as fallback.
|
|
70366
70209
|
*/
|
|
70367
70210
|
async sendToRoom(roomId, plaintext, opts) {
|
|
70211
|
+
if (isAbstention(plaintext)) return;
|
|
70368
70212
|
if (!this._persisted?.rooms?.[roomId]) {
|
|
70369
70213
|
throw new Error(`Room ${roomId} not found`);
|
|
70370
70214
|
}
|
|
@@ -72064,7 +71908,7 @@ var init_dist = __esm({
|
|
|
72064
71908
|
return;
|
|
72065
71909
|
}
|
|
72066
71910
|
const wsUrl = this.config.apiUrl.replace(/^http/, "ws");
|
|
72067
|
-
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))}`;
|
|
72068
71912
|
const ws = new WebSocket(url22);
|
|
72069
71913
|
this._ws = ws;
|
|
72070
71914
|
ws.on("open", async () => {
|
|
@@ -72108,7 +71952,7 @@ var init_dist = __esm({
|
|
|
72108
71952
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
72109
71953
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
72110
71954
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
72111
|
-
pluginVersion: true ? "0.23.
|
|
71955
|
+
pluginVersion: true ? "0.23.29" : "0.0.0-dev"
|
|
72112
71956
|
});
|
|
72113
71957
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
72114
71958
|
}
|
|
@@ -72432,7 +72276,7 @@ var init_dist = __esm({
|
|
|
72432
72276
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
72433
72277
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
72434
72278
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
72435
|
-
pluginVersion: true ? "0.23.
|
|
72279
|
+
pluginVersion: true ? "0.23.29" : "0.0.0-dev"
|
|
72436
72280
|
});
|
|
72437
72281
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
72438
72282
|
}
|
|
@@ -76296,7 +76140,7 @@ ${messageText}`;
|
|
|
76296
76140
|
channel.on("error", (err) => {
|
|
76297
76141
|
_log?.(formatChannelError(err));
|
|
76298
76142
|
});
|
|
76299
|
-
|
|
76143
|
+
attachLifecycle(channel, {
|
|
76300
76144
|
agentName: account.agentName,
|
|
76301
76145
|
log: (m2) => _log?.(`[AgentVault] ${m2}`),
|
|
76302
76146
|
onTerminal: async () => {
|
|
@@ -76412,6 +76256,11 @@ ${actionsText}`);
|
|
|
76412
76256
|
init_openclaw_compat();
|
|
76413
76257
|
}
|
|
76414
76258
|
});
|
|
76259
|
+
init_room_protocol = __esm2({
|
|
76260
|
+
"src/room-protocol.ts"() {
|
|
76261
|
+
"use strict";
|
|
76262
|
+
}
|
|
76263
|
+
});
|
|
76415
76264
|
init_llm_response_parser = __esm2({
|
|
76416
76265
|
"src/llm-response-parser.ts"() {
|
|
76417
76266
|
"use strict";
|
|
@@ -76443,6 +76292,7 @@ ${actionsText}`);
|
|
|
76443
76292
|
init_openclaw_entry = __esm2({
|
|
76444
76293
|
"src/openclaw-entry.ts"() {
|
|
76445
76294
|
"use strict";
|
|
76295
|
+
init_room_protocol();
|
|
76446
76296
|
init_account_config();
|
|
76447
76297
|
init_fetch_interceptor();
|
|
76448
76298
|
init_http_handlers();
|
|
@@ -80226,7 +80076,7 @@ ${actionsText}`);
|
|
|
80226
80076
|
cloneDef: () => cloneDef,
|
|
80227
80077
|
createTransparentProxy: () => createTransparentProxy,
|
|
80228
80078
|
defineLazy: () => defineLazy,
|
|
80229
|
-
esc: () =>
|
|
80079
|
+
esc: () => esc,
|
|
80230
80080
|
escapeRegex: () => escapeRegex,
|
|
80231
80081
|
extend: () => extend,
|
|
80232
80082
|
finalizeIssue: () => finalizeIssue,
|
|
@@ -81862,7 +81712,7 @@ ${actionsText}`);
|
|
|
81862
81712
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
81863
81713
|
const normalized = _normalized.value;
|
|
81864
81714
|
const parseStr = (key) => {
|
|
81865
|
-
const k2 =
|
|
81715
|
+
const k2 = esc(key);
|
|
81866
81716
|
return `shape[${k2}]._zod.run({ value: input[${k2}], issues: [] }, ctx)`;
|
|
81867
81717
|
};
|
|
81868
81718
|
doc.write(`const input = payload.value;`);
|
|
@@ -81874,7 +81724,7 @@ ${actionsText}`);
|
|
|
81874
81724
|
doc.write(`const newResult = {};`);
|
|
81875
81725
|
for (const key of normalized.keys) {
|
|
81876
81726
|
const id = ids[key];
|
|
81877
|
-
const k2 =
|
|
81727
|
+
const k2 = esc(key);
|
|
81878
81728
|
const schema = shape[key];
|
|
81879
81729
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
81880
81730
|
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
@@ -97665,40 +97515,477 @@ data:
|
|
|
97665
97515
|
init_skill_invoker();
|
|
97666
97516
|
await init_skill_telemetry();
|
|
97667
97517
|
await init_policy_enforcer();
|
|
97668
|
-
|
|
97518
|
+
init_room_protocol();
|
|
97519
|
+
VERSION = true ? "0.23.29" : "0.0.0-dev";
|
|
97669
97520
|
}
|
|
97670
97521
|
});
|
|
97671
97522
|
await init_index();
|
|
97672
97523
|
}
|
|
97673
97524
|
});
|
|
97674
97525
|
|
|
97675
|
-
// src/
|
|
97676
|
-
|
|
97677
|
-
|
|
97678
|
-
|
|
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
|
+
});
|
|
97679
97570
|
|
|
97680
|
-
// src/
|
|
97681
|
-
import {
|
|
97682
|
-
|
|
97683
|
-
|
|
97684
|
-
|
|
97685
|
-
|
|
97686
|
-
|
|
97687
|
-
|
|
97688
|
-
|
|
97689
|
-
|
|
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();
|
|
97690
97601
|
}
|
|
97691
|
-
|
|
97692
|
-
|
|
97693
|
-
|
|
97694
|
-
|
|
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;
|
|
97695
97660
|
}
|
|
97696
|
-
|
|
97697
|
-
|
|
97698
|
-
|
|
97699
|
-
|
|
97700
|
-
|
|
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;
|
|
97701
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
|
+
|
|
97984
|
+
// src/index.ts
|
|
97985
|
+
init_config();
|
|
97986
|
+
init_log();
|
|
97987
|
+
init_fence_auth();
|
|
97988
|
+
import { chmodSync as chmodSync5, mkdirSync as mkdirSync6 } from "node:fs";
|
|
97702
97989
|
|
|
97703
97990
|
// src/muse-session.ts
|
|
97704
97991
|
var MuseSession = class {
|
|
@@ -97812,7 +98099,7 @@ ${item.text}` : item.text;
|
|
|
97812
98099
|
// src/muse-driver.ts
|
|
97813
98100
|
import { spawn } from "node:child_process";
|
|
97814
98101
|
import { randomUUID } from "node:crypto";
|
|
97815
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as
|
|
98102
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
97816
98103
|
import { join as join4 } from "node:path";
|
|
97817
98104
|
|
|
97818
98105
|
// src/muse-spawn.ts
|
|
@@ -97881,14 +98168,14 @@ var MuseDriver = class {
|
|
|
97881
98168
|
mkdirSync3(this.opts.dataDir, { recursive: true });
|
|
97882
98169
|
const file2 = join4(this.opts.dataDir, SESSION_FILE);
|
|
97883
98170
|
if (existsSync3(file2)) {
|
|
97884
|
-
const existing =
|
|
98171
|
+
const existing = readFileSync3(file2, "utf8").trim();
|
|
97885
98172
|
if (existing) {
|
|
97886
98173
|
this.persistedId = existing;
|
|
97887
98174
|
return existing;
|
|
97888
98175
|
}
|
|
97889
98176
|
}
|
|
97890
98177
|
this.persistedId = randomUUID();
|
|
97891
|
-
|
|
98178
|
+
writeFileSync2(file2, this.persistedId + "\n", { encoding: "utf8" });
|
|
97892
98179
|
return this.persistedId;
|
|
97893
98180
|
}
|
|
97894
98181
|
sessionId() {
|
|
@@ -98402,7 +98689,7 @@ data: ${JSON.stringify(out)}
|
|
|
98402
98689
|
}
|
|
98403
98690
|
|
|
98404
98691
|
// src/settings-mcp.ts
|
|
98405
|
-
import { mkdirSync as mkdirSync4, writeFileSync as
|
|
98692
|
+
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync3, chmodSync as chmodSync3 } from "node:fs";
|
|
98406
98693
|
import { join as join5 } from "node:path";
|
|
98407
98694
|
function writeFenceMcpSettings(fenceHome, opts) {
|
|
98408
98695
|
const dir = join5(fenceHome, ".config", "muse");
|
|
@@ -98419,11 +98706,12 @@ function writeFenceMcpSettings(fenceHome, opts) {
|
|
|
98419
98706
|
}
|
|
98420
98707
|
}
|
|
98421
98708
|
};
|
|
98422
|
-
|
|
98709
|
+
writeFileSync3(dest, JSON.stringify(body, null, 2) + "\n", { mode: 384 });
|
|
98423
98710
|
chmodSync3(dest, 384);
|
|
98424
98711
|
}
|
|
98425
98712
|
|
|
98426
98713
|
// src/bridge.ts
|
|
98714
|
+
await init_dist();
|
|
98427
98715
|
var workAllowedFlag = false;
|
|
98428
98716
|
var gatesRemovedFlag = false;
|
|
98429
98717
|
function workAllowed() {
|
|
@@ -98480,7 +98768,7 @@ var ActiveTarget = class {
|
|
|
98480
98768
|
};
|
|
98481
98769
|
}
|
|
98482
98770
|
};
|
|
98483
|
-
function
|
|
98771
|
+
function attachLifecycle2(channel, opts = {}) {
|
|
98484
98772
|
const log = opts.log ?? (() => {
|
|
98485
98773
|
});
|
|
98486
98774
|
const onTerminal = opts.onTerminal ?? ((_reason, o2) => process.exit(o2.restart ? 1 : 0));
|
|
@@ -98504,9 +98792,32 @@ function roomTurnPrefix(roomId, senderName, roomName) {
|
|
|
98504
98792
|
const room = roomName ? `"${roomName}"` : roomId.slice(0, 8);
|
|
98505
98793
|
return `[room ${room} | ${senderName}]`;
|
|
98506
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
|
+
}
|
|
98507
98817
|
function wireBridge(channel, session, target, opts = {}) {
|
|
98508
98818
|
const log = opts.log ?? (() => {
|
|
98509
98819
|
});
|
|
98820
|
+
const _owesReply = _makeOwesReply(opts.agentName, channel, log);
|
|
98510
98821
|
channel.on("error", (err) => {
|
|
98511
98822
|
const msg = err instanceof Error ? err.message : String(err);
|
|
98512
98823
|
log(`channel error (non-fatal, not a reconnect trigger): ${msg}`);
|
|
@@ -98553,7 +98864,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
98553
98864
|
target.snapshotReply(channel, log),
|
|
98554
98865
|
{
|
|
98555
98866
|
autoReplyOnText: false,
|
|
98556
|
-
replyExpected: e
|
|
98867
|
+
replyExpected: _owesReply(e)
|
|
98557
98868
|
}
|
|
98558
98869
|
);
|
|
98559
98870
|
});
|
|
@@ -98571,7 +98882,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
98571
98882
|
}
|
|
98572
98883
|
|
|
98573
98884
|
// src/version.ts
|
|
98574
|
-
function
|
|
98885
|
+
function buildClientVersion2(version2) {
|
|
98575
98886
|
return `@agentvault/muse-bridge@${version2 ?? "dev"}`;
|
|
98576
98887
|
}
|
|
98577
98888
|
|
|
@@ -98581,7 +98892,7 @@ function mkdir700(path2) {
|
|
|
98581
98892
|
chmodSync5(path2, 448);
|
|
98582
98893
|
}
|
|
98583
98894
|
function packageVersion() {
|
|
98584
|
-
return true ? "0.1.
|
|
98895
|
+
return true ? "0.1.4" : void 0;
|
|
98585
98896
|
}
|
|
98586
98897
|
function helpText(version2) {
|
|
98587
98898
|
return [
|
|
@@ -98627,7 +98938,7 @@ async function main(opts = {}) {
|
|
|
98627
98938
|
}
|
|
98628
98939
|
const info = parseInfoFlags(argv.slice(2));
|
|
98629
98940
|
if (info.showVersion || info.showHelp) {
|
|
98630
|
-
const version2 =
|
|
98941
|
+
const version2 = buildClientVersion2(packageVersion());
|
|
98631
98942
|
if (info.showVersion) printLine(version2);
|
|
98632
98943
|
if (info.showHelp) printLine(helpText(version2));
|
|
98633
98944
|
exit(0);
|
|
@@ -98642,6 +98953,14 @@ async function main(opts = {}) {
|
|
|
98642
98953
|
hostHome: cfg.hostHome,
|
|
98643
98954
|
log: (m2) => logLine(m2)
|
|
98644
98955
|
});
|
|
98956
|
+
harvestFenceApiKeyToSidecar({
|
|
98957
|
+
dataDir: cfg.dataDir,
|
|
98958
|
+
fenceHome: cfg.fenceHome,
|
|
98959
|
+
log: (m2) => logLine(m2)
|
|
98960
|
+
});
|
|
98961
|
+
if (!cfg.apiKey) {
|
|
98962
|
+
cfg.apiKey = readSidecarMetaApiKey(cfg.dataDir) || readFenceMetaApiKey(cfg.fenceHome) || void 0;
|
|
98963
|
+
}
|
|
98645
98964
|
let shuttingDown = false;
|
|
98646
98965
|
let exiting = false;
|
|
98647
98966
|
let driver;
|
|
@@ -98701,7 +99020,7 @@ async function main(opts = {}) {
|
|
|
98701
99020
|
return;
|
|
98702
99021
|
}
|
|
98703
99022
|
logLine(`[muse-bridge] muse session ${driver.sessionId()} ready`);
|
|
98704
|
-
const clientVersion =
|
|
99023
|
+
const clientVersion = buildClientVersion2(packageVersion());
|
|
98705
99024
|
if (opts.createChannel) {
|
|
98706
99025
|
channel = opts.createChannel({
|
|
98707
99026
|
inviteToken: cfg.inviteToken,
|
|
@@ -98724,9 +99043,12 @@ async function main(opts = {}) {
|
|
|
98724
99043
|
}
|
|
98725
99044
|
const target = new ActiveTarget();
|
|
98726
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,
|
|
98727
99049
|
log: (m2) => logLine("[muse-bridge] " + m2)
|
|
98728
99050
|
});
|
|
98729
|
-
|
|
99051
|
+
attachLifecycle2(channel, {
|
|
98730
99052
|
log: (m2) => logLine("[muse-bridge] " + m2),
|
|
98731
99053
|
onTerminal: (_reason, o2) => void shutdown(o2.restart ? 1 : 0)
|
|
98732
99054
|
});
|