diff --git a/README.md b/README.md index 0b42020b63e742b9782dba2b1b843d81a6158f18..9e7703d0902b5bc406e49ab172c6df35436025fe 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ I have setup Prettier and ESLint, they use some basic rules (you can propose new To run all the tests (unit and e2e) please run: -`npm test` +`npm run test` This is not instantaneous: playwright may seems to do nothing for a while at first. diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..a704420547a8c3b28c5266a6f4d9e7ea3fcb6554 Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json index 75502ccae074d5c4015b868511a6af11b819605e..84ddfe40dc08a857bf6be9d32b932e352fe79066 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,44 @@ { - "name": "@aitube/clapper-monorepo", - "version": "1.0.0", - "private": true, - "description": "A monorepo for the Clapper project. Individual packages are in the packages directory.", - "workspaces": [ - "packages/*" - ], - "scripts": { - "dev": "npm install --verbose && npm run dev --workspaces", - "start": "npm run start --workspaces", - "build": "npm install --verbose && npm run build --workspaces", - "test": "npm run test --workspaces", - "format": "npm run format --workspaces" - } - } - \ No newline at end of file + "name": "@aitube/clapper-monorepo", + "version": "0.2.4", + "private": true, + "description": "A monorepo for the Clapper project. Individual packages are in the packages directory.", + "workspaces": [ + "packages/clap", + "packages/timeline", + "packages/api-client", + "packages/io", + "packages/colors", + "packages/engine", + "packages/broadway", + "packages/clapper-services", + "packages/app" + ], + "engines": { + "bun": ">=1.0.0" + }, + "scripts": { + "dev": "bun run --cwd packages/app dev", + "start": "bun run --cwd packages/app start", + "build": "bun run build:all", + "build:all": "bun run build:clap && bun run build:timeline && bun run build:api-client && bun run build:io && bun run build:colors && bun run build:engine && bun run build:broadway && bun run build:services && bun run build:app", + "build:clap": "bun run --cwd packages/clap build", + "build:timeline": "bun run --cwd packages/timeline build", + "build:api-client": "bun run --cwd packages/api-client build", + "build:io": "bun run --cwd packages/io build", + "build:colors": "bun run --cwd packages/colors build", + "build:engine": "bun run --cwd packages/engine build", + "build:broadway": "bun run --cwd packages/broadway build", + "build:clapper-services": "bun run --cwd packages/clapper-services build", + "build:app": "bun run --cwd packages/app build", + "test": "bun run test:all", + "test:all": "bun run --cwd packages/clap test && bun run --cwd packages/timeline test && bun run --cwd packages/api-client test && bun run --cwd packages/io test && bun run --cwd packages/colors test && bun run --cwd packages/engine test && bun run --cwd packages/broadway test && bun run --cwd packages/clapper-services test && bun run --cwd packages/app test", + "format": "bun run --cwd packages/app format" + }, + "packageManager": "bun@1.0.25", + "trustedDependencies": [ + "@aitube/clapper", + "onnxruntime-node", + "protobufjs" + ] +} \ No newline at end of file diff --git a/packages/api-client/README.md b/packages/api-client/README.md index 47bddccead821968bc0b4cadf43013971f6214f4..b2c17e1e2c81c10d925e80b316f580e8c97e2d56 100644 --- a/packages/api-client/README.md +++ b/packages/api-client/README.md @@ -1,4 +1,4 @@ -# @aitube/client +# @aitube/api-client *Official API client for AiTube.at* @@ -20,7 +20,7 @@ so we need to perform all API calls to `jbilcke-hf-ai-tube.hf.space`. To install the package, run the following command: ```bash -npm install @aitube/client +npm install @aitube/api-client ``` ## Getting Started @@ -48,7 +48,7 @@ import { ClapEntityPrompt, SupportedExportFormat, applyClapCompletion, - } from '@aitube/client' + } from '@aitube/api-client' const ultraSecret = "ultra secret token unavailable to common mortals" diff --git a/packages/api-client/bun.lockb b/packages/api-client/bun.lockb deleted file mode 100755 index ad73771dedbecc24af7a7e78dcd798c5bc9864c1..0000000000000000000000000000000000000000 Binary files a/packages/api-client/bun.lockb and /dev/null differ diff --git a/packages/api-client/package.json b/packages/api-client/package.json index e51a401e7f9711315b5b6ce1e2c4699541e2f9e4..67462a2f526df65666c3117f90a0086554f579ef 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -1,10 +1,10 @@ { - "name": "@aitube/client", + "name": "@aitube/api-client", "module": "index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "version": "0.2.4", "description": "Official API client for AiTube.at", "scripts": { "build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration", @@ -19,9 +19,6 @@ "rimraf": "^6.0.1", "typescript": "^5.5.4" }, - "peerDependencies": { - "@aitube/clap": "file:../clap" - }, "repository": { "type": "git", "url": "https://github.com/jbilcke-hf/aitube-client.git" diff --git a/packages/api-client/src/api/editClapVideos.ts b/packages/api-client/src/api/editClapVideos.ts index 7f02456bef0e9383f0c3282c14429732c8fbe93d..fd596f804a9d92a980a7735de6675ff20be6234c 100644 --- a/packages/api-client/src/api/editClapVideos.ts +++ b/packages/api-client/src/api/editClapVideos.ts @@ -43,7 +43,7 @@ export async function editClapVideos({ } // special trick to not touch the generated // storyboards that are used by pending videos - const idsOfStoryboardsToKeep = clap.segments.map(segment => { + const idsOfStoryboardsToKeep = clap.segments.map((segment: ClapSegment) => { const isPendingVideo = ( segment.category === ClapSegmentCategory.VIDEO @@ -61,7 +61,7 @@ export async function editClapVideos({ ).at(0) return storyboard?.id - }).filter(x => x) as string[] + }).filter((x: any) => x) as string[] const newClap = await fetchClap(`${aitubeApiUrl}edit/videos?${queryString.stringify(params)}`, { method: "POST", diff --git a/packages/app/package.json b/packages/app/package.json index 983dfba7a10bac3356759ca0db1041b5053731c9..f8cf45b61bbc24d4aa86220a4bd618011faead82 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@aitube/clapper", - "version": "0.0.8", + "version": "0.2.4", "private": true, "description": "🎬 Clapper", "license": "GPL-3.0-only", @@ -13,35 +13,35 @@ "public:": "./public" }, "scripts": { - "dev": "npm run checks && next dev", - "build": "npm run prepare && npm run checks && rm -Rf out && next build && npm run build:copyassets", - "build:ci": "rm -Rf out && npm run prepare && next build && npm run build:copyassets", - "build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/.next/static", - "prepare": "cp -R node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/", + "dev": "bun run checks && next dev", + "build": "bun run prepare && bun run checks && rm -Rf out && next build && bun run build:copyassets", + "build:ci": "rm -Rf out && bun run prepare && next build && bun run build:copyassets", + "build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/static", + "prepare": "cp -R ../../node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/", "start": "next start", "start:prod": "node .next/standalone/server.js", - "checks": "npm run format:fix && npm run lint", + "checks": "bun run format:fix && bun run lint", "format": "prettier --check --ignore-path .gitignore ./src/", "format:fix": "prettier --write --ignore-path .gitignore ./src/", "lint": "next lint", "lint:fix": "next lint --fix", - "test": "npm run build && npm run test:unit:ci", - "test_TEMPORARY_DISABLED": "npm run build && npm run test:unit:ci && npm run test:e2e", + "test": "bun run build && bun run test:unit:ci", + "test_TEMPORARY_DISABLED": "bun run build && bun run test:unit:ci && bun run test:e2e", "test:unit:ci": "vitest run", "test:unit:watch": "vitest", "test:e2e": "npx playwright test", - "electron": "npm run build && electron .", - "electron:start": "npm run build && electron-forge start", - "electron:package": "npm run build && electron-forge package", - "electron:make": "npm run build && electron-forge make" + "electron": "bun run build && electron .", + "electron:start": "bun run build && electron-forge start", + "electron:package": "bun run build && electron-forge package", + "electron:make": "bun run build && electron-forge make" }, "dependencies": { - "@aitube/broadway": "file:../broadway", - "@aitube/clap": "file:../clap", - "@aitube/clapper-services": "file:../services", - "@aitube/client": "file:../api-client", - "@aitube/engine": "file:../engine", - "@aitube/timeline": "file:../timeline", + "@aitube/api-client": "workspace:*", + "@aitube/broadway": "workspace:*", + "@aitube/clap": "workspace:*", + "@aitube/clapper-services": "workspace:*", + "@aitube/engine": "workspace:*", + "@aitube/timeline": "workspace:*", "@fal-ai/serverless-client": "^0.13.0", "@ffmpeg/ffmpeg": "^0.12.10", "@ffmpeg/util": "^0.12.1", diff --git a/packages/app/src/app/api/assistant/askAnyAssistant.ts b/packages/app/src/app/api/assistant/askAnyAssistant.ts index 04718e527261b53dce4b51aa543dc9945fe35998..4c0a7aaace9c3d2ed06e7e27dacfc8ba6b1f9adb 100644 --- a/packages/app/src/app/api/assistant/askAnyAssistant.ts +++ b/packages/app/src/app/api/assistant/askAnyAssistant.ts @@ -202,7 +202,7 @@ export async function askAnyAssistant({ }) // console.log('Lanchain success on the first time! rawResponse:', rawResponse) - assistantMessage = parseLangChainResponse(rawResponse) + assistantMessage = parseLangChainResponse(rawResponse as any) // console.log('assistantMessage:', assistantMessage) } catch (err) { // LangChain failure (this happens quite often, actually) diff --git a/packages/app/src/app/api/resolve/providers/aitube/index.ts b/packages/app/src/app/api/resolve/providers/aitube/index.ts index 11879347b22e6c08edc7c767a4d36dd65758e7ff..f8454e39563ac2aabab5177b2b65dbb00bf4dfe5 100644 --- a/packages/app/src/app/api/resolve/providers/aitube/index.ts +++ b/packages/app/src/app/api/resolve/providers/aitube/index.ts @@ -12,7 +12,7 @@ import { editClapSounds, editClapStoryboards, editClapVideos, -} from '@aitube/client' +} from '@aitube/api-client' import { getWorkflowInputValues } from '../getWorkflowInputValues' diff --git a/packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx b/packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx index 821d07fc2dcab112c2013d668dde25b369d7f74d..d34915ccc0ad1fa1c65d50b82f59f6ecc0f85c33 100644 --- a/packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx +++ b/packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx @@ -62,7 +62,7 @@ export function AssistantWorkflows() { - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( - {workflows.map((w) => ( + {workflows?.map((w) => ( @@ -11,36 +11,36 @@ export const cache: { tokenizer?: Promise } = {} -export async function loadModel( - modelId: string, - onProgress: (progress: number) => void -) { - onProgress(0) - const model = await (cache.model - ? cache.model - : (cache.model = Florence2ForConditionalGeneration.from_pretrained( - modelId, - { - dtype: 'fp32', - } - ))) +// export async function loadModel( +// modelId: string, +// onProgress: (progress: number) => void +// ) { +// onProgress(0) +// const model = await (cache.model +// ? cache.model +// : (cache.model = Florence2ForConditionalGeneration.from_pretrained( +// modelId, +// { +// dtype: 'fp32', +// } +// ))) - onProgress(33) +// onProgress(33) - const processor = await (cache.processor - ? cache.processor - : (cache.processor = AutoProcessor.from_pretrained(modelId))) +// const processor = await (cache.processor +// ? cache.processor +// : (cache.processor = AutoProcessor.from_pretrained(modelId))) - onProgress(66) +// onProgress(66) - const tokenizer = await (cache.tokenizer - ? cache.tokenizer - : (cache.tokenizer = AutoTokenizer.from_pretrained(modelId))) +// const tokenizer = await (cache.tokenizer +// ? cache.tokenizer +// : (cache.tokenizer = AutoTokenizer.from_pretrained(modelId))) - onProgress(100) +// onProgress(100) - return { model, processor, tokenizer } -} +// return { model, processor, tokenizer } +// } export function closeModel() { cache.model = undefined @@ -54,75 +54,86 @@ export async function extractCaptionsFromFrames( progress: number, storyboardIndex: number, nbStoryboards: number - ) => void -): Promise { - if (!(navigator as any).gpu) { - throw new Error(`Please enable WebGPU to analyze video frames: - -1. You need a modern browser such as Google Chrome 113+, Microsoft Edge 113+, Safari 18 (macOS 15), Firefox Nightly + ) => any +) { + return +} -2. You need to enable WebGPU (depends on your browser, see below) +// export async function extractCaptionsFromFrames( +// images: string[] = [], +// onProgress: ( +// progress: number, +// storyboardIndex: number, +// nbStoryboards: number +// ) => void +// ): Promise { +// if (!(navigator as any).gpu) { +// throw new Error(`Please enable WebGPU to analyze video frames: -2.1 For Chrome: Perform the following operations in the Chrome / Microsoft Edge address bar -The chrome://flags/#enable-unsafe-webgpu flag must be enabled (not enable-webgpu-developer-features). -Linux experimental support also requires launching the browser with --enable-features=Vulkan. +// 1. You need a modern browser such as Google Chrome 113+, Microsoft Edge 113+, Safari 18 (macOS 15), Firefox Nightly -2.2 For Safari 18 (macOS 15): WebGPU is enabled by default +// 2. You need to enable WebGPU (depends on your browser, see below) -2.3 For Firefox Nightly: Type about:config in the address bar and set 'dom.webgpu.enabled" to true -`) - } +// 2.1 For Chrome: Perform the following operations in the Chrome / Microsoft Edge address bar +// The chrome://flags/#enable-unsafe-webgpu flag must be enabled (not enable-webgpu-developer-features). +// Linux experimental support also requires launching the browser with --enable-features=Vulkan. - let progress = 0 +// 2.2 For Safari 18 (macOS 15): WebGPU is enabled by default - // for code example, see: - // https://github.com/xenova/transformers.js/pull/545#issuecomment-2183625876 +// 2.3 For Firefox Nightly: Type about:config in the address bar and set 'dom.webgpu.enabled" to true +// `) +// } - // Load model, processor, and tokenizer - const model_id = 'onnx-community/Florence-2-base-ft' +// let progress = 0 - const { model, processor, tokenizer } = await loadModel(model_id, (p) => { - onProgress((progress = p * 15), 0, images.length) - }) +// // for code example, see: +// // https://github.com/xenova/transformers.js/pull/545#issuecomment-2183625876 - // not all prompts will work properly, see the official examples: - // https://huggingface.co/microsoft/Florence-2-base-ft/blob/e7a5acc73559546de6e12ec0319cd7cc1fa2437c/processing_florence2.py#L115-L117 +// // Load model, processor, and tokenizer +// const model_id = 'onnx-community/Florence-2-base-ft' - // Prepare text inputs - const prompts = 'Describe with a paragraph what is shown in the image.' - // const prompts = 'Decompose the following video frame into era, genre, location, weather, characters, and action. Give the answer in YAML.' +// const { model, processor, tokenizer } = await loadModel(model_id, (p) => { +// onProgress((progress = p * 15), 0, images.length) +// }) - const text_inputs = tokenizer(prompts) +// // not all prompts will work properly, see the official examples: +// // https://huggingface.co/microsoft/Florence-2-base-ft/blob/e7a5acc73559546de6e12ec0319cd7cc1fa2437c/processing_florence2.py#L115-L117 - let i = 1 - const captions: string[] = [] - for (const imageInBase64DataUri of images) { - console.log('analyzing image:', imageInBase64DataUri.slice(0, 64)) - // Prepare vision inputs - const image = await RawImage.fromURL(imageInBase64DataUri) - const vision_inputs = await processor(image) +// // Prepare text inputs +// const prompts = 'Describe with a paragraph what is shown in the image.' +// // const prompts = 'Decompose the following video frame into era, genre, location, weather, characters, and action. Give the answer in YAML.' - console.log(' - generating caption..') - // Generate text - const generated_ids = await model.generate({ - ...text_inputs, - ...vision_inputs, - max_new_tokens: 100, - }) +// const text_inputs = tokenizer(prompts) - // Decode generated text - const generated_text = tokenizer.batch_decode(generated_ids, { - skip_special_tokens: true, - }) +// let i = 1 +// const captions: string[] = [] +// for (const imageInBase64DataUri of images) { +// console.log('analyzing image:', imageInBase64DataUri.slice(0, 64)) +// // Prepare vision inputs +// const image = await RawImage.fromURL(imageInBase64DataUri) +// const vision_inputs = await processor(image) - const caption = `${generated_text[0] || ''}` - console.log(' - caption:', caption) +// console.log(' - generating caption..') +// // Generate text +// const generated_ids = await model.generate({ +// ...text_inputs, +// ...vision_inputs, +// max_new_tokens: 100, +// }) - const relativeProgress = i / images.length +// // Decode generated text +// const generated_text = tokenizer.batch_decode(generated_ids, { +// skip_special_tokens: true, +// }) - progress += relativeProgress * 75 - onProgress(progress, i, images.length) - captions.push(caption) - } - return captions -} +// const caption = `${generated_text[0] || ''}` +// console.log(' - caption:', caption) + +// const relativeProgress = i / images.length + +// progress += relativeProgress * 75 +// onProgress(progress, i, images.length) +// captions.push(caption) +// } +// return captions +// } diff --git a/packages/app/src/services/autocomplete/useAutocomplete.ts b/packages/app/src/services/autocomplete/useAutocomplete.ts index b0c4846fb77f05555a55a0942dec391f09278e54..997420e62f7020600a19852fb3e046796d5ef099 100644 --- a/packages/app/src/services/autocomplete/useAutocomplete.ts +++ b/packages/app/src/services/autocomplete/useAutocomplete.ts @@ -133,27 +133,27 @@ export const useAutocomplete = create((set, get) => ({ // able to decompose a scene automatically for (const sentence of sentences) { if (sentence.match(/(?:is wearing|wears)/)) { - categories.CHARACTER.push(sentence) + categories[ClapSegmentCategory.CHARACTER].push(sentence) } else if (sentence.match(/(?:the (?:image|screen) (?:is|has))/)) { - categories.STYLE.push(sentence) + categories[ClapSegmentCategory.STYLE].push(sentence) } else if ( sentence.match( /(?:the (?:lighting|lights|light|fire|sun|moon)|bright|dim|neon|candle|lit up)/ ) ) { - categories.LIGHTING.push(sentence) + categories[ClapSegmentCategory.LIGHTING].push(sentence) } else if ( sentence.match( /(?:the (?:man|woman|kid|child|person|animal|person|robot)|(?:she|he) (?:has|is))/ ) ) { - categories.CHARACTER.push(sentence) + categories[ClapSegmentCategory.CHARACTER].push(sentence) } else if ( sentence.match(/(?:behind the|background|room|location|place)/) ) { - categories.LOCATION.push(sentence) + categories[ClapSegmentCategory.LOCATION].push(sentence) } else { - categories.GENERIC.push(sentence) + categories[ClapSegmentCategory.GENERIC].push(sentence) } } diff --git a/packages/app/src/services/io/ffmpegUtils.ts b/packages/app/src/services/io/ffmpegUtils.ts index 40b85972f9369e6cd0623dd7bcba2775551eb5dd..80eb8e07e5e2efa025dc9a99f23bff00bf659cd3 100644 --- a/packages/app/src/services/io/ffmpegUtils.ts +++ b/packages/app/src/services/io/ffmpegUtils.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import { UUID } from '@aitube/clap' import { FFmpeg } from '@ffmpeg/ffmpeg' import { toBlobURL } from '@ffmpeg/util' diff --git a/packages/app/src/services/io/fix-xenova-transformers.d.ts b/packages/app/src/services/io/fix-xenova-transformers.d.ts deleted file mode 100644 index f9e2aac7d4b8b468a26fe4fa649984940b42f138..0000000000000000000000000000000000000000 --- a/packages/app/src/services/io/fix-xenova-transformers.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module '@xenova/transformers' diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index be58954c745a70e996106cbe06fa8ec01018901c..c2cc2f8731a7e72aac9f70b92e382f65defa826c 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -7,6 +7,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", + "noImplicitAny": false, "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, diff --git a/packages/broadway/bun.lockb b/packages/broadway/bun.lockb deleted file mode 100755 index 42749859dd94430131bc6b196c3af726d78f95fe..0000000000000000000000000000000000000000 Binary files a/packages/broadway/bun.lockb and /dev/null differ diff --git a/packages/broadway/package.json b/packages/broadway/package.json index c67dc7bd6d4d79ad15a47da03f6fff26b3090fa5..92a95f9191a7bea2f2f84eeeeefb2ed5d975c9c0 100644 --- a/packages/broadway/package.json +++ b/packages/broadway/package.json @@ -4,7 +4,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "version": "0.2.4", "description": "Convert a script to a clap file", "scripts": { "test": "bun test --preload ./src/tests/setup.js", @@ -15,16 +15,12 @@ "update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build" }, "devDependencies": { - "@aitube/io": "file:../io", + "@aitube/io": "workspace:*", "bun-types": "latest", "prettier": "^3.3.3", "rimraf": "^6.0.1", "typescript": "^5.5.4" }, - "peerDependencies": { - "@aitube/clap": "file:../clap", - "@aitube/colors": "file:../colors" - }, "repository": { "type": "git", "url": "https://github.com/jbilcke-hf/aitube-broadway.git" diff --git a/packages/broadway/src/parsers/utils/getParserItemFromLabel.ts b/packages/broadway/src/parsers/utils/getParserItemFromLabel.ts index b6bddc172d131591141a070bfed8e0379dbef5bf..710b53864f6bb9acdd9639f4a2985c5b84460bf5 100644 --- a/packages/broadway/src/parsers/utils/getParserItemFromLabel.ts +++ b/packages/broadway/src/parsers/utils/getParserItemFromLabel.ts @@ -1,4 +1,4 @@ -import { ClapSegmentCategory } from "@aitube/clap" +// import { ClapSegmentCategory } from "@aitube/clap" import { NamedEntity } from "@/types" @@ -33,7 +33,7 @@ export const getParserItemFromLabel = (database: NamedEntity[]) => { return defaultEmptyItem } - const prompts: Partial> = + const prompts: Partial> = typeof item.prompts === "undefined" ? defaultEmptyItem.prompts! : item.prompts return { diff --git a/packages/broadway/src/types.ts b/packages/broadway/src/types.ts index 856d4547068e1c1004483d55804010f3d80a74db..574fcb4968b13e829023b93383c665ae6a5b4c58 100644 --- a/packages/broadway/src/types.ts +++ b/packages/broadway/src/types.ts @@ -1,5 +1,5 @@ import { ScreenplaySequenceType } from "@/constants/screenplaySequences" -import { ClapSegmentCategory } from "@aitube/clap" +// import { ClapSegmentCategory } from "@aitube/clap" export type NamedEntity = { label: string @@ -7,7 +7,7 @@ export type NamedEntity = { en: string[] } prompts: Omit< - Record, + Record, "SPLAT" | "INTERFACE" | "EVENT" | "EFFECT" | "PHENOMENON" | "MESH" | "DEPTH" | "VIDEO" | "STORYBOARD" | "GENERIC" > } diff --git a/packages/clap/bun.lockb b/packages/clap/bun.lockb deleted file mode 100755 index 8add52af2010d783c9258b706cba3781d77091f5..0000000000000000000000000000000000000000 Binary files a/packages/clap/bun.lockb and /dev/null differ diff --git a/packages/clap/package.json b/packages/clap/package.json index c24adfff9060b48f10aed2179d27c2933c9bdc89..9244736050e9210e53ac8d32933121a9ab16b97a 100644 --- a/packages/clap/package.json +++ b/packages/clap/package.json @@ -2,9 +2,10 @@ "name": "@aitube/clap", "module": "index.ts", "main": "dist/index.js", + "private": false, "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "version": "0.2.4", "description": "Types and helpers to manipulate .clap files", "scripts": { "build": "bun build ./src/index.ts --outfile=dist/index.js --external=yaml && bun run build:declaration", @@ -43,4 +44,4 @@ "dist/*.d.ts", "dist/**/*.d.ts" ] -} +} \ No newline at end of file diff --git a/packages/clap/src/constants/index.ts b/packages/clap/src/constants/index.ts index 0910633bebfa95e104d36fd99e158217be82a8d8..428d841b3709fe928d6af16801d8f3853daee2db 100644 --- a/packages/clap/src/constants/index.ts +++ b/packages/clap/src/constants/index.ts @@ -1 +1 @@ -export { defaultMediaOrientation } from "./defaultValues" \ No newline at end of file +export { defaultMediaOrientation } from "@/constants/defaultValues" \ No newline at end of file diff --git a/packages/clap/src/converters/index.ts b/packages/clap/src/converters/index.ts index 1a4daa0a2b7e86db0edb96b1ecffeace72e3ccf4..5bfbdbeb68c8a33d9af66694d6109baf2b64c332 100644 --- a/packages/clap/src/converters/index.ts +++ b/packages/clap/src/converters/index.ts @@ -1,3 +1,3 @@ -export { blobToDataUri } from './blobToDataUri' -export { clapToDataUri } from './clapToDataUri' -export { dataUriToBlob } from './dataUriToBlob' +export { blobToDataUri } from '@/converters/blobToDataUri' +export { clapToDataUri } from '@/converters/clapToDataUri' +export { dataUriToBlob } from '@/converters/dataUriToBlob' diff --git a/packages/clap/src/factories/index.ts b/packages/clap/src/factories/index.ts index a51443d71ba9c53ceed08721289a0a58112c0d2e..f324fa796e39ae7d7be0ea52d4e01921ca1d035e 100644 --- a/packages/clap/src/factories/index.ts +++ b/packages/clap/src/factories/index.ts @@ -1,4 +1,4 @@ -export { newClap } from './newClap' -export { newEntity } from './newEntity' -export { newSegment } from './newSegment' -export { newWorkflow } from './newWorkflow' +export { newClap } from '@/factories/newClap' +export { newEntity } from '@/factories/newEntity' +export { newSegment } from '@/factories/newSegment' +export { newWorkflow } from '@/factories/newWorkflow' diff --git a/packages/clap/src/factories/newSegment.ts b/packages/clap/src/factories/newSegment.ts index 408c8ca62ff512361eaa68f180fefbb3869d45f8..9af3ca7da1d11679b8f8a19799211488815b35a3 100644 --- a/packages/clap/src/factories/newSegment.ts +++ b/packages/clap/src/factories/newSegment.ts @@ -3,7 +3,7 @@ import { isValidNumber } from "@/utils/isValidNumber" import { generateSeed } from "@/utils/generateSeed" import { UUID } from "@/utils/uuid" import { parseSegmentCategory } from "@/utils/parseSegmentCategory" -import { parseOutputType } from ".." +import { parseOutputType } from "@/index" export function newSegment(maybeSegment?: Partial) { diff --git a/packages/clap/src/helpers/index.ts b/packages/clap/src/helpers/index.ts index 885cd67ca43c0df0b0295daedbf816ab5b019bb6..ea7659caf9026e8b2f5d267d1b5bb01786bfc282 100644 --- a/packages/clap/src/helpers/index.ts +++ b/packages/clap/src/helpers/index.ts @@ -1,6 +1,6 @@ -export { buildEntityIndex } from './buildEntityIndex' -export { filterAssets } from './filterAssets' -export { filterSegmentsByCategory } from './filterSegmentsByCategory' -export { getEmptyClap } from './getEmptyClap' -export { generateClapFromSimpleStory } from './generateClapFromSimpleStory' -export { removeGeneratedAssetUrls } from './removeGeneratedAssetUrls' \ No newline at end of file +export { buildEntityIndex } from '@/helpers/buildEntityIndex' +export { filterAssets } from '@/helpers/filterAssets' +export { filterSegmentsByCategory } from '@/helpers/filterSegmentsByCategory' +export { getEmptyClap } from '@/helpers/getEmptyClap' +export { generateClapFromSimpleStory } from '@/helpers/generateClapFromSimpleStory' +export { removeGeneratedAssetUrls } from '@/helpers/removeGeneratedAssetUrls' \ No newline at end of file diff --git a/packages/clap/src/index.ts b/packages/clap/src/index.ts index 0e18cb9082a23819c45090ef6d429325a8e7dbc8..46e8d8b198511c3f7b3053fcb4174a9397db45c3 100644 --- a/packages/clap/src/index.ts +++ b/packages/clap/src/index.ts @@ -37,22 +37,22 @@ export { ClapWorkflowCategory, ClapWorkflowProvider, ClapWorkflow -} from './types' +} from '@/types' export { defaultMediaOrientation -} from './constants' +} from '@/constants' export { newClap, newEntity, newSegment, newWorkflow -} from './factories' +} from '@/factories' export { parseClap, serializeClap, fetchClap, updateClap -} from './io' +} from '@/io' export { filterSegments, filterSegmentsWithinRange, @@ -68,12 +68,12 @@ export { parseSegmentCategory, parseSegmentStatus, UUID -} from './utils' +} from '@/utils' export { blobToDataUri, dataUriToBlob, clapToDataUri -} from './converters' +} from '@/converters' export { buildEntityIndex, filterAssets, @@ -81,7 +81,7 @@ export { generateClapFromSimpleStory, getEmptyClap, removeGeneratedAssetUrls, -} from './helpers' +} from '@/helpers' export { sanitizeEntities, sanitizeEntity, @@ -90,4 +90,4 @@ export { sanitizeSegments, sanitizeWorkflow, sanitizeWorkflows, -} from './sanitizers' \ No newline at end of file +} from '@/sanitizers' \ No newline at end of file diff --git a/packages/clap/src/io/index.ts b/packages/clap/src/io/index.ts index 8095718e147f067402d22b30940d933d0b8acbf3..5a46c8124d14bfadb29a98210cdbbeb1f497759f 100644 --- a/packages/clap/src/io/index.ts +++ b/packages/clap/src/io/index.ts @@ -1,4 +1,4 @@ -export { parseClap } from './parseClap' -export { serializeClap } from './serializeClap' -export { fetchClap } from './fetchClap' -export { updateClap } from './updateClap' +export { parseClap } from '@/io/parseClap' +export { serializeClap } from '@/io/serializeClap' +export { fetchClap } from '@/io/fetchClap' +export { updateClap } from '@/io/updateClap' diff --git a/packages/clap/src/io/parseClap.ts b/packages/clap/src/io/parseClap.ts index dce62f82d20578565b02aaa725efebb35b07ccf2..d3cdecc1a2a7591a590051fa5e29bb9314dd686e 100644 --- a/packages/clap/src/io/parseClap.ts +++ b/packages/clap/src/io/parseClap.ts @@ -1,7 +1,7 @@ import YAML from "yaml" -import { ClapHeader, ClapMeta, ClapEntity, ClapProject, ClapScene, ClapSegment, ClapFormat, ParseClapProgressUpdate, ClapWorkflow } from "../types" -import { dataUriToBlob } from "../converters/dataUriToBlob" +import { ClapHeader, ClapMeta, ClapEntity, ClapProject, ClapScene, ClapSegment, ClapFormat, ParseClapProgressUpdate, ClapWorkflow } from "@/types" +import { dataUriToBlob } from "@/converters/dataUriToBlob" import { buildEntityIndex } from "@/helpers/buildEntityIndex" import { sanitizeWorkflows } from "@/sanitizers/sanitizeWorkflows" import { sanitizeEntities } from "@/sanitizers/sanitizeEntities" diff --git a/packages/clap/src/sanitizers/index.ts b/packages/clap/src/sanitizers/index.ts index 6cf2b0f531f8ead8f0b2ec13bea86fd96ed3a7f4..df6b6bca330d100eac6964bb5b871820df32bd6d 100644 --- a/packages/clap/src/sanitizers/index.ts +++ b/packages/clap/src/sanitizers/index.ts @@ -1,7 +1,7 @@ -export { sanitizeEntities } from "./sanitizeEntities" -export { sanitizeEntity } from "./sanitizeEntity" -export { sanitizeMeta } from "./sanitizeMeta" -export { sanitizeSegment } from "./sanitizeSegment" -export { sanitizeSegments } from "./sanitizeSegments" -export { sanitizeWorkflow } from "./sanitizeWorkflow" -export { sanitizeWorkflows } from "./sanitizeWorkflows" \ No newline at end of file +export { sanitizeEntities } from "@/sanitizers/sanitizeEntities" +export { sanitizeEntity } from "@/sanitizers/sanitizeEntity" +export { sanitizeMeta } from "@/sanitizers/sanitizeMeta" +export { sanitizeSegment } from "@/sanitizers/sanitizeSegment" +export { sanitizeSegments } from "@/sanitizers/sanitizeSegments" +export { sanitizeWorkflow } from "@/sanitizers/sanitizeWorkflow" +export { sanitizeWorkflows } from "@/sanitizers/sanitizeWorkflows" \ No newline at end of file diff --git a/packages/clap/src/sanitizers/sanitizeEntities.ts b/packages/clap/src/sanitizers/sanitizeEntities.ts index 78774c34f972dee572104985ed8f15b44fee67a1..ad84dfdabc89efd3ab90f13ec05a9319e201f708 100644 --- a/packages/clap/src/sanitizers/sanitizeEntities.ts +++ b/packages/clap/src/sanitizers/sanitizeEntities.ts @@ -1,5 +1,5 @@ import { ClapEntity } from "@/types"; -import { sanitizeEntity } from "./sanitizeEntity"; +import { sanitizeEntity } from "@/sanitizers/sanitizeEntity"; export function sanitizeEntities(maybeEntities: ClapEntity[] = []): ClapEntity[] { return maybeEntities.map(entity => sanitizeEntity(entity)) diff --git a/packages/clap/src/sanitizers/sanitizeSegments.ts b/packages/clap/src/sanitizers/sanitizeSegments.ts index a84e5b6dd1003530f4fc4aaa2b157ec3bb4957b2..e9bafcc4390676ca8b3ae590f602ad2841d98d92 100644 --- a/packages/clap/src/sanitizers/sanitizeSegments.ts +++ b/packages/clap/src/sanitizers/sanitizeSegments.ts @@ -1,5 +1,5 @@ import { ClapSegment } from "@/types"; -import { sanitizeSegment } from "./sanitizeSegment"; +import { sanitizeSegment } from "@/sanitizers/sanitizeSegment"; export function sanitizeSegments(maybeSegments: ClapSegment[] = []): ClapSegment[] { return maybeSegments.map(segment => sanitizeSegment(segment)) diff --git a/packages/clap/src/sanitizers/sanitizeWorkflows.ts b/packages/clap/src/sanitizers/sanitizeWorkflows.ts index 03c31064dfd2292921d8031ce37a5bd15bee1d9e..ee70c018cfaafe21415e8bacc5c075495c64316c 100644 --- a/packages/clap/src/sanitizers/sanitizeWorkflows.ts +++ b/packages/clap/src/sanitizers/sanitizeWorkflows.ts @@ -1,5 +1,5 @@ import { ClapWorkflow } from "@/types"; -import { sanitizeWorkflow } from "./sanitizeWorkflow"; +import { sanitizeWorkflow } from "@/sanitizers/sanitizeWorkflow"; export function sanitizeWorkflows(maybeWorkflows: ClapWorkflow[] = []): ClapWorkflow[] { return maybeWorkflows.map(workflow => sanitizeWorkflow(workflow)) diff --git a/packages/clap/src/utils/filterSegments.ts b/packages/clap/src/utils/filterSegments.ts index fda915f7d4040b7636c3c4d2f8234b8cca287bdd..336dd29164d153815e37566484c66b4cb39fff15 100644 --- a/packages/clap/src/utils/filterSegments.ts +++ b/packages/clap/src/utils/filterSegments.ts @@ -1,5 +1,5 @@ import { ClapSegment, ClapSegmentCategory, ClapSegmentFilteringMode } from "@/types" -import { filterSegmentsWithinRange } from "./filterSegmentsWithinRange" +import { filterSegmentsWithinRange } from "@/utils/filterSegmentsWithinRange" /** * Return all the segments within the provided reference segment, for the given mode: diff --git a/packages/clap/src/utils/index.ts b/packages/clap/src/utils/index.ts index 124e8dd5c328f96c49bfd7523f8a3d73ea91fe22..0136dbf236bfe7e001f01284baaece072399774b 100644 --- a/packages/clap/src/utils/index.ts +++ b/packages/clap/src/utils/index.ts @@ -1,14 +1,14 @@ -export { filterSegments } from './filterSegments' -export { filterSegmentsWithinRange } from './filterSegmentsWithinRange' -export { generateSeed } from './generateSeed' -export { getClapAssetSourceType } from './getClapAssetSourceType' -export { getValidNumber } from './getValidNumber' -export { isValidNumber } from './isValidNumber' -export { parseMediaOrientation } from './parseMediaOrientation' -export { parseOutputType } from './parseOutputType' -export { parseSegmentCategory } from './parseSegmentCategory' -export { parseSegmentStatus } from './parseSegmentStatus' -export { parseWorkflowEngine } from './parseWorkflowEngine' -export { parseWorkflowCategory } from './parseWorkflowCategory' -export { parseWorkflowProvider } from './parseWorkflowProvider' -export { UUID } from './uuid' \ No newline at end of file +export { filterSegments } from '@/utils/filterSegments' +export { filterSegmentsWithinRange } from '@/utils/filterSegmentsWithinRange' +export { generateSeed } from '@/utils/generateSeed' +export { getClapAssetSourceType } from '@/utils/getClapAssetSourceType' +export { getValidNumber } from '@/utils/getValidNumber' +export { isValidNumber } from '@/utils/isValidNumber' +export { parseMediaOrientation } from '@/utils/parseMediaOrientation' +export { parseOutputType } from '@/utils/parseOutputType' +export { parseSegmentCategory } from '@/utils/parseSegmentCategory' +export { parseSegmentStatus } from '@/utils/parseSegmentStatus' +export { parseWorkflowEngine } from '@/utils/parseWorkflowEngine' +export { parseWorkflowCategory } from '@/utils/parseWorkflowCategory' +export { parseWorkflowProvider } from '@/utils/parseWorkflowProvider' +export { UUID } from '@/utils/uuid' \ No newline at end of file diff --git a/packages/clap/src/utils/parseSegmentCategory.ts b/packages/clap/src/utils/parseSegmentCategory.ts index b909725b41daea9511d9cf585293f28d29551c42..4dc78c230d322f43e4a1b0d55d832577e942648e 100644 --- a/packages/clap/src/utils/parseSegmentCategory.ts +++ b/packages/clap/src/utils/parseSegmentCategory.ts @@ -1,4 +1,4 @@ -import { ClapSegmentCategory } from "@/types" +import { ClapSegmentCategory } from "../types" export function parseSegmentCategory(input: any, defaultCategory?: ClapSegmentCategory): ClapSegmentCategory { diff --git a/packages/services/.gitignore b/packages/clapper-services/.gitignore similarity index 100% rename from packages/services/.gitignore rename to packages/clapper-services/.gitignore diff --git a/packages/services/.npmignore b/packages/clapper-services/.npmignore similarity index 100% rename from packages/services/.npmignore rename to packages/clapper-services/.npmignore diff --git a/packages/services/.prettierrc.json b/packages/clapper-services/.prettierrc.json similarity index 100% rename from packages/services/.prettierrc.json rename to packages/clapper-services/.prettierrc.json diff --git a/packages/services/LICENSE.md b/packages/clapper-services/LICENSE.md similarity index 100% rename from packages/services/LICENSE.md rename to packages/clapper-services/LICENSE.md diff --git a/packages/services/README.md b/packages/clapper-services/README.md similarity index 100% rename from packages/services/README.md rename to packages/clapper-services/README.md diff --git a/packages/services/package.json b/packages/clapper-services/package.json similarity index 88% rename from packages/services/package.json rename to packages/clapper-services/package.json index 1a08bfc4fba83d78c79461d6b085cb837ec9f7b1..465c9ea253e289f3f6e6d751c330c9d63b98e0c3 100644 --- a/packages/services/package.json +++ b/packages/clapper-services/package.json @@ -4,7 +4,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3-2", + "version": "0.2.4", "description": "Base types for Clapper services", "scripts": { "build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap --external=@aitube/timeline --external=@monaco-editor/react --external=monaco-editor --external=zustand --external=react --external=react-dom && bun run build:declaration", @@ -22,8 +22,8 @@ "typescript": "^5.5.4" }, "peerDependencies": { - "@aitube/clap": "file:../clap", - "@aitube/timeline": "file:../timeline", + "@aitube/clap": "workspace:*", + "@aitube/timeline": "workspace:*", "@monaco-editor/react": "4.6.0", "monaco-editor": "0.50.0", "react": "*", @@ -32,7 +32,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/jbilcke-hf/clapper-services.git" + "url": "https://github.com/jbilcke-hf/services.git" }, "keywords": [ "Clapper", diff --git a/packages/services/src/assistant.ts b/packages/clapper-services/src/assistant.ts similarity index 100% rename from packages/services/src/assistant.ts rename to packages/clapper-services/src/assistant.ts diff --git a/packages/services/src/audio.ts b/packages/clapper-services/src/audio.ts similarity index 100% rename from packages/services/src/audio.ts rename to packages/clapper-services/src/audio.ts diff --git a/packages/services/src/base-types.ts b/packages/clapper-services/src/base-types.ts similarity index 100% rename from packages/services/src/base-types.ts rename to packages/clapper-services/src/base-types.ts diff --git a/packages/services/src/broadcast.ts b/packages/clapper-services/src/broadcast.ts similarity index 100% rename from packages/services/src/broadcast.ts rename to packages/clapper-services/src/broadcast.ts diff --git a/packages/services/src/editors.ts b/packages/clapper-services/src/editors.ts similarity index 100% rename from packages/services/src/editors.ts rename to packages/clapper-services/src/editors.ts diff --git a/packages/services/src/entity-editor.ts b/packages/clapper-services/src/entity-editor.ts similarity index 100% rename from packages/services/src/entity-editor.ts rename to packages/clapper-services/src/entity-editor.ts diff --git a/packages/services/src/filter-editor.ts b/packages/clapper-services/src/filter-editor.ts similarity index 100% rename from packages/services/src/filter-editor.ts rename to packages/clapper-services/src/filter-editor.ts diff --git a/packages/services/src/index.ts b/packages/clapper-services/src/index.ts similarity index 100% rename from packages/services/src/index.ts rename to packages/clapper-services/src/index.ts diff --git a/packages/services/src/io.ts b/packages/clapper-services/src/io.ts similarity index 100% rename from packages/services/src/io.ts rename to packages/clapper-services/src/io.ts diff --git a/packages/services/src/mic.ts b/packages/clapper-services/src/mic.ts similarity index 100% rename from packages/services/src/mic.ts rename to packages/clapper-services/src/mic.ts diff --git a/packages/services/src/monitor.ts b/packages/clapper-services/src/monitor.ts similarity index 100% rename from packages/services/src/monitor.ts rename to packages/clapper-services/src/monitor.ts diff --git a/packages/services/src/plugin.ts b/packages/clapper-services/src/plugin.ts similarity index 100% rename from packages/services/src/plugin.ts rename to packages/clapper-services/src/plugin.ts diff --git a/packages/services/src/plugins.ts b/packages/clapper-services/src/plugins.ts similarity index 100% rename from packages/services/src/plugins.ts rename to packages/clapper-services/src/plugins.ts diff --git a/packages/services/src/project-editor.ts b/packages/clapper-services/src/project-editor.ts similarity index 100% rename from packages/services/src/project-editor.ts rename to packages/clapper-services/src/project-editor.ts diff --git a/packages/services/src/renderer.ts b/packages/clapper-services/src/renderer.ts similarity index 100% rename from packages/services/src/renderer.ts rename to packages/clapper-services/src/renderer.ts diff --git a/packages/services/src/resolver.ts b/packages/clapper-services/src/resolver.ts similarity index 100% rename from packages/services/src/resolver.ts rename to packages/clapper-services/src/resolver.ts diff --git a/packages/services/src/script-editor.ts b/packages/clapper-services/src/script-editor.ts similarity index 100% rename from packages/services/src/script-editor.ts rename to packages/clapper-services/src/script-editor.ts diff --git a/packages/services/src/segment-editor.ts b/packages/clapper-services/src/segment-editor.ts similarity index 100% rename from packages/services/src/segment-editor.ts rename to packages/clapper-services/src/segment-editor.ts diff --git a/packages/services/src/services.ts b/packages/clapper-services/src/services.ts similarity index 100% rename from packages/services/src/services.ts rename to packages/clapper-services/src/services.ts diff --git a/packages/services/src/settings.ts b/packages/clapper-services/src/settings.ts similarity index 100% rename from packages/services/src/settings.ts rename to packages/clapper-services/src/settings.ts diff --git a/packages/services/src/simulator.ts b/packages/clapper-services/src/simulator.ts similarity index 100% rename from packages/services/src/simulator.ts rename to packages/clapper-services/src/simulator.ts diff --git a/packages/services/src/speech.d.ts b/packages/clapper-services/src/speech.d.ts similarity index 100% rename from packages/services/src/speech.d.ts rename to packages/clapper-services/src/speech.d.ts diff --git a/packages/services/src/tasks.ts b/packages/clapper-services/src/tasks.ts similarity index 100% rename from packages/services/src/tasks.ts rename to packages/clapper-services/src/tasks.ts diff --git a/packages/services/src/types.ts b/packages/clapper-services/src/types.ts similarity index 81% rename from packages/services/src/types.ts rename to packages/clapper-services/src/types.ts index 995065b209213c8dc6fc5270ed1bfb8a894834c2..731e5dde181afbec4027922e3b82dfd3e99d5208 100644 --- a/packages/services/src/types.ts +++ b/packages/clapper-services/src/types.ts @@ -1,4 +1,4 @@ -import { ClapEntity, ClapMeta } from "@aitube/clap" +// import { ClapEntity, ClapMeta } from "@aitube/clap" import { TimelineSegment } from "@aitube/timeline" @@ -14,14 +14,14 @@ export type ResolveRequest = { // the slice to use for rendering segments: TimelineSegment[] - entities: Record + entities: Record // ClapEntity speakingCharactersIds: string[] generalCharactersIds: string[] mainCharacterId?: string - mainCharacterEntity?: ClapEntity + mainCharacterEntity?: any // ClapEntity - meta: ClapMeta + meta: any // ClapMeta prompts: ResolveRequestPrompts } @@ -41,7 +41,7 @@ export type AssistantRequest = { actionLine: string // used to provide more context - entities: Record + entities: Record // ClapEntity // used to provide more context projectInfo: string diff --git a/packages/services/src/ui.ts b/packages/clapper-services/src/ui.ts similarity index 100% rename from packages/services/src/ui.ts rename to packages/clapper-services/src/ui.ts diff --git a/packages/services/src/version-control.ts b/packages/clapper-services/src/version-control.ts similarity index 100% rename from packages/services/src/version-control.ts rename to packages/clapper-services/src/version-control.ts diff --git a/packages/services/src/workflow-editor.ts b/packages/clapper-services/src/workflow-editor.ts similarity index 100% rename from packages/services/src/workflow-editor.ts rename to packages/clapper-services/src/workflow-editor.ts diff --git a/packages/services/tsconfig.json b/packages/clapper-services/tsconfig.json similarity index 100% rename from packages/services/tsconfig.json rename to packages/clapper-services/tsconfig.json diff --git a/packages/services/tsconfig.types.json b/packages/clapper-services/tsconfig.types.json similarity index 100% rename from packages/services/tsconfig.types.json rename to packages/clapper-services/tsconfig.types.json diff --git a/packages/colors/bun.lockb b/packages/colors/bun.lockb deleted file mode 100755 index 5e3bc4904bffbf3617bebdd7f57064b6415e901a..0000000000000000000000000000000000000000 Binary files a/packages/colors/bun.lockb and /dev/null differ diff --git a/packages/colors/package.json b/packages/colors/package.json index 3097b74cc68b831e4fe2e6f9293165876d818b60..f45799a4ded09ba0e69328084878c159221a354c 100644 --- a/packages/colors/package.json +++ b/packages/colors/package.json @@ -4,13 +4,13 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "version": "0.2.4", "description": "Various color settings and utilities for AiTube", "scripts": { "build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration", "build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json", "postbuild": "rimraf tsconfig.types.tsbuildinfo && bun run build:declaration", - "publish": "npm run build && npm publish --access public", + "publish": "bun build && npm publish --access public", "update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build" }, "devDependencies": { @@ -19,9 +19,6 @@ "rimraf": "^6.0.1", "typescript": "^5.5.4" }, - "peerDependencies": { - "@aitube/clap": "file:../clap" - }, "repository": { "type": "git", "url": "https://github.com/jbilcke-hf/aitube-colors.git" @@ -36,6 +33,5 @@ "dist/*.js", "dist/*.d.ts", "dist/**/*.d.ts" - ], - "dependencies": {} + ] } diff --git a/packages/colors/src/types.ts b/packages/colors/src/types.ts index a047ce9277f559ed0307b9501432cceafcb65de1..93943536c6f70e390245074f55dd6fd9b3fa67ff 100644 --- a/packages/colors/src/types.ts +++ b/packages/colors/src/types.ts @@ -1,10 +1,10 @@ -import { ClapSegmentCategory } from "@aitube/clap" +// import { ClapSegmentCategory } from "@aitube/clap" import { SegmentColor } from "./constants/colors" export interface ClapSegmentCategorySettings { - id: ClapSegmentCategory // eg. "country" + id: any // ClapSegmentCategory // eg. "country" title: string // eg. Country description: string // description in one sentence color: SegmentColor // base color name, in lowercase diff --git a/packages/engine/bun.lockb b/packages/engine/bun.lockb deleted file mode 100755 index 9429d8d5fd4df53c1779b11fd12976332bf17297..0000000000000000000000000000000000000000 Binary files a/packages/engine/bun.lockb and /dev/null differ diff --git a/packages/engine/package.json b/packages/engine/package.json index 83b3b8623092dbca4fc62ceb984ed2f7f961e6da..3a1c71c64871e8b88728149a806fef91983cf307 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -4,14 +4,14 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "version": "0.2.4", "description": "The engine powering AiTube.at and Clapper.app", "scripts": { - "build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration", + "build": "bun build ./src/index.ts --outfile=dist/index.js && bun run build:declaration", "build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json", "postbuild": "rimraf tsconfig.types.tsbuildinfo && bun run build:declaration", "publish": "npm publish --access public", - "update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build" + "update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build" }, "devDependencies": { "bun-types": "latest", @@ -19,9 +19,6 @@ "rimraf": "^6.0.1", "typescript": "^5.5.4" }, - "peerDependencies": { - "@aitube/clap": "file:../clap" - }, "repository": { "type": "git", "url": "https://github.com/jbilcke-hf/aitube-engine.git" diff --git a/packages/engine/src/renderers/storyboard/renderShotToStoryboard.ts b/packages/engine/src/renderers/storyboard/renderShotToStoryboard.ts index 13a6f697e2f68bbe073788e2f3fd58acd4e4a904..f61a9a6bbae15664ce6fd38e9f48a66e72084a8f 100644 --- a/packages/engine/src/renderers/storyboard/renderShotToStoryboard.ts +++ b/packages/engine/src/renderers/storyboard/renderShotToStoryboard.ts @@ -85,7 +85,7 @@ export async function renderShotToStoryboard({ // console.log(`we have ${existingClap.entities.length} entities`) // check if we have an entity image we can use - const identityImage = existingClap.entities.find(e => e.id === shotStoryboardSegment.entityId)?.imageId + const identityImage = existingClap.entities.find((e: any) => e.id === shotStoryboardSegment.entityId)?.imageId if (identityImage) { // if (debug) { console.log(`[@aitube-engine/renderShotToStoryboard] using an entity to generate the storyboard..`) } } diff --git a/packages/io/bun.lockb b/packages/io/bun.lockb deleted file mode 100755 index 739d9da8b3d96df50bc099b2ada453e030874f97..0000000000000000000000000000000000000000 Binary files a/packages/io/bun.lockb and /dev/null differ diff --git a/packages/io/package.json b/packages/io/package.json index 0c47d10e4dbcd4b0d7e1f58f52b15d6eea5cee9d..eb6d911eb33666dc59cf44959c3125dd85aff51e 100644 --- a/packages/io/package.json +++ b/packages/io/package.json @@ -4,7 +4,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.0.1", + "version": "0.2.4", "description": "Collection of useful I/O utilities for NodeJS. Used by AiTube.at", "scripts": { "build": "bun build --target=node ./src/index.ts --outfile=dist/index.js && bun run build:declaration", @@ -19,7 +19,6 @@ "rimraf": "^5.0.7", "typescript": "^5.4.5" }, - "peerDependencies": {}, "dependencies": { "mime-types": "^2.1.35", "pure-uuid": "^1.8.1", diff --git a/packages/services/bun.lockb b/packages/services/bun.lockb deleted file mode 100755 index 5a369633b88be98dc7c26c06c10e366258c7ea2e..0000000000000000000000000000000000000000 Binary files a/packages/services/bun.lockb and /dev/null differ diff --git a/packages/timeline/README.md b/packages/timeline/README.md index fdac681e5ed838b0aee2fb7752387fb04842afa9..5a424f08464f4ff81501d772fb66f5d4dc56fcf9 100644 --- a/packages/timeline/README.md +++ b/packages/timeline/README.md @@ -18,13 +18,13 @@ Note: as warned before, this library is not ready for public use yet. I cannot provide support until the basic features have been implemented and some critical bugs fixed. ```bash -npm i @aitube/timeline +npm install @aitube/timeline ``` Depending on your project configuration and package manager, you may need to install some additional packages manually, such as React, Radix, Tailwind, Three.js, Zustand etc: ```bash -npm i @aitube/clap @radix-ui/react-slider @react-spring/three @react-spring/types @react-three/drei @react-three/fiber @types/react @types/react-dom react react-dom tailwindcss three typescript zustand +npm install @aitube/clap @radix-ui/react-slider @react-spring/three @react-spring/types @react-three/drei @react-three/fiber @types/react @types/react-dom react react-dom tailwindcss three typescript zustand ``` If you forget some dependencies you might get weird errors diff --git a/packages/timeline/bun.lockb b/packages/timeline/bun.lockb deleted file mode 100755 index 49c91d3d3eac7010244db4f9c5d084edaf8847b9..0000000000000000000000000000000000000000 Binary files a/packages/timeline/bun.lockb and /dev/null differ diff --git a/packages/timeline/package.json b/packages/timeline/package.json index 226dd83997ff22a47d761e6e2995969d45bf310a..2df1de55bd1f42d826afb8054f628516cf489f36 100644 --- a/packages/timeline/package.json +++ b/packages/timeline/package.json @@ -4,11 +4,12 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", - "version": "0.2.3", + "private": false, + "version": "0.2.4", "description": "React component to display an OpenClap timeline", "scripts": { - "build": "NODE_ENV=production bun build ./src/index.tsx --outfile=dist/index.js --external @aitube/clap --external @radix-ui/react-slider --external @react-spring/three --external @react-spring/types --external @react-three/drei --external @react-three/fiber --external @types/react --external @types/react-dom --external react --external react-dom --external tailwindcss --external three --external typescript --external zustand && bun run build:declaration", - "build:dev": "bun build ./src/index.tsx --outfile=dist/index.js --external @aitube/clap --external @radix-ui/react-slider --external @react-spring/three --external @react-spring/types --external @react-three/drei --external @react-three/fiber --external @types/react --external @types/react-dom --external react --external react-dom --external tailwindcss --external three --external typescript --external zustand && bun run build:declaration", + "build": "NODE_ENV=production bun build ./src/index.tsx --outfile=dist/index.js --external @radix-ui/react-slider --external @react-spring/three --external @react-spring/types --external @react-three/drei --external @react-three/fiber --external @types/react --external @types/react-dom --external react --external react-dom --external tailwindcss --external three --external typescript --external zustand && bun run build:declaration", + "build:dev": "bun build ./src/index.tsx --outfile=dist/index.js --external @radix-ui/react-slider --external @react-spring/three --external @react-spring/types --external @react-three/drei --external @react-three/fiber --external @types/react --external @types/react-dom --external react --external react-dom --external tailwindcss --external three --external typescript --external zustand && bun run build:declaration", "build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json", "postbuild": "rimraf tsconfig.types.tsbuildinfo && bun run build:declaration", "publish": "bun run build && npm publish --access public", @@ -31,25 +32,23 @@ "typescript": "^5.5.4", "vite": "^5.3.4" }, - "peerDependencies": { - "@aitube/clap": "file:../clap", + "dependencies": { + "@aitube/clap": "workspace:*", "@radix-ui/react-slider": "^1.1.2", "@react-spring/three": "^9.7.3", "@react-spring/types": "^9.7.3", "@react-three/drei": "^9.105.4", "@react-three/fiber": "^8.16.2", "clsx": "^2.1.1", + "date-fns": "^3.6.0", "react": "*", "react-dom": "*", + "react-virtualized-auto-sizer": "^1.0.24", "tailwind-merge": "^2.4.0", "tailwindcss": "^3.4.6", "three": "^0.164.1", "zustand": "4.5.2" }, - "dependencies": { - "date-fns": "^3.6.0", - "react-virtualized-auto-sizer": "^1.0.24" - }, "repository": { "type": "git", "url": "https://github.com/jbilcke-hf/aitube-timeline.git" diff --git a/packages/timeline/src/components/timeline/Timeline.tsx b/packages/timeline/src/components/timeline/Timeline.tsx index d35f9d59f304c4d31f650166cc7c086b0c6628aa..f85d9c3df23a2d067244551ac997dbb6f7fcb0b5 100644 --- a/packages/timeline/src/components/timeline/Timeline.tsx +++ b/packages/timeline/src/components/timeline/Timeline.tsx @@ -1,20 +1,17 @@ -import React, { useEffect } from "react" import { Plane } from "@react-three/drei" -import { useFrame, useThree } from "@react-three/fiber" +import { useThree } from "@react-three/fiber" +import { useEffect } from "react" -import { DEFAULT_NB_TRACKS } from "@/constants" import { useTimeline } from "@/hooks" -import { NB_MAX_SHOTS } from "@/constants/grid" -import { Grid } from "./Grid" import { Cells } from "./Cells" -import { TopBarTimeScale } from "./TopBarTimeScale" -import { clamp } from "@/utils/clamp" -import { LeftBarTrackScale } from "./LeftBarTrackScale" import { Cursor } from "./Cursor" +import { Grid } from "./Grid" +import { LeftBarTrackScale } from "./LeftBarTrackScale" +import { TopBarTimeScale } from "./TopBarTimeScale" export function Timeline({ width, height }: { width: number; height: number }) { const { size } = useThree() diff --git a/packages/timeline/src/compute/computeContentSizeMetrics.ts b/packages/timeline/src/compute/computeContentSizeMetrics.ts index 4ed62565cbb602c3f5fc9840bcb5cb6349dbc040..c6676206bc65fde46236b2246c0274657396d3b8 100644 --- a/packages/timeline/src/compute/computeContentSizeMetrics.ts +++ b/packages/timeline/src/compute/computeContentSizeMetrics.ts @@ -37,7 +37,7 @@ export function computeContentSizeMetrics({ ) let contentHeight = 0 - const newTracks: ClapTracks = tracks.map(track => { + const newTracks: ClapTracks = tracks.map((track: any) => { contentHeight += computeCellHeight({ trackNumber: track.id, tracks, diff --git a/packages/timeline/src/hooks/useHorizontalGridLines.ts b/packages/timeline/src/hooks/useHorizontalGridLines.ts index 3c41d311d48ad7d1e440458927650939cdc0a0a7..4e1e82efc40f54f9e8a28562bf801d9483ff0a79 100644 --- a/packages/timeline/src/hooks/useHorizontalGridLines.ts +++ b/packages/timeline/src/hooks/useHorizontalGridLines.ts @@ -29,7 +29,7 @@ export const useHorizontalGridLines = () => { setGridLines(thisLines); }, [ contentWidth, - JSON.stringify(tracks.map(t => `${t.visible}_${t.height}`)), + JSON.stringify(tracks.map((t: any) => `${t.visible}_${t.height}`)), ]); return gridlines; diff --git a/packages/timeline/src/hooks/useHorizontalTrackLines.ts b/packages/timeline/src/hooks/useHorizontalTrackLines.ts index 32a6d9c4b1bd5aa48aa992da3c4dc8b3e88a631a..a78c258e4e61544198d8d425dc43001b01554420 100644 --- a/packages/timeline/src/hooks/useHorizontalTrackLines.ts +++ b/packages/timeline/src/hooks/useHorizontalTrackLines.ts @@ -28,7 +28,7 @@ export const useHorizontaTrackLines = () => { setLines(thisLines); }, [, leftBarTrackScaleWidth, - JSON.stringify(tracks.map(t => `${t.visible}_${t.height}`)) + JSON.stringify(tracks.map((t: any) => `${t.visible}_${t.height}`)) ]); return lines; diff --git a/packages/timeline/src/hooks/useTimeline.ts b/packages/timeline/src/hooks/useTimeline.ts index 53e7a10f5e2afb11c7790ea4e5ac41d589bc08e9..fe3f1900b53becfb2b448e78c8a26419b90553d3 100644 --- a/packages/timeline/src/hooks/useTimeline.ts +++ b/packages/timeline/src/hooks/useTimeline.ts @@ -582,7 +582,7 @@ export const useTimeline = create((set, get) => ({ set({ ...computeContentSizeMetrics({ meta, - tracks: tracks.map(t => ( + tracks: tracks.map((t: any) => ( t.id === trackId ? { ...t, visible: !t.visible } : t diff --git a/packages/timeline/src/hooks/useVerticalGridLines.ts b/packages/timeline/src/hooks/useVerticalGridLines.ts index 5208f1bae7d84273fdbb6646d318b0cd9036a6a5..2d85198b680e2f5870d7440360b6d0c42a00da7c 100644 --- a/packages/timeline/src/hooks/useVerticalGridLines.ts +++ b/packages/timeline/src/hooks/useVerticalGridLines.ts @@ -31,7 +31,7 @@ export const useVerticalGridLines = () => { contentHeight, cellWidth, nbMaxShots, - JSON.stringify(tracks.map(t => `${t.visible}_${t.height}`)) + JSON.stringify(tracks.map((t: any) => `${t.visible}_${t.height}`)) ]); return gridlines; diff --git a/packages/timeline/src/utils/getFinalVideo.ts b/packages/timeline/src/utils/getFinalVideo.ts index da18229402df122cb2ae6cffc9a8b20de9fea77a..6689ac2db8c1ec259af9010e25f7b4dab2f2d025 100644 --- a/packages/timeline/src/utils/getFinalVideo.ts +++ b/packages/timeline/src/utils/getFinalVideo.ts @@ -3,8 +3,8 @@ import { ClapProject, ClapSegment, ClapSegmentCategory, ClapSegmentStatus } from import { TimelineSegment } from "@/types" import { clapSegmentToTimelineSegment } from "./clapSegmentToTimelineSegment" -export async function getFinalVideo(clap: ClapProject): Promise { - const alreadyAnEmbeddedFinalVideo: ClapSegment | undefined = clap.segments.filter(s => +export async function getFinalVideo(clap: ClapProject): Promise { + const alreadyAnEmbeddedFinalVideo: ClapSegment | undefined = clap.segments.filter((s: ClapSegment) => s.category.toUpperCase() === ClapSegmentCategory.VIDEO && s.status.toUpperCase() === ClapSegmentStatus.COMPLETED && s.startTimeInMs === 0 && diff --git a/packages/timeline/tsconfig.json b/packages/timeline/tsconfig.json index fe8d3130b7c2d7d8c9c471c852323e2495a548d2..afae3b3bee80ddff773f7d7aa12db7f357d6f11a 100644 --- a/packages/timeline/tsconfig.json +++ b/packages/timeline/tsconfig.json @@ -3,7 +3,7 @@ "outDir": "./dist", "rootDir": "./src", "baseUrl": "./", - "paths": { + "paths": { "@/*": ["src/*"] }, "lib": ["dom", "dom.iterable", "esnext"], @@ -12,6 +12,7 @@ "moduleResolution": "bundler", "moduleDetection": "force", "allowImportingTsExtensions": true, + "noImplicitAny": false, "noEmit": true, "composite": true, "strict": true, diff --git a/packages/timeline/vite.config.js b/packages/timeline/vite.config.js index 2dea53a3df155601ec39bc4b3844f7c58a2d4047..bcdb65c77265bbe217ac62621df96cd218485174 100644 --- a/packages/timeline/vite.config.js +++ b/packages/timeline/vite.config.js @@ -1,7 +1,24 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import path from 'path' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + // resolve monorepo packages + resolve: { + alias: { + "@aitube/clap": path.resolve(__dirname, "../clap/dist"), + '@': path.resolve(__dirname, 'src'), + }, + }, + server: { + fs: { + // Allow serving files from one level up to the project root + allow: ['..'], + }, + }, + optimizeDeps: { + exclude: ['@aitube/clap'], // Exclude the clap package from pre-bundling + }, }) \ No newline at end of file