@thunderkiller/video-clipper 1.5.6 → 1.7.0
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.
- package/README.md +13 -0
- package/dist/config/env.d.ts +4 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/pipeline/runner.d.ts.map +1 -1
- package/dist/pipeline/runner.js +79 -72
- package/dist/pipeline/runner.js.map +1 -1
- package/dist/pipeline/stages/segmentAnalyzer.d.ts +1 -1
- package/dist/pipeline/stages/segmentAnalyzer.d.ts.map +1 -1
- package/dist/pipeline/stages/segmentAnalyzer.js +2 -2
- package/dist/pipeline/stages/segmentAnalyzer.js.map +1 -1
- package/dist/services/clipRefiner/index.d.ts +2 -1
- package/dist/services/clipRefiner/index.d.ts.map +1 -1
- package/dist/services/clipRefiner/index.js +3 -5
- package/dist/services/clipRefiner/index.js.map +1 -1
- package/dist/services/llmAnalyzer/LLMAnalyzer.d.ts +2 -2
- package/dist/services/llmAnalyzer/LLMAnalyzer.d.ts.map +1 -1
- package/dist/services/llmAnalyzer/LLMAnalyzer.js +2 -2
- package/dist/services/llmAnalyzer/LLMAnalyzer.js.map +1 -1
- package/dist/services/llmAnalyzer/index.d.ts +3 -2
- package/dist/services/llmAnalyzer/index.d.ts.map +1 -1
- package/dist/services/llmAnalyzer/index.js +5 -7
- package/dist/services/llmAnalyzer/index.js.map +1 -1
- package/dist/services/transcriptDetector/index.d.ts +2 -2
- package/dist/services/transcriptDetector/index.d.ts.map +1 -1
- package/dist/services/transcriptDetector/index.js.map +1 -1
- package/dist/types/config.d.ts +7 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +12 -0
- package/dist/types/config.js.map +1 -1
- package/dist/utils/cache.d.ts +14 -18
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/cache.js +32 -112
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/cacheBackend.d.ts +40 -0
- package/dist/utils/cacheBackend.d.ts.map +1 -0
- package/dist/utils/cacheBackend.js +28 -0
- package/dist/utils/cacheBackend.js.map +1 -0
- package/dist/utils/cacheFactory.d.ts +14 -0
- package/dist/utils/cacheFactory.d.ts.map +1 -0
- package/dist/utils/cacheFactory.js +31 -0
- package/dist/utils/cacheFactory.js.map +1 -0
- package/dist/utils/fileCacheBackend.d.ts +33 -0
- package/dist/utils/fileCacheBackend.d.ts.map +1 -0
- package/dist/utils/fileCacheBackend.js +123 -0
- package/dist/utils/fileCacheBackend.js.map +1 -0
- package/dist/utils/mongoCacheBackend.d.ts +51 -0
- package/dist/utils/mongoCacheBackend.d.ts.map +1 -0
- package/dist/utils/mongoCacheBackend.js +176 -0
- package/dist/utils/mongoCacheBackend.js.map +1 -0
- package/package.json +21 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { MongoClient } from 'mongodb';
|
|
2
|
+
import type { TranscriptLine, LLMChunk, ChunkEvaluation, AudioEvent, SegmentRefinement } from '../types/index.js';
|
|
3
|
+
import type { CacheBackend } from './cacheBackend.js';
|
|
4
|
+
/**
|
|
5
|
+
* MongoDB-backed cache backend.
|
|
6
|
+
*
|
|
7
|
+
* Each cache category maps to one collection. Documents have the shape:
|
|
8
|
+
* { cacheKey: string, data: <payload>, createdAt: Date }
|
|
9
|
+
*
|
|
10
|
+
* Indexes created on first use (idempotent):
|
|
11
|
+
* - Unique index on `cacheKey` for O(1) lookups
|
|
12
|
+
* - TTL index on `createdAt` when `ttlSeconds > 0`
|
|
13
|
+
*
|
|
14
|
+
* All reads validate the stored payload through the same zod schemas used by
|
|
15
|
+
* the file backend, giving identical runtime safety guarantees.
|
|
16
|
+
*
|
|
17
|
+
* Pass `ttlSeconds = 0` (or omit) to disable TTL expiration.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MongoCacheBackend implements CacheBackend {
|
|
20
|
+
private readonly client;
|
|
21
|
+
private readonly db;
|
|
22
|
+
private readonly ttlSeconds;
|
|
23
|
+
/** Track which collections already have their indexes created this session. */
|
|
24
|
+
private readonly indexedCollections;
|
|
25
|
+
constructor(client: MongoClient, databaseName: string, ttlSeconds?: number);
|
|
26
|
+
/**
|
|
27
|
+
* Ensures indexes exist for a collection. Called lazily on first access per
|
|
28
|
+
* collection name. `createIndex` is idempotent so concurrent calls are safe.
|
|
29
|
+
*/
|
|
30
|
+
private ensureIndexes;
|
|
31
|
+
private readDoc;
|
|
32
|
+
private writeDoc;
|
|
33
|
+
private static readonly TRANSCRIPTS;
|
|
34
|
+
readTranscript(videoId: string): Promise<TranscriptLine[] | null>;
|
|
35
|
+
writeTranscript(videoId: string, lines: TranscriptLine[]): Promise<void>;
|
|
36
|
+
private static readonly CHUNKS;
|
|
37
|
+
private chunkKey;
|
|
38
|
+
readChunk(chunk: LLMChunk, chunkAudioEvents?: AudioEvent[]): Promise<ChunkEvaluation | null>;
|
|
39
|
+
writeChunk(chunk: LLMChunk, evaluation: ChunkEvaluation, chunkAudioEvents?: AudioEvent[]): Promise<void>;
|
|
40
|
+
private static readonly SEGMENTS;
|
|
41
|
+
readSegmentRefinement(start: number, end: number, reason: string): Promise<SegmentRefinement | null>;
|
|
42
|
+
writeSegmentRefinement(start: number, end: number, reason: string, refined: SegmentRefinement): Promise<void>;
|
|
43
|
+
private static readonly AUDIO_EVENTS;
|
|
44
|
+
readAudioEvents(videoId: string, gameProfile: string, provider: string): Promise<AudioEvent[] | null>;
|
|
45
|
+
writeAudioEvents(videoId: string, gameProfile: string, provider: string, events: AudioEvent[]): Promise<void>;
|
|
46
|
+
private static readonly AUDIO_CHUNKS;
|
|
47
|
+
readAudioChunk(videoId: string, gameProfile: string, provider: string, windowStart: number, windowEnd: number): Promise<AudioEvent[] | null>;
|
|
48
|
+
writeAudioChunk(videoId: string, gameProfile: string, provider: string, windowStart: number, windowEnd: number, events: AudioEvent[]): Promise<void>;
|
|
49
|
+
close(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=mongoCacheBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
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+
import { z } from 'zod';
|
|
3
|
+
import { log } from './logger.js';
|
|
4
|
+
import { TranscriptLineSchema, ChunkEvaluationSchema, AudioEventSchema, SegmentRefinementSchema, } from '../types/index.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Internal helpers
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
function hashContent(input) {
|
|
9
|
+
return createHash('sha256').update(input).digest('hex');
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Serializes audio events into a stable string for cache keying.
|
|
13
|
+
* Events are sorted by time so the key is order-independent.
|
|
14
|
+
*/
|
|
15
|
+
function audioEventsKey(events) {
|
|
16
|
+
if (events.length === 0)
|
|
17
|
+
return '';
|
|
18
|
+
const sorted = [...events].sort((a, b) => a.time - b.time);
|
|
19
|
+
return JSON.stringify(sorted);
|
|
20
|
+
}
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// MongoCacheBackend
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
/**
|
|
25
|
+
* MongoDB-backed cache backend.
|
|
26
|
+
*
|
|
27
|
+
* Each cache category maps to one collection. Documents have the shape:
|
|
28
|
+
* { cacheKey: string, data: <payload>, createdAt: Date }
|
|
29
|
+
*
|
|
30
|
+
* Indexes created on first use (idempotent):
|
|
31
|
+
* - Unique index on `cacheKey` for O(1) lookups
|
|
32
|
+
* - TTL index on `createdAt` when `ttlSeconds > 0`
|
|
33
|
+
*
|
|
34
|
+
* All reads validate the stored payload through the same zod schemas used by
|
|
35
|
+
* the file backend, giving identical runtime safety guarantees.
|
|
36
|
+
*
|
|
37
|
+
* Pass `ttlSeconds = 0` (or omit) to disable TTL expiration.
|
|
38
|
+
*/
|
|
39
|
+
export class MongoCacheBackend {
|
|
40
|
+
client;
|
|
41
|
+
db;
|
|
42
|
+
ttlSeconds;
|
|
43
|
+
/** Track which collections already have their indexes created this session. */
|
|
44
|
+
indexedCollections = new Set();
|
|
45
|
+
constructor(client, databaseName, ttlSeconds = 0) {
|
|
46
|
+
this.client = client;
|
|
47
|
+
this.db = client.db(databaseName);
|
|
48
|
+
this.ttlSeconds = ttlSeconds;
|
|
49
|
+
}
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Index management
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* Ensures indexes exist for a collection. Called lazily on first access per
|
|
55
|
+
* collection name. `createIndex` is idempotent so concurrent calls are safe.
|
|
56
|
+
*/
|
|
57
|
+
async ensureIndexes(collectionName) {
|
|
58
|
+
if (this.indexedCollections.has(collectionName))
|
|
59
|
+
return;
|
|
60
|
+
try {
|
|
61
|
+
const col = this.db.collection(collectionName);
|
|
62
|
+
// Unique index for O(1) cache key lookups
|
|
63
|
+
await col.createIndex({ cacheKey: 1 }, { unique: true });
|
|
64
|
+
// TTL index — only when a positive TTL is configured
|
|
65
|
+
if (this.ttlSeconds > 0) {
|
|
66
|
+
await col.createIndex({ createdAt: 1 }, { expireAfterSeconds: this.ttlSeconds });
|
|
67
|
+
}
|
|
68
|
+
this.indexedCollections.add(collectionName);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
// Non-fatal — pipeline should not crash if indexes can't be created
|
|
72
|
+
log.warn(`[mongo-cache] Failed to ensure indexes on "${collectionName}": ${err instanceof Error ? err.message : String(err)}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Low-level read / write helpers
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
async readDoc(collectionName, cacheKey, schema) {
|
|
79
|
+
try {
|
|
80
|
+
await this.ensureIndexes(collectionName);
|
|
81
|
+
const col = this.db.collection(collectionName);
|
|
82
|
+
const doc = await col.findOne({ cacheKey });
|
|
83
|
+
if (!doc)
|
|
84
|
+
return null;
|
|
85
|
+
const parsed = schema.safeParse(doc.data);
|
|
86
|
+
if (!parsed.success) {
|
|
87
|
+
log.warn(`[mongo-cache] Corrupt entry in "${collectionName}" (key=${cacheKey}) — ignoring`);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return parsed.data;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
log.warn(`[mongo-cache] Read failed in "${collectionName}": ${err instanceof Error ? err.message : String(err)}`);
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async writeDoc(collectionName, cacheKey, data) {
|
|
98
|
+
try {
|
|
99
|
+
await this.ensureIndexes(collectionName);
|
|
100
|
+
const col = this.db.collection(collectionName);
|
|
101
|
+
await col.updateOne({ cacheKey }, { $set: { cacheKey, data, createdAt: new Date() } }, { upsert: true });
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
log.warn(`[mongo-cache] Write failed in "${collectionName}": ${err instanceof Error ? err.message : String(err)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// Transcript
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
static TRANSCRIPTS = 'transcripts';
|
|
111
|
+
async readTranscript(videoId) {
|
|
112
|
+
return this.readDoc(MongoCacheBackend.TRANSCRIPTS, hashContent(videoId), z.array(TranscriptLineSchema));
|
|
113
|
+
}
|
|
114
|
+
async writeTranscript(videoId, lines) {
|
|
115
|
+
await this.writeDoc(MongoCacheBackend.TRANSCRIPTS, hashContent(videoId), lines);
|
|
116
|
+
}
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
// LLM chunk results
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
static CHUNKS = 'chunkEvaluations';
|
|
121
|
+
chunkKey(chunk, chunkAudioEvents = []) {
|
|
122
|
+
const audioKey = audioEventsKey(chunkAudioEvents);
|
|
123
|
+
return hashContent(`${chunk.start}|${chunk.end}|${chunk.text}|${audioKey}`);
|
|
124
|
+
}
|
|
125
|
+
async readChunk(chunk, chunkAudioEvents = []) {
|
|
126
|
+
return this.readDoc(MongoCacheBackend.CHUNKS, this.chunkKey(chunk, chunkAudioEvents), ChunkEvaluationSchema);
|
|
127
|
+
}
|
|
128
|
+
async writeChunk(chunk, evaluation, chunkAudioEvents = []) {
|
|
129
|
+
// Only cache successful evaluations — mirrors the file backend behaviour
|
|
130
|
+
if (evaluation.status !== 'success')
|
|
131
|
+
return;
|
|
132
|
+
await this.writeDoc(MongoCacheBackend.CHUNKS, this.chunkKey(chunk, chunkAudioEvents), evaluation);
|
|
133
|
+
}
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
// Segment refinement
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
static SEGMENTS = 'segmentRefinements';
|
|
138
|
+
async readSegmentRefinement(start, end, reason) {
|
|
139
|
+
return this.readDoc(MongoCacheBackend.SEGMENTS, hashContent(`${start}|${end}|${reason}`), SegmentRefinementSchema);
|
|
140
|
+
}
|
|
141
|
+
async writeSegmentRefinement(start, end, reason, refined) {
|
|
142
|
+
await this.writeDoc(MongoCacheBackend.SEGMENTS, hashContent(`${start}|${end}|${reason}`), refined);
|
|
143
|
+
}
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
// Audio events (whole-video)
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
static AUDIO_EVENTS = 'audioEvents';
|
|
148
|
+
async readAudioEvents(videoId, gameProfile, provider) {
|
|
149
|
+
return this.readDoc(MongoCacheBackend.AUDIO_EVENTS, hashContent(`${videoId}|${gameProfile}|${provider}`), z.array(AudioEventSchema));
|
|
150
|
+
}
|
|
151
|
+
async writeAudioEvents(videoId, gameProfile, provider, events) {
|
|
152
|
+
await this.writeDoc(MongoCacheBackend.AUDIO_EVENTS, hashContent(`${videoId}|${gameProfile}|${provider}`), events);
|
|
153
|
+
}
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// Audio events (per-chunk)
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
static AUDIO_CHUNKS = 'audioChunks';
|
|
158
|
+
async readAudioChunk(videoId, gameProfile, provider, windowStart, windowEnd) {
|
|
159
|
+
return this.readDoc(MongoCacheBackend.AUDIO_CHUNKS, hashContent(`${videoId}|${gameProfile}|${provider}|${windowStart}|${windowEnd}`), z.array(AudioEventSchema));
|
|
160
|
+
}
|
|
161
|
+
async writeAudioChunk(videoId, gameProfile, provider, windowStart, windowEnd, events) {
|
|
162
|
+
await this.writeDoc(MongoCacheBackend.AUDIO_CHUNKS, hashContent(`${videoId}|${gameProfile}|${provider}|${windowStart}|${windowEnd}`), events);
|
|
163
|
+
}
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
// Lifecycle
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
async close() {
|
|
168
|
+
try {
|
|
169
|
+
await this.client.close();
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
log.warn(`[mongo-cache] Failed to close MongoDB connection: ${err instanceof Error ? err.message : String(err)}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=mongoCacheBackend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongoCacheBackend.js","sourceRoot":"","sources":["../../src/utils/mongoCacheBackend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAuB3B,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,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,EACnB,QAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,MAAoB;QAEpB,MAAM,IAAI,CAAC,QAAQ,CACjB,iBAAiB,CAAC,YAAY,EAC9B,WAAW,CAAC,GAAG,OAAO,IAAI,WAAW,IAAI,QAAQ,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC,EAChF,MAAM,CACP,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,YAAY;IACZ,8EAA8E;IAE9E,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CACN,qDAAqD,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACxG,CAAC;QACJ,CAAC;IACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderkiller/video-clipper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "CLI that analyzes YouTube transcripts with an LLM to find interesting moments and cut clips",
|
|
5
5
|
"license": "ISC",
|
|
6
|
-
"author": "",
|
|
6
|
+
"author": "Amreet Kumar Khuntia",
|
|
7
7
|
"packageManager": "pnpm@10.12.4",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=18"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"keywords": [
|
|
13
|
+
"youtube",
|
|
14
|
+
"video-clipper",
|
|
15
|
+
"llm",
|
|
16
|
+
"transcript",
|
|
17
|
+
"ffmpeg",
|
|
18
|
+
"clips",
|
|
19
|
+
"ai",
|
|
20
|
+
"segmentation",
|
|
21
|
+
"yt-dlp",
|
|
22
|
+
"vercel-ai-sdk",
|
|
23
|
+
"video",
|
|
24
|
+
"highlights"
|
|
25
|
+
],
|
|
8
26
|
"type": "module",
|
|
9
27
|
"main": "dist/lib.js",
|
|
10
28
|
"module": "dist/lib.js",
|
|
@@ -73,6 +91,7 @@
|
|
|
73
91
|
"dotenv": "^16.4.7",
|
|
74
92
|
"execa": "^9.5.2",
|
|
75
93
|
"fluent-ffmpeg": "^2.1.3",
|
|
94
|
+
"mongodb": "^7.1.0",
|
|
76
95
|
"p-limit": "^7.3.0",
|
|
77
96
|
"zod": "^4.3.6"
|
|
78
97
|
},
|