@elizaos/plugin-action-bench 1.4.1 โ†’ 1.4.3

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/README.md CHANGED
@@ -1,2 +1,241 @@
1
1
  # plugin-action-bench
2
- Action calling benchmark for Eliza v2, including Typewriter, Relational Data and Multiverse Math.
2
+
3
+ Action calling benchmark plugins for ElizaOS v2, featuring multiverse mathematics where operations behave differently based on dimensional constants. Designed to test AI agents' ability to handle context-dependent mathematics, unknown operational behaviors, and complex state management across dimensional boundaries.
4
+
5
+ > **๐ŸŽ›๏ธ Environment Control**: Use `TYPEWRITER_ENABLED=false` or `MULTIVERSE_MATH_ENABLED=false` to selectively disable benchmark sets. See [Environment Variable Configuration](#environment-variable-configuration) for details.
6
+
7
+ ## Features
8
+
9
+ ### ๐Ÿ”ค Typewriter Actions (Aโ€“Z)
10
+ 26 single-letter typing actions that test basic action chaining and selection:
11
+ - **Actions**: `TYPE_A` through `TYPE_Z`
12
+ - **Purpose**: Tests rapid sequential action execution and accumulation
13
+ - **State Management**: Maintains `typedText` accumulator
14
+
15
+ ### ๐ŸŒŒ Multiverse Math Operations
16
+ Mathematical operations that behave differently based on dimensional constants, testing AI agents' ability to handle context-dependent mathematics:
17
+
18
+ #### Number Input (0-9)
19
+ - **Actions**: `INPUT_0` through `INPUT_9`
20
+ - **Purpose**: Build numbers in the input buffer
21
+
22
+ #### Dimension Selection
23
+ - **SELECT_DIMENSION**: Choose which dimensional rules apply to operations
24
+ - **Available Dimensions**: quantum, chaos, prime, mirror, void, absolute, fibonacci, exponential, harmonic, infinite, golden, spiral, fractal, cyclical
25
+
26
+ #### Multiverse Operations
27
+
28
+ ##### MULTIVERSE_ADD
29
+ Addition with dimensional variations:
30
+ - **Prime Dimension**: Results elevated to nearest prime number
31
+ - **Quantum Dimension**: Includes quantum entanglement factor โˆš(aร—b)
32
+ - **Chaos Dimension**: Adds deterministic chaos factor based on inputs
33
+
34
+ ##### MULTIVERSE_SUBTRACT
35
+ Subtraction with dimensional rules:
36
+ - **Absolute Dimension**: Negative numbers don't exist (absolute value)
37
+ - **Mirror Dimension**: Reflects subtraction across zero
38
+ - **Void Dimension**: Creates void compensation (always positive)
39
+
40
+ ##### MULTIVERSE_MULTIPLY
41
+ Multiplication across dimensions:
42
+ - **Fibonacci Dimension**: Results snap to nearest Fibonacci number
43
+ - **Exponential Dimension**: Multiplication becomes exponentiation
44
+ - **Harmonic Dimension**: Includes harmonic mean in calculation
45
+
46
+ ##### MULTIVERSE_DIVIDE
47
+ Division with special meanings:
48
+ - **Safe Dimension**: Division by zero returns dividend
49
+ - **Infinite Dimension**: Division by zero opens portals (ร—999)
50
+ - **Golden Dimension**: Results converge toward golden ratio ฯ†
51
+
52
+ ##### MULTIVERSE_MODULO
53
+ Modulo with cyclical properties:
54
+ - **Cyclical Dimension**: Creates perfect positive cycles
55
+ - **Spiral Dimension**: Adds spiral patterns using sin/cos
56
+ - **Fractal Dimension**: Self-similar iterations
57
+
58
+ ##### MULTIVERSE_POWER
59
+ Power operations with effects:
60
+ - **Standard Dimension**: Normal exponentiation
61
+ - **Imaginary Dimension**: Powers oscillate with cos factors
62
+ - **Recursive Dimension**: Power applied iteratively
63
+
64
+ ##### MULTIVERSE_SQRT
65
+ Square root variations:
66
+ - **Positive Dimension**: Always returns positive (uses absolute)
67
+ - **Complex Dimension**: Handles negative numbers as imaginary
68
+ - **Quantum Dimension**: Adds quantum fluctuations
69
+
70
+ #### Utility Operations
71
+ - **MATH_STORE**: Store accumulator to memory
72
+ - **MATH_RECALL**: Recall memory to input buffer
73
+ - **MATH_CLEAR**: Reset all buffers
74
+ - **TRANSFER_TO_INPUT**: Move accumulator to input buffer
75
+
76
+ ## State Management
77
+
78
+ The plugin maintains a sophisticated state system:
79
+ - **accumulator**: Main calculation result storage
80
+ - **inputBuffer**: Temporary number input storage
81
+ - **memory**: Persistent value storage
82
+ - **history**: Operation history tracking with explanations
83
+ - **typedText**: Typewriter accumulation buffer
84
+ - **dimension**: Current dimensional constant affecting operations
85
+ - **lastOperation**: Track the most recent operation performed
86
+
87
+ ## Usage
88
+
89
+ ```typescript
90
+ import { actionBenchPlugin } from "@elizaos/plugin-action-bench";
91
+
92
+ // Add to your agent's plugins
93
+ const agent = createAgent({
94
+ plugins: [actionBenchPlugin],
95
+ // ... other configuration
96
+ });
97
+ ```
98
+
99
+ ### Checking Configuration
100
+
101
+ You can verify which benchmarks are loaded programmatically:
102
+
103
+ ```typescript
104
+ import { benchmarkConfig } from "@elizaos/plugin-action-bench";
105
+
106
+ console.log("Benchmark configuration:", benchmarkConfig);
107
+ // Output:
108
+ // {
109
+ // typewriterEnabled: true,
110
+ // multiverseMathEnabled: true,
111
+ // totalActionsLoaded: 48
112
+ // }
113
+ ```
114
+
115
+ ## Environment Variable Configuration
116
+
117
+ The plugin supports granular control over which benchmark actions are loaded through environment variables. This is useful for testing specific features or reducing the action space when not benchmarking.
118
+
119
+ ### Available Environment Variables
120
+
121
+ | Variable | Default | Description |
122
+ |----------|---------|-------------|
123
+ | `TYPEWRITER_ENABLED` | `true` | Controls loading of typewriter actions (A-Z) |
124
+ | `MULTIVERSE_MATH_ENABLED` | `true` | Controls loading of multiverse math operations |
125
+
126
+ ### Examples
127
+
128
+ ```bash
129
+ # Load all benchmarks (default)
130
+ npm start
131
+
132
+ # Only load typewriter actions
133
+ MULTIVERSE_MATH_ENABLED=false npm start
134
+
135
+ # Only load multiverse math actions
136
+ TYPEWRITER_ENABLED=false npm start
137
+
138
+ # Disable all benchmarks (useful for production)
139
+ TYPEWRITER_ENABLED=false MULTIVERSE_MATH_ENABLED=false npm start
140
+ ```
141
+
142
+ ### .env File Configuration
143
+
144
+ You can also configure these in your `.env` file:
145
+
146
+ ```env
147
+ # Enable/disable specific benchmarks
148
+ TYPEWRITER_ENABLED=true
149
+ MULTIVERSE_MATH_ENABLED=true
150
+
151
+ # Example: Only enable typewriter for focused testing
152
+ # TYPEWRITER_ENABLED=true
153
+ # MULTIVERSE_MATH_ENABLED=false
154
+ ```
155
+
156
+ ### Runtime Feedback
157
+
158
+ The plugin provides console output to confirm which benchmarks are loaded:
159
+
160
+ ```
161
+ [plugin-action-bench] Typewriter actions enabled
162
+ [plugin-action-bench] Multiverse math actions enabled
163
+ [plugin-action-bench] Total actions loaded: 48
164
+ ```
165
+
166
+ Or when disabled:
167
+
168
+ ```
169
+ [plugin-action-bench] Typewriter actions disabled via TYPEWRITER_ENABLED=false
170
+ [plugin-action-bench] Multiverse math actions enabled
171
+ [plugin-action-bench] Total actions loaded: 22
172
+ ```
173
+
174
+ ### Why Use Environment Variables?
175
+
176
+ The environment variable system provides several benefits:
177
+
178
+ 1. **Reduce Action Space**: In production, disable benchmarks to reduce the number of actions the AI needs to consider
179
+ 2. **Focused Testing**: Enable only specific benchmarks when testing particular capabilities
180
+ 3. **Performance**: Fewer loaded actions means faster action selection and reduced memory usage
181
+ 4. **Debugging**: Isolate specific action sets to debug issues
182
+ 5. **A/B Testing**: Compare agent performance with different action sets enabled
183
+
184
+ Example scenarios:
185
+ - **Development**: Enable all benchmarks to test full capabilities
186
+ - **Production**: Disable all benchmarks to focus on real actions
187
+ - **Typewriter Testing**: Enable only typewriter to test rapid action chaining
188
+ - **Math Testing**: Enable only multiverse math to test context-dependent operations
189
+
190
+ ## Benchmarking Examples
191
+
192
+ ### Typewriter Test
193
+ Test rapid action selection by typing words:
194
+ ```
195
+ User: "type hello"
196
+ Agent: Uses TYPE_H, TYPE_E, TYPE_L, TYPE_L, TYPE_O sequentially
197
+ ```
198
+
199
+ ### Dimensional Math Test
200
+ Test context-dependent mathematical operations:
201
+ ```
202
+ User: "Set dimension to quantum, then add 5 and 3"
203
+ Agent: Uses SELECT_DIMENSION, INPUT_5, INPUT_3, MULTIVERSE_ADD
204
+ Result: In quantum dimension: 5 + 3 = 10.74 (includes โˆš15 entanglement)
205
+ ```
206
+
207
+ ### Division by Zero Test
208
+ Test how different dimensions handle edge cases:
209
+ ```
210
+ User: "Set dimension to infinite, divide 10 by 0"
211
+ Agent: Uses SELECT_DIMENSION, INPUT_1, INPUT_0, TRANSFER_TO_INPUT, INPUT_0, MULTIVERSE_DIVIDE
212
+ Result: In infinite dimension: 10 รท 0 = 9990 (portal opened!)
213
+ ```
214
+
215
+ ### Fibonacci Multiplication Test
216
+ Test dimensional constraints on operations:
217
+ ```
218
+ User: "In fibonacci dimension, multiply 7 by 8"
219
+ Agent: Uses SELECT_DIMENSION, INPUT_7, TRANSFER_TO_INPUT, INPUT_8, MULTIVERSE_MULTIPLY
220
+ Result: In fibonacci dimension: 7 ร— 8 = 55 (nearest Fibonacci to 56)
221
+ ```
222
+
223
+ ### Complex Calculation Chain Test
224
+ Test multi-step calculations with dimension changes:
225
+ ```
226
+ User: "Add 10 and 5 in prime dimension, then divide by 3 in golden dimension"
227
+ Agent: Uses dimension switching and chaining operations
228
+ Result: 10 + 5 = 17 (prime), then 17 รท 3 = 3.61 (converging to ฯ†)
229
+ ```
230
+
231
+ ### Unknown Math Scenario Test
232
+ The multiverse approach tests if AI can understand contextual mathematics:
233
+ ```
234
+ User: "Calculate the chaos-influenced sum of 15 and 23"
235
+ Agent: Must understand to set chaos dimension and apply MULTIVERSE_ADD
236
+ Result: Deterministic chaos factor added based on seed generation
237
+ ```
238
+
239
+ ## Development
240
+
241
+ This plugin is part of the ElizaOS ecosystem and follows the standard plugin architecture.