@indra.ai/deva 1.62.97 → 1.63.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 (4) hide show
  1. package/README.md +1 -1
  2. package/index.js +16 -12
  3. package/package.json +1 -1
  4. package/vibe.md +0 -1
package/README.md CHANGED
@@ -83,7 +83,7 @@ Run it with `node examples/hello-world.js` and it prints `hello world`.
83
83
 
84
84
  Three things to know from this example:
85
85
 
86
- - **Do your work from `onReady`, not after `await init()`.** The `init()` promise currently resolves with `undefined` as soon as the client step finishes, before `start`, `enter`, `done` and `ready` have run. `onReady` is the reliable point where the Deva is fully up.
86
+ - **Do your work from `onReady`, not after `await init()`.** The `init()` promise currently resolves with client data as soon as the client step finishes, before `start`, `enter`, `done` and `ready` have run. `onReady` is the reliable point where the Deva is fully up.
87
87
  - **`info`, `config: {hash: {}}` and `vars.context` are effectively required.** Without them `ready()` or `context()` throws. The error handler then calls `context()` again, and the process ends in a stack overflow.
88
88
  - **Methods must return a Promise.** `answer()` calls `this.methods[method](packet).then(...)`.
89
89
 
package/index.js CHANGED
@@ -1066,6 +1066,10 @@ class Deva {
1066
1066
 
1067
1067
  // stamp the init data
1068
1068
  const data_stamped = this._stamp(data, 'init', data.id.uid);
1069
+
1070
+ const step = (name, ...args) => new Promise((res, rej) => {
1071
+ this[name](...args, res, rej);
1072
+ });
1069
1073
 
1070
1074
  this.events.setMaxListeners(this.maxListeners);
1071
1075
  this._assignInherit().then(() => {
@@ -1079,29 +1083,29 @@ class Deva {
1079
1083
  this.action('init', data.id.uid);
1080
1084
  this.state('init', data.id.uid);
1081
1085
 
1082
- return this.Client(client, resolve, reject);
1086
+ return step('Client', client);
1083
1087
  }).then(() => {
1084
- return this.License(resolve, reject);
1088
+ return step('License');
1085
1089
  }).then(() => {
1086
- return this.Error(resolve, reject);
1090
+ return step('Error');
1087
1091
  }).then(() => {
1088
- return this.Log(resolve, reject);
1092
+ return step('Log');
1089
1093
  }).then(() => {
1090
- return this.Data(resolve, reject);
1094
+ return step('Data');
1091
1095
  }).then(() => {
1092
- return this.Report(resolve, reject);
1096
+ return step('Report');
1093
1097
  }).then(() => {
1094
- return this.Legal(resolve, reject);
1098
+ return step('Legal');
1095
1099
  }).then(() => {
1096
- return this.Security(resolve, reject);
1100
+ return step('Security');
1097
1101
  }).then(() => {
1098
- return this.Support(resolve, reject);
1102
+ return step('Support');
1099
1103
  }).then(() => {
1100
- return this.Services(resolve, reject);
1104
+ return step('Services');
1101
1105
  }).then(() => {
1102
- return this.Systems(resolve, reject);
1106
+ return step('Systems');
1103
1107
  }).then(() => {
1104
- return this.Done(resolve, reject);
1108
+ return step('Done');
1105
1109
  }).then(() => {
1106
1110
  const hasOnInit = this.onInit && typeof this.onInit === 'function';
1107
1111
  if (hasOnInit) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "31711622713594414221",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.62.97",
4
+ "version": "1.63.1",
5
5
  "description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
6
6
  "main": "index.js",
7
7
  "license": "VLA:31711622713594414221 LICENSE.md",
package/vibe.md CHANGED
@@ -311,7 +311,6 @@ Why it's "safe":
311
311
 
312
312
  ### Current limits (true at version 1.62.92)
313
313
 
314
- - **`init()` resolves too early. A fix is planned for 1.63.** Right now the `init()` promise resolves with `undefined` as soon as the client step finishes, before `start`, `enter`, `done` and `ready` have run. In our recipe, `init resolved with: undefined` printed before `onReady` had done any work. Until the fix ships, wait for `onReady` or `devacore:ready`, and don't trust the `init` promise as a "ready" signal.
315
314
  - **Errors during the client feature chain don't stop start-up.** Because of the same early resolve, if the client object is missing feature settings, each feature step announces a `devacore:error` (in our test: `Cannot read properties of undefined (reading 'license')`, and the same for the others), but `init` has already resolved and the Deva still reaches `onReady`. Listen for `devacore:error` so you notice.
316
315
  - **Unknown names are silent.** A name that isn't in `_data` (or your agent's additions) makes `feature`, `zone`, `action`, `state`, `intent` and `belief` do nothing at all. That keeps the vocabulary strict, but a typo, or a name removed from `_data` in a later version, can quietly drop logbook lines. Check the lists after upgrading.
317
316
  - **`npm test` has no assertions yet.** It runs a Deva through its lifecycle and passes as long as nothing throws. Assertion tests are planned. Until then, "tests pass" means "it didn't crash," not "it did the right thing."