vibefast-cli 1.1.5 → 1.3.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.
- package/CHANGELOG.md +32 -0
- package/README.md +63 -169
- package/dist/__tests__/recipes.test.js +89 -85
- package/dist/__tests__/recipes.test.js.map +1 -1
- package/dist/commands/add.d.ts +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +576 -588
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/checklist.d.ts +1 -1
- package/dist/commands/checklist.d.ts.map +1 -1
- package/dist/commands/checklist.js +40 -39
- package/dist/commands/checklist.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +22 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +58 -53
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/health.d.ts +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +101 -93
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +416 -296
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/remove.d.ts +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +77 -64
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +15 -14
- package/dist/commands/status.js.map +1 -1
- package/dist/core/__tests__/detect.test.js +68 -34
- package/dist/core/__tests__/detect.test.js.map +1 -1
- package/dist/core/ast.d.ts +14 -0
- package/dist/core/ast.d.ts.map +1 -0
- package/dist/core/ast.js +239 -0
- package/dist/core/ast.js.map +1 -0
- package/dist/core/codemod.d.ts.map +1 -1
- package/dist/core/codemod.js +62 -44
- package/dist/core/codemod.js.map +1 -1
- package/dist/core/config.d.ts +10 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +51 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/detect.d.ts +8 -2
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +52 -21
- package/dist/core/detect.js.map +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +9 -8
- package/dist/core/errors.js.map +1 -1
- package/dist/core/exec.d.ts +16 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +48 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/manualSteps.d.ts +7 -0
- package/dist/core/manualSteps.d.ts.map +1 -0
- package/dist/core/manualSteps.js +59 -0
- package/dist/core/manualSteps.js.map +1 -0
- package/dist/core/paths.d.ts +3 -1
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +14 -10
- package/dist/core/paths.js.map +1 -1
- package/dist/core/spinner.d.ts +1 -1
- package/dist/core/spinner.d.ts.map +1 -1
- package/dist/core/spinner.js +38 -8
- package/dist/core/spinner.js.map +1 -1
- package/dist/core/vosk.d.ts.map +1 -1
- package/dist/core/vosk.js +50 -39
- package/dist/core/vosk.js.map +1 -1
- package/docs/manual-testing.md +91 -0
- package/package.json +6 -3
- package/recipes/audio-recorder/apps/native/src/app/audio-recorder/index.tsx +5 -0
- package/recipes/audio-recorder/recipe.json +3 -3
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-player.tsx +301 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-recorder.tsx +373 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-waveform.tsx +270 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/index.ts +4 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/recording-list.tsx +89 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-player-demo.tsx +66 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-recorder-cloud.tsx +68 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-recorder-interview.tsx +102 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/basic.tsx +27 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/index.ts +5 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/with-recording-list-demo.tsx +82 -0
- package/recipes/audio-recorder-supabase/packages/backend/src/services/recordings.ts +369 -0
- package/recipes/audio-recorder-supabase/packages/backend/supabase/migrations/recordings.sql +70 -0
- package/recipes/audio-recorder-supabase/recipe.json +52 -0
- package/recipes/audio-recorder-supabase@latest.zip +0 -0
- package/recipes/audio-recorder@latest.zip +0 -0
- package/recipes/charts/apps/native/src/features/charts/components/bar-chart.tsx +3 -3
- package/recipes/charts/apps/native/src/features/charts/components/candlestick-chart.tsx +2 -2
- package/recipes/charts/apps/native/src/features/charts/components/chart-card.tsx +5 -5
- package/recipes/charts/apps/native/src/features/charts/components/column-chart.tsx +3 -3
- package/recipes/charts/apps/native/src/features/charts/components/doughnut-chart.tsx +20 -4
- package/recipes/charts/apps/native/src/features/charts/components/line-chart.tsx +7 -6
- package/recipes/charts/apps/native/src/features/charts/components/radar-chart.tsx +6 -4
- package/recipes/charts/apps/native/src/features/charts/components/radial-bar-chart.tsx +1 -1
- package/recipes/charts/apps/native/src/features/charts/components/stacked-bar-chart.tsx +5 -4
- package/recipes/charts/recipe.json +4 -13
- package/recipes/charts@latest.zip +0 -0
- package/recipes/chatbot/apps/native/src/app/chatbot/index.tsx +1 -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 +86 -53
- package/recipes/chatbot/recipe.json +26 -92
- package/recipes/chatbot-supabase/apps/native/src/api-client/supabase/chatbot.ts +515 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/app/index.tsx +257 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-header-buttons.tsx +59 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-input-bar.tsx +485 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-markdown.tsx +575 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-message-bubble.tsx +223 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-settings-modal.tsx +161 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/image-preview-list.tsx +116 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/code-block.tsx +165 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/index.ts +10 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/table-renderer.tsx +129 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/message-error-boundary.tsx +78 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/message-list.tsx +170 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/model-selector.tsx +283 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/report-content-modal.tsx +188 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/suggested-messages.tsx +67 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/constants/models.ts +20 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/constants/report-reasons.ts +9 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-attachment-cache.ts +142 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chat-config.ts +458 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chat-handlers.ts +429 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chatbot-settings.ts +89 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-conversation.ts +90 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-image-picker.ts +122 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-keyboard-coordinator.ts +161 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-smart-scroll-manager.ts +213 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/index.ts +86 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/models.ts +162 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/providers.ts +62 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/types.ts +40 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/services/file-uploader.ts +287 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/services/message-handler-service.ts +189 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/types/index.ts +70 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/utils/chat-telemetry.ts +91 -0
- package/recipes/chatbot-supabase/packages/backend/src/services/conversations.ts +243 -0
- package/recipes/chatbot-supabase/packages/backend/src/services/messages.ts +327 -0
- package/recipes/chatbot-supabase/packages/backend/supabase/functions/chat-stream/index.ts +347 -0
- package/recipes/chatbot-supabase/packages/backend/supabase/migrations/chatbot.sql +104 -0
- package/recipes/chatbot-supabase/recipe.json +106 -0
- package/recipes/chatbot-supabase@latest.zip +0 -0
- package/recipes/chatbot.zip +0 -0
- package/recipes/chatbot@latest.zip +0 -0
- package/recipes/image-analysis/packages/backend/convex/imageAnalysis/index.ts +2 -2
- package/recipes/image-analysis/packages/backend/convex/imageAnalysis.ts +0 -1
- package/recipes/image-analysis/recipe.json +15 -55
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/analysis-options-screen.tsx +304 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/camera.tsx +221 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/image-capture-screen.tsx +333 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/loading-screen.tsx +214 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/loading.tsx +191 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/results.tsx +137 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/trait-details.tsx +172 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/use-analysis-data.ts +160 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/use-results-screen.ts +151 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-badge.tsx +77 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-card.tsx +75 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-unlocked-modal.tsx +162 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievements-section.tsx +44 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/advice-list.tsx +42 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/circular-progress.tsx +233 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/content-card.tsx +38 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/error-state.tsx +42 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/index.ts +9 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/loading-state.tsx +26 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/profile-image.tsx +60 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/results-header.tsx +62 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/score-display.tsx +54 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/share-options-modal.tsx +110 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/traits-grid.tsx +74 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/config/analysis-config.ts +80 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/config/master-analysis-config.ts +157 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/index.ts +1 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/use-analysis.ts +38 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/use-image-analysis.ts +208 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/analysis-service.ts +262 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/share-service.ts +176 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/trait-details-service.ts +289 -0
- package/recipes/image-analysis-supabase/packages/backend/src/services/image-analyses.ts +132 -0
- package/recipes/image-analysis-supabase/packages/backend/supabase/functions/analyze-image/index.ts +312 -0
- package/recipes/image-analysis-supabase/packages/backend/supabase/migrations/image_analysis.sql +42 -0
- package/recipes/image-analysis-supabase/recipe.json +90 -0
- package/recipes/image-analysis-supabase@latest.zip +0 -0
- package/recipes/image-analysis@latest.zip +0 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/app/index.tsx +16 -2
- package/recipes/image-generator/apps/native/src/features/image-generator/components/image-model-selector.tsx +11 -5
- package/recipes/image-generator/apps/native/src/features/image-generator/hooks/use-image-generator.ts +11 -5
- package/recipes/image-generator/packages/backend/convex/imageGeneration/index.ts +2 -2
- package/recipes/image-generator/recipe.json +16 -39
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/_layout.tsx +26 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/gallery.tsx +217 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/index.tsx +251 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/gallery-image.tsx +25 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-detail-modal.tsx +215 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-model-selector.tsx +216 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-placeholder.tsx +26 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-gallery.ts +71 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-generator-settings.ts +152 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-generator.ts +103 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/models/models.ts +66 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/services/image-gallery-service.ts +96 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/services/image-save-service.ts +120 -0
- package/recipes/image-generator-supabase/packages/backend/supabase/functions/generate-image/index.ts +291 -0
- package/recipes/image-generator-supabase/packages/backend/supabase/migrations/image_generator.sql +71 -0
- package/recipes/image-generator-supabase/recipe.json +86 -0
- package/recipes/image-generator-supabase@latest.zip +0 -0
- package/recipes/image-generator@latest.zip +0 -0
- package/recipes/ios-widget/recipe.json +15 -24
- package/recipes/ios-widget@latest.zip +0 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/analytics/index.ts +9 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/components/onboarding-with-analytics.tsx +141 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/components/onboarding.tsx +173 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/config/onboarding-flow-config.ts +189 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/demo-one/app/index.tsx +42 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/demo-one/data.ts +32 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/app/index.tsx +43 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/interactive-onboarding.tsx +222 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/ai-tone-step.tsx +133 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/currency-step.tsx +165 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-ai-step.tsx +199 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-chatbot-step.tsx +154 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-manual-step.tsx +156 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-scan-step.tsx +158 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/main-reason-step.tsx +139 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/notification-step.tsx +129 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/overspend-step.tsx +138 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/personalizing-step.tsx +190 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/rating-step.tsx +98 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/reminder-step.tsx +181 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/safety-step.tsx +110 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/struggle-step.tsx +139 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/welcome-step.tsx +217 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/ui/onboarding-header.tsx +58 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/constants.ts +179 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/hooks/use-onboarding-analytics.ts +323 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/services/onboarding-analytics.ts +432 -0
- package/recipes/onboarding/recipe.json +15 -0
- package/recipes/onboarding@latest.zip +0 -0
- package/recipes/payments/recipe.json +28 -61
- package/recipes/payments-supabase/apps/native/src/features/payments/README.md +200 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/app/local-paywall.tsx +194 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/app/remote-paywall.tsx +79 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/payment-initializer.tsx +95 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-error-state.tsx +60 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-local-mode.tsx +116 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-product-card.tsx +133 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-remote-mode.tsx +146 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/hooks/use-entitlement.ts +63 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/index.ts +8 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/services/revenuecat-adapter.ts +407 -0
- package/recipes/payments-supabase/packages/backend/src/services/payments.ts +201 -0
- package/recipes/payments-supabase/packages/backend/supabase/migrations/payments.sql +35 -0
- package/recipes/payments-supabase/recipe.json +72 -0
- package/recipes/payments-supabase@latest.zip +0 -0
- package/recipes/payments@latest.zip +0 -0
- package/recipes/quiz/apps/native/src/features/quiz/index.tsx +1 -2
- package/recipes/quiz/recipe.json +6 -9
- package/recipes/quiz@latest.zip +0 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/app/index.tsx +1 -2
- package/recipes/tracker-app/recipe.json +7 -10
- package/recipes/tracker-app@latest.zip +0 -0
- package/recipes/voice-bot/recipe.json +8 -68
- package/recipes/voice-bot.zip +0 -0
- package/recipes/voice-bot@latest.zip +0 -0
- package/recipes/wake-word/recipe.json +10 -9
- package/recipes/wake-word.zip +0 -0
- package/recipes/wake-word@latest.zip +0 -0
- package/recipes/charts/apps/native/src/app/(root)/(protected)/charts/index.tsx +0 -3
- package/recipes/chatbot/packages/backend/convex/lib/rateLimit.ts +0 -100
- package/recipes/chatbot/packages/backend/convex/lib/telemetry.ts +0 -29
- package/recipes/chatbot/packages/backend/convex/ragKnowledge.ts +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/front.jpg +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/side.jpg +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/threeQuarter.jpg +0 -0
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/_layout.tsx +0 -5
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/analysis-options.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/camera.tsx +0 -2
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/index.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/loading.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/results.tsx +0 -2
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/trait-details.tsx +0 -3
- package/recipes/image-analysis/packages/backend/convex/imageAnalysisFunctions.ts +0 -325
- package/recipes/image-analysis/packages/backend/convex/lib/ai/imageAnalysisAdapter.ts +0 -200
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/index.tsx +0 -74
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/local.tsx +0 -25
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/remote.tsx +0 -23
- package/recipes/quiz/apps/native/src/app/(root)/(protected)/quiz/index.tsx +0 -47
- package/recipes/tracker-app/apps/native/src/app/(root)/(protected)/tracker-app/index.tsx +0 -1
- package/recipes/voice-bot/apps/native/src/app/(root)/(protected)/voice-bot/index.tsx +0 -27
- package/recipes/voice-bot/packages/backend/convex/router.ts +0 -81
- /package/recipes/{chatbot/apps/native/src/app/(root)/(protected) → chatbot-supabase/apps/native/src/app}/chatbot/index.tsx +0 -0
- /package/recipes/{image-generator/apps/native/src/app/(root)/(protected) → image-generator-supabase/apps/native/src/app}/image-generator/gallery.tsx +0 -0
- /package/recipes/{image-generator/apps/native/src/app/(root)/(protected) → image-generator-supabase/apps/native/src/app}/image-generator/index.tsx +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -3,9 +3,8 @@ import { useRouter } from 'expo-router';
|
|
|
3
3
|
import { AnimatePresence, MotiView } from 'moti';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
-
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
7
6
|
|
|
8
|
-
import { Button, Text } from '@/components/ui';
|
|
7
|
+
import { Button, SafeAreaView, Text } from '@/components/ui';
|
|
9
8
|
|
|
10
9
|
import Question from './components/question';
|
|
11
10
|
import { QuestionMode, quizConfig } from './config';
|
package/recipes/quiz/recipe.json
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quiz",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Interactive quiz
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Interactive quiz component",
|
|
5
5
|
"copy": [
|
|
6
|
-
{
|
|
7
|
-
"from": "apps/native/src/app/(root)/(protected)/quiz",
|
|
8
|
-
"to": "apps/native/src/app/(root)/(protected)/quiz"
|
|
9
|
-
},
|
|
10
6
|
{
|
|
11
7
|
"from": "apps/native/src/features/quiz",
|
|
12
8
|
"to": "apps/native/src/features/quiz"
|
|
@@ -15,8 +11,9 @@
|
|
|
15
11
|
"nav": {
|
|
16
12
|
"href": "/(root)/(protected)/quiz",
|
|
17
13
|
"label": "Quiz",
|
|
18
|
-
"icon": "
|
|
19
|
-
"color": "#
|
|
14
|
+
"icon": "❓",
|
|
15
|
+
"color": "#F59E0B"
|
|
20
16
|
},
|
|
21
|
-
"target": "native"
|
|
17
|
+
"target": "native",
|
|
18
|
+
"dependencies": { "expo": ["react-native-reanimated"] }
|
|
22
19
|
}
|
package/recipes/quiz@latest.zip
CHANGED
|
Binary file
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Ionicons, MaterialIcons } from '@expo/vector-icons';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ScrollView, View } from 'react-native';
|
|
4
|
-
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
5
4
|
|
|
6
|
-
import { Text } from '@/components/ui';
|
|
5
|
+
import { SafeAreaView, Text } from '@/components/ui';
|
|
7
6
|
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
8
7
|
|
|
9
8
|
import CalorieCard from '../components/calorie-card';
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tracker-app",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Habit/expense tracker UI",
|
|
5
5
|
"copy": [
|
|
6
|
-
{
|
|
7
|
-
"from": "apps/native/src/app/(root)/(protected)/tracker-app",
|
|
8
|
-
"to": "apps/native/src/app/(root)/(protected)/tracker-app"
|
|
9
|
-
},
|
|
10
6
|
{
|
|
11
7
|
"from": "apps/native/src/features/tracker-app",
|
|
12
8
|
"to": "apps/native/src/features/tracker-app"
|
|
13
9
|
}
|
|
14
10
|
],
|
|
15
11
|
"nav": {
|
|
16
|
-
"href": "/(root)/(protected)/tracker
|
|
12
|
+
"href": "/(root)/(protected)/tracker",
|
|
17
13
|
"label": "Tracker",
|
|
18
|
-
"icon": "
|
|
19
|
-
"color": "#
|
|
14
|
+
"icon": "📊",
|
|
15
|
+
"color": "#F59E0B"
|
|
20
16
|
},
|
|
21
|
-
"target": "native"
|
|
17
|
+
"target": "native",
|
|
18
|
+
"dependencies": { "expo": ["react-native-reanimated"] }
|
|
22
19
|
}
|
|
Binary file
|
|
@@ -1,85 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voice-bot",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Voice-enabled AI assistant",
|
|
5
5
|
"copy": [
|
|
6
|
-
{
|
|
7
|
-
"from": "apps/native/src/app/(root)/(protected)/voice-bot",
|
|
8
|
-
"to": "apps/native/src/app/(root)/(protected)/voice-bot"
|
|
9
|
-
},
|
|
10
6
|
{
|
|
11
7
|
"from": "apps/native/src/features/voice-bot",
|
|
12
8
|
"to": "apps/native/src/features/voice-bot"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"from": "packages/backend/convex/router.ts",
|
|
16
|
-
"to": "packages/backend/convex/router.ts"
|
|
17
9
|
}
|
|
18
10
|
],
|
|
19
11
|
"nav": {
|
|
20
12
|
"href": "/(root)/(protected)/voice-bot",
|
|
21
|
-
"label": "Voice
|
|
13
|
+
"label": "Voice Bot",
|
|
22
14
|
"icon": "🗣️",
|
|
23
|
-
"color": "#
|
|
15
|
+
"color": "#6366F1"
|
|
24
16
|
},
|
|
25
17
|
"target": "native",
|
|
26
|
-
"dependencies": {
|
|
27
|
-
|
|
28
|
-
"@elevenlabs/react-native",
|
|
29
|
-
"@livekit/react-native",
|
|
30
|
-
"@livekit/react-native-webrtc",
|
|
31
|
-
"@livekit/react-native-expo-plugin",
|
|
32
|
-
"@config-plugins/react-native-webrtc"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"env": [
|
|
36
|
-
{
|
|
37
|
-
"key": "ELEVENLABS_API_KEY",
|
|
38
|
-
"description": "API key for ElevenLabs Conversational AI (used by the backend token route).",
|
|
39
|
-
"example": "elevenlabs_api_key_example",
|
|
40
|
-
"link": "https://elevenlabs.io/account",
|
|
41
|
-
"file": "packages/backend/.env.local"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"key": "ELEVENLABS_AGENT_ID",
|
|
45
|
-
"description": "Agent ID from your ElevenLabs Conversational AI agent configuration.",
|
|
46
|
-
"example": "agent-abc123",
|
|
47
|
-
"link": "https://elevenlabs.io/"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"configuration": {
|
|
51
|
-
"env": {
|
|
52
|
-
"client": {
|
|
53
|
-
"schema": [
|
|
54
|
-
" ELEVENLABS_AGENT_ID: z.string(),"
|
|
55
|
-
],
|
|
56
|
-
"env": [
|
|
57
|
-
" ELEVENLABS_AGENT_ID: process.env.ELEVENLABS_AGENT_ID,"
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"manualSteps": [
|
|
63
|
-
{
|
|
64
|
-
"title": "Create an ElevenLabs Conversational AI agent",
|
|
65
|
-
"description": "Visit https://elevenlabs.io, sign up, go to the Conversational AI tab, and create a new agent with speech capabilities enabled.",
|
|
66
|
-
"link": "https://elevenlabs.io/"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"title": "Get your ElevenLabs API key and Agent ID",
|
|
70
|
-
"description": "From the ElevenLabs dashboard, copy your API key (from Account settings) and your Agent ID (from the agent you just created).",
|
|
71
|
-
"link": "https://elevenlabs.io/account"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"title": "Add keys to .env file",
|
|
75
|
-
"description": "Open your .env file and add the API key and Agent ID you just copied.",
|
|
76
|
-
"file": ".env",
|
|
77
|
-
"content": "ELEVENLABS_AGENT_ID=agent-...\nELEVENLABS_API_KEY=elevenlabs_...\n"
|
|
78
|
-
},
|
|
18
|
+
"dependencies": { "expo": ["expo-av", "expo-speech"] },
|
|
19
|
+
"plugins": [
|
|
79
20
|
{
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"link": "https://docs.expo.dev/build/setup/"
|
|
21
|
+
"name": "expo-av",
|
|
22
|
+
"config": "{\n microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone for voice conversations.',\n }"
|
|
83
23
|
}
|
|
84
24
|
]
|
|
85
25
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -28,18 +28,19 @@
|
|
|
28
28
|
},
|
|
29
29
|
"target": "native",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"expo": [
|
|
32
|
-
"expo-audio",
|
|
33
|
-
"react-native-vosk"
|
|
34
|
-
]
|
|
31
|
+
"expo": ["expo-audio", "react-native-vosk"]
|
|
35
32
|
},
|
|
36
|
-
"
|
|
33
|
+
"plugins": [
|
|
37
34
|
{
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"file": "apps/native/app.config.ts",
|
|
41
|
-
"content": "[\n 'react-native-vosk',\n {\n models: ['assets/vosk-model/model-en-us'],\n iOSMicrophonePermission: 'We use the mic for on-device wake-phrase detection.'\n }\n]"
|
|
35
|
+
"name": "expo-audio",
|
|
36
|
+
"config": "{\n microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone for voice conversations and on-device wake-word detection.',\n }"
|
|
42
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"name": "react-native-vosk",
|
|
40
|
+
"config": "{\n models: ['assets/vosk-model/model-en-us'],\n iOSMicrophonePermission: 'We use the mic for on-device wake-phrase detection.',\n }"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"manualSteps": [
|
|
43
44
|
{
|
|
44
45
|
"title": "Add model to .gitignore",
|
|
45
46
|
"description": "The Vosk model is large (~40MB) and should not be committed to Git. Add 'assets/vosk-model/model-en-us' to your .gitignore file so it stays local only.",
|
|
Binary file
|
|
Binary file
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { Id } from '../_generated/dataModel';
|
|
2
|
-
import type { MutationCtx } from '../_generated/server';
|
|
3
|
-
|
|
4
|
-
const AGENT_WINDOW_MS = 60 * 1000; // 1 minute
|
|
5
|
-
const AGENT_LIMIT = 12; // max agent calls per window
|
|
6
|
-
|
|
7
|
-
const TOOL_WINDOW_MS = 60 * 1000;
|
|
8
|
-
const TOOL_LIMIT = 20;
|
|
9
|
-
|
|
10
|
-
type RateLimitFields =
|
|
11
|
-
| [
|
|
12
|
-
'agentRateLimitWindowStart',
|
|
13
|
-
'agentRateLimitCount',
|
|
14
|
-
typeof AGENT_WINDOW_MS,
|
|
15
|
-
typeof AGENT_LIMIT,
|
|
16
|
-
]
|
|
17
|
-
| [
|
|
18
|
-
'toolRateLimitWindowStart',
|
|
19
|
-
'toolRateLimitCount',
|
|
20
|
-
typeof TOOL_WINDOW_MS,
|
|
21
|
-
typeof TOOL_LIMIT,
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
const getNow = () => Date.now();
|
|
25
|
-
|
|
26
|
-
async function enforceRateLimit(
|
|
27
|
-
db: MutationCtx['db'],
|
|
28
|
-
userId: Id<'users'>,
|
|
29
|
-
[windowField, countField, windowMs, limit]: RateLimitFields,
|
|
30
|
-
friendlyName: string,
|
|
31
|
-
) {
|
|
32
|
-
const userDoc = await db.get(userId);
|
|
33
|
-
if (!userDoc) {
|
|
34
|
-
throw new Error('User not found while enforcing rate limit.');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const nowMs = getNow();
|
|
38
|
-
const record = userDoc as unknown as Record<string, number | undefined>;
|
|
39
|
-
const windowStart = record[windowField] ?? 0;
|
|
40
|
-
const currentCount = record[countField] ?? 0;
|
|
41
|
-
|
|
42
|
-
const withinWindow = nowMs - windowStart < windowMs;
|
|
43
|
-
const nextCount = withinWindow ? currentCount + 1 : 1;
|
|
44
|
-
|
|
45
|
-
if (withinWindow && nextCount > limit) {
|
|
46
|
-
const retrySeconds = Math.ceil((windowMs - (nowMs - windowStart)) / 1000);
|
|
47
|
-
const message = `${friendlyName} limit reached. Please wait ${retrySeconds}s before trying again.`;
|
|
48
|
-
const error = new Error(message);
|
|
49
|
-
(error as Error & { code?: string }).code = 'RATE_LIMIT';
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
await db.patch(userId, {
|
|
54
|
-
[windowField]: withinWindow ? windowStart : nowMs,
|
|
55
|
-
[countField]: nextCount,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function enforceAgentRateLimit(
|
|
60
|
-
db: MutationCtx['db'],
|
|
61
|
-
userId: Id<'users'>,
|
|
62
|
-
) {
|
|
63
|
-
return enforceRateLimit(
|
|
64
|
-
db,
|
|
65
|
-
userId,
|
|
66
|
-
[
|
|
67
|
-
'agentRateLimitWindowStart',
|
|
68
|
-
'agentRateLimitCount',
|
|
69
|
-
AGENT_WINDOW_MS,
|
|
70
|
-
AGENT_LIMIT,
|
|
71
|
-
],
|
|
72
|
-
'Chat agent',
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function enforceToolRateLimit(
|
|
77
|
-
db: MutationCtx['db'],
|
|
78
|
-
userId: Id<'users'>,
|
|
79
|
-
) {
|
|
80
|
-
return enforceRateLimit(
|
|
81
|
-
db,
|
|
82
|
-
userId,
|
|
83
|
-
[
|
|
84
|
-
'toolRateLimitWindowStart',
|
|
85
|
-
'toolRateLimitCount',
|
|
86
|
-
TOOL_WINDOW_MS,
|
|
87
|
-
TOOL_LIMIT,
|
|
88
|
-
],
|
|
89
|
-
'Tool usage',
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function resetRateLimits(db: MutationCtx['db'], userId: Id<'users'>) {
|
|
94
|
-
return db.patch(userId, {
|
|
95
|
-
agentRateLimitWindowStart: undefined,
|
|
96
|
-
agentRateLimitCount: undefined,
|
|
97
|
-
toolRateLimitWindowStart: undefined,
|
|
98
|
-
toolRateLimitCount: undefined,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type TelemetryMode = 'off' | 'sample' | 'debug';
|
|
2
|
-
|
|
3
|
-
function normalizeMode(raw: string | undefined): TelemetryMode {
|
|
4
|
-
if (raw === 'sample' || raw === 'debug') {
|
|
5
|
-
return raw;
|
|
6
|
-
}
|
|
7
|
-
return 'off';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function getChatTelemetryMode(): TelemetryMode {
|
|
11
|
-
return normalizeMode(process.env.CHAT_LATENCY_TELEMETRY_MODE);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function isChatTelemetryEnabled(): boolean {
|
|
15
|
-
return getChatTelemetryMode() !== 'off';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function shouldSampleChatTelemetry(probability = 0.1): boolean {
|
|
19
|
-
const mode = getChatTelemetryMode();
|
|
20
|
-
if (mode === 'off') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (mode === 'debug') {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const clampedProbability = Math.min(Math.max(probability, 0), 1);
|
|
28
|
-
return Math.random() < clampedProbability;
|
|
29
|
-
}
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Redirect, useLocalSearchParams } from 'expo-router';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import { FocusAwareStatusBar, Text } from '@/components/ui';
|
|
6
|
-
import { DynamicAnalysisOptionsScreen } from '@/features/image-analyzer/app/analysis-options-screen';
|
|
7
|
-
import { getAnalysisFlowConfigSafe } from '@/features/image-analyzer/config/master-analysis-config';
|
|
8
|
-
import { translate } from '@/lib';
|
|
9
|
-
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Dynamic analysis options route that loads the appropriate configuration
|
|
13
|
-
* based on the type parameter
|
|
14
|
-
*/
|
|
15
|
-
export default function DynamicAnalysisOptionsRoute() {
|
|
16
|
-
const { type } = useLocalSearchParams<{ type: string }>();
|
|
17
|
-
const theme = useThemeConfig();
|
|
18
|
-
|
|
19
|
-
if (!type || typeof type !== 'string') {
|
|
20
|
-
return <Redirect href="/(protected)/(tabs)" />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const config = getAnalysisFlowConfigSafe(type);
|
|
24
|
-
|
|
25
|
-
if (!config) {
|
|
26
|
-
// Invalid analysis type, redirect to home with a user-friendly message
|
|
27
|
-
return (
|
|
28
|
-
<View
|
|
29
|
-
style={{
|
|
30
|
-
flex: 1,
|
|
31
|
-
backgroundColor: theme.colors.background,
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
padding: 20,
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<FocusAwareStatusBar />
|
|
38
|
-
<Text className="mb-4 text-center text-lg font-medium">
|
|
39
|
-
{translate('common.invalid_analysis_type')}
|
|
40
|
-
</Text>
|
|
41
|
-
<Text className="mb-6 text-center text-muted-foreground">
|
|
42
|
-
{translate('common.redirecting_home')}
|
|
43
|
-
</Text>
|
|
44
|
-
<Redirect href="/(protected)/(tabs)" />
|
|
45
|
-
</View>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return <DynamicAnalysisOptionsScreen config={config} />;
|
|
50
|
-
}
|
package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/index.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Redirect, useLocalSearchParams } from 'expo-router';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import { FocusAwareStatusBar, Text } from '@/components/ui';
|
|
6
|
-
import { ImageCaptureScreen } from '@/features/image-analyzer/app/image-capture-screen';
|
|
7
|
-
import { getAnalysisFlowConfigSafe } from '@/features/image-analyzer/config/master-analysis-config';
|
|
8
|
-
import { translate } from '@/lib';
|
|
9
|
-
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Dynamic analysis route that loads the appropriate configuration
|
|
13
|
-
* based on the type parameter
|
|
14
|
-
*/
|
|
15
|
-
export default function DynamicAnalysisScreen() {
|
|
16
|
-
const { type } = useLocalSearchParams<{ type: string }>();
|
|
17
|
-
const theme = useThemeConfig();
|
|
18
|
-
|
|
19
|
-
if (!type || typeof type !== 'string') {
|
|
20
|
-
return <Redirect href="/(protected)/(tabs)" />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const config = getAnalysisFlowConfigSafe(type);
|
|
24
|
-
|
|
25
|
-
if (!config) {
|
|
26
|
-
// Invalid analysis type, redirect to home with a user-friendly message
|
|
27
|
-
return (
|
|
28
|
-
<View
|
|
29
|
-
style={{
|
|
30
|
-
flex: 1,
|
|
31
|
-
backgroundColor: theme.colors.background,
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
padding: 20,
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<FocusAwareStatusBar />
|
|
38
|
-
<Text className="mb-4 text-center text-lg font-medium">
|
|
39
|
-
{translate('common.invalid_analysis_type')}
|
|
40
|
-
</Text>
|
|
41
|
-
<Text className="mb-6 text-center text-muted-foreground">
|
|
42
|
-
{translate('common.redirecting_home')}
|
|
43
|
-
</Text>
|
|
44
|
-
<Redirect href="/(protected)/(tabs)" />
|
|
45
|
-
</View>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return <ImageCaptureScreen config={config} />;
|
|
50
|
-
}
|
package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/loading.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Redirect, useLocalSearchParams } from 'expo-router';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import { FocusAwareStatusBar, Text } from '@/components/ui';
|
|
6
|
-
import { LoadingScreen } from '@/features/image-analyzer/app/loading-screen';
|
|
7
|
-
import { getAnalysisFlowConfigSafe } from '@/features/image-analyzer/config/master-analysis-config';
|
|
8
|
-
import { translate } from '@/lib';
|
|
9
|
-
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Dynamic loading route that loads the appropriate configuration
|
|
13
|
-
* based on the type parameter
|
|
14
|
-
*/
|
|
15
|
-
export default function DynamicLoadingRoute() {
|
|
16
|
-
const { type } = useLocalSearchParams<{ type: string }>();
|
|
17
|
-
const theme = useThemeConfig();
|
|
18
|
-
|
|
19
|
-
if (!type || typeof type !== 'string') {
|
|
20
|
-
return <Redirect href="/(protected)/(tabs)" />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const config = getAnalysisFlowConfigSafe(type);
|
|
24
|
-
|
|
25
|
-
if (!config) {
|
|
26
|
-
// Invalid analysis type, redirect to home with a user-friendly message
|
|
27
|
-
return (
|
|
28
|
-
<View
|
|
29
|
-
style={{
|
|
30
|
-
flex: 1,
|
|
31
|
-
backgroundColor: theme.colors.background,
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
padding: 20,
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<FocusAwareStatusBar />
|
|
38
|
-
<Text className="mb-4 text-center text-lg font-medium">
|
|
39
|
-
{translate('common.invalid_analysis_type')}
|
|
40
|
-
</Text>
|
|
41
|
-
<Text className="mb-6 text-center text-muted-foreground">
|
|
42
|
-
{translate('common.redirecting_home')}
|
|
43
|
-
</Text>
|
|
44
|
-
<Redirect href="/(protected)/(tabs)" />
|
|
45
|
-
</View>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return <LoadingScreen config={config} />;
|
|
50
|
-
}
|