@elizaos/plugin-sql 2.0.0-alpha.2 → 2.0.0-alpha.20

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 (108) hide show
  1. package/dist/base.d.ts +1102 -0
  2. package/dist/browser/index.browser.js +3887 -1999
  3. package/dist/browser/index.browser.js.map +32 -20
  4. package/dist/browser/index.d.ts +2 -2
  5. package/dist/cjs/index.d.ts +2 -0
  6. package/dist/cjs/index.node.cjs +8184 -0
  7. package/dist/cjs/index.node.cjs.map +67 -0
  8. package/dist/index.d.ts +4 -2
  9. package/dist/index.js +2 -0
  10. package/dist/index.node.d.ts +17 -0
  11. package/dist/migration-service.d.ts +17 -0
  12. package/dist/migrations.d.ts +15 -0
  13. package/dist/node/index.d.ts +2 -2
  14. package/dist/node/index.node.js +4411 -8649
  15. package/dist/node/index.node.js.map +34 -117
  16. package/dist/pg/adapter.d.ts +41 -0
  17. package/dist/pg/manager.d.ts +14 -0
  18. package/dist/pglite/adapter.d.ts +23 -0
  19. package/dist/pglite/errors.d.ts +20 -0
  20. package/dist/pglite/manager.d.ts +25 -0
  21. package/dist/rls.d.ts +13 -0
  22. package/dist/runtime-migrator/crypto-utils.d.ts +25 -0
  23. package/dist/runtime-migrator/drizzle-adapters/database-introspector.d.ts +58 -0
  24. package/dist/runtime-migrator/drizzle-adapters/diff-calculator.d.ts +77 -0
  25. package/dist/runtime-migrator/drizzle-adapters/snapshot-generator.d.ts +21 -0
  26. package/dist/runtime-migrator/drizzle-adapters/sql-generator.d.ts +38 -0
  27. package/dist/runtime-migrator/extension-manager.d.ts +6 -0
  28. package/dist/runtime-migrator/index.d.ts +8 -0
  29. package/dist/runtime-migrator/runtime-migrator.d.ts +95 -0
  30. package/dist/runtime-migrator/schema-transformer.d.ts +18 -0
  31. package/dist/runtime-migrator/storage/journal-storage.d.ts +10 -0
  32. package/dist/runtime-migrator/storage/migration-tracker.d.ts +13 -0
  33. package/dist/runtime-migrator/storage/snapshot-storage.d.ts +9 -0
  34. package/dist/runtime-migrator/types.d.ts +157 -0
  35. package/dist/schema/agent.d.ts +344 -0
  36. package/dist/schema/approvalRequests.d.ts +277 -0
  37. package/dist/schema/authAuditEvent.d.ts +153 -0
  38. package/dist/schema/authBootstrapJti.d.ts +49 -0
  39. package/dist/schema/authIdentity.d.ts +121 -0
  40. package/dist/schema/authOwnerBinding.d.ts +168 -0
  41. package/dist/schema/authOwnerLoginToken.d.ts +122 -0
  42. package/dist/schema/authSession.d.ts +225 -0
  43. package/dist/schema/cache.d.ts +97 -0
  44. package/dist/schema/channel.d.ts +177 -0
  45. package/dist/schema/channelParticipant.d.ts +41 -0
  46. package/dist/schema/component.d.ts +163 -0
  47. package/dist/schema/embedding.d.ts +204 -0
  48. package/dist/schema/entity.d.ts +125 -0
  49. package/dist/schema/entityIdentity.d.ts +577 -0
  50. package/dist/schema/index.d.ts +34 -0
  51. package/dist/schema/log.d.ts +114 -0
  52. package/dist/schema/longTermMemories.d.ts +254 -0
  53. package/dist/schema/memory.d.ts +185 -0
  54. package/dist/schema/memoryAccessLogs.d.ts +109 -0
  55. package/dist/schema/message.d.ts +194 -0
  56. package/dist/schema/messageServer.d.ts +126 -0
  57. package/dist/schema/messageServerAgent.d.ts +41 -0
  58. package/dist/schema/pairingAllowlist.d.ts +113 -0
  59. package/dist/schema/pairingRequest.d.ts +147 -0
  60. package/dist/schema/participant.d.ts +114 -0
  61. package/dist/schema/relationship.d.ts +156 -0
  62. package/dist/schema/room.d.ts +195 -0
  63. package/dist/schema/server.d.ts +64 -0
  64. package/dist/schema/sessionSummaries.d.ts +273 -0
  65. package/dist/schema/tasks.d.ts +225 -0
  66. package/dist/schema/types.d.ts +68 -0
  67. package/dist/schema/world.d.ts +114 -0
  68. package/dist/services/advanced-memory-storage.d.ts +36 -0
  69. package/dist/types.d.ts +13 -0
  70. package/dist/utils/string-to-uuid.d.ts +2 -0
  71. package/dist/utils.d.ts +4 -0
  72. package/dist/utils.node.d.ts +4 -0
  73. package/drizzle/index.ts +17 -0
  74. package/package.json +50 -17
  75. package/schema/agent.ts +50 -0
  76. package/schema/approvalRequests.ts +57 -0
  77. package/schema/authAuditEvent.ts +29 -0
  78. package/schema/authBootstrapJti.ts +18 -0
  79. package/schema/authIdentity.ts +35 -0
  80. package/schema/authOwnerBinding.ts +43 -0
  81. package/schema/authOwnerLoginToken.ts +50 -0
  82. package/schema/authSession.ts +44 -0
  83. package/schema/cache.ts +22 -0
  84. package/schema/channel.ts +19 -0
  85. package/schema/channelParticipant.ts +13 -0
  86. package/schema/component.ts +37 -0
  87. package/schema/embedding.ts +73 -0
  88. package/schema/entity.ts +28 -0
  89. package/schema/entityIdentity.ts +142 -0
  90. package/schema/index.ts +41 -0
  91. package/schema/log.ts +38 -0
  92. package/schema/longTermMemories.ts +27 -0
  93. package/schema/memory.ts +103 -0
  94. package/schema/memoryAccessLogs.ts +19 -0
  95. package/schema/message.ts +24 -0
  96. package/schema/messageServer.ts +12 -0
  97. package/schema/messageServerAgent.ts +16 -0
  98. package/schema/pairingAllowlist.ts +36 -0
  99. package/schema/pairingRequest.ts +46 -0
  100. package/schema/participant.ts +43 -0
  101. package/schema/relationship.ts +50 -0
  102. package/schema/room.ts +37 -0
  103. package/schema/server.ts +14 -0
  104. package/schema/sessionSummaries.ts +27 -0
  105. package/schema/tasks.ts +24 -0
  106. package/schema/types.ts +42 -0
  107. package/schema/world.ts +20 -0
  108. package/types.ts +19 -0
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export * from "./node/index";
2
- export { default } from "./node/index";
1
+ export * from './index.node';
2
+ export { default } from './index.node';
3
+ export * from './schema/index';
4
+ export type { DrizzleDatabase } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './node/index.node.js';
2
+ export { default } from './node/index.node.js';
@@ -0,0 +1,17 @@
1
+ import type { IDatabaseAdapter, UUID } from "@elizaos/core";
2
+ import { type Plugin } from "@elizaos/core";
3
+ export * from "./pglite/errors";
4
+ export * from "./schema";
5
+ export type { DrizzleDatabase } from "./types";
6
+ export declare function createDatabaseAdapter(config: {
7
+ dataDir?: string;
8
+ postgresUrl?: string;
9
+ }, agentId: UUID): IDatabaseAdapter;
10
+ export declare const plugin: Plugin;
11
+ export default plugin;
12
+ export { DatabaseMigrationService } from "./migration-service";
13
+ export { applyRLSToNewTables, assignAgentToServer, getOrCreateRlsServer, installRLSFunctions, setServerContext, uninstallRLS, } from "./rls";
14
+ export { AdvancedMemoryStorageService } from "./services/advanced-memory-storage";
15
+
16
+ export * from './schema/index';
17
+ export type { DrizzleDatabase } from './types';
@@ -0,0 +1,17 @@
1
+ import { type Plugin } from "@elizaos/core";
2
+ import { RuntimeMigrator } from "./runtime-migrator";
3
+ import type { DrizzleDatabase } from "./types";
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>;
@@ -1,2 +1,2 @@
1
- export * from "./index.node";
2
- export { default } from "./index.node";
1
+ export * from '../index.node';
2
+ export { default } from '../index.node';