@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,141 @@
|
|
|
1
|
+
/* A stage's previous results (StageDrawer): which history/ versions are really previous, today's
|
|
2
|
+
file matching each kept one, and the queue run that made each version. */
|
|
3
|
+
|
|
4
|
+
import { currentExport } from "./export";
|
|
5
|
+
import { toMs } from "./format";
|
|
6
|
+
import type { StageDef } from "./stages";
|
|
7
|
+
import type { FileEntry, HistoryVersion, Queue, Ticket, VideoDetail } from "../types/api";
|
|
8
|
+
|
|
9
|
+
/* which runs make the versions of each history/ dir */
|
|
10
|
+
export const GENERATED_BY: Record<string, string[]> = {
|
|
11
|
+
composition: [],
|
|
12
|
+
voice: ["voice"],
|
|
13
|
+
render: ["render"],
|
|
14
|
+
sound: ["sound", "premiere-assemble", "assembly"],
|
|
15
|
+
captions: ["captions"],
|
|
16
|
+
assembly: ["assembly", "premiere-assemble", "premiere-export"],
|
|
17
|
+
check: ["premiere-check"],
|
|
18
|
+
export: ["premiere-export"],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const HISTORY_LABEL: Record<string, string> = {
|
|
22
|
+
composition: "Composição",
|
|
23
|
+
voice: "Voz",
|
|
24
|
+
render: "Render",
|
|
25
|
+
sound: "Som",
|
|
26
|
+
captions: "Legenda",
|
|
27
|
+
assembly: "Montagem",
|
|
28
|
+
check: "Conferência",
|
|
29
|
+
export: "Outros exports",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const kindOf = (f: FileEntry) =>
|
|
33
|
+
/\.(mp4|mov|webm)$/i.test(f.path)
|
|
34
|
+
? "video"
|
|
35
|
+
: /\.(png|jpe?g|webp)$/i.test(f.path)
|
|
36
|
+
? "image"
|
|
37
|
+
: /\.(wav|mp3|m4a)$/i.test(f.path)
|
|
38
|
+
? "audio"
|
|
39
|
+
: /\.(srt|json)$/i.test(f.path)
|
|
40
|
+
? "text"
|
|
41
|
+
: "other";
|
|
42
|
+
|
|
43
|
+
export const fileName = (f: FileEntry) => f.path.split("/").pop()!;
|
|
44
|
+
|
|
45
|
+
/* the run that made the version: of the right tool, of this video, and running when the file was
|
|
46
|
+
written. The file is written inside the run, so the slack is minimal: the next run usually
|
|
47
|
+
starts right after, and a wide slack would mistake it for the one that made it */
|
|
48
|
+
export function runOf(version: HistoryVersion, runs: Ticket[]) {
|
|
49
|
+
const t = toMs(version.at)!;
|
|
50
|
+
return runs
|
|
51
|
+
.filter(
|
|
52
|
+
r =>
|
|
53
|
+
(GENERATED_BY[version.stage] ?? []).includes(r.tool) &&
|
|
54
|
+
r.started_at &&
|
|
55
|
+
r.ended_at &&
|
|
56
|
+
toMs(r.started_at)! - 100 <= t &&
|
|
57
|
+
t <= toMs(r.ended_at)! + 1000,
|
|
58
|
+
)
|
|
59
|
+
.sort((a, b) => toMs(b.started_at)! - toMs(a.started_at)!)[0];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* today's file matching a file of a version */
|
|
63
|
+
export function currentOf(video: VideoDetail, version: HistoryVersion, f: FileEntry): string | null {
|
|
64
|
+
const n = fileName(f);
|
|
65
|
+
switch (version.stage) {
|
|
66
|
+
case "composition":
|
|
67
|
+
return `motion/stills/${n}`;
|
|
68
|
+
case "voice":
|
|
69
|
+
return `voice/${n}`;
|
|
70
|
+
case "render":
|
|
71
|
+
return `motion/${n}`;
|
|
72
|
+
case "sound":
|
|
73
|
+
return `sound/${n}`;
|
|
74
|
+
case "captions":
|
|
75
|
+
return "captions.srt";
|
|
76
|
+
case "assembly":
|
|
77
|
+
return n === "assembly.json" ? "export/assembly.json" : `export/${n}`;
|
|
78
|
+
case "check":
|
|
79
|
+
return `check/${n}`;
|
|
80
|
+
case "export":
|
|
81
|
+
return currentExport(video)?.path ?? null;
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* a previous version with the same files (same mtime and size) as today's is not really previous:
|
|
87
|
+
a run fell over before checking */
|
|
88
|
+
export function isRepeat(video: VideoDetail, version: HistoryVersion) {
|
|
89
|
+
const media = version.files.filter(f => kindOf(f) !== "text");
|
|
90
|
+
return (
|
|
91
|
+
media.length > 0 &&
|
|
92
|
+
media.every(f => {
|
|
93
|
+
const now = video.files.find(x => x.path === currentOf(video, version, f));
|
|
94
|
+
return now && now.size === f.size && Math.abs(now.mtime - f.mtime) < 2;
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function versionsOf(stage: StageDef, video: VideoDetail): HistoryVersion[] {
|
|
100
|
+
const kept = video.history.filter(h => stage.history.includes(h.stage) && !isRepeat(video, h));
|
|
101
|
+
if (stage.parts?.includes("export")) {
|
|
102
|
+
/* besides the kept assemblies, the other MP4s in export/ (an old Premiere export, for example) */
|
|
103
|
+
const current = currentExport(video);
|
|
104
|
+
const loose = video.files
|
|
105
|
+
.filter(f => f.path.startsWith("export/") && /\.(mp4|mov)$/i.test(f.path) && f.path !== current?.path)
|
|
106
|
+
.map(f => ({ stage: "export", key: null, at: new Date(f.mtime).toISOString(), files: [f], data: {} }));
|
|
107
|
+
return [...kept, ...loose].sort((a, b) => b.at.localeCompare(a.at));
|
|
108
|
+
}
|
|
109
|
+
return kept;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function versionSrc(video: VideoDetail, path: string, mtime?: number) {
|
|
113
|
+
return `/media/${encodeURIComponent(video.slug)}/${path.split("/").map(encodeURIComponent).join("/")}${mtime ? `?v=${mtime}` : ""}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function countPreviousResults(stage: StageDef, video: VideoDetail) {
|
|
117
|
+
return versionsOf(stage, video).length + video.runs.filter(t => stage.tools.includes(t.tool)).length;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* the stage's runs, newest first: the queue has the state now; the video detail, the ones that
|
|
121
|
+
already left the recent list */
|
|
122
|
+
export function stageRuns(stage: StageDef, video: VideoDetail, queue: Queue | null): Ticket[] {
|
|
123
|
+
const live = new Map(
|
|
124
|
+
[...video.runs, ...(queue ? [...queue.recent, ...queue.running, ...queue.waiting] : [])]
|
|
125
|
+
.filter(t => t.dir === video.dir)
|
|
126
|
+
.map(t => [t.id, t]),
|
|
127
|
+
);
|
|
128
|
+
return [...live.values()]
|
|
129
|
+
.filter(t => stage.tools.includes(t.tool))
|
|
130
|
+
.sort((a, b) => b.arrived_at.localeCompare(a.arrived_at));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* the versions by history/ dir and key (one group per line, in voice), in order */
|
|
134
|
+
export function groupVersions(versions: HistoryVersion[]): Map<string, HistoryVersion[]> {
|
|
135
|
+
const groups = new Map<string, HistoryVersion[]>();
|
|
136
|
+
for (const ver of versions) {
|
|
137
|
+
const k = ver.key ? `${ver.stage}/${ver.key}` : ver.stage;
|
|
138
|
+
groups.set(k, [...(groups.get(k) ?? []), ver]);
|
|
139
|
+
}
|
|
140
|
+
return groups;
|
|
141
|
+
}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/* Each pipeline's stages as the UI shows them: who does it, how to run it, what it writes, which
|
|
2
|
+
queue tools belong to it and which history/ versions are its results. A content delivers one or
|
|
3
|
+
more pipelines (`deliverables`): the video's (the id is the one of `omnivideo.py status --json`)
|
|
4
|
+
and the carousel's (the id is `carousel-<stage of carousel.mjs status>`). New pipeline = a
|
|
5
|
+
StageDef list in PIPELINES and its state in getStageState. */
|
|
6
|
+
|
|
7
|
+
import { formatElapsed, formatWhen, toMs } from "./format";
|
|
8
|
+
import type {
|
|
9
|
+
Ticket,
|
|
10
|
+
Queue,
|
|
11
|
+
PipelineStatus,
|
|
12
|
+
Publication,
|
|
13
|
+
ScenesApproval,
|
|
14
|
+
ScriptApproval,
|
|
15
|
+
ReferenceSwap,
|
|
16
|
+
Deliverable,
|
|
17
|
+
CarouselSummary,
|
|
18
|
+
} from "../types/api";
|
|
19
|
+
|
|
20
|
+
export type Pipeline = Deliverable;
|
|
21
|
+
|
|
22
|
+
export type StageDef = {
|
|
23
|
+
id: string;
|
|
24
|
+
pipeline?: Pipeline;
|
|
25
|
+
num: string;
|
|
26
|
+
name: string;
|
|
27
|
+
title: string;
|
|
28
|
+
owner: string;
|
|
29
|
+
command?: string;
|
|
30
|
+
writes: string;
|
|
31
|
+
tools: string[];
|
|
32
|
+
history: string[];
|
|
33
|
+
/* the status stages this UI step joins (narration, voice and timing become one step);
|
|
34
|
+
without it, the step is just the stage `id` */
|
|
35
|
+
parts?: string[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const STAGES: StageDef[] = [
|
|
39
|
+
{
|
|
40
|
+
id: "script",
|
|
41
|
+
num: "1",
|
|
42
|
+
name: "Roteiro",
|
|
43
|
+
title: "Roteiro do conteúdo",
|
|
44
|
+
owner: "O agente, com a skill av-script",
|
|
45
|
+
writes: "script.md",
|
|
46
|
+
tools: [],
|
|
47
|
+
history: [],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "motion_script",
|
|
51
|
+
num: "2",
|
|
52
|
+
name: "Roteiro de motion",
|
|
53
|
+
title: "Roteiro de motion",
|
|
54
|
+
owner: "O agente, com a skill av-motion",
|
|
55
|
+
writes: "motion.md e as cenas e beats do scenes.json",
|
|
56
|
+
tools: [],
|
|
57
|
+
history: [],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "motion",
|
|
61
|
+
num: "3",
|
|
62
|
+
name: "Composição",
|
|
63
|
+
title: "Composição: still e folhas",
|
|
64
|
+
owner: "O agente, com a skill av-motion",
|
|
65
|
+
command: "node tools/build-motion.mjs videos/<slug> --stills --sheets --transitions",
|
|
66
|
+
writes: "motion/*.html e motion/stills/",
|
|
67
|
+
tools: [],
|
|
68
|
+
history: ["composition"],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "narration",
|
|
72
|
+
num: "4",
|
|
73
|
+
name: "Narração e voz",
|
|
74
|
+
title: "Narração, voz e tempo",
|
|
75
|
+
owner:
|
|
76
|
+
"O agente escreve as falas (av-narration); omnivideo.py voice gera cada uma (Fish Audio, com Cartesia e VoiceStudio de fallback) e omnivideo.py timing posiciona",
|
|
77
|
+
command: "$PY tools/omnivideo.py voice videos/<slug> && $PY tools/omnivideo.py timing videos/<slug>",
|
|
78
|
+
writes:
|
|
79
|
+
"As falas e o enters_with dos beats, voice/*.wav, e a duração e o início de cada fala e cena no scenes.json",
|
|
80
|
+
tools: ["voice"],
|
|
81
|
+
history: ["voice"],
|
|
82
|
+
parts: ["narration", "voice", "timing"],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "render",
|
|
86
|
+
num: "5",
|
|
87
|
+
name: "Editor",
|
|
88
|
+
title: "Editor: timeline, som, legenda e exportação",
|
|
89
|
+
owner:
|
|
90
|
+
"build-motion.mjs --render e sound.mjs; a timeline edita som e cortes; omnivideo.py captions mede a legenda; assemble.mjs (ffmpeg) monta o MP4",
|
|
91
|
+
command:
|
|
92
|
+
"node tools/build-motion.mjs videos/<slug> --sheets --transitions --render && $PY tools/omnivideo.py captions videos/<slug> && node tools/assemble.mjs videos/<slug>",
|
|
93
|
+
writes:
|
|
94
|
+
"motion/*.mp4, sound/, captions.srt com o tempo de cada palavra, export/<slug>.mp4, a folha de conferência e export/assembly.json",
|
|
95
|
+
tools: ["render", "sound", "captions", "assembly"],
|
|
96
|
+
history: ["render", "sound", "captions", "assembly"],
|
|
97
|
+
parts: ["render", "captions", "export"],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "publish",
|
|
101
|
+
num: "6",
|
|
102
|
+
name: "Publicar",
|
|
103
|
+
title: "Publicar",
|
|
104
|
+
owner: "Você, pelo botão (ou o agente no fim do pipeline, com publish.auto.approved)",
|
|
105
|
+
command: "node tools/publish.mjs videos/<slug> --youtube --instagram --tiktok --confirm",
|
|
106
|
+
writes: "publication.json: o texto (escrito a partir do roteiro), o id e o link de cada plataforma",
|
|
107
|
+
tools: [],
|
|
108
|
+
history: [],
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
export const CAROUSEL_STAGES: StageDef[] = [
|
|
113
|
+
{
|
|
114
|
+
id: "carousel-script",
|
|
115
|
+
pipeline: "carousel",
|
|
116
|
+
num: "1",
|
|
117
|
+
name: "Roteiro",
|
|
118
|
+
title: "Roteiro do carrossel",
|
|
119
|
+
owner: "O agente, com a skill av-carousel",
|
|
120
|
+
writes: "carousel/script.md, e os slides, o objetivo e a legenda do post no carousel.json",
|
|
121
|
+
tools: [],
|
|
122
|
+
history: [],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "carousel-composition",
|
|
126
|
+
pipeline: "carousel",
|
|
127
|
+
num: "2",
|
|
128
|
+
name: "Composição",
|
|
129
|
+
title: "Composição: os slides em código",
|
|
130
|
+
owner: "O agente, com a skill av-carousel",
|
|
131
|
+
command: "node tools/carousel.mjs build videos/<slug> && node tools/carousel.mjs export videos/<slug>",
|
|
132
|
+
writes: "carousel/src/ (HTML de cada slide), png/, a folha e export/ (JPEG)",
|
|
133
|
+
tools: [],
|
|
134
|
+
history: [],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "carousel-publish",
|
|
138
|
+
pipeline: "carousel",
|
|
139
|
+
num: "3",
|
|
140
|
+
name: "Publicar",
|
|
141
|
+
title: "Publicar no Instagram",
|
|
142
|
+
owner: "Você, pelo botão",
|
|
143
|
+
command: "node tools/publish.mjs carousel videos/<slug> --confirm",
|
|
144
|
+
writes: "carousel/publication.json: a legenda, o id e o link do post",
|
|
145
|
+
tools: [],
|
|
146
|
+
history: [],
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
|
|
150
|
+
export const PIPELINES: Record<Pipeline, StageDef[]> = {
|
|
151
|
+
video: STAGES.map(s => ({ ...s, pipeline: "video" as const })),
|
|
152
|
+
carousel: CAROUSEL_STAGES,
|
|
153
|
+
};
|
|
154
|
+
/* "Sem narração e voz" (content.json narration: false): the spoken script and the narration/voice steps do not
|
|
155
|
+
exist for the video; the others stay and are numbered again */
|
|
156
|
+
export const SILENT_SKIPPED_STAGES = new Set(["script", "narration"]);
|
|
157
|
+
export const videoStagesFor = (narration: boolean): StageDef[] =>
|
|
158
|
+
narration
|
|
159
|
+
? PIPELINES.video
|
|
160
|
+
: PIPELINES.video.filter(s => !SILENT_SKIPPED_STAGES.has(s.id)).map((s, i) => ({ ...s, num: String(i + 1) }));
|
|
161
|
+
export const PIPELINE_NAME: Record<Pipeline, string> = { video: "Vídeo", carousel: "Carrossel" };
|
|
162
|
+
export const pipelineOf = (stage: StageDef): Pipeline => stage.pipeline ?? "video";
|
|
163
|
+
|
|
164
|
+
/* also accepts a part's id: /videos/<slug>/voice opens the step that joins it */
|
|
165
|
+
export const findStage = (id: string) =>
|
|
166
|
+
[...PIPELINES.video, ...PIPELINES.carousel].find(s => s.id === id || s.parts?.includes(id));
|
|
167
|
+
|
|
168
|
+
export type StageState =
|
|
169
|
+
| { kind: "done" }
|
|
170
|
+
| { kind: "running"; ticket: Ticket }
|
|
171
|
+
| { kind: "queued"; ticket: Ticket; position: number }
|
|
172
|
+
| { kind: "user" }
|
|
173
|
+
| { kind: "rejected" }
|
|
174
|
+
| { kind: "redoing"; reason: string }
|
|
175
|
+
| { kind: "warning"; reason: string }
|
|
176
|
+
| { kind: "scheduled"; when: string }
|
|
177
|
+
| { kind: "error"; ticket: Ticket }
|
|
178
|
+
| { kind: "next" }
|
|
179
|
+
| { kind: "missing" }
|
|
180
|
+
| { kind: "na" };
|
|
181
|
+
|
|
182
|
+
/* what getStageState needs of a video (VideoSummary and VideoDetail both fit) */
|
|
183
|
+
export type StageInput = {
|
|
184
|
+
dir: string;
|
|
185
|
+
status: PipelineStatus | null;
|
|
186
|
+
scenes_approval?: ScenesApproval | null;
|
|
187
|
+
script_approval?: ScriptApproval | null;
|
|
188
|
+
reference_swap?: ReferenceSwap | null;
|
|
189
|
+
publication?: Publication | null;
|
|
190
|
+
deliverables?: Deliverable[];
|
|
191
|
+
carousel?: CarouselSummary | null;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/* The carousel does not go through the queue: the state comes from carousel.mjs's diagnosis.
|
|
195
|
+
Composition done = slides up to date and without warnings (the JPEG comes out at publish time). */
|
|
196
|
+
function carouselStageState(stage: StageDef, v: StageInput): StageState {
|
|
197
|
+
const c = v.carousel;
|
|
198
|
+
const part = stage.id.replace(/^carousel-/, "");
|
|
199
|
+
if (!c) return part === "script" && v.deliverables?.includes("carousel") ? { kind: "next" } : { kind: "missing" };
|
|
200
|
+
if (c.error) return { kind: "warning", reason: c.error };
|
|
201
|
+
const st = (id: string) => c.stages.find(s => s.id === id);
|
|
202
|
+
if (part === "publish") {
|
|
203
|
+
const ig = c.publication?.instagram;
|
|
204
|
+
if (ig?.last_error && (!ig.published_at || ig.last_error.at > ig.published_at))
|
|
205
|
+
return { kind: "warning", reason: `A última tentativa falhou: ${ig.last_error.message}` };
|
|
206
|
+
if (ig?.id) return { kind: "done" };
|
|
207
|
+
return st("composition")?.ok ? { kind: "next" } : { kind: "missing" };
|
|
208
|
+
}
|
|
209
|
+
const s = st(part);
|
|
210
|
+
if (s?.ok) return { kind: "done" };
|
|
211
|
+
/* `missing` is carousel.mjs's human text ("avisos em s02, s05") */
|
|
212
|
+
if (part === "composition" && s?.missing && /\b(avisos|warnings)\b/.test(s.missing))
|
|
213
|
+
return { kind: "warning", reason: `Slides com aviso: ${s.missing}` };
|
|
214
|
+
return c.next === part ? { kind: "next" } : { kind: "missing" };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* publish is not a status stage: done when some platform has a link, next when the export is
|
|
218
|
+
up to date, scheduled while the scheduler waits for the time */
|
|
219
|
+
function publishStageState(v: StageInput): StageState {
|
|
220
|
+
const s = v.publication?.schedule;
|
|
221
|
+
if (s?.state === "failed" || s?.state === "missed") {
|
|
222
|
+
return {
|
|
223
|
+
kind: "warning",
|
|
224
|
+
reason: `A publicação agendada ${s.state === "missed" ? "passou da hora" : "falhou"}: ${s.last_error?.message ?? ""}`,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (s) return { kind: "scheduled", when: s.when };
|
|
228
|
+
const plats = [v.publication?.youtube, v.publication?.instagram, v.publication?.tiktok];
|
|
229
|
+
const failed = plats.find(p => p?.last_error && (!p.published_at || p.last_error.at > p.published_at));
|
|
230
|
+
if (failed) return { kind: "warning", reason: `A última tentativa falhou: ${failed.last_error!.message}` };
|
|
231
|
+
if (plats.some(p => p?.id)) return { kind: "done" };
|
|
232
|
+
const exp = v.status?.stages.find(s => s.id === "export");
|
|
233
|
+
return exp?.ok && !exp.outdated ? { kind: "next" } : { kind: "missing" };
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const byRecent = (a: Ticket, b: Ticket) => (b.ended_at ?? b.arrived_at).localeCompare(a.ended_at ?? a.arrived_at);
|
|
237
|
+
|
|
238
|
+
/* step with parts: done when all are; else the most urgent state among them */
|
|
239
|
+
const URGENCY: StageState["kind"][] = [
|
|
240
|
+
"running",
|
|
241
|
+
"queued",
|
|
242
|
+
"error",
|
|
243
|
+
"warning",
|
|
244
|
+
"user",
|
|
245
|
+
"rejected",
|
|
246
|
+
"redoing",
|
|
247
|
+
"next",
|
|
248
|
+
"scheduled",
|
|
249
|
+
"missing",
|
|
250
|
+
"na",
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
export function getStageState(stage: StageDef, v: StageInput, queue: Queue | null, runs: Ticket[] = []): StageState {
|
|
254
|
+
if (pipelineOf(stage) === "carousel") return carouselStageState(stage, v);
|
|
255
|
+
if (stage.parts) {
|
|
256
|
+
const states = stage.parts.map(id => getStageState({ ...stage, id, parts: undefined }, v, queue, runs));
|
|
257
|
+
if (states.every(s => s.kind === "done")) return { kind: "done" };
|
|
258
|
+
for (const kind of URGENCY) {
|
|
259
|
+
const found = states.find(s => s.kind === kind);
|
|
260
|
+
if (found) return found;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const mine = (t: Ticket) => t.dir === v.dir && stage.tools.includes(t.tool);
|
|
264
|
+
const running = queue?.running.find(mine);
|
|
265
|
+
if (running) return { kind: "running", ticket: running };
|
|
266
|
+
const i = queue?.waiting.findIndex(mine) ?? -1;
|
|
267
|
+
if (i >= 0) return { kind: "queued", ticket: queue!.waiting[i], position: i + 1 };
|
|
268
|
+
if (stage.id === "publish") return publishStageState(v);
|
|
269
|
+
if (stage.id === "script") {
|
|
270
|
+
if (v.script_approval?.status === "pending") return { kind: "user" };
|
|
271
|
+
if (v.script_approval?.status === "change_requested") return { kind: "rejected" };
|
|
272
|
+
}
|
|
273
|
+
if (stage.id === "motion_script") {
|
|
274
|
+
if (v.reference_swap && !v.reference_swap.applied)
|
|
275
|
+
return {
|
|
276
|
+
kind: "redoing",
|
|
277
|
+
reason: `Trocando o estilo visual para ${v.reference_swap.to ?? "outra, escolhida pelo agente"}`,
|
|
278
|
+
};
|
|
279
|
+
if (v.scenes_approval?.status === "pending") return { kind: "user" };
|
|
280
|
+
if (v.scenes_approval?.status === "change_requested") return { kind: "rejected" };
|
|
281
|
+
}
|
|
282
|
+
const st = v.status?.stages.find(s => s.id === stage.id);
|
|
283
|
+
if (st?.ok) return { kind: "done" };
|
|
284
|
+
if (st?.outdated) return { kind: "warning", reason: "O scenes.json ou a legenda mudou depois: monte com --redo" };
|
|
285
|
+
if (st?.stale?.length)
|
|
286
|
+
return { kind: "warning", reason: `O início mudou em ${st.stale.join(", ")}: renderize de novo` };
|
|
287
|
+
/* the last run of this stage failed and it did not end up done */
|
|
288
|
+
const last = [...runs, ...(queue?.recent ?? [])].filter(mine).sort(byRecent)[0];
|
|
289
|
+
if (last?.effective === "error") return { kind: "error", ticket: last };
|
|
290
|
+
if (v.status?.next?.id === stage.id) return { kind: "next" };
|
|
291
|
+
return { kind: "missing" };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* the stage the page opens on: what is happening, what waits for the user, what broke; with the
|
|
295
|
+
video exported (not yet published, scheduled or already live) it opens on Publish, where it
|
|
296
|
+
is; else what comes next */
|
|
297
|
+
export function getInitialStage(
|
|
298
|
+
v: StageInput,
|
|
299
|
+
queue: Queue | null,
|
|
300
|
+
runs: Ticket[],
|
|
301
|
+
pipeline: Pipeline = "video",
|
|
302
|
+
): string {
|
|
303
|
+
if (pipeline === "carousel") {
|
|
304
|
+
const states = PIPELINES.carousel.map(s => [s.id, getStageState(s, v, queue, runs).kind] as const);
|
|
305
|
+
return states.find(([, k]) => k !== "done")?.[0] ?? "carousel-publish";
|
|
306
|
+
}
|
|
307
|
+
const states = STAGES.map(s => [s.id, getStageState(s, v, queue, runs).kind] as const);
|
|
308
|
+
const first = (kinds: string[]) => {
|
|
309
|
+
for (const kind of kinds) {
|
|
310
|
+
const found = states.find(([, k]) => k === kind);
|
|
311
|
+
if (found) return found[0];
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
};
|
|
315
|
+
const urgent = first(["running", "user", "redoing", "error", "queued"]);
|
|
316
|
+
if (urgent) return urgent;
|
|
317
|
+
const exp = v.status?.stages.find(s => s.id === "export");
|
|
318
|
+
if (exp?.ok && !exp.outdated) return "publish";
|
|
319
|
+
return first(["next", "scheduled"]) ?? "render";
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export const STAGE_STATE_LABEL: Record<StageState["kind"], string> = {
|
|
323
|
+
done: "Feita",
|
|
324
|
+
running: "Rodando",
|
|
325
|
+
queued: "Na fila",
|
|
326
|
+
user: "Esperando você",
|
|
327
|
+
rejected: "Reprovada",
|
|
328
|
+
redoing: "Refazendo",
|
|
329
|
+
warning: "Atenção",
|
|
330
|
+
scheduled: "Agendada",
|
|
331
|
+
error: "Erro",
|
|
332
|
+
next: "Próxima",
|
|
333
|
+
missing: "",
|
|
334
|
+
na: "Não se aplica",
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/* the short state text under a step: "Rodando 1min05s", "Na fila · 2º", "Agendada · 14/10 18:00" */
|
|
338
|
+
export function stageStateDetail(s: StageState, now: number) {
|
|
339
|
+
if (s.kind === "running")
|
|
340
|
+
return `${STAGE_STATE_LABEL.running} ${formatElapsed(now - (toMs(s.ticket.started_at) ?? now))}`;
|
|
341
|
+
if (s.kind === "queued") return `${STAGE_STATE_LABEL.queued} · ${s.position}º`;
|
|
342
|
+
if (s.kind === "scheduled") return `${STAGE_STATE_LABEL.scheduled} · ${formatWhen(s.when)}`;
|
|
343
|
+
return STAGE_STATE_LABEL[s.kind];
|
|
344
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* What the "studio sem conexão" screen (components/StudioOffline.tsx) says, from what the hub knows
|
|
2
|
+
(cloud/studio/src/presence.mjs): the reason the Mac is out and the step that brings it back. A refused
|
|
3
|
+
key repairs itself (the runner opens the approval page on the Mac); the rest needs one thing on the Mac. */
|
|
4
|
+
|
|
5
|
+
import type { RunnerProblem } from "../types/api";
|
|
6
|
+
import { formatDayTime } from "./format";
|
|
7
|
+
|
|
8
|
+
export type OfflineStep = { text: string; code?: string };
|
|
9
|
+
export type OfflineAdvice = { title: string; text: string; steps: OfflineStep[] };
|
|
10
|
+
|
|
11
|
+
const theMac = (name: string | null | undefined) => (name ? `O Mac “${name}”` : "O Mac que roda o studio");
|
|
12
|
+
|
|
13
|
+
export function offlineAdvice(o: {
|
|
14
|
+
name: string | null;
|
|
15
|
+
lastSeen: string | null;
|
|
16
|
+
problem: RunnerProblem | null;
|
|
17
|
+
}): OfflineAdvice {
|
|
18
|
+
const p = o.problem;
|
|
19
|
+
if (p?.reason === "key")
|
|
20
|
+
return {
|
|
21
|
+
title: "O Mac precisa ser aprovado de novo",
|
|
22
|
+
text: `${theMac(p.host || o.name)} tentou conectar em ${formatDayTime(p.at)}, mas o servidor não aceitou a chave dele. Ele pede uma nova sozinho: a página de aprovação abre no navegador do Mac.`,
|
|
23
|
+
steps: [
|
|
24
|
+
{ text: "No Mac, aprove a conexão na página que abriu (entre com o Google se ela pedir)." },
|
|
25
|
+
{ text: "Se a página não abriu, no Mac:", code: "node tools/runner.mjs login" },
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
if (p?.reason === "revoked")
|
|
29
|
+
return {
|
|
30
|
+
title: "Este Mac foi desconectado",
|
|
31
|
+
text: `${theMac(p.name || o.name)} foi desconectado do studio em ${formatDayTime(p.at)}. Ele só volta quando for pareado de novo.`,
|
|
32
|
+
steps: [{ text: "No Mac:", code: "node tools/runner.mjs login" }],
|
|
33
|
+
};
|
|
34
|
+
if (p?.reason === "protocol" && p.side === "mac")
|
|
35
|
+
return {
|
|
36
|
+
title: "O Mac precisa de atualização",
|
|
37
|
+
text: `${theMac(p.host || o.name)} está com uma versão do studio anterior à do servidor, e os dois não se entendem.`,
|
|
38
|
+
steps: [
|
|
39
|
+
{ text: "No Mac, atualize e reinicie o studio:", code: "git pull && node tools/runner.mjs service restart" },
|
|
40
|
+
{ text: "Sem o serviço, feche o studio e abra de novo:", code: "cd studio && bun start" },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
if (p?.reason === "protocol")
|
|
44
|
+
return {
|
|
45
|
+
title: "O servidor está desatualizado",
|
|
46
|
+
text: `${theMac(p.host || o.name)} já tem uma versão mais nova que a do servidor.`,
|
|
47
|
+
steps: [
|
|
48
|
+
{ text: "Suba o servidor: o merge na main faz o deploy sozinho, ou GitHub → Actions → Deploy → Run workflow." },
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
title: "O studio perdeu a conexão",
|
|
53
|
+
text: `${theMac(o.name)} não está conectado ${o.lastSeen ? `desde ${formatDayTime(o.lastSeen)}` : "agora"}. Ele pode estar desligado, dormindo ou sem internet, ou o studio está fechado. O que você pediu espera e volta a andar quando ele reconectar.`,
|
|
54
|
+
steps: [
|
|
55
|
+
{ text: "Confira se o Mac está ligado, acordado e com internet." },
|
|
56
|
+
{ text: "Deixe o studio sempre aberto (uma vez só, no Mac):", code: "node tools/runner.mjs service install" },
|
|
57
|
+
{ text: "Ou abra à mão:", code: "cd studio && bun start" },
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* The visual style upload, a photo or a video (POST /api/references/upload): a raw body with the name in
|
|
2
|
+
x-file-name, not JSON, so it stays outside the typed client. XHR because fetch gives no upload
|
|
3
|
+
progress. The file is kept in .uploads/ and the answer carries its path. */
|
|
4
|
+
|
|
5
|
+
export type UploadResult = { ok: boolean; path?: string; error?: string };
|
|
6
|
+
|
|
7
|
+
export function uploadStyleFile(file: File, progress: (pct: number) => void): Promise<UploadResult> {
|
|
8
|
+
return new Promise(resolve => {
|
|
9
|
+
const x = new XMLHttpRequest();
|
|
10
|
+
x.open("POST", "/api/references/upload");
|
|
11
|
+
x.setRequestHeader("content-type", "application/octet-stream");
|
|
12
|
+
x.setRequestHeader("x-file-name", encodeURIComponent(file.name));
|
|
13
|
+
x.upload.onprogress = e => e.lengthComputable && progress(Math.round((e.loaded / e.total) * 100));
|
|
14
|
+
x.onerror = () => resolve({ ok: false, error: "O envio falhou" });
|
|
15
|
+
x.onload = () => {
|
|
16
|
+
try {
|
|
17
|
+
resolve(JSON.parse(x.responseText));
|
|
18
|
+
} catch {
|
|
19
|
+
resolve({ ok: false, error: `${x.status}: ${x.statusText}` });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
x.send(file);
|
|
23
|
+
});
|
|
24
|
+
}
|