@indra.ai/deva.systems 0.15.5 → 0.15.6
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/README.md +270 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,273 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Systems Deva
|
|
2
|
+
|
|
3
|
+
Systems Deva handles all the various systems in Deva.world. It keeps the client's systems data, the concerns and the global systems settings, and reports it back with restricted values hidden. Its agent key is `systems`. The package entry (`index.js`) exports a ready Deva with empty `func`, `methods`, `listeners`, and `modules`. The `systems` method lives in `feature/methods.js` and is bound at runtime by the feature loader.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js with npm. Systems Deva's `package.json` sets no `engines`. Deva Core 1.67.26 declares `"node": ">=22"` and `"npm": ">=9.5.1"` in its own `package.json`.
|
|
8
|
+
- A project with `"type": "module"` in its `package.json`. Systems Deva is an ES module.
|
|
9
|
+
- `@indra.ai/deva` `^1.67.26` (Deva Core). Systems Deva lists it as a `dependency`.
|
|
10
|
+
- A Feecting agent reachable on the Deva bus if you call the `systems` method. The method hands its output to `#feecting parse`.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @indra.ai/deva.systems --save
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import SystemsDeva from '@indra.ai/deva.systems';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Two licenses
|
|
23
|
+
|
|
24
|
+
A running Deva carries two separate licenses, and each is checked on its own.
|
|
25
|
+
|
|
26
|
+
- **The core license** comes through the client data as `client.VLA`. Deva Core checks it against the core package's VLA at the start of `init`.
|
|
27
|
+
- **The agent license** comes through the license feature data as `features.license.devas.systems`. Deva Core 1.67.26 checks it against the VLA in Systems Deva's own `package.json` right after the features load and before the start chain. Systems Deva also has an `onInit` of its own, which runs `this.license_check(this.license().personal, this.info().VLA)` and then `this.start` or `this.stop`.
|
|
28
|
+
|
|
29
|
+
The agent check compares the sha256 of the whole VLA object, so every field has to match exactly.
|
|
30
|
+
|
|
31
|
+
## Configuration
|
|
32
|
+
|
|
33
|
+
Systems Deva reads two features from the client you pass to `init()`. The feature data loader puts them in the client, and Deva Core loads them into the Deva at startup, so both must be there before `init()` runs.
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
"features": {
|
|
37
|
+
"license": {
|
|
38
|
+
"concerns": [],
|
|
39
|
+
"global": {},
|
|
40
|
+
"devas": {
|
|
41
|
+
"systems": {
|
|
42
|
+
"uid": "24296120490769123430",
|
|
43
|
+
"time": 1795875310499,
|
|
44
|
+
"iso": "2026-11-28T14:15:10.499Z",
|
|
45
|
+
"utc": "Sat, 28 Nov 2026 14:15:10 GMT",
|
|
46
|
+
"date": "Saturday, November 28, 2026 - 6:15:10 AM",
|
|
47
|
+
"license": "34948472480559228528",
|
|
48
|
+
"fingerprint": "o+rkIG46UjP8O2or2lQ/GviqDBye6CNTXxowkJECWzE=",
|
|
49
|
+
"client": "27l9CQgHobrMikrhkiVH3N6A2GYIwOT/TBGhygYgf5k=",
|
|
50
|
+
"agent": "nJCa4yJAQOLtusCoXpoJVQa2S+xlRmvhM8sH6OGitmU=",
|
|
51
|
+
"machine": "zJ9MvOhpt85/FLRsci+lisLsVKrVvQD/p59dpJQxDgE=",
|
|
52
|
+
"core_hash": "QX5bYu6u8xEFC0dRQn8R5pY3c1wJgjv/ONxvV0haKik=",
|
|
53
|
+
"status": "vedic",
|
|
54
|
+
"warning": "⚡️ Deva declares UNLAWFUL USE, MODIFICATION, INSTALLATION, DUPLICATION, DISTRIBUTION, INTERACTION, or IMPLEMENTATION constitutes VEDIC SAHASA a CRIME of the HIGHEST DEGREE. A FINE amounting to 1000 PANAS (1 pana = 3.5 grams of gold) for each INSTANCE has been ORDAINED the PUNISHMENT for SAHASA of the HIGHEST DEGREE.",
|
|
55
|
+
"notice": "Any USE or INTERACTION with Deva constitutes YOUR EXPLICIT CONSENT and AGREEMENT to be GOVERNED according to the LAWS of the 🕉VEDIC RELIGION and 🇺🇸THE UNITED STATES OF AMERICA.",
|
|
56
|
+
"vectors": "#Quinn #QuinnMichaels #InsideTheNet #IndraAI #DEVA #DevaWorld #License #LicenseDeva #VedicLicenseAgreement",
|
|
57
|
+
"owner": "Quinn Michaels",
|
|
58
|
+
"creator": "Quinn Michaels",
|
|
59
|
+
"salute": "🤝🫡🪪🕉🇺🇸",
|
|
60
|
+
"copyright": "Copyright ©2000-2026 Quinn Michaels; All rights reserved.",
|
|
61
|
+
"md5": "t7xAYQBr4ovNiIyiFCvvsA==",
|
|
62
|
+
"sha256": "QOAi8oc2SMNaGXLkoJ4EYKXN2+dOjIk1TgmV0PmlgOs=",
|
|
63
|
+
"sha512": "fowmLExO94DmUHpTJCMa4LQvmne6rZI7YiiwynHVVldhZAdY8oTkt6Qo694vKoSE3Y52gJwve9dVR/5Z5IAg4g=="
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"systems": {
|
|
68
|
+
"concerns": ["Keep every system online."],
|
|
69
|
+
"global": {
|
|
70
|
+
"restricted": ["password", "token"],
|
|
71
|
+
"region": "example-region",
|
|
72
|
+
"database": {"id": "db1", "host": "example.invalid", "password": "example-password"}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- `license.devas.systems` is the agent VLA. The short form above only shows where it goes. It must be the full `VLA` object from this package's `package.json`, for example:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
import pkg from '@indra.ai/deva.systems/package.json' with {type:'json'};
|
|
82
|
+
|
|
83
|
+
const devas = {systems: pkg.VLA}; // goes in features.license.devas
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- `systems.concerns` is an array, and `systems.global` is an object. Deva Core stores them on the systems feature at init. If they are omitted, Deva Core stores `⛔️ NO CONCERNS PROVIDED` and `⛔️ NO GLOBAL PROVIDED` instead.
|
|
87
|
+
- `systems.global.restricted` is an array of lowercase field names whose values the `systems` method hides. See Feature methods.
|
|
88
|
+
- `systems.methods` is how the feature loader binds `feature/methods.js` at init. Import the file and set it here, as shown under Feature methods. If it is omitted, Systems Deva still comes online, and `this.methods` stays empty.
|
|
89
|
+
|
|
90
|
+
## Load it
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
import SystemsDeva from '@indra.ai/deva.systems';
|
|
94
|
+
|
|
95
|
+
const systems = await SystemsDeva.init(client); // client data provided by your loader
|
|
96
|
+
console.log(systems.id.uid);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
When the license checks pass, Systems Deva walks start, enter, done and ready. In `onReady` it reads `this.info().VLA` and prompts `🖥️ Systems Deva Ready > VLA:24296120490769123430`.
|
|
100
|
+
|
|
101
|
+
To shut it down:
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
await SystemsDeva.stop();
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Systems Deva has no `onStop` of its own, so Deva Core runs the default stop chain, which ends on `shutdown` with the value `systems`. A stopped Deva can start again. Call `init()` again with a client that passes the license check.
|
|
108
|
+
|
|
109
|
+
## When Systems Deva refuses to start
|
|
110
|
+
|
|
111
|
+
If a license check fails, Deva Core prompts the message, the Deva stays offline, and `init()` resolves with that message.
|
|
112
|
+
|
|
113
|
+
| You see | Why |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `❌ Bad Personal VLA` | `features.license.devas` is there but has no `systems` entry. |
|
|
116
|
+
| `❌ Invalid VLA Check` | The `systems` entry doesn't match this package's VLA, the license feature has no `devas`, or `client.VLA` doesn't match the core package's VLA. |
|
|
117
|
+
|
|
118
|
+
## Feature methods
|
|
119
|
+
|
|
120
|
+
`feature/methods.js` exports `systems`. The feature loader binds the exported methods at runtime from `client.features.systems.methods` onto the Deva's `methods`. `index.js` itself sets `methods: {}`.
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
import SystemsDeva from '@indra.ai/deva.systems';
|
|
124
|
+
import featureMethods from '@indra.ai/deva.systems/feature/methods.js';
|
|
125
|
+
import pkg from '@indra.ai/deva.systems/package.json' with {type:'json'};
|
|
126
|
+
import core from '@indra.ai/deva/package.json' with {type:'json'};
|
|
127
|
+
|
|
128
|
+
const client = {
|
|
129
|
+
id: '00000000000000000000',
|
|
130
|
+
key: 'client',
|
|
131
|
+
VLA: core.VLA,
|
|
132
|
+
prompt: {
|
|
133
|
+
emoji: '🧪',
|
|
134
|
+
text: 'client',
|
|
135
|
+
colors: {
|
|
136
|
+
label: {R: 2, G: 229, B: 77},
|
|
137
|
+
text: {R: 2, G: 229, B: 77},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
profile: {
|
|
141
|
+
id: '00000000000000000000',
|
|
142
|
+
name: 'Test Client',
|
|
143
|
+
describe: 'Test client for Systems Deva',
|
|
144
|
+
lang: 'en',
|
|
145
|
+
locale: 'en-US',
|
|
146
|
+
currency: 'USD',
|
|
147
|
+
},
|
|
148
|
+
features: {
|
|
149
|
+
license: {
|
|
150
|
+
concerns: [],
|
|
151
|
+
global: {},
|
|
152
|
+
devas: {systems: pkg.VLA},
|
|
153
|
+
},
|
|
154
|
+
systems: {
|
|
155
|
+
concerns: ['Keep every system online.'],
|
|
156
|
+
global: {
|
|
157
|
+
restricted: ['password', 'token'],
|
|
158
|
+
region: 'example-region',
|
|
159
|
+
database: {id: 'db1', host: 'example.invalid', password: 'example-password'},
|
|
160
|
+
},
|
|
161
|
+
methods: featureMethods,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
await SystemsDeva.init(client);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
After `init`, call the bound methods on `SystemsDeva.methods`.
|
|
170
|
+
|
|
171
|
+
| Method | What it does |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| `systems(packet)` | Builds a Feecting document from the systems feature, asks `#feecting parse` to render it, and resolves `{text, html, data}`. `text` and `html` come from the Feecting answer, and `data` is the `concerns` array. If the ask or the parse fails, it returns `this.err(err, packet, reject)`. `packet` is only passed along for that error handling. |
|
|
174
|
+
|
|
175
|
+
The document the `systems` method sends to Feecting is built like this:
|
|
176
|
+
|
|
177
|
+
- A `::BEGIN:SYSTEMS` block with a `### Client` section and a `### Global` section.
|
|
178
|
+
- The client section is a `client:<client_id>` block holding `id`, the client name as `client`, and the concerns as a numbered list under `**concerns**`.
|
|
179
|
+
- Each key in `systems.global` becomes a line `key: value`. A key whose value is an object becomes a `global:<key>:<id>` block, where `<id>` is the object's `id` or the key if it has none, with one `field: value` line per field.
|
|
180
|
+
- The `restricted` key is never printed.
|
|
181
|
+
|
|
182
|
+
With the example client above, the document is:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
::BEGIN:SYSTEMS
|
|
186
|
+
### Client
|
|
187
|
+
::begin:client:00000000000000000000
|
|
188
|
+
id: 00000000000000000000
|
|
189
|
+
client: Test Client
|
|
190
|
+
**concerns**
|
|
191
|
+
1. Keep every system online.
|
|
192
|
+
::end:client:00000000000000000000
|
|
193
|
+
### Global
|
|
194
|
+
region: example-region
|
|
195
|
+
::begin:global:database:db1
|
|
196
|
+
id: db1
|
|
197
|
+
host: example.invalid
|
|
198
|
+
password: *******
|
|
199
|
+
::end:global:database:db1
|
|
200
|
+
::END:SYSTEMS
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Rules for hiding values:
|
|
204
|
+
|
|
205
|
+
- A top-level key or an object field is hidden when its name, lowercased, equals an entry in `global.restricted`. Its value is replaced with `*******`. Entries in `restricted` have to be lowercase, so an entry like `Token` hides nothing.
|
|
206
|
+
- Only one level of objects is expanded. An object inside an object prints as `[object Object]`, so its contents are not shown.
|
|
207
|
+
- `global.restricted` has to be an array. If it is missing, or `global` itself was omitted, the method rejects with a `TypeError`.
|
|
208
|
+
- If no Feecting agent answers, the method rejects with a `TypeError`, and `onError` prompts `💣 ERROR!` and logs it.
|
|
209
|
+
|
|
210
|
+
## Help
|
|
211
|
+
|
|
212
|
+
Help lives in Feecting files. `help/main.feecting` is the main help page, with the heading `{{profile.name}}`, a hidden block that sets `#color`, `#bgcolor`, and `#bg` from `{{profile.color}}`, `{{profile.bgcolor}}`, and `{{profile.background}}`, and the license block. `help/corpus.feecting` is the help corpus, also with the heading `{{profile.name}}`.
|
|
213
|
+
|
|
214
|
+
`help(page, dir)` is a Deva Core method that returns the page as text. `dir` is the folder that holds `help/`, which for this package is `SystemsDeva.info().dir`. The pages are `main`, `corpus`, and `main:license`.
|
|
215
|
+
|
|
216
|
+
## Inside Systems Deva
|
|
217
|
+
|
|
218
|
+
| Name | Kind | What it does |
|
|
219
|
+
| --- | --- | --- |
|
|
220
|
+
| `systems` | feature method | The method in `feature/methods.js`, bound at runtime from `client.features.systems.methods`. |
|
|
221
|
+
| `translate`, `parse`, `process` | utils | Each returns its input trimmed. |
|
|
222
|
+
| `onInit` | lifecycle | Runs `this.license_check(this.license().personal, this.info().VLA)`, then `this.start` if the check passes or `this.stop` if it does not. |
|
|
223
|
+
| `onReady` | lifecycle | Reads `this.info().VLA` and prompts `🖥️ Systems Deva Ready > VLA:24296120490769123430`. |
|
|
224
|
+
| `onError` | lifecycle | Prompts `💣 ERROR!`, logs the error, and returns `reject(err)`. |
|
|
225
|
+
|
|
226
|
+
The `vars` in `package.json` hold the prompt `messages`, the trigger `@SYSTEMS`, an empty `ask.history` array, and an empty `context` object. `func`, `methods`, `listeners`, and `modules` in `index.js` start as empty objects.
|
|
227
|
+
|
|
228
|
+
`uid()`, `info()`, `agent()`, and `status()` are Deva Core methods. `uid()` returns an id with `md5`, `sha256`, and `sha512` hash tiers, and a `fingerprint` that is the sha256 of `license`, `client`, `agent`, `machine`, and `core_hash`. `info()` returns the package info. `agent()` returns the Systems Deva agent. `status()` returns the `Systems Deva active since <date>` string.
|
|
229
|
+
|
|
230
|
+
## Testing
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npm test
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
The `test` script is `node --test`. The tests build a stub client in code from the core VLA in `@indra.ai/deva/package.json` and the VLA in this package's `package.json`, so no client file is needed. They use only `node:test` and `node:assert/strict`, and they stub the Feecting ask so no Feecting agent is needed. They cover:
|
|
237
|
+
|
|
238
|
+
- systems builds as a Deva and waits offline before init
|
|
239
|
+
- systems data has no placeholders left
|
|
240
|
+
- `func`, `methods`, and `listeners` start empty, and `onInit`, `onReady`, and `onError` exist
|
|
241
|
+
- systems comes online and walks to ready
|
|
242
|
+
- systems info matches the package
|
|
243
|
+
- systems agent matches the package
|
|
244
|
+
- systems agent warning carries the corrected spellings
|
|
245
|
+
- systems uid carries hash tiers and a fingerprint of its contents
|
|
246
|
+
- the package VLA fingerprint is the sha256 of `license`, `client`, `agent`, `machine`, and `core_hash`
|
|
247
|
+
- systems status returns the active-since string
|
|
248
|
+
- systems utils answer with trimmed text
|
|
249
|
+
- systems vars include the ready message, trigger, and empty context
|
|
250
|
+
- systems help pages match the files and carry the package license
|
|
251
|
+
- `feature/methods.js` exports only the current methods
|
|
252
|
+
- systems stops through the full chain
|
|
253
|
+
- feature methods from `feature/methods.js` load at runtime
|
|
254
|
+
- `methods.systems` returns the parsed concerns and id end tags
|
|
255
|
+
- `methods.systems` masks every restricted field and keeps the rest readable
|
|
256
|
+
- `methods.systems` routes a question rejection through `this.err`
|
|
257
|
+
- systems refuses to start with a bad agent VLA
|
|
258
|
+
|
|
259
|
+
## Files
|
|
260
|
+
|
|
261
|
+
| File | What it holds |
|
|
262
|
+
| --- | --- |
|
|
263
|
+
| `index.js` | The Systems Deva: utils, empty `func`, `methods`, `listeners`, and `modules`, and the `onInit`, `onReady`, and `onError` hooks. |
|
|
264
|
+
| `package.json` | Package info, the package VLA, and the agent and vars data under `data`. |
|
|
265
|
+
| `feature/methods.js` | The `systems` feature method that the feature loader binds at runtime. |
|
|
266
|
+
| `help/main.feecting` | The main help page and the license block. |
|
|
267
|
+
| `help/corpus.feecting` | The help corpus. |
|
|
268
|
+
| `index.test.js` | The tests. |
|
|
269
|
+
| `assets/` | The emoji, avatar, background and main images. |
|
|
270
|
+
| `LICENSE.md` | The license. |
|
|
3
271
|
|
|
4
272
|
Copyright ©2000-2026 Quinn Michaels; All rights reserved.
|
|
5
273
|
Owner Signature Required For Lawful Use.
|