@agentvault/muse-bridge 0.1.26 → 0.1.28

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 CHANGED
@@ -16,6 +16,12 @@ export interface RoomMessage {
16
16
  }
17
17
  export interface MessageMeta {
18
18
  roomId?: string;
19
+ /** #1418 — the 1:1 conversation the message came from. A reply is sent as
20
+ * that conversation's turn, so it reaches that person only. */
21
+ conversationId?: string;
22
+ /** #1418 — the 1:1 group the message decrypted under (MLS). Attested, so it
23
+ * places the person even when the conversation is not mapped yet. */
24
+ conversationGroupId?: string;
19
25
  ownerDm1to1?: boolean;
20
26
  }
21
27
  export interface RoomHushed {
@@ -51,15 +57,22 @@ export type BridgeTarget = {
51
57
  roomId: string;
52
58
  } | {
53
59
  kind: "dm";
60
+ conversationId?: string;
61
+ groupId?: string;
54
62
  };
55
63
  export interface ReplyChannel {
56
64
  sendToRoom(roomId: string, text: string): Promise<void>;
57
65
  send(text: string): Promise<void>;
66
+ /** #1418 — SecureChannel: run `fn` as `conversationId`'s turn, so an
67
+ * untargeted send inside it reaches that conversation's person only. */
68
+ runForConversation?<T>(conversationId: string | undefined, fn: () => Promise<T>, opts?: {
69
+ groupId?: string;
70
+ }): Promise<T>;
58
71
  }
59
72
  export declare class ActiveTarget {
60
73
  private target;
61
74
  setRoom(roomId: string): void;
62
- setDm(): void;
75
+ setDm(conversationId?: string, groupId?: string): void;
63
76
  get current(): BridgeTarget | null;
64
77
  snapshotReply(channel: ReplyChannel, log?: (msg: string) => void): (text: string) => Promise<void>;
65
78
  }