Skip to content

Commit e81b16d

Browse files
committed
feat: 添加文件搜索、缓存淘汰和注入解析动画组件
添加三个新的动画演示组件: 1. BFS文件搜索算法展示并行批处理和指针队列优化 2. LRU缓存淘汰策略可视化最近最少使用算法 3. 注入解析器展示嵌套大括号匹配和内容提取 这些组件用于教学演示核心算法实现原理
1 parent e72407b commit e81b16d

7 files changed

Lines changed: 2712 additions & 0 deletions

src/App.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ const TokenLimitMatcherAnimation = lazy(() => import('./pages/TokenLimitMatcherA
9292
const SharedTokenManagerAnimation = lazy(() => import('./pages/SharedTokenManagerAnimation'));
9393
const ShellInjectionProcessorAnimation = lazy(() => import('./pages/ShellInjectionProcessorAnimation'));
9494
const AtFileProcessorAnimation = lazy(() => import('./pages/AtFileProcessorAnimation'));
95+
const ImageTokenizerAnimation = lazy(() => import('./pages/ImageTokenizerAnimation'));
96+
const ExponentialBackoffAnimation = lazy(() => import('./pages/ExponentialBackoffAnimation'));
97+
const BfsFileSearchAnimation = lazy(() => import('./pages/BfsFileSearchAnimation'));
98+
const InjectionParserAnimation = lazy(() => import('./pages/InjectionParserAnimation'));
99+
const LruCacheAnimation = lazy(() => import('./pages/LruCacheAnimation'));
95100
const CoreCode = lazy(() => import('./pages/CoreCode').then(m => ({ default: m.CoreCode })));
96101
const LoopMechanism = lazy(() => import('./pages/LoopMechanism').then(m => ({ default: m.LoopMechanism })));
97102

@@ -348,6 +353,16 @@ function App() {
348353
return <ShellInjectionProcessorAnimation />;
349354
case 'at-file-processor-anim':
350355
return <AtFileProcessorAnimation />;
356+
case 'image-tokenizer-anim':
357+
return <ImageTokenizerAnimation />;
358+
case 'exponential-backoff-anim':
359+
return <ExponentialBackoffAnimation />;
360+
case 'bfs-file-search-anim':
361+
return <BfsFileSearchAnimation />;
362+
case 'injection-parser-anim':
363+
return <InjectionParserAnimation />;
364+
case 'lru-cache-anim':
365+
return <LruCacheAnimation />;
351366
case 'code':
352367
return <CoreCode />;
353368
case 'loop':

src/nav.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ export const navGroups: NavGroup[] = [
171171
{ id: 'shared-token-manager-anim', label: 'Token 管理器', highlight: true },
172172
{ id: 'shell-injection-anim', label: 'Shell 注入处理', highlight: true },
173173
{ id: 'at-file-processor-anim', label: '@File 处理器', highlight: true },
174+
{ id: 'image-tokenizer-anim', label: 'Image Tokenizer 解析', highlight: true },
175+
{ id: 'exponential-backoff-anim', label: '指数退避重试', highlight: true },
176+
{ id: 'bfs-file-search-anim', label: 'BFS 文件搜索', highlight: true },
177+
{ id: 'injection-parser-anim', label: 'Injection 解析器', highlight: true },
178+
{ id: 'lru-cache-anim', label: 'LRU 缓存淘汰', highlight: true },
174179
],
175180
},
176181
{

0 commit comments

Comments
 (0)