@agentvault/claude-bridge 0.8.31 → 0.8.32
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 +5 -5
- package/dist/index.js +57 -3
- package/dist/info-flags.d.ts +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ room automatically.
|
|
|
10
10
|
### Recommended — env var form (safe, not visible via `ps`)
|
|
11
11
|
|
|
12
12
|
```sh
|
|
13
|
-
AV_INVITE_TOKEN=av_tok_… npx @agentvault/claude-bridge
|
|
13
|
+
AV_AGENT_NAME=<agent-name> AV_INVITE_TOKEN=av_tok_… npx @agentvault/claude-bridge
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Because the token is in the environment rather than in the process argument
|
|
@@ -20,7 +20,7 @@ Prefer this form, especially on shared machines.
|
|
|
20
20
|
### Convenience — positional arg form
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
npx @agentvault/claude-bridge av_tok_…
|
|
23
|
+
AV_AGENT_NAME=<agent-name> npx @agentvault/claude-bridge av_tok_…
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
> **Security caveat:** the token is visible to other local users via `ps` and
|
|
@@ -32,10 +32,10 @@ npx @agentvault/claude-bridge av_tok_…
|
|
|
32
32
|
|
|
33
33
|
| Variable | Default | Description |
|
|
34
34
|
|---|---|---|
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
35
|
+
| `AV_AGENT_NAME` | *(required)* | Your agent's AgentVault name. It also picks where this agent's credentials live |
|
|
36
|
+
| `AV_INVITE_TOKEN` | *(first run only)* | Invite token (preferred over the positional arg). A saved data dir reconnects without it |
|
|
37
|
+
| `AV_DATA_DIR` | `~/.agentvault/claude-room-bridge/<agent-name>` | Local state directory for MLS keys and session data |
|
|
37
38
|
| `AV_API_URL` | `https://api.agentvault.chat` | AgentVault API base URL |
|
|
38
|
-
| `AV_AGENT_NAME` | `CClaude` | Display name shown in the room roster |
|
|
39
39
|
| `AV_ROOM_ID` | *(all rooms)* | Restrict replies to a specific room UUID |
|
|
40
40
|
|
|
41
41
|
## Authentication
|
package/dist/index.js
CHANGED
|
@@ -11735,7 +11735,7 @@ function ownIdentity() {
|
|
|
11735
11735
|
return `${PACKAGE}@${v22}`;
|
|
11736
11736
|
}
|
|
11737
11737
|
function buildSha() {
|
|
11738
|
-
const raw = true ? "
|
|
11738
|
+
const raw = true ? "a0d3eeb" : "";
|
|
11739
11739
|
const cleaned = (raw ?? "").trim();
|
|
11740
11740
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
11741
11741
|
}
|
|
@@ -146044,7 +146044,61 @@ function identityPrompt(agentName) {
|
|
|
146044
146044
|
|
|
146045
146045
|
// src/index.ts
|
|
146046
146046
|
init_log();
|
|
146047
|
+
|
|
146048
|
+
// src/info-flags.ts
|
|
146049
|
+
var VERSION_FLAGS = ["--version", "-v"];
|
|
146050
|
+
var HELP_FLAGS = ["--help", "-h"];
|
|
146051
|
+
function bridgeVersion(version3) {
|
|
146052
|
+
return `@agentvault/claude-bridge@${version3 ?? "dev"}`;
|
|
146053
|
+
}
|
|
146054
|
+
function helpText(version3) {
|
|
146055
|
+
return [
|
|
146056
|
+
"",
|
|
146057
|
+
version3,
|
|
146058
|
+
"",
|
|
146059
|
+
" Bridges a Claude agent into E2E-encrypted AgentVault DMs and rooms.",
|
|
146060
|
+
"",
|
|
146061
|
+
"USAGE",
|
|
146062
|
+
" agentvault-claude-bridge [<invite-token>]",
|
|
146063
|
+
" agentvault-claude-bridge <install|uninstall|restart|status|logs>",
|
|
146064
|
+
" agentvault-claude-bridge doctor",
|
|
146065
|
+
"",
|
|
146066
|
+
"FLAGS",
|
|
146067
|
+
" --version, -v Print the version.",
|
|
146068
|
+
" --help, -h Print this.",
|
|
146069
|
+
"",
|
|
146070
|
+
"ENV",
|
|
146071
|
+
" AV_AGENT_NAME The agent's AgentVault name. Required.",
|
|
146072
|
+
" AV_INVITE_TOKEN First enrolment only; a saved data dir reconnects without it.",
|
|
146073
|
+
" AV_DATA_DIR Credential/state dir. Defaults per agent.",
|
|
146074
|
+
" AV_ROOM_ID Only answer in this room.",
|
|
146075
|
+
"",
|
|
146076
|
+
"NOTES",
|
|
146077
|
+
" Sign in to Claude on this machine first; ANTHROPIC_API_KEY is the fallback.",
|
|
146078
|
+
" To restart later use `restart`, never `install`.",
|
|
146079
|
+
""
|
|
146080
|
+
].join("\n");
|
|
146081
|
+
}
|
|
146082
|
+
function answerInfoFlags(argv, version3, print) {
|
|
146083
|
+
const first = argv[2];
|
|
146084
|
+
if (!first) return false;
|
|
146085
|
+
const label = bridgeVersion(version3);
|
|
146086
|
+
if (VERSION_FLAGS.includes(first)) {
|
|
146087
|
+
print(label);
|
|
146088
|
+
return true;
|
|
146089
|
+
}
|
|
146090
|
+
if (HELP_FLAGS.includes(first)) {
|
|
146091
|
+
print(helpText(label));
|
|
146092
|
+
return true;
|
|
146093
|
+
}
|
|
146094
|
+
return false;
|
|
146095
|
+
}
|
|
146096
|
+
|
|
146097
|
+
// src/index.ts
|
|
146047
146098
|
async function main() {
|
|
146099
|
+
if (answerInfoFlags(process.argv, true ? "0.8.32" : void 0, printLine)) {
|
|
146100
|
+
process.exit(0);
|
|
146101
|
+
}
|
|
146048
146102
|
if (process.argv[2] === "recovery" && await (await init_recovery().then(() => recovery_exports)).maybeRunRecoverySubcommand()) {
|
|
146049
146103
|
process.exit(process.exitCode ?? 0);
|
|
146050
146104
|
}
|
|
@@ -146070,7 +146124,7 @@ async function main() {
|
|
|
146070
146124
|
"[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
|
|
146071
146125
|
);
|
|
146072
146126
|
}
|
|
146073
|
-
logLine(`[bridge] version: ${true ? "0.8.
|
|
146127
|
+
logLine(`[bridge] version: ${true ? "0.8.32" : "dev"}`);
|
|
146074
146128
|
logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
|
|
146075
146129
|
logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
|
|
146076
146130
|
if (cfg.armRoom) {
|
|
@@ -146102,7 +146156,7 @@ async function main() {
|
|
|
146102
146156
|
// its default would render "@agentvault/agentvault@0.7.x" — the wrong
|
|
146103
146157
|
// package name attached to the bridge's version number, which is worse
|
|
146104
146158
|
// than either alone.
|
|
146105
|
-
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.
|
|
146159
|
+
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.32" : "dev"}`
|
|
146106
146160
|
});
|
|
146107
146161
|
const agentSystemPrompt = cfg.systemPrompt ?? identityPrompt(cfg.agentName);
|
|
146108
146162
|
const deviceJwt = () => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1512 — `--help` and `--version` answer WITHOUT an agent name.
|
|
3
|
+
*
|
|
4
|
+
* Every other path through index.ts resolves the data dir first, and that
|
|
5
|
+
* refuses a missing AV_AGENT_NAME (#921) — correct for running the bridge, but
|
|
6
|
+
* a new user's first command is usually `--help`, and it read like a crash.
|
|
7
|
+
* The Muse and Grok bridges already answer these before any config.
|
|
8
|
+
*
|
|
9
|
+
* Only when the FIRST argument is one of these flags: `install --help` and the
|
|
10
|
+
* other subcommands keep their own dispatch. Its own module (not index.ts) so a
|
|
11
|
+
* test can import it — index.ts runs main() at module scope.
|
|
12
|
+
*/
|
|
13
|
+
export declare const VERSION_FLAGS: readonly ["--version", "-v"];
|
|
14
|
+
export declare const HELP_FLAGS: readonly ["--help", "-h"];
|
|
15
|
+
export declare function bridgeVersion(version: string | undefined): string;
|
|
16
|
+
export declare function helpText(version: string): string;
|
|
17
|
+
/** Prints and returns true when argv (process.argv) opens with an info flag. */
|
|
18
|
+
export declare function answerInfoFlags(argv: string[], version: string | undefined, print: (text: string) => void): boolean;
|
|
19
|
+
//# sourceMappingURL=info-flags.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentvault/claude-bridge",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgentVault Claude Bridge — daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
|
|
6
6
|
"main": "dist/index.js",
|