@elizaos/plugin-mysticism 2.0.0-beta.1 → 2.0.3-beta.2
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/LICENSE +21 -0
- package/README.md +75 -82
- package/package.json +20 -3
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -8902
- package/dist/index.js.map +0 -32
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
# @elizaos/plugin-mysticism
|
|
2
2
|
|
|
3
|
-
Mystical divination engines for
|
|
3
|
+
Mystical divination engines for elizaOS agents — Tarot, I Ching, and Astrology readings with progressive revelation, emotional attunement, and optional payment integration.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This plugin gives
|
|
7
|
+
This plugin gives elizaOS agents the ability to perform three classical divination systems as interactive, multi-turn conversations:
|
|
8
8
|
|
|
9
|
-
- **Tarot** — Full 78-card Rider-Waite deck with multiple spread layouts (Three Card, Celtic Cross,
|
|
9
|
+
- **Tarot** — Full 78-card Rider-Waite deck with multiple spread layouts (Three Card, Celtic Cross, Horseshoe, Single Card, Relationship), card-by-card progressive reveal, and positional interpretation.
|
|
10
10
|
- **I Ching** — Three-coin method hexagram casting with full 64-hexagram corpus, changing line detection, and transformed hexagram support.
|
|
11
11
|
- **Astrology** — Natal chart calculation from birth data with planetary positions, house placements, aspect detection, and sign-by-sign interpretation.
|
|
12
12
|
|
|
13
13
|
Each system follows a phased reading lifecycle: **intake → casting → interpretation → synthesis → closing**, allowing the agent to pace the experience naturally and respond to user feedback between revelations.
|
|
14
14
|
|
|
15
|
+
No external APIs are required — all computation uses bundled static data.
|
|
16
|
+
|
|
15
17
|
## Installation
|
|
16
18
|
|
|
17
19
|
```bash
|
|
18
|
-
|
|
19
|
-
# or
|
|
20
|
-
bun add @elizaos/plugin-mysticism@next
|
|
20
|
+
bun add @elizaos/plugin-mysticism
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Peer Dependencies
|
|
24
24
|
|
|
25
|
-
- `@elizaos/core` (
|
|
26
|
-
- Optional `@elizaos/plugin-form` for shared FORM service intake flows
|
|
25
|
+
- `@elizaos/core` (workspace or published `alpha` dist-tag)
|
|
27
26
|
|
|
28
27
|
## Quick Start
|
|
29
28
|
|
|
@@ -40,7 +39,6 @@ Or import and register it directly:
|
|
|
40
39
|
```typescript
|
|
41
40
|
import { mysticismPlugin } from "@elizaos/plugin-mysticism";
|
|
42
41
|
|
|
43
|
-
// Add to your agent's plugin list
|
|
44
42
|
const character = {
|
|
45
43
|
plugins: [mysticismPlugin],
|
|
46
44
|
};
|
|
@@ -48,42 +46,52 @@ const character = {
|
|
|
48
46
|
|
|
49
47
|
## Actions
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
|
54
|
-
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
The plugin registers two actions. Both are expanded via `promoteSubactionsToActions` before the runtime sees them.
|
|
50
|
+
|
|
51
|
+
| Action | Contexts | Min Role | Description |
|
|
52
|
+
|--------|----------|----------|-------------|
|
|
53
|
+
| `MYSTICISM_READING` | `knowledge`, `general` | `USER` | Reading router. Set `type` to `tarot`, `astrology`, or `iching`; set `action` to `start`, `followup`, or `deepen`. |
|
|
54
|
+
| `PAYMENT` | `finance`, `payments` | `OWNER` | Payment router. Set `action` to `check` (read payment status) or `request` (ask user to pay). |
|
|
55
|
+
|
|
56
|
+
### MYSTICISM_READING parameters
|
|
57
|
+
|
|
58
|
+
| Parameter | Required | Description |
|
|
59
|
+
|-----------|----------|-------------|
|
|
60
|
+
| `type` | yes | `tarot` \| `astrology` \| `iching` |
|
|
61
|
+
| `action` | yes | `start` \| `followup` \| `deepen` |
|
|
62
|
+
| `question` | no | Focus question for the reading |
|
|
63
|
+
| `context` | no | Additional context (e.g., birth data hint for astrology) |
|
|
64
|
+
|
|
65
|
+
Similes (trigger phrases): `READING`, `TAROT_READING`, `READ_TAROT`, `DRAW_CARDS`, `ICHING_READING`, `CAST_HEXAGRAM`, `ASTROLOGY_READING`, `BIRTH_CHART`, `NATAL_CHART`, `READING_FOLLOWUP`, `CONTINUE_READING`, `DEEPEN_READING`, `EXPLORE_DEEPER`, and more.
|
|
60
66
|
|
|
61
67
|
## Providers
|
|
62
68
|
|
|
69
|
+
All three providers are dynamic and keyword-gated — they return empty text when the current message is not relevant, keeping context window usage low.
|
|
70
|
+
|
|
63
71
|
| Provider | Description |
|
|
64
72
|
|----------|-------------|
|
|
65
|
-
| `READING_CONTEXT` | Injects active reading session state
|
|
66
|
-
| `ECONOMIC_CONTEXT` |
|
|
67
|
-
| `MYSTICAL_KNOWLEDGE` |
|
|
73
|
+
| `READING_CONTEXT` | Injects active reading session state (progress, revealed elements, payment status, user feedback) |
|
|
74
|
+
| `ECONOMIC_CONTEXT` | Injects user payment history, configured prices, and current session payment status |
|
|
75
|
+
| `MYSTICAL_KNOWLEDGE` | Injects practitioner guidelines, reader personality adaptation, and crisis-awareness rules |
|
|
68
76
|
|
|
69
77
|
## Forms
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
|------|-------------|
|
|
73
|
-
| `tarot-intake` | Collects the user's question and preferred spread |
|
|
74
|
-
| `astrology-intake` | Collects birth date, time, and location |
|
|
75
|
-
| `reading-feedback` | Captures user reflection after each revealed element |
|
|
79
|
+
The plugin exports three `FormDefinition` objects for use with a form service:
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
| Export | ID | Description |
|
|
82
|
+
|--------|----|-------------|
|
|
83
|
+
| `tarotIntakeForm` | `tarot_intake` | Collects the user's question and preferred spread |
|
|
84
|
+
| `astrologyIntakeForm` | `astrology_intake` | Collects birth date, time, and location |
|
|
85
|
+
| `readingFeedbackForm` | `reading_feedback` | Captures user reflection after each revealed element |
|
|
78
86
|
|
|
79
|
-
|
|
87
|
+
## REST API Routes
|
|
80
88
|
|
|
81
|
-
| Method | Path | Description |
|
|
82
|
-
|
|
83
|
-
| `POST` | `/api/readings/tarot` | Start a tarot reading |
|
|
84
|
-
| `POST` | `/api/readings/iching` | Start an I Ching reading |
|
|
85
|
-
| `POST` | `/api/readings/astrology` | Start an astrology reading |
|
|
86
|
-
| `GET` | `/api/readings/status` | Poll
|
|
89
|
+
| Method | Path | Auth | Description |
|
|
90
|
+
|--------|------|------|-------------|
|
|
91
|
+
| `POST` | `/api/readings/tarot` | default | Start a tarot reading |
|
|
92
|
+
| `POST` | `/api/readings/iching` | default | Start an I Ching reading |
|
|
93
|
+
| `POST` | `/api/readings/astrology` | default | Start an astrology reading |
|
|
94
|
+
| `GET` | `/api/readings/status` | public | Poll active session status (`entityId` + `roomId` query params) |
|
|
87
95
|
|
|
88
96
|
### Example: Start a Tarot Reading
|
|
89
97
|
|
|
@@ -98,6 +106,8 @@ curl -X POST http://localhost:3000/api/readings/tarot \
|
|
|
98
106
|
}'
|
|
99
107
|
```
|
|
100
108
|
|
|
109
|
+
Valid `spreadId` values: `single`, `three_card`, `celtic_cross`, `relationship`, `career`.
|
|
110
|
+
|
|
101
111
|
### Example: Start an Astrology Reading
|
|
102
112
|
|
|
103
113
|
```bash
|
|
@@ -119,70 +129,53 @@ curl -X POST http://localhost:3000/api/readings/astrology \
|
|
|
119
129
|
|
|
120
130
|
## Configuration
|
|
121
131
|
|
|
122
|
-
Optional pricing parameters
|
|
132
|
+
Optional pricing parameters, readable via `runtime.getSetting()` or environment variables:
|
|
123
133
|
|
|
124
|
-
| Parameter |
|
|
125
|
-
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
134
|
+
| Parameter | Default | Description |
|
|
135
|
+
|-----------|---------|-------------|
|
|
136
|
+
| `MYSTICISM_PRICE_TAROT` | `0.01` | Base price in SOL for a tarot reading |
|
|
137
|
+
| `MYSTICISM_PRICE_ICHING` | `0.01` | Base price in SOL for an I Ching reading |
|
|
138
|
+
| `MYSTICISM_PRICE_ASTROLOGY` | `0.02` | Base price in SOL for an astrology reading |
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
These are configured suggestions — the agent decides the final amount when issuing a `PAYMENT` action with `action=request`. Invalid or negative values are logged as warnings and the default is used instead.
|
|
131
141
|
|
|
132
142
|
## Architecture
|
|
133
143
|
|
|
134
144
|
```
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
│ └── __tests__/ # Vitest test suite
|
|
149
|
-
├── python/ # Python implementation of divination engines
|
|
150
|
-
├── rust/ # Rust implementation of divination engines
|
|
151
|
-
└── package.json # Root package (monorepo orchestration)
|
|
145
|
+
src/
|
|
146
|
+
index.ts Plugin registration + dynamic provider wrappers
|
|
147
|
+
types.ts All shared types (ReadingSession, TarotCard, Hexagram, NatalChart, ...)
|
|
148
|
+
actions/ MYSTICISM_READING + PAYMENT action handlers
|
|
149
|
+
engines/
|
|
150
|
+
tarot/ TarotEngine — deck, spreads, interpretation
|
|
151
|
+
iching/ IChingEngine — coin casting, 64 hexagrams, changing lines
|
|
152
|
+
astrology/ AstrologyEngine — natal chart calculation, aspects, houses
|
|
153
|
+
forms/ tarotIntakeForm, astrologyIntakeForm, readingFeedbackForm
|
|
154
|
+
providers/ READING_CONTEXT, ECONOMIC_CONTEXT, MYSTICAL_KNOWLEDGE
|
|
155
|
+
routes/ REST routes via createReadingRoutes()
|
|
156
|
+
services/ MysticismService — session lifecycle, crisis detection, payments
|
|
157
|
+
utils/ Shared reading helpers
|
|
152
158
|
```
|
|
153
159
|
|
|
154
160
|
### Engine Design
|
|
155
161
|
|
|
156
|
-
The engines (`TarotEngine`, `IChingEngine`, `AstrologyEngine`) are pure
|
|
162
|
+
The engines (`TarotEngine`, `IChingEngine`, `AstrologyEngine`) are pure TypeScript classes with no elizaOS runtime dependency. They operate on bundled static data (card decks, hexagram tables, zodiac definitions) and return typed results — independently testable in isolation.
|
|
157
163
|
|
|
158
164
|
### Service Layer
|
|
159
165
|
|
|
160
|
-
`MysticismService` manages reading session lifecycle,
|
|
166
|
+
`MysticismService` (service type key `"MYSTICISM"`) manages reading session lifecycle per `entityId:roomId` pair, delegates computation to the engines, tracks progressive reveal state, records user feedback for emotional attunement, and handles payment status transitions.
|
|
161
167
|
|
|
162
|
-
### Safety
|
|
168
|
+
### Crisis Safety
|
|
163
169
|
|
|
164
|
-
The service includes built-in crisis detection that scans user input for indicators
|
|
170
|
+
The service includes built-in crisis detection that scans user input for distress indicators across three severity tiers (high/medium/low). High-severity matches immediately halt the reading and provide mental health resource referrals (988 Suicide & Crisis Lifeline, Crisis Text Line) rather than continuing the divination flow.
|
|
165
171
|
|
|
166
172
|
## Development
|
|
167
173
|
|
|
168
174
|
```bash
|
|
169
|
-
#
|
|
170
|
-
bun
|
|
171
|
-
|
|
172
|
-
#
|
|
173
|
-
bun run
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
bun run test
|
|
177
|
-
|
|
178
|
-
# Type check
|
|
179
|
-
bun run typecheck
|
|
180
|
-
|
|
181
|
-
# Lint & format
|
|
182
|
-
bun run lint
|
|
183
|
-
bun run format
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## License
|
|
187
|
-
|
|
188
|
-
MIT
|
|
175
|
+
bun run --cwd plugins/plugin-mysticism build # compile
|
|
176
|
+
bun run --cwd plugins/plugin-mysticism dev # watch build
|
|
177
|
+
bun run --cwd plugins/plugin-mysticism test # vitest
|
|
178
|
+
bun run --cwd plugins/plugin-mysticism typecheck # tsc --noEmit --noCheck
|
|
179
|
+
bun run --cwd plugins/plugin-mysticism lint # biome check + fix
|
|
180
|
+
bun run --cwd plugins/plugin-mysticism format # biome format
|
|
181
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-mysticism",
|
|
3
3
|
"description": "Mystical divination engines for ElizaOS — Tarot, I Ching, and Astrology readings",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.3-beta.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -23,8 +23,24 @@
|
|
|
23
23
|
"./package.json": "./package.json",
|
|
24
24
|
".": {
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
|
+
"eliza-source": {
|
|
27
|
+
"types": "./src/index.ts",
|
|
28
|
+
"import": "./src/index.ts",
|
|
29
|
+
"default": "./src/index.ts"
|
|
30
|
+
},
|
|
26
31
|
"import": "./dist/index.js",
|
|
27
32
|
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./*.css": "./dist/*.css",
|
|
35
|
+
"./*": {
|
|
36
|
+
"types": "./dist/*.d.ts",
|
|
37
|
+
"eliza-source": {
|
|
38
|
+
"types": "./src/*.ts",
|
|
39
|
+
"import": "./src/*.ts",
|
|
40
|
+
"default": "./src/*.ts"
|
|
41
|
+
},
|
|
42
|
+
"import": "./dist/*.js",
|
|
43
|
+
"default": "./dist/*.js"
|
|
28
44
|
}
|
|
29
45
|
},
|
|
30
46
|
"files": [
|
|
@@ -33,7 +49,7 @@
|
|
|
33
49
|
"package.json"
|
|
34
50
|
],
|
|
35
51
|
"peerDependencies": {
|
|
36
|
-
"@elizaos/core": "2.0.
|
|
52
|
+
"@elizaos/core": "2.0.3-beta.2"
|
|
37
53
|
},
|
|
38
54
|
"devDependencies": {
|
|
39
55
|
"@biomejs/biome": "^2.4.14",
|
|
@@ -75,5 +91,6 @@
|
|
|
75
91
|
"sensitive": false
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
|
|
79
96
|
}
|
package/dist/index.d.ts
DELETED