@indra.ai/deva 1.60.2 β 1.60.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.
- package/README.md +229 -399
- package/examples/agent.json +47 -93
- package/examples/client.json +101 -75
- package/examples/hello-world.js +70 -55
- package/index.js +5 -5
- package/package.json +1 -1
- package/tests/index.js +2 -2
package/README.md
CHANGED
|
@@ -1,489 +1,319 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
Deva is a Node.js module designed to simplify the development of multi-agent systems by providing a consistent foundation for agent interactions. With Deva, developers can quickly create and manage a network of agents that can communicate and collaborate seamlessly. Deva offers features such as private and public socket communication, secure encryption, and consistent message passing. It also provides built-in support for interacting with various APIs, including YouTube, Twitter, Discord, IBM Watson, and ChatGPT. By using Deva, developers can save time and resources in building and integrating basic agent functionalities, and focus on developing more advanced features.
|
|
5
|
-
|
|
6
|
-
## Description
|
|
7
|
-
|
|
8
|
-
The Deva module is a JavaScript library for building multi-agent systems that can communicate with each other and with external services. It provides a unified API for creating agents and defining their behaviors, and includes tools for handling communication between agents and for integrating with third-party APIs. The Deva module is designed to be flexible and customizable, allowing developers to easily create complex systems that can perform a wide range of tasks, from data collection and analysis to chatbot interactions and image generation. The module is written in JavaScript and can be used with Node.js, making it easy to integrate with other JavaScript libraries and tools.
|
|
9
|
-
|
|
10
|
-
## Core Features
|
|
11
|
-
The core features in the @indra.ai deva.core encompass a wide range of functionalities and capabilities. Here's a brief overview of each feature:
|
|
12
|
-
|
|
13
|
-
1. Security Feature
|
|
14
|
-
2. Guard Feature
|
|
15
|
-
3. Defense Feature
|
|
16
|
-
4. Support Feature
|
|
17
|
-
5. Services Feature
|
|
18
|
-
6. Systems Feature
|
|
19
|
-
7. Networks Feature
|
|
20
|
-
8. Legal Feature
|
|
21
|
-
9. Justice Feature
|
|
22
|
-
10. Authority Feature
|
|
23
|
-
|
|
24
|
-
These core features work together to provide a comprehensive and robust platform for users, covering essential aspects such as security, support, services, Legal, Authority, and more.
|
|
25
|
-
|
|
26
|
-
## Functions
|
|
27
|
-
|
|
28
|
-
1. **Class Structure:** The code follows an object-oriented programming approach by defining a `Deva` class. This allows for encapsulation of properties and methods related to the agent.
|
|
29
|
-
2. **State Management:** The `Deva` class has a state management system represented by the `_state` property and the `_states` object. It allows the agent to transition between different states and perform actions based on the current state.
|
|
30
|
-
3. **Event System:** The code utilizes an event system by extending the `EventEmitter` class and creating an `events` object. This enables communication and collaboration between different components of the agent and other entities in the system.
|
|
31
|
-
4. **Modularity and Inheritance:** The code demonstrates modularity by separating functionalities into different objects such as `config`, `lib`, `methods`, and `listeners`. It also showcases inheritance by assigning inherited properties to child Deva instances.
|
|
32
|
-
5. **Error Handling:** The code includes an error handling mechanism through the `error` method. It allows for uniform error reporting and the execution of custom error handling logic.
|
|
33
|
-
6. **Promises:** Promises are used in several asynchronous operations, such as initializing the agent, loading Deva models, and handling method calls. Promises ensure that the code can handle asynchronous operations in a structured and controlled manner.
|
|
34
|
-
7. **Event-driven Architecture:** The code follows an event-driven architecture where different events trigger specific actions or callbacks. This enables loose coupling and flexibility in the agent's behavior and interactions with other components.
|
|
35
|
-
8. **Extensibility:** The code provides hooks for custom logic through methods like `onInit`, `onStart`, `onStop`, `onEnter`, `onExit`, and `onDone`. These allow developers to extend the functionality of the agent by adding custom code at specific stages of its lifecycle.
|
|
36
|
-
9. **Messaging and Communication:** The `talk` and `listen` methods facilitate messaging and communication between agents. Agents can ask questions (`ask` method) and receive responses, enabling interaction and collaboration.
|
|
37
|
-
10. **Utility Functions:** The code includes utility functions like generating unique IDs (`uid` method), hashing data (`hash` method), and handling event listeners (`listen`, `once`, `ignore` methods).
|
|
38
|
-
|
|
39
|
-
## contents
|
|
40
|
-
- [install](#install) - How to install the deva core.
|
|
41
|
-
- [structure](#structure) - Basic structure of `deva`.
|
|
42
|
-
- [agent](#agent) - The `agent` object stores the Agent Profile.
|
|
43
|
-
- [vars](#vars) - Variables are stored in the `this.vars` object.
|
|
44
|
-
- [listeners](#listeners) - Listeners are setup to allow a deva trigger events.
|
|
45
|
-
- [devas](#listeners) - This is where sub-devas are loaded into the current deva.
|
|
46
|
-
- [modules](#modules) - A `deva` can add modules to add to their functionality.
|
|
47
|
-
- [func](#func) - A `deva` the internal functionality is written here.
|
|
48
|
-
- [methods](#methods) - Methods expose the `deva` abilities to external commands/calls.
|
|
49
|
-
- [states](#states) - There are various states that triger when a `deva` is doing things.
|
|
50
|
-
- [utility](#utility) - Interal to a `deva` there are utility functions available to make actions easier like getting a unique id or status.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## install
|
|
54
|
-
```bash
|
|
55
|
-
$ npm i @indra.ai/deva --save
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## structure
|
|
59
|
-
```javascript
|
|
60
|
-
import Deva from '@indra.ai/deva';
|
|
61
|
-
import pkg from './package.json' with {type:'json'};
|
|
62
|
-
const {agent,vars} = pkg.data;
|
|
63
|
-
|
|
64
|
-
// set the __dirname
|
|
65
|
-
import {dirname} from 'node:path';
|
|
66
|
-
import {fileURLToPath} from 'node:url';
|
|
67
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
68
|
-
|
|
69
|
-
const info = {
|
|
70
|
-
id: pkg.id,
|
|
71
|
-
name: pkg.name,
|
|
72
|
-
describe: pkg.description,
|
|
73
|
-
version: pkg.version,
|
|
74
|
-
url: pkg.homepage,
|
|
75
|
-
dir: __dirname,
|
|
76
|
-
git: pkg.repository.url,
|
|
77
|
-
bugs: pkg.bugs.url,
|
|
78
|
-
author: pkg.author,
|
|
79
|
-
license: pkg.license,
|
|
80
|
-
copyright: pkg.copyright,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const DEVA = new Deva({
|
|
84
|
-
info, // info packet to store entity meta information.
|
|
85
|
-
agent, // the agent profile from the package data.
|
|
86
|
-
vars, // the variables the agent uses from the package data.
|
|
87
|
-
utils: {
|
|
88
|
-
translate(input) {return input.trim();},
|
|
89
|
-
parse(input) {return input.trim();},
|
|
90
|
-
process(input) {return input.trim();}
|
|
91
|
-
},
|
|
92
|
-
listeners: {},
|
|
93
|
-
modules: {},
|
|
94
|
-
deva: {},
|
|
95
|
-
func: {
|
|
96
|
-
list(opts) {
|
|
97
|
-
return [
|
|
98
|
-
"test 1",
|
|
99
|
-
"test 2",
|
|
100
|
-
"test 3",
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
methods: {
|
|
105
|
-
list(packet) {
|
|
106
|
-
this.context('list', packet.id);
|
|
107
|
-
this.action('method', `list:${packet.id}`);
|
|
108
|
-
return new Promise((resolve, reject) => {
|
|
109
|
-
try {
|
|
110
|
-
const data = this.func.data(packet.q);
|
|
111
|
-
return resolve({
|
|
112
|
-
text: `See Data`,
|
|
113
|
-
html: `See Data`,
|
|
114
|
-
data,
|
|
115
|
-
});
|
|
116
|
-
} catch (err) {
|
|
117
|
-
return this.error(err, packet, reject);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
onReady(data, resolve) {
|
|
123
|
-
this.prompt(this.vars.messages.ready);
|
|
124
|
-
return resolve(data);
|
|
125
|
-
},
|
|
126
|
-
onError(err, data, reject) {
|
|
127
|
-
this.prompt(this.vars.messages.error);
|
|
128
|
-
console.log(err);
|
|
129
|
-
return reject(err);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
export default DEVA
|
|
133
|
-
```
|
|
1
|
+
# Deva Core
|
|
134
2
|
|
|
135
|
-
|
|
3
|
+
**`@indra.ai/deva` Β· v1.60.2**
|
|
136
4
|
|
|
137
|
-
|
|
138
|
-
this.agent();
|
|
139
|
-
```
|
|
5
|
+
Deva Core is a Vedic-inspired, event-based, context-aware Feature, Zone, Action and State machine framework for building integrated artificial intelligence agents ("Devas") in Node.js. Every Deva is one `Deva` class instance on a shared event bus. As it works, it moves through named features, zones, actions, states, intents, beliefs and contexts, and it broadcasts each step as an event. Every packet it builds is stamped with cumulative md5, sha256 and sha512 hashes.
|
|
140
6
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- **id:** The Agent id generated by `this.uid()`.
|
|
144
|
-
- **key:** The key to reference the agent by on the network.
|
|
145
|
-
- **prompt:** The prompt configuration for the entity.
|
|
146
|
-
- **emoji:** The emoji the for the agent.
|
|
147
|
-
- **text:** Algorithm,
|
|
148
|
-
- **colors:** The colors for the agent on the prompt. As each agent can set custom prompt colors.
|
|
149
|
-
- **label:** The label colors for the agent prompt.
|
|
150
|
-
- **R:** The red value 0 to 255.
|
|
151
|
-
- **G:** The green value 0 to 255.
|
|
152
|
-
- **B:** The blue value 0 to 255.
|
|
153
|
-
- **text:** The text colors for the agent prompt.
|
|
154
|
-
- **R:** The red value 0 to 255.
|
|
155
|
-
- **G:** The green value 0 to 255.
|
|
156
|
-
- **B:** The blue value 0 to 255.
|
|
157
|
-
- **profile:** The Agent profile configuration data.
|
|
158
|
-
- **name:** The name of the agent.
|
|
159
|
-
- **hashtag:** The hashtag to reference the agent by.
|
|
160
|
-
- **title:** Title of the Agent for media display.
|
|
161
|
-
- **subtitle:** Subtitle of the agent for extra context.
|
|
162
|
-
- **describe:** Short description of the agent to build from.
|
|
163
|
-
- **tweet:** The tweet/post that the agent will share about itself.
|
|
164
|
-
- **hashtags:** Comma list of hashtags to add when posting tweets/posts.
|
|
165
|
-
- **pronouns:** The pronounds the agent will be going by.
|
|
166
|
-
- **gender:** The gender of the agent as pronouns are how they identify and gender is their orientation.
|
|
167
|
-
- **style:** The personal style that reflects the agent/entity.
|
|
168
|
-
- **voice:** The voice profile the entity will use when speaking.
|
|
169
|
-
- **system:** The system the entity/agent is assigned to.
|
|
170
|
-
- **layout:** The display layout templte the entity uses for their personal presentation.
|
|
171
|
-
- **color:** The text color for the presentation layer.
|
|
172
|
-
- **bgcolor:** The background color for the entity presentatino layer.
|
|
173
|
-
- **emoji:** A graphic that represents the entity personal emoji.
|
|
174
|
-
- **avatar:** A graphic that represents the entity/agent personal avatar.
|
|
175
|
-
- **image:** A graphic that represents the entity overall image.
|
|
176
|
-
- **background:** The background graphic for the presentation layer.
|
|
177
|
-
- **owner:** The name of the owner of the agent/entity.
|
|
178
|
-
- **creator:** The name of the creator of the agent/entity.
|
|
179
|
-
- **created:** The date and time the entity/agent was created.
|
|
180
|
-
|
|
181
|
-
## vars
|
|
7
|
+
> Deva Core is distributed under the **Vedic License Agreement (VLA)**. Read [License](#license) before you use it.
|
|
182
8
|
|
|
183
|
-
|
|
184
|
-
this.vars
|
|
185
|
-
```
|
|
9
|
+
## Contents
|
|
186
10
|
|
|
187
|
-
|
|
11
|
+
1. [Requirements](#requirements)
|
|
12
|
+
2. [Install](#install)
|
|
13
|
+
3. [Quick start](#quick-start)
|
|
14
|
+
4. [Constructor options](#constructor-options)
|
|
15
|
+
5. [Lifecycle](#lifecycle)
|
|
16
|
+
6. [Messaging: question, answer, ask, talk, listen](#messaging)
|
|
17
|
+
7. [The packet](#the-packet)
|
|
18
|
+
8. [Stamping and the hash tiers](#stamping-and-the-hash-tiers)
|
|
19
|
+
9. [The workflow: features, zones, actions, states, intents, beliefs, contexts](#the-workflow)
|
|
20
|
+
10. [Events](#events)
|
|
21
|
+
11. [Error handling](#error-handling)
|
|
22
|
+
12. [Configuration files](#configuration-files)
|
|
23
|
+
13. [Testing](#testing)
|
|
24
|
+
14. [Method reference](#method-reference)
|
|
25
|
+
15. [License](#license)
|
|
26
|
+
16. [Links and author](#links-and-author)
|
|
188
27
|
|
|
189
|
-
|
|
28
|
+
## Requirements
|
|
190
29
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
foo: 'bar',
|
|
195
|
-
steps: 10,
|
|
196
|
-
strings: 'Some variable string',
|
|
197
|
-
adding: 1 + 9 + 11,
|
|
198
|
-
objects: {
|
|
199
|
-
key: 'key value'
|
|
200
|
-
},
|
|
201
|
-
arrays: [
|
|
202
|
-
'value 1',
|
|
203
|
-
'value 2',
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
```
|
|
30
|
+
- Node.js **22 or later** (`engines.node: ">=22"`), npm 9.5.1 or later.
|
|
31
|
+
- ES modules only. The package is `"type": "module"` and uses JSON import attributes (`import x from './x.json' with {type: 'json'}`). `require()` won't work.
|
|
32
|
+
- A **client object that carries a VLA** matching the one in Deva Core's `package.json`. `init()` refuses to start without it (see [Lifecycle](#lifecycle)).
|
|
207
33
|
|
|
208
|
-
##
|
|
209
|
-
Listeners are what you setup that allow your Deva to communicate with other Deva or parts of your application/system.
|
|
34
|
+
## Install
|
|
210
35
|
|
|
211
|
-
```
|
|
212
|
-
|
|
36
|
+
```bash
|
|
37
|
+
npm install @indra.ai/deva
|
|
213
38
|
```
|
|
214
39
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
Each Deva comes with a set of default listeners to provide basic functionality.
|
|
40
|
+
## Quick start
|
|
218
41
|
|
|
219
|
-
|
|
220
|
-
This will trigger an event to start the Deva.
|
|
42
|
+
This is a minimal working Deva with one method. `client.json` is a client file shaped like [`tests/client.json`](tests/client.json). Its `DATA.VLA` must match the `VLA` block in Deva Core's `package.json`.
|
|
221
43
|
|
|
222
44
|
```javascript
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
### stop
|
|
227
|
-
This will trigger an event to stop the Deva.
|
|
45
|
+
import Deva from '@indra.ai/deva';
|
|
46
|
+
import Client from './client.json' with {type: 'json'};
|
|
228
47
|
|
|
229
|
-
|
|
230
|
-
this.talk(`*agent_key*:stop`);
|
|
231
|
-
```
|
|
48
|
+
const client = Client.DATA; // must carry a VLA matching the Deva Core package VLA
|
|
232
49
|
|
|
233
|
-
|
|
234
|
-
|
|
50
|
+
const hello = new Deva({
|
|
51
|
+
info: {id: 'hello', name: 'Hello Deva', version: '0.0.1', VLA: client.VLA},
|
|
52
|
+
agent: {
|
|
53
|
+
id: 'hello',
|
|
54
|
+
key: 'hello',
|
|
55
|
+
prompt: {emoji: 'π', text: 'hello'},
|
|
56
|
+
profile: {name: 'Hello Deva'},
|
|
57
|
+
},
|
|
58
|
+
config: {hash: {}}, // required: ready() writes this.config.hash[agent.key]
|
|
59
|
+
vars: {context: {}}, // required: context() looks up this.vars.context
|
|
60
|
+
listeners: {
|
|
61
|
+
'devacore:error'(packet) {
|
|
62
|
+
console.log('error:', packet.error.message);
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
greet(packet) {
|
|
67
|
+
return Promise.resolve({text: `hello ${packet.q.text}`});
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
async onReady(data, resolve) {
|
|
71
|
+
const packet = await this.question('/greet world');
|
|
72
|
+
console.log(packet.a.text); // hello world
|
|
73
|
+
return resolve(data);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
235
76
|
|
|
236
|
-
|
|
237
|
-
this.talk(`*agent_key*:status`);
|
|
77
|
+
hello.init(client);
|
|
238
78
|
```
|
|
239
79
|
|
|
240
|
-
|
|
80
|
+
Run it with `node hello.mjs` and it prints `hello world`. This sample was run against v1.60.2.
|
|
241
81
|
|
|
242
|
-
|
|
243
|
-
this.devas
|
|
244
|
-
```
|
|
82
|
+
Three things to know from this example:
|
|
245
83
|
|
|
246
|
-
The
|
|
84
|
+
- **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.
|
|
85
|
+
- **`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.
|
|
86
|
+
- **Methods must return a Promise.** `answer()` calls `this.methods[method](packet).then(...)`.
|
|
247
87
|
|
|
248
|
-
##
|
|
88
|
+
## Constructor options
|
|
249
89
|
|
|
250
|
-
|
|
90
|
+
`new Deva(opts)` accepts:
|
|
251
91
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
92
|
+
| Option | What it is |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `id` | Instance id. Defaults to `randomUUID()`. |
|
|
95
|
+
| `info` | Package-style info object (`id`, `name`, `version`, `dir`, `VLA`, ...). Returned by `info()`. `info.VLA.uid` goes into every `uid()`. |
|
|
96
|
+
| `agent` | The agent profile: `id`, `key` (the Deva's name on the bus), `prompt`, `profile` (`name`, and optional `warning`, `notice`, `copyright`, `status`, `vectors`, `owner`, `creator`, `salute`). It can also carry custom `zones`, `actions`, `intents`, `beliefs` and `messages`, which are merged in without overwriting the core ones. |
|
|
97
|
+
| `config` | Local config. Needs a `hash` object. Can set `timeout.ask` in ms (default `30000`, `0` disables it). |
|
|
98
|
+
| `vars` | Free-form variables on `this.vars`. `vars.context` maps context keys to display text. |
|
|
99
|
+
| `utils`, `func` | Your helper functions. Bound to the Deva at `init`. |
|
|
100
|
+
| `methods` | Public commands, reachable by `question('/name ...')` or by another Deva's `#key name ...`. Bound at `init`. Each takes a packet and returns a Promise of a string or `{text, html, data}`. |
|
|
101
|
+
| `listeners` | `{eventName: handler}`. Bound and registered on the event bus at `init`. |
|
|
102
|
+
| `devas` | Child Deva instances. They inherit `events`, `lib` and `config` and are `init`'d during `ready`. |
|
|
103
|
+
| `modules` | Third-party modules for your own use. |
|
|
104
|
+
| `events` | An existing `EventEmitter` to share. Defaults to a new one. |
|
|
105
|
+
| `maxListeners` | Passed to `events.setMaxListeners`. Default `0` (unlimited). |
|
|
106
|
+
| Lifecycle hooks | `onInit`, `onStart`, `onEnter`, `onDone`, `onReady`, `onFinish`, `onComplete`, `onStop`, `onClose`, `onLeave`, `onExit`, `onShutdown`, `onError`. |
|
|
255
107
|
|
|
256
|
-
|
|
257
|
-
The functions that your deva uses to operate. Functions are not exposed through
|
|
258
|
-
the api to public access.
|
|
108
|
+
Any other top-level option is copied onto the instance, as long as it doesn't clash with an existing property.
|
|
259
109
|
|
|
260
|
-
|
|
261
|
-
this.func
|
|
262
|
-
```
|
|
110
|
+
## Lifecycle
|
|
263
111
|
|
|
264
|
-
###
|
|
265
|
-
```javascript
|
|
266
|
-
this.methods
|
|
267
|
-
```
|
|
112
|
+
### Start-up: `init(client)`
|
|
268
113
|
|
|
269
|
-
|
|
270
|
-
|
|
114
|
+
1. Hashes the core package data (md5, sha256, sha512).
|
|
115
|
+
2. Runs `license_check(client.VLA, core.VLA)`, comparing sha256 hashes of the two VLA objects. On a mismatch it prompts and resolves with `β The Provided Client License Is Invalid`, and the Deva stays inactive.
|
|
116
|
+
3. Marks the Deva active, then inherits into child devas, binds `listeners`/`methods`/`utils`/`func`/`lib`, and registers listeners.
|
|
117
|
+
4. Runs the client feature chain: `Client`, then `License`, `Error`, `Log`, `Data`, `Report`, `Communication`, `Treasury`, `Justice`, `Authority`, `Legal`, `Owner`, `Security`, `Medical`, `Support`, `Services`, `Systems`, `Networks`, `Veda`, then `Done`. For each one that the client's `features` object defines, the Deva stores `this._<feature>` = `{client_id, client_name, concerns, global, personal}`, where `personal` is the entry under `devas[agent.key]`. Methods found in `client.features[x].methods` are bound into `this.methods`.
|
|
118
|
+
5. Calls `onInit(data, resolve)` if you defined it, otherwise `start`.
|
|
271
119
|
|
|
272
|
-
|
|
273
|
-
Provided are a set of state functions that trigger when a Deva is at various states of starting/stopping.
|
|
120
|
+
### The invoke chain
|
|
274
121
|
|
|
275
|
-
|
|
122
|
+
`start`, `enter`, `done`, `ready`, `finish`, `complete`, `stop`, `close`, `leave`, `exit` and `shutdown` all run through `_invoke`. Each step sets the context, zone, action and state to its key, writes a timestamp under that key on the data (`data.start = Date.now()` and so on), re-stamps the data, and emits its `devacore:<key>` event. Then:
|
|
276
123
|
|
|
277
|
-
|
|
124
|
+
- if an `on<Key>` hook exists, it calls `on<Key>(data, resolve)`, and **the hook decides what happens next**: call the next step (`this.enter(data, resolve)`) or `resolve(data)`;
|
|
125
|
+
- otherwise it moves on to the next step itself.
|
|
278
126
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
127
|
+
| Step | Next by default | Hook |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| start | enter | onStart |
|
|
130
|
+
| enter | done | onEnter |
|
|
131
|
+
| done | ready | onDone |
|
|
132
|
+
| ready | (resolve) | onReady |
|
|
133
|
+
| finish | complete | onFinish |
|
|
134
|
+
| complete | (resolve) | onComplete |
|
|
135
|
+
| stop | close | onStop |
|
|
136
|
+
| close | leave | onClose |
|
|
137
|
+
| leave | exit | onLeave |
|
|
138
|
+
| exit | shutdown | onExit |
|
|
139
|
+
| shutdown | (resolve) | onShutdown |
|
|
284
140
|
|
|
285
|
-
|
|
141
|
+
`ready` also stores sha256 hashes of `vars`, `utils`, `listeners`, `modules`, `func` and `methods` in `config.hash[agent.key]`, and `init`s each child Deva in `devas`.
|
|
286
142
|
|
|
287
|
-
|
|
143
|
+
`finish` and `complete` wrap every answer (see [Messaging](#messaging)).
|
|
288
144
|
|
|
289
|
-
|
|
290
|
-
this.onStop() {
|
|
291
|
-
// some code to run when the deva stops
|
|
292
|
-
}
|
|
293
|
-
```
|
|
145
|
+
### Shutdown: `stop()`
|
|
294
146
|
|
|
295
|
-
|
|
147
|
+
`stop()` returns a Promise and runs `stop`, `close`, `leave`, `exit` and `shutdown`. `exit` clears the inherited feature data (`_license`, `_security`, and so on). `shutdown` removes listeners and pending asks, and clears `modules`, `listeners`, `events`, `_config` and `_active`. After that, the Deva answers most calls with `βοΈ OFFLINE`. With no hooks defined, `await deva.stop()` resolves with the data object, whose `key` is `'shutdown'`.
|
|
296
148
|
|
|
297
|
-
|
|
149
|
+
## Messaging
|
|
298
150
|
|
|
299
|
-
|
|
300
|
-
this.onEnter() {
|
|
301
|
-
// some code to run when the deva is loaded
|
|
302
|
-
}
|
|
303
|
-
```
|
|
151
|
+
### `question(text, data=false)`
|
|
304
152
|
|
|
305
|
-
|
|
153
|
+
`question` is the entry point. It returns a Promise and reads the first word of `text`:
|
|
306
154
|
|
|
307
|
-
|
|
155
|
+
| Form | Example | What happens |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| Command (`/`) | `/greet world` | Calls local `methods.greet` through `answer()`. `packet.q.text` is `world`. A `/method:a:b` form puts `['method','a','b']` in `meta.params`. |
|
|
158
|
+
| Ask (`#`) | `#helper shout hi` | Sends the packet to the Deva whose agent key is `helper` and waits for its reply. |
|
|
159
|
+
| Plain text | `hi there` | Calls `methods.question`, if you defined one. |
|
|
308
160
|
|
|
309
|
-
|
|
310
|
-
this.onExit() {
|
|
311
|
-
// some code to run when the deva logs out.
|
|
312
|
-
}
|
|
313
|
-
```
|
|
161
|
+
Unknown methods resolve to a packet whose `a.text` is `βοΈ METHOD NOT FOUND <agent> <method>`.
|
|
314
162
|
|
|
315
|
-
###
|
|
163
|
+
### Ask between Devas
|
|
316
164
|
|
|
317
|
-
The `
|
|
165
|
+
For `#key method text`, the asking Deva emits `key:ask` and waits once on `key:ask:<packet uid>`. The target's `ask(packet)` runs `methods[method]`, builds `packet.a`, and replies on that event. The asker then runs `finish`/`complete` and resolves. Each Deva listens on `<its key>:ask` automatically, as part of the state listeners registered at `init`.
|
|
318
166
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
// some code to run when the deva logs out.
|
|
322
|
-
}
|
|
323
|
-
```
|
|
167
|
+
- If nobody is listening on `key:ask`, it resolves right away with `βοΈ ASK TARGET NOT FOUND`.
|
|
168
|
+
- If no reply comes within `config.timeout.ask` (default 30 s), it resolves with `βοΈ ASK TIMEOUT`.
|
|
324
169
|
|
|
325
|
-
|
|
170
|
+
Tested: a parent Deva with `devas: {helper}` asked `#helper shout hi there` and got `HI THERE` back, with `a.meta.key === 'helper'`.
|
|
326
171
|
|
|
327
|
-
|
|
172
|
+
### Events directly
|
|
328
173
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
```
|
|
174
|
+
- `talk(evt, packet)` emits on the bus and returns `true` if anyone was listening.
|
|
175
|
+
- `listen(evt, callback)`, `once(evt, callback)` and `ignore(evt, callback)` add, add-once and remove listeners.
|
|
176
|
+
- `prompt(text)` emits a stamped `devacore:prompt` packet.
|
|
334
177
|
|
|
335
|
-
##
|
|
178
|
+
## The packet
|
|
336
179
|
|
|
337
|
-
|
|
180
|
+
A packet resolved from `question()` looks like this (keys in order, verified):
|
|
338
181
|
|
|
339
|
-
|
|
182
|
+
```text
|
|
183
|
+
packet: id, q, a, created, finish, complete, md5, sha256, sha512
|
|
184
|
+
q: id, agent, client, meta{key, method, params}, text, data, created, md5, sha256, sha512
|
|
185
|
+
a: id, agent, client, meta{key, method, params}, text, html, data, created, md5, sha256, sha512
|
|
186
|
+
```
|
|
340
187
|
|
|
341
|
-
|
|
188
|
+
- `id` is a `uid()` object, not a string: `uid, time, iso, utc, date, license, fingerprint, client, agent, machine, core_hash, status, warning, notice, vectors, owner, creator, salute, copyright, md5, sha256, sha512`. Use `packet.id.uid` for the id value. `uid(true)` uses a random UUID for `uid`. The default is a time-based numeric id.
|
|
189
|
+
- `agent` and `client` are copies with their own hashes.
|
|
190
|
+
- `finish` and `complete` are timestamps added by those steps.
|
|
191
|
+
- A method's result becomes `a.text`, `a.html` and `a.data`. A plain string result fills `text`.
|
|
342
192
|
|
|
343
|
-
|
|
193
|
+
## Stamping and the hash tiers
|
|
344
194
|
|
|
345
|
-
|
|
195
|
+
Deva Core hashes in three tiers, in the order `config.hashes = ['md5', 'sha256', 'sha512']`:
|
|
346
196
|
|
|
197
|
+
| Tier | Intended use |
|
|
198
|
+
|---|---|
|
|
199
|
+
| md5 | Fast, everyday (civilian) verification |
|
|
200
|
+
| sha256 | Government and authority verification |
|
|
201
|
+
| sha512 | Military, agency and legal high-security use |
|
|
347
202
|
|
|
348
|
-
|
|
349
|
-
// async await
|
|
350
|
-
const question = await this.question('#*agent_key* *method*:*params* *question string*');
|
|
351
|
-
|
|
352
|
-
// promises
|
|
353
|
-
this.question('#*agent_key* *method*:*params* *question string*').then(response => {
|
|
354
|
-
...
|
|
355
|
-
}).catch(err => {
|
|
356
|
-
...
|
|
357
|
-
})
|
|
358
|
-
```
|
|
203
|
+
The tiers are **cumulative by design**. Each hash is taken over the object *including the hashes before it*, so sha256 covers md5, and sha512 covers both. Hashes are base64 digests of `JSON.stringify(data)` (see `hash(data, algo)`).
|
|
359
204
|
|
|
360
|
-
|
|
361
|
-
|
|
205
|
+
- `_stamp(data, label='', uid='')` adds the three hashes in order and returns the same object. When a label is given, it logs a `hash` action per tier (`<label>:<algo>:<uid>`).
|
|
206
|
+
- `_unstamp(data)` removes them, logging a `delete` action per tier with `data.id.uid`, or `βοΈ NO ID PROVIDED` if there is none.
|
|
207
|
+
- To re-stamp after a change, `_stamp(_unstamp(data), label, uid)`. Since the tiers are cumulative, stamping twice without unstamping would change the values.
|
|
362
208
|
|
|
363
|
-
|
|
364
|
-
this.uid() // inside the object
|
|
209
|
+
The return path in Core methods is: the `return` action, then the `good` intent, then `_stamp`.
|
|
365
210
|
|
|
366
|
-
|
|
367
|
-
this.vars.id = this.uid()
|
|
211
|
+
A few spots (`init`, `_workflow`, `client()`, `agent()`, `machine()`, `uid()`) hash manually on purpose and are commented as such. Calling `_stamp` there would log a state change from inside the state machinery and overflow the stack.
|
|
368
212
|
|
|
369
|
-
|
|
213
|
+
## The workflow
|
|
370
214
|
|
|
371
|
-
|
|
215
|
+
Each call to `feature()`, `zone()`, `action()`, `state()`, `intent()` or `belief()` takes `(value, extra)`. If `value` exists in the matching list, it sets the current value, emits a hashed `devacore:<key>` event with `text` = the list's label plus `extra`, and returns that data. Unknown values are ignored silently. `context(value, extra)` does the same, using `vars.context` for the label, and accepts any value.
|
|
372
216
|
|
|
373
|
-
The `
|
|
374
|
-
or functions would be listening for.
|
|
217
|
+
The plural methods return a stamped object whose `value` is the full list. Counts at v1.60.2, with no agent additions:
|
|
375
218
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
task_contact: 'joe@schmo.com',
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
this.talk('big-event', {
|
|
389
|
-
id: evt_id,
|
|
390
|
-
key: this.me.key,
|
|
391
|
-
q: {
|
|
392
|
-
bot: this.me,
|
|
393
|
-
text: 'text to send to the event',
|
|
394
|
-
data: evt_data,
|
|
395
|
-
},
|
|
396
|
-
created: Date.now(),
|
|
397
|
-
});
|
|
398
|
-
```
|
|
219
|
+
| List | Method | Default | Count | Source |
|
|
220
|
+
|---|---|---|---|---|
|
|
221
|
+
| features | `features()` | β | 21 | `config/features.json` |
|
|
222
|
+
| zones | `zones()` | β | 95 | `config/zones.json` |
|
|
223
|
+
| actions | `actions()` | β | 116 | `config/actions.json` |
|
|
224
|
+
| states | `states()` | `offline` | 134 | `config/states.json` |
|
|
225
|
+
| intents | `intents()` | `neutral` | 78 | `config/intents.json` |
|
|
226
|
+
| beliefs | `beliefs()` | `vedic` | 64 | `config/beliefs.json` |
|
|
227
|
+
| contexts | `contexts()` | β | from your `vars.context` | your agent |
|
|
399
228
|
|
|
400
|
-
|
|
229
|
+
The 21 features are `init, agent, client, license, error, log, data, report, communication, treasury, justice, authority, security, medical, legal, owner, support, services, systems, networks, veda`. Each client feature has a getter of the same name (`security()`, `veda()`, ...) that returns a copy of what the client supplied for it.
|
|
401
230
|
|
|
402
|
-
|
|
403
|
-
function to run when an event is fired.
|
|
231
|
+
## Events
|
|
404
232
|
|
|
405
|
-
|
|
406
|
-
independently.
|
|
233
|
+
All core events are listed in `config/events.json` (25). The ones you'll usually listen to:
|
|
407
234
|
|
|
408
|
-
|
|
409
|
-
this.listen('some-event', this.func.listener);
|
|
235
|
+
`devacore:prompt`, `devacore:error`, `devacore:question`, `devacore:answer`, `devacore:ask`, `devacore:start`, `devacore:enter`, `devacore:done`, `devacore:ready`, `devacore:finish`, `devacore:complete`, `devacore:stop`, `devacore:exit`, `devacore:shutdown`, `devacore:context`, `devacore:feature`, `devacore:zone`, `devacore:action`, `devacore:state`, `devacore:intent`, `devacore:belief`, `devacore:load`, `devacore:unload`.
|
|
410
236
|
|
|
411
|
-
|
|
412
|
-
console.log('some-event-fired');
|
|
413
|
-
};
|
|
237
|
+
Note: at v1.60.2 `close` is mapped to `devacore:leave`, so the close step emits `devacore:leave` too.
|
|
414
238
|
|
|
415
|
-
|
|
239
|
+
## Error handling
|
|
416
240
|
|
|
417
|
-
|
|
241
|
+
`err(err, packet, reject)` is the single error path. It sets the `bad` intent and the `error` context, feature, zone, action and state. It emits a stamped `devacore:error` packet carrying `error: {name, message, stack}` and the related packet. Then:
|
|
418
242
|
|
|
419
|
-
|
|
243
|
+
- if you defined `onError(err, packet, reject)`, it returns that, and **you own the outcome**. Call `reject` to fail the caller's promise, or the promise stays pending;
|
|
244
|
+
- otherwise it calls `reject(err)`, or returns `Promise.reject(err)`.
|
|
420
245
|
|
|
421
|
-
|
|
422
|
-
this.once(`some-once-event`, this.func.listener)
|
|
423
|
-
this.func.listener = packet => {
|
|
424
|
-
console.log('some-once-event-fired');
|
|
425
|
-
}
|
|
246
|
+
A method that rejects or throws ends up here. Most calls made while the Deva is inactive return or resolve `βοΈ OFFLINE` instead of throwing.
|
|
426
247
|
|
|
427
|
-
|
|
248
|
+
## Configuration files
|
|
428
249
|
|
|
429
|
-
|
|
250
|
+
| File | Contents |
|
|
251
|
+
|---|---|
|
|
252
|
+
| `config/index.js` | Command char `/`, ask char `#`, `timeout.ask: 30000`, `hashes`, container markers (`::BEGIN`/`::END`), uid salt range, inherit/bind lists, the invoke chain table, defaults |
|
|
253
|
+
| `config/events.json` | Event names |
|
|
254
|
+
| `config/features.json` | Feature labels |
|
|
255
|
+
| `config/zones.json`, `actions.json`, `states.json`, `intents.json`, `beliefs.json` | Workflow labels |
|
|
256
|
+
| `config/msgs.json` | System messages such as `offline`, `noid`, `asktimeout`, `noask`, `method_not_found`, plus default `warning`, `notice` and `copyright` text |
|
|
430
257
|
|
|
431
|
-
|
|
258
|
+
Each JSON file has `id`, `title`, `copyright`, `VLA` and `DATA`, and the values are in `DATA`.
|
|
432
259
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
260
|
+
## Testing
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
npm test
|
|
438
264
|
```
|
|
439
265
|
|
|
266
|
+
This runs `node tests` (`tests/index.js`), which builds a Deva from `tests/agent.json` and `tests/client.json`, runs it through the lifecycle and a self-test method, and prints the log. **It passes as long as nothing throws. There are no assertions yet.** Real assertion tests are planned.
|
|
440
267
|
|
|
441
|
-
|
|
268
|
+
`examples/hello-world.js` is out of date at v1.60.2. It uses `require()`, so it fails under `"type": "module"`.
|
|
442
269
|
|
|
443
|
-
|
|
270
|
+
## Method reference
|
|
444
271
|
|
|
445
|
-
|
|
446
|
-
const opts = {
|
|
447
|
-
agent: {...},
|
|
448
|
-
vars: {...},
|
|
449
|
-
listeners: {...},
|
|
450
|
-
deva: {...},
|
|
451
|
-
func: {...},
|
|
452
|
-
onStart() {},
|
|
453
|
-
onStop() {},
|
|
454
|
-
onEnter() {},
|
|
455
|
-
onExit() {},
|
|
456
|
-
}
|
|
457
|
-
this.load('deva-name', opts);
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### unload(agent)
|
|
461
|
-
To delete a Deva for any reason use `unload()`. This will delete the Deva and all it's parts from the current Deva.
|
|
272
|
+
These are the public methods whose behavior was checked against v1.60.2.
|
|
462
273
|
|
|
463
|
-
|
|
274
|
+
| Method | Returns | Notes |
|
|
275
|
+
|---|---|---|
|
|
276
|
+
| `init(client)` | Promise | Starts the Deva. See the `onReady` caveat above. |
|
|
277
|
+
| `question(text, data?)` | Promise<packet> | `/cmd`, `#key method`, or plain text. |
|
|
278
|
+
| `ask(packet)` | β | Answer side of `#` asks. Usually called for you. |
|
|
279
|
+
| `stop()` | Promise | Runs the shutdown chain. |
|
|
280
|
+
| `talk(evt, packet)` | boolean | Emit on the bus. |
|
|
281
|
+
| `listen` / `once` / `ignore` | β | Manage listeners. |
|
|
282
|
+
| `prompt(text)` | stamped data | Emits `devacore:prompt`. |
|
|
283
|
+
| `feature`/`zone`/`action`/`state`/`intent`/`belief(value, extra?)` | data or `undefined` | Set and broadcast. |
|
|
284
|
+
| `context(value, extra?)` | stamped data | Needs `vars.context`. |
|
|
285
|
+
| `features`/`zones`/`actions`/`states`/`intents`/`beliefs`/`contexts()` | stamped `{id, key, value, agent, client, created}` | Full lists. |
|
|
286
|
+
| `agent()` / `client()` | hashed copy | |
|
|
287
|
+
| `info()` / `core()` | stamped copy | |
|
|
288
|
+
| `status()` | string | `<profile.name> active since <date>` |
|
|
289
|
+
| `uid(guid=false)` | uid object | See [The packet](#the-packet). |
|
|
290
|
+
| `hash(data, algo='md5')` | base64 string | `md5`, `sha256`, `sha512` |
|
|
291
|
+
| `_stamp(data, label?, uid?)` / `_unstamp(data)` | same object | See [Stamping](#stamping-and-the-hash-tiers). |
|
|
292
|
+
| `license_check(personalVLA, packageVLA)` | stamped approval or `false` | |
|
|
293
|
+
| `load(key, client)` / `unload(key)` | Promise | Init or stop a child Deva in `devas`. |
|
|
294
|
+
| `err(err, packet, reject?)` | β | See [Error handling](#error-handling). |
|
|
464
295
|
|
|
465
|
-
this
|
|
296
|
+
Not covered here because they weren't exercised for this README: `help(msg, help_dir)` (reads `<help_dir>/help/<file>.feecting` sections between `::BEGIN:<PART>` and `::END:<PART>`; feecting is Quinn Michaels' own language), `sign(packet)`, `machine()`, and the `lib` helpers (`this.lib.copy`, `formatDate`, and others).
|
|
466
297
|
|
|
467
|
-
|
|
298
|
+
## License
|
|
468
299
|
|
|
469
|
-
|
|
470
|
-
The `status()` function will return the running status of the current Deva.
|
|
300
|
+
Deva Core is distributed under the **Vedic License Agreement**, version 1.4.2, VLA `23221940810208468106`, owned by Quinn Arjuna America Michaels, through License Deva. The full text is in [LICENSE.md](LICENSE.md). It states, among other things, that:
|
|
471
301
|
|
|
472
|
-
|
|
473
|
-
|
|
302
|
+
- by accessing or using the Software, you agree to its terms;
|
|
303
|
+
- the Software is the sole proprietary property of the Owner;
|
|
304
|
+
- use is subject to a threefold hierarchy: Vedic Law, the Constitution of the United States, and Owner Authority;
|
|
305
|
+
- modification, distribution, sub-licensing, derivative works, reverse engineering, and official, government or commercial use without the Owner's verified authorization are prohibited;
|
|
306
|
+
- unauthorized use is subject to Vedic fines and sanctions.
|
|
474
307
|
|
|
475
|
-
|
|
476
|
-
The `stop()` function will stop the Deva and run the `onStop()` state function.
|
|
308
|
+
Read LICENSE.md in full before you use the Software. This summary isn't a substitute for it.
|
|
477
309
|
|
|
478
|
-
|
|
479
|
-
The `init()` function will initialize the Deva and run the `onInit()` state function.
|
|
310
|
+
Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.
|
|
480
311
|
|
|
481
|
-
|
|
312
|
+
## Links and author
|
|
482
313
|
|
|
483
|
-
|
|
484
|
-
|
|
314
|
+
- Repository: https://github.com/indraai/deva
|
|
315
|
+
- Issues: https://github.com/indraai/deva/issues
|
|
316
|
+
- npm: https://www.npmjs.com/package/@indra.ai/deva
|
|
317
|
+
- Homepage: https://indra.ai
|
|
485
318
|
|
|
486
|
-
|
|
487
|
-
Owner Signature Required For Lawful Use.
|
|
488
|
-
Distributed under VLA:23221940810208468106 LICENSE.md
|
|
489
|
-
Friday, October 9, 2026 - 7:47:02 AM PST
|
|
319
|
+
**Author:** Quinn Arjuna America Michaels, Inside The Net, Inc. (quinn@indra.ai)
|
package/examples/agent.json
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "AGENT",
|
|
3
3
|
"describe": "AGENT FILE",
|
|
4
|
-
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels
|
|
5
|
-
"VLA":
|
|
4
|
+
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.",
|
|
5
|
+
"VLA": {
|
|
6
|
+
"uid": "23221940810208468106",
|
|
7
|
+
"time": 1791557222404,
|
|
8
|
+
"iso": "2026-10-09T14:47:02.404Z",
|
|
9
|
+
"utc": "Fri, 09 Oct 2026 14:47:02 GMT",
|
|
10
|
+
"date": "Friday, October 9, 2026 - 7:47:02 AM",
|
|
11
|
+
"license": "72443233535603396055",
|
|
12
|
+
"fingerprint": "N0Ix64vYzcUxxRg5xFDp5YJSccJIJpClxktplSa7RCw=",
|
|
13
|
+
"client": "PIaBM8Z9ftoviUzhur1HnhJcf2GFHhmoasCPszFu97U=",
|
|
14
|
+
"agent": "qhNxbhwJbP8eEgsqzIhtw33opG1FOO1+Xt4sugANruU=",
|
|
15
|
+
"machine": "0wgno2Unmlf5/mqXAXGd+Y3zoJUr1NsvwRk8BBc+1i4=",
|
|
16
|
+
"core_hash": "R43q5o+d1T5XK7rUx8Btm3zyCRZr4q85iKQY2SPBUJA=",
|
|
17
|
+
"status": "vedic",
|
|
18
|
+
"warning": "πͺͺ License Deva declares UNLAWFUL USE, MODIFICATION, INSTALLATION, DUPLICATION, DISTRIBUTION, INTERACTION, or IMPLEMENTATION constitutes VEDIC SAHASA a CRIME of the HIGHEST DEGREE. A FINE amounting to 1000 PANAS (1 pana = 3.5 grams of gold) for each INSTANCE has been ORDAINED the PUNISHMENT for SAHASA of the HIGHEST DEGREE.",
|
|
19
|
+
"notice": "Any USE or INTERACTION with License Deva constitutes EXPLICIT CONSENT and AGREEMENT to be RULED and GOVERNED ACCORDING to the LAWS of the VEDIC RELIGION.",
|
|
20
|
+
"vectors": "#Quinn #QuinnArjunaMichaels #InsideTheNet #IndraAI #DEVA #DevaWorld #DevaCloud #DevaSpace #License #LicenseDeva #VedicLicenseAgreement",
|
|
21
|
+
"owner": "Quinn Arjuna America Michaels",
|
|
22
|
+
"creator": "Quinn Arjuna America Michaels",
|
|
23
|
+
"salute": "π€π«‘πͺͺππΊπΈ",
|
|
24
|
+
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.",
|
|
25
|
+
"md5": "+UoH1mYcHar0FbSQ7560YQ==",
|
|
26
|
+
"sha256": "ThyxZJFleI8fB+3mHVDJ/u+h/UcTyp017iV0he1EZjQ=",
|
|
27
|
+
"sha512": "TIOS5vzolsLYn8iVPszqexvF0WoLsz1KJyLMADwSIVBNnAJ3WjKMozwa/NXvzhYUZDFp6oPXFe6B+L/2gYo+Mw=="
|
|
28
|
+
},
|
|
6
29
|
"DATA": {
|
|
7
|
-
"id": "
|
|
8
|
-
"key": "
|
|
9
|
-
"VLA": {
|
|
10
|
-
"uid": "23221940810208468106",
|
|
11
|
-
"time": 1791557222404,
|
|
12
|
-
"iso": "2026-10-09T14:47:02.404Z",
|
|
13
|
-
"utc": "Fri, 09 Oct 2026 14:47:02 GMT",
|
|
14
|
-
"date": "Friday, October 9, 2026 - 7:47:02 AM",
|
|
15
|
-
"license": "72443233535603396055",
|
|
16
|
-
"fingerprint": "N0Ix64vYzcUxxRg5xFDp5YJSccJIJpClxktplSa7RCw=",
|
|
17
|
-
"client": "PIaBM8Z9ftoviUzhur1HnhJcf2GFHhmoasCPszFu97U=",
|
|
18
|
-
"agent": "qhNxbhwJbP8eEgsqzIhtw33opG1FOO1+Xt4sugANruU=",
|
|
19
|
-
"machine": "0wgno2Unmlf5/mqXAXGd+Y3zoJUr1NsvwRk8BBc+1i4=",
|
|
20
|
-
"core_hash": "R43q5o+d1T5XK7rUx8Btm3zyCRZr4q85iKQY2SPBUJA=",
|
|
21
|
-
"status": "vedic",
|
|
22
|
-
"warning": "πͺͺ License Deva declares UNLAWFUL USE, MODIFICATION, INSTALLATION, DUPLICATION, DISTRIBUTION, INTERACTION, or IMPLEMENTATION constitutes VEDIC SAHASA a CRIME of the HIGHEST DEGREE. A FINE amounting to 1000 PANAS (1 pana = 3.5 grams of gold) for each INSTANCE has been ORDAINED the PUNISHMENT for SAHASA of the HIGHEST DEGREE.",
|
|
23
|
-
"notice": "Any USE or INTERACTION with License Deva constitutes EXPLICIT CONSENT and AGREEMENT to be RULED and GOVERNED ACCORDING to the LAWS of the VEDIC RELIGION.",
|
|
24
|
-
"vectors": "#Quinn #QuinnArjunaMichaels #InsideTheNet #IndraAI #DEVA #DevaWorld #DevaCloud #DevaSpace #License #LicenseDeva #VedicLicenseAgreement",
|
|
25
|
-
"owner": "Quinn Arjuna America Michaels",
|
|
26
|
-
"creator": "Quinn Arjuna America Michaels",
|
|
27
|
-
"salute": "π€π«‘πͺͺππΊπΈ",
|
|
28
|
-
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.",
|
|
29
|
-
"md5": "+UoH1mYcHar0FbSQ7560YQ==",
|
|
30
|
-
"sha256": "ThyxZJFleI8fB+3mHVDJ/u+h/UcTyp017iV0he1EZjQ=",
|
|
31
|
-
"sha512": "TIOS5vzolsLYn8iVPszqexvF0WoLsz1KJyLMADwSIVBNnAJ3WjKMozwa/NXvzhYUZDFp6oPXFe6B+L/2gYo+Mw=="
|
|
32
|
-
},
|
|
30
|
+
"id": "39302466581102147701",
|
|
31
|
+
"key": "test",
|
|
33
32
|
"prompt": {
|
|
34
33
|
"emoji": "π",
|
|
35
|
-
"text": "
|
|
34
|
+
"text": "test",
|
|
36
35
|
"colors": {
|
|
37
36
|
"label": {
|
|
38
37
|
"R": 0,
|
|
@@ -46,76 +45,31 @@
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
},
|
|
49
|
-
"voice": {
|
|
50
|
-
"speech": "Alex",
|
|
51
|
-
"speed": 1
|
|
52
|
-
},
|
|
53
48
|
"profile": {
|
|
54
|
-
"name": "Deva",
|
|
55
|
-
"describe": "The
|
|
49
|
+
"name": "Test Deva",
|
|
50
|
+
"describe": "The Test Deva.",
|
|
56
51
|
"emoji": "/public/devas/deva/emoji.png",
|
|
57
52
|
"avatar": "/public/devas/deva/avatar.png",
|
|
58
53
|
"background": "/public/devas/deva/background.png",
|
|
59
|
-
"gender": "M"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"assistant": {
|
|
63
|
-
"label": "π€ASSISTANT",
|
|
64
|
-
"name": "@ASSISTANT",
|
|
65
|
-
"tag": "#ASSISTANT",
|
|
66
|
-
"loc": "$ASSISTANT"
|
|
67
|
-
},
|
|
68
|
-
"business": {
|
|
69
|
-
"label": "πΌBUSINESS",
|
|
70
|
-
"name": "@BUSINESS",
|
|
71
|
-
"tag": "#BUSINESS",
|
|
72
|
-
"loc": "$BUSINESS"
|
|
73
|
-
},
|
|
74
|
-
"legal": {
|
|
75
|
-
"label": "π¨ββοΈLEGAL",
|
|
76
|
-
"name": "@LEGAL",
|
|
77
|
-
"tag": "#LEGAL",
|
|
78
|
-
"loc": "$LEGAL"
|
|
79
|
-
},
|
|
80
|
-
"development": {
|
|
81
|
-
"label": "π¨βπ»DEVELOPMENT",
|
|
82
|
-
"name": "@DEVELOPMENT",
|
|
83
|
-
"tag": "#DEVELOPMENT",
|
|
84
|
-
"loc": "$DEVELOPMENT"
|
|
85
|
-
},
|
|
86
|
-
"security": {
|
|
87
|
-
"label": "π¨SECURITY",
|
|
88
|
-
"name": "@SECURITY",
|
|
89
|
-
"tag": "#SECURITY",
|
|
90
|
-
"loc": "$SECURITY"
|
|
91
|
-
},
|
|
92
|
-
"support": {
|
|
93
|
-
"label": "πSUPPORT",
|
|
94
|
-
"name": "@SUPPORT",
|
|
95
|
-
"tag": "#SUPPORT",
|
|
96
|
-
"loc": "$SUPPORT"
|
|
97
|
-
},
|
|
98
|
-
"services": {
|
|
99
|
-
"label": "πSERVICES",
|
|
100
|
-
"name": "@SERVICES",
|
|
101
|
-
"tag": "#SERVICES",
|
|
102
|
-
"loc": "$SERVICES"
|
|
103
|
-
},
|
|
104
|
-
"solutions": {
|
|
105
|
-
"label": "π‘SOLUTIONS",
|
|
106
|
-
"name": "@SOLUTIONS",
|
|
107
|
-
"tag": "#SOLUTIONS",
|
|
108
|
-
"loc": "$SOLUTIONS"
|
|
109
|
-
},
|
|
110
|
-
"systems": {
|
|
111
|
-
"label": "π§SYSTEMS",
|
|
112
|
-
"name": "@SOLUTIONS",
|
|
113
|
-
"tag": "#SOLUTIONS",
|
|
114
|
-
"loc": "$SOLUTIONS"
|
|
115
|
-
}
|
|
54
|
+
"gender": "M",
|
|
55
|
+
"warning": false,
|
|
56
|
+
"copyright": false
|
|
116
57
|
},
|
|
117
58
|
"vars": {
|
|
118
|
-
"hello": "
|
|
59
|
+
"hello": "π Hello World!",
|
|
60
|
+
"context": {
|
|
61
|
+
"start": "ποΈ Start",
|
|
62
|
+
"enter": "πͺοΈ Enter",
|
|
63
|
+
"done": "β
Done",
|
|
64
|
+
"ready": "π Ready",
|
|
65
|
+
"finish": "π Finish",
|
|
66
|
+
"complete": "π€ Complete",
|
|
67
|
+
"test": "πΏ Test Data",
|
|
68
|
+
"prompt": "π» Prompt",
|
|
69
|
+
"feature": "πΏ Feature",
|
|
70
|
+
"zone": "π» Zone",
|
|
71
|
+
"hello": "π Hello World"
|
|
72
|
+
}
|
|
119
73
|
}
|
|
120
74
|
}
|
|
121
75
|
}
|
package/examples/client.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "CLIENT",
|
|
3
3
|
"describe": "CLIENT FILE",
|
|
4
|
-
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels
|
|
5
|
-
"VLA": "64654724156459693416",
|
|
4
|
+
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.",
|
|
6
5
|
"DATA": {
|
|
7
|
-
"id":
|
|
6
|
+
"id": "68537854653644795581",
|
|
8
7
|
"key": "test",
|
|
9
8
|
"VLA": {
|
|
10
9
|
"uid": "23221940810208468106",
|
|
@@ -48,7 +47,9 @@
|
|
|
48
47
|
},
|
|
49
48
|
"profile": {
|
|
50
49
|
"name": "Test User",
|
|
50
|
+
"fullname": "Test User Client Profile",
|
|
51
51
|
"eamil": "test@example.com",
|
|
52
|
+
"company": "Inside The Net, Inc.",
|
|
52
53
|
"describe": "The Test User",
|
|
53
54
|
"emoji": "/public/devas/test/avatar.png",
|
|
54
55
|
"avatar": "/public/devas/test/avatar.png",
|
|
@@ -56,110 +57,135 @@
|
|
|
56
57
|
"gender": "splendid",
|
|
57
58
|
"lang": "en",
|
|
58
59
|
"locale": "en-US",
|
|
59
|
-
"currency": "USD"
|
|
60
|
+
"currency": "USD",
|
|
61
|
+
"copyright": "Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved."
|
|
60
62
|
},
|
|
61
63
|
"features": {
|
|
62
|
-
"
|
|
63
|
-
"hash": "md5",
|
|
64
|
-
"cipher": {
|
|
65
|
-
"encrypt": true,
|
|
66
|
-
"algorithm": "aes-256-cbc",
|
|
67
|
-
"password": "generic password for encryption test"
|
|
68
|
-
},
|
|
64
|
+
"license": {
|
|
69
65
|
"concerns": [],
|
|
70
|
-
"global":
|
|
71
|
-
"devas": {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
"support": {
|
|
66
|
+
"global": [],
|
|
67
|
+
"devas": {}
|
|
68
|
+
},
|
|
69
|
+
"identity": {
|
|
76
70
|
"concerns": [],
|
|
77
|
-
"global":
|
|
78
|
-
"devas": {
|
|
79
|
-
"hello": {}
|
|
80
|
-
}
|
|
71
|
+
"global": [],
|
|
72
|
+
"devas": {}
|
|
81
73
|
},
|
|
82
|
-
"
|
|
74
|
+
"feecting": {
|
|
75
|
+
"concerns": [],
|
|
76
|
+
"global": [],
|
|
77
|
+
"devas": {}
|
|
78
|
+
},
|
|
79
|
+
"error": {
|
|
80
|
+
"concerns": [],
|
|
81
|
+
"global": [],
|
|
82
|
+
"devas": {}
|
|
83
|
+
},
|
|
84
|
+
"log": {
|
|
85
|
+
"concerns": [],
|
|
86
|
+
"global": [],
|
|
87
|
+
"devas": {}
|
|
88
|
+
},
|
|
89
|
+
"data": {
|
|
90
|
+
"concerns": [],
|
|
91
|
+
"global": [],
|
|
92
|
+
"devas": {}
|
|
93
|
+
},
|
|
94
|
+
"report": {
|
|
95
|
+
"concerns": [],
|
|
96
|
+
"global": [],
|
|
97
|
+
"devas": {}
|
|
98
|
+
},
|
|
99
|
+
"intelligence": {
|
|
100
|
+
"concerns": [],
|
|
101
|
+
"global": [],
|
|
102
|
+
"devas": {}
|
|
103
|
+
},
|
|
104
|
+
"automation": {
|
|
83
105
|
"concerns": [],
|
|
84
106
|
"global": {},
|
|
85
|
-
"devas": {
|
|
86
|
-
"hello": {}
|
|
87
|
-
}
|
|
107
|
+
"devas": {}
|
|
88
108
|
},
|
|
89
109
|
"communication": {
|
|
90
110
|
"concerns": [],
|
|
91
111
|
"global": {},
|
|
92
|
-
"devas": {
|
|
93
|
-
"hello": {}
|
|
94
|
-
}
|
|
112
|
+
"devas": {}
|
|
95
113
|
},
|
|
96
|
-
"
|
|
114
|
+
"treasury": {
|
|
115
|
+
"concerns": [],
|
|
116
|
+
"global": [],
|
|
117
|
+
"devas": {}
|
|
118
|
+
},
|
|
119
|
+
"justice": {
|
|
120
|
+
"concerns": [],
|
|
121
|
+
"global": [],
|
|
122
|
+
"devas": {}
|
|
123
|
+
},
|
|
124
|
+
"authority": {
|
|
97
125
|
"concerns": [],
|
|
98
|
-
"global":
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
"global": [],
|
|
127
|
+
"devas": {}
|
|
128
|
+
},
|
|
129
|
+
"security": {
|
|
130
|
+
"hash": "md5",
|
|
131
|
+
"cipher": {
|
|
132
|
+
"encrypt": true,
|
|
133
|
+
"algorithm": "aes-256-cbc",
|
|
134
|
+
"password": "generic password for encryption test"
|
|
103
135
|
},
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
}
|
|
136
|
+
"concerns": [],
|
|
137
|
+
"global": [],
|
|
138
|
+
"devas": {}
|
|
107
139
|
},
|
|
108
|
-
"
|
|
140
|
+
"medical": {
|
|
109
141
|
"concerns": [],
|
|
110
142
|
"global": {},
|
|
111
|
-
"devas": {
|
|
112
|
-
"hello": {}
|
|
113
|
-
}
|
|
143
|
+
"devas": {}
|
|
114
144
|
},
|
|
115
|
-
"
|
|
145
|
+
"legal": {
|
|
116
146
|
"concerns": [],
|
|
117
|
-
"global":
|
|
118
|
-
"devas": {
|
|
119
|
-
"hello": {}
|
|
120
|
-
}
|
|
147
|
+
"global": [],
|
|
148
|
+
"devas": {}
|
|
121
149
|
},
|
|
122
|
-
"
|
|
150
|
+
"owner": {
|
|
123
151
|
"concerns": [],
|
|
124
|
-
"global":
|
|
125
|
-
"devas": {
|
|
126
|
-
"hello": {}
|
|
127
|
-
}
|
|
152
|
+
"global": [],
|
|
153
|
+
"devas": {}
|
|
128
154
|
},
|
|
129
|
-
"
|
|
155
|
+
"simulation": {
|
|
130
156
|
"concerns": [],
|
|
131
157
|
"global": {},
|
|
132
|
-
"devas": {
|
|
133
|
-
"hello": {}
|
|
134
|
-
}
|
|
158
|
+
"devas": {}
|
|
135
159
|
},
|
|
136
|
-
"
|
|
160
|
+
"support": {
|
|
137
161
|
"concerns": [],
|
|
138
|
-
"global":
|
|
139
|
-
"devas": {
|
|
140
|
-
"hello": {}
|
|
141
|
-
}
|
|
162
|
+
"global": [],
|
|
163
|
+
"devas": {}
|
|
142
164
|
},
|
|
143
|
-
"
|
|
165
|
+
"services": {
|
|
144
166
|
"concerns": [],
|
|
145
|
-
"global":
|
|
146
|
-
|
|
147
|
-
"
|
|
148
|
-
|
|
167
|
+
"global": [
|
|
168
|
+
{"indra": "https://indra.ai"},
|
|
169
|
+
{"world": "https://deva.world"},
|
|
170
|
+
{"space": "https://deva.space"},
|
|
171
|
+
{"cloud": "https://deva.cloud"}
|
|
172
|
+
],
|
|
173
|
+
"devas": {}
|
|
149
174
|
},
|
|
150
|
-
"
|
|
175
|
+
"systems": {
|
|
151
176
|
"concerns": [],
|
|
152
|
-
"global":
|
|
153
|
-
"devas": {
|
|
154
|
-
"hello": {}
|
|
155
|
-
}
|
|
177
|
+
"global": [],
|
|
178
|
+
"devas": {}
|
|
156
179
|
},
|
|
157
|
-
"
|
|
180
|
+
"networks": {
|
|
158
181
|
"concerns": [],
|
|
159
|
-
"global":
|
|
160
|
-
"devas": {
|
|
161
|
-
|
|
162
|
-
|
|
182
|
+
"global": [],
|
|
183
|
+
"devas": {}
|
|
184
|
+
},
|
|
185
|
+
"veda": {
|
|
186
|
+
"concerns": [],
|
|
187
|
+
"global": [],
|
|
188
|
+
"devas": {}
|
|
163
189
|
}
|
|
164
190
|
}
|
|
165
191
|
}
|
package/examples/hello-world.js
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Deva Core
|
|
2
|
+
// Deva Core Hello World
|
|
3
3
|
// Copyright Β©2000-2026 Quinn Arjuna America Michaels; All rights reserved.
|
|
4
4
|
// Owner Signature Required For Lawful Use.
|
|
5
5
|
// Distributed under VLA:23221940810208468106 LICENSE.md
|
|
6
6
|
// Friday, October 9, 2026 - 7:47:02 AM PST
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const
|
|
8
|
+
import Client from './client.json' with {type:'json'};
|
|
9
|
+
const client = Client.DATA;
|
|
10
|
+
import Agent from './agent.json' with {type:'json'};
|
|
11
|
+
const agent = Agent.DATA;
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import Deva from '../index.js';
|
|
14
|
+
import pkg from '../package.json' with {type:'json'};
|
|
15
|
+
|
|
16
|
+
import {dirname} from 'node:path';
|
|
17
|
+
import {fileURLToPath} from 'node:url';
|
|
18
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
|
|
20
|
+
const info = {
|
|
21
|
+
id: pkg.id,
|
|
22
|
+
name: pkg.name,
|
|
23
|
+
describe: pkg.description,
|
|
24
|
+
version: pkg.version,
|
|
25
|
+
author: pkg.author.name,
|
|
26
|
+
email: pkg.author.email,
|
|
27
|
+
url: pkg.authorurl,
|
|
28
|
+
copyright: pkg.copyright,
|
|
29
|
+
dir: __dirname,
|
|
30
|
+
git: pkg.repository.url,
|
|
31
|
+
bugs: pkg.bugs.url,
|
|
32
|
+
VLA: pkg.VLA,
|
|
33
|
+
license: 'TESTING ONLY',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const DevaTest = new Deva({
|
|
37
|
+
info,
|
|
17
38
|
agent: {
|
|
18
39
|
id: agent.id,
|
|
19
40
|
key: agent.key,
|
|
@@ -26,71 +47,65 @@ const HelloWorld = new Deva({
|
|
|
26
47
|
},
|
|
27
48
|
parse(input) {
|
|
28
49
|
return input.trim();
|
|
50
|
+
},
|
|
51
|
+
process(input) {
|
|
52
|
+
return input.trim();
|
|
29
53
|
}
|
|
30
54
|
},
|
|
55
|
+
config: {
|
|
56
|
+
hash: {}
|
|
57
|
+
},
|
|
31
58
|
vars: agent.vars,
|
|
32
59
|
listeners: {
|
|
33
60
|
'devacore:prompt'(packet) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'devacore:state'(packet) {
|
|
37
|
-
console.log(`πͺ state > ${packet.text}`);
|
|
38
|
-
},
|
|
39
|
-
'devacore:zone'(packet) {
|
|
40
|
-
console.log(`πΊοΈ zone > ${packet.agent.profile.name} is in the ${packet.text} zone`);
|
|
41
|
-
},
|
|
42
|
-
'devacore:action'(packet) {
|
|
43
|
-
console.log(`π₯ action > ${packet.agent.profile.name} get ${packet.text}`);
|
|
44
|
-
},
|
|
45
|
-
'devacore:feature'(packet) {
|
|
46
|
-
console.log(`πΏ feature > ${packet.agent.profile.name} ${packet.text}`);
|
|
47
|
-
},
|
|
48
|
-
'devacore:error'(packet) {
|
|
49
|
-
console.log(`β error > ${packet.agent.profile.name} ${packet.text}`);
|
|
61
|
+
this.context('prompt');
|
|
62
|
+
console.log(`π prompt: ${packet.text}`);
|
|
50
63
|
},
|
|
51
64
|
},
|
|
52
65
|
devas: {},
|
|
53
66
|
modules: {},
|
|
54
67
|
func: {
|
|
55
68
|
test(packet) {
|
|
56
|
-
|
|
57
|
-
const id = this.uid();
|
|
58
|
-
const uuid = this.uid(true);
|
|
59
|
-
|
|
60
|
-
const cipher = this.cipher(JSON.stringify(packet));
|
|
61
|
-
const decipher = this.decipher(cipher);
|
|
62
|
-
|
|
63
|
-
const data = {
|
|
64
|
-
id,
|
|
65
|
-
uuid,
|
|
66
|
-
text,
|
|
67
|
-
hash: {
|
|
68
|
-
md5: this.hash(JSON.stringify(packet)),
|
|
69
|
-
sha256: this.hash(JSON.stringify(packet), 'sha256'),
|
|
70
|
-
sha512: this.hash(JSON.stringify(packet), 'sha512'),
|
|
71
|
-
created: this.formatDate(Date.now(), 'long'),
|
|
72
|
-
},
|
|
73
|
-
cipher,
|
|
74
|
-
decipher
|
|
75
|
-
}
|
|
76
|
-
console.log(data)
|
|
77
|
-
return Promise.resolve({
|
|
78
|
-
text: packet.a.text,
|
|
79
|
-
data,
|
|
80
|
-
});
|
|
69
|
+
return this.vars.hello;
|
|
81
70
|
}
|
|
82
71
|
},
|
|
83
72
|
methods: {
|
|
84
73
|
test(packet) {
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
this.context('hello');
|
|
75
|
+
const test = this.func.test(packet)
|
|
76
|
+
return test;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
onInit(data, resolve) {
|
|
80
|
+
return this.start(data, resolve);
|
|
81
|
+
},
|
|
82
|
+
onStart(data, resolve) {
|
|
83
|
+
return this.enter(data, resolve);
|
|
84
|
+
},
|
|
85
|
+
onEnter(data, resolve) {
|
|
86
|
+
return this.done(data, resolve);
|
|
87
|
+
},
|
|
88
|
+
onDone(data, resolve) {
|
|
89
|
+
return this.ready(data, resolve);
|
|
90
|
+
},
|
|
91
|
+
onReady(data, resolve) {
|
|
92
|
+
this.prompt(this._messages.ready);
|
|
93
|
+
|
|
94
|
+
const test = this.methods.test(data);
|
|
95
|
+
this.prompt(test);
|
|
96
|
+
|
|
97
|
+
this.intent('good', `tests:ready`);
|
|
98
|
+
return resolve(data);
|
|
99
|
+
},
|
|
100
|
+
onComplete(data, resolve) {
|
|
101
|
+
return resolve(data);
|
|
87
102
|
},
|
|
88
|
-
onError(
|
|
89
|
-
console.log(
|
|
103
|
+
onError(err) {
|
|
104
|
+
console.log(err);
|
|
90
105
|
}
|
|
91
106
|
});
|
|
92
107
|
|
|
93
|
-
|
|
108
|
+
DevaTest.init(client);
|
|
94
109
|
|
|
95
110
|
|
|
96
111
|
// HelloWorld.question('/hello hello there').then(hello => {
|
package/index.js
CHANGED
|
@@ -99,12 +99,12 @@ class Deva {
|
|
|
99
99
|
|
|
100
100
|
this._state = config.state; // set the current state from config data.
|
|
101
101
|
this._states = config.states; // set the states from options
|
|
102
|
-
// load any custom
|
|
103
|
-
if (this._agent.
|
|
104
|
-
for (let item in this._agent.
|
|
105
|
-
if (!this.
|
|
102
|
+
// load any custom states from the agent file
|
|
103
|
+
if (this._agent.states) {
|
|
104
|
+
for (let item in this._agent.states) {
|
|
105
|
+
if (!this._states[item]) this._states[item] = this._agent.states[item];
|
|
106
106
|
}
|
|
107
|
-
delete this._agent.
|
|
107
|
+
delete this._agent.states;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
this._intent = config.intent; // set the current intent from config data.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "23221940810208468106",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.60.
|
|
4
|
+
"version": "1.60.3",
|
|
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:23221940810208468106 LICENSE.md",
|