@crievo/omni 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (708) hide show
  1. package/.env.example +41 -0
  2. package/README.md +2 -2
  3. package/bin/omni.mjs +18 -0
  4. package/docs/onboarding/clone-voice.png +0 -0
  5. package/docs/onboarding/getting-started.png +0 -0
  6. package/docs/onboarding/new-video.png +0 -0
  7. package/docs/onboarding/providers.png +0 -0
  8. package/docs/onboarding/publish.png +0 -0
  9. package/docs/onboarding/references.png +0 -0
  10. package/docs/onboarding.md +212 -0
  11. package/omnivideo.config.example.json +437 -0
  12. package/package.json +40 -4
  13. package/reference/captions.md +156 -0
  14. package/reference/carousel-contract.md +91 -0
  15. package/reference/cloud.md +96 -0
  16. package/reference/learnings.md +792 -0
  17. package/reference/omnichat.md +305 -0
  18. package/reference/premiere-mcp.md +91 -0
  19. package/reference/publish.md +305 -0
  20. package/reference/scenes-contract.md +109 -0
  21. package/reference/studio.md +666 -0
  22. package/reference/voicestudio.md +81 -0
  23. package/reference/writing-for-voice.md +67 -0
  24. package/requirements.txt +3 -0
  25. package/studio/api/app.ts +87 -0
  26. package/studio/api/lib/errors.ts +33 -0
  27. package/studio/api/lib/files.ts +41 -0
  28. package/studio/api/lib/hono.ts +9 -0
  29. package/studio/api/lib/result.ts +14 -0
  30. package/studio/api/lib/validate.ts +31 -0
  31. package/studio/api/lib/video.ts +10 -0
  32. package/studio/api/middleware/json-charset.ts +11 -0
  33. package/studio/api/middleware/local-only.ts +32 -0
  34. package/studio/api/middleware/no-timeout.ts +10 -0
  35. package/studio/api/routes/admin.ts +18 -0
  36. package/studio/api/routes/agent-cascade.ts +100 -0
  37. package/studio/api/routes/agent-history.ts +23 -0
  38. package/studio/api/routes/agent.ts +162 -0
  39. package/studio/api/routes/analytics.ts +31 -0
  40. package/studio/api/routes/approval.ts +60 -0
  41. package/studio/api/routes/archive.ts +12 -0
  42. package/studio/api/routes/captions.ts +28 -0
  43. package/studio/api/routes/carousel.ts +38 -0
  44. package/studio/api/routes/clone.ts +27 -0
  45. package/studio/api/routes/create.ts +19 -0
  46. package/studio/api/routes/events.ts +11 -0
  47. package/studio/api/routes/export.ts +14 -0
  48. package/studio/api/routes/media.ts +30 -0
  49. package/studio/api/routes/omnichat.ts +113 -0
  50. package/studio/api/routes/onboarding.ts +14 -0
  51. package/studio/api/routes/publish.ts +40 -0
  52. package/studio/api/routes/queue.ts +14 -0
  53. package/studio/api/routes/references.ts +40 -0
  54. package/studio/api/routes/runner.ts +17 -0
  55. package/studio/api/routes/schedule.ts +47 -0
  56. package/studio/api/routes/services.ts +11 -0
  57. package/studio/api/routes/sessions.ts +27 -0
  58. package/studio/api/routes/settings.ts +102 -0
  59. package/studio/api/routes/sound.ts +45 -0
  60. package/studio/api/routes/thumbnail.ts +18 -0
  61. package/studio/api/routes/usage.ts +13 -0
  62. package/studio/api/routes/videos.ts +41 -0
  63. package/studio/api/routes/voices.ts +71 -0
  64. package/studio/api/services/admin.ts +113 -0
  65. package/studio/api/services/agent-cascade.ts +975 -0
  66. package/studio/api/services/agent-claude.ts +47 -0
  67. package/studio/api/services/agent-history.ts +103 -0
  68. package/studio/api/services/agent-persona.ts +77 -0
  69. package/studio/api/services/agent-tools.ts +2237 -0
  70. package/studio/api/services/agent-ui-tools.ts +259 -0
  71. package/studio/api/services/agent-wait.ts +32 -0
  72. package/studio/api/services/agent.ts +553 -0
  73. package/studio/api/services/analytics.ts +92 -0
  74. package/studio/api/services/approval.ts +134 -0
  75. package/studio/api/services/archive.ts +38 -0
  76. package/studio/api/services/captions.ts +268 -0
  77. package/studio/api/services/carousel.ts +206 -0
  78. package/studio/api/services/classify.ts +196 -0
  79. package/studio/api/services/clone-phrases.ts +75 -0
  80. package/studio/api/services/clone.ts +722 -0
  81. package/studio/api/services/create.ts +421 -0
  82. package/studio/api/services/events.ts +215 -0
  83. package/studio/api/services/media.ts +32 -0
  84. package/studio/api/services/omnichat.ts +624 -0
  85. package/studio/api/services/onboarding.ts +77 -0
  86. package/studio/api/services/publish.ts +287 -0
  87. package/studio/api/services/queue.ts +150 -0
  88. package/studio/api/services/references.ts +269 -0
  89. package/studio/api/services/root.ts +60 -0
  90. package/studio/api/services/services.ts +114 -0
  91. package/studio/api/services/sessions.ts +1007 -0
  92. package/studio/api/services/settings.ts +983 -0
  93. package/studio/api/services/sound.ts +311 -0
  94. package/studio/api/services/thumbnail.ts +133 -0
  95. package/studio/api/services/usage.ts +27 -0
  96. package/studio/api/services/videos.ts +418 -0
  97. package/studio/api/services/voice-pause.ts +98 -0
  98. package/studio/api/services/voices.ts +324 -0
  99. package/studio/runner/runner.ts +244 -0
  100. package/studio/shared/omni-actions.ts +68 -0
  101. package/studio/shared/omni-admin.ts +52 -0
  102. package/studio/shared/omni-farewell.ts +48 -0
  103. package/studio/shared/omni-hotword.ts +20 -0
  104. package/studio/shared/omni-screens.ts +228 -0
  105. package/studio/shared/schemas/admin.ts +15 -0
  106. package/studio/shared/schemas/agent-cascade.ts +58 -0
  107. package/studio/shared/schemas/agent-history.ts +73 -0
  108. package/studio/shared/schemas/agent.ts +50 -0
  109. package/studio/shared/schemas/analytics.ts +6 -0
  110. package/studio/shared/schemas/approval.ts +22 -0
  111. package/studio/shared/schemas/captions.ts +19 -0
  112. package/studio/shared/schemas/carousel.ts +26 -0
  113. package/studio/shared/schemas/clone.ts +40 -0
  114. package/studio/shared/schemas/common.ts +16 -0
  115. package/studio/shared/schemas/omnichat.ts +54 -0
  116. package/studio/shared/schemas/onboarding.ts +5 -0
  117. package/studio/shared/schemas/publish.ts +45 -0
  118. package/studio/shared/schemas/references.ts +20 -0
  119. package/studio/shared/schemas/settings.ts +82 -0
  120. package/studio/shared/schemas/sound.ts +22 -0
  121. package/studio/shared/schemas/videos.ts +38 -0
  122. package/studio/shared/schemas/voices.ts +23 -0
  123. package/studio/shared/types/api.ts +1290 -0
  124. package/studio/studio.ts +148 -0
  125. package/studio/tsconfig.json +15 -0
  126. package/studio/web/assets/logos/cartesia.svg +4 -0
  127. package/studio/web/assets/logos/elevenlabs.svg +12 -0
  128. package/studio/web/assets/logos/fish.svg +24 -0
  129. package/studio/web/assets/logos/omni-black.png +0 -0
  130. package/studio/web/assets/logos/omni-white.png +0 -0
  131. package/studio/web/assets/logos/voicestudio.svg +21 -0
  132. package/studio/web/components/AgentMark.tsx +7 -0
  133. package/studio/web/components/AgentWalking.tsx +11 -0
  134. package/studio/web/components/ApiKeyField.tsx +104 -0
  135. package/studio/web/components/AppShell.tsx +64 -0
  136. package/studio/web/components/ApprovalNotice.tsx +65 -0
  137. package/studio/web/components/AvatarGroupIcon.tsx +22 -0
  138. package/studio/web/components/AvatarNameField.tsx +86 -0
  139. package/studio/web/components/AvatarPicker.tsx +84 -0
  140. package/studio/web/components/BrandLogo.tsx +16 -0
  141. package/studio/web/components/CartesiaPlanSetting.tsx +90 -0
  142. package/studio/web/components/ClaudeWalking.tsx +32 -0
  143. package/studio/web/components/CloneVoiceDialog/GuidedScript.tsx +39 -0
  144. package/studio/web/components/CloneVoiceDialog/LanguageBar.tsx +37 -0
  145. package/studio/web/components/CloneVoiceDialog/LevelMeter.tsx +31 -0
  146. package/studio/web/components/CloneVoiceDialog/ProviderChoice.tsx +81 -0
  147. package/studio/web/components/CloneVoiceDialog/QualityPanel.tsx +62 -0
  148. package/studio/web/components/CloneVoiceDialog/RecordStep.tsx +50 -0
  149. package/studio/web/components/CloneVoiceDialog/RecorderBar.tsx +79 -0
  150. package/studio/web/components/CloneVoiceDialog/RedoSummary.tsx +54 -0
  151. package/studio/web/components/CloneVoiceDialog/SaveStep.tsx +91 -0
  152. package/studio/web/components/CloneVoiceDialog/SourceBar.tsx +30 -0
  153. package/studio/web/components/CloneVoiceDialog/index.tsx +141 -0
  154. package/studio/web/components/CloneVoiceDialog/types.ts +28 -0
  155. package/studio/web/components/CloneVoiceDialog/useCloneVoice.ts +528 -0
  156. package/studio/web/components/ConnectionSignals.tsx +51 -0
  157. package/studio/web/components/EditVoiceDialog/EditVoiceFooter.tsx +72 -0
  158. package/studio/web/components/EditVoiceDialog/ProviderCards.tsx +81 -0
  159. package/studio/web/components/EditVoiceDialog/index.tsx +256 -0
  160. package/studio/web/components/ErrorBanner.tsx +115 -0
  161. package/studio/web/components/FinishedTask.tsx +41 -0
  162. package/studio/web/components/FishModelSetting.tsx +69 -0
  163. package/studio/web/components/FishPriceSetting.tsx +44 -0
  164. package/studio/web/components/HumanBanner.tsx +64 -0
  165. package/studio/web/components/Lightbox.tsx +41 -0
  166. package/studio/web/components/LogStream.tsx +42 -0
  167. package/studio/web/components/Markdown.tsx +21 -0
  168. package/studio/web/components/MissingDmsPanel/BatchSend.tsx +137 -0
  169. package/studio/web/components/MissingDmsPanel/CommentCard.tsx +168 -0
  170. package/studio/web/components/MissingDmsPanel/CommentFeed.tsx +45 -0
  171. package/studio/web/components/MissingDmsPanel/DmBubble.tsx +38 -0
  172. package/studio/web/components/MissingDmsPanel/ReplyComposer.tsx +63 -0
  173. package/studio/web/components/MissingDmsPanel/index.tsx +98 -0
  174. package/studio/web/components/NotFound.tsx +48 -0
  175. package/studio/web/components/Omni/OmniAvatarPicker.tsx +92 -0
  176. package/studio/web/components/Omni/OmniCards.tsx +202 -0
  177. package/studio/web/components/Omni/OmniGlow.tsx +183 -0
  178. package/studio/web/components/Omni/OmniHistory.tsx +119 -0
  179. package/studio/web/components/Omni/OmniHotword.tsx +40 -0
  180. package/studio/web/components/Omni/OmniMicSelect.tsx +92 -0
  181. package/studio/web/components/Omni/OmniVoiceSample.tsx +81 -0
  182. package/studio/web/components/Omni/OmniWidget.tsx +743 -0
  183. package/studio/web/components/Omni/PendingActions.tsx +200 -0
  184. package/studio/web/components/Omni/Transcript.tsx +127 -0
  185. package/studio/web/components/OmnichatAccountStatus.tsx +87 -0
  186. package/studio/web/components/OmnichatRulePanel/RuleConfig.tsx +150 -0
  187. package/studio/web/components/OmnichatRulePanel/RuleDryRun.tsx +15 -0
  188. package/studio/web/components/OmnichatRulePanel/RuleEnableConfirm.tsx +42 -0
  189. package/studio/web/components/OmnichatRulePanel/RuleSkeleton.tsx +18 -0
  190. package/studio/web/components/OmnichatRulePanel/RuleStatus.tsx +55 -0
  191. package/studio/web/components/OmnichatRulePanel/index.tsx +115 -0
  192. package/studio/web/components/OmnichatRulePanel/rule-steps.ts +67 -0
  193. package/studio/web/components/OmnichatRulePanel/steps/MessageStep.tsx +91 -0
  194. package/studio/web/components/OmnichatRulePanel/steps/RepliesStep.tsx +201 -0
  195. package/studio/web/components/OmnichatRulePanel/steps/TriggerStep.tsx +76 -0
  196. package/studio/web/components/OmnichatRulePanel/steps/types.ts +11 -0
  197. package/studio/web/components/Palette.tsx +17 -0
  198. package/studio/web/components/PlatformCard.tsx +109 -0
  199. package/studio/web/components/PlatformIcon.tsx +19 -0
  200. package/studio/web/components/ProviderCard.tsx +80 -0
  201. package/studio/web/components/ProviderDetail.tsx +367 -0
  202. package/studio/web/components/ProviderLogo.tsx +20 -0
  203. package/studio/web/components/QueuePanel.tsx +77 -0
  204. package/studio/web/components/ReferenceActions.tsx +89 -0
  205. package/studio/web/components/ReferencePicker.tsx +136 -0
  206. package/studio/web/components/ResultMessage.tsx +7 -0
  207. package/studio/web/components/RuleForm.tsx +138 -0
  208. package/studio/web/components/RuleLog.tsx +151 -0
  209. package/studio/web/components/RunningTask.tsx +23 -0
  210. package/studio/web/components/SampleList.tsx +55 -0
  211. package/studio/web/components/SessionPanel.tsx +352 -0
  212. package/studio/web/components/SettingRow.tsx +14 -0
  213. package/studio/web/components/SettingsCategorySkeleton.tsx +25 -0
  214. package/studio/web/components/SidePanel.tsx +77 -0
  215. package/studio/web/components/Sidebar.tsx +289 -0
  216. package/studio/web/components/StageStepper.tsx +87 -0
  217. package/studio/web/components/StudioOffline.tsx +80 -0
  218. package/studio/web/components/TaskName.tsx +17 -0
  219. package/studio/web/components/TopBanners.tsx +30 -0
  220. package/studio/web/components/VideoOmnichatPanel.tsx +287 -0
  221. package/studio/web/components/VoiceAvatar.tsx +33 -0
  222. package/studio/web/components/VoiceCarousel.tsx +196 -0
  223. package/studio/web/components/VoiceCategory.tsx +9 -0
  224. package/studio/web/components/VoiceModal.tsx +39 -0
  225. package/studio/web/components/VoiceProfileCard.tsx +75 -0
  226. package/studio/web/components/VoiceProfilePicker.tsx +107 -0
  227. package/studio/web/components/VoiceProfilesSettings.tsx +150 -0
  228. package/studio/web/components/VoiceProviderCard.tsx +118 -0
  229. package/studio/web/components/VoiceProvidersCard.tsx +26 -0
  230. package/studio/web/components/WaitList.tsx +21 -0
  231. package/studio/web/components/icons.tsx +247 -0
  232. package/studio/web/components/ui/accordion.tsx +47 -0
  233. package/studio/web/components/ui/badge.tsx +18 -0
  234. package/studio/web/components/ui/calendar.tsx +43 -0
  235. package/studio/web/components/ui/chart.tsx +229 -0
  236. package/studio/web/components/ui/checkbox.tsx +26 -0
  237. package/studio/web/components/ui/cx.ts +2 -0
  238. package/studio/web/components/ui/date-time-picker.tsx +84 -0
  239. package/studio/web/components/ui/panel.tsx +23 -0
  240. package/studio/web/components/ui/picker.tsx +58 -0
  241. package/studio/web/components/ui/popover.tsx +24 -0
  242. package/studio/web/components/ui/select.tsx +89 -0
  243. package/studio/web/components/ui/skeleton.tsx +10 -0
  244. package/studio/web/components/ui/slider.tsx +68 -0
  245. package/studio/web/components/ui/switch.tsx +13 -0
  246. package/studio/web/components/ui/tooltip.tsx +59 -0
  247. package/studio/web/hooks/useAccounts.ts +27 -0
  248. package/studio/web/hooks/useAdmin.ts +12 -0
  249. package/studio/web/hooks/useAnalytics.ts +21 -0
  250. package/studio/web/hooks/useAvatarAudioReactive.ts +87 -0
  251. package/studio/web/hooks/useBrowserConnect.ts +48 -0
  252. package/studio/web/hooks/useClonePlan.ts +14 -0
  253. package/studio/web/hooks/useConnected.ts +7 -0
  254. package/studio/web/hooks/useLiveQuery.ts +29 -0
  255. package/studio/web/hooks/useMenuCollapsed.ts +32 -0
  256. package/studio/web/hooks/useMicDevices.ts +53 -0
  257. package/studio/web/hooks/useMissingDms.ts +211 -0
  258. package/studio/web/hooks/useMissingSetupSteps.ts +26 -0
  259. package/studio/web/hooks/useNow.ts +11 -0
  260. package/studio/web/hooks/useOmniAgent.ts +278 -0
  261. package/studio/web/hooks/useOmniClaude.ts +124 -0
  262. package/studio/web/hooks/useOmniDock.ts +142 -0
  263. package/studio/web/hooks/useOmniGreeting.ts +60 -0
  264. package/studio/web/hooks/useOmniHotword.ts +128 -0
  265. package/studio/web/hooks/useOmnichat.ts +26 -0
  266. package/studio/web/hooks/useOnboarding.ts +27 -0
  267. package/studio/web/hooks/usePost.ts +23 -0
  268. package/studio/web/hooks/useQueue.ts +10 -0
  269. package/studio/web/hooks/useReferences.ts +20 -0
  270. package/studio/web/hooks/useRuleEditor.ts +101 -0
  271. package/studio/web/hooks/useRunner.ts +24 -0
  272. package/studio/web/hooks/useSaveAction.ts +23 -0
  273. package/studio/web/hooks/useSchedule.ts +11 -0
  274. package/studio/web/hooks/useServices.ts +10 -0
  275. package/studio/web/hooks/useSessions.ts +15 -0
  276. package/studio/web/hooks/useSettings.ts +11 -0
  277. package/studio/web/hooks/useSettingsSection.ts +30 -0
  278. package/studio/web/hooks/useSidePanel.ts +23 -0
  279. package/studio/web/hooks/useSound.ts +30 -0
  280. package/studio/web/hooks/useUsage.ts +11 -0
  281. package/studio/web/hooks/useVideoVoice.ts +36 -0
  282. package/studio/web/hooks/useVideos.ts +21 -0
  283. package/studio/web/hooks/useVoiceProfilePreview.ts +52 -0
  284. package/studio/web/hooks/useVoiceProfiles.ts +7 -0
  285. package/studio/web/hooks/useVoiceRunning.ts +10 -0
  286. package/studio/web/hooks/useVoiceStudioClosed.ts +8 -0
  287. package/studio/web/index.html +19 -0
  288. package/studio/web/lib/agent.ts +7 -0
  289. package/studio/web/lib/alerts.ts +210 -0
  290. package/studio/web/lib/analytics-metrics.ts +351 -0
  291. package/studio/web/lib/api.ts +70 -0
  292. package/studio/web/lib/audio.ts +39 -0
  293. package/studio/web/lib/avatars.ts +41 -0
  294. package/studio/web/lib/calendar.ts +218 -0
  295. package/studio/web/lib/caption-position.ts +249 -0
  296. package/studio/web/lib/carousel.ts +24 -0
  297. package/studio/web/lib/chime.ts +42 -0
  298. package/studio/web/lib/clone-voice.ts +55 -0
  299. package/studio/web/lib/export.ts +11 -0
  300. package/studio/web/lib/files.ts +8 -0
  301. package/studio/web/lib/format.ts +93 -0
  302. package/studio/web/lib/media.ts +29 -0
  303. package/studio/web/lib/mic-device.ts +72 -0
  304. package/studio/web/lib/missing-dms.ts +70 -0
  305. package/studio/web/lib/omni-cards.ts +42 -0
  306. package/studio/web/lib/omni-cascade.ts +1067 -0
  307. package/studio/web/lib/omni-greeting-audio.ts +24 -0
  308. package/studio/web/lib/omni-hotword.ts +231 -0
  309. package/studio/web/lib/omni-panel.ts +67 -0
  310. package/studio/web/lib/omni-realtime.ts +811 -0
  311. package/studio/web/lib/omni-ui.ts +402 -0
  312. package/studio/web/lib/omni-wait.ts +174 -0
  313. package/studio/web/lib/omnichat-api.ts +44 -0
  314. package/studio/web/lib/orb.ts +270 -0
  315. package/studio/web/lib/pcm-recorder.ts +115 -0
  316. package/studio/web/lib/platforms.ts +17 -0
  317. package/studio/web/lib/providers.ts +27 -0
  318. package/studio/web/lib/publish-draft.ts +52 -0
  319. package/studio/web/lib/publish-settings.ts +81 -0
  320. package/studio/web/lib/query-client.ts +122 -0
  321. package/studio/web/lib/references.ts +13 -0
  322. package/studio/web/lib/services.ts +40 -0
  323. package/studio/web/lib/sessions.ts +103 -0
  324. package/studio/web/lib/settings-categories.ts +58 -0
  325. package/studio/web/lib/sound-audio.ts +33 -0
  326. package/studio/web/lib/sound-timeline.ts +291 -0
  327. package/studio/web/lib/sse.ts +86 -0
  328. package/studio/web/lib/stage-history.ts +141 -0
  329. package/studio/web/lib/stages.ts +344 -0
  330. package/studio/web/lib/studio-offline.ts +60 -0
  331. package/studio/web/lib/upload.ts +24 -0
  332. package/studio/web/lib/video-tabs.ts +118 -0
  333. package/studio/web/lib/voice-profile-draft.ts +34 -0
  334. package/studio/web/lib/voice-profiles.ts +3 -0
  335. package/studio/web/main.tsx +14 -0
  336. package/studio/web/pages/AdminPage/index.tsx +123 -0
  337. package/studio/web/pages/AgentPage/components/Measurements.tsx +102 -0
  338. package/studio/web/pages/AgentPage/index.tsx +28 -0
  339. package/studio/web/pages/AnalyticsPage/components/About.tsx +52 -0
  340. package/studio/web/pages/AnalyticsPage/components/ChannelCards.tsx +106 -0
  341. package/studio/web/pages/AnalyticsPage/components/ChannelView.tsx +137 -0
  342. package/studio/web/pages/AnalyticsPage/components/CollectionStatus.tsx +46 -0
  343. package/studio/web/pages/AnalyticsPage/components/Comparison.tsx +68 -0
  344. package/studio/web/pages/AnalyticsPage/components/Diagnosis.tsx +50 -0
  345. package/studio/web/pages/AnalyticsPage/components/Highlights.tsx +49 -0
  346. package/studio/web/pages/AnalyticsPage/components/Hint.tsx +11 -0
  347. package/studio/web/pages/AnalyticsPage/components/HookVsBody.tsx +100 -0
  348. package/studio/web/pages/AnalyticsPage/components/HourlyWave.tsx +133 -0
  349. package/studio/web/pages/AnalyticsPage/components/Insights.tsx +70 -0
  350. package/studio/web/pages/AnalyticsPage/components/MetricCard.tsx +46 -0
  351. package/studio/web/pages/AnalyticsPage/components/PlanSection.tsx +40 -0
  352. package/studio/web/pages/AnalyticsPage/components/ProgressionChart.tsx +155 -0
  353. package/studio/web/pages/AnalyticsPage/components/ReelBarsChart.tsx +154 -0
  354. package/studio/web/pages/AnalyticsPage/components/ReelThumb.tsx +19 -0
  355. package/studio/web/pages/AnalyticsPage/components/ReelView.tsx +290 -0
  356. package/studio/web/pages/AnalyticsPage/components/ReelsTable.tsx +269 -0
  357. package/studio/web/pages/AnalyticsPage/components/RequestWithFocus.tsx +38 -0
  358. package/studio/web/pages/AnalyticsPage/components/SegmentedControl.tsx +35 -0
  359. package/studio/web/pages/AnalyticsPage/components/VsMedian.tsx +31 -0
  360. package/studio/web/pages/AnalyticsPage/index.tsx +17 -0
  361. package/studio/web/pages/GettingStartedPage/index.tsx +174 -0
  362. package/studio/web/pages/NewVideoPage/components/DeliverablesPicker.tsx +62 -0
  363. package/studio/web/pages/NewVideoPage/components/FormatPicker.tsx +33 -0
  364. package/studio/web/pages/NewVideoPage/index.tsx +133 -0
  365. package/studio/web/pages/NotFoundPage/index.tsx +9 -0
  366. package/studio/web/pages/OmnichatPage/components/NewFromLink.tsx +59 -0
  367. package/studio/web/pages/OmnichatPage/components/RuleListItem.tsx +64 -0
  368. package/studio/web/pages/OmnichatPage/components/RulePreview.tsx +14 -0
  369. package/studio/web/pages/OmnichatPage/components/RuleView.tsx +88 -0
  370. package/studio/web/pages/OmnichatPage/index.tsx +153 -0
  371. package/studio/web/pages/QueuePage/index.tsx +22 -0
  372. package/studio/web/pages/ReferencePage/components/ReferenceTexts.tsx +131 -0
  373. package/studio/web/pages/ReferencePage/index.tsx +216 -0
  374. package/studio/web/pages/ReferencesPage/components/NewReferenceForm.tsx +150 -0
  375. package/studio/web/pages/ReferencesPage/components/ReferenceCard.tsx +42 -0
  376. package/studio/web/pages/ReferencesPage/components/ReferenceGridSkeleton.tsx +31 -0
  377. package/studio/web/pages/ReferencesPage/index.tsx +67 -0
  378. package/studio/web/pages/SchedulePage/components/CalendarSkeleton.tsx +18 -0
  379. package/studio/web/pages/SchedulePage/components/DayView.tsx +177 -0
  380. package/studio/web/pages/SchedulePage/components/HourPicker.tsx +103 -0
  381. package/studio/web/pages/SchedulePage/components/MonthDayCell.tsx +111 -0
  382. package/studio/web/pages/SchedulePage/components/MonthView.tsx +47 -0
  383. package/studio/web/pages/SchedulePage/components/PlatformIcons.tsx +12 -0
  384. package/studio/web/pages/SchedulePage/components/PostThumb.tsx +15 -0
  385. package/studio/web/pages/SchedulePage/components/WeekColumn.tsx +75 -0
  386. package/studio/web/pages/SchedulePage/components/WeekView.tsx +35 -0
  387. package/studio/web/pages/SchedulePage/index.tsx +285 -0
  388. package/studio/web/pages/SettingsPage/components/AgentAccounts.tsx +263 -0
  389. package/studio/web/pages/SettingsPage/components/AgentCategory.tsx +20 -0
  390. package/studio/web/pages/SettingsPage/components/ModelPicker.tsx +49 -0
  391. package/studio/web/pages/SettingsPage/components/ModelsSettings.tsx +138 -0
  392. package/studio/web/pages/SettingsPage/components/PlatformsCategory.tsx +23 -0
  393. package/studio/web/pages/SettingsPage/components/PublishingCategory/AccountStatus.tsx +29 -0
  394. package/studio/web/pages/SettingsPage/components/PublishingCategory/AutoPublishPanel.tsx +90 -0
  395. package/studio/web/pages/SettingsPage/components/PublishingCategory/BrowserConnect.tsx +62 -0
  396. package/studio/web/pages/SettingsPage/components/PublishingCategory/CheckField.tsx +19 -0
  397. package/studio/web/pages/SettingsPage/components/PublishingCategory/InstagramPanel.tsx +113 -0
  398. package/studio/web/pages/SettingsPage/components/PublishingCategory/OmnichatSettingsPanel.tsx +146 -0
  399. package/studio/web/pages/SettingsPage/components/PublishingCategory/SaveBar.tsx +33 -0
  400. package/studio/web/pages/SettingsPage/components/PublishingCategory/SchedulePanel.tsx +132 -0
  401. package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCard.tsx +47 -0
  402. package/studio/web/pages/SettingsPage/components/PublishingCategory/SettingsCardGroup.tsx +19 -0
  403. package/studio/web/pages/SettingsPage/components/PublishingCategory/TextPanel.tsx +55 -0
  404. package/studio/web/pages/SettingsPage/components/PublishingCategory/TiktokPanel.tsx +123 -0
  405. package/studio/web/pages/SettingsPage/components/PublishingCategory/YoutubePanel.tsx +100 -0
  406. package/studio/web/pages/SettingsPage/components/PublishingCategory/badges.tsx +15 -0
  407. package/studio/web/pages/SettingsPage/components/PublishingCategory/index.tsx +40 -0
  408. package/studio/web/pages/SettingsPage/components/PublishingCategory/types.ts +10 -0
  409. package/studio/web/pages/SettingsPage/components/UsageCategory.tsx +389 -0
  410. package/studio/web/pages/SettingsPage/components/VoiceProvidersCategory.tsx +97 -0
  411. package/studio/web/pages/SettingsPage/index.tsx +85 -0
  412. package/studio/web/pages/VideoPage/components/AudioPlayer.tsx +113 -0
  413. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/AxisField.tsx +50 -0
  414. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionList.tsx +56 -0
  415. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionListItem.tsx +92 -0
  416. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionMargins.tsx +57 -0
  417. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionStyleFields.tsx +70 -0
  418. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/CaptionTextForm.tsx +87 -0
  419. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/ColorField.tsx +37 -0
  420. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/MarginField.tsx +59 -0
  421. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/NumberField.tsx +57 -0
  422. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/PositionControls.tsx +140 -0
  423. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/captionEditor.ts +215 -0
  424. package/studio/web/pages/VideoPage/components/CaptionPositionEditor/useCaptionPosition.ts +154 -0
  425. package/studio/web/pages/VideoPage/components/CarouselChangeRequest.tsx +72 -0
  426. package/studio/web/pages/VideoPage/components/CarouselCompositionStage.tsx +80 -0
  427. package/studio/web/pages/VideoPage/components/CarouselCreate.tsx +63 -0
  428. package/studio/web/pages/VideoPage/components/CarouselMissing.tsx +19 -0
  429. package/studio/web/pages/VideoPage/components/CarouselPublishStage.tsx +173 -0
  430. package/studio/web/pages/VideoPage/components/CarouselScriptStage.tsx +82 -0
  431. package/studio/web/pages/VideoPage/components/CarouselSlideCard.tsx +49 -0
  432. package/studio/web/pages/VideoPage/components/CarouselViewer.tsx +55 -0
  433. package/studio/web/pages/VideoPage/components/ChangedVoices.tsx +53 -0
  434. package/studio/web/pages/VideoPage/components/CompositionStage.tsx +78 -0
  435. package/studio/web/pages/VideoPage/components/CoverPicker.tsx +32 -0
  436. package/studio/web/pages/VideoPage/components/EditorStage.tsx +53 -0
  437. package/studio/web/pages/VideoPage/components/LineTakes.tsx +160 -0
  438. package/studio/web/pages/VideoPage/components/LineTextEditor.tsx +124 -0
  439. package/studio/web/pages/VideoPage/components/LineVoicePicker.tsx +37 -0
  440. package/studio/web/pages/VideoPage/components/MediaImage.tsx +25 -0
  441. package/studio/web/pages/VideoPage/components/MotionScriptStage.tsx +39 -0
  442. package/studio/web/pages/VideoPage/components/NarrationStage.tsx +70 -0
  443. package/studio/web/pages/VideoPage/components/PublishForm.tsx +387 -0
  444. package/studio/web/pages/VideoPage/components/PublishStage.tsx +76 -0
  445. package/studio/web/pages/VideoPage/components/PublishText.tsx +149 -0
  446. package/studio/web/pages/VideoPage/components/ScenesApprovalPanel.tsx +278 -0
  447. package/studio/web/pages/VideoPage/components/ScheduledInfo.tsx +72 -0
  448. package/studio/web/pages/VideoPage/components/ScriptApprovalPanel.tsx +189 -0
  449. package/studio/web/pages/VideoPage/components/ScriptStage.tsx +17 -0
  450. package/studio/web/pages/VideoPage/components/SequencePlayer.tsx +146 -0
  451. package/studio/web/pages/VideoPage/components/SoundTimeline/AddSound.tsx +117 -0
  452. package/studio/web/pages/VideoPage/components/SoundTimeline/AreaSelection.tsx +74 -0
  453. package/studio/web/pages/VideoPage/components/SoundTimeline/BedPanel.tsx +94 -0
  454. package/studio/web/pages/VideoPage/components/SoundTimeline/BedRow.tsx +45 -0
  455. package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionOverlay.tsx +44 -0
  456. package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionSaveBar.tsx +32 -0
  457. package/studio/web/pages/VideoPage/components/SoundTimeline/CaptionsPanel.tsx +22 -0
  458. package/studio/web/pages/VideoPage/components/SoundTimeline/ClipBlock.tsx +111 -0
  459. package/studio/web/pages/VideoPage/components/SoundTimeline/ClipPanel.tsx +76 -0
  460. package/studio/web/pages/VideoPage/components/SoundTimeline/CutsPanel.tsx +44 -0
  461. package/studio/web/pages/VideoPage/components/SoundTimeline/EditorTabBar.tsx +73 -0
  462. package/studio/web/pages/VideoPage/components/SoundTimeline/EffectChoice.tsx +46 -0
  463. package/studio/web/pages/VideoPage/components/SoundTimeline/EffectItem.tsx +89 -0
  464. package/studio/web/pages/VideoPage/components/SoundTimeline/EffectPanel.tsx +232 -0
  465. package/studio/web/pages/VideoPage/components/SoundTimeline/EffectsRow.tsx +21 -0
  466. package/studio/web/pages/VideoPage/components/SoundTimeline/Lane.tsx +39 -0
  467. package/studio/web/pages/VideoPage/components/SoundTimeline/MarkerRow.tsx +40 -0
  468. package/studio/web/pages/VideoPage/components/SoundTimeline/MuteButton.tsx +36 -0
  469. package/studio/web/pages/VideoPage/components/SoundTimeline/NumberInput.tsx +37 -0
  470. package/studio/web/pages/VideoPage/components/SoundTimeline/PlanWarnings.tsx +19 -0
  471. package/studio/web/pages/VideoPage/components/SoundTimeline/PlayerResizeHandle.tsx +50 -0
  472. package/studio/web/pages/VideoPage/components/SoundTimeline/PreviewControls.tsx +51 -0
  473. package/studio/web/pages/VideoPage/components/SoundTimeline/SceneRow.tsx +54 -0
  474. package/studio/web/pages/VideoPage/components/SoundTimeline/SettingsPanel.tsx +65 -0
  475. package/studio/web/pages/VideoPage/components/SoundTimeline/SoundLibrary.tsx +99 -0
  476. package/studio/web/pages/VideoPage/components/SoundTimeline/SoundPreview.tsx +82 -0
  477. package/studio/web/pages/VideoPage/components/SoundTimeline/SpeedPanel.tsx +128 -0
  478. package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineDock.tsx +56 -0
  479. package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineFooter.tsx +26 -0
  480. package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineSkeleton.tsx +21 -0
  481. package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineToolbar.tsx +160 -0
  482. package/studio/web/pages/VideoPage/components/SoundTimeline/TimelineTracks.tsx +121 -0
  483. package/studio/web/pages/VideoPage/components/SoundTimeline/TrackSidebar.tsx +30 -0
  484. package/studio/web/pages/VideoPage/components/SoundTimeline/VoiceRow.tsx +53 -0
  485. package/studio/web/pages/VideoPage/components/SoundTimeline/Waveform.tsx +97 -0
  486. package/studio/web/pages/VideoPage/components/SoundTimeline/clipActions.ts +50 -0
  487. package/studio/web/pages/VideoPage/components/SoundTimeline/effectActions.ts +161 -0
  488. package/studio/web/pages/VideoPage/components/SoundTimeline/index.tsx +161 -0
  489. package/studio/web/pages/VideoPage/components/SoundTimeline/timelineGeometry.ts +45 -0
  490. package/studio/web/pages/VideoPage/components/SoundTimeline/types.ts +43 -0
  491. package/studio/web/pages/VideoPage/components/SoundTimeline/useAutosave.ts +107 -0
  492. package/studio/web/pages/VideoPage/components/SoundTimeline/useEditorShortcuts.ts +168 -0
  493. package/studio/web/pages/VideoPage/components/SoundTimeline/useFitHeight.ts +40 -0
  494. package/studio/web/pages/VideoPage/components/SoundTimeline/useFollowPlayhead.ts +21 -0
  495. package/studio/web/pages/VideoPage/components/SoundTimeline/useListenMix.ts +43 -0
  496. package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayback.ts +231 -0
  497. package/studio/web/pages/VideoPage/components/SoundTimeline/usePlayerWidth.ts +27 -0
  498. package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundData.ts +124 -0
  499. package/studio/web/pages/VideoPage/components/SoundTimeline/useSoundTimeline.ts +511 -0
  500. package/studio/web/pages/VideoPage/components/StageDrawer/CompareVersions.tsx +111 -0
  501. package/studio/web/pages/VideoPage/components/StageDrawer/VersionCard.tsx +81 -0
  502. package/studio/web/pages/VideoPage/components/StageDrawer/VersionMedia.tsx +24 -0
  503. package/studio/web/pages/VideoPage/components/StageDrawer/VersionText.tsx +15 -0
  504. package/studio/web/pages/VideoPage/components/StageDrawer/index.tsx +109 -0
  505. package/studio/web/pages/VideoPage/components/StageProcess.tsx +126 -0
  506. package/studio/web/pages/VideoPage/components/StageResult.tsx +69 -0
  507. package/studio/web/pages/VideoPage/components/SwapReference.tsx +92 -0
  508. package/studio/web/pages/VideoPage/components/ThumbnailPanel.tsx +252 -0
  509. package/studio/web/pages/VideoPage/components/TimingPanel.tsx +89 -0
  510. package/studio/web/pages/VideoPage/components/VideoPlayer.tsx +18 -0
  511. package/studio/web/pages/VideoPage/components/VideoSkeleton.tsx +50 -0
  512. package/studio/web/pages/VideoPage/components/VideoVoiceInfo.tsx +33 -0
  513. package/studio/web/pages/VideoPage/components/VideoVoicePicker.tsx +165 -0
  514. package/studio/web/pages/VideoPage/components/VoicePauseBanner.tsx +56 -0
  515. package/studio/web/pages/VideoPage/components/WithLogo.tsx +10 -0
  516. package/studio/web/pages/VideoPage/index.tsx +295 -0
  517. package/studio/web/pages/VideosPage/components/PublishedOn.tsx +85 -0
  518. package/studio/web/pages/VideosPage/components/ServicesPanel.tsx +81 -0
  519. package/studio/web/pages/VideosPage/components/SessionsPanel.tsx +62 -0
  520. package/studio/web/pages/VideosPage/components/VideoListSkeleton.tsx +25 -0
  521. package/studio/web/pages/VideosPage/components/VideoRow.tsx +122 -0
  522. package/studio/web/pages/VideosPage/index.tsx +134 -0
  523. package/studio/web/pages/VoicePage/index.tsx +28 -0
  524. package/studio/web/router.tsx +201 -0
  525. package/studio/web/styles/base/elements.css +55 -0
  526. package/studio/web/styles/base/utilities.css +25 -0
  527. package/studio/web/styles/components/badge.css +33 -0
  528. package/studio/web/styles/components/claude-running.css +27 -0
  529. package/studio/web/styles/components/claude-session.css +212 -0
  530. package/studio/web/styles/components/claude-walking.css +92 -0
  531. package/studio/web/styles/components/clone-voice-save.css +136 -0
  532. package/studio/web/styles/components/clone-voice.css +379 -0
  533. package/studio/web/styles/components/controls.css +70 -0
  534. package/studio/web/styles/components/data-and-image.css +54 -0
  535. package/studio/web/styles/components/forms.css +132 -0
  536. package/studio/web/styles/components/human-banner.css +99 -0
  537. package/studio/web/styles/components/lightbox.css +50 -0
  538. package/studio/web/styles/components/markdown.css +68 -0
  539. package/studio/web/styles/components/modal.css +70 -0
  540. package/studio/web/styles/components/omni-cards.css +105 -0
  541. package/studio/web/styles/components/omni.css +859 -0
  542. package/studio/web/styles/components/omnichat.css +538 -0
  543. package/studio/web/styles/components/panel.css +115 -0
  544. package/studio/web/styles/components/platform-card.css +140 -0
  545. package/studio/web/styles/components/provider-card.css +132 -0
  546. package/studio/web/styles/components/queue.css +185 -0
  547. package/studio/web/styles/components/reference-actions.css +133 -0
  548. package/studio/web/styles/components/reference-picker.css +146 -0
  549. package/studio/web/styles/components/results-drawer.css +224 -0
  550. package/studio/web/styles/components/segmented.css +115 -0
  551. package/studio/web/styles/components/side-panel-tab.css +23 -0
  552. package/studio/web/styles/components/status-signals.css +66 -0
  553. package/studio/web/styles/components/stepper.css +208 -0
  554. package/studio/web/styles/components/table.css +19 -0
  555. package/studio/web/styles/components/tabs.css +24 -0
  556. package/studio/web/styles/components/ui/accordion.css +71 -0
  557. package/studio/web/styles/components/ui/chart.css +162 -0
  558. package/studio/web/styles/components/ui/checkbox.css +37 -0
  559. package/studio/web/styles/components/ui/date-picker.css +153 -0
  560. package/studio/web/styles/components/ui/select.css +110 -0
  561. package/studio/web/styles/components/ui/skeleton.css +25 -0
  562. package/studio/web/styles/components/ui/slider.css +81 -0
  563. package/studio/web/styles/components/ui/switch.css +41 -0
  564. package/studio/web/styles/components/ui/tooltip.css +24 -0
  565. package/studio/web/styles/components/voice-carousel.css +255 -0
  566. package/studio/web/styles/components/voice-editor.css +179 -0
  567. package/studio/web/styles/components/voice-grid.css +56 -0
  568. package/studio/web/styles/components/voice-profiles.css +192 -0
  569. package/studio/web/styles/design-system.md +136 -0
  570. package/studio/web/styles/index.css +116 -0
  571. package/studio/web/styles/layout/page.css +41 -0
  572. package/studio/web/styles/layout/sidebar-groups.css +39 -0
  573. package/studio/web/styles/layout/sidebar.css +111 -0
  574. package/studio/web/styles/pages/agent.css +26 -0
  575. package/studio/web/styles/pages/analytics/dashboard.css +614 -0
  576. package/studio/web/styles/pages/analytics/insights.css +48 -0
  577. package/studio/web/styles/pages/getting-started.css +166 -0
  578. package/studio/web/styles/pages/new-video/form.css +32 -0
  579. package/studio/web/styles/pages/not-found.css +59 -0
  580. package/studio/web/styles/pages/references.css +204 -0
  581. package/studio/web/styles/pages/schedule/calendar.css +541 -0
  582. package/studio/web/styles/pages/schedule/chip-states.css +60 -0
  583. package/studio/web/styles/pages/settings/models.css +72 -0
  584. package/studio/web/styles/pages/settings/shell.css +361 -0
  585. package/studio/web/styles/pages/settings/usage.css +63 -0
  586. package/studio/web/styles/pages/studio-offline.css +105 -0
  587. package/studio/web/styles/pages/video/caption-controls.css +194 -0
  588. package/studio/web/styles/pages/video/captions-grid.css +70 -0
  589. package/studio/web/styles/pages/video/captions.css +79 -0
  590. package/studio/web/styles/pages/video/editor-chat.css +103 -0
  591. package/studio/web/styles/pages/video/export.css +50 -0
  592. package/studio/web/styles/pages/video/frames.css +29 -0
  593. package/studio/web/styles/pages/video/fullscreen-stage.css +400 -0
  594. package/studio/web/styles/pages/video/instagram-carousel.css +309 -0
  595. package/studio/web/styles/pages/video/layout.css +285 -0
  596. package/studio/web/styles/pages/video/narration.css +138 -0
  597. package/studio/web/styles/pages/video/preview-overview.css +11 -0
  598. package/studio/web/styles/pages/video/processing-notice.css +34 -0
  599. package/studio/web/styles/pages/video/publish-when.css +76 -0
  600. package/studio/web/styles/pages/video/publish.css +97 -0
  601. package/studio/web/styles/pages/video/result.css +96 -0
  602. package/studio/web/styles/pages/video/scenes.css +167 -0
  603. package/studio/web/styles/pages/video/sound-timeline.css +672 -0
  604. package/studio/web/styles/pages/video/sound-toolbar.css +149 -0
  605. package/studio/web/styles/pages/video/take-player.css +100 -0
  606. package/studio/web/styles/pages/video/thumbnail.css +157 -0
  607. package/studio/web/styles/pages/video/timeline.css +117 -0
  608. package/studio/web/styles/pages/video/voice-picker.css +14 -0
  609. package/studio/web/styles/pages/video-list/active-row.css +27 -0
  610. package/studio/web/styles/pages/video-list/card-link.css +49 -0
  611. package/studio/web/styles/pages/video-list/list.css +86 -0
  612. package/studio/web/styles/theme/identity/details.css +204 -0
  613. package/studio/web/styles/theme/identity/shell.css +249 -0
  614. package/studio/web/styles/theme/identity/surfaces.css +183 -0
  615. package/studio/web/styles/theme/identity/titles-and-buttons.css +120 -0
  616. package/studio/web/styles/theme/no-borders/blocks.css +208 -0
  617. package/studio/web/styles/theme/no-borders/controls.css +256 -0
  618. package/studio/web/styles/tokens.css +245 -0
  619. package/studio/web/types/api.ts +2 -0
  620. package/studio/web/types/assets.d.ts +9 -0
  621. package/templates/brief.md +27 -0
  622. package/templates/captions.html +204 -0
  623. package/templates/carousel-composition.md +47 -0
  624. package/templates/carousel-script.md +60 -0
  625. package/templates/components/voiceavatar/README.md +87 -0
  626. package/templates/components/voiceavatar/demo.html +50 -0
  627. package/templates/components/voiceavatar/voiceavatar.js +415 -0
  628. package/templates/motion.md +80 -0
  629. package/templates/playbook.md +43 -0
  630. package/templates/reference.md +123 -0
  631. package/templates/scene.html +112 -0
  632. package/templates/scenes.example.json +96 -0
  633. package/templates/script.md +63 -0
  634. package/templates/slide.html +71 -0
  635. package/templates/wireframe.html +91 -0
  636. package/tools/analysis.mjs +300 -0
  637. package/tools/approval.mjs +442 -0
  638. package/tools/assemble.mjs +942 -0
  639. package/tools/build-motion.mjs +437 -0
  640. package/tools/captions.mjs +246 -0
  641. package/tools/carousel.mjs +558 -0
  642. package/tools/compose.mjs +307 -0
  643. package/tools/cuts.mjs +74 -0
  644. package/tools/editor.mjs +419 -0
  645. package/tools/epidemic-capture.js +54 -0
  646. package/tools/fanout.mjs +69 -0
  647. package/tools/history.mjs +70 -0
  648. package/tools/history.py +61 -0
  649. package/tools/job-queue.mjs +180 -0
  650. package/tools/job_queue.py +430 -0
  651. package/tools/lib/agents.mjs +412 -0
  652. package/tools/lib/channel.mjs +399 -0
  653. package/tools/lib/claude-settings.mjs +67 -0
  654. package/tools/lib/cli.mjs +9 -0
  655. package/tools/lib/fanout.mjs +234 -0
  656. package/tools/lib/http.mjs +94 -0
  657. package/tools/lib/index.js +14 -0
  658. package/tools/lib/mcp-server.mjs +69 -0
  659. package/tools/lib/metrics/metrics.mjs +204 -0
  660. package/tools/lib/narration.mjs +15 -0
  661. package/tools/lib/oauth-client.mjs +295 -0
  662. package/tools/lib/omnichat/config.mjs +139 -0
  663. package/tools/lib/omnichat/errors.mjs +42 -0
  664. package/tools/lib/omnichat/extract.mjs +82 -0
  665. package/tools/lib/omnichat/gate.mjs +151 -0
  666. package/tools/lib/omnichat/manual.mjs +166 -0
  667. package/tools/lib/omnichat/match.mjs +78 -0
  668. package/tools/lib/omnichat/pass.mjs +393 -0
  669. package/tools/lib/omnichat/record.mjs +208 -0
  670. package/tools/lib/omnichat/text.mjs +315 -0
  671. package/tools/lib/omnichat/webhook.mjs +166 -0
  672. package/tools/lib/pairing.mjs +99 -0
  673. package/tools/lib/paths.mjs +41 -0
  674. package/tools/lib/platforms/instagram.mjs +469 -0
  675. package/tools/lib/platforms/tiktok.mjs +343 -0
  676. package/tools/lib/platforms/youtube.mjs +228 -0
  677. package/tools/lib/publish/publish.mjs +244 -0
  678. package/tools/lib/schedule/schedule.mjs +191 -0
  679. package/tools/lib/service.mjs +134 -0
  680. package/tools/lib/skill-client.mjs +126 -0
  681. package/tools/lib/skills-release.mjs +196 -0
  682. package/tools/lib/testing.mjs +52 -0
  683. package/tools/lib/up.mjs +187 -0
  684. package/tools/metrics.mjs +415 -0
  685. package/tools/models.mjs +134 -0
  686. package/tools/narrate.mjs +257 -0
  687. package/tools/omni.mjs +298 -0
  688. package/tools/omni_paths.py +12 -0
  689. package/tools/omnichat.mjs +1577 -0
  690. package/tools/omnivideo.py +1122 -0
  691. package/tools/package.mjs +130 -0
  692. package/tools/platforms.mjs +236 -0
  693. package/tools/premiere.mjs +533 -0
  694. package/tools/publish.mjs +1496 -0
  695. package/tools/reference.mjs +1408 -0
  696. package/tools/render.mjs +426 -0
  697. package/tools/runner.mjs +156 -0
  698. package/tools/setup.mjs +466 -0
  699. package/tools/skills-release.mjs +93 -0
  700. package/tools/sound.mjs +1323 -0
  701. package/tools/soundtrack.mjs +217 -0
  702. package/tools/thumbnail.mjs +271 -0
  703. package/tools/timing.mjs +108 -0
  704. package/tools/usage.py +628 -0
  705. package/tools/voice-envelope.mjs +185 -0
  706. package/tools/voice.py +448 -0
  707. package/tools/voice_sample.py +75 -0
  708. package/tools/wireframe.mjs +230 -0
@@ -0,0 +1,52 @@
1
+ /* What the admin panel (/admin) offers for Omni, the same for every user: the engine Omni runs on,
2
+ the cascade's language model (OpenRouter), its voice and its voice model. The server checks a
3
+ choice against these lists (services/admin.ts) and the page draws its selects from them. */
4
+
5
+ export type OmniEngine = "grok" | "stream" | "chunks";
6
+
7
+ export const OMNI_ENGINES: { id: OmniEngine; label: string; hint: string }[] = [
8
+ { id: "grok", label: "Grok Voice", hint: "xAI de voz para voz; cobra cada minuto aberto (US$ 0,08/min)" },
9
+ {
10
+ id: "stream",
11
+ label: "Cascata em streaming",
12
+ hint: "STT da xAI em streaming → modelo do OpenRouter → Fish (US$ 0,20/h de microfone aberto)",
13
+ },
14
+ {
15
+ id: "chunks",
16
+ label: "Cascata por trechos",
17
+ hint: "cada fala vai inteira ao STT → modelo do OpenRouter → Fish (só a fala é cobrada)",
18
+ },
19
+ ];
20
+
21
+ /* the cascade's language model, by its OpenRouter id */
22
+ export const OMNI_LLMS: { id: string; label: string }[] = [
23
+ { id: "anthropic/claude-haiku-5.5", label: "Claude Haiku 5.5" },
24
+ { id: "openai/gpt-6-luna", label: "GPT-6 Luna" },
25
+ { id: "google/gemini-3.8-flash", label: "Gemini 3.8 Flash" },
26
+ ];
27
+
28
+ /* Grok's voices (agent.voices): picking one sets agent.gender */
29
+ export const GROK_VOICES: { id: string; label: string; gender: "female" | "male" }[] = [
30
+ { id: "ara", label: "Ara (feminina)", gender: "female" },
31
+ { id: "rex", label: "Rex (masculina)", gender: "male" },
32
+ ];
33
+
34
+ /* the cascade's Fish voices (agent.cascade.voice), from Fish's library and the account */
35
+ export const FISH_VOICES: { id: string; label: string; gender: "female" | "male" }[] = [
36
+ { id: "6ccc1431468e4ef69fca0054fe5898cd", label: "Omni", gender: "female" },
37
+ { id: "148da69cf74b4530b1c41d5c1e87c688", label: "Mulher comum", gender: "female" },
38
+ { id: "c7d997eba056434d8ba3dd1b8dec560e", label: "Linn", gender: "male" },
39
+ ];
40
+
41
+ /* the cascade's voice model (agent.cascade.fish_model) */
42
+ export const FISH_MODELS: { id: string; label: string }[] = [
43
+ { id: "s2.1-pro-free", label: "Fish S2.1 Pro grátis" },
44
+ { id: "s2.1-pro", label: "Fish S2.1 Pro (pago)" },
45
+ ];
46
+
47
+ /* the engine a config holds: agent.engine, or, from before it, agent.grok false = the cascade */
48
+ export function engineOf(agent: { engine?: unknown; grok?: unknown } | undefined): OmniEngine {
49
+ const e = agent?.engine;
50
+ if (e === "grok" || e === "stream" || e === "chunks") return e;
51
+ return agent?.grok === false ? "stream" : "grok";
52
+ }
@@ -0,0 +1,48 @@
1
+ /* The user saying goodbye to Omni ("tchau", "pode terminar", "valeu, até logo"): the call ends with
2
+ "Até logo!" without waiting for the model to decide it. Only an utterance that is nothing but the
3
+ goodbye counts: "tchau, mas antes abre o vídeo" goes to the model like any other. The cascade
4
+ checks it on the server (agent-cascade.ts), Grok's page on the user's transcript (omni-realtime). */
5
+
6
+ /* the goodbye itself, in normalized text (lowercase, no accents or punctuation) */
7
+ const FAREWELLS = [
8
+ /\b(?:tchau|tchauzinho|xau|xauzinho|chau)\b/,
9
+ /\bate (?:logo|mais|a proxima|amanha|depois|breve|outra hora)\b/,
10
+ /\b(?:falou|flw|fui)\b/,
11
+ /\b(?:pode|vamos|vou|quero) (?:terminar|encerrar|desligar|fechar|finalizar|parar por aqui)\b/,
12
+ /\b(?:encerra|encerrar|desliga|desligar|termina|terminar|finaliza|finalizar)\b/,
13
+ /\b(?:por hoje e so|era so isso|e so isso por hoje|nao preciso de mais nada)\b/,
14
+ ];
15
+ /* what may come with it: thanks, "ok", "a conversa", "por aqui", "boa noite"… */
16
+ const AROUND = new Set(
17
+ (
18
+ "ok okay entao beleza blz valeu vlw obrigado obrigada brigado brigada muito mesmo omni bom boa ta otimo " +
19
+ "perfeito show e a o conversa ligacao chamada papo por aqui hoje ai agora ja pode isso noite tarde dia " +
20
+ "beijo beijos abraco abracos gata querida linda tudo certo"
21
+ ).split(" "),
22
+ );
23
+
24
+ export const normalizeSpeech = (text: string) =>
25
+ text
26
+ .toLowerCase()
27
+ .normalize("NFD")
28
+ .replace(/[̀-ͯ]/g, "")
29
+ .replace(/[^a-z0-9\s]/g, " ")
30
+ .replace(/\s+/g, " ")
31
+ .trim();
32
+
33
+ export function isFarewell(text: string): boolean {
34
+ let t = normalizeSpeech(text);
35
+ if (!t || t.split(" ").length > 12) return false;
36
+ let found = false;
37
+ for (const re of FAREWELLS) {
38
+ const g = new RegExp(re.source, "g");
39
+ if (g.test(t)) {
40
+ found = true;
41
+ t = t.replace(g, " ");
42
+ }
43
+ }
44
+ return found && t.split(" ").every(w => !w || AROUND.has(w));
45
+ }
46
+
47
+ /* what Omni says before hanging up */
48
+ export const FAREWELL_REPLY = "Até logo!";
@@ -0,0 +1,20 @@
1
+ /* "Oi, Omni": the words that call Omni with its panel closed (lib/omni-hotword.ts listens, the server's
2
+ /api/agent/hotword transcribes the start of each utterance and checks it here). Only the start counts:
3
+ the name in its first words, after at most a greeting ("oi", "ei", "olha"…). "Omnichat" or "o homem"
4
+ don't call it. The STT writes the name in a few ways (measured 2026-10-17: "Omni", "Ômini",
5
+ "homini"); "homem" stays out, "ei, homem" is a real sentence. */
6
+
7
+ import { normalizeSpeech } from "./omni-farewell";
8
+
9
+ const NAME = new Set(["omni", "omini", "homini", "hominy", "ominy", "omne", "ommi"]);
10
+ /* what may come before the name */
11
+ const BEFORE = new Set(["oi", "ei", "ey", "hey", "e", "ai", "ah", "eh", "olha", "ola", "alo", "o", "ow", "opa"]);
12
+
13
+ export function isHotword(text: string): boolean {
14
+ const words = normalizeSpeech(text).split(" ").slice(0, 4);
15
+ for (const w of words) {
16
+ if (NAME.has(w)) return true;
17
+ if (!BEFORE.has(w)) return false;
18
+ }
19
+ return false;
20
+ }
@@ -0,0 +1,228 @@
1
+ /* The studio screens Omni can open (the `navigate` UI tool) and how a path reads back as "where the
2
+ user is" (the screen context of each turn). One catalog for the server, which hands it to the LLM,
3
+ and for the browser, which builds the route and navigates (web/lib/omni-ui.ts). Paths follow
4
+ web/router.tsx. */
5
+
6
+ export type ScreenId =
7
+ | "home"
8
+ | "videos"
9
+ | "video"
10
+ | "analytics"
11
+ | "video_metrics"
12
+ | "new"
13
+ | "styles"
14
+ | "style"
15
+ | "voice"
16
+ | "queue"
17
+ | "schedule"
18
+ | "omnichat"
19
+ | "omnichat_rule"
20
+ | "settings"
21
+ | "usage"
22
+ | "omni_measures"
23
+ | "getting_started";
24
+
25
+ /* label: how Omni names the screen to the user (and how it reads in the screen context) */
26
+ export const SCREENS: Record<ScreenId, { label: string; path: string }> = {
27
+ home: { label: "Início", path: "/" },
28
+ videos: { label: "Conteúdos", path: "/videos" },
29
+ video: { label: "Vídeo", path: "/videos/$slug" },
30
+ analytics: { label: "Análise do canal", path: "/analytics" },
31
+ video_metrics: { label: "Métricas de um Reel", path: "/analytics/$slug" },
32
+ new: { label: "Novo conteúdo", path: "/new" },
33
+ styles: { label: "Estilos visuais", path: "/styles" },
34
+ style: { label: "Um estilo visual", path: "/styles/$name" },
35
+ voice: { label: "Voz", path: "/voice" },
36
+ queue: { label: "Fila da máquina", path: "/queue" },
37
+ schedule: { label: "Agenda de publicação", path: "/schedule" },
38
+ omnichat: { label: "Omnichat", path: "/omnichat" },
39
+ /* where a content's Omnichat is set up, always: /omnichat/video/<slug> (or carousel) */
40
+ omnichat_rule: { label: "Omnichat de um conteúdo", path: "/omnichat/$kind/$id" },
41
+ settings: { label: "Configurações", path: "/settings" },
42
+ usage: { label: "Uso das vozes", path: "/usage" },
43
+ omni_measures: { label: "Medições do Omni", path: "/agent" },
44
+ getting_started: { label: "Primeiros passos", path: "/getting-started" },
45
+ };
46
+
47
+ /* the stages of a video (web/lib/stages.ts), as the video screen's tabs */
48
+ export const VIDEO_STAGES: Record<string, string> = {
49
+ script: "Roteiro do conteúdo",
50
+ motion_script: "Roteiro de motion",
51
+ motion: "Composição",
52
+ narration: "Narração, voz e tempo",
53
+ voice: "Voz (escolha das falas)",
54
+ render: "Editor (timeline, legenda e exportação)",
55
+ captions: "Legenda (aba do editor)",
56
+ export: "Exportação (no editor)",
57
+ publish: "Publicar",
58
+ "carousel-script": "Roteiro do carrossel",
59
+ "carousel-composition": "Composição do carrossel",
60
+ "carousel-publish": "Publicar o carrossel",
61
+ };
62
+
63
+ /* the tabs inside a video stage (navigate with stage and tab): the publication's, the carousel's and the
64
+ editor's. The stage registers a handle that switches them (web/lib/omni-ui.ts, stageTabsKey) */
65
+ export const STAGE_TABS: Record<string, Record<string, string>> = {
66
+ publish: { info: "Informações do vídeo (publicar e agendar)", thumbnail: "Thumbnail" },
67
+ "carousel-publish": { post: "Post (publicar o carrossel)" },
68
+ render: {
69
+ agent: "Agente (o chat do editor)",
70
+ settings: "Ajustes",
71
+ sounds: "Sons",
72
+ captions: "Legenda",
73
+ cuts: "Cortes",
74
+ scenes: "Cenas",
75
+ },
76
+ };
77
+ /* the "Sem DM" panel of a content's Omnichat screen (the omnichat_comments UI tool drives it) */
78
+ export const missingDmsKey = (content: "video" | "carousel", slug: string) => `missing-dms:${content}:${slug}`;
79
+ export const stageTabsKey = (slug: string, stage: string) =>
80
+ stage === "render" ? `editor:${slug}` : `stage-tabs:${slug}:${stage}`;
81
+
82
+ export const SETTINGS_TABS: Record<string, string> = {
83
+ voice: "Voz",
84
+ usage: "Uso",
85
+ agent: "Omni",
86
+ platforms: "Plataformas",
87
+ publishing: "Publicação",
88
+ providers: "Provedores",
89
+ };
90
+
91
+ export const SCHEDULE_VIEWS: Record<string, string> = { month: "mês", week: "semana", day: "dia" };
92
+
93
+ export type NavigateArgs = {
94
+ screen: ScreenId;
95
+ slug?: string;
96
+ /* omnichat_rule: the Reel's rule (video, the default) or the carousel's */
97
+ content?: "video" | "carousel";
98
+ stage?: string;
99
+ name?: string;
100
+ tab?: string;
101
+ view?: string;
102
+ };
103
+
104
+ const SLUG = /^[\w.-]{1,120}$/;
105
+
106
+ /* the route for these arguments, or why it can't be opened (in Portuguese, for the model) */
107
+ export type Route = { to: string; params: Record<string, string>; tab?: string };
108
+ export function routeFor(a: NavigateArgs): Route | { error: string } {
109
+ const screen = SCREENS[a.screen];
110
+ if (!screen) return { error: `tela desconhecida: ${a.screen}` };
111
+ if (a.screen === "video" || a.screen === "video_metrics") {
112
+ if (!a.slug || !SLUG.test(a.slug)) return { error: "falta o slug do vídeo (use list_videos)" };
113
+ if (a.screen === "video" && a.stage) {
114
+ if (!(a.stage in VIDEO_STAGES)) return { error: `etapa desconhecida: ${a.stage}` };
115
+ const route = { to: "/videos/$slug/$stage", params: { slug: a.slug, stage: a.stage } };
116
+ if (!a.tab) return route;
117
+ const tabs = STAGE_TABS[a.stage];
118
+ if (!tabs) return { error: `a etapa ${a.stage} não tem abas` };
119
+ if (!(a.tab in tabs))
120
+ return { error: `aba desconhecida em ${a.stage}: ${a.tab} (são ${Object.keys(tabs).join(", ")})` };
121
+ return { ...route, tab: a.tab };
122
+ }
123
+ if (a.tab) return { error: "aba de vídeo só com stage (publish, carousel-publish ou render)" };
124
+ return { to: screen.path, params: { slug: a.slug } };
125
+ }
126
+ if (a.screen === "omnichat_rule") {
127
+ if (!a.slug || !SLUG.test(a.slug)) return { error: "falta o slug do conteúdo (use list_videos)" };
128
+ return { to: screen.path, params: { kind: a.content === "carousel" ? "carousel" : "video", id: a.slug } };
129
+ }
130
+ if (a.screen === "style") {
131
+ if (!a.name || !SLUG.test(a.name)) return { error: "falta o nome do estilo" };
132
+ return { to: screen.path, params: { name: a.name } };
133
+ }
134
+ if (a.screen === "settings" && a.tab) {
135
+ if (!(a.tab in SETTINGS_TABS)) return { error: `aba desconhecida: ${a.tab}` };
136
+ return { to: "/settings/$category", params: { category: a.tab } };
137
+ }
138
+ if (a.screen === "schedule" && a.view && a.view !== "month") {
139
+ if (!(a.view in SCHEDULE_VIEWS)) return { error: `visão desconhecida: ${a.view}` };
140
+ return { to: "/schedule/$view", params: { view: a.view } };
141
+ }
142
+ return { to: screen.path, params: {} };
143
+ }
144
+
145
+ /* a path as a sentence: "Vídeo 2026-10-14-x, etapa Roteiro de motion" */
146
+ export function describePath(path: string): string {
147
+ const p = path.replace(/[?#].*$/, "").replace(/\/+$/, "") || "/";
148
+ const parts = p.split("/").filter(Boolean).map(decodeURIComponent);
149
+ if (!parts.length) return SCREENS.home.label;
150
+ const [root, a, b] = parts;
151
+ if (root === "videos" && a) return `${SCREENS.video.label} ${a}${b ? `, etapa ${VIDEO_STAGES[b] ?? b}` : ""}`;
152
+ if (root === "analytics" && a) return `${SCREENS.video_metrics.label} (${a})`;
153
+ if (root === "styles" && a) return `${SCREENS.style.label}: ${a}`;
154
+ if (root === "omnichat" && a && b)
155
+ return `Omnichat ${a === "carousel" ? "do carrossel" : a === "post" ? "do post" : "do vídeo"} ${b}`;
156
+ if (root === "settings" && a) return `${SCREENS.settings.label}, aba ${SETTINGS_TABS[a] ?? a}`;
157
+ if (root === "schedule" && a) return `${SCREENS.schedule.label}, visão por ${SCHEDULE_VIEWS[a] ?? a}`;
158
+ const hit = Object.values(SCREENS).find(s => s.path === `/${root}`);
159
+ return hit?.label ?? p;
160
+ }
161
+
162
+ /* --- the Claude processes on screen ----------------------------------------------------------- */
163
+ /* where each studio Claude session lives (the UI tools open_claude, stop_claude, write_to_claude,
164
+ send_to_claude): a video's in the "Processo" sidebar, the editor's chat in the Editor stage, a
165
+ reference's on its page. The channel analysis is left out: its panel sits inside a Reel's tabs */
166
+ export type ClaudeType = "video" | "edit" | "reference";
167
+ export const CLAUDE_TYPES: Record<ClaudeType, string> = {
168
+ video: "o Claude do vídeo (pipeline), na barra lateral Processo",
169
+ edit: "o chat do editor de um vídeo já montado",
170
+ reference: "o Claude de um estilo visual",
171
+ };
172
+ export type ClaudeArgs = { type: ClaudeType; slug?: string; name?: string };
173
+
174
+ /* the session's target (slug or reference name) and the screen that shows it, or why not */
175
+ export function claudeTarget(
176
+ a: ClaudeArgs,
177
+ ): { target: string; route: { to: string; params: Record<string, string> } } | { error: string } {
178
+ if (a.type === "reference") {
179
+ if (!a.name || !/^[a-z0-9][a-z0-9-]{0,62}$/.test(a.name))
180
+ return { error: "falta o nome do estilo visual (use list_references)" };
181
+ return { target: a.name, route: { to: SCREENS.style.path, params: { name: a.name } } };
182
+ }
183
+ if (a.type !== "video" && a.type !== "edit") return { error: `tipo desconhecido: ${a.type}` };
184
+ if (!a.slug || !SLUG.test(a.slug)) return { error: "falta o slug do vídeo (use list_videos)" };
185
+ return {
186
+ target: a.slug,
187
+ route:
188
+ a.type === "edit"
189
+ ? { to: "/videos/$slug/$stage", params: { slug: a.slug, stage: "render" } }
190
+ : { to: SCREENS.video.path, params: { slug: a.slug } },
191
+ };
192
+ }
193
+
194
+ /* already there: a video's sidebar opens over any of its stages, so its Claude needs no navigation */
195
+ export function onClaudeScreen(a: ClaudeArgs, path: string): boolean {
196
+ const p = path.replace(/[?#].*$/, "").replace(/\/+$/, "");
197
+ const parts = p.split("/").filter(Boolean).map(decodeURIComponent);
198
+ if (a.type === "video") return parts[0] === "videos" && parts[1] === a.slug;
199
+ if (a.type === "edit") return parts[0] === "videos" && parts[1] === a.slug && parts[2] === "render";
200
+ return parts[0] === "styles" && parts[1] === a.name;
201
+ }
202
+
203
+ /* --- the cards Omni shows in its panel (show_card; web/components/Omni/OmniCards) ----------------- */
204
+ export const CARD_KINDS = {
205
+ video: "o conteúdo: capa, título, etapa, onde foi publicado",
206
+ thumbnails: "as versões da thumbnail, com a escolhida",
207
+ export: "o player do vídeo exportado",
208
+ scene: "o quadro de uma cena (scene)",
209
+ carousel: "os slides do carrossel",
210
+ metrics: "os números do Reel publicado",
211
+ reference: "um estilo visual: quadro, título e essência (name)",
212
+ } as const;
213
+ export type CardKind = keyof typeof CARD_KINDS;
214
+
215
+ /* --- Epidemic Sound (add_epidemic_sound) -------------------------------------------------------- */
216
+ /* a search page on Epidemic: the editor's agent opens it in Chrome, plays the tracks and downloads the
217
+ first one the video doesn't have (api/services/sound.ts captureFromPage) */
218
+ export function epidemicSearchUrl(query: string, kind: "music" | "sfx" = "music"): string {
219
+ const base =
220
+ kind === "music"
221
+ ? "https://www.epidemicsound.com/music/search/?term="
222
+ : "https://www.epidemicsound.com/sound-effects/search/?term=";
223
+ return `${base}${encodeURIComponent(query.trim())}`;
224
+ }
225
+
226
+ /* an Epidemic link the "Adicionar som" box takes: a page on epidemicsound.com or a player MP3 */
227
+ export const isEpidemicUrl = (url: string) =>
228
+ /^https:\/\/(www\.)?epidemicsound\.com\//.test(url) || /^https:\/\/audiocdn\.epidemicsound\.com\/lqmp3\//.test(url);
@@ -0,0 +1,15 @@
1
+ /* The admin panel (/admin): POST /api/admin/omni changes one or more of Omni's settings for every user.
2
+ The values are checked against shared/omni-admin's lists on the server. */
3
+
4
+ import { z } from "zod";
5
+
6
+ export const omniAdminBody = z
7
+ .object({
8
+ enabled: z.boolean(),
9
+ engine: z.enum(["grok", "stream", "chunks"]),
10
+ voice: z.string().max(64),
11
+ fish_model: z.string().max(64),
12
+ llm: z.string().max(120),
13
+ })
14
+ .partial();
15
+ export type OmniAdminBody = z.infer<typeof omniAdminBody>;
@@ -0,0 +1,58 @@
1
+ /* Omni in cascade mode (speech → text → a fast LLM with the tools → Fish voice): the session, each
2
+ turn and what the browser measures. */
3
+
4
+ import { z } from "zod";
5
+
6
+ /* "stream": the microphone streams to xAI's STT WebSocket; "chunks": each utterance is posted whole */
7
+ export const cascadeMode = z.enum(["stream", "chunks"]);
8
+ export type CascadeMode = z.infer<typeof cascadeMode>;
9
+
10
+ /* POST /api/agent/cascade/session; `history`: the lines of an earlier conversation the user continues */
11
+ export const cascadeSessionBody = z.object({
12
+ mode: cascadeMode,
13
+ history: z
14
+ .array(z.object({ role: z.enum(["user", "assistant"]), text: z.string().min(1).max(4000) }))
15
+ .max(80)
16
+ .optional(),
17
+ });
18
+ export type CascadeSessionBody = z.infer<typeof cascadeSessionBody>;
19
+
20
+ /* POST /api/agent/cascade/:id/turn: what the user said (or typed, or "[Tela] …" after a Confirmar);
21
+ speculative: started on the STT's locked text before the end of the turn, confirmed by /commit */
22
+ export const cascadeTurnBody = z.object({
23
+ text: z.string().min(1).max(4000),
24
+ speculative: z.boolean().optional(),
25
+ /* the path on screen, for "esse vídeo" (shared/omni-screens.ts reads it) */
26
+ screen: z.string().max(300).optional(),
27
+ });
28
+ export type CascadeTurnBody = z.infer<typeof cascadeTurnBody>;
29
+
30
+ /* POST /api/agent/cascade/:id/ui-result: what a UI tool did in the browser */
31
+ export const cascadeUiResultBody = z.object({
32
+ call_id: z.string().max(200),
33
+ output: z.record(z.string(), z.unknown()),
34
+ });
35
+ export type CascadeUiResultBody = z.infer<typeof cascadeUiResultBody>;
36
+
37
+ /* POST /api/agent/cascade/:id/log: the browser's side of a turn and of the session */
38
+ export const cascadeLogBody = z.discriminatedUnion("type", [
39
+ /* end of the user's speech → first audio played, and how long the text took to arrive */
40
+ z.object({
41
+ type: z.literal("turn"),
42
+ latency_ms: z.number(),
43
+ stt_ms: z.number().nullable(),
44
+ llm_first_ms: z.number().nullable(),
45
+ tts_first_ms: z.number().nullable(),
46
+ item: z.string().optional(),
47
+ }),
48
+ z.object({ type: z.literal("feedback"), item: z.string(), value: z.enum(["up", "down", "none"]) }),
49
+ /* stt_audio_s: seconds of audio streamed to the STT (stream mode bills them) */
50
+ z.object({
51
+ type: z.literal("end"),
52
+ duration_s: z.number(),
53
+ stt_audio_s: z.number().optional(),
54
+ reason: z.string().optional(),
55
+ }),
56
+ z.object({ type: z.literal("error"), message: z.string() }),
57
+ ]);
58
+ export type CascadeLogBody = z.infer<typeof cascadeLogBody>;
@@ -0,0 +1,73 @@
1
+ /* Omni's conversation history (api/services/agent-history.ts): what the browser saves of a call and
2
+ what the Conversas list reads back. */
3
+
4
+ import { z } from "zod";
5
+
6
+ export const CONVERSATION_ID = /^[\w-]{1,80}$/;
7
+
8
+ const text = (max: number) => z.string().max(max);
9
+
10
+ /* one line of the transcript, the shape of web/lib/omni-realtime.ts OmniEntry */
11
+ export const conversationEntry = z.discriminatedUnion("kind", [
12
+ z.object({ kind: z.literal("user"), id: text(120), text: text(8000), pending: z.boolean().optional() }),
13
+ z.object({
14
+ kind: z.literal("assistant"),
15
+ id: text(120),
16
+ text: text(8000),
17
+ latency_ms: z.number().nullable().optional(),
18
+ feedback: z.enum(["up", "down"]).nullable().optional(),
19
+ breakdown: text(300).optional(),
20
+ }),
21
+ z.object({
22
+ kind: z.literal("tool"),
23
+ id: text(200),
24
+ name: text(80),
25
+ state: z.enum(["running", "ok", "error"]),
26
+ detail: text(2000).nullable().optional(),
27
+ ms: z.number().nullable().optional(),
28
+ }),
29
+ z.object({ kind: z.literal("note"), id: text(120), text: text(2000) }),
30
+ ]);
31
+ export type ConversationEntry = z.infer<typeof conversationEntry>;
32
+
33
+ /* a card Omni staged, and what became of it */
34
+ export const conversationAction = z.object({
35
+ id: text(40),
36
+ kind: text(40),
37
+ slug: text(120).nullable().optional(),
38
+ summary: text(2000),
39
+ state: z.enum(["staged", "confirmed", "failed", "canceled"]),
40
+ at: text(40),
41
+ });
42
+ export type ConversationAction = z.infer<typeof conversationAction>;
43
+
44
+ /* POST /api/agent/conversations/:id: the whole conversation so far (each save replaces the last) */
45
+ export const conversationSaveBody = z.object({
46
+ mode: z.enum(["grok", "stream", "chunks"]),
47
+ /* the voice sessions it used (a continued conversation adds one each time) */
48
+ sessions: z.array(text(100)).max(50),
49
+ entries: z.array(conversationEntry).max(600),
50
+ actions: z.array(conversationAction).max(100),
51
+ started_at: text(40),
52
+ });
53
+ export type ConversationSaveBody = z.infer<typeof conversationSaveBody>;
54
+
55
+ /* GET /api/agent/conversations/:id: what is kept, with the title (the first request) and when */
56
+ export type Conversation = ConversationSaveBody & {
57
+ id: string;
58
+ title: string;
59
+ created_at: string;
60
+ updated_at: string;
61
+ };
62
+ /* GET /api/agent/conversations: the list, newest first */
63
+ export type ConversationSummary = {
64
+ id: string;
65
+ title: string;
66
+ mode: Conversation["mode"];
67
+ created_at: string;
68
+ updated_at: string;
69
+ /* what the user said, and the cards it staged and confirmed */
70
+ messages: number;
71
+ actions: number;
72
+ confirmed: number;
73
+ };
@@ -0,0 +1,50 @@
1
+ /* Omni, the voice agent (AgentPage): voice choice, the tool calls the browser forwards from Grok,
2
+ the confirmation of a staged publish and the measurement log. */
3
+
4
+ import { z } from "zod";
5
+
6
+ /* POST /api/agent/voice: Omni speaks with the female or the male voice */
7
+ export const agentVoiceBody = z.object({ gender: z.enum(["female", "male"]) });
8
+ export type AgentVoiceBody = z.infer<typeof agentVoiceBody>;
9
+
10
+ /* POST /api/agent/avatar: Omni's face, a seed like a voice's avatar (`h<hue>-<suffix>`) */
11
+ export const AVATAR_SEED = /^[\w-]{1,40}$/;
12
+ export const agentAvatarBody = z.object({ avatar: z.string().regex(AVATAR_SEED) });
13
+ export type AgentAvatarBody = z.infer<typeof agentAvatarBody>;
14
+
15
+ /* POST /api/agent/session: a new Grok session, or `resume` (its id) to wake a call that slept waiting
16
+ for the studio's work */
17
+ export const agentSessionBody = z.object({ resume: z.string().max(100).optional() });
18
+ export type AgentSessionBody = z.infer<typeof agentSessionBody>;
19
+
20
+ /* POST /api/agent/tools: one function call from Grok, as it arrived (arguments is a JSON string) */
21
+ export const agentToolBody = z.object({
22
+ session: z.string(),
23
+ call_id: z.string(),
24
+ name: z.string(),
25
+ arguments: z.string(),
26
+ /* how many times the user spoke so far in this call (the page counts): confirm_action needs the
27
+ user to have spoken after the card appeared */
28
+ heard: z.number().int().min(0).optional(),
29
+ });
30
+ export type AgentToolBody = z.infer<typeof agentToolBody>;
31
+
32
+ /* POST /api/agent/sessions/:id/log: what the browser measures */
33
+ export const agentLogBody = z.discriminatedUnion("type", [
34
+ /* end of the user's speech → first audio of the reply */
35
+ z.object({ type: z.literal("turn"), latency_ms: z.number(), item: z.string().optional() }),
36
+ z.object({ type: z.literal("feedback"), item: z.string(), value: z.enum(["up", "down", "none"]) }),
37
+ /* reason "wait": the call only went to sleep (wait_for_work); its cards stay */
38
+ z.object({ type: z.literal("end"), duration_s: z.number(), reason: z.string().optional() }),
39
+ z.object({ type: z.literal("error"), message: z.string() }),
40
+ ]);
41
+ export type AgentLogBody = z.infer<typeof agentLogBody>;
42
+
43
+ /* POST /api/agent/stt: Claude mode, the page's recording as PCM16 mono 24 kHz in base64 (≤ 2 min) */
44
+ export const agentSttBody = z.object({ session: z.string().max(100), audio: z.string().max(8_000_000) });
45
+ export type AgentSttBody = z.infer<typeof agentSttBody>;
46
+
47
+ /* POST /api/agent/hotword: the start of an utterance heard with the panel closed (lib/omni-hotword.ts),
48
+ PCM16 mono 24 kHz in base64 (≤ ~3 s) */
49
+ export const agentHotwordBody = z.object({ audio: z.string().max(400_000) });
50
+ export type AgentHotwordBody = z.infer<typeof agentHotwordBody>;
@@ -0,0 +1,6 @@
1
+ /* Analytics (AnalyticsPage): Claude's analysis of the channel or of one Reel. */
2
+
3
+ import { z } from "zod";
4
+
5
+ export const analyzeBody = z.object({ slug: z.string().optional(), focus: z.string().optional() });
6
+ export type AnalyzeBody = z.infer<typeof analyzeBody>;
@@ -0,0 +1,22 @@
1
+ /* Script and scene approval (ScriptApprovalPanel, ScenesApprovalPanel). */
2
+
3
+ import { z } from "zod";
4
+
5
+ /* POST …/scenes/decide */
6
+ export const sceneDecisionBody = z.object({
7
+ scene: z.string(),
8
+ decision: z.enum(["approve", "change"]),
9
+ comment: z.string().optional(),
10
+ });
11
+ export type SceneDecisionBody = z.infer<typeof sceneDecisionBody>;
12
+
13
+ /* POST …/script/decide */
14
+ export const scriptDecisionBody = z.object({
15
+ decision: z.enum(["approve", "change"]),
16
+ comment: z.string().optional(),
17
+ });
18
+ export type ScriptDecisionBody = z.infer<typeof scriptDecisionBody>;
19
+
20
+ /* POST …/script/edit: the script text written on the UI (which approves it) */
21
+ export const scriptEditBody = z.object({ text: z.string() });
22
+ export type ScriptEditBody = z.infer<typeof scriptEditBody>;
@@ -0,0 +1,19 @@
1
+ /* Captions (CaptionPositionEditor): the frame query, position and text edits. */
2
+
3
+ import { z } from "zod";
4
+
5
+ /* GET /api/videos/:slug/captions/frame?t=<seconds> */
6
+ export const frameQuery = z.object({ t: z.string().optional() });
7
+
8
+ /* POST …/captions/position: one scope at a time; `value` is checked field by field by the service
9
+ (null clears a scene's or caption's own position) */
10
+ export const captionPositionBody = z.object({
11
+ scope: z.enum(["video", "scene", "caption"]),
12
+ target: z.string().optional(),
13
+ value: z.unknown(),
14
+ });
15
+ export type CaptionPositionBody = z.infer<typeof captionPositionBody>;
16
+
17
+ /* POST …/captions/text */
18
+ export const captionTextBody = z.object({ id: z.string(), text: z.string() });
19
+ export type CaptionTextBody = z.infer<typeof captionTextBody>;
@@ -0,0 +1,26 @@
1
+ /* The content's Instagram carousel (Carousel* stages). */
2
+
3
+ import { z } from "zod";
4
+
5
+ /* POST /api/videos/:slug/carousel/create */
6
+ export const carouselCreateBody = z.object({ note: z.string().optional() });
7
+ export type CarouselCreateBody = z.infer<typeof carouselCreateBody>;
8
+
9
+ /* POST …/carousel/adjust: a change on one slide (sNN) or on the whole carousel */
10
+ export const carouselAdjustBody = z.object({
11
+ request: z.string(),
12
+ slide: z.string().optional(),
13
+ stage: z.enum(["script", "composition"]).optional(),
14
+ });
15
+ export type CarouselAdjustBody = z.infer<typeof carouselAdjustBody>;
16
+
17
+ /* POST …/carousel/caption */
18
+ export const carouselCaptionBody = z.object({ caption: z.string() });
19
+ export type CarouselCaptionBody = z.infer<typeof carouselCaptionBody>;
20
+
21
+ /* POST …/carousel/publish: the caption (saved first) and "again" */
22
+ export const carouselPublishBody = z.object({
23
+ caption: z.string().nullish(),
24
+ republish: z.boolean().optional(),
25
+ });
26
+ export type CarouselPublishBody = z.infer<typeof carouselPublishBody>;