@elizaos/core 1.0.0-alpha.48 → 1.0.0-alpha.49
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/package.json +2 -2
- package/dist/actions/choice.d.ts +0 -13
- package/dist/actions/followRoom.d.ts +0 -20
- package/dist/actions/ignore.d.ts +0 -13
- package/dist/actions/muteRoom.d.ts +0 -22
- package/dist/actions/none.d.ts +0 -9
- package/dist/actions/reply.d.ts +0 -15
- package/dist/actions/roles.d.ts +0 -13
- package/dist/actions/sendMessage.d.ts +0 -14
- package/dist/actions/settings.d.ts +0 -21
- package/dist/actions/unfollowRoom.d.ts +0 -12
- package/dist/actions/unmuteRoom.d.ts +0 -18
- package/dist/actions/updateEntity.d.ts +0 -42
- package/dist/actions.d.ts +0 -28
- package/dist/bootstrap.d.ts +0 -3
- package/dist/database.d.ts +0 -419
- package/dist/entities.d.ts +0 -48
- package/dist/environment.d.ts +0 -403
- package/dist/evaluators/reflection.d.ts +0 -2
- package/dist/import.d.ts +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/logger.d.ts +0 -3
- package/dist/memory.d.ts +0 -114
- package/dist/prompts.d.ts +0 -200
- package/dist/providers/actions.d.ts +0 -14
- package/dist/providers/anxiety.d.ts +0 -9
- package/dist/providers/attachments.d.ts +0 -8
- package/dist/providers/capabilities.d.ts +0 -13
- package/dist/providers/character.d.ts +0 -9
- package/dist/providers/choice.d.ts +0 -10
- package/dist/providers/entities.d.ts +0 -2
- package/dist/providers/evaluators.d.ts +0 -26
- package/dist/providers/facts.d.ts +0 -10
- package/dist/providers/knowledge.d.ts +0 -13
- package/dist/providers/providers.d.ts +0 -6
- package/dist/providers/recentMessages.d.ts +0 -13
- package/dist/providers/relationships.d.ts +0 -14
- package/dist/providers/roles.d.ts +0 -14
- package/dist/providers/settings.d.ts +0 -6
- package/dist/providers/shouldRespond.d.ts +0 -6
- package/dist/providers/time.d.ts +0 -11
- package/dist/roles.d.ts +0 -25
- package/dist/runtime.d.ts +0 -290
- package/dist/services/scenario.d.ts +0 -106
- package/dist/services/task.d.ts +0 -72
- package/dist/settings.d.ts +0 -13
- package/dist/test_resources/constants.d.ts +0 -9
- package/dist/test_resources/testSetup.d.ts +0 -1
- package/dist/test_resources/types.d.ts +0 -22
- package/dist/types.d.ts +0 -1294
- package/dist/uuid.d.ts +0 -18
package/dist/prompts.d.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import type { Entity, IAgentRuntime, Memory, State, TemplateType } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Composes a context string by replacing placeholders in a template with corresponding values from the state.
|
|
4
|
-
*
|
|
5
|
-
* This function takes a template string with placeholders in the format `{{placeholder}}` and a state object.
|
|
6
|
-
* It replaces each placeholder with the value from the state object that matches the placeholder's name.
|
|
7
|
-
* If a matching key is not found in the state object for a given placeholder, the placeholder is replaced with an empty string.
|
|
8
|
-
*
|
|
9
|
-
* @param {Object} params - The parameters for composing the context.
|
|
10
|
-
* @param {State} params.state - The state object containing values to replace the placeholders in the template.
|
|
11
|
-
* @param {TemplateType} params.template - The template string or function containing placeholders to be replaced with state values.
|
|
12
|
-
* @returns {string} The composed context string with placeholders replaced by corresponding state values.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // Given a state object and a template
|
|
16
|
-
* const state = { userName: "Alice", userAge: 30 };
|
|
17
|
-
* const template = "Hello, {{userName}}! You are {{userAge}} years old";
|
|
18
|
-
*
|
|
19
|
-
* // Composing the context with simple string replacement will result in:
|
|
20
|
-
* // "Hello, Alice! You are 30 years old."
|
|
21
|
-
* const contextSimple = composePromptFromState({ state, template });
|
|
22
|
-
*
|
|
23
|
-
* // Using composePromptFromState with a template function for dynamic template
|
|
24
|
-
* const template = ({ state }) => {
|
|
25
|
-
* const tone = Math.random() > 0.5 ? "kind" : "rude";
|
|
26
|
-
* return `Hello, {{userName}}! You are {{userAge}} years old. Be ${tone}`;
|
|
27
|
-
* };
|
|
28
|
-
* const contextSimple = composePromptFromState({ state, template });
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Function to compose a prompt using a provided template and state.
|
|
32
|
-
*
|
|
33
|
-
* @param {Object} options - Object containing state and template information.
|
|
34
|
-
* @param {State} options.state - The state object containing values to fill the template.
|
|
35
|
-
* @param {TemplateType} options.template - The template to be used for composing the prompt.
|
|
36
|
-
* @returns {string} The composed prompt output.
|
|
37
|
-
*/
|
|
38
|
-
export declare const composePrompt: ({ state, template, }: {
|
|
39
|
-
state: {
|
|
40
|
-
[key: string]: string;
|
|
41
|
-
};
|
|
42
|
-
template: TemplateType;
|
|
43
|
-
}) => string;
|
|
44
|
-
/**
|
|
45
|
-
* Function to compose a prompt using a provided template and state.
|
|
46
|
-
*
|
|
47
|
-
* @param {Object} options - Object containing state and template information.
|
|
48
|
-
* @param {State} options.state - The state object containing values to fill the template.
|
|
49
|
-
* @param {TemplateType} options.template - The template to be used for composing the prompt.
|
|
50
|
-
* @returns {string} The composed prompt output.
|
|
51
|
-
*/
|
|
52
|
-
export declare const composePromptFromState: ({ state, template, }: {
|
|
53
|
-
state: State;
|
|
54
|
-
template: TemplateType;
|
|
55
|
-
}) => string;
|
|
56
|
-
/**
|
|
57
|
-
* Adds a header to a body of text.
|
|
58
|
-
*
|
|
59
|
-
* This function takes a header string and a body string and returns a new string with the header prepended to the body.
|
|
60
|
-
* If the body string is empty, the header is returned as is.
|
|
61
|
-
*
|
|
62
|
-
* @param {string} header - The header to add to the body.
|
|
63
|
-
* @param {string} body - The body to which to add the header.
|
|
64
|
-
* @returns {string} The body with the header prepended.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* // Given a header and a body
|
|
68
|
-
* const header = "Header";
|
|
69
|
-
* const body = "Body";
|
|
70
|
-
*
|
|
71
|
-
* // Adding the header to the body will result in:
|
|
72
|
-
* // "Header\nBody"
|
|
73
|
-
* const text = addHeader(header, body);
|
|
74
|
-
*/
|
|
75
|
-
export declare const addHeader: (header: string, body: string) => string;
|
|
76
|
-
/**
|
|
77
|
-
* Generates a string with random user names populated in a template.
|
|
78
|
-
*
|
|
79
|
-
* This function generates random user names and populates placeholders
|
|
80
|
-
* in the provided template with these names. Placeholders in the template should follow the format `{{userX}}`
|
|
81
|
-
* where `X` is the position of the user (e.g., `{{name1}}`, `{{name2}}`).
|
|
82
|
-
*
|
|
83
|
-
* @param {string} template - The template string containing placeholders for random user names.
|
|
84
|
-
* @param {number} length - The number of random user names to generate.
|
|
85
|
-
* @returns {string} The template string with placeholders replaced by random user names.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* // Given a template and a length
|
|
89
|
-
* const template = "Hello, {{name1}}! Meet {{name2}} and {{name3}}.";
|
|
90
|
-
* const length = 3;
|
|
91
|
-
*
|
|
92
|
-
* // Composing the random user string will result in:
|
|
93
|
-
* // "Hello, John! Meet Alice and Bob."
|
|
94
|
-
* const result = composeRandomUser(template, length);
|
|
95
|
-
*/
|
|
96
|
-
export declare const composeRandomUser: (template: string, length: number) => string;
|
|
97
|
-
export declare const formatPosts: ({ messages, entities, conversationHeader, }: {
|
|
98
|
-
messages: Memory[];
|
|
99
|
-
entities: Entity[];
|
|
100
|
-
conversationHeader?: boolean;
|
|
101
|
-
}) => string;
|
|
102
|
-
/**
|
|
103
|
-
* Format messages into a string
|
|
104
|
-
* @param {Object} params - The formatting parameters
|
|
105
|
-
* @param {Memory[]} params.messages - List of messages to format
|
|
106
|
-
* @param {Entity[]} params.entities - List of entities for name resolution
|
|
107
|
-
* @returns {string} Formatted message string with timestamps and user information
|
|
108
|
-
*/
|
|
109
|
-
export declare const formatMessages: ({ messages, entities, }: {
|
|
110
|
-
messages: Memory[];
|
|
111
|
-
entities: Entity[];
|
|
112
|
-
}) => string;
|
|
113
|
-
export declare const formatTimestamp: (messageDate: number) => string;
|
|
114
|
-
export declare const shouldRespondTemplate = "# Task: Decide on behalf of {{agentName}} whether they should respond to the message, ignore it or stop the conversation.\n{{providers}}\n# Instructions: Decide if {{agentName}} should respond to or interact with the conversation.\nIf the message is directed at or relevant to {{agentName}}, respond with RESPOND action.\nIf a user asks {{agentName}} to be quiet, respond with STOP action.\nIf {{agentName}} should ignore the message, respond with IGNORE action.\nIf responding with the RESPOND action, include a list of optional providers that could be relevant to the response.\nResponse format should be formatted in a valid JSON block like this:\n```json\n{\n \"name\": \"{{agentName}}\",\n\t\"reasoning\": \"<string>\",\n \"action\": \"RESPOND\" | \"IGNORE\" | \"STOP\",\n \"providers\": [\"<string>\", \"<string>\", ...]\n}\n```\nYour response should include the valid JSON block and nothing else.";
|
|
115
|
-
export declare const messageHandlerTemplate = "# Task: Generate dialog and actions for the character {{agentName}}.\n{{providers}}\n# Instructions: Write a thought and plan for {{agentName}} and decide what actions to take. Also include the providers that {{agentName}} will use to have the right context for responding and acting, if any.\nFirst, think about what you want to do next and plan your actions. Then, write the next message and include the actions you plan to take.\n\"thought\" should be a short description of what the agent is thinking about and planning.\n\"actions\" should be an array of the actions {{agentName}} plans to take based on the thought (if none, use IGNORE, if simply responding with text, use REPLY)\n\"providers\" should be an optional array of the providers that {{agentName}} will use to have the right context for responding and acting\n\"evaluators\" should be an optional array of the evaluators that {{agentName}} will use to evaluate the conversation after responding\n\"plan\" should be explanation of the message you plan to send, the actions you plan to take, and the data providers you plan to use.\nThese are the available valid actions: {{actionNames}}\n\nResponse format should be formatted in a valid JSON block like this:\n```json\n{\n \"thought\": \"<string>\",\n \"plan\": \"<string>\",\n \"actions\": [\"<string>\", \"<string>\", ...],\n \"providers\": [\"<string>\", \"<string>\", ...]\n}\n```\n\nYour response should include the valid JSON block and nothing else.";
|
|
116
|
-
export declare const booleanFooter = "Respond with only a YES or a NO.";
|
|
117
|
-
/**
|
|
118
|
-
* Parses a string to determine its boolean equivalent.
|
|
119
|
-
*
|
|
120
|
-
* Recognized affirmative values: "YES", "Y", "TRUE", "T", "1", "ON", "ENABLE"
|
|
121
|
-
* Recognized negative values: "NO", "N", "FALSE", "F", "0", "OFF", "DISABLE"
|
|
122
|
-
*
|
|
123
|
-
* @param {string | undefined | null} value - The input text to parse
|
|
124
|
-
* @returns {boolean} - Returns `true` for affirmative inputs, `false` for negative or unrecognized inputs
|
|
125
|
-
*/
|
|
126
|
-
export declare function parseBooleanFromText(value: string | undefined | null): boolean;
|
|
127
|
-
export declare const stringArrayFooter = "Respond with a JSON array containing the values in a valid JSON block formatted for markdown with this structure:\n```json\n[\n 'value',\n 'value'\n]\n```\n\nYour response must include the valid JSON block.";
|
|
128
|
-
/**
|
|
129
|
-
* Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks
|
|
130
|
-
* with `json` language identifier, and if not found, it searches for an array pattern within the text.
|
|
131
|
-
* It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result
|
|
132
|
-
* is an array, it returns the array; otherwise, it returns null.
|
|
133
|
-
*
|
|
134
|
-
* @param text - The input text from which to extract and parse the JSON array.
|
|
135
|
-
* @returns An array parsed from the JSON string if successful; otherwise, null.
|
|
136
|
-
*/
|
|
137
|
-
export declare function parseJsonArrayFromText(text: string): any[];
|
|
138
|
-
/**
|
|
139
|
-
* Parses a JSON object from a given text. The function looks for a JSON block wrapped in triple backticks
|
|
140
|
-
* with `json` language identifier, and if not found, it searches for an object pattern within the text.
|
|
141
|
-
* It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result
|
|
142
|
-
* is an object (but not an array), it returns the object; otherwise, it tries to parse an array if the result
|
|
143
|
-
* is an array, or returns null if parsing is unsuccessful or the result is neither an object nor an array.
|
|
144
|
-
*
|
|
145
|
-
* @param text - The input text from which to extract and parse the JSON object.
|
|
146
|
-
* @returns An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array.
|
|
147
|
-
*/
|
|
148
|
-
export declare function parseJSONObjectFromText(text: string): Record<string, any> | null;
|
|
149
|
-
/**
|
|
150
|
-
* Extracts specific attributes (e.g., user, text, action) from a JSON-like string using regex.
|
|
151
|
-
* @param response - The cleaned string response to extract attributes from.
|
|
152
|
-
* @param attributesToExtract - An array of attribute names to extract.
|
|
153
|
-
* @returns An object containing the extracted attributes.
|
|
154
|
-
*/
|
|
155
|
-
export declare function extractAttributes(response: string, attributesToExtract?: string[]): {
|
|
156
|
-
[key: string]: string | undefined;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Normalizes a JSON-like string by correcting formatting issues:
|
|
160
|
-
* - Removes extra spaces after '{' and before '}'.
|
|
161
|
-
* - Wraps unquoted values in double quotes.
|
|
162
|
-
* - Converts single-quoted values to double-quoted.
|
|
163
|
-
* - Ensures consistency in key-value formatting.
|
|
164
|
-
* - Normalizes mixed adjacent quote pairs.
|
|
165
|
-
*
|
|
166
|
-
* This is useful for cleaning up improperly formatted JSON strings
|
|
167
|
-
* before parsing them into valid JSON.
|
|
168
|
-
*
|
|
169
|
-
* @param str - The JSON-like string to normalize.
|
|
170
|
-
* @returns A properly formatted JSON string.
|
|
171
|
-
*/
|
|
172
|
-
export declare const normalizeJsonString: (str: string) => string;
|
|
173
|
-
/**
|
|
174
|
-
* Cleans a JSON-like response string by removing unnecessary markers, line breaks, and extra whitespace.
|
|
175
|
-
* This is useful for handling improperly formatted JSON responses from external sources.
|
|
176
|
-
*
|
|
177
|
-
* @param response - The raw JSON-like string response to clean.
|
|
178
|
-
* @returns The cleaned string, ready for parsing or further processing.
|
|
179
|
-
*/
|
|
180
|
-
export declare function cleanJsonResponse(response: string): string;
|
|
181
|
-
export declare const postActionResponseFooter = "Choose any combination of [LIKE], [RETWEET], [QUOTE], and [REPLY] that are appropriate. Each action must be on its own line. Your response must only include the chosen actions.";
|
|
182
|
-
type ActionResponse = {
|
|
183
|
-
like: boolean;
|
|
184
|
-
retweet: boolean;
|
|
185
|
-
quote?: boolean;
|
|
186
|
-
reply?: boolean;
|
|
187
|
-
};
|
|
188
|
-
export declare const parseActionResponseFromText: (text: string) => {
|
|
189
|
-
actions: ActionResponse;
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* Truncate text to fit within the character limit, ensuring it ends at a complete sentence.
|
|
193
|
-
*/
|
|
194
|
-
export declare function truncateToCompleteSentence(text: string, maxLength: number): string;
|
|
195
|
-
export declare function splitChunks(content: string, chunkSize?: number, bleed?: number): Promise<string[]>;
|
|
196
|
-
/**
|
|
197
|
-
* Trims the provided text prompt to a specified token limit using a tokenizer model and type.
|
|
198
|
-
*/
|
|
199
|
-
export declare function trimTokens(prompt: string, maxTokens: number, runtime: IAgentRuntime): Promise<string>;
|
|
200
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* A provider object that fetches possible response actions based on the provided runtime, message, and state.
|
|
4
|
-
* @type {Provider}
|
|
5
|
-
* @property {string} name - The name of the provider ("ACTIONS").
|
|
6
|
-
* @property {string} description - The description of the provider ("Possible response actions").
|
|
7
|
-
* @property {number} position - The position of the provider (-1).
|
|
8
|
-
* @property {Function} get - Asynchronous function that retrieves actions that validate for the given message.
|
|
9
|
-
* @param {IAgentRuntime} runtime - The runtime object.
|
|
10
|
-
* @param {Memory} message - The message memory.
|
|
11
|
-
* @param {State} state - The state object.
|
|
12
|
-
* @returns {Object} An object containing the actions data, values, and combined text sections.
|
|
13
|
-
*/
|
|
14
|
-
export declare const actionsProvider: Provider;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Represents an anxiety provider that provides examples and guidance for an AI roleplaying as a character.
|
|
4
|
-
* The anxiety provider offers suggestions on how to reduce verbosity and eagerness in responses based on the channel type.
|
|
5
|
-
* Randomly selects and returns three anxiety examples for the AI to follow.
|
|
6
|
-
*
|
|
7
|
-
* @type {Provider}
|
|
8
|
-
*/
|
|
9
|
-
export declare const anxietyProvider: Provider;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Provides a list of attachments in the current conversation.
|
|
4
|
-
* @param {IAgentRuntime} runtime - The agent runtime object.
|
|
5
|
-
* @param {Memory} message - The message memory object.
|
|
6
|
-
* @returns {Object} The attachments values, data, and text.
|
|
7
|
-
*/
|
|
8
|
-
export declare const attachmentsProvider: Provider;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Provider that collects capability descriptions from all registered services
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Provides capabilities information for the agent.
|
|
7
|
-
*
|
|
8
|
-
* @param {IAgentRuntime} runtime - The agent runtime instance.
|
|
9
|
-
* @param {Memory} _message - The memory message object.
|
|
10
|
-
* @returns {Promise<ProviderResult>} The provider result object containing capabilities information.
|
|
11
|
-
*/
|
|
12
|
-
export declare const capabilitiesProvider: Provider;
|
|
13
|
-
export default capabilitiesProvider;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Character provider object.
|
|
4
|
-
* @typedef {Object} Provider
|
|
5
|
-
* @property {string} name - The name of the provider ("CHARACTER").
|
|
6
|
-
* @property {string} description - Description of the character information.
|
|
7
|
-
* @property {Function} get - Async function to get character information.
|
|
8
|
-
*/
|
|
9
|
-
export declare const characterProvider: Provider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Choice provider function that retrieves all pending tasks with options for a specific room
|
|
4
|
-
*
|
|
5
|
-
* @param {IAgentRuntime} runtime - The runtime object for the agent
|
|
6
|
-
* @param {Memory} message - The message memory object
|
|
7
|
-
* @returns {Promise<ProviderResult>} A promise that resolves with the provider result containing the pending tasks with options
|
|
8
|
-
*/
|
|
9
|
-
export declare const choiceProvider: Provider;
|
|
10
|
-
export default choiceProvider;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Evaluator, Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Formats the names of evaluators into a comma-separated list, each enclosed in single quotes.
|
|
4
|
-
* @param evaluators - An array of evaluator objects.
|
|
5
|
-
* @returns A string that concatenates the names of all evaluators, each enclosed in single quotes and separated by commas.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Formats the names of the evaluators in the provided array.
|
|
9
|
-
*
|
|
10
|
-
* @param {Evaluator[]} evaluators - Array of evaluators.
|
|
11
|
-
* @returns {string} - Formatted string of evaluator names.
|
|
12
|
-
*/
|
|
13
|
-
export declare function formatEvaluatorNames(evaluators: Evaluator[]): string;
|
|
14
|
-
/**
|
|
15
|
-
* Formats evaluator examples into a readable string, replacing placeholders with generated names.
|
|
16
|
-
* @param evaluators - An array of evaluator objects, each containing examples to format.
|
|
17
|
-
* @returns A string that presents each evaluator example in a structured format, including context, messages, and outcomes, with placeholders replaced by generated names.
|
|
18
|
-
*/
|
|
19
|
-
export declare function formatEvaluatorExamples(evaluators: Evaluator[]): string;
|
|
20
|
-
/**
|
|
21
|
-
* Formats evaluator details into a string, including both the name and description of each evaluator.
|
|
22
|
-
* @param evaluators - An array of evaluator objects.
|
|
23
|
-
* @returns A string that concatenates the name and description of each evaluator, separated by a colon and a newline character.
|
|
24
|
-
*/
|
|
25
|
-
export declare function formatEvaluators(evaluators: Evaluator[]): string;
|
|
26
|
-
export declare const evaluatorsProvider: Provider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Function to get key facts that the agent knows.
|
|
4
|
-
* @param {IAgentRuntime} runtime - The runtime environment for the agent.
|
|
5
|
-
* @param {Memory} message - The message object containing relevant information.
|
|
6
|
-
* @param {State} [_state] - Optional state information.
|
|
7
|
-
* @returns {Object} An object containing values, data, and text related to the key facts.
|
|
8
|
-
*/
|
|
9
|
-
declare const factsProvider: Provider;
|
|
10
|
-
export { factsProvider };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Represents a knowledge provider that retrieves knowledge from the knowledge base.
|
|
4
|
-
* @type {Provider}
|
|
5
|
-
* @property {string} name - The name of the knowledge provider.
|
|
6
|
-
* @property {string} description - The description of the knowledge provider.
|
|
7
|
-
* @property {boolean} dynamic - Indicates if the knowledge provider is dynamic or static.
|
|
8
|
-
* @property {Function} get - Asynchronously retrieves knowledge from the knowledge base.
|
|
9
|
-
* @param {IAgentRuntime} runtime - The agent runtime object.
|
|
10
|
-
* @param {Memory} message - The message containing the query for knowledge retrieval.
|
|
11
|
-
* @returns {Object} An object containing the retrieved knowledge data, values, and text.
|
|
12
|
-
*/
|
|
13
|
-
export declare const knowledgeProvider: Provider;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* A provider object that retrieves recent messages, interactions, and memories based on a given message.
|
|
4
|
-
* @typedef {object} Provider
|
|
5
|
-
* @property {string} name - The name of the provider ("RECENT_MESSAGES").
|
|
6
|
-
* @property {string} description - A description of the provider's purpose ("Recent messages, interactions and other memories").
|
|
7
|
-
* @property {number} position - The position of the provider (100).
|
|
8
|
-
* @property {Function} get - Asynchronous function that retrieves recent messages, interactions, and memories.
|
|
9
|
-
* @param {IAgentRuntime} runtime - The runtime context for the agent.
|
|
10
|
-
* @param {Memory} message - The message to retrieve data from.
|
|
11
|
-
* @returns {object} An object containing data, values, and text sections.
|
|
12
|
-
*/
|
|
13
|
-
export declare const recentMessagesProvider: Provider;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Provider for fetching relationships data.
|
|
4
|
-
*
|
|
5
|
-
* @type {Provider}
|
|
6
|
-
* @property {string} name - The name of the provider ("RELATIONSHIPS").
|
|
7
|
-
* @property {string} description - Description of the provider.
|
|
8
|
-
* @property {Function} get - Asynchronous function to fetch relationships data.
|
|
9
|
-
* @param {IAgentRuntime} runtime - The agent runtime object.
|
|
10
|
-
* @param {Memory} message - The message object containing entity ID.
|
|
11
|
-
* @returns {Promise<Object>} Object containing relationships data or error message.
|
|
12
|
-
*/
|
|
13
|
-
declare const relationshipsProvider: Provider;
|
|
14
|
-
export { relationshipsProvider };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Role provider that retrieves roles in the server based on the provided runtime, message, and state.
|
|
4
|
-
* * @type { Provider }
|
|
5
|
-
* @property { string } name - The name of the role provider.
|
|
6
|
-
* @property { string } description - A brief description of the role provider.
|
|
7
|
-
* @property { Function } get - Asynchronous function that retrieves and processes roles in the server.
|
|
8
|
-
* @param { IAgentRuntime } runtime - The agent runtime object.
|
|
9
|
-
* @param { Memory } message - The message memory object.
|
|
10
|
-
* @param { State } state - The state object.
|
|
11
|
-
* @returns {Promise<ProviderResult>} The result containing roles data, values, and text.
|
|
12
|
-
*/
|
|
13
|
-
export declare const roleProvider: Provider;
|
|
14
|
-
export default roleProvider;
|
package/dist/providers/time.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Time provider function that retrieves the current date and time in UTC
|
|
4
|
-
* for use in time-based operations or responses.
|
|
5
|
-
*
|
|
6
|
-
* @param _runtime - The runtime environment of the bot agent.
|
|
7
|
-
* @param _message - The memory object containing message data.
|
|
8
|
-
* @returns An object containing the current date and time data, human-readable date and time string,
|
|
9
|
-
* and a text response with the current date and time information.
|
|
10
|
-
*/
|
|
11
|
-
export declare const timeProvider: Provider;
|
package/dist/roles.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, Role, type World } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Represents the state of server ownership, including a mapping of server IDs to their respective World objects.
|
|
4
|
-
*/
|
|
5
|
-
export interface ServerOwnershipState {
|
|
6
|
-
servers: {
|
|
7
|
-
[serverId: string]: World;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Gets a user's role from world metadata
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Retrieve the server role of a specified user entity within a given server.
|
|
15
|
-
*
|
|
16
|
-
* @param {IAgentRuntime} runtime - The runtime object containing necessary configurations and services.
|
|
17
|
-
* @param {string} entityId - The unique identifier of the user entity.
|
|
18
|
-
* @param {string} serverId - The unique identifier of the server.
|
|
19
|
-
* @returns {Promise<Role>} The role of the user entity within the server, resolved as a Promise.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getUserServerRole(runtime: IAgentRuntime, entityId: string, serverId: string): Promise<Role>;
|
|
22
|
-
/**
|
|
23
|
-
* Finds a server where the given user is the owner
|
|
24
|
-
*/
|
|
25
|
-
export declare function findWorldForOwner(runtime: IAgentRuntime, entityId: string): Promise<World | null>;
|