@indra.ai/deva.support 0.6.0 → 0.7.1

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/feature/methods.js +43 -0
  2. package/package.json +2 -2
@@ -144,6 +144,49 @@ export default {
144
144
  this.context('info');
145
145
  return Promise.resolve(this.info());
146
146
  },
147
+
148
+ /**************
149
+ method: devas
150
+ params: packet
151
+ describe: List the devas loaded for the current deva.
152
+ ***************/
153
+ devas(packet) {
154
+ const agent = this.agent();
155
+ return new Promise((resolve, reject) => {
156
+ try {
157
+ const devas = [
158
+ `::BEGIN:DEVAS:${packet.id.uid}`,
159
+ '::begin:menu'
160
+ ];
161
+ for (let deva in this.devas) {
162
+ const d = this.devas[deva];
163
+ const {prompt, key, profile} = d.agent();
164
+ devas.push(`button[${prompt.emoji} ${profile.name}]:${this.askChr}${key} help`);
165
+ }
166
+ devas.push('::end:menu');
167
+ devas.push('::begin:hidden');
168
+ devas.push('#color = {{profile.color}}');
169
+ devas.push('#bgcolor = {{profile.bgcolor}}');
170
+ devas.push('#bg = {{profile.background}}');
171
+ devas.push('copyright: {{profile.copyright}}');
172
+ devas.push('::end:hidden');
173
+ devas.push(`::END:DEVAS:${packet.id.uid}`);
174
+
175
+ this.question(`${this.askChr}feecting parse ${devas.join('\n')}`).then(parsed => {
176
+ return resolve({
177
+ text:parsed.a.text,
178
+ html:parsed.a.html,
179
+ data:parsed.a.data,
180
+ });
181
+ }).catch(err => {
182
+ return this.err(err, packet, reject);
183
+ });
184
+ } catch (e) {
185
+ return this.error(e, packet, reject);
186
+ }
187
+ });
188
+ },
189
+
147
190
  /**************
148
191
  method: help
149
192
  params: packet
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "47847759280011485514",
3
3
  "name": "@indra.ai/deva.support",
4
- "version": "0.6.0",
4
+ "version": "0.7.1",
5
5
  "license": "VLA:47847759280011485514 LICENSE.md",
6
6
  "VLA": {
7
7
  "uid": "47847759280011485514",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "homepage": "https://indra.ai",
61
61
  "devDependencies": {
62
- "@indra.ai/deva": "^1.25.0"
62
+ "@indra.ai/deva": "^1.30.0"
63
63
  },
64
64
  "data": {
65
65
  "agent": {