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:

  1. The Core checks that the Deva is active. If it is not, it returns the offline message.
  2. If the state name is not in the list below, the call is ignored without an error. Check the spelling against the list.
  3. 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.
  4. 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