graphifyy 0.3.17 → 0.3.28

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/dist/index.d.cts CHANGED
@@ -6,7 +6,8 @@ declare enum FileType {
6
6
  CODE = "code",
7
7
  DOCUMENT = "document",
8
8
  PAPER = "paper",
9
- IMAGE = "image"
9
+ IMAGE = "image",
10
+ VIDEO = "video"
10
11
  }
11
12
  /** Confidence level for extracted relationships. */
12
13
  type Confidence = "EXTRACTED" | "INFERRED" | "AMBIGUOUS";
@@ -154,12 +155,15 @@ declare function assertValid(data: unknown): void;
154
155
  * using an explicit `seen` set keyed on node.id.
155
156
  */
156
157
 
157
- declare function buildFromJson(extraction: Extraction): Graph;
158
+ interface BuildOptions {
159
+ directed?: boolean;
160
+ }
161
+ declare function buildFromJson(extraction: Extraction, options?: BuildOptions): Graph;
158
162
  /**
159
163
  * Merge multiple extraction results into one graph.
160
164
  * Extractions are merged in order — last attributes win for duplicate node IDs.
161
165
  */
162
- declare function build(extractions: Extraction[]): Graph;
166
+ declare function build(extractions: Extraction[], options?: BuildOptions): Graph;
163
167
 
164
168
  type NumericMapLike<T> = Map<number, T> | Record<number | string, T>;
165
169
  type StringMapLike<T> = Map<string, T> | Record<string, T>;
@@ -200,6 +204,7 @@ type CommunityLabelsInput = NumericMapLike<string>;
200
204
  type CommunityLabelOptions = {
201
205
  communityLabels?: CommunityLabelsInput;
202
206
  };
207
+ type JsonOptions = CommunityLabelOptions;
203
208
  type SvgOptions = CommunityLabelOptions & {
204
209
  figsize?: [number, number];
205
210
  };
@@ -212,7 +217,7 @@ type Neo4jPushOptions = {
212
217
  password: string;
213
218
  communities?: NumericMapLike<string[]>;
214
219
  };
215
- declare function toJson(G: Graph, communities: NumericMapLike<string[]>, outputPath: string): void;
220
+ declare function toJson(G: Graph, communities: NumericMapLike<string[]>, outputPath: string, communityLabelsOrOptions?: CommunityLabelsInput | JsonOptions): void;
216
221
  declare function toCypher(G: Graph, outputPath: string): void;
217
222
  declare function pushToNeo4j(G: Graph, optionsOrUri: Neo4jPushOptions | string, user?: string, password?: string, communities?: NumericMapLike<string[]>): Promise<{
218
223
  nodes: number;
@@ -253,7 +258,12 @@ declare function collectFiles(target: string, options?: {
253
258
  followSymlinks?: boolean;
254
259
  }): string[];
255
260
 
256
- /** SHA256 of file contents + resolved path. Prevents cache collisions on identical content. */
261
+ /**
262
+ * SHA256 of file contents + resolved path. Prevents cache collisions on identical content.
263
+ *
264
+ * For Markdown files, YAML frontmatter is stripped before hashing so metadata-only
265
+ * changes do not invalidate semantic extraction cache entries.
266
+ */
257
267
  declare function fileHash(filePath: string): string;
258
268
  /**
259
269
  * Return cached extraction for this file if hash matches, else null.
@@ -312,9 +322,29 @@ declare function saveQueryResult(questionOrOptions: string | {
312
322
  sourceNodes?: string[] | null;
313
323
  }, answer?: string, memoryDir?: string, queryType?: string, sourceNodes?: string[] | null): string;
314
324
 
325
+ declare function downloadAudio(url: string, outputDir: string): string;
326
+ declare function buildWhisperPrompt(godNodes: Array<{
327
+ label?: string | null;
328
+ }>): string;
329
+ declare function transcribe(videoPath: string, outputDir?: string, initialPrompt?: string, force?: boolean): Promise<string>;
330
+ declare function transcribeAll(videoFiles: string[], outputDir?: string, initialPrompt?: string, force?: boolean): Promise<string[]>;
331
+ declare function augmentDetectionWithTranscripts(detection: DetectionResult, options?: {
332
+ outputDir?: string;
333
+ initialPrompt?: string;
334
+ godNodes?: Array<{
335
+ label?: string | null;
336
+ }>;
337
+ incremental?: boolean;
338
+ whisperModel?: string;
339
+ }): Promise<{
340
+ detection: DetectionResult;
341
+ transcriptPaths: string[];
342
+ prompt: string;
343
+ }>;
344
+
315
345
  declare function serve(graphPath?: string, transport?: Transport): Promise<void>;
316
346
 
317
347
  declare function rebuildCode(watchPath: string, followSymlinks?: boolean): Promise<boolean>;
318
348
  declare function watch(watchPath: string, debounce?: number): Promise<void>;
319
349
 
320
- export { type DetectionResult, type Extraction, FileType, type GraphEdge, type GraphNode, type Hyperedge, assertValid, build, buildFromJson, checkSemanticCache, classifyFile, cluster, cohesionScore, collectFiles, detect, detectIncremental, extract, fileHash, generate as generateReport, godNodes, graphDiff, ingest, loadCached, printBenchmark, pushToNeo4j, rebuildCode, runBenchmark, safeFetch, safeFetchText, sanitizeLabel, saveCached, saveManifest, saveQueryResult, saveSemanticCache, scoreAll, serve, suggestQuestions, surprisingConnections, toCanvas, toCypher, toGraphml, toHtml, toJson, toSvg, toWiki, validateExtraction, validateGraphPath, validateUrl, watch };
350
+ export { type DetectionResult, type Extraction, FileType, type GraphEdge, type GraphNode, type Hyperedge, assertValid, augmentDetectionWithTranscripts, build, buildFromJson, buildWhisperPrompt, checkSemanticCache, classifyFile, cluster, cohesionScore, collectFiles, detect, detectIncremental, downloadAudio, extract, fileHash, generate as generateReport, godNodes, graphDiff, ingest, loadCached, printBenchmark, pushToNeo4j, rebuildCode, runBenchmark, safeFetch, safeFetchText, sanitizeLabel, saveCached, saveManifest, saveQueryResult, saveSemanticCache, scoreAll, serve, suggestQuestions, surprisingConnections, toCanvas, toCypher, toGraphml, toHtml, toJson, toSvg, toWiki, transcribe, transcribeAll, validateExtraction, validateGraphPath, validateUrl, watch };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,8 @@ declare enum FileType {
6
6
  CODE = "code",
7
7
  DOCUMENT = "document",
8
8
  PAPER = "paper",
9
- IMAGE = "image"
9
+ IMAGE = "image",
10
+ VIDEO = "video"
10
11
  }
11
12
  /** Confidence level for extracted relationships. */
12
13
  type Confidence = "EXTRACTED" | "INFERRED" | "AMBIGUOUS";
@@ -154,12 +155,15 @@ declare function assertValid(data: unknown): void;
154
155
  * using an explicit `seen` set keyed on node.id.
155
156
  */
156
157
 
157
- declare function buildFromJson(extraction: Extraction): Graph;
158
+ interface BuildOptions {
159
+ directed?: boolean;
160
+ }
161
+ declare function buildFromJson(extraction: Extraction, options?: BuildOptions): Graph;
158
162
  /**
159
163
  * Merge multiple extraction results into one graph.
160
164
  * Extractions are merged in order — last attributes win for duplicate node IDs.
161
165
  */
162
- declare function build(extractions: Extraction[]): Graph;
166
+ declare function build(extractions: Extraction[], options?: BuildOptions): Graph;
163
167
 
164
168
  type NumericMapLike<T> = Map<number, T> | Record<number | string, T>;
165
169
  type StringMapLike<T> = Map<string, T> | Record<string, T>;
@@ -200,6 +204,7 @@ type CommunityLabelsInput = NumericMapLike<string>;
200
204
  type CommunityLabelOptions = {
201
205
  communityLabels?: CommunityLabelsInput;
202
206
  };
207
+ type JsonOptions = CommunityLabelOptions;
203
208
  type SvgOptions = CommunityLabelOptions & {
204
209
  figsize?: [number, number];
205
210
  };
@@ -212,7 +217,7 @@ type Neo4jPushOptions = {
212
217
  password: string;
213
218
  communities?: NumericMapLike<string[]>;
214
219
  };
215
- declare function toJson(G: Graph, communities: NumericMapLike<string[]>, outputPath: string): void;
220
+ declare function toJson(G: Graph, communities: NumericMapLike<string[]>, outputPath: string, communityLabelsOrOptions?: CommunityLabelsInput | JsonOptions): void;
216
221
  declare function toCypher(G: Graph, outputPath: string): void;
217
222
  declare function pushToNeo4j(G: Graph, optionsOrUri: Neo4jPushOptions | string, user?: string, password?: string, communities?: NumericMapLike<string[]>): Promise<{
218
223
  nodes: number;
@@ -253,7 +258,12 @@ declare function collectFiles(target: string, options?: {
253
258
  followSymlinks?: boolean;
254
259
  }): string[];
255
260
 
256
- /** SHA256 of file contents + resolved path. Prevents cache collisions on identical content. */
261
+ /**
262
+ * SHA256 of file contents + resolved path. Prevents cache collisions on identical content.
263
+ *
264
+ * For Markdown files, YAML frontmatter is stripped before hashing so metadata-only
265
+ * changes do not invalidate semantic extraction cache entries.
266
+ */
257
267
  declare function fileHash(filePath: string): string;
258
268
  /**
259
269
  * Return cached extraction for this file if hash matches, else null.
@@ -312,9 +322,29 @@ declare function saveQueryResult(questionOrOptions: string | {
312
322
  sourceNodes?: string[] | null;
313
323
  }, answer?: string, memoryDir?: string, queryType?: string, sourceNodes?: string[] | null): string;
314
324
 
325
+ declare function downloadAudio(url: string, outputDir: string): string;
326
+ declare function buildWhisperPrompt(godNodes: Array<{
327
+ label?: string | null;
328
+ }>): string;
329
+ declare function transcribe(videoPath: string, outputDir?: string, initialPrompt?: string, force?: boolean): Promise<string>;
330
+ declare function transcribeAll(videoFiles: string[], outputDir?: string, initialPrompt?: string, force?: boolean): Promise<string[]>;
331
+ declare function augmentDetectionWithTranscripts(detection: DetectionResult, options?: {
332
+ outputDir?: string;
333
+ initialPrompt?: string;
334
+ godNodes?: Array<{
335
+ label?: string | null;
336
+ }>;
337
+ incremental?: boolean;
338
+ whisperModel?: string;
339
+ }): Promise<{
340
+ detection: DetectionResult;
341
+ transcriptPaths: string[];
342
+ prompt: string;
343
+ }>;
344
+
315
345
  declare function serve(graphPath?: string, transport?: Transport): Promise<void>;
316
346
 
317
347
  declare function rebuildCode(watchPath: string, followSymlinks?: boolean): Promise<boolean>;
318
348
  declare function watch(watchPath: string, debounce?: number): Promise<void>;
319
349
 
320
- export { type DetectionResult, type Extraction, FileType, type GraphEdge, type GraphNode, type Hyperedge, assertValid, build, buildFromJson, checkSemanticCache, classifyFile, cluster, cohesionScore, collectFiles, detect, detectIncremental, extract, fileHash, generate as generateReport, godNodes, graphDiff, ingest, loadCached, printBenchmark, pushToNeo4j, rebuildCode, runBenchmark, safeFetch, safeFetchText, sanitizeLabel, saveCached, saveManifest, saveQueryResult, saveSemanticCache, scoreAll, serve, suggestQuestions, surprisingConnections, toCanvas, toCypher, toGraphml, toHtml, toJson, toSvg, toWiki, validateExtraction, validateGraphPath, validateUrl, watch };
350
+ export { type DetectionResult, type Extraction, FileType, type GraphEdge, type GraphNode, type Hyperedge, assertValid, augmentDetectionWithTranscripts, build, buildFromJson, buildWhisperPrompt, checkSemanticCache, classifyFile, cluster, cohesionScore, collectFiles, detect, detectIncremental, downloadAudio, extract, fileHash, generate as generateReport, godNodes, graphDiff, ingest, loadCached, printBenchmark, pushToNeo4j, rebuildCode, runBenchmark, safeFetch, safeFetchText, sanitizeLabel, saveCached, saveManifest, saveQueryResult, saveSemanticCache, scoreAll, serve, suggestQuestions, surprisingConnections, toCanvas, toCypher, toGraphml, toHtml, toJson, toSvg, toWiki, transcribe, transcribeAll, validateExtraction, validateGraphPath, validateUrl, watch };