@elizaos/plugin-sql 2.0.3-beta.2 → 2.0.3-beta.4

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/package.json +3 -3
  2. package/src/dist/base.d.ts +1169 -0
  3. package/src/dist/browser/index.browser.d.ts +2 -0
  4. package/src/dist/browser/index.browser.js +31167 -0
  5. package/src/dist/browser/index.browser.js.map +76 -0
  6. package/src/dist/browser/index.d.ts +2 -0
  7. package/src/dist/cjs/index.d.ts +2 -0
  8. package/src/dist/cjs/index.node.cjs +13565 -0
  9. package/src/dist/cjs/index.node.cjs.map +75 -0
  10. package/src/dist/cjs/index.node.d.cts +2 -0
  11. package/src/dist/connector-credential-store.d.ts +48 -0
  12. package/src/dist/drizzle/index.d.ts +1 -0
  13. package/src/dist/drizzle/index.js +1 -0
  14. package/src/dist/index.d.ts +4 -0
  15. package/src/dist/index.js +2 -0
  16. package/src/dist/index.node.d.ts +53 -0
  17. package/src/dist/migration-service.d.ts +17 -0
  18. package/src/dist/migrations.d.ts +15 -0
  19. package/src/dist/node/index.d.ts +2 -0
  20. package/src/dist/node/index.node.d.ts +2 -0
  21. package/src/dist/node/index.node.js +13588 -0
  22. package/src/dist/node/index.node.js.map +75 -0
  23. package/src/dist/pg/adapter.d.ts +42 -0
  24. package/src/dist/pg/manager.d.ts +17 -0
  25. package/src/dist/pg/sslmode.d.ts +6 -0
  26. package/src/dist/pglite/adapter.d.ts +63 -0
  27. package/src/dist/pglite/errors.d.ts +20 -0
  28. package/src/dist/pglite/manager.d.ts +213 -0
  29. package/src/dist/rls.d.ts +13 -0
  30. package/src/dist/runtime-migrator/crypto-utils.d.ts +25 -0
  31. package/src/dist/runtime-migrator/drizzle-adapters/database-introspector.d.ts +58 -0
  32. package/src/dist/runtime-migrator/drizzle-adapters/diff-calculator.d.ts +77 -0
  33. package/src/dist/runtime-migrator/drizzle-adapters/snapshot-generator.d.ts +21 -0
  34. package/src/dist/runtime-migrator/drizzle-adapters/sql-generator.d.ts +38 -0
  35. package/src/dist/runtime-migrator/extension-manager.d.ts +6 -0
  36. package/src/dist/runtime-migrator/index.d.ts +8 -0
  37. package/src/dist/runtime-migrator/runtime-migrator.d.ts +95 -0
  38. package/src/dist/runtime-migrator/schema-transformer.d.ts +18 -0
  39. package/src/dist/runtime-migrator/storage/journal-storage.d.ts +10 -0
  40. package/src/dist/runtime-migrator/storage/migration-tracker.d.ts +13 -0
  41. package/src/dist/runtime-migrator/storage/snapshot-storage.d.ts +9 -0
  42. package/src/dist/runtime-migrator/types.d.ts +157 -0
  43. package/src/dist/schema/agent.d.ts +344 -0
  44. package/src/dist/schema/approvalRequests.d.ts +277 -0
  45. package/src/dist/schema/authAuditEvent.d.ts +153 -0
  46. package/src/dist/schema/authBootstrapJti.d.ts +49 -0
  47. package/src/dist/schema/authIdentity.d.ts +121 -0
  48. package/src/dist/schema/authOwnerBinding.d.ts +168 -0
  49. package/src/dist/schema/authOwnerLoginToken.d.ts +122 -0
  50. package/src/dist/schema/authSession.d.ts +225 -0
  51. package/src/dist/schema/cache.d.ts +97 -0
  52. package/src/dist/schema/channel.d.ts +177 -0
  53. package/src/dist/schema/channelParticipant.d.ts +41 -0
  54. package/src/dist/schema/component.d.ts +163 -0
  55. package/src/dist/schema/connectorAccounts.d.ts +981 -0
  56. package/src/dist/schema/embedding.d.ts +225 -0
  57. package/src/dist/schema/entity.d.ts +125 -0
  58. package/src/dist/schema/entityIdentity.d.ts +577 -0
  59. package/src/dist/schema/index.d.ts +35 -0
  60. package/src/dist/schema/index.js +1 -0
  61. package/src/dist/schema/log.d.ts +114 -0
  62. package/src/dist/schema/longTermMemories.d.ts +254 -0
  63. package/src/dist/schema/memory.d.ts +185 -0
  64. package/src/dist/schema/memoryAccessLogs.d.ts +109 -0
  65. package/src/dist/schema/message.d.ts +194 -0
  66. package/src/dist/schema/messageServer.d.ts +126 -0
  67. package/src/dist/schema/messageServerAgent.d.ts +41 -0
  68. package/src/dist/schema/pairingAllowlist.d.ts +113 -0
  69. package/src/dist/schema/pairingRequest.d.ts +147 -0
  70. package/src/dist/schema/participant.d.ts +114 -0
  71. package/src/dist/schema/relationship.d.ts +156 -0
  72. package/src/dist/schema/room.d.ts +195 -0
  73. package/src/dist/schema/server.d.ts +64 -0
  74. package/src/dist/schema/sessionSummaries.d.ts +273 -0
  75. package/src/dist/schema/tasks.d.ts +225 -0
  76. package/src/dist/schema/types.d.ts +68 -0
  77. package/src/dist/schema/world.d.ts +114 -0
  78. package/src/dist/services/advanced-memory-storage.d.ts +36 -0
  79. package/src/dist/stores/connectorAccount.store.d.ts +64 -0
  80. package/src/dist/stores/types.d.ts +25 -0
  81. package/src/dist/types.d.ts +13 -0
  82. package/src/dist/utils/string-to-uuid.d.ts +2 -0
  83. package/src/dist/utils.d.ts +4 -0
  84. package/src/dist/utils.node.d.ts +4 -0
  85. package/src/dist/write-back/index.d.ts +56 -0
@@ -0,0 +1,2 @@
1
+ export * from '../index.node.js';
2
+ export { default } from '../index.node.js';
@@ -0,0 +1,48 @@
1
+ import type { UUID } from "@elizaos/core";
2
+ export interface ConnectorPasswordManagerReference {
3
+ readonly source: "1password" | "protonpass";
4
+ readonly path: string;
5
+ }
6
+ export interface ConnectorCredentialVault {
7
+ set(key: string, value: string, opts?: {
8
+ sensitive?: boolean;
9
+ caller?: string;
10
+ }): Promise<void>;
11
+ setReference?(key: string, ref: ConnectorPasswordManagerReference): Promise<void>;
12
+ get(key: string): Promise<string>;
13
+ reveal?(key: string, caller?: string): Promise<string>;
14
+ has(key: string): Promise<boolean>;
15
+ remove(key: string): Promise<void>;
16
+ }
17
+ export interface ConnectorCredentialStore {
18
+ putSecret(params: {
19
+ vaultRef?: string;
20
+ agentId: UUID;
21
+ provider: string;
22
+ accountId: UUID;
23
+ credentialType: string;
24
+ value: string;
25
+ caller?: string;
26
+ }): Promise<string>;
27
+ putReference(params: {
28
+ vaultRef?: string;
29
+ agentId: UUID;
30
+ provider: string;
31
+ accountId: UUID;
32
+ credentialType: string;
33
+ reference: ConnectorPasswordManagerReference;
34
+ }): Promise<string>;
35
+ get(vaultRef: string, options?: {
36
+ reveal?: boolean;
37
+ caller?: string;
38
+ }): Promise<string>;
39
+ has(vaultRef: string): Promise<boolean>;
40
+ remove(vaultRef: string): Promise<void>;
41
+ }
42
+ export declare function buildConnectorCredentialVaultRef(params: {
43
+ agentId: UUID;
44
+ provider: string;
45
+ accountId: UUID;
46
+ credentialType: string;
47
+ }): string;
48
+ export declare function createConnectorCredentialStore(vault: ConnectorCredentialVault): ConnectorCredentialStore;
@@ -0,0 +1 @@
1
+ export { and, asc, count, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, type SQL, sql } from 'drizzle-orm';
@@ -0,0 +1 @@
1
+ export { and, asc, count, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from 'drizzle-orm';
@@ -0,0 +1,4 @@
1
+ export * from './node/index.node.js';
2
+ export { default } from './node/index.node.js';
3
+ export * from './schema/index.js';
4
+ export type { DrizzleDatabase } from './types.js';
@@ -0,0 +1,2 @@
1
+ export * from './node/index.node.js';
2
+ export { default } from './node/index.node.js';
@@ -0,0 +1,53 @@
1
+ import type { IDatabaseAdapter, UUID } from "@elizaos/core";
2
+ import { type Plugin } from "@elizaos/core";
3
+ export { and, asc, count, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, type SQL, sql, } from "drizzle-orm";
4
+ import { type LiveNamespace, type PgliteSyncStatus, type PgliteSyncTableStatus } from "./pglite/manager.js";
5
+ export type { AppendConnectorAccountAuditEventParams, ConnectorAccountAuditEventRecord, ConnectorAccountAuditOutcome, ConnectorAccountCredentialRefRecord, ConnectorAccountJsonObject, ConnectorAccountRecord, ConsumeOAuthFlowStateParams, CreateOAuthFlowStateParams, DeleteConnectorAccountParams, GetConnectorAccountCredentialRefParams, GetConnectorAccountParams, ListConnectorAccountCredentialRefsParams, ListConnectorAccountsParams, OAuthFlowRecord, SetConnectorAccountCredentialRefParams, UpsertConnectorAccountParams, } from "@elizaos/core";
6
+ export * from "./connector-credential-store.js";
7
+ export * from "./pglite/errors.js";
8
+ export type { LiveNamespace, PgliteSyncStatus, PgliteSyncTableStatus } from "./pglite/manager.js";
9
+ export * from "./schema/index.js";
10
+ export type { DrizzleDatabase } from "./types.js";
11
+ export declare function createDatabaseAdapter(config: {
12
+ dataDir?: string;
13
+ postgresUrl?: string;
14
+ }, agentId: UUID): IDatabaseAdapter;
15
+ export declare const plugin: Plugin;
16
+ export default plugin;
17
+ export * from "./drizzle/index.js";
18
+ export { DatabaseMigrationService } from "./migration-service.js";
19
+ export { applyRLSToNewTables, assignAgentToServer, getOrCreateRlsServer, installRLSFunctions, setServerContext, uninstallRLS, } from "./rls.js";
20
+ export { AdvancedMemoryStorageService } from "./services/advanced-memory-storage.js";
21
+ /**
22
+ * Query the live Electric Sync status from the global PGliteClientManager
23
+ * singleton. Returns "disabled" when no manager exists or sync is not
24
+ * configured, and "syncing" / "synced" / "error" at runtime as the sync
25
+ * client transitions.
26
+ */
27
+ export declare function getPgliteSyncStatus(): {
28
+ status: PgliteSyncStatus;
29
+ error: string | null;
30
+ tables: PgliteSyncTableStatus;
31
+ synced: string[];
32
+ };
33
+ /**
34
+ * Access the PGlite live query namespace from the global singleton.
35
+ * Returns null when the PGlite adapter is not in use or extensions are disabled.
36
+ * Use for reactive dashboard queries via pg.live.query() / incrementalQuery() / changes().
37
+ */
38
+ export declare function getPgliteLiveNamespace(): LiveNamespace | null;
39
+ /**
40
+ * Force-reset the Electric Sync stream for the current agent.
41
+ * Drops the electric schema, unsubscribes the current stream,
42
+ * and starts a fresh sync from the source Postgres.
43
+ * Returns the sync status after the reset, or null when sync is not configured.
44
+ */
45
+ export declare function forcePgliteResync(): Promise<{
46
+ status: PgliteSyncStatus;
47
+ error: string | null;
48
+ tables: PgliteSyncTableStatus;
49
+ synced: string[];
50
+ } | null>;
51
+
52
+ export * from './schema/index.js';
53
+ export type { DrizzleDatabase } from './types.js';
@@ -0,0 +1,17 @@
1
+ import { type Plugin } from "@elizaos/core";
2
+ import { RuntimeMigrator } from "./runtime-migrator/index.js";
3
+ import type { DrizzleDatabase } from "./types.js";
4
+ export declare class DatabaseMigrationService {
5
+ private db;
6
+ private registeredSchemas;
7
+ private migrator;
8
+ initializeWithDatabase(db: DrizzleDatabase): Promise<void>;
9
+ discoverAndRegisterPluginSchemas(plugins: Plugin[]): void;
10
+ registerSchema(pluginName: string, schema: Record<string, unknown>): void;
11
+ runAllPluginMigrations(options?: {
12
+ verbose?: boolean;
13
+ force?: boolean;
14
+ dryRun?: boolean;
15
+ }): Promise<void>;
16
+ getMigrator(): RuntimeMigrator | null;
17
+ }
@@ -0,0 +1,15 @@
1
+ import { type IDatabaseAdapter } from "@elizaos/core";
2
+ /**
3
+ * TEMPORARY MIGRATION: pre-1.6.5 → 1.6.5+ schema migration
4
+ *
5
+ * This migration runs automatically on startup and is idempotent.
6
+ * It handles the migration from Owner RLS to Server RLS + Entity RLS, including:
7
+ * - Disabling old RLS policies temporarily
8
+ * - Renaming server_id → message_server_id in channels, worlds, rooms
9
+ * - Converting TEXT → UUID where needed
10
+ * - Dropping old server_id columns for RLS
11
+ * - Cleaning up indexes
12
+ *
13
+ * @param adapter - Database adapter
14
+ */
15
+ export declare function migrateToEntityRLS(adapter: IDatabaseAdapter): Promise<void>;
@@ -0,0 +1,2 @@
1
+ export * from '../index.node.js';
2
+ export { default } from '../index.node.js';
@@ -0,0 +1,2 @@
1
+ export * from '../index.node.js';
2
+ export { default } from '../index.node.js';