@elizaos/api-client 1.5.3-beta.3 → 1.5.5
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/index.d.ts +1102 -1
- package/dist/index.js +449 -144
- package/dist/index.js.map +1 -19
- package/package.json +6 -5
- package/dist/api-client/src/client.d.ts +0 -25
- package/dist/api-client/src/client.d.ts.map +0 -1
- package/dist/api-client/src/index.d.ts +0 -20
- package/dist/api-client/src/index.d.ts.map +0 -1
- package/dist/api-client/src/lib/base-client.d.ts +0 -31
- package/dist/api-client/src/lib/base-client.d.ts.map +0 -1
- package/dist/api-client/src/services/agents.d.ts +0 -107
- package/dist/api-client/src/services/agents.d.ts.map +0 -1
- package/dist/api-client/src/services/audio.d.ts +0 -48
- package/dist/api-client/src/services/audio.d.ts.map +0 -1
- package/dist/api-client/src/services/media.d.ts +0 -14
- package/dist/api-client/src/services/media.d.ts.map +0 -1
- package/dist/api-client/src/services/memory.d.ts +0 -107
- package/dist/api-client/src/services/memory.d.ts.map +0 -1
- package/dist/api-client/src/services/messaging.d.ts +0 -164
- package/dist/api-client/src/services/messaging.d.ts.map +0 -1
- package/dist/api-client/src/services/server.d.ts +0 -47
- package/dist/api-client/src/services/server.d.ts.map +0 -1
- package/dist/api-client/src/services/sessions.d.ts +0 -52
- package/dist/api-client/src/services/sessions.d.ts.map +0 -1
- package/dist/api-client/src/services/system.d.ts +0 -56
- package/dist/api-client/src/services/system.d.ts.map +0 -1
- package/dist/api-client/src/types/agents.d.ts +0 -67
- package/dist/api-client/src/types/agents.d.ts.map +0 -1
- package/dist/api-client/src/types/audio.d.ts +0 -42
- package/dist/api-client/src/types/audio.d.ts.map +0 -1
- package/dist/api-client/src/types/base.d.ts +0 -30
- package/dist/api-client/src/types/base.d.ts.map +0 -1
- package/dist/api-client/src/types/media.d.ts +0 -21
- package/dist/api-client/src/types/media.d.ts.map +0 -1
- package/dist/api-client/src/types/memory.d.ts +0 -43
- package/dist/api-client/src/types/memory.d.ts.map +0 -1
- package/dist/api-client/src/types/messaging.d.ts +0 -186
- package/dist/api-client/src/types/messaging.d.ts.map +0 -1
- package/dist/api-client/src/types/server.d.ts +0 -44
- package/dist/api-client/src/types/server.d.ts.map +0 -1
- package/dist/api-client/src/types/sessions.d.ts +0 -134
- package/dist/api-client/src/types/sessions.d.ts.map +0 -1
- package/dist/api-client/src/types/system.d.ts +0 -16
- package/dist/api-client/src/types/system.d.ts.map +0 -1
- package/dist/core/src/actions.d.ts +0 -23
- package/dist/core/src/actions.d.ts.map +0 -1
- package/dist/core/src/database.d.ts +0 -481
- package/dist/core/src/database.d.ts.map +0 -1
- package/dist/core/src/entities.d.ts +0 -49
- package/dist/core/src/entities.d.ts.map +0 -1
- package/dist/core/src/index.d.ts +0 -27
- package/dist/core/src/index.d.ts.map +0 -1
- package/dist/core/src/logger.d.ts +0 -47
- package/dist/core/src/logger.d.ts.map +0 -1
- package/dist/core/src/prompts.d.ts +0 -8
- package/dist/core/src/prompts.d.ts.map +0 -1
- package/dist/core/src/roles.d.ts +0 -30
- package/dist/core/src/roles.d.ts.map +0 -1
- package/dist/core/src/runtime.d.ts +0 -328
- package/dist/core/src/runtime.d.ts.map +0 -1
- package/dist/core/src/schemas/character.d.ts +0 -228
- package/dist/core/src/schemas/character.d.ts.map +0 -1
- package/dist/core/src/search.d.ts +0 -317
- package/dist/core/src/search.d.ts.map +0 -1
- package/dist/core/src/sentry/instrument.d.ts +0 -12
- package/dist/core/src/sentry/instrument.d.ts.map +0 -1
- package/dist/core/src/services.d.ts +0 -49
- package/dist/core/src/services.d.ts.map +0 -1
- package/dist/core/src/settings.d.ts +0 -87
- package/dist/core/src/settings.d.ts.map +0 -1
- package/dist/core/src/types/agent.d.ts +0 -98
- package/dist/core/src/types/agent.d.ts.map +0 -1
- package/dist/core/src/types/browser.d.ts +0 -127
- package/dist/core/src/types/browser.d.ts.map +0 -1
- package/dist/core/src/types/components.d.ts +0 -135
- package/dist/core/src/types/components.d.ts.map +0 -1
- package/dist/core/src/types/database.d.ts +0 -278
- package/dist/core/src/types/database.d.ts.map +0 -1
- package/dist/core/src/types/email.d.ts +0 -143
- package/dist/core/src/types/email.d.ts.map +0 -1
- package/dist/core/src/types/environment.d.ts +0 -109
- package/dist/core/src/types/environment.d.ts.map +0 -1
- package/dist/core/src/types/events.d.ts +0 -208
- package/dist/core/src/types/events.d.ts.map +0 -1
- package/dist/core/src/types/index.d.ts +0 -30
- package/dist/core/src/types/index.d.ts.map +0 -1
- package/dist/core/src/types/knowledge.d.ts +0 -60
- package/dist/core/src/types/knowledge.d.ts.map +0 -1
- package/dist/core/src/types/lp.d.ts +0 -115
- package/dist/core/src/types/lp.d.ts.map +0 -1
- package/dist/core/src/types/memory.d.ts +0 -165
- package/dist/core/src/types/memory.d.ts.map +0 -1
- package/dist/core/src/types/message.d.ts +0 -202
- package/dist/core/src/types/message.d.ts.map +0 -1
- package/dist/core/src/types/messaging.d.ts +0 -45
- package/dist/core/src/types/messaging.d.ts.map +0 -1
- package/dist/core/src/types/model.d.ts +0 -319
- package/dist/core/src/types/model.d.ts.map +0 -1
- package/dist/core/src/types/pdf.d.ts +0 -68
- package/dist/core/src/types/pdf.d.ts.map +0 -1
- package/dist/core/src/types/plugin.d.ts +0 -64
- package/dist/core/src/types/plugin.d.ts.map +0 -1
- package/dist/core/src/types/post.d.ts +0 -242
- package/dist/core/src/types/post.d.ts.map +0 -1
- package/dist/core/src/types/primitives.d.ts +0 -72
- package/dist/core/src/types/primitives.d.ts.map +0 -1
- package/dist/core/src/types/runtime.d.ts +0 -106
- package/dist/core/src/types/runtime.d.ts.map +0 -1
- package/dist/core/src/types/service.d.ts +0 -147
- package/dist/core/src/types/service.d.ts.map +0 -1
- package/dist/core/src/types/settings.d.ts +0 -30
- package/dist/core/src/types/settings.d.ts.map +0 -1
- package/dist/core/src/types/state.d.ts +0 -59
- package/dist/core/src/types/state.d.ts.map +0 -1
- package/dist/core/src/types/task.d.ts +0 -68
- package/dist/core/src/types/task.d.ts.map +0 -1
- package/dist/core/src/types/tee.d.ts +0 -97
- package/dist/core/src/types/tee.d.ts.map +0 -1
- package/dist/core/src/types/testing.d.ts +0 -29
- package/dist/core/src/types/testing.d.ts.map +0 -1
- package/dist/core/src/types/token.d.ts +0 -73
- package/dist/core/src/types/token.d.ts.map +0 -1
- package/dist/core/src/types/transcription.d.ts +0 -108
- package/dist/core/src/types/transcription.d.ts.map +0 -1
- package/dist/core/src/types/video.d.ts +0 -93
- package/dist/core/src/types/video.d.ts.map +0 -1
- package/dist/core/src/types/wallet.d.ts +0 -49
- package/dist/core/src/types/wallet.d.ts.map +0 -1
- package/dist/core/src/types/web-search.d.ts +0 -112
- package/dist/core/src/types/web-search.d.ts.map +0 -1
- package/dist/core/src/utils/buffer.d.ts +0 -105
- package/dist/core/src/utils/buffer.d.ts.map +0 -1
- package/dist/core/src/utils/environment.d.ts +0 -106
- package/dist/core/src/utils/environment.d.ts.map +0 -1
- package/dist/core/src/utils/server-health.d.ts +0 -23
- package/dist/core/src/utils/server-health.d.ts.map +0 -1
- package/dist/core/src/utils.d.ts +0 -177
- package/dist/core/src/utils.d.ts.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from './primitives';
|
|
2
|
-
import { Service } from './service';
|
|
3
|
-
import type { TokenBalance } from './token';
|
|
4
|
-
/**
|
|
5
|
-
* A standardized representation of a liquidity pool from any DEX.
|
|
6
|
-
*/
|
|
7
|
-
export type PoolInfo = {
|
|
8
|
-
id: string;
|
|
9
|
-
displayName?: string;
|
|
10
|
-
dex: string;
|
|
11
|
-
tokenA: {
|
|
12
|
-
mint: string;
|
|
13
|
-
symbol?: string;
|
|
14
|
-
reserve?: string;
|
|
15
|
-
decimals?: number;
|
|
16
|
-
};
|
|
17
|
-
tokenB: {
|
|
18
|
-
mint: string;
|
|
19
|
-
symbol?: string;
|
|
20
|
-
reserve?: string;
|
|
21
|
-
decimals?: number;
|
|
22
|
-
};
|
|
23
|
-
lpTokenMint?: string;
|
|
24
|
-
apr?: number;
|
|
25
|
-
apy?: number;
|
|
26
|
-
tvl?: number;
|
|
27
|
-
fee?: number;
|
|
28
|
-
metadata?: Metadata;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* A standardized representation of a user's position in a liquidity pool.
|
|
32
|
-
*/
|
|
33
|
-
export type LpPositionDetails = {
|
|
34
|
-
poolId: string;
|
|
35
|
-
dex: string;
|
|
36
|
-
lpTokenBalance: TokenBalance;
|
|
37
|
-
underlyingTokens: TokenBalance[];
|
|
38
|
-
valueUsd?: number;
|
|
39
|
-
accruedFees?: TokenBalance[];
|
|
40
|
-
rewards?: TokenBalance[];
|
|
41
|
-
metadata?: Metadata;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* A standardized result for blockchain transactions.
|
|
45
|
-
*/
|
|
46
|
-
export type TransactionResult = {
|
|
47
|
-
success: boolean;
|
|
48
|
-
transactionId?: string;
|
|
49
|
-
error?: string;
|
|
50
|
-
data?: any;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Abstract interface for a Liquidity Pool Service.
|
|
54
|
-
* DEX-specific plugins (e.g., for Orca, Raydium) must implement this service
|
|
55
|
-
* to allow the LP Manager to interact with them in a standardized way.
|
|
56
|
-
*/
|
|
57
|
-
export declare abstract class ILpService extends Service {
|
|
58
|
-
static readonly serviceType = "lp";
|
|
59
|
-
readonly capabilityDescription = "Provides standardized access to DEX liquidity pools.";
|
|
60
|
-
/**
|
|
61
|
-
* Returns the name of the DEX this service interacts with.
|
|
62
|
-
* @returns The name of the DEX (e.g., "Orca", "Raydium").
|
|
63
|
-
*/
|
|
64
|
-
abstract getDexName(): string;
|
|
65
|
-
/**
|
|
66
|
-
* Fetches a list of available liquidity pools from the DEX.
|
|
67
|
-
* @param tokenAMint - Optional: Filter pools by the mint address of the first token.
|
|
68
|
-
* @param tokenBMint - Optional: Filter pools by the mint address of the second token.
|
|
69
|
-
* @returns A promise that resolves to an array of standardized PoolInfo objects.
|
|
70
|
-
*/
|
|
71
|
-
abstract getPools(tokenAMint?: string, tokenBMint?: string): Promise<PoolInfo[]>;
|
|
72
|
-
/**
|
|
73
|
-
* Adds liquidity to a specified pool.
|
|
74
|
-
* @param params - The parameters for adding liquidity.
|
|
75
|
-
* @returns A promise resolving to a transaction result, including the LP tokens received.
|
|
76
|
-
*/
|
|
77
|
-
abstract addLiquidity(params: {
|
|
78
|
-
userVault: any;
|
|
79
|
-
poolId: string;
|
|
80
|
-
tokenAAmountLamports: string;
|
|
81
|
-
tokenBAmountLamports?: string;
|
|
82
|
-
slippageBps: number;
|
|
83
|
-
tickLowerIndex?: number;
|
|
84
|
-
tickUpperIndex?: number;
|
|
85
|
-
}): Promise<TransactionResult & {
|
|
86
|
-
lpTokensReceived?: TokenBalance;
|
|
87
|
-
}>;
|
|
88
|
-
/**
|
|
89
|
-
* Removes liquidity from a specified pool.
|
|
90
|
-
* @param params - The parameters for removing liquidity.
|
|
91
|
-
* @returns A promise resolving to a transaction result, including the tokens received.
|
|
92
|
-
*/
|
|
93
|
-
abstract removeLiquidity(params: {
|
|
94
|
-
userVault: any;
|
|
95
|
-
poolId: string;
|
|
96
|
-
lpTokenAmountLamports: string;
|
|
97
|
-
slippageBps: number;
|
|
98
|
-
}): Promise<TransactionResult & {
|
|
99
|
-
tokensReceived?: TokenBalance[];
|
|
100
|
-
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Fetches the details of a specific LP position for a user.
|
|
103
|
-
* @param userAccountPublicKey - The user's wallet public key.
|
|
104
|
-
* @param poolOrPositionIdentifier - The identifier for the pool or a specific position (e.g., position NFT mint).
|
|
105
|
-
* @returns A promise resolving to the position details or null if not found.
|
|
106
|
-
*/
|
|
107
|
-
abstract getLpPositionDetails(userAccountPublicKey: string, poolOrPositionIdentifier: string): Promise<LpPositionDetails | null>;
|
|
108
|
-
/**
|
|
109
|
-
* Fetches the latest market data (e.g., APY, TVL) for a list of pools.
|
|
110
|
-
* @param poolIds - An array of pool IDs to fetch data for.
|
|
111
|
-
* @returns A promise resolving to a map of pool IDs to their partial market data.
|
|
112
|
-
*/
|
|
113
|
-
abstract getMarketDataForPools(poolIds: string[]): Promise<Record<string, Partial<PoolInfo>>>;
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=lp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lp.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/lp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MA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C,eAAe,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,GAAG,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,qBAAqB,EAAE,MAAM,CAAC;QAC9B,WAAW,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,iBAAiB,GAAG;QAAE,cAAc,CAAC,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAEpE;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,CAC3B,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,MAAM,GAC/B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9F"}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import type { Content, UUID } from './primitives';
|
|
2
|
-
/**
|
|
3
|
-
* Memory type enumeration for built-in memory types
|
|
4
|
-
*/
|
|
5
|
-
export type MemoryTypeAlias = string;
|
|
6
|
-
/**
|
|
7
|
-
* Enumerates the built-in types of memories that can be stored and retrieved.
|
|
8
|
-
* - `DOCUMENT`: Represents a whole document or a large piece of text.
|
|
9
|
-
* - `FRAGMENT`: A chunk or segment of a `DOCUMENT`, often created for embedding and search.
|
|
10
|
-
* - `MESSAGE`: A conversational message, typically from a user or the agent.
|
|
11
|
-
* - `DESCRIPTION`: A descriptive piece of information, perhaps about an entity or concept.
|
|
12
|
-
* - `CUSTOM`: For any other type of memory not covered by the built-in types.
|
|
13
|
-
* This enum is used in `MemoryMetadata` to categorize memories and influences how they are processed or queried.
|
|
14
|
-
*/
|
|
15
|
-
export declare enum MemoryType {
|
|
16
|
-
DOCUMENT = "document",
|
|
17
|
-
FRAGMENT = "fragment",
|
|
18
|
-
MESSAGE = "message",
|
|
19
|
-
DESCRIPTION = "description",
|
|
20
|
-
CUSTOM = "custom"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Defines the scope of a memory, indicating its visibility and accessibility.
|
|
24
|
-
* - `shared`: The memory is accessible to multiple entities or across different contexts (e.g., a public fact).
|
|
25
|
-
* - `private`: The memory is specific to a single entity or a private context (e.g., a user's personal preference).
|
|
26
|
-
* - `room`: The memory is scoped to a specific room or channel.
|
|
27
|
-
* This is used in `MemoryMetadata` to control how memories are stored and retrieved based on context.
|
|
28
|
-
*/
|
|
29
|
-
export type MemoryScope = 'shared' | 'private' | 'room';
|
|
30
|
-
/**
|
|
31
|
-
* Base interface for all memory metadata types.
|
|
32
|
-
* It includes common properties for all memories, such as:
|
|
33
|
-
* - `type`: The kind of memory (e.g., `MemoryType.MESSAGE`, `MemoryType.DOCUMENT`).
|
|
34
|
-
* - `source`: An optional string indicating the origin of the memory (e.g., 'discord', 'user_input').
|
|
35
|
-
* - `sourceId`: An optional UUID linking to a source entity or object.
|
|
36
|
-
* - `scope`: The visibility scope of the memory (`shared`, `private`, or `room`).
|
|
37
|
-
* - `timestamp`: An optional numerical timestamp (e.g., milliseconds since epoch) of when the memory was created or relevant.
|
|
38
|
-
* - `tags`: Optional array of strings for categorizing or filtering memories.
|
|
39
|
-
* Specific metadata types like `DocumentMetadata` or `MessageMetadata` extend this base.
|
|
40
|
-
*/
|
|
41
|
-
export interface BaseMetadata {
|
|
42
|
-
type: MemoryTypeAlias;
|
|
43
|
-
source?: string;
|
|
44
|
-
sourceId?: UUID;
|
|
45
|
-
scope?: MemoryScope;
|
|
46
|
-
timestamp?: number;
|
|
47
|
-
tags?: string[];
|
|
48
|
-
}
|
|
49
|
-
export interface DocumentMetadata extends BaseMetadata {
|
|
50
|
-
type: MemoryType.DOCUMENT;
|
|
51
|
-
}
|
|
52
|
-
export interface FragmentMetadata extends BaseMetadata {
|
|
53
|
-
type: MemoryType.FRAGMENT;
|
|
54
|
-
documentId: UUID;
|
|
55
|
-
position: number;
|
|
56
|
-
}
|
|
57
|
-
export interface MessageMetadata extends BaseMetadata {
|
|
58
|
-
type: MemoryType.MESSAGE;
|
|
59
|
-
}
|
|
60
|
-
export interface DescriptionMetadata extends BaseMetadata {
|
|
61
|
-
type: MemoryType.DESCRIPTION;
|
|
62
|
-
}
|
|
63
|
-
export interface CustomMetadata extends BaseMetadata {
|
|
64
|
-
[key: string]: unknown;
|
|
65
|
-
}
|
|
66
|
-
export type MemoryMetadata = DocumentMetadata | FragmentMetadata | MessageMetadata | DescriptionMetadata | CustomMetadata;
|
|
67
|
-
/**
|
|
68
|
-
* Represents a stored memory/message
|
|
69
|
-
*/
|
|
70
|
-
export interface Memory {
|
|
71
|
-
/** Optional unique identifier */
|
|
72
|
-
id?: UUID;
|
|
73
|
-
/** Associated user ID */
|
|
74
|
-
entityId: UUID;
|
|
75
|
-
/** Associated agent ID */
|
|
76
|
-
agentId?: UUID;
|
|
77
|
-
/** Optional creation timestamp in milliseconds since epoch */
|
|
78
|
-
createdAt?: number;
|
|
79
|
-
/** Memory content */
|
|
80
|
-
content: Content;
|
|
81
|
-
/** Optional embedding vector for semantic search */
|
|
82
|
-
embedding?: number[];
|
|
83
|
-
/** Associated room ID */
|
|
84
|
-
roomId: UUID;
|
|
85
|
-
/** Associated world ID (optional) */
|
|
86
|
-
worldId?: UUID;
|
|
87
|
-
/** Whether memory is unique (used to prevent duplicates) */
|
|
88
|
-
unique?: boolean;
|
|
89
|
-
/** Embedding similarity score (set when retrieved via search) */
|
|
90
|
-
similarity?: number;
|
|
91
|
-
/** Metadata for the memory */
|
|
92
|
-
metadata?: MemoryMetadata;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Specialized memory type for messages with enhanced type checking
|
|
96
|
-
*/
|
|
97
|
-
export interface MessageMemory extends Memory {
|
|
98
|
-
metadata: MessageMetadata;
|
|
99
|
-
content: Content & {
|
|
100
|
-
text: string;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Factory function to create a new message memory with proper defaults
|
|
105
|
-
*/
|
|
106
|
-
export declare function createMessageMemory(params: {
|
|
107
|
-
id?: UUID;
|
|
108
|
-
entityId: UUID;
|
|
109
|
-
agentId?: UUID;
|
|
110
|
-
roomId: UUID;
|
|
111
|
-
content: Content & {
|
|
112
|
-
text: string;
|
|
113
|
-
};
|
|
114
|
-
embedding?: number[];
|
|
115
|
-
}): MessageMemory;
|
|
116
|
-
/**
|
|
117
|
-
* Type guard to check if a memory metadata is a DocumentMetadata
|
|
118
|
-
* @param metadata The metadata to check
|
|
119
|
-
* @returns True if the metadata is a DocumentMetadata
|
|
120
|
-
*/
|
|
121
|
-
export declare function isDocumentMetadata(metadata: MemoryMetadata): metadata is DocumentMetadata;
|
|
122
|
-
/**
|
|
123
|
-
* Type guard to check if a memory metadata is a FragmentMetadata
|
|
124
|
-
* @param metadata The metadata to check
|
|
125
|
-
* @returns True if the metadata is a FragmentMetadata
|
|
126
|
-
*/
|
|
127
|
-
export declare function isFragmentMetadata(metadata: MemoryMetadata): metadata is FragmentMetadata;
|
|
128
|
-
/**
|
|
129
|
-
* Type guard to check if a memory metadata is a MessageMetadata
|
|
130
|
-
* @param metadata The metadata to check
|
|
131
|
-
* @returns True if the metadata is a MessageMetadata
|
|
132
|
-
*/
|
|
133
|
-
export declare function isMessageMetadata(metadata: MemoryMetadata): metadata is MessageMetadata;
|
|
134
|
-
/**
|
|
135
|
-
* Type guard to check if a memory metadata is a DescriptionMetadata
|
|
136
|
-
* @param metadata The metadata to check
|
|
137
|
-
* @returns True if the metadata is a DescriptionMetadata
|
|
138
|
-
*/
|
|
139
|
-
export declare function isDescriptionMetadata(metadata: MemoryMetadata): metadata is DescriptionMetadata;
|
|
140
|
-
/**
|
|
141
|
-
* Type guard to check if a memory metadata is a CustomMetadata
|
|
142
|
-
* @param metadata The metadata to check
|
|
143
|
-
* @returns True if the metadata is a CustomMetadata
|
|
144
|
-
*/
|
|
145
|
-
export declare function isCustomMetadata(metadata: MemoryMetadata): metadata is CustomMetadata;
|
|
146
|
-
/**
|
|
147
|
-
* Memory type guard for document memories
|
|
148
|
-
*/
|
|
149
|
-
export declare function isDocumentMemory(memory: Memory): memory is Memory & {
|
|
150
|
-
metadata: DocumentMetadata;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Memory type guard for fragment memories
|
|
154
|
-
*/
|
|
155
|
-
export declare function isFragmentMemory(memory: Memory): memory is Memory & {
|
|
156
|
-
metadata: FragmentMetadata;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Safely access the text content of a memory
|
|
160
|
-
* @param memory The memory to extract text from
|
|
161
|
-
* @param defaultValue Optional default value if no text is found
|
|
162
|
-
* @returns The text content or default value
|
|
163
|
-
*/
|
|
164
|
-
export declare function getMemoryText(memory: Memory, defaultValue?: string): string;
|
|
165
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;;;;;;;GAQG;AACH,oBAAY,UAAU;IACpB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AACD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI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ED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,SAAK,GAAG,MAAM,CAEvE"}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { Service } from './service';
|
|
2
|
-
import type { UUID } from './primitives';
|
|
3
|
-
export interface MessageParticipant {
|
|
4
|
-
id: UUID;
|
|
5
|
-
name: string;
|
|
6
|
-
username?: string;
|
|
7
|
-
avatar?: string;
|
|
8
|
-
status?: 'online' | 'offline' | 'away' | 'busy';
|
|
9
|
-
}
|
|
10
|
-
export interface MessageAttachment {
|
|
11
|
-
id: UUID;
|
|
12
|
-
filename: string;
|
|
13
|
-
url: string;
|
|
14
|
-
mimeType: string;
|
|
15
|
-
size: number;
|
|
16
|
-
width?: number;
|
|
17
|
-
height?: number;
|
|
18
|
-
duration?: number;
|
|
19
|
-
thumbnail?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface MessageReaction {
|
|
22
|
-
emoji: string;
|
|
23
|
-
count: number;
|
|
24
|
-
users: UUID[];
|
|
25
|
-
hasReacted: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface MessageReference {
|
|
28
|
-
messageId: UUID;
|
|
29
|
-
channelId: UUID;
|
|
30
|
-
type: 'reply' | 'forward' | 'quote';
|
|
31
|
-
}
|
|
32
|
-
export interface MessageContent {
|
|
33
|
-
text?: string;
|
|
34
|
-
html?: string;
|
|
35
|
-
markdown?: string;
|
|
36
|
-
attachments?: MessageAttachment[];
|
|
37
|
-
reactions?: MessageReaction[];
|
|
38
|
-
reference?: MessageReference;
|
|
39
|
-
mentions?: UUID[];
|
|
40
|
-
embeds?: Array<{
|
|
41
|
-
title?: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
url?: string;
|
|
44
|
-
image?: string;
|
|
45
|
-
fields?: Array<{
|
|
46
|
-
name: string;
|
|
47
|
-
value: string;
|
|
48
|
-
inline?: boolean;
|
|
49
|
-
}>;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
export interface MessageInfo {
|
|
53
|
-
id: UUID;
|
|
54
|
-
channelId: UUID;
|
|
55
|
-
senderId: UUID;
|
|
56
|
-
content: MessageContent;
|
|
57
|
-
timestamp: Date;
|
|
58
|
-
edited?: Date;
|
|
59
|
-
deleted?: Date;
|
|
60
|
-
pinned?: boolean;
|
|
61
|
-
thread?: {
|
|
62
|
-
id: UUID;
|
|
63
|
-
messageCount: number;
|
|
64
|
-
participants: UUID[];
|
|
65
|
-
lastMessageAt: Date;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export interface MessageSendOptions {
|
|
69
|
-
replyTo?: UUID;
|
|
70
|
-
ephemeral?: boolean;
|
|
71
|
-
silent?: boolean;
|
|
72
|
-
scheduled?: Date;
|
|
73
|
-
thread?: UUID;
|
|
74
|
-
nonce?: string;
|
|
75
|
-
}
|
|
76
|
-
export interface MessageSearchOptions {
|
|
77
|
-
query?: string;
|
|
78
|
-
channelId?: UUID;
|
|
79
|
-
senderId?: UUID;
|
|
80
|
-
before?: Date;
|
|
81
|
-
after?: Date;
|
|
82
|
-
limit?: number;
|
|
83
|
-
offset?: number;
|
|
84
|
-
hasAttachments?: boolean;
|
|
85
|
-
pinned?: boolean;
|
|
86
|
-
mentions?: UUID;
|
|
87
|
-
}
|
|
88
|
-
export interface MessageChannel {
|
|
89
|
-
id: UUID;
|
|
90
|
-
name: string;
|
|
91
|
-
type: 'text' | 'voice' | 'dm' | 'group' | 'announcement' | 'thread';
|
|
92
|
-
description?: string;
|
|
93
|
-
participants?: MessageParticipant[];
|
|
94
|
-
permissions?: {
|
|
95
|
-
canSend: boolean;
|
|
96
|
-
canRead: boolean;
|
|
97
|
-
canDelete: boolean;
|
|
98
|
-
canPin: boolean;
|
|
99
|
-
canManage: boolean;
|
|
100
|
-
};
|
|
101
|
-
lastMessageAt?: Date;
|
|
102
|
-
messageCount?: number;
|
|
103
|
-
unreadCount?: number;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Interface for messaging services
|
|
107
|
-
*/
|
|
108
|
-
export declare abstract class IMessageService extends Service {
|
|
109
|
-
static readonly serviceType: "message";
|
|
110
|
-
readonly capabilityDescription = "Message sending, receiving, and management capabilities";
|
|
111
|
-
/**
|
|
112
|
-
* Send a message to a channel
|
|
113
|
-
* @param channelId - Channel ID
|
|
114
|
-
* @param content - Message content
|
|
115
|
-
* @param options - Send options
|
|
116
|
-
* @returns Promise resolving to message ID
|
|
117
|
-
*/
|
|
118
|
-
abstract sendMessage(channelId: UUID, content: MessageContent, options?: MessageSendOptions): Promise<UUID>;
|
|
119
|
-
/**
|
|
120
|
-
* Get messages from a channel
|
|
121
|
-
* @param channelId - Channel ID
|
|
122
|
-
* @param options - Search options
|
|
123
|
-
* @returns Promise resolving to array of messages
|
|
124
|
-
*/
|
|
125
|
-
abstract getMessages(channelId: UUID, options?: MessageSearchOptions): Promise<MessageInfo[]>;
|
|
126
|
-
/**
|
|
127
|
-
* Get a specific message by ID
|
|
128
|
-
* @param messageId - Message ID
|
|
129
|
-
* @returns Promise resolving to message
|
|
130
|
-
*/
|
|
131
|
-
abstract getMessage(messageId: UUID): Promise<MessageInfo>;
|
|
132
|
-
/**
|
|
133
|
-
* Edit a message
|
|
134
|
-
* @param messageId - Message ID
|
|
135
|
-
* @param content - New message content
|
|
136
|
-
* @returns Promise resolving when edit completes
|
|
137
|
-
*/
|
|
138
|
-
abstract editMessage(messageId: UUID, content: MessageContent): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
* Delete a message
|
|
141
|
-
* @param messageId - Message ID
|
|
142
|
-
* @returns Promise resolving when deletion completes
|
|
143
|
-
*/
|
|
144
|
-
abstract deleteMessage(messageId: UUID): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Add a reaction to a message
|
|
147
|
-
* @param messageId - Message ID
|
|
148
|
-
* @param emoji - Reaction emoji
|
|
149
|
-
* @returns Promise resolving when reaction is added
|
|
150
|
-
*/
|
|
151
|
-
abstract addReaction(messageId: UUID, emoji: string): Promise<void>;
|
|
152
|
-
/**
|
|
153
|
-
* Remove a reaction from a message
|
|
154
|
-
* @param messageId - Message ID
|
|
155
|
-
* @param emoji - Reaction emoji
|
|
156
|
-
* @returns Promise resolving when reaction is removed
|
|
157
|
-
*/
|
|
158
|
-
abstract removeReaction(messageId: UUID, emoji: string): Promise<void>;
|
|
159
|
-
/**
|
|
160
|
-
* Pin a message
|
|
161
|
-
* @param messageId - Message ID
|
|
162
|
-
* @returns Promise resolving when message is pinned
|
|
163
|
-
*/
|
|
164
|
-
abstract pinMessage(messageId: UUID): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Unpin a message
|
|
167
|
-
* @param messageId - Message ID
|
|
168
|
-
* @returns Promise resolving when message is unpinned
|
|
169
|
-
*/
|
|
170
|
-
abstract unpinMessage(messageId: UUID): Promise<void>;
|
|
171
|
-
/**
|
|
172
|
-
* Get available channels
|
|
173
|
-
* @returns Promise resolving to array of channels
|
|
174
|
-
*/
|
|
175
|
-
abstract getChannels(): Promise<MessageChannel[]>;
|
|
176
|
-
/**
|
|
177
|
-
* Get channel information
|
|
178
|
-
* @param channelId - Channel ID
|
|
179
|
-
* @returns Promise resolving to channel info
|
|
180
|
-
*/
|
|
181
|
-
abstract getChannel(channelId: UUID): Promise<MessageChannel>;
|
|
182
|
-
/**
|
|
183
|
-
* Create a new channel
|
|
184
|
-
* @param name - Channel name
|
|
185
|
-
* @param type - Channel type
|
|
186
|
-
* @param options - Channel options
|
|
187
|
-
* @returns Promise resolving to new channel ID
|
|
188
|
-
*/
|
|
189
|
-
abstract createChannel(name: string, type: MessageChannel['type'], options?: {
|
|
190
|
-
description?: string;
|
|
191
|
-
participants?: UUID[];
|
|
192
|
-
private?: boolean;
|
|
193
|
-
}): Promise<UUID>;
|
|
194
|
-
/**
|
|
195
|
-
* Search messages across channels
|
|
196
|
-
* @param query - Search query
|
|
197
|
-
* @param options - Search options
|
|
198
|
-
* @returns Promise resolving to search results
|
|
199
|
-
*/
|
|
200
|
-
abstract searchMessages(query: string, options?: MessageSearchOptions): Promise<MessageInfo[]>;
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE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AAM,CAAC;QACrB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GACA,OAAO,CAAC,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAC/F"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Content, UUID } from './primitives';
|
|
2
|
-
import type { IAgentRuntime } from './runtime';
|
|
3
|
-
/**
|
|
4
|
-
* Information describing the target of a message.
|
|
5
|
-
*/
|
|
6
|
-
export interface TargetInfo {
|
|
7
|
-
source: string;
|
|
8
|
-
roomId?: UUID;
|
|
9
|
-
channelId?: string;
|
|
10
|
-
serverId?: string;
|
|
11
|
-
entityId?: UUID;
|
|
12
|
-
threadId?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Function signature for handlers responsible for sending messages to specific platforms.
|
|
16
|
-
*/
|
|
17
|
-
export type SendHandlerFunction = (runtime: IAgentRuntime, target: TargetInfo, content: Content) => Promise<void>;
|
|
18
|
-
export declare enum SOCKET_MESSAGE_TYPE {
|
|
19
|
-
ROOM_JOINING = 1,
|
|
20
|
-
SEND_MESSAGE = 2,
|
|
21
|
-
MESSAGE = 3,
|
|
22
|
-
ACK = 4,
|
|
23
|
-
THINKING = 5,
|
|
24
|
-
CONTROL = 6
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Interface for control messages sent from the backend to the frontend
|
|
28
|
-
* to manage UI state and interaction capabilities
|
|
29
|
-
*/
|
|
30
|
-
export interface ControlMessage {
|
|
31
|
-
/** Message type identifier */
|
|
32
|
-
type: 'control';
|
|
33
|
-
/** Control message payload */
|
|
34
|
-
payload: {
|
|
35
|
-
/** Action to perform */
|
|
36
|
-
action: 'disable_input' | 'enable_input';
|
|
37
|
-
/** Optional target element identifier */
|
|
38
|
-
target?: string;
|
|
39
|
-
/** Additional optional parameters */
|
|
40
|
-
[key: string]: unknown;
|
|
41
|
-
};
|
|
42
|
-
/** Room ID to ensure signal is directed to the correct chat window */
|
|
43
|
-
roomId: UUID;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAEnB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,oBAAY,mBAAmB;IAC7B,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,OAAO,IAAI;IACX,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAC;IAEhB,8BAA8B;IAC9B,OAAO,EAAE;QACP,wBAAwB;QACxB,MAAM,EAAE,eAAe,GAAG,cAAc,CAAC;QAEzC,yCAAyC;QACzC,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,qCAAqC;QACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IAEF,sEAAsE;IACtE,MAAM,EAAE,IAAI,CAAC;CACd"}
|