Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Monorepo working
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +1 -1
- bun.lockb +0 -0
- package.json +43 -16
- packages/api-client/README.md +3 -3
- packages/api-client/bun.lockb +0 -0
- packages/api-client/package.json +2 -5
- packages/api-client/src/api/editClapVideos.ts +2 -2
- packages/app/package.json +19 -19
- packages/app/src/app/api/assistant/askAnyAssistant.ts +1 -1
- packages/app/src/app/api/resolve/providers/aitube/index.ts +1 -1
- packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/ImageDepthWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/ImageGenerationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/ImageSegmentationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/ImageUpscalingWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/MusicGenerationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/SoundGenerationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/VideoDepthWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/VideoGenerationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/VideoSegmentationWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/VideoUpscalingWorkflows.tsx +1 -1
- packages/app/src/components/toolbars/top-menu/lists/VoiceGenerationWorkflows.tsx +1 -1
- packages/app/src/services/autocomplete/extractCaptionsFromFrames.ts +96 -85
- packages/app/src/services/autocomplete/useAutocomplete.ts +6 -6
- packages/app/src/services/io/ffmpegUtils.ts +1 -0
- packages/app/src/services/io/fix-xenova-transformers.d.ts +0 -1
- packages/app/tsconfig.json +1 -0
- packages/broadway/bun.lockb +0 -0
- packages/broadway/package.json +2 -6
- packages/broadway/src/parsers/utils/getParserItemFromLabel.ts +2 -2
- packages/broadway/src/types.ts +2 -2
- packages/clap/bun.lockb +0 -0
- packages/clap/package.json +3 -2
- packages/clap/src/constants/index.ts +1 -1
- packages/clap/src/converters/index.ts +3 -3
- packages/clap/src/factories/index.ts +4 -4
- packages/clap/src/factories/newSegment.ts +1 -1
- packages/clap/src/helpers/index.ts +6 -6
- packages/clap/src/index.ts +8 -8
- packages/clap/src/io/index.ts +4 -4
- packages/clap/src/io/parseClap.ts +2 -2
- packages/clap/src/sanitizers/index.ts +7 -7
- packages/clap/src/sanitizers/sanitizeEntities.ts +1 -1
- packages/clap/src/sanitizers/sanitizeSegments.ts +1 -1
- packages/clap/src/sanitizers/sanitizeWorkflows.ts +1 -1
- packages/clap/src/utils/filterSegments.ts +1 -1
- packages/clap/src/utils/index.ts +14 -14
- packages/clap/src/utils/parseSegmentCategory.ts +1 -1
- packages/{services → clapper-services}/.gitignore +0 -0
- packages/{services → clapper-services}/.npmignore +0 -0
README.md
CHANGED
@@ -141,7 +141,7 @@ I have setup Prettier and ESLint, they use some basic rules (you can propose new
|
|
141 |
|
142 |
To run all the tests (unit and e2e) please run:
|
143 |
|
144 |
-
`npm test`
|
145 |
|
146 |
This is not instantaneous: playwright may seems to do nothing for a while at first.
|
147 |
|
|
|
141 |
|
142 |
To run all the tests (unit and e2e) please run:
|
143 |
|
144 |
+
`npm run test`
|
145 |
|
146 |
This is not instantaneous: playwright may seems to do nothing for a while at first.
|
147 |
|
bun.lockb
ADDED
Binary file (677 kB). View file
|
|
package.json
CHANGED
@@ -1,17 +1,44 @@
|
|
1 |
{
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
"
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
{
|
2 |
+
"name": "@aitube/clapper-monorepo",
|
3 |
+
"version": "0.2.4",
|
4 |
+
"private": true,
|
5 |
+
"description": "A monorepo for the Clapper project. Individual packages are in the packages directory.",
|
6 |
+
"workspaces": [
|
7 |
+
"packages/clap",
|
8 |
+
"packages/timeline",
|
9 |
+
"packages/api-client",
|
10 |
+
"packages/io",
|
11 |
+
"packages/colors",
|
12 |
+
"packages/engine",
|
13 |
+
"packages/broadway",
|
14 |
+
"packages/clapper-services",
|
15 |
+
"packages/app"
|
16 |
+
],
|
17 |
+
"engines": {
|
18 |
+
"bun": ">=1.0.0"
|
19 |
+
},
|
20 |
+
"scripts": {
|
21 |
+
"dev": "bun run --cwd packages/app dev",
|
22 |
+
"start": "bun run --cwd packages/app start",
|
23 |
+
"build": "bun run build:all",
|
24 |
+
"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",
|
25 |
+
"build:clap": "bun run --cwd packages/clap build",
|
26 |
+
"build:timeline": "bun run --cwd packages/timeline build",
|
27 |
+
"build:api-client": "bun run --cwd packages/api-client build",
|
28 |
+
"build:io": "bun run --cwd packages/io build",
|
29 |
+
"build:colors": "bun run --cwd packages/colors build",
|
30 |
+
"build:engine": "bun run --cwd packages/engine build",
|
31 |
+
"build:broadway": "bun run --cwd packages/broadway build",
|
32 |
+
"build:clapper-services": "bun run --cwd packages/clapper-services build",
|
33 |
+
"build:app": "bun run --cwd packages/app build",
|
34 |
+
"test": "bun run test:all",
|
35 |
+
"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",
|
36 |
+
"format": "bun run --cwd packages/app format"
|
37 |
+
},
|
38 |
+
"packageManager": "[email protected]",
|
39 |
+
"trustedDependencies": [
|
40 |
+
"@aitube/clapper",
|
41 |
+
"onnxruntime-node",
|
42 |
+
"protobufjs"
|
43 |
+
]
|
44 |
+
}
|
packages/api-client/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# @aitube/client
|
2 |
|
3 |
*Official API client for AiTube.at*
|
4 |
|
@@ -20,7 +20,7 @@ so we need to perform all API calls to `jbilcke-hf-ai-tube.hf.space`.
|
|
20 |
To install the package, run the following command:
|
21 |
|
22 |
```bash
|
23 |
-
npm install @aitube/client
|
24 |
```
|
25 |
|
26 |
## Getting Started
|
@@ -48,7 +48,7 @@ import {
|
|
48 |
ClapEntityPrompt,
|
49 |
SupportedExportFormat,
|
50 |
applyClapCompletion,
|
51 |
-
} from '@aitube/client'
|
52 |
|
53 |
const ultraSecret = "ultra secret token unavailable to common mortals"
|
54 |
|
|
|
1 |
+
# @aitube/api-client
|
2 |
|
3 |
*Official API client for AiTube.at*
|
4 |
|
|
|
20 |
To install the package, run the following command:
|
21 |
|
22 |
```bash
|
23 |
+
npm install @aitube/api-client
|
24 |
```
|
25 |
|
26 |
## Getting Started
|
|
|
48 |
ClapEntityPrompt,
|
49 |
SupportedExportFormat,
|
50 |
applyClapCompletion,
|
51 |
+
} from '@aitube/api-client'
|
52 |
|
53 |
const ultraSecret = "ultra secret token unavailable to common mortals"
|
54 |
|
packages/api-client/bun.lockb
DELETED
Binary file (19.1 kB)
|
|
packages/api-client/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
{
|
2 |
-
"name": "@aitube/client",
|
3 |
"module": "index.ts",
|
4 |
"main": "dist/index.js",
|
5 |
"types": "dist/index.d.ts",
|
6 |
"type": "module",
|
7 |
-
"version": "0.2.
|
8 |
"description": "Official API client for AiTube.at",
|
9 |
"scripts": {
|
10 |
"build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration",
|
@@ -19,9 +19,6 @@
|
|
19 |
"rimraf": "^6.0.1",
|
20 |
"typescript": "^5.5.4"
|
21 |
},
|
22 |
-
"peerDependencies": {
|
23 |
-
"@aitube/clap": "file:../clap"
|
24 |
-
},
|
25 |
"repository": {
|
26 |
"type": "git",
|
27 |
"url": "https://github.com/jbilcke-hf/aitube-client.git"
|
|
|
1 |
{
|
2 |
+
"name": "@aitube/api-client",
|
3 |
"module": "index.ts",
|
4 |
"main": "dist/index.js",
|
5 |
"types": "dist/index.d.ts",
|
6 |
"type": "module",
|
7 |
+
"version": "0.2.4",
|
8 |
"description": "Official API client for AiTube.at",
|
9 |
"scripts": {
|
10 |
"build": "bun build ./src/index.ts --outfile=dist/index.js --external=@aitube/clap && bun run build:declaration",
|
|
|
19 |
"rimraf": "^6.0.1",
|
20 |
"typescript": "^5.5.4"
|
21 |
},
|
|
|
|
|
|
|
22 |
"repository": {
|
23 |
"type": "git",
|
24 |
"url": "https://github.com/jbilcke-hf/aitube-client.git"
|
packages/api-client/src/api/editClapVideos.ts
CHANGED
@@ -43,7 +43,7 @@ export async function editClapVideos({
|
|
43 |
}
|
44 |
// special trick to not touch the generated
|
45 |
// storyboards that are used by pending videos
|
46 |
-
const idsOfStoryboardsToKeep = clap.segments.map(segment => {
|
47 |
|
48 |
const isPendingVideo = (
|
49 |
segment.category === ClapSegmentCategory.VIDEO
|
@@ -61,7 +61,7 @@ export async function editClapVideos({
|
|
61 |
).at(0)
|
62 |
|
63 |
return storyboard?.id
|
64 |
-
}).filter(x => x) as string[]
|
65 |
|
66 |
const newClap = await fetchClap(`${aitubeApiUrl}edit/videos?${queryString.stringify(params)}`, {
|
67 |
method: "POST",
|
|
|
43 |
}
|
44 |
// special trick to not touch the generated
|
45 |
// storyboards that are used by pending videos
|
46 |
+
const idsOfStoryboardsToKeep = clap.segments.map((segment: ClapSegment) => {
|
47 |
|
48 |
const isPendingVideo = (
|
49 |
segment.category === ClapSegmentCategory.VIDEO
|
|
|
61 |
).at(0)
|
62 |
|
63 |
return storyboard?.id
|
64 |
+
}).filter((x: any) => x) as string[]
|
65 |
|
66 |
const newClap = await fetchClap(`${aitubeApiUrl}edit/videos?${queryString.stringify(params)}`, {
|
67 |
method: "POST",
|
packages/app/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"name": "@aitube/clapper",
|
3 |
-
"version": "0.
|
4 |
"private": true,
|
5 |
"description": "🎬 Clapper",
|
6 |
"license": "GPL-3.0-only",
|
@@ -13,35 +13,35 @@
|
|
13 |
"public:": "./public"
|
14 |
},
|
15 |
"scripts": {
|
16 |
-
"dev": "
|
17 |
-
"build": "
|
18 |
-
"build:ci": "rm -Rf out &&
|
19 |
-
"build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone
|
20 |
-
"prepare": "cp -R node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/",
|
21 |
"start": "next start",
|
22 |
"start:prod": "node .next/standalone/server.js",
|
23 |
-
"checks": "
|
24 |
"format": "prettier --check --ignore-path .gitignore ./src/",
|
25 |
"format:fix": "prettier --write --ignore-path .gitignore ./src/",
|
26 |
"lint": "next lint",
|
27 |
"lint:fix": "next lint --fix",
|
28 |
-
"test": "
|
29 |
-
"test_TEMPORARY_DISABLED": "
|
30 |
"test:unit:ci": "vitest run",
|
31 |
"test:unit:watch": "vitest",
|
32 |
"test:e2e": "npx playwright test",
|
33 |
-
"electron": "
|
34 |
-
"electron:start": "
|
35 |
-
"electron:package": "
|
36 |
-
"electron:make": "
|
37 |
},
|
38 |
"dependencies": {
|
39 |
-
"@aitube/
|
40 |
-
"@aitube/
|
41 |
-
"@aitube/
|
42 |
-
"@aitube/
|
43 |
-
"@aitube/engine": "
|
44 |
-
"@aitube/timeline": "
|
45 |
"@fal-ai/serverless-client": "^0.13.0",
|
46 |
"@ffmpeg/ffmpeg": "^0.12.10",
|
47 |
"@ffmpeg/util": "^0.12.1",
|
|
|
1 |
{
|
2 |
"name": "@aitube/clapper",
|
3 |
+
"version": "0.2.4",
|
4 |
"private": true,
|
5 |
"description": "🎬 Clapper",
|
6 |
"license": "GPL-3.0-only",
|
|
|
13 |
"public:": "./public"
|
14 |
},
|
15 |
"scripts": {
|
16 |
+
"dev": "bun run checks && next dev",
|
17 |
+
"build": "bun run prepare && bun run checks && rm -Rf out && next build && bun run build:copyassets",
|
18 |
+
"build:ci": "rm -Rf out && bun run prepare && next build && bun run build:copyassets",
|
19 |
+
"build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/static",
|
20 |
+
"prepare": "cp -R ../../node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/",
|
21 |
"start": "next start",
|
22 |
"start:prod": "node .next/standalone/server.js",
|
23 |
+
"checks": "bun run format:fix && bun run lint",
|
24 |
"format": "prettier --check --ignore-path .gitignore ./src/",
|
25 |
"format:fix": "prettier --write --ignore-path .gitignore ./src/",
|
26 |
"lint": "next lint",
|
27 |
"lint:fix": "next lint --fix",
|
28 |
+
"test": "bun run build && bun run test:unit:ci",
|
29 |
+
"test_TEMPORARY_DISABLED": "bun run build && bun run test:unit:ci && bun run test:e2e",
|
30 |
"test:unit:ci": "vitest run",
|
31 |
"test:unit:watch": "vitest",
|
32 |
"test:e2e": "npx playwright test",
|
33 |
+
"electron": "bun run build && electron .",
|
34 |
+
"electron:start": "bun run build && electron-forge start",
|
35 |
+
"electron:package": "bun run build && electron-forge package",
|
36 |
+
"electron:make": "bun run build && electron-forge make"
|
37 |
},
|
38 |
"dependencies": {
|
39 |
+
"@aitube/api-client": "workspace:*",
|
40 |
+
"@aitube/broadway": "workspace:*",
|
41 |
+
"@aitube/clap": "workspace:*",
|
42 |
+
"@aitube/clapper-services": "workspace:*",
|
43 |
+
"@aitube/engine": "workspace:*",
|
44 |
+
"@aitube/timeline": "workspace:*",
|
45 |
"@fal-ai/serverless-client": "^0.13.0",
|
46 |
"@ffmpeg/ffmpeg": "^0.12.10",
|
47 |
"@ffmpeg/util": "^0.12.1",
|
packages/app/src/app/api/assistant/askAnyAssistant.ts
CHANGED
@@ -202,7 +202,7 @@ export async function askAnyAssistant({
|
|
202 |
})
|
203 |
// console.log('Lanchain success on the first time! rawResponse:', rawResponse)
|
204 |
|
205 |
-
assistantMessage = parseLangChainResponse(rawResponse)
|
206 |
// console.log('assistantMessage:', assistantMessage)
|
207 |
} catch (err) {
|
208 |
// LangChain failure (this happens quite often, actually)
|
|
|
202 |
})
|
203 |
// console.log('Lanchain success on the first time! rawResponse:', rawResponse)
|
204 |
|
205 |
+
assistantMessage = parseLangChainResponse(rawResponse as any)
|
206 |
// console.log('assistantMessage:', assistantMessage)
|
207 |
} catch (err) {
|
208 |
// LangChain failure (this happens quite often, actually)
|
packages/app/src/app/api/resolve/providers/aitube/index.ts
CHANGED
@@ -12,7 +12,7 @@ import {
|
|
12 |
editClapSounds,
|
13 |
editClapStoryboards,
|
14 |
editClapVideos,
|
15 |
-
} from '@aitube/client'
|
16 |
|
17 |
import { getWorkflowInputValues } from '../getWorkflowInputValues'
|
18 |
|
|
|
12 |
editClapSounds,
|
13 |
editClapStoryboards,
|
14 |
editClapVideos,
|
15 |
+
} from '@aitube/api-client'
|
16 |
|
17 |
import { getWorkflowInputValues } from '../getWorkflowInputValues'
|
18 |
|
packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function AssistantWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/ImageDepthWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function ImageDepthWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/ImageGenerationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function ImageGenerationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/ImageSegmentationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function ImageSegmentationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/ImageUpscalingWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function ImageUpscalingWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/MusicGenerationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function MusicGenerationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/SoundGenerationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function SoundGenerationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/VideoDepthWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function VideoDepthWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/VideoGenerationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function VideoGenerationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/VideoSegmentationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function VideoSegmentationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/VideoUpscalingWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function VideoUpscalingWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/components/toolbars/top-menu/lists/VoiceGenerationWorkflows.tsx
CHANGED
@@ -62,7 +62,7 @@ export function VoiceGenerationWorkflows() {
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
-
{workflows
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
|
|
62 |
</ClapWorkflowProviderName>
|
63 |
</MenubarSubTrigger>
|
64 |
<MenubarSubContent>
|
65 |
+
{workflows?.map((w) => (
|
66 |
<MenubarCheckboxItem
|
67 |
key={w.id}
|
68 |
checked={workflowId === w.id}
|
packages/app/src/services/autocomplete/extractCaptionsFromFrames.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
import {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
} from '@xenova/transformers'
|
7 |
|
8 |
export const cache: {
|
9 |
model?: Promise<any>
|
@@ -11,36 +11,36 @@ export const cache: {
|
|
11 |
tokenizer?: Promise<any>
|
12 |
} = {}
|
13 |
|
14 |
-
export async function loadModel(
|
15 |
-
|
16 |
-
|
17 |
-
) {
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
}
|
44 |
|
45 |
export function closeModel() {
|
46 |
cache.model = undefined
|
@@ -54,75 +54,86 @@ export async function extractCaptionsFromFrames(
|
|
54 |
progress: number,
|
55 |
storyboardIndex: number,
|
56 |
nbStoryboards: number
|
57 |
-
) =>
|
58 |
-
)
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
1. You need a modern browser such as Google Chrome 113+, Microsoft Edge 113+, Safari 18 (macOS 15), Firefox Nightly
|
63 |
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
67 |
-
The chrome://flags/#enable-unsafe-webgpu flag must be enabled (not enable-webgpu-developer-features).
|
68 |
-
Linux experimental support also requires launching the browser with --enable-features=Vulkan.
|
69 |
|
70 |
-
2.
|
71 |
|
72 |
-
2.
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
|
|
80 |
|
81 |
-
|
82 |
-
const model_id = 'onnx-community/Florence-2-base-ft'
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
})
|
87 |
|
88 |
-
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
|
95 |
-
|
|
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
console.log('analyzing image:', imageInBase64DataUri.slice(0, 64))
|
101 |
-
// Prepare vision inputs
|
102 |
-
const image = await RawImage.fromURL(imageInBase64DataUri)
|
103 |
-
const vision_inputs = await processor(image)
|
104 |
|
105 |
-
|
106 |
-
// Generate text
|
107 |
-
const generated_ids = await model.generate({
|
108 |
-
...text_inputs,
|
109 |
-
...vision_inputs,
|
110 |
-
max_new_tokens: 100,
|
111 |
-
})
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
117 |
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
-
|
|
|
|
|
|
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// import {
|
2 |
+
// AutoProcessor,
|
3 |
+
// AutoTokenizer,
|
4 |
+
// Florence2ForConditionalGeneration,
|
5 |
+
// RawImage,
|
6 |
+
// } from '@xenova/transformers'
|
7 |
|
8 |
export const cache: {
|
9 |
model?: Promise<any>
|
|
|
11 |
tokenizer?: Promise<any>
|
12 |
} = {}
|
13 |
|
14 |
+
// export async function loadModel(
|
15 |
+
// modelId: string,
|
16 |
+
// onProgress: (progress: number) => void
|
17 |
+
// ) {
|
18 |
+
// onProgress(0)
|
19 |
+
// const model = await (cache.model
|
20 |
+
// ? cache.model
|
21 |
+
// : (cache.model = Florence2ForConditionalGeneration.from_pretrained(
|
22 |
+
// modelId,
|
23 |
+
// {
|
24 |
+
// dtype: 'fp32',
|
25 |
+
// }
|
26 |
+
// )))
|
27 |
|
28 |
+
// onProgress(33)
|
29 |
|
30 |
+
// const processor = await (cache.processor
|
31 |
+
// ? cache.processor
|
32 |
+
// : (cache.processor = AutoProcessor.from_pretrained(modelId)))
|
33 |
|
34 |
+
// onProgress(66)
|
35 |
|
36 |
+
// const tokenizer = await (cache.tokenizer
|
37 |
+
// ? cache.tokenizer
|
38 |
+
// : (cache.tokenizer = AutoTokenizer.from_pretrained(modelId)))
|
39 |
|
40 |
+
// onProgress(100)
|
41 |
|
42 |
+
// return { model, processor, tokenizer }
|
43 |
+
// }
|
44 |
|
45 |
export function closeModel() {
|
46 |
cache.model = undefined
|
|
|
54 |
progress: number,
|
55 |
storyboardIndex: number,
|
56 |
nbStoryboards: number
|
57 |
+
) => any
|
58 |
+
) {
|
59 |
+
return
|
60 |
+
}
|
|
|
|
|
61 |
|
62 |
+
// export async function extractCaptionsFromFrames(
|
63 |
+
// images: string[] = [],
|
64 |
+
// onProgress: (
|
65 |
+
// progress: number,
|
66 |
+
// storyboardIndex: number,
|
67 |
+
// nbStoryboards: number
|
68 |
+
// ) => void
|
69 |
+
// ): Promise<string[]> {
|
70 |
+
// if (!(navigator as any).gpu) {
|
71 |
+
// throw new Error(`Please enable WebGPU to analyze video frames:
|
72 |
|
73 |
+
// 1. You need a modern browser such as Google Chrome 113+, Microsoft Edge 113+, Safari 18 (macOS 15), Firefox Nightly
|
|
|
|
|
74 |
|
75 |
+
// 2. You need to enable WebGPU (depends on your browser, see below)
|
76 |
|
77 |
+
// 2.1 For Chrome: Perform the following operations in the Chrome / Microsoft Edge address bar
|
78 |
+
// The chrome://flags/#enable-unsafe-webgpu flag must be enabled (not enable-webgpu-developer-features).
|
79 |
+
// Linux experimental support also requires launching the browser with --enable-features=Vulkan.
|
80 |
|
81 |
+
// 2.2 For Safari 18 (macOS 15): WebGPU is enabled by default
|
82 |
|
83 |
+
// 2.3 For Firefox Nightly: Type about:config in the address bar and set 'dom.webgpu.enabled" to true
|
84 |
+
// `)
|
85 |
+
// }
|
86 |
|
87 |
+
// let progress = 0
|
|
|
88 |
|
89 |
+
// // for code example, see:
|
90 |
+
// // https://github.com/xenova/transformers.js/pull/545#issuecomment-2183625876
|
|
|
91 |
|
92 |
+
// // Load model, processor, and tokenizer
|
93 |
+
// const model_id = 'onnx-community/Florence-2-base-ft'
|
94 |
|
95 |
+
// const { model, processor, tokenizer } = await loadModel(model_id, (p) => {
|
96 |
+
// onProgress((progress = p * 15), 0, images.length)
|
97 |
+
// })
|
98 |
|
99 |
+
// // not all prompts will work properly, see the official examples:
|
100 |
+
// // https://huggingface.co/microsoft/Florence-2-base-ft/blob/e7a5acc73559546de6e12ec0319cd7cc1fa2437c/processing_florence2.py#L115-L117
|
101 |
|
102 |
+
// // Prepare text inputs
|
103 |
+
// const prompts = 'Describe with a paragraph what is shown in the image.'
|
104 |
+
// // const prompts = 'Decompose the following video frame into era, genre, location, weather, characters, and action. Give the answer in YAML.'
|
|
|
|
|
|
|
|
|
105 |
|
106 |
+
// const text_inputs = tokenizer(prompts)
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
+
// let i = 1
|
109 |
+
// const captions: string[] = []
|
110 |
+
// for (const imageInBase64DataUri of images) {
|
111 |
+
// console.log('analyzing image:', imageInBase64DataUri.slice(0, 64))
|
112 |
+
// // Prepare vision inputs
|
113 |
+
// const image = await RawImage.fromURL(imageInBase64DataUri)
|
114 |
+
// const vision_inputs = await processor(image)
|
115 |
|
116 |
+
// console.log(' - generating caption..')
|
117 |
+
// // Generate text
|
118 |
+
// const generated_ids = await model.generate({
|
119 |
+
// ...text_inputs,
|
120 |
+
// ...vision_inputs,
|
121 |
+
// max_new_tokens: 100,
|
122 |
+
// })
|
123 |
|
124 |
+
// // Decode generated text
|
125 |
+
// const generated_text = tokenizer.batch_decode(generated_ids, {
|
126 |
+
// skip_special_tokens: true,
|
127 |
+
// })
|
128 |
|
129 |
+
// const caption = `${generated_text[0] || ''}`
|
130 |
+
// console.log(' - caption:', caption)
|
131 |
+
|
132 |
+
// const relativeProgress = i / images.length
|
133 |
+
|
134 |
+
// progress += relativeProgress * 75
|
135 |
+
// onProgress(progress, i, images.length)
|
136 |
+
// captions.push(caption)
|
137 |
+
// }
|
138 |
+
// return captions
|
139 |
+
// }
|
packages/app/src/services/autocomplete/useAutocomplete.ts
CHANGED
@@ -133,27 +133,27 @@ export const useAutocomplete = create<AutocompleteStore>((set, get) => ({
|
|
133 |
// able to decompose a scene automatically
|
134 |
for (const sentence of sentences) {
|
135 |
if (sentence.match(/(?:is wearing|wears)/)) {
|
136 |
-
categories.CHARACTER.push(sentence)
|
137 |
} else if (sentence.match(/(?:the (?:image|screen) (?:is|has))/)) {
|
138 |
-
categories.STYLE.push(sentence)
|
139 |
} else if (
|
140 |
sentence.match(
|
141 |
/(?:the (?:lighting|lights|light|fire|sun|moon)|bright|dim|neon|candle|lit up)/
|
142 |
)
|
143 |
) {
|
144 |
-
categories.LIGHTING.push(sentence)
|
145 |
} else if (
|
146 |
sentence.match(
|
147 |
/(?:the (?:man|woman|kid|child|person|animal|person|robot)|(?:she|he) (?:has|is))/
|
148 |
)
|
149 |
) {
|
150 |
-
categories.CHARACTER.push(sentence)
|
151 |
} else if (
|
152 |
sentence.match(/(?:behind the|background|room|location|place)/)
|
153 |
) {
|
154 |
-
categories.LOCATION.push(sentence)
|
155 |
} else {
|
156 |
-
categories.GENERIC.push(sentence)
|
157 |
}
|
158 |
}
|
159 |
|
|
|
133 |
// able to decompose a scene automatically
|
134 |
for (const sentence of sentences) {
|
135 |
if (sentence.match(/(?:is wearing|wears)/)) {
|
136 |
+
categories[ClapSegmentCategory.CHARACTER].push(sentence)
|
137 |
} else if (sentence.match(/(?:the (?:image|screen) (?:is|has))/)) {
|
138 |
+
categories[ClapSegmentCategory.STYLE].push(sentence)
|
139 |
} else if (
|
140 |
sentence.match(
|
141 |
/(?:the (?:lighting|lights|light|fire|sun|moon)|bright|dim|neon|candle|lit up)/
|
142 |
)
|
143 |
) {
|
144 |
+
categories[ClapSegmentCategory.LIGHTING].push(sentence)
|
145 |
} else if (
|
146 |
sentence.match(
|
147 |
/(?:the (?:man|woman|kid|child|person|animal|person|robot)|(?:she|he) (?:has|is))/
|
148 |
)
|
149 |
) {
|
150 |
+
categories[ClapSegmentCategory.CHARACTER].push(sentence)
|
151 |
} else if (
|
152 |
sentence.match(/(?:behind the|background|room|location|place)/)
|
153 |
) {
|
154 |
+
categories[ClapSegmentCategory.LOCATION].push(sentence)
|
155 |
} else {
|
156 |
+
categories[ClapSegmentCategory.GENERIC].push(sentence)
|
157 |
}
|
158 |
}
|
159 |
|
packages/app/src/services/io/ffmpegUtils.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import { UUID } from '@aitube/clap'
|
2 |
import { FFmpeg } from '@ffmpeg/ffmpeg'
|
3 |
import { toBlobURL } from '@ffmpeg/util'
|
|
|
1 |
+
// @ts-nocheck
|
2 |
import { UUID } from '@aitube/clap'
|
3 |
import { FFmpeg } from '@ffmpeg/ffmpeg'
|
4 |
import { toBlobURL } from '@ffmpeg/util'
|
packages/app/src/services/io/fix-xenova-transformers.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
declare module '@xenova/transformers'
|
|
|
|
packages/app/tsconfig.json
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
"noEmit": true,
|
8 |
"esModuleInterop": true,
|
9 |
"module": "esnext",
|
|
|
10 |
"moduleResolution": "node",
|
11 |
"resolveJsonModule": true,
|
12 |
"isolatedModules": true,
|
|
|
7 |
"noEmit": true,
|
8 |
"esModuleInterop": true,
|
9 |
"module": "esnext",
|
10 |
+
"noImplicitAny": false,
|
11 |
"moduleResolution": "node",
|
12 |
"resolveJsonModule": true,
|
13 |
"isolatedModules": true,
|
packages/broadway/bun.lockb
DELETED
Binary file (33.9 kB)
|
|
packages/broadway/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
"main": "dist/index.js",
|
5 |
"types": "dist/index.d.ts",
|
6 |
"type": "module",
|
7 |
-
"version": "0.2.
|
8 |
"description": "Convert a script to a clap file",
|
9 |
"scripts": {
|
10 |
"test": "bun test --preload ./src/tests/setup.js",
|
@@ -15,16 +15,12 @@
|
|
15 |
"update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build"
|
16 |
},
|
17 |
"devDependencies": {
|
18 |
-
"@aitube/io": "
|
19 |
"bun-types": "latest",
|
20 |
"prettier": "^3.3.3",
|
21 |
"rimraf": "^6.0.1",
|
22 |
"typescript": "^5.5.4"
|
23 |
},
|
24 |
-
"peerDependencies": {
|
25 |
-
"@aitube/clap": "file:../clap",
|
26 |
-
"@aitube/colors": "file:../colors"
|
27 |
-
},
|
28 |
"repository": {
|
29 |
"type": "git",
|
30 |
"url": "https://github.com/jbilcke-hf/aitube-broadway.git"
|
|
|
4 |
"main": "dist/index.js",
|
5 |
"types": "dist/index.d.ts",
|
6 |
"type": "module",
|
7 |
+
"version": "0.2.4",
|
8 |
"description": "Convert a script to a clap file",
|
9 |
"scripts": {
|
10 |
"test": "bun test --preload ./src/tests/setup.js",
|
|
|
15 |
"update": "rm -Rf node_modules && rm bun.lockb && bun i && bun run build"
|
16 |
},
|
17 |
"devDependencies": {
|
18 |
+
"@aitube/io": "workspace:*",
|
19 |
"bun-types": "latest",
|
20 |
"prettier": "^3.3.3",
|
21 |
"rimraf": "^6.0.1",
|
22 |
"typescript": "^5.5.4"
|
23 |
},
|
|
|
|
|
|
|
|
|
24 |
"repository": {
|
25 |
"type": "git",
|
26 |
"url": "https://github.com/jbilcke-hf/aitube-broadway.git"
|
packages/broadway/src/parsers/utils/getParserItemFromLabel.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { ClapSegmentCategory } from "@aitube/clap"
|
2 |
|
3 |
import { NamedEntity } from "@/types"
|
4 |
|
@@ -33,7 +33,7 @@ export const getParserItemFromLabel = (database: NamedEntity[]) => {
|
|
33 |
return defaultEmptyItem
|
34 |
}
|
35 |
|
36 |
-
const prompts: Partial<Record<
|
37 |
typeof item.prompts === "undefined" ? defaultEmptyItem.prompts! : item.prompts
|
38 |
|
39 |
return {
|
|
|
1 |
+
// import { ClapSegmentCategory } from "@aitube/clap"
|
2 |
|
3 |
import { NamedEntity } from "@/types"
|
4 |
|
|
|
33 |
return defaultEmptyItem
|
34 |
}
|
35 |
|
36 |
+
const prompts: Partial<Record<any, string[]>> =
|
37 |
typeof item.prompts === "undefined" ? defaultEmptyItem.prompts! : item.prompts
|
38 |
|
39 |
return {
|
packages/broadway/src/types.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { ScreenplaySequenceType } from "@/constants/screenplaySequences"
|
2 |
-
import { ClapSegmentCategory } from "@aitube/clap"
|
3 |
|
4 |
export type NamedEntity = {
|
5 |
label: string
|
@@ -7,7 +7,7 @@ export type NamedEntity = {
|
|
7 |
en: string[]
|
8 |
}
|
9 |
prompts: Omit<
|
10 |
-
Record<
|
11 |
"SPLAT" | "INTERFACE" | "EVENT" | "EFFECT" | "PHENOMENON" | "MESH" | "DEPTH" | "VIDEO" | "STORYBOARD" | "GENERIC"
|
12 |
>
|
13 |
}
|
|
|
1 |
import { ScreenplaySequenceType } from "@/constants/screenplaySequences"
|
2 |
+
// import { ClapSegmentCategory } from "@aitube/clap"
|
3 |
|
4 |
export type NamedEntity = {
|
5 |
label: string
|
|
|
7 |
en: string[]
|
8 |
}
|
9 |
prompts: Omit<
|
10 |
+
Record<any, string[]>,
|
11 |
"SPLAT" | "INTERFACE" | "EVENT" | "EFFECT" | "PHENOMENON" | "MESH" | "DEPTH" | "VIDEO" | "STORYBOARD" | "GENERIC"
|
12 |
>
|
13 |
}
|
packages/clap/bun.lockb
DELETED
Binary file (17.3 kB)
|
|
packages/clap/package.json
CHANGED
@@ -2,9 +2,10 @@
|
|
2 |
"name": "@aitube/clap",
|
3 |
"module": "index.ts",
|
4 |
"main": "dist/index.js",
|
|
|
5 |
"types": "dist/index.d.ts",
|
6 |
"type": "module",
|
7 |
-
"version": "0.2.
|
8 |
"description": "Types and helpers to manipulate .clap files",
|
9 |
"scripts": {
|
10 |
"build": "bun build ./src/index.ts --outfile=dist/index.js --external=yaml && bun run build:declaration",
|
@@ -43,4 +44,4 @@
|
|
43 |
"dist/*.d.ts",
|
44 |
"dist/**/*.d.ts"
|
45 |
]
|
46 |
-
}
|
|
|
2 |
"name": "@aitube/clap",
|
3 |
"module": "index.ts",
|
4 |
"main": "dist/index.js",
|
5 |
+
"private": false,
|
6 |
"types": "dist/index.d.ts",
|
7 |
"type": "module",
|
8 |
+
"version": "0.2.4",
|
9 |
"description": "Types and helpers to manipulate .clap files",
|
10 |
"scripts": {
|
11 |
"build": "bun build ./src/index.ts --outfile=dist/index.js --external=yaml && bun run build:declaration",
|
|
|
44 |
"dist/*.d.ts",
|
45 |
"dist/**/*.d.ts"
|
46 |
]
|
47 |
+
}
|
packages/clap/src/constants/index.ts
CHANGED
@@ -1 +1 @@
|
|
1 |
-
export { defaultMediaOrientation } from "
|
|
|
1 |
+
export { defaultMediaOrientation } from "@/constants/defaultValues"
|
packages/clap/src/converters/index.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
export { blobToDataUri } from '
|
2 |
-
export { clapToDataUri } from '
|
3 |
-
export { dataUriToBlob } from '
|
|
|
1 |
+
export { blobToDataUri } from '@/converters/blobToDataUri'
|
2 |
+
export { clapToDataUri } from '@/converters/clapToDataUri'
|
3 |
+
export { dataUriToBlob } from '@/converters/dataUriToBlob'
|
packages/clap/src/factories/index.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
export { newClap } from '
|
2 |
-
export { newEntity } from '
|
3 |
-
export { newSegment } from '
|
4 |
-
export { newWorkflow } from '
|
|
|
1 |
+
export { newClap } from '@/factories/newClap'
|
2 |
+
export { newEntity } from '@/factories/newEntity'
|
3 |
+
export { newSegment } from '@/factories/newSegment'
|
4 |
+
export { newWorkflow } from '@/factories/newWorkflow'
|
packages/clap/src/factories/newSegment.ts
CHANGED
@@ -3,7 +3,7 @@ import { isValidNumber } from "@/utils/isValidNumber"
|
|
3 |
import { generateSeed } from "@/utils/generateSeed"
|
4 |
import { UUID } from "@/utils/uuid"
|
5 |
import { parseSegmentCategory } from "@/utils/parseSegmentCategory"
|
6 |
-
import { parseOutputType } from "
|
7 |
|
8 |
export function newSegment(maybeSegment?: Partial<ClapSegment>) {
|
9 |
|
|
|
3 |
import { generateSeed } from "@/utils/generateSeed"
|
4 |
import { UUID } from "@/utils/uuid"
|
5 |
import { parseSegmentCategory } from "@/utils/parseSegmentCategory"
|
6 |
+
import { parseOutputType } from "@/index"
|
7 |
|
8 |
export function newSegment(maybeSegment?: Partial<ClapSegment>) {
|
9 |
|
packages/clap/src/helpers/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
export { buildEntityIndex } from '
|
2 |
-
export { filterAssets } from '
|
3 |
-
export { filterSegmentsByCategory } from '
|
4 |
-
export { getEmptyClap } from '
|
5 |
-
export { generateClapFromSimpleStory } from '
|
6 |
-
export { removeGeneratedAssetUrls } from '
|
|
|
1 |
+
export { buildEntityIndex } from '@/helpers/buildEntityIndex'
|
2 |
+
export { filterAssets } from '@/helpers/filterAssets'
|
3 |
+
export { filterSegmentsByCategory } from '@/helpers/filterSegmentsByCategory'
|
4 |
+
export { getEmptyClap } from '@/helpers/getEmptyClap'
|
5 |
+
export { generateClapFromSimpleStory } from '@/helpers/generateClapFromSimpleStory'
|
6 |
+
export { removeGeneratedAssetUrls } from '@/helpers/removeGeneratedAssetUrls'
|
packages/clap/src/index.ts
CHANGED
@@ -37,22 +37,22 @@ export {
|
|
37 |
ClapWorkflowCategory,
|
38 |
ClapWorkflowProvider,
|
39 |
ClapWorkflow
|
40 |
-
} from '
|
41 |
export {
|
42 |
defaultMediaOrientation
|
43 |
-
} from '
|
44 |
export {
|
45 |
newClap,
|
46 |
newEntity,
|
47 |
newSegment,
|
48 |
newWorkflow
|
49 |
-
} from '
|
50 |
export {
|
51 |
parseClap,
|
52 |
serializeClap,
|
53 |
fetchClap,
|
54 |
updateClap
|
55 |
-
} from '
|
56 |
export {
|
57 |
filterSegments,
|
58 |
filterSegmentsWithinRange,
|
@@ -68,12 +68,12 @@ export {
|
|
68 |
parseSegmentCategory,
|
69 |
parseSegmentStatus,
|
70 |
UUID
|
71 |
-
} from '
|
72 |
export {
|
73 |
blobToDataUri,
|
74 |
dataUriToBlob,
|
75 |
clapToDataUri
|
76 |
-
} from '
|
77 |
export {
|
78 |
buildEntityIndex,
|
79 |
filterAssets,
|
@@ -81,7 +81,7 @@ export {
|
|
81 |
generateClapFromSimpleStory,
|
82 |
getEmptyClap,
|
83 |
removeGeneratedAssetUrls,
|
84 |
-
} from '
|
85 |
export {
|
86 |
sanitizeEntities,
|
87 |
sanitizeEntity,
|
@@ -90,4 +90,4 @@ export {
|
|
90 |
sanitizeSegments,
|
91 |
sanitizeWorkflow,
|
92 |
sanitizeWorkflows,
|
93 |
-
} from '
|
|
|
37 |
ClapWorkflowCategory,
|
38 |
ClapWorkflowProvider,
|
39 |
ClapWorkflow
|
40 |
+
} from '@/types'
|
41 |
export {
|
42 |
defaultMediaOrientation
|
43 |
+
} from '@/constants'
|
44 |
export {
|
45 |
newClap,
|
46 |
newEntity,
|
47 |
newSegment,
|
48 |
newWorkflow
|
49 |
+
} from '@/factories'
|
50 |
export {
|
51 |
parseClap,
|
52 |
serializeClap,
|
53 |
fetchClap,
|
54 |
updateClap
|
55 |
+
} from '@/io'
|
56 |
export {
|
57 |
filterSegments,
|
58 |
filterSegmentsWithinRange,
|
|
|
68 |
parseSegmentCategory,
|
69 |
parseSegmentStatus,
|
70 |
UUID
|
71 |
+
} from '@/utils'
|
72 |
export {
|
73 |
blobToDataUri,
|
74 |
dataUriToBlob,
|
75 |
clapToDataUri
|
76 |
+
} from '@/converters'
|
77 |
export {
|
78 |
buildEntityIndex,
|
79 |
filterAssets,
|
|
|
81 |
generateClapFromSimpleStory,
|
82 |
getEmptyClap,
|
83 |
removeGeneratedAssetUrls,
|
84 |
+
} from '@/helpers'
|
85 |
export {
|
86 |
sanitizeEntities,
|
87 |
sanitizeEntity,
|
|
|
90 |
sanitizeSegments,
|
91 |
sanitizeWorkflow,
|
92 |
sanitizeWorkflows,
|
93 |
+
} from '@/sanitizers'
|
packages/clap/src/io/index.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
export { parseClap } from '
|
2 |
-
export { serializeClap } from '
|
3 |
-
export { fetchClap } from '
|
4 |
-
export { updateClap } from '
|
|
|
1 |
+
export { parseClap } from '@/io/parseClap'
|
2 |
+
export { serializeClap } from '@/io/serializeClap'
|
3 |
+
export { fetchClap } from '@/io/fetchClap'
|
4 |
+
export { updateClap } from '@/io/updateClap'
|
packages/clap/src/io/parseClap.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import YAML from "yaml"
|
2 |
|
3 |
-
import { ClapHeader, ClapMeta, ClapEntity, ClapProject, ClapScene, ClapSegment, ClapFormat, ParseClapProgressUpdate, ClapWorkflow } from "
|
4 |
-
import { dataUriToBlob } from "
|
5 |
import { buildEntityIndex } from "@/helpers/buildEntityIndex"
|
6 |
import { sanitizeWorkflows } from "@/sanitizers/sanitizeWorkflows"
|
7 |
import { sanitizeEntities } from "@/sanitizers/sanitizeEntities"
|
|
|
1 |
import YAML from "yaml"
|
2 |
|
3 |
+
import { ClapHeader, ClapMeta, ClapEntity, ClapProject, ClapScene, ClapSegment, ClapFormat, ParseClapProgressUpdate, ClapWorkflow } from "@/types"
|
4 |
+
import { dataUriToBlob } from "@/converters/dataUriToBlob"
|
5 |
import { buildEntityIndex } from "@/helpers/buildEntityIndex"
|
6 |
import { sanitizeWorkflows } from "@/sanitizers/sanitizeWorkflows"
|
7 |
import { sanitizeEntities } from "@/sanitizers/sanitizeEntities"
|
packages/clap/src/sanitizers/index.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
export { sanitizeEntities } from "
|
2 |
-
export { sanitizeEntity } from "
|
3 |
-
export { sanitizeMeta } from "
|
4 |
-
export { sanitizeSegment } from "
|
5 |
-
export { sanitizeSegments } from "
|
6 |
-
export { sanitizeWorkflow } from "
|
7 |
-
export { sanitizeWorkflows } from "
|
|
|
1 |
+
export { sanitizeEntities } from "@/sanitizers/sanitizeEntities"
|
2 |
+
export { sanitizeEntity } from "@/sanitizers/sanitizeEntity"
|
3 |
+
export { sanitizeMeta } from "@/sanitizers/sanitizeMeta"
|
4 |
+
export { sanitizeSegment } from "@/sanitizers/sanitizeSegment"
|
5 |
+
export { sanitizeSegments } from "@/sanitizers/sanitizeSegments"
|
6 |
+
export { sanitizeWorkflow } from "@/sanitizers/sanitizeWorkflow"
|
7 |
+
export { sanitizeWorkflows } from "@/sanitizers/sanitizeWorkflows"
|
packages/clap/src/sanitizers/sanitizeEntities.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { ClapEntity } from "@/types";
|
2 |
-
import { sanitizeEntity } from "
|
3 |
|
4 |
export function sanitizeEntities(maybeEntities: ClapEntity[] = []): ClapEntity[] {
|
5 |
return maybeEntities.map(entity => sanitizeEntity(entity))
|
|
|
1 |
import { ClapEntity } from "@/types";
|
2 |
+
import { sanitizeEntity } from "@/sanitizers/sanitizeEntity";
|
3 |
|
4 |
export function sanitizeEntities(maybeEntities: ClapEntity[] = []): ClapEntity[] {
|
5 |
return maybeEntities.map(entity => sanitizeEntity(entity))
|
packages/clap/src/sanitizers/sanitizeSegments.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { ClapSegment } from "@/types";
|
2 |
-
import { sanitizeSegment } from "
|
3 |
|
4 |
export function sanitizeSegments(maybeSegments: ClapSegment[] = []): ClapSegment[] {
|
5 |
return maybeSegments.map(segment => sanitizeSegment(segment))
|
|
|
1 |
import { ClapSegment } from "@/types";
|
2 |
+
import { sanitizeSegment } from "@/sanitizers/sanitizeSegment";
|
3 |
|
4 |
export function sanitizeSegments(maybeSegments: ClapSegment[] = []): ClapSegment[] {
|
5 |
return maybeSegments.map(segment => sanitizeSegment(segment))
|
packages/clap/src/sanitizers/sanitizeWorkflows.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { ClapWorkflow } from "@/types";
|
2 |
-
import { sanitizeWorkflow } from "
|
3 |
|
4 |
export function sanitizeWorkflows(maybeWorkflows: ClapWorkflow[] = []): ClapWorkflow[] {
|
5 |
return maybeWorkflows.map(workflow => sanitizeWorkflow(workflow))
|
|
|
1 |
import { ClapWorkflow } from "@/types";
|
2 |
+
import { sanitizeWorkflow } from "@/sanitizers/sanitizeWorkflow";
|
3 |
|
4 |
export function sanitizeWorkflows(maybeWorkflows: ClapWorkflow[] = []): ClapWorkflow[] {
|
5 |
return maybeWorkflows.map(workflow => sanitizeWorkflow(workflow))
|
packages/clap/src/utils/filterSegments.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { ClapSegment, ClapSegmentCategory, ClapSegmentFilteringMode } from "@/types"
|
2 |
-
import { filterSegmentsWithinRange } from "
|
3 |
|
4 |
/**
|
5 |
* Return all the segments within the provided reference segment, for the given mode:
|
|
|
1 |
import { ClapSegment, ClapSegmentCategory, ClapSegmentFilteringMode } from "@/types"
|
2 |
+
import { filterSegmentsWithinRange } from "@/utils/filterSegmentsWithinRange"
|
3 |
|
4 |
/**
|
5 |
* Return all the segments within the provided reference segment, for the given mode:
|
packages/clap/src/utils/index.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
export { filterSegments } from '
|
2 |
-
export { filterSegmentsWithinRange } from '
|
3 |
-
export { generateSeed } from '
|
4 |
-
export { getClapAssetSourceType } from '
|
5 |
-
export { getValidNumber } from '
|
6 |
-
export { isValidNumber } from '
|
7 |
-
export { parseMediaOrientation } from '
|
8 |
-
export { parseOutputType } from '
|
9 |
-
export { parseSegmentCategory } from '
|
10 |
-
export { parseSegmentStatus } from '
|
11 |
-
export { parseWorkflowEngine } from '
|
12 |
-
export { parseWorkflowCategory } from '
|
13 |
-
export { parseWorkflowProvider } from '
|
14 |
-
export { UUID } from '
|
|
|
1 |
+
export { filterSegments } from '@/utils/filterSegments'
|
2 |
+
export { filterSegmentsWithinRange } from '@/utils/filterSegmentsWithinRange'
|
3 |
+
export { generateSeed } from '@/utils/generateSeed'
|
4 |
+
export { getClapAssetSourceType } from '@/utils/getClapAssetSourceType'
|
5 |
+
export { getValidNumber } from '@/utils/getValidNumber'
|
6 |
+
export { isValidNumber } from '@/utils/isValidNumber'
|
7 |
+
export { parseMediaOrientation } from '@/utils/parseMediaOrientation'
|
8 |
+
export { parseOutputType } from '@/utils/parseOutputType'
|
9 |
+
export { parseSegmentCategory } from '@/utils/parseSegmentCategory'
|
10 |
+
export { parseSegmentStatus } from '@/utils/parseSegmentStatus'
|
11 |
+
export { parseWorkflowEngine } from '@/utils/parseWorkflowEngine'
|
12 |
+
export { parseWorkflowCategory } from '@/utils/parseWorkflowCategory'
|
13 |
+
export { parseWorkflowProvider } from '@/utils/parseWorkflowProvider'
|
14 |
+
export { UUID } from '@/utils/uuid'
|
packages/clap/src/utils/parseSegmentCategory.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { ClapSegmentCategory } from "
|
2 |
|
3 |
export function parseSegmentCategory(input: any, defaultCategory?: ClapSegmentCategory): ClapSegmentCategory {
|
4 |
|
|
|
1 |
+
import { ClapSegmentCategory } from "../types"
|
2 |
|
3 |
export function parseSegmentCategory(input: any, defaultCategory?: ClapSegmentCategory): ClapSegmentCategory {
|
4 |
|
packages/{services → clapper-services}/.gitignore
RENAMED
File without changes
|
packages/{services → clapper-services}/.npmignore
RENAMED
File without changes
|