@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.
Files changed (2) hide show
  1. package/dist/v2.mjs +5 -5
  2. 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
- type: "agent",
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
- type: "agent",
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
- type: "agent",
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
- type: "agent",
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
- type: "agent",
148
+ ...this.initialState,
149
149
  status: "connected"
150
150
  });
151
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/agents",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "A starter for creating a TypeScript package.",
5
5
  "license": "MIT",
6
6
  "bin": {