@lemonriver/core 1.2.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 +34 -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/player.tsx +6 -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/present/dual-screen.ts +154 -0
- package/src/app/lemonriver/present/presenter-blocked-hint.tsx +28 -0
- package/src/app/lemonriver/present/wake-lock.ts +74 -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 +594 -452
- package/src/app/lemonriver/text/es.ts +404 -270
- package/src/app/lemonriver/text/ja.ts +405 -273
- package/src/app/lemonriver/text/platform.ts +7 -0
- package/src/app/lemonriver/text/types.ts +122 -1
- package/src/app/lemonriver/text/zh-cn.ts +645 -507
- package/src/app/lemonriver/text/zh-tw.ts +681 -544
- 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/presenter.tsx +2 -0
- package/src/app/routes/slide.tsx +130 -74
- 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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { Button } from '@/components/ui/button';
|
|
4
|
+
import { useCreateDeck } from '@/lib/agent/use-agent';
|
|
5
|
+
import { format } from '@/lib/use-locale';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
import { useAgentProviders } from '../agent-providers/use-providers';
|
|
8
|
+
import { useLrText } from '../text';
|
|
9
|
+
import { hasReadyCli, orderCliAgents } from './start';
|
|
10
|
+
import { StartBoard } from './start-board';
|
|
11
|
+
|
|
12
|
+
export function CreateBoard() {
|
|
13
|
+
const lr = useLrText();
|
|
14
|
+
const t = lr.start.create;
|
|
15
|
+
const agents = lr.agents;
|
|
16
|
+
const { catalog } = useAgentProviders();
|
|
17
|
+
const createDeck = useCreateDeck();
|
|
18
|
+
const [creating, setCreating] = useState(false);
|
|
19
|
+
|
|
20
|
+
const rows = orderCliAgents(catalog?.agents ?? []);
|
|
21
|
+
const ready = hasReadyCli(rows);
|
|
22
|
+
// The in-app panel is mounted by the editor in development builds only; the
|
|
23
|
+
// desktop app runs that server, a static build does not.
|
|
24
|
+
const panelAvailable = import.meta.env.DEV;
|
|
25
|
+
|
|
26
|
+
const start = async () => {
|
|
27
|
+
if (!panelAvailable || !ready || creating) return;
|
|
28
|
+
setCreating(true);
|
|
29
|
+
try {
|
|
30
|
+
await createDeck();
|
|
31
|
+
} finally {
|
|
32
|
+
setCreating(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<StartBoard board="create" mascot="outline" title={t.title} forWhom={t.forWhom}>
|
|
38
|
+
<ul className="divide-y divide-border border-t border-border">
|
|
39
|
+
{rows.map((row) => {
|
|
40
|
+
const cli = row.cli;
|
|
41
|
+
const state = cli?.state ?? 'missing';
|
|
42
|
+
const missing = state === 'missing';
|
|
43
|
+
const usable = row.connectable !== false;
|
|
44
|
+
const body = (
|
|
45
|
+
<>
|
|
46
|
+
<div className="flex items-baseline justify-between gap-2">
|
|
47
|
+
<p
|
|
48
|
+
data-lr-start-agent-name={row.id}
|
|
49
|
+
className={cn('text-[13px] font-medium', missing && 'text-muted-foreground')}
|
|
50
|
+
>
|
|
51
|
+
{row.name}
|
|
52
|
+
</p>
|
|
53
|
+
<span className="shrink-0 text-[11.5px] text-muted-foreground">
|
|
54
|
+
{missing
|
|
55
|
+
? t.missing
|
|
56
|
+
: state === 'login'
|
|
57
|
+
? t.login
|
|
58
|
+
: usable
|
|
59
|
+
? t.ready
|
|
60
|
+
: t.installed}
|
|
61
|
+
</span>
|
|
62
|
+
</div>
|
|
63
|
+
{state === 'login' && cli && (
|
|
64
|
+
<p className="mt-0.5 text-[11.5px] leading-snug text-muted-foreground">
|
|
65
|
+
{format(agents.needsLoginHint, { command: cli.loginCommand })}
|
|
66
|
+
</p>
|
|
67
|
+
)}
|
|
68
|
+
{!missing && cli?.version && (
|
|
69
|
+
<p
|
|
70
|
+
data-lr-start-agent-version={row.id}
|
|
71
|
+
className="mt-0.5 text-[11.5px] leading-snug text-muted-foreground"
|
|
72
|
+
>
|
|
73
|
+
{format(agents.versionLine, { version: cli.version })}
|
|
74
|
+
</p>
|
|
75
|
+
)}
|
|
76
|
+
{!missing && !usable && (
|
|
77
|
+
<p className="mt-0.5 text-[11.5px] leading-snug text-muted-foreground">
|
|
78
|
+
{t.unsupported}
|
|
79
|
+
</p>
|
|
80
|
+
)}
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
return (
|
|
84
|
+
<li
|
|
85
|
+
key={row.id}
|
|
86
|
+
data-lr-start-agent={row.id}
|
|
87
|
+
data-state={state}
|
|
88
|
+
data-connectable={usable ? undefined : ''}
|
|
89
|
+
className="py-2"
|
|
90
|
+
>
|
|
91
|
+
{missing && cli ? (
|
|
92
|
+
<a
|
|
93
|
+
data-lr-start-install-link={row.id}
|
|
94
|
+
href={cli.installUrl}
|
|
95
|
+
target="_blank"
|
|
96
|
+
rel="noreferrer"
|
|
97
|
+
title={t.installLink}
|
|
98
|
+
className="block rounded-[6px] text-muted-foreground outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
99
|
+
>
|
|
100
|
+
{body}
|
|
101
|
+
</a>
|
|
102
|
+
) : (
|
|
103
|
+
body
|
|
104
|
+
)}
|
|
105
|
+
</li>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</ul>
|
|
109
|
+
|
|
110
|
+
<div className="mt-auto pt-2">
|
|
111
|
+
<Button
|
|
112
|
+
type="button"
|
|
113
|
+
size="sm"
|
|
114
|
+
data-lr-start-create
|
|
115
|
+
disabled={!panelAvailable || !ready || creating}
|
|
116
|
+
onClick={() => void start()}
|
|
117
|
+
>
|
|
118
|
+
{t.start}
|
|
119
|
+
</Button>
|
|
120
|
+
{!panelAvailable ? (
|
|
121
|
+
<p
|
|
122
|
+
data-lr-start-unavailable
|
|
123
|
+
className="mt-1.5 text-[11.5px] leading-snug text-muted-foreground"
|
|
124
|
+
>
|
|
125
|
+
{t.unavailable}
|
|
126
|
+
</p>
|
|
127
|
+
) : (
|
|
128
|
+
catalog !== null &&
|
|
129
|
+
!ready && (
|
|
130
|
+
<p
|
|
131
|
+
data-lr-start-none-ready
|
|
132
|
+
className="mt-1.5 text-[11.5px] leading-snug text-muted-foreground"
|
|
133
|
+
>
|
|
134
|
+
{t.noneReady}
|
|
135
|
+
</p>
|
|
136
|
+
)
|
|
137
|
+
)}
|
|
138
|
+
<div>
|
|
139
|
+
<Link
|
|
140
|
+
to="/settings"
|
|
141
|
+
data-lr-start-more
|
|
142
|
+
className="mt-1.5 inline-block text-[11.5px] text-muted-foreground underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
143
|
+
>
|
|
144
|
+
{t.more}
|
|
145
|
+
</Link>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</StartBoard>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Check } from 'lucide-react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
import { toast } from 'sonner';
|
|
5
|
+
import { Button } from '@/components/ui/button';
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogFooter,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from '@/components/ui/dialog';
|
|
14
|
+
import { format, useLocale } from '@/lib/use-locale';
|
|
15
|
+
import {
|
|
16
|
+
AGENT_APP_DOWNLOADS,
|
|
17
|
+
type AgentAppId,
|
|
18
|
+
type AppStatus,
|
|
19
|
+
agentAppName,
|
|
20
|
+
type InstallAction,
|
|
21
|
+
} from '../agent-install/model';
|
|
22
|
+
import { useLrText } from '../text';
|
|
23
|
+
import { copyText } from './clipboard';
|
|
24
|
+
import { orderInstallApps } from './start';
|
|
25
|
+
import { StartBoard } from './start-board';
|
|
26
|
+
|
|
27
|
+
export function InstallBoard({
|
|
28
|
+
apps,
|
|
29
|
+
working,
|
|
30
|
+
act,
|
|
31
|
+
}: {
|
|
32
|
+
apps: readonly AppStatus[];
|
|
33
|
+
working: AgentAppId | null;
|
|
34
|
+
act: (
|
|
35
|
+
id: AgentAppId,
|
|
36
|
+
action: InstallAction,
|
|
37
|
+
) => Promise<{ ok: true } | { ok: false; error: string }>;
|
|
38
|
+
}) {
|
|
39
|
+
const lr = useLrText();
|
|
40
|
+
const t = lr.start.install;
|
|
41
|
+
const names = lr.agentInstall;
|
|
42
|
+
const localeId = useLocale().id;
|
|
43
|
+
const [pending, setPending] = useState<AppStatus | null>(null);
|
|
44
|
+
const [justInstalled, setJustInstalled] = useState<AgentAppId | null>(null);
|
|
45
|
+
const [lineCopied, setLineCopied] = useState(false);
|
|
46
|
+
|
|
47
|
+
const appName = (id: AgentAppId): string => agentAppName(id, localeId);
|
|
48
|
+
const rows = orderInstallApps(apps);
|
|
49
|
+
|
|
50
|
+
const stateText = (row: AppStatus): string => {
|
|
51
|
+
if (row.state === 'available') return names.state.available;
|
|
52
|
+
if (row.state === 'outdated') return names.state.outdated;
|
|
53
|
+
if (row.state === 'broken') return names.state.broken;
|
|
54
|
+
return names.state.installed;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const install = async (row: AppStatus) => {
|
|
58
|
+
setPending(null);
|
|
59
|
+
const result = await act(row.id, 'install');
|
|
60
|
+
if (!result.ok) {
|
|
61
|
+
toast.error(format(names.installFailed, { name: appName(row.id), error: result.error }));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setJustInstalled(row.id);
|
|
65
|
+
setLineCopied(false);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const copyLine = async () => {
|
|
69
|
+
if (await copyText(t.shortLine)) setLineCopied(true);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const installed = apps.some((app) => app.state === 'installed' || app.state === 'outdated');
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<StartBoard
|
|
76
|
+
board="install"
|
|
77
|
+
mascot="design"
|
|
78
|
+
title={t.title}
|
|
79
|
+
forWhom={t.forWhom}
|
|
80
|
+
done={installed}
|
|
81
|
+
>
|
|
82
|
+
<ul className="divide-y divide-border border-t border-border">
|
|
83
|
+
{rows.map((row) => (
|
|
84
|
+
<li
|
|
85
|
+
key={row.id}
|
|
86
|
+
data-lr-start-app={row.id}
|
|
87
|
+
data-state={row.state}
|
|
88
|
+
className="flex items-center gap-2 py-2"
|
|
89
|
+
>
|
|
90
|
+
<div className="min-w-0 flex-1">
|
|
91
|
+
<p className="text-[13px] font-medium">{appName(row.id)}</p>
|
|
92
|
+
{(row.state === 'outdated' || row.state === 'broken') && (
|
|
93
|
+
<p className="text-[11.5px] text-muted-foreground">{stateText(row)}</p>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
{row.state === 'no-app' ? (
|
|
97
|
+
<div className="flex shrink-0 items-baseline gap-2">
|
|
98
|
+
<span
|
|
99
|
+
data-lr-start-app-missing={row.id}
|
|
100
|
+
className="text-[12px] text-muted-foreground"
|
|
101
|
+
>
|
|
102
|
+
{t.missing}
|
|
103
|
+
</span>
|
|
104
|
+
<a
|
|
105
|
+
data-lr-start-download={row.id}
|
|
106
|
+
href={AGENT_APP_DOWNLOADS[row.id]}
|
|
107
|
+
target="_blank"
|
|
108
|
+
rel="noreferrer"
|
|
109
|
+
className="shrink-0 text-[12px] text-foreground underline decoration-border underline-offset-2 outline-none hover:no-underline focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
110
|
+
>
|
|
111
|
+
{t.download}
|
|
112
|
+
</a>
|
|
113
|
+
</div>
|
|
114
|
+
) : row.state === 'installed' ? (
|
|
115
|
+
<span
|
|
116
|
+
data-lr-start-app-installed={row.id}
|
|
117
|
+
className="inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-1 text-[12px] text-muted-foreground"
|
|
118
|
+
>
|
|
119
|
+
<Check className="size-3.5" aria-hidden />
|
|
120
|
+
{t.installed}
|
|
121
|
+
</span>
|
|
122
|
+
) : (
|
|
123
|
+
(row.state === 'available' || row.state === 'outdated') && (
|
|
124
|
+
<Button
|
|
125
|
+
type="button"
|
|
126
|
+
size="xs"
|
|
127
|
+
variant="outline"
|
|
128
|
+
data-lr-start-install={row.id}
|
|
129
|
+
disabled={working === row.id}
|
|
130
|
+
onClick={() => setPending(row)}
|
|
131
|
+
>
|
|
132
|
+
{working === row.id ? names.working : t.install}
|
|
133
|
+
</Button>
|
|
134
|
+
)
|
|
135
|
+
)}
|
|
136
|
+
</li>
|
|
137
|
+
))}
|
|
138
|
+
</ul>
|
|
139
|
+
|
|
140
|
+
{justInstalled && (
|
|
141
|
+
<div data-lr-start-installed-hint className="mt-2 rounded-[10px] bg-muted px-3 py-2">
|
|
142
|
+
<p className="text-[12px] leading-snug">
|
|
143
|
+
{format(t.shortTitle, { name: appName(justInstalled) })}
|
|
144
|
+
</p>
|
|
145
|
+
<blockquote data-lr-start-short-line className="mt-1 text-[13px] font-medium">
|
|
146
|
+
{t.shortLine}
|
|
147
|
+
</blockquote>
|
|
148
|
+
<Button
|
|
149
|
+
type="button"
|
|
150
|
+
size="xs"
|
|
151
|
+
variant="outline"
|
|
152
|
+
data-lr-start-copy-line
|
|
153
|
+
className="mt-1.5"
|
|
154
|
+
onClick={() => void copyLine()}
|
|
155
|
+
>
|
|
156
|
+
{lineCopied ? t.copiedLine : t.copyLine}
|
|
157
|
+
</Button>
|
|
158
|
+
</div>
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
<div className="mt-auto pt-2">
|
|
162
|
+
<Link
|
|
163
|
+
to="/agents/more"
|
|
164
|
+
data-lr-start-more-agents
|
|
165
|
+
className="inline-block text-[11.5px] text-muted-foreground underline-offset-2 outline-none hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
166
|
+
>
|
|
167
|
+
{t.more}
|
|
168
|
+
</Link>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<Dialog open={pending !== null} onOpenChange={(open) => !open && setPending(null)}>
|
|
172
|
+
<DialogContent data-lr-start-confirm>
|
|
173
|
+
{pending && (
|
|
174
|
+
<>
|
|
175
|
+
<DialogHeader>
|
|
176
|
+
<DialogTitle>
|
|
177
|
+
{format(names.confirmTitle, { name: appName(pending.id) })}
|
|
178
|
+
</DialogTitle>
|
|
179
|
+
<DialogDescription>{names.confirmBackup}</DialogDescription>
|
|
180
|
+
</DialogHeader>
|
|
181
|
+
<p className="break-all rounded-[10px] bg-muted px-3 py-2 text-[12px] text-muted-foreground">
|
|
182
|
+
{format(names.confirmTarget, { path: pending.target })}
|
|
183
|
+
</p>
|
|
184
|
+
<DialogFooter>
|
|
185
|
+
<Button
|
|
186
|
+
type="button"
|
|
187
|
+
variant="ghost"
|
|
188
|
+
data-lr-start-cancel
|
|
189
|
+
onClick={() => setPending(null)}
|
|
190
|
+
>
|
|
191
|
+
{names.cancel}
|
|
192
|
+
</Button>
|
|
193
|
+
<Button
|
|
194
|
+
type="button"
|
|
195
|
+
data-lr-start-go
|
|
196
|
+
disabled={working === pending.id}
|
|
197
|
+
onClick={() => void install(pending)}
|
|
198
|
+
>
|
|
199
|
+
{names.confirmInstall}
|
|
200
|
+
</Button>
|
|
201
|
+
</DialogFooter>
|
|
202
|
+
</>
|
|
203
|
+
)}
|
|
204
|
+
</DialogContent>
|
|
205
|
+
</Dialog>
|
|
206
|
+
</StartBoard>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Download } from 'lucide-react';
|
|
2
|
+
import { format, useLocale } from '@/lib/use-locale';
|
|
3
|
+
import { useLrText } from '../text';
|
|
4
|
+
import { agentEntry, agentName, agentsByMethod, MORE_METHODS } from './more-agents';
|
|
5
|
+
|
|
6
|
+
export const PLUGIN_BUNDLE_URL = '/__lr/agent-plugins/bundle.zip';
|
|
7
|
+
|
|
8
|
+
export function MoreAgentsPage() {
|
|
9
|
+
const t = useLrText().agentsMore;
|
|
10
|
+
const localeId = useLocale().id;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div data-lr-agents-more className="max-w-[760px] pb-10">
|
|
14
|
+
<header className="mb-5">
|
|
15
|
+
<h1 className="font-heading text-[28px] font-bold leading-[34px] tracking-[-0.01em]">
|
|
16
|
+
{t.title}
|
|
17
|
+
</h1>
|
|
18
|
+
<p className="mt-1 text-[14px] leading-relaxed text-muted-foreground">{t.intro}</p>
|
|
19
|
+
</header>
|
|
20
|
+
|
|
21
|
+
<section
|
|
22
|
+
data-lr-more-download-card
|
|
23
|
+
className="rounded-[16px] border border-border bg-card px-6 py-5 shadow-[var(--lr-shadow-1)]"
|
|
24
|
+
>
|
|
25
|
+
<a
|
|
26
|
+
data-lr-more-download
|
|
27
|
+
href={PLUGIN_BUNDLE_URL}
|
|
28
|
+
download="lemonriver-plugin.zip"
|
|
29
|
+
className="inline-flex items-center gap-2 rounded-[10px] bg-primary px-4 py-2 text-[14px] font-semibold text-primary-foreground outline-none hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
30
|
+
>
|
|
31
|
+
<Download className="size-4" />
|
|
32
|
+
{t.download}
|
|
33
|
+
</a>
|
|
34
|
+
<p className="mt-3 text-[13px] leading-snug text-muted-foreground">{t.downloadHint}</p>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<h2 className="mt-6 mb-2 font-heading text-[16px] font-semibold">{t.examplesTitle}</h2>
|
|
38
|
+
|
|
39
|
+
<div className="flex flex-col gap-3">
|
|
40
|
+
{MORE_METHODS.map((method) => {
|
|
41
|
+
const agents = agentsByMethod(method);
|
|
42
|
+
return (
|
|
43
|
+
<section
|
|
44
|
+
key={method}
|
|
45
|
+
data-lr-more-method={method}
|
|
46
|
+
className="rounded-[16px] border border-border bg-card px-6 py-5"
|
|
47
|
+
>
|
|
48
|
+
<h3 className="text-[15px] font-semibold">{t.methods[method].title}</h3>
|
|
49
|
+
<p className="mt-1 text-[13px] leading-relaxed text-muted-foreground">
|
|
50
|
+
{t.methods[method].body}
|
|
51
|
+
</p>
|
|
52
|
+
{agents.length > 0 && (
|
|
53
|
+
<ul className="mt-3 divide-y divide-border border-t border-border">
|
|
54
|
+
{agents.map((agent) => {
|
|
55
|
+
const entry = agentEntry(agent, localeId);
|
|
56
|
+
return (
|
|
57
|
+
<li key={agent.id} data-lr-more-agent={agent.id} className="py-2">
|
|
58
|
+
<div className="flex flex-wrap items-baseline gap-2">
|
|
59
|
+
<span className="text-[13px] font-medium">
|
|
60
|
+
{agentName(agent, localeId)}
|
|
61
|
+
</span>
|
|
62
|
+
<a
|
|
63
|
+
href={agent.url}
|
|
64
|
+
target="_blank"
|
|
65
|
+
rel="noreferrer"
|
|
66
|
+
className="text-[11.5px] text-muted-foreground underline decoration-border underline-offset-2 outline-none hover:text-foreground hover:no-underline focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
67
|
+
>
|
|
68
|
+
{t.official}
|
|
69
|
+
</a>
|
|
70
|
+
</div>
|
|
71
|
+
<p className="mt-0.5 text-[12px] leading-snug text-muted-foreground">
|
|
72
|
+
{entry
|
|
73
|
+
? format(entry.englishMenu ? t.entryEnglishLabel : t.entryLabel, {
|
|
74
|
+
entry: entry.text,
|
|
75
|
+
})
|
|
76
|
+
: t.uncertain}
|
|
77
|
+
</p>
|
|
78
|
+
</li>
|
|
79
|
+
);
|
|
80
|
+
})}
|
|
81
|
+
</ul>
|
|
82
|
+
)}
|
|
83
|
+
</section>
|
|
84
|
+
);
|
|
85
|
+
})}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { Locale } from '../../../locale/types';
|
|
2
|
+
|
|
3
|
+
export type MoreMethod = 'plugin' | 'skills' | 'folder';
|
|
4
|
+
|
|
5
|
+
export type MoreAgentId =
|
|
6
|
+
| 'doubao'
|
|
7
|
+
| 'qianwen'
|
|
8
|
+
| 'pi'
|
|
9
|
+
| 'trae'
|
|
10
|
+
| 'kimi'
|
|
11
|
+
| 'cursor'
|
|
12
|
+
| 'gemini'
|
|
13
|
+
| 'opencode'
|
|
14
|
+
| 'cherry'
|
|
15
|
+
| 'lingma';
|
|
16
|
+
|
|
17
|
+
export type MoreAgent = {
|
|
18
|
+
id: MoreAgentId;
|
|
19
|
+
name: string;
|
|
20
|
+
/** Chinese UIs show the app under its Chinese name; others keep the brand's Latin form. */
|
|
21
|
+
nameZhCN?: string;
|
|
22
|
+
nameZhTW?: string;
|
|
23
|
+
url: string;
|
|
24
|
+
method: MoreMethod;
|
|
25
|
+
/** Where that app takes the skills or MCP config, as its own docs name it. */
|
|
26
|
+
entry?: string;
|
|
27
|
+
entryZhCN?: string;
|
|
28
|
+
entryZhTW?: string;
|
|
29
|
+
/** A menu path whose Chinese wording its docs do not give; the UI says so. */
|
|
30
|
+
entryEnglish?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// One entry per app the user asked about. The method says what that app's
|
|
34
|
+
// official docs confirm; anything not confirmed stays on the folder way.
|
|
35
|
+
export const MORE_AGENTS: readonly MoreAgent[] = [
|
|
36
|
+
{
|
|
37
|
+
id: 'doubao',
|
|
38
|
+
name: 'Doubao',
|
|
39
|
+
nameZhCN: '豆包',
|
|
40
|
+
nameZhTW: '豆包',
|
|
41
|
+
url: 'https://www.doubao.com/',
|
|
42
|
+
method: 'folder',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'qianwen',
|
|
46
|
+
name: 'Qianwen Office',
|
|
47
|
+
nameZhCN: '千问办公',
|
|
48
|
+
nameZhTW: '千問辦公',
|
|
49
|
+
url: 'https://qwenwork.ai/',
|
|
50
|
+
method: 'folder',
|
|
51
|
+
},
|
|
52
|
+
{ id: 'pi', name: 'Pi', url: 'https://inflection.ai/', method: 'folder' },
|
|
53
|
+
{
|
|
54
|
+
id: 'trae',
|
|
55
|
+
name: 'Trae',
|
|
56
|
+
url: 'https://docs.trae.cn/',
|
|
57
|
+
method: 'skills',
|
|
58
|
+
entry: 'Settings → MCP → Add → Add manually',
|
|
59
|
+
entryZhCN: '设置 → MCP → 添加 → 手动添加',
|
|
60
|
+
entryZhTW: '設定 → MCP → 新增 → 手動新增',
|
|
61
|
+
},
|
|
62
|
+
{ id: 'kimi', name: 'Kimi', url: 'https://www.kimi.ai/', method: 'folder' },
|
|
63
|
+
{
|
|
64
|
+
id: 'cursor',
|
|
65
|
+
name: 'Cursor',
|
|
66
|
+
url: 'https://cursor.com/',
|
|
67
|
+
method: 'skills',
|
|
68
|
+
entry: 'Settings → Customize; or ~/.cursor/mcp.json (project: .cursor/mcp.json)',
|
|
69
|
+
entryEnglish: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'gemini',
|
|
73
|
+
name: 'Gemini CLI',
|
|
74
|
+
url: 'https://geminicli.com/',
|
|
75
|
+
method: 'skills',
|
|
76
|
+
entry: '~/.gemini/settings.json → mcpServers',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'opencode',
|
|
80
|
+
name: 'OpenCode',
|
|
81
|
+
url: 'https://opencode.ai/',
|
|
82
|
+
method: 'skills',
|
|
83
|
+
entry: 'opencode.jsonc → mcp.servers',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'cherry',
|
|
87
|
+
name: 'Cherry Studio',
|
|
88
|
+
url: 'https://www.cherryai.com.cn/',
|
|
89
|
+
method: 'skills',
|
|
90
|
+
entry: 'Settings → MCP → Add (JSON import works too)',
|
|
91
|
+
entryZhCN: '设置 → MCP → MCP 服务器 → 添加(也可以从 JSON 导入)',
|
|
92
|
+
entryZhTW: '設定 → MCP → MCP 伺服器 → 新增(也可以從 JSON 匯入)',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'lingma',
|
|
96
|
+
name: 'Tongyi Lingma',
|
|
97
|
+
nameZhCN: '通义灵码',
|
|
98
|
+
nameZhTW: '通義靈碼',
|
|
99
|
+
url: 'https://lingma.aliyun.com/',
|
|
100
|
+
method: 'skills',
|
|
101
|
+
entry: 'Settings → MCP tools → + (MCP Square also works)',
|
|
102
|
+
entryZhCN: '头像 → 个人设置 → MCP 服务',
|
|
103
|
+
entryZhTW: '頭像 → 個人設定 → MCP 服務',
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
export const MORE_METHODS: readonly MoreMethod[] = ['plugin', 'skills', 'folder'];
|
|
108
|
+
|
|
109
|
+
export function agentsByMethod(
|
|
110
|
+
method: MoreMethod,
|
|
111
|
+
agents: readonly MoreAgent[] = MORE_AGENTS,
|
|
112
|
+
): MoreAgent[] {
|
|
113
|
+
return agents.filter((agent) => agent.method === method);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function agentName(agent: MoreAgent, localeId: Locale['id']): string {
|
|
117
|
+
if (localeId === 'zh-CN') return agent.nameZhCN ?? agent.name;
|
|
118
|
+
if (localeId === 'zh-TW') return agent.nameZhTW ?? agent.name;
|
|
119
|
+
return agent.name;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type MoreAgentEntry = { text: string; englishMenu: boolean };
|
|
123
|
+
|
|
124
|
+
export function agentEntry(agent: MoreAgent, localeId: Locale['id']): MoreAgentEntry | null {
|
|
125
|
+
if (!agent.entry) return null;
|
|
126
|
+
if (localeId === 'zh-CN') {
|
|
127
|
+
return agent.entryZhCN
|
|
128
|
+
? { text: agent.entryZhCN, englishMenu: false }
|
|
129
|
+
: { text: agent.entry, englishMenu: Boolean(agent.entryEnglish) };
|
|
130
|
+
}
|
|
131
|
+
if (localeId === 'zh-TW') {
|
|
132
|
+
return agent.entryZhTW
|
|
133
|
+
? { text: agent.entryZhTW, englishMenu: false }
|
|
134
|
+
: { text: agent.entry, englishMenu: Boolean(agent.entryEnglish) };
|
|
135
|
+
}
|
|
136
|
+
return { text: agent.entry, englishMenu: false };
|
|
137
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import { workspacePath } from '../settings/workspace';
|
|
4
|
+
import { useLrText } from '../text';
|
|
5
|
+
import { copyText } from './clipboard';
|
|
6
|
+
import { startPrompt } from './start';
|
|
7
|
+
import { StartBoard } from './start-board';
|
|
8
|
+
|
|
9
|
+
export function QuickBoard({ copied, onCopied }: { copied: boolean; onCopied: () => void }) {
|
|
10
|
+
const t = useLrText().start.quick;
|
|
11
|
+
const [path, setPath] = useState<string | null>(null);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
let alive = true;
|
|
15
|
+
void workspacePath().then((value) => {
|
|
16
|
+
if (alive) setPath(value);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
alive = false;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
const prompt = startPrompt(t.prompt, path, window.location.origin);
|
|
24
|
+
|
|
25
|
+
const copy = async () => {
|
|
26
|
+
if (!prompt) return;
|
|
27
|
+
if (await copyText(prompt)) onCopied();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<StartBoard board="quick" mascot="research" title={t.title} forWhom={t.forWhom} done={copied}>
|
|
32
|
+
<p data-lr-start-howto className="mt-1 text-[12.5px] leading-relaxed text-muted-foreground">
|
|
33
|
+
{t.howTo}
|
|
34
|
+
</p>
|
|
35
|
+
<Button
|
|
36
|
+
type="button"
|
|
37
|
+
size="sm"
|
|
38
|
+
variant={copied ? 'outline' : 'default'}
|
|
39
|
+
data-lr-start-copy
|
|
40
|
+
className="mt-2 self-start"
|
|
41
|
+
disabled={!prompt}
|
|
42
|
+
onClick={() => void copy()}
|
|
43
|
+
>
|
|
44
|
+
{copied ? t.copied : t.copy}
|
|
45
|
+
</Button>
|
|
46
|
+
{copied && (
|
|
47
|
+
<p
|
|
48
|
+
data-lr-start-after-copy
|
|
49
|
+
className="mt-1.5 text-[12px] leading-snug text-muted-foreground"
|
|
50
|
+
>
|
|
51
|
+
{t.afterCopy}
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
54
|
+
<p className="mt-1.5 text-[11.5px] leading-snug text-muted-foreground">{t.agents}</p>
|
|
55
|
+
</StartBoard>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { HelperMascot, type HelperRole } from '../brand/mascot';
|
|
3
|
+
|
|
4
|
+
export type StartBoardId = 'quick' | 'install' | 'create';
|
|
5
|
+
|
|
6
|
+
/** One of the three choices on the start card: mascot, title, who it suits. */
|
|
7
|
+
export function StartBoard({
|
|
8
|
+
board,
|
|
9
|
+
mascot,
|
|
10
|
+
title,
|
|
11
|
+
forWhom,
|
|
12
|
+
done = false,
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
board: StartBoardId;
|
|
16
|
+
mascot: HelperRole;
|
|
17
|
+
title: string;
|
|
18
|
+
forWhom: string;
|
|
19
|
+
done?: boolean;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
data-lr-start-board={board}
|
|
25
|
+
data-done={done ? '' : undefined}
|
|
26
|
+
className="flex min-w-0 flex-col rounded-[14px] border border-border bg-card p-4"
|
|
27
|
+
>
|
|
28
|
+
<div className="flex items-start gap-2">
|
|
29
|
+
<HelperMascot role={mascot} state={done ? 'done' : 'idle'} size={40} />
|
|
30
|
+
<div className="min-w-0 flex-1">
|
|
31
|
+
<p className="text-[15px] font-semibold leading-tight">{title}</p>
|
|
32
|
+
<p className="mt-0.5 text-[12.5px] leading-snug text-muted-foreground">{forWhom}</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="mt-2 flex flex-1 flex-col">{children}</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|