@indra.ai/deva 1.64.56 → 1.64.92
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.
- package/README.md +1 -1
- package/_config.yml +2 -2
- package/_data/guide.json +119 -0
- package/_data/msgs.json +4 -0
- package/_includes/header.html +1 -1
- package/guide/index.md +47 -0
- package/guide/step-1.md +99 -0
- package/guide/step-2.md +253 -0
- package/guide/step-3.md +159 -0
- package/guide/step-4.md +173 -0
- package/guide/step-5.md +222 -0
- package/guide/step-6.md +281 -0
- package/guide/step-7.md +247 -0
- package/guide/troubleshooting.md +116 -0
- package/index.js +2305 -2295
- package/package.json +1 -1
- package/tests/client.json +1 -0
- package/tests/index.js +3 -3
- package/tests/suite/01-init.test.js +3 -3
- package/tests/suite/09-ready-hash.test.js +1 -1
- package/vibe.md +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "31711622713594414221",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.64.
|
|
4
|
+
"version": "1.64.92",
|
|
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/tests/client.json
CHANGED
package/tests/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const DevaTest = new Deva({
|
|
|
63
63
|
console.log(`👔 prompt: ${packet.text}`);
|
|
64
64
|
},
|
|
65
65
|
'devacore:question'(packet) {
|
|
66
|
-
console.log(`🙋♂️️ question: ${packet.text}`);
|
|
66
|
+
console.log(`🙋♂️️ question: ${packet.q.text}`);
|
|
67
67
|
},
|
|
68
68
|
'devacore:start'(packet) {
|
|
69
69
|
console.log(`🟢 start: ${packet.text}`);
|
|
@@ -167,10 +167,10 @@ const DevaTest = new Deva({
|
|
|
167
167
|
`::END:SIGN:${license_check.id.uid}`,
|
|
168
168
|
'::::',
|
|
169
169
|
];
|
|
170
|
-
return {
|
|
170
|
+
return Promise.resolve({
|
|
171
171
|
text: data.join('\n'),
|
|
172
172
|
data,
|
|
173
|
-
};
|
|
173
|
+
});
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
methods: {
|
|
@@ -59,7 +59,7 @@ test('a failing feature step rejects init() and stops the chain', async () => {
|
|
|
59
59
|
for (const e of ['start', 'ready']) deva.events.on(`devacore:${e}`, () => seen.push(e));
|
|
60
60
|
deva.events.on('devacore:action', p => { if (p.value === 'feature') seen.push(p.text); });
|
|
61
61
|
|
|
62
|
-
await assert.rejects(deva.init(fresh({features:
|
|
62
|
+
await assert.rejects(deva.init(fresh({features: null})));
|
|
63
63
|
await wait(200);
|
|
64
64
|
assert.ok(!seen.includes('start') && !seen.includes('ready') && !seen.includes('onReady'), 'no lifecycle after the failure');
|
|
65
65
|
assert.ok(seen.some(t => t.includes('Feature:license')), 'license step ran');
|
|
@@ -68,10 +68,10 @@ test('a failing feature step rejects init() and stops the chain', async () => {
|
|
|
68
68
|
|
|
69
69
|
test('onError that calls reject rejects init()', async () => {
|
|
70
70
|
const deva = build({ onError(err, packet, reject) { return reject && reject(err); } });
|
|
71
|
-
await assert.rejects(deva.init(fresh({features:
|
|
71
|
+
await assert.rejects(deva.init(fresh({features: null})));
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
test('onError that never calls reject leaves init() pending (the hook owns the outcome)', async () => {
|
|
75
75
|
const deva = build({ onError() {} });
|
|
76
|
-
assert.equal(await status(deva.init(fresh({features:
|
|
76
|
+
assert.equal(await status(deva.init(fresh({features: null})), 500), 'pending');
|
|
77
77
|
});
|
|
@@ -21,7 +21,7 @@ const same = () => ({
|
|
|
21
21
|
listeners: { 'suite:ready'(packet) { return packet; } },
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const readyHash = deva => deva.
|
|
24
|
+
const readyHash = deva => deva._config.hash[deva.agent().key];
|
|
25
25
|
|
|
26
26
|
test('the ready hash is stable across two Devas with identical functions', async () => {
|
|
27
27
|
const a = build(same());
|
package/vibe.md
CHANGED
|
@@ -127,7 +127,7 @@ After `init`, the Deva walks through named steps. Each step does the same things
|
|
|
127
127
|
| exit | shutdown | `onExit` |
|
|
128
128
|
| shutdown | (finished) | `onShutdown` |
|
|
129
129
|
|
|
130
|
-
`ready` also seals your `vars`, `utils`, `listeners`, `modules`, `func` and `methods` into `
|
|
130
|
+
`ready` also seals your `vars`, `utils`, `listeners`, `modules`, `func` and `methods` into `this._config.hash[agent.key]` (a snapshot of how the office was set up) and starts each child Deva.
|
|
131
131
|
|
|
132
132
|
## Talking on the intercom: messaging
|
|
133
133
|
|
|
@@ -221,7 +221,7 @@ const client = Client.DATA; // carries the VLA and an entry for every client fea
|
|
|
221
221
|
const helper = new Deva({
|
|
222
222
|
info: {id: 'helper', name: 'Helper Deva', version: '0.0.1', dir: '.', VLA: pkg.VLA},
|
|
223
223
|
agent: {id: 'helper', key: 'helper', prompt: {emoji: '🛠', text: 'helper'}, profile: {name: 'Helper Deva'}},
|
|
224
|
-
config: {hash: {}}, //
|
|
224
|
+
config: {hash: {}}, // optional: ready() writes this._config.hash[agent.key]
|
|
225
225
|
vars: {context: {}}, // needed: context() looks things up here
|
|
226
226
|
methods: {
|
|
227
227
|
shout(packet) {
|