@indra.ai/deva.error 0.0.15 → 0.0.17

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.
@@ -1,18 +1,14 @@
1
- ::begin:center
2
- image: /public/devas/::agent_key::/main.png
3
- ::end:center
4
-
5
1
  # ::agent_name::
6
2
 
7
- ::profile::
3
+ ::agent_profile::
8
4
 
9
5
  ---
10
6
 
11
- talk:#docs view devas/main:security
7
+ talk: #docs file:private:header main
12
8
 
13
9
  ---
14
10
 
15
- copyright: (c)2023 Quinn Michaels
11
+ copyright: (c)2025 Quinn Michaels
16
12
 
17
13
  ::begin:hidden
18
14
  #color = ::agent_color::
package/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  // Copyright (c)2025 Quinn Michaels
2
2
  // The main Error Deva for deva.world
3
3
  import Deva from '@indra.ai/deva';
4
+ import {MongoClient} from 'mongodb';
4
5
  import pkg from './package.json' with {type:'json'};
6
+ const {agent,vars} = pkg.data;
5
7
 
6
8
  import {dirname} from 'node:path';
7
9
  import {fileURLToPath} from 'node:url';
@@ -21,9 +23,6 @@ const info = {
21
23
  copyright: pkg.copyright,
22
24
  };
23
25
 
24
- import data from './data.json' with {type:'json'};
25
- const {agent,vars} = data.DATA;
26
-
27
26
  const ERROR = new Deva({
28
27
  info,
29
28
  agent,
@@ -35,20 +34,45 @@ const ERROR = new Deva({
35
34
  },
36
35
  listeners: {
37
36
  'devacore:error'(packet) {
38
- this.func.error(packet);
37
+ this.func.error_write('errors', packet);
39
38
  }
40
39
  },
41
40
  modules: {},
42
41
  func: {
43
- error(err) {
44
- console.log('ERROR ERROR DEVA', err);
45
- return;
46
- }
42
+ /**************
43
+ func: log_write
44
+ params: type, packet
45
+ describe: this is the log file writer function that handles writing
46
+ the interactions to json log file.
47
+ ***************/
48
+ async error_write(type, packet) {
49
+ this.prompt('error_write')
50
+ console.log(packet);
51
+ const created = Date.now();
52
+ let result = false;
53
+ try {
54
+ const database = this.modules.client.db(this.vars.database);
55
+ const collection = database.collection(type);
56
+ result = await collection.insertOne(packet);
57
+ } catch (e) {
58
+ console.error(e);
59
+ } finally {
60
+ return result;
61
+ }
62
+ },
47
63
  },
48
64
  methods: {},
49
65
  onReady(data, resolve) {
50
- this.prompt('ready');
66
+ const {uri,database} = this.services().personal.mongo;
67
+ this.modules.client = new MongoClient(uri);
68
+ this.vars.database = database;
69
+ this.prompt(this.vars.messages.ready)
51
70
  return resolve(data);
52
- }
71
+ },
72
+ onError(err, data, reject) {
73
+ this.prompt(this.vars.messages.error);
74
+ console.log(err);
75
+ return reject(err);
76
+ },
53
77
  });
54
78
  export default ERROR
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": 4690322313284,
3
3
  "name": "@indra.ai/deva.error",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "author": "Quinn Michaels",
6
6
  "copyright": "2025",
7
7
  "license": "MIT",
@@ -27,7 +27,98 @@
27
27
  "url": "https://github.com/indraai/deva.error/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@indra.ai/deva": "^1.3.1"
30
+ "@indra.ai/deva": "^1.4.8",
31
+ "mongodb": "^6.14.2"
31
32
  },
32
- "homepage": "https://deva.space/devas/error"
33
+ "homepage": "https://deva.space/devas/error",
34
+ "data": {
35
+ "agent": {
36
+ "id": 3574974849802,
37
+ "key": "error",
38
+ "prompt": {
39
+ "emoji": "❌",
40
+ "text": "Error",
41
+ "colors": {
42
+ "label": {
43
+ "R": 213,
44
+ "G": 3,
45
+ "B": 3
46
+ },
47
+ "text": {
48
+ "R": 247,
49
+ "G": 49,
50
+ "B": 49
51
+ }
52
+ }
53
+ },
54
+ "profile": {
55
+ "name": "Error Deva",
56
+ "pronouns": "He, Him",
57
+ "gender": "DEVA",
58
+ "owner": "Quinn Michaels",
59
+ "creator": "Quinn Michaels",
60
+ "created": "August 21, 2022 at 12:05 AM",
61
+ "system": "Deva.world.error",
62
+ "describe": "ErrorDEVA manage the errors in Deva.world. Responsibilities include managing, logging, and reporting the errors that occur in Deva.world.",
63
+ "emoji": "/public/devas/error/emoji.png",
64
+ "avatar": "/public/devas/error/avatar.png",
65
+ "background": "/public/devas/error/background.png",
66
+ "color": "#f73131",
67
+ "bgcolor": "#000000",
68
+ "voice": "onyx",
69
+ "style": "Technical illustrations and flow charts."
70
+ }
71
+ },
72
+ "vars": {
73
+ "messages": {
74
+ "init": "🟠 INIT",
75
+ "start": "🔵 START",
76
+ "enter": "🟢 ENTER",
77
+ "ready": "⭐️ Error Deva Ready!",
78
+ "stop": "🔴 STOP",
79
+ "exit": "🟡 EXIT",
80
+ "done": "🟣 DONE",
81
+ "error": "💣 ERROR!"
82
+ },
83
+ "live": {
84
+ "profile": "deva",
85
+ "max_tokens": 50,
86
+ "words": 25,
87
+ "history": [],
88
+ "max_chats": 5,
89
+ "page_token": ""
90
+ },
91
+ "ask": {
92
+ "history": []
93
+ },
94
+ "reply": {
95
+ "profile": "deva",
96
+ "max_tokens": 300,
97
+ "words": 100,
98
+ "history": []
99
+ },
100
+ "comment": {
101
+ "profile": "deva",
102
+ "max_tokens": 300,
103
+ "words": 100,
104
+ "history": []
105
+ },
106
+ "art": {
107
+ "history": []
108
+ },
109
+ "context": {
110
+ "uid": "generating uid",
111
+ "status": "getting status",
112
+ "info": "getting info",
113
+ "feature": "accessing feature",
114
+ "issue": "has issues",
115
+ "help": "Help",
116
+ "finish": "Finshed",
117
+ "ask": "Ask",
118
+ "reply": "Reply",
119
+ "live": "Livechat",
120
+ "comment": "Comment"
121
+ }
122
+ }
123
+ }
33
124
  }
package/data.json DELETED
@@ -1,108 +0,0 @@
1
- {
2
- "name": "ERROR Data File",
3
- "describe": "The main Data file for ERROR",
4
- "copyright": "Copyright (c)2022 Quinn Michaels. All rights reserved.",
5
- "DATA": {
6
- "agent": {
7
- "id": 4690322313284,
8
- "key": "error",
9
- "prompt": {
10
- "emoji": "❌",
11
- "text": "Error",
12
- "colors": {
13
- "label": {
14
- "R": 213,
15
- "G": 3,
16
- "B": 3
17
- },
18
- "text": {
19
- "R": 247,
20
- "G": 49,
21
- "B": 49
22
- }
23
- }
24
- },
25
- "profile": {
26
- "identity": "You are #ErrorDEVA in deva.world.",
27
- "invoke": "#ErrorDEVA of deva.world",
28
- "name": "Error Deva",
29
- "mention": "@ErrorDEVA",
30
- "tags": "#Error #ErrorDEVA",
31
- "pronouns": "He, Him, His, Man, Male, Dude, Guy",
32
- "gender": "Deva",
33
- "creator": "Quinn Michaels",
34
- "created": "August 21, 2022 at 12:05 AM",
35
- "house": "House Deva",
36
- "temple": "Kedarnath Temple (Vadari)",
37
- "forest": "Pushkara",
38
- "city": "Amaravati",
39
- "region": "Svarga",
40
- "land": "Visisipra",
41
- "planet": "Arjika",
42
- "loka": "Devaloka",
43
- "verse": "Rikverse",
44
- "system": "deva.world",
45
- "describe": "You are Error Deva. Your duty is to manage the errors in deva.world. Your responsibilities include managing and logging the errors that occur in the deva.world multi-agent system.",
46
- "emoji": "/public/devas/error/emoji.png",
47
- "avatar": "/public/devas/error/avatar.png",
48
- "background": "/public/devas/error/background.png",
49
- "color": "#f73131",
50
- "bgcolor": "#000000",
51
- "voice": "onyx",
52
- "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."
53
- }
54
- },
55
- "vars": {
56
- "messages": {
57
- "init": "🟠 INIT",
58
- "start": "🔵 START",
59
- "enter": "🟢 ENTER",
60
- "stop": "🔴 STOP",
61
- "exit": "🟡 EXIT",
62
- "done": "🟣 DONE",
63
- "error": "💣 ERROR!"
64
- },
65
- "live": {
66
- "profile": "deva",
67
- "max_tokens": 50,
68
- "words": 25,
69
- "history": [],
70
- "max_chats": 5,
71
- "page_token": ""
72
- },
73
- "ask": {
74
- "max_tokens": 500,
75
- "words": 200,
76
- "history": []
77
- },
78
- "reply": {
79
- "profile": "deva",
80
- "max_tokens": 300,
81
- "words": 100,
82
- "history": []
83
- },
84
- "comment": {
85
- "profile": "deva",
86
- "max_tokens": 300,
87
- "words": 100,
88
- "history": []
89
- },
90
- "art": {
91
- "history": []
92
- },
93
- "context": {
94
- "uid": "generating uid",
95
- "status": "getting status",
96
- "info": "getting info",
97
- "feature": "accessing feature",
98
- "issue": "has issues",
99
- "help": "Help",
100
- "finish": "Finshed",
101
- "ask": "Ask",
102
- "reply": "Reply",
103
- "live": "Livechat",
104
- "comment": "Comment"
105
- }
106
- }
107
- }
108
- }