@tangle-network/agent-app 0.45.28 → 0.45.29

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 (38) hide show
  1. package/dist/{DesignCanvas-3RRPVPCP.js → DesignCanvas-RSWQCXM3.js} +2 -2
  2. package/dist/{DesignCanvasEditor-KAMMEX7E.js → DesignCanvasEditor-XZMGIST7.js} +4 -4
  3. package/dist/assistant/index.d.ts +62 -39
  4. package/dist/assistant/index.js +23 -5
  5. package/dist/assistant/index.js.map +1 -1
  6. package/dist/chat-react/index.d.ts +25 -2
  7. package/dist/chat-react/index.js.map +1 -1
  8. package/dist/chat-routes/index.js +1 -1
  9. package/dist/{chunk-WC43OQMR.js → chunk-3I27SDU3.js} +103 -30
  10. package/dist/chunk-3I27SDU3.js.map +1 -0
  11. package/dist/{chunk-NC2V63EL.js → chunk-FNM7JYME.js} +88 -21
  12. package/dist/chunk-FNM7JYME.js.map +1 -0
  13. package/dist/{chunk-4QVG4WJQ.js → chunk-OYTMILRK.js} +10 -3
  14. package/dist/chunk-OYTMILRK.js.map +1 -0
  15. package/dist/{chunk-OYGM5WLD.js → chunk-PURHUAOR.js} +52 -15
  16. package/dist/chunk-PURHUAOR.js.map +1 -0
  17. package/dist/{chunk-AWPK7ZDS.js → chunk-QGOU3VXH.js} +3 -3
  18. package/dist/{chunk-OTLEYHOG.js → chunk-RRH23CGS.js} +24 -4
  19. package/dist/chunk-RRH23CGS.js.map +1 -0
  20. package/dist/design-canvas-react/engine.d.ts +15 -1
  21. package/dist/design-canvas-react/engine.js +6 -2
  22. package/dist/design-canvas-react/index.d.ts +13 -1
  23. package/dist/design-canvas-react/index.js +13 -8
  24. package/dist/design-canvas-react/index.js.map +1 -1
  25. package/dist/design-canvas-react/lazy.js +1 -1
  26. package/dist/sandbox/index.d.ts +11 -1
  27. package/dist/sandbox/index.js +1 -1
  28. package/dist/web-react/index.d.ts +23 -4
  29. package/dist/web-react/index.js +1 -1
  30. package/package.json +14 -3
  31. package/dist/chunk-4QVG4WJQ.js.map +0 -1
  32. package/dist/chunk-NC2V63EL.js.map +0 -1
  33. package/dist/chunk-OTLEYHOG.js.map +0 -1
  34. package/dist/chunk-OYGM5WLD.js.map +0 -1
  35. package/dist/chunk-WC43OQMR.js.map +0 -1
  36. /package/dist/{DesignCanvas-3RRPVPCP.js.map → DesignCanvas-RSWQCXM3.js.map} +0 -0
  37. /package/dist/{DesignCanvasEditor-KAMMEX7E.js.map → DesignCanvasEditor-XZMGIST7.js.map} +0 -0
  38. /package/dist/{chunk-AWPK7ZDS.js.map → chunk-QGOU3VXH.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DesignCanvas
3
- } from "./chunk-NC2V63EL.js";
3
+ } from "./chunk-FNM7JYME.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-3RRPVPCP.js.map
10
+ //# sourceMappingURL=DesignCanvas-RSWQCXM3.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  DesignCanvasEditor
3
- } from "./chunk-OYGM5WLD.js";
4
- import "./chunk-NC2V63EL.js";
3
+ } from "./chunk-PURHUAOR.js";
4
+ import "./chunk-FNM7JYME.js";
5
5
  import "./chunk-LSQR6HM6.js";
6
- import "./chunk-4QVG4WJQ.js";
6
+ import "./chunk-OYTMILRK.js";
7
7
  import "./chunk-X5DQ5QOP.js";
8
8
  import "./chunk-DRB77FYL.js";
9
9
  import "./chunk-F7VH4G5C.js";
10
10
  export {
11
11
  DesignCanvasEditor
12
12
  };
13
- //# sourceMappingURL=DesignCanvasEditor-KAMMEX7E.js.map
13
+ //# sourceMappingURL=DesignCanvasEditor-XZMGIST7.js.map
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { ToolDetailRenderers, ChatUiMessage } from '../web-react/index.js';
3
+ import { ToolDetailRenderers, ComposerFile, ChatUiMessage } from '../web-react/index.js';
4
4
  import '../contract-OxG_jVMx.js';
5
5
  import '@tangle-network/agent-interface';
6
6
  import '../plans/index.js';
@@ -609,43 +609,6 @@ interface AssistantThreads {
609
609
  /** Resolve and manage assistant threads state for a given user including pending deletions and refresh logic */
610
610
  declare function useAssistantThreads(userId: string | null): AssistantThreads;
611
611
 
612
- interface AssistantDockProps {
613
- /** The signed-in user this conversation belongs to (null when signed out). */
614
- userId: string | null;
615
- /** Host navigation for error CTAs and connect targets. */
616
- navigate?: (path: string) => void;
617
- balanceUsd?: number | null;
618
- formatMoney?: (usd: number | null) => string;
619
- /** Render workflow YAML as a node graph in a proposal card. */
620
- renderGraph?: (yaml: string) => ReactNode;
621
- /** Render the brand icon for a proposal requirement's integration provider.
622
- * The host owns the provider→icon mapping (its integrations catalog); when
623
- * absent, the card falls back to its built-in provider mark. */
624
- renderProviderIcon?: (provider: string) => ReactNode;
625
- /** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
626
- onWorkflowMutation?: () => void;
627
- /** In-place connect handler for a proposal's integration requirements. The host
628
- * runs its own connect flow (OAuth popup, api-key modal, app install) and
629
- * resolves whether the requirement is now satisfied; the proposal card then
630
- * flips it to connected. Host-agnostic — when omitted, the card falls back to
631
- * navigating the requirement's connect target via `navigate`. */
632
- onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
633
- /** Markdown renderer for assistant message content (plain text when absent). */
634
- renderMarkdown?: (content: string) => ReactNode;
635
- /** Per-tool custom detail renderers for expanded tool cards in the transcript. */
636
- toolRenderers?: ToolDetailRenderers;
637
- /** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
638
- * API-key reveal for `create_api_key`), shown inline after the action's status
639
- * line. The result's `output` may carry a one-time secret — see
640
- * {@link ConfirmedResult} for the never-persist/never-to-model contract. */
641
- renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
642
- /** Swap the conversation rendering for a host-supplied renderer (see
643
- * {@link AssistantPanelProps.renderTranscript}); the dock chrome, composer,
644
- * transport, and proposal flow stay owned by the panel. */
645
- renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
646
- }
647
- declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantDockProps): react.JSX.Element;
648
-
649
612
  interface AssistantPanelProps {
650
613
  chat: AssistantChat;
651
614
  userId: string | null;
@@ -684,8 +647,68 @@ interface AssistantPanelProps {
684
647
  * clears its seed state (consume-once). */
685
648
  composerSeed?: string | null;
686
649
  onComposerSeedApplied?: () => void;
650
+ /** Opt-in attachment surface for the composer, mirroring `ChatComposer`'s
651
+ * attachment props: pass `onAttach` to show the attach button and accept
652
+ * drag-and-drop, and drive the staged-file chips with `pendingFiles` /
653
+ * `onRemoveFile` (web-react's `useComposerAttachments` owns that lifecycle).
654
+ * Omitted, the composer stays text-only. The assistant wire carries text
655
+ * only, so a host that stages files owns getting their content to the model
656
+ * (e.g. inlined on the next `chat.send`); `onComposerSend` is the signal to
657
+ * consume and clear the staged set. */
658
+ composerAttachments?: {
659
+ onAttach: (files: FileList) => void;
660
+ onAttachFolder?: (files: FileList) => void;
661
+ pendingFiles?: ComposerFile[];
662
+ onRemoveFile?: (id: string) => void;
663
+ accept?: string;
664
+ };
665
+ /** Fired when the composer sends (alongside `chat.send`) — the host's signal
666
+ * to consume and clear its staged attachments. */
667
+ onComposerSend?: (message: string) => void;
668
+ }
669
+ declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerSeed, onComposerSeedApplied, composerAttachments, onComposerSend, }: AssistantPanelProps): react.JSX.Element;
670
+
671
+ interface AssistantDockProps {
672
+ /** The signed-in user this conversation belongs to (null when signed out). */
673
+ userId: string | null;
674
+ /** Host navigation for error CTAs and connect targets. */
675
+ navigate?: (path: string) => void;
676
+ balanceUsd?: number | null;
677
+ formatMoney?: (usd: number | null) => string;
678
+ /** Render workflow YAML as a node graph in a proposal card. */
679
+ renderGraph?: (yaml: string) => ReactNode;
680
+ /** Render the brand icon for a proposal requirement's integration provider.
681
+ * The host owns the provider→icon mapping (its integrations catalog); when
682
+ * absent, the card falls back to its built-in provider mark. */
683
+ renderProviderIcon?: (provider: string) => ReactNode;
684
+ /** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
685
+ onWorkflowMutation?: () => void;
686
+ /** In-place connect handler for a proposal's integration requirements. The host
687
+ * runs its own connect flow (OAuth popup, api-key modal, app install) and
688
+ * resolves whether the requirement is now satisfied; the proposal card then
689
+ * flips it to connected. Host-agnostic — when omitted, the card falls back to
690
+ * navigating the requirement's connect target via `navigate`. */
691
+ onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
692
+ /** Markdown renderer for assistant message content (plain text when absent). */
693
+ renderMarkdown?: (content: string) => ReactNode;
694
+ /** Per-tool custom detail renderers for expanded tool cards in the transcript. */
695
+ toolRenderers?: ToolDetailRenderers;
696
+ /** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
697
+ * API-key reveal for `create_api_key`), shown inline after the action's status
698
+ * line. The result's `output` may carry a one-time secret — see
699
+ * {@link ConfirmedResult} for the never-persist/never-to-model contract. */
700
+ renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
701
+ /** Swap the conversation rendering for a host-supplied renderer (see
702
+ * {@link AssistantPanelProps.renderTranscript}); the dock chrome, composer,
703
+ * transport, and proposal flow stay owned by the panel. */
704
+ renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
705
+ /** Opt-in attachment surface for the dock's composer — forwarded to
706
+ * {@link AssistantPanelProps.composerAttachments}. */
707
+ composerAttachments?: AssistantPanelProps["composerAttachments"];
708
+ /** Forwarded to {@link AssistantPanelProps.onComposerSend}. */
709
+ onComposerSend?: AssistantPanelProps["onComposerSend"];
687
710
  }
688
- declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerSeed, onComposerSeedApplied, }: AssistantPanelProps): react.JSX.Element;
711
+ declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerAttachments, onComposerSend, }: AssistantDockProps): react.JSX.Element;
689
712
 
690
713
  /**
691
714
  * True while a turn is streaming but the model hasn't emitted its first answer
@@ -6,7 +6,7 @@ import {
6
6
  ChatMessages,
7
7
  ModelPicker,
8
8
  ProviderLogo
9
- } from "../chunk-WC43OQMR.js";
9
+ } from "../chunk-3I27SDU3.js";
10
10
  import "../chunk-FBVLEGEG.js";
11
11
  import "../chunk-HZ4WCA37.js";
12
12
  import "../chunk-GEYACSFW.js";
@@ -2391,7 +2391,9 @@ function AssistantPanel({
2391
2391
  renderConfirmedResult,
2392
2392
  renderTranscript,
2393
2393
  composerSeed = null,
2394
- onComposerSeedApplied
2394
+ onComposerSeedApplied,
2395
+ composerAttachments,
2396
+ onComposerSend
2395
2397
  }) {
2396
2398
  const models = useAssistantModels();
2397
2399
  const threads = useAssistantThreads(userId);
@@ -2712,6 +2714,7 @@ function AssistantPanel({
2712
2714
  onSend: (message) => {
2713
2715
  setView("chat");
2714
2716
  chat.send(message);
2717
+ onComposerSend?.(message);
2715
2718
  },
2716
2719
  onCancel: chat.stop,
2717
2720
  isStreaming: streaming,
@@ -2719,6 +2722,11 @@ function AssistantPanel({
2719
2722
  placeholder: "Message the assistant\u2026",
2720
2723
  seed: composerSeed,
2721
2724
  onSeedApplied: onComposerSeedApplied,
2725
+ onAttach: composerAttachments?.onAttach,
2726
+ onAttachFolder: composerAttachments?.onAttachFolder,
2727
+ pendingFiles: composerAttachments?.pendingFiles,
2728
+ onRemoveFile: composerAttachments?.onRemoveFile,
2729
+ accept: composerAttachments?.accept,
2722
2730
  controls: pickerModels.length > 0 ? /* @__PURE__ */ jsx5(
2723
2731
  ModelPicker,
2724
2732
  {
@@ -2868,7 +2876,9 @@ function AssistantDock({
2868
2876
  renderMarkdown,
2869
2877
  toolRenderers,
2870
2878
  renderConfirmedResult,
2871
- renderTranscript
2879
+ renderTranscript,
2880
+ composerAttachments,
2881
+ onComposerSend
2872
2882
  }) {
2873
2883
  const { open, openAssistant, closeAssistant, seed, clearSeed } = useAssistantLauncher();
2874
2884
  const chat = useAssistantChat(userId, {
@@ -2884,7 +2894,13 @@ function AssistantDock({
2884
2894
  useEffect7(() => {
2885
2895
  if (!open) return;
2886
2896
  const onKeyDown = (e) => {
2887
- if (e.key === "Escape") closeAssistant();
2897
+ if (e.key !== "Escape") return;
2898
+ if (dialogRef.current?.querySelector(
2899
+ '[aria-haspopup="true"][aria-expanded="true"]'
2900
+ )) {
2901
+ return;
2902
+ }
2903
+ closeAssistant();
2888
2904
  };
2889
2905
  document.addEventListener("keydown", onKeyDown);
2890
2906
  return () => document.removeEventListener("keydown", onKeyDown);
@@ -2982,7 +2998,9 @@ function AssistantDock({
2982
2998
  renderConfirmedResult,
2983
2999
  renderTranscript,
2984
3000
  composerSeed: seed,
2985
- onComposerSeedApplied: clearSeed
3001
+ onComposerSeedApplied: clearSeed,
3002
+ composerAttachments,
3003
+ onComposerSend
2986
3004
  },
2987
3005
  userId ?? "anon"
2988
3006
  ),