@tangle-network/agent-app 0.46.4 → 0.46.6
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/assistant/index.js +6 -4
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.d.ts +10 -24
- package/dist/chat-react/index.js +6 -127
- package/dist/chat-react/index.js.map +1 -1
- package/dist/{chunk-RLOHIX5Y.js → chunk-3HUFJ5LO.js} +1 -13
- package/dist/chunk-3HUFJ5LO.js.map +1 -0
- package/dist/chunk-5SSUCLBW.js +1896 -0
- package/dist/chunk-5SSUCLBW.js.map +1 -0
- package/dist/{chunk-YTEUZXX2.js → chunk-JAYKCWW4.js} +619 -1671
- package/dist/chunk-JAYKCWW4.js.map +1 -0
- package/dist/chunk-L7MB2LLM.js +15 -0
- package/dist/chunk-L7MB2LLM.js.map +1 -0
- package/dist/{chunk-LEGZX5MQ.js → chunk-OOE2TPY2.js} +6 -2
- package/dist/chunk-OOE2TPY2.js.map +1 -0
- package/dist/{mention-editor-GVLG3W7C.js → mention-editor-WW7UVZMR.js} +5 -3
- package/dist/{mention-editor-GVLG3W7C.js.map → mention-editor-WW7UVZMR.js.map} +1 -1
- package/dist/studio/generation.d.ts +10 -2
- package/dist/studio/index.js +3 -1
- package/dist/studio-react/composer-option-controls.d.ts +3 -1
- package/dist/studio-react/index.js +40 -22
- package/dist/studio-react/index.js.map +1 -1
- package/dist/{chat-react → web-react}/composer-mode-controls.d.ts +11 -1
- package/dist/{chat-react → web-react}/entry-composer.d.ts +11 -8
- package/dist/web-react/index.d.ts +2 -0
- package/dist/web-react/index.js +14 -9
- package/package.json +1 -1
- package/dist/chat-react/types.d.ts +0 -11
- package/dist/chunk-DINGA2MO.js +0 -718
- package/dist/chunk-DINGA2MO.js.map +0 -1
- package/dist/chunk-LEGZX5MQ.js.map +0 -1
- package/dist/chunk-RLOHIX5Y.js.map +0 -1
- package/dist/chunk-YTEUZXX2.js.map +0 -1
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
hashSeed,
|
|
17
17
|
imageToVideoSibling,
|
|
18
18
|
isLocalGeneration,
|
|
19
|
+
laneUnavailable,
|
|
19
20
|
latestBatchOf,
|
|
20
21
|
mergeGenerationPages,
|
|
21
22
|
mergeLiveGeneration,
|
|
22
23
|
mergeLoaderAndLive,
|
|
23
|
-
modelMessage,
|
|
24
24
|
normalizeImageCount,
|
|
25
25
|
normalizeVaultPath,
|
|
26
26
|
optimisticGeneration,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
textToVideoSibling,
|
|
35
35
|
userSafeGenerationMessage,
|
|
36
36
|
validateCustomImageSize
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-OOE2TPY2.js";
|
|
38
38
|
import {
|
|
39
39
|
useInfiniteScroll
|
|
40
40
|
} from "../chunk-KKBTPZIE.js";
|
|
@@ -108,7 +108,7 @@ function useStudioGenerations(loaderGenerations, options = {}) {
|
|
|
108
108
|
|
|
109
109
|
// src/studio-react/studio-composer.tsx
|
|
110
110
|
import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
|
|
111
|
-
import { AudioLines, ArrowUp, Image as ImageIcon, Video } from "lucide-react";
|
|
111
|
+
import { AudioLines, ArrowUp, Image as ImageIcon, TriangleAlert as TriangleAlert2, Video } from "lucide-react";
|
|
112
112
|
|
|
113
113
|
// src/studio-react/composer-option-controls.tsx
|
|
114
114
|
import {
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
useId,
|
|
118
118
|
useState as useState2
|
|
119
119
|
} from "react";
|
|
120
|
-
import { ImagePlus, Volume2, VolumeX, X } from "lucide-react";
|
|
120
|
+
import { ImagePlus, TriangleAlert, Volume2, VolumeX, X } from "lucide-react";
|
|
121
121
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
122
122
|
var PILL = "inline-flex h-7 flex-none items-center gap-1.5 whitespace-nowrap rounded-full border border-border bg-card px-2.5 text-[12.5px] font-medium text-foreground transition hover:bg-accent";
|
|
123
123
|
var MENU_PANEL = `flex min-w-[184px] flex-col overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground ${OVERLAY_SHADOW}`;
|
|
@@ -578,6 +578,7 @@ function ModelPill({
|
|
|
578
578
|
value,
|
|
579
579
|
displayName,
|
|
580
580
|
provider,
|
|
581
|
+
unavailable,
|
|
581
582
|
onSelect,
|
|
582
583
|
bandRef
|
|
583
584
|
}) {
|
|
@@ -593,10 +594,11 @@ function ModelPill({
|
|
|
593
594
|
...triggerProps,
|
|
594
595
|
"aria-controls": open ? panelId : void 0,
|
|
595
596
|
title: "Model",
|
|
596
|
-
"aria-label": `Model: ${displayName}`,
|
|
597
|
+
"aria-label": `Model: ${displayName}${unavailable ? " (unavailable)" : ""}`,
|
|
597
598
|
onClick: () => setOpen(!open),
|
|
598
|
-
className: PILL
|
|
599
|
+
className: `${PILL}${unavailable ? " border-warning/50" : ""}`,
|
|
599
600
|
children: [
|
|
601
|
+
unavailable && /* @__PURE__ */ jsx(TriangleAlert, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-warning", strokeWidth: 2 }),
|
|
600
602
|
provider && /* @__PURE__ */ jsx(ProviderLogo, { provider, size: 14 }),
|
|
601
603
|
/* @__PURE__ */ jsx("span", { className: "max-w-[168px] truncate", children: displayName }),
|
|
602
604
|
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })
|
|
@@ -621,16 +623,18 @@ function ModelPill({
|
|
|
621
623
|
type: "button",
|
|
622
624
|
role: "menuitemradio",
|
|
623
625
|
"aria-checked": model.id === value,
|
|
624
|
-
disabled: model.status === "unavailable",
|
|
625
626
|
onClick: () => {
|
|
626
627
|
onSelect(model.id);
|
|
627
628
|
setOpen(false);
|
|
628
629
|
},
|
|
629
|
-
className:
|
|
630
|
+
className: menuRowClass(model.id === value),
|
|
630
631
|
children: [
|
|
631
|
-
model.provider && /* @__PURE__ */ jsx(ProviderLogo, { provider: model.provider, size: 14 }),
|
|
632
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
633
|
-
model.status
|
|
632
|
+
model.provider && /* @__PURE__ */ jsx("span", { className: model.status === "unavailable" ? "opacity-45" : void 0, children: /* @__PURE__ */ jsx(ProviderLogo, { provider: model.provider, size: 14 }) }),
|
|
633
|
+
/* @__PURE__ */ jsx("span", { className: `truncate${model.status === "unavailable" ? " opacity-45" : ""}`, children: model.name || model.id }),
|
|
634
|
+
model.status === "unavailable" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
635
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-[11px] text-warning", children: "Unavailable" }),
|
|
636
|
+
/* @__PURE__ */ jsx(TriangleAlert, { "aria-hidden": true, className: "h-3.5 w-3.5 shrink-0 text-warning", strokeWidth: 2 })
|
|
637
|
+
] }) : model.status === "limited" && /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 text-[11px] capitalize text-muted-foreground", children: model.status }),
|
|
634
638
|
model.id === value && /* @__PURE__ */ jsx(CheckGlyph, { className: `${model.status === "available" ? "ml-auto " : ""}h-3.5 w-3.5 shrink-0 text-primary` })
|
|
635
639
|
]
|
|
636
640
|
},
|
|
@@ -696,7 +700,7 @@ function visibleParams(type, options) {
|
|
|
696
700
|
}
|
|
697
701
|
function defaultModelId(type, catalog, curated) {
|
|
698
702
|
const preferred = preferredModelId(type, catalog);
|
|
699
|
-
if (preferred && curated.some((model) => model.id === preferred)) return preferred;
|
|
703
|
+
if (preferred && curated.some((model) => model.id === preferred && model.status !== "unavailable")) return preferred;
|
|
700
704
|
return curated.find((model) => model.status !== "unavailable")?.id ?? curated[0]?.id ?? "";
|
|
701
705
|
}
|
|
702
706
|
function StudioComposer({
|
|
@@ -748,9 +752,21 @@ function StudioComposer({
|
|
|
748
752
|
const laneModels = useMemo2(() => catalog?.models[type] ?? [], [catalog, type]);
|
|
749
753
|
const curatedModels = useMemo2(() => curateComposerModels(type, laneModels), [laneModels, type]);
|
|
750
754
|
const retained = selectedModels[type];
|
|
751
|
-
const retainedUsable = retained !== void 0 && (!catalog || Boolean(textToVideoSibling(retained)) || curatedModels.some((model) => model.id === retained
|
|
755
|
+
const retainedUsable = retained !== void 0 && (!catalog || Boolean(textToVideoSibling(retained)) || curatedModels.some((model) => model.id === retained));
|
|
752
756
|
const modelId = retainedUsable ? retained : defaultModelId(type, catalog, curatedModels);
|
|
753
757
|
const modelOption = laneModels.find((model) => model.id === modelId);
|
|
758
|
+
useEffect3(() => {
|
|
759
|
+
setSelectedModels((current) => {
|
|
760
|
+
const retainedId = current[type];
|
|
761
|
+
if (!retainedId || !catalog) return current;
|
|
762
|
+
if (textToVideoSibling(retainedId)) return current;
|
|
763
|
+
const row = (catalog.models[type] ?? []).find((model) => model.id === retainedId);
|
|
764
|
+
if (!row || row.status !== "unavailable") return current;
|
|
765
|
+
const next = { ...current };
|
|
766
|
+
delete next[type];
|
|
767
|
+
return next;
|
|
768
|
+
});
|
|
769
|
+
}, [catalog, type]);
|
|
754
770
|
const options = useMemo2(
|
|
755
771
|
() => modelId ? resolveComposerOptions({
|
|
756
772
|
type,
|
|
@@ -776,6 +792,7 @@ function StudioComposer({
|
|
|
776
792
|
const unlistedSibling = !modelOption && Boolean(textToVideoSibling(modelId));
|
|
777
793
|
const referenceSupported = type === "video" && Boolean(imageToVideoSibling(modelId) ?? textToVideoSibling(modelId));
|
|
778
794
|
const modelReady = (Boolean(modelOption) || unlistedSibling) && modelOption?.status !== "unavailable" && !catalogLoading && !catalogError;
|
|
795
|
+
const laneDown = Boolean(catalog) && !catalogLoading && !catalogError && laneUnavailable(curatedModels);
|
|
779
796
|
const canSubmit = Boolean(workspaceId) && modelReady && Boolean(prompt.trim()) && !isSubmitting;
|
|
780
797
|
function selectModel(id) {
|
|
781
798
|
setSelectedModels((current) => ({ ...current, [type]: id }));
|
|
@@ -804,10 +821,7 @@ function StudioComposer({
|
|
|
804
821
|
if (!workspaceId || submitLockRef.current || isSubmitting) return;
|
|
805
822
|
const promptText = prompt.trim();
|
|
806
823
|
if (!promptText) return;
|
|
807
|
-
if (!modelReady)
|
|
808
|
-
if (!catalogLoading) setError("Select an available model");
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
824
|
+
if (!modelReady) return;
|
|
811
825
|
submitLockRef.current = true;
|
|
812
826
|
setIsSubmitting(true);
|
|
813
827
|
setError(null);
|
|
@@ -879,16 +893,19 @@ function StudioComposer({
|
|
|
879
893
|
setIsSubmitting(false);
|
|
880
894
|
}
|
|
881
895
|
}
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
const
|
|
896
|
+
const notice = catalogError ?? error;
|
|
897
|
+
const laneLabel = SEGMENTS.find((segment) => segment.type === type).label;
|
|
898
|
+
const laneDownMessage = curatedModels.length > 0 ? `${laneLabel} models are temporarily unavailable` : `No ${laneLabel.toLowerCase()} models are available`;
|
|
885
899
|
return /* @__PURE__ */ jsxs2(
|
|
886
900
|
"section",
|
|
887
901
|
{
|
|
888
902
|
"data-variant": variant,
|
|
889
903
|
className: `rounded-[14px] border border-border bg-card px-2.5 pb-[9px] pt-2 shadow-sm transition focus-within:border-primary focus-within:ring-[3px] focus-within:ring-ring/30 ${className ?? ""}`,
|
|
890
904
|
children: [
|
|
891
|
-
/* @__PURE__ */
|
|
905
|
+
laneDown ? /* @__PURE__ */ jsxs2("p", { className: "flex min-h-0 items-center gap-2 px-1.5 pb-3 pt-1.5 text-[13px] font-medium text-warning", children: [
|
|
906
|
+
/* @__PURE__ */ jsx2(TriangleAlert2, { "aria-hidden": true, className: "h-4 w-4 shrink-0", strokeWidth: 2 }),
|
|
907
|
+
/* @__PURE__ */ jsx2("span", { children: laneDownMessage })
|
|
908
|
+
] }) : /* @__PURE__ */ jsx2(
|
|
892
909
|
"textarea",
|
|
893
910
|
{
|
|
894
911
|
value: prompt,
|
|
@@ -914,6 +931,7 @@ function StudioComposer({
|
|
|
914
931
|
value: modelId,
|
|
915
932
|
displayName: modelOption?.name || modelId || "Select a model",
|
|
916
933
|
provider: modelOption?.provider,
|
|
934
|
+
unavailable: modelOption?.status === "unavailable",
|
|
917
935
|
onSelect: chooseModel,
|
|
918
936
|
bandRef
|
|
919
937
|
}
|
|
@@ -973,7 +991,7 @@ function StudioComposer({
|
|
|
973
991
|
}
|
|
974
992
|
)
|
|
975
993
|
] }),
|
|
976
|
-
notice && /* @__PURE__ */ jsx2("p", { className:
|
|
994
|
+
notice && /* @__PURE__ */ jsx2("p", { className: "px-1.5 pt-1.5 text-[12px] text-destructive", children: notice })
|
|
977
995
|
]
|
|
978
996
|
}
|
|
979
997
|
);
|