@exulu/backend 5.8.0 → 5.8.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.cjs +40 -2
- package/dist/index.js +40 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36048,7 +36048,9 @@ var publicAgentView = (row, slug) => ({
|
|
|
36048
36048
|
welcomemessage: row.welcomemessage ?? "",
|
|
36049
36049
|
slug,
|
|
36050
36050
|
guest_auth_mode: row.guest_auth_mode || "regular",
|
|
36051
|
-
guest_has_cover: !!row.guest_cover_image
|
|
36051
|
+
guest_has_cover: !!row.guest_cover_image,
|
|
36052
|
+
guest_has_idle_animation: !!row.animation_idle,
|
|
36053
|
+
guest_has_responding_animation: !!row.animation_responding
|
|
36052
36054
|
});
|
|
36053
36055
|
var evaluateGuestChatAccess = async (agent, userId, guestPassword) => {
|
|
36054
36056
|
if (agent.guest_access) {
|
|
@@ -40305,7 +40307,11 @@ ${style.markdown}` : params.prompt;
|
|
|
40305
40307
|
"welcomemessage",
|
|
40306
40308
|
"model",
|
|
40307
40309
|
"guest_auth_mode",
|
|
40308
|
-
"guest_cover_image"
|
|
40310
|
+
"guest_cover_image",
|
|
40311
|
+
// Presence only — publicAgentView turns these into booleans and the
|
|
40312
|
+
// bytes are served by /public-agents/:id/animation/:kind.
|
|
40313
|
+
"animation_idle",
|
|
40314
|
+
"animation_responding"
|
|
40309
40315
|
);
|
|
40310
40316
|
const views = await Promise.all(
|
|
40311
40317
|
rows.map(
|
|
@@ -40347,6 +40353,38 @@ ${style.markdown}` : params.prompt;
|
|
|
40347
40353
|
res.setHeader("Cache-Control", "public, max-age=300");
|
|
40348
40354
|
res.send(bytes);
|
|
40349
40355
|
});
|
|
40356
|
+
app.get(
|
|
40357
|
+
"/public-agents/:id/animation/:kind",
|
|
40358
|
+
async (req, res) => {
|
|
40359
|
+
const kind = req.params.kind;
|
|
40360
|
+
if (kind !== "idle" && kind !== "responding") {
|
|
40361
|
+
res.status(404).json({ detail: "Not found." });
|
|
40362
|
+
return;
|
|
40363
|
+
}
|
|
40364
|
+
const row = await getGuestAgentById(req.params.id ?? "");
|
|
40365
|
+
const key = kind === "idle" ? row?.animation_idle : row?.animation_responding;
|
|
40366
|
+
if (!key) {
|
|
40367
|
+
res.status(404).json({ detail: "Not found." });
|
|
40368
|
+
return;
|
|
40369
|
+
}
|
|
40370
|
+
let bytes;
|
|
40371
|
+
try {
|
|
40372
|
+
bytes = await getS3ObjectBytes(key, config);
|
|
40373
|
+
} catch (e) {
|
|
40374
|
+
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
40375
|
+
res.status(404).json({ detail: "Animation not found." });
|
|
40376
|
+
return;
|
|
40377
|
+
}
|
|
40378
|
+
console.error("[EXULU] public-agent animation read failed", e);
|
|
40379
|
+
res.status(500).json({ detail: "Failed to read animation." });
|
|
40380
|
+
return;
|
|
40381
|
+
}
|
|
40382
|
+
res.setHeader("Content-Type", "application/json");
|
|
40383
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
40384
|
+
res.setHeader("Cache-Control", "public, max-age=300");
|
|
40385
|
+
res.send(bytes);
|
|
40386
|
+
}
|
|
40387
|
+
);
|
|
40350
40388
|
app.post(
|
|
40351
40389
|
"/public-agents/:id/verify-password",
|
|
40352
40390
|
async (req, res) => {
|
package/dist/index.js
CHANGED
|
@@ -17198,7 +17198,9 @@ var publicAgentView = (row, slug) => ({
|
|
|
17198
17198
|
welcomemessage: row.welcomemessage ?? "",
|
|
17199
17199
|
slug,
|
|
17200
17200
|
guest_auth_mode: row.guest_auth_mode || "regular",
|
|
17201
|
-
guest_has_cover: !!row.guest_cover_image
|
|
17201
|
+
guest_has_cover: !!row.guest_cover_image,
|
|
17202
|
+
guest_has_idle_animation: !!row.animation_idle,
|
|
17203
|
+
guest_has_responding_animation: !!row.animation_responding
|
|
17202
17204
|
});
|
|
17203
17205
|
var evaluateGuestChatAccess = async (agent, userId, guestPassword) => {
|
|
17204
17206
|
if (agent.guest_access) {
|
|
@@ -21445,7 +21447,11 @@ ${style.markdown}` : params.prompt;
|
|
|
21445
21447
|
"welcomemessage",
|
|
21446
21448
|
"model",
|
|
21447
21449
|
"guest_auth_mode",
|
|
21448
|
-
"guest_cover_image"
|
|
21450
|
+
"guest_cover_image",
|
|
21451
|
+
// Presence only — publicAgentView turns these into booleans and the
|
|
21452
|
+
// bytes are served by /public-agents/:id/animation/:kind.
|
|
21453
|
+
"animation_idle",
|
|
21454
|
+
"animation_responding"
|
|
21449
21455
|
);
|
|
21450
21456
|
const views = await Promise.all(
|
|
21451
21457
|
rows.map(
|
|
@@ -21487,6 +21493,38 @@ ${style.markdown}` : params.prompt;
|
|
|
21487
21493
|
res.setHeader("Cache-Control", "public, max-age=300");
|
|
21488
21494
|
res.send(bytes);
|
|
21489
21495
|
});
|
|
21496
|
+
app.get(
|
|
21497
|
+
"/public-agents/:id/animation/:kind",
|
|
21498
|
+
async (req, res) => {
|
|
21499
|
+
const kind = req.params.kind;
|
|
21500
|
+
if (kind !== "idle" && kind !== "responding") {
|
|
21501
|
+
res.status(404).json({ detail: "Not found." });
|
|
21502
|
+
return;
|
|
21503
|
+
}
|
|
21504
|
+
const row = await getGuestAgentById(req.params.id ?? "");
|
|
21505
|
+
const key = kind === "idle" ? row?.animation_idle : row?.animation_responding;
|
|
21506
|
+
if (!key) {
|
|
21507
|
+
res.status(404).json({ detail: "Not found." });
|
|
21508
|
+
return;
|
|
21509
|
+
}
|
|
21510
|
+
let bytes;
|
|
21511
|
+
try {
|
|
21512
|
+
bytes = await getS3ObjectBytes(key, config);
|
|
21513
|
+
} catch (e) {
|
|
21514
|
+
if (e?.name === "NoSuchKey" || e?.name === "NotFound" || e?.$metadata?.httpStatusCode === 404) {
|
|
21515
|
+
res.status(404).json({ detail: "Animation not found." });
|
|
21516
|
+
return;
|
|
21517
|
+
}
|
|
21518
|
+
console.error("[EXULU] public-agent animation read failed", e);
|
|
21519
|
+
res.status(500).json({ detail: "Failed to read animation." });
|
|
21520
|
+
return;
|
|
21521
|
+
}
|
|
21522
|
+
res.setHeader("Content-Type", "application/json");
|
|
21523
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
21524
|
+
res.setHeader("Cache-Control", "public, max-age=300");
|
|
21525
|
+
res.send(bytes);
|
|
21526
|
+
}
|
|
21527
|
+
);
|
|
21490
21528
|
app.post(
|
|
21491
21529
|
"/public-agents/:id/verify-password",
|
|
21492
21530
|
async (req, res) => {
|