vibefast-cli 1.1.5 → 1.2.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/CHANGELOG.md +32 -0
- package/README.md +63 -169
- package/dist/commands/add.d.ts +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +547 -589
- 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 +35 -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 +79 -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 +57 -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 +59 -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 +51 -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
package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-input-bar.tsx
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { AntDesign, Feather } from '@expo/vector-icons';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, Alert, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
import { sharedApi } from '@/api-client/shared';
|
|
7
|
+
import { getSupabase } from '@/api-client/supabase/client';
|
|
8
|
+
import { Input, Pressable } from '@/components/ui';
|
|
9
|
+
import type { SelectedImage } from '@/features/chatbot/components/image-preview-list';
|
|
10
|
+
import { ImagePreviewList } from '@/features/chatbot/components/image-preview-list';
|
|
11
|
+
import { ModelSelector } from '@/features/chatbot/components/model-selector';
|
|
12
|
+
import { SuggestedMessages } from '@/features/chatbot/components/suggested-messages';
|
|
13
|
+
import type { ModelType } from '@/features/chatbot/constants/models';
|
|
14
|
+
import { DEFAULT_MODELS } from '@/features/chatbot/constants/models';
|
|
15
|
+
import { useImagePicker } from '@/features/chatbot/hooks/use-image-picker';
|
|
16
|
+
import { useFileUploadService } from '@/features/chatbot/services/file-uploader';
|
|
17
|
+
import {
|
|
18
|
+
createChatTelemetryTracker,
|
|
19
|
+
logChatTelemetryEvent,
|
|
20
|
+
} from '@/features/chatbot/utils/chat-telemetry';
|
|
21
|
+
import { useEntitlement } from '@/features/payments/hooks/use-entitlement';
|
|
22
|
+
import { useThemeConfig } from '@/lib/use-theme-config';
|
|
23
|
+
|
|
24
|
+
// Helper to generate unique IDs
|
|
25
|
+
function generateId(): string {
|
|
26
|
+
return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type ChatInputBarProps = {
|
|
30
|
+
/** Current text input value */
|
|
31
|
+
input: string;
|
|
32
|
+
/** Handler for text input changes */
|
|
33
|
+
onInputChange: (text: string) => void;
|
|
34
|
+
/** Handler for sending message with text and/or images */
|
|
35
|
+
onSubmit: (
|
|
36
|
+
attachments?: {
|
|
37
|
+
type: 'image';
|
|
38
|
+
storageId: string;
|
|
39
|
+
fileName?: string;
|
|
40
|
+
mimeType?: string;
|
|
41
|
+
url?: string;
|
|
42
|
+
}[],
|
|
43
|
+
) => Promise<void>;
|
|
44
|
+
/** Whether the chat is currently loading/sending */
|
|
45
|
+
isLoading: boolean;
|
|
46
|
+
/** Whether to show suggested messages (only when conversation is empty) */
|
|
47
|
+
showSuggestedMessages?: boolean;
|
|
48
|
+
/** Currently selected AI model */
|
|
49
|
+
selectedModel?: ModelType;
|
|
50
|
+
/** Handler for model selection changes */
|
|
51
|
+
onModelChange?: (model: ModelType) => void;
|
|
52
|
+
/** Test ID for E2E testing */
|
|
53
|
+
testID?: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Chat input bar component with support for text input and multiple image attachments.
|
|
58
|
+
* Handles image selection, preview, removal, and upload progress.
|
|
59
|
+
*/
|
|
60
|
+
export const ChatInputBar: React.FC<ChatInputBarProps> = ({
|
|
61
|
+
input,
|
|
62
|
+
onInputChange,
|
|
63
|
+
onSubmit,
|
|
64
|
+
isLoading,
|
|
65
|
+
showSuggestedMessages = false,
|
|
66
|
+
selectedModel = DEFAULT_MODELS.openai,
|
|
67
|
+
onModelChange,
|
|
68
|
+
testID = 'chat-input-bar',
|
|
69
|
+
}) => {
|
|
70
|
+
const theme = useThemeConfig();
|
|
71
|
+
const fileUploadService = useFileUploadService();
|
|
72
|
+
const { showImageSourceOptions } = useImagePicker();
|
|
73
|
+
const deleteFileMutation = sharedApi.useDeleteUploadedFile();
|
|
74
|
+
|
|
75
|
+
const [selectedImages, setSelectedImages] = useState<SelectedImage[]>([]);
|
|
76
|
+
const uploadAbortControllersRef = useRef<Map<string, AbortController>>(
|
|
77
|
+
new Map(),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// Entitlement-based attachment limits
|
|
81
|
+
const { isEntitled: hasPremium } = useEntitlement('premium_access');
|
|
82
|
+
const maxImages = hasPremium ? 5 : 1;
|
|
83
|
+
|
|
84
|
+
// Update image state helper
|
|
85
|
+
const updateImageState = useCallback(
|
|
86
|
+
(
|
|
87
|
+
id: string,
|
|
88
|
+
updates:
|
|
89
|
+
| Partial<SelectedImage>
|
|
90
|
+
| ((prev: SelectedImage) => SelectedImage),
|
|
91
|
+
) => {
|
|
92
|
+
setSelectedImages((prev) =>
|
|
93
|
+
prev.map((img) => {
|
|
94
|
+
if (img.id !== id) return img;
|
|
95
|
+
return typeof updates === 'function'
|
|
96
|
+
? updates(img)
|
|
97
|
+
: { ...img, ...updates };
|
|
98
|
+
}),
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
[],
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// Upload image immediately
|
|
105
|
+
const uploadImageImmediately = useCallback(
|
|
106
|
+
async (image: SelectedImage) => {
|
|
107
|
+
const telemetry = createChatTelemetryTracker(
|
|
108
|
+
'chat.imageUpload.immediate',
|
|
109
|
+
{ imageId: image.id, fileName: image.fileName },
|
|
110
|
+
0.25,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
// Update to uploading state
|
|
115
|
+
updateImageState(image.id, {
|
|
116
|
+
uploadState: { status: 'uploading', progress: 10 },
|
|
117
|
+
});
|
|
118
|
+
telemetry?.mark('upload.started');
|
|
119
|
+
|
|
120
|
+
// Optimize and upload
|
|
121
|
+
updateImageState(image.id, {
|
|
122
|
+
uploadState: { status: 'uploading', progress: 30 },
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const storageId = await fileUploadService.uploadImage(
|
|
126
|
+
image.uri,
|
|
127
|
+
image.fileName,
|
|
128
|
+
image.mimeType || image.type,
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
updateImageState(image.id, {
|
|
132
|
+
uploadState: { status: 'uploading', progress: 90 },
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Generate a signed URL for immediate display + model input
|
|
136
|
+
const supabase = getSupabase();
|
|
137
|
+
const { data: signed, error: signedErr } = await supabase.storage
|
|
138
|
+
.from('chat-attachments')
|
|
139
|
+
.createSignedUrl(storageId, 60 * 60); // 1 hour
|
|
140
|
+
if (signedErr) {
|
|
141
|
+
console.warn(
|
|
142
|
+
'[CHATBOT_FRONTEND] Failed to sign chat attachment:',
|
|
143
|
+
signedErr.message,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Update to completed state
|
|
148
|
+
updateImageState(image.id, {
|
|
149
|
+
uploadState: { status: 'completed', storageId, progress: 100 },
|
|
150
|
+
storageId,
|
|
151
|
+
mimeType: image.type,
|
|
152
|
+
signedUrl: signed?.signedUrl ?? undefined,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
telemetry?.mark('upload.completed', { storageId });
|
|
156
|
+
telemetry?.finalize('ok', { storageId });
|
|
157
|
+
} catch (error) {
|
|
158
|
+
const errorMessage =
|
|
159
|
+
error instanceof Error ? error.message : 'Unknown error';
|
|
160
|
+
|
|
161
|
+
updateImageState(image.id, {
|
|
162
|
+
uploadState: { status: 'error', error: errorMessage, progress: 0 },
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
telemetry?.mark('upload.failed', { error: errorMessage });
|
|
166
|
+
telemetry?.finalize('error', { error: errorMessage });
|
|
167
|
+
|
|
168
|
+
console.error('[CHATBOT_FRONTEND] Immediate upload failed:', {
|
|
169
|
+
error: errorMessage,
|
|
170
|
+
imageId: image.id,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
[fileUploadService, updateImageState],
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const handleImageSelection = useCallback(
|
|
178
|
+
(newImages: { uri: string; type: string; fileName?: string }[]) => {
|
|
179
|
+
setSelectedImages((prev) => {
|
|
180
|
+
const remaining = Math.max(0, maxImages - prev.length);
|
|
181
|
+
if (remaining <= 0) {
|
|
182
|
+
Alert.alert(
|
|
183
|
+
'Limit reached',
|
|
184
|
+
hasPremium
|
|
185
|
+
? 'You can attach up to 5 images per message.'
|
|
186
|
+
: 'Free plan allows 1 image per message.',
|
|
187
|
+
);
|
|
188
|
+
return prev;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const toAdd = newImages.slice(0, remaining);
|
|
192
|
+
|
|
193
|
+
if (newImages.length > toAdd.length) {
|
|
194
|
+
Alert.alert(
|
|
195
|
+
'Some images not added',
|
|
196
|
+
hasPremium
|
|
197
|
+
? 'You reached the 5-image limit for premium.'
|
|
198
|
+
: 'Free plan allows only 1 image.',
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Convert to SelectedImage with upload state
|
|
203
|
+
const imagesWithState: SelectedImage[] = toAdd.map((img) => ({
|
|
204
|
+
...img,
|
|
205
|
+
id: generateId(),
|
|
206
|
+
uploadState: { status: 'pending', progress: 0 },
|
|
207
|
+
}));
|
|
208
|
+
|
|
209
|
+
// Start uploads immediately
|
|
210
|
+
imagesWithState.forEach((img) => {
|
|
211
|
+
uploadImageImmediately(img);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
return [...prev, ...imagesWithState];
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
[maxImages, hasPremium, uploadImageImmediately],
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const removeSelectedImage = useCallback(
|
|
221
|
+
async (id: string) => {
|
|
222
|
+
const image = selectedImages.find((img) => img.id === id);
|
|
223
|
+
|
|
224
|
+
if (!image) return;
|
|
225
|
+
|
|
226
|
+
// If upload completed, delete from storage
|
|
227
|
+
if (image.uploadState.status === 'completed' && image.storageId) {
|
|
228
|
+
try {
|
|
229
|
+
await deleteFileMutation({ storageId: image.storageId });
|
|
230
|
+
} catch (error) {
|
|
231
|
+
console.error('[CHATBOT_FRONTEND] Failed to delete file:', error);
|
|
232
|
+
// Continue with UI removal even if deletion fails
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Remove from state
|
|
237
|
+
setSelectedImages((prev) => prev.filter((img) => img.id !== id));
|
|
238
|
+
|
|
239
|
+
// Clean up abort controller if exists
|
|
240
|
+
uploadAbortControllersRef.current.delete(id);
|
|
241
|
+
},
|
|
242
|
+
[selectedImages, deleteFileMutation],
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
const retryUpload = useCallback(
|
|
246
|
+
(id: string) => {
|
|
247
|
+
const image = selectedImages.find((img) => img.id === id);
|
|
248
|
+
if (!image) return;
|
|
249
|
+
|
|
250
|
+
// Reset to pending state
|
|
251
|
+
updateImageState(id, {
|
|
252
|
+
uploadState: { status: 'pending', progress: 0 },
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// Retry upload
|
|
256
|
+
uploadImageImmediately(image);
|
|
257
|
+
},
|
|
258
|
+
[selectedImages, updateImageState, uploadImageImmediately],
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
const handleSubmit = useCallback(async () => {
|
|
262
|
+
const hasText = input.trim();
|
|
263
|
+
const hasImages = selectedImages.length > 0;
|
|
264
|
+
|
|
265
|
+
if (!hasText && !hasImages) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Check upload states
|
|
270
|
+
const hasErrors = selectedImages.some(
|
|
271
|
+
(img) => img.uploadState.status === 'error',
|
|
272
|
+
);
|
|
273
|
+
const isUploading = selectedImages.some(
|
|
274
|
+
(img) =>
|
|
275
|
+
img.uploadState.status === 'uploading' ||
|
|
276
|
+
img.uploadState.status === 'pending',
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
if (hasErrors) {
|
|
280
|
+
Alert.alert(
|
|
281
|
+
'Upload Error',
|
|
282
|
+
'Some images failed to upload. Please remove them or retry before sending.',
|
|
283
|
+
);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (isUploading) {
|
|
288
|
+
Alert.alert(
|
|
289
|
+
'Upload in Progress',
|
|
290
|
+
'Please wait for all images to finish uploading.',
|
|
291
|
+
);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
logChatTelemetryEvent(
|
|
296
|
+
'chat.inputBar.submitTapped',
|
|
297
|
+
{
|
|
298
|
+
hasText: Boolean(hasText),
|
|
299
|
+
imageCount: selectedImages.length,
|
|
300
|
+
isLoading,
|
|
301
|
+
},
|
|
302
|
+
0.05,
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
try {
|
|
306
|
+
// Extract completed attachments
|
|
307
|
+
const attachments = selectedImages
|
|
308
|
+
.filter((img) => img.uploadState.status === 'completed')
|
|
309
|
+
.map((img) => ({
|
|
310
|
+
type: 'image' as const,
|
|
311
|
+
storageId: img.storageId!,
|
|
312
|
+
url: img.signedUrl,
|
|
313
|
+
fileName: img.fileName,
|
|
314
|
+
mimeType: img.mimeType || img.type,
|
|
315
|
+
}));
|
|
316
|
+
|
|
317
|
+
await onSubmit(attachments.length > 0 ? attachments : undefined);
|
|
318
|
+
|
|
319
|
+
logChatTelemetryEvent(
|
|
320
|
+
'chat.inputBar.submitCompleted',
|
|
321
|
+
{
|
|
322
|
+
attachmentsCount: attachments.length,
|
|
323
|
+
hadText: Boolean(hasText),
|
|
324
|
+
},
|
|
325
|
+
0.05,
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
// Clear selected images after successful submission
|
|
329
|
+
setSelectedImages([]);
|
|
330
|
+
} catch (error) {
|
|
331
|
+
console.error('[CHATBOT_FRONTEND] Message submission failed:', {
|
|
332
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
333
|
+
});
|
|
334
|
+
Alert.alert('Error', 'Failed to send message. Please try again.');
|
|
335
|
+
logChatTelemetryEvent(
|
|
336
|
+
'chat.inputBar.submitFailed',
|
|
337
|
+
{
|
|
338
|
+
hasText: Boolean(hasText),
|
|
339
|
+
imageCount: selectedImages.length,
|
|
340
|
+
error:
|
|
341
|
+
error instanceof Error
|
|
342
|
+
? error.message
|
|
343
|
+
: 'Unknown error encountered',
|
|
344
|
+
},
|
|
345
|
+
0.05,
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
}, [input, isLoading, onSubmit, selectedImages]);
|
|
349
|
+
|
|
350
|
+
const canSend = useMemo(() => {
|
|
351
|
+
const hasText = input.trim().length > 0;
|
|
352
|
+
const hasImages = selectedImages.length > 0;
|
|
353
|
+
const allUploaded = selectedImages.every(
|
|
354
|
+
(img) => img.uploadState.status === 'completed',
|
|
355
|
+
);
|
|
356
|
+
const hasErrors = selectedImages.some(
|
|
357
|
+
(img) => img.uploadState.status === 'error',
|
|
358
|
+
);
|
|
359
|
+
const isUploading = selectedImages.some(
|
|
360
|
+
(img) =>
|
|
361
|
+
img.uploadState.status === 'uploading' ||
|
|
362
|
+
img.uploadState.status === 'pending',
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
(hasText || (hasImages && allUploaded)) &&
|
|
367
|
+
!isLoading &&
|
|
368
|
+
!hasErrors &&
|
|
369
|
+
!isUploading
|
|
370
|
+
);
|
|
371
|
+
}, [input, selectedImages, isLoading]);
|
|
372
|
+
|
|
373
|
+
return (
|
|
374
|
+
<View className="">
|
|
375
|
+
<SuggestedMessages
|
|
376
|
+
visible={showSuggestedMessages}
|
|
377
|
+
onSelectMessage={onInputChange}
|
|
378
|
+
/>
|
|
379
|
+
|
|
380
|
+
<View
|
|
381
|
+
className="m-2 mb-4 mt-0 rounded-[30px] border border-neutral-300/60 bg-neutral-50 p-4 dark:border-neutral-700/70 dark:bg-neutral-900"
|
|
382
|
+
testID={testID}
|
|
383
|
+
>
|
|
384
|
+
<ImagePreviewList
|
|
385
|
+
images={selectedImages}
|
|
386
|
+
onRemoveImage={removeSelectedImage}
|
|
387
|
+
onRetryUpload={retryUpload}
|
|
388
|
+
/>
|
|
389
|
+
|
|
390
|
+
{/* Model Selector Row */}
|
|
391
|
+
|
|
392
|
+
<Input
|
|
393
|
+
value={input}
|
|
394
|
+
onChangeText={onInputChange}
|
|
395
|
+
placeholder="Message..."
|
|
396
|
+
multiline
|
|
397
|
+
showClearButton={false}
|
|
398
|
+
className="max-h-32 min-h-12 rounded-2xl border-none px-4 py-0 text-base dark:text-white"
|
|
399
|
+
placeholderTextColor={theme.dark ? '#94a3b8' : '#64748b'}
|
|
400
|
+
accessibilityLabel="Message input"
|
|
401
|
+
accessibilityHint="Type your message to the AI assistant"
|
|
402
|
+
testID="message-input"
|
|
403
|
+
/>
|
|
404
|
+
|
|
405
|
+
{/* Input Row */}
|
|
406
|
+
<View className="w-full flex-row items-center justify-between gap-3">
|
|
407
|
+
<View className="flex-row gap-2">
|
|
408
|
+
<Pressable
|
|
409
|
+
onPress={() => {
|
|
410
|
+
if (selectedImages.length >= maxImages) {
|
|
411
|
+
Alert.alert(
|
|
412
|
+
'Limit reached',
|
|
413
|
+
hasPremium
|
|
414
|
+
? 'You can attach up to 5 images per message.'
|
|
415
|
+
: 'Free plan allows 1 image per message.',
|
|
416
|
+
);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
showImageSourceOptions(handleImageSelection);
|
|
420
|
+
}}
|
|
421
|
+
className="mb-2 rounded-full bg-neutral-100 p-3 dark:bg-neutral-800"
|
|
422
|
+
accessibilityLabel="Attach images"
|
|
423
|
+
accessibilityHint="Attach images from camera or gallery"
|
|
424
|
+
accessibilityRole="button"
|
|
425
|
+
testID="attach-image-button"
|
|
426
|
+
>
|
|
427
|
+
<Feather
|
|
428
|
+
name="paperclip"
|
|
429
|
+
size={20}
|
|
430
|
+
color={theme.dark ? '#94a3b8' : '#64748b'}
|
|
431
|
+
/>
|
|
432
|
+
</Pressable>
|
|
433
|
+
<View className="flex-row items-center justify-between">
|
|
434
|
+
<ModelSelector
|
|
435
|
+
selectedModel={selectedModel}
|
|
436
|
+
onModelSelect={onModelChange || (() => {})}
|
|
437
|
+
testID="chat-model-selector"
|
|
438
|
+
/>
|
|
439
|
+
</View>
|
|
440
|
+
</View>
|
|
441
|
+
|
|
442
|
+
{/* <View className="flex-1">
|
|
443
|
+
<Input
|
|
444
|
+
value={input}
|
|
445
|
+
onChangeText={onInputChange}
|
|
446
|
+
placeholder="Message..."
|
|
447
|
+
multiline
|
|
448
|
+
className="max-h-32 min-h-12 rounded-2xl border border-neutral-300 bg-neutral-50 px-4 py-3 text-base dark:border-neutral-600 dark:bg-neutral-800 dark:text-white"
|
|
449
|
+
placeholderTextColor={theme.dark ? '#94a3b8' : '#64748b'}
|
|
450
|
+
accessibilityLabel="Message input"
|
|
451
|
+
accessibilityHint="Type your message to the AI assistant"
|
|
452
|
+
testID="message-input"
|
|
453
|
+
/>
|
|
454
|
+
</View> */}
|
|
455
|
+
|
|
456
|
+
<Pressable
|
|
457
|
+
onPress={handleSubmit}
|
|
458
|
+
disabled={!canSend}
|
|
459
|
+
className={`mb-2 size-12 items-center justify-center rounded-full ${
|
|
460
|
+
canSend
|
|
461
|
+
? 'bg-neutral-900 dark:bg-white'
|
|
462
|
+
: 'bg-neutral-300 dark:bg-neutral-700'
|
|
463
|
+
}`}
|
|
464
|
+
accessibilityLabel="Send message"
|
|
465
|
+
accessibilityHint="Send your message to the AI assistant"
|
|
466
|
+
testID="send-button"
|
|
467
|
+
>
|
|
468
|
+
{isLoading ? (
|
|
469
|
+
<ActivityIndicator
|
|
470
|
+
size="small"
|
|
471
|
+
color={canSend ? (theme.dark ? '#000' : '#fff') : '#94a3b8'}
|
|
472
|
+
/>
|
|
473
|
+
) : (
|
|
474
|
+
<AntDesign
|
|
475
|
+
name="arrow-up"
|
|
476
|
+
size={20}
|
|
477
|
+
color={canSend ? (theme.dark ? '#000' : '#fff') : '#94a3b8'}
|
|
478
|
+
/>
|
|
479
|
+
)}
|
|
480
|
+
</Pressable>
|
|
481
|
+
</View>
|
|
482
|
+
</View>
|
|
483
|
+
</View>
|
|
484
|
+
);
|
|
485
|
+
};
|