@awarevue/agent-sdk 1.1.14 → 2.0.1
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 +12 -8
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/dist/agent-app.js
CHANGED
|
@@ -72,7 +72,16 @@ class AgentApp {
|
|
|
72
72
|
.run$(context)
|
|
73
73
|
.pipe((0, rxjs_1.tap)((message) => this.options.transport.send(this.addEnvelope({ ...message, provider: context.provider })))),
|
|
74
74
|
// handle messages to agent
|
|
75
|
-
this.options.transport.messages$.pipe((0, rxjs_1.
|
|
75
|
+
this.options.transport.messages$.pipe((0, rxjs_1.startWith)(null), // emit immediately to ensure subscription is active
|
|
76
|
+
(0, rxjs_1.mergeMap)((message) => {
|
|
77
|
+
// Send start-rs on the first emission (null) to signal we're ready
|
|
78
|
+
if (message === null) {
|
|
79
|
+
this.options.transport.send(this.addEnvelope({
|
|
80
|
+
kind: 'start-rs',
|
|
81
|
+
requestId: context.startRequestId,
|
|
82
|
+
}));
|
|
83
|
+
return rxjs_1.EMPTY;
|
|
84
|
+
}
|
|
76
85
|
switch (message.kind) {
|
|
77
86
|
// handle commands
|
|
78
87
|
case 'command':
|
|
@@ -152,13 +161,7 @@ class AgentApp {
|
|
|
152
161
|
provider: message.provider,
|
|
153
162
|
config: message.config,
|
|
154
163
|
})
|
|
155
|
-
.pipe((0, rxjs_1.retry)({ delay: 3000 }), (0, rxjs_1.
|
|
156
|
-
// reply to server that we are starting
|
|
157
|
-
this.options.transport.send(this.addEnvelope({
|
|
158
|
-
kind: 'start-rs',
|
|
159
|
-
requestId: message.id,
|
|
160
|
-
}));
|
|
161
|
-
}), (0, rxjs_1.map)((deviceCatalog) => ({
|
|
164
|
+
.pipe((0, rxjs_1.retry)({ delay: 3000 }), (0, rxjs_1.map)((deviceCatalog) => ({
|
|
162
165
|
provider: message.provider,
|
|
163
166
|
config: message.config,
|
|
164
167
|
lastEventForeignRef: message.lastEventForeignRef,
|
|
@@ -166,6 +169,7 @@ class AgentApp {
|
|
|
166
169
|
? null
|
|
167
170
|
: Math.min(Date.now(), message.lastEventTimestamp),
|
|
168
171
|
deviceCatalog,
|
|
172
|
+
startRequestId: message.id,
|
|
169
173
|
})), (0, rxjs_1.mergeMap)((context) => this.runProvider$(context)))
|
|
170
174
|
: (0, rxjs_1.of)(message).pipe((0, rxjs_1.tap)(() => this.options.transport.send(this.addEnvelope({
|
|
171
175
|
kind: 'stop-rs',
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awarevue/agent-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
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": "^
|
|
30
|
+
"@awarevue/api-types": "^2.0.1",
|
|
31
31
|
"rxjs": "^7.8.2",
|
|
32
32
|
"ws": "^8",
|
|
33
33
|
"zod": "3.24.2"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awarevue/agent-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
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": "^
|
|
30
|
+
"@awarevue/api-types": "^2.0.1",
|
|
31
31
|
"rxjs": "^7.8.2",
|
|
32
32
|
"ws": "^8",
|
|
33
33
|
"zod": "3.24.2"
|