@adecore/agents-react 0.54.16 → 0.55.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.
- package/dist/agents/AgentModelLabel.d.ts +5 -0
- package/dist/agents/AgentModelLabel.js +32 -7
- package/dist/chat/account-choice.d.ts +1 -0
- package/dist/chat/account-choice.js +13 -4
- package/dist/chat/mentions.d.ts +24 -2
- package/dist/chat/mentions.js +84 -10
- package/dist/chat/subagent-list.d.ts +0 -1
- package/dist/chat/subagent-list.js +1 -9
- package/dist/chat/tag-suggestions.d.ts +22 -0
- package/dist/chat/tag-suggestions.js +71 -0
- package/dist/chat/ui/Composer.js +489 -447
- package/dist/chat/ui/ComposerInput.d.ts +1 -0
- package/dist/chat/ui/ComposerInput.js +9 -1
- package/dist/chat/ui/Markdown.js +41 -25
- package/dist/chat/ui/NamedChip.d.ts +5 -0
- package/dist/chat/ui/NamedChip.js +118 -0
- package/dist/chat/ui/Pickers.d.ts +0 -4
- package/dist/chat/ui/Pickers.js +1 -141
- package/dist/chat/ui/PromptEditor.js +2 -1
- package/dist/chat/ui/ReferenceChip.d.ts +3 -2
- package/dist/chat/ui/ReferenceChip.js +58 -36
- package/dist/chat/ui/RunSettings.d.ts +3 -2
- package/dist/chat/ui/RunSettings.js +386 -361
- package/dist/chat/ui/SubagentInfo.js +98 -114
- package/dist/chat/ui/SubagentTimeline.js +65 -43
- package/dist/chat/ui/Timeline.js +14 -8
- package/dist/chat/ui/chip-clipboard.js +10 -0
- package/dist/chat/ui/composer/ComposerControls.d.ts +6 -1
- package/dist/chat/ui/composer/ComposerControls.js +171 -158
- package/dist/chat/ui/composer/ComposerMenu.js +187 -55
- package/dist/chat/ui/composer/ComposerPlusMenu.d.ts +18 -0
- package/dist/chat/ui/composer/ComposerPlusMenu.js +400 -0
- package/dist/chat/ui/composer/ComposerStatusLine.d.ts +4 -0
- package/dist/chat/ui/composer/ComposerStatusLine.js +239 -0
- package/dist/chat/ui/composer/chips.d.ts +2 -0
- package/dist/chat/ui/composer/chips.js +66 -5
- package/dist/chat/ui/composer/insert.d.ts +1 -0
- package/dist/chat/ui/composer/insert.js +24 -0
- package/dist/chat/ui/composer/use-composer-menus.js +34 -17
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +10 -2
- package/dist/chat/ui/composer/use-prompt-menus.js +290 -202
- package/dist/chat/ui/covered-bottom.d.ts +1 -0
- package/dist/chat/ui/covered-bottom.js +6 -0
- package/dist/chat/ui/named-chip-look.d.ts +14 -0
- package/dist/chat/ui/named-chip-look.js +72 -0
- package/dist/chat/ui/rehype-chips.js +13 -2
- package/dist/host-hooks.d.ts +2 -1
- package/dist/host-hooks.js +6 -0
- package/dist/host.d.ts +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +14 -2
- package/dist/locales/en/agent-chat.js +16 -4
- package/dist/locales/nl/agent-chat.d.ts +14 -2
- package/dist/locales/nl/agent-chat.js +16 -4
- package/dist/state/chats.d.ts +1 -0
- package/dist/state/chats.js +45 -0
- package/package.json +9 -9
- package/src/agents/AgentModelLabel.tsx +10 -1
- package/src/chat/account-choice.ts +8 -0
- package/src/chat/mentions.ts +110 -13
- package/src/chat/subagent-list.ts +1 -14
- package/src/chat/tag-suggestions.ts +121 -0
- package/src/chat/ui/Composer.tsx +24 -12
- package/src/chat/ui/ComposerInput.tsx +13 -1
- package/src/chat/ui/Markdown.tsx +5 -0
- package/src/chat/ui/NamedChip.tsx +34 -0
- package/src/chat/ui/Pickers.tsx +1 -51
- package/src/chat/ui/PromptEditor.tsx +7 -1
- package/src/chat/ui/ReferenceChip.tsx +15 -4
- package/src/chat/ui/RunSettings.tsx +51 -29
- package/src/chat/ui/SubagentInfo.tsx +17 -17
- package/src/chat/ui/SubagentTimeline.tsx +7 -2
- package/src/chat/ui/Timeline.tsx +11 -5
- package/src/chat/ui/chip-clipboard.ts +8 -1
- package/src/chat/ui/composer/ComposerControls.tsx +24 -17
- package/src/chat/ui/composer/ComposerMenu.tsx +83 -15
- package/src/chat/ui/composer/ComposerPlusMenu.tsx +158 -0
- package/src/chat/ui/composer/ComposerStatusLine.tsx +94 -0
- package/src/chat/ui/composer/chips.ts +78 -7
- package/src/chat/ui/composer/insert.ts +12 -0
- package/src/chat/ui/composer/use-composer-menus.ts +5 -2
- package/src/chat/ui/composer/use-prompt-menus.ts +55 -10
- package/src/chat/ui/covered-bottom.ts +7 -0
- package/src/chat/ui/named-chip-look.ts +64 -0
- package/src/chat/ui/rehype-chips.ts +17 -2
- package/src/host-hooks.ts +11 -1
- package/src/host.ts +29 -0
- package/src/index.ts +2 -0
- package/src/locales/en/agent-chat.ts +16 -4
- package/src/locales/nl/agent-chat.ts +16 -4
- package/src/state/chats.ts +26 -0
|
@@ -5,7 +5,7 @@ import { EditorView, placeholder as placeholderText } from '@codemirror/view';
|
|
|
5
5
|
import { useImperativeHandle, useLayoutEffect, useRef, useState } from 'react';
|
|
6
6
|
import { useChatHost } from '../../host.js';
|
|
7
7
|
import { composerEditorExtensions, externalChange } from './composer/editor.js';
|
|
8
|
-
import { insertAtSelection } from './composer/insert.js';
|
|
8
|
+
import { insertAtSelection, insertSigil } from './composer/insert.js';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const NO_EXTENSIONS = [];
|
|
11
11
|
const NO_ARIA = {};
|
|
@@ -268,6 +268,14 @@ export function ComposerInput(t0) {
|
|
|
268
268
|
}
|
|
269
269
|
view_2.dispatch(insertAtSelection(view_2.state, text_0));
|
|
270
270
|
view_2.focus();
|
|
271
|
+
},
|
|
272
|
+
insertSigil: sigil => {
|
|
273
|
+
const view_3 = viewRef.current;
|
|
274
|
+
if (!view_3) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
view_3.focus();
|
|
278
|
+
view_3.dispatch(insertSigil(view_3.state, sigil));
|
|
271
279
|
}
|
|
272
280
|
});
|
|
273
281
|
t13 = [];
|
package/dist/chat/ui/Markdown.js
CHANGED
|
@@ -15,6 +15,7 @@ import { DisplayImage } from './DisplayImage.js';
|
|
|
15
15
|
import { useFileLinkCwd, useFileLinkScopeId, useFileLinkTarget, useOpenFileLink } from './file-links.js';
|
|
16
16
|
import { createMarkdownBlockSplitter } from './markdown-blocks.js';
|
|
17
17
|
import { MermaidBlock } from './MermaidBlock.js';
|
|
18
|
+
import { NamedChip } from './NamedChip.js';
|
|
18
19
|
import { ReferenceLookupContext } from './reference-lookup.js';
|
|
19
20
|
import { ReferenceChip, TokenChip } from './ReferenceChip.js';
|
|
20
21
|
import { rehypeChips, rehypeNamedReferences } from './rehype-chips.js';
|
|
@@ -681,7 +682,7 @@ function ReplyCode(t0) {
|
|
|
681
682
|
}
|
|
682
683
|
/* A picked file, skill or reference in a sent message. The glyph stands in for the sigil the text still carries. */
|
|
683
684
|
function Chip(t0) {
|
|
684
|
-
const $ = _c(
|
|
685
|
+
const $ = _c(17);
|
|
685
686
|
const {
|
|
686
687
|
kind,
|
|
687
688
|
value
|
|
@@ -699,20 +700,35 @@ function Chip(t0) {
|
|
|
699
700
|
}
|
|
700
701
|
return t1;
|
|
701
702
|
}
|
|
703
|
+
if (kind === "model" || kind === "account") {
|
|
704
|
+
let t1;
|
|
705
|
+
if ($[2] !== kind || $[3] !== value) {
|
|
706
|
+
t1 = /*#__PURE__*/_jsx(NamedChip, {
|
|
707
|
+
kind: kind,
|
|
708
|
+
value: value
|
|
709
|
+
});
|
|
710
|
+
$[2] = kind;
|
|
711
|
+
$[3] = value;
|
|
712
|
+
$[4] = t1;
|
|
713
|
+
} else {
|
|
714
|
+
t1 = $[4];
|
|
715
|
+
}
|
|
716
|
+
return t1;
|
|
717
|
+
}
|
|
702
718
|
if (kind === "skill") {
|
|
703
719
|
let t1;
|
|
704
|
-
if ($[
|
|
720
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
705
721
|
t1 = /*#__PURE__*/_jsx(Icon, {
|
|
706
722
|
icon: Zap,
|
|
707
723
|
size: 14,
|
|
708
724
|
className: clsx(TOKEN_ICON, "opacity-85")
|
|
709
725
|
});
|
|
710
|
-
$[
|
|
726
|
+
$[5] = t1;
|
|
711
727
|
} else {
|
|
712
|
-
t1 = $[
|
|
728
|
+
t1 = $[5];
|
|
713
729
|
}
|
|
714
730
|
let t2;
|
|
715
|
-
if ($[
|
|
731
|
+
if ($[6] !== value) {
|
|
716
732
|
t2 = /*#__PURE__*/_jsx(TokenChip, {
|
|
717
733
|
kind: "skill",
|
|
718
734
|
value: value,
|
|
@@ -721,42 +737,42 @@ function Chip(t0) {
|
|
|
721
737
|
label: value,
|
|
722
738
|
tone: SKILL_TONE
|
|
723
739
|
});
|
|
724
|
-
$[
|
|
725
|
-
$[
|
|
740
|
+
$[6] = value;
|
|
741
|
+
$[7] = t2;
|
|
726
742
|
} else {
|
|
727
|
-
t2 = $[
|
|
743
|
+
t2 = $[7];
|
|
728
744
|
}
|
|
729
745
|
return t2;
|
|
730
746
|
}
|
|
731
747
|
let t1;
|
|
732
|
-
if ($[
|
|
748
|
+
if ($[8] !== value) {
|
|
733
749
|
t1 = /*#__PURE__*/_jsx(FileIcon, {
|
|
734
750
|
path: value,
|
|
735
751
|
size: 14,
|
|
736
752
|
className: TOKEN_ICON
|
|
737
753
|
});
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
754
|
+
$[8] = value;
|
|
755
|
+
$[9] = t1;
|
|
740
756
|
} else {
|
|
741
|
-
t1 = $[
|
|
757
|
+
t1 = $[9];
|
|
742
758
|
}
|
|
743
759
|
let t2;
|
|
744
|
-
if ($[
|
|
760
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
745
761
|
t2 = /[\\/]$/;
|
|
746
|
-
$[
|
|
762
|
+
$[10] = t2;
|
|
747
763
|
} else {
|
|
748
|
-
t2 = $[
|
|
764
|
+
t2 = $[10];
|
|
749
765
|
}
|
|
750
766
|
let t3;
|
|
751
|
-
if ($[
|
|
767
|
+
if ($[11] !== value) {
|
|
752
768
|
t3 = t2.test(value);
|
|
753
|
-
$[
|
|
754
|
-
$[
|
|
769
|
+
$[11] = value;
|
|
770
|
+
$[12] = t3;
|
|
755
771
|
} else {
|
|
756
|
-
t3 = $[
|
|
772
|
+
t3 = $[12];
|
|
757
773
|
}
|
|
758
774
|
let t4;
|
|
759
|
-
if ($[
|
|
775
|
+
if ($[13] !== t1 || $[14] !== t3 || $[15] !== value) {
|
|
760
776
|
t4 = /*#__PURE__*/_jsx(TokenChip, {
|
|
761
777
|
kind: "mention",
|
|
762
778
|
value: value,
|
|
@@ -767,12 +783,12 @@ function Chip(t0) {
|
|
|
767
783
|
"data-file-path": value,
|
|
768
784
|
"data-file-directory": t3
|
|
769
785
|
});
|
|
770
|
-
$[
|
|
771
|
-
$[
|
|
772
|
-
$[
|
|
773
|
-
$[
|
|
786
|
+
$[13] = t1;
|
|
787
|
+
$[14] = t3;
|
|
788
|
+
$[15] = value;
|
|
789
|
+
$[16] = t4;
|
|
774
790
|
} else {
|
|
775
|
-
t4 = $[
|
|
791
|
+
t4 = $[16];
|
|
776
792
|
}
|
|
777
793
|
return t4;
|
|
778
794
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { CliMark } from '../../agents/AgentModelLabel.js';
|
|
3
|
+
import { namedChipPrefix } from '../mentions.js';
|
|
4
|
+
import { REFERENCE_TONE, TOKEN_ICON_BOX } from './chips.js';
|
|
5
|
+
import { useNamedChipLookup } from './named-chip-look.js';
|
|
6
|
+
import { TokenChip } from './ReferenceChip.js';
|
|
7
|
+
/*
|
|
8
|
+
* A model or an account a message names, under its CLI's mark in the color of the account it runs on, and
|
|
9
|
+
* the name the machine knows it by. An id the machine does not know keeps the id. A copy reads the token.
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export function NamedChip(t0) {
|
|
13
|
+
const $ = _c(26);
|
|
14
|
+
const {
|
|
15
|
+
kind,
|
|
16
|
+
value
|
|
17
|
+
} = t0;
|
|
18
|
+
const lookup = useNamedChipLookup();
|
|
19
|
+
let T0;
|
|
20
|
+
let cli;
|
|
21
|
+
let color;
|
|
22
|
+
let id;
|
|
23
|
+
let label;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[0] !== kind || $[1] !== lookup || $[2] !== value) {
|
|
28
|
+
const slash = value.indexOf("/");
|
|
29
|
+
cli = value.slice(0, slash);
|
|
30
|
+
id = value.slice(slash + 1);
|
|
31
|
+
({
|
|
32
|
+
label,
|
|
33
|
+
color
|
|
34
|
+
} = lookup(kind, cli, id));
|
|
35
|
+
T0 = TokenChip;
|
|
36
|
+
t1 = kind;
|
|
37
|
+
t2 = value;
|
|
38
|
+
t3 = namedChipPrefix(kind, cli);
|
|
39
|
+
$[0] = kind;
|
|
40
|
+
$[1] = lookup;
|
|
41
|
+
$[2] = value;
|
|
42
|
+
$[3] = T0;
|
|
43
|
+
$[4] = cli;
|
|
44
|
+
$[5] = color;
|
|
45
|
+
$[6] = id;
|
|
46
|
+
$[7] = label;
|
|
47
|
+
$[8] = t1;
|
|
48
|
+
$[9] = t2;
|
|
49
|
+
$[10] = t3;
|
|
50
|
+
} else {
|
|
51
|
+
T0 = $[3];
|
|
52
|
+
cli = $[4];
|
|
53
|
+
color = $[5];
|
|
54
|
+
id = $[6];
|
|
55
|
+
label = $[7];
|
|
56
|
+
t1 = $[8];
|
|
57
|
+
t2 = $[9];
|
|
58
|
+
t3 = $[10];
|
|
59
|
+
}
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[11] !== color) {
|
|
62
|
+
t4 = color === undefined ? undefined : {
|
|
63
|
+
color
|
|
64
|
+
};
|
|
65
|
+
$[11] = color;
|
|
66
|
+
$[12] = t4;
|
|
67
|
+
} else {
|
|
68
|
+
t4 = $[12];
|
|
69
|
+
}
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[13] !== cli) {
|
|
72
|
+
t5 = /*#__PURE__*/_jsx(CliMark, {
|
|
73
|
+
kind: cli,
|
|
74
|
+
size: 14
|
|
75
|
+
});
|
|
76
|
+
$[13] = cli;
|
|
77
|
+
$[14] = t5;
|
|
78
|
+
} else {
|
|
79
|
+
t5 = $[14];
|
|
80
|
+
}
|
|
81
|
+
let t6;
|
|
82
|
+
if ($[15] !== t4 || $[16] !== t5) {
|
|
83
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
84
|
+
className: TOKEN_ICON_BOX,
|
|
85
|
+
style: t4,
|
|
86
|
+
children: t5
|
|
87
|
+
});
|
|
88
|
+
$[15] = t4;
|
|
89
|
+
$[16] = t5;
|
|
90
|
+
$[17] = t6;
|
|
91
|
+
} else {
|
|
92
|
+
t6 = $[17];
|
|
93
|
+
}
|
|
94
|
+
const t7 = label === id ? undefined : id;
|
|
95
|
+
let t8;
|
|
96
|
+
if ($[18] !== T0 || $[19] !== label || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t6 || $[24] !== t7) {
|
|
97
|
+
t8 = /*#__PURE__*/_jsx(T0, {
|
|
98
|
+
kind: t1,
|
|
99
|
+
value: t2,
|
|
100
|
+
sigil: t3,
|
|
101
|
+
icon: t6,
|
|
102
|
+
label: label,
|
|
103
|
+
spelled: t7,
|
|
104
|
+
tone: REFERENCE_TONE
|
|
105
|
+
});
|
|
106
|
+
$[18] = T0;
|
|
107
|
+
$[19] = label;
|
|
108
|
+
$[20] = t1;
|
|
109
|
+
$[21] = t2;
|
|
110
|
+
$[22] = t3;
|
|
111
|
+
$[23] = t6;
|
|
112
|
+
$[24] = t7;
|
|
113
|
+
$[25] = t8;
|
|
114
|
+
} else {
|
|
115
|
+
t8 = $[25];
|
|
116
|
+
}
|
|
117
|
+
return t8;
|
|
118
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AgentKind, ModelSelection, ProviderInfo } from '@adecore/agent-contracts';
|
|
2
2
|
import { type ReactNode, type RefObject } from 'react';
|
|
3
|
-
import { type StashedPrompt } from '../stash.js';
|
|
4
3
|
interface ModelPickerProps {
|
|
5
4
|
providers: ProviderInfo[];
|
|
6
5
|
provider: AgentKind;
|
|
@@ -16,7 +15,4 @@ interface ModelPickerProps {
|
|
|
16
15
|
footer?: ReactNode;
|
|
17
16
|
}
|
|
18
17
|
export declare function ModelPicker({ providers, provider, selection, open, onOpenChange, onChange, kbd, side, trigger, chipSize, finalFocus, footer }: ModelPickerProps): import("react").JSX.Element;
|
|
19
|
-
export declare function StashPicker({ onRestore }: {
|
|
20
|
-
onRestore(prompt: StashedPrompt): void;
|
|
21
|
-
}): import("react").JSX.Element | null;
|
|
22
18
|
export {};
|
package/dist/chat/ui/Pickers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { Button, Icon, IconButton, Menu, Popover, ScrollArea, Tooltip } from '@adecore/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { ChevronDown, ChevronRight, Search, Star } from 'lucide-react';
|
|
4
4
|
import { useContext, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
@@ -13,7 +13,6 @@ import { ChatScopeContext } from '../../scope.js';
|
|
|
13
13
|
import { useReportedModels } from '../../state/chats.js';
|
|
14
14
|
import { inPickerOrder, pickerEntriesOf, separatesGroups } from '../logic/picker-entries.js';
|
|
15
15
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences.js';
|
|
16
|
-
import { forgetStashed, STASH_SHORTCUT, useStash } from '../stash.js';
|
|
17
16
|
import { ModelMarks } from './ModelMarks.js';
|
|
18
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const triggerClass = 'flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-md px-2 text-xs text-text-muted hover:bg-surface-hover hover:text-text data-[popup-open]:bg-surface-active data-[popup-open]:text-text';
|
|
@@ -507,145 +506,6 @@ export function ModelPicker(t0) {
|
|
|
507
506
|
})]
|
|
508
507
|
});
|
|
509
508
|
}
|
|
510
|
-
/*
|
|
511
|
-
* Prompts put aside with Cmd+S, on a shelf the whole app shares, since a stashed prompt usually moves
|
|
512
|
-
* to another chat. A draft's files are named on the row but not kept: their bytes never go to storage.
|
|
513
|
-
*/
|
|
514
509
|
function _temp(preferences) {
|
|
515
510
|
return preferences.favoriteModels;
|
|
516
|
-
}
|
|
517
|
-
export function StashPicker(t0) {
|
|
518
|
-
const $ = _c(20);
|
|
519
|
-
const {
|
|
520
|
-
onRestore
|
|
521
|
-
} = t0;
|
|
522
|
-
const {
|
|
523
|
-
t
|
|
524
|
-
} = useTranslation("agent-chat");
|
|
525
|
-
const prompts = useStash(_temp2);
|
|
526
|
-
if (prompts.length === 0) {
|
|
527
|
-
return null;
|
|
528
|
-
}
|
|
529
|
-
let t1;
|
|
530
|
-
if ($[0] !== t) {
|
|
531
|
-
t1 = t("pickers.stash.title");
|
|
532
|
-
$[0] = t;
|
|
533
|
-
$[1] = t1;
|
|
534
|
-
} else {
|
|
535
|
-
t1 = $[1];
|
|
536
|
-
}
|
|
537
|
-
let t2;
|
|
538
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
539
|
-
t2 = /*#__PURE__*/_jsx(Icon, {
|
|
540
|
-
icon: Bookmark,
|
|
541
|
-
size: 12
|
|
542
|
-
});
|
|
543
|
-
$[2] = t2;
|
|
544
|
-
} else {
|
|
545
|
-
t2 = $[2];
|
|
546
|
-
}
|
|
547
|
-
let t3;
|
|
548
|
-
if ($[3] !== prompts.length) {
|
|
549
|
-
t3 = /*#__PURE__*/_jsxs(Popover.Trigger, {
|
|
550
|
-
className: triggerClass,
|
|
551
|
-
children: [t2, /*#__PURE__*/_jsx("span", {
|
|
552
|
-
className: "tabular-nums",
|
|
553
|
-
children: prompts.length
|
|
554
|
-
})]
|
|
555
|
-
});
|
|
556
|
-
$[3] = prompts.length;
|
|
557
|
-
$[4] = t3;
|
|
558
|
-
} else {
|
|
559
|
-
t3 = $[4];
|
|
560
|
-
}
|
|
561
|
-
let t4;
|
|
562
|
-
if ($[5] !== t1 || $[6] !== t3) {
|
|
563
|
-
t4 = /*#__PURE__*/_jsx(Tooltip, {
|
|
564
|
-
label: t1,
|
|
565
|
-
kbd: STASH_SHORTCUT,
|
|
566
|
-
children: t3
|
|
567
|
-
});
|
|
568
|
-
$[5] = t1;
|
|
569
|
-
$[6] = t3;
|
|
570
|
-
$[7] = t4;
|
|
571
|
-
} else {
|
|
572
|
-
t4 = $[7];
|
|
573
|
-
}
|
|
574
|
-
let t5;
|
|
575
|
-
if ($[8] !== onRestore || $[9] !== prompts || $[10] !== t) {
|
|
576
|
-
let t6;
|
|
577
|
-
if ($[12] !== onRestore || $[13] !== t) {
|
|
578
|
-
t6 = prompt => /*#__PURE__*/_jsxs("div", {
|
|
579
|
-
className: "group/stash flex items-start gap-1",
|
|
580
|
-
children: [/*#__PURE__*/_jsxs(Popover.Close, {
|
|
581
|
-
className: "flex min-w-0 grow flex-col gap-0.5 rounded-md px-2 py-1.5 text-left text-xs text-text-muted hover:bg-surface-hover hover:text-text",
|
|
582
|
-
onClick: () => onRestore(prompt),
|
|
583
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
584
|
-
className: "line-clamp-2 whitespace-pre-wrap",
|
|
585
|
-
children: prompt.text || prompt.quote?.text || t("pickers.stash.noText")
|
|
586
|
-
}), prompt.attachments.length > 0 && /*#__PURE__*/_jsx("span", {
|
|
587
|
-
className: "text-text-faint",
|
|
588
|
-
children: t("pickers.stash.files", {
|
|
589
|
-
count: prompt.attachments.length
|
|
590
|
-
})
|
|
591
|
-
}), prompt.chats.length > 0 && /*#__PURE__*/_jsx("span", {
|
|
592
|
-
className: "text-text-faint",
|
|
593
|
-
children: t("pickers.stash.chats", {
|
|
594
|
-
count: prompt.chats.length
|
|
595
|
-
})
|
|
596
|
-
})]
|
|
597
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
598
|
-
icon: Trash2,
|
|
599
|
-
size: "xs",
|
|
600
|
-
label: t("common.action.delete"),
|
|
601
|
-
className: "mt-1 opacity-0 group-hover/stash:opacity-100 focus-visible:opacity-100",
|
|
602
|
-
onClick: () => forgetStashed(prompt.id)
|
|
603
|
-
})]
|
|
604
|
-
}, prompt.id);
|
|
605
|
-
$[12] = onRestore;
|
|
606
|
-
$[13] = t;
|
|
607
|
-
$[14] = t6;
|
|
608
|
-
} else {
|
|
609
|
-
t6 = $[14];
|
|
610
|
-
}
|
|
611
|
-
t5 = prompts.map(t6);
|
|
612
|
-
$[8] = onRestore;
|
|
613
|
-
$[9] = prompts;
|
|
614
|
-
$[10] = t;
|
|
615
|
-
$[11] = t5;
|
|
616
|
-
} else {
|
|
617
|
-
t5 = $[11];
|
|
618
|
-
}
|
|
619
|
-
let t6;
|
|
620
|
-
if ($[15] !== t5) {
|
|
621
|
-
t6 = /*#__PURE__*/_jsx(Popover.Popup, {
|
|
622
|
-
variant: "picker",
|
|
623
|
-
side: "top",
|
|
624
|
-
className: "w-80",
|
|
625
|
-
children: /*#__PURE__*/_jsx(ScrollArea, {
|
|
626
|
-
className: "max-h-72",
|
|
627
|
-
viewportClassName: "p-1",
|
|
628
|
-
children: t5
|
|
629
|
-
})
|
|
630
|
-
});
|
|
631
|
-
$[15] = t5;
|
|
632
|
-
$[16] = t6;
|
|
633
|
-
} else {
|
|
634
|
-
t6 = $[16];
|
|
635
|
-
}
|
|
636
|
-
let t7;
|
|
637
|
-
if ($[17] !== t4 || $[18] !== t6) {
|
|
638
|
-
t7 = /*#__PURE__*/_jsxs(Popover.Root, {
|
|
639
|
-
children: [t4, t6]
|
|
640
|
-
});
|
|
641
|
-
$[17] = t4;
|
|
642
|
-
$[18] = t6;
|
|
643
|
-
$[19] = t7;
|
|
644
|
-
} else {
|
|
645
|
-
t7 = $[19];
|
|
646
|
-
}
|
|
647
|
-
return t7;
|
|
648
|
-
}
|
|
649
|
-
function _temp2(s) {
|
|
650
|
-
return s.prompts;
|
|
651
511
|
}
|
|
@@ -66,7 +66,8 @@ export function PromptEditor({
|
|
|
66
66
|
mentions: value.mentions,
|
|
67
67
|
skills: value.skills,
|
|
68
68
|
references: menus.referenceChips,
|
|
69
|
-
referenceIcon: host.ReferenceIcon
|
|
69
|
+
referenceIcon: host.ReferenceIcon,
|
|
70
|
+
named: menus.namedLook
|
|
70
71
|
});
|
|
71
72
|
const onKeyDown = e => {
|
|
72
73
|
if (e.isComposing) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
interface TokenChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
3
|
-
kind: 'mention' | 'skill' | 'reference' | 'gone';
|
|
3
|
+
kind: 'mention' | 'skill' | 'reference' | 'gone' | 'model' | 'account';
|
|
4
4
|
value?: string;
|
|
5
5
|
sigil?: string;
|
|
6
6
|
icon: ReactNode;
|
|
7
7
|
label: string;
|
|
8
|
+
spelled?: string;
|
|
8
9
|
tone: string;
|
|
9
10
|
onOpen?: () => void;
|
|
10
11
|
}
|
|
11
|
-
export declare function TokenChip({ kind, value, sigil, icon, label, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
|
|
12
|
+
export declare function TokenChip({ kind, value, sigil, icon, label, spelled, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
|
|
12
13
|
export declare function ReferenceChip({ id, lastName, goneHint }: {
|
|
13
14
|
id: string;
|
|
14
15
|
lastName?: string;
|
|
@@ -14,9 +14,9 @@ import { ReferenceTrail } from './ReferenceTrail.js';
|
|
|
14
14
|
* since a button is a box with a baseline of its own and would not sit on the line the others sit on.
|
|
15
15
|
* It stays out of prose, whose margins on an image would lift a host's picture mark off the line.
|
|
16
16
|
*/
|
|
17
|
-
import { jsx as _jsx,
|
|
17
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export function TokenChip(t0) {
|
|
19
|
-
const $ = _c(
|
|
19
|
+
const $ = _c(34);
|
|
20
20
|
let className;
|
|
21
21
|
let icon;
|
|
22
22
|
let kind;
|
|
@@ -24,6 +24,7 @@ export function TokenChip(t0) {
|
|
|
24
24
|
let onOpen;
|
|
25
25
|
let rest;
|
|
26
26
|
let sigil;
|
|
27
|
+
let spelled;
|
|
27
28
|
let t1;
|
|
28
29
|
let tone;
|
|
29
30
|
let value;
|
|
@@ -34,6 +35,7 @@ export function TokenChip(t0) {
|
|
|
34
35
|
sigil,
|
|
35
36
|
icon,
|
|
36
37
|
label,
|
|
38
|
+
spelled,
|
|
37
39
|
tone,
|
|
38
40
|
onOpen,
|
|
39
41
|
className,
|
|
@@ -53,9 +55,10 @@ export function TokenChip(t0) {
|
|
|
53
55
|
$[5] = onOpen;
|
|
54
56
|
$[6] = rest;
|
|
55
57
|
$[7] = sigil;
|
|
56
|
-
$[8] =
|
|
57
|
-
$[9] =
|
|
58
|
-
$[10] =
|
|
58
|
+
$[8] = spelled;
|
|
59
|
+
$[9] = t1;
|
|
60
|
+
$[10] = tone;
|
|
61
|
+
$[11] = value;
|
|
59
62
|
} else {
|
|
60
63
|
className = $[1];
|
|
61
64
|
icon = $[2];
|
|
@@ -64,40 +67,59 @@ export function TokenChip(t0) {
|
|
|
64
67
|
onOpen = $[5];
|
|
65
68
|
rest = $[6];
|
|
66
69
|
sigil = $[7];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
spelled = $[8];
|
|
71
|
+
t1 = $[9];
|
|
72
|
+
tone = $[10];
|
|
73
|
+
value = $[11];
|
|
70
74
|
}
|
|
71
75
|
const onKeyDown = t1;
|
|
72
76
|
const t2 = onOpen !== undefined && "cursor-pointer focus-visible:outline-2 focus-visible:outline-accent";
|
|
73
77
|
let t3;
|
|
74
|
-
if ($[
|
|
78
|
+
if ($[12] !== className || $[13] !== t2 || $[14] !== tone) {
|
|
75
79
|
t3 = clsx("not-prose", TOKEN_IN_MESSAGE, tone, t2, className);
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
+
$[12] = className;
|
|
81
|
+
$[13] = t2;
|
|
82
|
+
$[14] = tone;
|
|
83
|
+
$[15] = t3;
|
|
80
84
|
} else {
|
|
81
|
-
t3 = $[
|
|
85
|
+
t3 = $[15];
|
|
82
86
|
}
|
|
83
87
|
const t4 = kind === "reference" ? label : undefined;
|
|
84
88
|
const t5 = onOpen === undefined ? undefined : "button";
|
|
85
89
|
const t6 = onOpen === undefined ? undefined : 0;
|
|
86
90
|
const t7 = onOpen === undefined ? undefined : onKeyDown;
|
|
87
91
|
let t8;
|
|
88
|
-
if ($[
|
|
92
|
+
if ($[16] !== sigil) {
|
|
89
93
|
t8 = sigil !== undefined && /*#__PURE__*/_jsx("span", {
|
|
90
94
|
className: "sr-only",
|
|
91
95
|
children: sigil
|
|
92
96
|
});
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
97
|
+
$[16] = sigil;
|
|
98
|
+
$[17] = t8;
|
|
95
99
|
} else {
|
|
96
|
-
t8 = $[
|
|
100
|
+
t8 = $[17];
|
|
97
101
|
}
|
|
98
102
|
let t9;
|
|
99
|
-
if ($[
|
|
100
|
-
t9 = /*#__PURE__*/_jsxs(
|
|
103
|
+
if ($[18] !== label || $[19] !== spelled) {
|
|
104
|
+
t9 = spelled === undefined ? label : /*#__PURE__*/_jsxs(_Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
106
|
+
"aria-hidden": true,
|
|
107
|
+
className: "sr-only",
|
|
108
|
+
children: spelled
|
|
109
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
110
|
+
className: "select-none",
|
|
111
|
+
children: label
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
$[18] = label;
|
|
115
|
+
$[19] = spelled;
|
|
116
|
+
$[20] = t9;
|
|
117
|
+
} else {
|
|
118
|
+
t9 = $[20];
|
|
119
|
+
}
|
|
120
|
+
let t10;
|
|
121
|
+
if ($[21] !== icon || $[22] !== kind || $[23] !== onOpen || $[24] !== rest || $[25] !== t3 || $[26] !== t4 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9 || $[32] !== value) {
|
|
122
|
+
t10 = /*#__PURE__*/_jsxs("span", {
|
|
101
123
|
...rest,
|
|
102
124
|
className: t3,
|
|
103
125
|
"data-chip": kind,
|
|
@@ -107,25 +129,25 @@ export function TokenChip(t0) {
|
|
|
107
129
|
tabIndex: t6,
|
|
108
130
|
onClick: onOpen,
|
|
109
131
|
onKeyDown: t7,
|
|
110
|
-
children: [icon, t8,
|
|
132
|
+
children: [icon, t8, t9]
|
|
111
133
|
});
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
134
|
+
$[21] = icon;
|
|
135
|
+
$[22] = kind;
|
|
136
|
+
$[23] = onOpen;
|
|
137
|
+
$[24] = rest;
|
|
138
|
+
$[25] = t3;
|
|
139
|
+
$[26] = t4;
|
|
140
|
+
$[27] = t5;
|
|
141
|
+
$[28] = t6;
|
|
142
|
+
$[29] = t7;
|
|
143
|
+
$[30] = t8;
|
|
144
|
+
$[31] = t9;
|
|
145
|
+
$[32] = value;
|
|
146
|
+
$[33] = t10;
|
|
125
147
|
} else {
|
|
126
|
-
|
|
148
|
+
t10 = $[33];
|
|
127
149
|
}
|
|
128
|
-
return
|
|
150
|
+
return t10;
|
|
129
151
|
}
|
|
130
152
|
/*
|
|
131
153
|
* A view, node or chat a message points at, under the name it has now. One that went says so, under
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AgentKind, type ChatUsage, type ModelInfo, type ModelSelection, type ProviderInfo, type RuntimeMode } from '@adecore/agent-contracts';
|
|
2
2
|
import type { AccountChoice } from '../account-choice.js';
|
|
3
3
|
interface RunSettingsProps {
|
|
4
4
|
disabled?: boolean;
|
|
@@ -18,11 +18,12 @@ interface RunSettingsProps {
|
|
|
18
18
|
compactDisabled: boolean;
|
|
19
19
|
onCompact(): void;
|
|
20
20
|
account: AccountPick | null;
|
|
21
|
+
accountColorId?: string;
|
|
21
22
|
}
|
|
22
23
|
interface AccountPick {
|
|
23
24
|
choice: AccountChoice;
|
|
24
25
|
started: boolean;
|
|
25
26
|
onPick(id: string): void;
|
|
26
27
|
}
|
|
27
|
-
export declare function RunSettings({ disabled, providers, provider, selection, model, runtimeMode, effectiveRuntimeMode, permissionMode, open, onOpenChange, onModel, onOption, onMode, usage, compactDisabled, onCompact, account }: RunSettingsProps): import("react").JSX.Element;
|
|
28
|
+
export declare function RunSettings({ disabled, providers, provider, selection, model, runtimeMode, effectiveRuntimeMode, permissionMode, open, onOpenChange, onModel, onOption, onMode, usage, compactDisabled, onCompact, account, accountColorId }: RunSettingsProps): import("react").JSX.Element;
|
|
28
29
|
export {};
|