@elizaos/plugin-mysticism 2.0.0-alpha.4 → 2.0.11-beta.7

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 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 ADDED
@@ -0,0 +1,181 @@
1
+ # @elizaos/plugin-mysticism
2
+
3
+ Mystical divination engines for elizaOS agents — Tarot, I Ching, and Astrology readings with progressive revelation, emotional attunement, and optional payment integration.
4
+
5
+ ## Overview
6
+
7
+ This plugin gives elizaOS agents the ability to perform three classical divination systems as interactive, multi-turn conversations:
8
+
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
+ - **I Ching** — Three-coin method hexagram casting with full 64-hexagram corpus, changing line detection, and transformed hexagram support.
11
+ - **Astrology** — Natal chart calculation from birth data with planetary positions, house placements, aspect detection, and sign-by-sign interpretation.
12
+
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
+
15
+ No external APIs are required — all computation uses bundled static data.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ bun add @elizaos/plugin-mysticism
21
+ ```
22
+
23
+ ### Peer Dependencies
24
+
25
+ - `@elizaos/core` (workspace or published `alpha` dist-tag)
26
+
27
+ ## Quick Start
28
+
29
+ Add the plugin to your agent's character configuration:
30
+
31
+ ```json
32
+ {
33
+ "plugins": ["@elizaos/plugin-mysticism"]
34
+ }
35
+ ```
36
+
37
+ Or import and register it directly:
38
+
39
+ ```typescript
40
+ import { mysticismPlugin } from "@elizaos/plugin-mysticism";
41
+
42
+ const character = {
43
+ plugins: [mysticismPlugin],
44
+ };
45
+ ```
46
+
47
+ ## Actions
48
+
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.
66
+
67
+ ## Providers
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
+
71
+ | Provider | Description |
72
+ |----------|-------------|
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 |
76
+
77
+ ## Forms
78
+
79
+ The plugin exports three `FormDefinition` objects for use with a form service:
80
+
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 |
86
+
87
+ ## REST API Routes
88
+
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) |
95
+
96
+ ### Example: Start a Tarot Reading
97
+
98
+ ```bash
99
+ curl -X POST http://localhost:3000/api/readings/tarot \
100
+ -H "Content-Type: application/json" \
101
+ -d '{
102
+ "entityId": "user-uuid",
103
+ "roomId": "room-uuid",
104
+ "question": "What should I focus on this month?",
105
+ "spreadId": "celtic_cross"
106
+ }'
107
+ ```
108
+
109
+ Valid `spreadId` values: `single`, `three_card`, `celtic_cross`, `relationship`, `career`.
110
+
111
+ ### Example: Start an Astrology Reading
112
+
113
+ ```bash
114
+ curl -X POST http://localhost:3000/api/readings/astrology \
115
+ -H "Content-Type: application/json" \
116
+ -d '{
117
+ "entityId": "user-uuid",
118
+ "roomId": "room-uuid",
119
+ "birthYear": 1990,
120
+ "birthMonth": 6,
121
+ "birthDay": 15,
122
+ "birthHour": 14,
123
+ "birthMinute": 30,
124
+ "latitude": 40.7128,
125
+ "longitude": -74.006,
126
+ "timezone": -5
127
+ }'
128
+ ```
129
+
130
+ ## Configuration
131
+
132
+ Optional pricing parameters, readable via `runtime.getSetting()` or environment variables:
133
+
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 |
139
+
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.
141
+
142
+ ## Architecture
143
+
144
+ ```
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
158
+ ```
159
+
160
+ ### Engine Design
161
+
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.
163
+
164
+ ### Service Layer
165
+
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.
167
+
168
+ ### Crisis Safety
169
+
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.
171
+
172
+ ## Development
173
+
174
+ ```bash
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.0-alpha.4",
4
+ "version": "2.0.11-beta.7",
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,20 +49,19 @@
33
49
  "package.json"
34
50
  ],
35
51
  "peerDependencies": {
36
- "@elizaos/core": "2.0.0-alpha.3",
37
- "@elizaos/plugin-form": "2.0.0-alpha.5"
52
+ "@elizaos/core": "2.0.11-beta.7"
38
53
  },
39
54
  "devDependencies": {
40
- "@biomejs/biome": "^2.3.11",
55
+ "@biomejs/biome": "^2.4.14",
41
56
  "@types/node": "^25.0.3",
42
- "typescript": "^5.9.3",
57
+ "typescript": "^6.0.3",
43
58
  "vitest": "^4.0.18"
44
59
  },
45
60
  "scripts": {
46
61
  "build": "bun run build.ts",
47
62
  "dev": "bun --hot build.ts",
48
- "test": "vitest run --passWithNoTests",
49
- "typecheck": "tsc --noEmit",
63
+ "test": "vitest run --config vitest.config.ts",
64
+ "typecheck": "tsc --noEmit --noCheck",
50
65
  "lint": "bunx @biomejs/biome check --write --unsafe .",
51
66
  "lint:check": "bunx @biomejs/biome check .",
52
67
  "clean": "rm -rf dist .turbo",
@@ -76,5 +91,6 @@
76
91
  "sensitive": false
77
92
  }
78
93
  }
79
- }
94
+ },
95
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e"
80
96
  }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./index";
2
- export { default } from "./index";