@absolutejs/voice 0.0.22-beta.536 → 0.0.22-beta.538
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.
|
@@ -21,6 +21,23 @@ export declare const voiceAssistantMemoryTable: import("drizzle-orm/pg-core").Pg
|
|
|
21
21
|
identity: undefined;
|
|
22
22
|
generated: undefined;
|
|
23
23
|
}, {}, {}>;
|
|
24
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
|
+
name: "id";
|
|
26
|
+
tableName: "voice_assistant_memory";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "PgText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: true;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
24
41
|
key: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
42
|
name: "key";
|
|
26
43
|
tableName: "voice_assistant_memory";
|
package/dist/drizzle/index.d.ts
CHANGED
|
@@ -28,6 +28,23 @@ export declare const voiceDrizzleSchema: {
|
|
|
28
28
|
identity: undefined;
|
|
29
29
|
generated: undefined;
|
|
30
30
|
}, {}, {}>;
|
|
31
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
32
|
+
name: "id";
|
|
33
|
+
tableName: "voice_assistant_memory";
|
|
34
|
+
dataType: "string";
|
|
35
|
+
columnType: "PgText";
|
|
36
|
+
data: string;
|
|
37
|
+
driverParam: string;
|
|
38
|
+
notNull: true;
|
|
39
|
+
hasDefault: false;
|
|
40
|
+
isPrimaryKey: true;
|
|
41
|
+
isAutoincrement: false;
|
|
42
|
+
hasRuntimeDefault: false;
|
|
43
|
+
enumValues: [string, ...string[]];
|
|
44
|
+
baseColumn: never;
|
|
45
|
+
identity: undefined;
|
|
46
|
+
generated: undefined;
|
|
47
|
+
}, {}, {}>;
|
|
31
48
|
key: import("drizzle-orm/pg-core").PgColumn<{
|
|
32
49
|
name: "key";
|
|
33
50
|
tableName: "voice_assistant_memory";
|
package/dist/drizzle/index.js
CHANGED
|
@@ -85,7 +85,7 @@ var __require = import.meta.require;
|
|
|
85
85
|
|
|
86
86
|
// src/drizzle/assistantMemory.ts
|
|
87
87
|
import { and, desc, eq } from "drizzle-orm";
|
|
88
|
-
import { bigint, jsonb, pgTable,
|
|
88
|
+
import { bigint, jsonb, pgTable, text } from "drizzle-orm/pg-core";
|
|
89
89
|
|
|
90
90
|
// src/core/assistantMemory.ts
|
|
91
91
|
var createMemoryId = (input) => `${input.assistantId}:${input.namespace}:${input.key}`;
|
|
@@ -196,24 +196,22 @@ var resolveVoiceAssistantMemoryNamespace = async (input) => typeof input.memory.
|
|
|
196
196
|
// src/drizzle/assistantMemory.ts
|
|
197
197
|
var voiceAssistantMemoryTable = pgTable("voice_assistant_memory", {
|
|
198
198
|
assistantId: text("assistant_id").notNull(),
|
|
199
|
+
id: text("id").primaryKey(),
|
|
199
200
|
key: text("key").notNull(),
|
|
200
201
|
namespace: text("namespace").notNull(),
|
|
201
202
|
payload: jsonb("payload").notNull(),
|
|
202
203
|
sortAt: bigint("sort_at", { mode: "number" }).notNull()
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
columns: [table.assistantId, table.namespace, table.key]
|
|
206
|
-
})
|
|
207
|
-
]);
|
|
204
|
+
});
|
|
205
|
+
var voiceAssistantMemoryId = (input) => JSON.stringify([input.assistantId, input.namespace, input.key]);
|
|
208
206
|
var createDrizzleAssistantMemoryStore = (db) => {
|
|
209
207
|
const get = async (input) => {
|
|
210
|
-
const rows = await db.select({ payload: voiceAssistantMemoryTable.payload }).from(voiceAssistantMemoryTable).where(
|
|
208
|
+
const rows = await db.select({ payload: voiceAssistantMemoryTable.payload }).from(voiceAssistantMemoryTable).where(eq(voiceAssistantMemoryTable.id, voiceAssistantMemoryId(input))).limit(1);
|
|
211
209
|
return rows[0]?.payload;
|
|
212
210
|
};
|
|
213
211
|
return {
|
|
214
212
|
get,
|
|
215
213
|
delete: async (input) => {
|
|
216
|
-
await db.delete(voiceAssistantMemoryTable).where(
|
|
214
|
+
await db.delete(voiceAssistantMemoryTable).where(eq(voiceAssistantMemoryTable.id, voiceAssistantMemoryId(input)));
|
|
217
215
|
},
|
|
218
216
|
list: async (input) => {
|
|
219
217
|
const rows = await db.select({ payload: voiceAssistantMemoryTable.payload }).from(voiceAssistantMemoryTable).where(input.namespace === undefined ? eq(voiceAssistantMemoryTable.assistantId, input.assistantId) : and(eq(voiceAssistantMemoryTable.assistantId, input.assistantId), eq(voiceAssistantMemoryTable.namespace, input.namespace))).orderBy(desc(voiceAssistantMemoryTable.sortAt));
|
|
@@ -228,6 +226,7 @@ var createDrizzleAssistantMemoryStore = (db) => {
|
|
|
228
226
|
});
|
|
229
227
|
await db.insert(voiceAssistantMemoryTable).values({
|
|
230
228
|
assistantId: record.assistantId,
|
|
229
|
+
id: voiceAssistantMemoryId(record),
|
|
231
230
|
key: record.key,
|
|
232
231
|
namespace: record.namespace,
|
|
233
232
|
payload: record,
|
|
@@ -237,11 +236,7 @@ var createDrizzleAssistantMemoryStore = (db) => {
|
|
|
237
236
|
payload: record,
|
|
238
237
|
sortAt: record.updatedAt
|
|
239
238
|
},
|
|
240
|
-
target:
|
|
241
|
-
voiceAssistantMemoryTable.assistantId,
|
|
242
|
-
voiceAssistantMemoryTable.namespace,
|
|
243
|
-
voiceAssistantMemoryTable.key
|
|
244
|
-
]
|
|
239
|
+
target: voiceAssistantMemoryTable.id
|
|
245
240
|
});
|
|
246
241
|
return record;
|
|
247
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/voice",
|
|
3
|
-
"version": "0.0.22-beta.
|
|
3
|
+
"version": "0.0.22-beta.538",
|
|
4
4
|
"description": "Voice primitives and Elysia plugin for AbsoluteJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"./drizzle": {
|
|
60
60
|
"import": "./dist/drizzle/index.js",
|
|
61
|
-
"types": "./dist/drizzle/index.d.ts"
|
|
61
|
+
"types": "./dist/drizzle/index.d.ts",
|
|
62
|
+
"default": "./dist/drizzle/index.js"
|
|
62
63
|
},
|
|
63
64
|
"./testing": {
|
|
64
65
|
"import": "./dist/testing/index.js",
|