lisichatbot 1.9.5 → 1.9.7

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/package.json +1 -1
  2. package/src/index.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -2820,6 +2820,16 @@ async function showNextStep() {
2820
2820
  }
2821
2821
  }
2822
2822
 
2823
+ // ✅ NEW: Support updating chatState.data from onStart (moved outside updateCurrentStep block)
2824
+ if (result && typeof result === 'object' && result.data && typeof result.data === 'object') {
2825
+ console.log(` 📝 onStart returned data to update chatState.data:`, result.data);
2826
+ // Merge returned data into chatState.data
2827
+ Object.keys(result.data).forEach(key => {
2828
+ chatState.data[key] = result.data[key];
2829
+ console.log(` → chatState.data.${key} = ${JSON.stringify(result.data[key])}`);
2830
+ });
2831
+ }
2832
+
2823
2833
  // ✅ NEW: Check if onStart wants to jump to step by name
2824
2834
  if (result && typeof result === 'object' && result.goToStepName) {
2825
2835
  console.log(`🎯 onStart requested jump to step name: "${result.goToStepName}"`);