@crievo/omni 0.0.0-stage → 0.1.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/.env.example +41 -0
- package/README.md +2 -2
- package/bin/omni.mjs +18 -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.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,23 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
/* a right side panel's open state, remembered in this browser under `storageKey` */
|
|
4
|
+
export function useSidePanel(storageKey: string, open = false) {
|
|
5
|
+
const stored = () => {
|
|
6
|
+
try {
|
|
7
|
+
const v = localStorage.getItem(storageKey);
|
|
8
|
+
return v === null ? open : v === "1";
|
|
9
|
+
} catch {
|
|
10
|
+
return open;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const [panel, setPanel] = useState(stored);
|
|
14
|
+
const toggle = (value: boolean) => {
|
|
15
|
+
setPanel(value);
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(storageKey, value ? "1" : "0");
|
|
18
|
+
} catch {
|
|
19
|
+
/* lasts this session only */
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return [panel, toggle] as const;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* The video's sound routes (api/routes/sound.ts) and the sound timeline's data query. */
|
|
2
|
+
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { api, enc, read, send } from "../lib/api";
|
|
5
|
+
import type { SoundDraft } from "../types/api";
|
|
6
|
+
|
|
7
|
+
export const soundRoutes = (slug: string) => {
|
|
8
|
+
const r = api.videos[":slug"].sound;
|
|
9
|
+
const param = { slug: enc(slug) };
|
|
10
|
+
return {
|
|
11
|
+
get: () => read(r.$get({ param })),
|
|
12
|
+
plan: (draft: SoundDraft) => send(r.plan.$post({ param, json: draft })),
|
|
13
|
+
/* keepalive: the request survives the page going away */
|
|
14
|
+
save: (draft: SoundDraft, keepalive = false) =>
|
|
15
|
+
keepalive
|
|
16
|
+
? r.$post({ param, json: draft }, { init: { keepalive: true } })
|
|
17
|
+
: send(r.$post({ param, json: draft })),
|
|
18
|
+
reassemble: () => send(r.reassemble.$post({ param, json: {} })),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/* the timeline's data: gcTime 0 so coming back to the editor always reads fresh; no structural
|
|
23
|
+
sharing so every fetch resets the draft, like a reload */
|
|
24
|
+
export const useSoundQuery = (slug: string) =>
|
|
25
|
+
useQuery({
|
|
26
|
+
queryKey: ["sound", slug],
|
|
27
|
+
queryFn: () => soundRoutes(slug).get(),
|
|
28
|
+
gcTime: 0,
|
|
29
|
+
structuralSharing: false,
|
|
30
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { api } from "../lib/api";
|
|
2
|
+
import { queryKeys } from "../lib/query-client";
|
|
3
|
+
import type { Usage } from "../types/api";
|
|
4
|
+
import { useLiveQuery } from "./useLiveQuery";
|
|
5
|
+
|
|
6
|
+
/* GET /api/usage; reload after POST /api/usage/refresh */
|
|
7
|
+
export function useUsage() {
|
|
8
|
+
const { data, error, reload } = useLiveQuery(queryKeys.usage, () => api.usage.$get());
|
|
9
|
+
const usage: Usage | null = data;
|
|
10
|
+
return { usage, error, reload };
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* The video's voice and its providers: used by the video voice picker and by each line's picker. */
|
|
2
|
+
|
|
3
|
+
import { PROVIDER_NAME } from "../lib/providers";
|
|
4
|
+
import type { VideoDetail, VoiceProviderStatus } from "../types/api";
|
|
5
|
+
import { useServices } from "./useServices";
|
|
6
|
+
import { useVoiceProfiles } from "./useVoiceProfiles";
|
|
7
|
+
|
|
8
|
+
export function useVideoVoice(video: VideoDetail) {
|
|
9
|
+
const s = useServices();
|
|
10
|
+
const { profiles, defaultId: defaultProfile, reload: reloadProfiles } = useVoiceProfiles();
|
|
11
|
+
const currentProfile = video.scenes?.voice?.voice_profile ?? defaultProfile ?? "";
|
|
12
|
+
/* with a voice (profile), its priority wins; with none, the global config order */
|
|
13
|
+
const profileOrder = profiles?.find(p => p.id === currentProfile)?.order ?? null;
|
|
14
|
+
const global = s?.voices ?? [];
|
|
15
|
+
const providers: VoiceProviderStatus[] = profileOrder
|
|
16
|
+
? profileOrder
|
|
17
|
+
.map(
|
|
18
|
+
id =>
|
|
19
|
+
global.find(g => g.id === id) ?? {
|
|
20
|
+
id,
|
|
21
|
+
name: PROVIDER_NAME[id] ?? id,
|
|
22
|
+
default: false,
|
|
23
|
+
ready: true,
|
|
24
|
+
reason: null,
|
|
25
|
+
},
|
|
26
|
+
)
|
|
27
|
+
.map((p, i) => ({ ...p, default: i === 0, reason: null, ready: true }))
|
|
28
|
+
: global;
|
|
29
|
+
const defaultProvider = providers.find(p => p.default)?.id ?? "fish";
|
|
30
|
+
const current =
|
|
31
|
+
video.scenes?.voice?.provider && providers.some(p => p.id === video.scenes?.voice?.provider)
|
|
32
|
+
? video.scenes.voice.provider
|
|
33
|
+
: defaultProvider;
|
|
34
|
+
return { profiles, defaultProfile, reloadProfiles, currentProfile, profileOrder, providers, current };
|
|
35
|
+
}
|
|
36
|
+
export type VideoVoice = ReturnType<typeof useVideoVoice>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { api, enc } from "../lib/api";
|
|
2
|
+
import { queryKeys } from "../lib/query-client";
|
|
3
|
+
import type { VideoDetail, VideoSummary } from "../types/api";
|
|
4
|
+
import { useLiveQuery } from "./useLiveQuery";
|
|
5
|
+
|
|
6
|
+
/* refetched on every SSE "video" notice (150 ms debounce) */
|
|
7
|
+
export function useVideos() {
|
|
8
|
+
const { data, error, reload } = useLiveQuery(queryKeys.videos, () => api.videos.$get());
|
|
9
|
+
const videos: VideoSummary[] | null = data;
|
|
10
|
+
return { videos, error, reload };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* refetched on the SSE "video" notice for this slug; null slug: nothing to ask for */
|
|
14
|
+
export function useVideo(slug: string | null) {
|
|
15
|
+
const { data, error, reload } = useLiveQuery(
|
|
16
|
+
queryKeys.video(slug ?? ""),
|
|
17
|
+
slug ? () => api.videos[":slug"].$get({ param: { slug: enc(slug) } }) : null,
|
|
18
|
+
);
|
|
19
|
+
const video: VideoDetail | null = data;
|
|
20
|
+
return { video, error, reload };
|
|
21
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* "Ouvir voz": plays the profile's stored sample (generated only if it doesn't exist yet); the
|
|
2
|
+
same button stops it. With `provider`, that provider's sample, and `listeningId` is
|
|
3
|
+
`<profile>:<provider>`. */
|
|
4
|
+
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import { api, send } from "../lib/api";
|
|
7
|
+
import { createAudioAnalyser } from "../lib/audio";
|
|
8
|
+
|
|
9
|
+
export type ListenPhase = "generating" | "playing" | null;
|
|
10
|
+
|
|
11
|
+
export function useVoiceProfilePreview() {
|
|
12
|
+
const [listening, setListening] = useState<ListenPhase>(null);
|
|
13
|
+
const [listeningId, setListeningId] = useState<string | null>(null);
|
|
14
|
+
const [error, setError] = useState<string | null>(null);
|
|
15
|
+
const audio = useRef<HTMLAudioElement | null>(null);
|
|
16
|
+
const analyser = useRef<AnalyserNode | null>(null);
|
|
17
|
+
const stop = useCallback(() => {
|
|
18
|
+
audio.current?.pause();
|
|
19
|
+
audio.current = null;
|
|
20
|
+
analyser.current = null;
|
|
21
|
+
setListening(null);
|
|
22
|
+
setListeningId(null);
|
|
23
|
+
}, []);
|
|
24
|
+
useEffect(() => stop, [stop]);
|
|
25
|
+
const listen = async (id: string, provider?: string) => {
|
|
26
|
+
if (listening === "generating") return;
|
|
27
|
+
const key = provider ? `${id}:${provider}` : id;
|
|
28
|
+
const same = listeningId === key;
|
|
29
|
+
stop();
|
|
30
|
+
if (same) return; /* the same button only stops */
|
|
31
|
+
setError(null);
|
|
32
|
+
setListeningId(key);
|
|
33
|
+
setListening("generating");
|
|
34
|
+
const r = await send(api.settings["voice-profile"].sample.$post({ json: { id, provider } }));
|
|
35
|
+
if (!r.ok || !r.url) {
|
|
36
|
+
stop();
|
|
37
|
+
setError(r.error ?? "Não consegui gerar a amostra");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const a = new Audio(r.url);
|
|
41
|
+
a.onended = stop;
|
|
42
|
+
a.onerror = () => {
|
|
43
|
+
stop();
|
|
44
|
+
setError("Não consegui tocar a amostra");
|
|
45
|
+
};
|
|
46
|
+
audio.current = a;
|
|
47
|
+
analyser.current = createAudioAnalyser(a);
|
|
48
|
+
setListening("playing");
|
|
49
|
+
a.play().catch(() => stop());
|
|
50
|
+
};
|
|
51
|
+
return { listening, listeningId, error, listen, stop, analyser, clearError: () => setError(null) };
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useSettings } from "./useSettings";
|
|
2
|
+
|
|
3
|
+
/* the voice profiles and the default one (from GET /api/settings) */
|
|
4
|
+
export function useVoiceProfiles() {
|
|
5
|
+
const { settings, reload } = useSettings();
|
|
6
|
+
return { profiles: settings?.voice.profiles ?? null, defaultId: settings?.voice.default_profile ?? null, reload };
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VideoDetail } from "../types/api";
|
|
2
|
+
import { useQueue } from "./useQueue";
|
|
3
|
+
|
|
4
|
+
/* the voice ticket of this video running or waiting in the queue, if any */
|
|
5
|
+
export function useVoiceRunning(video: VideoDetail) {
|
|
6
|
+
const queue = useQueue();
|
|
7
|
+
return (
|
|
8
|
+
[...(queue?.running ?? []), ...(queue?.waiting ?? [])].find(t => t.dir === video.dir && t.tool === "voice") ?? null
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useServices } from "./useServices";
|
|
2
|
+
|
|
3
|
+
/* VoiceStudio is local: with the app closed it neither speaks nor has anything to configure.
|
|
4
|
+
Until the status arrives, it counts as open. */
|
|
5
|
+
export function useVoiceStudioClosed() {
|
|
6
|
+
const vs = useServices()?.voicestudio;
|
|
7
|
+
return !!vs && !vs.ok;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="pt-BR">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Omni</title>
|
|
7
|
+
<!-- the brand (looping play): black on the light theme, white on the dark one (web/assets/logos/omni-*.png) -->
|
|
8
|
+
<link rel="icon" type="image/png" media="(prefers-color-scheme: light)" href="data:image/png;base64,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8QjD6nDYmbgOiQUoa74d59qrX76/qexTntb/SOMyQ+I0rCHXDPPvVa/c36COgG6232FTcKXwJMdykHL8IJ0M7Sh/MfugGEJECZFvqmtgH048l4aLVkHQHy9yFoDP9oADdRIaNSSMKSsQkd/TjRSnmZzn3+WhzSexNGpzl8XUaDMvoqzEkzWmFbL7ZDEiAd/d45y+fL+YEG3azK+B54GKZCM0WTWWgCloQ4dipKef4vQE6IHbAYxkHVohl9I/gSoPaVEDLXDTm+JcCojYBoaYn4ABtVzw+T6WOnx1f5o1+PMt2Q5zxGo0HHnVsiNET1e2MV0oNR9ZPWv+aIzqyda6lLMhzXWVKdJeEX7D0IjS8wWR2K0T+Quncgzk+re4D2sTHXeqsOQ6MfzFBSgKH1siO2gT6vHwJFRT9uRP2zfjbTdlnRDu6M6SA04CQ9c/A9bA/7Lp/R2QXoa0mzBJjdH6jTO4v+b6Cw6KtpkckwKQmqN4dXcexdlyOR6PEcdGzIlj7bPQHToVS5HGtpgRRpsyToTmp+mObxXMvzk7AX7FodvwSFN2FaT5NEmV0E6rQKsb53Y7wP1oFGnjZWWrpmwHyYBxPARLrLYY1VVFVqCVkPSkCRO+671u6qr9Q/WF4DWgWaJl309AlUnYS4JFlCtILcBpnXdK4pRTTBNDMJFvgu+l0Bx5QSRUEjGgm2+ahqNFjgmtmfgpkFfS798kOx+BiYo3HDNk+da68X+4Vn9tIjjxi8gvPPwXW8SOCysxYWQNuINkuamGzDZMlQmZYMV08/T2kpWwgd0JYyEa97QP9Co9lawbtBRo9/pn0TaHKbDS0X24yU4YhGhVYMbWCOh0mgNVtBfwdbYTMMwF/wv9QhA/8CzgmGCSxGD/QAAAAASUVORK5CYII=">
|
|
9
|
+
<link rel="icon" type="image/png" media="(prefers-color-scheme: dark)" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAA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+kKe5Ta+KKsI+hwB7VFoHoBmH+0/uHgvx1gb0F6Enjlz5uLh4eH1lVLlkobXWIuCwyg7z2d1Oo15hvHjnMxM9iLj/3P7bIH/AB9Y8jMDtnmoAAAAAElFTkSuQmCC">
|
|
10
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
11
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
12
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">
|
|
13
|
+
<link rel="stylesheet" href="./styles/index.css">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root"></div>
|
|
17
|
+
<script type="module" src="./main.tsx"></script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* The agent that drives the studio sessions. The UI calls it "Agente"; Claude's name, mark and
|
|
2
|
+
animation show only with Claude chosen in Configurações → Agente (today the only option: Codex
|
|
3
|
+
is "em breve"). When there is a real choice, it goes here and the rest of the UI follows. */
|
|
4
|
+
|
|
5
|
+
export type AgentProvider = "claude" | "codex";
|
|
6
|
+
export const AGENT_PROVIDER: AgentProvider = "claude";
|
|
7
|
+
export const isClaude = AGENT_PROVIDER === "claude";
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/* What broke and needs the user, for the error banner (components/ErrorBanner.tsx): a publication that
|
|
2
|
+
failed or missed its time, a session that stopped with an error, no agent account free, a platform
|
|
3
|
+
that refused its token or whose token is about to expire, the omnichat paused by Meta or its cloud
|
|
4
|
+
not answering. Each alert leaves on its own when the condition clears; its key names the occurrence,
|
|
5
|
+
so a dismissed one comes back when it fails again. */
|
|
6
|
+
|
|
7
|
+
import type { AgentsSettings, OmnichatState, PlatformAccounts, Session, Settings, VideoSummary } from "../types/api";
|
|
8
|
+
import { formatDayTime } from "./format";
|
|
9
|
+
import { sessionPageLink, type SessionPageLink } from "./sessions";
|
|
10
|
+
import { PUBLISH_PLATFORMS } from "./video-tabs";
|
|
11
|
+
|
|
12
|
+
export type AlertLink =
|
|
13
|
+
| SessionPageLink
|
|
14
|
+
| { to: "/settings/$category"; params: { category: string } }
|
|
15
|
+
| { to: "/omnichat"; params?: undefined };
|
|
16
|
+
|
|
17
|
+
export type Alert = { key: string; label: string; subject?: string; message?: string; link: AlertLink };
|
|
18
|
+
|
|
19
|
+
export type AlertInput = {
|
|
20
|
+
videos: VideoSummary[] | null;
|
|
21
|
+
sessions: Session[] | null;
|
|
22
|
+
agents: AgentsSettings | null;
|
|
23
|
+
keys: Settings["publish"]["keys"] | null;
|
|
24
|
+
accounts: PlatformAccounts | null;
|
|
25
|
+
omnichat: OmnichatState | null;
|
|
26
|
+
now: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const PLATFORM_NAME = { youtube: "YouTube", instagram: "Instagram", tiktok: "TikTok" } as const;
|
|
30
|
+
const DAY = 86_400_000;
|
|
31
|
+
/* a session error older than this is history, not something to act on */
|
|
32
|
+
export const SESSION_WINDOW_MS = DAY;
|
|
33
|
+
/* a token closer than this to expiring is an alert (the renewal should have run by then) */
|
|
34
|
+
export const EXPIRY_WINDOW_MS = 7 * DAY;
|
|
35
|
+
|
|
36
|
+
const failedAfter = (p?: { last_error?: { at: string }; published_at?: string }) =>
|
|
37
|
+
!!p?.last_error && (!p.published_at || p.last_error.at > p.published_at);
|
|
38
|
+
|
|
39
|
+
const firstLine = (s: string, max = 160) => {
|
|
40
|
+
const line = s.trim().split("\n")[0] ?? "";
|
|
41
|
+
return line.length > max ? `${line.slice(0, max - 1)}…` : line;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const publishLink = (slug: string, stage = "publish"): AlertLink => ({
|
|
45
|
+
to: "/videos/$slug/$stage",
|
|
46
|
+
params: { slug, stage },
|
|
47
|
+
});
|
|
48
|
+
const settingsLink = (category: string): AlertLink => ({ to: "/settings/$category", params: { category } });
|
|
49
|
+
|
|
50
|
+
function videoAlerts(videos: VideoSummary[]): Alert[] {
|
|
51
|
+
const out: Alert[] = [];
|
|
52
|
+
for (const v of videos) {
|
|
53
|
+
if (v.archived) continue;
|
|
54
|
+
const s = v.publication?.schedule;
|
|
55
|
+
if (s?.state === "failed" || s?.state === "missed") {
|
|
56
|
+
out.push({
|
|
57
|
+
key: `schedule:${v.slug}:${s.state}:${s.last_error?.at ?? s.when}`,
|
|
58
|
+
label: s.state === "missed" ? "Publicação agendada passou da hora" : "Publicação agendada falhou",
|
|
59
|
+
subject: v.title,
|
|
60
|
+
message: s.last_error ? firstLine(s.last_error.message) : undefined,
|
|
61
|
+
link: publishLink(v.slug),
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
for (const p of PUBLISH_PLATFORMS) {
|
|
65
|
+
const x = v.publication?.[p];
|
|
66
|
+
if (!failedAfter(x)) continue;
|
|
67
|
+
out.push({
|
|
68
|
+
key: `publish:${v.slug}:${p}:${x!.last_error!.at}`,
|
|
69
|
+
label: `Falhou a publicação no ${PLATFORM_NAME[p]}`,
|
|
70
|
+
subject: v.title,
|
|
71
|
+
message: firstLine(x!.last_error!.message),
|
|
72
|
+
link: publishLink(v.slug),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const ig = v.carousel?.publication?.instagram;
|
|
77
|
+
if (failedAfter(ig)) {
|
|
78
|
+
out.push({
|
|
79
|
+
key: `carousel:${v.slug}:${ig!.last_error!.at}`,
|
|
80
|
+
label: "Falhou a publicação do carrossel",
|
|
81
|
+
subject: v.title,
|
|
82
|
+
message: firstLine(ig!.last_error!.message),
|
|
83
|
+
link: publishLink(v.slug, "carousel-publish"),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (v.statusError) {
|
|
87
|
+
out.push({
|
|
88
|
+
key: `status:${v.slug}:${v.statusError}`,
|
|
89
|
+
label: "Não consegui ler o estado do vídeo",
|
|
90
|
+
subject: v.title,
|
|
91
|
+
message: firstLine(v.statusError),
|
|
92
|
+
link: { to: "/videos/$slug", params: { slug: v.slug } },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Omni's own sessions have no page of their own; their errors show in its panel */
|
|
100
|
+
function sessionAlerts(sessions: Session[], now: number): Alert[] {
|
|
101
|
+
return sessions
|
|
102
|
+
.filter(s => s.type !== "omni" && s.state === "error" && s.turn)
|
|
103
|
+
.filter(s => now - Date.parse(s.turn!.started_at) < SESSION_WINDOW_MS)
|
|
104
|
+
.map(s => ({
|
|
105
|
+
key: `session:${s.id}:${s.turn!.n}`,
|
|
106
|
+
label: "O agente parou com erro",
|
|
107
|
+
subject: s.title,
|
|
108
|
+
message: s.turn!.result?.text ? firstLine(s.turn!.result.text) : undefined,
|
|
109
|
+
link: sessionPageLink(s),
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* only when no account can take a session: one account at its limit is the rotation working */
|
|
114
|
+
function agentAlerts(agents: AgentsSettings, now: number): Alert[] {
|
|
115
|
+
const on = agents.accounts.filter(a => a.enabled);
|
|
116
|
+
const link = settingsLink("agent");
|
|
117
|
+
if (!on.length) return [{ key: "agents:none", label: "Nenhuma conta de agente ligada", link }];
|
|
118
|
+
const limited = (a: (typeof on)[number]) => !!a.limited_until && a.limited_until > now;
|
|
119
|
+
if (on.some(a => a.login && !limited(a))) return [];
|
|
120
|
+
const until = on.filter(a => a.login && limited(a)).map(a => a.limited_until!);
|
|
121
|
+
if (!until.length) {
|
|
122
|
+
return [
|
|
123
|
+
{
|
|
124
|
+
key: "agents:no-login",
|
|
125
|
+
label: "Nenhuma conta de agente tem login",
|
|
126
|
+
message: "As sessões não começam até uma conta entrar",
|
|
127
|
+
link,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
const first = Math.min(...until);
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
key: `agents:limited:${first}`,
|
|
135
|
+
label: "Todas as contas de agente estão no limite de uso",
|
|
136
|
+
message: `A primeira libera ${formatDayTime(first)}`,
|
|
137
|
+
link,
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* a platform this machine is connected to (the token is in .env) that refuses it, or a token about to expire */
|
|
143
|
+
function tokenAlerts(keys: AlertInput["keys"], accounts: PlatformAccounts, now: number): Alert[] {
|
|
144
|
+
if (accounts.error) return [];
|
|
145
|
+
const out: Alert[] = [];
|
|
146
|
+
for (const p of PUBLISH_PLATFORMS) {
|
|
147
|
+
const a = accounts[p];
|
|
148
|
+
if (!a || !keys?.[`${p}_connected`]) continue;
|
|
149
|
+
const name = PLATFORM_NAME[p];
|
|
150
|
+
if (!a.ready) {
|
|
151
|
+
out.push({
|
|
152
|
+
key: `token:${p}:${a.reason ?? ""}`,
|
|
153
|
+
label: `O ${name} recusou a conexão`,
|
|
154
|
+
message: a.reason ? firstLine(a.reason) : undefined,
|
|
155
|
+
link: settingsLink("platforms"),
|
|
156
|
+
});
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const at = "expires" in a ? a.expires : null;
|
|
160
|
+
const expires = at ? Date.parse(at) : NaN;
|
|
161
|
+
if (Number.isFinite(expires) && expires - now < EXPIRY_WINDOW_MS) {
|
|
162
|
+
out.push({
|
|
163
|
+
key: `expiry:${p}:${at}`,
|
|
164
|
+
label: expires <= now ? `O token do ${name} venceu` : `O token do ${name} vence ${formatDayTime(expires)}`,
|
|
165
|
+
message: "Conecte de novo em Plataformas",
|
|
166
|
+
link: settingsLink("platforms"),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function omnichatAlerts(o: OmnichatState, now: number): Alert[] {
|
|
174
|
+
const out: Alert[] = [];
|
|
175
|
+
if (o.pause && Date.parse(o.pause.until) > now) {
|
|
176
|
+
out.push({
|
|
177
|
+
key: `omnichat-pause:${o.pause.until}`,
|
|
178
|
+
label: "O omnichat está pausado pela Meta",
|
|
179
|
+
message: `Até ${formatDayTime(o.pause.until)}${o.pause.reason ? `: ${firstLine(o.pause.reason)}` : ""}`,
|
|
180
|
+
link: { to: "/omnichat" },
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
const agent = o.agent;
|
|
184
|
+
if (agent?.cloud && !agent.cloud.ready) {
|
|
185
|
+
out.push({
|
|
186
|
+
key: `omnichat-cloud:${agent.cloud.reason}`,
|
|
187
|
+
label: "A cloud do omnichat não responde",
|
|
188
|
+
message: firstLine(agent.cloud.reason),
|
|
189
|
+
link: settingsLink("publishing"),
|
|
190
|
+
});
|
|
191
|
+
} else if (agent && !agent.cloud && agent.installed && !agent.node_ok) {
|
|
192
|
+
out.push({
|
|
193
|
+
key: "omnichat-node",
|
|
194
|
+
label: "O agente do omnichat não acha o Node",
|
|
195
|
+
message: "Instale o agente de novo em Publicação",
|
|
196
|
+
link: settingsLink("publishing"),
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function alertsOf(i: AlertInput): Alert[] {
|
|
203
|
+
return [
|
|
204
|
+
...(i.agents ? agentAlerts(i.agents, i.now) : []),
|
|
205
|
+
...(i.accounts ? tokenAlerts(i.keys, i.accounts, i.now) : []),
|
|
206
|
+
...(i.omnichat ? omnichatAlerts(i.omnichat, i.now) : []),
|
|
207
|
+
...(i.videos ? videoAlerts(i.videos) : []),
|
|
208
|
+
...(i.sessions ? sessionAlerts(i.sessions, i.now) : []),
|
|
209
|
+
];
|
|
210
|
+
}
|