@agentvault/claude-bridge 0.8.14 → 0.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge.d.ts +3 -0
- package/dist/index.js +46 -21
- package/package.json +1 -1
package/dist/bridge.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export interface RoomMessage {
|
|
|
3
3
|
roomId: string;
|
|
4
4
|
senderName: string;
|
|
5
5
|
plaintext: string;
|
|
6
|
+
/** #1223 — the text the sender typed, before any attachment was folded into
|
|
7
|
+
* `plaintext`. The @ gate reads this; absent on emitters < 0.23.42. */
|
|
8
|
+
caption?: string;
|
|
6
9
|
/** True when the sender is another agent (SecureChannel derives this from the
|
|
7
10
|
* room roster). Used to decide reply expectation: a human/owner speaking in a
|
|
8
11
|
* room always expects a reply; agent-authored traffic does not (the agent may
|
package/dist/index.js
CHANGED
|
@@ -1103,6 +1103,19 @@ var init_abstention = __esm2({
|
|
|
1103
1103
|
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";
|
|
1104
1104
|
}
|
|
1105
1105
|
});
|
|
1106
|
+
function envelopeText(parsed, raw) {
|
|
1107
|
+
if (parsed !== null && typeof parsed === "object") {
|
|
1108
|
+
const obj = parsed;
|
|
1109
|
+
if (typeof obj.text === "string") return obj.text;
|
|
1110
|
+
if ("type" in obj || "attachment" in obj) return "";
|
|
1111
|
+
}
|
|
1112
|
+
return raw;
|
|
1113
|
+
}
|
|
1114
|
+
var init_envelope_text = __esm2({
|
|
1115
|
+
"src/envelope-text.ts"() {
|
|
1116
|
+
"use strict";
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1106
1119
|
function toEpoch(v22) {
|
|
1107
1120
|
if (typeof v22 === "bigint") return v22;
|
|
1108
1121
|
if (typeof v22 === "number") {
|
|
@@ -64664,11 +64677,11 @@ var init_mls_kp_pool = __esm2({
|
|
|
64664
64677
|
}
|
|
64665
64678
|
});
|
|
64666
64679
|
function ownIdentity() {
|
|
64667
|
-
const v22 = true ? "0.23.
|
|
64680
|
+
const v22 = true ? "0.23.44" : FALLBACK;
|
|
64668
64681
|
return `${PACKAGE}@${v22}`;
|
|
64669
64682
|
}
|
|
64670
64683
|
function buildSha() {
|
|
64671
|
-
const raw = true ? "
|
|
64684
|
+
const raw = true ? "765ae19-dirty" : "";
|
|
64672
64685
|
const cleaned = (raw ?? "").trim();
|
|
64673
64686
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
64674
64687
|
}
|
|
@@ -65590,6 +65603,7 @@ var init_channel = __esm2({
|
|
|
65590
65603
|
async "src/channel.ts"() {
|
|
65591
65604
|
"use strict";
|
|
65592
65605
|
init_abstention();
|
|
65606
|
+
init_envelope_text();
|
|
65593
65607
|
init_mls_commit_classify();
|
|
65594
65608
|
init_room_protocol();
|
|
65595
65609
|
await init_libsodium_wrappers();
|
|
@@ -66919,7 +66933,7 @@ ${text}`;
|
|
|
66919
66933
|
*/
|
|
66920
66934
|
sendActivitySpan(spanData) {
|
|
66921
66935
|
if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
|
|
66922
|
-
const pluginVersion = true ? "0.23.
|
|
66936
|
+
const pluginVersion = true ? "0.23.44" : "0.0.0-dev";
|
|
66923
66937
|
const agentName = this.config.agentName ?? "Agent";
|
|
66924
66938
|
const resource = {
|
|
66925
66939
|
"service.name": "agentvault-agent",
|
|
@@ -68857,7 +68871,7 @@ ${text}`;
|
|
|
68857
68871
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
68858
68872
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
68859
68873
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
68860
|
-
pluginVersion: true ? "0.23.
|
|
68874
|
+
pluginVersion: true ? "0.23.44" : "0.0.0-dev"
|
|
68861
68875
|
});
|
|
68862
68876
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
68863
68877
|
}
|
|
@@ -69181,7 +69195,7 @@ ${text}`;
|
|
|
69181
69195
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
69182
69196
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
69183
69197
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
69184
|
-
pluginVersion: true ? "0.23.
|
|
69198
|
+
pluginVersion: true ? "0.23.44" : "0.0.0-dev"
|
|
69185
69199
|
});
|
|
69186
69200
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
69187
69201
|
}
|
|
@@ -69635,7 +69649,7 @@ ${text}`;
|
|
|
69635
69649
|
let mlsAttachment = null;
|
|
69636
69650
|
try {
|
|
69637
69651
|
const parsed = JSON.parse(plaintext);
|
|
69638
|
-
text = parsed
|
|
69652
|
+
text = envelopeText(parsed, plaintext);
|
|
69639
69653
|
messageType = parsed.type ?? "text";
|
|
69640
69654
|
topicId = parsed.topicId ?? topicId;
|
|
69641
69655
|
if (parsed.attachment) mlsAttachment = parsed.attachment;
|
|
@@ -69830,7 +69844,7 @@ ${text}`;
|
|
|
69830
69844
|
try {
|
|
69831
69845
|
const parsed = JSON.parse(plaintext);
|
|
69832
69846
|
messageType = parsed.type || "message";
|
|
69833
|
-
messageText = parsed
|
|
69847
|
+
messageText = envelopeText(parsed, plaintext);
|
|
69834
69848
|
if (parsed.attachment) {
|
|
69835
69849
|
attachmentInfo = parsed.attachment;
|
|
69836
69850
|
}
|
|
@@ -69944,7 +69958,13 @@ ${messageText}`;
|
|
|
69944
69958
|
messageType: msgData.message_type ?? "text",
|
|
69945
69959
|
priority: msgData.priority ?? "normal",
|
|
69946
69960
|
envelopeVersion: msgData.envelope_version ?? "1.0.0",
|
|
69947
|
-
roomId
|
|
69961
|
+
roomId,
|
|
69962
|
+
// #1223 — the pre-fold text. This DR `message` path also sets `roomId`
|
|
69963
|
+
// and folds an attachment into `emitText`, so without this a room
|
|
69964
|
+
// message that reaches the gate here would fall back to the folded
|
|
69965
|
+
// text (the same bug the MLS room path fixes). `messageText` is the
|
|
69966
|
+
// envelope text before the fold; `emitText` is the folded copy.
|
|
69967
|
+
caption: messageText
|
|
69948
69968
|
};
|
|
69949
69969
|
this.emit("message", emitText, metadata);
|
|
69950
69970
|
Promise.resolve(this.config.onMessage?.(emitText, metadata)).catch((err) => {
|
|
@@ -70582,14 +70602,14 @@ ${baseText}`;
|
|
|
70582
70602
|
try {
|
|
70583
70603
|
const parsed = JSON.parse(rawPlaintext);
|
|
70584
70604
|
messageType = parsed.type || "message";
|
|
70585
|
-
messageText = parsed
|
|
70605
|
+
messageText = envelopeText(parsed, rawPlaintext);
|
|
70586
70606
|
if (parsed.attachment) roomAttachment = parsed.attachment;
|
|
70587
70607
|
} catch {
|
|
70588
70608
|
messageType = "message";
|
|
70589
70609
|
messageText = rawPlaintext;
|
|
70590
70610
|
}
|
|
70591
70611
|
if (CREDENTIAL_MESSAGE_TYPES.has(messageType)) {
|
|
70592
|
-
this._handleCredentialMessage(resolvedRoomId, messageType,
|
|
70612
|
+
this._handleCredentialMessage(resolvedRoomId, messageType, rawPlaintext, data.message_id);
|
|
70593
70613
|
if (data.created_at && this._persisted) {
|
|
70594
70614
|
this._persisted.lastMessageTimestamp = data.created_at;
|
|
70595
70615
|
}
|
|
@@ -70598,7 +70618,7 @@ ${baseText}`;
|
|
|
70598
70618
|
}
|
|
70599
70619
|
if (CATCHUP_MESSAGE_TYPES.has(messageType)) {
|
|
70600
70620
|
if (messageType === "history_catchup_request") {
|
|
70601
|
-
await this._handleHistoryCatchupRequest(resolvedRoomId,
|
|
70621
|
+
await this._handleHistoryCatchupRequest(resolvedRoomId, rawPlaintext, data.message_id);
|
|
70602
70622
|
}
|
|
70603
70623
|
return;
|
|
70604
70624
|
}
|
|
@@ -70623,6 +70643,7 @@ ${baseText}`;
|
|
|
70623
70643
|
await this._refreshRoomRoster(resolvedRoomId);
|
|
70624
70644
|
}
|
|
70625
70645
|
}
|
|
70646
|
+
const caption = messageText;
|
|
70626
70647
|
const addressed = parseMentions(messageText).length > 0;
|
|
70627
70648
|
if (roomAttachment && !addressed) {
|
|
70628
70649
|
this._deferRoomAttachment(resolvedRoomId, roomAttachment);
|
|
@@ -70649,7 +70670,8 @@ ${baseText}`;
|
|
|
70649
70670
|
senderDeviceId,
|
|
70650
70671
|
senderIsAgent,
|
|
70651
70672
|
senderName: senderMember?.displayName || "unknown",
|
|
70652
|
-
roomName: this._persisted?.rooms?.[resolvedRoomId]?.name
|
|
70673
|
+
roomName: this._persisted?.rooms?.[resolvedRoomId]?.name,
|
|
70674
|
+
caption
|
|
70653
70675
|
};
|
|
70654
70676
|
const senderLabel = senderMember?.displayName || "someone";
|
|
70655
70677
|
this._appendHistory("owner", messageText, `room:${resolvedRoomId}`);
|
|
@@ -70658,6 +70680,9 @@ ${baseText}`;
|
|
|
70658
70680
|
senderDeviceId,
|
|
70659
70681
|
senderName: senderLabel,
|
|
70660
70682
|
plaintext: messageText,
|
|
70683
|
+
// #1223 — what the sender typed, before the attachment fold. The
|
|
70684
|
+
// bridges gate on this (falling back to `plaintext` when absent).
|
|
70685
|
+
caption,
|
|
70661
70686
|
messageType,
|
|
70662
70687
|
timestamp: data.created_at ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
70663
70688
|
// Native bridge (claude-room-bridge) consumes this to decide reply
|
|
@@ -72577,7 +72602,7 @@ ${baseText}`;
|
|
|
72577
72602
|
try {
|
|
72578
72603
|
const parsed = JSON.parse(plaintext);
|
|
72579
72604
|
messageType = parsed.type || "message";
|
|
72580
|
-
messageText = parsed
|
|
72605
|
+
messageText = envelopeText(parsed, plaintext);
|
|
72581
72606
|
} catch {
|
|
72582
72607
|
messageType = "message";
|
|
72583
72608
|
messageText = plaintext;
|
|
@@ -73176,7 +73201,7 @@ ${baseText}`;
|
|
|
73176
73201
|
try {
|
|
73177
73202
|
const parsed = JSON.parse(plaintext);
|
|
73178
73203
|
messageType = parsed.type || "message";
|
|
73179
|
-
messageText = parsed
|
|
73204
|
+
messageText = envelopeText(parsed, plaintext);
|
|
73180
73205
|
} catch {
|
|
73181
73206
|
messageType = "message";
|
|
73182
73207
|
messageText = plaintext;
|
|
@@ -73461,7 +73486,7 @@ ${baseText}`;
|
|
|
73461
73486
|
try {
|
|
73462
73487
|
const parsed = JSON.parse(plaintext);
|
|
73463
73488
|
messageType = parsed.type || "message";
|
|
73464
|
-
messageText = parsed
|
|
73489
|
+
messageText = envelopeText(parsed, plaintext);
|
|
73465
73490
|
} catch {
|
|
73466
73491
|
messageType = "message";
|
|
73467
73492
|
messageText = plaintext;
|
|
@@ -74090,7 +74115,7 @@ var init_harness_compat = __esm2({
|
|
|
74090
74115
|
"use strict";
|
|
74091
74116
|
}
|
|
74092
74117
|
});
|
|
74093
|
-
var
|
|
74118
|
+
var managedRoutesRequested;
|
|
74094
74119
|
var init_openclaw_entry = __esm2({
|
|
74095
74120
|
"src/openclaw-entry.ts"() {
|
|
74096
74121
|
"use strict";
|
|
@@ -74103,7 +74128,7 @@ var init_openclaw_entry = __esm2({
|
|
|
74103
74128
|
init_tool_audit();
|
|
74104
74129
|
init_harness_compat();
|
|
74105
74130
|
init_types();
|
|
74106
|
-
|
|
74131
|
+
managedRoutesRequested = false;
|
|
74107
74132
|
}
|
|
74108
74133
|
});
|
|
74109
74134
|
var util;
|
|
@@ -100154,7 +100179,7 @@ var init_index = __esm2({
|
|
|
100154
100179
|
await init_skill_telemetry();
|
|
100155
100180
|
await init_policy_enforcer();
|
|
100156
100181
|
init_room_protocol();
|
|
100157
|
-
VERSION = true ? "0.23.
|
|
100182
|
+
VERSION = true ? "0.23.44" : "0.0.0-dev";
|
|
100158
100183
|
}
|
|
100159
100184
|
});
|
|
100160
100185
|
await init_index();
|
|
@@ -136346,7 +136371,7 @@ function _makeOwesReply(agentName, channel, log) {
|
|
|
136346
136371
|
);
|
|
136347
136372
|
}
|
|
136348
136373
|
return owesRoomReply(
|
|
136349
|
-
e7.plaintext,
|
|
136374
|
+
e7.caption ?? e7.plaintext,
|
|
136350
136375
|
own,
|
|
136351
136376
|
own,
|
|
136352
136377
|
e7.senderIsAgent,
|
|
@@ -136570,7 +136595,7 @@ async function main() {
|
|
|
136570
136595
|
"[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"
|
|
136571
136596
|
);
|
|
136572
136597
|
}
|
|
136573
|
-
logLine(`[bridge] version: ${true ? "0.8.
|
|
136598
|
+
logLine(`[bridge] version: ${true ? "0.8.16" : "dev"}`);
|
|
136574
136599
|
logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
|
|
136575
136600
|
logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
|
|
136576
136601
|
if (cfg.armRoom) {
|
|
@@ -136602,7 +136627,7 @@ async function main() {
|
|
|
136602
136627
|
// its default would render "@agentvault/agentvault@0.7.x" — the wrong
|
|
136603
136628
|
// package name attached to the bridge's version number, which is worse
|
|
136604
136629
|
// than either alone.
|
|
136605
|
-
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.
|
|
136630
|
+
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.16" : "dev"}`
|
|
136606
136631
|
});
|
|
136607
136632
|
const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
|
|
136608
136633
|
const deviceJwt = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentvault/claude-bridge",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.16",
|
|
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",
|