@awarevue/agent-sdk 2.0.26 → 2.0.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/agent-app.js +6 -9
- package/dist/package.json +2 -2
- package/dist/utils.js +7 -1
- package/package.json +2 -2
package/dist/agent-app.js
CHANGED
|
@@ -68,13 +68,7 @@ class AgentApp {
|
|
|
68
68
|
device: {},
|
|
69
69
|
zone: {},
|
|
70
70
|
};
|
|
71
|
-
return (0, rxjs_1.
|
|
72
|
-
// run the agent monitor
|
|
73
|
-
this.agent
|
|
74
|
-
.run$(context)
|
|
75
|
-
.pipe((0, rxjs_1.tap)((message) => this.options.transport.send(this.addEnvelope({ ...message, provider: context.provider })))),
|
|
76
|
-
// handle messages to agent
|
|
77
|
-
this.options.transport.messages$.pipe((0, rxjs_1.startWith)(null), // emit immediately to ensure subscription is active
|
|
71
|
+
return this.options.transport.messages$.pipe((0, rxjs_1.startWith)(null), // emit immediately to ensure subscription is active
|
|
78
72
|
(0, rxjs_1.mergeMap)((message) => {
|
|
79
73
|
// Send start-rs on the first emission (null) to signal we're ready
|
|
80
74
|
if (message === null) {
|
|
@@ -82,7 +76,10 @@ class AgentApp {
|
|
|
82
76
|
kind: 'start-rs',
|
|
83
77
|
requestId: context.startRequestId,
|
|
84
78
|
}));
|
|
85
|
-
return rxjs_1.
|
|
79
|
+
return (0, rxjs_1.of)(null).pipe((0, rxjs_1.delay)(1000), (0, rxjs_1.mergeMap)(() => this.agent.run$(context).pipe((0, rxjs_1.tap)((message) => this.options.transport.send(this.addEnvelope({
|
|
80
|
+
...message,
|
|
81
|
+
provider: context.provider,
|
|
82
|
+
}))))));
|
|
86
83
|
}
|
|
87
84
|
switch (message.kind) {
|
|
88
85
|
// handle commands
|
|
@@ -156,7 +153,7 @@ class AgentApp {
|
|
|
156
153
|
default:
|
|
157
154
|
return rxjs_1.EMPTY;
|
|
158
155
|
}
|
|
159
|
-
}))
|
|
156
|
+
}));
|
|
160
157
|
};
|
|
161
158
|
this.process$ = () => {
|
|
162
159
|
const registration$ = this.options.transport.connected$.pipe((0, rxjs_1.switchMap)((connected) => connected
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awarevue/agent-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
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": "^2.0.
|
|
30
|
+
"@awarevue/api-types": "^2.0.28",
|
|
31
31
|
"rxjs": "^7.8.2",
|
|
32
32
|
"ws": "^8",
|
|
33
33
|
"zod": "3.24.2"
|
package/dist/utils.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringifyError = void 0;
|
|
4
|
+
const agent_error_1 = require("./agent-error");
|
|
4
5
|
const stringifyError = (error) => {
|
|
5
6
|
if (error instanceof Error) {
|
|
6
|
-
|
|
7
|
+
if (error instanceof agent_error_1.AgentError && error.code === 'NOT_SUPPORTED') {
|
|
8
|
+
return `\nMessage: ${error.message}`;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return `\nMessage: ${error.message}\nStack: ${error.stack}`;
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
if (typeof error === 'string') {
|
|
9
15
|
return error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awarevue/agent-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
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": "^2.0.
|
|
30
|
+
"@awarevue/api-types": "^2.0.28",
|
|
31
31
|
"rxjs": "^7.8.2",
|
|
32
32
|
"ws": "^8",
|
|
33
33
|
"zod": "3.24.2"
|