@elizaos/plugin-eliza-classic 2.0.0-beta.1 → 2.0.3-beta.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/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,57 @@
1
+ # @elizaos/plugin-eliza-classic
2
+
3
+ Deterministic ELIZA-style pattern-matching model handlers for [elizaOS](https://github.com/elizaos/eliza) agents. No LLM API key or network access required.
4
+
5
+ ## What it does
6
+
7
+ This plugin registers model handlers that intercept every text-inference call an Eliza agent makes and replies with keyword-pattern responses modelled after the 1966 ELIZA chatbot. It also provides a deterministic lexical embedding handler that returns a normalized 1536-dimensional hashing vector.
8
+
9
+ Use cases:
10
+
11
+ - Offline / zero-cost agent testing without a real LLM.
12
+ - CI pipelines that need an agent to produce responses without network calls.
13
+ - Demonstrating the elizaOS plugin model with a minimal, dependency-free example.
14
+
15
+ ## Capabilities
16
+
17
+ | Capability | Detail |
18
+ |---|---|
19
+ | Text generation | Pattern-matches the user turn using ~16 keyword regexes (mother, feel, think, want, I am, …) and returns a reflective question. Falls back to "Please go on." |
20
+ | Embeddings | Returns a deterministic normalized 1536-dim lexical hashing vector. Useful for offline smoke tests and rough lexical similarity; not a neural semantic embedding. |
21
+
22
+ Exported helpers:
23
+ - `generateElizaResponse(input: string): string` — run the pattern matcher directly.
24
+ - `getElizaGreeting(): string` — returns `"Hello. How are you feeling today?"`.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ bun add @elizaos/plugin-eliza-classic
30
+ ```
31
+
32
+ ## Enabling the plugin
33
+
34
+ Add it to your agent's plugin list:
35
+
36
+ ```ts
37
+ import elizaClassicPlugin from "@elizaos/plugin-eliza-classic";
38
+
39
+ const agent = new AgentRuntime({
40
+ plugins: [elizaClassicPlugin],
41
+ // ...
42
+ });
43
+ ```
44
+
45
+ The plugin declares `priority: 200`. If loaded alongside a real LLM plugin, it will win the model-handler election for all `ModelType` variants unless the other plugin declares a higher priority. To use it only as a fallback, load it before (lower index than) any real LLM plugin and ensure that plugin declares `priority > 200`.
46
+
47
+ ## Required configuration
48
+
49
+ None. No environment variables or API keys needed.
50
+
51
+ ## Building from source
52
+
53
+ ```bash
54
+ bun run --cwd plugins/plugin-eliza-classic build
55
+ ```
56
+
57
+ Output goes to `dist/`. Browser and Node ESM bundles are produced separately (`index.js` / `index.browser.js`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-eliza-classic",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.3-beta.3",
4
4
  "type": "module",
5
5
  "description": "Deterministic ELIZA-style pattern matching (browser + Node); ships compiled ESM in dist/.",
6
6
  "main": "./dist/index.js",
@@ -23,6 +23,12 @@
23
23
  },
24
24
  "import": "./dist/index.js",
25
25
  "default": "./dist/index.js"
26
+ },
27
+ "./*.css": "./dist/*.css",
28
+ "./*": {
29
+ "types": "./dist/*.d.ts",
30
+ "import": "./dist/*.js",
31
+ "default": "./dist/*.js"
26
32
  }
27
33
  },
28
34
  "sideEffects": false,
@@ -30,23 +36,24 @@
30
36
  "dist"
31
37
  ],
32
38
  "scripts": {
33
- "build": "tsup --config tsup.config.ts",
39
+ "build": "bun run scripts/build.mjs",
34
40
  "dev": "tsup --config tsup.config.ts --watch",
35
41
  "clean": "rm -rf dist .turbo",
36
- "typecheck": "tsc --noEmit -p tsconfig.json",
42
+ "typecheck": "tsgo --noEmit -p tsconfig.json",
37
43
  "lint": "echo \"Lint skipped\"",
38
44
  "lint:check": "bun run lint",
39
- "test": "echo \"No tests\""
45
+ "test": "vitest run --config vitest.config.ts"
40
46
  },
41
47
  "dependencies": {
42
- "@elizaos/core": "2.0.0-beta.1"
48
+ "@elizaos/core": "2.0.3-beta.3"
43
49
  },
44
50
  "devDependencies": {
45
51
  "tsup": "8.5.1",
46
- "typescript": "^6.0.3"
52
+ "typescript": "^6.0.3",
53
+ "vitest": "^4.0.18"
47
54
  },
48
55
  "peerDependencies": {
49
- "@elizaos/core": "2.0.0-beta.1"
56
+ "@elizaos/core": "2.0.3-beta.3"
50
57
  },
51
58
  "publishConfig": {
52
59
  "access": "public"
@@ -55,5 +62,6 @@
55
62
  "type": "git",
56
63
  "url": "git+https://github.com/elizaos/eliza.git",
57
64
  "directory": "plugins/plugin-eliza-classic"
58
- }
65
+ },
66
+ "gitHead": "f54b0f4eaed317d59fa7dbcdce20f4cdb0734420"
59
67
  }
@@ -1,2 +0,0 @@
1
- export { default, default as elizaClassicPlugin, generateElizaResponse, getElizaGreeting, plugin } from './index.js';
2
- import '@elizaos/core';
@@ -1,89 +0,0 @@
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
- };
89
- //# sourceMappingURL=index.browser.js.map
@@ -1 +0,0 @@
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;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KAAK,UAAU;AAAA,IACpB,SAAS;AAAA,IACT,SAAS,CAAC,OAAO;AAAA,IACjB,WAAW,CAAC;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 DELETED
@@ -1,8 +0,0 @@
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 DELETED
@@ -1,89 +0,0 @@
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
- };
89
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
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,UA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