@sprucelabs/sprucebot-llm 13.1.2 → 13.1.3

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.
@@ -82,6 +82,7 @@ class SprucebotLlmBotImpl extends mercury_event_emitter_1.AbstractEventEmitter {
82
82
  this.messages.push(m);
83
83
  }
84
84
  async updateState(newState) {
85
+ (0, schema_1.validateSchemaValues)(this.stateSchema, newState);
85
86
  this.state = { ...this.state, ...newState };
86
87
  await this.emit('did-update-state');
87
88
  }
@@ -18,6 +18,7 @@ class SprucebotLlmSkillImpl extends mercury_event_emitter_1.AbstractEventEmitter
18
18
  : undefined;
19
19
  }
20
20
  async updateState(updates) {
21
+ (0, schema_1.validateSchemaValues)(this.stateSchema, updates);
21
22
  this.state = { ...this.state, ...updates };
22
23
  await this.emit('did-update-state');
23
24
  }
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { AbstractEventEmitter } from '@sprucelabs/mercury-event-emitter';
11
- import { assertOptions, defaultSchemaValues, } from '@sprucelabs/schema';
11
+ import { assertOptions, defaultSchemaValues, validateSchemaValues, } from '@sprucelabs/schema';
12
12
  import { llmEventContract, } from '../llm.types.js';
13
13
  import TurnRequest from './TurnRequest.js';
14
14
  class SprucebotLlmBotImpl extends AbstractEventEmitter {
@@ -91,6 +91,7 @@ class SprucebotLlmBotImpl extends AbstractEventEmitter {
91
91
  }
92
92
  updateState(newState) {
93
93
  return __awaiter(this, void 0, void 0, function* () {
94
+ validateSchemaValues(this.stateSchema, newState);
94
95
  this.state = Object.assign(Object.assign({}, this.state), newState);
95
96
  yield this.emit('did-update-state');
96
97
  });
@@ -19,7 +19,7 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import { AbstractEventEmitter } from '@sprucelabs/mercury-event-emitter';
22
- import { defaultSchemaValues } from '@sprucelabs/schema';
22
+ import { defaultSchemaValues, validateSchemaValues, } from '@sprucelabs/schema';
23
23
  import { llmEventContract, } from '../llm.types.js';
24
24
  export default class SprucebotLlmSkillImpl extends AbstractEventEmitter {
25
25
  constructor(options) {
@@ -34,6 +34,7 @@ export default class SprucebotLlmSkillImpl extends AbstractEventEmitter {
34
34
  }
35
35
  updateState(updates) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
+ validateSchemaValues(this.stateSchema, updates);
37
38
  this.state = Object.assign(Object.assign({}, this.state), updates);
38
39
  yield this.emit('did-update-state');
39
40
  });
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "eta"
9
9
  ]
10
10
  },
11
- "version": "13.1.2",
11
+ "version": "13.1.3",
12
12
  "files": [
13
13
  "build"
14
14
  ],