@adecore/agents-react 0.37.2 → 0.38.0

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 (115) hide show
  1. package/dist/chat/chat-client.d.ts +1 -0
  2. package/dist/chat/chat-client.js +2 -1
  3. package/dist/chat/chat-references.d.ts +16 -1
  4. package/dist/chat/chat-references.js +29 -3
  5. package/dist/chat/drafts.d.ts +2 -0
  6. package/dist/chat/drafts.js +21 -5
  7. package/dist/chat/index.d.ts +1 -1
  8. package/dist/chat/logic/visual-height.d.ts +1 -0
  9. package/dist/chat/logic/visual-height.js +1 -1
  10. package/dist/chat/mentions.d.ts +31 -14
  11. package/dist/chat/mentions.js +186 -41
  12. package/dist/chat/stash.d.ts +1 -0
  13. package/dist/chat/stash.js +4 -2
  14. package/dist/chat/ui/Composer.js +438 -429
  15. package/dist/chat/ui/ComposerInput.d.ts +1 -0
  16. package/dist/chat/ui/ComposerInput.js +2 -0
  17. package/dist/chat/ui/HostMenuItems.d.ts +4 -0
  18. package/dist/chat/ui/HostMenuItems.js +15 -0
  19. package/dist/chat/ui/Markdown.d.ts +3 -1
  20. package/dist/chat/ui/Markdown.js +194 -120
  21. package/dist/chat/ui/MessageActions.js +70 -66
  22. package/dist/chat/ui/ReferenceChip.d.ts +15 -0
  23. package/dist/chat/ui/ReferenceChip.js +255 -0
  24. package/dist/chat/ui/Timeline.js +52 -29
  25. package/dist/chat/ui/TimelineMenu.js +84 -78
  26. package/dist/chat/ui/VisualFrame.d.ts +8 -0
  27. package/dist/chat/ui/VisualFrame.js +217 -115
  28. package/dist/chat/ui/chip-clipboard.d.ts +9 -0
  29. package/dist/chat/ui/chip-clipboard.js +105 -0
  30. package/dist/chat/ui/chips.d.ts +5 -0
  31. package/dist/chat/ui/chips.js +15 -1
  32. package/dist/chat/ui/composer/ComposerMenu.js +140 -79
  33. package/dist/chat/ui/composer/DraftParts.d.ts +0 -4
  34. package/dist/chat/ui/composer/DraftParts.js +0 -41
  35. package/dist/chat/ui/composer/chip-paste.d.ts +15 -0
  36. package/dist/chat/ui/composer/chip-paste.js +104 -0
  37. package/dist/chat/ui/composer/chips.d.ts +5 -0
  38. package/dist/chat/ui/composer/chips.js +59 -9
  39. package/dist/chat/ui/composer/key-handler.js +9 -0
  40. package/dist/chat/ui/composer/use-composer-draft.d.ts +0 -1
  41. package/dist/chat/ui/composer/use-composer-draft.js +2 -10
  42. package/dist/chat/ui/composer/use-composer-menus.d.ts +12 -2
  43. package/dist/chat/ui/composer/use-composer-menus.js +192 -149
  44. package/dist/chat/ui/composer/use-composer-submit.js +17 -12
  45. package/dist/chat/ui/composer/use-draft-files.d.ts +7 -1
  46. package/dist/chat/ui/composer/use-draft-files.js +90 -58
  47. package/dist/chat/ui/composer/use-take-back.js +2 -1
  48. package/dist/chat/ui/index.d.ts +1 -1
  49. package/dist/chat/ui/index.js +1 -1
  50. package/dist/chat/ui/reference-icons.d.ts +3 -0
  51. package/dist/chat/ui/reference-icons.js +15 -0
  52. package/dist/chat/ui/reference-lookup.d.ts +7 -0
  53. package/dist/chat/ui/reference-lookup.js +6 -0
  54. package/dist/chat/ui/rehype-chips.d.ts +8 -1
  55. package/dist/chat/ui/rehype-chips.js +35 -11
  56. package/dist/chat/ui/rows/GeneratedImageRow.js +8 -4
  57. package/dist/chat/ui/rows/MessageRows.js +218 -158
  58. package/dist/chat/ui/rows/VisualRow.js +184 -142
  59. package/dist/chat/ui/rows/row-rhythm.js +6 -4
  60. package/dist/chat/ui/thread-references.d.ts +4 -0
  61. package/dist/chat/ui/thread-references.js +78 -0
  62. package/dist/host-hooks.d.ts +2 -0
  63. package/dist/host-hooks.js +7 -0
  64. package/dist/host.d.ts +14 -1
  65. package/dist/index.d.ts +1 -1
  66. package/dist/locales/en/agent-chat.d.ts +20 -3
  67. package/dist/locales/en/agent-chat.js +24 -7
  68. package/dist/locales/nl/agent-chat.d.ts +20 -3
  69. package/dist/locales/nl/agent-chat.js +24 -7
  70. package/package.json +8 -8
  71. package/src/chat/chat-client.ts +4 -1
  72. package/src/chat/chat-references.ts +44 -3
  73. package/src/chat/drafts.ts +24 -6
  74. package/src/chat/index.ts +1 -1
  75. package/src/chat/logic/visual-height.ts +1 -1
  76. package/src/chat/mentions.ts +202 -36
  77. package/src/chat/stash.ts +6 -2
  78. package/src/chat/ui/Composer.tsx +14 -4
  79. package/src/chat/ui/ComposerInput.tsx +4 -0
  80. package/src/chat/ui/HostMenuItems.tsx +11 -0
  81. package/src/chat/ui/Markdown.tsx +57 -25
  82. package/src/chat/ui/MessageActions.tsx +5 -2
  83. package/src/chat/ui/ReferenceChip.tsx +74 -0
  84. package/src/chat/ui/Timeline.tsx +24 -2
  85. package/src/chat/ui/TimelineMenu.tsx +7 -3
  86. package/src/chat/ui/VisualFrame.tsx +68 -21
  87. package/src/chat/ui/chip-clipboard.ts +115 -0
  88. package/src/chat/ui/chips.ts +20 -1
  89. package/src/chat/ui/composer/ComposerMenu.tsx +53 -37
  90. package/src/chat/ui/composer/DraftParts.tsx +0 -12
  91. package/src/chat/ui/composer/chip-paste.ts +122 -0
  92. package/src/chat/ui/composer/chips.ts +60 -10
  93. package/src/chat/ui/composer/key-handler.ts +9 -0
  94. package/src/chat/ui/composer/use-composer-draft.ts +1 -7
  95. package/src/chat/ui/composer/use-composer-menus.ts +68 -29
  96. package/src/chat/ui/composer/use-composer-submit.ts +13 -6
  97. package/src/chat/ui/composer/use-draft-files.ts +39 -5
  98. package/src/chat/ui/composer/use-take-back.ts +2 -1
  99. package/src/chat/ui/index.ts +1 -1
  100. package/src/chat/ui/reference-icons.ts +17 -0
  101. package/src/chat/ui/reference-lookup.ts +13 -0
  102. package/src/chat/ui/rehype-chips.ts +38 -13
  103. package/src/chat/ui/rows/GeneratedImageRow.tsx +9 -4
  104. package/src/chat/ui/rows/MessageRows.tsx +88 -64
  105. package/src/chat/ui/rows/VisualRow.tsx +5 -1
  106. package/src/chat/ui/rows/row-rhythm.ts +6 -4
  107. package/src/chat/ui/thread-references.ts +47 -0
  108. package/src/host-hooks.ts +9 -0
  109. package/src/host.ts +24 -1
  110. package/src/index.ts +1 -0
  111. package/src/locales/en/agent-chat.ts +24 -7
  112. package/src/locales/nl/agent-chat.ts +24 -7
  113. package/dist/chat/ui/ChatReferenceChip.d.ts +0 -4
  114. package/dist/chat/ui/ChatReferenceChip.js +0 -110
  115. package/src/chat/ui/ChatReferenceChip.tsx +0 -26
@@ -26,6 +26,7 @@ interface ComposerInputProps {
26
26
  onComposing?(composing: boolean): void;
27
27
  onKeyDown?(event: KeyboardEvent, view: EditorView): boolean;
28
28
  onPaste?(event: ClipboardEvent, view: EditorView): boolean;
29
+ onCopy?(event: ClipboardEvent, view: EditorView): boolean;
29
30
  }
30
31
  export declare function ComposerInput({ ref, value, placeholder, disabled, tabbable, className, dictationToolbar, extensions, aria, ...handlers }: ComposerInputProps): import("react").JSX.Element;
31
32
  export {};
@@ -117,6 +117,8 @@ export function ComposerInput(t0) {
117
117
  extensions: [composerEditorExtensions(), dictation.composer?.extensions ?? [], compartments.attributes.of([]), compartments.editable.of([]), compartments.placeholder.of([]), compartments.extensions.of([]), Prec.highest(EditorView.domEventHandlers({
118
118
  keydown: (event, target) => latest.current.handlers.onKeyDown?.(event, target) ?? false,
119
119
  paste: (event_0, target_0) => latest.current.handlers.onPaste?.(event_0, target_0) ?? false,
120
+ copy: (event_1, target_1) => latest.current.handlers.onCopy?.(event_1, target_1) ?? false,
121
+ cut: (event_2, target_2) => latest.current.handlers.onCopy?.(event_2, target_2) ?? false,
120
122
  compositionstart: () => {
121
123
  latest.current.handlers.onComposing?.(true);
122
124
  return false;
@@ -0,0 +1,4 @@
1
+ import type { HostMenuAction } from '../../host.js';
2
+ export declare function HostMenuItems({ actions }: {
3
+ actions: readonly HostMenuAction[];
4
+ }): import("react").JSX.Element[];
@@ -0,0 +1,15 @@
1
+ import { Icon, Menu } from '@adecore/ui';
2
+ /* The items a host adds to a menu of the chat's, in the order it gave them. */
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ export function HostMenuItems({
5
+ actions
6
+ }) {
7
+ return actions.map(action => /*#__PURE__*/_jsxs(Menu.Item, {
8
+ disabled: action.disabled,
9
+ onClick: () => action.run(),
10
+ children: [action.icon !== undefined && /*#__PURE__*/_jsx(Icon, {
11
+ icon: action.icon,
12
+ size: 14
13
+ }), " ", action.label]
14
+ }, action.id));
15
+ }
@@ -1,4 +1,5 @@
1
1
  import { type Components, type Options } from 'react-markdown';
2
+ import type { ReferenceToken } from '../mentions.js';
2
3
  import { type ShellCodeBlockContext } from '../../host.js';
3
4
  type ShellCodeBlockReply = Pick<ShellCodeBlockContext, 'scopeId' | 'chatId' | 'itemId'> & {
4
5
  streaming: boolean;
@@ -9,10 +10,11 @@ export declare const ReplyMarkdown: import("react").MemoExoticComponent<({ text,
9
10
  arriving?: boolean;
10
11
  reply?: ShellCodeBlockReply;
11
12
  }) => import("react").JSX.Element>;
12
- export declare const MessageMarkdown: import("react").MemoExoticComponent<({ text, mentions, skills }: {
13
+ export declare const MessageMarkdown: import("react").MemoExoticComponent<({ text, mentions, skills, references }: {
13
14
  text: string;
14
15
  mentions?: string[];
15
16
  skills?: string[];
17
+ references?: readonly ReferenceToken[];
16
18
  }) => import("react").JSX.Element>;
17
19
  export declare const Markdown: import("react").MemoExoticComponent<({ text, breaks, fileLinks, muted, rehypePlugins, componentOverrides }: {
18
20
  text: string;
@@ -5,19 +5,21 @@ import { Zap } from 'lucide-react';
5
5
  import ReactMarkdown from 'react-markdown';
6
6
  import remarkBreaks from 'remark-breaks';
7
7
  import remarkGfm from 'remark-gfm';
8
- import { CHIP_IN_MESSAGE, MENTION_TONE, SKILL_TONE } from './chips.js';
8
+ import { MENTION_TONE, SKILL_TONE, TOKEN_ICON } from './chips.js';
9
9
  import { CodeBlock } from './CodeBlock.js';
10
10
  import { MermaidBlock } from './MermaidBlock.js';
11
11
  import { CodeStreamingContext } from './code-streaming.js';
12
12
  import { splitMarkdownBlocks } from './markdown-blocks.js';
13
- import { rehypeChips } from './rehype-chips.js';
13
+ import { ReferenceChip, TokenChip } from './ReferenceChip.js';
14
+ import { ReferenceLookupContext } from './reference-lookup.js';
15
+ import { rehypeChips, rehypeNamedReferences } from './rehype-chips.js';
14
16
  import { rehypeFadeWords } from './rehype-fade.js';
15
17
  import { remarkHtmlAsText } from './remark-html-as-text.js';
16
18
  import { useChatHost } from '../../host.js';
17
19
  import { useFileLinkCwd, useFileLinkScopeId, useFileLinkTarget, useOpenFileLink } from './file-links.js';
18
20
  import { ErrorBoundary, FileIcon, Icon } from '@adecore/ui';
19
21
  import { useTranslation } from 'react-i18next';
20
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
21
23
  const ShellCodeBlockReplyContext = createContext(null);
22
24
  const BlockCodeContext = createContext(false);
23
25
  /* The command a shell fence holds, read from the fence as written, so it keeps the indentation and line endings it has. */
@@ -562,6 +564,7 @@ function replyHeading(level) {
562
564
  const replyComponents = {
563
565
  ...components,
564
566
  code: ReplyCode,
567
+ span: ChipSpan,
565
568
  h1: replyHeading(1),
566
569
  h2: replyHeading(2),
567
570
  h3: replyHeading(3),
@@ -685,121 +688,162 @@ function ReplyCode(t0) {
685
688
  }
686
689
  return t2;
687
690
  }
688
- /* A picked file or skill in a sent message. The glyph stands in for the sigil the text still carries. */
691
+ /* A picked file, skill or reference in a sent message. The glyph stands in for the sigil the text still carries. */
689
692
  function Chip(t0) {
690
- const $ = _c(16);
693
+ const $ = _c(14);
691
694
  const {
692
695
  kind,
693
696
  value
694
697
  } = t0;
698
+ if (kind === "reference") {
699
+ let t1;
700
+ if ($[0] !== value) {
701
+ t1 = /*#__PURE__*/_jsx(ReferenceChip, {
702
+ id: value
703
+ });
704
+ $[0] = value;
705
+ $[1] = t1;
706
+ } else {
707
+ t1 = $[1];
708
+ }
709
+ return t1;
710
+ }
695
711
  if (kind === "skill") {
696
712
  let t1;
697
- let t2;
698
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
699
- t1 = clsx(CHIP_IN_MESSAGE, SKILL_TONE);
700
- t2 = /*#__PURE__*/_jsx(Icon, {
713
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
714
+ t1 = /*#__PURE__*/_jsx(Icon, {
701
715
  icon: Zap,
702
716
  size: 14,
703
- className: "shrink-0 opacity-85"
717
+ className: clsx(TOKEN_ICON, "opacity-85")
704
718
  });
705
- $[0] = t1;
706
- $[1] = t2;
719
+ $[2] = t1;
707
720
  } else {
708
- t1 = $[0];
709
- t2 = $[1];
721
+ t1 = $[2];
710
722
  }
711
- let t3;
712
- if ($[2] !== value) {
713
- t3 = /*#__PURE__*/_jsxs("span", {
714
- className: t1,
715
- children: [t2, /*#__PURE__*/_jsx("span", {
716
- className: "truncate",
717
- children: value
718
- })]
723
+ let t2;
724
+ if ($[3] !== value) {
725
+ t2 = /*#__PURE__*/_jsx(TokenChip, {
726
+ kind: "skill",
727
+ value: value,
728
+ sigil: "$",
729
+ icon: t1,
730
+ label: value,
731
+ tone: SKILL_TONE
719
732
  });
720
- $[2] = value;
721
- $[3] = t3;
733
+ $[3] = value;
734
+ $[4] = t2;
722
735
  } else {
723
- t3 = $[3];
736
+ t2 = $[4];
724
737
  }
725
- return t3;
738
+ return t2;
726
739
  }
727
740
  let t1;
728
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
729
- t1 = clsx(CHIP_IN_MESSAGE, MENTION_TONE);
730
- $[4] = t1;
741
+ if ($[5] !== value) {
742
+ t1 = /*#__PURE__*/_jsx(FileIcon, {
743
+ path: value,
744
+ size: 14,
745
+ className: TOKEN_ICON
746
+ });
747
+ $[5] = value;
748
+ $[6] = t1;
731
749
  } else {
732
- t1 = $[4];
750
+ t1 = $[6];
733
751
  }
734
752
  let t2;
735
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
753
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
736
754
  t2 = /[\\/]$/;
737
- $[5] = t2;
755
+ $[7] = t2;
738
756
  } else {
739
- t2 = $[5];
757
+ t2 = $[7];
740
758
  }
741
759
  let t3;
742
- if ($[6] !== value) {
743
- t3 = t2.test(value);
744
- $[6] = value;
745
- $[7] = t3;
746
- } else {
747
- t3 = $[7];
748
- }
749
- let t4;
750
- let t5;
751
760
  if ($[8] !== value) {
752
- t4 = /*#__PURE__*/_jsx(FileIcon, {
753
- path: value,
754
- size: 14
755
- });
756
- t5 = /*#__PURE__*/_jsx("span", {
757
- className: "truncate",
758
- children: value
759
- });
761
+ t3 = t2.test(value);
760
762
  $[8] = value;
761
- $[9] = t4;
762
- $[10] = t5;
763
+ $[9] = t3;
763
764
  } else {
764
- t4 = $[9];
765
- t5 = $[10];
765
+ t3 = $[9];
766
766
  }
767
- let t6;
768
- if ($[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== value) {
769
- t6 = /*#__PURE__*/_jsxs("span", {
770
- className: t1,
767
+ let t4;
768
+ if ($[10] !== t1 || $[11] !== t3 || $[12] !== value) {
769
+ t4 = /*#__PURE__*/_jsx(TokenChip, {
770
+ kind: "mention",
771
+ value: value,
772
+ sigil: "@",
773
+ icon: t1,
774
+ label: value,
775
+ tone: MENTION_TONE,
771
776
  "data-file-path": value,
772
- "data-file-directory": t3,
773
- children: [t4, t5]
777
+ "data-file-directory": t3
774
778
  });
779
+ $[10] = t1;
775
780
  $[11] = t3;
776
- $[12] = t4;
777
- $[13] = t5;
778
- $[14] = value;
779
- $[15] = t6;
781
+ $[12] = value;
782
+ $[13] = t4;
780
783
  } else {
781
- t6 = $[15];
784
+ t4 = $[13];
782
785
  }
783
- return t6;
786
+ return t4;
784
787
  }
785
- const messageComponents = {
786
- ...replyComponents,
787
- span({
788
- children,
789
- 'data-chip': chip,
790
- 'data-value': value
791
- }) {
792
- if (chip === undefined || value === undefined) {
793
- return /*#__PURE__*/_jsx("span", {
788
+ /* A span the chip plugins made is a chip; any other, such as a fading word, stays the span it was. */
789
+ function ChipSpan(t0) {
790
+ const $ = _c(11);
791
+ let children;
792
+ let chip;
793
+ let rest;
794
+ let value;
795
+ if ($[0] !== t0) {
796
+ const {
797
+ children: t1,
798
+ node: _node,
799
+ "data-chip": t2,
800
+ "data-value": t3,
801
+ ...t4
802
+ } = t0;
803
+ children = t1;
804
+ chip = t2;
805
+ value = t3;
806
+ rest = t4;
807
+ $[0] = t0;
808
+ $[1] = children;
809
+ $[2] = chip;
810
+ $[3] = rest;
811
+ $[4] = value;
812
+ } else {
813
+ children = $[1];
814
+ chip = $[2];
815
+ rest = $[3];
816
+ value = $[4];
817
+ }
818
+ if (chip === undefined || value === undefined) {
819
+ let t1;
820
+ if ($[5] !== children || $[6] !== rest) {
821
+ t1 = /*#__PURE__*/_jsx("span", {
822
+ ...rest,
794
823
  children: children
795
824
  });
825
+ $[5] = children;
826
+ $[6] = rest;
827
+ $[7] = t1;
828
+ } else {
829
+ t1 = $[7];
796
830
  }
797
- return /*#__PURE__*/_jsx(Chip, {
831
+ return t1;
832
+ }
833
+ let t1;
834
+ if ($[8] !== chip || $[9] !== value) {
835
+ t1 = /*#__PURE__*/_jsx(Chip, {
798
836
  kind: chip,
799
837
  value: value
800
838
  });
839
+ $[8] = chip;
840
+ $[9] = value;
841
+ $[10] = t1;
842
+ } else {
843
+ t1 = $[10];
801
844
  }
802
- };
845
+ return t1;
846
+ }
803
847
  // Module constants, so a render never hands react-markdown a fresh array and makes it parse again.
804
848
  const PLUGINS = [remarkGfm];
805
849
  const REPLY_PLUGINS = [remarkGfm, remarkShellCodeBlocks];
@@ -809,54 +853,81 @@ const FADE_PLUGINS = [rehypeFadeWords];
809
853
  const NO_PLUGINS = [];
810
854
  /* One block of a reply. It renders no element of its own, so prose keeps its first and last margins. */
811
855
  const ReplyBlock = memo(function ReplyBlock(t0) {
812
- const $ = _c(9);
856
+ const $ = _c(16);
813
857
  const {
814
858
  text,
815
859
  fade,
816
860
  open,
817
861
  reply
818
862
  } = t0;
819
- const t1 = reply ?? null;
820
- const t2 = fade ? FADE_PLUGINS : NO_PLUGINS;
821
- let t3;
822
- if ($[0] !== t2 || $[1] !== text) {
823
- t3 = /*#__PURE__*/_jsx(ReactMarkdown, {
863
+ const {
864
+ items,
865
+ referenced
866
+ } = useContext(ReferenceLookupContext);
867
+ let t1;
868
+ if ($[0] !== items || $[1] !== referenced) {
869
+ t1 = {
870
+ items,
871
+ referenced
872
+ };
873
+ $[0] = items;
874
+ $[1] = referenced;
875
+ $[2] = t1;
876
+ } else {
877
+ t1 = $[2];
878
+ }
879
+ const named = t1;
880
+ let t2;
881
+ if ($[3] !== fade || $[4] !== items.length || $[5] !== named) {
882
+ t2 = items.length === 0 ? fade ? FADE_PLUGINS : NO_PLUGINS : [[rehypeNamedReferences, named], ...(fade ? FADE_PLUGINS : [])];
883
+ $[3] = fade;
884
+ $[4] = items.length;
885
+ $[5] = named;
886
+ $[6] = t2;
887
+ } else {
888
+ t2 = $[6];
889
+ }
890
+ const rehypePlugins = t2;
891
+ const t3 = reply ?? null;
892
+ let t4;
893
+ if ($[7] !== rehypePlugins || $[8] !== text) {
894
+ t4 = /*#__PURE__*/_jsx(ReactMarkdown, {
824
895
  remarkPlugins: REPLY_PLUGINS,
825
- rehypePlugins: t2,
896
+ rehypePlugins: rehypePlugins,
826
897
  components: replyComponents,
827
898
  children: text
828
899
  });
829
- $[0] = t2;
830
- $[1] = text;
831
- $[2] = t3;
900
+ $[7] = rehypePlugins;
901
+ $[8] = text;
902
+ $[9] = t4;
832
903
  } else {
833
- t3 = $[2];
904
+ t4 = $[9];
834
905
  }
835
- let t4;
836
- if ($[3] !== t1 || $[4] !== t3) {
837
- t4 = /*#__PURE__*/_jsx(ShellCodeBlockReplyContext.Provider, {
838
- value: t1,
839
- children: t3
906
+ let t5;
907
+ if ($[10] !== t3 || $[11] !== t4) {
908
+ t5 = /*#__PURE__*/_jsx(ShellCodeBlockReplyContext.Provider, {
909
+ value: t3,
910
+ children: t4
840
911
  });
841
- $[3] = t1;
842
- $[4] = t3;
843
- $[5] = t4;
912
+ $[10] = t3;
913
+ $[11] = t4;
914
+ $[12] = t5;
844
915
  } else {
845
- t4 = $[5];
916
+ t5 = $[12];
846
917
  }
847
- let t5;
848
- if ($[6] !== open || $[7] !== t4) {
849
- t5 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
918
+ let t6;
919
+ if ($[13] !== open || $[14] !== t5) {
920
+ t6 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
850
921
  value: open,
851
- children: t4
922
+ children: t5
852
923
  });
853
- $[6] = open;
854
- $[7] = t4;
855
- $[8] = t5;
924
+ $[13] = open;
925
+ $[14] = t5;
926
+ $[15] = t6;
856
927
  } else {
857
- t5 = $[8];
928
+ t6 = $[15];
858
929
  }
859
- return t5;
930
+ return t6;
860
931
  });
861
932
  /*
862
933
  * A code fence at the top level of a reply, drawn as markdown draws it but without parsing, so a word
@@ -998,44 +1069,47 @@ export const ReplyMarkdown = memo(function ReplyMarkdown(t0) {
998
1069
  });
999
1070
  /*
1000
1071
  * A message a person sent. Enter meant a line break, a tag typed without backticks stays the text
1001
- * it was, and the files and skills picked in the composer are chips again.
1072
+ * it was, and the files, skills and references picked in the composer are chips again.
1002
1073
  */
1003
1074
  export const MessageMarkdown = memo(function MessageMarkdown(t0) {
1004
- const $ = _c(6);
1075
+ const $ = _c(7);
1005
1076
  const {
1006
1077
  text,
1007
1078
  mentions,
1008
- skills
1079
+ skills,
1080
+ references
1009
1081
  } = t0;
1010
1082
  let t1;
1011
- if ($[0] !== mentions || $[1] !== skills) {
1083
+ if ($[0] !== mentions || $[1] !== references || $[2] !== skills) {
1012
1084
  t1 = [[rehypeChips, {
1013
1085
  mentions,
1014
- skills
1086
+ skills,
1087
+ references
1015
1088
  }]];
1016
1089
  $[0] = mentions;
1017
- $[1] = skills;
1018
- $[2] = t1;
1090
+ $[1] = references;
1091
+ $[2] = skills;
1092
+ $[3] = t1;
1019
1093
  } else {
1020
- t1 = $[2];
1094
+ t1 = $[3];
1021
1095
  }
1022
1096
  const rehypePlugins = t1;
1023
1097
  let t2;
1024
- if ($[3] !== rehypePlugins || $[4] !== text) {
1098
+ if ($[4] !== rehypePlugins || $[5] !== text) {
1025
1099
  t2 = /*#__PURE__*/_jsx("div", {
1026
1100
  className: "chat-markdown prose prose-sm max-w-none text-sm",
1027
1101
  children: /*#__PURE__*/_jsx(ReactMarkdown, {
1028
1102
  remarkPlugins: MESSAGE_PLUGINS,
1029
1103
  rehypePlugins: rehypePlugins,
1030
- components: messageComponents,
1104
+ components: replyComponents,
1031
1105
  children: text
1032
1106
  })
1033
1107
  });
1034
- $[3] = rehypePlugins;
1035
- $[4] = text;
1036
- $[5] = t2;
1108
+ $[4] = rehypePlugins;
1109
+ $[5] = text;
1110
+ $[6] = t2;
1037
1111
  } else {
1038
- t2 = $[5];
1112
+ t2 = $[6];
1039
1113
  }
1040
1114
  return t2;
1041
1115
  });