@elizaos/plugin-sql 2.0.0-beta.1 → 2.0.3-beta.2

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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -304
  3. package/package.json +24 -12
  4. package/src/dist/base.d.ts +0 -1152
  5. package/src/dist/browser/index.browser.d.ts +0 -2
  6. package/src/dist/browser/index.browser.js +0 -26781
  7. package/src/dist/browser/index.browser.js.map +0 -72
  8. package/src/dist/browser/index.d.ts +0 -2
  9. package/src/dist/cjs/index.d.ts +0 -2
  10. package/src/dist/cjs/index.node.cjs +0 -9154
  11. package/src/dist/cjs/index.node.cjs.map +0 -70
  12. package/src/dist/cjs/index.node.d.cts +0 -2
  13. package/src/dist/connector-credential-store.d.ts +0 -48
  14. package/src/dist/drizzle/index.d.ts +0 -1
  15. package/src/dist/drizzle/index.js +0 -1
  16. package/src/dist/index.d.ts +0 -4
  17. package/src/dist/index.js +0 -2
  18. package/src/dist/index.node.d.ts +0 -20
  19. package/src/dist/migration-service.d.ts +0 -17
  20. package/src/dist/migrations.d.ts +0 -15
  21. package/src/dist/node/index.d.ts +0 -2
  22. package/src/dist/node/index.node.d.ts +0 -2
  23. package/src/dist/node/index.node.js +0 -9175
  24. package/src/dist/node/index.node.js.map +0 -70
  25. package/src/dist/pg/adapter.d.ts +0 -42
  26. package/src/dist/pg/manager.d.ts +0 -17
  27. package/src/dist/pglite/adapter.d.ts +0 -24
  28. package/src/dist/pglite/errors.d.ts +0 -20
  29. package/src/dist/pglite/manager.d.ts +0 -32
  30. package/src/dist/rls.d.ts +0 -13
  31. package/src/dist/runtime-migrator/crypto-utils.d.ts +0 -25
  32. package/src/dist/runtime-migrator/drizzle-adapters/database-introspector.d.ts +0 -58
  33. package/src/dist/runtime-migrator/drizzle-adapters/diff-calculator.d.ts +0 -77
  34. package/src/dist/runtime-migrator/drizzle-adapters/snapshot-generator.d.ts +0 -21
  35. package/src/dist/runtime-migrator/drizzle-adapters/sql-generator.d.ts +0 -38
  36. package/src/dist/runtime-migrator/extension-manager.d.ts +0 -6
  37. package/src/dist/runtime-migrator/index.d.ts +0 -8
  38. package/src/dist/runtime-migrator/runtime-migrator.d.ts +0 -95
  39. package/src/dist/runtime-migrator/schema-transformer.d.ts +0 -18
  40. package/src/dist/runtime-migrator/storage/journal-storage.d.ts +0 -10
  41. package/src/dist/runtime-migrator/storage/migration-tracker.d.ts +0 -13
  42. package/src/dist/runtime-migrator/storage/snapshot-storage.d.ts +0 -9
  43. package/src/dist/runtime-migrator/types.d.ts +0 -157
  44. package/src/dist/schema/agent.d.ts +0 -344
  45. package/src/dist/schema/approvalRequests.d.ts +0 -277
  46. package/src/dist/schema/authAuditEvent.d.ts +0 -153
  47. package/src/dist/schema/authBootstrapJti.d.ts +0 -49
  48. package/src/dist/schema/authIdentity.d.ts +0 -121
  49. package/src/dist/schema/authOwnerBinding.d.ts +0 -168
  50. package/src/dist/schema/authOwnerLoginToken.d.ts +0 -122
  51. package/src/dist/schema/authSession.d.ts +0 -225
  52. package/src/dist/schema/cache.d.ts +0 -97
  53. package/src/dist/schema/channel.d.ts +0 -177
  54. package/src/dist/schema/channelParticipant.d.ts +0 -41
  55. package/src/dist/schema/component.d.ts +0 -163
  56. package/src/dist/schema/connectorAccounts.d.ts +0 -981
  57. package/src/dist/schema/embedding.d.ts +0 -204
  58. package/src/dist/schema/entity.d.ts +0 -125
  59. package/src/dist/schema/entityIdentity.d.ts +0 -577
  60. package/src/dist/schema/index.d.ts +0 -35
  61. package/src/dist/schema/index.js +0 -1
  62. package/src/dist/schema/log.d.ts +0 -114
  63. package/src/dist/schema/longTermMemories.d.ts +0 -254
  64. package/src/dist/schema/memory.d.ts +0 -185
  65. package/src/dist/schema/memoryAccessLogs.d.ts +0 -109
  66. package/src/dist/schema/message.d.ts +0 -194
  67. package/src/dist/schema/messageServer.d.ts +0 -126
  68. package/src/dist/schema/messageServerAgent.d.ts +0 -41
  69. package/src/dist/schema/pairingAllowlist.d.ts +0 -113
  70. package/src/dist/schema/pairingRequest.d.ts +0 -147
  71. package/src/dist/schema/participant.d.ts +0 -114
  72. package/src/dist/schema/relationship.d.ts +0 -156
  73. package/src/dist/schema/room.d.ts +0 -195
  74. package/src/dist/schema/server.d.ts +0 -64
  75. package/src/dist/schema/sessionSummaries.d.ts +0 -273
  76. package/src/dist/schema/tasks.d.ts +0 -225
  77. package/src/dist/schema/types.d.ts +0 -68
  78. package/src/dist/schema/world.d.ts +0 -114
  79. package/src/dist/services/advanced-memory-storage.d.ts +0 -36
  80. package/src/dist/stores/connectorAccount.store.d.ts +0 -64
  81. package/src/dist/stores/types.d.ts +0 -25
  82. package/src/dist/types.d.ts +0 -13
  83. package/src/dist/utils/string-to-uuid.d.ts +0 -2
  84. package/src/dist/utils.d.ts +0 -4
  85. package/src/dist/utils.node.d.ts +0 -4
@@ -1,36 +0,0 @@
1
- import { type IAgentRuntime, type MemoryStorageProvider, Service, type UUID } from "@elizaos/core";
2
- type LongTermMemoryRecord = Awaited<ReturnType<MemoryStorageProvider["storeLongTermMemory"]>>;
3
- type LongTermMemoryInput = Parameters<MemoryStorageProvider["storeLongTermMemory"]>[0];
4
- type LongTermMemoryCategory = LongTermMemoryRecord["category"];
5
- type SessionSummaryRecord = Awaited<ReturnType<MemoryStorageProvider["storeSessionSummary"]>>;
6
- type SessionSummaryInput = Parameters<MemoryStorageProvider["storeSessionSummary"]>[0];
7
- export declare class AdvancedMemoryStorageService extends Service implements MemoryStorageProvider {
8
- static serviceType: "memoryStorage";
9
- capabilityDescription: string;
10
- static start(runtime: IAgentRuntime): Promise<Service>;
11
- initialize(runtime: IAgentRuntime): Promise<void>;
12
- stop(): Promise<void>;
13
- private getMemoryWorldId;
14
- private getLongTermRoomId;
15
- private ensureMemoryWorld;
16
- private ensureLongTermRoom;
17
- private getEntityResolutionService;
18
- private getIdentityGroup;
19
- private getAnchorEntityId;
20
- private parseLongTermMemory;
21
- private parseSessionSummary;
22
- private sortLongTermMemories;
23
- private sortSessionSummaries;
24
- storeLongTermMemory(memory: LongTermMemoryInput): Promise<LongTermMemoryRecord>;
25
- getLongTermMemories(agentId: UUID, entityId: UUID, opts?: {
26
- category?: LongTermMemoryCategory;
27
- limit?: number;
28
- }): Promise<LongTermMemoryRecord[]>;
29
- updateLongTermMemory(id: UUID, agentId: UUID, entityId: UUID, updates: Partial<Omit<LongTermMemoryRecord, "id" | "agentId" | "entityId" | "createdAt">>): Promise<void>;
30
- deleteLongTermMemory(id: UUID, agentId: UUID, entityId: UUID): Promise<void>;
31
- storeSessionSummary(summary: SessionSummaryInput): Promise<SessionSummaryRecord>;
32
- getCurrentSessionSummary(agentId: UUID, roomId: UUID): Promise<SessionSummaryRecord | null>;
33
- updateSessionSummary(id: UUID, agentId: UUID, roomId: UUID, updates: Partial<Omit<SessionSummaryRecord, "id" | "agentId" | "roomId" | "createdAt" | "updatedAt">>): Promise<void>;
34
- getSessionSummaries(agentId: UUID, roomId: UUID, limit?: number): Promise<SessionSummaryRecord[]>;
35
- }
36
- export {};
@@ -1,64 +0,0 @@
1
- import type { AppendConnectorAccountAuditEventParams, ConnectorAccountAuditEventRecord, ConnectorAccountCredentialRefRecord, ConnectorAccountJsonObject, ConnectorAccountRecord, ConnectorOwnerBindingLookup, ConnectorOwnerBindingRecord, ConsumeOAuthFlowStateParams, CreateOAuthFlowStateParams, DeleteConnectorAccountParams, GetConnectorAccountCredentialRefParams, GetConnectorAccountParams, ListConnectorAccountCredentialRefsParams, ListConnectorAccountsParams, OAuthFlowRecord, SetConnectorAccountCredentialRefParams, UpsertConnectorAccountParams } from "@elizaos/core";
2
- import type { Store, StoreContext } from "./types";
3
- interface GetOAuthFlowStateParams {
4
- state?: string;
5
- stateHash?: string;
6
- flowId?: string;
7
- agentId?: string;
8
- provider?: string;
9
- includeConsumed?: boolean;
10
- includeExpired?: boolean;
11
- now?: number | Date;
12
- }
13
- interface UpdateOAuthFlowStateParams {
14
- state?: string;
15
- stateHash?: string;
16
- flowId?: string;
17
- agentId?: string;
18
- provider?: string;
19
- accountId?: string | null;
20
- redirectUri?: string | null;
21
- codeVerifierRef?: string | null;
22
- scopes?: string[];
23
- metadata?: ConnectorAccountJsonObject;
24
- expiresAt?: number | Date;
25
- consumedAt?: number | Date | null;
26
- consumedBy?: string | null;
27
- }
28
- interface DeleteOAuthFlowStateParams {
29
- state?: string;
30
- stateHash?: string;
31
- flowId?: string;
32
- agentId?: string;
33
- provider?: string;
34
- }
35
- export interface ListConnectorAccountAuditEventsParams {
36
- agentId?: string;
37
- provider?: string;
38
- accountId?: string;
39
- action?: string;
40
- outcome?: string;
41
- limit?: number;
42
- }
43
- export declare class ConnectorAccountStore implements Store {
44
- readonly ctx: StoreContext;
45
- constructor(ctx: StoreContext);
46
- private get db();
47
- listAccounts(params?: ListConnectorAccountsParams): Promise<ConnectorAccountRecord[]>;
48
- getAccount(params: GetConnectorAccountParams): Promise<ConnectorAccountRecord | null>;
49
- upsertAccount(params: UpsertConnectorAccountParams): Promise<ConnectorAccountRecord>;
50
- deleteAccount(params: DeleteConnectorAccountParams): Promise<boolean>;
51
- findOwnerBinding(params: ConnectorOwnerBindingLookup): Promise<ConnectorOwnerBindingRecord | null>;
52
- setCredentialRef(params: SetConnectorAccountCredentialRefParams): Promise<ConnectorAccountCredentialRefRecord>;
53
- getCredentialRef(params: GetConnectorAccountCredentialRefParams): Promise<ConnectorAccountCredentialRefRecord | null>;
54
- listCredentialRefs(params: ListConnectorAccountCredentialRefsParams): Promise<ConnectorAccountCredentialRefRecord[]>;
55
- appendAuditEvent(params: AppendConnectorAccountAuditEventParams): Promise<ConnectorAccountAuditEventRecord>;
56
- listAuditEvents(params?: ListConnectorAccountAuditEventsParams): Promise<ConnectorAccountAuditEventRecord[]>;
57
- createOAuthFlowState(params: CreateOAuthFlowStateParams): Promise<OAuthFlowRecord>;
58
- consumeOAuthFlowState(params: ConsumeOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
59
- private buildOAuthFlowLookupConditions;
60
- getOAuthFlowState(params: GetOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
61
- updateOAuthFlowState(params: UpdateOAuthFlowStateParams): Promise<OAuthFlowRecord | null>;
62
- deleteOAuthFlowState(params: DeleteOAuthFlowStateParams): Promise<boolean>;
63
- }
64
- export {};
@@ -1,25 +0,0 @@
1
- import type { UUID } from "@elizaos/core";
2
- import type { EmbeddingDimensionColumn } from "../schema/embedding";
3
- import type { DrizzleDatabase } from "../types";
4
- /**
5
- * Context passed to all stores for database operations.
6
- * Stores don't manage connections - they receive a context from the adapter.
7
- */
8
- export interface StoreContext {
9
- /** Get the database instance (may be a transaction) */
10
- getDb: () => DrizzleDatabase;
11
- /** Execute operation with retry logic (context is for logging, ignored by adapter) */
12
- withRetry: <T>(operation: () => Promise<T>, context?: string) => Promise<T>;
13
- /** Execute operation within RLS isolation context */
14
- withIsolationContext: <T>(entityId: UUID | null, callback: (tx: DrizzleDatabase) => Promise<T>) => Promise<T>;
15
- /** Current agent ID */
16
- agentId: UUID;
17
- /** Get current embedding dimension column (dynamic to reflect runtime changes) */
18
- getEmbeddingDimension: () => EmbeddingDimensionColumn;
19
- }
20
- /**
21
- * Base interface for all domain stores.
22
- */
23
- export interface Store {
24
- readonly ctx: StoreContext;
25
- }
@@ -1,13 +0,0 @@
1
- import type { IDatabaseAdapter } from "@elizaos/core";
2
- import type { NodePgDatabase } from "drizzle-orm/node-postgres";
3
- import type { PgliteDatabase } from "drizzle-orm/pglite";
4
- export type DrizzleDatabase = NodePgDatabase | PgliteDatabase;
5
- export interface IDatabaseClientManager<T> {
6
- initialize(): Promise<void>;
7
- getConnection(): T;
8
- close(): Promise<void>;
9
- }
10
- export declare function getDb(adapter: IDatabaseAdapter): DrizzleDatabase;
11
- export declare function getRow<T>(result: {
12
- rows: unknown[];
13
- }, index?: number): T | undefined;
@@ -1,2 +0,0 @@
1
- import type { UUID } from "@elizaos/core";
2
- export declare function stringToUuid(target: string | number): UUID;
@@ -1,4 +0,0 @@
1
- export declare function expandTildePath(filepath: string): string;
2
- export declare function resolveEnvFile(startDir?: string): string;
3
- export declare function resolvePgliteDir(dir?: string, fallbackDir?: string): string;
4
- export declare function sanitizeJsonObject(value: unknown, seen?: WeakSet<object>): unknown;
@@ -1,4 +0,0 @@
1
- export declare function expandTildePath(filepath: string): string;
2
- export declare function resolveEnvFile(startDir?: string): string;
3
- export declare function resolvePgliteDir(dir?: string, fallbackDir?: string): string;
4
- export declare function sanitizeJsonObject(value: unknown, seen?: WeakSet<object>): unknown;