@elizaos/cli 1.2.9 → 1.2.11-beta.0
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/dist/index.js +65 -2
- package/dist/templates/plugin-quick-starter/dist/index.js +195 -0
- package/dist/templates/plugin-quick-starter/dist/index.js.map +1 -0
- package/dist/templates/plugin-quick-starter/package.json +1 -1
- package/dist/templates/plugin-starter/package.json +2 -2
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-tee-starter/package.json +3 -3
- package/package.json +5 -5
- package/templates/plugin-quick-starter/dist/index.d.ts +13 -0
- package/templates/plugin-quick-starter/dist/index.js +195 -0
- package/templates/plugin-quick-starter/dist/index.js.map +1 -0
- package/templates/plugin-quick-starter/package.json +1 -1
- package/templates/plugin-starter/package.json +2 -2
- package/templates/project-starter/package.json +4 -4
- package/templates/project-tee-starter/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1775,7 +1775,6 @@ import fs from "fs-extra";
|
|
|
1775
1775
|
|
|
1776
1776
|
// src/utils/upgrade/simple-migration-agent.ts
|
|
1777
1777
|
import { query } from "@anthropic-ai/claude-code";
|
|
1778
|
-
import { EventEmitter } from "events";
|
|
1779
1778
|
|
|
1780
1779
|
// src/utils/upgrade/migration-guide-loader.ts
|
|
1781
1780
|
import { existsSync as existsSync10, readFileSync as readFileSync3 } from "fs";
|
|
@@ -2203,7 +2202,8 @@ function createMigrationGuideLoader(projectRoot) {
|
|
|
2203
2202
|
|
|
2204
2203
|
// src/utils/upgrade/simple-migration-agent.ts
|
|
2205
2204
|
import { logger as logger8 } from "@elizaos/core";
|
|
2206
|
-
var SimpleMigrationAgent = class extends
|
|
2205
|
+
var SimpleMigrationAgent = class extends EventTarget {
|
|
2206
|
+
handlers = /* @__PURE__ */ new Map();
|
|
2207
2207
|
repoPath;
|
|
2208
2208
|
abortController;
|
|
2209
2209
|
verbose;
|
|
@@ -2232,6 +2232,69 @@ var SimpleMigrationAgent = class extends EventEmitter {
|
|
|
2232
2232
|
throw new Error("Cannot initialize migration system without guide access");
|
|
2233
2233
|
}
|
|
2234
2234
|
}
|
|
2235
|
+
// EventEmitter-like API using native EventTarget
|
|
2236
|
+
emit(event, data) {
|
|
2237
|
+
return this.dispatchEvent(new CustomEvent(event, { detail: data }));
|
|
2238
|
+
}
|
|
2239
|
+
on(event, handler) {
|
|
2240
|
+
if (!this.handlers.has(event)) {
|
|
2241
|
+
this.handlers.set(event, /* @__PURE__ */ new Map());
|
|
2242
|
+
}
|
|
2243
|
+
const eventHandlers = this.handlers.get(event);
|
|
2244
|
+
if (eventHandlers.has(handler)) {
|
|
2245
|
+
return this;
|
|
2246
|
+
}
|
|
2247
|
+
const wrappedHandler = (e) => {
|
|
2248
|
+
if (e instanceof CustomEvent) {
|
|
2249
|
+
handler(e.detail);
|
|
2250
|
+
} else {
|
|
2251
|
+
handler(void 0);
|
|
2252
|
+
}
|
|
2253
|
+
};
|
|
2254
|
+
eventHandlers.set(handler, wrappedHandler);
|
|
2255
|
+
this.addEventListener(event, wrappedHandler);
|
|
2256
|
+
return this;
|
|
2257
|
+
}
|
|
2258
|
+
off(event, handler) {
|
|
2259
|
+
const eventHandlers = this.handlers.get(event);
|
|
2260
|
+
const wrappedHandler = eventHandlers?.get(handler);
|
|
2261
|
+
if (wrappedHandler) {
|
|
2262
|
+
this.removeEventListener(event, wrappedHandler);
|
|
2263
|
+
eventHandlers.delete(handler);
|
|
2264
|
+
if (eventHandlers.size === 0) {
|
|
2265
|
+
this.handlers.delete(event);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
// Alias for EventEmitter compatibility
|
|
2270
|
+
removeListener(event, handler) {
|
|
2271
|
+
return this.off(event, handler);
|
|
2272
|
+
}
|
|
2273
|
+
removeAllListeners(event) {
|
|
2274
|
+
if (event) {
|
|
2275
|
+
const eventHandlers = this.handlers.get(event);
|
|
2276
|
+
if (eventHandlers) {
|
|
2277
|
+
for (const [_, wrappedHandler] of eventHandlers) {
|
|
2278
|
+
this.removeEventListener(event, wrappedHandler);
|
|
2279
|
+
}
|
|
2280
|
+
this.handlers.delete(event);
|
|
2281
|
+
}
|
|
2282
|
+
} else {
|
|
2283
|
+
for (const [eventName, eventHandlers] of this.handlers) {
|
|
2284
|
+
for (const [_, wrappedHandler] of eventHandlers) {
|
|
2285
|
+
this.removeEventListener(eventName, wrappedHandler);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
this.handlers.clear();
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
listenerCount(event) {
|
|
2292
|
+
return this.handlers.get(event)?.size || 0;
|
|
2293
|
+
}
|
|
2294
|
+
listeners(event) {
|
|
2295
|
+
const eventHandlers = this.handlers.get(event);
|
|
2296
|
+
return eventHandlers ? Array.from(eventHandlers.keys()) : [];
|
|
2297
|
+
}
|
|
2235
2298
|
isImportantUpdate(text3) {
|
|
2236
2299
|
const importantPatterns = [
|
|
2237
2300
|
/GATE \d+/i,
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// src/plugin.ts
|
|
2
|
+
import {
|
|
3
|
+
ModelType,
|
|
4
|
+
Service,
|
|
5
|
+
logger,
|
|
6
|
+
EventType
|
|
7
|
+
} from "@elizaos/core";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
var configSchema = z.object({
|
|
10
|
+
EXAMPLE_PLUGIN_VARIABLE: z.string().min(1, "Example plugin variable is not provided").optional().transform((val) => {
|
|
11
|
+
if (!val) {
|
|
12
|
+
logger.warn("Example plugin variable is not provided (this is expected)");
|
|
13
|
+
}
|
|
14
|
+
return val;
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
var helloWorldAction = {
|
|
18
|
+
name: "HELLO_WORLD",
|
|
19
|
+
similes: ["GREET", "SAY_HELLO"],
|
|
20
|
+
description: "Responds with a simple hello world message",
|
|
21
|
+
validate: async (_runtime, _message, _state) => {
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
handler: async (_runtime, message, _state, _options = {}, callback, _responses) => {
|
|
25
|
+
try {
|
|
26
|
+
logger.info("Handling HELLO_WORLD action");
|
|
27
|
+
const responseContent = {
|
|
28
|
+
text: "hello world!",
|
|
29
|
+
actions: ["HELLO_WORLD"],
|
|
30
|
+
source: message.content.source
|
|
31
|
+
};
|
|
32
|
+
if (callback) {
|
|
33
|
+
await callback(responseContent);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
text: "hello world!",
|
|
37
|
+
success: true,
|
|
38
|
+
data: {
|
|
39
|
+
actions: ["HELLO_WORLD"],
|
|
40
|
+
source: message.content.source
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
logger.error("Error in HELLO_WORLD action:", error);
|
|
45
|
+
return {
|
|
46
|
+
success: false,
|
|
47
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
examples: [
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
name: "{{name1}}",
|
|
55
|
+
content: {
|
|
56
|
+
text: "Can you say hello?"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "{{name2}}",
|
|
61
|
+
content: {
|
|
62
|
+
text: "hello world!",
|
|
63
|
+
actions: ["HELLO_WORLD"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
var helloWorldProvider = {
|
|
70
|
+
name: "HELLO_WORLD_PROVIDER",
|
|
71
|
+
description: "A simple example provider",
|
|
72
|
+
get: async (_runtime, _message, _state) => {
|
|
73
|
+
return {
|
|
74
|
+
text: "I am a provider",
|
|
75
|
+
values: {},
|
|
76
|
+
data: {}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var StarterService = class _StarterService extends Service {
|
|
81
|
+
static serviceType = "starter";
|
|
82
|
+
capabilityDescription = "This is a starter service which is attached to the agent through the starter plugin.";
|
|
83
|
+
constructor(runtime) {
|
|
84
|
+
super(runtime);
|
|
85
|
+
}
|
|
86
|
+
static async start(runtime) {
|
|
87
|
+
logger.info("Starting starter service");
|
|
88
|
+
const service = new _StarterService(runtime);
|
|
89
|
+
return service;
|
|
90
|
+
}
|
|
91
|
+
static async stop(runtime) {
|
|
92
|
+
logger.info("Stopping starter service");
|
|
93
|
+
const service = runtime.getService(_StarterService.serviceType);
|
|
94
|
+
if (!service) {
|
|
95
|
+
throw new Error("Starter service not found");
|
|
96
|
+
}
|
|
97
|
+
if ("stop" in service && typeof service.stop === "function") {
|
|
98
|
+
await service.stop();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async stop() {
|
|
102
|
+
logger.info("Starter service stopped");
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var starterPlugin = {
|
|
106
|
+
name: "plugin-quick-starter",
|
|
107
|
+
description: "Quick backend-only plugin template for elizaOS",
|
|
108
|
+
config: {
|
|
109
|
+
EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE
|
|
110
|
+
},
|
|
111
|
+
async init(config) {
|
|
112
|
+
logger.info("Initializing plugin-quick-starter");
|
|
113
|
+
try {
|
|
114
|
+
const validatedConfig = await configSchema.parseAsync(config);
|
|
115
|
+
for (const [key, value] of Object.entries(validatedConfig)) {
|
|
116
|
+
if (value) process.env[key] = value;
|
|
117
|
+
}
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (error instanceof z.ZodError) {
|
|
120
|
+
throw new Error(
|
|
121
|
+
`Invalid plugin configuration: ${error.errors.map((e) => e.message).join(", ")}`
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
models: {
|
|
128
|
+
[ModelType.TEXT_SMALL]: async (_runtime, { prompt, stopSequences = [] }) => {
|
|
129
|
+
return "Never gonna give you up, never gonna let you down, never gonna run around and desert you...";
|
|
130
|
+
},
|
|
131
|
+
[ModelType.TEXT_LARGE]: async (_runtime, {
|
|
132
|
+
prompt,
|
|
133
|
+
stopSequences = [],
|
|
134
|
+
maxTokens = 8192,
|
|
135
|
+
temperature = 0.7,
|
|
136
|
+
frequencyPenalty = 0.7,
|
|
137
|
+
presencePenalty = 0.7
|
|
138
|
+
}) => {
|
|
139
|
+
return "Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...";
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
routes: [
|
|
143
|
+
{
|
|
144
|
+
name: "api-status",
|
|
145
|
+
path: "/api/status",
|
|
146
|
+
type: "GET",
|
|
147
|
+
handler: async (_req, res) => {
|
|
148
|
+
res.json({
|
|
149
|
+
status: "ok",
|
|
150
|
+
plugin: "quick-starter",
|
|
151
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
events: {
|
|
157
|
+
[EventType.MESSAGE_RECEIVED]: [
|
|
158
|
+
async (params) => {
|
|
159
|
+
logger.debug("MESSAGE_RECEIVED event received");
|
|
160
|
+
logger.debug("Message:", params.message);
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
[EventType.VOICE_MESSAGE_RECEIVED]: [
|
|
164
|
+
async (params) => {
|
|
165
|
+
logger.debug("VOICE_MESSAGE_RECEIVED event received");
|
|
166
|
+
logger.debug("Message:", params.message);
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
[EventType.WORLD_CONNECTED]: [
|
|
170
|
+
async (params) => {
|
|
171
|
+
logger.debug("WORLD_CONNECTED event received");
|
|
172
|
+
logger.debug("World:", params.world);
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
[EventType.WORLD_JOINED]: [
|
|
176
|
+
async (params) => {
|
|
177
|
+
logger.debug("WORLD_JOINED event received");
|
|
178
|
+
logger.debug("World:", params.world);
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
services: [StarterService],
|
|
183
|
+
actions: [helloWorldAction],
|
|
184
|
+
providers: [helloWorldProvider]
|
|
185
|
+
// dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/index.ts
|
|
189
|
+
var index_default = starterPlugin;
|
|
190
|
+
export {
|
|
191
|
+
StarterService,
|
|
192
|
+
index_default as default,
|
|
193
|
+
starterPlugin
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"sourcesContent":["import type { Plugin } from '@elizaos/core';\nimport {\n type Action,\n type ActionResult,\n type Content,\n type GenerateTextParams,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n ModelType,\n type Provider,\n type ProviderResult,\n Service,\n type State,\n logger,\n type MessagePayload,\n type WorldPayload,\n EventType,\n} from '@elizaos/core';\nimport { z } from 'zod';\n\n/**\n * Defines the configuration schema for a plugin, including the validation rules for the plugin name.\n *\n * @type {import('zod').ZodObject<{ EXAMPLE_PLUGIN_VARIABLE: import('zod').ZodString }>}\n */\nconst configSchema = z.object({\n EXAMPLE_PLUGIN_VARIABLE: z\n .string()\n .min(1, 'Example plugin variable is not provided')\n .optional()\n .transform((val) => {\n if (!val) {\n logger.warn('Example plugin variable is not provided (this is expected)');\n }\n return val;\n }),\n});\n\n/**\n * Example HelloWorld action\n * This demonstrates the simplest possible action structure\n */\n/**\n * Action representing a hello world message.\n * @typedef {Object} Action\n * @property {string} name - The name of the action.\n * @property {string[]} similes - An array of related actions.\n * @property {string} description - A brief description of the action.\n * @property {Function} validate - Asynchronous function to validate the action.\n * @property {Function} handler - Asynchronous function to handle the action and generate a response.\n * @property {Object[]} examples - An array of example inputs and expected outputs for the action.\n */\nconst helloWorldAction: Action = {\n name: 'HELLO_WORLD',\n similes: ['GREET', 'SAY_HELLO'],\n description: 'Responds with a simple hello world message',\n\n validate: async (\n _runtime: IAgentRuntime,\n _message: Memory,\n _state: State | undefined\n ): Promise<boolean> => {\n // Always valid\n return true;\n },\n\n handler: async (\n _runtime: IAgentRuntime,\n message: Memory,\n _state: State | undefined,\n _options: Record<string, unknown> = {},\n callback?: HandlerCallback,\n _responses?: Memory[]\n ): Promise<ActionResult> => {\n try {\n logger.info('Handling HELLO_WORLD action');\n\n // Simple response content for callback\n const responseContent: Content = {\n text: 'hello world!',\n actions: ['HELLO_WORLD'],\n source: message.content.source,\n };\n\n // Call back with the hello world message if callback is provided\n if (callback) {\n await callback(responseContent);\n }\n\n // Return ActionResult\n return {\n text: 'hello world!',\n success: true,\n data: {\n actions: ['HELLO_WORLD'],\n source: message.content.source,\n },\n };\n } catch (error) {\n logger.error('Error in HELLO_WORLD action:', error);\n return {\n success: false,\n error: error instanceof Error ? error : new Error(String(error)),\n };\n }\n },\n\n examples: [\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Can you say hello?',\n },\n },\n {\n name: '{{name2}}',\n content: {\n text: 'hello world!',\n actions: ['HELLO_WORLD'],\n },\n },\n ],\n ],\n};\n\n/**\n * Example Hello World Provider\n * This demonstrates the simplest possible provider implementation\n */\nconst helloWorldProvider: Provider = {\n name: 'HELLO_WORLD_PROVIDER',\n description: 'A simple example provider',\n\n get: async (\n _runtime: IAgentRuntime,\n _message: Memory,\n _state: State | undefined\n ): Promise<ProviderResult> => {\n return {\n text: 'I am a provider',\n values: {},\n data: {},\n };\n },\n};\n\nexport class StarterService extends Service {\n static override serviceType = 'starter';\n\n override capabilityDescription =\n 'This is a starter service which is attached to the agent through the starter plugin.';\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n }\n\n static override async start(runtime: IAgentRuntime): Promise<Service> {\n logger.info('Starting starter service');\n const service = new StarterService(runtime);\n return service;\n }\n\n static override async stop(runtime: IAgentRuntime): Promise<void> {\n logger.info('Stopping starter service');\n const service = runtime.getService(StarterService.serviceType);\n if (!service) {\n throw new Error('Starter service not found');\n }\n if ('stop' in service && typeof service.stop === 'function') {\n await service.stop();\n }\n }\n\n override async stop(): Promise<void> {\n logger.info('Starter service stopped');\n }\n}\n\nexport const starterPlugin: Plugin = {\n name: 'plugin-quick-starter',\n description: 'Quick backend-only plugin template for elizaOS',\n config: {\n EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE,\n },\n async init(config: Record<string, string>) {\n logger.info('Initializing plugin-quick-starter');\n try {\n const validatedConfig = await configSchema.parseAsync(config);\n\n // Set all environment variables at once\n for (const [key, value] of Object.entries(validatedConfig)) {\n if (value) process.env[key] = value;\n }\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw new Error(\n `Invalid plugin configuration: ${error.errors.map((e) => e.message).join(', ')}`\n );\n }\n throw error;\n }\n },\n models: {\n [ModelType.TEXT_SMALL]: async (\n _runtime,\n { prompt, stopSequences = [] }: GenerateTextParams\n ) => {\n return 'Never gonna give you up, never gonna let you down, never gonna run around and desert you...';\n },\n [ModelType.TEXT_LARGE]: async (\n _runtime,\n {\n prompt,\n stopSequences = [],\n maxTokens = 8192,\n temperature = 0.7,\n frequencyPenalty = 0.7,\n presencePenalty = 0.7,\n }: GenerateTextParams\n ) => {\n return 'Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...';\n },\n },\n routes: [\n {\n name: 'api-status',\n path: '/api/status',\n type: 'GET',\n handler: async (_req: any, res: any) => {\n res.json({\n status: 'ok',\n plugin: 'quick-starter',\n timestamp: new Date().toISOString(),\n });\n },\n },\n ],\n events: {\n [EventType.MESSAGE_RECEIVED]: [\n async (params: MessagePayload) => {\n logger.debug('MESSAGE_RECEIVED event received');\n logger.debug('Message:', params.message);\n },\n ],\n [EventType.VOICE_MESSAGE_RECEIVED]: [\n async (params: MessagePayload) => {\n logger.debug('VOICE_MESSAGE_RECEIVED event received');\n logger.debug('Message:', params.message);\n },\n ],\n [EventType.WORLD_CONNECTED]: [\n async (params: WorldPayload) => {\n logger.debug('WORLD_CONNECTED event received');\n logger.debug('World:', params.world);\n },\n ],\n [EventType.WORLD_JOINED]: [\n async (params: WorldPayload) => {\n logger.debug('WORLD_JOINED event received');\n logger.debug('World:', params.world);\n },\n ],\n },\n services: [StarterService],\n actions: [helloWorldAction],\n providers: [helloWorldProvider],\n // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)\n};\n\nexport default starterPlugin;\n","import { starterPlugin } from './plugin.ts';\n\nexport { starterPlugin, StarterService } from './plugin.ts';\nexport default starterPlugin;\n"],"mappings":";AACA;AAAA,EAQE;AAAA,EAGA;AAAA,EAEA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,SAAS;AAOlB,IAAM,eAAe,EAAE,OAAO;AAAA,EAC5B,yBAAyB,EACtB,OAAO,EACP,IAAI,GAAG,yCAAyC,EAChD,SAAS,EACT,UAAU,CAAC,QAAQ;AAClB,QAAI,CAAC,KAAK;AACR,aAAO,KAAK,4DAA4D;AAAA,IAC1E;AACA,WAAO;AAAA,EACT,CAAC;AACL,CAAC;AAgBD,IAAM,mBAA2B;AAAA,EAC/B,MAAM;AAAA,EACN,SAAS,CAAC,SAAS,WAAW;AAAA,EAC9B,aAAa;AAAA,EAEb,UAAU,OACR,UACA,UACA,WACqB;AAErB,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,OACP,UACA,SACA,QACA,WAAoC,CAAC,GACrC,UACA,eAC0B;AAC1B,QAAI;AACF,aAAO,KAAK,6BAA6B;AAGzC,YAAM,kBAA2B;AAAA,QAC/B,MAAM;AAAA,QACN,SAAS,CAAC,aAAa;AAAA,QACvB,QAAQ,QAAQ,QAAQ;AAAA,MAC1B;AAGA,UAAI,UAAU;AACZ,cAAM,SAAS,eAAe;AAAA,MAChC;AAGA,aAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAA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;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,CAAC,UAAU,gBAAgB,GAAG;AAAA,MAC5B,OAAO,WAA2B;AAChC,eAAO,MAAM,iCAAiC;AAC9C,eAAO,MAAM,YAAY,OAAO,OAAO;AAAA,MACzC;AAAA,IACF;AAAA,IACA,CAAC,UAAU,sBAAsB,GAAG;AAAA,MAClC,OAAO,WAA2B;AAChC,eAAO,MAAM,uCAAuC;AACpD,eAAO,MAAM,YAAY,OAAO,OAAO;AAAA,MACzC;AAAA,IACF;AAAA,IACA,CAAC,UAAU,eAAe,GAAG;AAAA,MAC3B,OAAO,WAAyB;AAC9B,eAAO,MAAM,gCAAgC;AAC7C,eAAO,MAAM,UAAU,OAAO,KAAK;AAAA,MACrC;AAAA,IACF;AAAA,IACA,CAAC,UAAU,YAAY,GAAG;AAAA,MACxB,OAAO,WAAyB;AAC9B,eAAO,MAAM,6BAA6B;AAC1C,eAAO,MAAM,UAAU,OAAO,KAAK;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AAAA,EACA,UAAU,CAAC,cAAc;AAAA,EACzB,SAAS,CAAC,gBAAgB;AAAA,EAC1B,WAAW,CAAC,kBAAkB;AAAA;AAEhC;;;AC1QA,IAAO,gBAAQ;","names":[]}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"tsup.config.ts"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elizaos/core": "1.2.
|
|
43
|
+
"@elizaos/core": "1.2.10",
|
|
44
44
|
"@tanstack/react-query": "^5.80.7",
|
|
45
45
|
"clsx": "^2.1.1",
|
|
46
46
|
"tailwind-merge": "^3.3.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"zod": "3.24.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@elizaos/cli": "1.2.
|
|
52
|
+
"@elizaos/cli": "1.2.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.1.10",
|
|
54
54
|
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
55
55
|
"dotenv": "16.4.5",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@elizaos/cli": "1.2.
|
|
32
|
-
"@elizaos/core": "1.2.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.2.
|
|
34
|
-
"@elizaos/plugin-sql": "1.2.
|
|
31
|
+
"@elizaos/cli": "1.2.10",
|
|
32
|
+
"@elizaos/core": "1.2.10",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.2.10",
|
|
34
|
+
"@elizaos/plugin-sql": "1.2.10",
|
|
35
35
|
"@tanstack/react-query": "^5.29.0",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.2.
|
|
37
|
-
"@elizaos/core": "1.2.
|
|
36
|
+
"@elizaos/cli": "1.2.10",
|
|
37
|
+
"@elizaos/core": "1.2.10",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
-
"@elizaos/plugin-sql": "1.2.
|
|
39
|
+
"@elizaos/plugin-sql": "1.2.10",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11-beta.0",
|
|
4
4
|
"description": "elizaOS CLI - Manage your AI agents and plugins",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"typescript": "5.8.3",
|
|
70
70
|
"vite": "^6.3.5"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "62e308fb48494ec8bdae0632310275a130159926",
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@anthropic-ai/claude-code": "^1.0.35",
|
|
75
75
|
"@anthropic-ai/sdk": "^0.54.0",
|
|
76
76
|
"@clack/prompts": "^0.11.0",
|
|
77
|
-
"@elizaos/core": "1.2.
|
|
78
|
-
"@elizaos/plugin-sql": "1.2.
|
|
79
|
-
"@elizaos/server": "1.2.
|
|
77
|
+
"@elizaos/core": "1.2.11-beta.0",
|
|
78
|
+
"@elizaos/plugin-sql": "1.2.11-beta.0",
|
|
79
|
+
"@elizaos/server": "1.2.11-beta.0",
|
|
80
80
|
"bun": "^1.2.17",
|
|
81
81
|
"chalk": "^5.3.0",
|
|
82
82
|
"chokidar": "^4.0.3",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Plugin, Service, IAgentRuntime } from '@elizaos/core';
|
|
2
|
+
|
|
3
|
+
declare class StarterService extends Service {
|
|
4
|
+
static serviceType: string;
|
|
5
|
+
capabilityDescription: string;
|
|
6
|
+
constructor(runtime: IAgentRuntime);
|
|
7
|
+
static start(runtime: IAgentRuntime): Promise<Service>;
|
|
8
|
+
static stop(runtime: IAgentRuntime): Promise<void>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
declare const starterPlugin: Plugin;
|
|
12
|
+
|
|
13
|
+
export { StarterService, starterPlugin as default, starterPlugin };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// src/plugin.ts
|
|
2
|
+
import {
|
|
3
|
+
ModelType,
|
|
4
|
+
Service,
|
|
5
|
+
logger,
|
|
6
|
+
EventType
|
|
7
|
+
} from "@elizaos/core";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
var configSchema = z.object({
|
|
10
|
+
EXAMPLE_PLUGIN_VARIABLE: z.string().min(1, "Example plugin variable is not provided").optional().transform((val) => {
|
|
11
|
+
if (!val) {
|
|
12
|
+
logger.warn("Example plugin variable is not provided (this is expected)");
|
|
13
|
+
}
|
|
14
|
+
return val;
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
var helloWorldAction = {
|
|
18
|
+
name: "HELLO_WORLD",
|
|
19
|
+
similes: ["GREET", "SAY_HELLO"],
|
|
20
|
+
description: "Responds with a simple hello world message",
|
|
21
|
+
validate: async (_runtime, _message, _state) => {
|
|
22
|
+
return true;
|
|
23
|
+
},
|
|
24
|
+
handler: async (_runtime, message, _state, _options = {}, callback, _responses) => {
|
|
25
|
+
try {
|
|
26
|
+
logger.info("Handling HELLO_WORLD action");
|
|
27
|
+
const responseContent = {
|
|
28
|
+
text: "hello world!",
|
|
29
|
+
actions: ["HELLO_WORLD"],
|
|
30
|
+
source: message.content.source
|
|
31
|
+
};
|
|
32
|
+
if (callback) {
|
|
33
|
+
await callback(responseContent);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
text: "hello world!",
|
|
37
|
+
success: true,
|
|
38
|
+
data: {
|
|
39
|
+
actions: ["HELLO_WORLD"],
|
|
40
|
+
source: message.content.source
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
logger.error("Error in HELLO_WORLD action:", error);
|
|
45
|
+
return {
|
|
46
|
+
success: false,
|
|
47
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
examples: [
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
name: "{{name1}}",
|
|
55
|
+
content: {
|
|
56
|
+
text: "Can you say hello?"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "{{name2}}",
|
|
61
|
+
content: {
|
|
62
|
+
text: "hello world!",
|
|
63
|
+
actions: ["HELLO_WORLD"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
var helloWorldProvider = {
|
|
70
|
+
name: "HELLO_WORLD_PROVIDER",
|
|
71
|
+
description: "A simple example provider",
|
|
72
|
+
get: async (_runtime, _message, _state) => {
|
|
73
|
+
return {
|
|
74
|
+
text: "I am a provider",
|
|
75
|
+
values: {},
|
|
76
|
+
data: {}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var StarterService = class _StarterService extends Service {
|
|
81
|
+
static serviceType = "starter";
|
|
82
|
+
capabilityDescription = "This is a starter service which is attached to the agent through the starter plugin.";
|
|
83
|
+
constructor(runtime) {
|
|
84
|
+
super(runtime);
|
|
85
|
+
}
|
|
86
|
+
static async start(runtime) {
|
|
87
|
+
logger.info("Starting starter service");
|
|
88
|
+
const service = new _StarterService(runtime);
|
|
89
|
+
return service;
|
|
90
|
+
}
|
|
91
|
+
static async stop(runtime) {
|
|
92
|
+
logger.info("Stopping starter service");
|
|
93
|
+
const service = runtime.getService(_StarterService.serviceType);
|
|
94
|
+
if (!service) {
|
|
95
|
+
throw new Error("Starter service not found");
|
|
96
|
+
}
|
|
97
|
+
if ("stop" in service && typeof service.stop === "function") {
|
|
98
|
+
await service.stop();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async stop() {
|
|
102
|
+
logger.info("Starter service stopped");
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var starterPlugin = {
|
|
106
|
+
name: "plugin-quick-starter",
|
|
107
|
+
description: "Quick backend-only plugin template for elizaOS",
|
|
108
|
+
config: {
|
|
109
|
+
EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE
|
|
110
|
+
},
|
|
111
|
+
async init(config) {
|
|
112
|
+
logger.info("Initializing plugin-quick-starter");
|
|
113
|
+
try {
|
|
114
|
+
const validatedConfig = await configSchema.parseAsync(config);
|
|
115
|
+
for (const [key, value] of Object.entries(validatedConfig)) {
|
|
116
|
+
if (value) process.env[key] = value;
|
|
117
|
+
}
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (error instanceof z.ZodError) {
|
|
120
|
+
throw new Error(
|
|
121
|
+
`Invalid plugin configuration: ${error.errors.map((e) => e.message).join(", ")}`
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
models: {
|
|
128
|
+
[ModelType.TEXT_SMALL]: async (_runtime, { prompt, stopSequences = [] }) => {
|
|
129
|
+
return "Never gonna give you up, never gonna let you down, never gonna run around and desert you...";
|
|
130
|
+
},
|
|
131
|
+
[ModelType.TEXT_LARGE]: async (_runtime, {
|
|
132
|
+
prompt,
|
|
133
|
+
stopSequences = [],
|
|
134
|
+
maxTokens = 8192,
|
|
135
|
+
temperature = 0.7,
|
|
136
|
+
frequencyPenalty = 0.7,
|
|
137
|
+
presencePenalty = 0.7
|
|
138
|
+
}) => {
|
|
139
|
+
return "Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...";
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
routes: [
|
|
143
|
+
{
|
|
144
|
+
name: "api-status",
|
|
145
|
+
path: "/api/status",
|
|
146
|
+
type: "GET",
|
|
147
|
+
handler: async (_req, res) => {
|
|
148
|
+
res.json({
|
|
149
|
+
status: "ok",
|
|
150
|
+
plugin: "quick-starter",
|
|
151
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
events: {
|
|
157
|
+
[EventType.MESSAGE_RECEIVED]: [
|
|
158
|
+
async (params) => {
|
|
159
|
+
logger.debug("MESSAGE_RECEIVED event received");
|
|
160
|
+
logger.debug("Message:", params.message);
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
[EventType.VOICE_MESSAGE_RECEIVED]: [
|
|
164
|
+
async (params) => {
|
|
165
|
+
logger.debug("VOICE_MESSAGE_RECEIVED event received");
|
|
166
|
+
logger.debug("Message:", params.message);
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
[EventType.WORLD_CONNECTED]: [
|
|
170
|
+
async (params) => {
|
|
171
|
+
logger.debug("WORLD_CONNECTED event received");
|
|
172
|
+
logger.debug("World:", params.world);
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
[EventType.WORLD_JOINED]: [
|
|
176
|
+
async (params) => {
|
|
177
|
+
logger.debug("WORLD_JOINED event received");
|
|
178
|
+
logger.debug("World:", params.world);
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
services: [StarterService],
|
|
183
|
+
actions: [helloWorldAction],
|
|
184
|
+
providers: [helloWorldProvider]
|
|
185
|
+
// dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/index.ts
|
|
189
|
+
var index_default = starterPlugin;
|
|
190
|
+
export {
|
|
191
|
+
StarterService,
|
|
192
|
+
index_default as default,
|
|
193
|
+
starterPlugin
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"sourcesContent":["import type { Plugin } from '@elizaos/core';\nimport {\n type Action,\n type ActionResult,\n type Content,\n type GenerateTextParams,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n ModelType,\n type Provider,\n type ProviderResult,\n Service,\n type State,\n logger,\n type MessagePayload,\n type WorldPayload,\n EventType,\n} from '@elizaos/core';\nimport { z } from 'zod';\n\n/**\n * Defines the configuration schema for a plugin, including the validation rules for the plugin name.\n *\n * @type {import('zod').ZodObject<{ EXAMPLE_PLUGIN_VARIABLE: import('zod').ZodString }>}\n */\nconst configSchema = z.object({\n EXAMPLE_PLUGIN_VARIABLE: z\n .string()\n .min(1, 'Example plugin variable is not provided')\n .optional()\n .transform((val) => {\n if (!val) {\n logger.warn('Example plugin variable is not provided (this is expected)');\n }\n return val;\n }),\n});\n\n/**\n * Example HelloWorld action\n * This demonstrates the simplest possible action structure\n */\n/**\n * Action representing a hello world message.\n * @typedef {Object} Action\n * @property {string} name - The name of the action.\n * @property {string[]} similes - An array of related actions.\n * @property {string} description - A brief description of the action.\n * @property {Function} validate - Asynchronous function to validate the action.\n * @property {Function} handler - Asynchronous function to handle the action and generate a response.\n * @property {Object[]} examples - An array of example inputs and expected outputs for the action.\n */\nconst helloWorldAction: Action = {\n name: 'HELLO_WORLD',\n similes: ['GREET', 'SAY_HELLO'],\n description: 'Responds with a simple hello world message',\n\n validate: async (\n _runtime: IAgentRuntime,\n _message: Memory,\n _state: State | undefined\n ): Promise<boolean> => {\n // Always valid\n return true;\n },\n\n handler: async (\n _runtime: IAgentRuntime,\n message: Memory,\n _state: State | undefined,\n _options: Record<string, unknown> = {},\n callback?: HandlerCallback,\n _responses?: Memory[]\n ): Promise<ActionResult> => {\n try {\n logger.info('Handling HELLO_WORLD action');\n\n // Simple response content for callback\n const responseContent: Content = {\n text: 'hello world!',\n actions: ['HELLO_WORLD'],\n source: message.content.source,\n };\n\n // Call back with the hello world message if callback is provided\n if (callback) {\n await callback(responseContent);\n }\n\n // Return ActionResult\n return {\n text: 'hello world!',\n success: true,\n data: {\n actions: ['HELLO_WORLD'],\n source: message.content.source,\n },\n };\n } catch (error) {\n logger.error('Error in HELLO_WORLD action:', error);\n return {\n success: false,\n error: error instanceof Error ? error : new Error(String(error)),\n };\n }\n },\n\n examples: [\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Can you say hello?',\n },\n },\n {\n name: '{{name2}}',\n content: {\n text: 'hello world!',\n actions: ['HELLO_WORLD'],\n },\n },\n ],\n ],\n};\n\n/**\n * Example Hello World Provider\n * This demonstrates the simplest possible provider implementation\n */\nconst helloWorldProvider: Provider = {\n name: 'HELLO_WORLD_PROVIDER',\n description: 'A simple example provider',\n\n get: async (\n _runtime: IAgentRuntime,\n _message: Memory,\n _state: State | undefined\n ): Promise<ProviderResult> => {\n return {\n text: 'I am a provider',\n values: {},\n data: {},\n };\n },\n};\n\nexport class StarterService extends Service {\n static override serviceType = 'starter';\n\n override capabilityDescription =\n 'This is a starter service which is attached to the agent through the starter plugin.';\n\n constructor(runtime: IAgentRuntime) {\n super(runtime);\n }\n\n static override async start(runtime: IAgentRuntime): Promise<Service> {\n logger.info('Starting starter service');\n const service = new StarterService(runtime);\n return service;\n }\n\n static override async stop(runtime: IAgentRuntime): Promise<void> {\n logger.info('Stopping starter service');\n const service = runtime.getService(StarterService.serviceType);\n if (!service) {\n throw new Error('Starter service not found');\n }\n if ('stop' in service && typeof service.stop === 'function') {\n await service.stop();\n }\n }\n\n override async stop(): Promise<void> {\n logger.info('Starter service stopped');\n }\n}\n\nexport const starterPlugin: Plugin = {\n name: 'plugin-quick-starter',\n description: 'Quick backend-only plugin template for elizaOS',\n config: {\n EXAMPLE_PLUGIN_VARIABLE: process.env.EXAMPLE_PLUGIN_VARIABLE,\n },\n async init(config: Record<string, string>) {\n logger.info('Initializing plugin-quick-starter');\n try {\n const validatedConfig = await configSchema.parseAsync(config);\n\n // Set all environment variables at once\n for (const [key, value] of Object.entries(validatedConfig)) {\n if (value) process.env[key] = value;\n }\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw new Error(\n `Invalid plugin configuration: ${error.errors.map((e) => e.message).join(', ')}`\n );\n }\n throw error;\n }\n },\n models: {\n [ModelType.TEXT_SMALL]: async (\n _runtime,\n { prompt, stopSequences = [] }: GenerateTextParams\n ) => {\n return 'Never gonna give you up, never gonna let you down, never gonna run around and desert you...';\n },\n [ModelType.TEXT_LARGE]: async (\n _runtime,\n {\n prompt,\n stopSequences = [],\n maxTokens = 8192,\n temperature = 0.7,\n frequencyPenalty = 0.7,\n presencePenalty = 0.7,\n }: GenerateTextParams\n ) => {\n return 'Never gonna make you cry, never gonna say goodbye, never gonna tell a lie and hurt you...';\n },\n },\n routes: [\n {\n name: 'api-status',\n path: '/api/status',\n type: 'GET',\n handler: async (_req: any, res: any) => {\n res.json({\n status: 'ok',\n plugin: 'quick-starter',\n timestamp: new Date().toISOString(),\n });\n },\n },\n ],\n events: {\n [EventType.MESSAGE_RECEIVED]: [\n async (params: MessagePayload) => {\n logger.debug('MESSAGE_RECEIVED event received');\n logger.debug('Message:', params.message);\n },\n ],\n [EventType.VOICE_MESSAGE_RECEIVED]: [\n async (params: MessagePayload) => {\n logger.debug('VOICE_MESSAGE_RECEIVED event received');\n logger.debug('Message:', params.message);\n },\n ],\n [EventType.WORLD_CONNECTED]: [\n async (params: WorldPayload) => {\n logger.debug('WORLD_CONNECTED event received');\n logger.debug('World:', params.world);\n },\n ],\n [EventType.WORLD_JOINED]: [\n async (params: WorldPayload) => {\n logger.debug('WORLD_JOINED event received');\n logger.debug('World:', params.world);\n },\n ],\n },\n services: [StarterService],\n actions: [helloWorldAction],\n providers: [helloWorldProvider],\n // dependencies: ['@elizaos/plugin-knowledge'], <--- plugin dependecies go here (if requires another plugin)\n};\n\nexport default starterPlugin;\n","import { starterPlugin } from './plugin.ts';\n\nexport { starterPlugin, StarterService } from './plugin.ts';\nexport default starterPlugin;\n"],"mappings":";AACA;AAAA,EAQE;AAAA,EAGA;AAAA,EAEA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,SAAS;AAOlB,IAAM,eAAe,EAAE,OAAO;AAAA,EAC5B,yBAAyB,EACtB,OAAO,EACP,IAAI,GAAG,yCAAyC,EAChD,SAAS,EACT,UAAU,CAAC,QAAQ;AAClB,QAAI,CAAC,KAAK;AACR,aAAO,KAAK,4DAA4D;AAAA,IAC1E;AACA,WAAO;AAAA,EACT,CAAC;AACL,CAAC;AAgBD,IAAM,mBAA2B;AAAA,EAC/B,MAAM;AAAA,EACN,SAAS,CAAC,SAAS,WAAW;AAAA,EAC9B,aAAa;AAAA,EAEb,UAAU,OACR,UACA,UACA,WACqB;AAErB,WAAO;AAAA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"@elizaos/core": "1.2.
|
|
43
|
+
"@elizaos/core": "1.2.10",
|
|
44
44
|
"@tanstack/react-query": "^5.80.7",
|
|
45
45
|
"clsx": "^2.1.1",
|
|
46
46
|
"tailwind-merge": "^3.3.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"zod": "3.24.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@elizaos/cli": "1.2.
|
|
52
|
+
"@elizaos/cli": "1.2.10",
|
|
53
53
|
"@tailwindcss/vite": "^4.1.10",
|
|
54
54
|
"@vitejs/plugin-react-swc": "^3.10.2",
|
|
55
55
|
"dotenv": "16.4.5",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@elizaos/cli": "1.2.
|
|
32
|
-
"@elizaos/core": "1.2.
|
|
33
|
-
"@elizaos/plugin-bootstrap": "1.2.
|
|
34
|
-
"@elizaos/plugin-sql": "1.2.
|
|
31
|
+
"@elizaos/cli": "1.2.10",
|
|
32
|
+
"@elizaos/core": "1.2.10",
|
|
33
|
+
"@elizaos/plugin-bootstrap": "1.2.10",
|
|
34
|
+
"@elizaos/plugin-sql": "1.2.10",
|
|
35
35
|
"@tanstack/react-query": "^5.29.0",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"GUIDE.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elizaos/cli": "1.2.
|
|
37
|
-
"@elizaos/core": "1.2.
|
|
36
|
+
"@elizaos/cli": "1.2.10",
|
|
37
|
+
"@elizaos/core": "1.2.10",
|
|
38
38
|
"@elizaos/plugin-redpill": "1.0.3",
|
|
39
|
-
"@elizaos/plugin-sql": "1.2.
|
|
39
|
+
"@elizaos/plugin-sql": "1.2.10",
|
|
40
40
|
"@phala/dstack-sdk": "0.1.11",
|
|
41
41
|
"@solana/web3.js": "1.98.2",
|
|
42
42
|
"viem": "2.30.1",
|