jbilcke-hf HF staff commited on
Commit
6419aeb
·
1 Parent(s): 135382f

upgrade dependencies

Browse files
package-lock.json CHANGED
@@ -8,9 +8,9 @@
8
  "name": "@aitube/website",
9
  "version": "0.0.0",
10
  "dependencies": {
11
- "@aitube/clap": "0.0.7",
12
- "@aitube/client": "0.0.7",
13
- "@aitube/engine": "^0.0.0",
14
  "@huggingface/hub": "0.12.3-oauth",
15
  "@huggingface/inference": "^2.6.7",
16
  "@jcoreio/async-throttle": "^1.6.0",
@@ -117,9 +117,9 @@
117
  }
118
  },
119
  "node_modules/@aitube/clap": {
120
- "version": "0.0.7",
121
- "resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.7.tgz",
122
- "integrity": "sha512-0muPu4G1sRsNqSVZ/ICBCc4QibZ9OT33ORbahPP1+h3GYcD/7K+ZLYJjdbQwJWVEcpKDosDVaQKeNYdab0S0LA==",
123
  "dependencies": {
124
  "pure-uuid": "^1.8.1",
125
  "yaml": "^2.4.1"
@@ -129,29 +129,19 @@
129
  }
130
  },
131
  "node_modules/@aitube/client": {
132
- "version": "0.0.7",
133
- "resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.7.tgz",
134
- "integrity": "sha512-s6vxst7pkLt7tI96JS508gfk4EgdLJy5Itr76ej/zvtMRMgnKgAlfB6Bb8/1u7L5CToz4Wgk6h4kz8T+yEbEeg==",
135
- "dependencies": {
136
- "uuid": "^9.0.1",
137
- "yaml": "^2.4.1"
138
- },
139
  "peerDependencies": {
140
- "@aitube/clap": "0.0.7",
141
- "typescript": "^5.4.5"
142
  }
143
  },
144
  "node_modules/@aitube/engine": {
145
- "version": "0.0.0",
146
- "resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.0.tgz",
147
- "integrity": "sha512-3yOAXXCUf6pehdB2t1Nt/F4CC2biC9LA3LZK1d7PwmEA4cahP5q5sb2P1633mSrX7ElJEFkXIsKdEz6hltIP2Q==",
148
- "dependencies": {
149
- "uuid": "^9.0.1",
150
- "yaml": "^2.4.1"
151
- },
152
  "peerDependencies": {
153
- "@aitube/clap": "0.0.7",
154
- "typescript": "^5.4.5"
155
  }
156
  },
157
  "node_modules/@alloc/quick-lru": {
@@ -166,9 +156,9 @@
166
  }
167
  },
168
  "node_modules/@babel/runtime": {
169
- "version": "7.24.4",
170
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.4.tgz",
171
- "integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==",
172
  "dependencies": {
173
  "regenerator-runtime": "^0.14.0"
174
  },
@@ -219,9 +209,9 @@
219
  "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
220
  },
221
  "node_modules/@emotion/unitless": {
222
- "version": "0.8.0",
223
- "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz",
224
- "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw=="
225
  },
226
  "node_modules/@eslint-community/eslint-utils": {
227
  "version": "4.4.0",
@@ -1530,9 +1520,9 @@
1530
  }
1531
  },
1532
  "node_modules/@mediapipe/tasks-vision": {
1533
- "version": "0.10.13-rc.20240428",
1534
- "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.13-rc.20240428.tgz",
1535
- "integrity": "sha512-YMOshYcwxzLNNNEKSs4hWVTRjtuX+irWIjsbENrOee491t/oM1a9bnhggMdWLq0FBQ7xuCfvp1diu/JeZFoE0A=="
1536
  },
1537
  "node_modules/@next/env": {
1538
  "version": "14.2.3",
@@ -3260,9 +3250,9 @@
3260
  }
3261
  },
3262
  "node_modules/alchemy-sdk": {
3263
- "version": "3.2.1",
3264
- "resolved": "https://registry.npmjs.org/alchemy-sdk/-/alchemy-sdk-3.2.1.tgz",
3265
- "integrity": "sha512-ytCllr0E3TZxlYT2o/+i8AVEFJwRS7msXYvS3f/L47VEemkv0Hpz09XTqbjOcfur2PooEMcD8rn5oKrbwLyFrQ==",
3266
  "dependencies": {
3267
  "@ethersproject/abi": "^5.7.0",
3268
  "@ethersproject/abstract-provider": "^5.7.0",
@@ -3750,9 +3740,9 @@
3750
  }
3751
  },
3752
  "node_modules/caniuse-lite": {
3753
- "version": "1.0.30001614",
3754
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001614.tgz",
3755
- "integrity": "sha512-jmZQ1VpmlRwHgdP1/uiKzgiAuGOfLEJsYFP4+GBou/QQ4U6IOJCB4NP1c+1p9RGLpwObcT94jA5/uO+F1vBbog==",
3756
  "funding": [
3757
  {
3758
  "type": "opencollective",
@@ -4324,9 +4314,9 @@
4324
  "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
4325
  },
4326
  "node_modules/electron-to-chromium": {
4327
- "version": "1.4.750",
4328
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.750.tgz",
4329
- "integrity": "sha512-9ItEpeu15hW5m8jKdriL+BQrgwDTXEL9pn4SkillWFu73ZNNNQ2BKKLS+ZHv2vC9UkNhosAeyfxOf/5OSeTCPA=="
4330
  },
4331
  "node_modules/elliptic": {
4332
  "version": "6.5.4",
@@ -5428,11 +5418,12 @@
5428
  }
5429
  },
5430
  "node_modules/globalthis": {
5431
- "version": "1.0.3",
5432
- "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
5433
- "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==",
5434
  "dependencies": {
5435
- "define-properties": "^1.1.3"
 
5436
  },
5437
  "engines": {
5438
  "node": ">= 0.4"
@@ -6531,9 +6522,9 @@
6531
  }
6532
  },
6533
  "node_modules/node-gyp-build": {
6534
- "version": "4.8.0",
6535
- "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz",
6536
- "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==",
6537
  "bin": {
6538
  "node-gyp-build": "bin.js",
6539
  "node-gyp-build-optional": "optional.js",
@@ -6694,9 +6685,9 @@
6694
  }
6695
  },
6696
  "node_modules/openai": {
6697
- "version": "4.38.5",
6698
- "resolved": "https://registry.npmjs.org/openai/-/openai-4.38.5.tgz",
6699
- "integrity": "sha512-Ym5GJL98ZhLJJ7enBx53jjG3vwN/fsB+Ozh46nnRZZS9W1NiYqbwkJ+sXd3dkCIiWIgcyyOPL2Zr8SQAzbpj3g==",
6700
  "dependencies": {
6701
  "@types/node": "^18.11.18",
6702
  "@types/node-fetch": "^2.6.4",
@@ -7460,9 +7451,9 @@
7460
  }
7461
  },
7462
  "node_modules/runcss": {
7463
- "version": "0.1.6",
7464
- "resolved": "https://registry.npmjs.org/runcss/-/runcss-0.1.6.tgz",
7465
- "integrity": "sha512-RyG7VVUxZi8+ynXA4YFH7N6uXK0QgULKTEEMmeUkK/uhfNGiQitWRKQp5b+1AEKu4/QTslFEx7wu971vQQk9Tg=="
7466
  },
7467
  "node_modules/safe-array-concat": {
7468
  "version": "1.1.2",
@@ -7910,12 +7901,12 @@
7910
  "integrity": "sha512-NnzSOEKyv4I83qbuKw9ROtJrrT6Z/Xt7I0HiP/e6H6GnpeTDvzwGIGeJ8slai+VwODSHQDooW2CAilJwT9SpRg=="
7911
  },
7912
  "node_modules/styled-components": {
7913
- "version": "6.1.8",
7914
- "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.8.tgz",
7915
- "integrity": "sha512-PQ6Dn+QxlWyEGCKDS71NGsXoVLKfE1c3vApkvDYS5KAK+V8fNWGhbSUEo9Gg2iaID2tjLXegEW3bZDUGpofRWw==",
7916
  "dependencies": {
7917
  "@emotion/is-prop-valid": "1.2.1",
7918
- "@emotion/unitless": "0.8.0",
7919
  "@types/stylis": "4.2.0",
7920
  "css-to-react-native": "3.2.0",
7921
  "csstype": "3.1.2",
@@ -8313,9 +8304,9 @@
8313
  }
8314
  },
8315
  "node_modules/type-fest": {
8316
- "version": "4.18.0",
8317
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.0.tgz",
8318
- "integrity": "sha512-+dbmiyliDY/2TTcjCS7NpI9yV2iEFlUDk5TKnsbkN7ZoRu5s7bT+zvYtNFhFXC2oLwURGT2frACAZvbbyNBI+w==",
8319
  "engines": {
8320
  "node": ">=16"
8321
  },
@@ -8432,9 +8423,9 @@
8432
  "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
8433
  },
8434
  "node_modules/update-browserslist-db": {
8435
- "version": "1.0.13",
8436
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
8437
- "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
8438
  "funding": [
8439
  {
8440
  "type": "opencollective",
@@ -8450,7 +8441,7 @@
8450
  }
8451
  ],
8452
  "dependencies": {
8453
- "escalade": "^3.1.1",
8454
  "picocolors": "^1.0.0"
8455
  },
8456
  "bin": {
 
8
  "name": "@aitube/website",
9
  "version": "0.0.0",
10
  "dependencies": {
11
+ "@aitube/clap": "0.0.10",
12
+ "@aitube/client": "0.0.11",
13
+ "@aitube/engine": "0.0.2",
14
  "@huggingface/hub": "0.12.3-oauth",
15
  "@huggingface/inference": "^2.6.7",
16
  "@jcoreio/async-throttle": "^1.6.0",
 
117
  }
118
  },
119
  "node_modules/@aitube/clap": {
120
+ "version": "0.0.10",
121
+ "resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.10.tgz",
122
+ "integrity": "sha512-pj855yWhUJ0QTJIaxMJhg0PwC3JaHsScJ5rQ8iqog7zDBWNNJR9MPBtFDYRuIs3vmUsGVxHwSlIBz5I1VjMF8w==",
123
  "dependencies": {
124
  "pure-uuid": "^1.8.1",
125
  "yaml": "^2.4.1"
 
129
  }
130
  },
131
  "node_modules/@aitube/client": {
132
+ "version": "0.0.11",
133
+ "resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.11.tgz",
134
+ "integrity": "sha512-MqgLN/VxZ6BmHovCSIE8SqR+NpC8U2j1aGrxob6+yBUOsmjBm81cwRtv861jgz0LM3aVXOJsM03EJDFgUnigQQ==",
 
 
 
 
135
  "peerDependencies": {
136
+ "@aitube/clap": "0.0.10"
 
137
  }
138
  },
139
  "node_modules/@aitube/engine": {
140
+ "version": "0.0.2",
141
+ "resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.2.tgz",
142
+ "integrity": "sha512-k+H91R8tP6cgR5E2yLkF0g2esKk1EI9jwaqF+YrEdPiRcEFNUUhwBER9XkkWp7ySDLUWumgiZgCCmVC4OnBmVQ==",
 
 
 
 
143
  "peerDependencies": {
144
+ "@aitube/clap": "0.0.10"
 
145
  }
146
  },
147
  "node_modules/@alloc/quick-lru": {
 
156
  }
157
  },
158
  "node_modules/@babel/runtime": {
159
+ "version": "7.24.5",
160
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz",
161
+ "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==",
162
  "dependencies": {
163
  "regenerator-runtime": "^0.14.0"
164
  },
 
209
  "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
210
  },
211
  "node_modules/@emotion/unitless": {
212
+ "version": "0.8.1",
213
+ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz",
214
+ "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ=="
215
  },
216
  "node_modules/@eslint-community/eslint-utils": {
217
  "version": "4.4.0",
 
1520
  }
1521
  },
1522
  "node_modules/@mediapipe/tasks-vision": {
1523
+ "version": "0.10.13-rc.20240503",
1524
+ "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.13-rc.20240503.tgz",
1525
+ "integrity": "sha512-1ExneS7QNyKFCROGJ9A04B89ofFMga/m0ANLiD8yQeHJC7jZKSnWlaC+QxOwdIN4pV+uvMoQO4TPDpuqGlVEpw=="
1526
  },
1527
  "node_modules/@next/env": {
1528
  "version": "14.2.3",
 
3250
  }
3251
  },
3252
  "node_modules/alchemy-sdk": {
3253
+ "version": "3.3.0",
3254
+ "resolved": "https://registry.npmjs.org/alchemy-sdk/-/alchemy-sdk-3.3.0.tgz",
3255
+ "integrity": "sha512-g9AstE3NMC7ot2vhLhtoLTVCRik1O7TGMDd1DBAWpZl8N/uReYwYJrVBO6b9+GAybmrNudxqy4C4DL2HB58Kiw==",
3256
  "dependencies": {
3257
  "@ethersproject/abi": "^5.7.0",
3258
  "@ethersproject/abstract-provider": "^5.7.0",
 
3740
  }
3741
  },
3742
  "node_modules/caniuse-lite": {
3743
+ "version": "1.0.30001615",
3744
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001615.tgz",
3745
+ "integrity": "sha512-1IpazM5G3r38meiae0bHRnPhz+CBQ3ZLqbQMtrg+AsTPKAXgW38JNsXkyZ+v8waCsDmPq87lmfun5Q2AGysNEQ==",
3746
  "funding": [
3747
  {
3748
  "type": "opencollective",
 
4314
  "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
4315
  },
4316
  "node_modules/electron-to-chromium": {
4317
+ "version": "1.4.755",
4318
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.755.tgz",
4319
+ "integrity": "sha512-9nop+3jZxSHIxe1EzEUcjDXzK+3qOv3fY5w0sE88nIZUntbv1aXWmoxGWlklX5XSO4txCpLssWkUSh8RQPovBg=="
4320
  },
4321
  "node_modules/elliptic": {
4322
  "version": "6.5.4",
 
5418
  }
5419
  },
5420
  "node_modules/globalthis": {
5421
+ "version": "1.0.4",
5422
+ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
5423
+ "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
5424
  "dependencies": {
5425
+ "define-properties": "^1.2.1",
5426
+ "gopd": "^1.0.1"
5427
  },
5428
  "engines": {
5429
  "node": ">= 0.4"
 
6522
  }
6523
  },
6524
  "node_modules/node-gyp-build": {
6525
+ "version": "4.8.1",
6526
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz",
6527
+ "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==",
6528
  "bin": {
6529
  "node-gyp-build": "bin.js",
6530
  "node-gyp-build-optional": "optional.js",
 
6685
  }
6686
  },
6687
  "node_modules/openai": {
6688
+ "version": "4.40.2",
6689
+ "resolved": "https://registry.npmjs.org/openai/-/openai-4.40.2.tgz",
6690
+ "integrity": "sha512-r9AIaYQNHw8HGJpnny6Rcu/0moGUVqvpv0wTJfP0hKlk8ja5DVUMUCdPWEVfg7lxQMC+wIh+Qjp3onDIhVBemA==",
6691
  "dependencies": {
6692
  "@types/node": "^18.11.18",
6693
  "@types/node-fetch": "^2.6.4",
 
7451
  }
7452
  },
7453
  "node_modules/runcss": {
7454
+ "version": "0.1.7",
7455
+ "resolved": "https://registry.npmjs.org/runcss/-/runcss-0.1.7.tgz",
7456
+ "integrity": "sha512-6o3Mtdgk5bJ6RPq3N46YjLKniOsw8Su+ezfZcS1Os+t57kMKuy+HBe0/BUxgmfgKLwcqeOX70uM5c65kvQv/Gg=="
7457
  },
7458
  "node_modules/safe-array-concat": {
7459
  "version": "1.1.2",
 
7901
  "integrity": "sha512-NnzSOEKyv4I83qbuKw9ROtJrrT6Z/Xt7I0HiP/e6H6GnpeTDvzwGIGeJ8slai+VwODSHQDooW2CAilJwT9SpRg=="
7902
  },
7903
  "node_modules/styled-components": {
7904
+ "version": "6.1.9",
7905
+ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.9.tgz",
7906
+ "integrity": "sha512-aBOqs0uMsYufFXSE4q6cA6Ty1fwZuMk4BJRHfiGSna59F1otnxiDelwhN4fEwmBtIymmF0ZqXHnpSigr2ps9Cg==",
7907
  "dependencies": {
7908
  "@emotion/is-prop-valid": "1.2.1",
7909
+ "@emotion/unitless": "0.8.1",
7910
  "@types/stylis": "4.2.0",
7911
  "css-to-react-native": "3.2.0",
7912
  "csstype": "3.1.2",
 
8304
  }
8305
  },
8306
  "node_modules/type-fest": {
8307
+ "version": "4.18.1",
8308
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.1.tgz",
8309
+ "integrity": "sha512-qXhgeNsX15bM63h5aapNFcQid9jRF/l3ojDoDFmekDQEUufZ9U4ErVt6SjDxnHp48Ltrw616R8yNc3giJ3KvVQ==",
8310
  "engines": {
8311
  "node": ">=16"
8312
  },
 
8423
  "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
8424
  },
8425
  "node_modules/update-browserslist-db": {
8426
+ "version": "1.0.14",
8427
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.14.tgz",
8428
+ "integrity": "sha512-JixKH8GR2pWYshIPUg/NujK3JO7JiqEEUiNArE86NQyrgUuZeTlZQN3xuS/yiV5Kb48ev9K6RqNkaJjXsdg7Jw==",
8429
  "funding": [
8430
  {
8431
  "type": "opencollective",
 
8441
  }
8442
  ],
8443
  "dependencies": {
8444
+ "escalade": "^3.1.2",
8445
  "picocolors": "^1.0.0"
8446
  },
8447
  "bin": {
package.json CHANGED
@@ -10,9 +10,9 @@
10
  "lint": "next lint"
11
  },
12
  "dependencies": {
13
- "@aitube/clap": "0.0.7",
14
- "@aitube/client": "0.0.7",
15
- "@aitube/engine": "^0.0.0",
16
  "@huggingface/hub": "0.12.3-oauth",
17
  "@huggingface/inference": "^2.6.7",
18
  "@jcoreio/async-throttle": "^1.6.0",
 
10
  "lint": "next lint"
11
  },
12
  "dependencies": {
13
+ "@aitube/clap": "0.0.10",
14
+ "@aitube/client": "0.0.11",
15
+ "@aitube/engine": "0.0.2",
16
  "@huggingface/hub": "0.12.3-oauth",
17
  "@huggingface/inference": "^2.6.7",
18
  "@jcoreio/async-throttle": "^1.6.0",
src/app/api/v1/edit/dialogues/processShot.ts CHANGED
@@ -1,8 +1,7 @@
1
 
2
- import { ClapProject, ClapSegment, getClapAssetSourceType } from "@aitube/clap"
3
  import { getSpeechBackgroundAudioPrompt } from "@aitube/engine"
4
 
5
- import { startOfSegment1IsWithinSegment2 } from "@/lib/utils/startOfSegment1IsWithinSegment2"
6
  import { generateSpeechWithParlerTTS } from "@/app/api/generators/speech/generateVoiceWithParlerTTS"
7
  import { getMediaInfo } from "@/app/api/utils/getMediaInfo"
8
 
@@ -14,20 +13,22 @@ export async function processShot({
14
  clap: ClapProject
15
  }): Promise<void> {
16
 
17
- const shotSegments: ClapSegment[] = clap.segments.filter(s =>
18
- startOfSegment1IsWithinSegment2(s, shotSegment)
 
 
19
  )
20
-
21
  const shotDialogueSegments: ClapSegment[] = shotSegments.filter(s =>
22
  s.category === "dialogue"
23
  )
24
 
25
  let shotDialogueSegment: ClapSegment | undefined = shotDialogueSegments.at(0)
26
 
27
- console.log(`[api/generate/dialogues] processShot: shot [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}] has ${shotSegments.length} segments (${shotDialogueSegments.length} dialogues)`)
28
 
29
  if (shotDialogueSegment && !shotDialogueSegment.assetUrl) {
30
- // console.log(`[api/generate/dialogues] generating audio..`)
31
 
32
  try {
33
  // this generates a mp3
@@ -52,12 +53,12 @@ export async function processShot({
52
  }
53
 
54
  } catch (err) {
55
- console.log(`[api/generate/dialogues] processShot: failed to generate audio: ${err}`)
56
  throw err
57
  }
58
 
59
- console.log(`[api/generate/dialogues] processShot: generated dialogue audio: ${shotDialogueSegment?.assetUrl?.slice?.(0, 50)}...`)
60
  } else {
61
- console.log(`[api/generate/dialogues] processShot: there is already a dialogue audio: ${shotDialogueSegment?.assetUrl?.slice?.(0, 50)}...`)
62
  }
63
  }
 
1
 
2
+ import { ClapProject, ClapSegment, getClapAssetSourceType, filterSegments, ClapSegmentFilteringMode } from "@aitube/clap"
3
  import { getSpeechBackgroundAudioPrompt } from "@aitube/engine"
4
 
 
5
  import { generateSpeechWithParlerTTS } from "@/app/api/generators/speech/generateVoiceWithParlerTTS"
6
  import { getMediaInfo } from "@/app/api/utils/getMediaInfo"
7
 
 
13
  clap: ClapProject
14
  }): Promise<void> {
15
 
16
+ const shotSegments: ClapSegment[] = filterSegments(
17
+ ClapSegmentFilteringMode.START,
18
+ shotSegment,
19
+ clap.segments
20
  )
21
+
22
  const shotDialogueSegments: ClapSegment[] = shotSegments.filter(s =>
23
  s.category === "dialogue"
24
  )
25
 
26
  let shotDialogueSegment: ClapSegment | undefined = shotDialogueSegments.at(0)
27
 
28
+ console.log(`[api/edit/dialogues] processShot: shot [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}] has ${shotSegments.length} segments (${shotDialogueSegments.length} dialogues)`)
29
 
30
  if (shotDialogueSegment && !shotDialogueSegment.assetUrl) {
31
+ // console.log(`[api/edit/dialogues] generating audio..`)
32
 
33
  try {
34
  // this generates a mp3
 
53
  }
54
 
55
  } catch (err) {
56
+ console.log(`[api/edit/dialogues] processShot: failed to generate audio: ${err}`)
57
  throw err
58
  }
59
 
60
+ console.log(`[api/edit/dialogues] processShot: generated dialogue audio: ${shotDialogueSegment?.assetUrl?.slice?.(0, 50)}...`)
61
  } else {
62
+ console.log(`[api/edit/dialogues] processShot: there is already a dialogue audio: ${shotDialogueSegment?.assetUrl?.slice?.(0, 50)}...`)
63
  }
64
  }
src/app/api/v1/edit/dialogues/route.ts CHANGED
@@ -17,10 +17,10 @@ export async function POST(req: NextRequest) {
17
 
18
  if (!clap?.segments) { throw new Error(`no segment found in the provided clap!`) }
19
 
20
- console.log(`[api/generate/dialogues] detected ${clap.segments.length} segments`)
21
 
22
  const shotsSegments: ClapSegment[] = clap.segments.filter(s => s.category === "camera")
23
- console.log(`[api/generate/dialogues] detected ${shotsSegments.length} shots`)
24
 
25
  if (shotsSegments.length > 32) {
26
  throw new Error(`Error, this endpoint being synchronous, it is designed for short stories only (max 32 shots).`)
@@ -34,7 +34,7 @@ export async function POST(req: NextRequest) {
34
  })
35
  ))
36
 
37
- // console.log(`[api/generate/dialogues] returning the clap augmented with dialogues`)
38
 
39
  return new NextResponse(await serializeClap(clap), {
40
  status: 200,
 
17
 
18
  if (!clap?.segments) { throw new Error(`no segment found in the provided clap!`) }
19
 
20
+ console.log(`[api/edit/dialogues] detected ${clap.segments.length} segments`)
21
 
22
  const shotsSegments: ClapSegment[] = clap.segments.filter(s => s.category === "camera")
23
+ console.log(`[api/edit/dialogues] detected ${shotsSegments.length} shots`)
24
 
25
  if (shotsSegments.length > 32) {
26
  throw new Error(`Error, this endpoint being synchronous, it is designed for short stories only (max 32 shots).`)
 
34
  })
35
  ))
36
 
37
+ // console.log(`[api/edit/dialogues] returning the clap augmented with dialogues`)
38
 
39
  return new NextResponse(await serializeClap(clap), {
40
  status: 200,
src/app/api/v1/edit/entities/route.ts CHANGED
@@ -6,6 +6,9 @@ import { getToken } from "@/app/api/auth/getToken"
6
 
7
  import { generateImageID } from "./generateImageID"
8
  import { generateAudioID } from "./generateAudioID"
 
 
 
9
 
10
  export async function POST(req: NextRequest) {
11
 
@@ -25,7 +28,14 @@ export async function POST(req: NextRequest) {
25
  if (!prompt.length) { throw new Error(`please provide a prompt`) }
26
  */
27
 
28
- console.log("[api/generate/entities] request:", prompt)
 
 
 
 
 
 
 
29
 
30
  const jwtToken = await getToken({ user: "anonymous" })
31
 
@@ -68,7 +78,7 @@ export async function POST(req: NextRequest) {
68
  }
69
  }
70
 
71
- console.log(`[api/generate/entities] returning the clap extended with the entities`)
72
 
73
  return new NextResponse(await serializeClap(clap), {
74
  status: 200,
 
6
 
7
  import { generateImageID } from "./generateImageID"
8
  import { generateAudioID } from "./generateAudioID"
9
+ import { ClapCompletionMode } from "../types"
10
+
11
+ const defaultMode: ClapCompletionMode = "full"
12
 
13
  export async function POST(req: NextRequest) {
14
 
 
28
  if (!prompt.length) { throw new Error(`please provide a prompt`) }
29
  */
30
 
31
+
32
+ let mode = defaultMode
33
+ try {
34
+ let maybeMode = decodeURIComponent(query?.mode?.toString() || defaultMode).trim()
35
+ mode = ["partial", "full"].includes(maybeMode) ? (maybeMode as ClapCompletionMode) : "full"
36
+ } catch (err) {}
37
+
38
+ console.log("[api/edit/entities] request:", prompt)
39
 
40
  const jwtToken = await getToken({ user: "anonymous" })
41
 
 
78
  }
79
  }
80
 
81
+ console.log(`[api/edit/entities] returning the clap extended with the entities`)
82
 
83
  return new NextResponse(await serializeClap(clap), {
84
  status: 200,
src/app/api/v1/edit/storyboards/processShot.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { ClapProject, ClapSegment, getClapAssetSourceType, newSegment, parseClap, serializeClap } from "@aitube/clap"
2
- import { getVideoPrompt } from "@aitube/engine"
3
 
4
- import { startOfSegment1IsWithinSegment2 } from "@/lib/utils/startOfSegment1IsWithinSegment2"
5
 
6
  import { getPositivePrompt } from "@/app/api/utils/imagePrompts"
7
  import { generateStoryboard } from "./generateStoryboard"
@@ -14,8 +13,10 @@ export async function processShot({
14
  clap: ClapProject
15
  }): Promise<void> {
16
 
17
- const shotSegments: ClapSegment[] = clap.segments.filter(s =>
18
- startOfSegment1IsWithinSegment2(s, shotSegment)
 
 
19
  )
20
 
21
  const shotStoryboardSegments: ClapSegment[] = shotSegments.filter(s =>
 
1
+ import { ClapProject, ClapSegment, getClapAssetSourceType, newSegment, filterSegments, ClapSegmentFilteringMode } from "@aitube/clap"
 
2
 
3
+ import { getVideoPrompt } from "@aitube/engine"
4
 
5
  import { getPositivePrompt } from "@/app/api/utils/imagePrompts"
6
  import { generateStoryboard } from "./generateStoryboard"
 
13
  clap: ClapProject
14
  }): Promise<void> {
15
 
16
+ const shotSegments: ClapSegment[] = filterSegments(
17
+ ClapSegmentFilteringMode.START,
18
+ shotSegment,
19
+ clap.segments
20
  )
21
 
22
  const shotStoryboardSegments: ClapSegment[] = shotSegments.filter(s =>
src/app/api/v1/edit/types.ts ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ export type ClapCompletionMode =
2
+ // the full .clap is returned, containing both previous data and also new entries
3
+ // this isn't the most optimized mode, obviously
4
+ | "full"
5
+
6
+ // only changes are
7
+ | "partial"
8
+
src/app/api/v1/edit/videos/processShot.ts CHANGED
@@ -1,10 +1,7 @@
1
- import { NextResponse, NextRequest } from "next/server"
2
 
3
- import { ClapProject, ClapSegment, getClapAssetSourceType, newSegment, parseClap, serializeClap } from "@aitube/clap"
4
  import { getVideoPrompt } from "@aitube/engine"
5
 
6
- import { startOfSegment1IsWithinSegment2 } from "@/lib/utils/startOfSegment1IsWithinSegment2"
7
- import { getToken } from "@/app/api/auth/getToken"
8
  import { getPositivePrompt } from "@/app/api/utils/imagePrompts"
9
 
10
  import { generateVideo } from "./generateVideo"
@@ -16,8 +13,10 @@ export async function processShot({
16
  shotSegment: ClapSegment
17
  clap: ClapProject
18
  }): Promise<void> {
19
- const shotSegments: ClapSegment[] = clap.segments.filter(s =>
20
- startOfSegment1IsWithinSegment2(s, shotSegment)
 
 
21
  )
22
 
23
  const shotVideoSegments: ClapSegment[] = shotSegments.filter(s =>
@@ -26,7 +25,7 @@ export async function processShot({
26
 
27
  let shotVideoSegment: ClapSegment | undefined = shotVideoSegments.at(0)
28
 
29
- console.log(`[api/generate/videos] processShot: shot [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}] has ${shotSegments.length} segments (${shotVideoSegments.length} videos)`)
30
 
31
  // TASK 1: GENERATE MISSING VIDEO SEGMENT
32
  if (!shotVideoSegment) {
@@ -45,7 +44,7 @@ export async function processShot({
45
  clap.segments.push(shotVideoSegment)
46
  }
47
 
48
- console.log(`[api/generate/videos] processShot: generated video segment [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}]`)
49
  }
50
 
51
  if (!shotVideoSegment) {
@@ -56,12 +55,12 @@ export async function processShot({
56
  if (!shotVideoSegment?.prompt) {
57
  // video is missing, let's generate it
58
  shotVideoSegment.prompt = getVideoPrompt(shotSegments, clap.entityIndex, ["high quality", "crisp", "detailed"])
59
- console.log(`[api/generate/videos] processShot: generating video prompt: ${shotVideoSegment.prompt}`)
60
  }
61
 
62
  // TASK 3: GENERATE MISSING VIDEO FILE
63
  if (!shotVideoSegment.assetUrl) {
64
- console.log(`[api/generate/videos] processShot: generating video file..`)
65
 
66
  try {
67
  shotVideoSegment.assetUrl = await generateVideo({
@@ -71,12 +70,12 @@ export async function processShot({
71
  })
72
  shotVideoSegment.assetSourceType = getClapAssetSourceType(shotVideoSegment.assetUrl)
73
  } catch (err) {
74
- console.log(`[api/generate/videos] processShot: failed to generate a video file: ${err}`)
75
  throw err
76
  }
77
 
78
- console.log(`[api/generate/videos] processShot: generated video files: ${shotVideoSegment?.assetUrl?.slice?.(0, 50)}...`)
79
  } else {
80
- console.log(`[api/generate/videos] processShot: there is already a video file: ${shotVideoSegment?.assetUrl?.slice?.(0, 50)}...`)
81
  }
82
  }
 
 
1
 
2
+ import { ClapProject, ClapSegment, getClapAssetSourceType, newSegment,filterSegments, ClapSegmentFilteringMode } from "@aitube/clap"
3
  import { getVideoPrompt } from "@aitube/engine"
4
 
 
 
5
  import { getPositivePrompt } from "@/app/api/utils/imagePrompts"
6
 
7
  import { generateVideo } from "./generateVideo"
 
13
  shotSegment: ClapSegment
14
  clap: ClapProject
15
  }): Promise<void> {
16
+ const shotSegments: ClapSegment[] = filterSegments(
17
+ ClapSegmentFilteringMode.START,
18
+ shotSegment,
19
+ clap.segments
20
  )
21
 
22
  const shotVideoSegments: ClapSegment[] = shotSegments.filter(s =>
 
25
 
26
  let shotVideoSegment: ClapSegment | undefined = shotVideoSegments.at(0)
27
 
28
+ console.log(`[api/edit/videos] processShot: shot [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}] has ${shotSegments.length} segments (${shotVideoSegments.length} videos)`)
29
 
30
  // TASK 1: GENERATE MISSING VIDEO SEGMENT
31
  if (!shotVideoSegment) {
 
44
  clap.segments.push(shotVideoSegment)
45
  }
46
 
47
+ console.log(`[api/edit/videos] processShot: generated video segment [${shotSegment.startTimeInMs}:${shotSegment.endTimeInMs}]`)
48
  }
49
 
50
  if (!shotVideoSegment) {
 
55
  if (!shotVideoSegment?.prompt) {
56
  // video is missing, let's generate it
57
  shotVideoSegment.prompt = getVideoPrompt(shotSegments, clap.entityIndex, ["high quality", "crisp", "detailed"])
58
+ console.log(`[api/edit/videos] processShot: generating video prompt: ${shotVideoSegment.prompt}`)
59
  }
60
 
61
  // TASK 3: GENERATE MISSING VIDEO FILE
62
  if (!shotVideoSegment.assetUrl) {
63
+ console.log(`[api/edit/videos] processShot: generating video file..`)
64
 
65
  try {
66
  shotVideoSegment.assetUrl = await generateVideo({
 
70
  })
71
  shotVideoSegment.assetSourceType = getClapAssetSourceType(shotVideoSegment.assetUrl)
72
  } catch (err) {
73
+ console.log(`[api/edit/videos] processShot: failed to generate a video file: ${err}`)
74
  throw err
75
  }
76
 
77
+ console.log(`[api/edit/videos] processShot: generated video files: ${shotVideoSegment?.assetUrl?.slice?.(0, 50)}...`)
78
  } else {
79
+ console.log(`[api/edit/videos] processShot: there is already a video file: ${shotVideoSegment?.assetUrl?.slice?.(0, 50)}...`)
80
  }
81
  }
src/app/api/v1/edit/videos/route.ts CHANGED
@@ -24,10 +24,10 @@ export async function POST(req: NextRequest) {
24
 
25
  if (!clap?.segments) { throw new Error(`no segment found in the provided clap!`) }
26
 
27
- console.log(`[api/generate/videos] detected ${clap.segments.length} segments`)
28
 
29
  const shotsSegments: ClapSegment[] = clap.segments.filter(s => s.category === "camera")
30
- console.log(`[api/generate/videos] detected ${shotsSegments.length} shots`)
31
 
32
  if (shotsSegments.length > 32) {
33
  throw new Error(`Error, this endpoint being synchronous, it is designed for short stories only (max 32 shots).`)
@@ -41,7 +41,7 @@ export async function POST(req: NextRequest) {
41
  })
42
  ))
43
 
44
- console.log(`[api/generate/videos] returning the clap augmented with videos`)
45
 
46
  return new NextResponse(await serializeClap(clap), {
47
  status: 200,
 
24
 
25
  if (!clap?.segments) { throw new Error(`no segment found in the provided clap!`) }
26
 
27
+ console.log(`[api/edit/videos] detected ${clap.segments.length} segments`)
28
 
29
  const shotsSegments: ClapSegment[] = clap.segments.filter(s => s.category === "camera")
30
+ console.log(`[api/edit/videos] detected ${shotsSegments.length} shots`)
31
 
32
  if (shotsSegments.length > 32) {
33
  throw new Error(`Error, this endpoint being synchronous, it is designed for short stories only (max 32 shots).`)
 
41
  })
42
  ))
43
 
44
+ console.log(`[api/edit/videos] returning the clap augmented with videos`)
45
 
46
  return new NextResponse(await serializeClap(clap), {
47
  status: 200,
src/lib/utils/startOfSegment1IsWithinSegment2.ts DELETED
@@ -1,6 +0,0 @@
1
- import { ClapSegment } from "@aitube/clap"
2
-
3
- export function startOfSegment1IsWithinSegment2(s1: ClapSegment, s2: ClapSegment) {
4
- const startOfSegment1 = s1.startTimeInMs
5
- return s2.startTimeInMs <= startOfSegment1 && startOfSegment1 <= s2.endTimeInMs
6
- }