@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
package/tools/editor.mjs
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
Editor pela linha de comando: o que a timeline do studio (etapa Editor) faz
|
|
4
|
+
na mão, para o Claude fazer pelo chat de edição (skill av-editor). Grava no
|
|
5
|
+
scenes.json com as mesmas regras da tela (tools/cuts.mjs, tools/soundtrack.mjs)
|
|
6
|
+
e guarda a versão anterior em history/editor/. Não renderiza: depois de
|
|
7
|
+
editar, `node tools/assemble.mjs videos/<slug>` refaz o export.
|
|
8
|
+
|
|
9
|
+
node tools/editor.mjs show videos/<slug> [--json]
|
|
10
|
+
a timeline: cenas e falas com os clips (posição no vídeo), o texto e as
|
|
11
|
+
palavras com tempo, os beats com som, a cama e os cortes de área
|
|
12
|
+
node tools/editor.mjs silences videos/<slug> [--min 0.6]
|
|
13
|
+
as pausas da voz maiores que --min (s), entre palavras, já tirando o
|
|
14
|
+
que está cortado
|
|
15
|
+
node tools/editor.mjs cut videos/<slug> --from 12.3 --to 13.1
|
|
16
|
+
corte de área: o trecho sai do export e o resto emenda
|
|
17
|
+
node tools/editor.mjs cut-silences videos/<slug> [--min 0.6] [--padding 0.15]
|
|
18
|
+
corta cada pausa maior que --min, deixando --padding de respiro de cada lado
|
|
19
|
+
node tools/editor.mjs uncut videos/<slug> <n|all>
|
|
20
|
+
desfaz o corte n (a ordem do `show`) ou todos
|
|
21
|
+
node tools/editor.mjs speed videos/<slug> <100–150>
|
|
22
|
+
velocidade do export (%): imagem, voz e efeitos aceleram juntos; a música de
|
|
23
|
+
fundo (cama) não: ela fica isolada, tanto da velocidade quanto dos cortes
|
|
24
|
+
node tools/editor.mjs speed videos/<slug> <50–200> <cena|fala>[:k] | bed
|
|
25
|
+
velocidade só do clip k (1, 2…; padrão 1) de uma cena ou fala, ou só da música
|
|
26
|
+
de fundo: o clip dura menos e começa no mesmo lugar (a voz não muda de tom)
|
|
27
|
+
node tools/editor.mjs split videos/<slug> <cena|fala> <t>
|
|
28
|
+
quebra o clip da cena (c02) ou da fala (c02f1) que está em t, em dois
|
|
29
|
+
node tools/editor.mjs move videos/<slug> <cena|fala>[:k] <offset> [--add]
|
|
30
|
+
põe o clip k (1, 2…; padrão 1) a `offset` segundos do lugar dele; --add soma
|
|
31
|
+
node tools/editor.mjs delete videos/<slug> <cena|fala>:k
|
|
32
|
+
tira o clip k (a imagem para no último quadro do anterior; a voz fica muda)
|
|
33
|
+
node tools/editor.mjs restore videos/<slug> <cena|fala|all>
|
|
34
|
+
volta o clip inteiro, no lugar
|
|
35
|
+
|
|
36
|
+
Tempos em segundos do vídeo sem cortes (o do scenes.json). Com --edited,
|
|
37
|
+
os tempos que você passa são os da timeline já cortada (o que o usuário vê
|
|
38
|
+
no editor, e o tempo do export).
|
|
39
|
+
============================================================================ */
|
|
40
|
+
/* (the header above is printed as the usage text, so it stays in Portuguese) */
|
|
41
|
+
|
|
42
|
+
import { readFileSync, writeFileSync, renameSync, existsSync } from "node:fs";
|
|
43
|
+
import { join, resolve } from "node:path";
|
|
44
|
+
import { fileURLToPath } from "node:url";
|
|
45
|
+
import { loadVideo, beatTime } from "./timing.mjs";
|
|
46
|
+
import { normalizeCuts, removedDuration, toEdited, toOriginal, isCut } from "./cuts.mjs";
|
|
47
|
+
import {
|
|
48
|
+
videoClips,
|
|
49
|
+
lineClips,
|
|
50
|
+
voiceSpans,
|
|
51
|
+
animationInstant,
|
|
52
|
+
lineDuration,
|
|
53
|
+
clipLength,
|
|
54
|
+
clipSpeed,
|
|
55
|
+
CLIP_SPEED,
|
|
56
|
+
} from "./soundtrack.mjs";
|
|
57
|
+
import { applyClips, sanitizeBed, sanitizeSpeed } from "./sound.mjs";
|
|
58
|
+
import { keepPrevious } from "./history.mjs";
|
|
59
|
+
|
|
60
|
+
const args = process.argv.slice(2);
|
|
61
|
+
const [cmd, dirArg] = args;
|
|
62
|
+
const flag = n => args.includes(`--${n}`);
|
|
63
|
+
const option = n => {
|
|
64
|
+
const i = args.indexOf(`--${n}`);
|
|
65
|
+
return i < 0 ? undefined : args[i + 1];
|
|
66
|
+
};
|
|
67
|
+
const positionals = args
|
|
68
|
+
.slice(2)
|
|
69
|
+
.filter(
|
|
70
|
+
(a, i, l) =>
|
|
71
|
+
!a.startsWith("--") &&
|
|
72
|
+
!(i > 0 && l[i - 1].startsWith("--") && ["from", "to", "min", "padding"].includes(l[i - 1].slice(2))),
|
|
73
|
+
);
|
|
74
|
+
function fail(msg) {
|
|
75
|
+
console.error(`erro: ${msg}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
if (!cmd || !dirArg || !existsSync(join(resolve(dirArg), "scenes.json"))) {
|
|
79
|
+
const source = readFileSync(fileURLToPath(import.meta.url), "utf8").split("\n");
|
|
80
|
+
console.log(
|
|
81
|
+
source
|
|
82
|
+
.slice(
|
|
83
|
+
1,
|
|
84
|
+
source.findIndex((l, i) => i > 1 && l.includes("=====*/")),
|
|
85
|
+
)
|
|
86
|
+
.join("\n"),
|
|
87
|
+
);
|
|
88
|
+
process.exit(2);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const dir = resolve(dirArg);
|
|
92
|
+
const file = join(dir, "scenes.json");
|
|
93
|
+
const raw = JSON.parse(readFileSync(file, "utf8"));
|
|
94
|
+
const video = loadVideo(dir);
|
|
95
|
+
const { fps } = video.format;
|
|
96
|
+
const total = video.total_duration;
|
|
97
|
+
let cuts = normalizeCuts(video.cuts, total, fps);
|
|
98
|
+
const ed = t => toEdited(t, cuts);
|
|
99
|
+
/* time from the command line → scenes.json time */
|
|
100
|
+
const input = s => {
|
|
101
|
+
const n = Number(s);
|
|
102
|
+
if (!Number.isFinite(n)) fail(`tempo inválido: ${s}`);
|
|
103
|
+
return flag("edited") ? toOriginal(n, cuts) : n;
|
|
104
|
+
};
|
|
105
|
+
const mmss = s => `${Math.floor(s / 60)}:${(s % 60).toFixed(2).padStart(5, "0")}`;
|
|
106
|
+
const when = s => `${s.toFixed(2)}s${cuts.length ? ` (${mmss(ed(s))} no editor)` : ` (${mmss(s)})`}`;
|
|
107
|
+
|
|
108
|
+
/* scene (c02) or line (c02f1) */
|
|
109
|
+
function target(id) {
|
|
110
|
+
for (const scene of video.scenes) {
|
|
111
|
+
if (scene.id === id)
|
|
112
|
+
return { kind: "video", id, scene, base: scene.start, clips: videoClips(scene), step: 1 / fps };
|
|
113
|
+
const line = (scene.lines ?? []).find(l => l.id === id);
|
|
114
|
+
if (line)
|
|
115
|
+
return { kind: "voice", id, scene, line, base: scene.start + line.start, clips: lineClips(line), step: 0.001 };
|
|
116
|
+
}
|
|
117
|
+
fail(`não existe cena nem fala "${id}" (veja: node tools/editor.mjs show ${dirArg})`);
|
|
118
|
+
}
|
|
119
|
+
const idAndK = s => {
|
|
120
|
+
const [id, k] = String(s ?? "").split(":");
|
|
121
|
+
return { id, k: k ? Number(k) - 1 : 0 };
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
function save(summary) {
|
|
125
|
+
const previous = keepPrevious(dir, "editor", null, ["scenes.json"]);
|
|
126
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
127
|
+
writeFileSync(tmp, JSON.stringify(raw, null, 2) + "\n");
|
|
128
|
+
renameSync(tmp, file);
|
|
129
|
+
previous.close();
|
|
130
|
+
console.log(summary);
|
|
131
|
+
console.log("gravado no scenes.json; o export muda com: node tools/assemble.mjs " + dirArg);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* new clips of a scene or line, validated as the screen validates, copied into scenes.json */
|
|
135
|
+
function newClips(a, clips) {
|
|
136
|
+
const draft = a.kind === "video" ? { scene_clips: { [a.id]: clips } } : { line_clips: { [a.id]: clips } };
|
|
137
|
+
try {
|
|
138
|
+
applyClips(video, draft);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
fail(e.message);
|
|
141
|
+
}
|
|
142
|
+
const rawScene = raw.scenes.find(c => c.id === a.scene.id);
|
|
143
|
+
const vs = video.scenes.find(c => c.id === a.scene.id);
|
|
144
|
+
if (a.kind === "video") {
|
|
145
|
+
/* video_em = legacy name of video_offset */
|
|
146
|
+
for (const k of ["clips", "video_offset", "video_em"]) {
|
|
147
|
+
if (k in vs) rawScene[k] = vs[k];
|
|
148
|
+
else delete rawScene[k];
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
const rawLine = rawScene.lines.find(l => l.id === a.id),
|
|
152
|
+
vl = vs.lines.find(l => l.id === a.id);
|
|
153
|
+
if ("clips" in vl) rawLine.clips = vl.clips;
|
|
154
|
+
else delete rawLine.clips;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function saveCuts(next) {
|
|
159
|
+
const n = normalizeCuts(next, total, fps);
|
|
160
|
+
if (total - removedDuration(n) < 0.5) fail("os cortes tirariam o vídeo inteiro");
|
|
161
|
+
if (n.length) raw.cuts = n;
|
|
162
|
+
else delete raw.cuts;
|
|
163
|
+
cuts = n;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* the spoken words, in video time, already where the voice clips put them */
|
|
167
|
+
function words() {
|
|
168
|
+
const out = [];
|
|
169
|
+
for (const scene of video.scenes)
|
|
170
|
+
for (const l of scene.lines ?? []) {
|
|
171
|
+
for (const p of l.words ?? [])
|
|
172
|
+
for (const [s, e] of voiceSpans(scene, l, p.s, p.e)) out.push({ line: l.id, w: p.w, s, e });
|
|
173
|
+
}
|
|
174
|
+
return out.sort((a, b) => a.s - b.s);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function silences(min) {
|
|
178
|
+
const ps = words().filter(p => !isCut((p.s + p.e) / 2, cuts));
|
|
179
|
+
const out = [];
|
|
180
|
+
for (let i = 1; i < ps.length; i++) {
|
|
181
|
+
const a = ps[i - 1].e,
|
|
182
|
+
b = ps[i].s;
|
|
183
|
+
if (b - a < min) continue;
|
|
184
|
+
/* whatever was already cut in there doesn't count */
|
|
185
|
+
const free = b - a - cuts.reduce((s, c) => s + Math.max(0, Math.min(b, c.to) - Math.max(a, c.from)), 0);
|
|
186
|
+
if (free >= min) out.push({ from: a, to: b, dur: free, before: ps[i - 1], after: ps[i] });
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
switch (cmd) {
|
|
192
|
+
case "show": {
|
|
193
|
+
const data = {
|
|
194
|
+
format: video.format,
|
|
195
|
+
total,
|
|
196
|
+
total_edited: +(total - removedDuration(cuts)).toFixed(3),
|
|
197
|
+
speed: sanitizeSpeed(raw.speed),
|
|
198
|
+
provisional: video.provisional,
|
|
199
|
+
cuts: cuts.map((c, i) => ({ n: i + 1, ...c, in_editor: +ed(c.from).toFixed(3) })),
|
|
200
|
+
scenes: video.scenes.map(c => ({
|
|
201
|
+
id: c.id,
|
|
202
|
+
title: c.title,
|
|
203
|
+
start: c.start,
|
|
204
|
+
duration: c.duration,
|
|
205
|
+
html: c.html,
|
|
206
|
+
mp4: c.mp4,
|
|
207
|
+
clips: videoClips(c).map((cl, k) => ({
|
|
208
|
+
k: k + 1,
|
|
209
|
+
...cl,
|
|
210
|
+
in_video: [
|
|
211
|
+
+(c.start + cl.from + cl.offset).toFixed(3),
|
|
212
|
+
+(c.start + cl.from + cl.offset + clipLength(cl)).toFixed(3),
|
|
213
|
+
],
|
|
214
|
+
})),
|
|
215
|
+
beats: (c.beats ?? []).map(b => {
|
|
216
|
+
let t = null;
|
|
217
|
+
try {
|
|
218
|
+
t = animationInstant(c, beatTime(c, b));
|
|
219
|
+
} catch {
|
|
220
|
+
/* no timing */
|
|
221
|
+
}
|
|
222
|
+
return { element: b.element, t: t == null ? null : +t.toFixed(3), sound: b.sound ?? null };
|
|
223
|
+
}),
|
|
224
|
+
lines: (c.lines ?? []).map(l => ({
|
|
225
|
+
id: l.id,
|
|
226
|
+
text: l.text,
|
|
227
|
+
dur: lineDuration(l),
|
|
228
|
+
clips: lineClips(l).map((cl, k) => ({
|
|
229
|
+
k: k + 1,
|
|
230
|
+
...cl,
|
|
231
|
+
in_video: [
|
|
232
|
+
+(c.start + l.start + cl.from + cl.offset).toFixed(3),
|
|
233
|
+
+(c.start + l.start + cl.from + cl.offset + clipLength(cl)).toFixed(3),
|
|
234
|
+
],
|
|
235
|
+
})),
|
|
236
|
+
})),
|
|
237
|
+
})),
|
|
238
|
+
bed: video.bed ?? null,
|
|
239
|
+
words: words().map(p => ({ ...p, s: +p.s.toFixed(3), e: +p.e.toFixed(3) })),
|
|
240
|
+
};
|
|
241
|
+
if (flag("json")) {
|
|
242
|
+
console.log(JSON.stringify(data, null, 1));
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
console.log(
|
|
246
|
+
`${video.format.w}×${video.format.h} @ ${fps} · ${total.toFixed(2)}s${cuts.length ? ` · ${data.total_edited.toFixed(2)}s com os cortes` : ""}${video.provisional ? " · tempos provisórios" : ""}`,
|
|
247
|
+
);
|
|
248
|
+
for (const c of data.scenes) {
|
|
249
|
+
console.log(
|
|
250
|
+
`\n${c.id} ${c.title ?? ""} · ${c.start.toFixed(2)}–${(c.start + c.duration).toFixed(2)}s · ${c.html ?? ""}`,
|
|
251
|
+
);
|
|
252
|
+
for (const cl of c.clips)
|
|
253
|
+
console.log(
|
|
254
|
+
` animação ${c.id}:${cl.k} MP4 ${cl.from.toFixed(2)}–${cl.to.toFixed(2)} no vídeo ${when(cl.in_video[0])} → ${cl.in_video[1].toFixed(2)}s${cl.offset ? ` offset ${cl.offset > 0 ? "+" : ""}${cl.offset}` : ""}${cl.speed ? ` ${Math.round(cl.speed * 100)}%` : ""}`,
|
|
255
|
+
);
|
|
256
|
+
if (!c.clips.length) console.log(" animação apagada");
|
|
257
|
+
for (const l of c.lines) {
|
|
258
|
+
console.log(` fala ${l.id} "${l.text}"`);
|
|
259
|
+
for (const cl of l.clips)
|
|
260
|
+
console.log(
|
|
261
|
+
` voz ${l.id}:${cl.k} áudio ${cl.from.toFixed(2)}–${cl.to.toFixed(2)} no vídeo ${when(cl.in_video[0])} → ${cl.in_video[1].toFixed(2)}s${cl.offset ? ` offset ${cl.offset > 0 ? "+" : ""}${cl.offset}` : ""}${cl.speed ? ` ${Math.round(cl.speed * 100)}%` : ""}`,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
for (const b of c.beats.filter(b => b.sound))
|
|
265
|
+
console.log(
|
|
266
|
+
` beat ${b.element} ${b.t == null ? "(num pedaço apagado)" : when(b.t)} · som ${JSON.stringify(b.sound)}`,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
if (data.bed) console.log(`\ncama: ${JSON.stringify(data.bed)}`);
|
|
270
|
+
console.log(
|
|
271
|
+
cuts.length
|
|
272
|
+
? `\ncortes de área:\n${data.cuts.map(c => ` ${c.n}. ${c.from.toFixed(2)}–${c.to.toFixed(2)}s (${(c.to - c.from).toFixed(2)}s, em ${mmss(c.in_editor)} no editor)`).join("\n")}`
|
|
273
|
+
: "\nsem cortes de área",
|
|
274
|
+
);
|
|
275
|
+
console.log(`\npalavras (tempo do vídeo):\n${data.words.map(p => `${p.s.toFixed(2)} ${p.w}`).join(" · ")}`);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
case "silences": {
|
|
279
|
+
const min = Number(option("min") ?? 0.6);
|
|
280
|
+
const l = silences(min);
|
|
281
|
+
if (!l.length) {
|
|
282
|
+
console.log(`nenhuma pausa maior que ${min}s`);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
for (const p of l)
|
|
286
|
+
console.log(
|
|
287
|
+
`${p.from.toFixed(2)}–${p.to.toFixed(2)}s (${p.dur.toFixed(2)}s, em ${mmss(ed(p.from))} no editor) "${p.before.w}" … "${p.after.w}" ${p.before.line === p.after.line ? `dentro de ${p.before.line}` : `${p.before.line} → ${p.after.line}`}`,
|
|
288
|
+
);
|
|
289
|
+
console.log(`${l.length} pausa(s), ${l.reduce((s, p) => s + p.dur, 0).toFixed(2)}s no total`);
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
case "cut": {
|
|
293
|
+
const from = input(option("from")),
|
|
294
|
+
to = input(option("to"));
|
|
295
|
+
if (!(to > from)) fail("--to tem de ser depois de --from");
|
|
296
|
+
saveCuts([...cuts, { from, to }]);
|
|
297
|
+
save(
|
|
298
|
+
`cortado ${from.toFixed(2)}–${to.toFixed(2)}s (${(to - from).toFixed(2)}s) · ${cuts.length} corte(s), ${removedDuration(cuts).toFixed(2)}s fora`,
|
|
299
|
+
);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case "speed": {
|
|
303
|
+
if (positionals[0] == null) fail("diga a velocidade em % (100 a 150)");
|
|
304
|
+
/* only one clip, or only the background music */
|
|
305
|
+
if (positionals[1] != null) {
|
|
306
|
+
const pct = Number(positionals[0]);
|
|
307
|
+
const [lo, hi] = CLIP_SPEED.map(x => x * 100);
|
|
308
|
+
if (!(pct >= lo && pct <= hi)) fail(`velocidade de um clip ou da música: ${lo} a ${hi}%`);
|
|
309
|
+
if (positionals[1] === "bed") {
|
|
310
|
+
if (!raw.bed) fail("o vídeo não tem música de fundo");
|
|
311
|
+
const bed = typeof raw.bed === "string" ? { name: raw.bed } : { ...raw.bed };
|
|
312
|
+
bed.speed = pct / 100;
|
|
313
|
+
try {
|
|
314
|
+
raw.bed = sanitizeBed(dir, bed, total);
|
|
315
|
+
} catch (e) {
|
|
316
|
+
fail(e.message);
|
|
317
|
+
}
|
|
318
|
+
save(`música de fundo a ${pct}%`);
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
const { id, k } = idAndK(positionals[1]);
|
|
322
|
+
const a = target(id);
|
|
323
|
+
if (!a.clips[k]) fail(`${id} não tem o clip ${k + 1}`);
|
|
324
|
+
newClips(
|
|
325
|
+
a,
|
|
326
|
+
a.clips.map((c, i) => (i === k ? { ...c, speed: pct / 100 } : c)),
|
|
327
|
+
);
|
|
328
|
+
const c = { ...a.clips[k], speed: pct / 100 };
|
|
329
|
+
save(`${id}:${k + 1} a ${pct}%: dura ${clipLength(c).toFixed(2)}s em vez de ${(c.to - c.from).toFixed(2)}s`);
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
const v = sanitizeSpeed(positionals[0]);
|
|
333
|
+
raw.speed = v;
|
|
334
|
+
save(`velocidade do export: ${Math.round(v * 100)}% (${(total / v - removedDuration(cuts) / v).toFixed(2)}s)`);
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
case "cut-silences": {
|
|
338
|
+
const min = Number(option("min") ?? 0.6),
|
|
339
|
+
padding = Number(option("padding") ?? 0.15);
|
|
340
|
+
const next = silences(min)
|
|
341
|
+
.map(p => ({ from: p.from + padding, to: p.to - padding }))
|
|
342
|
+
.filter(c => c.to - c.from >= 2 / fps);
|
|
343
|
+
if (!next.length) {
|
|
344
|
+
console.log(`nenhuma pausa maior que ${min}s para cortar`);
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
const before = removedDuration(cuts);
|
|
348
|
+
saveCuts([...cuts, ...next]);
|
|
349
|
+
save(
|
|
350
|
+
`${next.length} pausa(s) cortada(s), deixando ${padding}s de cada lado: ${(removedDuration(cuts) - before).toFixed(2)}s a menos (${(total - removedDuration(cuts)).toFixed(2)}s no total)`,
|
|
351
|
+
);
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
case "uncut": {
|
|
355
|
+
const q = positionals[0];
|
|
356
|
+
if (q === "all") saveCuts([]);
|
|
357
|
+
else {
|
|
358
|
+
const i = Number(q) - 1;
|
|
359
|
+
if (!cuts[i]) fail(`não existe o corte ${q} (veja: show)`);
|
|
360
|
+
saveCuts(cuts.filter((_, j) => j !== i));
|
|
361
|
+
}
|
|
362
|
+
save(`${q === "all" ? "todos os cortes desfeitos" : `corte ${q} desfeito`} · ${cuts.length} corte(s)`);
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
case "split": {
|
|
366
|
+
const a = target(positionals[0]);
|
|
367
|
+
const t = input(positionals[1]);
|
|
368
|
+
const k = a.clips.findIndex(c => t > a.base + c.from + c.offset && t < a.base + c.from + c.offset + clipLength(c));
|
|
369
|
+
if (k < 0) fail(`nenhum clip de ${a.id} passa por ${t.toFixed(2)}s`);
|
|
370
|
+
const c = a.clips[k];
|
|
371
|
+
/* the point in the file: a sped clip covers speed seconds of it per second of video */
|
|
372
|
+
const local = Math.round((c.from + (t - (a.base + c.from + c.offset)) * clipSpeed(c)) / a.step) * a.step;
|
|
373
|
+
if (local - c.from < a.step || c.to - local < a.step) fail("ponto colado na borda do clip");
|
|
374
|
+
newClips(a, [...a.clips.slice(0, k), { ...c, to: local }, { ...c, from: local }, ...a.clips.slice(k + 1)]);
|
|
375
|
+
save(`${a.id}:${k + 1} quebrado em ${t.toFixed(2)}s: agora ${a.id}:${k + 1} e ${a.id}:${k + 2}`);
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
case "move": {
|
|
379
|
+
const { id, k } = idAndK(positionals[0]);
|
|
380
|
+
const a = target(id);
|
|
381
|
+
if (!a.clips[k]) fail(`${id} não tem o clip ${k + 1}`);
|
|
382
|
+
const n = Number(positionals[1]);
|
|
383
|
+
if (!Number.isFinite(n)) fail("diga quanto: move <id>[:k] <segundos>");
|
|
384
|
+
const offset = flag("add") ? a.clips[k].offset + n : n;
|
|
385
|
+
newClips(
|
|
386
|
+
a,
|
|
387
|
+
a.clips.map((c, i) => (i === k ? { ...c, offset } : c)),
|
|
388
|
+
);
|
|
389
|
+
save(`${id}:${k + 1} a ${offset > 0 ? "+" : ""}${offset.toFixed(3)}s do lugar`);
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
case "delete": {
|
|
393
|
+
const { id, k } = idAndK(positionals[0]);
|
|
394
|
+
const a = target(id);
|
|
395
|
+
if (!a.clips[k]) fail(`${id} não tem o clip ${k + 1}`);
|
|
396
|
+
newClips(
|
|
397
|
+
a,
|
|
398
|
+
a.clips.filter((_, i) => i !== k),
|
|
399
|
+
);
|
|
400
|
+
save(
|
|
401
|
+
`${id}:${k + 1} apagado (${a.clips[k].from.toFixed(2)}–${a.clips[k].to.toFixed(2)}s do ${a.kind === "video" ? "MP4" : "áudio"})`,
|
|
402
|
+
);
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
case "restore": {
|
|
406
|
+
const q = positionals[0];
|
|
407
|
+
const ids = q === "all" ? video.scenes.flatMap(c => [c.id, ...(c.lines ?? []).map(l => l.id)]) : [q];
|
|
408
|
+
for (const id of ids) {
|
|
409
|
+
const a = target(id);
|
|
410
|
+
newClips(a, [{ from: 0, to: a.kind === "video" ? a.scene.duration : lineDuration(a.line), offset: 0 }]);
|
|
411
|
+
}
|
|
412
|
+
save(`${q === "all" ? "todas as cenas e falas" : q} de volta inteiras, no lugar`);
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
default:
|
|
416
|
+
fail(
|
|
417
|
+
`comando desconhecido: ${cmd} (show, silences, cut, cut-silences, uncut, speed, split, move, delete, restore)`,
|
|
418
|
+
);
|
|
419
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
Effect capture on Epidemic Sound, to paste into Claude in Chrome's
|
|
3
|
+
javascript_tool with an effects search open
|
|
4
|
+
(https://www.epidemicsound.com/sound-effects/search/?term=<term>).
|
|
5
|
+
|
|
6
|
+
`node tools/sound.mjs capture [n]` prints this code with N replaced.
|
|
7
|
+
|
|
8
|
+
The player plays each preview through an <audio> that is not in the page:
|
|
9
|
+
neither the extension's Network tab nor performance.getEntries() show the
|
|
10
|
+
MP3. What works is intercepting the media element's `src`: each play writes
|
|
11
|
+
the URL https://audiocdn.epidemicsound.com/lqmp3/<id>.mp3 there, which
|
|
12
|
+
`sound.mjs download` takes to the video's folder.
|
|
13
|
+
|
|
14
|
+
Take a screenshot of the tab first: the list only mounts with the tab painted,
|
|
15
|
+
and running in a background tab hangs javascript_tool. Waits for the list (up to 10 s), plays the first N results one by one, pauses
|
|
16
|
+
at the end and returns [{ title, duration, url }]. A result without url: the play
|
|
17
|
+
did not respond within 3 s. Empty list: the page did not load or changed layout
|
|
18
|
+
(each result is a [data-testid=track-row] with a "Play <title>" button).
|
|
19
|
+
============================================================================ */
|
|
20
|
+
const N = __N__;
|
|
21
|
+
if (!window.__sfxHook) {
|
|
22
|
+
const d = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "src");
|
|
23
|
+
Object.defineProperty(HTMLMediaElement.prototype, "src", {
|
|
24
|
+
configurable: true,
|
|
25
|
+
get() {
|
|
26
|
+
return d.get.call(this);
|
|
27
|
+
},
|
|
28
|
+
set(v) {
|
|
29
|
+
if (/audiocdn\.epidemicsound\.com\/lqmp3\//.test(v)) window.__sfxLast = String(v);
|
|
30
|
+
d.set.call(this, v);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
window.__sfxHook = true;
|
|
34
|
+
}
|
|
35
|
+
const wait = ms => new Promise(r => setTimeout(r, ms));
|
|
36
|
+
/* the list arrives a few seconds after the page */
|
|
37
|
+
for (let i = 0; i < 100 && !document.querySelector('[data-testid="track-row"] button[aria-label^="Play "]'); i++)
|
|
38
|
+
await wait(100);
|
|
39
|
+
/* whatever is playing is labeled "Pause …": pause it before starting */
|
|
40
|
+
document.querySelector('[data-testid="track-row"] button[aria-label^="Pause "]')?.click();
|
|
41
|
+
await wait(200);
|
|
42
|
+
const found = [];
|
|
43
|
+
for (const row of [...document.querySelectorAll('[data-testid="track-row"]')].slice(0, N)) {
|
|
44
|
+
const b = row.querySelector('button[aria-label^="Play "]');
|
|
45
|
+
if (!b) continue;
|
|
46
|
+
/* the label becomes "Pause …" after play: read it before clicking */
|
|
47
|
+
const title = b.getAttribute("aria-label").replace(/^Play /, "");
|
|
48
|
+
window.__sfxLast = null;
|
|
49
|
+
b.click();
|
|
50
|
+
for (let i = 0; i < 30 && !window.__sfxLast; i++) await wait(100);
|
|
51
|
+
found.push({ title, duration: row.innerText.match(/\b\d+:\d{2}\b/)?.[0] ?? null, url: window.__sfxLast });
|
|
52
|
+
}
|
|
53
|
+
document.querySelector('[data-testid="track-row"] button[aria-label^="Pause "]')?.click();
|
|
54
|
+
found;
|
package/tools/fanout.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
The fan-out guard from the command line (tools/lib/fanout.mjs explains why).
|
|
4
|
+
|
|
5
|
+
node tools/fanout.mjs claim videos/<slug> <kind> cNN [--run R]
|
|
6
|
+
a fork takes its scene before writing anything. Exit 3 = refused: the
|
|
7
|
+
scene is someone else's (another run, or already started): stop.
|
|
8
|
+
Without --run (a scene call made alone), prints the run it created.
|
|
9
|
+
node tools/fanout.mjs done videos/<slug> <kind> cNN --run R
|
|
10
|
+
node tools/fanout.mjs release videos/<slug> <kind> cNN[,cMM]
|
|
11
|
+
frees scenes whose fork died, so `plan` hands them out again
|
|
12
|
+
node tools/fanout.mjs status videos/<slug> [<kind>]
|
|
13
|
+
|
|
14
|
+
kind: compose (stage 3), wireframe (stage 2), narration (stage 4). The plans
|
|
15
|
+
are `compose.mjs plan`, `wireframe.mjs plan` and `narrate.mjs plan`.
|
|
16
|
+
============================================================================ */
|
|
17
|
+
|
|
18
|
+
import { existsSync } from "node:fs";
|
|
19
|
+
import { join, resolve } from "node:path";
|
|
20
|
+
import { KINDS, FanoutError, claim, done, release, busy } from "./lib/fanout.mjs";
|
|
21
|
+
|
|
22
|
+
const [cmd, target, kind, ids, ...rest] = process.argv.slice(2);
|
|
23
|
+
const opt = n => {
|
|
24
|
+
const i = rest.indexOf(`--${n}`);
|
|
25
|
+
return i < 0 ? null : rest[i + 1];
|
|
26
|
+
};
|
|
27
|
+
const usage = () => {
|
|
28
|
+
console.error(
|
|
29
|
+
"uso: node tools/fanout.mjs claim videos/<slug> <tipo> cNN [--run R]\n" +
|
|
30
|
+
" node tools/fanout.mjs done videos/<slug> <tipo> cNN --run R\n" +
|
|
31
|
+
" node tools/fanout.mjs release videos/<slug> <tipo> cNN[,cMM]\n" +
|
|
32
|
+
` node tools/fanout.mjs status videos/<slug> [<tipo>] (tipos: ${KINDS.join(", ")})`,
|
|
33
|
+
);
|
|
34
|
+
process.exit(2);
|
|
35
|
+
};
|
|
36
|
+
if (!cmd || !target) usage();
|
|
37
|
+
const dir = resolve(target);
|
|
38
|
+
if (!existsSync(join(dir, "scenes.json"))) {
|
|
39
|
+
console.error(`erro: falta ${join(dir, "scenes.json")}`);
|
|
40
|
+
process.exit(2);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
if (cmd === "claim") {
|
|
45
|
+
if (!kind || !ids) usage();
|
|
46
|
+
const run = await claim(dir, kind, ids, opt("run"));
|
|
47
|
+
console.log(
|
|
48
|
+
`${ids}: sua (rodada ${run})${opt("run") ? "" : `. No fim: fanout.mjs done ${target} ${kind} ${ids} --run ${run}`}`,
|
|
49
|
+
);
|
|
50
|
+
} else if (cmd === "done") {
|
|
51
|
+
if (!kind || !ids || !opt("run")) usage();
|
|
52
|
+
await done(dir, kind, ids, opt("run"));
|
|
53
|
+
console.log(`${ids}: concluída (rodada ${opt("run")})`);
|
|
54
|
+
} else if (cmd === "release") {
|
|
55
|
+
if (!kind || !ids) usage();
|
|
56
|
+
const freed = await release(dir, kind, ids.split(",").filter(Boolean));
|
|
57
|
+
console.log(freed.length ? `liberadas: ${freed.join(" ")}` : "nada a liberar");
|
|
58
|
+
} else if (cmd === "status") {
|
|
59
|
+
for (const k of kind ? [kind] : KINDS) {
|
|
60
|
+
const held = busy(dir, k);
|
|
61
|
+
console.log(
|
|
62
|
+
`${k}: ${held.length ? held.map(b => `${b.id} ${b.state === "started" ? "rodando" : "na fila"} (rodada ${b.run}, ${b.age_min} min)`).join(", ") : "nada em andamento"}`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
} else usage();
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error(`erro: ${e.message}`);
|
|
68
|
+
process.exit(e instanceof FanoutError ? e.code : 1);
|
|
69
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
Previous versions of results. Before a tool overwrites a result (a
|
|
3
|
+
scene's still and sheet, render, sound, assembly), the version that was
|
|
4
|
+
there is copied, with its original mtime, to
|
|
5
|
+
|
|
6
|
+
videos/<slug>/history/<stage>/[<key>/]<file stamp>/
|
|
7
|
+
|
|
8
|
+
If the new result comes out identical, the copy is discarded: only what
|
|
9
|
+
changed is kept. The `history.versions` most recent of each result are kept
|
|
10
|
+
(config, default 5). The studio shows the versions in each stage's drawer and
|
|
11
|
+
links each one to the queue run that produced it by the file's time.
|
|
12
|
+
|
|
13
|
+
const previous = keepPrevious(dir, "render", "c04", ["motion/c04.mp4", "motion/c04.render.json"]);
|
|
14
|
+
...write the new result...
|
|
15
|
+
previous.close();
|
|
16
|
+
|
|
17
|
+
The Python counterpart is tools/history.py (voice and captions).
|
|
18
|
+
============================================================================ */
|
|
19
|
+
|
|
20
|
+
import { existsSync, mkdirSync, copyFileSync, statSync, utimesSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { join, basename } from "node:path";
|
|
23
|
+
import { DATA_ROOT as ROOT } from "./lib/paths.mjs";
|
|
24
|
+
|
|
25
|
+
const CFG = JSON.parse(readFileSync(join(ROOT, "omnivideo.config.json"), "utf8"));
|
|
26
|
+
const VERSIONS = CFG.history?.versions ?? 5;
|
|
27
|
+
|
|
28
|
+
const digest = file => createHash("sha1").update(readFileSync(file)).digest("hex");
|
|
29
|
+
|
|
30
|
+
export function keepPrevious(dir, stage, key, files) {
|
|
31
|
+
const existing = files.filter(f => existsSync(join(dir, f)));
|
|
32
|
+
if (!existing.length) return { close() {} };
|
|
33
|
+
const base = join(dir, "history", stage, ...(key ? [key] : []));
|
|
34
|
+
const mtime = Math.max(...existing.map(f => statSync(join(dir, f)).mtimeMs));
|
|
35
|
+
const snapDir = join(base, new Date(mtime).toISOString().replace(/[:.]/g, "-"));
|
|
36
|
+
const before = Object.fromEntries(existing.map(f => [f, digest(join(dir, f))]));
|
|
37
|
+
/* already kept (a previous run died before closing): leave it as is */
|
|
38
|
+
const isNew = !existsSync(snapDir);
|
|
39
|
+
if (isNew) {
|
|
40
|
+
mkdirSync(snapDir, { recursive: true });
|
|
41
|
+
for (const f of existing) {
|
|
42
|
+
const dest = join(snapDir, basename(f));
|
|
43
|
+
copyFileSync(join(dir, f), dest);
|
|
44
|
+
const st = statSync(join(dir, f));
|
|
45
|
+
utimesSync(dest, st.atime, st.mtime);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
/* keep: the copy is the starting point of a change; stays even if the original didn't change */
|
|
50
|
+
close({ keep = false } = {}) {
|
|
51
|
+
const same = existing.every(f => existsSync(join(dir, f)) && digest(join(dir, f)) === before[f]);
|
|
52
|
+
if (same && isNew && !keep) rmSync(snapDir, { recursive: true, force: true });
|
|
53
|
+
prune(base);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* the stamp is ISO: alphabetical order is time order */
|
|
59
|
+
function prune(base) {
|
|
60
|
+
let versions;
|
|
61
|
+
try {
|
|
62
|
+
versions = readdirSync(base)
|
|
63
|
+
.filter(n => /^\d{4}-/.test(n))
|
|
64
|
+
.sort();
|
|
65
|
+
} catch {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
for (const v of versions.slice(0, Math.max(0, versions.length - VERSIONS)))
|
|
69
|
+
rmSync(join(base, v), { recursive: true, force: true });
|
|
70
|
+
}
|
package/tools/history.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Previous versions of results: the Python twin of tools/history.mjs (voice and captions).
|
|
2
|
+
|
|
3
|
+
with keep_previous(dir, "voice", "c01f1", ["voice/c01f1.wav", "voice/c01f1.json"]):
|
|
4
|
+
...write the new result...
|
|
5
|
+
|
|
6
|
+
The version that was there goes, with its original mtime, to
|
|
7
|
+
history/<stage>/[<key>/]<stamp>/. If the new result comes out identical (or the
|
|
8
|
+
tool fails before writing), the copy is discarded. The most recent
|
|
9
|
+
`history.versions` are kept (config, default 5).
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import hashlib
|
|
13
|
+
import json
|
|
14
|
+
import shutil
|
|
15
|
+
from contextlib import contextmanager
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from omni_paths import DATA_ROOT as ROOT
|
|
20
|
+
|
|
21
|
+
VERSIONS = json.loads((ROOT / "omnivideo.config.json").read_text()).get("history", {}).get("versions", 5)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def digest(path):
|
|
25
|
+
return hashlib.sha1(path.read_bytes()).hexdigest()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def prune(base):
|
|
29
|
+
"""The stamp is ISO: alphabetical order is time order."""
|
|
30
|
+
if not base.is_dir():
|
|
31
|
+
return
|
|
32
|
+
versions = sorted(p for p in base.iterdir() if p.name[:4].isdigit())
|
|
33
|
+
for old in versions[: max(0, len(versions) - VERSIONS)]:
|
|
34
|
+
shutil.rmtree(old, ignore_errors=True)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@contextmanager
|
|
38
|
+
def keep_previous(dir, stage, key, files):
|
|
39
|
+
dir = Path(dir)
|
|
40
|
+
existing = [f for f in files if (dir / f).exists()]
|
|
41
|
+
if not existing:
|
|
42
|
+
yield
|
|
43
|
+
return
|
|
44
|
+
base = dir / "history" / stage / (key or "")
|
|
45
|
+
mtime = max((dir / f).stat().st_mtime for f in existing)
|
|
46
|
+
stamp = datetime.fromtimestamp(mtime, timezone.utc).isoformat(timespec="milliseconds")
|
|
47
|
+
snapshot = base / stamp.replace("+00:00", "Z").replace(":", "-").replace(".", "-")
|
|
48
|
+
before = {f: digest(dir / f) for f in existing}
|
|
49
|
+
# already kept (a previous run died before closing): leave it as is
|
|
50
|
+
new = not snapshot.exists()
|
|
51
|
+
if new:
|
|
52
|
+
snapshot.mkdir(parents=True)
|
|
53
|
+
for f in existing:
|
|
54
|
+
shutil.copy2(dir / f, snapshot / Path(f).name)
|
|
55
|
+
try:
|
|
56
|
+
yield
|
|
57
|
+
finally:
|
|
58
|
+
same = all((dir / f).exists() and digest(dir / f) == before[f] for f in existing)
|
|
59
|
+
if same and new:
|
|
60
|
+
shutil.rmtree(snapshot, ignore_errors=True)
|
|
61
|
+
prune(base)
|