@indra.ai/deva.shield 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.
Files changed (2) hide show
  1. package/index.js +3 -37
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -37,49 +37,15 @@ const SHIELD = new Deva({
37
37
  },
38
38
  listeners: {
39
39
  'devacore:question'(packet) {
40
- this.func.echo(packet.q);
40
+ const echo = this.methods.echo('shield', 'question', packet.q);
41
41
  },
42
42
  'devacore:answer'(packet) {
43
- this.func.echo(packet.a);
43
+ const echo = this.methods.echo('shield', 'answer', packet.a);
44
44
  }
45
45
  },
46
46
  modules: {},
47
47
  devas: {},
48
- func: {
49
- echo(opts) {
50
- const {id, agent, client, md5, sha256, sha512} = opts;
51
- const created = Date.now();
52
-
53
- this.action('func', `echo:${id}`);
54
- this.state('set', `echo:${id}`);
55
- const echo_data = [
56
- `::begin:shield:${id}`,
57
- `transport: ${id}`,
58
- `client: ${client.id}`,
59
- `agent: ${agent.id}`,
60
- `created: ${created}`,
61
- `md5: ${md5}`,
62
- `sha256:${sha256}`,
63
- `sha512:${sha512}`,
64
- `::end:shield:${id}`,
65
- ].join('\n');
66
-
67
- // stub for later features right now just echo into the system process for SIGINT monitoring.
68
- const echo = spawn('echo', [echo_data])
69
- echo.stdout.on('data', data => {
70
- this.state('data', `echo:stdout:${id}`);
71
- });
72
- echo.stderr.on('data', err => {
73
- this.state('error', `echo:stderr:${id}`);
74
- this.error(err, opts);
75
- });
76
- echo.on('close', data => {
77
- this.state('close', `echo:${id}`);
78
- });
79
- this.state('return', `echo:${id}`);
80
- return echo_data;
81
- }
82
- },
48
+ func: {},
83
49
  methods: {},
84
50
  onReady(data, resolve) {
85
51
  this.prompt(this.vars.messages.ready);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "72d29d06-a871-4e5c-942c-7a2d7d21973d",
3
3
  "name": "@indra.ai/deva.shield",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",