@crievo/omni 0.0.0-stage → 0.1.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/.env.example +41 -0
- package/README.md +2 -2
- package/bin/omni.mjs +14 -0
- package/docs/onboarding/clone-voice.png +0 -0
- package/docs/onboarding/getting-started.png +0 -0
- package/docs/onboarding/new-video.png +0 -0
- package/docs/onboarding/providers.png +0 -0
- package/docs/onboarding/publish.png +0 -0
- package/docs/onboarding/references.png +0 -0
- package/docs/onboarding.md +212 -0
- package/omnivideo.config.example.json +437 -0
- package/package.json +40 -4
- package/reference/captions.md +156 -0
- package/reference/carousel-contract.md +91 -0
- package/reference/cloud.md +96 -0
- package/reference/learnings.md +792 -0
- package/reference/omnichat.md +305 -0
- package/reference/premiere-mcp.md +91 -0
- package/reference/publish.md +305 -0
- package/reference/scenes-contract.md +109 -0
- package/reference/studio.md +666 -0
- package/reference/voicestudio.md +81 -0
- package/reference/writing-for-voice.md +67 -0
- package/requirements.txt +3 -0
- package/studio/api/app.ts +87 -0
- package/studio/api/lib/errors.ts +33 -0
- package/studio/api/lib/files.ts +41 -0
- package/studio/api/lib/hono.ts +9 -0
- package/studio/api/lib/result.ts +14 -0
- package/studio/api/lib/validate.ts +31 -0
- package/studio/api/lib/video.ts +10 -0
- package/studio/api/middleware/json-charset.ts +11 -0
- package/studio/api/middleware/local-only.ts +32 -0
- package/studio/api/middleware/no-timeout.ts +10 -0
- package/studio/api/routes/admin.ts +18 -0
- package/studio/api/routes/agent-cascade.ts +100 -0
- package/studio/api/routes/agent-history.ts +23 -0
- package/studio/api/routes/agent.ts +162 -0
- package/studio/api/routes/analytics.ts +31 -0
- package/studio/api/routes/approval.ts +60 -0
- package/studio/api/routes/archive.ts +12 -0
- package/studio/api/routes/captions.ts +28 -0
- package/studio/api/routes/carousel.ts +38 -0
- package/studio/api/routes/clone.ts +27 -0
- package/studio/api/routes/create.ts +19 -0
- package/studio/api/routes/events.ts +11 -0
- package/studio/api/routes/export.ts +14 -0
- package/studio/api/routes/media.ts +30 -0
- package/studio/api/routes/omnichat.ts +113 -0
- package/studio/api/routes/onboarding.ts +14 -0
- package/studio/api/routes/publish.ts +40 -0
- package/studio/api/routes/queue.ts +14 -0
- package/studio/api/routes/references.ts +40 -0
- package/studio/api/routes/runner.ts +17 -0
- package/studio/api/routes/schedule.ts +47 -0
- package/studio/api/routes/services.ts +11 -0
- package/studio/api/routes/sessions.ts +27 -0
- package/studio/api/routes/settings.ts +102 -0
- package/studio/api/routes/sound.ts +45 -0
- package/studio/api/routes/thumbnail.ts +18 -0
- package/studio/api/routes/usage.ts +13 -0
- package/studio/api/routes/videos.ts +41 -0
- package/studio/api/routes/voices.ts +71 -0
- package/studio/api/services/admin.ts +113 -0
- package/studio/api/services/agent-cascade.ts +975 -0
- package/studio/api/services/agent-claude.ts +47 -0
- package/studio/api/services/agent-history.ts +103 -0
- package/studio/api/services/agent-persona.ts +77 -0
- package/studio/api/services/agent-tools.ts +2237 -0
- package/studio/api/services/agent-ui-tools.ts +259 -0
- package/studio/api/services/agent-wait.ts +32 -0
- package/studio/api/services/agent.ts +553 -0
- package/studio/api/services/analytics.ts +92 -0
- package/studio/api/services/approval.ts +134 -0
- package/studio/api/services/archive.ts +38 -0
- package/studio/api/services/captions.ts +268 -0
- package/studio/api/services/carousel.ts +206 -0
- package/studio/api/services/classify.ts +196 -0
- package/studio/api/services/clone-phrases.ts +75 -0
- package/studio/api/services/clone.ts +722 -0
- package/studio/api/services/create.ts +421 -0
- package/studio/api/services/events.ts +215 -0
- package/studio/api/services/media.ts +32 -0
- package/studio/api/services/omnichat.ts +624 -0
- package/studio/api/services/onboarding.ts +77 -0
- package/studio/api/services/publish.ts +287 -0
- package/studio/api/services/queue.ts +150 -0
- package/studio/api/services/references.ts +269 -0
- package/studio/api/services/root.ts +60 -0
- package/studio/api/services/services.ts +114 -0
- package/studio/api/services/sessions.ts +1007 -0
- package/studio/api/services/settings.ts +983 -0
- package/studio/api/services/sound.ts +311 -0
- package/studio/api/services/thumbnail.ts +133 -0
- package/studio/api/services/usage.ts +27 -0
- package/studio/api/services/videos.ts +418 -0
- package/studio/api/services/voice-pause.ts +98 -0
- package/studio/api/services/voices.ts +324 -0
- package/studio/runner/runner.ts +244 -0
- package/studio/shared/omni-actions.ts +68 -0
- package/studio/shared/omni-admin.ts +52 -0
- package/studio/shared/omni-farewell.ts +48 -0
- package/studio/shared/omni-hotword.ts +20 -0
- package/studio/shared/omni-screens.ts +228 -0
- package/studio/shared/schemas/admin.ts +15 -0
- package/studio/shared/schemas/agent-cascade.ts +58 -0
- package/studio/shared/schemas/agent-history.ts +73 -0
- package/studio/shared/schemas/agent.ts +50 -0
- package/studio/shared/schemas/analytics.ts +6 -0
- package/studio/shared/schemas/approval.ts +22 -0
- package/studio/shared/schemas/captions.ts +19 -0
- package/studio/shared/schemas/carousel.ts +26 -0
- package/studio/shared/schemas/clone.ts +40 -0
- package/studio/shared/schemas/common.ts +16 -0
- package/studio/shared/schemas/omnichat.ts +54 -0
- package/studio/shared/schemas/onboarding.ts +5 -0
- package/studio/shared/schemas/publish.ts +45 -0
- package/studio/shared/schemas/references.ts +20 -0
- package/studio/shared/schemas/settings.ts +82 -0
- package/studio/shared/schemas/sound.ts +22 -0
- package/studio/shared/schemas/videos.ts +38 -0
- package/studio/shared/schemas/voices.ts +23 -0
- package/studio/shared/types/api.ts +1290 -0
- package/studio/studio.ts +148 -0
- package/studio/tsconfig.json +15 -0
- package/studio/web/assets/logos/cartesia.svg +4 -0
- package/studio/web/assets/logos/elevenlabs.svg +12 -0
- package/studio/web/assets/logos/fish.svg +24 -0
- package/studio/web/assets/logos/omni-black.png +0 -0
- package/studio/web/assets/logos/omni-white.png +0 -0
- package/studio/web/assets/logos/voicestudio.svg +21 -0
- package/studio/web/components/AgentMark.tsx +7 -0
- package/studio/web/components/AgentWalking.tsx +11 -0
- package/studio/web/components/ApiKeyField.tsx +104 -0
- package/studio/web/components/AppShell.tsx +64 -0
- package/studio/web/components/ApprovalNotice.tsx +65 -0
- package/studio/web/components/AvatarGroupIcon.tsx +22 -0
- package/studio/web/components/AvatarNameField.tsx +86 -0
- package/studio/web/components/AvatarPicker.tsx +84 -0
- package/studio/web/components/BrandLogo.tsx +16 -0
- package/studio/web/components/CartesiaPlanSetting.tsx +90 -0
- package/studio/web/components/ClaudeWalking.tsx +32 -0
- package/studio/web/components/CloneVoiceDialog/GuidedScript.tsx +39 -0
- package/studio/web/components/CloneVoiceDialog/LanguageBar.tsx +37 -0
- package/studio/web/components/CloneVoiceDialog/LevelMeter.tsx +31 -0
- package/studio/web/components/CloneVoiceDialog/ProviderChoice.tsx +81 -0
- package/studio/web/components/CloneVoiceDialog/QualityPanel.tsx +62 -0
- package/studio/web/components/CloneVoiceDialog/RecordStep.tsx +50 -0
- package/studio/web/components/CloneVoiceDialog/RecorderBar.tsx +79 -0
- package/studio/web/components/CloneVoiceDialog/RedoSummary.tsx +54 -0
- package/studio/web/components/CloneVoiceDialog/SaveStep.tsx +91 -0
- package/studio/web/components/CloneVoiceDialog/SourceBar.tsx +30 -0
- package/studio/web/components/CloneVoiceDialog/index.tsx +141 -0
- package/studio/web/components/CloneVoiceDialog/types.ts +28 -0
- package/studio/web/components/CloneVoiceDialog/useCloneVoice.ts +528 -0
- package/studio/web/components/ConnectionSignals.tsx +51 -0
- package/studio/web/components/EditVoiceDialog/EditVoiceFooter.tsx +72 -0
- package/studio/web/components/EditVoiceDialog/ProviderCards.tsx +81 -0
- package/studio/web/components/EditVoiceDialog/index.tsx +256 -0
- package/studio/web/components/ErrorBanner.tsx +115 -0
- package/studio/web/components/FinishedTask.tsx +41 -0
- package/studio/web/components/FishModelSetting.tsx +69 -0
- package/studio/web/components/FishPriceSetting.tsx +44 -0
- package/studio/web/components/HumanBanner.tsx +64 -0
- package/studio/web/components/Lightbox.tsx +41 -0
- package/studio/web/components/LogStream.tsx +42 -0
- package/studio/web/components/Markdown.tsx +21 -0
- package/studio/web/components/MissingDmsPanel/BatchSend.tsx +137 -0
- package/studio/web/components/MissingDmsPanel/CommentCard.tsx +168 -0
- package/studio/web/components/MissingDmsPanel/CommentFeed.tsx +45 -0
- package/studio/web/components/MissingDmsPanel/DmBubble.tsx +38 -0
- package/studio/web/components/MissingDmsPanel/ReplyComposer.tsx +63 -0
- package/studio/web/components/MissingDmsPanel/index.tsx +98 -0
- package/studio/web/components/NotFound.tsx +48 -0
- package/studio/web/components/Omni/OmniAvatarPicker.tsx +92 -0
- package/studio/web/components/Omni/OmniCards.tsx +202 -0
- package/studio/web/components/Omni/OmniGlow.tsx +183 -0
- package/studio/web/components/Omni/OmniHistory.tsx +119 -0
- package/studio/web/components/Omni/OmniHotword.tsx +40 -0
- package/studio/web/components/Omni/OmniMicSelect.tsx +92 -0
- package/studio/web/components/Omni/OmniVoiceSample.tsx +81 -0
- package/studio/web/components/Omni/OmniWidget.tsx +743 -0
- package/studio/web/components/Omni/PendingActions.tsx +200 -0
- package/studio/web/components/Omni/Transcript.tsx +127 -0
- package/studio/web/components/OmnichatAccountStatus.tsx +87 -0
- package/studio/web/components/OmnichatRulePanel/RuleConfig.tsx +150 -0
- package/studio/web/components/OmnichatRulePanel/RuleDryRun.tsx +15 -0
- package/studio/web/components/OmnichatRulePanel/RuleEnableConfirm.tsx +42 -0
- package/studio/web/components/OmnichatRulePanel/RuleSkeleton.tsx +18 -0
- package/studio/web/components/OmnichatRulePanel/RuleStatus.tsx +55 -0
- package/studio/web/components/OmnichatRulePanel/index.tsx +115 -0
- package/studio/web/components/OmnichatRulePanel/rule-steps.ts +67 -0
- package/studio/web/components/OmnichatRulePanel/steps/MessageStep.tsx +91 -0
- package/studio/web/components/OmnichatRulePanel/steps/RepliesStep.tsx +201 -0
- package/studio/web/components/OmnichatRulePanel/steps/TriggerStep.tsx +76 -0
- package/studio/web/components/OmnichatRulePanel/steps/types.ts +11 -0
- package/studio/web/components/Palette.tsx +17 -0
- package/studio/web/components/PlatformCard.tsx +109 -0
- package/studio/web/components/PlatformIcon.tsx +19 -0
- package/studio/web/components/ProviderCard.tsx +80 -0
- package/studio/web/components/ProviderDetail.tsx +367 -0
- package/studio/web/components/ProviderLogo.tsx +20 -0
- package/studio/web/components/QueuePanel.tsx +77 -0
- package/studio/web/components/ReferenceActions.tsx +89 -0
- package/studio/web/components/ReferencePicker.tsx +136 -0
- package/studio/web/components/ResultMessage.tsx +7 -0
- package/studio/web/components/RuleForm.tsx +138 -0
- package/studio/web/components/RuleLog.tsx +151 -0
- package/studio/web/components/RunningTask.tsx +23 -0
- package/studio/web/components/SampleList.tsx +55 -0
- package/studio/web/components/SessionPanel.tsx +352 -0
- package/studio/web/components/SettingRow.tsx +14 -0
- package/studio/web/components/SettingsCategorySkeleton.tsx +25 -0
- package/studio/web/components/SidePanel.tsx +77 -0
- package/studio/web/components/Sidebar.tsx +289 -0
- package/studio/web/components/StageStepper.tsx +87 -0
- package/studio/web/components/StudioOffline.tsx +80 -0
- package/studio/web/components/TaskName.tsx +17 -0
- package/studio/web/components/TopBanners.tsx +30 -0
- package/studio/web/components/VideoOmnichatPanel.tsx +287 -0
- package/studio/web/components/VoiceAvatar.tsx +33 -0
- package/studio/web/components/VoiceCarousel.tsx +196 -0
- package/studio/web/components/VoiceCategory.tsx +9 -0
- package/studio/web/components/VoiceModal.tsx +39 -0
- package/studio/web/components/VoiceProfileCard.tsx +75 -0
- package/studio/web/components/VoiceProfilePicker.tsx +107 -0
- package/studio/web/components/VoiceProfilesSettings.tsx +150 -0
- package/studio/web/components/VoiceProviderCard.tsx +118 -0
- package/studio/web/components/VoiceProvidersCard.tsx +26 -0
- package/studio/web/components/WaitList.tsx +21 -0
- package/studio/web/components/icons.tsx +247 -0
- package/studio/web/components/ui/accordion.tsx +47 -0
- package/studio/web/components/ui/badge.tsx +18 -0
- package/studio/web/components/ui/calendar.tsx +43 -0
- package/studio/web/components/ui/chart.tsx +229 -0
- package/studio/web/components/ui/checkbox.tsx +26 -0
- package/studio/web/components/ui/cx.ts +2 -0
- package/studio/web/components/ui/date-time-picker.tsx +84 -0
- package/studio/web/components/ui/panel.tsx +23 -0
- package/studio/web/components/ui/picker.tsx +58 -0
- package/studio/web/components/ui/popover.tsx +24 -0
- package/studio/web/components/ui/select.tsx +89 -0
- package/studio/web/components/ui/skeleton.tsx +10 -0
- package/studio/web/components/ui/slider.tsx +68 -0
- package/studio/web/components/ui/switch.tsx +13 -0
- package/studio/web/components/ui/tooltip.test.tsx +30 -0
- package/studio/web/components/ui/tooltip.tsx +59 -0
- package/studio/web/hooks/useAccounts.ts +27 -0
- package/studio/web/hooks/useAdmin.ts +12 -0
- package/studio/web/hooks/useAnalytics.ts +21 -0
- package/studio/web/hooks/useAvatarAudioReactive.ts +87 -0
- package/studio/web/hooks/useBrowserConnect.ts +48 -0
- package/studio/web/hooks/useClonePlan.ts +14 -0
- package/studio/web/hooks/useConnected.ts +7 -0
- package/studio/web/hooks/useLiveQuery.ts +29 -0
- package/studio/web/hooks/useMenuCollapsed.ts +32 -0
- package/studio/web/hooks/useMicDevices.ts +53 -0
- package/studio/web/hooks/useMissingDms.ts +211 -0
- package/studio/web/hooks/useMissingSetupSteps.ts +26 -0
- package/studio/web/hooks/useNow.ts +11 -0
- package/studio/web/hooks/useOmniAgent.ts +278 -0
- package/studio/web/hooks/useOmniClaude.ts +124 -0
- package/studio/web/hooks/useOmniDock.ts +142 -0
- package/studio/web/hooks/useOmniGreeting.ts +60 -0
- package/studio/web/hooks/useOmniHotword.ts +128 -0
- package/studio/web/hooks/useOmnichat.ts +26 -0
- package/studio/web/hooks/useOnboarding.ts +27 -0
- package/studio/web/hooks/usePost.ts +23 -0
- package/studio/web/hooks/useQueue.ts +10 -0
- package/studio/web/hooks/useReferences.ts +20 -0
- package/studio/web/hooks/useRuleEditor.ts +101 -0
- package/studio/web/hooks/useRunner.ts +24 -0
- package/studio/web/hooks/useSaveAction.ts +23 -0
- package/studio/web/hooks/useSchedule.ts +11 -0
- package/studio/web/hooks/useServices.ts +10 -0
- package/studio/web/hooks/useSessions.ts +15 -0
- package/studio/web/hooks/useSettings.ts +11 -0
- package/studio/web/hooks/useSettingsSection.ts +30 -0
- package/studio/web/hooks/useSidePanel.ts +23 -0
- package/studio/web/hooks/useSound.ts +30 -0
- package/studio/web/hooks/useUsage.ts +11 -0
- package/studio/web/hooks/useVideoVoice.ts +36 -0
- package/studio/web/hooks/useVideos.ts +21 -0
- package/studio/web/hooks/useVoiceProfilePreview.ts +52 -0
- package/studio/web/hooks/useVoiceProfiles.ts +7 -0
- package/studio/web/hooks/useVoiceRunning.ts +10 -0
- package/studio/web/hooks/useVoiceStudioClosed.ts +8 -0
- package/studio/web/index.html +19 -0
- package/studio/web/lib/agent.ts +7 -0
- package/studio/web/lib/alerts.ts +210 -0
- package/studio/web/lib/analytics-metrics.ts +351 -0
- package/studio/web/lib/api.ts +70 -0
- package/studio/web/lib/audio.ts +39 -0
- package/studio/web/lib/avatars.ts +41 -0
- package/studio/web/lib/calendar.ts +218 -0
- package/studio/web/lib/caption-position.ts +249 -0
- package/studio/web/lib/carousel.ts +24 -0
- package/studio/web/lib/chime.ts +42 -0
- package/studio/web/lib/clone-voice.ts +55 -0
- package/studio/web/lib/export.ts +11 -0
- package/studio/web/lib/files.ts +8 -0
- package/studio/web/lib/format.ts +93 -0
- package/studio/web/lib/media.ts +29 -0
- package/studio/web/lib/mic-device.ts +72 -0
- package/studio/web/lib/missing-dms.ts +70 -0
- package/studio/web/lib/omni-cards.ts +42 -0
- package/studio/web/lib/omni-cascade.ts +1067 -0
- package/studio/web/lib/omni-greeting-audio.ts +24 -0
- package/studio/web/lib/omni-hotword.ts +231 -0
- package/studio/web/lib/omni-panel.ts +67 -0
- package/studio/web/lib/omni-realtime.ts +811 -0
- package/studio/web/lib/omni-ui.ts +402 -0
- package/studio/web/lib/omni-wait.ts +174 -0
- package/studio/web/lib/omnichat-api.ts +44 -0
- package/studio/web/lib/orb.ts +270 -0
- package/studio/web/lib/pcm-recorder.ts +115 -0
- package/studio/web/lib/platforms.ts +17 -0
- package/studio/web/lib/providers.ts +27 -0
- package/studio/web/lib/publish-draft.ts +52 -0
- package/studio/web/lib/publish-settings.ts +81 -0
- package/studio/web/lib/query-client.ts +122 -0
- package/studio/web/lib/references.ts +13 -0
- package/studio/web/lib/services.ts +40 -0
- package/studio/web/lib/sessions.ts +103 -0
- package/studio/web/lib/settings-categories.ts +58 -0
- package/studio/web/lib/sound-audio.ts +33 -0
- package/studio/web/lib/sound-timeline.ts +291 -0
- package/studio/web/lib/sse.ts +86 -0
- package/studio/web/lib/stage-history.ts +141 -0
- package/studio/web/lib/stages.ts +344 -0
- package/studio/web/lib/studio-offline.ts +60 -0
- package/studio/web/lib/upload.ts +24 -0
- package/studio/web/lib/video-tabs.ts +118 -0
- package/studio/web/lib/voice-profile-draft.ts +34 -0
- package/studio/web/lib/voice-profiles.ts +3 -0
- package/studio/web/main.tsx +14 -0
- package/studio/web/pages/AdminPage/index.tsx +123 -0
- package/studio/web/pages/AgentPage/components/Measurements.tsx +102 -0
- package/studio/web/pages/AgentPage/index.tsx +28 -0
- package/studio/web/pages/AnalyticsPage/components/About.tsx +52 -0
- package/studio/web/pages/AnalyticsPage/components/ChannelCards.tsx +106 -0
- package/studio/web/pages/AnalyticsPage/components/ChannelView.tsx +137 -0
- package/studio/web/pages/AnalyticsPage/components/CollectionStatus.tsx +46 -0
- package/studio/web/pages/AnalyticsPage/components/Comparison.tsx +68 -0
- package/studio/web/pages/AnalyticsPage/components/Diagnosis.tsx +50 -0
- package/studio/web/pages/AnalyticsPage/components/Highlights.tsx +49 -0
- package/studio/web/pages/AnalyticsPage/components/Hint.tsx +11 -0
- package/studio/web/pages/AnalyticsPage/components/HookVsBody.tsx +100 -0
- package/studio/web/pages/AnalyticsPage/components/HourlyWave.tsx +133 -0
- package/studio/web/pages/AnalyticsPage/components/Insights.tsx +70 -0
- package/studio/web/pages/AnalyticsPage/components/MetricCard.tsx +46 -0
- package/studio/web/pages/AnalyticsPage/components/PlanSection.tsx +40 -0
- package/studio/web/pages/AnalyticsPage/components/ProgressionChart.tsx +155 -0
- package/studio/web/pages/AnalyticsPage/components/ReelBarsChart.tsx +154 -0
- package/studio/web/pages/AnalyticsPage/components/ReelThumb.tsx +19 -0
- package/studio/web/pages/AnalyticsPage/components/ReelView.tsx +290 -0
- package/studio/web/pages/AnalyticsPage/components/ReelsTable.tsx +269 -0
- package/studio/web/pages/AnalyticsPage/components/RequestWithFocus.tsx +38 -0
- package/studio/web/pages/AnalyticsPage/components/SegmentedControl.tsx +35 -0
- package/studio/web/pages/AnalyticsPage/components/VsMedian.tsx +31 -0
- package/studio/web/pages/AnalyticsPage/index.tsx +17 -0
- package/studio/web/pages/GettingStartedPage/index.tsx +174 -0
- package/studio/web/pages/NewVideoPage/components/DeliverablesPicker.tsx +62 -0
- package/studio/web/pages/NewVideoPage/components/FormatPicker.tsx +33 -0
- package/studio/web/pages/NewVideoPage/index.tsx +133 -0
- package/studio/web/pages/NotFoundPage/index.tsx +9 -0
- package/studio/web/pages/OmnichatPage/components/NewFromLink.tsx +59 -0
- package/studio/web/pages/OmnichatPage/components/RuleListItem.tsx +64 -0
- package/studio/web/pages/OmnichatPage/components/RulePreview.tsx +14 -0
- package/studio/web/pages/OmnichatPage/components/RuleView.tsx +88 -0
- package/studio/web/pages/OmnichatPage/index.tsx +153 -0
- package/studio/web/pages/QueuePage/index.tsx +22 -0
- package/studio/web/pages/ReferencePage/components/ReferenceTexts.tsx +131 -0
- package/studio/web/pages/ReferencePage/index.tsx +216 -0
- package/studio/web/pages/ReferencesPage/components/NewReferenceForm.tsx +150 -0
- package/studio/web/pages/ReferencesPage/components/ReferenceCard.tsx +42 -0
- package/studio/web/pages/ReferencesPage/components/ReferenceGridSkeleton.tsx +31 -0
- package/studio/web/pages/ReferencesPage/index.tsx +67 -0
- package/studio/web/pages/SchedulePage/components/CalendarSkeleton.tsx +18 -0
- package/studio/web/pages/SchedulePage/components/DayView.tsx +177 -0
- package/studio/web/pages/SchedulePage/components/HourPicker.tsx +103 -0
- package/studio/web/pages/SchedulePage/components/MonthDayCell.tsx +111 -0
- package/studio/web/pages/SchedulePage/components/MonthView.tsx +47 -0
- package/studio/web/pages/SchedulePage/components/PlatformIcons.tsx +12 -0
- package/studio/web/pages/SchedulePage/components/PostThumb.tsx +15 -0
- package/studio/web/pages/SchedulePage/components/WeekColumn.tsx +75 -0
- package/studio/web/pages/SchedulePage/components/WeekView.tsx +35 -0
- package/studio/web/pages/SchedulePage/index.tsx +285 -0
- package/studio/web/pages/SettingsPage/components/AgentAccounts.tsx +263 -0
- package/studio/web/pages/SettingsPage/components/AgentCategory.tsx +20 -0
- package/studio/web/pages/SettingsPage/components/ModelPicker.tsx +49 -0
- package/studio/web/pages/SettingsPage/components/ModelsSettings.tsx +138 -0
- package/studio/web/pages/SettingsPage/components/PlatformsCategory.tsx +23 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/AccountStatus.tsx +29 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/AutoPublishPanel.tsx +90 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/BrowserConnect.tsx +62 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/CheckField.tsx +19 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/InstagramPanel.tsx +113 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/OmnichatSettingsPanel.tsx +146 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SaveBar.tsx +33 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SchedulePanel.tsx +132 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCard.tsx +47 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCardGroup.tsx +19 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/TextPanel.tsx +55 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/TiktokPanel.tsx +123 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/YoutubePanel.tsx +100 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/badges.tsx +15 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/index.tsx +40 -0
- package/studio/web/pages/SettingsPage/components/PublishingCategory/types.ts +10 -0
- package/studio/web/pages/SettingsPage/components/UsageCategory.tsx +389 -0
- package/studio/web/pages/SettingsPage/components/VoiceProvidersCategory.tsx +97 -0
- package/studio/web/pages/SettingsPage/index.tsx +85 -0
- package/studio/web/pages/VideoPage/components/AudioPlayer.tsx +113 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/AxisField.tsx +50 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionList.tsx +56 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionListItem.tsx +92 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionMargins.tsx +57 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionStyleFields.tsx +70 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionTextForm.tsx +87 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/ColorField.tsx +37 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/MarginField.tsx +59 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/NumberField.tsx +57 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/PositionControls.tsx +140 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/captionEditor.ts +215 -0
- package/studio/web/pages/VideoPage/components/CaptionPositionEditor/useCaptionPosition.ts +154 -0
- package/studio/web/pages/VideoPage/components/CarouselChangeRequest.tsx +72 -0
- package/studio/web/pages/VideoPage/components/CarouselCompositionStage.tsx +80 -0
- package/studio/web/pages/VideoPage/components/CarouselCreate.tsx +63 -0
- package/studio/web/pages/VideoPage/components/CarouselMissing.tsx +19 -0
- package/studio/web/pages/VideoPage/components/CarouselPublishStage.tsx +173 -0
- package/studio/web/pages/VideoPage/components/CarouselScriptStage.tsx +82 -0
- package/studio/web/pages/VideoPage/components/CarouselSlideCard.tsx +49 -0
- package/studio/web/pages/VideoPage/components/CarouselViewer.tsx +55 -0
- package/studio/web/pages/VideoPage/components/ChangedVoices.tsx +53 -0
- package/studio/web/pages/VideoPage/components/CompositionStage.tsx +78 -0
- package/studio/web/pages/VideoPage/components/CoverPicker.tsx +32 -0
- package/studio/web/pages/VideoPage/components/EditorStage.tsx +53 -0
- package/studio/web/pages/VideoPage/components/LineTakes.tsx +160 -0
- package/studio/web/pages/VideoPage/components/LineTextEditor.tsx +124 -0
- package/studio/web/pages/VideoPage/components/LineVoicePicker.tsx +37 -0
- package/studio/web/pages/VideoPage/components/MediaImage.tsx +25 -0
- package/studio/web/pages/VideoPage/components/MotionScriptStage.tsx +39 -0
- package/studio/web/pages/VideoPage/components/NarrationStage.tsx +70 -0
- package/studio/web/pages/VideoPage/components/PublishForm.tsx +387 -0
- package/studio/web/pages/VideoPage/components/PublishStage.tsx +76 -0
- package/studio/web/pages/VideoPage/components/PublishText.tsx +149 -0
- package/studio/web/pages/VideoPage/components/ScenesApprovalPanel.tsx +278 -0
- package/studio/web/pages/VideoPage/components/ScheduledInfo.tsx +72 -0
- package/studio/web/pages/VideoPage/components/ScriptApprovalPanel.tsx +189 -0
- package/studio/web/pages/VideoPage/components/ScriptStage.tsx +17 -0
- package/studio/web/pages/VideoPage/components/SequencePlayer.tsx +146 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/AddSound.tsx +117 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/AreaSelection.tsx +74 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/BedPanel.tsx +94 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/BedRow.tsx +45 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionOverlay.tsx +44 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionSaveBar.tsx +32 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionsPanel.tsx +22 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/ClipBlock.tsx +111 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/ClipPanel.tsx +76 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/CutsPanel.tsx +44 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EditorTabBar.tsx +73 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectChoice.tsx +46 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectItem.tsx +89 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectPanel.tsx +232 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/EffectsRow.tsx +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/Lane.tsx +39 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/MarkerRow.tsx +40 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/MuteButton.tsx +36 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/NumberInput.tsx +37 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PlanWarnings.tsx +19 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PlayerResizeHandle.tsx +50 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/PreviewControls.tsx +51 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SceneRow.tsx +54 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SettingsPanel.tsx +65 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SoundLibrary.tsx +99 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SoundPreview.tsx +82 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/SpeedPanel.tsx +128 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineDock.tsx +56 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineFooter.tsx +26 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineSkeleton.tsx +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineToolbar.tsx +160 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineTracks.tsx +121 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/TrackSidebar.tsx +30 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/VoiceRow.tsx +53 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/Waveform.tsx +97 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/clipActions.ts +50 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/effectActions.ts +161 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/index.tsx +161 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/timelineGeometry.ts +45 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/types.ts +43 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useAutosave.ts +107 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useEditorShortcuts.ts +168 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useFitHeight.ts +40 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useFollowPlayhead.ts +21 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useListenMix.ts +43 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayback.ts +231 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayerWidth.ts +27 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundData.ts +124 -0
- package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundTimeline.ts +511 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/CompareVersions.tsx +111 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionCard.tsx +81 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionMedia.tsx +24 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/VersionText.tsx +15 -0
- package/studio/web/pages/VideoPage/components/StageDrawer/index.tsx +109 -0
- package/studio/web/pages/VideoPage/components/StageProcess.tsx +126 -0
- package/studio/web/pages/VideoPage/components/StageResult.tsx +69 -0
- package/studio/web/pages/VideoPage/components/SwapReference.tsx +92 -0
- package/studio/web/pages/VideoPage/components/ThumbnailPanel.tsx +252 -0
- package/studio/web/pages/VideoPage/components/TimingPanel.tsx +89 -0
- package/studio/web/pages/VideoPage/components/VideoPlayer.tsx +18 -0
- package/studio/web/pages/VideoPage/components/VideoSkeleton.tsx +50 -0
- package/studio/web/pages/VideoPage/components/VideoVoiceInfo.tsx +33 -0
- package/studio/web/pages/VideoPage/components/VideoVoicePicker.tsx +165 -0
- package/studio/web/pages/VideoPage/components/VoicePauseBanner.tsx +56 -0
- package/studio/web/pages/VideoPage/components/WithLogo.tsx +10 -0
- package/studio/web/pages/VideoPage/index.tsx +295 -0
- package/studio/web/pages/VideosPage/components/PublishedOn.tsx +85 -0
- package/studio/web/pages/VideosPage/components/ServicesPanel.tsx +81 -0
- package/studio/web/pages/VideosPage/components/SessionsPanel.tsx +62 -0
- package/studio/web/pages/VideosPage/components/VideoListSkeleton.tsx +25 -0
- package/studio/web/pages/VideosPage/components/VideoRow.tsx +122 -0
- package/studio/web/pages/VideosPage/index.tsx +134 -0
- package/studio/web/pages/VoicePage/index.tsx +28 -0
- package/studio/web/router.tsx +201 -0
- package/studio/web/styles/base/elements.css +55 -0
- package/studio/web/styles/base/utilities.css +25 -0
- package/studio/web/styles/components/badge.css +33 -0
- package/studio/web/styles/components/claude-running.css +27 -0
- package/studio/web/styles/components/claude-session.css +212 -0
- package/studio/web/styles/components/claude-walking.css +92 -0
- package/studio/web/styles/components/clone-voice-save.css +136 -0
- package/studio/web/styles/components/clone-voice.css +379 -0
- package/studio/web/styles/components/controls.css +70 -0
- package/studio/web/styles/components/data-and-image.css +54 -0
- package/studio/web/styles/components/forms.css +132 -0
- package/studio/web/styles/components/human-banner.css +99 -0
- package/studio/web/styles/components/lightbox.css +50 -0
- package/studio/web/styles/components/markdown.css +68 -0
- package/studio/web/styles/components/modal.css +70 -0
- package/studio/web/styles/components/omni-cards.css +105 -0
- package/studio/web/styles/components/omni.css +859 -0
- package/studio/web/styles/components/omnichat.css +538 -0
- package/studio/web/styles/components/panel.css +115 -0
- package/studio/web/styles/components/platform-card.css +140 -0
- package/studio/web/styles/components/provider-card.css +132 -0
- package/studio/web/styles/components/queue.css +185 -0
- package/studio/web/styles/components/reference-actions.css +133 -0
- package/studio/web/styles/components/reference-picker.css +146 -0
- package/studio/web/styles/components/results-drawer.css +224 -0
- package/studio/web/styles/components/segmented.css +115 -0
- package/studio/web/styles/components/side-panel-tab.css +23 -0
- package/studio/web/styles/components/status-signals.css +66 -0
- package/studio/web/styles/components/stepper.css +208 -0
- package/studio/web/styles/components/table.css +19 -0
- package/studio/web/styles/components/tabs.css +24 -0
- package/studio/web/styles/components/ui/accordion.css +71 -0
- package/studio/web/styles/components/ui/chart.css +162 -0
- package/studio/web/styles/components/ui/checkbox.css +37 -0
- package/studio/web/styles/components/ui/date-picker.css +153 -0
- package/studio/web/styles/components/ui/select.css +110 -0
- package/studio/web/styles/components/ui/skeleton.css +25 -0
- package/studio/web/styles/components/ui/slider.css +81 -0
- package/studio/web/styles/components/ui/switch.css +41 -0
- package/studio/web/styles/components/ui/tooltip.css +24 -0
- package/studio/web/styles/components/voice-carousel.css +255 -0
- package/studio/web/styles/components/voice-editor.css +179 -0
- package/studio/web/styles/components/voice-grid.css +56 -0
- package/studio/web/styles/components/voice-profiles.css +192 -0
- package/studio/web/styles/design-system.md +136 -0
- package/studio/web/styles/index.css +116 -0
- package/studio/web/styles/layout/page.css +41 -0
- package/studio/web/styles/layout/sidebar-groups.css +39 -0
- package/studio/web/styles/layout/sidebar.css +111 -0
- package/studio/web/styles/pages/agent.css +26 -0
- package/studio/web/styles/pages/analytics/dashboard.css +614 -0
- package/studio/web/styles/pages/analytics/insights.css +48 -0
- package/studio/web/styles/pages/getting-started.css +166 -0
- package/studio/web/styles/pages/new-video/form.css +32 -0
- package/studio/web/styles/pages/not-found.css +59 -0
- package/studio/web/styles/pages/references.css +204 -0
- package/studio/web/styles/pages/schedule/calendar.css +541 -0
- package/studio/web/styles/pages/schedule/chip-states.css +60 -0
- package/studio/web/styles/pages/settings/models.css +72 -0
- package/studio/web/styles/pages/settings/shell.css +361 -0
- package/studio/web/styles/pages/settings/usage.css +63 -0
- package/studio/web/styles/pages/studio-offline.css +105 -0
- package/studio/web/styles/pages/video/caption-controls.css +194 -0
- package/studio/web/styles/pages/video/captions-grid.css +70 -0
- package/studio/web/styles/pages/video/captions.css +79 -0
- package/studio/web/styles/pages/video/editor-chat.css +103 -0
- package/studio/web/styles/pages/video/export.css +50 -0
- package/studio/web/styles/pages/video/frames.css +29 -0
- package/studio/web/styles/pages/video/fullscreen-stage.css +400 -0
- package/studio/web/styles/pages/video/instagram-carousel.css +309 -0
- package/studio/web/styles/pages/video/layout.css +285 -0
- package/studio/web/styles/pages/video/narration.css +138 -0
- package/studio/web/styles/pages/video/preview-overview.css +11 -0
- package/studio/web/styles/pages/video/processing-notice.css +34 -0
- package/studio/web/styles/pages/video/publish-when.css +76 -0
- package/studio/web/styles/pages/video/publish.css +97 -0
- package/studio/web/styles/pages/video/result.css +96 -0
- package/studio/web/styles/pages/video/scenes.css +167 -0
- package/studio/web/styles/pages/video/sound-timeline.css +672 -0
- package/studio/web/styles/pages/video/sound-toolbar.css +149 -0
- package/studio/web/styles/pages/video/take-player.css +100 -0
- package/studio/web/styles/pages/video/thumbnail.css +157 -0
- package/studio/web/styles/pages/video/timeline.css +117 -0
- package/studio/web/styles/pages/video/voice-picker.css +14 -0
- package/studio/web/styles/pages/video-list/active-row.css +27 -0
- package/studio/web/styles/pages/video-list/card-link.css +49 -0
- package/studio/web/styles/pages/video-list/list.css +86 -0
- package/studio/web/styles/theme/identity/details.css +204 -0
- package/studio/web/styles/theme/identity/shell.css +249 -0
- package/studio/web/styles/theme/identity/surfaces.css +183 -0
- package/studio/web/styles/theme/identity/titles-and-buttons.css +120 -0
- package/studio/web/styles/theme/no-borders/blocks.css +208 -0
- package/studio/web/styles/theme/no-borders/controls.css +256 -0
- package/studio/web/styles/tokens.css +245 -0
- package/studio/web/types/api.ts +2 -0
- package/studio/web/types/assets.d.ts +9 -0
- package/templates/brief.md +27 -0
- package/templates/captions.html +204 -0
- package/templates/carousel-composition.md +47 -0
- package/templates/carousel-script.md +60 -0
- package/templates/components/voiceavatar/README.md +87 -0
- package/templates/components/voiceavatar/demo.html +50 -0
- package/templates/components/voiceavatar/voiceavatar.js +415 -0
- package/templates/motion.md +80 -0
- package/templates/playbook.md +43 -0
- package/templates/reference.md +123 -0
- package/templates/scene.html +112 -0
- package/templates/scenes.example.json +96 -0
- package/templates/script.md +63 -0
- package/templates/slide.html +71 -0
- package/templates/wireframe.html +91 -0
- package/tools/analysis.mjs +300 -0
- package/tools/approval.mjs +442 -0
- package/tools/assemble.mjs +942 -0
- package/tools/build-motion.mjs +437 -0
- package/tools/captions.mjs +246 -0
- package/tools/carousel.mjs +558 -0
- package/tools/compose.mjs +307 -0
- package/tools/cuts.mjs +74 -0
- package/tools/editor.mjs +419 -0
- package/tools/epidemic-capture.js +54 -0
- package/tools/fanout.mjs +69 -0
- package/tools/history.mjs +70 -0
- package/tools/history.py +61 -0
- package/tools/job-queue.mjs +180 -0
- package/tools/job_queue.py +430 -0
- package/tools/lib/agents.mjs +412 -0
- package/tools/lib/channel.mjs +399 -0
- package/tools/lib/claude-settings.mjs +67 -0
- package/tools/lib/cli.mjs +9 -0
- package/tools/lib/fanout.mjs +234 -0
- package/tools/lib/http.mjs +94 -0
- package/tools/lib/index.js +14 -0
- package/tools/lib/mcp-server.mjs +69 -0
- package/tools/lib/metrics/metrics.mjs +204 -0
- package/tools/lib/narration.mjs +15 -0
- package/tools/lib/oauth-client.mjs +295 -0
- package/tools/lib/omnichat/config.mjs +139 -0
- package/tools/lib/omnichat/errors.mjs +42 -0
- package/tools/lib/omnichat/extract.mjs +82 -0
- package/tools/lib/omnichat/gate.mjs +151 -0
- package/tools/lib/omnichat/manual.mjs +166 -0
- package/tools/lib/omnichat/match.mjs +78 -0
- package/tools/lib/omnichat/pass.mjs +393 -0
- package/tools/lib/omnichat/record.mjs +208 -0
- package/tools/lib/omnichat/text.mjs +315 -0
- package/tools/lib/omnichat/webhook.mjs +166 -0
- package/tools/lib/pairing.mjs +99 -0
- package/tools/lib/paths.mjs +41 -0
- package/tools/lib/platforms/instagram.mjs +469 -0
- package/tools/lib/platforms/tiktok.mjs +343 -0
- package/tools/lib/platforms/youtube.mjs +228 -0
- package/tools/lib/publish/publish.mjs +244 -0
- package/tools/lib/schedule/schedule.mjs +191 -0
- package/tools/lib/service.mjs +134 -0
- package/tools/lib/skill-client.mjs +126 -0
- package/tools/lib/skills-release.mjs +196 -0
- package/tools/lib/testing.mjs +52 -0
- package/tools/lib/up.mjs +187 -0
- package/tools/metrics.mjs +415 -0
- package/tools/models.mjs +134 -0
- package/tools/narrate.mjs +257 -0
- package/tools/omni.mjs +298 -0
- package/tools/omni_paths.py +12 -0
- package/tools/omnichat.mjs +1577 -0
- package/tools/omnivideo.py +1122 -0
- package/tools/package.mjs +130 -0
- package/tools/platforms.mjs +236 -0
- package/tools/premiere.mjs +533 -0
- package/tools/publish.mjs +1496 -0
- package/tools/reference.mjs +1408 -0
- package/tools/render.mjs +426 -0
- package/tools/runner.mjs +156 -0
- package/tools/setup.mjs +466 -0
- package/tools/skills-release.mjs +93 -0
- package/tools/sound.mjs +1323 -0
- package/tools/soundtrack.mjs +217 -0
- package/tools/thumbnail.mjs +271 -0
- package/tools/timing.mjs +108 -0
- package/tools/usage.py +628 -0
- package/tools/voice-envelope.mjs +185 -0
- package/tools/voice.py +448 -0
- package/tools/voice_sample.py +75 -0
- package/tools/wireframe.mjs +230 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { hasProviderKey, PROVIDER_NAME, type VoiceProviderId } from "../../lib/providers";
|
|
2
|
+
import { cardOrder, missingIds, type ProfileDraft } from "../../lib/voice-profile-draft";
|
|
3
|
+
import type { Settings, VoiceProfile } from "../../types/api";
|
|
4
|
+
import { VoiceProviderCard } from "../VoiceProviderCard";
|
|
5
|
+
|
|
6
|
+
/* the voice's provider cards (checked ones first, in priority order) and what is still missing */
|
|
7
|
+
export function ProviderCards({
|
|
8
|
+
draft: r,
|
|
9
|
+
profile,
|
|
10
|
+
settings,
|
|
11
|
+
vsClosed,
|
|
12
|
+
saving,
|
|
13
|
+
listening,
|
|
14
|
+
listeningId,
|
|
15
|
+
onListen,
|
|
16
|
+
onToggle,
|
|
17
|
+
onMove,
|
|
18
|
+
onConfigure,
|
|
19
|
+
}: {
|
|
20
|
+
draft: ProfileDraft;
|
|
21
|
+
profile: VoiceProfile | undefined;
|
|
22
|
+
settings: Settings;
|
|
23
|
+
vsClosed: boolean;
|
|
24
|
+
saving: boolean;
|
|
25
|
+
listening: "generating" | "playing" | null;
|
|
26
|
+
listeningId: string | null;
|
|
27
|
+
onListen: (profile: string, provider: VoiceProviderId) => void;
|
|
28
|
+
onToggle: (p: VoiceProviderId) => void;
|
|
29
|
+
onMove: (i: number, d: -1 | 1) => void;
|
|
30
|
+
onConfigure: (p: VoiceProviderId) => void;
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<div className="clone-cards" role="group" aria-label="Provedores desta voz">
|
|
35
|
+
{/* the checked ones come in priority order, so up/down swaps the card's place */}
|
|
36
|
+
{cardOrder(r.order).map(p => {
|
|
37
|
+
const checked = r.order.includes(p);
|
|
38
|
+
const i = r.order.indexOf(p);
|
|
39
|
+
const key = profile ? `${profile.id}:${p}` : "";
|
|
40
|
+
/* the sample comes from what is saved in the voice: only a provider already saved in it plays */
|
|
41
|
+
const saved = !!profile && checked && profile.order.includes(p);
|
|
42
|
+
return (
|
|
43
|
+
<VoiceProviderCard
|
|
44
|
+
key={p}
|
|
45
|
+
id={p}
|
|
46
|
+
checked={checked}
|
|
47
|
+
has={hasProviderKey(settings, p)}
|
|
48
|
+
closed={p === "voicestudio" && vsClosed}
|
|
49
|
+
noVoice={!r.ids[p].trim()}
|
|
50
|
+
position={i}
|
|
51
|
+
total={r.order.length}
|
|
52
|
+
disabled={saving}
|
|
53
|
+
onToggle={() => onToggle(p)}
|
|
54
|
+
onMove={d => onMove(i, d)}
|
|
55
|
+
onConfigure={() => onConfigure(p)}
|
|
56
|
+
listen={
|
|
57
|
+
saved && profile
|
|
58
|
+
? {
|
|
59
|
+
playing: listeningId === key && listening === "playing",
|
|
60
|
+
busy: listening === "generating" && listeningId !== key,
|
|
61
|
+
onListen: () => onListen(profile.id, p),
|
|
62
|
+
}
|
|
63
|
+
: undefined
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
</div>
|
|
69
|
+
{r.order.length === 0 && <small className="subtle warning">Marque ao menos um provedor para esta voz.</small>}
|
|
70
|
+
{missingIds(r).length > 0 && (
|
|
71
|
+
<small className="subtle warning">
|
|
72
|
+
Falta o Voice ID de{" "}
|
|
73
|
+
{missingIds(r)
|
|
74
|
+
.map(p => PROVIDER_NAME[p])
|
|
75
|
+
.join(", ")}
|
|
76
|
+
: abra "Configurar" para criar a voz ali ou colar o Voice ID.
|
|
77
|
+
</small>
|
|
78
|
+
)}
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/* Editar voz (and "Já tenho voz criada"), from Configurações → Voz (VoiceProfilesSettings): avatar
|
|
2
|
+
and name on the right, providers on the left. The provider card shows only the status;
|
|
3
|
+
"Configurar" opens its view (ProviderDetail) with what it asks for (API key, model, Voice ID).
|
|
4
|
+
With more than one checked, the order is the usage priority, and the next ones are fallback. API
|
|
5
|
+
key and model apply to all the provider's voices and save immediately; the Voice ID and the
|
|
6
|
+
order belong to the voice and save on "Salvar voz". */
|
|
7
|
+
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
|
+
import { useAvatarAudioReactive } from "../../hooks/useAvatarAudioReactive";
|
|
10
|
+
import { useVoiceProfilePreview } from "../../hooks/useVoiceProfilePreview";
|
|
11
|
+
import { useVoiceStudioClosed } from "../../hooks/useVoiceStudioClosed";
|
|
12
|
+
import { type ActionResult, api, send } from "../../lib/api";
|
|
13
|
+
import { shuffleAvatars } from "../../lib/avatars";
|
|
14
|
+
import { hasProviderKey, PROVIDER_NAME, type VoiceProviderId } from "../../lib/providers";
|
|
15
|
+
import { draftFromProfile, type ProfileDraft, savedIds } from "../../lib/voice-profile-draft";
|
|
16
|
+
import { NAME_MAX, NAME_MIN } from "../../lib/voice-profiles";
|
|
17
|
+
import type { Settings, VoiceProfile } from "../../types/api";
|
|
18
|
+
import { AvatarNameField } from "../AvatarNameField";
|
|
19
|
+
import { ArrowLeft } from "../icons";
|
|
20
|
+
import { ProviderDetail } from "../ProviderDetail";
|
|
21
|
+
import { VoiceModal } from "../VoiceModal";
|
|
22
|
+
import { EditVoiceFooter } from "./EditVoiceFooter";
|
|
23
|
+
import { ProviderCards } from "./ProviderCards";
|
|
24
|
+
|
|
25
|
+
/* `profile` undefined: the new voice from "já tenho voz criada nos provedores" (name and Voice IDs).
|
|
26
|
+
`warnings`: the clone just failed on some provider; they stay on top until it is created again there. */
|
|
27
|
+
export function EditVoiceDialog({
|
|
28
|
+
settings,
|
|
29
|
+
profile,
|
|
30
|
+
reload,
|
|
31
|
+
onClose,
|
|
32
|
+
onSave,
|
|
33
|
+
onCloneInstead,
|
|
34
|
+
onRedo,
|
|
35
|
+
onRemove,
|
|
36
|
+
warnings = [],
|
|
37
|
+
}: {
|
|
38
|
+
settings: Settings;
|
|
39
|
+
profile: VoiceProfile | undefined;
|
|
40
|
+
reload: () => void;
|
|
41
|
+
onClose: () => void;
|
|
42
|
+
onSave: (id: string) => void;
|
|
43
|
+
onCloneInstead: () => void;
|
|
44
|
+
onRedo: () => void;
|
|
45
|
+
onRemove: (output: string) => void;
|
|
46
|
+
warnings?: string[];
|
|
47
|
+
}) {
|
|
48
|
+
const isNew = !profile;
|
|
49
|
+
const [r, setR] = useState<ProfileDraft>(() => draftFromProfile(profile, settings.voice.voicestudio.profile));
|
|
50
|
+
const [detail, setDetail] = useState<VoiceProviderId | null>(null);
|
|
51
|
+
const [avatars, setAvatars] = useState<string[]>(() =>
|
|
52
|
+
profile ? [profile.avatar || profile.id, ...shuffleAvatars().slice(0, 9)] : shuffleAvatars(),
|
|
53
|
+
);
|
|
54
|
+
const [avatar, setAvatar] = useState(0);
|
|
55
|
+
const [saving, setSaving] = useState(false);
|
|
56
|
+
const [result, setResult] = useState<ActionResult>(null);
|
|
57
|
+
const [confirmRemove, setConfirmRemove] = useState(false);
|
|
58
|
+
const [warningsSeen, setWarningsSeen] = useState(false);
|
|
59
|
+
const root = useRef<HTMLDivElement>(null);
|
|
60
|
+
const { listening, listeningId, error: sampleError, listen, analyser } = useVoiceProfilePreview();
|
|
61
|
+
const vsClosed = useVoiceStudioClosed();
|
|
62
|
+
useAvatarAudioReactive(listening === "playing", root, analyser, rz =>
|
|
63
|
+
Array.from(rz.querySelectorAll<HTMLCanvasElement>(".carousel-item.d0 .voice-avatar")),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
/* the voice may have an old name longer than the new limit: it still counts, it just doesn't grow */
|
|
67
|
+
const max = Math.max(NAME_MAX, profile?.name.length ?? 0);
|
|
68
|
+
const name = r.name.trim();
|
|
69
|
+
const nameValid = name.length >= NAME_MIN && name.length <= max;
|
|
70
|
+
const idsOk = r.order.length > 0 && r.order.every(p => r.ids[p].trim());
|
|
71
|
+
const canSave = !saving && nameValid && idsOk;
|
|
72
|
+
|
|
73
|
+
const toggle = (p: VoiceProviderId) => {
|
|
74
|
+
if (r.order.includes(p)) {
|
|
75
|
+
/* the Voice ID stays in the draft: without it the card doesn't check again; what removes it
|
|
76
|
+
from the voice is "Salvar voz", which only sends the checked ones */
|
|
77
|
+
setR({ ...r, order: r.order.filter(x => x !== p) });
|
|
78
|
+
if (detail === p) setDetail(null);
|
|
79
|
+
} else {
|
|
80
|
+
setR({ ...r, order: [...r.order, p] });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const move = (i: number, d: -1 | 1) => {
|
|
84
|
+
const order = [...r.order];
|
|
85
|
+
[order[i], order[i + d]] = [order[i + d], order[i]];
|
|
86
|
+
setR({ ...r, order });
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const save = async () => {
|
|
90
|
+
setSaving(true);
|
|
91
|
+
setResult(null);
|
|
92
|
+
const ids = savedIds(r);
|
|
93
|
+
const resp = await send(
|
|
94
|
+
api.settings["voice-profile"].$post({
|
|
95
|
+
json: { id: profile?.id ?? "", name, order: r.order, avatar: avatars[avatar], ...ids },
|
|
96
|
+
}),
|
|
97
|
+
);
|
|
98
|
+
setSaving(false);
|
|
99
|
+
if (resp.ok) {
|
|
100
|
+
reload();
|
|
101
|
+
onSave(resp.id ?? profile?.id ?? "");
|
|
102
|
+
} else setResult(resp);
|
|
103
|
+
};
|
|
104
|
+
const remove = async () => {
|
|
105
|
+
if (!profile) return;
|
|
106
|
+
setSaving(true);
|
|
107
|
+
const resp = await send(api.settings["voice-profile"].remove.$post({ json: { id: profile.id } }));
|
|
108
|
+
setSaving(false);
|
|
109
|
+
if (resp.ok) {
|
|
110
|
+
reload();
|
|
111
|
+
onRemove(resp.output ?? "");
|
|
112
|
+
} else setResult(resp);
|
|
113
|
+
};
|
|
114
|
+
/* where the saved voice exists and will be deleted too (api/services/settings.ts: removeProfile) */
|
|
115
|
+
const deletesOn = profile
|
|
116
|
+
? (["fish", "cartesia", "elevenlabs"] as const).filter(p => profile[p]).map(p => PROVIDER_NAME[p])
|
|
117
|
+
: [];
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<VoiceModal title={isNew ? "Já tenho voz criada" : "Editar voz"} onClose={onClose} locked={saving}>
|
|
121
|
+
{/* --- left: providers --- */}
|
|
122
|
+
<section className="clone-left" aria-label="Provedores desta voz">
|
|
123
|
+
{detail ? (
|
|
124
|
+
<header className="clone-top">
|
|
125
|
+
<button type="button" className="button small" onClick={() => setDetail(null)}>
|
|
126
|
+
<ArrowLeft weight="bold" className="ic" /> Voltar
|
|
127
|
+
</button>
|
|
128
|
+
<b>{PROVIDER_NAME[detail]}</b>
|
|
129
|
+
</header>
|
|
130
|
+
) : isNew ? (
|
|
131
|
+
<header className="clone-top">
|
|
132
|
+
<button type="button" className="button small" onClick={onCloneInstead} disabled={saving}>
|
|
133
|
+
<ArrowLeft weight="bold" className="ic" /> Clonar a minha voz
|
|
134
|
+
</button>
|
|
135
|
+
<b>Provedores desta voz</b>
|
|
136
|
+
</header>
|
|
137
|
+
) : (
|
|
138
|
+
<header className="clone-top">
|
|
139
|
+
<b>Provedores desta voz</b>
|
|
140
|
+
</header>
|
|
141
|
+
)}
|
|
142
|
+
<div className="clone-save">
|
|
143
|
+
{detail && (
|
|
144
|
+
<ProviderDetail
|
|
145
|
+
provider={detail}
|
|
146
|
+
settings={settings}
|
|
147
|
+
reload={reload}
|
|
148
|
+
id={r.ids[detail]}
|
|
149
|
+
onIdChange={v =>
|
|
150
|
+
setR({
|
|
151
|
+
...r,
|
|
152
|
+
order: r.order.includes(detail) || !hasProviderKey(settings, detail) ? r.order : [...r.order, detail],
|
|
153
|
+
ids: { ...r.ids, [detail]: v },
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
next={PROVIDER_NAME[r.order[r.order.indexOf(detail) + 1]] ?? null}
|
|
157
|
+
onClone={
|
|
158
|
+
profile
|
|
159
|
+
? {
|
|
160
|
+
profile: profile.id,
|
|
161
|
+
/* the server already wrote the new Voice ID into the voice; the draft follows */
|
|
162
|
+
onCreated: v => {
|
|
163
|
+
setR(x => ({
|
|
164
|
+
...x,
|
|
165
|
+
order: x.order.includes(detail) ? x.order : [...x.order, detail],
|
|
166
|
+
ids: { ...x.ids, [detail]: v },
|
|
167
|
+
}));
|
|
168
|
+
setWarningsSeen(true);
|
|
169
|
+
reload();
|
|
170
|
+
},
|
|
171
|
+
}
|
|
172
|
+
: undefined
|
|
173
|
+
}
|
|
174
|
+
/>
|
|
175
|
+
)}
|
|
176
|
+
{/* right under "Provedores desta voz": how the card order counts */}
|
|
177
|
+
{!detail && r.order.length > 1 && (
|
|
178
|
+
<small className="subtle">
|
|
179
|
+
A ordem é a prioridade: a fala sai do principal; se ele falhar, entra o primeiro fallback, e assim por
|
|
180
|
+
diante.
|
|
181
|
+
</small>
|
|
182
|
+
)}
|
|
183
|
+
{!warningsSeen &&
|
|
184
|
+
warnings.map((x, i) => (
|
|
185
|
+
<p key={i} className="response error">
|
|
186
|
+
{x}
|
|
187
|
+
</p>
|
|
188
|
+
))}
|
|
189
|
+
{!detail && (
|
|
190
|
+
<ProviderCards
|
|
191
|
+
draft={r}
|
|
192
|
+
profile={profile}
|
|
193
|
+
settings={settings}
|
|
194
|
+
vsClosed={vsClosed}
|
|
195
|
+
saving={saving}
|
|
196
|
+
listening={listening}
|
|
197
|
+
listeningId={listeningId}
|
|
198
|
+
onListen={listen}
|
|
199
|
+
onToggle={toggle}
|
|
200
|
+
onMove={move}
|
|
201
|
+
onConfigure={setDetail}
|
|
202
|
+
/>
|
|
203
|
+
)}
|
|
204
|
+
{confirmRemove && (
|
|
205
|
+
<p className="response error">
|
|
206
|
+
Remove a voz do app{deletesOn.length ? ` e apaga na conta da ${deletesOn.join(", da ")}` : ""}. Não tem
|
|
207
|
+
volta.
|
|
208
|
+
</p>
|
|
209
|
+
)}
|
|
210
|
+
{result && !result.ok && <p className="response error">{result.error}</p>}
|
|
211
|
+
{sampleError && <p className="response error">{sampleError}</p>}
|
|
212
|
+
</div>
|
|
213
|
+
<EditVoiceFooter
|
|
214
|
+
hasProfile={!!profile}
|
|
215
|
+
isNew={isNew}
|
|
216
|
+
confirmRemove={confirmRemove}
|
|
217
|
+
onConfirmRemoveChange={setConfirmRemove}
|
|
218
|
+
canRedo={deletesOn.length > 0}
|
|
219
|
+
saving={saving}
|
|
220
|
+
canSave={canSave}
|
|
221
|
+
onRemove={remove}
|
|
222
|
+
onRedo={onRedo}
|
|
223
|
+
onSave={save}
|
|
224
|
+
/>
|
|
225
|
+
</section>
|
|
226
|
+
|
|
227
|
+
{/* --- right: avatar and name --- */}
|
|
228
|
+
<section className="clone-right" aria-label="Avatar e nome da voz">
|
|
229
|
+
<AvatarNameField
|
|
230
|
+
avatars={avatars}
|
|
231
|
+
avatar={avatar}
|
|
232
|
+
onAvatarChange={setAvatar}
|
|
233
|
+
locked={saving}
|
|
234
|
+
onShuffle={() => {
|
|
235
|
+
setAvatars(v => (profile ? [v[0], ...shuffleAvatars().slice(0, 9)] : shuffleAvatars()));
|
|
236
|
+
setAvatar(0);
|
|
237
|
+
}}
|
|
238
|
+
name={r.name}
|
|
239
|
+
onNameChange={v => setR({ ...r, name: v })}
|
|
240
|
+
nameValid={nameValid}
|
|
241
|
+
max={max}
|
|
242
|
+
listening={profile && listeningId === `${profile.id}:original` ? listening : null}
|
|
243
|
+
onListen={() => {
|
|
244
|
+
if (profile) listen(profile.id, "original");
|
|
245
|
+
}}
|
|
246
|
+
noAudio={isNew}
|
|
247
|
+
listenLabel="Ouvir voz original"
|
|
248
|
+
onEnter={() => {
|
|
249
|
+
if (canSave) save();
|
|
250
|
+
}}
|
|
251
|
+
rootRef={root}
|
|
252
|
+
/>
|
|
253
|
+
</section>
|
|
254
|
+
</VoiceModal>
|
|
255
|
+
);
|
|
256
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* Red banner on top of the whole app, above the one that waits for a decision: what broke and needs the
|
|
2
|
+
user (lib/alerts.ts). Each line links to where it is fixed and leaves on its own when the condition
|
|
3
|
+
clears; × dismisses it on this browser until it fails again (the key names the occurrence). Settings,
|
|
4
|
+
the platform accounts and the omnichat state have no SSE notice, so they are asked again every few
|
|
5
|
+
minutes. */
|
|
6
|
+
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import { Link } from "@tanstack/react-router";
|
|
9
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
10
|
+
import { useAccounts } from "../hooks/useAccounts";
|
|
11
|
+
import { useNow } from "../hooks/useNow";
|
|
12
|
+
import { useOmnichatState } from "../hooks/useOmnichat";
|
|
13
|
+
import { useSessions } from "../hooks/useSessions";
|
|
14
|
+
import { useSettings } from "../hooks/useSettings";
|
|
15
|
+
import { useVideos } from "../hooks/useVideos";
|
|
16
|
+
import { alertsOf } from "../lib/alerts";
|
|
17
|
+
import { queryKeys } from "../lib/query-client";
|
|
18
|
+
import { ArrowRight, X } from "./icons";
|
|
19
|
+
|
|
20
|
+
const STORAGE_KEY = "omnivideo.dismissed-alerts";
|
|
21
|
+
const REFRESH_MS = 3 * 60_000;
|
|
22
|
+
|
|
23
|
+
function readDismissed(): string[] {
|
|
24
|
+
try {
|
|
25
|
+
const v = JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "[]");
|
|
26
|
+
return Array.isArray(v) ? v : [];
|
|
27
|
+
} catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function saveDismissed(keys: string[]) {
|
|
33
|
+
try {
|
|
34
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(keys));
|
|
35
|
+
} catch {
|
|
36
|
+
/* private window or blocked storage: dismissed for this visit only */
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function ErrorBanner() {
|
|
41
|
+
const { videos } = useVideos();
|
|
42
|
+
const sessions = useSessions();
|
|
43
|
+
const { settings } = useSettings();
|
|
44
|
+
const { accounts } = useAccounts();
|
|
45
|
+
const { state: omnichat } = useOmnichatState(false);
|
|
46
|
+
const now = useNow(30_000);
|
|
47
|
+
const qc = useQueryClient();
|
|
48
|
+
const [dismissed, setDismissed] = useState(readDismissed);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const t = setInterval(() => {
|
|
52
|
+
for (const key of [queryKeys.settings, queryKeys.accounts, queryKeys.omnichat(false)])
|
|
53
|
+
void qc.invalidateQueries({ queryKey: key, exact: true });
|
|
54
|
+
}, REFRESH_MS);
|
|
55
|
+
return () => clearInterval(t);
|
|
56
|
+
}, [qc]);
|
|
57
|
+
|
|
58
|
+
const all = alertsOf({
|
|
59
|
+
videos,
|
|
60
|
+
sessions,
|
|
61
|
+
agents: settings?.agents ?? null,
|
|
62
|
+
keys: settings?.publish.keys ?? null,
|
|
63
|
+
accounts,
|
|
64
|
+
omnichat,
|
|
65
|
+
now,
|
|
66
|
+
});
|
|
67
|
+
const alerts = all.filter(a => !dismissed.includes(a.key));
|
|
68
|
+
|
|
69
|
+
const store = (keys: string[]) => {
|
|
70
|
+
setDismissed(keys);
|
|
71
|
+
saveDismissed(keys);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/* forget the dismissals of alerts that are gone (once every source answered), so the list stays short */
|
|
75
|
+
const liveKeys = all.map(a => a.key).join("\n");
|
|
76
|
+
const loaded = !!(videos && sessions && settings && accounts && omnichat);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!loaded) return;
|
|
79
|
+
const live = new Set(liveKeys.split("\n"));
|
|
80
|
+
setDismissed(prev => {
|
|
81
|
+
const kept = prev.filter(k => live.has(k));
|
|
82
|
+
if (kept.length === prev.length) return prev;
|
|
83
|
+
saveDismissed(kept);
|
|
84
|
+
return kept;
|
|
85
|
+
});
|
|
86
|
+
}, [liveKeys, loaded]);
|
|
87
|
+
|
|
88
|
+
if (!alerts.length) return null;
|
|
89
|
+
const n = alerts.length;
|
|
90
|
+
return (
|
|
91
|
+
<div className="error-banner" role="alert">
|
|
92
|
+
<strong>{n === 1 ? "Deu erro" : `${n} erros`}</strong>
|
|
93
|
+
<ul>
|
|
94
|
+
{alerts.map(a => (
|
|
95
|
+
<li key={a.key}>
|
|
96
|
+
<Link {...a.link}>
|
|
97
|
+
<span>{a.label}</span>
|
|
98
|
+
{a.subject && <> · {a.subject}</>}
|
|
99
|
+
{a.message && <span className="error-banner-message"> · {a.message}</span>} <ArrowRight className="ic" />
|
|
100
|
+
</Link>
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
className="error-banner-dismiss"
|
|
104
|
+
title="Dispensar (volta se falhar de novo)"
|
|
105
|
+
aria-label="Dispensar"
|
|
106
|
+
onClick={() => store([...dismissed, a.key])}
|
|
107
|
+
>
|
|
108
|
+
<X className="ic" />
|
|
109
|
+
</button>
|
|
110
|
+
</li>
|
|
111
|
+
))}
|
|
112
|
+
</ul>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { formatElapsed, timeAgo, ticketOrigin, toMs, TOOL_LABEL } from "../lib/format";
|
|
3
|
+
import type { Ticket } from "../types/api";
|
|
4
|
+
import { STATE_ICON } from "./icons";
|
|
5
|
+
import { LogStream } from "./LogStream";
|
|
6
|
+
|
|
7
|
+
export function FinishedTask({ ticket: t }: { ticket: Ticket }) {
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
const start = toMs(t.started_at);
|
|
10
|
+
const end = toMs(t.ended_at);
|
|
11
|
+
return (
|
|
12
|
+
<li className={`done ${t.effective}${open ? " open" : ""}`}>
|
|
13
|
+
<button className="done-row" onClick={() => setOpen(!open)}>
|
|
14
|
+
<span className={`icon ${t.effective}`}>{STATE_ICON[t.effective] ?? "·"}</span>
|
|
15
|
+
<span className="done-name">{TOOL_LABEL[t.tool] ?? t.tool}</span>
|
|
16
|
+
<span className="done-video">{t.video ?? ""}</span>
|
|
17
|
+
<span className="subtle">
|
|
18
|
+
{start && end ? formatElapsed(end - start) : t.effective === "waiting" ? "Esperando a vez" : "Saiu da fila"}
|
|
19
|
+
{t.effective === "error" && t.exit_code != null ? ` · código ${t.exit_code}` : ""}
|
|
20
|
+
</span>
|
|
21
|
+
<span className="subtle done-when">{timeAgo(t.ended_at ?? t.arrived_at)}</span>
|
|
22
|
+
</button>
|
|
23
|
+
{open && (
|
|
24
|
+
<div className="done-detail">
|
|
25
|
+
<code className="command">{t.command}</code>
|
|
26
|
+
<span className="subtle">
|
|
27
|
+
{ticketOrigin(t)} · pid {t.pid}
|
|
28
|
+
{t.video ? "" : " · sem vídeo"}
|
|
29
|
+
</span>
|
|
30
|
+
{t.started_at ? (
|
|
31
|
+
<LogStream id={t.id} height={220} />
|
|
32
|
+
) : (
|
|
33
|
+
<p className="empty">
|
|
34
|
+
{t.effective === "waiting" ? "Ainda esperando a vez." : "Saiu antes da vez: não rodou."}
|
|
35
|
+
</p>
|
|
36
|
+
)}
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
</li>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* Fish Audio's model: valid for every Fish voice, edited from the voice editor and the providers page. */
|
|
2
|
+
|
|
3
|
+
import { useSaveAction } from "../hooks/useSaveAction";
|
|
4
|
+
import { api } from "../lib/api";
|
|
5
|
+
import type { Settings } from "../types/api";
|
|
6
|
+
import { ResultMessage } from "./ResultMessage";
|
|
7
|
+
import { SettingRow } from "./SettingRow";
|
|
8
|
+
import { Checkbox } from "./ui/checkbox";
|
|
9
|
+
import { Picker } from "./ui/picker";
|
|
10
|
+
|
|
11
|
+
/* the free one is the same S2.1 Pro, without charge; the paid one comes out of the API balance */
|
|
12
|
+
export const FISH_MODELS = [
|
|
13
|
+
{ id: "s2.1-pro-free", name: "S2.1 Pro free", note: "Sem custo, uso justo, até 30/11/2026" },
|
|
14
|
+
{ id: "s2.1-pro", name: "S2.1 Pro pago", note: "Sai do saldo da API" },
|
|
15
|
+
];
|
|
16
|
+
export const modelLabel = (id: string) => FISH_MODELS.find(m => m.id === id)?.name ?? id;
|
|
17
|
+
|
|
18
|
+
export function FishModelSetting({
|
|
19
|
+
fish,
|
|
20
|
+
next,
|
|
21
|
+
onSave,
|
|
22
|
+
}: {
|
|
23
|
+
fish: Settings["voice"]["fish"];
|
|
24
|
+
next: string | null;
|
|
25
|
+
onSave: () => void;
|
|
26
|
+
}) {
|
|
27
|
+
const { result, saving, save } = useSaveAction(onSave);
|
|
28
|
+
const other = FISH_MODELS.find(m => m.id !== fish.model)?.id ?? null;
|
|
29
|
+
const store = (model: string, fallback: string | null) =>
|
|
30
|
+
save(() => api.settings["fish-model"].$post({ json: { model, fallback } }));
|
|
31
|
+
/* changing the model keeps the fallback on (or off), pointing at the other one */
|
|
32
|
+
const change = (model: string) =>
|
|
33
|
+
store(model, fish.fallback_model ? (FISH_MODELS.find(m => m.id !== model)?.id ?? null) : null);
|
|
34
|
+
return (
|
|
35
|
+
<SettingRow label="Modelo" help={FISH_MODELS.find(m => m.id === fish.model)?.note}>
|
|
36
|
+
<Picker
|
|
37
|
+
aria-label="Modelo"
|
|
38
|
+
value={fish.model}
|
|
39
|
+
disabled={saving}
|
|
40
|
+
onChange={change}
|
|
41
|
+
options={[
|
|
42
|
+
...(FISH_MODELS.some(m => m.id === fish.model) ? [] : [{ value: fish.model, label: fish.model }]),
|
|
43
|
+
...FISH_MODELS.map(m => ({ value: m.id, label: `${m.name}${m.id === "s2.1-pro-free" ? " (padrão)" : ""}` })),
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
{other && (
|
|
47
|
+
<label className="check-toggle">
|
|
48
|
+
<Checkbox
|
|
49
|
+
checked={!!fish.fallback_model}
|
|
50
|
+
disabled={saving}
|
|
51
|
+
onCheckedChange={v => store(fish.model, v ? other : null)}
|
|
52
|
+
/>
|
|
53
|
+
<span>
|
|
54
|
+
Se falhar, tentar o {modelLabel(other)}
|
|
55
|
+
{other === "s2.1-pro" && <span className="subtle"> (cobra do saldo da API)</span>}
|
|
56
|
+
</span>
|
|
57
|
+
</label>
|
|
58
|
+
)}
|
|
59
|
+
<p className="hint">
|
|
60
|
+
Vale para a próxima <code>voice</code>. Free e pago dão a mesma voz: trocar não gera de novo as falas prontas.
|
|
61
|
+
{next &&
|
|
62
|
+
(fish.fallback_model
|
|
63
|
+
? ` Sem o fallback, quando o ${modelLabel(fish.model)} falha a fala vai para ${next}.`
|
|
64
|
+
: ` Se ele falhar, a fala vai para ${next}.`)}
|
|
65
|
+
</p>
|
|
66
|
+
<ResultMessage result={result} />
|
|
67
|
+
</SettingRow>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { useSaveAction } from "../hooks/useSaveAction";
|
|
3
|
+
import { api } from "../lib/api";
|
|
4
|
+
import { FloppyDisk } from "./icons";
|
|
5
|
+
import { ResultMessage } from "./ResultMessage";
|
|
6
|
+
import { SettingRow } from "./SettingRow";
|
|
7
|
+
|
|
8
|
+
/* the paid model's price, used by the usage estimate */
|
|
9
|
+
export function FishPriceSetting({ current, onSave }: { current: number | null; onSave: () => void }) {
|
|
10
|
+
const [value, setValue] = useState(current == null ? "" : String(current));
|
|
11
|
+
const { result, saving, save } = useSaveAction(onSave);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setValue(current == null ? "" : String(current));
|
|
14
|
+
}, [current]);
|
|
15
|
+
const changed = value.trim() !== (current == null ? "" : String(current));
|
|
16
|
+
return (
|
|
17
|
+
<SettingRow
|
|
18
|
+
label="Métrica de custo"
|
|
19
|
+
help="Preço do modelo pago, usado na estimativa da tela Uso (as falas do free não contam)"
|
|
20
|
+
>
|
|
21
|
+
<form
|
|
22
|
+
className="setting-row"
|
|
23
|
+
onSubmit={e => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (changed) save(() => api.settings["fish-price"].$post({ json: { value } }));
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<span className="subtle">US$</span>
|
|
29
|
+
<input
|
|
30
|
+
className="short"
|
|
31
|
+
inputMode="decimal"
|
|
32
|
+
value={value}
|
|
33
|
+
onChange={e => setValue(e.target.value)}
|
|
34
|
+
disabled={saving}
|
|
35
|
+
/>
|
|
36
|
+
<span className="subtle">Por milhão de bytes de texto</span>
|
|
37
|
+
<button className="button" type="submit" disabled={saving || !changed || !value.trim()}>
|
|
38
|
+
<FloppyDisk className="ic" /> {saving ? "Gravando…" : "Gravar"}
|
|
39
|
+
</button>
|
|
40
|
+
</form>
|
|
41
|
+
<ResultMessage result={result} />
|
|
42
|
+
</SettingRow>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* Fixed banner on top of the whole app, on any screen: everything that waits for a decision of
|
|
2
|
+
the user (script, motion script scenes, voice being chosen). It doesn't go away on page
|
|
3
|
+
change nor closes: it leaves when the user decides. It sits in the shell's top stack (TopBanners). */
|
|
4
|
+
|
|
5
|
+
import { Link } from "@tanstack/react-router";
|
|
6
|
+
import { useNow } from "../hooks/useNow";
|
|
7
|
+
import { useVideos } from "../hooks/useVideos";
|
|
8
|
+
import { formatCountdown } from "../lib/format";
|
|
9
|
+
import { ArrowRight } from "./icons";
|
|
10
|
+
|
|
11
|
+
export function HumanBanner() {
|
|
12
|
+
const { videos } = useVideos();
|
|
13
|
+
const now = useNow();
|
|
14
|
+
const list = (videos ?? []).filter(v => !v.archived);
|
|
15
|
+
const scripts = list.filter(v => v.script_approval?.status === "pending");
|
|
16
|
+
const scenes = list.filter(v => v.scenes_approval?.status === "pending");
|
|
17
|
+
const voices = list.flatMap(v => {
|
|
18
|
+
const s = v.status?.stages.find(x => x.pause);
|
|
19
|
+
return s ? [{ v, stage: s.id }] : [];
|
|
20
|
+
});
|
|
21
|
+
const items = [
|
|
22
|
+
...scripts.map(v => {
|
|
23
|
+
const a = v.script_approval!;
|
|
24
|
+
const ms = a.mode === "auto" ? Date.parse(a.deadline) - now : (a.remaining_ms ?? 0);
|
|
25
|
+
return {
|
|
26
|
+
k: `r-${v.slug}`,
|
|
27
|
+
label: "Roteiro espera sua aprovação",
|
|
28
|
+
v,
|
|
29
|
+
stage: "script",
|
|
30
|
+
extra: `${a.mode === "paused" ? "⏸ " : "aprova sozinho em "}${formatCountdown(ms)}`,
|
|
31
|
+
};
|
|
32
|
+
}),
|
|
33
|
+
...scenes.map(v => {
|
|
34
|
+
const a = v.scenes_approval!;
|
|
35
|
+
const ms = a.mode === "auto" ? Date.parse(a.deadline) - now : (a.remaining_ms ?? 0);
|
|
36
|
+
return {
|
|
37
|
+
k: `c-${v.slug}`,
|
|
38
|
+
label: "Cenas esperam sua aprovação",
|
|
39
|
+
v,
|
|
40
|
+
stage: "motion_script",
|
|
41
|
+
extra: `${a.mode === "paused" ? "⏸ " : "aprovam sozinhas em "}${formatCountdown(ms)}`,
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
...voices.map(({ v, stage }) => ({ k: `v-${v.slug}`, label: "Voz em escolha, falta seguir", v, stage, extra: "" })),
|
|
45
|
+
];
|
|
46
|
+
const n = items.length;
|
|
47
|
+
|
|
48
|
+
if (!n) return null;
|
|
49
|
+
return (
|
|
50
|
+
<div className="human-banner" role="status">
|
|
51
|
+
<strong>{n === 1 ? "Espera você" : `${n} coisas esperam você`}</strong>
|
|
52
|
+
<ul>
|
|
53
|
+
{items.map(i => (
|
|
54
|
+
<li key={i.k}>
|
|
55
|
+
<Link to="/videos/$slug/$stage" params={{ slug: i.v.slug, stage: i.stage }}>
|
|
56
|
+
<span>{i.label}</span> · {i.v.title}
|
|
57
|
+
{i.extra && <span className="mono"> · {i.extra}</span>} <ArrowRight className="ic" />
|
|
58
|
+
</Link>
|
|
59
|
+
</li>
|
|
60
|
+
))}
|
|
61
|
+
</ul>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|