@elizaos/plugin-sql 1.6.0-alpha.0 → 1.6.0-alpha.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 (71) hide show
  1. package/dist/browser/index.browser.js +3254 -0
  2. package/dist/browser/index.browser.js.map +36 -0
  3. package/dist/browser/index.d.ts +2 -0
  4. package/dist/browser/tsconfig.build.tsbuildinfo +1 -0
  5. package/dist/index.d.ts +2 -33
  6. package/dist/node/index.d.ts +2 -0
  7. package/dist/{index.js → node/index.node.js} +55 -4791
  8. package/dist/node/index.node.js.map +123 -0
  9. package/dist/node/tsconfig.build.node.tsbuildinfo +1 -0
  10. package/package.json +38 -13
  11. package/types/index.d.ts +19 -0
  12. package/dist/base.d.ts +0 -894
  13. package/dist/base.d.ts.map +0 -1
  14. package/dist/custom-migrator.d.ts +0 -75
  15. package/dist/custom-migrator.d.ts.map +0 -1
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/index.js.map +0 -164
  18. package/dist/migration-service.d.ts +0 -12
  19. package/dist/migration-service.d.ts.map +0 -1
  20. package/dist/pg/adapter.d.ts +0 -76
  21. package/dist/pg/adapter.d.ts.map +0 -1
  22. package/dist/pg/manager.d.ts +0 -18
  23. package/dist/pg/manager.d.ts.map +0 -1
  24. package/dist/pglite/adapter.d.ts +0 -75
  25. package/dist/pglite/adapter.d.ts.map +0 -1
  26. package/dist/pglite/manager.d.ts +0 -22
  27. package/dist/pglite/manager.d.ts.map +0 -1
  28. package/dist/schema/agent.d.ts +0 -328
  29. package/dist/schema/agent.d.ts.map +0 -1
  30. package/dist/schema/cache.d.ts +0 -98
  31. package/dist/schema/cache.d.ts.map +0 -1
  32. package/dist/schema/channel.d.ts +0 -178
  33. package/dist/schema/channel.d.ts.map +0 -1
  34. package/dist/schema/channelParticipant.d.ts +0 -42
  35. package/dist/schema/channelParticipant.d.ts.map +0 -1
  36. package/dist/schema/component.d.ts +0 -164
  37. package/dist/schema/component.d.ts.map +0 -1
  38. package/dist/schema/embedding.d.ts +0 -194
  39. package/dist/schema/embedding.d.ts.map +0 -1
  40. package/dist/schema/entity.d.ts +0 -123
  41. package/dist/schema/entity.d.ts.map +0 -1
  42. package/dist/schema/factory.d.ts +0 -60
  43. package/dist/schema/factory.d.ts.map +0 -1
  44. package/dist/schema/index.d.ts +0 -18
  45. package/dist/schema/index.d.ts.map +0 -1
  46. package/dist/schema/log.d.ts +0 -115
  47. package/dist/schema/log.d.ts.map +0 -1
  48. package/dist/schema/memory.d.ts +0 -189
  49. package/dist/schema/memory.d.ts.map +0 -1
  50. package/dist/schema/message.d.ts +0 -2
  51. package/dist/schema/message.d.ts.map +0 -1
  52. package/dist/schema/messageServer.d.ts +0 -127
  53. package/dist/schema/messageServer.d.ts.map +0 -1
  54. package/dist/schema/participant.d.ts +0 -115
  55. package/dist/schema/participant.d.ts.map +0 -1
  56. package/dist/schema/relationship.d.ts +0 -157
  57. package/dist/schema/relationship.d.ts.map +0 -1
  58. package/dist/schema/room.d.ts +0 -193
  59. package/dist/schema/room.d.ts.map +0 -1
  60. package/dist/schema/serverAgent.d.ts +0 -42
  61. package/dist/schema/serverAgent.d.ts.map +0 -1
  62. package/dist/schema/tasks.d.ts +0 -226
  63. package/dist/schema/tasks.d.ts.map +0 -1
  64. package/dist/schema/types.d.ts +0 -69
  65. package/dist/schema/types.d.ts.map +0 -1
  66. package/dist/schema/world.d.ts +0 -115
  67. package/dist/schema/world.d.ts.map +0 -1
  68. package/dist/types.d.ts +0 -16
  69. package/dist/types.d.ts.map +0 -1
  70. package/dist/utils.d.ts +0 -33
  71. package/dist/utils.d.ts.map +0 -1
@@ -1,226 +0,0 @@
1
- /**
2
- * Represents a table schema for tasks in the database.
3
- *
4
- * @type {PgTable}
5
- */
6
- export declare const taskTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
7
- name: "tasks";
8
- schema: undefined;
9
- columns: {
10
- id: import("drizzle-orm/pg-core").PgColumn<{
11
- name: "id";
12
- tableName: "tasks";
13
- dataType: "string";
14
- columnType: "PgUUID";
15
- data: string;
16
- driverParam: string;
17
- notNull: true;
18
- hasDefault: true;
19
- isPrimaryKey: true;
20
- isAutoincrement: false;
21
- hasRuntimeDefault: false;
22
- enumValues: undefined;
23
- baseColumn: never;
24
- identity: undefined;
25
- generated: undefined;
26
- }, {}, {}>;
27
- name: import("drizzle-orm/pg-core").PgColumn<{
28
- name: "name";
29
- tableName: "tasks";
30
- dataType: "string";
31
- columnType: "PgText";
32
- data: string;
33
- driverParam: string;
34
- notNull: true;
35
- hasDefault: false;
36
- isPrimaryKey: false;
37
- isAutoincrement: false;
38
- hasRuntimeDefault: false;
39
- enumValues: [string, ...string[]];
40
- baseColumn: never;
41
- identity: undefined;
42
- generated: undefined;
43
- }, {}, {}>;
44
- description: import("drizzle-orm/pg-core").PgColumn<{
45
- name: "description";
46
- tableName: "tasks";
47
- dataType: "string";
48
- columnType: "PgText";
49
- data: string;
50
- driverParam: string;
51
- notNull: false;
52
- hasDefault: false;
53
- isPrimaryKey: false;
54
- isAutoincrement: false;
55
- hasRuntimeDefault: false;
56
- enumValues: [string, ...string[]];
57
- baseColumn: never;
58
- identity: undefined;
59
- generated: undefined;
60
- }, {}, {}>;
61
- roomId: import("drizzle-orm/pg-core").PgColumn<{
62
- name: "roomId";
63
- tableName: "tasks";
64
- dataType: "string";
65
- columnType: "PgUUID";
66
- data: string;
67
- driverParam: string;
68
- notNull: false;
69
- hasDefault: false;
70
- isPrimaryKey: false;
71
- isAutoincrement: false;
72
- hasRuntimeDefault: false;
73
- enumValues: undefined;
74
- baseColumn: never;
75
- identity: undefined;
76
- generated: undefined;
77
- }, {}, {}>;
78
- worldId: import("drizzle-orm/pg-core").PgColumn<{
79
- name: "worldId";
80
- tableName: "tasks";
81
- dataType: "string";
82
- columnType: "PgUUID";
83
- data: string;
84
- driverParam: string;
85
- notNull: false;
86
- hasDefault: false;
87
- isPrimaryKey: false;
88
- isAutoincrement: false;
89
- hasRuntimeDefault: false;
90
- enumValues: undefined;
91
- baseColumn: never;
92
- identity: undefined;
93
- generated: undefined;
94
- }, {}, {}>;
95
- entityId: import("drizzle-orm/pg-core").PgColumn<{
96
- name: "entityId";
97
- tableName: "tasks";
98
- dataType: "string";
99
- columnType: "PgUUID";
100
- data: string;
101
- driverParam: string;
102
- notNull: false;
103
- hasDefault: false;
104
- isPrimaryKey: false;
105
- isAutoincrement: false;
106
- hasRuntimeDefault: false;
107
- enumValues: undefined;
108
- baseColumn: never;
109
- identity: undefined;
110
- generated: undefined;
111
- }, {}, {}>;
112
- agentId: import("drizzle-orm/pg-core").PgColumn<{
113
- name: "agent_id";
114
- tableName: "tasks";
115
- dataType: "string";
116
- columnType: "PgUUID";
117
- data: string;
118
- driverParam: string;
119
- notNull: true;
120
- hasDefault: false;
121
- isPrimaryKey: false;
122
- isAutoincrement: false;
123
- hasRuntimeDefault: false;
124
- enumValues: undefined;
125
- baseColumn: never;
126
- identity: undefined;
127
- generated: undefined;
128
- }, {}, {}>;
129
- tags: import("drizzle-orm/pg-core").PgColumn<{
130
- name: "tags";
131
- tableName: "tasks";
132
- dataType: "array";
133
- columnType: "PgArray";
134
- data: string[];
135
- driverParam: string | string[];
136
- notNull: false;
137
- hasDefault: true;
138
- isPrimaryKey: false;
139
- isAutoincrement: false;
140
- hasRuntimeDefault: false;
141
- enumValues: [string, ...string[]];
142
- baseColumn: import("drizzle-orm").Column<{
143
- name: "tags";
144
- tableName: "tasks";
145
- dataType: "string";
146
- columnType: "PgText";
147
- data: string;
148
- driverParam: string;
149
- notNull: false;
150
- hasDefault: false;
151
- isPrimaryKey: false;
152
- isAutoincrement: false;
153
- hasRuntimeDefault: false;
154
- enumValues: [string, ...string[]];
155
- baseColumn: never;
156
- identity: undefined;
157
- generated: undefined;
158
- }, {}, {}>;
159
- identity: undefined;
160
- generated: undefined;
161
- }, {}, {
162
- baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
163
- name: "tags";
164
- dataType: "string";
165
- columnType: "PgText";
166
- data: string;
167
- enumValues: [string, ...string[]];
168
- driverParam: string;
169
- }, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
170
- size: undefined;
171
- }>;
172
- metadata: import("drizzle-orm/pg-core").PgColumn<{
173
- name: "metadata";
174
- tableName: "tasks";
175
- dataType: "json";
176
- columnType: "PgJsonb";
177
- data: unknown;
178
- driverParam: unknown;
179
- notNull: false;
180
- hasDefault: true;
181
- isPrimaryKey: false;
182
- isAutoincrement: false;
183
- hasRuntimeDefault: false;
184
- enumValues: undefined;
185
- baseColumn: never;
186
- identity: undefined;
187
- generated: undefined;
188
- }, {}, {}>;
189
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
190
- name: "created_at";
191
- tableName: "tasks";
192
- dataType: "date";
193
- columnType: "PgTimestamp";
194
- data: Date;
195
- driverParam: string;
196
- notNull: false;
197
- hasDefault: true;
198
- isPrimaryKey: false;
199
- isAutoincrement: false;
200
- hasRuntimeDefault: false;
201
- enumValues: undefined;
202
- baseColumn: never;
203
- identity: undefined;
204
- generated: undefined;
205
- }, {}, {}>;
206
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
207
- name: "updated_at";
208
- tableName: "tasks";
209
- dataType: "date";
210
- columnType: "PgTimestamp";
211
- data: Date;
212
- driverParam: string;
213
- notNull: false;
214
- hasDefault: true;
215
- isPrimaryKey: false;
216
- isAutoincrement: false;
217
- hasRuntimeDefault: false;
218
- enumValues: undefined;
219
- baseColumn: never;
220
- identity: undefined;
221
- generated: undefined;
222
- }, {}, {}>;
223
- };
224
- dialect: "pg";
225
- }>;
226
- //# sourceMappingURL=tasks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/schema/tasks.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpB,CAAC"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Represents a custom type for converting a string to a JSONB format and vice versa.
3
- * @param {Object} options - The options for the custom type.
4
- * @param {Function} options.dataType - A function that returns the data type as "jsonb".
5
- * @param {Function} options.toDriver - A function that converts a string to a JSON string.
6
- * @param {Function} options.fromDriver - A function that converts a JSON string back to a string.
7
- * @returns {Object} - The custom type for string to JSONB conversion.
8
- */
9
- export declare const stringJsonb: {
10
- (): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
11
- name: "";
12
- dataType: "custom";
13
- columnType: "PgCustomColumn";
14
- data: string;
15
- driverParam: string;
16
- enumValues: undefined;
17
- }>;
18
- <TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
19
- name: "";
20
- dataType: "custom";
21
- columnType: "PgCustomColumn";
22
- data: string;
23
- driverParam: string;
24
- enumValues: undefined;
25
- }>;
26
- <TName extends string>(dbName: TName, fieldConfig?: unknown): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
27
- name: TName;
28
- dataType: "custom";
29
- columnType: "PgCustomColumn";
30
- data: string;
31
- driverParam: string;
32
- enumValues: undefined;
33
- }>;
34
- };
35
- /**
36
- * Represents a custom type for converting a number to a timestamp string and vice versa.
37
- * @param {Object} options - The options for the custom type.
38
- * @param {Function} options.dataType - A function that returns the data type as "timestamptz".
39
- * @param {Function} options.toDriver - A function that converts a number to a timestamp string using the Date object's toISOString method.
40
- * @param {Function} options.fromDriver - A function that converts a timestamp string to a number using the Date object's getTime method.
41
- * @returns {Object} - The custom type for number to timestamp conversion.
42
- */
43
- export declare const numberTimestamp: {
44
- (): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
45
- name: "";
46
- dataType: "custom";
47
- columnType: "PgCustomColumn";
48
- data: number;
49
- driverParam: string;
50
- enumValues: undefined;
51
- }>;
52
- <TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
53
- name: "";
54
- dataType: "custom";
55
- columnType: "PgCustomColumn";
56
- data: number;
57
- driverParam: string;
58
- enumValues: undefined;
59
- }>;
60
- <TName extends string>(dbName: TName, fieldConfig?: unknown): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
61
- name: TName;
62
- dataType: "custom";
63
- columnType: "PgCustomColumn";
64
- data: number;
65
- driverParam: string;
66
- enumValues: undefined;
67
- }>;
68
- };
69
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAUtB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAU1B,CAAC"}
@@ -1,115 +0,0 @@
1
- /**
2
- * Represents a table schema for worlds in the database.
3
- *
4
- * @type {PgTable}
5
- */
6
- export declare const worldTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
7
- name: "worlds";
8
- schema: undefined;
9
- columns: {
10
- id: import("drizzle-orm/pg-core").PgColumn<{
11
- name: "id";
12
- tableName: "worlds";
13
- dataType: "string";
14
- columnType: "PgUUID";
15
- data: string;
16
- driverParam: string;
17
- notNull: true;
18
- hasDefault: true;
19
- isPrimaryKey: true;
20
- isAutoincrement: false;
21
- hasRuntimeDefault: false;
22
- enumValues: undefined;
23
- baseColumn: never;
24
- identity: undefined;
25
- generated: undefined;
26
- }, {}, {}>;
27
- agentId: import("drizzle-orm/pg-core").PgColumn<{
28
- name: "agentId";
29
- tableName: "worlds";
30
- dataType: "string";
31
- columnType: "PgUUID";
32
- data: string;
33
- driverParam: string;
34
- notNull: true;
35
- hasDefault: false;
36
- isPrimaryKey: false;
37
- isAutoincrement: false;
38
- hasRuntimeDefault: false;
39
- enumValues: undefined;
40
- baseColumn: never;
41
- identity: undefined;
42
- generated: undefined;
43
- }, {}, {}>;
44
- name: import("drizzle-orm/pg-core").PgColumn<{
45
- name: "name";
46
- tableName: "worlds";
47
- dataType: "string";
48
- columnType: "PgText";
49
- data: string;
50
- driverParam: string;
51
- notNull: true;
52
- hasDefault: false;
53
- isPrimaryKey: false;
54
- isAutoincrement: false;
55
- hasRuntimeDefault: false;
56
- enumValues: [string, ...string[]];
57
- baseColumn: never;
58
- identity: undefined;
59
- generated: undefined;
60
- }, {}, {}>;
61
- metadata: import("drizzle-orm/pg-core").PgColumn<{
62
- name: "metadata";
63
- tableName: "worlds";
64
- dataType: "json";
65
- columnType: "PgJsonb";
66
- data: unknown;
67
- driverParam: unknown;
68
- notNull: false;
69
- hasDefault: false;
70
- isPrimaryKey: false;
71
- isAutoincrement: false;
72
- hasRuntimeDefault: false;
73
- enumValues: undefined;
74
- baseColumn: never;
75
- identity: undefined;
76
- generated: undefined;
77
- }, {}, {}>;
78
- serverId: import("drizzle-orm/pg-core").PgColumn<{
79
- name: "serverId";
80
- tableName: "worlds";
81
- dataType: "string";
82
- columnType: "PgText";
83
- data: string;
84
- driverParam: string;
85
- notNull: true;
86
- hasDefault: true;
87
- isPrimaryKey: false;
88
- isAutoincrement: false;
89
- hasRuntimeDefault: false;
90
- enumValues: [string, ...string[]];
91
- baseColumn: never;
92
- identity: undefined;
93
- generated: undefined;
94
- }, {}, {}>;
95
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
96
- name: "createdAt";
97
- tableName: "worlds";
98
- dataType: "date";
99
- columnType: "PgTimestamp";
100
- data: Date;
101
- driverParam: string;
102
- notNull: true;
103
- hasDefault: true;
104
- isPrimaryKey: false;
105
- isAutoincrement: false;
106
- hasRuntimeDefault: false;
107
- enumValues: undefined;
108
- baseColumn: never;
109
- identity: undefined;
110
- generated: undefined;
111
- }, {}, {}>;
112
- };
113
- dialect: "pg";
114
- }>;
115
- //# sourceMappingURL=world.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/schema/world.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrB,CAAC"}
package/dist/types.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { NodePgDatabase } from 'drizzle-orm/node-postgres';
2
- import type { PgliteDatabase } from 'drizzle-orm/pglite';
3
- /**
4
- * Represents a type that can be either a NodePgDatabase or a PgliteDatabase.
5
- */
6
- export type DrizzleDatabase = NodePgDatabase | PgliteDatabase;
7
- /**
8
- * Interface for managing a database client.
9
- * @template T - The type of the database connection object.
10
- */
11
- export interface IDatabaseClientManager<T> {
12
- initialize(): Promise<void>;
13
- getConnection(): T;
14
- close(): Promise<void>;
15
- }
16
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,cAAc,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,aAAa,IAAI,CAAC,CAAC;IACnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
package/dist/utils.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * Expands a file path starting with `~` to the project directory.
3
- *
4
- * @param filepath - The path to expand.
5
- * @returns The expanded path.
6
- */
7
- export declare function expandTildePath(filepath: string): string;
8
- /**
9
- * Resolves the path to the nearest `.env` file.
10
- *
11
- * If no `.env` file is found when traversing up from the starting directory,
12
- * a path to `.env` in the starting directory is returned.
13
- *
14
- * @param startDir - The directory to start searching from. Defaults to the
15
- * current working directory.
16
- * @returns The resolved path to the `.env` file.
17
- */
18
- export declare function resolveEnvFile(startDir?: string): string;
19
- /**
20
- * Resolves the directory used for PGlite database storage.
21
- *
22
- * Resolution order:
23
- * 1. The `dir` argument if provided.
24
- * 2. The `PGLITE_DATA_DIR` environment variable.
25
- * 3. The `fallbackDir` argument if provided.
26
- * 4. `./.eliza/.elizadb` relative to the current working directory.
27
- *
28
- * @param dir - Optional directory preference.
29
- * @param fallbackDir - Optional fallback directory when env var is not set.
30
- * @returns The resolved data directory with any tilde expanded.
31
- */
32
- export declare function resolvePgliteDir(dir?: string, fallbackDir?: string): string;
33
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAiBvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAmC3E"}