@elizaos/plugin-eliza-classic 2.0.0-alpha.7 → 2.0.0-beta.1

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.
Files changed (63) hide show
  1. package/dist/index.browser.d.ts +2 -2
  2. package/dist/index.browser.js +88 -1
  3. package/dist/index.browser.js.map +1 -1
  4. package/dist/index.d.ts +8 -5
  5. package/dist/index.js +88 -4
  6. package/dist/index.js.map +1 -1
  7. package/package.json +34 -50
  8. package/dist/actions/generateResponse.d.ts +0 -4
  9. package/dist/actions/generateResponse.d.ts.map +0 -1
  10. package/dist/actions/generateResponse.js +0 -50
  11. package/dist/actions/generateResponse.js.map +0 -1
  12. package/dist/actions/index.d.ts +0 -2
  13. package/dist/actions/index.d.ts.map +0 -1
  14. package/dist/actions/index.js +0 -2
  15. package/dist/actions/index.js.map +0 -1
  16. package/dist/browser/index.browser.js +0 -1382
  17. package/dist/browser/index.browser.js.map +0 -15
  18. package/dist/build.d.ts +0 -2
  19. package/dist/build.d.ts.map +0 -1
  20. package/dist/build.js +0 -60
  21. package/dist/build.js.map +0 -1
  22. package/dist/cjs/index.node.cjs +0 -1413
  23. package/dist/cjs/index.node.cjs.map +0 -15
  24. package/dist/generated/specs/spec-helpers.d.ts +0 -49
  25. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  26. package/dist/generated/specs/spec-helpers.js +0 -79
  27. package/dist/generated/specs/spec-helpers.js.map +0 -1
  28. package/dist/generated/specs/specs.d.ts +0 -73
  29. package/dist/generated/specs/specs.d.ts.map +0 -1
  30. package/dist/generated/specs/specs.js +0 -61
  31. package/dist/generated/specs/specs.js.map +0 -1
  32. package/dist/index.browser.d.ts.map +0 -1
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/index.node.d.ts +0 -2
  35. package/dist/index.node.d.ts.map +0 -1
  36. package/dist/index.node.js +0 -2
  37. package/dist/index.node.js.map +0 -1
  38. package/dist/models/index.d.ts +0 -2
  39. package/dist/models/index.d.ts.map +0 -1
  40. package/dist/models/index.js +0 -2
  41. package/dist/models/index.js.map +0 -1
  42. package/dist/models/text.d.ts +0 -8
  43. package/dist/models/text.d.ts.map +0 -1
  44. package/dist/models/text.js +0 -425
  45. package/dist/models/text.js.map +0 -1
  46. package/dist/node/index.node.js +0 -1382
  47. package/dist/node/index.node.js.map +0 -15
  48. package/dist/plugin.d.ts +0 -4
  49. package/dist/plugin.d.ts.map +0 -1
  50. package/dist/plugin.js +0 -91
  51. package/dist/plugin.js.map +0 -1
  52. package/dist/providers/elizaGreeting.d.ts +0 -4
  53. package/dist/providers/elizaGreeting.d.ts.map +0 -1
  54. package/dist/providers/elizaGreeting.js +0 -21
  55. package/dist/providers/elizaGreeting.js.map +0 -1
  56. package/dist/providers/index.d.ts +0 -2
  57. package/dist/providers/index.d.ts.map +0 -1
  58. package/dist/providers/index.js +0 -2
  59. package/dist/providers/index.js.map +0 -1
  60. package/dist/types/index.d.ts +0 -49
  61. package/dist/types/index.d.ts.map +0 -1
  62. package/dist/types/index.js +0 -6
  63. package/dist/types/index.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export * from "./index";
2
- //# sourceMappingURL=index.browser.d.ts.map
1
+ export { default, default as elizaClassicPlugin, generateElizaResponse, getElizaGreeting, plugin } from './index.js';
2
+ import '@elizaos/core';
@@ -1,2 +1,89 @@
1
- export * from "./index";
1
+ // index.ts
2
+ import { ModelType } from "@elizaos/core";
3
+ var responses = [
4
+ { pattern: /\bmother\b/i, response: "Tell me more about your family." },
5
+ {
6
+ pattern: /\bfather\b/i,
7
+ response: "How does that make you feel about your father?"
8
+ },
9
+ { pattern: /\bfeel\b/i, response: "Do you often feel this way?" },
10
+ { pattern: /\bthink\b/i, response: "Why do you think that?" },
11
+ { pattern: /\bwant\b/i, response: "What would it mean if you got that?" },
12
+ {
13
+ pattern: /\bsad\b/i,
14
+ response: "I'm sorry to hear you're feeling sad. Can you tell me more?"
15
+ },
16
+ {
17
+ pattern: /\bhappy\b/i,
18
+ response: "That's wonderful. What's making you happy?"
19
+ },
20
+ { pattern: /\byes\b/i, response: "You seem certain. Why is that?" },
21
+ { pattern: /\bno\b/i, response: "Why not?" },
22
+ {
23
+ pattern: /\bwhy\b/i,
24
+ response: "That's a good question. What do you think?"
25
+ },
26
+ { pattern: /\bhow\b/i, response: "What approach would you suggest?" },
27
+ {
28
+ pattern: /\bwhat\b/i,
29
+ response: "What does that question mean to you?"
30
+ },
31
+ { pattern: /\bcan\b/i, response: "What makes you ask about that?" },
32
+ { pattern: /\byou\b/i, response: "We were talking about you, not me." },
33
+ { pattern: /\bI am\b/i, response: "How long have you been like that?" },
34
+ { pattern: /\bI\b/i, response: "Tell me more about yourself." },
35
+ { pattern: /.*/, response: "Please go on." }
36
+ ];
37
+ function getElizaGreeting() {
38
+ return "Hello. How are you feeling today?";
39
+ }
40
+ function extractUserMessage(prompt) {
41
+ const match = prompt.match(/(?:User|Human|You):\s*(.+?)(?:\n|$)/i);
42
+ return match?.[1]?.trim() ?? prompt.trim();
43
+ }
44
+ function generateElizaResponse(input) {
45
+ for (const entry of responses) {
46
+ if (entry.pattern.test(input)) return entry.response;
47
+ }
48
+ return "Please go on.";
49
+ }
50
+ async function handleText(_runtime, params) {
51
+ const reply = generateElizaResponse(extractUserMessage(params.prompt ?? ""));
52
+ return JSON.stringify({
53
+ thought: "Responding with deterministic ELIZA pattern matching.",
54
+ actions: ["REPLY"],
55
+ providers: [],
56
+ text: reply,
57
+ simple: true,
58
+ useKnowledgeProviders: false
59
+ });
60
+ }
61
+ async function handleEmbedding() {
62
+ return Array.from({ length: 1536 }, (_, index) => index === 0 ? 1 : 0);
63
+ }
64
+ var elizaClassicPlugin = {
65
+ name: "eliza-classic",
66
+ description: "Deterministic offline ELIZA-style text responses.",
67
+ priority: 200,
68
+ models: {
69
+ [ModelType.TEXT_NANO]: handleText,
70
+ [ModelType.TEXT_LARGE]: handleText,
71
+ [ModelType.TEXT_MEDIUM]: handleText,
72
+ [ModelType.TEXT_SMALL]: handleText,
73
+ [ModelType.TEXT_MEGA]: handleText,
74
+ [ModelType.RESPONSE_HANDLER]: handleText,
75
+ [ModelType.ACTION_PLANNER]: handleText,
76
+ [ModelType.TEXT_COMPLETION]: handleText,
77
+ [ModelType.TEXT_EMBEDDING]: handleEmbedding
78
+ }
79
+ };
80
+ var plugin = elizaClassicPlugin;
81
+ var index_default = elizaClassicPlugin;
82
+ export {
83
+ index_default as default,
84
+ elizaClassicPlugin,
85
+ generateElizaResponse,
86
+ getElizaGreeting,
87
+ plugin
88
+ };
2
89
  //# sourceMappingURL=index.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { GenerateTextParams, IAgentRuntime, Plugin } from \"@elizaos/core\";\nimport { ModelType } from \"@elizaos/core\";\n\nconst responses = [\n { pattern: /\\bmother\\b/i, response: \"Tell me more about your family.\" },\n {\n pattern: /\\bfather\\b/i,\n response: \"How does that make you feel about your father?\",\n },\n { pattern: /\\bfeel\\b/i, response: \"Do you often feel this way?\" },\n { pattern: /\\bthink\\b/i, response: \"Why do you think that?\" },\n { pattern: /\\bwant\\b/i, response: \"What would it mean if you got that?\" },\n {\n pattern: /\\bsad\\b/i,\n response: \"I'm sorry to hear you're feeling sad. Can you tell me more?\",\n },\n {\n pattern: /\\bhappy\\b/i,\n response: \"That's wonderful. What's making you happy?\",\n },\n { pattern: /\\byes\\b/i, response: \"You seem certain. Why is that?\" },\n { pattern: /\\bno\\b/i, response: \"Why not?\" },\n {\n pattern: /\\bwhy\\b/i,\n response: \"That's a good question. What do you think?\",\n },\n { pattern: /\\bhow\\b/i, response: \"What approach would you suggest?\" },\n {\n pattern: /\\bwhat\\b/i,\n response: \"What does that question mean to you?\",\n },\n { pattern: /\\bcan\\b/i, response: \"What makes you ask about that?\" },\n { pattern: /\\byou\\b/i, response: \"We were talking about you, not me.\" },\n { pattern: /\\bI am\\b/i, response: \"How long have you been like that?\" },\n { pattern: /\\bI\\b/i, response: \"Tell me more about yourself.\" },\n { pattern: /.*/, response: \"Please go on.\" },\n] as const;\n\nexport function getElizaGreeting(): string {\n return \"Hello. How are you feeling today?\";\n}\n\nfunction extractUserMessage(prompt: string): string {\n const match = prompt.match(/(?:User|Human|You):\\s*(.+?)(?:\\n|$)/i);\n return match?.[1]?.trim() ?? prompt.trim();\n}\n\nexport function generateElizaResponse(input: string): string {\n for (const entry of responses) {\n if (entry.pattern.test(input)) return entry.response;\n }\n return \"Please go on.\";\n}\n\nasync function handleText(\n _runtime: IAgentRuntime,\n params: GenerateTextParams,\n): Promise<string> {\n const reply = generateElizaResponse(extractUserMessage(params.prompt ?? \"\"));\n return JSON.stringify({\n thought: \"Responding with deterministic ELIZA pattern matching.\",\n actions: [\"REPLY\"],\n providers: [],\n text: reply,\n simple: true,\n useKnowledgeProviders: false,\n });\n}\n\nasync function handleEmbedding(): Promise<number[]> {\n return Array.from({ length: 1536 }, (_, index) => (index === 0 ? 1 : 0));\n}\n\nexport const elizaClassicPlugin: Plugin = {\n name: \"eliza-classic\",\n description: \"Deterministic offline ELIZA-style text responses.\",\n priority: 200,\n models: {\n [ModelType.TEXT_NANO]: handleText,\n [ModelType.TEXT_LARGE]: handleText,\n [ModelType.TEXT_MEDIUM]: handleText,\n [ModelType.TEXT_SMALL]: handleText,\n [ModelType.TEXT_MEGA]: handleText,\n [ModelType.RESPONSE_HANDLER]: handleText,\n [ModelType.ACTION_PLANNER]: handleText,\n [ModelType.TEXT_COMPLETION]: handleText,\n [ModelType.TEXT_EMBEDDING]: handleEmbedding,\n },\n};\n\nexport const plugin = elizaClassicPlugin;\nexport default elizaClassicPlugin;\n"],"mappings":";AACA,SAAS,iBAAiB;AAE1B,IAAM,YAAY;AAAA,EAChB,EAAE,SAAS,eAAe,UAAU,kCAAkC;AAAA,EACtE;AAAA,IACE,SAAS;AAAA,IAC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;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,uBAAuB;AAAA,EACzB,CAAC;AACH;AAEA,eAAe,kBAAqC;AAClD,SAAO,MAAM,KAAK,EAAE,QAAQ,KAAK,GAAG,CAAC,GAAG,UAAW,UAAU,IAAI,IAAI,CAAE;AACzE;AAEO,IAAM,qBAA6B;AAAA,EACxC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV,QAAQ;AAAA,IACN,CAAC,UAAU,SAAS,GAAG;AAAA,IACvB,CAAC,UAAU,UAAU,GAAG;AAAA,IACxB,CAAC,UAAU,WAAW,GAAG;AAAA,IACzB,CAAC,UAAU,UAAU,GAAG;AAAA,IACxB,CAAC,UAAU,SAAS,GAAG;AAAA,IACvB,CAAC,UAAU,gBAAgB,GAAG;AAAA,IAC9B,CAAC,UAAU,cAAc,GAAG;AAAA,IAC5B,CAAC,UAAU,eAAe,GAAG;AAAA,IAC7B,CAAC,UAAU,cAAc,GAAG;AAAA,EAC9B;AACF;AAEO,IAAM,SAAS;AACtB,IAAO,gBAAQ;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- export * from "./models";
2
- export { generateElizaResponse, getElizaGreeting } from "./models/text";
3
- export { elizaClassicPlugin, elizaClassicPlugin as default } from "./plugin";
4
- export * from "./types";
5
- //# sourceMappingURL=index.d.ts.map
1
+ import { Plugin } from '@elizaos/core';
2
+
3
+ declare function getElizaGreeting(): string;
4
+ declare function generateElizaResponse(input: string): string;
5
+ declare const elizaClassicPlugin: Plugin;
6
+ declare const plugin: Plugin;
7
+
8
+ export { elizaClassicPlugin as default, elizaClassicPlugin, generateElizaResponse, getElizaGreeting, plugin };
package/dist/index.js CHANGED
@@ -1,5 +1,89 @@
1
- export * from "./models";
2
- export { generateElizaResponse, getElizaGreeting } from "./models/text";
3
- export { elizaClassicPlugin, elizaClassicPlugin as default } from "./plugin";
4
- export * from "./types";
1
+ // index.ts
2
+ import { ModelType } from "@elizaos/core";
3
+ var responses = [
4
+ { pattern: /\bmother\b/i, response: "Tell me more about your family." },
5
+ {
6
+ pattern: /\bfather\b/i,
7
+ response: "How does that make you feel about your father?"
8
+ },
9
+ { pattern: /\bfeel\b/i, response: "Do you often feel this way?" },
10
+ { pattern: /\bthink\b/i, response: "Why do you think that?" },
11
+ { pattern: /\bwant\b/i, response: "What would it mean if you got that?" },
12
+ {
13
+ pattern: /\bsad\b/i,
14
+ response: "I'm sorry to hear you're feeling sad. Can you tell me more?"
15
+ },
16
+ {
17
+ pattern: /\bhappy\b/i,
18
+ response: "That's wonderful. What's making you happy?"
19
+ },
20
+ { pattern: /\byes\b/i, response: "You seem certain. Why is that?" },
21
+ { pattern: /\bno\b/i, response: "Why not?" },
22
+ {
23
+ pattern: /\bwhy\b/i,
24
+ response: "That's a good question. What do you think?"
25
+ },
26
+ { pattern: /\bhow\b/i, response: "What approach would you suggest?" },
27
+ {
28
+ pattern: /\bwhat\b/i,
29
+ response: "What does that question mean to you?"
30
+ },
31
+ { pattern: /\bcan\b/i, response: "What makes you ask about that?" },
32
+ { pattern: /\byou\b/i, response: "We were talking about you, not me." },
33
+ { pattern: /\bI am\b/i, response: "How long have you been like that?" },
34
+ { pattern: /\bI\b/i, response: "Tell me more about yourself." },
35
+ { pattern: /.*/, response: "Please go on." }
36
+ ];
37
+ function getElizaGreeting() {
38
+ return "Hello. How are you feeling today?";
39
+ }
40
+ function extractUserMessage(prompt) {
41
+ const match = prompt.match(/(?:User|Human|You):\s*(.+?)(?:\n|$)/i);
42
+ return match?.[1]?.trim() ?? prompt.trim();
43
+ }
44
+ function generateElizaResponse(input) {
45
+ for (const entry of responses) {
46
+ if (entry.pattern.test(input)) return entry.response;
47
+ }
48
+ return "Please go on.";
49
+ }
50
+ async function handleText(_runtime, params) {
51
+ const reply = generateElizaResponse(extractUserMessage(params.prompt ?? ""));
52
+ return JSON.stringify({
53
+ thought: "Responding with deterministic ELIZA pattern matching.",
54
+ actions: ["REPLY"],
55
+ providers: [],
56
+ text: reply,
57
+ simple: true,
58
+ useKnowledgeProviders: false
59
+ });
60
+ }
61
+ async function handleEmbedding() {
62
+ return Array.from({ length: 1536 }, (_, index) => index === 0 ? 1 : 0);
63
+ }
64
+ var elizaClassicPlugin = {
65
+ name: "eliza-classic",
66
+ description: "Deterministic offline ELIZA-style text responses.",
67
+ priority: 200,
68
+ models: {
69
+ [ModelType.TEXT_NANO]: handleText,
70
+ [ModelType.TEXT_LARGE]: handleText,
71
+ [ModelType.TEXT_MEDIUM]: handleText,
72
+ [ModelType.TEXT_SMALL]: handleText,
73
+ [ModelType.TEXT_MEGA]: handleText,
74
+ [ModelType.RESPONSE_HANDLER]: handleText,
75
+ [ModelType.ACTION_PLANNER]: handleText,
76
+ [ModelType.TEXT_COMPLETION]: handleText,
77
+ [ModelType.TEXT_EMBEDDING]: handleEmbedding
78
+ }
79
+ };
80
+ var plugin = elizaClassicPlugin;
81
+ var index_default = elizaClassicPlugin;
82
+ export {
83
+ index_default as default,
84
+ elizaClassicPlugin,
85
+ generateElizaResponse,
86
+ getElizaGreeting,
87
+ plugin
88
+ };
5
89
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC7E,cAAc,SAAS,CAAC"}
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["import type { GenerateTextParams, IAgentRuntime, Plugin } from \"@elizaos/core\";\nimport { ModelType } from \"@elizaos/core\";\n\nconst responses = [\n { pattern: /\\bmother\\b/i, response: \"Tell me more about your family.\" },\n {\n pattern: /\\bfather\\b/i,\n response: \"How does that make you feel about your father?\",\n },\n { pattern: /\\bfeel\\b/i, response: \"Do you often feel this way?\" },\n { pattern: /\\bthink\\b/i, response: \"Why do you think that?\" },\n { pattern: /\\bwant\\b/i, response: \"What would it mean if you got that?\" },\n {\n pattern: /\\bsad\\b/i,\n response: \"I'm sorry to hear you're feeling sad. Can you tell me more?\",\n },\n {\n pattern: /\\bhappy\\b/i,\n response: \"That's wonderful. What's making you happy?\",\n },\n { pattern: /\\byes\\b/i, response: \"You seem certain. Why is that?\" },\n { pattern: /\\bno\\b/i, response: \"Why not?\" },\n {\n pattern: /\\bwhy\\b/i,\n response: \"That's a good question. What do you think?\",\n },\n { pattern: /\\bhow\\b/i, response: \"What approach would you suggest?\" },\n {\n pattern: /\\bwhat\\b/i,\n response: \"What does that question mean to you?\",\n },\n { pattern: /\\bcan\\b/i, response: \"What makes you ask about that?\" },\n { pattern: /\\byou\\b/i, response: \"We were talking about you, not me.\" },\n { pattern: /\\bI am\\b/i, response: \"How long have you been like that?\" },\n { pattern: /\\bI\\b/i, response: \"Tell me more about yourself.\" },\n { pattern: /.*/, response: \"Please go on.\" },\n] as const;\n\nexport function getElizaGreeting(): string {\n return \"Hello. How are you feeling today?\";\n}\n\nfunction extractUserMessage(prompt: string): string {\n const match = prompt.match(/(?:User|Human|You):\\s*(.+?)(?:\\n|$)/i);\n return match?.[1]?.trim() ?? prompt.trim();\n}\n\nexport function generateElizaResponse(input: string): string {\n for (const entry of responses) {\n if (entry.pattern.test(input)) return entry.response;\n }\n return \"Please go on.\";\n}\n\nasync function handleText(\n _runtime: IAgentRuntime,\n params: GenerateTextParams,\n): Promise<string> {\n const reply = generateElizaResponse(extractUserMessage(params.prompt ?? \"\"));\n return JSON.stringify({\n thought: \"Responding with deterministic ELIZA pattern matching.\",\n actions: [\"REPLY\"],\n providers: [],\n text: reply,\n simple: true,\n useKnowledgeProviders: false,\n });\n}\n\nasync function handleEmbedding(): Promise<number[]> {\n return Array.from({ length: 1536 }, (_, index) => (index === 0 ? 1 : 0));\n}\n\nexport const elizaClassicPlugin: Plugin = {\n name: \"eliza-classic\",\n description: \"Deterministic offline ELIZA-style text responses.\",\n priority: 200,\n models: {\n [ModelType.TEXT_NANO]: handleText,\n [ModelType.TEXT_LARGE]: handleText,\n [ModelType.TEXT_MEDIUM]: handleText,\n [ModelType.TEXT_SMALL]: handleText,\n [ModelType.TEXT_MEGA]: handleText,\n [ModelType.RESPONSE_HANDLER]: handleText,\n [ModelType.ACTION_PLANNER]: handleText,\n [ModelType.TEXT_COMPLETION]: handleText,\n [ModelType.TEXT_EMBEDDING]: handleEmbedding,\n },\n};\n\nexport const plugin = elizaClassicPlugin;\nexport default elizaClassicPlugin;\n"],"mappings":";AACA,SAAS,iBAAiB;AAE1B,IAAM,YAAY;AAAA,EAChB,EAAE,SAAS,eAAe,UAAU,kCAAkC;AAAA,EACtE;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AAAA,EACA,EAAE,SAAS,aAAa,UAAU,8BAA8B;AAAA,EAChE,EAAE,SAAS,cAAc,UAAU,yBAAyB;AAAA,EAC5D,EAAE,SAAS,aAAa,UAAU,sCAAsC;AAAA,EACxE;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AAAA,EACA,EAAE,SAAS,YAAY,UAAU,iCAAiC;AAAA,EAClE,EAAE,SAAS,WAAW,UAAU,WAAW;AAAA,EAC3C;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AAAA,EACA,EAAE,SAAS,YAAY,UAAU,mCAAmC;AAAA,EACpE;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AAAA,EACA,EAAE,SAAS,YAAY,UAAU,iCAAiC;AAAA,EAClE,EAAE,SAAS,YAAY,UAAU,qCAAqC;AAAA,EACtE,EAAE,SAAS,aAAa,UAAU,oCAAoC;AAAA,EACtE,EAAE,SAAS,UAAU,UAAU,+BAA+B;AAAA,EAC9D,E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+1,59 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-eliza-classic",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-beta.1",
4
4
  "type": "module",
5
- "main": "dist/cjs/index.node.cjs",
6
- "module": "dist/node/index.node.js",
7
- "types": "dist/index.d.ts",
8
- "browser": "dist/browser/index.browser.js",
9
- "sideEffects": false,
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/elizaos-plugins/plugin-eliza-classic.git"
13
- },
5
+ "description": "Deterministic ELIZA-style pattern matching (browser + Node); ships compiled ESM in dist/.",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "browser": "./dist/index.browser.js",
14
10
  "exports": {
15
11
  "./package.json": "./package.json",
16
12
  ".": {
17
13
  "types": "./dist/index.d.ts",
18
14
  "browser": {
19
- "types": "./dist/browser/index.d.ts",
20
- "import": "./dist/browser/index.browser.js",
21
- "default": "./dist/browser/index.browser.js"
15
+ "types": "./dist/index.browser.d.ts",
16
+ "import": "./dist/index.browser.js",
17
+ "default": "./dist/index.browser.js"
22
18
  },
23
19
  "node": {
24
- "types": "./dist/node/index.d.ts",
25
- "import": "./dist/node/index.node.js",
26
- "require": "./dist/cjs/index.node.cjs",
27
- "default": "./dist/node/index.node.js"
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js",
22
+ "default": "./dist/index.js"
28
23
  },
29
- "default": "./dist/node/index.node.js"
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
30
26
  }
31
27
  },
28
+ "sideEffects": false,
32
29
  "files": [
33
- "dist",
34
- "rust"
30
+ "dist"
35
31
  ],
32
+ "scripts": {
33
+ "build": "tsup --config tsup.config.ts",
34
+ "dev": "tsup --config tsup.config.ts --watch",
35
+ "clean": "rm -rf dist .turbo",
36
+ "typecheck": "tsc --noEmit -p tsconfig.json",
37
+ "lint": "echo \"Lint skipped\"",
38
+ "lint:check": "bun run lint",
39
+ "test": "echo \"No tests\""
40
+ },
36
41
  "dependencies": {
37
- "@elizaos/core": "2.0.0-alpha.3"
42
+ "@elizaos/core": "2.0.0-beta.1"
38
43
  },
39
44
  "devDependencies": {
40
- "@biomejs/biome": "^2.3.11",
41
- "@types/node": "^25.0.3",
42
- "typescript": "^5.9.3"
45
+ "tsup": "8.5.1",
46
+ "typescript": "^6.0.3"
43
47
  },
44
- "scripts": {
45
- "build:ts": "bun run build.ts",
46
- "dev": "bun --hot build.ts",
47
- "lint": "bunx @biomejs/biome check --write --unsafe .",
48
- "lint:check": "bunx @biomejs/biome check .",
49
- "clean": "rm -rf dist .turbo node_modules",
50
- "format": "bunx @biomejs/biome format --write .",
51
- "format:check": "bunx @biomejs/biome format .",
52
- "typecheck": "tsc --noEmit",
53
- "test": "npx -y vitest@4.0.18 run --passWithNoTests",
54
- "test:ts": "vitest run",
55
- "build": "bun run build.ts"
48
+ "peerDependencies": {
49
+ "@elizaos/core": "2.0.0-beta.1"
56
50
  },
57
51
  "publishConfig": {
58
52
  "access": "public"
59
53
  },
60
- "agentConfig": {
61
- "pluginType": "elizaos:plugin:1.0.0",
62
- "pluginParameters": {}
63
- },
64
- "milady": {
65
- "platforms": [
66
- "browser",
67
- "node"
68
- ],
69
- "runtime": "both",
70
- "platformDetails": {
71
- "browser": "Browser-compatible build available via exports.browser",
72
- "node": "Node.js build available via exports.node"
73
- }
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/elizaos/eliza.git",
57
+ "directory": "plugins/plugin-eliza-classic"
74
58
  }
75
59
  }
@@ -1,4 +0,0 @@
1
- import type { Action } from "@elizaos/core";
2
- export declare const generateResponseAction: Action;
3
- export default generateResponseAction;
4
- //# sourceMappingURL=generateResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateResponse.d.ts","sourceRoot":"","sources":["../../actions/generateResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAMvB,eAAO,MAAM,sBAAsB,EAAE,MAwDpC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,50 +0,0 @@
1
- import { ModelType } from "@elizaos/core";
2
- import { requireActionSpec } from "../generated/specs/spec-helpers";
3
- const spec = requireActionSpec("generate-response");
4
- export const generateResponseAction = {
5
- name: spec.name,
6
- similes: spec.similes ? [...spec.similes] : [],
7
- description: spec.description,
8
- validate: async (_runtime, _message, _state) => {
9
- return true;
10
- },
11
- handler: async (runtime, message, _state, _options, callback) => {
12
- const userInput = typeof message.content === "object" && message.content !== null
13
- ? message.content.text || ""
14
- : String(message.content || "");
15
- if (!userInput.trim()) {
16
- if (callback) {
17
- await callback({
18
- text: "I need something to respond to. What would you like to talk about?",
19
- source: message.content.source,
20
- });
21
- }
22
- return { success: false, error: "No user input provided" };
23
- }
24
- try {
25
- const response = await runtime.useModel(ModelType.TEXT_LARGE, {
26
- prompt: userInput,
27
- });
28
- if (callback) {
29
- await callback({
30
- text: response,
31
- source: message.content.source,
32
- });
33
- }
34
- return { success: true, text: response };
35
- }
36
- catch (error) {
37
- const errorMessage = error instanceof Error ? error.message : String(error);
38
- if (callback) {
39
- await callback({
40
- text: "I encountered an issue. Please try again.",
41
- source: message.content.source,
42
- });
43
- }
44
- return { success: false, error: errorMessage };
45
- }
46
- },
47
- examples: (spec.examples ?? []),
48
- };
49
- export default generateResponseAction;
50
- //# sourceMappingURL=generateResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateResponse.js","sourceRoot":"","sources":["../../actions/generateResponse.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,IAAI,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC5C,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,OAAO,EAAE,IA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,QAAQ,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,QAAQ,CAAC;oBACb,IAAI,EAAE,2CAA2C;oBACjD,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM;iBAC/B,CAAC,CAAC;YACL,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QACjD,CAAC;IACH,CAAC;IAED,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAsB;CACrD,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { generateResponseAction } from "./generateResponse";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { generateResponseAction } from "./generateResponse";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}