Core - States What states are in the Deva Core, how to set one with this.state(), how to list them with this.states(), and the full list. What a state is A state records the condition a Deva or a piece of work is in right now: online, idle, waiting, pending, valid, or catch for an error. Each time you set one, the Core records it and broadcasts a devacore:state event. Actions say what is being done, and states say what condition it is in while it happens. Setting a state: this.state() this.state(<state>, <emit_value>) <state> is a key from the list below, such as 'try', 'valid' or 'catch'. <emit_value> is optional extra text added to the record. Use it to say what the state applies to, such as a function name and an id. this.state('try', key); // work is starting inside a try block this.state('valid', `_getFeature:${key}`); // the data passed its check this.state('catch', `_getFeature:${key}`); // an error was caught When you call it: The Core checks that the Deva is active. If it is not, it returns the offline message. If the state name is not in the list below, the call is ignored without an error. Check the spelling against the list. Otherwise the Core sets the current state and builds a record with a unique id, the state key, the label plus your extra text, the agent, the client, and a timestamp. The record is hashed with md5, sha256 and sha512, emitted as devacore:state, and returned to you. Listing the states: this.states() const states = this.states(); This returns every state the Deva knows about as one data packet, with its own id, the agent, the client, a timestamp, and the md5, sha256 and sha512 hashes. The list itself is under states.value, as key and label pairs. If the Deva is not active it returns the offline message. Calling it also records a states action and a data state of its own, so reading the list leaves a trace like everything else. The matching functions this.actions(), this.zones(), this.intents() and the others work the same way for their lists. Available states There are 115 states. online: π€© Online offline: π΄ Offline active: π Active inactive: π₯± Inactive idle: π Idle talk: π’ Talk listen: π Listen ask: π£οΈ Ask question: π¬ Question cmd: πͺ Command answer: π‘ Answer wait: β³ Wait pause: βΈοΈ Pause resume: π Resume pending: β³ Pending connect: π³ Connect disconnect: π΄ Disconnect send: π¬ Send receive: πͺ Receive return: π€Ώ Return resolve: π€ Resolve reject: π§± Reject init: π Init start: π’ Start enter: πͺ Enter done: βοΈ Done ready: βοΈ Ready finish: π Finish complete: β Complete stop: π΄ Stop close: π¦ Close leave: π«£ Leave exit: πͺ Exit shutdown: π Shutdown open: π₯« Open begin: πΊοΈ Begin end: π¬ End load: π¦ Load unload: π₯‘ Unload set: π Set let: π₯¬ Let const: π© Const get: π Get put: π€ Put push: π«Έ Push pull: π Pull while: π While loop: π Loop async: π¦Ώ Async await: π Await continue: β€οΈ Continue break: π Break search: π Search memory: π Memory signature: βοΈοΈ Signature invalid: ποΈ Invalid valid: βοΈ Valid abort: π₯ Abort help: π Help authorized: π Authorized unauthorized: π΄ Unauthorized Done: βοΈ Done glitch: π‘ Glitch intruder: π¦ΉββοΈ Intruder snooper: π Snooper scam: π ββοΈ Scam fraud: π€¬ Fraud crime: π Crime official: π«‘ Official unofficial: π€₯ Unofficial approved: ποΈ Approved denied: π Denied try: πΈ Try catch: βΎοΈ Catch finally: π Finally view: π View license: πͺͺ License feecting: π Feecting data: πΎ Data error: β Error log: πͺ΅ Log report: ποΈ Report security: π¨ Security legal: ποΈ Legal support: πΌ Support services: π οΈ Services systems: π₯οΈ Systems emergency: π Emergency ingress: π«΄ Ingress egress: π«³ Egress go: π Go do: πΉ Do make: ποΈ Make write: π Write create: π¨ Create destroy: π£ Destroy save: π Save build: π·οΈ Build true: π’ True false: π΄ False safe: βͺοΈ Safe unsafe: β«οΈ Unsafe correct: π¦ Correct incorrect: π₯ Incorrect clean: π§Ό Clean dirty: π§Ή Dirty friend: π¦Έ Friend enemy: π¦Ή Enemy fake: π₯Έ Fake real: π² Real mature: π§ Mature immature: π§ Immature consent: βοΈ Consent onfunc: ποΈ onFunction romance: πΉ Romance