@agentvault/grok-bridge 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +15 -0
- package/dist/index.js +96 -18
- package/dist/log.d.ts +12 -0
- package/dist/service/subcommand.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
* flag can never be mistaken for an invite token.
|
|
12
12
|
*/
|
|
13
13
|
export declare const INSTALL_FLAG = "--install";
|
|
14
|
+
/** Informational flags. Handled BEFORE loadConfig in index.ts, because asking
|
|
15
|
+
* "what version is this?" must not require an invite token. Listed here too so
|
|
16
|
+
* the strict unknown-flag check does not reject them. */
|
|
17
|
+
export declare const VERSION_FLAGS: readonly ["--version", "-v"];
|
|
18
|
+
export declare const HELP_FLAGS: readonly ["--help", "-h"];
|
|
19
|
+
/** Pure argv read for the informational flags. Deliberately independent of
|
|
20
|
+
* loadConfig: that throws without a token, and `--version` must answer anyway. */
|
|
21
|
+
export declare function parseInfoFlags(argv: string[]): {
|
|
22
|
+
showVersion: boolean;
|
|
23
|
+
showHelp: boolean;
|
|
24
|
+
};
|
|
14
25
|
/**
|
|
15
26
|
* Package-manager scratch caches. `service/subcommand.ts` bakes `process.argv[1]`
|
|
16
27
|
* into the launcher script, so a service installed from one of these points at a
|
|
@@ -68,6 +79,10 @@ export interface BridgeConfig {
|
|
|
68
79
|
* then EXIT so the customer's terminal returns. False leaves a bare run
|
|
69
80
|
* byte-for-byte as it behaves today. */
|
|
70
81
|
installAfterEnroll: boolean;
|
|
82
|
+
/** --version / -v. index.ts answers these before loadConfig runs. */
|
|
83
|
+
showVersion: boolean;
|
|
84
|
+
/** --help / -h. Same. */
|
|
85
|
+
showHelp: boolean;
|
|
71
86
|
}
|
|
72
87
|
export declare function loadConfig(env: NodeJS.ProcessEnv, argv?: string[]): BridgeConfig;
|
|
73
88
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,12 @@ var __export = (target, all) => {
|
|
|
13
13
|
import { existsSync, readFileSync as readFileSync2, mkdirSync, chmodSync } from "node:fs";
|
|
14
14
|
import { join as join5, resolve as resolve2, sep, dirname } from "node:path";
|
|
15
15
|
import { tmpdir } from "node:os";
|
|
16
|
+
function parseInfoFlags(argv) {
|
|
17
|
+
return {
|
|
18
|
+
showVersion: argv.some((a2) => VERSION_FLAGS.includes(a2)),
|
|
19
|
+
showHelp: argv.some((a2) => HELP_FLAGS.includes(a2))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
16
22
|
function isEphemeralEntrypoint(entrypoint) {
|
|
17
23
|
return entrypoint.includes("/_npx/") || entrypoint.includes("/dlx-") || entrypoint.includes("/.bun/install/cache/") || entrypoint.startsWith(tmpdir() + sep);
|
|
18
24
|
}
|
|
@@ -50,7 +56,7 @@ function loadConfig(env, argv = []) {
|
|
|
50
56
|
const unknownFlags = argv.filter((a2) => a2.startsWith("-") && !KNOWN_FLAGS.has(a2));
|
|
51
57
|
if (unknownFlags.length) {
|
|
52
58
|
throw new Error(
|
|
53
|
-
`unknown option(s): ${unknownFlags.join(", ")} \u2014
|
|
59
|
+
`unknown option(s): ${unknownFlags.join(", ")} \u2014 supported flags are ${[...KNOWN_FLAGS].join(", ")}`
|
|
54
60
|
);
|
|
55
61
|
}
|
|
56
62
|
const workspaceDir = env.AV_WORKSPACE_DIR || join5(dirname(dataDir), "workspaces", slugify2(env.AV_AGENT_NAME ?? "grok"));
|
|
@@ -81,6 +87,7 @@ function loadConfig(env, argv = []) {
|
|
|
81
87
|
// One-paste install (--install): enrol, hand off to the supervisor, exit.
|
|
82
88
|
// Default false keeps a bare `npx @agentvault/grok-bridge` run identical.
|
|
83
89
|
installAfterEnroll: argv.includes(INSTALL_FLAG),
|
|
90
|
+
...parseInfoFlags(argv),
|
|
84
91
|
apiUrl: env.AV_API_URL ?? "https://api.agentvault.chat",
|
|
85
92
|
// Identity shown to the agent's own session. Set this to the agent's
|
|
86
93
|
// AgentVault name via AV_AGENT_NAME (the native connect command passes it).
|
|
@@ -97,12 +104,14 @@ function loadConfig(env, argv = []) {
|
|
|
97
104
|
systemPrompt: env.AV_SYSTEM_PROMPT || void 0
|
|
98
105
|
};
|
|
99
106
|
}
|
|
100
|
-
var INSTALL_FLAG, KNOWN_FLAGS, CRED_FILES, BACKUP_FILE;
|
|
107
|
+
var INSTALL_FLAG, VERSION_FLAGS, HELP_FLAGS, KNOWN_FLAGS, CRED_FILES, BACKUP_FILE;
|
|
101
108
|
var init_config = __esm({
|
|
102
109
|
"src/config.ts"() {
|
|
103
110
|
"use strict";
|
|
104
111
|
INSTALL_FLAG = "--install";
|
|
105
|
-
|
|
112
|
+
VERSION_FLAGS = ["--version", "-v"];
|
|
113
|
+
HELP_FLAGS = ["--help", "-h"];
|
|
114
|
+
KNOWN_FLAGS = /* @__PURE__ */ new Set([INSTALL_FLAG, ...VERSION_FLAGS, ...HELP_FLAGS]);
|
|
106
115
|
CRED_FILES = ["agentvault.json", "secure-channel.json"];
|
|
107
116
|
BACKUP_FILE = "agentvault.json.bak";
|
|
108
117
|
}
|
|
@@ -117,6 +126,9 @@ function stamp(message) {
|
|
|
117
126
|
function logLine(...args) {
|
|
118
127
|
console.error(stamp(format(...args)));
|
|
119
128
|
}
|
|
129
|
+
function printLine(text) {
|
|
130
|
+
console.log(text);
|
|
131
|
+
}
|
|
120
132
|
var init_log = __esm({
|
|
121
133
|
"src/log.ts"() {
|
|
122
134
|
"use strict";
|
|
@@ -265,6 +277,7 @@ var init_launchd = __esm({
|
|
|
265
277
|
constructor(deps) {
|
|
266
278
|
this.deps = deps;
|
|
267
279
|
}
|
|
280
|
+
deps;
|
|
268
281
|
plistPath(label) {
|
|
269
282
|
return join10(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
270
283
|
}
|
|
@@ -349,6 +362,7 @@ var init_systemd = __esm({
|
|
|
349
362
|
constructor(deps) {
|
|
350
363
|
this.deps = deps;
|
|
351
364
|
}
|
|
365
|
+
deps;
|
|
352
366
|
unitPath(label) {
|
|
353
367
|
return join11(this.deps.home, ".config", "systemd", "user", `${label}.service`);
|
|
354
368
|
}
|
|
@@ -435,7 +449,17 @@ function labelFor(env) {
|
|
|
435
449
|
}
|
|
436
450
|
function maybeRunServiceSubcommand(argv, env, deps) {
|
|
437
451
|
const cmd = argv[2];
|
|
438
|
-
if (!cmd
|
|
452
|
+
if (!cmd) return false;
|
|
453
|
+
if (!SERVICE_CMDS.has(cmd)) {
|
|
454
|
+
const looksLikeToken = cmd.startsWith("av_tok_");
|
|
455
|
+
const looksLikeFlag = cmd.startsWith("-");
|
|
456
|
+
if (!looksLikeToken && !looksLikeFlag) {
|
|
457
|
+
throw new Error(
|
|
458
|
+
`unknown subcommand: ${cmd} \u2014 expected one of ${[...SERVICE_CMDS].join(", ")}, an invite token, or no argument at all`
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
439
463
|
const backend = deps?.backend ?? selectBackend(process.platform);
|
|
440
464
|
const entrypoint = deps?.entrypoint ?? process.argv[1];
|
|
441
465
|
const log = deps?.log ?? ((m2) => logLine("[grok-bridge] " + m2));
|
|
@@ -456,7 +480,7 @@ function maybeRunServiceSubcommand(argv, env, deps) {
|
|
|
456
480
|
path: env.PATH ?? ""
|
|
457
481
|
});
|
|
458
482
|
backend.install(spec);
|
|
459
|
-
log(`installed service ${spec.label} \u2014 logs: ${spec.
|
|
483
|
+
log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
|
|
460
484
|
log(`check it with: agentvault-grok-bridge status`);
|
|
461
485
|
} else if (cmd === "uninstall") {
|
|
462
486
|
const label = labelFor(env);
|
|
@@ -590,7 +614,7 @@ import { spawn } from "node:child_process";
|
|
|
590
614
|
import { mkdirSync as mkdirSync5 } from "node:fs";
|
|
591
615
|
import { join as join13 } from "node:path";
|
|
592
616
|
|
|
593
|
-
//
|
|
617
|
+
// ../plugin/dist/index.js
|
|
594
618
|
import * as nc from "node:crypto";
|
|
595
619
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
596
620
|
import { readdir, readFile, rename, rm } from "node:fs/promises";
|
|
@@ -861,7 +885,7 @@ var init_libsodium_sumo = __esm2({
|
|
|
861
885
|
}, Module: function(binary) {
|
|
862
886
|
}, Instance: function(module2, info) {
|
|
863
887
|
this.exports = // EMSCRIPTEN_START_ASM
|
|
864
|
-
function instantiate(ea2) {
|
|
888
|
+
(function instantiate(ea2) {
|
|
865
889
|
var a2;
|
|
866
890
|
var b2 = new Uint8Array(123);
|
|
867
891
|
for (var c2 = 25; c2 >= 0; --c2) {
|
|
@@ -40656,7 +40680,7 @@ var init_libsodium_sumo = __esm2({
|
|
|
40656
40680
|
} } }), f: yi, g: ma2, h: Ba2, i: ma2, j: ka2, k: Le2, l: Je2, m: zg, n: yg, o: xg, p: wg, q: ka2, r: Ba2, s: ka2, t: ka2, u: Le2, v: ra2, w: vg, x: ug, y: tg, z: sg, A: Ba2, B: rg, C: qg, D: pg, E: ng, F: mg, G: lg, H: kg, I: jg, J: ka2, K: Ce2, L: Ba2, M: ma2, N: Ta2, O: ra2, P: ka2, Q: Oa2, R: Ba2, S: ma2, T: Ta2, U: ra2, V: ig, W: hg, X: gg, Y: fg, Z: ka2, _: Ma2, $: Ba2, aa: ma2, ba: Ta2, ca: ra2, da: ka2, ea: ka2, fa: Kg, ga: wd, ha: vd, ia: ra2, ja: ka2, ka: ka2, la: Cb, ma: ra2, na: Xa2, oa: eg, pa: qb, qa: dg, ra: cg, sa: ua2, ta: ka2, ua: Dc, va: ra2, wa: Va2, xa: ud, ya: Ya2, za: bg, Aa: ag, Ba: ka2, Ca: ka2, Da: Dc, Ea: ra2, Fa: ze2, Ga: ud, Ha: Ng, Ia: wd, Ja: vd, Ka: ka2, La: ka2, Ma: ka2, Na: ka2, Oa: Ma2, Pa: ka2, Qa: ma2, Ra: ma2, Sa: Ta2, Ta: dh2, Ua: ch, Va: bh, Wa: ah, Xa: Lb, Ya: Kb, Za: td, _a: sd, $a: rd, ab: $f, bb: _f, cb: Zf, db: qd, eb: Yf, fb: pd, gb: Xf, hb: Wf, ib: Uf, jb: Md, kb: tc, lb: nb, mb, nb: Lb, ob: Kb, pb: td, qb: sd, rb: ka2, sb: ka2, tb: ka2, ub: ka2, vb: Ma2, wb: ka2, xb: ma2, yb: ma2, zb: Ta2, Ab: Aa2, Bb: ka2, Cb: ma2, Db: ka2, Eb: ma2, Fb: Sa2, Gb: ka2, Hb: ma2, Ib: ka2, Jb: ma2, Kb: vb, Lb: ua2, Mb: ma2, Nb: ka2, Ob: ma2, Pb: ub, Qb: ua2, Rb: ma2, Sb: ka2, Tb: ma2, Ub: tb, Vb: ua2, Wb: ma2, Xb: ka2, Yb: ma2, Zb: ma2, _b: ua2, $b: ka2, ac: ma2, bc: ua2, cc: ka2, dc: Nd, ec: pe2, fc: od, gc: fh, hc: nd, ic: eh, jc: ra2, kc: ma2, lc: ua2, mc: ka2, nc: ma2, oc: ua2, pc: ka2, qc: ma2, rc: ma2, sc: pe2, tc: ra2, uc: od, vc: Tf, wc: Ja2, xc: xh, yc: nd, zc: Ia2, Ac: ua2, Bc: md, Cc: Lg, Dc: ka2, Ec: Ag, Fc: Ub, Gc: Sf, Hc: Ua2, Ic: Rf, Jc: ua2, Kc: Cb, Lc: Za2, Mc: ic, Nc: Ca2, Oc: md, Pc: ma2, Qc: ua2, Rc: Oa2, Sc: ka2, Tc: ld, Uc: Nd, Vc: ma2, Wc: ua2, Xc: Oa2, Yc: ka2, Zc: ld, _c: ra2, $c: Gh, ad: Fh, bd: Eh, cd: Dh, dd: ra2, ed: Ch, fd: ka2, gd: Ba2, hd: Bh, id: Cb, jd: ze2, kd: hi, ld: gi, md: fi, nd: ei, od: di, pd: ua2, qd: Ba2, rd: ci, sd: Dc, td: Gg, ud: nb, vd: Fg, wd: Eg, xd: ka2, yd: ka2, zd: ka2, Ad: ka2, Bd: Dg, Cd: Rc, Dd: ma2, Ed: ka2, Fd: kd, Gd: jd, Hd: Sg, Id: id, Jd: Rg, Kd: Qg, Ld: ra2, Md: kd, Nd: jd, Od: Ga2, Pd: id, Qd: Fa2, Rd: ma2, Sd: ka2, Td: Rc, Ud: ra2, Vd: Db, Wd: ma2, Xd: wa2, Yd: Ba2, Zd: wa2, _d: ma2, $d: yc, ae: wh, be: Vb, ce: wa2, de: xc, ee: wc, fe: vc, ge: me2, he: vh, ie: uh, je: Oa2, ke: th, le: Pf, me: Of, ne: Nf, oe: Mf, pe: Lf, qe: fb, re: ma2, se: wa2, te: Ba2, ue: wa2, ve: ma2, we: yc, xe: fe2, ye: Db, ze: wa2, Ae: xc, Be: wc, Ce: fb, De: ee2, Ee: Vb, Fe: de2, Ge: vc, He: uc, Ie: Kf, Je: hd, Ke: Jf, Le: Db, Me: fb, Ne: fb, Oe: ma2, Pe: wa2, Qe: Ba2, Re: wa2, Se: ma2, Te: yc, Ue: fe2, Ve: Db, We: wa2, Xe: xc, Ye: wc, Ze: fb, _e: ee2, $e: Vb, af: de2, bf: vc, cf: uc, df: Hf, ef: hd, ff: Gf, gf: Ff, hf: Ef, jf: sh, kf: Jg, lf: Ig, mf: Hg, nf: ka2, of: ka2, pf: Ea2, qf: wb, rf: ka2, sf: ka2, tf: ka2, uf: Ma2, vf: ka2, wf: ma2, xf: ma2, yf: Ta2, zf: Mg, Af: Lb, Bf: Kb, Cf: ra2, Df: rd, Ef: Df, Ff: qd, Gf: pd, Hf: Lb, If: Kb, Jf: ka2, Kf: Ma2, Lf: ka2, Mf: ma2, Nf: ma2, Of: Ta2, Pf: ra2, Qf: ra2, Rf: Mh, Sf: Lh, Tf: Kh, Uf: Cf, Vf: Bf, Wf: Jh, Xf: Ih, Yf: Ma2, Zf: ka2, _f: Hh, $f: Ba2, ag: Db, bg: fb, cg: Vb, dg: Oa2, eg: ma2, fg: Tg, gg: gd, hg: Je2, ig: Oa2, jg: ma2, kg: gd, lg: Cb, mg: ua2, ng: ka2, og: ka2, pg: ua2, qg: Wd, rg: lh, sg: kh, tg: jh, ug: fd, vg: ed, wg: dd, xg: cd, yg: ih, zg: ic, Ag: hh, Bg: gh, Cg: Cb, Dg: ua2, Eg: ka2, Fg: ka2, Gg: ua2, Hg: Wd, Ig: nh, Jg: mh, Kg: Vd, Lg: ic, Mg: Ud, Ng: Td, Og: Yd, Pg: Xd, Qg: ph, Rg: oh, Sg: cd, Tg: ed, Ug: dd, Vg: fd, Wg: ka2, Xg: Oa2, Yg: wa2, Zg: ka2, _g: Ce2, $g: wa2, ah: zf, bh: yf, ch: xf, dh: wf, eh: vf, fh: uf, gh: ra2, hh: ra2, ih: ka2, jh: Ma2, kh: wa2, lh: qh, mh: bd, nh: ad, oh: ra2, ph: ka2, qh: Oa2, rh: wa2, sh: tf, th: sf, uh: rf, vh: ra2, wh: bd, xh: qf, yh: ad, zh: ka2, Ah: Ma2, Bh: wa2, Ch: ra2, Dh: ma2, Eh: ka2, Fh: ua2, Gh: db, Hh: kb, Ih: xd, Jh: oi, Kh: ni, Lh: Ae2, Mh: mi, Nh: za2, Oh: li, Ph: ka2, Qh: ki, Rh: pf, Sh: Ah, Th: zh, Uh: yh, Vh: Bc, Wh: Ac, Xh: ti, Yh: ji, Zh: ii, _h: Cg, $h: Bg, ai: fb, bi: Ba2, ci: tc, di: nb, ei: rh, fi: $c, gi: of, hi: nf, ii: mf, ji: _c, ki: lf, li: Yc, mi: kf, ni: ka2, oi: ka2, pi: ka2, qi: ka2, ri: Ma2, si: ma2, ti: Ta2, ui: jf, vi: hf, wi: Md, xi: bi, yi: ai, zi: $h, Ai: _h, Bi: Zh, Ci: ye2, Di: xe2, Ei: we2, Fi: ve2, Gi: ue2, Hi: te2, Ii: se2, Ji: re2, Ki: ka2, Li: ua2, Mi: ka2, Ni: ua2, Oi: ka2, Pi: Yh, Qi: Xh, Ri: Wh, Si: Vh, Ti: Uh, Ui: Th, Vi: Sh, Wi: Rh, Xi: Qh, Yi: Ph, Zi: Oh, _i: re2, $i: Nh, aj: ka2, bj: ua2, cj: ua2, dj: ka2, ej: gf, fj: ma2, gj: wa2, hj: Ba2, ij: wa2, jj: ka2, kj: $g, lj: _g, mj: Zg, nj: wa2, oj: Ed, pj: wa2, qj: Yg, rj: Ed, sj: me2, tj: uc, uj: ff, vj: ef, wj: df, xj: cf, yj: Xg, zj: Wg, Aj: Vg, Bj: Ug, Cj: ka2, Dj: ka2, Ej: Pg, Fj: Og, Gj: ka2, Hj: ka2, Ij: $c, Jj: bf, Kj: _c, Lj: Yc, Mj: ka2, Nj: Ma2, Oj: ma2, Pj: Ta2, Qj: ma2, Rj: ma2, Sj: af, Tj: $e2, Uj: _e2, Vj: ka2, Wj: Oa2, Xj: wa2, Yj: ra2, Zj: Ze2, _j: Ye2, $j: ka2, ak: Oa2, bk: wa2, ck: ra2, dk: ka2, ek: Ma2, fk: wa2, gk: Xe2, hk: We2, ik: Ve2, jk: ra2, kk: Da2, lk: ta2 };
|
|
40657
40681
|
}
|
|
40658
40682
|
return da2(ea2);
|
|
40659
|
-
}(info);
|
|
40683
|
+
})(info);
|
|
40660
40684
|
}, instantiate: function(binary, info) {
|
|
40661
40685
|
return { then: function(ok) {
|
|
40662
40686
|
var module2 = new WebAssembly2.Module(binary);
|
|
@@ -70067,7 +70091,8 @@ ${messageText}`;
|
|
|
70067
70091
|
const candidateCount = candidates.filter(Boolean).length;
|
|
70068
70092
|
const joined = await joinWithFirstMatchingKp(welcomeBytes, candidates);
|
|
70069
70093
|
if (!joined) {
|
|
70070
|
-
console.error(`[SecureChannel] No matching KeyPackage found for Welcome \u2014 cannot join group ${groupId?.slice(0, 8)}. The Welcome is encrypted to a published KP's public key; none of our ${candidateCount} candidate bundle(s) decrypted it.
|
|
70094
|
+
console.error(`[SecureChannel] No matching KeyPackage found for Welcome \u2014 cannot join group ${groupId?.slice(0, 8)}. The Welcome is encrypted to a published KP's public key; none of our ${candidateCount} candidate bundle(s) decrypted it. Requesting a re-Welcome with a fresh KeyPackage.`);
|
|
70095
|
+
if (groupId) void this._requestWelcomeSelfHeal(groupId);
|
|
70071
70096
|
return;
|
|
70072
70097
|
}
|
|
70073
70098
|
const mgr = joined.mgr;
|
|
@@ -81231,7 +81256,7 @@ function _stringbool(Classes, _params) {
|
|
|
81231
81256
|
type: "pipe",
|
|
81232
81257
|
in: stringSchema,
|
|
81233
81258
|
out: booleanSchema,
|
|
81234
|
-
transform: (input, payload) => {
|
|
81259
|
+
transform: ((input, payload) => {
|
|
81235
81260
|
let data = input;
|
|
81236
81261
|
if (params.case !== "sensitive")
|
|
81237
81262
|
data = data.toLowerCase();
|
|
@@ -81250,14 +81275,14 @@ function _stringbool(Classes, _params) {
|
|
|
81250
81275
|
});
|
|
81251
81276
|
return {};
|
|
81252
81277
|
}
|
|
81253
|
-
},
|
|
81254
|
-
reverseTransform: (input, _payload) => {
|
|
81278
|
+
}),
|
|
81279
|
+
reverseTransform: ((input, _payload) => {
|
|
81255
81280
|
if (input === true) {
|
|
81256
81281
|
return truthyArray[0] || "true";
|
|
81257
81282
|
} else {
|
|
81258
81283
|
return falsyArray[0] || "false";
|
|
81259
81284
|
}
|
|
81260
|
-
},
|
|
81285
|
+
}),
|
|
81261
81286
|
error: params.error
|
|
81262
81287
|
});
|
|
81263
81288
|
return codec2;
|
|
@@ -82313,10 +82338,10 @@ var init_schemas2 = __esm2({
|
|
|
82313
82338
|
inst.with = inst.check;
|
|
82314
82339
|
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
82315
82340
|
inst.brand = () => inst;
|
|
82316
|
-
inst.register = (reg, meta3) => {
|
|
82341
|
+
inst.register = ((reg, meta3) => {
|
|
82317
82342
|
reg.add(inst, meta3);
|
|
82318
82343
|
return inst;
|
|
82319
|
-
};
|
|
82344
|
+
});
|
|
82320
82345
|
inst.apply = (fn) => fn(inst);
|
|
82321
82346
|
});
|
|
82322
82347
|
ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
@@ -83402,10 +83427,10 @@ var init_schemas3 = __esm2({
|
|
|
83402
83427
|
inst.with = inst.check;
|
|
83403
83428
|
inst.clone = (def2, params) => clone(inst, def2, params);
|
|
83404
83429
|
inst.brand = () => inst;
|
|
83405
|
-
inst.register = (reg, meta3) => {
|
|
83430
|
+
inst.register = ((reg, meta3) => {
|
|
83406
83431
|
reg.add(inst, meta3);
|
|
83407
83432
|
return inst;
|
|
83408
|
-
};
|
|
83433
|
+
});
|
|
83409
83434
|
inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
|
|
83410
83435
|
inst.safeParse = (data, params) => safeParse3(inst, data, params);
|
|
83411
83436
|
inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
|
|
@@ -84067,11 +84092,13 @@ function assertCompleteRequestPrompt(request) {
|
|
|
84067
84092
|
if (request.params.ref.type !== "ref/prompt") {
|
|
84068
84093
|
throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
|
|
84069
84094
|
}
|
|
84095
|
+
void request;
|
|
84070
84096
|
}
|
|
84071
84097
|
function assertCompleteRequestResourceTemplate(request) {
|
|
84072
84098
|
if (request.params.ref.type !== "ref/resource") {
|
|
84073
84099
|
throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
|
|
84074
84100
|
}
|
|
84101
|
+
void request;
|
|
84075
84102
|
}
|
|
84076
84103
|
var LATEST_PROTOCOL_VERSION;
|
|
84077
84104
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
|
|
@@ -98234,6 +98261,8 @@ var GrokSession = class {
|
|
|
98234
98261
|
this.driver = driver2;
|
|
98235
98262
|
this.opts = opts;
|
|
98236
98263
|
}
|
|
98264
|
+
driver;
|
|
98265
|
+
opts;
|
|
98237
98266
|
queue = [];
|
|
98238
98267
|
running = false;
|
|
98239
98268
|
/** The message whose turn is in flight, or null between turns. Null is a
|
|
@@ -98346,6 +98375,9 @@ var AcpChildDied = class extends Error {
|
|
|
98346
98375
|
this.signal = signal;
|
|
98347
98376
|
this.name = "AcpChildDied";
|
|
98348
98377
|
}
|
|
98378
|
+
method;
|
|
98379
|
+
code;
|
|
98380
|
+
signal;
|
|
98349
98381
|
};
|
|
98350
98382
|
var AcpTimeout = class extends Error {
|
|
98351
98383
|
constructor(method, ms) {
|
|
@@ -98354,6 +98386,8 @@ var AcpTimeout = class extends Error {
|
|
|
98354
98386
|
this.ms = ms;
|
|
98355
98387
|
this.name = "AcpTimeout";
|
|
98356
98388
|
}
|
|
98389
|
+
method;
|
|
98390
|
+
ms;
|
|
98357
98391
|
};
|
|
98358
98392
|
var AcpConnection = class {
|
|
98359
98393
|
constructor(child, opts) {
|
|
@@ -98371,6 +98405,7 @@ var AcpConnection = class {
|
|
|
98371
98405
|
this.stdinErrors++;
|
|
98372
98406
|
});
|
|
98373
98407
|
}
|
|
98408
|
+
child;
|
|
98374
98409
|
nextId = 1;
|
|
98375
98410
|
pending = /* @__PURE__ */ new Map();
|
|
98376
98411
|
/** Undecoded leftover. Decode UTF-8 only on complete lines so a 4-byte
|
|
@@ -98553,6 +98588,8 @@ var GrokDriver = class {
|
|
|
98553
98588
|
this.acp.onNotification((method, params) => this.onNotification(method, params));
|
|
98554
98589
|
this.acp.onRequest((method, params) => this.onAgentRequest(method, params));
|
|
98555
98590
|
}
|
|
98591
|
+
child;
|
|
98592
|
+
opts;
|
|
98556
98593
|
acp;
|
|
98557
98594
|
session = null;
|
|
98558
98595
|
/** State for the turn currently in flight. Null between turns, so a late
|
|
@@ -99044,6 +99081,47 @@ async function main() {
|
|
|
99044
99081
|
})) {
|
|
99045
99082
|
process.exit(process.exitCode ?? 0);
|
|
99046
99083
|
}
|
|
99084
|
+
const info = parseInfoFlags(process.argv.slice(2));
|
|
99085
|
+
if (info.showVersion || info.showHelp) {
|
|
99086
|
+
const version2 = buildClientVersion2(
|
|
99087
|
+
true ? "0.2.1" : void 0
|
|
99088
|
+
);
|
|
99089
|
+
if (info.showVersion) printLine(version2);
|
|
99090
|
+
if (info.showHelp) {
|
|
99091
|
+
printLine(
|
|
99092
|
+
[
|
|
99093
|
+
"",
|
|
99094
|
+
`${version2}`,
|
|
99095
|
+
"",
|
|
99096
|
+
" Bridges a Grok agent into E2E-encrypted AgentVault DMs and rooms.",
|
|
99097
|
+
"",
|
|
99098
|
+
"USAGE",
|
|
99099
|
+
" agentvault-grok-bridge [<invite-token>] [--install]",
|
|
99100
|
+
" agentvault-grok-bridge <install|uninstall|restart|status|logs>",
|
|
99101
|
+
"",
|
|
99102
|
+
"FLAGS",
|
|
99103
|
+
" --install Enrol, install a supervised OS service, then EXIT so",
|
|
99104
|
+
" your terminal returns. Requires a global install:",
|
|
99105
|
+
" npm i -g @agentvault/grok-bridge",
|
|
99106
|
+
" --version, -v Print the version.",
|
|
99107
|
+
" --help, -h Print this.",
|
|
99108
|
+
"",
|
|
99109
|
+
"ENV",
|
|
99110
|
+
" AV_AGENT_NAME The agent's AgentVault name. Required.",
|
|
99111
|
+
" AV_INVITE_TOKEN First enrolment only; a saved data dir reconnects without it.",
|
|
99112
|
+
" AV_DATA_DIR Credential/state dir. Defaults per agent.",
|
|
99113
|
+
"",
|
|
99114
|
+
"NOTES",
|
|
99115
|
+
" Run `grok login` first. XAI_API_KEY from your shell is NOT inherited by a",
|
|
99116
|
+
" supervised service, so --install refuses rather than run mute.",
|
|
99117
|
+
" To restart later use `restart`, never `install` \u2014 install re-bakes the",
|
|
99118
|
+
" service from your current shell and drops env from the original install.",
|
|
99119
|
+
""
|
|
99120
|
+
].join("\n")
|
|
99121
|
+
);
|
|
99122
|
+
}
|
|
99123
|
+
process.exit(0);
|
|
99124
|
+
}
|
|
99047
99125
|
const cfg = loadConfig(process.env, process.argv.slice(2));
|
|
99048
99126
|
if (cfg.installAfterEnroll) {
|
|
99049
99127
|
assertInstallableEntrypoint(process.argv[1]);
|
|
@@ -99064,7 +99142,7 @@ async function main() {
|
|
|
99064
99142
|
agentName: cfg.agentName,
|
|
99065
99143
|
platform: "node",
|
|
99066
99144
|
clientVersion: buildClientVersion2(
|
|
99067
|
-
true ? "0.2.
|
|
99145
|
+
true ? "0.2.1" : void 0
|
|
99068
99146
|
)
|
|
99069
99147
|
});
|
|
99070
99148
|
channelRef = channel;
|
package/dist/log.d.ts
CHANGED
|
@@ -19,4 +19,16 @@ export declare function stamp(message: string): string;
|
|
|
19
19
|
* just anchored to a clock.
|
|
20
20
|
*/
|
|
21
21
|
export declare function logLine(...args: unknown[]): void;
|
|
22
|
+
/**
|
|
23
|
+
* Plain stdout, no timestamp. For CLI answers a human or a script reads —
|
|
24
|
+
* `--version` and `--help` — not for daemon logging.
|
|
25
|
+
*
|
|
26
|
+
* `logLine` stamps every line and writes to stderr, which is right for a daemon
|
|
27
|
+
* and wrong here: `agentvault-grok-bridge --version` must print a version, not a
|
|
28
|
+
* version wearing a date. Anything a script would parse belongs on stdout.
|
|
29
|
+
*
|
|
30
|
+
* This lives in log.ts because the "no bare console sinks" guard test excludes
|
|
31
|
+
* only this file — the sink belongs here, and nowhere else.
|
|
32
|
+
*/
|
|
33
|
+
export declare function printLine(text: string): void;
|
|
22
34
|
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subcommand.d.ts","sourceRoot":"","sources":["../../src/service/subcommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAQD;;uFAEuF;AACvF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"subcommand.d.ts","sourceRoot":"","sources":["../../src/service/subcommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAQD;;uFAEuF;AACvF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAoFT"}
|
package/package.json
CHANGED