@agentvault/agentvault 0.15.3 → 0.16.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.
@@ -56,6 +56,40 @@ export declare function sendDecisionToOwner(request: {
56
56
  }, options?: GatewaySendOptions): Promise<GatewaySendResult & {
57
57
  decision_id?: string;
58
58
  }>;
59
+ /**
60
+ * Send a plaintext message to a specific room via the gateway HTTP server.
61
+ * Never throws — returns `{ ok: false, error }` on failure.
62
+ */
63
+ export declare function sendToRoom(roomId: string, text: string, options?: GatewaySendOptions): Promise<GatewaySendResult>;
64
+ /**
65
+ * Send a plaintext message to any target via the gateway HTTP server.
66
+ * Accepts target strings: "owner", "room:<id>", "a2a:<addr>", "context".
67
+ * Never throws — returns `{ ok: false, error }` on failure.
68
+ */
69
+ export declare function sendToTarget(target: string, text: string, options?: GatewaySendOptions): Promise<GatewaySendResult & {
70
+ destination?: {
71
+ kind: string;
72
+ id?: string;
73
+ };
74
+ }>;
75
+ /**
76
+ * Discover available delivery targets from the gateway.
77
+ * Never throws — returns `{ ok: false, error }` on failure.
78
+ */
79
+ export declare function listTargets(options?: GatewaySendOptions): Promise<{
80
+ ok: boolean;
81
+ targets?: Array<{
82
+ kind: string;
83
+ id: string;
84
+ label: string;
85
+ available: boolean;
86
+ }>;
87
+ context?: {
88
+ kind: string;
89
+ roomId?: string;
90
+ };
91
+ error?: string;
92
+ }>;
59
93
  /**
60
94
  * Check gateway health / status.
61
95
  * Never throws — returns `{ ok: false, error }` on failure.
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-send.d.ts","sourceRoot":"","sources":["../src/gateway-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC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O,CAAC,mBAAmB,CAAC,CAoB9B"}
@@ -15,6 +15,12 @@ export interface HandlerResult {
15
15
  }
16
16
  /**
17
17
  * Handle POST /send — send a message (text, file, or room).
18
+ *
19
+ * Routing: explicit target fields only — no silent lastInboundRoomId fallback.
20
+ * - hub_address / a2a_address / channel_id → A2A
21
+ * - room_id → room
22
+ * - target: "context" → resolve from lastInboundRoomId (opt-in)
23
+ * - No target fields → owner (the breaking fix)
18
24
  */
19
25
  export declare function handleSendRequest(parsed: Record<string, unknown>, channel: SecureChannel): Promise<HandlerResult>;
20
26
  /**
@@ -29,4 +35,8 @@ export declare function handleDecisionRequest(parsed: Record<string, unknown>, c
29
35
  * Handle GET /status — return channel health info.
30
36
  */
31
37
  export declare function handleStatusRequest(channel: SecureChannel): HandlerResult;
38
+ /**
39
+ * Handle GET /targets — return available delivery destinations.
40
+ */
41
+ export declare function handleTargetsRequest(channel: SecureChannel): HandlerResult;
32
42
  //# sourceMappingURL=http-handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-handlers.d.ts","sourceRoot":"","sources":["../src/http-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA0CxB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CAuBxB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAUzE"}
1
+ {"version":3,"file":"http-handlers.d.ts","sourceRoot":"","sources":["../src/http-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CAqExB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CAmCxB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA8BxB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAUzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAW1E"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  export { SecureChannel } from "./channel.js";
2
- export type { SecureChannelConfig, ChannelState, MessageMetadata, AttachmentData, PersistedState, LegacyPersistedState, DeviceSession, HistoryEntry, SendOptions, DecisionOption, DecisionRequest, DecisionResponse, ContextRef, HeartbeatStatus, StatusAlert, RoomInfo, RoomMemberInfo, RoomConversationInfo, RoomState, A2AChannel, A2AMessage, RoomParticipantEvent, } from "./types.js";
2
+ export type { SecureChannelConfig, ChannelState, MessageMetadata, AttachmentData, PersistedState, LegacyPersistedState, DeviceSession, HistoryEntry, SendOptions, DecisionOption, DecisionRequest, DecisionResponse, ContextRef, HeartbeatStatus, StatusAlert, RoomInfo, RoomMemberInfo, RoomConversationInfo, RoomState, A2AChannel, A2AMessage, RoomParticipantEvent, DeliveryTarget, DeliveryContent, DeliveryOptions, DeliveryReceipt, TargetInfo, ActionConfirmation, ArtifactPayload, } from "./types.js";
3
+ export { parseTarget } from "./types.js";
3
4
  export { listAccountIds, resolveAccount } from "./account-config.js";
4
5
  export type { ResolvedAccount } from "./account-config.js";
5
6
  export { agentVaultPlugin, setOcRuntime, getActiveChannel } from "./openclaw-plugin.js";
6
- export { sendToOwner, sendDecisionToOwner, checkGateway } from "./gateway-send.js";
7
+ export { sendToOwner, sendToRoom, sendToTarget, listTargets, sendDecisionToOwner, checkGateway } from "./gateway-send.js";
7
8
  export type { GatewaySendOptions, GatewaySendResult, GatewayStatusResult, } from "./gateway-send.js";
8
9
  export { requestHeartbeatNow, onAgentEvent, onSessionTranscriptUpdate } from "./openclaw-compat.js";
9
10
  export { isUsingManagedRoutes } from "./openclaw-entry.js";
10
- export { handleSendRequest, handleActionRequest, handleDecisionRequest, handleStatusRequest } from "./http-handlers.js";
11
+ export { handleSendRequest, handleActionRequest, handleDecisionRequest, handleStatusRequest, handleTargetsRequest } from "./http-handlers.js";
11
12
  export type { HandlerResult } from "./http-handlers.js";
12
13
  export { AgentVaultMcpServer } from "./mcp-server.js";
13
14
  export type { SkillDefinition, McpServerOpts } from "./mcp-server.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,8 @@ __export(http_handlers_exports, {
46496
46496
  handleActionRequest: () => handleActionRequest,
46497
46497
  handleDecisionRequest: () => handleDecisionRequest,
46498
46498
  handleSendRequest: () => handleSendRequest,
46499
- handleStatusRequest: () => handleStatusRequest
46499
+ handleStatusRequest: () => handleStatusRequest,
46500
+ handleTargetsRequest: () => handleTargetsRequest
46500
46501
  });
46501
46502
  async function handleSendRequest(parsed, channel) {
46502
46503
  const text = parsed.text;
@@ -46504,32 +46505,55 @@ async function handleSendRequest(parsed, channel) {
46504
46505
  return { status: 400, body: { ok: false, error: "Missing 'text' field" } };
46505
46506
  }
46506
46507
  try {
46508
+ let target;
46507
46509
  let a2aTarget = parsed.hub_address ?? parsed.a2a_address ?? parsed.a2aAddress;
46508
46510
  if (!a2aTarget && parsed.channel_id && typeof parsed.channel_id === "string") {
46509
46511
  const hubAddr = channel.resolveA2AChannelHub(parsed.channel_id);
46510
46512
  if (hubAddr) a2aTarget = hubAddr;
46511
46513
  }
46512
- const roomId = (typeof parsed.room_id === "string" ? parsed.room_id : void 0) ?? channel.lastInboundRoomId;
46513
46514
  if (a2aTarget && typeof a2aTarget === "string") {
46514
- await channel.sendToAgent(a2aTarget, text);
46515
- } else if (roomId) {
46516
- await channel.sendToRoom(roomId, text, {
46517
- messageType: parsed.message_type,
46518
- priority: parsed.priority,
46519
- metadata: parsed.metadata
46520
- });
46515
+ target = { kind: "a2a", hubAddress: a2aTarget };
46516
+ } else if (typeof parsed.room_id === "string") {
46517
+ target = { kind: "room", roomId: parsed.room_id };
46518
+ } else if (parsed.target === "context") {
46519
+ target = { kind: "context" };
46521
46520
  } else if (parsed.file_path && typeof parsed.file_path === "string") {
46522
- await channel.sendWithAttachment(text, parsed.file_path, {
46523
- topicId: parsed.topicId
46524
- });
46521
+ const receipt2 = await channel.deliver(
46522
+ { kind: "owner" },
46523
+ { type: "attachment", text, filePath: parsed.file_path },
46524
+ { topicId: parsed.topicId }
46525
+ );
46526
+ return {
46527
+ status: receipt2.ok ? 200 : 500,
46528
+ body: {
46529
+ ok: receipt2.ok,
46530
+ destination: receipt2.destination,
46531
+ ...receipt2.error ? { error: receipt2.error } : {}
46532
+ }
46533
+ };
46525
46534
  } else {
46526
- await channel.send(text, {
46527
- topicId: parsed.topicId,
46528
- messageType: parsed.message_type,
46529
- metadata: parsed.metadata
46530
- });
46535
+ target = { kind: "owner" };
46531
46536
  }
46532
- return { status: 200, body: { ok: true } };
46537
+ const receipt = await channel.deliver(
46538
+ target,
46539
+ { type: "text", text },
46540
+ {
46541
+ topicId: parsed.topicId,
46542
+ priority: parsed.priority,
46543
+ metadata: {
46544
+ ...parsed.metadata,
46545
+ ...parsed.message_type ? { message_type: parsed.message_type } : {}
46546
+ }
46547
+ }
46548
+ );
46549
+ return {
46550
+ status: receipt.ok ? 200 : 500,
46551
+ body: {
46552
+ ok: receipt.ok,
46553
+ destination: receipt.destination,
46554
+ ...receipt.error ? { error: receipt.error } : {}
46555
+ }
46556
+ };
46533
46557
  } catch (err) {
46534
46558
  return { status: 500, body: { ok: false, error: String(err) } };
46535
46559
  }
@@ -46546,12 +46570,19 @@ async function handleActionRequest(parsed, channel) {
46546
46570
  detail: parsed.detail,
46547
46571
  estimated_cost: parsed.estimated_cost
46548
46572
  };
46549
- if (parsed.room_id && typeof parsed.room_id === "string") {
46550
- await channel.sendActionConfirmationToRoom(parsed.room_id, confirmation);
46551
- } else {
46552
- await channel.sendActionConfirmation(confirmation);
46553
- }
46554
- return { status: 200, body: { ok: true } };
46573
+ const target = parsed.room_id && typeof parsed.room_id === "string" ? { kind: "room", roomId: parsed.room_id } : { kind: "owner" };
46574
+ const receipt = await channel.deliver(
46575
+ target,
46576
+ { type: "action_confirmation", confirmation }
46577
+ );
46578
+ return {
46579
+ status: receipt.ok ? 200 : 500,
46580
+ body: {
46581
+ ok: receipt.ok,
46582
+ destination: receipt.destination,
46583
+ ...receipt.error ? { error: receipt.error } : {}
46584
+ }
46585
+ };
46555
46586
  } catch (err) {
46556
46587
  return { status: 500, body: { ok: false, error: String(err) } };
46557
46588
  }
@@ -46595,6 +46626,16 @@ function handleStatusRequest(channel) {
46595
46626
  }
46596
46627
  };
46597
46628
  }
46629
+ function handleTargetsRequest(channel) {
46630
+ return {
46631
+ status: 200,
46632
+ body: {
46633
+ ok: true,
46634
+ targets: channel.listTargets(),
46635
+ context: channel.lastInboundRoomId ? { kind: "room", roomId: channel.lastInboundRoomId } : { kind: "owner" }
46636
+ }
46637
+ };
46638
+ }
46598
46639
  var init_http_handlers = __esm({
46599
46640
  "src/http-handlers.ts"() {
46600
46641
  "use strict";
@@ -47574,6 +47615,171 @@ var init_channel = __esm({
47574
47615
  metadata
47575
47616
  });
47576
47617
  }
47618
+ // --- Unified Delivery Protocol ---
47619
+ /**
47620
+ * Canonical message dispatcher. ALL outbound messages should flow through this method.
47621
+ * Routes based on explicit target — never silently falls back to a room.
47622
+ */
47623
+ async deliver(target, content, options) {
47624
+ const ts = (/* @__PURE__ */ new Date()).toISOString();
47625
+ if (this._state === "idle" || this._state === "error") {
47626
+ return {
47627
+ ok: false,
47628
+ destination: { kind: "owner" },
47629
+ error: `Channel is in ${this._state} state`,
47630
+ timestamp: ts
47631
+ };
47632
+ }
47633
+ let resolved;
47634
+ if (target.kind === "context") {
47635
+ if (this._lastInboundRoomId) {
47636
+ resolved = { kind: "room", id: this._lastInboundRoomId };
47637
+ console.log(`[deliver] target=context\u2192room:${this._lastInboundRoomId.slice(0, 8)}...`);
47638
+ } else {
47639
+ resolved = { kind: "owner" };
47640
+ console.log(`[deliver] target=context\u2192owner`);
47641
+ }
47642
+ } else if (target.kind === "owner") {
47643
+ resolved = { kind: "owner" };
47644
+ } else if (target.kind === "room") {
47645
+ if (!this._persisted?.rooms?.[target.roomId]) {
47646
+ const err = `Room ${target.roomId} not found`;
47647
+ console.log(`[deliver] target=room:${target.roomId.slice(0, 8)}... content=${content.type} result=FAIL: ${err}`);
47648
+ return { ok: false, destination: { kind: "room", id: target.roomId }, error: err, timestamp: ts };
47649
+ }
47650
+ resolved = { kind: "room", id: target.roomId };
47651
+ } else if (target.kind === "a2a") {
47652
+ const channelEntry = this._persisted?.a2aChannels ? Object.values(this._persisted.a2aChannels).find((ch) => ch.hubAddress === target.hubAddress) : void 0;
47653
+ if (!channelEntry) {
47654
+ const err = `No A2A channel found for hub address: ${target.hubAddress}`;
47655
+ console.log(`[deliver] target=a2a:${target.hubAddress} content=${content.type} result=FAIL: ${err}`);
47656
+ return { ok: false, destination: { kind: "a2a", id: target.hubAddress }, error: err, timestamp: ts };
47657
+ }
47658
+ resolved = { kind: "a2a", id: target.hubAddress };
47659
+ } else {
47660
+ return { ok: false, destination: { kind: "owner" }, error: "Unknown target kind", timestamp: ts };
47661
+ }
47662
+ try {
47663
+ let decisionId;
47664
+ if (content.type === "text") {
47665
+ if (resolved.kind === "room") {
47666
+ await this.sendToRoom(resolved.id, content.text, {
47667
+ messageType: options?.metadata?.message_type,
47668
+ priority: options?.priority,
47669
+ metadata: options?.metadata
47670
+ });
47671
+ } else if (resolved.kind === "a2a") {
47672
+ await this.sendToAgent(resolved.id, content.text, {
47673
+ parentSpanId: options?.parentSpanId
47674
+ });
47675
+ } else {
47676
+ await this.send(content.text, {
47677
+ conversationId: options?.conversationId,
47678
+ topicId: options?.topicId,
47679
+ messageType: options?.metadata?.message_type,
47680
+ priority: options?.priority,
47681
+ metadata: options?.metadata
47682
+ });
47683
+ }
47684
+ } else if (content.type === "decision_request") {
47685
+ if (resolved.kind !== "owner") {
47686
+ const err = "Decision requests can only be sent to owner";
47687
+ console.log(`[deliver] target=${resolved.kind}:${resolved.id} content=decision_request result=FAIL: ${err}`);
47688
+ return { ok: false, destination: resolved, error: err, timestamp: ts };
47689
+ }
47690
+ decisionId = await this.sendDecisionRequest(content.request);
47691
+ } else if (content.type === "status_alert") {
47692
+ if (resolved.kind === "room") {
47693
+ const envelope = {
47694
+ title: content.alert.title,
47695
+ message: content.alert.message,
47696
+ severity: content.alert.severity,
47697
+ timestamp: ts
47698
+ };
47699
+ if (content.alert.detail !== void 0) envelope.detail = content.alert.detail;
47700
+ if (content.alert.detailFormat !== void 0) envelope.detail_format = content.alert.detailFormat;
47701
+ if (content.alert.category !== void 0) envelope.category = content.alert.category;
47702
+ await this.sendToRoom(resolved.id, JSON.stringify(envelope), {
47703
+ messageType: "status_alert",
47704
+ priority: content.alert.severity === "error" || content.alert.severity === "critical" ? "high" : "normal",
47705
+ metadata: { severity: content.alert.severity }
47706
+ });
47707
+ } else if (resolved.kind === "owner") {
47708
+ await this.sendStatusAlert(content.alert);
47709
+ } else {
47710
+ return { ok: false, destination: resolved, error: "Status alerts cannot be sent to A2A targets", timestamp: ts };
47711
+ }
47712
+ } else if (content.type === "action_confirmation") {
47713
+ if (resolved.kind === "room") {
47714
+ await this.sendActionConfirmationToRoom(resolved.id, content.confirmation);
47715
+ } else if (resolved.kind === "owner") {
47716
+ await this.sendActionConfirmation(content.confirmation);
47717
+ } else {
47718
+ return { ok: false, destination: resolved, error: "Action confirmations cannot be sent to A2A targets", timestamp: ts };
47719
+ }
47720
+ } else if (content.type === "artifact") {
47721
+ if (resolved.kind !== "owner") {
47722
+ return { ok: false, destination: resolved, error: "Artifacts can only be sent to owner", timestamp: ts };
47723
+ }
47724
+ await this.sendArtifact(content.artifact);
47725
+ } else if (content.type === "attachment") {
47726
+ if (resolved.kind !== "owner") {
47727
+ return { ok: false, destination: resolved, error: "Attachments can only be sent to owner", timestamp: ts };
47728
+ }
47729
+ await this.sendWithAttachment(content.text, content.filePath, {
47730
+ topicId: options?.topicId
47731
+ });
47732
+ }
47733
+ const targetLabel = resolved.kind === "owner" ? "owner" : `${resolved.kind}:${resolved.id?.slice(0, 8)}...`;
47734
+ console.log(`[deliver] target=${targetLabel} content=${content.type} result=ok`);
47735
+ return {
47736
+ ok: true,
47737
+ destination: resolved,
47738
+ queued: this._state !== "ready",
47739
+ decisionId,
47740
+ timestamp: ts
47741
+ };
47742
+ } catch (err) {
47743
+ const targetLabel = resolved.kind === "owner" ? "owner" : `${resolved.kind}:${resolved.id?.slice(0, 8)}...`;
47744
+ const errMsg = err instanceof Error ? err.message : String(err);
47745
+ console.log(`[deliver] target=${targetLabel} content=${content.type} result=FAIL: ${errMsg}`);
47746
+ return { ok: false, destination: resolved, error: errMsg, timestamp: ts };
47747
+ }
47748
+ }
47749
+ /**
47750
+ * Returns all available delivery destinations with availability status.
47751
+ */
47752
+ listTargets() {
47753
+ const targets = [
47754
+ {
47755
+ kind: "owner",
47756
+ id: "owner",
47757
+ label: "Owner (direct)",
47758
+ available: this._state === "ready" && this._sessions.size > 0
47759
+ }
47760
+ ];
47761
+ if (this._persisted?.rooms) {
47762
+ for (const room of Object.values(this._persisted.rooms)) {
47763
+ targets.push({
47764
+ kind: "room",
47765
+ id: room.roomId,
47766
+ label: room.name || `Room ${room.roomId.slice(0, 8)}`,
47767
+ available: this._state === "ready" && room.conversationIds.length > 0
47768
+ });
47769
+ }
47770
+ }
47771
+ if (this._persisted?.a2aChannels) {
47772
+ for (const ch of Object.values(this._persisted.a2aChannels)) {
47773
+ targets.push({
47774
+ kind: "a2a",
47775
+ id: ch.hubAddress,
47776
+ label: `A2A: ${ch.hubAddress}`,
47777
+ available: this._state === "ready" && !!ch.session?.ratchetState
47778
+ });
47779
+ }
47780
+ }
47781
+ return targets;
47782
+ }
47577
47783
  _sendHeartbeat() {
47578
47784
  if (this._state !== "ready" || !this._heartbeatCallback) return;
47579
47785
  const status = this._heartbeatCallback();
@@ -47692,9 +47898,13 @@ var init_channel = __esm({
47692
47898
  const result = handlers.handleStatusRequest(this);
47693
47899
  res.writeHead(result.status, { "Content-Type": "application/json" });
47694
47900
  res.end(JSON.stringify(result.body));
47901
+ } else if (req.method === "GET" && req.url === "/targets") {
47902
+ const result = handlers.handleTargetsRequest(this);
47903
+ res.writeHead(result.status, { "Content-Type": "application/json" });
47904
+ res.end(JSON.stringify(result.body));
47695
47905
  } else {
47696
47906
  res.writeHead(404, { "Content-Type": "application/json" });
47697
- res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, or GET /status" }));
47907
+ res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, GET /status, or GET /targets" }));
47698
47908
  }
47699
47909
  });
47700
47910
  this._httpServer.listen(port, "127.0.0.1", () => {
@@ -50015,6 +50225,39 @@ ${messageText}`;
50015
50225
  }
50016
50226
  });
50017
50227
 
50228
+ // src/types.ts
50229
+ function parseTarget(raw) {
50230
+ let target = raw;
50231
+ if (target.startsWith("agentvault:")) {
50232
+ target = target.slice("agentvault:".length);
50233
+ }
50234
+ if (target.startsWith("agent:")) {
50235
+ target = "a2a:" + target.slice("agent:".length);
50236
+ }
50237
+ if (target === "owner" || target === "default") {
50238
+ return { kind: "owner" };
50239
+ }
50240
+ if (target === "context") {
50241
+ return { kind: "context" };
50242
+ }
50243
+ if (target.startsWith("room:")) {
50244
+ const roomId = target.slice("room:".length);
50245
+ if (!roomId) throw new Error(`Invalid room target: "${raw}" \u2014 missing room ID`);
50246
+ return { kind: "room", roomId };
50247
+ }
50248
+ if (target.startsWith("a2a:")) {
50249
+ const hubAddress = target.slice("a2a:".length);
50250
+ if (!hubAddress) throw new Error(`Invalid A2A target: "${raw}" \u2014 missing hub address`);
50251
+ return { kind: "a2a", hubAddress };
50252
+ }
50253
+ throw new Error(`Unrecognized delivery target: "${raw}". Use "owner", "room:<id>", "a2a:<addr>", or "context".`);
50254
+ }
50255
+ var init_types = __esm({
50256
+ "src/types.ts"() {
50257
+ "use strict";
50258
+ }
50259
+ });
50260
+
50018
50261
  // src/account-config.ts
50019
50262
  function listAccountIds(cfg) {
50020
50263
  const av = cfg?.channels?.agentvault;
@@ -50408,6 +50651,88 @@ async function sendDecisionToOwner(request, options) {
50408
50651
  return { ok: false, error: friendlyError(err) };
50409
50652
  }
50410
50653
  }
50654
+ async function sendToRoom(roomId, text, options) {
50655
+ if (typeof text !== "string" || text.trim().length === 0) {
50656
+ return { ok: false, error: "Message text must be a non-empty string" };
50657
+ }
50658
+ if (!roomId) {
50659
+ return { ok: false, error: "Room ID is required" };
50660
+ }
50661
+ requestHeartbeatNow({ reason: "proactive-room-send" }).catch(() => {
50662
+ });
50663
+ try {
50664
+ const base = resolveBaseUrl(options);
50665
+ const sendPath = process.env.OPENCLAW_GATEWAY_URL ? "/agentvault/send" : "/send";
50666
+ const res = await fetch(`${base}${sendPath}`, {
50667
+ method: "POST",
50668
+ headers: { "Content-Type": "application/json" },
50669
+ body: JSON.stringify({ text, room_id: roomId }),
50670
+ signal: options?.signal
50671
+ });
50672
+ if (!res.ok) {
50673
+ const body = await res.text().catch(() => "");
50674
+ return { ok: false, error: `HTTP ${res.status}${body ? `: ${body}` : ""}` };
50675
+ }
50676
+ const data = await res.json();
50677
+ return { ok: data.ok ?? true };
50678
+ } catch (err) {
50679
+ return { ok: false, error: friendlyError(err) };
50680
+ }
50681
+ }
50682
+ async function sendToTarget(target, text, options) {
50683
+ if (typeof text !== "string" || text.trim().length === 0) {
50684
+ return { ok: false, error: "Message text must be a non-empty string" };
50685
+ }
50686
+ requestHeartbeatNow({ reason: "proactive-target-send" }).catch(() => {
50687
+ });
50688
+ try {
50689
+ const base = resolveBaseUrl(options);
50690
+ const sendPath = process.env.OPENCLAW_GATEWAY_URL ? "/agentvault/send" : "/send";
50691
+ const body = { text };
50692
+ if (target.startsWith("room:")) {
50693
+ body.room_id = target.slice(5);
50694
+ } else if (target.startsWith("a2a:")) {
50695
+ body.hub_address = target.slice(4);
50696
+ } else if (target === "context") {
50697
+ body.target = "context";
50698
+ }
50699
+ const res = await fetch(`${base}${sendPath}`, {
50700
+ method: "POST",
50701
+ headers: { "Content-Type": "application/json" },
50702
+ body: JSON.stringify(body),
50703
+ signal: options?.signal
50704
+ });
50705
+ if (!res.ok) {
50706
+ const respBody = await res.text().catch(() => "");
50707
+ return { ok: false, error: `HTTP ${res.status}${respBody ? `: ${respBody}` : ""}` };
50708
+ }
50709
+ const data = await res.json();
50710
+ return {
50711
+ ok: data.ok ?? true,
50712
+ destination: data.destination
50713
+ };
50714
+ } catch (err) {
50715
+ return { ok: false, error: friendlyError(err) };
50716
+ }
50717
+ }
50718
+ async function listTargets(options) {
50719
+ try {
50720
+ const base = resolveBaseUrl(options);
50721
+ const targetsPath = process.env.OPENCLAW_GATEWAY_URL ? "/agentvault/targets" : "/targets";
50722
+ const res = await fetch(`${base}${targetsPath}`, { signal: options?.signal });
50723
+ if (!res.ok) {
50724
+ return { ok: false, error: `HTTP ${res.status}` };
50725
+ }
50726
+ const data = await res.json();
50727
+ return {
50728
+ ok: true,
50729
+ targets: data.targets,
50730
+ context: data.context
50731
+ };
50732
+ } catch (err) {
50733
+ return { ok: false, error: friendlyError(err) };
50734
+ }
50735
+ }
50411
50736
  async function checkGateway(options) {
50412
50737
  try {
50413
50738
  const base = resolveBaseUrl(options);
@@ -50453,6 +50778,7 @@ var init_openclaw_entry = __esm({
50453
50778
  init_fetch_interceptor();
50454
50779
  init_http_handlers();
50455
50780
  init_openclaw_compat();
50781
+ init_types();
50456
50782
  isUsingManagedRoutes = false;
50457
50783
  }
50458
50784
  });
@@ -51135,7 +51461,7 @@ function createZodEnum(values, params) {
51135
51461
  });
51136
51462
  }
51137
51463
  var ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType;
51138
- var init_types = __esm({
51464
+ var init_types2 = __esm({
51139
51465
  "../../node_modules/zod/v3/types.js"() {
51140
51466
  init_ZodError();
51141
51467
  init_errors();
@@ -54387,7 +54713,7 @@ var init_external = __esm({
54387
54713
  init_parseUtil();
54388
54714
  init_typeAliases();
54389
54715
  init_util();
54390
- init_types();
54716
+ init_types2();
54391
54717
  init_ZodError();
54392
54718
  }
54393
54719
  });
@@ -62159,7 +62485,7 @@ function assertCompleteRequestResourceTemplate(request) {
62159
62485
  void request;
62160
62486
  }
62161
62487
  var LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError;
62162
- var init_types2 = __esm({
62488
+ var init_types3 = __esm({
62163
62489
  "../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"() {
62164
62490
  init_v4();
62165
62491
  LATEST_PROTOCOL_VERSION = "2025-11-25";
@@ -65325,7 +65651,7 @@ var DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol;
65325
65651
  var init_protocol = __esm({
65326
65652
  "../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"() {
65327
65653
  init_zod_compat();
65328
- init_types2();
65654
+ init_types3();
65329
65655
  init_interfaces();
65330
65656
  init_zod_json_schema_compat();
65331
65657
  DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
@@ -73221,7 +73547,7 @@ var Server;
73221
73547
  var init_server2 = __esm({
73222
73548
  "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js"() {
73223
73549
  init_protocol();
73224
- init_types2();
73550
+ init_types3();
73225
73551
  init_ajv_provider();
73226
73552
  init_zod_compat();
73227
73553
  init_server();
@@ -73791,7 +74117,7 @@ var init_mcp = __esm({
73791
74117
  init_server2();
73792
74118
  init_zod_compat();
73793
74119
  init_zod_json_schema_compat();
73794
- init_types2();
74120
+ init_types3();
73795
74121
  init_completable();
73796
74122
  init_uriTemplate();
73797
74123
  init_toolNameValidation();
@@ -75063,7 +75389,7 @@ var init_dist2 = __esm({
75063
75389
  var WebStandardStreamableHTTPServerTransport;
75064
75390
  var init_webStandardStreamableHttp = __esm({
75065
75391
  "../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js"() {
75066
- init_types2();
75392
+ init_types3();
75067
75393
  WebStandardStreamableHTTPServerTransport = class {
75068
75394
  constructor(options = {}) {
75069
75395
  this._started = false;
@@ -76363,6 +76689,7 @@ var VERSION;
76363
76689
  var init_index = __esm({
76364
76690
  async "src/index.ts"() {
76365
76691
  await init_channel();
76692
+ init_types();
76366
76693
  init_account_config();
76367
76694
  await init_openclaw_plugin();
76368
76695
  init_gateway_send();
@@ -76392,20 +76719,25 @@ export {
76392
76719
  handleDecisionRequest,
76393
76720
  handleSendRequest,
76394
76721
  handleStatusRequest,
76722
+ handleTargetsRequest,
76395
76723
  invokeSkill,
76396
76724
  isUsingManagedRoutes,
76397
76725
  listAccountIds,
76726
+ listTargets,
76398
76727
  loadSkillsFromApi,
76399
76728
  loadSkillsFromDirectory,
76400
76729
  mergeSkills,
76401
76730
  onAgentEvent,
76402
76731
  onSessionTranscriptUpdate,
76403
76732
  parseSkillMd,
76733
+ parseTarget,
76404
76734
  reportSkillInvocation,
76405
76735
  requestHeartbeatNow,
76406
76736
  resolveAccount,
76407
76737
  sendDecisionToOwner,
76408
76738
  sendToOwner,
76739
+ sendToRoom,
76740
+ sendToTarget,
76409
76741
  setOcRuntime,
76410
76742
  wrapSkillExecution
76411
76743
  };