tuna-agent 0.1.135 → 0.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { AgentWebSocketClient } from './ws-client.js';
9
9
  export interface AnalyzeVideoResult {
10
+ source_title: string;
10
11
  duration_sec: number;
11
12
  language: string;
12
13
  transcript: string;
@@ -232,6 +232,14 @@ export async function analyzeVideo(url, onProgress) {
232
232
  progress('Đang tải video...');
233
233
  console.log('[analyze_video] Downloading:', url);
234
234
  await run(YT_DLP, ['-f', 'best[height<=720]/best', '-o', videoPath, '--no-playlist', '--quiet', url]);
235
+ // Grab the original video title (metadata only, no extra download) so the
236
+ // clone idea gets a real name instead of "Clone: www.youtube.com".
237
+ let source_title = '';
238
+ try {
239
+ const t = await run(YT_DLP, ['--skip-download', '--no-warnings', '--no-playlist', '--print', '%(title)s', url]);
240
+ source_title = (t.out || '').trim().split('\n')[0].slice(0, 200);
241
+ }
242
+ catch { /* title is best-effort — analysis still proceeds without it */ }
235
243
  progress('Đang tách audio...');
236
244
  console.log('[analyze_video] Extracting audio');
237
245
  await run(FFMPEG, ['-y', '-i', videoPath, '-vn', '-ar', '16000', '-ac', '1', '-b:a', '64k', audioPath, '-loglevel', 'error']);
@@ -399,6 +407,7 @@ export async function analyzeVideo(url, onProgress) {
399
407
  }
400
408
  const scenes = sceneResults.sort((a, b) => a.scene_number - b.scene_number);
401
409
  return {
410
+ source_title,
402
411
  duration_sec: Math.round(durationSec),
403
412
  language: transcript.language || 'unknown',
404
413
  transcript: transcript.text || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.135",
3
+ "version": "0.1.136",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"