bertrand 0.25.1 → 0.26.0
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.
- package/dist/bertrand.js +7 -7
- package/dist/dashboard/assets/index-DyWg1D46.js +696 -0
- package/dist/dashboard/assets/index-fpXRi6i0.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/run-screen.js +5 -5
- package/package.json +1 -1
- package/dist/dashboard/assets/index-DVv_2taj.js +0 -696
- package/dist/dashboard/assets/index-ldnBrPCg.css +0 -1
package/dist/bertrand.js
CHANGED
|
@@ -890,7 +890,7 @@ var init_parse_session_name = __esm(() => {
|
|
|
890
890
|
});
|
|
891
891
|
|
|
892
892
|
// src/db/queries/sessions.ts
|
|
893
|
-
import { eq as eq2, and, inArray, sql as sql2 } from "drizzle-orm";
|
|
893
|
+
import { eq as eq2, and, inArray, sql as sql2, desc } from "drizzle-orm";
|
|
894
894
|
function resolveSessionByName(name) {
|
|
895
895
|
const flat = parseSessionName(name);
|
|
896
896
|
const flatCategory = getCategoryByPath(flat.categoryPath);
|
|
@@ -942,9 +942,9 @@ function selectSessions(db, opts) {
|
|
|
942
942
|
"active",
|
|
943
943
|
"waiting",
|
|
944
944
|
"paused"
|
|
945
|
-
])).all();
|
|
945
|
+
])).orderBy(desc(sessions.updatedAt)).all();
|
|
946
946
|
}
|
|
947
|
-
return query.all();
|
|
947
|
+
return query.orderBy(desc(sessions.updatedAt)).all();
|
|
948
948
|
}
|
|
949
949
|
function getAllSessions(opts) {
|
|
950
950
|
return selectSessions(getDb(), opts);
|
|
@@ -973,7 +973,7 @@ var init_sessions = __esm(() => {
|
|
|
973
973
|
});
|
|
974
974
|
|
|
975
975
|
// src/db/queries/conversations.ts
|
|
976
|
-
import { eq as eq3, and as and2, desc, sql as sql3 } from "drizzle-orm";
|
|
976
|
+
import { eq as eq3, and as and2, desc as desc2, sql as sql3 } from "drizzle-orm";
|
|
977
977
|
function createConversation(opts) {
|
|
978
978
|
return getDb().insert(conversations).values(opts).returning().get();
|
|
979
979
|
}
|
|
@@ -981,7 +981,7 @@ function getConversation(id) {
|
|
|
981
981
|
return getDb().select().from(conversations).where(eq3(conversations.id, id)).get();
|
|
982
982
|
}
|
|
983
983
|
function getConversationsBySession(sessionId) {
|
|
984
|
-
return getDb().select().from(conversations).where(and2(eq3(conversations.sessionId, sessionId), eq3(conversations.discarded, false))).orderBy(
|
|
984
|
+
return getDb().select().from(conversations).where(and2(eq3(conversations.sessionId, sessionId), eq3(conversations.discarded, false))).orderBy(desc2(conversations.startedAt)).all();
|
|
985
985
|
}
|
|
986
986
|
function endConversation(id) {
|
|
987
987
|
return getDb().update(conversations).set({ endedAt: sql3`(datetime('now'))` }).where(eq3(conversations.id, id)).returning().get();
|
|
@@ -1038,7 +1038,7 @@ function normalizeAnsweredMeta(meta) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
// src/db/queries/events.ts
|
|
1041
|
-
import { eq as eq4, and as and3, desc as
|
|
1041
|
+
import { eq as eq4, and as and3, desc as desc3 } from "drizzle-orm";
|
|
1042
1042
|
function insertEvent(opts) {
|
|
1043
1043
|
return getDb().insert(events).values({
|
|
1044
1044
|
sessionId: opts.sessionId,
|
|
@@ -1062,7 +1062,7 @@ function getLatestEventOfType(sessionId, eventType, conversationId) {
|
|
|
1062
1062
|
if (conversationId) {
|
|
1063
1063
|
conditions.push(eq4(events.conversationId, conversationId));
|
|
1064
1064
|
}
|
|
1065
|
-
return getDb().select().from(events).where(and3(...conditions)).orderBy(
|
|
1065
|
+
return getDb().select().from(events).where(and3(...conditions)).orderBy(desc3(events.createdAt)).limit(1).get();
|
|
1066
1066
|
}
|
|
1067
1067
|
var init_events = __esm(() => {
|
|
1068
1068
|
init_client();
|