@automagik/omni 2.260601.1 → 2.260602.2
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/commands/persons.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/server/index.js +77 -9
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persons.d.ts","sourceRoot":"","sources":["../../src/commands/persons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"persons.d.ts","sourceRoot":"","sources":["../../src/commands/persons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,IAAI,OAAO,CAyL9C"}
|
package/dist/index.js
CHANGED
|
@@ -124967,7 +124967,7 @@ import { fileURLToPath } from "url";
|
|
|
124967
124967
|
// package.json
|
|
124968
124968
|
var package_default = {
|
|
124969
124969
|
name: "@automagik/omni",
|
|
124970
|
-
version: "2.
|
|
124970
|
+
version: "2.260602.2",
|
|
124971
124971
|
description: "LLM-optimized CLI for Omni",
|
|
124972
124972
|
type: "module",
|
|
124973
124973
|
bin: {
|
|
@@ -134834,8 +134834,8 @@ function createPersonsCommand() {
|
|
|
134834
134834
|
const items = persons3.map((p11) => ({
|
|
134835
134835
|
id: p11.id,
|
|
134836
134836
|
displayName: p11.displayName ?? "-",
|
|
134837
|
-
email: p11.email ?? "-",
|
|
134838
|
-
phone: p11.phone ?? "-"
|
|
134837
|
+
email: p11.primaryEmail ?? p11.email ?? "-",
|
|
134838
|
+
phone: p11.primaryPhone ?? p11.phone ?? "-"
|
|
134839
134839
|
}));
|
|
134840
134840
|
list(items, { emptyMessage: "No persons found." });
|
|
134841
134841
|
} catch (err2) {
|
package/dist/server/index.js
CHANGED
|
@@ -225241,7 +225241,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
225241
225241
|
var require_package7 = __commonJS((exports, module) => {
|
|
225242
225242
|
module.exports = {
|
|
225243
225243
|
name: "@omni/api",
|
|
225244
|
-
version: "2.
|
|
225244
|
+
version: "2.260602.2",
|
|
225245
225245
|
type: "module",
|
|
225246
225246
|
exports: {
|
|
225247
225247
|
".": {
|
|
@@ -311383,8 +311383,7 @@ class GeminiVideoGenProvider {
|
|
|
311383
311383
|
aspectRatio,
|
|
311384
311384
|
...options?.durationSec !== undefined ? { durationSeconds: options.durationSec } : {},
|
|
311385
311385
|
...options?.seed !== undefined ? { seed: options.seed } : {},
|
|
311386
|
-
...options?.resolution !== undefined ? { resolution: options.resolution } : {}
|
|
311387
|
-
...!options?.imageBase64 ? { generateAudio: options?.audio !== false } : {}
|
|
311386
|
+
...options?.resolution !== undefined ? { resolution: options.resolution } : {}
|
|
311388
311387
|
}
|
|
311389
311388
|
};
|
|
311390
311389
|
if (options?.imageBase64) {
|
|
@@ -336171,7 +336170,66 @@ class PersonService {
|
|
|
336171
336170
|
}
|
|
336172
336171
|
async search(query, limit2 = 20) {
|
|
336173
336172
|
const searchPattern = `%${query}%`;
|
|
336174
|
-
|
|
336173
|
+
const result = await this.db.execute(sql`
|
|
336174
|
+
WITH candidates AS (
|
|
336175
|
+
SELECT
|
|
336176
|
+
p.id,
|
|
336177
|
+
CASE
|
|
336178
|
+
WHEN p.display_name ILIKE ${searchPattern} ESCAPE '' THEN p.display_name
|
|
336179
|
+
WHEN pi.platform_username ILIKE ${searchPattern} ESCAPE '' THEN pi.platform_username
|
|
336180
|
+
WHEN cp.display_name ILIKE ${searchPattern} ESCAPE '' THEN cp.display_name
|
|
336181
|
+
ELSE COALESCE(NULLIF(p.display_name, ''), NULLIF(pi.platform_username, ''), NULLIF(cp.display_name, ''))
|
|
336182
|
+
END AS "displayName",
|
|
336183
|
+
p.primary_phone AS "primaryPhone",
|
|
336184
|
+
p.primary_email AS "primaryEmail",
|
|
336185
|
+
p.avatar_url AS "avatarUrl",
|
|
336186
|
+
p.metadata,
|
|
336187
|
+
p.created_at AS "createdAt",
|
|
336188
|
+
p.updated_at AS "updatedAt",
|
|
336189
|
+
GREATEST(
|
|
336190
|
+
COALESCE(pi.last_seen_at, 'epoch'::timestamptz),
|
|
336191
|
+
COALESCE(cp.last_seen_at, 'epoch'::timestamptz),
|
|
336192
|
+
COALESCE(p.updated_at, 'epoch'::timestamptz)
|
|
336193
|
+
) AS rank_ts
|
|
336194
|
+
FROM persons p
|
|
336195
|
+
LEFT JOIN platform_identities pi ON pi.person_id = p.id
|
|
336196
|
+
LEFT JOIN chat_participants cp ON cp.person_id = p.id OR cp.platform_identity_id = pi.id
|
|
336197
|
+
WHERE
|
|
336198
|
+
p.display_name ILIKE ${searchPattern} ESCAPE ''
|
|
336199
|
+
OR p.primary_email ILIKE ${searchPattern} ESCAPE ''
|
|
336200
|
+
OR p.primary_phone ILIKE ${searchPattern} ESCAPE ''
|
|
336201
|
+
OR pi.platform_username ILIKE ${searchPattern} ESCAPE ''
|
|
336202
|
+
OR pi.platform_user_id ILIKE ${searchPattern} ESCAPE ''
|
|
336203
|
+
OR cp.display_name ILIKE ${searchPattern} ESCAPE ''
|
|
336204
|
+
OR cp.platform_user_id ILIKE ${searchPattern} ESCAPE ''
|
|
336205
|
+
), distinct_candidates AS (
|
|
336206
|
+
SELECT DISTINCT ON (id)
|
|
336207
|
+
id,
|
|
336208
|
+
"displayName",
|
|
336209
|
+
"primaryPhone",
|
|
336210
|
+
"primaryEmail",
|
|
336211
|
+
"avatarUrl",
|
|
336212
|
+
metadata,
|
|
336213
|
+
"createdAt",
|
|
336214
|
+
"updatedAt",
|
|
336215
|
+
rank_ts
|
|
336216
|
+
FROM candidates
|
|
336217
|
+
ORDER BY id, rank_ts DESC
|
|
336218
|
+
)
|
|
336219
|
+
SELECT
|
|
336220
|
+
id,
|
|
336221
|
+
"displayName",
|
|
336222
|
+
"primaryPhone",
|
|
336223
|
+
"primaryEmail",
|
|
336224
|
+
"avatarUrl",
|
|
336225
|
+
metadata,
|
|
336226
|
+
"createdAt",
|
|
336227
|
+
"updatedAt"
|
|
336228
|
+
FROM distinct_candidates
|
|
336229
|
+
ORDER BY rank_ts DESC
|
|
336230
|
+
LIMIT ${limit2}
|
|
336231
|
+
`);
|
|
336232
|
+
return result;
|
|
336175
336233
|
}
|
|
336176
336234
|
async getById(id) {
|
|
336177
336235
|
const [result] = await this.db.select().from(persons).where(eq(persons.id, id)).limit(1);
|
|
@@ -355825,6 +355883,19 @@ function handleSendResult(result, context20) {
|
|
|
355825
355883
|
});
|
|
355826
355884
|
}
|
|
355827
355885
|
}
|
|
355886
|
+
function normalizeSendMediaMimeType(data) {
|
|
355887
|
+
const inferred = data.mimeType ?? inferMediaMimeType(data.type, data.filename);
|
|
355888
|
+
if (data.type === "audio" && data.voiceNote === true && inferred === "audio/ogg") {
|
|
355889
|
+
return "audio/ogg; codecs=opus";
|
|
355890
|
+
}
|
|
355891
|
+
return inferred;
|
|
355892
|
+
}
|
|
355893
|
+
function buildSendMediaMetadata(data) {
|
|
355894
|
+
if (data.type === "audio" && data.voiceNote === true && data.base64) {
|
|
355895
|
+
return { audioBuffer: Buffer.from(data.base64, "base64"), ptt: true };
|
|
355896
|
+
}
|
|
355897
|
+
return { base64: data.base64, ptt: data.voiceNote };
|
|
355898
|
+
}
|
|
355828
355899
|
function getMediaStorageForDownload(db2) {
|
|
355829
355900
|
if (!_mediaStorageForDownload) {
|
|
355830
355901
|
_mediaStorageForDownload = new MediaStorageService(db2);
|
|
@@ -356404,7 +356475,7 @@ var init_messages5 = __esm(() => {
|
|
|
356404
356475
|
});
|
|
356405
356476
|
}
|
|
356406
356477
|
const resolvedTo = await resolveRecipient(data.to, instance4.channel, services);
|
|
356407
|
-
const mediaMimeType =
|
|
356478
|
+
const mediaMimeType = normalizeSendMediaMimeType(data);
|
|
356408
356479
|
const outgoingMessage = {
|
|
356409
356480
|
to: resolvedTo,
|
|
356410
356481
|
threadId: data.threadId,
|
|
@@ -356415,10 +356486,7 @@ var init_messages5 = __esm(() => {
|
|
|
356415
356486
|
filename: data.filename,
|
|
356416
356487
|
mimeType: mediaMimeType
|
|
356417
356488
|
},
|
|
356418
|
-
metadata:
|
|
356419
|
-
base64: data.base64,
|
|
356420
|
-
ptt: data.voiceNote
|
|
356421
|
-
}
|
|
356489
|
+
metadata: buildSendMediaMetadata(data)
|
|
356422
356490
|
};
|
|
356423
356491
|
if (correlationId && tracker.isTracking(correlationId)) {
|
|
356424
356492
|
tracker.recordCheckpoint(correlationId, "T8", JOURNEY_STAGES.T8);
|