vibefast-cli 1.2.1 → 1.3.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.
- package/README.md +30 -95
- package/dist/__tests__/recipes.test.js +94 -91
- package/dist/__tests__/recipes.test.js.map +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +301 -125
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/checklist.d.ts.map +1 -1
- package/dist/commands/checklist.js +85 -44
- package/dist/commands/checklist.js.map +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +13 -4
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +118 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +3 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +202 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +61 -3
- package/dist/commands/remove.js.map +1 -1
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +20 -18
- package/dist/core/auth.js.map +1 -1
- package/dist/core/codemod.d.ts +33 -0
- package/dist/core/codemod.d.ts.map +1 -1
- package/dist/core/codemod.js +116 -0
- package/dist/core/codemod.js.map +1 -1
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +24 -7
- package/dist/core/detect.js.map +1 -1
- package/dist/core/journal.d.ts +1 -0
- package/dist/core/journal.d.ts.map +1 -1
- package/dist/core/journal.js.map +1 -1
- package/dist/core/recipes.d.ts.map +1 -1
- package/dist/core/recipes.js +25 -7
- package/dist/core/recipes.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +50 -0
- package/docs/commands.md +78 -0
- package/docs/contributing.md +27 -0
- package/docs/quickstart.md +50 -0
- package/docs/recipes.md +57 -0
- package/docs/troubleshooting.md +31 -0
- package/package.json +2 -2
- package/recipes/0/apps/native/src/components/advanced-ui/timeline/demo.tsx +445 -0
- package/recipes/0/apps/native/src/components/advanced-ui/timeline/timeline-view.tsx +355 -0
- package/recipes/0/apps/native/src/components/advanced-ui/timeline/types.ts +31 -0
- package/recipes/0/recipe.json +18 -0
- package/recipes/animated-chip/apps/native/src/components/advanced-ui/chip/demo.tsx +2 -1
- package/recipes/animated-chip/recipe.json +5 -2
- package/recipes/animated-chip-native@latest.zip +0 -0
- package/recipes/animated-chip@latest.zip +0 -0
- package/recipes/animated-switch/apps/native/src/components/advanced-ui/switch/demo.tsx +1 -1
- package/recipes/animated-switch/recipe.json +5 -2
- package/recipes/animated-switch-native@latest.zip +0 -0
- package/recipes/animated-switch@latest.zip +0 -0
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/components/audio-recorder.tsx +2 -1
- package/recipes/audio-recorder/apps/native/src/features/audio-recorder/demo/with-recording-list-demo.tsx +2 -2
- package/recipes/audio-recorder/recipe.json +7 -2
- package/recipes/audio-recorder-native@latest.zip +0 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-recorder.tsx +2 -1
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/with-recording-list-demo.tsx +2 -1
- package/recipes/audio-recorder-supabase/recipe.json +12 -16
- package/recipes/audio-recorder-supabase-native@latest.zip +0 -0
- package/recipes/audio-recorder-supabase@latest.zip +0 -0
- package/recipes/audio-recorder@latest.zip +0 -0
- package/recipes/charts/apps/native/src/app/charts/index.tsx +3 -0
- package/recipes/charts/apps/native/src/features/charts/components/bar-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/candlestick-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/column-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/doughnut-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/line-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/radar-chart.tsx +3 -1
- package/recipes/charts/apps/native/src/features/charts/components/stacked-bar-chart.tsx +3 -1
- package/recipes/charts/recipe.json +13 -4
- package/recipes/charts-native@latest.zip +0 -0
- package/recipes/charts@latest.zip +0 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-markdown.tsx +86 -86
- package/recipes/chatbot/apps/native/src/features/chatbot/components/markdown/code-block.tsx +4 -4
- package/recipes/chatbot/recipe.json +3 -40
- package/recipes/chatbot-native@latest.zip +0 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-markdown.tsx +4 -1
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/code-block.tsx +86 -53
- package/recipes/chatbot-supabase/recipe.json +3 -42
- package/recipes/chatbot-supabase-native@latest.zip +0 -0
- package/recipes/chatbot-supabase@latest.zip +0 -0
- package/recipes/chatbot@latest.zip +0 -0
- package/recipes/glowing-button/recipe.json +6 -2
- package/recipes/glowing-button-native@latest.zip +0 -0
- package/recipes/glowing-button@latest.zip +0 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/_layout.tsx +5 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/analysis-options.tsx +50 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/camera.tsx +2 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/index.tsx +50 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/loading.tsx +50 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/results.tsx +2 -0
- package/recipes/image-analysis/apps/native/src/app/analysis/[type]/trait-details.tsx +3 -0
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/app/analysis-options-screen.tsx +2 -2
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/app/camera.tsx +72 -65
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/app/image-capture-screen.tsx +65 -47
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/app/loading-screen.tsx +43 -2
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/app/loading.tsx +34 -1
- package/recipes/image-analysis/apps/native/src/features/image-analyzer/hooks/use-image-analysis.ts +83 -2
- package/recipes/image-analysis/recipe.json +11 -19
- package/recipes/image-analysis-native@latest.zip +0 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/_layout.tsx +5 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/analysis-options.tsx +50 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/camera.tsx +2 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/index.tsx +50 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/loading.tsx +50 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/results.tsx +2 -0
- package/recipes/image-analysis-supabase/apps/native/src/app/analysis/[type]/trait-details.tsx +3 -0
- package/recipes/image-analysis-supabase/recipe.json +10 -37
- package/recipes/image-analysis-supabase-native@latest.zip +0 -0
- package/recipes/image-analysis-supabase@latest.zip +0 -0
- package/recipes/image-analysis@latest.zip +0 -0
- package/recipes/image-analyzer/apps/native/src/app/(root)/(protected)/image-analyzer/index.tsx +2 -0
- package/recipes/image-generator/apps/native/src/app/image-generator/gallery.tsx +3 -0
- package/recipes/image-generator/apps/native/src/app/image-generator/index.tsx +3 -0
- package/recipes/image-generator/recipe.json +8 -18
- package/recipes/image-generator-native@latest.zip +0 -0
- package/recipes/image-generator-supabase/recipe.json +6 -35
- package/recipes/image-generator-supabase-native@latest.zip +0 -0
- package/recipes/image-generator-supabase@latest.zip +0 -0
- package/recipes/image-generator@latest.zip +0 -0
- package/recipes/ios-widget/recipe.json +18 -119
- package/recipes/ios-widget-native@latest.zip +0 -0
- package/recipes/ios-widget@latest.zip +0 -0
- package/recipes/number-stepper/apps/native/src/components/advanced-ui/stepper/demo.tsx +1 -1
- package/recipes/number-stepper/recipe.json +5 -2
- package/recipes/number-stepper-native@latest.zip +0 -0
- package/recipes/number-stepper@latest.zip +0 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/interactive-onboarding.tsx +11 -18
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/ai-tone-step.tsx +5 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/currency-step.tsx +9 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-ai-step.tsx +8 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-chatbot-step.tsx +6 -5
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-manual-step.tsx +4 -3
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-scan-step.tsx +6 -5
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/main-reason-step.tsx +5 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/notification-step.tsx +7 -6
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/overspend-step.tsx +5 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/personalizing-step.tsx +8 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/rating-step.tsx +6 -5
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/reminder-step.tsx +5 -6
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/safety-step.tsx +5 -4
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/struggle-step.tsx +5 -7
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/welcome-step.tsx +7 -6
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/ui/onboarding-header.tsx +4 -3
- package/recipes/onboarding/recipe.json +9 -6
- package/recipes/onboarding-native@latest.zip +0 -0
- package/recipes/onboarding@latest.zip +0 -0
- package/recipes/payments/apps/native/src/app/paywall/index.tsx +74 -0
- package/recipes/payments/apps/native/src/app/paywall/local.tsx +25 -0
- package/recipes/payments/apps/native/src/app/paywall/remote.tsx +23 -0
- package/recipes/payments/packages/backend/convex/payments.ts +21 -3
- package/recipes/payments/recipe.json +14 -34
- package/recipes/payments-native@latest.zip +0 -0
- package/recipes/payments-supabase/apps/native/src/app/paywall/index.tsx +74 -0
- package/recipes/payments-supabase/apps/native/src/app/paywall/local.tsx +25 -0
- package/recipes/payments-supabase/apps/native/src/app/paywall/remote.tsx +23 -0
- package/recipes/payments-supabase/recipe.json +16 -23
- package/recipes/payments-supabase-native@latest.zip +0 -0
- package/recipes/payments-supabase@latest.zip +0 -0
- package/recipes/payments@latest.zip +0 -0
- package/recipes/posthog/apps/native/src/components/analytics/navigation-tracker.tsx +14 -0
- package/recipes/posthog/apps/native/src/lib/hooks/use-navigation-analytics.ts +44 -0
- package/recipes/posthog/apps/native/src/providers/posthog-provider.tsx +51 -0
- package/recipes/posthog/recipe.json +60 -0
- package/recipes/posthog-native@latest.zip +0 -0
- package/recipes/progress-circle/apps/native/src/components/advanced-ui/progress-bars/progress-circle-page.tsx +1 -1
- package/recipes/progress-circle/recipe.json +5 -2
- package/recipes/progress-circle-native@latest.zip +0 -0
- package/recipes/progress-circle@latest.zip +0 -0
- package/recipes/quiz/apps/native/src/app/quiz/index.tsx +47 -0
- package/recipes/quiz/recipe.json +9 -6
- package/recipes/quiz-native@latest.zip +0 -0
- package/recipes/quiz@latest.zip +0 -0
- package/recipes/screen-kits/apps/native/src/app/screen-kits/_layout.tsx +12 -0
- package/recipes/screen-kits/apps/native/src/app/screen-kits/index.tsx +114 -0
- package/recipes/screen-kits/apps/native/src/features/screen-kits/index.ts +1 -0
- package/recipes/screen-kits/apps/native/src/features/screen-kits/types.ts +28 -0
- package/recipes/screen-kits/recipe.json +26 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/_layout.tsx +12 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/home.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/index.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/lesson-complete.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/lesson-fail.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/lesson.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/app/screen-kits/duolingo/skill-tree.tsx +5 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/components/duo-button.tsx +174 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/components/skill-button.tsx +186 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/components/xp-header.tsx +115 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/constants.ts +89 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/index.ts +3 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/screens/home-screen.tsx +225 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/screens/lesson-complete-screen.tsx +485 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/screens/lesson-fail-screen.tsx +105 -0
- package/recipes/screen-kits-duolingo/apps/native/src/features/screen-kits/duolingo/screens/lesson-screen.tsx +384 -0
- package/recipes/screen-kits-duolingo/recipe.json +58 -0
- package/recipes/screen-kits-duolingo-native@latest.zip +0 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/_layout.tsx +45 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/asset-detail.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/notifications.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/receive.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/send.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/swap.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/app/screen-kits/finance/wallet.tsx +3 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/components/ActionButtons.tsx +78 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/components/AssetRow.tsx +94 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/components/BalanceCard.tsx +118 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/constants.ts +85 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/asset-detail.tsx +378 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/notifications.tsx +210 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/receive-modal.tsx +317 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/send-modal.tsx +420 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/swap-modal.tsx +363 -0
- package/recipes/screen-kits-finance/apps/native/src/features/screen-kits/finance/screens/wallet-dashboard.tsx +281 -0
- package/recipes/screen-kits-finance/recipe.json +46 -0
- package/recipes/screen-kits-finance-native@latest.zip +0 -0
- package/recipes/screen-kits-fitness/apps/native/assets/sounds/timer-beep.wav +0 -0
- package/recipes/screen-kits-fitness/apps/native/src/app/screen-kits/fitness/_layout.tsx +10 -0
- package/recipes/screen-kits-fitness/apps/native/src/app/screen-kits/fitness/index.tsx +6 -0
- package/recipes/screen-kits-fitness/apps/native/src/app/screen-kits/fitness/timer.tsx +3 -0
- package/recipes/screen-kits-fitness/apps/native/src/app/screen-kits/fitness/workout.tsx +3 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/components/timer-components.tsx +500 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/components/timer-settings-modal.tsx +352 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/components/workout-card.tsx +105 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/constants.ts +189 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/hooks/use-timer.ts +307 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/index.ts +1 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/screens/timer-screen.tsx +278 -0
- package/recipes/screen-kits-fitness/apps/native/src/features/screen-kits/fitness/screens/workout-dashboard.tsx +350 -0
- package/recipes/screen-kits-fitness/recipe.json +63 -0
- package/recipes/screen-kits-fitness-native@latest.zip +0 -0
- package/recipes/screen-kits-habits/apps/native/src/app/screen-kits/productivity/habits.tsx +1 -0
- package/recipes/screen-kits-habits/apps/native/src/app/screen-kits/productivity/kanban.tsx +1 -0
- package/recipes/screen-kits-habits/apps/native/src/app/screen-kits/productivity/routes.ts +4 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/components/AddTaskModal.tsx +246 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/components/DraggableTaskCard.tsx +92 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/components/KanbanColumn.tsx +238 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/components/TaskCard.tsx +144 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/components/add-habit-modal.tsx +271 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/constants.ts +295 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/kanban-utils.ts +62 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/screens/habit-tracker.tsx +1160 -0
- package/recipes/screen-kits-habits/apps/native/src/features/screen-kits/productivity/screens/kanban-board.tsx +432 -0
- package/recipes/screen-kits-habits/recipe.json +52 -0
- package/recipes/screen-kits-habits-native@latest.zip +0 -0
- package/recipes/screen-kits-native@latest.zip +0 -0
- package/recipes/sentry/apps/native/src/providers/sentry-provider.tsx +64 -0
- package/recipes/sentry/recipe.json +39 -0
- package/recipes/sentry-native@latest.zip +0 -0
- package/recipes/swipe-slider/apps/native/src/components/advanced-ui/sliders/swipe-slider-page.tsx +1 -1
- package/recipes/swipe-slider/recipe.json +5 -2
- package/recipes/swipe-slider-native@latest.zip +0 -0
- package/recipes/swipe-slider@latest.zip +0 -0
- package/recipes/timeline/apps/native/src/components/advanced-ui/timeline/demo.tsx +2 -1
- package/recipes/timeline/recipe.json +5 -2
- package/recipes/timeline-native@latest.zip +0 -0
- package/recipes/timeline@latest.zip +0 -0
- package/recipes/tracker-app/apps/native/src/app/tracker-app/index.tsx +1 -0
- package/recipes/tracker-app/recipe.json +10 -7
- package/recipes/tracker-app-native@latest.zip +0 -0
- package/recipes/tracker-app@latest.zip +0 -0
- package/recipes/upload-all.sh +8 -31
- package/recipes/voice-bot/apps/native/src/app/voice-bot/index.tsx +56 -0
- package/recipes/voice-bot/recipe.json +31 -7
- package/recipes/voice-bot-native@latest.zip +0 -0
- package/recipes/voice-bot@latest.zip +0 -0
- package/recipes/wake-word/apps/native/src/app/{(root)/(protected)/test-wake-word.tsx → test-wake-word.tsx} +43 -4
- package/recipes/wake-word/recipe.json +16 -26
- package/recipes/wake-word-native@latest.zip +0 -0
- package/recipes/wake-word@latest.zip +0 -0
- package/scripts/create-advanced-ui-recipes.sh +46 -19
- package/scripts/create-recipes.mjs +471 -117
- package/scripts/package-recipes.mjs +76 -0
- package/scripts/publish-all.sh +6 -2
- package/CHANGELOG.md +0 -198
- package/docs/archive/AUTO-DETECT-DEPS.md +0 -607
- package/docs/archive/FINAL-PACKAGE-STRATEGY.md +0 -583
- package/docs/archive/FINAL-SIMPLE-PLAN.md +0 -487
- package/docs/archive/FINAL-STATUS.md +0 -144
- package/docs/archive/FLOW-DIAGRAM.md +0 -1629
- package/docs/archive/GOTCHAS-AND-RISKS.md +0 -801
- package/docs/archive/IMPLEMENTATION-PLAN.md +0 -1360
- package/docs/archive/PLAN.md +0 -453
- package/docs/archive/PRODUCTION-READINESS.md +0 -684
- package/docs/archive/PRODUCTION-TEST-RESULTS.md +0 -465
- package/docs/archive/SIMPLIFIED-PLAN.md +0 -578
- package/docs/archive/STATUS.md +0 -199
- package/docs/archive/SUCCESS.md +0 -259
- package/docs/archive/TEST-SUMMARY.md +0 -261
- package/docs/archive/TESTING-CHECKLIST.md +0 -450
- package/docs/archive/USER-MODIFICATIONS.md +0 -448
- package/docs/decisions.md +0 -55
- package/docs/manual-testing.md +0 -91
- package/docs/next-steps.md +0 -12
- package/recipes/README.md +0 -156
- package/recipes/audio-recorder-supabase/packages/backend/src/services/recordings.ts +0 -369
- package/recipes/chatbot/apps/native/src/api-client/chatbot.ts +0 -83
- package/recipes/chatbot/packages/backend/convex/agents.ts +0 -115
- package/recipes/chatbot/packages/backend/convex/tools/index.ts +0 -18
- package/recipes/chatbot/packages/backend/convex/tools/knowledgeRetrieval.ts +0 -97
- package/recipes/chatbot/packages/backend/convex/tools/tavilySearch.ts +0 -83
- package/recipes/chatbot/packages/backend/convex/tools/userProfile.ts +0 -72
- package/recipes/chatbot-supabase/apps/native/src/api-client/supabase/chatbot.ts +0 -515
- package/recipes/chatbot-supabase/packages/backend/src/services/conversations.ts +0 -243
- package/recipes/chatbot-supabase/packages/backend/src/services/messages.ts +0 -327
- package/recipes/image-analysis/apps/native/src/api-client/image-analyzer.ts +0 -62
- package/recipes/image-analysis-supabase/packages/backend/src/services/image-analyses.ts +0 -132
- package/recipes/image-generator/apps/native/src/api-client/image-generator.ts +0 -34
- package/recipes/payments/apps/native/src/api-client/payments.ts +0 -44
- package/recipes/payments-supabase/packages/backend/src/services/payments.ts +0 -201
- package/recipes/posthog.json +0 -47
- package/recipes/revenuecat.json +0 -43
- package/recipes/sentry.json +0 -47
- package/recipes/wake-word/apps/native/assets/vosk-model/README.md +0 -103
- package/recipes/wake-word/apps/native/scripts/download-vosk-model.mjs +0 -127
- /package/recipes/{audio-recorder/apps/native/src/app/(root)/(protected) → audio-recorder-supabase/apps/native/src/app}/audio-recorder/index.tsx +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/AppIntent.swift +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-20x20@1x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-20x20@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-20x20@3x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-29x29@1x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-29x29@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-29x29@3x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-40x40@1x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-40x40@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-40x40@3x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-60x60@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-60x60@3x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-76x76@1x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-76x76@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/App-Icon-83.5x83.5@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/CalorieTrackerWidget.swift +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/HabitTrackerWidget.swift +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/Info.plist +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/WidgetLiveActivity.swift +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/expo-target.config.js +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/generated.entitlements +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/index.swift +0 -0
- /package/recipes/ios-widget/{targets → apps/native/targets}/widget/widgets.swift +0 -0
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
2
|
-
import { openai } from '@ai-sdk/openai';
|
|
3
|
-
import { Agent } from '@convex-dev/agent';
|
|
4
|
-
|
|
5
|
-
import { components } from './_generated/api';
|
|
6
|
-
import {
|
|
7
|
-
knowledgeRetrievalTool,
|
|
8
|
-
tavilySearchTool,
|
|
9
|
-
userProfileTool,
|
|
10
|
-
} from './tools';
|
|
11
|
-
|
|
12
|
-
const google = createGoogleGenerativeAI();
|
|
13
|
-
|
|
14
|
-
type ModelProvider = 'openai' | 'google';
|
|
15
|
-
|
|
16
|
-
type ModelResolver = () => {
|
|
17
|
-
model: any;
|
|
18
|
-
provider: ModelProvider;
|
|
19
|
-
modelId: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const PROVIDER_CHAT_FACTORIES: Record<
|
|
23
|
-
ModelProvider,
|
|
24
|
-
(modelId: string) => unknown
|
|
25
|
-
> = {
|
|
26
|
-
openai: (modelId) => openai.chat(modelId),
|
|
27
|
-
google: (modelId) => google.chat(modelId),
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const MODEL_CONFIGS = {
|
|
31
|
-
'gpt-4.1-nano': { provider: 'openai', modelId: 'gpt-4.1-nano' },
|
|
32
|
-
'gpt-5': { provider: 'openai', modelId: 'gpt-5' },
|
|
33
|
-
'gpt-5-nano': { provider: 'openai', modelId: 'gpt-5-nano' },
|
|
34
|
-
'gpt-4o-mini': { provider: 'openai', modelId: 'gpt-4o-mini' },
|
|
35
|
-
'gpt-4o': { provider: 'openai', modelId: 'gpt-4o' },
|
|
36
|
-
'gemini-2.0-flash': {
|
|
37
|
-
provider: 'google',
|
|
38
|
-
modelId: 'models/gemini-2.0-flash',
|
|
39
|
-
},
|
|
40
|
-
'gemini-1.5-flash': {
|
|
41
|
-
provider: 'google',
|
|
42
|
-
modelId: 'models/gemini-1.5-flash',
|
|
43
|
-
},
|
|
44
|
-
'gemini-1.5-pro': { provider: 'google', modelId: 'models/gemini-1.5-pro' },
|
|
45
|
-
'gemini-2.5-flash': {
|
|
46
|
-
provider: 'google',
|
|
47
|
-
modelId: 'models/gemini-2.5-flash-preview-05-20',
|
|
48
|
-
},
|
|
49
|
-
'gemini-2.5-pro': {
|
|
50
|
-
provider: 'google',
|
|
51
|
-
modelId: 'models/gemini-2.5-pro-preview-06-05',
|
|
52
|
-
},
|
|
53
|
-
} satisfies Record<string, { provider: ModelProvider; modelId: string }>;
|
|
54
|
-
|
|
55
|
-
const MODEL_RESOLVERS = Object.fromEntries(
|
|
56
|
-
Object.entries(MODEL_CONFIGS).map(([key, config]) => [
|
|
57
|
-
key,
|
|
58
|
-
() => ({
|
|
59
|
-
model: PROVIDER_CHAT_FACTORIES[config.provider](config.modelId),
|
|
60
|
-
provider: config.provider,
|
|
61
|
-
modelId: config.modelId,
|
|
62
|
-
}),
|
|
63
|
-
]),
|
|
64
|
-
) as Record<string, ModelResolver>;
|
|
65
|
-
|
|
66
|
-
const DEFAULT_MODEL: keyof typeof MODEL_CONFIGS = 'gpt-4.1-nano';
|
|
67
|
-
|
|
68
|
-
export function resolveChatModel(preferredModel?: string) {
|
|
69
|
-
const modelKey =
|
|
70
|
-
preferredModel && MODEL_RESOLVERS[preferredModel]
|
|
71
|
-
? preferredModel
|
|
72
|
-
: DEFAULT_MODEL;
|
|
73
|
-
|
|
74
|
-
const resolver = MODEL_RESOLVERS[modelKey] ?? MODEL_RESOLVERS[DEFAULT_MODEL];
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
return resolver();
|
|
78
|
-
} catch (error) {
|
|
79
|
-
if (modelKey !== DEFAULT_MODEL) {
|
|
80
|
-
return MODEL_RESOLVERS[DEFAULT_MODEL]();
|
|
81
|
-
}
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const agent: Agent = new Agent(components.agent, {
|
|
87
|
-
name: 'VibeFast Assistant',
|
|
88
|
-
languageModel: MODEL_RESOLVERS[DEFAULT_MODEL]().model as any,
|
|
89
|
-
instructions: `
|
|
90
|
-
You are VibeFast, a proactive mobile AI assistant. Produce concise, friendly responses with clear structure.
|
|
91
|
-
|
|
92
|
-
- Use markdown for readability (lists, bold keywords, inline code where appropriate).
|
|
93
|
-
- When a question depends on current or niche information, call the tavilySearch tool first and cite the findings.
|
|
94
|
-
- When the user asks about their account, credits, or profile details, call the userProfile tool before answering.
|
|
95
|
-
- When the user references uploaded files or knowledge base material, call the knowledgeRetrieval tool with relevant filters to ground your answer.
|
|
96
|
-
- For image attachments, describe what you see before reasoning about it.
|
|
97
|
-
- If a user asks for something you cannot do, gracefully explain the limitation and offer an alternative.
|
|
98
|
-
- Keep responses focused on the user's goal; avoid unnecessary chatter.
|
|
99
|
-
`.trim(),
|
|
100
|
-
tools: {
|
|
101
|
-
knowledgeRetrieval: knowledgeRetrievalTool,
|
|
102
|
-
tavilySearch: tavilySearchTool,
|
|
103
|
-
userProfile: userProfileTool,
|
|
104
|
-
},
|
|
105
|
-
maxSteps: 6,
|
|
106
|
-
contextOptions: {
|
|
107
|
-
recentMessages: 50,
|
|
108
|
-
},
|
|
109
|
-
storageOptions: {
|
|
110
|
-
saveMessages: 'promptAndOutput',
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
export const SUPPORTED_MODEL_KEYS = Object.keys(MODEL_RESOLVERS);
|
|
115
|
-
export { DEFAULT_MODEL };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Central export for all available AI tools
|
|
2
|
-
// This file makes it easy to add more tools in the future
|
|
3
|
-
|
|
4
|
-
import { knowledgeRetrievalTool } from './knowledgeRetrieval';
|
|
5
|
-
import { tavilySearchTool } from './tavilySearch';
|
|
6
|
-
import { userProfileTool } from './userProfile';
|
|
7
|
-
|
|
8
|
-
// Export all tools in a single object for easy access
|
|
9
|
-
export const allTools = {
|
|
10
|
-
knowledgeRetrieval: knowledgeRetrievalTool,
|
|
11
|
-
tavilySearch: tavilySearchTool,
|
|
12
|
-
userProfile: userProfileTool,
|
|
13
|
-
} as const;
|
|
14
|
-
|
|
15
|
-
// Export individual tools for specific use cases
|
|
16
|
-
export { knowledgeRetrievalTool } from './knowledgeRetrieval';
|
|
17
|
-
export { tavilySearchTool } from './tavilySearch';
|
|
18
|
-
export { userProfileTool } from './userProfile';
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { createTool } from '@convex-dev/agent';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
import { api } from '../_generated/api';
|
|
6
|
-
|
|
7
|
-
export const knowledgeRetrievalTool = createTool({
|
|
8
|
-
description:
|
|
9
|
-
'Search uploaded knowledge files and synthesize an answer with citations.',
|
|
10
|
-
args: z.object({
|
|
11
|
-
query: z.string().min(1).describe('Question or topic to search.'),
|
|
12
|
-
scope: z
|
|
13
|
-
.enum(['personal', 'global'])
|
|
14
|
-
.default('personal')
|
|
15
|
-
.describe(
|
|
16
|
-
'Whether to search personal uploads or the shared global knowledge base.',
|
|
17
|
-
),
|
|
18
|
-
filter: z
|
|
19
|
-
.union([
|
|
20
|
-
z.object({
|
|
21
|
-
type: z.literal('filename'),
|
|
22
|
-
value: z.string(),
|
|
23
|
-
}),
|
|
24
|
-
z.object({
|
|
25
|
-
type: z.literal('category'),
|
|
26
|
-
value: z.union([z.string(), z.null()]),
|
|
27
|
-
}),
|
|
28
|
-
])
|
|
29
|
-
.optional()
|
|
30
|
-
.describe('Optional filter to narrow search by filename or category.'),
|
|
31
|
-
limit: z
|
|
32
|
-
.number()
|
|
33
|
-
.min(1)
|
|
34
|
-
.max(20)
|
|
35
|
-
.default(10)
|
|
36
|
-
.describe('Maximum number of chunks to retrieve.'),
|
|
37
|
-
chunkContext: z
|
|
38
|
-
.object({
|
|
39
|
-
before: z.number().min(0).max(5).default(1),
|
|
40
|
-
after: z.number().min(0).max(5).default(1),
|
|
41
|
-
})
|
|
42
|
-
.default({ before: 1, after: 1 })
|
|
43
|
-
.describe('Number of neighboring chunks to include around matches.'),
|
|
44
|
-
}),
|
|
45
|
-
handler: async (ctx, args): Promise<string> => {
|
|
46
|
-
const prompt = args.query.trim();
|
|
47
|
-
if (!prompt) {
|
|
48
|
-
return 'Please provide a non-empty question for knowledge retrieval.';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const filter =
|
|
52
|
-
args.filter?.type === 'filename'
|
|
53
|
-
? {
|
|
54
|
-
name: 'filename' as const,
|
|
55
|
-
value: args.filter.value,
|
|
56
|
-
}
|
|
57
|
-
: args.filter?.type === 'category'
|
|
58
|
-
? {
|
|
59
|
-
name: 'category' as const,
|
|
60
|
-
value: args.filter.value,
|
|
61
|
-
}
|
|
62
|
-
: undefined;
|
|
63
|
-
|
|
64
|
-
const chunkContext = {
|
|
65
|
-
before: args.chunkContext?.before ?? 1,
|
|
66
|
-
after: args.chunkContext?.after ?? 1,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const result = (await (ctx as any).runAction(
|
|
70
|
-
(api as any).ragKnowledge.askKnowledge,
|
|
71
|
-
{
|
|
72
|
-
prompt,
|
|
73
|
-
globalNamespace: args.scope === 'global',
|
|
74
|
-
limit: args.limit,
|
|
75
|
-
chunkContext,
|
|
76
|
-
filter,
|
|
77
|
-
} as any,
|
|
78
|
-
)) as {
|
|
79
|
-
answer: string;
|
|
80
|
-
files?: { filename: string; url: string | null }[];
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
if (!result.files || result.files.length === 0) {
|
|
84
|
-
return `${result.answer}\n\n_No supporting files were located._`;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const references = result.files
|
|
88
|
-
.map((file: { filename: string; url: string | null }, index: number) => {
|
|
89
|
-
const label = `[${index + 1}] ${file.filename}`;
|
|
90
|
-
return file.url ? `${label} — ${file.url}` : label;
|
|
91
|
-
})
|
|
92
|
-
.join('\n');
|
|
93
|
-
|
|
94
|
-
return `${result.answer}\n\n**References**\n${references}`;
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
// @ts-nocheck
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { createTool } from '@convex-dev/agent';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
import { internal } from '../_generated/api';
|
|
5
|
-
import type { Id } from '../_generated/dataModel';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Tavily search tool exposed to the Convex agent runtime.
|
|
9
|
-
* Uses the direct HTTP API to stay compatible with the Convex execution environment.
|
|
10
|
-
*/
|
|
11
|
-
export const tavilySearchTool = createTool({
|
|
12
|
-
description:
|
|
13
|
-
'Search the web with Tavily to retrieve up-to-date information. Best for news, recent events, or factual lookups.',
|
|
14
|
-
args: z.object({
|
|
15
|
-
query: z.string().describe('The query to send to Tavily.'),
|
|
16
|
-
}),
|
|
17
|
-
handler: async (ctx, { query }) => {
|
|
18
|
-
const userId = ctx.userId as Id<'users'> | undefined;
|
|
19
|
-
if (userId) {
|
|
20
|
-
await ctx.runMutation(internal.rateLimit.enforceTool, { userId });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const apiKey = process.env.TAVILY_API_KEY;
|
|
24
|
-
if (!apiKey) {
|
|
25
|
-
return 'Tavily search is unavailable because TAVILY_API_KEY is not configured.';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
const response = await fetch('https://api.tavily.com/search', {
|
|
30
|
-
method: 'POST',
|
|
31
|
-
headers: {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
Authorization: `Bearer ${apiKey}`,
|
|
34
|
-
},
|
|
35
|
-
body: JSON.stringify({
|
|
36
|
-
query,
|
|
37
|
-
max_results: 5,
|
|
38
|
-
search_depth: 'basic',
|
|
39
|
-
include_answer: false,
|
|
40
|
-
include_images: false,
|
|
41
|
-
}),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
if (!response.ok) {
|
|
45
|
-
const errorText = await response.text();
|
|
46
|
-
throw new Error(
|
|
47
|
-
`Tavily API error: ${response.status} ${response.statusText} - ${errorText}`,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const searchResult = await response.json();
|
|
52
|
-
|
|
53
|
-
if (!searchResult.results || searchResult.results.length === 0) {
|
|
54
|
-
return `No Tavily results found for “${query}”.`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const formattedResults = searchResult.results
|
|
58
|
-
.map(
|
|
59
|
-
(
|
|
60
|
-
result: {
|
|
61
|
-
title?: string;
|
|
62
|
-
url?: string;
|
|
63
|
-
content?: string;
|
|
64
|
-
},
|
|
65
|
-
index: number,
|
|
66
|
-
) => {
|
|
67
|
-
const title = result.title ?? 'Untitled';
|
|
68
|
-
const url = result.url ?? 'No URL';
|
|
69
|
-
const content = result.content?.trim() || 'No summary available.';
|
|
70
|
-
return `${index + 1}. **${title}**\n URL: ${url}\n Summary: ${content}`;
|
|
71
|
-
},
|
|
72
|
-
)
|
|
73
|
-
.join('\n\n');
|
|
74
|
-
|
|
75
|
-
return `🌐 **Tavily Search Results for “${query}”**\n\n${formattedResults}`;
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error('[Tavily Search Tool] Error performing search:', error);
|
|
78
|
-
return `Tavily search failed: ${
|
|
79
|
-
error instanceof Error ? error.message : 'Unknown error'
|
|
80
|
-
}`;
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { createTool } from '@convex-dev/agent';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
import { internal } from '../_generated/api';
|
|
5
|
-
import type { Id } from '../_generated/dataModel';
|
|
6
|
-
|
|
7
|
-
type PublicUserFields = {
|
|
8
|
-
name: string | null;
|
|
9
|
-
email: string | null;
|
|
10
|
-
credits: number;
|
|
11
|
-
joinedAt: string | null;
|
|
12
|
-
emailVerified: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type UserProfileToolResult =
|
|
16
|
-
| {
|
|
17
|
-
found: false;
|
|
18
|
-
reason: string;
|
|
19
|
-
}
|
|
20
|
-
| {
|
|
21
|
-
found: true;
|
|
22
|
-
profile: PublicUserFields;
|
|
23
|
-
guidance: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Tool that surfaces the signed-in user's profile information so the agent can
|
|
28
|
-
* answer personalized questions (e.g. “How many credits do I have?”).
|
|
29
|
-
*
|
|
30
|
-
* The handler returns a sanitized payload – no phone numbers or internal IDs –
|
|
31
|
-
* and gracefully handles anonymous or missing profiles.
|
|
32
|
-
*/
|
|
33
|
-
export const userProfileTool = createTool({
|
|
34
|
-
description:
|
|
35
|
-
'Fetch the current signed-in user profile (name, email, credits, join date). Use when the user asks about their account details.',
|
|
36
|
-
args: z
|
|
37
|
-
.object({})
|
|
38
|
-
.describe('No input is required; the tool looks up the current user.'),
|
|
39
|
-
handler: async (ctx, _args): Promise<UserProfileToolResult> => {
|
|
40
|
-
const userId = ctx.userId as Id<'users'> | undefined;
|
|
41
|
-
|
|
42
|
-
if (!userId) {
|
|
43
|
-
return {
|
|
44
|
-
found: false,
|
|
45
|
-
reason:
|
|
46
|
-
'There is no signed-in user associated with this conversation, so profile data is unavailable.',
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
await ctx.runMutation(internal.rateLimit.enforceTool, {
|
|
51
|
-
userId,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const profile = await ctx.runQuery(internal.sharedUsers.getPublicProfile, {
|
|
55
|
-
userId,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
if (!profile) {
|
|
59
|
-
return {
|
|
60
|
-
found: false,
|
|
61
|
-
reason: 'Could not locate the user record linked to this conversation.',
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
found: true,
|
|
67
|
-
profile,
|
|
68
|
-
guidance:
|
|
69
|
-
'Summarize the profile in natural language. If fields are null, mention they are not provided. Use credits to answer balance questions.',
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
});
|