@lemonriver/core 0.3.0 → 0.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.
Files changed (86) hide show
  1. package/dist/{build-Bqo69DWP.js → build-Nl7EeJ6x.js} +1 -1
  2. package/dist/cli/bin.js +3 -3
  3. package/dist/{config-teo3kWz7.d.ts → config-CYNOR93W.d.ts} +1 -1
  4. package/dist/{config-DJ5rkMMg.js → config-CpC0nM3r.js} +697 -2
  5. package/dist/{dev-B2FJD5bJ.js → dev-BB3THd5I.js} +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +1 -1
  8. package/dist/locale/index.d.ts +1 -1
  9. package/dist/locale/index.js +1 -1
  10. package/dist/{preview-C93BOZL1.js → preview-BGjgTg7H.js} +1 -1
  11. package/dist/{types-DFK02XVv.d.ts → types-tdaXSyah.d.ts} +1 -0
  12. package/dist/vite/index.d.ts +1 -1
  13. package/dist/vite/index.js +1 -1
  14. package/dist/{zh-tw-DwTAZKa6.js → zh-tw-DcrDeKxr.js} +5 -0
  15. package/package.json +1 -1
  16. package/src/agent/prompt.ts +2 -0
  17. package/src/app/components/agent/agent-panel.tsx +2 -0
  18. package/src/app/components/player.tsx +105 -23
  19. package/src/app/components/present/curtain.tsx +52 -0
  20. package/src/app/components/present/last-slide-hint.tsx +36 -0
  21. package/src/app/components/sidebar/sidebar-footer.tsx +6 -1
  22. package/src/app/components/thumbnail-rail.tsx +1 -0
  23. package/src/app/lemonriver/agent/lemon.tsx +16 -1
  24. package/src/app/lemonriver/agent-prefs/prefs.test.ts +173 -0
  25. package/src/app/lemonriver/agent-prefs/prefs.ts +137 -0
  26. package/src/app/lemonriver/agent-prefs/use-prefs.ts +36 -0
  27. package/src/app/lemonriver/brand/mascot.tsx +86 -0
  28. package/src/app/lemonriver/brand/mascots/design-done.png +0 -0
  29. package/src/app/lemonriver/brand/mascots/design-idle.png +0 -0
  30. package/src/app/lemonriver/brand/mascots/design-needs-you.png +0 -0
  31. package/src/app/lemonriver/brand/mascots/design-working.png +0 -0
  32. package/src/app/lemonriver/brand/mascots/outline-done.png +0 -0
  33. package/src/app/lemonriver/brand/mascots/outline-idle.png +0 -0
  34. package/src/app/lemonriver/brand/mascots/outline-needs-you.png +0 -0
  35. package/src/app/lemonriver/brand/mascots/outline-working.png +0 -0
  36. package/src/app/lemonriver/brand/mascots/research-done.png +0 -0
  37. package/src/app/lemonriver/brand/mascots/research-idle.png +0 -0
  38. package/src/app/lemonriver/brand/mascots/research-needs-you.png +0 -0
  39. package/src/app/lemonriver/brand/mascots/research-working.png +0 -0
  40. package/src/app/lemonriver/brand/mascots/review-done.png +0 -0
  41. package/src/app/lemonriver/brand/mascots/review-idle.png +0 -0
  42. package/src/app/lemonriver/brand/mascots/review-needs-you.png +0 -0
  43. package/src/app/lemonriver/brand/mascots/review-working.png +0 -0
  44. package/src/app/lemonriver/chrome/app-chrome.tsx +2 -0
  45. package/src/app/lemonriver/features.test.ts +5 -0
  46. package/src/app/lemonriver/features.ts +2 -1
  47. package/src/app/lemonriver/home/brief-card.tsx +8 -1
  48. package/src/app/lemonriver/home/home-page.tsx +11 -7
  49. package/src/app/lemonriver/onboarding/onboarding.tsx +182 -0
  50. package/src/app/lemonriver/outline/build-team.tsx +278 -0
  51. package/src/app/lemonriver/outline/describe-page.tsx +380 -0
  52. package/src/app/lemonriver/outline/files.test.ts +90 -0
  53. package/src/app/lemonriver/outline/files.ts +69 -0
  54. package/src/app/lemonriver/outline/model.test.ts +633 -0
  55. package/src/app/lemonriver/outline/model.ts +443 -0
  56. package/src/app/lemonriver/outline/outline-page.tsx +504 -0
  57. package/src/app/lemonriver/outline/pending-pages.tsx +39 -0
  58. package/src/app/lemonriver/outline/rule.ts +3 -0
  59. package/src/app/lemonriver/outline/steps.tsx +43 -0
  60. package/src/app/lemonriver/outline/use-build-driver.ts +258 -0
  61. package/src/app/lemonriver/routes.test.tsx +6 -6
  62. package/src/app/lemonriver/routes.tsx +28 -0
  63. package/src/app/lemonriver/settings/settings-page.tsx +211 -0
  64. package/src/app/lemonriver/slide-extensions.tsx +31 -24
  65. package/src/app/lemonriver/text/en.ts +149 -0
  66. package/src/app/lemonriver/text/es.ts +148 -0
  67. package/src/app/lemonriver/text/ja.ts +150 -0
  68. package/src/app/lemonriver/text/text.test.ts +33 -0
  69. package/src/app/lemonriver/text/types.ts +169 -0
  70. package/src/app/lemonriver/text/zh-cn.ts +146 -0
  71. package/src/app/lemonriver/text/zh-tw.ts +146 -0
  72. package/src/app/lemonriver/theme/app.css +12 -1
  73. package/src/app/lemonriver/theme/pages.test.ts +4 -0
  74. package/src/app/lemonriver/theme/pages.ts +11 -2
  75. package/src/app/lemonriver/update/beta-badge.tsx +26 -0
  76. package/src/app/lemonriver/update/prompt.test.ts +84 -0
  77. package/src/app/lemonriver/update/prompt.ts +48 -0
  78. package/src/app/lemonriver/update/update-prompt.tsx +113 -0
  79. package/src/app/routes/home.tsx +13 -5
  80. package/src/app/routes/slide.tsx +70 -13
  81. package/src/locale/en.ts +1 -0
  82. package/src/locale/es.ts +1 -0
  83. package/src/locale/ja.ts +1 -0
  84. package/src/locale/types.ts +1 -0
  85. package/src/locale/zh-cn.ts +1 -0
  86. package/src/locale/zh-tw.ts +1 -0
@@ -0,0 +1,173 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import {
3
+ type AgentPrefs,
4
+ DEFAULT_PREFS,
5
+ PREFS_KEY,
6
+ prefsLines,
7
+ readPrefs,
8
+ sanitizePrefs,
9
+ savePrefs,
10
+ toneForUses,
11
+ } from './prefs';
12
+
13
+ function memoryStorage(initial: Record<string, string> = {}): Storage {
14
+ const data = new Map(Object.entries(initial));
15
+ return {
16
+ get length() {
17
+ return data.size;
18
+ },
19
+ clear: () => data.clear(),
20
+ getItem: (key: string) => data.get(key) ?? null,
21
+ key: (index: number) => [...data.keys()][index] ?? null,
22
+ removeItem: (key: string) => {
23
+ data.delete(key);
24
+ },
25
+ setItem: (key: string, value: string) => {
26
+ data.set(key, value);
27
+ },
28
+ };
29
+ }
30
+
31
+ describe('sanitizePrefs', () => {
32
+ it('returns the defaults for anything that is not an object', () => {
33
+ expect(sanitizePrefs(null)).toEqual(DEFAULT_PREFS);
34
+ expect(sanitizePrefs('dense')).toEqual(DEFAULT_PREFS);
35
+ expect(sanitizePrefs(['dense'])).toEqual(DEFAULT_PREFS);
36
+ });
37
+
38
+ it('keeps the values it knows', () => {
39
+ const prefs: AgentPrefs = {
40
+ confirmEachPage: true,
41
+ askOnMismatch: false,
42
+ autoImages: false,
43
+ tone: 'concise',
44
+ research: 'web',
45
+ outline: 'direct',
46
+ design: 'dense',
47
+ review: 'numbers',
48
+ };
49
+ expect(sanitizePrefs(prefs)).toEqual(prefs);
50
+ });
51
+
52
+ it('replaces the values it does not know with the defaults', () => {
53
+ expect(
54
+ sanitizePrefs({
55
+ confirmEachPage: 'yes',
56
+ askOnMismatch: 0,
57
+ autoImages: null,
58
+ tone: 'shouty',
59
+ research: 'library',
60
+ outline: 'auto',
61
+ design: 'sparse',
62
+ review: 'loose',
63
+ }),
64
+ ).toEqual(DEFAULT_PREFS);
65
+ });
66
+
67
+ it('fills a partial record', () => {
68
+ expect(sanitizePrefs({ design: 'visual' })).toEqual({ ...DEFAULT_PREFS, design: 'visual' });
69
+ });
70
+ });
71
+
72
+ describe('readPrefs and savePrefs', () => {
73
+ it('round-trips through storage', () => {
74
+ const storage = memoryStorage();
75
+ const prefs: AgentPrefs = { ...DEFAULT_PREFS, tone: 'friendly', confirmEachPage: true };
76
+ savePrefs(storage, prefs);
77
+ expect(storage.getItem(PREFS_KEY)).toBe(JSON.stringify(prefs));
78
+ expect(readPrefs(storage)).toEqual(prefs);
79
+ });
80
+
81
+ it('falls back to the defaults on junk or a missing key', () => {
82
+ expect(readPrefs(memoryStorage())).toEqual(DEFAULT_PREFS);
83
+ expect(readPrefs(memoryStorage({ [PREFS_KEY]: 'not json' }))).toEqual(DEFAULT_PREFS);
84
+ expect(readPrefs(memoryStorage({ [PREFS_KEY]: '{"tone":"loud"}' }))).toEqual(DEFAULT_PREFS);
85
+ });
86
+
87
+ it('swallows a storage that throws', () => {
88
+ const broken = {
89
+ getItem: () => {
90
+ throw new Error('blocked');
91
+ },
92
+ setItem: () => {
93
+ throw new Error('blocked');
94
+ },
95
+ } as unknown as Storage;
96
+ expect(readPrefs(broken)).toEqual(DEFAULT_PREFS);
97
+ expect(() => savePrefs(broken, DEFAULT_PREFS)).not.toThrow();
98
+ });
99
+ });
100
+
101
+ describe('prefsLines', () => {
102
+ const prefs = (patch: Partial<AgentPrefs> = {}): AgentPrefs => ({ ...DEFAULT_PREFS, ...patch });
103
+
104
+ it('gives every step the tone', () => {
105
+ for (const step of ['outline', 'page', 'review'] as const) {
106
+ expect(prefsLines(prefs(), step)[0]).toBe('Write in a steady, professional tone.');
107
+ }
108
+ expect(prefsLines(prefs({ tone: 'friendly' }), 'page')[0]).toBe(
109
+ 'Write in a light, friendly tone.',
110
+ );
111
+ expect(prefsLines(prefs({ tone: 'concise' }), 'review')[0]).toBe(
112
+ 'Keep the wording short and punchy.',
113
+ );
114
+ });
115
+
116
+ it('tells the outline step where facts may come from', () => {
117
+ expect(prefsLines(prefs(), 'outline')).toEqual([
118
+ 'Write in a steady, professional tone.',
119
+ "Use only the user's reference files; do not look anything up on the web.",
120
+ ]);
121
+ expect(prefsLines(prefs({ research: 'web' }), 'outline')).toContain(
122
+ 'You may look up facts the files do not cover; say where each one came from.',
123
+ );
124
+ });
125
+
126
+ it('tells the page step how dense to lay out and whether to use images', () => {
127
+ expect(prefsLines(prefs(), 'page')).toEqual([
128
+ 'Write in a steady, professional tone.',
129
+ 'Balance text and visuals.',
130
+ 'Use icons and image placeholders where a picture helps; never invent photos the user did not provide.',
131
+ ]);
132
+ expect(prefsLines(prefs({ design: 'dense' }), 'page')).toContain(
133
+ 'A page may carry more text and data when the content needs it.',
134
+ );
135
+ expect(prefsLines(prefs({ autoImages: false }), 'page')).toContain(
136
+ 'Do not add any image the user did not provide.',
137
+ );
138
+ });
139
+
140
+ it('tells the review step how far to check and what to do with a mismatch', () => {
141
+ expect(prefsLines(prefs(), 'review')).toEqual([
142
+ 'Write in a steady, professional tone.',
143
+ 'Check wording, typos and every number.',
144
+ ]);
145
+ expect(prefsLines(prefs({ review: 'numbers' }), 'review')).toContain(
146
+ 'Check only the numbers against the reference files.',
147
+ );
148
+ const lenient = prefsLines(prefs({ askOnMismatch: false }), 'review');
149
+ expect(lenient).toContain(
150
+ 'When two files disagree on a number, use the one from the spreadsheet (.xlsx, .xls or .csv) and say which you used.',
151
+ );
152
+ });
153
+ });
154
+
155
+ describe('toneForUses', () => {
156
+ it('picks a tone from what the deck is for', () => {
157
+ expect(toneForUses(['report'])).toBe('steady');
158
+ expect(toneForUses(['pitch'])).toBe('steady');
159
+ expect(toneForUses(['lecture'])).toBe('friendly');
160
+ expect(toneForUses(['training'])).toBe('friendly');
161
+ expect(toneForUses(['launch'])).toBe('concise');
162
+ });
163
+
164
+ it('lets a launch win over anything else picked with it', () => {
165
+ expect(toneForUses(['lecture', 'launch'])).toBe('concise');
166
+ expect(toneForUses(['report', 'training'])).toBe('friendly');
167
+ });
168
+
169
+ it('changes nothing for other or an empty pick', () => {
170
+ expect(toneForUses([])).toBeNull();
171
+ expect(toneForUses(['other'])).toBeNull();
172
+ });
173
+ });
@@ -0,0 +1,137 @@
1
+ export type Tone = 'steady' | 'friendly' | 'concise';
2
+ export type ResearchSource = 'uploads' | 'web';
3
+ export type OutlineMode = 'review' | 'direct';
4
+ export type DesignDensity = 'visual' | 'balanced' | 'dense';
5
+ export type ReviewMode = 'strict' | 'numbers';
6
+
7
+ export type AgentPrefs = {
8
+ confirmEachPage: boolean;
9
+ askOnMismatch: boolean;
10
+ autoImages: boolean;
11
+ tone: Tone;
12
+ research: ResearchSource;
13
+ outline: OutlineMode;
14
+ design: DesignDensity;
15
+ review: ReviewMode;
16
+ };
17
+
18
+ export const DEFAULT_PREFS: AgentPrefs = {
19
+ confirmEachPage: false,
20
+ askOnMismatch: true,
21
+ autoImages: true,
22
+ tone: 'steady',
23
+ research: 'uploads',
24
+ outline: 'review',
25
+ design: 'balanced',
26
+ review: 'strict',
27
+ };
28
+
29
+ export const PREFS_KEY = 'lemonriver:agent-prefs';
30
+
31
+ const TONES: readonly Tone[] = ['steady', 'friendly', 'concise'];
32
+ const RESEARCH: readonly ResearchSource[] = ['uploads', 'web'];
33
+ const OUTLINES: readonly OutlineMode[] = ['review', 'direct'];
34
+ const DESIGNS: readonly DesignDensity[] = ['visual', 'balanced', 'dense'];
35
+ const REVIEWS: readonly ReviewMode[] = ['strict', 'numbers'];
36
+
37
+ function pick<T extends string>(value: unknown, allowed: readonly T[], fallback: T): T {
38
+ return typeof value === 'string' && (allowed as readonly string[]).includes(value)
39
+ ? (value as T)
40
+ : fallback;
41
+ }
42
+
43
+ function flag(value: unknown, fallback: boolean): boolean {
44
+ return typeof value === 'boolean' ? value : fallback;
45
+ }
46
+
47
+ export function sanitizePrefs(raw: unknown): AgentPrefs {
48
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return { ...DEFAULT_PREFS };
49
+ const r = raw as Record<string, unknown>;
50
+ return {
51
+ confirmEachPage: flag(r.confirmEachPage, DEFAULT_PREFS.confirmEachPage),
52
+ askOnMismatch: flag(r.askOnMismatch, DEFAULT_PREFS.askOnMismatch),
53
+ autoImages: flag(r.autoImages, DEFAULT_PREFS.autoImages),
54
+ tone: pick(r.tone, TONES, DEFAULT_PREFS.tone),
55
+ research: pick(r.research, RESEARCH, DEFAULT_PREFS.research),
56
+ outline: pick(r.outline, OUTLINES, DEFAULT_PREFS.outline),
57
+ design: pick(r.design, DESIGNS, DEFAULT_PREFS.design),
58
+ review: pick(r.review, REVIEWS, DEFAULT_PREFS.review),
59
+ };
60
+ }
61
+
62
+ export function readPrefs(storage: Storage): AgentPrefs {
63
+ let raw: string | null = null;
64
+ try {
65
+ raw = storage.getItem(PREFS_KEY);
66
+ } catch {
67
+ return { ...DEFAULT_PREFS };
68
+ }
69
+ if (!raw) return { ...DEFAULT_PREFS };
70
+ try {
71
+ return sanitizePrefs(JSON.parse(raw));
72
+ } catch {
73
+ return { ...DEFAULT_PREFS };
74
+ }
75
+ }
76
+
77
+ export function savePrefs(storage: Storage, prefs: AgentPrefs): void {
78
+ try {
79
+ storage.setItem(PREFS_KEY, JSON.stringify(sanitizePrefs(prefs)));
80
+ } catch {}
81
+ }
82
+
83
+ const TONE_LINE: Record<Tone, string> = {
84
+ steady: 'Write in a steady, professional tone.',
85
+ friendly: 'Write in a light, friendly tone.',
86
+ concise: 'Keep the wording short and punchy.',
87
+ };
88
+
89
+ const RESEARCH_LINE: Record<ResearchSource, string> = {
90
+ uploads: "Use only the user's reference files; do not look anything up on the web.",
91
+ web: 'You may look up facts the files do not cover; say where each one came from.',
92
+ };
93
+
94
+ const DESIGN_LINE: Record<DesignDensity, string> = {
95
+ visual: 'Keep text short and give each page one large visual, chart or icon.',
96
+ balanced: 'Balance text and visuals.',
97
+ dense: 'A page may carry more text and data when the content needs it.',
98
+ };
99
+
100
+ const IMAGES_LINE = {
101
+ yes: 'Use icons and image placeholders where a picture helps; never invent photos the user did not provide.',
102
+ no: 'Do not add any image the user did not provide.',
103
+ };
104
+
105
+ const REVIEW_LINE: Record<ReviewMode, string> = {
106
+ strict: 'Check wording, typos and every number.',
107
+ numbers: 'Check only the numbers against the reference files.',
108
+ };
109
+
110
+ const MISMATCH_LINE =
111
+ 'When two files disagree on a number, use the one from the spreadsheet (.xlsx, .xls or .csv) and say which you used.';
112
+
113
+ export type PrefStep = 'outline' | 'page' | 'review';
114
+
115
+ export function prefsLines(prefs: AgentPrefs, step: PrefStep): string[] {
116
+ const lines = [TONE_LINE[prefs.tone]];
117
+ if (step === 'outline') lines.push(RESEARCH_LINE[prefs.research]);
118
+ if (step === 'page') {
119
+ lines.push(DESIGN_LINE[prefs.design]);
120
+ lines.push(prefs.autoImages ? IMAGES_LINE.yes : IMAGES_LINE.no);
121
+ }
122
+ if (step === 'review') {
123
+ lines.push(REVIEW_LINE[prefs.review]);
124
+ if (!prefs.askOnMismatch) lines.push(MISMATCH_LINE);
125
+ }
126
+ return lines;
127
+ }
128
+
129
+ export const USE_IDS = ['report', 'pitch', 'lecture', 'launch', 'training', 'other'] as const;
130
+ export type UseId = (typeof USE_IDS)[number];
131
+
132
+ export function toneForUses(uses: readonly string[]): Tone | null {
133
+ if (uses.includes('launch')) return 'concise';
134
+ if (uses.includes('lecture') || uses.includes('training')) return 'friendly';
135
+ if (uses.includes('report') || uses.includes('pitch')) return 'steady';
136
+ return null;
137
+ }
@@ -0,0 +1,36 @@
1
+ import { useSyncExternalStore } from 'react';
2
+ import { type AgentPrefs, DEFAULT_PREFS, readPrefs, sanitizePrefs, savePrefs } from './prefs';
3
+
4
+ let current: AgentPrefs =
5
+ typeof window === 'undefined' ? DEFAULT_PREFS : readPrefs(window.localStorage);
6
+
7
+ const listeners = new Set<() => void>();
8
+
9
+ function subscribe(listener: () => void): () => void {
10
+ listeners.add(listener);
11
+ return () => {
12
+ listeners.delete(listener);
13
+ };
14
+ }
15
+
16
+ function snapshot(): AgentPrefs {
17
+ return current;
18
+ }
19
+
20
+ function serverSnapshot(): AgentPrefs {
21
+ return DEFAULT_PREFS;
22
+ }
23
+
24
+ export function useAgentPrefs(): AgentPrefs {
25
+ return useSyncExternalStore(subscribe, snapshot, serverSnapshot);
26
+ }
27
+
28
+ export function setAgentPrefs(next: AgentPrefs): void {
29
+ current = sanitizePrefs(next);
30
+ savePrefs(window.localStorage, current);
31
+ for (const listener of listeners) listener();
32
+ }
33
+
34
+ export function updateAgentPrefs(patch: Partial<AgentPrefs>): void {
35
+ setAgentPrefs({ ...current, ...patch });
36
+ }
@@ -1,10 +1,26 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
2
  import { cn } from '@/lib/utils';
3
+ import designDone from './mascots/design-done.png';
4
+ import designIdle from './mascots/design-idle.png';
5
+ import designNeedsYou from './mascots/design-needs-you.png';
6
+ import designWorking from './mascots/design-working.png';
3
7
  import done from './mascots/lemon-done.png';
4
8
  import idle from './mascots/lemon-idle.png';
5
9
  import needsYou from './mascots/lemon-needs-you.png';
6
10
  import thinking from './mascots/lemon-thinking.png';
7
11
  import working from './mascots/lemon-working.png';
12
+ import outlineDone from './mascots/outline-done.png';
13
+ import outlineIdle from './mascots/outline-idle.png';
14
+ import outlineNeedsYou from './mascots/outline-needs-you.png';
15
+ import outlineWorking from './mascots/outline-working.png';
16
+ import researchDone from './mascots/research-done.png';
17
+ import researchIdle from './mascots/research-idle.png';
18
+ import researchNeedsYou from './mascots/research-needs-you.png';
19
+ import researchWorking from './mascots/research-working.png';
20
+ import reviewDone from './mascots/review-done.png';
21
+ import reviewIdle from './mascots/review-idle.png';
22
+ import reviewNeedsYou from './mascots/review-needs-you.png';
23
+ import reviewWorking from './mascots/review-working.png';
8
24
 
9
25
  export type MascotState = 'idle' | 'thinking' | 'working' | 'needs-you' | 'done';
10
26
 
@@ -57,3 +73,73 @@ export function Mascot({
57
73
  />
58
74
  );
59
75
  }
76
+
77
+ export type HelperRole = 'research' | 'outline' | 'design' | 'review';
78
+ export type HelperState = 'idle' | 'working' | 'done' | 'needs-you';
79
+
80
+ const HELPER_SRC: Record<HelperRole, Record<HelperState, string>> = {
81
+ research: {
82
+ idle: researchIdle,
83
+ working: researchWorking,
84
+ done: researchDone,
85
+ 'needs-you': researchNeedsYou,
86
+ },
87
+ outline: {
88
+ idle: outlineIdle,
89
+ working: outlineWorking,
90
+ done: outlineDone,
91
+ 'needs-you': outlineNeedsYou,
92
+ },
93
+ design: {
94
+ idle: designIdle,
95
+ working: designWorking,
96
+ done: designDone,
97
+ 'needs-you': designNeedsYou,
98
+ },
99
+ review: {
100
+ idle: reviewIdle,
101
+ working: reviewWorking,
102
+ done: reviewDone,
103
+ 'needs-you': reviewNeedsYou,
104
+ },
105
+ };
106
+
107
+ /** One of the four helpers on the build team; floats and bounces like Lemon. */
108
+ export function HelperMascot({
109
+ role,
110
+ state,
111
+ size,
112
+ }: {
113
+ role: HelperRole;
114
+ state: HelperState;
115
+ size: number;
116
+ }) {
117
+ const first = useRef(true);
118
+ const [bounce, setBounce] = useState(0);
119
+
120
+ // biome-ignore lint/correctness/useExhaustiveDependencies: state is the trigger
121
+ useEffect(() => {
122
+ if (first.current) {
123
+ first.current = false;
124
+ return;
125
+ }
126
+ setBounce((n) => n + 1);
127
+ }, [state]);
128
+
129
+ return (
130
+ <img
131
+ key={bounce}
132
+ src={HELPER_SRC[role][state]}
133
+ alt=""
134
+ aria-hidden
135
+ draggable={false}
136
+ width={size}
137
+ height={size}
138
+ data-lr-helper={role}
139
+ data-lr-helper-state={state}
140
+ data-bounce={bounce > 0 ? '' : undefined}
141
+ className={cn('lr-mascot shrink-0', state === 'idle' && 'opacity-45')}
142
+ style={{ width: size, height: size }}
143
+ />
144
+ );
145
+ }
@@ -15,6 +15,7 @@ import {
15
15
  listTrash,
16
16
  restoreFromTrash,
17
17
  } from '../trash/api';
18
+ import { UpdatePrompt } from '../update/update-prompt';
18
19
  import { SidebarExtras } from './sidebar-extras';
19
20
 
20
21
  const UNDO_MS = 5000;
@@ -94,6 +95,7 @@ export function AppChrome() {
94
95
  <Toaster />
95
96
  {import.meta.env.DEV && <OfflineBanner />}
96
97
  <SidebarExtras />
98
+ <UpdatePrompt />
97
99
  </>
98
100
  );
99
101
  }
@@ -26,4 +26,9 @@ describe('isFeatureEnabled', () => {
26
26
  it('offers settings in a built site too', () => {
27
27
  expect(isFeatureEnabled('settings', { dev: false })).toBe(true);
28
28
  });
29
+
30
+ it('keeps the guided outline to dev, where the agent it drives runs', () => {
31
+ expect(isFeatureEnabled('outline', { dev: true })).toBe(true);
32
+ expect(isFeatureEnabled('outline', { dev: false })).toBe(false);
33
+ });
29
34
  });
@@ -1,5 +1,5 @@
1
1
  export type Tier = 'free' | 'pro';
2
- export type FeatureId = 'board' | 'trash' | 'settings';
2
+ export type FeatureId = 'board' | 'trash' | 'settings' | 'outline';
3
3
 
4
4
  export type Feature = { id: FeatureId; tier: Tier; devOnly: boolean };
5
5
 
@@ -7,6 +7,7 @@ export const FEATURES: readonly Feature[] = [
7
7
  { id: 'board', tier: 'free', devOnly: true },
8
8
  { id: 'trash', tier: 'free', devOnly: true },
9
9
  { id: 'settings', tier: 'free', devOnly: false },
10
+ { id: 'outline', tier: 'free', devOnly: true },
10
11
  ];
11
12
 
12
13
  /** The single place a paid tier will hook into later; today every tier is unlocked. */
@@ -1,14 +1,17 @@
1
1
  import { ArrowRight } from 'lucide-react';
2
2
  import { useState } from 'react';
3
+ import { useNavigate } from 'react-router-dom';
3
4
  import { Button } from '@/components/ui/button';
4
5
  import { useAgentStatus, useCreateDeck } from '@/lib/agent/use-agent';
5
6
  import { Mascot } from '../brand/mascot';
7
+ import { isFeatureEnabled } from '../features';
6
8
  import { useLrText } from '../text';
7
9
  import { saveBrief } from './brief';
8
10
 
9
- /** "Say it in one sentence": creates a deck, opens the agent there, sends the sentence. */
11
+ /** "Say it in one sentence": opens the guided flow, or creates a deck and tells the agent. */
10
12
  export function BriefCard() {
11
13
  const lr = useLrText();
14
+ const navigate = useNavigate();
12
15
  const createDeck = useCreateDeck();
13
16
  const { connected, loading } = useAgentStatus();
14
17
  const [text, setText] = useState('');
@@ -19,6 +22,10 @@ export function BriefCard() {
19
22
  const submit = async () => {
20
23
  const brief = text.trim();
21
24
  if (!brief || busy) return;
25
+ if (isFeatureEnabled('outline')) {
26
+ navigate('/new', { state: { brief } });
27
+ return;
28
+ }
22
29
  setBusy(true);
23
30
  saveBrief(brief);
24
31
  await createDeck();
@@ -1,6 +1,6 @@
1
1
  import { ChevronDown, Plus } from 'lucide-react';
2
2
  import { type ReactNode, useEffect, useMemo, useState } from 'react';
3
- import { useOutletContext } from 'react-router-dom';
3
+ import { useNavigate, useOutletContext } from 'react-router-dom';
4
4
  import { toast } from 'sonner';
5
5
  import { Button } from '@/components/ui/button';
6
6
  import {
@@ -226,12 +226,14 @@ export function LemonRiverHome() {
226
226
 
227
227
  function NewDeckCard() {
228
228
  const lr = useLrText();
229
+ const navigate = useNavigate();
229
230
  const createDeck = useCreateDeck();
231
+ const guided = isFeatureEnabled('outline');
230
232
  return (
231
233
  <li>
232
234
  <button
233
235
  type="button"
234
- onClick={() => void createDeck()}
236
+ onClick={() => (guided ? navigate('/new') : void createDeck())}
235
237
  className={cn(
236
238
  'flex h-full min-h-[190px] w-full flex-col items-center justify-center gap-2 rounded-[16px]',
237
239
  'border-[1.5px] border-dashed border-border text-[14px] font-semibold text-muted-foreground outline-none',
@@ -239,7 +241,7 @@ function NewDeckCard() {
239
241
  )}
240
242
  >
241
243
  <Plus className="size-7" />
242
- {lr.shell.newDeckCard}
244
+ {guided ? lr.shell.newDeckGuided : lr.shell.newDeckCard}
243
245
  </button>
244
246
  </li>
245
247
  );
@@ -261,7 +263,7 @@ function GridSkeleton() {
261
263
 
262
264
  function EmptyHome({ isDraft, folderName }: { isDraft: boolean; folderName?: string }) {
263
265
  const t = useLocale();
264
- const { provider } = useAgentStatus();
266
+ const { enabled, provider } = useAgentStatus();
265
267
  const createDeck = useCreateDeck();
266
268
  if (!isDraft) {
267
269
  return (
@@ -275,14 +277,16 @@ function EmptyHome({ isDraft, folderName }: { isDraft: boolean; folderName?: str
275
277
  title={t.home.noSlidesYet}
276
278
  actions={
277
279
  import.meta.env.DEV &&
278
- provider && (
280
+ enabled && (
279
281
  <Button onClick={() => void createDeck()}>
280
- {format(t.agent.createDeckWith, { provider: provider.name })}
282
+ {provider
283
+ ? format(t.agent.createDeckWith, { provider: provider.name })
284
+ : t.agent.createDeck}
281
285
  </Button>
282
286
  )
283
287
  }
284
288
  >
285
- {!provider && (
289
+ {!enabled && (
286
290
  <>
287
291
  {t.home.createSlideHintPrefix}
288
292
  <code className="rounded-[4px] bg-muted px-1.5 py-0.5 font-mono text-[12.5px] text-foreground">