@agentvault/muse-bridge 0.1.0
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 +42 -0
- package/dist/bridge.d.ts +83 -0
- package/dist/config.d.ts +36 -0
- package/dist/fence-auth.d.ts +14 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +98477 -0
- package/dist/log.d.ts +16 -0
- package/dist/muse-driver.d.ts +58 -0
- package/dist/muse-room-http.d.ts +31 -0
- package/dist/muse-room-mcp.d.ts +3 -0
- package/dist/muse-session.d.ts +48 -0
- package/dist/muse-spawn.d.ts +43 -0
- package/dist/service/backend.d.ts +35 -0
- package/dist/service/backend.d.ts.map +1 -0
- package/dist/service/launchd.d.ts +20 -0
- package/dist/service/launchd.d.ts.map +1 -0
- package/dist/service/launcher.d.ts +12 -0
- package/dist/service/launcher.d.ts.map +1 -0
- package/dist/service/spec.d.ts +21 -0
- package/dist/service/spec.d.ts.map +1 -0
- package/dist/service/subcommand.d.ts +11 -0
- package/dist/service/subcommand.d.ts.map +1 -0
- package/dist/service/systemd.d.ts +18 -0
- package/dist/service/systemd.d.ts.map +1 -0
- package/dist/settings-mcp.d.ts +9 -0
- package/dist/version.d.ts +5 -0
- package/package.json +41 -0
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix every line of `message` with an ISO-8601 UTC timestamp.
|
|
3
|
+
*
|
|
4
|
+
* Per-LINE, not per-call, on purpose: a multi-line stack must be stamped on
|
|
5
|
+
* every frame. UTC, not local — agent boxes run local time while the API/DB
|
|
6
|
+
* are UTC.
|
|
7
|
+
*/
|
|
8
|
+
export declare function stamp(message: string): string;
|
|
9
|
+
/** Write one stamped record to stderr. */
|
|
10
|
+
export declare function logLine(...args: unknown[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Plain stdout, no timestamp. For CLI answers a human or a script reads —
|
|
13
|
+
* `--version` and `--help` — not for daemon logging.
|
|
14
|
+
*/
|
|
15
|
+
export declare function printLine(text: string): void;
|
|
16
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type MuseProvider, type MuseSpawnEnv } from "./muse-spawn.js";
|
|
2
|
+
export type Flag = boolean | (() => boolean);
|
|
3
|
+
export interface MuseChild {
|
|
4
|
+
stdout?: {
|
|
5
|
+
on(event: "data", listener: (chunk: Buffer | string) => void): unknown;
|
|
6
|
+
} | null;
|
|
7
|
+
stderr?: {
|
|
8
|
+
on(event: "data", listener: (chunk: Buffer | string) => void): unknown;
|
|
9
|
+
} | null;
|
|
10
|
+
kill(signal?: NodeJS.Signals): boolean;
|
|
11
|
+
on(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
12
|
+
}
|
|
13
|
+
export type MuseSpawnFn = (command: string, args: readonly string[], options: {
|
|
14
|
+
cwd: string;
|
|
15
|
+
env: MuseSpawnEnv;
|
|
16
|
+
}) => MuseChild;
|
|
17
|
+
export interface MuseDriverOpts {
|
|
18
|
+
command: string;
|
|
19
|
+
path: string;
|
|
20
|
+
provider?: MuseProvider;
|
|
21
|
+
workspaceDir: string;
|
|
22
|
+
fenceHome: string;
|
|
23
|
+
apiKey?: string;
|
|
24
|
+
workAllowed: Flag;
|
|
25
|
+
gatesRemoved: Flag;
|
|
26
|
+
dataDir: string;
|
|
27
|
+
spawnFn?: MuseSpawnFn;
|
|
28
|
+
turnTimeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Per-wake `muse exec --json` child. Parses stdout JSONL; the turn ends on
|
|
32
|
+
* `run.terminal.*`. Exit 0 without a terminal event is still a failure.
|
|
33
|
+
*/
|
|
34
|
+
export declare class MuseDriver {
|
|
35
|
+
private readonly opts;
|
|
36
|
+
private readonly spawnFn;
|
|
37
|
+
private readonly turnTimeoutMs;
|
|
38
|
+
private persistedId;
|
|
39
|
+
private current;
|
|
40
|
+
private child;
|
|
41
|
+
private probed;
|
|
42
|
+
constructor(opts: MuseDriverOpts);
|
|
43
|
+
/** Load or create `<dataDir>/muse-session-id`. Does not spawn muse. */
|
|
44
|
+
start(): Promise<string>;
|
|
45
|
+
sessionId(): string | null;
|
|
46
|
+
runTurn(prompt: string): Promise<{
|
|
47
|
+
text: string;
|
|
48
|
+
spoke: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
noteSaid(_text: string): void;
|
|
51
|
+
stop(): Promise<void>;
|
|
52
|
+
/** SIGTERM, then SIGKILL if still alive after 2s. Does not fulfill runTurn. */
|
|
53
|
+
private escalateKill;
|
|
54
|
+
private executeTurn;
|
|
55
|
+
private probeUsable;
|
|
56
|
+
private execJsonl;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=muse-driver.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface RoomHttpTrace {
|
|
2
|
+
httpMethod: string;
|
|
3
|
+
accept: string | undefined;
|
|
4
|
+
hasSessionId: boolean;
|
|
5
|
+
rpcMethod?: string;
|
|
6
|
+
status: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RoomMcpServer {
|
|
9
|
+
/** JSON-RPC methods this listener has accepted, in order. Diagnostic only. */
|
|
10
|
+
seenMethods(): string[];
|
|
11
|
+
/** HTTP-level trace (methods, Accept, session header, status). Diagnostic only. */
|
|
12
|
+
seenHttp(): RoomHttpTrace[];
|
|
13
|
+
/** Full tokened URL to place in settings.json. TREAT AS A CREDENTIAL. */
|
|
14
|
+
url: string;
|
|
15
|
+
token: string;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Serve the room MCP over loopback, IN THIS PROCESS, as streamable HTTP.
|
|
20
|
+
*
|
|
21
|
+
* POST JSON-RPC; GET opens SSE if the client asks; notifications/initialized → 202.
|
|
22
|
+
* initialize issues Mcp-Session-Id; later POSTs without it are rejected.
|
|
23
|
+
*
|
|
24
|
+
* SECURITY. Any local process can reach a loopback port, so the path carries a
|
|
25
|
+
* random token and a mismatch is refused. Log the port only — never the token.
|
|
26
|
+
*/
|
|
27
|
+
export declare function startRoomMcpServer(opts: {
|
|
28
|
+
onSay: (text: string) => void;
|
|
29
|
+
log?: (m: string) => void;
|
|
30
|
+
}): Promise<RoomMcpServer>;
|
|
31
|
+
//# sourceMappingURL=muse-room-http.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface RoomSession {
|
|
2
|
+
push(text: string, reply?: (text: string) => Promise<void>, opts?: {
|
|
3
|
+
autoReplyOnText?: boolean;
|
|
4
|
+
replyExpected?: boolean;
|
|
5
|
+
}): void;
|
|
6
|
+
}
|
|
7
|
+
export interface DriverLike {
|
|
8
|
+
runTurn(prompt: string): Promise<{
|
|
9
|
+
text: string;
|
|
10
|
+
spoke: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serializes inbound messages onto MuseDriver.runTurn and routes the say back.
|
|
15
|
+
*
|
|
16
|
+
* Destination is captured PER MESSAGE. A room inbound arriving mid-compose
|
|
17
|
+
* cannot redirect a private 1:1 reply, because the newer message only becomes
|
|
18
|
+
* current when its own turn starts.
|
|
19
|
+
*/
|
|
20
|
+
export declare class MuseSession implements RoomSession {
|
|
21
|
+
private readonly driver;
|
|
22
|
+
private readonly opts;
|
|
23
|
+
private queue;
|
|
24
|
+
private running;
|
|
25
|
+
private current;
|
|
26
|
+
private saidThisTurn;
|
|
27
|
+
private drain;
|
|
28
|
+
constructor(driver: DriverLike, opts?: {
|
|
29
|
+
onSay?: (text: string) => Promise<void>;
|
|
30
|
+
log?: (m: string) => void;
|
|
31
|
+
identity?: string;
|
|
32
|
+
});
|
|
33
|
+
push(text: string, reply?: (text: string) => Promise<void>, opts?: {
|
|
34
|
+
autoReplyOnText?: boolean;
|
|
35
|
+
replyExpected?: boolean;
|
|
36
|
+
}): void;
|
|
37
|
+
sayHandler(): (text: string) => void;
|
|
38
|
+
idle(): Promise<void>;
|
|
39
|
+
private log;
|
|
40
|
+
private run;
|
|
41
|
+
/**
|
|
42
|
+
* Room/DM fallback only when this turn authorised a reply AND the model
|
|
43
|
+
* never called `say`. Echo provider payload.text is prefixed `echo:` — that
|
|
44
|
+
* is the prompt reflected, not a say. Never post it.
|
|
45
|
+
*/
|
|
46
|
+
private maybeFallback;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=muse-session.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type MuseProvider = "echo" | "meta";
|
|
2
|
+
export interface MuseSpawnOpts {
|
|
3
|
+
/** Binary from AV_MUSE_PATH or "muse". */
|
|
4
|
+
command: string;
|
|
5
|
+
/** Launcher install-time PATH. Required non-empty; never host PATH by default. */
|
|
6
|
+
path: string;
|
|
7
|
+
/** Gate 1 must pass "echo". Default "meta". */
|
|
8
|
+
provider?: MuseProvider;
|
|
9
|
+
sessionId: string;
|
|
10
|
+
workspaceDir: string;
|
|
11
|
+
fenceHome: string;
|
|
12
|
+
prompt: string;
|
|
13
|
+
/** Forwarded as META_API_KEY only when non-empty. */
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
workAllowed: boolean;
|
|
16
|
+
gatesRemoved: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface MuseSpawnEnv {
|
|
19
|
+
HOME: string;
|
|
20
|
+
XDG_CONFIG_HOME: string;
|
|
21
|
+
XDG_DATA_HOME: string;
|
|
22
|
+
XDG_STATE_HOME: string;
|
|
23
|
+
PATH: string;
|
|
24
|
+
META_API_KEY?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MuseSpawn {
|
|
27
|
+
command: string;
|
|
28
|
+
args: string[];
|
|
29
|
+
cwd: string;
|
|
30
|
+
env: MuseSpawnEnv;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Existence on PATH is not enough. A TUI-only stub has no --json / --session-id.
|
|
34
|
+
* Throws an operator sentence naming what the help text is missing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function assertMuseExec(helpText: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* One-shot `muse exec --json` argv + closed fence env.
|
|
39
|
+
* Never spread process.env (host HOME would leak). Never --no-session-log
|
|
40
|
+
* (--session-id requires retained logs). Prompt is last, after `--`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function museSpawnArgs(opts: MuseSpawnOpts): MuseSpawn;
|
|
43
|
+
//# sourceMappingURL=muse-spawn.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ServiceSpec } from "./spec.js";
|
|
2
|
+
export interface InstalledService {
|
|
3
|
+
label: string;
|
|
4
|
+
path: string;
|
|
5
|
+
env: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface ServiceBackend {
|
|
8
|
+
install(spec: ServiceSpec): void;
|
|
9
|
+
uninstall(label: string): void;
|
|
10
|
+
list(prefix: string): InstalledService[];
|
|
11
|
+
restart(label: string): void;
|
|
12
|
+
status(label: string): {
|
|
13
|
+
loaded: boolean;
|
|
14
|
+
detail: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface BackendDeps {
|
|
18
|
+
home: string;
|
|
19
|
+
uid: number;
|
|
20
|
+
user: string;
|
|
21
|
+
exec: (cmd: string, args: string[]) => {
|
|
22
|
+
code: number;
|
|
23
|
+
stdout: string;
|
|
24
|
+
};
|
|
25
|
+
writeFile: (path: string, data: string) => void;
|
|
26
|
+
mkdir: (path: string) => void;
|
|
27
|
+
chmod: (path: string, mode: number) => void;
|
|
28
|
+
rm: (path: string) => void;
|
|
29
|
+
exists: (path: string) => boolean;
|
|
30
|
+
readdir: (path: string) => string[];
|
|
31
|
+
readFile: (path: string) => string;
|
|
32
|
+
}
|
|
33
|
+
export declare function defaultDeps(): BackendDeps;
|
|
34
|
+
export declare function selectBackend(platform: NodeJS.Platform, deps?: BackendDeps): ServiceBackend;
|
|
35
|
+
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/service/backend.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED,wBAAgB,WAAW,IAAI,WAAW,CA6BzC;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,cAAc,CAQ3F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ServiceSpec } from "./spec.js";
|
|
2
|
+
import type { BackendDeps, ServiceBackend, InstalledService } from "./backend.js";
|
|
3
|
+
export declare function renderLaunchdPlist(spec: ServiceSpec): string;
|
|
4
|
+
export declare function parsePlistEnv(xml: string): Record<string, string>;
|
|
5
|
+
export declare class LaunchdBackend implements ServiceBackend {
|
|
6
|
+
private deps;
|
|
7
|
+
constructor(deps: BackendDeps);
|
|
8
|
+
private plistPath;
|
|
9
|
+
private domain;
|
|
10
|
+
install(spec: ServiceSpec): void;
|
|
11
|
+
private waitUntilGone;
|
|
12
|
+
restart(label: string): void;
|
|
13
|
+
uninstall(label: string): void;
|
|
14
|
+
status(label: string): {
|
|
15
|
+
loaded: boolean;
|
|
16
|
+
detail: string;
|
|
17
|
+
};
|
|
18
|
+
list(prefix: string): InstalledService[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=launchd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchd.d.ts","sourceRoot":"","sources":["../../src/service/launchd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUlF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAkC5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BjE;AAMD,qBAAa,cAAe,YAAW,cAAc;IACvC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC,OAAO,CAAC,SAAS;IAGjB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAiBhC,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAK1D,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE;CAczC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ServiceSpec } from "./spec.js";
|
|
2
|
+
import type { BackendDeps } from "./backend.js";
|
|
3
|
+
export declare const FALLBACK_NODES: string[];
|
|
4
|
+
/** Render the bash launcher the service actually execs. Pure string. */
|
|
5
|
+
export declare function renderLauncher(opts: {
|
|
6
|
+
installPath: string;
|
|
7
|
+
entrypoint: string;
|
|
8
|
+
fallbacks?: string[];
|
|
9
|
+
}): string;
|
|
10
|
+
export declare function writeLauncher(deps: BackendDeps, spec: ServiceSpec): void;
|
|
11
|
+
export declare function parseLauncherEntrypoint(script: string | undefined): string | undefined;
|
|
12
|
+
//# sourceMappingURL=launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/service/launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,cAAc,UAO1B,CAAC;AAUF,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,MAAM,CAgBT;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAIxE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKtF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BridgeConfig } from "../config.js";
|
|
2
|
+
export interface ServiceSpec {
|
|
3
|
+
label: string;
|
|
4
|
+
programArgs: string[];
|
|
5
|
+
launcherPath: string;
|
|
6
|
+
launcherScript: string;
|
|
7
|
+
env: Record<string, string>;
|
|
8
|
+
workingDir: string;
|
|
9
|
+
logOut: string;
|
|
10
|
+
logErr: string;
|
|
11
|
+
keepAliveUnlessCleanExit: boolean;
|
|
12
|
+
runAtLoad: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface BuildSpecOptions {
|
|
15
|
+
entrypoint: string;
|
|
16
|
+
home: string;
|
|
17
|
+
path: string;
|
|
18
|
+
}
|
|
19
|
+
/** Pure: BridgeConfig -> ServiceSpec. Secrets are excluded. */
|
|
20
|
+
export declare function buildServiceSpec(cfg: BridgeConfig, opts: BuildSpecOptions): ServiceSpec;
|
|
21
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/service/spec.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAuBvF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ServiceBackend } from "./backend.js";
|
|
2
|
+
export interface ServiceCmdDeps {
|
|
3
|
+
backend?: ServiceBackend;
|
|
4
|
+
entrypoint?: string;
|
|
5
|
+
log?: (msg: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function labelFor(env: NodeJS.ProcessEnv): string;
|
|
8
|
+
/** Handle `agentvault-muse-bridge <install|uninstall|status|logs>` before boot.
|
|
9
|
+
* Returns true when handled (caller should exit). `install` is not an invite token. */
|
|
10
|
+
export declare function maybeRunServiceSubcommand(argv: string[], env: NodeJS.ProcessEnv, deps?: ServiceCmdDeps): boolean;
|
|
11
|
+
//# sourceMappingURL=subcommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subcommand.d.ts","sourceRoot":"","sources":["../../src/service/subcommand.ts"],"names":[],"mappings":"AAIA,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;AAeD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAEvD;AAOD;wFACwF;AACxF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CA6DT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ServiceSpec } from "./spec.js";
|
|
2
|
+
import type { BackendDeps, ServiceBackend, InstalledService } from "./backend.js";
|
|
3
|
+
export declare function renderSystemdUnit(spec: ServiceSpec): string;
|
|
4
|
+
export declare function parseUnitEnv(text: string): Record<string, string>;
|
|
5
|
+
export declare class SystemdBackend implements ServiceBackend {
|
|
6
|
+
private deps;
|
|
7
|
+
constructor(deps: BackendDeps);
|
|
8
|
+
private unitPath;
|
|
9
|
+
install(spec: ServiceSpec): void;
|
|
10
|
+
restart(label: string): void;
|
|
11
|
+
uninstall(label: string): void;
|
|
12
|
+
status(label: string): {
|
|
13
|
+
loaded: boolean;
|
|
14
|
+
detail: string;
|
|
15
|
+
};
|
|
16
|
+
list(prefix: string): InstalledService[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=systemd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemd.d.ts","sourceRoot":"","sources":["../../src/service/systemd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAclF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAsB3D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWjE;AAQD,qBAAa,cAAe,YAAW,cAAc;IACvC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAYhC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAM1D,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE;CAczC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write the fenced Muse settings.json that points at this process's
|
|
3
|
+
* streamable-HTTP room listener. Replaces the whole object — never merges
|
|
4
|
+
* leftover host keys. The URL carries a path token; the file is 0600.
|
|
5
|
+
*/
|
|
6
|
+
export declare function writeFenceMcpSettings(fenceHome: string, opts: {
|
|
7
|
+
url: string;
|
|
8
|
+
}): void;
|
|
9
|
+
//# sourceMappingURL=settings-mcp.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentvault/muse-bridge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "AgentVault Muse Bridge — daemon bridging a Muse agent into E2E-encrypted AgentVault direct messages and rooms.",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"agentvault-muse-bridge": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"!dist/*.map"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "npm --prefix ../plugin run build && tsc --emitDeclarationOnly && node build.mjs",
|
|
21
|
+
"start": "node dist/index.js",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.test.json",
|
|
24
|
+
"prepublishOnly": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"ws": "^8.16.0",
|
|
28
|
+
"zod": "^4.3.6"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@agentvault/agentvault": "file:../plugin",
|
|
32
|
+
"esbuild": "^0.27.3",
|
|
33
|
+
"typescript": "^5.4.0",
|
|
34
|
+
"vitest": "^2.0.0",
|
|
35
|
+
"@types/node": "^20.0.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"license": "MIT"
|
|
41
|
+
}
|