@llmnative/agentico 0.15.0 → 0.15.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.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-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
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,30 @@ function Ut(e, t = {}) {
1951
1951
  } finally {
1952
1952
  D.current = !1, d(!1);
1953
1953
  }
1954
- }, xe = async (e, t) => {
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
+ }, Se = (e) => xe(e) !== void 0, Ce = async (e, t) => {
1955
1967
  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 (!ie || !n || !i || i.kind !== "user" || i.historyAt === void 0) return null;
1958
- let a = (t ?? i.detail ?? "").trim();
1959
- if (!a) return null;
1960
- let o = g.slice(0, r);
1961
- return n.history = n.history.slice(0, i.historyAt), O.current = {
1962
- activity: o,
1968
+ let n = E.current, r = g.findIndex((t) => t.id === e), i = g[r], a = xe(e);
1969
+ if (!n || !i || a === void 0) return null;
1970
+ let o = (t ?? i.detail ?? "").trim();
1971
+ if (!o) return null;
1972
+ let s = g.slice(0, r);
1973
+ return n.history = n.history.slice(0, a), O.current = {
1974
+ activity: s,
1963
1975
  fresh: !0
1964
- }, b(o), be(a);
1965
- }, Se = () => {
1976
+ }, b(s), be(o);
1977
+ }, we = () => {
1966
1978
  let t = E.current;
1967
1979
  if (!t) return null;
1968
1980
  p(null);
@@ -1973,7 +1985,7 @@ function Ut(e, t = {}) {
1973
1985
  status: "done",
1974
1986
  label: e.describeFallback?.(n) ?? T.current.continueWithoutAiFallback
1975
1987
  }]), n;
1976
- }, Ce = () => E.current ? {
1988
+ }, Te = () => E.current ? {
1977
1989
  history: E.current.history,
1978
1990
  activity: g
1979
1991
  } : null;
@@ -1999,12 +2011,13 @@ function Ut(e, t = {}) {
1999
2011
  resume: ye,
2000
2012
  sendMessage: be,
2001
2013
  stop: te,
2002
- runFallback: Se,
2003
- snapshot: Ce,
2014
+ runFallback: we,
2015
+ snapshot: Te,
2004
2016
  answerQuestions: he,
2005
2017
  cardAction: me,
2006
- rewind: xe,
2018
+ rewind: Ce,
2007
2019
  canRewind: ie,
2020
+ rewindable: Se,
2008
2021
  offersFallback: e.offersFallback !== !1
2009
2022
  };
2010
2023
  }
@@ -2896,7 +2909,7 @@ function wn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
2896
2909
  ...t === void 0 ? {} : { text: t }
2897
2910
  }) : K(e, t);
2898
2911
  }, ie = a ? {
2899
- available: (e) => a.agent.canRewind && e.historyAt !== void 0 && a.agent.activity.some((t) => t.id === e.id),
2912
+ available: (e) => a.agent.activity.some((t) => t.id === e.id) && a.agent.rewindable(e.id),
2900
2913
  disabled: a.agent.running,
2901
2914
  onRetry: (e) => re(e),
2902
2915
  onEdit: (e) => A(e)