@elizaos/plugin-action-bench 1.4.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/README.md +2 -0
- package/dist/index.cjs +66 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/README.md
ADDED
package/dist/index.cjs
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
// src/actions/typewriter.ts
|
6
|
+
function createLetterAction(letter) {
|
7
|
+
const upper = letter.toUpperCase();
|
8
|
+
return {
|
9
|
+
name: `TYPE_${upper}`,
|
10
|
+
similes: [`TYPE_${upper}`, `TYPE_${letter}`],
|
11
|
+
description: `Type the letter '${letter}' and append it to the accumulating typed text for benchmarking action chaining.`,
|
12
|
+
validate: async (_runtime, _message, _state) => {
|
13
|
+
return true;
|
14
|
+
},
|
15
|
+
handler: async (_runtime, message, state, _options, callback) => {
|
16
|
+
const current = state?.values?.typedText ?? "";
|
17
|
+
const next = `${current}${letter}`;
|
18
|
+
if (callback) {
|
19
|
+
await callback({
|
20
|
+
text: next,
|
21
|
+
source: message.content.source
|
22
|
+
});
|
23
|
+
}
|
24
|
+
return {
|
25
|
+
success: true,
|
26
|
+
text: next,
|
27
|
+
values: {
|
28
|
+
typedText: next
|
29
|
+
},
|
30
|
+
data: {
|
31
|
+
letter,
|
32
|
+
length: next.length
|
33
|
+
}
|
34
|
+
};
|
35
|
+
},
|
36
|
+
examples: [
|
37
|
+
[
|
38
|
+
{
|
39
|
+
name: "{{user}}",
|
40
|
+
content: { text: `type '${letter}'` }
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: "{{agent}}",
|
44
|
+
content: {
|
45
|
+
text: letter,
|
46
|
+
actions: [`TYPE_${upper}`]
|
47
|
+
}
|
48
|
+
}
|
49
|
+
]
|
50
|
+
]
|
51
|
+
};
|
52
|
+
}
|
53
|
+
var typewriterActions = "abcdefghijklmnopqrstuvwxyz".split("").map(createLetterAction);
|
54
|
+
|
55
|
+
// src/index.ts
|
56
|
+
var typewriterPlugin = {
|
57
|
+
name: "action-bench-typewriter",
|
58
|
+
description: "Typewriter benchmark plugin providing 26 single-letter actions (A\u2013Z) to test action selection and chaining.",
|
59
|
+
actions: [...typewriterActions]
|
60
|
+
};
|
61
|
+
var index_default = typewriterPlugin;
|
62
|
+
|
63
|
+
exports.default = index_default;
|
64
|
+
exports.typewriterPlugin = typewriterPlugin;
|
65
|
+
//# sourceMappingURL=index.cjs.map
|
66
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/actions/typewriter.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAcA,SAAS,mBAAmB,MAAA,EAAkC;AAC5D,EAAA,MAAM,KAAA,GAAQ,OAAO,WAAA,EAAY;AAEjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAQ,KAAK,CAAA,CAAA;AAAA,IACnB,SAAS,CAAC,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAA,EAAI,CAAA,KAAA,EAAQ,MAAM,CAAA,CAAE,CAAA;AAAA,IAC3C,WAAA,EAAa,oBAAoB,MAAM,CAAA,gFAAA,CAAA;AAAA,IACvC,QAAA,EAAU,OAAO,QAAA,EAAyB,QAAA,EAAkB,MAAA,KAAmB;AAC7E,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,SAAS,OACP,QAAA,EACA,OAAA,EACA,KAAA,EACA,UACA,QAAA,KAC0B;AAC1B,MAAA,MAAM,OAAA,GAAU,KAAA,EAAO,MAAA,EAAQ,SAAA,IAAa,EAAA;AAC5C,MAAA,MAAM,IAAA,GAAO,CAAA,EAAG,OAAO,CAAA,EAAG,MAAM,CAAA,CAAA;AAGhC,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,MAAM,QAAA,CAAS;AAAA,UACb,IAAA,EAAM,IAAA;AAAA,UACN,MAAA,EAAQ,QAAQ,OAAA,CAAQ;AAAA,SACzB,CAAA;AAAA,MACH;AAEA,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,IAAA;AAAA,QACT,IAAA,EAAM,IAAA;AAAA,QACN,MAAA,EAAQ;AAAA,UACN,SAAA,EAAW;AAAA,SACb;AAAA,QACA,IAAA,EAAM;AAAA,UACJ,MAAA;AAAA,UACA,QAAQ,IAAA,CAAK;AAAA;AACf,OACF;AAAA,IACF,CAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACR;AAAA,QACE;AAAA,UACE,IAAA,EAAM,UAAA;AAAA,UACN,OAAA,EAAS,EAAE,IAAA,EAAM,CAAA,MAAA,EAAS,MAAM,CAAA,CAAA,CAAA;AAAI,SACtC;AAAA,QACA;AAAA,UACE,IAAA,EAAM,WAAA;AAAA,UACN,OAAA,EAAS;AAAA,YACP,IAAA,EAAM,MAAA;AAAA,YACN,OAAA,EAAS,CAAC,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAE;AAAA;AAC3B;AACF;AACF;AACF,GACF;AACF;AAEO,IAAM,oBACX,4BAAA,CAA6B,KAAA,CAAM,EAAE,CAAA,CACrC,IAAI,kBAAkB,CAAA;;;ACvEjB,IAAM,gBAAA,GAA2B;AAAA,EACtC,IAAA,EAAM,yBAAA;AAAA,EACN,WAAA,EACE,kHAAA;AAAA,EACF,OAAA,EAAS,CAAC,GAAG,iBAAiB;AAChC;AAEA,IAAO,aAAA,GAAQ","file":"index.cjs","sourcesContent":["import type {\n Action,\n ActionExample,\n ActionResult,\n HandlerCallback,\n IAgentRuntime,\n Memory,\n State,\n} from \"@elizaos/core\";\n\ntype TypewriterLetter =\n | \"a\" | \"b\" | \"c\" | \"d\" | \"e\" | \"f\" | \"g\" | \"h\" | \"i\" | \"j\" | \"k\" | \"l\" | \"m\"\n | \"n\" | \"o\" | \"p\" | \"q\" | \"r\" | \"s\" | \"t\" | \"u\" | \"v\" | \"w\" | \"x\" | \"y\" | \"z\";\n\nfunction createLetterAction(letter: TypewriterLetter): Action {\n const upper = letter.toUpperCase();\n\n return {\n name: `TYPE_${upper}`,\n similes: [`TYPE_${upper}`, `TYPE_${letter}`],\n description: `Type the letter '${letter}' and append it to the accumulating typed text for benchmarking action chaining.`,\n validate: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => {\n return true;\n },\n handler: async (\n _runtime: IAgentRuntime,\n message: Memory,\n state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> => {\n const current = state?.values?.typedText ?? \"\";\n const next = `${current}${letter}`;\n\n // Optional immediate feedback for visibility during bench runs\n if (callback) {\n await callback({\n text: next,\n source: message.content.source,\n });\n }\n\n return {\n success: true,\n text: next,\n values: {\n typedText: next,\n },\n data: {\n letter,\n length: next.length,\n },\n } satisfies ActionResult;\n },\n examples: [\n [\n {\n name: \"{{user}}\",\n content: { text: `type '${letter}'` },\n },\n {\n name: \"{{agent}}\",\n content: {\n text: letter,\n actions: [`TYPE_${upper}`],\n },\n },\n ],\n ] as ActionExample[][],\n } as Action;\n}\n\nexport const typewriterActions: Action[] = (\n \"abcdefghijklmnopqrstuvwxyz\".split(\"\") as TypewriterLetter[]\n).map(createLetterAction);\n\n\n","import type { Plugin } from \"@elizaos/core\";\nimport { typewriterActions } from \"./actions/typewriter\";\n\nexport const typewriterPlugin: Plugin = {\n name: \"action-bench-typewriter\",\n description:\n \"Typewriter benchmark plugin providing 26 single-letter actions (A–Z) to test action selection and chaining.\",\n actions: [...typewriterActions],\n};\n\nexport default typewriterPlugin;\n\n\n"]}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
// src/actions/typewriter.ts
|
2
|
+
function createLetterAction(letter) {
|
3
|
+
const upper = letter.toUpperCase();
|
4
|
+
return {
|
5
|
+
name: `TYPE_${upper}`,
|
6
|
+
similes: [`TYPE_${upper}`, `TYPE_${letter}`],
|
7
|
+
description: `Type the letter '${letter}' and append it to the accumulating typed text for benchmarking action chaining.`,
|
8
|
+
validate: async (_runtime, _message, _state) => {
|
9
|
+
return true;
|
10
|
+
},
|
11
|
+
handler: async (_runtime, message, state, _options, callback) => {
|
12
|
+
const current = state?.values?.typedText ?? "";
|
13
|
+
const next = `${current}${letter}`;
|
14
|
+
if (callback) {
|
15
|
+
await callback({
|
16
|
+
text: next,
|
17
|
+
source: message.content.source
|
18
|
+
});
|
19
|
+
}
|
20
|
+
return {
|
21
|
+
success: true,
|
22
|
+
text: next,
|
23
|
+
values: {
|
24
|
+
typedText: next
|
25
|
+
},
|
26
|
+
data: {
|
27
|
+
letter,
|
28
|
+
length: next.length
|
29
|
+
}
|
30
|
+
};
|
31
|
+
},
|
32
|
+
examples: [
|
33
|
+
[
|
34
|
+
{
|
35
|
+
name: "{{user}}",
|
36
|
+
content: { text: `type '${letter}'` }
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: "{{agent}}",
|
40
|
+
content: {
|
41
|
+
text: letter,
|
42
|
+
actions: [`TYPE_${upper}`]
|
43
|
+
}
|
44
|
+
}
|
45
|
+
]
|
46
|
+
]
|
47
|
+
};
|
48
|
+
}
|
49
|
+
var typewriterActions = "abcdefghijklmnopqrstuvwxyz".split("").map(createLetterAction);
|
50
|
+
|
51
|
+
// src/index.ts
|
52
|
+
var typewriterPlugin = {
|
53
|
+
name: "action-bench-typewriter",
|
54
|
+
description: "Typewriter benchmark plugin providing 26 single-letter actions (A\u2013Z) to test action selection and chaining.",
|
55
|
+
actions: [...typewriterActions]
|
56
|
+
};
|
57
|
+
var index_default = typewriterPlugin;
|
58
|
+
|
59
|
+
export { index_default as default, typewriterPlugin };
|
60
|
+
//# sourceMappingURL=index.js.map
|
61
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3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A,EAAS,MAAM,CAAA,CAAA,CAAA;AAAI,SACtC;AAAA,QACA;AAAA,UACE,IAAA,EAAM,WAAA;AAAA,UACN,OAAA,EAAS;AAAA,YACP,IAAA,EAAM,MAAA;AAAA,YACN,OAAA,EAAS,CAAC,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAE;AAAA;AAC3B;AACF;AACF;AACF,GACF;AACF;AAEO,IAAM,oBACX,4BAAA,CAA6B,KAAA,CAAM,EAAE,CAAA,CACrC,IAAI,kBAAkB,CAAA;;;ACvEjB,IAAM,gBAAA,GAA2B;AAAA,EACtC,IAAA,EAAM,yBAAA;AAAA,EACN,WAAA,EACE,kHAAA;AAAA,EACF,OAAA,EAAS,CAAC,GAAG,iBAAiB;AAChC;AAEA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["import type {\n Action,\n ActionExample,\n ActionResult,\n HandlerCallback,\n IAgentRuntime,\n Memory,\n State,\n} from \"@elizaos/core\";\n\ntype TypewriterLetter =\n | \"a\" | \"b\" | \"c\" | \"d\" | \"e\" | \"f\" | \"g\" | \"h\" | \"i\" | \"j\" | \"k\" | \"l\" | \"m\"\n | \"n\" | \"o\" | \"p\" | \"q\" | \"r\" | \"s\" | \"t\" | \"u\" | \"v\" | \"w\" | \"x\" | \"y\" | \"z\";\n\nfunction createLetterAction(letter: TypewriterLetter): Action {\n const upper = letter.toUpperCase();\n\n return {\n name: `TYPE_${upper}`,\n similes: [`TYPE_${upper}`, `TYPE_${letter}`],\n description: `Type the letter '${letter}' and append it to the accumulating typed text for benchmarking action chaining.`,\n validate: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => {\n return true;\n },\n handler: async (\n _runtime: IAgentRuntime,\n message: Memory,\n state?: State,\n _options?: Record<string, unknown>,\n callback?: HandlerCallback\n ): Promise<ActionResult> => {\n const current = state?.values?.typedText ?? \"\";\n const next = `${current}${letter}`;\n\n // Optional immediate feedback for visibility during bench runs\n if (callback) {\n await callback({\n text: next,\n source: message.content.source,\n });\n }\n\n return {\n success: true,\n text: next,\n values: {\n typedText: next,\n },\n data: {\n letter,\n length: next.length,\n },\n } satisfies ActionResult;\n },\n examples: [\n [\n {\n name: \"{{user}}\",\n content: { text: `type '${letter}'` },\n },\n {\n name: \"{{agent}}\",\n content: {\n text: letter,\n actions: [`TYPE_${upper}`],\n },\n },\n ],\n ] as ActionExample[][],\n } as Action;\n}\n\nexport const typewriterActions: Action[] = (\n \"abcdefghijklmnopqrstuvwxyz\".split(\"\") as TypewriterLetter[]\n).map(createLetterAction);\n\n\n","import type { Plugin } from \"@elizaos/core\";\nimport { typewriterActions } from \"./actions/typewriter\";\n\nexport const typewriterPlugin: Plugin = {\n name: \"action-bench-typewriter\",\n description:\n \"Typewriter benchmark plugin providing 26 single-letter actions (A–Z) to test action selection and chaining.\",\n actions: [...typewriterActions],\n};\n\nexport default typewriterPlugin;\n\n\n"]}
|
package/package.json
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
{
|
2
|
+
"name": "@elizaos/plugin-action-bench",
|
3
|
+
"version": "1.4.0",
|
4
|
+
"description": "Action calling benchmark plugins for ElizaOS (Typewriter A–Z actions)",
|
5
|
+
"type": "module",
|
6
|
+
"main": "dist/index.js",
|
7
|
+
"module": "dist/index.mjs",
|
8
|
+
"types": "dist/index.d.ts",
|
9
|
+
"exports": {
|
10
|
+
".": {
|
11
|
+
"types": "./dist/index.d.ts",
|
12
|
+
"import": "./dist/index.mjs",
|
13
|
+
"require": "./dist/index.js"
|
14
|
+
},
|
15
|
+
"./package.json": "./package.json"
|
16
|
+
},
|
17
|
+
"files": [
|
18
|
+
"dist",
|
19
|
+
"README.md"
|
20
|
+
],
|
21
|
+
"scripts": {
|
22
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
23
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
24
|
+
"clean": "rm -rf dist",
|
25
|
+
"format": "prettier --write \"src/**/*.ts\""
|
26
|
+
},
|
27
|
+
"keywords": [
|
28
|
+
"elizaos",
|
29
|
+
"plugin",
|
30
|
+
"benchmark",
|
31
|
+
"typewriter",
|
32
|
+
"actions"
|
33
|
+
],
|
34
|
+
"publishConfig": {
|
35
|
+
"access": "public"
|
36
|
+
},
|
37
|
+
"author": "elizaOS Contributors",
|
38
|
+
"license": "MIT",
|
39
|
+
"repository": {
|
40
|
+
"type": "git",
|
41
|
+
"url": "https://github.com/elizaos/eliza.git",
|
42
|
+
"directory": "plugin-action-bench"
|
43
|
+
},
|
44
|
+
"bugs": {
|
45
|
+
"url": "https://github.com/elizaos/eliza/issues"
|
46
|
+
},
|
47
|
+
"homepage": "https://github.com/elizaos/eliza#readme",
|
48
|
+
"dependencies": {
|
49
|
+
"@elizaos/core": "^1.4.2"
|
50
|
+
},
|
51
|
+
"devDependencies": {
|
52
|
+
"@types/node": "^24.2.0",
|
53
|
+
"prettier": "^3.4.2",
|
54
|
+
"tsup": "^8.3.5",
|
55
|
+
"typescript": "^5.7.2"
|
56
|
+
}
|
57
|
+
}
|