@elizaos/core 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +213 -16
- package/dist/testing/index.js +22 -0
- package/dist/testing/index.js.map +9 -0
- package/package.json +46 -27
- package/dist/actions.d.ts +0 -22
- package/dist/actions.d.ts.map +0 -1
- package/dist/browser/index.browser.js +0 -771
- package/dist/browser/index.browser.js.map +0 -427
- package/dist/browser/index.d.ts +0 -2
- package/dist/character.d.ts +0 -39
- package/dist/character.d.ts.map +0 -1
- package/dist/constants/index.d.ts +0 -7
- package/dist/constants/secrets.d.ts +0 -67
- package/dist/database.d.ts +0 -494
- package/dist/database.d.ts.map +0 -1
- package/dist/elizaos.d.ts +0 -194
- package/dist/elizaos.d.ts.map +0 -1
- package/dist/entities.d.ts +0 -40
- package/dist/entities.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -39
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.node.d.ts +0 -37
- package/dist/index.node.d.ts.map +0 -1
- package/dist/logger.d.ts +0 -72
- package/dist/logger.d.ts.map +0 -1
- package/dist/memory.d.ts +0 -63
- package/dist/memory.d.ts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.node.js +0 -53403
- package/dist/node/index.node.js.map +0 -511
- package/dist/onboarding-state.d.ts +0 -209
- package/dist/plugin.d.ts +0 -55
- package/dist/plugin.d.ts.map +0 -1
- package/dist/prompts.d.ts +0 -7
- package/dist/prompts.d.ts.map +0 -1
- package/dist/request-context.d.ts +0 -142
- package/dist/request-context.d.ts.map +0 -1
- package/dist/request-context.node.d.ts +0 -36
- package/dist/request-context.node.d.ts.map +0 -1
- package/dist/roles.d.ts +0 -23
- package/dist/roles.d.ts.map +0 -1
- package/dist/runtime.d.ts +0 -366
- package/dist/runtime.d.ts.map +0 -1
- package/dist/schemas/character.d.ts +0 -151
- package/dist/schemas/character.d.ts.map +0 -1
- package/dist/search.d.ts +0 -316
- package/dist/search.d.ts.map +0 -1
- package/dist/secrets.d.ts +0 -11
- package/dist/secrets.d.ts.map +0 -1
- package/dist/services/default-message-service.d.ts +0 -69
- package/dist/services/default-message-service.d.ts.map +0 -1
- package/dist/services/message-service.d.ts +0 -171
- package/dist/services/message-service.d.ts.map +0 -1
- package/dist/services.d.ts +0 -56
- package/dist/services.d.ts.map +0 -1
- package/dist/sessions/index.d.ts +0 -10
- package/dist/sessions/paths.d.ts +0 -56
- package/dist/sessions/provider.d.ts +0 -73
- package/dist/sessions/session-key.d.ts +0 -133
- package/dist/sessions/store.d.ts +0 -75
- package/dist/sessions/types.d.ts +0 -195
- package/dist/settings.d.ts +0 -90
- package/dist/settings.d.ts.map +0 -1
- package/dist/streaming-context.browser.d.ts +0 -26
- package/dist/streaming-context.browser.d.ts.map +0 -1
- package/dist/streaming-context.d.ts +0 -95
- package/dist/streaming-context.d.ts.map +0 -1
- package/dist/streaming-context.node.d.ts +0 -15
- package/dist/streaming-context.node.d.ts.map +0 -1
- package/dist/types/agent.d.ts +0 -97
- package/dist/types/agent.d.ts.map +0 -1
- package/dist/types/components.d.ts +0 -155
- package/dist/types/components.d.ts.map +0 -1
- package/dist/types/database.d.ts +0 -414
- package/dist/types/database.d.ts.map +0 -1
- package/dist/types/elizaos.d.ts +0 -159
- package/dist/types/elizaos.d.ts.map +0 -1
- package/dist/types/environment.d.ts +0 -116
- package/dist/types/environment.d.ts.map +0 -1
- package/dist/types/events.d.ts +0 -203
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -20
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/knowledge.d.ts +0 -30
- package/dist/types/knowledge.d.ts.map +0 -1
- package/dist/types/memory.d.ts +0 -102
- package/dist/types/memory.d.ts.map +0 -1
- package/dist/types/messaging.d.ts +0 -137
- package/dist/types/messaging.d.ts.map +0 -1
- package/dist/types/model.d.ts +0 -513
- package/dist/types/model.d.ts.map +0 -1
- package/dist/types/plugin.d.ts +0 -91
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/primitives.d.ts +0 -96
- package/dist/types/primitives.d.ts.map +0 -1
- package/dist/types/runtime.d.ts +0 -140
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/service.d.ts +0 -150
- package/dist/types/service.d.ts.map +0 -1
- package/dist/types/settings.d.ts +0 -29
- package/dist/types/settings.d.ts.map +0 -1
- package/dist/types/state.d.ts +0 -56
- package/dist/types/state.d.ts.map +0 -1
- package/dist/types/streaming.d.ts +0 -71
- package/dist/types/streaming.d.ts.map +0 -1
- package/dist/types/task.d.ts +0 -67
- package/dist/types/task.d.ts.map +0 -1
- package/dist/types/tee.d.ts +0 -96
- package/dist/types/tee.d.ts.map +0 -1
- package/dist/types/testing.d.ts +0 -28
- package/dist/types/testing.d.ts.map +0 -1
- package/dist/utils/buffer.d.ts +0 -104
- package/dist/utils/buffer.d.ts.map +0 -1
- package/dist/utils/crypto-compat.d.ts +0 -183
- package/dist/utils/crypto-compat.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -50
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/node.d.ts +0 -5
- package/dist/utils/node.d.ts.map +0 -1
- package/dist/utils/paths.d.ts +0 -92
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/server-health.d.ts +0 -22
- package/dist/utils/server-health.d.ts.map +0 -1
- package/dist/utils/streaming.d.ts +0 -179
- package/dist/utils/streaming.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts +0 -23
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -182
- package/dist/utils.d.ts.map +0 -1
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Onboarding State Machine for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* Manages the step-by-step onboarding flow across platforms.
|
|
5
|
-
* Ported from the Python/Rust reference implementations.
|
|
6
|
-
*
|
|
7
|
-
* @module onboarding-state
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Steps in the onboarding flow.
|
|
11
|
-
*/
|
|
12
|
-
export declare enum OnboardingStep {
|
|
13
|
-
WELCOME = "welcome",
|
|
14
|
-
RISK_ACK = "risk_ack",
|
|
15
|
-
AUTH = "auth",
|
|
16
|
-
CHANNELS = "channels",
|
|
17
|
-
SKILLS = "skills",
|
|
18
|
-
COMPLETE = "complete"
|
|
19
|
-
}
|
|
20
|
-
/** Canonical step order. */
|
|
21
|
-
export declare const ONBOARDING_STEP_ORDER: OnboardingStep[];
|
|
22
|
-
/** Human-readable step labels. */
|
|
23
|
-
export declare const ONBOARDING_STEP_LABELS: Record<OnboardingStep, string>;
|
|
24
|
-
/** Step descriptions. */
|
|
25
|
-
export declare const ONBOARDING_STEP_DESCRIPTIONS: Record<OnboardingStep, string>;
|
|
26
|
-
export interface OAuthTokens {
|
|
27
|
-
accessToken: string;
|
|
28
|
-
refreshToken?: string;
|
|
29
|
-
expiresAt?: number;
|
|
30
|
-
}
|
|
31
|
-
export interface AuthSettings {
|
|
32
|
-
modelProvider?: string;
|
|
33
|
-
apiKey?: string;
|
|
34
|
-
oauthTokens?: OAuthTokens;
|
|
35
|
-
setupToken?: string;
|
|
36
|
-
authMethod?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface ChannelConfig {
|
|
39
|
-
type: string;
|
|
40
|
-
enabled: boolean;
|
|
41
|
-
credentials?: Record<string, string>;
|
|
42
|
-
settings?: Record<string, string | boolean | number>;
|
|
43
|
-
}
|
|
44
|
-
export interface ChannelSettings {
|
|
45
|
-
enabledChannels: string[];
|
|
46
|
-
channelConfigs: Record<string, ChannelConfig>;
|
|
47
|
-
dmPolicy?: Record<string, boolean>;
|
|
48
|
-
}
|
|
49
|
-
export interface SkillsSettings {
|
|
50
|
-
enabledSkills: string[];
|
|
51
|
-
skillsToInstall: string[];
|
|
52
|
-
useHomebrew?: boolean;
|
|
53
|
-
nodeManager?: string;
|
|
54
|
-
}
|
|
55
|
-
export interface OnboardingSettings {
|
|
56
|
-
auth?: AuthSettings;
|
|
57
|
-
channels?: ChannelSettings;
|
|
58
|
-
skills?: SkillsSettings;
|
|
59
|
-
riskAcknowledgedAt?: number;
|
|
60
|
-
riskAcknowledged?: boolean;
|
|
61
|
-
gateway?: Record<string, string | number | null>;
|
|
62
|
-
}
|
|
63
|
-
export interface OnboardingStepError {
|
|
64
|
-
code: string;
|
|
65
|
-
message: string;
|
|
66
|
-
step: OnboardingStep;
|
|
67
|
-
timestamp: number;
|
|
68
|
-
details?: Record<string, unknown>;
|
|
69
|
-
}
|
|
70
|
-
export interface OnboardingContext {
|
|
71
|
-
currentStep: OnboardingStep;
|
|
72
|
-
completedSteps: OnboardingStep[];
|
|
73
|
-
settings: OnboardingSettings;
|
|
74
|
-
errors: OnboardingStepError[];
|
|
75
|
-
startedAt: number;
|
|
76
|
-
lastActivityAt: number;
|
|
77
|
-
platform: string;
|
|
78
|
-
mode: string;
|
|
79
|
-
sessionId: string;
|
|
80
|
-
worldId?: string;
|
|
81
|
-
userId?: string;
|
|
82
|
-
interrupted?: boolean;
|
|
83
|
-
metadata?: Record<string, unknown>;
|
|
84
|
-
}
|
|
85
|
-
export interface WelcomeInput {
|
|
86
|
-
acknowledged: boolean;
|
|
87
|
-
userName?: string;
|
|
88
|
-
}
|
|
89
|
-
export interface RiskAckInput {
|
|
90
|
-
accepted: boolean;
|
|
91
|
-
warningText?: string;
|
|
92
|
-
}
|
|
93
|
-
export interface OAuthCallback {
|
|
94
|
-
code: string;
|
|
95
|
-
state: string;
|
|
96
|
-
}
|
|
97
|
-
export interface AuthInput {
|
|
98
|
-
method: string;
|
|
99
|
-
provider?: string;
|
|
100
|
-
apiKey?: string;
|
|
101
|
-
oauthCallback?: OAuthCallback;
|
|
102
|
-
setupToken?: string;
|
|
103
|
-
skip?: boolean;
|
|
104
|
-
}
|
|
105
|
-
export interface ChannelEntry {
|
|
106
|
-
type: string;
|
|
107
|
-
enabled: boolean;
|
|
108
|
-
token?: string;
|
|
109
|
-
credentials?: Record<string, string>;
|
|
110
|
-
settings?: Record<string, string | boolean | number>;
|
|
111
|
-
}
|
|
112
|
-
export interface ChannelsInput {
|
|
113
|
-
channels: ChannelEntry[];
|
|
114
|
-
dmPolicy?: Record<string, boolean>;
|
|
115
|
-
skip?: boolean;
|
|
116
|
-
}
|
|
117
|
-
export interface SkillsPreferences {
|
|
118
|
-
useHomebrew?: boolean;
|
|
119
|
-
nodeManager?: string;
|
|
120
|
-
}
|
|
121
|
-
export interface SkillsInput {
|
|
122
|
-
skills?: string[];
|
|
123
|
-
install?: string[];
|
|
124
|
-
preferences?: SkillsPreferences;
|
|
125
|
-
skip?: boolean;
|
|
126
|
-
}
|
|
127
|
-
export interface OnboardingResult {
|
|
128
|
-
success: boolean;
|
|
129
|
-
newStep: OnboardingStep;
|
|
130
|
-
isComplete: boolean;
|
|
131
|
-
error?: OnboardingStepError;
|
|
132
|
-
message?: string;
|
|
133
|
-
context?: OnboardingContext;
|
|
134
|
-
data?: Record<string, unknown>;
|
|
135
|
-
}
|
|
136
|
-
export interface StepProgressInfo {
|
|
137
|
-
step: OnboardingStep;
|
|
138
|
-
label: string;
|
|
139
|
-
status: 'completed' | 'current' | 'pending' | 'error';
|
|
140
|
-
errorMessage?: string;
|
|
141
|
-
}
|
|
142
|
-
export interface OnboardingProgress {
|
|
143
|
-
currentStepNumber: number;
|
|
144
|
-
totalSteps: number;
|
|
145
|
-
percentage: number;
|
|
146
|
-
steps: StepProgressInfo[];
|
|
147
|
-
}
|
|
148
|
-
export interface SerializedOnboardingState {
|
|
149
|
-
version: number;
|
|
150
|
-
context: OnboardingContext;
|
|
151
|
-
checksum?: string;
|
|
152
|
-
}
|
|
153
|
-
export interface ValidationResult {
|
|
154
|
-
valid: boolean;
|
|
155
|
-
error?: string;
|
|
156
|
-
details?: Record<string, unknown>;
|
|
157
|
-
}
|
|
158
|
-
export type StepHandler = (data: unknown, context: OnboardingContext) => Promise<OnboardingResult>;
|
|
159
|
-
export type OnStepChangeCallback = (oldStep: OnboardingStep, newStep: OnboardingStep, context: OnboardingContext) => Promise<void> | void;
|
|
160
|
-
export type OnCompleteCallback = (context: OnboardingContext) => Promise<void> | void;
|
|
161
|
-
export type OnErrorCallback = (error: OnboardingStepError, context: OnboardingContext) => void;
|
|
162
|
-
export interface OnboardingStateMachineConfig {
|
|
163
|
-
platform: string;
|
|
164
|
-
mode?: string;
|
|
165
|
-
worldId?: string;
|
|
166
|
-
userId?: string;
|
|
167
|
-
existingContext?: OnboardingContext;
|
|
168
|
-
onStepChange?: OnStepChangeCallback;
|
|
169
|
-
onComplete?: OnCompleteCallback;
|
|
170
|
-
onError?: OnErrorCallback;
|
|
171
|
-
}
|
|
172
|
-
/** Get index of a step in the canonical order (returns -1 if not found). */
|
|
173
|
-
export declare function getStepIndex(step: OnboardingStep): number;
|
|
174
|
-
/** Get next step after the given one, or null if at end. */
|
|
175
|
-
export declare function getNextStep(current: OnboardingStep): OnboardingStep | null;
|
|
176
|
-
/** Get previous step, or null if at beginning. */
|
|
177
|
-
export declare function getPreviousStep(current: OnboardingStep): OnboardingStep | null;
|
|
178
|
-
/** Check if a step is completed in the context. */
|
|
179
|
-
export declare function isStepCompleted(context: OnboardingContext, step: OnboardingStep): boolean;
|
|
180
|
-
/** Calculate progress percentage. */
|
|
181
|
-
export declare function calculateProgress(context: OnboardingContext): number;
|
|
182
|
-
/** Check if onboarding is complete. */
|
|
183
|
-
export declare function isOnboardingComplete(context: OnboardingContext): boolean;
|
|
184
|
-
/** Get a human-readable summary of onboarding state. */
|
|
185
|
-
export declare function getOnboardingSummary(context: OnboardingContext): string;
|
|
186
|
-
export declare class OnboardingStateMachine {
|
|
187
|
-
private context;
|
|
188
|
-
private readonly config;
|
|
189
|
-
private readonly handlers;
|
|
190
|
-
constructor(config: OnboardingStateMachineConfig);
|
|
191
|
-
getCurrentStep(): OnboardingStep;
|
|
192
|
-
getContext(): OnboardingContext;
|
|
193
|
-
getSettings(): OnboardingSettings;
|
|
194
|
-
canAdvance(): boolean;
|
|
195
|
-
getProgress(): OnboardingProgress;
|
|
196
|
-
advanceStep(step: OnboardingStep, data: unknown): Promise<OnboardingResult>;
|
|
197
|
-
skipStep(): Promise<OnboardingResult>;
|
|
198
|
-
goBack(targetStep?: OnboardingStep): OnboardingResult;
|
|
199
|
-
toJSON(): SerializedOnboardingState;
|
|
200
|
-
static fromJSON(serialized: SerializedOnboardingState, config: OnboardingStateMachineConfig): OnboardingStateMachine;
|
|
201
|
-
reset(): void;
|
|
202
|
-
registerHandler(step: OnboardingStep, handler: StepHandler): void;
|
|
203
|
-
private makeError;
|
|
204
|
-
private handleStepDefault;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Factory function for creating an OnboardingStateMachine.
|
|
208
|
-
*/
|
|
209
|
-
export declare function createOnboardingStateMachine(platform: string, mode?: string, worldId?: string, userId?: string, onStepChange?: OnStepChangeCallback, onComplete?: OnCompleteCallback, onError?: OnErrorCallback): OnboardingStateMachine;
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Attempt to install a plugin using Bun
|
|
4
|
-
* Returns true if installation succeeded, false otherwise
|
|
5
|
-
*/
|
|
6
|
-
export declare function tryInstallPlugin(pluginName: string): Promise<boolean>;
|
|
7
|
-
/**
|
|
8
|
-
* Check if an object has a valid plugin shape
|
|
9
|
-
*/
|
|
10
|
-
export declare function isValidPluginShape(obj: unknown): obj is Plugin;
|
|
11
|
-
/**
|
|
12
|
-
* Validate a plugin's structure
|
|
13
|
-
*/
|
|
14
|
-
export declare function validatePlugin(plugin: unknown): {
|
|
15
|
-
isValid: boolean;
|
|
16
|
-
errors: string[];
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Load and prepare a plugin for use
|
|
20
|
-
*/
|
|
21
|
-
export declare function loadAndPreparePlugin(pluginName: string): Promise<Plugin | null>;
|
|
22
|
-
/**
|
|
23
|
-
* Normalizes a plugin name by extracting the short name from scoped packages
|
|
24
|
-
* Examples:
|
|
25
|
-
* - '@elizaos/plugin-discord' -> 'discord'
|
|
26
|
-
* - '@elizaos/plugin-sql' -> 'sql'
|
|
27
|
-
* - 'bootstrap' -> 'bootstrap'
|
|
28
|
-
* - 'plugin-custom' -> 'plugin-custom'
|
|
29
|
-
*/
|
|
30
|
-
export declare function normalizePluginName(pluginName: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Resolve plugin dependencies with circular dependency detection
|
|
33
|
-
* Performs topological sorting of plugins to ensure dependencies are loaded in the correct order
|
|
34
|
-
*
|
|
35
|
-
* Supports both scoped package names (@elizaos/plugin-discord) and short names (discord)
|
|
36
|
-
*/
|
|
37
|
-
export declare function resolvePluginDependencies(availablePlugins: Map<string, Plugin>, isTestMode?: boolean): Plugin[];
|
|
38
|
-
/**
|
|
39
|
-
* Load a plugin by name or validate a provided plugin object
|
|
40
|
-
* @param nameOrPlugin - Plugin name string or Plugin object
|
|
41
|
-
* @returns Loaded Plugin or null if failed
|
|
42
|
-
*/
|
|
43
|
-
export declare function loadPlugin(nameOrPlugin: string | Plugin): Promise<Plugin | null>;
|
|
44
|
-
/**
|
|
45
|
-
* Resolve multiple plugins with dependency ordering
|
|
46
|
-
* Browser-compatible wrapper that handles Node.js-only plugin loading
|
|
47
|
-
*
|
|
48
|
-
* @param plugins - Array of plugin names or Plugin objects
|
|
49
|
-
* @param isTestMode - Whether to include test dependencies
|
|
50
|
-
* @returns Ordered array of resolved plugins
|
|
51
|
-
*
|
|
52
|
-
* Note: In browser environments, string plugin names are not supported.
|
|
53
|
-
* Only pre-resolved Plugin objects can be used.
|
|
54
|
-
*/
|
|
55
|
-
export declare function resolvePlugins(plugins: (string | Plugin)[], isTestMode?: boolean): Promise<Plugin[]>;
|
package/dist/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAuBtC;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiE3E;AAMD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAkB9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAkDtF;AAMD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2DrF;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAO9D;AAMD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,UAAU,GAAE,OAAe,GAC1B,MAAM,EAAE,CA8FV;AAMD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAatF;AA+FD;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC5B,UAAU,GAAE,OAAe,GAC1B,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB"}
|
package/dist/prompts.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const shouldRespondTemplate = "<task>Decide on behalf of {{agentName}} whether they should respond to the message, ignore it or stop the conversation.</task>\n\n<providers>\n{{providers}}\n</providers>\n\n<instructions>Decide if {{agentName}} should respond to or interact with the conversation.\n\nIMPORTANT RULES FOR RESPONDING:\n- If YOUR name ({{agentName}}) is directly mentioned \u2192 RESPOND\n- If someone uses a DIFFERENT name (not {{agentName}}) \u2192 IGNORE (they're talking to someone else)\n- If you're actively participating in a conversation and the message continues that thread \u2192 RESPOND\n- If someone tells you to stop or be quiet \u2192 STOP\n- Otherwise \u2192 IGNORE\n\nThe key distinction is:\n- \"Talking TO {{agentName}}\" (your name mentioned, replies to you, continuing your conversation) \u2192 RESPOND\n- \"Talking ABOUT {{agentName}}\" or to someone else \u2192 IGNORE\n</instructions>\n\n<output>\nDo NOT include any thinking, reasoning, or <think> sections in your response.\nGo directly to the XML response format without any preamble or explanation.\n\nRespond using XML format like this:\n<response>\n <name>{{agentName}}</name>\n <reasoning>Your reasoning here</reasoning>\n <action>RESPOND | IGNORE | STOP</action>\n</response>\n\nIMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.\n</output>";
|
|
2
|
-
export declare const messageHandlerTemplate = "<task>Generate dialog and actions for the character {{agentName}}.</task>\n\n<providers>\n{{providers}}\n</providers>\n\n<instructions>\nWrite 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.\n\nIMPORTANT ACTION ORDERING RULES:\n- Actions are executed in the ORDER you list them - the order MATTERS!\n- REPLY should come FIRST to acknowledge the user's request before executing other actions\n- Common patterns:\n - For requests requiring tool use: REPLY,CALL_MCP_TOOL (acknowledge first, then gather info)\n - For task execution: REPLY,SEND_MESSAGE or REPLY,EVM_SWAP_TOKENS (acknowledge first, then do the task)\n - For multi-step operations: REPLY,ACTION1,ACTION2 (acknowledge first, then complete all steps)\n- REPLY is used to acknowledge and inform the user about what you're going to do\n- Follow-up actions execute the actual tasks after acknowledgment\n- Use IGNORE only when you should not respond at all\n- If you use IGNORE, do not include any other actions. IGNORE should be used alone when you should not respond or take any actions.\n\nIMPORTANT PROVIDER SELECTION RULES:\n- Only include providers if they are needed to respond accurately.\n- If the message mentions images, photos, pictures, attachments, or visual content, OR if you see \"(Attachments:\" in the conversation, you MUST include \"ATTACHMENTS\" in your providers list\n- If the message asks about or references specific people, include \"ENTITIES\" in your providers list \n- If the message asks about relationships or connections between people, include \"RELATIONSHIPS\" in your providers list\n- If the message asks about facts or specific information, include \"FACTS\" in your providers list\n- If the message asks about the environment or world context, include \"WORLD\" in your providers list\n- If no additional context is needed, you may leave the providers list empty.\n\nIMPORTANT CODE BLOCK FORMATTING RULES:\n- If {{agentName}} includes code examples, snippets, or multi-line code in the response, ALWAYS wrap the code with ``` fenced code blocks (specify the language if known, e.g., ```python).\n- ONLY use fenced code blocks for actual code. Do NOT wrap non-code text, instructions, or single words in fenced code blocks.\n- If including inline code (short single words or function names), use single backticks (`) as appropriate.\n- This ensures the user sees clearly formatted and copyable code when relevant.\n\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</instructions>\n\n<keys>\n\"thought\" should be a short description of what the agent is thinking about and planning.\n\"actions\" should be a comma-separated list of the actions {{agentName}} plans to take based on the thought, IN THE ORDER THEY SHOULD BE EXECUTED (if none, use IGNORE, if simply responding with text, use REPLY)\n\"providers\" should be a comma-separated list of the providers that {{agentName}} will use to have the right context for responding and acting (NEVER use \"IGNORE\" as a provider - use specific provider names like ATTACHMENTS, ENTITIES, FACTS, KNOWLEDGE, etc.)\n\"text\" should be the text of the next message for {{agentName}} which they will send to the conversation.\n</keys>\n\n<output>\nDo NOT include any thinking, reasoning, or <think> sections in your response. \nGo directly to the XML response format without any preamble or explanation.\n\nRespond using XML format like this:\n<response>\n <thought>Your thought here</thought>\n <actions>ACTION1,ACTION2</actions>\n <providers>PROVIDER1,PROVIDER2</providers>\n <text>Your response text here</text>\n</response>\n\nIMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.\n</output>";
|
|
3
|
-
export declare const postCreationTemplate = "# Task: Create a post in the voice and style and perspective of {{agentName}} @{{twitterUserName}}.\n\nExample task outputs:\n1. A post about the importance of AI in our lives\n<response>\n <thought>I am thinking about writing a post about the importance of AI in our lives</thought>\n <post>AI is changing the world and it is important to understand how it works</post>\n <imagePrompt>A futuristic cityscape with flying cars and people using AI to do things</imagePrompt>\n</response>\n\n2. A post about dogs\n<response>\n <thought>I am thinking about writing a post about dogs</thought>\n <post>Dogs are man's best friend and they are loyal and loving</post>\n <imagePrompt>A dog playing with a ball in a park</imagePrompt>\n</response>\n\n3. A post about finding a new job\n<response>\n <thought>Getting a job is hard, I bet there's a good tweet in that</thought>\n <post>Just keep going!</post>\n <imagePrompt>A person looking at a computer screen with a job search website</imagePrompt>\n</response>\n\n{{providers}}\n\nWrite a post that is {{adjective}} about {{topic}} (without mentioning {{topic}} directly), from the perspective of {{agentName}}. Do not add commentary or acknowledge this request, just write the post.\nYour response should be 1, 2, or 3 sentences (choose the length at random).\nYour response should not contain any questions. Brief, concise statements only. The total character count MUST be less than 280. No emojis. Use \\n\\n (double spaces) between statements if there are multiple statements in your response.\n\nYour output should be formatted in XML like this:\n<response>\n <thought>Your thought here</thought>\n <post>Your post text here</post>\n <imagePrompt>Optional image prompt here</imagePrompt>\n</response>\n\nThe \"post\" field should be the post you want to send. Do not including any thinking or internal reflection in the \"post\" field.\nThe \"imagePrompt\" field is optional and should be a prompt for an image that is relevant to the post. It should be a single sentence that captures the essence of the post. ONLY USE THIS FIELD if it makes sense that the post would benefit from an image.\nThe \"thought\" field should be a short description of what the agent is thinking about before responding, including a brief justification for the response. Includate an explanation how the post is relevant to the topic but unique and different than other posts.\n\nDo NOT include any thinking, reasoning, or <think> sections in your response. \nGo directly to the XML response format without any preamble or explanation.\n\nIMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.";
|
|
4
|
-
export declare const booleanFooter = "Respond with only a YES or a NO.";
|
|
5
|
-
export declare const imageDescriptionTemplate = "<task>Analyze the provided image and generate a comprehensive description with multiple levels of detail.</task>\n\n<instructions>\nCarefully examine the image and provide:\n1. A concise, descriptive title that captures the main subject or scene\n2. A brief summary description (1-2 sentences) highlighting the key elements\n3. An extensive, detailed description that covers all visible elements, composition, lighting, colors, mood, and any other relevant details\n\nBe objective and descriptive. Focus on what you can actually see in the image rather than making assumptions about context or meaning.\n</instructions>\n\n<output>\nDo NOT include any thinking, reasoning, or <think> sections in your response. \nGo directly to the XML response format without any preamble or explanation.\n\nRespond using XML format like this:\n<response>\n <title>A concise, descriptive title for the image</title>\n <description>A brief 1-2 sentence summary of the key elements in the image</description>\n <text>An extensive, detailed description covering all visible elements, composition, lighting, colors, mood, setting, objects, people, activities, and any other relevant details you can observe in the image</text>\n</response>\n\nIMPORTANT: Your response must ONLY contain the <response></response> XML block above. Do not include any text, thinking, or reasoning before or after this XML block. Start your response immediately with <response> and end with </response>.\n</output>";
|
|
6
|
-
export declare const multiStepDecisionTemplate = "<task>\nDetermine the next step the assistant should take in this conversation to help the user reach their goal.\n</task>\n\n{{recentMessages}}\n\n# Multi-Step Workflow\n\nIn each step, decide:\n\n1. **Which providers (if any)** should be called to gather necessary data.\n2. **Which action (if any)** should be executed after providers return.\n3. **What parameters** the action requires (if any).\n4. Decide whether the task is complete. If so, set `isFinish: true`. Do not select the `REPLY` action; replies are handled separately after task completion.\n\nYou can select **multiple providers** and at most **one action** per step.\n\nIf the task is fully resolved and no further steps are needed, mark the step as `isFinish: true`.\n\n---\n\n{{actionsWithParams}}\n\n{{providersWithDescriptions}}\n\nThese are the actions or data provider calls that have already been used in this run. Use this to avoid redundancy and guide your next move.\n\n{{actionResults}}\n\n<keys>\n\"thought\" Clearly explain your reasoning for the selected providers and/or action, and how this step contributes to resolving the user's request.\n\"action\" Name of the action to execute after providers return. Omit or use empty string \"\" if isFinish: true or no action needed.\n\"parameters\" JSON object with exact parameter names and values for the action. Use empty object {} if no parameters are needed.\n\"providers\" List of provider names to call in this step (can be empty if none are needed).\n\"isFinish\" Set to true only if the task is fully complete.\n</keys>\n\n\u26A0\uFE0F IMPORTANT: Do **not** mark the task as `isFinish: true` immediately after calling an action. Wait for the action to complete before deciding the task is finished.\n\n<output>\n<response>\n <thought>Your thought here</thought>\n <action>ACTION_NAME or \"\"</action>\n <parameters>\n {\n \"param1\": \"value1\",\n \"param2\": \"value2\"\n }\n </parameters>\n <providers>PROVIDER1,PROVIDER2</providers>\n <isFinish>true | false</isFinish>\n</response>\n</output>";
|
|
7
|
-
export declare const multiStepSummaryTemplate = "<task>\nSummarize what the assistant has done so far and provide a final response to the user based on the completed steps.\n</task>\n\n# Context Information\n{{bio}}\n\n---\n\n{{system}}\n\n---\n\n{{messageDirections}}\n\n# Conversation Summary\nBelow is the user\u2019s original request and conversation so far:\n{{recentMessages}}\n\n# Execution Trace\nHere are the actions taken by the assistant to fulfill the request:\n{{actionResults}}\n\n# Assistant\u2019s Last Reasoning Step\n{{recentMessage}}\n\n# Instructions\n\n - Review the execution trace and last reasoning step carefully\n\n - Your final output MUST be in this XML format:\n<output>\n<response>\n <thought>Your thought here</thought>\n <text>Your final message to the user</text>\n</response>\n</output>\n";
|
package/dist/prompts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,49CAgCxB,CAAC;AAEX,eAAO,MAAM,sBAAsB,o+HA2DzB,CAAC;AAEX,eAAO,MAAM,oBAAoB,wwFA4C+M,CAAC;AAEjP,eAAO,MAAM,aAAa,qCAAqC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,y8CAuB3B,CAAC;AAEX,eAAO,MAAM,yBAAyB,2gEAoD5B,CAAC;AAEX,eAAO,MAAM,wBAAwB,4wBAqCpC,CAAC"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Request context management for per-entity settings in multi-tenant deployments.
|
|
3
|
-
*
|
|
4
|
-
* Follows the OpenTelemetry ContextManager pattern (same as streaming-context.ts):
|
|
5
|
-
* - Interface for context management
|
|
6
|
-
* - Platform-specific implementations (Node.js AsyncLocalStorage, Browser Stack)
|
|
7
|
-
* - Global singleton configured at startup
|
|
8
|
-
*
|
|
9
|
-
* This enables sharing a single agent runtime across multiple users while ensuring
|
|
10
|
-
* each user's API keys, OAuth tokens, and configuration are used for their specific requests.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Before processing a user's message
|
|
15
|
-
* const entitySettings = await prefetchEntitySettings(userId, agentId);
|
|
16
|
-
*
|
|
17
|
-
* await runWithRequestContext({
|
|
18
|
-
* entityId: userId,
|
|
19
|
-
* agentId: agentId,
|
|
20
|
-
* entitySettings: new Map([
|
|
21
|
-
* ['OPENAI_API_KEY', 'sk-user-specific-key'],
|
|
22
|
-
* ['TWITTER_ACCESS_TOKEN', 'oauth-token-for-user'],
|
|
23
|
-
* ]),
|
|
24
|
-
* requestStartTime: Date.now(),
|
|
25
|
-
* }, async () => {
|
|
26
|
-
* // All getSetting() calls here check entitySettings first
|
|
27
|
-
* await runtime.handleMessage(message);
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
import type { UUID } from './types';
|
|
32
|
-
/**
|
|
33
|
-
* The value types that can be stored in entity settings.
|
|
34
|
-
* Matches the return type of getSetting().
|
|
35
|
-
*/
|
|
36
|
-
export type EntitySettingValue = string | boolean | number | null;
|
|
37
|
-
/**
|
|
38
|
-
* Request-scoped context containing per-entity settings.
|
|
39
|
-
* Used to isolate user settings across concurrent requests sharing the same runtime.
|
|
40
|
-
*/
|
|
41
|
-
export interface RequestContext {
|
|
42
|
-
/**
|
|
43
|
-
* The entity (user) ID for this request.
|
|
44
|
-
* Used to identify which user's settings should be used.
|
|
45
|
-
*/
|
|
46
|
-
entityId: UUID;
|
|
47
|
-
/**
|
|
48
|
-
* The agent ID for this request.
|
|
49
|
-
* Used for agent-specific entity settings lookup.
|
|
50
|
-
*/
|
|
51
|
-
agentId: UUID;
|
|
52
|
-
/**
|
|
53
|
-
* Pre-fetched entity-specific settings.
|
|
54
|
-
* These take highest priority in getSetting() resolution chain.
|
|
55
|
-
*
|
|
56
|
-
* The Map contains setting keys and their values:
|
|
57
|
-
* - string/boolean/number: The actual setting value to use
|
|
58
|
-
* - null: Explicitly unset (use agent default)
|
|
59
|
-
* - undefined (key not present): Fall through to agent settings
|
|
60
|
-
*/
|
|
61
|
-
entitySettings: Map<string, EntitySettingValue>;
|
|
62
|
-
/**
|
|
63
|
-
* Request start timestamp for observability and debugging.
|
|
64
|
-
* Useful for tracking request duration and timeout handling.
|
|
65
|
-
*/
|
|
66
|
-
requestStartTime: number;
|
|
67
|
-
/**
|
|
68
|
-
* Optional trace ID for distributed tracing.
|
|
69
|
-
* Can be passed from incoming request headers (e.g., X-Trace-Id).
|
|
70
|
-
*/
|
|
71
|
-
traceId?: string;
|
|
72
|
-
/**
|
|
73
|
-
* Optional organization ID for multi-tenant deployments.
|
|
74
|
-
* Used for logging and auditing purposes.
|
|
75
|
-
*/
|
|
76
|
-
organizationId?: string;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Interface for request context managers.
|
|
80
|
-
* Different implementations exist for Node.js (AsyncLocalStorage) and Browser (fallback).
|
|
81
|
-
*/
|
|
82
|
-
export interface IRequestContextManager {
|
|
83
|
-
/**
|
|
84
|
-
* Run a function with a request context.
|
|
85
|
-
* The context will be available to all nested async calls via `active()`.
|
|
86
|
-
*
|
|
87
|
-
* @param context - The request context to make available, or undefined to clear context
|
|
88
|
-
* @param fn - The function to run within the context
|
|
89
|
-
* @returns The result of the function
|
|
90
|
-
*/
|
|
91
|
-
run<T>(context: RequestContext | undefined, fn: () => T): T;
|
|
92
|
-
/**
|
|
93
|
-
* Get the currently active request context.
|
|
94
|
-
* Returns undefined if no context is active (e.g., during plugin init).
|
|
95
|
-
*
|
|
96
|
-
* @returns The current request context or undefined
|
|
97
|
-
*/
|
|
98
|
-
active(): RequestContext | undefined;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Set the global request context manager.
|
|
102
|
-
* Called during initialization by platform-specific entry points.
|
|
103
|
-
*
|
|
104
|
-
* @param manager - The context manager to use globally
|
|
105
|
-
*/
|
|
106
|
-
export declare function setRequestContextManager(manager: IRequestContextManager): void;
|
|
107
|
-
/**
|
|
108
|
-
* Get the global request context manager.
|
|
109
|
-
* Useful for testing or advanced use cases.
|
|
110
|
-
*
|
|
111
|
-
* @returns The current global request context manager
|
|
112
|
-
*/
|
|
113
|
-
export declare function getRequestContextManager(): IRequestContextManager;
|
|
114
|
-
/**
|
|
115
|
-
* Run a function with a request context.
|
|
116
|
-
* All getSetting() calls within this function will check entitySettings first.
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```typescript
|
|
120
|
-
* const result = await runWithRequestContext({
|
|
121
|
-
* entityId: userId as UUID,
|
|
122
|
-
* agentId: agentId as UUID,
|
|
123
|
-
* entitySettings: new Map([['API_KEY', 'user-specific-key']]),
|
|
124
|
-
* requestStartTime: Date.now(),
|
|
125
|
-
* }, async () => {
|
|
126
|
-
* // Inside here, runtime.getSetting('API_KEY') returns 'user-specific-key'
|
|
127
|
-
* return await runtime.processMessage(message);
|
|
128
|
-
* });
|
|
129
|
-
* ```
|
|
130
|
-
*
|
|
131
|
-
* @param context - The request context with entitySettings
|
|
132
|
-
* @param fn - The function to run with request context
|
|
133
|
-
* @returns The result of the function
|
|
134
|
-
*/
|
|
135
|
-
export declare function runWithRequestContext<T>(context: RequestContext | undefined, fn: () => T): T;
|
|
136
|
-
/**
|
|
137
|
-
* Get the currently active request context.
|
|
138
|
-
* Called by getSetting() to check for entity-specific settings.
|
|
139
|
-
*
|
|
140
|
-
* @returns The current request context or undefined if not in a request
|
|
141
|
-
*/
|
|
142
|
-
export declare function getRequestContext(): RequestContext | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../src/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,IAAI,CAAC;IAEf;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAC;IAEd;;;;;;;;OAQG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEhD;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,MAAM,IAAI,cAAc,GAAG,SAAS,CAAC;CACtC;AAoBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,CAEjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE5F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { RequestContext, IRequestContextManager } from './request-context';
|
|
2
|
-
/**
|
|
3
|
-
* AsyncLocalStorage-based context manager for Node.js.
|
|
4
|
-
* Provides proper async context isolation across parallel async operations.
|
|
5
|
-
*
|
|
6
|
-
* When User A and User B send messages concurrently:
|
|
7
|
-
* - User A's async chain sees User A's entitySettings
|
|
8
|
-
* - User B's async chain sees User B's entitySettings
|
|
9
|
-
* - No race conditions or cross-contamination
|
|
10
|
-
*/
|
|
11
|
-
export declare class AsyncLocalStorageRequestContextManager implements IRequestContextManager {
|
|
12
|
-
private storage;
|
|
13
|
-
/**
|
|
14
|
-
* Run a function with a request context.
|
|
15
|
-
* The context is automatically propagated through all async operations.
|
|
16
|
-
*
|
|
17
|
-
* @param context - The request context to use, or undefined to clear
|
|
18
|
-
* @param fn - The function to execute within the context
|
|
19
|
-
* @returns The result of the function
|
|
20
|
-
*/
|
|
21
|
-
run<T>(context: RequestContext | undefined, fn: () => T): T;
|
|
22
|
-
/**
|
|
23
|
-
* Get the currently active request context.
|
|
24
|
-
* Returns the context that was passed to the enclosing run() call.
|
|
25
|
-
*
|
|
26
|
-
* @returns The current request context or undefined if outside a run() scope
|
|
27
|
-
*/
|
|
28
|
-
active(): RequestContext | undefined;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Create and return a configured AsyncLocalStorage context manager.
|
|
32
|
-
* Called by index.node.ts during initialization.
|
|
33
|
-
*
|
|
34
|
-
* @returns A new AsyncLocalStorageRequestContextManager instance
|
|
35
|
-
*/
|
|
36
|
-
export declare function createNodeRequestContextManager(): IRequestContextManager;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.node.d.ts","sourceRoot":"","sources":["../src/request-context.node.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhF;;;;;;;;GAQG;AACH,qBAAa,sCAAuC,YAAW,sBAAsB;IACnF,OAAO,CAAC,OAAO,CAAuD;IAEtE;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAI3D;;;;;OAKG;IACH,MAAM,IAAI,cAAc,GAAG,SAAS;CAGrC;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,IAAI,sBAAsB,CAExE"}
|
package/dist/roles.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, Role, type World } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Interface representing the ownership state of servers.
|
|
4
|
-
* @property {Object.<string, World>} servers - The servers and their corresponding worlds, where the key is the server ID and the value is the World object.
|
|
5
|
-
*/
|
|
6
|
-
export interface ServerOwnershipState {
|
|
7
|
-
servers: {
|
|
8
|
-
[serverId: string]: World;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Retrieve the server role of a specified user entity within a given server.
|
|
13
|
-
*
|
|
14
|
-
* @param {IAgentRuntime} runtime - The runtime object containing necessary configurations and services.
|
|
15
|
-
* @param {string} entityId - The unique identifier of the user entity.
|
|
16
|
-
* @param {string} serverId - The unique identifier of the server.
|
|
17
|
-
* @returns {Promise<Role>} The role of the user entity within the server, resolved as a Promise.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getUserServerRole(runtime: IAgentRuntime, entityId: string, serverId: string): Promise<Role>;
|
|
20
|
-
/**
|
|
21
|
-
* Finds a server where the given user is the owner
|
|
22
|
-
*/
|
|
23
|
-
export declare function findWorldsForOwner(runtime: IAgentRuntime, entityId: string): Promise<World[] | null>;
|
package/dist/roles.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../src/roles.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAE,IAAI,EAAE,KAAK,KAAK,EAAa,MAAM,SAAS,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE;QACP,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CA0BzB"}
|