moi-computer 0.11.1-next.0 → 0.11.1-next.2
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/client/AGENTS.md +2 -2
- package/client/components/ui/button.tsx +1 -53
- package/client/components/ui/collapsible.tsx +1 -15
- package/client/components/ui/dialog.tsx +1 -58
- package/client/components/ui/dropdown-menu.tsx +1 -254
- package/client/components/ui/hover-card.tsx +1 -44
- package/client/components/ui/input.tsx +1 -21
- package/client/components/ui/popover.tsx +1 -88
- package/client/components/ui/resizable.tsx +1 -40
- package/client/components/ui/skeleton.tsx +1 -13
- package/client/components/ui/slider.tsx +1 -70
- package/client/components/ui/spinner.tsx +1 -18
- package/client/components/ui/switch.tsx +1 -23
- package/client/components/ui/tabs.tsx +1 -0
- package/client/components/ui/textarea.tsx +1 -18
- package/client/components/ui/tooltip.tsx +1 -51
- package/client/features/chat/ChatPanel.tsx +6 -6
- package/client/features/chat/ChatPopup.tsx +3 -4
- package/client/features/chat/TurnView.tsx +5 -4
- package/client/features/chat/api.ts +5 -14
- package/client/features/chat/chat-frames.ts +9 -7
- package/client/features/chat/chat-send.ts +13 -2
- package/client/features/chat/chat-store.ts +1 -3
- package/client/features/chat/composer/ChatComposer.tsx +5 -1
- package/client/features/chat/composer/ModelPicker.tsx +44 -44
- package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
- package/client/features/chat/composer/model-order.ts +15 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
- package/client/features/chat/group-turns.ts +12 -0
- package/client/features/chat/interleave-notices.ts +7 -11
- package/client/features/chat/session-view.ts +53 -0
- package/client/features/chat/tool-group/ToolCallGroup.tsx +1 -4
- package/client/features/chat/tool-group/format/codex.ts +4 -1
- package/client/features/chat/useChat.ts +10 -9
- package/client/features/dev/ChatStatesPage.tsx +3 -1
- package/client/features/dev/DevIndexPage.tsx +5 -0
- package/client/features/dev/DevRoutes.tsx +2 -0
- package/client/features/dev/HarnessDebugPage.tsx +1 -1
- package/client/features/dev/UiComponentPreviews.tsx +834 -0
- package/client/features/dev/UiComponentsPage.tsx +60 -0
- package/client/features/home/WorkspacePreview.tsx +1 -1
- package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
- package/client/features/settings/SettingsLayout.tsx +1 -1
- package/client/features/settings/WorkspaceSettings.tsx +4 -1
- package/client/features/views/ViewManager.tsx +14 -9
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +1 -3
- package/client/features/workspace/WorkspaceScreen.tsx +5 -1
- package/client/features/workspace/WorkspaceSplitLayout.tsx +6 -1
- package/client/features/workspace/api.ts +2 -4
- package/client/index.css +22 -29
- package/dist/chunk-245wt82v.css +1 -0
- package/dist/{chunk-tny85yt2.js → chunk-4s15axjs.js} +2 -2
- package/dist/{chunk-c9pjqx9m.js → chunk-53a7pxcz.js} +1 -1
- package/dist/{chunk-104m57qw.js → chunk-87thzbtw.js} +2 -2
- package/dist/chunk-a6jad1a6.js +1 -0
- package/dist/chunk-dghwstd2.js +9 -0
- package/dist/chunk-eg120aca.js +1 -0
- package/dist/{chunk-v7wr1df4.js → chunk-j3wvxjr7.js} +1 -1
- package/dist/chunk-j7hh2ab4.js +70 -0
- package/dist/chunk-w482ew2c.js +546 -0
- package/dist/chunk-y8eyahwx.js +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +55 -6
- package/lib/themes.ts +6 -6
- package/lib/types.ts +10 -9
- package/package.json +12 -5
- package/registry.json +643 -0
- package/server/agent.ts +1 -1
- package/server/api.ts +26 -30
- package/server/applets.ts +30 -29
- package/server/bundler/applet-css.ts +7 -107
- package/server/bundler/build-applet.ts +5 -1
- package/server/bundler/build-worker.ts +178 -0
- package/server/cli-ui-components.ts +28 -33
- package/server/cli.ts +6 -11
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +41 -48
- package/server/harness/acp/NOTES.md +426 -0
- package/server/harness/acp/discovery.ts +27 -30
- package/server/harness/acp/model-state.ts +57 -0
- package/server/harness/acp/session.ts +18 -6
- package/server/harness/claude-code/NOTES.md +47 -12
- package/server/harness/claude-code/cli.ts +40 -0
- package/server/harness/claude-code/index.ts +11 -5
- package/server/harness/claude-code/models.ts +72 -19
- package/server/harness/claude-code/session.ts +408 -299
- package/server/harness/codex/NOTES.md +222 -350
- package/server/harness/codex/adapter.ts +94 -45
- package/server/harness/codex/auth.ts +1 -3
- package/server/harness/codex/client.ts +169 -249
- package/server/harness/codex/discovery.ts +9 -17
- package/server/harness/codex/index.ts +2 -1
- package/server/harness/codex/pagination.ts +24 -0
- package/server/harness/codex/permissions.ts +31 -7
- package/server/harness/codex/probe.ts +10 -13
- package/server/harness/codex/session.ts +549 -136
- package/server/harness/codex/transport.ts +184 -0
- package/server/harness/debug.ts +1 -1
- package/server/harness/hermes/NOTES.md +18 -0
- package/server/harness/hermes/discovery.ts +20 -0
- package/server/harness/hermes/index.ts +9 -0
- package/server/harness/hermes/models.ts +28 -8
- package/server/harness/types.ts +4 -2
- package/server/moi-scaffold.ts +1 -1
- package/server/preview.ts +3 -1
- package/server/registry.ts +63 -41
- package/server/tldraw-package.d.ts +4 -0
- package/server/ui-components.ts +101 -434
- package/server/view-builders.ts +2 -1
- package/server/web.ts +12 -5
- package/server/workspace-env.ts +3 -2
- package/tsconfig.json +0 -1
- package/ui-components/accordion.tsx +71 -0
- package/ui-components/alert-dialog.tsx +165 -0
- package/ui-components/alert.tsx +68 -0
- package/ui-components/attachment.tsx +195 -0
- package/ui-components/avatar.tsx +90 -0
- package/ui-components/badge.tsx +49 -0
- package/ui-components/button-group.tsx +78 -0
- package/ui-components/button.tsx +55 -0
- package/ui-components/calendar.tsx +180 -0
- package/ui-components/card.tsx +84 -0
- package/ui-components/carousel.tsx +235 -0
- package/ui-components/chart.tsx +338 -0
- package/ui-components/checkbox.tsx +28 -0
- package/ui-components/collapsible.tsx +15 -0
- package/ui-components/combobox.tsx +267 -0
- package/ui-components/context-menu.tsx +244 -0
- package/ui-components/dialog.tsx +138 -0
- package/ui-components/docs/accordion.md +463 -0
- package/ui-components/docs/alert-dialog.md +481 -0
- package/ui-components/docs/alert.md +301 -0
- package/ui-components/docs/attachment.md +689 -0
- package/ui-components/docs/avatar.md +495 -0
- package/ui-components/docs/badge.md +258 -0
- package/ui-components/docs/button-group.md +879 -0
- package/ui-components/docs/button.md +26 -0
- package/ui-components/docs/calendar.md +862 -0
- package/ui-components/docs/card.md +265 -0
- package/ui-components/docs/carousel.md +627 -0
- package/ui-components/docs/chart.md +1256 -0
- package/ui-components/docs/checkbox.md +477 -0
- package/ui-components/docs/collapsible.md +446 -0
- package/ui-components/docs/combobox.md +1003 -0
- package/ui-components/docs/context-menu.md +860 -0
- package/ui-components/docs/data-table.md +1580 -0
- package/ui-components/docs/date-picker.md +614 -0
- package/ui-components/docs/dialog.md +414 -0
- package/ui-components/docs/drawer.md +51 -0
- package/ui-components/docs/dropdown-menu.md +1000 -0
- package/ui-components/docs/field.md +1192 -0
- package/ui-components/docs/hover-card.md +275 -0
- package/ui-components/docs/input-group.md +866 -0
- package/ui-components/docs/input.md +456 -0
- package/ui-components/docs/label.md +295 -0
- package/ui-components/docs/pagination.md +416 -0
- package/ui-components/docs/popover.md +348 -0
- package/ui-components/docs/progress.md +214 -0
- package/ui-components/docs/radio-group.md +389 -0
- package/ui-components/docs/resizable.md +265 -0
- package/ui-components/docs/select.md +616 -0
- package/ui-components/docs/separator.md +216 -0
- package/ui-components/docs/skeleton.md +205 -0
- package/ui-components/docs/slider.md +226 -0
- package/ui-components/docs/spinner.md +332 -0
- package/ui-components/docs/switch.md +236 -0
- package/ui-components/docs/table.md +551 -0
- package/ui-components/docs/tabs.md +379 -0
- package/ui-components/docs/textarea.md +187 -0
- package/ui-components/docs/toggle-group.md +370 -0
- package/ui-components/docs/toggle.md +91 -0
- package/ui-components/docs/tooltip.md +290 -0
- package/ui-components/drawer.tsx +213 -0
- package/ui-components/dropdown-menu.tsx +263 -0
- package/ui-components/field.tsx +224 -0
- package/ui-components/hover-card.tsx +46 -0
- package/ui-components/input-group.tsx +146 -0
- package/ui-components/input.tsx +20 -0
- package/ui-components/label.tsx +17 -0
- package/ui-components/pagination.tsx +124 -0
- package/ui-components/popover.tsx +81 -0
- package/ui-components/progress.tsx +63 -0
- package/ui-components/radio-group.tsx +38 -0
- package/ui-components/resizable.tsx +40 -0
- package/ui-components/scoped-portal.tsx +31 -0
- package/ui-components/select.tsx +195 -0
- package/ui-components/separator.tsx +18 -0
- package/ui-components/skeleton.tsx +15 -0
- package/ui-components/slider.tsx +75 -0
- package/ui-components/spinner.tsx +20 -0
- package/ui-components/switch.tsx +27 -0
- package/ui-components/table.tsx +86 -0
- package/ui-components/tabs.tsx +75 -0
- package/ui-components/textarea.tsx +17 -0
- package/ui-components/toggle-group.tsx +85 -0
- package/ui-components/toggle.tsx +42 -0
- package/ui-components/tooltip.tsx +61 -0
- package/ui-components/utils.ts +8 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +11 -20
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +4 -3
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
- package/dist/chunk-59zf0m6n.js +0 -1
- package/dist/chunk-bj3akjs2.js +0 -1
- package/dist/chunk-j2w2vak4.js +0 -546
- package/dist/chunk-k2r9c95m.js +0 -10
- package/dist/chunk-kmbxhgwv.js +0 -1
- package/dist/chunk-p1yqa71k.js +0 -83
- package/dist/chunk-r5xrenjy.css +0 -1
|
@@ -1,70 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Slider as SliderPrimitive } from '@base-ui/react/slider'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/client/lib/cn'
|
|
6
|
-
|
|
7
|
-
function Slider({
|
|
8
|
-
children,
|
|
9
|
-
className,
|
|
10
|
-
defaultValue,
|
|
11
|
-
value,
|
|
12
|
-
min = 0,
|
|
13
|
-
max = 100,
|
|
14
|
-
...props
|
|
15
|
-
}: SliderPrimitive.Root.Props) {
|
|
16
|
-
const [animationReady, setAnimationReady] = useState(false)
|
|
17
|
-
const _values = Array.isArray(value)
|
|
18
|
-
? value
|
|
19
|
-
: Array.isArray(defaultValue)
|
|
20
|
-
? defaultValue
|
|
21
|
-
: [min, max]
|
|
22
|
-
|
|
23
|
-
// Let Base UI measure the initial positions before transitions are enabled.
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const frame = requestAnimationFrame(() => setAnimationReady(true))
|
|
26
|
-
return () => cancelAnimationFrame(frame)
|
|
27
|
-
}, [])
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<SliderPrimitive.Root
|
|
31
|
-
className={cn('data-horizontal:w-full data-vertical:h-full', className)}
|
|
32
|
-
data-slot="slider"
|
|
33
|
-
defaultValue={defaultValue}
|
|
34
|
-
value={value}
|
|
35
|
-
min={min}
|
|
36
|
-
max={max}
|
|
37
|
-
thumbAlignment="edge"
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
40
|
-
<SliderPrimitive.Control className="relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col">
|
|
41
|
-
<SliderPrimitive.Track
|
|
42
|
-
data-slot="slider-track"
|
|
43
|
-
className="relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1"
|
|
44
|
-
>
|
|
45
|
-
<SliderPrimitive.Indicator
|
|
46
|
-
data-slot="slider-range"
|
|
47
|
-
className={cn(
|
|
48
|
-
'bg-primary select-none data-horizontal:h-full data-vertical:w-full',
|
|
49
|
-
animationReady && 'transition-[width] duration-150 ease-in-out'
|
|
50
|
-
)}
|
|
51
|
-
/>
|
|
52
|
-
</SliderPrimitive.Track>
|
|
53
|
-
{children}
|
|
54
|
-
{Array.from({ length: _values.length }, (_, index) => (
|
|
55
|
-
<SliderPrimitive.Thumb
|
|
56
|
-
data-slot="slider-thumb"
|
|
57
|
-
key={index}
|
|
58
|
-
className={cn(
|
|
59
|
-
'relative block size-3 shrink-0 cursor-ew-resize rounded-full border border-ring bg-white ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50',
|
|
60
|
-
animationReady &&
|
|
61
|
-
'transition-[inset-inline-start,color,box-shadow] duration-150 ease-in-out'
|
|
62
|
-
)}
|
|
63
|
-
/>
|
|
64
|
-
))}
|
|
65
|
-
</SliderPrimitive.Control>
|
|
66
|
-
</SliderPrimitive.Root>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { Slider }
|
|
1
|
+
export * from '@/ui-components/slider'
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/client/lib/cn'
|
|
4
|
-
|
|
5
|
-
function Spinner({ className, ...props }: React.ComponentProps<typeof IconLoader2>) {
|
|
6
|
-
return (
|
|
7
|
-
<IconLoader2
|
|
8
|
-
data-slot="spinner"
|
|
9
|
-
role="status"
|
|
10
|
-
aria-label="Loading"
|
|
11
|
-
className={cn('size-4 animate-spin', className)}
|
|
12
|
-
stroke={1.75}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Spinner }
|
|
1
|
+
export * from '@/ui-components/spinner'
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/client/lib/cn'
|
|
4
|
-
|
|
5
|
-
function Switch({ className, ...props }: SwitchPrimitive.Root.Props) {
|
|
6
|
-
return (
|
|
7
|
-
<SwitchPrimitive.Root
|
|
8
|
-
data-slot="switch"
|
|
9
|
-
className={cn(
|
|
10
|
-
'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input',
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
>
|
|
15
|
-
<SwitchPrimitive.Thumb
|
|
16
|
-
data-slot="switch-thumb"
|
|
17
|
-
className="pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0.5"
|
|
18
|
-
/>
|
|
19
|
-
</SwitchPrimitive.Root>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { Switch }
|
|
1
|
+
export * from '@/ui-components/switch'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@/ui-components/tabs'
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/client/lib/cn'
|
|
4
|
-
|
|
5
|
-
function Textarea({ className, ...props }: ComponentProps<'textarea'>) {
|
|
6
|
-
return (
|
|
7
|
-
<textarea
|
|
8
|
-
data-slot="textarea"
|
|
9
|
-
className={cn(
|
|
10
|
-
'flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Textarea }
|
|
1
|
+
export * from '@/ui-components/textarea'
|
|
@@ -1,51 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/client/lib/cn'
|
|
4
|
-
|
|
5
|
-
function TooltipProvider({ delay = 100, ...props }: TooltipPrimitive.Provider.Props) {
|
|
6
|
-
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delay={delay} {...props} />
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
|
|
10
|
-
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
|
|
14
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function TooltipContent({
|
|
18
|
-
className,
|
|
19
|
-
side = 'top',
|
|
20
|
-
sideOffset = 6,
|
|
21
|
-
align = 'center',
|
|
22
|
-
alignOffset = 0,
|
|
23
|
-
children,
|
|
24
|
-
...props
|
|
25
|
-
}: TooltipPrimitive.Popup.Props &
|
|
26
|
-
Pick<TooltipPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
27
|
-
return (
|
|
28
|
-
<TooltipPrimitive.Portal>
|
|
29
|
-
<TooltipPrimitive.Positioner
|
|
30
|
-
align={align}
|
|
31
|
-
alignOffset={alignOffset}
|
|
32
|
-
side={side}
|
|
33
|
-
sideOffset={sideOffset}
|
|
34
|
-
className="isolate z-50"
|
|
35
|
-
>
|
|
36
|
-
<TooltipPrimitive.Popup
|
|
37
|
-
data-slot="tooltip-content"
|
|
38
|
-
className={cn(
|
|
39
|
-
'z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
</TooltipPrimitive.Popup>
|
|
46
|
-
</TooltipPrimitive.Positioner>
|
|
47
|
-
</TooltipPrimitive.Portal>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider }
|
|
1
|
+
export * from '@/ui-components/tooltip'
|
|
@@ -5,7 +5,7 @@ import { IconChevronDown, IconChevronsRight, IconX } from '@tabler/icons-react'
|
|
|
5
5
|
import { canSubmitComposerAction, focusComposer } from '@/client/components/shared/Composer'
|
|
6
6
|
import { AgentBlobatar } from '@/client/components/shared/AgentBlobatar'
|
|
7
7
|
import { useStickToBottom } from '@/client/features/chat/useStickToBottom'
|
|
8
|
-
import { groupTurns } from '@/client/features/chat/group-turns'
|
|
8
|
+
import { appendPreviewTurn, groupTurns } from '@/client/features/chat/group-turns'
|
|
9
9
|
import { chatNoticeLabel, interleaveNotices } from '@/client/features/chat/interleave-notices'
|
|
10
10
|
import { attachmentKey, useLive } from '@/client/features/chat/chat-store'
|
|
11
11
|
import type { ChatPromptBubble } from '@/client/features/chat/ChatPromptBubbles'
|
|
@@ -45,7 +45,7 @@ type ChatPanelProps = {
|
|
|
45
45
|
hasWorkspaceApplets: boolean
|
|
46
46
|
view: ViewState
|
|
47
47
|
// The live streaming preview as a synthetic assistant turn (or null). Merged
|
|
48
|
-
// into the
|
|
48
|
+
// into the trailing assistant run so a thinking-only
|
|
49
49
|
// preview folds into the current tool group. See client/lib/preview-turn.ts.
|
|
50
50
|
previewTurn?: Turn | null
|
|
51
51
|
// Selected session id — used only as the scroll reset key (jump to bottom on
|
|
@@ -106,13 +106,13 @@ export function ChatPanel({
|
|
|
106
106
|
// synthetic turn so OpenAI Codex–style traces (which serialize one
|
|
107
107
|
// assistant message per agent step) don't render with the wider
|
|
108
108
|
// inter-turn gap between every tool call. See `dev/turn-spacing.md`.
|
|
109
|
-
//
|
|
110
|
-
// preview merges into the trailing tool group exactly like its finalized form.
|
|
109
|
+
// Group saved history once, then merge previews into just the trailing run.
|
|
111
110
|
const effectivePreviewTurn = builderDraft ? null : previewTurn
|
|
112
111
|
const notices = builderDraft ? EMPTY_NOTICES : view.notices
|
|
112
|
+
const savedGroups = useMemo(() => groupTurns(turns), [turns])
|
|
113
113
|
const groupedTurns = useMemo(
|
|
114
|
-
() =>
|
|
115
|
-
[
|
|
114
|
+
() => appendPreviewTurn(savedGroups, effectivePreviewTurn),
|
|
115
|
+
[savedGroups, effectivePreviewTurn]
|
|
116
116
|
)
|
|
117
117
|
// Grouped turns plus the renderable notices (compaction, model changes)
|
|
118
118
|
// woven in at the moment they happened. Interleaving runs AFTER grouping so
|
|
@@ -46,7 +46,7 @@ export function ChatPopup({
|
|
|
46
46
|
legible regardless of the active theme background. */}
|
|
47
47
|
<PopoverTrigger
|
|
48
48
|
render={
|
|
49
|
-
<div className="fixed right-
|
|
49
|
+
<div className="fixed right-3 bottom-3">
|
|
50
50
|
<motion.div
|
|
51
51
|
variants={{
|
|
52
52
|
from: { opacity: 0, scale: 0.8, filter: 'blur(4px)' },
|
|
@@ -59,7 +59,7 @@ export function ChatPopup({
|
|
|
59
59
|
>
|
|
60
60
|
<button
|
|
61
61
|
type="button"
|
|
62
|
-
className="group block cursor-pointer rounded-xl p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50"
|
|
62
|
+
className="group block cursor-pointer rounded-xl p-0 drop-shadow-[0_0_4px_var(--primary-foreground)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50"
|
|
63
63
|
aria-label="Agent"
|
|
64
64
|
>
|
|
65
65
|
<AgentBlobatar
|
|
@@ -80,9 +80,8 @@ export function ChatPopup({
|
|
|
80
80
|
}
|
|
81
81
|
/>
|
|
82
82
|
<PopoverContent
|
|
83
|
-
positionMethod="fixed"
|
|
84
83
|
side="top"
|
|
85
|
-
sideOffset={-
|
|
84
|
+
sideOffset={({ anchor }) => -anchor.height}
|
|
86
85
|
align="end"
|
|
87
86
|
className="flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1"
|
|
88
87
|
keepMounted
|
|
@@ -156,9 +156,8 @@ export function AssistantTurnParts({
|
|
|
156
156
|
|
|
157
157
|
type TurnViewProps = { turn: Turn; processing?: boolean }
|
|
158
158
|
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
// or `processing` actually changed.
|
|
159
|
+
// ChatPanel preserves completed groups during streaming, so token updates only
|
|
160
|
+
// render the active row. A changed transcript still refreshes the saved groups.
|
|
162
161
|
export const TurnView = memo(function TurnView({ turn, processing = false }: TurnViewProps) {
|
|
163
162
|
const cwd = useWorkspaceLayoutCtx().cwd
|
|
164
163
|
|
|
@@ -262,7 +261,9 @@ type DataPartProps = { name: string; data: unknown }
|
|
|
262
261
|
function DataPart({ name, data }: DataPartProps) {
|
|
263
262
|
return (
|
|
264
263
|
<details>
|
|
265
|
-
<summary className="cursor-pointer text-xs text-muted-foreground">
|
|
264
|
+
<summary className="cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden">
|
|
265
|
+
data:{name}
|
|
266
|
+
</summary>
|
|
266
267
|
<pre className="mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground">
|
|
267
268
|
{JSON.stringify(data, null, 2)}
|
|
268
269
|
</pre>
|
|
@@ -3,8 +3,8 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
|
3
3
|
import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
|
|
4
4
|
import { WORKSPACE_RESOURCE_OPTIONS } from '@/client/api/query-options'
|
|
5
5
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
6
|
-
import {
|
|
7
|
-
import type { SessionConfig, SessionInfo
|
|
6
|
+
import { sessionViewOptions } from '@/client/features/chat/session-view'
|
|
7
|
+
import type { SessionConfig, SessionInfo } from '@/lib/types'
|
|
8
8
|
|
|
9
9
|
export function useWorkspaceSessions(workspaceId: string) {
|
|
10
10
|
return useQuery<SessionInfo[]>({
|
|
@@ -42,18 +42,9 @@ export function useArchiveWorkspaceSession(workspaceId: string) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export function useSessionView(workspaceId: string, sessionId: string | null) {
|
|
45
|
-
return useQuery
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const response = await fetch(`/api/workspaces/${workspaceId}/sessions/${sessionId}/events`)
|
|
49
|
-
const events: StreamEvent[] = response.ok ? await response.json() : []
|
|
50
|
-
return applyEvents(events)
|
|
51
|
-
},
|
|
52
|
-
enabled: Boolean(sessionId),
|
|
53
|
-
staleTime: Infinity,
|
|
54
|
-
gcTime: 5 * 60_000,
|
|
55
|
-
refetchOnMount: false,
|
|
56
|
-
refetchOnWindowFocus: false
|
|
45
|
+
return useQuery({
|
|
46
|
+
...sessionViewOptions(workspaceId, sessionId ?? ''),
|
|
47
|
+
enabled: Boolean(sessionId)
|
|
57
48
|
})
|
|
58
49
|
}
|
|
59
50
|
|
|
@@ -3,6 +3,7 @@ import type { QueryClient } from '@tanstack/react-query'
|
|
|
3
3
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
4
4
|
import { getScratchExecutor } from '@/client/features/scratchpad/scratch-executor'
|
|
5
5
|
import { liveStore } from '@/client/features/chat/chat-store'
|
|
6
|
+
import { bufferSessionEvent } from '@/client/features/chat/session-view'
|
|
6
7
|
import { renameSelectedSessionInCache } from '@/client/features/chat/useSelectedSession'
|
|
7
8
|
import { applyEvent } from '@/lib/format'
|
|
8
9
|
import type {
|
|
@@ -143,11 +144,10 @@ export function reduceChatFrame(data: Record<string, unknown>, context: ChatFram
|
|
|
143
144
|
}
|
|
144
145
|
if (kind === 'error' && typeof data.content === 'string') {
|
|
145
146
|
store.setError(workspaceId, sessionId, data.content)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
store.clearPreviewsForSession(workspaceId, sessionId)
|
|
147
|
+
if (data.terminal !== false) {
|
|
148
|
+
store.setActivity(workspaceId, sessionId, 'idle')
|
|
149
|
+
store.clearPreviewsForSession(workspaceId, sessionId)
|
|
150
|
+
}
|
|
151
151
|
}
|
|
152
152
|
if (kind === 'stopped') {
|
|
153
153
|
store.setActivity(workspaceId, sessionId, 'idle')
|
|
@@ -161,8 +161,10 @@ function patchView(
|
|
|
161
161
|
sessionId: string,
|
|
162
162
|
event: StreamEvent
|
|
163
163
|
) {
|
|
164
|
+
if (!queryClient) return
|
|
165
|
+
bufferSessionEvent(queryClient, workspaceId, sessionId, event)
|
|
164
166
|
const queryKey = workspaceKeys.events(workspaceId, sessionId)
|
|
165
|
-
const existing = queryClient
|
|
167
|
+
const existing = queryClient.getQueryData<ViewState>(queryKey)
|
|
166
168
|
if (existing === undefined) return
|
|
167
|
-
queryClient
|
|
169
|
+
queryClient.setQueryData<ViewState>(queryKey, applyEvent(existing, event))
|
|
168
170
|
}
|
|
@@ -2,6 +2,7 @@ import type { QueryClient } from '@tanstack/react-query'
|
|
|
2
2
|
|
|
3
3
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
4
4
|
import { attachmentKey, type ChatAttachment, liveStore } from '@/client/features/chat/chat-store'
|
|
5
|
+
import { resolveSelectedModel } from '@/client/features/chat/composer/model-order'
|
|
5
6
|
import type { MoiUserMessageOptions } from '@/client/features/workspace/moi-context'
|
|
6
7
|
import { STREAM_RESPONSES } from '@/client/lib/flags'
|
|
7
8
|
import { formatChatTitle } from '@/lib/chat-title'
|
|
@@ -148,11 +149,21 @@ export function resolveChatRunOptions(
|
|
|
148
149
|
pickedFastMode?: boolean
|
|
149
150
|
): { model?: string; effort?: string; fastMode?: boolean; stream?: true } {
|
|
150
151
|
const models = modelsData?.models
|
|
151
|
-
const
|
|
152
|
+
const savedModel =
|
|
152
153
|
!pickedModel || !models || models.some(candidate => candidate.value === pickedModel)
|
|
153
154
|
? pickedModel
|
|
154
155
|
: undefined
|
|
155
|
-
const modelInfo =
|
|
156
|
+
const modelInfo =
|
|
157
|
+
modelsData?.provider === 'codex'
|
|
158
|
+
? resolveSelectedModel(modelsData.models, pickedModel)
|
|
159
|
+
: models?.find(candidate => candidate.value === (savedModel ?? 'default'))
|
|
160
|
+
// Omitting Codex's model inherits config.toml (or the resumed thread's
|
|
161
|
+
// model), which can be unavailable even though the picker shows a supported
|
|
162
|
+
// fallback. Always send the concrete model the Codex picker displays.
|
|
163
|
+
const model =
|
|
164
|
+
modelsData?.provider === 'codex' && modelInfo
|
|
165
|
+
? (modelInfo.resolvedModel ?? modelInfo.value)
|
|
166
|
+
: savedModel
|
|
156
167
|
const effort =
|
|
157
168
|
pickedEffort && (!modelInfo || (modelInfo.supportedEffortLevels ?? []).includes(pickedEffort))
|
|
158
169
|
? pickedEffort
|
|
@@ -112,9 +112,7 @@ export type LivePreview = {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export type LiveStore = {
|
|
115
|
-
// Per-session activity mirrored from server `status` frames.
|
|
116
|
-
// shows the loader/Stop; `requires-action` is tracked but not rendered yet.
|
|
117
|
-
// Missing key = idle.
|
|
115
|
+
// Per-session activity mirrored from server `status` frames. Missing key = idle.
|
|
118
116
|
activity: Record<string, SessionActivity>
|
|
119
117
|
errors: Record<string, string | null>
|
|
120
118
|
// Live token-streaming previews, keyed by `messageId` (the API `msg_...` id)
|
|
@@ -364,7 +364,11 @@ function DrawingAttachmentChip({ attachment, onRemove }: DrawingAttachmentChipPr
|
|
|
364
364
|
<span>{label}</span>
|
|
365
365
|
</HoverCardTrigger>
|
|
366
366
|
{previewUrl && (
|
|
367
|
-
<HoverCardContent
|
|
367
|
+
<HoverCardContent
|
|
368
|
+
side="top"
|
|
369
|
+
align="start"
|
|
370
|
+
className="w-60 max-w-[calc(100vw-2rem)] rounded-xl"
|
|
371
|
+
>
|
|
368
372
|
<img
|
|
369
373
|
src={previewUrl}
|
|
370
374
|
alt={`${label} preview`}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
resolveDisplayedEffort,
|
|
13
13
|
resolveEffortIndex,
|
|
14
14
|
resolveFastMode,
|
|
15
|
+
resolveSelectedModel,
|
|
15
16
|
sortModelsByProviderOrder
|
|
16
17
|
} from './model-order'
|
|
17
18
|
import { Button } from '@/client/components/ui/button'
|
|
@@ -125,6 +126,38 @@ function ModelDropdown({ current, model, models, onValueChange }: ModelDropdownP
|
|
|
125
126
|
)
|
|
126
127
|
}
|
|
127
128
|
|
|
129
|
+
type FastModeToggleProps = { fastMode: boolean; onChange: (value: boolean) => void }
|
|
130
|
+
|
|
131
|
+
function FastModeToggle({ fastMode, onChange }: FastModeToggleProps) {
|
|
132
|
+
return (
|
|
133
|
+
<Tooltip>
|
|
134
|
+
<TooltipTrigger
|
|
135
|
+
render={
|
|
136
|
+
<Button
|
|
137
|
+
type="button"
|
|
138
|
+
variant="ghost"
|
|
139
|
+
size="icon-sm"
|
|
140
|
+
aria-label={fastMode ? 'Turn off fast mode' : 'Turn on fast mode'}
|
|
141
|
+
aria-pressed={fastMode}
|
|
142
|
+
onClick={() => onChange(!fastMode)}
|
|
143
|
+
className="-my-1 -mr-1"
|
|
144
|
+
>
|
|
145
|
+
{fastMode ? (
|
|
146
|
+
<IconBoltFilled className="text-primary" stroke={1.75} />
|
|
147
|
+
) : (
|
|
148
|
+
<IconBolt className="text-muted-foreground" stroke={1.75} />
|
|
149
|
+
)}
|
|
150
|
+
</Button>
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
<TooltipContent align="center" className="flex-col gap-0">
|
|
154
|
+
<span>Fast mode</span>
|
|
155
|
+
<span className="font-normal text-muted-foreground">More usage</span>
|
|
156
|
+
</TooltipContent>
|
|
157
|
+
</Tooltip>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
128
161
|
type EffortPickerProps = {
|
|
129
162
|
currentEffort: string
|
|
130
163
|
effortLevels: readonly string[]
|
|
@@ -172,7 +205,7 @@ function EffortPicker({
|
|
|
172
205
|
/>
|
|
173
206
|
}
|
|
174
207
|
/>
|
|
175
|
-
<PopoverContent align="end" side="top" className="w-64"
|
|
208
|
+
<PopoverContent align="end" side="top" className="w-64">
|
|
176
209
|
<PopoverHeader className="relative h-5 flex-row items-center">
|
|
177
210
|
<AnimatePresence mode="popLayout" initial={false}>
|
|
178
211
|
{dragging ? (
|
|
@@ -203,33 +236,7 @@ function EffortPicker({
|
|
|
203
236
|
<span className="text-muted-foreground">Effort</span>
|
|
204
237
|
<output aria-live="polite">{displayedLabel}</output>
|
|
205
238
|
</div>
|
|
206
|
-
{showFastMode &&
|
|
207
|
-
<Tooltip>
|
|
208
|
-
<TooltipTrigger
|
|
209
|
-
render={
|
|
210
|
-
<Button
|
|
211
|
-
type="button"
|
|
212
|
-
variant="ghost"
|
|
213
|
-
size="icon-sm"
|
|
214
|
-
aria-label={fastMode ? 'Turn off Fast mode' : 'Turn on Fast mode'}
|
|
215
|
-
aria-pressed={fastMode}
|
|
216
|
-
onClick={() => onFastModeChange(!fastMode)}
|
|
217
|
-
className="-my-1 -mr-1"
|
|
218
|
-
>
|
|
219
|
-
{fastMode ? (
|
|
220
|
-
<IconBoltFilled className="text-primary" />
|
|
221
|
-
) : (
|
|
222
|
-
<IconBolt className="text-muted-foreground" stroke={1.5} />
|
|
223
|
-
)}
|
|
224
|
-
</Button>
|
|
225
|
-
}
|
|
226
|
-
/>
|
|
227
|
-
<TooltipContent align="center" className="flex-col gap-0">
|
|
228
|
-
<span>Fast mode</span>
|
|
229
|
-
<span className="font-normal text-muted-foreground">More usage</span>
|
|
230
|
-
</TooltipContent>
|
|
231
|
-
</Tooltip>
|
|
232
|
-
)}
|
|
239
|
+
{showFastMode && <FastModeToggle fastMode={fastMode} onChange={onFastModeChange} />}
|
|
233
240
|
</motion.div>
|
|
234
241
|
)}
|
|
235
242
|
</AnimatePresence>
|
|
@@ -237,7 +244,7 @@ function EffortPicker({
|
|
|
237
244
|
<label className="block">
|
|
238
245
|
<span className="sr-only">Reasoning effort</span>
|
|
239
246
|
<Slider
|
|
240
|
-
value={draftIndex}
|
|
247
|
+
value={[draftIndex]}
|
|
241
248
|
min={0}
|
|
242
249
|
max={effortLevels.length - 1}
|
|
243
250
|
step={1}
|
|
@@ -252,8 +259,9 @@ function EffortPicker({
|
|
|
252
259
|
}}
|
|
253
260
|
className={cn(
|
|
254
261
|
'**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm',
|
|
255
|
-
'**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:
|
|
262
|
+
'**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:ring-0'
|
|
256
263
|
)}
|
|
264
|
+
animate
|
|
257
265
|
>
|
|
258
266
|
<span
|
|
259
267
|
data-slot="slider-marks"
|
|
@@ -323,19 +331,8 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
323
331
|
else setLayout({ selectedFastMode: value })
|
|
324
332
|
}
|
|
325
333
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
// Show a persisted pick when it still exists. Otherwise name the concrete
|
|
329
|
-
// model behind the SDK default, or fall back to the first available model.
|
|
330
|
-
const persistedModel = models.some(model => model.value === selectedModel)
|
|
331
|
-
? selectedModel
|
|
332
|
-
: undefined
|
|
333
|
-
const defaultModel =
|
|
334
|
-
models.find(
|
|
335
|
-
model => defaultEntry?.resolvedModel && model.resolvedModel === defaultEntry.resolvedModel
|
|
336
|
-
) ?? models[0]
|
|
337
|
-
const currentModelValue = persistedModel ?? defaultModel.value
|
|
338
|
-
const model = models.find(item => item.value === currentModelValue) ?? models[0]
|
|
334
|
+
const model = resolveSelectedModel(models, selectedModel, defaultEntry?.resolvedModel)
|
|
335
|
+
if (!model) return null
|
|
339
336
|
const effortLevels = model.supportsEffort ? (model.supportedEffortLevels ?? []) : []
|
|
340
337
|
const currentEffort = resolveDisplayedEffort(effortLevels, selectedEffort, model.defaultEffort)
|
|
341
338
|
const showEffort = hasEffortChoice(effortLevels) && currentEffort !== undefined
|
|
@@ -344,11 +341,14 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
344
341
|
return (
|
|
345
342
|
<div className="flex min-w-0 items-center gap-1">
|
|
346
343
|
<ModelDropdown
|
|
347
|
-
current={
|
|
344
|
+
current={model.value}
|
|
348
345
|
model={model}
|
|
349
346
|
models={models}
|
|
350
347
|
onValueChange={setSelectedModel}
|
|
351
348
|
/>
|
|
349
|
+
{!showEffort && model.supportsFastMode && (
|
|
350
|
+
<FastModeToggle fastMode={fastMode} onChange={setSelectedFastMode} />
|
|
351
|
+
)}
|
|
352
352
|
{showEffort && (
|
|
353
353
|
<EffortPicker
|
|
354
354
|
key={model.value}
|
|
@@ -6,23 +6,31 @@ import { ComposerBannerShell } from './ComposerBanner'
|
|
|
6
6
|
|
|
7
7
|
type ErrorBannerProps = {
|
|
8
8
|
error: string
|
|
9
|
-
onDismiss
|
|
9
|
+
onDismiss?: () => void
|
|
10
|
+
onRetry?: () => void
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export function ErrorBanner({ error, onDismiss }: ErrorBannerProps) {
|
|
13
|
+
export function ErrorBanner({ error, onDismiss, onRetry }: ErrorBannerProps) {
|
|
13
14
|
return (
|
|
14
15
|
<ComposerBannerShell role="alert" className="flex items-center gap-2 text-destructive">
|
|
15
16
|
<span className="flex-1 wrap-break-word">{error}</span>
|
|
16
|
-
|
|
17
|
-
type="button"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
{onRetry && (
|
|
18
|
+
<Button type="button" variant="ghost" size="sm" onClick={onRetry}>
|
|
19
|
+
Retry
|
|
20
|
+
</Button>
|
|
21
|
+
)}
|
|
22
|
+
{onDismiss && (
|
|
23
|
+
<Button
|
|
24
|
+
type="button"
|
|
25
|
+
variant="ghost"
|
|
26
|
+
size="icon-sm"
|
|
27
|
+
onClick={onDismiss}
|
|
28
|
+
className="text-destructive hover:text-destructive"
|
|
29
|
+
aria-label="Dismiss error"
|
|
30
|
+
>
|
|
31
|
+
<IconX stroke={1.75} />
|
|
32
|
+
</Button>
|
|
33
|
+
)}
|
|
26
34
|
</ComposerBannerShell>
|
|
27
35
|
)
|
|
28
36
|
}
|
|
@@ -6,6 +6,21 @@ const ANTHROPIC_MODEL_FAMILY_ORDER = ['fable', 'opus', 'sonnet', 'haiku'] as con
|
|
|
6
6
|
|
|
7
7
|
type ModelComparator = (a: Model, b: Model) => number
|
|
8
8
|
|
|
9
|
+
// Resolve the same concrete row for the picker and the outgoing chat request.
|
|
10
|
+
// Unavailable selections fall back to the resolved default, then the first row.
|
|
11
|
+
export function resolveSelectedModel(
|
|
12
|
+
models: readonly Model[],
|
|
13
|
+
selectedModel: string | undefined,
|
|
14
|
+
defaultModel = models.find(model => model.value === 'default')?.resolvedModel
|
|
15
|
+
): Model | undefined {
|
|
16
|
+
const choices = models.filter(model => model.value !== 'default')
|
|
17
|
+
return (
|
|
18
|
+
choices.find(model => model.value === selectedModel) ??
|
|
19
|
+
choices.find(model => (model.resolvedModel ?? model.value) === defaultModel) ??
|
|
20
|
+
choices[0]
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
9
24
|
function anthropicModelFamilyRank(model: Model): number | undefined {
|
|
10
25
|
const key = model.resolvedModel ?? model.value
|
|
11
26
|
const rank = ANTHROPIC_MODEL_FAMILY_ORDER.findIndex(
|