@persistadev/mcp-server 3.3.7 → 3.3.8
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/index.js +13 -82
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.d.ts +27 -0
- package/dist/knowledge-base.d.ts.map +1 -0
- package/dist/knowledge-base.js +1430 -0
- package/dist/knowledge-base.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ const os_1 = __importDefault(require("os"));
|
|
|
50
50
|
const child_process_1 = require("child_process");
|
|
51
51
|
const fs_1 = __importDefault(require("fs"));
|
|
52
52
|
const path_1 = __importDefault(require("path"));
|
|
53
|
+
const knowledge_base_js_1 = require("./knowledge-base.js");
|
|
53
54
|
// ============================================
|
|
54
55
|
// CONFIGURATION
|
|
55
56
|
// ============================================
|
|
@@ -2287,81 +2288,11 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
2287
2288
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
2288
2289
|
}
|
|
2289
2290
|
case 'knowledge_seed': {
|
|
2290
|
-
//
|
|
2291
|
-
|
|
2292
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2293
|
-
// 🎯 PROMPTS
|
|
2294
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2295
|
-
{ domain: 'prompts', topic: 'react', update_type: 'prompt', title: 'Generate React Component', content: `Create a React component called [ComponentName] that:\n- Uses TypeScript with proper type definitions\n- Follows single responsibility principle\n- Includes JSDoc comments for props\n- Uses CSS modules for styling\n- Handles loading, error, and empty states\n- Is accessible (ARIA labels, keyboard nav)\n- Includes basic unit test file\n\nProps needed: [describe]\nFunctionality: [describe]`, tags: ['react', 'component'] },
|
|
2296
|
-
{ domain: 'prompts', topic: 'react', update_type: 'prompt', title: 'Refactor React Component', content: `Refactor this React component to:\n1. Extract reusable logic into custom hooks\n2. Memoize expensive computations with useMemo\n3. Optimize re-renders with React.memo\n4. Split into smaller components if over 150 lines\n5. Add proper TypeScript types (no 'any')\n6. Improve accessibility\n7. Add error boundaries if needed\n\nExplain each change.`, tags: ['react', 'refactor'] },
|
|
2297
|
-
{ domain: 'prompts', topic: 'react', update_type: 'prompt', title: 'Debug React Performance', content: `This React app is slow. Help debug:\n1. Identify unnecessary re-renders\n2. Find expensive computations to memoize\n3. Detect prop drilling that needs Context\n4. Spot missing keys in lists\n5. Find components to lazy load\n6. Check for memory leaks in useEffect\n\nFor each issue: problem, why it's slow, fix with code.`, tags: ['react', 'performance'] },
|
|
2298
|
-
{ domain: 'prompts', topic: 'typescript', update_type: 'prompt', title: 'Type This JavaScript', content: `Convert this JavaScript to TypeScript:\n1. Add types for all variables, params, returns\n2. Create interfaces for complex objects\n3. Use generics where appropriate\n4. Add type guards for runtime checking\n5. Use strict null checks\n6. No 'any' - use 'unknown' if needed\n7. Export types consumers might need`, tags: ['typescript', 'conversion'] },
|
|
2299
|
-
{ domain: 'prompts', topic: 'typescript', update_type: 'prompt', title: 'Create Type-Safe API Client', content: `Create a type-safe API client:\n1. Full TypeScript types for requests/responses\n2. Type-safe path params and query strings\n3. Proper error types and handling\n4. Generic fetch wrapper with JSON parsing\n5. Request/response interceptors\n6. Retry logic with exponential backoff\n7. Cancel token support`, tags: ['typescript', 'api'] },
|
|
2300
|
-
{ domain: 'prompts', topic: 'nextjs', update_type: 'prompt', title: 'Create Next.js Page', content: `Create a Next.js App Router page for [route]:\n1. Server Component by default\n2. Proper metadata export for SEO\n3. Loading state with loading.tsx\n4. Error handling with error.tsx\n5. generateStaticParams if dynamic\n6. Parallel data fetching\n7. Proper TypeScript types\n8. Accessible and responsive`, tags: ['nextjs', 'page'] },
|
|
2301
|
-
{ domain: 'prompts', topic: 'nextjs', update_type: 'prompt', title: 'Create Server Action', content: `Create a Next.js Server Action:\n1. 'use server' directive\n2. Zod validation for inputs\n3. Proper error handling\n4. Revalidate affected paths\n5. Return typed response\n6. Rate limiting consideration\n7. Auth check if needed`, tags: ['nextjs', 'server-actions'] },
|
|
2302
|
-
{ domain: 'prompts', topic: 'database', update_type: 'prompt', title: 'Design Database Schema', content: `Design a database schema for [feature]:\n1. Normalized (3NF unless justified)\n2. Proper foreign keys\n3. Indexes for common queries\n4. Timestamps (created_at, updated_at)\n5. Soft delete if needed\n6. UUID primary keys\n7. RLS policies for Supabase\n8. Sample queries\n\nOutput as SQL CREATE statements.`, tags: ['database', 'schema'] },
|
|
2303
|
-
{ domain: 'prompts', topic: 'review', update_type: 'prompt', title: 'Code Review', content: `Review this code:\n\n## Security\n- SQL injection, XSS, data exposure, auth issues\n\n## Performance\n- N+1 queries, missing indexes, memory leaks, bundle size\n\n## Maintainability\n- Naming, single responsibility, DRY, complexity\n\n## TypeScript\n- No 'any', proper null handling\n\nProvide specific line-by-line feedback with fixes.`, tags: ['review', 'quality'] },
|
|
2304
|
-
{ domain: 'prompts', topic: 'debugging', update_type: 'prompt', title: 'Debug This Error', content: `Debug this error:\n\nError: [paste]\nContext: [what you were doing]\nEnvironment: [dev/prod, versions]\n\n1. Explain what this error means\n2. List most common causes (ranked)\n3. Debugging steps to find root cause\n4. Give fix with code example\n5. How to prevent this in future`, tags: ['debugging', 'errors'] },
|
|
2305
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2306
|
-
// 🎨 DESIGN SYSTEMS
|
|
2307
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2308
|
-
{ domain: 'design', topic: 'colors', update_type: 'design_system', title: 'Modern SaaS Palette', content: `:root {\n --primary-500: #a855f7;\n --primary-600: #9333ea;\n --gray-50: #f8fafc;\n --gray-100: #f1f5f9;\n --gray-200: #e2e8f0;\n --gray-500: #64748b;\n --gray-700: #334155;\n --gray-900: #0f172a;\n --success: #10b981;\n --warning: #f59e0b;\n --error: #ef4444;\n --info: #3b82f6;\n}`, tags: ['colors', 'css'] },
|
|
2309
|
-
{ domain: 'design', topic: 'colors', update_type: 'design_system', title: 'Dark Mode Palette', content: `[data-theme="dark"] {\n --bg-primary: #0f0f0f;\n --bg-secondary: #1a1a1a;\n --bg-elevated: #2a2a2a;\n --text-primary: #fafafa;\n --text-secondary: #a1a1aa;\n --border-subtle: #27272a;\n --border-default: #3f3f46;\n --accent: #a855f7;\n}`, tags: ['colors', 'dark-mode'] },
|
|
2310
|
-
{ domain: 'design', topic: 'typography', update_type: 'design_system', title: 'Typography Scale', content: `:root {\n --font-sans: 'Inter', system-ui, sans-serif;\n --font-mono: 'JetBrains Mono', monospace;\n --text-xs: 0.75rem;\n --text-sm: 0.875rem;\n --text-base: 1rem;\n --text-lg: 1.125rem;\n --text-xl: 1.25rem;\n --text-2xl: 1.5rem;\n --text-3xl: 1.875rem;\n --text-4xl: 2.25rem;\n}`, tags: ['typography', 'fonts'] },
|
|
2311
|
-
{ domain: 'design', topic: 'spacing', update_type: 'design_system', title: 'Spacing & Shadows', content: `:root {\n --space-1: 0.25rem;\n --space-2: 0.5rem;\n --space-4: 1rem;\n --space-6: 1.5rem;\n --space-8: 2rem;\n --radius-sm: 4px;\n --radius-md: 8px;\n --radius-lg: 12px;\n --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);\n --shadow-md: 0 4px 6px rgba(0,0,0,0.1);\n --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);\n}`, tags: ['spacing', 'shadows'] },
|
|
2312
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2313
|
-
// 📁 ARCHITECTURE
|
|
2314
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2315
|
-
{ domain: 'architecture', topic: 'react', update_type: 'architecture', title: 'React Project Structure', content: `src/\n├── components/\n│ ├── ui/ # Button, Input, Modal\n│ ├── features/ # Feature-specific\n│ └── layouts/ # Layout components\n├── hooks/ # Custom hooks\n├── lib/ # Utils, API, constants\n├── stores/ # State management\n├── types/ # TypeScript types\n└── styles/ # Global CSS`, tags: ['structure', 'react'] },
|
|
2316
|
-
{ domain: 'architecture', topic: 'nextjs', update_type: 'architecture', title: 'Next.js App Router', content: `app/\n├── (auth)/ # Auth route group\n│ ├── login/\n│ └── layout.tsx\n├── (dashboard)/ # Dashboard group\n│ ├── dashboard/\n│ └── layout.tsx\n├── api/ # API routes\n├── globals.css\n├── layout.tsx # Root layout\n└── page.tsx # Home\n\nConventions:\n(folder) = group\n[folder] = dynamic\nloading.tsx = suspense\nerror.tsx = boundary`, tags: ['nextjs', 'structure'] },
|
|
2317
|
-
{ domain: 'architecture', topic: 'api', update_type: 'architecture', title: 'REST API Conventions', content: `GET /users # List\nPOST /users # Create\nGET /users/:id # Get one\nPUT /users/:id # Update full\nPATCH /users/:id # Update partial\nDELETE /users/:id # Delete\n\nFiltering: ?status=active&sort=-created_at&page=2\n\nResponse:\n{ data: [...], meta: { total, page, limit } }\n\nError:\n{ error: { code, message, details } }`, tags: ['api', 'rest'] },
|
|
2318
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2319
|
-
// ✅ CHECKLISTS
|
|
2320
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2321
|
-
{ domain: 'checklist', topic: 'launch', update_type: 'checklist', title: 'Pre-Launch Checklist', content: `## Performance\n- [ ] Lighthouse > 90\n- [ ] Images optimized\n- [ ] Bundle analyzed\n\n## SEO\n- [ ] Meta tags\n- [ ] Open Graph\n- [ ] Sitemap.xml\n- [ ] robots.txt\n\n## Security\n- [ ] HTTPS\n- [ ] Security headers\n- [ ] Rate limiting\n- [ ] Input validation\n\n## Monitoring\n- [ ] Error tracking\n- [ ] Analytics\n- [ ] Uptime monitoring\n\n## Legal\n- [ ] Privacy Policy\n- [ ] Terms of Service`, tags: ['launch', 'production'] },
|
|
2322
|
-
{ domain: 'checklist', topic: 'security', update_type: 'checklist', title: 'Security Audit', content: `## Auth\n- [ ] Passwords hashed (bcrypt/argon2)\n- [ ] MFA available\n- [ ] Session timeout\n- [ ] Account lockout\n\n## Data\n- [ ] Encrypted at rest\n- [ ] TLS 1.3 in transit\n- [ ] Audit logs\n\n## Input\n- [ ] All input validated\n- [ ] SQL injection prevented\n- [ ] XSS prevented\n- [ ] CSRF tokens\n\n## Infra\n- [ ] Secrets in env vars\n- [ ] Deps updated\n- [ ] Vulnerability scanning`, tags: ['security', 'audit'] },
|
|
2323
|
-
{ domain: 'checklist', topic: 'accessibility', update_type: 'checklist', title: 'Accessibility (a11y)', content: `## Perceivable\n- [ ] Images have alt\n- [ ] Videos captioned\n- [ ] Contrast ≥ 4.5:1\n- [ ] Text resizable 200%\n\n## Operable\n- [ ] Keyboard accessible\n- [ ] Focus visible\n- [ ] Skip links\n- [ ] Touch targets ≥ 44px\n\n## Understandable\n- [ ] Language set\n- [ ] Form labels clear\n- [ ] Errors descriptive\n\n## Robust\n- [ ] Valid HTML\n- [ ] ARIA correct\n- [ ] Screen reader tested`, tags: ['accessibility', 'wcag'] },
|
|
2324
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2325
|
-
// 🔧 CODE PATTERNS
|
|
2326
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2327
|
-
{ domain: 'patterns', topic: 'react', update_type: 'code_pattern', title: 'useAsync Hook', content: `function useAsync<T>() {\n const [state, setState] = useState<{\n data: T | null;\n error: Error | null;\n isLoading: boolean;\n }>({ data: null, error: null, isLoading: false });\n\n const execute = useCallback(async (fn: () => Promise<T>) => {\n setState({ data: null, error: null, isLoading: true });\n try {\n const data = await fn();\n setState({ data, error: null, isLoading: false });\n } catch (error) {\n setState({ data: null, error: error as Error, isLoading: false });\n }\n }, []);\n\n return { ...state, execute };\n}`, tags: ['hooks', 'async'] },
|
|
2328
|
-
{ domain: 'patterns', topic: 'typescript', update_type: 'code_pattern', title: 'Type-Safe Fetch', content: `async function request<T>(\n method: 'GET' | 'POST' | 'PUT' | 'DELETE',\n path: string,\n body?: unknown\n): Promise<T> {\n const res = await fetch(path, {\n method,\n headers: { 'Content-Type': 'application/json' },\n body: body ? JSON.stringify(body) : undefined,\n });\n if (!res.ok) throw new Error(res.statusText);\n return res.json();\n}\n\nexport const api = {\n get: <T>(path: string) => request<T>('GET', path),\n post: <T>(path: string, body: unknown) => request<T>('POST', path, body),\n};`, tags: ['api', 'fetch'] },
|
|
2329
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2330
|
-
// 🚀 BOILERPLATES
|
|
2331
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2332
|
-
{ domain: 'boilerplate', topic: 'react', update_type: 'boilerplate', title: 'Component Template', content: `import { memo } from 'react';\nimport styles from './Name.module.css';\n\ninterface Props {\n children?: React.ReactNode;\n className?: string;\n}\n\nexport const Name = memo(function Name({ children, className }: Props) {\n return (\n <div className={\`\${styles.root} \${className || ''}\`}>\n {children}\n </div>\n );\n});`, tags: ['template', 'component'] },
|
|
2333
|
-
{ domain: 'boilerplate', topic: 'nextjs', update_type: 'boilerplate', title: 'API Route Template', content: `import { NextRequest, NextResponse } from 'next/server';\nimport { z } from 'zod';\n\nconst Schema = z.object({ name: z.string() });\n\nexport async function POST(req: NextRequest) {\n try {\n const body = Schema.parse(await req.json());\n return NextResponse.json({ id: '1', ...body }, { status: 201 });\n } catch (e) {\n if (e instanceof z.ZodError)\n return NextResponse.json({ error: e.errors }, { status: 400 });\n return NextResponse.json({ error: 'Server error' }, { status: 500 });\n }\n}`, tags: ['nextjs', 'api'] },
|
|
2334
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2335
|
-
// 🔄 WORKFLOWS
|
|
2336
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2337
|
-
{ domain: 'workflow', topic: 'feature', update_type: 'workflow', title: 'Feature Development', content: `1. PLAN\n- Write user story\n- Define acceptance criteria\n- Break into tasks\n\n2. IMPLEMENT\n- Create feature branch\n- Write tests first (TDD)\n- Small commits\n\n3. TEST\n- Unit tests\n- Integration tests\n- Manual QA\n\n4. REVIEW\n- Open PR with screenshots\n- Address feedback\n\n5. DEPLOY\n- Merge to main\n- Verify staging\n- Deploy prod\n- Monitor errors`, tags: ['workflow', 'process'] },
|
|
2338
|
-
{ domain: 'workflow', topic: 'debugging', update_type: 'workflow', title: 'Debugging Workflow', content: `1. REPRODUCE\n- Exact steps?\n- Environment?\n- Consistent?\n\n2. ISOLATE\n- When did it start?\n- Frontend or backend?\n- Specific route/component?\n\n3. EVIDENCE\n- Console errors\n- Network tab\n- Server logs\n- Error tracking\n\n4. HYPOTHESIZE\n- Top 3 likely causes\n\n5. TEST\n- Simplest first\n- Change ONE thing\n- Verify fix works\n\n6. PREVENT\n- Write regression test\n- Document root cause`, tags: ['debugging', 'process'] },
|
|
2339
|
-
{ domain: 'workflow', topic: 'pr', update_type: 'workflow', title: 'PR Best Practices', content: `TITLE: type(scope): description\n- feat(auth): add Google login\n- fix(cart): resolve quantity bug\n\nDESCRIPTION:\n## What\nBrief changes\n\n## Why\nLink to issue\n\n## Testing\n- [ ] Unit tests\n- [ ] Manual testing\n- [ ] Screenshots\n\nSIZE:\n- Ideal: < 400 lines\n- Max: < 1000 lines\n- Split large features`, tags: ['git', 'pr'] },
|
|
2340
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2341
|
-
// 💡 BEST PRACTICES
|
|
2342
|
-
// ═══════════════════════════════════════════════════════════════
|
|
2343
|
-
{ domain: 'react', topic: 'performance', update_type: 'best_practice', title: 'Use React.memo()', content: 'Wrap components with stable props but expensive render logic.', package_name: 'react', min_version: '16.6.0', tags: ['performance'] },
|
|
2344
|
-
{ domain: 'react', topic: 'hooks', update_type: 'best_practice', title: 'useCallback for handlers', content: 'Wrap callbacks passed to memoized children.', package_name: 'react', min_version: '16.8.0', tags: ['hooks'] },
|
|
2345
|
-
{ domain: 'react', topic: 'lists', update_type: 'best_practice', title: 'Stable keys, not indices', content: 'Keys should be unique IDs, not array indices.', package_name: 'react', min_version: '16.0.0', tags: ['lists'] },
|
|
2346
|
-
{ domain: 'react', topic: 'state', update_type: 'best_practice', title: 'Colocate state', content: 'Keep state in lowest common ancestor.', package_name: 'react', min_version: '16.0.0', tags: ['state'] },
|
|
2347
|
-
{ domain: 'typescript', topic: 'types', update_type: 'best_practice', title: 'type vs interface', content: 'type for unions, interface for extendable objects.', package_name: 'typescript', min_version: '4.0.0', tags: ['types'] },
|
|
2348
|
-
{ domain: 'typescript', topic: 'safety', update_type: 'best_practice', title: 'unknown over any', content: 'unknown is type-safe, must narrow before use.', package_name: 'typescript', min_version: '3.0.0', tags: ['safety'] },
|
|
2349
|
-
{ domain: 'typescript', topic: 'config', update_type: 'best_practice', title: 'Enable strict', content: 'Set strict: true in tsconfig.json.', package_name: 'typescript', min_version: '2.3.0', tags: ['config'] },
|
|
2350
|
-
{ domain: 'nextjs', topic: 'components', update_type: 'best_practice', title: 'Server Components default', content: 'Only add "use client" when needed.', package_name: 'next', min_version: '13.0.0', tags: ['server-components'] },
|
|
2351
|
-
{ domain: 'nextjs', topic: 'data', update_type: 'best_practice', title: 'Parallel fetching', content: 'Use Promise.all() for independent fetches.', package_name: 'next', min_version: '13.0.0', tags: ['data'] },
|
|
2352
|
-
{ domain: 'nextjs', topic: 'images', update_type: 'best_practice', title: 'Always next/image', content: 'Auto optimization, lazy loading, responsive.', package_name: 'next', min_version: '10.0.0', tags: ['images'] },
|
|
2353
|
-
{ domain: 'nodejs', topic: 'async', update_type: 'best_practice', title: 'async/await > callbacks', content: 'Cleaner code, better error handling.', package_name: 'node', min_version: '8.0.0', tags: ['async'] },
|
|
2354
|
-
{ domain: 'nodejs', topic: 'config', update_type: 'best_practice', title: 'Validate env vars', content: 'Use zod/joi at startup, fail fast.', package_name: 'node', min_version: '12.0.0', tags: ['config'] },
|
|
2355
|
-
{ domain: 'nodejs', topic: 'production', update_type: 'best_practice', title: 'Graceful shutdown', content: 'Handle SIGTERM/SIGINT properly.', package_name: 'node', min_version: '1.0.0', tags: ['production'] },
|
|
2356
|
-
{ domain: 'css', topic: 'variables', update_type: 'best_practice', title: 'CSS custom properties', content: 'Enable theming and runtime changes.', package_name: null, min_version: null, tags: ['variables'] },
|
|
2357
|
-
{ domain: 'css', topic: 'units', update_type: 'best_practice', title: 'rem over px', content: 'rem scales with user font preferences.', package_name: null, min_version: null, tags: ['units'] },
|
|
2358
|
-
{ domain: 'git', topic: 'commits', update_type: 'best_practice', title: 'Atomic commits', content: 'One logical change per commit.', package_name: null, min_version: null, tags: ['commits'] },
|
|
2359
|
-
{ domain: 'git', topic: 'commits', update_type: 'best_practice', title: 'Conventional commits', content: 'feat:, fix:, docs: for changelogs.', package_name: null, min_version: null, tags: ['conventional'] },
|
|
2360
|
-
{ domain: 'supabase', topic: 'security', update_type: 'best_practice', title: 'Always enable RLS', content: 'Row Level Security protects your data.', package_name: '@supabase/supabase-js', min_version: '2.0.0', tags: ['rls'] },
|
|
2361
|
-
];
|
|
2291
|
+
// Uses KNOWLEDGE_BASE imported from ./knowledge-base.ts
|
|
2292
|
+
// Add new items there and run knowledge_seed to sync!
|
|
2362
2293
|
// Sync to Supabase
|
|
2363
2294
|
let inserted = 0, updated = 0, skipped = 0;
|
|
2364
|
-
for (const item of KNOWLEDGE_BASE) {
|
|
2295
|
+
for (const item of knowledge_base_js_1.KNOWLEDGE_BASE) {
|
|
2365
2296
|
try {
|
|
2366
2297
|
// Check if exists by domain + title
|
|
2367
2298
|
const checkResult = await apiRequest('GET', `/knowledge?domain=${encodeURIComponent(item.domain)}&title=${encodeURIComponent(item.title)}`);
|
|
@@ -2408,16 +2339,16 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
2408
2339
|
}
|
|
2409
2340
|
}
|
|
2410
2341
|
const categories = {
|
|
2411
|
-
prompts: KNOWLEDGE_BASE.filter(k => k.update_type === 'prompt').length,
|
|
2412
|
-
design: KNOWLEDGE_BASE.filter(k => k.update_type === 'design_system').length,
|
|
2413
|
-
architecture: KNOWLEDGE_BASE.filter(k => k.update_type === 'architecture').length,
|
|
2414
|
-
checklists: KNOWLEDGE_BASE.filter(k => k.update_type === 'checklist').length,
|
|
2415
|
-
patterns: KNOWLEDGE_BASE.filter(k => k.update_type === 'code_pattern').length,
|
|
2416
|
-
boilerplates: KNOWLEDGE_BASE.filter(k => k.update_type === 'boilerplate').length,
|
|
2417
|
-
workflows: KNOWLEDGE_BASE.filter(k => k.update_type === 'workflow').length,
|
|
2418
|
-
best_practices: KNOWLEDGE_BASE.filter(k => k.update_type === 'best_practice').length,
|
|
2342
|
+
prompts: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'prompt').length,
|
|
2343
|
+
design: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'design_system').length,
|
|
2344
|
+
architecture: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'architecture').length,
|
|
2345
|
+
checklists: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'checklist').length,
|
|
2346
|
+
patterns: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'code_pattern').length,
|
|
2347
|
+
boilerplates: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'boilerplate').length,
|
|
2348
|
+
workflows: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'workflow').length,
|
|
2349
|
+
best_practices: knowledge_base_js_1.KNOWLEDGE_BASE.filter(k => k.update_type === 'best_practice').length,
|
|
2419
2350
|
};
|
|
2420
|
-
return { content: [{ type: 'text', text: `🌱 Knowledge Synced!\n\n✅ Inserted: ${inserted}\n⏭️ Skipped (exists): ${skipped}\n📊 Total: ${KNOWLEDGE_BASE.length}\n\n📚 Categories:\n- 🎯 Prompts: ${categories.prompts}\n- 🎨 Design Systems: ${categories.design}\n- 📁 Architecture: ${categories.architecture}\n- ✅ Checklists: ${categories.checklists}\n- 🔧 Code Patterns: ${categories.patterns}\n- 🚀 Boilerplates: ${categories.boilerplates}\n- 🔄 Workflows: ${categories.workflows}\n- 💡 Best Practices: ${categories.best_practices}\n\nUse knowledge_check to fetch any category!` }] };
|
|
2351
|
+
return { content: [{ type: 'text', text: `🌱 Knowledge Synced!\n\n✅ Inserted: ${inserted}\n⏭️ Skipped (exists): ${skipped}\n📊 Total: ${knowledge_base_js_1.KNOWLEDGE_BASE.length}\n\n📚 Categories:\n- 🎯 Prompts: ${categories.prompts}\n- 🎨 Design Systems: ${categories.design}\n- 📁 Architecture: ${categories.architecture}\n- ✅ Checklists: ${categories.checklists}\n- 🔧 Code Patterns: ${categories.patterns}\n- 🚀 Boilerplates: ${categories.boilerplates}\n- 🔄 Workflows: ${categories.workflows}\n- 💡 Best Practices: ${categories.best_practices}\n\nUse knowledge_check to fetch any category!` }] };
|
|
2421
2352
|
}
|
|
2422
2353
|
// ═══════════════════════════════════════
|
|
2423
2354
|
// ERROR HANDLERS
|