@elizaos/plugin-code 2.0.0-alpha.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.
- package/dist/actions/changeDirectory.d.ts +2 -0
- package/dist/actions/editFile.d.ts +2 -0
- package/dist/actions/executeShell.d.ts +2 -0
- package/dist/actions/git.d.ts +2 -0
- package/dist/actions/index.d.ts +8 -0
- package/dist/actions/listFiles.d.ts +2 -0
- package/dist/actions/readFile.d.ts +2 -0
- package/dist/actions/searchFiles.d.ts +2 -0
- package/dist/actions/writeFile.d.ts +2 -0
- package/dist/build.d.ts +1 -0
- package/dist/generated/specs/spec-helpers.d.ts +48 -0
- package/dist/generated/specs/specs.d.ts +142 -0
- package/dist/index.browser.d.ts +9 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1064 -0
- package/dist/index.js.map +24 -0
- package/dist/providers/coderStatusProvider.d.ts +2 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/services/coderService.d.ts +61 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/pathUtils.d.ts +13 -0
- package/package.json +60 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { changeDirectory } from "./changeDirectory";
|
|
2
|
+
export { editFile } from "./editFile";
|
|
3
|
+
export { executeShell } from "./executeShell";
|
|
4
|
+
export { git } from "./git";
|
|
5
|
+
export { listFiles } from "./listFiles";
|
|
6
|
+
export { readFile } from "./readFile";
|
|
7
|
+
export { searchFiles } from "./searchFiles";
|
|
8
|
+
export { writeFile } from "./writeFile";
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper functions to lookup action/provider/evaluator specs by name.
|
|
3
|
+
* These allow language-specific implementations to import their text content
|
|
4
|
+
* (description, similes, examples) from the centralized specs.
|
|
5
|
+
*
|
|
6
|
+
* DO NOT EDIT the spec data - update prompts/actions.json, prompts/providers.json, prompts/evaluators.json and regenerate.
|
|
7
|
+
*/
|
|
8
|
+
import { type ActionDoc, type EvaluatorDoc, type ProviderDoc } from "./specs";
|
|
9
|
+
/**
|
|
10
|
+
* Get an action spec by name from the core specs.
|
|
11
|
+
* @param name - The action name
|
|
12
|
+
* @returns The action spec or undefined if not found
|
|
13
|
+
*/
|
|
14
|
+
export declare function getActionSpec(name: string): ActionDoc | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Get an action spec by name, throwing if not found.
|
|
17
|
+
* @param name - The action name
|
|
18
|
+
* @returns The action spec
|
|
19
|
+
* @throws Error if the action is not found
|
|
20
|
+
*/
|
|
21
|
+
export declare function requireActionSpec(name: string): ActionDoc;
|
|
22
|
+
/**
|
|
23
|
+
* Get a provider spec by name from the core specs.
|
|
24
|
+
* @param name - The provider name
|
|
25
|
+
* @returns The provider spec or undefined if not found
|
|
26
|
+
*/
|
|
27
|
+
export declare function getProviderSpec(name: string): ProviderDoc | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get a provider spec by name, throwing if not found.
|
|
30
|
+
* @param name - The provider name
|
|
31
|
+
* @returns The provider spec
|
|
32
|
+
* @throws Error if the provider is not found
|
|
33
|
+
*/
|
|
34
|
+
export declare function requireProviderSpec(name: string): ProviderDoc;
|
|
35
|
+
/**
|
|
36
|
+
* Get an evaluator spec by name from the core specs.
|
|
37
|
+
* @param name - The evaluator name
|
|
38
|
+
* @returns The evaluator spec or undefined if not found
|
|
39
|
+
*/
|
|
40
|
+
export declare function getEvaluatorSpec(name: string): EvaluatorDoc | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Get an evaluator spec by name, throwing if not found.
|
|
43
|
+
* @param name - The evaluator name
|
|
44
|
+
* @returns The evaluator spec
|
|
45
|
+
* @throws Error if the evaluator is not found
|
|
46
|
+
*/
|
|
47
|
+
export declare function requireEvaluatorSpec(name: string): EvaluatorDoc;
|
|
48
|
+
export type { ActionDoc, ProviderDoc, EvaluatorDoc };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated canonical action/provider/evaluator docs for plugin-code.
|
|
3
|
+
* DO NOT EDIT - Generated from prompts/specs/**.
|
|
4
|
+
*/
|
|
5
|
+
export type ActionDoc = {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
similes?: readonly string[];
|
|
9
|
+
parameters?: readonly unknown[];
|
|
10
|
+
examples?: readonly (readonly unknown[])[];
|
|
11
|
+
};
|
|
12
|
+
export type ProviderDoc = {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
position?: number;
|
|
16
|
+
dynamic?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type EvaluatorDoc = {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
similes?: readonly string[];
|
|
22
|
+
alwaysRun?: boolean;
|
|
23
|
+
examples?: readonly unknown[];
|
|
24
|
+
};
|
|
25
|
+
export declare const coreActionsSpec: {
|
|
26
|
+
readonly version: "1.0.0";
|
|
27
|
+
readonly actions: readonly [{
|
|
28
|
+
readonly name: "CHANGE_DIRECTORY";
|
|
29
|
+
readonly description: "Change the working directory (restricted to allowed directory).";
|
|
30
|
+
readonly similes: readonly ["CD", "CWD"];
|
|
31
|
+
readonly parameters: readonly [];
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "EDIT_FILE";
|
|
34
|
+
readonly description: "Replace a substring in a file (single replacement).";
|
|
35
|
+
readonly similes: readonly ["REPLACE_IN_FILE", "PATCH_FILE", "MODIFY_FILE"];
|
|
36
|
+
readonly parameters: readonly [];
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "EXECUTE_SHELL";
|
|
39
|
+
readonly description: "Execute a shell command in the current working directory (restricted).";
|
|
40
|
+
readonly similes: readonly ["SHELL", "RUN_COMMAND", "EXEC", "TERMINAL"];
|
|
41
|
+
readonly parameters: readonly [];
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "GIT";
|
|
44
|
+
readonly description: "Run a git command (restricted).";
|
|
45
|
+
readonly similes: readonly ["GIT_COMMAND", "GIT_RUN"];
|
|
46
|
+
readonly parameters: readonly [];
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "LIST_FILES";
|
|
49
|
+
readonly description: "List files in a directory.";
|
|
50
|
+
readonly similes: readonly ["LS", "LIST_DIR", "LIST_DIRECTORY", "DIR"];
|
|
51
|
+
readonly parameters: readonly [];
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "READ_FILE";
|
|
54
|
+
readonly description: "Read and return a file";
|
|
55
|
+
readonly similes: readonly ["VIEW_FILE", "OPEN_FILE", "CAT_FILE", "SHOW_FILE", "GET_FILE"];
|
|
56
|
+
readonly parameters: readonly [];
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "SEARCH_FILES";
|
|
59
|
+
readonly description: "Search for text across files under a directory.";
|
|
60
|
+
readonly similes: readonly ["GREP", "RG", "FIND_IN_FILES", "SEARCH"];
|
|
61
|
+
readonly parameters: readonly [];
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "WRITE_FILE";
|
|
64
|
+
readonly description: "Create or overwrite a file with given content.";
|
|
65
|
+
readonly similes: readonly ["CREATE_FILE", "SAVE_FILE", "OUTPUT_FILE"];
|
|
66
|
+
readonly parameters: readonly [];
|
|
67
|
+
}];
|
|
68
|
+
};
|
|
69
|
+
export declare const allActionsSpec: {
|
|
70
|
+
readonly version: "1.0.0";
|
|
71
|
+
readonly actions: readonly [{
|
|
72
|
+
readonly name: "CHANGE_DIRECTORY";
|
|
73
|
+
readonly description: "Change the working directory (restricted to allowed directory).";
|
|
74
|
+
readonly similes: readonly ["CD", "CWD"];
|
|
75
|
+
readonly parameters: readonly [];
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "EDIT_FILE";
|
|
78
|
+
readonly description: "Replace a substring in a file (single replacement).";
|
|
79
|
+
readonly similes: readonly ["REPLACE_IN_FILE", "PATCH_FILE", "MODIFY_FILE"];
|
|
80
|
+
readonly parameters: readonly [];
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "EXECUTE_SHELL";
|
|
83
|
+
readonly description: "Execute a shell command in the current working directory (restricted).";
|
|
84
|
+
readonly similes: readonly ["SHELL", "RUN_COMMAND", "EXEC", "TERMINAL"];
|
|
85
|
+
readonly parameters: readonly [];
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "GIT";
|
|
88
|
+
readonly description: "Run a git command (restricted).";
|
|
89
|
+
readonly similes: readonly ["GIT_COMMAND", "GIT_RUN"];
|
|
90
|
+
readonly parameters: readonly [];
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "LIST_FILES";
|
|
93
|
+
readonly description: "List files in a directory.";
|
|
94
|
+
readonly similes: readonly ["LS", "LIST_DIR", "LIST_DIRECTORY", "DIR"];
|
|
95
|
+
readonly parameters: readonly [];
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "READ_FILE";
|
|
98
|
+
readonly description: "Read and return a file";
|
|
99
|
+
readonly similes: readonly ["VIEW_FILE", "OPEN_FILE", "CAT_FILE", "SHOW_FILE", "GET_FILE"];
|
|
100
|
+
readonly parameters: readonly [];
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "SEARCH_FILES";
|
|
103
|
+
readonly description: "Search for text across files under a directory.";
|
|
104
|
+
readonly similes: readonly ["GREP", "RG", "FIND_IN_FILES", "SEARCH"];
|
|
105
|
+
readonly parameters: readonly [];
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "WRITE_FILE";
|
|
108
|
+
readonly description: "Create or overwrite a file with given content.";
|
|
109
|
+
readonly similes: readonly ["CREATE_FILE", "SAVE_FILE", "OUTPUT_FILE"];
|
|
110
|
+
readonly parameters: readonly [];
|
|
111
|
+
}];
|
|
112
|
+
};
|
|
113
|
+
export declare const coreProvidersSpec: {
|
|
114
|
+
readonly version: "1.0.0";
|
|
115
|
+
readonly providers: readonly [{
|
|
116
|
+
readonly name: "CODER_STATUS";
|
|
117
|
+
readonly description: "Provides current working directory, allowed directory, and recent shell/file operations";
|
|
118
|
+
readonly dynamic: true;
|
|
119
|
+
}];
|
|
120
|
+
};
|
|
121
|
+
export declare const allProvidersSpec: {
|
|
122
|
+
readonly version: "1.0.0";
|
|
123
|
+
readonly providers: readonly [{
|
|
124
|
+
readonly name: "CODER_STATUS";
|
|
125
|
+
readonly description: "Provides current working directory, allowed directory, and recent shell/file operations";
|
|
126
|
+
readonly dynamic: true;
|
|
127
|
+
}];
|
|
128
|
+
};
|
|
129
|
+
export declare const coreEvaluatorsSpec: {
|
|
130
|
+
readonly version: "1.0.0";
|
|
131
|
+
readonly evaluators: readonly [];
|
|
132
|
+
};
|
|
133
|
+
export declare const allEvaluatorsSpec: {
|
|
134
|
+
readonly version: "1.0.0";
|
|
135
|
+
readonly evaluators: readonly [];
|
|
136
|
+
};
|
|
137
|
+
export declare const coreActionDocs: readonly ActionDoc[];
|
|
138
|
+
export declare const allActionDocs: readonly ActionDoc[];
|
|
139
|
+
export declare const coreProviderDocs: readonly ProviderDoc[];
|
|
140
|
+
export declare const allProviderDocs: readonly ProviderDoc[];
|
|
141
|
+
export declare const coreEvaluatorDocs: readonly EvaluatorDoc[];
|
|
142
|
+
export declare const allEvaluatorDocs: readonly EvaluatorDoc[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Plugin } from "@elizaos/core";
|
|
2
|
+
/**
|
|
3
|
+
* Browser entrypoint.
|
|
4
|
+
*
|
|
5
|
+
* The eliza-coder plugin requires filesystem/shell/git access and is therefore
|
|
6
|
+
* Node-only. This stub avoids importing Node-only code in browser bundles.
|
|
7
|
+
*/
|
|
8
|
+
export declare const elizaCoderPlugin: Plugin;
|
|
9
|
+
export default elizaCoderPlugin;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Plugin } from "@elizaos/core";
|
|
2
|
+
export declare const coderPlugin: Plugin;
|
|
3
|
+
export default coderPlugin;
|
|
4
|
+
export * from "./actions";
|
|
5
|
+
export { coderStatusProvider } from "./providers/coderStatusProvider";
|
|
6
|
+
export { CoderService } from "./services/coderService";
|
|
7
|
+
export * from "./types";
|
|
8
|
+
export * from "./utils";
|