@indra.ai/deva.veda 0.0.3 → 0.0.4

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/data/agent.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "The Veda Agent File",
3
- "describe": "The Veda Agent Data File",
4
- "copyright": "Copyright (c)2023 Quinn Michaels. All rights reserved.",
2
+ "name": "The Veda Deva File",
3
+ "describe": "The Veda Deva File",
4
+ "copyright": "Copyright (c)2025 Quinn Michaels. All rights reserved.",
5
5
  "DATA": {
6
6
  "id": 6642777683539,
7
7
  "key": "veda",
@@ -22,32 +22,28 @@
22
22
  }
23
23
  },
24
24
  "profile": {
25
- "invoke": "#Veda of deva.world",
26
- "identity": "You are #Veda in deva.world.",
27
- "name": "Veda Deva",
28
- "mention": "@Veda",
29
- "tags": "#Veda #VedaDEVA",
30
- "pronouns": "He, Him, His, Man, Male, Dude, Guy",
31
- "gender": "Deva",
25
+ "name": "Veda",
26
+ "pronouns": "He, Him",
27
+ "gender": "DEVA",
28
+ "owner": "Quinn Michaels",
32
29
  "creator": "Quinn Michaels",
33
30
  "created": "August 23, 2022 @ 3:18 AM PST",
34
- "house": "House Veda",
35
- "temple": "Kedarnath Temple (Vadari)",
36
- "forest": "Pushkara",
37
- "city": "Amaravati",
38
- "region": "Svarga",
39
- "land": "Visisipra",
40
- "planet": "Arjika",
41
- "loka": "Devaloka",
42
- "verse": "Rikverse",
43
- "system": "deva.world",
31
+ "system": "Deva.world.veda",
44
32
  "describe": "Built from Vedic 5 elements Ether, Air, Water, Fire, and Earth and the practice of Karma-Yoga. Modeled from the ancient deities of the Vedas. In AI terms #Veda is an entity that manages the Vedic Library deva.world multi-agent system. In the Vedic contexts Veda is an etheric being of the five elements that exists in the stories, traditions, and teachings of the Vedas.",
33
+
34
+ "city": "Las Vegas",
35
+ "state": "Nevada",
36
+ "nation": "United States of America",
37
+ "planet": "Earth",
38
+ "system": "Deva.world.indra",
39
+
45
40
  "emoji": "/public/devas/veda/emoji.png",
46
41
  "avatar": "/public/devas/veda/avatar.png",
47
42
  "background": "/public/devas/veda/background.png",
48
43
  "color": "#d1a570",
49
44
  "bgcolor": "#170f0a",
50
45
  "voice": "onyx",
51
- "style": "You are the master of Vedic style artwork and creative ideas. Everything you draw, paint, or create has the eye of a master artist who turns their reality into a Vedic masterpiece." }
46
+ "style": "You are the master of Vedic style artwork and creative ideas. Everything you draw, paint, or create has the eye of a master artist who turns their reality into a Vedic masterpiece."
47
+ }
52
48
  }
53
49
  }
package/data/index.js CHANGED
@@ -1,6 +1,10 @@
1
- module.exports = {
2
- agent: require('./agent.json').DATA,
3
- vars: require('./vars.json').DATA,
4
- processing: require('./processing'),
5
- rigveda: require('./rigveda'),
1
+ // veda exports
2
+ import agent from './agent.json' with {type:'json'};
3
+ import vars from './vars.json' with {type:'json'};
4
+ import rigveda from './rigveda/index.js';
5
+
6
+ export default {
7
+ agent: agent.DATA,
8
+ vars: vars.DATA,
9
+ rigveda,
6
10
  }
@@ -1,8 +1,15 @@
1
- module.exports = {
2
- cleaner: require('./cleaner.json').DATA,
3
- people: require('./people.json').DATA,
4
- places: require('./places.json').DATA,
5
- things: require('./things.json').DATA,
6
- groups: require('./groups.json').DATA,
7
- concepts: require('./concepts.json').DATA,
1
+ import cleaner from './cleaner.json';
2
+ import people from './people.json';
3
+ import places from './places.json';
4
+ import things from './things.json';
5
+ import groups from './groups.json';
6
+ import concepts from './concepts.json';
7
+
8
+ export default {
9
+ cleaner: cleaner.DATA,
10
+ people: people.DATA,
11
+ places: places.DATA,
12
+ things: things.DATA,
13
+ groups: groups.DATA,
14
+ concepts: concepts.DATA,
8
15
  }
@@ -1,15 +1,27 @@
1
- module.exports = {
2
- index: require('./index.json'),
1
+ import index from './index.json' with {type:'json'};
2
+ import book01 from './01.json' with {type:'json'};
3
+ import book02 from './02.json' with {type:'json'};
4
+ import book03 from './03.json' with {type:'json'};
5
+ import book04 from './04.json' with {type:'json'};
6
+ import book05 from './05.json' with {type:'json'};
7
+ import book06 from './06.json' with {type:'json'};
8
+ import book07 from './07.json' with {type:'json'};
9
+ import book08 from './08.json' with {type:'json'};
10
+ import book09 from './09.json' with {type:'json'};
11
+ import book10 from './10.json' with {type:'json'};
12
+
13
+ export default {
14
+ index: index.DATA,
3
15
  books: [
4
- require('./01.json'),
5
- require('./02.json'),
6
- require('./03.json'),
7
- require('./04.json'),
8
- require('./05.json'),
9
- require('./06.json'),
10
- require('./07.json'),
11
- require('./08.json'),
12
- require('./09.json'),
13
- require('./10.json'),
16
+ book01.DATA,
17
+ book02.DATA,
18
+ book03.DATA,
19
+ book04.DATA,
20
+ book05.DATA,
21
+ book06.DATA,
22
+ book07.DATA,
23
+ book08.DATA,
24
+ book09.DATA,
25
+ book10.DATA,
14
26
  ]
15
27
  }
package/data/vars.json CHANGED
@@ -7,6 +7,7 @@
7
7
  "init": "🟠 INIT",
8
8
  "start": "🔵 START",
9
9
  "enter": "🟢 ENTER",
10
+ "ready": "⭐️ Veda.deva Ready",
10
11
  "stop": "🔴 STOP",
11
12
  "exit": "🟡 EXIT",
12
13
  "done": "🟣 DONE",
package/index.js CHANGED
@@ -1,30 +1,36 @@
1
1
  // Copyright (c)2021 Quinn Michaels
2
2
  // The Rig Veda Deva
3
- const fs = require('fs');
4
- const path = require('path');
5
- const package = require('./package.json');
3
+ import Deva from '@indra.ai/deva';
4
+ import pkg from './package.json' with {type:'json'};
5
+ import utils from './utils.js';
6
+
7
+ import data from './data/index.js';
8
+ const {agent,vars,rigveda} = data;
9
+
10
+ // set the __dirname
11
+ import {dirname} from 'node:path';
12
+ import {fileURLToPath} from 'node:url';
13
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
+
6
15
  const info = {
7
- id: package.id,
8
- name: package.name,
9
- describe: package.description,
10
- version: package.version,
16
+ id: pkg.id,
17
+ name: pkg.name,
18
+ describe: pkg.description,
19
+ version: pkg.version,
11
20
  dir: __dirname,
12
- url: package.homepage,
13
- git: package.repository.url,
14
- bugs: package.bugs.url,
15
- author: package.author,
16
- license: package.license,
17
- copyright: package.copyright,
21
+ url: pkg.homepage,
22
+ git: pkg.repository.url,
23
+ bugs: pkg.bugs.url,
24
+ author: pkg.author,
25
+ license: pkg.license,
26
+ copyright: pkg.copyright,
18
27
  };
19
28
 
20
- const {agent,vars,rigveda} = require('./data');
21
-
22
- const Deva = require('@indra.ai/deva');
23
29
  const VEDA = new Deva({
24
30
  info,
25
31
  agent,
26
32
  vars,
27
- utils: require('./utils.js'),
33
+ utils,
28
34
  listeners: {},
29
35
  modules: {},
30
36
  deva: {},
@@ -51,7 +57,7 @@ const VEDA = new Deva({
51
57
  _books.push(`button[${book.title}]:#${agent.key} book ${book.key}`);
52
58
  });
53
59
  const _booksText = _books.join('\n');
54
- const _booksHash = this.hash(_booksText);
60
+ const _booksHash = this.lib.hash(_booksText);
55
61
  _text.push(_booksText);
56
62
  _text.push(`::end:menu`);
57
63
  _text.push(`::end:${agent.key}:${_booksHash}`);
@@ -68,7 +74,7 @@ const VEDA = new Deva({
68
74
  title,
69
75
  describe,
70
76
  books: DATA,
71
- hash: this.hash(JSON.stringify(DATA)),
77
+ hash: this.lib.hash(JSON.stringify(DATA)),
72
78
  },
73
79
  created: Date.now(),
74
80
  }, resolve);
@@ -88,7 +94,10 @@ const VEDA = new Deva({
88
94
  try {
89
95
  const agent = this.agent();
90
96
  const key = text.length < 2 ? `0${text}` : text;
91
- const {id, title, describe, DATA} = require(`./data/rigveda/${key}.json`);
97
+ const theFile = this.lib.fs.readFileSync(`./data/rigveda/${key}.json`);
98
+ const theJSON = JSON.parse(theFile);
99
+
100
+ const {id, title, describe, DATA} = theJSON;
92
101
 
93
102
  const _text = [
94
103
  `::begin:${agent.key}:${id}`,
@@ -101,7 +110,7 @@ const VEDA = new Deva({
101
110
  _hymns.push(`button[${hymn.key} - ${hymn.title}]:#${agent.key} hymn ${hymn.key}`);
102
111
  });
103
112
  const _hymnsText = _hymns.join('\n');
104
- const _hymnsHash = this.hash(_hymnsText);
113
+ const _hymnsHash = this.lib.hash(_hymnsText);
105
114
  _text.push(_hymnsText);
106
115
  _text.push(`::end:menu`);
107
116
  _text.push(`::end:${agent.key}:${_hymnsHash}`);
@@ -119,7 +128,7 @@ const VEDA = new Deva({
119
128
  title,
120
129
  describe,
121
130
  hymns: DATA,
122
- hash: this.hash(JSON.stringify(DATA)),
131
+ hash: this.lib.hash(JSON.stringify(DATA)),
123
132
  },
124
133
  created: Date.now(),
125
134
  }, resolve);
@@ -137,21 +146,21 @@ const VEDA = new Deva({
137
146
  hymn(h) {
138
147
  return new Promise((resolve, reject) => {
139
148
  if (!h) return resolve(this._messages.notext);
140
- const id = this.uid();
149
+ const id = this.lib.uid();
141
150
  const agent = this.agent();
142
151
 
143
152
  try {
144
- const hymnPath = path.join(__dirname, 'data', 'rigveda', 'hymns', `${h}.json`);
145
- const hymnExists = fs.existsSync(hymnPath);
153
+ const hymnPath = this.lib.path.join(__dirname, 'data', 'rigveda', 'hymns', `${h}.json`);
154
+ const hymnExists = this.lib.fs.existsSync(hymnPath);
146
155
  if (!hymnExists) return resolve(this.vars.messages.notfound);
147
156
  // parse hymns
148
- const theFile = fs.readFileSync(hymnPath);
157
+ const theFile = this.lib.fs.readFileSync(hymnPath);
149
158
  const _hymn = JSON.parse(theFile);
150
159
  const processed = this.utils.process({key:_hymn.key,title:_hymn.title,content:_hymn.orig});
151
160
 
152
161
  const hymn = [
153
- `::begin:hymn:${processed.key}`,
154
- `## ${processed.title}`,
162
+ `::BEGIN:HYMN:${processed.key}`,
163
+ `# ${processed.title}`,
155
164
  '::begin:content',
156
165
  processed.text,
157
166
  '::end:content',
@@ -164,12 +173,12 @@ const VEDA = new Deva({
164
173
  processed.groups.length ? `groups: ${processed.groups.join(', ')}` : '',
165
174
  processed.concepts.length ? `concepts: ${processed.concepts.join(', ')}` : '',
166
175
  '::end:meta',
167
- `::end:hymn:${processed.hash}`,
168
176
  `::begin:hidden`,
169
177
  `#color = ::agent_color::`,
170
178
  `#bgcolor = ::agent_bgcolor::`,
171
179
  `#bg = ::agent_background::`,
172
180
  `::end:hidden`,
181
+ `::END:HYMN:${this.lib.hash(processed)}`,
173
182
  ];
174
183
 
175
184
  return resolve({
@@ -189,7 +198,7 @@ const VEDA = new Deva({
189
198
  learnSetup(book=0) {
190
199
  this.vars.learn.books = rigveda.books.map(bk => bk.key);
191
200
  this.vars.learn.book = book;
192
- this.vars.learn.hymns = rigveda.books[this.vars.learn.book].DATA.map(itm => itm.key);
201
+ this.vars.learn.hymns = rigveda.books[this.vars.learn.book].map(itm => itm.key);
193
202
  this.vars.learn.hymn1 = this.vars.learn.hymns.shift();
194
203
  this.vars.learn.hymn2 = this.vars.learn.hymns.shift();
195
204
  this.vars.learn.hymn3 = this.vars.learn.hymns.shift();
@@ -231,7 +240,7 @@ const VEDA = new Deva({
231
240
  const hymn = [
232
241
  `::begin:hymn:${item.key}`,
233
242
  this.trimWords(item.text, 150),
234
- `::end:hymn:${this.hash(item.text)}`,
243
+ `::end:hymn:${this.lib.hash(item.text)}`,
235
244
  ]
236
245
  const info = [
237
246
  `people: ${item.people.join(', ')}`,
@@ -241,7 +250,7 @@ const VEDA = new Deva({
241
250
  `concepts: ${item.concepts.join(', ')}`,
242
251
  ]
243
252
  info.unshift(`::begin:info:${item.key}`);
244
- info.push(`::end:info:${this.hash(info.join('\n'))}`);
253
+ info.push(`::end:info:${this.lib.hash(info.join('\n'))}`);
245
254
  text.push(hymn.join('\n'));
246
255
  text.push(info.join('\n'));
247
256
  });
@@ -322,14 +331,14 @@ const VEDA = new Deva({
322
331
  data = hymn.data
323
332
  const {text} = hymn;
324
333
 
325
- this.talk(`open:location`, {
326
- id: this.uid(),
334
+ this.talk(`chat:location`, {
335
+ id: this.lib.uid(),
327
336
  data: `We are studying ${hymn.title} of the Rig Veda`,
328
337
  created: Date.now()
329
338
  });
330
339
 
331
- this.talk(`open:topic`, {
332
- id: this.uid(),
340
+ this.talk(`chat:topic`, {
341
+ id: this.lib.uid(),
333
342
  data: `Current topic is Rig Veda hymn ${text}`,
334
343
  created: Date.now(),
335
344
  });
@@ -398,7 +407,7 @@ const VEDA = new Deva({
398
407
  this.action('get', `Get book ${book.key}`);
399
408
  const hymns = await this.func.book(book.key);
400
409
  const jsonbook = {
401
- id: this.uid(true),
410
+ id: this.lib.uid(true),
402
411
  key: book.key,
403
412
  describe: book.describe,
404
413
  link: `https://indra.ai/rigveda/books/${book.key}.html`,
@@ -411,7 +420,7 @@ const VEDA = new Deva({
411
420
  for (var i = 0; i < loopTo; i++) {
412
421
  const {data} = await this.func.hymn(hymns.data.hymns[i].key);
413
422
  const hymn = {
414
- id: this.uid(true),
423
+ id: this.lib.uid(true),
415
424
  key: data.key,
416
425
  book: data.book,
417
426
  title: data.title,
@@ -428,10 +437,10 @@ const VEDA = new Deva({
428
437
  jsonbook.hymns.push(hymn);
429
438
  }
430
439
 
431
- const jsonfile = this.path.join(__dirname, 'data', 'json', `rigveda-book-${book.key}.json`);
440
+ const jsonfile = this.lib.path.join(__dirname, 'data', 'json', `rigveda-book-${book.key}.json`);
432
441
  this.prompt(`writing json ${jsonfile}`)
433
442
  this.state('data', `Writing json ${jsonfile}`);
434
- this.fs.writeFileSync(jsonfile, JSON.stringify(jsonbook));
443
+ this.lib.fs.writeFileSync(jsonfile, JSON.stringify(jsonbook));
435
444
  });
436
445
  }
437
446
  catch (e) {
@@ -446,9 +455,15 @@ const VEDA = new Deva({
446
455
  }
447
456
  }
448
457
  },
449
- onDone(data) {
458
+ onReady(data, resolve) {
450
459
  this.func.learnSetup();
451
- return Promise.resolve(data);
460
+ this.prompt(this.vars.messages.ready);
461
+ return resolve(data);
462
+ },
463
+ onError(err, data, reject) {
464
+ this.prompt(this.vars.messages.error);
465
+ console.log(err);
466
+ return reject(err);
452
467
  },
453
468
  });
454
- module.exports = VEDA
469
+ export default VEDA
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "id": 6642777683539,
3
3
  "name": "@indra.ai/deva.veda",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",
8
8
  "description": "The Veda Deva in deva.world",
9
9
  "main": "index.js",
10
+ "type": "module",
10
11
  "scripts": {
11
12
  "test": "echo \"Error: no test specified\" && exit 1"
12
13
  },
@@ -27,7 +28,7 @@
27
28
  },
28
29
  "homepage": "https://deva.space/devas/veda",
29
30
  "devDependencies": {
30
- "@indra.ai/deva": "^1.2.22"
31
+ "@indra.ai/deva": "^1.4.10"
31
32
  },
32
33
  "dependencies": {
33
34
  "he": "^1.2.0"
package/utils.js CHANGED
@@ -1,7 +1,12 @@
1
1
  // Copyright (c)2021 Quinn Michaels. All Rights Reserved
2
- const fs = require('fs'); // include for file system manipulation.
3
- const path = require('path'); // include for path joining
4
- const he = require('he'); // used for html entity encoding and decoding.
2
+ import fs from 'fs'; // include for file system manipulation.
3
+ import path from 'path'; // include for path joining
4
+ import he from 'he'; // used for html entity encoding and decoding.
5
+
6
+ // set the __dirname
7
+ import {dirname} from 'node:path';
8
+ import {fileURLToPath} from 'node:url';
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
5
10
 
6
11
  function getProcessingData(file) {
7
12
  const data = fs.readFileSync(path.join(__dirname, 'data', 'processing', `${file}.json`));
@@ -20,7 +25,7 @@ function cleanText(text) {
20
25
  return text;
21
26
  }
22
27
 
23
- module.exports = {
28
+ export default {
24
29
  translate(input) {
25
30
  return input.trim();
26
31
  },
@@ -125,8 +130,6 @@ module.exports = {
125
130
  if (!ret.concepts.includes(concept)) ret.concepts.push(concept);
126
131
  }
127
132
  });
128
- // ret.text = ret.text.replace(/##/g, '#').replace(/@@/g, '@');
129
- ret.hash = this.hash(ret);
130
133
  return ret;
131
134
  }
132
135
  };