@economic/agents 2.0.0 → 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/v2.mjs +5 -5
- package/package.json +1 -1
package/dist/v2.mjs
CHANGED
|
@@ -81,7 +81,7 @@ var Agent = class extends Think {
|
|
|
81
81
|
}
|
|
82
82
|
async onStart() {
|
|
83
83
|
this.setState({
|
|
84
|
-
|
|
84
|
+
...this.initialState,
|
|
85
85
|
status: "connecting"
|
|
86
86
|
});
|
|
87
87
|
let hasCorrectBindings = true;
|
|
@@ -100,7 +100,7 @@ var Agent = class extends Think {
|
|
|
100
100
|
}
|
|
101
101
|
if (!hasCorrectBindings) {
|
|
102
102
|
this.setState({
|
|
103
|
-
|
|
103
|
+
...this.initialState,
|
|
104
104
|
status: "disconnected"
|
|
105
105
|
});
|
|
106
106
|
throw new Error("Could not connect to agent, bindings not found");
|
|
@@ -118,7 +118,7 @@ var Agent = class extends Think {
|
|
|
118
118
|
result = await verifyJwt(ctx.request, config);
|
|
119
119
|
} catch (error) {
|
|
120
120
|
this.setState({
|
|
121
|
-
|
|
121
|
+
...this.initialState,
|
|
122
122
|
status: "unauthorized"
|
|
123
123
|
});
|
|
124
124
|
console.error(`[Agent] JWT verification error - ${error}`);
|
|
@@ -127,7 +127,7 @@ var Agent = class extends Think {
|
|
|
127
127
|
}
|
|
128
128
|
if (!result.success) {
|
|
129
129
|
this.setState({
|
|
130
|
-
|
|
130
|
+
...this.initialState,
|
|
131
131
|
status: "unauthorized"
|
|
132
132
|
});
|
|
133
133
|
console.error(`[Agent] JWT verification error - ${result.message}`);
|
|
@@ -145,7 +145,7 @@ var Agent = class extends Think {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
this.setState({
|
|
148
|
-
|
|
148
|
+
...this.initialState,
|
|
149
149
|
status: "connected"
|
|
150
150
|
});
|
|
151
151
|
}
|