@lemonriver/core 0.8.0 → 1.0.1

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.
Files changed (54) hide show
  1. package/README.md +3 -1
  2. package/dist/{build-Bdagm0FU.js → build-CiT4CNey.js} +1 -1
  3. package/dist/cli/bin.js +11 -4
  4. package/dist/client-DpO_eR9X.js +57 -0
  5. package/dist/{config-Begts3gq.js → config-BI3VRI2n.js} +4557 -4596
  6. package/dist/{dev-DjjzmT28.js → dev-DpzBn_sf.js} +2 -2
  7. package/dist/index.js +1 -1
  8. package/dist/locale/index.js +1 -1
  9. package/dist/mcp-CjYDzcJa.js +262 -0
  10. package/dist/{preview-C9y9MTY1.js → preview-Dro8hl5_.js} +2 -2
  11. package/dist/vite/index.js +1 -1
  12. package/dist/{zh-tw-DcrDeKxr.js → zh-tw-BhYyMx0-.js} +40 -40
  13. package/package.json +1 -1
  14. package/skills/slide-authoring/SKILL.md +2 -0
  15. package/src/app/lemonriver/agent-providers/section.tsx +13 -4
  16. package/src/app/lemonriver/board/use-self-check.ts +1 -1
  17. package/src/app/lemonriver/brand/mascot.tsx +4 -1
  18. package/src/app/lemonriver/chrome/app-chrome.tsx +6 -0
  19. package/src/app/lemonriver/chrome/sidebar-extras.tsx +9 -1
  20. package/src/app/lemonriver/feedback/lemon-empty.tsx +3 -1
  21. package/src/app/lemonriver/guide/guide-prompt.tsx +89 -0
  22. package/src/app/lemonriver/guide/state.ts +29 -0
  23. package/src/app/lemonriver/guide/use-guide.ts +17 -0
  24. package/src/app/lemonriver/help/help-page.tsx +5 -0
  25. package/src/app/lemonriver/help/model.test.ts +72 -0
  26. package/src/app/lemonriver/help/model.ts +10 -1
  27. package/src/app/lemonriver/home/home-page.tsx +25 -7
  28. package/src/app/lemonriver/mcp/respond.ts +47 -0
  29. package/src/app/lemonriver/mcp/screenshot.tsx +155 -0
  30. package/src/app/lemonriver/mcp/self-check.tsx +65 -0
  31. package/src/app/lemonriver/outline/describe-page.tsx +3 -1
  32. package/src/app/lemonriver/routes.test.tsx +4 -1
  33. package/src/app/lemonriver/routes.tsx +12 -11
  34. package/src/app/lemonriver/settings/settings-page.tsx +3 -3
  35. package/src/app/lemonriver/share/freeze.ts +13 -5
  36. package/src/app/lemonriver/text/en.ts +227 -7
  37. package/src/app/lemonriver/text/es.ts +23 -6
  38. package/src/app/lemonriver/text/ja.ts +23 -6
  39. package/src/app/lemonriver/text/types.ts +14 -1
  40. package/src/app/lemonriver/text/zh-cn.ts +218 -6
  41. package/src/app/lemonriver/text/zh-tw.ts +218 -6
  42. package/src/app/lemonriver/update/beta-badge.tsx +3 -0
  43. package/src/app/lemonriver/update/lazy-page.tsx +29 -0
  44. package/src/app/lemonriver/update/notice-mascot.tsx +18 -0
  45. package/src/app/lemonriver/update/restart-notice.tsx +47 -0
  46. package/src/app/lemonriver/update/state.ts +33 -0
  47. package/src/app/lemonriver/update/update-prompt.tsx +30 -1
  48. package/src/app/lemonriver/update/version.test.ts +14 -0
  49. package/src/app/lemonriver/update/version.ts +5 -0
  50. package/src/locale/en.ts +8 -8
  51. package/src/locale/es.ts +10 -8
  52. package/src/locale/ja.ts +9 -8
  53. package/src/locale/zh-cn.ts +9 -8
  54. package/src/locale/zh-tw.ts +9 -8
@@ -0,0 +1,33 @@
1
+ export const UPDATE_TOAST_ID = 'lemonriver-update';
2
+
3
+ let updatedVersion: string | null = null;
4
+ let icons: { done: string | null; needsYou: string | null } = { done: null, needsYou: null };
5
+
6
+ export function markUpdated(version: string): void {
7
+ updatedVersion = version;
8
+ }
9
+
10
+ export function justUpdated(): string | null {
11
+ return updatedVersion;
12
+ }
13
+
14
+ export function rememberNoticeIcons(next: typeof icons): void {
15
+ icons = next;
16
+ }
17
+
18
+ export function noticeIcons(): typeof icons {
19
+ return icons;
20
+ }
21
+
22
+ // A dev-server update deletes the old files while the page still runs them, so
23
+ // the next page the user opens fails to fetch its chunk.
24
+ const MODULE_FETCH_ERRORS = [
25
+ 'Failed to fetch dynamically imported module',
26
+ 'error loading dynamically imported module',
27
+ 'Importing a module script failed',
28
+ ];
29
+
30
+ export function moduleFetchFailed(error: unknown): boolean {
31
+ const message = (error as Error | null)?.message ?? '';
32
+ return MODULE_FETCH_ERRORS.some((text) => message.includes(text));
33
+ }
@@ -3,7 +3,9 @@ import { useLocation } from 'react-router-dom';
3
3
  import { toast } from 'sonner';
4
4
  import { format } from '@/lib/use-locale';
5
5
  import { useRestartServer } from '@/lib/use-restart-server';
6
+ import { MASCOT_SRC } from '../brand/mascot';
6
7
  import { useLrText } from '../text';
8
+ import { NoticeMascot } from './notice-mascot';
7
9
  import {
8
10
  promptsOnPage,
9
11
  readSnooze,
@@ -12,8 +14,26 @@ import {
12
14
  UPDATE_CHECK_INTERVAL_MS,
13
15
  type UpdateCheck,
14
16
  } from './prompt';
17
+ import { markUpdated, rememberNoticeIcons, UPDATE_TOAST_ID } from './state';
15
18
 
16
- const TOAST_ID = 'lemonriver-update';
19
+ const TOAST_ID = UPDATE_TOAST_ID;
20
+
21
+ /** Reads a mascot while its file still exists, so the notice can still draw it after the update. */
22
+ async function preloadMascot(src: string): Promise<string | null> {
23
+ try {
24
+ const res = await fetch(src);
25
+ if (!res.ok) return null;
26
+ const blob = await res.blob();
27
+ return await new Promise<string>((resolve, reject) => {
28
+ const reader = new FileReader();
29
+ reader.onload = () => resolve(String(reader.result));
30
+ reader.onerror = () => reject(reader.error);
31
+ reader.readAsDataURL(blob);
32
+ });
33
+ } catch {
34
+ return null;
35
+ }
36
+ }
17
37
 
18
38
  export function UpdatePrompt() {
19
39
  const { pathname } = useLocation();
@@ -41,6 +61,12 @@ export function UpdatePrompt() {
41
61
  phase.current = 'busy';
42
62
  toast.loading(lr.update.updating, { id: TOAST_ID, duration: Infinity });
43
63
 
64
+ const icons = {
65
+ done: await preloadMascot(MASCOT_SRC.done),
66
+ needsYou: await preloadMascot(MASCOT_SRC['needs-you']),
67
+ };
68
+ rememberNoticeIcons(icons);
69
+
44
70
  let ok = false;
45
71
  try {
46
72
  const res = await fetch('/__update-package', { method: 'POST' });
@@ -56,6 +82,7 @@ export function UpdatePrompt() {
56
82
  id: TOAST_ID,
57
83
  duration: Infinity,
58
84
  description: lr.update.failedHint,
85
+ icon: icons.needsYou ? <NoticeMascot src={icons.needsYou} /> : undefined,
59
86
  action: { label: lr.update.retry, onClick: () => void runUpdate(latest) },
60
87
  cancel: { label: lr.update.later, onClick: () => snooze(latest) },
61
88
  });
@@ -64,10 +91,12 @@ export function UpdatePrompt() {
64
91
 
65
92
  phase.current = 'done';
66
93
  settled.current = latest;
94
+ markUpdated(latest);
67
95
  if (cancelled) return;
68
96
  toast.success(format(lr.update.updated, { version: latest }), {
69
97
  id: TOAST_ID,
70
98
  duration: Infinity,
99
+ icon: icons.done ? <NoticeMascot src={icons.done} /> : undefined,
71
100
  description: canRestart ? lr.update.updatedHint : lr.update.updatedManual,
72
101
  action: canRestart
73
102
  ? { label: lr.update.restart, onClick: () => void restartServer() }
@@ -0,0 +1,14 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { shouldShowBeta } from './version';
3
+
4
+ describe('the sidebar Beta badge', () => {
5
+ it('shows before 1.0', () => {
6
+ expect(shouldShowBeta('0.8.0')).toBe(true);
7
+ expect(shouldShowBeta('0.99.9')).toBe(true);
8
+ });
9
+
10
+ it('is gone from 1.0 on', () => {
11
+ expect(shouldShowBeta('1.0.0')).toBe(false);
12
+ expect(shouldShowBeta('1.2.3')).toBe(false);
13
+ });
14
+ });
@@ -0,0 +1,5 @@
1
+ // 1.0 is the first release that is no longer an early access build.
2
+ export function shouldShowBeta(version: string): boolean {
3
+ const major = Number.parseInt(version, 10);
4
+ return !Number.isFinite(major) || major < 1;
5
+ }
package/src/locale/en.ts CHANGED
@@ -64,8 +64,8 @@ export const en: Locale = {
64
64
  nothingMatchesPrefix: 'Nothing matches ',
65
65
  nothingMatchesSuffix: ' in this folder.',
66
66
  noSlidesYet: 'No slides yet',
67
- createSlideHintPrefix: 'Run ',
68
- createSlideHintSuffix: ' in your agent to scaffold one.',
67
+ createSlideHintPrefix: 'Ask your agent to “make a slide deck about …” (in Claude Code, run ',
68
+ createSlideHintSuffix: ').',
69
69
  folderEmptyTitle: '{name} is empty',
70
70
  folderEmptyHint: 'Drag a slide from Draft into this folder in the sidebar.',
71
71
  slideActions: 'Slide actions',
@@ -99,12 +99,12 @@ export const en: Locale = {
99
99
  resizeSidePanel: 'Resize side panel',
100
100
  home: 'Home',
101
101
  backToHome: 'Back to home',
102
- agentConnected: 'Agent connected',
102
+ agentConnected: 'Local service connected',
103
103
  agentConnectedTooltip:
104
- 'The current slide and inspector selection are synced to your agent in real time.',
105
- agentDisconnected: 'Agent disconnected',
104
+ 'The browser and the local service are connected: the deck you are viewing, the page number and the selected element are written into the workspace, where an agent working in this folder can read them.',
105
+ agentDisconnected: 'Local service disconnected',
106
106
  agentDisconnectedTooltip:
107
- 'Lost connection to the dev server, so your agent can no longer see the current slide or inspector selection. Restart the dev server to restore the connection.',
107
+ 'The browser is disconnected from the local service, so the agent cannot see which page you are on. Reopen LemonRiver (or run the start command again) to restore it.',
108
108
  download: 'Download',
109
109
  copyLink: 'Copy link',
110
110
  moreActions: 'More actions',
@@ -303,8 +303,8 @@ export const en: Locale = {
303
303
  commentLineLabel: 'line {n}',
304
304
  commentRegionLabel: 'region',
305
305
  commentEmptyHint: 'Click an element or drag across a region to leave a comment.',
306
- commentsApplyHintPrefix: 'Run ',
307
- commentsApplyHintSuffix: ' in your agent to apply these.',
306
+ commentsApplyHintPrefix: 'Ask your agent to “apply comments” (in Claude Code, run ',
307
+ commentsApplyHintSuffix: ').',
308
308
  commentDeleteAria: 'Delete',
309
309
  commentUpdateFailed: "Couldn't update comment:",
310
310
  commentAddFailed: "Couldn't add comment:",
package/src/locale/es.ts CHANGED
@@ -65,8 +65,9 @@ export const es: Locale = {
65
65
  nothingMatchesPrefix: 'Nada coincide con ',
66
66
  nothingMatchesSuffix: ' en esta carpeta.',
67
67
  noSlidesYet: 'Aún no hay presentaciones',
68
- createSlideHintPrefix: 'Ejecuta ',
69
- createSlideHintSuffix: ' en tu agente para crear una.',
68
+ createSlideHintPrefix:
69
+ 'Pídele a tu agente que «haga una presentación sobre…» (en Claude Code, ejecuta ',
70
+ createSlideHintSuffix: ').',
70
71
  folderEmptyTitle: '{name} está vacía',
71
72
  folderEmptyHint:
72
73
  'Arrastra una presentación desde Borradores a esta carpeta en la barra lateral.',
@@ -101,12 +102,12 @@ export const es: Locale = {
101
102
  resizeSidePanel: 'Redimensionar panel lateral',
102
103
  home: 'Inicio',
103
104
  backToHome: 'Volver al inicio',
104
- agentConnected: 'Agente conectado',
105
+ agentConnected: 'Servicio local conectado',
105
106
  agentConnectedTooltip:
106
- 'La diapositiva actual y la selección del inspector se sincronizan con tu agente en tiempo real.',
107
- agentDisconnected: 'Agente desconectado',
107
+ 'El navegador y el servicio local están conectados: la presentación que estás viendo, el número de página y el elemento seleccionado se escriben en el espacio de trabajo, donde un agente que trabaje en esta carpeta puede leerlos.',
108
+ agentDisconnected: 'Servicio local desconectado',
108
109
  agentDisconnectedTooltip:
109
- 'Se perdió la conexión con el servidor de desarrollo, así que tu agente ya no ve la diapositiva actual ni la selección del inspector. Reinicia el servidor de desarrollo para restablecerla.',
110
+ 'El navegador se ha desconectado del servicio local, así que el agente ya no puede ver qué página estás viendo. Vuelve a abrir LemonRiver (o ejecuta de nuevo el comando de inicio) para restablecer la conexión.',
110
111
  download: 'Descargar',
111
112
  copyLink: 'Copiar enlace',
112
113
  moreActions: 'Más acciones',
@@ -308,8 +309,9 @@ export const es: Locale = {
308
309
  commentLineLabel: 'línea {n}',
309
310
  commentRegionLabel: 'zona',
310
311
  commentEmptyHint: 'Haz clic en un elemento o arrastra sobre una zona para dejar un comentario.',
311
- commentsApplyHintPrefix: 'Ejecuta ',
312
- commentsApplyHintSuffix: ' en tu agente para aplicarlos.',
312
+ commentsApplyHintPrefix:
313
+ 'Pídele a tu agente que «aplique los comentarios» (en Claude Code, ejecuta ',
314
+ commentsApplyHintSuffix: ').',
313
315
  commentDeleteAria: 'Eliminar',
314
316
  commentUpdateFailed: 'No se pudo actualizar el comentario:',
315
317
  commentAddFailed: 'No se pudo añadir el comentario:',
package/src/locale/ja.ts CHANGED
@@ -64,8 +64,9 @@ export const ja: Locale = {
64
64
  nothingMatchesPrefix: 'このフォルダ内に ',
65
65
  nothingMatchesSuffix: ' に一致する項目はありません。',
66
66
  noSlidesYet: 'スライドはまだありません',
67
- createSlideHintPrefix: 'エージェントで ',
68
- createSlideHintSuffix: ' を実行してスライドを作成しましょう。',
67
+ createSlideHintPrefix:
68
+ 'エージェントに「〜についてのスライドを作って」と伝えてください(Claude Code では ',
69
+ createSlideHintSuffix: ' を実行)。',
69
70
  folderEmptyTitle: '{name} は空です',
70
71
  folderEmptyHint: 'サイドバーから下書きのスライドをこのフォルダにドラッグしてください。',
71
72
  slideActions: 'スライド操作',
@@ -97,12 +98,12 @@ export const ja: Locale = {
97
98
 
98
99
  slide: {
99
100
  resizeSidePanel: 'サイドパネルの幅を調整',
100
- agentConnected: 'エージェント接続中',
101
+ agentConnected: 'ローカルサービス接続中',
101
102
  agentConnectedTooltip:
102
- '現在のスライドと Inspector の選択はエージェントにリアルタイムで同期されています。',
103
- agentDisconnected: 'エージェント切断',
103
+ 'ブラウザとローカルサービスが接続されています。表示中のデッキ、ページ番号、選択中の要素はワークスペースに書き込まれ、このフォルダで作業するエージェントが読めます。',
104
+ agentDisconnected: 'ローカルサービス切断',
104
105
  agentDisconnectedTooltip:
105
- 'dev server との接続が切れたため、現在のスライドや Inspector の選択がエージェントに届かなくなっています。dev server を再起動して接続を復旧してください。',
106
+ 'ブラウザとローカルサービスが切断されたため、エージェントは表示中のページを参照できません。LemonRiver を開き直す(または起動コマンドを再実行する)と復旧します。',
106
107
  home: 'ホーム',
107
108
  backToHome: 'ホームへ戻る',
108
109
  download: 'ダウンロード',
@@ -306,8 +307,8 @@ export const ja: Locale = {
306
307
  commentLineLabel: '行 {n}',
307
308
  commentRegionLabel: '範囲',
308
309
  commentEmptyHint: '要素をクリックするか、範囲をドラッグしてコメントを残せます。',
309
- commentsApplyHintPrefix: 'エージェントで ',
310
- commentsApplyHintSuffix: ' を実行して適用してください。',
310
+ commentsApplyHintPrefix: 'エージェントに「コメントを適用」と伝えてください(Claude Code では ',
311
+ commentsApplyHintSuffix: ' を実行)。',
311
312
  commentDeleteAria: '削除',
312
313
  commentUpdateFailed: 'コメントを更新できませんでした:',
313
314
  commentAddFailed: 'コメントを追加できませんでした:',
@@ -64,8 +64,8 @@ export const zhCN: Locale = {
64
64
  nothingMatchesPrefix: '该文件夹中没有匹配 ',
65
65
  nothingMatchesSuffix: ' 的内容。',
66
66
  noSlidesYet: '尚无幻灯片',
67
- createSlideHintPrefix: '在 agent 中执行 ',
68
- createSlideHintSuffix: ' 开始创建。',
67
+ createSlideHintPrefix: '跟你的 Agent 说「做一份关于……的幻灯片」(Claude Code 里输入 ',
68
+ createSlideHintSuffix: ')。',
69
69
  folderEmptyTitle: '{name} 为空',
70
70
  folderEmptyHint: '从侧边栏将幻灯片从草稿拖入此文件夹。',
71
71
  slideActions: '幻灯片操作',
@@ -97,11 +97,12 @@ export const zhCN: Locale = {
97
97
 
98
98
  slide: {
99
99
  resizeSidePanel: '调整侧栏宽度',
100
- agentConnected: 'Agent 已连接',
101
- agentConnectedTooltip: '目前的 slide 与 Inspector 选择会即时同步给 agent。',
102
- agentDisconnected: 'Agent 已断开',
100
+ agentConnected: '本机服务已连接',
101
+ agentConnectedTooltip:
102
+ '浏览器和本机服务连着:你正在看的演示、页码和选中的元素会写进工作区,在这个文件夹里干活的 Agent 读得到。',
103
+ agentDisconnected: '本机服务已断开',
103
104
  agentDisconnectedTooltip:
104
- '已和 dev server 断开连接,agent 没办法再看到你目前的 slide 或 Inspector 选择。请重新启动 dev server 来恢复连接。',
105
+ '浏览器和本机服务断开了,Agent 看不到你正在看哪一页。重新打开 LemonRiver(或重新运行启动命令)就能恢复。',
105
106
  home: '首页',
106
107
  backToHome: '返回首页',
107
108
  download: '下载',
@@ -300,8 +301,8 @@ export const zhCN: Locale = {
300
301
  commentLineLabel: '第 {n} 行',
301
302
  commentRegionLabel: '区域',
302
303
  commentEmptyHint: '点击元素或拖拽框选一个区域来评论。',
303
- commentsApplyHintPrefix: '在你的代理中运行 ',
304
- commentsApplyHintSuffix: ' 以应用这些更改。',
304
+ commentsApplyHintPrefix: '跟你的 Agent 说「应用评论」(Claude Code 里输入 ',
305
+ commentsApplyHintSuffix: ')。',
305
306
  commentDeleteAria: '删除',
306
307
  commentUpdateFailed: '无法更新评论:',
307
308
  commentAddFailed: '无法添加评论:',
@@ -64,8 +64,8 @@ export const zhTW: Locale = {
64
64
  nothingMatchesPrefix: '此資料夾中沒有相符 ',
65
65
  nothingMatchesSuffix: ' 的項目。',
66
66
  noSlidesYet: '尚無投影片',
67
- createSlideHintPrefix: '在 agent 中執行 ',
68
- createSlideHintSuffix: ' 開始建立。',
67
+ createSlideHintPrefix: '跟你的 Agent 說「做一份關於……的簡報」(Claude Code 裡輸入 ',
68
+ createSlideHintSuffix: ')。',
69
69
  folderEmptyTitle: '{name} 為空',
70
70
  folderEmptyHint: '從側邊欄將投影片從草稿拖入此資料夾。',
71
71
  slideActions: '投影片操作',
@@ -97,11 +97,12 @@ export const zhTW: Locale = {
97
97
 
98
98
  slide: {
99
99
  resizeSidePanel: '調整側欄寬度',
100
- agentConnected: 'Agent 已連線',
101
- agentConnectedTooltip: '目前的 slide 與 Inspector 選擇會即時同步給 agent。',
102
- agentDisconnected: 'Agent 已斷線',
100
+ agentConnected: '本機服務已連線',
101
+ agentConnectedTooltip:
102
+ '瀏覽器和本機服務連著:你正在看的簡報、頁碼和選取的元素會寫進工作區,在這個資料夾裡工作的 Agent 讀得到。',
103
+ agentDisconnected: '本機服務已斷線',
103
104
  agentDisconnectedTooltip:
104
- '已和 dev server 斷線,agent 沒辦法再看到你目前的 slide 或 Inspector 選擇。請重新啟動 dev server 來恢復連線。',
105
+ '瀏覽器和本機服務斷開了,Agent 看不到你正在看哪一頁。重新開啟 LemonRiver(或重新執行啟動指令)就能恢復。',
105
106
  home: '首頁',
106
107
  backToHome: '返回首頁',
107
108
  download: '下載',
@@ -300,8 +301,8 @@ export const zhTW: Locale = {
300
301
  commentLineLabel: '第 {n} 行',
301
302
  commentRegionLabel: '範圍',
302
303
  commentEmptyHint: '點選元件或拖曳框選一個範圍來留言。',
303
- commentsApplyHintPrefix: '在你的代理中執行 ',
304
- commentsApplyHintSuffix: ' 以套用這些變更。',
304
+ commentsApplyHintPrefix: '跟你的 Agent 說「套用留言」(Claude Code 裡輸入 ',
305
+ commentsApplyHintSuffix: ')。',
305
306
  commentDeleteAria: '刪除',
306
307
  commentUpdateFailed: '無法更新留言:',
307
308
  commentAddFailed: '無法新增留言:',