@cotal-ai/connector-hermes 0.167.0 → 0.169.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.
package/dist/bridge.d.ts CHANGED
@@ -1,10 +1,17 @@
1
+ import { type ControlEndpoint } from "@cotal-ai/core";
1
2
  import { type MeshAgent, type AgentConfig } from "@cotal-ai/connector-core";
2
3
  interface BridgeServer {
3
- close(): void;
4
+ /** Stop accepting, end every accepted connection, and resolve once the server has closed. */
5
+ close(): Promise<void>;
4
6
  }
5
- /** Start the adapter bridge. Returns a handle whose `close()` stops the server. `token` is the
6
- * launch's control token: the same shared secret {@link startControlServer} authenticates the
7
- * control plane with, presented here as the first frame's `token` field. */
8
- export declare function startBridgeServer(agent: MeshAgent, config: AgentConfig, socketPath: string, token: string): BridgeServer;
7
+ /** The token the adapter presents in its first frame: HMAC-SHA256 keyed with the UTF-8 bytes of the
8
+ * launch's control key over `cotal-hermes-bridge/<version>`, base64url without padding. Derived so
9
+ * the control key never crosses the bridge socket, and versioned so an adapter of another release
10
+ * is refused rather than accepted. The Python adapter computes the same value (control_exchange.py). */
11
+ export declare function bridgeToken(control: Pick<ControlEndpoint, "token" | "version">): string;
12
+ /** Start the adapter bridge. Returns a handle whose `close()` stops the server. `control` is the
13
+ * launch's control endpoint; the first frame must carry {@link bridgeToken} of its key.
14
+ * `onSubscribe` runs when an authenticated adapter subscribes. */
15
+ export declare function startBridgeServer(agent: MeshAgent, config: AgentConfig, socketPath: string, control: ControlEndpoint, onSubscribe?: () => void): BridgeServer;
9
16
  export {};
10
17
  //# sourceMappingURL=bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AA2CA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,WAAW,EAIjB,MAAM,0BAA0B,CAAC;AAoDlC,UAAU,YAAY;IACpB,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;6EAE6E;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAsPxH"}
1
+ {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAsF,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1I,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EAIjB,MAAM,0BAA0B,CAAC;AAoDlC,UAAU,YAAY;IACpB,6FAA6F;IAC7F,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;yGAGyG;AACzG,wBAAgB,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,MAAM,CAEvF;AASD;;mEAEmE;AACnE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,YAAY,CA4P7J"}
Binary file
Binary file