@elizaos/plugin-sql 2.0.3-beta.2 → 2.0.3-beta.3
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 +3 -3
- package/src/dist/base.d.ts +1169 -0
- package/src/dist/browser/index.browser.d.ts +2 -0
- package/src/dist/browser/index.browser.js +31167 -0
- package/src/dist/browser/index.browser.js.map +76 -0
- package/src/dist/browser/index.d.ts +2 -0
- package/src/dist/cjs/index.d.ts +2 -0
- package/src/dist/cjs/index.node.cjs +13565 -0
- package/src/dist/cjs/index.node.cjs.map +75 -0
- package/src/dist/cjs/index.node.d.cts +2 -0
- package/src/dist/connector-credential-store.d.ts +48 -0
- package/src/dist/drizzle/index.d.ts +1 -0
- package/src/dist/drizzle/index.js +1 -0
- package/src/dist/index.d.ts +4 -0
- package/src/dist/index.js +2 -0
- package/src/dist/index.node.d.ts +53 -0
- package/src/dist/migration-service.d.ts +17 -0
- package/src/dist/migrations.d.ts +15 -0
- package/src/dist/node/index.d.ts +2 -0
- package/src/dist/node/index.node.d.ts +2 -0
- package/src/dist/node/index.node.js +13588 -0
- package/src/dist/node/index.node.js.map +75 -0
- package/src/dist/pg/adapter.d.ts +42 -0
- package/src/dist/pg/manager.d.ts +17 -0
- package/src/dist/pg/sslmode.d.ts +6 -0
- package/src/dist/pglite/adapter.d.ts +63 -0
- package/src/dist/pglite/errors.d.ts +20 -0
- package/src/dist/pglite/manager.d.ts +213 -0
- package/src/dist/rls.d.ts +13 -0
- package/src/dist/runtime-migrator/crypto-utils.d.ts +25 -0
- package/src/dist/runtime-migrator/drizzle-adapters/database-introspector.d.ts +58 -0
- package/src/dist/runtime-migrator/drizzle-adapters/diff-calculator.d.ts +77 -0
- package/src/dist/runtime-migrator/drizzle-adapters/snapshot-generator.d.ts +21 -0
- package/src/dist/runtime-migrator/drizzle-adapters/sql-generator.d.ts +38 -0
- package/src/dist/runtime-migrator/extension-manager.d.ts +6 -0
- package/src/dist/runtime-migrator/index.d.ts +8 -0
- package/src/dist/runtime-migrator/runtime-migrator.d.ts +95 -0
- package/src/dist/runtime-migrator/schema-transformer.d.ts +18 -0
- package/src/dist/runtime-migrator/storage/journal-storage.d.ts +10 -0
- package/src/dist/runtime-migrator/storage/migration-tracker.d.ts +13 -0
- package/src/dist/runtime-migrator/storage/snapshot-storage.d.ts +9 -0
- package/src/dist/runtime-migrator/types.d.ts +157 -0
- package/src/dist/schema/agent.d.ts +344 -0
- package/src/dist/schema/approvalRequests.d.ts +277 -0
- package/src/dist/schema/authAuditEvent.d.ts +153 -0
- package/src/dist/schema/authBootstrapJti.d.ts +49 -0
- package/src/dist/schema/authIdentity.d.ts +121 -0
- package/src/dist/schema/authOwnerBinding.d.ts +168 -0
- package/src/dist/schema/authOwnerLoginToken.d.ts +122 -0
- package/src/dist/schema/authSession.d.ts +225 -0
- package/src/dist/schema/cache.d.ts +97 -0
- package/src/dist/schema/channel.d.ts +177 -0
- package/src/dist/schema/channelParticipant.d.ts +41 -0
- package/src/dist/schema/component.d.ts +163 -0
- package/src/dist/schema/connectorAccounts.d.ts +981 -0
- package/src/dist/schema/embedding.d.ts +225 -0
- package/src/dist/schema/entity.d.ts +125 -0
- package/src/dist/schema/entityIdentity.d.ts +577 -0
- package/src/dist/schema/index.d.ts +35 -0
- package/src/dist/schema/index.js +1 -0
- package/src/dist/schema/log.d.ts +114 -0
- package/src/dist/schema/longTermMemories.d.ts +254 -0
- package/src/dist/schema/memory.d.ts +185 -0
- package/src/dist/schema/memoryAccessLogs.d.ts +109 -0
- package/src/dist/schema/message.d.ts +194 -0
- package/src/dist/schema/messageServer.d.ts +126 -0
- package/src/dist/schema/messageServerAgent.d.ts +41 -0
- package/src/dist/schema/pairingAllowlist.d.ts +113 -0
- package/src/dist/schema/pairingRequest.d.ts +147 -0
- package/src/dist/schema/participant.d.ts +114 -0
- package/src/dist/schema/relationship.d.ts +156 -0
- package/src/dist/schema/room.d.ts +195 -0
- package/src/dist/schema/server.d.ts +64 -0
- package/src/dist/schema/sessionSummaries.d.ts +273 -0
- package/src/dist/schema/tasks.d.ts +225 -0
- package/src/dist/schema/types.d.ts +68 -0
- package/src/dist/schema/world.d.ts +114 -0
- package/src/dist/services/advanced-memory-storage.d.ts +36 -0
- package/src/dist/stores/connectorAccount.store.d.ts +64 -0
- package/src/dist/stores/types.d.ts +25 -0
- package/src/dist/types.d.ts +13 -0
- package/src/dist/utils/string-to-uuid.d.ts +2 -0
- package/src/dist/utils.d.ts +4 -0
- package/src/dist/utils.node.d.ts +4 -0
- package/src/dist/write-back/index.d.ts +56 -0
|
@@ -0,0 +1,1169 @@
|
|
|
1
|
+
import { type AccessContext, type Agent, type AgentRunSummaryResult, type AppendConnectorAccountAuditEventParams, type Component, type ConnectorAccountAuditEventRecord, type ConnectorAccountCredentialRefRecord, type ConnectorAccountRecord, type ConnectorOwnerBindingLookup, type ConnectorOwnerBindingRecord, type ConsumeOAuthFlowStateParams, type CreateOAuthFlowStateParams, DatabaseAdapter, type DeleteConnectorAccountParams, type EntitiesForRoomsResult, type Entity, type GetConnectorAccountCredentialRefParams, type GetConnectorAccountParams, type IDatabaseAdapter, type JsonValue, type ListConnectorAccountCredentialRefsParams, type ListConnectorAccountsParams, type Log, type LogBody, type Memory, type MemoryMetadata, type Metadata, type OAuthFlowRecord, type PairingAllowlistEntry, type PairingAllowlistsResult, type PairingChannel, type PairingRequest, type PairingRequestsResult, type Participant, type ParticipantsForRoomsResult, type ParticipantUpdateFields, type ParticipantUserState, type PatchOp, type Relationship, type Room, type RunStatus, type SetConnectorAccountCredentialRefParams, type Task, type UpsertConnectorAccountParams, type UUID, type World } from "@elizaos/core";
|
|
2
|
+
interface GetOAuthFlowStateParams {
|
|
3
|
+
state?: string;
|
|
4
|
+
stateHash?: string;
|
|
5
|
+
flowId?: string;
|
|
6
|
+
agentId?: string;
|
|
7
|
+
provider?: string;
|
|
8
|
+
includeConsumed?: boolean;
|
|
9
|
+
includeExpired?: boolean;
|
|
10
|
+
now?: number | Date;
|
|
11
|
+
}
|
|
12
|
+
interface UpdateOAuthFlowStateParams {
|
|
13
|
+
state?: string;
|
|
14
|
+
stateHash?: string;
|
|
15
|
+
flowId?: string;
|
|
16
|
+
agentId?: string;
|
|
17
|
+
provider?: string;
|
|
18
|
+
accountId?: string | null;
|
|
19
|
+
redirectUri?: string | null;
|
|
20
|
+
codeVerifierRef?: string | null;
|
|
21
|
+
scopes?: string[];
|
|
22
|
+
metadata?: Record<string, JsonValue>;
|
|
23
|
+
expiresAt?: number | Date;
|
|
24
|
+
consumedAt?: number | Date | null;
|
|
25
|
+
consumedBy?: string | null;
|
|
26
|
+
}
|
|
27
|
+
interface DeleteOAuthFlowStateParams {
|
|
28
|
+
state?: string;
|
|
29
|
+
stateHash?: string;
|
|
30
|
+
flowId?: string;
|
|
31
|
+
agentId?: string;
|
|
32
|
+
provider?: string;
|
|
33
|
+
}
|
|
34
|
+
type CountMemoriesParams = {
|
|
35
|
+
roomIds?: UUID[];
|
|
36
|
+
unique?: boolean;
|
|
37
|
+
tableName?: string;
|
|
38
|
+
entityId?: UUID;
|
|
39
|
+
agentId?: UUID;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
import type { DatabaseMigrationService } from "./migration-service.js";
|
|
43
|
+
import { type EmbeddingDimensionColumn } from "./schema/embedding.js";
|
|
44
|
+
import { ConnectorAccountStore, type ListConnectorAccountAuditEventsParams } from "./stores/connectorAccount.store";
|
|
45
|
+
import type { DrizzleDatabase } from "./types.js";
|
|
46
|
+
export declare abstract class BaseDrizzleAdapter extends DatabaseAdapter<DrizzleDatabase> {
|
|
47
|
+
protected readonly maxRetries: number;
|
|
48
|
+
protected readonly baseDelay: number;
|
|
49
|
+
protected readonly maxDelay: number;
|
|
50
|
+
protected readonly jitterMax: number;
|
|
51
|
+
protected embeddingDimension: EmbeddingDimensionColumn;
|
|
52
|
+
protected migrationService?: DatabaseMigrationService;
|
|
53
|
+
private migrationRunPromise;
|
|
54
|
+
private _connectorAccountStore?;
|
|
55
|
+
protected getConnectorAccountStore(): ConnectorAccountStore;
|
|
56
|
+
protected abstract withDatabase<T>(operation: () => Promise<T>): Promise<T>;
|
|
57
|
+
abstract withEntityContext<T>(entityId: UUID | null, callback: (tx: DrizzleDatabase) => Promise<T>): Promise<T>;
|
|
58
|
+
abstract init(): Promise<void>;
|
|
59
|
+
abstract close(): Promise<void>;
|
|
60
|
+
initialize(): Promise<void>;
|
|
61
|
+
runPluginMigrations(plugins: Array<{
|
|
62
|
+
name: string;
|
|
63
|
+
schema?: Record<string, unknown>;
|
|
64
|
+
}>, options?: {
|
|
65
|
+
verbose?: boolean;
|
|
66
|
+
force?: boolean;
|
|
67
|
+
dryRun?: boolean;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
getDatabase(): unknown;
|
|
70
|
+
protected agentId: UUID;
|
|
71
|
+
constructor(agentId: UUID);
|
|
72
|
+
private normalizeEntityNames;
|
|
73
|
+
private isValidUUID;
|
|
74
|
+
private normalizeWorldData;
|
|
75
|
+
private mapWorldResult;
|
|
76
|
+
/**
|
|
77
|
+
* Executes the given operation with retry logic.
|
|
78
|
+
* @template T
|
|
79
|
+
* @param {() => Promise<T>} operation - The operation to be executed.
|
|
80
|
+
* @returns {Promise<T>} A promise that resolves with the result of the operation.
|
|
81
|
+
*/
|
|
82
|
+
protected withRetry<T>(operation: () => Promise<T>): Promise<T>;
|
|
83
|
+
/**
|
|
84
|
+
* Asynchronously ensures that the given embedding dimension is valid for the agent.
|
|
85
|
+
*
|
|
86
|
+
* @param {number} dimension - The dimension to ensure for the embedding.
|
|
87
|
+
* @returns {Promise<void>} - Resolves once the embedding dimension is ensured.
|
|
88
|
+
*/
|
|
89
|
+
ensureEmbeddingDimension(dimension: number): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Asynchronously retrieves an agent by their ID from the database.
|
|
92
|
+
* @param {UUID} agentId - The ID of the agent to retrieve.
|
|
93
|
+
* @returns {Promise<Agent | null>} A promise that resolves to the retrieved agent or null if not found.
|
|
94
|
+
*/
|
|
95
|
+
getAgent(agentId: UUID): Promise<Agent | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Asynchronously retrieves a list of agents from the database.
|
|
98
|
+
*
|
|
99
|
+
* @returns {Promise<Partial<Agent>[]>} A Promise that resolves to an array of Agent objects.
|
|
100
|
+
*/
|
|
101
|
+
getAgents(): Promise<Partial<Agent>[]>;
|
|
102
|
+
getAgentsByIds(agentIds: UUID[]): Promise<Agent[]>;
|
|
103
|
+
createAgents(agents: Partial<Agent>[]): Promise<UUID[]>;
|
|
104
|
+
updateAgents(updates: Array<{
|
|
105
|
+
agentId: UUID;
|
|
106
|
+
agent: Partial<Agent>;
|
|
107
|
+
}>): Promise<boolean>;
|
|
108
|
+
upsertAgents(agents: Partial<Agent>[]): Promise<void>;
|
|
109
|
+
deleteAgents(agentIds: UUID[]): Promise<boolean>;
|
|
110
|
+
/**
|
|
111
|
+
* Asynchronously creates a new agent record in the database.
|
|
112
|
+
*
|
|
113
|
+
* @param {Partial<Agent>} agent The agent object to be created.
|
|
114
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the operation.
|
|
115
|
+
*/
|
|
116
|
+
createAgent(agent: Agent): Promise<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Updates an agent in the database with the provided agent ID and data.
|
|
119
|
+
* @param {UUID} agentId - The unique identifier of the agent to update.
|
|
120
|
+
* @param {Partial<Agent>} agent - The partial agent object containing the fields to update.
|
|
121
|
+
* @returns {Promise<boolean>} - A boolean indicating if the agent was successfully updated.
|
|
122
|
+
*/
|
|
123
|
+
updateAgent(agentId: UUID, agent: Partial<Agent>): Promise<boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* Merges updated agent settings with existing settings in the database,
|
|
126
|
+
* with special handling for nested objects like secrets.
|
|
127
|
+
* @param tx - The database transaction
|
|
128
|
+
* @param agentId - The ID of the agent
|
|
129
|
+
* @param updatedSettings - The settings object with updates
|
|
130
|
+
* @returns The merged settings object
|
|
131
|
+
* @private
|
|
132
|
+
*/
|
|
133
|
+
private mergeAgentSettings;
|
|
134
|
+
/**
|
|
135
|
+
* Asynchronously deletes an agent with the specified UUID and all related entries.
|
|
136
|
+
*
|
|
137
|
+
* @param {UUID} agentId - The UUID of the agent to be deleted.
|
|
138
|
+
* @returns {Promise<boolean>} - A boolean indicating if the deletion was successful.
|
|
139
|
+
*/
|
|
140
|
+
deleteAgent(agentId: UUID): Promise<boolean>;
|
|
141
|
+
/**
|
|
142
|
+
* Count all agents in the database
|
|
143
|
+
* Used primarily for maintenance and cleanup operations
|
|
144
|
+
*/
|
|
145
|
+
/**
|
|
146
|
+
* Asynchronously counts the number of agents in the database.
|
|
147
|
+
* @returns {Promise<number>} A Promise that resolves to the number of agents in the database.
|
|
148
|
+
*/
|
|
149
|
+
countAgents(): Promise<number>;
|
|
150
|
+
/**
|
|
151
|
+
* Clean up the agents table by removing all agents
|
|
152
|
+
* This is used during server startup to ensure no orphaned agents exist
|
|
153
|
+
* from previous crashes or improper shutdowns
|
|
154
|
+
*/
|
|
155
|
+
cleanupAgents(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Asynchronously retrieves an entity and its components by entity IDs.
|
|
158
|
+
* @param {UUID[]} entityIds - The unique identifiers of the entities to retrieve.
|
|
159
|
+
* @returns {Promise<Entity[]>} A Promise that resolves to the entity with its components.
|
|
160
|
+
*/
|
|
161
|
+
getEntitiesByIds(entityIds: UUID[]): Promise<Entity[]>;
|
|
162
|
+
/**
|
|
163
|
+
* Asynchronously retrieves all entities for a given room, optionally including their components.
|
|
164
|
+
* @param {UUID} roomId - The unique identifier of the room to get entities for
|
|
165
|
+
* @param {boolean} [includeComponents] - Whether to include component data for each entity
|
|
166
|
+
* @returns {Promise<Entity[]>} A Promise that resolves to an array of entities in the room
|
|
167
|
+
*/
|
|
168
|
+
getEntitiesForRoom(roomId: UUID, includeComponents?: boolean): Promise<Entity[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Asynchronously creates new entities in the database.
|
|
171
|
+
* @param {Entity[]} entities - The entity objects to be created.
|
|
172
|
+
* @returns {Promise<UUID[]>} The IDs of the created entities.
|
|
173
|
+
*/
|
|
174
|
+
createEntities(entities: Entity[]): Promise<UUID[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Asynchronously ensures an entity exists, creating it if it doesn't
|
|
177
|
+
* @param entity The entity to ensure exists
|
|
178
|
+
* @returns Promise resolving to boolean indicating success
|
|
179
|
+
*/
|
|
180
|
+
protected ensureEntityExists(entity: Entity): Promise<boolean>;
|
|
181
|
+
/**
|
|
182
|
+
* Asynchronously updates an entity in the database.
|
|
183
|
+
* @param {Entity} entity - The entity object to be updated.
|
|
184
|
+
* @returns {Promise<void>} A Promise that resolves when the entity is updated.
|
|
185
|
+
*/
|
|
186
|
+
updateEntity(entity: Entity): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Asynchronously deletes an entity from the database based on the provided ID.
|
|
189
|
+
* @param {UUID} entityId - The ID of the entity to delete.
|
|
190
|
+
* @returns {Promise<void>} A Promise that resolves when the entity is deleted.
|
|
191
|
+
*/
|
|
192
|
+
deleteEntity(entityId: UUID): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Asynchronously retrieves entities by their names and agentId.
|
|
195
|
+
* @param {Object} params - The parameters for retrieving entities.
|
|
196
|
+
* @param {string[]} params.names - The names to search for.
|
|
197
|
+
* @param {UUID} params.agentId - The agent ID to filter by.
|
|
198
|
+
* @returns {Promise<Entity[]>} A Promise that resolves to an array of entities.
|
|
199
|
+
*/
|
|
200
|
+
getEntitiesByNames(params: {
|
|
201
|
+
names: string[];
|
|
202
|
+
agentId: UUID;
|
|
203
|
+
}): Promise<Entity[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Asynchronously searches for entities by name with fuzzy matching.
|
|
206
|
+
* @param {Object} params - The parameters for searching entities.
|
|
207
|
+
* @param {string} params.query - The search query.
|
|
208
|
+
* @param {UUID} params.agentId - The agent ID to filter by.
|
|
209
|
+
* @param {number} params.limit - The maximum number of results to return.
|
|
210
|
+
* @returns {Promise<Entity[]>} A Promise that resolves to an array of entities.
|
|
211
|
+
*/
|
|
212
|
+
searchEntitiesByName(params: {
|
|
213
|
+
query: string;
|
|
214
|
+
agentId: UUID;
|
|
215
|
+
limit?: number;
|
|
216
|
+
}): Promise<Entity[]>;
|
|
217
|
+
getComponent(entityId: UUID, type: string, worldId?: UUID, sourceEntityId?: UUID): Promise<Component | null>;
|
|
218
|
+
/**
|
|
219
|
+
* Asynchronously retrieves all components for a given entity, optionally filtered by world and source entity.
|
|
220
|
+
* @param {UUID} entityId - The unique identifier of the entity to retrieve components for
|
|
221
|
+
* @param {UUID} [worldId] - Optional world ID to filter components by
|
|
222
|
+
* @param {UUID} [sourceEntityId] - Optional source entity ID to filter components by
|
|
223
|
+
* @returns {Promise<Component[]>} A Promise that resolves to an array of components
|
|
224
|
+
*/
|
|
225
|
+
getComponents(entityId: UUID, worldId?: UUID, sourceEntityId?: UUID): Promise<Component[]>;
|
|
226
|
+
/**
|
|
227
|
+
* Asynchronously creates a new component in the database.
|
|
228
|
+
* @param {Component} component - The component object to be created.
|
|
229
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating the success of the operation.
|
|
230
|
+
*/
|
|
231
|
+
createComponent(component: Component): Promise<boolean>;
|
|
232
|
+
/**
|
|
233
|
+
* Asynchronously updates an existing component in the database.
|
|
234
|
+
* @param {Component} component - The component object to be updated.
|
|
235
|
+
* @returns {Promise<void>} A Promise that resolves when the component is updated.
|
|
236
|
+
*/
|
|
237
|
+
updateComponent(component: Component): Promise<void>;
|
|
238
|
+
/**
|
|
239
|
+
* Asynchronously deletes a component from the database.
|
|
240
|
+
* @param {UUID} componentId - The unique identifier of the component to delete.
|
|
241
|
+
* @returns {Promise<void>} A Promise that resolves when the component is deleted.
|
|
242
|
+
*/
|
|
243
|
+
deleteComponent(componentId: UUID): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Asynchronously retrieves memories from the database based on the provided parameters.
|
|
246
|
+
* @param {Object} params - The parameters for retrieving memories.
|
|
247
|
+
* @param {UUID} params.roomId - The ID of the room to retrieve memories for.
|
|
248
|
+
* @param {number} [params.count] - The maximum number of memories to retrieve.
|
|
249
|
+
* @param {number} [params.offset] - The offset for pagination.
|
|
250
|
+
* @param {boolean} [params.unique] - Whether to retrieve unique memories only.
|
|
251
|
+
* @param {string} [params.tableName] - The name of the table to retrieve memories from.
|
|
252
|
+
* @param {number} [params.start] - The start date to retrieve memories from.
|
|
253
|
+
* @param {number} [params.end] - The end date to retrieve memories from.
|
|
254
|
+
* @returns {Promise<Memory[]>} A Promise that resolves to an array of memories.
|
|
255
|
+
*/
|
|
256
|
+
getMemories(params: {
|
|
257
|
+
entityId?: UUID;
|
|
258
|
+
agentId?: UUID;
|
|
259
|
+
limit?: number;
|
|
260
|
+
count?: number;
|
|
261
|
+
offset?: number;
|
|
262
|
+
unique?: boolean;
|
|
263
|
+
tableName: string;
|
|
264
|
+
start?: number;
|
|
265
|
+
end?: number;
|
|
266
|
+
roomId?: UUID;
|
|
267
|
+
worldId?: UUID;
|
|
268
|
+
/**
|
|
269
|
+
* When `false`, skip fetching/materializing the embedding vector. List and
|
|
270
|
+
* browse callers discard embeddings, so fetching the 384-float column for
|
|
271
|
+
* every row (via the embeddingTable join) is pure waste. Defaults to `true`
|
|
272
|
+
* (embeddings included) to preserve existing behavior.
|
|
273
|
+
*/
|
|
274
|
+
includeEmbedding?: boolean;
|
|
275
|
+
accessContext?: AccessContext;
|
|
276
|
+
}): Promise<Memory[]>;
|
|
277
|
+
/**
|
|
278
|
+
* Asynchronously retrieves memories from the database based on the provided parameters.
|
|
279
|
+
* @param {Object} params - The parameters for retrieving memories.
|
|
280
|
+
* @param {UUID[]} params.roomIds - The IDs of the rooms to retrieve memories for.
|
|
281
|
+
* @param {string} params.tableName - The name of the table to retrieve memories from.
|
|
282
|
+
* @param {number} [params.limit] - The maximum number of memories to retrieve.
|
|
283
|
+
* @returns {Promise<Memory[]>} A Promise that resolves to an array of memories.
|
|
284
|
+
*/
|
|
285
|
+
getMemoriesByRoomIds(params: {
|
|
286
|
+
roomIds: UUID[];
|
|
287
|
+
tableName: string;
|
|
288
|
+
limit?: number;
|
|
289
|
+
accessContext?: AccessContext;
|
|
290
|
+
}): Promise<Memory[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Asynchronously retrieves a memory by its unique identifier.
|
|
293
|
+
* @param {UUID} id - The unique identifier of the memory to retrieve.
|
|
294
|
+
* @returns {Promise<Memory | null>} A Promise that resolves to the memory if found, null otherwise.
|
|
295
|
+
*/
|
|
296
|
+
getMemoryById(id: UUID): Promise<Memory | null>;
|
|
297
|
+
/**
|
|
298
|
+
* Asynchronously retrieves memories from the database based on the provided parameters.
|
|
299
|
+
* @param {Object} params - The parameters for retrieving memories.
|
|
300
|
+
* @param {UUID[]} params.memoryIds - The IDs of the memories to retrieve.
|
|
301
|
+
* @param {string} [params.tableName] - The name of the table to retrieve memories from.
|
|
302
|
+
* @returns {Promise<Memory[]>} A Promise that resolves to an array of memories.
|
|
303
|
+
*/
|
|
304
|
+
getMemoriesByIds(memoryIds: UUID[], tableName?: string): Promise<Memory[]>;
|
|
305
|
+
/**
|
|
306
|
+
* Asynchronously retrieves cached embeddings from the database based on the provided parameters.
|
|
307
|
+
* @param {Object} opts - The parameters for retrieving cached embeddings.
|
|
308
|
+
* @param {string} opts.query_table_name - The name of the table to retrieve embeddings from.
|
|
309
|
+
* @param {number} opts.query_threshold - The threshold for the levenshtein distance.
|
|
310
|
+
* @param {string} opts.query_input - The input string to search for.
|
|
311
|
+
* @param {string} opts.query_field_name - The name of the field to retrieve embeddings from.
|
|
312
|
+
* @param {string} opts.query_field_sub_name - The name of the sub-field to retrieve embeddings from.
|
|
313
|
+
* @param {number} opts.query_match_count - The maximum number of matches to retrieve.
|
|
314
|
+
* @returns {Promise<{ embedding: number[]; levenshtein_score: number }[]>} A Promise that resolves to an array of cached embeddings.
|
|
315
|
+
*/
|
|
316
|
+
getCachedEmbeddings(opts: {
|
|
317
|
+
query_table_name: string;
|
|
318
|
+
query_threshold: number;
|
|
319
|
+
query_input: string;
|
|
320
|
+
query_field_name: string;
|
|
321
|
+
query_field_sub_name: string;
|
|
322
|
+
query_match_count: number;
|
|
323
|
+
}): Promise<{
|
|
324
|
+
embedding: number[];
|
|
325
|
+
levenshtein_score: number;
|
|
326
|
+
}[]>;
|
|
327
|
+
/**
|
|
328
|
+
* Asynchronously logs an event in the database.
|
|
329
|
+
* @param {Object} params - The parameters for logging an event.
|
|
330
|
+
* @param {Object} params.body - The body of the event to log.
|
|
331
|
+
* @param {UUID} params.entityId - The ID of the entity associated with the event.
|
|
332
|
+
* @param {UUID} params.roomId - The ID of the room associated with the event.
|
|
333
|
+
* @param {string} params.type - The type of the event to log.
|
|
334
|
+
* @returns {Promise<void>} A Promise that resolves when the event is logged.
|
|
335
|
+
*/
|
|
336
|
+
log(params: {
|
|
337
|
+
body: LogBody;
|
|
338
|
+
entityId: UUID;
|
|
339
|
+
roomId: UUID;
|
|
340
|
+
type: string;
|
|
341
|
+
}): Promise<void>;
|
|
342
|
+
/**
|
|
343
|
+
* Sanitizes a JSON object by replacing problematic Unicode escape sequences
|
|
344
|
+
* that could cause errors during JSON serialization/storage
|
|
345
|
+
*
|
|
346
|
+
* @param value - The value to sanitize
|
|
347
|
+
* @returns The sanitized value
|
|
348
|
+
*/
|
|
349
|
+
private sanitizeJsonObject;
|
|
350
|
+
/**
|
|
351
|
+
* Asynchronously retrieves logs from the database based on the provided parameters.
|
|
352
|
+
* @param {Object} params - The parameters for retrieving logs.
|
|
353
|
+
* @param {UUID} params.entityId - The ID of the entity associated with the logs.
|
|
354
|
+
* @param {UUID} [params.roomId] - The ID of the room associated with the logs.
|
|
355
|
+
* @param {string} [params.type] - The type of the logs to retrieve.
|
|
356
|
+
* @param {number} [params.count] - The maximum number of logs to retrieve.
|
|
357
|
+
* @param {number} [params.offset] - The offset to retrieve logs from.
|
|
358
|
+
* @returns {Promise<Log[]>} A Promise that resolves to an array of logs.
|
|
359
|
+
*/
|
|
360
|
+
getLogs(params: {
|
|
361
|
+
entityId?: UUID;
|
|
362
|
+
roomId?: UUID;
|
|
363
|
+
type?: string;
|
|
364
|
+
count?: number;
|
|
365
|
+
offset?: number;
|
|
366
|
+
}): Promise<Log[]>;
|
|
367
|
+
getAgentRunSummaries(params?: {
|
|
368
|
+
limit?: number;
|
|
369
|
+
roomId?: UUID;
|
|
370
|
+
status?: RunStatus | "all";
|
|
371
|
+
from?: number;
|
|
372
|
+
to?: number;
|
|
373
|
+
entityId?: UUID;
|
|
374
|
+
}): Promise<AgentRunSummaryResult>;
|
|
375
|
+
/**
|
|
376
|
+
* Asynchronously deletes a log from the database based on the provided parameters.
|
|
377
|
+
* @param {UUID} logId - The ID of the log to delete.
|
|
378
|
+
* @returns {Promise<void>} A Promise that resolves when the log is deleted.
|
|
379
|
+
*/
|
|
380
|
+
deleteLog(logId: UUID): Promise<void>;
|
|
381
|
+
/**
|
|
382
|
+
* Asynchronously searches for memories in the database based on the provided parameters.
|
|
383
|
+
* @param {Object} params - The parameters for searching for memories.
|
|
384
|
+
* @param {string} params.tableName - The name of the table to search for memories in.
|
|
385
|
+
* @param {number[]} params.embedding - The embedding to search for.
|
|
386
|
+
* @param {number} [params.match_threshold] - The threshold for the cosine distance.
|
|
387
|
+
* @param {number} [params.count] - The maximum number of memories to retrieve.
|
|
388
|
+
* @param {boolean} [params.unique] - Whether to retrieve unique memories only.
|
|
389
|
+
* @param {string} [params.query] - Optional query string for potential reranking.
|
|
390
|
+
* @param {UUID} [params.roomId] - Optional room ID to filter by.
|
|
391
|
+
* @param {UUID} [params.worldId] - Optional world ID to filter by.
|
|
392
|
+
* @param {UUID} [params.entityId] - Optional entity ID to filter by.
|
|
393
|
+
* @returns {Promise<Memory[]>} A Promise that resolves to an array of memories.
|
|
394
|
+
*/
|
|
395
|
+
searchMemories(params: {
|
|
396
|
+
tableName: string;
|
|
397
|
+
embedding: number[];
|
|
398
|
+
match_threshold?: number;
|
|
399
|
+
count?: number;
|
|
400
|
+
unique?: boolean;
|
|
401
|
+
query?: string;
|
|
402
|
+
roomId?: UUID;
|
|
403
|
+
worldId?: UUID;
|
|
404
|
+
entityId?: UUID;
|
|
405
|
+
accessContext?: AccessContext;
|
|
406
|
+
}): Promise<Memory[]>;
|
|
407
|
+
/**
|
|
408
|
+
* Asynchronously searches for memories in the database based on the provided parameters.
|
|
409
|
+
* @param {number[]} embedding - The embedding to search for.
|
|
410
|
+
* @param {Object} params - The parameters for searching for memories.
|
|
411
|
+
* @param {number} [params.match_threshold] - The threshold for the cosine distance.
|
|
412
|
+
* @param {number} [params.count] - The maximum number of memories to retrieve.
|
|
413
|
+
* @param {UUID} [params.roomId] - Optional room ID to filter by.
|
|
414
|
+
* @param {UUID} [params.worldId] - Optional world ID to filter by.
|
|
415
|
+
* @param {UUID} [params.entityId] - Optional entity ID to filter by.
|
|
416
|
+
* @param {boolean} [params.unique] - Whether to retrieve unique memories only.
|
|
417
|
+
* @param {string} [params.tableName] - The name of the table to search for memories in.
|
|
418
|
+
* @returns {Promise<Memory[]>} A Promise that resolves to an array of memories.
|
|
419
|
+
*/
|
|
420
|
+
searchMemoriesByEmbedding(embedding: number[], params: {
|
|
421
|
+
match_threshold?: number;
|
|
422
|
+
count?: number;
|
|
423
|
+
roomId?: UUID;
|
|
424
|
+
worldId?: UUID;
|
|
425
|
+
entityId?: UUID;
|
|
426
|
+
unique?: boolean;
|
|
427
|
+
tableName: string;
|
|
428
|
+
}): Promise<Memory[]>;
|
|
429
|
+
/**
|
|
430
|
+
* Asynchronously creates a new memory in the database.
|
|
431
|
+
* @param {Memory & { metadata?: MemoryMetadata }} memory - The memory object to create.
|
|
432
|
+
* @param {string} tableName - The name of the table to create the memory in.
|
|
433
|
+
* @returns {Promise<UUID>} A Promise that resolves to the ID of the created memory.
|
|
434
|
+
*/
|
|
435
|
+
createMemory(memory: Memory & {
|
|
436
|
+
metadata?: MemoryMetadata;
|
|
437
|
+
}, tableName: string): Promise<UUID>;
|
|
438
|
+
/**
|
|
439
|
+
* Updates an existing memory in the database.
|
|
440
|
+
* @param memory The memory object with updated content and optional embedding
|
|
441
|
+
* @returns Promise resolving to boolean indicating success
|
|
442
|
+
*/
|
|
443
|
+
updateMemory(memory: Partial<Memory> & {
|
|
444
|
+
id: UUID;
|
|
445
|
+
metadata?: MemoryMetadata;
|
|
446
|
+
}): Promise<boolean>;
|
|
447
|
+
/**
|
|
448
|
+
* Asynchronously deletes a memory from the database based on the provided parameters.
|
|
449
|
+
* @param {UUID} memoryId - The ID of the memory to delete.
|
|
450
|
+
* @returns {Promise<void>} A Promise that resolves when the memory is deleted.
|
|
451
|
+
*/
|
|
452
|
+
deleteMemory(memoryId: UUID): Promise<void>;
|
|
453
|
+
/**
|
|
454
|
+
* Asynchronously deletes multiple memories from the database in a single batch operation.
|
|
455
|
+
* @param {UUID[]} memoryIds - An array of UUIDs of the memories to delete.
|
|
456
|
+
* @returns {Promise<void>} A Promise that resolves when all memories are deleted.
|
|
457
|
+
*/
|
|
458
|
+
deleteManyMemories(memoryIds: UUID[]): Promise<void>;
|
|
459
|
+
/**
|
|
460
|
+
* Deletes all memory fragments that reference a specific document memory
|
|
461
|
+
* @param tx The database transaction
|
|
462
|
+
* @param documentId The UUID of the document memory whose fragments should be deleted
|
|
463
|
+
* @private
|
|
464
|
+
*/
|
|
465
|
+
private deleteMemoryFragments;
|
|
466
|
+
/**
|
|
467
|
+
* Retrieves all memory fragments that reference a specific document memory
|
|
468
|
+
* @param tx The database transaction
|
|
469
|
+
* @param documentId The UUID of the document memory whose fragments should be retrieved
|
|
470
|
+
* @returns An array of memory fragments
|
|
471
|
+
* @private
|
|
472
|
+
*/
|
|
473
|
+
private getMemoryFragments;
|
|
474
|
+
/**
|
|
475
|
+
* Asynchronously deletes all memories from the database based on the provided parameters.
|
|
476
|
+
* @param {UUID[]} roomIds - The IDs of the rooms to delete memories from.
|
|
477
|
+
* @param {string} tableName - The name of the table to delete memories from.
|
|
478
|
+
* @returns {Promise<void>} A Promise that resolves when the memories are deleted.
|
|
479
|
+
*/
|
|
480
|
+
deleteAllMemories(roomIds: UUID[], tableName: string): Promise<void>;
|
|
481
|
+
deleteAllMemories(roomId: UUID, tableName: string): Promise<void>;
|
|
482
|
+
/**
|
|
483
|
+
* Count memories using the current object-based adapter contract while preserving
|
|
484
|
+
* the legacy positional signature used by older tests and callers.
|
|
485
|
+
* @returns {Promise<number>} A Promise that resolves to the number of memories.
|
|
486
|
+
*/
|
|
487
|
+
countMemories(params: CountMemoriesParams): Promise<number>;
|
|
488
|
+
countMemories(roomId: UUID, unique?: boolean, tableName?: string): Promise<number>;
|
|
489
|
+
/**
|
|
490
|
+
* Asynchronously retrieves rooms from the database based on the provided parameters.
|
|
491
|
+
* @param {UUID[]} roomIds - The IDs of the rooms to retrieve.
|
|
492
|
+
* @returns {Promise<Room[] | null>} A Promise that resolves to the rooms if found, null otherwise.
|
|
493
|
+
*/
|
|
494
|
+
getRoomsByIds(roomIds: UUID[]): Promise<Room[]>;
|
|
495
|
+
/**
|
|
496
|
+
* Asynchronously retrieves all rooms from the database based on the provided parameters.
|
|
497
|
+
* @param {UUID} worldId - The ID of the world to retrieve rooms from.
|
|
498
|
+
* @returns {Promise<Room[]>} A Promise that resolves to an array of rooms.
|
|
499
|
+
*/
|
|
500
|
+
getRoomsByWorld(worldId: UUID): Promise<Room[]>;
|
|
501
|
+
/**
|
|
502
|
+
* Asynchronously updates a room in the database based on the provided parameters.
|
|
503
|
+
* @param {Room} room - The room object to update.
|
|
504
|
+
* @returns {Promise<void>} A Promise that resolves when the room is updated.
|
|
505
|
+
*/
|
|
506
|
+
updateRoom(room: Room): Promise<void>;
|
|
507
|
+
/**
|
|
508
|
+
* Asynchronously creates a new room in the database based on the provided parameters.
|
|
509
|
+
* @param {Room} room - The room object to create.
|
|
510
|
+
* @returns {Promise<UUID>} A Promise that resolves to the ID of the created room.
|
|
511
|
+
*/
|
|
512
|
+
createRooms(rooms: Room[]): Promise<UUID[]>;
|
|
513
|
+
/**
|
|
514
|
+
* Asynchronously deletes a room from the database based on the provided parameters.
|
|
515
|
+
* @param {UUID} roomId - The ID of the room to delete.
|
|
516
|
+
* @returns {Promise<void>} A Promise that resolves when the room is deleted.
|
|
517
|
+
*/
|
|
518
|
+
deleteRoom(roomId: UUID): Promise<void>;
|
|
519
|
+
/**
|
|
520
|
+
* Asynchronously retrieves all rooms for a participant from the database based on the provided parameters.
|
|
521
|
+
* @param {UUID} entityId - The ID of the entity to retrieve rooms for.
|
|
522
|
+
* @returns {Promise<UUID[]>} A Promise that resolves to an array of room IDs.
|
|
523
|
+
*/
|
|
524
|
+
getRoomsForParticipant(entityId: UUID): Promise<UUID[]>;
|
|
525
|
+
/**
|
|
526
|
+
* Asynchronously retrieves all rooms for a list of participants from the database based on the provided parameters.
|
|
527
|
+
* @param {UUID[]} entityIds - The IDs of the entities to retrieve rooms for.
|
|
528
|
+
* @returns {Promise<UUID[]>} A Promise that resolves to an array of room IDs.
|
|
529
|
+
*/
|
|
530
|
+
getRoomsForParticipants(entityIds: UUID[]): Promise<UUID[]>;
|
|
531
|
+
/**
|
|
532
|
+
* Asynchronously adds a participant to a room in the database based on the provided parameters.
|
|
533
|
+
* @param {UUID} entityId - The ID of the entity to add to the room.
|
|
534
|
+
* @param {UUID} roomId - The ID of the room to add the entity to.
|
|
535
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the participant was added successfully.
|
|
536
|
+
*/
|
|
537
|
+
addParticipant(entityId: UUID, roomId: UUID): Promise<boolean>;
|
|
538
|
+
addParticipantsRoom(entityIds: UUID[], roomId: UUID): Promise<boolean>;
|
|
539
|
+
/**
|
|
540
|
+
* Asynchronously removes a participant from a room in the database based on the provided parameters.
|
|
541
|
+
* @param {UUID} entityId - The ID of the entity to remove from the room.
|
|
542
|
+
* @param {UUID} roomId - The ID of the room to remove the entity from.
|
|
543
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the participant was removed successfully.
|
|
544
|
+
*/
|
|
545
|
+
removeParticipant(entityId: UUID, roomId: UUID): Promise<boolean>;
|
|
546
|
+
/**
|
|
547
|
+
* Asynchronously retrieves all participants for an entity from the database based on the provided parameters.
|
|
548
|
+
* @param {UUID} entityId - The ID of the entity to retrieve participants for.
|
|
549
|
+
* @returns {Promise<Participant[]>} A Promise that resolves to an array of participants.
|
|
550
|
+
*/
|
|
551
|
+
getParticipantsForEntity(entityId: UUID): Promise<Participant[]>;
|
|
552
|
+
/**
|
|
553
|
+
* Asynchronously retrieves all participants for a room from the database based on the provided parameters.
|
|
554
|
+
* @param {UUID} roomId - The ID of the room to retrieve participants for.
|
|
555
|
+
* @returns {Promise<UUID[]>} A Promise that resolves to an array of entity IDs.
|
|
556
|
+
*/
|
|
557
|
+
getParticipantsForRoom(roomId: UUID): Promise<UUID[]>;
|
|
558
|
+
/**
|
|
559
|
+
* Check if an entity is a participant in a specific room/channel.
|
|
560
|
+
* More efficient than getParticipantsForRoom when only checking membership.
|
|
561
|
+
* @param {UUID} roomId - The ID of the room to check.
|
|
562
|
+
* @param {UUID} entityId - The ID of the entity to check.
|
|
563
|
+
* @returns {Promise<boolean>} A Promise that resolves to true if entity is a participant.
|
|
564
|
+
*/
|
|
565
|
+
isRoomParticipant(roomId: UUID, entityId: UUID): Promise<boolean>;
|
|
566
|
+
/**
|
|
567
|
+
* Asynchronously retrieves the user state for a participant in a room from the database based on the provided parameters.
|
|
568
|
+
* @param {UUID} roomId - The ID of the room to retrieve the participant's user state for.
|
|
569
|
+
* @param {UUID} entityId - The ID of the entity to retrieve the user state for.
|
|
570
|
+
* @returns {Promise<"FOLLOWED" | "MUTED" | null>} A Promise that resolves to the participant's user state.
|
|
571
|
+
*/
|
|
572
|
+
getParticipantUserState(roomId: UUID, entityId: UUID): Promise<"FOLLOWED" | "MUTED" | null>;
|
|
573
|
+
/**
|
|
574
|
+
* Asynchronously sets the user state for a participant in a room in the database based on the provided parameters.
|
|
575
|
+
* @param {UUID} roomId - The ID of the room to set the participant's user state for.
|
|
576
|
+
* @param {UUID} entityId - The ID of the entity to set the user state for.
|
|
577
|
+
* @param {string} state - The state to set the participant's user state to.
|
|
578
|
+
* @returns {Promise<void>} A Promise that resolves when the participant's user state is set.
|
|
579
|
+
*/
|
|
580
|
+
setParticipantUserState(roomId: UUID, entityId: UUID, state: "FOLLOWED" | "MUTED" | null): Promise<void>;
|
|
581
|
+
/**
|
|
582
|
+
* Asynchronously creates a new relationship in the database based on the provided parameters.
|
|
583
|
+
* @param {Object} params - The parameters for creating a new relationship.
|
|
584
|
+
* @param {UUID} params.sourceEntityId - The ID of the source entity.
|
|
585
|
+
* @param {UUID} params.targetEntityId - The ID of the target entity.
|
|
586
|
+
* @param {string[]} [params.tags] - The tags for the relationship.
|
|
587
|
+
* @param {Object} [params.metadata] - The metadata for the relationship.
|
|
588
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the relationship was created successfully.
|
|
589
|
+
*/
|
|
590
|
+
createRelationship(params: {
|
|
591
|
+
sourceEntityId: UUID;
|
|
592
|
+
targetEntityId: UUID;
|
|
593
|
+
tags?: string[];
|
|
594
|
+
metadata?: {
|
|
595
|
+
[key: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
}): Promise<boolean>;
|
|
598
|
+
/**
|
|
599
|
+
* Asynchronously updates an existing relationship in the database based on the provided parameters.
|
|
600
|
+
* @param {Relationship} relationship - The relationship object to update.
|
|
601
|
+
* @returns {Promise<void>} A Promise that resolves when the relationship is updated.
|
|
602
|
+
*/
|
|
603
|
+
updateRelationship(relationship: Relationship): Promise<void>;
|
|
604
|
+
/**
|
|
605
|
+
* Asynchronously retrieves a relationship from the database based on the provided parameters.
|
|
606
|
+
* @param {Object} params - The parameters for retrieving a relationship.
|
|
607
|
+
* @param {UUID} params.sourceEntityId - The ID of the source entity.
|
|
608
|
+
* @param {UUID} params.targetEntityId - The ID of the target entity.
|
|
609
|
+
* @returns {Promise<Relationship | null>} A Promise that resolves to the relationship if found, null otherwise.
|
|
610
|
+
*/
|
|
611
|
+
getRelationship(params: {
|
|
612
|
+
sourceEntityId: UUID;
|
|
613
|
+
targetEntityId: UUID;
|
|
614
|
+
}): Promise<Relationship | null>;
|
|
615
|
+
/**
|
|
616
|
+
* Asynchronously retrieves relationships from the database based on the provided parameters.
|
|
617
|
+
* @param {Object} params - The parameters for retrieving relationships.
|
|
618
|
+
* @param {UUID[]} [params.entityIds] - Entity IDs to retrieve relationships for.
|
|
619
|
+
* @param {UUID} [params.entityId] - Legacy single-entity alias.
|
|
620
|
+
* @param {string[]} [params.tags] - The tags to filter relationships by.
|
|
621
|
+
* @returns {Promise<Relationship[]>} A Promise that resolves to an array of relationships.
|
|
622
|
+
*/
|
|
623
|
+
getRelationships(params: {
|
|
624
|
+
entityIds?: UUID[];
|
|
625
|
+
entityId?: UUID;
|
|
626
|
+
tags?: string[];
|
|
627
|
+
limit?: number;
|
|
628
|
+
offset?: number;
|
|
629
|
+
}): Promise<Relationship[]>;
|
|
630
|
+
/**
|
|
631
|
+
* Asynchronously retrieves a cache value from the database based on the provided key.
|
|
632
|
+
* @param {string} key - The key to retrieve the cache value for.
|
|
633
|
+
* @returns {Promise<T | undefined>} A Promise that resolves to the cache value if found, undefined otherwise.
|
|
634
|
+
*/
|
|
635
|
+
getCache<T>(key: string): Promise<T | undefined>;
|
|
636
|
+
/**
|
|
637
|
+
* Asynchronously sets a cache value in the database based on the provided key and value.
|
|
638
|
+
* @param {string} key - The key to set the cache value for.
|
|
639
|
+
* @param {T} value - The value to set in the cache.
|
|
640
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the cache value was set successfully.
|
|
641
|
+
*/
|
|
642
|
+
setCache<T>(key: string, value: T): Promise<boolean>;
|
|
643
|
+
/**
|
|
644
|
+
* Asynchronously deletes a cache value from the database based on the provided key.
|
|
645
|
+
* @param {string} key - The key to delete the cache value for.
|
|
646
|
+
* @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the cache value was deleted successfully.
|
|
647
|
+
*/
|
|
648
|
+
deleteCache(key: string): Promise<boolean>;
|
|
649
|
+
/**
|
|
650
|
+
* Asynchronously creates a new world in the database based on the provided parameters.
|
|
651
|
+
* @param {World} world - The world object to create.
|
|
652
|
+
* @returns {Promise<UUID>} A Promise that resolves to the ID of the created world.
|
|
653
|
+
*/
|
|
654
|
+
createWorld(world: World): Promise<UUID>;
|
|
655
|
+
/**
|
|
656
|
+
* Asynchronously retrieves a world from the database based on the provided parameters.
|
|
657
|
+
* @param {UUID} id - The ID of the world to retrieve.
|
|
658
|
+
* @returns {Promise<World | null>} A Promise that resolves to the world if found, null otherwise.
|
|
659
|
+
*/
|
|
660
|
+
getWorld(id: UUID): Promise<World | null>;
|
|
661
|
+
/**
|
|
662
|
+
* Asynchronously retrieves all worlds from the database based on the provided parameters.
|
|
663
|
+
* @returns {Promise<World[]>} A Promise that resolves to an array of worlds.
|
|
664
|
+
*/
|
|
665
|
+
getAllWorlds(): Promise<World[]>;
|
|
666
|
+
/**
|
|
667
|
+
* Asynchronously updates an existing world in the database based on the provided parameters.
|
|
668
|
+
* @param {World} world - The world object to update.
|
|
669
|
+
* @returns {Promise<void>} A Promise that resolves when the world is updated.
|
|
670
|
+
*/
|
|
671
|
+
updateWorld(world: World): Promise<void>;
|
|
672
|
+
/**
|
|
673
|
+
* Asynchronously removes a world from the database based on the provided parameters.
|
|
674
|
+
* @param {UUID} id - The ID of the world to remove.
|
|
675
|
+
* @returns {Promise<void>} A Promise that resolves when the world is removed.
|
|
676
|
+
*/
|
|
677
|
+
removeWorld(id: UUID): Promise<void>;
|
|
678
|
+
/**
|
|
679
|
+
* Asynchronously creates a new task in the database based on the provided parameters.
|
|
680
|
+
* @param {Task} task - The task object to create.
|
|
681
|
+
* @returns {Promise<UUID>} A Promise that resolves to the ID of the created task.
|
|
682
|
+
*/
|
|
683
|
+
createTask(task: Task): Promise<UUID>;
|
|
684
|
+
/**
|
|
685
|
+
* Asynchronously retrieves tasks based on specified parameters.
|
|
686
|
+
* @param params Object containing optional roomId, tags, and entityId to filter tasks
|
|
687
|
+
* @returns Promise resolving to an array of Task objects
|
|
688
|
+
*/
|
|
689
|
+
getTasks(params: {
|
|
690
|
+
roomId?: UUID;
|
|
691
|
+
tags?: string[];
|
|
692
|
+
entityId?: UUID;
|
|
693
|
+
}): Promise<Task[]>;
|
|
694
|
+
/**
|
|
695
|
+
* Asynchronously retrieves a specific task by its name.
|
|
696
|
+
* @param name The name of the task to retrieve
|
|
697
|
+
* @returns Promise resolving to the Task object if found, null otherwise
|
|
698
|
+
*/
|
|
699
|
+
getTasksByName(name: string): Promise<Task[]>;
|
|
700
|
+
/**
|
|
701
|
+
* Asynchronously retrieves a specific task by its ID.
|
|
702
|
+
* @param id The UUID of the task to retrieve
|
|
703
|
+
* @returns Promise resolving to the Task object if found, null otherwise
|
|
704
|
+
*/
|
|
705
|
+
getTask(id: UUID): Promise<Task | null>;
|
|
706
|
+
/**
|
|
707
|
+
* Asynchronously updates an existing task in the database.
|
|
708
|
+
* @param id The UUID of the task to update
|
|
709
|
+
* @param task Partial Task object containing the fields to update
|
|
710
|
+
* @returns Promise resolving when the update is complete
|
|
711
|
+
*/
|
|
712
|
+
updateTask(id: UUID, task: Partial<Task>): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Asynchronously deletes a task from the database.
|
|
715
|
+
* @param id The UUID of the task to delete
|
|
716
|
+
* @returns Promise resolving when the deletion is complete
|
|
717
|
+
*/
|
|
718
|
+
deleteTask(id: UUID): Promise<void>;
|
|
719
|
+
getMemoriesByWorldId(params: {
|
|
720
|
+
worldId: UUID;
|
|
721
|
+
count?: number;
|
|
722
|
+
tableName?: string;
|
|
723
|
+
}): Promise<Memory[]>;
|
|
724
|
+
getMemoriesByServerId(params: {
|
|
725
|
+
serverId: UUID;
|
|
726
|
+
count?: number;
|
|
727
|
+
tableName?: string;
|
|
728
|
+
}): Promise<Memory[]>;
|
|
729
|
+
deleteRoomsByWorldId(worldId: UUID): Promise<void>;
|
|
730
|
+
/**
|
|
731
|
+
* Creates a new message server in the central database
|
|
732
|
+
*/
|
|
733
|
+
createMessageServer(data: {
|
|
734
|
+
id?: UUID;
|
|
735
|
+
name: string;
|
|
736
|
+
sourceType: string;
|
|
737
|
+
sourceId?: string;
|
|
738
|
+
metadata?: Metadata;
|
|
739
|
+
}): Promise<{
|
|
740
|
+
id: UUID;
|
|
741
|
+
name: string;
|
|
742
|
+
sourceType: string;
|
|
743
|
+
sourceId?: string;
|
|
744
|
+
metadata?: Metadata;
|
|
745
|
+
createdAt: Date;
|
|
746
|
+
updatedAt: Date;
|
|
747
|
+
}>;
|
|
748
|
+
/**
|
|
749
|
+
* Gets all message servers
|
|
750
|
+
*/
|
|
751
|
+
getMessageServers(): Promise<Array<{
|
|
752
|
+
id: UUID;
|
|
753
|
+
name: string;
|
|
754
|
+
sourceType: string;
|
|
755
|
+
sourceId?: string;
|
|
756
|
+
metadata?: Metadata;
|
|
757
|
+
createdAt: Date;
|
|
758
|
+
updatedAt: Date;
|
|
759
|
+
}>>;
|
|
760
|
+
/**
|
|
761
|
+
* Gets a message server by ID
|
|
762
|
+
*/
|
|
763
|
+
getMessageServerById(serverId: UUID): Promise<{
|
|
764
|
+
id: UUID;
|
|
765
|
+
name: string;
|
|
766
|
+
sourceType: string;
|
|
767
|
+
sourceId?: string;
|
|
768
|
+
metadata?: Metadata;
|
|
769
|
+
createdAt: Date;
|
|
770
|
+
updatedAt: Date;
|
|
771
|
+
} | null>;
|
|
772
|
+
/**
|
|
773
|
+
* Gets a message server by RLS server_id.
|
|
774
|
+
* The server_id column is added dynamically when RLS is enabled.
|
|
775
|
+
*/
|
|
776
|
+
getMessageServerByRlsServerId(rlsServerId: UUID): Promise<{
|
|
777
|
+
id: UUID;
|
|
778
|
+
name: string;
|
|
779
|
+
sourceType: string;
|
|
780
|
+
sourceId?: string;
|
|
781
|
+
metadata?: Metadata;
|
|
782
|
+
createdAt: Date;
|
|
783
|
+
updatedAt: Date;
|
|
784
|
+
} | null>;
|
|
785
|
+
/**
|
|
786
|
+
* Creates a new channel
|
|
787
|
+
*/
|
|
788
|
+
createChannel(data: {
|
|
789
|
+
id?: UUID;
|
|
790
|
+
messageServerId: UUID;
|
|
791
|
+
name: string;
|
|
792
|
+
type: string;
|
|
793
|
+
sourceType?: string;
|
|
794
|
+
sourceId?: string;
|
|
795
|
+
topic?: string;
|
|
796
|
+
metadata?: Metadata;
|
|
797
|
+
}, participantIds?: UUID[]): Promise<{
|
|
798
|
+
id: UUID;
|
|
799
|
+
messageServerId: UUID;
|
|
800
|
+
name: string;
|
|
801
|
+
type: string;
|
|
802
|
+
sourceType?: string;
|
|
803
|
+
sourceId?: string;
|
|
804
|
+
topic?: string;
|
|
805
|
+
metadata?: Metadata;
|
|
806
|
+
createdAt: Date;
|
|
807
|
+
updatedAt: Date;
|
|
808
|
+
}>;
|
|
809
|
+
/**
|
|
810
|
+
* Gets channels for a message server
|
|
811
|
+
*/
|
|
812
|
+
getChannelsForMessageServer(messageServerId: UUID): Promise<Array<{
|
|
813
|
+
id: UUID;
|
|
814
|
+
messageServerId: UUID;
|
|
815
|
+
name: string;
|
|
816
|
+
type: string;
|
|
817
|
+
sourceType?: string;
|
|
818
|
+
sourceId?: string;
|
|
819
|
+
topic?: string;
|
|
820
|
+
metadata?: Metadata;
|
|
821
|
+
createdAt: Date;
|
|
822
|
+
updatedAt: Date;
|
|
823
|
+
}>>;
|
|
824
|
+
/**
|
|
825
|
+
* Gets channel details
|
|
826
|
+
*/
|
|
827
|
+
getChannelDetails(channelId: UUID): Promise<{
|
|
828
|
+
id: UUID;
|
|
829
|
+
messageServerId: UUID;
|
|
830
|
+
name: string;
|
|
831
|
+
type: string;
|
|
832
|
+
sourceType?: string;
|
|
833
|
+
sourceId?: string;
|
|
834
|
+
topic?: string;
|
|
835
|
+
metadata?: Metadata;
|
|
836
|
+
createdAt: Date;
|
|
837
|
+
updatedAt: Date;
|
|
838
|
+
} | null>;
|
|
839
|
+
/**
|
|
840
|
+
* Creates a message
|
|
841
|
+
*/
|
|
842
|
+
createMessage(data: {
|
|
843
|
+
channelId: UUID;
|
|
844
|
+
authorId: UUID;
|
|
845
|
+
content: string;
|
|
846
|
+
rawMessage?: Record<string, unknown>;
|
|
847
|
+
sourceType?: string;
|
|
848
|
+
sourceId?: string;
|
|
849
|
+
metadata?: Metadata;
|
|
850
|
+
inReplyToRootMessageId?: UUID;
|
|
851
|
+
messageId?: UUID;
|
|
852
|
+
}): Promise<{
|
|
853
|
+
id: UUID;
|
|
854
|
+
channelId: UUID;
|
|
855
|
+
authorId: UUID;
|
|
856
|
+
content: string;
|
|
857
|
+
rawMessage?: Record<string, unknown>;
|
|
858
|
+
sourceType?: string;
|
|
859
|
+
sourceId?: string;
|
|
860
|
+
metadata?: Metadata;
|
|
861
|
+
inReplyToRootMessageId?: UUID;
|
|
862
|
+
createdAt: Date;
|
|
863
|
+
updatedAt: Date;
|
|
864
|
+
}>;
|
|
865
|
+
getMessageById(id: UUID): Promise<{
|
|
866
|
+
id: UUID;
|
|
867
|
+
channelId: UUID;
|
|
868
|
+
authorId: UUID;
|
|
869
|
+
content: string;
|
|
870
|
+
rawMessage?: Record<string, unknown>;
|
|
871
|
+
sourceType?: string;
|
|
872
|
+
sourceId?: string;
|
|
873
|
+
metadata?: Metadata;
|
|
874
|
+
inReplyToRootMessageId?: UUID;
|
|
875
|
+
createdAt: Date;
|
|
876
|
+
updatedAt: Date;
|
|
877
|
+
} | null>;
|
|
878
|
+
updateMessage(id: UUID, patch: {
|
|
879
|
+
content?: string;
|
|
880
|
+
rawMessage?: Record<string, unknown>;
|
|
881
|
+
sourceType?: string;
|
|
882
|
+
sourceId?: string;
|
|
883
|
+
metadata?: Metadata;
|
|
884
|
+
inReplyToRootMessageId?: UUID;
|
|
885
|
+
}): Promise<{
|
|
886
|
+
id: UUID;
|
|
887
|
+
channelId: UUID;
|
|
888
|
+
authorId: UUID;
|
|
889
|
+
content: string;
|
|
890
|
+
rawMessage?: Record<string, unknown>;
|
|
891
|
+
sourceType?: string;
|
|
892
|
+
sourceId?: string;
|
|
893
|
+
metadata?: Metadata;
|
|
894
|
+
inReplyToRootMessageId?: UUID;
|
|
895
|
+
createdAt: Date;
|
|
896
|
+
updatedAt: Date;
|
|
897
|
+
} | null>;
|
|
898
|
+
/**
|
|
899
|
+
* Gets messages for a channel
|
|
900
|
+
*/
|
|
901
|
+
getMessagesForChannel(channelId: UUID, limit?: number, beforeTimestamp?: Date): Promise<Array<{
|
|
902
|
+
id: UUID;
|
|
903
|
+
channelId: UUID;
|
|
904
|
+
authorId: UUID;
|
|
905
|
+
content: string;
|
|
906
|
+
rawMessage?: Record<string, unknown>;
|
|
907
|
+
sourceType?: string;
|
|
908
|
+
sourceId?: string;
|
|
909
|
+
metadata?: Metadata;
|
|
910
|
+
inReplyToRootMessageId?: UUID;
|
|
911
|
+
createdAt: Date;
|
|
912
|
+
updatedAt: Date;
|
|
913
|
+
}>>;
|
|
914
|
+
/**
|
|
915
|
+
* Deletes a message
|
|
916
|
+
*/
|
|
917
|
+
deleteMessage(messageId: UUID): Promise<void>;
|
|
918
|
+
/**
|
|
919
|
+
* Updates a channel
|
|
920
|
+
*/
|
|
921
|
+
updateChannel(channelId: UUID, updates: {
|
|
922
|
+
name?: string;
|
|
923
|
+
participantCentralUserIds?: UUID[];
|
|
924
|
+
metadata?: Metadata;
|
|
925
|
+
}): Promise<{
|
|
926
|
+
id: UUID;
|
|
927
|
+
messageServerId: UUID;
|
|
928
|
+
name: string;
|
|
929
|
+
type: string;
|
|
930
|
+
sourceType?: string;
|
|
931
|
+
sourceId?: string;
|
|
932
|
+
topic?: string;
|
|
933
|
+
metadata?: Metadata;
|
|
934
|
+
createdAt: Date;
|
|
935
|
+
updatedAt: Date;
|
|
936
|
+
}>;
|
|
937
|
+
/**
|
|
938
|
+
* Deletes a channel and all its associated data
|
|
939
|
+
*/
|
|
940
|
+
deleteChannel(channelId: UUID): Promise<void>;
|
|
941
|
+
/**
|
|
942
|
+
* Adds participants to a channel
|
|
943
|
+
*/
|
|
944
|
+
addChannelParticipants(channelId: UUID, entityIds: UUID[]): Promise<void>;
|
|
945
|
+
/**
|
|
946
|
+
* Gets participants for a channel
|
|
947
|
+
*/
|
|
948
|
+
getChannelParticipants(channelId: UUID): Promise<UUID[]>;
|
|
949
|
+
/**
|
|
950
|
+
* Check if an entity is a participant in a specific messaging channel.
|
|
951
|
+
* @param {UUID} channelId - The ID of the channel to check.
|
|
952
|
+
* @param {UUID} entityId - The ID of the entity to check.
|
|
953
|
+
* @returns {Promise<boolean>} A Promise that resolves to true if entity is a participant.
|
|
954
|
+
*/
|
|
955
|
+
isChannelParticipant(channelId: UUID, entityId: UUID): Promise<boolean>;
|
|
956
|
+
/**
|
|
957
|
+
* Adds an agent to a message server (Discord/Telegram server)
|
|
958
|
+
*/
|
|
959
|
+
addAgentToMessageServer(messageServerId: UUID, agentId: UUID): Promise<void>;
|
|
960
|
+
/**
|
|
961
|
+
* Gets agents for a message server (Discord/Telegram server)
|
|
962
|
+
*/
|
|
963
|
+
getAgentsForMessageServer(messageServerId: UUID): Promise<UUID[]>;
|
|
964
|
+
/**
|
|
965
|
+
* Removes an agent from a message server (Discord/Telegram server)
|
|
966
|
+
*/
|
|
967
|
+
removeAgentFromMessageServer(messageServerId: UUID, agentId: UUID): Promise<void>;
|
|
968
|
+
/**
|
|
969
|
+
* Finds or creates a DM channel between two users
|
|
970
|
+
*/
|
|
971
|
+
findOrCreateDmChannel(user1Id: UUID, user2Id: UUID, messageServerId: UUID): Promise<{
|
|
972
|
+
id: UUID;
|
|
973
|
+
messageServerId: UUID;
|
|
974
|
+
name: string;
|
|
975
|
+
type: string;
|
|
976
|
+
sourceType?: string;
|
|
977
|
+
sourceId?: string;
|
|
978
|
+
topic?: string;
|
|
979
|
+
metadata?: Metadata;
|
|
980
|
+
createdAt: Date;
|
|
981
|
+
updatedAt: Date;
|
|
982
|
+
}>;
|
|
983
|
+
/**
|
|
984
|
+
* Get all pending pairing requests for a channel and agent.
|
|
985
|
+
*/
|
|
986
|
+
getPairingRequests(queries: Array<{
|
|
987
|
+
channel: PairingChannel;
|
|
988
|
+
agentId: UUID;
|
|
989
|
+
}>): Promise<PairingRequestsResult>;
|
|
990
|
+
/**
|
|
991
|
+
* Create a new pairing request.
|
|
992
|
+
*/
|
|
993
|
+
createPairingRequest(request: PairingRequest): Promise<UUID>;
|
|
994
|
+
/**
|
|
995
|
+
* Update an existing pairing request.
|
|
996
|
+
*/
|
|
997
|
+
updatePairingRequest(request: PairingRequest): Promise<void>;
|
|
998
|
+
/**
|
|
999
|
+
* Delete a pairing request by ID.
|
|
1000
|
+
*/
|
|
1001
|
+
deletePairingRequest(id: UUID): Promise<void>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Get the allowlist for a channel and agent.
|
|
1004
|
+
*/
|
|
1005
|
+
getPairingAllowlist(channel: PairingChannel, agentId: UUID): Promise<PairingAllowlistEntry[]>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Create a new allowlist entry.
|
|
1008
|
+
*/
|
|
1009
|
+
createPairingAllowlistEntry(entry: PairingAllowlistEntry): Promise<UUID>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Delete an allowlist entry by ID.
|
|
1012
|
+
*/
|
|
1013
|
+
deletePairingAllowlistEntry(id: UUID): Promise<void>;
|
|
1014
|
+
isReady(): Promise<boolean>;
|
|
1015
|
+
getConnection(): Promise<DrizzleDatabase>;
|
|
1016
|
+
transaction<T>(callback: (tx: IDatabaseAdapter<DrizzleDatabase>) => Promise<T>, _options?: {
|
|
1017
|
+
entityContext?: UUID;
|
|
1018
|
+
}): Promise<T>;
|
|
1019
|
+
getComponentsByNaturalKeys(keys: Array<{
|
|
1020
|
+
entityId: UUID;
|
|
1021
|
+
type: string;
|
|
1022
|
+
worldId?: UUID;
|
|
1023
|
+
sourceEntityId?: UUID;
|
|
1024
|
+
}>): Promise<(Component | null)[]>;
|
|
1025
|
+
getComponentsForEntities(entityIds: UUID[], worldId?: UUID, sourceEntityId?: UUID): Promise<Component[]>;
|
|
1026
|
+
createComponents(components: Component[]): Promise<UUID[]>;
|
|
1027
|
+
getComponentsByIds(componentIds: UUID[]): Promise<Component[]>;
|
|
1028
|
+
updateComponents(components: Component[]): Promise<void>;
|
|
1029
|
+
deleteComponents(componentIds: UUID[]): Promise<void>;
|
|
1030
|
+
upsertComponents(components: Component[], _options?: {
|
|
1031
|
+
entityContext?: UUID;
|
|
1032
|
+
}): Promise<void>;
|
|
1033
|
+
patchComponents(updates: Array<{
|
|
1034
|
+
componentId: UUID;
|
|
1035
|
+
ops: PatchOp[];
|
|
1036
|
+
}>, _options?: {
|
|
1037
|
+
entityContext?: UUID;
|
|
1038
|
+
}): Promise<void>;
|
|
1039
|
+
upsertEntities(entities: Entity[]): Promise<void>;
|
|
1040
|
+
queryEntities(params: {
|
|
1041
|
+
componentType?: string;
|
|
1042
|
+
componentDataFilter?: Record<string, unknown>;
|
|
1043
|
+
agentId?: UUID;
|
|
1044
|
+
entityIds?: UUID[];
|
|
1045
|
+
worldId?: UUID;
|
|
1046
|
+
limit?: number;
|
|
1047
|
+
offset?: number;
|
|
1048
|
+
includeAllComponents?: boolean;
|
|
1049
|
+
entityContext?: UUID;
|
|
1050
|
+
}): Promise<Entity[]>;
|
|
1051
|
+
updateEntities(entities: Entity[]): Promise<void>;
|
|
1052
|
+
deleteEntities(entityIds: UUID[]): Promise<void>;
|
|
1053
|
+
getEntitiesForRooms(roomIds: UUID[], includeComponents?: boolean): Promise<EntitiesForRoomsResult>;
|
|
1054
|
+
createLogs(params: Array<{
|
|
1055
|
+
body: LogBody;
|
|
1056
|
+
entityId: UUID;
|
|
1057
|
+
roomId: UUID;
|
|
1058
|
+
type: string;
|
|
1059
|
+
}>): Promise<void>;
|
|
1060
|
+
getLogsByIds(logIds: UUID[]): Promise<Log[]>;
|
|
1061
|
+
updateLogs(logs: Array<{
|
|
1062
|
+
id: UUID;
|
|
1063
|
+
updates: Partial<Log>;
|
|
1064
|
+
}>): Promise<void>;
|
|
1065
|
+
deleteLogs(logIds: UUID[]): Promise<void>;
|
|
1066
|
+
createMemories(memories: Array<{
|
|
1067
|
+
memory: Memory;
|
|
1068
|
+
tableName: string;
|
|
1069
|
+
unique?: boolean;
|
|
1070
|
+
}>): Promise<UUID[]>;
|
|
1071
|
+
updateMemories(memories: Array<Partial<Memory> & {
|
|
1072
|
+
id: UUID;
|
|
1073
|
+
metadata?: MemoryMetadata;
|
|
1074
|
+
}>): Promise<void>;
|
|
1075
|
+
upsertMemories(memories: Array<{
|
|
1076
|
+
memory: Memory;
|
|
1077
|
+
tableName: string;
|
|
1078
|
+
}>, _options?: {
|
|
1079
|
+
entityContext?: UUID;
|
|
1080
|
+
}): Promise<void>;
|
|
1081
|
+
deleteMemories(memoryIds: UUID[]): Promise<void>;
|
|
1082
|
+
getWorldsByIds(worldIds: UUID[]): Promise<World[]>;
|
|
1083
|
+
createWorlds(worlds: World[]): Promise<UUID[]>;
|
|
1084
|
+
deleteWorlds(worldIds: UUID[]): Promise<void>;
|
|
1085
|
+
updateWorlds(worlds: World[]): Promise<void>;
|
|
1086
|
+
upsertWorlds(worlds: World[]): Promise<void>;
|
|
1087
|
+
deleteRoomsByWorldIds(worldIds: UUID[]): Promise<void>;
|
|
1088
|
+
getRoomsByWorlds(worldIds: UUID[], limit?: number, offset?: number): Promise<Room[]>;
|
|
1089
|
+
upsertRooms(rooms: Room[]): Promise<void>;
|
|
1090
|
+
createRoomParticipants(entityIds: UUID[], roomId: UUID): Promise<UUID[]>;
|
|
1091
|
+
deleteParticipants(participants: Array<{
|
|
1092
|
+
entityId: UUID;
|
|
1093
|
+
roomId: UUID;
|
|
1094
|
+
}>): Promise<boolean>;
|
|
1095
|
+
updateParticipants(participants: Array<{
|
|
1096
|
+
entityId: UUID;
|
|
1097
|
+
roomId: UUID;
|
|
1098
|
+
updates: ParticipantUpdateFields;
|
|
1099
|
+
}>): Promise<void>;
|
|
1100
|
+
updateRooms(rooms: Room[]): Promise<void>;
|
|
1101
|
+
deleteRooms(roomIds: UUID[]): Promise<void>;
|
|
1102
|
+
getParticipantsForEntities(entityIds: UUID[]): Promise<Participant[]>;
|
|
1103
|
+
getParticipantsForRooms(roomIds: UUID[]): Promise<ParticipantsForRoomsResult>;
|
|
1104
|
+
areRoomParticipants(pairs: Array<{
|
|
1105
|
+
roomId: UUID;
|
|
1106
|
+
entityId: UUID;
|
|
1107
|
+
}>): Promise<boolean[]>;
|
|
1108
|
+
getParticipantUserStates(pairs: Array<{
|
|
1109
|
+
roomId: UUID;
|
|
1110
|
+
entityId: UUID;
|
|
1111
|
+
}>): Promise<ParticipantUserState[]>;
|
|
1112
|
+
updateParticipantUserStates(updates: Array<{
|
|
1113
|
+
roomId: UUID;
|
|
1114
|
+
entityId: UUID;
|
|
1115
|
+
state: ParticipantUserState;
|
|
1116
|
+
}>): Promise<void>;
|
|
1117
|
+
getRelationshipsByPairs(pairs: Array<{
|
|
1118
|
+
sourceEntityId: UUID;
|
|
1119
|
+
targetEntityId: UUID;
|
|
1120
|
+
}>): Promise<(Relationship | null)[]>;
|
|
1121
|
+
createRelationships(relationships: Array<{
|
|
1122
|
+
sourceEntityId: UUID;
|
|
1123
|
+
targetEntityId: UUID;
|
|
1124
|
+
tags?: string[];
|
|
1125
|
+
metadata?: Metadata;
|
|
1126
|
+
}>): Promise<UUID[]>;
|
|
1127
|
+
getRelationshipsByIds(relationshipIds: UUID[]): Promise<Relationship[]>;
|
|
1128
|
+
updateRelationships(relationships: Relationship[]): Promise<void>;
|
|
1129
|
+
deleteRelationships(relationshipIds: UUID[]): Promise<void>;
|
|
1130
|
+
getCaches<T>(keys: string[]): Promise<Map<string, T>>;
|
|
1131
|
+
setCaches<T>(entries: Array<{
|
|
1132
|
+
key: string;
|
|
1133
|
+
value: T;
|
|
1134
|
+
}>): Promise<boolean>;
|
|
1135
|
+
deleteCaches(keys: string[]): Promise<boolean>;
|
|
1136
|
+
createTasks(tasks: Task[]): Promise<UUID[]>;
|
|
1137
|
+
getTasksByIds(taskIds: UUID[]): Promise<Task[]>;
|
|
1138
|
+
updateTasks(updates: Array<{
|
|
1139
|
+
id: UUID;
|
|
1140
|
+
task: Partial<Task>;
|
|
1141
|
+
}>): Promise<void>;
|
|
1142
|
+
deleteTasks(taskIds: UUID[]): Promise<void>;
|
|
1143
|
+
getPairingAllowlists(queries: Array<{
|
|
1144
|
+
channel: PairingChannel;
|
|
1145
|
+
agentId: UUID;
|
|
1146
|
+
}>): Promise<PairingAllowlistsResult>;
|
|
1147
|
+
createPairingRequests(requests: PairingRequest[]): Promise<UUID[]>;
|
|
1148
|
+
updatePairingRequests(requests: PairingRequest[]): Promise<void>;
|
|
1149
|
+
deletePairingRequests(ids: UUID[]): Promise<void>;
|
|
1150
|
+
createPairingAllowlistEntries(entries: PairingAllowlistEntry[]): Promise<UUID[]>;
|
|
1151
|
+
updatePairingAllowlistEntries(entries: PairingAllowlistEntry[]): Promise<void>;
|
|
1152
|
+
deletePairingAllowlistEntries(ids: UUID[]): Promise<void>;
|
|
1153
|
+
listConnectorAccounts(params?: ListConnectorAccountsParams): Promise<ConnectorAccountRecord[]>;
|
|
1154
|
+
getConnectorAccount(params: GetConnectorAccountParams): Promise<ConnectorAccountRecord | null>;
|
|
1155
|
+
upsertConnectorAccount(params: UpsertConnectorAccountParams): Promise<ConnectorAccountRecord>;
|
|
1156
|
+
deleteConnectorAccount(params: DeleteConnectorAccountParams): Promise<boolean>;
|
|
1157
|
+
findConnectorOwnerBinding(params: ConnectorOwnerBindingLookup): Promise<ConnectorOwnerBindingRecord | null>;
|
|
1158
|
+
setConnectorAccountCredentialRef(params: SetConnectorAccountCredentialRefParams): Promise<ConnectorAccountCredentialRefRecord>;
|
|
1159
|
+
getConnectorAccountCredentialRef(params: GetConnectorAccountCredentialRefParams): Promise<ConnectorAccountCredentialRefRecord | null>;
|
|
1160
|
+
listConnectorAccountCredentialRefs(params: ListConnectorAccountCredentialRefsParams): Promise<ConnectorAccountCredentialRefRecord[]>;
|
|
1161
|
+
appendConnectorAccountAuditEvent(params: AppendConnectorAccountAuditEventParams): Promise<ConnectorAccountAuditEventRecord>;
|
|
1162
|
+
listConnectorAccountAuditEvents(params?: ListConnectorAccountAuditEventsParams): Promise<ConnectorAccountAuditEventRecord[]>;
|
|
1163
|
+
createOAuthFlowState(params: CreateOAuthFlowStateParams): Promise<OAuthFlowRecord>;
|
|
1164
|
+
consumeOAuthFlowState(params: ConsumeOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
|
|
1165
|
+
getOAuthFlowState(params: GetOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
|
|
1166
|
+
updateOAuthFlowState(params: UpdateOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
|
|
1167
|
+
deleteOAuthFlowState(params: DeleteOAuthFlowStateParams): Promise<boolean>;
|
|
1168
|
+
}
|
|
1169
|
+
export {};
|