@lemonriver/core 1.3.0 → 1.4.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/{build-CSkdswfd.js → build-Cv0nNc4G.js} +1 -1
- package/dist/cli/bin.js +5 -5
- package/dist/{config-C5-myPY6.js → config-Di9kipre.js} +2773 -714
- package/dist/{config-CYNOR93W.d.ts → config-f1SqAhtR.d.ts} +1 -1
- package/dist/{dev-DHtYH8sw.js → dev-Az1UzCQp.js} +11 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -2
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/{mcp-B2UeO1un.js → mcp-CW7H6oUg.js} +1 -1
- package/dist/{preview-C1B6-umF.js → preview-DtSq5uN1.js} +1 -1
- package/dist/{types-tdaXSyah.d.ts → types-C4VfD89E.d.ts} +12 -0
- package/dist/{update-DzL8fpcI.js → update-DVe2kQA7.js} +86 -13
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-BhYyMx0-.js → zh-tw-BX3oQAc2.js} +110 -0
- package/package.json +5 -6
- package/release-notes.json +20 -0
- package/src/agent/types.ts +9 -2
- package/src/app/app.tsx +2 -0
- package/src/app/components/agent/agent-panel.tsx +12 -3
- package/src/app/components/agent/agent-presence.tsx +1 -1
- package/src/app/components/command/home-command-menu.tsx +4 -1
- package/src/app/components/command/slide-command-menu.tsx +4 -1
- package/src/app/components/export-progress-toast.tsx +3 -1
- package/src/app/components/inspector/asset-picker-dialog.tsx +1 -1
- package/src/app/components/inspector/comment-layer.tsx +3 -3
- package/src/app/components/inspector/inline-text-editor.tsx +1 -12
- package/src/app/components/inspector/inspect-overlay.tsx +9 -1
- package/src/app/components/inspector/inspector-panel.tsx +7 -23
- package/src/app/components/inspector/inspector-provider.tsx +177 -36
- package/src/app/components/inspector/page-panel.tsx +270 -0
- package/src/app/components/language-toggle.tsx +13 -11
- package/src/app/components/overview-grid.tsx +3 -3
- package/src/app/components/panel/editor-sidebar.tsx +43 -8
- package/src/app/components/panel/panel-shell.tsx +9 -5
- package/src/app/components/panel/save-card.tsx +1 -1
- package/src/app/components/sidebar/folder-item.tsx +4 -1
- package/src/app/components/sidebar/sidebar.tsx +11 -8
- package/src/app/components/slide-canvas.tsx +1 -1
- package/src/app/components/style-panel/design-provider.tsx +48 -11
- package/src/app/components/style-panel/use-design.ts +6 -1
- package/src/app/components/theme-toggle.tsx +16 -22
- package/src/app/components/thumbnail-rail.tsx +69 -50
- package/src/app/components/ui/context-menu.tsx +9 -10
- package/src/app/components/ui/dialog.tsx +2 -4
- package/src/app/components/ui/dropdown-menu.tsx +9 -10
- package/src/app/components/ui/popover.tsx +1 -1
- package/src/app/components/ui/select.tsx +2 -2
- package/src/app/components/ui/sonner.tsx +2 -2
- package/src/app/index.html +7 -0
- package/src/app/lemonriver/agent-cli/model.ts +22 -0
- package/src/app/lemonriver/agent-install/model.ts +46 -0
- package/src/app/lemonriver/agent-install/section.tsx +178 -0
- package/src/app/lemonriver/agent-install/use-install.ts +51 -0
- package/src/app/lemonriver/agent-providers/section.tsx +385 -44
- package/src/app/lemonriver/agent-providers/use-providers.ts +50 -3
- package/src/app/lemonriver/backup/places.ts +22 -12
- package/src/app/lemonriver/chrome/sidebar-extras.tsx +1 -1
- package/src/app/lemonriver/feedback/dialog.tsx +1 -2
- package/src/app/lemonriver/feedback/model.ts +0 -5
- package/src/app/lemonriver/guide/clipboard.ts +19 -0
- package/src/app/lemonriver/guide/create-board.tsx +150 -0
- package/src/app/lemonriver/guide/install-board.tsx +208 -0
- package/src/app/lemonriver/guide/more-agents-page.tsx +89 -0
- package/src/app/lemonriver/guide/more-agents.ts +137 -0
- package/src/app/lemonriver/guide/quick-board.tsx +57 -0
- package/src/app/lemonriver/guide/start-board.tsx +38 -0
- package/src/app/lemonriver/guide/start-card.tsx +105 -0
- package/src/app/lemonriver/guide/start.ts +174 -0
- package/src/app/lemonriver/guide/state.ts +5 -21
- package/src/app/lemonriver/help/help-page.tsx +24 -6
- package/src/app/lemonriver/help/model.ts +1 -0
- package/src/app/lemonriver/home/home-page.tsx +12 -6
- package/src/app/lemonriver/home/sorting.ts +45 -0
- package/src/app/lemonriver/home/use-deck-times.ts +1 -2
- package/src/app/lemonriver/i18n/system-locale.ts +39 -0
- package/src/app/lemonriver/routes.tsx +2 -0
- package/src/app/lemonriver/settings/backup-section.tsx +3 -2
- package/src/app/lemonriver/settings/settings-page.tsx +5 -6
- package/src/app/lemonriver/settings/workspace-card.tsx +2 -1
- package/src/app/lemonriver/share/share-dialog.tsx +2 -1
- package/src/app/lemonriver/text/en.ts +592 -453
- package/src/app/lemonriver/text/es.ts +402 -271
- package/src/app/lemonriver/text/ja.ts +403 -274
- package/src/app/lemonriver/text/platform.ts +7 -0
- package/src/app/lemonriver/text/types.ts +118 -1
- package/src/app/lemonriver/text/zh-cn.ts +643 -508
- package/src/app/lemonriver/text/zh-tw.ts +679 -545
- package/src/app/lemonriver/theme/app.css +9 -0
- package/src/app/lemonriver/theme/controls.css +5 -2
- package/src/app/lemonriver/theme/index.css +9 -0
- package/src/app/lemonriver/theme/pages.ts +2 -0
- package/src/app/lemonriver/theme/theme-menu.tsx +10 -11
- package/src/app/lemonriver/update/restart-wait.ts +45 -0
- package/src/app/lemonriver/update/update-prompt.tsx +9 -0
- package/src/app/lib/agent/use-agent.ts +117 -30
- package/src/app/lib/desktop-host.ts +31 -0
- package/src/app/lib/desktop-routes.ts +22 -0
- package/src/app/lib/desktop.ts +106 -0
- package/src/app/lib/export-pdf.ts +15 -7
- package/src/app/lib/inspector/color.ts +51 -0
- package/src/app/lib/inspector/fiber.ts +6 -0
- package/src/app/lib/inspector/use-editor.ts +2 -1
- package/src/app/lib/inspector/use-notes.ts +331 -57
- package/src/app/lib/inspector/use-visual-editor.ts +9 -1
- package/src/app/lib/locale-store.ts +6 -1
- package/src/app/lib/transition.ts +43 -0
- package/src/app/lib/unsaved.ts +155 -0
- package/src/app/routes/home.tsx +1 -1
- package/src/app/routes/slide.tsx +116 -73
- package/src/app/styles.css +39 -1
- package/src/locale/en.ts +19 -0
- package/src/locale/es.ts +19 -0
- package/src/locale/ja.ts +19 -0
- package/src/locale/types.ts +12 -0
- package/src/locale/zh-cn.ts +19 -0
- package/src/locale/zh-tw.ts +19 -0
- package/src/app/lemonriver/guide/guide-prompt.tsx +0 -89
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { CheckIcon, ChevronRightIcon
|
|
4
|
+
import { CheckIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
5
|
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
|
|
6
6
|
|
|
7
7
|
import { cn } from '@/lib/utils';
|
|
@@ -47,7 +47,7 @@ function ContextMenuSubTrigger({
|
|
|
47
47
|
data-slot="context-menu-sub-trigger"
|
|
48
48
|
data-inset={inset}
|
|
49
49
|
className={cn(
|
|
50
|
-
'flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none focus:bg-foreground focus:
|
|
50
|
+
'flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[inset]:pl-8 data-popup-open:bg-foreground/[0.07] dark:data-popup-open:bg-foreground/10',
|
|
51
51
|
className,
|
|
52
52
|
)}
|
|
53
53
|
{...props}
|
|
@@ -74,7 +74,7 @@ function ContextMenuSubContent({
|
|
|
74
74
|
<ContextMenuPrimitive.Popup
|
|
75
75
|
data-slot="context-menu-sub-content"
|
|
76
76
|
className={cn(
|
|
77
|
-
'z-50 min-w-[9rem] overflow-hidden rounded-[8px] border border-border bg-
|
|
77
|
+
'z-50 min-w-[9rem] overflow-hidden rounded-[8px] border border-border bg-material backdrop-blur-xl backdrop-saturate-150 p-1 text-popover-foreground shadow-floating outline-none',
|
|
78
78
|
'transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
79
79
|
className,
|
|
80
80
|
)}
|
|
@@ -96,7 +96,7 @@ function ContextMenuContent({
|
|
|
96
96
|
data-slot="context-menu-content"
|
|
97
97
|
className={cn(
|
|
98
98
|
'z-50 max-h-(--available-height) min-w-[9rem] origin-(--transform-origin)',
|
|
99
|
-
'overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-
|
|
99
|
+
'overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-material backdrop-blur-xl backdrop-saturate-150 p-1 text-popover-foreground shadow-floating outline-none',
|
|
100
100
|
'transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
101
101
|
className,
|
|
102
102
|
)}
|
|
@@ -123,10 +123,9 @@ function ContextMenuItem({
|
|
|
123
123
|
data-variant={variant}
|
|
124
124
|
className={cn(
|
|
125
125
|
'relative flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none transition-colors',
|
|
126
|
-
'focus:bg-foreground focus:
|
|
127
|
-
'data-[active=true]:bg-muted data-[active=true]:text-foreground',
|
|
126
|
+
'focus:bg-foreground/[0.07] dark:focus:bg-foreground/10',
|
|
128
127
|
'data-[disabled]:pointer-events-none data-[disabled]:opacity-45 data-[inset]:pl-8',
|
|
129
|
-
'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive
|
|
128
|
+
'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10',
|
|
130
129
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='text-'])]:text-current [&_svg]:opacity-80",
|
|
131
130
|
className,
|
|
132
131
|
)}
|
|
@@ -145,7 +144,7 @@ function ContextMenuCheckboxItem({
|
|
|
145
144
|
<ContextMenuPrimitive.CheckboxItem
|
|
146
145
|
data-slot="context-menu-checkbox-item"
|
|
147
146
|
className={cn(
|
|
148
|
-
|
|
147
|
+
"relative flex cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-2 pl-8 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
149
148
|
className,
|
|
150
149
|
)}
|
|
151
150
|
checked={checked}
|
|
@@ -170,14 +169,14 @@ function ContextMenuRadioItem({
|
|
|
170
169
|
<ContextMenuPrimitive.RadioItem
|
|
171
170
|
data-slot="context-menu-radio-item"
|
|
172
171
|
className={cn(
|
|
173
|
-
|
|
172
|
+
"relative flex cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-2 pl-8 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
174
173
|
className,
|
|
175
174
|
)}
|
|
176
175
|
{...props}
|
|
177
176
|
>
|
|
178
177
|
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
179
178
|
<ContextMenuPrimitive.RadioItemIndicator>
|
|
180
|
-
<
|
|
179
|
+
<CheckIcon className="size-3.5" />
|
|
181
180
|
</ContextMenuPrimitive.RadioItemIndicator>
|
|
182
181
|
</span>
|
|
183
182
|
{children}
|
|
@@ -28,7 +28,7 @@ function DialogOverlay({
|
|
|
28
28
|
<DialogPrimitive.Backdrop
|
|
29
29
|
data-slot="dialog-overlay"
|
|
30
30
|
className={cn(
|
|
31
|
-
'fixed inset-0 z-50 bg-
|
|
31
|
+
'fixed inset-0 z-50 bg-black/20 backdrop-blur-[3px] dark:bg-black/45 transition-opacity data-starting-style:opacity-0 data-ending-style:opacity-0',
|
|
32
32
|
className,
|
|
33
33
|
)}
|
|
34
34
|
{...props}
|
|
@@ -52,10 +52,8 @@ function DialogContent({
|
|
|
52
52
|
<DialogPrimitive.Popup
|
|
53
53
|
data-slot="dialog-content"
|
|
54
54
|
className={cn(
|
|
55
|
-
// Crisp paper card with hairline edge + soft drop. No oversized
|
|
56
|
-
// shadcn-glow ring; sits cleanly on the dimmed canvas.
|
|
57
55
|
'fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-5',
|
|
58
|
-
'rounded-[10px] border border-border bg-
|
|
56
|
+
'rounded-[10px] border border-border bg-material p-6 text-card-foreground backdrop-blur-2xl backdrop-saturate-150',
|
|
59
57
|
'shadow-overlay outline-none',
|
|
60
58
|
'transition-[transform,scale,opacity] duration-200',
|
|
61
59
|
'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { CheckIcon, ChevronRightIcon
|
|
4
|
+
import { CheckIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
5
|
import { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu';
|
|
6
6
|
|
|
7
7
|
import { cn } from '@/lib/utils';
|
|
@@ -48,7 +48,7 @@ function DropdownMenuContent({
|
|
|
48
48
|
data-slot="dropdown-menu-content"
|
|
49
49
|
className={cn(
|
|
50
50
|
'z-50 max-h-(--available-height) min-w-[9rem] origin-(--transform-origin)',
|
|
51
|
-
'overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-
|
|
51
|
+
'overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-material backdrop-blur-xl backdrop-saturate-150 p-1 text-popover-foreground shadow-floating outline-none',
|
|
52
52
|
'transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
@@ -79,10 +79,9 @@ function DropdownMenuItem({
|
|
|
79
79
|
data-variant={variant}
|
|
80
80
|
className={cn(
|
|
81
81
|
'relative flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none transition-colors',
|
|
82
|
-
'focus:bg-foreground focus:
|
|
83
|
-
'data-[active=true]:bg-muted data-[active=true]:text-foreground',
|
|
82
|
+
'focus:bg-foreground/[0.07] dark:focus:bg-foreground/10',
|
|
84
83
|
'data-[disabled]:pointer-events-none data-[disabled]:opacity-45 data-[inset]:pl-8',
|
|
85
|
-
'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive
|
|
84
|
+
'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10',
|
|
86
85
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='text-'])]:text-current [&_svg]:opacity-80",
|
|
87
86
|
className,
|
|
88
87
|
)}
|
|
@@ -101,7 +100,7 @@ function DropdownMenuCheckboxItem({
|
|
|
101
100
|
<DropdownMenuPrimitive.CheckboxItem
|
|
102
101
|
data-slot="dropdown-menu-checkbox-item"
|
|
103
102
|
className={cn(
|
|
104
|
-
|
|
103
|
+
"relative flex cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-2 pl-8 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
105
104
|
className,
|
|
106
105
|
)}
|
|
107
106
|
checked={checked}
|
|
@@ -132,14 +131,14 @@ function DropdownMenuRadioItem({
|
|
|
132
131
|
<DropdownMenuPrimitive.RadioItem
|
|
133
132
|
data-slot="dropdown-menu-radio-item"
|
|
134
133
|
className={cn(
|
|
135
|
-
|
|
134
|
+
"relative flex cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-2 pl-8 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
|
136
135
|
className,
|
|
137
136
|
)}
|
|
138
137
|
{...props}
|
|
139
138
|
>
|
|
140
139
|
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
141
140
|
<DropdownMenuPrimitive.RadioItemIndicator>
|
|
142
|
-
<
|
|
141
|
+
<CheckIcon className="size-3.5" />
|
|
143
142
|
</DropdownMenuPrimitive.RadioItemIndicator>
|
|
144
143
|
</span>
|
|
145
144
|
{children}
|
|
@@ -210,7 +209,7 @@ function DropdownMenuSubTrigger({
|
|
|
210
209
|
data-slot="dropdown-menu-sub-trigger"
|
|
211
210
|
data-inset={inset}
|
|
212
211
|
className={cn(
|
|
213
|
-
'flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none focus:bg-foreground focus:
|
|
212
|
+
'flex cursor-default items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12.5px] outline-hidden select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10 data-[inset]:pl-8 data-popup-open:bg-foreground/[0.07] dark:data-popup-open:bg-foreground/10',
|
|
214
213
|
className,
|
|
215
214
|
)}
|
|
216
215
|
{...props}
|
|
@@ -237,7 +236,7 @@ function DropdownMenuSubContent({
|
|
|
237
236
|
<DropdownMenuPrimitive.Popup
|
|
238
237
|
data-slot="dropdown-menu-sub-content"
|
|
239
238
|
className={cn(
|
|
240
|
-
'z-50 min-w-[9rem] overflow-hidden rounded-[8px] border border-border bg-
|
|
239
|
+
'z-50 min-w-[9rem] overflow-hidden rounded-[8px] border border-border bg-material backdrop-blur-xl backdrop-saturate-150 p-1 text-popover-foreground shadow-floating outline-none',
|
|
241
240
|
'transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
242
241
|
className,
|
|
243
242
|
)}
|
|
@@ -37,7 +37,7 @@ function PopoverContent({
|
|
|
37
37
|
<PopoverPrimitive.Popup
|
|
38
38
|
data-slot="popover-content"
|
|
39
39
|
className={cn(
|
|
40
|
-
'w-72 origin-(--transform-origin) rounded-[8px] border border-border bg-
|
|
40
|
+
'w-72 origin-(--transform-origin) rounded-[8px] border border-border bg-material p-3 backdrop-blur-xl backdrop-saturate-150 text-popover-foreground shadow-floating outline-hidden',
|
|
41
41
|
'transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',
|
|
42
42
|
className,
|
|
43
43
|
)}
|
|
@@ -78,7 +78,7 @@ function SelectContent({
|
|
|
78
78
|
<SelectPrimitive.Popup
|
|
79
79
|
data-slot="select-content"
|
|
80
80
|
className={cn(
|
|
81
|
-
"relative isolate z-50 max-h-(--available-height) min-w-[9rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-
|
|
81
|
+
"relative isolate z-50 max-h-(--available-height) min-w-[9rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[8px] border border-border bg-material backdrop-blur-xl backdrop-saturate-150 text-popover-foreground shadow-floating transition-[transform,scale,opacity] data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0",
|
|
82
82
|
className
|
|
83
83
|
)}
|
|
84
84
|
{...props}
|
|
@@ -114,7 +114,7 @@ function SelectItem({
|
|
|
114
114
|
<SelectPrimitive.Item
|
|
115
115
|
data-slot="select-item"
|
|
116
116
|
className={cn(
|
|
117
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-8 pl-2 text-[12.5px] outline-hidden select-none data-highlighted:bg-foreground data-highlighted:
|
|
117
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-[5px] py-1.5 pr-8 pl-2 text-[12.5px] outline-hidden select-none data-highlighted:bg-foreground/[0.07] dark:data-highlighted:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 [&_svg:not([class*='text-'])]:text-current *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
118
118
|
className
|
|
119
119
|
)}
|
|
120
120
|
{...props}
|
|
@@ -24,7 +24,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
24
24
|
}}
|
|
25
25
|
style={
|
|
26
26
|
{
|
|
27
|
-
"--normal-bg": "var(--
|
|
27
|
+
"--normal-bg": "var(--material)",
|
|
28
28
|
"--normal-text": "var(--popover-foreground)",
|
|
29
29
|
"--normal-border": "var(--border)",
|
|
30
30
|
"--border-radius": "8px",
|
|
@@ -35,7 +35,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
35
35
|
toastOptions={{
|
|
36
36
|
classNames: {
|
|
37
37
|
toast:
|
|
38
|
-
"!font-sans !text-[12.5px] !shadow-floating !border-border !rounded-[8px]",
|
|
38
|
+
"!font-sans !text-[12.5px] !shadow-floating !border-border !rounded-[8px] backdrop-blur-xl backdrop-saturate-150",
|
|
39
39
|
title: "!font-medium !text-[12.5px] !tracking-tight",
|
|
40
40
|
description: "!text-[12px] !text-muted-foreground",
|
|
41
41
|
},
|
package/src/app/index.html
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
html.dark {
|
|
14
14
|
background-color: oklch(0.145 0 0);
|
|
15
15
|
}
|
|
16
|
+
html[data-translucent] {
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
}
|
|
16
19
|
</style>
|
|
17
20
|
<script>
|
|
18
21
|
// Apply the stored theme before first paint; next-themes only runs
|
|
@@ -26,6 +29,10 @@
|
|
|
26
29
|
(stored !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches);
|
|
27
30
|
document.documentElement.classList.toggle('dark', dark);
|
|
28
31
|
document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
|
|
32
|
+
if (window.openSlideDesktop) {
|
|
33
|
+
document.documentElement.dataset.shell = 'desktop';
|
|
34
|
+
if (window.openSlideDesktop.translucent) document.documentElement.dataset.translucent = '';
|
|
35
|
+
}
|
|
29
36
|
</script>
|
|
30
37
|
</head>
|
|
31
38
|
<body>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type AgentCliId =
|
|
2
|
+
| 'claude'
|
|
3
|
+
| 'codex'
|
|
4
|
+
| 'gemini'
|
|
5
|
+
| 'qwen'
|
|
6
|
+
| 'kimi'
|
|
7
|
+
| 'opencode'
|
|
8
|
+
| 'cursor-agent';
|
|
9
|
+
|
|
10
|
+
export type CliState = 'found' | 'login' | 'missing';
|
|
11
|
+
|
|
12
|
+
export type CliStatus = {
|
|
13
|
+
id: AgentCliId;
|
|
14
|
+
state: CliState;
|
|
15
|
+
path: string | null;
|
|
16
|
+
source: string | null;
|
|
17
|
+
version: string | null;
|
|
18
|
+
searched: string[];
|
|
19
|
+
manualPath: string | null;
|
|
20
|
+
loginCommand: string;
|
|
21
|
+
installUrl: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Locale } from '../../../locale/types';
|
|
2
|
+
|
|
3
|
+
export type AgentAppId = 'claude' | 'codex' | 'workbuddy' | 'dumate' | 'dsh';
|
|
4
|
+
|
|
5
|
+
export const AGENT_APP_IDS: AgentAppId[] = ['claude', 'codex', 'workbuddy', 'dumate', 'dsh'];
|
|
6
|
+
|
|
7
|
+
export type AppState = 'no-app' | 'available' | 'installed' | 'outdated' | 'broken';
|
|
8
|
+
|
|
9
|
+
export type AppStatus = {
|
|
10
|
+
id: AgentAppId;
|
|
11
|
+
state: AppState;
|
|
12
|
+
installedVersion: string | null;
|
|
13
|
+
target: string;
|
|
14
|
+
detail: string | null;
|
|
15
|
+
check: 'pass' | 'fail' | 'unknown';
|
|
16
|
+
checkError: string | null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type InstallCatalog = { version: string; apps: AppStatus[] };
|
|
20
|
+
|
|
21
|
+
export type InstallAction = 'install' | 'uninstall' | 'check';
|
|
22
|
+
|
|
23
|
+
export const AGENT_APP_NAMES: Record<AgentAppId, string> = {
|
|
24
|
+
claude: 'Claude',
|
|
25
|
+
codex: 'ChatGPT(Codex)',
|
|
26
|
+
workbuddy: 'WorkBuddy',
|
|
27
|
+
dumate: 'DuMate',
|
|
28
|
+
dsh: 'DeepSeek Harness',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Chinese UIs keep the full-width parentheses; every other locale reads the
|
|
32
|
+
// half-width form.
|
|
33
|
+
export function agentAppName(id: AgentAppId, localeId: Locale['id']): string {
|
|
34
|
+
const name = AGENT_APP_NAMES[id];
|
|
35
|
+
if (localeId === 'zh-CN' || localeId === 'zh-TW') return name;
|
|
36
|
+
return name.replaceAll('(', ' (').replaceAll(')', ')');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Where each app is downloaded from, shown while none of them is installed.
|
|
40
|
+
export const AGENT_APP_DOWNLOADS: Record<AgentAppId, string> = {
|
|
41
|
+
claude: 'https://claude.ai/download',
|
|
42
|
+
codex: 'https://chatgpt.com/download',
|
|
43
|
+
workbuddy: 'https://www.workbuddy.cn',
|
|
44
|
+
dumate: 'https://dumate.baidu.com',
|
|
45
|
+
dsh: 'https://www.deepseek.com/harness',
|
|
46
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { toast } from 'sonner';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from '@/components/ui/dialog';
|
|
12
|
+
import { format, useLocale } from '@/lib/use-locale';
|
|
13
|
+
import { useLrText } from '../text';
|
|
14
|
+
import { type AgentAppId, type AppStatus, agentAppName } from './model';
|
|
15
|
+
import { useAgentInstall } from './use-install';
|
|
16
|
+
|
|
17
|
+
type Pending = { row: AppStatus; action: 'install' | 'uninstall' };
|
|
18
|
+
|
|
19
|
+
export function AgentInstallSection() {
|
|
20
|
+
const lr = useLrText().agentInstall;
|
|
21
|
+
const localeId = useLocale().id;
|
|
22
|
+
const { catalog, working, act } = useAgentInstall();
|
|
23
|
+
const [pending, setPending] = useState<Pending | null>(null);
|
|
24
|
+
if (!catalog) return null;
|
|
25
|
+
|
|
26
|
+
const appName = (id: AgentAppId): string => agentAppName(id, localeId);
|
|
27
|
+
|
|
28
|
+
const stateText = (row: AppStatus): string => {
|
|
29
|
+
if (row.state === 'no-app') return lr.state.noApp;
|
|
30
|
+
if (row.state === 'available') return lr.state.available;
|
|
31
|
+
if (row.state === 'outdated') return lr.state.outdated;
|
|
32
|
+
if (row.state === 'broken') return lr.state.broken;
|
|
33
|
+
return lr.state.installed;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const run = async (row: AppStatus, action: 'install' | 'uninstall') => {
|
|
37
|
+
setPending(null);
|
|
38
|
+
const result = await act(row.id, action);
|
|
39
|
+
if (result.ok) return;
|
|
40
|
+
const name = appName(row.id);
|
|
41
|
+
toast.error(
|
|
42
|
+
action === 'install'
|
|
43
|
+
? format(lr.installFailed, { name, error: result.error })
|
|
44
|
+
: format(lr.uninstallFailed, { name, error: result.error }),
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const installed = (row: AppStatus): boolean =>
|
|
49
|
+
row.state === 'installed' || row.state === 'outdated' || row.state === 'broken';
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<section
|
|
53
|
+
data-lr-agent-install
|
|
54
|
+
className="mt-5 rounded-[16px] border border-border bg-card px-6 py-5 shadow-[var(--lr-shadow-1)]"
|
|
55
|
+
>
|
|
56
|
+
<h2 className="text-[16px] font-semibold">{lr.title}</h2>
|
|
57
|
+
<p className="mt-1 mb-2 text-[14px] text-muted-foreground">{lr.hint}</p>
|
|
58
|
+
|
|
59
|
+
<ul className="divide-y divide-border border-t border-border">
|
|
60
|
+
{catalog.apps.map((row) => (
|
|
61
|
+
<li
|
|
62
|
+
key={row.id}
|
|
63
|
+
data-lr-agent-install-row={row.id}
|
|
64
|
+
className="flex items-center gap-3 py-3"
|
|
65
|
+
>
|
|
66
|
+
<div className="min-w-0 flex-1">
|
|
67
|
+
<p className="text-[14px] font-semibold">{appName(row.id)}</p>
|
|
68
|
+
<p data-lr-agent-install-state={row.id} className="text-[12px] text-muted-foreground">
|
|
69
|
+
{stateText(row)}
|
|
70
|
+
{row.installedVersion
|
|
71
|
+
? ` · ${format(lr.version, { version: row.installedVersion })}`
|
|
72
|
+
: ''}
|
|
73
|
+
</p>
|
|
74
|
+
{row.state === 'broken' && row.checkError && (
|
|
75
|
+
<p data-lr-agent-install-check={row.id} className="text-[12px] text-destructive">
|
|
76
|
+
{format(lr.checkFailedDetail, { error: row.checkError })}
|
|
77
|
+
</p>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
81
|
+
{row.state === 'available' && (
|
|
82
|
+
<Button
|
|
83
|
+
type="button"
|
|
84
|
+
size="sm"
|
|
85
|
+
data-lr-agent-install-button={`${row.id}:install`}
|
|
86
|
+
disabled={working === row.id}
|
|
87
|
+
onClick={() => setPending({ row, action: 'install' })}
|
|
88
|
+
>
|
|
89
|
+
{working === row.id ? lr.working : lr.install}
|
|
90
|
+
</Button>
|
|
91
|
+
)}
|
|
92
|
+
{row.state === 'outdated' && (
|
|
93
|
+
<Button
|
|
94
|
+
type="button"
|
|
95
|
+
size="sm"
|
|
96
|
+
data-lr-agent-install-button={`${row.id}:install`}
|
|
97
|
+
disabled={working === row.id}
|
|
98
|
+
onClick={() => setPending({ row, action: 'install' })}
|
|
99
|
+
>
|
|
100
|
+
{working === row.id ? lr.working : lr.update}
|
|
101
|
+
</Button>
|
|
102
|
+
)}
|
|
103
|
+
{installed(row) && (
|
|
104
|
+
<Button
|
|
105
|
+
type="button"
|
|
106
|
+
size="sm"
|
|
107
|
+
variant="outline"
|
|
108
|
+
data-lr-agent-install-button={`${row.id}:check`}
|
|
109
|
+
disabled={working === row.id}
|
|
110
|
+
onClick={() => void act(row.id, 'check')}
|
|
111
|
+
>
|
|
112
|
+
{lr.check}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
{installed(row) && (
|
|
116
|
+
<Button
|
|
117
|
+
type="button"
|
|
118
|
+
size="sm"
|
|
119
|
+
variant="ghost"
|
|
120
|
+
data-lr-agent-install-button={`${row.id}:uninstall`}
|
|
121
|
+
disabled={working === row.id}
|
|
122
|
+
onClick={() => setPending({ row, action: 'uninstall' })}
|
|
123
|
+
>
|
|
124
|
+
{lr.uninstall}
|
|
125
|
+
</Button>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
</li>
|
|
129
|
+
))}
|
|
130
|
+
</ul>
|
|
131
|
+
|
|
132
|
+
<Dialog open={pending !== null} onOpenChange={(open) => !open && setPending(null)}>
|
|
133
|
+
<DialogContent data-lr-agent-install-confirm>
|
|
134
|
+
{pending && (
|
|
135
|
+
<>
|
|
136
|
+
<DialogHeader>
|
|
137
|
+
<DialogTitle>
|
|
138
|
+
{pending.action === 'install'
|
|
139
|
+
? format(lr.confirmTitle, { name: appName(pending.row.id) })
|
|
140
|
+
: format(lr.confirmUninstallTitle, { name: appName(pending.row.id) })}
|
|
141
|
+
</DialogTitle>
|
|
142
|
+
<DialogDescription>
|
|
143
|
+
{pending.action === 'install' ? lr.confirmBackup : lr.confirmUninstallBody}
|
|
144
|
+
</DialogDescription>
|
|
145
|
+
</DialogHeader>
|
|
146
|
+
{pending.action === 'install' && pending.row.target && (
|
|
147
|
+
<p
|
|
148
|
+
data-lr-agent-install-target
|
|
149
|
+
className="break-all rounded-[10px] bg-muted px-3 py-2 text-[12px] text-muted-foreground"
|
|
150
|
+
>
|
|
151
|
+
{format(lr.confirmTarget, { path: pending.row.target })}
|
|
152
|
+
</p>
|
|
153
|
+
)}
|
|
154
|
+
<DialogFooter>
|
|
155
|
+
<Button
|
|
156
|
+
type="button"
|
|
157
|
+
variant="ghost"
|
|
158
|
+
data-lr-agent-install-cancel
|
|
159
|
+
onClick={() => setPending(null)}
|
|
160
|
+
>
|
|
161
|
+
{lr.cancel}
|
|
162
|
+
</Button>
|
|
163
|
+
<Button
|
|
164
|
+
type="button"
|
|
165
|
+
data-lr-agent-install-go
|
|
166
|
+
disabled={working === pending.row.id}
|
|
167
|
+
onClick={() => void run(pending.row, pending.action)}
|
|
168
|
+
>
|
|
169
|
+
{pending.action === 'install' ? lr.confirmInstall : lr.uninstall}
|
|
170
|
+
</Button>
|
|
171
|
+
</DialogFooter>
|
|
172
|
+
</>
|
|
173
|
+
)}
|
|
174
|
+
</DialogContent>
|
|
175
|
+
</Dialog>
|
|
176
|
+
</section>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import type { AgentAppId, AppStatus, InstallAction, InstallCatalog } from './model';
|
|
3
|
+
|
|
4
|
+
export function useAgentInstall() {
|
|
5
|
+
const [catalog, setCatalog] = useState<InstallCatalog | null>(null);
|
|
6
|
+
const [working, setWorking] = useState<AgentAppId | null>(null);
|
|
7
|
+
|
|
8
|
+
const load = useCallback(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const res = await fetch('/__lr/agent-plugins');
|
|
11
|
+
if (!res.ok) return;
|
|
12
|
+
setCatalog((await res.json()) as InstallCatalog);
|
|
13
|
+
} catch {}
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
void load();
|
|
18
|
+
}, [load]);
|
|
19
|
+
|
|
20
|
+
const act = useCallback(
|
|
21
|
+
async (
|
|
22
|
+
id: AgentAppId,
|
|
23
|
+
action: InstallAction,
|
|
24
|
+
): Promise<{ ok: true } | { ok: false; error: string }> => {
|
|
25
|
+
setWorking(id);
|
|
26
|
+
try {
|
|
27
|
+
const res = await fetch('/__lr/agent-plugins', {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: { 'content-type': 'application/json' },
|
|
30
|
+
body: JSON.stringify({ app: id, action }),
|
|
31
|
+
});
|
|
32
|
+
const data = (await res.json().catch(() => ({}))) as { error?: string; app?: AppStatus };
|
|
33
|
+
if (!res.ok || !data.app) return { ok: false, error: data.error ?? `HTTP ${res.status}` };
|
|
34
|
+
const updated = data.app;
|
|
35
|
+
setCatalog((current) =>
|
|
36
|
+
current
|
|
37
|
+
? { ...current, apps: current.apps.map((row) => (row.id === id ? updated : row)) }
|
|
38
|
+
: current,
|
|
39
|
+
);
|
|
40
|
+
return { ok: true };
|
|
41
|
+
} catch (err) {
|
|
42
|
+
return { ok: false, error: err instanceof Error ? err.message : 'failed' };
|
|
43
|
+
} finally {
|
|
44
|
+
setWorking(null);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
[],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return { catalog, working, act, reload: load };
|
|
51
|
+
}
|