@tangle-network/agent-app 0.43.18 → 0.43.19

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.
@@ -574,6 +574,10 @@ interface AssistantDockProps {
574
574
  formatMoney?: (usd: number | null) => string;
575
575
  /** Render workflow YAML as a node graph in a proposal card. */
576
576
  renderGraph?: (yaml: string) => ReactNode;
577
+ /** Render the brand icon for a proposal requirement's integration provider.
578
+ * The host owns the provider→icon mapping (its integrations catalog); when
579
+ * absent, the card falls back to its built-in provider mark. */
580
+ renderProviderIcon?: (provider: string) => ReactNode;
577
581
  /** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
578
582
  onWorkflowMutation?: () => void;
579
583
  /** In-place connect handler for a proposal's integration requirements. The host
@@ -596,7 +600,7 @@ interface AssistantDockProps {
596
600
  * transport, and proposal flow stay owned by the panel. */
597
601
  renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
598
602
  }
599
- declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantDockProps): react.JSX.Element;
603
+ declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantDockProps): react.JSX.Element;
600
604
 
601
605
  interface AssistantPanelProps {
602
606
  chat: AssistantChat;
@@ -611,6 +615,9 @@ interface AssistantPanelProps {
611
615
  /** Render workflow YAML as a node graph in a proposal card (the `./workflows`
612
616
  * WorkflowGraph). When absent, proposals show YAML as text. */
613
617
  renderGraph?: (yaml: string) => ReactNode;
618
+ /** Render the brand icon for a proposal requirement's integration provider.
619
+ * When absent, the card falls back to its built-in provider mark. */
620
+ renderProviderIcon?: (provider: string) => ReactNode;
614
621
  /** Markdown renderer for assistant message content. When absent, content
615
622
  * renders as plain pre-wrapped text. */
616
623
  renderMarkdown?: (content: string) => ReactNode;
@@ -628,7 +635,7 @@ interface AssistantPanelProps {
628
635
  * conversation. */
629
636
  renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
630
637
  }
631
- declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantPanelProps): react.JSX.Element;
638
+ declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantPanelProps): react.JSX.Element;
632
639
 
633
640
  /**
634
641
  * True while a turn is streaming but the model hasn't emitted its first answer
@@ -700,8 +707,13 @@ interface ProposalCardProps {
700
707
  /** Render the workflow YAML as a node graph (the `./workflows` WorkflowGraph).
701
708
  * When absent, the YAML is shown as text. */
702
709
  renderGraph?: (yaml: string) => ReactNode;
710
+ /** Render the brand icon for an integration requirement's provider. The host
711
+ * owns the provider→icon mapping (its integrations catalog); when absent, or
712
+ * when it returns a nullish node for a provider it doesn't recognize, the row
713
+ * falls back to the built-in {@link ProviderLogo} mark. */
714
+ renderProviderIcon?: (provider: string) => ReactNode;
703
715
  }
704
- declare function ProposalCard({ proposal, confirming, onConfirm, onCancel, navigate, onConnect, renderGraph, }: ProposalCardProps): react.JSX.Element;
716
+ declare function ProposalCard({ proposal, confirming, onConfirm, onCancel, navigate, onConnect, renderGraph, renderProviderIcon, }: ProposalCardProps): react.JSX.Element;
705
717
 
706
718
  interface AssistantLauncher {
707
719
  /** Whether the assistant drawer is open. */
@@ -1798,7 +1798,7 @@ function providerLabel(provider) {
1798
1798
  }
1799
1799
 
1800
1800
  // src/assistant/ProposalCard.tsx
1801
- import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1801
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1802
1802
  function ProposalCard({
1803
1803
  proposal,
1804
1804
  confirming,
@@ -1806,7 +1806,8 @@ function ProposalCard({
1806
1806
  onCancel,
1807
1807
  navigate,
1808
1808
  onConnect,
1809
- renderGraph
1809
+ renderGraph,
1810
+ renderProviderIcon
1810
1811
  }) {
1811
1812
  const view = describeProposal(proposal);
1812
1813
  const [tab, setTab] = useState4("graph");
@@ -1862,7 +1863,8 @@ function ProposalCard({
1862
1863
  {
1863
1864
  req: r,
1864
1865
  navigate,
1865
- onConnect
1866
+ onConnect,
1867
+ renderProviderIcon
1866
1868
  },
1867
1869
  `${r.provider}-${r.kind ?? "integration"}`
1868
1870
  )) }),
@@ -1913,7 +1915,8 @@ function openConnect(target, navigate) {
1913
1915
  function RequirementRow({
1914
1916
  req,
1915
1917
  navigate,
1916
- onConnect
1918
+ onConnect,
1919
+ renderProviderIcon
1917
1920
  }) {
1918
1921
  const [connecting, setConnecting] = useState4(false);
1919
1922
  const mountedRef = useRef3(true);
@@ -1947,9 +1950,15 @@ function RequirementRow({
1947
1950
  if (mountedRef.current) setConnecting(false);
1948
1951
  });
1949
1952
  };
1953
+ let providerIcon;
1954
+ try {
1955
+ providerIcon = renderProviderIcon?.(req.provider) ?? null;
1956
+ } catch {
1957
+ providerIcon = null;
1958
+ }
1950
1959
  return /* @__PURE__ */ jsxs2("li", { className: "flex items-center justify-between gap-2 text-xs", children: [
1951
1960
  /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 items-center gap-2", children: [
1952
- /* @__PURE__ */ jsx3(ProviderLogo, { provider: req.provider, size: 16 }),
1961
+ providerIcon ?? /* @__PURE__ */ jsx3(ProviderLogo, { provider: req.provider, size: 16 }),
1953
1962
  /* @__PURE__ */ jsx3("span", { className: "truncate text-foreground", children: kindLabel }),
1954
1963
  /* @__PURE__ */ jsxs2("span", { className: "flex shrink-0 items-center gap-1", children: [
1955
1964
  /* @__PURE__ */ jsx3(
@@ -1974,11 +1983,8 @@ function RequirementRow({
1974
1983
  type: "button",
1975
1984
  onClick: handleConnect,
1976
1985
  disabled: connecting,
1977
- className: "shrink-0 text-primary disabled:opacity-50",
1978
- children: connecting ? isApp ? "Installing\u2026" : "Connecting\u2026" : /* @__PURE__ */ jsxs2(Fragment, { children: [
1979
- isApp ? "Install" : "Connect",
1980
- " \u2192"
1981
- ] })
1986
+ className: "shrink-0 rounded border border-primary px-2 py-0.5 font-medium text-primary transition-colors hover:bg-primary/10 disabled:opacity-50",
1987
+ children: connecting ? isApp ? "Installing\u2026" : "Connecting\u2026" : isApp ? "Install" : "Connect"
1982
1988
  }
1983
1989
  )
1984
1990
  ] });
@@ -1986,7 +1992,7 @@ function RequirementRow({
1986
1992
 
1987
1993
  // src/assistant/transcript.tsx
1988
1994
  import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
1989
- import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1995
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1990
1996
  function assistantIsThinking(state) {
1991
1997
  if (state.status !== "streaming") return false;
1992
1998
  const streaming = state.streamingId ? state.messages.find((m) => m.id === state.streamingId) : void 0;
@@ -2087,7 +2093,7 @@ function ProposalSlot({
2087
2093
  proposal,
2088
2094
  render
2089
2095
  }) {
2090
- return /* @__PURE__ */ jsx4(Fragment2, { children: render(proposal) });
2096
+ return /* @__PURE__ */ jsx4(Fragment, { children: render(proposal) });
2091
2097
  }
2092
2098
  function AssistantTranscript({
2093
2099
  view,
@@ -2105,7 +2111,7 @@ function AssistantTranscript({
2105
2111
  [renderMarkdown]
2106
2112
  );
2107
2113
  if (messages.length === 0 && !view.isStreaming) {
2108
- return /* @__PURE__ */ jsx4(Fragment2, { children: emptyState });
2114
+ return /* @__PURE__ */ jsx4(Fragment, { children: emptyState });
2109
2115
  }
2110
2116
  return /* @__PURE__ */ jsx4(
2111
2117
  ChatMessages,
@@ -2115,7 +2121,7 @@ function AssistantTranscript({
2115
2121
  agentLabel: "Assistant",
2116
2122
  renderMarkdown: markdown,
2117
2123
  toolRenderers,
2118
- renderEmpty: () => /* @__PURE__ */ jsx4(Fragment2, { children: emptyState }),
2124
+ renderEmpty: () => /* @__PURE__ */ jsx4(Fragment, { children: emptyState }),
2119
2125
  renderExtras: (message) => {
2120
2126
  const proposals = message.id === proposalHostId && view.pendingProposals.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "mt-3 flex flex-col gap-3", children: view.pendingProposals.map((proposal) => /* @__PURE__ */ jsx4(
2121
2127
  ProposalSlot,
@@ -2133,7 +2139,7 @@ function AssistantTranscript({
2133
2139
  " this turn"
2134
2140
  ] }) : null;
2135
2141
  if (!proposals && !cost && !confirmedCard) return null;
2136
- return /* @__PURE__ */ jsxs3(Fragment2, { children: [
2142
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
2137
2143
  confirmedCard,
2138
2144
  proposals,
2139
2145
  cost
@@ -2335,6 +2341,7 @@ function AssistantPanel({
2335
2341
  balanceUsd = null,
2336
2342
  formatMoney = defaultFormatMoney,
2337
2343
  renderGraph,
2344
+ renderProviderIcon,
2338
2345
  renderMarkdown,
2339
2346
  toolRenderers,
2340
2347
  renderConfirmedResult,
@@ -2412,7 +2419,8 @@ function AssistantPanel({
2412
2419
  onCancel: () => chat.cancel(proposal),
2413
2420
  navigate,
2414
2421
  onConnect: chat.canConnectRequirement ? (requirement) => chat.connectRequirement(proposal, requirement) : void 0,
2415
- renderGraph
2422
+ renderGraph,
2423
+ renderProviderIcon
2416
2424
  }
2417
2425
  );
2418
2426
  const isThinking = assistantIsThinking(state);
@@ -2791,7 +2799,7 @@ function ResizeHandle({
2791
2799
  }
2792
2800
 
2793
2801
  // src/assistant/AssistantDock.tsx
2794
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
2802
+ import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
2795
2803
  function focusableWithin(container) {
2796
2804
  const selector = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
2797
2805
  return Array.from(container.querySelectorAll(selector)).filter(
@@ -2804,6 +2812,7 @@ function AssistantDock({
2804
2812
  balanceUsd = null,
2805
2813
  formatMoney,
2806
2814
  renderGraph,
2815
+ renderProviderIcon,
2807
2816
  onWorkflowMutation,
2808
2817
  onConnectRequirement,
2809
2818
  renderMarkdown,
@@ -2886,7 +2895,7 @@ function AssistantDock({
2886
2895
  first.focus();
2887
2896
  }
2888
2897
  };
2889
- return /* @__PURE__ */ jsxs5(Fragment3, { children: [
2898
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
2890
2899
  /* @__PURE__ */ jsx8(
2891
2900
  "div",
2892
2901
  {
@@ -2917,6 +2926,7 @@ function AssistantDock({
2917
2926
  balanceUsd,
2918
2927
  formatMoney,
2919
2928
  renderGraph,
2929
+ renderProviderIcon,
2920
2930
  renderMarkdown,
2921
2931
  toolRenderers,
2922
2932
  renderConfirmedResult,