@agentvault/agentvault 0.14.30 → 0.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-entry.d.ts","sourceRoot":"","sources":["../src/openclaw-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,qBAAqB,CAAC;AAsD7B,gFAAgF;AAChF,eAAO,IAAI,oBAAoB,SAAQ,CAAC;AAqCxC,uEAAuE;AACvE,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9C;AAED,qFAAqF;AACrF,iBAAS,yBAAyB,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAcT;AAED,sFAAsF;AACtF,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiBR;AAizBD,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;;;;;kBAQrD,iBAAiB;;AAJjC,wBAoRE"}
1
+ {"version":3,"file":"openclaw-entry.d.ts","sourceRoot":"","sources":["../src/openclaw-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,qBAAqB,CAAC;AAsD7B,gFAAgF;AAChF,eAAO,IAAI,oBAAoB,SAAQ,CAAC;AA6CxC,uEAAuE;AACvE,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9C;AAED,qFAAqF;AACrF,iBAAS,yBAAyB,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAcT;AAED,sFAAsF;AACtF,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiBR;AAk1BD,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;;;;;kBAQrD,iBAAiB;;AAJjC,wBAoRE"}
@@ -295,7 +295,7 @@ async function handleSendRequest(parsed, channel) {
295
295
  const hubAddr = channel.resolveA2AChannelHub(parsed.channel_id);
296
296
  if (hubAddr) a2aTarget = hubAddr;
297
297
  }
298
- const roomId = parsed.room_id ?? channel.lastInboundRoomId;
298
+ const roomId = (typeof parsed.room_id === "string" ? parsed.room_id : void 0) ?? channel.lastInboundRoomId;
299
299
  if (a2aTarget && typeof a2aTarget === "string") {
300
300
  await channel.sendToAgent(a2aTarget, text);
301
301
  } else if (roomId) {
@@ -424,6 +424,12 @@ var _outboundTargets = [
424
424
  { id: "owner", label: "AgentVault Owner", accountId: "default" },
425
425
  { id: "default", label: "AgentVault Owner (default)", accountId: "default" }
426
426
  ];
427
+ function _registerRoomTarget(roomId, roomName, accountId) {
428
+ const targetId = `room:${roomId}`;
429
+ if (_outboundTargets.some((t) => t.id === targetId)) return;
430
+ _outboundTargets.push({ id: targetId, label: `Room: ${roomName}`, accountId });
431
+ console.log(`[AgentVault] Registered room target: ${roomName} (${roomId.slice(0, 8)}...)`);
432
+ }
427
433
  function _registerA2ATarget(hubAddress, accountId) {
428
434
  const targetId = `a2a:${hubAddress}`;
429
435
  if (_outboundTargets.some((t) => t.id === targetId)) return;
@@ -1103,6 +1109,12 @@ var agentVaultPlugin = {
1103
1109
  for (const peerAddress of channel.a2aPeerAddresses) {
1104
1110
  _registerA2ATarget(peerAddress, account.accountId);
1105
1111
  }
1112
+ for (const room of channel.roomIds) {
1113
+ _registerRoomTarget(room.roomId, room.name, account.accountId);
1114
+ }
1115
+ });
1116
+ channel.on("room_joined", (info) => {
1117
+ _registerRoomTarget(info.roomId, info.name, account.accountId);
1106
1118
  });
1107
1119
  channel.start().catch(reject);
1108
1120
  }).catch(reject);
@@ -1123,10 +1135,16 @@ var agentVaultPlugin = {
1123
1135
  try {
1124
1136
  const wasReady = ch.state === "ready";
1125
1137
  if (to.startsWith("a2a:")) {
1126
- const hubAddress = to.slice(4);
1127
- await ch.sendToAgent(hubAddress, text);
1138
+ await ch.sendToAgent(to.slice(4), text);
1139
+ } else if (to.startsWith("room:")) {
1140
+ await ch.sendToRoom(to.slice(5), text);
1128
1141
  } else {
1129
- await ch.send(text);
1142
+ const roomId = ch.lastInboundRoomId;
1143
+ if (roomId) {
1144
+ await ch.sendToRoom(roomId, text);
1145
+ } else {
1146
+ await ch.send(text);
1147
+ }
1130
1148
  }
1131
1149
  return { ok: true, queued: !wasReady };
1132
1150
  } catch (err) {
@@ -1143,8 +1161,15 @@ ${mediaUrl}` : mediaUrl;
1143
1161
  const wasReady = ch.state === "ready";
1144
1162
  if (to.startsWith("a2a:")) {
1145
1163
  await ch.sendToAgent(to.slice(4), message);
1164
+ } else if (to.startsWith("room:")) {
1165
+ await ch.sendToRoom(to.slice(5), message);
1146
1166
  } else {
1147
- await ch.send(message);
1167
+ const roomId = ch.lastInboundRoomId;
1168
+ if (roomId) {
1169
+ await ch.sendToRoom(roomId, message);
1170
+ } else {
1171
+ await ch.send(message);
1172
+ }
1148
1173
  }
1149
1174
  return { ok: true, queued: !wasReady };
1150
1175
  } catch (err) {
@@ -1167,8 +1192,15 @@ ${mediaUrl}` : mediaUrl;
1167
1192
  const target = ctx.to;
1168
1193
  if (target && typeof target === "string" && target.startsWith("a2a:")) {
1169
1194
  await ch.sendToAgent(target.slice(4), msg);
1195
+ } else if (target && typeof target === "string" && target.startsWith("room:")) {
1196
+ await ch.sendToRoom(target.slice(5), msg);
1170
1197
  } else {
1171
- await ch.send(msg);
1198
+ const roomId = ch.lastInboundRoomId;
1199
+ if (roomId) {
1200
+ await ch.sendToRoom(roomId, msg);
1201
+ } else {
1202
+ await ch.send(msg);
1203
+ }
1172
1204
  }
1173
1205
  };
1174
1206
  if (text) {