@automagik/omni 2.260720.2 → 2.260721.1
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/index.js +1 -1
- package/dist/server/index.js +23 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125191,7 +125191,7 @@ import { fileURLToPath } from "url";
|
|
|
125191
125191
|
// package.json
|
|
125192
125192
|
var package_default = {
|
|
125193
125193
|
name: "@automagik/omni",
|
|
125194
|
-
version: "2.
|
|
125194
|
+
version: "2.260721.1",
|
|
125195
125195
|
description: "LLM-optimized CLI for Omni",
|
|
125196
125196
|
type: "module",
|
|
125197
125197
|
bin: {
|
package/dist/server/index.js
CHANGED
|
@@ -227026,7 +227026,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
227026
227026
|
var require_package7 = __commonJS((exports, module) => {
|
|
227027
227027
|
module.exports = {
|
|
227028
227028
|
name: "@omni/api",
|
|
227029
|
-
version: "2.
|
|
227029
|
+
version: "2.260721.1",
|
|
227030
227030
|
type: "module",
|
|
227031
227031
|
exports: {
|
|
227032
227032
|
".": {
|
|
@@ -337808,6 +337808,19 @@ var init_instances = __esm(() => {
|
|
|
337808
337808
|
});
|
|
337809
337809
|
|
|
337810
337810
|
// ../api/src/services/messages.ts
|
|
337811
|
+
function sanitizeMediaText(data) {
|
|
337812
|
+
const out = { ...data };
|
|
337813
|
+
if (typeof out.transcription === "string")
|
|
337814
|
+
out.transcription = sanitizeText(out.transcription) ?? "";
|
|
337815
|
+
if (typeof out.imageDescription === "string")
|
|
337816
|
+
out.imageDescription = sanitizeText(out.imageDescription) ?? "";
|
|
337817
|
+
if (typeof out.videoDescription === "string")
|
|
337818
|
+
out.videoDescription = sanitizeText(out.videoDescription) ?? "";
|
|
337819
|
+
if (typeof out.documentExtraction === "string") {
|
|
337820
|
+
out.documentExtraction = sanitizeText(out.documentExtraction) ?? "";
|
|
337821
|
+
}
|
|
337822
|
+
return out;
|
|
337823
|
+
}
|
|
337811
337824
|
function buildMessagePreview(options) {
|
|
337812
337825
|
const sender = options.isFromMe ? "You" : options.senderDisplayName ?? null;
|
|
337813
337826
|
let content;
|
|
@@ -338001,10 +338014,10 @@ class MessageService {
|
|
|
338001
338014
|
mediaUrl: options.mediaUrl,
|
|
338002
338015
|
mediaLocalPath: options.mediaLocalPath,
|
|
338003
338016
|
mediaMetadata: options.mediaMetadata,
|
|
338004
|
-
transcription: options.transcription,
|
|
338005
|
-
imageDescription: options.imageDescription,
|
|
338006
|
-
videoDescription: options.videoDescription,
|
|
338007
|
-
documentExtraction: options.documentExtraction,
|
|
338017
|
+
transcription: sanitizeText(options.transcription),
|
|
338018
|
+
imageDescription: sanitizeText(options.imageDescription),
|
|
338019
|
+
videoDescription: sanitizeText(options.videoDescription),
|
|
338020
|
+
documentExtraction: sanitizeText(options.documentExtraction),
|
|
338008
338021
|
replyToMessageId: options.replyToMessageId,
|
|
338009
338022
|
replyToExternalId: options.replyToExternalId,
|
|
338010
338023
|
quotedText: options.quotedText,
|
|
@@ -338079,7 +338092,7 @@ class MessageService {
|
|
|
338079
338092
|
return { message: message2, created: true };
|
|
338080
338093
|
}
|
|
338081
338094
|
async update(id, data) {
|
|
338082
|
-
const [updated] = await this.db.update(messages2).set({ ...data, updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338095
|
+
const [updated] = await this.db.update(messages2).set({ ...sanitizeMediaText(data), updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338083
338096
|
if (!updated) {
|
|
338084
338097
|
throw new NotFoundError("Message", id);
|
|
338085
338098
|
}
|
|
@@ -338183,28 +338196,28 @@ class MessageService {
|
|
|
338183
338196
|
return updated;
|
|
338184
338197
|
}
|
|
338185
338198
|
async updateTranscription(id, transcription) {
|
|
338186
|
-
const [updated] = await this.db.update(messages2).set({ transcription, updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338199
|
+
const [updated] = await this.db.update(messages2).set({ transcription: sanitizeText(transcription) ?? "", updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338187
338200
|
if (!updated) {
|
|
338188
338201
|
throw new NotFoundError("Message", id);
|
|
338189
338202
|
}
|
|
338190
338203
|
return updated;
|
|
338191
338204
|
}
|
|
338192
338205
|
async updateImageDescription(id, description) {
|
|
338193
|
-
const [updated] = await this.db.update(messages2).set({ imageDescription: description, updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338206
|
+
const [updated] = await this.db.update(messages2).set({ imageDescription: sanitizeText(description) ?? "", updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338194
338207
|
if (!updated) {
|
|
338195
338208
|
throw new NotFoundError("Message", id);
|
|
338196
338209
|
}
|
|
338197
338210
|
return updated;
|
|
338198
338211
|
}
|
|
338199
338212
|
async updateVideoDescription(id, description) {
|
|
338200
|
-
const [updated] = await this.db.update(messages2).set({ videoDescription: description, updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338213
|
+
const [updated] = await this.db.update(messages2).set({ videoDescription: sanitizeText(description) ?? "", updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338201
338214
|
if (!updated) {
|
|
338202
338215
|
throw new NotFoundError("Message", id);
|
|
338203
338216
|
}
|
|
338204
338217
|
return updated;
|
|
338205
338218
|
}
|
|
338206
338219
|
async updateDocumentExtraction(id, extraction) {
|
|
338207
|
-
const [updated] = await this.db.update(messages2).set({ documentExtraction: extraction, updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338220
|
+
const [updated] = await this.db.update(messages2).set({ documentExtraction: sanitizeText(extraction) ?? "", updatedAt: new Date }).where(eq(messages2.id, id)).returning();
|
|
338208
338221
|
if (!updated) {
|
|
338209
338222
|
throw new NotFoundError("Message", id);
|
|
338210
338223
|
}
|