@indra.ai/deva 1.64.37 → 1.64.44

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/_config.yml CHANGED
@@ -11,6 +11,7 @@ lang: en_US
11
11
  logo: /assets/icon.png
12
12
  author:
13
13
  name: Quinn Michaels
14
+ twitter: quinnmichaels
14
15
  email: "quinn@indra.ai"
15
16
  url: "https://indra.ai"
16
17
  twitter:
package/_data/tests.json CHANGED
@@ -56,6 +56,12 @@
56
56
  "title": "Help",
57
57
  "describe": "help() returns the right feecting section by file and part, answers help not found for a missing file or section as invalid and bad without an error or a good intent, and answers offline before init and after stop.",
58
58
  "count": 10
59
+ },
60
+ {
61
+ "file": "08-error.test.js",
62
+ "title": "Error",
63
+ "describe": "err() rejects or hands off to onError without calling context(), talks one stamped error packet, and context() and contexts() read each Deva's own vars.context, falling back safely when it is missing.",
64
+ "count": 6
59
65
  }
60
66
  ],
61
67
  "edgecases": [
@@ -1,9 +1,38 @@
1
- <div class="site-footer">
1
+ <footer class="site-footer" role="contentinfo">
2
2
  <div class="wrapper">
3
- <div class="footer-col-wrapper">
4
- <div class="footer-col footer-col-1">
5
- <p>Copyright &copy;2000-2026 Quinn Michaels; All rights reserved.</p>
3
+ <div class="footer-grid">
4
+ <div class="footer-brand">
5
+ <p class="footer-title">Deva Core</p>
6
+ <p>{{ site.tagline }}</p>
7
+ <p class="footer-small">Distributed under the <a href="{{ '/vla/' | relative_url }}">Vedic License Agreement</a>, VLA <code>31711622713594414221</code>.</p>
8
+ </div>
9
+ <div>
10
+ <p class="footer-title">Project</p>
11
+ <ul>
12
+ <li><a href="{{ '/docs/' | relative_url }}">Documentation</a></li>
13
+ <li><a href="{{ '/tests/' | relative_url }}">Tests</a></li>
14
+ <li><a href="https://github.com/indraai/deva">GitHub</a></li>
15
+ <li><a href="https://www.npmjs.com/package/@indra.ai/deva">npm</a></li>
16
+ </ul>
17
+ </div>
18
+ <div>
19
+ <p class="footer-title">Contact</p>
20
+ <ul>
21
+ <li><a href="mailto:{{ site.author.email }}">{{ site.author.email }}</a></li>
22
+ <li><a href="https://indra.ai">indra.ai</a></li>
23
+ {%- for link in site.social.links %}
24
+ {%- assign host = link | split: "//" | last | split: "/" | first | remove: "www." | split: "." | first -%}
25
+ {%- case host -%}
26
+ {%- when "github" -%}{%- assign label = "GitHub" -%}
27
+ {%- when "x" -%}{%- assign label = "X" -%}
28
+ {%- when "youtube" -%}{%- assign label = "YouTube" -%}
29
+ {%- else -%}{%- assign label = host | capitalize -%}
30
+ {%- endcase %}
31
+ <li><a href="{{ link }}" rel="me">{{ label }}</a></li>
32
+ {%- endfor %}
33
+ </ul>
6
34
  </div>
7
35
  </div>
36
+ <p class="footer-small footer-copy">Copyright &copy;2000-2026 Quinn Michaels; All rights reserved.</p>
8
37
  </div>
9
- </div>
38
+ </footer>
@@ -8,7 +8,7 @@
8
8
  <meta property="og:image:height" content="630">
9
9
  <meta property="og:image:alt" content="{{ page.title | default: site.title }}: {{ site.tagline }}">
10
10
  <meta name="twitter:image:alt" content="{{ page.title | default: site.title }}: {{ site.tagline }}">
11
- <meta name="theme-color" content="#1a1025">
11
+ <meta name="theme-color" content="#0d0f17">
12
12
  <link rel="stylesheet" href="{{ '/assets/main.css' | relative_url }}">
13
13
 
14
14
  {%- feed_meta -%}
@@ -1,23 +1,25 @@
1
1
  <header class="site-header" role="banner">
2
2
  <div class="wrapper">
3
- <a class="site-title" rel="author" href="/">Deva</a>
4
- <nav class="site-nav">
3
+ <a class="site-title" rel="author" href="{{ '/' | relative_url }}">
4
+ <img class="site-logo" src="{{ '/assets/favicon.png' | relative_url }}" alt="" width="28" height="28">
5
+ <span>Deva Core</span>
6
+ </a>
7
+ <nav class="site-nav" aria-label="Main">
5
8
  <input type="checkbox" id="nav-trigger" class="nav-trigger">
6
- <label for="nav-trigger">
9
+ <label for="nav-trigger" aria-label="Menu">
7
10
  <span class="menu-icon">
8
- <svg viewBox="0 0 18 15" width="18px" height="15px">
9
- <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"></path>
10
- </svg>
11
+ <svg viewBox="0 0 18 15" width="18px" height="15px"><path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"></path></svg>
11
12
  </span>
12
13
  </label>
13
-
14
14
  <div class="trigger">
15
- <a class="page-link" href="/core/">Core</a>
16
- <a class="page-link" href="/docs/">Docs</a>
17
- <a class="page-link" href="/tests/">Tests</a>
18
- <a class="page-link" href="/vibe/">Vibe</a>
19
- <a class="page-link" href="/vla/">VLA</a>
20
- <a class="page-link" href="/about/">About</a>
15
+ {%- assign nav = "Core:/core/,Docs:/docs/,Tests:/tests/,Vibe:/vibe/,VLA:/vla/,About:/about/" | split: "," -%}
16
+ {%- for item in nav -%}
17
+ {%- assign parts = item | split: ":" -%}
18
+ {%- assign href = parts[1] -%}
19
+ <a class="page-link{% if page.url contains href %} active{% endif %}" href="{{ href | relative_url }}"{% if page.url == href %} aria-current="page"{% endif %}>{{ parts[0] }}</a>
20
+ {%- endfor -%}
21
+ <a class="page-link nav-cta" href="https://github.com/indraai/deva">GitHub</a>
21
22
  </div>
22
23
  </nav>
23
- </header>
24
+ </div>
25
+ </header>
@@ -0,0 +1,49 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ {%- assign tests = site.data.tests.DATA -%}
5
+ {%- assign total = 0 -%}
6
+ {%- for suite in tests.suites -%}{%- assign total = total | plus: suite.count -%}{%- endfor -%}
7
+ <div class="home">
8
+ <section class="hero">
9
+ <img class="hero-logo" src="{{ '/assets/deva.png' | relative_url }}" alt="Deva Core" width="180" height="180">
10
+ <div class="hero-text">
11
+ <p class="hero-eyebrow">{{ site.tagline }}</p>
12
+ <h1 class="hero-title">{{ page.headline | default: page.title }}</h1>
13
+ <p class="hero-lead">{{ page.description }}</p>
14
+ <div class="hero-actions">
15
+ <a class="btn btn-primary" href="{{ '/docs/#quick-start' | relative_url }}">Quick start</a>
16
+ <a class="btn" href="https://github.com/indraai/deva">View on GitHub</a>
17
+ <a class="btn btn-ghost" href="{{ '/vla/' | relative_url }}">Licensing</a>
18
+ </div>
19
+ <div class="hero-install"><code>npm install @indra.ai/deva</code></div>
20
+ <p class="hero-badges">
21
+ <a href="https://www.npmjs.com/package/@indra.ai/deva"><img src="https://img.shields.io/npm/v/@indra.ai/deva?color=ff5c8a" alt="npm version"></a>
22
+ <a href="https://github.com/indraai/deva/actions/workflows/test.yml"><img src="https://github.com/indraai/deva/actions/workflows/test.yml/badge.svg" alt="Tests"></a>
23
+ </p>
24
+ </div>
25
+ </section>
26
+
27
+ <section class="stats" aria-label="At a glance">
28
+ <div class="stat"><span class="stat-num">{{ total }}</span><span class="stat-label">tests in {{ tests.suites | size }} suites</span></div>
29
+ <div class="stat"><span class="stat-num">0</span><span class="stat-label">runtime dependencies</span></div>
30
+ <div class="stat"><span class="stat-num">3</span><span class="stat-label">hash tiers per packet</span></div>
31
+ <div class="stat"><span class="stat-num">{{ site.data.events.DATA | size }}</span><span class="stat-label">lifecycle events</span></div>
32
+ </section>
33
+
34
+ {%- if page.features %}
35
+ <section class="cards">
36
+ {%- for card in page.features %}
37
+ <a class="card" href="{{ card.url | relative_url }}">
38
+ <h3>{{ card.title }}</h3>
39
+ <p>{{ card.text }}</p>
40
+ <span class="card-more">{{ card.link | default: "Read more" }} &rarr;</span>
41
+ </a>
42
+ {%- endfor %}
43
+ </section>
44
+ {%- endif %}
45
+
46
+ <div class="home-content">
47
+ {{ content }}
48
+ </div>
49
+ </div>
@@ -0,0 +1,149 @@
1
+ ---
2
+ # Deva Core site styles. Overrides minima 2.5.1 (the version GitHub Pages pins).
3
+ ---
4
+
5
+ // minima variables, set before the import so minima builds with them.
6
+ $base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
7
+ $base-font-size: 17px;
8
+ $base-line-height: 1.6;
9
+ $text-color: #e6e8ef;
10
+ $background-color: #0d0f17;
11
+ $brand-color: #ff7aa2;
12
+ $grey-color: #8a90a6;
13
+ $content-width: 1000px;
14
+
15
+ @import "minima";
16
+
17
+ /* ---- Deva Core overrides (plain CSS below so it previews without Sass) ---- */
18
+
19
+ :root {
20
+ --bg: #0d0f17;
21
+ --bg-raised: #151826;
22
+ --bg-code: #10131f;
23
+ --line: #262a3b;
24
+ --text: #e6e8ef;
25
+ --muted: #9aa0b5;
26
+ --pink: #ff5c8a;
27
+ --orange: #ff8a3d;
28
+ --purple: #8b5cf6;
29
+ --link: #ff7aa2;
30
+ --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
31
+ }
32
+
33
+ html { color-scheme: dark; }
34
+ body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
35
+ a { color: var(--link); text-decoration: none; }
36
+ a:visited { color: var(--link); }
37
+ a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
38
+ ::selection { background: rgba(255, 92, 138, .35); }
39
+
40
+ h1, h2, h3, h4 { color: #fff; letter-spacing: -0.01em; font-weight: 650; }
41
+ .post-content h2 { font-size: 1.75rem; margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
42
+ .post-content h3 { font-size: 1.25rem; margin-top: 1.75rem; }
43
+ .post-title, .page-heading { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; }
44
+ .post-header { margin-bottom: 1.5rem; }
45
+ hr { border: 0; border-top: 1px solid var(--line); }
46
+ blockquote { color: var(--muted); border-left: 4px solid var(--purple); font-style: normal; font-size: 1rem; letter-spacing: 0; background: var(--bg-raised); padding: .75rem 1rem; border-radius: 0 8px 8px 0; }
47
+
48
+ /* Header */
49
+ .site-header {
50
+ border-top: 3px solid transparent;
51
+ border-image: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)) 1;
52
+ border-bottom: 1px solid var(--line);
53
+ background: rgba(13, 15, 23, .85);
54
+ backdrop-filter: saturate(140%) blur(10px);
55
+ position: sticky; top: 0; z-index: 10;
56
+ min-height: 60px;
57
+ }
58
+ .site-title, .site-title:visited { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: 0; line-height: 60px; display: inline-flex; align-items: center; gap: .5rem; }
59
+ .site-title:hover { text-decoration: none; }
60
+ .site-logo { width: 28px; height: 28px; border-radius: 6px; }
61
+ .site-nav { line-height: 60px; }
62
+ .site-nav .page-link, .site-nav .page-link:visited { color: var(--muted); font-size: .95rem; }
63
+ .site-nav .page-link:hover, .site-nav .page-link.active { color: #fff; text-decoration: none; }
64
+ .site-nav .page-link.active { box-shadow: inset 0 -2px 0 var(--pink); }
65
+ .site-nav .nav-cta { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; }
66
+ .site-nav .menu-icon > svg path { fill: var(--text); }
67
+ @media screen and (max-width: 600px) {
68
+ .site-nav { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; top: 10px; line-height: 1.4; }
69
+ .site-nav .page-link { padding: .6rem 0; }
70
+ .site-nav .page-link.active { box-shadow: none; color: var(--pink); }
71
+ .site-nav .nav-cta { border: 0; padding: .6rem 0; }
72
+ }
73
+
74
+ /* Code */
75
+ code, pre { font-family: var(--mono); font-size: .88em; background: var(--bg-code); border: 1px solid var(--line); border-radius: 6px; color: #f3d7e1; }
76
+ code { padding: .1em .35em; }
77
+ pre { padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.5; }
78
+ pre > code { border: 0; padding: 0; color: var(--text); font-size: .9rem; }
79
+ .highlight, .highlighter-rouge .highlight, .highlight pre, .highlight code { background: var(--bg-code); }
80
+ .highlighter-rouge .highlight { border-radius: 8px; }
81
+ .highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #6b7290; font-style: italic; }
82
+ .highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc { color: #c49bff; font-weight: normal; }
83
+ .highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sx { color: #9be8a6; }
84
+ .highlight .nx, .highlight .nf, .highlight .na { color: #8ecbff; }
85
+ .highlight .mi, .highlight .mf, .highlight .m, .highlight .kt { color: #ffb37a; }
86
+ .highlight .o, .highlight .p { color: #c7cbe0; font-weight: normal; }
87
+ .highlight .nb, .highlight .bp, .highlight .nc, .highlight .no { color: #ff8fb1; }
88
+ .highlight .err { color: #ff6b6b; background: none; }
89
+
90
+ /* Tables: scroll instead of squeezing on phones */
91
+ table { display: block; overflow-x: auto; width: 100%; border: 1px solid var(--line); border-radius: 8px; border-collapse: separate; border-spacing: 0; color: var(--text); font-size: .95rem; }
92
+ table th, table td { border: 0; border-bottom: 1px solid var(--line); padding: .6rem .8rem; vertical-align: top; }
93
+ table th { background: var(--bg-raised); color: #fff; text-align: left; }
94
+ table tr, table tr:nth-child(even) { background: transparent; }
95
+ table tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
96
+ @media screen and (max-width: 600px) { table td:last-child { min-width: 15rem; } }
97
+ table tr:last-child td { border-bottom: 0; }
98
+ table td code { white-space: nowrap; }
99
+
100
+ /* Home */
101
+ .home .hero { display: flex; align-items: center; gap: 2.5rem; padding: 3rem 0 2rem; }
102
+ .hero-logo { flex: 0 0 auto; width: 180px; height: 180px; filter: drop-shadow(0 10px 40px rgba(255, 92, 138, .35)); }
103
+ .hero-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--orange); margin: 0 0 .5rem; font-weight: 600; }
104
+ .hero-title { font-size: 2.9rem; line-height: 1.1; margin: 0 0 1rem; background: linear-gradient(90deg, #fff 30%, #ffb3c8); -webkit-background-clip: text; background-clip: text; color: transparent; }
105
+ .hero-lead { color: var(--muted); font-size: 1.15rem; max-width: 40rem; }
106
+ .hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 1rem; }
107
+ .btn, .btn:visited { display: inline-block; padding: .65rem 1.2rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); color: #fff; font-weight: 600; font-size: .95rem; }
108
+ .btn:hover { text-decoration: none; border-color: var(--pink); color: #fff; }
109
+ .btn-primary, .btn-primary:visited { background: linear-gradient(90deg, var(--pink), var(--orange)); border-color: transparent; color: #140a10; }
110
+ .btn-primary:hover { color: #140a10; filter: brightness(1.08); }
111
+ .btn-ghost, .btn-ghost:visited { background: transparent; color: var(--muted); }
112
+ .hero-install code { display: inline-block; padding: .55rem .9rem; font-size: .95rem; color: #fff; }
113
+ .hero-install code::before { content: "$ "; color: var(--pink); }
114
+ .hero-badges { margin-top: .75rem; }
115
+ .hero-badges img { vertical-align: middle; margin-right: .35rem; }
116
+
117
+ .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 2rem; }
118
+ .stat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; }
119
+ .stat-num { display: block; font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.1; }
120
+ .stat-label { color: var(--muted); font-size: .9rem; }
121
+
122
+ .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
123
+ .card, .card:visited { display: block; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.35rem; color: var(--text); transition: border-color .15s, transform .15s; }
124
+ .card:hover { border-color: var(--pink); transform: translateY(-2px); text-decoration: none; color: var(--text); }
125
+ .card h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
126
+ .card p { color: var(--muted); margin: 0 0 .75rem; font-size: .97rem; }
127
+ .card-more { color: var(--link); font-size: .9rem; font-weight: 600; }
128
+
129
+ @media screen and (max-width: 800px) {
130
+ .home .hero { flex-direction: column; text-align: center; padding-top: 2rem; }
131
+ .hero-logo { width: 130px; height: 130px; }
132
+ .hero-title { font-size: 2.1rem; }
133
+ .hero-actions { justify-content: center; }
134
+ .stats { grid-template-columns: repeat(2, 1fr); }
135
+ .cards { grid-template-columns: 1fr; }
136
+ .post-title, .page-heading { font-size: 2rem; }
137
+ }
138
+
139
+ /* Footer */
140
+ .site-footer { border-top: 1px solid var(--line); background: #0a0c13; color: var(--muted); padding: 2.5rem 0 1.5rem; margin-top: 3rem; font-size: .92rem; }
141
+ .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
142
+ .footer-title { color: #fff; font-weight: 700; margin-bottom: .5rem; }
143
+ .site-footer ul { list-style: none; margin: 0; }
144
+ .site-footer li { margin-bottom: .3rem; }
145
+ .site-footer a, .site-footer a:visited { color: var(--muted); }
146
+ .site-footer a:hover { color: #fff; }
147
+ .footer-small { font-size: .85rem; }
148
+ .footer-copy { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
149
+ @media screen and (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; } }
package/index.md CHANGED
@@ -1,23 +1,31 @@
1
1
  ---
2
- layout: page
2
+ layout: home
3
3
  title: Deva Core
4
- description: A Vedic-inspired, event-based Node.js framework for building integrated AI agents, with stamped, verifiable data on every step in Node.js.
4
+ headline: Agents that keep a verifiable record of every step.
5
+ description: A Vedic-inspired, event-based Node.js framework for building integrated AI agents, with stamped, verifiable data on every step.
5
6
  image: /assets/banner.png
7
+ features:
8
+ - title: A shared event bus
9
+ text: Devas talk with question, answer, ask, talk and listen. Asks time out instead of hanging.
10
+ url: /docs/#messaging
11
+ link: Messaging
12
+ - title: A named workflow
13
+ text: Features, zones, actions, states, intents, beliefs and contexts are first-class data you can read back stamped.
14
+ url: /core/
15
+ link: Core reference
16
+ - title: Stamped packets
17
+ text: Cumulative md5, sha256 and sha512 tiers on every packet, so you can verify what happened and in what order.
18
+ url: /docs/#stamping-and-the-hash-tiers
19
+ link: Hash tiers
20
+ - title: Tested in the open
21
+ text: Node's built-in test runner, no extra dependencies, run on Node 22 and 24 on every push.
22
+ url: /tests/
23
+ link: Test suites
6
24
  ---
7
25
 
8
- <center>
9
- <img src="/assets/deva.png" alt="Deva Core">
10
- </center>
26
+ ## How it works
11
27
 
12
- **{{ page.description}}**
13
-
14
- [![npm](https://img.shields.io/npm/v/@indra.ai/deva)](https://www.npmjs.com/package/@indra.ai/deva) [![Tests](https://github.com/indraai/deva/actions/workflows/test.yml/badge.svg)](https://github.com/indraai/deva/actions/workflows/test.yml)
15
-
16
- Deva Core is the base of every Deva. Each agent is one `Deva` class instance on a shared event bus. As it works, it moves through named features, zones, actions, states, intents, beliefs and contexts, and it announces every step as an event. Every data packet it builds is stamped with cumulative md5, sha256 and sha512 hashes, so you can verify what happened and in what order.
17
-
18
- ```bash
19
- npm install @indra.ai/deva
20
- ```
28
+ Each agent is one `Deva` class instance on a shared event bus. As it works, it moves through named features, zones, actions, states, intents, beliefs and contexts, and it announces every step as an event. Every data packet it builds is stamped with cumulative md5, sha256 and sha512 hashes.
21
29
 
22
30
  Node.js 22 or later. ES modules only.
23
31
 
@@ -27,15 +35,8 @@ Node.js 22 or later. ES modules only.
27
35
  - [Deva Core on GitHub](https://github.com/indraai/deva), where the code, the issues and the examples live.
28
36
  - [`@indra.ai/deva` on npm](https://www.npmjs.com/package/@indra.ai/deva), for the published package.
29
37
 
30
- ## What it gives you
31
-
32
- - **A shared event bus.** Devas talk to each other with `question`, `answer`, `ask`, `talk` and `listen`. Asks time out instead of hanging.
33
- - **A named workflow.** Features, zones, actions, states, intents, beliefs and contexts are first-class data, and you can read each one back stamped.
34
- - **Stamped packets.** The md5, sha256 and sha512 tiers build on each other, in order, on every packet.
35
- - **Your own methods.** Add agent methods, listeners and extra workflow names through the constructor, and the Core merges them with its own.
36
-
37
- ## License
38
+ ## Working with a team
38
39
 
39
- Deva Core is distributed under the **Vedic License Agreement (VLA)**. Read the [license](https://github.com/indraai/deva/blob/main/LICENSE.md) before you use it.
40
+ Building a multi-agent system and want help with the design, the audit trail or a commercial license? Email [quinn@indra.ai](mailto:quinn@indra.ai). Read the [VLA](/vla/) first.
40
41
 
41
42
  Created by Quinn Michaels. [indra.ai](https://indra.ai)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "31711622713594414221",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.64.37",
4
+ "version": "1.64.44",
5
5
  "description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
6
6
  "main": "index.js",
7
7
  "license": "VLA:31711622713594414221 LICENSE.md",
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ // Deva Core Test Suite: step 8, err() and the context lookups
3
+ // Copyright ©2000-2026 Quinn Michaels; All rights reserved.
4
+ // Owner Signature Required For Lawful Use.
5
+ // Distributed under VLA:31711622713594414221 LICENSE.md
6
+
7
+ import test from 'node:test';
8
+ import assert from 'node:assert/strict';
9
+ import {build, client, agent} from './_deva.js';
10
+
11
+ const TIERS = ['md5', 'sha256', 'sha512'];
12
+ const fresh = () => structuredClone(client);
13
+ // each test gets its own vars so a delete never reaches the shared agent.json data.
14
+ const vars = () => structuredClone(agent.vars);
15
+
16
+ test('err() rejects with the same error and never calls context()', async () => {
17
+ const deva = build({vars: vars()});
18
+ await deva.init(fresh());
19
+ let calls = 0;
20
+ const context = deva.context;
21
+ deva.context = (...args) => { calls++; return context.apply(deva, args); };
22
+ const before = deva._context;
23
+ const boom = new Error('boom');
24
+
25
+ await assert.rejects(deva.err(boom, {test: true}), e => e === boom);
26
+ assert.equal(calls, 0, 'err() does not call context()');
27
+ assert.equal(deva._context, before, 'err() leaves _context alone');
28
+ });
29
+
30
+ test('err() talks one stamped error packet on the error event', async () => {
31
+ const deva = build({vars: vars()});
32
+ await deva.init(fresh());
33
+ const heard = [];
34
+ deva.events.on(deva._events.error, packet => heard.push(packet));
35
+ const boom = new Error('boom');
36
+
37
+ await deva.err(boom, {test: true}).catch(() => {});
38
+ assert.equal(heard.length, 1, 'one error packet');
39
+ const data = heard[0];
40
+ assert.equal(data.key, 'error');
41
+ assert.equal(data.error.message, 'boom');
42
+ assert.deepEqual(data.packet, {test: true});
43
+ for (const t of TIERS) assert.equal(typeof data[t], 'string', `error data ${t}`);
44
+ });
45
+
46
+ test('err() hands err, packet and reject to onError and returns its result', async () => {
47
+ let seen;
48
+ const deva = build({
49
+ vars: vars(),
50
+ onError(err, packet, reject) {
51
+ seen = {err, packet, reject};
52
+ return 'handled';
53
+ },
54
+ });
55
+ await deva.init(fresh());
56
+ const boom = new Error('boom');
57
+ const reject = () => {};
58
+
59
+ assert.equal(await deva.err(boom, {test: true}, reject), 'handled');
60
+ assert.equal(seen.err, boom);
61
+ assert.deepEqual(seen.packet, {test: true});
62
+ assert.equal(seen.reject, reject);
63
+ });
64
+
65
+ test('context() without vars.context returns a stamped packet instead of overflowing', async () => {
66
+ const deva = build({vars: vars()});
67
+ await deva.init(fresh());
68
+ delete deva.vars.context;
69
+
70
+ const data = deva.context('hello', 'world');
71
+ assert.equal(data.key, 'context');
72
+ assert.equal(data.value, 'hello');
73
+ assert.equal(data.text, 'hello world', 'falls back to the raw value');
74
+ for (const t of TIERS) assert.equal(typeof data[t], 'string', `context data ${t}`);
75
+ });
76
+
77
+ test('context() looks the value up in this Deva\'s own vars.context', async () => {
78
+ const deva = build({vars: vars()});
79
+ await deva.init(fresh());
80
+ const [key, text] = Object.entries(agent.vars.context)[0];
81
+
82
+ const data = deva.context(key);
83
+ assert.equal(data.value, key);
84
+ assert.equal(data.text, text);
85
+ });
86
+
87
+ test('contexts() returns this Deva\'s vars.context, or false when it has none', async () => {
88
+ const deva = build({vars: vars()});
89
+ await deva.init(fresh());
90
+
91
+ const data = deva.contexts();
92
+ assert.equal(data.key, 'contexts');
93
+ assert.deepEqual(data.value, deva.vars.context);
94
+ for (const t of TIERS) assert.equal(typeof data[t], 'string', `contexts data ${t}`);
95
+
96
+ delete deva.vars.context;
97
+ assert.equal(deva.contexts().value, false);
98
+ });