@awarevue/agent-sdk 2.0.90 → 2.0.92
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/hubs/index.d.ts +1 -0
- package/dist/hubs/index.js +1 -0
- package/dist/hubs/ws-json-hub-adapter.d.ts +11 -0
- package/dist/hubs/ws-json-hub-adapter.js +33 -0
- package/dist/index.browser.d.ts +11 -0
- package/dist/index.browser.js +32 -0
- package/dist/package.json +10 -6
- package/package.json +10 -6
package/dist/hubs/index.d.ts
CHANGED
package/dist/hubs/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { FromAgent, FromServer, Message } from '@awarevue/api-types';
|
|
3
|
+
import { HubTransport, DuplexTransport, PeerEvent, PeerId } from '../transport_types';
|
|
4
|
+
export declare class WsJsonHubAdapter<TPeer extends PeerId = string> implements HubTransport<Message<FromAgent>, Message<FromServer>, TPeer> {
|
|
5
|
+
private readonly inner;
|
|
6
|
+
readonly peerEvents$: Observable<PeerEvent<TPeer>>;
|
|
7
|
+
constructor(inner: HubTransport<string, string, TPeer>);
|
|
8
|
+
connection(peer: TPeer): DuplexTransport<Message<FromAgent>, Message<FromServer>> | null;
|
|
9
|
+
closePeer(peer: TPeer): void;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// hubs/ws-json-hub-adapter.ts
|
|
3
|
+
// ----------------------------------------------------------------
|
|
4
|
+
// Wraps a HubTransport<string, string, TPeer> and exposes it as
|
|
5
|
+
// HubTransport<Message<FromAgent>, Message<FromServer>, TPeer> by
|
|
6
|
+
// decorating each peer connection with WsJsonEncoder.
|
|
7
|
+
//
|
|
8
|
+
// This is the hub-level mirror of WsJsonEncoder: instead of adapting
|
|
9
|
+
// a single DuplexTransport, it adapts every peer connection inside a hub.
|
|
10
|
+
// ----------------------------------------------------------------
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WsJsonHubAdapter = void 0;
|
|
13
|
+
const ws_json_encoder_1 = require("../transports/ws-json-encoder");
|
|
14
|
+
class WsJsonHubAdapter {
|
|
15
|
+
constructor(inner) {
|
|
16
|
+
this.inner = inner;
|
|
17
|
+
this.peerEvents$ = inner.peerEvents$;
|
|
18
|
+
}
|
|
19
|
+
connection(peer) {
|
|
20
|
+
const conn = this.inner.connection(peer);
|
|
21
|
+
if (!conn)
|
|
22
|
+
return null;
|
|
23
|
+
// WsJsonEncoder handles both directions; cast to the server-side view
|
|
24
|
+
return new ws_json_encoder_1.WsJsonEncoder(conn);
|
|
25
|
+
}
|
|
26
|
+
closePeer(peer) {
|
|
27
|
+
this.inner.closePeer(peer);
|
|
28
|
+
}
|
|
29
|
+
close() {
|
|
30
|
+
this.inner.close();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.WsJsonHubAdapter = WsJsonHubAdapter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './agent-app';
|
|
2
|
+
export * from './agent-server';
|
|
3
|
+
export * from './agent';
|
|
4
|
+
export * from './constants';
|
|
5
|
+
export * from './agent-protocol';
|
|
6
|
+
export * from './agent-error';
|
|
7
|
+
export * from './transport_types';
|
|
8
|
+
export * from './utils';
|
|
9
|
+
export * from './hubs';
|
|
10
|
+
export * from './transports/ws-json-encoder';
|
|
11
|
+
export * from './transports/logging';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Browser-safe entry point.
|
|
18
|
+
// Excludes Node.js-only modules: transports/ws and agent-app-with-defaults.
|
|
19
|
+
// Bundlers that honour the "browser" condition in package.json will
|
|
20
|
+
// resolve this file instead of index.ts.
|
|
21
|
+
__exportStar(require("./agent-app"), exports);
|
|
22
|
+
__exportStar(require("./agent-server"), exports);
|
|
23
|
+
__exportStar(require("./agent"), exports);
|
|
24
|
+
__exportStar(require("./constants"), exports);
|
|
25
|
+
__exportStar(require("./agent-protocol"), exports);
|
|
26
|
+
__exportStar(require("./agent-error"), exports);
|
|
27
|
+
__exportStar(require("./transport_types"), exports);
|
|
28
|
+
__exportStar(require("./utils"), exports);
|
|
29
|
+
__exportStar(require("./hubs"), exports);
|
|
30
|
+
// Only the browser-safe transports (excludes ./transports/ws)
|
|
31
|
+
__exportStar(require("./transports/ws-json-encoder"), exports);
|
|
32
|
+
__exportStar(require("./transports/logging"), exports);
|
package/dist/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.92",
|
|
8
8
|
"description": "SDK for building Agent implementations that speak the agent protocol.",
|
|
9
9
|
"author": "Yaser Awajan",
|
|
10
10
|
"license": "MIT",
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
+
"browser": "./dist/index.browser.js",
|
|
18
19
|
"import": "./dist/index.js",
|
|
19
20
|
"require": "./dist/index.js",
|
|
20
21
|
"types": "./dist/index.d.ts"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
"
|
|
24
|
-
"node": ">=18.0.0"
|
|
25
|
-
},
|
|
24
|
+
"sideEffects": false,
|
|
26
25
|
"scripts": {
|
|
27
26
|
"build": "tsc -p tsconfig.json && cp package.json dist/",
|
|
28
27
|
"prepublishOnly": "yarn build",
|
|
@@ -31,13 +30,18 @@
|
|
|
31
30
|
"lint:fix": "yarn lint --fix"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
|
-
"@awarevue/api-types": "2.0.
|
|
33
|
+
"@awarevue/api-types": "2.0.92",
|
|
35
34
|
"rxjs": "^7.8.2",
|
|
36
35
|
"ws": "^8",
|
|
37
36
|
"zod": "4.4.3"
|
|
38
37
|
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"ws": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
39
43
|
"devDependencies": {
|
|
40
|
-
"@awarevue/api-types": "2.0.
|
|
44
|
+
"@awarevue/api-types": "2.0.92",
|
|
41
45
|
"@types/node": "^20.12.7",
|
|
42
46
|
"@types/ws": "^8.18.1",
|
|
43
47
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.92",
|
|
8
8
|
"description": "SDK for building Agent implementations that speak the agent protocol.",
|
|
9
9
|
"author": "Yaser Awajan",
|
|
10
10
|
"license": "MIT",
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
+
"browser": "./dist/index.browser.js",
|
|
18
19
|
"import": "./dist/index.js",
|
|
19
20
|
"require": "./dist/index.js",
|
|
20
21
|
"types": "./dist/index.d.ts"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
"
|
|
24
|
-
"node": ">=18.0.0"
|
|
25
|
-
},
|
|
24
|
+
"sideEffects": false,
|
|
26
25
|
"scripts": {
|
|
27
26
|
"build": "tsc -p tsconfig.json && cp package.json dist/",
|
|
28
27
|
"prepublishOnly": "yarn build",
|
|
@@ -31,13 +30,18 @@
|
|
|
31
30
|
"lint:fix": "yarn lint --fix"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
|
-
"@awarevue/api-types": "2.0.
|
|
33
|
+
"@awarevue/api-types": "2.0.92",
|
|
35
34
|
"rxjs": "^7.8.2",
|
|
36
35
|
"ws": "^8",
|
|
37
36
|
"zod": "4.4.3"
|
|
38
37
|
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"ws": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
39
43
|
"devDependencies": {
|
|
40
|
-
"@awarevue/api-types": "2.0.
|
|
44
|
+
"@awarevue/api-types": "2.0.92",
|
|
41
45
|
"@types/node": "^20.12.7",
|
|
42
46
|
"@types/ws": "^8.18.1",
|
|
43
47
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|