@adminide-stack/yantra-mobile 12.0.129-alpha.0 → 12.0.129-alpha.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 (360) hide show
  1. package/lib/compute.js +57 -1
  2. package/lib/compute.js.map +1 -1
  3. package/lib/features/agent-chat/NativeAgentChat.js +3 -2
  4. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  5. package/lib/features/apps/AppsCatalog.js +10 -0
  6. package/lib/features/apps/AppsCatalog.js.map +1 -1
  7. package/lib/features/apps/mobileAppCatalog.js +11 -0
  8. package/lib/features/apps/mobileAppCatalog.js.map +1 -1
  9. package/lib/features/canvas/AudioEditorExperience.js +448 -105
  10. package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
  11. package/lib/features/canvas/CanvasAgentChatPane.js +33 -14
  12. package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
  13. package/lib/features/canvas/CanvasBoardsGrid.js +493 -41
  14. package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
  15. package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
  16. package/lib/features/canvas/CanvasEditToolsPanel.js +37 -1
  17. package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
  18. package/lib/features/canvas/CanvasExperience.js +237 -22
  19. package/lib/features/canvas/CanvasExperience.js.map +1 -1
  20. package/lib/features/canvas/CanvasGeneratePanel.js +119 -26
  21. package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
  22. package/lib/features/canvas/CanvasLooksPanel.js +17 -6
  23. package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
  24. package/lib/features/canvas/CanvasTasksPanel.js +18 -1
  25. package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
  26. package/lib/features/canvas/DesignCategoryGallery.js +423 -0
  27. package/lib/features/canvas/DesignCategoryGallery.js.map +1 -0
  28. package/lib/features/canvas/ImageEditorExperience.js +763 -187
  29. package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
  30. package/lib/features/canvas/SetStudioExperience.js +199 -11
  31. package/lib/features/canvas/SetStudioExperience.js.map +1 -1
  32. package/lib/features/canvas/VideoEditorExperience.js +59 -40
  33. package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
  34. package/lib/features/canvas/VideoGeneratorExperience.js +134 -34
  35. package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
  36. package/lib/features/canvas/aiEdit.js +4 -2
  37. package/lib/features/canvas/aiEdit.js.map +1 -1
  38. package/lib/features/canvas/audioEditor/AudioWaveform.js +96 -0
  39. package/lib/features/canvas/audioEditor/AudioWaveform.js.map +1 -0
  40. package/lib/features/canvas/audioEditor/audioPeaks.js +93 -0
  41. package/lib/features/canvas/audioEditor/audioPeaks.js.map +1 -0
  42. package/lib/features/canvas/canvasTaskSync.js +34 -7
  43. package/lib/features/canvas/canvasTaskSync.js.map +1 -1
  44. package/lib/features/canvas/canvasTasks.js +23 -3
  45. package/lib/features/canvas/canvasTasks.js.map +1 -1
  46. package/lib/features/canvas/canvasTheme.js +10 -24
  47. package/lib/features/canvas/canvasTheme.js.map +1 -1
  48. package/lib/features/canvas/canvasUi.js +1 -1
  49. package/lib/features/canvas/canvasUi.js.map +1 -1
  50. package/lib/features/canvas/createTiles.js +17 -9
  51. package/lib/features/canvas/createTiles.js.map +1 -1
  52. package/lib/features/canvas/deepLinks.js +35 -5
  53. package/lib/features/canvas/deepLinks.js.map +1 -1
  54. package/lib/features/canvas/designCatalog.js +165 -0
  55. package/lib/features/canvas/designCatalog.js.map +1 -0
  56. package/lib/features/canvas/designCategories.js +262 -0
  57. package/lib/features/canvas/designCategories.js.map +1 -0
  58. package/lib/features/canvas/editorControls.js +406 -0
  59. package/lib/features/canvas/editorControls.js.map +1 -0
  60. package/lib/features/canvas/generationModels.js +5 -3
  61. package/lib/features/canvas/generationModels.js.map +1 -1
  62. package/lib/features/canvas/generationTasks.js +162 -0
  63. package/lib/features/canvas/generationTasks.js.map +1 -0
  64. package/lib/features/canvas/generator/BottomSheet.js +167 -0
  65. package/lib/features/canvas/generator/BottomSheet.js.map +1 -0
  66. package/lib/features/canvas/generator/BusinessCardChatCard.js +155 -0
  67. package/lib/features/canvas/generator/BusinessCardChatCard.js.map +1 -0
  68. package/lib/features/canvas/generator/DirectorSheet.js +163 -0
  69. package/lib/features/canvas/generator/DirectorSheet.js.map +1 -0
  70. package/lib/features/canvas/generator/ReframePreview.js +122 -0
  71. package/lib/features/canvas/generator/ReframePreview.js.map +1 -0
  72. package/lib/features/canvas/generator/RunLogCard.js +119 -0
  73. package/lib/features/canvas/generator/RunLogCard.js.map +1 -0
  74. package/lib/features/canvas/generator/ShotPanel.js +261 -0
  75. package/lib/features/canvas/generator/ShotPanel.js.map +1 -0
  76. package/lib/features/canvas/generator/businessCardWidget.js +117 -0
  77. package/lib/features/canvas/generator/businessCardWidget.js.map +1 -0
  78. package/lib/features/canvas/generator/cameraVocabulary.js +142 -0
  79. package/lib/features/canvas/generator/cameraVocabulary.js.map +1 -0
  80. package/lib/features/canvas/generator/cinematicVocabulary.js +416 -0
  81. package/lib/features/canvas/generator/cinematicVocabulary.js.map +1 -0
  82. package/lib/features/canvas/generator/direction.js +41 -0
  83. package/lib/features/canvas/generator/direction.js.map +1 -0
  84. package/lib/features/canvas/generator/reframeGeometry.js +108 -0
  85. package/lib/features/canvas/generator/reframeGeometry.js.map +1 -0
  86. package/lib/features/canvas/generator/runLog.js +71 -0
  87. package/lib/features/canvas/generator/runLog.js.map +1 -0
  88. package/lib/features/canvas/generator/shot.js +133 -0
  89. package/lib/features/canvas/generator/shot.js.map +1 -0
  90. package/lib/features/canvas/generator/useShotSpec.js +87 -0
  91. package/lib/features/canvas/generator/useShotSpec.js.map +1 -0
  92. package/lib/features/canvas/home/HeroComposer.js +214 -0
  93. package/lib/features/canvas/home/HeroComposer.js.map +1 -0
  94. package/lib/features/canvas/home/HeroMonitor.js +225 -0
  95. package/lib/features/canvas/home/HeroMonitor.js.map +1 -0
  96. package/lib/features/canvas/home/LookDetail.js +185 -0
  97. package/lib/features/canvas/home/LookDetail.js.map +1 -0
  98. package/lib/features/canvas/home/LoopingVideo.js +37 -0
  99. package/lib/features/canvas/home/LoopingVideo.js.map +1 -0
  100. package/lib/features/canvas/home/TemplatesGallery.js +253 -0
  101. package/lib/features/canvas/home/TemplatesGallery.js.map +1 -0
  102. package/lib/features/canvas/home/heroShots.js +100 -0
  103. package/lib/features/canvas/home/heroShots.js.map +1 -0
  104. package/lib/features/canvas/homeWork.js +62 -3
  105. package/lib/features/canvas/homeWork.js.map +1 -1
  106. package/lib/features/canvas/imageEditor/ImageMarkup.js +195 -0
  107. package/lib/features/canvas/imageEditor/ImageMarkup.js.map +1 -0
  108. package/lib/features/canvas/imageEditor/imageEditOps.js +367 -0
  109. package/lib/features/canvas/imageEditor/imageEditOps.js.map +1 -0
  110. package/lib/features/canvas/nativeViewerRegistry.js.map +1 -1
  111. package/lib/features/canvas/rankedCatalogSearch.js +375 -0
  112. package/lib/features/canvas/rankedCatalogSearch.js.map +1 -0
  113. package/lib/features/canvas/recorder/CameraRecorderExperience.js +68 -20
  114. package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
  115. package/lib/features/canvas/recorder/RecordingReview.js +272 -0
  116. package/lib/features/canvas/recorder/RecordingReview.js.map +1 -0
  117. package/lib/features/canvas/recorder/RecordingsList.js +179 -0
  118. package/lib/features/canvas/recorder/RecordingsList.js.map +1 -0
  119. package/lib/features/canvas/recorder/recorderOps.js +99 -0
  120. package/lib/features/canvas/recorder/recorderOps.js.map +1 -0
  121. package/lib/features/canvas/seedanceShowcase.js +314 -0
  122. package/lib/features/canvas/seedanceShowcase.js.map +1 -0
  123. package/lib/features/canvas/serverTasks.js +149 -15
  124. package/lib/features/canvas/serverTasks.js.map +1 -1
  125. package/lib/features/canvas/sessionRenewal.js +114 -0
  126. package/lib/features/canvas/sessionRenewal.js.map +1 -0
  127. package/lib/features/canvas/set/SetViewportWebView.js +34 -1
  128. package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
  129. package/lib/features/canvas/set/agent/setTurn.js +4 -2
  130. package/lib/features/canvas/set/agent/setTurn.js.map +1 -1
  131. package/lib/features/canvas/set/setPresets.js +85 -0
  132. package/lib/features/canvas/set/setPresets.js.map +1 -0
  133. package/lib/features/canvas/set/setProject.js +4 -1
  134. package/lib/features/canvas/set/setProject.js.map +1 -1
  135. package/lib/features/canvas/studioCatalog.js +59 -4
  136. package/lib/features/canvas/studioCatalog.js.map +1 -1
  137. package/lib/features/canvas/studioLooks.js +31 -4
  138. package/lib/features/canvas/studioLooks.js.map +1 -1
  139. package/lib/features/canvas/surfaceIndex.js +1 -14
  140. package/lib/features/canvas/surfaceIndex.js.map +1 -1
  141. package/lib/features/canvas/templateSearch.js +489 -0
  142. package/lib/features/canvas/templateSearch.js.map +1 -0
  143. package/lib/features/canvas/useCanvasSession.js +28 -6
  144. package/lib/features/canvas/useCanvasSession.js.map +1 -1
  145. package/lib/features/canvas/useStudioCatalogTemplates.js +41 -5
  146. package/lib/features/canvas/useStudioCatalogTemplates.js.map +1 -1
  147. package/lib/features/canvas/videoEditor/EditorPanels.js +531 -0
  148. package/lib/features/canvas/videoEditor/EditorPanels.js.map +1 -0
  149. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +48 -4
  150. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
  151. package/lib/features/canvas/videoEditor/agent/agentLoop.js +2 -0
  152. package/lib/features/canvas/videoEditor/agent/agentLoop.js.map +1 -1
  153. package/lib/features/canvas/videoEditor/agent/brainClient.js +97 -27
  154. package/lib/features/canvas/videoEditor/agent/brainClient.js.map +1 -1
  155. package/lib/features/canvas/videoEditor/agent/cutTools.js +707 -3
  156. package/lib/features/canvas/videoEditor/agent/cutTools.js.map +1 -1
  157. package/lib/features/canvas/videoEditor/audioServices.js +165 -0
  158. package/lib/features/canvas/videoEditor/audioServices.js.map +1 -0
  159. package/lib/features/canvas/videoEditor/captions.js +144 -0
  160. package/lib/features/canvas/videoEditor/captions.js.map +1 -0
  161. package/lib/features/canvas/videoEditor/compileTimeline.js +24 -16
  162. package/lib/features/canvas/videoEditor/compileTimeline.js.map +1 -1
  163. package/lib/features/canvas/videoEditor/editorModel.js +12 -2
  164. package/lib/features/canvas/videoEditor/editorModel.js.map +1 -1
  165. package/lib/features/canvas/videoEditor/exportTask.js +89 -7
  166. package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
  167. package/lib/features/canvas/videoEditor/layers.js +117 -0
  168. package/lib/features/canvas/videoEditor/layers.js.map +1 -0
  169. package/lib/features/canvas/videoEditor/remoteMediaClient.js +45 -18
  170. package/lib/features/canvas/videoEditor/remoteMediaClient.js.map +1 -1
  171. package/lib/features/canvas/videoEditor/renderTimeline.js +18 -6
  172. package/lib/features/canvas/videoEditor/renderTimeline.js.map +1 -1
  173. package/lib/features/canvas/videoEditor/revoice.js +138 -0
  174. package/lib/features/canvas/videoEditor/revoice.js.map +1 -0
  175. package/lib/features/canvas/videoEditor/storageUpload.js +34 -0
  176. package/lib/features/canvas/videoEditor/storageUpload.js.map +1 -0
  177. package/lib/features/canvas/videoEditor/textMotion.js +109 -0
  178. package/lib/features/canvas/videoEditor/textMotion.js.map +1 -0
  179. package/lib/features/canvas/videoEditor/transitions.js +31 -0
  180. package/lib/features/canvas/videoEditor/transitions.js.map +1 -0
  181. package/lib/features/chat/TemplatesChatCards.js +8 -3
  182. package/lib/features/chat/TemplatesChatCards.js.map +1 -1
  183. package/lib/features/design/DesignEditorExperience.js +674 -644
  184. package/lib/features/design/DesignEditorExperience.js.map +1 -1
  185. package/lib/features/design/DesignExperience.js +285 -538
  186. package/lib/features/design/DesignExperience.js.map +1 -1
  187. package/lib/features/design/designCore.js +2 -212
  188. package/lib/features/design/designCore.js.map +1 -1
  189. package/lib/features/design/designIndex.js +1 -50
  190. package/lib/features/design/designIndex.js.map +1 -1
  191. package/lib/features/design/doc/aiDesign.js +247 -0
  192. package/lib/features/design/doc/aiDesign.js.map +1 -0
  193. package/lib/features/design/doc/artifacts.js +280 -0
  194. package/lib/features/design/doc/artifacts.js.map +1 -0
  195. package/lib/features/design/doc/chart.js +98 -0
  196. package/lib/features/design/doc/chart.js.map +1 -0
  197. package/lib/features/design/doc/crop.js +104 -0
  198. package/lib/features/design/doc/crop.js.map +1 -0
  199. package/lib/features/design/doc/curve.js +49 -0
  200. package/lib/features/design/doc/curve.js.map +1 -0
  201. package/lib/features/design/doc/docOps.js +397 -0
  202. package/lib/features/design/doc/docOps.js.map +1 -0
  203. package/lib/features/design/doc/findReplace.js +112 -0
  204. package/lib/features/design/doc/findReplace.js.map +1 -0
  205. package/lib/features/design/doc/fonts.js +79 -0
  206. package/lib/features/design/doc/fonts.js.map +1 -0
  207. package/lib/features/design/doc/frames.js +17 -0
  208. package/lib/features/design/doc/frames.js.map +1 -0
  209. package/lib/features/design/doc/geometry.js +133 -0
  210. package/lib/features/design/doc/geometry.js.map +1 -0
  211. package/lib/features/design/doc/imageAdjust.js +203 -0
  212. package/lib/features/design/doc/imageAdjust.js.map +1 -0
  213. package/lib/features/design/doc/legacyDoc.js +107 -0
  214. package/lib/features/design/doc/legacyDoc.js.map +1 -0
  215. package/lib/features/design/doc/newDoc.js +335 -0
  216. package/lib/features/design/doc/newDoc.js.map +1 -0
  217. package/lib/features/design/doc/pageRange.js +17 -0
  218. package/lib/features/design/doc/pageRange.js.map +1 -0
  219. package/lib/features/design/doc/pathScale.js +68 -0
  220. package/lib/features/design/doc/pathScale.js.map +1 -0
  221. package/lib/features/design/doc/qr.js +62 -0
  222. package/lib/features/design/doc/qr.js.map +1 -0
  223. package/lib/features/design/doc/shapes.js +366 -0
  224. package/lib/features/design/doc/shapes.js.map +1 -0
  225. package/lib/features/design/doc/sizes.js +230 -0
  226. package/lib/features/design/doc/sizes.js.map +1 -0
  227. package/lib/features/design/doc/textEffects.js +134 -0
  228. package/lib/features/design/doc/textEffects.js.map +1 -0
  229. package/lib/features/design/doc/textLayout.js +182 -0
  230. package/lib/features/design/doc/textLayout.js.map +1 -0
  231. package/lib/features/design/doc/types.js +30 -0
  232. package/lib/features/design/doc/types.js.map +1 -0
  233. package/lib/features/design/editor/AiPanel.js +194 -0
  234. package/lib/features/design/editor/AiPanel.js.map +1 -0
  235. package/lib/features/design/editor/ChartDataPanel.js +182 -0
  236. package/lib/features/design/editor/ChartDataPanel.js.map +1 -0
  237. package/lib/features/design/editor/CropOverlay.js +199 -0
  238. package/lib/features/design/editor/CropOverlay.js.map +1 -0
  239. package/lib/features/design/editor/DesignCanvas.js +363 -0
  240. package/lib/features/design/editor/DesignCanvas.js.map +1 -0
  241. package/lib/features/design/editor/ExportSheet.js +123 -0
  242. package/lib/features/design/editor/ExportSheet.js.map +1 -0
  243. package/lib/features/design/editor/FindReplacePanel.js +93 -0
  244. package/lib/features/design/editor/FindReplacePanel.js.map +1 -0
  245. package/lib/features/design/editor/ImageTools.js +188 -0
  246. package/lib/features/design/editor/ImageTools.js.map +1 -0
  247. package/lib/features/design/editor/LayerTools.js +485 -0
  248. package/lib/features/design/editor/LayerTools.js.map +1 -0
  249. package/lib/features/design/editor/PageStrip.js +203 -0
  250. package/lib/features/design/editor/PageStrip.js.map +1 -0
  251. package/lib/features/design/editor/Slideshow.js +97 -0
  252. package/lib/features/design/editor/Slideshow.js.map +1 -0
  253. package/lib/features/design/editor/ToolPanels.js +695 -0
  254. package/lib/features/design/editor/ToolPanels.js.map +1 -0
  255. package/lib/features/design/editor/controls.js +630 -0
  256. package/lib/features/design/editor/controls.js.map +1 -0
  257. package/lib/features/design/editor/useDesignSave.js +91 -0
  258. package/lib/features/design/editor/useDesignSave.js.map +1 -0
  259. package/lib/features/design/export/exportDesign.js +170 -0
  260. package/lib/features/design/export/exportDesign.js.map +1 -0
  261. package/lib/features/design/export/pdf.js +143 -0
  262. package/lib/features/design/export/pdf.js.map +1 -0
  263. package/lib/features/design/home/DesignHome.js +688 -0
  264. package/lib/features/design/home/DesignHome.js.map +1 -0
  265. package/lib/features/design/home/studioHome.js +61 -0
  266. package/lib/features/design/home/studioHome.js.map +1 -0
  267. package/lib/features/design/pickDesignImage.js +60 -0
  268. package/lib/features/design/pickDesignImage.js.map +1 -0
  269. package/lib/features/design/render/DesignPageView.js +69 -0
  270. package/lib/features/design/render/DesignPageView.js.map +1 -0
  271. package/lib/features/design/render/PageCapture.js +288 -0
  272. package/lib/features/design/render/PageCapture.js.map +1 -0
  273. package/lib/features/design/render/TextMeasure.js +115 -0
  274. package/lib/features/design/render/TextMeasure.js.map +1 -0
  275. package/lib/features/design/render/fontRegistry.js +110 -0
  276. package/lib/features/design/render/fontRegistry.js.map +1 -0
  277. package/lib/features/design/render/layers.js +392 -0
  278. package/lib/features/design/render/layers.js.map +1 -0
  279. package/lib/features/design/render/svg.js +35 -0
  280. package/lib/features/design/render/svg.js.map +1 -0
  281. package/lib/features/design/render/svgParts.js +435 -0
  282. package/lib/features/design/render/svgParts.js.map +1 -0
  283. package/lib/features/design/surface/BoardScreen.js +529 -0
  284. package/lib/features/design/surface/BoardScreen.js.map +1 -0
  285. package/lib/features/design/surface/CompareView.js +138 -0
  286. package/lib/features/design/surface/CompareView.js.map +1 -0
  287. package/lib/features/design/surface/CreationScreen.js +294 -0
  288. package/lib/features/design/surface/CreationScreen.js.map +1 -0
  289. package/lib/features/design/surface/DesignAgentChatPane.js +444 -0
  290. package/lib/features/design/surface/DesignAgentChatPane.js.map +1 -0
  291. package/lib/features/design/surface/DesignBoards.js +441 -0
  292. package/lib/features/design/surface/DesignBoards.js.map +1 -0
  293. package/lib/features/design/surface/DesignPreview.js +159 -0
  294. package/lib/features/design/surface/DesignPreview.js.map +1 -0
  295. package/lib/features/design/surface/DesignSurfaceExperience.js +80 -0
  296. package/lib/features/design/surface/DesignSurfaceExperience.js.map +1 -0
  297. package/lib/features/design/surface/FullScreenPreview.js +59 -0
  298. package/lib/features/design/surface/FullScreenPreview.js.map +1 -0
  299. package/lib/features/design/surface/NewSystemDialog.js +122 -0
  300. package/lib/features/design/surface/NewSystemDialog.js.map +1 -0
  301. package/lib/features/design/surface/PickerSheet.js +175 -0
  302. package/lib/features/design/surface/PickerSheet.js.map +1 -0
  303. package/lib/features/design/surface/TemplatesGallery.js +156 -0
  304. package/lib/features/design/surface/TemplatesGallery.js.map +1 -0
  305. package/lib/features/design/surface/WetPaint.js +140 -0
  306. package/lib/features/design/surface/WetPaint.js.map +1 -0
  307. package/lib/features/design/surface/agentTurn.js +229 -0
  308. package/lib/features/design/surface/agentTurn.js.map +1 -0
  309. package/lib/features/design/surface/designBoard.js +218 -0
  310. package/lib/features/design/surface/designBoard.js.map +1 -0
  311. package/lib/features/design/surface/designChannel.js +186 -0
  312. package/lib/features/design/surface/designChannel.js.map +1 -0
  313. package/lib/features/design/surface/designChat.js +141 -0
  314. package/lib/features/design/surface/designChat.js.map +1 -0
  315. package/lib/features/design/surface/designConnector.js +266 -0
  316. package/lib/features/design/surface/designConnector.js.map +1 -0
  317. package/lib/features/design/surface/designDocument.js +40 -0
  318. package/lib/features/design/surface/designDocument.js.map +1 -0
  319. package/lib/features/design/surface/designExport.js +55 -0
  320. package/lib/features/design/surface/designExport.js.map +1 -0
  321. package/lib/features/design/surface/designLinks.js +64 -0
  322. package/lib/features/design/surface/designLinks.js.map +1 -0
  323. package/lib/features/design/surface/designPalette.js +24 -0
  324. package/lib/features/design/surface/designPalette.js.map +1 -0
  325. package/lib/features/design/surface/designRun.js +161 -0
  326. package/lib/features/design/surface/designRun.js.map +1 -0
  327. package/lib/features/design/surface/designTheme.js +119 -0
  328. package/lib/features/design/surface/designTheme.js.map +1 -0
  329. package/lib/features/design/surface/execStream.js +206 -0
  330. package/lib/features/design/surface/execStream.js.map +1 -0
  331. package/lib/features/design/surface/metaball.js +48 -0
  332. package/lib/features/design/surface/metaball.js.map +1 -0
  333. package/lib/features/design/surface/pickReferenceFiles.js +35 -0
  334. package/lib/features/design/surface/pickReferenceFiles.js.map +1 -0
  335. package/lib/features/design/surface/useDesignSurface.js +379 -0
  336. package/lib/features/design/surface/useDesignSurface.js.map +1 -0
  337. package/lib/features/docs/DocBlockRow.js +336 -0
  338. package/lib/features/docs/DocBlockRow.js.map +1 -0
  339. package/lib/features/docs/DocsEditorExperience.js +949 -0
  340. package/lib/features/docs/DocsEditorExperience.js.map +1 -0
  341. package/lib/features/docs/DocsToolbar.js +247 -0
  342. package/lib/features/docs/DocsToolbar.js.map +1 -0
  343. package/lib/features/docs/blocks.js +560 -0
  344. package/lib/features/docs/blocks.js.map +1 -0
  345. package/lib/features/docs/docArtifacts.js +129 -0
  346. package/lib/features/docs/docArtifacts.js.map +1 -0
  347. package/lib/features/docs/docEdits.js +201 -0
  348. package/lib/features/docs/docEdits.js.map +1 -0
  349. package/lib/features/docs/docExport.js +235 -0
  350. package/lib/features/docs/docExport.js.map +1 -0
  351. package/lib/features/docs/docShare.js +62 -0
  352. package/lib/features/docs/docShare.js.map +1 -0
  353. package/lib/features/links/openInApp.js +38 -2
  354. package/lib/features/links/openInApp.js.map +1 -1
  355. package/lib/routes.json +54 -0
  356. package/lib/screens/DesignNative/index.js +35 -0
  357. package/lib/screens/DesignNative/index.js.map +1 -0
  358. package/package.json +3 -3
  359. package/lib/features/design/exportDesign.js +0 -133
  360. package/lib/features/design/exportDesign.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import {removeClip,moveClip,updateClip,clipFromColor,textClipAt}from'../editorModel.js';import {sceneSpans}from'../sceneLayers.js';var __defProp = Object.defineProperty;
1
+ import {removeClip,moveClip,updateClip,clipFromColor,textClipAt,DEFAULT_IMAGE_SEC,clipFromItem}from'../editorModel.js';import {sceneSpans,sceneAtSec}from'../sceneLayers.js';import {captionsForClip,placeCaptions,transcribeMedia}from'../captions.js';import {STOCK_VOICES,speakLine,composeSoundEffect,composeMusic}from'../audioServices.js';import {probeAudioSec}from'../revoice.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -158,7 +158,149 @@ const CUT_AGENT_TOOLS = [{
158
158
  }
159
159
  }
160
160
  }
161
- }];
161
+ }, ...MEDIA_TOOL_SCHEMAS()];
162
+ function tool(name, description, properties, required = []) {
163
+ return {
164
+ type: "function",
165
+ function: {
166
+ name,
167
+ description,
168
+ parameters: {
169
+ type: "object",
170
+ properties,
171
+ required
172
+ }
173
+ }
174
+ };
175
+ }
176
+ function sceneEntry() {
177
+ return {
178
+ type: "object",
179
+ properties: {
180
+ asset_id: {
181
+ type: "string",
182
+ description: "Library item or timeline clip id (video or image) to cut from. Omit for a scene to film."
183
+ },
184
+ in_sec: {
185
+ type: "number",
186
+ description: "Start inside the source clip, seconds. Omit for the head."
187
+ },
188
+ out_sec: {
189
+ type: "number",
190
+ description: "End inside the source clip, seconds. For a still: how long it holds."
191
+ },
192
+ label: {
193
+ type: "string",
194
+ description: "Short scene name shown on the timeline."
195
+ },
196
+ shot: {
197
+ type: "string",
198
+ description: "A scene to FILM instead of cutting from the library: subject, setting, action, light, camera move. Picture only. Then call film_scenes."
199
+ },
200
+ seconds: {
201
+ type: "number",
202
+ description: "How long a scene to film plays (default 6, 2-15)."
203
+ }
204
+ }
205
+ };
206
+ }
207
+ const MEDIA_TOOL_NAMES = ["analyze_footage", "read_document", "get_transcript", "search_dialogue", "import_link", "set_cut", "add_music", "add_sound_effect", "add_voiceover", "add_captions", "set_format"];
208
+ function MEDIA_TOOL_SCHEMAS() {
209
+ return [tool("analyze_footage", "Learn the dialogue (timed transcript) and, when available, what each library item or clip shows. Cached per item: analyzing again is free. Call before cutting footage you have not seen.", {
210
+ asset_ids: {
211
+ type: "array",
212
+ items: {
213
+ type: "string"
214
+ },
215
+ description: "Only these items; omit for every item not yet analyzed."
216
+ },
217
+ visual: {
218
+ type: "boolean",
219
+ description: "Describe what the picture shows (default true)."
220
+ }
221
+ }), tool("read_document", "The full text of an uploaded document (screenplay, shot list, brief).", {
222
+ document_id: {
223
+ type: "string"
224
+ }
225
+ }, ["document_id"]), tool("get_transcript", "Every dialogue cue of one item with source timings, once it has been analyzed.", {
226
+ asset_id: {
227
+ type: "string"
228
+ }
229
+ }, ["asset_id"]), tool("search_dialogue", "Find where words are spoken across the analyzed media: returns the best-matching cues with their item id and source timings.", {
230
+ query: {
231
+ type: "string",
232
+ description: "Words or a line of dialogue to look for."
233
+ },
234
+ limit: {
235
+ type: "number",
236
+ description: "Max results (default 12)."
237
+ }
238
+ }, ["query"]), tool("import_link", "Take a web link into the library: a direct picture, video or sound file, or a page (its preview picture or video). Links in the user's current message are already taken in; use this for a link from an earlier message.", {
239
+ url: {
240
+ type: "string"
241
+ }
242
+ }, ["url"]), tool("set_cut", 'Lay scenes on the timeline back to back. Each scene is cut from library footage (asset_id) or is a shot to film (shot + seconds). mode "replace" swaps the whole cut; "append" adds after the last scene. Returns the new scene ids.', {
243
+ scenes: {
244
+ type: "array",
245
+ items: sceneEntry(),
246
+ description: "Scenes in play order."
247
+ },
248
+ mode: {
249
+ type: "string",
250
+ enum: ["replace", "append"],
251
+ description: 'Default "replace".'
252
+ }
253
+ }, ["scenes"]), tool("add_music", "Generate a music bed from a mood description and lay it under the cut (mixed under the other audio). Takes a minute or two.", {
254
+ prompt: {
255
+ type: "string",
256
+ description: "Mood, genre, instrumentation, tempo, build."
257
+ },
258
+ duration_sec: {
259
+ type: "number",
260
+ description: "Length wanted (default: the cut's length, max 180)."
261
+ },
262
+ at_sec: {
263
+ type: "number",
264
+ description: "Timeline second it starts (default 0)."
265
+ }
266
+ }, ["prompt"]), tool("add_sound_effect", "Generate one sound effect (a hit, riser, whoosh, ambience) and place it at a timeline second.", {
267
+ prompt: {
268
+ type: "string"
269
+ },
270
+ at_sec: {
271
+ type: "number"
272
+ },
273
+ duration_sec: {
274
+ type: "number",
275
+ description: "Default 2, max 20."
276
+ }
277
+ }, ["prompt", "at_sec"]), tool("add_voiceover", "Speak a line with a synthetic voice and place it at a timeline second; it moves with the scene it lands in.", {
278
+ text: {
279
+ type: "string"
280
+ },
281
+ at_sec: {
282
+ type: "number",
283
+ description: "Default: after the last voiceover line, else 0."
284
+ },
285
+ voice: {
286
+ type: "string",
287
+ enum: STOCK_VOICES.map((v) => v.id),
288
+ description: "Default: the studio's first voice."
289
+ }
290
+ }, ["text"]), tool("add_captions", "Captions from the dialogue of the given scenes (default: every video scene); transcribes what is not analyzed yet.", {
291
+ scene_ids: {
292
+ type: "array",
293
+ items: {
294
+ type: "string"
295
+ }
296
+ }
297
+ }), tool("set_format", "Output aspect: 16:9, 9:16, 1:1, 4:5, or auto (source).", {
298
+ aspect: {
299
+ type: "string",
300
+ enum: ["16:9", "9:16", "1:1", "4:5", "auto"]
301
+ }
302
+ }, ["aspect"])];
303
+ }
162
304
  async function executeCutTool(name, rawArgs, ctx) {
163
305
  var _a, _b;
164
306
  const args = rawArgs && typeof rawArgs === "object" ? rawArgs : {};
@@ -321,9 +463,571 @@ async function executeCutTool(name, rawArgs, ctx) {
321
463
  content: `filming ${ids.length} scene(s); each lands in place in a few minutes`
322
464
  };
323
465
  }
466
+ if (MEDIA_TOOL_NAMES.includes(name)) {
467
+ try {
468
+ return await executeMediaTool(name, args, ctx);
469
+ } catch (err) {
470
+ const message = err instanceof Error ? err.message : String(err);
471
+ const kind = err instanceof ToolInputError ? "bad arguments" : "failed";
472
+ return {
473
+ ok: false,
474
+ label: `${name.replace(/_/g, " ")} ${kind}`,
475
+ detail: message.slice(0, 80),
476
+ content: `error (${kind}): ${message}`
477
+ };
478
+ }
479
+ }
324
480
  return {
325
481
  ok: false,
326
482
  label: name,
327
483
  content: `Unknown tool ${name}`
328
484
  };
329
- }export{CUT_AGENT_TOOLS,SHOT_SEC_RANGE,executeCutTool};//# sourceMappingURL=cutTools.js.map
485
+ }
486
+ class ToolInputError extends Error {
487
+ }
488
+ function str(args, key, required = false) {
489
+ const v = args[key];
490
+ if (v == null || v === "") {
491
+ if (required) throw new ToolInputError(`missing "${key}"`);
492
+ return void 0;
493
+ }
494
+ if (typeof v !== "string") throw new ToolInputError(`"${key}" must be a string`);
495
+ return v;
496
+ }
497
+ function num(args, key) {
498
+ const v = args[key];
499
+ if (v == null || v === "") return void 0;
500
+ const n = typeof v === "number" ? v : Number(v);
501
+ if (!Number.isFinite(n)) throw new ToolInputError(`"${key}" must be a number of seconds`);
502
+ return n;
503
+ }
504
+ function strList(args, key, required = false) {
505
+ const v = args[key];
506
+ if (v == null) {
507
+ if (required) throw new ToolInputError(`missing "${key}"`);
508
+ return void 0;
509
+ }
510
+ if (!Array.isArray(v)) throw new ToolInputError(`"${key}" must be an array of ids`);
511
+ return v.map((x) => String(x));
512
+ }
513
+ const secs = (n) => `${n.toFixed(1)}s`;
514
+ const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
515
+ const excerpt = (s, n) => s.length > n ? `${s.slice(0, n - 1)}\u2026` : s;
516
+ function withNotes(text, notes) {
517
+ return notes.length ? `${text}
518
+ Notes: ${notes.join("; ")}` : text;
519
+ }
520
+ const DOCUMENT_CHAR_CAP = 6e4;
521
+ const TRANSCRIPT_CUE_CAP = 400;
522
+ const DEFAULT_MUSIC_SEC = 60;
523
+ const MAX_MUSIC_SEC = 180;
524
+ const DEFAULT_SFX_SEC = 2;
525
+ const FORMAT_ASPECTS = {
526
+ "16:9": "16:9",
527
+ "9:16": "9:16",
528
+ "1:1": "1:1",
529
+ "4:5": "4:5",
530
+ auto: null
531
+ };
532
+ function agentLibrary(ctx) {
533
+ var _a, _b;
534
+ const out = [...(_b = (_a = ctx.library) == null ? void 0 : _a.call(ctx)) != null ? _b : []];
535
+ const seen = new Set(out.map((i) => i.id));
536
+ for (const c of ctx.getTimeline().clips) {
537
+ if (c.fillColor || seen.has(c.id)) continue;
538
+ out.push({
539
+ id: c.id,
540
+ type: c.type,
541
+ src: c.src,
542
+ name: c.name
543
+ });
544
+ }
545
+ return out;
546
+ }
547
+ function needRun(ctx, what) {
548
+ if (!ctx.runAction) throw new Error(`${what} is not available here`);
549
+ return ctx.runAction;
550
+ }
551
+ function cache(ctx) {
552
+ if (!ctx.analyses) ctx.analyses = /* @__PURE__ */ new Map();
553
+ return ctx.analyses;
554
+ }
555
+ function cutSec(t, sourceSec) {
556
+ const spans = sceneSpans(t.clips, sourceSec);
557
+ return spans.length ? spans[spans.length - 1].endSec : 0;
558
+ }
559
+ let audioCounter = 0;
560
+ function sceneAudioAt(t, audio, sourceSec) {
561
+ audioCounter += 1;
562
+ const scene = sceneAtSec(sceneSpans(t.clips, sourceSec), audio.startSec);
563
+ return __spreadValues(__spreadProps(__spreadValues({
564
+ id: `agent-audio-${Date.now().toString(36)}-${audioCounter}`
565
+ }, audio), {
566
+ startSec: Math.round(audio.startSec * 1e3) / 1e3
567
+ }), scene ? {
568
+ sceneId: scene.id
569
+ } : {});
570
+ }
571
+ async function analyzeItem(item, ctx, visual) {
572
+ var _a, _b, _c, _d, _e;
573
+ const seed = cache(ctx).get(item.src);
574
+ const problems = [];
575
+ let transcript = (_a = seed == null ? void 0 : seed.transcript) != null ? _a : [];
576
+ const timed = item.type === "video" || item.type === "audio";
577
+ if (timed && !seed) {
578
+ if (ctx.runAction) {
579
+ try {
580
+ transcript = await transcribeMedia(ctx.runAction, item.src);
581
+ } catch (err) {
582
+ problems.push(`transcription failed: ${err instanceof Error ? err.message : String(err)}`);
583
+ }
584
+ } else problems.push("transcription is not available here");
585
+ }
586
+ const clip = ctx.getTimeline().clips.find((c) => c.id === item.id);
587
+ const durationSec = (seed == null ? void 0 : seed.durationSec) || (clip ? clip.type === "image" ? (_b = clip.durationSec) != null ? _b : DEFAULT_IMAGE_SEC : (_e = (_d = (_c = ctx.sourceSec) == null ? void 0 : _c.call(ctx)[clip.id]) != null ? _d : clip.trimEndSec) != null ? _e : 0 : 0) || (transcript.length ? transcript[transcript.length - 1].end : 0);
588
+ let description = seed == null ? void 0 : seed.description;
589
+ if (visual && ctx.describe && !description && item.type !== "audio") {
590
+ try {
591
+ let picture = item.type === "image" ? item.src : null;
592
+ if (!picture && ctx.runAction) {
593
+ const r = await ctx.runAction("yantra-video-editing", "YANTRA_VIDEO_EDIT_CONTACT_SHEET", {
594
+ input_url: item.src,
595
+ cols: 3,
596
+ rows: 2,
597
+ thumb_width: 320
598
+ });
599
+ const root = r.data && typeof r.data === "object" ? r.data : r;
600
+ picture = typeof root.output_url === "string" && root.output_url ? root.output_url : null;
601
+ }
602
+ if (picture) {
603
+ description = await ctx.describe(picture, item.type === "image" ? "This is a still image from a video project." : "This is a contact sheet of six frames from one video clip, left to right then top to bottom, in time order.");
604
+ } else problems.push("no frames could be rendered for the visual pass");
605
+ } catch (err) {
606
+ problems.push(`visual pass failed: ${err instanceof Error ? err.message : String(err)}`);
607
+ }
608
+ }
609
+ const analysis = __spreadValues({
610
+ durationSec,
611
+ transcript
612
+ }, description ? {
613
+ description
614
+ } : {});
615
+ cache(ctx).set(item.src, analysis);
616
+ return {
617
+ analysis,
618
+ problems
619
+ };
620
+ }
621
+ function summarize(item, an, problems) {
622
+ const bits = [`id=${item.id} "${item.name}" (${item.type})`];
623
+ if (an.durationSec > 0) bits.push(secs(an.durationSec));
624
+ if (an.transcript.length) bits.push(`dialogue: "${excerpt(an.transcript.map((c) => c.text).join(" "), 220)}"`);
625
+ else if (item.type !== "image") bits.push("no speech");
626
+ if (an.description) bits.push(`looks: ${an.description}`);
627
+ if (problems.length) bits.push(`(${problems.join("; ")})`);
628
+ return `- ${bits.join(" \xB7 ")}`;
629
+ }
630
+ const tokensOf = (s) => {
631
+ var _a;
632
+ return (_a = s.toLowerCase().match(/[a-z0-9']{3,}/g)) != null ? _a : [];
633
+ };
634
+ function clipForEntry(entry, i, library, timeline) {
635
+ var _a, _b, _c, _d;
636
+ const assetId = (_a = str(entry, "asset_id")) != null ? _a : str(entry, "id");
637
+ const shot = (_b = str(entry, "shot")) == null ? void 0 : _b.trim();
638
+ const label = str(entry, "label");
639
+ if (!assetId) {
640
+ if (!shot) throw new ToolInputError(`scenes[${i}] needs an asset_id from the library or a shot to film`);
641
+ const asked = (_c = num(entry, "seconds")) != null ? _c : SHOT_SEC_RANGE.default;
642
+ const seconds = Math.min(SHOT_SEC_RANGE.max, Math.max(SHOT_SEC_RANGE.min, asked));
643
+ return {
644
+ clip: __spreadProps(__spreadValues({}, clipFromColor("#101014")), {
645
+ name: (label != null ? label : shot).slice(0, 32),
646
+ shot,
647
+ durationSec: seconds
648
+ })
649
+ };
650
+ }
651
+ const onTimeline = timeline.clips.find((c) => c.id === assetId);
652
+ const item = library.find((x) => x.id === assetId);
653
+ if (!onTimeline && !item) return {
654
+ error: `scenes[${i}]: no library item "${assetId}"`
655
+ };
656
+ if ((item == null ? void 0 : item.type) === "audio") return {
657
+ error: `scenes[${i}]: "${assetId}" is audio, not a picture`
658
+ };
659
+ const base = onTimeline ? __spreadValues(__spreadValues(__spreadValues({}, clipFromItem({
660
+ id: onTimeline.itemId,
661
+ type: onTimeline.type,
662
+ src: onTimeline.src,
663
+ generatedAssetName: onTimeline.name
664
+ })), onTimeline.fillColor ? {
665
+ fillColor: onTimeline.fillColor
666
+ } : {}), onTimeline.hasAudio === false ? {
667
+ hasAudio: false
668
+ } : {}) : clipFromItem({
669
+ id: item.id,
670
+ type: item.type,
671
+ src: item.src,
672
+ generatedAssetName: item.name
673
+ });
674
+ const inSec = Math.max(0, (_d = num(entry, "in_sec")) != null ? _d : 0);
675
+ const outSec = num(entry, "out_sec");
676
+ const named = label ? {
677
+ name: label.slice(0, 32)
678
+ } : {};
679
+ if (base.type === "image") {
680
+ const hold = outSec !== void 0 ? Math.max(0.5, outSec - inSec) : DEFAULT_IMAGE_SEC;
681
+ return {
682
+ clip: __spreadProps(__spreadValues(__spreadValues({}, base), named), {
683
+ durationSec: hold
684
+ })
685
+ };
686
+ }
687
+ if (outSec !== void 0 && outSec <= inSec) return {
688
+ error: `scenes[${i}]: out_sec must be after in_sec`
689
+ };
690
+ return {
691
+ clip: __spreadProps(__spreadValues(__spreadValues({}, base), named), {
692
+ trimStartSec: inSec,
693
+ trimEndSec: outSec != null ? outSec : null
694
+ })
695
+ };
696
+ }
697
+ async function executeMediaTool(name, args, ctx) {
698
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
699
+ const sourceSec = (_a = ctx.sourceSec) == null ? void 0 : _a.call(ctx);
700
+ switch (name) {
701
+ case "analyze_footage": {
702
+ const library = agentLibrary(ctx);
703
+ const ids = strList(args, "asset_ids");
704
+ const visual = typeof args.visual === "boolean" ? args.visual : true;
705
+ const missing = [];
706
+ const targets = ids ? ids.flatMap((id) => {
707
+ const a = library.find((x) => x.id === id);
708
+ if (!a) missing.push(`no item "${id}"`);
709
+ return a ? [a] : [];
710
+ }) : library.filter((a) => {
711
+ const an = cache(ctx).get(a.src);
712
+ return !an || visual && ctx.describe && !an.description && a.type !== "audio";
713
+ });
714
+ if (!targets.length) {
715
+ return {
716
+ ok: true,
717
+ label: "Library already analyzed",
718
+ content: withNotes("Everything in the library is already analyzed.", missing)
719
+ };
720
+ }
721
+ const lines = [];
722
+ let spoken = 0;
723
+ for (let i = 0; i < targets.length; i += 1) {
724
+ (_b = ctx.progress) == null ? void 0 : _b.call(ctx, `Scanning ${i + 1}/${targets.length}\u2026`);
725
+ const {
726
+ analysis,
727
+ problems
728
+ } = await analyzeItem(targets[i], ctx, visual);
729
+ if (analysis.transcript.length) spoken += 1;
730
+ lines.push(summarize(targets[i], analysis, problems));
731
+ }
732
+ return {
733
+ ok: true,
734
+ label: `Scanned ${plural(targets.length, "clip")}`,
735
+ detail: `${spoken} with dialogue`,
736
+ content: withNotes(`Analyzed ${plural(targets.length, "item")}:
737
+ ${lines.join("\n")}`, missing)
738
+ };
739
+ }
740
+ case "read_document": {
741
+ const id = str(args, "document_id", true);
742
+ const docs = (_d = (_c = ctx.documents) == null ? void 0 : _c.call(ctx)) != null ? _d : [];
743
+ const doc = (_e = docs.find((d) => d.id === id)) != null ? _e : docs.find((d) => d.name.toLowerCase() === id.toLowerCase());
744
+ if (!doc) throw new ToolInputError(`no document "${id}"; available: ${docs.map((d) => `${d.id} (${d.name})`).join(", ") || "none"}`);
745
+ const cut = doc.text.length > DOCUMENT_CHAR_CAP;
746
+ return {
747
+ ok: true,
748
+ label: `Read ${doc.name}`,
749
+ content: `${doc.name}${cut ? ` (first ${DOCUMENT_CHAR_CAP} of ${doc.text.length} chars)` : ""}:
750
+ ${doc.text.slice(0, DOCUMENT_CHAR_CAP)}`
751
+ };
752
+ }
753
+ case "get_transcript": {
754
+ const id = str(args, "asset_id", true);
755
+ const item = agentLibrary(ctx).find((x) => x.id === id);
756
+ if (!item) throw new ToolInputError(`no library item "${id}"`);
757
+ const cues = (_f = cache(ctx).get(item.src)) == null ? void 0 : _f.transcript;
758
+ if (!cues) return {
759
+ ok: true,
760
+ label: `No transcript for ${item.name}`,
761
+ content: `"${item.name}" is not analyzed yet - call analyze_footage.`
762
+ };
763
+ if (!cues.length) return {
764
+ ok: true,
765
+ label: `No speech in ${item.name}`,
766
+ content: `"${item.name}" has no speech.`
767
+ };
768
+ const lines = cues.slice(0, TRANSCRIPT_CUE_CAP).map((c) => `[${c.start.toFixed(1)}-${c.end.toFixed(1)}] ${c.text}`);
769
+ return {
770
+ ok: true,
771
+ label: `Read transcript of ${item.name}`,
772
+ content: `${item.name} (${plural(cues.length, "cue")}):
773
+ ${lines.join("\n")}`
774
+ };
775
+ }
776
+ case "search_dialogue": {
777
+ const query = str(args, "query", true);
778
+ const limit = Math.max(1, Math.min(40, (_g = num(args, "limit")) != null ? _g : 12));
779
+ const words = new Set(tokensOf(query));
780
+ const needle = query.toLowerCase().trim();
781
+ const hits = [];
782
+ let searched = 0;
783
+ for (const item of agentLibrary(ctx)) {
784
+ const cues = (_h = cache(ctx).get(item.src)) == null ? void 0 : _h.transcript;
785
+ if (!(cues == null ? void 0 : cues.length)) continue;
786
+ searched += 1;
787
+ cues.forEach((c, i) => {
788
+ var _a2, _b2, _c2, _d2;
789
+ const text = c.text.toLowerCase();
790
+ let score = 0;
791
+ for (const w of tokensOf(text)) if (words.has(w)) score += 1;
792
+ if (needle && text.includes(needle)) score += 5;
793
+ if (!score) return;
794
+ const before = (_b2 = (_a2 = cues[i - 1]) == null ? void 0 : _a2.text) != null ? _b2 : "";
795
+ const after = (_d2 = (_c2 = cues[i + 1]) == null ? void 0 : _c2.text) != null ? _d2 : "";
796
+ hits.push({
797
+ score: score / Math.max(1, words.size),
798
+ line: `- ${item.id} "${item.name}" [${c.start.toFixed(1)}-${c.end.toFixed(1)}] "${c.text}"${before || after ? ` (context: \u2026${excerpt(before, 60)} | ${excerpt(after, 60)}\u2026)` : ""}`
799
+ });
800
+ });
801
+ }
802
+ if (!searched) return {
803
+ ok: true,
804
+ label: "Nothing to search",
805
+ content: "No analyzed dialogue yet - call analyze_footage first."
806
+ };
807
+ hits.sort((a, b) => b.score - a.score);
808
+ const top = hits.slice(0, limit);
809
+ return {
810
+ ok: true,
811
+ label: `Searched dialogue for "${excerpt(query, 40)}"`,
812
+ detail: plural(top.length, "match"),
813
+ content: top.length ? `${plural(top.length, "match")} for "${query}":
814
+ ${top.map((h) => h.line).join("\n")}` : `Nothing in the dialogue matches "${query}".`
815
+ };
816
+ }
817
+ case "import_link": {
818
+ const url = str(args, "url", true).trim();
819
+ const known = agentLibrary(ctx).find((a) => a.sourceUrl === url);
820
+ if (known) return {
821
+ ok: true,
822
+ label: `Already have ${known.name}`,
823
+ content: `Already in the library: ${known.type} id=${known.id} "${known.name}".`
824
+ };
825
+ if (!ctx.importLink) throw new Error("taking in links is not available here");
826
+ (_i = ctx.progress) == null ? void 0 : _i.call(ctx, "Opening the link\u2026");
827
+ const got = await ctx.importLink(url);
828
+ let looks = "";
829
+ if (got.type === "image" && ctx.describe) {
830
+ const {
831
+ analysis
832
+ } = await analyzeItem(got, ctx, true);
833
+ if (analysis.description) looks = ` \xB7 looks: ${analysis.description}`;
834
+ }
835
+ return {
836
+ ok: true,
837
+ label: `Took in ${got.name}`,
838
+ content: `Took in the link as ${got.type} id=${got.id} "${got.name}"${looks}.`
839
+ };
840
+ }
841
+ case "set_cut": {
842
+ const raw = args.scenes;
843
+ if (!Array.isArray(raw) || !raw.length) throw new ToolInputError('"scenes" must be a non-empty array');
844
+ const mode = str(args, "mode") === "append" ? "append" : "replace";
845
+ const t = ctx.getTimeline();
846
+ const library = agentLibrary(ctx);
847
+ const notes = [];
848
+ const made = [];
849
+ raw.forEach((e, i) => {
850
+ const entry = e && typeof e === "object" && !Array.isArray(e) ? e : {};
851
+ const r = clipForEntry(entry, i, library, t);
852
+ if ("error" in r) notes.push(`skipped ${r.error}`);
853
+ else made.push(r.clip);
854
+ });
855
+ if (!made.length) return {
856
+ ok: false,
857
+ label: "Nothing placed",
858
+ content: withNotes("Nothing was placed.", notes)
859
+ };
860
+ const next = __spreadProps(__spreadValues({}, t), {
861
+ clips: mode === "replace" ? made : [...t.clips, ...made]
862
+ });
863
+ ctx.setTimeline(next);
864
+ const toFilm = made.filter((c) => c.fillColor && c.shot).length;
865
+ return {
866
+ ok: true,
867
+ label: `${mode === "append" ? "Appended" : "Placed"} ${plural(made.length, "scene")}`,
868
+ detail: `cut is ${secs(cutSec(next, sourceSec))}`,
869
+ content: withNotes(`Placed ${plural(made.length, "scene")} (${mode}): ${JSON.stringify(made.map((c) => c.id))}.${toFilm ? ` ${plural(toFilm, "scene")} wait to be filmed: call film_scenes.` : ""}`, notes)
870
+ };
871
+ }
872
+ case "add_music": {
873
+ const run = needRun(ctx, "Music");
874
+ const prompt = str(args, "prompt", true);
875
+ const t = ctx.getTimeline();
876
+ const total = cutSec(t, sourceSec);
877
+ const at = Math.max(0, (_j = num(args, "at_sec")) != null ? _j : 0);
878
+ const wanted = (_k = num(args, "duration_sec")) != null ? _k : total > at ? total - at : DEFAULT_MUSIC_SEC;
879
+ const durationSec = Math.max(10, Math.min(MAX_MUSIC_SEC, Math.round(wanted)));
880
+ (_l = ctx.progress) == null ? void 0 : _l.call(ctx, `Composing music (${durationSec}s)\u2026`);
881
+ const audioUrl = await composeMusic(run, `Instrumental music bed, no vocals: ${prompt}`, durationSec);
882
+ const now = ctx.getTimeline();
883
+ if (at <= 0) {
884
+ ctx.setTimeline(__spreadProps(__spreadValues({}, now), {
885
+ soundtrack: {
886
+ audioUrl,
887
+ mode: "mix",
888
+ title: excerpt(prompt, 60)
889
+ }
890
+ }));
891
+ return {
892
+ ok: true,
893
+ label: "Generated music",
894
+ detail: excerpt(prompt, 60),
895
+ content: `Music laid under the whole cut (${secs(durationSec)}), mixed under the other audio.`
896
+ };
897
+ }
898
+ const audio = sceneAudioAt(now, {
899
+ audioUrl,
900
+ startSec: at,
901
+ durationSec: null,
902
+ volume: 0.6,
903
+ label: `Music \xB7 ${excerpt(prompt, 32)}`
904
+ }, sourceSec);
905
+ ctx.setTimeline(__spreadProps(__spreadValues({}, now), {
906
+ sceneAudio: [...(_m = now.sceneAudio) != null ? _m : [], audio]
907
+ }));
908
+ return {
909
+ ok: true,
910
+ label: "Generated music",
911
+ detail: excerpt(prompt, 60),
912
+ content: `Music placed at ${secs(at)} (id=${audio.id}).`
913
+ };
914
+ }
915
+ case "add_sound_effect": {
916
+ const run = needRun(ctx, "Sound effects");
917
+ const prompt = str(args, "prompt", true);
918
+ const at = Math.max(0, (_n = num(args, "at_sec")) != null ? _n : 0);
919
+ const durationSec = Math.max(0.5, Math.min(20, (_o = num(args, "duration_sec")) != null ? _o : DEFAULT_SFX_SEC));
920
+ (_p = ctx.progress) == null ? void 0 : _p.call(ctx, `Generating sound effect: ${excerpt(prompt, 40)}\u2026`);
921
+ const audioUrl = await composeSoundEffect(run, prompt, durationSec);
922
+ const now = ctx.getTimeline();
923
+ const audio = sceneAudioAt(now, {
924
+ audioUrl,
925
+ startSec: at,
926
+ durationSec,
927
+ volume: 0.9,
928
+ label: `SFX \xB7 ${excerpt(prompt, 32)}`
929
+ }, sourceSec);
930
+ ctx.setTimeline(__spreadProps(__spreadValues({}, now), {
931
+ sceneAudio: [...(_q = now.sceneAudio) != null ? _q : [], audio]
932
+ }));
933
+ return {
934
+ ok: true,
935
+ label: "Added sound effect",
936
+ detail: excerpt(prompt, 60),
937
+ content: `Sound effect placed at ${secs(at)} (id=${audio.id}).`
938
+ };
939
+ }
940
+ case "add_voiceover": {
941
+ const run = needRun(ctx, "Voiceover");
942
+ const text = str(args, "text", true);
943
+ const voice = str(args, "voice");
944
+ if (voice && !STOCK_VOICES.some((v) => v.id === voice)) throw new ToolInputError(`unknown voice "${voice}"`);
945
+ const before = ctx.getTimeline();
946
+ const lines = ((_r = before.sceneAudio) != null ? _r : []).filter((a) => {
947
+ var _a2;
948
+ return (_a2 = a.label) == null ? void 0 : _a2.startsWith("Voiceover");
949
+ });
950
+ const lastEnd = lines.reduce((end, a) => {
951
+ var _a2;
952
+ return Math.max(end, a.startSec + ((_a2 = a.durationSec) != null ? _a2 : 0));
953
+ }, 0);
954
+ const at = Math.max(0, (_s = num(args, "at_sec")) != null ? _s : lastEnd);
955
+ (_t = ctx.progress) == null ? void 0 : _t.call(ctx, "Recording voiceover\u2026");
956
+ const audioUrl = await speakLine(run, text, voice);
957
+ const measured = await probeAudioSec(run, audioUrl);
958
+ const now = ctx.getTimeline();
959
+ const audio = sceneAudioAt(now, {
960
+ audioUrl,
961
+ startSec: at,
962
+ durationSec: measured > 0 ? Math.round(measured * 1e3) / 1e3 : null,
963
+ volume: 1,
964
+ label: `Voiceover \xB7 ${excerpt(text, 32)}`
965
+ }, sourceSec);
966
+ ctx.setTimeline(__spreadProps(__spreadValues({}, now), {
967
+ sceneAudio: [...(_u = now.sceneAudio) != null ? _u : [], audio]
968
+ }));
969
+ return {
970
+ ok: true,
971
+ label: "Added voiceover",
972
+ detail: excerpt(text, 60),
973
+ content: `Voiceover placed at ${secs(at)} (id=${audio.id}${measured > 0 ? `, ${secs(measured)}` : ""}).`
974
+ };
975
+ }
976
+ case "add_captions": {
977
+ const ids = strList(args, "scene_ids");
978
+ const t = ctx.getTimeline();
979
+ const notes = [];
980
+ if (ids) {
981
+ for (const id of ids) if (!t.clips.some((c) => c.id === id)) notes.push(`no scene with id "${id}"`);
982
+ }
983
+ const scenes = t.clips.filter((c) => c.type === "video" && !c.fillColor && (!ids || ids.includes(c.id)));
984
+ let next = t;
985
+ let count = 0;
986
+ for (const scene of scenes) {
987
+ let cues = (_v = cache(ctx).get(scene.src)) == null ? void 0 : _v.transcript;
988
+ if (!cues && ctx.runAction) {
989
+ (_w = ctx.progress) == null ? void 0 : _w.call(ctx, `Transcribing ${scene.name}\u2026`);
990
+ cues = (await analyzeItem({
991
+ id: scene.id,
992
+ type: "video",
993
+ src: scene.src,
994
+ name: scene.name
995
+ }, ctx, false)).analysis.transcript;
996
+ }
997
+ const lines = captionsForClip(next, scene.id, cues != null ? cues : [], sourceSec);
998
+ count += lines.length;
999
+ next = placeCaptions(next, lines);
1000
+ }
1001
+ if (!count) notes.push("no dialogue in those scenes");
1002
+ else ctx.setTimeline(next);
1003
+ return {
1004
+ ok: count > 0,
1005
+ label: count > 0 ? `Captioned ${plural(count, "line")}` : "No captions added",
1006
+ content: withNotes(`Added ${plural(count, "caption")}.`, notes)
1007
+ };
1008
+ }
1009
+ case "set_format": {
1010
+ const aspect = str(args, "aspect", true);
1011
+ if (!(aspect in FORMAT_ASPECTS)) {
1012
+ return {
1013
+ ok: false,
1014
+ label: "Format unchanged",
1015
+ content: `Format unchanged.
1016
+ Notes: unknown aspect "${aspect}" - use 16:9, 9:16, 1:1, 4:5 or auto`
1017
+ };
1018
+ }
1019
+ const t = ctx.getTimeline();
1020
+ const ratio = FORMAT_ASPECTS[aspect];
1021
+ const rest = __spreadValues({}, t);
1022
+ delete rest.aspect;
1023
+ ctx.setTimeline(ratio ? __spreadProps(__spreadValues({}, t), {
1024
+ aspect: ratio
1025
+ }) : rest);
1026
+ return {
1027
+ ok: true,
1028
+ label: `Set format ${aspect}`,
1029
+ content: `Format set to ${aspect}.`
1030
+ };
1031
+ }
1032
+ }
1033
+ }export{CUT_AGENT_TOOLS,FORMAT_ASPECTS,MEDIA_TOOL_NAMES,SHOT_SEC_RANGE,agentLibrary,executeCutTool};//# sourceMappingURL=cutTools.js.map