@streamoid/agent 0.6.49 → 0.6.50
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 +11 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -130913,7 +130913,7 @@ function readPrefilledInputs(e) {
|
|
|
130913
130913
|
}
|
|
130914
130914
|
return n;
|
|
130915
130915
|
}
|
|
130916
|
-
function
|
|
130916
|
+
function readBriefSamples(e) {
|
|
130917
130917
|
const t = e?.sample_asset_urls;
|
|
130918
130918
|
if (!Array.isArray(t)) return [];
|
|
130919
130919
|
const n = [];
|
|
@@ -130962,7 +130962,7 @@ function formatSuggestionDetail(e, t, n) {
|
|
|
130962
130962
|
return typeof t == "number" && Number.isFinite(t) && t > 0 && s.push(`up to ${t}min`), typeof n == "number" && Number.isFinite(n) && n >= 0 && s.push(`${n} ${n === 1 ? "credit" : "credits"}`), s.join(" · ") || null;
|
|
130963
130963
|
}
|
|
130964
130964
|
function readBriefHints(e) {
|
|
130965
|
-
const t = readString(e, "minimal_inputs_needed") || null, n = readString(e, "outcome_summary") || readString(e, "expected_output") || null, s = readPrefilledInputs(e), o = s.length > 0 && s.every((c) => c.value.length > 0), l =
|
|
130965
|
+
const t = readString(e, "minimal_inputs_needed") || null, n = readString(e, "outcome_summary") || readString(e, "expected_output") || null, s = readPrefilledInputs(e), o = s.length > 0 && s.every((c) => c.value.length > 0), l = readBriefSamples(e).length > 0;
|
|
130966
130966
|
return !t && !n && !o ? null : {
|
|
130967
130967
|
needs: t,
|
|
130968
130968
|
output: n,
|
|
@@ -130973,7 +130973,7 @@ function readBriefHints(e) {
|
|
|
130973
130973
|
};
|
|
130974
130974
|
}
|
|
130975
130975
|
function parseBriefTemplate(e) {
|
|
130976
|
-
const t = readString(e, "expected_output") || null, n =
|
|
130976
|
+
const t = readString(e, "expected_output") || null, n = readBriefSamples(e), s = readPrefilledInputs(e);
|
|
130977
130977
|
if (s.length > 0)
|
|
130978
130978
|
return { fields: s, requirements: [], samples: n, expectedOutput: t };
|
|
130979
130979
|
const o = readString(e, "example_quick_input"), l = [], c = [];
|
|
@@ -131270,7 +131270,7 @@ function EmptyChatBelow({
|
|
|
131270
131270
|
detail: I.detail,
|
|
131271
131271
|
icon: I.icon,
|
|
131272
131272
|
variant: "task",
|
|
131273
|
-
thumbnailUrl: I.suggestion?.imageUrl,
|
|
131273
|
+
thumbnailUrl: I.suggestion?.imageUrl ?? I.thumbnailUrl,
|
|
131274
131274
|
hints: readBriefHints(I.meta),
|
|
131275
131275
|
apps: readBriefApps(I.meta),
|
|
131276
131276
|
onClick: (P) => l?.(I, P)
|
|
@@ -131307,7 +131307,7 @@ function EmptyChatBelow({
|
|
|
131307
131307
|
detail: T.detail,
|
|
131308
131308
|
icon: T.icon,
|
|
131309
131309
|
hints: T.suggestion ? null : readBriefHints(T.meta),
|
|
131310
|
-
thumbnailUrl: T.suggestion?.imageUrl,
|
|
131310
|
+
thumbnailUrl: T.suggestion?.imageUrl ?? T.thumbnailUrl,
|
|
131311
131311
|
onClick: (M) => l?.(T, M)
|
|
131312
131312
|
},
|
|
131313
131313
|
`${T.title}:${T.value ?? T.title}`
|
|
@@ -131517,6 +131517,10 @@ function sampleUrl(e, t) {
|
|
|
131517
131517
|
const n = t.path || t.url;
|
|
131518
131518
|
return /^https?:\/\//i.test(n) ? n : e(n.startsWith("/") ? n : `/${n}`);
|
|
131519
131519
|
}
|
|
131520
|
+
function briefThumbnailUrl(e, t) {
|
|
131521
|
+
const [n] = readBriefSamples(t);
|
|
131522
|
+
return n ? sampleUrl(e, n) : null;
|
|
131523
|
+
}
|
|
131520
131524
|
async function fetchSampleFiles(e, t, n = ((s) => fetch(s))) {
|
|
131521
131525
|
const s = [];
|
|
131522
131526
|
for (const o of e)
|
|
@@ -135918,7 +135922,8 @@ function ChatScreen() {
|
|
|
135918
135922
|
})), z = (Tt) => ({
|
|
135919
135923
|
title: Tt.title,
|
|
135920
135924
|
value: Tt.text,
|
|
135921
|
-
meta: Tt.meta
|
|
135925
|
+
meta: Tt.meta,
|
|
135926
|
+
thumbnailUrl: briefThumbnailUrl(apiUrl, Tt.meta)
|
|
135922
135927
|
}), ee = di ? jr ? [...Qs, ...di.map(z)] : Qs.length > 0 ? Qs.slice(0, 3) : pickEmptyChatBriefs(
|
|
135923
135928
|
di.filter((Tt) => Tt.show_in_empty_chat).length > 0 ? di.filter((Tt) => Tt.show_in_empty_chat) : di,
|
|
135924
135929
|
() => 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamoid/agent",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.50",
|
|
4
4
|
"description": "Native (no-iframe) embeddable Streamoid agent chat panel. Host renders <AgentPanel adapters={\u2026}/>. Prebuilt bundle \u2014 source + build live in the stream-agent repo.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|