@tangle-network/agent-app 0.45.23 → 0.45.24

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.
Files changed (58) hide show
  1. package/dist/{DesignCanvas-ZG7DJS7C.js → DesignCanvas-3RRPVPCP.js} +2 -2
  2. package/dist/{DesignCanvasEditor-SLFMHOII.js → DesignCanvasEditor-KAMMEX7E.js} +4 -4
  3. package/dist/{TimelineEditor-6PV42FLG.js → TimelineEditor-IIBVCAZV.js} +2 -2
  4. package/dist/VaultPane-MUWGYVJ7.js +7 -0
  5. package/dist/assistant/index.d.ts +11 -0
  6. package/dist/assistant/index.js +89 -56
  7. package/dist/assistant/index.js.map +1 -1
  8. package/dist/chat-react/index.js +4 -1
  9. package/dist/chat-react/index.js.map +1 -1
  10. package/dist/{chunk-MLACJ6DB.js → chunk-7O4FZAFP.js} +10 -10
  11. package/dist/chunk-7O4FZAFP.js.map +1 -0
  12. package/dist/{chunk-OASVAPRL.js → chunk-AWPK7ZDS.js} +3 -3
  13. package/dist/{chunk-YTMKRL3L.js → chunk-HZ4WCA37.js} +3 -2
  14. package/dist/chunk-HZ4WCA37.js.map +1 -0
  15. package/dist/{chunk-FVJP2RTC.js → chunk-JJJEO4ND.js} +91 -36
  16. package/dist/chunk-JJJEO4ND.js.map +1 -0
  17. package/dist/{chunk-7PFFFRVU.js → chunk-KOMP6NDW.js} +172 -43
  18. package/dist/chunk-KOMP6NDW.js.map +1 -0
  19. package/dist/{chunk-TZO3SOUL.js → chunk-LSQR6HM6.js} +49 -33
  20. package/dist/chunk-LSQR6HM6.js.map +1 -0
  21. package/dist/{chunk-3IHYJIDJ.js → chunk-NC2V63EL.js} +15 -15
  22. package/dist/chunk-NC2V63EL.js.map +1 -0
  23. package/dist/{chunk-73CQJOIU.js → chunk-OYGM5WLD.js} +5 -5
  24. package/dist/chunk-OYGM5WLD.js.map +1 -0
  25. package/dist/chunk-YIQHOAHN.js +340 -0
  26. package/dist/chunk-YIQHOAHN.js.map +1 -0
  27. package/dist/design-canvas-react/index.d.ts +2 -2
  28. package/dist/design-canvas-react/index.js +9 -9
  29. package/dist/design-canvas-react/index.js.map +1 -1
  30. package/dist/design-canvas-react/lazy.js +1 -1
  31. package/dist/sequences-react/index.js +2 -2
  32. package/dist/theme/index.d.ts +27 -1
  33. package/dist/theme/index.js +1 -1
  34. package/dist/theme/tailwind-preset.d.ts +25 -0
  35. package/dist/theme/tailwind-preset.js +55 -1
  36. package/dist/theme/tailwind-preset.js.map +1 -1
  37. package/dist/theme/tokens.css +298 -40
  38. package/dist/vault/index.js +1 -1
  39. package/dist/vault/lazy.js +1 -1
  40. package/dist/web-react/async/index.js +19 -307
  41. package/dist/web-react/async/index.js.map +1 -1
  42. package/dist/web-react/index.d.ts +73 -6
  43. package/dist/web-react/index.js +2 -2
  44. package/dist/work-product-react/index.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/VaultPane-HFH734K6.js +0 -7
  47. package/dist/chunk-3IHYJIDJ.js.map +0 -1
  48. package/dist/chunk-73CQJOIU.js.map +0 -1
  49. package/dist/chunk-7PFFFRVU.js.map +0 -1
  50. package/dist/chunk-FVJP2RTC.js.map +0 -1
  51. package/dist/chunk-MLACJ6DB.js.map +0 -1
  52. package/dist/chunk-TZO3SOUL.js.map +0 -1
  53. package/dist/chunk-YTMKRL3L.js.map +0 -1
  54. /package/dist/{DesignCanvas-ZG7DJS7C.js.map → DesignCanvas-3RRPVPCP.js.map} +0 -0
  55. /package/dist/{DesignCanvasEditor-SLFMHOII.js.map → DesignCanvasEditor-KAMMEX7E.js.map} +0 -0
  56. /package/dist/{TimelineEditor-6PV42FLG.js.map → TimelineEditor-IIBVCAZV.js.map} +0 -0
  57. /package/dist/{VaultPane-HFH734K6.js.map → VaultPane-MUWGYVJ7.js.map} +0 -0
  58. /package/dist/{chunk-OASVAPRL.js.map → chunk-AWPK7ZDS.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DesignCanvas
3
- } from "./chunk-3IHYJIDJ.js";
3
+ } from "./chunk-NC2V63EL.js";
4
4
  import "./chunk-X5DQ5QOP.js";
5
5
  import "./chunk-DRB77FYL.js";
6
6
  import "./chunk-F7VH4G5C.js";
7
7
  export {
8
8
  DesignCanvas
9
9
  };
10
- //# sourceMappingURL=DesignCanvas-ZG7DJS7C.js.map
10
+ //# sourceMappingURL=DesignCanvas-3RRPVPCP.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DesignCanvasEditor
3
- } from "./chunk-73CQJOIU.js";
4
- import "./chunk-3IHYJIDJ.js";
5
- import "./chunk-TZO3SOUL.js";
3
+ } from "./chunk-OYGM5WLD.js";
4
+ import "./chunk-NC2V63EL.js";
5
+ import "./chunk-LSQR6HM6.js";
6
6
  import "./chunk-4QVG4WJQ.js";
7
7
  import "./chunk-X5DQ5QOP.js";
8
8
  import "./chunk-DRB77FYL.js";
@@ -10,4 +10,4 @@ import "./chunk-F7VH4G5C.js";
10
10
  export {
11
11
  DesignCanvasEditor
12
12
  };
13
- //# sourceMappingURL=DesignCanvasEditor-SLFMHOII.js.map
13
+ //# sourceMappingURL=DesignCanvasEditor-KAMMEX7E.js.map
@@ -2,11 +2,11 @@ import {
2
2
  SEQUENCE_MEDIA_DRAG_TYPE,
3
3
  TimelineEditor,
4
4
  TimelineEditor_default
5
- } from "./chunk-MLACJ6DB.js";
5
+ } from "./chunk-7O4FZAFP.js";
6
6
  import "./chunk-BVKQKGRK.js";
7
7
  export {
8
8
  SEQUENCE_MEDIA_DRAG_TYPE,
9
9
  TimelineEditor,
10
10
  TimelineEditor_default as default
11
11
  };
12
- //# sourceMappingURL=TimelineEditor-6PV42FLG.js.map
12
+ //# sourceMappingURL=TimelineEditor-IIBVCAZV.js.map
@@ -0,0 +1,7 @@
1
+ import {
2
+ VaultPane
3
+ } from "./chunk-JJJEO4ND.js";
4
+ export {
5
+ VaultPane
6
+ };
7
+ //# sourceMappingURL=VaultPane-MUWGYVJ7.js.map
@@ -573,6 +573,13 @@ declare function useAssistantModels(): AssistantModels;
573
573
  * no longer matches the current props — so a swap never shows the prior scope's
574
574
  * threads for even one frame. In flight, a late result is dropped if either the
575
575
  * user or the client changed, and the request is aborted on the swap.
576
+ *
577
+ * A FAILED load is reported, not swallowed. `fetchThreads` answers a non-ok
578
+ * response, an unusable body or a thrown request with `null`; that used to end
579
+ * as `loaded: true` over an empty list, which renders identically to a user who
580
+ * has never chatted. `error` carries the reason so the history view can offer
581
+ * the retry instead — the `web-react/async` rule (a failed fetch cannot render
582
+ * as empty data) applied to this hook's own transport.
576
583
  */
577
584
 
578
585
  /** Manage and interact with a list of assistant threads including loading, refreshing, and removing threads */
@@ -581,6 +588,10 @@ interface AssistantThreads {
581
588
  loading: boolean;
582
589
  /** True once a fetch has settled at least once (drives empty-vs-loading copy). */
583
590
  loaded: boolean;
591
+ /** Why the last load failed, or null. Non-null means the list on hand is stale
592
+ * or empty because the request FAILED — never because there is nothing to
593
+ * show. Cleared by the next successful load. */
594
+ error: string | null;
584
595
  /** Load (or reload) the thread list. Must be called to populate `threads` —
585
596
  * the hook never fetches on mount (the panel calls this when history opens). */
586
597
  refresh: () => void;
@@ -1,14 +1,17 @@
1
+ import {
2
+ AsyncView
3
+ } from "../chunk-YIQHOAHN.js";
1
4
  import {
2
5
  ChatComposer,
3
6
  ChatMessages,
4
7
  ModelPicker,
5
8
  ProviderLogo
6
- } from "../chunk-7PFFFRVU.js";
9
+ } from "../chunk-KOMP6NDW.js";
7
10
  import "../chunk-FBVLEGEG.js";
8
11
  import "../chunk-E4DHYENH.js";
9
12
  import "../chunk-BATKJP3P.js";
10
13
  import "../chunk-PC2WYTK7.js";
11
- import "../chunk-YTMKRL3L.js";
14
+ import "../chunk-HZ4WCA37.js";
12
15
  import "../chunk-GEYACSFW.js";
13
16
  import "../chunk-QY4BRKRJ.js";
14
17
  import "../chunk-CCVG2TL6.js";
@@ -1563,6 +1566,7 @@ function useAssistantModels() {
1563
1566
 
1564
1567
  // src/assistant/useAssistantThreads.ts
1565
1568
  import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
1569
+ var THREADS_LOAD_FAILED = "Couldn't load your conversations. Check your connection and try again.";
1566
1570
  function useAssistantThreads(userId) {
1567
1571
  const client = useAssistantClient();
1568
1572
  const userRef = useRef2(userId);
@@ -1575,6 +1579,7 @@ function useAssistantThreads(userId) {
1575
1579
  threads: [],
1576
1580
  loading: false,
1577
1581
  loaded: false,
1582
+ error: null,
1578
1583
  ownerUserId: userId,
1579
1584
  ownerClient: client
1580
1585
  }));
@@ -1586,6 +1591,7 @@ function useAssistantThreads(userId) {
1586
1591
  threads: [],
1587
1592
  loading: false,
1588
1593
  loaded: true,
1594
+ error: null,
1589
1595
  ownerUserId: requestedUserId,
1590
1596
  ownerClient: requestedClient
1591
1597
  });
@@ -1597,6 +1603,8 @@ function useAssistantThreads(userId) {
1597
1603
  setState((s) => ({
1598
1604
  ...s,
1599
1605
  loading: true,
1606
+ // A retry starts clean; a still-failing load sets it again on settle.
1607
+ error: null,
1600
1608
  ownerUserId: requestedUserId,
1601
1609
  ownerClient: requestedClient
1602
1610
  }));
@@ -1604,20 +1612,27 @@ function useAssistantThreads(userId) {
1604
1612
  void requestedClient.fetchThreads(ac.signal).then((result) => {
1605
1613
  if (!isCurrent()) return;
1606
1614
  setState((s) => ({
1607
- // null = transient failure: keep the prior list, just drop the spinner.
1608
- // Drop any in-flight/finished deletions so a stale fetch can't resurrect
1609
- // a row we already removed.
1615
+ // null = the request failed: keep the prior list (it is the best data
1616
+ // on hand) and REPORT it, so an empty list is never mistaken for a
1617
+ // user with no conversations. Drop any in-flight/finished deletions so
1618
+ // a stale fetch can't resurrect a row we already removed.
1610
1619
  threads: (result ?? s.threads).filter(
1611
1620
  (t) => !pendingDeletesRef.current.has(t.id)
1612
1621
  ),
1613
1622
  loading: false,
1614
1623
  loaded: true,
1624
+ error: result === null ? THREADS_LOAD_FAILED : null,
1615
1625
  ownerUserId: requestedUserId,
1616
1626
  ownerClient: requestedClient
1617
1627
  }));
1618
1628
  }).catch(() => {
1619
1629
  if (isCurrent()) {
1620
- setState((s) => ({ ...s, loading: false, loaded: true }));
1630
+ setState((s) => ({
1631
+ ...s,
1632
+ loading: false,
1633
+ loaded: true,
1634
+ error: THREADS_LOAD_FAILED
1635
+ }));
1621
1636
  }
1622
1637
  });
1623
1638
  }, []);
@@ -1657,6 +1672,8 @@ function useAssistantThreads(userId) {
1657
1672
  threads: stale ? [] : state.threads,
1658
1673
  loading: stale ? false : state.loading,
1659
1674
  loaded: stale ? false : state.loaded,
1675
+ // A prior scope's failure is not this scope's — masked with the rest.
1676
+ error: stale ? null : state.error,
1660
1677
  refresh,
1661
1678
  remove,
1662
1679
  canRemove: typeof client.deleteThread === "function"
@@ -1699,6 +1716,8 @@ function parsedTime(iso) {
1699
1716
  function AssistantHistory({
1700
1717
  threads,
1701
1718
  loaded,
1719
+ error,
1720
+ onRetry,
1702
1721
  activeThreadId,
1703
1722
  activeBusy,
1704
1723
  canRemove,
@@ -1728,6 +1747,7 @@ function AssistantHistory({
1728
1747
  ) : sorted,
1729
1748
  [sorted, trimmed]
1730
1749
  );
1750
+ const state = error ? { status: "error", message: error, error, retry: onRetry } : !loaded ? { status: "loading", retry: onRetry } : visible.length === 0 ? { status: "empty", value: visible, retry: onRetry } : { status: "ready", value: visible, retry: onRetry };
1731
1751
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
1732
1752
  /* @__PURE__ */ jsx2("div", { className: "border-border border-b p-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1733
1753
  /* @__PURE__ */ jsx2(Search, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-2.5 h-3.5 w-3.5 text-muted-foreground" }),
@@ -1739,55 +1759,66 @@ function AssistantHistory({
1739
1759
  onChange: (e) => setQuery(e.target.value),
1740
1760
  placeholder: "Search conversations",
1741
1761
  "aria-label": "Search conversations",
1742
- className: "w-full rounded-md border border-border bg-surface-container-high py-1.5 pr-2 pl-8 text-foreground text-sm placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1762
+ className: "w-full rounded-md border border-border bg-surface-container-high py-1.5 pr-2 pl-8 text-foreground text-sm placeholder:text-muted-foreground"
1743
1763
  }
1744
1764
  )
1745
1765
  ] }) }),
1746
- /* @__PURE__ */ jsx2("div", { className: "min-h-0 flex-1 overflow-y-auto", children: visible.length === 0 ? /* @__PURE__ */ jsx2("p", { className: "px-3 py-6 text-center text-muted-foreground text-xs", children: !loaded ? "Loading\u2026" : trimmed ? "No conversations match your search." : "No past conversations yet." }) : /* @__PURE__ */ jsx2("ul", { className: "py-1", children: visible.map((t) => {
1747
- const active = t.id === activeThreadId;
1748
- const ms = parsedTime(t.updatedAt);
1749
- const busyActive = active && activeBusy;
1750
- const title = t.title ?? "Untitled conversation";
1751
- return /* @__PURE__ */ jsxs(
1752
- "li",
1753
- {
1754
- className: `group flex items-center transition-colors hover:bg-muted/60 ${active ? "bg-primary/10" : ""}`,
1755
- children: [
1756
- /* @__PURE__ */ jsxs(
1757
- "button",
1758
- {
1759
- type: "button",
1760
- onClick: () => onSelect(t.id),
1761
- className: "flex min-w-0 flex-1 flex-col gap-0.5 px-3 py-2 text-left",
1762
- children: [
1763
- /* @__PURE__ */ jsx2(
1764
- "span",
1765
- {
1766
- className: `truncate text-sm ${active ? "font-medium text-foreground" : "text-foreground"}`,
1767
- children: title
1768
- }
1769
- ),
1770
- ms != null && /* @__PURE__ */ jsx2("span", { className: "text-[11px] text-muted-foreground", children: timeAgo(ms) })
1771
- ]
1772
- }
1773
- ),
1774
- canRemove && /* @__PURE__ */ jsx2(
1775
- "button",
1776
- {
1777
- type: "button",
1778
- onClick: () => onDelete(t.id),
1779
- disabled: busyActive,
1780
- "aria-label": `Delete conversation: ${title}`,
1781
- title: busyActive ? "Can't delete while this conversation is active" : "Delete conversation",
1782
- className: "shrink-0 p-2 text-muted-foreground opacity-0 transition [@media(hover:none)]:opacity-100 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",
1783
- children: /* @__PURE__ */ jsx2(Trash2, { className: "h-3.5 w-3.5" })
1784
- }
1785
- )
1786
- ]
1766
+ /* @__PURE__ */ jsx2("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx2(
1767
+ AsyncView,
1768
+ {
1769
+ state,
1770
+ loadingLabel: "Loading\u2026",
1771
+ empty: {
1772
+ title: trimmed ? "No conversations match your search." : "No past conversations yet.",
1773
+ description: trimmed ? void 0 : "Your chats with the assistant will appear here."
1787
1774
  },
1788
- t.id
1789
- );
1790
- }) }) })
1775
+ children: (rows) => /* @__PURE__ */ jsx2("ul", { className: "py-1", children: rows.map((t) => {
1776
+ const active = t.id === activeThreadId;
1777
+ const ms = parsedTime(t.updatedAt);
1778
+ const busyActive = active && activeBusy;
1779
+ const title = t.title ?? "Untitled conversation";
1780
+ return /* @__PURE__ */ jsxs(
1781
+ "li",
1782
+ {
1783
+ className: `group flex items-center transition-colors hover:bg-muted/60 ${active ? "bg-primary/10" : ""}`,
1784
+ children: [
1785
+ /* @__PURE__ */ jsxs(
1786
+ "button",
1787
+ {
1788
+ type: "button",
1789
+ onClick: () => onSelect(t.id),
1790
+ className: "flex min-w-0 flex-1 flex-col gap-0.5 px-3 py-2 text-left",
1791
+ children: [
1792
+ /* @__PURE__ */ jsx2(
1793
+ "span",
1794
+ {
1795
+ className: `truncate text-sm ${active ? "font-medium text-foreground" : "text-foreground"}`,
1796
+ children: title
1797
+ }
1798
+ ),
1799
+ ms != null && /* @__PURE__ */ jsx2("span", { className: "text-[11px] text-muted-foreground", children: timeAgo(ms) })
1800
+ ]
1801
+ }
1802
+ ),
1803
+ canRemove && /* @__PURE__ */ jsx2(
1804
+ "button",
1805
+ {
1806
+ type: "button",
1807
+ onClick: () => onDelete(t.id),
1808
+ disabled: busyActive,
1809
+ "aria-label": `Delete conversation: ${title}`,
1810
+ title: busyActive ? "Can't delete while this conversation is active" : "Delete conversation",
1811
+ className: "shrink-0 p-2 text-muted-foreground opacity-0 transition [@media(hover:none)]:opacity-100 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",
1812
+ children: /* @__PURE__ */ jsx2(Trash2, { className: "h-3.5 w-3.5" })
1813
+ }
1814
+ )
1815
+ ]
1816
+ },
1817
+ t.id
1818
+ );
1819
+ }) })
1820
+ }
1821
+ ) })
1791
1822
  ] });
1792
1823
  }
1793
1824
 
@@ -2534,7 +2565,7 @@ function AssistantPanel({
2534
2565
  onClick: toggleHistory,
2535
2566
  "aria-label": "Chat history",
2536
2567
  "aria-pressed": view === "history",
2537
- className: `rounded-md p-1.5 transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${view === "history" ? "bg-muted text-foreground" : "text-muted-foreground"}`,
2568
+ className: `rounded-md p-1.5 transition-colors hover:bg-muted hover:text-foreground ${view === "history" ? "bg-muted text-foreground" : "text-muted-foreground"}`,
2538
2569
  children: /* @__PURE__ */ jsx5(History, { className: "h-4 w-4" })
2539
2570
  }
2540
2571
  ),
@@ -2548,7 +2579,7 @@ function AssistantPanel({
2548
2579
  },
2549
2580
  "aria-label": "New chat",
2550
2581
  title: "New chat",
2551
- className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2582
+ className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
2552
2583
  children: /* @__PURE__ */ jsx5(MessageSquarePlus, { className: "h-4 w-4" })
2553
2584
  }
2554
2585
  ),
@@ -2558,7 +2589,7 @@ function AssistantPanel({
2558
2589
  type: "button",
2559
2590
  onClick: onClose,
2560
2591
  "aria-label": "Close assistant",
2561
- className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2592
+ className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
2562
2593
  children: /* @__PURE__ */ jsx5(X, { className: "h-4 w-4" })
2563
2594
  }
2564
2595
  )
@@ -2579,6 +2610,8 @@ function AssistantPanel({
2579
2610
  {
2580
2611
  threads: threads.threads,
2581
2612
  loaded: threads.loaded,
2613
+ error: threads.error,
2614
+ onRetry: threads.refresh,
2582
2615
  activeThreadId: state.threadId,
2583
2616
  activeBusy: state.status !== "idle",
2584
2617
  canRemove: threads.canRemove,
@@ -2664,7 +2697,7 @@ function AssistantPanel({
2664
2697
  setView("chat");
2665
2698
  chat.send("continue");
2666
2699
  },
2667
- className: "shrink-0 rounded-lg bg-primary px-3 py-1.5 font-semibold text-primary-foreground text-xs transition hover:bg-primary/90 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2700
+ className: "shrink-0 rounded-lg bg-primary px-3 py-1.5 font-semibold text-primary-foreground text-xs transition hover:bg-primary/90",
2668
2701
  children: "Continue"
2669
2702
  }
2670
2703
  )
@@ -2802,7 +2835,7 @@ function ResizeHandle({
2802
2835
  onPointerUp: endDrag,
2803
2836
  onPointerCancel: endDrag,
2804
2837
  onKeyDown,
2805
- className: "group absolute inset-y-0 left-0 z-10 flex w-2 -translate-x-1/2 cursor-ew-resize touch-none items-center justify-center focus:outline-none",
2838
+ className: "group absolute inset-y-0 left-0 z-10 flex w-2 -translate-x-1/2 cursor-ew-resize touch-none items-center justify-center",
2806
2839
  children: /* @__PURE__ */ jsx7(
2807
2840
  "span",
2808
2841
  {