@llmnative/agentico 0.15.0 → 0.15.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/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -16
- package/dist/index.mjs.map +1 -1
- package/dist/types/presentation/useAgent.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -949,7 +949,7 @@ function dt({ entry: e, pinned: n = !0, actions: r }) {
|
|
|
949
949
|
return /* @__PURE__ */ F("div", {
|
|
950
950
|
className: `${n ? "sticky top-0 z-20 border-b border-border/40" : ""} group flex items-start justify-end gap-1 bg-background py-1.5`,
|
|
951
951
|
children: [r?.available(e) && /* @__PURE__ */ F("span", {
|
|
952
|
-
className: "flex shrink-0 items-center opacity-
|
|
952
|
+
className: "flex shrink-0 items-center opacity-50 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
|
|
953
953
|
children: [/* @__PURE__ */ P(t, {
|
|
954
954
|
icon: "rotate-ccw",
|
|
955
955
|
ariaLabel: i.retryFromHere,
|
|
@@ -1951,18 +1951,31 @@ function Ut(e, t = {}) {
|
|
|
1951
1951
|
} finally {
|
|
1952
1952
|
D.current = !1, d(!1);
|
|
1953
1953
|
}
|
|
1954
|
-
}, xe =
|
|
1954
|
+
}, xe = (e) => {
|
|
1955
|
+
let t = E.current, n = g.findIndex((t) => t.id === e), r = g[n], i = r?.detail?.trim();
|
|
1956
|
+
if (!ie || !t || !r || r.kind !== "user" || !i) return;
|
|
1957
|
+
if (r.historyAt !== void 0) return r.historyAt;
|
|
1958
|
+
let a = g.slice(0, n).filter((e) => e.kind === "user" && e.detail?.trim() === i).length, o = 0;
|
|
1959
|
+
for (let e = 0; e < t.history.length; e += 1) {
|
|
1960
|
+
let n = t.history[e];
|
|
1961
|
+
if (n.role === "user" && n.content.includes(i)) {
|
|
1962
|
+
if (o === a) return e;
|
|
1963
|
+
o += 1;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return n === g.map((e) => e.kind === "user").lastIndexOf(!0) ? t.history.length : void 0;
|
|
1967
|
+
}, Se = (e) => xe(e) !== void 0, Ce = async (e, t) => {
|
|
1955
1968
|
if (D.current) return p(T.current.requestInProgress), null;
|
|
1956
|
-
let n = E.current, r = g.findIndex((t) => t.id === e), i = g[r];
|
|
1957
|
-
if (!
|
|
1958
|
-
let
|
|
1959
|
-
if (!
|
|
1960
|
-
let
|
|
1961
|
-
return n.history = n.history.slice(0,
|
|
1962
|
-
activity:
|
|
1969
|
+
let n = E.current, r = g.findIndex((t) => t.id === e), i = g[r], a = xe(e);
|
|
1970
|
+
if (!n || !i || a === void 0) return null;
|
|
1971
|
+
let o = (t ?? i.detail ?? "").trim();
|
|
1972
|
+
if (!o) return null;
|
|
1973
|
+
let s = g.slice(0, r);
|
|
1974
|
+
return n.history = n.history.slice(0, a), O.current = {
|
|
1975
|
+
activity: s,
|
|
1963
1976
|
fresh: !0
|
|
1964
|
-
}, b(
|
|
1965
|
-
},
|
|
1977
|
+
}, b(s), be(o);
|
|
1978
|
+
}, we = () => {
|
|
1966
1979
|
let t = E.current;
|
|
1967
1980
|
if (!t) return null;
|
|
1968
1981
|
p(null);
|
|
@@ -1973,7 +1986,7 @@ function Ut(e, t = {}) {
|
|
|
1973
1986
|
status: "done",
|
|
1974
1987
|
label: e.describeFallback?.(n) ?? T.current.continueWithoutAiFallback
|
|
1975
1988
|
}]), n;
|
|
1976
|
-
},
|
|
1989
|
+
}, Te = () => E.current ? {
|
|
1977
1990
|
history: E.current.history,
|
|
1978
1991
|
activity: g
|
|
1979
1992
|
} : null;
|
|
@@ -1999,12 +2012,13 @@ function Ut(e, t = {}) {
|
|
|
1999
2012
|
resume: ye,
|
|
2000
2013
|
sendMessage: be,
|
|
2001
2014
|
stop: te,
|
|
2002
|
-
runFallback:
|
|
2003
|
-
snapshot:
|
|
2015
|
+
runFallback: we,
|
|
2016
|
+
snapshot: Te,
|
|
2004
2017
|
answerQuestions: he,
|
|
2005
2018
|
cardAction: me,
|
|
2006
|
-
rewind:
|
|
2019
|
+
rewind: Ce,
|
|
2007
2020
|
canRewind: ie,
|
|
2021
|
+
rewindable: Se,
|
|
2008
2022
|
offersFallback: e.offersFallback !== !1
|
|
2009
2023
|
};
|
|
2010
2024
|
}
|
|
@@ -2896,7 +2910,7 @@ function wn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2896
2910
|
...t === void 0 ? {} : { text: t }
|
|
2897
2911
|
}) : K(e, t);
|
|
2898
2912
|
}, ie = a ? {
|
|
2899
|
-
available: (e) => a.agent.
|
|
2913
|
+
available: (e) => a.agent.activity.some((t) => t.id === e.id) && a.agent.rewindable(e.id),
|
|
2900
2914
|
disabled: a.agent.running,
|
|
2901
2915
|
onRetry: (e) => re(e),
|
|
2902
2916
|
onEdit: (e) => A(e)
|