@indra.ai/deva.systems 0.0.2 → 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.
Files changed (2) hide show
  1. package/index.js +24 -24
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -1,29 +1,31 @@
1
- // Copyright (c)2023 Quinn Michaels
1
+ // Copyright (c)2025 Quinn Michaels
2
2
  // The Systems Deva manages the various @SYSTEMS in deva.world
3
3
 
4
+ import Deva from '@indra.ai/deva';
5
+ import pkg from './package.json' with {type:'json'};
4
6
 
5
- const fs = require('fs');
6
- const path = require('path');
7
+ import data from './data.json' with {type:'json'};
8
+ const {agent,vars} = data.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));
7
14
 
8
- const package = require('./package.json');
9
15
  const info = {
10
- id: package.id,
11
- name: package.name,
12
- describe: package.description,
13
- version: package.version,
14
- url: package.homepage,
16
+ id: pkg.id,
17
+ name: pkg.name,
18
+ describe: pkg.description,
19
+ version: pkg.version,
20
+ url: pkg.homepage,
15
21
  dir: __dirname,
16
- git: package.repository.url,
17
- bugs: package.bugs.url,
18
- author: package.author,
19
- license: package.license,
20
- copyright: package.copyright,
22
+ git: pkg.repository.url,
23
+ bugs: pkg.bugs.url,
24
+ author: pkg.author,
25
+ license: pkg.license,
26
+ copyright: pkg.copyright,
21
27
  };
22
28
 
23
- const data_path = path.join(__dirname, 'data.json');
24
- const {agent,vars} = require(data_path).DATA;
25
-
26
- const Deva = require('@indra.ai/deva');
27
29
  const SYSTEMS = new Deva({
28
30
  info,
29
31
  agent,
@@ -41,10 +43,8 @@ const SYSTEMS = new Deva({
41
43
  sys_answer(packet) {return;},
42
44
  },
43
45
  methods: {},
44
- onDone(data) {
45
- this.listen('devacore:question', this.func.sys_question);
46
- this.listen('devacore:answer', this.func.sys_answer);
47
- return Promise.resolve(data);
48
- },
46
+ onError(err) {
47
+ console.log('ERR', err);
48
+ }
49
49
  });
50
- module.exports = SYSTEMS
50
+ export default SYSTEMS
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "id": 3605038032151,
3
3
  "name": "@indra.ai/deva.systems",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",
8
8
  "description": "The Systems Deva handles all the various systems 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
  },