@awarevue/agent-sdk 1.1.12 → 1.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/agent-sdk",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "SDK for building Agent implementations that speak the Aware protocol.",
5
5
  "author": "Yaser Awajan",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "lint:fix": "yarn lint --fix"
28
28
  },
29
29
  "dependencies": {
30
- "@awarevue/api-types": "^1.1.12",
30
+ "@awarevue/api-types": "^1.1.13",
31
31
  "rxjs": "^7.8.2",
32
32
  "ws": "^8",
33
33
  "zod": "3.24.2"
@@ -3,6 +3,7 @@ import { FromAgent, FromServer, Message } from '@awarevue/api-types';
3
3
  import { Transport } from './transport';
4
4
  export declare class WsAgentTransport implements Transport {
5
5
  private readonly url;
6
+ private readonly apiKey;
6
7
  readonly connected$: Observable<boolean>;
7
8
  readonly messages$: Observable<Message<FromServer>>;
8
9
  readonly errors$: Observable<Error>;
@@ -15,7 +16,7 @@ export declare class WsAgentTransport implements Transport {
15
16
  private reconnectDelay;
16
17
  private readonly maxDelay;
17
18
  private destroyed;
18
- constructor(url: string);
19
+ constructor(url: string, apiKey: string);
19
20
  send(msg: Message<FromAgent>): void;
20
21
  /** Call once when your container/module shuts down. */
21
22
  close(): void;
@@ -11,8 +11,9 @@ exports.WsAgentTransport = void 0;
11
11
  const ws_1 = require("ws");
12
12
  const rxjs_1 = require("rxjs");
13
13
  class WsAgentTransport {
14
- constructor(url) {
14
+ constructor(url, apiKey) {
15
15
  this.url = url;
16
+ this.apiKey = apiKey;
16
17
  this._connected$ = new rxjs_1.BehaviorSubject(false);
17
18
  this._messages$ = new rxjs_1.Subject();
18
19
  this._errors$ = new rxjs_1.Subject();
@@ -66,7 +67,10 @@ class WsAgentTransport {
66
67
  /** Establish or re-establish a WebSocket connection. */
67
68
  connect() {
68
69
  this.ws = new ws_1.WebSocket(this.url, {
69
- headers: { 'User-Agent': 'Aware Agent SDK' },
70
+ headers: {
71
+ 'User-Agent': 'Aware Agent SDK',
72
+ Authorization: `ApiKey ${this.apiKey}`,
73
+ },
70
74
  });
71
75
  this.ws.on('open', () => {
72
76
  this.reconnectDelay = 1000; // reset back-off
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/agent-sdk",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "SDK for building Agent implementations that speak the Aware protocol.",
5
5
  "author": "Yaser Awajan",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "lint:fix": "yarn lint --fix"
28
28
  },
29
29
  "dependencies": {
30
- "@awarevue/api-types": "^1.1.12",
30
+ "@awarevue/api-types": "^1.1.13",
31
31
  "rxjs": "^7.8.2",
32
32
  "ws": "^8",
33
33
  "zod": "3.24.2"