symposium 0.11.2 → 0.11.4

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/Agent.js +7 -8
  2. package/package.json +1 -1
package/Agent.js CHANGED
@@ -58,7 +58,7 @@ export default class Agent {
58
58
  async doInitThread(thread) {
59
59
  }
60
60
 
61
- async getThread(id, i) {
61
+ async getThread(id, i = 'default') {
62
62
  let thread = this.threads.get(id);
63
63
  if (thread) {
64
64
  if (thread.interface !== i)
@@ -161,15 +161,14 @@ export default class Agent {
161
161
  }
162
162
 
163
163
  async output(thread, msg) {
164
- const i = this.options.interfaces.find(i => i.name === thread.interface);
165
- if (i) {
166
- if (this.callbacks.hasOwnProperty(i + '-' + thread.id) && this.callbacks[i + '-' + thread.id].length) {
167
- const callback = this.callbacks[i + '-' + thread.id].shift();
168
- await callback(thread, msg);
169
- }
164
+ if (this.callbacks.hasOwnProperty(thread.interface + '-' + thread.id) && this.callbacks[thread.interface + '-' + thread.id].length) {
165
+ const callback = this.callbacks[thread.interface + '-' + thread.id].shift();
166
+ await callback(msg);
167
+ }
170
168
 
169
+ const i = this.options.interfaces.find(i => i.name === thread.interface);
170
+ if (i)
171
171
  return i.output(thread, msg);
172
- }
173
172
  }
174
173
 
175
174
  parseFunctions(message) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.11.2",
4
+ "version": "0.11.4",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",