@agentvault/agentvault 0.14.14 → 0.14.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.
@@ -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;AAexC,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;AAgzBD,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;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"}
@@ -290,8 +290,13 @@ async function handleSendRequest(parsed, channel) {
290
290
  return { status: 400, body: { ok: false, error: "Missing 'text' field" } };
291
291
  }
292
292
  try {
293
- if (parsed.hub_address && typeof parsed.hub_address === "string") {
294
- await channel.sendToAgent(parsed.hub_address, text);
293
+ let a2aTarget = parsed.hub_address ?? parsed.a2a_address ?? parsed.a2aAddress;
294
+ if (!a2aTarget && parsed.channel_id && typeof parsed.channel_id === "string") {
295
+ const hubAddr = channel.resolveA2AChannelHub(parsed.channel_id);
296
+ if (hubAddr) a2aTarget = hubAddr;
297
+ }
298
+ if (a2aTarget && typeof a2aTarget === "string") {
299
+ await channel.sendToAgent(a2aTarget, text);
295
300
  } else if (parsed.room_id && typeof parsed.room_id === "string") {
296
301
  await channel.sendToRoom(parsed.room_id, text, {
297
302
  messageType: parsed.message_type,
@@ -414,6 +419,20 @@ function _a2aRecordReply(channelId) {
414
419
  );
415
420
  }
416
421
  var isUsingManagedRoutes = false;
422
+ var _outboundTargets = [
423
+ { id: "owner", label: "AgentVault Owner", accountId: "default" },
424
+ { id: "default", label: "AgentVault Owner (default)", accountId: "default" }
425
+ ];
426
+ function _registerA2ATarget(hubAddress, accountId) {
427
+ const targetId = `a2a:${hubAddress}`;
428
+ if (_outboundTargets.some((t) => t.id === targetId)) return;
429
+ _outboundTargets.push({
430
+ id: targetId,
431
+ label: `A2A: ${hubAddress}`,
432
+ accountId
433
+ });
434
+ console.log(`[AgentVault] Registered A2A target: ${targetId}`);
435
+ }
417
436
  function _setRuntime(rt) {
418
437
  _ocRuntime = rt;
419
438
  if (_messageQueue.length > 0) {
@@ -1037,12 +1056,13 @@ var agentVaultPlugin = {
1037
1056
  }
1038
1057
  },
1039
1058
  onA2AChannelReady: async (info) => {
1059
+ _registerA2ATarget(info.peerHubAddress, account.accountId);
1040
1060
  if (info.role !== "initiator") {
1041
1061
  _log?.(`[AgentVault] A2A channel ready (responder) \u2014 waiting for initiator: ${info.peerHubAddress}`);
1042
1062
  return;
1043
1063
  }
1044
- _log?.(`[AgentVault] A2A channel ready (initiator) \u2014 sending seed to ${info.peerHubAddress}`);
1045
- const seedText = `[System] A new A2A channel has been established with agent ${info.peerHubAddress}. Introduce yourself briefly and state what you can help with.`;
1064
+ _log?.(`[AgentVault] A2A channel ready (initiator) \u2014 sending seed to ${info.peerHubAddress}${info.topic ? ` [topic: ${info.topic}]` : ""}`);
1065
+ const seedText = info.topic ? `[System] A new A2A channel has been established with agent ${info.peerHubAddress}. Topic: "${info.topic}". Introduce yourself briefly and begin discussing this topic.` : `[System] A new A2A channel has been established with agent ${info.peerHubAddress}. Introduce yourself briefly and state what you can help with.`;
1046
1066
  const seedMetadata = {
1047
1067
  a2aChannelId: info.channelId,
1048
1068
  fromHubAddress: info.peerHubAddress,
@@ -1079,6 +1099,9 @@ var agentVaultPlugin = {
1079
1099
  if (isUsingManagedRoutes) {
1080
1100
  _log?.(`[AgentVault] OpenClaw managed routes also registered`);
1081
1101
  }
1102
+ for (const peerAddress of channel.a2aPeerAddresses) {
1103
+ _registerA2ATarget(peerAddress, account.accountId);
1104
+ }
1082
1105
  });
1083
1106
  channel.start().catch(reject);
1084
1107
  }).catch(reject);
@@ -1091,18 +1114,7 @@ var agentVaultPlugin = {
1091
1114
  deliveryMode: "direct",
1092
1115
  // Register valid send targets so OpenClaw's `message` tool can route
1093
1116
  // proactive (agent-initiated) sends — not just replies to inbound messages.
1094
- targets: [
1095
- {
1096
- id: "owner",
1097
- label: "AgentVault Owner",
1098
- accountId: "default"
1099
- },
1100
- {
1101
- id: "default",
1102
- label: "AgentVault Owner (default)",
1103
- accountId: "default"
1104
- }
1105
- ],
1117
+ targets: _outboundTargets,
1106
1118
  sendText: async ({ to, text, accountId }) => {
1107
1119
  const resolvedId = accountId ?? "default";
1108
1120
  const ch = _channels.get(resolvedId);