shaw commited on
Commit
68f0d00
1 Parent(s): 2109dea

Monorepo working

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +1 -1
  2. bun.lockb +0 -0
  3. package.json +43 -16
  4. packages/api-client/README.md +3 -3
  5. packages/api-client/bun.lockb +0 -0
  6. packages/api-client/package.json +2 -5
  7. packages/api-client/src/api/editClapVideos.ts +2 -2
  8. packages/app/package.json +19 -19
  9. packages/app/src/app/api/assistant/askAnyAssistant.ts +1 -1
  10. packages/app/src/app/api/resolve/providers/aitube/index.ts +1 -1
  11. packages/app/src/components/toolbars/top-menu/lists/AssistantWorkflows.tsx +1 -1
  12. packages/app/src/components/toolbars/top-menu/lists/ImageDepthWorkflows.tsx +1 -1
  13. packages/app/src/components/toolbars/top-menu/lists/ImageGenerationWorkflows.tsx +1 -1
  14. packages/app/src/components/toolbars/top-menu/lists/ImageSegmentationWorkflows.tsx +1 -1
  15. packages/app/src/components/toolbars/top-menu/lists/ImageUpscalingWorkflows.tsx +1 -1
  16. packages/app/src/components/toolbars/top-menu/lists/MusicGenerationWorkflows.tsx +1 -1
  17. packages/app/src/components/toolbars/top-menu/lists/SoundGenerationWorkflows.tsx +1 -1
  18. packages/app/src/components/toolbars/top-menu/lists/VideoDepthWorkflows.tsx +1 -1
  19. packages/app/src/components/toolbars/top-menu/lists/VideoGenerationWorkflows.tsx +1 -1
  20. packages/app/src/components/toolbars/top-menu/lists/VideoSegmentationWorkflows.tsx +1 -1
  21. packages/app/src/components/toolbars/top-menu/lists/VideoUpscalingWorkflows.tsx +1 -1
  22. packages/app/src/components/toolbars/top-menu/lists/VoiceGenerationWorkflows.tsx +1 -1
  23. packages/app/src/services/autocomplete/extractCaptionsFromFrames.ts +96 -85
  24. packages/app/src/services/autocomplete/useAutocomplete.ts +6 -6
  25. packages/app/src/services/io/ffmpegUtils.ts +1 -0
  26. packages/app/src/services/io/fix-xenova-transformers.d.ts +0 -1
  27. packages/app/tsconfig.json +1 -0
  28. packages/broadway/bun.lockb +0 -0
  29. packages/broadway/package.json +2 -6
  30. packages/broadway/src/parsers/utils/getParserItemFromLabel.ts +2 -2
  31. packages/broadway/src/types.ts +2 -2
  32. packages/clap/bun.lockb +0 -0
  33. packages/clap/package.json +3 -2
  34. packages/clap/src/constants/index.ts +1 -1
  35. packages/clap/src/converters/index.ts +3 -3
  36. packages/clap/src/factories/index.ts +4 -4
  37. packages/clap/src/factories/newSegment.ts +1 -1
  38. packages/clap/src/helpers/index.ts +6 -6
  39. packages/clap/src/index.ts +8 -8
  40. packages/clap/src/io/index.ts +4 -4
  41. packages/clap/src/io/parseClap.ts +2 -2
  42. packages/clap/src/sanitizers/index.ts +7 -7
  43. packages/clap/src/sanitizers/sanitizeEntities.ts +1 -1
  44. packages/clap/src/sanitizers/sanitizeSegments.ts +1 -1
  45. packages/clap/src/sanitizers/sanitizeWorkflows.ts +1 -1
  46. packages/clap/src/utils/filterSegments.ts +1 -1
  47. packages/clap/src/utils/index.ts +14 -14
  48. packages/clap/src/utils/parseSegmentCategory.ts +1 -1
  49. packages/{services → clapper-services}/.gitignore +0 -0
  50. 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
- "name": "@aitube/clapper-monorepo",
3
- "version": "1.0.0",
4
- "private": true,
5
- "description": "A monorepo for the Clapper project. Individual packages are in the packages directory.",
6
- "workspaces": [
7
- "packages/*"
8
- ],
9
- "scripts": {
10
- "dev": "npm install --verbose && npm run dev --workspaces",
11
- "start": "npm run start --workspaces",
12
- "build": "npm install --verbose && npm run build --workspaces",
13
- "test": "npm run test --workspaces",
14
- "format": "npm run format --workspaces"
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.3",
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.0.8",
4
  "private": true,
5
  "description": "🎬 Clapper",
6
  "license": "GPL-3.0-only",
@@ -13,35 +13,35 @@
13
  "public:": "./public"
14
  },
15
  "scripts": {
16
- "dev": "npm run checks && next dev",
17
- "build": "npm run prepare && npm run checks && rm -Rf out && next build && npm run build:copyassets",
18
- "build:ci": "rm -Rf out && npm run prepare && next build && npm run build:copyassets",
19
- "build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/.next/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": "npm run format:fix && npm 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": "npm run build && npm run test:unit:ci",
29
- "test_TEMPORARY_DISABLED": "npm run build && npm run test:unit:ci && npm run test:e2e",
30
  "test:unit:ci": "vitest run",
31
  "test:unit:watch": "vitest",
32
  "test:e2e": "npx playwright test",
33
- "electron": "npm run build && electron .",
34
- "electron:start": "npm run build && electron-forge start",
35
- "electron:package": "npm run build && electron-forge package",
36
- "electron:make": "npm run build && electron-forge make"
37
  },
38
  "dependencies": {
39
- "@aitube/broadway": "file:../broadway",
40
- "@aitube/clap": "file:../clap",
41
- "@aitube/clapper-services": "file:../services",
42
- "@aitube/client": "file:../api-client",
43
- "@aitube/engine": "file:../engine",
44
- "@aitube/timeline": "file:../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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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.map((w) => (
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
- AutoProcessor,
3
- AutoTokenizer,
4
- Florence2ForConditionalGeneration,
5
- RawImage,
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
- 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,75 +54,86 @@ export async function extractCaptionsFromFrames(
54
  progress: number,
55
  storyboardIndex: number,
56
  nbStoryboards: number
57
- ) => void
58
- ): Promise<string[]> {
59
- if (!(navigator as any).gpu) {
60
- throw new Error(`Please enable WebGPU to analyze video frames:
61
-
62
- 1. You need a modern browser such as Google Chrome 113+, Microsoft Edge 113+, Safari 18 (macOS 15), Firefox Nightly
63
 
64
- 2. You need to enable WebGPU (depends on your browser, see below)
 
 
 
 
 
 
 
 
 
65
 
66
- 2.1 For Chrome: Perform the following operations in the Chrome / Microsoft Edge address bar
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.2 For Safari 18 (macOS 15): WebGPU is enabled by default
71
 
72
- 2.3 For Firefox Nightly: Type about:config in the address bar and set 'dom.webgpu.enabled" to true
73
- `)
74
- }
75
 
76
- let progress = 0
77
 
78
- // for code example, see:
79
- // https://github.com/xenova/transformers.js/pull/545#issuecomment-2183625876
 
80
 
81
- // Load model, processor, and tokenizer
82
- const model_id = 'onnx-community/Florence-2-base-ft'
83
 
84
- const { model, processor, tokenizer } = await loadModel(model_id, (p) => {
85
- onProgress((progress = p * 15), 0, images.length)
86
- })
87
 
88
- // not all prompts will work properly, see the official examples:
89
- // https://huggingface.co/microsoft/Florence-2-base-ft/blob/e7a5acc73559546de6e12ec0319cd7cc1fa2437c/processing_florence2.py#L115-L117
90
 
91
- // Prepare text inputs
92
- const prompts = 'Describe with a paragraph what is shown in the image.'
93
- // const prompts = 'Decompose the following video frame into era, genre, location, weather, characters, and action. Give the answer in YAML.'
94
 
95
- const text_inputs = tokenizer(prompts)
 
96
 
97
- let i = 1
98
- const captions: string[] = []
99
- for (const imageInBase64DataUri of images) {
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
- console.log(' - generating caption..')
106
- // Generate text
107
- const generated_ids = await model.generate({
108
- ...text_inputs,
109
- ...vision_inputs,
110
- max_new_tokens: 100,
111
- })
112
 
113
- // Decode generated text
114
- const generated_text = tokenizer.batch_decode(generated_ids, {
115
- skip_special_tokens: true,
116
- })
 
 
 
117
 
118
- const caption = `${generated_text[0] || ''}`
119
- console.log(' - caption:', caption)
 
 
 
 
 
120
 
121
- const relativeProgress = i / images.length
 
 
 
122
 
123
- progress += relativeProgress * 75
124
- onProgress(progress, i, images.length)
125
- captions.push(caption)
126
- }
127
- return captions
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.3",
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": "file:../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<ClapSegmentCategory, string[]>> =
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<ClapSegmentCategory, string[]>,
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.3",
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 "./defaultValues"
 
1
+ export { defaultMediaOrientation } from "@/constants/defaultValues"
packages/clap/src/converters/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { blobToDataUri } from './blobToDataUri'
2
- export { clapToDataUri } from './clapToDataUri'
3
- export { dataUriToBlob } from './dataUriToBlob'
 
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 './newClap'
2
- export { newEntity } from './newEntity'
3
- export { newSegment } from './newSegment'
4
- export { newWorkflow } from './newWorkflow'
 
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 './buildEntityIndex'
2
- export { filterAssets } from './filterAssets'
3
- export { filterSegmentsByCategory } from './filterSegmentsByCategory'
4
- export { getEmptyClap } from './getEmptyClap'
5
- export { generateClapFromSimpleStory } from './generateClapFromSimpleStory'
6
- export { removeGeneratedAssetUrls } from './removeGeneratedAssetUrls'
 
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 './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,12 +68,12 @@ export {
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,7 +81,7 @@ export {
81
  generateClapFromSimpleStory,
82
  getEmptyClap,
83
  removeGeneratedAssetUrls,
84
- } from './helpers'
85
  export {
86
  sanitizeEntities,
87
  sanitizeEntity,
@@ -90,4 +90,4 @@ export {
90
  sanitizeSegments,
91
  sanitizeWorkflow,
92
  sanitizeWorkflows,
93
- } from './sanitizers'
 
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 './parseClap'
2
- export { serializeClap } from './serializeClap'
3
- export { fetchClap } from './fetchClap'
4
- export { updateClap } from './updateClap'
 
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 "../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"
 
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 "./sanitizeEntities"
2
- export { sanitizeEntity } from "./sanitizeEntity"
3
- export { sanitizeMeta } from "./sanitizeMeta"
4
- export { sanitizeSegment } from "./sanitizeSegment"
5
- export { sanitizeSegments } from "./sanitizeSegments"
6
- export { sanitizeWorkflow } from "./sanitizeWorkflow"
7
- export { sanitizeWorkflows } from "./sanitizeWorkflows"
 
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 "./sanitizeEntity";
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 "./sanitizeSegment";
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 "./sanitizeWorkflow";
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 "./filterSegmentsWithinRange"
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 './filterSegments'
2
- export { filterSegmentsWithinRange } from './filterSegmentsWithinRange'
3
- export { generateSeed } from './generateSeed'
4
- export { getClapAssetSourceType } from './getClapAssetSourceType'
5
- export { getValidNumber } from './getValidNumber'
6
- export { isValidNumber } from './isValidNumber'
7
- export { parseMediaOrientation } from './parseMediaOrientation'
8
- export { parseOutputType } from './parseOutputType'
9
- export { parseSegmentCategory } from './parseSegmentCategory'
10
- export { parseSegmentStatus } from './parseSegmentStatus'
11
- export { parseWorkflowEngine } from './parseWorkflowEngine'
12
- export { parseWorkflowCategory } from './parseWorkflowCategory'
13
- export { parseWorkflowProvider } from './parseWorkflowProvider'
14
- export { UUID } from './uuid'
 
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 "@/types"
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