videobook 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +195 -2
- package/bin/videobook.js +7 -0
- package/dist/acestep/client.js +203 -0
- package/dist/acestep/config.js +62 -0
- package/dist/acestep/errors.js +8 -0
- package/dist/acestep/process.js +175 -0
- package/dist/alive-captions/analyze.js +117 -0
- package/dist/alive-captions/audio.js +179 -0
- package/dist/alive-captions/frames.js +59 -0
- package/dist/alive-captions/model.js +37 -0
- package/dist/alive-captions/schema.js +49 -0
- package/dist/alive-captions/track.js +9 -0
- package/dist/api-key.js +33 -0
- package/dist/app-state.js +56 -0
- package/dist/app.js +257 -0
- package/dist/archive-b2.js +332 -0
- package/dist/archive-store.js +169 -0
- package/dist/artifact-label.js +36 -0
- package/dist/artifact-refs.js +49 -0
- package/dist/asset-tag-extraction.js +169 -0
- package/dist/asset-tags.js +228 -0
- package/dist/asset-usage.js +23 -0
- package/dist/audio-cue.js +71 -0
- package/dist/audio-encoding.js +32 -0
- package/dist/audio-sync-request.js +1 -0
- package/dist/audio-sync.js +223 -0
- package/dist/audio-trim-range.js +31 -0
- package/dist/book-context.js +31 -0
- package/dist/book-manager.js +374 -0
- package/dist/catalog-gc.js +26 -0
- package/dist/chain-executor.js +815 -0
- package/dist/chain-generation.js +115 -0
- package/dist/chain-plan.js +746 -0
- package/dist/chain-step-review.js +60 -0
- package/dist/character-name.js +25 -0
- package/dist/chat-generation-routing.js +73 -0
- package/dist/chat-generation-settings.js +78 -0
- package/dist/chat-models.js +44 -0
- package/dist/chat-prompt-rewrite.js +67 -0
- package/dist/chat-router.js +628 -0
- package/dist/chat-view-actions.js +49 -0
- package/dist/cli/args.js +242 -0
- package/dist/cli/config-command.js +103 -0
- package/dist/cli/doctor-command.js +289 -0
- package/dist/cli/entry.js +2 -0
- package/dist/cli/key-report.js +16 -0
- package/dist/cli/main.js +104 -0
- package/dist/cli/mcp-command.js +88 -0
- package/dist/cli/mcp-relay.js +51 -0
- package/dist/cli/open-browser.js +14 -0
- package/dist/cli/run-command.js +231 -0
- package/dist/cli/serve-command.js +62 -0
- package/dist/cli/setup-command.js +60 -0
- package/dist/cli/stdio-guard.js +8 -0
- package/dist/cold-open-model.js +7 -0
- package/dist/cold-open.js +79 -0
- package/dist/command-reference.js +95 -0
- package/dist/content-store.js +74 -0
- package/dist/cost.js +8 -0
- package/dist/crop-geometry.js +23 -0
- package/dist/dancing-workflow.js +447 -0
- package/dist/data-home.js +44 -0
- package/dist/diagnostics.js +109 -0
- package/dist/dialog-quality.js +34 -0
- package/dist/downloads-dest.js +56 -0
- package/dist/editing-moments.js +194 -0
- package/dist/elevenlabs-audio-extension.js +66 -0
- package/dist/engine.js +54 -0
- package/dist/env-file.js +91 -0
- package/dist/env-secrets.js +148 -0
- package/dist/ffmpeg-binary.js +12 -0
- package/dist/ffmpeg.js +425 -0
- package/dist/ffprobe-binary.js +77 -0
- package/dist/forget-asset.js +216 -0
- package/dist/frame-utils.js +27 -0
- package/dist/generation-credit-error.js +11 -0
- package/dist/generation-input-mentions.js +117 -0
- package/dist/generation-input-policy.js +68 -0
- package/dist/generation-reference-mentions.js +97 -0
- package/dist/goal-characters.js +49 -0
- package/dist/goal-plan-v3.js +273 -0
- package/dist/goal-plan.js +220 -0
- package/dist/goal-planner-prompt.js +28 -0
- package/dist/goal-prompt-budget.js +4 -0
- package/dist/goal-reference-images.js +25 -0
- package/dist/goal-state.js +261 -0
- package/dist/goal-stills.js +153 -0
- package/dist/goal-store.js +144 -0
- package/dist/goal-styles.js +144 -0
- package/dist/goal-v3-runtime.js +157 -0
- package/dist/guides/character_schema_guide.md +70 -0
- package/dist/guides/gpt_image_2_5_prompting_guide.md +21 -0
- package/dist/guides/grok_imagine_prompting_guide.md +72 -0
- package/dist/guides/image_reproduction_guide.md +84 -0
- package/dist/guides/kling_3_0_prompting_guide.md +136 -0
- package/dist/guides/nano_banana_pro_prompting_guide.md +28 -0
- package/dist/guides/seedance_2_prompting_guide.md +172 -0
- package/dist/http-access.js +49 -0
- package/dist/http-byte-range.js +31 -0
- package/dist/hydration.js +56 -0
- package/dist/image-compress.js +77 -0
- package/dist/image-edit-default.js +1 -0
- package/dist/image-edit-models.js +41 -0
- package/dist/image-edit-settings.js +11 -0
- package/dist/image-region-edit.js +32 -0
- package/dist/image-subject-map.js +523 -0
- package/dist/image.js +46 -0
- package/dist/index.js +12 -0
- package/dist/job-deadline.js +60 -0
- package/dist/jobs/_alibaba-upload.js +30 -0
- package/dist/jobs/_audio-chunks.js +31 -0
- package/dist/jobs/_download-into-asset.js +15 -0
- package/dist/jobs/_fal-shared.js +22 -0
- package/dist/jobs/_fal-upload.js +35 -0
- package/dist/jobs/_image-edit-adapter.js +213 -0
- package/dist/jobs/_kie-poll.js +119 -0
- package/dist/jobs/_kie-upload.js +32 -0
- package/dist/jobs/_lease.js +163 -0
- package/dist/jobs/_persist-output.js +19 -0
- package/dist/jobs/_storage-retry.js +21 -0
- package/dist/jobs/_transcribe.js +245 -0
- package/dist/jobs/_translate-transcript.js +270 -0
- package/dist/jobs/analyze-alive-captions.js +10 -0
- package/dist/jobs/analyze-editing-moments.js +104 -0
- package/dist/jobs/analyze-jokes.js +143 -0
- package/dist/jobs/analyze-keyword-placement.js +155 -0
- package/dist/jobs/analyze-music.js +14 -0
- package/dist/jobs/analyze-video.js +282 -0
- package/dist/jobs/apply-cuts.js +83 -0
- package/dist/jobs/apply-sfx.js +107 -0
- package/dist/jobs/archive-clip.js +458 -0
- package/dist/jobs/assemble-goal.js +98 -0
- package/dist/jobs/audio-boost.js +71 -0
- package/dist/jobs/audio-mix.js +161 -0
- package/dist/jobs/backfill-asset-tags.js +144 -0
- package/dist/jobs/burn-watermark.js +316 -0
- package/dist/jobs/change-video-speed.js +176 -0
- package/dist/jobs/clean-video-audio.js +207 -0
- package/dist/jobs/cold-open.js +166 -0
- package/dist/jobs/combine-goal.js +108 -0
- package/dist/jobs/complete-provider-task.js +185 -0
- package/dist/jobs/copy-library-asset.js +33 -0
- package/dist/jobs/cost-estimate-assessment.js +113 -0
- package/dist/jobs/crop-image.js +47 -0
- package/dist/jobs/crop-video.js +71 -0
- package/dist/jobs/describe-image.js +181 -0
- package/dist/jobs/detect-scenes.js +33 -0
- package/dist/jobs/doctor-fix.js +100 -0
- package/dist/jobs/download-video.js +427 -0
- package/dist/jobs/enqueue-search-index.js +24 -0
- package/dist/jobs/even-split.js +122 -0
- package/dist/jobs/export-sequence.js +365 -0
- package/dist/jobs/extend-audio.js +229 -0
- package/dist/jobs/extract-audio.js +72 -0
- package/dist/jobs/extract-frame.js +58 -0
- package/dist/jobs/extract-notebook-audio.js +82 -0
- package/dist/jobs/extract-notebook-frame.js +93 -0
- package/dist/jobs/extract-video-clip.js +8 -0
- package/dist/jobs/extract-video-poster.js +55 -0
- package/dist/jobs/extract-waveform.js +25 -0
- package/dist/jobs/finish-goal.js +255 -0
- package/dist/jobs/forget-asset.js +11 -0
- package/dist/jobs/generate-acestep-cover.js +219 -0
- package/dist/jobs/generate-media.js +70 -0
- package/dist/jobs/image-subjects.js +1059 -0
- package/dist/jobs/index.js +18 -0
- package/dist/jobs/inject-first-frame.js +175 -0
- package/dist/jobs/isolate-vocals.js +69 -0
- package/dist/jobs/kie-paygate.js +177 -0
- package/dist/jobs/label-music-sections.js +5 -0
- package/dist/jobs/osg-placement.js +135 -0
- package/dist/jobs/pad-video.js +72 -0
- package/dist/jobs/plan-goal.js +97 -0
- package/dist/jobs/post-record.js +21 -0
- package/dist/jobs/post-to-x.js +21 -0
- package/dist/jobs/prepare-search-reference.js +190 -0
- package/dist/jobs/prepare-temporal-search.js +16 -0
- package/dist/jobs/process-audio.js +67 -0
- package/dist/jobs/process-image.js +58 -0
- package/dist/jobs/process-upload.js +166 -0
- package/dist/jobs/process-video.js +438 -0
- package/dist/jobs/register-all.js +161 -0
- package/dist/jobs/relayout-notebook.js +78 -0
- package/dist/jobs/remove-sound.js +299 -0
- package/dist/jobs/render-project.js +380 -0
- package/dist/jobs/render-qr-outro.js +138 -0
- package/dist/jobs/render-timeline.js +283 -0
- package/dist/jobs/repair-search-indexes.js +42 -0
- package/dist/jobs/replace-video-audio.js +64 -0
- package/dist/jobs/restore-archive-clip.js +53 -0
- package/dist/jobs/reverse-video.js +53 -0
- package/dist/jobs/rewrite-script.js +173 -0
- package/dist/jobs/run-notebook.js +3335 -0
- package/dist/jobs/semantic-index.js +797 -0
- package/dist/jobs/smooth-scene-concat.js +257 -0
- package/dist/jobs/splice-video.js +280 -0
- package/dist/jobs/split-video.js +127 -0
- package/dist/jobs/suggest-cuts.js +149 -0
- package/dist/jobs/suggest-sfx.js +135 -0
- package/dist/jobs/sync-video-to-audio.js +329 -0
- package/dist/jobs/tag-asset.js +266 -0
- package/dist/jobs/task-failure.js +16 -0
- package/dist/jobs/timewarp-video.js +152 -0
- package/dist/jobs/transcribe-video-audio.js +117 -0
- package/dist/jobs/transcribe.js +35 -0
- package/dist/jobs/translate-transcript.js +55 -0
- package/dist/jobs/trim-audio.js +133 -0
- package/dist/jobs/trim-video.js +291 -0
- package/dist/jobs/xai-paygate.js +26 -0
- package/dist/keyword-placement-cache.js +74 -0
- package/dist/lazy-render.js +142 -0
- package/dist/library-browse.js +78 -0
- package/dist/lightning-defaults.js +206 -0
- package/dist/load-env.js +12 -0
- package/dist/local-search-models.js +206 -0
- package/dist/local-upload.js +318 -0
- package/dist/logger.js +69 -0
- package/dist/media/adapters/alibaba.js +20 -0
- package/dist/media/adapters/elevenlabs.js +58 -0
- package/dist/media/adapters/fal.js +45 -0
- package/dist/media/adapters/index.js +26 -0
- package/dist/media/adapters/kie.js +120 -0
- package/dist/media/adapters/pending.js +21 -0
- package/dist/media/adapters/types.js +5 -0
- package/dist/media/adapters/xai.js +18 -0
- package/dist/media/catalog.js +236 -0
- package/dist/media/complete.js +191 -0
- package/dist/media/cost.js +45 -0
- package/dist/media/descriptor.js +157 -0
- package/dist/media/endpoints.js +11 -0
- package/dist/media/frame-options.js +18 -0
- package/dist/media/insert-video-timing.js +17 -0
- package/dist/media/json-schema.js +75 -0
- package/dist/media/legacy-task-types.js +129 -0
- package/dist/media/listing.js +24 -0
- package/dist/media/model-id.js +14 -0
- package/dist/media/preview.js +86 -0
- package/dist/media/prompt-dialects.js +65 -0
- package/dist/media/ref-fields.js +106 -0
- package/dist/media/refs.js +131 -0
- package/dist/media/request.js +188 -0
- package/dist/media/types.js +6 -0
- package/dist/media/wire.js +161 -0
- package/dist/media-library.js +535 -0
- package/dist/media-output-path.js +33 -0
- package/dist/multyculty-workflow.js +757 -0
- package/dist/notebook-action-catalog.js +608 -0
- package/dist/notebook-cell-outputs.js +726 -0
- package/dist/notebook-credit-retry.js +45 -0
- package/dist/notebook-fixtures.js +8 -0
- package/dist/notebook-generation-contract.js +77 -0
- package/dist/notebook-generation-controls.js +145 -0
- package/dist/notebook-goal-layout.js +40 -0
- package/dist/notebook-graph.js +37 -0
- package/dist/notebook-image-edit.js +84 -0
- package/dist/notebook-initial-generation-prompt.js +222 -0
- package/dist/notebook-live-analysis.js +941 -0
- package/dist/notebook-media-ops.js +579 -0
- package/dist/notebook-mutations.js +20 -0
- package/dist/notebook-placement.js +41 -0
- package/dist/notebook-provider-failure.js +87 -0
- package/dist/notebook-published-post.js +26 -0
- package/dist/notebook-reference-resolver.js +227 -0
- package/dist/notebook-relayout.js +270 -0
- package/dist/notebook-run-plan.js +519 -0
- package/dist/notebook-shots.js +162 -0
- package/dist/notebook-workflow.js +856 -0
- package/dist/one-password.js +200 -0
- package/dist/openai-intelligence.js +99 -0
- package/dist/original-media-file.js +12 -0
- package/dist/osg-assets.js +36 -0
- package/dist/osg-placement-cache.js +64 -0
- package/dist/osg-settings.js +27 -0
- package/dist/paid-tools.js +22 -0
- package/dist/platform-guidance.js +26 -0
- package/dist/posts/dropbox-auth.js +91 -0
- package/dist/posts/dropbox-upload.js +132 -0
- package/dist/posts/icloud-drive.js +134 -0
- package/dist/posts/icloud-status.js +64 -0
- package/dist/posts/post-contract.js +2 -0
- package/dist/posts/post-copy-format.js +43 -0
- package/dist/posts/post-copy.js +193 -0
- package/dist/posts/post-folder.js +18 -0
- package/dist/posts/post-metrics.js +119 -0
- package/dist/posts/post-store.js +340 -0
- package/dist/posts/x-post-target.js +43 -0
- package/dist/preview-payload.js +90 -0
- package/dist/prompt-surfaces.js +22 -0
- package/dist/provider-prompt-transform.js +77 -0
- package/dist/provider-status-link.js +21 -0
- package/dist/provider-task-record.js +78 -0
- package/dist/provider-task-status.js +47 -0
- package/dist/provider-usage.js +294 -0
- package/dist/queue.js +810 -0
- package/dist/reference-video-duration.js +17 -0
- package/dist/remotion/BlurFillVideo.js +51 -0
- package/dist/remotion/KeywordGraphicsOverlay.js +68 -0
- package/dist/remotion/OsgOverlay.js +30 -0
- package/dist/remotion/QrOutroComposition.js +47 -0
- package/dist/remotion/RenderComposition.js +11 -0
- package/dist/remotion/browser.js +59 -0
- package/dist/remotion/constants.js +35 -0
- package/dist/remotion/index.js +66 -0
- package/dist/remotion/keyword-graphics.js +151 -0
- package/dist/remotion/keyword-placement.js +182 -0
- package/dist/remotion/osg-spec.js +198 -0
- package/dist/remotion/public/qr-outro-impact.wav +0 -0
- package/dist/remotion/qr-outro-audio.js +1 -0
- package/dist/remotion/qr-outro-spec.js +211 -0
- package/dist/remotion/shared-bundle.js +37 -0
- package/dist/remotion/subtitles/AliveCaptions.js +83 -0
- package/dist/remotion/subtitles/Highlight.js +58 -0
- package/dist/remotion/subtitles/Impact.js +67 -0
- package/dist/remotion/subtitles/SubtitleOverlay.js +9 -0
- package/dist/remotion/subtitles/alive-layout.js +321 -0
- package/dist/remotion/subtitles/alive-types.js +17 -0
- package/dist/remotion/subtitles/chunker.js +68 -0
- package/dist/remotion/subtitles/segments.js +42 -0
- package/dist/remotion/subtitles/styles.js +4 -0
- package/dist/remotion/subtitles/types.js +1 -0
- package/dist/remotion/util.js +18 -0
- package/dist/remotion-cancellation.js +15 -0
- package/dist/rename-helpers.js +204 -0
- package/dist/rhythm/analyze.js +128 -0
- package/dist/rhythm/contract.js +14 -0
- package/dist/rhythm/draft-model.js +19 -0
- package/dist/rhythm/energy.js +133 -0
- package/dist/rhythm/fft.js +44 -0
- package/dist/rhythm/model.js +71 -0
- package/dist/rhythm/music-analysis.js +124 -0
- package/dist/rhythm/music-draft.js +261 -0
- package/dist/rhythm/onset.js +101 -0
- package/dist/rhythm/run-worker.js +51 -0
- package/dist/rhythm/score.js +47 -0
- package/dist/rhythm/section-labels.js +168 -0
- package/dist/rhythm/sequence-rhythm.js +67 -0
- package/dist/rhythm/synthesize.js +103 -0
- package/dist/rhythm/timing.js +98 -0
- package/dist/rhythm/track.js +320 -0
- package/dist/rhythm/visual-fit.js +4 -0
- package/dist/rhythm/worker.js +25 -0
- package/dist/scene-detect.js +200 -0
- package/dist/scene-transition.js +12 -0
- package/dist/scheduled-posts.js +200 -0
- package/dist/search-index-coverage.js +13 -0
- package/dist/search-index-media.js +71 -0
- package/dist/search-reference-store.js +60 -0
- package/dist/search-scoring.js +17 -0
- package/dist/serve.js +125 -0
- package/dist/server-lock.js +143 -0
- package/dist/server.js +42 -0
- package/dist/srt.js +16 -0
- package/dist/tag-backfill-state.js +121 -0
- package/dist/tag-settings.js +30 -0
- package/dist/tag-vocabulary.js +237 -0
- package/dist/test-queue-cleanup.js +1 -0
- package/dist/time-parse.js +50 -0
- package/dist/timeline-helpers.js +554 -0
- package/dist/timewarp.js +87 -0
- package/dist/tools/_image-inputs.js +9 -0
- package/dist/tools/_media-refs.js +84 -0
- package/dist/tools/_shared.js +59 -0
- package/dist/tools/_suggest-shared.js +279 -0
- package/dist/tools/add-timeline-audio.js +73 -0
- package/dist/tools/alive-captions.js +157 -0
- package/dist/tools/analyze-jokes.js +56 -0
- package/dist/tools/analyze-video.js +66 -0
- package/dist/tools/animate-keywords.js +217 -0
- package/dist/tools/api-status.js +42 -0
- package/dist/tools/application-commands.js +34 -0
- package/dist/tools/apply-cuts.js +112 -0
- package/dist/tools/apply-sfx.js +152 -0
- package/dist/tools/apply-watermark.js +670 -0
- package/dist/tools/archive-clip.js +74 -0
- package/dist/tools/asset-history.js +61 -0
- package/dist/tools/asset-manifest.js +24 -0
- package/dist/tools/asset-tags.js +151 -0
- package/dist/tools/assign-slot.js +97 -0
- package/dist/tools/audio-boost.js +107 -0
- package/dist/tools/audio-mix.js +121 -0
- package/dist/tools/book-usage.js +16 -0
- package/dist/tools/chain.js +136 -0
- package/dist/tools/change-video-speed.js +105 -0
- package/dist/tools/chat-history.js +5 -0
- package/dist/tools/chat.js +848 -0
- package/dist/tools/clean-video-audio.js +97 -0
- package/dist/tools/clear-failed-tasks.js +66 -0
- package/dist/tools/cold-open.js +114 -0
- package/dist/tools/command-plan.js +1680 -0
- package/dist/tools/commands.js +1666 -0
- package/dist/tools/concat-images.js +236 -0
- package/dist/tools/connect-service.js +55 -0
- package/dist/tools/copy-file-to-clipboard.js +58 -0
- package/dist/tools/create-character.js +114 -0
- package/dist/tools/create-qart.js +253 -0
- package/dist/tools/create-qr-outro.js +149 -0
- package/dist/tools/create-qrbtf.js +215 -0
- package/dist/tools/create-watermark.js +97 -0
- package/dist/tools/crop-asset.js +18 -0
- package/dist/tools/crop-image.js +120 -0
- package/dist/tools/crop-video.js +97 -0
- package/dist/tools/delete-asset.js +104 -0
- package/dist/tools/describe-image.js +69 -0
- package/dist/tools/detect-scenes.js +44 -0
- package/dist/tools/doctor.js +126 -0
- package/dist/tools/download-video.js +114 -0
- package/dist/tools/duplicate-asset.js +184 -0
- package/dist/tools/edit-timeline.js +59 -0
- package/dist/tools/editing-moments.js +105 -0
- package/dist/tools/estimate-cost.js +171 -0
- package/dist/tools/even-split.js +295 -0
- package/dist/tools/export-asset-file.js +22 -0
- package/dist/tools/export-asset.js +140 -0
- package/dist/tools/export-sequence.js +250 -0
- package/dist/tools/export-to-downloads.js +54 -0
- package/dist/tools/export-transcript-srt.js +79 -0
- package/dist/tools/extend-audio.js +100 -0
- package/dist/tools/extract-audio.js +174 -0
- package/dist/tools/extract-frame.js +108 -0
- package/dist/tools/extract-notebook-audio.js +173 -0
- package/dist/tools/extract-notebook-frame.js +160 -0
- package/dist/tools/extract-video-clip.js +101 -0
- package/dist/tools/generate-media.js +157 -0
- package/dist/tools/generation-payload.js +48 -0
- package/dist/tools/get-timeline.js +12 -0
- package/dist/tools/get-watermark-config.js +38 -0
- package/dist/tools/goal.js +644 -0
- package/dist/tools/image-subjects.js +711 -0
- package/dist/tools/index.js +323 -0
- package/dist/tools/inject-first-frame.js +154 -0
- package/dist/tools/invert-image.js +70 -0
- package/dist/tools/isolate-vocals.js +66 -0
- package/dist/tools/list-assets.js +98 -0
- package/dist/tools/list-cell-generations.js +225 -0
- package/dist/tools/list-elevenlabs-voices.js +163 -0
- package/dist/tools/log-wrapper.js +29 -0
- package/dist/tools/make-cover-song.js +95 -0
- package/dist/tools/mark-asset-seen.js +23 -0
- package/dist/tools/media-library.js +245 -0
- package/dist/tools/move-timeline-audio.js +35 -0
- package/dist/tools/music-analysis.js +60 -0
- package/dist/tools/music-draft.js +29 -0
- package/dist/tools/pad-video.js +87 -0
- package/dist/tools/post-record.js +83 -0
- package/dist/tools/post.js +168 -0
- package/dist/tools/prompt-history.js +164 -0
- package/dist/tools/provider-key-status.js +248 -0
- package/dist/tools/qrbtf-render.js +849 -0
- package/dist/tools/read-asset-metadata.js +26 -0
- package/dist/tools/read-file-at-commit.js +29 -0
- package/dist/tools/read-transcript.js +41 -0
- package/dist/tools/reconcile-project-work.js +1452 -0
- package/dist/tools/recover-asset.js +28 -0
- package/dist/tools/remove-sound.js +72 -0
- package/dist/tools/remove-timeline-audio.js +34 -0
- package/dist/tools/remove-timeline-slot.js +40 -0
- package/dist/tools/rename-all.js +434 -0
- package/dist/tools/rename-asset.js +34 -0
- package/dist/tools/render-settings.js +47 -0
- package/dist/tools/render-timeline.js +120 -0
- package/dist/tools/render.js +384 -0
- package/dist/tools/reorder-character-images.js +45 -0
- package/dist/tools/replace-video-audio.js +133 -0
- package/dist/tools/restore-archive-clips.js +209 -0
- package/dist/tools/restore-asset-version.js +37 -0
- package/dist/tools/retry-generation.js +54 -0
- package/dist/tools/reverse-video.js +74 -0
- package/dist/tools/rewrite-prompt.js +388 -0
- package/dist/tools/rewrite-script.js +67 -0
- package/dist/tools/schema-from-apicity.js +66 -0
- package/dist/tools/search-archive.js +150 -0
- package/dist/tools/semantic-search.js +1214 -0
- package/dist/tools/sequence-rhythm.js +43 -0
- package/dist/tools/set-character-metadata.js +84 -0
- package/dist/tools/set-env-secret.js +40 -0
- package/dist/tools/set-osg.js +143 -0
- package/dist/tools/show-folder.js +37 -0
- package/dist/tools/smooth-scene-concat.js +122 -0
- package/dist/tools/splice-video.js +149 -0
- package/dist/tools/split-video.js +202 -0
- package/dist/tools/suggest-cuts.js +45 -0
- package/dist/tools/suggest-sfx.js +43 -0
- package/dist/tools/sync-video-to-audio.js +115 -0
- package/dist/tools/tag-backfill.js +177 -0
- package/dist/tools/timewarp-video.js +85 -0
- package/dist/tools/tool-def.js +1 -0
- package/dist/tools/tool-json-schema.js +116 -0
- package/dist/tools/transcribe.js +90 -0
- package/dist/tools/translate-subtitles.js +59 -0
- package/dist/tools/trim-audio.js +139 -0
- package/dist/tools/trim-video.js +168 -0
- package/dist/tools/update-script.js +25 -0
- package/dist/tools/update-timeline-audio.js +40 -0
- package/dist/tools/upload-file.js +41 -0
- package/dist/tools/verify-x-mentions.js +141 -0
- package/dist/tools/video-editing-command-contract.js +291 -0
- package/dist/tools/video-source-reference.js +30 -0
- package/dist/tools/video-time-input.js +18 -0
- package/dist/tools/videobook-domain.js +2021 -0
- package/dist/tools/wait-for-asset-ready.js +143 -0
- package/dist/tools/workspace-actions.js +54 -0
- package/dist/transcript-projection.js +202 -0
- package/dist/transcript-srt.js +33 -0
- package/dist/upload.js +76 -0
- package/dist/usage-providers.js +25 -0
- package/dist/video-analysis-projection.js +46 -0
- package/dist/video-poster.js +33 -0
- package/dist/video-proxy.js +99 -0
- package/dist/vision-regions.js +111 -0
- package/dist/voice-actions.js +90 -0
- package/dist/voice-audio.js +55 -0
- package/dist/voice-config.js +122 -0
- package/dist/voice-continuation.js +54 -0
- package/dist/voice-contract.js +1 -0
- package/dist/voice-http.js +145 -0
- package/dist/voice-reply-progress.js +55 -0
- package/dist/voice-session.js +992 -0
- package/dist/watermark-badge.js +259 -0
- package/dist/watermark-config.js +111 -0
- package/dist/watermark-handle-position.js +55 -0
- package/dist/watermark-platform.js +15 -0
- package/dist/watermark-timing.js +16 -0
- package/dist/workspace-action-catalog.js +315 -0
- package/dist/workspace-action-contract.js +21 -0
- package/dist/workspace-action-groups.js +98 -0
- package/dist/workspace-action-surfaces.js +7 -0
- package/dist/x/account.js +88 -0
- package/dist/x/authenticated-handle.js +30 -0
- package/dist/x/oauth-flow.js +191 -0
- package/dist/x/post-contract.js +1 -0
- package/dist/x/post-metadata.js +44 -0
- package/dist/x/post-to-x.js +456 -0
- package/dist/x/published-post-cell.js +90 -0
- package/dist/x/x-tokens.js +69 -0
- package/dist/ytdlp-binary.js +65 -0
- package/dist/zod-slots.js +334 -0
- package/package.json +84 -4
- package/ui/assets/alive-captions-BWb5nLKj.css +1 -0
- package/ui/assets/alive-captions-DPEr1nKM.js +1 -0
- package/ui/assets/confirm-bodies-D8ouHXKy.js +1 -0
- package/ui/assets/confirm-bodies-DrMhaXC6.css +1 -0
- package/ui/assets/fullscreen-B7nw4YbE.js +1 -0
- package/ui/assets/goal-ui-DK-xTCK0.js +2 -0
- package/ui/assets/goal-ui-DXdUM2KF.css +1 -0
- package/ui/assets/index-DzPAnCUj.css +1 -0
- package/ui/assets/index-kS1905s5.js +37 -0
- package/ui/assets/inspector-MlzQbTVo.js +1 -0
- package/ui/assets/jobs-ui-CoinOWx0.js +1 -0
- package/ui/assets/music-video-Cbe80kmQ.js +1 -0
- package/ui/assets/music-video-DPaiKKEq.css +1 -0
- package/ui/assets/ui-Oirr9VOf.css +1 -0
- package/ui/assets/ui-xo_Y1yQg.js +2 -0
- package/ui/assets/vendor-D2rfiZ5j.css +1 -0
- package/ui/assets/vendor-DfTCWgKm.js +19 -0
- package/ui/assets/vendor-flow-BXbeWxW7.js +7 -0
- package/ui/assets/vendor-flow-BnuhLJ6X.css +1 -0
- package/ui/assets/vendor-icons-CGqhCIXV.js +1 -0
- package/ui/assets/vendor-mcp-BTlEJcHV.js +67 -0
- package/ui/assets/vendor-react-Dj7D1fD4.js +9 -0
- package/ui/assets/vendor-remotion-CH1HXrlc.js +95 -0
- package/ui/assets/videobook-Qlp9HQFu.js +20 -0
- package/ui/favicon.svg +8 -0
- package/ui/index.html +126 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { WORKSPACE_TOOL_GROUPS } from "./workspace-action-groups.js";
|
|
2
|
+
import { toolSpendsMoney } from "./paid-tools.js";
|
|
3
|
+
import { WORKSPACE_ACTION_SURFACES } from "./workspace-action-surfaces.js";
|
|
4
|
+
import { APPLICATION_COMMAND_IDS, UI_ACTION_IDS } from "./workspace-action-contract.js";
|
|
5
|
+
import { toolInputJsonSchema } from "./tools/tool-json-schema.js";
|
|
6
|
+
const GENERATION_MEDIA = {
|
|
7
|
+
generate_image: "image",
|
|
8
|
+
generate_video: "video",
|
|
9
|
+
generate_audio: "audio",
|
|
10
|
+
};
|
|
11
|
+
const toolGroups = new Map(Object.entries(WORKSPACE_TOOL_GROUPS).flatMap(([group, tools]) => tools.map((tool) => [tool, group])));
|
|
12
|
+
const uiActions = new Set(UI_ACTION_IDS);
|
|
13
|
+
const applicationCommands = new Set(APPLICATION_COMMAND_IDS);
|
|
14
|
+
export const WORKFLOW_TOOLS = {
|
|
15
|
+
upload_post_to_dropbox: { actionId: "command.upload-post-to-dropbox", reason: "Uploads after the composer review shows the Post, its editable caption and the destination folder." },
|
|
16
|
+
save_post_to_icloud: { actionId: "command.save-post-to-icloud", reason: "Saves after the composer delivery sheet shows the Post, its caption and the iPhone folder." },
|
|
17
|
+
post_icloud_sync_status: { actionId: "command.save-post-to-icloud", reason: "Reports iCloud upload progress for a Post the delivery sheet already saved." },
|
|
18
|
+
draft_post_copy: { actionId: "command.save-post-to-icloud", reason: "Drafts the caption and tags in the delivery sheet from the clip analysis, and rewrites them with an Astra prompt." },
|
|
19
|
+
prepare_cold_open: { actionId: "command.edit-cold-open", reason: "Selects a highlight in the cold-open review." },
|
|
20
|
+
edit_cold_open: { actionId: "command.edit-cold-open", reason: "Creates the reviewed cold-open copy." },
|
|
21
|
+
video_goal: {
|
|
22
|
+
actionId: "command.goal",
|
|
23
|
+
reason: "Goal mode defaults to portrait and Cinematic style. IG Influencer adds a hyper-realistic phone-shot style with content format, delivery, camera and light options, fixed after the frame. Review the plan and separately approve the frame, storyboards and videos; still versions remain selectable and revisable.",
|
|
24
|
+
},
|
|
25
|
+
assemble_goal: {
|
|
26
|
+
actionId: "command.goal",
|
|
27
|
+
reason: "Goal mode appends its completed shots to the sequence in order.",
|
|
28
|
+
},
|
|
29
|
+
list_workspace_actions: {
|
|
30
|
+
actionId: "command.actions",
|
|
31
|
+
reason: "Loads the Actions launcher and its typed forms.",
|
|
32
|
+
},
|
|
33
|
+
slash_commands: {
|
|
34
|
+
actionId: "command.actions",
|
|
35
|
+
reason: "Loads slash suggestions and dynamic project shortcuts in the Actions launcher.",
|
|
36
|
+
},
|
|
37
|
+
record_prompt: {
|
|
38
|
+
actionId: "tool.chat",
|
|
39
|
+
reason: "Records text entered through the composer and generation editors; browsing history is a separate action.",
|
|
40
|
+
},
|
|
41
|
+
check_duplicate_bytes: {
|
|
42
|
+
actionId: "command.upload",
|
|
43
|
+
reason: "Checks existing immutable bytes during Import before uploading a file.",
|
|
44
|
+
},
|
|
45
|
+
upload_file: {
|
|
46
|
+
actionId: "command.upload",
|
|
47
|
+
reason: "Import opens a native file picker and uploads media through the file workflow; users do not enter base64 data.",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
function title(value) {
|
|
51
|
+
const words = value.replace(/^\//u, "").replaceAll(/[_-]/gu, " ");
|
|
52
|
+
return `${words.charAt(0).toUpperCase()}${words.slice(1)}`
|
|
53
|
+
.replace(/\bqr\b/gu, "QR")
|
|
54
|
+
.replace(/\bsfx\b/gu, "sound effects");
|
|
55
|
+
}
|
|
56
|
+
function groupForTool(name) {
|
|
57
|
+
const group = toolGroups.get(name);
|
|
58
|
+
if (group)
|
|
59
|
+
return group;
|
|
60
|
+
throw new Error(`No workspace action group for ${name}`);
|
|
61
|
+
}
|
|
62
|
+
function uiGroup(action) {
|
|
63
|
+
if (/provider|x_connect/u.test(action))
|
|
64
|
+
return "Providers";
|
|
65
|
+
if (/archive|diagnostic|storage|jobs|inbox/u.test(action))
|
|
66
|
+
return "Recovery";
|
|
67
|
+
if (/histor|revision|status|rewind/u.test(action))
|
|
68
|
+
return "History";
|
|
69
|
+
if (/entities/u.test(action))
|
|
70
|
+
return "Entities";
|
|
71
|
+
if (/post/u.test(action))
|
|
72
|
+
return "Publishing";
|
|
73
|
+
if (/timeline|music_video|slot_player/u.test(action))
|
|
74
|
+
return "Sequence";
|
|
75
|
+
if (/notebook/u.test(action))
|
|
76
|
+
return "Notebook";
|
|
77
|
+
if (/speak|audio/u.test(action))
|
|
78
|
+
return "Audio";
|
|
79
|
+
if (/viewer|settings|watermark|cold_open|crop|osg|skeleton/u.test(action))
|
|
80
|
+
return "Video";
|
|
81
|
+
if (/asset|clipboard|upload|rename/u.test(action))
|
|
82
|
+
return "Media";
|
|
83
|
+
return "Workspace";
|
|
84
|
+
}
|
|
85
|
+
function targetForSchema(schema, group) {
|
|
86
|
+
const fields = schema.properties ?? {};
|
|
87
|
+
if (fields.cell_id)
|
|
88
|
+
return { kind: "cell", argument: "cell_id" };
|
|
89
|
+
if (fields.cell_ids)
|
|
90
|
+
return { kind: "cell", argument: "cell_ids", multiple: true };
|
|
91
|
+
if (fields.post_cell_id && schema.required?.includes("post_cell_id"))
|
|
92
|
+
return { kind: "cell", argument: "post_cell_id" };
|
|
93
|
+
if (fields.source_cell_id)
|
|
94
|
+
return { kind: "cell", argument: "source_cell_id" };
|
|
95
|
+
if (fields.clip_id)
|
|
96
|
+
return { kind: "clip", argument: "clip_id" };
|
|
97
|
+
if (fields.track_id)
|
|
98
|
+
return { kind: "track", argument: "track_id" };
|
|
99
|
+
const asset = ["asset_id", "asset_ref", "artifact_id", "artifact_ref", "audio_ref", "video_ref", "image_ref", "artifact_ids", "image_refs", "video_refs", "audio_refs", "qr_image_refs"]
|
|
100
|
+
.find((name) => name in fields);
|
|
101
|
+
if (asset) {
|
|
102
|
+
const mediaKinds = /image/u.test(asset) ? ["image"] : /audio/u.test(asset) ? ["audio"] : /video/u.test(asset) ? ["video", "final"] : group === "Video"
|
|
103
|
+
? ["video", "final"]
|
|
104
|
+
: group === "Audio"
|
|
105
|
+
? ["audio", "video", "final"]
|
|
106
|
+
: group === "Images" ? ["image"] : undefined;
|
|
107
|
+
return { kind: "asset", argument: asset, ...(asset.endsWith("s") ? { multiple: true } : {}), ...(mediaKinds ? { mediaKinds } : {}) };
|
|
108
|
+
}
|
|
109
|
+
if (fields.notebook_id)
|
|
110
|
+
return { kind: "notebook", argument: "notebook_id" };
|
|
111
|
+
return { kind: "none" };
|
|
112
|
+
}
|
|
113
|
+
function scopeForSchema(schema) {
|
|
114
|
+
const required = new Set(schema.required ?? []);
|
|
115
|
+
if (required.has("sequence_id"))
|
|
116
|
+
return "sequence";
|
|
117
|
+
if (required.has("notebook_id"))
|
|
118
|
+
return "notebook";
|
|
119
|
+
if (required.has("book_id"))
|
|
120
|
+
return "book";
|
|
121
|
+
return "global";
|
|
122
|
+
}
|
|
123
|
+
function confirmationForTool(tool) {
|
|
124
|
+
if (toolSpendsMoney(tool.name))
|
|
125
|
+
return "generation";
|
|
126
|
+
if (["post", "storage_sync", "archive_clip"].includes(tool.name))
|
|
127
|
+
return "external";
|
|
128
|
+
if (tool.name === "enqueue_sequence_export" || tool.annotations?.destructiveHint || /^(?:delete_|remove_|clean_failed|restore_)/u.test(tool.name)) {
|
|
129
|
+
return "destructive";
|
|
130
|
+
}
|
|
131
|
+
return "none";
|
|
132
|
+
}
|
|
133
|
+
function commandSchema(command) {
|
|
134
|
+
const schema = {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: Object.fromEntries(command.params.map((param) => [param.name, {
|
|
137
|
+
type: param.type === "string[]" ? "array" : param.type,
|
|
138
|
+
description: param.description,
|
|
139
|
+
...(param.type === "string[]" ? { items: { type: "string" } } : {}),
|
|
140
|
+
}])),
|
|
141
|
+
required: command.params.filter((param) => param.required).map((param) => param.name),
|
|
142
|
+
};
|
|
143
|
+
const fields = schema.properties ?? {};
|
|
144
|
+
for (const [name, field] of Object.entries(fields)) {
|
|
145
|
+
if (name.endsWith("_frame") || name.endsWith("_frames")) {
|
|
146
|
+
field.type = "integer";
|
|
147
|
+
field.minimum = name === "duration_frames" ? 1 : 0;
|
|
148
|
+
}
|
|
149
|
+
if (name === "gain_db")
|
|
150
|
+
Object.assign(field, { minimum: -96, maximum: 24 });
|
|
151
|
+
if (name === "reduction_db")
|
|
152
|
+
Object.assign(field, { minimum: -36, maximum: -1, default: -12 });
|
|
153
|
+
}
|
|
154
|
+
if (command.command === "/track-add")
|
|
155
|
+
fields.kind.enum = ["video", "audio", "caption"];
|
|
156
|
+
if (command.command === "/caption")
|
|
157
|
+
fields.style.enum = ["clean", "bold", "high-contrast"];
|
|
158
|
+
if (command.command === "/fit")
|
|
159
|
+
fields.mode.enum = ["fit", "fill", "crop"];
|
|
160
|
+
if (command.command === "/clip-audio")
|
|
161
|
+
fields.field.enum = ["gain", "mute", "fade-in", "fade-out"];
|
|
162
|
+
if (command.command === "/clip-delete")
|
|
163
|
+
fields.ripple.enum = ["--ripple"];
|
|
164
|
+
if (command.command === "/export-sequence") {
|
|
165
|
+
Object.assign(fields.aspect, { enum: ["16:9", "9:16", "1:1"], default: "16:9" });
|
|
166
|
+
Object.assign(fields.captions, { enum: ["burned", "sidecar", "omit"], default: "burned" });
|
|
167
|
+
}
|
|
168
|
+
if (command.command === "/crop")
|
|
169
|
+
fields.ratio.enum = ["16:9", "9:16", "1:1"];
|
|
170
|
+
if (command.command === "/bg")
|
|
171
|
+
fields.mode.enum = ["blur", "black"];
|
|
172
|
+
if (["/collapse", "/expand"].includes(command.command))
|
|
173
|
+
fields.side.enum = ["left", "right", "both"];
|
|
174
|
+
if (command.command === "/sort")
|
|
175
|
+
fields.order.enum = ["newest", "oldest"];
|
|
176
|
+
return schema;
|
|
177
|
+
}
|
|
178
|
+
function uiCommandAction(command) {
|
|
179
|
+
const action = command.uiAction;
|
|
180
|
+
if (!action || !uiActions.has(action))
|
|
181
|
+
throw new Error(`No UI action handler contract for ${command.command}: ${action}`);
|
|
182
|
+
const group = uiGroup(action);
|
|
183
|
+
const schema = commandSchema(command);
|
|
184
|
+
if (["viewer_set_original", "viewer_set_landscape", "viewer_set_portrait", "viewer_focus_file", "viewer_show_settings", "settings_landscape", "settings_portrait", "settings_square", "settings_audio", "settings_subs", "settings_bg", "settings_osg"].includes(action)) {
|
|
185
|
+
schema.properties = { asset_id: { type: "string", description: "Media to view or edit" }, ...schema.properties };
|
|
186
|
+
schema.required = ["asset_id", ...(schema.required ?? [])];
|
|
187
|
+
}
|
|
188
|
+
const target = targetForSchema(schema, group);
|
|
189
|
+
if (action === "open_crop" || ["viewer_set_original", "viewer_set_landscape", "viewer_set_portrait", "viewer_focus_file"].includes(action))
|
|
190
|
+
target.mediaKinds = ["image", "video", "final"];
|
|
191
|
+
if (action === "extract_skeleton")
|
|
192
|
+
target.mediaKinds = ["image"];
|
|
193
|
+
return {
|
|
194
|
+
id: `command.${command.command.slice(1)}`,
|
|
195
|
+
title: title(command.command),
|
|
196
|
+
description: command.description,
|
|
197
|
+
group,
|
|
198
|
+
command: command.command,
|
|
199
|
+
aliases: [...(command.aliases ?? [])],
|
|
200
|
+
keywords: [group, ...command.params.map((param) => param.description)],
|
|
201
|
+
scope: ["open_projects", "open_provider_keys", "open_actions", "x_connect"].includes(action) ? "global" : "book",
|
|
202
|
+
target,
|
|
203
|
+
handler: { kind: "ui", action: action },
|
|
204
|
+
inputSchema: schema,
|
|
205
|
+
surfaces: ["slash", "launcher"],
|
|
206
|
+
focus: /^(?:open_|show_|viewer_|settings_|speak_preview)/u.test(action) ? "dialog" : "composer",
|
|
207
|
+
confirmation: "none",
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function applicationCommandAction(command) {
|
|
211
|
+
if (!applicationCommands.has(command.command))
|
|
212
|
+
throw new Error(`No application handler contract for ${command.command}`);
|
|
213
|
+
const schema = commandSchema(command);
|
|
214
|
+
const group = /arrange|group|split$|generate-cell/u.test(command.command) ? "Notebook" : "Sequence";
|
|
215
|
+
return {
|
|
216
|
+
id: `command.${command.command.slice(1)}`, title: title(command.command), description: command.description,
|
|
217
|
+
group, command: command.command, aliases: [...(command.aliases ?? [])], keywords: [group],
|
|
218
|
+
scope: group === "Notebook" ? "notebook" : "sequence", target: targetForSchema(schema, group),
|
|
219
|
+
handler: { kind: "command", command: command.command }, inputSchema: schema,
|
|
220
|
+
surfaces: ["slash", "launcher"], focus: "composer", confirmation: "none",
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function toolAction(tool, command, reserved) {
|
|
224
|
+
const group = groupForTool(tool.name);
|
|
225
|
+
const schema = toolInputJsonSchema(tool.schema);
|
|
226
|
+
if (tool.name === "set_env_secret" && schema.properties?.value)
|
|
227
|
+
schema.properties.value.format = "password";
|
|
228
|
+
const preferredCommand = `/${tool.name.replaceAll("_", "-")}`;
|
|
229
|
+
const name = command?.command ?? (reserved.has(preferredCommand) ? `/tool-${preferredCommand.slice(1)}` : preferredCommand);
|
|
230
|
+
reserved.add(name);
|
|
231
|
+
const target = targetForSchema(schema, group);
|
|
232
|
+
const mediaType = GENERATION_MEDIA[tool.name];
|
|
233
|
+
return {
|
|
234
|
+
id: `tool.${tool.name}`,
|
|
235
|
+
title: tool.annotations?.title ?? title(tool.name),
|
|
236
|
+
description: command?.description ?? tool.description,
|
|
237
|
+
group,
|
|
238
|
+
command: name,
|
|
239
|
+
aliases: [...(command?.aliases ?? [])],
|
|
240
|
+
keywords: [tool.name, group, ...(mediaType ? [mediaType, "generate"] : [])],
|
|
241
|
+
scope: scopeForSchema(schema),
|
|
242
|
+
target,
|
|
243
|
+
handler: { kind: "tool", tool: tool.name },
|
|
244
|
+
inputSchema: schema,
|
|
245
|
+
...(command?.mcpTool?.injectParams ? { initialArgs: { ...command.mcpTool.injectParams } } : {}),
|
|
246
|
+
...(mediaType ? { generation: { provider: "catalog", operation: tool.name, mediaType } } : {}),
|
|
247
|
+
surfaces: target.kind === "asset" ? ["slash", "launcher", "cell-menu"]
|
|
248
|
+
: target.kind === "cell" ? ["slash", "launcher", "cell-menu", "selection-menu"] : ["slash", "launcher"],
|
|
249
|
+
focus: "dialog",
|
|
250
|
+
confirmation: confirmationForTool(tool),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
export function buildWorkspaceActionCatalog(tools, commands, surfaces = new Set(Object.keys(WORKSPACE_ACTION_SURFACES))) {
|
|
254
|
+
const reserved = new Set();
|
|
255
|
+
for (const command of commands) {
|
|
256
|
+
for (const name of [command.command, ...(command.aliases ?? [])]) {
|
|
257
|
+
const normalized = name.toLowerCase();
|
|
258
|
+
if (reserved.has(normalized))
|
|
259
|
+
throw new Error(`Duplicate workspace command or alias: ${name}`);
|
|
260
|
+
reserved.add(normalized);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const actions = commands.filter((command) => command.uiAction).map(uiCommandAction);
|
|
264
|
+
if (!actions.some((action) => action.id === "command.actions")) {
|
|
265
|
+
actions.push({
|
|
266
|
+
id: "command.actions", title: "All actions", description: "Search and run every workspace action.",
|
|
267
|
+
group: "Workspace", command: "/actions", aliases: [], keywords: ["commands", "tools", "help"],
|
|
268
|
+
scope: "global", target: { kind: "none" }, handler: { kind: "ui", action: "open_actions" },
|
|
269
|
+
inputSchema: { type: "object", properties: {} }, surfaces: ["slash", "launcher", "button"],
|
|
270
|
+
focus: "dialog", confirmation: "none",
|
|
271
|
+
});
|
|
272
|
+
reserved.add("/actions");
|
|
273
|
+
}
|
|
274
|
+
const toolNames = new Set(tools.map((tool) => tool.name));
|
|
275
|
+
if (toolNames.size !== tools.length)
|
|
276
|
+
throw new Error("Duplicate workspace tool name");
|
|
277
|
+
for (const command of commands) {
|
|
278
|
+
if (command.uiAction)
|
|
279
|
+
continue;
|
|
280
|
+
if (command.exposure === "composite" && !command.mcpTool) {
|
|
281
|
+
actions.push(applicationCommandAction(command));
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (!command.mcpTool || !toolNames.has(command.mcpTool.tool)) {
|
|
285
|
+
throw new Error(`No registered handler for ${command.command}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const coverage = [];
|
|
289
|
+
for (const tool of tools) {
|
|
290
|
+
groupForTool(tool.name);
|
|
291
|
+
const workflow = WORKFLOW_TOOLS[tool.name];
|
|
292
|
+
if (workflow) {
|
|
293
|
+
coverage.push({ tool: tool.name, ...workflow, exposure: "workflow" });
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const linkedCommands = commands.filter((command) => command.mcpTool?.tool === tool.name);
|
|
297
|
+
const action = toolAction(tool, linkedCommands[0], reserved);
|
|
298
|
+
actions.push(action);
|
|
299
|
+
for (const command of linkedCommands.slice(1)) {
|
|
300
|
+
actions.push({ ...toolAction(tool, command, reserved), id: `command.${command.command.slice(1)}` });
|
|
301
|
+
}
|
|
302
|
+
coverage.push({ tool: tool.name, actionId: action.id, exposure: "action", reason: "Available in Actions with validated inputs." });
|
|
303
|
+
}
|
|
304
|
+
const actionIds = new Set(actions.map((action) => action.id));
|
|
305
|
+
for (const action of actions) {
|
|
306
|
+
for (const surface of action.surfaces)
|
|
307
|
+
if (!surfaces.has(surface))
|
|
308
|
+
throw new Error(`No implemented surface ${surface} for ${action.id}`);
|
|
309
|
+
}
|
|
310
|
+
for (const entry of coverage) {
|
|
311
|
+
if (!actionIds.has(entry.actionId))
|
|
312
|
+
throw new Error(`No visible owning action for ${entry.tool}: ${entry.actionId}`);
|
|
313
|
+
}
|
|
314
|
+
return { actions, tools: coverage };
|
|
315
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const UI_ACTION_IDS = [
|
|
2
|
+
"open_upload", "open_inbox", "open_status", "copy_clipboard", "show_history",
|
|
3
|
+
"open_asset", "open_crop", "open_osg", "switch_book", "viewer_set_original",
|
|
4
|
+
"viewer_set_landscape", "viewer_set_portrait", "viewer_toggle_info",
|
|
5
|
+
"viewer_focus_file", "viewer_show_settings", "settings_landscape",
|
|
6
|
+
"settings_portrait", "settings_square", "settings_subs", "settings_audio",
|
|
7
|
+
"settings_bg", "settings_osg", "open_cold_open", "open_watermark", "open_post_composer", "open_post_dropbox", "open_post_icloud",
|
|
8
|
+
"open_notebook", "open_music_video", "start_goal", "open_alive_captions", "open_rename_all", "open_projects",
|
|
9
|
+
"close_viewer", "sidebar_collapse", "sidebar_expand", "sidebar_sort",
|
|
10
|
+
"open_provider_keys", "open_archive", "timeline_audio_add", "timeline_audio_move",
|
|
11
|
+
"timeline_audio_remove", "timeline_audio_update", "extract_skeleton",
|
|
12
|
+
"rewind_activity", "open_slot_player", "open_diagnostics",
|
|
13
|
+
"open_entities", "open_jobs", "open_revisions", "run_notebook", "save_notebook",
|
|
14
|
+
"speak_preview", "x_connect", "open_actions",
|
|
15
|
+
];
|
|
16
|
+
export const APPLICATION_COMMAND_IDS = [
|
|
17
|
+
"/arrange-videos-column", "/arrange-videos-row", "/group-images", "/split", "/split-clip",
|
|
18
|
+
"/caption", "/duck", "/fit", "/gap", "/generate-cell", "/insert", "/move",
|
|
19
|
+
"/overwrite", "/reframe", "/rough-cut", "/sound-effects", "/track-add",
|
|
20
|
+
"/track-remove", "/volume", "/clip-audio", "/clip-delete", "/clip-reverse", "/clip-trim", "/export-sequence",
|
|
21
|
+
];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export const WORKSPACE_TOOL_GROUPS = {
|
|
2
|
+
Workspace: [
|
|
3
|
+
"list_books", "create_book", "rename_book", "delete_book", "get_book", "get_book_usage",
|
|
4
|
+
"slash_commands", "list_workspace_actions", "chat", "chain", "video_goal", "assemble_goal",
|
|
5
|
+
],
|
|
6
|
+
Notebook: [
|
|
7
|
+
"list_notebooks", "create_notebook", "get_notebook", "list_notebook_actions",
|
|
8
|
+
"get_notebook_cell_details", "ensure_notebook_workflow_scaffold",
|
|
9
|
+
"rename_notebook", "delete_notebook", "create_notebook_cell",
|
|
10
|
+
"update_notebook_cell", "relayout_notebook", "move_notebook_cells",
|
|
11
|
+
"delete_notebook_cell", "connect_notebook_cells", "disconnect_notebook_cells",
|
|
12
|
+
"set_notebook_cell_input", "preview_notebook_generation", "run_notebook_cell",
|
|
13
|
+
"run_notebook", "set_notebook_media_slot", "attach_library_asset",
|
|
14
|
+
"plan_notebook_generation", "list_notebook_generation_plans", "plan_notebook_run",
|
|
15
|
+
"plan_notebook_subgraph", "list_notebook_run_plans", "enqueue_notebook_run",
|
|
16
|
+
"revise_notebook_generation_plan", "continue_notebook_generation",
|
|
17
|
+
],
|
|
18
|
+
Media: [
|
|
19
|
+
"upload_file", "asset_manifest", "crop_asset", "delete_asset", "rename_asset", "rename_all",
|
|
20
|
+
"mark_asset_seen", "duplicate_asset", "export_asset_to_project",
|
|
21
|
+
"read_asset_metadata", "download_video", "list_assets", "export_asset_file",
|
|
22
|
+
"check_duplicate_bytes",
|
|
23
|
+
"list_media_streams",
|
|
24
|
+
],
|
|
25
|
+
Video: [
|
|
26
|
+
"prepare_cold_open", "edit_cold_open", "trim_video", "split_video", "extract_video_clip", "split_video_by_durations",
|
|
27
|
+
"pad_video", "set_video_overlay", "animate_keywords", "alive_captions", "set_alive_captions",
|
|
28
|
+
"detect_scenes", "suggest_cuts", "analyze_jokes", "apply_cuts",
|
|
29
|
+
"change_video_speed", "timewarp_video", "reverse_video", "inject_first_frame",
|
|
30
|
+
"extract_frame",
|
|
31
|
+
"extract_notebook_frame", "splice_video", "smooth_scene_concat",
|
|
32
|
+
"analyze_video", "analyze_editing_moments", "get_editing_moments", "render_video", "get_render_settings", "create_watermark_card",
|
|
33
|
+
"apply_watermark", "get_watermark_config",
|
|
34
|
+
],
|
|
35
|
+
Audio: [
|
|
36
|
+
"trim_audio", "suggest_sfx", "apply_sfx", "sync_video_to_audio", "audio_boost",
|
|
37
|
+
"audio_mix", "extract_notebook_audio", "extract_audio", "make_cover_song",
|
|
38
|
+
"extend_audio_asset", "remove_sound", "replace_video_audio", "transcribe",
|
|
39
|
+
"read_transcript", "translate_subtitles", "isolate_vocals", "clean_video_audio",
|
|
40
|
+
"export_transcript_srt", "analyze_music", "get_music_analysis",
|
|
41
|
+
],
|
|
42
|
+
Images: [
|
|
43
|
+
"invert_image", "concat_images", "describe_image",
|
|
44
|
+
"get_image_subject_map", "analyze_image_subjects", "edit_image_subjects",
|
|
45
|
+
"list_image_edit_models",
|
|
46
|
+
"create_qr_outro", "create_qart", "create_qrbtf",
|
|
47
|
+
],
|
|
48
|
+
Generation: [
|
|
49
|
+
"estimate_cost", "rewrite_prompt", "rewrite_script",
|
|
50
|
+
"generate_image", "generate_video", "generate_audio", "list_generation_models",
|
|
51
|
+
],
|
|
52
|
+
Sequence: [
|
|
53
|
+
"get_timeline", "set_timeline", "render_timeline", "assign_slot",
|
|
54
|
+
"remove_timeline_slot", "add_timeline_audio",
|
|
55
|
+
"remove_timeline_audio", "move_timeline_audio", "update_timeline_audio",
|
|
56
|
+
"plan_sequence_edit", "plan_chat_command", "plan_generation_insert",
|
|
57
|
+
"continue_queued_insert", "preview_edit_intent", "commit_edit_intent",
|
|
58
|
+
"get_edit_action", "restore_edit_action", "validate_sequence_export",
|
|
59
|
+
"plan_sequence_export", "enqueue_sequence_export", "get_primary_sequence",
|
|
60
|
+
"add_sequence_track", "remove_sequence_track", "plan_notebook_rough_cut",
|
|
61
|
+
"plan_sequence_sound_effects", "plan_music_video", "commit_music_video", "get_sequence_rhythm", "update_sequence_rhythm",
|
|
62
|
+
],
|
|
63
|
+
Search: [
|
|
64
|
+
"search_moments", "suggest_sequence_coverage",
|
|
65
|
+
"get_search_coverage", "get_search_index_status", "register_search_manifest",
|
|
66
|
+
"pin_search_moment", "send_search_moment_to_sequence",
|
|
67
|
+
"list_sequence_replace_targets", "replace_sequence_clip_with_search_moment",
|
|
68
|
+
"repair_library_search_indexes", "prepare_search_reference",
|
|
69
|
+
"release_search_reference", "search_library_assets",
|
|
70
|
+
],
|
|
71
|
+
Tags: [
|
|
72
|
+
"edit_asset_tag", "suggest_asset_tags",
|
|
73
|
+
"backfill_asset_tags", "retag_asset", "configure_asset_tagging",
|
|
74
|
+
],
|
|
75
|
+
Entities: [
|
|
76
|
+
"create_character", "set_character_metadata", "reorder_character_images",
|
|
77
|
+
"update_script", "create_entity", "list_entities", "get_entity",
|
|
78
|
+
"update_entity", "delete_entity",
|
|
79
|
+
],
|
|
80
|
+
History: [
|
|
81
|
+
"asset_history", "restore_asset_version", "read_file_at_commit",
|
|
82
|
+
"list_cell_generations", "inspect_generation_request",
|
|
83
|
+
"record_prompt", "list_prompt_history", "list_book_actions",
|
|
84
|
+
"get_history_action",
|
|
85
|
+
],
|
|
86
|
+
Recovery: [
|
|
87
|
+
"clean_failed_assets", "recover_asset", "retry_generation",
|
|
88
|
+
"doctor", "archive_clip", "search_archive", "restore_archive_clips",
|
|
89
|
+
"reconcile_project_work", "wait_for_asset_ready", "list_ingest_status",
|
|
90
|
+
"retry_ingest", "list_jobs", "cancel_job", "retry_job",
|
|
91
|
+
"storage_status", "storage_sync",
|
|
92
|
+
],
|
|
93
|
+
Publishing: ["create_post", "update_post", "get_post", "list_posts", "link_post", "upload_post_to_dropbox", "save_post_to_icloud", "refresh_post_metrics", "record_post_metrics", "connect_service", "service_status", "post_icloud_sync_status", "draft_post_copy", "post", "verify_x_mentions"],
|
|
94
|
+
Providers: [
|
|
95
|
+
"check_kimi_coding_api", "list_chat_models", "provider_key_status", "set_env_secret",
|
|
96
|
+
"list_elevenlabs_voices",
|
|
97
|
+
],
|
|
98
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const WORKSPACE_ACTION_SURFACES = {
|
|
2
|
+
slash: { component: "src/components/videobook/RichComposerEditor.tsx", trigger: "Type / in chat; choose a command or alias" },
|
|
3
|
+
launcher: { component: "src/components/videobook/ComposerActionsPanel.tsx", trigger: "Search Actions in the main chat input; choose a command, then submit to continue" },
|
|
4
|
+
button: { component: "src/components/videobook/CommandComposer.tsx", trigger: "Actions beside the chat input; Ctrl+Shift+K / Cmd+Shift+K" },
|
|
5
|
+
"cell-menu": { component: "src/components/videobook/NotebookCellContextMenu.tsx", trigger: "Notebook cell context menu" },
|
|
6
|
+
"selection-menu": { component: "src/components/videobook/NotebookToolbar.tsx", trigger: "Selection actions in the notebook toolbar" },
|
|
7
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The connected X account's subscription tier, which decides how long a post
|
|
3
|
+
* may be: X gives every Premium tier (Basic, Premium, Premium+) long posts of
|
|
4
|
+
* up to 25,000 characters, while unsubscribed accounts keep 280.
|
|
5
|
+
*
|
|
6
|
+
* The tier is read from /2/users/me and cached in the application credential
|
|
7
|
+
* store next to the OAuth tokens, so posting never spends an extra API call.
|
|
8
|
+
* Callers refresh it after a new authorization or on explicit request.
|
|
9
|
+
*/
|
|
10
|
+
import { createX } from "@apicity/x";
|
|
11
|
+
import { appState } from "../app-state.js";
|
|
12
|
+
import { getValidAccessToken } from "./x-tokens.js";
|
|
13
|
+
export const X_POST_MAX_CHARACTERS = 280;
|
|
14
|
+
export const X_PREMIUM_POST_MAX_CHARACTERS = 25_000;
|
|
15
|
+
const SETTINGS_KEY = "x.account";
|
|
16
|
+
const SUBSCRIPTION_TYPES = ["None", "Basic", "Premium", "PremiumPlus"];
|
|
17
|
+
function isXSubscriptionType(value) {
|
|
18
|
+
return typeof value === "string"
|
|
19
|
+
&& SUBSCRIPTION_TYPES.includes(value);
|
|
20
|
+
}
|
|
21
|
+
/** Whether a tier unlocks long posts. Every paid tier does. */
|
|
22
|
+
function xAccountHasLongPosts(subscription) {
|
|
23
|
+
return subscription !== null && subscription !== "None";
|
|
24
|
+
}
|
|
25
|
+
export function xPostMaxCharacters(subscription) {
|
|
26
|
+
return xAccountHasLongPosts(subscription)
|
|
27
|
+
? X_PREMIUM_POST_MAX_CHARACTERS
|
|
28
|
+
: X_POST_MAX_CHARACTERS;
|
|
29
|
+
}
|
|
30
|
+
function parseAccountState(value) {
|
|
31
|
+
if (typeof value !== "object" || value === null)
|
|
32
|
+
return null;
|
|
33
|
+
const record = value;
|
|
34
|
+
if (typeof record.username !== "string"
|
|
35
|
+
|| !isXSubscriptionType(record.subscription_type)
|
|
36
|
+
|| typeof record.fetched_at !== "string") {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
username: record.username,
|
|
41
|
+
subscription_type: record.subscription_type,
|
|
42
|
+
fetched_at: record.fetched_at,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export async function readXAccount(store = appState) {
|
|
46
|
+
return parseAccountState(await store.get(SETTINGS_KEY));
|
|
47
|
+
}
|
|
48
|
+
export async function clearXAccount(store = appState) {
|
|
49
|
+
await store.set(SETTINGS_KEY, null);
|
|
50
|
+
}
|
|
51
|
+
/** Ask X who the token belongs to and cache the answer. */
|
|
52
|
+
export async function fetchXAccount(options = {}) {
|
|
53
|
+
const store = options.store ?? appState;
|
|
54
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
55
|
+
const accessToken = await getValidAccessToken({ fetchImpl, store });
|
|
56
|
+
const x = createX({ accessToken, fetch: fetchImpl });
|
|
57
|
+
const response = await x.get.v2.users.me({
|
|
58
|
+
"user.fields": ["username", "subscription_type"],
|
|
59
|
+
});
|
|
60
|
+
const username = response?.data?.username;
|
|
61
|
+
if (typeof username !== "string" || username.trim() === "") {
|
|
62
|
+
throw new Error("X did not return the connected account's username");
|
|
63
|
+
}
|
|
64
|
+
const subscription = response.data.subscription_type;
|
|
65
|
+
const account = {
|
|
66
|
+
username: username.replace(/^@/, "").trim(),
|
|
67
|
+
subscription_type: isXSubscriptionType(subscription) ? subscription : "None",
|
|
68
|
+
fetched_at: new Date().toISOString(),
|
|
69
|
+
};
|
|
70
|
+
await store.set(SETTINGS_KEY, account);
|
|
71
|
+
return account;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The cached account, fetched once when nothing is cached or when asked to
|
|
75
|
+
* refresh. A failed lookup keeps whatever was cached; null means unknown.
|
|
76
|
+
*/
|
|
77
|
+
export async function resolveXAccount(options = {}) {
|
|
78
|
+
const store = options.store ?? appState;
|
|
79
|
+
const cached = await readXAccount(store);
|
|
80
|
+
if (cached && !options.refresh)
|
|
81
|
+
return cached;
|
|
82
|
+
try {
|
|
83
|
+
return await fetchXAccount({ store, fetchImpl: options.fetchImpl });
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return cached;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the authenticated X user's handle via @apicity/x's /2/users/me endpoint.
|
|
3
|
+
*
|
|
4
|
+
* Returns the handle (no leading @) or null when no token is configured, the
|
|
5
|
+
* API rejects, or the response is malformed. Callers should treat null as
|
|
6
|
+
* "unknown" and fall back to a cached value or prompt the user.
|
|
7
|
+
*/
|
|
8
|
+
import { createX } from "@apicity/x";
|
|
9
|
+
import { getValidAccessToken } from "./x-tokens.js";
|
|
10
|
+
import { normalizeHandle } from "../watermark-config.js";
|
|
11
|
+
export async function fetchAuthenticatedXHandle() {
|
|
12
|
+
let accessToken;
|
|
13
|
+
try {
|
|
14
|
+
accessToken = await getValidAccessToken();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const x = createX({ accessToken });
|
|
21
|
+
const res = await x.get.v2.users.me({ "user.fields": ["username"] });
|
|
22
|
+
const username = res?.data?.username;
|
|
23
|
+
if (typeof username !== "string")
|
|
24
|
+
return null;
|
|
25
|
+
return normalizeHandle(username);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|