@adecore/agents-react 0.35.4 → 0.36.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/chat/ui/Pickers.js +6 -3
- package/dist/chat/ui/RunSettings.js +2 -2
- package/dist/chat/ui/composer/ComposerControls.js +1 -1
- package/dist/chat/ui/rows/MessageRows.js +1 -1
- package/package.json +8 -8
- package/src/chat/ui/Pickers.tsx +3 -6
- package/src/chat/ui/RunSettings.tsx +2 -2
- package/src/chat/ui/composer/ComposerControls.tsx +1 -1
- package/src/chat/ui/rows/MessageRows.tsx +1 -1
package/dist/chat/ui/Pickers.js
CHANGED
|
@@ -13,11 +13,10 @@ import { ModelMarks } from './ModelMarks.js';
|
|
|
13
13
|
import { pickerEntriesOf } from '../logic/picker-entries.js';
|
|
14
14
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences.js';
|
|
15
15
|
import { forgetStashed, STASH_SHORTCUT, useStash } from '../stash.js';
|
|
16
|
-
import { Icon, IconButton, Menu, Popover, Tooltip } from '@adecore/ui';
|
|
16
|
+
import { Button, Icon, IconButton, Menu, Popover, Tooltip } from '@adecore/ui';
|
|
17
17
|
import { useHostMachineLabel } from '../../host-hooks.js';
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
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';
|
|
20
|
-
const chipClass = 'flex h-6 min-w-0 shrink items-center gap-1.5 whitespace-nowrap rounded-md bg-surface-hover px-2 text-xs text-text hover:bg-surface-active data-[popup-open]:bg-surface-active';
|
|
21
20
|
/*
|
|
22
21
|
* Which model answers: a search field over one group per provider, with the legacy models behind an
|
|
23
22
|
* expander. Before the first message the list carries every installed CLI, so picking another
|
|
@@ -251,7 +250,11 @@ export function ModelPicker(t0) {
|
|
|
251
250
|
let t18;
|
|
252
251
|
if ($[37] !== chip || $[38] !== current || $[39] !== provider || $[40] !== trigger) {
|
|
253
252
|
t18 = trigger === "chip" ? /*#__PURE__*/_jsxs(Popover.Trigger, {
|
|
254
|
-
|
|
253
|
+
render: /*#__PURE__*/_jsx(Button, {
|
|
254
|
+
variant: "secondary",
|
|
255
|
+
size: "sm",
|
|
256
|
+
className: "min-w-0 shrink gap-1.5"
|
|
257
|
+
}),
|
|
255
258
|
children: [chip.mark === "logo" ? /*#__PURE__*/_jsx(ProviderLogo, {
|
|
256
259
|
provider: provider,
|
|
257
260
|
size: 12
|
|
@@ -422,7 +422,7 @@ export function RunSettings(t0) {
|
|
|
422
422
|
} else {
|
|
423
423
|
t19 = $[56];
|
|
424
424
|
}
|
|
425
|
-
const t20 = open ? "border-accent bg-accent-soft" : "border-border hover:bg-surface-hover";
|
|
425
|
+
const t20 = open ? "border-accent bg-accent-soft" : "border-border hover:bg-surface-hover-edged";
|
|
426
426
|
let t21;
|
|
427
427
|
if ($[57] !== t20) {
|
|
428
428
|
t21 = clsx("flex h-8 min-w-0 items-center gap-2 rounded-full border pr-3 pl-2.5 text-xs whitespace-nowrap text-text-muted @max-xl/composer:gap-1.5 @max-sm/composer:pr-2.5", t20);
|
|
@@ -1611,7 +1611,7 @@ function OptionRow(t0) {
|
|
|
1611
1611
|
value: value,
|
|
1612
1612
|
onValueChange: t4,
|
|
1613
1613
|
"aria-label": t5,
|
|
1614
|
-
className: "flex gap-0.5 rounded-md bg-surface-sunken p-0.5",
|
|
1614
|
+
className: "flex gap-0.5 rounded-md bg-surface-sunken p-0.5 dark:bg-surface-idle",
|
|
1615
1615
|
children: t6
|
|
1616
1616
|
});
|
|
1617
1617
|
$[45] = option.label;
|
|
@@ -67,7 +67,7 @@ export function ComposerControls(t0) {
|
|
|
67
67
|
name: true,
|
|
68
68
|
children: /*#__PURE__*/_jsx("button", {
|
|
69
69
|
type: "button",
|
|
70
|
-
className: "grid h-8 w-8 shrink-0 place-items-center rounded-full border border-border text-text-muted hover:bg-surface-hover hover:text-text disabled:opacity-50",
|
|
70
|
+
className: "grid h-8 w-8 shrink-0 place-items-center rounded-full border border-border text-text-muted hover:bg-surface-hover-edged hover:text-text disabled:opacity-50",
|
|
71
71
|
disabled: !writable,
|
|
72
72
|
onClick: () => fileInputRef.current?.click(),
|
|
73
73
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
@@ -129,7 +129,7 @@ function AttachmentLink(t0) {
|
|
|
129
129
|
target: "_blank",
|
|
130
130
|
rel: "noreferrer",
|
|
131
131
|
"aria-disabled": t5,
|
|
132
|
-
className: "flex h-28 w-36 flex-col rounded-xl border border-border bg-surface-raised bg-clip-padding p-2.5 text-left hover:bg-surface-hover",
|
|
132
|
+
className: "flex h-28 w-36 flex-col rounded-xl border border-border bg-surface-raised bg-clip-padding p-2.5 text-left hover:bg-surface-hover-edged",
|
|
133
133
|
children: [t7, t8, t10]
|
|
134
134
|
});
|
|
135
135
|
$[12] = attachment.name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@adecore/agent-contracts": "0.
|
|
71
|
-
"@adecore/editor": "0.
|
|
72
|
-
"@adecore/editor-react": "0.
|
|
73
|
-
"@adecore/intelligent-ui": "0.
|
|
74
|
-
"@adecore/merge": "0.
|
|
70
|
+
"@adecore/agent-contracts": "0.36.0",
|
|
71
|
+
"@adecore/editor": "0.36.0",
|
|
72
|
+
"@adecore/editor-react": "0.36.0",
|
|
73
|
+
"@adecore/intelligent-ui": "0.36.0",
|
|
74
|
+
"@adecore/merge": "0.36.0",
|
|
75
75
|
"@codemirror/commands": "^6.11.1",
|
|
76
76
|
"@codemirror/language": "^6.12.4",
|
|
77
77
|
"@codemirror/state": "^6.7.6",
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
"zustand": "^5.0.15"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@adecore/ui": "^0.
|
|
97
|
+
"@adecore/ui": "^0.36.0",
|
|
98
98
|
"i18next": "^26.4.2",
|
|
99
99
|
"react": "^19.3.0",
|
|
100
100
|
"react-dom": "^19.3.0",
|
|
101
101
|
"react-i18next": "^17.0.15"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@adecore/ui": "0.
|
|
104
|
+
"@adecore/ui": "0.36.0",
|
|
105
105
|
"@types/bun": "^1.4.2",
|
|
106
106
|
"@types/react": "^19.3.0",
|
|
107
107
|
"@types/react-dom": "^19.3.0",
|
package/src/chat/ui/Pickers.tsx
CHANGED
|
@@ -13,15 +13,12 @@ import { ModelMarks } from './ModelMarks';
|
|
|
13
13
|
import { pickerEntriesOf, type PickerEntry } from '../logic/picker-entries';
|
|
14
14
|
import { favoriteModelsOf, toggleFavoriteModel, useChatPreferences } from '../preferences';
|
|
15
15
|
import { forgetStashed, STASH_SHORTCUT, useStash, type StashedPrompt } from '../stash';
|
|
16
|
-
import { Icon, IconButton, Menu, Popover, Tooltip } from '@adecore/ui';
|
|
16
|
+
import { Button, Icon, IconButton, Menu, Popover, Tooltip } from '@adecore/ui';
|
|
17
17
|
import { useHostMachineLabel } from '../../host-hooks';
|
|
18
18
|
|
|
19
19
|
const triggerClass =
|
|
20
20
|
'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';
|
|
21
21
|
|
|
22
|
-
const chipClass =
|
|
23
|
-
'flex h-6 min-w-0 shrink items-center gap-1.5 whitespace-nowrap rounded-md bg-surface-hover px-2 text-xs text-text hover:bg-surface-active data-[popup-open]:bg-surface-active';
|
|
24
|
-
|
|
25
22
|
interface ModelPickerProps {
|
|
26
23
|
/* Whose models may be picked: every installed chat CLI before the first message, the chat's own after it. */
|
|
27
24
|
providers: ProviderInfo[];
|
|
@@ -35,7 +32,7 @@ interface ModelPickerProps {
|
|
|
35
32
|
kbd?: string | null;
|
|
36
33
|
/* Where the popup opens: over the composer by default, below the trigger in a form. */
|
|
37
34
|
side?: 'top' | 'bottom';
|
|
38
|
-
/* `chip` names the provider beside the model
|
|
35
|
+
/* `chip` names the provider beside the model on a secondary button, for a picker that sits in a card or a form. */
|
|
39
36
|
trigger?: 'plain' | 'chip';
|
|
40
37
|
/* Where the focus goes when the popup closes; by default back to the trigger. */
|
|
41
38
|
finalFocus?: RefObject<HTMLElement | null>;
|
|
@@ -149,7 +146,7 @@ export function ModelPicker({
|
|
|
149
146
|
<Popover.Root open={open} onOpenChange={setOpen}>
|
|
150
147
|
<Tooltip label={owner ? `${owner.name} · ${current}` : t('pickers.model.choose')} kbd={kbd ?? undefined}>
|
|
151
148
|
{trigger === 'chip' ? (
|
|
152
|
-
<Popover.Trigger className=
|
|
149
|
+
<Popover.Trigger render={<Button variant="secondary" size="sm" className="min-w-0 shrink gap-1.5" />}>
|
|
153
150
|
{chip.mark === 'logo' ? <ProviderLogo provider={provider as UsageProvider} size={12} /> : <AgentIcon kind={provider} size={12} />}
|
|
154
151
|
<span className="truncate">{chip.name}</span>
|
|
155
152
|
<span className="max-w-32 truncate text-text-muted">{chip.model}</span>
|
|
@@ -312,7 +312,7 @@ export function RunSettings({
|
|
|
312
312
|
disabled={disabled}
|
|
313
313
|
className={clsx(
|
|
314
314
|
'flex h-8 min-w-0 items-center gap-2 rounded-full border pr-3 pl-2.5 text-xs whitespace-nowrap text-text-muted @max-xl/composer:gap-1.5 @max-sm/composer:pr-2.5',
|
|
315
|
-
open ? 'border-accent bg-accent-soft' : 'border-border hover:bg-surface-hover'
|
|
315
|
+
open ? 'border-accent bg-accent-soft' : 'border-border hover:bg-surface-hover-edged'
|
|
316
316
|
)}
|
|
317
317
|
>
|
|
318
318
|
<AgentIcon kind={provider} size={14} className="shrink-0" />
|
|
@@ -665,7 +665,7 @@ function OptionRow({ option, selection, onChange }: { option: ModelOptionDescrip
|
|
|
665
665
|
value={value}
|
|
666
666
|
onValueChange={(next: string) => onChange(next)}
|
|
667
667
|
aria-label={option.label}
|
|
668
|
-
className="flex gap-0.5 rounded-md bg-surface-sunken p-0.5"
|
|
668
|
+
className="flex gap-0.5 rounded-md bg-surface-sunken p-0.5 dark:bg-surface-idle"
|
|
669
669
|
>
|
|
670
670
|
{option.choices.map((choice) => (
|
|
671
671
|
<Menu.RadioItem
|
|
@@ -76,7 +76,7 @@ export function ComposerControls({
|
|
|
76
76
|
<Tooltip label={t('composer.attach')} name>
|
|
77
77
|
<button
|
|
78
78
|
type="button"
|
|
79
|
-
className="grid h-8 w-8 shrink-0 place-items-center rounded-full border border-border text-text-muted hover:bg-surface-hover hover:text-text disabled:opacity-50"
|
|
79
|
+
className="grid h-8 w-8 shrink-0 place-items-center rounded-full border border-border text-text-muted hover:bg-surface-hover-edged hover:text-text disabled:opacity-50"
|
|
80
80
|
disabled={!writable}
|
|
81
81
|
onClick={() => fileInputRef.current?.click()}
|
|
82
82
|
>
|
|
@@ -65,7 +65,7 @@ function AttachmentLink({ chatId, attachment }: { chatId: string; attachment: Ch
|
|
|
65
65
|
target="_blank"
|
|
66
66
|
rel="noreferrer"
|
|
67
67
|
aria-disabled={url === null}
|
|
68
|
-
className="flex h-28 w-36 flex-col rounded-xl border border-border bg-surface-raised bg-clip-padding p-2.5 text-left hover:bg-surface-hover"
|
|
68
|
+
className="flex h-28 w-36 flex-col rounded-xl border border-border bg-surface-raised bg-clip-padding p-2.5 text-left hover:bg-surface-hover-edged"
|
|
69
69
|
>
|
|
70
70
|
<span className="flex h-6 min-w-6 items-center justify-center self-start rounded-md border border-border px-1.5 text-xs font-medium text-text-muted">
|
|
71
71
|
{badge ?? <Icon icon={File} size={12} />}
|